mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08:00
feat!: upgrade blocksuite version (#2833)
This commit is contained in:
Vendored
+5
-3
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user