@jsenv/navi 0.30.3 → 0.30.4

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.
@@ -11751,7 +11751,7 @@ const getMessageString = (message) => {
11751
11751
  if (typeof message === "string") {
11752
11752
  return message;
11753
11753
  }
11754
- if (Error.isError(message)) {
11754
+ if (message instanceof Error) {
11755
11755
  return message.message;
11756
11756
  }
11757
11757
  return undefined;
@@ -20281,7 +20281,7 @@ const openCallout = (
20281
20281
  element: calloutElement,
20282
20282
  });
20283
20283
  } else {
20284
- if (Error.isError(newMessage)) {
20284
+ if (newMessage instanceof Error) {
20285
20285
  const error = newMessage;
20286
20286
  newMessage = error.message;
20287
20287
  if (showErrorStack && error.stack) {
@@ -23931,7 +23931,7 @@ const sayRefusal = (element, error) => {
23931
23931
  let anchorElement = element;
23932
23932
  if (
23933
23933
  typeof error === "object" &&
23934
- !Error.isError(error) &&
23934
+ !(error instanceof Error) &&
23935
23935
  !isValidElement(error)
23936
23936
  ) {
23937
23937
  message = error.message;
@@ -26739,7 +26739,7 @@ const useExecuteAction = (
26739
26739
  // and it is then shown exactly as if there were no mapping at all.
26740
26740
  if (typeof errorMappingResult === "string") {
26741
26741
  message = errorMappingResult;
26742
- } else if (Error.isError(errorMappingResult)) {
26742
+ } else if (errorMappingResult instanceof Error) {
26743
26743
  message = errorMappingResult;
26744
26744
  } else if (isValidElement(errorMappingResult)) {
26745
26745
  message = errorMappingResult;
@@ -84981,7 +84981,7 @@ const css$w = /* css */`@property --list-group-label-height {
84981
84981
  overflow: clip;
84982
84982
  }
84983
84983
 
84984
- .navi_list_container[data-horizontal]:not([data-scroller], [data-overflow-visible]) > .navi_list_scroll_container > .navi_list:not([navi-box-flow="grid"]) {
84984
+ .navi_list_container[data-horizontal]:not([data-scroller], [data-overflow-visible], [data-flex-wrap]) > .navi_list_scroll_container > .navi_list:not([navi-box-flow="grid"]) {
84985
84985
  width: min-content;
84986
84986
  min-width: 100%;
84987
84987
  }
@@ -85542,7 +85542,7 @@ const ListUI = props => {
85542
85542
  // rule (min-content, never narrower than its box — see the css), which
85543
85543
  // already gives it what expandX asks. An inline width from expandX would beat
85544
85544
  // that rule and lay the end room among the items again.
85545
- const trackSizedByItsRule = horizontal && !scrollerAttribute && !overflowVisibleAttribute && !(columns || itemColumns);
85545
+ const trackSizedByItsRule = horizontal && !scrollerAttribute && !overflowVisibleAttribute && !rest.flexWrap && !(columns || itemColumns);
85546
85546
  return jsx(Box, {
85547
85547
  ...rest,
85548
85548
  ref: ref,
@@ -85553,6 +85553,7 @@ const ListUI = props => {
85553
85553
  "data-borderless": isBorderless(rest) ? "" : undefined,
85554
85554
  "data-scroller": scrollerAttribute,
85555
85555
  "data-overflow-visible": overflowVisibleAttribute,
85556
+ "data-flex-wrap": rest.flexWrap ? "" : undefined,
85556
85557
  "navi-hover-while-scrolling": hoverWhileScrolling ? "" : undefined,
85557
85558
  "data-expand-x": expandX || expand ? "" : undefined,
85558
85559
  "data-expand-y": expandY || expand ? "" : undefined,
@@ -86425,6 +86426,12 @@ const useListScrollSync = ({
86425
86426
  // (pour l'instant pas grave car on travaille pour le mode select qui fermera le dialog au select)
86426
86427
  const topMatchScoresKeyRef = useRef("");
86427
86428
  const restoreScrollRafRef = useRef(null);
86429
+ // The frame reads the list's ref, which an unmount empties.
86430
+ useLayoutEffect(() => {
86431
+ return () => {
86432
+ cancelAnimationFrame(restoreScrollRafRef.current);
86433
+ };
86434
+ }, []);
86428
86435
  useLayoutEffect(() => {
86429
86436
  const listScrollContainerEl = ref.current ? getScroller() : null;
86430
86437
  if (!listScrollContainerEl) {
@@ -86463,10 +86470,9 @@ const useListScrollSync = ({
86463
86470
  // based on virtual item height which can wrongly restore the scroll.
86464
86471
  // However we have a contract with outside to inside which item is scrolled
86465
86472
  // (used by keyboard nav to enable anchoring the item for list item nav with arrow keys)
86466
- // so we do our best to give that item back
86467
- const {
86468
- item
86469
- } = getScrollInfo({
86473
+ // so we do our best to give that item back: there is none to give when
86474
+ // the list has no visible part, and the restore happens all the same.
86475
+ const scrollInfo = getScrollInfo({
86470
86476
  scrollValues: savedScroll,
86471
86477
  scrollerEl: listScrollContainerEl,
86472
86478
  listEl: getListEl(),
@@ -86482,7 +86488,7 @@ const useListScrollSync = ({
86482
86488
  });
86483
86489
  const listEl = getListEl();
86484
86490
  dispatchPublicCustomEvent(listEl, "navi_scroll", {
86485
- item,
86491
+ item: scrollInfo?.item,
86486
86492
  event: new CustomEvent("navi_scroll_restore")
86487
86493
  });
86488
86494
  });