@jsenv/navi 0.29.517 → 0.29.519

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.
@@ -22024,6 +22024,11 @@ const BUSY_CONSTRAINT = {
22024
22024
  return null;
22025
22025
  }
22026
22026
 
22027
+ // Same as READONLY_CONSTRAINT: a run inside the popup holds it from there.
22028
+ if (intent === "close") {
22029
+ return null;
22030
+ }
22031
+
22027
22032
  // Busy, and what it opens still opens: a picker's answer lives in a shape
22028
22033
  // only its popup draws, and refusing to open leaves it unreadable for as
22029
22034
  // long as the wait lasts. Opening reads and nothing more — the same
@@ -22118,12 +22123,17 @@ const findBusySource = (field) => {
22118
22123
  const DISABLED_CONSTRAINT = {
22119
22124
  name: "disabled",
22120
22125
  messageAttribute: "data-disabled-message",
22121
- check: (field) => {
22126
+ check: (field, { intent } = {}) => {
22122
22127
  const disabled = field.controlHostProps.disabled;
22123
22128
  if (!disabled) {
22124
22129
  return null;
22125
22130
  }
22126
22131
 
22132
+ // Same as READONLY_CONSTRAINT: a popup still open leaves like any other.
22133
+ if (intent === "close") {
22134
+ return null;
22135
+ }
22136
+
22127
22137
  const type = field.controlHostProps.type;
22128
22138
  let message;
22129
22139
  if (type === "radio") {
@@ -23112,6 +23122,14 @@ const READONLY_CONSTRAINT = {
23112
23122
  return null;
23113
23123
  }
23114
23124
 
23125
+ // Leaving a popup already open is never the control's to refuse, whatever
23126
+ // it would refuse on the way in: closing writes nothing, and what may hold
23127
+ // a popup is the popup's own question (see popup_busy.js and the picker's
23128
+ // onRequestClose).
23129
+ if (intent === "close") {
23130
+ return null;
23131
+ }
23132
+
23115
23133
  // Read-only, and what it opens still opens: a picker's answer often lives
23116
23134
  // in a shape only its popup draws — a plan with one tile ringed, a wheel
23117
23135
  // stopped on a time — and refusing to open leaves that shape unreadable.
@@ -23211,7 +23229,8 @@ const readOnlyMessage = (field) => {
23211
23229
  * → onRequestInteraction
23212
23230
  * → check disabled / read-only / busy (via controller.rules.interaction)
23213
23231
  * against the interaction's `intent` ("write" by default, "read" for one
23214
- * that only shows what is already there — see READONLY_CONSTRAINT)
23232
+ * that only shows what is already there, "close" for one leaving a popup
23233
+ * — see READONLY_CONSTRAINT)
23215
23234
  * → if blocked → prevented()
23216
23235
  * → if allowed → allowed()
23217
23236
  * → (in allowed callback) setUIState(value)
@@ -23494,9 +23513,10 @@ const onRequestInteraction = (
23494
23513
  name,
23495
23514
  // What this interaction would do to the control: write it, or only read it.
23496
23515
  // Everything writes unless it says otherwise — an interaction that merely
23497
- // shows what is already there (opening a picker's popup, closing it again)
23498
- // says "read", and that is what a control held read-only can still let
23499
- // through (see READONLY_CONSTRAINT).
23516
+ // shows what is already there (opening a picker's popup) says "read", and
23517
+ // that is what a control held read-only can still let through. Closing that
23518
+ // popup says "close", which no state of the control refuses (see
23519
+ // READONLY_CONSTRAINT).
23500
23520
  intent = "write",
23501
23521
  bypassInteractivity = false,
23502
23522
  // navi continuing a gesture on its own rather than a user asking for
@@ -39834,12 +39854,6 @@ const css$17 = /* css */`@property --navi-route-transition-leave {
39834
39854
  inherits: false
39835
39855
  }
39836
39856
 
39837
- @property --navi-furniture-fade {
39838
- syntax: "<number>";
39839
- inherits: true;
39840
- initial-value: 1;
39841
- }
39842
-
39843
39857
  :root::view-transition, :root::view-transition-group(*), :root::view-transition-image-pair(*), :root::view-transition-old(*), :root::view-transition-new(*) {
39844
39858
  --navi-route-transition-leave: inherit;
39845
39859
  --navi-route-transition-enter: inherit;
@@ -39922,22 +39936,14 @@ const css$17 = /* css */`@property --navi-route-transition-leave {
39922
39936
  animation-duration: var(--navi-route-transition-duration, .3s);
39923
39937
  }
39924
39938
 
39925
- &::view-transition-image-pair(.navi_furniture_shared) {
39926
- animation: navi-furniture-fade
39927
- var(--navi-route-transition-duration, .3s) ease both;
39928
- }
39929
-
39930
- &::view-transition-old(.navi_furniture_shared), &::view-transition-new(.navi_furniture_shared) {
39931
- mix-blend-mode: plus-lighter;
39932
- animation-name: none;
39933
- }
39934
-
39935
39939
  &::view-transition-old(.navi_furniture_shared) {
39936
- opacity: calc(1 - var(--navi-furniture-fade));
39940
+ mix-blend-mode: plus-lighter;
39941
+ animation-name: navi-route-transition-fade-out;
39937
39942
  }
39938
39943
 
39939
39944
  &::view-transition-new(.navi_furniture_shared) {
39940
- opacity: var(--navi-furniture-fade);
39945
+ mix-blend-mode: plus-lighter;
39946
+ animation-name: navi-route-transition-fade-in;
39941
39947
  }
39942
39948
  }
39943
39949
 
@@ -40215,6 +40221,10 @@ const css$17 = /* css */`@property --navi-route-transition-leave {
40215
40221
  }
40216
40222
 
40217
40223
  @keyframes navi-route-transition-fade-out {
40224
+ from {
40225
+ opacity: 1;
40226
+ }
40227
+
40218
40228
  to {
40219
40229
  opacity: 0;
40220
40230
  }
@@ -40224,15 +40234,9 @@ const css$17 = /* css */`@property --navi-route-transition-leave {
40224
40234
  from {
40225
40235
  opacity: 0;
40226
40236
  }
40227
- }
40228
-
40229
- @keyframes navi-furniture-fade {
40230
- from {
40231
- --navi-furniture-fade: 0;
40232
- }
40233
40237
 
40234
40238
  to {
40235
- --navi-furniture-fade: 1;
40239
+ opacity: 1;
40236
40240
  }
40237
40241
  }
40238
40242
  `;
@@ -44764,11 +44768,8 @@ const clearCommand = (source, event) => {
44764
44768
  return;
44765
44769
  }
44766
44770
  // Only what is open: the clear cross of a picker sits on the closed
44767
- // trigger, and asking that trigger to close is asking it to do nothing —
44768
- // except that the ask goes through the interaction gate, which turns it
44769
- // down while the clear it just sent is still running and says so out loud
44770
- // ("this element is busy"). A clear pressed INSIDE an open popup is the
44771
- // one this is for: it answers the popup, so the popup goes away.
44771
+ // trigger, with nothing to close. A clear pressed INSIDE an open popup is
44772
+ // the one this is for: it answers the popup, so the popup goes away.
44772
44773
  const expandable = resolveClosestExpandable(source);
44773
44774
  if (expandable?.getAttribute("aria-expanded") !== "true") {
44774
44775
  return;
@@ -53171,21 +53172,20 @@ const useInteractiveProps = (props, {
53171
53172
  // — a diskette saving a row into the reader's own address book stays
53172
53173
  // pressable on a game nobody may edit. Its own props still hold; only what
53173
53174
  // came from above is dropped (see self_interactions.js for the three modes).
53174
- const zoneStateApplies = !selfInteractionsIgnoreBlock(props);
53175
53175
  // A press that only leaves the popup it sits in writes nothing to the zone
53176
- // around it either, so that zone being read-only — or holding a write the
53177
- // network policy keeps — does not hold it: the popup answers the close
53178
- // itself. A read-only picker's popup then closes from its own button as
53179
- // it does from a press outside, and refuses both alike when it holds a
53180
- // change it cannot send.
53181
- const zoneReadOnlyApplies = zoneStateApplies && !pressOnlyLeaves(props);
53176
+ // around it either, so that zone being disabled, read-only or busy — or
53177
+ // holding a write the network policy keeps — does not hold it: the popup
53178
+ // answers the close itself. A read-only picker's popup then closes from its
53179
+ // own button as it does from a press outside, and refuses both alike when it
53180
+ // holds a change it cannot send or a run it cannot give up on.
53181
+ const zoneStateApplies = !selfInteractionsIgnoreBlock(props) && !pressOnlyLeaves(controlInfo.controlType, props);
53182
53182
  // A press feeding nothing to the write around it — a travel, a page, a
53183
53183
  // uiAction, a function of its own — has nothing for the network policy to
53184
53184
  // keep: only its own verb holds it, as anywhere else. What the zone holds
53185
53185
  // for its own reasons (read-only, busy) still holds it.
53186
53186
  const asksNothingOfTheWrite = pressAsksNothingOfTheWrite(controlInfo.controlType, props, boundAction);
53187
53187
  const controlDisabled = zoneStateApplies && controlDisabledFromAbove;
53188
- const controlReadOnly = zoneReadOnlyApplies && !(asksNothingOfTheWrite && controlReadOnlyFromAbove === "network-policy") && controlReadOnlyFromAbove;
53188
+ const controlReadOnly = zoneStateApplies && !(asksNothingOfTheWrite && controlReadOnlyFromAbove === "network-policy") && controlReadOnlyFromAbove;
53189
53189
  const controlLoading = zoneStateApplies && controlLoadingFromAbove;
53190
53190
  const disabledResolved = disabled || controlDisabled;
53191
53191
  const requiredResolved = required || controlRequired;
@@ -53204,7 +53204,7 @@ const useInteractiveProps = (props, {
53204
53204
  // picker's popup) — refuses before the press and says why (see
53205
53205
  // network_policy.js): a press that looks accepted and fails after is what
53206
53206
  // the policy exists to avoid.
53207
- const heldByNetworkPolicy = networkPolicyReason !== null && (isWriteAction(boundAction) || Boolean(zoneReadOnlyApplies && !asksNothingOfTheWrite && parentAction && isWriteAction(parentAction)) || controlReadOnly === "network-policy");
53207
+ const heldByNetworkPolicy = networkPolicyReason !== null && (isWriteAction(boundAction) || Boolean(zoneStateApplies && !asksNothingOfTheWrite && parentAction && isWriteAction(parentAction)) || controlReadOnly === "network-policy");
53208
53208
  // Held back because the surface above already has as many runs in flight as
53209
53209
  // it allows (see parallel_guard.js). Only a control that would START one:
53210
53210
  // anything without an action of its own runs nothing and has nothing to
@@ -53778,10 +53778,11 @@ const splitControlProps = (props, {
53778
53778
  return [controlRootProps, controlHostProps];
53779
53779
  };
53780
53780
  // What a press leaving a popup asks for: closing it, or cancelling it. Only on
53781
- // a control running nothing of its own — one with an action writes, wherever
53782
- // it then leads.
53781
+ // a button or a link running nothing of its own — one with an action writes,
53782
+ // wherever it then leads, and on a field or a form `command` is what follows
53783
+ // the value it writes.
53783
53784
  const LEAVING_COMMAND_SET = new Set(["--navi-close", "--navi-cancel"]);
53784
- const pressOnlyLeaves = props => LEAVING_COMMAND_SET.has(props.command) && !props.action;
53785
+ const pressOnlyLeaves = (controlType, props) => (controlType === "button" || controlType === "link") && LEAVING_COMMAND_SET.has(props.command) && !props.action;
53785
53786
  // What these commands move reads only the person's place: the slide shown,
53786
53787
  // the item pointed at, the scroll, the page (see commands.js).
53787
53788
  const COMMANDS_ASKING_NOTHING_OF_THE_WRITE = new Set(["--navi-right", "--navi-left", "--navi-down", "--navi-up", "--navi-previous", "--navi-next", "--navi-first", "--navi-last", "--navi-go-to-slide", "--navi-back", "--navi-scroll", "--navi-nav-to", "--navi-nav-back"]);
@@ -57859,6 +57860,7 @@ const css$$ = /* css */`@layer navi {
57859
57860
  }
57860
57861
 
57861
57862
  &[data-stretch] {
57863
+ z-index: auto;
57862
57864
  position: static;
57863
57865
 
57864
57866
  &:after {
@@ -76297,12 +76299,11 @@ const clipOf = (side, distance) => {
76297
76299
  * `--navi-close`, which the nearest popup above it answers; the caller only
76298
76300
  * decides where it goes (the right end of a header, most of the time).
76299
76301
  *
76300
- * It is the way out of a popup, so it is the one affordance in there that the
76301
- * surrounding control's read-only and disabled do not reach: a read-only picker
76302
- * still opens (reading changes nothing) and hands its popup that read-only, and
76303
- * a cross wearing it would trap the user in a popup they were invited to read.
76304
- * A close button written by hand inherits it and refuses the press — which is
76305
- * the reason to use this one rather than a `<Button command="--navi-close" />`.
76302
+ * It is the way out of a popup, so the state of the surrounding control does not
76303
+ * reach it, as with any `--navi-close` button that has no action of its own (see
76304
+ * pressOnlyLeaves in control_hooks.jsx): a read-only picker still opens (reading
76305
+ * changes nothing) and hands its popup that read-only, and a cross wearing it
76306
+ * would trap the user in a popup they were invited to read.
76306
76307
  *
76307
76308
  * Exempt from the state around it, never from the popup's own answer: the cross
76308
76309
  * ASKS, and the popup decides — a dialog holding a form mid-send keeps the
@@ -76329,15 +76330,6 @@ const PopupClose = ({
76329
76330
  command: "--navi-close",
76330
76331
  icon: true,
76331
76332
  variant: "discrete"
76332
- // Dismissing writes nothing to whatever control the popup belongs to, so
76333
- // that control's read-only and disabled are not about this cross: a
76334
- // read-only picker still opens to be read (see readonly_constraint.js),
76335
- // and what is opened has to be closable. Whether closing is allowed at
76336
- // this instant is the popup's own question, answered by the popup — a
76337
- // dialog holds the close while an action inside it runs (see
76338
- // popup_busy.js).
76339
- ,
76340
- whenSelfInteractionsBlocked: "ignore"
76341
76333
  // The cross is drawn at the control size, which is a few millimetres
76342
76334
  // wide; the padding is what makes it a target a thumb can hit.
76343
76335
  ,
@@ -82036,11 +82028,11 @@ const PickerCustom = props => {
82036
82028
  event: e,
82037
82029
  name: "navi_request_open_event",
82038
82030
  // Showing what the picker already holds, in the shape only the popup
82039
- // draws it in — nothing of the value is written on the way in, nor on
82040
- // the way out. Every interaction below says the same, which is what
82041
- // lets a read-only picker be opened and read while everything that
82042
- // would write it (paste, cut, the clear cross) stays refused. See
82043
- // READONLY_CONSTRAINT.
82031
+ // draws it in — nothing of the value is written on the way in. Every
82032
+ // way of opening below says the same, which is what lets a read-only
82033
+ // picker be opened and read while everything that would write it
82034
+ // (paste, cut, the clear cross) stays refused. Every way of closing
82035
+ // says "close". See READONLY_CONSTRAINT.
82044
82036
  intent: "read",
82045
82037
  allowed: () => {
82046
82038
  // What the open said travels with it: a picker opened from
@@ -82065,7 +82057,7 @@ const PickerCustom = props => {
82065
82057
  onnavi_request_close: e => {
82066
82058
  requestInteraction({
82067
82059
  event: e,
82068
- intent: "read",
82060
+ intent: "close",
82069
82061
  allowed: () => {
82070
82062
  const closing = requestClose(e, {
82071
82063
  isCancel: e.detail.isCancel,
@@ -82172,7 +82164,7 @@ const PickerCustom = props => {
82172
82164
  }
82173
82165
  return {
82174
82166
  name: "escape_to_cancel",
82175
- intent: "read",
82167
+ intent: "close",
82176
82168
  allowed: () => {
82177
82169
  // Read with escapeEffect by the controller (see above).
82178
82170
  requestClose(e, {
@@ -82249,7 +82241,7 @@ const PickerCustom = props => {
82249
82241
  pressAnsweredAtMouseDownRef.current = readPressCount();
82250
82242
  return {
82251
82243
  name: "mousedown to close picker",
82252
- intent: "read",
82244
+ intent: "close",
82253
82245
  allowed: () => requestClose(e, {
82254
82246
  isCancel: true
82255
82247
  })
@@ -82297,7 +82289,7 @@ const PickerCustom = props => {
82297
82289
  if (openController.opened && !openedDuringThisPress(openController)) {
82298
82290
  return {
82299
82291
  name: "click to close picker",
82300
- intent: "read",
82292
+ intent: "close",
82301
82293
  prevented: () => {
82302
82294
  e.preventDefault();
82303
82295
  },