@lvce-editor/explorer-view 7.16.0 → 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.
- package/dist/explorerViewWorkerMain.js +18 -13
- package/package.json +1 -1
|
@@ -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
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
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 = [
|
|
3432
|
-
|
|
3433
|
-
|
|
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
|
};
|
|
@@ -7183,6 +7185,7 @@ const getExplorerItemVirtualDom = (item, editingSessionId = 0) => {
|
|
|
7183
7185
|
hasEditingError,
|
|
7184
7186
|
icon,
|
|
7185
7187
|
id,
|
|
7188
|
+
indent,
|
|
7186
7189
|
index,
|
|
7187
7190
|
isCut,
|
|
7188
7191
|
isEditing,
|
|
@@ -7206,6 +7209,8 @@ const getExplorerItemVirtualDom = (item, editingSessionId = 0) => {
|
|
|
7206
7209
|
'data-index': index,
|
|
7207
7210
|
draggable: true,
|
|
7208
7211
|
id,
|
|
7212
|
+
// Keep the item aligned even when the generated indent stylesheet is applied late.
|
|
7213
|
+
paddingLeft: indent,
|
|
7209
7214
|
role: TreeItem,
|
|
7210
7215
|
title: getTitle(path),
|
|
7211
7216
|
type: Div
|