mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
feat(editor): brush and note gfx extension (#11927)
Closes: BS-3206 Closes: BS-3210 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new brush and note view extensions, enhancing integration and extensibility for brush and note tools. - Added store extension for brush tools, allowing for improved adapter integration. - **Improvements** - Expanded module exports for brush and note graphics, making store and view functionalities more accessible. - Added new dependencies to support extension loading and improved project structure. - **Refactor** - Updated extension arrays and toolbars to use the new view and store extensions for brush and note tools. - Removed legacy brush and note tools, effects, and toolbar extensions in favor of the new extension-based approach. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { FileDropExtension } from '@blocksuite/affine-components/drop-indicator';
|
||||
import { BrushElementRendererExtension } from '@blocksuite/affine-gfx-brush';
|
||||
import {
|
||||
ConnectorElementRendererExtension,
|
||||
ConnectorElementView,
|
||||
@@ -61,7 +60,6 @@ const EdgelessElementViews = [
|
||||
];
|
||||
|
||||
export const EdgelessElementRendererExtension: ExtensionType[] = [
|
||||
BrushElementRendererExtension,
|
||||
HighlighterElementRendererExtension,
|
||||
ShapeElementRendererExtension,
|
||||
TextElementRendererExtension,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { frameQuickTool } from '@blocksuite/affine-block-frame';
|
||||
import { penSeniorTool } from '@blocksuite/affine-gfx-brush';
|
||||
import { connectorQuickTool } from '@blocksuite/affine-gfx-connector';
|
||||
import { mindMapSeniorTool } from '@blocksuite/affine-gfx-mindmap';
|
||||
import { noteSeniorTool } from '@blocksuite/affine-gfx-note';
|
||||
import { shapeSeniorTool } from '@blocksuite/affine-gfx-shape';
|
||||
import { templateSeniorTool } from '@blocksuite/affine-gfx-template';
|
||||
import { QuickToolExtension } from '@blocksuite/affine-widget-edgeless-toolbar';
|
||||
@@ -36,8 +34,6 @@ export const quickTools = [
|
||||
];
|
||||
|
||||
export const seniorTools = [
|
||||
noteSeniorTool,
|
||||
penSeniorTool,
|
||||
shapeSeniorTool,
|
||||
mindMapSeniorTool,
|
||||
templateSeniorTool,
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { edgelessTextToolbarExtension } from '@blocksuite/affine-block-edgeless-text';
|
||||
import { frameToolbarExtension } from '@blocksuite/affine-block-frame';
|
||||
import {
|
||||
brushToolbarExtension,
|
||||
highlighterToolbarExtension,
|
||||
} from '@blocksuite/affine-gfx-brush';
|
||||
import { connectorToolbarExtension } from '@blocksuite/affine-gfx-connector';
|
||||
import { groupToolbarExtension } from '@blocksuite/affine-gfx-group';
|
||||
import {
|
||||
@@ -23,10 +19,6 @@ export const EdgelessElementToolbarExtension: ExtensionType[] = [
|
||||
|
||||
groupToolbarExtension,
|
||||
|
||||
brushToolbarExtension,
|
||||
|
||||
highlighterToolbarExtension,
|
||||
|
||||
connectorToolbarExtension,
|
||||
|
||||
shapeToolbarExtension,
|
||||
|
||||
@@ -4,11 +4,7 @@ import {
|
||||
PresentTool,
|
||||
} from '@blocksuite/affine-block-frame';
|
||||
import { ConnectionOverlay } from '@blocksuite/affine-block-surface';
|
||||
import {
|
||||
BrushTool,
|
||||
EraserTool,
|
||||
HighlighterTool,
|
||||
} from '@blocksuite/affine-gfx-brush';
|
||||
import type * as BrushEffect from '@blocksuite/affine-gfx-brush';
|
||||
import {
|
||||
ConnectorFilter,
|
||||
ConnectorTool,
|
||||
@@ -17,7 +13,7 @@ import {
|
||||
MindMapDragExtension,
|
||||
MindMapIndicatorOverlay,
|
||||
} from '@blocksuite/affine-gfx-mindmap';
|
||||
import { NoteTool } from '@blocksuite/affine-gfx-note';
|
||||
import type * as NoteEffect from '@blocksuite/affine-gfx-note';
|
||||
import { ShapeTool } from '@blocksuite/affine-gfx-shape';
|
||||
import { TemplateTool } from '@blocksuite/affine-gfx-template';
|
||||
import { TextTool } from '@blocksuite/affine-gfx-text';
|
||||
@@ -35,20 +31,18 @@ import { SnapExtension } from './interact-extensions/snap-manager.js';
|
||||
import { EditPropsMiddlewareBuilder } from './middlewares/base.js';
|
||||
import { SnapOverlay } from './utils/snap-manager.js';
|
||||
|
||||
declare type _GLOBAL_ = typeof NoteEffect | typeof BrushEffect;
|
||||
|
||||
export const EdgelessToolExtension: ExtensionType[] = [
|
||||
DefaultTool,
|
||||
PanTool,
|
||||
EraserTool,
|
||||
TextTool,
|
||||
ShapeTool,
|
||||
NoteTool,
|
||||
BrushTool,
|
||||
ConnectorTool,
|
||||
TemplateTool,
|
||||
EmptyTool,
|
||||
FrameTool,
|
||||
PresentTool,
|
||||
HighlighterTool,
|
||||
];
|
||||
|
||||
export const EdgelessEditExtensions: ExtensionType[] = [
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { effects as gfxBrushEffects } from '@blocksuite/affine-gfx-brush/effects';
|
||||
import { effects as gfxConnectorEffects } from '@blocksuite/affine-gfx-connector/effects';
|
||||
import { effects as gfxGroupEffects } from '@blocksuite/affine-gfx-group/effects';
|
||||
import { effects as gfxMindmapEffects } from '@blocksuite/affine-gfx-mindmap/effects';
|
||||
import { effects as gfxNoteEffects } from '@blocksuite/affine-gfx-note/effects';
|
||||
import { effects as gfxShapeEffects } from '@blocksuite/affine-gfx-shape/effects';
|
||||
import { effects as gfxTemplateEffects } from '@blocksuite/affine-gfx-template/effects';
|
||||
import { effects as gfxCanvasTextEffects } from '@blocksuite/affine-gfx-text/effects';
|
||||
@@ -80,11 +78,9 @@ function registerRootComponents() {
|
||||
function registerGfxEffects() {
|
||||
gfxCanvasTextEffects();
|
||||
gfxShapeEffects();
|
||||
gfxNoteEffects();
|
||||
gfxConnectorEffects();
|
||||
gfxMindmapEffects();
|
||||
gfxGroupEffects();
|
||||
gfxBrushEffects();
|
||||
gfxTemplateEffects();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user