@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
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
type UIEvent as ReactUIEvent,
|
|
65
65
|
} from 'react';
|
|
66
66
|
|
|
67
|
+
import {VelocityTracker} from '../gestures/VelocityTracker';
|
|
67
68
|
import {resolveSnapPoint} from '../motion/resolveSnapPoint';
|
|
68
69
|
import {rubberBand} from '../motion/rubberBand';
|
|
69
70
|
import {scroll} from '../motion/uikit/scroll';
|
|
@@ -93,10 +94,6 @@ interface SheetDetents {
|
|
|
93
94
|
const DECELERATION_RATE = 0.998;
|
|
94
95
|
const PROJECTION_FACTOR = DECELERATION_RATE / (1 - DECELERATION_RATE); // ms
|
|
95
96
|
const PROJECTION_MIN_TRAVEL = 48; // px traveled during the gesture
|
|
96
|
-
// The release speed is the finger's speed over its last stretch, not between
|
|
97
|
-
// its last two samples: one slow sample before the lift must not cancel a
|
|
98
|
-
// throw, and a finger that paused before lifting has no speed at all.
|
|
99
|
-
const VELOCITY_WINDOW_MS = 100;
|
|
100
97
|
// On a slow drag below the shortest detent, dismiss once dragged past it by
|
|
101
98
|
// more than this fraction of that detent's height; otherwise snap back to it.
|
|
102
99
|
const DISMISS_OVERSHOOT_RATIO = 0.4;
|
|
@@ -762,12 +759,9 @@ export function useSheetGestures({
|
|
|
762
759
|
pointerType: string;
|
|
763
760
|
pointerId: number;
|
|
764
761
|
startCoord: number;
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
// (and never fewer than two) for the release speed.
|
|
769
|
-
samples: {t: number; y: number}[];
|
|
770
|
-
velocity: number;
|
|
762
|
+
// The finger's positions on the timestamps their events carry, for the
|
|
763
|
+
// release velocity (Core's one velocity tracker).
|
|
764
|
+
tracker: VelocityTracker;
|
|
771
765
|
height: number;
|
|
772
766
|
/** The surface kept below the screen when the drag began. */
|
|
773
767
|
reserve: number;
|
|
@@ -1295,15 +1289,14 @@ export function useSheetGestures({
|
|
|
1295
1289
|
const start = startCoord ?? event.clientY;
|
|
1296
1290
|
const naturalEndGap = naturalEndGapFor(bodyNodeRef.current);
|
|
1297
1291
|
const baseLayoutOffset = settledLayoutOffsetRef.current;
|
|
1292
|
+
const tracker = new VelocityTracker();
|
|
1293
|
+
tracker.add(0, event.clientY, event.timeStamp);
|
|
1298
1294
|
dragStateRef.current = {
|
|
1299
1295
|
syntheticTouch,
|
|
1300
1296
|
pointerType: event.pointerType,
|
|
1301
1297
|
pointerId: event.pointerId,
|
|
1302
1298
|
startCoord: start,
|
|
1303
|
-
|
|
1304
|
-
lastTime: event.timeStamp,
|
|
1305
|
-
samples: [{t: event.timeStamp, y: event.clientY}],
|
|
1306
|
-
velocity: 0,
|
|
1299
|
+
tracker,
|
|
1307
1300
|
height: sheetHeight,
|
|
1308
1301
|
reserve: offscreenBlockEndInsetRef.current,
|
|
1309
1302
|
baseOffset: settledOffset,
|
|
@@ -1380,26 +1373,9 @@ export function useSheetGestures({
|
|
|
1380
1373
|
return;
|
|
1381
1374
|
}
|
|
1382
1375
|
const delta = event.clientY - state.startCoord;
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
state.lastTime = event.timeStamp;
|
|
1387
|
-
state.samples.push({t: event.timeStamp, y: event.clientY});
|
|
1388
|
-
// Drop what fell out of the window while a partner remains: a throw
|
|
1389
|
-
// that begins after a rest reads its own speed, not the average since
|
|
1390
|
-
// touch-down.
|
|
1391
|
-
while (
|
|
1392
|
-
state.samples.length > 2 &&
|
|
1393
|
-
event.timeStamp - state.samples[0].t > VELOCITY_WINDOW_MS
|
|
1394
|
-
) {
|
|
1395
|
-
state.samples.shift();
|
|
1396
|
-
}
|
|
1397
|
-
const first = state.samples[0];
|
|
1398
|
-
// A lone partner older than the window says only where the finger
|
|
1399
|
-
// rested; the move it precedes is read as if it took the window.
|
|
1400
|
-
const span = Math.min(event.timeStamp - first.t, VELOCITY_WINDOW_MS);
|
|
1401
|
-
state.velocity = span > 0 ? (event.clientY - first.y) / span : 0;
|
|
1402
|
-
}
|
|
1376
|
+
// One sample per event, on the event's own timestamp: when the finger
|
|
1377
|
+
// was there, however late a busy main thread handles the event.
|
|
1378
|
+
state.tracker.add(0, event.clientY, event.timeStamp);
|
|
1403
1379
|
const {offsets, peekOffset} = resolveDetents(state.height);
|
|
1404
1380
|
|
|
1405
1381
|
const raw = state.baseOffset + delta;
|
|
@@ -1497,11 +1473,13 @@ export function useSheetGestures({
|
|
|
1497
1473
|
const delta = event.clientY - state.startCoord;
|
|
1498
1474
|
const offset = Math.max(0, state.baseOffset + delta);
|
|
1499
1475
|
const dir = delta === 0 ? 0 : delta > 0 ? 1 : -1;
|
|
1500
|
-
// A
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1476
|
+
// The release velocity, px/ms. A lift at a new position is the last
|
|
1477
|
+
// sample. A finger that held still for longer than the stillness
|
|
1478
|
+
// interval before the lift releases nothing in motion.
|
|
1479
|
+
if (state.tracker.lastSample?.y !== event.clientY) {
|
|
1480
|
+
state.tracker.add(0, event.clientY, event.timeStamp);
|
|
1481
|
+
}
|
|
1482
|
+
const velocity = state.tracker.velocity(event.timeStamp).y / 1000;
|
|
1505
1483
|
dragStateRef.current = null;
|
|
1506
1484
|
if (!state.syntheticTouch) {
|
|
1507
1485
|
target.releasePointerCapture?.(event.pointerId);
|
|
@@ -1659,13 +1637,15 @@ export function useSheetGestures({
|
|
|
1659
1637
|
});
|
|
1660
1638
|
|
|
1661
1639
|
const bodyRef = useCallback((node: HTMLElement | null) => {
|
|
1662
|
-
const asPointer = (touch: Touch, target: HTMLElement) =>
|
|
1640
|
+
const asPointer = (touch: Touch, target: HTMLElement, event: TouchEvent) =>
|
|
1663
1641
|
({
|
|
1664
1642
|
syntheticTouch: true,
|
|
1665
1643
|
pointerId: touch.identifier,
|
|
1666
1644
|
pointerType: touchPointerType(touch),
|
|
1667
1645
|
clientY: touch.clientY,
|
|
1668
|
-
|
|
1646
|
+
// The touch event's own time: when the finger was there, however
|
|
1647
|
+
// late this handler runs.
|
|
1648
|
+
timeStamp: event.timeStamp,
|
|
1669
1649
|
currentTarget: target,
|
|
1670
1650
|
setPointerCapture: () => {},
|
|
1671
1651
|
releasePointerCapture: () => {},
|
|
@@ -1744,11 +1724,11 @@ export function useSheetGestures({
|
|
|
1744
1724
|
// Deliberately NOT preventDefault()ed: the scroller is clamped at
|
|
1745
1725
|
// its end, so there is no scrolling left to cancel, and claiming the
|
|
1746
1726
|
// gesture would strand the content for as long as the finger is down.
|
|
1747
|
-
pointerMoveRef.current(asPointer(t, scroller));
|
|
1727
|
+
pointerMoveRef.current(asPointer(t, scroller, event));
|
|
1748
1728
|
return;
|
|
1749
1729
|
}
|
|
1750
1730
|
event.preventDefault();
|
|
1751
|
-
pointerMoveRef.current(asPointer(t, scroller));
|
|
1731
|
+
pointerMoveRef.current(asPointer(t, scroller, event));
|
|
1752
1732
|
return;
|
|
1753
1733
|
}
|
|
1754
1734
|
if (!armed) {
|
|
@@ -1774,11 +1754,11 @@ export function useSheetGestures({
|
|
|
1774
1754
|
releaseContentHold(armed);
|
|
1775
1755
|
touchDragRef.current = null;
|
|
1776
1756
|
beginDragRef.current(
|
|
1777
|
-
asPointer(t, scroller),
|
|
1757
|
+
asPointer(t, scroller, event),
|
|
1778
1758
|
measureHeightRef.current(),
|
|
1779
1759
|
armed.startY,
|
|
1780
1760
|
);
|
|
1781
|
-
pointerMoveRef.current(asPointer(t, scroller));
|
|
1761
|
+
pointerMoveRef.current(asPointer(t, scroller, event));
|
|
1782
1762
|
return;
|
|
1783
1763
|
}
|
|
1784
1764
|
if ((armed.top && delta < 0) || (armed.bottom && delta > 0)) {
|
|
@@ -1802,11 +1782,11 @@ export function useSheetGestures({
|
|
|
1802
1782
|
} else if (armed.contentEndY - t.clientY >= CONTENT_END_HANDOFF_SLOP) {
|
|
1803
1783
|
armed.promotedAtContentEnd = true;
|
|
1804
1784
|
beginDragRef.current(
|
|
1805
|
-
asPointer(t, scroller),
|
|
1785
|
+
asPointer(t, scroller, event),
|
|
1806
1786
|
measureHeightRef.current(),
|
|
1807
1787
|
armed.contentEndY,
|
|
1808
1788
|
);
|
|
1809
|
-
pointerMoveRef.current(asPointer(t, scroller));
|
|
1789
|
+
pointerMoveRef.current(asPointer(t, scroller, event));
|
|
1810
1790
|
}
|
|
1811
1791
|
} else {
|
|
1812
1792
|
armed.contentEndY = null;
|
|
@@ -1826,7 +1806,7 @@ export function useSheetGestures({
|
|
|
1826
1806
|
);
|
|
1827
1807
|
const target = event.currentTarget as HTMLElement;
|
|
1828
1808
|
if (t) {
|
|
1829
|
-
endDragRef.current(asPointer(t, target));
|
|
1809
|
+
endDragRef.current(asPointer(t, target, event));
|
|
1830
1810
|
} else if (event.touches.length === 0) {
|
|
1831
1811
|
// Some interrupted multi-touch sequences omit the active touch from
|
|
1832
1812
|
// changedTouches. If no fingers remain, the drag cannot finish later.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import {useMemo, type ReactNode} from 'react';
|
|
20
|
-
import {createLayerScopedContext
|
|
20
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
21
21
|
import * as stylex from '@stylexjs/stylex';
|
|
22
22
|
import {spacingVars} from '../theme/tokens.stylex';
|
|
23
23
|
import {mergeProps} from '../utils';
|
|
@@ -55,10 +55,11 @@ export interface BreadcrumbContextValue {
|
|
|
55
55
|
separator: ReactNode;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export const BreadcrumbContext =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
export const BreadcrumbContext =
|
|
59
|
+
createLayerScopedContext<BreadcrumbContextValue>('BreadcrumbContext', 1, {
|
|
60
|
+
variant: 'default',
|
|
61
|
+
separator: '/',
|
|
62
|
+
});
|
|
62
63
|
BreadcrumbContext.displayName = 'BreadcrumbContext';
|
|
63
64
|
|
|
64
65
|
// =============================================================================
|
|
@@ -151,7 +151,7 @@ export const docs = {
|
|
|
151
151
|
{
|
|
152
152
|
name: 'isDisabled',
|
|
153
153
|
type: 'boolean',
|
|
154
|
-
description: 'Disables the button.
|
|
154
|
+
description: 'Disables the button. Uses aria-disabled instead of native disabled so the button stays focusable.',
|
|
155
155
|
default: 'false',
|
|
156
156
|
},
|
|
157
157
|
{
|
|
@@ -351,7 +351,7 @@ export const docsZh = {
|
|
|
351
351
|
{
|
|
352
352
|
name: 'isDisabled',
|
|
353
353
|
type: 'boolean',
|
|
354
|
-
description: '
|
|
354
|
+
description: '禁用按钮。使用 aria-disabled 代替原生 disabled 以保持可聚焦。',
|
|
355
355
|
default: 'false',
|
|
356
356
|
},
|
|
357
357
|
{name: 'icon', type: 'ReactNode', description: '图标元素。未显式指定尺寸的 Astryx Icon 在 sm/md 按钮中默认为 sm,在 lg 按钮中默认为 md。仅提供 icon 而不提供 children 时,按钮渲染为正方形的纯图标按钮。'},
|
|
@@ -430,6 +430,6 @@ export const docsDense = {
|
|
|
430
430
|
tooltip: 'tooltip on hover',
|
|
431
431
|
onClick: 'standard click handler; fires before clickAction',
|
|
432
432
|
clickAction: 'async click handler; shows loading while promise pending',
|
|
433
|
-
isDisabled: 'disables button; uses aria-disabled
|
|
433
|
+
isDisabled: 'disables button; uses aria-disabled instead of native disabled',
|
|
434
434
|
},
|
|
435
435
|
};
|
package/src/Button/Button.tsx
CHANGED
|
@@ -769,12 +769,6 @@ export function Button({
|
|
|
769
769
|
// (credit @AKnassa, #4879), which is exactly the bug this PR fixes.
|
|
770
770
|
const renderAsLink = href != null && !isTrueDisabled;
|
|
771
771
|
|
|
772
|
-
// Use aria-disabled (button stays focusable) when busy-only, or when a
|
|
773
|
-
// tooltip is present so keyboard users can still reach it. A genuinely
|
|
774
|
-
// isDisabled/group-disabled button (not busy) keeps native disabled.
|
|
775
|
-
const useAriaDisabled =
|
|
776
|
-
buttonDisabled && (isBusyOnlyDisabled || tooltip != null);
|
|
777
|
-
|
|
778
772
|
// Attach tooltip behavior via the hook rather than wrapping the button in a
|
|
779
773
|
// <Tooltip> element. The hook adds hover/focus triggers to the button itself,
|
|
780
774
|
// so no extra DOM node is inserted — the button stays a direct child of its
|
|
@@ -790,15 +784,9 @@ export function Button({
|
|
|
790
784
|
// a re-click while pending starts a fresh action that interrupts the prior.
|
|
791
785
|
if (buttonDisabled || (actionInFlightRef.current && !isInterruptible)) {
|
|
792
786
|
e.preventDefault();
|
|
793
|
-
//
|
|
794
|
-
//
|
|
795
|
-
//
|
|
796
|
-
// interactive element the DOM keeps dispatching clicks on —
|
|
797
|
-
// preventDefault alone only cancels the button's OWN default action
|
|
798
|
-
// (form submit, link navigation), not propagation. Without this, an
|
|
799
|
-
// unavailable Button inside a clickable row/card/backdrop still
|
|
800
|
-
// triggers that ancestor's action, which the previously native-disabled
|
|
801
|
-
// control never did.
|
|
787
|
+
// An aria-disabled button still receives clicks. preventDefault cancels
|
|
788
|
+
// only its own default action, such as a form submit. Stop propagation
|
|
789
|
+
// so a clickable ancestor does not act.
|
|
802
790
|
e.stopPropagation();
|
|
803
791
|
return;
|
|
804
792
|
}
|
|
@@ -815,9 +803,9 @@ export function Button({
|
|
|
815
803
|
}
|
|
816
804
|
};
|
|
817
805
|
|
|
818
|
-
//
|
|
819
|
-
//
|
|
820
|
-
const handleKeyDown =
|
|
806
|
+
// A disabled button cancels Enter and Space, its activation keys. Other
|
|
807
|
+
// keys, such as Escape and the arrows, still reach the caller's handler.
|
|
808
|
+
const handleKeyDown = buttonDisabled
|
|
821
809
|
? (e: React.KeyboardEvent<HTMLButtonElement>) => {
|
|
822
810
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
823
811
|
e.preventDefault();
|
|
@@ -846,7 +834,7 @@ export function Button({
|
|
|
846
834
|
isGroupTracked && styles.trackedOverlay,
|
|
847
835
|
buttonDisabled && styles.inactive,
|
|
848
836
|
isTrueDisabled && styles.disabled,
|
|
849
|
-
|
|
837
|
+
buttonDisabled && styles.ariaDisabled,
|
|
850
838
|
renderAsLink && styles.link,
|
|
851
839
|
!buttonGroup &&
|
|
852
840
|
(isGroupTracked ? styles.pressableTracked : styles.pressable),
|
|
@@ -1004,7 +992,7 @@ export function Button({
|
|
|
1004
992
|
// A caller's own busy or disabled state is kept, so a component that
|
|
1005
993
|
// hands these props to a Button (a caller-rendered trigger) is heard.
|
|
1006
994
|
aria-busy={isLoadingState || props['aria-busy'] || undefined}
|
|
1007
|
-
aria-disabled={
|
|
995
|
+
aria-disabled={buttonDisabled || props['aria-disabled'] || undefined}
|
|
1008
996
|
onClick={handleClick}
|
|
1009
997
|
{...(handleKeyDown ? {onKeyDown: handleKeyDown} : null)}>
|
|
1010
998
|
{buttonContent}
|
|
@@ -1015,7 +1003,6 @@ export function Button({
|
|
|
1015
1003
|
<button
|
|
1016
1004
|
ref={mergedButtonRef}
|
|
1017
1005
|
type={type}
|
|
1018
|
-
disabled={useAriaDisabled ? undefined : buttonDisabled}
|
|
1019
1006
|
{...(inputGroup != null && buttonGroup == null
|
|
1020
1007
|
? inputGroupItemProps
|
|
1021
1008
|
: undefined)}
|
|
@@ -1023,13 +1010,14 @@ export function Button({
|
|
|
1023
1010
|
{...pressFeedback}
|
|
1024
1011
|
{...groupItemProps}
|
|
1025
1012
|
{...props}
|
|
1013
|
+
{...(isTrueDisabled ? {name: undefined} : null)}
|
|
1026
1014
|
{...ariaLabelProp}
|
|
1027
1015
|
{...describedByProp}
|
|
1028
1016
|
{...edgeCompAttr}
|
|
1029
1017
|
// A caller's own busy or disabled state is kept, so a component that
|
|
1030
1018
|
// hands these props to a Button (a caller-rendered trigger) is heard.
|
|
1031
1019
|
aria-busy={isLoadingState || props['aria-busy'] || undefined}
|
|
1032
|
-
aria-disabled={
|
|
1020
|
+
aria-disabled={buttonDisabled || props['aria-disabled'] || undefined}
|
|
1033
1021
|
onClick={handleClick}
|
|
1034
1022
|
{...(handleKeyDown ? {onKeyDown: handleKeyDown} : null)}>
|
|
1035
1023
|
{buttonContent}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file buttonHitArea.ts
|
|
7
|
-
* @input Uses
|
|
7
|
+
* @input Uses createSharedContext and the touch hit-area options type
|
|
8
8
|
* @output Exports ButtonHitAreaContext, the touch hit-area options a Button
|
|
9
9
|
* passes to useTouchHitArea, and BUTTON_HIT_AREA, their default
|
|
10
10
|
* @position Internal to Core. A Core part that renders a Button and needs a
|
|
11
11
|
* different band, such as InputClearButton, provides its own options.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
15
15
|
import type {TouchHitAreaOptions} from '../utils/touchHitArea';
|
|
16
16
|
|
|
17
17
|
// The band is on the content wrapper, so a band tap lands on a descendant.
|
|
@@ -21,6 +21,9 @@ export const BUTTON_HIT_AREA: TouchHitAreaOptions = {
|
|
|
21
21
|
ownsDescendantTouches: false,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export const ButtonHitAreaContext =
|
|
25
|
-
|
|
24
|
+
export const ButtonHitAreaContext = createSharedContext<TouchHitAreaOptions>(
|
|
25
|
+
'ButtonHitAreaContext',
|
|
26
|
+
1,
|
|
27
|
+
BUTTON_HIT_AREA,
|
|
28
|
+
);
|
|
26
29
|
ButtonHitAreaContext.displayName = 'ButtonHitAreaContext';
|
|
@@ -95,7 +95,7 @@ export const docs = {
|
|
|
95
95
|
{guidance: false, description: "Don't nest ButtonGroups. If you need multiple groups, place them side by side with a gap."},
|
|
96
96
|
{guidance: true, description: 'Name the group for what its buttons act on. The label is the group\'s accessible name and a screen reader reads it before each member.'},
|
|
97
97
|
{guidance: true, description: 'Keep the group a single Tab stop. Arrow keys move between members along the orientation, and Home/End jump to the ends. This is the WAI-ARIA APG roving tabindex technique: https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex'},
|
|
98
|
-
{guidance: false, description: "Don't disable the group to show that an action is in flight.
|
|
98
|
+
{guidance: false, description: "Don't disable the group to show that an action is in flight. Leave the group enabled and show progress on the button that started the work."},
|
|
99
99
|
],
|
|
100
100
|
anatomy: [
|
|
101
101
|
{name: 'Button', required: true, description: 'One or more Button or IconButton children that form the connected group.'},
|
|
@@ -136,7 +136,7 @@ export const docsZh = {
|
|
|
136
136
|
{guidance: false, description: '不要嵌套 ButtonGroup。如需多个组,请并排放置并留有间隔。'},
|
|
137
137
|
{guidance: true, description: '按钮组的标签应说明这些按钮作用于什么。该标签是按钮组的无障碍名称,屏幕阅读器会在每个成员之前朗读它。'},
|
|
138
138
|
{guidance: true, description: '按钮组是单个 Tab 停靠点。方向键沿排列方向在成员间移动焦点,Home/End 跳到首尾,禁用成员会被跳过——即 WAI-ARIA APG 的 roving tabindex 技术。'},
|
|
139
|
-
{guidance: false, description: '
|
|
139
|
+
{guidance: false, description: '不要用禁用整个按钮组来表示操作进行中。请保持按钮组可用,并在发起操作的按钮上显示进度。'},
|
|
140
140
|
],
|
|
141
141
|
anatomy: [
|
|
142
142
|
{name: '按钮', required: true, description: '一个或多个 Button 或 IconButton 子元素,形成连接的组。'},
|
|
@@ -161,7 +161,7 @@ export const docsDense = {
|
|
|
161
161
|
{guidance: true, description: 'Label the group for what its buttons act on; it is the accessible name.'},
|
|
162
162
|
{guidance: true, description: 'Single Tab stop; arrows move between members, Home/End to ends (APG roving tabindex).'},
|
|
163
163
|
{guidance: true, description: 'Under the touch presentation a press tracks like a menu: slide across, the lifted button runs, a lift outside runs nothing. A mouse press acts as a native button\'s. Finger targets grow toward 44 px, up to half the gap to a neighbour; a menu trigger keeps its own opening.'},
|
|
164
|
-
{guidance: false, description: "Don't disable the group for an in-flight action;
|
|
164
|
+
{guidance: false, description: "Don't disable the group for an in-flight action; show progress on the active button instead."},
|
|
165
165
|
],
|
|
166
166
|
},
|
|
167
167
|
components: [
|
|
@@ -28,7 +28,7 @@ import type {ButtonSize} from '../Button';
|
|
|
28
28
|
import {radiusVars, shadowVars} from '../theme/tokens.stylex';
|
|
29
29
|
import type {Elevation} from '../utils/types';
|
|
30
30
|
import {SizeProvider, useSize} from '../SizeContext/SizeContext';
|
|
31
|
-
import {
|
|
31
|
+
import {oneTabStopAmong, useInternalListFocus} from '../hooks/useListFocus';
|
|
32
32
|
import {PressGroupContext} from '../hooks/pressGroupContext';
|
|
33
33
|
import {
|
|
34
34
|
GROUP_PRESS_POINTERS,
|
|
@@ -137,6 +137,16 @@ const elevationStyles = stylex.create({
|
|
|
137
137
|
// Component
|
|
138
138
|
// =============================================================================
|
|
139
139
|
|
|
140
|
+
// Roving rewrites `tabindex` on every item, so the selector cannot key off
|
|
141
|
+
// a value: `[tabindex="0"]` would drop each member the moment it is stamped
|
|
142
|
+
// -1. `a[href]` catches a Button rendered with `href`.
|
|
143
|
+
const MEMBER_SELECTOR = 'button, a[href], [tabindex]';
|
|
144
|
+
|
|
145
|
+
const keepDisabledGroupStop = oneTabStopAmong(
|
|
146
|
+
MEMBER_SELECTOR,
|
|
147
|
+
'[role="group"], [popover]',
|
|
148
|
+
);
|
|
149
|
+
|
|
140
150
|
/**
|
|
141
151
|
* Groups buttons with connected styling — shared borders, proper border-radius
|
|
142
152
|
* handling (only on outer edges), and horizontal or vertical orientation.
|
|
@@ -189,21 +199,22 @@ export function ButtonGroup({
|
|
|
189
199
|
}: ButtonGroupProps): ReactNode {
|
|
190
200
|
const size = useSize(sizeProp, 'md');
|
|
191
201
|
|
|
192
|
-
const {listRef, handleKeyDown, handleFocus} =
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
const {listRef, handleKeyDown, handleFocus} =
|
|
203
|
+
useInternalListFocus<HTMLDivElement>({
|
|
204
|
+
itemSelector: MEMBER_SELECTOR,
|
|
205
|
+
// A member's layer renders inline inside the group (useLayer does not
|
|
206
|
+
// portal it), so a key pressed in an open DropdownMenu bubbles here. The
|
|
207
|
+
// boundary is the group's own root or any layer, whichever is nearer to
|
|
208
|
+
// the target. Naming the group's own root is what keeps a group rendered
|
|
209
|
+
// inside a Popover or Toast working: bailing on any [popover] ancestor
|
|
210
|
+
// instead would swallow every arrow key it owns.
|
|
211
|
+
boundarySelector: '[role="group"], [popover]',
|
|
212
|
+
orientation,
|
|
213
|
+
hasRovingTabIndex: true,
|
|
214
|
+
// A group of disabled buttons keeps its one Tab stop, so a keyboard user
|
|
215
|
+
// still reaches it. Its members are focusable while disabled.
|
|
216
|
+
tabStopOrder: keepDisabledGroupStop,
|
|
217
|
+
});
|
|
207
218
|
|
|
208
219
|
const contextValue = useMemo(
|
|
209
220
|
() => ({orientation, isDisabled}),
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {use} from 'react';
|
|
13
|
-
import {createLayerScopedContext
|
|
13
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
14
14
|
|
|
15
15
|
export type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
16
16
|
|
|
@@ -19,9 +19,12 @@ export interface ButtonGroupContextValue {
|
|
|
19
19
|
isDisabled: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export const ButtonGroupContext =
|
|
23
|
-
null
|
|
24
|
-
|
|
22
|
+
export const ButtonGroupContext =
|
|
23
|
+
createLayerScopedContext<ButtonGroupContextValue | null>(
|
|
24
|
+
'ButtonGroupContext',
|
|
25
|
+
1,
|
|
26
|
+
null,
|
|
27
|
+
);
|
|
25
28
|
ButtonGroupContext.displayName = 'ButtonGroupContext';
|
|
26
29
|
|
|
27
30
|
/**
|
|
@@ -53,7 +53,7 @@ import {Button} from '../Button';
|
|
|
53
53
|
import {Icon} from '../Icon';
|
|
54
54
|
import {useLayer} from '../Layer';
|
|
55
55
|
import {useAttachment} from '../hooks/useAttachment';
|
|
56
|
-
import {
|
|
56
|
+
import {useShownScrollOverflow} from '../hooks/useScrollOverflow';
|
|
57
57
|
import {isRtlElement} from '../hooks/isRtlElement';
|
|
58
58
|
import type {BaseProps} from '../BaseProps';
|
|
59
59
|
import {mergeProps, rtlStyles} from '../utils';
|
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
attachSnapPaging,
|
|
66
66
|
isSnapPaging,
|
|
67
67
|
moveHeldSnapPaging,
|
|
68
|
+
moveSnapPaging,
|
|
68
69
|
nearestStop,
|
|
69
70
|
type SnapPaging,
|
|
70
71
|
snapStops,
|
|
@@ -408,8 +409,8 @@ export function Carousel({
|
|
|
408
409
|
// transition it is allowed to act on.
|
|
409
410
|
const focusedNavRef = useRef<'start' | 'end' | null>(null);
|
|
410
411
|
const prevCanScrollRef = useRef<{start: boolean; end: boolean} | null>(null);
|
|
411
|
-
const {scrollRef, overflowStart, overflowEnd, hasOverflow} =
|
|
412
|
-
|
|
412
|
+
const {scrollRef, followShown, overflowStart, overflowEnd, hasOverflow} =
|
|
413
|
+
useShownScrollOverflow();
|
|
413
414
|
|
|
414
415
|
// Children.toArray drops null/undefined/boolean children and assigns
|
|
415
416
|
// stable keys, so slide numbering ("Slide N of M") matches what actually
|
|
@@ -447,12 +448,13 @@ export function Carousel({
|
|
|
447
448
|
setAttachedPaging(snapPaging);
|
|
448
449
|
}
|
|
449
450
|
// Attaches snap paging to the scroll area, and follows a replaced one.
|
|
451
|
+
// While the paging holds the row, the edges follow the row as shown.
|
|
450
452
|
useAttachment(
|
|
451
453
|
scrollElRef,
|
|
452
454
|
scroller =>
|
|
453
455
|
attachedPaging == null
|
|
454
456
|
? () => {}
|
|
455
|
-
: attachSnapPaging(attachedPaging, scroller),
|
|
457
|
+
: attachSnapPaging(attachedPaging, scroller, followShown),
|
|
456
458
|
attachedPaging,
|
|
457
459
|
);
|
|
458
460
|
// React's wheel listener is passive, so it can't stop the browser's own
|
|
@@ -506,9 +508,10 @@ export function Carousel({
|
|
|
506
508
|
if (!el) {
|
|
507
509
|
return;
|
|
508
510
|
}
|
|
509
|
-
//
|
|
511
|
+
// Under snap paging the paging moves the row, held or at rest. A touch
|
|
512
|
+
// then catches the move, and the release rests on a page.
|
|
510
513
|
if (
|
|
511
|
-
|
|
514
|
+
moveSnapPaging(el, (at, end) =>
|
|
512
515
|
pagingStep(el, at, end, direction, hasLoop && hasOverflow),
|
|
513
516
|
)
|
|
514
517
|
) {
|
|
@@ -589,8 +592,15 @@ export function Carousel({
|
|
|
589
592
|
const delta = isRtlElement(el)
|
|
590
593
|
? itemRect.right - containerRect.right
|
|
591
594
|
: itemRect.left - containerRect.left;
|
|
595
|
+
// Under snap paging the row goes to the item's stop, inside the scroll
|
|
596
|
+
// padding, so the hand-back's snap does not pull it back.
|
|
592
597
|
if (
|
|
593
|
-
|
|
598
|
+
moveSnapPaging(el, (at, end) =>
|
|
599
|
+
nearestStop(
|
|
600
|
+
snapStops(el, at, end),
|
|
601
|
+
at + (isRtlElement(el) ? -delta : delta),
|
|
602
|
+
),
|
|
603
|
+
)
|
|
594
604
|
) {
|
|
595
605
|
return;
|
|
596
606
|
}
|
|
@@ -771,6 +781,9 @@ export function Carousel({
|
|
|
771
781
|
layer.render(
|
|
772
782
|
<>
|
|
773
783
|
<div
|
|
784
|
+
// A hidden button is never a Tab stop or in the a11y tree. Its
|
|
785
|
+
// disabled state alone would keep it focusable.
|
|
786
|
+
inert={!canScrollStart || undefined}
|
|
774
787
|
{...stylex.props(
|
|
775
788
|
styles.buttonPill,
|
|
776
789
|
styles.buttonPillStart,
|
|
@@ -790,18 +803,18 @@ export function Carousel({
|
|
|
790
803
|
size="sm"
|
|
791
804
|
isIconOnly
|
|
792
805
|
// Disabled when there's nothing to scroll toward. Keeps the
|
|
793
|
-
// button mounted (stable layout)
|
|
794
|
-
//
|
|
795
|
-
//
|
|
796
|
-
// hands focus to the scroll area when the state behind this
|
|
797
|
-
// one flips it disabled.
|
|
806
|
+
// button mounted (stable layout). The Effect above hands focus
|
|
807
|
+
// to the scroll area when the state behind this one flips it
|
|
808
|
+
// disabled.
|
|
798
809
|
isDisabled={!canScrollStart}
|
|
799
810
|
onFocus={() => {
|
|
800
811
|
focusedNavRef.current = 'start';
|
|
801
812
|
}}
|
|
802
813
|
onBlur={event => {
|
|
803
814
|
// A disabled button was blurred by the commit, not the person.
|
|
804
|
-
if (
|
|
815
|
+
if (
|
|
816
|
+
event.currentTarget.getAttribute('aria-disabled') !== 'true'
|
|
817
|
+
) {
|
|
805
818
|
focusedNavRef.current = null;
|
|
806
819
|
}
|
|
807
820
|
}}
|
|
@@ -810,6 +823,9 @@ export function Carousel({
|
|
|
810
823
|
/>
|
|
811
824
|
</div>
|
|
812
825
|
<div
|
|
826
|
+
// A hidden button is never a Tab stop or in the a11y tree. Its
|
|
827
|
+
// disabled state alone would keep it focusable.
|
|
828
|
+
inert={!canScrollEnd || undefined}
|
|
813
829
|
{...stylex.props(
|
|
814
830
|
styles.buttonPill,
|
|
815
831
|
styles.buttonPillEnd,
|
|
@@ -829,14 +845,16 @@ export function Carousel({
|
|
|
829
845
|
size="sm"
|
|
830
846
|
isIconOnly
|
|
831
847
|
// See "Scroll left" — disabled while visually hidden so the
|
|
832
|
-
// button stays mounted
|
|
848
|
+
// button stays mounted.
|
|
833
849
|
isDisabled={!canScrollEnd}
|
|
834
850
|
onFocus={() => {
|
|
835
851
|
focusedNavRef.current = 'end';
|
|
836
852
|
}}
|
|
837
853
|
onBlur={event => {
|
|
838
854
|
// A disabled button was blurred by the commit, not the person.
|
|
839
|
-
if (
|
|
855
|
+
if (
|
|
856
|
+
event.currentTarget.getAttribute('aria-disabled') !== 'true'
|
|
857
|
+
) {
|
|
840
858
|
focusedNavRef.current = null;
|
|
841
859
|
}
|
|
842
860
|
}}
|
package/src/Chat/ChatContext.tsx
CHANGED
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
* ChatComposerInput, ChatSendButton, and custom inputs.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {use, type RefObject} from 'react';
|
|
16
16
|
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
17
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
17
18
|
|
|
18
19
|
export type ChatMessageSender = 'user' | 'assistant' | 'system';
|
|
19
20
|
export type ChatDensity = 'compact' | 'balanced' | 'spacious';
|
|
@@ -24,7 +25,11 @@ export interface ChatMessageContextValue {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export const ChatMessageContext =
|
|
27
|
-
createLayerScopedContext<ChatMessageContextValue | null>(
|
|
28
|
+
createLayerScopedContext<ChatMessageContextValue | null>(
|
|
29
|
+
'ChatMessageContext',
|
|
30
|
+
1,
|
|
31
|
+
null,
|
|
32
|
+
);
|
|
28
33
|
ChatMessageContext.displayName = 'ChatMessageContext';
|
|
29
34
|
|
|
30
35
|
export function useChatMessageContext(): ChatMessageContextValue | null {
|
|
@@ -36,7 +41,11 @@ export interface ChatListContextValue {
|
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
export const ChatListContext =
|
|
39
|
-
createLayerScopedContext<ChatListContextValue | null>(
|
|
44
|
+
createLayerScopedContext<ChatListContextValue | null>(
|
|
45
|
+
'ChatListContext',
|
|
46
|
+
1,
|
|
47
|
+
null,
|
|
48
|
+
);
|
|
40
49
|
ChatListContext.displayName = 'ChatListContext';
|
|
41
50
|
|
|
42
51
|
export function useChatListContext(): ChatListContextValue | null {
|
|
@@ -83,7 +92,11 @@ export interface ChatComposerContextValue {
|
|
|
83
92
|
}
|
|
84
93
|
|
|
85
94
|
export const ChatComposerContext =
|
|
86
|
-
|
|
95
|
+
createSharedContext<ChatComposerContextValue | null>(
|
|
96
|
+
'ChatComposerContext',
|
|
97
|
+
1,
|
|
98
|
+
null,
|
|
99
|
+
);
|
|
87
100
|
ChatComposerContext.displayName = 'ChatComposerContext';
|
|
88
101
|
|
|
89
102
|
export function useChatComposerContext(): ChatComposerContextValue | null {
|
|
@@ -101,9 +114,12 @@ export interface ChatLayoutContextValue {
|
|
|
101
114
|
contentRef: (el: HTMLElement | null) => void;
|
|
102
115
|
}
|
|
103
116
|
|
|
104
|
-
export const ChatLayoutContext =
|
|
105
|
-
null
|
|
106
|
-
|
|
117
|
+
export const ChatLayoutContext =
|
|
118
|
+
createSharedContext<ChatLayoutContextValue | null>(
|
|
119
|
+
'ChatLayoutContext',
|
|
120
|
+
1,
|
|
121
|
+
null,
|
|
122
|
+
);
|
|
107
123
|
ChatLayoutContext.displayName = 'ChatLayoutContext';
|
|
108
124
|
|
|
109
125
|
export function useChatLayoutContext(): ChatLayoutContextValue | null {
|