@jsenv/navi 0.29.452 → 0.29.453

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.
@@ -39081,27 +39081,34 @@ const TARGET_WAIT_MS = 1000;
39081
39081
  // covers is a render, not a fetch. Past it the popup's picture plays out on
39082
39082
  // its own.
39083
39083
  const LANDING_WAIT_MS = 300;
39084
- // The popup's own animation duration, published on the root because the
39085
- // ::view-transition tree hangs off it and inherits from nowhere else.
39084
+ // What the pictures are told — the popup's pace, the lifted card's paint, the
39085
+ // corners — is written on ::view-transition (transition_values.js), the root of
39086
+ // the pseudo-element tree they inherit from. Never on the document's root: a
39087
+ // custom property there is inherited by every element, and writing or removing
39088
+ // it restyles the whole document — at the press, again when the app reads
39089
+ // style before the first picture, and once more as the movement ends.
39090
+ //
39091
+ // The popup's own animation duration, for the pictures; the wall reads it off
39092
+ // the popup itself (dialog.jsx).
39086
39093
  const DURATION_PROPERTY = "--navi-popup-lift-duration";
39087
39094
  // The fixed bars (fixed_bar.jsx): the popup is placed in the room between
39088
39095
  // them, and the moving picture is clipped to that room on the way.
39089
39096
  const FIXED_BAR_SELECTOR = ".navi_fixed_bar";
39090
- // The paint of the lifted node, published the same way: the box wears the
39091
- // card's own background, so where it has grown past the picture it carries it
39092
- // is the card that has grown, not a picture fading into a bigger one. Read off
39093
- // the lifted node rather than the anchor: the anchor is often a bare trigger
39094
- // around the card, painting nothing of its own, while the lifted node IS the
39095
- // card — and a card does not change colour on the way.
39097
+ // The paint of the lifted node: the box wears the card's own background, so
39098
+ // where it has grown past the picture it carries it is the card that has
39099
+ // grown, not a picture fading into a bigger one. Read off the lifted node
39100
+ // rather than the anchor: the anchor is often a bare trigger around the card,
39101
+ // painting nothing of its own, while the lifted node IS the card — and a card
39102
+ // does not change colour on the way.
39096
39103
  const BACKGROUND_COLOR_PROPERTY = "--navi-popup-lift-background-color";
39097
39104
  const BACKGROUND_IMAGE_PROPERTY = "--navi-popup-lift-background-image";
39098
- // The corners of the box the movement starts from, published the same way —
39099
- // and, unlike the paint, not kept for the length of the movement: a corner is
39100
- // written per box, on purpose, the same card at two sizes not wanting the same
39101
- // round (a 6px corner stops showing on a big card). The moving box leaves with
39102
- // the corners of the box it leaves and arrives with those of the box it
39103
- // arrives on, the two authored values interpolated on the group's own clock
39104
- // (see animateMovingBox).
39105
+ // The corners of the box the movement starts from — and, unlike the paint, not
39106
+ // kept for the length of the movement: a corner is written per box, on
39107
+ // purpose, the same card at two sizes not wanting the same round (a 6px corner
39108
+ // stops showing on a big card). The moving box leaves with the corners of the
39109
+ // box it leaves and arrives with those of the box it arrives on, the two
39110
+ // authored values interpolated on the group's own clock (see
39111
+ // animateMovingBox).
39105
39112
  const BORDER_RADIUS_PROPERTY = "--navi-popup-lift-border-radius";
39106
39113
 
39107
39114
  let releaseLiftInProgress = null;
@@ -39162,11 +39169,9 @@ const liftPopupFromAnchor = (
39162
39169
  releaseLiftInProgress?.();
39163
39170
 
39164
39171
  const elementLeaving = opened ? resolveAnchor() : resolveLiftTarget(popupEl);
39165
- // Everything read about the leaving side, before the first write. A read
39166
- // brings the style up to date, and the writes below land on the root — an
39167
- // attribute or an unregistered custom property there invalidates the
39168
- // computed style of every element — so a read placed after any of them is
39169
- // the whole document's style over again. Nothing on the leaving side moves
39172
+ // Everything read about the leaving side, before the first write: a read
39173
+ // brings the style up to date, and one placed after the writes below would
39174
+ // pay for them on the spot, in the press. Nothing on the leaving side moves
39170
39175
  // before the movement, the page being held from here on.
39171
39176
  releaseScrollHold = trapScrollInside(popupEl, { backdrop: true });
39172
39177
  const duration = getComputedStyle(popupEl)
@@ -39184,9 +39189,9 @@ const liftPopupFromAnchor = (
39184
39189
  // Empty would substitute into `animation-duration:` as nothing at all,
39185
39190
  // which computes to 0s — a movement nobody sees rather than one at the
39186
39191
  // browser's own pace.
39187
- root.style.setProperty(DURATION_PROPERTY, duration);
39192
+ setTransitionValue(DURATION_PROPERTY, duration);
39188
39193
  }
39189
- root.style.setProperty(BORDER_RADIUS_PROPERTY, cornersLeaving);
39194
+ setTransitionValue(BORDER_RADIUS_PROPERTY, cornersLeaving);
39190
39195
  if (paintLeaving) {
39191
39196
  publishBoxPaint(paintLeaving);
39192
39197
  }
@@ -39213,10 +39218,10 @@ const liftPopupFromAnchor = (
39213
39218
  root.removeAttribute(ROOT_ATTRIBUTE);
39214
39219
  root.removeAttribute(KIND_ATTRIBUTE);
39215
39220
  root.removeAttribute(FIT_ATTRIBUTE);
39216
- root.style.removeProperty(DURATION_PROPERTY);
39217
- root.style.removeProperty(BORDER_RADIUS_PROPERTY);
39218
- root.style.removeProperty(BACKGROUND_COLOR_PROPERTY);
39219
- root.style.removeProperty(BACKGROUND_IMAGE_PROPERTY);
39221
+ removeTransitionValue(DURATION_PROPERTY);
39222
+ removeTransitionValue(BORDER_RADIUS_PROPERTY);
39223
+ removeTransitionValue(BACKGROUND_COLOR_PROPERTY);
39224
+ removeTransitionValue(BACKGROUND_IMAGE_PROPERTY);
39220
39225
  callLiftOverCallbacks();
39221
39226
  };
39222
39227
  releaseLiftInProgress = release;
@@ -39290,8 +39295,6 @@ const liftPopupFromAnchor = (
39290
39295
  popupEl.removeAttribute(ARRIVING_ATTRIBUTE);
39291
39296
  };
39292
39297
  const liftTarget = (target) => {
39293
- // The last write before the transition: nothing reads between it and the
39294
- // style pass the browser makes on its own to take the first picture.
39295
39298
  publishBoxPaint(readBoxPaint(target));
39296
39299
  startMovement(reveal, () => target);
39297
39300
  };
@@ -39320,9 +39323,8 @@ const readBoxPaint = (liftedElement) => {
39320
39323
  };
39321
39324
 
39322
39325
  const publishBoxPaint = ({ backgroundColor, backgroundImage }) => {
39323
- const root = document.documentElement;
39324
- root.style.setProperty(BACKGROUND_COLOR_PROPERTY, backgroundColor);
39325
- root.style.setProperty(BACKGROUND_IMAGE_PROPERTY, backgroundImage);
39326
+ setTransitionValue(BACKGROUND_COLOR_PROPERTY, backgroundColor);
39327
+ setTransitionValue(BACKGROUND_IMAGE_PROPERTY, backgroundImage);
39326
39328
  };
39327
39329
 
39328
39330
  // The corners of a box: the first round found going down through children
@@ -65109,6 +65111,70 @@ const giveUpOnControlsHoldingPopup = (controlsHolding, reason) => {
65109
65111
  */
65110
65112
 
65111
65113
  const popupCss = /* css */ `
65114
+ /* Not inherited: what the placement writes on a popup (applyNewPosition in
65115
+ @jsenv/dom) and what the popup derives from it are read by the popup
65116
+ alone, for its own size and cut. Inherited, every element of its content
65117
+ carries a copy, and each placement restyles all of them before the first
65118
+ frame. A popup nested in another also stops reading the outer one's values
65119
+ where its own are unset. "*" keeps them untyped: var() substitutes them as
65120
+ it does an unregistered property. */
65121
+ @property --container-position-room-top {
65122
+ syntax: "*";
65123
+ inherits: false;
65124
+ }
65125
+ @property --container-position-room-right {
65126
+ syntax: "*";
65127
+ inherits: false;
65128
+ }
65129
+ @property --container-position-room-bottom {
65130
+ syntax: "*";
65131
+ inherits: false;
65132
+ }
65133
+ @property --container-position-room-left {
65134
+ syntax: "*";
65135
+ inherits: false;
65136
+ }
65137
+ @property --container-position-remaining-height {
65138
+ syntax: "*";
65139
+ inherits: false;
65140
+ }
65141
+ @property --container-position-remaining-width {
65142
+ syntax: "*";
65143
+ inherits: false;
65144
+ }
65145
+ @property --x-popup-cut-top-at-area {
65146
+ syntax: "*";
65147
+ inherits: false;
65148
+ }
65149
+ @property --x-popup-cut-right-at-area {
65150
+ syntax: "*";
65151
+ inherits: false;
65152
+ }
65153
+ @property --x-popup-cut-bottom-at-area {
65154
+ syntax: "*";
65155
+ inherits: false;
65156
+ }
65157
+ @property --x-popup-cut-left-at-area {
65158
+ syntax: "*";
65159
+ inherits: false;
65160
+ }
65161
+ @property --x-popup-cut-top {
65162
+ syntax: "*";
65163
+ inherits: false;
65164
+ }
65165
+ @property --x-popup-cut-right {
65166
+ syntax: "*";
65167
+ inherits: false;
65168
+ }
65169
+ @property --x-popup-cut-bottom {
65170
+ syntax: "*";
65171
+ inherits: false;
65172
+ }
65173
+ @property --x-popup-cut-left {
65174
+ syntax: "*";
65175
+ inherits: false;
65176
+ }
65177
+
65112
65178
  @layer navi {
65113
65179
  .navi_popover,
65114
65180
  .navi_dialog {
@@ -65123,29 +65189,6 @@ const popupCss = /* css */ `
65123
65189
 
65124
65190
  .navi_popover,
65125
65191
  .navi_dialog {
65126
- /* The translate property is deliberately absent from this list — it
65127
- carries where the popup stands, and applyNewPosition (visible_rect.js)
65128
- owns it and drives its own transition through the Web Animations API
65129
- instead of CSS, so it stays independent of whatever this list contains
65130
- (no shared transition-property to clobber, no propertyName to filter).
65131
- What moves here is transform, which composes under it. */
65132
- &[navi-animation] {
65133
- /* clip-path takes the translate's own duration, for the one cut that
65134
- still moves (a band of glass beside the app — see this file's top
65135
- comment for why every other cut is a constant). A constant cut, or a
65136
- kind that sets none, has the same value on both sides of the change,
65137
- which costs nothing. */
65138
- transition-property:
65139
- display, overlay, opacity, transform, scale, box-shadow, clip-path;
65140
- transition-duration:
65141
- var(--popup-animation-duration), var(--popup-animation-duration),
65142
- var(--popup-opacity-duration), var(--popup-translate-duration),
65143
- var(--popup-scale-duration), var(--popup-animation-duration),
65144
- var(--popup-translate-duration);
65145
- transition-timing-function: ease;
65146
- transition-behavior: allow-discrete;
65147
- }
65148
-
65149
65192
  /* Where a travel may be cut, per side, in the popup's own coordinates.
65150
65193
  --container-position-room-* is how far past each of its own edges the
65151
65194
  popup may still paint before reaching the edge of the area it was placed
@@ -65177,6 +65220,28 @@ const popupCss = /* css */ `
65177
65220
  -1 * var(--container-position-room-left, 100vmax) - 100vmax +
65178
65221
  min(100vmax, var(--navi-app-inset-left, 0px) * 1000000)
65179
65222
  );
65223
+ /* The translate property is deliberately absent from this list — it
65224
+ carries where the popup stands, and applyNewPosition (visible_rect.js)
65225
+ owns it and drives its own transition through the Web Animations API
65226
+ instead of CSS, so it stays independent of whatever this list contains
65227
+ (no shared transition-property to clobber, no propertyName to filter).
65228
+ What moves here is transform, which composes under it. */
65229
+ &[navi-animation] {
65230
+ /* clip-path takes the translate's own duration, for the one cut that
65231
+ still moves (a band of glass beside the app — see this file's top
65232
+ comment for why every other cut is a constant). A constant cut, or a
65233
+ kind that sets none, has the same value on both sides of the change,
65234
+ which costs nothing. */
65235
+ transition-property:
65236
+ display, overlay, opacity, transform, scale, box-shadow, clip-path;
65237
+ transition-duration:
65238
+ var(--popup-animation-duration), var(--popup-animation-duration),
65239
+ var(--popup-opacity-duration), var(--popup-translate-duration),
65240
+ var(--popup-scale-duration), var(--popup-animation-duration),
65241
+ var(--popup-translate-duration);
65242
+ transition-timing-function: ease;
65243
+ transition-behavior: allow-discrete;
65244
+ }
65180
65245
  /* A local popup is clipped by its clip wrapper (a static ancestor sized to
65181
65246
  the container, overflow: hidden): nothing is left for a cut to hide. */
65182
65247
  &[data-layer="local"] {
@@ -65306,7 +65371,6 @@ const popupCss = /* css */ `
65306
65371
  transform: translate(var(--x-popup-travel-x), var(--x-popup-travel-y));
65307
65372
  }
65308
65373
  }
65309
-
65310
65374
  }
65311
65375
 
65312
65376
  .navi_popover {
@@ -65671,6 +65735,62 @@ let openLocalDialogCount = 0;
65671
65735
  const css$E = /* css */`
65672
65736
  /* jsenv-css-opaque: popupCss overlaps these rules, own sheet = cascade
65673
65737
  order depending on which popup renders first. */
65738
+
65739
+ /* Not inherited: each is written on the dialog or derived there — by its
65740
+ placement (see popup_css.js for what inheriting would cost), by its
65741
+ opening (the anchor box under sizeFromAnchor, the stack order) or from the
65742
+ minWidth/maxWidth/minHeight/maxHeight props — and read by the dialog
65743
+ alone. Inherited, a dialog nested in this one would also open at this
65744
+ one's size. */
65745
+ @property --dialog-stack-order {
65746
+ syntax: "*";
65747
+ inherits: false;
65748
+ }
65749
+ @property --anchor-width {
65750
+ syntax: "*";
65751
+ inherits: false;
65752
+ }
65753
+ @property --anchor-height {
65754
+ syntax: "*";
65755
+ inherits: false;
65756
+ }
65757
+ @property --dialog-min-width {
65758
+ syntax: "*";
65759
+ inherits: false;
65760
+ }
65761
+ @property --dialog-max-width {
65762
+ syntax: "*";
65763
+ inherits: false;
65764
+ }
65765
+ @property --dialog-min-height {
65766
+ syntax: "*";
65767
+ inherits: false;
65768
+ }
65769
+ @property --dialog-max-height {
65770
+ syntax: "*";
65771
+ inherits: false;
65772
+ }
65773
+ @property --x-dialog-container-spacing {
65774
+ syntax: "*";
65775
+ inherits: false;
65776
+ }
65777
+ @property --dialog-maxmax-width {
65778
+ syntax: "*";
65779
+ inherits: false;
65780
+ }
65781
+ @property --dialog-maxmax-height {
65782
+ syntax: "*";
65783
+ inherits: false;
65784
+ }
65785
+ @property --x-dialog-max-width {
65786
+ syntax: "*";
65787
+ inherits: false;
65788
+ }
65789
+ @property --x-dialog-max-height {
65790
+ syntax: "*";
65791
+ inherits: false;
65792
+ }
65793
+
65674
65794
  @layer navi {
65675
65795
  .navi_dialog {
65676
65796
  /* Min gap between the dialog and the edges of its container. Written
@@ -65768,18 +65888,6 @@ const css$E = /* css */`
65768
65888
  --x-corner-bottom-right-radius: initial;
65769
65889
  --x-corner-bottom-left-radius: initial;
65770
65890
 
65771
- /* Sizing is per dialog: the anchor box (sizeFromAnchor) and the
65772
- minWidth/maxWidth/minHeight/maxHeight props are written inline on THIS
65773
- element, and an inline declaration wins over these resets. Without
65774
- them, a dialog nested in another dialog would inherit its parent's
65775
- inline values and open at the parent's size. */
65776
- --anchor-width: initial;
65777
- --anchor-height: initial;
65778
- --dialog-min-width: initial;
65779
- --dialog-max-width: initial;
65780
- --dialog-min-height: initial;
65781
- --dialog-max-height: initial;
65782
-
65783
65891
  /* Computed once, reused by both max-width itself and min-width's own
65784
65892
  clamp below (see its comment for why) — avoids repeating the same
65785
65893
  min(..., ...) expression twice. */
@@ -66034,7 +66142,7 @@ const css$E = /* css */`
66034
66142
  &[aria-expanded="true"]:not([navi-transitions-off])::backdrop {
66035
66143
  opacity: 1;
66036
66144
  transition-property: opacity;
66037
- transition-duration: var(--navi-popup-lift-duration, 0.25s);
66145
+ transition-duration: var(--popup-animation-duration, 0.18s);
66038
66146
  transition-timing-function: ease;
66039
66147
 
66040
66148
  @starting-style {
@@ -66217,7 +66325,7 @@ const css$E = /* css */`
66217
66325
  &[aria-expanded="true"] {
66218
66326
  opacity: 1;
66219
66327
  transition-property: opacity;
66220
- transition-duration: var(--navi-popup-lift-duration, 0.25s);
66328
+ transition-duration: var(--popup-animation-duration);
66221
66329
  transition-timing-function: ease;
66222
66330
  }
66223
66331
  }
@@ -66255,8 +66363,9 @@ const css$E = /* css */`
66255
66363
  and unpressable while the movement plays: under a modal wall at the
66256
66364
  opening, and for the popup's --popup-animation-duration at the closing. */
66257
66365
  :root[data-navi-popup-lift] {
66258
- /* The popup's own pace, published on the root by popup_lift.js because the
66259
- ::view-transition tree hangs off it and inherits from nowhere else. */
66366
+ /* The popup's own pace, published on ::view-transition by popup_lift.js:
66367
+ the pictures inherit from nowhere else. The wall reads it off the
66368
+ dialog itself (the [data-lifting] backdrop rules above). */
66260
66369
  &::view-transition-group(navi-popup-lift),
66261
66370
  &::view-transition-old(navi-popup-lift),
66262
66371
  &::view-transition-new(navi-popup-lift),
@@ -67998,6 +68107,58 @@ let openLocalPopoverCount = 0;
67998
68107
  const css$D = /* css */`
67999
68108
  /* jsenv-css-opaque: popupCss overlaps these rules, own sheet = cascade
68000
68109
  order depending on which popup renders first. */
68110
+
68111
+ /* Not inherited: each is written on the popover or derived there — by its
68112
+ placement (the anchor box included; see popup_css.js for what inheriting
68113
+ would cost), by its opening (the stack order, which the backdrop gets a
68114
+ copy of) or from the minWidth/maxWidth/minHeight/maxHeight props — and
68115
+ read by the popover alone. Inherited, a popover nested in another popup
68116
+ would also open at the outer one's size. */
68117
+ @property --popover-stack-order {
68118
+ syntax: "*";
68119
+ inherits: false;
68120
+ }
68121
+ @property --anchor-width {
68122
+ syntax: "*";
68123
+ inherits: false;
68124
+ }
68125
+ @property --anchor-height {
68126
+ syntax: "*";
68127
+ inherits: false;
68128
+ }
68129
+ @property --anchor-inner-width {
68130
+ syntax: "*";
68131
+ inherits: false;
68132
+ }
68133
+ @property --anchor-inner-height {
68134
+ syntax: "*";
68135
+ inherits: false;
68136
+ }
68137
+ @property --popover-min-width {
68138
+ syntax: "*";
68139
+ inherits: false;
68140
+ }
68141
+ @property --popover-max-width {
68142
+ syntax: "*";
68143
+ inherits: false;
68144
+ }
68145
+ @property --popover-min-height {
68146
+ syntax: "*";
68147
+ inherits: false;
68148
+ }
68149
+ @property --popover-max-height {
68150
+ syntax: "*";
68151
+ inherits: false;
68152
+ }
68153
+ @property --x-popover-max-width {
68154
+ syntax: "*";
68155
+ inherits: false;
68156
+ }
68157
+ @property --x-popover-max-height {
68158
+ syntax: "*";
68159
+ inherits: false;
68160
+ }
68161
+
68001
68162
  @layer navi {
68002
68163
  .navi_popover {
68003
68164
  /* soft: user-configurable preferred max-height. Kept as a *default*
@@ -68059,21 +68220,6 @@ const css$D = /* css */`
68059
68220
  --x-corner-bottom-right-radius: initial;
68060
68221
  --x-corner-bottom-left-radius: initial;
68061
68222
 
68062
- /* Sizing is per popover: the anchor box and the
68063
- minWidth/maxWidth/minHeight/maxHeight props are written inline on THIS
68064
- element, and an inline declaration wins over these resets. Without
68065
- them, a popover nested in another popup (or opened without an anchor
68066
- inside one sized from its own) would inherit the outer inline values
68067
- and open at the outer size. */
68068
- --anchor-width: initial;
68069
- --anchor-height: initial;
68070
- --anchor-inner-width: initial;
68071
- --anchor-inner-height: initial;
68072
- --popover-min-width: initial;
68073
- --popover-max-width: initial;
68074
- --popover-min-height: initial;
68075
- --popover-max-height: initial;
68076
-
68077
68223
  --x-popover-max-width: min(
68078
68224
  var(--popover-max-width, var(--popover-maxmax-width)),
68079
68225
  var(--container-position-remaining-width, var(--popover-maxmax-width)),
@@ -68202,10 +68348,8 @@ const css$D = /* css */`
68202
68348
  "position: absolute" above. */
68203
68349
  &[popover] {
68204
68350
  position: fixed;
68205
- /* The native top layer already gives "last shown wins" for free —
68206
- --popover-stack-order is only ever set by the custom renderer's own
68207
- openEffect, but reset here regardless in case a consumer sets the
68208
- var directly on an ancestor. */
68351
+ /* The native top layer already gives "last shown wins" for free: the
68352
+ custom renderer's stack order has no say here. */
68209
68353
  z-index: unset;
68210
68354
  padding: 0;
68211
68355