flow-mindmap 0.4.5 → 0.4.7

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.
@@ -47,6 +47,10 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
47
47
  moveNode: (srcId: string, targetId: string, position: "before" | "after" | "child") => boolean;
48
48
  getData: () => MindMapNode;
49
49
  nodeHasContent: (id: string) => boolean;
50
+ getSelectedIds: () => string[];
51
+ copyNodes: (ids: string[]) => void;
52
+ cutNodes: (ids: string[]) => void;
53
+ pasteNodes: (targetId: string | null) => void;
50
54
  setData: (data: MindMapNode) => void;
51
55
  resetView: () => void;
52
56
  exportData: () => string;
@@ -82,7 +86,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
82
86
  lineWidthForDepth: (depth: number) => number;
83
87
  endWidthForDepth: (depth: number) => number;
84
88
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
85
- select: (node: MindMapNode | null) => any;
89
+ select: (nodes: MindMapNode[] | null) => any;
86
90
  change: (data: MindMapNode) => any;
87
91
  "edit-note": (nodeId: string) => any;
88
92
  markdownChange: (markdown: string) => any;
@@ -92,7 +96,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {
92
96
  "canvas-data": () => any;
93
97
  "canvas-import": (mode: "markdown" | "txt" | "json") => any;
94
98
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
95
- onSelect?: ((node: MindMapNode | null) => any) | undefined;
99
+ onSelect?: ((nodes: MindMapNode[] | null) => any) | undefined;
96
100
  onChange?: ((data: MindMapNode) => any) | undefined;
97
101
  "onEdit-note"?: ((nodeId: string) => any) | undefined;
98
102
  onMarkdownChange?: ((markdown: string) => any) | undefined;
@@ -2,12 +2,17 @@ import type { MindMapNode } from '../types';
2
2
  /**
3
3
  * Linear undo/redo history for the mind map.
4
4
  *
5
- * Each entry stores the data tree (full JSON snapshot).
6
- * Snapshots are deep-cloned JSON strings (one string per state). The
7
- * timeline is bounded so a long session doesn't grow without limit.
5
+ * Each entry stores the data tree (full JSON snapshot) plus the
6
+ * multi-select state, so undo / redo restores both the tree shape
7
+ * and the user's selection. Snapshots are deep-cloned JSON
8
+ * strings (one string per state). The timeline is bounded so a
9
+ * long session doesn't grow without limit.
8
10
  */
9
11
  export interface HistoryState {
10
12
  data: MindMapNode;
13
+ /** Selected node ids at snapshot time. Optional so older
14
+ * snapshots without it remain loadable. */
15
+ selectedIds?: string[];
11
16
  }
12
17
  export declare function useHistory(maxSize?: number): {
13
18
  canUndo: () => boolean;
@@ -2,7 +2,11 @@ export interface KeyboardOptions {
2
2
  isEditing: () => boolean;
3
3
  isReadonly: () => boolean;
4
4
  getSelectedId: () => string | null;
5
- getRootId: () => string;
5
+ /**
6
+ * Multi-select view of the current selection. Returned in
7
+ * preorder (root-first) so consumers can iterate top-down.
8
+ * Empty when nothing is selected. */
9
+ getSelectedIds: () => string[];
6
10
  /**
7
11
  * Called when Tab/Enter fires and no node is selected — defaults the
8
12
  * action to the root node so the user can build a tree from scratch
@@ -16,6 +20,22 @@ export interface KeyboardOptions {
16
20
  onStartEdit: (id: string) => void;
17
21
  onClearSelection: () => void;
18
22
  onDuplicate: (id: string) => void;
23
+ /** Copy the currently selected subtrees into the host's clipboard
24
+ * buffer. No-op when the selection is empty. */
25
+ onCopy: (ids: string[]) => void;
26
+ /** Cut the currently selected subtrees (copy + remove from tree).
27
+ * No-op when the selection is empty. */
28
+ onCut: (ids: string[]) => void;
29
+ /** Paste the host's clipboard buffer under `targetId` (defaults to
30
+ * the primary selected node, or the root when nothing is selected).
31
+ * `targetId === null` means "default to root". */
32
+ onPaste: (targetId: string | null) => void;
33
+ /** Returns true when the host's internal clipboard buffer has at
34
+ * least one copied node ready to paste. When false, Ctrl+V is
35
+ * NOT intercepted so the browser's native `paste` event fires —
36
+ * this lets the onPaste(ClipboardEvent) handler pick up image
37
+ * data from the system clipboard. */
38
+ hasClipboard: () => boolean;
19
39
  onUndo: () => void;
20
40
  onRedo: () => void;
21
41
  /**
@@ -10,17 +10,27 @@ export interface MarqueeRect {
10
10
  y: number;
11
11
  width: number;
12
12
  height: number;
13
+ /**
14
+ * Captured at the start of the marquee gesture. `true` when the
15
+ * user held Shift while pressing the mouse — the consumer
16
+ * (`onMarqueeEnd`) uses this to decide between extending the
17
+ * existing selection set (shift) and replacing it (no shift).
18
+ */
19
+ shiftKey?: boolean;
13
20
  }
14
21
  export declare function usePanZoom(opts: PanZoomOptions): {
15
22
  scale: Ref<number, number>;
16
23
  offsetX: Ref<number, number>;
17
24
  offsetY: Ref<number, number>;
18
25
  isPanning: Ref<boolean, boolean>;
26
+ panMoved: Ref<boolean, boolean>;
19
27
  onWheel: (e: WheelEvent) => void;
20
28
  zoomIn: () => void;
21
29
  zoomOut: () => void;
22
30
  startPan: (e: PointerEvent | MouseEvent) => void;
23
- startMarquee: (worldX: number, worldY: number) => void;
31
+ startMarquee: (worldX: number, worldY: number, opts?: {
32
+ shift?: boolean;
33
+ }) => void;
24
34
  updateMarquee: (worldX: number, worldY: number) => void;
25
35
  isMarquee: Ref<boolean, boolean>;
26
36
  marquee: {
@@ -28,6 +38,7 @@ export declare function usePanZoom(opts: PanZoomOptions): {
28
38
  y: number;
29
39
  width: number;
30
40
  height: number;
41
+ shiftKey?: boolean | undefined;
31
42
  };
32
43
  marqueeVersion: Ref<number, number>;
33
44
  setOnMarqueeEnd: (cb: (() => void) | null) => void;