@jsenv/navi 0.30.7 → 0.30.9

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.
@@ -40450,9 +40450,11 @@ const readRowStretch = (scroller, pages, page, { sideways } = {}) => {
40450
40450
  /**
40451
40451
  * @param {Element} scroller
40452
40452
  * @param {object} options
40453
- * @param {(move: {finger: boolean}) => void} options.onScroll - the row moved.
40454
- * `finger`: a touch has come since the row last stopped, so a lift will say where
40455
- * it goes (`onLeftToSnap`). Without one (a trackpad, a wheel) nothing will.
40453
+ * @param {(move: {finger: boolean, lifted: boolean}) => void} options.onScroll - the
40454
+ * row moved. `finger`: a touch has come since the row last stopped, so a lift will
40455
+ * say where it goes (`onLeftToSnap`). Without one (a trackpad, a wheel) nothing
40456
+ * will. `lifted`: that finger has lifted and none has landed since: no hand moves
40457
+ * the row, the snap the lift left running does.
40456
40458
  * @param {(event: Event|null) => void} options.onLand - the row may have stopped.
40457
40459
  * Read `pageAtRest` to know whether it stopped on a page. Heard more than once
40458
40460
  * for one landing, so what it does must find nothing to do the second time.
@@ -40483,7 +40485,10 @@ const watchRowScroll = (
40483
40485
  stoppedTimeout = setTimeout(landOnSilence, STOPPED_SILENCE);
40484
40486
  };
40485
40487
  const onScrollEvent = () => {
40486
- onScroll({ finger: touchedSinceStop });
40488
+ onScroll({
40489
+ finger: touchedSinceStop,
40490
+ lifted: touchedSinceStop && !touching,
40491
+ });
40487
40492
  armSilence();
40488
40493
  if (!liftedAt) {
40489
40494
  return;
@@ -41067,7 +41072,8 @@ const RouteTravel = ({
41067
41072
  const row = rowRef.current;
41068
41073
  const isClipped = () => row.getAttribute("data-route-row-taken") === "clip";
41069
41074
  const onScroll = ({
41070
- finger
41075
+ finger,
41076
+ lifted
41071
41077
  }) => {
41072
41078
  const {
41073
41079
  pages,
@@ -41102,6 +41108,12 @@ const RouteTravel = ({
41102
41108
  } = readRowFrame(row, panes);
41103
41109
  followPageOnScreen(pages[panes.indexOf(fraction >= 0.5 && toward ? toward : base)], askedPageRef.current || pages[currentIndex]);
41104
41110
  }
41111
+ // The pull is read from the pane of the address. Once the finger has lifted,
41112
+ // the address is where the snap goes (onLeftToSnap), and what still lies
41113
+ // between is the snap playing out, not a hand pulling towards the neighbour.
41114
+ if (lifted) {
41115
+ return;
41116
+ }
41105
41117
  const pulled = row.scrollLeft - pane.offsetLeft;
41106
41118
  if (Math.abs(pulled) < SET_OFF_PULL) {
41107
41119
  return;
@@ -85512,10 +85524,13 @@ const useListScrollSync = ({
85512
85524
  };
85513
85525
  // Items that came in at another size than what stood in for them (a
85514
85526
  // skeleton becoming its item) leave the window short of the screen, or past
85515
- // it, and nothing scrolled to say so. Asked on the next frame, not inside
85516
- // the resize delivery: the window it frames is a render, which resizes what
85517
- // is observed once more, and the browser gives up on the loop
85518
- // ("ResizeObserver loop completed with undelivered notifications").
85527
+ // it, and nothing scrolled to say so. A held list too: its hold places it but
85528
+ // leaves the window to the screen (see holdWindow), and a placement that
85529
+ // moves nothing — a document too short to scroll — fires no scroll that
85530
+ // would size it. Asked on the next frame, not inside the resize delivery:
85531
+ // the window it frames is a render, which resizes what is observed once
85532
+ // more, and the browser gives up on the loop ("ResizeObserver loop
85533
+ // completed with undelivered notifications").
85519
85534
  const onItemsResizedRef = useRef(null);
85520
85535
  onItemsResizedRef.current = () => {
85521
85536
  settleWindow();
@@ -85679,9 +85694,7 @@ const useListScrollSync = ({
85679
85694
  const putTopItemBack = entries => {
85680
85695
  const listResized = entries.some(entry => entry.target === listEl);
85681
85696
  if (listResized) {
85682
- if (onGeometryChangeRef.current()) {
85683
- return;
85684
- }
85697
+ const placed = onGeometryChangeRef.current();
85685
85698
  cancelAnimationFrame(itemsResizedFrame);
85686
85699
  itemsResizedFrame = requestAnimationFrame(() => {
85687
85700
  if (pageLeftRef.current) {
@@ -85689,6 +85702,9 @@ const useListScrollSync = ({
85689
85702
  }
85690
85703
  onItemsResizedRef.current();
85691
85704
  });
85705
+ if (placed) {
85706
+ return;
85707
+ }
85692
85708
  }
85693
85709
  if (!entries.some(entry => entry.target === scrollerEl)) {
85694
85710
  return;