@astryxdesign/core 0.7.8 → 0.7.9-canary.0200dfe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell/observeMainOverflow.d.ts.map +1 -1
- package/dist/AppShell/observeMainOverflow.js +9 -6
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +37 -3
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +40 -8
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +4 -3
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +61 -21
- package/dist/Calendar/Calendar.d.ts +14 -2
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +63 -74
- package/dist/Calendar/getInitialFocusDate.d.ts +4 -1
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
- package/dist/Calendar/getInitialFocusDate.js +7 -5
- package/dist/Calendar/hooks/useCalendarDays.d.ts +19 -2
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +57 -64
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts +28 -3
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +33 -22
- package/dist/Calendar/styles.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +74 -18
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts +2 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.js +20 -0
- package/dist/CheckboxList/CheckboxListItem.d.ts +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +40 -14
- package/dist/ClickableCard/ClickableCard.d.ts +1 -1
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +5 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +2 -0
- package/dist/DateInput/DateInput.d.ts +37 -6
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +97 -124
- package/dist/DateInput/MonthScroller.d.ts +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +26 -29
- package/dist/DateInput/MonthYearWheels.d.ts +10 -1
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -1
- package/dist/DateInput/MonthYearWheels.js +54 -42
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +7 -1
- package/dist/DateInput/TouchDateField.d.ts +1 -1
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +26 -21
- package/dist/DateInput/monthGeometry.d.ts +42 -8
- package/dist/DateInput/monthGeometry.d.ts.map +1 -1
- package/dist/DateInput/monthGeometry.js +81 -7
- package/dist/DateInput/useCalendarPresentation.d.ts +10 -0
- package/dist/DateInput/useCalendarPresentation.d.ts.map +1 -0
- package/dist/DateInput/useCalendarPresentation.js +32 -0
- package/dist/DateInput/useTypedDate.d.ts +92 -0
- package/dist/DateInput/useTypedDate.d.ts.map +1 -0
- package/dist/DateInput/useTypedDate.js +269 -0
- package/dist/DateInput/wheelStrip.js +2 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts +17 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +15 -8
- package/dist/DateTimeInput/DateTimeInput.d.ts +26 -3
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +92 -88
- package/dist/DateTimeInput/TouchDateTimeField.d.ts +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +26 -20
- package/dist/Dialog/Dialog.d.ts +2 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +14 -3
- package/dist/Drawer/useDrawerDialogPresence.d.ts +2 -1
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +11 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +11 -8
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -2
- package/dist/Field/inputDisabledFocus.d.ts +4 -4
- package/dist/Field/inputStyles.stylex.d.ts +1 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +16 -2
- package/dist/HoverCard/useHoverCard.d.ts +3 -1
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/InfoTip/InfoTip.d.ts +1 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +6 -18
- package/dist/InputGroup/InputGroup.d.ts +4 -3
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +2 -2
- package/dist/InputGroup/InputGroupText.d.ts +2 -1
- package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupText.js +2 -1
- package/dist/InputGroup/groupStyles.d.ts +1 -1
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +1 -1
- package/dist/Item/Item.d.ts +20 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +97 -29
- package/dist/Item/ItemListRowContext.d.ts +2 -0
- package/dist/Item/ItemListRowContext.d.ts.map +1 -0
- package/dist/Item/ItemListRowContext.js +16 -0
- package/dist/Layer/holdEntranceInput.d.ts +24 -0
- package/dist/Layer/holdEntranceInput.d.ts.map +1 -0
- package/dist/Layer/holdEntranceInput.js +65 -0
- package/dist/Layer/inputHold.d.ts +49 -0
- package/dist/Layer/inputHold.d.ts.map +1 -0
- package/dist/Layer/inputHold.js +636 -0
- package/dist/Layer/outsidePress.d.ts +4 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +18 -1
- package/dist/Layer/preserveAnimations.d.ts +1 -5
- package/dist/Layer/preserveAnimations.d.ts.map +1 -1
- package/dist/Layer/preserveAnimations.js +12 -214
- package/dist/Layer/useBackdropPress.d.ts +8 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -1
- package/dist/Layer/useBackdropPress.js +31 -2
- package/dist/Layer/useLayer.d.ts +3 -1
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +64 -4
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +4 -0
- package/dist/Layout/LayoutContent.d.ts +3 -1
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +12 -4
- package/dist/Layout/LayoutPanel.d.ts +13 -10
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +81 -11
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -0
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +1 -0
- package/dist/List/ListItem.d.ts +5 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +45 -9
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +56 -39
- package/dist/MetadataList/MetadataList.js +1 -1
- package/dist/MobileNav/MobileNav.d.ts +11 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +39 -1
- package/dist/MoreMenu/MoreMenu.d.ts +5 -3
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +6 -9
- package/dist/NumberInput/NumberInput.d.ts +4 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +244 -11
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +7 -2
- package/dist/Popover/usePopover.d.ts +1 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +12 -5
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +9 -3
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +14 -11
- package/dist/PowerSearch/formatTokenValue.d.ts +6 -2
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatTokenValue.js +6 -3
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +16 -3
- package/dist/Resizable/ResizeHandle.d.ts +5 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +44 -5
- package/dist/Resizable/resizablePane.d.ts +58 -0
- package/dist/Resizable/resizablePane.d.ts.map +1 -0
- package/dist/Resizable/resizablePane.js +137 -0
- package/dist/Resizable/useResizable.d.ts +7 -0
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +13 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SelectableCard/SelectableCard.d.ts +1 -1
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +5 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +51 -10
- package/dist/SideNav/SideNav.d.ts +9 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +45 -10
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +14 -71
- package/dist/Spinner/index.d.ts +1 -1
- package/dist/Spinner/index.d.ts.map +1 -1
- package/dist/Spinner/spinnerRotor.d.ts +28 -0
- package/dist/Spinner/spinnerRotor.d.ts.map +1 -0
- package/dist/Spinner/spinnerRotor.js +98 -0
- package/dist/Stack/StackItem.d.ts +8 -4
- package/dist/Stack/StackItem.d.ts.map +1 -1
- package/dist/Stack/StackItem.js +17 -4
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -10
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +14 -8
- package/dist/Timestamp/formatInstant.d.ts +10 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +13 -27
- package/dist/Timestamp/tooltipEntries.d.ts +5 -3
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +6 -4
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +9 -0
- package/dist/Token/TokenLink.d.ts +1 -1
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +4 -1
- package/dist/Tokenizer/Tokenizer.d.ts +14 -10
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +189 -89
- package/dist/Tooltip/useTooltip.d.ts +3 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +164 -59
- package/dist/TreeList/TreeListItem.d.ts +2 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +27 -3
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/dist/animator/createAnimator.js +2 -2
- package/dist/astryx.css +362 -325
- package/dist/gestures/GestureHost.d.ts +2 -2
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +21 -6
- package/dist/gestures/PanGestureRecognizer.d.ts +11 -1
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +15 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +6 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.d.ts +3 -6
- package/dist/gestures/nativeScroll.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.js +7 -52
- package/dist/gestures/wheelSegmenter.d.ts +68 -1
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +199 -10
- package/dist/hooks/StackItemScrollRegion.d.ts +31 -0
- package/dist/hooks/StackItemScrollRegion.d.ts.map +1 -0
- package/dist/hooks/StackItemScrollRegion.js +40 -0
- package/dist/hooks/computeOverflow.d.ts +2 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +1 -1
- package/dist/hooks/menuPressGesture.d.ts +133 -21
- package/dist/hooks/menuPressGesture.d.ts.map +1 -1
- package/dist/hooks/menuPressGesture.js +155 -30
- package/dist/hooks/menuPressValues.d.ts +16 -0
- package/dist/hooks/menuPressValues.d.ts.map +1 -0
- package/dist/hooks/menuPressValues.js +18 -0
- package/dist/hooks/useClickableContainer.d.ts +36 -7
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +63 -14
- package/dist/hooks/useFocusTrap.d.ts +10 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +225 -132
- package/dist/hooks/useKeyboardHighlight.d.ts +17 -0
- package/dist/hooks/useKeyboardHighlight.d.ts.map +1 -0
- package/dist/hooks/useKeyboardHighlight.js +38 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +37 -12
- package/dist/hooks/useMenuPress.d.ts +34 -1
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +93 -5
- package/dist/hooks/useOverflow.d.ts +10 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +214 -23
- package/dist/hooks/usePressFeedback.d.ts +6 -6
- package/dist/hooks/usePressFeedback.js +6 -6
- package/dist/hooks/useScrollRegionProps.d.ts +35 -0
- package/dist/hooks/useScrollRegionProps.d.ts.map +1 -0
- package/dist/hooks/useScrollRegionProps.js +51 -0
- package/dist/i18n/InternationalizationContext.d.ts +6 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.d.ts +23 -3
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +8 -3
- package/dist/i18n/generated-english/DateInput/DateInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateInput/DateInput.generated.js +0 -1
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.js +16 -0
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.js +0 -1
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts +8 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.js +12 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +5 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +5 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/useCalendarSystem.d.ts +19 -0
- package/dist/i18n/useCalendarSystem.d.ts.map +1 -0
- package/dist/i18n/useCalendarSystem.js +61 -0
- package/dist/internal/calendar-system.d.ts +18 -0
- package/dist/internal/calendar-system.d.ts.map +1 -0
- package/dist/internal/calendar-system.js +19 -0
- package/dist/internal/spinner-rotor.d.ts +16 -0
- package/dist/internal/spinner-rotor.d.ts.map +1 -0
- package/dist/internal/spinner-rotor.js +16 -0
- package/dist/internal/touch.d.ts +20 -2
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +29 -3
- package/dist/motion/animator.d.ts +5 -5
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +7 -6
- package/dist/motion/carryAnimations.d.ts +58 -0
- package/dist/motion/carryAnimations.d.ts.map +1 -0
- package/dist/motion/carryAnimations.js +305 -0
- package/dist/motion/transientCopy.d.ts +4 -2
- package/dist/motion/transientCopy.d.ts.map +1 -1
- package/dist/motion/transientCopy.js +34 -5
- package/dist/motion/uikit/gestures.d.ts +41 -0
- package/dist/motion/uikit/gestures.d.ts.map +1 -1
- package/dist/motion/uikit/gestures.js +25 -0
- package/dist/motion/uikit/index.d.ts +1 -1
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +1 -1
- package/dist/motion/uikit/timing.d.ts +14 -10
- package/dist/motion/uikit/timing.d.ts.map +1 -1
- package/dist/motion/uikit/timing.js +7 -5
- package/dist/privateAttributes/menuPressLit.stylex.d.ts +52 -0
- package/dist/privateAttributes/menuPressLit.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/menuPressLit.stylex.js +99 -0
- package/dist/privateAttributes/press.stylex.d.ts +142 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/press.stylex.js +101 -0
- package/dist/theme/themeMotion.d.ts +3 -2
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +3 -2
- package/dist/theme/tokens.stylex.d.ts +2 -2
- package/dist/theme/tokens.stylex.js +1 -1
- package/dist/utils/calendarDateParser.d.ts +110 -0
- package/dist/utils/calendarDateParser.d.ts.map +1 -0
- package/dist/utils/calendarDateParser.js +1225 -0
- package/dist/utils/calendarSystem.d.ts +176 -0
- package/dist/utils/calendarSystem.d.ts.map +1 -0
- package/dist/utils/calendarSystem.js +569 -0
- package/dist/utils/coarsePointer.d.ts +5 -0
- package/dist/utils/coarsePointer.d.ts.map +1 -1
- package/dist/utils/coarsePointer.js +22 -13
- package/dist/utils/flatTree.d.ts +6 -3
- package/dist/utils/flatTree.d.ts.map +1 -1
- package/dist/utils/flatTree.js +13 -3
- package/dist/utils/focusReturn.d.ts +34 -13
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +64 -17
- package/dist/utils/hitArea.d.ts +8 -1
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +99 -9
- package/dist/utils/inputPresentation.d.ts +9 -1
- package/dist/utils/inputPresentation.d.ts.map +1 -1
- package/dist/utils/inputPresentation.js +15 -1
- package/dist/utils/inputStream.d.ts +14 -1
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +40 -9
- package/dist/utils/interactionOverlay.stylex.d.ts +5 -9
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +29 -31
- package/dist/utils/plainDate.d.ts +38 -7
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +92 -18
- package/dist/utils/pressFeedback.d.ts +10 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +40 -15
- package/dist/utils/pressGesture.d.ts +12 -6
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +26 -8
- package/dist/utils/scrollView.d.ts +25 -0
- package/dist/utils/scrollView.d.ts.map +1 -0
- package/dist/utils/scrollView.js +108 -0
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +1 -10
- package/dist/utils/touchHitArea.d.ts +30 -0
- package/dist/utils/touchHitArea.d.ts.map +1 -0
- package/dist/utils/touchHitArea.js +167 -0
- package/dist/utils/touchHitArea.stylex.d.ts +38 -0
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -0
- package/dist/utils/touchHitArea.stylex.js +48 -0
- package/dist/utils/triggerFocus.d.ts +5 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -1
- package/dist/utils/triggerFocus.js +9 -2
- package/locales/en.json +21 -1
- package/locales/pseudo.json +15 -0
- package/package.json +15 -4
- package/src/AppShell/observeMainOverflow.ts +9 -6
- package/src/BottomSheet/BottomSheet.tsx +45 -3
- package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
- package/src/BottomSheet/bottomSheetStack.ts +4 -3
- package/src/BottomSheet/useSheetGestures.ts +83 -20
- package/src/Calendar/Calendar.doc.mjs +76 -6
- package/src/Calendar/Calendar.tsx +123 -104
- package/src/Calendar/getInitialFocusDate.ts +22 -8
- package/src/Calendar/hooks/useCalendarDays.ts +89 -63
- package/src/Calendar/hooks/useCalendarNavigation.ts +68 -26
- package/src/CheckboxInput/CheckboxInput.doc.mjs +5 -4
- package/src/CheckboxInput/CheckboxInput.tsx +105 -20
- package/src/CheckboxInput/CheckboxRowPressContext.ts +22 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/CheckboxList/CheckboxListItem.tsx +35 -14
- package/src/ClickableCard/ClickableCard.tsx +8 -1
- package/src/ContextMenu/ContextMenu.tsx +2 -0
- package/src/DateInput/DateInput.doc.mjs +45 -12
- package/src/DateInput/DateInput.tsx +165 -179
- package/src/DateInput/MonthScroller.tsx +39 -37
- package/src/DateInput/MonthYearWheels.tsx +68 -47
- package/src/DateInput/PickerWheel.tsx +7 -2
- package/src/DateInput/TouchDateField.tsx +45 -17
- package/src/DateInput/monthGeometry.ts +110 -8
- package/src/DateInput/useCalendarPresentation.ts +64 -0
- package/src/DateInput/useTypedDate.ts +469 -0
- package/src/DateInput/wheelStrip.ts +2 -2
- package/src/DateRangeInput/DateRangeInput.doc.mjs +9 -0
- package/src/DateRangeInput/DateRangeInput.tsx +43 -9
- package/src/DateTimeInput/DateTimeInput.doc.mjs +42 -9
- package/src/DateTimeInput/DateTimeInput.tsx +138 -148
- package/src/DateTimeInput/TouchDateTimeField.tsx +31 -16
- package/src/Dialog/Dialog.doc.mjs +1 -1
- package/src/Dialog/Dialog.tsx +14 -2
- package/src/Drawer/Drawer.doc.mjs +1 -1
- package/src/Drawer/useDrawerDialogPresence.ts +9 -2
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -2
- package/src/DropdownMenu/DropdownMenu.tsx +31 -7
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuItem.tsx +8 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -1
- package/src/FileInput/FileInput.tsx +16 -2
- package/src/HoverCard/useHoverCard.tsx +3 -1
- package/src/Icon/useIcon.doc.mjs +94 -0
- package/src/InfoTip/InfoTip.doc.mjs +26 -2
- package/src/InfoTip/InfoTip.tsx +6 -27
- package/src/InputGroup/InputGroup.doc.mjs +4 -3
- package/src/InputGroup/InputGroup.tsx +4 -3
- package/src/InputGroup/InputGroupText.doc.mjs +45 -3
- package/src/InputGroup/InputGroupText.tsx +2 -1
- package/src/InputGroup/groupStyles.ts +3 -1
- package/src/Item/Item.tsx +139 -35
- package/src/Item/ItemListRowContext.tsx +18 -0
- package/src/Layer/holdEntranceInput.ts +84 -0
- package/src/Layer/inputHold.ts +734 -0
- package/src/Layer/outsidePress.ts +18 -1
- package/src/Layer/preserveAnimations.ts +12 -275
- package/src/Layer/useBackdropPress.ts +41 -1
- package/src/Layer/useLayer.tsx +77 -4
- package/src/Layer/useTouchTrigger.ts +4 -0
- package/src/Layout/LayoutContent.doc.mjs +6 -3
- package/src/Layout/LayoutContent.tsx +10 -4
- package/src/Layout/LayoutPanel.doc.mjs +14 -11
- package/src/Layout/LayoutPanel.tsx +113 -16
- package/src/Lightbox/Lightbox.tsx +4 -0
- package/src/List/List.doc.mjs +10 -1
- package/src/List/List.tsx +5 -0
- package/src/List/ListItem.tsx +63 -8
- package/src/Markdown/parser.ts +65 -42
- package/src/MetadataList/MetadataList.tsx +1 -1
- package/src/MobileNav/MobileNav.doc.mjs +3 -3
- package/src/MobileNav/MobileNav.tsx +39 -1
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -4
- package/src/MoreMenu/MoreMenu.tsx +5 -3
- package/src/MultiSelector/MultiSelector.tsx +7 -17
- package/src/NumberInput/NumberInput.doc.mjs +1 -1
- package/src/NumberInput/NumberInput.tsx +259 -11
- package/src/OverflowList/OverflowList.tsx +15 -9
- package/src/Popover/usePopover.tsx +1 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
- package/src/PowerSearch/PowerSearch.tsx +20 -3
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +4 -1
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -11
- package/src/PowerSearch/formatTokenValue.ts +7 -1
- package/src/RadioList/RadioListItem.doc.mjs +3 -2
- package/src/RadioList/RadioListItem.tsx +16 -6
- package/src/Resizable/Resizable.doc.mjs +40 -12
- package/src/Resizable/ResizeHandle.tsx +68 -6
- package/src/Resizable/resizablePane.ts +179 -0
- package/src/Resizable/useResizable.ts +15 -0
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +3 -3
- package/src/SelectableCard/SelectableCard.tsx +8 -1
- package/src/Selector/Selector.tsx +83 -8
- package/src/SideNav/SideNav.doc.mjs +2 -2
- package/src/SideNav/SideNav.tsx +87 -12
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +7 -89
- package/src/Spinner/index.ts +1 -5
- package/src/Spinner/spinnerRotor.ts +113 -0
- package/src/Stack/Stack.doc.mjs +1 -1
- package/src/Stack/StackItem.tsx +27 -13
- package/src/Switch/Switch.tsx +7 -6
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/TabList/Tab.tsx +5 -1
- package/src/Table/plugins/sortable/useTableSortable.tsx +1 -1
- package/src/Timestamp/Timestamp.doc.mjs +3 -3
- package/src/Timestamp/Timestamp.tsx +13 -8
- package/src/Timestamp/formatInstant.ts +49 -28
- package/src/Timestamp/tooltipEntries.ts +7 -3
- package/src/Token/Token.tsx +18 -1
- package/src/Token/TokenLink.tsx +7 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +3 -3
- package/src/Tokenizer/Tokenizer.tsx +252 -115
- package/src/Tooltip/useTooltip.tsx +180 -80
- package/src/TreeList/TreeListItem.tsx +36 -2
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
- package/src/animator/createAnimator.ts +3 -3
- package/src/gestures/GestureHost.ts +21 -5
- package/src/gestures/PanGestureRecognizer.ts +19 -2
- package/src/gestures/README.md +14 -5
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +6 -1
- package/src/gestures/nativeScroll.ts +12 -68
- package/src/gestures/wheelSegmenter.ts +243 -10
- package/src/hooks/StackItemScrollRegion.tsx +57 -0
- package/src/hooks/computeOverflow.ts +1 -1
- package/src/hooks/menuPressGesture.ts +244 -38
- package/src/hooks/menuPressValues.ts +18 -0
- package/src/hooks/useClickableContainer.doc.mjs +8 -2
- package/src/hooks/useClickableContainer.ts +93 -15
- package/src/hooks/useFocusTrap.ts +268 -151
- package/src/hooks/useKeyboardHighlight.ts +71 -0
- package/src/hooks/useMediaQuery.ts +41 -12
- package/src/hooks/useMenuPress.ts +118 -11
- package/src/hooks/useOverflow.ts +321 -75
- package/src/hooks/usePressFeedback.doc.mjs +3 -3
- package/src/hooks/usePressFeedback.ts +6 -6
- package/src/hooks/useScrollRegionProps.ts +76 -0
- package/src/i18n/InternationalizationContext.ts +6 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +29 -1
- package/src/i18n/InternationalizationProvider.tsx +35 -3
- package/src/i18n/generated-english/DateInput/DateInput.generated.ts +0 -1
- package/src/i18n/generated-english/DateInput/useTypedDate.generated.ts +17 -0
- package/src/i18n/generated-english/DateTimeInput/DateTimeInput.generated.ts +0 -1
- package/src/i18n/generated-english/hooks/useScrollRegionProps.generated.ts +13 -0
- package/src/i18n/generated-locales/en.generated.ts +7 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +7 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/useCalendarSystem.ts +95 -0
- package/src/internal/calendar-system.ts +26 -0
- package/src/internal/spinner-rotor.ts +20 -0
- package/src/internal/touch.ts +43 -2
- package/src/motion/MEASUREMENTS.md +11 -0
- package/src/motion/README.md +3 -3
- package/src/motion/animator.ts +7 -7
- package/src/motion/carryAnimations.ts +389 -0
- package/src/motion/transientCopy.ts +45 -5
- package/src/motion/uikit/gestures.ts +22 -0
- package/src/motion/uikit/index.ts +1 -0
- package/src/motion/uikit/timing.ts +7 -5
- package/src/privateAttributes/menuPressLit.stylex.ts +104 -0
- package/src/privateAttributes/press.stylex.ts +261 -0
- package/src/theme/themeMotion.ts +3 -2
- package/src/theme/tokens.stylex.ts +1 -1
- package/src/utils/calendarDateParser.ts +1385 -0
- package/src/utils/calendarSystem.ts +832 -0
- package/src/utils/coarsePointer.ts +27 -14
- package/src/utils/flatTree.ts +15 -3
- package/src/utils/focusReturn.ts +78 -18
- package/src/utils/hitArea.ts +138 -9
- package/src/utils/inputPresentation.ts +21 -1
- package/src/utils/inputStream.ts +47 -10
- package/src/utils/interactionOverlay.stylex.ts +19 -22
- package/src/utils/plainDate.ts +130 -19
- package/src/utils/pressFeedback.ts +46 -14
- package/src/utils/pressGesture.ts +35 -9
- package/src/utils/scrollView.ts +135 -0
- package/src/utils/selectionLock.ts +5 -10
- package/src/utils/touchHitArea.stylex.ts +56 -0
- package/src/utils/touchHitArea.ts +177 -0
- package/src/utils/triggerFocus.ts +17 -4
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
type ReactNode,
|
|
22
22
|
type RefCallback,
|
|
23
23
|
} from 'react';
|
|
24
|
-
import {createTriggerFocusGate} from '../utils/triggerFocus';
|
|
24
|
+
import {createTriggerFocusGate, isFocusOnTrigger} from '../utils/triggerFocus';
|
|
25
25
|
import * as stylex from '@stylexjs/stylex';
|
|
26
26
|
import {
|
|
27
27
|
useLayerInternal,
|
|
@@ -37,6 +37,7 @@ import {useAnnounceRenderedText} from '../hooks/useAnnounceRenderedText';
|
|
|
37
37
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
38
38
|
import {layerAnimations} from '../Layer/layerAnimations.stylex';
|
|
39
39
|
import {registerLayerSurface} from '../Layer/layerSurfacePress';
|
|
40
|
+
import {noteOutsideDismissal} from '../Layer/outsidePress';
|
|
40
41
|
import {useLayerDismissal} from '../Layer/useLayerDismissal';
|
|
41
42
|
import {themeProps} from '../utils/themeProps';
|
|
42
43
|
import {
|
|
@@ -185,7 +186,8 @@ export interface TooltipReturn {
|
|
|
185
186
|
|
|
186
187
|
/**
|
|
187
188
|
* Ref for the positioning anchor element.
|
|
188
|
-
*
|
|
189
|
+
* While the layer is shown, and until its exit animation ends, the trigger
|
|
190
|
+
* carries the layer's CSS anchor name.
|
|
189
191
|
*/
|
|
190
192
|
positionRef: RefCallback<HTMLElement>;
|
|
191
193
|
|
|
@@ -199,6 +201,7 @@ export interface TooltipReturn {
|
|
|
199
201
|
/**
|
|
200
202
|
* The CSS anchor name to use for positioning.
|
|
201
203
|
* Use this when you need to set anchorName manually (e.g., display:contents wrapper).
|
|
204
|
+
* Set it only while the layer is shown or its exit animation runs.
|
|
202
205
|
*/
|
|
203
206
|
anchorId: string;
|
|
204
207
|
|
|
@@ -308,6 +311,17 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
308
311
|
const showTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
309
312
|
const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
310
313
|
const triggerRef = useRef<HTMLElement | null>(null);
|
|
314
|
+
// Whether the tooltip is enabled now, for a show that runs after a render
|
|
315
|
+
// (a pending hover show) and for the trigger ref callback.
|
|
316
|
+
const isEnabledRef = useRef(isEnabled);
|
|
317
|
+
isEnabledRef.current = isEnabled;
|
|
318
|
+
// Counts the renders in which the tooltip is disabled. A pending show
|
|
319
|
+
// records it, so a show scheduled before a disable is dropped even when
|
|
320
|
+
// the tooltip is enabled again before the timer fires.
|
|
321
|
+
const disabledRendersRef = useRef(0);
|
|
322
|
+
if (!isEnabled) {
|
|
323
|
+
disabledRendersRef.current += 1;
|
|
324
|
+
}
|
|
311
325
|
|
|
312
326
|
// Clear all timeouts
|
|
313
327
|
const clearTimeouts = useCallback(() => {
|
|
@@ -438,6 +452,7 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
438
452
|
) {
|
|
439
453
|
return;
|
|
440
454
|
}
|
|
455
|
+
noteOutsideDismissal(view.document);
|
|
441
456
|
releaseHold();
|
|
442
457
|
},
|
|
443
458
|
[isHeldOpen, layerId, releaseHold],
|
|
@@ -460,22 +475,16 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
460
475
|
return;
|
|
461
476
|
}
|
|
462
477
|
clearTimeouts();
|
|
478
|
+
const disabledRenders = disabledRendersRef.current;
|
|
463
479
|
showTimeoutRef.current = setTimeout(() => {
|
|
464
|
-
|
|
480
|
+
// A show runs only if the tooltip stayed enabled since it was
|
|
481
|
+
// scheduled: nothing would close a tooltip that opens after a disable.
|
|
482
|
+
if (disabledRendersRef.current === disabledRenders) {
|
|
483
|
+
showLayer();
|
|
484
|
+
}
|
|
465
485
|
}, delay);
|
|
466
486
|
}, [isEnabled, isOpen, clearTimeouts, showLayer, delay]);
|
|
467
487
|
|
|
468
|
-
// A show scheduled while the triggers were enabled must not outlive them:
|
|
469
|
-
// disabling also detaches the leave listener that would have cancelled it,
|
|
470
|
-
// so the timer would open a tooltip that nothing ever closes. Only the
|
|
471
|
-
// pending show is dropped; a pending hide still runs.
|
|
472
|
-
useEffect(() => {
|
|
473
|
-
if (!isEnabled && showTimeoutRef.current) {
|
|
474
|
-
clearTimeout(showTimeoutRef.current);
|
|
475
|
-
showTimeoutRef.current = null;
|
|
476
|
-
}
|
|
477
|
-
}, [isEnabled]);
|
|
478
|
-
|
|
479
488
|
// Schedule hide with delay (suppressed when isOpen is true).
|
|
480
489
|
// A small hover bridge (when hideDelay is 0) lets the pointer travel from the
|
|
481
490
|
// trigger onto the tooltip surface without the tooltip vanishing — required
|
|
@@ -537,23 +546,25 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
537
546
|
// focus that counted still hides on blur (utils/triggerFocus.ts).
|
|
538
547
|
const [focusGate] = useState(createTriggerFocusGate);
|
|
539
548
|
|
|
549
|
+
// Whether focus on `target` opens the tooltip. With a `trigger`, its
|
|
550
|
+
// `focusTrigger` rule applies too. Only `:focus-visible` focus opens it, and
|
|
551
|
+
// a tap never does: a tapped `<input>` also matches `:focus-visible`.
|
|
552
|
+
const opensOnFocus = useCallback(
|
|
553
|
+
(target: HTMLElement, trigger: HTMLElement | null): boolean => {
|
|
554
|
+
if (trigger != null && !isFocusOnTrigger(target, trigger, focusTrigger)) {
|
|
555
|
+
return false;
|
|
556
|
+
}
|
|
557
|
+
return !isTouchInteraction() && target.matches(':focus-visible');
|
|
558
|
+
},
|
|
559
|
+
[focusTrigger, isTouchInteraction],
|
|
560
|
+
);
|
|
561
|
+
|
|
540
562
|
const handleFocusIn = useCallback(
|
|
541
563
|
(e: Event) => {
|
|
542
564
|
if (!focusGate.focusIn(e, focusTrigger) || !isEnabled) {
|
|
543
565
|
return;
|
|
544
566
|
}
|
|
545
|
-
|
|
546
|
-
// filter that out on every element: a tapped `<input>` or contenteditable
|
|
547
|
-
// matches it. Those are exactly the action triggers `auto` just decided
|
|
548
|
-
// to keep shut, so without this the focus reopens what the tap
|
|
549
|
-
// suppressed, over the field the user is trying to type into.
|
|
550
|
-
if (isTouchInteraction()) {
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
// Only show tooltip for keyboard focus (:focus-visible),
|
|
554
|
-
// not programmatic focus (e.g. dialog auto-focus, touch tap)
|
|
555
|
-
const target = e.target as HTMLElement;
|
|
556
|
-
if (!target.matches(':focus-visible')) {
|
|
567
|
+
if (!opensOnFocus(e.target as HTMLElement, null)) {
|
|
557
568
|
return;
|
|
558
569
|
}
|
|
559
570
|
clearTimeouts();
|
|
@@ -563,7 +574,7 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
563
574
|
focusGate,
|
|
564
575
|
focusTrigger,
|
|
565
576
|
isEnabled,
|
|
566
|
-
|
|
577
|
+
opensOnFocus,
|
|
567
578
|
clearTimeouts,
|
|
568
579
|
showLayer,
|
|
569
580
|
],
|
|
@@ -656,66 +667,155 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
656
667
|
],
|
|
657
668
|
);
|
|
658
669
|
|
|
659
|
-
//
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
670
|
+
// The trigger's listeners call the latest handlers through this ref, so the
|
|
671
|
+
// trigger ref callback keeps one identity.
|
|
672
|
+
const handlersRef = useRef({
|
|
673
|
+
handleMouseEnter,
|
|
674
|
+
handleMouseLeave,
|
|
675
|
+
handleFocusIn,
|
|
676
|
+
handleFocusOut,
|
|
677
|
+
handleHeldFocusOut,
|
|
678
|
+
handlePointerEnter,
|
|
679
|
+
handlePointerDown,
|
|
680
|
+
focusTrigger,
|
|
681
|
+
isOpen,
|
|
682
|
+
dropHold,
|
|
683
|
+
hideNow,
|
|
684
|
+
showNow,
|
|
685
|
+
opensOnFocus,
|
|
686
|
+
});
|
|
687
|
+
handlersRef.current = {
|
|
688
|
+
handleMouseEnter,
|
|
689
|
+
handleMouseLeave,
|
|
690
|
+
handleFocusIn,
|
|
691
|
+
handleFocusOut,
|
|
692
|
+
handleHeldFocusOut,
|
|
693
|
+
handlePointerEnter,
|
|
694
|
+
handlePointerDown,
|
|
695
|
+
focusTrigger,
|
|
696
|
+
isOpen,
|
|
697
|
+
dropHold,
|
|
698
|
+
hideNow,
|
|
699
|
+
showNow,
|
|
700
|
+
opensOnFocus,
|
|
701
|
+
};
|
|
679
702
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
703
|
+
// Removes the attached trigger's listeners (the trigger ref callback's
|
|
704
|
+
// cleanup).
|
|
705
|
+
const detachTriggerRef = useRef<(() => void) | null>(null);
|
|
706
|
+
// Set when the trigger detached while the tooltip was disabled: the
|
|
707
|
+
// caller removed the wiring (DropdownMenu's Button while its menu is
|
|
708
|
+
// open), so the next enabled attach reads the focus that arrived meanwhile.
|
|
709
|
+
const wasSuppressedRef = useRef(false);
|
|
710
|
+
|
|
711
|
+
// The trigger's ref callback owns every trigger listener, and reads the
|
|
712
|
+
// trigger's state when it attaches and detaches.
|
|
713
|
+
const interactionRef = useCallback((el: HTMLElement | null) => {
|
|
714
|
+
// A caller that reports `null` by hand detaches the trigger, as the
|
|
715
|
+
// returned cleanup does.
|
|
716
|
+
if (el == null) {
|
|
717
|
+
detachTriggerRef.current?.();
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
if (el === triggerRef.current) {
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
detachTriggerRef.current?.();
|
|
724
|
+
const latest = () => handlersRef.current;
|
|
725
|
+
// `pointerenter` runs before the synthesized `mouseenter` a tap produces,
|
|
726
|
+
// which is what lets the hover path know it is looking at a finger.
|
|
727
|
+
const onPointerEnter = (e: PointerEvent) => latest().handlePointerEnter(e);
|
|
728
|
+
const onMouseEnter = () => latest().handleMouseEnter();
|
|
729
|
+
const onMouseLeave = (e: Event) => latest().handleMouseLeave(e);
|
|
730
|
+
// Press-to-dismiss on a mouse; tap-to-open on a touch pointer.
|
|
731
|
+
const onPointerDown = (e: PointerEvent) => latest().handlePointerDown(e);
|
|
732
|
+
// Focus counts unless focus never opens the tooltip; `auto` decides per
|
|
733
|
+
// event (isFocusForTrigger).
|
|
734
|
+
const onFocusIn = (e: Event) => {
|
|
735
|
+
if (latest().focusTrigger !== 'never') {
|
|
736
|
+
latest().handleFocusIn(e);
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
const onFocusOut = (e: Event) => {
|
|
740
|
+
if (latest().focusTrigger !== 'never') {
|
|
741
|
+
latest().handleFocusOut(e);
|
|
696
742
|
}
|
|
743
|
+
};
|
|
744
|
+
// A held tooltip's own focus-leave close, whatever `focusTrigger` is.
|
|
745
|
+
const onHeldFocusOut = (e: FocusEvent) => latest().handleHeldFocusOut(e);
|
|
746
|
+
el.addEventListener('pointerenter', onPointerEnter);
|
|
747
|
+
el.addEventListener('mouseenter', onMouseEnter);
|
|
748
|
+
el.addEventListener('mouseleave', onMouseLeave);
|
|
749
|
+
el.addEventListener('pointerdown', onPointerDown);
|
|
750
|
+
el.addEventListener('focusin', onFocusIn);
|
|
751
|
+
el.addEventListener('focusout', onFocusOut);
|
|
752
|
+
el.addEventListener('focusout', onHeldFocusOut);
|
|
753
|
+
triggerRef.current = el;
|
|
754
|
+
|
|
755
|
+
// A trigger that attaches again after its wiring was removed
|
|
756
|
+
// (DropdownMenu's Button as its menu closes) missed the focus that
|
|
757
|
+
// arrived meanwhile. Show for it only if it would open the tooltip:
|
|
758
|
+
// returned keyboard focus does, focus returned after a pointer pick does
|
|
759
|
+
// not. Any other attach leaves the tooltip as it is, so a tooltip
|
|
760
|
+
// dismissed with Escape stays closed.
|
|
761
|
+
const focused = el.ownerDocument.activeElement;
|
|
762
|
+
const wasSuppressed = wasSuppressedRef.current;
|
|
763
|
+
if (isEnabledRef.current) {
|
|
764
|
+
wasSuppressedRef.current = false;
|
|
765
|
+
}
|
|
766
|
+
if (
|
|
767
|
+
wasSuppressed &&
|
|
768
|
+
isEnabledRef.current &&
|
|
769
|
+
latest().isOpen === undefined &&
|
|
770
|
+
latest().focusTrigger !== 'never' &&
|
|
771
|
+
focused instanceof HTMLElement &&
|
|
772
|
+
el.contains(focused) &&
|
|
773
|
+
latest().opensOnFocus(focused, el)
|
|
774
|
+
) {
|
|
775
|
+
latest().showNow();
|
|
776
|
+
}
|
|
697
777
|
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
778
|
+
const detach = () => {
|
|
779
|
+
if (detachTriggerRef.current === detach) {
|
|
780
|
+
detachTriggerRef.current = null;
|
|
781
|
+
}
|
|
782
|
+
el.removeEventListener('pointerenter', onPointerEnter);
|
|
783
|
+
el.removeEventListener('mouseenter', onMouseEnter);
|
|
784
|
+
el.removeEventListener('mouseleave', onMouseLeave);
|
|
785
|
+
el.removeEventListener('pointerdown', onPointerDown);
|
|
786
|
+
el.removeEventListener('focusin', onFocusIn);
|
|
787
|
+
el.removeEventListener('focusout', onFocusOut);
|
|
788
|
+
el.removeEventListener('focusout', onHeldFocusOut);
|
|
789
|
+
stopPressTrackingRef.current?.();
|
|
790
|
+
if (triggerRef.current === el) {
|
|
791
|
+
triggerRef.current = null;
|
|
792
|
+
}
|
|
793
|
+
// A caller removes the wiring as it disables the tooltip. Close an
|
|
794
|
+
// uncontrolled tooltip then, or the next attach shows a stale tooltip.
|
|
795
|
+
// A detach while enabled, such as a merged ref that changes identity
|
|
796
|
+
// on a re-render, keeps a hovered or held tooltip open.
|
|
797
|
+
if (!isEnabledRef.current && latest().isOpen === undefined) {
|
|
798
|
+
wasSuppressedRef.current = true;
|
|
799
|
+
latest().dropHold();
|
|
800
|
+
latest().hideNow();
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
detachTriggerRef.current = detach;
|
|
804
|
+
return detach;
|
|
805
|
+
}, []);
|
|
713
806
|
|
|
714
807
|
// Combined ref - shorthand for calling both positionRef and interactionRef
|
|
715
|
-
const ref
|
|
808
|
+
const ref = useCallback(
|
|
716
809
|
(el: HTMLElement | null) => {
|
|
717
810
|
layerRef(el);
|
|
718
|
-
interactionRef(el);
|
|
811
|
+
const detachInteraction = interactionRef(el);
|
|
812
|
+
if (el == null) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
return () => {
|
|
816
|
+
detachInteraction?.();
|
|
817
|
+
layerRef(null);
|
|
818
|
+
};
|
|
719
819
|
},
|
|
720
820
|
[layerRef, interactionRef],
|
|
721
821
|
);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file TreeListItem.tsx
|
|
7
|
-
* @input Uses React, StyleX, theme tokens, TreeListBranches
|
|
7
|
+
* @input Uses React, StyleX, theme tokens, TreeListBranches, the shared press
|
|
8
|
+
* overlays and the compositor press layer
|
|
8
9
|
* @output Exports TreeListItem component (internal, not publicly exported)
|
|
9
10
|
* @position Internal implementation; consumed by TreeList.tsx
|
|
10
11
|
*
|
|
@@ -27,8 +28,10 @@ import {
|
|
|
27
28
|
} from '../theme/tokens.stylex';
|
|
28
29
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
29
30
|
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
31
|
+
import {rowPressLayerStyles} from '../privateAttributes/press.stylex';
|
|
30
32
|
import {usePressFeedback} from '../hooks/usePressFeedback';
|
|
31
33
|
import {
|
|
34
|
+
cancelNestedTouchPress,
|
|
32
35
|
hasInteractiveAncestor,
|
|
33
36
|
useClickableContainer,
|
|
34
37
|
} from '../hooks/useClickableContainer';
|
|
@@ -485,6 +488,28 @@ export function TreeListItem({
|
|
|
485
488
|
interactiveRef: linkRef,
|
|
486
489
|
disabled: isDisabled || !forwardsToLink,
|
|
487
490
|
});
|
|
491
|
+
|
|
492
|
+
// A finger press that starts on a control inside the row does not activate
|
|
493
|
+
// the row, so the row shows no press for it. The row's own action, its link
|
|
494
|
+
// or invisible button, activates it. The Chevron does too when the row's
|
|
495
|
+
// surface toggles, since it runs that same toggle.
|
|
496
|
+
const actionButtonRef = useRef<HTMLButtonElement>(null);
|
|
497
|
+
const chevronRef = useRef<HTMLButtonElement>(null);
|
|
498
|
+
const surfaceToggles = onClick == null && handleClick != null;
|
|
499
|
+
const pressOnRow = (event: React.PointerEvent<HTMLDivElement>) => {
|
|
500
|
+
if (isDisabled) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const chevron = chevronRef.current;
|
|
504
|
+
const ownAction =
|
|
505
|
+
surfaceToggles &&
|
|
506
|
+
chevron != null &&
|
|
507
|
+
event.target instanceof Node &&
|
|
508
|
+
chevron.contains(event.target)
|
|
509
|
+
? chevron
|
|
510
|
+
: (linkRef.current ?? actionButtonRef.current);
|
|
511
|
+
cancelNestedTouchPress(event, event.currentTarget, ownAction);
|
|
512
|
+
};
|
|
488
513
|
const {onMouseUp: openLinkOnMiddleClick} = useClickableContainer({
|
|
489
514
|
containerRef: linkRowRef,
|
|
490
515
|
href,
|
|
@@ -566,6 +591,7 @@ export function TreeListItem({
|
|
|
566
591
|
// focusable element to receive Enter/Space). The row's handleClick ignores
|
|
567
592
|
// clicks originating inside a <button>, so this never double-toggles.
|
|
568
593
|
<button
|
|
594
|
+
ref={chevronRef}
|
|
569
595
|
type="button"
|
|
570
596
|
aria-expanded={isExpanded}
|
|
571
597
|
aria-label={t('@astryx.treeList.toggleChildren')}
|
|
@@ -642,6 +668,7 @@ export function TreeListItem({
|
|
|
642
668
|
</LinkComponent>
|
|
643
669
|
) : onClick != null ? (
|
|
644
670
|
<button
|
|
671
|
+
ref={actionButtonRef}
|
|
645
672
|
type="button"
|
|
646
673
|
onClick={onClick}
|
|
647
674
|
aria-disabled={isDisabled || undefined}
|
|
@@ -712,6 +739,10 @@ export function TreeListItem({
|
|
|
712
739
|
densityStyles[density],
|
|
713
740
|
styles.interactive,
|
|
714
741
|
interactionOverlayStyles.backgroundImage,
|
|
742
|
+
// The touch press on a compositor layer (after the
|
|
743
|
+
// overlay, whose own touch paint it turns off).
|
|
744
|
+
rowPressLayerStyles.cell,
|
|
745
|
+
rowPressLayerStyles.cellOnImage,
|
|
715
746
|
isDisabled && styles.disabled,
|
|
716
747
|
isSelected && styles.selected,
|
|
717
748
|
xstyle,
|
|
@@ -732,7 +763,10 @@ export function TreeListItem({
|
|
|
732
763
|
)}
|
|
733
764
|
ref={forwardsToLink ? linkRowRef : undefined}
|
|
734
765
|
onClick={forwardsToLink ? delegateToLink : handleClick}
|
|
735
|
-
onMouseUp={forwardsToLink ? openLinkOnMiddleClick : undefined}
|
|
766
|
+
onMouseUp={forwardsToLink ? openLinkOnMiddleClick : undefined}
|
|
767
|
+
onPointerDown={
|
|
768
|
+
forwardsToLink || handleClick != null ? pressOnRow : undefined
|
|
769
|
+
}>
|
|
736
770
|
<div {...stylex.props(styles.indentedContent)}>{innerContent}</div>
|
|
737
771
|
</div>
|
|
738
772
|
</div>
|
|
@@ -44,6 +44,7 @@ import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
|
44
44
|
import {
|
|
45
45
|
isFocusInsideOwnedLayer,
|
|
46
46
|
isPressInsideOwnedLayer,
|
|
47
|
+
noteOutsideDismissal,
|
|
47
48
|
useOutsidePress,
|
|
48
49
|
} from '../Layer/outsidePress';
|
|
49
50
|
import {isImeKeyEvent} from '../utils/ime';
|
|
@@ -1473,6 +1474,7 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
1473
1474
|
if (isFocusInsideOwnedLayer(e.relatedTarget, anchorEl, popover.id)) {
|
|
1474
1475
|
return;
|
|
1475
1476
|
}
|
|
1477
|
+
noteOutsideDismissal(e.currentTarget.ownerDocument);
|
|
1476
1478
|
popover.hide();
|
|
1477
1479
|
},
|
|
1478
1480
|
[popover, anchorRef],
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import {
|
|
21
|
-
|
|
21
|
+
createMotionEngine,
|
|
22
22
|
SETTLE_THRESHOLD,
|
|
23
|
-
type Animator as
|
|
23
|
+
type Animator as MotionEngine,
|
|
24
24
|
type MotionCurve,
|
|
25
25
|
type MotionProperty,
|
|
26
26
|
type MotionValues,
|
|
@@ -199,7 +199,7 @@ export function createAttachableAnimator(): {
|
|
|
199
199
|
readonly animator: Animator;
|
|
200
200
|
readonly attach: (element: HTMLElement | null) => void;
|
|
201
201
|
} {
|
|
202
|
-
const motion:
|
|
202
|
+
const motion: MotionEngine = createMotionEngine(null);
|
|
203
203
|
// Calls do nothing while no element is attached, before the ref attaches
|
|
204
204
|
// or after it lets go. They also do nothing after destroy, and animate and
|
|
205
205
|
// decay then resolve at once.
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file GestureHost.ts
|
|
5
5
|
* @input DOM touch, pointer, click, contextmenu, scroll and focus events of
|
|
6
|
-
* one document; elements with recognizers and consumers attached
|
|
6
|
+
* one document; elements with recognizers and consumers attached; the
|
|
7
|
+
* input hold's held layers (Layer/inputHold `holdsTouch`)
|
|
7
8
|
* @output Exports GestureHost (the DOM side of the gesture system) and
|
|
8
9
|
* getGestureHost (one host per document)
|
|
9
10
|
* @position Browser adapter of packages/core/src/gestures: turns real events
|
|
@@ -149,6 +150,7 @@ import {
|
|
|
149
150
|
import {containsAlongFlatTree} from '../utils/flatTree';
|
|
150
151
|
import {isIosWebKit} from '../utils/touchQueries';
|
|
151
152
|
import {type WheelSegment, WheelSegmenter} from './wheelSegmenter';
|
|
153
|
+
import {holdsTouch} from '../Layer/inputHold';
|
|
152
154
|
import {
|
|
153
155
|
gestureHostStyle,
|
|
154
156
|
type GestureHostStyle,
|
|
@@ -2126,9 +2128,12 @@ export class GestureHost {
|
|
|
2126
2128
|
const recognizers: GestureRecognizer[] = [];
|
|
2127
2129
|
let consumer: TouchConsumer | null = null;
|
|
2128
2130
|
let consumerElement: Element | null = null;
|
|
2131
|
+
// A layer that the input hold holds takes no touch while it presents.
|
|
2132
|
+
// The host asks the hold, so the hold needs nothing from gestures/. A
|
|
2133
|
+
// root-entry component can then use the hold with no gesture code.
|
|
2129
2134
|
if (
|
|
2130
2135
|
target instanceof Node &&
|
|
2131
|
-
[...this.touchGates].some(gate => gate(target))
|
|
2136
|
+
(holdsTouch(target) || [...this.touchGates].some(gate => gate(target)))
|
|
2132
2137
|
) {
|
|
2133
2138
|
return {recognizers, consumer, consumerElement};
|
|
2134
2139
|
}
|
|
@@ -2287,17 +2292,20 @@ export class GestureHost {
|
|
|
2287
2292
|
};
|
|
2288
2293
|
this.wheel = gesture;
|
|
2289
2294
|
}
|
|
2290
|
-
|
|
2295
|
+
let {dx, dy} = wheelPixels(wheel, this.doc.defaultView);
|
|
2291
2296
|
const horizontal = Math.abs(dx) > Math.abs(dy);
|
|
2292
2297
|
// The splitter reads a pan's stream only. A ctrl-wheel pinch has no
|
|
2293
2298
|
// fingers' phase or momentum to tell apart, and ends 100 ms after its
|
|
2294
2299
|
// last wheel.
|
|
2295
2300
|
let seg: WheelSegment | null = null;
|
|
2296
2301
|
if (kind === 'pan') {
|
|
2302
|
+
// Only a trackpad's wheel can join its glide late; a mouse wheel's
|
|
2303
|
+
// notches keep the splitter's other rules.
|
|
2297
2304
|
seg = this.segmenter.push(
|
|
2298
2305
|
time,
|
|
2299
2306
|
horizontal ? dx : dy,
|
|
2300
2307
|
horizontal ? WHEEL_FOLLOW_END_MS : WHEEL_FOLLOW_END_V_MS,
|
|
2308
|
+
scrollTypeOf(wheel) === 'continuous',
|
|
2301
2309
|
);
|
|
2302
2310
|
} else {
|
|
2303
2311
|
this.segmenter.end();
|
|
@@ -2309,6 +2317,14 @@ export class GestureHost {
|
|
|
2309
2317
|
gesture = null;
|
|
2310
2318
|
}
|
|
2311
2319
|
}
|
|
2320
|
+
// A late wheel the glide took was the fingers' first when this one grows.
|
|
2321
|
+
if (seg != null && seg.carried !== 0) {
|
|
2322
|
+
if (horizontal) {
|
|
2323
|
+
dx += seg.carried;
|
|
2324
|
+
} else {
|
|
2325
|
+
dy += seg.carried;
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2312
2328
|
if (gesture == null) {
|
|
2313
2329
|
gesture = this.beginWheel(wheel, kind, dx, dy, time);
|
|
2314
2330
|
this.wheel = gesture;
|
|
@@ -2868,8 +2884,8 @@ export class GestureHost {
|
|
|
2868
2884
|
|
|
2869
2885
|
/**
|
|
2870
2886
|
* Hold touches away from every participant while `gate(target)` answers
|
|
2871
|
-
* true
|
|
2872
|
-
*
|
|
2887
|
+
* true. Returns the release. The input hold's held layers need no gate,
|
|
2888
|
+
* because the host asks `holdsTouch` for every touch.
|
|
2873
2889
|
*/
|
|
2874
2890
|
addTouchGate(gate: (target: Node) => boolean): () => void {
|
|
2875
2891
|
this.touchGates.add(gate);
|
|
@@ -55,7 +55,12 @@ export interface PanGestureRecognizerOptions extends GestureRecognizerOptions<Pa
|
|
|
55
55
|
minimumNumberOfTouches?: number;
|
|
56
56
|
/** @default Infinity */
|
|
57
57
|
maximumNumberOfTouches?: number;
|
|
58
|
-
|
|
58
|
+
/**
|
|
59
|
+
* The travel that begins the pan, px. A function gives each press its own
|
|
60
|
+
* threshold: it reads the press's first touch when that touch lands.
|
|
61
|
+
* @default UIKit's 10
|
|
62
|
+
*/
|
|
63
|
+
hysteresis?: number | ((touch: GestureTouch) => number);
|
|
59
64
|
/** Movement that may begin the pan; anything else fails it. @default 'any' */
|
|
60
65
|
direction?: PanDirection;
|
|
61
66
|
/**
|
|
@@ -117,6 +122,11 @@ export class PanGestureRecognizer extends GestureRecognizer {
|
|
|
117
122
|
travelAtBegan: Point = ZERO;
|
|
118
123
|
|
|
119
124
|
private readonly tracker: VelocityTracker;
|
|
125
|
+
/**
|
|
126
|
+
* Read once per press. A finger that lands later keeps the press's
|
|
127
|
+
* threshold.
|
|
128
|
+
*/
|
|
129
|
+
private readonly hysteresisFor: ((touch: GestureTouch) => number) | null;
|
|
120
130
|
/** The lift's event time once the pan ended: its release (AST-100 FR2). */
|
|
121
131
|
private releaseTime: number | undefined = undefined;
|
|
122
132
|
/** The centroid where the gesture started, in client px. */
|
|
@@ -132,7 +142,10 @@ export class PanGestureRecognizer extends GestureRecognizer {
|
|
|
132
142
|
this.minimumNumberOfTouches = options.minimumNumberOfTouches ?? 1;
|
|
133
143
|
this.maximumNumberOfTouches =
|
|
134
144
|
options.maximumNumberOfTouches ?? Number.POSITIVE_INFINITY;
|
|
135
|
-
|
|
145
|
+
const {hysteresis} = options;
|
|
146
|
+
this.hysteresisFor = typeof hysteresis === 'function' ? hysteresis : null;
|
|
147
|
+
this.hysteresis =
|
|
148
|
+
typeof hysteresis === 'number' ? hysteresis : UIKIT_PAN.hysteresis.value;
|
|
136
149
|
this.direction = options.direction ?? 'any';
|
|
137
150
|
this.axisRatio = options.axisRatio ?? 1;
|
|
138
151
|
this.lockAxis = options.lockAxis ?? false;
|
|
@@ -237,6 +250,10 @@ export class PanGestureRecognizer extends GestureRecognizer {
|
|
|
237
250
|
event: GestureEventContext,
|
|
238
251
|
): void {
|
|
239
252
|
if (this.numberOfTouches === touches.length) {
|
|
253
|
+
const first = touches[0];
|
|
254
|
+
if (this.hysteresisFor != null && first != null) {
|
|
255
|
+
this.hysteresis = this.hysteresisFor(first);
|
|
256
|
+
}
|
|
240
257
|
this.origin = centroid(this.touches.values());
|
|
241
258
|
this.adjust = ZERO;
|
|
242
259
|
this.raw = ZERO;
|
package/src/gestures/README.md
CHANGED
|
@@ -118,7 +118,8 @@ The pan reads its numbers the way `UIPanGestureRecognizer` does, as measured
|
|
|
118
118
|
in the UIKit lab:
|
|
119
119
|
|
|
120
120
|
- It begins once the centroid has moved `hysteresis` (10 px) along either
|
|
121
|
-
axis, not as a distance.
|
|
121
|
+
axis, not as a distance. A function gives each press its own threshold,
|
|
122
|
+
read from the press's first touch when it lands.
|
|
122
123
|
- `translation()` leaves out the travel the threshold took: a slow drag reads
|
|
123
124
|
zero when the pan begins, and a step that overshoots keeps only the
|
|
124
125
|
overshoot. A dragged surface does not jump. `totalTranslation()` is the
|
|
@@ -434,11 +435,15 @@ subscriber cancels it: the host cancels `touchend` and `contextmenu` there
|
|
|
434
435
|
while a claiming participant is attached, never a `touchstart` or a
|
|
435
436
|
`touchmove`, and the click guard (`../utils/clickGuard.ts`) keeps a
|
|
436
437
|
cancelling `click` while it is armed, and from the menu press model's first
|
|
437
|
-
arm on. A
|
|
438
|
+
arm on. A layer's input hold (`../Layer/inputHold.ts`) cancels pointer and
|
|
439
|
+
mouse events, clicks, `touchmove` and `touchend` there while a layer is held,
|
|
440
|
+
never a `touchstart`. A blocking `touchmove` sits on a claiming
|
|
438
441
|
element and on a claimed touch's target, on the document while an element a
|
|
439
442
|
claiming recognizer lives in is moving (Touches on moving elements), or on
|
|
440
|
-
the window only while a page hold is held, so a page
|
|
441
|
-
no scroll.
|
|
443
|
+
the window only while a page hold or a layer's input hold is held, so a page
|
|
444
|
+
of pressables blocks no scroll. The stream records the type of the latest
|
|
445
|
+
pointer event it delivers (`getLastPointerType`); the input hold reads it as
|
|
446
|
+
a layer opens.
|
|
442
447
|
|
|
443
448
|
### Holding the page still
|
|
444
449
|
|
|
@@ -525,7 +530,11 @@ it never moves it; when the fingers carry on instead, their moves absorb
|
|
|
525
530
|
what the pan showed past their travel, or short of it, so it never steps
|
|
526
531
|
back and ends on their travel. Fingers that stop release still, once the end
|
|
527
532
|
time passes. In momentum, a reversal, a delta that grows
|
|
528
|
-
against the decay, or a 50 ms pause starts a new gesture
|
|
533
|
+
against the decay, or a 50 ms pause starts a new gesture; a late, coalesced
|
|
534
|
+
trackpad wheel that continues the glide's deceleration (at or below the next
|
|
535
|
+
step, or near the sum of the next steps its stall spans) belongs to the same
|
|
536
|
+
flick. When the next wheel grows instead, it starts a new gesture with the late
|
|
537
|
+
wheel's travel. A finger, mouse or
|
|
529
538
|
pen that comes down ends it, and a wheel claim keeps the page's text
|
|
530
539
|
selection. A gesture a
|
|
531
540
|
recognizer took is latched to it, as a browser latches a scroller: while it
|
|
@@ -76,12 +76,17 @@ interface EdgeLayout {
|
|
|
76
76
|
*/
|
|
77
77
|
export interface ScreenEdgePanGestureRecognizerOptions extends Omit<
|
|
78
78
|
PanGestureRecognizerOptions,
|
|
79
|
-
'direction' | 'allowedPointerTypes' | 'allowedScrollTypes'
|
|
79
|
+
'direction' | 'allowedPointerTypes' | 'allowedScrollTypes' | 'hysteresis'
|
|
80
80
|
> {
|
|
81
81
|
/** The edges a touch may start from. @default ['leading'] */
|
|
82
82
|
edges?: ReadonlyArray<ScreenEdge>;
|
|
83
83
|
/** Width of the band at each edge, px. */
|
|
84
84
|
edgeRegion?: number;
|
|
85
|
+
/**
|
|
86
|
+
* The travel that begins the pan in its edge zone, px. It is one number for
|
|
87
|
+
* every press, since the zone sets the threshold itself. @default UIKit's 15
|
|
88
|
+
*/
|
|
89
|
+
hysteresis?: number;
|
|
85
90
|
}
|
|
86
91
|
|
|
87
92
|
export class ScreenEdgePanGestureRecognizer extends PanGestureRecognizer {
|