@tmagic/utils 1.8.0-beta.5 → 1.8.0-beta.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.
package/dist/es/index.js CHANGED
@@ -44,7 +44,8 @@ var getNodeInfo = (id, root, skip) => {
44
44
  const info = {
45
45
  node: null,
46
46
  parent: null,
47
- page: null
47
+ page: null,
48
+ path: []
48
49
  };
49
50
  if (!root) return info;
50
51
  if (id === root.id) {
@@ -52,6 +53,7 @@ var getNodeInfo = (id, root, skip) => {
52
53
  return info;
53
54
  }
54
55
  const path = getNodePath(id, root.items, skip);
56
+ info.path = path;
55
57
  if (!path.length) return info;
56
58
  path.unshift(root);
57
59
  info.node = path[path.length - 1];
@@ -2369,7 +2369,8 @@
2369
2369
  const info = {
2370
2370
  node: null,
2371
2371
  parent: null,
2372
- page: null
2372
+ page: null,
2373
+ path: []
2373
2374
  };
2374
2375
  if (!root) return info;
2375
2376
  if (id === root.id) {
@@ -2377,6 +2378,7 @@
2377
2378
  return info;
2378
2379
  }
2379
2380
  const path = getNodePath(id, root.items, skip);
2381
+ info.path = path;
2380
2382
  if (!path.length) return info;
2381
2383
  path.unshift(root);
2382
2384
  info.node = path[path.length - 1];
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.0-beta.5",
2
+ "version": "1.8.0-beta.7",
3
3
  "name": "@tmagic/utils",
4
4
  "type": "module",
5
5
  "sideEffects": false,
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "peerDependencies": {
37
37
  "typescript": "^6.0.3",
38
- "@tmagic/schema": "1.8.0-beta.5"
38
+ "@tmagic/schema": "1.8.0-beta.7"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "typescript": {
package/src/index.ts CHANGED
@@ -121,6 +121,7 @@ export const getNodeInfo = (id: Id, root: { id: Id; items?: MNode[] } | null, sk
121
121
  node: null,
122
122
  parent: null,
123
123
  page: null,
124
+ path: [],
124
125
  };
125
126
 
126
127
  if (!root) return info;
@@ -131,6 +132,7 @@ export const getNodeInfo = (id: Id, root: { id: Id; items?: MNode[] } | null, sk
131
132
  }
132
133
 
133
134
  const path = getNodePath(id, root.items, skip);
135
+ info.path = path;
134
136
 
135
137
  if (!path.length) return info;
136
138
 
package/types/index.d.ts CHANGED
@@ -6,6 +6,7 @@ interface EditorNodeInfo {
6
6
  node: MNode$1 | null;
7
7
  parent: MContainer | null;
8
8
  page: MPage | MPageFragment | null;
9
+ path: MNode$1[];
9
10
  }
10
11
  //#endregion
11
12
  //#region temp/packages/utils/src/dom.d.ts