@jsenv/navi 0.29.504 → 0.29.505
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/dev/jsenv_navi.js +23 -13
- package/dist/dev/jsenv_navi.js.map +2 -2
- package/dist/jsenv_navi.js +23 -13
- package/dist/jsenv_navi.js.map +2 -2
- package/package.json +1 -1
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -37852,18 +37852,18 @@ const useContentKeepingLeavingPages = (branch, readShownBranch, parentPage) => {
|
|
|
37852
37852
|
}
|
|
37853
37853
|
entry.hidden = true;
|
|
37854
37854
|
entry.page.leavingSignal.value = true;
|
|
37855
|
-
hideNodesBetween(start, end);
|
|
37856
37855
|
// The page renders on its own while kept (a component reading a signal
|
|
37857
37856
|
// the address moved), never through this container: a top node it
|
|
37858
|
-
// replaces lands between the markers unmarked
|
|
37859
|
-
// before the next frame.
|
|
37857
|
+
// replaces lands between the markers unmarked, a text it writes shows
|
|
37858
|
+
// again. Both are heard before the next frame.
|
|
37860
37859
|
const observer = new MutationObserver(() => {
|
|
37861
37860
|
if (entry.hold.released) {
|
|
37862
37861
|
observer.disconnect();
|
|
37863
37862
|
return;
|
|
37864
37863
|
}
|
|
37865
|
-
hideNodesBetween(start, end);
|
|
37864
|
+
hideNodesBetween(start, end, observer);
|
|
37866
37865
|
});
|
|
37866
|
+
hideNodesBetween(start, end, observer);
|
|
37867
37867
|
observer.observe(start.parentNode, {
|
|
37868
37868
|
childList: true
|
|
37869
37869
|
});
|
|
@@ -37907,18 +37907,28 @@ const useContentKeepingLeavingPages = (branch, readShownBranch, parentPage) => {
|
|
|
37907
37907
|
};
|
|
37908
37908
|
};
|
|
37909
37909
|
const countRenders = count => count + 1;
|
|
37910
|
-
const hideNodesBetween = (start, end) => {
|
|
37910
|
+
const hideNodesBetween = (start, end, observer) => {
|
|
37911
37911
|
const focusedElement = document.activeElement;
|
|
37912
37912
|
let node = start.nextSibling;
|
|
37913
37913
|
while (node && node !== end) {
|
|
37914
|
-
if (node.nodeType === Node.ELEMENT_NODE
|
|
37915
|
-
node.
|
|
37916
|
-
|
|
37917
|
-
|
|
37918
|
-
|
|
37919
|
-
|
|
37920
|
-
|
|
37921
|
-
|
|
37914
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
37915
|
+
if (!node.hasAttribute(LEAVING_ATTRIBUTE)) {
|
|
37916
|
+
node.setAttribute(LEAVING_ATTRIBUTE, "");
|
|
37917
|
+
// What the keyboard held in it goes where the page's removal would
|
|
37918
|
+
// have sent it: a hidden element keeps the focus, and would go on
|
|
37919
|
+
// receiving the keys pressed during the movement.
|
|
37920
|
+
if (node.contains(focusedElement)) {
|
|
37921
|
+
focusedElement.blur();
|
|
37922
|
+
}
|
|
37923
|
+
}
|
|
37924
|
+
} else if (node.nodeType === Node.TEXT_NODE && node.data !== "") {
|
|
37925
|
+
// No CSS reaches a text node, and it stays where it is: Preact inserts
|
|
37926
|
+
// next to it. Emptied for good, since the page is taken down without
|
|
37927
|
+
// being shown again, and Preact only writes it when its text changes.
|
|
37928
|
+
node.data = "";
|
|
37929
|
+
observer.observe(node, {
|
|
37930
|
+
characterData: true
|
|
37931
|
+
});
|
|
37922
37932
|
}
|
|
37923
37933
|
node = node.nextSibling;
|
|
37924
37934
|
}
|