@umbraci/jsmind 0.10.14 → 0.10.15

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 (69) hide show
  1. package/LICENSE +24 -24
  2. package/README.md +116 -116
  3. package/dist/jsmind.copy-paste.js +9 -0
  4. package/dist/jsmind.copy-paste.js.map +1 -0
  5. package/dist/jsmind.draggable-node.js +1 -1
  6. package/dist/jsmind.draggable-node.js.map +1 -1
  7. package/dist/jsmind.history.js +1 -1
  8. package/dist/jsmind.history.js.map +1 -1
  9. package/dist/jsmind.js +1 -1
  10. package/dist/jsmind.js.map +1 -1
  11. package/dist/jsmind.multi-select.js +1 -1
  12. package/dist/jsmind.multi-select.js.map +1 -1
  13. package/dist/jsmind.multiline-text.js +1 -1
  14. package/dist/jsmind.multiline-text.js.map +1 -1
  15. package/dist/jsmind.screenshot.js +1 -1
  16. package/dist/jsmind.screenshot.js.map +1 -1
  17. package/es/jsmind.copy-paste.js +9 -0
  18. package/es/jsmind.copy-paste.js.map +1 -0
  19. package/es/jsmind.draggable-node.js +1 -1
  20. package/es/jsmind.draggable-node.js.map +1 -1
  21. package/es/jsmind.history.js +1 -1
  22. package/es/jsmind.history.js.map +1 -1
  23. package/es/jsmind.js +1 -1
  24. package/es/jsmind.js.map +1 -1
  25. package/es/jsmind.multi-select.js +1 -1
  26. package/es/jsmind.multi-select.js.map +1 -1
  27. package/es/jsmind.multiline-text.js +1 -1
  28. package/es/jsmind.multiline-text.js.map +1 -1
  29. package/es/jsmind.screenshot.js +1 -1
  30. package/es/jsmind.screenshot.js.map +1 -1
  31. package/lib/jsmind.copy-paste.js +9 -0
  32. package/lib/jsmind.copy-paste.js.map +1 -0
  33. package/lib/jsmind.draggable-node.js +1 -1
  34. package/lib/jsmind.draggable-node.js.map +1 -1
  35. package/lib/jsmind.history.js +1 -1
  36. package/lib/jsmind.history.js.map +1 -1
  37. package/lib/jsmind.js +1 -1
  38. package/lib/jsmind.js.map +1 -1
  39. package/lib/jsmind.multi-select.js +1 -1
  40. package/lib/jsmind.multi-select.js.map +1 -1
  41. package/lib/jsmind.multiline-text.js +1 -1
  42. package/lib/jsmind.multiline-text.js.map +1 -1
  43. package/lib/jsmind.screenshot.js +1 -1
  44. package/lib/jsmind.screenshot.js.map +1 -1
  45. package/package.json +115 -115
  46. package/style/jsmind.css +408 -408
  47. package/types/generated/index.d.ts +8 -0
  48. package/types/generated/jsmind.common.d.ts +68 -0
  49. package/types/generated/jsmind.d.ts +632 -0
  50. package/types/generated/jsmind.data_provider.d.ts +56 -0
  51. package/types/generated/jsmind.dom.d.ts +59 -0
  52. package/types/generated/jsmind.enhanced-plugin.d.ts +103 -0
  53. package/types/generated/jsmind.format.d.ts +113 -0
  54. package/types/generated/jsmind.graph.d.ts +180 -0
  55. package/types/generated/jsmind.layout_provider.d.ts +182 -0
  56. package/types/generated/jsmind.mind.d.ts +129 -0
  57. package/types/generated/jsmind.node.d.ts +69 -0
  58. package/types/generated/jsmind.option.d.ts +78 -0
  59. package/types/generated/jsmind.plugin.d.ts +21 -0
  60. package/types/generated/jsmind.shortcut_provider.d.ts +52 -0
  61. package/types/generated/jsmind.util.d.ts +26 -0
  62. package/types/generated/jsmind.view_provider.d.ts +374 -0
  63. package/types/generated/plugins/history/history-diff.d.ts +310 -0
  64. package/types/generated/plugins/history/jsmind.history.d.ts +87 -0
  65. package/types/generated/plugins/jsmind.draggable-node.d.ts +262 -0
  66. package/types/generated/plugins/jsmind.multiline-text-v2.d.ts +58 -0
  67. package/types/generated/plugins/jsmind.multiline-text.d.ts +43 -0
  68. package/types/generated/plugins/jsmind.screenshot.d.ts +83 -0
  69. package/types/tsconfig.declaration.json +19 -19
@@ -0,0 +1,632 @@
1
+ /**
2
+ * Event callback payload
3
+ * @typedef {{ evt?: string, data?: unknown[], node?: string }} EventData
4
+ */
5
+ /**
6
+ * jsMind runtime: orchestrates data/layout/view/shortcut and exposes public API.
7
+ */
8
+ declare class jsMind {
9
+ static mind: typeof Mind;
10
+ static node: typeof Node;
11
+ static direction: import("./jsmind.common.js").DirectionType;
12
+ static event_type: {
13
+ show: number;
14
+ resize: number;
15
+ edit: number;
16
+ select: number;
17
+ reset: number;
18
+ history_change: number;
19
+ };
20
+ static $: {
21
+ w: Window;
22
+ d: Document;
23
+ g: (id: string) => HTMLElement | null;
24
+ c: (tag: string) => HTMLElement;
25
+ t: (n: HTMLElement, t: string) => void;
26
+ h: (n: HTMLElement, t: string | HTMLElement) => void;
27
+ i: (el: unknown) => el is HTMLElement;
28
+ on: (t: HTMLElement, e: string, h: (ev: Event) => void) => void;
29
+ };
30
+ static plugin: typeof Plugin;
31
+ static register_plugin: typeof _register_plugin;
32
+ static util: {
33
+ file: {
34
+ read: (file: File, cb: (result: string, name: string) => void) => void;
35
+ save: (data: string, type: string, name: string) => void;
36
+ };
37
+ json: {
38
+ json2string: (v: unknown) => string;
39
+ string2json: (s: string) => unknown;
40
+ merge: (b: object, a: object) => object;
41
+ };
42
+ uuid: {
43
+ newid: () => string;
44
+ };
45
+ text: {
46
+ is_empty: (s?: string) => boolean;
47
+ };
48
+ };
49
+ static enhanced_plugin: typeof EnhancedPlugin;
50
+ /** @type {Array<import('./jsmind.enhanced-plugin.js').PluginDescriptor>} */
51
+ static enhancedPluginList: Array<import("./jsmind.enhanced-plugin.js").PluginDescriptor>;
52
+ /**
53
+ * Register an enhanced plugin
54
+ * @param {typeof EnhancedPlugin} PluginClass - Plugin class
55
+ * @param {object} [options={}] - Plugin options
56
+ * @returns {typeof jsMind}
57
+ */
58
+ static usePlugin(PluginClass: typeof EnhancedPlugin, options?: object): typeof jsMind;
59
+ /**
60
+ * Check if an enhanced plugin is registered
61
+ * @param {typeof EnhancedPlugin} PluginClass - Plugin class
62
+ * @returns {boolean}
63
+ */
64
+ static hasEnhancedPlugin(PluginClass: typeof EnhancedPlugin): boolean;
65
+ /**
66
+ * Deprecated: static show constructor helper.
67
+ * @param {import('./jsmind.option.js').JsMindRuntimeOptions} options
68
+ * @param {object | null} mind
69
+ * @returns {jsMind}
70
+ */
71
+ static show(options: import("./jsmind.option.js").JsMindRuntimeOptions, mind: object | null): jsMind;
72
+ /**
73
+ * Create a jsMind instance.
74
+ * @param {import('./jsmind.option.js').JsMindRuntimeOptions} options
75
+ */
76
+ constructor(options: import("./jsmind.option.js").JsMindRuntimeOptions);
77
+ options: import("./jsmind.option.js").JsMindRuntimeOptions;
78
+ version: string;
79
+ initialized: boolean;
80
+ mind: Mind;
81
+ /** @type {'single'|'multi'|null} */
82
+ _selection_mode: "single" | "multi" | null;
83
+ /** @type {import('./jsmind.node.js').Node|null} */
84
+ _last_selected_node: import("./jsmind.node.js").Node | null;
85
+ /** @type {Array<(type: number, data: EventData) => void>} */
86
+ event_handles: Array<(type: number, data: EventData) => void>;
87
+ /** Initialize sub-systems and plugins. */
88
+ init(): void;
89
+ enhancedPluginManager: EnhancedPluginManager;
90
+ data: DataProvider;
91
+ layout: LayoutProvider;
92
+ view: ViewProvider;
93
+ shortcut: ShortcutProvider;
94
+ /** @returns {boolean} whether current mind map is editable */
95
+ get_editable(): boolean;
96
+ /** enable editing */
97
+ enable_edit(): void;
98
+ /** disable editing */
99
+ disable_edit(): void;
100
+ /** @returns {boolean} whether view is draggable */
101
+ get_view_draggable(): boolean;
102
+ /** enable view dragging */
103
+ enable_view_draggable(): void;
104
+ /** disable view dragging */
105
+ disable_view_draggable(): void;
106
+ /**
107
+ * Enable default event handle.
108
+ * @param {'mousedown'|'click'|'dblclick'|'mousewheel'} event_handle
109
+ */
110
+ enable_event_handle(event_handle: "mousedown" | "click" | "dblclick" | "mousewheel"): void;
111
+ /**
112
+ * Disable default event handle.
113
+ * @param {'mousedown'|'click'|'dblclick'|'mousewheel'} event_handle
114
+ */
115
+ disable_event_handle(event_handle: "mousedown" | "click" | "dblclick" | "mousewheel"): void;
116
+ /**
117
+ * Set theme name.
118
+ * @param {string|null=} theme
119
+ */
120
+ set_theme(theme?: (string | null) | undefined): void;
121
+ /** bind internal DOM events */
122
+ _event_bind(): void;
123
+ /** @param {MouseEvent} e */
124
+ mousedown_handle(e: MouseEvent): void;
125
+ /** @param {MouseEvent} e */
126
+ click_handle(e: MouseEvent): void;
127
+ /** @param {MouseEvent} e */
128
+ dblclick_handle(e: MouseEvent): void;
129
+ /** @param {WheelEvent} e */
130
+ mousewheel_handle(e: WheelEvent): void;
131
+ /**
132
+ * Begin editing a node.
133
+ * @param {string | import('./jsmind.node.js').Node} node
134
+ * @returns {boolean|void}
135
+ */
136
+ begin_edit(node: string | import("./jsmind.node.js").Node): boolean | void;
137
+ /** End editing */
138
+ end_edit(): void;
139
+ /**
140
+ * Toggle a node's expanded state.
141
+ * @param {string | import('./jsmind.node.js').Node} node
142
+ * @returns {void}
143
+ */
144
+ toggle_node(node: string | import("./jsmind.node.js").Node): void;
145
+ /**
146
+ * Expand a node.
147
+ * @param {string | import('./jsmind.node.js').Node} node
148
+ * @returns {void}
149
+ */
150
+ expand_node(node: string | import("./jsmind.node.js").Node): void;
151
+ /**
152
+ * Collapse a node.
153
+ * @param {string | import('./jsmind.node.js').Node} node
154
+ * @returns {void}
155
+ */
156
+ collapse_node(node: string | import("./jsmind.node.js").Node): void;
157
+ /** Expand all nodes */
158
+ expand_all(): void;
159
+ /** Collapse all nodes */
160
+ collapse_all(): void;
161
+ /**
162
+ * Expand nodes up to a specified depth level.
163
+ * @param {number} depth
164
+ */
165
+ expand_to_depth(depth: number): void;
166
+ /** reset view/layout/data */
167
+ _reset(): void;
168
+ /**
169
+ * Internal show flow.
170
+ * @param {object | null} mind
171
+ * @param {boolean=} skip_centering
172
+ */
173
+ _show(mind: object | null, skip_centering?: boolean | undefined): void;
174
+ /**
175
+ * Show a mind (or example) on the canvas.
176
+ * @param {object | null} mind
177
+ * @param {boolean=} skip_centering
178
+ */
179
+ show(mind: object | null, skip_centering?: boolean | undefined): void;
180
+ /** @returns {{name:string,author:string,version:string}} */
181
+ get_meta(): {
182
+ name: string;
183
+ author: string;
184
+ version: string;
185
+ };
186
+ /**
187
+ * Serialize current mind to given format.
188
+ * @param {'node_tree'|'node_array'|'freemind'|'text'} [data_format]
189
+ * @returns {object}
190
+ */
191
+ get_data(data_format?: "node_tree" | "node_array" | "freemind" | "text"): object;
192
+ /** @returns {import('./jsmind.node.js').Node} */
193
+ get_root(): import("./jsmind.node.js").Node;
194
+ /**
195
+ * @param {string | import('./jsmind.node.js').Node} node
196
+ * @returns {import('./jsmind.node.js').Node}
197
+ */
198
+ get_node(node: string | import("./jsmind.node.js").Node): import("./jsmind.node.js").Node;
199
+ /**
200
+ * Get the level/depth of a node in the mind map.
201
+ * @param {string | import('./jsmind.node.js').Node} node - Node id or Node instance
202
+ * @returns {number} Node level (root node is 0, its children are 1, etc.)
203
+ */
204
+ get_node_level(node: string | import("./jsmind.node.js").Node): number;
205
+ /**
206
+ * Add node data to the mind map without triggering UI refresh.
207
+ * @private
208
+ * @param {import('./jsmind.node.js').Node} parent_node
209
+ * @param {string} node_id
210
+ * @param {string} topic
211
+ * @param {Record<string, any>=} data
212
+ * @param {('left'|'center'|'right'|'-1'|'0'|'1'|number)=} direction
213
+ * @returns {import('./jsmind.node.js').Node|null}
214
+ */
215
+ private _add_node_data;
216
+ /**
217
+ * Refresh UI after node changes.
218
+ * @private
219
+ * @param {import('./jsmind.node.js').Node} parent_node
220
+ */
221
+ private _refresh_node_ui;
222
+ /**
223
+ * Add a new node to the mind map.
224
+ * @param {string | import('./jsmind.node.js').Node} parent_node
225
+ * @param {string} node_id
226
+ * @param {string} topic
227
+ * @param {Record<string, any>=} data
228
+ * @param {('left'|'center'|'right'|'-1'|'0'|'1'|number)=} direction - Direction for node placement. Supports string values ('left', 'center', 'right'), numeric strings ('-1', '0', '1'), and numbers (-1, 0, 1)
229
+ * @returns {import('./jsmind.node.js').Node|null}
230
+ */
231
+ add_node(parent_node: string | import("./jsmind.node.js").Node, node_id: string, topic: string, data?: Record<string, any> | undefined, direction?: ("left" | "center" | "right" | "-1" | "0" | "1" | number) | undefined): import("./jsmind.node.js").Node | null;
232
+ /**
233
+ * Add multiple nodes in batch.
234
+ *
235
+ * This method provides atomic batch node creation with automatic rollback on failure.
236
+ * All nodes are created in a single operation, and if any node fails to create,
237
+ * all previously created nodes in this batch will be automatically removed.
238
+ *
239
+ * **Note**: This is a batch operation API that uses standard field names only.
240
+ * For data import with custom fieldNames, use `show()` instead.
241
+ *
242
+ * @example
243
+ * // Using standard field names
244
+ * jm.add_nodes('parent_id', [
245
+ * { id: 'node1', topic: 'Node 1', data: { color: 'red' }, children: [
246
+ * { id: 'node1-1', topic: 'Child 1' }
247
+ * ]}
248
+ * ]);
249
+ *
250
+ * @param {string | import('./jsmind.node.js').Node} parent_node - Parent node for all new nodes
251
+ * @param {Array<{id: string, topic: string, data?: Record<string, any>, direction?: ('left'|'center'|'right'|'-1'|'0'|'1'|number), children?: Array}>} nodes_data - Array of node data objects with standard field names (id, topic, children, data, direction)
252
+ * @returns {Array<import('./jsmind.node.js').Node|null>} Array of created nodes (flattened from all levels)
253
+ */
254
+ add_nodes(parent_node: string | import("./jsmind.node.js").Node, nodes_data: Array<{
255
+ id: string;
256
+ topic: string;
257
+ data?: Record<string, any>;
258
+ direction?: ("left" | "center" | "right" | "-1" | "0" | "1" | number);
259
+ children?: any[];
260
+ }>): Array<import("./jsmind.node.js").Node | null>;
261
+ /**
262
+ * Recursively add nodes using standard field names.
263
+ * This is a batch operation API that uses standard field names only.
264
+ * For data import with custom fieldNames, use `show()` instead.
265
+ * @private
266
+ * @param {import('./jsmind.node.js').Node} parent_node
267
+ * @param {object} node_data - Node data object with standard field names (id, topic, children, data, direction)
268
+ * @returns {Array<import('./jsmind.node.js').Node|null>}
269
+ */
270
+ private _add_nodes_recursive;
271
+ /**
272
+ * Count expected nodes recursively.
273
+ * Supports custom field names via options.fieldNames configuration.
274
+ * @private
275
+ * @param {Array} nodes_data
276
+ * @returns {number}
277
+ */
278
+ private _count_expected_nodes;
279
+ /**
280
+ * Clean up partially created nodes without triggering UI refresh for each node.
281
+ * @private
282
+ * @param {Array<import('./jsmind.node.js').Node>} created_nodes
283
+ */
284
+ private _cleanup_partial_nodes;
285
+ /**
286
+ * Insert a node before target node.
287
+ * @param {string | import('./jsmind.node.js').Node} node_before
288
+ * @param {string} node_id
289
+ * @param {string} topic
290
+ * @param {Record<string, any>=} data
291
+ * @param {('left'|'center'|'right'|'-1'|'0'|'1'|number)=} direction - Direction for node placement. Supports string values ('left', 'center', 'right'), numeric strings ('-1', '0', '1'), and numbers (-1, 0, 1)
292
+ * @returns {import('./jsmind.node.js').Node|null}
293
+ */
294
+ insert_node_before(node_before: string | import("./jsmind.node.js").Node, node_id: string, topic: string, data?: Record<string, any> | undefined, direction?: ("left" | "center" | "right" | "-1" | "0" | "1" | number) | undefined): import("./jsmind.node.js").Node | null;
295
+ /**
296
+ * Insert a node after target node.
297
+ * @param {string | import('./jsmind.node.js').Node} node_after
298
+ * @param {string} node_id
299
+ * @param {string} topic
300
+ * @param {Record<string, any>=} data
301
+ * @param {('left'|'center'|'right'|'-1'|'0'|'1'|number)=} direction - Direction for node placement. Supports string values ('left', 'center', 'right'), numeric strings ('-1', '0', '1'), and numbers (-1, 0, 1)
302
+ * @returns {import('./jsmind.node.js').Node|null}
303
+ */
304
+ insert_node_after(node_after: string | import("./jsmind.node.js").Node, node_id: string, topic: string, data?: Record<string, any> | undefined, direction?: ("left" | "center" | "right" | "-1" | "0" | "1" | number) | undefined): import("./jsmind.node.js").Node | null;
305
+ /**
306
+ * Remove a node.
307
+ * @param {string | import('./jsmind.node.js').Node} node
308
+ * @returns {boolean}
309
+ */
310
+ remove_node(node: string | import("./jsmind.node.js").Node): boolean;
311
+ /**
312
+ * Update node topic text or multiple node properties.
313
+ * @param {string} node_id - The ID of the node to update
314
+ * @param {string|Partial<Pick<import('./jsmind.node.js').Node, 'topic' | 'data' | 'id' | 'index' | 'expanded' | 'direction'>>} topic_or_updates - Topic string for backward compatibility, or partial Node object for comprehensive updates
315
+ */
316
+ update_node(node_id: string, topic_or_updates: string | Partial<Pick<import("./jsmind.node.js").Node, "topic" | "data" | "id" | "index" | "expanded" | "direction">>): void;
317
+ /**
318
+ * Move a node and optionally change direction.
319
+ * @param {string} node_id
320
+ * @param {string=} before_id - The ID of the node before which to place the moved node. Special values: "_first_", "_last_"
321
+ * @param {string=} parent_id
322
+ * @param {('left'|'center'|'right'|'-1'|'0'|'1'|number)=} direction - Direction for node placement. Supports string values ('left', 'center', 'right'), numeric strings ('-1', '0', '1'), and numbers (-1, 0, 1). Only effective for second-level nodes (children of root). If not provided, direction will be determined automatically.
323
+ */
324
+ move_node(node_id: string, before_id?: string | undefined, parent_id?: string | undefined, direction?: ("left" | "center" | "right" | "-1" | "0" | "1" | number) | undefined): void;
325
+ /**
326
+ * @param {string | import('./jsmind.node.js').Node} node
327
+ * @returns {void}
328
+ */
329
+ select_node(node: string | import("./jsmind.node.js").Node): void;
330
+ /**
331
+ * Get the currently selected node.
332
+ *
333
+ * This is a query API that returns the internal Node instance.
334
+ * For data export with custom fieldNames, use `get_data()` instead.
335
+ *
336
+ * @returns {import('./jsmind.node.js').Node|null} Node instance or null
337
+ */
338
+ get_selected_node(): import("./jsmind.node.js").Node | null;
339
+ /**
340
+ * Get all currently selected nodes.
341
+ * @returns {import('./jsmind.node.js').Node[]}
342
+ */
343
+ get_selected_nodes(): import("./jsmind.node.js").Node[];
344
+ /** clear selection */
345
+ select_clear(): void;
346
+ /**
347
+ * Toggle multi-selection for a node (and optionally descendants).
348
+ * @param {string | import('./jsmind.node.js').Node} node
349
+ */
350
+ toggle_subtree_selection(node: string | import("./jsmind.node.js").Node): void;
351
+ /**
352
+ * Determine whether a node is currently selected.
353
+ * @param {string | import('./jsmind.node.js').Node} node
354
+ * @returns {boolean}
355
+ */
356
+ is_node_selected(node: string | import("./jsmind.node.js").Node): boolean;
357
+ /** @param {string | import('./jsmind.node.js').Node} node */
358
+ is_node_visible(node: string | import("./jsmind.node.js").Node): boolean;
359
+ /**
360
+ * Scroll the mind map to center the specified node.
361
+ * @param {string | import('./jsmind.node.js').Node} node
362
+ */
363
+ scroll_node_to_center(node: string | import("./jsmind.node.js").Node): void;
364
+ /**
365
+ * Add nodes into the current selection set without clearing existing ones.
366
+ * @param {import('./jsmind.node.js').Node[]} nodes
367
+ * @returns {import('./jsmind.node.js').Node[]}
368
+ * @private
369
+ */
370
+ /**
371
+ * @param {import('./jsmind.node.js').Node[]} nodes
372
+ * @param {{focusNode?: import('./jsmind.node.js').Node}=} options
373
+ * @private
374
+ */
375
+ private _append_selection;
376
+ /**
377
+ * Remove nodes from the current selection set.
378
+ * @param {import('./jsmind.node.js').Node[]} nodes
379
+ * @returns {import('./jsmind.node.js').Node[]}
380
+ * @private
381
+ */
382
+ private _remove_selection;
383
+ /**
384
+ * Deselect a node and all its descendants from the current selection.
385
+ * @param {string | import('./jsmind.node.js').Node} node
386
+ * @private
387
+ */
388
+ private _deselect_subtree;
389
+ /**
390
+ * Clear all current selections and return the nodes that were cleared.
391
+ * @returns {import('./jsmind.node.js').Node[]}
392
+ * @private
393
+ */
394
+ private _clear_selection_state;
395
+ /**
396
+ * Collect a node and optionally its descendants respecting filters.
397
+ * @param {import('./jsmind.node.js').Node} node
398
+ * @param {{includeChildren?:boolean, respectFilter?:boolean, skipRootFilter?:boolean}=} config
399
+ * @returns {import('./jsmind.node.js').Node[]}
400
+ * @private
401
+ */
402
+ private _collect_subtree_nodes;
403
+ /**
404
+ * Ensure ancestors of provided nodes are also selected (up to first selected ancestor).
405
+ * @param {import('./jsmind.node.js').Node[]} nodes
406
+ * @param {import('./jsmind.node.js').Node=} focusNode
407
+ * @returns {import('./jsmind.node.js').Node[]}
408
+ * @private
409
+ */
410
+ /**
411
+ * @param {import('./jsmind.node.js').Node[]} nodes
412
+ * @param {import('./jsmind.node.js').Node=} focusNode
413
+ * @param {{requireAncestorChainSelected?: boolean}=} options
414
+ * @returns {import('./jsmind.node.js').Node[]}
415
+ * @private
416
+ */
417
+ private _ensure_ancestor_selection;
418
+ /**
419
+ * Get the configured selection filter callback, if any.
420
+ * @returns {((node: import('./jsmind.node.js').Node)=>boolean)|null}
421
+ * @private
422
+ */
423
+ private _get_selection_filter;
424
+ /**
425
+ * Determine the multi-select mode based on event modifiers.
426
+ * Returns: null (single select), 'ctrl' (add/remove), 'shift' (range select)
427
+ * @param {MouseEvent} e
428
+ * @returns {null|'ctrl'|'shift'}
429
+ * @private
430
+ */
431
+ private _get_multi_select_mode;
432
+ /**
433
+ * Toggle selection of a single node (add if not selected, remove if selected).
434
+ * Used for Ctrl+Click behavior.
435
+ * @param {string | import('./jsmind.node.js').Node} node_id
436
+ * @private
437
+ */
438
+ private _toggle_node_selection;
439
+ /**
440
+ * Range select nodes for Shift+Click behavior.
441
+ * Logic:
442
+ * - If no nodes are currently selected: select all nodes under the clicked node
443
+ * - If nodes are already selected: select nodes in the range from first selected to clicked node
444
+ * @param {string | import('./jsmind.node.js').Node} node_id
445
+ * @private
446
+ */
447
+ private _range_select_nodes;
448
+ /**
449
+ * Find all nodes between two nodes (for range selection).
450
+ * This includes both nodes and all nodes in between them in tree order.
451
+ * @param {import('./jsmind.node.js').Node} node1
452
+ * @param {import('./jsmind.node.js').Node} node2
453
+ * @returns {import('./jsmind.node.js').Node[]}
454
+ * @private
455
+ */
456
+ private _find_nodes_between;
457
+ /**
458
+ * Check whether ancestor is an ancestor of node.
459
+ * @param {import('./jsmind.node.js').Node} ancestor
460
+ * @param {import('./jsmind.node.js').Node} node
461
+ * @returns {boolean}
462
+ * @private
463
+ */
464
+ private _is_ancestor_of;
465
+ /**
466
+ * Return nodes along the ancestor->descendant chain, inclusive. If 'ancestor' is not actually
467
+ * an ancestor of 'descendant', returns empty array.
468
+ * @param {import('./jsmind.node.js').Node} ancestor
469
+ * @param {import('./jsmind.node.js').Node} descendant
470
+ * @returns {import('./jsmind.node.js').Node[]}
471
+ * @private
472
+ */
473
+ private _get_path_nodes;
474
+ /**
475
+ * Find nearest selected ancestor of the given node from current selection set.
476
+ * @param {import('./jsmind.node.js').Node} node
477
+ * @returns {import('./jsmind.node.js').Node|null}
478
+ * @private
479
+ */
480
+ private _find_nearest_selected_ancestor;
481
+ /**
482
+ * Find lowest common ancestor of two nodes.
483
+ * @param {import('./jsmind.node.js').Node} a
484
+ * @param {import('./jsmind.node.js').Node} b
485
+ * @returns {import('./jsmind.node.js').Node|null}
486
+ * @private
487
+ */
488
+ private _find_lca;
489
+ /**
490
+ * Given a lowest common ancestor 'lca' and a descendant 'node',
491
+ * return the direct child of lca that lies on the path to node.
492
+ * Returns null if node is not a descendant of lca or node === lca.
493
+ * @param {import('./jsmind.node.js').Node} lca
494
+ * @param {import('./jsmind.node.js').Node} node
495
+ * @returns {import('./jsmind.node.js').Node|null}
496
+ * @private
497
+ */
498
+ private _child_on_path;
499
+ /**
500
+ * From a list of nodes, remove those that are ancestors of any other node in the same list.
501
+ * Keeps only the deepest nodes so that we don't auto-select parents implicitly.
502
+ * @param {import('./jsmind.node.js').Node[]} nodes
503
+ * @returns {import('./jsmind.node.js').Node[]}
504
+ * @private
505
+ */
506
+ private _remove_ancestor_nodes;
507
+ /**
508
+ * From a list of nodes, remove those that are descendants of any other node in the same list.
509
+ * Keeps only top-most nodes so that expanding subtrees covers full branches across siblings.
510
+ * @param {import('./jsmind.node.js').Node[]} nodes
511
+ * @returns {import('./jsmind.node.js').Node[]}
512
+ * @private
513
+ */
514
+ private _remove_descendant_nodes;
515
+ /**
516
+ * Expand a set of base nodes with all their descendants (and themselves).
517
+ * @param {import('./jsmind.node.js').Node[]} nodes
518
+ * @param {{respectFilter?: boolean}=} opts
519
+ * @returns {Set<import('./jsmind.node.js').Node>}
520
+ * @private
521
+ */
522
+ private _expand_with_descendants;
523
+ /**
524
+ * Promote parents into selection ONLY when all their direct children are selected
525
+ * AND at least one ancestor of that parent is already selected (in previous selection set).
526
+ * This avoids auto-selecting parents when only siblings are selected.
527
+ * @param {Set<import('./jsmind.node.js').Node>} set
528
+ * @returns {Set<import('./jsmind.node.js').Node>}
529
+ * @private
530
+ */
531
+ private _promote_parents_when_children_selected;
532
+ /**
533
+ * Determine selection mode based on current selection size.
534
+ * @returns {'single'|'multi'|null}
535
+ * @private
536
+ */
537
+ private _derive_selection_mode;
538
+ /**
539
+ * Find the previous sibling node of the given node.
540
+ *
541
+ * @param {string | import('./jsmind.node.js').Node} node - Node id or Node instance
542
+ * @returns {import('./jsmind.node.js').Node | null}
543
+ */
544
+ find_node_before(node: string | import("./jsmind.node.js").Node): import("./jsmind.node.js").Node | null;
545
+ /**
546
+ * Find the next sibling node of the given node.
547
+ * @param {string | import('./jsmind.node.js').Node} node
548
+ * @returns {import('./jsmind.node.js').Node | null}
549
+ */
550
+ find_node_after(node: string | import("./jsmind.node.js").Node): import("./jsmind.node.js").Node | null;
551
+ /**
552
+ * Set background and foreground colors for a node.
553
+ * @param {string} node_id
554
+ * @param {string=} bg_color
555
+ * @param {string=} fg_color
556
+ * @returns {void}
557
+ */
558
+ set_node_color(node_id: string, bg_color?: string | undefined, fg_color?: string | undefined): void;
559
+ /**
560
+ * Set font style for a node.
561
+ * @param {string} node_id
562
+ * @param {number=} size
563
+ * @param {string=} weight
564
+ * @param {string=} style
565
+ * @returns {void}
566
+ */
567
+ set_node_font_style(node_id: string, size?: number | undefined, weight?: string | undefined, style?: string | undefined): void;
568
+ /**
569
+ * Set background image for a node.
570
+ * @param {string} node_id
571
+ * @param {string=} image
572
+ * @param {number=} width
573
+ * @param {number=} height
574
+ * @param {number=} rotation
575
+ * @returns {void}
576
+ */
577
+ set_node_background_image(node_id: string, image?: string | undefined, width?: number | undefined, height?: number | undefined, rotation?: number | undefined): void;
578
+ /**
579
+ * @param {string} node_id
580
+ * @param {number} rotation
581
+ * @returns {void}
582
+ */
583
+ set_node_background_rotation(node_id: string, rotation: number): void;
584
+ /** trigger view resize */
585
+ resize(): void;
586
+ /** @param {(type:number, data: EventData)=>void} callback */
587
+ add_event_listener(callback: (type: number, data: EventData) => void): void;
588
+ /** clear event listeners */
589
+ clear_event_listener(): void;
590
+ /** @param {number} type @param {EventData} data */
591
+ invoke_event_handle(type: number, data: EventData): void;
592
+ /** @param {number} type @param {EventData} data */
593
+ _invoke_event_handle(type: number, data: EventData): void;
594
+ /**
595
+ * Remove an enhanced plugin
596
+ * @param {typeof EnhancedPlugin} PluginClass - Plugin class
597
+ */
598
+ removePlugin(PluginClass: typeof EnhancedPlugin): void;
599
+ removePlugin(PluginClass: typeof EnhancedPlugin): void;
600
+ /**
601
+ * Get an enhanced plugin instance
602
+ * @param {string} instanceName - Plugin instance name
603
+ * @returns {EnhancedPlugin | undefined}
604
+ */
605
+ getPlugin(instanceName: string): EnhancedPlugin | undefined;
606
+ getPlugin(instanceName: string): EnhancedPlugin | undefined;
607
+ /**
608
+ * Destroy the jsMind instance and clean up resources
609
+ */
610
+ destroy(): void;
611
+ destroy(): void;
612
+ }
613
+ export default jsMind;
614
+ /**
615
+ * Event callback payload
616
+ */
617
+ export type EventData = {
618
+ evt?: string;
619
+ data?: unknown[];
620
+ node?: string;
621
+ };
622
+ export namespace jsMind { }
623
+ import { Mind } from './jsmind.mind.js';
624
+ import { EnhancedPluginManager } from './jsmind.enhanced-plugin.js';
625
+ import { DataProvider } from './jsmind.data_provider.js';
626
+ import { LayoutProvider } from './jsmind.layout_provider.js';
627
+ import { ViewProvider } from './jsmind.view_provider.js';
628
+ import { ShortcutProvider } from './jsmind.shortcut_provider.js';
629
+ import { EnhancedPlugin } from './jsmind.enhanced-plugin.js';
630
+ import { Node } from './jsmind.node.js';
631
+ import { Plugin } from './jsmind.plugin.js';
632
+ import { register as _register_plugin } from './jsmind.plugin.js';
@@ -0,0 +1,56 @@
1
+ export class DataProvider {
2
+ /**
3
+ * Data provider: loads and serializes mind data by format.
4
+ * @param {import('./jsmind.js').default} jm - jsMind instance
5
+ */
6
+ constructor(jm: import("./jsmind.js").default);
7
+ jm: import("./jsmind.js").default;
8
+ /** Initialize data provider. */
9
+ init(): void;
10
+ /** Reset data provider state. */
11
+ reset(): void;
12
+ /**
13
+ * Load a Mind from mixed source.
14
+ * @param {import('./jsmind.format.js').NodeTreeFormat|import('./jsmind.format.js').NodeArrayFormat|{meta?:{name:string,author:string,version:string},format:'freemind',data:string}|{meta?:{name:string,author:string,version:string},format:'text',data:string}} mind_data - object with {format,data} or a format-specific payload
15
+ * @returns {import('./jsmind.mind.js').Mind|null}
16
+ */
17
+ load(mind_data: import("./jsmind.format.js").NodeTreeFormat | import("./jsmind.format.js").NodeArrayFormat | {
18
+ meta?: {
19
+ name: string;
20
+ author: string;
21
+ version: string;
22
+ };
23
+ format: "freemind";
24
+ data: string;
25
+ } | {
26
+ meta?: {
27
+ name: string;
28
+ author: string;
29
+ version: string;
30
+ };
31
+ format: "text";
32
+ data: string;
33
+ }): import("./jsmind.mind.js").Mind | null;
34
+ /**
35
+ * Serialize current mind to target format.
36
+ * @param {'node_tree'|'node_array'|'freemind'|'text'} data_format
37
+ * @returns {import('./jsmind.format.js').NodeTreeFormat|import('./jsmind.format.js').NodeArrayFormat|{meta:{name:string,author:string,version:string},format:'freemind',data:string}|{meta:{name:string,author:string,version:string},format:'text',data:string}}
38
+ */
39
+ get_data(data_format: "node_tree" | "node_array" | "freemind" | "text"): import("./jsmind.format.js").NodeTreeFormat | import("./jsmind.format.js").NodeArrayFormat | {
40
+ meta: {
41
+ name: string;
42
+ author: string;
43
+ version: string;
44
+ };
45
+ format: "freemind";
46
+ data: string;
47
+ } | {
48
+ meta: {
49
+ name: string;
50
+ author: string;
51
+ version: string;
52
+ };
53
+ format: "text";
54
+ data: string;
55
+ };
56
+ }