@univerjs-pro/boards-mind-ui 1.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +46 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/cjs/locale/ar-SA.js +1 -0
  4. package/lib/cjs/locale/ca-ES.js +1 -0
  5. package/lib/cjs/locale/de-DE.js +1 -0
  6. package/lib/cjs/locale/en-US.js +1 -0
  7. package/lib/cjs/locale/es-ES.js +1 -0
  8. package/lib/cjs/locale/fa-IR.js +1 -0
  9. package/lib/cjs/locale/fr-FR.js +1 -0
  10. package/lib/cjs/locale/id-ID.js +1 -0
  11. package/lib/cjs/locale/it-IT.js +1 -0
  12. package/lib/cjs/locale/ja-JP.js +1 -0
  13. package/lib/cjs/locale/ko-KR.js +1 -0
  14. package/lib/cjs/locale/pl-PL.js +1 -0
  15. package/lib/cjs/locale/pt-BR.js +1 -0
  16. package/lib/cjs/locale/ru-RU.js +1 -0
  17. package/lib/cjs/locale/sk-SK.js +1 -0
  18. package/lib/cjs/locale/vi-VN.js +1 -0
  19. package/lib/cjs/locale/zh-CN.js +1 -0
  20. package/lib/cjs/locale/zh-HK.js +1 -0
  21. package/lib/cjs/locale/zh-TW.js +1 -0
  22. package/lib/es/index.js +1 -0
  23. package/lib/es/locale/ar-SA.js +1 -0
  24. package/lib/es/locale/ca-ES.js +1 -0
  25. package/lib/es/locale/de-DE.js +1 -0
  26. package/lib/es/locale/en-US.js +1 -0
  27. package/lib/es/locale/es-ES.js +1 -0
  28. package/lib/es/locale/fa-IR.js +1 -0
  29. package/lib/es/locale/fr-FR.js +1 -0
  30. package/lib/es/locale/id-ID.js +1 -0
  31. package/lib/es/locale/it-IT.js +1 -0
  32. package/lib/es/locale/ja-JP.js +1 -0
  33. package/lib/es/locale/ko-KR.js +1 -0
  34. package/lib/es/locale/pl-PL.js +1 -0
  35. package/lib/es/locale/pt-BR.js +1 -0
  36. package/lib/es/locale/ru-RU.js +1 -0
  37. package/lib/es/locale/sk-SK.js +1 -0
  38. package/lib/es/locale/vi-VN.js +1 -0
  39. package/lib/es/locale/zh-CN.js +1 -0
  40. package/lib/es/locale/zh-HK.js +1 -0
  41. package/lib/es/locale/zh-TW.js +1 -0
  42. package/lib/index.css +417 -0
  43. package/lib/index.js +1 -0
  44. package/lib/locale/ar-SA.js +1 -0
  45. package/lib/locale/ca-ES.js +1 -0
  46. package/lib/locale/de-DE.js +1 -0
  47. package/lib/locale/en-US.js +1 -0
  48. package/lib/locale/es-ES.js +1 -0
  49. package/lib/locale/fa-IR.js +1 -0
  50. package/lib/locale/fr-FR.js +1 -0
  51. package/lib/locale/id-ID.js +1 -0
  52. package/lib/locale/it-IT.js +1 -0
  53. package/lib/locale/ja-JP.js +1 -0
  54. package/lib/locale/ko-KR.js +1 -0
  55. package/lib/locale/pl-PL.js +1 -0
  56. package/lib/locale/pt-BR.js +1 -0
  57. package/lib/locale/ru-RU.js +1 -0
  58. package/lib/locale/sk-SK.js +1 -0
  59. package/lib/locale/vi-VN.js +1 -0
  60. package/lib/locale/zh-CN.js +1 -0
  61. package/lib/locale/zh-HK.js +1 -0
  62. package/lib/locale/zh-TW.js +1 -0
  63. package/lib/types/commands/operations/open-mind-map-panel.operation.d.ts +8 -0
  64. package/lib/types/config/config.d.ts +5 -0
  65. package/lib/types/controllers/board-mind-map-autosize-layout.render-controller.d.ts +24 -0
  66. package/lib/types/controllers/board-mind-map-drag-topology.render-controller.d.ts +61 -0
  67. package/lib/types/controllers/board-mind-map-floating-toolbar.render-controller.d.ts +27 -0
  68. package/lib/types/controllers/board-mind-map-insert.render-controller.d.ts +26 -0
  69. package/lib/types/controllers/board-mind-map-intrinsic-size.render-controller.d.ts +31 -0
  70. package/lib/types/controllers/board-mind-map-keyboard-shortcut.controller.d.ts +41 -0
  71. package/lib/types/controllers/board-mind-map-node-controls.render-controller.d.ts +37 -0
  72. package/lib/types/controllers/board-mind-map-panel.controller.d.ts +15 -0
  73. package/lib/types/controllers/board-mind-map-text-editing-shortcut.controller.d.ts +18 -0
  74. package/lib/types/index.d.ts +2 -0
  75. package/lib/types/locale/ar-SA.d.ts +3 -0
  76. package/lib/types/locale/ca-ES.d.ts +3 -0
  77. package/lib/types/locale/de-DE.d.ts +3 -0
  78. package/lib/types/locale/en-US.d.ts +81 -0
  79. package/lib/types/locale/es-ES.d.ts +3 -0
  80. package/lib/types/locale/fa-IR.d.ts +3 -0
  81. package/lib/types/locale/fr-FR.d.ts +3 -0
  82. package/lib/types/locale/id-ID.d.ts +3 -0
  83. package/lib/types/locale/it-IT.d.ts +3 -0
  84. package/lib/types/locale/ja-JP.d.ts +3 -0
  85. package/lib/types/locale/ko-KR.d.ts +3 -0
  86. package/lib/types/locale/pl-PL.d.ts +3 -0
  87. package/lib/types/locale/pt-BR.d.ts +3 -0
  88. package/lib/types/locale/ru-RU.d.ts +3 -0
  89. package/lib/types/locale/sk-SK.d.ts +3 -0
  90. package/lib/types/locale/types.d.ts +3 -0
  91. package/lib/types/locale/vi-VN.d.ts +3 -0
  92. package/lib/types/locale/zh-CN.d.ts +3 -0
  93. package/lib/types/locale/zh-HK.d.ts +3 -0
  94. package/lib/types/locale/zh-TW.d.ts +3 -0
  95. package/lib/types/plugin.d.ts +21 -0
  96. package/lib/types/render-objects/board-mind-map-drag-preview-object.d.ts +36 -0
  97. package/lib/types/render-objects/board-mind-map-node-controls-object.d.ts +22 -0
  98. package/lib/types/render-objects/board-mind-map-pending-insert-object.d.ts +22 -0
  99. package/lib/types/services/board-mind-map-insert-state.service.d.ts +19 -0
  100. package/lib/types/services/board-mind-map-preview-refresh.service.d.ts +13 -0
  101. package/lib/types/services/board-mind-map-ui-adapter.service.d.ts +9 -0
  102. package/lib/types/utils/mind-map-canvas-tokens.util.d.ts +6 -0
  103. package/lib/types/utils/mind-map-drag-topology.util.d.ts +26 -0
  104. package/lib/types/utils/mind-map-node-controls.util.d.ts +46 -0
  105. package/lib/types/utils/mind-map-preview-tokens.util.d.ts +29 -0
  106. package/lib/types/utils/mind-map-scope-preview.util.d.ts +29 -0
  107. package/lib/types/views/BoardMindMapDescriptionDialog.d.ts +10 -0
  108. package/lib/types/views/BoardMindMapFloatingToolbar.d.ts +147 -0
  109. package/lib/types/views/BoardMindMapPanel.d.ts +127 -0
  110. package/lib/umd/index.js +1 -0
  111. package/lib/umd/locale/ar-SA.js +1 -0
  112. package/lib/umd/locale/ca-ES.js +1 -0
  113. package/lib/umd/locale/de-DE.js +1 -0
  114. package/lib/umd/locale/en-US.js +1 -0
  115. package/lib/umd/locale/es-ES.js +1 -0
  116. package/lib/umd/locale/fa-IR.js +1 -0
  117. package/lib/umd/locale/fr-FR.js +1 -0
  118. package/lib/umd/locale/id-ID.js +1 -0
  119. package/lib/umd/locale/it-IT.js +1 -0
  120. package/lib/umd/locale/ja-JP.js +1 -0
  121. package/lib/umd/locale/ko-KR.js +1 -0
  122. package/lib/umd/locale/pl-PL.js +1 -0
  123. package/lib/umd/locale/pt-BR.js +1 -0
  124. package/lib/umd/locale/ru-RU.js +1 -0
  125. package/lib/umd/locale/sk-SK.js +1 -0
  126. package/lib/umd/locale/vi-VN.js +1 -0
  127. package/lib/umd/locale/zh-CN.js +1 -0
  128. package/lib/umd/locale/zh-HK.js +1 -0
  129. package/lib/umd/locale/zh-TW.js +1 -0
  130. package/package.json +91 -0
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type { LocaleLeafKeys } from '@univerjs/core';
2
+ import type enUS from './en-US';
3
+ export type LocaleKey = LocaleLeafKeys<typeof enUS>;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,21 @@
1
+ import type { BoardToolbarToolConfig } from '@univerjs-pro/boards-ui';
2
+ import type { IUniverBoardsMindUIConfig } from './config/config';
3
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
4
+ import { IRenderManagerService } from '@univerjs/engine-render';
5
+ export declare const BOARDS_MIND_UI_PLUGIN_NAME = "UNIVER_BOARDS_MIND_UI_PLUGIN";
6
+ export declare class UniverBoardsMindUIPlugin extends Plugin {
7
+ private readonly _config;
8
+ protected readonly _injector: Injector;
9
+ private readonly _configService;
10
+ private readonly _renderManagerService;
11
+ static pluginName: string;
12
+ static packageName: string;
13
+ static version: string;
14
+ static type: UniverInstanceType;
15
+ constructor(_config: Partial<IUniverBoardsMindUIConfig> | undefined, _injector: Injector, _configService: IConfigService, _renderManagerService: IRenderManagerService);
16
+ onStarting(): void;
17
+ onReady(): void;
18
+ private _enableMindMapToolbarTool;
19
+ private _getBoardsUIConfig;
20
+ }
21
+ export declare function enableMindMapTool(config: BoardToolbarToolConfig | undefined): BoardToolbarToolConfig;
@@ -0,0 +1,36 @@
1
+ import type { MindMapNodeSide } from '@univerjs-pro/boards-mind';
2
+ import type { IViewportInfo, UniverRenderingContext, Vector2 } from '@univerjs/engine-render';
3
+ import { BaseObject } from '@univerjs/engine-render';
4
+ export interface IBoardMindMapDragPreviewBounds {
5
+ left?: number;
6
+ top?: number;
7
+ width?: number;
8
+ height?: number;
9
+ }
10
+ export interface IBoardMindMapDragPreviewObjectState {
11
+ ghostBounds: IBoardMindMapDragPreviewBounds | null;
12
+ sourceBounds?: IBoardMindMapDragPreviewBounds | null;
13
+ parentBounds?: IBoardMindMapDragPreviewBounds | null;
14
+ side?: MindMapNodeSide;
15
+ zoomRatio?: number;
16
+ textStyle?: IBoardMindMapDragPreviewTextStyle;
17
+ renderGhostNode?: boolean;
18
+ }
19
+ export interface IBoardMindMapDragPreviewTextStyle {
20
+ text?: string;
21
+ fontSize?: number;
22
+ color?: string;
23
+ horizontalAlign?: number;
24
+ }
25
+ export declare const BOARD_MIND_MAP_DRAG_PREVIEW_OBJECT_KEY = "board-mind-map-drag-preview-object";
26
+ export declare const BOARD_MIND_MAP_DRAG_PREVIEW_OBJECT_LAYER_INDEX: 3;
27
+ export declare class BoardMindMapDragPreviewObject extends BaseObject {
28
+ private _state;
29
+ constructor(key?: string, state?: Partial<IBoardMindMapDragPreviewObjectState>);
30
+ updateState(state?: Partial<IBoardMindMapDragPreviewObjectState>): void;
31
+ isHit(_coord: Vector2): boolean;
32
+ render(ctx: UniverRenderingContext, _bounds: IViewportInfo): this;
33
+ private _resolveDirtyBounds;
34
+ private _drawSourceHighlight;
35
+ private _drawConnectorPreview;
36
+ }
@@ -0,0 +1,22 @@
1
+ import type { IViewportInfo, UniverRenderingContext, Vector2 } from '@univerjs/engine-render';
2
+ import type { IMindMapNodeControl } from '../utils/mind-map-node-controls.util';
3
+ import { BaseObject } from '@univerjs/engine-render';
4
+ export interface IBoardMindMapNodeControlsObjectState {
5
+ controls: IMindMapNodeControl[];
6
+ hoveredControl?: IMindMapNodeControl | null;
7
+ zoomRatio: number;
8
+ }
9
+ export declare const BOARD_MIND_MAP_NODE_CONTROLS_OBJECT_KEY = "board-mind-map-node-controls-object";
10
+ export declare const BOARD_MIND_MAP_NODE_CONTROLS_OBJECT_LAYER_INDEX: 5;
11
+ export declare class BoardMindMapNodeControlsObject extends BaseObject {
12
+ private _state;
13
+ constructor(key?: string, state?: Partial<IBoardMindMapNodeControlsObjectState>);
14
+ updateState(state?: Partial<IBoardMindMapNodeControlsObjectState>): void;
15
+ setHoveredControl(control: IMindMapNodeControl | null): void;
16
+ getHitControl(point: {
17
+ x: number;
18
+ y: number;
19
+ }): IMindMapNodeControl | null;
20
+ isHit(coord: Vector2): boolean;
21
+ render(ctx: UniverRenderingContext, _bounds: IViewportInfo): this;
22
+ }
@@ -0,0 +1,22 @@
1
+ import type { IMindMapChildBlueprint, IMindMapTreeBlueprint, MindMapStructureKind } from '@univerjs-pro/boards-mind';
2
+ import type { IViewportInfo, UniverRenderingContext, Vector2 } from '@univerjs/engine-render';
3
+ import { BaseObject } from '@univerjs/engine-render';
4
+ export interface IBoardMindMapPendingInsertObjectState {
5
+ point: {
6
+ x: number;
7
+ y: number;
8
+ } | null;
9
+ structureKind?: MindMapStructureKind;
10
+ children?: IMindMapChildBlueprint[];
11
+ blueprint?: IMindMapTreeBlueprint;
12
+ zoomRatio?: number;
13
+ }
14
+ export declare const BOARD_MIND_MAP_PENDING_INSERT_OBJECT_KEY = "board-mind-map-pending-insert-object";
15
+ export declare const BOARD_MIND_MAP_PENDING_INSERT_OBJECT_LAYER_INDEX: 3;
16
+ export declare class BoardMindMapPendingInsertObject extends BaseObject {
17
+ private _state;
18
+ constructor(key?: string, state?: Partial<IBoardMindMapPendingInsertObjectState>);
19
+ updateState(state?: Partial<IBoardMindMapPendingInsertObjectState>): void;
20
+ isHit(_coord: Vector2): boolean;
21
+ render(ctx: UniverRenderingContext, _bounds: IViewportInfo): this;
22
+ }
@@ -0,0 +1,19 @@
1
+ import type { IMindMapChildBlueprint, IMindMapTreeBlueprint, MindMapBranchLineType, MindMapStructureKind } from '@univerjs-pro/boards-mind';
2
+ import { Disposable } from '@univerjs/core';
3
+ export interface IBoardMindMapInsertTemplate {
4
+ rootText?: string;
5
+ structureKind?: MindMapStructureKind;
6
+ branchLineType?: MindMapBranchLineType;
7
+ children?: IMindMapChildBlueprint[];
8
+ blueprint?: IMindMapTreeBlueprint;
9
+ }
10
+ export declare const DEFAULT_BOARD_MIND_MAP_INSERT_TEMPLATE: IBoardMindMapInsertTemplate;
11
+ export declare class BoardMindMapInsertStateService extends Disposable {
12
+ private _template;
13
+ setTemplate(template?: IBoardMindMapInsertTemplate): void;
14
+ getTemplate(): IBoardMindMapInsertTemplate;
15
+ private _cloneBlueprint;
16
+ private _cloneBlueprintNode;
17
+ private _normalizeChildren;
18
+ private _resolveChildSide;
19
+ }
@@ -0,0 +1,13 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ export interface IBoardMindMapPreviewRefreshEvent {
3
+ nodeId: string;
4
+ scopeId: string;
5
+ subUnitId: string;
6
+ unitId: string;
7
+ }
8
+ export declare class BoardMindMapPreviewRefreshService extends Disposable {
9
+ private readonly _refresh$;
10
+ readonly refresh$: import("rxjs").Observable<IBoardMindMapPreviewRefreshEvent>;
11
+ notify(event: IBoardMindMapPreviewRefreshEvent): void;
12
+ dispose(): void;
13
+ }
@@ -0,0 +1,9 @@
1
+ import type { IBeginBoardMindMapOperationParams, IBoardMindMapAdapter } from '@univerjs-pro/boards';
2
+ import { IBoardUIStateService } from '@univerjs-pro/boards-ui';
3
+ import { BoardMindMapInsertStateService } from './board-mind-map-insert-state.service';
4
+ export declare class BoardMindMapUIAdapter implements IBoardMindMapAdapter {
5
+ private readonly _stateService;
6
+ private readonly _insertStateService;
7
+ constructor(_stateService: IBoardUIStateService, _insertStateService: BoardMindMapInsertStateService);
8
+ beginMindMapMode(params: IBeginBoardMindMapOperationParams): boolean;
9
+ }
@@ -0,0 +1,6 @@
1
+ export declare const BOARD_MIND_MAP_CANVAS_TOKENS: {
2
+ readonly primaryColor: "#2563EB";
3
+ readonly surfaceColor: "#ffffff";
4
+ readonly textColor: "#111827";
5
+ readonly fontFamily: string;
6
+ };
@@ -0,0 +1,26 @@
1
+ import type { IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { MindMapNodeSide } from '@univerjs-pro/boards-mind';
3
+ export type MindMapDragTopologyAction = {
4
+ kind: 'none';
5
+ } | {
6
+ kind: 'detach';
7
+ left?: number;
8
+ top?: number;
9
+ } | {
10
+ kind: 'reparent';
11
+ newParentNodeId: string;
12
+ side: MindMapNodeSide;
13
+ referenceNodeId?: string;
14
+ placement?: 'before' | 'after';
15
+ };
16
+ export interface IMindMapDragTopologyBounds {
17
+ left?: number;
18
+ top?: number;
19
+ width?: number;
20
+ height?: number;
21
+ }
22
+ export declare function resolveMindMapDragTopologyAction(elementData: Record<string, IBoardElementData>, nodeId: string, options?: {
23
+ boundsByElementId?: Readonly<Record<string, IMindMapDragTopologyBounds | undefined>>;
24
+ detachWhenNoSnap?: boolean;
25
+ allowRootReparent?: boolean;
26
+ }): MindMapDragTopologyAction;
@@ -0,0 +1,46 @@
1
+ export type MindMapNodeControlKind = 'add-child-left' | 'add-child-right' | 'add-child-top' | 'add-child-bottom' | 'add-sibling-before' | 'add-sibling-after' | 'toggle-collapse';
2
+ export interface IMindMapNodeControlBounds {
3
+ left: number;
4
+ top: number;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export interface IResolveMindMapNodeControlLayoutOptions {
9
+ bounds: IMindMapNodeControlBounds;
10
+ isRoot: boolean;
11
+ side: 'left' | 'right' | 'top' | 'bottom';
12
+ rootChildSides?: Array<'left' | 'right' | 'top' | 'bottom'>;
13
+ hasChildren: boolean;
14
+ collapsedDescendantCount: number;
15
+ zoomRatio: number;
16
+ }
17
+ export interface IMindMapNodeControl {
18
+ kind: MindMapNodeControlKind;
19
+ x: number;
20
+ y: number;
21
+ radius: number;
22
+ visualRadius?: number;
23
+ placement?: 'before' | 'after';
24
+ badgeCount?: number;
25
+ }
26
+ export declare const BOARD_MIND_MAP_NODE_CONTROL_TOKENS: {
27
+ readonly radiusScreen: 18;
28
+ readonly addChildRadiusScreen: 14;
29
+ readonly siblingHoverRadiusScreen: 10;
30
+ readonly siblingDotRadiusScreen: 5;
31
+ readonly siblingDotGapScreen: 3;
32
+ readonly gapScreen: 10;
33
+ readonly collapsePlusMinDistanceScreen: 44;
34
+ readonly primaryColor: "#2563EB";
35
+ readonly surfaceColor: "#ffffff";
36
+ readonly borderWidthScreen: 2;
37
+ readonly glyphSizeScreen: 8;
38
+ readonly addChildGlyphSizeScreen: 6;
39
+ readonly siblingGlyphSizeScreen: 5.5;
40
+ readonly glyphWidthScreen: 2.4;
41
+ readonly glyphHoverWidthScreen: 3;
42
+ readonly badgeFontWeight: 600;
43
+ readonly badgeFontSizeScreen: 18;
44
+ readonly fontFamily: string;
45
+ };
46
+ export declare function resolveMindMapNodeControlLayout(options: IResolveMindMapNodeControlLayoutOptions): IMindMapNodeControl[];
@@ -0,0 +1,29 @@
1
+ import type { UniverRenderingContext } from '@univerjs/engine-render';
2
+ export declare function resolveMindMapPreviewTokenAlpha(color: string, alpha: number): string;
3
+ export declare const BOARD_MIND_MAP_PREVIEW_TOKENS: {
4
+ readonly primaryColor: "#2563EB";
5
+ readonly ghostFillColor: string;
6
+ readonly ghostTextColor: string;
7
+ readonly rootTextColor: string;
8
+ readonly sourceHighlightFillColor: string;
9
+ readonly sourceHighlightStrokeColor: string;
10
+ readonly objectAlpha: 0.72;
11
+ readonly dragObjectAlpha: 0.78;
12
+ readonly connectorAlpha: 0.64;
13
+ readonly lineWidthScreen: 2;
14
+ readonly fallbackNodeWidth: 160;
15
+ readonly fallbackNodeHeight: 48;
16
+ readonly branchGap: 40;
17
+ readonly sourceHaloScreen: 4;
18
+ readonly ghostRadius: 8;
19
+ readonly rootRadius: 10;
20
+ readonly fontFamily: string;
21
+ readonly ghostFontWeight: 500;
22
+ readonly rootFontWeight: 600;
23
+ readonly rootFontSize: 18;
24
+ readonly textPaddingScreen: 12;
25
+ readonly dirtyPaddingScreen: 24;
26
+ readonly sourceDashScreen: readonly [6, 4];
27
+ };
28
+ export declare function drawMindMapPreviewRoundedRect(ctx: UniverRenderingContext, left: number, top: number, width: number, height: number, radius: number): void;
29
+ export declare function resolveMindMapPreviewFont(weight: number, fontSize: number, zoomRatio: number): string;
@@ -0,0 +1,29 @@
1
+ import type { IBoardConnectorElement, IBoardElementData } from '@univerjs-pro/boards';
2
+ import { resolveBoardElementWorldBounds } from '@univerjs-pro/boards';
3
+ export interface IMindMapRootScopePreviewBounds {
4
+ left: number;
5
+ top: number;
6
+ }
7
+ export interface IResolveMindMapRootScopePreviewOptions {
8
+ elementData: Record<string, IBoardElementData>;
9
+ scopeId: string;
10
+ rootNodeId: string;
11
+ rootStartBounds: IMindMapRootScopePreviewBounds;
12
+ liveRootBounds: IMindMapRootScopePreviewBounds;
13
+ }
14
+ export type MindMapRootScopePreviewItem = {
15
+ kind: 'bounds';
16
+ elementId: string;
17
+ bounds: NonNullable<ReturnType<typeof resolveBoardElementWorldBounds>>;
18
+ } | {
19
+ kind: 'connector';
20
+ elementId: string;
21
+ element: IBoardConnectorElement;
22
+ };
23
+ export interface IMindMapRootScopePreview {
24
+ deltaX: number;
25
+ deltaY: number;
26
+ elementData: Record<string, IBoardElementData>;
27
+ items: MindMapRootScopePreviewItem[];
28
+ }
29
+ export declare function resolveMindMapRootScopePreview(options: IResolveMindMapRootScopePreviewOptions): IMindMapRootScopePreview | null;
@@ -0,0 +1,10 @@
1
+ export declare const BOARD_MIND_MAP_DESCRIPTION_DIALOG_KEY = "board.mind-map.description-dialog";
2
+ export declare const BOARD_MIND_MAP_DESCRIPTION_DIALOG_ID = "board-mind-map-description-dialog";
3
+ export declare const BOARD_MIND_MAP_DESCRIPTION_DIALOG_WIDTH = 420;
4
+ export interface IBoardMindMapDescriptionDialogProps {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ nodeId: string;
8
+ initialDescription?: string;
9
+ }
10
+ export declare function BoardMindMapDescriptionDialog(props: IBoardMindMapDescriptionDialogProps): import("react").JSX.Element;
@@ -0,0 +1,147 @@
1
+ import type { IBoardConnectorStyle } from '@univerjs-pro/boards';
2
+ import type { IMindMapContainerData, IUpdateMindMapNodeOperationParams, MindMapBranchLineType, MindMapStructureKind } from '@univerjs-pro/boards-mind';
3
+ import type { IShapeData } from '@univerjs-pro/engine-shape';
4
+ import type { IShapeTextUpdateOptions } from '@univerjs-pro/shape-editor-ui';
5
+ import type { ITextStyle } from '@univerjs/core';
6
+ import type { MindMapKeyboardShortcutAction } from '../controllers/board-mind-map-keyboard-shortcut.controller';
7
+ import type { LocaleKey } from '../locale/types';
8
+ import { HorizontalAlign, ICommandService, VerticalAlign } from '@univerjs/core';
9
+ import { IShortcutService } from '@univerjs/ui';
10
+ export declare const BOARD_MIND_MAP_FLOATING_TOOLBAR_KEY = "board.mind-map.floating-toolbar";
11
+ export declare const BOARD_MIND_MAP_LINE_WIDTH_RANGE: {
12
+ min: number;
13
+ max: number;
14
+ defaultValue: number;
15
+ };
16
+ export declare const BOARD_MIND_MAP_LINE_OPACITY_RANGE: {
17
+ min: number;
18
+ max: number;
19
+ defaultValue: number;
20
+ };
21
+ export type BoardMindMapLineType = 'solid' | 'dash' | 'dot';
22
+ export type BoardMindMapFloatingToolbarPanel = 'line' | 'more';
23
+ export type BoardMindMapFloatingToolbarPrimaryItem = {
24
+ kind: 'dropdown';
25
+ titleKey: LocaleKey;
26
+ panel: BoardMindMapFloatingToolbarPanel;
27
+ dividerBefore?: boolean;
28
+ } | {
29
+ kind: 'fontColor';
30
+ titleKey: LocaleKey;
31
+ dividerBefore?: boolean;
32
+ } | {
33
+ kind: 'typography';
34
+ titleKey: LocaleKey;
35
+ dividerBefore?: boolean;
36
+ };
37
+ export declare const BOARD_MIND_MAP_FLOATING_TOOLBAR_PRIMARY_ITEMS: BoardMindMapFloatingToolbarPrimaryItem[];
38
+ export declare const BOARD_MIND_MAP_FLOATING_TOOLBAR_PANELS: {
39
+ line: {
40
+ sections: readonly ["type", "width", "color", "opacity"];
41
+ };
42
+ more: {
43
+ actionKeys: readonly ["addSibling", "addChild", "copy", "paste", "delete"];
44
+ };
45
+ };
46
+ export declare const BOARD_MIND_MAP_MORE_ACTION_SHORTCUTS: {
47
+ readonly addSibling: "add-sibling-or-child";
48
+ readonly addChild: "add-child";
49
+ readonly copy: "copy";
50
+ readonly paste: "paste";
51
+ readonly delete: "delete";
52
+ };
53
+ export type BoardMindMapFloatingToolbarLayoutIcon = MindMapStructureKind | 'branch-curve' | 'branch-rounded-orthogonal' | 'branch-orthogonal';
54
+ export declare const BOARD_MIND_MAP_FLOATING_TOOLBAR_LAYOUT_GROUPS: readonly [{
55
+ readonly key: "mind-map";
56
+ readonly title: "Mind map";
57
+ readonly items: readonly [{
58
+ readonly value: "mindmap-horizontal";
59
+ readonly icon: "mindmap-horizontal";
60
+ }, {
61
+ readonly value: "mindmap-vertical";
62
+ readonly icon: "mindmap-vertical";
63
+ }];
64
+ }, {
65
+ readonly key: "tree-diagram";
66
+ readonly title: "Tree diagram";
67
+ readonly items: readonly [{
68
+ readonly value: "tree-right";
69
+ readonly icon: "tree-right";
70
+ }, {
71
+ readonly value: "tree-left";
72
+ readonly icon: "tree-left";
73
+ }, {
74
+ readonly value: "tree-alternate";
75
+ readonly icon: "tree-alternate";
76
+ }];
77
+ }, {
78
+ readonly key: "timeline";
79
+ readonly title: "Timeline";
80
+ readonly items: readonly [{
81
+ readonly value: "timeline-horizontal";
82
+ readonly icon: "timeline-horizontal";
83
+ }, {
84
+ readonly value: "timeline-vertical";
85
+ readonly icon: "timeline-vertical";
86
+ }];
87
+ }];
88
+ export declare const BOARD_MIND_MAP_FLOATING_TOOLBAR_BRANCH_GROUP: {
89
+ readonly key: "branch";
90
+ readonly title: "Branch";
91
+ readonly items: readonly [{
92
+ readonly value: "curve";
93
+ readonly icon: "branch-curve";
94
+ }, {
95
+ readonly value: "rounded-orthogonal";
96
+ readonly icon: "branch-rounded-orthogonal";
97
+ }, {
98
+ readonly value: "orthogonal";
99
+ readonly icon: "branch-orthogonal";
100
+ }];
101
+ };
102
+ interface IBoardMindMapFloatingToolbarExtraProps {
103
+ unitId: string;
104
+ subUnitId: string;
105
+ elementId: string;
106
+ scopeId: string;
107
+ isRootNode?: boolean;
108
+ left?: number;
109
+ top?: number;
110
+ shapeData?: IShapeData;
111
+ incomingConnectorStyle?: IBoardConnectorStyle;
112
+ layout?: IMindMapContainerData['layout'];
113
+ }
114
+ interface IBoardMindMapFloatingToolbarProps {
115
+ popup: {
116
+ extraProps?: IBoardMindMapFloatingToolbarExtraProps;
117
+ };
118
+ }
119
+ export declare function executeMindMapToolbarShortcut(commandService: ICommandService, action: MindMapKeyboardShortcutAction): void;
120
+ export declare function resolveMindMapToolbarTextState(shapeData: IShapeData | undefined): {
121
+ color: string;
122
+ fontSize: number;
123
+ horizontalAlign: HorizontalAlign;
124
+ textFill?: ITextStyle['textFill'];
125
+ verticalAlign: VerticalAlign;
126
+ };
127
+ export declare function resolveMindMapShortcutDisplay(shortcutService: Pick<IShortcutService, 'getShortcutDisplay'>, action?: MindMapKeyboardShortcutAction): string | undefined;
128
+ export declare function handleMindMapToolbarStructureKindChange(commandService: ICommandService, params: {
129
+ unitId: string;
130
+ subUnitId: string;
131
+ scopeId: string;
132
+ structureKind: MindMapStructureKind;
133
+ branchLineType?: MindMapBranchLineType;
134
+ }): Promise<boolean>;
135
+ export declare function handleMindMapToolbarBranchLineTypeChange(commandService: ICommandService, params: {
136
+ unitId: string;
137
+ subUnitId: string;
138
+ scopeId: string;
139
+ branchLineType: MindMapBranchLineType;
140
+ }): Promise<boolean>;
141
+ export declare function handleMindMapToolbarTextUpdate(params: IShapeTextUpdateOptions, updateNode: (params: {
142
+ textStyle: NonNullable<IUpdateMindMapNodeOperationParams['textStyle']>;
143
+ }) => void): void;
144
+ export declare function handleMindMapToolbarLineUpdate(shapeData: IShapeData | undefined, updateLine: (style: Record<string, unknown>) => void): void;
145
+ export declare function resolveMindMapLineShapeData(incomingConnectorStyle: IBoardConnectorStyle | undefined): IShapeData;
146
+ export declare function BoardMindMapFloatingToolbar(props: IBoardMindMapFloatingToolbarProps): import("react").JSX.Element | null;
147
+ export {};
@@ -0,0 +1,127 @@
1
+ import type { IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { IMindMapContainerData, MindMapBranchLineType, MindMapLayoutDirection, MindMapStructureKind } from '@univerjs-pro/boards-mind';
3
+ import type { CSSProperties, ReactNode } from 'react';
4
+ import type { LocaleKey } from '../locale/types';
5
+ import { ICommandService } from '@univerjs/core';
6
+ export declare const BOARD_MIND_MAP_PANEL_KEY = "board.mind-map.panel";
7
+ export declare const BOARD_MIND_MAP_PANEL_SIDEBAR_WIDTH = 388;
8
+ export declare const BOARD_MIND_MAP_PANEL_TABS: readonly ["structure", "layout", "importExport"];
9
+ export type BoardMindMapPanelTab = typeof BOARD_MIND_MAP_PANEL_TABS[number];
10
+ export type BoardMindMapPanelSpacingKey = 'horizontalGap' | 'siblingGap' | 'branchGap';
11
+ export declare const BOARD_MIND_MAP_PANEL_DEFAULT_SPACING: Record<BoardMindMapPanelSpacingKey, number>;
12
+ export declare const BOARD_MIND_MAP_PANEL_SPACING_CONTROLS: Array<{
13
+ labelKey: LocaleKey;
14
+ key: BoardMindMapPanelSpacingKey;
15
+ min: number;
16
+ max: number;
17
+ }>;
18
+ export declare const BOARD_MIND_MAP_PANEL_LAYOUT_DIRECTION_ITEMS: Array<{
19
+ labelKey: LocaleKey;
20
+ value: MindMapLayoutDirection;
21
+ }>;
22
+ export declare const BOARD_MIND_MAP_PANEL_STRUCTURE_ITEMS: Array<{
23
+ labelKey: LocaleKey;
24
+ value: MindMapStructureKind;
25
+ }>;
26
+ export declare const BOARD_MIND_MAP_PANEL_BRANCH_LINE_ITEMS: Array<{
27
+ labelKey: LocaleKey;
28
+ value: MindMapBranchLineType;
29
+ }>;
30
+ export interface IBoardMindMapPanelOutlineItem {
31
+ nodeId: string;
32
+ depth: number;
33
+ text: string;
34
+ }
35
+ export interface IBoardMindMapPanelProps {
36
+ unitId: string;
37
+ subUnitId: string;
38
+ scopeId: string;
39
+ nodeId?: string;
40
+ outlineItems?: IBoardMindMapPanelOutlineItem[];
41
+ layout?: IMindMapContainerData['layout'];
42
+ }
43
+ export declare function resolveMindMapPanelLayoutState(layout?: IMindMapContainerData['layout']): {
44
+ spacing: {
45
+ horizontalGap: number;
46
+ siblingGap: number;
47
+ branchGap: number;
48
+ };
49
+ direction: MindMapLayoutDirection;
50
+ structureKind: MindMapStructureKind;
51
+ branchLineType: MindMapBranchLineType;
52
+ };
53
+ export declare function handleMindMapPanelLayoutChange(commandService: ICommandService, params: {
54
+ unitId: string;
55
+ subUnitId: string;
56
+ scopeId: string;
57
+ direction?: MindMapLayoutDirection;
58
+ structureKind?: MindMapStructureKind;
59
+ branchLineType?: MindMapBranchLineType;
60
+ }): Promise<boolean>;
61
+ export declare function handleMindMapPanelLineTypeChange(commandService: ICommandService, params: {
62
+ unitId: string;
63
+ subUnitId: string;
64
+ scopeId: string;
65
+ branchLineType: MindMapBranchLineType;
66
+ }): Promise<boolean>;
67
+ export declare function handleMindMapPanelSpacingChange(commandService: ICommandService, params: {
68
+ unitId: string;
69
+ subUnitId: string;
70
+ scopeId: string;
71
+ horizontalGap?: number;
72
+ siblingGap?: number;
73
+ branchGap?: number;
74
+ }): Promise<boolean>;
75
+ export declare function handleMindMapPanelReorderNode(commandService: ICommandService, params: {
76
+ unitId: string;
77
+ subUnitId: string;
78
+ scopeId: string;
79
+ nodeId: string;
80
+ targetNodeId: string;
81
+ placement: 'before' | 'after';
82
+ }): Promise<boolean>;
83
+ export declare function handleMindMapPanelRenameNode(commandService: ICommandService, params: {
84
+ unitId: string;
85
+ subUnitId: string;
86
+ scopeId: string;
87
+ nodeId: string;
88
+ text: string;
89
+ }): Promise<boolean>;
90
+ export declare function writeMindMapPanelClipboardText(content: string): Promise<boolean>;
91
+ export declare function handleMindMapPanelExportOpml(commandService: ICommandService, params: {
92
+ unitId: string;
93
+ subUnitId: string;
94
+ scopeId: string;
95
+ }, writeText?: (content: string) => Promise<boolean | void>): Promise<boolean>;
96
+ export declare function handleMindMapPanelImportOpml(commandService: ICommandService, params: {
97
+ unitId: string;
98
+ subUnitId: string;
99
+ left: number;
100
+ top: number;
101
+ opml: string;
102
+ }): Promise<boolean>;
103
+ export declare function collectMindMapPanelOutlineItems(elementData: Record<string, IBoardElementData>, scopeId: string, fallbackText?: string): IBoardMindMapPanelOutlineItem[];
104
+ export declare function filterMindMapPanelOutlineItems(outlineItems: IBoardMindMapPanelOutlineItem[], query: string): IBoardMindMapPanelOutlineItem[];
105
+ export declare function resolveMindMapPanelOutlineIndent(depth: number): CSSProperties;
106
+ export declare function BoardMindMapPanelShell(props: {
107
+ children?: ReactNode;
108
+ }): import("react").JSX.Element;
109
+ export declare function BoardMindMapPanelTabs(props: {
110
+ items: Array<{
111
+ label: string;
112
+ value: BoardMindMapPanelTab;
113
+ }>;
114
+ value: BoardMindMapPanelTab;
115
+ onChange: (tab: BoardMindMapPanelTab) => void;
116
+ }): import("react").JSX.Element;
117
+ export declare function BoardMindMapPanelSection(props: {
118
+ titleKey: LocaleKey;
119
+ children?: ReactNode;
120
+ }): import("react").JSX.Element;
121
+ export declare function BoardMindMapPanelEmptyState(props: {
122
+ children?: ReactNode;
123
+ }): import("react").JSX.Element;
124
+ export declare function BoardMindMapPanelOutlineRenameButton(props: {
125
+ onClick: () => void;
126
+ }): import("react").JSX.Element;
127
+ export declare function BoardMindMapPanel(props: IBoardMindMapPanelProps): import("react").JSX.Element;