@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.
- package/dist/dev/jsenv_navi.js +17 -11
- package/dist/dev/jsenv_navi.js.map +6 -6
- package/dist/jsenv_navi.js +17 -11
- package/dist/jsenv_navi.js.map +6 -6
- package/docs/scroll.md +8 -0
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -11346,7 +11346,7 @@ const getMessageString = (message) => {
|
|
|
11346
11346
|
if (typeof message === "string") {
|
|
11347
11347
|
return message;
|
|
11348
11348
|
}
|
|
11349
|
-
if (Error
|
|
11349
|
+
if (message instanceof Error) {
|
|
11350
11350
|
return message.message;
|
|
11351
11351
|
}
|
|
11352
11352
|
return undefined;
|
|
@@ -19492,7 +19492,7 @@ const openCallout = (
|
|
|
19492
19492
|
element: calloutElement,
|
|
19493
19493
|
});
|
|
19494
19494
|
} else {
|
|
19495
|
-
if (Error
|
|
19495
|
+
if (newMessage instanceof Error) {
|
|
19496
19496
|
const error = newMessage;
|
|
19497
19497
|
newMessage = error.message;
|
|
19498
19498
|
if (showErrorStack && error.stack) {
|
|
@@ -23051,7 +23051,7 @@ const sayRefusal = (element, error) => {
|
|
|
23051
23051
|
let anchorElement = element;
|
|
23052
23052
|
if (
|
|
23053
23053
|
typeof error === "object" &&
|
|
23054
|
-
!
|
|
23054
|
+
!(error instanceof Error) &&
|
|
23055
23055
|
!isValidElement(error)
|
|
23056
23056
|
) {
|
|
23057
23057
|
message = error.message;
|
|
@@ -25680,7 +25680,7 @@ const useExecuteAction = (
|
|
|
25680
25680
|
// and it is then shown exactly as if there were no mapping at all.
|
|
25681
25681
|
if (typeof errorMappingResult === "string") {
|
|
25682
25682
|
message = errorMappingResult;
|
|
25683
|
-
} else if (Error
|
|
25683
|
+
} else if (errorMappingResult instanceof Error) {
|
|
25684
25684
|
message = errorMappingResult;
|
|
25685
25685
|
} else if (isValidElement(errorMappingResult)) {
|
|
25686
25686
|
message = errorMappingResult;
|
|
@@ -83190,7 +83190,7 @@ const css$w = /* css */`@property --list-group-label-height {
|
|
|
83190
83190
|
overflow: clip;
|
|
83191
83191
|
}
|
|
83192
83192
|
|
|
83193
|
-
.navi_list_container[data-horizontal]:not([data-scroller], [data-overflow-visible]) > .navi_list_scroll_container > .navi_list:not([navi-box-flow="grid"]) {
|
|
83193
|
+
.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"]) {
|
|
83194
83194
|
width: min-content;
|
|
83195
83195
|
min-width: 100%;
|
|
83196
83196
|
}
|
|
@@ -83751,7 +83751,7 @@ const ListUI = props => {
|
|
|
83751
83751
|
// rule (min-content, never narrower than its box — see the css), which
|
|
83752
83752
|
// already gives it what expandX asks. An inline width from expandX would beat
|
|
83753
83753
|
// that rule and lay the end room among the items again.
|
|
83754
|
-
const trackSizedByItsRule = horizontal && !scrollerAttribute && !overflowVisibleAttribute && !(columns || itemColumns);
|
|
83754
|
+
const trackSizedByItsRule = horizontal && !scrollerAttribute && !overflowVisibleAttribute && !rest.flexWrap && !(columns || itemColumns);
|
|
83755
83755
|
return jsx(Box, {
|
|
83756
83756
|
...rest,
|
|
83757
83757
|
ref: ref,
|
|
@@ -83762,6 +83762,7 @@ const ListUI = props => {
|
|
|
83762
83762
|
"data-borderless": isBorderless(rest) ? "" : undefined,
|
|
83763
83763
|
"data-scroller": scrollerAttribute,
|
|
83764
83764
|
"data-overflow-visible": overflowVisibleAttribute,
|
|
83765
|
+
"data-flex-wrap": rest.flexWrap ? "" : undefined,
|
|
83765
83766
|
"navi-hover-while-scrolling": hoverWhileScrolling ? "" : undefined,
|
|
83766
83767
|
"data-expand-x": expandX || expand ? "" : undefined,
|
|
83767
83768
|
"data-expand-y": expandY || expand ? "" : undefined,
|
|
@@ -84583,6 +84584,12 @@ const useListScrollSync = ({
|
|
|
84583
84584
|
// (pour l'instant pas grave car on travaille pour le mode select qui fermera le dialog au select)
|
|
84584
84585
|
const topMatchScoresKeyRef = useRef("");
|
|
84585
84586
|
const restoreScrollRafRef = useRef(null);
|
|
84587
|
+
// The frame reads the list's ref, which an unmount empties.
|
|
84588
|
+
useLayoutEffect(() => {
|
|
84589
|
+
return () => {
|
|
84590
|
+
cancelAnimationFrame(restoreScrollRafRef.current);
|
|
84591
|
+
};
|
|
84592
|
+
}, []);
|
|
84586
84593
|
useLayoutEffect(() => {
|
|
84587
84594
|
const listScrollContainerEl = ref.current ? getScroller() : null;
|
|
84588
84595
|
if (!listScrollContainerEl) {
|
|
@@ -84620,10 +84627,9 @@ const useListScrollSync = ({
|
|
|
84620
84627
|
// based on virtual item height which can wrongly restore the scroll.
|
|
84621
84628
|
// However we have a contract with outside to inside which item is scrolled
|
|
84622
84629
|
// (used by keyboard nav to enable anchoring the item for list item nav with arrow keys)
|
|
84623
|
-
// so we do our best to give that item back
|
|
84624
|
-
|
|
84625
|
-
|
|
84626
|
-
} = getScrollInfo({
|
|
84630
|
+
// so we do our best to give that item back: there is none to give when
|
|
84631
|
+
// the list has no visible part, and the restore happens all the same.
|
|
84632
|
+
const scrollInfo = getScrollInfo({
|
|
84627
84633
|
scrollValues: savedScroll,
|
|
84628
84634
|
scrollerEl: listScrollContainerEl,
|
|
84629
84635
|
listEl: getListEl(),
|
|
@@ -84639,7 +84645,7 @@ const useListScrollSync = ({
|
|
|
84639
84645
|
});
|
|
84640
84646
|
const listEl = getListEl();
|
|
84641
84647
|
dispatchPublicCustomEvent(listEl, "navi_scroll", {
|
|
84642
|
-
item,
|
|
84648
|
+
item: scrollInfo?.item,
|
|
84643
84649
|
event: new CustomEvent("navi_scroll_restore")
|
|
84644
84650
|
});
|
|
84645
84651
|
});
|