feat(core): unify all new created page IDs to nanoid (#4884)

This commit is contained in:
liuyi authored and GitHub committed 2023-11-09 09:22:02 +00:00
1 parent e3e0553c56
commit f9654bb1f8
4 files changed
+10 -27

No files matched your search

@@ -1,14 +1,10 @@
import type { Page, Workspace } from '@blocksuite/store';
import { useMemo } from 'react';
import { v4 as uuid } from 'uuid';
export function useBlockSuiteWorkspaceHelper(blockSuiteWorkspace: Workspace) {
return useMemo(
() => ({
createPage: (pageId?: string): Page => {
if (!pageId) {
pageId = uuid();
}
return blockSuiteWorkspace.createPage({ id: pageId });
},
}),