feat: support subpage (#1663)

This commit is contained in:
Qi
2023-03-23 13:47:07 +08:00
committed by GitHub
parent 2551785451
commit 6a7b5601aa
26 changed files with 824 additions and 82 deletions
+7
View File
@@ -6,6 +6,7 @@ import type { BlockSuiteWorkspace } from '../shared';
declare module '@blocksuite/store' {
interface PageMeta {
favorite?: boolean;
subpageIds: string[];
trash?: boolean;
trashDate?: number;
// whether to create the page with the default template
@@ -45,6 +46,12 @@ export function usePageMetaHelper(blockSuiteWorkspace: BlockSuiteWorkspace) {
setPageMeta: (pageId: string, pageMeta: Partial<PageMeta>) => {
blockSuiteWorkspace.meta.setPageMeta(pageId, pageMeta);
},
getPageMeta: (pageId: string) => {
return blockSuiteWorkspace.meta.getPageMeta(pageId);
},
shiftPageMeta: (pageId: string, index: number) => {
return blockSuiteWorkspace.meta.shiftPageMeta(pageId, index);
},
}),
[blockSuiteWorkspace]
);