@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.
@@ -29073,22 +29073,26 @@ installImportMetaCssBuild(import.meta);
29073
29073
  * of being photographed, and a route transition is where it costs nothing:
29074
29074
  * both pages are pictures for those few hundred milliseconds anyway.
29075
29075
  *
29076
- * The WALL of a modal dialog goes the other way round: it cannot be
29077
- * photographed at all. It is the browser's own ::backdrop — a pseudo-element,
29078
- * which wears no name — and the top layer it is painted in is drawn during a
29079
- * transition only as part of the root's picture, which is opted out while an
29080
- * area is marked (route_transition.jsx). Captured on its own, the dialog's
29081
- * box travels; its wall is painted nowhere for the length of the movement,
29082
- * and the page under it leaves undimmed. So the wall is painted INTO the
29083
- * page's picture instead: a stand-in laid over the area before each of the
29084
- * two pictures is taken, painting what the ::backdrop paints, and removed
29076
+ * The WALL of a popup goes the other way round: it is not photographed at
29077
+ * all. The top layer is drawn during a transition only as part of the root's
29078
+ * picture, which is opted out while an area is marked (route_transition.jsx),
29079
+ * and a modal dialog's wall is its ::backdrop — a pseudo-element, which wears
29080
+ * no name; a popover's is a real element, but named it would be a picture the
29081
+ * size of the screen, sliding across the page arriving. Captured on its own,
29082
+ * the popup's box travels; its wall is painted nowhere for the length of the
29083
+ * movement, and the page under it leaves undimmed. So the wall is painted
29084
+ * INTO the page's picture instead: a stand-in laid over the area before each
29085
+ * of the two pictures is taken, painting what the wall paints, and removed
29085
29086
  * with the movement. Carried by the page's picture, it leaves with the page
29086
29087
  * being left and arrives with the page arriving, cut at the page's edge — and
29087
- * under the dialog's own picture, which stands over the pages (the z-order in
29088
- * route_transition.jsx). A bar the two states share is outside both pictures
29089
- * and goes undimmed for those few hundred milliseconds: it is the frame, not
29090
- * part of the page. A dialog with layer="local" paints a real element for its
29091
- * wall, inside the page, and needs none of this.
29088
+ * under the popup's own picture, which stands over the pages (the z-order in
29089
+ * route_transition.jsx). The bars are under the wall as much as the page is,
29090
+ * and each is a picture of its own: the same stand-in is laid over every bar
29091
+ * outside the area. A bar the two states share is one group with two
29092
+ * pictures — dimmed on the side that has a wall — and its cross-fade is the
29093
+ * wall fading out as the page leaves, or in as it arrives; a bar only one
29094
+ * state has carries the wall with it. A popup with layer="local" paints its
29095
+ * wall inside the page and needs none of this.
29092
29096
  */
29093
29097
 
29094
29098
  // The browser's top layer: painted above everything the document paints, so
@@ -29106,15 +29110,22 @@ const FURNITURE_SELECTOR = `.navi_fixed_bar, .navi_popover:is(${TOP_LAYER_SELECT
29106
29110
  const TRANSITION_ATTRIBUTE$1 = "data-navi-route-transition";
29107
29111
  const NAME_PROPERTY$1 = "view-transition-name";
29108
29112
  const FURNITURE_NAME_PREFIX = "navi-transition-furniture-";
29109
- // The dialogs whose wall is the browser's ::backdrop: shown with showModal().
29110
- // A top-layer dialog without a wall is shown as a popover and has nothing to
29111
- // stand in for.
29112
- const MODAL_DIALOG_SELECTOR = ".navi_dialog:modal";
29113
+ // The walls painted in the top layer: a modal dialog's, which is its
29114
+ // ::backdrop, and a popover's, which is a real element shown as a popover
29115
+ // beside it (layout/popover.jsx) — unnamed, so covered by the pictures for
29116
+ // the length of the movement all the same. A top-layer dialog without a wall
29117
+ // is shown as a popover and has nothing to stand in for.
29118
+ const TOP_LAYER_WALL_SELECTOR =
29119
+ ".navi_dialog:modal, .navi_popover_backdrop:popover-open";
29113
29120
  const WALL_ATTRIBUTE = "data-navi-transition-wall";
29114
- // What the ::backdrop paints, resolved on the dialog (layout/dialog.jsx): the
29115
- // same two properties, copied onto the wall.
29121
+ // What the wall paints, resolved on the matched element in both cases (the
29122
+ // dialog for its ::backdrop, the popover's wall for itself): the same two
29123
+ // properties, copied onto the stand-in.
29116
29124
  const WALL_PROPERTIES = ["--backdrop-background", "--backdrop-filter"];
29117
29125
 
29126
+ // The pictures the wall is painted into: the pages', and every bar's own.
29127
+ const FIXED_BAR_SELECTOR$1 = ".navi_fixed_bar";
29128
+
29118
29129
  const TRANSITION_WALL_CSS = /* css */ `[data-navi-transition-wall] {
29119
29130
  z-index: var(--navi-z-index-top-layer);
29120
29131
  background: var(--backdrop-background);
@@ -29124,6 +29135,10 @@ const TRANSITION_WALL_CSS = /* css */ `[data-navi-transition-wall] {
29124
29135
  top: 0;
29125
29136
  left: 0;
29126
29137
  }
29138
+
29139
+ :root:not(:active-view-transition) [data-navi-transition-wall] {
29140
+ display: none;
29141
+ }
29127
29142
  `;
29128
29143
 
29129
29144
  // Called from the render of whatever holds the pages, never at module scope:
@@ -29144,8 +29159,8 @@ let namedElements = new Set();
29144
29159
  // The rule giving the one-sided bars their movement, written for one movement
29145
29160
  // and taken down with it.
29146
29161
  let travelStyleElement = null;
29147
- // The walls standing in for the ::backdrop of the modal dialogs open in the
29148
- // area, painted for one picture and taken down before the next.
29162
+ // The stand-ins for the walls open in the top layer, painted for one picture
29163
+ // and taken down before the next.
29149
29164
  let wallElements = [];
29150
29165
 
29151
29166
  /**
@@ -29266,29 +29281,49 @@ const releaseTransitionFurniture = (owner) => {
29266
29281
  removeTransitionWalls();
29267
29282
  };
29268
29283
 
29269
- // One wall per modal dialog open in the area, in document order: the
29270
- // ::backdrops stack in the top layer, and what dims the page is all of them.
29284
+ // One stand-in per open wall in every picture, walls in document order: they
29285
+ // stack in the top layer, and what dims the document is all of them. A wall
29286
+ // open anywhere covers everything the document paints, so the sources are
29287
+ // looked for in the whole document — a dialog opened from a bar dims the
29288
+ // pages too. A bar inside the area is part of the pages' picture, and the
29289
+ // area's stand-in answers for it.
29271
29290
  const paintTransitionWalls = (areaElement) => {
29272
29291
  removeTransitionWalls();
29273
- for (const dialog of areaElement.querySelectorAll(MODAL_DIALOG_SELECTOR)) {
29274
- const dialogStyle = getComputedStyle(dialog);
29275
- const wall = document.createElement("div");
29276
- wall.setAttribute(WALL_ATTRIBUTE, "");
29277
- for (const property of WALL_PROPERTIES) {
29278
- wall.style.setProperty(property, dialogStyle.getPropertyValue(property));
29279
- }
29280
- areaElement.appendChild(wall);
29281
- // The area is not necessarily a containing block, and made one for the
29282
- // movement it would move whatever the page positioned against an ancestor
29283
- // of the area: the wall is placed from wherever its containing block
29284
- // turns out to be, by the offset between that box and the area's.
29285
- const areaRect = areaElement.getBoundingClientRect();
29286
- const wallRect = wall.getBoundingClientRect();
29287
- wall.style.left = `${areaRect.left - wallRect.left}px`;
29288
- wall.style.top = `${areaRect.top - wallRect.top}px`;
29289
- wall.style.width = `${areaRect.width}px`;
29290
- wall.style.height = `${areaRect.height}px`;
29291
- wallElements.push(wall);
29292
+ const sources = document.querySelectorAll(TOP_LAYER_WALL_SELECTOR);
29293
+ if (sources.length === 0) {
29294
+ return;
29295
+ }
29296
+ const targets = [areaElement];
29297
+ for (const bar of document.querySelectorAll(FIXED_BAR_SELECTOR$1)) {
29298
+ if (!areaElement.contains(bar)) {
29299
+ targets.push(bar);
29300
+ }
29301
+ }
29302
+ for (const target of targets) {
29303
+ for (const source of sources) {
29304
+ const sourceStyle = getComputedStyle(source);
29305
+ const wall = document.createElement("div");
29306
+ wall.setAttribute(WALL_ATTRIBUTE, "");
29307
+ for (const property of WALL_PROPERTIES) {
29308
+ wall.style.setProperty(
29309
+ property,
29310
+ sourceStyle.getPropertyValue(property),
29311
+ );
29312
+ }
29313
+ target.appendChild(wall);
29314
+ // The target is not necessarily a containing block (the area is a plain
29315
+ // box), and made one for the movement it would move whatever the page
29316
+ // positioned against an ancestor of it: the wall is placed from
29317
+ // wherever its containing block turns out to be, by the offset between
29318
+ // that box and the target's.
29319
+ const targetRect = target.getBoundingClientRect();
29320
+ const wallRect = wall.getBoundingClientRect();
29321
+ wall.style.left = `${targetRect.left - wallRect.left}px`;
29322
+ wall.style.top = `${targetRect.top - wallRect.top}px`;
29323
+ wall.style.width = `${targetRect.width}px`;
29324
+ wall.style.height = `${targetRect.height}px`;
29325
+ wallElements.push(wall);
29326
+ }
29292
29327
  }
29293
29328
  };
29294
29329