@umbraci/jsmind 0.10.7 → 0.10.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraci/jsmind",
3
- "version": "0.10.7",
3
+ "version": "0.10.9",
4
4
  "description": "jsMind is a pure javascript library for mindmap, it base on html5 canvas. jsMind was released under BSD license, you can embed it in any project, if only you observe the license.",
5
5
  "main": "lib/jsmind.js",
6
6
  "module": "es/jsmind.js",
@@ -99,7 +99,11 @@
99
99
  "testEnvironment": "jsdom"
100
100
  },
101
101
  "sideEffects": [
102
- "./es6/*"
102
+ "./es6/*",
103
+ "./es/*.js",
104
+ "./lib/*.js",
105
+ "./dist/*.js",
106
+ "./style/*.css"
103
107
  ],
104
108
  "dependencies": {
105
109
  "fast-equals": "^5.3.2"
@@ -192,6 +192,12 @@ declare class jsMind {
192
192
  * @returns {import('./jsmind.node.js').Node}
193
193
  */
194
194
  get_node(node: string | import("./jsmind.node.js").Node): import("./jsmind.node.js").Node;
195
+ /**
196
+ * Get the level/depth of a node in the mind map.
197
+ * @param {string | import('./jsmind.node.js').Node} node - Node id or Node instance
198
+ * @returns {number} Node level (root node is 0, its children are 1, etc.)
199
+ */
200
+ get_node_level(node: string | import("./jsmind.node.js").Node): number;
195
201
  /**
196
202
  * Add node data to the mind map without triggering UI refresh.
197
203
  * @private
@@ -12,13 +12,13 @@
12
12
  * // With default fieldNames
13
13
  * const tree = { data: { id: 'root', topic: 'Root', children: [...] } };
14
14
  * const flatMap = flatten(tree);
15
- * const rootNode = flatMap.get('root'); // { id: 'root', topic: 'Root', data: {...}, _parentid: null, _order: 0 }
15
+ * const rootNode = flatMap.get('root'); // { id: 'root', topic: 'Root', data: {...}, parentid: null, index: 0 }
16
16
  *
17
17
  * @example
18
18
  * // With custom fieldNames: { topic: 'name' }
19
19
  * const tree = { data: { id: 'root', name: 'Root', children: [...] } };
20
20
  * const flatMap = flatten(tree, { fields: ['name', 'data', 'id'] });
21
- * const rootNode = flatMap.get('root'); // { id: 'root', name: 'Root', data: {...}, _parentid: null, _order: 0 }
21
+ * const rootNode = flatMap.get('root'); // { id: 'root', name: 'Root', data: {...}, parentid: null, index: 0 }
22
22
  */
23
23
  export function flatten(tree: NodeTreeFormat | NodeTreeData, opts?: FlattenOptions): Map<string, FlatNode>;
24
24
  /**
@@ -91,11 +91,11 @@ export type FlatNode = {
91
91
  /**
92
92
  * - Parent node ID (structure field)
93
93
  */
94
- _parentid?: string | null;
94
+ parentid?: string | null;
95
95
  /**
96
96
  * - Node order in parent's children (structure field)
97
97
  */
98
- _order?: number;
98
+ index?: number;
99
99
  };
100
100
  export type ChangeDetail = {
101
101
  /**
@@ -261,7 +261,7 @@ export type FlattenOptions = {
261
261
  */
262
262
  childrenKey?: string;
263
263
  /**
264
- * - Whether to include _parentid and _order. Defaults to true
264
+ * - Whether to include parentid and index. Defaults to true
265
265
  */
266
266
  includeStructure?: boolean;
267
267
  };
@@ -287,7 +287,7 @@ export type DiffOptions = {
287
287
  */
288
288
  childrenKey?: string;
289
289
  /**
290
- * - Whether to include _parentid and _order in comparison. Defaults to true
290
+ * - Whether to include parentid and index in comparison. Defaults to true
291
291
  */
292
292
  includeStructure?: boolean;
293
293
  /**
@@ -258,8 +258,5 @@ export type DraggableNodeOptions = {
258
258
  scrolling_trigger_width?: number;
259
259
  scrolling_step_length?: number;
260
260
  shadow_node_class_name?: string;
261
- /**
262
- * - Function to validate drag operation, receives (draggedNode, targetNode) and returns boolean to allow/deny
263
- */
264
- before_drop?: Function;
261
+ validate_drag?: (draggedNode: import("../jsmind.node.js").Node, targetNode: import("../jsmind.node.js").Node | null) => boolean;
265
262
  };