feat: new preload pages (#3674)

This commit is contained in:
Alex Yang
2023-08-10 15:56:16 -04:00
committed by GitHub
parent f06efd4d02
commit 43b35a77bb
43 changed files with 14197 additions and 6833 deletions

View File

@@ -5,7 +5,7 @@
"main": "./src/index.ts",
"module": "./src/index.ts",
"devDependencies": {
"@blocksuite/global": "0.0.0-20230810005427-25adb757-nightly",
"@blocksuite/global": "0.0.0-20230810154852-8a8eccea-nightly",
"react": "18.2.0",
"react-dom": "18.2.0",
"zod": "^3.21.4"

View File

@@ -1,12 +1,8 @@
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);
}
/**
* @deprecated
*/
export async function initEmptyPage(page: Page) {
await page.waitForLoaded();
const pageBlockId = page.addBlock('affine:page', {