mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-23 09:17:06 +08:00
feat(editor): add bs affine foundation module (#12012)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced the Affine Foundation package, providing a centralized layer for initializing core UI effects, custom elements, and foundational services. - Added new foundational store and view extensions to improve core service registration and UI effect setup. - **Refactor** - Streamlined and reorganized block, store, and view extension arrays to rely on the new foundation layer, reducing duplication and simplifying extension management. - Removed redundant or now-centralized services and UI effects from existing modules. - **Chores** - Updated configuration files and workspace dependencies to support the new Affine Foundation package. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,15 +1,5 @@
|
||||
import { FileDropExtension } from '@blocksuite/affine-components/drop-indicator';
|
||||
import { NoteBlockSchema } from '@blocksuite/affine-model';
|
||||
import {
|
||||
AutoClearSelectionService,
|
||||
DNDAPIExtension,
|
||||
DocModeService,
|
||||
EmbedOptionService,
|
||||
PageViewportServiceExtension,
|
||||
ThemeService,
|
||||
ToolbarModuleExtension,
|
||||
ToolbarRegistryExtension,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { ToolbarModuleExtension } from '@blocksuite/affine-shared/services';
|
||||
import { BlockFlavourIdentifier, FlavourExtension } from '@blocksuite/std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
@@ -21,14 +11,6 @@ import { viewportOverlayWidget } from './widgets';
|
||||
|
||||
export const CommonSpecs: ExtensionType[] = [
|
||||
FlavourExtension('affine:page'),
|
||||
DocModeService,
|
||||
ThemeService,
|
||||
EmbedOptionService,
|
||||
PageViewportServiceExtension,
|
||||
DNDAPIExtension,
|
||||
FileDropExtension,
|
||||
ToolbarRegistryExtension,
|
||||
AutoClearSelectionService,
|
||||
...RootBlockAdapterExtensions,
|
||||
...clipboardConfigs,
|
||||
viewportOverlayWidget,
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { InteractivityManager } from '@blocksuite/std/gfx';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { EdgelessElementToolbarExtension } from './configs/toolbar';
|
||||
import { EdgelessRootBlockSpec } from './edgeless-root-spec.js';
|
||||
import { AltCloneExtension } from './interact-extensions/clone-ext.js';
|
||||
|
||||
export const EdgelessEditExtensions: ExtensionType[] = [InteractivityManager];
|
||||
|
||||
export const EdgelessBuiltInManager: ExtensionType[] = [
|
||||
AltCloneExtension,
|
||||
EdgelessElementToolbarExtension,
|
||||
@@ -15,5 +12,4 @@ export const EdgelessBuiltInManager: ExtensionType[] = [
|
||||
export const EdgelessBuiltInSpecs: ExtensionType[] = [
|
||||
EdgelessRootBlockSpec,
|
||||
EdgelessBuiltInManager,
|
||||
EdgelessEditExtensions,
|
||||
].flat();
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
LifeCycleWatcher,
|
||||
WidgetViewExtension,
|
||||
} from '@blocksuite/std';
|
||||
import { GfxControllerIdentifier, ToolController } from '@blocksuite/std/gfx';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/std/gfx';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
@@ -49,7 +49,6 @@ class EdgelessLocker extends LifeCycleWatcher {
|
||||
|
||||
const EdgelessCommonExtension: ExtensionType[] = [
|
||||
CommonSpecs,
|
||||
ToolController,
|
||||
EdgelessRootService,
|
||||
ViewportElementExtension('.affine-edgeless-viewport'),
|
||||
...quickTools,
|
||||
|
||||
Reference in New Issue
Block a user