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:
@@ -174,7 +174,9 @@
|
||||
"./fragments/frame-panel": "./src/fragments/frame-panel.ts",
|
||||
"./fragments/outline": "./src/fragments/outline.ts",
|
||||
"./gfx/text": "./src/gfx/text.ts",
|
||||
"./gfx/brush": "./src/gfx/brush.ts",
|
||||
"./gfx/brush": "./src/gfx/brush/index.ts",
|
||||
"./gfx/brush/store": "./src/gfx/brush/store.ts",
|
||||
"./gfx/brush/view": "./src/gfx/brush/view.ts",
|
||||
"./gfx/shape": "./src/gfx/shape.ts",
|
||||
"./gfx/note": "./src/gfx/note.ts",
|
||||
"./gfx/mindmap": "./src/gfx/mindmap.ts",
|
||||
|
||||
@@ -11,10 +11,6 @@ import {
|
||||
PageSurfaceBlockSpec,
|
||||
SurfaceBlockAdapterExtensions,
|
||||
} from '@blocksuite/affine-block-surface';
|
||||
import {
|
||||
brushToMarkdownAdapterMatcher,
|
||||
brushToPlainTextAdapterMatcher,
|
||||
} from '@blocksuite/affine-gfx-brush';
|
||||
import {
|
||||
connectorToMarkdownAdapterMatcher,
|
||||
connectorToPlainTextAdapterMatcher,
|
||||
@@ -48,7 +44,6 @@ const elementToPlainTextAdapterMatchers = [
|
||||
groupToPlainTextAdapterMatcher,
|
||||
shapeToPlainTextAdapterMatcher,
|
||||
connectorToPlainTextAdapterMatcher,
|
||||
brushToPlainTextAdapterMatcher,
|
||||
textToPlainTextAdapterMatcher,
|
||||
mindmapToPlainTextAdapterMatcher,
|
||||
];
|
||||
@@ -57,7 +52,6 @@ const elementToMarkdownAdapterMatchers = [
|
||||
groupToMarkdownAdapterMatcher,
|
||||
shapeToMarkdownAdapterMatcher,
|
||||
connectorToMarkdownAdapterMatcher,
|
||||
brushToMarkdownAdapterMatcher,
|
||||
textToMarkdownAdapterMatcher,
|
||||
mindmapToMarkdownAdapterMatcher,
|
||||
];
|
||||
|
||||
@@ -15,6 +15,7 @@ import { NoteStoreExtension } from '@blocksuite/affine-block-note/store';
|
||||
import { ParagraphStoreExtension } from '@blocksuite/affine-block-paragraph/store';
|
||||
import { SurfaceRefStoreExtension } from '@blocksuite/affine-block-surface-ref/store';
|
||||
import { TableStoreExtension } from '@blocksuite/affine-block-table/store';
|
||||
import { BrushStoreExtension } from '@blocksuite/affine-gfx-brush/store';
|
||||
import { FootnoteStoreExtension } from '@blocksuite/affine-inline-footnote/store';
|
||||
import { LatexStoreExtension as InlineLatexStoreExtension } from '@blocksuite/affine-inline-latex/store';
|
||||
import { LinkStoreExtension } from '@blocksuite/affine-inline-link/store';
|
||||
@@ -49,6 +50,8 @@ export function getInternalStoreExtensions() {
|
||||
InlineLatexStoreExtension,
|
||||
InlinePresetStoreExtension,
|
||||
|
||||
BrushStoreExtension,
|
||||
|
||||
MigratingStoreExtension,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ import { NoteViewExtension } from '@blocksuite/affine-block-note/view';
|
||||
import { ParagraphViewExtension } from '@blocksuite/affine-block-paragraph/view';
|
||||
import { SurfaceRefViewExtension } from '@blocksuite/affine-block-surface-ref/view';
|
||||
import { TableViewExtension } from '@blocksuite/affine-block-table/view';
|
||||
import { BrushViewExtension } from '@blocksuite/affine-gfx-brush/view';
|
||||
import { NoteViewExtension as GfxNoteViewExtension } from '@blocksuite/affine-gfx-note/view';
|
||||
import { FootnoteViewExtension } from '@blocksuite/affine-inline-footnote/view';
|
||||
import { LatexViewExtension as InlineLatexViewExtension } from '@blocksuite/affine-inline-latex/view';
|
||||
import { LinkViewExtension } from '@blocksuite/affine-inline-link/view';
|
||||
@@ -26,6 +28,12 @@ import { MigratingViewExtension } from './migrating-view';
|
||||
|
||||
export function getInternalViewExtensions() {
|
||||
return [
|
||||
GfxNoteViewExtension,
|
||||
BrushViewExtension,
|
||||
// shape
|
||||
// mind
|
||||
// template
|
||||
|
||||
MigratingViewExtension,
|
||||
|
||||
// Block
|
||||
|
||||
1
blocksuite/affine/all/src/gfx/brush/store.ts
Normal file
1
blocksuite/affine/all/src/gfx/brush/store.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from '@blocksuite/affine-gfx-brush/store';
|
||||
1
blocksuite/affine/all/src/gfx/brush/view.ts
Normal file
1
blocksuite/affine/all/src/gfx/brush/view.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from '@blocksuite/affine-gfx-brush/view';
|
||||
1
blocksuite/affine/all/src/gfx/note/view.ts
Normal file
1
blocksuite/affine/all/src/gfx/note/view.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from '@blocksuite/affine-gfx-note/view';
|
||||
Reference in New Issue
Block a user