@astryxdesign/core 0.7.11 → 0.7.12-canary.ccb4a6d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell/AppShellMobileContext.d.ts.map +1 -1
- package/dist/AppShell/AppShellMobileContext.js +4 -3
- package/dist/AppShell/useAppShellMainId.d.ts.map +1 -1
- package/dist/AppShell/useAppShellMainId.js +3 -2
- package/dist/Avatar/AvatarSizeContext.d.ts.map +1 -1
- package/dist/Avatar/AvatarSizeContext.js +2 -2
- package/dist/Avatar/AvatarStatusLabelContext.d.ts +2 -2
- package/dist/Avatar/AvatarStatusLabelContext.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusLabelContext.js +3 -3
- package/dist/AvatarGroup/AvatarGroupContext.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupContext.js +2 -2
- package/dist/BottomSheet/BottomSheetHostContext.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetHostContext.js +3 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +48 -4
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcherContext.js +2 -2
- package/dist/BottomSheet/bottomSheetEscape.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetEscape.js +2 -2
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +2 -13
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +25 -42
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +12 -21
- package/dist/Button/buttonHitArea.d.ts.map +1 -1
- package/dist/Button/buttonHitArea.js +3 -3
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +13 -7
- package/dist/ButtonGroup/ButtonGroupContext.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroupContext.js +2 -2
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +24 -15
- package/dist/Chat/ChatContext.d.ts.map +1 -1
- package/dist/Chat/ChatContext.js +6 -5
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +7 -22
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxRowPressContext.js +1 -1
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListContext.js +1 -1
- package/dist/Collapsible/CollapsibleGroupContext.d.ts.map +1 -1
- package/dist/Collapsible/CollapsibleGroupContext.js +3 -3
- package/dist/CommandPalette/CommandPaletteContext.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteContext.js +4 -3
- package/dist/CommandPalette/busyStartSettle.d.ts.map +1 -1
- package/dist/CommandPalette/busyStartSettle.js +2 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +41 -4
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogContext.js +3 -2
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +6 -5
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +4 -15
- package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -1
- package/dist/DropdownMenu/menuRegionStops.js +2 -37
- package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.js +2 -2
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +19 -16
- package/dist/HoverCard/HoverCard.d.ts +1 -2
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +1 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +5 -1
- package/dist/Icon/IconDefaultSizeContext.d.ts.map +1 -1
- package/dist/Icon/IconDefaultSizeContext.js +2 -2
- package/dist/InputGroup/InputGroupContext.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupContext.js +2 -2
- package/dist/InputGroup/InputGroupInternalContext.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupInternalContext.js +2 -2
- package/dist/InteractiveRoleContext/InteractiveRoleContext.d.ts.map +1 -1
- package/dist/InteractiveRoleContext/InteractiveRoleContext.js +5 -3
- package/dist/Item/ItemDescriptionContext.d.ts.map +1 -1
- package/dist/Item/ItemDescriptionContext.js +3 -3
- package/dist/Item/ItemListRowContext.d.ts.map +1 -1
- package/dist/Item/ItemListRowContext.js +3 -3
- package/dist/Item/ItemMarkerColumnsContext.d.ts +1 -1
- package/dist/Item/ItemMarkerColumnsContext.d.ts.map +1 -1
- package/dist/Item/ItemMarkerColumnsContext.js +2 -2
- package/dist/Layer/LayerContext.d.ts.map +1 -1
- package/dist/Layer/LayerContext.js +3 -2
- package/dist/Layer/LayerDepthContext.d.ts.map +1 -1
- package/dist/Layer/LayerDepthContext.js +3 -2
- package/dist/Layer/LayerTouch.d.ts +3 -2
- package/dist/Layer/LayerTouch.d.ts.map +1 -1
- package/dist/Layer/LayerTouch.js +3 -2
- package/dist/Layer/anchorName.d.ts.map +1 -1
- package/dist/Layer/anchorName.js +5 -1
- package/dist/Layer/inputHold.d.ts.map +1 -1
- package/dist/Layer/inputHold.js +115 -13
- package/dist/Layer/layerScopedContext.d.ts +5 -2
- package/dist/Layer/layerScopedContext.d.ts.map +1 -1
- package/dist/Layer/layerScopedContext.js +27 -10
- package/dist/Layer/layerSlideRules.d.ts +28 -26
- package/dist/Layer/layerSlideRules.d.ts.map +1 -1
- package/dist/Layer/layerSlideRules.js +41 -40
- package/dist/Layer/outsidePress.d.ts +21 -3
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +119 -29
- package/dist/Layer/settledBox.d.ts +9 -8
- package/dist/Layer/settledBox.d.ts.map +1 -1
- package/dist/Layer/settledBox.js +169 -49
- package/dist/Layer/toastHost.d.ts.map +1 -1
- package/dist/Layer/toastHost.js +3 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +172 -60
- package/dist/Layer/useLayerKeyboardClearance.d.ts +14 -2
- package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -1
- package/dist/Layer/useLayerKeyboardClearance.js +83 -12
- package/dist/Layer/useTouchTrigger.d.ts +21 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +61 -37
- package/dist/Layout/Layout.d.ts +1 -1
- package/dist/Layout/Layout.d.ts.map +1 -1
- package/dist/Layout/Layout.js +10 -6
- package/dist/Layout/LayoutAreaContext.d.ts.map +1 -1
- package/dist/Layout/LayoutAreaContext.js +3 -3
- package/dist/Layout/LayoutContent.d.ts +6 -6
- package/dist/Layout/LayoutContent.js +9 -9
- package/dist/Layout/LayoutDividerContext.d.ts.map +1 -1
- package/dist/Layout/LayoutDividerContext.js +2 -2
- package/dist/Layout/LayoutSlotsContext.d.ts.map +1 -1
- package/dist/Layout/LayoutSlotsContext.js +2 -2
- package/dist/Link/LinkContext.d.ts +16 -0
- package/dist/Link/LinkContext.d.ts.map +1 -1
- package/dist/Link/LinkContext.js +3 -3
- package/dist/List/List.d.ts +12 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +29 -10
- package/dist/List/ListContext.d.ts +18 -3
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +9 -6
- package/dist/List/ListItem.d.ts +13 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +37 -10
- package/dist/List/listLayoutUpdates.d.ts +34 -0
- package/dist/List/listLayoutUpdates.d.ts.map +1 -0
- package/dist/List/listLayoutUpdates.js +539 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +57 -10
- package/dist/Markdown/blockDirection.d.ts +26 -0
- package/dist/Markdown/blockDirection.d.ts.map +1 -0
- package/dist/Markdown/blockDirection.js +68 -0
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts +3 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.js +3 -1
- package/dist/MetadataList/MetadataListContext.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListContext.js +2 -2
- package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
- package/dist/NavMenu/NavMenuContext.js +5 -4
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +9 -9
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +11 -8
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +2 -2
- package/dist/RadioList/RadioListReasonContext.d.ts.map +1 -1
- package/dist/RadioList/RadioListReasonContext.js +1 -1
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlContext.js +2 -2
- package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -1
- package/dist/SelectableCard/selectableCardInput.js +2 -2
- package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -1
- package/dist/Selector/SelectorRowLayoutContext.js +2 -2
- package/dist/SideNav/SideNavCollapseButton.d.ts +4 -3
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseContext.js +4 -3
- package/dist/SideNav/SideNavFocusTargetsContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavFocusTargetsContext.js +2 -2
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -2
- package/dist/SideNav/SideNavRenderContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavRenderContext.js +4 -3
- package/dist/SideNav/railMotion.d.ts +40 -0
- package/dist/SideNav/railMotion.d.ts.map +1 -1
- package/dist/SideNav/railMotion.js +2 -2
- package/dist/SizeContext/SizeContext.d.ts.map +1 -1
- package/dist/SizeContext/SizeContext.js +2 -2
- package/dist/SnapPaging/SnapPaging.d.ts.map +1 -1
- package/dist/SnapPaging/SnapPaging.js +162 -36
- package/dist/SnapPaging/snapPagingValue.d.ts +29 -3
- package/dist/SnapPaging/snapPagingValue.d.ts.map +1 -1
- package/dist/SnapPaging/snapPagingValue.js +38 -6
- package/dist/Spinner/SpinnerOwnerContext.d.ts.map +1 -1
- package/dist/Spinner/SpinnerOwnerContext.js +2 -2
- package/dist/Stepper/StepperContext.d.ts.map +1 -1
- package/dist/Stepper/StepperContext.js +3 -3
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +8 -3
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +2 -2
- package/dist/Table/BaseTable.d.ts +3 -2
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +73 -16
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +3 -2
- package/dist/Table/TableContext.d.ts.map +1 -1
- package/dist/Table/TableContext.js +2 -2
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +4 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +5 -3
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +16 -18
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +48 -39
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +4 -2
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +3 -2
- package/dist/Table/tableRowContextUsage.d.ts +21 -0
- package/dist/Table/tableRowContextUsage.d.ts.map +1 -0
- package/dist/Table/tableRowContextUsage.js +88 -0
- package/dist/Table/types.d.ts +58 -5
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -2
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +18 -14
- package/dist/Text/TruncationTooltip.d.ts +45 -0
- package/dist/Text/TruncationTooltip.d.ts.map +1 -0
- package/dist/Text/TruncationTooltip.js +123 -0
- package/dist/Text/textClampContext.d.ts.map +1 -1
- package/dist/Text/textClampContext.js +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +4 -0
- package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.js +2 -2
- package/dist/Token/TokenNamingContext.d.ts.map +1 -1
- package/dist/Token/TokenNamingContext.js +2 -2
- package/dist/Tokenizer/TokenizerClearAllMessageContext.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerClearAllMessageContext.js +2 -2
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +12 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +2 -2
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +12 -6
- package/dist/Tooltip/tooltipPresentInterest.d.ts +29 -0
- package/dist/Tooltip/tooltipPresentInterest.d.ts.map +1 -0
- package/dist/Tooltip/tooltipPresentInterest.js +29 -0
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +30 -4
- package/dist/TopNav/TopNavContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavContext.js +2 -2
- package/dist/TopNav/TopNavMobileContentContext.d.ts +1 -1
- package/dist/TopNav/TopNavMobileContentContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavMobileContentContext.js +4 -3
- package/dist/TopNav/TopNavRenderContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavRenderContext.js +4 -3
- package/dist/Typeahead/busyIndicatorLane.d.ts.map +1 -1
- package/dist/Typeahead/busyIndicatorLane.js +3 -2
- package/dist/Typeahead/committedChoicesKey.d.ts.map +1 -1
- package/dist/Typeahead/committedChoicesKey.js +3 -2
- package/dist/Typeahead/trailingKeyDown.d.ts.map +1 -1
- package/dist/Typeahead/trailingKeyDown.js +3 -2
- package/dist/astryx.css +18 -8
- package/dist/gestures/GestureArena.d.ts +2 -0
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +8 -1
- package/dist/gestures/GestureRecognizer.d.ts +6 -0
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +9 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +9 -4
- package/dist/hooks/focusableSelector.d.ts +13 -1
- package/dist/hooks/focusableSelector.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.js +22 -2
- package/dist/hooks/longPressDetector.d.ts.map +1 -1
- package/dist/hooks/longPressDetector.js +1 -25
- package/dist/hooks/pressGroupContext.d.ts.map +1 -1
- package/dist/hooks/pressGroupContext.js +1 -1
- package/dist/hooks/useActionGroupTracking.d.ts +18 -1
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -1
- package/dist/hooks/useActionGroupTracking.js +13 -2
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +3 -2
- package/dist/hooks/useFocusTrap.d.ts +11 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +47 -2
- package/dist/hooks/useListFocus.d.ts +7 -0
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +20 -3
- package/dist/hooks/usePager.d.ts.map +1 -1
- package/dist/hooks/usePager.js +26 -3
- package/dist/hooks/useScrollOverflow.d.ts +22 -0
- package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
- package/dist/hooks/useScrollOverflow.js +67 -11
- package/dist/i18n/InternationalizationContext.d.ts +19 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -3
- package/dist/i18n/englishFallback.d.ts.map +1 -1
- package/dist/i18n/englishFallback.js +5 -1
- package/dist/i18n/firstStrongDirection.d.ts +7 -0
- package/dist/i18n/firstStrongDirection.d.ts.map +1 -0
- package/dist/i18n/firstStrongDirection.js +65 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +1 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +1 -0
- package/dist/internal/scroll-anchoring.d.ts +16 -0
- package/dist/internal/scroll-anchoring.d.ts.map +1 -0
- package/dist/internal/scroll-anchoring.js +16 -0
- package/dist/internal/touch.d.ts +2 -0
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +4 -1
- package/dist/motion/animatedLayout.d.ts +8 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +51 -3
- package/dist/motion/animator.d.ts +19 -2
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +72 -7
- package/dist/privateAttributes/itemKey.stylex.d.ts +5 -0
- package/dist/privateAttributes/itemKey.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/itemKey.stylex.js +25 -0
- package/dist/privateAttributes/leaving.stylex.d.ts +5 -0
- package/dist/privateAttributes/leaving.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/leaving.stylex.js +23 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +13 -3
- package/dist/privateAttributes/scrollAnchoring.stylex.d.ts +7 -0
- package/dist/privateAttributes/scrollAnchoring.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/scrollAnchoring.stylex.js +50 -0
- package/dist/privateAttributes/travelling.stylex.d.ts +27 -0
- package/dist/privateAttributes/travelling.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/travelling.stylex.js +51 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +95 -49
- package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +3 -2
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +3 -2
- package/dist/utils/calendarSystem.d.ts.map +1 -1
- package/dist/utils/calendarSystem.js +4 -1
- package/dist/utils/flatTree.d.ts +13 -0
- package/dist/utils/flatTree.d.ts.map +1 -1
- package/dist/utils/flatTree.js +28 -4
- package/dist/utils/inputAge.d.ts +22 -0
- package/dist/utils/inputAge.d.ts.map +1 -0
- package/dist/utils/inputAge.js +54 -0
- package/dist/utils/inputStream.d.ts +8 -0
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +53 -3
- package/dist/utils/moduleLoader.d.ts +23 -0
- package/dist/utils/moduleLoader.d.ts.map +1 -0
- package/dist/utils/moduleLoader.js +31 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +13 -8
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +7 -14
- package/dist/utils/sharedContext.d.ts +18 -0
- package/dist/utils/sharedContext.d.ts.map +1 -0
- package/dist/utils/sharedContext.js +33 -0
- package/dist/utils/sharedRealm.d.ts +24 -0
- package/dist/utils/sharedRealm.d.ts.map +1 -0
- package/dist/utils/sharedRealm.js +38 -0
- package/locales/en.json +4 -0
- package/locales/pseudo.json +3 -0
- package/package.json +10 -5
- package/src/AppShell/AppShellMobileContext.tsx +8 -3
- package/src/AppShell/useAppShellMainId.ts +7 -2
- package/src/Avatar/AvatarSizeContext.ts +6 -2
- package/src/Avatar/AvatarStatusLabelContext.ts +8 -3
- package/src/AvatarGroup/AvatarGroupContext.ts +7 -4
- package/src/BottomSheet/BottomSheetHostContext.ts +7 -3
- package/src/BottomSheet/BottomSheetPanel.tsx +56 -7
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +7 -2
- package/src/BottomSheet/bottomSheetEscape.ts +6 -2
- package/src/BottomSheet/bottomSheetStack.ts +6 -14
- package/src/BottomSheet/useSheetGestures.ts +28 -48
- package/src/Breadcrumbs/Breadcrumbs.tsx +6 -5
- package/src/Button/Button.doc.mjs +3 -3
- package/src/Button/Button.tsx +10 -22
- package/src/Button/buttonHitArea.ts +7 -4
- package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -3
- package/src/ButtonGroup/ButtonGroup.tsx +27 -16
- package/src/ButtonGroup/ButtonGroupContext.ts +7 -4
- package/src/Carousel/Carousel.tsx +33 -15
- package/src/Chat/ChatContext.tsx +23 -7
- package/src/Chat/useChatStreamScroll.ts +7 -26
- package/src/CheckboxInput/CheckboxRowPressContext.ts +5 -1
- package/src/CheckboxList/CheckboxListContext.tsx +5 -1
- package/src/Collapsible/CollapsibleGroupContext.tsx +11 -3
- package/src/CommandPalette/CommandPaletteContext.ts +8 -3
- package/src/CommandPalette/busyStartSettle.ts +6 -2
- package/src/DateInput/TouchDateField.tsx +62 -4
- package/src/Dialog/DialogContext.ts +7 -2
- package/src/DropdownMenu/DropdownMenuContext.tsx +18 -5
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +6 -18
- package/src/DropdownMenu/menuRegionStops.ts +1 -49
- package/src/FormLayout/FormLayoutContext.ts +3 -3
- package/src/Heading/Heading.tsx +34 -18
- package/src/HoverCard/HoverCard.doc.mjs +3 -3
- package/src/HoverCard/HoverCard.tsx +1 -2
- package/src/HoverCard/useHoverCard.tsx +6 -2
- package/src/Icon/IconDefaultSizeContext.ts +6 -2
- package/src/IconButton/IconButton.doc.mjs +2 -2
- package/src/InputGroup/InputGroupContext.ts +7 -4
- package/src/InputGroup/InputGroupInternalContext.ts +6 -2
- package/src/InteractiveRoleContext/InteractiveRoleContext.ts +8 -3
- package/src/Item/ItemDescriptionContext.tsx +7 -3
- package/src/Item/ItemListRowContext.tsx +7 -3
- package/src/Item/ItemMarkerColumnsContext.tsx +7 -2
- package/src/Layer/LayerContext.ts +7 -2
- package/src/Layer/LayerDepthContext.tsx +3 -2
- package/src/Layer/LayerTouch.ts +6 -2
- package/src/Layer/anchorName.ts +8 -4
- package/src/Layer/inputHold.ts +138 -21
- package/src/Layer/layerScopedContext.tsx +34 -7
- package/src/Layer/layerSlideRules.ts +43 -40
- package/src/Layer/outsidePress.ts +144 -28
- package/src/Layer/settledBox.ts +216 -54
- package/src/Layer/toastHost.tsx +6 -2
- package/src/Layer/useLayer.tsx +200 -69
- package/src/Layer/useLayerKeyboardClearance.ts +90 -12
- package/src/Layer/useTouchTrigger.ts +89 -40
- package/src/Layout/Layout.doc.mjs +17 -0
- package/src/Layout/Layout.tsx +13 -9
- package/src/Layout/LayoutAreaContext.ts +8 -9
- package/src/Layout/LayoutContent.doc.mjs +11 -0
- package/src/Layout/LayoutContent.tsx +9 -9
- package/src/Layout/LayoutDividerContext.ts +6 -2
- package/src/Layout/LayoutSlotsContext.ts +6 -3
- package/src/Link/LinkContext.ts +7 -3
- package/src/List/List.doc.mjs +5 -0
- package/src/List/List.tsx +53 -5
- package/src/List/ListContext.tsx +28 -6
- package/src/List/ListItem.doc.mjs +11 -0
- package/src/List/ListItem.tsx +51 -14
- package/src/List/listLayoutUpdates.ts +603 -0
- package/src/Markdown/Markdown.tsx +93 -5
- package/src/Markdown/blockDirection.ts +100 -0
- package/src/Markdown/plugins/HeadingLinksRenderer.tsx +4 -0
- package/src/MetadataList/MetadataListContext.tsx +6 -2
- package/src/NavMenu/NavMenuContext.tsx +14 -5
- package/src/Popover/Popover.tsx +23 -16
- package/src/Popover/usePopover.tsx +21 -7
- package/src/RadioList/RadioList.tsx +7 -4
- package/src/RadioList/RadioListReasonContext.ts +1 -1
- package/src/Section/Section.doc.mjs +22 -0
- package/src/SegmentedControl/SegmentedControlContext.ts +6 -2
- package/src/SelectableCard/selectableCardInput.ts +6 -2
- package/src/Selector/SelectorRowLayoutContext.ts +6 -2
- package/src/SideNav/SideNavCollapseButton.doc.mjs +5 -5
- package/src/SideNav/SideNavCollapseButton.tsx +4 -3
- package/src/SideNav/SideNavCollapseContext.ts +12 -7
- package/src/SideNav/SideNavFocusTargetsContext.ts +6 -2
- package/src/SideNav/SideNavItem.tsx +6 -2
- package/src/SideNav/SideNavRenderContext.ts +9 -8
- package/src/SideNav/railMotion.ts +6 -2
- package/src/SizeContext/SizeContext.ts +6 -2
- package/src/SnapPaging/SnapPaging.ts +164 -39
- package/src/SnapPaging/snapPagingValue.ts +59 -12
- package/src/Spinner/SpinnerOwnerContext.ts +6 -2
- package/src/Stepper/StepperContext.ts +12 -3
- package/src/Switch/useSwitchTouch.ts +7 -5
- package/src/TabList/TabListContext.ts +7 -2
- package/src/Table/BaseTable.tsx +143 -19
- package/src/Table/Table.tsx +4 -3
- package/src/Table/TableContext.ts +6 -2
- package/src/Table/index.ts +2 -0
- package/src/Table/plugins/filtering/useTableFiltering.tsx +11 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +10 -3
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +38 -29
- package/src/Table/plugins/selection/useTableSelection.tsx +7 -2
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +6 -2
- package/src/Table/tableRowContextUsage.ts +105 -0
- package/src/Table/types.ts +60 -2
- package/src/Table/useBaseTablePlugins.ts +5 -2
- package/src/Table/useTableRowIndex.doc.mjs +6 -7
- package/src/Text/Text.tsx +34 -18
- package/src/Text/TruncationTooltip.tsx +179 -0
- package/src/Text/textClampContext.ts +5 -1
- package/src/TimeInput/TimeInput.tsx +4 -0
- package/src/ToggleButton/ToggleButtonGroup.tsx +6 -2
- package/src/Token/TokenNamingContext.ts +6 -2
- package/src/Tokenizer/TokenizerClearAllMessageContext.ts +4 -4
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +3 -3
- package/src/Toolbar/Toolbar.tsx +16 -9
- package/src/Tooltip/tooltipPresentInterest.ts +43 -0
- package/src/Tooltip/useTooltip.tsx +33 -0
- package/src/TopNav/TopNavContext.ts +6 -2
- package/src/TopNav/TopNavMobileContentContext.ts +8 -3
- package/src/TopNav/TopNavRenderContext.ts +8 -4
- package/src/Typeahead/busyIndicatorLane.tsx +7 -2
- package/src/Typeahead/committedChoicesKey.tsx +4 -3
- package/src/Typeahead/trailingKeyDown.tsx +7 -2
- package/src/gestures/GestureArena.ts +8 -1
- package/src/gestures/GestureRecognizer.ts +9 -0
- package/src/gestures/PressTracker.ts +13 -4
- package/src/hooks/focusableSelector.ts +29 -1
- package/src/hooks/longPressDetector.ts +1 -35
- package/src/hooks/pressGroupContext.ts +5 -1
- package/src/hooks/useActionGroupTracking.ts +29 -2
- package/src/hooks/useAnnounce.ts +8 -4
- package/src/hooks/useFocusTrap.ts +62 -2
- package/src/hooks/useListFocus.ts +34 -7
- package/src/hooks/usePager.ts +30 -3
- package/src/hooks/useScrollOverflow.ts +65 -7
- package/src/i18n/InternationalizationContext.ts +12 -8
- package/src/i18n/englishFallback.ts +7 -1
- package/src/i18n/firstStrongDirection.ts +69 -0
- package/src/i18n/generated-locales/en.generated.ts +1 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
- package/src/internal/scroll-anchoring.ts +16 -0
- package/src/internal/touch.ts +4 -0
- package/src/motion/animatedLayout.ts +44 -3
- package/src/motion/animator.ts +97 -9
- package/src/privateAttributes/itemKey.stylex.ts +25 -0
- package/src/privateAttributes/leaving.stylex.ts +23 -0
- package/src/privateAttributes/press.stylex.ts +19 -7
- package/src/privateAttributes/scrollAnchoring.stylex.ts +50 -0
- package/src/privateAttributes/travelling.stylex.ts +88 -0
- package/src/theme/Theme.tsx +124 -60
- package/src/theme/syntax/SyntaxTheme.tsx +7 -2
- package/src/theme/useTheme.ts +7 -8
- package/src/utils/calendarSystem.ts +7 -1
- package/src/utils/flatTree.ts +31 -4
- package/src/utils/inputAge.ts +66 -0
- package/src/utils/inputStream.ts +52 -3
- package/src/utils/moduleLoader.ts +47 -0
- package/src/utils/pressFeedback.ts +16 -7
- package/src/utils/selectionLock.ts +8 -18
- package/src/utils/sharedContext.ts +42 -0
- package/src/utils/sharedRealm.ts +42 -0
package/dist/Layer/useLayer.js
CHANGED
|
@@ -18,23 +18,26 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
18
18
|
import { createPortal } from 'react-dom';
|
|
19
19
|
import { LayerContentBoundary } from "./layerScopedContext.js";
|
|
20
20
|
import { layerClickBoundary } from "./layerClickBoundary.js";
|
|
21
|
-
import { addAnchorName, removeAnchorName } from "./anchorName.js";
|
|
21
|
+
import { addAnchorName, readAnchorNames, removeAnchorName } from "./anchorName.js";
|
|
22
22
|
import { currentGesture, currentGestureHasClicked } from "./gestureCounter.js";
|
|
23
23
|
import { resolveLayerPortalTarget } from "./layerHost.js";
|
|
24
24
|
import { layerTextReset } from "./layerTextReset.stylex.js";
|
|
25
25
|
import { layerStructureReset } from "./layerStructureReset.stylex.js";
|
|
26
26
|
import "./layerViewportInset.stylex.js";
|
|
27
27
|
import { layerViewportInset } from "./layerViewportInset.stylex.js";
|
|
28
|
-
import { useLayerKeyboardClearance } from "./LayerTouch.js";
|
|
28
|
+
import { keyboardLiftStyle, useLayerKeyboardClearance } from "./LayerTouch.js";
|
|
29
29
|
import { LAYER_ANCHORED_ATTRIBUTE } from "./layerKeyboardClearance.js";
|
|
30
30
|
import { settledBox } from "./settledBox.js";
|
|
31
31
|
import { layerInsetProperties } from "./layerInset.js";
|
|
32
|
-
import { LAYER_CLEARANCE_PROPERTY,
|
|
32
|
+
import { LAYER_CLEARANCE_PROPERTY, LAYER_SCROLLS_ATTRIBUTE, ensureSlideRules, anchorClearAlignment, getAnchorClearFallbacks, slideRuleName } from "./layerSlideRules.js";
|
|
33
33
|
import { afterPopoverOperations, isBrowserHideInFlight, isPopoverOperationInFlight, observeBrowserHide, runPopoverOperation } from "./popoverOperations.js";
|
|
34
34
|
import { preserveAnimations } from "./preserveAnimations.js";
|
|
35
35
|
import { useLayerContext } from "./LayerContext.js";
|
|
36
36
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
37
37
|
import { overlayPaddingReset } from "../Layout/overlayPaddingReset.stylex.js";
|
|
38
|
+
import { containsAlongFlatTree, parentAcrossShadow } from "../utils/flatTree.js";
|
|
39
|
+
import { isShadowRoot } from "../utils/nodeType.js";
|
|
40
|
+
import { subscribeInput } from "../utils/inputStream.js";
|
|
38
41
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
39
42
|
const _temp = {
|
|
40
43
|
keoZOQ: "x1vhfslr",
|
|
@@ -274,37 +277,25 @@ function failsAnchor(layer, anchor) {
|
|
|
274
277
|
}
|
|
275
278
|
|
|
276
279
|
/**
|
|
277
|
-
* For a layer that must never settle over its anchor (spec:AST-059 FR4)
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
* compare a moved anchor with a stale layer. Once switched, a layer keeps its
|
|
293
|
-
* anchor-clear list until it next opens, so it never jumps back over its
|
|
294
|
-
* trigger while open; it is placed afresh (`placeAfresh`) only when the switch
|
|
295
|
-
* does not take effect at once, or when a later read finds it failing again.
|
|
280
|
+
* For a layer that must never settle over its anchor (spec:AST-059 FR4). Every
|
|
281
|
+
* option of its one combined fallback list keeps it clear of its anchor, and
|
|
282
|
+
* the engine picks one. Where the box still covers the anchor or, while the
|
|
283
|
+
* anchor is in view, leaves the viewport on the block axis, the layer is
|
|
284
|
+
* placed afresh (`placeAfresh`) from that list. Then it scrolls only if its
|
|
285
|
+
* content overflows the box it was given (FR3). The runtime calls this in the
|
|
286
|
+
* same task as every show and remount, and while the layer is open whenever
|
|
287
|
+
* its size, its content's size, its anchor's size or the viewport changes;
|
|
288
|
+
* each of those reads lands before the next frame paints. It also runs once
|
|
289
|
+
* in the first frame painted after a scroll of the anchor stops
|
|
290
|
+
* (`observeScrollStop`), because during a scroll the browser does not choose
|
|
291
|
+
* an option again. A same-size anchor that moves on screen, in layout or
|
|
292
|
+
* because something scrolled, is reported after paint by the anchor-move
|
|
293
|
+
* observer. That call does not check the box and never places the layer
|
|
294
|
+
* afresh, so the layer never jumps to another side mid-scroll.
|
|
296
295
|
*/
|
|
297
|
-
function keepAnchorClear(layer, anchor) {
|
|
298
|
-
if (anchor && failsAnchor(layer, anchor)) {
|
|
299
|
-
|
|
300
|
-
layer.setAttribute(LAYER_CLEARS_ANCHOR_ATTRIBUTE, '');
|
|
301
|
-
// A switch usually takes effect at once. The engine may instead keep the
|
|
302
|
-
// option it last used, even one the new list does not contain or one a
|
|
303
|
-
// scroll has since made fail: then, and on any later read that finds the
|
|
304
|
-
// switched layer failing again, place it afresh.
|
|
305
|
-
if (!switching || failsAnchor(layer, anchor)) {
|
|
306
|
-
placeAfresh(layer);
|
|
307
|
-
}
|
|
296
|
+
function keepAnchorClear(layer, anchor, cause = 'change') {
|
|
297
|
+
if (cause === 'change' && anchor && failsAnchor(layer, anchor)) {
|
|
298
|
+
placeAfresh(layer);
|
|
308
299
|
}
|
|
309
300
|
// A layer that fits has no scroll range and stays a plain box, so a wheel
|
|
310
301
|
// over it still scrolls the page.
|
|
@@ -442,21 +433,125 @@ function observeMove(element, onMove) {
|
|
|
442
433
|
return stop;
|
|
443
434
|
}
|
|
444
435
|
|
|
436
|
+
/**
|
|
437
|
+
* How long a scroll must stay still, in ms, to count as stopped where the
|
|
438
|
+
* browser does not fire `scrollend`.
|
|
439
|
+
*/
|
|
440
|
+
const SCROLL_STILL_MS = 150;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* The shadow roots along `node`'s flat-tree path. `scroll` and `scrollend`
|
|
444
|
+
* are not composed, so a scroll inside a shadow tree reaches its shadow root
|
|
445
|
+
* but not the window.
|
|
446
|
+
*/
|
|
447
|
+
function shadowRootsAbove(node) {
|
|
448
|
+
const roots = [];
|
|
449
|
+
for (let current = node; current; current = parentAcrossShadow(current)) {
|
|
450
|
+
const root = current.getRootNode();
|
|
451
|
+
if (isShadowRoot(root) && !roots.includes(root)) {
|
|
452
|
+
roots.push(root);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return roots;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Calls `onStop` once each time a scroll of the page or of an ancestor of
|
|
460
|
+
* `anchor` stops, in the first frame painted after it stops. During a scroll,
|
|
461
|
+
* Chromium does not choose a layer's position option again, so the layer is
|
|
462
|
+
* checked once the scroll stops. A scroll stops at `scrollend`; where the
|
|
463
|
+
* browser does not fire it, a scroll stops after `SCROLL_STILL_MS` with no
|
|
464
|
+
* `scroll` event. A scroll that starts again before the check cancels it. No
|
|
465
|
+
* handler reads layout.
|
|
466
|
+
*/
|
|
467
|
+
function observeScrollStop(view, anchor, onStop) {
|
|
468
|
+
let frame = null;
|
|
469
|
+
let timer = null;
|
|
470
|
+
const cancel = () => {
|
|
471
|
+
if (frame !== null) {
|
|
472
|
+
view.cancelAnimationFrame(frame);
|
|
473
|
+
frame = null;
|
|
474
|
+
}
|
|
475
|
+
if (timer !== null) {
|
|
476
|
+
view.clearTimeout(timer);
|
|
477
|
+
timer = null;
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
// At `scrollend`, and in the frame after it, Chromium still reads the
|
|
481
|
+
// anchored layer at its position before the scroll. After one painted
|
|
482
|
+
// frame it reads the position the scroll gave it.
|
|
483
|
+
const callAfterNextPaint = () => {
|
|
484
|
+
cancel();
|
|
485
|
+
frame = view.requestAnimationFrame(() => {
|
|
486
|
+
frame = null;
|
|
487
|
+
timer = view.setTimeout(() => {
|
|
488
|
+
timer = null;
|
|
489
|
+
frame = view.requestAnimationFrame(() => {
|
|
490
|
+
frame = null;
|
|
491
|
+
onStop();
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
};
|
|
496
|
+
const firesScrollEnd = view.onscrollend !== undefined;
|
|
497
|
+
const isAnchorScroll = event => containsAlongFlatTree(event.target, anchor);
|
|
498
|
+
const onScroll = event => {
|
|
499
|
+
if (!isAnchorScroll(event)) {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
cancel();
|
|
503
|
+
if (!firesScrollEnd) {
|
|
504
|
+
timer = view.setTimeout(() => {
|
|
505
|
+
timer = null;
|
|
506
|
+
callAfterNextPaint();
|
|
507
|
+
}, SCROLL_STILL_MS);
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
const onScrollEnd = event => {
|
|
511
|
+
if (isAnchorScroll(event)) {
|
|
512
|
+
callAfterNextPaint();
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
const unsubscribes = [subscribeInput(view, 'scroll', onScroll)];
|
|
516
|
+
if (firesScrollEnd) {
|
|
517
|
+
unsubscribes.push(subscribeInput(view, 'scrollend', onScrollEnd));
|
|
518
|
+
}
|
|
519
|
+
const listening = {
|
|
520
|
+
capture: true,
|
|
521
|
+
passive: true
|
|
522
|
+
};
|
|
523
|
+
const shadowRoots = shadowRootsAbove(anchor);
|
|
524
|
+
for (const shadowRoot of shadowRoots) {
|
|
525
|
+
shadowRoot.addEventListener('scroll', onScroll, listening);
|
|
526
|
+
if (firesScrollEnd) {
|
|
527
|
+
shadowRoot.addEventListener('scrollend', onScrollEnd, listening);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return () => {
|
|
531
|
+
for (const unsubscribe of unsubscribes) {
|
|
532
|
+
unsubscribe();
|
|
533
|
+
}
|
|
534
|
+
for (const shadowRoot of shadowRoots) {
|
|
535
|
+
shadowRoot.removeEventListener('scroll', onScroll, listening);
|
|
536
|
+
shadowRoot.removeEventListener('scrollend', onScrollEnd, listening);
|
|
537
|
+
}
|
|
538
|
+
cancel();
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
|
|
445
542
|
/**
|
|
446
543
|
* Watch an open layer that keeps its anchor clear, and its anchor, for every
|
|
447
544
|
* change that can re-settle the layer over the anchor or give it a scroll
|
|
448
545
|
* range (spec:AST-059 FR4, FR8): the layer, its content or the anchor
|
|
449
546
|
* resizing (ResizeObserver, before paint), the viewport resizing (before
|
|
450
|
-
* paint),
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
* paints, the fresh placement uses the moved anchor. Reports in one frame
|
|
459
|
-
* share one read. Returns the function that removes every observer and
|
|
547
|
+
* paint), a scroll of the anchor stopping (`observeScrollStop`, in the first
|
|
548
|
+
* frame painted after it), and the anchor moving on screen without resizing,
|
|
549
|
+
* in layout or by a scroll (`observeMove`, reported after paint). Each calls
|
|
550
|
+
* `keepAnchorClear` for this layer and anchor while `isCurrent` says they
|
|
551
|
+
* are still the live pair. A move is handled in the next animation frame, not
|
|
552
|
+
* in the task that reports it, and only updates whether the layer scrolls: it
|
|
553
|
+
* never checks the box and never places the layer afresh. Reports in one
|
|
554
|
+
* frame share one call. Returns the function that removes every observer and
|
|
460
555
|
* listener it added.
|
|
461
556
|
*/
|
|
462
557
|
function observeAnchorClearance(layer, anchor, isCurrent) {
|
|
@@ -464,14 +559,15 @@ function observeAnchorClearance(layer, anchor, isCurrent) {
|
|
|
464
559
|
if (!view) {
|
|
465
560
|
return () => {};
|
|
466
561
|
}
|
|
467
|
-
const reread = () => {
|
|
562
|
+
const reread = (cause = 'change') => {
|
|
468
563
|
if (isCurrent()) {
|
|
469
|
-
keepAnchorClear(layer, anchor);
|
|
564
|
+
keepAnchorClear(layer, anchor, cause);
|
|
470
565
|
}
|
|
471
566
|
};
|
|
567
|
+
const rereadAfterChange = () => reread('change');
|
|
472
568
|
let observer = null;
|
|
473
569
|
if (typeof ResizeObserver !== 'undefined') {
|
|
474
|
-
observer = new ResizeObserver(
|
|
570
|
+
observer = new ResizeObserver(rereadAfterChange);
|
|
475
571
|
observer.observe(layer);
|
|
476
572
|
for (const child of Array.from(layer.children)) {
|
|
477
573
|
observer.observe(child);
|
|
@@ -485,18 +581,20 @@ function observeAnchorClearance(layer, anchor, isCurrent) {
|
|
|
485
581
|
}
|
|
486
582
|
moveFrame = view.requestAnimationFrame(() => {
|
|
487
583
|
moveFrame = null;
|
|
488
|
-
reread();
|
|
584
|
+
reread('move');
|
|
489
585
|
});
|
|
490
586
|
});
|
|
491
|
-
view.addEventListener('resize',
|
|
587
|
+
view.addEventListener('resize', rereadAfterChange);
|
|
588
|
+
const stopObservingScrollStop = observeScrollStop(view, anchor, rereadAfterChange);
|
|
492
589
|
return () => {
|
|
493
590
|
observer?.disconnect();
|
|
494
591
|
stopObservingMove();
|
|
592
|
+
stopObservingScrollStop();
|
|
495
593
|
if (moveFrame !== null) {
|
|
496
594
|
view.cancelAnimationFrame(moveFrame);
|
|
497
595
|
moveFrame = null;
|
|
498
596
|
}
|
|
499
|
-
view.removeEventListener('resize',
|
|
597
|
+
view.removeEventListener('resize', rereadAfterChange);
|
|
500
598
|
};
|
|
501
599
|
}
|
|
502
600
|
|
|
@@ -1019,7 +1117,6 @@ function useLayerImplementation(options) {
|
|
|
1019
1117
|
// before the writes of the show, so the read lays nothing out.
|
|
1020
1118
|
const closeTransitionHolds = closeTransitionKeepsShown(popover);
|
|
1021
1119
|
const closedAnimations = animationNames(popover);
|
|
1022
|
-
popover.removeAttribute(LAYER_CLEARS_ANCHOR_ATTRIBUTE);
|
|
1023
1120
|
popover.removeAttribute(LAYER_SCROLLS_ATTRIBUTE);
|
|
1024
1121
|
applyDeferredWritingContext(popover);
|
|
1025
1122
|
// The trigger takes the layer's anchor name in the task that shows the
|
|
@@ -1203,11 +1300,25 @@ function useLayerImplementation(options) {
|
|
|
1203
1300
|
const handleBeforeToggle = useCallback(e => {
|
|
1204
1301
|
const toggleEvent = e;
|
|
1205
1302
|
const el = e.currentTarget;
|
|
1206
|
-
if (toggleEvent.newState
|
|
1303
|
+
if (toggleEvent.newState !== 'closed' || el == null) {
|
|
1304
|
+
return;
|
|
1305
|
+
}
|
|
1306
|
+
if (isOpenRef.current) {
|
|
1207
1307
|
observeBrowserHide(el);
|
|
1208
1308
|
onCloseStartRef.current?.();
|
|
1309
|
+
// The browser's own close releases the name from its toggle event.
|
|
1310
|
+
return;
|
|
1209
1311
|
}
|
|
1210
|
-
|
|
1312
|
+
// Our hide drops its trigger's anchor name here, inside the hide, so the
|
|
1313
|
+
// hide's own layout covers the change. A name dropped after that layout
|
|
1314
|
+
// costs one more. A layer that the closed state keeps shown keeps the
|
|
1315
|
+
// name until its exit ends.
|
|
1316
|
+
const trigger = triggerRef.current;
|
|
1317
|
+
if (trigger != null && readAnchorNames(trigger).includes(anchorId) && !closeKeepsShownRef.current) {
|
|
1318
|
+
exitRef.current = null;
|
|
1319
|
+
removeAnchorName(trigger, anchorId);
|
|
1320
|
+
}
|
|
1321
|
+
}, [anchorId]);
|
|
1211
1322
|
const handleToggle = useCallback(e => {
|
|
1212
1323
|
const toggleEvent = e;
|
|
1213
1324
|
if (toggleEvent.newState === 'closed' && isOpenRef.current) {
|
|
@@ -1247,6 +1358,7 @@ function useLayerImplementation(options) {
|
|
|
1247
1358
|
// block-start edge and ends clear of the keyboard.
|
|
1248
1359
|
const {
|
|
1249
1360
|
cap: keyboardCap,
|
|
1361
|
+
lift: keyboardLift,
|
|
1250
1362
|
inset: keyboardInset,
|
|
1251
1363
|
followLayerElement
|
|
1252
1364
|
} = useLayerKeyboardClearance(isOpen && mode === 'context', popoverRef);
|
|
@@ -1384,12 +1496,9 @@ function useLayerImplementation(options) {
|
|
|
1384
1496
|
|
|
1385
1497
|
// CSS anchor positioning (dynamic, not in StyleX)
|
|
1386
1498
|
const standardFallbacks = getPositionTryFallbacks(placement, alignment);
|
|
1387
|
-
//
|
|
1388
|
-
//
|
|
1499
|
+
// An above or below layer that keeps its anchor clear uses one combined
|
|
1500
|
+
// list whose options never overlap the anchor (FR4).
|
|
1389
1501
|
const clearFallbacks = keepsAnchorClear && positioning === 'anchor' ? getAnchorClearFallbacks(placement) : '';
|
|
1390
|
-
const clearFallbacksProperty = clearFallbacks ? {
|
|
1391
|
-
[LAYER_CLEAR_FALLBACKS_PROPERTY]: clearFallbacks
|
|
1392
|
-
} : {};
|
|
1393
1502
|
const anchorStyle = positioning === 'custom' ?
|
|
1394
1503
|
// Consumer authors its own position styles via `style` — keep
|
|
1395
1504
|
// only the anchor wiring, derive nothing from placement.
|
|
@@ -1398,7 +1507,10 @@ function useLayerImplementation(options) {
|
|
|
1398
1507
|
} : {
|
|
1399
1508
|
positionAnchor: anchorId,
|
|
1400
1509
|
positionArea: getPositionArea(placement, alignment),
|
|
1401
|
-
positionTryFallbacks: clearFallbacks
|
|
1510
|
+
positionTryFallbacks: clearFallbacks || standardFallbacks,
|
|
1511
|
+
...(clearFallbacks ? {
|
|
1512
|
+
alignSelf: anchorClearAlignment(placement)
|
|
1513
|
+
} : {}),
|
|
1402
1514
|
...getSelfAlignment(placement, alignment, isAnchorInView)
|
|
1403
1515
|
};
|
|
1404
1516
|
const clearance = offset ? toCssLength(offset) : null;
|
|
@@ -1431,8 +1543,8 @@ function useLayerImplementation(options) {
|
|
|
1431
1543
|
style: {
|
|
1432
1544
|
...stylexResult.style,
|
|
1433
1545
|
...anchorStyle,
|
|
1546
|
+
...keyboardLiftStyle(keyboardLift),
|
|
1434
1547
|
...clearanceProperty,
|
|
1435
|
-
...clearFallbacksProperty,
|
|
1436
1548
|
...layerInsetProperties(declaredInset),
|
|
1437
1549
|
...mount.portalStyle,
|
|
1438
1550
|
...extraStyle
|
|
@@ -1452,7 +1564,7 @@ function useLayerImplementation(options) {
|
|
|
1452
1564
|
renderLayer: renderLayer,
|
|
1453
1565
|
sentinelRef: sentinelRefCallback
|
|
1454
1566
|
});
|
|
1455
|
-
}, [anchorId, declaredInset, id, isAnchorInView, keepsAnchorClear, keyboardCap, keyboardInset, lightDismiss, mountStore, popoverRefCallback, sentinelRefCallback]);
|
|
1567
|
+
}, [anchorId, declaredInset, id, isAnchorInView, keepsAnchorClear, keyboardCap, keyboardInset, keyboardLift, lightDismiss, mountStore, popoverRefCallback, sentinelRefCallback]);
|
|
1456
1568
|
|
|
1457
1569
|
// Render function for fixed mode
|
|
1458
1570
|
const renderFixed = useCallback((children, props) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @input Whether an anchor-mode layer is open, its element, and the keyboard
|
|
4
4
|
* module: its one height, and its layout guide for timing.
|
|
5
5
|
* @output Exports `useLayerKeyboardClearance` and its result type,
|
|
6
|
-
* `keyboardClearanceCap`, `LAYER_ANCHORED_ATTRIBUTE`,
|
|
6
|
+
* `keyboardLiftStyle`, `keyboardClearanceCap`, `LAYER_ANCHORED_ATTRIBUTE`,
|
|
7
7
|
* `LAYER_KEYBOARD_CAP_PROPERTY`, `LAYER_KEYBOARD_OVERFLOW_PROPERTY`,
|
|
8
8
|
* `LAYER_KEYBOARD_INSET_PROPERTY` and `LAYER_KEYBOARD_CLEARANCE_PX`
|
|
9
9
|
* @position Layer runtime, through the layer's touch module: the software
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* - /packages/core/src/Selector/hooks.ts
|
|
18
18
|
* - /docs/specs/AST-059-layer-viewport-inset/spec.md
|
|
19
19
|
*/
|
|
20
|
-
import { type RefObject } from 'react';
|
|
20
|
+
import { type CSSProperties, type RefObject } from 'react';
|
|
21
21
|
export { keyboardClearanceCap, LAYER_ANCHORED_ATTRIBUTE, LAYER_KEYBOARD_CLEARANCE_PX, } from './layerKeyboardClearance.js';
|
|
22
22
|
/**
|
|
23
23
|
* The custom property each layer's style sets (useLayer.tsx's `keyboardCap`
|
|
@@ -41,10 +41,22 @@ export declare const LAYER_KEYBOARD_OVERFLOW_PROPERTY = "--_layer-keyboard-overf
|
|
|
41
41
|
* keyboard with it before the cap measures, and stays there.
|
|
42
42
|
*/
|
|
43
43
|
export declare const LAYER_KEYBOARD_INSET_PROPERTY = "--_layer-keyboard-inset-block-end";
|
|
44
|
+
/**
|
|
45
|
+
* The insets that move a capped layer's anchor area `lift` px toward the
|
|
46
|
+
* block-start, or null without a lift. They hold the layer's block-start edge
|
|
47
|
+
* where it was when the cap landed (`LayerKeyboardClearance.lift`).
|
|
48
|
+
*/
|
|
49
|
+
export declare function keyboardLiftStyle(lift: number | null): CSSProperties | null;
|
|
44
50
|
/** What `useLayerKeyboardClearance` gives the layer runtime. */
|
|
45
51
|
export interface LayerKeyboardClearance {
|
|
46
52
|
/** The block size that keeps the layer clear of the keyboard, or null. */
|
|
47
53
|
readonly cap: number | null;
|
|
54
|
+
/**
|
|
55
|
+
* While the cap holds the layer, how far its block-start edge sits above
|
|
56
|
+
* the place the fallback order picks for the shorter box, in px. The
|
|
57
|
+
* runtime applies it with `keyboardLiftStyle`. Otherwise null.
|
|
58
|
+
*/
|
|
59
|
+
readonly lift: number | null;
|
|
48
60
|
/**
|
|
49
61
|
* Once a software keyboard is up, the layout px between the layout
|
|
50
62
|
* viewport's bottom and the line an anchored layer ends above. It keeps its
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayerKeyboardClearance.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayerKeyboardClearance.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"useLayerKeyboardClearance.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayerKeyboardClearance.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAmBf,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,+BAA+B,CAAC;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,sCACL,CAAC;AA8BtC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,GAAG,IAAI,CAE3E;AAED,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,IAAI,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GACtC,sBAAsB,CAmVxB"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @input Whether an anchor-mode layer is open, its element, and the keyboard
|
|
8
8
|
* module: its one height, and its layout guide for timing.
|
|
9
9
|
* @output Exports `useLayerKeyboardClearance` and its result type,
|
|
10
|
-
* `keyboardClearanceCap`, `LAYER_ANCHORED_ATTRIBUTE`,
|
|
10
|
+
* `keyboardLiftStyle`, `keyboardClearanceCap`, `LAYER_ANCHORED_ATTRIBUTE`,
|
|
11
11
|
* `LAYER_KEYBOARD_CAP_PROPERTY`, `LAYER_KEYBOARD_OVERFLOW_PROPERTY`,
|
|
12
12
|
* `LAYER_KEYBOARD_INSET_PROPERTY` and `LAYER_KEYBOARD_CLEARANCE_PX`
|
|
13
13
|
* @position Layer runtime, through the layer's touch module: the software
|
|
@@ -83,6 +83,18 @@ function keepInView(layer, target) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* The insets that move a capped layer's anchor area `lift` px toward the
|
|
88
|
+
* block-start, or null without a lift. They hold the layer's block-start edge
|
|
89
|
+
* where it was when the cap landed (`LayerKeyboardClearance.lift`).
|
|
90
|
+
*/
|
|
91
|
+
export function keyboardLiftStyle(lift) {
|
|
92
|
+
return lift == null ? null : {
|
|
93
|
+
insetBlockStart: -lift,
|
|
94
|
+
insetBlockEnd: lift
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
86
98
|
/** What `useLayerKeyboardClearance` gives the layer runtime. */
|
|
87
99
|
|
|
88
100
|
/**
|
|
@@ -96,9 +108,11 @@ function keepInView(layer, target) {
|
|
|
96
108
|
*/
|
|
97
109
|
export function useLayerKeyboardClearance(isOpen, layerRef) {
|
|
98
110
|
const [cap, setCap] = useState(null);
|
|
111
|
+
const [lift, setLift] = useState(null);
|
|
99
112
|
const [keyboardInset, setKeyboardInset] = useState(null);
|
|
100
113
|
// The cap the layer renders with, read by the measurement between commits.
|
|
101
114
|
const capRef = useRef(null);
|
|
115
|
+
const liftRef = useRef(null);
|
|
102
116
|
const keyboardInsetRef = useRef(null);
|
|
103
117
|
// Set while the layer is open: follows the runtime when it replaces the
|
|
104
118
|
// layer element without closing it.
|
|
@@ -120,29 +134,51 @@ export function useLayerKeyboardClearance(isOpen, layerRef) {
|
|
|
120
134
|
// replace the layer element while it stays open; `sync` moves both to the
|
|
121
135
|
// element the ref holds now.
|
|
122
136
|
let layer = initial;
|
|
137
|
+
// The field reveal after a cap stands down if a person's input reached
|
|
138
|
+
// the layer since the cap.
|
|
139
|
+
let personInputs = 0;
|
|
140
|
+
const notePersonInput = () => {
|
|
141
|
+
personInputs += 1;
|
|
142
|
+
};
|
|
123
143
|
const sync = () => {
|
|
124
144
|
const next = layerRef.current;
|
|
125
145
|
if (next == null || next === layer) {
|
|
126
146
|
return false;
|
|
127
147
|
}
|
|
128
148
|
layer.removeEventListener('pointerdown', handlePress, true);
|
|
149
|
+
layer.removeEventListener('touchstart', notePersonInput, {
|
|
150
|
+
capture: true
|
|
151
|
+
});
|
|
152
|
+
layer.removeEventListener('wheel', notePersonInput, {
|
|
153
|
+
capture: true
|
|
154
|
+
});
|
|
129
155
|
layer = next;
|
|
130
156
|
layer.addEventListener('pointerdown', handlePress, true);
|
|
157
|
+
layer.addEventListener('touchstart', notePersonInput, {
|
|
158
|
+
capture: true,
|
|
159
|
+
passive: true
|
|
160
|
+
});
|
|
161
|
+
layer.addEventListener('wheel', notePersonInput, {
|
|
162
|
+
capture: true,
|
|
163
|
+
passive: true
|
|
164
|
+
});
|
|
131
165
|
return true;
|
|
132
166
|
};
|
|
133
167
|
// Renders the layer with `next` and returns once that commit has laid it
|
|
134
168
|
// out, so the measurement after it reads the new box. Runs outside
|
|
135
169
|
// React's own work: keyboard reports, timers, frames and native events.
|
|
136
|
-
const commitCap = (next, nextInset = keyboardInsetRef.current) => {
|
|
137
|
-
if (isDisposed || capRef.current === next && keyboardInsetRef.current === nextInset) {
|
|
170
|
+
const commitCap = (next, nextInset = keyboardInsetRef.current, nextLift = null) => {
|
|
171
|
+
if (isDisposed || capRef.current === next && keyboardInsetRef.current === nextInset && liftRef.current === nextLift) {
|
|
138
172
|
return;
|
|
139
173
|
}
|
|
140
174
|
capRef.current = next;
|
|
141
175
|
keyboardInsetRef.current = nextInset;
|
|
176
|
+
liftRef.current = nextLift;
|
|
142
177
|
// eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the box is measured at its new size in the same task, before the frame paints
|
|
143
178
|
flushSync(() => {
|
|
144
179
|
setCap(next);
|
|
145
180
|
setKeyboardInset(nextInset);
|
|
181
|
+
setLift(nextLift);
|
|
146
182
|
});
|
|
147
183
|
sync();
|
|
148
184
|
};
|
|
@@ -168,14 +204,24 @@ export function useLayerKeyboardClearance(isOpen, layerRef) {
|
|
|
168
204
|
return false;
|
|
169
205
|
}
|
|
170
206
|
commitCap(height);
|
|
171
|
-
// A layer too tall for the room
|
|
172
|
-
// the trigger, where the viewport fit
|
|
173
|
-
//
|
|
207
|
+
// A layer too tall for the room on both sides of its trigger sits over
|
|
208
|
+
// the trigger, where the viewport fit shifted it. Shorter, it fits below
|
|
209
|
+
// the trigger, and the fallback order moves it down. Lift it back, so it
|
|
210
|
+
// keeps the block-start edge it had when the cap landed. A layer that
|
|
211
|
+
// holds its block-end edge (placed above its trigger) moves only its
|
|
212
|
+
// top, and is not lifted.
|
|
174
213
|
const placed = settledBox(layer);
|
|
175
|
-
if (placed.top > box.top + 1) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
214
|
+
if (placed.top > box.top + 1 && Math.abs(placed.bottom - box.bottom) > 1) {
|
|
215
|
+
commitCap(height, keyboardInsetRef.current, placed.top - box.top);
|
|
216
|
+
// An engine that does not move the layer by the lift leaves it below
|
|
217
|
+
// the trigger: cap it from where it starts there.
|
|
218
|
+
const lifted = settledBox(layer);
|
|
219
|
+
if (Math.abs(lifted.top - box.top) > 1) {
|
|
220
|
+
commitCap(height);
|
|
221
|
+
const again = keyboardClearanceCap(placed, viewport, inset);
|
|
222
|
+
if (again != null) {
|
|
223
|
+
commitCap(again);
|
|
224
|
+
}
|
|
179
225
|
}
|
|
180
226
|
}
|
|
181
227
|
// The cap holds the block-start edge: below its trigger the top stays
|
|
@@ -199,11 +245,16 @@ export function useLayerKeyboardClearance(isOpen, layerRef) {
|
|
|
199
245
|
}
|
|
200
246
|
// The composing component makes its surface a scroll container once it
|
|
201
247
|
// overflows. That comes a frame later, as its observer reports the
|
|
202
|
-
// smaller box. Keep the field being typed into in view after that.
|
|
248
|
+
// smaller box. Keep the field being typed into in view after that. A
|
|
249
|
+
// person who presses, touches or turns a wheel in the layer by then has
|
|
250
|
+
// placed its content, so the reveal stands down. A component's own
|
|
251
|
+
// scroll, such as a list keeping its active option in view, does not
|
|
252
|
+
// stop it. The next cap reveals the field again.
|
|
203
253
|
const focused = layer.ownerDocument.activeElement;
|
|
204
254
|
if (focused != null && focused !== layer && layer.contains(focused)) {
|
|
255
|
+
const inputsAtCap = personInputs;
|
|
205
256
|
win.requestAnimationFrame(() => win.requestAnimationFrame(() => {
|
|
206
|
-
if (!isDisposed) {
|
|
257
|
+
if (!isDisposed && personInputs === inputsAtCap) {
|
|
207
258
|
keepInView(layer, focused);
|
|
208
259
|
}
|
|
209
260
|
}));
|
|
@@ -249,6 +300,7 @@ export function useLayerKeyboardClearance(isOpen, layerRef) {
|
|
|
249
300
|
run?.();
|
|
250
301
|
};
|
|
251
302
|
function handlePress(event) {
|
|
303
|
+
notePersonInput();
|
|
252
304
|
if (pressed.size === 0) {
|
|
253
305
|
follow();
|
|
254
306
|
}
|
|
@@ -268,6 +320,14 @@ export function useLayerKeyboardClearance(isOpen, layerRef) {
|
|
|
268
320
|
});
|
|
269
321
|
}
|
|
270
322
|
layer.addEventListener('pointerdown', handlePress, true);
|
|
323
|
+
layer.addEventListener('touchstart', notePersonInput, {
|
|
324
|
+
capture: true,
|
|
325
|
+
passive: true
|
|
326
|
+
});
|
|
327
|
+
layer.addEventListener('wheel', notePersonInput, {
|
|
328
|
+
capture: true,
|
|
329
|
+
passive: true
|
|
330
|
+
});
|
|
271
331
|
const unsubscribe = guide.subscribe(transition => {
|
|
272
332
|
cancelPending();
|
|
273
333
|
if (transition.animated && transition.to > transition.from) {
|
|
@@ -335,12 +395,22 @@ export function useLayerKeyboardClearance(isOpen, layerRef) {
|
|
|
335
395
|
cancelPending();
|
|
336
396
|
stopWaiting?.();
|
|
337
397
|
layer.removeEventListener('pointerdown', handlePress, true);
|
|
398
|
+
layer.removeEventListener('touchstart', notePersonInput, {
|
|
399
|
+
capture: true
|
|
400
|
+
});
|
|
401
|
+
layer.removeEventListener('wheel', notePersonInput, {
|
|
402
|
+
capture: true
|
|
403
|
+
});
|
|
338
404
|
unfollow();
|
|
339
405
|
// A closed layer reopens at its own size.
|
|
340
406
|
if (capRef.current != null) {
|
|
341
407
|
capRef.current = null;
|
|
342
408
|
setCap(null);
|
|
343
409
|
}
|
|
410
|
+
if (liftRef.current != null) {
|
|
411
|
+
liftRef.current = null;
|
|
412
|
+
setLift(null);
|
|
413
|
+
}
|
|
344
414
|
if (keyboardInsetRef.current != null) {
|
|
345
415
|
keyboardInsetRef.current = null;
|
|
346
416
|
setKeyboardInset(null);
|
|
@@ -352,6 +422,7 @@ export function useLayerKeyboardClearance(isOpen, layerRef) {
|
|
|
352
422
|
}, []);
|
|
353
423
|
return {
|
|
354
424
|
cap: isOpen ? cap : null,
|
|
425
|
+
lift: isOpen ? lift : null,
|
|
355
426
|
inset: isOpen ? keyboardInset : null,
|
|
356
427
|
followLayerElement
|
|
357
428
|
};
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* @file useTouchTrigger.ts
|
|
3
3
|
* @input Touch trigger mode, layer open state, trigger ref, show/hide callbacks
|
|
4
4
|
* @output Exports useTouchTrigger hook, isActionTrigger, LayerTouchTrigger type,
|
|
5
|
-
* tapLandsOnDisabledControl, TOUCH_POINTER_TYPES and
|
|
5
|
+
* tapLandsOnDisabledControl, TOUCH_POINTER_TYPES, useTapRecognizer and
|
|
6
|
+
* useTapStop (internal:
|
|
6
7
|
* not re-exported from index). Also useTouchTriggerInternal, with the
|
|
7
8
|
* outside dismissal's arm for useTooltip's hold (Core-internal).
|
|
8
9
|
* @position Layer hook; shared touch behavior for useTooltip and useHoverCard
|
|
@@ -57,6 +58,20 @@ export type LayerTouchTrigger = 'auto' | 'tap' | 'none';
|
|
|
57
58
|
* once it lands. See `handlePointerEnter`.
|
|
58
59
|
*/
|
|
59
60
|
export declare const TOUCH_POINTER_TYPES: Set<string>;
|
|
61
|
+
/** Waits for the tap that a touch or pen press may become. Internal. */
|
|
62
|
+
export interface TapRecognizer {
|
|
63
|
+
/**
|
|
64
|
+
* Call on every press. A touch or pen press on `trigger` waits for its tap:
|
|
65
|
+
* the press's own `click`. A touch the browser takes for a scroll or a
|
|
66
|
+
* pinch (`pointercancel`) is no tap, and a new press replaces one still
|
|
67
|
+
* waiting. Returns whether the press is touch or pen.
|
|
68
|
+
*/
|
|
69
|
+
press(event: PointerEvent, trigger: Element | null, onTap: (tapEvent: Event) => void): boolean;
|
|
70
|
+
/** Stops waiting for a press still waiting for its tap. */
|
|
71
|
+
forget(): void;
|
|
72
|
+
}
|
|
73
|
+
/** One tap recognizer for a trigger, released on unmount. Internal. */
|
|
74
|
+
export declare function useTapRecognizer(): TapRecognizer;
|
|
60
75
|
export declare function useTapStop(event: 'click'): {
|
|
61
76
|
onPointerDown: (event: ReactPointerEvent<Element>) => void;
|
|
62
77
|
onClick: (event: ReactMouseEvent<Element>) => void;
|
|
@@ -151,6 +166,11 @@ export interface UseTouchTriggerInternalReturn extends UseTouchTriggerReturn {
|
|
|
151
166
|
* hold arms it too.
|
|
152
167
|
*/
|
|
153
168
|
armOutsideDismiss: () => void;
|
|
169
|
+
/**
|
|
170
|
+
* Answers a tap the trigger completed before the layer mounted, by the same
|
|
171
|
+
* rules as a tap it sees, and arms the outside dismissal when it opens.
|
|
172
|
+
*/
|
|
173
|
+
answerTap: (tapEvent: Event | null) => void;
|
|
154
174
|
}
|
|
155
175
|
/**
|
|
156
176
|
* Touch behavior shared by the hover layers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTouchTrigger.d.ts","sourceRoot":"","sources":["../../src/Layer/useTouchTrigger.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"useTouchTrigger.d.ts","sourceRoot":"","sources":["../../src/Layer/useTouchTrigger.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAKL,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,aAA4B,CAAC;AAE7D,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,KAAK,CACH,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,OAAO,GAAG,IAAI,EACvB,KAAK,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,GAC/B,OAAO,CAAC;IACX,2DAA2D;IAC3D,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,IAAI,aAAa,CAKhD;AA2CD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG;IAC1C,aAAa,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3D,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACpD,CAAC;AACF,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG;IAC9C,aAAa,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxD,CAAC;AAwCF;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CA8B7D;AAiBD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAUlE;AAeD,MAAM,WAAW,sBAAsB;IACrC,sDAAsD;IACtD,YAAY,EAAE,iBAAiB,CAAC;IAEhC,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;IAEhB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAEhB,oDAAoD;IACpD,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE1C,uDAAuD;IACvD,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB,mCAAmC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,iBAAiB,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAEtC;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,OAAO,CAAC;IAElC;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAElD;;;;;;OAMG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;IAEpD,gFAAgF;IAChF,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAC1E;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B;;;OAGG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CASvB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,sBAAsB;AAC/B;;;;GAIG;AACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,GAC5B,6BAA6B,CA6M/B"}
|