@jsenv/navi 0.29.369 → 0.29.370
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 +78 -43
- package/dist/dev/jsenv_navi.js.map +3 -2
- package/dist/jsenv_navi.js +78 -43
- package/dist/jsenv_navi.js.map +3 -2
- package/package.json +1 -1
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -29979,22 +29979,26 @@ installImportMetaCssBuild(import.meta);
|
|
|
29979
29979
|
* of being photographed, and a route transition is where it costs nothing:
|
|
29980
29980
|
* both pages are pictures for those few hundred milliseconds anyway.
|
|
29981
29981
|
*
|
|
29982
|
-
* The WALL of a
|
|
29983
|
-
*
|
|
29984
|
-
* which
|
|
29985
|
-
*
|
|
29986
|
-
*
|
|
29987
|
-
*
|
|
29988
|
-
*
|
|
29989
|
-
*
|
|
29990
|
-
*
|
|
29982
|
+
* The WALL of a popup goes the other way round: it is not photographed at
|
|
29983
|
+
* all. The top layer is drawn during a transition only as part of the root's
|
|
29984
|
+
* picture, which is opted out while an area is marked (route_transition.jsx),
|
|
29985
|
+
* and a modal dialog's wall is its ::backdrop — a pseudo-element, which wears
|
|
29986
|
+
* no name; a popover's is a real element, but named it would be a picture the
|
|
29987
|
+
* size of the screen, sliding across the page arriving. Captured on its own,
|
|
29988
|
+
* the popup's box travels; its wall is painted nowhere for the length of the
|
|
29989
|
+
* movement, and the page under it leaves undimmed. So the wall is painted
|
|
29990
|
+
* INTO the page's picture instead: a stand-in laid over the area before each
|
|
29991
|
+
* of the two pictures is taken, painting what the wall paints, and removed
|
|
29991
29992
|
* with the movement. Carried by the page's picture, it leaves with the page
|
|
29992
29993
|
* being left and arrives with the page arriving, cut at the page's edge — and
|
|
29993
|
-
* under the
|
|
29994
|
-
* route_transition.jsx).
|
|
29995
|
-
* and
|
|
29996
|
-
*
|
|
29997
|
-
*
|
|
29994
|
+
* under the popup's own picture, which stands over the pages (the z-order in
|
|
29995
|
+
* route_transition.jsx). The bars are under the wall as much as the page is,
|
|
29996
|
+
* and each is a picture of its own: the same stand-in is laid over every bar
|
|
29997
|
+
* outside the area. A bar the two states share is one group with two
|
|
29998
|
+
* pictures — dimmed on the side that has a wall — and its cross-fade is the
|
|
29999
|
+
* wall fading out as the page leaves, or in as it arrives; a bar only one
|
|
30000
|
+
* state has carries the wall with it. A popup with layer="local" paints its
|
|
30001
|
+
* wall inside the page and needs none of this.
|
|
29998
30002
|
*/
|
|
29999
30003
|
|
|
30000
30004
|
// The browser's top layer: painted above everything the document paints, so
|
|
@@ -30012,15 +30016,22 @@ const FURNITURE_SELECTOR = `.navi_fixed_bar, .navi_popover:is(${TOP_LAYER_SELECT
|
|
|
30012
30016
|
const TRANSITION_ATTRIBUTE$1 = "data-navi-route-transition";
|
|
30013
30017
|
const NAME_PROPERTY$1 = "view-transition-name";
|
|
30014
30018
|
const FURNITURE_NAME_PREFIX = "navi-transition-furniture-";
|
|
30015
|
-
// The
|
|
30016
|
-
//
|
|
30017
|
-
//
|
|
30018
|
-
|
|
30019
|
+
// The walls painted in the top layer: a modal dialog's, which is its
|
|
30020
|
+
// ::backdrop, and a popover's, which is a real element shown as a popover
|
|
30021
|
+
// beside it (layout/popover.jsx) — unnamed, so covered by the pictures for
|
|
30022
|
+
// the length of the movement all the same. A top-layer dialog without a wall
|
|
30023
|
+
// is shown as a popover and has nothing to stand in for.
|
|
30024
|
+
const TOP_LAYER_WALL_SELECTOR =
|
|
30025
|
+
".navi_dialog:modal, .navi_popover_backdrop:popover-open";
|
|
30019
30026
|
const WALL_ATTRIBUTE = "data-navi-transition-wall";
|
|
30020
|
-
// What the
|
|
30021
|
-
//
|
|
30027
|
+
// What the wall paints, resolved on the matched element in both cases (the
|
|
30028
|
+
// dialog for its ::backdrop, the popover's wall for itself): the same two
|
|
30029
|
+
// properties, copied onto the stand-in.
|
|
30022
30030
|
const WALL_PROPERTIES = ["--backdrop-background", "--backdrop-filter"];
|
|
30023
30031
|
|
|
30032
|
+
// The pictures the wall is painted into: the pages', and every bar's own.
|
|
30033
|
+
const FIXED_BAR_SELECTOR$1 = ".navi_fixed_bar";
|
|
30034
|
+
|
|
30024
30035
|
const TRANSITION_WALL_CSS = /* css */ `[data-navi-transition-wall] {
|
|
30025
30036
|
z-index: var(--navi-z-index-top-layer);
|
|
30026
30037
|
background: var(--backdrop-background);
|
|
@@ -30030,6 +30041,10 @@ const TRANSITION_WALL_CSS = /* css */ `[data-navi-transition-wall] {
|
|
|
30030
30041
|
top: 0;
|
|
30031
30042
|
left: 0;
|
|
30032
30043
|
}
|
|
30044
|
+
|
|
30045
|
+
:root:not(:active-view-transition) [data-navi-transition-wall] {
|
|
30046
|
+
display: none;
|
|
30047
|
+
}
|
|
30033
30048
|
`;
|
|
30034
30049
|
|
|
30035
30050
|
// Called from the render of whatever holds the pages, never at module scope:
|
|
@@ -30050,8 +30065,8 @@ let namedElements = new Set();
|
|
|
30050
30065
|
// The rule giving the one-sided bars their movement, written for one movement
|
|
30051
30066
|
// and taken down with it.
|
|
30052
30067
|
let travelStyleElement = null;
|
|
30053
|
-
// The
|
|
30054
|
-
//
|
|
30068
|
+
// The stand-ins for the walls open in the top layer, painted for one picture
|
|
30069
|
+
// and taken down before the next.
|
|
30055
30070
|
let wallElements = [];
|
|
30056
30071
|
|
|
30057
30072
|
/**
|
|
@@ -30172,29 +30187,49 @@ const releaseTransitionFurniture = (owner) => {
|
|
|
30172
30187
|
removeTransitionWalls();
|
|
30173
30188
|
};
|
|
30174
30189
|
|
|
30175
|
-
// One
|
|
30176
|
-
//
|
|
30190
|
+
// One stand-in per open wall in every picture, walls in document order: they
|
|
30191
|
+
// stack in the top layer, and what dims the document is all of them. A wall
|
|
30192
|
+
// open anywhere covers everything the document paints, so the sources are
|
|
30193
|
+
// looked for in the whole document — a dialog opened from a bar dims the
|
|
30194
|
+
// pages too. A bar inside the area is part of the pages' picture, and the
|
|
30195
|
+
// area's stand-in answers for it.
|
|
30177
30196
|
const paintTransitionWalls = (areaElement) => {
|
|
30178
30197
|
removeTransitionWalls();
|
|
30179
|
-
|
|
30180
|
-
|
|
30181
|
-
|
|
30182
|
-
|
|
30183
|
-
|
|
30184
|
-
|
|
30185
|
-
|
|
30186
|
-
|
|
30187
|
-
|
|
30188
|
-
|
|
30189
|
-
|
|
30190
|
-
|
|
30191
|
-
|
|
30192
|
-
|
|
30193
|
-
|
|
30194
|
-
|
|
30195
|
-
|
|
30196
|
-
|
|
30197
|
-
|
|
30198
|
+
const sources = document.querySelectorAll(TOP_LAYER_WALL_SELECTOR);
|
|
30199
|
+
if (sources.length === 0) {
|
|
30200
|
+
return;
|
|
30201
|
+
}
|
|
30202
|
+
const targets = [areaElement];
|
|
30203
|
+
for (const bar of document.querySelectorAll(FIXED_BAR_SELECTOR$1)) {
|
|
30204
|
+
if (!areaElement.contains(bar)) {
|
|
30205
|
+
targets.push(bar);
|
|
30206
|
+
}
|
|
30207
|
+
}
|
|
30208
|
+
for (const target of targets) {
|
|
30209
|
+
for (const source of sources) {
|
|
30210
|
+
const sourceStyle = getComputedStyle(source);
|
|
30211
|
+
const wall = document.createElement("div");
|
|
30212
|
+
wall.setAttribute(WALL_ATTRIBUTE, "");
|
|
30213
|
+
for (const property of WALL_PROPERTIES) {
|
|
30214
|
+
wall.style.setProperty(
|
|
30215
|
+
property,
|
|
30216
|
+
sourceStyle.getPropertyValue(property),
|
|
30217
|
+
);
|
|
30218
|
+
}
|
|
30219
|
+
target.appendChild(wall);
|
|
30220
|
+
// The target is not necessarily a containing block (the area is a plain
|
|
30221
|
+
// box), and made one for the movement it would move whatever the page
|
|
30222
|
+
// positioned against an ancestor of it: the wall is placed from
|
|
30223
|
+
// wherever its containing block turns out to be, by the offset between
|
|
30224
|
+
// that box and the target's.
|
|
30225
|
+
const targetRect = target.getBoundingClientRect();
|
|
30226
|
+
const wallRect = wall.getBoundingClientRect();
|
|
30227
|
+
wall.style.left = `${targetRect.left - wallRect.left}px`;
|
|
30228
|
+
wall.style.top = `${targetRect.top - wallRect.top}px`;
|
|
30229
|
+
wall.style.width = `${targetRect.width}px`;
|
|
30230
|
+
wall.style.height = `${targetRect.height}px`;
|
|
30231
|
+
wallElements.push(wall);
|
|
30232
|
+
}
|
|
30198
30233
|
}
|
|
30199
30234
|
};
|
|
30200
30235
|
|