@jsenv/navi 0.29.428 → 0.29.430
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 +51 -23
- package/dist/dev/jsenv_navi.js.map +5 -5
- package/dist/jsenv_navi.js +38 -16
- package/dist/jsenv_navi.js.map +5 -5
- package/docs/scroll.md +4 -1
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -30015,14 +30015,14 @@ import.meta.css = /* css */[`[data-scrollable] > .navi_loading_outline_wrapper,
|
|
|
30015
30015
|
}
|
|
30016
30016
|
|
|
30017
30017
|
[data-scrollable] {
|
|
30018
|
-
overflow: var(--x-scrollable-overflow, auto);
|
|
30019
30018
|
scroll-padding: var(--navi-scroll-padding, var(--navi-s));
|
|
30020
30019
|
--box-header-z-index: var(--navi-z-index-sticky);
|
|
30021
30020
|
--box-footer-z-index: var(--navi-z-index-sticky);
|
|
30022
30021
|
isolation: isolate;
|
|
30022
|
+
overflow: auto;
|
|
30023
30023
|
|
|
30024
30024
|
&[data-scrollable-overflow="scroll"] {
|
|
30025
|
-
|
|
30025
|
+
overflow: scroll;
|
|
30026
30026
|
}
|
|
30027
30027
|
|
|
30028
30028
|
& > [data-header] {
|
|
@@ -30044,9 +30044,9 @@ import.meta.css = /* css */[`[data-scrollable] > .navi_loading_outline_wrapper,
|
|
|
30044
30044
|
}
|
|
30045
30045
|
|
|
30046
30046
|
&:has( > [data-body]) {
|
|
30047
|
-
--x-scrollable-overflow: hidden;
|
|
30048
30047
|
flex-direction: column;
|
|
30049
30048
|
display: flex;
|
|
30049
|
+
overflow: hidden;
|
|
30050
30050
|
|
|
30051
30051
|
& > [data-header], & > [data-footer] {
|
|
30052
30052
|
z-index: auto;
|
|
@@ -38775,6 +38775,16 @@ const resolveAfterSend = (target, requester) => {
|
|
|
38775
38775
|
}
|
|
38776
38776
|
return undefined;
|
|
38777
38777
|
};
|
|
38778
|
+
// What follows a send is caused by the send, not by the gesture: the send
|
|
38779
|
+
// answered the gesture and may have prevented it (an Enter must not also click
|
|
38780
|
+
// the submit button, nor activate the trigger of the popup it closed), and a
|
|
38781
|
+
// follow-up judged on that event is refused as a gesture someone cancelled.
|
|
38782
|
+
// Chained, so the gesture stays readable behind it.
|
|
38783
|
+
const createSentEvent = (event) => {
|
|
38784
|
+
const sentEvent = new CustomEvent("sent", { detail: {} });
|
|
38785
|
+
chainEvent(sentEvent, event);
|
|
38786
|
+
return sentEvent;
|
|
38787
|
+
};
|
|
38778
38788
|
|
|
38779
38789
|
registerNaviCommand("--navi-send", (source, event, { requester }) => {
|
|
38780
38790
|
const expandable = resolveExpandableAround(source);
|
|
@@ -38807,7 +38817,9 @@ registerNaviCommand("--navi-send", (source, event, { requester }) => {
|
|
|
38807
38817
|
source.getAttribute("data-after-send") ||
|
|
38808
38818
|
target.getAttribute("data-after-send");
|
|
38809
38819
|
if (afterSend) {
|
|
38810
|
-
triggerNaviCommand(target, afterSend, event, {
|
|
38820
|
+
triggerNaviCommand(target, afterSend, createSentEvent(event), {
|
|
38821
|
+
optional: true,
|
|
38822
|
+
});
|
|
38811
38823
|
}
|
|
38812
38824
|
return result;
|
|
38813
38825
|
},
|
|
@@ -38851,7 +38863,9 @@ registerNaviCommand("--navi-send", (source, event, { requester }) => {
|
|
|
38851
38863
|
if (!afterSend) {
|
|
38852
38864
|
return;
|
|
38853
38865
|
}
|
|
38854
|
-
triggerNaviCommand(source, afterSend, event, {
|
|
38866
|
+
triggerNaviCommand(source, afterSend, createSentEvent(event), {
|
|
38867
|
+
optional: true,
|
|
38868
|
+
});
|
|
38855
38869
|
};
|
|
38856
38870
|
const {
|
|
38857
38871
|
result: sent,
|
|
@@ -72728,9 +72742,12 @@ const useListScrollSync = ({
|
|
|
72728
72742
|
};
|
|
72729
72743
|
const [renderWindow, setRenderWindow] = useState(() => {
|
|
72730
72744
|
// Opening somewhere else than the beginning starts by framing there: the
|
|
72731
|
-
// items the list will draw are the items it will ask for.
|
|
72745
|
+
// items the list will draw are the items it will ask for. A named item is
|
|
72746
|
+
// framed where it stood when it was written down, which is where holdWindow
|
|
72747
|
+
// aims before anyone can say where it is.
|
|
72732
72748
|
const openAt = scrolled ?? defaultScrolled;
|
|
72733
|
-
const
|
|
72749
|
+
const openIndex = typeof openAt === "number" ? openAt : openAt && typeof openAt === "object" && typeof openAt.index === "number" ? openAt.index : null;
|
|
72750
|
+
const start = openIndex === null ? 0 : openIndex - itemsAboveOpening(openAt, firstWindowItemCount);
|
|
72734
72751
|
const startClamped = start < 0 ? 0 : start;
|
|
72735
72752
|
return {
|
|
72736
72753
|
start: startClamped,
|
|
@@ -72856,14 +72873,11 @@ const useListScrollSync = ({
|
|
|
72856
72873
|
if (wantedStart < 0) {
|
|
72857
72874
|
wantedStart = 0;
|
|
72858
72875
|
}
|
|
72859
|
-
|
|
72860
|
-
|
|
72861
|
-
|
|
72862
|
-
|
|
72863
|
-
|
|
72864
|
-
start: wantedStart,
|
|
72865
|
-
end: wantedStart + windowSize
|
|
72866
|
-
};
|
|
72876
|
+
// The window the hold frames goes into the state, not into this render
|
|
72877
|
+
// alone: the next render starts from the state, and once the item stands
|
|
72878
|
+
// inside the window the hold stops framing it — a window left where the
|
|
72879
|
+
// state had it would draw around another place.
|
|
72880
|
+
updateRenderWindow(wantedStart, wantedStart + windowSize);
|
|
72867
72881
|
listItems.holdPending = false;
|
|
72868
72882
|
};
|
|
72869
72883
|
const pendingScrollRef = useRef();
|
|
@@ -73011,6 +73025,13 @@ const useListScrollSync = ({
|
|
|
73011
73025
|
return;
|
|
73012
73026
|
}
|
|
73013
73027
|
hasBeenDisplayedRef.current = true;
|
|
73028
|
+
const place = startPlaceRef.current;
|
|
73029
|
+
if (!place.userTookOver && place.wanted !== "start" && place.wanted !== undefined) {
|
|
73030
|
+
// Held somewhere: where the list opens is the hold's to say (see
|
|
73031
|
+
// placeWhereHeld). Scrolled here too, the list would go to the top or
|
|
73032
|
+
// the selected item for as long as the hold takes to put it back.
|
|
73033
|
+
return;
|
|
73034
|
+
}
|
|
73014
73035
|
const items = listItems.itemsSignal.peek();
|
|
73015
73036
|
const firstSelected = items.find(i => {
|
|
73016
73037
|
if (i.selected) {
|
|
@@ -77308,7 +77329,8 @@ const ListResolved = /*#__PURE__*/createComponentResolver([ListFirstResolver, Li
|
|
|
77308
77329
|
* "Many rows"). The window keeps three quarters of what the screen leaves of
|
|
77309
77330
|
* it ahead of the scroll, and moves once that falls under half a screen; it
|
|
77310
77331
|
* has to hold more than the screen shows, with room for that lookahead — the
|
|
77311
|
-
* list warns when it
|
|
77332
|
+
* list warns when it holds no more than the screen. How much more is
|
|
77333
|
+
* measured: fling the list on the slowest device it runs on.
|
|
77312
77334
|
*
|
|
77313
77335
|
* `{ initial, after }` for a list whose first picture is taken as it is
|
|
77314
77336
|
* built — drawn in the click that opens a popup, or in the update callback
|