@jsenv/navi 0.29.348 → 0.29.350
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 +102 -32
- package/dist/dev/jsenv_navi.js.map +6 -6
- package/dist/dev/jsenv_navi_side_effects.js.map +2 -2
- package/dist/jsenv_navi.js +90 -25
- package/dist/jsenv_navi.js.map +6 -6
- package/dist/jsenv_navi_side_effects.js.map +2 -2
- package/docs/AI_INSTRUCTIONS.md +3 -1
- package/docs/popup_backdrop.md +11 -4
- package/docs/popup_lift.md +122 -2
- package/docs/popup_open.md +7 -3
- package/package.json +1 -1
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -60720,8 +60720,15 @@ const css$E = /* css */`
|
|
|
60720
60720
|
--backdrop-filter: var(--navi-backdrop-capture-backdrop-filter);
|
|
60721
60721
|
}
|
|
60722
60722
|
/* backdropVariant, after the rules it overrides: same specificity, so
|
|
60723
|
-
order is what decides. The wall is still there
|
|
60724
|
-
paint
|
|
60723
|
+
order is what decides. The wall is still there whichever one is asked
|
|
60724
|
+
for — only its paint changes. */
|
|
60725
|
+
/* "lift": the wall a lifted popup brings, asked for on its own. A popup
|
|
60726
|
+
whose content is what must be looked at wants the page gone behind it
|
|
60727
|
+
whether or not it got there by moving. */
|
|
60728
|
+
&[data-backdrop-variant="lift"] {
|
|
60729
|
+
--backdrop-background: var(--navi-backdrop-lift-background);
|
|
60730
|
+
--backdrop-filter: var(--navi-backdrop-lift-backdrop-filter);
|
|
60731
|
+
}
|
|
60725
60732
|
&[data-backdrop-variant="discrete"] {
|
|
60726
60733
|
--backdrop-background: var(--navi-backdrop-discrete-background);
|
|
60727
60734
|
--backdrop-filter: var(--navi-backdrop-discrete-backdrop-filter);
|
|
@@ -60919,6 +60926,10 @@ const css$E = /* css */`
|
|
|
60919
60926
|
--backdrop-background: var(--navi-backdrop-capture-background);
|
|
60920
60927
|
--backdrop-filter: var(--navi-backdrop-capture-backdrop-filter);
|
|
60921
60928
|
}
|
|
60929
|
+
&[data-backdrop-variant="lift"] {
|
|
60930
|
+
--backdrop-background: var(--navi-backdrop-lift-background);
|
|
60931
|
+
--backdrop-filter: var(--navi-backdrop-lift-backdrop-filter);
|
|
60932
|
+
}
|
|
60922
60933
|
&[data-backdrop-variant="discrete"] {
|
|
60923
60934
|
--backdrop-background: var(--navi-backdrop-discrete-background);
|
|
60924
60935
|
--backdrop-filter: var(--navi-backdrop-discrete-backdrop-filter);
|
|
@@ -61181,15 +61192,18 @@ const css$E = /* css */`
|
|
|
61181
61192
|
* "Outside" is the dialog's own border box; a see-through dialog whose box is
|
|
61182
61193
|
* bigger than what it paints marks the difference with
|
|
61183
61194
|
* `data-navi-popup-outside` (see docs/popup_backdrop.md).
|
|
61184
|
-
* @param {"auto"|"discrete"|"invisible"} [props.backdropVariant="auto"]
|
|
61185
|
-
* visible the backdrop is, independently of what it does. `"auto"`:
|
|
61186
|
-
* paint `pointerInteractionOutsideEffect` implies (dimmed for
|
|
61195
|
+
* @param {"auto"|"lift"|"discrete"|"invisible"} [props.backdropVariant="auto"]
|
|
61196
|
+
* - How visible the backdrop is, independently of what it does. `"auto"`:
|
|
61197
|
+
* the paint `pointerInteractionOutsideEffect` implies (dimmed for
|
|
61187
61198
|
* `"close"`/`"cancel"`, blurred glass for `"capture"`), or the opaque wall
|
|
61188
|
-
* `animation="lifting"` asks for. `"
|
|
61189
|
-
*
|
|
61190
|
-
*
|
|
61191
|
-
*
|
|
61192
|
-
*
|
|
61199
|
+
* `animation="lifting"` asks for. `"lift"`: that same opaque, blurred wall
|
|
61200
|
+
* (`--navi-backdrop-lift-*`) asked for on its own, for a dialog whose
|
|
61201
|
+
* content is the thing to look at — a picture, a plan, a card opened full
|
|
61202
|
+
* — without the morph. `"discrete"`: a barely-there dim. `"invisible"`:
|
|
61203
|
+
* fully transparent — a wall that is not seen, still catching every press.
|
|
61204
|
+
* This only changes how much the dialog insists visually, never what an
|
|
61205
|
+
* outside click does; whether there is a wall to paint at all is `backdrop`
|
|
61206
|
+
* above.
|
|
61193
61207
|
* @param {string} [props.backdropColor] - The wash painted over what is
|
|
61194
61208
|
* behind, for this popup alone: any CSS color (`"rgb(6 10 20 / 88%)"`).
|
|
61195
61209
|
* Wins over `backdropVariant` and over the theme tokens
|
|
@@ -61249,6 +61263,15 @@ const css$E = /* css */`
|
|
|
61249
61263
|
* whatever triggered the open (`e.detail.source`). A string is resolved via
|
|
61250
61264
|
* `document.getElementById` when the dialog opens — see popover.jsx's own
|
|
61251
61265
|
* `anchor` doc for why (mainly `defaultOpen`).
|
|
61266
|
+
* @param {Element|{current: Element}|string} [props.liftAnchor] - Under
|
|
61267
|
+
* `animation="lifting"`, where the closing brings the box back to, when that
|
|
61268
|
+
* is no longer where it came from: a popup one walks through (a row of cards
|
|
61269
|
+
* shown one at a time) has something else in front by the time it closes,
|
|
61270
|
+
* and the box would otherwise fly back to the card the press opened on. Same
|
|
61271
|
+
* grammar as `anchor` (element, ref or id), resolved at the close, so
|
|
61272
|
+
* whatever names the card currently in front — an id built from the signal
|
|
61273
|
+
* the walk is bound to, a ref moved with it — is read then and not at the
|
|
61274
|
+
* opening. Left out, the box comes back to the anchor it came out of.
|
|
61252
61275
|
* @param {boolean} [props.sizeFromAnchor=false] - Whether the dialog takes the
|
|
61253
61276
|
* anchor's width/height as a min-width/min-height floor
|
|
61254
61277
|
* (`--anchor-width`/`--anchor-height`). Off by default: unlike a popover,
|
|
@@ -61564,9 +61587,10 @@ const useDialogProps = props => {
|
|
|
61564
61587
|
// the dialog goes to the same top layer through the Popover API instead.
|
|
61565
61588
|
backdrop = true,
|
|
61566
61589
|
// How loudly the backdrop says it is there — independent of what it
|
|
61567
|
-
// *does* (that's pointerInteractionOutsideEffect above). "
|
|
61568
|
-
// wall
|
|
61569
|
-
// from being
|
|
61590
|
+
// *does* (that's pointerInteractionOutsideEffect above). "lift" is the
|
|
61591
|
+
// opaque wall at one end, "invisible" a wall that is not seen at the
|
|
61592
|
+
// other — not the absence of one, it only stops the dim from being
|
|
61593
|
+
// drawn.
|
|
61570
61594
|
backdropVariant = "auto",
|
|
61571
61595
|
// The paint itself, when the tokens behind backdropVariant are not what
|
|
61572
61596
|
// this one dialog wants. Named/forwarded rather than left in ...rest:
|
|
@@ -61584,6 +61608,10 @@ const useDialogProps = props => {
|
|
|
61584
61608
|
// Inert unless sizeFromAnchor below (see this file's top comment) —
|
|
61585
61609
|
// Dialog's own positioning is never relative to it.
|
|
61586
61610
|
anchor,
|
|
61611
|
+
// Where a lift comes back to, when that is no longer the box it came out
|
|
61612
|
+
// of. Read at the close, not kept from the opening — see
|
|
61613
|
+
// resolveLiftAnchorElement.
|
|
61614
|
+
liftAnchor,
|
|
61587
61615
|
// Opt-in: --anchor-width/--anchor-height are only set when this is true.
|
|
61588
61616
|
// See this prop's own JSDoc above for why a dialog does not follow its
|
|
61589
61617
|
// trigger's box by default.
|
|
@@ -61786,6 +61814,25 @@ const useDialogProps = props => {
|
|
|
61786
61814
|
return undefined;
|
|
61787
61815
|
};
|
|
61788
61816
|
|
|
61817
|
+
// A popup one walks through puts something else in front than what was
|
|
61818
|
+
// pressed — a row of cards shown one at a time, the walk carrying on from
|
|
61819
|
+
// the card the press opened on — and the box then has to come back to what
|
|
61820
|
+
// is in front NOW, which only the caller knows. Resolved at the close for
|
|
61821
|
+
// that reason: the element it names changes while the popup is open, so
|
|
61822
|
+
// anything read at the opening would be the walk's starting point again.
|
|
61823
|
+
const resolveLiftAnchorElement = () => {
|
|
61824
|
+
if (typeof liftAnchor === "string") {
|
|
61825
|
+
const liftAnchorElementById = document.getElementById(liftAnchor);
|
|
61826
|
+
if (!liftAnchorElementById) {
|
|
61827
|
+
console.warn(`Dialog: liftAnchor="${liftAnchor}" did not match any element`);
|
|
61828
|
+
}
|
|
61829
|
+
return liftAnchorElementById;
|
|
61830
|
+
}
|
|
61831
|
+
// A ref is unwrapped even when it holds nothing, the same way `anchor` is:
|
|
61832
|
+
// the ref object itself has no box to come back to.
|
|
61833
|
+
return "current" in liftAnchor ? liftAnchor.current : liftAnchor;
|
|
61834
|
+
};
|
|
61835
|
+
|
|
61789
61836
|
// The dialog and the anchor are the same box at two sizes, so the opening
|
|
61790
61837
|
// and the closing are one becoming the other. The browser draws that itself
|
|
61791
61838
|
// provided the change happens between its two pictures, which is what
|
|
@@ -61803,11 +61850,21 @@ const useDialogProps = props => {
|
|
|
61803
61850
|
applyChange();
|
|
61804
61851
|
return;
|
|
61805
61852
|
}
|
|
61806
|
-
|
|
61853
|
+
let anchorElement;
|
|
61854
|
+
if (opened) {
|
|
61855
|
+
anchorElement = resolveAnchorElement(event);
|
|
61856
|
+
} else if (liftAnchor) {
|
|
61857
|
+
anchorElement = resolveLiftAnchorElement();
|
|
61858
|
+
} else {
|
|
61859
|
+
anchorElement = anchorElementRef.current;
|
|
61860
|
+
}
|
|
61807
61861
|
if (!anchorElement) {
|
|
61808
61862
|
if (opened) {
|
|
61809
61863
|
console.warn(`[navi] Dialog has animation="lifting" and no anchor to lift out of, so it simply appears. The anchor is whatever opened it — a <Button command="--navi-open">, the "source" given to triggerNaviCommand — or the "anchor" prop.`);
|
|
61810
61864
|
}
|
|
61865
|
+
if (!opened && liftAnchor) {
|
|
61866
|
+
console.warn(`[navi] Dialog has animation="lifting" and a "liftAnchor" naming nothing on screen, so it simply closes. The element it names is where the box comes back to, and it has to be in the document at the close.`);
|
|
61867
|
+
}
|
|
61811
61868
|
applyChange();
|
|
61812
61869
|
return;
|
|
61813
61870
|
}
|
|
@@ -62822,6 +62879,13 @@ const css$D = /* css */`
|
|
|
62822
62879
|
them to win. Only the paint changes: the element is still rendered
|
|
62823
62880
|
and still pointer-events: auto, so an outside click keeps doing
|
|
62824
62881
|
exactly what pointerInteractionOutsideEffect says. */
|
|
62882
|
+
/* "lift": the wall a lifted popup brings (see navi_css_vars.js), asked
|
|
62883
|
+
for on its own — a popover whose own content is what must be looked at
|
|
62884
|
+
wants the page gone behind it, without moving out of anything. */
|
|
62885
|
+
&[data-backdrop-variant="lift"] {
|
|
62886
|
+
--backdrop-background: var(--navi-backdrop-lift-background);
|
|
62887
|
+
--backdrop-filter: var(--navi-backdrop-lift-backdrop-filter);
|
|
62888
|
+
}
|
|
62825
62889
|
&[data-backdrop-variant="discrete"] {
|
|
62826
62890
|
--backdrop-background: var(--navi-backdrop-discrete-background);
|
|
62827
62891
|
--backdrop-filter: var(--navi-backdrop-discrete-backdrop-filter);
|
|
@@ -62913,12 +62977,15 @@ const css$D = /* css */`
|
|
|
62913
62977
|
* own border box; a see-through popover whose box is bigger than what it
|
|
62914
62978
|
* paints marks the difference with `data-navi-popup-outside` (see
|
|
62915
62979
|
* docs/popup_backdrop.md).
|
|
62916
|
-
* @param {"auto"|"discrete"|"invisible"} [props.backdropVariant="auto"]
|
|
62917
|
-
* visible the backdrop is, independently of what it does. `"auto"`:
|
|
62918
|
-
* paint `pointerInteractionOutsideEffect` implies (dimmed for
|
|
62919
|
-
* `"close"`/`"cancel"`, blurred glass for `"capture"`). `"
|
|
62920
|
-
*
|
|
62921
|
-
*
|
|
62980
|
+
* @param {"auto"|"lift"|"discrete"|"invisible"} [props.backdropVariant="auto"]
|
|
62981
|
+
* - How visible the backdrop is, independently of what it does. `"auto"`:
|
|
62982
|
+
* the paint `pointerInteractionOutsideEffect` implies (dimmed for
|
|
62983
|
+
* `"close"`/`"cancel"`, blurred glass for `"capture"`). `"lift"`: the
|
|
62984
|
+
* opaque, blurred wall (`--navi-backdrop-lift-*`) a lifted popup brings,
|
|
62985
|
+
* for content that is the thing to look at rather than a surface shown over
|
|
62986
|
+
* a page still being read. `"discrete"`: a barely-there dim. `"invisible"`:
|
|
62987
|
+
* fully transparent — a wall that is not seen, still rendered and still
|
|
62988
|
+
* catching every outside click. This only
|
|
62922
62989
|
* changes how much the popover insists on being the thing you deal with;
|
|
62923
62990
|
* whether there is a wall to paint at all is `backdrop` above. Ignored when
|
|
62924
62991
|
* there is none (`pointerInteractionOutsideEffect="none"`, or
|
|
@@ -63255,9 +63322,10 @@ const usePopoverProps = props => {
|
|
|
63255
63322
|
backdrop = true,
|
|
63256
63323
|
// How loudly the backdrop says it is there — independent of what it
|
|
63257
63324
|
// *does* (that's pointerInteractionOutsideEffect above). "auto" keeps
|
|
63258
|
-
// the paint the effect implies; "
|
|
63259
|
-
//
|
|
63260
|
-
//
|
|
63325
|
+
// the paint the effect implies; "lift" asks for the opaque wall, and
|
|
63326
|
+
// "discrete"/"invisible" tone it down or stop drawing it — none of them
|
|
63327
|
+
// gives up the outside click, a wall that is not seen is still a wall
|
|
63328
|
+
// (that is `backdrop` above).
|
|
63261
63329
|
backdropVariant = "auto",
|
|
63262
63330
|
// The paint itself, when the tokens behind backdropVariant are not what
|
|
63263
63331
|
// this one popover wants. Named/forwarded rather than left in ...rest:
|
|
@@ -64264,7 +64332,7 @@ const css$C = /* css */`@layer navi {
|
|
|
64264
64332
|
* resolution picks says nothing about whether the page behind stays live.
|
|
64265
64333
|
* It is also what makes a sheet docked to an edge of a phone's screen
|
|
64266
64334
|
* (`dockedOnSmallTouchScreen`) non-modal.
|
|
64267
|
-
* @param {"auto"|"discrete"|"invisible"} [props.backdropVariant] - Forwarded
|
|
64335
|
+
* @param {"auto"|"lift"|"discrete"|"invisible"} [props.backdropVariant] - Forwarded
|
|
64268
64336
|
* as-is to whichever component renders (both understand it identically):
|
|
64269
64337
|
* how visible the backdrop is, independently of what an outside click
|
|
64270
64338
|
* does — a wall that is not seen is still a wall (that is `backdrop`
|
|
@@ -74757,7 +74825,7 @@ const PickerFirstResolver = props => {
|
|
|
74757
74825
|
* escapeEffect?: "cancel" | "close",
|
|
74758
74826
|
* pointerInteractionOutsideEffect?: "close" | "cancel" | "capture",
|
|
74759
74827
|
* backdrop?: boolean,
|
|
74760
|
-
* backdropVariant?: "auto" | "discrete" | "invisible",
|
|
74828
|
+
* backdropVariant?: "auto" | "lift" | "discrete" | "invisible",
|
|
74761
74829
|
* backdropColor?: string,
|
|
74762
74830
|
* backdropFilter?: string,
|
|
74763
74831
|
* ref?: import("ignore:preact").RefObject<HTMLElement>,
|
|
@@ -75114,12 +75182,14 @@ const PickerFirstResolver = props => {
|
|
|
75114
75182
|
* dialog with no wall is shown through the Popover API rather than
|
|
75115
75183
|
* `showModal()`, so a picker docked as a bottom sheet on a phone still
|
|
75116
75184
|
* leaves the plan behind it live.
|
|
75117
|
-
* @param {"auto"|"discrete"|"invisible"} [backdropVariant="auto"] How
|
|
75118
|
-
* popup's backdrop is, independently of what a click outside
|
|
75119
|
-
* is the paint `pointerInteractionOutsideEffect` implies,
|
|
75120
|
-
*
|
|
75121
|
-
*
|
|
75122
|
-
*
|
|
75185
|
+
* @param {"auto"|"lift"|"discrete"|"invisible"} [backdropVariant="auto"] How
|
|
75186
|
+
* visible the popup's backdrop is, independently of what a click outside
|
|
75187
|
+
* does: `"auto"` is the paint `pointerInteractionOutsideEffect` implies,
|
|
75188
|
+
* `"lift"` the opaque blurred wall `animation="lifting"` brings, asked for
|
|
75189
|
+
* without the movement, `"discrete"` a barely-there dim, `"invisible"` fully
|
|
75190
|
+
* transparent — a wall that is not seen is still a wall, which is what
|
|
75191
|
+
* `backdrop` above answers. For a picker that closes on an outside click
|
|
75192
|
+
* without wanting to dim the page for it.
|
|
75123
75193
|
* @param {string} [backdropColor] The wash the popup paints over what is
|
|
75124
75194
|
* behind, for this picker alone. See Dialog's own doc.
|
|
75125
75195
|
* @param {string} [backdropFilter] What that wash does to the picture
|
|
@@ -77725,7 +77795,7 @@ const css$n = /* css */`.navi_split_button {
|
|
|
77725
77795
|
* dockedOnSmallTouchScreen?: boolean | "top" | "bottom",
|
|
77726
77796
|
* marginWithContainer?: number | string,
|
|
77727
77797
|
* backdrop?: boolean,
|
|
77728
|
-
* backdropVariant?: "auto" | "discrete" | "invisible",
|
|
77798
|
+
* backdropVariant?: "auto" | "lift" | "discrete" | "invisible",
|
|
77729
77799
|
* backdropColor?: string,
|
|
77730
77800
|
* backdropFilter?: string,
|
|
77731
77801
|
* pointerInteractionOutsideEffect?: "close" | "cancel" | "capture",
|