flow-mindmap 0.5.12 → 0.6.0

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.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # flow-mindmap
2
2
 
3
- A modern, minimalist mind mapping tool — xmind-style, embeddable as a Vue 3 component.
4
-
5
- <p align="center">
6
- <img src="https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.11/docs/screenshots/overview.png" alt="flow-mindmap overview" width="780" />
7
- </p>
8
-
9
- ## 特性
10
-
3
+ A modern, minimalist mind mapping tool — xmind-style, embeddable as a Vue 3 component.
4
+
5
+ <p align="center">
6
+ <img src="https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.13/docs/screenshots/overview.png" alt="flow-mindmap overview" width="780" />
7
+ </p>
8
+
9
+ ## 特性
10
+
11
11
  - 纯 SVG 渲染,矢量缩放无损
12
12
  - 拖拽、缩放、平移画布
13
13
  - 键盘快捷键: `Tab` 添加子节点 / `Enter` 添加同级 / `F2` 编辑 / `Delete` 删除节点
@@ -18,19 +18,19 @@ A modern, minimalist mind mapping tool — xmind-style, embeddable as a Vue 3 co
18
18
  - 扁平化 SVG 线框图标,无任何 Emoji
19
19
  - Apache-2.0 开源协议,可在 npm 安装作为组件使用
20
20
 
21
- ## 预览
22
-
23
- ### 三种布局
24
-
25
- | mindmap(默认) | tree(右向树) | org(向下组织结构) |
26
- | :-: | :-: | :-: |
27
- | ![](https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.11/docs/screenshots/layout-mindmap.png) | ![](https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.11/docs/screenshots/layout-tree.png) | ![](https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.11/docs/screenshots/layout-org.png) |
28
-
29
- ### 可调画板
30
-
31
- 右键画布 → 设置 打开右侧抽屉,所有视觉项实时生效:
32
-
33
- ![settings panel](https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.11/docs/screenshots/settings-panel.png)
21
+ ## 预览
22
+
23
+ ### 三种布局
24
+
25
+ | mindmap(默认) | tree(右向树) | org(向下组织结构) |
26
+ | :-: | :-: | :-: |
27
+ | ![](https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.13/docs/screenshots/layout-mindmap.png) | ![](https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.13/docs/screenshots/layout-tree.png) | ![](https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.13/docs/screenshots/layout-org.png) |
28
+
29
+ ### 可调画板
30
+
31
+ 右键画布 → 设置 打开右侧抽屉,所有视觉项实时生效:
32
+
33
+ ![settings panel](https://cdn.jsdelivr.net/gh/xz333221/flow-mindmap@v0.5.13/docs/screenshots/settings-panel.png)
34
34
 
35
35
 
36
36
  ## 安装
@@ -1,4 +1,4 @@
1
- import type { MindMapNode, MindMapTheme, MindMapSettings, NodeStyle, MindMapImage } from '../types';
1
+ import type { MindMapNode, MindMapTheme, MindMapSettings, NodeStyle, MindMapImage, MindMapRelation } from '../types';
2
2
  type __VLS_Props = {
3
3
  data: MindMapNode;
4
4
  theme?: MindMapTheme;
@@ -105,6 +105,10 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
105
105
  searchNodes: (query: string) => string[];
106
106
  getSearchResults: () => string[];
107
107
  getSearchIndex: () => number;
108
+ addRelation: (fromId: string, toId: string) => string | null;
109
+ removeRelation: (relationId: string) => void;
110
+ updateRelation: (relationId: string, patch: Partial<Omit<MindMapRelation, "id" | "fromId" | "toId">>) => void;
111
+ getRelations: () => MindMapRelation[];
108
112
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
109
113
  select: (nodes: MindMapNode[] | null) => any;
110
114
  change: (data: MindMapNode) => any;
@@ -49,6 +49,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
49
49
  clearMarkers: () => any;
50
50
  addTag: () => any;
51
51
  removeTags: () => any;
52
+ addRelation: () => any;
52
53
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
53
54
  onClose?: (() => any) | undefined;
54
55
  onPickImage?: (() => any) | undefined;
@@ -67,6 +68,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
67
68
  onClearMarkers?: (() => any) | undefined;
68
69
  onAddTag?: (() => any) | undefined;
69
70
  onRemoveTags?: (() => any) | undefined;
71
+ onAddRelation?: (() => any) | undefined;
70
72
  }>, {
71
73
  hasImage: boolean;
72
74
  hasLink: boolean;
@@ -98,6 +98,10 @@ export interface LayoutOptions {
98
98
  * min-width). The internal tier table is tuned for 14px; values
99
99
  * scale linearly. Default 14. */
100
100
  baseFontSize?: number;
101
+ /** Extra vertical gap (px) between first-level branches (children
102
+ * of the root). Adds to the base V_GAP so each top-level subtree
103
+ * gets more breathing room. Default 0 (no extra gap). */
104
+ branchGap?: number;
101
105
  /**
102
106
  * When true, layout() leaves each LayoutNode's existing x/y in
103
107
  * place — it still does the doLayout split / redirect / stack