@astryxdesign/core 0.7.6 → 0.7.7-canary.0eb44a2
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/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +23 -3
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +1 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +16 -9
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +2 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +3 -2
- package/dist/Chat/ChatComposerInput.d.ts +9 -0
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +2 -0
- package/dist/Chat/ChatMessage.js +2 -2
- package/dist/Chat/chatMessage.vars.stylex.d.ts +8 -8
- package/dist/Chat/chatMessage.vars.stylex.js +8 -8
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +8 -1
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +72 -2
- package/dist/DateInput/Wheel.d.ts +17 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +179 -19
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +63 -49
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +37 -1
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +6 -0
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +4 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +20 -4
- package/dist/DropdownMenu/useMenuOverflow.d.ts +13 -3
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -1
- package/dist/DropdownMenu/useMenuOverflow.js +31 -8
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +8 -1
- package/dist/Field/textEntryTraits.d.ts +6 -6
- package/dist/Field/textEntryTraits.js +6 -6
- package/dist/Layer/layerClickBoundary.d.ts +7 -1
- package/dist/Layer/layerClickBoundary.d.ts.map +1 -1
- package/dist/Layer/layerClickBoundary.js +2 -2
- package/dist/Layer/usePressPin.d.ts +95 -0
- package/dist/Layer/usePressPin.d.ts.map +1 -0
- package/dist/Layer/usePressPin.js +365 -0
- package/dist/Layer/useTouchTrigger.d.ts +23 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +45 -7
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +2 -1
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +1 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +56 -7
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +38 -30
- package/dist/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +52 -14
- package/dist/ProgressBar/ProgressBarTouch.d.ts +29 -0
- package/dist/ProgressBar/ProgressBarTouch.d.ts.map +1 -0
- package/dist/ProgressBar/ProgressBarTouch.js +91 -0
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +2 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +25 -13
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +404 -131
- package/dist/Slider/sliderTouchController.d.ts +189 -0
- package/dist/Slider/sliderTouchController.d.ts.map +1 -0
- package/dist/Slider/sliderTouchController.js +1017 -0
- package/dist/Slider/useSliderTouch.d.ts +22 -0
- package/dist/Slider/useSliderTouch.d.ts.map +1 -0
- package/dist/Slider/useSliderTouch.js +56 -0
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +200 -46
- package/dist/Switch/switchFill.d.ts +31 -0
- package/dist/Switch/switchFill.d.ts.map +1 -0
- package/dist/Switch/switchFill.js +88 -0
- package/dist/Switch/switchTouch.d.ts +81 -0
- package/dist/Switch/switchTouch.d.ts.map +1 -0
- package/dist/Switch/switchTouch.js +133 -0
- package/dist/Switch/useSwitchTouch.d.ts +285 -0
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -0
- package/dist/Switch/useSwitchTouch.js +998 -0
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +4 -3
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +12 -5
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +3 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +17 -0
- package/dist/Tooltip/Tooltip.d.ts +30 -6
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +5 -0
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +31 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +59 -18
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +19 -9
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +26 -15
- package/dist/astryx.css +91 -8
- package/dist/gestures/GestureArena.d.ts +21 -2
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +23 -3
- package/dist/gestures/GestureHost.d.ts +123 -3
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +797 -15
- package/dist/gestures/GestureRecognizer.d.ts +15 -1
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +12 -0
- package/dist/gestures/PanGestureRecognizer.d.ts +8 -0
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PinchGestureRecognizer.d.ts +5 -1
- package/dist/gestures/PinchGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PinchGestureRecognizer.js +10 -0
- package/dist/gestures/PressTracker.d.ts +6 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +3 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +3 -3
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.js +7 -5
- package/dist/gestures/nativeScroll.d.ts +16 -2
- package/dist/gestures/nativeScroll.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.js +39 -8
- package/dist/gestures/recognizerInternals.d.ts +4 -2
- package/dist/gestures/recognizerInternals.d.ts.map +1 -1
- package/dist/gestures/types.d.ts +17 -0
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/types.js +7 -0
- package/dist/gestures/usePressTracker.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.js +1 -0
- package/dist/gestures/wheelSegmenter.d.ts +56 -0
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -0
- package/dist/gestures/wheelSegmenter.js +122 -0
- package/dist/hooks/useAttachment.d.ts +16 -8
- package/dist/hooks/useAttachment.d.ts.map +1 -1
- package/dist/hooks/useAttachment.js +35 -15
- package/dist/hooks/useFocusTrap.d.ts +15 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +13 -2
- package/dist/hooks/usePager.d.ts +261 -0
- package/dist/hooks/usePager.d.ts.map +1 -0
- package/dist/hooks/usePager.js +1169 -0
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +140 -19
- package/dist/motion/paging.d.ts +69 -0
- package/dist/motion/paging.d.ts.map +1 -0
- package/dist/motion/paging.js +148 -0
- package/dist/motion/uikit/index.d.ts +8 -4
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +8 -4
- package/dist/motion/uikit/paging.d.ts +171 -0
- package/dist/motion/uikit/paging.d.ts.map +1 -0
- package/dist/motion/uikit/paging.js +192 -0
- package/dist/motion/uikit/progressBar.d.ts +79 -0
- package/dist/motion/uikit/progressBar.d.ts.map +1 -0
- package/dist/motion/uikit/progressBar.js +102 -0
- package/dist/motion/uikit/scroll.d.ts +0 -19
- package/dist/motion/uikit/scroll.d.ts.map +1 -1
- package/dist/motion/uikit/scroll.js +2 -21
- package/dist/motion/uikit/slider.d.ts +97 -0
- package/dist/motion/uikit/slider.d.ts.map +1 -0
- package/dist/motion/uikit/slider.js +111 -0
- package/dist/motion/uikit/springs.d.ts +59 -30
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +64 -34
- package/dist/motion/uikit/switch.d.ts +166 -0
- package/dist/motion/uikit/switch.d.ts.map +1 -0
- package/dist/motion/uikit/switch.js +186 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts +18 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.js +28 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +5 -0
- package/dist/utils/selectionLock.d.ts +43 -0
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +394 -6
- package/package.json +5 -5
- package/src/AppShell/AppShell.doc.mjs +10 -0
- package/src/AppShell/AppShell.tsx +48 -2
- package/src/Avatar/Avatar.tsx +3 -1
- package/src/BottomSheet/BottomSheetPanel.tsx +16 -9
- package/src/Breadcrumbs/BreadcrumbItem.tsx +4 -1
- package/src/Button/Button.tsx +3 -2
- package/src/Chat/Chat.doc.mjs +1 -0
- package/src/Chat/ChatComposerInput.doc.mjs +11 -0
- package/src/Chat/ChatComposerInput.tsx +11 -0
- package/src/Chat/ChatMessage.tsx +2 -2
- package/src/Chat/chatMessage.vars.stylex.ts +8 -8
- package/src/CommandPalette/CommandPaletteInput.tsx +6 -0
- package/src/DateInput/MonthScroller.tsx +63 -5
- package/src/DateInput/Wheel.tsx +174 -14
- package/src/DateRangeInput/DateRangeInput.doc.mjs +3 -2
- package/src/DateRangeInput/DateRangeInput.tsx +117 -71
- package/src/Dialog/Dialog.tsx +37 -1
- package/src/Drawer/Drawer.tsx +6 -0
- package/src/Drawer/useDrawerDialogPresence.ts +4 -0
- package/src/DropdownMenu/DropdownMenu.tsx +28 -6
- package/src/DropdownMenu/useMenuOverflow.ts +44 -8
- package/src/Field/PanelSearchInput.tsx +6 -0
- package/src/Field/textEntryTraits.ts +6 -6
- package/src/Layer/layerClickBoundary.ts +2 -2
- package/src/Layer/usePressPin.ts +516 -0
- package/src/Layer/useTouchTrigger.ts +56 -6
- package/src/Lightbox/Lightbox.tsx +2 -1
- package/src/Link/Link.tsx +3 -0
- package/src/Popover/usePopover.tsx +71 -9
- package/src/PowerSearch/PowerSearch.tsx +38 -31
- package/src/ProgressBar/ProgressBar.doc.mjs +7 -5
- package/src/ProgressBar/ProgressBar.tsx +147 -16
- package/src/ProgressBar/ProgressBarTouch.ts +109 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +2 -1
- package/src/Selector/Selector.tsx +29 -2
- package/src/Slider/Slider.doc.mjs +11 -7
- package/src/Slider/Slider.tsx +539 -132
- package/src/Slider/sliderTouchController.ts +1209 -0
- package/src/Slider/useSliderTouch.ts +78 -0
- package/src/Switch/Switch.doc.mjs +3 -3
- package/src/Switch/Switch.tsx +412 -86
- package/src/Switch/switchFill.ts +106 -0
- package/src/Switch/switchTouch.ts +194 -0
- package/src/Switch/useSwitchTouch.ts +1121 -0
- package/src/TabList/Tab.tsx +5 -3
- package/src/Tokenizer/Tokenizer.tsx +15 -5
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +22 -0
- package/src/Tooltip/Tooltip.doc.mjs +21 -6
- package/src/Tooltip/Tooltip.tsx +42 -5
- package/src/Tooltip/index.ts +1 -0
- package/src/Tooltip/useTooltip.doc.mjs +4 -2
- package/src/Tooltip/useTooltip.tsx +84 -21
- package/src/Typeahead/BaseTypeahead.tsx +16 -8
- package/src/Typeahead/Typeahead.tsx +29 -15
- package/src/gestures/GestureArena.ts +45 -4
- package/src/gestures/GestureHost.ts +958 -15
- package/src/gestures/GestureRecognizer.ts +28 -0
- package/src/gestures/PanGestureRecognizer.ts +8 -0
- package/src/gestures/PinchGestureRecognizer.ts +16 -1
- package/src/gestures/PressTracker.ts +10 -0
- package/src/gestures/README.md +82 -3
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +7 -5
- package/src/gestures/nativeScroll.ts +49 -9
- package/src/gestures/recognizerInternals.ts +9 -2
- package/src/gestures/types.ts +18 -0
- package/src/gestures/usePressTracker.ts +2 -0
- package/src/gestures/wheelSegmenter.ts +143 -0
- package/src/hooks/useAttachment.ts +56 -14
- package/src/hooks/useFocusTrap.ts +26 -2
- package/src/hooks/usePager.ts +1446 -0
- package/src/motion/MEASUREMENTS.md +36 -27
- package/src/motion/README.md +7 -3
- package/src/motion/animator.ts +193 -25
- package/src/motion/paging.ts +161 -0
- package/src/motion/uikit/index.ts +7 -4
- package/src/motion/uikit/paging.ts +193 -0
- package/src/motion/uikit/progressBar.ts +102 -0
- package/src/motion/uikit/scroll.ts +2 -18
- package/src/motion/uikit/slider.ts +105 -0
- package/src/motion/uikit/springs.ts +53 -32
- package/src/motion/uikit/switch.ts +174 -0
- package/src/privateAttributes/pressHoldsDrag.stylex.ts +28 -0
- package/src/utils/pressFeedback.ts +5 -0
- package/src/utils/selectionLock.ts +501 -6
- package/dist/motion/selectPage.d.ts +0 -26
- package/dist/motion/selectPage.d.ts.map +0 -1
- package/dist/motion/selectPage.js +0 -55
- package/src/motion/selectPage.ts +0 -55
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* README.md.
|
|
27
27
|
*/
|
|
28
28
|
import type { GestureArena } from './GestureArena.js';
|
|
29
|
-
import type { GestureEnvironment, GestureEventContext, GestureState, GestureTouch, Point, PointerKind } from './types.js';
|
|
29
|
+
import type { GestureEnvironment, GestureEventContext, GestureState, GestureTouch, Point, PointerKind, ScrollType } from './types.js';
|
|
30
30
|
/**
|
|
31
31
|
* Turns text selection and the touch callout off on `elements` (and on a
|
|
32
32
|
* non-text input `target` inside one) for one held press; returns the undo.
|
|
@@ -65,6 +65,16 @@ export interface GestureRecognizerOptions<R = GestureRecognizer> {
|
|
|
65
65
|
delaysTouchesEnded?: boolean;
|
|
66
66
|
/** Pointer kinds this recognizer listens to (UIKit's `allowedTouchTypes`). @default all */
|
|
67
67
|
allowedPointerTypes?: ReadonlyArray<PointerKind>;
|
|
68
|
+
/**
|
|
69
|
+
* Scroll input this recognizer takes, as UIKit's `allowedScrollTypesMask`.
|
|
70
|
+
* A pan follows a trackpad's two-finger scroll (`continuous`), never a
|
|
71
|
+
* mouse wheel's notches. It moves as a contact with the content, along its
|
|
72
|
+
* own axis, after the scrollers under the pointer. A pinch takes a
|
|
73
|
+
* ctrl-wheel of either, as a trackpad pinches.
|
|
74
|
+
* @default none; a pinch takes both, the screen-edge pan none whatever a
|
|
75
|
+
* caller passes
|
|
76
|
+
*/
|
|
77
|
+
allowedScrollTypes?: ReadonlyArray<ScrollType>;
|
|
68
78
|
/** Ignore a touch of a different kind than the ones already tracked. @default true */
|
|
69
79
|
requiresExclusiveTouchType?: boolean;
|
|
70
80
|
/**
|
|
@@ -126,6 +136,8 @@ export declare abstract class GestureRecognizer {
|
|
|
126
136
|
delaysTouchesBegan: boolean;
|
|
127
137
|
delaysTouchesEnded: boolean;
|
|
128
138
|
allowedPointerTypes: ReadonlySet<PointerKind> | null;
|
|
139
|
+
/** See GestureRecognizerOptions.allowedScrollTypes. */
|
|
140
|
+
readonly allowedScrollTypes: ReadonlySet<ScrollType>;
|
|
129
141
|
requiresExclusiveTouchType: boolean;
|
|
130
142
|
/**
|
|
131
143
|
* The element (or any object) the recognizer is attached to. The DOM host
|
|
@@ -243,6 +255,8 @@ export declare abstract class GestureRecognizer {
|
|
|
243
255
|
protected touchBeganElsewhere(_touches: ReadonlyArray<GestureTouch>, _event: GestureEventContext): void;
|
|
244
256
|
/** Clear per-gesture state before the next attempt. */
|
|
245
257
|
protected reset(): void;
|
|
258
|
+
/** The scroll types taken when the options name none (UIKit's: none). */
|
|
259
|
+
protected get defaultScrollTypes(): ReadonlyArray<ScrollType>;
|
|
246
260
|
/**
|
|
247
261
|
* Whether a touch may join. The base checks enabled, pointer kind and
|
|
248
262
|
* exclusivity of kind; subclasses narrow it (a one-finger pan ignores a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GestureRecognizer.d.ts","sourceRoot":"","sources":["../../src/gestures/GestureRecognizer.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,WAAW,
|
|
1
|
+
{"version":3,"file":"GestureRecognizer.d.ts","sourceRoot":"","sources":["../../src/gestures/GestureRecognizer.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC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pB,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IASP,gBAAgB;IAChB,SAAS,CAAC,qBAAqB,CAC7B,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAOP,gBAAgB;IAChB,SAAS,CAAC,YAAY,CACpB,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IASP,gBAAgB;IAChB,SAAS,CAAC,YAAY,CACpB,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAcP,gBAAgB;IAChB,SAAS,CAAC,gBAAgB,CACxB,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAaP,gBAAgB;IAChB,SAAS,CAAC,qBAAqB,CAC7B,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAaP,+EAA+E;IAC/E,eAAe,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAQ;IAE5C;;;OAGG;IACH,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAWhC,4EAA4E;IAC5E,MAAM,IAAI,IAAI;IAWd,2DAA2D;IAC3D,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAsB9C,2DAA2D;IAC3D,SAAS,CAAC,eAAe,IAAI,IAAI;CAQlC"}
|
|
@@ -91,6 +91,8 @@ export class GestureRecognizer {
|
|
|
91
91
|
|
|
92
92
|
/** See GestureRecognizerOptions.selectionLock. */
|
|
93
93
|
|
|
94
|
+
/** See GestureRecognizerOptions.allowedScrollTypes. */
|
|
95
|
+
|
|
94
96
|
/**
|
|
95
97
|
* The element (or any object) the recognizer is attached to. The DOM host
|
|
96
98
|
* sets it; the arena treats it as opaque.
|
|
@@ -131,6 +133,7 @@ export class GestureRecognizer {
|
|
|
131
133
|
this.delaysTouchesBegan = options.delaysTouchesBegan ?? false;
|
|
132
134
|
this.delaysTouchesEnded = options.delaysTouchesEnded ?? true;
|
|
133
135
|
this.allowedPointerTypes = options.allowedPointerTypes == null ? null : new Set(options.allowedPointerTypes);
|
|
136
|
+
this.allowedScrollTypes = new Set(options.allowedScrollTypes ?? this.defaultScrollTypes);
|
|
134
137
|
this.requiresExclusiveTouchType = options.requiresExclusiveTouchType ?? true;
|
|
135
138
|
}
|
|
136
139
|
|
|
@@ -335,6 +338,11 @@ export class GestureRecognizer {
|
|
|
335
338
|
/** Clear per-gesture state before the next attempt. */
|
|
336
339
|
reset() {}
|
|
337
340
|
|
|
341
|
+
/** The scroll types taken when the options name none (UIKit's: none). */
|
|
342
|
+
get defaultScrollTypes() {
|
|
343
|
+
return [];
|
|
344
|
+
}
|
|
345
|
+
|
|
338
346
|
/**
|
|
339
347
|
* Whether a touch may join. The base checks enabled, pointer kind and
|
|
340
348
|
* exclusivity of kind; subclasses narrow it (a one-finger pan ignores a
|
|
@@ -344,6 +352,10 @@ export class GestureRecognizer {
|
|
|
344
352
|
if (!this.isEnabled) {
|
|
345
353
|
return false;
|
|
346
354
|
}
|
|
355
|
+
if (touch.scrollType != null) {
|
|
356
|
+
// Scroll input is no pointer: only the scroll types allowed count.
|
|
357
|
+
return this.allowedScrollTypes.has(touch.scrollType) && (this.options.shouldReceiveTouch?.(this, touch) ?? true);
|
|
358
|
+
}
|
|
347
359
|
if (this.allowedPointerTypes != null && !this.allowedPointerTypes.has(touch.pointerType)) {
|
|
348
360
|
return false;
|
|
349
361
|
}
|
|
@@ -24,6 +24,14 @@ export interface PanGestureRecognizerOptions extends GestureRecognizerOptions<Pa
|
|
|
24
24
|
* at the start only (UIScrollView's directional lock).
|
|
25
25
|
*/
|
|
26
26
|
lockAxis?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A trackpad's two-finger scroll (`continuous`) drives the pan where its
|
|
29
|
+
* owner allows it. It moves as a contact with the content, along its own
|
|
30
|
+
* axis, after the scrollers under the pointer. A mouse wheel's notches
|
|
31
|
+
* never drive a pan; they scroll what is under the pointer.
|
|
32
|
+
* @default [] (none)
|
|
33
|
+
*/
|
|
34
|
+
allowedScrollTypes?: ReadonlyArray<'continuous'>;
|
|
27
35
|
/** Begin only when the native scrollers under the touch are at the edge. */
|
|
28
36
|
scrollEdge?: boolean;
|
|
29
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanGestureRecognizer.d.ts","sourceRoot":"","sources":["../../src/gestures/PanGestureRecognizer.ts"],"names":[],"mappings":"AAuCA,OAAO,EAEL,iBAAiB,EAEjB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,mBAAmB,EAAE,YAAY,EAAE,KAAK,EAAC,MAAM,SAAS,CAAC;AAGtE,MAAM,MAAM,YAAY,GACtB,KAAK,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;AAEvE,MAAM,WAAW,2BAA4B,SAAQ,wBAAwB,CAAC,oBAAoB,CAAC;IACjG,iBAAiB;IACjB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAWD,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,IAAa,IAAI,IAAI,iBAAiB,CAAC,MA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;;;OAIG;IACH,cAAc,IAAI,KAAK;IAQvB;;;;;;;OAOG;IACH,IAAa,mBAAmB,IAAI,mBAAmB,CAkBtD;cAEkB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;cAW1C,YAAY,CAC7B,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;cAmBY,YAAY,CAC7B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EACrC,KAAK,EAAE,mBAAmB,GACzB,IAAI;cASY,YAAY,CAC7B,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI;cAoBY,KAAK,IAAI,IAAI;IAWhC;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM;IAoBjE,OAAO,CAAC,QAAQ;IAsChB;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa;IAUrB;;;;;;;OAOG;cACgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAsBvD,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,KAAK;IAWb,kEAAkE;IAClE,OAAO,CAAC,MAAM;IAad,OAAO,CAAC,MAAM;CASf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GestureRecognizer, type GestureRecognizerOptions, type NativeTouchBehavior } from './GestureRecognizer.js';
|
|
2
|
-
import type { GestureEventContext, GestureTouch, Point } from './types.js';
|
|
2
|
+
import type { GestureEventContext, GestureTouch, Point, ScrollType } from './types.js';
|
|
3
3
|
export interface PinchGestureRecognizerOptions extends GestureRecognizerOptions<PinchGestureRecognizer> {
|
|
4
4
|
hysteresis?: number;
|
|
5
5
|
}
|
|
@@ -12,6 +12,10 @@ export declare class PinchGestureRecognizer extends GestureRecognizer {
|
|
|
12
12
|
/** The lift's event time, for the stillness reset. */
|
|
13
13
|
private liftTime;
|
|
14
14
|
constructor(options?: PinchGestureRecognizerOptions);
|
|
15
|
+
/** @internal The host's brand: a ctrl-wheel drives a pinch (recognizerInternals). */
|
|
16
|
+
protected get family(): 'pinch';
|
|
17
|
+
/** A ctrl-wheel drives a pinch, from a trackpad or a mouse. */
|
|
18
|
+
protected get defaultScrollTypes(): ReadonlyArray<ScrollType>;
|
|
15
19
|
/** Current span over the span the fingers started at. */
|
|
16
20
|
get scale(): number;
|
|
17
21
|
/** Re-base: from now on the scale reads `value` at the current span. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinchGestureRecognizer.d.ts","sourceRoot":"","sources":["../../src/gestures/PinchGestureRecognizer.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,iBAAiB,EAEjB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PinchGestureRecognizer.d.ts","sourceRoot":"","sources":["../../src/gestures/PinchGestureRecognizer.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,iBAAiB,EAEjB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,KAAK,EACL,UAAU,EACX,MAAM,SAAS,CAAC;AAGjB,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IACrG,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,sBAAuB,SAAQ,iBAAiB;IAC3D,IAAa,IAAI,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAE7C;IAED,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,sDAAsD;IACtD,OAAO,CAAC,QAAQ,CAAqB;gBAEzB,OAAO,GAAE,6BAAkC;IAKvD,qFAAqF;IACrF,SAAS,KAAK,MAAM,IAAI,OAAO,CAE9B;IAED,+DAA+D;IAC/D,cAAuB,kBAAkB,IAAI,aAAa,CAAC,UAAU,CAAC,CAErE;IAED,yDAAyD;IACzD,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,wEAAwE;IACxE,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAUtB;IAED,0EAA0E;IAC1E,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,4CAA4C;IAC5C,UAAU,IAAI,KAAK;IAInB,8EAA8E;IAC9E,IAAa,mBAAmB,IAAI,mBAAmB,CAEtD;cAEkB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;cAI1C,YAAY,CAC7B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EACrC,KAAK,EAAE,mBAAmB,GACzB,IAAI;cASY,YAAY,CAC7B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EACrC,KAAK,EAAE,mBAAmB,GACzB,IAAI;cA4BY,YAAY,CAC7B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EACrC,KAAK,EAAE,mBAAmB,GACzB,IAAI;cAKY,KAAK,IAAI,IAAI;IAOhC,OAAO,CAAC,IAAI;CAIb"}
|
|
@@ -37,6 +37,16 @@ export class PinchGestureRecognizer extends GestureRecognizer {
|
|
|
37
37
|
this.hysteresis = options.hysteresis ?? UIKIT_PINCH.hysteresis.value;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/** @internal The host's brand: a ctrl-wheel drives a pinch (recognizerInternals). */
|
|
41
|
+
get family() {
|
|
42
|
+
return 'pinch';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** A ctrl-wheel drives a pinch, from a trackpad or a mouse. */
|
|
46
|
+
get defaultScrollTypes() {
|
|
47
|
+
return ['continuous', 'discrete'];
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
/** Current span over the span the fingers started at. */
|
|
41
51
|
get scale() {
|
|
42
52
|
return this.scaleValue;
|
|
@@ -32,6 +32,12 @@ export interface PressTrackerOptions {
|
|
|
32
32
|
* does nothing passes none. @default undefined
|
|
33
33
|
*/
|
|
34
34
|
selectionLock?: SelectionLock;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the press of `touchId` holds the browser's context menu closed
|
|
37
|
+
* now; the host then cancels it. For a control whose hold acts, such as a
|
|
38
|
+
* switch. @default undefined
|
|
39
|
+
*/
|
|
40
|
+
holdsContextMenu?: (touchId: number) => boolean;
|
|
35
41
|
trackingExpansion?: number;
|
|
36
42
|
/**
|
|
37
43
|
* When the highlight waits `contentTouchDelay`: inside a scroller (a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PressTracker.d.ts","sourceRoot":"","sources":["../../src/gestures/PressTracker.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAE1E,OAAO,KAAK,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAEzD,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,aAAa,CAAC;AAElB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,SAAS,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACpC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAA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AAElD,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,cAAc,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAMtE;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,wCAAwC;IACxC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC;IACrB,wBAAwB,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC;IACvD,6EAA6E;IAC7E,OAAO,IAAI,IAAI,CAAC;IAChB;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;CACnD;AAED,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAyN7E"}
|
|
@@ -177,6 +177,9 @@ export function createPressTracker(options) {
|
|
|
177
177
|
isEnabled() {
|
|
178
178
|
return options.isEnabled?.() !== false;
|
|
179
179
|
},
|
|
180
|
+
holdsContextMenu(id) {
|
|
181
|
+
return options.holdsContextMenu?.(id) === true;
|
|
182
|
+
},
|
|
180
183
|
touchBegan(touch) {
|
|
181
184
|
if (touchId != null || options.isEnabled?.() === false ||
|
|
182
185
|
// The scroll brake is a finger's (`spec:AST-094` FR11, DEC-21).
|
|
@@ -9,10 +9,10 @@ export type ScreenEdge = 'leading' | 'trailing';
|
|
|
9
9
|
/** A physical horizontal edge of the viewport. */
|
|
10
10
|
type PhysicalEdge = 'left' | 'right';
|
|
11
11
|
/**
|
|
12
|
-
* A screen-edge pan is a finger's: it takes no `allowedPointerTypes`
|
|
13
|
-
*
|
|
12
|
+
* A screen-edge pan is a finger's: it takes no `allowedPointerTypes` and no
|
|
13
|
+
* `allowedScrollTypes`, so neither a mouse, a trackpad nor a pen drives it.
|
|
14
14
|
*/
|
|
15
|
-
export interface ScreenEdgePanGestureRecognizerOptions extends Omit<PanGestureRecognizerOptions, 'direction' | 'allowedPointerTypes'> {
|
|
15
|
+
export interface ScreenEdgePanGestureRecognizerOptions extends Omit<PanGestureRecognizerOptions, 'direction' | 'allowedPointerTypes' | 'allowedScrollTypes'> {
|
|
16
16
|
/** The edges a touch may start from. @default ['leading'] */
|
|
17
17
|
edges?: ReadonlyArray<ScreenEdge>;
|
|
18
18
|
/** Width of the band at each edge, px. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenEdgePanGestureRecognizer.d.ts","sourceRoot":"","sources":["../../src/gestures/ScreenEdgePanGestureRecognizer.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAmB,KAAK,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,KAAK,2BAA2B,EACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAC,mBAAmB,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAS/D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAEhD,kDAAkD;AAClD,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAarC;;;GAGG;AACH,MAAM,WAAW,qCAAsC,SAAQ,IAAI,CACjE,2BAA2B,EAC3B,WAAW,GAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ScreenEdgePanGestureRecognizer.d.ts","sourceRoot":"","sources":["../../src/gestures/ScreenEdgePanGestureRecognizer.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAmB,KAA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AAI;IAiCP;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ;cAyBG,KAAK,IAAI,IAAI;IAKhC,OAAO,CAAC,MAAM;CAaf"}
|
|
@@ -59,8 +59,8 @@ const EDGE_ZONE_TOLERANCE = 0.5;
|
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* A screen-edge pan is a finger's: it takes no `allowedPointerTypes`
|
|
63
|
-
*
|
|
62
|
+
* A screen-edge pan is a finger's: it takes no `allowedPointerTypes` and no
|
|
63
|
+
* `allowedScrollTypes`, so neither a mouse, a trackpad nor a pen drives it.
|
|
64
64
|
*/
|
|
65
65
|
|
|
66
66
|
export class ScreenEdgePanGestureRecognizer extends PanGestureRecognizer {
|
|
@@ -84,9 +84,11 @@ export class ScreenEdgePanGestureRecognizer extends PanGestureRecognizer {
|
|
|
84
84
|
maximumNumberOfTouches: 1,
|
|
85
85
|
hysteresis: UIKIT_SCREEN_EDGE_PAN.hysteresis.value,
|
|
86
86
|
...options,
|
|
87
|
-
// A finger's only:
|
|
88
|
-
// pan stays off
|
|
89
|
-
|
|
87
|
+
// A finger's only (`spec:AST-094` FR43). Under a mouse, a trackpad or
|
|
88
|
+
// a pen, the screen-edge pan stays off, whatever a caller passes. It
|
|
89
|
+
// takes no wheel or trackpad scrolling.
|
|
90
|
+
allowedPointerTypes: ['touch'],
|
|
91
|
+
allowedScrollTypes: []
|
|
90
92
|
});
|
|
91
93
|
this.edges = options.edges ?? ['leading'];
|
|
92
94
|
this.edgeRegion = options.edgeRegion ?? UIKIT_SCREEN_EDGE_PAN.edgeRegion.value;
|
|
@@ -7,6 +7,20 @@ export interface AllowedPans {
|
|
|
7
7
|
}
|
|
8
8
|
/** Which pans a `touch-action` value lets the browser perform. */
|
|
9
9
|
export declare function parseTouchAction(value: string): AllowedPans;
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Whether `element` itself scrolls natively now for a finger moving by
|
|
12
|
+
* (dx, dy). It uses the probe's own test of each scroller: overflow that
|
|
13
|
+
* scrolls on that axis, and room past the edge tolerance. The position must
|
|
14
|
+
* also be short of the end it moves toward, a right-to-left range included.
|
|
15
|
+
* A wheel moves the content the other way, so pass its deltas negated.
|
|
16
|
+
*/
|
|
17
|
+
export declare function canElementScroll(element: Element, dx: number, dy: number): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A probe of the native scrollers under `target`. A wheel scrolls whatever
|
|
20
|
+
* `touch-action` says, which narrows only a finger's pan: a wheel's probe
|
|
21
|
+
* passes `readsTouchAction: false`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createNativeScrollProbe(target: unknown, { readsTouchAction }?: {
|
|
24
|
+
readsTouchAction?: boolean;
|
|
25
|
+
}): NativeScrollProbe;
|
|
12
26
|
//# sourceMappingURL=nativeScroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeScroll.d.ts","sourceRoot":"","sources":["../../src/gestures/nativeScroll.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nativeScroll.d.ts","sourceRoot":"","sources":["../../src/gestures/nativeScroll.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAC,kBAAkB,EAAC,CAAC;AAE5B,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAiB3D;AA+JD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT,OAAO,CAcT;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,EAAC,gBAAuB,EAAC,GAAE;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAM,GAC3D,iBAAiB,CAiDnB"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @file nativeScroll.ts
|
|
5
5
|
* @input An element a touch landed on
|
|
6
6
|
* @output Exports createNativeScrollProbe (the NativeScrollProbe a host gives
|
|
7
|
-
* each touch
|
|
7
|
+
* each touch, and each wheel gesture without the touch-action narrowing)
|
|
8
|
+
* and parseTouchAction
|
|
8
9
|
* @position DOM half of the scroll coordination in packages/core/src/gestures
|
|
9
10
|
*
|
|
10
11
|
* Answers one question for a recognizer without letting it touch the DOM:
|
|
@@ -52,7 +53,7 @@ export function parseTouchAction(value) {
|
|
|
52
53
|
}
|
|
53
54
|
const SCROLLABLE = new Set(['auto', 'scroll', 'overlay']);
|
|
54
55
|
const EDGE_TOLERANCE = 1;
|
|
55
|
-
function buildChain(target) {
|
|
56
|
+
function buildChain(target, readsTouchAction) {
|
|
56
57
|
const doc = target.ownerDocument;
|
|
57
58
|
const view = doc.defaultView;
|
|
58
59
|
if (view == null) {
|
|
@@ -72,9 +73,11 @@ function buildChain(target) {
|
|
|
72
73
|
continue;
|
|
73
74
|
}
|
|
74
75
|
const style = view.getComputedStyle(node);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
if (readsTouchAction) {
|
|
77
|
+
const pans = parseTouchAction(style.touchAction || 'auto');
|
|
78
|
+
allowX &&= pans.x;
|
|
79
|
+
allowY &&= pans.y;
|
|
80
|
+
}
|
|
78
81
|
const isRoot = node === root || node === doc.documentElement;
|
|
79
82
|
if (isRoot) {
|
|
80
83
|
reachedRoot = true;
|
|
@@ -173,11 +176,39 @@ function canMoveX(entry, dx) {
|
|
|
173
176
|
return dx > 0 ? element.scrollLeft > min + EDGE_TOLERANCE - 0.5 : element.scrollLeft < max - EDGE_TOLERANCE + 0.5;
|
|
174
177
|
}
|
|
175
178
|
|
|
176
|
-
/**
|
|
177
|
-
|
|
179
|
+
/**
|
|
180
|
+
* Whether `element` itself scrolls natively now for a finger moving by
|
|
181
|
+
* (dx, dy). It uses the probe's own test of each scroller: overflow that
|
|
182
|
+
* scrolls on that axis, and room past the edge tolerance. The position must
|
|
183
|
+
* also be short of the end it moves toward, a right-to-left range included.
|
|
184
|
+
* A wheel moves the content the other way, so pass its deltas negated.
|
|
185
|
+
*/
|
|
186
|
+
export function canElementScroll(element, dx, dy) {
|
|
187
|
+
const view = element.ownerDocument.defaultView;
|
|
188
|
+
if (view == null) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
const style = view.getComputedStyle(element);
|
|
192
|
+
if (dy !== 0 && SCROLLABLE.has(style.overflowY) && canMoveY(element, dy)) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
return dx !== 0 && SCROLLABLE.has(style.overflowX) && canMoveX({
|
|
196
|
+
element,
|
|
197
|
+
isRtl: isRtlElement(element)
|
|
198
|
+
}, dx);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* A probe of the native scrollers under `target`. A wheel scrolls whatever
|
|
203
|
+
* `touch-action` says, which narrows only a finger's pan: a wheel's probe
|
|
204
|
+
* passes `readsTouchAction: false`.
|
|
205
|
+
*/
|
|
206
|
+
export function createNativeScrollProbe(target, {
|
|
207
|
+
readsTouchAction = true
|
|
208
|
+
} = {}) {
|
|
178
209
|
let chain = null;
|
|
179
210
|
const getChain = () => {
|
|
180
|
-
chain ??= target instanceof Element ? buildChain(target) : {
|
|
211
|
+
chain ??= target instanceof Element ? buildChain(target, readsTouchAction) : {
|
|
181
212
|
entries: [],
|
|
182
213
|
allowsPan: false
|
|
183
214
|
};
|
|
@@ -17,18 +17,20 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import type { GestureArena } from './GestureArena.js';
|
|
19
19
|
import type { GestureRecognizer } from './GestureRecognizer.js';
|
|
20
|
-
import type { GestureEventContext, GestureState, GestureTouch } from './types.js';
|
|
20
|
+
import type { GestureEventContext, GestureState, GestureTouch, Point } from './types.js';
|
|
21
21
|
/**
|
|
22
22
|
* The kinds of recognizer the host and touch-action treat specially. Each of
|
|
23
23
|
* those classes brands itself (a subclass inherits the brand), so the host
|
|
24
24
|
* never imports a recognizer class: a page ships only the recognizers it
|
|
25
25
|
* constructs.
|
|
26
26
|
*/
|
|
27
|
-
export type RecognizerFamily = 'tap' | 'longPress' | 'pan';
|
|
27
|
+
export type RecognizerFamily = 'tap' | 'longPress' | 'pan' | 'pinch';
|
|
28
28
|
/** The members of a recognizer only the gesture system calls. */
|
|
29
29
|
export interface RecognizerInternals {
|
|
30
30
|
/** The recognizer's family, when the host treats it specially. */
|
|
31
31
|
readonly family?: RecognizerFamily;
|
|
32
|
+
/** A pan's direction rule for a translation, `axisRatio` included. */
|
|
33
|
+
classify?(translation: Point): 'begin' | 'fail' | 'wait';
|
|
32
34
|
arena: GestureArena | null;
|
|
33
35
|
pending: 'began' | 'ended' | null;
|
|
34
36
|
readonly seenTouchIds: Set<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizerInternals.d.ts","sourceRoot":"","sources":["../../src/gestures/recognizerInternals.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"recognizerInternals.d.ts","sourceRoot":"","sources":["../../src/gestures/recognizerInternals.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAC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AAgB,CACd,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI,CAAC;IACR,qBAAqB,CACnB,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,EACpC,KAAK,EAAE,mBAAmB,GACzB,IAAI,CAAC;IACR,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IACrC,eAAe,IAAI,IAAI,CAAC;CACzB;AAED,iDAAiD;AACjD,wBAAgB,SAAS,CAAC,UAAU,EAAE,iBAAiB,GAAG,mBAAmB,CAE5E"}
|
package/dist/gestures/types.d.ts
CHANGED
|
@@ -14,6 +14,13 @@ import type { SelectionLock } from './GestureRecognizer.js';
|
|
|
14
14
|
export type GestureState = 'possible' | 'began' | 'changed' | 'ended' | 'cancelled' | 'failed';
|
|
15
15
|
/** What made the contact. A pen on an iPad is `pen`, not `touch`. */
|
|
16
16
|
export type PointerKind = 'touch' | 'mouse' | 'pen';
|
|
17
|
+
/**
|
|
18
|
+
* Scroll input a recognizer can take, as UIKit's `UIScrollTypeMask`: a
|
|
19
|
+
* trackpad's two-finger scroll or pinch (`continuous`), or a mouse wheel's
|
|
20
|
+
* notches (`discrete`). A pan takes only a trackpad's; a pinch takes a
|
|
21
|
+
* ctrl-wheel of either.
|
|
22
|
+
*/
|
|
23
|
+
export type ScrollType = 'continuous' | 'discrete';
|
|
17
24
|
export interface Point {
|
|
18
25
|
readonly x: number;
|
|
19
26
|
readonly y: number;
|
|
@@ -74,6 +81,8 @@ export interface GestureTouch {
|
|
|
74
81
|
readonly target: unknown;
|
|
75
82
|
/** The native scrollers under the contact, when the host knows them. */
|
|
76
83
|
readonly scroll: NativeScrollProbe | null;
|
|
84
|
+
/** Set for a wheel's or a trackpad's scroll input, which is no contact. */
|
|
85
|
+
readonly scrollType?: ScrollType;
|
|
77
86
|
/** The browser took this contact for its own pan or zoom. */
|
|
78
87
|
takenByBrowser: boolean;
|
|
79
88
|
}
|
|
@@ -91,6 +100,8 @@ export interface TouchBeganInput extends TouchInput {
|
|
|
91
100
|
readonly pointerType: PointerKind;
|
|
92
101
|
readonly target: unknown;
|
|
93
102
|
readonly scroll?: NativeScrollProbe | null;
|
|
103
|
+
/** Set for a wheel's or a trackpad's scroll input. */
|
|
104
|
+
readonly scrollType?: ScrollType;
|
|
94
105
|
}
|
|
95
106
|
/** What a recognizer is told alongside the touches that changed. */
|
|
96
107
|
export interface GestureEventContext {
|
|
@@ -156,6 +167,12 @@ export interface TouchConsumer {
|
|
|
156
167
|
* undefined and keeps the browser's long-press selection.
|
|
157
168
|
*/
|
|
158
169
|
readonly selectionLock?: SelectionLock;
|
|
170
|
+
/**
|
|
171
|
+
* Whether this touch's press holds the browser's context menu closed now.
|
|
172
|
+
* A control whose hold acts uses it (a switch's hold toggles it). The host
|
|
173
|
+
* then cancels the menu, as for a claimed touch.
|
|
174
|
+
*/
|
|
175
|
+
holdsContextMenu?(touchId: number): boolean;
|
|
159
176
|
/**
|
|
160
177
|
* Whether the consumer takes touches now (a disabled control does not).
|
|
161
178
|
* The host listens only while something enabled is attached
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/gestures/types.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,YAAY,GACtB,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEtE,qEAAqE;AACrE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAEpD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,C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,GAAG,IAAI,CAAC;IAC1C;;;;OAIG;IACH,wBAAwB,CAAC,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC;IACxD;;;;;;OAMG;IACH,UAAU,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5C;;;;;OAKG;IACH,SAAS,CAAC,IAAI,OAAO,CAAC;CACvB"}
|
package/dist/gestures/types.js
CHANGED
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
/** What made the contact. A pen on an iPad is `pen`, not `touch`. */
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Scroll input a recognizer can take, as UIKit's `UIScrollTypeMask`: a
|
|
21
|
+
* trackpad's two-finger scroll or pinch (`continuous`), or a mouse wheel's
|
|
22
|
+
* notches (`discrete`). A pan takes only a trackpad's; a pinch takes a
|
|
23
|
+
* ctrl-wheel of either.
|
|
24
|
+
*/
|
|
25
|
+
|
|
19
26
|
/** One position of a contact at one instant, in client (viewport) CSS px. */
|
|
20
27
|
|
|
21
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePressTracker.d.ts","sourceRoot":"","sources":["../../src/gestures/usePressTracker.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA4B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAIhE,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAQxB,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,mBAAmB,EACnB,WAAW,GAAG,MAAM,CACrB,GAAG;IACF;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,EAC9B,OAAO,GAAE,sBAA2B,GACnC,YAAY,
|
|
1
|
+
{"version":3,"file":"usePressTracker.d.ts","sourceRoot":"","sources":["../../src/gestures/usePressTracker.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA4B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAIhE,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAQxB,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,mBAAmB,EACnB,WAAW,GAAG,MAAM,CACrB,GAAG;IACF;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,EAC9B,OAAO,GAAE,sBAA2B,GACnC,YAAY,CA0Jd"}
|
|
@@ -100,6 +100,7 @@ export function usePressTracker(ref, options = {}) {
|
|
|
100
100
|
// The caller's veto, read on every touch, else the tracker's own.
|
|
101
101
|
vetoesAncestorRecognizer: recognizer => (optionsRef.current.vetoesAncestorRecognizer ?? vetoesSingleTap)(recognizer),
|
|
102
102
|
isEnabled: () => optionsRef.current.isEnabled?.() ?? true,
|
|
103
|
+
holdsContextMenu: id => optionsRef.current.holdsContextMenu?.(id) === true,
|
|
103
104
|
// The caller's brake, or the host's: a touch that stops a flick
|
|
104
105
|
// presses nothing, as a UIKit control in a decelerating scroll view.
|
|
105
106
|
isBraking: touch => {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file wheelSegmenter.ts
|
|
3
|
+
* @input A wheel stream's deltas along one axis, with their event times
|
|
4
|
+
* @output Exports WheelSegmenter and isBunched. WheelSegmenter splits the
|
|
5
|
+
* stream into gestures and reads a trackpad's lift (the onset of momentum).
|
|
6
|
+
* isBunched tells one stall's merge from a frame.
|
|
7
|
+
* @position Read by GestureHost.ts's wheel input: the web reports no
|
|
8
|
+
* trackpad contact or phase, so both are inferred.
|
|
9
|
+
*/
|
|
10
|
+
export type WheelBoundary = 'first' | 'idle' | 'reversal' | 'jump' | 'gap';
|
|
11
|
+
export type WheelPhase = 'finger' | 'momentum';
|
|
12
|
+
export interface WheelSegment {
|
|
13
|
+
/** Why this event starts a new gesture, or null when it continues one. */
|
|
14
|
+
readonly boundary: WheelBoundary | null;
|
|
15
|
+
readonly phase: WheelPhase;
|
|
16
|
+
/** The gesture's number, counting from 1. */
|
|
17
|
+
readonly gesture: number;
|
|
18
|
+
/** This event is where the fingers lifted (momentum begins with it). */
|
|
19
|
+
readonly liftNow: boolean;
|
|
20
|
+
/** This event shrank, so it may be momentum: hold it until known. */
|
|
21
|
+
readonly decaying: boolean;
|
|
22
|
+
/** This event came so soon after the one before that it is a merge. */
|
|
23
|
+
readonly bunched: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether a wheel `intervalMs` after the one before is one stall's merge, not
|
|
27
|
+
* a frame. A stalled page receives the wheels it held back together, within
|
|
28
|
+
* 1.5 ms of each other. The rule reads no history, so slow wheels never make
|
|
29
|
+
* a real frame look like a merge.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isBunched(intervalMs: number): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* A trackpad gesture has a finger phase and, after a fling, a momentum phase.
|
|
34
|
+
* In the finger phase, deltas come while the fingers move, with pauses when
|
|
35
|
+
* they move slowly. In the momentum phase, deltas come at frame rate and
|
|
36
|
+
* shrink smoothly. The lift is the start of a run of shrinking deltas that
|
|
37
|
+
* has lost a fifth of its size. In the finger phase, a pause of `idleMs`
|
|
38
|
+
* ends the gesture. In the momentum phase, a reversal, a jump up against the
|
|
39
|
+
* decay, or a pause of 50 ms starts a new gesture. A bunched wheel is never
|
|
40
|
+
* a jump. The decay reads it by its last step. Momentum never pauses,
|
|
41
|
+
* reverses or grows.
|
|
42
|
+
*/
|
|
43
|
+
export declare class WheelSegmenter {
|
|
44
|
+
gesture: number;
|
|
45
|
+
phase: WheelPhase;
|
|
46
|
+
private last;
|
|
47
|
+
private previous;
|
|
48
|
+
private sign;
|
|
49
|
+
private count;
|
|
50
|
+
private run;
|
|
51
|
+
private runStart;
|
|
52
|
+
push(time: number, delta: number, idleMs: number): WheelSegment;
|
|
53
|
+
/** The gesture ended on its own (its timer): the next event starts one. */
|
|
54
|
+
end(): void;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=wheelSegmenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wheelSegmenter.d.ts","sourceRoot":"","sources":["../../src/gestures/wheelSegmenter.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAcD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,cAAc;IACzB,OAAO,SAA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