@jsenv/navi 0.29.495 → 0.29.497
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 +45 -25
- package/dist/dev/jsenv_navi.js.map +5 -5
- package/dist/jsenv_navi.js +44 -24
- package/dist/jsenv_navi.js.map +5 -5
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -78993,12 +78993,14 @@ const PickerCustomResolver = props => {
|
|
|
78993
78993
|
return renderResolver(PickerNative, props);
|
|
78994
78994
|
}
|
|
78995
78995
|
if (props.mode === "callout") {
|
|
78996
|
-
// A tooltip is an icon one presses, unless told otherwise
|
|
78997
|
-
//
|
|
78998
|
-
//
|
|
78999
|
-
//
|
|
79000
|
-
if (
|
|
78996
|
+
// A tooltip is an icon one presses, unless told otherwise; "picker" asks
|
|
78997
|
+
// for the field-like drawing back. "circle" is the icon variant with the
|
|
78998
|
+
// status icon drawn round — a word about the trigger, not a drawing of its
|
|
78999
|
+
// own.
|
|
79000
|
+
if (props.variant === undefined) {
|
|
79001
79001
|
props.variant = "icon";
|
|
79002
|
+
} else if (props.variant === "picker") {
|
|
79003
|
+
props.variant = undefined;
|
|
79002
79004
|
}
|
|
79003
79005
|
const circle = props.variant === "circle";
|
|
79004
79006
|
if (circle) {
|
|
@@ -80489,11 +80491,10 @@ const PickerConfirmResolver = props => {
|
|
|
80489
80491
|
openWhileReadOnly = false
|
|
80490
80492
|
} = props;
|
|
80491
80493
|
// A button, unless told otherwise: nothing is picked here, the popup is a
|
|
80492
|
-
// question, and a question is asked by pressing something. "picker"
|
|
80493
|
-
//
|
|
80494
|
-
//
|
|
80495
|
-
|
|
80496
|
-
const variant = Object.hasOwn(props, "variant") ? props.variant === "picker" ? undefined : props.variant : "button";
|
|
80494
|
+
// question, and a question is asked by pressing something. "picker" is how a
|
|
80495
|
+
// caller asks for the field-like drawing back — a word, not an undefined, so
|
|
80496
|
+
// a wrapper forwarding `variant={variant}` keeps the button.
|
|
80497
|
+
const variant = props.variant === undefined ? "button" : props.variant === "picker" ? undefined : props.variant;
|
|
80497
80498
|
|
|
80498
80499
|
// From the picker's own input, as its press would have been: the input is
|
|
80499
80500
|
// what carries `command`/`commandFor` in the DOM, and what a form sending
|
|
@@ -84871,19 +84872,28 @@ const useListScrollSync = ({
|
|
|
84871
84872
|
});
|
|
84872
84873
|
}, []);
|
|
84873
84874
|
// What to do when the list's own geometry moves under it, kept fresh for the
|
|
84874
|
-
// observer below (which is installed once).
|
|
84875
|
+
// observer below (which is installed once). A held list is placed inside the
|
|
84876
|
+
// resize delivery, so the browser paints it where it lands; answers whether
|
|
84877
|
+
// it was.
|
|
84875
84878
|
const onGeometryChangeRef = useRef(null);
|
|
84876
84879
|
onGeometryChangeRef.current = () => {
|
|
84877
|
-
|
|
84878
|
-
|
|
84879
|
-
placeWhereHeld();
|
|
84880
|
-
return true;
|
|
84880
|
+
if (!heldSomewhere) {
|
|
84881
|
+
return false;
|
|
84881
84882
|
}
|
|
84882
|
-
|
|
84883
|
-
|
|
84884
|
-
|
|
84883
|
+
settleWindow();
|
|
84884
|
+
placeWhereHeld();
|
|
84885
|
+
return true;
|
|
84886
|
+
};
|
|
84887
|
+
// Items that came in at another size than what stood in for them (a
|
|
84888
|
+
// skeleton becoming its item) leave the window short of the screen, or past
|
|
84889
|
+
// it, and nothing scrolled to say so. Asked on the next frame, not inside
|
|
84890
|
+
// the resize delivery: the window it frames is a render, which resizes what
|
|
84891
|
+
// is observed once more, and the browser gives up on the loop
|
|
84892
|
+
// ("ResizeObserver loop completed with undelivered notifications").
|
|
84893
|
+
const onItemsResizedRef = useRef(null);
|
|
84894
|
+
onItemsResizedRef.current = () => {
|
|
84895
|
+
settleWindow();
|
|
84885
84896
|
evaluateWindowRef.current("items resized");
|
|
84886
|
-
return false;
|
|
84887
84897
|
};
|
|
84888
84898
|
// The box around a held list changing shape is the hold's to answer too: it
|
|
84889
84899
|
// places the list again, the way it writes every scroll of its own (see
|
|
@@ -85031,10 +85041,20 @@ const useListScrollSync = ({
|
|
|
85031
85041
|
// which this would undo. The SCROLLER resizing is the window around it
|
|
85032
85042
|
// changing shape, and then the item that was at the top goes back where it
|
|
85033
85043
|
// was.
|
|
85044
|
+
let itemsResizedFrame;
|
|
85034
85045
|
const putTopItemBack = entries => {
|
|
85035
85046
|
const listResized = entries.some(entry => entry.target === listEl);
|
|
85036
|
-
if (listResized
|
|
85037
|
-
|
|
85047
|
+
if (listResized) {
|
|
85048
|
+
if (onGeometryChangeRef.current()) {
|
|
85049
|
+
return;
|
|
85050
|
+
}
|
|
85051
|
+
cancelAnimationFrame(itemsResizedFrame);
|
|
85052
|
+
itemsResizedFrame = requestAnimationFrame(() => {
|
|
85053
|
+
if (pageLeftRef.current) {
|
|
85054
|
+
return;
|
|
85055
|
+
}
|
|
85056
|
+
onItemsResizedRef.current();
|
|
85057
|
+
});
|
|
85038
85058
|
}
|
|
85039
85059
|
if (!entries.some(entry => entry.target === scrollerEl)) {
|
|
85040
85060
|
return;
|
|
@@ -85087,6 +85107,7 @@ const useListScrollSync = ({
|
|
|
85087
85107
|
observer.observe(listEl);
|
|
85088
85108
|
return () => {
|
|
85089
85109
|
observer.disconnect();
|
|
85110
|
+
cancelAnimationFrame(itemsResizedFrame);
|
|
85090
85111
|
};
|
|
85091
85112
|
}, [scrollerElResolved]);
|
|
85092
85113
|
|
|
@@ -92884,9 +92905,8 @@ const PickerUI = /*#__PURE__*/Object.assign(PickerDefaultUI, {
|
|
|
92884
92905
|
* not sit in — an object on a map saying
|
|
92885
92906
|
* `triggerNaviCommand(pickerEl, "--navi-open", event, { anchor, value })` —
|
|
92886
92907
|
* therefore wants an element of its own to stretch into rather than the
|
|
92887
|
-
* nearest positioned ancestor it happens to find. `"picker"`
|
|
92888
|
-
*
|
|
92889
|
-
* drawing every other picker has.
|
|
92908
|
+
* nearest positioned ancestor it happens to find. `"picker"` asks a confirm
|
|
92909
|
+
* or callout picker for the field-like drawing every other picker has.
|
|
92890
92910
|
* @param {boolean} [cta] A call to action: filled with the accent, its border
|
|
92891
92911
|
* matching, as `cta` draws a Button — for a confirm picker that is a row's
|
|
92892
92912
|
* main action.
|