@jsenv/navi 0.29.159 → 0.29.161
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 +56 -14
- package/dist/jsenv_navi.js.map +7 -4455
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -5686,6 +5686,15 @@ const CONTROL_PROP_SET = new Set([
|
|
|
5686
5686
|
|
|
5687
5687
|
"charGuard",
|
|
5688
5688
|
"maxLengthGuard",
|
|
5689
|
+
|
|
5690
|
+
// This control answers for itself: it registers into no group, no form and no
|
|
5691
|
+
// picker around it (see useUIStateController). It belongs here rather than
|
|
5692
|
+
// being deleted off `props` where it is read: props is the vnode's own object
|
|
5693
|
+
// and Preact hands the SAME one back on a re-render the component triggers
|
|
5694
|
+
// itself, so a prop deleted on the first render is simply gone on the second
|
|
5695
|
+
// — and the control, no longer standalone, walked into the group it had
|
|
5696
|
+
// stepped out of.
|
|
5697
|
+
"standalone",
|
|
5689
5698
|
]);
|
|
5690
5699
|
|
|
5691
5700
|
/**
|
|
@@ -30621,13 +30630,28 @@ const triggerNaviCommand = (
|
|
|
30621
30630
|
return false;
|
|
30622
30631
|
}
|
|
30623
30632
|
const { target, implementation } = execute;
|
|
30624
|
-
|
|
30633
|
+
// The event is how the target takes part in what it was asked to do (a popup
|
|
30634
|
+
// closing on --navi-close also has its own things to do); the command itself
|
|
30635
|
+
// is the implementation, and it must not depend on someone listening. Nobody
|
|
30636
|
+
// does when the target has left the document — a trigger whose own action
|
|
30637
|
+
// took it away, which is the shape of "delete this, then leave the page it
|
|
30638
|
+
// was on" (see runWhenActionSucceeded in rules/control_action.js): the
|
|
30639
|
+
// command is decided while the trigger is there and runs once the action has
|
|
30640
|
+
// succeeded, by which time the row it stood in is gone. So the command runs
|
|
30641
|
+
// here rather than being lost in silence.
|
|
30642
|
+
const detail = {
|
|
30625
30643
|
command,
|
|
30626
30644
|
event,
|
|
30627
30645
|
source: element,
|
|
30628
30646
|
implementation,
|
|
30629
30647
|
value,
|
|
30630
|
-
|
|
30648
|
+
answered: false,
|
|
30649
|
+
};
|
|
30650
|
+
const dispatched = dispatchCustomEvent(target, "navi_command", detail);
|
|
30651
|
+
if (!detail.answered) {
|
|
30652
|
+
implementation();
|
|
30653
|
+
}
|
|
30654
|
+
return dispatched;
|
|
30631
30655
|
};
|
|
30632
30656
|
|
|
30633
30657
|
// Returns the target explicitly declared via HTML attributes (commandfor / navi-command-target),
|
|
@@ -30758,6 +30782,7 @@ const onNaviCommand = (e, { debugCommand = () => {} } = {}) => {
|
|
|
30758
30782
|
console.warn(`navi_command event is missing detail.implementation`, e);
|
|
30759
30783
|
return false;
|
|
30760
30784
|
}
|
|
30785
|
+
e.detail.answered = true;
|
|
30761
30786
|
const commandTarget = e.currentTarget;
|
|
30762
30787
|
debugCommand(
|
|
30763
30788
|
event,
|
|
@@ -35078,7 +35103,6 @@ const useControlProps = (props, {
|
|
|
35078
35103
|
const {
|
|
35079
35104
|
standalone
|
|
35080
35105
|
} = props;
|
|
35081
|
-
delete props.standalone;
|
|
35082
35106
|
const idDefault = useId();
|
|
35083
35107
|
const controlId = useContext(ControlIdContext);
|
|
35084
35108
|
props.id = props.id || controlId || idDefault;
|
|
@@ -36097,7 +36121,6 @@ const useControlgroupProps = (props, {
|
|
|
36097
36121
|
action,
|
|
36098
36122
|
standalone
|
|
36099
36123
|
} = props;
|
|
36100
|
-
delete props.standalone;
|
|
36101
36124
|
const uiGroupStateController = useUIGroupStateController(props, controlType, {
|
|
36102
36125
|
stateType,
|
|
36103
36126
|
childControlFilter,
|
|
@@ -38869,7 +38892,7 @@ const TextAnchor = ({
|
|
|
38869
38892
|
className: "navi_text_anchor",
|
|
38870
38893
|
"aria-hidden": "true",
|
|
38871
38894
|
hidden: true,
|
|
38872
|
-
children: "
|
|
38895
|
+
children: ""
|
|
38873
38896
|
})]
|
|
38874
38897
|
});
|
|
38875
38898
|
};
|
|
@@ -39278,7 +39301,7 @@ const REGULAR_SPACE = jsx("span", {
|
|
|
39278
39301
|
const FAKE_SPACE = jsx("span", {
|
|
39279
39302
|
"data-navi-space": "",
|
|
39280
39303
|
style: "padding-left: 0.25em",
|
|
39281
|
-
children: "
|
|
39304
|
+
children: ""
|
|
39282
39305
|
});
|
|
39283
39306
|
const CustomWidthSpace = ({
|
|
39284
39307
|
value,
|
|
@@ -39301,13 +39324,13 @@ const CustomWidthSpace = ({
|
|
|
39301
39324
|
children: " "
|
|
39302
39325
|
}), jsx("span", {
|
|
39303
39326
|
style: `padding-left: ${value}`,
|
|
39304
|
-
children: "
|
|
39327
|
+
children: ""
|
|
39305
39328
|
})]
|
|
39306
39329
|
});
|
|
39307
39330
|
}
|
|
39308
39331
|
return jsx("span", {
|
|
39309
39332
|
style: `padding-left: ${value}`,
|
|
39310
|
-
children: "
|
|
39333
|
+
children: ""
|
|
39311
39334
|
});
|
|
39312
39335
|
};
|
|
39313
39336
|
|
|
@@ -39906,7 +39929,7 @@ const Icon = ({
|
|
|
39906
39929
|
ref: textRef,
|
|
39907
39930
|
children: [jsx("span", {
|
|
39908
39931
|
style: "user-select:none",
|
|
39909
|
-
children: "
|
|
39932
|
+
children: ""
|
|
39910
39933
|
}), innerChildren]
|
|
39911
39934
|
})
|
|
39912
39935
|
});
|
|
@@ -54003,7 +54026,7 @@ const TimeRelative = ({
|
|
|
54003
54026
|
if (children === undefined) {
|
|
54004
54027
|
return jsx(TimeText, {
|
|
54005
54028
|
...props,
|
|
54006
|
-
children: "
|
|
54029
|
+
children: "–"
|
|
54007
54030
|
});
|
|
54008
54031
|
}
|
|
54009
54032
|
const date = toDate(children);
|
|
@@ -61798,6 +61821,7 @@ const css$x = /* css */`@layer navi {
|
|
|
61798
61821
|
--x-corner-top-right-radius: initial;
|
|
61799
61822
|
--x-corner-bottom-right-radius: initial;
|
|
61800
61823
|
--x-corner-bottom-left-radius: initial;
|
|
61824
|
+
box-sizing: border-box;
|
|
61801
61825
|
width: inherit;
|
|
61802
61826
|
min-width: inherit;
|
|
61803
61827
|
max-width: var(--list-max-width, inherit);
|
|
@@ -62120,6 +62144,14 @@ const css$x = /* css */`@layer navi {
|
|
|
62120
62144
|
animation: none;
|
|
62121
62145
|
}
|
|
62122
62146
|
`;
|
|
62147
|
+
|
|
62148
|
+
/* A padding on a list is space between its frame and its rows, so it belongs on
|
|
62149
|
+
the scroll box and not on the frame around it: on the frame it insets the
|
|
62150
|
+
scroll box as a whole, and the scrollbar — which is drawn at the edge of what
|
|
62151
|
+
scrolls — comes off the list's edge by that same amount, floating in the
|
|
62152
|
+
middle of the padding. On the scroll box the scrollbar stays against the
|
|
62153
|
+
border and the padding is what separates the rows from it. */
|
|
62154
|
+
const LIST_PADDING_PROP_SET = new Set(["padding", "paddingX", "paddingY", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"]);
|
|
62123
62155
|
const ListUI = props => {
|
|
62124
62156
|
import.meta.css = [css$x, "@jsenv/navi/src/control/list/list.jsx"];
|
|
62125
62157
|
const {
|
|
@@ -62161,6 +62193,13 @@ const ListUI = props => {
|
|
|
62161
62193
|
virtual,
|
|
62162
62194
|
...rest
|
|
62163
62195
|
} = props;
|
|
62196
|
+
const scrollBoxPaddingProps = {};
|
|
62197
|
+
for (const name of LIST_PADDING_PROP_SET) {
|
|
62198
|
+
if (name in rest) {
|
|
62199
|
+
scrollBoxPaddingProps[name] = rest[name];
|
|
62200
|
+
delete rest[name];
|
|
62201
|
+
}
|
|
62202
|
+
}
|
|
62164
62203
|
// Accept a string (e.g. from an HTML attribute: renderBudget="50") the
|
|
62165
62204
|
// same way a bare number would work — arithmetic below (renderBudget / 2,
|
|
62166
62205
|
// start + renderBudget, etc.) would silently misbehave on a raw string
|
|
@@ -62315,7 +62354,7 @@ const ListUI = props => {
|
|
|
62315
62354
|
children: [jsx("span", {
|
|
62316
62355
|
className: "navi_list_error_icon",
|
|
62317
62356
|
"aria-hidden": "true",
|
|
62318
|
-
children: "
|
|
62357
|
+
children: "⚠"
|
|
62319
62358
|
}), jsx("span", {
|
|
62320
62359
|
children: error === true ? "Something went wrong." : error
|
|
62321
62360
|
})]
|
|
@@ -62418,6 +62457,7 @@ const ListUI = props => {
|
|
|
62418
62457
|
overflow: overflow,
|
|
62419
62458
|
overflowX: overflowX,
|
|
62420
62459
|
overflowY: overflowY,
|
|
62460
|
+
scrollBoxPaddingProps: scrollBoxPaddingProps,
|
|
62421
62461
|
children: content
|
|
62422
62462
|
})
|
|
62423
62463
|
});
|
|
@@ -62655,6 +62695,7 @@ const ListContent = ({
|
|
|
62655
62695
|
overflow,
|
|
62656
62696
|
overflowX,
|
|
62657
62697
|
overflowY,
|
|
62698
|
+
scrollBoxPaddingProps,
|
|
62658
62699
|
children
|
|
62659
62700
|
}) => {
|
|
62660
62701
|
const listProps = useContext(BoxForwardedPropsContext);
|
|
@@ -62663,6 +62704,7 @@ const ListContent = ({
|
|
|
62663
62704
|
overflow: overflow,
|
|
62664
62705
|
overflowX: overflowX,
|
|
62665
62706
|
overflowY: overflowY,
|
|
62707
|
+
...scrollBoxPaddingProps,
|
|
62666
62708
|
children: jsx(UnorderedList, {
|
|
62667
62709
|
role: role,
|
|
62668
62710
|
fallback: fallback,
|
|
@@ -64680,7 +64722,7 @@ const ListItemReal = props => {
|
|
|
64680
64722
|
children: [jsx("span", {
|
|
64681
64723
|
className: "navi_list_error_icon",
|
|
64682
64724
|
"aria-hidden": "true",
|
|
64683
|
-
children: "
|
|
64725
|
+
children: "⚠"
|
|
64684
64726
|
}), jsx("span", {
|
|
64685
64727
|
className: "navi_list_item_error_message",
|
|
64686
64728
|
children: error === true ? "Something went wrong." : error
|
|
@@ -65563,7 +65605,7 @@ const ListItemsFailure = ({
|
|
|
65563
65605
|
children: [jsx("span", {
|
|
65564
65606
|
className: "navi_list_error_icon",
|
|
65565
65607
|
"aria-hidden": "true",
|
|
65566
|
-
children: "
|
|
65608
|
+
children: "⚠"
|
|
65567
65609
|
}), jsx("span", {
|
|
65568
65610
|
className: "navi_list_item_error_message",
|
|
65569
65611
|
children: error && error.message ? error.message : naviI18n("list.rows_failed")
|
|
@@ -77724,7 +77766,7 @@ const ButtonCopyToClipboard = ({
|
|
|
77724
77766
|
className: "navi_copied_notif",
|
|
77725
77767
|
"aria-hidden": copied ? "false" : "true",
|
|
77726
77768
|
opacity: copied ? 1 : 0,
|
|
77727
|
-
children: "
|
|
77769
|
+
children: "Copié !"
|
|
77728
77770
|
}), jsx(Button, {
|
|
77729
77771
|
className: "navi_copy_button",
|
|
77730
77772
|
flex: "y",
|