@jsenv/navi 0.29.220 → 0.29.222

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.
@@ -46275,15 +46275,27 @@ const warnAboutUnreachableOutsideRegions = (popupEl) => {
46275
46275
  * answers it. The one popup where that cannot hold is the modal dialog, where
46276
46276
  * the browser has already made everything behind inert before this runs.
46277
46277
  *
46278
- * `pointerdown`, not `mousedown`, and this is what makes the reading work at
46279
- * all: a page with no wall over it is a page whose own elements arbitrate
46280
- * their presses, and cancelling a `pointerdown` — what a drag source and a
46281
- * control keeping the focus where it is both do — suppresses every
46282
- * compatibility mouse event that would have followed it. The press happens,
46283
- * reaches its target, and no `mousedown` is ever dispatched for it. Reading
46284
- * the pointer event is reading the press itself, whatever anything does with
46285
- * it afterwards, and it is the same event the drag and surface detectors
46286
- * read.
46278
+ * `pressEventType` says which event IS the press, and the two callers want
46279
+ * opposite ones:
46280
+ *
46281
+ * - `"pointerdown"` for a popup with no wall: a page with no wall over it is
46282
+ * a page whose own elements arbitrate their presses, and cancelling a
46283
+ * `pointerdown` — what a drag source and a control keeping the focus where
46284
+ * it is both do — suppresses every compatibility mouse event that would have
46285
+ * followed it. The press happens, reaches its target, and no `mousedown` is
46286
+ * ever dispatched for it. Reading the pointer event is reading the press
46287
+ * itself, whatever anything does with it afterwards, and it is the same
46288
+ * event the drag and surface detectors read.
46289
+ * - `"mousedown"` for the modal dialog, whose native `::backdrop` exists to
46290
+ * spend the press. The page's controls act on `mousedown`, and on a touch
46291
+ * screen that is not the same moment as `pointerdown`: the compatibility
46292
+ * mouse events are synthesized at `touchend` and hit-tested again then.
46293
+ * Closing on `pointerdown` takes the `::backdrop` away before that second
46294
+ * hit-test, so the `mousedown` lands on whatever the page holds under the
46295
+ * finger, and one tap both dismisses the dialog and presses the page. Read
46296
+ * on `mousedown`, the wall is still up when the press the page acts on is
46297
+ * aimed, and it catches it. Nothing behind a modal wall can cancel that
46298
+ * press, since nothing behind it hears the `pointerdown` at all.
46287
46299
  *
46288
46300
  * Capture phase, so a handler downstream that stops propagation cannot keep
46289
46301
  * the popup open either — the press is still outside whatever is made of it.
@@ -46292,7 +46304,11 @@ const warnAboutUnreachableOutsideRegions = (popupEl) => {
46292
46304
  */
46293
46305
  const armOutsidePressClose = (
46294
46306
  popupEl,
46295
- { openController, pointerInteractionOutsideEffect },
46307
+ {
46308
+ openController,
46309
+ pointerInteractionOutsideEffect,
46310
+ pressEventType = "pointerdown",
46311
+ },
46296
46312
  ) => {
46297
46313
  const onDocumentPointerDown = (pointerDownEvent) => {
46298
46314
  if (pointerDownEvent.button !== 0) {
@@ -46349,11 +46365,11 @@ const armOutsidePressClose = (
46349
46365
  isCancel: pointerInteractionOutsideEffect === "cancel",
46350
46366
  });
46351
46367
  };
46352
- document.addEventListener("pointerdown", onDocumentPointerDown, {
46368
+ document.addEventListener(pressEventType, onDocumentPointerDown, {
46353
46369
  capture: true,
46354
46370
  });
46355
46371
  return () => {
46356
- document.removeEventListener("pointerdown", onDocumentPointerDown, {
46372
+ document.removeEventListener(pressEventType, onDocumentPointerDown, {
46357
46373
  capture: true,
46358
46374
  });
46359
46375
  };
@@ -59502,7 +59518,12 @@ const useDialogProps = props => {
59502
59518
  if ((isModal || !backdrop) && (pointerInteractionOutsideEffect === "close" || pointerInteractionOutsideEffect === "cancel")) {
59503
59519
  addCleanup(armOutsidePressClose(dialogEl, {
59504
59520
  openController,
59505
- pointerInteractionOutsideEffect
59521
+ pointerInteractionOutsideEffect,
59522
+ // A modal wall spends the press the page acts on (mousedown); a
59523
+ // local dialog with no wall lets that same press through
59524
+ // (pointerdown). See armOutsidePressClose for why the two differ on
59525
+ // a touch screen.
59526
+ pressEventType: isModal ? "mousedown" : "pointerdown"
59506
59527
  }));
59507
59528
  }
59508
59529
  return closeEvent => {
@@ -64521,7 +64542,7 @@ const css$x = /* css */`@layer navi {
64521
64542
  overflow: clip visible;
64522
64543
  }
64523
64544
 
64524
- & .navi_list_scroll_container {
64545
+ & > .navi_list_scroll_container {
64525
64546
  --x-corner-top-left-radius: initial;
64526
64547
  --x-corner-top-right-radius: initial;
64527
64548
  --x-corner-bottom-right-radius: initial;
@@ -64541,13 +64562,13 @@ const css$x = /* css */`@layer navi {
64541
64562
  max-height: none;
64542
64563
  overflow: visible;
64543
64564
 
64544
- & .navi_list_scroll_container {
64565
+ & > .navi_list_scroll_container {
64545
64566
  max-height: none;
64546
64567
  overflow: visible;
64547
64568
  }
64548
64569
  }
64549
64570
 
64550
- &:not([navi-hover-while-scrolling]) .navi_list:is([navi-scrolling] *) {
64571
+ &:not([navi-hover-while-scrolling]) > .navi_list_scroll_container > .navi_list:is([navi-scrolling] *) {
64551
64572
  pointer-events: none;
64552
64573
  }
64553
64574
 
@@ -64562,7 +64583,7 @@ const css$x = /* css */`@layer navi {
64562
64583
  &[data-expand-y] {
64563
64584
  --list-max-height: none;
64564
64585
 
64565
- & .navi_list_scroll_container {
64586
+ & > .navi_list_scroll_container {
64566
64587
  flex: 1;
64567
64588
  min-height: 0;
64568
64589
  }
@@ -64677,7 +64698,7 @@ const css$x = /* css */`@layer navi {
64677
64698
  .navi_list_container[data-horizontal] {
64678
64699
  --list-max-height: none;
64679
64700
 
64680
- & .navi_list_virtual_filler {
64701
+ & > .navi_list_scroll_container > .navi_list > .navi_list_virtual_filler {
64681
64702
  width: var(--size-to-fill, 0px);
64682
64703
  height: 100%;
64683
64704
  }
@@ -66557,7 +66578,7 @@ const getScrollerEl = (listContainerEl, scroller, horizontal) => {
66557
66578
  return el || document.scrollingElement;
66558
66579
  }
66559
66580
  if (scroller !== "parent") {
66560
- return listContainerEl.querySelector(`.navi_list_scroll_container`);
66581
+ return listContainerEl.querySelector(`:scope > .navi_list_scroll_container`);
66561
66582
  }
66562
66583
  const axis = horizontal ? "x" : "y";
66563
66584
  let element = listContainerEl;