mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
chore: bump version (#1618)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import markdown from '@affine/templates/Welcome-to-AFFiNE.md';
|
||||
import { ContentParser } from '@blocksuite/blocks/content-parser';
|
||||
import type { EditorContainer } from '@blocksuite/editor';
|
||||
import type { Page } from '@blocksuite/store';
|
||||
|
||||
@@ -30,12 +31,12 @@ export function initPage(page: Page, editor: Readonly<EditorContainer>): void {
|
||||
}
|
||||
|
||||
export function _initEmptyPage(page: Page, _: Readonly<EditorContainer>) {
|
||||
const pageBlockId = page.addBlockByFlavour('affine:page', {
|
||||
const pageBlockId = page.addBlock('affine:page', {
|
||||
title: new page.Text(''),
|
||||
});
|
||||
page.addBlockByFlavour('affine:surface', {}, null);
|
||||
const frameId = page.addBlockByFlavour('affine:frame', {}, pageBlockId);
|
||||
page.addBlockByFlavour('affine:paragraph', {}, frameId);
|
||||
page.addBlock('affine:surface', {}, null);
|
||||
const frameId = page.addBlock('affine:frame', {}, pageBlockId);
|
||||
page.addBlock('affine:paragraph', {}, frameId);
|
||||
}
|
||||
|
||||
export function _initPageWithDemoMarkdown(
|
||||
@@ -43,15 +44,13 @@ export function _initPageWithDemoMarkdown(
|
||||
editor: Readonly<EditorContainer>
|
||||
): void {
|
||||
logger.debug('initPageWithDefaultMarkdown', page.id);
|
||||
const pageBlockId = page.addBlockByFlavour('affine:page', {
|
||||
const pageBlockId = page.addBlock('affine:page', {
|
||||
title: new page.Text(demoTitle),
|
||||
});
|
||||
page.addBlockByFlavour('affine:surface', {}, null);
|
||||
const frameId = page.addBlockByFlavour('affine:frame', {}, pageBlockId);
|
||||
page.addBlockByFlavour('affine:paragraph', {}, frameId);
|
||||
setTimeout(() => {
|
||||
// hotfix: contentParser.importMarkdown is not working in the first render
|
||||
editor.contentParser.importMarkdown(demoText, frameId);
|
||||
}, 0);
|
||||
page.addBlock('affine:surface', {}, null);
|
||||
const frameId = page.addBlock('affine:frame', {}, pageBlockId);
|
||||
page.addBlock('affine:paragraph', {}, frameId);
|
||||
const contentParser = new ContentParser(page);
|
||||
contentParser.importMarkdown(demoText, frameId);
|
||||
page.workspace.setPageMeta(page.id, { demoTitle });
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { __unstableSchemas, builtInSchemas } from '@blocksuite/blocks/models';
|
||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||
import type { BlobOptionsGetter, Generator } from '@blocksuite/store';
|
||||
|
||||
import { BlockSuiteWorkspace } from '../shared';
|
||||
@@ -39,7 +39,7 @@ export const createEmptyBlockSuiteWorkspace = (
|
||||
blobOptionsGetter,
|
||||
idGenerator,
|
||||
})
|
||||
.register(builtInSchemas)
|
||||
.register(AffineSchemas)
|
||||
.register(__unstableSchemas);
|
||||
hashMap.set(id, workspace);
|
||||
return workspace;
|
||||
|
||||
Reference in New Issue
Block a user