@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
|
@@ -65,11 +65,17 @@ import {
|
|
|
65
65
|
} from './parser';
|
|
66
66
|
import type {IncrementalState, MathParseOptions, ParseOptions} from './parser';
|
|
67
67
|
import {getMarkdownAstLegacyCodeLanguage, markdownAstText} from './ast';
|
|
68
|
+
import {
|
|
69
|
+
blockDirection,
|
|
70
|
+
innerDirectionScope,
|
|
71
|
+
type BlockDirectionScope,
|
|
72
|
+
} from './blockDirection';
|
|
68
73
|
import type {
|
|
69
74
|
MarkdownAstBlockContent,
|
|
70
75
|
MarkdownAstPhrasingContent,
|
|
71
76
|
MarkdownAstPosition,
|
|
72
77
|
MarkdownAstTable,
|
|
78
|
+
MarkdownAstTableAlignment,
|
|
73
79
|
} from './ast';
|
|
74
80
|
import {
|
|
75
81
|
applyMarkdownTransforms,
|
|
@@ -103,6 +109,7 @@ import {
|
|
|
103
109
|
registerEnglishFallback,
|
|
104
110
|
useComponentTranslator,
|
|
105
111
|
} from '../i18n/useComponentTranslator';
|
|
112
|
+
import {useDirection} from '../i18n/useDirection';
|
|
106
113
|
import english from '../i18n/generated-english/Markdown/Markdown.generated';
|
|
107
114
|
|
|
108
115
|
registerEnglishFallback(english);
|
|
@@ -376,6 +383,7 @@ const dynamicStyles = stylex.create({
|
|
|
376
383
|
});
|
|
377
384
|
|
|
378
385
|
const cellAlignStyles = stylex.create({
|
|
386
|
+
start: {textAlign: 'start'},
|
|
379
387
|
center: {textAlign: 'center'},
|
|
380
388
|
end: {textAlign: 'end'},
|
|
381
389
|
});
|
|
@@ -428,6 +436,17 @@ const markdownTableCellStyles = stylex.create({
|
|
|
428
436
|
code: {
|
|
429
437
|
wordBreak: 'normal',
|
|
430
438
|
},
|
|
439
|
+
// A cell that reads against its table draws the column rule on the table's
|
|
440
|
+
// inline-end side, which is the cell's own inline-start.
|
|
441
|
+
ruleOnTableEnd: {
|
|
442
|
+
borderInlineEndWidth: 0,
|
|
443
|
+
borderInlineStartWidth: {
|
|
444
|
+
default: borderVars['--border-width'],
|
|
445
|
+
':last-child': '0',
|
|
446
|
+
},
|
|
447
|
+
borderInlineStartStyle: 'solid',
|
|
448
|
+
borderInlineStartColor: colorVars['--color-border'],
|
|
449
|
+
},
|
|
431
450
|
// The grid's outer edge. `dividers="grid"` draws the lines *between* cells
|
|
432
451
|
// and stops at the table's rim, so without this the top, bottom, and sides
|
|
433
452
|
// stay open and the grid reads as unfinished. On the table element, not the
|
|
@@ -1344,6 +1363,24 @@ function computeTableColumnMinWidths(node: RenderTable): number[] {
|
|
|
1344
1363
|
});
|
|
1345
1364
|
}
|
|
1346
1365
|
|
|
1366
|
+
/**
|
|
1367
|
+
* The alignment and column-rule styles for a Markdown table cell. For a cell
|
|
1368
|
+
* that reads against its table, the table's start is the cell's end, so an
|
|
1369
|
+
* explicit alignment and the rule swap logical sides.
|
|
1370
|
+
*/
|
|
1371
|
+
function tableCellSideStyles(
|
|
1372
|
+
align: MarkdownAstTableAlignment | undefined,
|
|
1373
|
+
isAgainstTable: boolean,
|
|
1374
|
+
): ReadonlyArray<StyleXStyles | false> {
|
|
1375
|
+
return [
|
|
1376
|
+
align === 'center' && cellAlignStyles.center,
|
|
1377
|
+
align === 'right' &&
|
|
1378
|
+
(isAgainstTable ? cellAlignStyles.start : cellAlignStyles.end),
|
|
1379
|
+
align === 'left' && isAgainstTable && cellAlignStyles.end,
|
|
1380
|
+
isAgainstTable && markdownTableCellStyles.ruleOnTableEnd,
|
|
1381
|
+
];
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1347
1384
|
function renderBlock(
|
|
1348
1385
|
node: RenderBlockNode,
|
|
1349
1386
|
index: number,
|
|
@@ -1365,6 +1402,7 @@ function renderBlock(
|
|
|
1365
1402
|
headingProjection?: MarkdownHeadingProjection,
|
|
1366
1403
|
// How many lists enclose this block (spec:AST-061 DEC-6).
|
|
1367
1404
|
listDepth = 0,
|
|
1405
|
+
directionScope?: BlockDirectionScope,
|
|
1368
1406
|
): SyncReactNode {
|
|
1369
1407
|
const blockAlignMargin = BLOCK_ALIGN_MARGIN[contentAlign];
|
|
1370
1408
|
const blockAlignStyle =
|
|
@@ -1415,6 +1453,7 @@ function renderBlock(
|
|
|
1415
1453
|
<Tag
|
|
1416
1454
|
key={index}
|
|
1417
1455
|
id={headingId}
|
|
1456
|
+
dir={blockDirection(node, directionScope)}
|
|
1418
1457
|
{...mergeProps(
|
|
1419
1458
|
themeProps('markdown-heading', {density, level}),
|
|
1420
1459
|
stylex.props(
|
|
@@ -1439,6 +1478,7 @@ function renderBlock(
|
|
|
1439
1478
|
return (
|
|
1440
1479
|
<HeadingLinksRenderer
|
|
1441
1480
|
key={index}
|
|
1481
|
+
dir={blockDirection(node, directionScope)}
|
|
1442
1482
|
headingId={headingId}
|
|
1443
1483
|
headingLabel={headingLabel}
|
|
1444
1484
|
permalinkUrl={permalinkUrl}
|
|
@@ -1501,6 +1541,7 @@ function renderBlock(
|
|
|
1501
1541
|
<div
|
|
1502
1542
|
key={index}
|
|
1503
1543
|
role="paragraph"
|
|
1544
|
+
dir={blockDirection(node, directionScope)}
|
|
1504
1545
|
{...mergeProps(
|
|
1505
1546
|
themeProps('markdown-paragraph', {density}),
|
|
1506
1547
|
stylex.props(
|
|
@@ -1660,6 +1701,7 @@ function renderBlock(
|
|
|
1660
1701
|
codeLanguages,
|
|
1661
1702
|
headingProjection,
|
|
1662
1703
|
listDepth,
|
|
1704
|
+
directionScope,
|
|
1663
1705
|
),
|
|
1664
1706
|
);
|
|
1665
1707
|
return (
|
|
@@ -1671,6 +1713,7 @@ function renderBlock(
|
|
|
1671
1713
|
return (
|
|
1672
1714
|
<Blockquote
|
|
1673
1715
|
key={index}
|
|
1716
|
+
dir={blockDirection(node, directionScope)}
|
|
1674
1717
|
{...themeProps('markdown-blockquote', {density})}
|
|
1675
1718
|
{...lineStamps}
|
|
1676
1719
|
xstyle={[
|
|
@@ -1704,6 +1747,7 @@ function renderBlock(
|
|
|
1704
1747
|
codeLanguages,
|
|
1705
1748
|
headingProjection,
|
|
1706
1749
|
listDepth,
|
|
1750
|
+
innerDirectionScope(node, directionScope),
|
|
1707
1751
|
),
|
|
1708
1752
|
)}
|
|
1709
1753
|
</Blockquote>
|
|
@@ -1735,6 +1779,12 @@ function renderBlock(
|
|
|
1735
1779
|
themeProps('markdown-list', {density}),
|
|
1736
1780
|
stylex.props(
|
|
1737
1781
|
spacing,
|
|
1782
|
+
contentWidthValue != null
|
|
1783
|
+
? dynamicStyles.proseWidth(contentWidthValue)
|
|
1784
|
+
: null,
|
|
1785
|
+
contentAlign !== 'start'
|
|
1786
|
+
? dynamicStyles.proseAlign(ALIGN_MARGIN[contentAlign])
|
|
1787
|
+
: null,
|
|
1738
1788
|
isFirst && styles.noMarginBlockStart,
|
|
1739
1789
|
isLast && styles.noMarginBlockEnd,
|
|
1740
1790
|
),
|
|
@@ -1790,6 +1840,7 @@ function renderBlock(
|
|
|
1790
1840
|
codeLanguages,
|
|
1791
1841
|
headingProjection,
|
|
1792
1842
|
listDepth + 1,
|
|
1843
|
+
innerDirectionScope(item, directionScope),
|
|
1793
1844
|
),
|
|
1794
1845
|
)}
|
|
1795
1846
|
</>
|
|
@@ -1801,6 +1852,7 @@ function renderBlock(
|
|
|
1801
1852
|
key={i}
|
|
1802
1853
|
value={`task-${i}`}
|
|
1803
1854
|
label={label}
|
|
1855
|
+
dir={blockDirection(item, directionScope)}
|
|
1804
1856
|
{...(recordsSourceLines
|
|
1805
1857
|
? sourceLineAttributes(blockSourceLines(item))
|
|
1806
1858
|
: undefined)}
|
|
@@ -1880,6 +1932,7 @@ function renderBlock(
|
|
|
1880
1932
|
codeLanguages,
|
|
1881
1933
|
headingProjection,
|
|
1882
1934
|
listDepth + 1,
|
|
1935
|
+
innerDirectionScope(item, directionScope),
|
|
1883
1936
|
),
|
|
1884
1937
|
)}
|
|
1885
1938
|
</>
|
|
@@ -1909,6 +1962,16 @@ function renderBlock(
|
|
|
1909
1962
|
: t('@astryx.markdown.taskList'),
|
|
1910
1963
|
};
|
|
1911
1964
|
|
|
1965
|
+
const itemDirection = blockDirection(item, directionScope);
|
|
1966
|
+
// A numbered item that reads against its list keeps its counter
|
|
1967
|
+
// beside its own text, so its text never widens the counter
|
|
1968
|
+
// column that the other rows share.
|
|
1969
|
+
const readsAgainstList =
|
|
1970
|
+
node.ordered &&
|
|
1971
|
+
itemDirection != null &&
|
|
1972
|
+
directionScope != null &&
|
|
1973
|
+
itemDirection !== directionScope.around;
|
|
1974
|
+
|
|
1912
1975
|
return (
|
|
1913
1976
|
<ListMarkerScope
|
|
1914
1977
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- markdown list items are rendered from positional AST nodes
|
|
@@ -1919,9 +1982,11 @@ function renderBlock(
|
|
|
1919
1982
|
]
|
|
1920
1983
|
}
|
|
1921
1984
|
task={task}
|
|
1922
|
-
hasMarkerGutter={node.ordered}
|
|
1985
|
+
hasMarkerGutter={node.ordered}
|
|
1986
|
+
isOutsideNumberColumns={readsAgainstList}>
|
|
1923
1987
|
<ListItem
|
|
1924
1988
|
label={label}
|
|
1989
|
+
dir={itemDirection}
|
|
1925
1990
|
{...(recordsSourceLines
|
|
1926
1991
|
? sourceLineAttributes(blockSourceLines(item))
|
|
1927
1992
|
: undefined)}
|
|
@@ -1935,6 +2000,19 @@ function renderBlock(
|
|
|
1935
2000
|
}
|
|
1936
2001
|
case 'table': {
|
|
1937
2002
|
const colMinWidths = computeTableColumnMinWidths(node);
|
|
2003
|
+
// A cell whose text reads against its table keeps the table's sides: the
|
|
2004
|
+
// column rule and an explicit alignment resolve in the table's
|
|
2005
|
+
// direction, not the cell's.
|
|
2006
|
+
const readsAgainstTable = (
|
|
2007
|
+
cell: Parameters<typeof blockDirection>[0],
|
|
2008
|
+
): boolean => {
|
|
2009
|
+
const cellDirection = blockDirection(cell, directionScope);
|
|
2010
|
+
return (
|
|
2011
|
+
cellDirection != null &&
|
|
2012
|
+
directionScope != null &&
|
|
2013
|
+
cellDirection !== directionScope.around
|
|
2014
|
+
);
|
|
2015
|
+
};
|
|
1938
2016
|
const [header, ...rows] = node.children;
|
|
1939
2017
|
// Inline code inside a cell keeps its token whole, through the same
|
|
1940
2018
|
// `components` seam consumers use. A supplied renderer owns its own
|
|
@@ -1977,11 +2055,14 @@ function renderBlock(
|
|
|
1977
2055
|
<TableHeaderCell
|
|
1978
2056
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- markdown table columns are positional by definition
|
|
1979
2057
|
key={i}
|
|
2058
|
+
dir={blockDirection(h, directionScope)}
|
|
1980
2059
|
xstyle={[
|
|
1981
2060
|
markdownTableCellStyles.headerCell,
|
|
1982
2061
|
dynamicStyles.cellMinWidth(`${colMinWidths[i]}ch`),
|
|
1983
|
-
|
|
1984
|
-
|
|
2062
|
+
...tableCellSideStyles(
|
|
2063
|
+
node.align[i],
|
|
2064
|
+
readsAgainstTable(h),
|
|
2065
|
+
),
|
|
1985
2066
|
]}>
|
|
1986
2067
|
{h.children.map((c, j) =>
|
|
1987
2068
|
renderInline(
|
|
@@ -2006,10 +2087,13 @@ function renderBlock(
|
|
|
2006
2087
|
<TableCell
|
|
2007
2088
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- markdown table cells are positional by row and column
|
|
2008
2089
|
key={j}
|
|
2090
|
+
dir={blockDirection(cell, directionScope)}
|
|
2009
2091
|
xstyle={[
|
|
2010
2092
|
markdownTableCellStyles.cell,
|
|
2011
|
-
|
|
2012
|
-
|
|
2093
|
+
...tableCellSideStyles(
|
|
2094
|
+
node.align[j],
|
|
2095
|
+
readsAgainstTable(cell),
|
|
2096
|
+
),
|
|
2013
2097
|
]}>
|
|
2014
2098
|
{cell.children.map((c, k) =>
|
|
2015
2099
|
renderInline(
|
|
@@ -2174,6 +2258,7 @@ export function Markdown<
|
|
|
2174
2258
|
...props
|
|
2175
2259
|
}: MarkdownProps<Plugins>): React.ReactElement {
|
|
2176
2260
|
const t = useComponentTranslator();
|
|
2261
|
+
const direction = useDirection();
|
|
2177
2262
|
// Keep one list while it names the same values, so an inline
|
|
2178
2263
|
// `codeLanguages={[…]}` does not re-render every block on each parent
|
|
2179
2264
|
// render (adjusting state during render, not in an Effect).
|
|
@@ -2445,6 +2530,8 @@ export function Markdown<
|
|
|
2445
2530
|
t,
|
|
2446
2531
|
codeLanguages,
|
|
2447
2532
|
headingProjection,
|
|
2533
|
+
undefined,
|
|
2534
|
+
{provider: direction, around: direction},
|
|
2448
2535
|
),
|
|
2449
2536
|
);
|
|
2450
2537
|
}, [
|
|
@@ -2466,6 +2553,7 @@ export function Markdown<
|
|
|
2466
2553
|
t,
|
|
2467
2554
|
headingProjection,
|
|
2468
2555
|
codeLanguages,
|
|
2556
|
+
direction,
|
|
2469
2557
|
]);
|
|
2470
2558
|
|
|
2471
2559
|
if (display === 'inline') {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file blockDirection.ts
|
|
5
|
+
* @input A Markdown AST prose block (a paragraph, heading, blockquote or list
|
|
6
|
+
* item) or a table cell
|
|
7
|
+
* @output The `dir` for the block: its own text's direction, or the
|
|
8
|
+
* provider's for a block whose text has no strongly directional character
|
|
9
|
+
* @position Read by Markdown.tsx to set each block's `dir`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {firstStrongDirection} from '../i18n/firstStrongDirection';
|
|
13
|
+
|
|
14
|
+
interface DirectionalNode {
|
|
15
|
+
readonly type: string;
|
|
16
|
+
readonly value?: unknown;
|
|
17
|
+
readonly children?: ReadonlyArray<DirectionalNode>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Nodes whose text does not count. An image, a code block, math and a table
|
|
22
|
+
* read on their own terms. An extension node or a citation shows text that is
|
|
23
|
+
* not in the tree.
|
|
24
|
+
*/
|
|
25
|
+
const SKIPPED_TYPES = new Set([
|
|
26
|
+
'image',
|
|
27
|
+
'code',
|
|
28
|
+
'math',
|
|
29
|
+
'inlineMath',
|
|
30
|
+
'table',
|
|
31
|
+
'thematicBreak',
|
|
32
|
+
'citation',
|
|
33
|
+
'break',
|
|
34
|
+
'extension',
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
function nodeDirection(node: DirectionalNode): 'ltr' | 'rtl' | null {
|
|
38
|
+
if (SKIPPED_TYPES.has(node.type)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (typeof node.value === 'string') {
|
|
42
|
+
return firstStrongDirection(node.value);
|
|
43
|
+
}
|
|
44
|
+
for (const child of node.children ?? []) {
|
|
45
|
+
const direction = nodeDirection(child);
|
|
46
|
+
if (direction != null) {
|
|
47
|
+
return direction;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The direction of a prose block's own text. A list item and a blockquote read
|
|
55
|
+
* everything under them, nested lists included, so a nested step resolves
|
|
56
|
+
* against the item that holds it.
|
|
57
|
+
*/
|
|
58
|
+
export function markdownBlockDirection(
|
|
59
|
+
node: DirectionalNode,
|
|
60
|
+
): 'ltr' | 'rtl' | undefined {
|
|
61
|
+
return nodeDirection(node) ?? undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The provider's direction, and the direction of the block around this one. */
|
|
65
|
+
export interface BlockDirectionScope {
|
|
66
|
+
readonly provider: 'ltr' | 'rtl';
|
|
67
|
+
readonly around: 'ltr' | 'rtl';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The `dir` for a prose block or a table cell. A block with no direction of
|
|
72
|
+
* its own takes the provider's. It needs the attribute only where the block
|
|
73
|
+
* around it reads the other way; elsewhere it inherits the same direction.
|
|
74
|
+
*/
|
|
75
|
+
export function blockDirection(
|
|
76
|
+
node: DirectionalNode,
|
|
77
|
+
scope: BlockDirectionScope | undefined,
|
|
78
|
+
): 'ltr' | 'rtl' | undefined {
|
|
79
|
+
const own = markdownBlockDirection(node);
|
|
80
|
+
if (own != null) {
|
|
81
|
+
return own;
|
|
82
|
+
}
|
|
83
|
+
return scope != null && scope.around !== scope.provider
|
|
84
|
+
? scope.provider
|
|
85
|
+
: undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The scope for the blocks inside a quote or a list item. */
|
|
89
|
+
export function innerDirectionScope(
|
|
90
|
+
node: DirectionalNode,
|
|
91
|
+
scope: BlockDirectionScope | undefined,
|
|
92
|
+
): BlockDirectionScope | undefined {
|
|
93
|
+
if (scope == null) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
provider: scope.provider,
|
|
98
|
+
around: markdownBlockDirection(node) ?? scope.provider,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -113,6 +113,8 @@ interface HeadingLinksRendererProps {
|
|
|
113
113
|
readonly contentAlign: 'start' | 'center';
|
|
114
114
|
readonly headingTextStyle: StyleXStyles;
|
|
115
115
|
readonly blockSpacingStyle: StyleXStyles;
|
|
116
|
+
/** The heading's own direction; the copy control follows its inline end. */
|
|
117
|
+
readonly dir?: 'ltr' | 'rtl';
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
function isUnmodifiedPrimaryActivation(
|
|
@@ -137,6 +139,7 @@ export function HeadingLinksRenderer({
|
|
|
137
139
|
contentAlign,
|
|
138
140
|
headingTextStyle,
|
|
139
141
|
blockSpacingStyle,
|
|
142
|
+
dir,
|
|
140
143
|
}: HeadingLinksRendererProps): ReactElement {
|
|
141
144
|
const t = useComponentTranslator();
|
|
142
145
|
const copiedLabel = t('@astryx.markdownHeadingLinks.copied');
|
|
@@ -163,6 +166,7 @@ export function HeadingLinksRenderer({
|
|
|
163
166
|
|
|
164
167
|
return (
|
|
165
168
|
<div
|
|
169
|
+
dir={dir}
|
|
166
170
|
{...mergeProps(
|
|
167
171
|
getContainerProps(),
|
|
168
172
|
stylex.props(
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @position Internal context; consumed by MetadataList.tsx and MetadataListItem.tsx
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {createLayerScopedContext
|
|
12
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
13
13
|
|
|
14
14
|
export interface MetadataListLabelConfig {
|
|
15
15
|
position?: 'start' | 'top';
|
|
@@ -22,5 +22,9 @@ export interface MetadataListContextValue {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const MetadataListContext =
|
|
25
|
-
|
|
25
|
+
createLayerScopedContext<MetadataListContextValue | null>(
|
|
26
|
+
'MetadataListContext',
|
|
27
|
+
1,
|
|
28
|
+
null,
|
|
29
|
+
);
|
|
26
30
|
MetadataListContext.displayName = 'MetadataListContext';
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
* - /packages/core/src/NavMenu/index.ts
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {use} from 'react';
|
|
16
16
|
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
17
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
17
18
|
|
|
18
19
|
export type NavHeadingMenuSize = 'sm' | 'md' | 'lg';
|
|
19
20
|
|
|
@@ -27,7 +28,11 @@ export interface NavHeadingCloseContextValue {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export const NavHeadingCloseContext =
|
|
30
|
-
|
|
31
|
+
createSharedContext<NavHeadingCloseContextValue | null>(
|
|
32
|
+
'NavHeadingCloseContext',
|
|
33
|
+
1,
|
|
34
|
+
null,
|
|
35
|
+
);
|
|
31
36
|
NavHeadingCloseContext.displayName = 'NavHeadingCloseContext';
|
|
32
37
|
|
|
33
38
|
export function useNavHeadingCloseContext(): NavHeadingCloseContextValue | null {
|
|
@@ -40,9 +45,9 @@ export function useNavHeadingCloseContext(): NavHeadingCloseContextValue | null
|
|
|
40
45
|
* expanded SideNavHeading, FR7). NavHeadingMenu calls it for a mouse released
|
|
41
46
|
* outside, never on an item's selection.
|
|
42
47
|
*/
|
|
43
|
-
export const NavHeadingDismissContext =
|
|
48
|
+
export const NavHeadingDismissContext = createSharedContext<{
|
|
44
49
|
dismiss: () => void;
|
|
45
|
-
} | null>(null);
|
|
50
|
+
} | null>('NavHeadingDismissContext', 1, null);
|
|
46
51
|
NavHeadingDismissContext.displayName = 'NavHeadingDismissContext';
|
|
47
52
|
|
|
48
53
|
/**
|
|
@@ -55,7 +60,11 @@ export interface NavHeadingMenuContextValue {
|
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
export const NavHeadingMenuContext =
|
|
58
|
-
createLayerScopedContext<NavHeadingMenuContextValue | null>(
|
|
63
|
+
createLayerScopedContext<NavHeadingMenuContextValue | null>(
|
|
64
|
+
'NavHeadingMenuContext',
|
|
65
|
+
1,
|
|
66
|
+
null,
|
|
67
|
+
);
|
|
59
68
|
NavHeadingMenuContext.displayName = 'NavHeadingMenuContext';
|
|
60
69
|
|
|
61
70
|
export function useNavHeadingMenuContext(): NavHeadingMenuContextValue | null {
|
package/src/Popover/Popover.tsx
CHANGED
|
@@ -61,7 +61,11 @@ import {matchesMediaQuery, watchMediaQuery} from '../utils/coarsePointer';
|
|
|
61
61
|
import type {BaseProps} from '../BaseProps';
|
|
62
62
|
import {FALLBACK_CLOSE_SELECTOR, usePopoverInternal} from './usePopover';
|
|
63
63
|
import {usePopoverSurfaceMotion} from './PopoverTouch';
|
|
64
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
FOCUSABLE_SELECTOR,
|
|
66
|
+
isDisabledWithin,
|
|
67
|
+
preferTabStops,
|
|
68
|
+
} from '../hooks/focusableSelector';
|
|
65
69
|
import type {LayerAlignment, LayerPlacement} from '../Layer/useLayer';
|
|
66
70
|
import {layerAnimations} from '../Layer/layerAnimations.stylex';
|
|
67
71
|
import {layerViewportInset} from '../Layer/layerViewportInset.stylex';
|
|
@@ -645,12 +649,12 @@ export function Popover({
|
|
|
645
649
|
sheetPanelRef.current = panel;
|
|
646
650
|
setSheetPanelAttached(panel != null);
|
|
647
651
|
}, []);
|
|
648
|
-
// Focus enters the sheet at each opening as
|
|
649
|
-
//
|
|
650
|
-
//
|
|
651
|
-
// scroll area
|
|
652
|
-
//
|
|
653
|
-
// BottomSheet presents the dialog
|
|
652
|
+
// Focus enters the sheet at each opening, as in the anchored popover (FR2).
|
|
653
|
+
// A caller's `[data-autofocus]` wins. Else the first enabled tab stop in the
|
|
654
|
+
// content takes focus: never the injected fallback close or BottomSheet's
|
|
655
|
+
// own scroll area. Else the scroll area does: it is the sheet's labelled
|
|
656
|
+
// surface and shows the keyboard focus ring. This runs a frame after
|
|
657
|
+
// BottomSheet presents the dialog.
|
|
654
658
|
useEffect(() => {
|
|
655
659
|
if (!isSheetOpen || !isSheetPanelAttached) {
|
|
656
660
|
return;
|
|
@@ -675,15 +679,18 @@ export function Popover({
|
|
|
675
679
|
}
|
|
676
680
|
const target =
|
|
677
681
|
sheetPanel.querySelector<HTMLElement>('[data-autofocus]') ??
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
682
|
+
preferTabStops(
|
|
683
|
+
Array.from(
|
|
684
|
+
sheetPanel.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
|
|
685
|
+
).filter(
|
|
686
|
+
element =>
|
|
687
|
+
// BottomSheet's scroll area is the panel's own child; content
|
|
688
|
+
// sits inside it.
|
|
689
|
+
element.parentElement !== sheetPanel &&
|
|
690
|
+
element.closest(FALLBACK_CLOSE_SELECTOR) == null &&
|
|
691
|
+
!isDisabledWithin(element, sheetPanel),
|
|
692
|
+
),
|
|
693
|
+
)[0];
|
|
687
694
|
if (target != null) {
|
|
688
695
|
target.focus({preventScroll: true});
|
|
689
696
|
return;
|
|
@@ -30,7 +30,11 @@ import {
|
|
|
30
30
|
shadowVars,
|
|
31
31
|
} from '../theme/tokens.stylex';
|
|
32
32
|
import {Button} from '../Button';
|
|
33
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
FOCUSABLE_SELECTOR,
|
|
35
|
+
isDisabledWithin,
|
|
36
|
+
preferTabStops,
|
|
37
|
+
} from '../hooks/focusableSelector';
|
|
34
38
|
import {rtlStyles} from '../utils';
|
|
35
39
|
import {useDevWarning} from '../hooks/useDevWarning';
|
|
36
40
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
@@ -66,9 +70,15 @@ function attemptFocus(element: HTMLElement): boolean {
|
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
function focusFirstContentControl(container: HTMLElement): boolean {
|
|
69
|
-
const focusable =
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
const focusable = preferTabStops(
|
|
74
|
+
Array.from(
|
|
75
|
+
container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
|
|
76
|
+
).filter(
|
|
77
|
+
element =>
|
|
78
|
+
element.closest(FALLBACK_CLOSE_SELECTOR) == null &&
|
|
79
|
+
!isDisabledWithin(element, container),
|
|
80
|
+
),
|
|
81
|
+
);
|
|
72
82
|
for (const element of focusable) {
|
|
73
83
|
if (attemptFocus(element)) {
|
|
74
84
|
return true;
|
|
@@ -600,6 +610,7 @@ function usePopoverImplementation(
|
|
|
600
610
|
role === 'dialog' && !dialogLabel,
|
|
601
611
|
);
|
|
602
612
|
|
|
613
|
+
const isDialogShown = role === 'dialog' && layer.isOpen;
|
|
603
614
|
// Wrapped render function that includes surface styles and optional hidden close button
|
|
604
615
|
const render = useCallback(
|
|
605
616
|
(children: ReactNode, props?: ContextRenderProps): ReactNode => {
|
|
@@ -616,9 +627,11 @@ function usePopoverImplementation(
|
|
|
616
627
|
<LayerDepthProvider>
|
|
617
628
|
<div
|
|
618
629
|
ref={contentRef}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
630
|
+
// A closed surface stays mounted but hidden. It carries no dialog
|
|
631
|
+
// role or name, so selectors find no hidden dialog.
|
|
632
|
+
role={isDialogShown ? 'dialog' : undefined}
|
|
633
|
+
aria-modal={isDialogShown && isModal ? true : undefined}
|
|
634
|
+
aria-label={isDialogShown ? dialogLabel : undefined}
|
|
622
635
|
tabIndex={role === 'dialog' ? -1 : undefined}
|
|
623
636
|
{...mergeProps(
|
|
624
637
|
{...surfaceProps, className: surfaceClassName},
|
|
@@ -662,6 +675,7 @@ function usePopoverImplementation(
|
|
|
662
675
|
closeButtonLabel,
|
|
663
676
|
contentRef,
|
|
664
677
|
dialogLabel,
|
|
678
|
+
isDialogShown,
|
|
665
679
|
role,
|
|
666
680
|
isModal,
|
|
667
681
|
xstyle,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import {RadioListReasonContext} from './RadioListReasonContext';
|
|
20
|
-
import {createLayerScopedContext
|
|
20
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
21
21
|
import React, {
|
|
22
22
|
useCallback,
|
|
23
23
|
useId,
|
|
@@ -63,9 +63,12 @@ export interface RadioListContextValue {
|
|
|
63
63
|
status?: InputStatus;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export const RadioListContext =
|
|
67
|
-
null
|
|
68
|
-
|
|
66
|
+
export const RadioListContext =
|
|
67
|
+
createLayerScopedContext<RadioListContextValue | null>(
|
|
68
|
+
'RadioListContext',
|
|
69
|
+
1,
|
|
70
|
+
null,
|
|
71
|
+
);
|
|
69
72
|
RadioListContext.displayName = 'RadioListContext';
|
|
70
73
|
|
|
71
74
|
const styles = stylex.create({
|
|
@@ -21,5 +21,5 @@ import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
|
21
21
|
// group is not a radio of it.
|
|
22
22
|
export const RadioListReasonContext = createLayerScopedContext<
|
|
23
23
|
string | undefined
|
|
24
|
-
>(undefined);
|
|
24
|
+
>('RadioListReasonContext', 1, undefined);
|
|
25
25
|
RadioListReasonContext.displayName = 'RadioListReasonContext';
|
|
@@ -122,8 +122,28 @@ export const docs = {
|
|
|
122
122
|
{ guidance: true, description: 'Add dividers between same-background sections that need separation.' },
|
|
123
123
|
{ guidance: true, description: 'Combine with a heading + Stack for a typical page section pattern.' },
|
|
124
124
|
{ guidance: false, description: 'Use Card when you mean Section. Cards are for discrete items (one notification, one profile). Sections are for page regions.' },
|
|
125
|
+
{ guidance: true, description: "To center a Section, set marginInlineStart and marginInlineEnd to 'auto' in xstyle. If Astryx source is compiled in your app's own StyleX pass, the marginInline shorthand loses to Section's own inline margins." },
|
|
125
126
|
],
|
|
126
127
|
},
|
|
128
|
+
examples: [
|
|
129
|
+
{
|
|
130
|
+
label: 'Center a Section with a maximum width',
|
|
131
|
+
code: `import * as stylex from '@stylexjs/stylex';
|
|
132
|
+
import {Section} from '@astryxdesign/core/Section';
|
|
133
|
+
|
|
134
|
+
const styles = stylex.create({
|
|
135
|
+
centered: {marginInlineStart: 'auto', marginInlineEnd: 'auto'},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
function Page({children}: {children: React.ReactNode}) {
|
|
139
|
+
return (
|
|
140
|
+
<Section maxWidth={1280} xstyle={styles.centered}>
|
|
141
|
+
{children}
|
|
142
|
+
</Section>
|
|
143
|
+
);
|
|
144
|
+
}`,
|
|
145
|
+
},
|
|
146
|
+
],
|
|
127
147
|
};
|
|
128
148
|
|
|
129
149
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
@@ -230,6 +250,7 @@ export const docsZh = {
|
|
|
230
250
|
{ guidance: true, description: 'Add dividers between same-background sections that need separation.' },
|
|
231
251
|
{ guidance: true, description: 'Combine with a heading + Stack for a typical page section pattern.' },
|
|
232
252
|
{ guidance: false, description: 'Use Card when you mean Section. Cards are for discrete items (one notification, one profile). Sections are for page regions.' },
|
|
253
|
+
{ guidance: true, description: '要让 Section 居中,在 xstyle 中把 marginInlineStart 和 marginInlineEnd 设为 \'auto\'。如果 Astryx 源码在你的应用自己的 StyleX 编译中处理,marginInline 简写会输给 Section 自身的行内外边距。' },
|
|
233
254
|
],
|
|
234
255
|
},
|
|
235
256
|
};
|
|
@@ -248,6 +269,7 @@ export const docsDense = {
|
|
|
248
269
|
{ guidance: true, description: 'Add dividers between same-background sections that need separation.' },
|
|
249
270
|
{ guidance: true, description: 'Combine w/ heading + Stack for typical page section pattern.' },
|
|
250
271
|
{ guidance: false, description: 'Use Card when you mean Section. Cards = discrete items (one notification, one profile). Sections = page regions.' },
|
|
272
|
+
{ guidance: true, description: "Center: xstyle marginInlineStart + marginInlineEnd 'auto'. If Astryx source goes through your app's StyleX pass, marginInline shorthand loses to Section's inline margins." },
|
|
251
273
|
],
|
|
252
274
|
},
|
|
253
275
|
propDescriptions: {
|