@astryxdesign/core 0.7.7-canary.550ff21 → 0.7.7-canary.58c5b8a
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/AlertDialog/AlertDialog.d.ts +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +36 -6
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +13 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.js +45 -0
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +1 -1
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +79 -9
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +23 -4
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +5 -4
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +2 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +9 -4
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +50 -5
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +7 -1
- package/dist/CheckboxList/CheckboxListContext.d.ts +6 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +10 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +13 -27
- package/dist/DateInput/Wheel.d.ts +17 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +161 -20
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +63 -49
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +53 -15
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +15 -11
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +20 -4
- package/dist/Field/Field.js +2 -2
- package/dist/Field/PanelSearchInput.d.ts +9 -1
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +3 -1
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +27 -2
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/InfoTip/InfoTip.d.ts +63 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -0
- package/dist/InfoTip/InfoTip.js +126 -0
- package/dist/InfoTip/index.d.ts +10 -0
- package/dist/InfoTip/index.d.ts.map +1 -0
- package/dist/InfoTip/index.js +12 -0
- package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +25 -20
- 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/useBackdropPress.d.ts +27 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -0
- package/dist/Layer/useBackdropPress.js +53 -0
- package/dist/Layer/usePressPin.d.ts +105 -0
- package/dist/Layer/usePressPin.d.ts.map +1 -0
- package/dist/Layer/usePressPin.js +413 -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/MobileNav/MobileNav.js +0 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +2 -4
- package/dist/Outline/Outline.d.ts +2 -4
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -52
- package/dist/Outline/useOutlineFromMarkdown.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromMarkdown.js +1 -0
- package/dist/Outline/useScrollSpy.js +3 -3
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +56 -7
- package/dist/PowerSearch/PowerSearch.d.ts +36 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +571 -302
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
- package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +11 -1
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +160 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +33 -6
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +8 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +118 -260
- package/dist/Resizable/resizeGesture.d.ts +91 -0
- package/dist/Resizable/resizeGesture.d.ts.map +1 -0
- package/dist/Resizable/resizeGesture.js +251 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +3 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +115 -8
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +6 -0
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -0
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +10 -2
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +357 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +1349 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +70 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +264 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +96 -67
- package/dist/Selector/optionShape.d.ts +24 -0
- package/dist/Selector/optionShape.d.ts.map +1 -0
- package/dist/Selector/optionShape.js +48 -0
- package/dist/Selector/selectableOptionEntries.d.ts +20 -0
- package/dist/Selector/selectableOptionEntries.d.ts.map +1 -0
- package/dist/Selector/selectableOptionEntries.js +38 -0
- package/dist/Selector/utils.d.ts +2 -17
- package/dist/Selector/utils.d.ts.map +1 -1
- package/dist/Selector/utils.js +3 -51
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -9
- package/dist/Slider/sliderTouchController.js +2 -2
- 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 +74 -0
- package/dist/Switch/switchTouch.d.ts.map +1 -0
- package/dist/Switch/switchTouch.js +125 -0
- package/dist/Switch/useSwitchTouch.d.ts +276 -0
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -0
- package/dist/Switch/useSwitchTouch.js +939 -0
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +4 -3
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +10 -7
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +5 -0
- package/dist/Token/Token.d.ts +2 -2
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +13 -4
- package/dist/Token/TokenNamingContext.d.ts +14 -0
- package/dist/Token/TokenNamingContext.d.ts.map +1 -0
- package/dist/Token/TokenNamingContext.js +23 -0
- package/dist/Tokenizer/Tokenizer.d.ts +46 -59
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +44 -60
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +25 -28
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +157 -54
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +3 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +19 -0
- package/dist/Tooltip/Tooltip.d.ts +24 -5
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +29 -5
- package/dist/Tooltip/useTooltip.d.ts +48 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +90 -20
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +4 -7
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +4 -7
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -7
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +26 -15
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +142 -7
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +161 -22
- 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/types.d.ts +6 -0
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.js +1 -0
- package/dist/gestures/wheelSegmenter.d.ts +14 -3
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +32 -8
- package/dist/hooks/actionGroupTracker.d.ts +7 -4
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +19 -56
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -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/useHighlightedOptionScroll.d.ts +11 -1
- package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
- package/dist/hooks/useHighlightedOptionScroll.js +112 -11
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +7 -4
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +4 -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/i18n/generated-english/InfoTip/InfoTip.generated.d.ts +8 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.js +12 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.js +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.js +7 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +33 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +33 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/internal/SheetConfirmation.d.ts +11 -0
- package/dist/internal/SheetConfirmation.d.ts.map +1 -0
- package/dist/internal/SheetConfirmation.js +92 -0
- package/dist/internal/sheetDraft.d.ts +35 -0
- package/dist/internal/sheetDraft.d.ts.map +1 -0
- package/dist/internal/sheetDraft.js +65 -0
- package/dist/internal/touch-sheet.d.ts +21 -0
- package/dist/internal/touch-sheet.d.ts.map +1 -0
- package/dist/internal/touch-sheet.js +19 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts +24 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts.map +1 -0
- package/dist/internal/useDismissSearchOnTouchDrag.js +56 -0
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +41 -18
- package/dist/motion/paging.d.ts +16 -5
- package/dist/motion/paging.d.ts.map +1 -1
- package/dist/motion/paging.js +34 -14
- package/dist/motion/reducedMotion.d.ts +24 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +78 -1
- package/dist/motion/roles.d.ts +7 -1
- package/dist/motion/roles.d.ts.map +1 -1
- package/dist/motion/roles.js +20 -1
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/motion/uikit/index.d.ts +7 -4
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +7 -4
- package/dist/motion/uikit/paging.d.ts +31 -20
- package/dist/motion/uikit/paging.d.ts.map +1 -1
- package/dist/motion/uikit/paging.js +41 -11
- package/dist/motion/uikit/progressBar.d.ts +27 -7
- package/dist/motion/uikit/progressBar.d.ts.map +1 -1
- package/dist/motion/uikit/progressBar.js +31 -11
- package/dist/motion/uikit/segmented.d.ts +55 -0
- package/dist/motion/uikit/segmented.d.ts.map +1 -0
- package/dist/motion/uikit/segmented.js +77 -0
- package/dist/motion/uikit/springs.d.ts +8 -42
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +12 -42
- 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/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -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/privateAttributes/segmentTitle.stylex.d.ts +5 -0
- package/dist/privateAttributes/segmentTitle.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/segmentTitle.stylex.js +22 -0
- package/dist/utils/browserClickWait.d.ts +35 -0
- package/dist/utils/browserClickWait.d.ts.map +1 -0
- package/dist/utils/browserClickWait.js +123 -0
- package/dist/utils/clickGuard.d.ts +14 -1
- package/dist/utils/clickGuard.d.ts.map +1 -1
- package/dist/utils/clickGuard.js +46 -1
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +12 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +24 -6
- package/locales/en.json +128 -0
- package/locales/pseudo.json +96 -0
- package/package.json +13 -8
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/AppShell/useCloseMobileDrawerOnActivate.ts +52 -0
- package/src/Avatar/Avatar.tsx +3 -1
- package/src/BottomSheet/BottomSheet.tsx +95 -10
- package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
- package/src/BottomSheet/bottomSheetStack.ts +8 -4
- package/src/BottomSheet/useSheetGestures.ts +3 -1
- package/src/Breadcrumbs/BreadcrumbItem.tsx +17 -4
- package/src/Button/Button.tsx +66 -7
- package/src/CheckboxList/CheckboxList.doc.mjs +4 -2
- package/src/CheckboxList/CheckboxList.tsx +6 -0
- package/src/CheckboxList/CheckboxListContext.tsx +6 -0
- package/src/CheckboxList/CheckboxListItem.tsx +11 -2
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/DateInput/DateInput.tsx +8 -2
- package/src/DateInput/MonthScroller.tsx +18 -22
- package/src/DateInput/Wheel.tsx +172 -14
- package/src/DateRangeInput/DateRangeInput.doc.mjs +3 -2
- package/src/DateRangeInput/DateRangeInput.tsx +117 -71
- package/src/DateTimeInput/DateTimeInput.tsx +8 -2
- package/src/Dialog/Dialog.tsx +81 -15
- package/src/Drawer/Drawer.tsx +28 -11
- package/src/Drawer/useDrawerDialogPresence.ts +9 -1
- package/src/DropdownMenu/DropdownMenu.tsx +28 -6
- package/src/Field/Field.tsx +2 -2
- package/src/Field/PanelSearchInput.tsx +11 -0
- package/src/HoverCard/HoverCard.tsx +31 -1
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/InfoTip/InfoTip.doc.mjs +192 -0
- package/src/InfoTip/InfoTip.tsx +186 -0
- package/src/InfoTip/index.ts +14 -0
- package/src/Layer/layerAnimations.stylex.ts +24 -16
- package/src/Layer/layerClickBoundary.ts +2 -2
- package/src/Layer/useBackdropPress.ts +81 -0
- package/src/Layer/usePressPin.ts +576 -0
- package/src/Layer/useTouchTrigger.ts +56 -6
- package/src/Lightbox/Lightbox.tsx +2 -1
- package/src/MobileNav/MobileNav.tsx +1 -1
- package/src/MultiSelector/hooks.ts +2 -4
- package/src/Outline/Outline.doc.mjs +177 -51
- package/src/Outline/Outline.tsx +5 -57
- package/src/Outline/useOutlineFromMarkdown.doc.mjs +157 -0
- package/src/Outline/useOutlineFromMarkdown.ts +1 -0
- package/src/Outline/useScrollSpy.ts +3 -3
- package/src/Popover/usePopover.tsx +71 -9
- package/src/PowerSearch/PowerSearch.doc.mjs +55 -6
- package/src/PowerSearch/PowerSearch.tsx +798 -324
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
- package/src/PowerSearch/formatFilterValue.ts +18 -1
- package/src/PowerSearch/formatTokenValue.ts +215 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +4 -2
- package/src/ProgressBar/ProgressBar.tsx +67 -7
- package/src/RadioList/RadioList.doc.mjs +4 -2
- package/src/RadioList/RadioList.tsx +7 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/ResizeHandle.tsx +133 -328
- package/src/Resizable/resizeGesture.ts +368 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
- package/src/SegmentedControl/SegmentedControl.tsx +179 -5
- package/src/SegmentedControl/SegmentedControlContext.ts +6 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +14 -2
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +1640 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +308 -0
- package/src/Selector/Selector.tsx +136 -89
- package/src/Selector/optionShape.ts +64 -0
- package/src/Selector/selectableOptionEntries.ts +39 -0
- package/src/Selector/utils.ts +9 -68
- package/src/SideNav/SideNavItem.tsx +3 -7
- package/src/Slider/sliderTouchController.ts +2 -2
- 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 +186 -0
- package/src/Switch/useSwitchTouch.ts +1051 -0
- package/src/TabList/Tab.tsx +5 -3
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.tsx +5 -0
- package/src/Token/Token.tsx +15 -4
- package/src/Token/TokenNamingContext.ts +28 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
- package/src/Tokenizer/Tokenizer.tsx +93 -88
- package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
- package/src/Tooltip/Tooltip.doc.mjs +123 -39
- package/src/Tooltip/Tooltip.tsx +43 -9
- package/src/Tooltip/useTooltip.doc.mjs +171 -31
- package/src/Tooltip/useTooltip.tsx +137 -22
- package/src/TopNav/TopNavItem.tsx +6 -5
- package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
- package/src/TopNav/TopNavMenu.tsx +6 -5
- package/src/Typeahead/Typeahead.tsx +29 -15
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/GestureHost.ts +205 -21
- package/src/gestures/PressTracker.ts +10 -0
- package/src/gestures/types.ts +6 -0
- package/src/gestures/usePressTracker.ts +2 -0
- package/src/gestures/wheelSegmenter.ts +36 -7
- package/src/hooks/actionGroupTracker.ts +32 -61
- package/src/hooks/index.ts +2 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAttachment.ts +56 -14
- package/src/hooks/useFocusTrap.ts +26 -2
- package/src/hooks/useHighlightedOptionScroll.ts +123 -15
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useMediaQuery.doc.mjs +2 -2
- package/src/hooks/useMediaQuery.ts +13 -4
- package/src/hooks/useMenuPress.ts +8 -2
- package/src/hooks/usePager.ts +1446 -0
- package/src/i18n/generated-english/InfoTip/InfoTip.generated.ts +13 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearch.generated.ts +1 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.ts +7 -1
- package/src/i18n/generated-locales/en.generated.ts +43 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +44 -0
- package/src/index.ts +14 -0
- package/src/internal/SheetConfirmation.tsx +101 -0
- package/src/internal/sheetDraft.ts +80 -0
- package/src/internal/touch-sheet.ts +21 -0
- package/src/internal/useDismissSearchOnTouchDrag.ts +69 -0
- package/src/motion/MEASUREMENTS.md +36 -27
- package/src/motion/README.md +11 -6
- package/src/motion/animator.ts +61 -29
- package/src/motion/paging.ts +37 -14
- package/src/motion/reducedMotion.ts +79 -1
- package/src/motion/roles.ts +20 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/motion/uikit/index.ts +6 -5
- package/src/motion/uikit/paging.ts +41 -10
- package/src/motion/uikit/progressBar.ts +31 -11
- package/src/motion/uikit/segmented.ts +74 -0
- package/src/motion/uikit/springs.ts +12 -42
- package/src/motion/uikit/switch.ts +174 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/privateAttributes/pressHoldsDrag.stylex.ts +28 -0
- package/src/privateAttributes/segmentTitle.stylex.ts +22 -0
- package/src/utils/browserClickWait.ts +133 -0
- package/src/utils/clickGuard.ts +64 -1
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +24 -6
- package/dist/internal/tokenizer-presentation.d.ts +0 -21
- package/dist/internal/tokenizer-presentation.d.ts.map +0 -1
- package/dist/internal/tokenizer-presentation.js +0 -21
- package/src/internal/tokenizer-presentation.ts +0 -25
|
@@ -110,8 +110,9 @@
|
|
|
110
110
|
* click; a click held for a recognizer that may still recognize is
|
|
111
111
|
* replayed if they all fail. Keyboard and assistive-technology clicks
|
|
112
112
|
* (`detail === 0`) always pass.
|
|
113
|
-
* - A `contextmenu` while a recognizer owns a touch
|
|
114
|
-
*
|
|
113
|
+
* - A `contextmenu` while a recognizer owns a touch, or while a press
|
|
114
|
+
* consumer holds the menu closed (`holdsContextMenu`), is cancelled. So a
|
|
115
|
+
* long press never also opens the browser's menu.
|
|
115
116
|
* - When the app loses focus (a window blur, a hidden page), every touch in
|
|
116
117
|
* flight is cancelled, as in UIKit; a finger the browser keeps alive lifts
|
|
117
118
|
* on nothing: its `touchend` is cancelled (`spec:AST-094` FR28).
|
|
@@ -290,6 +291,28 @@ function absorbedDebt(debt, moved) {
|
|
|
290
291
|
return Math.sign(debt) * Math.max(0, Math.abs(debt) - Math.abs(moved) / 2);
|
|
291
292
|
}
|
|
292
293
|
|
|
294
|
+
/**
|
|
295
|
+
* A stall held a bunched wheel's frames back, and the move just before it took
|
|
296
|
+
* their time. So the wheel joins that move's reading. It can restore what the
|
|
297
|
+
* late move lowered, but never passes the speed before it.
|
|
298
|
+
*/
|
|
299
|
+
function joinReading(f, trueX, trueY) {
|
|
300
|
+
if (f.readSpan <= 0) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
f.speedX = joinedSpeed(f.speedX, (trueX - f.readFromX) / f.readSpan, f.priorSpeedX);
|
|
304
|
+
f.speedY = joinedSpeed(f.speedY, (trueY - f.readFromY) / f.readSpan, f.priorSpeedY);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* A joined reading, held to the speed before the late move. It only ever
|
|
309
|
+
* raises the current speed, in the current direction.
|
|
310
|
+
*/
|
|
311
|
+
function joinedSpeed(current, reading, prior) {
|
|
312
|
+
const held = Math.sign(reading) * Math.min(Math.abs(reading), Math.abs(prior));
|
|
313
|
+
return held * current >= 0 && Math.abs(held) > Math.abs(current) ? held : current;
|
|
314
|
+
}
|
|
315
|
+
|
|
293
316
|
/**
|
|
294
317
|
* `target` where it is ahead of `shown` in the direction of `speed`, else
|
|
295
318
|
* `shown`: a reconcile that never steps back.
|
|
@@ -434,6 +457,12 @@ export class GestureHost {
|
|
|
434
457
|
* lift click (`spec:AST-094` FR28: nothing acts).
|
|
435
458
|
*/
|
|
436
459
|
cancelledFingers = new Set();
|
|
460
|
+
/**
|
|
461
|
+
* The pens and pointer-read fingers that the app's lost focus cancelled,
|
|
462
|
+
* by pointer id. Each is kept until its lift, which must not click either,
|
|
463
|
+
* or until a new press.
|
|
464
|
+
*/
|
|
465
|
+
cancelledPointers = new Map();
|
|
437
466
|
/** Touch.identifier → the element the finger landed on. */
|
|
438
467
|
touchTargets = new Map();
|
|
439
468
|
/**
|
|
@@ -455,6 +484,8 @@ export class GestureHost {
|
|
|
455
484
|
processed = new WeakSet();
|
|
456
485
|
/** pointerId → arena id, for live mouse and pen contacts. */
|
|
457
486
|
pointerIds = new Map();
|
|
487
|
+
/** Each contact's kind: a blur refuses a pen's or a pointer-read finger's lift, never a mouse's. */
|
|
488
|
+
pointerKinds = new Map();
|
|
458
489
|
/**
|
|
459
490
|
* The boxes the host watches for screen-edge pans (syncLayoutWatch): each
|
|
460
491
|
* element with an enabled one, and the root for one whose band moves with
|
|
@@ -912,12 +943,14 @@ export class GestureHost {
|
|
|
912
943
|
* cancels it (or the click guard drops it, a late one included) and this one
|
|
913
944
|
* is the tap's single activation.
|
|
914
945
|
*/
|
|
915
|
-
clickRetargeted(target, x, y) {
|
|
946
|
+
clickRetargeted(target, x, y, pointerType) {
|
|
916
947
|
const view = this.doc.defaultView;
|
|
917
948
|
if (!(target instanceof Element) || !target.isConnected || view == null) {
|
|
918
949
|
return;
|
|
919
950
|
}
|
|
920
|
-
armClickGuard(this.doc
|
|
951
|
+
armClickGuard(this.doc, {
|
|
952
|
+
takesLateMouse: pointerType === 'touch'
|
|
953
|
+
});
|
|
921
954
|
if (target instanceof view.HTMLElement && target.matches('input, textarea, select, [contenteditable]')) {
|
|
922
955
|
target.focus();
|
|
923
956
|
}
|
|
@@ -1395,13 +1428,32 @@ export class GestureHost {
|
|
|
1395
1428
|
}
|
|
1396
1429
|
}
|
|
1397
1430
|
|
|
1398
|
-
/**
|
|
1431
|
+
/**
|
|
1432
|
+
* A new press is a new gesture, as the click guard reads one, so the lifts
|
|
1433
|
+
* the blur cancelled owe nothing after it. A second finger keeps the other
|
|
1434
|
+
* fingers' refusals, since those fingers may still be down.
|
|
1435
|
+
*/
|
|
1436
|
+
dropCancelledLifts(event) {
|
|
1437
|
+
const isSecond = event.pointerType === 'touch' && event.isPrimary === false;
|
|
1438
|
+
for (const [pointerId, kind] of [...this.cancelledPointers]) {
|
|
1439
|
+
if (pointerId === event.pointerId || !(isSecond && kind === 'touch')) {
|
|
1440
|
+
this.cancelledPointers.delete(pointerId);
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
/**
|
|
1446
|
+
* After a contact ends: an armed press that is over stops listening. A
|
|
1447
|
+
* contact the lost focus cancelled still owes its lift, so the press is
|
|
1448
|
+
* not over until that lift comes. A lift the page never hears ends it at
|
|
1449
|
+
* the next press, or at a cancel.
|
|
1450
|
+
*/
|
|
1399
1451
|
releaseArmedPress() {
|
|
1400
1452
|
if (!this.isArmedPress) {
|
|
1401
1453
|
return;
|
|
1402
1454
|
}
|
|
1403
1455
|
queueMicrotask(() => {
|
|
1404
|
-
if (this.isArmedPress && this.arena.touches.length === 0) {
|
|
1456
|
+
if (this.isArmedPress && this.arena.touches.length === 0 && this.cancelledPointers.size === 0) {
|
|
1405
1457
|
this.isArmedPress = false;
|
|
1406
1458
|
this.syncKeptPresses();
|
|
1407
1459
|
this.syncListeners();
|
|
@@ -1432,6 +1484,7 @@ export class GestureHost {
|
|
|
1432
1484
|
return;
|
|
1433
1485
|
}
|
|
1434
1486
|
this.cancelledFingers.clear();
|
|
1487
|
+
this.cancelledPointers.clear();
|
|
1435
1488
|
this.clearClaimedLifts();
|
|
1436
1489
|
this.cancelCallerRead?.();
|
|
1437
1490
|
this.cancelCallerRead = null;
|
|
@@ -1824,9 +1877,22 @@ export class GestureHost {
|
|
|
1824
1877
|
}
|
|
1825
1878
|
if (this.wheelSegment?.decaying === true) {
|
|
1826
1879
|
// Undecided: the real deltas wait for the splitter while the
|
|
1827
|
-
// fingers' last speed carries the pan on.
|
|
1880
|
+
// fingers' last speed carries the pan on. A held wheel with its own
|
|
1881
|
+
// frame ends the reading a stall's bunch joins.
|
|
1828
1882
|
f.heldX += dx;
|
|
1829
1883
|
f.heldY += dy;
|
|
1884
|
+
if (this.wheelSegment.bunched) {
|
|
1885
|
+
// A raised speed moves on from where the pan is shown, so the
|
|
1886
|
+
// position never jumps inside the bunch.
|
|
1887
|
+
const since = time - f.lastMove;
|
|
1888
|
+
const speedX = f.speedX;
|
|
1889
|
+
const speedY = f.speedY;
|
|
1890
|
+
joinReading(f, f.trueX - f.heldX, f.trueY - f.heldY);
|
|
1891
|
+
f.baseX += (speedX - f.speedX) * since;
|
|
1892
|
+
f.baseY += (speedY - f.speedY) * since;
|
|
1893
|
+
} else {
|
|
1894
|
+
f.readSpan = 0;
|
|
1895
|
+
}
|
|
1830
1896
|
this.followProvisionally(gesture, f, time);
|
|
1831
1897
|
return;
|
|
1832
1898
|
}
|
|
@@ -1839,8 +1905,18 @@ export class GestureHost {
|
|
|
1839
1905
|
const debtY = absorbedDebt(gesture.y - beforeY, dy);
|
|
1840
1906
|
const trueX = beforeX - dx;
|
|
1841
1907
|
const trueY = beforeY - dy;
|
|
1908
|
+
// A wheel the splitter reads as one stall's merge has no speed of its
|
|
1909
|
+
// own. It joins the reading of the move before its bunch, whose
|
|
1910
|
+
// interval holds its time.
|
|
1842
1911
|
const elapsed = time - f.lastMove;
|
|
1843
|
-
if (
|
|
1912
|
+
if (this.wheelSegment?.bunched === true) {
|
|
1913
|
+
joinReading(f, trueX, trueY);
|
|
1914
|
+
} else if (elapsed > 0) {
|
|
1915
|
+
f.priorSpeedX = f.speedX;
|
|
1916
|
+
f.priorSpeedY = f.speedY;
|
|
1917
|
+
f.readFromX = f.trueX;
|
|
1918
|
+
f.readFromY = f.trueY;
|
|
1919
|
+
f.readSpan = elapsed;
|
|
1844
1920
|
f.speedX = (trueX - f.trueX) / elapsed;
|
|
1845
1921
|
f.speedY = (trueY - f.trueY) / elapsed;
|
|
1846
1922
|
}
|
|
@@ -1975,7 +2051,12 @@ export class GestureHost {
|
|
|
1975
2051
|
baseX: kept.x,
|
|
1976
2052
|
baseY: kept.y,
|
|
1977
2053
|
speedX: 0,
|
|
1978
|
-
speedY: 0
|
|
2054
|
+
speedY: 0,
|
|
2055
|
+
readFromX: kept.x,
|
|
2056
|
+
readFromY: kept.y,
|
|
2057
|
+
readSpan: 0,
|
|
2058
|
+
priorSpeedX: 0,
|
|
2059
|
+
priorSpeedY: 0
|
|
1979
2060
|
};
|
|
1980
2061
|
}
|
|
1981
2062
|
this.arena.began(kind === 'pan' ? [{
|
|
@@ -2362,8 +2443,9 @@ export class GestureHost {
|
|
|
2362
2443
|
consumerElement
|
|
2363
2444
|
});
|
|
2364
2445
|
}
|
|
2365
|
-
// The finger's events keep going to what the engine hit.
|
|
2366
|
-
|
|
2446
|
+
// The finger's events keep going to what the engine hit. A disabled
|
|
2447
|
+
// participant can never claim, so a scroll never waits on it.
|
|
2448
|
+
this.watchTarget(touch.identifier, native, recognizers.some(recognizer => recognizer.isEnabled && claimsWhileMoving(recognizer)) || consumer?.keepsTouch != null && consumer.isEnabled?.() !== false, consumer != null && consumer.isEnabled?.() !== false || recognizers.some(recognizer => recognizer.isEnabled && recognizer.claimsTouches));
|
|
2367
2449
|
this.lastFed.set(id, {
|
|
2368
2450
|
x: touch.clientX,
|
|
2369
2451
|
y: touch.clientY,
|
|
@@ -2407,6 +2489,11 @@ export class GestureHost {
|
|
|
2407
2489
|
for (const input of untracked) {
|
|
2408
2490
|
this.arena.untrackedBegan(input);
|
|
2409
2491
|
}
|
|
2492
|
+
// Again once the new fingers are delivered: a pinch's second finger may
|
|
2493
|
+
// have landed on another one-finger pan, the next row.
|
|
2494
|
+
if (this.fingerTargets.length > 1 && !this.isFingerClaimed()) {
|
|
2495
|
+
this.failUnclaimedLoneFingerPans();
|
|
2496
|
+
}
|
|
2410
2497
|
// Stamped after the consumers judged the touch: the brake asks whether
|
|
2411
2498
|
// an EARLIER finger is still driving a scroll.
|
|
2412
2499
|
const landed = landedOn(event);
|
|
@@ -2636,7 +2723,7 @@ export class GestureHost {
|
|
|
2636
2723
|
// A tap sent to what is drawn: the engine's click would hit the layout
|
|
2637
2724
|
// position, so it is cancelled and the tap clicks what it touched.
|
|
2638
2725
|
for (const end of retargetedEnds) {
|
|
2639
|
-
if (this.clickRetargetedTap(end.landed, end, dispositions.get(end.id))) {
|
|
2726
|
+
if (this.clickRetargetedTap(end.landed, end, dispositions.get(end.id), 'touch')) {
|
|
2640
2727
|
cancelsClick = true;
|
|
2641
2728
|
}
|
|
2642
2729
|
}
|
|
@@ -2644,7 +2731,9 @@ export class GestureHost {
|
|
|
2644
2731
|
if (event.cancelable) {
|
|
2645
2732
|
event.preventDefault();
|
|
2646
2733
|
}
|
|
2647
|
-
armClickGuard(this.doc
|
|
2734
|
+
armClickGuard(this.doc, {
|
|
2735
|
+
takesLateMouse: true
|
|
2736
|
+
});
|
|
2648
2737
|
}
|
|
2649
2738
|
};
|
|
2650
2739
|
|
|
@@ -2654,7 +2743,7 @@ export class GestureHost {
|
|
|
2654
2743
|
* (a taken contact is no longer retargeted), and the finger stayed within
|
|
2655
2744
|
* a tap's movement. Returns whether it clicked.
|
|
2656
2745
|
*/
|
|
2657
|
-
clickRetargetedTap(landed, end, disposition) {
|
|
2746
|
+
clickRetargetedTap(landed, end, disposition, pointerType) {
|
|
2658
2747
|
if (landed == null || disposition !== 'allow') {
|
|
2659
2748
|
return false;
|
|
2660
2749
|
}
|
|
@@ -2662,7 +2751,7 @@ export class GestureHost {
|
|
|
2662
2751
|
if (moved > UIKIT_TAP.allowableMovement.value) {
|
|
2663
2752
|
return false;
|
|
2664
2753
|
}
|
|
2665
|
-
this.clickRetargeted(landed.target, end.x, end.y);
|
|
2754
|
+
this.clickRetargeted(landed.target, end.x, end.y, pointerType);
|
|
2666
2755
|
return true;
|
|
2667
2756
|
}
|
|
2668
2757
|
onTouchCancel = event => {
|
|
@@ -2930,6 +3019,7 @@ export class GestureHost {
|
|
|
2930
3019
|
if (!isPointerKind(event.pointerType)) {
|
|
2931
3020
|
return;
|
|
2932
3021
|
}
|
|
3022
|
+
this.dropCancelledLifts(event);
|
|
2933
3023
|
if (event.pointerType === 'touch' && this.usesTouchEvents) {
|
|
2934
3024
|
this.pairPointer(event.pointerId, {
|
|
2935
3025
|
x: event.clientX,
|
|
@@ -2938,6 +3028,13 @@ export class GestureHost {
|
|
|
2938
3028
|
});
|
|
2939
3029
|
return;
|
|
2940
3030
|
}
|
|
3031
|
+
if (event.pointerType === 'touch' && event.isPrimary === false) {
|
|
3032
|
+
// Fingers from pointer events: a second one, wherever either lands,
|
|
3033
|
+
// leaves the two to the page's pinch, as onTouchStart does. A finger
|
|
3034
|
+
// that is not the primary pointer is a second finger, even where the
|
|
3035
|
+
// host never heard the first.
|
|
3036
|
+
this.failUnclaimedLoneFingerPans();
|
|
3037
|
+
}
|
|
2941
3038
|
// A right click, a pen's barrel button, or a ctrl-click on macOS (its
|
|
2942
3039
|
// context click) starts no press (FR43).
|
|
2943
3040
|
if (event.pointerType !== 'touch' && !isPrimaryClick(event)) {
|
|
@@ -2955,6 +3052,7 @@ export class GestureHost {
|
|
|
2955
3052
|
}
|
|
2956
3053
|
const id = this.nextId++;
|
|
2957
3054
|
this.pointerIds.set(event.pointerId, id);
|
|
3055
|
+
this.pointerKinds.set(event.pointerId, event.pointerType);
|
|
2958
3056
|
if (target !== landed && target != null) {
|
|
2959
3057
|
this.retargeted.set(id, {
|
|
2960
3058
|
x: event.clientX,
|
|
@@ -2978,6 +3076,11 @@ export class GestureHost {
|
|
|
2978
3076
|
recognizers,
|
|
2979
3077
|
consumer
|
|
2980
3078
|
}]);
|
|
3079
|
+
if (event.pointerType === 'touch' && event.isPrimary === false && !this.isFingerClaimed()) {
|
|
3080
|
+
// Again once this finger is delivered: it may have landed on another
|
|
3081
|
+
// one-finger pan.
|
|
3082
|
+
this.failUnclaimedLoneFingerPans();
|
|
3083
|
+
}
|
|
2981
3084
|
if (locksSelectionFor(event.pointerType)) {
|
|
2982
3085
|
// The presented target: what the pen is on, where the engine's own
|
|
2983
3086
|
// hit test may still see the motion's start.
|
|
@@ -3024,9 +3127,14 @@ export class GestureHost {
|
|
|
3024
3127
|
}
|
|
3025
3128
|
const id = this.pointerIds.get(event.pointerId);
|
|
3026
3129
|
if (id == null) {
|
|
3130
|
+
// A contact the lost focus cancelled: its lift clicks nothing.
|
|
3131
|
+
if (this.cancelledPointers.delete(event.pointerId)) {
|
|
3132
|
+
this.refuseCancelledLift(event);
|
|
3133
|
+
}
|
|
3027
3134
|
return;
|
|
3028
3135
|
}
|
|
3029
3136
|
this.pointerIds.delete(event.pointerId);
|
|
3137
|
+
this.pointerKinds.delete(event.pointerId);
|
|
3030
3138
|
this.unlockSelection(id);
|
|
3031
3139
|
const dispositions = this.arena.ended([{
|
|
3032
3140
|
id,
|
|
@@ -3040,9 +3148,11 @@ export class GestureHost {
|
|
|
3040
3148
|
const clicked = this.clickRetargetedTap(landed, {
|
|
3041
3149
|
x: event.clientX,
|
|
3042
3150
|
y: event.clientY
|
|
3043
|
-
}, dispositions.get(id));
|
|
3151
|
+
}, dispositions.get(id), event.pointerType);
|
|
3044
3152
|
if (!clicked && needsSuppression(dispositions)) {
|
|
3045
|
-
armClickGuard(this.doc
|
|
3153
|
+
armClickGuard(this.doc, {
|
|
3154
|
+
takesLateMouse: event.pointerType === 'touch'
|
|
3155
|
+
});
|
|
3046
3156
|
}
|
|
3047
3157
|
// A finger read from its pointer events: the touchend that follows the
|
|
3048
3158
|
// lift is cancelled when a gesture took it, which the lift itself may
|
|
@@ -3119,9 +3229,12 @@ export class GestureHost {
|
|
|
3119
3229
|
}
|
|
3120
3230
|
return;
|
|
3121
3231
|
}
|
|
3232
|
+
// A contact that ends in a cancel owes no refused lift.
|
|
3233
|
+
this.cancelledPointers.delete(event.pointerId);
|
|
3122
3234
|
const id = this.pointerIds.get(event.pointerId);
|
|
3123
3235
|
if (id != null) {
|
|
3124
3236
|
this.pointerIds.delete(event.pointerId);
|
|
3237
|
+
this.pointerKinds.delete(event.pointerId);
|
|
3125
3238
|
this.unlockSelection(id, true);
|
|
3126
3239
|
this.retargeted.delete(id);
|
|
3127
3240
|
this.arena.cancelled([id], eventTime(event));
|
|
@@ -3178,7 +3291,7 @@ export class GestureHost {
|
|
|
3178
3291
|
}
|
|
3179
3292
|
onContextMenu = event => {
|
|
3180
3293
|
for (const touch of this.arena.touches) {
|
|
3181
|
-
if (this.arena.isClaimed(touch.id)) {
|
|
3294
|
+
if (this.arena.isClaimed(touch.id) || this.arena.consumerOf(touch.id)?.holdsContextMenu?.(touch.id) === true) {
|
|
3182
3295
|
event.preventDefault();
|
|
3183
3296
|
return;
|
|
3184
3297
|
}
|
|
@@ -3291,18 +3404,22 @@ export class GestureHost {
|
|
|
3291
3404
|
}
|
|
3292
3405
|
}
|
|
3293
3406
|
}
|
|
3407
|
+
/** Whether a finger's drag is claimed: then two fingers make no pinch. */
|
|
3408
|
+
isFingerClaimed() {
|
|
3409
|
+
return this.arena.touches.some(touch => touch.pointerType === 'touch' && this.arena.isClaimed(touch.id));
|
|
3410
|
+
}
|
|
3294
3411
|
onVisibilityChange = () => {
|
|
3295
3412
|
if (this.doc.visibilityState === 'hidden') {
|
|
3296
3413
|
this.cancelEverything(this.arena.now());
|
|
3297
|
-
// As at a blur:
|
|
3298
|
-
//
|
|
3414
|
+
// As at a blur: an armed press's page listeners go once nothing is left
|
|
3415
|
+
// to hear.
|
|
3299
3416
|
this.releaseArmedPress();
|
|
3300
3417
|
}
|
|
3301
3418
|
};
|
|
3302
3419
|
onBlur = () => {
|
|
3303
3420
|
this.cancelEverything(this.arena.now());
|
|
3304
|
-
//
|
|
3305
|
-
//
|
|
3421
|
+
// An armed press's page listeners go once nothing is left to hear. A pen
|
|
3422
|
+
// or a pointer-read finger the blur cancelled still owes its lift.
|
|
3306
3423
|
this.releaseArmedPress();
|
|
3307
3424
|
};
|
|
3308
3425
|
|
|
@@ -3322,8 +3439,29 @@ export class GestureHost {
|
|
|
3322
3439
|
return this.inputMode === 'pointer-events' || view != null && !('ontouchstart' in view);
|
|
3323
3440
|
}
|
|
3324
3441
|
|
|
3442
|
+
/**
|
|
3443
|
+
* The lift of a contact the lost focus cancelled: its click is refused,
|
|
3444
|
+
* and a finger's touchend after it is cancelled.
|
|
3445
|
+
*/
|
|
3446
|
+
refuseCancelledLift(event) {
|
|
3447
|
+
armClickGuard(this.doc, {
|
|
3448
|
+
takesLateMouse: event.pointerType === 'touch'
|
|
3449
|
+
});
|
|
3450
|
+
if (event.pointerType === 'touch') {
|
|
3451
|
+
// Noted as a claimed lift is: capped, and gone after its time.
|
|
3452
|
+
this.noteClaimedLift(event);
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
|
|
3325
3456
|
/** The app lost focus: UIKit cancels every touch in flight. */
|
|
3326
3457
|
cancelEverything(time) {
|
|
3458
|
+
// The browser may keep a pen or a pointer-read finger down: its lift must
|
|
3459
|
+
// not click. A mouse button held through the blur keeps its click.
|
|
3460
|
+
for (const [pointerId, kind] of this.pointerKinds) {
|
|
3461
|
+
if (kind !== 'mouse') {
|
|
3462
|
+
this.cancelledPointers.set(pointerId, kind);
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3327
3465
|
const ids = [...this.pointerIds.values()];
|
|
3328
3466
|
for (const id of ids) {
|
|
3329
3467
|
this.unlockSelection(id, true);
|
|
@@ -3337,6 +3475,7 @@ export class GestureHost {
|
|
|
3337
3475
|
}
|
|
3338
3476
|
}
|
|
3339
3477
|
this.pointerIds.clear();
|
|
3478
|
+
this.pointerKinds.clear();
|
|
3340
3479
|
this.retargeted.clear();
|
|
3341
3480
|
this.fingerPointers.clear();
|
|
3342
3481
|
this.pendingPointers.clear();
|
|
@@ -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,CA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ACzB,yEAAyE;;;;;;IASzE;;;;OAIG;;;;;;;CAO4C,CAAC;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).
|
package/dist/gestures/types.d.ts
CHANGED
|
@@ -167,6 +167,12 @@ export interface TouchConsumer {
|
|
|
167
167
|
* undefined and keeps the browser's long-press selection.
|
|
168
168
|
*/
|
|
169
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;
|
|
170
176
|
/**
|
|
171
177
|
* Whether the consumer takes touches now (a disabled control does not).
|
|
172
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;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnD,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,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC;AAEnE;;;;GAIG;AACH,MAAM,W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O,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"}
|
|
@@ -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 => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file wheelSegmenter.ts
|
|
3
3
|
* @input A wheel stream's deltas along one axis, with their event times
|
|
4
|
-
* @output Exports WheelSegmenter
|
|
5
|
-
* a trackpad's lift (the onset of momentum)
|
|
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.
|
|
6
7
|
* @position Read by GestureHost.ts's wheel input: the web reports no
|
|
7
8
|
* trackpad contact or phase, so both are inferred.
|
|
8
9
|
*/
|
|
@@ -18,7 +19,16 @@ export interface WheelSegment {
|
|
|
18
19
|
readonly liftNow: boolean;
|
|
19
20
|
/** This event shrank, so it may be momentum: hold it until known. */
|
|
20
21
|
readonly decaying: boolean;
|
|
22
|
+
/** This event came so soon after the one before that it is a merge. */
|
|
23
|
+
readonly bunched: boolean;
|
|
21
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;
|
|
22
32
|
/**
|
|
23
33
|
* A trackpad gesture has a finger phase and, after a fling, a momentum phase.
|
|
24
34
|
* In the finger phase, deltas come while the fingers move, with pauses when
|
|
@@ -26,7 +36,8 @@ export interface WheelSegment {
|
|
|
26
36
|
* shrink smoothly. The lift is the start of a run of shrinking deltas that
|
|
27
37
|
* has lost a fifth of its size. In the finger phase, a pause of `idleMs`
|
|
28
38
|
* ends the gesture. In the momentum phase, a reversal, a jump up against the
|
|
29
|
-
* decay, or a pause of 50 ms starts a new gesture.
|
|
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,
|
|
30
41
|
* reverses or grows.
|
|
31
42
|
*/
|
|
32
43
|
export declare class WheelSegmenter {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wheelSegmenter.d.ts","sourceRoot":"","sources":["../../src/gestures/wheelSegmenter.ts"],"names":[],"mappings":"AAEA
|
|
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,SAAK;IACZ,KAAK,EAAE,UAAU,CAAY;IAC7B,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,QAAQ,CAAK;IAErB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY;IAkE/D,2EAA2E;IAC3E,GAAG,IAAI,IAAI;CAGZ"}
|
|
@@ -3,19 +3,35 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file wheelSegmenter.ts
|
|
5
5
|
* @input A wheel stream's deltas along one axis, with their event times
|
|
6
|
-
* @output Exports WheelSegmenter
|
|
7
|
-
* a trackpad's lift (the onset of momentum)
|
|
6
|
+
* @output Exports WheelSegmenter and isBunched. WheelSegmenter splits the
|
|
7
|
+
* stream into gestures and reads a trackpad's lift (the onset of momentum).
|
|
8
|
+
* isBunched tells one stall's merge from a frame.
|
|
8
9
|
* @position Read by GestureHost.ts's wheel input: the web reports no
|
|
9
10
|
* trackpad contact or phase, so both are inferred.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
/** Momentum arrives at frame rate: a pause this long ends it. */
|
|
13
14
|
const MOMENTUM_GAP_MS = 50;
|
|
15
|
+
/**
|
|
16
|
+
* A wheel this close to the one before, ms, is one stall's merge. Frames come
|
|
17
|
+
* further apart at every display rate up to 500 Hz, which is 2 ms.
|
|
18
|
+
*/
|
|
19
|
+
const BUNCHED_MS = 1.5;
|
|
14
20
|
/** Shrinking deltas in a row before the lift is read. */
|
|
15
21
|
const LIFT_RUN = 4;
|
|
16
22
|
/** And how much of its size the run has lost by then. */
|
|
17
23
|
const LIFT_DECAY = 0.8;
|
|
18
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 function isBunched(intervalMs) {
|
|
32
|
+
return intervalMs <= BUNCHED_MS;
|
|
33
|
+
}
|
|
34
|
+
|
|
19
35
|
/**
|
|
20
36
|
* A trackpad gesture has a finger phase and, after a fling, a momentum phase.
|
|
21
37
|
* In the finger phase, deltas come while the fingers move, with pauses when
|
|
@@ -23,7 +39,8 @@ const LIFT_DECAY = 0.8;
|
|
|
23
39
|
* shrink smoothly. The lift is the start of a run of shrinking deltas that
|
|
24
40
|
* has lost a fifth of its size. In the finger phase, a pause of `idleMs`
|
|
25
41
|
* ends the gesture. In the momentum phase, a reversal, a jump up against the
|
|
26
|
-
* decay, or a pause of 50 ms starts a new gesture.
|
|
42
|
+
* decay, or a pause of 50 ms starts a new gesture. A bunched wheel is never
|
|
43
|
+
* a jump. The decay reads it by its last step. Momentum never pauses,
|
|
27
44
|
* reverses or grows.
|
|
28
45
|
*/
|
|
29
46
|
export class WheelSegmenter {
|
|
@@ -39,6 +56,7 @@ export class WheelSegmenter {
|
|
|
39
56
|
const size = Math.abs(delta);
|
|
40
57
|
const sign = Math.sign(delta);
|
|
41
58
|
const gap = time - this.last;
|
|
59
|
+
const bunched = this.count > 0 && isBunched(gap);
|
|
42
60
|
let boundary = null;
|
|
43
61
|
if (this.count === 0) {
|
|
44
62
|
boundary = this.gesture === 0 ? 'first' : 'idle';
|
|
@@ -49,10 +67,13 @@ export class WheelSegmenter {
|
|
|
49
67
|
boundary = 'reversal';
|
|
50
68
|
} else if (gap >= MOMENTUM_GAP_MS) {
|
|
51
69
|
boundary = 'gap';
|
|
52
|
-
} else if (size >= 2 && size > this.previous * 1.3 + 0.5) {
|
|
70
|
+
} else if (!bunched && size >= 2 && size > this.previous * 1.3 + 0.5) {
|
|
53
71
|
boundary = 'jump';
|
|
54
72
|
}
|
|
55
73
|
}
|
|
74
|
+
// A bunched wheel carries the steps of the frames it merged. The decay
|
|
75
|
+
// goes on from its last step, so the steps after it read as they are.
|
|
76
|
+
const steps = boundary == null && bunched && this.previous > 0 ? Math.max(1, Math.round(size / this.previous)) : 1;
|
|
56
77
|
if (boundary != null) {
|
|
57
78
|
this.gesture += 1;
|
|
58
79
|
this.phase = 'finger';
|
|
@@ -62,7 +83,9 @@ export class WheelSegmenter {
|
|
|
62
83
|
let liftNow = false;
|
|
63
84
|
let decaying = false;
|
|
64
85
|
if (this.phase === 'finger' && this.count >= 3 && size > 0) {
|
|
65
|
-
|
|
86
|
+
// A bunched wheel is read by its last step, as the decay goes on from it.
|
|
87
|
+
const step = size / steps;
|
|
88
|
+
decaying = step <= this.previous * 0.995 && step >= this.previous * 0.5;
|
|
66
89
|
if (decaying) {
|
|
67
90
|
if (this.run === 0) {
|
|
68
91
|
this.runStart = this.previous;
|
|
@@ -71,13 +94,13 @@ export class WheelSegmenter {
|
|
|
71
94
|
} else {
|
|
72
95
|
this.run = 0;
|
|
73
96
|
}
|
|
74
|
-
if (this.run >= LIFT_RUN &&
|
|
97
|
+
if (this.run >= LIFT_RUN && step <= this.runStart * LIFT_DECAY) {
|
|
75
98
|
this.phase = 'momentum';
|
|
76
99
|
liftNow = true;
|
|
77
100
|
}
|
|
78
101
|
}
|
|
79
102
|
this.count += 1;
|
|
80
|
-
this.previous = size;
|
|
103
|
+
this.previous = size / steps;
|
|
81
104
|
if (sign !== 0) {
|
|
82
105
|
this.sign = sign;
|
|
83
106
|
}
|
|
@@ -87,7 +110,8 @@ export class WheelSegmenter {
|
|
|
87
110
|
phase: this.phase,
|
|
88
111
|
gesture: this.gesture,
|
|
89
112
|
liftNow,
|
|
90
|
-
decaying: decaying && !liftNow
|
|
113
|
+
decaying: decaying && !liftNow,
|
|
114
|
+
bunched: boundary == null && bunched
|
|
91
115
|
};
|
|
92
116
|
}
|
|
93
117
|
|