mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
refactor(editor): remove legacy blocksuite doc (#9521)
This commit is contained in:
@@ -11,10 +11,7 @@ import { WorkspaceService } from '@affine/core/modules/workspace';
|
||||
import { i18nTime, Trans, useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type {
|
||||
Blocks as BlockSuiteDoc,
|
||||
Workspace,
|
||||
} from '@blocksuite/affine/store';
|
||||
import type { Blocks, Workspace } from '@blocksuite/affine/store';
|
||||
import { CloseIcon, ToggleCollapseIcon } from '@blocksuite/icons/rc';
|
||||
import * as Collapsible from '@radix-ui/react-collapsible';
|
||||
import type { DialogContentProps } from '@radix-ui/react-dialog';
|
||||
@@ -90,7 +87,7 @@ const ModalContainer = ({
|
||||
interface HistoryEditorPreviewProps {
|
||||
ts?: string;
|
||||
historyList: HistoryList;
|
||||
snapshotPage?: BlockSuiteDoc;
|
||||
snapshotPage?: Blocks;
|
||||
mode: DocMode;
|
||||
onModeChange: (mode: DocMode) => void;
|
||||
title: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Blocks } from '@blocksuite/affine/store';
|
||||
import type { Map as YMap } from 'yjs';
|
||||
import type { Doc as YDoc, Map as YMap } from 'yjs';
|
||||
|
||||
/**
|
||||
* TODO(@eyhn): Define error to unexpected state together in the future.
|
||||
@@ -9,9 +9,9 @@ export class NoPageRootError extends Error {
|
||||
super('Page root not found when render editor!');
|
||||
|
||||
// Log info to let sentry collect more message
|
||||
const hasExpectSpace = Array.from(page.rootDoc.spaces.values()).some(
|
||||
doc => page.spaceDoc.guid === doc.guid
|
||||
);
|
||||
const hasExpectSpace = Array.from(
|
||||
page.rootDoc.getMap<YDoc>('spaces').values()
|
||||
).some(doc => page.spaceDoc.guid === doc.guid);
|
||||
const blocks = page.spaceDoc.getMap('blocks') as YMap<YMap<any>>;
|
||||
const havePageBlock = Array.from(blocks.values()).some(
|
||||
block => block.get('sys:flavour') === 'affine:page'
|
||||
|
||||
Reference in New Issue
Block a user