mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-23 17:32:48 +08:00
19 lines
636 B
TypeScript
19 lines
636 B
TypeScript
import type { Page } from '@blocksuite/store';
|
|
|
|
export async function initPageWithPreloading(page: Page) {
|
|
const workspace = page.workspace;
|
|
const { data } = await import('@affine/templates/preloading.json');
|
|
await workspace.importPageSnapshot(data['space:hello-world'], page.id);
|
|
}
|
|
|
|
export function initEmptyPage(page: Page): void {
|
|
const pageBlockId = page.addBlock('affine:page', {
|
|
title: new page.Text(''),
|
|
});
|
|
page.addBlock('affine:surface', {}, pageBlockId);
|
|
const frameId = page.addBlock('affine:frame', {}, pageBlockId);
|
|
page.addBlock('affine:paragraph', {}, frameId);
|
|
}
|
|
|
|
export * from './subdoc-migration';
|