flow-mindmap 0.1.0-beta.1 → 0.1.1-beta.1

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.
@@ -12,6 +12,24 @@ type __VLS_Props = {
12
12
  * the canvas's own chrome.
13
13
  */
14
14
  previewMode?: boolean;
15
+ /**
16
+ * Optional raw markdown source. When set, the component parses
17
+ * it into the data tree and ignores `data` (use one or the
18
+ * other). Editing nodes on the canvas emits `markdownChange`
19
+ * with the re-serialized form, so the host can keep its
20
+ * markdown source in sync without polling. Pass an empty
21
+ * string to clear.
22
+ */
23
+ markdown?: string;
24
+ /**
25
+ * Optional per-edge color list. When set, top-level branches
26
+ * draw their edges (and their descendant edges under
27
+ * `rainbowBranch`) using these colors in order, wrapping
28
+ * around. Overrides the palette picked by `branchPaletteId`
29
+ * / `customPalettes`. Pass an empty array to fall back to
30
+ * the palette pipeline.
31
+ */
32
+ lineColors?: string[];
15
33
  };
16
34
  declare const _default: import("vue").DefineComponent<__VLS_Props, {
17
35
  addChild: (parentId: string) => void;
@@ -25,6 +43,8 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
25
43
  resetView: () => void;
26
44
  exportData: () => string;
27
45
  importData: (json: string) => boolean;
46
+ getMarkdown: () => string;
47
+ setMarkdown: (md: string, emitMarkdownChange?: boolean) => void;
28
48
  setBalanced: (value: boolean) => void;
29
49
  isBalanced: () => boolean;
30
50
  balance: () => void;
@@ -49,10 +69,12 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
49
69
  select: (node: MindMapNode | null) => any;
50
70
  change: (data: MindMapNode) => any;
51
71
  "edit-note": (nodeId: string) => any;
72
+ markdownChange: (markdown: string) => any;
52
73
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
53
74
  onSelect?: ((node: MindMapNode | null) => any) | undefined;
54
75
  onChange?: ((data: MindMapNode) => any) | undefined;
55
76
  "onEdit-note"?: ((nodeId: string) => any) | undefined;
77
+ onMarkdownChange?: ((markdown: string) => any) | undefined;
56
78
  }>, {
57
79
  readonly: boolean;
58
80
  previewMode: boolean;
@@ -48,13 +48,21 @@ export interface LayoutNode {
48
48
  parent: LayoutNode | null;
49
49
  }
50
50
  import type { MindMapNode, MindMapImage } from '../types';
51
- declare function heightAt(depth: number): number;
52
- declare function fontAt(depth: number): number;
51
+ /** Return the rendered font size for a node at the given depth, scaled
52
+ * by the host's `theme.fontSize` (default 14). The base table is
53
+ * tuned at 14px; values scale linearly so a 30px theme produces
54
+ * roughly 2.14× larger nodes. */
55
+ declare function fontAt(depth: number, baseFontSize?: number): number;
56
+ declare function heightAt(depth: number, baseFontSize?: number): number;
53
57
  export type LayoutMode = 'mindmap' | 'tree' | 'org';
54
58
  export interface LayoutOptions {
55
59
  mode?: LayoutMode;
56
60
  /** @deprecated kept for API compat; ignored in 1.html-style layout. */
57
61
  balanced?: boolean;
62
+ /** Base font size (px) used to scale node metrics (font/height/
63
+ * min-width). The internal tier table is tuned for 14px; values
64
+ * scale linearly. Default 14. */
65
+ baseFontSize?: number;
58
66
  /**
59
67
  * When true, layout() leaves each LayoutNode's existing x/y in
60
68
  * place — it still does the doLayout split / redirect / stack
package/dist/entry.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import MindMap from './components/MindMap.vue';
2
2
  import type { App } from 'vue';
3
- import type { MindMapNode, MindMapOptions, MindMapTheme, MindMapExpose } from './types';
4
- import { uid, clone, findNode, findParent, removeNode, addChild, addSibling } from './tree';
5
- export type { MindMapNode, MindMapOptions, MindMapTheme, MindMapExpose };
3
+ import type { MindMapNode, MindMapOptions, MindMapTheme, MindMapExpose, MindMapSettings, NodeStyle, LineStyle, LayoutMode, BranchPalette, BranchPaletteId } from './types';
4
+ import { uid, clone, findNode, findParent, removeNode, addChild, addSibling, markdownToMindMap, mindMapToMarkdown } from './tree';
5
+ export type { MindMapNode, MindMapOptions, MindMapTheme, MindMapExpose, MindMapSettings, NodeStyle, LineStyle, LayoutMode, BranchPalette, BranchPaletteId };
6
6
  export { MindMap };
7
- export { uid, clone, findNode, findParent, removeNode, addChild, addSibling };
7
+ export { uid, clone, findNode, findParent, removeNode, addChild, addSibling, markdownToMindMap, mindMapToMarkdown };
8
8
  declare const plugin: {
9
9
  install(app: App): void;
10
10
  };
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
2
+ <circle cx="12" cy="12" r="2.2" />
3
+ <circle cx="4" cy="5" r="1.6" />
4
+ <circle cx="20" cy="5" r="1.6" />
5
+ <circle cx="4" cy="19" r="1.6" />
6
+ <circle cx="20" cy="19" r="1.6" />
7
+ <line x1="10.5" y1="10.8" x2="5.2" y2="6.4" />
8
+ <line x1="13.5" y1="10.8" x2="18.8" y2="6.4" />
9
+ <line x1="10.5" y1="13.2" x2="5.2" y2="17.6" />
10
+ <line x1="13.5" y1="13.2" x2="18.8" y2="17.6" />
11
+ </svg>