@jsenv/navi 0.29.114 → 0.29.116
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/jsenv_navi.js +47 -46
- package/dist/jsenv_navi.js.map +8 -9
- package/docs/actions.md +14 -0
- package/docs/create_and_edit.md +3 -1
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -56908,6 +56908,15 @@ const css$C = /* css */`
|
|
|
56908
56908
|
--popup-border-width: 1px;
|
|
56909
56909
|
--popup-border-color: var(--navi-popup-border-color);
|
|
56910
56910
|
|
|
56911
|
+
/* A popup is a page of its own, opened from a control: it is written on
|
|
56912
|
+
the page's line, as the number, so each text it holds keeps a line
|
|
56913
|
+
relative to its own size. Its element sits under the control that
|
|
56914
|
+
opens it (a Picker holds its popup children inside its root), and
|
|
56915
|
+
line-height inherits as computed: the control's line is a length
|
|
56916
|
+
(--navi-control-line-height), and inherited it would arrive as that
|
|
56917
|
+
control's pixels — a 12px caption on an 18px picker's 23px rows. */
|
|
56918
|
+
line-height: var(--navi-line-height);
|
|
56919
|
+
|
|
56911
56920
|
&.navi_popover {
|
|
56912
56921
|
--popover-border-radius: var(--popup-border-radius);
|
|
56913
56922
|
--popover-border-width: var(--popup-border-width);
|
|
@@ -60586,6 +60595,7 @@ const ListUI = props => {
|
|
|
60586
60595
|
overflow,
|
|
60587
60596
|
overflowX,
|
|
60588
60597
|
overflowY,
|
|
60598
|
+
virtual,
|
|
60589
60599
|
...rest
|
|
60590
60600
|
} = props;
|
|
60591
60601
|
// Accept a string (e.g. from an HTML attribute: renderBudget="50") the
|
|
@@ -60636,20 +60646,8 @@ const ListUI = props => {
|
|
|
60636
60646
|
onListVisibleItemsChange?.(tracker.visibleItemsSignal.peek());
|
|
60637
60647
|
}
|
|
60638
60648
|
});
|
|
60639
|
-
|
|
60640
|
-
|
|
60641
|
-
// back the very vnodes it already holds, preact skips them — the list
|
|
60642
|
-
// re-rendered on its own and nothing is said again, so nothing is asked
|
|
60643
|
-
// again either (see openPass).
|
|
60644
|
-
const virtualRef = useRef(null);
|
|
60645
|
-
if (!virtualRef.current) {
|
|
60646
|
-
virtualRef.current = createListVirtual();
|
|
60647
|
-
}
|
|
60648
|
-
const virtual = virtualRef.current;
|
|
60649
|
-
const childrenPreviousRef = useRef(undefined);
|
|
60650
|
-
const childrenWalked = childrenPreviousRef.current !== children;
|
|
60651
|
-
childrenPreviousRef.current = children;
|
|
60652
|
-
virtual.openPass(renderBudget, scrolled ?? defaultScrolled, childrenWalked);
|
|
60649
|
+
virtual.renderBudget = renderBudget;
|
|
60650
|
+
virtual.scrolled = scrolled ?? defaultScrolled;
|
|
60653
60651
|
const {
|
|
60654
60652
|
virtualItemSizeSignal,
|
|
60655
60653
|
renderWindow,
|
|
@@ -60865,6 +60863,24 @@ const ListFirstResolver = props => {
|
|
|
60865
60863
|
props.ref = props.ref || refDefault;
|
|
60866
60864
|
const idDefault = useId();
|
|
60867
60865
|
props.id = props.id || idDefault;
|
|
60866
|
+
// A new pass every time the caller walks the children: they are about to
|
|
60867
|
+
// say again, in order, which rows of the collection they stand for. Decided
|
|
60868
|
+
// here, on the children as the caller gave them. Further down the chain a
|
|
60869
|
+
// resolver re-rendering on its own hands the rows down inside a vnode of its
|
|
60870
|
+
// own (ListSelectable wraps them in the group's contexts) — but the rows are
|
|
60871
|
+
// the very vnodes preact already holds, and it skips them: nothing is said
|
|
60872
|
+
// again, so nothing may be asked again either (see createListVirtual).
|
|
60873
|
+
const virtualRef = useRef(null);
|
|
60874
|
+
if (!virtualRef.current) {
|
|
60875
|
+
virtualRef.current = createListVirtual();
|
|
60876
|
+
}
|
|
60877
|
+
const virtual = virtualRef.current;
|
|
60878
|
+
const childrenPreviousRef = useRef(undefined);
|
|
60879
|
+
if (childrenPreviousRef.current !== props.children) {
|
|
60880
|
+
childrenPreviousRef.current = props.children;
|
|
60881
|
+
virtual.openPass();
|
|
60882
|
+
}
|
|
60883
|
+
props.virtual = virtual;
|
|
60868
60884
|
return jsx(Next, {
|
|
60869
60885
|
...props
|
|
60870
60886
|
});
|
|
@@ -62878,19 +62894,13 @@ const ListItemUI = props => {
|
|
|
62878
62894
|
const listItemVnode = jsx(ListItemReal, {
|
|
62879
62895
|
...props
|
|
62880
62896
|
});
|
|
62881
|
-
//
|
|
62882
|
-
//
|
|
62883
|
-
// reorder render pass (
|
|
62884
|
-
//
|
|
62885
|
-
//
|
|
62886
|
-
//
|
|
62887
|
-
//
|
|
62888
|
-
// Instead we use the parent-provided index, which is race-free:
|
|
62889
|
-
// - global list: props.index === 0 means "first by explicit order"
|
|
62890
|
-
// (parent passes sequential indices starting at 0; filtered items
|
|
62891
|
-
// are already pushed to the end by useSearchText)
|
|
62892
|
-
// - inside a group: each group has its own item tracker and group
|
|
62893
|
-
// items don't reorder, so groupVisibleIndex is reliable
|
|
62897
|
+
// "Am I the first visible item?" is answered by the place the list handed
|
|
62898
|
+
// out (virtual.take above), not by the tracker's visibleIndex: during a
|
|
62899
|
+
// reorder render pass (items resorted by search score) the other items still
|
|
62900
|
+
// carry stale keyToExplicitOrder values, the binary search reads them, no
|
|
62901
|
+
// item comes out at 0 and a spurious separator appears at the top. Inside a
|
|
62902
|
+
// group, each group has its own tracker and its items do not reorder, so
|
|
62903
|
+
// groupVisibleIndex is reliable.
|
|
62894
62904
|
const isFirstInList = groupVisibleIndex === null ? index === 0 : groupVisibleIndex === 0;
|
|
62895
62905
|
if (!separator || isFirstInList) {
|
|
62896
62906
|
return listItemVnode;
|
|
@@ -63204,9 +63214,10 @@ List.Item = ListItem;
|
|
|
63204
63214
|
// A child knows how many rows it stands for but not what was declared before
|
|
63205
63215
|
// it, so the list hands out the places as its children render — in order, which
|
|
63206
63216
|
// is the only thing needed to place them. A child re-rendering ON ITS OWN (its
|
|
63207
|
-
// own state changed, the list
|
|
63208
|
-
// nothing before it moved. Hence the pass — only
|
|
63209
|
-
//
|
|
63217
|
+
// own state changed, the list was not given its children again) keeps the
|
|
63218
|
+
// place it was given: nothing before it moved. Hence the pass — only the
|
|
63219
|
+
// caller walking the children again opens a new one (see ListFirstResolver),
|
|
63220
|
+
// and within a pass a child takes its place exactly once.
|
|
63210
63221
|
const createListVirtual = () => {
|
|
63211
63222
|
const totalSignal = signal(0);
|
|
63212
63223
|
// Bumped whenever a run takes in rows. The list itself has to hear about it:
|
|
@@ -63242,22 +63253,12 @@ const createListVirtual = () => {
|
|
|
63242
63253
|
horizontal: false,
|
|
63243
63254
|
virtualItemSizeSignal: null,
|
|
63244
63255
|
renderSkeleton: undefined,
|
|
63245
|
-
|
|
63246
|
-
|
|
63247
|
-
|
|
63248
|
-
|
|
63249
|
-
|
|
63250
|
-
|
|
63251
|
-
// holds, and preact skips them: nobody says where they sit, so nobody
|
|
63252
|
-
// may lose where they sat. Reopening the pass there would empty the
|
|
63253
|
-
// places without anyone refilling them, and the next row to render on
|
|
63254
|
-
// its own (an item being selected, a run following the window) would be
|
|
63255
|
-
// handed the first place — drawing itself as the top of the list, its
|
|
63256
|
-
// separator gone, and the one after it wearing a separator it should not
|
|
63257
|
-
// have.
|
|
63258
|
-
if (!childrenWalked) {
|
|
63259
|
-
return;
|
|
63260
|
-
}
|
|
63256
|
+
// Reopening the pass when the rows are not about to render again would
|
|
63257
|
+
// empty the places without anyone refilling them: the next row to render
|
|
63258
|
+
// on its own (an item being selected, a run following the window) would be
|
|
63259
|
+
// handed the first place — drawing itself as the top of the list, its
|
|
63260
|
+
// separator gone, and the one after it wearing a separator it should not.
|
|
63261
|
+
openPass: () => {
|
|
63261
63262
|
passId++;
|
|
63262
63263
|
nextIndex = 0;
|
|
63263
63264
|
},
|