mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix(core): default page mode (#3745)
This commit is contained in:
@@ -1,6 +1,19 @@
|
||||
import type { PageMeta, Workspace } from '@blocksuite/store';
|
||||
import type { createStore, WritableAtom } from 'jotai/vanilla';
|
||||
|
||||
export async function buildShowcaseWorkspace(workspace: Workspace) {
|
||||
export async function buildShowcaseWorkspace(
|
||||
workspace: Workspace,
|
||||
options: {
|
||||
atoms: {
|
||||
pageMode: WritableAtom<
|
||||
undefined,
|
||||
[pageId: string, mode: 'page' | 'edgeless'],
|
||||
void
|
||||
>;
|
||||
};
|
||||
store: ReturnType<typeof createStore>;
|
||||
}
|
||||
) {
|
||||
const showcaseWorkspaceVersions = {
|
||||
'affine:code': 1,
|
||||
'affine:paragraph': 1,
|
||||
@@ -66,6 +79,11 @@ export async function buildShowcaseWorkspace(workspace: Workspace) {
|
||||
},
|
||||
};
|
||||
workspace.meta.setProperties(prototypes);
|
||||
const { store, atoms } = options;
|
||||
['F1SX6cgNxy', 'nQd2Bdvoqz'].forEach(pageId => {
|
||||
store.set(atoms.pageMode, pageId, 'edgeless');
|
||||
});
|
||||
|
||||
const pageMetas = {
|
||||
'gc5FeppNDv-hello-world': {
|
||||
createDate: 1691548231530,
|
||||
|
||||
Reference in New Issue
Block a user