mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
feat(editor): replace spec provider with extension manager (#11861)
Closes: BS-3273
This commit is contained in:
@@ -2,7 +2,6 @@ import { toReactNode } from '@affine/component';
|
||||
import { AIChatBlockPeekViewTemplate } from '@affine/core/blocksuite/ai';
|
||||
import type { AIChatBlockModel } from '@affine/core/blocksuite/ai/blocks/ai-chat-block/model/ai-chat-model';
|
||||
import { useAIChatConfig } from '@affine/core/components/hooks/affine/use-ai-chat-config';
|
||||
import { SpecProvider } from '@blocksuite/affine/shared/utils';
|
||||
import type { EditorHost } from '@blocksuite/affine/std';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
@@ -18,11 +17,9 @@ export const AIChatBlockPeekView = ({
|
||||
const { docDisplayConfig, searchMenuConfig, networkSearchConfig } =
|
||||
useAIChatConfig();
|
||||
return useMemo(() => {
|
||||
const previewSpecBuilder = SpecProvider._.getSpec('preview:page');
|
||||
const template = AIChatBlockPeekViewTemplate(
|
||||
model,
|
||||
host,
|
||||
previewSpecBuilder,
|
||||
docDisplayConfig,
|
||||
searchMenuConfig,
|
||||
networkSearchConfig
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SpecProvider } from '@blocksuite/affine/shared/utils';
|
||||
import { getStoreManager } from '@affine/core/blocksuite/manager/migrating-store';
|
||||
import {
|
||||
AwarenessStore,
|
||||
type Doc,
|
||||
@@ -294,11 +294,9 @@ export class DocImpl implements Doc {
|
||||
return this._storeMap.get(key) as Store;
|
||||
}
|
||||
|
||||
const storeExtensions = SpecProvider._.getSpec('store');
|
||||
const storeExtensions = getStoreManager().get('store');
|
||||
const extensionSet = new Set(
|
||||
storeExtensions.value
|
||||
.concat(extensions ?? [])
|
||||
.concat(this.storeExtensions)
|
||||
storeExtensions.concat(extensions ?? []).concat(this.storeExtensions)
|
||||
);
|
||||
|
||||
const doc = new Store({
|
||||
|
||||
Reference in New Issue
Block a user