@jsenv/navi 0.29.385 → 0.29.387

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.
@@ -66503,6 +66503,19 @@ const createListRows = () => {
66503
66503
  `List: every row stands in the same slot, so they keep the order they first rendered in — reordering them (a search, a sort) will not move them. The list's rows must be its own children: give it the rows (or a <List.Items>), not a component rendering them.`,
66504
66504
  );
66505
66505
  };
66506
+ // A run holds the room of every item it was given, drawn or not: its
66507
+ // fillers count them, its window frames them. A row of it that renders
66508
+ // nothing leaves its room blank, where a declared row gives its place back.
66509
+ let runRowRemovedWarned = false;
66510
+ const warnRunRowRemoved = () => {
66511
+ if (runRowRemovedWarned) {
66512
+ return;
66513
+ }
66514
+ runRowRemovedWarned = true;
66515
+ console.warn(
66516
+ `List: a row drawn by <List.Items> matches nothing and searchNoMatchMode is "remove", but a run's rows cannot be removed: the run keeps the room of every item it was given, so the row leaves a blank. Give <List.Items> the matching items only (useSearchText orders them first; keep the ones whose getItemMatchInfo(item).match is not false), or use searchNoMatchMode="muted" / "invisible_and_inert", which keep the row.`,
66517
+ );
66518
+ };
66506
66519
  const removeFromSlot = (slotId, ownerId) => {
66507
66520
  const ownerIds = ownerIdsBySlot.get(slotId);
66508
66521
  if (!ownerIds) {
@@ -66774,6 +66787,7 @@ const createListRows = () => {
66774
66787
  // inside is then its to place (a run draws its groups with their rows
66775
66788
  // already placed), and no walk inside it has anything to declare.
66776
66789
  slotHasOwner: (slotId) => ownerIdsBySlot.has(slotId),
66790
+ warnRunRowRemoved,
66777
66791
  // Whether any run of rows lives in this list: what makes a render window
66778
66792
  // mean anything (see List's renderBudget).
66779
66793
  hasRuns: () => locatorByOwner.size > 0,
@@ -71261,7 +71275,10 @@ const VISIBILITY_HIDDEN_STYLE = {
71261
71275
  * @param {any[]} [props.items]
71262
71276
  * The collection, when it is held in memory: all of it, in order. Nothing is
71263
71277
  * ever asked for — `itemsAction`, `count`, `pageSize` and `memoryBudget` have
71264
- * no part to play, and no row is ever a skeleton.
71278
+ * no part to play, and no row is ever a skeleton. Every item is a row with
71279
+ * its room, whether the run draws it or holds it in a filler: a search that
71280
+ * is to remove rows (`searchNoMatchMode="remove"`) is applied to the array
71281
+ * itself — see `useSearchText` — not to the rows it draws.
71265
71282
  * @param {(range: object) => any} [props.itemsAction]
71266
71283
  * Where the rows come from when the collection is read a slice at a time:
71267
71284
  * a resource's range reader (`RESOURCE.GET_RANGE.bindParams(...)`).
@@ -78012,18 +78029,26 @@ const createSearch = (fields) => {
78012
78029
  };
78013
78030
 
78014
78031
  /**
78015
- * useSearch — reorders items so matched ones come first (sorted by score desc),
78016
- * followed by non-matched items in their natural order. No item is hidden.
78032
+ * useSearchText — reorders items so matched ones come first (sorted by score
78033
+ * desc), followed by non-matched items in their natural order. No item is
78034
+ * dropped: what a non-matching row becomes is the list's `searchNoMatchMode`.
78017
78035
  * Returns [orderedItems, getItemMatchInfo].
78018
78036
  * - orderedItems: all items, reordered
78019
78037
  * - getItemMatchInfo(item): { match, matchScore, matchRanges } — pass the
78020
- * whole thing straight to <ListItem matchInfo={getItemMatchInfo(item)} />,
78021
- * there is no need to destructure the three fields by hand.
78022
- *
78023
- * When searchText is empty, natural order is preserved and all items match with score 0.
78024
- *
78025
- * To filter (hide non-matching items), pass filtered={!getItemMatchInfo(item).match}
78026
- * to each ListItem. The list's matchFallback will be shown when all items are hidden.
78038
+ * whole thing straight to <List.Item matchInfo={getItemMatchInfo(item)} />,
78039
+ * there is no need to destructure the three fields by hand. The row derives
78040
+ * filtered / hidden / muted from it, and the list counts the rows matching
78041
+ * nothing (its searchFallback shows when none matches).
78042
+ *
78043
+ * When searchText is empty, natural order is preserved and all items match with
78044
+ * score 0.
78045
+ *
78046
+ * Rows declared one by one (<List.Item> children) give their place back when
78047
+ * removed. A run (<List.Items items={...}>) does not: it keeps the room of
78048
+ * every item it was given, drawn or held in a filler. In "remove" mode, hand
78049
+ * the run the matching items only — the ones whose getItemMatchInfo(item).match
78050
+ * is not false; a typed search that leaves the list without a row still shows
78051
+ * its searchFallback.
78027
78052
  */
78028
78053
  const useSearchText = (searchText, items, matchFn = applySearch) => {
78029
78054
  if (typeof searchText !== "string" && searchText !== undefined) {