@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).
|
|
@@ -474,6 +475,16 @@ interface WheelFollow {
|
|
|
474
475
|
/** The fingers' speed at that move, content px per ms. */
|
|
475
476
|
speedX: number;
|
|
476
477
|
speedY: number;
|
|
478
|
+
/**
|
|
479
|
+
* The reading behind that speed: the fingers' travel where it began, and
|
|
480
|
+
* its interval in ms.
|
|
481
|
+
*/
|
|
482
|
+
readFromX: number;
|
|
483
|
+
readFromY: number;
|
|
484
|
+
readSpan: number;
|
|
485
|
+
/** The fingers' speed before that reading, content px per ms. */
|
|
486
|
+
priorSpeedX: number;
|
|
487
|
+
priorSpeedY: number;
|
|
477
488
|
}
|
|
478
489
|
|
|
479
490
|
/**
|
|
@@ -502,6 +513,39 @@ function absorbedDebt(debt: number, moved: number): number {
|
|
|
502
513
|
return Math.sign(debt) * Math.max(0, Math.abs(debt) - Math.abs(moved) / 2);
|
|
503
514
|
}
|
|
504
515
|
|
|
516
|
+
/**
|
|
517
|
+
* A stall held a bunched wheel's frames back, and the move just before it took
|
|
518
|
+
* their time. So the wheel joins that move's reading. It can restore what the
|
|
519
|
+
* late move lowered, but never passes the speed before it.
|
|
520
|
+
*/
|
|
521
|
+
function joinReading(f: WheelFollow, trueX: number, trueY: number): void {
|
|
522
|
+
if (f.readSpan <= 0) {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
f.speedX = joinedSpeed(
|
|
526
|
+
f.speedX,
|
|
527
|
+
(trueX - f.readFromX) / f.readSpan,
|
|
528
|
+
f.priorSpeedX,
|
|
529
|
+
);
|
|
530
|
+
f.speedY = joinedSpeed(
|
|
531
|
+
f.speedY,
|
|
532
|
+
(trueY - f.readFromY) / f.readSpan,
|
|
533
|
+
f.priorSpeedY,
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* A joined reading, held to the speed before the late move. It only ever
|
|
539
|
+
* raises the current speed, in the current direction.
|
|
540
|
+
*/
|
|
541
|
+
function joinedSpeed(current: number, reading: number, prior: number): number {
|
|
542
|
+
const held =
|
|
543
|
+
Math.sign(reading) * Math.min(Math.abs(reading), Math.abs(prior));
|
|
544
|
+
return held * current >= 0 && Math.abs(held) > Math.abs(current)
|
|
545
|
+
? held
|
|
546
|
+
: current;
|
|
547
|
+
}
|
|
548
|
+
|
|
505
549
|
/**
|
|
506
550
|
* `target` where it is ahead of `shown` in the direction of `speed`, else
|
|
507
551
|
* `shown`: a reconcile that never steps back.
|
|
@@ -687,6 +731,12 @@ export class GestureHost {
|
|
|
687
731
|
* lift click (`spec:AST-094` FR28: nothing acts).
|
|
688
732
|
*/
|
|
689
733
|
private readonly cancelledFingers = new Set<number>();
|
|
734
|
+
/**
|
|
735
|
+
* The pens and pointer-read fingers that the app's lost focus cancelled,
|
|
736
|
+
* by pointer id. Each is kept until its lift, which must not click either,
|
|
737
|
+
* or until a new press.
|
|
738
|
+
*/
|
|
739
|
+
private readonly cancelledPointers = new Map<number, PointerKind>();
|
|
690
740
|
/** Touch.identifier → the element the finger landed on. */
|
|
691
741
|
private readonly touchTargets = new Map<number, EventTarget>();
|
|
692
742
|
/**
|
|
@@ -711,6 +761,8 @@ export class GestureHost {
|
|
|
711
761
|
private readonly processed = new WeakSet<Event>();
|
|
712
762
|
/** pointerId → arena id, for live mouse and pen contacts. */
|
|
713
763
|
private readonly pointerIds = new Map<number, number>();
|
|
764
|
+
/** Each contact's kind: a blur refuses a pen's or a pointer-read finger's lift, never a mouse's. */
|
|
765
|
+
private readonly pointerKinds = new Map<number, PointerKind>();
|
|
714
766
|
/**
|
|
715
767
|
* The boxes the host watches for screen-edge pans (syncLayoutWatch): each
|
|
716
768
|
* element with an enabled one, and the root for one whose band moves with
|
|
@@ -1202,12 +1254,17 @@ export class GestureHost {
|
|
|
1202
1254
|
* cancels it (or the click guard drops it, a late one included) and this one
|
|
1203
1255
|
* is the tap's single activation.
|
|
1204
1256
|
*/
|
|
1205
|
-
private clickRetargeted(
|
|
1257
|
+
private clickRetargeted(
|
|
1258
|
+
target: EventTarget,
|
|
1259
|
+
x: number,
|
|
1260
|
+
y: number,
|
|
1261
|
+
pointerType: string,
|
|
1262
|
+
): void {
|
|
1206
1263
|
const view = this.doc.defaultView;
|
|
1207
1264
|
if (!(target instanceof Element) || !target.isConnected || view == null) {
|
|
1208
1265
|
return;
|
|
1209
1266
|
}
|
|
1210
|
-
armClickGuard(this.doc);
|
|
1267
|
+
armClickGuard(this.doc, {takesLateMouse: pointerType === 'touch'});
|
|
1211
1268
|
if (
|
|
1212
1269
|
target instanceof view.HTMLElement &&
|
|
1213
1270
|
target.matches('input, textarea, select, [contenteditable]')
|
|
@@ -1771,13 +1828,36 @@ export class GestureHost {
|
|
|
1771
1828
|
}
|
|
1772
1829
|
}
|
|
1773
1830
|
|
|
1774
|
-
/**
|
|
1831
|
+
/**
|
|
1832
|
+
* A new press is a new gesture, as the click guard reads one, so the lifts
|
|
1833
|
+
* the blur cancelled owe nothing after it. A second finger keeps the other
|
|
1834
|
+
* fingers' refusals, since those fingers may still be down.
|
|
1835
|
+
*/
|
|
1836
|
+
private dropCancelledLifts(event: PointerEvent): void {
|
|
1837
|
+
const isSecond = event.pointerType === 'touch' && event.isPrimary === false;
|
|
1838
|
+
for (const [pointerId, kind] of [...this.cancelledPointers]) {
|
|
1839
|
+
if (pointerId === event.pointerId || !(isSecond && kind === 'touch')) {
|
|
1840
|
+
this.cancelledPointers.delete(pointerId);
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
/**
|
|
1846
|
+
* After a contact ends: an armed press that is over stops listening. A
|
|
1847
|
+
* contact the lost focus cancelled still owes its lift, so the press is
|
|
1848
|
+
* not over until that lift comes. A lift the page never hears ends it at
|
|
1849
|
+
* the next press, or at a cancel.
|
|
1850
|
+
*/
|
|
1775
1851
|
private releaseArmedPress(): void {
|
|
1776
1852
|
if (!this.isArmedPress) {
|
|
1777
1853
|
return;
|
|
1778
1854
|
}
|
|
1779
1855
|
queueMicrotask(() => {
|
|
1780
|
-
if (
|
|
1856
|
+
if (
|
|
1857
|
+
this.isArmedPress &&
|
|
1858
|
+
this.arena.touches.length === 0 &&
|
|
1859
|
+
this.cancelledPointers.size === 0
|
|
1860
|
+
) {
|
|
1781
1861
|
this.isArmedPress = false;
|
|
1782
1862
|
this.syncKeptPresses();
|
|
1783
1863
|
this.syncListeners();
|
|
@@ -1808,6 +1888,7 @@ export class GestureHost {
|
|
|
1808
1888
|
return;
|
|
1809
1889
|
}
|
|
1810
1890
|
this.cancelledFingers.clear();
|
|
1891
|
+
this.cancelledPointers.clear();
|
|
1811
1892
|
this.clearClaimedLifts();
|
|
1812
1893
|
this.cancelCallerRead?.();
|
|
1813
1894
|
this.cancelCallerRead = null;
|
|
@@ -2270,9 +2351,22 @@ export class GestureHost {
|
|
|
2270
2351
|
}
|
|
2271
2352
|
if (this.wheelSegment?.decaying === true) {
|
|
2272
2353
|
// Undecided: the real deltas wait for the splitter while the
|
|
2273
|
-
// fingers' last speed carries the pan on.
|
|
2354
|
+
// fingers' last speed carries the pan on. A held wheel with its own
|
|
2355
|
+
// frame ends the reading a stall's bunch joins.
|
|
2274
2356
|
f.heldX += dx;
|
|
2275
2357
|
f.heldY += dy;
|
|
2358
|
+
if (this.wheelSegment.bunched) {
|
|
2359
|
+
// A raised speed moves on from where the pan is shown, so the
|
|
2360
|
+
// position never jumps inside the bunch.
|
|
2361
|
+
const since = time - f.lastMove;
|
|
2362
|
+
const speedX = f.speedX;
|
|
2363
|
+
const speedY = f.speedY;
|
|
2364
|
+
joinReading(f, f.trueX - f.heldX, f.trueY - f.heldY);
|
|
2365
|
+
f.baseX += (speedX - f.speedX) * since;
|
|
2366
|
+
f.baseY += (speedY - f.speedY) * since;
|
|
2367
|
+
} else {
|
|
2368
|
+
f.readSpan = 0;
|
|
2369
|
+
}
|
|
2276
2370
|
this.followProvisionally(gesture, f, time);
|
|
2277
2371
|
return;
|
|
2278
2372
|
}
|
|
@@ -2285,8 +2379,18 @@ export class GestureHost {
|
|
|
2285
2379
|
const debtY = absorbedDebt(gesture.y - beforeY, dy);
|
|
2286
2380
|
const trueX = beforeX - dx;
|
|
2287
2381
|
const trueY = beforeY - dy;
|
|
2382
|
+
// A wheel the splitter reads as one stall's merge has no speed of its
|
|
2383
|
+
// own. It joins the reading of the move before its bunch, whose
|
|
2384
|
+
// interval holds its time.
|
|
2288
2385
|
const elapsed = time - f.lastMove;
|
|
2289
|
-
if (
|
|
2386
|
+
if (this.wheelSegment?.bunched === true) {
|
|
2387
|
+
joinReading(f, trueX, trueY);
|
|
2388
|
+
} else if (elapsed > 0) {
|
|
2389
|
+
f.priorSpeedX = f.speedX;
|
|
2390
|
+
f.priorSpeedY = f.speedY;
|
|
2391
|
+
f.readFromX = f.trueX;
|
|
2392
|
+
f.readFromY = f.trueY;
|
|
2393
|
+
f.readSpan = elapsed;
|
|
2290
2394
|
f.speedX = (trueX - f.trueX) / elapsed;
|
|
2291
2395
|
f.speedY = (trueY - f.trueY) / elapsed;
|
|
2292
2396
|
}
|
|
@@ -2437,6 +2541,11 @@ export class GestureHost {
|
|
|
2437
2541
|
baseY: kept.y,
|
|
2438
2542
|
speedX: 0,
|
|
2439
2543
|
speedY: 0,
|
|
2544
|
+
readFromX: kept.x,
|
|
2545
|
+
readFromY: kept.y,
|
|
2546
|
+
readSpan: 0,
|
|
2547
|
+
priorSpeedX: 0,
|
|
2548
|
+
priorSpeedY: 0,
|
|
2440
2549
|
};
|
|
2441
2550
|
}
|
|
2442
2551
|
this.arena.began(
|
|
@@ -2857,13 +2966,19 @@ export class GestureHost {
|
|
|
2857
2966
|
if (locksSelectionFor('touch')) {
|
|
2858
2967
|
toLock.push({id, target, consumerElement});
|
|
2859
2968
|
}
|
|
2860
|
-
// The finger's events keep going to what the engine hit.
|
|
2969
|
+
// The finger's events keep going to what the engine hit. A disabled
|
|
2970
|
+
// participant can never claim, so a scroll never waits on it.
|
|
2861
2971
|
this.watchTarget(
|
|
2862
2972
|
touch.identifier,
|
|
2863
2973
|
native,
|
|
2864
|
-
recognizers.some(
|
|
2865
|
-
|
|
2866
|
-
|
|
2974
|
+
recognizers.some(
|
|
2975
|
+
recognizer => recognizer.isEnabled && claimsWhileMoving(recognizer),
|
|
2976
|
+
) ||
|
|
2977
|
+
(consumer?.keepsTouch != null && consumer.isEnabled?.() !== false),
|
|
2978
|
+
(consumer != null && consumer.isEnabled?.() !== false) ||
|
|
2979
|
+
recognizers.some(
|
|
2980
|
+
recognizer => recognizer.isEnabled && recognizer.claimsTouches,
|
|
2981
|
+
),
|
|
2867
2982
|
);
|
|
2868
2983
|
this.lastFed.set(id, {x: touch.clientX, y: touch.clientY, time});
|
|
2869
2984
|
this.pairTouch(id, {x: touch.clientX, y: touch.clientY, target: native});
|
|
@@ -2898,6 +3013,11 @@ export class GestureHost {
|
|
|
2898
3013
|
for (const input of untracked) {
|
|
2899
3014
|
this.arena.untrackedBegan(input);
|
|
2900
3015
|
}
|
|
3016
|
+
// Again once the new fingers are delivered: a pinch's second finger may
|
|
3017
|
+
// have landed on another one-finger pan, the next row.
|
|
3018
|
+
if (this.fingerTargets.length > 1 && !this.isFingerClaimed()) {
|
|
3019
|
+
this.failUnclaimedLoneFingerPans();
|
|
3020
|
+
}
|
|
2901
3021
|
// Stamped after the consumers judged the touch: the brake asks whether
|
|
2902
3022
|
// an EARLIER finger is still driving a scroll.
|
|
2903
3023
|
const landed = landedOn(event);
|
|
@@ -3143,7 +3263,14 @@ export class GestureHost {
|
|
|
3143
3263
|
// A tap sent to what is drawn: the engine's click would hit the layout
|
|
3144
3264
|
// position, so it is cancelled and the tap clicks what it touched.
|
|
3145
3265
|
for (const end of retargetedEnds) {
|
|
3146
|
-
if (
|
|
3266
|
+
if (
|
|
3267
|
+
this.clickRetargetedTap(
|
|
3268
|
+
end.landed,
|
|
3269
|
+
end,
|
|
3270
|
+
dispositions.get(end.id),
|
|
3271
|
+
'touch',
|
|
3272
|
+
)
|
|
3273
|
+
) {
|
|
3147
3274
|
cancelsClick = true;
|
|
3148
3275
|
}
|
|
3149
3276
|
}
|
|
@@ -3151,7 +3278,7 @@ export class GestureHost {
|
|
|
3151
3278
|
if (event.cancelable) {
|
|
3152
3279
|
event.preventDefault();
|
|
3153
3280
|
}
|
|
3154
|
-
armClickGuard(this.doc);
|
|
3281
|
+
armClickGuard(this.doc, {takesLateMouse: true});
|
|
3155
3282
|
}
|
|
3156
3283
|
};
|
|
3157
3284
|
|
|
@@ -3165,6 +3292,7 @@ export class GestureHost {
|
|
|
3165
3292
|
landed: {x: number; y: number; target: EventTarget} | undefined,
|
|
3166
3293
|
end: {x: number; y: number},
|
|
3167
3294
|
disposition: ClickDisposition | undefined,
|
|
3295
|
+
pointerType: string,
|
|
3168
3296
|
): boolean {
|
|
3169
3297
|
if (landed == null || disposition !== 'allow') {
|
|
3170
3298
|
return false;
|
|
@@ -3173,7 +3301,7 @@ export class GestureHost {
|
|
|
3173
3301
|
if (moved > UIKIT_TAP.allowableMovement.value) {
|
|
3174
3302
|
return false;
|
|
3175
3303
|
}
|
|
3176
|
-
this.clickRetargeted(landed.target, end.x, end.y);
|
|
3304
|
+
this.clickRetargeted(landed.target, end.x, end.y, pointerType);
|
|
3177
3305
|
return true;
|
|
3178
3306
|
}
|
|
3179
3307
|
|
|
@@ -3485,6 +3613,7 @@ export class GestureHost {
|
|
|
3485
3613
|
if (!isPointerKind(event.pointerType)) {
|
|
3486
3614
|
return;
|
|
3487
3615
|
}
|
|
3616
|
+
this.dropCancelledLifts(event);
|
|
3488
3617
|
if (event.pointerType === 'touch' && this.usesTouchEvents) {
|
|
3489
3618
|
this.pairPointer(event.pointerId, {
|
|
3490
3619
|
x: event.clientX,
|
|
@@ -3493,6 +3622,13 @@ export class GestureHost {
|
|
|
3493
3622
|
});
|
|
3494
3623
|
return;
|
|
3495
3624
|
}
|
|
3625
|
+
if (event.pointerType === 'touch' && event.isPrimary === false) {
|
|
3626
|
+
// Fingers from pointer events: a second one, wherever either lands,
|
|
3627
|
+
// leaves the two to the page's pinch, as onTouchStart does. A finger
|
|
3628
|
+
// that is not the primary pointer is a second finger, even where the
|
|
3629
|
+
// host never heard the first.
|
|
3630
|
+
this.failUnclaimedLoneFingerPans();
|
|
3631
|
+
}
|
|
3496
3632
|
// A right click, a pen's barrel button, or a ctrl-click on macOS (its
|
|
3497
3633
|
// context click) starts no press (FR43).
|
|
3498
3634
|
if (event.pointerType !== 'touch' && !isPrimaryClick(event)) {
|
|
@@ -3514,6 +3650,7 @@ export class GestureHost {
|
|
|
3514
3650
|
}
|
|
3515
3651
|
const id = this.nextId++;
|
|
3516
3652
|
this.pointerIds.set(event.pointerId, id);
|
|
3653
|
+
this.pointerKinds.set(event.pointerId, event.pointerType);
|
|
3517
3654
|
if (target !== landed && target != null) {
|
|
3518
3655
|
this.retargeted.set(id, {x: event.clientX, y: event.clientY, target});
|
|
3519
3656
|
}
|
|
@@ -3535,6 +3672,15 @@ export class GestureHost {
|
|
|
3535
3672
|
consumer,
|
|
3536
3673
|
},
|
|
3537
3674
|
]);
|
|
3675
|
+
if (
|
|
3676
|
+
event.pointerType === 'touch' &&
|
|
3677
|
+
event.isPrimary === false &&
|
|
3678
|
+
!this.isFingerClaimed()
|
|
3679
|
+
) {
|
|
3680
|
+
// Again once this finger is delivered: it may have landed on another
|
|
3681
|
+
// one-finger pan.
|
|
3682
|
+
this.failUnclaimedLoneFingerPans();
|
|
3683
|
+
}
|
|
3538
3684
|
if (locksSelectionFor(event.pointerType)) {
|
|
3539
3685
|
// The presented target: what the pen is on, where the engine's own
|
|
3540
3686
|
// hit test may still see the motion's start.
|
|
@@ -3593,9 +3739,14 @@ export class GestureHost {
|
|
|
3593
3739
|
}
|
|
3594
3740
|
const id = this.pointerIds.get(event.pointerId);
|
|
3595
3741
|
if (id == null) {
|
|
3742
|
+
// A contact the lost focus cancelled: its lift clicks nothing.
|
|
3743
|
+
if (this.cancelledPointers.delete(event.pointerId)) {
|
|
3744
|
+
this.refuseCancelledLift(event);
|
|
3745
|
+
}
|
|
3596
3746
|
return;
|
|
3597
3747
|
}
|
|
3598
3748
|
this.pointerIds.delete(event.pointerId);
|
|
3749
|
+
this.pointerKinds.delete(event.pointerId);
|
|
3599
3750
|
this.unlockSelection(id);
|
|
3600
3751
|
const dispositions = this.arena.ended([
|
|
3601
3752
|
{id, x: event.clientX, y: event.clientY, time: eventTime(event)},
|
|
@@ -3607,9 +3758,10 @@ export class GestureHost {
|
|
|
3607
3758
|
landed,
|
|
3608
3759
|
{x: event.clientX, y: event.clientY},
|
|
3609
3760
|
dispositions.get(id),
|
|
3761
|
+
event.pointerType,
|
|
3610
3762
|
);
|
|
3611
3763
|
if (!clicked && needsSuppression(dispositions)) {
|
|
3612
|
-
armClickGuard(this.doc);
|
|
3764
|
+
armClickGuard(this.doc, {takesLateMouse: event.pointerType === 'touch'});
|
|
3613
3765
|
}
|
|
3614
3766
|
// A finger read from its pointer events: the touchend that follows the
|
|
3615
3767
|
// lift is cancelled when a gesture took it, which the lift itself may
|
|
@@ -3698,9 +3850,12 @@ export class GestureHost {
|
|
|
3698
3850
|
}
|
|
3699
3851
|
return;
|
|
3700
3852
|
}
|
|
3853
|
+
// A contact that ends in a cancel owes no refused lift.
|
|
3854
|
+
this.cancelledPointers.delete(event.pointerId);
|
|
3701
3855
|
const id = this.pointerIds.get(event.pointerId);
|
|
3702
3856
|
if (id != null) {
|
|
3703
3857
|
this.pointerIds.delete(event.pointerId);
|
|
3858
|
+
this.pointerKinds.delete(event.pointerId);
|
|
3704
3859
|
this.unlockSelection(id, true);
|
|
3705
3860
|
this.retargeted.delete(id);
|
|
3706
3861
|
this.arena.cancelled([id], eventTime(event));
|
|
@@ -3767,7 +3922,10 @@ export class GestureHost {
|
|
|
3767
3922
|
|
|
3768
3923
|
private readonly onContextMenu = (event: MouseEvent): void => {
|
|
3769
3924
|
for (const touch of this.arena.touches) {
|
|
3770
|
-
if (
|
|
3925
|
+
if (
|
|
3926
|
+
this.arena.isClaimed(touch.id) ||
|
|
3927
|
+
this.arena.consumerOf(touch.id)?.holdsContextMenu?.(touch.id) === true
|
|
3928
|
+
) {
|
|
3771
3929
|
event.preventDefault();
|
|
3772
3930
|
return;
|
|
3773
3931
|
}
|
|
@@ -3902,20 +4060,26 @@ export class GestureHost {
|
|
|
3902
4060
|
}
|
|
3903
4061
|
}
|
|
3904
4062
|
}
|
|
4063
|
+
/** Whether a finger's drag is claimed: then two fingers make no pinch. */
|
|
4064
|
+
private isFingerClaimed(): boolean {
|
|
4065
|
+
return this.arena.touches.some(
|
|
4066
|
+
touch => touch.pointerType === 'touch' && this.arena.isClaimed(touch.id),
|
|
4067
|
+
);
|
|
4068
|
+
}
|
|
3905
4069
|
|
|
3906
4070
|
private readonly onVisibilityChange = (): void => {
|
|
3907
4071
|
if (this.doc.visibilityState === 'hidden') {
|
|
3908
4072
|
this.cancelEverything(this.arena.now());
|
|
3909
|
-
// As at a blur:
|
|
3910
|
-
//
|
|
4073
|
+
// As at a blur: an armed press's page listeners go once nothing is left
|
|
4074
|
+
// to hear.
|
|
3911
4075
|
this.releaseArmedPress();
|
|
3912
4076
|
}
|
|
3913
4077
|
};
|
|
3914
4078
|
|
|
3915
4079
|
private readonly onBlur = (): void => {
|
|
3916
4080
|
this.cancelEverything(this.arena.now());
|
|
3917
|
-
//
|
|
3918
|
-
//
|
|
4081
|
+
// An armed press's page listeners go once nothing is left to hear. A pen
|
|
4082
|
+
// or a pointer-read finger the blur cancelled still owes its lift.
|
|
3919
4083
|
this.releaseArmedPress();
|
|
3920
4084
|
};
|
|
3921
4085
|
|
|
@@ -3938,8 +4102,27 @@ export class GestureHost {
|
|
|
3938
4102
|
);
|
|
3939
4103
|
}
|
|
3940
4104
|
|
|
4105
|
+
/**
|
|
4106
|
+
* The lift of a contact the lost focus cancelled: its click is refused,
|
|
4107
|
+
* and a finger's touchend after it is cancelled.
|
|
4108
|
+
*/
|
|
4109
|
+
private refuseCancelledLift(event: PointerEvent): void {
|
|
4110
|
+
armClickGuard(this.doc, {takesLateMouse: event.pointerType === 'touch'});
|
|
4111
|
+
if (event.pointerType === 'touch') {
|
|
4112
|
+
// Noted as a claimed lift is: capped, and gone after its time.
|
|
4113
|
+
this.noteClaimedLift(event);
|
|
4114
|
+
}
|
|
4115
|
+
}
|
|
4116
|
+
|
|
3941
4117
|
/** The app lost focus: UIKit cancels every touch in flight. */
|
|
3942
4118
|
private cancelEverything(time: number): void {
|
|
4119
|
+
// The browser may keep a pen or a pointer-read finger down: its lift must
|
|
4120
|
+
// not click. A mouse button held through the blur keeps its click.
|
|
4121
|
+
for (const [pointerId, kind] of this.pointerKinds) {
|
|
4122
|
+
if (kind !== 'mouse') {
|
|
4123
|
+
this.cancelledPointers.set(pointerId, kind);
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
3943
4126
|
const ids = [...this.pointerIds.values()];
|
|
3944
4127
|
for (const id of ids) {
|
|
3945
4128
|
this.unlockSelection(id, true);
|
|
@@ -3953,6 +4136,7 @@ export class GestureHost {
|
|
|
3953
4136
|
}
|
|
3954
4137
|
}
|
|
3955
4138
|
this.pointerIds.clear();
|
|
4139
|
+
this.pointerKinds.clear();
|
|
3956
4140
|
this.retargeted.clear();
|
|
3957
4141
|
this.fingerPointers.clear();
|
|
3958
4142
|
this.pendingPointers.clear();
|
|
@@ -95,6 +95,12 @@ export interface PressTrackerOptions {
|
|
|
95
95
|
* does nothing passes none. @default undefined
|
|
96
96
|
*/
|
|
97
97
|
selectionLock?: SelectionLock;
|
|
98
|
+
/**
|
|
99
|
+
* Whether the press of `touchId` holds the browser's context menu closed
|
|
100
|
+
* now; the host then cancels it. For a control whose hold acts, such as a
|
|
101
|
+
* switch. @default undefined
|
|
102
|
+
*/
|
|
103
|
+
holdsContextMenu?: (touchId: number) => boolean;
|
|
98
104
|
trackingExpansion?: number;
|
|
99
105
|
/**
|
|
100
106
|
* When the highlight waits `contentTouchDelay`: inside a scroller (a
|
|
@@ -312,6 +318,10 @@ export function createPressTracker(options: PressTrackerOptions): PressTracker {
|
|
|
312
318
|
return options.isEnabled?.() !== false;
|
|
313
319
|
},
|
|
314
320
|
|
|
321
|
+
holdsContextMenu(id: number): boolean {
|
|
322
|
+
return options.holdsContextMenu?.(id) === true;
|
|
323
|
+
},
|
|
324
|
+
|
|
315
325
|
touchBegan(touch: GestureTouch): void {
|
|
316
326
|
if (
|
|
317
327
|
touchId != null ||
|
package/src/gestures/types.ts
CHANGED
|
@@ -202,6 +202,12 @@ export interface TouchConsumer {
|
|
|
202
202
|
* undefined and keeps the browser's long-press selection.
|
|
203
203
|
*/
|
|
204
204
|
readonly selectionLock?: SelectionLock;
|
|
205
|
+
/**
|
|
206
|
+
* Whether this touch's press holds the browser's context menu closed now.
|
|
207
|
+
* A control whose hold acts uses it (a switch's hold toggles it). The host
|
|
208
|
+
* then cancels the menu, as for a claimed touch.
|
|
209
|
+
*/
|
|
210
|
+
holdsContextMenu?(touchId: number): boolean;
|
|
205
211
|
/**
|
|
206
212
|
* Whether the consumer takes touches now (a disabled control does not).
|
|
207
213
|
* The host listens only while something enabled is attached
|
|
@@ -132,6 +132,8 @@ export function usePressTracker(
|
|
|
132
132
|
recognizer,
|
|
133
133
|
),
|
|
134
134
|
isEnabled: () => optionsRef.current.isEnabled?.() ?? true,
|
|
135
|
+
holdsContextMenu: id =>
|
|
136
|
+
optionsRef.current.holdsContextMenu?.(id) === true,
|
|
135
137
|
// The caller's brake, or the host's: a touch that stops a flick
|
|
136
138
|
// presses nothing, as a UIKit control in a decelerating scroll view.
|
|
137
139
|
isBraking: touch => {
|
|
@@ -3,8 +3,9 @@
|
|
|
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
|
*/
|
|
@@ -22,15 +23,32 @@ export interface WheelSegment {
|
|
|
22
23
|
readonly liftNow: boolean;
|
|
23
24
|
/** This event shrank, so it may be momentum: hold it until known. */
|
|
24
25
|
readonly decaying: boolean;
|
|
26
|
+
/** This event came so soon after the one before that it is a merge. */
|
|
27
|
+
readonly bunched: boolean;
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
/** Momentum arrives at frame rate: a pause this long ends it. */
|
|
28
31
|
const MOMENTUM_GAP_MS = 50;
|
|
32
|
+
/**
|
|
33
|
+
* A wheel this close to the one before, ms, is one stall's merge. Frames come
|
|
34
|
+
* further apart at every display rate up to 500 Hz, which is 2 ms.
|
|
35
|
+
*/
|
|
36
|
+
const BUNCHED_MS = 1.5;
|
|
29
37
|
/** Shrinking deltas in a row before the lift is read. */
|
|
30
38
|
const LIFT_RUN = 4;
|
|
31
39
|
/** And how much of its size the run has lost by then. */
|
|
32
40
|
const LIFT_DECAY = 0.8;
|
|
33
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Whether a wheel `intervalMs` after the one before is one stall's merge, not
|
|
44
|
+
* a frame. A stalled page receives the wheels it held back together, within
|
|
45
|
+
* 1.5 ms of each other. The rule reads no history, so slow wheels never make
|
|
46
|
+
* a real frame look like a merge.
|
|
47
|
+
*/
|
|
48
|
+
export function isBunched(intervalMs: number): boolean {
|
|
49
|
+
return intervalMs <= BUNCHED_MS;
|
|
50
|
+
}
|
|
51
|
+
|
|
34
52
|
/**
|
|
35
53
|
* A trackpad gesture has a finger phase and, after a fling, a momentum phase.
|
|
36
54
|
* In the finger phase, deltas come while the fingers move, with pauses when
|
|
@@ -38,7 +56,8 @@ const LIFT_DECAY = 0.8;
|
|
|
38
56
|
* shrink smoothly. The lift is the start of a run of shrinking deltas that
|
|
39
57
|
* has lost a fifth of its size. In the finger phase, a pause of `idleMs`
|
|
40
58
|
* ends the gesture. In the momentum phase, a reversal, a jump up against the
|
|
41
|
-
* decay, or a pause of 50 ms starts a new gesture.
|
|
59
|
+
* decay, or a pause of 50 ms starts a new gesture. A bunched wheel is never
|
|
60
|
+
* a jump. The decay reads it by its last step. Momentum never pauses,
|
|
42
61
|
* reverses or grows.
|
|
43
62
|
*/
|
|
44
63
|
export class WheelSegmenter {
|
|
@@ -55,6 +74,7 @@ export class WheelSegmenter {
|
|
|
55
74
|
const size = Math.abs(delta);
|
|
56
75
|
const sign = Math.sign(delta);
|
|
57
76
|
const gap = time - this.last;
|
|
77
|
+
const bunched = this.count > 0 && isBunched(gap);
|
|
58
78
|
let boundary: WheelBoundary | null = null;
|
|
59
79
|
if (this.count === 0) {
|
|
60
80
|
boundary = this.gesture === 0 ? 'first' : 'idle';
|
|
@@ -65,10 +85,16 @@ export class WheelSegmenter {
|
|
|
65
85
|
boundary = 'reversal';
|
|
66
86
|
} else if (gap >= MOMENTUM_GAP_MS) {
|
|
67
87
|
boundary = 'gap';
|
|
68
|
-
} else if (size >= 2 && size > this.previous * 1.3 + 0.5) {
|
|
88
|
+
} else if (!bunched && size >= 2 && size > this.previous * 1.3 + 0.5) {
|
|
69
89
|
boundary = 'jump';
|
|
70
90
|
}
|
|
71
91
|
}
|
|
92
|
+
// A bunched wheel carries the steps of the frames it merged. The decay
|
|
93
|
+
// goes on from its last step, so the steps after it read as they are.
|
|
94
|
+
const steps =
|
|
95
|
+
boundary == null && bunched && this.previous > 0
|
|
96
|
+
? Math.max(1, Math.round(size / this.previous))
|
|
97
|
+
: 1;
|
|
72
98
|
if (boundary != null) {
|
|
73
99
|
this.gesture += 1;
|
|
74
100
|
this.phase = 'finger';
|
|
@@ -78,7 +104,9 @@ export class WheelSegmenter {
|
|
|
78
104
|
let liftNow = false;
|
|
79
105
|
let decaying = false;
|
|
80
106
|
if (this.phase === 'finger' && this.count >= 3 && size > 0) {
|
|
81
|
-
|
|
107
|
+
// A bunched wheel is read by its last step, as the decay goes on from it.
|
|
108
|
+
const step = size / steps;
|
|
109
|
+
decaying = step <= this.previous * 0.995 && step >= this.previous * 0.5;
|
|
82
110
|
if (decaying) {
|
|
83
111
|
if (this.run === 0) {
|
|
84
112
|
this.runStart = this.previous;
|
|
@@ -87,13 +115,13 @@ export class WheelSegmenter {
|
|
|
87
115
|
} else {
|
|
88
116
|
this.run = 0;
|
|
89
117
|
}
|
|
90
|
-
if (this.run >= LIFT_RUN &&
|
|
118
|
+
if (this.run >= LIFT_RUN && step <= this.runStart * LIFT_DECAY) {
|
|
91
119
|
this.phase = 'momentum';
|
|
92
120
|
liftNow = true;
|
|
93
121
|
}
|
|
94
122
|
}
|
|
95
123
|
this.count += 1;
|
|
96
|
-
this.previous = size;
|
|
124
|
+
this.previous = size / steps;
|
|
97
125
|
if (sign !== 0) {
|
|
98
126
|
this.sign = sign;
|
|
99
127
|
}
|
|
@@ -104,6 +132,7 @@ export class WheelSegmenter {
|
|
|
104
132
|
gesture: this.gesture,
|
|
105
133
|
liftNow,
|
|
106
134
|
decaying: decaying && !liftNow,
|
|
135
|
+
bunched: boundary == null && bunched,
|
|
107
136
|
};
|
|
108
137
|
}
|
|
109
138
|
|