@lvce-editor/renderer-process 30.22.1 → 30.22.3
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.
|
@@ -2386,6 +2386,17 @@ const createHiddenContainer = (activeElement, focused) => {
|
|
|
2386
2386
|
}
|
|
2387
2387
|
return $Hidden;
|
|
2388
2388
|
};
|
|
2389
|
+
const updateAttributes = ($Previous, $New) => {
|
|
2390
|
+
const newAttributeNames = new Set($New.getAttributeNames());
|
|
2391
|
+
for (const attributeName of $Previous.getAttributeNames()) {
|
|
2392
|
+
if (!newAttributeNames.has(attributeName)) {
|
|
2393
|
+
$Previous.removeAttribute(attributeName);
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
for (const attributeName of newAttributeNames) {
|
|
2397
|
+
$Previous.setAttribute(attributeName, $New.getAttribute(attributeName));
|
|
2398
|
+
}
|
|
2399
|
+
};
|
|
2389
2400
|
const restoreFocusedElement = ($Hidden, $New, focused) => {
|
|
2390
2401
|
const $NewFocused = $New.querySelector(`[name="${CSS.escape(focused)}"]`);
|
|
2391
2402
|
if (!$NewFocused) {
|
|
@@ -2395,8 +2406,7 @@ const restoreFocusedElement = ($Hidden, $New, focused) => {
|
|
|
2395
2406
|
if (!$Previous) {
|
|
2396
2407
|
return;
|
|
2397
2408
|
}
|
|
2398
|
-
$Previous
|
|
2399
|
-
$Previous.placeholder = $NewFocused.placeholder;
|
|
2409
|
+
updateAttributes($Previous, $NewFocused);
|
|
2400
2410
|
if ($NewFocused.childNodes) {
|
|
2401
2411
|
$Previous.replaceChildren(...$NewFocused.childNodes);
|
|
2402
2412
|
}
|
|
@@ -2440,31 +2450,34 @@ const restoreFocus = ($Viewlet, isRootTree, isTreeFocused, focused) => {
|
|
|
2440
2450
|
};
|
|
2441
2451
|
const rememberFocus = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
2442
2452
|
startIgnore();
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2453
|
+
try {
|
|
2454
|
+
const oldLeft = $Viewlet.style.left;
|
|
2455
|
+
const oldTop = $Viewlet.style.top;
|
|
2456
|
+
const oldWidth = $Viewlet.style.width;
|
|
2457
|
+
const oldHeight = $Viewlet.style.height;
|
|
2458
|
+
const activeElement = getActiveElementInside($Viewlet);
|
|
2459
|
+
const isTreeFocused = activeElement?.getAttribute('role') === 'tree';
|
|
2460
|
+
const isRootTree = $Viewlet.getAttribute('role') === 'tree' && activeElement === $Viewlet;
|
|
2461
|
+
const focused = activeElement?.getAttribute('name') || null;
|
|
2462
|
+
const $Hidden = createHiddenContainer(activeElement, focused);
|
|
2463
|
+
if (uid) {
|
|
2464
|
+
const numericUid = Number(uid);
|
|
2465
|
+
const inputMap = getInputMap($Viewlet);
|
|
2466
|
+
$Viewlet = renderWithUid($Viewlet, dom, eventMap, numericUid, inputMap, focused, $Hidden);
|
|
2467
|
+
}
|
|
2468
|
+
if (!uid) {
|
|
2469
|
+
renderInto($Viewlet, dom, eventMap);
|
|
2470
|
+
}
|
|
2471
|
+
$Hidden.remove();
|
|
2472
|
+
restoreFocus($Viewlet, isRootTree, isTreeFocused, focused);
|
|
2473
|
+
$Viewlet.style.top = oldTop;
|
|
2474
|
+
$Viewlet.style.left = oldLeft;
|
|
2475
|
+
$Viewlet.style.height = oldHeight;
|
|
2476
|
+
$Viewlet.style.width = oldWidth;
|
|
2477
|
+
return $Viewlet;
|
|
2478
|
+
} finally {
|
|
2479
|
+
stopIgnore();
|
|
2480
|
+
}
|
|
2468
2481
|
};
|
|
2469
2482
|
|
|
2470
2483
|
const state = {
|
|
@@ -1540,6 +1540,17 @@ const createHiddenContainer = (activeElement, focused) => {
|
|
|
1540
1540
|
}
|
|
1541
1541
|
return $Hidden;
|
|
1542
1542
|
};
|
|
1543
|
+
const updateAttributes = ($Previous, $New) => {
|
|
1544
|
+
const newAttributeNames = new Set($New.getAttributeNames());
|
|
1545
|
+
for (const attributeName of $Previous.getAttributeNames()) {
|
|
1546
|
+
if (!newAttributeNames.has(attributeName)) {
|
|
1547
|
+
$Previous.removeAttribute(attributeName);
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
for (const attributeName of newAttributeNames) {
|
|
1551
|
+
$Previous.setAttribute(attributeName, $New.getAttribute(attributeName));
|
|
1552
|
+
}
|
|
1553
|
+
};
|
|
1543
1554
|
const restoreFocusedElement = ($Hidden, $New, focused) => {
|
|
1544
1555
|
const $NewFocused = $New.querySelector(`[name="${CSS.escape(focused)}"]`);
|
|
1545
1556
|
if (!$NewFocused) {
|
|
@@ -1549,8 +1560,7 @@ const restoreFocusedElement = ($Hidden, $New, focused) => {
|
|
|
1549
1560
|
if (!$Previous) {
|
|
1550
1561
|
return;
|
|
1551
1562
|
}
|
|
1552
|
-
$Previous
|
|
1553
|
-
$Previous.placeholder = $NewFocused.placeholder;
|
|
1563
|
+
updateAttributes($Previous, $NewFocused);
|
|
1554
1564
|
if ($NewFocused.childNodes) {
|
|
1555
1565
|
$Previous.replaceChildren(...$NewFocused.childNodes);
|
|
1556
1566
|
}
|
|
@@ -1594,31 +1604,34 @@ const restoreFocus = ($Viewlet, isRootTree, isTreeFocused, focused) => {
|
|
|
1594
1604
|
};
|
|
1595
1605
|
const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
1596
1606
|
startIgnore();
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1607
|
+
try {
|
|
1608
|
+
const oldLeft = $Viewlet.style.left;
|
|
1609
|
+
const oldTop = $Viewlet.style.top;
|
|
1610
|
+
const oldWidth = $Viewlet.style.width;
|
|
1611
|
+
const oldHeight = $Viewlet.style.height;
|
|
1612
|
+
const activeElement = getActiveElementInside($Viewlet);
|
|
1613
|
+
const isTreeFocused = activeElement?.getAttribute('role') === 'tree';
|
|
1614
|
+
const isRootTree = $Viewlet.getAttribute('role') === 'tree' && activeElement === $Viewlet;
|
|
1615
|
+
const focused = activeElement?.getAttribute('name') || null;
|
|
1616
|
+
const $Hidden = createHiddenContainer(activeElement, focused);
|
|
1617
|
+
if (uid) {
|
|
1618
|
+
const numericUid = Number(uid);
|
|
1619
|
+
const inputMap = getInputMap($Viewlet);
|
|
1620
|
+
$Viewlet = renderWithUid($Viewlet, dom, eventMap, numericUid, inputMap, focused, $Hidden);
|
|
1621
|
+
}
|
|
1622
|
+
if (!uid) {
|
|
1623
|
+
renderInto($Viewlet, dom, eventMap);
|
|
1624
|
+
}
|
|
1625
|
+
$Hidden.remove();
|
|
1626
|
+
restoreFocus($Viewlet, isRootTree, isTreeFocused, focused);
|
|
1627
|
+
$Viewlet.style.top = oldTop;
|
|
1628
|
+
$Viewlet.style.left = oldLeft;
|
|
1629
|
+
$Viewlet.style.height = oldHeight;
|
|
1630
|
+
$Viewlet.style.width = oldWidth;
|
|
1631
|
+
return $Viewlet;
|
|
1632
|
+
} finally {
|
|
1633
|
+
stopIgnore();
|
|
1634
|
+
}
|
|
1622
1635
|
};
|
|
1623
1636
|
|
|
1624
1637
|
const get$6 = ids => {
|