feat!: upgrade blocksuite version (#2833)

This commit is contained in:
Alex Yang
2023-06-25 01:16:46 +08:00
committed by GitHub
parent aa86d3a2ee
commit 7fcc5e599e
59 changed files with 564 additions and 1064 deletions
+5 -3
View File
@@ -3,16 +3,18 @@ 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 page.waitForLoaded();
await workspace.importPageSnapshot(data['space:hello-world'], page.id);
}
export function initEmptyPage(page: Page): void {
export async function initEmptyPage(page: Page) {
await page.waitForLoaded();
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);
const noteBlockId = page.addBlock('affine:note', {}, pageBlockId);
page.addBlock('affine:paragraph', {}, noteBlockId);
}
export * from './subdoc-migration';