@lvce-editor/explorer-view 7.16.1 → 7.17.0

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.
@@ -3383,14 +3383,11 @@ const compareNodes = (oldNode, newNode) => {
3383
3383
  }
3384
3384
  const patches = [];
3385
3385
  // Handle reference nodes - special handling for uid changes
3386
- if (oldNode.type === Reference) {
3387
- if (oldNode.uid !== newNode.uid) {
3388
- patches.push({
3389
- type: SetReferenceNodeUid,
3390
- uid: newNode.uid
3391
- });
3392
- }
3393
- return patches;
3386
+ if (oldNode.type === Reference && oldNode.uid !== newNode.uid) {
3387
+ patches.push({
3388
+ type: SetReferenceNodeUid,
3389
+ uid: newNode.uid
3390
+ });
3394
3391
  }
3395
3392
  // Handle text nodes
3396
3393
  if (oldNode.type === Text && newNode.type === Text) {
@@ -3403,8 +3400,8 @@ const compareNodes = (oldNode, newNode) => {
3403
3400
  return patches;
3404
3401
  }
3405
3402
  // Compare attributes
3406
- const oldKeys = getKeys(oldNode);
3407
- const newKeys = getKeys(newNode);
3403
+ const oldKeys = getKeys(oldNode).filter(key => oldNode.type !== Reference || key !== 'uid');
3404
+ const newKeys = getKeys(newNode).filter(key => newNode.type !== Reference || key !== 'uid');
3408
3405
  // Check for attribute changes
3409
3406
  for (const key of newKeys) {
3410
3407
  if (oldNode[key] !== newNode[key]) {
@@ -3428,9 +3425,14 @@ const compareNodes = (oldNode, newNode) => {
3428
3425
  };
3429
3426
 
3430
3427
  const treeToArray = node => {
3431
- const result = [node.node];
3432
- for (const child of node.children) {
3433
- result.push(...treeToArray(child));
3428
+ const result = [];
3429
+ const stack = [node];
3430
+ while (stack.length > 0) {
3431
+ const current = stack.pop();
3432
+ result.push(current.node);
3433
+ for (let i = current.children.length - 1; i >= 0; i--) {
3434
+ stack.push(current.children[i]);
3435
+ }
3434
3436
  }
3435
3437
  return result;
3436
3438
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "7.16.1",
3
+ "version": "7.17.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",