@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/src/Layer/useLayer.tsx
CHANGED
|
@@ -30,23 +30,21 @@ import type {StyleXStyles} from '@stylexjs/stylex';
|
|
|
30
30
|
import {createPortal} from 'react-dom';
|
|
31
31
|
import {LayerContentBoundary} from './layerScopedContext';
|
|
32
32
|
import {layerClickBoundary} from './layerClickBoundary';
|
|
33
|
-
import {addAnchorName, removeAnchorName} from './anchorName';
|
|
33
|
+
import {addAnchorName, readAnchorNames, removeAnchorName} from './anchorName';
|
|
34
34
|
import {currentGesture, currentGestureHasClicked} from './gestureCounter';
|
|
35
35
|
import {resolveLayerPortalTarget} from './layerHost';
|
|
36
36
|
import {layerTextReset} from './layerTextReset.stylex';
|
|
37
37
|
import {layerStructureReset} from './layerStructureReset.stylex';
|
|
38
38
|
import {layerViewportInset} from './layerViewportInset.stylex';
|
|
39
|
-
import {useLayerKeyboardClearance} from './LayerTouch';
|
|
39
|
+
import {keyboardLiftStyle, useLayerKeyboardClearance} from './LayerTouch';
|
|
40
40
|
import {LAYER_ANCHORED_ATTRIBUTE} from './layerKeyboardClearance';
|
|
41
41
|
import {settledBox} from './settledBox';
|
|
42
42
|
import {layerInsetProperties} from './layerInset';
|
|
43
43
|
import {
|
|
44
44
|
LAYER_CLEARANCE_PROPERTY,
|
|
45
|
-
LAYER_CLEARS_ANCHOR_ATTRIBUTE,
|
|
46
45
|
LAYER_SCROLLS_ATTRIBUTE,
|
|
47
|
-
LAYER_CLEAR_FALLBACKS_PROPERTY,
|
|
48
|
-
LAYER_TRY_FALLBACKS_PROPERTY,
|
|
49
46
|
ensureSlideRules,
|
|
47
|
+
anchorClearAlignment,
|
|
50
48
|
getAnchorClearFallbacks,
|
|
51
49
|
slideRuleName,
|
|
52
50
|
} from './layerSlideRules';
|
|
@@ -61,6 +59,9 @@ import {preserveAnimations} from './preserveAnimations';
|
|
|
61
59
|
import {useLayerContext} from './LayerContext';
|
|
62
60
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
63
61
|
import {overlayPaddingReset} from '../Layout/overlayPaddingReset.stylex';
|
|
62
|
+
import {containsAlongFlatTree, parentAcrossShadow} from '../utils/flatTree';
|
|
63
|
+
import {isShadowRoot} from '../utils/nodeType';
|
|
64
|
+
import {subscribeInput} from '../utils/inputStream';
|
|
64
65
|
|
|
65
66
|
const styles = stylex.create({
|
|
66
67
|
// The software keyboard's block-size cap, on the layer's own element. Every
|
|
@@ -589,37 +590,29 @@ function failsAnchor(layer: HTMLElement, anchor: HTMLElement): boolean {
|
|
|
589
590
|
}
|
|
590
591
|
|
|
591
592
|
/**
|
|
592
|
-
* For a layer that must never settle over its anchor (spec:AST-059 FR4)
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
* compare a moved anchor with a stale layer. Once switched, a layer keeps its
|
|
608
|
-
* anchor-clear list until it next opens, so it never jumps back over its
|
|
609
|
-
* trigger while open; it is placed afresh (`placeAfresh`) only when the switch
|
|
610
|
-
* does not take effect at once, or when a later read finds it failing again.
|
|
593
|
+
* For a layer that must never settle over its anchor (spec:AST-059 FR4). Every
|
|
594
|
+
* option of its one combined fallback list keeps it clear of its anchor, and
|
|
595
|
+
* the engine picks one. Where the box still covers the anchor or, while the
|
|
596
|
+
* anchor is in view, leaves the viewport on the block axis, the layer is
|
|
597
|
+
* placed afresh (`placeAfresh`) from that list. Then it scrolls only if its
|
|
598
|
+
* content overflows the box it was given (FR3). The runtime calls this in the
|
|
599
|
+
* same task as every show and remount, and while the layer is open whenever
|
|
600
|
+
* its size, its content's size, its anchor's size or the viewport changes;
|
|
601
|
+
* each of those reads lands before the next frame paints. It also runs once
|
|
602
|
+
* in the first frame painted after a scroll of the anchor stops
|
|
603
|
+
* (`observeScrollStop`), because during a scroll the browser does not choose
|
|
604
|
+
* an option again. A same-size anchor that moves on screen, in layout or
|
|
605
|
+
* because something scrolled, is reported after paint by the anchor-move
|
|
606
|
+
* observer. That call does not check the box and never places the layer
|
|
607
|
+
* afresh, so the layer never jumps to another side mid-scroll.
|
|
611
608
|
*/
|
|
612
|
-
function keepAnchorClear(
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
// switched layer failing again, place it afresh.
|
|
620
|
-
if (!switching || failsAnchor(layer, anchor)) {
|
|
621
|
-
placeAfresh(layer);
|
|
622
|
-
}
|
|
609
|
+
function keepAnchorClear(
|
|
610
|
+
layer: HTMLElement,
|
|
611
|
+
anchor: HTMLElement | null,
|
|
612
|
+
cause: 'change' | 'move' = 'change',
|
|
613
|
+
): void {
|
|
614
|
+
if (cause === 'change' && anchor && failsAnchor(layer, anchor)) {
|
|
615
|
+
placeAfresh(layer);
|
|
623
616
|
}
|
|
624
617
|
// A layer that fits has no scroll range and stays a plain box, so a wheel
|
|
625
618
|
// over it still scrolls the page.
|
|
@@ -795,21 +788,132 @@ function observeMove(element: HTMLElement, onMove: () => void): () => void {
|
|
|
795
788
|
return stop;
|
|
796
789
|
}
|
|
797
790
|
|
|
791
|
+
/**
|
|
792
|
+
* How long a scroll must stay still, in ms, to count as stopped where the
|
|
793
|
+
* browser does not fire `scrollend`.
|
|
794
|
+
*/
|
|
795
|
+
const SCROLL_STILL_MS = 150;
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* The shadow roots along `node`'s flat-tree path. `scroll` and `scrollend`
|
|
799
|
+
* are not composed, so a scroll inside a shadow tree reaches its shadow root
|
|
800
|
+
* but not the window.
|
|
801
|
+
*/
|
|
802
|
+
function shadowRootsAbove(node: Node): ShadowRoot[] {
|
|
803
|
+
const roots: ShadowRoot[] = [];
|
|
804
|
+
for (
|
|
805
|
+
let current: Node | null = node;
|
|
806
|
+
current;
|
|
807
|
+
current = parentAcrossShadow(current)
|
|
808
|
+
) {
|
|
809
|
+
const root = current.getRootNode();
|
|
810
|
+
if (isShadowRoot(root) && !roots.includes(root)) {
|
|
811
|
+
roots.push(root);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return roots;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Calls `onStop` once each time a scroll of the page or of an ancestor of
|
|
819
|
+
* `anchor` stops, in the first frame painted after it stops. During a scroll,
|
|
820
|
+
* Chromium does not choose a layer's position option again, so the layer is
|
|
821
|
+
* checked once the scroll stops. A scroll stops at `scrollend`; where the
|
|
822
|
+
* browser does not fire it, a scroll stops after `SCROLL_STILL_MS` with no
|
|
823
|
+
* `scroll` event. A scroll that starts again before the check cancels it. No
|
|
824
|
+
* handler reads layout.
|
|
825
|
+
*/
|
|
826
|
+
function observeScrollStop(
|
|
827
|
+
view: Window,
|
|
828
|
+
anchor: HTMLElement,
|
|
829
|
+
onStop: () => void,
|
|
830
|
+
): () => void {
|
|
831
|
+
let frame: number | null = null;
|
|
832
|
+
let timer: number | null = null;
|
|
833
|
+
const cancel = () => {
|
|
834
|
+
if (frame !== null) {
|
|
835
|
+
view.cancelAnimationFrame(frame);
|
|
836
|
+
frame = null;
|
|
837
|
+
}
|
|
838
|
+
if (timer !== null) {
|
|
839
|
+
view.clearTimeout(timer);
|
|
840
|
+
timer = null;
|
|
841
|
+
}
|
|
842
|
+
};
|
|
843
|
+
// At `scrollend`, and in the frame after it, Chromium still reads the
|
|
844
|
+
// anchored layer at its position before the scroll. After one painted
|
|
845
|
+
// frame it reads the position the scroll gave it.
|
|
846
|
+
const callAfterNextPaint = () => {
|
|
847
|
+
cancel();
|
|
848
|
+
frame = view.requestAnimationFrame(() => {
|
|
849
|
+
frame = null;
|
|
850
|
+
timer = view.setTimeout(() => {
|
|
851
|
+
timer = null;
|
|
852
|
+
frame = view.requestAnimationFrame(() => {
|
|
853
|
+
frame = null;
|
|
854
|
+
onStop();
|
|
855
|
+
});
|
|
856
|
+
});
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
const firesScrollEnd =
|
|
860
|
+
(view as {onscrollend?: unknown}).onscrollend !== undefined;
|
|
861
|
+
const isAnchorScroll = (event: Event) =>
|
|
862
|
+
containsAlongFlatTree(event.target as Node, anchor);
|
|
863
|
+
const onScroll = (event: Event) => {
|
|
864
|
+
if (!isAnchorScroll(event)) {
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
cancel();
|
|
868
|
+
if (!firesScrollEnd) {
|
|
869
|
+
timer = view.setTimeout(() => {
|
|
870
|
+
timer = null;
|
|
871
|
+
callAfterNextPaint();
|
|
872
|
+
}, SCROLL_STILL_MS);
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
const onScrollEnd = (event: Event) => {
|
|
876
|
+
if (isAnchorScroll(event)) {
|
|
877
|
+
callAfterNextPaint();
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
const unsubscribes = [subscribeInput(view, 'scroll', onScroll)];
|
|
881
|
+
if (firesScrollEnd) {
|
|
882
|
+
unsubscribes.push(subscribeInput(view, 'scrollend', onScrollEnd));
|
|
883
|
+
}
|
|
884
|
+
const listening = {capture: true, passive: true};
|
|
885
|
+
const shadowRoots = shadowRootsAbove(anchor);
|
|
886
|
+
for (const shadowRoot of shadowRoots) {
|
|
887
|
+
shadowRoot.addEventListener('scroll', onScroll, listening);
|
|
888
|
+
if (firesScrollEnd) {
|
|
889
|
+
shadowRoot.addEventListener('scrollend', onScrollEnd, listening);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
return () => {
|
|
893
|
+
for (const unsubscribe of unsubscribes) {
|
|
894
|
+
unsubscribe();
|
|
895
|
+
}
|
|
896
|
+
for (const shadowRoot of shadowRoots) {
|
|
897
|
+
shadowRoot.removeEventListener('scroll', onScroll, listening);
|
|
898
|
+
shadowRoot.removeEventListener('scrollend', onScrollEnd, listening);
|
|
899
|
+
}
|
|
900
|
+
cancel();
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
|
|
798
904
|
/**
|
|
799
905
|
* Watch an open layer that keeps its anchor clear, and its anchor, for every
|
|
800
906
|
* change that can re-settle the layer over the anchor or give it a scroll
|
|
801
907
|
* range (spec:AST-059 FR4, FR8): the layer, its content or the anchor
|
|
802
908
|
* resizing (ResizeObserver, before paint), the viewport resizing (before
|
|
803
|
-
* paint),
|
|
804
|
-
*
|
|
805
|
-
*
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
809
|
-
*
|
|
810
|
-
*
|
|
811
|
-
* paints, the fresh placement uses the moved anchor. Reports in one frame
|
|
812
|
-
* share one read. Returns the function that removes every observer and
|
|
909
|
+
* paint), a scroll of the anchor stopping (`observeScrollStop`, in the first
|
|
910
|
+
* frame painted after it), and the anchor moving on screen without resizing,
|
|
911
|
+
* in layout or by a scroll (`observeMove`, reported after paint). Each calls
|
|
912
|
+
* `keepAnchorClear` for this layer and anchor while `isCurrent` says they
|
|
913
|
+
* are still the live pair. A move is handled in the next animation frame, not
|
|
914
|
+
* in the task that reports it, and only updates whether the layer scrolls: it
|
|
915
|
+
* never checks the box and never places the layer afresh. Reports in one
|
|
916
|
+
* frame share one call. Returns the function that removes every observer and
|
|
813
917
|
* listener it added.
|
|
814
918
|
*/
|
|
815
919
|
function observeAnchorClearance(
|
|
@@ -821,14 +925,15 @@ function observeAnchorClearance(
|
|
|
821
925
|
if (!view) {
|
|
822
926
|
return () => {};
|
|
823
927
|
}
|
|
824
|
-
const reread = () => {
|
|
928
|
+
const reread = (cause: 'change' | 'move' = 'change') => {
|
|
825
929
|
if (isCurrent()) {
|
|
826
|
-
keepAnchorClear(layer, anchor);
|
|
930
|
+
keepAnchorClear(layer, anchor, cause);
|
|
827
931
|
}
|
|
828
932
|
};
|
|
933
|
+
const rereadAfterChange = () => reread('change');
|
|
829
934
|
let observer: ResizeObserver | null = null;
|
|
830
935
|
if (typeof ResizeObserver !== 'undefined') {
|
|
831
|
-
observer = new ResizeObserver(
|
|
936
|
+
observer = new ResizeObserver(rereadAfterChange);
|
|
832
937
|
observer.observe(layer);
|
|
833
938
|
for (const child of Array.from(layer.children)) {
|
|
834
939
|
observer.observe(child);
|
|
@@ -842,18 +947,24 @@ function observeAnchorClearance(
|
|
|
842
947
|
}
|
|
843
948
|
moveFrame = view.requestAnimationFrame(() => {
|
|
844
949
|
moveFrame = null;
|
|
845
|
-
reread();
|
|
950
|
+
reread('move');
|
|
846
951
|
});
|
|
847
952
|
});
|
|
848
|
-
view.addEventListener('resize',
|
|
953
|
+
view.addEventListener('resize', rereadAfterChange);
|
|
954
|
+
const stopObservingScrollStop = observeScrollStop(
|
|
955
|
+
view,
|
|
956
|
+
anchor,
|
|
957
|
+
rereadAfterChange,
|
|
958
|
+
);
|
|
849
959
|
return () => {
|
|
850
960
|
observer?.disconnect();
|
|
851
961
|
stopObservingMove();
|
|
962
|
+
stopObservingScrollStop();
|
|
852
963
|
if (moveFrame !== null) {
|
|
853
964
|
view.cancelAnimationFrame(moveFrame);
|
|
854
965
|
moveFrame = null;
|
|
855
966
|
}
|
|
856
|
-
view.removeEventListener('resize',
|
|
967
|
+
view.removeEventListener('resize', rereadAfterChange);
|
|
857
968
|
};
|
|
858
969
|
}
|
|
859
970
|
|
|
@@ -1472,7 +1583,6 @@ function useLayerImplementation(
|
|
|
1472
1583
|
// before the writes of the show, so the read lays nothing out.
|
|
1473
1584
|
const closeTransitionHolds = closeTransitionKeepsShown(popover);
|
|
1474
1585
|
const closedAnimations = animationNames(popover);
|
|
1475
|
-
popover.removeAttribute(LAYER_CLEARS_ANCHOR_ATTRIBUTE);
|
|
1476
1586
|
popover.removeAttribute(LAYER_SCROLLS_ATTRIBUTE);
|
|
1477
1587
|
applyDeferredWritingContext(popover);
|
|
1478
1588
|
// The trigger takes the layer's anchor name in the task that shows the
|
|
@@ -1673,14 +1783,35 @@ function useLayerImplementation(
|
|
|
1673
1783
|
// hide starts; the ledger counts the hide from there until the element's
|
|
1674
1784
|
// own `toggle`, independent of this hook's bindings, which a render inside
|
|
1675
1785
|
// the hide can replace.
|
|
1676
|
-
const handleBeforeToggle = useCallback(
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1786
|
+
const handleBeforeToggle = useCallback(
|
|
1787
|
+
(e: Event) => {
|
|
1788
|
+
const toggleEvent = e as ToggleEvent;
|
|
1789
|
+
const el = e.currentTarget as HTMLElement | null;
|
|
1790
|
+
if (toggleEvent.newState !== 'closed' || el == null) {
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
if (isOpenRef.current) {
|
|
1794
|
+
observeBrowserHide(el);
|
|
1795
|
+
onCloseStartRef.current?.();
|
|
1796
|
+
// The browser's own close releases the name from its toggle event.
|
|
1797
|
+
return;
|
|
1798
|
+
}
|
|
1799
|
+
// Our hide drops its trigger's anchor name here, inside the hide, so the
|
|
1800
|
+
// hide's own layout covers the change. A name dropped after that layout
|
|
1801
|
+
// costs one more. A layer that the closed state keeps shown keeps the
|
|
1802
|
+
// name until its exit ends.
|
|
1803
|
+
const trigger = triggerRef.current;
|
|
1804
|
+
if (
|
|
1805
|
+
trigger != null &&
|
|
1806
|
+
readAnchorNames(trigger).includes(anchorId) &&
|
|
1807
|
+
!closeKeepsShownRef.current
|
|
1808
|
+
) {
|
|
1809
|
+
exitRef.current = null;
|
|
1810
|
+
removeAnchorName(trigger, anchorId);
|
|
1811
|
+
}
|
|
1812
|
+
},
|
|
1813
|
+
[anchorId],
|
|
1814
|
+
);
|
|
1684
1815
|
|
|
1685
1816
|
const handleToggle = useCallback(
|
|
1686
1817
|
(e: Event) => {
|
|
@@ -1740,6 +1871,7 @@ function useLayerImplementation(
|
|
|
1740
1871
|
// block-start edge and ends clear of the keyboard.
|
|
1741
1872
|
const {
|
|
1742
1873
|
cap: keyboardCap,
|
|
1874
|
+
lift: keyboardLift,
|
|
1743
1875
|
inset: keyboardInset,
|
|
1744
1876
|
followLayerElement,
|
|
1745
1877
|
} = useLayerKeyboardClearance(isOpen && mode === 'context', popoverRef);
|
|
@@ -1925,15 +2057,12 @@ function useLayerImplementation(
|
|
|
1925
2057
|
|
|
1926
2058
|
// CSS anchor positioning (dynamic, not in StyleX)
|
|
1927
2059
|
const standardFallbacks = getPositionTryFallbacks(placement, alignment);
|
|
1928
|
-
//
|
|
1929
|
-
//
|
|
2060
|
+
// An above or below layer that keeps its anchor clear uses one combined
|
|
2061
|
+
// list whose options never overlap the anchor (FR4).
|
|
1930
2062
|
const clearFallbacks =
|
|
1931
2063
|
keepsAnchorClear && positioning === 'anchor'
|
|
1932
2064
|
? getAnchorClearFallbacks(placement)
|
|
1933
2065
|
: '';
|
|
1934
|
-
const clearFallbacksProperty: Record<string, string> = clearFallbacks
|
|
1935
|
-
? {[LAYER_CLEAR_FALLBACKS_PROPERTY]: clearFallbacks}
|
|
1936
|
-
: {};
|
|
1937
2066
|
const anchorStyle: React.CSSProperties =
|
|
1938
2067
|
positioning === 'custom'
|
|
1939
2068
|
? // Consumer authors its own position styles via `style` — keep
|
|
@@ -1942,9 +2071,10 @@ function useLayerImplementation(
|
|
|
1942
2071
|
: {
|
|
1943
2072
|
positionAnchor: anchorId,
|
|
1944
2073
|
positionArea: getPositionArea(placement, alignment),
|
|
1945
|
-
positionTryFallbacks: clearFallbacks
|
|
1946
|
-
|
|
1947
|
-
:
|
|
2074
|
+
positionTryFallbacks: clearFallbacks || standardFallbacks,
|
|
2075
|
+
...(clearFallbacks
|
|
2076
|
+
? {alignSelf: anchorClearAlignment(placement)}
|
|
2077
|
+
: {}),
|
|
1948
2078
|
...getSelfAlignment(placement, alignment, isAnchorInView),
|
|
1949
2079
|
};
|
|
1950
2080
|
|
|
@@ -2016,8 +2146,8 @@ function useLayerImplementation(
|
|
|
2016
2146
|
style={{
|
|
2017
2147
|
...stylexResult.style,
|
|
2018
2148
|
...anchorStyle,
|
|
2149
|
+
...keyboardLiftStyle(keyboardLift),
|
|
2019
2150
|
...clearanceProperty,
|
|
2020
|
-
...clearFallbacksProperty,
|
|
2021
2151
|
...layerInsetProperties(declaredInset),
|
|
2022
2152
|
...mount.portalStyle,
|
|
2023
2153
|
...extraStyle,
|
|
@@ -2047,6 +2177,7 @@ function useLayerImplementation(
|
|
|
2047
2177
|
keepsAnchorClear,
|
|
2048
2178
|
keyboardCap,
|
|
2049
2179
|
keyboardInset,
|
|
2180
|
+
keyboardLift,
|
|
2050
2181
|
lightDismiss,
|
|
2051
2182
|
mountStore,
|
|
2052
2183
|
popoverRefCallback,
|
|
@@ -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
|
|
@@ -22,7 +22,13 @@
|
|
|
22
22
|
* - /docs/specs/AST-059-layer-viewport-inset/spec.md
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
useCallback,
|
|
27
|
+
useRef,
|
|
28
|
+
useState,
|
|
29
|
+
type CSSProperties,
|
|
30
|
+
type RefObject,
|
|
31
|
+
} from 'react';
|
|
26
32
|
import {flushSync} from 'react-dom';
|
|
27
33
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
28
34
|
// The keyboard module's own files, not its index. The index also re-exports
|
|
@@ -101,10 +107,25 @@ function keepInView(layer: HTMLElement, target: Element) {
|
|
|
101
107
|
}
|
|
102
108
|
}
|
|
103
109
|
|
|
110
|
+
/**
|
|
111
|
+
* The insets that move a capped layer's anchor area `lift` px toward the
|
|
112
|
+
* block-start, or null without a lift. They hold the layer's block-start edge
|
|
113
|
+
* where it was when the cap landed (`LayerKeyboardClearance.lift`).
|
|
114
|
+
*/
|
|
115
|
+
export function keyboardLiftStyle(lift: number | null): CSSProperties | null {
|
|
116
|
+
return lift == null ? null : {insetBlockStart: -lift, insetBlockEnd: lift};
|
|
117
|
+
}
|
|
118
|
+
|
|
104
119
|
/** What `useLayerKeyboardClearance` gives the layer runtime. */
|
|
105
120
|
export interface LayerKeyboardClearance {
|
|
106
121
|
/** The block size that keeps the layer clear of the keyboard, or null. */
|
|
107
122
|
readonly cap: number | null;
|
|
123
|
+
/**
|
|
124
|
+
* While the cap holds the layer, how far its block-start edge sits above
|
|
125
|
+
* the place the fallback order picks for the shorter box, in px. The
|
|
126
|
+
* runtime applies it with `keyboardLiftStyle`. Otherwise null.
|
|
127
|
+
*/
|
|
128
|
+
readonly lift: number | null;
|
|
108
129
|
/**
|
|
109
130
|
* Once a software keyboard is up, the layout px between the layout
|
|
110
131
|
* viewport's bottom and the line an anchored layer ends above. It keeps its
|
|
@@ -132,9 +153,11 @@ export function useLayerKeyboardClearance(
|
|
|
132
153
|
layerRef: RefObject<HTMLElement | null>,
|
|
133
154
|
): LayerKeyboardClearance {
|
|
134
155
|
const [cap, setCap] = useState<number | null>(null);
|
|
156
|
+
const [lift, setLift] = useState<number | null>(null);
|
|
135
157
|
const [keyboardInset, setKeyboardInset] = useState<number | null>(null);
|
|
136
158
|
// The cap the layer renders with, read by the measurement between commits.
|
|
137
159
|
const capRef = useRef<number | null>(null);
|
|
160
|
+
const liftRef = useRef<number | null>(null);
|
|
138
161
|
const keyboardInsetRef = useRef<number | null>(null);
|
|
139
162
|
// Set while the layer is open: follows the runtime when it replaces the
|
|
140
163
|
// layer element without closing it.
|
|
@@ -156,14 +179,30 @@ export function useLayerKeyboardClearance(
|
|
|
156
179
|
// replace the layer element while it stays open; `sync` moves both to the
|
|
157
180
|
// element the ref holds now.
|
|
158
181
|
let layer: HTMLElement = initial;
|
|
182
|
+
// The field reveal after a cap stands down if a person's input reached
|
|
183
|
+
// the layer since the cap.
|
|
184
|
+
let personInputs = 0;
|
|
185
|
+
const notePersonInput = () => {
|
|
186
|
+
personInputs += 1;
|
|
187
|
+
};
|
|
159
188
|
const sync = (): boolean => {
|
|
160
189
|
const next = layerRef.current;
|
|
161
190
|
if (next == null || next === layer) {
|
|
162
191
|
return false;
|
|
163
192
|
}
|
|
164
193
|
layer.removeEventListener('pointerdown', handlePress, true);
|
|
194
|
+
layer.removeEventListener('touchstart', notePersonInput, {capture: true});
|
|
195
|
+
layer.removeEventListener('wheel', notePersonInput, {capture: true});
|
|
165
196
|
layer = next;
|
|
166
197
|
layer.addEventListener('pointerdown', handlePress, true);
|
|
198
|
+
layer.addEventListener('touchstart', notePersonInput, {
|
|
199
|
+
capture: true,
|
|
200
|
+
passive: true,
|
|
201
|
+
});
|
|
202
|
+
layer.addEventListener('wheel', notePersonInput, {
|
|
203
|
+
capture: true,
|
|
204
|
+
passive: true,
|
|
205
|
+
});
|
|
167
206
|
return true;
|
|
168
207
|
};
|
|
169
208
|
// Renders the layer with `next` and returns once that commit has laid it
|
|
@@ -172,19 +211,24 @@ export function useLayerKeyboardClearance(
|
|
|
172
211
|
const commitCap = (
|
|
173
212
|
next: number | null,
|
|
174
213
|
nextInset = keyboardInsetRef.current,
|
|
214
|
+
nextLift: number | null = null,
|
|
175
215
|
) => {
|
|
176
216
|
if (
|
|
177
217
|
isDisposed ||
|
|
178
|
-
(capRef.current === next &&
|
|
218
|
+
(capRef.current === next &&
|
|
219
|
+
keyboardInsetRef.current === nextInset &&
|
|
220
|
+
liftRef.current === nextLift)
|
|
179
221
|
) {
|
|
180
222
|
return;
|
|
181
223
|
}
|
|
182
224
|
capRef.current = next;
|
|
183
225
|
keyboardInsetRef.current = nextInset;
|
|
226
|
+
liftRef.current = nextLift;
|
|
184
227
|
// 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
|
|
185
228
|
flushSync(() => {
|
|
186
229
|
setCap(next);
|
|
187
230
|
setKeyboardInset(nextInset);
|
|
231
|
+
setLift(nextLift);
|
|
188
232
|
});
|
|
189
233
|
sync();
|
|
190
234
|
};
|
|
@@ -210,14 +254,27 @@ export function useLayerKeyboardClearance(
|
|
|
210
254
|
return false;
|
|
211
255
|
}
|
|
212
256
|
commitCap(height);
|
|
213
|
-
// A layer too tall for the room
|
|
214
|
-
// the trigger, where the viewport fit
|
|
215
|
-
//
|
|
257
|
+
// A layer too tall for the room on both sides of its trigger sits over
|
|
258
|
+
// the trigger, where the viewport fit shifted it. Shorter, it fits below
|
|
259
|
+
// the trigger, and the fallback order moves it down. Lift it back, so it
|
|
260
|
+
// keeps the block-start edge it had when the cap landed. A layer that
|
|
261
|
+
// holds its block-end edge (placed above its trigger) moves only its
|
|
262
|
+
// top, and is not lifted.
|
|
216
263
|
const placed = settledBox(layer);
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
264
|
+
if (
|
|
265
|
+
placed.top > box.top + 1 &&
|
|
266
|
+
Math.abs(placed.bottom - box.bottom) > 1
|
|
267
|
+
) {
|
|
268
|
+
commitCap(height, keyboardInsetRef.current, placed.top - box.top);
|
|
269
|
+
// An engine that does not move the layer by the lift leaves it below
|
|
270
|
+
// the trigger: cap it from where it starts there.
|
|
271
|
+
const lifted = settledBox(layer);
|
|
272
|
+
if (Math.abs(lifted.top - box.top) > 1) {
|
|
273
|
+
commitCap(height);
|
|
274
|
+
const again = keyboardClearanceCap(placed, viewport, inset);
|
|
275
|
+
if (again != null) {
|
|
276
|
+
commitCap(again);
|
|
277
|
+
}
|
|
221
278
|
}
|
|
222
279
|
}
|
|
223
280
|
// The cap holds the block-start edge: below its trigger the top stays
|
|
@@ -242,12 +299,17 @@ export function useLayerKeyboardClearance(
|
|
|
242
299
|
}
|
|
243
300
|
// The composing component makes its surface a scroll container once it
|
|
244
301
|
// overflows. That comes a frame later, as its observer reports the
|
|
245
|
-
// smaller box. Keep the field being typed into in view after that.
|
|
302
|
+
// smaller box. Keep the field being typed into in view after that. A
|
|
303
|
+
// person who presses, touches or turns a wheel in the layer by then has
|
|
304
|
+
// placed its content, so the reveal stands down. A component's own
|
|
305
|
+
// scroll, such as a list keeping its active option in view, does not
|
|
306
|
+
// stop it. The next cap reveals the field again.
|
|
246
307
|
const focused = layer.ownerDocument.activeElement;
|
|
247
308
|
if (focused != null && focused !== layer && layer.contains(focused)) {
|
|
309
|
+
const inputsAtCap = personInputs;
|
|
248
310
|
win.requestAnimationFrame(() =>
|
|
249
311
|
win.requestAnimationFrame(() => {
|
|
250
|
-
if (!isDisposed) {
|
|
312
|
+
if (!isDisposed && personInputs === inputsAtCap) {
|
|
251
313
|
keepInView(layer, focused);
|
|
252
314
|
}
|
|
253
315
|
}),
|
|
@@ -298,6 +360,7 @@ export function useLayerKeyboardClearance(
|
|
|
298
360
|
run?.();
|
|
299
361
|
};
|
|
300
362
|
function handlePress(event: PointerEvent) {
|
|
363
|
+
notePersonInput();
|
|
301
364
|
if (pressed.size === 0) {
|
|
302
365
|
follow();
|
|
303
366
|
}
|
|
@@ -317,6 +380,14 @@ export function useLayerKeyboardClearance(
|
|
|
317
380
|
});
|
|
318
381
|
}
|
|
319
382
|
layer.addEventListener('pointerdown', handlePress, true);
|
|
383
|
+
layer.addEventListener('touchstart', notePersonInput, {
|
|
384
|
+
capture: true,
|
|
385
|
+
passive: true,
|
|
386
|
+
});
|
|
387
|
+
layer.addEventListener('wheel', notePersonInput, {
|
|
388
|
+
capture: true,
|
|
389
|
+
passive: true,
|
|
390
|
+
});
|
|
320
391
|
const unsubscribe = guide.subscribe(transition => {
|
|
321
392
|
cancelPending();
|
|
322
393
|
if (transition.animated && transition.to > transition.from) {
|
|
@@ -391,12 +462,18 @@ export function useLayerKeyboardClearance(
|
|
|
391
462
|
cancelPending();
|
|
392
463
|
stopWaiting?.();
|
|
393
464
|
layer.removeEventListener('pointerdown', handlePress, true);
|
|
465
|
+
layer.removeEventListener('touchstart', notePersonInput, {capture: true});
|
|
466
|
+
layer.removeEventListener('wheel', notePersonInput, {capture: true});
|
|
394
467
|
unfollow();
|
|
395
468
|
// A closed layer reopens at its own size.
|
|
396
469
|
if (capRef.current != null) {
|
|
397
470
|
capRef.current = null;
|
|
398
471
|
setCap(null);
|
|
399
472
|
}
|
|
473
|
+
if (liftRef.current != null) {
|
|
474
|
+
liftRef.current = null;
|
|
475
|
+
setLift(null);
|
|
476
|
+
}
|
|
400
477
|
if (keyboardInsetRef.current != null) {
|
|
401
478
|
keyboardInsetRef.current = null;
|
|
402
479
|
setKeyboardInset(null);
|
|
@@ -409,6 +486,7 @@ export function useLayerKeyboardClearance(
|
|
|
409
486
|
}, []);
|
|
410
487
|
return {
|
|
411
488
|
cap: isOpen ? cap : null,
|
|
489
|
+
lift: isOpen ? lift : null,
|
|
412
490
|
inset: isOpen ? keyboardInset : null,
|
|
413
491
|
followLayerElement,
|
|
414
492
|
};
|