@jsenv/navi 0.29.320 → 0.29.321

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.
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { installImportMetaCssBuild, windowHeightSignal, windowWidthSignal, visualViewportHeightSignal, visualViewportWidthSignal, getAppHeight, getAppWidth, coarsePointerSignal, smallTouchScreenSignal } from "./jsenv_navi_side_effects.js";
6
6
  export { disableVirtualKeyboardOverlay } from "./jsenv_navi_side_effects.js";
7
- import { elementIsFocusable, createIterableWeakSet, dispatchInternalCustomEvent, dispatchCustomEvent, getVisuallyVisibleInfo, getFirstVisuallyVisibleAncestor, getElementSignature, createPubSub, findEvent, createValueEffect, findFocusDelegateTarget, findFocusable, scrollIntoViewThroughScrollables, allowWheelThrough, dispatchPublicCustomEvent, resolveCSSColor, ELEMENT_SIZE_CHANGE, findSelfOrAncestorFixedPosition, visibleRectEffect, pickPositionRelativeTo, getBorderSizes, getPaddingSizes, applyNewPosition, measureLongestVisualLineWidth, chainEvent, keepTouchRefusable, isPressDrivenClick, waitForTap, waitForPressHeld, suppressClickAfterGesture, startDragToTravel, markDragSource, refuseDragTo, startDragTo, installPanZoom, getKeyboardEventDefaultAction, activeElementSignal, normalizeStyle, mergeOneStyle, getPositionedParent, normalizeStyles, createGroupTransitionController, getBorderRadius, preventIntermediateScrollbar, createOpacityTransition, watchWheelTravel, scrollRoomTowards, getScrollContainer, isTouchDrivenEvent, scrollIntoViewScoped, closestOpenableAncestor, isAncestorOpen, isDisplayedDespiteClosedAncestor, observeAncestorOpenState, getAncestorOpenType, findBefore, findAfter, resolveCSSSize, hasCSSSizeUnit, releaseWheelGesture, getScrollIntoViewScopedOffsets, wheelGestureIsTakenFrom, claimWheelGesture, initFocusGroup, stringifyStyle as stringifyStyle$1, resolveOklchLightness, contrastColor, parsePositionArea, snapToPixel, trapFocusInside, trapScrollInside, onAncestorReopen, isPressDisputedByDrag, canScroll, measureWidestChildRow, performTabNavigation, dragAfterIntent, stickyAsRelativeCoords, createDragToMoveGestureController, getDropTargetInfo, setStyles, useActiveElement } from "@jsenv/dom";
7
+ import { elementIsFocusable, createIterableWeakSet, dispatchInternalCustomEvent, dispatchCustomEvent, getVisuallyVisibleInfo, getFirstVisuallyVisibleAncestor, getElementSignature, createPubSub, findEvent, createValueEffect, findFocusDelegateTarget, findFocusable, scrollIntoViewThroughScrollables, allowWheelThrough, dispatchPublicCustomEvent, resolveCSSColor, ELEMENT_SIZE_CHANGE, findSelfOrAncestorFixedPosition, visibleRectEffect, pickPositionRelativeTo, getBorderSizes, getPaddingSizes, applyNewPosition, measureLongestVisualLineWidth, chainEvent, keepTouchRefusable, isPressDrivenClick, waitForTap, waitForPressHeld, suppressClickAfterGesture, startDragToTravel, dragSourceThatStoodDown, markDragSource, refuseDragTo, startDragTo, installPanZoom, getKeyboardEventDefaultAction, activeElementSignal, normalizeStyle, mergeOneStyle, getPositionedParent, normalizeStyles, createGroupTransitionController, getBorderRadius, preventIntermediateScrollbar, createOpacityTransition, watchWheelTravel, scrollRoomTowards, getScrollContainer, isTouchDrivenEvent, scrollIntoViewScoped, closestOpenableAncestor, isAncestorOpen, isDisplayedDespiteClosedAncestor, observeAncestorOpenState, getAncestorOpenType, findBefore, findAfter, resolveCSSSize, hasCSSSizeUnit, releaseWheelGesture, getScrollIntoViewScopedOffsets, wheelGestureIsTakenFrom, claimWheelGesture, initFocusGroup, stringifyStyle as stringifyStyle$1, resolveOklchLightness, contrastColor, parsePositionArea, snapToPixel, trapFocusInside, trapScrollInside, onAncestorReopen, isPressDisputedByDrag, canScroll, measureWidestChildRow, performTabNavigation, dragAfterIntent, stickyAsRelativeCoords, createDragToMoveGestureController, getDropTargetInfo, setStyles, useActiveElement } from "@jsenv/dom";
8
8
  export { chainEvent, clickIsSuppressed, contrastColor, createDragGestureController, dragAfterIntent, findEvent, markDragSource, startDragTo } from "@jsenv/dom";
9
9
  import { signal, computed, effect, untracked, batch, useComputed, useSignal } from "@preact/signals";
10
10
  import { isValidElement, createContext, render, h, toChildArray, options, cloneElement, Fragment as Fragment$1 } from "preact";
@@ -10544,7 +10544,17 @@ defineInteractionDetector({
10544
10544
  },
10545
10545
  });
10546
10546
  }
10547
- if (hasLongPress) {
10547
+ // A press on something INSIDE this element that is picked up and
10548
+ // carried is that thing's, the same nearer word as the inner hold below:
10549
+ // a finger held still on a piece is the piece's own hold when it drags
10550
+ // by holding, and when it drags by distance it has decided nothing yet
10551
+ // at the delay — a hold answered there is a hold on a piece, and a carry
10552
+ // out of the same press the moment the hand moves. A surface that pans
10553
+ // steps back from the same source at the press (see pan_zoom.js).
10554
+ if (
10555
+ hasLongPress &&
10556
+ !isPressOnDragSourceInside(pointerDownEvent, element)
10557
+ ) {
10548
10558
  // A hold declared INSIDE this element, on this same press: the nearer
10549
10559
  // one answers, the way a click is the innermost target's, and this
10550
10560
  // wait is given up — two sheets opening from one hold is nobody's
@@ -10711,6 +10721,23 @@ const startSwipe = (
10711
10721
  });
10712
10722
  };
10713
10723
 
10724
+ // Whether the press landed on a drag source strictly inside the element — the
10725
+ // element itself being one is the other arrangement, where the grab answers
10726
+ // the hold (see refuseDragTo in @jsenv/dom). A source that stood down from this
10727
+ // press carries nothing, so it is no reason to hold back, and the walk goes on
10728
+ // above it the way a surface's does.
10729
+ const isPressOnDragSourceInside = (pointerDownEvent, element) => {
10730
+ const target = pointerDownEvent.target;
10731
+ if (!target || typeof target.closest !== "function") {
10732
+ return false;
10733
+ }
10734
+ let source = target.closest("[data-drag-source]");
10735
+ if (source && source === dragSourceThatStoodDown(pointerDownEvent)) {
10736
+ source = source.parentElement?.closest("[data-drag-source]") || null;
10737
+ }
10738
+ return Boolean(source) && source !== element && element.contains(source);
10739
+ };
10740
+
10714
10741
  // Whether a press landing now completes the tap before it: the same hand, soon
10715
10742
  // enough, and near enough. Axis by axis rather than as a distance, the way every
10716
10743
  // other slop in this family is read.