refactor: init package @affine/workspace (#1661)

This commit is contained in:
Himself65
2023-03-23 11:17:38 -05:00
committed by GitHub
parent 84d27e939d
commit 69721f2a61
44 changed files with 952 additions and 236 deletions

View File

@@ -1,3 +1,4 @@
import type { WorkspaceFlavour } from '@affine/workspace/type';
import type { EditorContainer } from '@blocksuite/editor';
import type { Page } from '@blocksuite/store';
import { assertExists } from '@blocksuite/store';
@@ -6,7 +7,7 @@ import { atomWithStorage } from 'jotai/utils';
import { unstable_batchedUpdates } from 'react-dom';
import { WorkspacePlugins } from '../plugins';
import type { RemWorkspace, RemWorkspaceFlavour } from '../shared';
import type { RemWorkspace } from '../shared';
// workspace necessary atoms
export const currentWorkspaceIdAtom = atom<string | null>(null);
export const currentPageIdAtom = atom<string | null>(null);
@@ -37,7 +38,7 @@ export const jotaiStore = createStore();
type JotaiWorkspace = {
id: string;
flavour: RemWorkspaceFlavour;
flavour: WorkspaceFlavour;
};
export const jotaiWorkspacesAtom = atomWithStorage<JotaiWorkspace[]>(