@lvce-editor/renderer-process 30.46.4 → 30.47.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.
|
@@ -2315,17 +2315,16 @@ const NavigateParent = 8;
|
|
|
2315
2315
|
const RemoveChild = 9;
|
|
2316
2316
|
const NavigateSibling = 10;
|
|
2317
2317
|
const SetReferenceNodeUid = 11;
|
|
2318
|
+
const MultiNavigation = 18;
|
|
2318
2319
|
|
|
2319
|
-
const handleNavigateChild = (state,
|
|
2320
|
-
const patch = patches[patchIndex];
|
|
2320
|
+
const handleNavigateChild = (state, index, nextPatchType) => {
|
|
2321
2321
|
const $Children = state.current.childNodes;
|
|
2322
|
-
const $Child = $Children[
|
|
2322
|
+
const $Child = $Children[index];
|
|
2323
2323
|
if ($Child) {
|
|
2324
2324
|
state.current = $Child;
|
|
2325
2325
|
return true;
|
|
2326
2326
|
}
|
|
2327
|
-
|
|
2328
|
-
if (nextPatch && (nextPatch.type === Replace || nextPatch.type === SetReferenceNodeUid) && patch.index === $Children.length) {
|
|
2327
|
+
if ((nextPatchType === Replace || nextPatchType === SetReferenceNodeUid) && index === $Children.length) {
|
|
2329
2328
|
const $Placeholder = document.createComment('virtual-dom-placeholder');
|
|
2330
2329
|
state.current.append($Placeholder);
|
|
2331
2330
|
state.current = $Placeholder;
|
|
@@ -2333,7 +2332,7 @@ const handleNavigateChild = (state, patches, patchIndex) => {
|
|
|
2333
2332
|
}
|
|
2334
2333
|
console.error('Cannot navigate to child: child not found at index', {
|
|
2335
2334
|
$Current: state.current,
|
|
2336
|
-
index
|
|
2335
|
+
index,
|
|
2337
2336
|
childCount: $Children.length
|
|
2338
2337
|
});
|
|
2339
2338
|
return false;
|
|
@@ -2349,7 +2348,7 @@ const handleNavigateParent = state => {
|
|
|
2349
2348
|
state.current = $Parent;
|
|
2350
2349
|
return true;
|
|
2351
2350
|
};
|
|
2352
|
-
const handleNavigateSibling = (state,
|
|
2351
|
+
const handleNavigateSibling = (state, index, $Element, patchIndex) => {
|
|
2353
2352
|
const $Parent = state.current.parentNode;
|
|
2354
2353
|
if (!$Parent) {
|
|
2355
2354
|
console.error('Cannot navigate to sibling: current node has no parent', {
|
|
@@ -2357,14 +2356,14 @@ const handleNavigateSibling = (state, patch, $Element, patchIndex) => {
|
|
|
2357
2356
|
});
|
|
2358
2357
|
return false;
|
|
2359
2358
|
}
|
|
2360
|
-
let $Sibling = $Parent.childNodes[
|
|
2359
|
+
let $Sibling = $Parent.childNodes[index];
|
|
2361
2360
|
if (!$Sibling && !state.hasAppliedMutation && state.current !== $Element) {
|
|
2362
|
-
$Sibling = $Element.childNodes[
|
|
2361
|
+
$Sibling = $Element.childNodes[index];
|
|
2363
2362
|
}
|
|
2364
2363
|
if (!$Sibling) {
|
|
2365
2364
|
console.error('Cannot navigate to sibling: sibling not found at index', {
|
|
2366
2365
|
$Parent,
|
|
2367
|
-
index
|
|
2366
|
+
index,
|
|
2368
2367
|
childCount: $Parent.childNodes.length
|
|
2369
2368
|
});
|
|
2370
2369
|
return false;
|
|
@@ -2372,6 +2371,32 @@ const handleNavigateSibling = (state, patch, $Element, patchIndex) => {
|
|
|
2372
2371
|
state.current = $Sibling;
|
|
2373
2372
|
return true;
|
|
2374
2373
|
};
|
|
2374
|
+
const handleSingleNavigation = (state, type, index, nextPatchType, $Element, patchIndex) => {
|
|
2375
|
+
switch (type) {
|
|
2376
|
+
case NavigateChild:
|
|
2377
|
+
return handleNavigateChild(state, index, nextPatchType);
|
|
2378
|
+
case NavigateParent:
|
|
2379
|
+
return handleNavigateParent(state);
|
|
2380
|
+
case NavigateSibling:
|
|
2381
|
+
return handleNavigateSibling(state, index, $Element, patchIndex);
|
|
2382
|
+
default:
|
|
2383
|
+
console.error('Unknown navigation type', {
|
|
2384
|
+
type
|
|
2385
|
+
});
|
|
2386
|
+
return false;
|
|
2387
|
+
}
|
|
2388
|
+
};
|
|
2389
|
+
const handleMultiNavigation = (state, navigations, nextPatchType, $Element, patchIndex) => {
|
|
2390
|
+
for (let i = 0; i < navigations.length; i += 2) {
|
|
2391
|
+
const type = navigations[i];
|
|
2392
|
+
const index = navigations[i + 1];
|
|
2393
|
+
const nextType = navigations[i + 2] ?? nextPatchType;
|
|
2394
|
+
if (!handleSingleNavigation(state, type, index, nextType, $Element, patchIndex)) {
|
|
2395
|
+
return false;
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
return true;
|
|
2399
|
+
};
|
|
2375
2400
|
const handleSetReferenceNodeUid = (state, patch) => {
|
|
2376
2401
|
const instance = get$2(patch.uid);
|
|
2377
2402
|
if (!instance || !instance.state) {
|
|
@@ -2389,12 +2414,14 @@ const handleSetReferenceNodeUid = (state, patch) => {
|
|
|
2389
2414
|
};
|
|
2390
2415
|
const handleNavigationPatch = (state, patch, patches, patchIndex, $Element) => {
|
|
2391
2416
|
switch (patch.type) {
|
|
2417
|
+
case MultiNavigation:
|
|
2418
|
+
return handleMultiNavigation(state, patch.navigations, patches[patchIndex + 1]?.type, $Element, patchIndex);
|
|
2392
2419
|
case NavigateChild:
|
|
2393
|
-
return handleNavigateChild(state,
|
|
2420
|
+
return handleNavigateChild(state, patch.index, patches[patchIndex + 1]?.type);
|
|
2394
2421
|
case NavigateParent:
|
|
2395
2422
|
return handleNavigateParent(state);
|
|
2396
2423
|
case NavigateSibling:
|
|
2397
|
-
return handleNavigateSibling(state, patch, $Element, patchIndex);
|
|
2424
|
+
return handleNavigateSibling(state, patch.index, $Element, patchIndex);
|
|
2398
2425
|
default:
|
|
2399
2426
|
return true;
|
|
2400
2427
|
}
|
|
@@ -1751,17 +1751,16 @@ const NavigateParent = 8;
|
|
|
1751
1751
|
const RemoveChild = 9;
|
|
1752
1752
|
const NavigateSibling = 10;
|
|
1753
1753
|
const SetReferenceNodeUid = 11;
|
|
1754
|
+
const MultiNavigation = 18;
|
|
1754
1755
|
|
|
1755
|
-
const handleNavigateChild = (state,
|
|
1756
|
-
const patch = patches[patchIndex];
|
|
1756
|
+
const handleNavigateChild = (state, index, nextPatchType) => {
|
|
1757
1757
|
const $Children = state.current.childNodes;
|
|
1758
|
-
const $Child = $Children[
|
|
1758
|
+
const $Child = $Children[index];
|
|
1759
1759
|
if ($Child) {
|
|
1760
1760
|
state.current = $Child;
|
|
1761
1761
|
return true;
|
|
1762
1762
|
}
|
|
1763
|
-
|
|
1764
|
-
if (nextPatch && (nextPatch.type === Replace || nextPatch.type === SetReferenceNodeUid) && patch.index === $Children.length) {
|
|
1763
|
+
if ((nextPatchType === Replace || nextPatchType === SetReferenceNodeUid) && index === $Children.length) {
|
|
1765
1764
|
const $Placeholder = document.createComment('virtual-dom-placeholder');
|
|
1766
1765
|
state.current.append($Placeholder);
|
|
1767
1766
|
state.current = $Placeholder;
|
|
@@ -1769,7 +1768,7 @@ const handleNavigateChild = (state, patches, patchIndex) => {
|
|
|
1769
1768
|
}
|
|
1770
1769
|
console.error('Cannot navigate to child: child not found at index', {
|
|
1771
1770
|
$Current: state.current,
|
|
1772
|
-
index
|
|
1771
|
+
index,
|
|
1773
1772
|
childCount: $Children.length
|
|
1774
1773
|
});
|
|
1775
1774
|
return false;
|
|
@@ -1785,7 +1784,7 @@ const handleNavigateParent = state => {
|
|
|
1785
1784
|
state.current = $Parent;
|
|
1786
1785
|
return true;
|
|
1787
1786
|
};
|
|
1788
|
-
const handleNavigateSibling = (state,
|
|
1787
|
+
const handleNavigateSibling = (state, index, $Element, patchIndex) => {
|
|
1789
1788
|
const $Parent = state.current.parentNode;
|
|
1790
1789
|
if (!$Parent) {
|
|
1791
1790
|
console.error('Cannot navigate to sibling: current node has no parent', {
|
|
@@ -1793,14 +1792,14 @@ const handleNavigateSibling = (state, patch, $Element, patchIndex) => {
|
|
|
1793
1792
|
});
|
|
1794
1793
|
return false;
|
|
1795
1794
|
}
|
|
1796
|
-
let $Sibling = $Parent.childNodes[
|
|
1795
|
+
let $Sibling = $Parent.childNodes[index];
|
|
1797
1796
|
if (!$Sibling && !state.hasAppliedMutation && state.current !== $Element) {
|
|
1798
|
-
$Sibling = $Element.childNodes[
|
|
1797
|
+
$Sibling = $Element.childNodes[index];
|
|
1799
1798
|
}
|
|
1800
1799
|
if (!$Sibling) {
|
|
1801
1800
|
console.error('Cannot navigate to sibling: sibling not found at index', {
|
|
1802
1801
|
$Parent,
|
|
1803
|
-
index
|
|
1802
|
+
index,
|
|
1804
1803
|
childCount: $Parent.childNodes.length
|
|
1805
1804
|
});
|
|
1806
1805
|
return false;
|
|
@@ -1808,6 +1807,32 @@ const handleNavigateSibling = (state, patch, $Element, patchIndex) => {
|
|
|
1808
1807
|
state.current = $Sibling;
|
|
1809
1808
|
return true;
|
|
1810
1809
|
};
|
|
1810
|
+
const handleSingleNavigation = (state, type, index, nextPatchType, $Element, patchIndex) => {
|
|
1811
|
+
switch (type) {
|
|
1812
|
+
case NavigateChild:
|
|
1813
|
+
return handleNavigateChild(state, index, nextPatchType);
|
|
1814
|
+
case NavigateParent:
|
|
1815
|
+
return handleNavigateParent(state);
|
|
1816
|
+
case NavigateSibling:
|
|
1817
|
+
return handleNavigateSibling(state, index, $Element, patchIndex);
|
|
1818
|
+
default:
|
|
1819
|
+
console.error('Unknown navigation type', {
|
|
1820
|
+
type
|
|
1821
|
+
});
|
|
1822
|
+
return false;
|
|
1823
|
+
}
|
|
1824
|
+
};
|
|
1825
|
+
const handleMultiNavigation = (state, navigations, nextPatchType, $Element, patchIndex) => {
|
|
1826
|
+
for (let i = 0; i < navigations.length; i += 2) {
|
|
1827
|
+
const type = navigations[i];
|
|
1828
|
+
const index = navigations[i + 1];
|
|
1829
|
+
const nextType = navigations[i + 2] ?? nextPatchType;
|
|
1830
|
+
if (!handleSingleNavigation(state, type, index, nextType, $Element, patchIndex)) {
|
|
1831
|
+
return false;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
return true;
|
|
1835
|
+
};
|
|
1811
1836
|
const handleSetReferenceNodeUid = (state, patch) => {
|
|
1812
1837
|
const instance = get$a(patch.uid);
|
|
1813
1838
|
if (!instance || !instance.state) {
|
|
@@ -1825,12 +1850,14 @@ const handleSetReferenceNodeUid = (state, patch) => {
|
|
|
1825
1850
|
};
|
|
1826
1851
|
const handleNavigationPatch = (state, patch, patches, patchIndex, $Element) => {
|
|
1827
1852
|
switch (patch.type) {
|
|
1853
|
+
case MultiNavigation:
|
|
1854
|
+
return handleMultiNavigation(state, patch.navigations, patches[patchIndex + 1]?.type, $Element, patchIndex);
|
|
1828
1855
|
case NavigateChild:
|
|
1829
|
-
return handleNavigateChild(state,
|
|
1856
|
+
return handleNavigateChild(state, patch.index, patches[patchIndex + 1]?.type);
|
|
1830
1857
|
case NavigateParent:
|
|
1831
1858
|
return handleNavigateParent(state);
|
|
1832
1859
|
case NavigateSibling:
|
|
1833
|
-
return handleNavigateSibling(state, patch, $Element, patchIndex);
|
|
1860
|
+
return handleNavigateSibling(state, patch.index, $Element, patchIndex);
|
|
1834
1861
|
default:
|
|
1835
1862
|
return true;
|
|
1836
1863
|
}
|
|
@@ -7793,8 +7820,21 @@ const isNativeButtonActivation = event => {
|
|
|
7793
7820
|
}
|
|
7794
7821
|
return target instanceof HTMLButtonElement && target.role !== MenuItem && (key === 'Enter' || key === ' ');
|
|
7795
7822
|
};
|
|
7823
|
+
const isTerminalTextInput = event => {
|
|
7824
|
+
const {
|
|
7825
|
+
altKey,
|
|
7826
|
+
ctrlKey,
|
|
7827
|
+
key,
|
|
7828
|
+
metaKey,
|
|
7829
|
+
target
|
|
7830
|
+
} = event;
|
|
7831
|
+
if (altKey || ctrlKey || metaKey || key.length !== 1) {
|
|
7832
|
+
return false;
|
|
7833
|
+
}
|
|
7834
|
+
return target instanceof Element && Boolean(target.closest('.XtermTerminal'));
|
|
7835
|
+
};
|
|
7796
7836
|
const handleKeyDown$1 = event => {
|
|
7797
|
-
if (isNativeButtonActivation(event)) {
|
|
7837
|
+
if (isNativeButtonActivation(event) || isTerminalTextInput(event)) {
|
|
7798
7838
|
return;
|
|
7799
7839
|
}
|
|
7800
7840
|
const identifier = getKeyBindingIdentifier(event);
|