mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 06:47:02 +08:00
feat(editor): root block extension (#12063)
Closes: BS-3202 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new root block store and view extensions, enhancing modularity and integration options for root block functionality. - Exported the EdgelessLocker class for broader usage. - **Improvements** - Updated export paths for root block modules, enabling clearer and more flexible module access. - Enhanced view extension setup to better tailor user interface and interactions based on context. - **Removals** - Removed legacy migrating store and view extension logic, streamlining extension management and reducing unused code. - Removed multiple deprecated block specifications and common extension collections to simplify the codebase. - Deleted AI page root block specification, retaining only lifecycle watcher functionality. - **Chores** - Updated dependencies and project references to support new extension loader integration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,20 +1,9 @@
|
||||
import { PageRootBlockSpec } from '@blocksuite/affine/blocks/root';
|
||||
import { ToolbarModuleExtension } from '@blocksuite/affine/shared/services';
|
||||
import {
|
||||
BlockFlavourIdentifier,
|
||||
LifeCycleWatcher,
|
||||
} from '@blocksuite/affine/std';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import { LifeCycleWatcher } from '@blocksuite/affine/std';
|
||||
import type { FrameworkProvider } from '@toeverything/infra';
|
||||
|
||||
import { buildAIPanelConfig } from '../ai-panel';
|
||||
import { toolbarAIEntryConfig } from '../entries';
|
||||
import { setupSpaceAIEntry } from '../entries/space/setup-space';
|
||||
import {
|
||||
AffineAIPanelWidget,
|
||||
aiPanelWidget,
|
||||
} from '../widgets/ai-panel/ai-panel';
|
||||
import { AiSlashMenuConfigExtension } from './ai-slash-menu';
|
||||
import { AffineAIPanelWidget } from '../widgets/ai-panel/ai-panel';
|
||||
|
||||
export function getAIPageRootWatcher(framework: FrameworkProvider) {
|
||||
class AIPageRootWatcher extends LifeCycleWatcher {
|
||||
@@ -38,18 +27,3 @@ export function getAIPageRootWatcher(framework: FrameworkProvider) {
|
||||
}
|
||||
return AIPageRootWatcher;
|
||||
}
|
||||
|
||||
export function createAIPageRootBlockSpec(
|
||||
framework: FrameworkProvider
|
||||
): ExtensionType[] {
|
||||
return [
|
||||
...PageRootBlockSpec,
|
||||
aiPanelWidget,
|
||||
getAIPageRootWatcher(framework),
|
||||
ToolbarModuleExtension({
|
||||
id: BlockFlavourIdentifier('custom:affine:note'),
|
||||
config: toolbarAIEntryConfig(),
|
||||
}),
|
||||
AiSlashMenuConfigExtension(),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user