feat(editor): mindmap gfx extension (#11936)

Closes: BS-3209

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced mind map view and store extensions, enhancing mind map integration and conversion to plain text and markdown formats.
  - Added priority property to quick tools, allowing for custom ordering in the toolbar.
- **Improvements**
  - Toolbar quick tools are now sorted by priority for a more intuitive user experience.
  - Updated toolbar and extension configurations to streamline available tools and extensions.
- **Bug Fixes**
  - Conditional registration of certain components ensures correct behavior in edgeless mode.
- **Chores**
  - Updated dependencies and project references to improve module integration and maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Saul-Mirone
2025-04-24 00:49:38 +00:00
parent bc0530a708
commit f0a233368d
25 changed files with 95 additions and 52 deletions

View File

@@ -5,4 +5,4 @@ export * from './interactivity';
export * from './toolbar/config';
export * from './toolbar/senior-tool';
export * from './utils';
export * from './view';
export * from './view/index';

View File

@@ -0,0 +1,19 @@
import {
type StoreExtensionContext,
StoreExtensionProvider,
} from '@blocksuite/affine-ext-loader';
import {
mindmapToMarkdownAdapterMatcher,
mindmapToPlainTextAdapterMatcher,
} from './adapter';
export class MindmapStoreExtension extends StoreExtensionProvider {
override name = 'affine-mindmap-gfx';
override setup(context: StoreExtensionContext) {
super.setup(context);
context.register(mindmapToPlainTextAdapterMatcher);
context.register(mindmapToMarkdownAdapterMatcher);
}
}

View File

@@ -23,7 +23,7 @@ import {
MindmapStyleOne,
MindmapStyleThree,
MindmapStyleTwo,
} from '../view';
} from '../view/index';
const MINDMAP_STYLE_LIST = [
{

View File

@@ -0,0 +1,35 @@
import {
type ViewExtensionContext,
ViewExtensionProvider,
} from '@blocksuite/affine-ext-loader';
import { effects } from './effects';
import { MindmapElementRendererExtension } from './element-renderer';
import { MindMapIndicatorOverlay } from './indicator-overlay';
import { MindMapDragExtension } from './interactivity';
import {
mindmapToolbarExtension,
shapeMindmapToolbarExtension,
} from './toolbar/config';
import { mindMapSeniorTool } from './toolbar/senior-tool';
import { MindMapView } from './view/view';
export class MindmapViewExtension extends ViewExtensionProvider {
override name = 'affine-mindmap-gfx';
override effect(): void {
super.effect();
effects();
}
override setup(context: ViewExtensionContext) {
super.setup(context);
context.register(MindmapElementRendererExtension);
context.register(mindMapSeniorTool);
context.register(mindmapToolbarExtension);
context.register(shapeMindmapToolbarExtension);
context.register(MindMapView);
context.register(MindMapDragExtension);
context.register(MindMapIndicatorOverlay);
}
}