mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-19 15:26:59 +08:00
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:
@@ -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';
|
||||
|
||||
19
blocksuite/affine/gfx/mindmap/src/store.ts
Normal file
19
blocksuite/affine/gfx/mindmap/src/store.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
MindmapStyleOne,
|
||||
MindmapStyleThree,
|
||||
MindmapStyleTwo,
|
||||
} from '../view';
|
||||
} from '../view/index';
|
||||
|
||||
const MINDMAP_STYLE_LIST = [
|
||||
{
|
||||
|
||||
35
blocksuite/affine/gfx/mindmap/src/view.ts
Normal file
35
blocksuite/affine/gfx/mindmap/src/view.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user