@jsenv/navi 0.29.320 → 0.29.322
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.
- package/dist/dev/jsenv_navi.js +39 -3
- package/dist/dev/jsenv_navi.js.map +3 -3
- package/dist/jsenv_navi.js +39 -3
- package/dist/jsenv_navi.js.map +3 -3
- package/docs/interactions.md +4 -1
- package/package.json +2 -2
package/dist/jsenv_navi.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
@@ -34956,6 +34983,8 @@ const createDisplayedEvent = (ancestor, becauseAncestorOpened) => {
|
|
|
34956
34983
|
* @returns {Function} triggerAutofocus — can be called manually with a synthetic
|
|
34957
34984
|
* event to re-run the focus logic outside of the layout-effect lifecycle.
|
|
34958
34985
|
*/
|
|
34986
|
+
const NO_ELEMENT_REF = { current: null };
|
|
34987
|
+
|
|
34959
34988
|
const useAutoFocus = (
|
|
34960
34989
|
focusableElementRef,
|
|
34961
34990
|
autoFocus,
|
|
@@ -35087,8 +35116,15 @@ const useAutoFocus = (
|
|
|
35087
35116
|
};
|
|
35088
35117
|
};
|
|
35089
35118
|
|
|
35119
|
+
// Nothing to place when the control asks for no focus ("restore" is given
|
|
35120
|
+
// focus by a transfer, never by this effect): the displayed-effect is then
|
|
35121
|
+
// handed no element at all, so it never asks the layout whether one is on
|
|
35122
|
+
// screen — a question every control in a list would otherwise ask at
|
|
35123
|
+
// mount, for an answer this hook would not use. Read at mount, like the
|
|
35124
|
+
// deps below say.
|
|
35125
|
+
const claimsFocus = Boolean(autoFocus) && autoFocus !== "restore";
|
|
35090
35126
|
useDisplayedLayoutEffect(
|
|
35091
|
-
focusableElementRef,
|
|
35127
|
+
claimsFocus ? focusableElementRef : NO_ELEMENT_REF,
|
|
35092
35128
|
(el, e) => {
|
|
35093
35129
|
return triggerAutofocus(e);
|
|
35094
35130
|
},
|