mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 22:38:56 +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:
@@ -7,10 +7,6 @@ import {
|
||||
GroupElementRendererExtension,
|
||||
GroupElementView,
|
||||
} from '@blocksuite/affine-gfx-group';
|
||||
import {
|
||||
MindmapElementRendererExtension,
|
||||
MindMapView,
|
||||
} from '@blocksuite/affine-gfx-mindmap';
|
||||
import {
|
||||
TextElementRendererExtension,
|
||||
TextElementView,
|
||||
@@ -48,7 +44,6 @@ import { viewportOverlayWidget } from './widgets';
|
||||
*/
|
||||
const EdgelessElementViews = [
|
||||
ConnectorElementView,
|
||||
MindMapView,
|
||||
GroupElementView,
|
||||
TextElementView,
|
||||
];
|
||||
@@ -57,7 +52,6 @@ export const EdgelessElementRendererExtension: ExtensionType[] = [
|
||||
TextElementRendererExtension,
|
||||
ConnectorElementRendererExtension,
|
||||
GroupElementRendererExtension,
|
||||
MindmapElementRendererExtension,
|
||||
];
|
||||
|
||||
export const CommonSpecs: ExtensionType[] = [
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { frameQuickTool } from '@blocksuite/affine-block-frame';
|
||||
import { connectorQuickTool } from '@blocksuite/affine-gfx-connector';
|
||||
import { mindMapSeniorTool } from '@blocksuite/affine-gfx-mindmap';
|
||||
import { templateSeniorTool } from '@blocksuite/affine-gfx-template';
|
||||
import { QuickToolExtension } from '@blocksuite/affine-widget-edgeless-toolbar';
|
||||
import { html } from 'lit';
|
||||
@@ -9,6 +7,7 @@ import { buildLinkDenseMenu } from './link/link-dense-menu.js';
|
||||
|
||||
const defaultQuickTool = QuickToolExtension('default', ({ block }) => {
|
||||
return {
|
||||
priority: 100,
|
||||
type: 'default',
|
||||
content: html`<edgeless-default-tool-button
|
||||
.edgeless=${block}
|
||||
@@ -25,11 +24,6 @@ const linkQuickTool = QuickToolExtension('link', ({ block, gfx }) => {
|
||||
};
|
||||
});
|
||||
|
||||
export const quickTools = [
|
||||
defaultQuickTool,
|
||||
frameQuickTool,
|
||||
connectorQuickTool,
|
||||
linkQuickTool,
|
||||
];
|
||||
export const quickTools = [defaultQuickTool, connectorQuickTool, linkQuickTool];
|
||||
|
||||
export const seniorTools = [mindMapSeniorTool, templateSeniorTool];
|
||||
export const seniorTools = [templateSeniorTool];
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
import { edgelessTextToolbarExtension } from '@blocksuite/affine-block-edgeless-text';
|
||||
import { frameToolbarExtension } from '@blocksuite/affine-block-frame';
|
||||
import { connectorToolbarExtension } from '@blocksuite/affine-gfx-connector';
|
||||
import { groupToolbarExtension } from '@blocksuite/affine-gfx-group';
|
||||
import {
|
||||
mindmapToolbarExtension,
|
||||
shapeMindmapToolbarExtension,
|
||||
} from '@blocksuite/affine-gfx-mindmap';
|
||||
import { shapeToolbarExtension } from '@blocksuite/affine-gfx-shape';
|
||||
import { textToolbarExtension } from '@blocksuite/affine-gfx-text';
|
||||
import { ToolbarModuleExtension } from '@blocksuite/affine-shared/services';
|
||||
import { BlockFlavourIdentifier } from '@blocksuite/std';
|
||||
@@ -15,22 +8,12 @@ import type { ExtensionType } from '@blocksuite/store';
|
||||
import { builtinLockedToolbarConfig, builtinMiscToolbarConfig } from './misc';
|
||||
|
||||
export const EdgelessElementToolbarExtension: ExtensionType[] = [
|
||||
frameToolbarExtension,
|
||||
|
||||
groupToolbarExtension,
|
||||
|
||||
connectorToolbarExtension,
|
||||
|
||||
shapeToolbarExtension,
|
||||
|
||||
shapeMindmapToolbarExtension,
|
||||
|
||||
mindmapToolbarExtension,
|
||||
|
||||
textToolbarExtension,
|
||||
|
||||
edgelessTextToolbarExtension,
|
||||
|
||||
ToolbarModuleExtension({
|
||||
id: BlockFlavourIdentifier('affine:surface:*'),
|
||||
config: builtinMiscToolbarConfig,
|
||||
|
||||
@@ -4,10 +4,6 @@ import {
|
||||
ConnectorFilter,
|
||||
ConnectorTool,
|
||||
} from '@blocksuite/affine-gfx-connector';
|
||||
import {
|
||||
MindMapDragExtension,
|
||||
MindMapIndicatorOverlay,
|
||||
} from '@blocksuite/affine-gfx-mindmap';
|
||||
import type * as NoteEffect from '@blocksuite/affine-gfx-note';
|
||||
import type * as ShapeEffect from '@blocksuite/affine-gfx-shape';
|
||||
import { TemplateTool } from '@blocksuite/affine-gfx-template';
|
||||
@@ -44,13 +40,11 @@ export const EdgelessEditExtensions: ExtensionType[] = [
|
||||
InteractivityManager,
|
||||
ConnectorFilter,
|
||||
SnapExtension,
|
||||
MindMapDragExtension,
|
||||
DblClickAddEdgelessText,
|
||||
];
|
||||
|
||||
export const EdgelessBuiltInManager: ExtensionType[] = [
|
||||
ConnectionOverlay,
|
||||
MindMapIndicatorOverlay,
|
||||
SnapOverlay,
|
||||
AltCloneExtension,
|
||||
EditPropsMiddlewareBuilder,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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 gfxTemplateEffects } from '@blocksuite/affine-gfx-template/effects';
|
||||
import { effects as gfxCanvasTextEffects } from '@blocksuite/affine-gfx-text/effects';
|
||||
import { effects as widgetEdgelessToolbarEffects } from '@blocksuite/affine-widget-edgeless-toolbar/effects';
|
||||
@@ -77,7 +76,6 @@ function registerRootComponents() {
|
||||
function registerGfxEffects() {
|
||||
gfxCanvasTextEffects();
|
||||
gfxConnectorEffects();
|
||||
gfxMindmapEffects();
|
||||
gfxGroupEffects();
|
||||
gfxTemplateEffects();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user