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,3 +1,4 @@
import { ContentParser } from '@blocksuite/blocks/content-parser';
import type {
GetStaticPaths,
GetStaticProps,
@@ -61,22 +62,16 @@ const PreviewPage: NextPage<PreviewPageProps> = ({
pageId="preview"
onInit={(page, editor) => {
blockSuiteWorkspace.setPageMeta(page.id, { title });
const pageBlockId = page.addBlockByFlavour('affine:page', {
const pageBlockId = page.addBlock('affine:page', {
title: new page.Text(title),
});
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(text, frameId).then(() => {
page.resetHistory();
});
}, 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(text, frameId).then(() => {
page.resetHistory();
});
}}
/>
<StyledToolWrapper>

View File

@@ -1,6 +1,6 @@
import { useTranslation } from '@affine/i18n';
import { FolderIcon } from '@blocksuite/icons';
import { assertExists, nanoid } from '@blocksuite/store';
import { assertEquals, assertExists, nanoid } from '@blocksuite/store';
import Head from 'next/head';
import { useRouter } from 'next/router';
import React, { useCallback, useEffect } from 'react';
@@ -44,14 +44,12 @@ const AllPage: NextPageWithLayout = () => {
if (currentWorkspace.blockSuiteWorkspace.isEmpty) {
// this is a new workspace, so we should redirect to the new page
const pageId = nanoid();
currentWorkspace.blockSuiteWorkspace.slots.pageAdded.once(id => {
currentWorkspace.blockSuiteWorkspace.setPageMeta(id, {
init: true,
});
assertExists(pageId, id);
jumpToPage(currentWorkspace.id, pageId);
const page = currentWorkspace.blockSuiteWorkspace.createPage(pageId);
assertEquals(page.id, pageId);
currentWorkspace.blockSuiteWorkspace.setPageMeta(page.id, {
init: true,
});
currentWorkspace.blockSuiteWorkspace.createPage(pageId);
jumpToPage(currentWorkspace.id, pageId);
}
};
provider.callbacks.add(callback);