@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
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* - /packages/core/src/Layer/index.ts
|
|
13
13
|
* - /packages/core/src/Layer/LayerProvider.tsx
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
15
|
+
import { use } from 'react';
|
|
16
|
+
import { createSharedContext } from "../utils/sharedContext.js";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* The inset an app declares for a persistent bar floating over a viewport
|
|
@@ -36,7 +37,7 @@ import { createContext, use } from 'react';
|
|
|
36
37
|
* React context for the layer provider.
|
|
37
38
|
* Default value is null — hooks detect this and use the fallback.
|
|
38
39
|
*/
|
|
39
|
-
export const LayerContext =
|
|
40
|
+
export const LayerContext = createSharedContext('LayerContext', 1, null);
|
|
40
41
|
LayerContext.displayName = 'LayerContext';
|
|
41
42
|
|
|
42
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerDepthContext.d.ts","sourceRoot":"","sources":["../../src/Layer/LayerDepthContext.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"LayerDepthContext.d.ts","sourceRoot":"","sources":["../../src/Layer/LayerDepthContext.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAM,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG1C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iCAAiD,CAAC;AAGhF;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAC,QAAQ,EAAC,EAAE;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,+BAGnE;yBAHe,kBAAkB"}
|
|
@@ -27,14 +27,15 @@
|
|
|
27
27
|
* There is nothing to mount at the app root: the context defaults to 0, and
|
|
28
28
|
* each layer provides depth for its OWN content, so nesting composes on its own.
|
|
29
29
|
*/
|
|
30
|
-
import {
|
|
30
|
+
import { use } from 'react';
|
|
31
|
+
import { createSharedContext } from "../utils/sharedContext.js";
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* How many layers deep the current subtree is. 0 at the app root; each layer
|
|
34
35
|
* increments it for its own content.
|
|
35
36
|
*/
|
|
36
37
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
37
|
-
export const LayerDepthContext =
|
|
38
|
+
export const LayerDepthContext = createSharedContext('LayerDepthContext', 1, 0);
|
|
38
39
|
LayerDepthContext.displayName = 'LayerDepthContext';
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* @file LayerTouch.ts
|
|
3
3
|
* @input useLayerKeyboardClearance.ts (the software keyboard's part of the
|
|
4
4
|
* viewport caps)
|
|
5
|
-
* @output The layer runtime's touch layer: useLayerKeyboardClearance
|
|
5
|
+
* @output The layer runtime's touch layer: useLayerKeyboardClearance and
|
|
6
|
+
* keyboardLiftStyle
|
|
6
7
|
* @position The one module the layer runtime imports touch-only code through,
|
|
7
8
|
* and its only import site is useLayer.tsx. It is imported statically, as
|
|
8
9
|
* every touch module is.
|
|
9
10
|
*
|
|
10
11
|
* SYNC: When modified, keep every touch-only import of useLayer.tsx here.
|
|
11
12
|
*/
|
|
12
|
-
export { useLayerKeyboardClearance } from './useLayerKeyboardClearance.js';
|
|
13
|
+
export { keyboardLiftStyle, useLayerKeyboardClearance, } from './useLayerKeyboardClearance.js';
|
|
13
14
|
//# sourceMappingURL=LayerTouch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerTouch.d.ts","sourceRoot":"","sources":["../../src/Layer/LayerTouch.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"LayerTouch.d.ts","sourceRoot":"","sources":["../../src/Layer/LayerTouch.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC"}
|
package/dist/Layer/LayerTouch.js
CHANGED
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
* @file LayerTouch.ts
|
|
7
7
|
* @input useLayerKeyboardClearance.ts (the software keyboard's part of the
|
|
8
8
|
* viewport caps)
|
|
9
|
-
* @output The layer runtime's touch layer: useLayerKeyboardClearance
|
|
9
|
+
* @output The layer runtime's touch layer: useLayerKeyboardClearance and
|
|
10
|
+
* keyboardLiftStyle
|
|
10
11
|
* @position The one module the layer runtime imports touch-only code through,
|
|
11
12
|
* and its only import site is useLayer.tsx. It is imported statically, as
|
|
12
13
|
* every touch module is.
|
|
13
14
|
*
|
|
14
15
|
* SYNC: When modified, keep every touch-only import of useLayer.tsx here.
|
|
15
16
|
*/
|
|
16
|
-
export { useLayerKeyboardClearance } from "./useLayerKeyboardClearance.js";
|
|
17
|
+
export { keyboardLiftStyle, useLayerKeyboardClearance } from "./useLayerKeyboardClearance.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchorName.d.ts","sourceRoot":"","sources":["../../src/Layer/anchorName.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH;;;;;GAKG;AAEH,wBAAgB,eAAe,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,EAAE,CAOzD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAEvE;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAMjE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"anchorName.d.ts","sourceRoot":"","sources":["../../src/Layer/anchorName.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH;;;;;GAKG;AAEH,wBAAgB,eAAe,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,EAAE,CAOzD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAEvE;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAMjE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CASpE"}
|
package/dist/Layer/anchorName.js
CHANGED
|
@@ -32,5 +32,9 @@ export function addAnchorName(el, name) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
export function removeAnchorName(el, name) {
|
|
35
|
-
|
|
35
|
+
const names = readAnchorNames(el);
|
|
36
|
+
// A write invalidates the element's style even when the value is the same.
|
|
37
|
+
if (names.includes(name)) {
|
|
38
|
+
writeAnchorNames(el, names.filter(existing => existing !== name));
|
|
39
|
+
}
|
|
36
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputHold.d.ts","sourceRoot":"","sources":["../../src/Layer/inputHold.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inputHold.d.ts","sourceRoot":"","sources":["../../src/Layer/inputHold.ts"],"names":[],"mappings":"AA+BA;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9D,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GACtB,WAAW,CAAC,OAAO,CAAC,GAAG;IAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAAC,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,KAAK,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAC;CACvB;AA8CD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAExD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAW1D;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAyBhD;AAuPD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EACd,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,gBAAgB,GAC/B,MAAM,IAAI,CAsFZ"}
|
package/dist/Layer/inputHold.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* __tests__/inputHold.interaction.browser.spec.ts and the holdInput callers.
|
|
16
16
|
*/
|
|
17
17
|
import { containsAlongFlatTree, deepActiveElement, parentAcrossShadow } from "../utils/flatTree.js";
|
|
18
|
-
import { getLastMousePoint, getLastPointerType, subscribeInput } from "../utils/inputStream.js";
|
|
18
|
+
import { getDownPresses, getLastMousePoint, getLastPointerType, subscribeInput } from "../utils/inputStream.js";
|
|
19
19
|
import { isDocument, isElement, isHTMLElement, isNode } from "../utils/nodeType.js";
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -207,6 +207,40 @@ function addShield(layer, isFull) {
|
|
|
207
207
|
return shield;
|
|
208
208
|
}
|
|
209
209
|
const MOUSE_OPENING_HALF_SIDE_PX = 2;
|
|
210
|
+
/**
|
|
211
|
+
* The square opening around each point. Two openings that overlap become one
|
|
212
|
+
* box that covers both: under the nonzero rule, the overlap of two openings
|
|
213
|
+
* drawn the same way round would count twice and close again.
|
|
214
|
+
*/
|
|
215
|
+
function openings(points) {
|
|
216
|
+
const boxes = [];
|
|
217
|
+
for (const {
|
|
218
|
+
x,
|
|
219
|
+
y
|
|
220
|
+
} of points) {
|
|
221
|
+
let box = {
|
|
222
|
+
left: x - MOUSE_OPENING_HALF_SIDE_PX,
|
|
223
|
+
right: x + MOUSE_OPENING_HALF_SIDE_PX,
|
|
224
|
+
top: y - MOUSE_OPENING_HALF_SIDE_PX,
|
|
225
|
+
bottom: y + MOUSE_OPENING_HALF_SIDE_PX
|
|
226
|
+
};
|
|
227
|
+
for (let index = boxes.length - 1; index >= 0; index--) {
|
|
228
|
+
const other = boxes[index];
|
|
229
|
+
if (box.left < other.right && other.left < box.right && box.top < other.bottom && other.top < box.bottom) {
|
|
230
|
+
box = {
|
|
231
|
+
left: Math.min(box.left, other.left),
|
|
232
|
+
right: Math.max(box.right, other.right),
|
|
233
|
+
top: Math.min(box.top, other.top),
|
|
234
|
+
bottom: Math.max(box.bottom, other.bottom)
|
|
235
|
+
};
|
|
236
|
+
boxes.splice(index, 1);
|
|
237
|
+
index = boxes.length;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
boxes.push(box);
|
|
241
|
+
}
|
|
242
|
+
return boxes;
|
|
243
|
+
}
|
|
210
244
|
|
|
211
245
|
/**
|
|
212
246
|
* Leaves the mouse a way through a presentation's shield that takes hits.
|
|
@@ -216,7 +250,9 @@ const MOUSE_OPENING_HALF_SIDE_PX = 2;
|
|
|
216
250
|
* the mouse. A shield over the layer's box alone stops taking hits, because
|
|
217
251
|
* the box moves with the layer's entrance. A finger's press there is still
|
|
218
252
|
* held, because the press hold judges each press by its own pointer. A
|
|
219
|
-
*
|
|
253
|
+
* full shield also leaves open each finger or pen press that was down before
|
|
254
|
+
* it came up (see `openToEarlierPresses`). A dismissal's shield keeps every
|
|
255
|
+
* hit.
|
|
220
256
|
*/
|
|
221
257
|
function openToMouse(state, doc) {
|
|
222
258
|
const {
|
|
@@ -226,8 +262,18 @@ function openToMouse(state, doc) {
|
|
|
226
262
|
return;
|
|
227
263
|
}
|
|
228
264
|
const view = doc.defaultView;
|
|
229
|
-
const
|
|
230
|
-
|
|
265
|
+
const mouse = view == null ? null : getLastMousePoint(view);
|
|
266
|
+
const downPresses = view == null ? null : getDownPresses(view);
|
|
267
|
+
const presses = [];
|
|
268
|
+
if (state.isShieldFull && downPresses != null) {
|
|
269
|
+
for (const pointerId of state.pressOpenings) {
|
|
270
|
+
const point = downPresses.get(pointerId);
|
|
271
|
+
if (point != null) {
|
|
272
|
+
presses.push(point);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (mouse == null && presses.length === 0 || state.layer > 0 || shield.style.pointerEvents === 'none') {
|
|
231
277
|
shield.style.removeProperty('clip-path');
|
|
232
278
|
return;
|
|
233
279
|
}
|
|
@@ -235,16 +281,42 @@ function openToMouse(state, doc) {
|
|
|
235
281
|
shield.style.pointerEvents = 'none';
|
|
236
282
|
return;
|
|
237
283
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
284
|
+
// The viewport, then each opening drawn the other way round. The nonzero
|
|
285
|
+
// rule leaves the openings out, and a clipped-out area takes no hits.
|
|
286
|
+
const outline = ['0 0', '100% 0', '100% 100%', '0 100%'];
|
|
287
|
+
for (const {
|
|
288
|
+
left,
|
|
289
|
+
right,
|
|
290
|
+
top,
|
|
291
|
+
bottom
|
|
292
|
+
} of openings(mouse == null ? presses : [mouse, ...presses])) {
|
|
293
|
+
outline.push(`0 ${top}px`, `${left}px ${top}px`, `${left}px ${bottom}px`, `${right}px ${bottom}px`, `${right}px ${top}px`, `0 ${top}px`);
|
|
294
|
+
}
|
|
245
295
|
shield.style.clipPath = `polygon(${outline.join(', ')})`;
|
|
246
296
|
}
|
|
247
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Leaves an opening in a presentation's full shield at each finger or pen
|
|
300
|
+
* press that went down before the shield came up. WebKit hit-tests the lift
|
|
301
|
+
* of such a press again, even with pointer capture, and the lift would land
|
|
302
|
+
* on the shield, inside the layer: a light-dismissing popover would stay
|
|
303
|
+
* open. Through the opening, the lift reaches what is under it, so light
|
|
304
|
+
* dismiss runs as with no hold. A press the press hold holds started during
|
|
305
|
+
* an earlier hold, and gets no opening.
|
|
306
|
+
*/
|
|
307
|
+
function openToEarlierPresses(state, doc) {
|
|
308
|
+
const view = doc.defaultView;
|
|
309
|
+
if (view == null) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const pressHold = pressHolds.get(doc);
|
|
313
|
+
for (const pointerId of getDownPresses(view).keys()) {
|
|
314
|
+
if (pressHold?.holds(pointerId) !== true) {
|
|
315
|
+
state.pressOpenings.add(pointerId);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
248
320
|
/**
|
|
249
321
|
* Holds input away from `layer` until `until` settles. Returns the release
|
|
250
322
|
* (idempotent), for a hold that ends early. Holds on one layer stack, and
|
|
@@ -264,12 +336,14 @@ export function holdInput(layer, {
|
|
|
264
336
|
surface: 0,
|
|
265
337
|
shield: null,
|
|
266
338
|
isShieldFull: false,
|
|
267
|
-
inertContent: null
|
|
339
|
+
inertContent: null,
|
|
340
|
+
pressOpenings: new Set()
|
|
268
341
|
};
|
|
269
342
|
held.set(layer, state);
|
|
270
343
|
}
|
|
271
344
|
startHolding(layer);
|
|
272
345
|
const isFull = scope !== 'surface';
|
|
346
|
+
const raisesFullShield = isFull && (state.shield == null || !state.isShieldFull);
|
|
273
347
|
if (state.shield != null && isFull && !state.isShieldFull) {
|
|
274
348
|
// A surface hold's shield gives way to one over the viewport.
|
|
275
349
|
liveShields.delete(state.shield);
|
|
@@ -297,6 +371,9 @@ export function holdInput(layer, {
|
|
|
297
371
|
state.inertContent = makeContentInert(layer, state.shield);
|
|
298
372
|
}
|
|
299
373
|
}
|
|
374
|
+
if (raisesFullShield) {
|
|
375
|
+
openToEarlierPresses(state, layer.ownerDocument);
|
|
376
|
+
}
|
|
300
377
|
openToMouse(state, layer.ownerDocument);
|
|
301
378
|
let isReleased = false;
|
|
302
379
|
const release = () => {
|
|
@@ -483,12 +560,36 @@ function createPressHold(doc) {
|
|
|
483
560
|
}
|
|
484
561
|
shield.setPointerCapture(event.pointerId);
|
|
485
562
|
};
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* An earlier press's opening follows it, and closes when it ends. The
|
|
566
|
+
* stream has already recorded the event's point when the hold hears it.
|
|
567
|
+
*/
|
|
568
|
+
const followEarlierPress = event => {
|
|
569
|
+
const {
|
|
570
|
+
pointerId,
|
|
571
|
+
type
|
|
572
|
+
} = event;
|
|
573
|
+
for (const layer of liveLayers(doc)) {
|
|
574
|
+
const state = held.get(layer);
|
|
575
|
+
if (state == null || !state.pressOpenings.has(pointerId)) {
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
if (type === 'pointerup' || type === 'pointercancel') {
|
|
579
|
+
state.pressOpenings.delete(pointerId);
|
|
580
|
+
}
|
|
581
|
+
openToMouse(state, doc);
|
|
582
|
+
}
|
|
583
|
+
};
|
|
486
584
|
const onPointer = event => {
|
|
487
585
|
const {
|
|
488
586
|
pointerId,
|
|
489
587
|
pointerType,
|
|
490
588
|
type
|
|
491
589
|
} = event;
|
|
590
|
+
if (HELD_POINTERS.has(pointerType) && type !== 'pointerdown' && !pointers.has(pointerId)) {
|
|
591
|
+
followEarlierPress(event);
|
|
592
|
+
}
|
|
492
593
|
// A finger or a pen raises the shields. Only a mouse that moves with no
|
|
493
594
|
// button down lowers them. So a mouse press that began on a shield stays
|
|
494
595
|
// the shield's to its end. Otherwise its click would go to the two
|
|
@@ -641,7 +742,8 @@ function createPressHold(doc) {
|
|
|
641
742
|
}
|
|
642
743
|
isHolding = false;
|
|
643
744
|
settle();
|
|
644
|
-
}
|
|
745
|
+
},
|
|
746
|
+
holds: pointerId => pointers.has(pointerId)
|
|
645
747
|
};
|
|
646
748
|
return pressHold;
|
|
647
749
|
}
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* @position AST-038 surface membership; unrelated contexts retain their owners
|
|
6
6
|
*/
|
|
7
7
|
import { type Context, type ReactNode } from 'react';
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Create a surface-scoped context whose whole default applies in a new layer.
|
|
10
|
+
* The name and version register it like `createSharedContext`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createLayerScopedContext<T>(name: string, version: number, defaultValue: T): Context<T>;
|
|
10
13
|
export declare function LayerContentBoundary({ children, }: {
|
|
11
14
|
children: ReactNode;
|
|
12
15
|
}): ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerScopedContext.d.ts","sourceRoot":"","sources":["../../src/Layer/layerScopedContext.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAA0B,KAAK,OAAO,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"layerScopedContext.d.ts","sourceRoot":"","sources":["../../src/Layer/layerScopedContext.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAA0B,KAAK,OAAO,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAsB5E;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,CAAC,GACd,OAAO,CAAC,CAAC,CAAC,CAQZ;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,SAAS,CAQZ"}
|
|
@@ -9,17 +9,34 @@
|
|
|
9
9
|
* @position AST-038 surface membership; unrelated contexts retain their owners
|
|
10
10
|
*/
|
|
11
11
|
import { createContext, useState } from 'react';
|
|
12
|
+
import { createSharedContext } from "../utils/sharedContext.js";
|
|
13
|
+
import { realmValue, sharedKey } from "../utils/sharedRealm.js";
|
|
12
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The reset of each layer-scoped context from every copy of Core on this
|
|
17
|
+
* React. A layer boundary from any of those copies resets them all, and never
|
|
18
|
+
* renders another React's contexts.
|
|
19
|
+
*/
|
|
20
|
+
const resetsByReact = realmValue(sharedKey('layer-scoped-context-resets', 2), () => new WeakMap(), value => value instanceof WeakMap);
|
|
21
|
+
let resets = resetsByReact.get(createContext);
|
|
22
|
+
if (resets == null) {
|
|
23
|
+
resets = new Map();
|
|
24
|
+
resetsByReact.set(createContext, resets);
|
|
25
|
+
}
|
|
26
|
+
const reactResets = resets;
|
|
14
27
|
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Create a surface-scoped context whose whole default applies in a new layer.
|
|
30
|
+
* The name and version register it like `createSharedContext`.
|
|
31
|
+
*/
|
|
32
|
+
export function createLayerScopedContext(name, version, defaultValue) {
|
|
33
|
+
const Context = createSharedContext(name, version, defaultValue);
|
|
34
|
+
if (!reactResets.has(Context)) {
|
|
35
|
+
reactResets.set(Context, children => /*#__PURE__*/_jsx(Context, {
|
|
36
|
+
value: defaultValue,
|
|
37
|
+
children: children
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
23
40
|
return Context;
|
|
24
41
|
}
|
|
25
42
|
export function LayerContentBoundary({
|
|
@@ -27,6 +44,6 @@ export function LayerContentBoundary({
|
|
|
27
44
|
}) {
|
|
28
45
|
// Keep the provider chain stable for this mount: lazy imports must not
|
|
29
46
|
// remount existing content and discard its state or focus.
|
|
30
|
-
const [resetChain] = useState(() =>
|
|
47
|
+
const [resetChain] = useState(() => [...reactResets.values()]);
|
|
31
48
|
return resetChain.reduceRight((content, reset) => reset(content), children);
|
|
32
49
|
}
|
|
@@ -16,22 +16,26 @@
|
|
|
16
16
|
* gutter on both alignment-axis edges, and the clearance facing the anchor
|
|
17
17
|
* with the gutter on the far edge of the side it lands on.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* An above or below layer that must never settle over its anchor
|
|
20
|
+
* (spec:AST-059 FR4, Tooltip) uses one combined fallback list from the start,
|
|
21
|
+
* and no option in it overlaps the anchor. `beside` lands on a
|
|
22
22
|
* side across the alignment axis, spanning the whole block axis, at the
|
|
23
23
|
* content's own inline size, so it fits only where the layer fits without
|
|
24
24
|
* squeezing. `fit` lands above or below sized to the room on that side, so
|
|
25
25
|
* overflow scrolls inside the layer, and is never smaller than half of the room
|
|
26
26
|
* the trigger leaves on the block axis, so it fits only on the side with more
|
|
27
|
-
* room; the list tries both only after the layer's own position,
|
|
28
|
-
*
|
|
27
|
+
* room; the list tries both only after the layer's own position, the opposite
|
|
28
|
+
* side at the layer's own size and `beside`, so only content taller than the
|
|
29
29
|
* room on both sides is sized to a room. No option is sized to whatever room
|
|
30
30
|
* is left: a browser keeps a layer on the option it last used for as long as
|
|
31
31
|
* that option still fits, so such an option would hold an open layer on a side
|
|
32
32
|
* shrunk to a sliver after its anchor moved. Chromium applies a position
|
|
33
33
|
* option's width and height properties but not their min/max forms, so the
|
|
34
|
-
* sizes are `inline-size` and `block-size`.
|
|
34
|
+
* sizes are `inline-size` and `block-size`. Inside a scrolling panel, Chromium
|
|
35
|
+
* does not choose an option again while the panel scrolls, and it shifts a box
|
|
36
|
+
* that runs out of room back into the room, onto the anchor. So the layer and
|
|
37
|
+
* every option align `unsafe` toward the anchor on the placement axis: a box
|
|
38
|
+
* that runs out of room overflows away from the anchor instead.
|
|
35
39
|
*
|
|
36
40
|
* The rules are static — the anchor clearance travels through a custom
|
|
37
41
|
* property — so one style sheet per document carries all of them. It is
|
|
@@ -46,6 +50,13 @@ import type { LayerAlignment, LayerPlacement } from './useLayer.js';
|
|
|
46
50
|
export declare const LAYER_CLEARANCE_PROPERTY = "--_astryx-layer-clearance";
|
|
47
51
|
type Side = 'same' | 'opposite';
|
|
48
52
|
export declare function slideRuleName(placement: LayerPlacement, alignment: LayerAlignment, side: Side): string;
|
|
53
|
+
/**
|
|
54
|
+
* The placement-axis alignment of a layer that keeps its anchor clear, on
|
|
55
|
+
* `side` of its anchor: `unsafe`, toward the anchor, so a box that runs out of
|
|
56
|
+
* room overflows away from the anchor rather than being shifted onto it.
|
|
57
|
+
* `flip-block` swaps it with the side.
|
|
58
|
+
*/
|
|
59
|
+
export declare function anchorClearAlignment(side: LayerPlacement): string;
|
|
49
60
|
/** The name of the `beside` option that lands on `side`, across the block axis. */
|
|
50
61
|
export declare function besideRuleName(side: 'start' | 'end'): string;
|
|
51
62
|
/**
|
|
@@ -55,28 +66,19 @@ export declare function besideRuleName(side: 'start' | 'end'): string;
|
|
|
55
66
|
*/
|
|
56
67
|
export declare function fitRuleName(side: 'above' | 'below'): string;
|
|
57
68
|
/**
|
|
58
|
-
* The fallback list of
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
+
* The one combined fallback list of an above or below layer that must never
|
|
70
|
+
* settle over its anchor (FR4). After the layer's own position (the preferred
|
|
71
|
+
* block side, at its own size): the opposite block side at its own size, then
|
|
72
|
+
* beside the trigger on the inline end, then the inline start, and only then
|
|
73
|
+
* the preferred block side and the opposite one sized to the room there, each
|
|
74
|
+
* only while it is the roomier side. Every option before the last two keeps
|
|
75
|
+
* the layer at its own size, so a layer whose content fits somewhere is never
|
|
76
|
+
* stretched to a room; the last two are for content taller than the room on
|
|
77
|
+
* both sides. Chromium tries no more than five options, so this replaces the
|
|
78
|
+
* standard list rather than extending it. Side placements already slide along
|
|
79
|
+
* the block axis at full height, so they have none.
|
|
69
80
|
*/
|
|
70
81
|
export declare function getAnchorClearFallbacks(placement: LayerPlacement): string;
|
|
71
|
-
/** The custom property a layer writes its anchor-clear fallback list to. */
|
|
72
|
-
export declare const LAYER_CLEAR_FALLBACKS_PROPERTY = "--_astryx-layer-clear-fallbacks";
|
|
73
|
-
/** The custom property its `position-try-fallbacks` reads first. */
|
|
74
|
-
export declare const LAYER_TRY_FALLBACKS_PROPERTY = "--_astryx-layer-try-fallbacks";
|
|
75
|
-
/**
|
|
76
|
-
* The attribute the runtime sets on a layer whose settled box covered its
|
|
77
|
-
* anchor; it switches the layer to its anchor-clear list.
|
|
78
|
-
*/
|
|
79
|
-
export declare const LAYER_CLEARS_ANCHOR_ATTRIBUTE = "data-astryx-clears-anchor";
|
|
80
82
|
/**
|
|
81
83
|
* The attribute the runtime sets on a layer that keeps its anchor clear while
|
|
82
84
|
* its content overflows the box it was given; only then does it scroll, so a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerSlideRules.d.ts","sourceRoot":"","sources":["../../src/Layer/layerSlideRules.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"layerSlideRules.d.ts","sourceRoot":"","sources":["../../src/Layer/layerSlideRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAG/D,kEAAkE;AAClE,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE,KAAK,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhC,wBAAgB,aAAa,CAC3B,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,IAAI,GACT,MAAM,CAER;AAmFD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAIjE;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAE3D;AA6CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,CAMzE;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAOnE;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CActC;AAED,eAAO,MAAM,cAAc,6BAA6B,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAQpD"}
|
|
@@ -18,22 +18,26 @@
|
|
|
18
18
|
* gutter on both alignment-axis edges, and the clearance facing the anchor
|
|
19
19
|
* with the gutter on the far edge of the side it lands on.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* An above or below layer that must never settle over its anchor
|
|
22
|
+
* (spec:AST-059 FR4, Tooltip) uses one combined fallback list from the start,
|
|
23
|
+
* and no option in it overlaps the anchor. `beside` lands on a
|
|
24
24
|
* side across the alignment axis, spanning the whole block axis, at the
|
|
25
25
|
* content's own inline size, so it fits only where the layer fits without
|
|
26
26
|
* squeezing. `fit` lands above or below sized to the room on that side, so
|
|
27
27
|
* overflow scrolls inside the layer, and is never smaller than half of the room
|
|
28
28
|
* the trigger leaves on the block axis, so it fits only on the side with more
|
|
29
|
-
* room; the list tries both only after the layer's own position,
|
|
30
|
-
*
|
|
29
|
+
* room; the list tries both only after the layer's own position, the opposite
|
|
30
|
+
* side at the layer's own size and `beside`, so only content taller than the
|
|
31
31
|
* room on both sides is sized to a room. No option is sized to whatever room
|
|
32
32
|
* is left: a browser keeps a layer on the option it last used for as long as
|
|
33
33
|
* that option still fits, so such an option would hold an open layer on a side
|
|
34
34
|
* shrunk to a sliver after its anchor moved. Chromium applies a position
|
|
35
35
|
* option's width and height properties but not their min/max forms, so the
|
|
36
|
-
* sizes are `inline-size` and `block-size`.
|
|
36
|
+
* sizes are `inline-size` and `block-size`. Inside a scrolling panel, Chromium
|
|
37
|
+
* does not choose an option again while the panel scrolls, and it shifts a box
|
|
38
|
+
* that runs out of room back into the room, onto the anchor. So the layer and
|
|
39
|
+
* every option align `unsafe` toward the anchor on the placement axis: a box
|
|
40
|
+
* that runs out of room overflows away from the anchor instead.
|
|
37
41
|
*
|
|
38
42
|
* The rules are static — the anchor clearance travels through a custom
|
|
39
43
|
* property — so one style sheet per document carries all of them. It is
|
|
@@ -107,6 +111,16 @@ function rule(placement, alignment, side) {
|
|
|
107
111
|
const PLACEMENTS = ['above', 'below', 'start', 'end'];
|
|
108
112
|
const ALIGNMENTS = ['start', 'center', 'end'];
|
|
109
113
|
|
|
114
|
+
/**
|
|
115
|
+
* The placement-axis alignment of a layer that keeps its anchor clear, on
|
|
116
|
+
* `side` of its anchor: `unsafe`, toward the anchor, so a box that runs out of
|
|
117
|
+
* room overflows away from the anchor rather than being shifted onto it.
|
|
118
|
+
* `flip-block` swaps it with the side.
|
|
119
|
+
*/
|
|
120
|
+
export function anchorClearAlignment(side) {
|
|
121
|
+
return side === 'above' || side === 'start' ? 'unsafe self-end' : 'unsafe self-start';
|
|
122
|
+
}
|
|
123
|
+
|
|
110
124
|
/** The name of the `beside` option that lands on `side`, across the block axis. */
|
|
111
125
|
export function besideRuleName(side) {
|
|
112
126
|
return `--astryx-layer-beside-${side}`;
|
|
@@ -124,10 +138,12 @@ export function fitRuleName(side) {
|
|
|
124
138
|
/**
|
|
125
139
|
* `beside`: the slide's geometry on an inline side, at the content's own
|
|
126
140
|
* inline size. A content-sized layer would otherwise wrap to whatever sliver
|
|
127
|
-
* of room the trigger leaves and always fit.
|
|
141
|
+
* of room the trigger leaves and always fit. On the block axis it drops the
|
|
142
|
+
* layer's own alignment toward its anchor, so it centres on the trigger and
|
|
143
|
+
* slides into view.
|
|
128
144
|
*/
|
|
129
145
|
function besideRule(side) {
|
|
130
|
-
return `@position-try ${besideRuleName(side)}{position-area:${areaFor(side)};${placementMargins(side)}${alignmentMargins(side)}inline-size:max-content;}`;
|
|
146
|
+
return `@position-try ${besideRuleName(side)}{position-area:${areaFor(side)};${placementMargins(side)}${alignmentMargins(side)}inline-size:max-content;align-self:normal;justify-self:${anchorClearAlignment(side)};}`;
|
|
131
147
|
}
|
|
132
148
|
|
|
133
149
|
/** The block size of the room on one block side: the area minus its margins. */
|
|
@@ -154,42 +170,30 @@ function halfRoom(viewport, gutter) {
|
|
|
154
170
|
function fitRule(side) {
|
|
155
171
|
const size = (viewport, gutter) => `max(${roomCap(gutter)}, ${halfRoom(viewport, gutter)})`;
|
|
156
172
|
const blockSize = pair('block-size', size('100vh', layerViewportInset.gutterBlockFallback), size('100dvb', layerViewportInset.gutterBlock));
|
|
157
|
-
return `@position-try ${fitRuleName(side)}{position-area:${areaFor(side)};${placementMargins(side)}${alignmentMargins(side)}${blockSize}}`;
|
|
173
|
+
return `@position-try ${fitRuleName(side)}{position-area:${areaFor(side)};${placementMargins(side)}${alignmentMargins(side)}${blockSize}align-self:${anchorClearAlignment(side)};}`;
|
|
158
174
|
}
|
|
159
175
|
|
|
160
176
|
/**
|
|
161
|
-
* The fallback list of
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
177
|
+
* The one combined fallback list of an above or below layer that must never
|
|
178
|
+
* settle over its anchor (FR4). After the layer's own position (the preferred
|
|
179
|
+
* block side, at its own size): the opposite block side at its own size, then
|
|
180
|
+
* beside the trigger on the inline end, then the inline start, and only then
|
|
181
|
+
* the preferred block side and the opposite one sized to the room there, each
|
|
182
|
+
* only while it is the roomier side. Every option before the last two keeps
|
|
183
|
+
* the layer at its own size, so a layer whose content fits somewhere is never
|
|
184
|
+
* stretched to a room; the last two are for content taller than the room on
|
|
185
|
+
* both sides. Chromium tries no more than five options, so this replaces the
|
|
186
|
+
* standard list rather than extending it. Side placements already slide along
|
|
187
|
+
* the block axis at full height, so they have none.
|
|
172
188
|
*/
|
|
173
189
|
export function getAnchorClearFallbacks(placement) {
|
|
174
190
|
if (placement !== 'above' && placement !== 'below') {
|
|
175
191
|
return '';
|
|
176
192
|
}
|
|
177
193
|
const opposite = placement === 'above' ? 'below' : 'above';
|
|
178
|
-
return
|
|
194
|
+
return `flip-block, ${besideRuleName('end')}, ${besideRuleName('start')}, ${fitRuleName(placement)}, ${fitRuleName(opposite)}`;
|
|
179
195
|
}
|
|
180
196
|
|
|
181
|
-
/** The custom property a layer writes its anchor-clear fallback list to. */
|
|
182
|
-
export const LAYER_CLEAR_FALLBACKS_PROPERTY = '--_astryx-layer-clear-fallbacks';
|
|
183
|
-
|
|
184
|
-
/** The custom property its `position-try-fallbacks` reads first. */
|
|
185
|
-
export const LAYER_TRY_FALLBACKS_PROPERTY = '--_astryx-layer-try-fallbacks';
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* The attribute the runtime sets on a layer whose settled box covered its
|
|
189
|
-
* anchor; it switches the layer to its anchor-clear list.
|
|
190
|
-
*/
|
|
191
|
-
export const LAYER_CLEARS_ANCHOR_ATTRIBUTE = 'data-astryx-clears-anchor';
|
|
192
|
-
|
|
193
197
|
/**
|
|
194
198
|
* The attribute the runtime sets on a layer that keeps its anchor clear while
|
|
195
199
|
* its content overflows the box it was given; only then does it scroll, so a
|
|
@@ -198,12 +202,9 @@ export const LAYER_CLEARS_ANCHOR_ATTRIBUTE = 'data-astryx-clears-anchor';
|
|
|
198
202
|
*/
|
|
199
203
|
export const LAYER_SCROLLS_ATTRIBUTE = 'data-astryx-layer-scrolls';
|
|
200
204
|
|
|
201
|
-
/**
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
*/
|
|
205
|
-
function clearSwitchCss() {
|
|
206
|
-
return `[${LAYER_CLEARS_ANCHOR_ATTRIBUTE}]{${LAYER_TRY_FALLBACKS_PROPERTY}:var(${LAYER_CLEAR_FALLBACKS_PROPERTY});}[${LAYER_SCROLLS_ATTRIBUTE}]{overflow-y:auto;overscroll-behavior-block:contain;}`;
|
|
205
|
+
/** Lets a layer whose content overflows scroll it. */
|
|
206
|
+
function scrollsCss() {
|
|
207
|
+
return `[${LAYER_SCROLLS_ATTRIBUTE}]{overflow-y:auto;overscroll-behavior-block:contain;}`;
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
/**
|
|
@@ -211,7 +212,7 @@ function clearSwitchCss() {
|
|
|
211
212
|
* rules.
|
|
212
213
|
*/
|
|
213
214
|
export function slideRulesCss() {
|
|
214
|
-
return [...PLACEMENTS.flatMap(placement => ALIGNMENTS.flatMap(alignment => [rule(placement, alignment, 'same'), rule(placement, alignment, 'opposite')])), besideRule('end'), besideRule('start'), fitRule('above'), fitRule('below'),
|
|
215
|
+
return [...PLACEMENTS.flatMap(placement => ALIGNMENTS.flatMap(alignment => [rule(placement, alignment, 'same'), rule(placement, alignment, 'opposite')])), besideRule('end'), besideRule('start'), fitRule('above'), fitRule('below'), scrollsCss()].join('');
|
|
215
216
|
}
|
|
216
217
|
export const SLIDE_RULES_ID = 'astryx-layer-slide-rules';
|
|
217
218
|
|