@jsenv/navi 0.30.37 → 0.30.38

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.
@@ -41316,7 +41316,12 @@ const watchRowScroll = (
41316
41316
  };
41317
41317
 
41318
41318
  installImportMetaCssBuild(import.meta);
41319
- const css$16 = /* css */`.navi_route_travel {
41319
+ const css$16 = /* css */`@property --navi-route-row-pin {
41320
+ syntax: "*";
41321
+ inherits: false
41322
+ }
41323
+
41324
+ .navi_route_travel {
41320
41325
  flex-direction: column;
41321
41326
  display: flex;
41322
41327
  position: relative;
@@ -41372,7 +41377,7 @@ const css$16 = /* css */`.navi_route_travel {
41372
41377
  display: flex;
41373
41378
  }
41374
41379
 
41375
- & > [data-route-row-pane][inert]:not([data-route-row-held]), &:has( > [data-route-row-held]) > [data-route-row-pane]:not([data-route-row-held]) {
41380
+ & > [data-route-row-pane][inert]:not([data-route-row-held]), &[data-route-row-holding] > [data-route-row-pane]:not([data-route-row-held]) {
41376
41381
  top: var(--navi-route-row-pin, 0);
41377
41382
  contain: paint;
41378
41383
  max-height: 100dvh;
@@ -41544,11 +41549,25 @@ const RouteTravel = ({
41544
41549
  // when the row rests. Not what readers are told the page held is
41545
41550
  // (route_travel_hold.js): that follows the hand, and goes at its lift.
41546
41551
  const heldPaneRef = useRef(null);
41547
- const releasePaneAtRest = () => {
41552
+ const releasePaneAtRest = row => {
41548
41553
  const heldPane = heldPaneRef.current;
41549
41554
  if (heldPane) {
41550
41555
  heldPaneRef.current = null;
41551
41556
  heldPane.removeAttribute("data-route-row-held");
41557
+ row.removeAttribute("data-route-row-holding");
41558
+ }
41559
+ };
41560
+
41561
+ // How far down the reader is looking, on every pane, for those the CSS pins.
41562
+ const pinPanes = row => {
41563
+ const pin = `${pinOf(row)}px`;
41564
+ for (const pane of panesOf(row)) {
41565
+ pane.style.setProperty("--navi-route-row-pin", pin);
41566
+ }
41567
+ };
41568
+ const unpinPanes = row => {
41569
+ for (const pane of panesOf(row)) {
41570
+ pane.style.removeProperty("--navi-route-row-pin");
41552
41571
  }
41553
41572
  };
41554
41573
 
@@ -41575,13 +41594,14 @@ const RouteTravel = ({
41575
41594
  if (!windowed && paneAtRest) {
41576
41595
  heldPaneRef.current = paneAtRest;
41577
41596
  paneAtRest.setAttribute("data-route-row-held", "");
41597
+ row.setAttribute("data-route-row-holding", "");
41578
41598
  }
41579
41599
  if (movement.scrollsDocument) {
41580
41600
  // Whatever the browser does with the offset meanwhile (clamping it to a page
41581
41601
  // shorter than the trip) is not the reader scrolling, and the address it
41582
41602
  // would be written against may already be another page's.
41583
41603
  movement.resumeScrollRecording = suspendScrollRecording();
41584
- row.style.setProperty("--navi-route-row-pin", `${pinOf(row)}px`);
41604
+ pinPanes(row);
41585
41605
  }
41586
41606
  return movement;
41587
41607
  };
@@ -41874,7 +41894,7 @@ const RouteTravel = ({
41874
41894
  row.removeAttribute("data-route-row-taken");
41875
41895
  publishRouteRowMove(null);
41876
41896
  releaseHeldPage();
41877
- releasePaneAtRest();
41897
+ releasePaneAtRest(row);
41878
41898
  if (liveRef.current) {
41879
41899
  liveRef.current.style.top = "";
41880
41900
  }
@@ -41882,7 +41902,7 @@ const RouteTravel = ({
41882
41902
  picture.remove();
41883
41903
  }
41884
41904
  if (movement.scrollsDocument) {
41885
- row.style.removeProperty("--navi-route-row-pin");
41905
+ unpinPanes(row);
41886
41906
  const {
41887
41907
  pages,
41888
41908
  currentIndex
@@ -42187,7 +42207,7 @@ const RouteTravel = ({
42187
42207
  movementRef.current = null;
42188
42208
  publishRouteRowMove(null);
42189
42209
  releaseHeldPage();
42190
- releasePaneAtRest();
42210
+ releasePaneAtRest(row);
42191
42211
  };
42192
42212
  }, [windowed]);
42193
42213
 
@@ -42251,7 +42271,7 @@ const RouteTravel = ({
42251
42271
  const row = rowRef.current;
42252
42272
  const onTouchStart = () => {
42253
42273
  if (!movementRef.current && rowFollowsDocument(row)) {
42254
- row.style.setProperty("--navi-route-row-pin", `${pinOf(row)}px`);
42274
+ pinPanes(row);
42255
42275
  }
42256
42276
  };
42257
42277
  row.addEventListener("touchstart", onTouchStart, {
@@ -82543,9 +82563,15 @@ const PickerNaviMinute = props => {
82543
82563
  * element crossing the cursor — a dozen per wheel tick. Those hovers are noise:
82544
82564
  * the user asked to scroll, not to hover. Anything doing real work on hover (a
82545
82565
  * map highlight, a preview, a prefetch) then pays for that noise on the main
82546
- * thread, exactly while a scroll animation is running. A rule matching
82547
- * `[navi-scrolling] *` takes the rows out of hit-testing and the browser
82548
- * suppresses it all, at no cost per element.
82566
+ * thread, exactly while a scroll animation is running. A rule like
82567
+ * `[navi-scrolling] .my_row { pointer-events: none }` takes the rows out of
82568
+ * hit-testing and the browser suppresses it all.
82569
+ *
82570
+ * Such a rule must end on a class (or an id, a tag, an attribute) of what it
82571
+ * styles: Chrome then restyles only those elements when the attribute comes and
82572
+ * goes. One ending on `*`, including `.my_row:is([navi-scrolling] *)`, gives it
82573
+ * nothing to narrow to, so it restyles everything under the scroller (the whole
82574
+ * document when the page scrolls) at the start and at the end of every scroll.
82549
82575
  *
82550
82576
  * One capturing listener on the document sees them all: "scroll" does not
82551
82577
  * bubble, but it does propagate in the capture phase.
@@ -84927,7 +84953,7 @@ const css$w = /* css */`@property --list-group-label-height {
84927
84953
  }
84928
84954
  }
84929
84955
 
84930
- &:not([navi-hover-while-scrolling]) > .navi_list_scroll_container > .navi_list:is([navi-scrolling] *) {
84956
+ [navi-scrolling] &:not([navi-hover-while-scrolling]) > .navi_list_scroll_container > .navi_list, &[navi-scrolling]:not([navi-hover-while-scrolling]) > .navi_list_scroll_container > .navi_list, &:not([navi-hover-while-scrolling]) > .navi_list_scroll_container[navi-scrolling] > .navi_list {
84931
84957
  pointer-events: none;
84932
84958
  }
84933
84959