chore: merge blocksuite source code (#9213)

This commit is contained in:
Mirone
2024-12-20 15:38:06 +08:00
committed by GitHub
parent 2c9ef916f4
commit 30200ff86d
2031 changed files with 238888 additions and 229 deletions
@@ -0,0 +1,44 @@
import { unsafeCSSVarV2 } from '@blocksuite/affine-shared/theme';
import { IS_MOBILE } from '@blocksuite/global/env';
import { html, nothing } from 'lit';
import {
type DataViewWidgetProps,
defineUniComponent,
} from '../../core/index.js';
import { ShowQuickSettingBarContextKey } from './context.js';
import { renderFilterBar } from './filter/index.js';
import { renderSortBar } from './sort/index.js';
export const widgetQuickSettingBar = defineUniComponent(
(props: DataViewWidgetProps) => {
const view = props.dataViewInstance.view;
const barList = [renderSortBar(props), renderFilterBar(props)].filter(
Boolean
);
if (!IS_MOBILE) {
if (!view.contextGet(ShowQuickSettingBarContextKey).value[view.id]) {
return html``;
}
if (!barList.length) {
return html``;
}
}
return html` <div
style="display: flex;margin-top: 8px;align-items: center;width: 100%;gap:8px"
>
${barList.map((bar, index) => {
return html`
${index !== 0
? html` <div
style="width: 1px;height:27px;background-color: ${unsafeCSSVarV2(
'layer/insideBorder/border'
)}"
></div>`
: nothing}
${bar}
`;
})}
</div>`;
}
);