@jsenv/navi 0.28.7 → 0.28.9

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.
@@ -5353,10 +5353,12 @@ const stateSignal = (defaultValue, options = {}) => {
5353
5353
  // Convert numeric IDs to strings for consistency
5354
5354
  const signalIdString = String(signalId);
5355
5355
  if (globalSignalRegistry.has(signalIdString)) {
5356
- const conflictInfo = globalSignalRegistry.get(signalIdString);
5357
- throw new Error(
5358
- `Signal ID conflict: A signal with ID "${signalIdString}" already exists (existing default: ${conflictInfo.options.getDefaultValue()})`,
5359
- );
5356
+ const existingEntry = globalSignalRegistry.get(signalIdString);
5357
+ {
5358
+ throw new Error(
5359
+ `Signal ID conflict: A signal with ID "${signalIdString}" already exists (existing default: ${existingEntry.options.getDefaultValue()})`,
5360
+ );
5361
+ }
5360
5362
  }
5361
5363
 
5362
5364
  // Determine localStorage key: use id if persists=true, or legacy localStorage option
@@ -5481,7 +5483,12 @@ const stateSignal = (defaultValue, options = {}) => {
5481
5483
  // can reflect the current input state without silently correcting it.
5482
5484
  return validity.value;
5483
5485
  };
5484
- const preactSignal = signal(processValue(getFallbackValue()));
5486
+ const preactSignal = signal(
5487
+ processValue(
5488
+ getFallbackValue()
5489
+ ,
5490
+ ),
5491
+ );
5485
5492
 
5486
5493
  // Override the value setter on the instance to intercept writes and apply processValue.
5487
5494
  // We do this on the instance (not the prototype) so preactSignal remains a real Signal
@@ -23323,6 +23330,7 @@ const CONTROL_ATTRIBUTE_SET = new Set([
23323
23330
  "command",
23324
23331
  "commandFor",
23325
23332
  "command-value", // not standard but make sense, allow to give param to the command in question
23333
+ "list",
23326
23334
 
23327
23335
  // "ui-action-target",
23328
23336
  "navi-input-type",
@@ -31229,6 +31237,11 @@ const generateCrossPlatformCombination = (combination) => {
31229
31237
  return crossPlatform;
31230
31238
  };
31231
31239
  const keyboardEventIsMatchingKeyCombination = (event, keyCombination) => {
31240
+ if (!event.key) {
31241
+ // Some keydown events carry no key at all — the browser synthesizes one
31242
+ // when a native autofill/search suggestion is clicked. No key, no match.
31243
+ return false;
31244
+ }
31232
31245
  const keys = keyCombination.toLowerCase().split("+");
31233
31246
  const activeModifiers = new Set();
31234
31247
  for (const eventProperty of Object.keys(modifierKeyMapping)) {
@@ -41485,7 +41498,10 @@ const css$y = /* css */`
41485
41498
  * @param {boolean|"last-resort"|"restore"} [props.autoFocus="last-resort"] - See
41486
41499
  * `focus_transfer.js` — `"last-resort"` focuses the popover itself only if it
41487
41500
  * has no other focusable descendant, `"restore"` keeps it out of the
41488
- * opening focus chain unless it held focus when the popover closed.
41501
+ * opening focus chain unless it held focus when the popover closed. `false`
41502
+ * disables the open-time focus transfer entirely: nothing inside the popover
41503
+ * receives focus, whoever had the keyboard keeps it — the combobox case,
41504
+ * where suggestions open under an input being typed in.
41489
41505
  * @param {boolean} [props.open] - Controlled open state.
41490
41506
  * @param {boolean} [props.defaultOpen] - Uncontrolled, mount-only initial
41491
41507
  * open state — plays no entrance animation (nothing was ever shown as
@@ -42190,7 +42206,12 @@ const usePopoverProps = props => {
42190
42206
  }
42191
42207
  }
42192
42208
  const cancelOpenInteractionSuppression = !silent && hasCssTransitionAnimation ? suppressPointerEventsDuringTransition(popoverEl) : null;
42193
- const restoreFocus = openController.transferFocusOnOpen(popoverEl);
42209
+ // autoFocus={false}: opening moves no focus at all — whoever has the
42210
+ // keyboard keeps it (combobox-style suggestions under an input being
42211
+ // typed in). The element-level useAutoFocus hook is already a no-op for
42212
+ // false; this skips the open transfer too, and with no transfer there is
42213
+ // nothing to restore on close.
42214
+ const restoreFocus = autoFocus === false ? null : openController.transferFocusOnOpen(popoverEl);
42194
42215
  debugPopup(e, isTopLayer ? `openPopover() -> anchor: ${anchorElement?.tagName}, hasAnchorElement: ${hasAnchorElement}` : `openPopover() -> scroll-container (local)`);
42195
42216
 
42196
42217
  // The close callback openEffect returns — also inlined for the same
@@ -42228,7 +42249,7 @@ const usePopoverProps = props => {
42228
42249
  }
42229
42250
  });
42230
42251
  }
42231
- restoreFocus(closeEvent);
42252
+ restoreFocus?.(closeEvent);
42232
42253
 
42233
42254
  // pickPositionRelativeTo (visible_rect.js) writes data-position-y/x-
42234
42255
  // current unconditionally on every call, and treats their mere
@@ -48288,6 +48309,10 @@ const css$o = /* css */`
48288
48309
  .navi_picker_spin {
48289
48310
  /* What the loading outline is drawn around. */
48290
48311
  position: relative;
48312
+ /* Written in the control font, like the picker it wraps: the day and its
48313
+ two chevrons are a control, not running text. */
48314
+ font-size: var(--navi-control-font-size);
48315
+ font-family: var(--navi-control-font-family);
48291
48316
  /* Framed like every other control (see navi_css_vars.js): what one steps
48292
48317
  through is a value one edits, and a box around it is what says so. Said
48293
48318
  as CSS rather than as defaults on the Box, so borderWidth="0" or a radius
@@ -51001,7 +51026,11 @@ const useWheelInteractions = ({
51001
51026
  if (vp.contains(documentWheelEvent.target)) {
51002
51027
  return; // on the scroll surface → its own onWheel handles it
51003
51028
  }
51004
- documentWheelEvent.preventDefault();
51029
+ if (documentWheelEvent.cancelable) {
51030
+ // cancelable=false during an inertial scroll the browser already owns;
51031
+ // preventDefault would be ignored with an intervention warning.
51032
+ documentWheelEvent.preventDefault();
51033
+ }
51005
51034
  keepClaimingGesture(); // the gesture continues elsewhere → keep swallowing it
51006
51035
  };
51007
51036
  const stopClaimingGesture = () => {
@@ -51301,7 +51330,11 @@ const useWheelInteractions = ({
51301
51330
  // preventing touchstart has wider side effects. Requires a non-passive
51302
51331
  // listener. See docs/MOBILE_TAP_SUPPRESSION_AFTER_DRAG.md.
51303
51332
  const onTouchMove = e => {
51304
- if (drag) {
51333
+ // cancelable=false when the touch landed while a scroll was already in
51334
+ // progress (e.g. the page still coasting from a fling): the browser owns
51335
+ // that scroll, preventDefault would be a no-op and Chrome logs an
51336
+ // intervention warning for the attempt.
51337
+ if (drag && e.cancelable) {
51305
51338
  e.preventDefault();
51306
51339
  }
51307
51340
  };