@astryxdesign/core 0.7.6-canary.fdabeba → 0.7.6
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/CHANGELOG.md +270 -0
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +4 -2
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +48 -36
- package/dist/Avatar/Avatar.d.ts +1 -1
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +6 -4
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +4 -2
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +5 -3
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +10 -7
- package/dist/BottomSheet/BottomSheet.d.ts +3 -51
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +95 -91
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetEdgeTint.js +10 -21
- package/dist/BottomSheet/BottomSheetHostContext.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetHostContext.js +6 -10
- package/dist/BottomSheet/BottomSheetPanel.d.ts +14 -8
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +73 -50
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts +16 -62
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +54 -72
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +8 -0
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetEscape.js +3 -3
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +42 -96
- package/dist/BottomSheet/useMobileKeyboard.d.ts +0 -14
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +1 -1
- package/dist/BottomSheet/useMobileKeyboard.js +56 -22
- package/dist/BottomSheet/useSheetGestures.d.ts +34 -68
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +111 -100
- package/dist/Breadcrumbs/BreadcrumbItem.js +4 -2
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +6 -3
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +19 -10
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +14 -12
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +4 -7
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +6 -3
- package/dist/Center/Center.d.ts +1 -1
- package/dist/Center/Center.js +1 -1
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +16 -8
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +5 -3
- package/dist/Chat/ChatComposerInput.d.ts +1 -1
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +16 -4
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +6 -3
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +7 -4
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +6 -3
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +12 -4
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +7 -3
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +4 -2
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +23 -7
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +6 -3
- package/dist/Chat/ChatSystemMessage.d.ts.map +1 -1
- package/dist/Chat/ChatSystemMessage.js +2 -1
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +7 -4
- package/dist/Chat/chatMessage.vars.stylex.d.ts +16 -0
- package/dist/Chat/chatMessage.vars.stylex.d.ts.map +1 -0
- package/dist/Chat/chatMessage.vars.stylex.js +19 -0
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +5 -2
- package/dist/Chat/useTriggerMenu.d.ts +1 -1
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +37 -35
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +5 -3
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +5 -2
- package/dist/CheckboxList/CheckboxListContext.d.ts +8 -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 -4
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +4 -2
- package/dist/Code/Code.d.ts +1 -1
- package/dist/Code/Code.js +1 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +30 -8
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +23 -3
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +24 -8
- package/dist/CommandPalette/CommandPaletteEmpty.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteEmpty.js +1 -0
- package/dist/CommandPalette/CommandPaletteFooter.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteFooter.js +4 -2
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +12 -7
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +4 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts +2 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +5 -3
- package/dist/ContextMenu/ContextMenu.d.ts +6 -0
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +35 -9
- package/dist/DateInput/DateInput.d.ts +3 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +60 -15
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +4 -3
- package/dist/DateInput/NativeDateField.d.ts.map +1 -1
- package/dist/DateInput/NativeDateField.js +7 -8
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +12 -12
- package/dist/DateRangeInput/DateRangeInput.d.ts +3 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +7 -8
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +41 -26
- package/dist/DateTimeInput/NativeDateSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeDateSegment.js +5 -2
- package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeTimeSegment.js +5 -2
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +12 -12
- package/dist/Dialog/Dialog.d.ts +1 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +35 -19
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +4 -2
- package/dist/Drawer/Drawer.d.ts +2 -2
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +27 -5
- package/dist/Drawer/DrawerHeader.d.ts.map +1 -1
- package/dist/Drawer/DrawerHeader.js +4 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +31 -73
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +3 -2
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +4 -3
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +4 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +4 -3
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +15 -9
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +9 -3
- package/dist/Field/Field.d.ts +2 -2
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/FieldLabel.d.ts +1 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +10 -16
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +5 -3
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +10 -5
- package/dist/Field/fieldStatusPlacement.d.ts +15 -0
- package/dist/Field/fieldStatusPlacement.d.ts.map +1 -0
- package/dist/Field/fieldStatusPlacement.js +1 -0
- package/dist/Field/index.d.ts +4 -1
- package/dist/Field/index.d.ts.map +1 -1
- package/dist/Field/index.js +2 -1
- package/dist/Field/inputDisabledFocus.d.ts +16 -3
- package/dist/Field/inputDisabledFocus.d.ts.map +1 -1
- package/dist/Field/inputDisabledFocus.js +19 -3
- package/dist/Field/inputStyles.stylex.d.ts +12 -9
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +12 -9
- package/dist/Field/textEntryTraits.d.ts +86 -0
- package/dist/Field/textEntryTraits.d.ts.map +1 -0
- package/dist/Field/textEntryTraits.js +81 -0
- package/dist/FieldStatus/FieldStatus.d.ts +13 -28
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +25 -3
- package/dist/FieldStatus/index.d.ts +7 -0
- package/dist/FieldStatus/index.d.ts.map +1 -1
- package/dist/FileInput/FileInput.d.ts +7 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +31 -4
- package/dist/Grid/Grid.d.ts +6 -4
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/GridSpan.d.ts +2 -0
- package/dist/Grid/GridSpan.d.ts.map +1 -1
- package/dist/Grid/GridSpan.js +2 -0
- package/dist/HStack/HStack.d.ts +2 -1
- package/dist/HStack/HStack.d.ts.map +1 -1
- package/dist/HStack/HStack.js +2 -1
- package/dist/Heading/Heading.d.ts +5 -3
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +5 -3
- package/dist/HoverCard/HoverCard.d.ts +8 -5
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +1 -0
- package/dist/HoverCard/useHoverCard.d.ts +3 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +7 -0
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +12 -6
- package/dist/Item/Item.js +5 -5
- package/dist/Item/ItemSwipeLayer.d.ts.map +1 -1
- package/dist/Item/ItemSwipeLayer.js +8 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +7 -3
- package/dist/Layer/layerClickBoundary.d.ts +35 -0
- package/dist/Layer/layerClickBoundary.d.ts.map +1 -0
- package/dist/Layer/layerClickBoundary.js +61 -0
- package/dist/Layer/layerStructureReset.stylex.d.ts +1 -0
- package/dist/Layer/layerStructureReset.stylex.d.ts.map +1 -1
- package/dist/Layer/layerStructureReset.stylex.js +1 -0
- package/dist/Layer/layerSurfacePress.d.ts +9 -0
- package/dist/Layer/layerSurfacePress.d.ts.map +1 -0
- package/dist/Layer/layerSurfacePress.js +35 -0
- package/dist/Layer/outsidePress.d.ts +45 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -0
- package/dist/Layer/outsidePress.js +132 -0
- package/dist/Layer/useLayer.d.ts +8 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +17 -6
- package/dist/Layer/useTouchTrigger.d.ts +26 -3
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +79 -10
- package/dist/Layout/LayoutSlotsContext.d.ts +5 -0
- package/dist/Layout/LayoutSlotsContext.d.ts.map +1 -1
- package/dist/Layout/LayoutSlotsContext.js +3 -2
- package/dist/Layout/layoutReset.d.ts +44 -0
- package/dist/Layout/layoutReset.d.ts.map +1 -0
- package/dist/Layout/layoutReset.js +40 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +14 -7
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +5 -3
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +5 -2
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.js +4 -2
- package/dist/MetadataList/MetadataList.d.ts +1 -1
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +9 -5
- package/dist/MetadataList/MetadataListItem.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListItem.js +2 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +15 -5
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +4 -2
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +4 -2
- package/dist/MultiSelector/MultiSelector.d.ts +2 -2
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +22 -23
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +4 -2
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +2 -1
- package/dist/NumberInput/NumberInput.d.ts +3 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +7 -3
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -2
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +2 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +6 -3
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +8 -5
- package/dist/Popover/usePopover.d.ts +7 -1
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +12 -4
- package/dist/PowerSearch/PowerSearch.d.ts +3 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +8 -4
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +7 -4
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +2 -2
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +16 -13
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +3 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts +4 -1
- package/dist/PowerSearch/resolveOperatorLabel.d.ts.map +1 -1
- package/dist/PowerSearch/resolveOperatorLabel.js +5 -0
- package/dist/PowerSearch/usePowerSearchConfig.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.js +3 -0
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.js +3 -2
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +3 -1
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +7 -2
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +8 -2
- package/dist/RadioList/RadioListReasonContext.d.ts +2 -0
- package/dist/RadioList/RadioListReasonContext.d.ts.map +1 -0
- package/dist/RadioList/RadioListReasonContext.js +22 -0
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +4 -2
- package/dist/Resizable/resizableModel.d.ts +64 -0
- package/dist/Resizable/resizableModel.d.ts.map +1 -0
- package/dist/Resizable/resizableModel.js +287 -0
- package/dist/Resizable/useResizable.d.ts +2 -2
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +1 -284
- package/dist/SegmentedControl/SegmentedControl.d.ts +7 -5
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +26 -16
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +4 -5
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +16 -13
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +59 -0
- package/dist/Selector/Selector.d.ts +3 -3
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +11 -10
- package/dist/Selector/useSelectorPresentation.d.ts +7 -1
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
- package/dist/Selector/useSelectorPresentation.js +2 -1
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +156 -23
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +16 -4
- package/dist/SideNav/SideNavFocusTargetsContext.d.ts +11 -0
- package/dist/SideNav/SideNavFocusTargetsContext.d.ts.map +1 -0
- package/dist/SideNav/SideNavFocusTargetsContext.js +16 -0
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +26 -17
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +21 -5
- package/dist/SideNav/SideNavSection.d.ts.map +1 -1
- package/dist/SideNav/SideNavSection.js +2 -1
- package/dist/SideNav/railMotion.d.ts +5 -5
- package/dist/SideNav/railMotion.d.ts.map +1 -1
- package/dist/SideNav/railMotion.js +69 -177
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +16 -10
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +6 -4
- package/dist/Stack/Stack.d.ts +1 -1
- package/dist/Stack/stack.stylex.d.ts +1 -1
- package/dist/Stack/stack.stylex.js +1 -1
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +6 -3
- package/dist/Stepper/Stepper.d.ts.map +1 -1
- package/dist/Stepper/Stepper.js +5 -3
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +5 -3
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +5 -3
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +11 -8
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +6 -3
- package/dist/Table/TableSelectionToolbar.d.ts.map +1 -1
- package/dist/Table/TableSelectionToolbar.js +4 -2
- package/dist/Table/glidingDivider.d.ts +8 -1
- package/dist/Table/glidingDivider.d.ts.map +1 -1
- package/dist/Table/glidingDivider.js +8 -3
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +6 -3
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +14 -10
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +5 -3
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +6 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +8 -5
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +6 -3
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +7 -4
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +8 -5
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -2
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +8 -5
- package/dist/Text/text.stylex.d.ts +2 -0
- package/dist/Text/text.stylex.d.ts.map +1 -1
- package/dist/Text/text.stylex.js +11 -0
- package/dist/TextArea/TextArea.d.ts +7 -5
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +25 -7
- package/dist/TextInput/TextInput.d.ts +23 -8
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +30 -5
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +4 -2
- package/dist/TimeInput/TimeInput.d.ts +3 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +7 -10
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +8 -9
- package/dist/Timer/Timer.js +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +5 -3
- package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
- package/dist/Timestamp/TimestampHoverCard.js +4 -2
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +5 -3
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +6 -2
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +8 -2
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +11 -3
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +8 -3
- package/dist/Token/TokenLink.d.ts +9 -2
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +2 -0
- package/dist/Tokenizer/Tokenizer.d.ts +12 -5
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +81 -54
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +6 -4
- package/dist/Tooltip/Tooltip.d.ts +4 -3
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +4 -3
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +40 -8
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +19 -13
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +23 -13
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +4 -3
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +9 -2
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +3 -2
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +2 -1
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +68 -7
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +10 -6
- package/dist/Typeahead/BaseTypeahead.d.ts +8 -5
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +432 -68
- package/dist/Typeahead/Typeahead.d.ts +13 -8
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.disabled.a11y.chromium.spec.d.ts.map +1 -0
- package/dist/Typeahead/Typeahead.js +13 -9
- package/dist/Typeahead/committedChoicesKey.d.ts +12 -0
- package/dist/Typeahead/committedChoicesKey.d.ts.map +1 -0
- package/dist/Typeahead/committedChoicesKey.js +24 -0
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.d.ts.map +1 -1
- package/dist/Typeahead/types.d.ts +26 -3
- package/dist/Typeahead/types.d.ts.map +1 -1
- package/dist/astryx.css +27 -7
- package/dist/gestures/GestureArena.d.ts +17 -3
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +70 -38
- package/dist/gestures/GestureHost.d.ts +330 -95
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +1304 -475
- package/dist/gestures/GestureRecognizer.d.ts +56 -17
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +28 -2
- package/dist/gestures/LongPressGestureRecognizer.d.ts +2 -0
- package/dist/gestures/LongPressGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/LongPressGestureRecognizer.js +14 -1
- package/dist/gestures/PanGestureRecognizer.d.ts +11 -0
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +25 -0
- package/dist/gestures/PinchGestureRecognizer.d.ts +3 -2
- package/dist/gestures/PinchGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PinchGestureRecognizer.js +10 -8
- package/dist/gestures/PressTracker.d.ts +31 -3
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +25 -6
- package/dist/gestures/TapGestureRecognizer.d.ts +2 -0
- package/dist/gestures/TapGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/TapGestureRecognizer.js +5 -0
- package/dist/gestures/VelocityTracker.d.ts +12 -0
- package/dist/gestures/VelocityTracker.d.ts.map +1 -1
- package/dist/gestures/VelocityTracker.js +38 -0
- package/dist/gestures/fingerScroll.d.ts +14 -0
- package/dist/gestures/fingerScroll.d.ts.map +1 -0
- package/dist/gestures/fingerScroll.js +181 -0
- package/dist/gestures/gestureSync.d.ts +12 -0
- package/dist/gestures/gestureSync.d.ts.map +1 -0
- package/dist/gestures/gestureSync.js +59 -0
- package/dist/gestures/haptics.d.ts +6 -3
- package/dist/gestures/haptics.d.ts.map +1 -1
- package/dist/gestures/haptics.js +9 -10
- package/dist/gestures/hostRegistry.d.ts +15 -0
- package/dist/gestures/hostRegistry.d.ts.map +1 -0
- package/dist/gestures/hostRegistry.js +16 -0
- package/dist/gestures/index.d.ts +6 -2
- package/dist/gestures/index.d.ts.map +1 -1
- package/dist/gestures/index.js +3 -1
- package/dist/gestures/nativeScroll.d.ts +2 -32
- package/dist/gestures/nativeScroll.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.js +5 -17
- package/dist/gestures/pageHold.d.ts +21 -0
- package/dist/gestures/pageHold.d.ts.map +1 -0
- package/dist/gestures/pageHold.js +216 -0
- package/dist/gestures/recognizerInternals.d.ts +52 -0
- package/dist/gestures/recognizerInternals.d.ts.map +1 -0
- package/dist/gestures/recognizerInternals.js +33 -0
- package/dist/gestures/selectionLock.d.ts +10 -0
- package/dist/gestures/selectionLock.d.ts.map +1 -0
- package/dist/gestures/selectionLock.js +12 -0
- package/dist/gestures/touchAction.d.ts +10 -12
- package/dist/gestures/touchAction.d.ts.map +1 -1
- package/dist/gestures/touchAction.js +13 -21
- package/dist/gestures/types.d.ts +17 -0
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/useFingerScroll.d.ts +35 -0
- package/dist/gestures/useFingerScroll.d.ts.map +1 -0
- package/dist/gestures/useFingerScroll.js +70 -0
- package/dist/gestures/useGestureRecognizer.d.ts +23 -15
- package/dist/gestures/useGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/useGestureRecognizer.js +51 -160
- package/dist/gestures/usePressTracker.d.ts +34 -0
- package/dist/gestures/usePressTracker.d.ts.map +1 -0
- package/dist/gestures/usePressTracker.js +168 -0
- package/dist/hooks/ModalAnnounceProvider.d.ts +5 -6
- package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -1
- package/dist/hooks/ModalAnnounceProvider.js +13 -13
- package/dist/hooks/actionGroupTracker.d.ts +12 -0
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +23 -55
- package/dist/hooks/menuPressGesture.d.ts +21 -26
- package/dist/hooks/menuPressGesture.d.ts.map +1 -1
- package/dist/hooks/menuPressGesture.js +25 -30
- package/dist/hooks/menuPressMarker.d.ts +13 -0
- package/dist/hooks/menuPressMarker.d.ts.map +1 -0
- package/dist/hooks/menuPressMarker.js +15 -0
- package/dist/hooks/menuPressOnItems.d.ts +2 -9
- package/dist/hooks/menuPressOnItems.d.ts.map +1 -1
- package/dist/hooks/menuPressOnItems.js +7 -9
- package/dist/hooks/modalAnnounce.d.ts +1 -1
- package/dist/hooks/modalAnnounce.d.ts.map +1 -1
- package/dist/hooks/modalAnnounce.js +20 -39
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -1
- package/dist/hooks/scrollbarGutter.js +9 -16
- package/dist/hooks/useAnimatedLayout.d.ts +2 -3
- package/dist/hooks/useAnimatedLayout.d.ts.map +1 -1
- package/dist/hooks/useAnimatedLayout.js +2 -3
- package/dist/hooks/useAnnounce.d.ts +16 -37
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +56 -92
- package/dist/hooks/useAnnounceRenderedText.d.ts +17 -48
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +22 -42
- package/dist/hooks/useAttachment.d.ts +22 -0
- package/dist/hooks/useAttachment.d.ts.map +1 -0
- package/dist/hooks/useAttachment.js +50 -0
- package/dist/hooks/useAutoMediaMode.d.ts.map +1 -1
- package/dist/hooks/useAutoMediaMode.js +29 -54
- package/dist/hooks/useBusyAnnouncement.d.ts +2 -16
- package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
- package/dist/hooks/useBusyAnnouncement.js +13 -20
- package/dist/hooks/useClickableContainer.d.ts +30 -13
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +59 -34
- package/dist/hooks/useContainerReveal.d.ts +9 -36
- package/dist/hooks/useContainerReveal.d.ts.map +1 -1
- package/dist/hooks/useContainerReveal.js +9 -36
- package/dist/hooks/useDevWarning.d.ts.map +1 -1
- package/dist/hooks/useDevWarning.js +3 -8
- package/dist/hooks/useEntryAnimation.d.ts.map +1 -1
- package/dist/hooks/useEntryAnimation.js +1 -3
- package/dist/hooks/useFocusReturnVisibility.d.ts +8 -1
- package/dist/hooks/useFocusReturnVisibility.d.ts.map +1 -1
- package/dist/hooks/useFocusReturnVisibility.js +14 -8
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +2 -3
- package/dist/hooks/useHighlightedOptionScroll.d.ts +2 -4
- package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
- package/dist/hooks/useHighlightedOptionScroll.js +1 -1
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +4 -16
- package/dist/hooks/useImageMode.d.ts.map +1 -1
- package/dist/hooks/useImageMode.js +6 -45
- package/dist/hooks/useIndicatorFocusRing.d.ts.map +1 -1
- package/dist/hooks/useIndicatorFocusRing.js +13 -38
- package/dist/hooks/useInputStatusIcon.d.ts +11 -3
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +21 -35
- package/dist/hooks/useInteractiveRole.d.ts.map +1 -1
- package/dist/hooks/useInteractiveRole.js +6 -24
- package/dist/hooks/useKeyboardHint.d.ts +1 -1
- package/dist/hooks/useKeyboardHint.d.ts.map +1 -1
- package/dist/hooks/useKeyboardHint.js +14 -5
- package/dist/hooks/useListFocus.d.ts +29 -0
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +53 -10
- package/dist/hooks/useLongPress.d.ts +21 -0
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +55 -28
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +38 -52
- package/dist/hooks/useMenuPress.d.ts +33 -40
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +108 -182
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +3 -8
- package/dist/hooks/useRenamedProp.d.ts.map +1 -1
- package/dist/hooks/useRenamedProp.js +8 -17
- package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
- package/dist/hooks/useScrollOverflow.js +9 -27
- package/dist/hooks/useScrollableArea.d.ts +2 -4
- package/dist/hooks/useScrollableArea.d.ts.map +1 -1
- package/dist/hooks/useScrollableArea.js +14 -21
- package/dist/hooks/useSettledOpen.d.ts +16 -0
- package/dist/hooks/useSettledOpen.d.ts.map +1 -0
- package/dist/hooks/useSettledOpen.js +44 -0
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +14 -36
- package/dist/hooks/useTreeFocus.d.ts +11 -1
- package/dist/hooks/useTreeFocus.d.ts.map +1 -1
- package/dist/hooks/useTreeFocus.js +32 -8
- package/dist/hooks/useTypeahead.d.ts +3 -1
- package/dist/hooks/useTypeahead.d.ts.map +1 -1
- package/dist/hooks/useTypeahead.js +21 -15
- package/dist/i18n/InternationalizationContext.d.ts +1 -1
- package/dist/i18n/InternationalizationContext.js +1 -1
- package/dist/i18n/englishFallback.d.ts +32 -0
- package/dist/i18n/englishFallback.d.ts.map +1 -0
- package/dist/i18n/englishFallback.js +38 -0
- package/dist/i18n/fullEnglishFallback.d.ts +3 -0
- package/dist/i18n/fullEnglishFallback.d.ts.map +1 -0
- package/dist/i18n/fullEnglishFallback.js +26 -0
- package/dist/i18n/generated-english/AlertDialog/AlertDialog.generated.d.ts +8 -0
- package/dist/i18n/generated-english/AlertDialog/AlertDialog.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/AlertDialog/AlertDialog.generated.js +12 -0
- package/dist/i18n/generated-english/AppShell/AppShell.generated.d.ts +8 -0
- package/dist/i18n/generated-english/AppShell/AppShell.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/AppShell/AppShell.generated.js +13 -0
- package/dist/i18n/generated-english/Avatar/Avatar.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Avatar/Avatar.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Avatar/Avatar.generated.js +12 -0
- package/dist/i18n/generated-english/AvatarGroup/AvatarGroup.generated.d.ts +8 -0
- package/dist/i18n/generated-english/AvatarGroup/AvatarGroup.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/AvatarGroup/AvatarGroup.generated.js +13 -0
- package/dist/i18n/generated-english/AvatarGroup/AvatarGroupOverflow.generated.d.ts +8 -0
- package/dist/i18n/generated-english/AvatarGroup/AvatarGroupOverflow.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/AvatarGroup/AvatarGroupOverflow.generated.js +12 -0
- package/dist/i18n/generated-english/Banner/Banner.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Banner/Banner.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Banner/Banner.generated.js +15 -0
- package/dist/i18n/generated-english/Breadcrumbs/Breadcrumbs.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Breadcrumbs/Breadcrumbs.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Breadcrumbs/Breadcrumbs.generated.js +12 -0
- package/dist/i18n/generated-english/Button/Button.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Button/Button.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Button/Button.generated.js +12 -0
- package/dist/i18n/generated-english/Calendar/Calendar.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Calendar/Calendar.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Calendar/Calendar.generated.js +21 -0
- package/dist/i18n/generated-english/Carousel/Carousel.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Carousel/Carousel.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Carousel/Carousel.generated.js +15 -0
- package/dist/i18n/generated-english/Chat/ChatComposer.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatComposer.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatComposer.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/ChatComposerDrawer.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatComposerDrawer.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatComposerDrawer.generated.js +14 -0
- package/dist/i18n/generated-english/Chat/ChatComposerInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatComposerInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatComposerInput.generated.js +13 -0
- package/dist/i18n/generated-english/Chat/ChatDictationButton.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatDictationButton.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatDictationButton.generated.js +13 -0
- package/dist/i18n/generated-english/Chat/ChatLayout.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatLayout.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatLayout.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/ChatLayoutScrollButton.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatLayoutScrollButton.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatLayoutScrollButton.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/ChatMessage.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatMessage.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatMessage.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/ChatMessageList.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatMessageList.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatMessageList.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/ChatMessageMetadata.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatMessageMetadata.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatMessageMetadata.generated.js +17 -0
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.js +13 -0
- package/dist/i18n/generated-english/Chat/ChatSendButton.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatSendButton.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatSendButton.generated.js +13 -0
- package/dist/i18n/generated-english/Chat/ChatToolCalls.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/ChatToolCalls.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/ChatToolCalls.generated.js +17 -0
- package/dist/i18n/generated-english/Chat/useSpeechRecognition.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/useSpeechRecognition.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/useSpeechRecognition.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.js +13 -0
- package/dist/i18n/generated-english/CheckboxInput/CheckboxInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/CheckboxInput/CheckboxInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/CheckboxInput/CheckboxInput.generated.js +12 -0
- package/dist/i18n/generated-english/CheckboxList/CheckboxListItem.generated.d.ts +8 -0
- package/dist/i18n/generated-english/CheckboxList/CheckboxListItem.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/CheckboxList/CheckboxListItem.generated.js +12 -0
- package/dist/i18n/generated-english/Citation/Citation.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Citation/Citation.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Citation/Citation.generated.js +12 -0
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.d.ts +8 -0
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.js +14 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPalette.generated.d.ts +8 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPalette.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPalette.generated.js +15 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteFooter.generated.d.ts +8 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteFooter.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteFooter.generated.js +14 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteInput.generated.js +14 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteList.generated.d.ts +8 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteList.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/CommandPalette/CommandPaletteList.generated.js +12 -0
- package/dist/i18n/generated-english/ComplexSelector/ComplexSelector.generated.d.ts +8 -0
- package/dist/i18n/generated-english/ComplexSelector/ComplexSelector.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/ComplexSelector/ComplexSelector.generated.js +13 -0
- package/dist/i18n/generated-english/ContextMenu/ContextMenu.generated.d.ts +8 -0
- package/dist/i18n/generated-english/ContextMenu/ContextMenu.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/ContextMenu/ContextMenu.generated.js +13 -0
- package/dist/i18n/generated-english/DateInput/DateInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateInput/DateInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateInput/DateInput.generated.js +19 -0
- package/dist/i18n/generated-english/DateInput/NativeDateField.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateInput/NativeDateField.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateInput/NativeDateField.generated.js +16 -0
- package/dist/i18n/generated-english/DateInput/TouchDateField.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateInput/TouchDateField.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateInput/TouchDateField.generated.js +24 -0
- package/dist/i18n/generated-english/DateRangeInput/DateRangeInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateRangeInput/DateRangeInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateRangeInput/DateRangeInput.generated.js +20 -0
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.js +26 -0
- package/dist/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.js +13 -0
- package/dist/i18n/generated-english/DateTimeInput/NativeTimeSegment.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateTimeInput/NativeTimeSegment.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateTimeInput/NativeTimeSegment.generated.js +12 -0
- package/dist/i18n/generated-english/DateTimeInput/TouchDateTimeField.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateTimeInput/TouchDateTimeField.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateTimeInput/TouchDateTimeField.generated.js +37 -0
- package/dist/i18n/generated-english/Dialog/DialogHeader.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Dialog/DialogHeader.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Dialog/DialogHeader.generated.js +12 -0
- package/dist/i18n/generated-english/Drawer/DrawerHeader.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Drawer/DrawerHeader.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Drawer/DrawerHeader.generated.js +12 -0
- package/dist/i18n/generated-english/DropdownMenu/DropdownMenu.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DropdownMenu/DropdownMenu.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DropdownMenu/DropdownMenu.generated.js +13 -0
- package/dist/i18n/generated-english/DropdownMenu/DropdownMenuSubMenu.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DropdownMenu/DropdownMenuSubMenu.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DropdownMenu/DropdownMenuSubMenu.generated.js +14 -0
- package/dist/i18n/generated-english/Field/FieldLabel.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Field/FieldLabel.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Field/FieldLabel.generated.js +13 -0
- package/dist/i18n/generated-english/Field/InputClearButton.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Field/InputClearButton.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Field/InputClearButton.generated.js +12 -0
- package/dist/i18n/generated-english/FileInput/FileInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/FileInput/FileInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/FileInput/FileInput.generated.js +26 -0
- package/dist/i18n/generated-english/Kbd/Kbd.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Kbd/Kbd.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Kbd/Kbd.generated.js +27 -0
- package/dist/i18n/generated-english/Lightbox/Lightbox.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Lightbox/Lightbox.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Lightbox/Lightbox.generated.js +20 -0
- package/dist/i18n/generated-english/Link/Link.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Link/Link.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Link/Link.generated.js +12 -0
- package/dist/i18n/generated-english/Markdown/Markdown.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Markdown/Markdown.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Markdown/Markdown.generated.js +12 -0
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.js +13 -0
- package/dist/i18n/generated-english/MetadataList/MetadataList.generated.d.ts +8 -0
- package/dist/i18n/generated-english/MetadataList/MetadataList.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/MetadataList/MetadataList.generated.js +13 -0
- package/dist/i18n/generated-english/MobileNav/MobileNav.generated.d.ts +8 -0
- package/dist/i18n/generated-english/MobileNav/MobileNav.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/MobileNav/MobileNav.generated.js +13 -0
- package/dist/i18n/generated-english/MobileNav/MobileNavToggle.generated.d.ts +8 -0
- package/dist/i18n/generated-english/MobileNav/MobileNavToggle.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/MobileNav/MobileNavToggle.generated.js +12 -0
- package/dist/i18n/generated-english/MoreMenu/MoreMenu.generated.d.ts +8 -0
- package/dist/i18n/generated-english/MoreMenu/MoreMenu.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/MoreMenu/MoreMenu.generated.js +12 -0
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.d.ts +8 -0
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.js +32 -0
- package/dist/i18n/generated-english/NumberInput/NumberInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/NumberInput/NumberInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/NumberInput/NumberInput.generated.js +15 -0
- package/dist/i18n/generated-english/Outline/Outline.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Outline/Outline.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Outline/Outline.generated.js +12 -0
- package/dist/i18n/generated-english/Pagination/Pagination.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Pagination/Pagination.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Pagination/Pagination.generated.js +27 -0
- package/dist/i18n/generated-english/Popover/Popover.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Popover/Popover.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Popover/Popover.generated.js +12 -0
- package/dist/i18n/generated-english/Popover/usePopover.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Popover/usePopover.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Popover/usePopover.generated.js +12 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.js +16 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchEditPopover.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchEditPopover.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchEditPopover.generated.js +20 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +23 -0
- package/dist/i18n/generated-english/PowerSearch/formatFilterValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatFilterValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatFilterValue.generated.js +15 -0
- package/dist/i18n/generated-english/PowerSearch/usePowerSearchConfig.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/usePowerSearchConfig.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/usePowerSearchConfig.generated.js +32 -0
- package/dist/i18n/generated-english/Resizable/ResizeHandle.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Resizable/ResizeHandle.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Resizable/ResizeHandle.generated.js +13 -0
- package/dist/i18n/generated-english/Selector/Selector.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Selector/Selector.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Selector/Selector.generated.js +24 -0
- package/dist/i18n/generated-english/SideNav/SideNav.generated.d.ts +8 -0
- package/dist/i18n/generated-english/SideNav/SideNav.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/SideNav/SideNav.generated.js +13 -0
- package/dist/i18n/generated-english/SideNav/SideNavCollapseButton.generated.d.ts +8 -0
- package/dist/i18n/generated-english/SideNav/SideNavCollapseButton.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/SideNav/SideNavCollapseButton.generated.js +13 -0
- package/dist/i18n/generated-english/SideNav/SideNavHeading.generated.d.ts +8 -0
- package/dist/i18n/generated-english/SideNav/SideNavHeading.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/SideNav/SideNavHeading.generated.js +13 -0
- package/dist/i18n/generated-english/SideNav/SideNavItem.generated.d.ts +8 -0
- package/dist/i18n/generated-english/SideNav/SideNavItem.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/SideNav/SideNavItem.generated.js +14 -0
- package/dist/i18n/generated-english/Slider/Slider.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Slider/Slider.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Slider/Slider.generated.js +13 -0
- package/dist/i18n/generated-english/Spinner/Spinner.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Spinner/Spinner.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Spinner/Spinner.generated.js +12 -0
- package/dist/i18n/generated-english/Stepper/Step.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Stepper/Step.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Stepper/Step.generated.js +17 -0
- package/dist/i18n/generated-english/Stepper/Stepper.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Stepper/Stepper.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Stepper/Stepper.generated.js +14 -0
- package/dist/i18n/generated-english/Switch/Switch.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Switch/Switch.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Switch/Switch.generated.js +12 -0
- package/dist/i18n/generated-english/TabList/TabList.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TabList/TabList.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TabList/TabList.generated.js +12 -0
- package/dist/i18n/generated-english/Table/BaseTable.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/BaseTable.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/BaseTable.generated.js +12 -0
- package/dist/i18n/generated-english/Table/Table.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/Table.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/Table.generated.js +12 -0
- package/dist/i18n/generated-english/Table/TableSelectionToolbar.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/TableSelectionToolbar.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/TableSelectionToolbar.generated.js +14 -0
- package/dist/i18n/generated-english/Table/plugins/columnResize/useTableColumnResize.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/columnResize/useTableColumnResize.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/columnResize/useTableColumnResize.generated.js +12 -0
- package/dist/i18n/generated-english/Table/plugins/filtering/useTableFiltering.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/filtering/useTableFiltering.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/filtering/useTableFiltering.generated.js +15 -0
- package/dist/i18n/generated-english/Table/plugins/groupedRows/useTableGroupedRows.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/groupedRows/useTableGroupedRows.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/groupedRows/useTableGroupedRows.generated.js +13 -0
- package/dist/i18n/generated-english/Table/plugins/pagination/useTablePagination.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/pagination/useTablePagination.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/pagination/useTablePagination.generated.js +14 -0
- package/dist/i18n/generated-english/Table/plugins/rowExpansion/useTableRowExpansion.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/rowExpansion/useTableRowExpansion.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/rowExpansion/useTableRowExpansion.generated.js +14 -0
- package/dist/i18n/generated-english/Table/plugins/rowStatus/useTableRowStatus.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/rowStatus/useTableRowStatus.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/rowStatus/useTableRowStatus.generated.js +12 -0
- package/dist/i18n/generated-english/Table/plugins/selection/useTableSelection.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/selection/useTableSelection.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/selection/useTableSelection.generated.js +14 -0
- package/dist/i18n/generated-english/Table/plugins/sortable/useTableSortable.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/sortable/useTableSortable.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/sortable/useTableSortable.generated.js +15 -0
- package/dist/i18n/generated-english/Table/plugins/tree/useTableTreeData.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Table/plugins/tree/useTableTreeData.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Table/plugins/tree/useTableTreeData.generated.js +15 -0
- package/dist/i18n/generated-english/TextArea/TextArea.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TextArea/TextArea.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TextArea/TextArea.generated.js +15 -0
- package/dist/i18n/generated-english/TextInput/TextInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TextInput/TextInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TextInput/TextInput.generated.js +13 -0
- package/dist/i18n/generated-english/Thumbnail/Thumbnail.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Thumbnail/Thumbnail.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Thumbnail/Thumbnail.generated.js +15 -0
- package/dist/i18n/generated-english/TimeInput/TimeInput.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TimeInput/TimeInput.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TimeInput/TimeInput.generated.js +18 -0
- package/dist/i18n/generated-english/TimeInput/TouchTimeField.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TimeInput/TouchTimeField.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TimeInput/TouchTimeField.generated.js +22 -0
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.js +12 -0
- package/dist/i18n/generated-english/Timestamp/TimestampHoverCard.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Timestamp/TimestampHoverCard.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Timestamp/TimestampHoverCard.generated.js +14 -0
- package/dist/i18n/generated-english/Toast/Toast.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Toast/Toast.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Toast/Toast.generated.js +12 -0
- package/dist/i18n/generated-english/Toast/ToastViewport.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Toast/ToastViewport.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Toast/ToastViewport.generated.js +12 -0
- package/dist/i18n/generated-english/Token/Token.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Token/Token.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Token/Token.generated.js +12 -0
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.js +18 -0
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.js +30 -0
- package/dist/i18n/generated-english/TopNav/TopNav.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TopNav/TopNav.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TopNav/TopNav.generated.js +12 -0
- package/dist/i18n/generated-english/TopNav/TopNavHeading.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TopNav/TopNavHeading.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TopNav/TopNavHeading.generated.js +13 -0
- package/dist/i18n/generated-english/TreeList/TreeListItem.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TreeList/TreeListItem.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TreeList/TreeListItem.generated.js +12 -0
- package/dist/i18n/generated-english/Typeahead/BaseTypeahead.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Typeahead/BaseTypeahead.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Typeahead/BaseTypeahead.generated.js +16 -0
- package/dist/i18n/generated-english/Typeahead/Typeahead.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Typeahead/Typeahead.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Typeahead/Typeahead.generated.js +13 -0
- package/dist/i18n/generated-english/hooks/useInputStatusIcon.generated.d.ts +8 -0
- package/dist/i18n/generated-english/hooks/useInputStatusIcon.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/hooks/useInputStatusIcon.generated.js +14 -0
- package/dist/i18n/generated-english/hooks/useKeyboardHint.generated.d.ts +8 -0
- package/dist/i18n/generated-english/hooks/useKeyboardHint.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/hooks/useKeyboardHint.generated.js +12 -0
- package/dist/i18n/generated-locales/af-ZA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/af-ZA.generated.js +2 -2
- package/dist/i18n/generated-locales/ar-SA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ar-SA.generated.js +2 -2
- package/dist/i18n/generated-locales/ca-ES.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ca-ES.generated.js +2 -2
- package/dist/i18n/generated-locales/cs-CZ.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/cs-CZ.generated.js +2 -2
- package/dist/i18n/generated-locales/da-DK.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/da-DK.generated.js +2 -2
- package/dist/i18n/generated-locales/de-DE.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/de-DE.generated.js +2 -2
- package/dist/i18n/generated-locales/el-GR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/el-GR.generated.js +2 -2
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +11 -2
- package/dist/i18n/generated-locales/es-ES.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/es-ES.generated.js +2 -2
- package/dist/i18n/generated-locales/fi-FI.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/fi-FI.generated.js +2 -2
- package/dist/i18n/generated-locales/fr-FR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/fr-FR.generated.js +2 -2
- package/dist/i18n/generated-locales/he-IL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/he-IL.generated.js +2 -2
- package/dist/i18n/generated-locales/hu-HU.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/hu-HU.generated.js +2 -2
- package/dist/i18n/generated-locales/it-IT.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/it-IT.generated.js +2 -2
- package/dist/i18n/generated-locales/ja-JP.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ja-JP.generated.js +2 -2
- package/dist/i18n/generated-locales/ko-KR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ko-KR.generated.js +2 -2
- package/dist/i18n/generated-locales/nl-NL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/nl-NL.generated.js +2 -2
- package/dist/i18n/generated-locales/no-NO.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/no-NO.generated.js +2 -2
- package/dist/i18n/generated-locales/pl-PL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pl-PL.generated.js +2 -2
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +11 -2
- package/dist/i18n/generated-locales/pt-BR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pt-BR.generated.js +2 -2
- package/dist/i18n/generated-locales/pt-PT.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pt-PT.generated.js +2 -2
- package/dist/i18n/generated-locales/ro-RO.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ro-RO.generated.js +2 -2
- package/dist/i18n/generated-locales/ru-RU.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ru-RU.generated.js +2 -2
- package/dist/i18n/generated-locales/sr-SP.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/sr-SP.generated.js +2 -2
- package/dist/i18n/generated-locales/sv-SE.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/sv-SE.generated.js +2 -2
- package/dist/i18n/generated-locales/tr-TR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/tr-TR.generated.js +2 -2
- package/dist/i18n/generated-locales/uk-UA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/uk-UA.generated.js +2 -2
- package/dist/i18n/generated-locales/vi-VN.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/vi-VN.generated.js +2 -2
- package/dist/i18n/generated-locales/zh-CN.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/zh-CN.generated.js +2 -2
- package/dist/i18n/generated-locales/zh-TW.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/zh-TW.generated.js +2 -2
- package/dist/i18n/index.d.ts +6 -1
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +6 -1
- package/dist/i18n/publicContext.d.ts +2 -0
- package/dist/i18n/publicContext.d.ts.map +1 -0
- package/dist/i18n/publicContext.js +26 -0
- package/dist/i18n/resolve.d.ts +6 -2
- package/dist/i18n/resolve.d.ts.map +1 -1
- package/dist/i18n/resolve.js +12 -4
- package/dist/i18n/useComponentTranslator.d.ts +8 -0
- package/dist/i18n/useComponentTranslator.d.ts.map +1 -0
- package/dist/i18n/useComponentTranslator.js +42 -0
- package/dist/i18n/useTranslator.d.ts.map +1 -1
- package/dist/i18n/useTranslator.js +7 -1
- package/dist/motion/animatedLayout.d.ts +130 -5
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +867 -47
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +197 -5
- package/dist/motion/presentation.d.ts +44 -0
- package/dist/motion/presentation.d.ts.map +1 -0
- package/dist/motion/presentation.js +127 -0
- package/dist/motion/uikit/gestures.d.ts +9 -18
- package/dist/motion/uikit/gestures.d.ts.map +1 -1
- package/dist/motion/uikit/gestures.js +14 -9
- 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/longPress.d.ts +26 -0
- package/dist/motion/uikit/longPress.d.ts.map +1 -0
- package/dist/motion/uikit/longPress.js +29 -0
- package/dist/motion/uikit/springs.d.ts +18 -0
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +20 -1
- package/dist/privateAttributes/hapticSwitch.stylex.d.ts +5 -0
- package/dist/privateAttributes/hapticSwitch.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/hapticSwitch.stylex.js +27 -0
- package/dist/privateAttributes/layerRoot.stylex.d.ts +9 -0
- package/dist/privateAttributes/layerRoot.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/layerRoot.stylex.js +28 -0
- package/dist/privateAttributes/segmentDisabled.stylex.d.ts +5 -0
- package/dist/privateAttributes/segmentDisabled.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/segmentDisabled.stylex.js +28 -0
- package/dist/theme/Theme.d.ts +10 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +8 -4
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +7 -1
- package/dist/utils/accessibleName.d.ts +8 -0
- package/dist/utils/accessibleName.d.ts.map +1 -0
- package/dist/utils/accessibleName.js +72 -0
- package/dist/utils/clickGuard.d.ts +33 -0
- package/dist/utils/clickGuard.d.ts.map +1 -0
- package/dist/utils/clickGuard.js +141 -0
- package/dist/utils/coarsePointer.d.ts +8 -0
- package/dist/utils/coarsePointer.d.ts.map +1 -0
- package/dist/utils/coarsePointer.js +45 -0
- package/dist/utils/devWarning.d.ts.map +1 -1
- package/dist/utils/devWarning.js +4 -9
- package/dist/utils/flatTree.d.ts +17 -0
- package/dist/utils/flatTree.d.ts.map +1 -0
- package/dist/utils/flatTree.js +38 -0
- package/dist/utils/focusOutline.stylex.d.ts +0 -16
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +7 -16
- package/dist/utils/focusReturn.d.ts +41 -7
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +60 -8
- package/dist/utils/getNodeText.d.ts.map +1 -1
- package/dist/utils/getNodeText.js +2 -1
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +14 -17
- package/dist/utils/ime.d.ts.map +1 -1
- package/dist/utils/ime.js +23 -51
- package/dist/utils/inputPresentation.d.ts +5 -5
- package/dist/utils/inputPresentation.d.ts.map +1 -1
- package/dist/utils/inputPresentation.js +5 -5
- package/dist/utils/inputStream.d.ts +17 -0
- package/dist/utils/inputStream.d.ts.map +1 -0
- package/dist/utils/inputStream.js +136 -0
- package/dist/utils/interactionModality.d.ts +49 -7
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +133 -66
- package/dist/utils/interactionOverlay.stylex.d.ts +26 -92
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +58 -85
- package/dist/utils/plainDate.d.ts +9 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +26 -1
- package/dist/utils/presentation.d.ts +3 -4
- package/dist/utils/presentation.d.ts.map +1 -1
- package/dist/utils/presentation.js +30 -45
- package/dist/utils/pressDisabled.d.ts +21 -0
- package/dist/utils/pressDisabled.d.ts.map +1 -0
- package/dist/utils/pressDisabled.js +32 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +117 -112
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +11 -21
- package/dist/utils/rtlStyles.d.ts +0 -24
- package/dist/utils/rtlStyles.d.ts.map +1 -1
- package/dist/utils/rtlStyles.js +13 -24
- package/dist/utils/selectionLock.d.ts +13 -0
- package/dist/utils/selectionLock.d.ts.map +1 -0
- package/dist/utils/selectionLock.js +159 -0
- package/dist/utils/sharedMutationObserver.d.ts +2 -2
- package/dist/utils/sharedMutationObserver.js +2 -2
- package/dist/utils/standaloneMonthCapitals.generated.d.ts +7 -0
- package/dist/utils/standaloneMonthCapitals.generated.d.ts.map +1 -0
- package/dist/utils/standaloneMonthCapitals.generated.js +9 -0
- package/dist/utils/timeFormat.d.ts +5 -13
- package/dist/utils/timeFormat.d.ts.map +1 -1
- package/dist/utils/timeFormat.js +5 -13
- package/dist/utils/touchPresentation.d.ts +6 -11
- package/dist/utils/touchPresentation.d.ts.map +1 -1
- package/dist/utils/touchPresentation.js +37 -62
- package/dist/utils/touchPresentation.stylex.d.ts +1 -1
- package/dist/utils/touchPresentation.stylex.d.ts.map +1 -1
- package/dist/utils/touchPresentation.stylex.js +7 -13
- package/dist/utils/touchQueries.d.ts +17 -1
- package/dist/utils/touchQueries.d.ts.map +1 -1
- package/dist/utils/touchQueries.js +20 -2
- package/dist/utils/typeaheadMatch.d.ts +24 -0
- package/dist/utils/typeaheadMatch.d.ts.map +1 -0
- package/dist/utils/typeaheadMatch.js +113 -0
- package/dist/utils/useFocusLeavingChange.d.ts +13 -0
- package/dist/utils/useFocusLeavingChange.d.ts.map +1 -0
- package/dist/utils/useFocusLeavingChange.js +48 -0
- package/locales/af-ZA.json +2 -2
- package/locales/ar-SA.json +2 -2
- package/locales/ca-ES.json +2 -2
- package/locales/cs-CZ.json +2 -2
- package/locales/da-DK.json +2 -2
- package/locales/de-DE.json +2 -2
- package/locales/el-GR.json +2 -2
- package/locales/en.json +41 -5
- package/locales/es-ES.json +2 -2
- package/locales/fi-FI.json +2 -2
- package/locales/fr-FR.json +2 -2
- package/locales/he-IL.json +2 -2
- package/locales/hu-HU.json +2 -2
- package/locales/it-IT.json +2 -2
- package/locales/ja-JP.json +2 -2
- package/locales/ko-KR.json +2 -2
- package/locales/nl-NL.json +2 -2
- package/locales/no-NO.json +2 -2
- package/locales/pl-PL.json +2 -2
- package/locales/pseudo.json +29 -2
- package/locales/pt-BR.json +2 -2
- package/locales/pt-PT.json +2 -2
- package/locales/ro-RO.json +2 -2
- package/locales/ru-RU.json +2 -2
- package/locales/sr-SP.json +2 -2
- package/locales/sv-SE.json +2 -2
- package/locales/tr-TR.json +2 -2
- package/locales/uk-UA.json +2 -2
- package/locales/vi-VN.json +2 -2
- package/locales/zh-CN.json +2 -2
- package/locales/zh-TW.json +2 -2
- package/package.json +6 -5
- package/src/AlertDialog/AlertDialog.tsx +8 -2
- package/src/AppShell/AppShell.tsx +73 -57
- package/src/Avatar/Avatar.tsx +10 -3
- package/src/AvatarGroup/AvatarGroup.tsx +8 -2
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +9 -3
- package/src/Banner/Banner.tsx +12 -2
- package/src/BottomSheet/BottomSheet.tsx +106 -104
- package/src/BottomSheet/BottomSheetEdgeTint.tsx +10 -21
- package/src/BottomSheet/BottomSheetHostContext.ts +6 -10
- package/src/BottomSheet/BottomSheetPanel.tsx +109 -86
- package/src/BottomSheet/BottomSheetSwitcher.tsx +64 -78
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +8 -0
- package/src/BottomSheet/bottomSheetEscape.ts +3 -3
- package/src/BottomSheet/bottomSheetStack.ts +42 -96
- package/src/BottomSheet/useMobileKeyboard.ts +63 -24
- package/src/BottomSheet/useSheetGestures.ts +138 -108
- package/src/Breadcrumbs/BreadcrumbItem.tsx +2 -1
- package/src/Breadcrumbs/Breadcrumbs.tsx +8 -2
- package/src/Button/Button.tsx +19 -6
- package/src/Calendar/Calendar.tsx +21 -13
- package/src/Calendar/hooks/useCalendarNavigation.ts +9 -10
- package/src/Carousel/Carousel.tsx +8 -2
- package/src/Center/Center.tsx +1 -1
- package/src/Chat/ChatComposer.tsx +14 -11
- package/src/Chat/ChatComposerDrawer.tsx +9 -3
- package/src/Chat/ChatComposerInput.tsx +18 -3
- package/src/Chat/ChatDictationButton.tsx +8 -2
- package/src/Chat/ChatLayout.tsx +9 -8
- package/src/Chat/ChatLayoutScrollButton.tsx +8 -2
- package/src/Chat/ChatMessage.tsx +21 -5
- package/src/Chat/ChatMessageList.tsx +9 -2
- package/src/Chat/ChatMessageMetadata.tsx +8 -2
- package/src/Chat/ChatPastedTextToken.tsx +23 -6
- package/src/Chat/ChatSendButton.tsx +8 -2
- package/src/Chat/ChatSystemMessage.tsx +4 -1
- package/src/Chat/ChatToolCalls.tsx +15 -4
- package/src/Chat/chatMessage.vars.stylex.ts +18 -0
- package/src/Chat/useSpeechRecognition.ts +9 -2
- package/src/Chat/useTriggerMenu.tsx +46 -33
- package/src/CheckboxInput/CheckboxInput.tsx +8 -2
- package/src/CheckboxList/CheckboxList.tsx +7 -1
- package/src/CheckboxList/CheckboxListContext.tsx +8 -0
- package/src/CheckboxList/CheckboxListItem.tsx +16 -4
- package/src/Citation/Citation.tsx +8 -2
- package/src/Code/Code.tsx +1 -1
- package/src/CodeBlock/CodeBlock.tsx +14 -4
- package/src/Collapsible/Collapsible.tsx +33 -4
- package/src/CommandPalette/CommandPalette.tsx +28 -8
- package/src/CommandPalette/CommandPaletteEmpty.tsx +2 -0
- package/src/CommandPalette/CommandPaletteFooter.tsx +8 -2
- package/src/CommandPalette/CommandPaletteInput.tsx +13 -10
- package/src/CommandPalette/CommandPaletteList.tsx +8 -2
- package/src/ComplexSelector/ComplexSelector.tsx +11 -4
- package/src/ContextMenu/ContextMenu.tsx +38 -8
- package/src/DateInput/DateInput.tsx +86 -25
- package/src/DateInput/MonthScroller.tsx +2 -3
- package/src/DateInput/NativeDateField.tsx +11 -15
- package/src/DateInput/TouchDateField.tsx +13 -18
- package/src/DateRangeInput/DateRangeInput.tsx +13 -17
- package/src/DateTimeInput/DateTimeInput.tsx +56 -38
- package/src/DateTimeInput/NativeDateSegment.tsx +9 -2
- package/src/DateTimeInput/NativeTimeSegment.tsx +9 -2
- package/src/DateTimeInput/TouchDateTimeField.tsx +14 -18
- package/src/Dialog/Dialog.tsx +36 -28
- package/src/Dialog/DialogHeader.tsx +8 -2
- package/src/Drawer/Drawer.tsx +32 -4
- package/src/Drawer/DrawerHeader.tsx +8 -2
- package/src/DropdownMenu/DropdownMenu.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenu.tsx +38 -87
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +15 -5
- package/src/DropdownMenu/DropdownMenuItem.tsx +7 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +16 -6
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +19 -6
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +6 -3
- package/src/Field/Field.tsx +2 -2
- package/src/Field/FieldLabel.tsx +13 -25
- package/src/Field/InputClearButton.tsx +9 -3
- package/src/Field/PanelSearchInput.tsx +7 -8
- package/src/Field/fieldStatusPlacement.ts +18 -0
- package/src/Field/index.ts +4 -1
- package/src/Field/inputDisabledFocus.ts +62 -4
- package/src/Field/inputStyles.stylex.ts +46 -9
- package/src/Field/textEntryTraits.ts +116 -0
- package/src/FieldStatus/FieldStatus.tsx +28 -3
- package/src/FieldStatus/index.ts +7 -0
- package/src/FileInput/FileInput.doc.mjs +3 -3
- package/src/FileInput/FileInput.tsx +42 -10
- package/src/Grid/Grid.doc.mjs +4 -4
- package/src/Grid/Grid.tsx +6 -4
- package/src/Grid/GridSpan.doc.mjs +51 -2
- package/src/Grid/GridSpan.tsx +2 -0
- package/src/HStack/HStack.tsx +2 -1
- package/src/Heading/Heading.tsx +5 -3
- package/src/HoverCard/HoverCard.doc.mjs +61 -10
- package/src/HoverCard/HoverCard.tsx +8 -5
- package/src/HoverCard/useHoverCard.doc.mjs +1 -1
- package/src/HoverCard/useHoverCard.tsx +10 -2
- package/src/InputGroup/groupStyles.ts +9 -2
- package/src/Item/Item.tsx +5 -5
- package/src/Item/ItemSwipeLayer.tsx +8 -1
- package/src/Kbd/Kbd.tsx +12 -3
- package/src/Layer/layerClickBoundary.ts +97 -0
- package/src/Layer/layerStructureReset.stylex.ts +5 -0
- package/src/Layer/layerSurfacePress.ts +35 -0
- package/src/Layer/outsidePress.ts +179 -0
- package/src/Layer/useLayer.tsx +32 -6
- package/src/Layer/useTouchTrigger.ts +106 -17
- package/src/Layout/LayoutSlotsContext.ts +4 -2
- package/src/Layout/layoutReset.ts +45 -0
- package/src/Lightbox/Lightbox.tsx +19 -7
- package/src/Link/Link.tsx +8 -2
- package/src/Markdown/Markdown.tsx +10 -2
- package/src/Markdown/plugins/HeadingLinksRenderer.tsx +8 -2
- package/src/MetadataList/MetadataList.tsx +13 -5
- package/src/MetadataList/MetadataListItem.tsx +2 -1
- package/src/MobileNav/MobileNav.tsx +15 -3
- package/src/MobileNav/MobileNavToggle.tsx +8 -2
- package/src/MoreMenu/MoreMenu.tsx +8 -2
- package/src/MultiSelector/MultiSelector.tsx +48 -49
- package/src/MultiSelector/hooks.ts +7 -5
- package/src/NavMenu/NavHeadingMenuItem.tsx +2 -1
- package/src/NumberInput/NumberInput.tsx +11 -4
- package/src/Outline/Outline.tsx +8 -2
- package/src/OverflowList/OverflowList.tsx +2 -1
- package/src/Pagination/Pagination.tsx +9 -2
- package/src/Popover/Popover.tsx +10 -4
- package/src/Popover/usePopover.tsx +15 -4
- package/src/PowerSearch/PowerSearch.tsx +12 -4
- package/src/PowerSearch/PowerSearchEditPopover.tsx +10 -4
- package/src/PowerSearch/PowerSearchToken.tsx +2 -2
- package/src/PowerSearch/PowerSearchValueEditor.tsx +20 -13
- package/src/PowerSearch/formatFilterValue.ts +4 -0
- package/src/PowerSearch/resolveOperatorLabel.ts +7 -1
- package/src/PowerSearch/usePowerSearchConfig.ts +4 -0
- package/src/PowerSearch/usePowerSearchSource.ts +2 -2
- package/src/ProgressBar/ProgressBar.tsx +3 -1
- package/src/RadioList/RadioList.tsx +13 -2
- package/src/RadioList/RadioListItem.tsx +9 -1
- package/src/RadioList/RadioListReasonContext.ts +25 -0
- package/src/Resizable/ResizeHandle.tsx +8 -2
- package/src/Resizable/resizableModel.ts +364 -0
- package/src/Resizable/useResizable.ts +17 -348
- package/src/SegmentedControl/SegmentedControl.doc.mjs +5 -5
- package/src/SegmentedControl/SegmentedControl.tsx +58 -30
- package/src/SegmentedControl/SegmentedControlContext.ts +4 -5
- package/src/SegmentedControl/SegmentedControlItem.doc.mjs +1 -1
- package/src/SegmentedControl/SegmentedControlItem.tsx +12 -14
- package/src/SelectableCard/SelectableCard.tsx +66 -1
- package/src/Selector/Selector.tsx +17 -21
- package/src/Selector/useSelectorPresentation.ts +8 -1
- package/src/SideNav/SideNav.tsx +230 -33
- package/src/SideNav/SideNavCollapseButton.tsx +26 -4
- package/src/SideNav/SideNavFocusTargetsContext.ts +29 -0
- package/src/SideNav/SideNavHeading.tsx +33 -16
- package/src/SideNav/SideNavItem.tsx +29 -6
- package/src/SideNav/SideNavSection.tsx +2 -1
- package/src/SideNav/railMotion.ts +73 -179
- package/src/Slider/Slider.tsx +15 -12
- package/src/Spinner/Spinner.tsx +9 -3
- package/src/Stack/Stack.doc.mjs +83 -11
- package/src/Stack/Stack.tsx +1 -1
- package/src/Stack/stack.stylex.ts +1 -1
- package/src/Stepper/Step.tsx +8 -2
- package/src/Stepper/Stepper.tsx +8 -2
- package/src/Switch/Switch.tsx +9 -3
- package/src/TabList/TabList.tsx +8 -2
- package/src/Table/BaseTable.tsx +18 -8
- package/src/Table/Table.tsx +8 -2
- package/src/Table/TableSelectionToolbar.tsx +8 -2
- package/src/Table/glidingDivider.ts +8 -3
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +8 -2
- package/src/Table/plugins/filtering/useTableFiltering.tsx +16 -9
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +8 -2
- package/src/Table/plugins/pagination/useTablePagination.tsx +8 -2
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +10 -4
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +8 -2
- package/src/Table/plugins/selection/useTableSelection.tsx +9 -3
- package/src/Table/plugins/sortable/useTableSortable.tsx +12 -4
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -2
- package/src/Table/plugins/tree/useTableTreeData.tsx +10 -4
- package/src/Text/Heading.doc.mjs +52 -3
- package/src/Text/Text.doc.mjs +1 -1
- package/src/Text/text.stylex.ts +12 -0
- package/src/TextArea/TextArea.doc.mjs +65 -1
- package/src/TextArea/TextArea.tsx +38 -11
- package/src/TextInput/TextInput.doc.mjs +70 -6
- package/src/TextInput/TextInput.tsx +55 -13
- package/src/Thumbnail/Thumbnail.tsx +8 -2
- package/src/TimeInput/TimeInput.tsx +13 -17
- package/src/TimeInput/TouchTimeField.tsx +12 -15
- package/src/Timer/Timer.tsx +1 -1
- package/src/Timestamp/Timestamp.tsx +8 -2
- package/src/Timestamp/TimestampHoverCard.tsx +8 -2
- package/src/Toast/Toast.tsx +10 -2
- package/src/Toast/ToastViewport.tsx +12 -3
- package/src/Toast/useToast.tsx +8 -3
- package/src/ToggleButton/ToggleButton.tsx +10 -3
- package/src/Token/Token.tsx +10 -2
- package/src/Token/TokenLink.tsx +16 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +16 -11
- package/src/Tokenizer/Tokenizer.tsx +117 -70
- package/src/Tokenizer/TokenizerBottomSheet.tsx +9 -3
- package/src/Tooltip/Tooltip.doc.mjs +3 -3
- package/src/Tooltip/Tooltip.tsx +4 -3
- package/src/Tooltip/useTooltip.doc.mjs +3 -3
- package/src/Tooltip/useTooltip.tsx +58 -15
- package/src/TopNav/TopNav.tsx +24 -13
- package/src/TopNav/TopNavHeading.tsx +31 -12
- package/src/TopNav/TopNavMegaMenu.tsx +4 -3
- package/src/TopNav/TopNavMegaMenuFeaturedCard.tsx +9 -2
- package/src/TopNav/TopNavMegaMenuItem.tsx +7 -2
- package/src/TopNav/TopNavMenu.tsx +2 -1
- package/src/TreeList/TreeList.tsx +91 -11
- package/src/TreeList/TreeListItem.tsx +13 -5
- package/src/Typeahead/BaseTypeahead.doc.mjs +7 -4
- package/src/Typeahead/BaseTypeahead.tsx +523 -68
- package/src/Typeahead/Typeahead.doc.mjs +24 -6
- package/src/Typeahead/Typeahead.tsx +27 -15
- package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
- package/src/Typeahead/committedChoicesKey.tsx +37 -0
- package/src/Typeahead/index.ts +1 -1
- package/src/Typeahead/types.ts +27 -3
- package/src/gestures/GestureArena.ts +91 -38
- package/src/gestures/GestureHost.ts +1561 -561
- package/src/gestures/GestureRecognizer.ts +69 -18
- package/src/gestures/LongPressGestureRecognizer.ts +20 -1
- package/src/gestures/PanGestureRecognizer.ts +35 -0
- package/src/gestures/PinchGestureRecognizer.ts +13 -8
- package/src/gestures/PressTracker.ts +55 -8
- package/src/gestures/README.md +313 -51
- package/src/gestures/TapGestureRecognizer.ts +5 -0
- package/src/gestures/VelocityTracker.ts +35 -0
- package/src/gestures/fingerScroll.ts +208 -0
- package/src/gestures/gestureSync.ts +60 -0
- package/src/gestures/haptics.ts +9 -13
- package/src/gestures/hostRegistry.ts +18 -0
- package/src/gestures/index.ts +6 -5
- package/src/gestures/nativeScroll.ts +6 -20
- package/src/gestures/pageHold.ts +265 -0
- package/src/gestures/recognizerInternals.ts +77 -0
- package/src/gestures/selectionLock.ts +12 -0
- package/src/gestures/touchAction.ts +12 -24
- package/src/gestures/types.ts +18 -0
- package/src/gestures/useFingerScroll.ts +78 -0
- package/src/gestures/useGestureRecognizer.ts +70 -209
- package/src/gestures/usePressTracker.ts +212 -0
- package/src/hooks/ModalAnnounceProvider.tsx +19 -19
- package/src/hooks/actionGroupTracker.ts +23 -55
- package/src/hooks/menuPressGesture.ts +25 -30
- package/src/hooks/menuPressMarker.ts +15 -0
- package/src/hooks/menuPressOnItems.ts +7 -9
- package/src/hooks/modalAnnounce.ts +20 -39
- package/src/hooks/scrollbarGutter.ts +9 -16
- package/src/hooks/useAnimatedLayout.ts +2 -3
- package/src/hooks/useAnnounce.ts +65 -106
- package/src/hooks/useAnnounceRenderedText.ts +32 -53
- package/src/hooks/useAttachment.ts +59 -0
- package/src/hooks/useAutoMediaMode.ts +29 -54
- package/src/hooks/useBusyAnnouncement.ts +13 -20
- package/src/hooks/useClickableContainer.ts +66 -34
- package/src/hooks/useContainerReveal.ts +9 -36
- package/src/hooks/useDevWarning.ts +3 -8
- package/src/hooks/useEntryAnimation.ts +1 -3
- package/src/hooks/useFocusReturnVisibility.ts +15 -12
- package/src/hooks/useFocusTrap.ts +2 -8
- package/src/hooks/useHighlightedOptionScroll.ts +2 -4
- package/src/hooks/useHotkeys.ts +4 -16
- package/src/hooks/useImageMode.ts +6 -43
- package/src/hooks/useIndicatorFocusRing.tsx +13 -38
- package/src/hooks/useInputStatusIcon.tsx +29 -42
- package/src/hooks/useInteractiveRole.ts +6 -22
- package/src/hooks/useKeyboardHint.tsx +16 -4
- package/src/hooks/useListFocus.ts +87 -8
- package/src/hooks/useLongPress.ts +69 -28
- package/src/hooks/useMenuHover.ts +38 -52
- package/src/hooks/useMenuPress.ts +117 -186
- package/src/hooks/useOverflow.ts +3 -8
- package/src/hooks/useRenamedProp.ts +8 -17
- package/src/hooks/useScrollOverflow.ts +9 -27
- package/src/hooks/useScrollableArea.ts +14 -21
- package/src/hooks/useSettledOpen.ts +51 -0
- package/src/hooks/useStreamingText.ts +14 -33
- package/src/hooks/useTreeFocus.doc.mjs +2 -2
- package/src/hooks/useTreeFocus.ts +49 -13
- package/src/hooks/useTypeahead.doc.mjs +2 -2
- package/src/hooks/useTypeahead.ts +21 -20
- package/src/i18n/InternationalizationContext.ts +1 -1
- package/src/i18n/englishFallback.ts +40 -0
- package/src/i18n/fullEnglishFallback.ts +26 -0
- package/src/i18n/generated-english/AlertDialog/AlertDialog.generated.ts +13 -0
- package/src/i18n/generated-english/AppShell/AppShell.generated.ts +14 -0
- package/src/i18n/generated-english/Avatar/Avatar.generated.ts +13 -0
- package/src/i18n/generated-english/AvatarGroup/AvatarGroup.generated.ts +14 -0
- package/src/i18n/generated-english/AvatarGroup/AvatarGroupOverflow.generated.ts +13 -0
- package/src/i18n/generated-english/Banner/Banner.generated.ts +16 -0
- package/src/i18n/generated-english/Breadcrumbs/Breadcrumbs.generated.ts +13 -0
- package/src/i18n/generated-english/Button/Button.generated.ts +13 -0
- package/src/i18n/generated-english/Calendar/Calendar.generated.ts +22 -0
- package/src/i18n/generated-english/Carousel/Carousel.generated.ts +16 -0
- package/src/i18n/generated-english/Chat/ChatComposer.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/ChatComposerDrawer.generated.ts +15 -0
- package/src/i18n/generated-english/Chat/ChatComposerInput.generated.ts +14 -0
- package/src/i18n/generated-english/Chat/ChatDictationButton.generated.ts +14 -0
- package/src/i18n/generated-english/Chat/ChatLayout.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/ChatLayoutScrollButton.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/ChatMessage.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/ChatMessageList.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/ChatMessageMetadata.generated.ts +18 -0
- package/src/i18n/generated-english/Chat/ChatPastedTextToken.generated.ts +14 -0
- package/src/i18n/generated-english/Chat/ChatSendButton.generated.ts +14 -0
- package/src/i18n/generated-english/Chat/ChatToolCalls.generated.ts +18 -0
- package/src/i18n/generated-english/Chat/useSpeechRecognition.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/useTriggerMenu.generated.ts +14 -0
- package/src/i18n/generated-english/CheckboxInput/CheckboxInput.generated.ts +13 -0
- package/src/i18n/generated-english/CheckboxList/CheckboxListItem.generated.ts +13 -0
- package/src/i18n/generated-english/Citation/Citation.generated.ts +13 -0
- package/src/i18n/generated-english/CodeBlock/CodeBlock.generated.ts +15 -0
- package/src/i18n/generated-english/CommandPalette/CommandPalette.generated.ts +16 -0
- package/src/i18n/generated-english/CommandPalette/CommandPaletteFooter.generated.ts +15 -0
- package/src/i18n/generated-english/CommandPalette/CommandPaletteInput.generated.ts +15 -0
- package/src/i18n/generated-english/CommandPalette/CommandPaletteList.generated.ts +13 -0
- package/src/i18n/generated-english/ComplexSelector/ComplexSelector.generated.ts +14 -0
- package/src/i18n/generated-english/ContextMenu/ContextMenu.generated.ts +14 -0
- package/src/i18n/generated-english/DateInput/DateInput.generated.ts +20 -0
- package/src/i18n/generated-english/DateInput/NativeDateField.generated.ts +17 -0
- package/src/i18n/generated-english/DateInput/TouchDateField.generated.ts +25 -0
- package/src/i18n/generated-english/DateRangeInput/DateRangeInput.generated.ts +21 -0
- package/src/i18n/generated-english/DateTimeInput/DateTimeInput.generated.ts +27 -0
- package/src/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.ts +14 -0
- package/src/i18n/generated-english/DateTimeInput/NativeTimeSegment.generated.ts +13 -0
- package/src/i18n/generated-english/DateTimeInput/TouchDateTimeField.generated.ts +38 -0
- package/src/i18n/generated-english/Dialog/DialogHeader.generated.ts +13 -0
- package/src/i18n/generated-english/Drawer/DrawerHeader.generated.ts +13 -0
- package/src/i18n/generated-english/DropdownMenu/DropdownMenu.generated.ts +14 -0
- package/src/i18n/generated-english/DropdownMenu/DropdownMenuSubMenu.generated.ts +15 -0
- package/src/i18n/generated-english/Field/FieldLabel.generated.ts +14 -0
- package/src/i18n/generated-english/Field/InputClearButton.generated.ts +13 -0
- package/src/i18n/generated-english/FileInput/FileInput.generated.ts +27 -0
- package/src/i18n/generated-english/Kbd/Kbd.generated.ts +28 -0
- package/src/i18n/generated-english/Lightbox/Lightbox.generated.ts +21 -0
- package/src/i18n/generated-english/Link/Link.generated.ts +13 -0
- package/src/i18n/generated-english/Markdown/Markdown.generated.ts +13 -0
- package/src/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.ts +14 -0
- package/src/i18n/generated-english/MetadataList/MetadataList.generated.ts +14 -0
- package/src/i18n/generated-english/MobileNav/MobileNav.generated.ts +14 -0
- package/src/i18n/generated-english/MobileNav/MobileNavToggle.generated.ts +13 -0
- package/src/i18n/generated-english/MoreMenu/MoreMenu.generated.ts +13 -0
- package/src/i18n/generated-english/MultiSelector/MultiSelector.generated.ts +33 -0
- package/src/i18n/generated-english/NumberInput/NumberInput.generated.ts +16 -0
- package/src/i18n/generated-english/Outline/Outline.generated.ts +13 -0
- package/src/i18n/generated-english/Pagination/Pagination.generated.ts +28 -0
- package/src/i18n/generated-english/Popover/Popover.generated.ts +13 -0
- package/src/i18n/generated-english/Popover/usePopover.generated.ts +13 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearch.generated.ts +17 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchEditPopover.generated.ts +21 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +24 -0
- package/src/i18n/generated-english/PowerSearch/formatFilterValue.generated.ts +16 -0
- package/src/i18n/generated-english/PowerSearch/usePowerSearchConfig.generated.ts +33 -0
- package/src/i18n/generated-english/Resizable/ResizeHandle.generated.ts +14 -0
- package/src/i18n/generated-english/Selector/Selector.generated.ts +25 -0
- package/src/i18n/generated-english/SideNav/SideNav.generated.ts +14 -0
- package/src/i18n/generated-english/SideNav/SideNavCollapseButton.generated.ts +14 -0
- package/src/i18n/generated-english/SideNav/SideNavHeading.generated.ts +14 -0
- package/src/i18n/generated-english/SideNav/SideNavItem.generated.ts +15 -0
- package/src/i18n/generated-english/Slider/Slider.generated.ts +14 -0
- package/src/i18n/generated-english/Spinner/Spinner.generated.ts +13 -0
- package/src/i18n/generated-english/Stepper/Step.generated.ts +18 -0
- package/src/i18n/generated-english/Stepper/Stepper.generated.ts +15 -0
- package/src/i18n/generated-english/Switch/Switch.generated.ts +13 -0
- package/src/i18n/generated-english/TabList/TabList.generated.ts +13 -0
- package/src/i18n/generated-english/Table/BaseTable.generated.ts +13 -0
- package/src/i18n/generated-english/Table/Table.generated.ts +13 -0
- package/src/i18n/generated-english/Table/TableSelectionToolbar.generated.ts +15 -0
- package/src/i18n/generated-english/Table/plugins/columnResize/useTableColumnResize.generated.ts +13 -0
- package/src/i18n/generated-english/Table/plugins/filtering/useTableFiltering.generated.ts +16 -0
- package/src/i18n/generated-english/Table/plugins/groupedRows/useTableGroupedRows.generated.ts +14 -0
- package/src/i18n/generated-english/Table/plugins/pagination/useTablePagination.generated.ts +15 -0
- package/src/i18n/generated-english/Table/plugins/rowExpansion/useTableRowExpansion.generated.ts +15 -0
- package/src/i18n/generated-english/Table/plugins/rowStatus/useTableRowStatus.generated.ts +13 -0
- package/src/i18n/generated-english/Table/plugins/selection/useTableSelection.generated.ts +15 -0
- package/src/i18n/generated-english/Table/plugins/sortable/useTableSortable.generated.ts +16 -0
- package/src/i18n/generated-english/Table/plugins/tree/useTableTreeData.generated.ts +16 -0
- package/src/i18n/generated-english/TextArea/TextArea.generated.ts +16 -0
- package/src/i18n/generated-english/TextInput/TextInput.generated.ts +14 -0
- package/src/i18n/generated-english/Thumbnail/Thumbnail.generated.ts +16 -0
- package/src/i18n/generated-english/TimeInput/TimeInput.generated.ts +19 -0
- package/src/i18n/generated-english/TimeInput/TouchTimeField.generated.ts +23 -0
- package/src/i18n/generated-english/Timestamp/Timestamp.generated.ts +13 -0
- package/src/i18n/generated-english/Timestamp/TimestampHoverCard.generated.ts +15 -0
- package/src/i18n/generated-english/Toast/Toast.generated.ts +13 -0
- package/src/i18n/generated-english/Toast/ToastViewport.generated.ts +13 -0
- package/src/i18n/generated-english/Token/Token.generated.ts +13 -0
- package/src/i18n/generated-english/Tokenizer/Tokenizer.generated.ts +19 -0
- package/src/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.ts +31 -0
- package/src/i18n/generated-english/TopNav/TopNav.generated.ts +13 -0
- package/src/i18n/generated-english/TopNav/TopNavHeading.generated.ts +14 -0
- package/src/i18n/generated-english/TreeList/TreeListItem.generated.ts +13 -0
- package/src/i18n/generated-english/Typeahead/BaseTypeahead.generated.ts +17 -0
- package/src/i18n/generated-english/Typeahead/Typeahead.generated.ts +14 -0
- package/src/i18n/generated-english/hooks/useInputStatusIcon.generated.ts +15 -0
- package/src/i18n/generated-english/hooks/useKeyboardHint.generated.ts +13 -0
- package/src/i18n/generated-locales/af-ZA.generated.ts +3 -2
- package/src/i18n/generated-locales/ar-SA.generated.ts +3 -2
- package/src/i18n/generated-locales/ca-ES.generated.ts +3 -2
- package/src/i18n/generated-locales/cs-CZ.generated.ts +3 -2
- package/src/i18n/generated-locales/da-DK.generated.ts +3 -2
- package/src/i18n/generated-locales/de-DE.generated.ts +3 -2
- package/src/i18n/generated-locales/el-GR.generated.ts +3 -2
- package/src/i18n/generated-locales/en.generated.ts +15 -2
- package/src/i18n/generated-locales/es-ES.generated.ts +3 -2
- package/src/i18n/generated-locales/fi-FI.generated.ts +3 -2
- package/src/i18n/generated-locales/fr-FR.generated.ts +3 -2
- package/src/i18n/generated-locales/he-IL.generated.ts +3 -2
- package/src/i18n/generated-locales/hu-HU.generated.ts +3 -2
- package/src/i18n/generated-locales/it-IT.generated.ts +3 -2
- package/src/i18n/generated-locales/ja-JP.generated.ts +3 -2
- package/src/i18n/generated-locales/ko-KR.generated.ts +3 -2
- package/src/i18n/generated-locales/nl-NL.generated.ts +3 -2
- package/src/i18n/generated-locales/no-NO.generated.ts +3 -2
- package/src/i18n/generated-locales/pl-PL.generated.ts +3 -2
- package/src/i18n/generated-locales/pseudo.generated.ts +15 -2
- package/src/i18n/generated-locales/pt-BR.generated.ts +3 -2
- package/src/i18n/generated-locales/pt-PT.generated.ts +3 -2
- package/src/i18n/generated-locales/ro-RO.generated.ts +3 -2
- package/src/i18n/generated-locales/ru-RU.generated.ts +3 -2
- package/src/i18n/generated-locales/sr-SP.generated.ts +3 -2
- package/src/i18n/generated-locales/sv-SE.generated.ts +3 -2
- package/src/i18n/generated-locales/tr-TR.generated.ts +3 -2
- package/src/i18n/generated-locales/uk-UA.generated.ts +3 -2
- package/src/i18n/generated-locales/vi-VN.generated.ts +3 -2
- package/src/i18n/generated-locales/zh-CN.generated.ts +3 -2
- package/src/i18n/generated-locales/zh-TW.generated.ts +3 -2
- package/src/i18n/index.ts +6 -1
- package/src/i18n/publicContext.ts +29 -0
- package/src/i18n/resolve.ts +17 -4
- package/src/i18n/useComponentTranslator.ts +45 -0
- package/src/i18n/useTranslator.ts +8 -1
- package/src/motion/MEASUREMENTS.md +1 -1
- package/src/motion/README.md +11 -0
- package/src/motion/animatedLayout.ts +1079 -48
- package/src/motion/animator.ts +225 -13
- package/src/motion/presentation.ts +149 -0
- package/src/motion/uikit/gestures.ts +15 -8
- package/src/motion/uikit/index.ts +1 -0
- package/src/motion/uikit/longPress.ts +29 -0
- package/src/motion/uikit/springs.ts +19 -0
- package/src/privateAttributes/hapticSwitch.stylex.ts +27 -0
- package/src/privateAttributes/layerRoot.stylex.ts +28 -0
- package/src/privateAttributes/segmentDisabled.stylex.ts +28 -0
- package/src/theme/Theme.tsx +8 -4
- package/src/theme/useTheme.ts +6 -1
- package/src/utils/accessibleName.ts +87 -0
- package/src/utils/clickGuard.ts +157 -0
- package/src/utils/coarsePointer.ts +51 -0
- package/src/utils/devWarning.ts +4 -9
- package/src/utils/flatTree.ts +40 -0
- package/src/utils/focusOutline.stylex.ts +9 -19
- package/src/utils/focusReturn.ts +74 -8
- package/src/utils/getNodeText.ts +2 -1
- package/src/utils/hitArea.ts +14 -17
- package/src/utils/ime.ts +23 -51
- package/src/utils/inputPresentation.ts +5 -5
- package/src/utils/inputStream.ts +155 -0
- package/src/utils/interactionModality.ts +173 -68
- package/src/utils/interactionOverlay.stylex.ts +72 -88
- package/src/utils/plainDate.ts +29 -1
- package/src/utils/presentation.ts +31 -47
- package/src/utils/pressDisabled.ts +32 -0
- package/src/utils/pressFeedback.ts +118 -107
- package/src/utils/pressGesture.ts +11 -21
- package/src/utils/rtlStyles.ts +13 -24
- package/src/utils/selectionLock.ts +188 -0
- package/src/utils/sharedMutationObserver.ts +2 -2
- package/src/utils/standaloneMonthCapitals.generated.ts +17 -0
- package/src/utils/timeFormat.ts +5 -13
- package/src/utils/touchPresentation.stylex.ts +8 -14
- package/src/utils/touchPresentation.ts +37 -62
- package/src/utils/touchQueries.ts +24 -1
- package/src/utils/typeaheadMatch.ts +142 -0
- package/src/utils/useFocusLeavingChange.ts +53 -0
- package/src/AlertDialog/AlertDialog.spec.md +0 -259
- package/src/AppShell/AppShell.spec.md +0 -331
- package/src/AspectRatio/AspectRatio.spec.md +0 -179
- package/src/Avatar/Avatar.spec.md +0 -253
- package/src/Avatar/AvatarStatusDot.spec.md +0 -208
- package/src/AvatarGroup/AvatarGroup.spec.md +0 -205
- package/src/AvatarGroup/AvatarGroupOverflow.spec.md +0 -210
- package/src/Badge/Badge.spec.md +0 -207
- package/src/Banner/Banner.spec.md +0 -282
- package/src/Blockquote/Blockquote.spec.md +0 -171
- package/src/BottomSheet/BottomSheet.spec.md +0 -457
- package/src/BottomSheet/BottomSheetSwitcher.spec.md +0 -367
- package/src/Breadcrumbs/BreadcrumbItem.spec.md +0 -269
- package/src/Breadcrumbs/Breadcrumbs.spec.md +0 -165
- package/src/Button/Button.spec.md +0 -322
- package/src/ButtonGroup/ButtonGroup.spec.md +0 -220
- package/src/Calendar/Calendar.spec.md +0 -248
- package/src/Card/Card.spec.md +0 -205
- package/src/Carousel/Carousel.spec.md +0 -146
- package/src/Center/Center.spec.md +0 -205
- package/src/Chat/ChatComposer.spec.md +0 -246
- package/src/Chat/ChatComposerDrawer.spec.md +0 -267
- package/src/Chat/ChatComposerInput.spec.md +0 -224
- package/src/Chat/ChatComposerTokenElement.spec.md +0 -164
- package/src/Chat/ChatDictationButton.spec.md +0 -205
- package/src/Chat/ChatLayout.spec.md +0 -276
- package/src/Chat/ChatLayoutScrollButton.spec.md +0 -322
- package/src/Chat/ChatMessage.spec.md +0 -264
- package/src/Chat/ChatMessageBubble.spec.md +0 -263
- package/src/Chat/ChatMessageList.spec.md +0 -222
- package/src/Chat/ChatMessageMetadata.spec.md +0 -220
- package/src/Chat/ChatSendButton.spec.md +0 -238
- package/src/Chat/ChatSystemMessage.spec.md +0 -224
- package/src/Chat/ChatTokenizedText.spec.md +0 -190
- package/src/Chat/ChatToolCalls.spec.md +0 -194
- package/src/CheckboxInput/CheckboxInput.spec.md +0 -218
- package/src/CheckboxList/CheckboxList.spec.md +0 -332
- package/src/CheckboxList/CheckboxListItem.spec.md +0 -302
- package/src/Citation/Citation.spec.md +0 -192
- package/src/ClickableCard/ClickableCard.spec.md +0 -241
- package/src/Code/Code.spec.md +0 -170
- package/src/CodeBlock/CodeBlock.spec.md +0 -243
- package/src/Collapsible/Collapsible.spec.md +0 -247
- package/src/Collapsible/CollapsibleGroup.spec.md +0 -229
- package/src/CommandPalette/CommandPalette.spec.md +0 -278
- package/src/CommandPalette/CommandPaletteEmpty.spec.md +0 -190
- package/src/CommandPalette/CommandPaletteInput.spec.md +0 -215
- package/src/CommandPalette/CommandPaletteItem.spec.md +0 -223
- package/src/CommandPalette/CommandPaletteList.spec.md +0 -194
- package/src/ComplexSelector/ComplexSelector.spec.md +0 -266
- package/src/ContextMenu/ContextMenu.spec.md +0 -279
- package/src/ContextMenu/ContextMenuItem.spec.md +0 -132
- package/src/DateInput/DateInput.spec.md +0 -336
- package/src/DateRangeInput/DateRangeInput.spec.md +0 -203
- package/src/DateTimeInput/DateTimeInput.spec.md +0 -270
- package/src/Dialog/Dialog.spec.md +0 -189
- package/src/Dialog/modules/DialogHeader.spec.md +0 -211
- package/src/Divider/Divider.spec.md +0 -252
- package/src/Drawer/Drawer.spec.md +0 -388
- package/src/Drawer/DrawerHeader.spec.md +0 -181
- package/src/DropdownMenu/DropdownMenu.spec.md +0 -562
- package/src/DropdownMenu/DropdownMenuCheckboxItem.spec.md +0 -192
- package/src/DropdownMenu/DropdownMenuDivider.spec.md +0 -186
- package/src/DropdownMenu/DropdownMenuGroup.spec.md +0 -145
- package/src/DropdownMenu/DropdownMenuItem.spec.md +0 -215
- package/src/DropdownMenu/DropdownMenuRadioGroup.spec.md +0 -187
- package/src/DropdownMenu/DropdownMenuRadioItem.spec.md +0 -227
- package/src/DropdownMenu/DropdownMenuSubMenu.spec.md +0 -231
- package/src/DropdownMenu/modules/useMenuHover.spec.md +0 -283
- package/src/DropdownMenu/modules/useMenuPress.spec.md +0 -348
- package/src/EmptyState/EmptyState.spec.md +0 -203
- package/src/Field/Field.spec.md +0 -226
- package/src/Field/FieldLabel.spec.md +0 -192
- package/src/FieldStatus/FieldStatus.spec.md +0 -224
- package/src/FileInput/FileInput.spec.md +0 -199
- package/src/FormLayout/FormLayout.spec.md +0 -201
- package/src/Grid/Grid.spec.md +0 -193
- package/src/Grid/GridSpan.spec.md +0 -158
- package/src/Heading/Heading.spec.md +0 -198
- package/src/HoverCard/HoverCard.spec.md +0 -244
- package/src/Icon/Icon.spec.md +0 -244
- package/src/IconButton/IconButton.spec.md +0 -197
- package/src/Indicator/CheckIndicator.spec.md +0 -164
- package/src/Indicator/CheckboxIndicator.spec.md +0 -164
- package/src/Indicator/Indicator.spec.md +0 -188
- package/src/InputGroup/InputGroup.spec.md +0 -199
- package/src/InputGroup/InputGroupText.spec.md +0 -139
- package/src/Item/Item.spec.md +0 -226
- package/src/Kbd/Kbd.spec.md +0 -185
- package/src/Layer/LayerProvider.spec.md +0 -149
- package/src/Layout/Layout.spec.md +0 -243
- package/src/Layout/LayoutContent.spec.md +0 -205
- package/src/Layout/LayoutFooter.spec.md +0 -190
- package/src/Layout/LayoutHeader.spec.md +0 -193
- package/src/Layout/LayoutPanel.spec.md +0 -194
- package/src/Lightbox/Lightbox.spec.md +0 -387
- package/src/Link/Link.spec.md +0 -230
- package/src/Link/LinkProvider.spec.md +0 -167
- package/src/List/List.spec.md +0 -336
- package/src/List/ListItem.spec.md +0 -205
- package/src/Markdown/Markdown.spec.md +0 -595
- package/src/Markdown/modules/headingLinks.spec.md +0 -262
- package/src/Markdown/modules/remark.spec.md +0 -269
- package/src/Markdown/modules/softBreaks.spec.md +0 -137
- package/src/Markdown/modules/sourceLines.spec.md +0 -162
- package/src/MetadataList/MetadataList.spec.md +0 -187
- package/src/MetadataList/MetadataListItem.spec.md +0 -165
- package/src/MobileNav/MobileNav.spec.md +0 -306
- package/src/MoreMenu/MoreMenu.spec.md +0 -268
- package/src/MultiSelector/MultiSelector.spec.md +0 -364
- package/src/NavIcon/NavIcon.spec.md +0 -158
- package/src/NavMenu/NavHeadingMenu.spec.md +0 -264
- package/src/NumberInput/NumberInput.spec.md +0 -270
- package/src/Outline/Outline.spec.md +0 -258
- package/src/Outline/modules/parseOutlineFromMarkdown.spec.md +0 -150
- package/src/OverflowList/OverflowList.spec.md +0 -204
- package/src/Overlay/Overlay.spec.md +0 -304
- package/src/Pagination/Pagination.spec.md +0 -300
- package/src/Popover/Popover.spec.md +0 -525
- package/src/PowerSearch/PowerSearch.spec.md +0 -661
- package/src/ProgressBar/ProgressBar.spec.md +0 -285
- package/src/RadioList/RadioList.spec.md +0 -227
- package/src/RadioList/RadioListItem.spec.md +0 -223
- package/src/Resizable/Resizable.spec.md +0 -298
- package/src/ScrollableArea/ScrollableArea.spec.md +0 -190
- package/src/ScrollableArea/modules/useScrollableArea.spec.md +0 -149
- package/src/Section/Section.spec.md +0 -197
- package/src/SegmentedControl/SegmentedControl.spec.md +0 -261
- package/src/SegmentedControl/SegmentedControlItem.spec.md +0 -206
- package/src/SelectableCard/SelectableCard.spec.md +0 -230
- package/src/Selector/Selector.spec.md +0 -379
- package/src/SideNav/SideNav.spec.md +0 -247
- package/src/SideNav/SideNavCollapseButton.spec.md +0 -161
- package/src/SideNav/SideNavHeading.spec.md +0 -226
- package/src/SideNav/SideNavItem.spec.md +0 -236
- package/src/SideNav/SideNavSection.spec.md +0 -153
- package/src/Skeleton/Skeleton.spec.md +0 -184
- package/src/Slider/Slider.spec.md +0 -287
- package/src/Spinner/Spinner.spec.md +0 -231
- package/src/Stack/Stack.spec.md +0 -203
- package/src/StatusDot/StatusDot.spec.md +0 -224
- package/src/Stepper/Step.spec.md +0 -200
- package/src/Stepper/Stepper.spec.md +0 -327
- package/src/Switch/Switch.spec.md +0 -277
- package/src/TabList/Tab.spec.md +0 -201
- package/src/TabList/TabList.spec.md +0 -217
- package/src/TabList/TabMenu.spec.md +0 -198
- package/src/Table/Table.spec.md +0 -395
- package/src/Table/plugins/activation/useTableActivation.spec.md +0 -254
- package/src/Table/plugins/columnResize/useTableColumnResize.spec.md +0 -373
- package/src/Table/plugins/infiniteScroll/useTableInfiniteScroll.spec.md +0 -244
- package/src/Table/plugins/rowStatus/useTableRowStatus.spec.md +0 -355
- package/src/Table/plugins/virtualization/useTableVirtualization.spec.md +0 -266
- package/src/Text/Text.spec.md +0 -193
- package/src/TextArea/TextArea.spec.md +0 -300
- package/src/TextInput/TextInput.spec.md +0 -260
- package/src/Thumbnail/Thumbnail.spec.md +0 -244
- package/src/TimeInput/TimeInput.spec.md +0 -270
- package/src/Timer/Timer.spec.md +0 -215
- package/src/Timestamp/Timestamp.spec.md +0 -246
- package/src/Toast/Toast.spec.md +0 -291
- package/src/ToggleButton/ToggleButton.spec.md +0 -256
- package/src/ToggleButton/ToggleButtonGroup.spec.md +0 -195
- package/src/Token/Token.spec.md +0 -262
- package/src/Tokenizer/Tokenizer.spec.md +0 -615
- package/src/Toolbar/Toolbar.spec.md +0 -227
- package/src/Tooltip/Tooltip.spec.md +0 -267
- package/src/TopNav/TopNav.spec.md +0 -190
- package/src/TopNav/TopNavHeading.spec.md +0 -211
- package/src/TopNav/TopNavItem.spec.md +0 -189
- package/src/TopNav/TopNavMegaMenu.spec.md +0 -190
- package/src/TopNav/TopNavMegaMenuFeaturedCard.spec.md +0 -150
- package/src/TopNav/TopNavMegaMenuItem.spec.md +0 -155
- package/src/TopNav/TopNavMenu.spec.md +0 -202
- package/src/TreeList/TreeList.spec.md +0 -328
- package/src/Typeahead/BaseTypeahead.spec.md +0 -270
- package/src/Typeahead/Typeahead.spec.md +0 -257
- package/src/VisuallyHidden/VisuallyHidden.spec.md +0 -170
- package/src/i18n/InternationalizationProvider.spec.md +0 -252
|
@@ -3,10 +3,9 @@
|
|
|
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
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* getGestureHost (one host per document) and the delegated consumer type
|
|
6
|
+
* one document; elements with recognizers and consumers attached
|
|
7
|
+
* @output Exports GestureHost (the DOM side of the gesture system) and
|
|
8
|
+
* getGestureHost (one host per document)
|
|
10
9
|
* @position Browser adapter of packages/core/src/gestures: turns real events
|
|
11
10
|
* into GestureArena input, and carries out what the arena decides
|
|
12
11
|
*
|
|
@@ -14,36 +13,36 @@
|
|
|
14
13
|
*
|
|
15
14
|
* - Recognizers and press consumers attach for a mouse, a pen and a finger
|
|
16
15
|
* alike (`spec:AST-094` FR43, FR19). Where the primary pointer is coarse
|
|
17
|
-
* the host listens
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* counts apart
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* touch in flight.
|
|
32
|
-
* -
|
|
33
|
-
* primary pointer is fine, the document keeps one passive `pointerdown`
|
|
34
|
-
* listener for every type, counted once per page (FR24).
|
|
16
|
+
* the host listens while something enabled could take a touch. Where it
|
|
17
|
+
* is fine, each element with an enabled recognizer or consumer keeps one
|
|
18
|
+
* passive `pointerdown` listener and the page has none; a press on it (a
|
|
19
|
+
* mouse's primary button, a pen, or a finger, whose `pointerdown` comes
|
|
20
|
+
* before its `touchstart`) installs the host's page listeners, which go
|
|
21
|
+
* once that press's contacts end and the arena has decided them, a tap
|
|
22
|
+
* that waits on a double tap included (FR24). After the last detach the
|
|
23
|
+
* host holds nothing: no listener, note, frame or timer (releaseWhenIdle).
|
|
24
|
+
* Under every pointer, an element whose recognizer claims a moving finger
|
|
25
|
+
* also keeps its blocking `touchmove`, a listener FR24 counts apart from
|
|
26
|
+
* the press's one.
|
|
27
|
+
* - A press consumer takes a mouse press as a press (DEC-21): PressTracker's
|
|
28
|
+
* fine-pointer profile paints at once and brakes no scroll (FR11).
|
|
29
|
+
* - The host follows the query (a tablet docking or undocking a mouse):
|
|
30
|
+
* turning fine cancels every touch in flight.
|
|
31
|
+
* - `perEventPointer` (AttachOptions), from before FR43, changes nothing.
|
|
35
32
|
*
|
|
36
33
|
* INPUT CHANNELS
|
|
37
34
|
*
|
|
38
35
|
* - Fingers begin and end with Touch Events: they are the only cancelable
|
|
39
36
|
* channel (a pointer event's preventDefault cannot stop a scroll or a
|
|
40
|
-
* click), they keep arriving after the browser takes a pan (which a
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* 10
|
|
37
|
+
* click), they keep arriving after the browser takes a pan (which a
|
|
38
|
+
* watcher following the scroll to the lift needs, `spec:AST-094` FR20,
|
|
39
|
+
* DEC-7), and every event lists all the fingers at once. A
|
|
40
|
+
* finger's movement is sampled from ONE channel: its `pointermove`s, once
|
|
41
|
+
* its pointerdown has paired with its touchstart (by target and
|
|
42
|
+
* position), since Chromium sends no `touchmove` until a finger has
|
|
43
|
+
* travelled about 16 px while a tap fails and a pan begins at 10; touch
|
|
44
|
+
* events sample only a finger no pointer event reported. The other
|
|
45
|
+
* channel keeps its control duties but feeds no sample.
|
|
47
46
|
* - A finger's events go to the element it landed on even after that
|
|
48
47
|
* element leaves the document, and then never reach the document. Each
|
|
49
48
|
* tracked finger's target therefore gets its own listeners, and a finger
|
|
@@ -51,17 +50,43 @@
|
|
|
51
50
|
* removed target never strands a gesture.
|
|
52
51
|
* - Mice and pens come from Pointer Events, with coalesced samples for
|
|
53
52
|
* velocity. A pen on an iPad also produces `stylus` touches; those are left
|
|
54
|
-
* to the pointer path
|
|
53
|
+
* to the pointer path, except that a claimed pen's stylus moves are
|
|
54
|
+
* cancelled as a finger's.
|
|
55
55
|
* - `pointercancel` on a finger is the browser saying it took that finger
|
|
56
56
|
* for its own pan or zoom; so is a `touchmove` that can no longer be
|
|
57
57
|
* cancelled where `touch-action` let the browser pan, and a scroll above
|
|
58
58
|
* the touch.
|
|
59
59
|
*
|
|
60
|
+
* FINGERS
|
|
61
|
+
*
|
|
62
|
+
* - The host keeps one record of where each finger on the screen landed
|
|
63
|
+
* (`fingersDown()`). Finger scrolls (fingerScroll.ts) read it, and a
|
|
64
|
+
* scroll lock's page hold (pageHold.ts) asks which touches a recognizer
|
|
65
|
+
* owns; both live in their own modules, so a page that needs neither
|
|
66
|
+
* never ships them.
|
|
67
|
+
*
|
|
68
|
+
* TOUCHES ON MOVING ELEMENTS
|
|
69
|
+
*
|
|
70
|
+
* - iOS WebKit hit-tests an element a compositor animation moves where the
|
|
71
|
+
* animation started. There, at touch-down, the host resolves the moving
|
|
72
|
+
* elements (motion/presentation.ts: one style write each) and asks the
|
|
73
|
+
* engine again, so a contact goes to what is drawn under it; press
|
|
74
|
+
* trackers read `presentedRect`, and a retargeted tap clicks what it
|
|
75
|
+
* touched once, with the engine's own click cancelled or swallowed.
|
|
76
|
+
*
|
|
60
77
|
* WHAT THE BROWSER IS TOLD
|
|
61
78
|
*
|
|
62
79
|
* - Each element gets the `touch-action` its recognizers leave the browser
|
|
63
|
-
* (touchAction.ts),
|
|
64
|
-
*
|
|
80
|
+
* (touchAction.ts), never wider than the element's own value (a caller's
|
|
81
|
+
* explicit `touch-action` stays in force), set inline when they attach and
|
|
82
|
+
* restored when they detach.
|
|
83
|
+
* - While a finger or a pen is down, text selection and the touch callout
|
|
84
|
+
* are off only where the hold does something (`spec:AST-094` FR41): on the
|
|
85
|
+
* elements of recognizers that bring a `selectionLock`, and on a non-text
|
|
86
|
+
* input under the finger inside them (WebKit's own style makes every
|
|
87
|
+
* input selectable); restored when the contact ends. A finger or a pen
|
|
88
|
+
* takes it under any primary pointer; a mouse never does (`spec:AST-017`
|
|
89
|
+
* FR59).
|
|
65
90
|
* - Each element with a recognizer that can claim a touch while it moves (a
|
|
66
91
|
* pan, a swipe, a long press that then drags, a pinch) gets a
|
|
67
92
|
* NON-passive `touchmove` listener that cancels the event only while a
|
|
@@ -71,27 +96,39 @@
|
|
|
71
96
|
* known cost: a scroll that BEGINS on such an element waits for a busy main
|
|
72
97
|
* thread (measured in iOS Safari; a passive listener would hand every
|
|
73
98
|
* diagonal to the scroll instead). Elements whose recognizers only claim
|
|
74
|
-
* at the lift (taps)
|
|
75
|
-
*
|
|
99
|
+
* at the lift (taps), recognizers that never claim (`claimsTouches` false)
|
|
100
|
+
* and press consumers get no blocking listener, and the listener a
|
|
101
|
+
* finger's target gets at touch-down is passive for them too, so a scroll
|
|
102
|
+
* starting on them never waits.
|
|
103
|
+
* - The browser took a finger on `pointercancel`, on its first uncancelable
|
|
104
|
+
* `touchmove` where it could pan, or on a scroll above it once the finger
|
|
105
|
+
* has travelled the slop; a scroll under a finger that has not moved is
|
|
106
|
+
* the page's own and leaves the touch alone.
|
|
76
107
|
* - A lift whose click must not happen cancels its `touchend` (no click, no
|
|
77
|
-
* compatibility mouse events) and arms
|
|
78
|
-
*
|
|
108
|
+
* compatibility mouse events) and arms the shared click guard
|
|
109
|
+
* (utils/clickGuard.ts, the menu press model's too) for the browser's next
|
|
110
|
+
* click; a click held for a recognizer that may still recognize is
|
|
79
111
|
* replayed if they all fail. Keyboard and assistive-technology clicks
|
|
80
112
|
* (`detail === 0`) always pass.
|
|
81
113
|
* - A `contextmenu` while a recognizer owns a touch is cancelled, so a long
|
|
82
114
|
* press never also opens the browser's menu.
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* and an instance is created for that one touch: a list of a thousand rows
|
|
87
|
-
* costs nothing until a finger lands on one.
|
|
115
|
+
* - When the app loses focus (a window blur, a hidden page), every touch in
|
|
116
|
+
* flight is cancelled, as in UIKit; a finger the browser keeps alive lifts
|
|
117
|
+
* on nothing: its `touchend` is cancelled (`spec:AST-094` FR28).
|
|
88
118
|
*
|
|
89
119
|
* SSR-safe: nothing touches `window` or `document` until something attaches.
|
|
90
120
|
*
|
|
91
121
|
* SYNC: When modified, update GestureHost.test.ts and README.md.
|
|
92
122
|
*/
|
|
93
123
|
|
|
94
|
-
import {
|
|
124
|
+
import {isRtlElement} from '../hooks/isRtlElement';
|
|
125
|
+
import {
|
|
126
|
+
presentedElements,
|
|
127
|
+
presentedOffsetOf,
|
|
128
|
+
resolvePresented,
|
|
129
|
+
watchPresentedElements,
|
|
130
|
+
} from '../motion/presentation';
|
|
131
|
+
import {UIKIT_PRESS, UIKIT_TAP} from '../motion/uikit/gestures';
|
|
95
132
|
import {
|
|
96
133
|
browserClock,
|
|
97
134
|
GestureArena,
|
|
@@ -100,14 +137,15 @@ import {
|
|
|
100
137
|
type GestureArenaOptions,
|
|
101
138
|
type GestureClock,
|
|
102
139
|
} from './GestureArena';
|
|
103
|
-
import type {GestureRecognizer} from './GestureRecognizer';
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
140
|
+
import type {GestureRecognizer, SelectionLock} from './GestureRecognizer';
|
|
141
|
+
import type {PressBounds} from './PressTracker';
|
|
142
|
+
import type {PanGestureRecognizer} from './PanGestureRecognizer';
|
|
106
143
|
import {createNativeScrollProbe, parentAcrossShadow} from './nativeScroll';
|
|
144
|
+
import {containsAlongFlatTree} from '../utils/flatTree';
|
|
145
|
+
import {isIosWebKit} from '../utils/touchQueries';
|
|
107
146
|
import {
|
|
108
147
|
gestureHostStyle,
|
|
109
148
|
type GestureHostStyle,
|
|
110
|
-
holdSelectionStyle,
|
|
111
149
|
intersectTouchAction,
|
|
112
150
|
} from './touchAction';
|
|
113
151
|
import {
|
|
@@ -125,16 +163,29 @@ import type {
|
|
|
125
163
|
TouchInput,
|
|
126
164
|
TouchSample,
|
|
127
165
|
} from './types';
|
|
166
|
+
import {internals} from './recognizerInternals';
|
|
167
|
+
import {
|
|
168
|
+
armClickGuard,
|
|
169
|
+
disarmClickGuard,
|
|
170
|
+
withoutClickGuard,
|
|
171
|
+
} from '../utils/clickGuard';
|
|
172
|
+
import {subscribeInput} from '../utils/inputStream';
|
|
173
|
+
import {isPrimaryClick} from '../utils/primaryClick';
|
|
174
|
+
import {locksSelectionFor} from '../utils/selectionLock';
|
|
175
|
+
import {isCoarsePointer, watchCoarsePointer} from '../utils/coarsePointer';
|
|
176
|
+
import {gestureHosts} from './hostRegistry';
|
|
128
177
|
|
|
129
178
|
interface Registration {
|
|
130
179
|
readonly recognizers: GestureRecognizer[];
|
|
131
180
|
consumer: TouchConsumer | null;
|
|
132
|
-
touchMoveListener: EventListener | null;
|
|
133
181
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
182
|
+
* Where fingers come from their pointer events, whether the element
|
|
183
|
+
* carries the host's blocking `touchend` handler, which cancels a claimed
|
|
184
|
+
* finger's lift (`spec:AST-094` FR21).
|
|
136
185
|
*/
|
|
137
|
-
|
|
186
|
+
hasTouchEndListener: boolean;
|
|
187
|
+
/** Whether the element carries the host's shared blocking touchmove handler. */
|
|
188
|
+
hasTouchMoveListener: boolean;
|
|
138
189
|
/** Inline values the host replaced, to restore on detach. */
|
|
139
190
|
readonly savedStyle: Map<string, string>;
|
|
140
191
|
/**
|
|
@@ -147,6 +198,8 @@ interface Registration {
|
|
|
147
198
|
manageStyle: boolean;
|
|
148
199
|
/** An action group (`family:action-groups` FR5). */
|
|
149
200
|
actionGroup: boolean;
|
|
201
|
+
/** The attachments that asked for the action group; it lasts while one does. */
|
|
202
|
+
actionGroupAsks: number;
|
|
150
203
|
}
|
|
151
204
|
|
|
152
205
|
export interface GestureHostOptions {
|
|
@@ -159,6 +212,13 @@ export interface GestureHostOptions {
|
|
|
159
212
|
inputMode?: 'auto' | 'pointer-events';
|
|
160
213
|
/** Every recognizer transition, for debugging and tests. */
|
|
161
214
|
onTransition?: GestureArenaOptions['onTransition'];
|
|
215
|
+
/**
|
|
216
|
+
* Send a contact to what is drawn while a compositor animation moves an
|
|
217
|
+
* element (motion/presentation.ts): `auto` where the engine hit-tests such
|
|
218
|
+
* an element where its animation started (iOS WebKit); `always` or
|
|
219
|
+
* `never` for tests. @default 'auto'
|
|
220
|
+
*/
|
|
221
|
+
presentedHitTesting?: 'auto' | 'always' | 'never';
|
|
162
222
|
/**
|
|
163
223
|
* Whether the primary pointer is coarse (a phone, a tablet). Gestures
|
|
164
224
|
* attach for every pointer (`spec:AST-094` FR43); where it is fine, an
|
|
@@ -178,6 +238,12 @@ export interface AttachOptions {
|
|
|
178
238
|
* @default true
|
|
179
239
|
*/
|
|
180
240
|
manageStyle?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Accepted and ignored: every attachment reads each event's pointer
|
|
243
|
+
* (`spec:AST-094` FR43). Kept so callers written before FR43 compile.
|
|
244
|
+
* @deprecated
|
|
245
|
+
*/
|
|
246
|
+
perEventPointer?: boolean;
|
|
181
247
|
/**
|
|
182
248
|
* The element is an action group, sibling actions a held pointer slides
|
|
183
249
|
* across (`family:action-groups` FR5). It is served like every
|
|
@@ -186,21 +252,6 @@ export interface AttachOptions {
|
|
|
186
252
|
actionGroup?: boolean;
|
|
187
253
|
}
|
|
188
254
|
|
|
189
|
-
/**
|
|
190
|
-
* A kind of view-level consumer found by attribute instead of attached to
|
|
191
|
-
* each element.
|
|
192
|
-
*/
|
|
193
|
-
export interface DelegatedConsumerType {
|
|
194
|
-
/** Marks an element as this kind of consumer. */
|
|
195
|
-
readonly attribute: string;
|
|
196
|
-
/**
|
|
197
|
-
* The consumer for one contact on `element`, or null for none (a disabled
|
|
198
|
-
* control). The innermost marked element decides, even with null: a press
|
|
199
|
-
* on a disabled button does not light the row around it.
|
|
200
|
-
*/
|
|
201
|
-
create(element: Element, pointerType: PointerKind): TouchConsumer | null;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
255
|
const STYLE_PROPERTIES: Record<keyof GestureHostStyle, string> = {
|
|
205
256
|
touchAction: 'touch-action',
|
|
206
257
|
WebkitTouchCallout: '-webkit-touch-callout',
|
|
@@ -208,15 +259,6 @@ const STYLE_PROPERTIES: Record<keyof GestureHostStyle, string> = {
|
|
|
208
259
|
userSelect: 'user-select',
|
|
209
260
|
};
|
|
210
261
|
|
|
211
|
-
/**
|
|
212
|
-
* Whether a recognizer can take a touch while it moves, and so needs the
|
|
213
|
-
* blocking `touchmove` listener that stops the browser's pan. A tap claims
|
|
214
|
-
* only at the lift (it fails once the finger travels), so it needs none.
|
|
215
|
-
*/
|
|
216
|
-
function claimsWhileMoving(recognizer: GestureRecognizer): boolean {
|
|
217
|
-
return recognizer.acceptsTouchInput && recognizer.kind !== 'tap';
|
|
218
|
-
}
|
|
219
|
-
|
|
220
262
|
/**
|
|
221
263
|
* A CSS-wide keyword, which names no touch-action of its own: the value in
|
|
222
264
|
* force resolves it (`initial` and `unset` to `auto`, `inherit` to the
|
|
@@ -238,16 +280,41 @@ const CSS_WIDE_KEYWORDS: ReadonlySet<string> = new Set([
|
|
|
238
280
|
* Run `task` in the next frame, before it paints: a read there styles what
|
|
239
281
|
* the frame must style anyway, and its writes are what the frame shows.
|
|
240
282
|
*/
|
|
241
|
-
function inNextFrame(view: Window | null, task: () => void): void {
|
|
283
|
+
function inNextFrame(view: Window | null, task: () => void): () => void {
|
|
242
284
|
if (view != null && typeof view.requestAnimationFrame === 'function') {
|
|
243
|
-
view.requestAnimationFrame(task);
|
|
244
|
-
|
|
245
|
-
setTimeout(task, 0);
|
|
285
|
+
const frame = view.requestAnimationFrame(task);
|
|
286
|
+
return () => view.cancelAnimationFrame(frame);
|
|
246
287
|
}
|
|
288
|
+
const timeout = setTimeout(task, 0);
|
|
289
|
+
return () => clearTimeout(timeout);
|
|
247
290
|
}
|
|
248
291
|
|
|
292
|
+
/** An armed press tracker's own element listeners: they never cancel. */
|
|
249
293
|
const PASSIVE_CAPTURE = {capture: true, passive: true} as const;
|
|
250
294
|
|
|
295
|
+
/**
|
|
296
|
+
* Whether a recognizer can take a touch while it moves, and so needs the
|
|
297
|
+
* blocking `touchmove` listener that stops the browser's pan. A tap claims
|
|
298
|
+
* only at the lift (it fails once the finger travels), so it needs none.
|
|
299
|
+
*/
|
|
300
|
+
function claimsWhileMoving(recognizer: GestureRecognizer): boolean {
|
|
301
|
+
return (
|
|
302
|
+
recognizer.claimsTouches &&
|
|
303
|
+
internals(recognizer).acceptsTouchInput &&
|
|
304
|
+
internals(recognizer).family !== 'tap'
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* A pan (or a pan subclass), told apart by its family rather than its class,
|
|
310
|
+
* so a page that constructs no pan never ships PanGestureRecognizer.
|
|
311
|
+
*/
|
|
312
|
+
function isPanRecognizer(
|
|
313
|
+
recognizer: GestureRecognizer,
|
|
314
|
+
): recognizer is PanGestureRecognizer {
|
|
315
|
+
return internals(recognizer).family === 'pan';
|
|
316
|
+
}
|
|
317
|
+
|
|
251
318
|
/**
|
|
252
319
|
* A screen-edge pan, told apart by its kind (architecture:react-component-runtime
|
|
253
320
|
* INV13), so the host can report its layout changes without importing it.
|
|
@@ -260,31 +327,30 @@ function asScreenEdgePan(
|
|
|
260
327
|
: null;
|
|
261
328
|
}
|
|
262
329
|
|
|
263
|
-
/** The inline properties a held press sets to none (holdSelectionStyle). */
|
|
264
|
-
const HOLD_SELECTION_PROPERTIES = [
|
|
265
|
-
'-webkit-touch-callout',
|
|
266
|
-
'-webkit-user-select',
|
|
267
|
-
'user-select',
|
|
268
|
-
] as const;
|
|
269
|
-
|
|
270
|
-
/** Elements a held press turned selection off on, and what to restore. */
|
|
271
|
-
const heldSelection = new WeakMap<
|
|
272
|
-
HTMLElement,
|
|
273
|
-
{
|
|
274
|
-
count: number;
|
|
275
|
-
saved: ReadonlyArray<{name: string; value: string; priority: string}>;
|
|
276
|
-
}
|
|
277
|
-
>();
|
|
278
|
-
const ACTIVE_CAPTURE = {capture: true, passive: false} as const;
|
|
279
|
-
|
|
280
330
|
type StylusTouch = Touch & {touchType?: string};
|
|
281
331
|
|
|
332
|
+
function hasStylusTouch(event: TouchEvent): boolean {
|
|
333
|
+
return touchesOf(event.changedTouches).some(
|
|
334
|
+
touch => (touch as StylusTouch).touchType === 'stylus',
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
282
338
|
interface PlacedContact {
|
|
283
339
|
readonly x: number;
|
|
284
340
|
readonly y: number;
|
|
285
341
|
readonly target: unknown;
|
|
286
342
|
}
|
|
287
343
|
|
|
344
|
+
/**
|
|
345
|
+
* How long a claimed finger's lift waits for its `touchend`, ms. The touchend
|
|
346
|
+
* follows its pointerup in the same frame; a browser that sends pointer events
|
|
347
|
+
* alone for a finger never sends it, and the record goes.
|
|
348
|
+
*/
|
|
349
|
+
const CLAIMED_LIFT_MS = 500;
|
|
350
|
+
|
|
351
|
+
/** At most this many claimed lifts wait for their `touchend` at once (FR24). */
|
|
352
|
+
const CLAIMED_LIFT_LIMIT = 8;
|
|
353
|
+
|
|
288
354
|
/** A touchstart and a pointerdown describe one finger: same target, same spot. */
|
|
289
355
|
function isSamePlace(a: PlacedContact, b: PlacedContact): boolean {
|
|
290
356
|
return (
|
|
@@ -298,6 +364,23 @@ function isPointerKind(type: string): type is PointerKind {
|
|
|
298
364
|
return type === 'touch' || type === 'mouse' || type === 'pen';
|
|
299
365
|
}
|
|
300
366
|
|
|
367
|
+
/**
|
|
368
|
+
* What an event, or one of its touches, landed on. Inside an open shadow root
|
|
369
|
+
* the document's listeners see the shadow host, in `event.target` and in a
|
|
370
|
+
* touch's `target` alike, while the composed path starts at the element
|
|
371
|
+
* itself. A touch whose target is not the event's (another finger) keeps its
|
|
372
|
+
* own.
|
|
373
|
+
*/
|
|
374
|
+
function landedOn(
|
|
375
|
+
event: Event,
|
|
376
|
+
retargeted: EventTarget | null = event.target,
|
|
377
|
+
): EventTarget | null {
|
|
378
|
+
if (retargeted !== event.target) {
|
|
379
|
+
return retargeted;
|
|
380
|
+
}
|
|
381
|
+
return event.composedPath()[0] ?? retargeted;
|
|
382
|
+
}
|
|
383
|
+
|
|
301
384
|
/**
|
|
302
385
|
* An event's time on the arena's clock (`performance.now()`). Some engines
|
|
303
386
|
* and DOM emulators stamp events in epoch milliseconds instead.
|
|
@@ -323,9 +406,34 @@ export class GestureHost {
|
|
|
323
406
|
readonly arena: GestureArena;
|
|
324
407
|
private readonly doc: Document;
|
|
325
408
|
private readonly registry = new Map<Element, Registration>();
|
|
326
|
-
|
|
409
|
+
/** Stops following the animator's moving elements (iOS WebKit only). */
|
|
410
|
+
private stopWatchingMovers: (() => void) | null = null;
|
|
411
|
+
/** Whether the document carries the blocking touchmove for a mover. */
|
|
412
|
+
private stopBlockingForMovers: (() => void) | null = null;
|
|
413
|
+
/** Elements whose caller touch-action waits for a read after paint. */
|
|
414
|
+
private readonly pendingCallerReads = new Set<HTMLElement>();
|
|
415
|
+
private isCallerReadScheduled = false;
|
|
416
|
+
/** Cancels the scheduled next-frame read (readCallerTouchActionInNextFrame). */
|
|
417
|
+
private cancelCallerRead: (() => void) | null = null;
|
|
418
|
+
/** The selection lock each contact holds, by host contact id. */
|
|
419
|
+
private readonly lockedBy = new Map<number, () => void>();
|
|
420
|
+
private readonly presentedHitTesting: 'auto' | 'always' | 'never';
|
|
421
|
+
/**
|
|
422
|
+
* Contacts sent to what is drawn instead of what the engine hit, by host
|
|
423
|
+
* contact id, with where they landed (for their click).
|
|
424
|
+
*/
|
|
425
|
+
private readonly retargeted = new Map<
|
|
426
|
+
number,
|
|
427
|
+
{x: number; y: number; target: EventTarget}
|
|
428
|
+
>();
|
|
327
429
|
/** Touch.identifier → arena id, for live fingers. */
|
|
328
430
|
private readonly touchIds = new Map<number, number>();
|
|
431
|
+
/**
|
|
432
|
+
* Fingers cancelled because the app lost focus, kept until the browser
|
|
433
|
+
* ends them: a browser that keeps such a touch alive must not let its
|
|
434
|
+
* lift click (`spec:AST-094` FR28: nothing acts).
|
|
435
|
+
*/
|
|
436
|
+
private readonly cancelledFingers = new Set<number>();
|
|
329
437
|
/** Touch.identifier → the element the finger landed on. */
|
|
330
438
|
private readonly touchTargets = new Map<number, EventTarget>();
|
|
331
439
|
/**
|
|
@@ -335,17 +443,21 @@ export class GestureHost {
|
|
|
335
443
|
*/
|
|
336
444
|
private readonly watched = new Map<
|
|
337
445
|
EventTarget,
|
|
338
|
-
{count: number; blocking: number}
|
|
446
|
+
{count: number; blocking: number; claiming: number}
|
|
339
447
|
>();
|
|
340
448
|
/** Fingers whose target listener is the blocking one. */
|
|
341
449
|
private readonly blockingFingers = new Set<number>();
|
|
450
|
+
/**
|
|
451
|
+
* Fingers a participant could claim (a recognizer that claims touches, or
|
|
452
|
+
* a press consumer): only their target's `touchend` may need cancelling,
|
|
453
|
+
* so a touch only watchers follow gets a passive one (`spec:AST-094`
|
|
454
|
+
* FR20).
|
|
455
|
+
*/
|
|
456
|
+
private readonly claimingFingers = new Set<number>();
|
|
342
457
|
/** Touch events already handled (the document's and the target's listeners both see one). */
|
|
343
458
|
private readonly processed = new WeakSet<Event>();
|
|
344
459
|
/** pointerId → arena id, for live mouse and pen contacts. */
|
|
345
460
|
private readonly pointerIds = new Map<number, number>();
|
|
346
|
-
/** Elements whose caller touch-action waits for a read after paint. */
|
|
347
|
-
private readonly pendingCallerReads = new Set<HTMLElement>();
|
|
348
|
-
private isCallerReadScheduled = false;
|
|
349
461
|
/**
|
|
350
462
|
* The boxes the host watches for screen-edge pans (syncLayoutWatch): each
|
|
351
463
|
* element with an enabled one, and the root for one whose band moves with
|
|
@@ -359,63 +471,103 @@ export class GestureHost {
|
|
|
359
471
|
/**
|
|
360
472
|
* A finger's pointerId → its arena id, once its pointerdown and its
|
|
361
473
|
* touchstart are paired. Chromium sends no `touchmove` until a finger has
|
|
362
|
-
* travelled its slop (about 16 px), but sends every `pointermove`, so
|
|
363
|
-
* finger
|
|
364
|
-
* the browser's claim of exactly that finger.
|
|
474
|
+
* travelled its slop (about 16 px), but sends every `pointermove`, so a
|
|
475
|
+
* paired finger is sampled from its pointer events (`pointerFed`); and its
|
|
476
|
+
* `pointercancel` is the browser's claim of exactly that finger.
|
|
365
477
|
*/
|
|
366
478
|
private readonly fingerPointers = new Map<number, number>();
|
|
367
479
|
/** Finger pointerdowns still waiting for their touchstart. */
|
|
368
480
|
private readonly pendingPointers = new Map<number, PlacedContact>();
|
|
369
481
|
/**
|
|
370
|
-
*
|
|
371
|
-
* `touchend` that follows
|
|
482
|
+
* Where fingers come from their pointer events, where claimed fingers
|
|
483
|
+
* lifted and when: the `touchend` that follows each `pointerup` is
|
|
484
|
+
* cancelled (FR21). A record no `touchend` consumed expires
|
|
485
|
+
* (CLAIMED_LIFT_MS).
|
|
372
486
|
*/
|
|
373
|
-
private readonly claimedLifts: PlacedContact[] = [];
|
|
487
|
+
private readonly claimedLifts: (PlacedContact & {time: number})[] = [];
|
|
488
|
+
/** The one timer that drops claimed lifts whose `touchend` never came. */
|
|
489
|
+
private claimedLiftTimer: unknown = null;
|
|
490
|
+
/** The arena's clock, which the claimed lifts' timer runs on too. */
|
|
491
|
+
private readonly clock: GestureClock;
|
|
374
492
|
/** Fingers still waiting for their pointerdown, by arena id. */
|
|
375
493
|
private readonly unpairedTouches = new Map<number, PlacedContact>();
|
|
376
|
-
/** The elements each held contact turned selection off on. */
|
|
377
|
-
private readonly heldSelectionBy = new Map<number, HTMLElement[]>();
|
|
378
494
|
private readonly isPrimaryPointerCoarse: () => boolean;
|
|
379
|
-
|
|
380
|
-
private
|
|
381
|
-
|
|
382
|
-
/** The last position fed per contact, so one channel's echo is dropped. */
|
|
495
|
+
/** Whether the host follows `(pointer: coarse)` (no read was passed). */
|
|
496
|
+
private readonly followsPointer: boolean;
|
|
497
|
+
/** The last sample fed per contact: a contact's time never runs back. */
|
|
383
498
|
private readonly lastFed = new Map<number, TouchSample>();
|
|
499
|
+
/**
|
|
500
|
+
* Fingers whose samples come from their pointer events. A finger the
|
|
501
|
+
* browser reports on both channels is sampled from ONE: the pointer
|
|
502
|
+
* channel, where its pointerdown paired with its touchstart; touch events
|
|
503
|
+
* sample only a finger no pointer event reported (no Pointer Events). The
|
|
504
|
+
* other channel keeps its control duties (cancelling, claiming, the
|
|
505
|
+
* browser's takeover) but never feeds a sample, so the two copies of one
|
|
506
|
+
* move cannot both reach a velocity, however far apart they arrive.
|
|
507
|
+
*/
|
|
508
|
+
private readonly pointerFed = new Set<number>();
|
|
384
509
|
/** When a finger was last down or lifted, and where it landed. */
|
|
385
510
|
private lastTouch: {readonly target: Node; readonly time: number} | null =
|
|
386
511
|
null;
|
|
387
512
|
/** Scrollers a recognizer is scrolling itself this frame (ownScroll). */
|
|
388
|
-
private readonly ownedScrolls = new
|
|
513
|
+
private readonly ownedScrolls = new Map<Node, number>();
|
|
514
|
+
/** Numbers each ownScroll call: only the newest one's timer clears it. */
|
|
515
|
+
private ownScrollCalls = 0;
|
|
516
|
+
/** Cancels each scroller's pending ownScroll frames. */
|
|
517
|
+
private readonly ownScrollFrames = new Map<Node, () => void>();
|
|
389
518
|
/** The last scroll a finger drove, and when. */
|
|
390
519
|
private lastScroll: {readonly scroller: Node; readonly time: number} | null =
|
|
391
520
|
null;
|
|
521
|
+
/** Predicates that hold a touch's target away from every participant. */
|
|
522
|
+
private readonly touchGates = new Set<(target: Node) => boolean>();
|
|
523
|
+
/** Who keeps the listeners installed without a registration (retain). */
|
|
524
|
+
private retainers = 0;
|
|
525
|
+
/** Told after every touch event that changed the fingers on the screen. */
|
|
526
|
+
private readonly fingerListeners = new Set<() => void>();
|
|
527
|
+
/**
|
|
528
|
+
* Where each finger now on the screen landed, from the last touch event's
|
|
529
|
+
* `touches` (every finger, whether or not a recognizer tracks it).
|
|
530
|
+
*/
|
|
531
|
+
private fingerTargets: ReadonlyArray<Node> = [];
|
|
392
532
|
private nextId = 1;
|
|
393
533
|
private isInstalled = false;
|
|
394
|
-
private readonly inputMode: 'auto' | 'pointer-events';
|
|
395
|
-
private usesTouchEvents = true;
|
|
396
|
-
private swallowDeadline = Number.NEGATIVE_INFINITY;
|
|
397
534
|
/**
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
535
|
+
* Whether the primary pointer is coarse (`spec:AST-094` FR19), read when
|
|
536
|
+
* something first attaches and kept current while anything is attached.
|
|
537
|
+
*/
|
|
538
|
+
private isCoarse = false;
|
|
539
|
+
private stopWatchingPointer: (() => void) | null = null;
|
|
540
|
+
/** The input stream subscriptions while installed. */
|
|
541
|
+
private unsubscribers: (() => void)[] = [];
|
|
542
|
+
/**
|
|
543
|
+
* Where the primary pointer is fine, each element that uses a gesture
|
|
544
|
+
* listens for a press itself; the page's listeners last that press (FR24).
|
|
403
545
|
*/
|
|
404
|
-
private readonly
|
|
546
|
+
private readonly armedElements = new Map<Element, () => void>();
|
|
405
547
|
private isArmedPress = false;
|
|
406
|
-
|
|
548
|
+
/**
|
|
549
|
+
* Whether the installed listeners include the cancelable ones (the
|
|
550
|
+
* document's touchend, contextmenu and the window's click): only while a
|
|
551
|
+
* participant that can claim is attached (`spec:AST-094` FR20).
|
|
552
|
+
*/
|
|
553
|
+
private isClaimingInstalled = false;
|
|
554
|
+
/** The input stream subscriptions syncClaimingListeners keeps. */
|
|
555
|
+
private claimingUnsubscribers: (() => void)[] = [];
|
|
556
|
+
private readonly inputMode: 'auto' | 'pointer-events';
|
|
557
|
+
private usesTouchEvents = true;
|
|
407
558
|
|
|
408
559
|
constructor(doc: Document, options: GestureHostOptions = {}) {
|
|
409
560
|
this.doc = doc;
|
|
410
561
|
this.inputMode = options.inputMode ?? 'auto';
|
|
562
|
+
this.presentedHitTesting = options.presentedHitTesting ?? 'auto';
|
|
411
563
|
const environment: GestureEnvironment = {
|
|
412
564
|
viewportSize: () => ({
|
|
413
565
|
width: doc.defaultView?.innerWidth ?? 0,
|
|
414
566
|
height: doc.defaultView?.innerHeight ?? 0,
|
|
415
567
|
}),
|
|
568
|
+
// The writing direction through core's one helper.
|
|
416
569
|
isRtl: view =>
|
|
417
|
-
view instanceof Element &&
|
|
418
|
-
doc.defaultView?.getComputedStyle(view).direction === 'rtl',
|
|
570
|
+
view instanceof Element && isRtlElement(view as HTMLElement),
|
|
419
571
|
// A screen-edge pan tells a view within its edge band from any other
|
|
420
572
|
// by its box (spec:AST-094 FR18).
|
|
421
573
|
viewRect: view => {
|
|
@@ -426,29 +578,22 @@ export class GestureHost {
|
|
|
426
578
|
return {left, top, width, height};
|
|
427
579
|
},
|
|
428
580
|
};
|
|
581
|
+
this.clock = options.clock ?? browserClock;
|
|
429
582
|
this.arena = new GestureArena({
|
|
430
|
-
clock:
|
|
583
|
+
clock: this.clock,
|
|
431
584
|
environment,
|
|
432
585
|
onDeferredClick: (touch, allowed) => this.replayClick(touch, allowed),
|
|
586
|
+
// A press whose decision waited on a timer (a tap waiting on a double
|
|
587
|
+
// tap) ends here: an armed press stops listening (FR24).
|
|
588
|
+
onIdle: () => this.releaseArmedPress(),
|
|
433
589
|
onTransition: options.onTransition,
|
|
434
590
|
});
|
|
435
591
|
const view = doc.defaultView;
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
? view.matchMedia('(pointer: coarse)')
|
|
440
|
-
: null;
|
|
592
|
+
// A test may pass its own read; otherwise the one coarse-pointer gate,
|
|
593
|
+
// followed as it changes.
|
|
594
|
+
this.followsPointer = options.isPrimaryPointerCoarse == null;
|
|
441
595
|
this.isPrimaryPointerCoarse =
|
|
442
|
-
options.isPrimaryPointerCoarse ?? (() =>
|
|
443
|
-
this.coarseQuery = coarseQuery;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
/** Re-derive every element's styles and the host's listeners. */
|
|
447
|
-
private refreshAll(): void {
|
|
448
|
-
for (const [element, registration] of this.registry) {
|
|
449
|
-
this.refresh(element, registration);
|
|
450
|
-
}
|
|
451
|
-
this.syncListeners();
|
|
596
|
+
options.isPrimaryPointerCoarse ?? (() => isCoarsePointer(view));
|
|
452
597
|
}
|
|
453
598
|
|
|
454
599
|
// --- Attachment ------------------------------------------------------------
|
|
@@ -461,7 +606,12 @@ export class GestureHost {
|
|
|
461
606
|
): () => void {
|
|
462
607
|
const registration = this.registrationFor(element);
|
|
463
608
|
registration.manageStyle = options.manageStyle ?? registration.manageStyle;
|
|
464
|
-
|
|
609
|
+
// An action group while any attachment asks, whatever their order.
|
|
610
|
+
const asksForGroup = options.actionGroup === true;
|
|
611
|
+
if (asksForGroup) {
|
|
612
|
+
registration.actionGroupAsks += 1;
|
|
613
|
+
registration.actionGroup = true;
|
|
614
|
+
}
|
|
465
615
|
recognizer.view = element;
|
|
466
616
|
registration.recognizers.push(recognizer);
|
|
467
617
|
recognizer.onEnabledChange = () => {
|
|
@@ -482,6 +632,10 @@ export class GestureHost {
|
|
|
482
632
|
this.syncListeners();
|
|
483
633
|
return () => {
|
|
484
634
|
recognizer.onEnabledChange = null;
|
|
635
|
+
if (asksForGroup) {
|
|
636
|
+
registration.actionGroupAsks -= 1;
|
|
637
|
+
registration.actionGroup = registration.actionGroupAsks > 0;
|
|
638
|
+
}
|
|
485
639
|
if (edgePan != null) {
|
|
486
640
|
edgePan.onTouchBehaviorChange = null;
|
|
487
641
|
}
|
|
@@ -570,14 +724,22 @@ export class GestureHost {
|
|
|
570
724
|
};
|
|
571
725
|
|
|
572
726
|
/** Attach the view-level touch consumer of an element (a pressable control). */
|
|
573
|
-
attachConsumer(
|
|
727
|
+
attachConsumer(
|
|
728
|
+
element: Element,
|
|
729
|
+
consumer: TouchConsumer,
|
|
730
|
+
_options: Pick<AttachOptions, 'perEventPointer'> = {},
|
|
731
|
+
): () => void {
|
|
574
732
|
const registration = this.registrationFor(element);
|
|
575
733
|
registration.consumer = consumer;
|
|
734
|
+
this.refresh(element, registration);
|
|
576
735
|
this.syncListeners();
|
|
577
736
|
return () => {
|
|
578
737
|
if (registration.consumer === consumer) {
|
|
579
738
|
registration.consumer = null;
|
|
580
739
|
}
|
|
740
|
+
// A keepsTouch consumer's blocking touchmove goes with it, even while
|
|
741
|
+
// the element keeps its recognizers.
|
|
742
|
+
this.refresh(element, registration);
|
|
581
743
|
// Even when the element keeps a recognizer: one left disabled keeps
|
|
582
744
|
// no listener or observer (FR24).
|
|
583
745
|
this.syncListeners();
|
|
@@ -586,23 +748,217 @@ export class GestureHost {
|
|
|
586
748
|
}
|
|
587
749
|
|
|
588
750
|
/**
|
|
589
|
-
*
|
|
590
|
-
* the function that stops it.
|
|
751
|
+
* @internal The document this host serves.
|
|
591
752
|
*/
|
|
592
|
-
|
|
593
|
-
this.
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
753
|
+
get document(): Document {
|
|
754
|
+
return this.doc;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* @internal Whether a recognizer owns the touch with this Touch Events
|
|
759
|
+
* `identifier`, so the browser must not pan it (pageHold.ts asks).
|
|
760
|
+
*/
|
|
761
|
+
isTouchClaimed(identifier: number): boolean {
|
|
762
|
+
const id = this.touchIds.get(identifier);
|
|
763
|
+
return id != null && this.arena.isClaimed(id);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* An element's box where it is drawn: the box the engine reports, moved
|
|
768
|
+
* by the compositor animations of it and its ancestors on engines that
|
|
769
|
+
* report and hit-test those where they started (iOS WebKit). Elsewhere
|
|
770
|
+
* `getBoundingClientRect` already reports the drawn box. Press trackers
|
|
771
|
+
* read their bounds through it.
|
|
772
|
+
*/
|
|
773
|
+
presentedRect(element: Element): PressBounds {
|
|
774
|
+
const box = element.getBoundingClientRect();
|
|
775
|
+
if (!this.hitTestsLayout()) {
|
|
776
|
+
return box;
|
|
777
|
+
}
|
|
778
|
+
const {x, y} = presentedOffsetOf(element);
|
|
779
|
+
if (x === 0 && y === 0) {
|
|
780
|
+
return box;
|
|
781
|
+
}
|
|
782
|
+
return {
|
|
783
|
+
left: box.left + x,
|
|
784
|
+
top: box.top + y,
|
|
785
|
+
right: box.right + x,
|
|
786
|
+
bottom: box.bottom + y,
|
|
598
787
|
};
|
|
599
788
|
}
|
|
600
789
|
|
|
790
|
+
/** Whether this engine hit-tests a compositor-moved element at layout. */
|
|
791
|
+
private hitTestsLayout(): boolean {
|
|
792
|
+
return (
|
|
793
|
+
this.presentedHitTesting === 'always' ||
|
|
794
|
+
(this.presentedHitTesting === 'auto' && isIosWebKit(this.doc.defaultView))
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Where a contact lands among what is drawn. iOS WebKit hit-tests an
|
|
800
|
+
* element that a compositor animation moves where the animation started:
|
|
801
|
+
* a finger on a settling sheet lands on whatever sat under the sheet's
|
|
802
|
+
* start (the scrim, which closes it), and a finger where the sheet was
|
|
803
|
+
* lands on the sheet. UIKit keeps an interruptible animation hit-testable
|
|
804
|
+
* where it is drawn (UIViewPropertyAnimator). The touch goes to what was
|
|
805
|
+
* drawn under the finger when it landed (`time`, its event's timestamp),
|
|
806
|
+
* even when a busy main thread hands it over later, and content that slid
|
|
807
|
+
* under the finger since takes nothing (`spec:AST-094` FR11).
|
|
808
|
+
*/
|
|
809
|
+
private presentedTarget(
|
|
810
|
+
native: EventTarget | null,
|
|
811
|
+
x: number,
|
|
812
|
+
y: number,
|
|
813
|
+
time: number,
|
|
814
|
+
): EventTarget | null {
|
|
815
|
+
if (!this.hitTestsLayout()) {
|
|
816
|
+
return native;
|
|
817
|
+
}
|
|
818
|
+
const movers = presentedElements().filter(element => {
|
|
819
|
+
if (!element.isConnected || element.ownerDocument !== this.doc) {
|
|
820
|
+
return false;
|
|
821
|
+
}
|
|
822
|
+
const {x: dx, y: dy} = presentedOffsetOf(element);
|
|
823
|
+
return Math.abs(dx) >= 0.5 || Math.abs(dy) >= 0.5;
|
|
824
|
+
});
|
|
825
|
+
if (movers.length === 0) {
|
|
826
|
+
return native;
|
|
827
|
+
}
|
|
828
|
+
// One style write per mover makes the engine hit-test it where it is
|
|
829
|
+
// drawn now; the hit test below flushes them. The engine then gets
|
|
830
|
+
// z-order, pointer-events and clipping right, which no box math would.
|
|
831
|
+
resolvePresented(movers);
|
|
832
|
+
let hit = this.drawnAt(x, y);
|
|
833
|
+
// A mover kept going while the touch waited for the main thread: what
|
|
834
|
+
// was under the finger when it landed is now that far along. A timestamp
|
|
835
|
+
// on another clock, or older than a second, is not corrected.
|
|
836
|
+
const age = (this.doc.defaultView?.performance.now() ?? time) - time;
|
|
837
|
+
if (age > 0 && age < 1000) {
|
|
838
|
+
const movedSince = (mover: Element) => {
|
|
839
|
+
const then = presentedOffsetOf(mover, time);
|
|
840
|
+
return Math.abs(then.x) >= 0.5 || Math.abs(then.y) >= 0.5 ? then : null;
|
|
841
|
+
};
|
|
842
|
+
const now = hit;
|
|
843
|
+
const under =
|
|
844
|
+
now == null
|
|
845
|
+
? undefined
|
|
846
|
+
: movers.find(mover => containsAlongFlatTree(mover, now));
|
|
847
|
+
let landedOnMover = false;
|
|
848
|
+
for (const mover of movers) {
|
|
849
|
+
const then = movedSince(mover);
|
|
850
|
+
if (then == null) {
|
|
851
|
+
continue;
|
|
852
|
+
}
|
|
853
|
+
const landed = this.drawnAt(x - then.x, y - then.y);
|
|
854
|
+
if (landed != null && containsAlongFlatTree(mover, landed)) {
|
|
855
|
+
hit = landed;
|
|
856
|
+
landedOnMover = true;
|
|
857
|
+
break;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
// Content that slid under the finger after it landed takes nothing:
|
|
861
|
+
// the touch goes to what was there, beneath it.
|
|
862
|
+
if (!landedOnMover && under != null && movedSince(under) != null) {
|
|
863
|
+
hit = this.drawnBeneath(x, y, movers);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
if (hit == null || hit === native) {
|
|
867
|
+
return native;
|
|
868
|
+
}
|
|
869
|
+
const found = hit;
|
|
870
|
+
const node = native instanceof Node ? native : null;
|
|
871
|
+
const isAboutMover = movers.some(
|
|
872
|
+
mover =>
|
|
873
|
+
containsAlongFlatTree(mover, found) ||
|
|
874
|
+
(node != null && containsAlongFlatTree(mover, node)),
|
|
875
|
+
);
|
|
876
|
+
return isAboutMover ? found : native;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/** What is drawn at a point beneath every mover. */
|
|
880
|
+
private drawnBeneath(
|
|
881
|
+
x: number,
|
|
882
|
+
y: number,
|
|
883
|
+
movers: ReadonlyArray<Element>,
|
|
884
|
+
): Element | null {
|
|
885
|
+
if (typeof this.doc.elementsFromPoint !== 'function') {
|
|
886
|
+
return null;
|
|
887
|
+
}
|
|
888
|
+
return (
|
|
889
|
+
this.doc
|
|
890
|
+
.elementsFromPoint(x, y)
|
|
891
|
+
.find(
|
|
892
|
+
element =>
|
|
893
|
+
!movers.some(mover => containsAlongFlatTree(mover, element)),
|
|
894
|
+
) ?? null
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/** What is drawn at a point, inside open shadow roots too. */
|
|
899
|
+
private drawnAt(x: number, y: number): Element | null {
|
|
900
|
+
let hit = this.doc.elementFromPoint(x, y);
|
|
901
|
+
// The document answers a shadow host for anything inside its open root:
|
|
902
|
+
// descend to what is drawn there.
|
|
903
|
+
while (hit?.shadowRoot != null) {
|
|
904
|
+
const inner = hit.shadowRoot.elementFromPoint(x, y);
|
|
905
|
+
if (inner == null || inner === hit) {
|
|
906
|
+
break;
|
|
907
|
+
}
|
|
908
|
+
hit = inner;
|
|
909
|
+
}
|
|
910
|
+
return hit;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/** The browser took these touches (a scroll): no click of ours for them. */
|
|
914
|
+
private browserTook(ids: ReadonlyArray<number>, time: number): void {
|
|
915
|
+
for (const id of ids) {
|
|
916
|
+
this.retargeted.delete(id);
|
|
917
|
+
}
|
|
918
|
+
this.arena.browserTookOver(ids, time);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* The click a retargeted tap earned, on what was drawn under the finger.
|
|
923
|
+
* The engine's own click would hit the start position, so the caller
|
|
924
|
+
* cancels it (or the click guard drops it, a late one included) and this one
|
|
925
|
+
* is the tap's single activation.
|
|
926
|
+
*/
|
|
927
|
+
private clickRetargeted(target: EventTarget, x: number, y: number): void {
|
|
928
|
+
const view = this.doc.defaultView;
|
|
929
|
+
if (!(target instanceof Element) || !target.isConnected || view == null) {
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
armClickGuard(this.doc);
|
|
933
|
+
if (
|
|
934
|
+
target instanceof view.HTMLElement &&
|
|
935
|
+
target.matches('input, textarea, select, [contenteditable]')
|
|
936
|
+
) {
|
|
937
|
+
target.focus();
|
|
938
|
+
}
|
|
939
|
+
withoutClickGuard(() =>
|
|
940
|
+
target.dispatchEvent(
|
|
941
|
+
new view.MouseEvent('click', {
|
|
942
|
+
bubbles: true,
|
|
943
|
+
cancelable: true,
|
|
944
|
+
composed: true,
|
|
945
|
+
detail: 1,
|
|
946
|
+
clientX: x,
|
|
947
|
+
clientY: y,
|
|
948
|
+
}),
|
|
949
|
+
),
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
|
|
601
953
|
/**
|
|
602
954
|
* Re-derive an element's styles and the host's listeners after its
|
|
603
955
|
* recognizers' options or its consumer's enabled state changed.
|
|
604
956
|
*/
|
|
605
957
|
update(element: Element): void {
|
|
958
|
+
if (!this.followsPointer) {
|
|
959
|
+
// A read passed in (a test's) is not followed: an update reads it again.
|
|
960
|
+
this.isCoarse = this.isPrimaryPointerCoarse();
|
|
961
|
+
}
|
|
606
962
|
const registration = this.registry.get(element);
|
|
607
963
|
if (registration != null) {
|
|
608
964
|
this.refresh(element, registration);
|
|
@@ -639,77 +995,165 @@ export class GestureHost {
|
|
|
639
995
|
*/
|
|
640
996
|
isScrollBraking(
|
|
641
997
|
node: Node,
|
|
642
|
-
window: number =
|
|
998
|
+
window: number = UIKIT_PRESS.scrollBrake.value,
|
|
643
999
|
): boolean {
|
|
644
1000
|
const last = this.lastScroll;
|
|
645
1001
|
return (
|
|
646
1002
|
last != null &&
|
|
647
1003
|
this.arena.now() - last.time < window &&
|
|
648
|
-
last.scroller
|
|
1004
|
+
containsAlongFlatTree(last.scroller, node)
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* @internal Keep the host's listeners installed until the returned
|
|
1010
|
+
* function runs, with no recognizer attached (fingerScroll.ts reads the
|
|
1011
|
+
* finger record meanwhile).
|
|
1012
|
+
*/
|
|
1013
|
+
retain(): () => void {
|
|
1014
|
+
this.retainers += 1;
|
|
1015
|
+
// A watch is not an attach: no warning where the pointer is fine.
|
|
1016
|
+
this.watchPointer();
|
|
1017
|
+
this.syncListeners();
|
|
1018
|
+
let isRetained = true;
|
|
1019
|
+
return () => {
|
|
1020
|
+
if (!isRetained) {
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
isRetained = false;
|
|
1024
|
+
this.retainers -= 1;
|
|
1025
|
+
this.uninstallIfIdle();
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* @internal Call `listener` after each touch event the host hears, once
|
|
1031
|
+
* the finger record is up to date. Returns the unsubscribe.
|
|
1032
|
+
*/
|
|
1033
|
+
onFingersChange(listener: () => void): () => void {
|
|
1034
|
+
this.fingerListeners.add(listener);
|
|
1035
|
+
return () => {
|
|
1036
|
+
this.fingerListeners.delete(listener);
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/** @internal Whether a finger that landed inside `node` is down now. */
|
|
1041
|
+
isFingerDownIn(node: Node): boolean {
|
|
1042
|
+
// Along the flat tree: a finger on content inside an open shadow root is
|
|
1043
|
+
// in the scroller around that root.
|
|
1044
|
+
return this.fingerTargets.some(target =>
|
|
1045
|
+
containsAlongFlatTree(node, target),
|
|
649
1046
|
);
|
|
650
1047
|
}
|
|
651
1048
|
|
|
652
1049
|
private registrationFor(element: Element): Registration {
|
|
1050
|
+
this.watchPointer();
|
|
653
1051
|
let registration = this.registry.get(element);
|
|
654
1052
|
if (registration == null) {
|
|
655
1053
|
registration = {
|
|
656
1054
|
recognizers: [],
|
|
657
1055
|
consumer: null,
|
|
658
|
-
|
|
659
|
-
|
|
1056
|
+
hasTouchEndListener: false,
|
|
1057
|
+
hasTouchMoveListener: false,
|
|
660
1058
|
savedStyle: new Map(),
|
|
661
1059
|
authorTouchAction: null,
|
|
662
1060
|
manageStyle: true,
|
|
663
1061
|
actionGroup: false,
|
|
1062
|
+
actionGroupAsks: 0,
|
|
664
1063
|
};
|
|
665
1064
|
this.registry.set(element, registration);
|
|
666
1065
|
}
|
|
667
1066
|
return registration;
|
|
668
1067
|
}
|
|
669
1068
|
|
|
1069
|
+
/** Whether anything attached could take input. */
|
|
1070
|
+
private needsInput(): boolean {
|
|
1071
|
+
return this.registry.size > 0 || this.retainers > 0;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
670
1074
|
private refresh(element: Element, registration: Registration): void {
|
|
671
1075
|
if (registration.manageStyle && element instanceof HTMLElement) {
|
|
672
1076
|
this.applyStyle(element, registration);
|
|
673
1077
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
1078
|
+
this.syncTouchMoveListener(element, registration);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* The element's blocking `touchmove`. For every pointer a claiming
|
|
1083
|
+
* recognizer keeps it: a finger's claim cancels its moves here (FR19), a
|
|
1084
|
+
* listener FR24 counts outside the one-listener budget a fine pointer's
|
|
1085
|
+
* element keeps for its press (syncArmed). A kept press needs it only
|
|
1086
|
+
* while a press is held: a phone's before every touch (Safari honours a
|
|
1087
|
+
* blocking listener only when registered before the touch began), a fine
|
|
1088
|
+
* pointer's only during an armed press, whose `pointerdown` comes before
|
|
1089
|
+
* the touch it brings (FR24).
|
|
1090
|
+
*/
|
|
1091
|
+
private syncTouchMoveListener(
|
|
1092
|
+
element: Element,
|
|
1093
|
+
registration: Registration,
|
|
1094
|
+
): void {
|
|
1095
|
+
// Where fingers come from their pointer events (Pointer Events input, or
|
|
1096
|
+
// a window with no ontouchstart), a claimed finger's touchend is not the
|
|
1097
|
+
// host's own document listener's to cancel, so the element cancels it
|
|
1098
|
+
// (FR21). Under a coarse pointer always: touch emulation turned on after
|
|
1099
|
+
// load hides ontouchstart yet sends touches. Under a fine one wherever
|
|
1100
|
+
// the browser sends Touch Events, as a touchscreen laptop does (FR43);
|
|
1101
|
+
// elsewhere no touchend ever comes, and the element keeps no listener
|
|
1102
|
+
// (FR24).
|
|
691
1103
|
const needsEndListener =
|
|
692
|
-
this.
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
1104
|
+
this.readsFingersFromPointerEvents() &&
|
|
1105
|
+
(this.isCoarse || this.sendsTouchEvents()) &&
|
|
1106
|
+
registration.recognizers.some(
|
|
1107
|
+
recognizer =>
|
|
1108
|
+
recognizer.isEnabled && internals(recognizer).acceptsTouchInput,
|
|
1109
|
+
);
|
|
1110
|
+
if (needsEndListener && !registration.hasTouchEndListener) {
|
|
1111
|
+
element.addEventListener('touchend', this.onClaimedTouchEnd, {
|
|
1112
|
+
passive: false,
|
|
1113
|
+
});
|
|
1114
|
+
registration.hasTouchEndListener = true;
|
|
1115
|
+
} else if (!needsEndListener && registration.hasTouchEndListener) {
|
|
1116
|
+
element.removeEventListener('touchend', this.onClaimedTouchEnd);
|
|
1117
|
+
registration.hasTouchEndListener = false;
|
|
1118
|
+
}
|
|
1119
|
+
const needsListener =
|
|
1120
|
+
registration.recognizers.some(
|
|
1121
|
+
recognizer => recognizer.isEnabled && claimsWhileMoving(recognizer),
|
|
1122
|
+
) ||
|
|
1123
|
+
(registration.consumer?.keepsTouch != null &&
|
|
1124
|
+
registration.consumer.isEnabled?.() !== false &&
|
|
1125
|
+
(this.isCoarse || this.isArmedPress));
|
|
1126
|
+
// The blocking listener sits on the element itself (FR19: a scroll that
|
|
1127
|
+
// starts elsewhere never waits on it), but every element shares the
|
|
1128
|
+
// host's one handler, which routes through the arena.
|
|
1129
|
+
if (needsListener && !registration.hasTouchMoveListener) {
|
|
1130
|
+
element.addEventListener('touchmove', this.onBlockingTouchMove, {
|
|
1131
|
+
passive: false,
|
|
1132
|
+
});
|
|
1133
|
+
registration.hasTouchMoveListener = true;
|
|
1134
|
+
} else if (!needsListener && registration.hasTouchMoveListener) {
|
|
1135
|
+
element.removeEventListener('touchmove', this.onBlockingTouchMove);
|
|
1136
|
+
registration.hasTouchMoveListener = false;
|
|
702
1137
|
}
|
|
703
1138
|
}
|
|
704
1139
|
|
|
705
1140
|
private applyStyle(element: HTMLElement, registration: Registration): void {
|
|
706
|
-
//
|
|
707
|
-
//
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
1141
|
+
// A disabled recognizer leaves the browser everything (FR24).
|
|
1142
|
+
// Every pointer gets it: a touchscreen laptop's finger as a phone's (FR43).
|
|
1143
|
+
const active = registration.recognizers.filter(
|
|
1144
|
+
recognizer => recognizer.isEnabled,
|
|
1145
|
+
);
|
|
1146
|
+
let style: GestureHostStyle =
|
|
1147
|
+
active.length > 0 ? gestureHostStyle(active) : {};
|
|
1148
|
+
// A control that keeps its touch (a stepper's hold-repeat) takes taps in
|
|
1149
|
+
// quick succession: the browser's double-tap zoom goes, as for a tap
|
|
1150
|
+
// recognizer (`spec:AST-094` FR18), for every pointer (FR43).
|
|
1151
|
+
if (
|
|
1152
|
+
style.touchAction == null &&
|
|
1153
|
+
registration.consumer?.keepsTouch != null
|
|
1154
|
+
) {
|
|
1155
|
+
style = {...style, touchAction: 'manipulation'};
|
|
1156
|
+
}
|
|
713
1157
|
for (const key of Object.keys(
|
|
714
1158
|
STYLE_PROPERTIES,
|
|
715
1159
|
) as (keyof GestureHostStyle)[]) {
|
|
@@ -804,8 +1248,9 @@ export class GestureHost {
|
|
|
804
1248
|
return;
|
|
805
1249
|
}
|
|
806
1250
|
this.isCallerReadScheduled = true;
|
|
807
|
-
inNextFrame(this.doc.defaultView, () => {
|
|
1251
|
+
this.cancelCallerRead = inNextFrame(this.doc.defaultView, () => {
|
|
808
1252
|
this.isCallerReadScheduled = false;
|
|
1253
|
+
this.cancelCallerRead = null;
|
|
809
1254
|
const pending: [HTMLElement, Registration][] = [];
|
|
810
1255
|
for (const candidate of this.pendingCallerReads) {
|
|
811
1256
|
const registration = this.registry.get(candidate);
|
|
@@ -834,60 +1279,99 @@ export class GestureHost {
|
|
|
834
1279
|
|
|
835
1280
|
private cleanup(element: Element, registration: Registration): void {
|
|
836
1281
|
if (registration.recognizers.length > 0 || registration.consumer != null) {
|
|
1282
|
+
// What stays may take nothing (only disabled recognizers): FR24.
|
|
1283
|
+
this.syncListeners();
|
|
837
1284
|
return;
|
|
838
1285
|
}
|
|
839
|
-
if (registration.
|
|
840
|
-
element.removeEventListener('
|
|
1286
|
+
if (registration.hasTouchEndListener) {
|
|
1287
|
+
element.removeEventListener('touchend', this.onClaimedTouchEnd);
|
|
1288
|
+
registration.hasTouchEndListener = false;
|
|
841
1289
|
}
|
|
842
|
-
if (registration.
|
|
843
|
-
element.removeEventListener('
|
|
844
|
-
registration.touchEndListener = null;
|
|
1290
|
+
if (registration.hasTouchMoveListener) {
|
|
1291
|
+
element.removeEventListener('touchmove', this.onBlockingTouchMove);
|
|
845
1292
|
}
|
|
846
1293
|
this.registry.delete(element);
|
|
847
|
-
this.
|
|
1294
|
+
this.uninstallIfIdle();
|
|
848
1295
|
}
|
|
849
1296
|
|
|
850
1297
|
/**
|
|
851
1298
|
* Listen only while something could take a touch now (`spec:AST-094`
|
|
852
|
-
* FR24, FR43): where the primary pointer is coarse,
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
* nothing.
|
|
1299
|
+
* FR24, FR43): where the primary pointer is coarse, an enabled recognizer
|
|
1300
|
+
* or consumer, or a finger-scroll watch; where it is fine, only during a
|
|
1301
|
+
* press an element armed (syncArmed). Otherwise no document listener is
|
|
1302
|
+
* registered, so an idle page and a disabled control pay nothing.
|
|
857
1303
|
*/
|
|
858
1304
|
private syncListeners(): void {
|
|
859
1305
|
this.syncLayoutWatch();
|
|
860
|
-
// The primary pointer can change (a tablet's keyboard attached or
|
|
861
|
-
// removed): while anything is attached, styles and listeners follow it.
|
|
862
|
-
// Nothing touch-related stays once the last attachment goes (FR24).
|
|
863
|
-
const hasAttachments = this.registry.size > 0 || this.delegated.size > 0;
|
|
864
|
-
if (hasAttachments && !this.isWatchingPointer) {
|
|
865
|
-
this.coarseQuery?.addEventListener?.('change', this.onPointerKindChange);
|
|
866
|
-
this.isWatchingPointer = true;
|
|
867
|
-
} else if (!hasAttachments && this.isWatchingPointer) {
|
|
868
|
-
this.coarseQuery?.removeEventListener?.(
|
|
869
|
-
'change',
|
|
870
|
-
this.onPointerKindChange,
|
|
871
|
-
);
|
|
872
|
-
this.isWatchingPointer = false;
|
|
873
|
-
}
|
|
874
1306
|
this.syncArmed();
|
|
875
1307
|
if (this.shouldListen()) {
|
|
876
1308
|
this.install();
|
|
877
|
-
|
|
1309
|
+
this.syncClaimingListeners();
|
|
1310
|
+
} else {
|
|
878
1311
|
this.uninstall();
|
|
879
1312
|
}
|
|
1313
|
+
this.syncMoverBlocking();
|
|
880
1314
|
}
|
|
881
1315
|
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
1316
|
+
/**
|
|
1317
|
+
* Safari honours a blocking `touchmove` only where it was registered before
|
|
1318
|
+
* the touch began, on the engine's own target, and on iOS WebKit a finger
|
|
1319
|
+
* on an element a compositor animation moves lands, for the engine, on
|
|
1320
|
+
* whatever sits under the motion's start (see presentedTarget). So while an
|
|
1321
|
+
* element a recognizer that claims moving touches lives in (or around) is
|
|
1322
|
+
* moving, the blocking listener subscribes to the window's capturing
|
|
1323
|
+
* `touchmove` through the shared input stream with `{cancels: true}`,
|
|
1324
|
+
* which sees every touch on the page whatever the engine targets and makes
|
|
1325
|
+
* that one listener non-passive (`spec:AST-094` FR19;
|
|
1326
|
+
* architecture:react-component-runtime INV13). It leaves when the motion
|
|
1327
|
+
* ends: only while it is subscribed does a scroll starting anywhere wait on
|
|
1328
|
+
* the main thread.
|
|
1329
|
+
*/
|
|
1330
|
+
private syncMoverBlocking(): void {
|
|
1331
|
+
const isWatching = this.isInstalled && this.hitTestsLayout();
|
|
1332
|
+
if (isWatching && this.stopWatchingMovers == null) {
|
|
1333
|
+
this.stopWatchingMovers = watchPresentedElements(() =>
|
|
1334
|
+
this.syncMoverBlocking(),
|
|
1335
|
+
);
|
|
1336
|
+
} else if (!isWatching && this.stopWatchingMovers != null) {
|
|
1337
|
+
this.stopWatchingMovers();
|
|
1338
|
+
this.stopWatchingMovers = null;
|
|
1339
|
+
}
|
|
1340
|
+
const needed =
|
|
1341
|
+
isWatching &&
|
|
1342
|
+
presentedElements().some(mover =>
|
|
1343
|
+
this.hasClaimingRecognizerAround(mover),
|
|
1344
|
+
);
|
|
1345
|
+
if (needed === (this.stopBlockingForMovers != null)) {
|
|
1346
|
+
return;
|
|
885
1347
|
}
|
|
886
|
-
|
|
887
|
-
|
|
1348
|
+
const view = this.doc.defaultView;
|
|
1349
|
+
if (needed && view != null) {
|
|
1350
|
+
this.stopBlockingForMovers = subscribeInput(
|
|
1351
|
+
view,
|
|
1352
|
+
'touchmove',
|
|
1353
|
+
this.onBlockingTouchMove,
|
|
1354
|
+
{cancels: true},
|
|
1355
|
+
);
|
|
1356
|
+
} else if (!needed) {
|
|
1357
|
+
this.stopBlockingForMovers?.();
|
|
1358
|
+
this.stopBlockingForMovers = null;
|
|
888
1359
|
}
|
|
889
|
-
|
|
890
|
-
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
/** Whether a recognizer that claims moving touches lives in or around `mover`. */
|
|
1363
|
+
private hasClaimingRecognizerAround(mover: Element): boolean {
|
|
1364
|
+
if (!mover.isConnected || mover.ownerDocument !== this.doc) {
|
|
1365
|
+
return false;
|
|
1366
|
+
}
|
|
1367
|
+
for (const [element, registration] of this.registry) {
|
|
1368
|
+
if (
|
|
1369
|
+
(containsAlongFlatTree(mover, element) ||
|
|
1370
|
+
containsAlongFlatTree(element, mover)) &&
|
|
1371
|
+
registration.recognizers.some(
|
|
1372
|
+
recognizer => recognizer.isEnabled && claimsWhileMoving(recognizer),
|
|
1373
|
+
)
|
|
1374
|
+
) {
|
|
891
1375
|
return true;
|
|
892
1376
|
}
|
|
893
1377
|
}
|
|
@@ -897,56 +1381,56 @@ export class GestureHost {
|
|
|
897
1381
|
/**
|
|
898
1382
|
* Where the primary pointer is fine, each element with an enabled
|
|
899
1383
|
* recognizer or press consumer listens for a press itself: one passive
|
|
900
|
-
* `pointerdown` listener
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
*
|
|
905
|
-
*
|
|
1384
|
+
* `pointerdown` listener on the element. The host's page listeners come at
|
|
1385
|
+
* that press and go once its contacts end and the arena drops their last
|
|
1386
|
+
* record (onIdle: a decision that waited on a timer), so an idle page has none
|
|
1387
|
+
* (`spec:AST-094` FR24, FR43). A finger on a touchscreen whose primary
|
|
1388
|
+
* pointer is fine sends its `pointerdown` before its `touchstart`, so the
|
|
1389
|
+
* host hears both.
|
|
906
1390
|
*/
|
|
907
1391
|
private syncArmed(): void {
|
|
908
|
-
const wanted = new Set<
|
|
909
|
-
if (!this.
|
|
1392
|
+
const wanted = new Set<Element>();
|
|
1393
|
+
if (!this.isCoarse) {
|
|
910
1394
|
for (const [element, registration] of this.registry) {
|
|
911
|
-
|
|
1395
|
+
const consumer = registration.consumer;
|
|
1396
|
+
if (
|
|
1397
|
+
registration.recognizers.some(recognizer => recognizer.isEnabled) ||
|
|
1398
|
+
(consumer != null && consumer.isEnabled?.() !== false)
|
|
1399
|
+
) {
|
|
912
1400
|
wanted.add(element);
|
|
913
1401
|
}
|
|
914
1402
|
}
|
|
915
|
-
if (this.delegated.size > 0) {
|
|
916
|
-
wanted.add(this.doc);
|
|
917
|
-
}
|
|
918
1403
|
}
|
|
919
|
-
for (const [
|
|
920
|
-
if (!wanted.has(
|
|
921
|
-
|
|
922
|
-
this.
|
|
1404
|
+
for (const [element, release] of this.armedElements) {
|
|
1405
|
+
if (!wanted.has(element)) {
|
|
1406
|
+
release();
|
|
1407
|
+
this.armedElements.delete(element);
|
|
923
1408
|
}
|
|
924
1409
|
}
|
|
925
|
-
for (const
|
|
926
|
-
if (this.
|
|
1410
|
+
for (const element of wanted) {
|
|
1411
|
+
if (this.armedElements.has(element)) {
|
|
927
1412
|
continue;
|
|
928
1413
|
}
|
|
929
|
-
|
|
1414
|
+
element.addEventListener(
|
|
930
1415
|
'pointerdown',
|
|
931
1416
|
this.onArmedPress,
|
|
932
1417
|
PASSIVE_CAPTURE,
|
|
933
1418
|
);
|
|
934
|
-
this.
|
|
935
|
-
|
|
1419
|
+
this.armedElements.set(element, () => {
|
|
1420
|
+
element.removeEventListener(
|
|
936
1421
|
'pointerdown',
|
|
937
1422
|
this.onArmedPress,
|
|
938
1423
|
PASSIVE_CAPTURE,
|
|
939
1424
|
);
|
|
940
1425
|
});
|
|
941
1426
|
}
|
|
1427
|
+
if (wanted.size === 0 && this.isArmedPress) {
|
|
1428
|
+
this.isArmedPress = false;
|
|
1429
|
+
this.syncKeptPresses();
|
|
1430
|
+
}
|
|
942
1431
|
}
|
|
943
1432
|
|
|
944
|
-
/**
|
|
945
|
-
* A press on something armed, where the primary pointer is fine: a
|
|
946
|
-
* mouse's primary button, a pen, or a finger. The page's listeners come
|
|
947
|
-
* for this press, and the press goes on to them, its capture phase on the
|
|
948
|
-
* page being over.
|
|
949
|
-
*/
|
|
1433
|
+
/** A press on an armed element, a mouse's primary button, a pen or a finger: listen for this press. */
|
|
950
1434
|
private readonly onArmedPress = (event: Event): void => {
|
|
951
1435
|
const press = event as PointerEvent;
|
|
952
1436
|
if (
|
|
@@ -957,95 +1441,250 @@ export class GestureHost {
|
|
|
957
1441
|
return;
|
|
958
1442
|
}
|
|
959
1443
|
this.isArmedPress = true;
|
|
1444
|
+
this.syncKeptPresses();
|
|
960
1445
|
this.install();
|
|
1446
|
+
// A finger's or a pen's press brings the cancelable touchend and the
|
|
1447
|
+
// contextmenu canceller, as wherever the host installs, so a claimed
|
|
1448
|
+
// lift clicks nothing and a claimed hold opens no browser menu (FR21). A
|
|
1449
|
+
// mouse's press needs neither.
|
|
1450
|
+
if (press.pointerType !== 'mouse') {
|
|
1451
|
+
this.syncClaimingListeners();
|
|
1452
|
+
}
|
|
1453
|
+
// The window's capture phase is over for this event: hand it on.
|
|
961
1454
|
this.onPointerDown(press);
|
|
962
|
-
// A mouse's or a pen's press that nothing took has nothing to wait for;
|
|
963
|
-
// a finger's contact begins at its touchstart, which comes next.
|
|
964
|
-
if (press.pointerType !== 'touch') {
|
|
965
|
-
this.releaseArmedPress();
|
|
966
|
-
}
|
|
967
1455
|
};
|
|
968
1456
|
|
|
969
|
-
/**
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1457
|
+
/** A kept press's blocking `touchmove` follows the armed press (syncTouchMoveListener). */
|
|
1458
|
+
private syncKeptPresses(): void {
|
|
1459
|
+
for (const [element, registration] of this.registry) {
|
|
1460
|
+
if (registration.consumer?.keepsTouch != null) {
|
|
1461
|
+
this.syncTouchMoveListener(element, registration);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
/** After a contact ends: an armed press that is over stops listening. */
|
|
975
1467
|
private releaseArmedPress(): void {
|
|
976
|
-
if (
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
)
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1468
|
+
if (!this.isArmedPress) {
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
queueMicrotask(() => {
|
|
1472
|
+
if (this.isArmedPress && this.arena.touches.length === 0) {
|
|
1473
|
+
this.isArmedPress = false;
|
|
1474
|
+
this.syncKeptPresses();
|
|
1475
|
+
this.syncListeners();
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
/** With nothing attached, stop listening and stop following the pointer. */
|
|
1481
|
+
private uninstallIfIdle(): void {
|
|
1482
|
+
this.syncListeners();
|
|
1483
|
+
if (this.registry.size === 0 && this.retainers === 0) {
|
|
1484
|
+
this.uninstall();
|
|
1485
|
+
this.stopWatchingPointer?.();
|
|
1486
|
+
this.stopWatchingPointer = null;
|
|
1487
|
+
this.releaseWhenIdle();
|
|
984
1488
|
}
|
|
985
1489
|
}
|
|
986
1490
|
|
|
987
1491
|
/**
|
|
988
|
-
*
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
*
|
|
1492
|
+
* In the microtask after the last detach, unless something attached again
|
|
1493
|
+
* in the same task (a component that remounts mid-press keeps its notes):
|
|
1494
|
+
* nothing the host holds outlives it, no note and no pending frame or
|
|
1495
|
+
* timer (`spec:AST-094` FR24).
|
|
992
1496
|
*/
|
|
993
|
-
private
|
|
1497
|
+
private releaseWhenIdle(): void {
|
|
1498
|
+
queueMicrotask(() => {
|
|
1499
|
+
if (this.registry.size > 0 || this.retainers > 0) {
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
this.cancelledFingers.clear();
|
|
1503
|
+
this.clearClaimedLifts();
|
|
1504
|
+
this.cancelCallerRead?.();
|
|
1505
|
+
this.cancelCallerRead = null;
|
|
1506
|
+
this.isCallerReadScheduled = false;
|
|
1507
|
+
this.pendingCallerReads.clear();
|
|
1508
|
+
for (const cancel of this.ownScrollFrames.values()) {
|
|
1509
|
+
cancel();
|
|
1510
|
+
}
|
|
1511
|
+
this.ownScrollFrames.clear();
|
|
1512
|
+
this.ownedScrolls.clear();
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
/** Read the primary pointer, and follow it while anything is attached. */
|
|
1517
|
+
private watchPointer(): void {
|
|
1518
|
+
if (this.stopWatchingPointer != null) {
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
994
1521
|
const view = this.doc.defaultView;
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
this.
|
|
1522
|
+
this.isCoarse = this.isPrimaryPointerCoarse();
|
|
1523
|
+
this.stopWatchingPointer = this.followsPointer
|
|
1524
|
+
? watchCoarsePointer(view, isCoarse => this.pointerChanged(isCoarse))
|
|
1525
|
+
: () => {};
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
/**
|
|
1529
|
+
* The primary pointer turned coarse or fine (a tablet docking a mouse):
|
|
1530
|
+
* install or remove everything, as if each attach happened now.
|
|
1531
|
+
*/
|
|
1532
|
+
private pointerChanged(isCoarse: boolean): void {
|
|
1533
|
+
if (isCoarse === this.isCoarse) {
|
|
1534
|
+
return;
|
|
998
1535
|
}
|
|
999
|
-
|
|
1000
|
-
if (
|
|
1001
|
-
|
|
1536
|
+
this.isCoarse = isCoarse;
|
|
1537
|
+
if (!isCoarse) {
|
|
1538
|
+
this.cancelEverything(this.arena.now());
|
|
1539
|
+
}
|
|
1540
|
+
for (const [element, registration] of this.registry) {
|
|
1541
|
+
this.refresh(element, registration);
|
|
1542
|
+
}
|
|
1543
|
+
this.syncListeners();
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Whether an enabled participant could claim a touch or cancel a lift: a
|
|
1548
|
+
* consumer, or a recognizer that claims touches. With only watchers
|
|
1549
|
+
* attached, the host's listeners are all passive (`spec:AST-094` FR20).
|
|
1550
|
+
*/
|
|
1551
|
+
private hasClaimer(): boolean {
|
|
1552
|
+
for (const registration of this.registry.values()) {
|
|
1553
|
+
const consumer = registration.consumer;
|
|
1554
|
+
if (
|
|
1555
|
+
(consumer != null && consumer.isEnabled?.() !== false) ||
|
|
1556
|
+
registration.recognizers.some(
|
|
1557
|
+
recognizer => recognizer.isEnabled && recognizer.claimsTouches,
|
|
1558
|
+
)
|
|
1559
|
+
) {
|
|
1560
|
+
return true;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
return false;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
/**
|
|
1567
|
+
* Keeps the touchend cancelable, and the contextmenu subscription on,
|
|
1568
|
+
* only while a claimer is attached; with only watchers the touchend is
|
|
1569
|
+
* passive and the contextmenu is off. Clicks are the click guard's
|
|
1570
|
+
* (utils/clickGuard.ts), whose one listener a window gets only once a
|
|
1571
|
+
* gesture first arms it.
|
|
1572
|
+
*/
|
|
1573
|
+
private syncClaimingListeners(): void {
|
|
1574
|
+
if (!this.isInstalled) {
|
|
1575
|
+
return;
|
|
1576
|
+
}
|
|
1577
|
+
const isClaiming = this.hasClaimer();
|
|
1578
|
+
if (isClaiming === this.isClaimingInstalled) {
|
|
1002
1579
|
return;
|
|
1003
1580
|
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1581
|
+
const view = this.doc.defaultView;
|
|
1582
|
+
for (const unsubscribe of this.claimingUnsubscribers.splice(0)) {
|
|
1583
|
+
unsubscribe();
|
|
1584
|
+
}
|
|
1585
|
+
if (view != null) {
|
|
1586
|
+
if (this.inputMode === 'auto') {
|
|
1587
|
+
this.claimingUnsubscribers.push(
|
|
1588
|
+
subscribeInput(view, 'touchend', this.onTouchEnd, {
|
|
1589
|
+
cancels: isClaiming,
|
|
1590
|
+
}),
|
|
1591
|
+
);
|
|
1592
|
+
}
|
|
1593
|
+
if (isClaiming) {
|
|
1594
|
+
this.claimingUnsubscribers.push(
|
|
1595
|
+
subscribeInput(view, 'contextmenu', this.onContextMenu, {
|
|
1596
|
+
cancels: true,
|
|
1597
|
+
}),
|
|
1598
|
+
);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
this.isClaimingInstalled = isClaiming;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
private shouldListen(): boolean {
|
|
1605
|
+
if (!this.needsInput()) {
|
|
1606
|
+
return false;
|
|
1607
|
+
}
|
|
1608
|
+
// A retainer (a finger-scroll watch) listens only where the pointer is
|
|
1609
|
+
// coarse: it follows a finger's scroll, which a fine pointer's page
|
|
1610
|
+
// leaves to the browser (FR24).
|
|
1611
|
+
if (this.isCoarse && this.retainers > 0) {
|
|
1612
|
+
return true;
|
|
1613
|
+
}
|
|
1614
|
+
let isUsed = false;
|
|
1615
|
+
for (const registration of this.registry.values()) {
|
|
1616
|
+
const consumer = registration.consumer;
|
|
1617
|
+
if (
|
|
1618
|
+
(consumer != null && consumer.isEnabled?.() !== false) ||
|
|
1619
|
+
registration.recognizers.some(recognizer => recognizer.isEnabled)
|
|
1620
|
+
) {
|
|
1621
|
+
isUsed = true;
|
|
1622
|
+
break;
|
|
1008
1623
|
}
|
|
1009
|
-
}
|
|
1624
|
+
}
|
|
1625
|
+
// Where the primary pointer is fine, only while a press an element armed
|
|
1626
|
+
// is held (syncArmed, FR24, FR43).
|
|
1627
|
+
return isUsed && (this.isCoarse || this.isArmedPress);
|
|
1010
1628
|
}
|
|
1011
1629
|
|
|
1012
1630
|
// --- Listeners -------------------------------------------------------------
|
|
1013
1631
|
|
|
1014
1632
|
private install(): void {
|
|
1015
|
-
|
|
1633
|
+
this.watchPointer();
|
|
1634
|
+
if (!this.needsInput()) {
|
|
1016
1635
|
return;
|
|
1017
1636
|
}
|
|
1018
|
-
if (this.
|
|
1019
|
-
|
|
1020
|
-
this.clickRemoval = null;
|
|
1637
|
+
if (this.isInstalled) {
|
|
1638
|
+
return;
|
|
1021
1639
|
}
|
|
1022
1640
|
const view = this.doc.defaultView;
|
|
1023
1641
|
this.isInstalled = true;
|
|
1024
1642
|
this.usesTouchEvents =
|
|
1025
1643
|
this.inputMode === 'auto' && view != null && 'ontouchstart' in view;
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1644
|
+
if (view == null) {
|
|
1645
|
+
// A document without a window receives no input.
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1648
|
+
// The window's capture phase, through the shared input stream
|
|
1649
|
+
// (utils/inputStream.ts): ahead of any document listener, so an app's
|
|
1650
|
+
// window-capture stopPropagation, or a document-capture
|
|
1651
|
+
// stopImmediatePropagation registered first, no longer hides a touch
|
|
1652
|
+
// from the recognizers. A recognizer that must claim mid-gesture still
|
|
1653
|
+
// needs the touch to reach its element, where its blocking touchmove
|
|
1654
|
+
// sits. Only the listeners that cancel are non-passive, and only while a
|
|
1655
|
+
// claimer is attached (syncClaimingListeners); none of them is a
|
|
1656
|
+
// touchstart or touchmove, so none of them holds a scroll.
|
|
1657
|
+
this.unsubscribers = [
|
|
1658
|
+
// Pointer Events only: a finger comes from its pointer events alone. A
|
|
1659
|
+
// browser that has Touch Events still sends them for the same finger,
|
|
1660
|
+
// and reading both would track it twice (a long press needs one touch).
|
|
1661
|
+
...(this.inputMode === 'auto'
|
|
1662
|
+
? [
|
|
1663
|
+
subscribeInput(view, 'touchstart', this.onTouchStart),
|
|
1664
|
+
subscribeInput(view, 'touchmove', this.onTouchMove),
|
|
1665
|
+
subscribeInput(view, 'touchcancel', this.onTouchCancel),
|
|
1666
|
+
]
|
|
1667
|
+
: []),
|
|
1668
|
+
subscribeInput(view, 'pointerdown', this.onPointerDown),
|
|
1669
|
+
subscribeInput(view, 'pointermove', this.onPointerMove),
|
|
1670
|
+
subscribeInput(view, 'pointerup', this.onPointerUp),
|
|
1671
|
+
subscribeInput(view, 'pointercancel', this.onPointerCancel),
|
|
1672
|
+
subscribeInput(view, 'scroll', this.onScroll),
|
|
1673
|
+
subscribeInput(view, 'visibilitychange', this.onVisibilityChange),
|
|
1674
|
+
// The window's own blur; an element's blur (a Node's) reaches the
|
|
1675
|
+
// window's capture phase too and means nothing here.
|
|
1676
|
+
subscribeInput(view, 'blur', event => {
|
|
1677
|
+
if (!(event.target instanceof view.Node)) {
|
|
1678
|
+
this.onBlur();
|
|
1679
|
+
}
|
|
1680
|
+
}),
|
|
1681
|
+
];
|
|
1682
|
+
// Passive until a claimer is attached (syncClaimingListeners).
|
|
1683
|
+
this.isClaimingInstalled = false;
|
|
1684
|
+
this.claimingUnsubscribers =
|
|
1685
|
+
this.inputMode === 'auto'
|
|
1686
|
+
? [subscribeInput(view, 'touchend', this.onTouchEnd)]
|
|
1687
|
+
: [];
|
|
1049
1688
|
}
|
|
1050
1689
|
|
|
1051
1690
|
private uninstall(): void {
|
|
@@ -1053,26 +1692,20 @@ export class GestureHost {
|
|
|
1053
1692
|
return;
|
|
1054
1693
|
}
|
|
1055
1694
|
this.isInstalled = false;
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
doc.removeEventListener(
|
|
1066
|
-
'pointercancel',
|
|
1067
|
-
this.onPointerCancel,
|
|
1068
|
-
PASSIVE_CAPTURE,
|
|
1069
|
-
);
|
|
1070
|
-
doc.removeEventListener('contextmenu', this.onContextMenu, ACTIVE_CAPTURE);
|
|
1071
|
-
doc.removeEventListener('scroll', this.onScroll, PASSIVE_CAPTURE);
|
|
1072
|
-
doc.removeEventListener('visibilitychange', this.onVisibilityChange);
|
|
1073
|
-
this.releaseClickListener();
|
|
1074
|
-
view?.removeEventListener('blur', this.onBlur);
|
|
1695
|
+
// Unheard from here on: no fingers to keep.
|
|
1696
|
+
this.fingerTargets = [];
|
|
1697
|
+
this.isClaimingInstalled = false;
|
|
1698
|
+
for (const unsubscribe of [
|
|
1699
|
+
...this.unsubscribers.splice(0),
|
|
1700
|
+
...this.claimingUnsubscribers.splice(0),
|
|
1701
|
+
]) {
|
|
1702
|
+
unsubscribe();
|
|
1703
|
+
}
|
|
1075
1704
|
this.cancelEverything(this.arena.now());
|
|
1705
|
+
// A claimed lift's note stays: an armed press's listeners go in the
|
|
1706
|
+
// microtask after its pointerup, the touchend comes after that microtask
|
|
1707
|
+
// in the same task (iOS and WebKit), and the element's own listener still
|
|
1708
|
+
// takes it (noteClaimedLift).
|
|
1076
1709
|
this.lastTouch = null;
|
|
1077
1710
|
this.lastScroll = null;
|
|
1078
1711
|
}
|
|
@@ -1082,7 +1715,7 @@ export class GestureHost {
|
|
|
1082
1715
|
/**
|
|
1083
1716
|
* The recognizers on the path from `target` to the document, innermost
|
|
1084
1717
|
* first, and (for a contact) its consumer: the innermost element with an
|
|
1085
|
-
* attached consumer
|
|
1718
|
+
* attached consumer.
|
|
1086
1719
|
*/
|
|
1087
1720
|
private participantsAt(
|
|
1088
1721
|
target: unknown,
|
|
@@ -1090,9 +1723,17 @@ export class GestureHost {
|
|
|
1090
1723
|
): {
|
|
1091
1724
|
recognizers: GestureRecognizer[];
|
|
1092
1725
|
consumer: TouchConsumer | null;
|
|
1726
|
+
consumerElement: Element | null;
|
|
1093
1727
|
} {
|
|
1094
1728
|
const recognizers: GestureRecognizer[] = [];
|
|
1095
1729
|
let consumer: TouchConsumer | null = null;
|
|
1730
|
+
let consumerElement: Element | null = null;
|
|
1731
|
+
if (
|
|
1732
|
+
target instanceof Node &&
|
|
1733
|
+
[...this.touchGates].some(gate => gate(target))
|
|
1734
|
+
) {
|
|
1735
|
+
return {recognizers, consumer, consumerElement};
|
|
1736
|
+
}
|
|
1096
1737
|
let hasConsumerOwner = pointerType == null;
|
|
1097
1738
|
for (
|
|
1098
1739
|
let node: Node | null = target instanceof Node ? target : null;
|
|
@@ -1104,29 +1745,120 @@ export class GestureHost {
|
|
|
1104
1745
|
}
|
|
1105
1746
|
const registration = this.registry.get(node);
|
|
1106
1747
|
if (registration != null) {
|
|
1748
|
+
// Every pointer (`spec:AST-094` FR43), hover included.
|
|
1107
1749
|
recognizers.push(...registration.recognizers);
|
|
1108
1750
|
}
|
|
1109
1751
|
if (hasConsumerOwner || pointerType == null) {
|
|
1110
1752
|
continue;
|
|
1111
1753
|
}
|
|
1754
|
+
// A press consumer takes every pointer's press, a mouse's too
|
|
1755
|
+
// (`spec:AST-094` FR43, DEC-21).
|
|
1112
1756
|
if (registration?.consumer != null) {
|
|
1113
1757
|
consumer = registration.consumer;
|
|
1758
|
+
consumerElement = node;
|
|
1114
1759
|
hasConsumerOwner = true;
|
|
1115
1760
|
continue;
|
|
1116
1761
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1762
|
+
}
|
|
1763
|
+
return {recognizers, consumer, consumerElement};
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
/**
|
|
1767
|
+
* Turn text selection and the touch callout off, for as long as this
|
|
1768
|
+
* finger or pen is down, only on the elements whose hold does something:
|
|
1769
|
+
* a long press's (a menu, a hold-repeat), those of recognizers created
|
|
1770
|
+
* with a `selectionLock` (a slider's thumb, a switch's drag, a tab bar's
|
|
1771
|
+
* zero-delay lens) and that of a press tracker created with one (a
|
|
1772
|
+
* stepper's hold-repeat). Anything whose hold does nothing, a plain
|
|
1773
|
+
* press-tracked control or row included, keeps the browser's long-press
|
|
1774
|
+
* selection (`spec:AST-094` FR41). Restored when the contact ends. Callers
|
|
1775
|
+
* lock for a finger or a pen under any primary pointer, never for a mouse
|
|
1776
|
+
* (locksSelectionFor), and only once the arena has admitted the contact:
|
|
1777
|
+
* `recognizers` and `consumer` are the ones that took it.
|
|
1778
|
+
*/
|
|
1779
|
+
private lockSelection(
|
|
1780
|
+
id: number,
|
|
1781
|
+
recognizers: ReadonlyArray<GestureRecognizer>,
|
|
1782
|
+
target: EventTarget | null,
|
|
1783
|
+
consumer: TouchConsumer | null,
|
|
1784
|
+
consumerElement: Element | null,
|
|
1785
|
+
): void {
|
|
1786
|
+
// Each recognizer whose hold does something brings its lock; the host
|
|
1787
|
+
// never imports one (a component without such a hold does not bundle
|
|
1788
|
+
// it). Only one that took this contact locks for it: a recognizer that
|
|
1789
|
+
// declined it (its pointer, or its own shouldReceiveTouch) has no hold
|
|
1790
|
+
// here.
|
|
1791
|
+
// An element attached with manageStyle: false keeps its own styles, the
|
|
1792
|
+
// lock included (AttachOptions.manageStyle).
|
|
1793
|
+
const managed = (element: Element) =>
|
|
1794
|
+
this.registry.get(element)?.manageStyle !== false;
|
|
1795
|
+
const byLock = new Map<SelectionLock, Set<Element>>();
|
|
1796
|
+
for (const recognizer of recognizers) {
|
|
1797
|
+
const lock = recognizer.selectionLock;
|
|
1798
|
+
if (
|
|
1799
|
+
lock != null &&
|
|
1800
|
+
recognizer.view instanceof Element &&
|
|
1801
|
+
managed(recognizer.view)
|
|
1802
|
+
) {
|
|
1803
|
+
const elements = byLock.get(lock) ?? new Set<Element>();
|
|
1804
|
+
elements.add(recognizer.view);
|
|
1805
|
+
byLock.set(lock, elements);
|
|
1123
1806
|
}
|
|
1124
1807
|
}
|
|
1125
|
-
|
|
1808
|
+
const consumerLock = consumer?.selectionLock;
|
|
1809
|
+
if (
|
|
1810
|
+
consumerLock != null &&
|
|
1811
|
+
consumerElement != null &&
|
|
1812
|
+
managed(consumerElement)
|
|
1813
|
+
) {
|
|
1814
|
+
const elements = byLock.get(consumerLock) ?? new Set<Element>();
|
|
1815
|
+
elements.add(consumerElement);
|
|
1816
|
+
byLock.set(consumerLock, elements);
|
|
1817
|
+
}
|
|
1818
|
+
if (byLock.size > 0) {
|
|
1819
|
+
const undo = [...byLock].map(([lock, elements]) =>
|
|
1820
|
+
lock(elements, target),
|
|
1821
|
+
);
|
|
1822
|
+
this.lockedBy.set(id, () => {
|
|
1823
|
+
for (const release of undo) {
|
|
1824
|
+
release();
|
|
1825
|
+
}
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
/** Undo `lockSelection` for a contact that ended; idempotent. */
|
|
1831
|
+
private unlockSelection(id: number): void {
|
|
1832
|
+
this.lockedBy.get(id)?.();
|
|
1833
|
+
this.lockedBy.delete(id);
|
|
1126
1834
|
}
|
|
1127
1835
|
|
|
1128
1836
|
// --- Touch events ----------------------------------------------------------
|
|
1129
1837
|
|
|
1838
|
+
/**
|
|
1839
|
+
* Hold touches away from every participant while `gate(target)` answers
|
|
1840
|
+
* true (a presentation running in a layer: its content takes no touch
|
|
1841
|
+
* until it settles). Returns the release.
|
|
1842
|
+
*/
|
|
1843
|
+
addTouchGate(gate: (target: Node) => boolean): () => void {
|
|
1844
|
+
this.touchGates.add(gate);
|
|
1845
|
+
return () => {
|
|
1846
|
+
this.touchGates.delete(gate);
|
|
1847
|
+
};
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* How many fingers are on the screen: the length of `touches` in the last
|
|
1852
|
+
* touch event the host's listeners heard (`touchstart`, `touchmove`,
|
|
1853
|
+
* `touchend`, `touchcancel`), whatever its target, so a finger on an
|
|
1854
|
+
* element with no recognizer counts too. 0 before any, and while no
|
|
1855
|
+
* listener is installed. A recognizer that must not begin under a second
|
|
1856
|
+
* finger reads it in `shouldBegin`.
|
|
1857
|
+
*/
|
|
1858
|
+
fingersDown(): number {
|
|
1859
|
+
return this.fingerTargets.length;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1130
1862
|
/** Whether this event is new to the host (and mark it handled). */
|
|
1131
1863
|
private takeEvent(event: Event): boolean {
|
|
1132
1864
|
if (this.processed.has(event)) {
|
|
@@ -1137,25 +1869,50 @@ export class GestureHost {
|
|
|
1137
1869
|
}
|
|
1138
1870
|
|
|
1139
1871
|
private readonly onTouchStart = (event: TouchEvent): void => {
|
|
1140
|
-
|
|
1872
|
+
this.noteFingersDown(event);
|
|
1873
|
+
// Where the host reads a finger from its pointer events (no ontouchstart,
|
|
1874
|
+
// as after touch emulation turns on), its Touch Events would track it twice.
|
|
1875
|
+
if (!this.usesTouchEvents || !this.takeEvent(event)) {
|
|
1141
1876
|
return;
|
|
1142
1877
|
}
|
|
1878
|
+
if (this.fingerTargets.length > 1) {
|
|
1879
|
+
this.failUnclaimedLoneFingerPans();
|
|
1880
|
+
}
|
|
1143
1881
|
const time = eventTime(event);
|
|
1144
1882
|
const inputs: ArenaBeganInput[] = [];
|
|
1145
1883
|
const untracked: TouchBeganInput[] = [];
|
|
1146
1884
|
const stale: number[] = [];
|
|
1885
|
+
// Locked once the arena knows which recognizers took each finger.
|
|
1886
|
+
const toLock: {
|
|
1887
|
+
id: number;
|
|
1888
|
+
target: EventTarget | null;
|
|
1889
|
+
consumerElement: Element | null;
|
|
1890
|
+
}[] = [];
|
|
1147
1891
|
for (const touch of touchesOf(event.changedTouches)) {
|
|
1148
1892
|
if ((touch as StylusTouch).touchType === 'stylus') {
|
|
1149
1893
|
continue;
|
|
1150
1894
|
}
|
|
1151
1895
|
// A finger number still tracked here began again: the touch it named
|
|
1152
1896
|
// ended where no listener of ours could hear it.
|
|
1897
|
+
this.cancelledFingers.delete(touch.identifier);
|
|
1153
1898
|
const previous = this.forgetFinger(touch.identifier);
|
|
1154
1899
|
if (previous != null) {
|
|
1155
1900
|
stale.push(previous);
|
|
1156
1901
|
}
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1902
|
+
const native =
|
|
1903
|
+
touch.target instanceof Node
|
|
1904
|
+
? landedOn(event, touch.target)
|
|
1905
|
+
: landedOn(event);
|
|
1906
|
+
const target = this.presentedTarget(
|
|
1907
|
+
native,
|
|
1908
|
+
touch.clientX,
|
|
1909
|
+
touch.clientY,
|
|
1910
|
+
event.timeStamp,
|
|
1911
|
+
);
|
|
1912
|
+
const {recognizers, consumer, consumerElement} = this.participantsAt(
|
|
1913
|
+
target,
|
|
1914
|
+
'touch',
|
|
1915
|
+
);
|
|
1159
1916
|
if (recognizers.length === 0 && consumer == null) {
|
|
1160
1917
|
// Nothing here takes part: the touch stays the page's, but a
|
|
1161
1918
|
// recognizer tracking another finger hears it began (a second
|
|
@@ -1172,14 +1929,22 @@ export class GestureHost {
|
|
|
1172
1929
|
}
|
|
1173
1930
|
const id = this.nextId++;
|
|
1174
1931
|
this.touchIds.set(touch.identifier, id);
|
|
1175
|
-
|
|
1932
|
+
if (locksSelectionFor('touch')) {
|
|
1933
|
+
toLock.push({id, target, consumerElement});
|
|
1934
|
+
}
|
|
1935
|
+
// The finger's events keep going to what the engine hit.
|
|
1176
1936
|
this.watchTarget(
|
|
1177
1937
|
touch.identifier,
|
|
1178
|
-
|
|
1179
|
-
recognizers.some(claimsWhileMoving),
|
|
1938
|
+
native,
|
|
1939
|
+
recognizers.some(claimsWhileMoving) || consumer?.keepsTouch != null,
|
|
1940
|
+
consumer != null ||
|
|
1941
|
+
recognizers.some(recognizer => recognizer.claimsTouches),
|
|
1180
1942
|
);
|
|
1181
1943
|
this.lastFed.set(id, {x: touch.clientX, y: touch.clientY, time});
|
|
1182
|
-
this.pairTouch(id, {x: touch.clientX, y: touch.clientY, target});
|
|
1944
|
+
this.pairTouch(id, {x: touch.clientX, y: touch.clientY, target: native});
|
|
1945
|
+
if (target !== native && target != null) {
|
|
1946
|
+
this.retargeted.set(id, {x: touch.clientX, y: touch.clientY, target});
|
|
1947
|
+
}
|
|
1183
1948
|
inputs.push({
|
|
1184
1949
|
id,
|
|
1185
1950
|
x: touch.clientX,
|
|
@@ -1196,18 +1961,31 @@ export class GestureHost {
|
|
|
1196
1961
|
this.arena.cancelled(stale, time);
|
|
1197
1962
|
}
|
|
1198
1963
|
this.arena.began(inputs);
|
|
1964
|
+
for (const {id, target, consumerElement} of toLock) {
|
|
1965
|
+
this.lockSelection(
|
|
1966
|
+
id,
|
|
1967
|
+
this.arena.participantsOf(id),
|
|
1968
|
+
target,
|
|
1969
|
+
this.arena.consumerOf(id) ?? null,
|
|
1970
|
+
consumerElement,
|
|
1971
|
+
);
|
|
1972
|
+
}
|
|
1199
1973
|
for (const input of untracked) {
|
|
1200
1974
|
this.arena.untrackedBegan(input);
|
|
1201
1975
|
}
|
|
1202
1976
|
// Stamped after the consumers judged the touch: the brake asks whether
|
|
1203
1977
|
// an EARLIER finger is still driving a scroll.
|
|
1204
|
-
|
|
1205
|
-
|
|
1978
|
+
const landed = landedOn(event);
|
|
1979
|
+
if (landed instanceof Node) {
|
|
1980
|
+
this.lastTouch = {target: landed, time};
|
|
1206
1981
|
}
|
|
1207
1982
|
};
|
|
1208
1983
|
|
|
1209
1984
|
private readonly onTouchMove = (event: TouchEvent): void => {
|
|
1210
|
-
|
|
1985
|
+
this.noteFingersDown(event);
|
|
1986
|
+
// Where the host reads a finger from its pointer events (no ontouchstart,
|
|
1987
|
+
// as after touch emulation turns on), its Touch Events would track it twice.
|
|
1988
|
+
if (!this.usesTouchEvents || !this.takeEvent(event)) {
|
|
1211
1989
|
return;
|
|
1212
1990
|
}
|
|
1213
1991
|
this.dropFingersNotDown(event);
|
|
@@ -1258,12 +2036,25 @@ export class GestureHost {
|
|
|
1258
2036
|
: touch.scroll.canScroll(0, dy);
|
|
1259
2037
|
});
|
|
1260
2038
|
if (taken.length > 0) {
|
|
1261
|
-
this.
|
|
2039
|
+
this.browserTook(taken, time);
|
|
1262
2040
|
}
|
|
1263
2041
|
}
|
|
1264
|
-
|
|
2042
|
+
// A finger its pointer events sample is fed from there, never from here.
|
|
2043
|
+
this.feedMoves(inputs.filter(input => !this.pointerFed.has(input.id)));
|
|
1265
2044
|
};
|
|
1266
2045
|
|
|
2046
|
+
/** The one blocking `touchmove` handler every claiming element shares. */
|
|
2047
|
+
private readonly onBlockingTouchMove = (event: Event): void => {
|
|
2048
|
+
this.cancelIfClaimed(event as TouchEvent);
|
|
2049
|
+
};
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* Cancel a `touchmove` while a recognizer owns one of its fingers. A touch
|
|
2053
|
+
* no recognizer owns keeps its moves (`spec:AST-094` FR19): nothing is
|
|
2054
|
+
* cancelled before a recognizer begins, or for a touch it does not track,
|
|
2055
|
+
* unless a recognizer holds that finger already (a scroll-edge pan pulling
|
|
2056
|
+
* away from an edge every scroller under it is at; FR19, DEC-18).
|
|
2057
|
+
*/
|
|
1267
2058
|
/**
|
|
1268
2059
|
* Under `inputMode: 'pointer-events'` a finger comes from its pointer
|
|
1269
2060
|
* events, so its touches carry no id of ours: the live finger it is, the
|
|
@@ -1280,10 +2071,11 @@ export class GestureHost {
|
|
|
1280
2071
|
finger.phase === 'cancelled' ||
|
|
1281
2072
|
!(finger.target instanceof Node) ||
|
|
1282
2073
|
!(touch.target instanceof Node) ||
|
|
2074
|
+
// Along the flat tree, both ways: the finger's target can be inside
|
|
2075
|
+
// an open shadow root while its touches reach the host retargeted.
|
|
1283
2076
|
!(
|
|
1284
|
-
finger.target
|
|
1285
|
-
|
|
1286
|
-
touch.target.contains(finger.target)
|
|
2077
|
+
containsAlongFlatTree(finger.target, touch.target) ||
|
|
2078
|
+
containsAlongFlatTree(touch.target, finger.target)
|
|
1287
2079
|
)
|
|
1288
2080
|
) {
|
|
1289
2081
|
continue;
|
|
@@ -1300,33 +2092,41 @@ export class GestureHost {
|
|
|
1300
2092
|
/**
|
|
1301
2093
|
* Cancel the `touchend` of a finger a recognizer owned when it lifted
|
|
1302
2094
|
* (`inputMode: 'pointer-events'`): its `pointerup` came first, at the same
|
|
1303
|
-
* place on the same target (`spec:AST-094` FR21).
|
|
2095
|
+
* place on the same target (`spec:AST-094` FR21). Records older than
|
|
2096
|
+
* CLAIMED_LIFT_MS are dropped first: their touchend never came.
|
|
1304
2097
|
*/
|
|
1305
|
-
private
|
|
1306
|
-
|
|
2098
|
+
private readonly onClaimedTouchEnd = (event: Event): void => {
|
|
2099
|
+
const end = event as TouchEvent;
|
|
2100
|
+
const time = eventTime(end);
|
|
2101
|
+
for (let i = this.claimedLifts.length - 1; i >= 0; i--) {
|
|
2102
|
+
if (time - this.claimedLifts[i].time > CLAIMED_LIFT_MS) {
|
|
2103
|
+
this.claimedLifts.splice(i, 1);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
if (!end.cancelable || end.defaultPrevented) {
|
|
1307
2107
|
return;
|
|
1308
2108
|
}
|
|
1309
|
-
for (const touch of touchesOf(
|
|
2109
|
+
for (const touch of touchesOf(end.changedTouches)) {
|
|
2110
|
+
// As its pointer landed: inside an open shadow root this listener
|
|
2111
|
+
// sees the touch retargeted to the host.
|
|
1310
2112
|
const index = this.claimedLifts.findIndex(lift =>
|
|
1311
2113
|
isSamePlace(lift, {
|
|
1312
2114
|
x: touch.clientX,
|
|
1313
2115
|
y: touch.clientY,
|
|
1314
|
-
target: touch.target,
|
|
2116
|
+
target: landedOn(end, touch.target),
|
|
1315
2117
|
}),
|
|
1316
2118
|
);
|
|
1317
2119
|
if (index >= 0) {
|
|
1318
2120
|
this.claimedLifts.splice(index, 1);
|
|
1319
|
-
|
|
2121
|
+
if (this.claimedLifts.length === 0) {
|
|
2122
|
+
this.clearClaimedLifts();
|
|
2123
|
+
}
|
|
2124
|
+
end.preventDefault();
|
|
1320
2125
|
return;
|
|
1321
2126
|
}
|
|
1322
2127
|
}
|
|
1323
|
-
}
|
|
2128
|
+
};
|
|
1324
2129
|
|
|
1325
|
-
/**
|
|
1326
|
-
* Cancel a `touchmove` while a recognizer owns one of its fingers. A touch
|
|
1327
|
-
* no recognizer owns keeps its moves (`spec:AST-094` FR19): nothing is
|
|
1328
|
-
* cancelled before a recognizer begins, or for a touch it does not track.
|
|
1329
|
-
*/
|
|
1330
2130
|
private cancelIfClaimed(event: TouchEvent): void {
|
|
1331
2131
|
if (!event.cancelable || event.defaultPrevented) {
|
|
1332
2132
|
return;
|
|
@@ -1337,15 +2137,29 @@ export class GestureHost {
|
|
|
1337
2137
|
for (const touch of moved) {
|
|
1338
2138
|
const id =
|
|
1339
2139
|
this.touchIds.get(touch.identifier) ??
|
|
1340
|
-
(
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
if (
|
|
2140
|
+
// Where fingers come from pointer events (inputMode 'pointer-events',
|
|
2141
|
+
// or 'auto' with no ontouchstart), the touch is matched to its pointer.
|
|
2142
|
+
(this.usesTouchEvents ? undefined : this.pointerFingerAt(touch));
|
|
2143
|
+
if (
|
|
2144
|
+
id != null &&
|
|
2145
|
+
(this.arena.isClaimed(id) ||
|
|
2146
|
+
// A kept press keeps its finger under any pointer (FR11, DEC-21).
|
|
2147
|
+
this.arena.consumerOf(id)?.keepsTouch?.(id) === true ||
|
|
2148
|
+
// A recognizer that holds the finger before it begins: a
|
|
2149
|
+
// scroll-edge pan pulling away from an edge (FR19, DEC-18), only
|
|
2150
|
+
// while this is the one finger on the screen: with a second one
|
|
2151
|
+
// down anywhere, even off the recognizer's element, the moves stay
|
|
2152
|
+
// the browser's, for its pinch (FR10).
|
|
2153
|
+
(event.touches.length === 1 &&
|
|
2154
|
+
this.arena
|
|
2155
|
+
.participantsOf(id)
|
|
2156
|
+
.some(recognizer => internals(recognizer).keepsTouch(id))))
|
|
2157
|
+
) {
|
|
1344
2158
|
event.preventDefault();
|
|
1345
2159
|
return;
|
|
1346
2160
|
}
|
|
1347
2161
|
}
|
|
1348
|
-
if (
|
|
2162
|
+
if (hasStylusTouch(event)) {
|
|
1349
2163
|
for (const id of this.pointerIds.values()) {
|
|
1350
2164
|
if (this.arena.isClaimed(id)) {
|
|
1351
2165
|
// A pen whose pointer a recognizer owns: its stylus touches too,
|
|
@@ -1358,39 +2172,92 @@ export class GestureHost {
|
|
|
1358
2172
|
}
|
|
1359
2173
|
|
|
1360
2174
|
private readonly onTouchEnd = (event: TouchEvent): void => {
|
|
1361
|
-
|
|
2175
|
+
this.releaseArmedPress();
|
|
2176
|
+
this.noteFingersDown(event);
|
|
2177
|
+
// Where the host reads a finger from its pointer events (no ontouchstart,
|
|
2178
|
+
// as after touch emulation turns on), its Touch Events would track it twice.
|
|
2179
|
+
if (!this.usesTouchEvents || !this.takeEvent(event)) {
|
|
1362
2180
|
return;
|
|
1363
2181
|
}
|
|
1364
2182
|
this.dropFingersNotDown(event);
|
|
1365
2183
|
const time = eventTime(event);
|
|
1366
2184
|
const inputs: TouchInput[] = [];
|
|
2185
|
+
const retargetedEnds: {
|
|
2186
|
+
id: number;
|
|
2187
|
+
landed: {x: number; y: number; target: EventTarget};
|
|
2188
|
+
x: number;
|
|
2189
|
+
y: number;
|
|
2190
|
+
}[] = [];
|
|
2191
|
+
let isRefused = false;
|
|
1367
2192
|
for (const touch of touchesOf(event.changedTouches)) {
|
|
2193
|
+
if (this.cancelledFingers.delete(touch.identifier)) {
|
|
2194
|
+
isRefused = true;
|
|
2195
|
+
continue;
|
|
2196
|
+
}
|
|
2197
|
+
const tracked = this.touchIds.get(touch.identifier);
|
|
2198
|
+
const landed = tracked == null ? undefined : this.retargeted.get(tracked);
|
|
1368
2199
|
const id = this.forgetFinger(touch.identifier);
|
|
1369
2200
|
if (id == null) {
|
|
1370
2201
|
continue;
|
|
1371
2202
|
}
|
|
1372
2203
|
inputs.push({id, x: touch.clientX, y: touch.clientY, time});
|
|
2204
|
+
if (landed != null) {
|
|
2205
|
+
retargetedEnds.push({id, landed, x: touch.clientX, y: touch.clientY});
|
|
2206
|
+
}
|
|
1373
2207
|
}
|
|
1374
2208
|
// The lift is when momentum starts: the clock the brake wants most.
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
2209
|
+
const landed = landedOn(event);
|
|
2210
|
+
if (landed instanceof Node) {
|
|
2211
|
+
this.lastTouch = {target: landed, time};
|
|
2212
|
+
}
|
|
2213
|
+
const dispositions =
|
|
2214
|
+
inputs.length > 0
|
|
2215
|
+
? this.arena.ended(inputs)
|
|
2216
|
+
: new Map<number, ClickDisposition>();
|
|
2217
|
+
let cancelsClick = isRefused || needsSuppression(dispositions);
|
|
2218
|
+
// A tap sent to what is drawn: the engine's click would hit the layout
|
|
2219
|
+
// position, so it is cancelled and the tap clicks what it touched.
|
|
2220
|
+
for (const end of retargetedEnds) {
|
|
2221
|
+
if (this.clickRetargetedTap(end.landed, end, dispositions.get(end.id))) {
|
|
2222
|
+
cancelsClick = true;
|
|
2223
|
+
}
|
|
1381
2224
|
}
|
|
1382
|
-
|
|
1383
|
-
if (needsSuppression(dispositions)) {
|
|
2225
|
+
if (cancelsClick) {
|
|
1384
2226
|
if (event.cancelable) {
|
|
1385
2227
|
event.preventDefault();
|
|
1386
2228
|
}
|
|
1387
|
-
this.
|
|
2229
|
+
armClickGuard(this.doc);
|
|
1388
2230
|
}
|
|
1389
|
-
this.releaseArmedPress();
|
|
1390
2231
|
};
|
|
1391
2232
|
|
|
2233
|
+
/**
|
|
2234
|
+
* Clicks what a retargeted contact touched if it ended as a tap the
|
|
2235
|
+
* engine would click: nothing claimed it, the browser did not take it
|
|
2236
|
+
* (a taken contact is no longer retargeted), and the finger stayed within
|
|
2237
|
+
* a tap's movement. Returns whether it clicked.
|
|
2238
|
+
*/
|
|
2239
|
+
private clickRetargetedTap(
|
|
2240
|
+
landed: {x: number; y: number; target: EventTarget} | undefined,
|
|
2241
|
+
end: {x: number; y: number},
|
|
2242
|
+
disposition: ClickDisposition | undefined,
|
|
2243
|
+
): boolean {
|
|
2244
|
+
if (landed == null || disposition !== 'allow') {
|
|
2245
|
+
return false;
|
|
2246
|
+
}
|
|
2247
|
+
const moved = Math.hypot(end.x - landed.x, end.y - landed.y);
|
|
2248
|
+
if (moved > UIKIT_TAP.allowableMovement.value) {
|
|
2249
|
+
return false;
|
|
2250
|
+
}
|
|
2251
|
+
this.clickRetargeted(landed.target, end.x, end.y);
|
|
2252
|
+
return true;
|
|
2253
|
+
}
|
|
2254
|
+
|
|
1392
2255
|
private readonly onTouchCancel = (event: TouchEvent): void => {
|
|
1393
|
-
|
|
2256
|
+
this.releaseArmedPress();
|
|
2257
|
+
this.noteFingersDown(event);
|
|
2258
|
+
// Where the host reads a finger from its pointer events (no ontouchstart,
|
|
2259
|
+
// as after touch emulation turns on), its Touch Events would track it twice.
|
|
2260
|
+
if (!this.usesTouchEvents || !this.takeEvent(event)) {
|
|
1394
2261
|
return;
|
|
1395
2262
|
}
|
|
1396
2263
|
const listed = touchesOf(event.changedTouches);
|
|
@@ -1399,6 +2266,12 @@ export class GestureHost {
|
|
|
1399
2266
|
listed.length > 0
|
|
1400
2267
|
? listed.map(touch => touch.identifier)
|
|
1401
2268
|
: [...this.touchIds.keys()];
|
|
2269
|
+
if (listed.length === 0) {
|
|
2270
|
+
this.cancelledFingers.clear();
|
|
2271
|
+
}
|
|
2272
|
+
for (const identifier of identifiers) {
|
|
2273
|
+
this.cancelledFingers.delete(identifier);
|
|
2274
|
+
}
|
|
1402
2275
|
const ids: number[] = [];
|
|
1403
2276
|
for (const identifier of identifiers) {
|
|
1404
2277
|
const id = this.forgetFinger(identifier);
|
|
@@ -1409,7 +2282,6 @@ export class GestureHost {
|
|
|
1409
2282
|
if (ids.length > 0) {
|
|
1410
2283
|
this.arena.cancelled(ids, eventTime(event));
|
|
1411
2284
|
}
|
|
1412
|
-
this.releaseArmedPress();
|
|
1413
2285
|
};
|
|
1414
2286
|
|
|
1415
2287
|
/** The target's own listeners, for a target that left the document. */
|
|
@@ -1427,6 +2299,11 @@ export class GestureHost {
|
|
|
1427
2299
|
this.onTouchEnd(event as TouchEvent);
|
|
1428
2300
|
};
|
|
1429
2301
|
|
|
2302
|
+
/** The same, registered passively for a touch only watchers follow. */
|
|
2303
|
+
private readonly onTargetTouchEndPassive = (event: Event): void => {
|
|
2304
|
+
this.onTouchEnd(event as TouchEvent);
|
|
2305
|
+
};
|
|
2306
|
+
|
|
1430
2307
|
private readonly onTargetTouchCancel = (event: Event): void => {
|
|
1431
2308
|
this.onTouchCancel(event as TouchEvent);
|
|
1432
2309
|
};
|
|
@@ -1437,7 +2314,10 @@ export class GestureHost {
|
|
|
1437
2314
|
* in this very event) ended where we could not see it.
|
|
1438
2315
|
*/
|
|
1439
2316
|
private dropFingersNotDown(event: TouchEvent): void {
|
|
1440
|
-
if (
|
|
2317
|
+
if (
|
|
2318
|
+
event.touches == null ||
|
|
2319
|
+
(this.touchIds.size === 0 && this.cancelledFingers.size === 0)
|
|
2320
|
+
) {
|
|
1441
2321
|
return;
|
|
1442
2322
|
}
|
|
1443
2323
|
const down = new Set<number>();
|
|
@@ -1447,6 +2327,11 @@ export class GestureHost {
|
|
|
1447
2327
|
for (const touch of touchesOf(event.changedTouches)) {
|
|
1448
2328
|
down.add(touch.identifier);
|
|
1449
2329
|
}
|
|
2330
|
+
for (const identifier of [...this.cancelledFingers]) {
|
|
2331
|
+
if (!down.has(identifier)) {
|
|
2332
|
+
this.cancelledFingers.delete(identifier);
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
1450
2335
|
const gone = [...this.touchIds.keys()].filter(
|
|
1451
2336
|
identifier => !down.has(identifier),
|
|
1452
2337
|
);
|
|
@@ -1466,6 +2351,7 @@ export class GestureHost {
|
|
|
1466
2351
|
identifier: number,
|
|
1467
2352
|
target: EventTarget | null,
|
|
1468
2353
|
isBlocking: boolean,
|
|
2354
|
+
isClaiming: boolean,
|
|
1469
2355
|
): void {
|
|
1470
2356
|
if (target == null || typeof target.addEventListener !== 'function') {
|
|
1471
2357
|
return;
|
|
@@ -1473,30 +2359,45 @@ export class GestureHost {
|
|
|
1473
2359
|
this.touchTargets.set(identifier, target);
|
|
1474
2360
|
const state = this.watched.get(target);
|
|
1475
2361
|
if (state == null) {
|
|
1476
|
-
this.watched.set(target, {
|
|
2362
|
+
this.watched.set(target, {
|
|
2363
|
+
count: 1,
|
|
2364
|
+
blocking: isBlocking ? 1 : 0,
|
|
2365
|
+
claiming: isClaiming ? 1 : 0,
|
|
2366
|
+
});
|
|
1477
2367
|
if (isBlocking) {
|
|
1478
2368
|
this.blockingFingers.add(identifier);
|
|
1479
2369
|
}
|
|
2370
|
+
if (isClaiming) {
|
|
2371
|
+
this.claimingFingers.add(identifier);
|
|
2372
|
+
}
|
|
1480
2373
|
target.addEventListener(
|
|
1481
2374
|
'touchmove',
|
|
1482
2375
|
isBlocking ? this.onTargetTouchMove : this.onTargetTouchMovePassive,
|
|
1483
2376
|
{passive: !isBlocking},
|
|
1484
2377
|
);
|
|
1485
|
-
target.addEventListener(
|
|
1486
|
-
|
|
1487
|
-
|
|
2378
|
+
target.addEventListener(
|
|
2379
|
+
'touchend',
|
|
2380
|
+
isClaiming ? this.onTargetTouchEnd : this.onTargetTouchEndPassive,
|
|
2381
|
+
{passive: !isClaiming},
|
|
2382
|
+
);
|
|
1488
2383
|
target.addEventListener('touchcancel', this.onTargetTouchCancel, {
|
|
1489
2384
|
passive: true,
|
|
1490
2385
|
});
|
|
1491
2386
|
return;
|
|
1492
2387
|
}
|
|
1493
2388
|
const wasBlocking = state.blocking > 0;
|
|
2389
|
+
const wasClaiming = state.claiming > 0;
|
|
1494
2390
|
state.count += 1;
|
|
1495
2391
|
if (isBlocking) {
|
|
1496
2392
|
state.blocking += 1;
|
|
1497
2393
|
this.blockingFingers.add(identifier);
|
|
1498
2394
|
}
|
|
2395
|
+
if (isClaiming) {
|
|
2396
|
+
state.claiming += 1;
|
|
2397
|
+
this.claimingFingers.add(identifier);
|
|
2398
|
+
}
|
|
1499
2399
|
this.swapTargetTouchMove(target, wasBlocking, state.blocking > 0);
|
|
2400
|
+
this.swapTargetTouchEnd(target, wasClaiming, state.claiming > 0);
|
|
1500
2401
|
}
|
|
1501
2402
|
|
|
1502
2403
|
private unwatchTarget(identifier: number): void {
|
|
@@ -1510,12 +2411,17 @@ export class GestureHost {
|
|
|
1510
2411
|
return;
|
|
1511
2412
|
}
|
|
1512
2413
|
const wasBlocking = state.blocking > 0;
|
|
2414
|
+
const wasClaiming = state.claiming > 0;
|
|
1513
2415
|
state.count -= 1;
|
|
1514
2416
|
if (this.blockingFingers.delete(identifier)) {
|
|
1515
2417
|
state.blocking -= 1;
|
|
1516
2418
|
}
|
|
2419
|
+
if (this.claimingFingers.delete(identifier)) {
|
|
2420
|
+
state.claiming -= 1;
|
|
2421
|
+
}
|
|
1517
2422
|
if (state.count > 0) {
|
|
1518
2423
|
this.swapTargetTouchMove(target, wasBlocking, state.blocking > 0);
|
|
2424
|
+
this.swapTargetTouchEnd(target, wasClaiming, state.claiming > 0);
|
|
1519
2425
|
return;
|
|
1520
2426
|
}
|
|
1521
2427
|
this.watched.delete(target);
|
|
@@ -1523,7 +2429,10 @@ export class GestureHost {
|
|
|
1523
2429
|
'touchmove',
|
|
1524
2430
|
wasBlocking ? this.onTargetTouchMove : this.onTargetTouchMovePassive,
|
|
1525
2431
|
);
|
|
1526
|
-
target.removeEventListener(
|
|
2432
|
+
target.removeEventListener(
|
|
2433
|
+
'touchend',
|
|
2434
|
+
wasClaiming ? this.onTargetTouchEnd : this.onTargetTouchEndPassive,
|
|
2435
|
+
);
|
|
1527
2436
|
target.removeEventListener('touchcancel', this.onTargetTouchCancel);
|
|
1528
2437
|
}
|
|
1529
2438
|
|
|
@@ -1552,6 +2461,31 @@ export class GestureHost {
|
|
|
1552
2461
|
);
|
|
1553
2462
|
}
|
|
1554
2463
|
|
|
2464
|
+
/**
|
|
2465
|
+
* Keeps one `touchend` listener on a watched target: the cancelable one
|
|
2466
|
+
* while a finger on it has a participant that could claim (a lift whose
|
|
2467
|
+
* click must not happen cancels its `touchend`), a passive one while only
|
|
2468
|
+
* watchers follow its fingers (`spec:AST-094` FR20).
|
|
2469
|
+
*/
|
|
2470
|
+
private swapTargetTouchEnd(
|
|
2471
|
+
target: EventTarget,
|
|
2472
|
+
wasClaiming: boolean,
|
|
2473
|
+
isClaiming: boolean,
|
|
2474
|
+
): void {
|
|
2475
|
+
if (wasClaiming === isClaiming) {
|
|
2476
|
+
return;
|
|
2477
|
+
}
|
|
2478
|
+
target.removeEventListener(
|
|
2479
|
+
'touchend',
|
|
2480
|
+
wasClaiming ? this.onTargetTouchEnd : this.onTargetTouchEndPassive,
|
|
2481
|
+
);
|
|
2482
|
+
target.addEventListener(
|
|
2483
|
+
'touchend',
|
|
2484
|
+
isClaiming ? this.onTargetTouchEnd : this.onTargetTouchEndPassive,
|
|
2485
|
+
{passive: !isClaiming},
|
|
2486
|
+
);
|
|
2487
|
+
}
|
|
2488
|
+
|
|
1555
2489
|
/** Stop tracking a finger by its Touch.identifier; returns its arena id. */
|
|
1556
2490
|
private forgetFinger(identifier: number): number | undefined {
|
|
1557
2491
|
const id = this.touchIds.get(identifier);
|
|
@@ -1568,6 +2502,7 @@ export class GestureHost {
|
|
|
1568
2502
|
if (isSamePlace(pending, place)) {
|
|
1569
2503
|
this.pendingPointers.delete(pointerId);
|
|
1570
2504
|
this.fingerPointers.set(pointerId, id);
|
|
2505
|
+
this.pointerFed.add(id);
|
|
1571
2506
|
return;
|
|
1572
2507
|
}
|
|
1573
2508
|
}
|
|
@@ -1579,23 +2514,18 @@ export class GestureHost {
|
|
|
1579
2514
|
if (isSamePlace(unpaired, place)) {
|
|
1580
2515
|
this.unpairedTouches.delete(id);
|
|
1581
2516
|
this.fingerPointers.set(pointerId, id);
|
|
2517
|
+
this.pointerFed.add(id);
|
|
1582
2518
|
return;
|
|
1583
2519
|
}
|
|
1584
2520
|
}
|
|
1585
2521
|
this.pendingPointers.set(pointerId, place);
|
|
1586
2522
|
}
|
|
1587
2523
|
|
|
1588
|
-
/** Feed moves
|
|
2524
|
+
/** Feed moves from a contact's sampling channel, in time order. */
|
|
1589
2525
|
private feedMoves(inputs: ReadonlyArray<TouchInput>): void {
|
|
1590
2526
|
const fresh = inputs.filter(input => {
|
|
1591
2527
|
const last = this.lastFed.get(input.id);
|
|
1592
|
-
if (
|
|
1593
|
-
last != null &&
|
|
1594
|
-
(input.time < last.time ||
|
|
1595
|
-
(input.time === last.time &&
|
|
1596
|
-
input.x === last.x &&
|
|
1597
|
-
input.y === last.y))
|
|
1598
|
-
) {
|
|
2528
|
+
if (last != null && input.time < last.time) {
|
|
1599
2529
|
return false;
|
|
1600
2530
|
}
|
|
1601
2531
|
this.lastFed.set(input.id, {x: input.x, y: input.y, time: input.time});
|
|
@@ -1606,83 +2536,12 @@ export class GestureHost {
|
|
|
1606
2536
|
}
|
|
1607
2537
|
}
|
|
1608
2538
|
|
|
1609
|
-
/**
|
|
1610
|
-
* For one held press by a finger or a pen: text selection and the touch
|
|
1611
|
-
* callout off on the elements whose hold does something (a long press),
|
|
1612
|
-
* as `holdSelectionStyle` decides (`spec:AST-094` FR41, DEC-9).
|
|
1613
|
-
* Everything else keeps the browser's long-press selection. Restored when
|
|
1614
|
-
* the contact ends; refcounted across contacts on one element.
|
|
1615
|
-
*/
|
|
1616
|
-
private holdSelection(
|
|
1617
|
-
id: number,
|
|
1618
|
-
recognizers: ReadonlyArray<GestureRecognizer>,
|
|
1619
|
-
): void {
|
|
1620
|
-
const elements = new Set<HTMLElement>();
|
|
1621
|
-
for (const recognizer of recognizers) {
|
|
1622
|
-
if (
|
|
1623
|
-
recognizer.view instanceof HTMLElement &&
|
|
1624
|
-
recognizer.isEnabled &&
|
|
1625
|
-
// An element attached with manageStyle: false keeps its own styles.
|
|
1626
|
-
this.registry.get(recognizer.view)?.manageStyle !== false &&
|
|
1627
|
-
holdSelectionStyle([recognizer]) != null
|
|
1628
|
-
) {
|
|
1629
|
-
elements.add(recognizer.view);
|
|
1630
|
-
}
|
|
1631
|
-
}
|
|
1632
|
-
if (elements.size === 0) {
|
|
1633
|
-
return;
|
|
1634
|
-
}
|
|
1635
|
-
const held = [...elements];
|
|
1636
|
-
for (const element of held) {
|
|
1637
|
-
const entry = heldSelection.get(element);
|
|
1638
|
-
if (entry != null) {
|
|
1639
|
-
entry.count += 1;
|
|
1640
|
-
continue;
|
|
1641
|
-
}
|
|
1642
|
-
const saved = HOLD_SELECTION_PROPERTIES.map(name => ({
|
|
1643
|
-
name,
|
|
1644
|
-
value: element.style.getPropertyValue(name),
|
|
1645
|
-
priority: element.style.getPropertyPriority(name),
|
|
1646
|
-
}));
|
|
1647
|
-
for (const name of HOLD_SELECTION_PROPERTIES) {
|
|
1648
|
-
element.style.setProperty(name, 'none');
|
|
1649
|
-
}
|
|
1650
|
-
heldSelection.set(element, {count: 1, saved});
|
|
1651
|
-
}
|
|
1652
|
-
this.heldSelectionBy.set(id, held);
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
/** Undo `holdSelection` for a contact that ended; idempotent. */
|
|
1656
|
-
private releaseSelection(id: number): void {
|
|
1657
|
-
const held = this.heldSelectionBy.get(id);
|
|
1658
|
-
if (held == null) {
|
|
1659
|
-
return;
|
|
1660
|
-
}
|
|
1661
|
-
this.heldSelectionBy.delete(id);
|
|
1662
|
-
for (const element of held) {
|
|
1663
|
-
const entry = heldSelection.get(element);
|
|
1664
|
-
if (entry == null) {
|
|
1665
|
-
continue;
|
|
1666
|
-
}
|
|
1667
|
-
entry.count -= 1;
|
|
1668
|
-
if (entry.count > 0) {
|
|
1669
|
-
continue;
|
|
1670
|
-
}
|
|
1671
|
-
heldSelection.delete(element);
|
|
1672
|
-
for (const {name, value, priority} of entry.saved) {
|
|
1673
|
-
if (value === '') {
|
|
1674
|
-
element.style.removeProperty(name);
|
|
1675
|
-
} else {
|
|
1676
|
-
element.style.setProperty(name, value, priority);
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
2539
|
/** Forget a contact's pairing and echo state. */
|
|
1683
2540
|
private forgetContact(id: number): void {
|
|
1684
|
-
this.
|
|
2541
|
+
this.unlockSelection(id);
|
|
2542
|
+
this.retargeted.delete(id);
|
|
1685
2543
|
this.lastFed.delete(id);
|
|
2544
|
+
this.pointerFed.delete(id);
|
|
1686
2545
|
this.judgedUncancelable.delete(id);
|
|
1687
2546
|
this.unpairedTouches.delete(id);
|
|
1688
2547
|
for (const [pointerId, paired] of this.fingerPointers) {
|
|
@@ -1696,7 +2555,7 @@ export class GestureHost {
|
|
|
1696
2555
|
|
|
1697
2556
|
private readonly onPointerDown = (event: PointerEvent): void => {
|
|
1698
2557
|
// A new press: whatever click is still owed to the last one is not this.
|
|
1699
|
-
this.
|
|
2558
|
+
disarmClickGuard(this.doc);
|
|
1700
2559
|
if (!isPointerKind(event.pointerType)) {
|
|
1701
2560
|
return;
|
|
1702
2561
|
}
|
|
@@ -1704,17 +2563,24 @@ export class GestureHost {
|
|
|
1704
2563
|
this.pairPointer(event.pointerId, {
|
|
1705
2564
|
x: event.clientX,
|
|
1706
2565
|
y: event.clientY,
|
|
1707
|
-
target: event
|
|
2566
|
+
target: landedOn(event),
|
|
1708
2567
|
});
|
|
1709
2568
|
return;
|
|
1710
2569
|
}
|
|
1711
|
-
// A right click, a pen's barrel button
|
|
1712
|
-
// no press (FR43).
|
|
2570
|
+
// A right click, a pen's barrel button, or a ctrl-click on macOS (its
|
|
2571
|
+
// context click) starts no press (FR43).
|
|
1713
2572
|
if (event.pointerType !== 'touch' && !isPrimaryClick(event)) {
|
|
1714
2573
|
return;
|
|
1715
2574
|
}
|
|
1716
|
-
const
|
|
1717
|
-
|
|
2575
|
+
const landed = landedOn(event);
|
|
2576
|
+
const target = this.presentedTarget(
|
|
2577
|
+
landed,
|
|
2578
|
+
event.clientX,
|
|
2579
|
+
event.clientY,
|
|
2580
|
+
event.timeStamp,
|
|
2581
|
+
);
|
|
2582
|
+
const {recognizers, consumer, consumerElement} = this.participantsAt(
|
|
2583
|
+
target,
|
|
1718
2584
|
event.pointerType,
|
|
1719
2585
|
);
|
|
1720
2586
|
if (recognizers.length === 0 && consumer == null) {
|
|
@@ -1722,8 +2588,8 @@ export class GestureHost {
|
|
|
1722
2588
|
}
|
|
1723
2589
|
const id = this.nextId++;
|
|
1724
2590
|
this.pointerIds.set(event.pointerId, id);
|
|
1725
|
-
if (
|
|
1726
|
-
this.
|
|
2591
|
+
if (target !== landed && target != null) {
|
|
2592
|
+
this.retargeted.set(id, {x: event.clientX, y: event.clientY, target});
|
|
1727
2593
|
}
|
|
1728
2594
|
this.arena.began([
|
|
1729
2595
|
{
|
|
@@ -1732,12 +2598,23 @@ export class GestureHost {
|
|
|
1732
2598
|
y: event.clientY,
|
|
1733
2599
|
time: eventTime(event),
|
|
1734
2600
|
pointerType: event.pointerType,
|
|
1735
|
-
target
|
|
1736
|
-
scroll: createNativeScrollProbe(
|
|
2601
|
+
target,
|
|
2602
|
+
scroll: createNativeScrollProbe(target),
|
|
1737
2603
|
recognizers,
|
|
1738
2604
|
consumer,
|
|
1739
2605
|
},
|
|
1740
2606
|
]);
|
|
2607
|
+
if (locksSelectionFor(event.pointerType)) {
|
|
2608
|
+
// The presented target: what the pen is on, where the engine's own
|
|
2609
|
+
// hit test may still see the motion's start.
|
|
2610
|
+
this.lockSelection(
|
|
2611
|
+
id,
|
|
2612
|
+
this.arena.participantsOf(id),
|
|
2613
|
+
target,
|
|
2614
|
+
this.arena.consumerOf(id) ?? null,
|
|
2615
|
+
consumerElement,
|
|
2616
|
+
);
|
|
2617
|
+
}
|
|
1741
2618
|
};
|
|
1742
2619
|
|
|
1743
2620
|
private readonly onPointerMove = (event: PointerEvent): void => {
|
|
@@ -1772,6 +2649,7 @@ export class GestureHost {
|
|
|
1772
2649
|
};
|
|
1773
2650
|
|
|
1774
2651
|
private readonly onPointerUp = (event: PointerEvent): void => {
|
|
2652
|
+
this.releaseArmedPress();
|
|
1775
2653
|
if (event.pointerType === 'touch' && this.usesTouchEvents) {
|
|
1776
2654
|
// The lift itself is the touchend's: it alone can cancel the click.
|
|
1777
2655
|
this.fingerPointers.delete(event.pointerId);
|
|
@@ -1780,31 +2658,96 @@ export class GestureHost {
|
|
|
1780
2658
|
}
|
|
1781
2659
|
const id = this.pointerIds.get(event.pointerId);
|
|
1782
2660
|
if (id == null) {
|
|
1783
|
-
this.releaseArmedPress();
|
|
1784
2661
|
return;
|
|
1785
2662
|
}
|
|
1786
2663
|
this.pointerIds.delete(event.pointerId);
|
|
1787
|
-
this.
|
|
1788
|
-
if (event.pointerType === 'touch' && this.arena.isClaimed(id)) {
|
|
1789
|
-
this.claimedLifts.push({
|
|
1790
|
-
x: event.clientX,
|
|
1791
|
-
y: event.clientY,
|
|
1792
|
-
target: event.target,
|
|
1793
|
-
});
|
|
1794
|
-
if (this.claimedLifts.length > 8) {
|
|
1795
|
-
this.claimedLifts.shift();
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
2664
|
+
this.unlockSelection(id);
|
|
1798
2665
|
const dispositions = this.arena.ended([
|
|
1799
2666
|
{id, x: event.clientX, y: event.clientY, time: eventTime(event)},
|
|
1800
2667
|
]);
|
|
1801
|
-
|
|
1802
|
-
|
|
2668
|
+
// A retargeted tap's own click arms the click guard for the engine's.
|
|
2669
|
+
const landed = this.retargeted.get(id);
|
|
2670
|
+
this.retargeted.delete(id);
|
|
2671
|
+
const clicked = this.clickRetargetedTap(
|
|
2672
|
+
landed,
|
|
2673
|
+
{x: event.clientX, y: event.clientY},
|
|
2674
|
+
dispositions.get(id),
|
|
2675
|
+
);
|
|
2676
|
+
if (!clicked && needsSuppression(dispositions)) {
|
|
2677
|
+
armClickGuard(this.doc);
|
|
2678
|
+
}
|
|
2679
|
+
// A finger read from its pointer events: the touchend that follows the
|
|
2680
|
+
// lift is cancelled when a gesture took it, which the lift itself may
|
|
2681
|
+
// decide (a hold whose time came with it), or when its tap was retargeted
|
|
2682
|
+
// (FR21).
|
|
2683
|
+
if (
|
|
2684
|
+
event.pointerType === 'touch' &&
|
|
2685
|
+
(clicked || needsSuppression(dispositions))
|
|
2686
|
+
) {
|
|
2687
|
+
this.noteClaimedLift(event);
|
|
1803
2688
|
}
|
|
1804
|
-
this.releaseArmedPress();
|
|
1805
2689
|
};
|
|
1806
2690
|
|
|
2691
|
+
/**
|
|
2692
|
+
* Note a claimed finger's lift, so the `touchend` that follows its
|
|
2693
|
+
* `pointerup` is cancelled (FR21). Only where an element's listener can take
|
|
2694
|
+
* that touchend: elsewhere none comes, and the note would hold its node for
|
|
2695
|
+
* nothing. At most CLAIMED_LIFT_LIMIT wait, the oldest going first, and one
|
|
2696
|
+
* timer drops each once CLAIMED_LIFT_MS has passed (FR24); the host's
|
|
2697
|
+
* uninstall keeps them, as it can run in the microtask after the pointerup,
|
|
2698
|
+
* before the touchend that comes later in the same task.
|
|
2699
|
+
*/
|
|
2700
|
+
private noteClaimedLift(event: PointerEvent): void {
|
|
2701
|
+
if (
|
|
2702
|
+
!this.readsFingersFromPointerEvents() ||
|
|
2703
|
+
!(this.isCoarse || this.sendsTouchEvents())
|
|
2704
|
+
) {
|
|
2705
|
+
return;
|
|
2706
|
+
}
|
|
2707
|
+
this.claimedLifts.push({
|
|
2708
|
+
x: event.clientX,
|
|
2709
|
+
y: event.clientY,
|
|
2710
|
+
target: landedOn(event),
|
|
2711
|
+
time: eventTime(event),
|
|
2712
|
+
});
|
|
2713
|
+
if (this.claimedLifts.length > CLAIMED_LIFT_LIMIT) {
|
|
2714
|
+
this.claimedLifts.shift();
|
|
2715
|
+
}
|
|
2716
|
+
this.armClaimedLiftTimer();
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
/** Arm the one timer for the oldest claimed lift still waiting. */
|
|
2720
|
+
private armClaimedLiftTimer(): void {
|
|
2721
|
+
if (this.claimedLiftTimer != null || this.claimedLifts.length === 0) {
|
|
2722
|
+
return;
|
|
2723
|
+
}
|
|
2724
|
+
const due = this.claimedLifts[0].time + CLAIMED_LIFT_MS;
|
|
2725
|
+
this.claimedLiftTimer = this.clock.setTimeout(
|
|
2726
|
+
() => {
|
|
2727
|
+
this.claimedLiftTimer = null;
|
|
2728
|
+
const now = this.clock.now();
|
|
2729
|
+
for (let i = this.claimedLifts.length - 1; i >= 0; i--) {
|
|
2730
|
+
if (now - this.claimedLifts[i].time >= CLAIMED_LIFT_MS) {
|
|
2731
|
+
this.claimedLifts.splice(i, 1);
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
this.armClaimedLiftTimer();
|
|
2735
|
+
},
|
|
2736
|
+
Math.max(0, due - this.clock.now()),
|
|
2737
|
+
);
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/** Drop every claimed lift and its timer, once the last one is taken. */
|
|
2741
|
+
private clearClaimedLifts(): void {
|
|
2742
|
+
this.claimedLifts.length = 0;
|
|
2743
|
+
if (this.claimedLiftTimer != null) {
|
|
2744
|
+
this.clock.clearTimeout(this.claimedLiftTimer);
|
|
2745
|
+
this.claimedLiftTimer = null;
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
|
|
1807
2749
|
private readonly onPointerCancel = (event: PointerEvent): void => {
|
|
2750
|
+
this.releaseArmedPress();
|
|
1808
2751
|
if (event.pointerType === 'touch' && this.usesTouchEvents) {
|
|
1809
2752
|
const id =
|
|
1810
2753
|
this.fingerPointers.get(event.pointerId) ??
|
|
@@ -1812,17 +2755,21 @@ export class GestureHost {
|
|
|
1812
2755
|
this.fingerPointers.delete(event.pointerId);
|
|
1813
2756
|
this.pendingPointers.delete(event.pointerId);
|
|
1814
2757
|
if (id != null) {
|
|
1815
|
-
|
|
2758
|
+
// The pointer channel ends here while the finger keeps moving (the
|
|
2759
|
+
// browser scrolls with it): its touch events, now the only channel,
|
|
2760
|
+
// sample it, as a watcher following the scroll to the lift needs.
|
|
2761
|
+
this.pointerFed.delete(id);
|
|
2762
|
+
this.browserTook([id], eventTime(event));
|
|
1816
2763
|
}
|
|
1817
2764
|
return;
|
|
1818
2765
|
}
|
|
1819
2766
|
const id = this.pointerIds.get(event.pointerId);
|
|
1820
2767
|
if (id != null) {
|
|
1821
2768
|
this.pointerIds.delete(event.pointerId);
|
|
1822
|
-
this.
|
|
2769
|
+
this.unlockSelection(id);
|
|
2770
|
+
this.retargeted.delete(id);
|
|
1823
2771
|
this.arena.cancelled([id], eventTime(event));
|
|
1824
2772
|
}
|
|
1825
|
-
this.releaseArmedPress();
|
|
1826
2773
|
};
|
|
1827
2774
|
|
|
1828
2775
|
/**
|
|
@@ -1839,7 +2786,7 @@ export class GestureHost {
|
|
|
1839
2786
|
touch.pointerType !== 'touch' ||
|
|
1840
2787
|
touch.phase === 'ended' ||
|
|
1841
2788
|
touch.phase === 'cancelled' ||
|
|
1842
|
-
touch.target !== event
|
|
2789
|
+
touch.target !== landedOn(event)
|
|
1843
2790
|
) {
|
|
1844
2791
|
continue;
|
|
1845
2792
|
}
|
|
@@ -1857,54 +2804,29 @@ export class GestureHost {
|
|
|
1857
2804
|
|
|
1858
2805
|
// --- Clicks, menus, scrolls, focus -----------------------------------------
|
|
1859
2806
|
|
|
1860
|
-
private armSwallower(): void {
|
|
1861
|
-
this.swallowDeadline =
|
|
1862
|
-
browserClock.now() + UIKIT_GESTURES.click.strayClickWindow.value;
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
private disarmSwallower(): void {
|
|
1866
|
-
this.swallowDeadline = Number.NEGATIVE_INFINITY;
|
|
1867
|
-
}
|
|
1868
|
-
|
|
1869
|
-
private readonly onClick = (event: MouseEvent): void => {
|
|
1870
|
-
if (browserClock.now() > this.swallowDeadline) {
|
|
1871
|
-
return;
|
|
1872
|
-
}
|
|
1873
|
-
if (!event.isTrusted || event.detail === 0) {
|
|
1874
|
-
return;
|
|
1875
|
-
}
|
|
1876
|
-
if (
|
|
1877
|
-
event.target instanceof Element &&
|
|
1878
|
-
event.target.hasAttribute(HAPTIC_SWITCH_ATTRIBUTE)
|
|
1879
|
-
) {
|
|
1880
|
-
return;
|
|
1881
|
-
}
|
|
1882
|
-
this.disarmSwallower();
|
|
1883
|
-
event.preventDefault();
|
|
1884
|
-
event.stopImmediatePropagation();
|
|
1885
|
-
};
|
|
1886
|
-
|
|
1887
2807
|
private replayClick(touch: GestureTouch, allowed: boolean): void {
|
|
1888
2808
|
if (!allowed) {
|
|
1889
2809
|
return;
|
|
1890
2810
|
}
|
|
1891
2811
|
// The browser's own click was swallowed while recognizers decided; they
|
|
1892
2812
|
// all failed, so the click the touch earned is delivered now.
|
|
1893
|
-
this.
|
|
2813
|
+
disarmClickGuard(this.doc);
|
|
1894
2814
|
const target = touch.target;
|
|
1895
2815
|
const view = this.doc.defaultView;
|
|
1896
2816
|
if (!(target instanceof Element) || !target.isConnected || view == null) {
|
|
1897
2817
|
return;
|
|
1898
2818
|
}
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
2819
|
+
withoutClickGuard(() =>
|
|
2820
|
+
target.dispatchEvent(
|
|
2821
|
+
new view.MouseEvent('click', {
|
|
2822
|
+
bubbles: true,
|
|
2823
|
+
cancelable: true,
|
|
2824
|
+
composed: true,
|
|
2825
|
+
detail: 1,
|
|
2826
|
+
clientX: touch.x,
|
|
2827
|
+
clientY: touch.y,
|
|
2828
|
+
}),
|
|
2829
|
+
),
|
|
1908
2830
|
);
|
|
1909
2831
|
}
|
|
1910
2832
|
|
|
@@ -1925,16 +2847,38 @@ export class GestureHost {
|
|
|
1925
2847
|
* reports itself through pointercancel or touchcancel.
|
|
1926
2848
|
*/
|
|
1927
2849
|
ownScroll(scroller: Node): void {
|
|
1928
|
-
this.
|
|
2850
|
+
const call = ++this.ownScrollCalls;
|
|
2851
|
+
this.ownedScrolls.set(scroller, call);
|
|
1929
2852
|
const view = this.doc.defaultView;
|
|
1930
2853
|
if (view == null) {
|
|
1931
2854
|
return;
|
|
1932
2855
|
}
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
2856
|
+
// A newer call keeps it until its own frame has passed: its frames
|
|
2857
|
+
// replace the older call's.
|
|
2858
|
+
this.ownScrollFrames.get(scroller)?.();
|
|
2859
|
+
let inner = 0;
|
|
2860
|
+
const outer = view.requestAnimationFrame(() => {
|
|
2861
|
+
inner = view.requestAnimationFrame(() => {
|
|
2862
|
+
this.ownScrollFrames.delete(scroller);
|
|
2863
|
+
if (this.ownedScrolls.get(scroller) === call) {
|
|
2864
|
+
this.ownedScrolls.delete(scroller);
|
|
2865
|
+
}
|
|
1936
2866
|
});
|
|
1937
2867
|
});
|
|
2868
|
+
this.ownScrollFrames.set(scroller, () => {
|
|
2869
|
+
view.cancelAnimationFrame(outer);
|
|
2870
|
+
if (inner !== 0) {
|
|
2871
|
+
view.cancelAnimationFrame(inner);
|
|
2872
|
+
}
|
|
2873
|
+
});
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
/**
|
|
2877
|
+
* @internal Whether a recognizer is scrolling `scroller` itself now
|
|
2878
|
+
* (ownScroll): that scroll is not a finger's (fingerScroll.ts reads it).
|
|
2879
|
+
*/
|
|
2880
|
+
isOwnScroll(scroller: Node): boolean {
|
|
2881
|
+
return this.ownedScrolls.has(scroller);
|
|
1938
2882
|
}
|
|
1939
2883
|
|
|
1940
2884
|
private readonly onScroll = (event: Event): void => {
|
|
@@ -1948,8 +2892,8 @@ export class GestureHost {
|
|
|
1948
2892
|
const last = this.lastTouch;
|
|
1949
2893
|
if (
|
|
1950
2894
|
last != null &&
|
|
1951
|
-
time - last.time <
|
|
1952
|
-
scroller
|
|
2895
|
+
time - last.time < UIKIT_PRESS.momentumMemory.value &&
|
|
2896
|
+
containsAlongFlatTree(scroller, last.target)
|
|
1953
2897
|
) {
|
|
1954
2898
|
this.lastScroll = {scroller, time};
|
|
1955
2899
|
}
|
|
@@ -1966,7 +2910,7 @@ export class GestureHost {
|
|
|
1966
2910
|
}
|
|
1967
2911
|
if (
|
|
1968
2912
|
touch.target instanceof Node &&
|
|
1969
|
-
scroller
|
|
2913
|
+
containsAlongFlatTree(scroller, touch.target) &&
|
|
1970
2914
|
// Only a pan this finger drove takes the touch: the browser starts
|
|
1971
2915
|
// one only once the finger has travelled the take distance
|
|
1972
2916
|
// (spec:AST-094 FR20). A scroll under a finger that has not
|
|
@@ -1974,60 +2918,118 @@ export class GestureHost {
|
|
|
1974
2918
|
// anchoring) is the page's own: the touch, and the click it earns,
|
|
1975
2919
|
// stay where they are.
|
|
1976
2920
|
Math.hypot(touch.x - touch.startX, touch.y - touch.startY) >=
|
|
1977
|
-
|
|
2921
|
+
UIKIT_PRESS.slop.value
|
|
1978
2922
|
) {
|
|
1979
2923
|
taken.push(touch.id);
|
|
1980
2924
|
}
|
|
1981
2925
|
}
|
|
1982
2926
|
if (taken.length > 0) {
|
|
1983
|
-
this.
|
|
2927
|
+
this.browserTook(taken, time);
|
|
1984
2928
|
}
|
|
1985
2929
|
};
|
|
1986
2930
|
|
|
2931
|
+
private noteFingersDown(event: TouchEvent): void {
|
|
2932
|
+
const fingers: Node[] = [];
|
|
2933
|
+
for (const touch of touchesOf(event.touches)) {
|
|
2934
|
+
if ((touch as StylusTouch).touchType !== 'stylus') {
|
|
2935
|
+
if (touch.target instanceof Node) {
|
|
2936
|
+
fingers.push(touch.target);
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
this.fingerTargets = fingers;
|
|
2941
|
+
for (const listener of [...this.fingerListeners]) {
|
|
2942
|
+
listener();
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
/**
|
|
2947
|
+
* A second finger landed somewhere (wherever: often on a plain row): a
|
|
2948
|
+
* pan that takes one finger only and has not claimed its touch fails, so
|
|
2949
|
+
* the two fingers stay the browser's pinch (WCAG 1.4.4) instead of the
|
|
2950
|
+
* pan claiming them midway. A drag a recognizer has claimed keeps its
|
|
2951
|
+
* finger: a second finger never cancels or redirects it (`spec:AST-094`
|
|
2952
|
+
* FR10), and no claim is released here.
|
|
2953
|
+
*/
|
|
2954
|
+
private failUnclaimedLoneFingerPans(): void {
|
|
2955
|
+
for (const recognizer of [...this.arena.involvedRecognizers]) {
|
|
2956
|
+
if (
|
|
2957
|
+
isPanRecognizer(recognizer) &&
|
|
2958
|
+
recognizer.state === 'possible' &&
|
|
2959
|
+
recognizer.maximumNumberOfTouches === 1 &&
|
|
2960
|
+
recognizer.trackedTouches.length > 0 &&
|
|
2961
|
+
recognizer.trackedTouches.every(
|
|
2962
|
+
touch =>
|
|
2963
|
+
touch.pointerType === 'touch' && !this.arena.isClaimed(touch.id),
|
|
2964
|
+
)
|
|
2965
|
+
) {
|
|
2966
|
+
recognizer.cancel();
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
|
|
1987
2971
|
private readonly onVisibilityChange = (): void => {
|
|
1988
2972
|
if (this.doc.visibilityState === 'hidden') {
|
|
1989
2973
|
this.cancelEverything(this.arena.now());
|
|
2974
|
+
// As at a blur: the press sends no further pointer event, so an armed
|
|
2975
|
+
// press's page listeners go now (FR24).
|
|
1990
2976
|
this.releaseArmedPress();
|
|
1991
2977
|
}
|
|
1992
2978
|
};
|
|
1993
2979
|
|
|
1994
2980
|
private readonly onBlur = (): void => {
|
|
1995
2981
|
this.cancelEverything(this.arena.now());
|
|
2982
|
+
// The press a blur ends sends no further pointer event: an armed press's
|
|
2983
|
+
// page listeners go now, as at its lift (FR24).
|
|
1996
2984
|
this.releaseArmedPress();
|
|
1997
2985
|
};
|
|
1998
2986
|
|
|
2987
|
+
/** Whether the browser sends Touch Events at all (`ontouchstart`). */
|
|
2988
|
+
private sendsTouchEvents(): boolean {
|
|
2989
|
+
const view = this.doc.defaultView;
|
|
2990
|
+
return view != null && 'ontouchstart' in view;
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
/**
|
|
2994
|
+
* Whether the host reads fingers from their pointer events: Pointer Events
|
|
2995
|
+
* input, or a window with no `ontouchstart` (touch emulation turned on
|
|
2996
|
+
* after load), as the move path does.
|
|
2997
|
+
*/
|
|
2998
|
+
private readsFingersFromPointerEvents(): boolean {
|
|
2999
|
+
const view = this.doc.defaultView;
|
|
3000
|
+
return (
|
|
3001
|
+
this.inputMode === 'pointer-events' ||
|
|
3002
|
+
(view != null && !('ontouchstart' in view))
|
|
3003
|
+
);
|
|
3004
|
+
}
|
|
3005
|
+
|
|
1999
3006
|
/** The app lost focus: UIKit cancels every touch in flight. */
|
|
2000
3007
|
private cancelEverything(time: number): void {
|
|
2001
3008
|
const ids = [...this.pointerIds.values()];
|
|
2002
3009
|
for (const id of ids) {
|
|
2003
|
-
this.
|
|
3010
|
+
this.unlockSelection(id);
|
|
2004
3011
|
}
|
|
2005
3012
|
for (const identifier of [...this.touchIds.keys()]) {
|
|
3013
|
+
// The browser may keep the touch alive: its lift must not click.
|
|
3014
|
+
this.cancelledFingers.add(identifier);
|
|
2006
3015
|
const id = this.forgetFinger(identifier);
|
|
2007
3016
|
if (id != null) {
|
|
2008
3017
|
ids.push(id);
|
|
2009
3018
|
}
|
|
2010
3019
|
}
|
|
2011
3020
|
this.pointerIds.clear();
|
|
3021
|
+
this.retargeted.clear();
|
|
2012
3022
|
this.fingerPointers.clear();
|
|
2013
3023
|
this.pendingPointers.clear();
|
|
2014
3024
|
this.unpairedTouches.clear();
|
|
2015
3025
|
this.lastFed.clear();
|
|
3026
|
+
this.pointerFed.clear();
|
|
2016
3027
|
if (ids.length > 0) {
|
|
2017
3028
|
this.arena.cancelled(ids, time);
|
|
2018
3029
|
}
|
|
2019
3030
|
}
|
|
2020
3031
|
}
|
|
2021
3032
|
|
|
2022
|
-
/** Whether an attachment could take a press now: something on it is enabled. */
|
|
2023
|
-
function isServed(registration: Registration): boolean {
|
|
2024
|
-
return (
|
|
2025
|
-
registration.recognizers.some(r => r.isEnabled) ||
|
|
2026
|
-
(registration.consumer != null &&
|
|
2027
|
-
registration.consumer.isEnabled?.() !== false)
|
|
2028
|
-
);
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
3033
|
function needsSuppression(
|
|
2032
3034
|
dispositions: Map<number, ClickDisposition>,
|
|
2033
3035
|
): boolean {
|
|
@@ -2051,14 +3053,12 @@ function coalescedHistory(event: PointerEvent): TouchSample[] {
|
|
|
2051
3053
|
}));
|
|
2052
3054
|
}
|
|
2053
3055
|
|
|
2054
|
-
const hosts = new WeakMap<Document, GestureHost>();
|
|
2055
|
-
|
|
2056
3056
|
/** The gesture host of a document, created on first use. */
|
|
2057
3057
|
export function getGestureHost(doc: Document): GestureHost {
|
|
2058
|
-
let host =
|
|
3058
|
+
let host = gestureHosts.get(doc);
|
|
2059
3059
|
if (host == null) {
|
|
2060
3060
|
host = new GestureHost(doc);
|
|
2061
|
-
|
|
3061
|
+
gestureHosts.set(doc, host);
|
|
2062
3062
|
}
|
|
2063
3063
|
return host;
|
|
2064
3064
|
}
|