mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 00:07:01 +08:00
feat(editor): replace spec provider with extension manager (#11861)
Closes: BS-3273
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
import {
|
||||
EdgelessEditorBlockSpecs,
|
||||
PageEditorBlockSpecs,
|
||||
} from '@blocksuite/affine/extensions';
|
||||
import { RefNodeSlotsProvider } from '@blocksuite/affine/inlines/reference';
|
||||
import {
|
||||
CommunityCanvasTextFonts,
|
||||
@@ -13,6 +9,7 @@ import {
|
||||
} from '@blocksuite/affine/shared/services';
|
||||
import type { ExtensionType, Store, Workspace } from '@blocksuite/affine/store';
|
||||
import { type TestAffineEditorContainer } from '@blocksuite/integration-test';
|
||||
import { getTestViewManager } from '@blocksuite/integration-test/view';
|
||||
|
||||
import {
|
||||
mockDocModeService,
|
||||
@@ -20,6 +17,8 @@ import {
|
||||
mockParseDocUrlService,
|
||||
} from '../../_common/mock-services';
|
||||
|
||||
const viewManager = getTestViewManager();
|
||||
|
||||
export function getTestCommonExtensions(
|
||||
editor: TestAffineEditorContainer
|
||||
): ExtensionType[] {
|
||||
@@ -48,8 +47,8 @@ export function createTestEditor(store: Store, workspace: Workspace) {
|
||||
editor.doc = store;
|
||||
|
||||
const defaultExtensions = getTestCommonExtensions(editor);
|
||||
editor.pageSpecs = [...PageEditorBlockSpecs, ...defaultExtensions];
|
||||
editor.edgelessSpecs = [...EdgelessEditorBlockSpecs, ...defaultExtensions];
|
||||
editor.pageSpecs = [...viewManager.get('page'), ...defaultExtensions];
|
||||
editor.edgelessSpecs = [...viewManager.get('edgeless'), ...defaultExtensions];
|
||||
|
||||
editor.std
|
||||
.get(RefNodeSlotsProvider)
|
||||
|
||||
Reference in New Issue
Block a user