flow-mindmap 0.4.4 → 0.4.6
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/dist/components/MindMap.vue.d.ts +6 -2
- package/dist/composables/useHistory.d.ts +8 -3
- package/dist/composables/useKeyboard.d.ts +15 -1
- package/dist/composables/usePanZoom.d.ts +11 -1
- package/dist/flow-mindmap.js +3903 -3788
- package/dist/flow-mindmap.umd.cjs +55 -55
- package/dist/style.css +1 -1
- package/dist/tree.d.ts +9 -0
- package/dist/types.d.ts +13 -0
- package/package.json +1 -1
|
@@ -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: (
|
|
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?: ((
|
|
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
|
-
*
|
|
7
|
-
*
|
|
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
|
-
|
|
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,16 @@ 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;
|
|
19
33
|
onUndo: () => void;
|
|
20
34
|
onRedo: () => void;
|
|
21
35
|
/**
|
|
@@ -10,6 +10,13 @@ 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>;
|
|
@@ -20,7 +27,9 @@ export declare function usePanZoom(opts: PanZoomOptions): {
|
|
|
20
27
|
zoomIn: () => void;
|
|
21
28
|
zoomOut: () => void;
|
|
22
29
|
startPan: (e: PointerEvent | MouseEvent) => void;
|
|
23
|
-
startMarquee: (worldX: number, worldY: number
|
|
30
|
+
startMarquee: (worldX: number, worldY: number, opts?: {
|
|
31
|
+
shift?: boolean;
|
|
32
|
+
}) => void;
|
|
24
33
|
updateMarquee: (worldX: number, worldY: number) => void;
|
|
25
34
|
isMarquee: Ref<boolean, boolean>;
|
|
26
35
|
marquee: {
|
|
@@ -28,6 +37,7 @@ export declare function usePanZoom(opts: PanZoomOptions): {
|
|
|
28
37
|
y: number;
|
|
29
38
|
width: number;
|
|
30
39
|
height: number;
|
|
40
|
+
shiftKey?: boolean | undefined;
|
|
31
41
|
};
|
|
32
42
|
marqueeVersion: Ref<number, number>;
|
|
33
43
|
setOnMarqueeEnd: (cb: (() => void) | null) => void;
|