@jsenv/navi 0.29.347 → 0.29.349

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.
@@ -60067,6 +60067,15 @@ const css$E = /* css */`
60067
60067
  * whatever triggered the open (`e.detail.source`). A string is resolved via
60068
60068
  * `document.getElementById` when the dialog opens — see popover.jsx's own
60069
60069
  * `anchor` doc for why (mainly `defaultOpen`).
60070
+ * @param {Element|{current: Element}|string} [props.liftAnchor] - Under
60071
+ * `animation="lifting"`, where the closing brings the box back to, when that
60072
+ * is no longer where it came from: a popup one walks through (a row of cards
60073
+ * shown one at a time) has something else in front by the time it closes,
60074
+ * and the box would otherwise fly back to the card the press opened on. Same
60075
+ * grammar as `anchor` (element, ref or id), resolved at the close, so
60076
+ * whatever names the card currently in front — an id built from the signal
60077
+ * the walk is bound to, a ref moved with it — is read then and not at the
60078
+ * opening. Left out, the box comes back to the anchor it came out of.
60070
60079
  * @param {boolean} [props.sizeFromAnchor=false] - Whether the dialog takes the
60071
60080
  * anchor's width/height as a min-width/min-height floor
60072
60081
  * (`--anchor-width`/`--anchor-height`). Off by default: unlike a popover,
@@ -60400,6 +60409,10 @@ const useDialogProps = props => {
60400
60409
  // Inert unless sizeFromAnchor below (see this file's top comment) —
60401
60410
  // Dialog's own positioning is never relative to it.
60402
60411
  anchor,
60412
+ // Where a lift comes back to, when that is no longer the box it came out
60413
+ // of. Read at the close, not kept from the opening — see
60414
+ // resolveLiftAnchorElement.
60415
+ liftAnchor,
60403
60416
  // Opt-in: --anchor-width/--anchor-height are only set when this is true.
60404
60417
  // See this prop's own JSDoc above for why a dialog does not follow its
60405
60418
  // trigger's box by default.
@@ -60599,6 +60612,25 @@ const useDialogProps = props => {
60599
60612
  return undefined;
60600
60613
  };
60601
60614
 
60615
+ // A popup one walks through puts something else in front than what was
60616
+ // pressed — a row of cards shown one at a time, the walk carrying on from
60617
+ // the card the press opened on — and the box then has to come back to what
60618
+ // is in front NOW, which only the caller knows. Resolved at the close for
60619
+ // that reason: the element it names changes while the popup is open, so
60620
+ // anything read at the opening would be the walk's starting point again.
60621
+ const resolveLiftAnchorElement = () => {
60622
+ if (typeof liftAnchor === "string") {
60623
+ const liftAnchorElementById = document.getElementById(liftAnchor);
60624
+ if (!liftAnchorElementById) {
60625
+ console.warn(`Dialog: liftAnchor="${liftAnchor}" did not match any element`);
60626
+ }
60627
+ return liftAnchorElementById;
60628
+ }
60629
+ // A ref is unwrapped even when it holds nothing, the same way `anchor` is:
60630
+ // the ref object itself has no box to come back to.
60631
+ return "current" in liftAnchor ? liftAnchor.current : liftAnchor;
60632
+ };
60633
+
60602
60634
  // The dialog and the anchor are the same box at two sizes, so the opening
60603
60635
  // and the closing are one becoming the other. The browser draws that itself
60604
60636
  // provided the change happens between its two pictures, which is what
@@ -60616,7 +60648,14 @@ const useDialogProps = props => {
60616
60648
  applyChange();
60617
60649
  return;
60618
60650
  }
60619
- const anchorElement = opened ? resolveAnchorElement(event) : anchorElementRef.current;
60651
+ let anchorElement;
60652
+ if (opened) {
60653
+ anchorElement = resolveAnchorElement(event);
60654
+ } else if (liftAnchor) {
60655
+ anchorElement = resolveLiftAnchorElement();
60656
+ } else {
60657
+ anchorElement = anchorElementRef.current;
60658
+ }
60620
60659
  if (!anchorElement) {
60621
60660
  applyChange();
60622
60661
  return;
@@ -66566,7 +66605,7 @@ const css$x = /* css */`@layer navi {
66566
66605
  }
66567
66606
 
66568
66607
  .navi_list_failed_rows {
66569
- height: var(--size-to-fill, 0px);
66608
+ min-height: var(--size-to-fill, 0px);
66570
66609
  flex-shrink: 0;
66571
66610
  list-style: none;
66572
66611
  display: block;