@jsenv/navi 0.30.39 → 0.30.40

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.
@@ -85493,6 +85493,17 @@ const createListItems = () => {
85493
85493
  }
85494
85494
  return null;
85495
85495
  },
85496
+ // Whether a run stands for the item at that index without holding it: the
85497
+ // page it belongs to has not answered yet. An id missing from what the runs
85498
+ // hold says the item is gone only once the page where it stood is in.
85499
+ itemOnItsWayAt: (index) => {
85500
+ for (const locator of locatorByOwner.values()) {
85501
+ if (locator.awaits(index)) {
85502
+ return true;
85503
+ }
85504
+ }
85505
+ return false;
85506
+ },
85496
85507
  // The room the item at that index takes: the room it took when it was
85497
85508
  // last drawn, else the room its run is given for it (see List.Items'
85498
85509
  // itemSize), else undefined.
@@ -88519,10 +88530,14 @@ const useListScrollSync = ({
88519
88530
  // Not there yet, but where it stood is drawn already: the item
88520
88531
  // standing in for it at that index (see holdWindow). The list is placed
88521
88532
  // on that one, measured like any other, and the named item takes over
88522
- // where it lands.
88523
- if (listItems.pagesSignal.peek() === 0) {
88524
- if (typeof scrolledWanted.index === "number") {
88525
- placeItem(findItemElementAt(getListEl(), scrolledWanted.index), scrolledWanted.offset || 0, scrolledWanted.align);
88533
+ // where it lands. Held for as long as the page at that index has not
88534
+ // answered — the first one, or the one a press sends the list to: only
88535
+ // an answer without the item says it is gone.
88536
+ const standInIndex = scrolledWanted.index;
88537
+ const hasStandIn = typeof standInIndex === "number";
88538
+ if (listItems.pagesSignal.peek() === 0 || hasStandIn && listItems.itemOnItsWayAt(standInIndex)) {
88539
+ if (hasStandIn) {
88540
+ placeItem(findItemElementAt(getListEl(), standInIndex), scrolledWanted.offset || 0, scrolledWanted.align);
88526
88541
  }
88527
88542
  return;
88528
88543
  }
@@ -92217,6 +92232,7 @@ const useRunItems = (store, {
92217
92232
  });
92218
92233
  return found;
92219
92234
  },
92235
+ awaits: itemIndex => itemIndex >= runStart && itemIndex < runEnd && getItemAt(itemIndex) === undefined,
92220
92236
  roomAt: roomOf,
92221
92237
  givenRoomAt: givenRoomOf
92222
92238
  });