@jsenv/navi 0.29.153 → 0.29.154

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.
@@ -61160,12 +61160,14 @@ const SKELETON_LIST_ITEM_CLASS = "navi_list_item_skeleton";
61160
61160
  // inside it (see ListItems): a run draws the rows it frames and holds the room
61161
61161
  // of the others.
61162
61162
  const RenderWindowContext = createContext(null);
61163
- // Carries List's own `columns` prop (a grid-template-columns value, e.g.
61163
+ // Carries List's own `itemColumns` prop (a grid-template-columns value, e.g.
61164
61164
  // "1fr auto auto") down to each ListItem/filler/fallback so they can render
61165
61165
  // as a subgrid row instead of a flex row — see ListItem's own use of this
61166
- // context, and List's own `columns` doc, for the full rationale (table-like
61166
+ // context, and List's own `itemColumns` doc, for the full rationale (table-like
61167
61167
  // column sizing that stays correct across a virtualized, windowed item set).
61168
- const ListColumnsContext = createContext(null);
61168
+ // List's own `columns` never reaches here: it lays the items themselves into
61169
+ // the track's columns, and an item then occupies a cell like anything else.
61170
+ const ListItemColumnsContext = createContext(null);
61169
61171
  // Carries the separator element/function down to each ListItem so separators
61170
61172
  // are only rendered between items that actually mount (post-filter, post-window).
61171
61173
  const SeparatorContext = createContext(null);
@@ -61251,6 +61253,8 @@ const css$x = /* css */`@layer navi {
61251
61253
  --x-list-scroll-spacing-bottom: calc(var(--list-footer-height, 0px) + var(--list-scroll-padding-bottom, 0px));
61252
61254
  --x-list-scroll-spacing-left: calc(var(--list-header-width, 0px) + var(--list-scroll-padding-left, 0px));
61253
61255
  --x-list-scroll-spacing-right: calc(var(--list-footer-width, 0px) + var(--list-scroll-padding-right, 0px));
61256
+ min-width: 0;
61257
+ max-width: var(--list-max-width, 100%);
61254
61258
  background-color: var(--x-list-background-color);
61255
61259
  border: var(--x-list-border-width) solid var(--x-list-border-color);
61256
61260
  border-top-left-radius: var(--x-corner-top-left-radius, var(--x-list-border-radius));
@@ -61258,8 +61262,6 @@ const css$x = /* css */`@layer navi {
61258
61262
  border-bottom-right-radius: var(--x-corner-bottom-right-radius, var(--x-list-border-radius));
61259
61263
  border-bottom-left-radius: var(--x-corner-bottom-left-radius, var(--x-list-border-radius));
61260
61264
  flex-direction: column;
61261
- min-width: 0;
61262
- max-width: 100%;
61263
61265
  transition: opacity .2s;
61264
61266
  display: flex;
61265
61267
  overflow: hidden;
@@ -61285,7 +61287,6 @@ const css$x = /* css */`@layer navi {
61285
61287
  min-width: inherit;
61286
61288
  max-width: var(--list-max-width, inherit);
61287
61289
  max-height: var(--list-max-height, inherit);
61288
- flex-wrap: inherit;
61289
61290
  overflow-anchor: none;
61290
61291
  overscroll-behavior: inherit;
61291
61292
  scrollbar-width: inherit;
@@ -61347,7 +61348,6 @@ const css$x = /* css */`@layer navi {
61347
61348
 
61348
61349
  .navi_list {
61349
61350
  box-sizing: border-box;
61350
- flex-wrap: inherit;
61351
61351
  outline: none;
61352
61352
  margin: 0;
61353
61353
  padding: 0;
@@ -61630,6 +61630,7 @@ const ListUI = props => {
61630
61630
  hoverWhileScrolling = false,
61631
61631
  lockSize,
61632
61632
  columns,
61633
+ itemColumns,
61633
61634
  searchText,
61634
61635
  searchNoMatchMode = "remove",
61635
61636
  loading,
@@ -61864,6 +61865,7 @@ const ListUI = props => {
61864
61865
  styleCSSVars: LIST_STYLE_CSS_VARS,
61865
61866
  pseudoClasses: LIST_PSEUDO_CLASSES,
61866
61867
  hasChildUsingForwardedProps: true,
61868
+ childPropSet: LIST_TRACK_PROP_SET,
61867
61869
  onnavi_request_scroll: e => {
61868
61870
  if (!Object.hasOwn(e.detail, "id")) {
61869
61871
  console.warn(`navi_request_scroll event is missing the "id" property in its detail.`, e);
@@ -61893,6 +61895,7 @@ const ListUI = props => {
61893
61895
  horizontal: horizontal,
61894
61896
  spacing: spacing,
61895
61897
  columns: columns,
61898
+ itemColumns: itemColumns,
61896
61899
  tracker: tracker,
61897
61900
  renderWindow: renderWindow,
61898
61901
  virtual: virtual,
@@ -61958,12 +61961,47 @@ const ListFirstResolver = props => {
61958
61961
  * horizontal?: boolean,
61959
61962
  * spacing?: string,
61960
61963
  * columns?: string,
61964
+ * itemColumns?: string,
61965
+ * alignX?: string,
61966
+ * alignY?: string,
61967
+ * flexWrap?: boolean,
61961
61968
  * expandX?: boolean,
61962
61969
  * expandY?: boolean,
61963
61970
  * expand?: boolean,
61964
61971
  * children?: import("ignore:preact").ComponentChildren,
61965
61972
  * [key: string]: any,
61966
61973
  * }>}
61974
+ * @param {string} [props.columns]
61975
+ * The list's own columns: a `grid-template-columns` value the ITEMS are laid
61976
+ * into — a sheet of icons (`repeat(auto-fill, minmax(2.5rem, 1fr))`), a row of
61977
+ * choices (`repeat(3, minmax(0, 1fr))`). Each item takes one cell, and an item
61978
+ * meant to take a whole line says so for itself
61979
+ * (`style={{ gridColumn: "1 / -1" }}`). Several items to a line is a shape the
61980
+ * list cannot virtualize — its render window and the room it holds for the
61981
+ * rows it does not draw both count one item per line — so it is for a set of
61982
+ * items the caller renders whole, not for a `<List.Items>` collection.
61983
+ * @param {string} [props.itemColumns]
61984
+ * The columns inside an ITEM: a `grid-template-columns` value each item fills
61985
+ * with its own children, a table whose cells line up down the list. Every item
61986
+ * becomes a subgrid row spanning all the columns, so a column is as wide as
61987
+ * the widest cell in it among the rows actually in the DOM — real column
61988
+ * sizing that stays right as the window moves. Rows of a table, then, where
61989
+ * `columns` above is a grid of items; the two cannot both be set.
61990
+ * @param {string} [props.alignX]
61991
+ * Where the items sit across the track — `alignX="center"` centres a
61992
+ * horizontal list's row of items inside a list wider than they are. Together
61993
+ * with `alignY`, `align` and `flexWrap`, this reaches the `<ul>` holding the
61994
+ * items rather than the frame drawn around it: the frame's only child is the
61995
+ * scroll box, which fills it and has nothing to arrange.
61996
+ * @param {boolean} [props.flexWrap]
61997
+ * Lets a horizontal list's items fall to the next line instead of running
61998
+ * past the edge — a row of choices under a `maxWidth`, say. Same caveat as
61999
+ * `columns` above: a line holding several items is not virtualizable.
62000
+ * @param {string} [props.overflow]
62001
+ * `"visible"` lets the items paint outside the list — a check in a row's
62002
+ * corner, a badge crossing the edge. A list clips by default, which is what
62003
+ * its rounded corners and its scroll box need, and the two cannot both be
62004
+ * true: asking for visible gives up the clipping, corners included.
61967
62005
  * @param {boolean} [props.itemTransition]
61968
62006
  * Names each row, so a change the application wraps in
61969
62007
  * `document.startViewTransition` is seen row by row — rows moving to their new
@@ -62087,6 +62125,7 @@ const ListContent = ({
62087
62125
  horizontal,
62088
62126
  spacing,
62089
62127
  columns,
62128
+ itemColumns,
62090
62129
  tracker,
62091
62130
  renderWindow,
62092
62131
  virtual,
@@ -62132,6 +62171,7 @@ const ListContent = ({
62132
62171
  horizontal: horizontal,
62133
62172
  spacing: spacing,
62134
62173
  columns: columns,
62174
+ itemColumns: itemColumns,
62135
62175
  ...listProps,
62136
62176
  tracker: tracker,
62137
62177
  renderWindow: renderWindow,
@@ -62143,6 +62183,12 @@ const ListContent = ({
62143
62183
  })
62144
62184
  });
62145
62185
  };
62186
+ // Where the items sit is a question about the track (the <ul>), not about the
62187
+ // frame around it: the frame's only child is the scroll box, which fills it and
62188
+ // has nothing to arrange. Box moves these out of the container's own props and
62189
+ // into BoxForwardedPropsContext, which ListContent reads and hands to the <ul>
62190
+ // — the same route `horizontal`, `spacing` and the column props take by hand.
62191
+ const LIST_TRACK_PROP_SET = new Set(["align", "alignX", "alignY", "flexWrap"]);
62146
62192
  const LIST_STYLE_CSS_VARS = {
62147
62193
  maxHeight: "--list-max-height",
62148
62194
  maxWidth: "--list-max-width",
@@ -63614,6 +63660,7 @@ const UnorderedList = ({
63614
63660
  horizontal,
63615
63661
  spacing,
63616
63662
  columns,
63663
+ itemColumns,
63617
63664
  children,
63618
63665
  ...rest
63619
63666
  }) => {
@@ -63622,11 +63669,19 @@ const UnorderedList = ({
63622
63669
  // A loading state drawing nothing keeps the message: an announced count of 0
63623
63670
  // already tells us the list is empty (see ListUI's loadingPlaceholderShown).
63624
63671
  const suppressFallback = loadingPlaceholderShown || Boolean(error);
63672
+
63673
+ // One track, one template: the two column props are the same
63674
+ // grid-template-columns seen from either end, and only differ in what an
63675
+ // item does with it (see useItemColumnsOverrideProps).
63676
+ if (columns && itemColumns) {
63677
+ console.warn(`List: "columns" and "itemColumns" cannot both be set — they define the same track. "columns" lays the items into the columns; "itemColumns" gives each item the columns its own children fill.`);
63678
+ }
63679
+ const trackColumns = columns || itemColumns;
63625
63680
  return jsxs(Box, {
63626
63681
  as: "ul",
63627
- flex: columns ? undefined : horizontal ? "x" : "y",
63628
- grid: columns ? true : undefined,
63629
- gridTemplateColumns: columns,
63682
+ flex: trackColumns ? undefined : horizontal ? "x" : "y",
63683
+ grid: trackColumns ? true : undefined,
63684
+ gridTemplateColumns: trackColumns,
63630
63685
  ...rest,
63631
63686
  spacing: spacing,
63632
63687
  baseClassName: "navi_list",
@@ -63648,8 +63703,8 @@ const UnorderedList = ({
63648
63703
  value: virtual,
63649
63704
  children: jsx(ListRowContext.Provider, {
63650
63705
  value: null,
63651
- children: jsx(ListColumnsContext.Provider, {
63652
- value: columns || null,
63706
+ children: jsx(ListItemColumnsContext.Provider, {
63707
+ value: columns ? null : itemColumns || null,
63653
63708
  children: jsx(ListDeclaredChildren, {
63654
63709
  children: children
63655
63710
  })
@@ -63718,8 +63773,8 @@ const VirtualFiller = ({
63718
63773
  });
63719
63774
  };
63720
63775
 
63721
- // List's own `columns` prop (see ListColumnsContext) turns a list item into
63722
- // a subgrid row instead of a flex row: its own children become direct grid
63776
+ // List's own `itemColumns` prop (see ListItemColumnsContext) turns a list item
63777
+ // into a subgrid row instead of a flex row: its own children become direct grid
63723
63778
  // items of List's own <ul>, so column widths are computed from whichever
63724
63779
  // rows are actually in the DOM (the currently-windowed items plus the
63725
63780
  // always-mounted header/footer) — real grid/table column sizing, not a
@@ -63729,11 +63784,10 @@ const VirtualFiller = ({
63729
63784
  // this they'd silently stay flex rows and break column alignment against
63730
63785
  // the rest of the grid). `flex` is force-cleared here because Box picks
63731
63786
  // flex over grid when both are set (see box.jsx's own boxFlow resolution),
63732
- // so a caller-provided `flex` prop (leftover from a non-columns usage)
63733
- // would otherwise silently win over this.
63734
- const useListItemColumnsOverrideProps = callerStyle => {
63735
- const columns = useContext(ListColumnsContext);
63736
- if (!columns) {
63787
+ // so a caller-provided `flex` prop would otherwise silently win over this.
63788
+ const useItemColumnsOverrideProps = callerStyle => {
63789
+ const itemColumns = useContext(ListItemColumnsContext);
63790
+ if (!itemColumns) {
63737
63791
  return undefined;
63738
63792
  }
63739
63793
  return {
@@ -63797,11 +63851,11 @@ const ListItemPresentationResolver = props => {
63797
63851
  });
63798
63852
  };
63799
63853
  const ListItemPresentation = props => {
63800
- const columnsOverrideProps = useListItemColumnsOverrideProps(props.style);
63854
+ const itemColumnsOverrideProps = useItemColumnsOverrideProps(props.style);
63801
63855
  return jsx(Box, {
63802
63856
  as: "li",
63803
63857
  ...props,
63804
- ...columnsOverrideProps
63858
+ ...itemColumnsOverrideProps
63805
63859
  });
63806
63860
  };
63807
63861
  // A <List.Item skeleton> — a non-interactive placeholder row shown while a list
@@ -63831,14 +63885,14 @@ const ListItemSkeleton = props => {
63831
63885
  paddingY = "s",
63832
63886
  ...rest
63833
63887
  } = props;
63834
- const columnsOverrideProps = useListItemColumnsOverrideProps(rest.style);
63888
+ const itemColumnsOverrideProps = useItemColumnsOverrideProps(rest.style);
63835
63889
  return jsx(Box, {
63836
63890
  as: "li",
63837
63891
  role: "presentation",
63838
63892
  "aria-hidden": "true",
63839
63893
  paddingY: paddingY,
63840
63894
  ...rest,
63841
- ...columnsOverrideProps,
63895
+ ...itemColumnsOverrideProps,
63842
63896
  baseClassName: `navi_list_item ${SKELETON_LIST_ITEM_CLASS}`,
63843
63897
  children: children ?? jsx(Text, {
63844
63898
  loading: true
@@ -63999,7 +64053,7 @@ const ListItemReal = props => {
63999
64053
  // CSS Highlight API: mark matching text ranges from matchInfo.matchRanges,
64000
64054
  // if any (there is no standalone highlight prop — see ListItem's own doc).
64001
64055
  useSearchHighlight(ref, matchInfo?.matchRanges, [children, hidden]);
64002
- const columnsOverrideProps = useListItemColumnsOverrideProps(rest.style);
64056
+ const itemColumnsOverrideProps = useItemColumnsOverrideProps(rest.style);
64003
64057
  // <List itemTransition>: the row carries the name it is to be paired by, and
64004
64058
  // the stylesheet turns it into a view-transition-name where a browser can
64005
64059
  // draw it inside the list (see the @supports block in the css above).
@@ -64068,7 +64122,7 @@ const ListItemReal = props => {
64068
64122
  id: id,
64069
64123
  "navi-list-item-real": "",
64070
64124
  ...rest,
64071
- ...columnsOverrideProps,
64125
+ ...itemColumnsOverrideProps,
64072
64126
  index: undefined,
64073
64127
  selected: undefined
64074
64128
  // We use aria-hidden and not hidden because hidden would be forced to