chore: bump version (#1618)

This commit is contained in:
Himself65
2023-03-20 00:07:54 -05:00
committed by GitHub
parent 4e7ff3862f
commit f6c1423361
20 changed files with 199 additions and 833 deletions

View File

@@ -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 });
}

View File

@@ -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;