@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/settledBox.ts
CHANGED
|
@@ -17,6 +17,23 @@
|
|
|
17
17
|
|
|
18
18
|
const TRANSFORM_PROPERTIES = ['transform', 'translate', 'scale', 'rotate'];
|
|
19
19
|
|
|
20
|
+
/** A 2D affine matrix in the order CSS `matrix()` lists it: a, b, c, d, e, f. */
|
|
21
|
+
type Matrix2D = readonly [number, number, number, number, number, number];
|
|
22
|
+
|
|
23
|
+
const IDENTITY: Matrix2D = [1, 0, 0, 1, 0, 0];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Chromium and WebKit place layout boxes on a 1/64 px grid. The computed
|
|
27
|
+
* transform keeps six digits, so a derived edge can miss that grid by
|
|
28
|
+
* millionths of a px. An edge that close moves onto the grid. Firefox uses a
|
|
29
|
+
* 1/60 px grid, so its edges stay as derived.
|
|
30
|
+
*/
|
|
31
|
+
const LAYOUT_UNITS_PER_PX = 64;
|
|
32
|
+
const GRID_TOLERANCE_PX = 1 / 2048;
|
|
33
|
+
|
|
34
|
+
/** How much nearer the scaled size must be, px, for the box to carry it. */
|
|
35
|
+
const SCALE_TOLERANCE_PX = 1 / 32;
|
|
36
|
+
|
|
20
37
|
function hasTransform(style: CSSStyleDeclaration): boolean {
|
|
21
38
|
return TRANSFORM_PROPERTIES.some(name => {
|
|
22
39
|
const value = style.getPropertyValue(name);
|
|
@@ -24,63 +41,189 @@ function hasTransform(style: CSSStyleDeclaration): boolean {
|
|
|
24
41
|
});
|
|
25
42
|
}
|
|
26
43
|
|
|
44
|
+
function isSet(value: string): boolean {
|
|
45
|
+
return value !== '' && value !== 'none';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function multiply(m: Matrix2D, n: Matrix2D): Matrix2D {
|
|
49
|
+
return [
|
|
50
|
+
m[0] * n[0] + m[2] * n[1],
|
|
51
|
+
m[1] * n[0] + m[3] * n[1],
|
|
52
|
+
m[0] * n[2] + m[2] * n[3],
|
|
53
|
+
m[1] * n[2] + m[3] * n[3],
|
|
54
|
+
m[0] * n[4] + m[2] * n[5] + m[4],
|
|
55
|
+
m[1] * n[4] + m[3] * n[5] + m[5],
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
|
|
27
59
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* transform this cannot undo (3D, or a rotation in another unit) leaves `rect`
|
|
33
|
-
* as it is.
|
|
60
|
+
* The element's whole 2D transform, as one matrix, or null for a transform
|
|
61
|
+
* this cannot read (3D, or a rotation in another unit). The individual
|
|
62
|
+
* transform properties apply before `transform`, in this order (CSS
|
|
63
|
+
* Transforms 2). An engine reports a computed `transform` as `matrix()`.
|
|
34
64
|
*/
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
style
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (z != null) {
|
|
50
|
-
return rect;
|
|
65
|
+
function transformOf(style: CSSStyleDeclaration): Matrix2D | null {
|
|
66
|
+
const translate = style.getPropertyValue('translate');
|
|
67
|
+
const rotate = style.getPropertyValue('rotate');
|
|
68
|
+
const scale = style.getPropertyValue('scale');
|
|
69
|
+
const transform = style.getPropertyValue('transform');
|
|
70
|
+
let matrix = IDENTITY;
|
|
71
|
+
if (isSet(translate)) {
|
|
72
|
+
const [x = '0', y = '0', z] = translate.split(' ');
|
|
73
|
+
// The computed `translate` keeps a percentage, which is not a length.
|
|
74
|
+
if (
|
|
75
|
+
z != null ||
|
|
76
|
+
!translate.split(' ').every(value => value.endsWith('px'))
|
|
77
|
+
) {
|
|
78
|
+
return null;
|
|
51
79
|
}
|
|
52
|
-
matrix = matrix
|
|
80
|
+
matrix = multiply(matrix, [1, 0, 0, 1, parseFloat(x), parseFloat(y)]);
|
|
53
81
|
}
|
|
54
|
-
if (
|
|
55
|
-
if (!/^-?[\d.]+deg$/.test(
|
|
56
|
-
return
|
|
82
|
+
if (isSet(rotate)) {
|
|
83
|
+
if (!/^-?[\d.]+deg$/.test(rotate)) {
|
|
84
|
+
return null;
|
|
57
85
|
}
|
|
58
|
-
|
|
86
|
+
const angle = (parseFloat(rotate) * Math.PI) / 180;
|
|
87
|
+
const cos = Math.cos(angle);
|
|
88
|
+
const sin = Math.sin(angle);
|
|
89
|
+
matrix = multiply(matrix, [cos, sin, -sin, cos, 0, 0]);
|
|
59
90
|
}
|
|
60
|
-
if (
|
|
61
|
-
const [x = '1', y = x, z] =
|
|
91
|
+
if (isSet(scale)) {
|
|
92
|
+
const [x = '1', y = x, z] = scale.split(' ');
|
|
62
93
|
if (z != null) {
|
|
63
|
-
return
|
|
94
|
+
return null;
|
|
64
95
|
}
|
|
65
|
-
matrix = matrix
|
|
96
|
+
matrix = multiply(matrix, [parseFloat(x), 0, 0, parseFloat(y), 0, 0]);
|
|
66
97
|
}
|
|
67
|
-
if (
|
|
68
|
-
|
|
98
|
+
if (isSet(transform)) {
|
|
99
|
+
const listed = /^matrix\(([^)]*)\)$/.exec(transform);
|
|
100
|
+
const values = listed?.[1].split(',').map(value => parseFloat(value));
|
|
101
|
+
if (values?.length !== 6 || values.some(value => Number.isNaN(value))) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
matrix = multiply(matrix, values as unknown as Matrix2D);
|
|
69
105
|
}
|
|
70
|
-
|
|
106
|
+
return matrix;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Whether the matrix only translates and scales: the box keeps its edges
|
|
111
|
+
* parallel to the axes, and its layout size is its transformed size over the
|
|
112
|
+
* scale.
|
|
113
|
+
*/
|
|
114
|
+
function isAxisAligned([a, b, c, d]: Matrix2D): boolean {
|
|
115
|
+
return b === 0 && c === 0 && a !== 0 && d !== 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Whether the layer's transform can be taken out of its box by calculation.
|
|
120
|
+
* Not while one of its animations is pending: Chromium can then report the
|
|
121
|
+
* first keyframe before the box carries it. Not under a CSS zoom other than 1:
|
|
122
|
+
* the computed translation and origin are then in the layer's own px, not in
|
|
123
|
+
* the box's.
|
|
124
|
+
*/
|
|
125
|
+
function canUndoByCalculation(layer: HTMLElement): boolean {
|
|
126
|
+
const zoom = (layer as {currentCSSZoom?: number}).currentCSSZoom ?? 1;
|
|
127
|
+
if (zoom !== 1) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
return !(layer.getAnimations?.() ?? []).some(animation => animation.pending);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** The layer's border-box size in layout px, unrounded, from its used size. */
|
|
134
|
+
function layoutSize(style: CSSStyleDeclaration): {
|
|
135
|
+
width: number;
|
|
136
|
+
height: number;
|
|
137
|
+
} {
|
|
138
|
+
const px = (name: string) => parseFloat(style.getPropertyValue(name)) || 0;
|
|
139
|
+
const isContentBox = style.getPropertyValue('box-sizing') !== 'border-box';
|
|
140
|
+
const extra = (sides: [string, string]) =>
|
|
141
|
+
isContentBox
|
|
142
|
+
? sides.reduce(
|
|
143
|
+
(sum, side) =>
|
|
144
|
+
sum + px(`padding-${side}`) + px(`border-${side}-width`),
|
|
145
|
+
0,
|
|
146
|
+
)
|
|
147
|
+
: 0;
|
|
148
|
+
return {
|
|
149
|
+
width: px('width') + extra(['left', 'right']),
|
|
150
|
+
height: px('height') + extra(['top', 'bottom']),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Whether the box read carries the scale of `matrix`. Right after a layer
|
|
156
|
+
* shows, Chromium can report its entrance's first frame in the computed style
|
|
157
|
+
* while the box read is still laid out without it. The box carries the scale
|
|
158
|
+
* only when its size is clearly nearer the layout size times the scale than
|
|
159
|
+
* the layout size itself. A scale too near 1 to tell them apart does not
|
|
160
|
+
* count.
|
|
161
|
+
*/
|
|
162
|
+
function carriesScale(
|
|
163
|
+
rect: DOMRect,
|
|
164
|
+
style: CSSStyleDeclaration,
|
|
165
|
+
[a, , , d]: Matrix2D,
|
|
166
|
+
): boolean {
|
|
167
|
+
const {width, height} = layoutSize(style);
|
|
168
|
+
if (!(width > 0) || !(height > 0)) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
const scaledError =
|
|
172
|
+
Math.abs(rect.width - width * Math.abs(a)) +
|
|
173
|
+
Math.abs(rect.height - height * Math.abs(d));
|
|
174
|
+
const unscaledError =
|
|
175
|
+
Math.abs(rect.width - width) + Math.abs(rect.height - height);
|
|
176
|
+
return scaledError + SCALE_TOLERANCE_PX < unscaledError;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function onLayoutGrid(value: number): number {
|
|
180
|
+
const snapped = Math.round(value * LAYOUT_UNITS_PER_PX) / LAYOUT_UNITS_PER_PX;
|
|
181
|
+
return Math.abs(snapped - value) < GRID_TOLERANCE_PX ? snapped : value;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* `rect`, the box of an element whose computed style carries the 2D transform
|
|
186
|
+
* `matrix`, with that transform undone. The transformed box's centre is the
|
|
187
|
+
* image of the element's centre. So undoing the transform about its origin on
|
|
188
|
+
* that centre gives the untransformed box. A box that only translates and
|
|
189
|
+
* scales gets its layout size from the transformed size, exactly, and needs
|
|
190
|
+
* no other read. Any other box takes its layout size from `offsetWidth` and
|
|
191
|
+
* `offsetHeight`, which round to whole pixels.
|
|
192
|
+
*/
|
|
193
|
+
function untransform(
|
|
194
|
+
rect: DOMRect,
|
|
195
|
+
layer: HTMLElement,
|
|
196
|
+
style: CSSStyleDeclaration,
|
|
197
|
+
matrix: Matrix2D,
|
|
198
|
+
): DOMRect {
|
|
199
|
+
const [a, b, c, d, e, f] = matrix;
|
|
200
|
+
const isExact = isAxisAligned(matrix);
|
|
201
|
+
const width = isExact ? rect.width / Math.abs(a) : layer.offsetWidth;
|
|
202
|
+
const height = isExact ? rect.height / Math.abs(d) : layer.offsetHeight;
|
|
203
|
+
if (!isExact && width <= 0) {
|
|
71
204
|
return rect;
|
|
72
205
|
}
|
|
73
|
-
const [originX = 0, originY = 0] = style
|
|
206
|
+
const [originX = 0, originY = 0] = style
|
|
207
|
+
.getPropertyValue('transform-origin')
|
|
74
208
|
.split(' ')
|
|
75
209
|
.map(value => parseFloat(value));
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
210
|
+
const x = width / 2 - originX;
|
|
211
|
+
const y = height / 2 - originY;
|
|
212
|
+
const centreX = a * x + c * y + e;
|
|
213
|
+
const centreY = b * x + d * y + f;
|
|
214
|
+
const left = rect.left + rect.width / 2 - centreX - originX;
|
|
215
|
+
const top = rect.top + rect.height / 2 - centreY - originY;
|
|
216
|
+
if (!isExact) {
|
|
217
|
+
return new DOMRect(left, top, width, height);
|
|
218
|
+
}
|
|
219
|
+
const snappedLeft = onLayoutGrid(left);
|
|
220
|
+
const snappedTop = onLayoutGrid(top);
|
|
221
|
+
return new DOMRect(
|
|
222
|
+
snappedLeft,
|
|
223
|
+
snappedTop,
|
|
224
|
+
onLayoutGrid(left + width) - snappedLeft,
|
|
225
|
+
onLayoutGrid(top + height) - snappedTop,
|
|
80
226
|
);
|
|
81
|
-
const left = rect.left + rect.width / 2 - centre.x - originX;
|
|
82
|
-
const top = rect.top + rect.height / 2 - centre.y - originY;
|
|
83
|
-
return new DOMRect(left, top, width, height);
|
|
84
227
|
}
|
|
85
228
|
|
|
86
229
|
/**
|
|
@@ -88,14 +231,15 @@ function untransform(
|
|
|
88
231
|
* entry animation (or anything else) applies to it. A Tooltip enters from a
|
|
89
232
|
* few pixels toward its trigger, scaled down. So the transformed box of a
|
|
90
233
|
* tooltip that fits beside its trigger can read as covering it while it
|
|
91
|
-
* enters.
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* layer
|
|
97
|
-
*
|
|
98
|
-
*
|
|
234
|
+
* enters. When the transform only translates and scales, `untransform` takes
|
|
235
|
+
* it out of one box read, if `canUndoByCalculation` and `carriesScale` allow
|
|
236
|
+
* it. Nothing is written, so the read forces no extra style or layout work.
|
|
237
|
+
* A layer that transitions a transform is also only read: restoring an
|
|
238
|
+
* overridden value would start that transition. Otherwise one read overrides
|
|
239
|
+
* the layer's transforms with `none !important`, which outranks an animation.
|
|
240
|
+
* The same task restores them, so no frame paints in between and the
|
|
241
|
+
* animation keeps running. WebKit still applies an animated transform under
|
|
242
|
+
* that override, so there the read box has that transform undone instead.
|
|
99
243
|
*/
|
|
100
244
|
export function settledBox(layer: HTMLElement): DOMRect {
|
|
101
245
|
const view = layer.ownerDocument.defaultView;
|
|
@@ -103,15 +247,29 @@ export function settledBox(layer: HTMLElement): DOMRect {
|
|
|
103
247
|
if (style == null || !hasTransform(style)) {
|
|
104
248
|
return layer.getBoundingClientRect();
|
|
105
249
|
}
|
|
106
|
-
const
|
|
107
|
-
|
|
250
|
+
const matrix = transformOf(style);
|
|
251
|
+
if (matrix != null && isAxisAligned(matrix) && canUndoByCalculation(layer)) {
|
|
252
|
+
const rect = layer.getBoundingClientRect();
|
|
253
|
+
if (carriesScale(rect, style, matrix)) {
|
|
254
|
+
return untransform(rect, layer, style, matrix);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const transitions = style
|
|
258
|
+
.getPropertyValue('transition-property')
|
|
259
|
+
.split(',')
|
|
260
|
+
.map(p => p.trim());
|
|
261
|
+
const durations = style
|
|
262
|
+
.getPropertyValue('transition-duration')
|
|
263
|
+
.split(',')
|
|
264
|
+
.map(parseFloat);
|
|
108
265
|
const transitioned = transitions.some(
|
|
109
266
|
(name, index) =>
|
|
110
267
|
(name === 'all' || TRANSFORM_PROPERTIES.includes(name)) &&
|
|
111
268
|
(durations[index % durations.length] ?? 0) > 0,
|
|
112
269
|
);
|
|
113
270
|
if (transitioned) {
|
|
114
|
-
|
|
271
|
+
const rect = layer.getBoundingClientRect();
|
|
272
|
+
return matrix == null ? rect : untransform(rect, layer, style, matrix);
|
|
115
273
|
}
|
|
116
274
|
const saved = TRANSFORM_PROPERTIES.map(
|
|
117
275
|
name =>
|
|
@@ -126,8 +284,12 @@ export function settledBox(layer: HTMLElement): DOMRect {
|
|
|
126
284
|
}
|
|
127
285
|
const box = layer.getBoundingClientRect();
|
|
128
286
|
const under = view?.getComputedStyle(layer);
|
|
287
|
+
const underMatrix =
|
|
288
|
+
under != null && hasTransform(under) ? transformOf(under) : null;
|
|
129
289
|
const settled =
|
|
130
|
-
under != null &&
|
|
290
|
+
under != null && underMatrix != null
|
|
291
|
+
? untransform(box, layer, under, underMatrix)
|
|
292
|
+
: box;
|
|
131
293
|
for (const [name, value, priority] of saved) {
|
|
132
294
|
if (value === '') {
|
|
133
295
|
layer.style.removeProperty(name);
|
package/src/Layer/toastHost.tsx
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import {
|
|
19
|
-
createContext,
|
|
20
19
|
use,
|
|
21
20
|
useEffect,
|
|
22
21
|
useState,
|
|
@@ -26,6 +25,7 @@ import {
|
|
|
26
25
|
} from 'react';
|
|
27
26
|
import type {ToastDismissReason, ToastEntry} from '../Toast/types';
|
|
28
27
|
import type {LayerInset, LayerToastConfig} from './LayerContext';
|
|
28
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
29
29
|
|
|
30
30
|
/** Internal context value for toast state management. */
|
|
31
31
|
export interface ToastContextValue {
|
|
@@ -42,7 +42,11 @@ export interface ToastContextValue {
|
|
|
42
42
|
* provide it without importing Toast. With no provider it is null, and
|
|
43
43
|
* `useToast` mounts a viewport of its own.
|
|
44
44
|
*/
|
|
45
|
-
export const ToastContext =
|
|
45
|
+
export const ToastContext = createSharedContext<ToastContextValue | null>(
|
|
46
|
+
'ToastContext',
|
|
47
|
+
1,
|
|
48
|
+
null,
|
|
49
|
+
);
|
|
46
50
|
ToastContext.displayName = 'ToastContext';
|
|
47
51
|
|
|
48
52
|
/**
|