@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
|
@@ -10,10 +10,14 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {use} from 'react';
|
|
13
|
-
import {createLayerScopedContext
|
|
13
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
14
14
|
import type {IconSize} from './IconSize.stylex';
|
|
15
15
|
|
|
16
|
-
const IconDefaultSizeContext =
|
|
16
|
+
const IconDefaultSizeContext = createLayerScopedContext<IconSize | null>(
|
|
17
|
+
'IconDefaultSizeContext',
|
|
18
|
+
1,
|
|
19
|
+
null,
|
|
20
|
+
);
|
|
17
21
|
IconDefaultSizeContext.displayName = 'IconDefaultSizeContext';
|
|
18
22
|
|
|
19
23
|
export const IconDefaultSizeProvider = IconDefaultSizeContext.Provider;
|
|
@@ -55,7 +55,7 @@ export const docs = {
|
|
|
55
55
|
name: 'isDisabled',
|
|
56
56
|
type: 'boolean',
|
|
57
57
|
description:
|
|
58
|
-
'Disables the button.
|
|
58
|
+
'Disables the button. Uses aria-disabled instead of native disabled so the button stays focusable.',
|
|
59
59
|
default: 'false',
|
|
60
60
|
},
|
|
61
61
|
{
|
|
@@ -249,7 +249,7 @@ export const docsDense = {
|
|
|
249
249
|
'resting shadow depth: none|low|med|high; raise for a floating action button (FAB)',
|
|
250
250
|
isLoading:
|
|
251
251
|
'shows loading spinner, blocks re-activation but stays focusable (aria-disabled, not native disabled)',
|
|
252
|
-
isDisabled: 'disables button; uses aria-disabled
|
|
252
|
+
isDisabled: 'disables button; uses aria-disabled instead of native disabled',
|
|
253
253
|
tooltip:
|
|
254
254
|
'tooltip on hover + keyboard focus; also describes the button unless it repeats the accessible name',
|
|
255
255
|
onClick: 'standard click handler',
|
|
@@ -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 interface InputGroupContextValue {
|
|
16
16
|
isInGroup: true;
|
|
@@ -20,9 +20,12 @@ export interface InputGroupContextValue {
|
|
|
20
20
|
describedByIDs?: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export const InputGroupContext =
|
|
24
|
-
null
|
|
25
|
-
|
|
23
|
+
export const InputGroupContext =
|
|
24
|
+
createLayerScopedContext<InputGroupContextValue | null>(
|
|
25
|
+
'InputGroupContext',
|
|
26
|
+
1,
|
|
27
|
+
null,
|
|
28
|
+
);
|
|
26
29
|
InputGroupContext.displayName = 'InputGroupContext';
|
|
27
30
|
|
|
28
31
|
/**
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
* @position Internal group state; not re-exported by index.ts
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {createLayerScopedContext
|
|
12
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
13
13
|
|
|
14
|
-
export const InputGroupInternalContext =
|
|
14
|
+
export const InputGroupInternalContext = createLayerScopedContext(
|
|
15
|
+
'InputGroupInternalContext',
|
|
16
|
+
1,
|
|
17
|
+
{isDisabled: false},
|
|
18
|
+
);
|
|
15
19
|
InputGroupInternalContext.displayName = 'InputGroupInternalContext';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file InteractiveRoleContext.ts
|
|
7
|
-
* @input
|
|
7
|
+
* @input createSharedContext, use
|
|
8
8
|
* @output Exports InteractiveRoleContext, useInteractiveRoleContext
|
|
9
9
|
* @position Context primitive; consumed by useInteractiveRole hook
|
|
10
10
|
*
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
* - /packages/core/src/InteractiveRoleContext/index.ts
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import {
|
|
26
|
+
import {use} from 'react';
|
|
27
27
|
import type {InteractiveRole} from '../hooks/useInteractiveRole';
|
|
28
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* Context that provides a role override to child components.
|
|
@@ -37,7 +38,11 @@ import type {InteractiveRole} from '../hooks/useInteractiveRole';
|
|
|
37
38
|
* `null` means no parent is overriding — resolve based on own props.
|
|
38
39
|
*/
|
|
39
40
|
export const InteractiveRoleContext =
|
|
40
|
-
|
|
41
|
+
createSharedContext<InteractiveRole | null>(
|
|
42
|
+
'InteractiveRoleContext',
|
|
43
|
+
1,
|
|
44
|
+
null,
|
|
45
|
+
);
|
|
41
46
|
InteractiveRoleContext.displayName = 'InteractiveRoleContext';
|
|
42
47
|
|
|
43
48
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file ItemDescriptionContext.tsx
|
|
7
|
-
* @input Uses
|
|
7
|
+
* @input Uses createSharedContext
|
|
8
8
|
* @output Exports ItemDescriptionContext
|
|
9
9
|
* @position Internal seam between Item and a control it renders in a slot
|
|
10
10
|
*
|
|
@@ -23,7 +23,11 @@
|
|
|
23
23
|
* `aria-describedby`.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import {
|
|
26
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
27
27
|
|
|
28
|
-
export const ItemDescriptionContext =
|
|
28
|
+
export const ItemDescriptionContext = createSharedContext<string | null>(
|
|
29
|
+
'ItemDescriptionContext',
|
|
30
|
+
1,
|
|
31
|
+
null,
|
|
32
|
+
);
|
|
29
33
|
ItemDescriptionContext.displayName = 'ItemDescriptionContext';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file ItemListRowContext.tsx
|
|
7
|
-
* @input Uses
|
|
7
|
+
* @input Uses createSharedContext
|
|
8
8
|
* @output Exports ItemListRowContext
|
|
9
9
|
* @position Internal seam between ListItem and the Item it renders. Under a
|
|
10
10
|
* coarse primary pointer a List row's whole touch target follows its link,
|
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
* content, and a standalone Item has none.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
16
16
|
|
|
17
|
-
export const ItemListRowContext =
|
|
17
|
+
export const ItemListRowContext = createSharedContext(
|
|
18
|
+
'ItemListRowContext',
|
|
19
|
+
1,
|
|
20
|
+
false,
|
|
21
|
+
);
|
|
18
22
|
ItemListRowContext.displayName = 'ItemListRowContext';
|
|
@@ -14,7 +14,12 @@
|
|
|
14
14
|
* marker and does not inherit the formatting request.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import
|
|
17
|
+
import type {ReactNode} from 'react';
|
|
18
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
18
19
|
|
|
19
|
-
export const ItemMarkerColumnsContext =
|
|
20
|
+
export const ItemMarkerColumnsContext = createSharedContext<ReactNode>(
|
|
21
|
+
'ItemMarkerColumnsContext',
|
|
22
|
+
1,
|
|
23
|
+
null,
|
|
24
|
+
);
|
|
20
25
|
ItemMarkerColumnsContext.displayName = 'ItemMarkerColumnsContext';
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* - /packages/core/src/Layer/LayerProvider.tsx
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import {use} from 'react';
|
|
17
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* The inset an app declares for a persistent bar floating over a viewport
|
|
@@ -68,7 +69,11 @@ export interface LayerContextValue {
|
|
|
68
69
|
* React context for the layer provider.
|
|
69
70
|
* Default value is null — hooks detect this and use the fallback.
|
|
70
71
|
*/
|
|
71
|
-
export const LayerContext =
|
|
72
|
+
export const LayerContext = createSharedContext<LayerContextValue | null>(
|
|
73
|
+
'LayerContext',
|
|
74
|
+
1,
|
|
75
|
+
null,
|
|
76
|
+
);
|
|
72
77
|
LayerContext.displayName = 'LayerContext';
|
|
73
78
|
|
|
74
79
|
/**
|
|
@@ -28,13 +28,14 @@
|
|
|
28
28
|
* each layer provides depth for its OWN content, so nesting composes on its own.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
import {
|
|
31
|
+
import {use, type ReactNode} from 'react';
|
|
32
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* How many layers deep the current subtree is. 0 at the app root; each layer
|
|
35
36
|
* increments it for its own content.
|
|
36
37
|
*/
|
|
37
|
-
export const LayerDepthContext =
|
|
38
|
+
export const LayerDepthContext = createSharedContext('LayerDepthContext', 1, 0);
|
|
38
39
|
LayerDepthContext.displayName = 'LayerDepthContext';
|
|
39
40
|
|
|
40
41
|
/**
|
package/src/Layer/LayerTouch.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @file LayerTouch.ts
|
|
7
7
|
* @input useLayerKeyboardClearance.ts (the software keyboard's part of the
|
|
8
8
|
* viewport caps)
|
|
9
|
-
* @output The layer runtime's touch layer: useLayerKeyboardClearance
|
|
9
|
+
* @output The layer runtime's touch layer: useLayerKeyboardClearance and
|
|
10
|
+
* keyboardLiftStyle
|
|
10
11
|
* @position The one module the layer runtime imports touch-only code through,
|
|
11
12
|
* and its only import site is useLayer.tsx. It is imported statically, as
|
|
12
13
|
* every touch module is.
|
|
@@ -14,4 +15,7 @@
|
|
|
14
15
|
* SYNC: When modified, keep every touch-only import of useLayer.tsx here.
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
export {
|
|
18
|
+
export {
|
|
19
|
+
keyboardLiftStyle,
|
|
20
|
+
useLayerKeyboardClearance,
|
|
21
|
+
} from './useLayerKeyboardClearance';
|
package/src/Layer/anchorName.ts
CHANGED
|
@@ -39,8 +39,12 @@ export function addAnchorName(el: HTMLElement, name: string): void {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export function removeAnchorName(el: HTMLElement, name: string): void {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const names = readAnchorNames(el);
|
|
43
|
+
// A write invalidates the element's style even when the value is the same.
|
|
44
|
+
if (names.includes(name)) {
|
|
45
|
+
writeAnchorNames(
|
|
46
|
+
el,
|
|
47
|
+
names.filter(existing => existing !== name),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
46
50
|
}
|
package/src/Layer/inputHold.ts
CHANGED
|
@@ -21,9 +21,11 @@ import {
|
|
|
21
21
|
parentAcrossShadow,
|
|
22
22
|
} from '../utils/flatTree';
|
|
23
23
|
import {
|
|
24
|
+
getDownPresses,
|
|
24
25
|
getLastMousePoint,
|
|
25
26
|
getLastPointerType,
|
|
26
27
|
subscribeInput,
|
|
28
|
+
type MousePoint,
|
|
27
29
|
} from '../utils/inputStream';
|
|
28
30
|
import {isDocument, isElement, isHTMLElement, isNode} from '../utils/nodeType';
|
|
29
31
|
|
|
@@ -58,6 +60,12 @@ interface HeldLayer {
|
|
|
58
60
|
isShieldFull: boolean;
|
|
59
61
|
/** The content a dismissal made inert, and whether each was already. */
|
|
60
62
|
inertContent: Map<Element, boolean> | null;
|
|
63
|
+
/**
|
|
64
|
+
* The pointer ids of the finger and pen presses that were down when the
|
|
65
|
+
* full shield came up. The shield leaves each one open where the stream
|
|
66
|
+
* last heard it, until its press ends.
|
|
67
|
+
*/
|
|
68
|
+
pressOpenings: Set<number>;
|
|
61
69
|
}
|
|
62
70
|
|
|
63
71
|
/** A document while any of its layers is held. */
|
|
@@ -72,6 +80,8 @@ interface PressHold {
|
|
|
72
80
|
hold: () => void;
|
|
73
81
|
/** No new press is held; held ones are followed to their end. */
|
|
74
82
|
release: () => void;
|
|
83
|
+
/** Whether the press with this pointer id is held to its end. */
|
|
84
|
+
holds: (pointerId: number) => boolean;
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
const held = new WeakMap<Element, HeldLayer>();
|
|
@@ -266,6 +276,50 @@ function addShield(layer: Element, isFull: boolean): HTMLElement {
|
|
|
266
276
|
|
|
267
277
|
const MOUSE_OPENING_HALF_SIDE_PX = 2;
|
|
268
278
|
|
|
279
|
+
interface Opening {
|
|
280
|
+
left: number;
|
|
281
|
+
right: number;
|
|
282
|
+
top: number;
|
|
283
|
+
bottom: number;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The square opening around each point. Two openings that overlap become one
|
|
288
|
+
* box that covers both: under the nonzero rule, the overlap of two openings
|
|
289
|
+
* drawn the same way round would count twice and close again.
|
|
290
|
+
*/
|
|
291
|
+
function openings(points: ReadonlyArray<MousePoint>): Opening[] {
|
|
292
|
+
const boxes: Opening[] = [];
|
|
293
|
+
for (const {x, y} of points) {
|
|
294
|
+
let box: Opening = {
|
|
295
|
+
left: x - MOUSE_OPENING_HALF_SIDE_PX,
|
|
296
|
+
right: x + MOUSE_OPENING_HALF_SIDE_PX,
|
|
297
|
+
top: y - MOUSE_OPENING_HALF_SIDE_PX,
|
|
298
|
+
bottom: y + MOUSE_OPENING_HALF_SIDE_PX,
|
|
299
|
+
};
|
|
300
|
+
for (let index = boxes.length - 1; index >= 0; index--) {
|
|
301
|
+
const other = boxes[index];
|
|
302
|
+
if (
|
|
303
|
+
box.left < other.right &&
|
|
304
|
+
other.left < box.right &&
|
|
305
|
+
box.top < other.bottom &&
|
|
306
|
+
other.top < box.bottom
|
|
307
|
+
) {
|
|
308
|
+
box = {
|
|
309
|
+
left: Math.min(box.left, other.left),
|
|
310
|
+
right: Math.max(box.right, other.right),
|
|
311
|
+
top: Math.min(box.top, other.top),
|
|
312
|
+
bottom: Math.max(box.bottom, other.bottom),
|
|
313
|
+
};
|
|
314
|
+
boxes.splice(index, 1);
|
|
315
|
+
index = boxes.length;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
boxes.push(box);
|
|
319
|
+
}
|
|
320
|
+
return boxes;
|
|
321
|
+
}
|
|
322
|
+
|
|
269
323
|
/**
|
|
270
324
|
* Leaves the mouse a way through a presentation's shield that takes hits.
|
|
271
325
|
* The browser hit-tests a press before any script reads its pointer. So a
|
|
@@ -274,7 +328,9 @@ const MOUSE_OPENING_HALF_SIDE_PX = 2;
|
|
|
274
328
|
* the mouse. A shield over the layer's box alone stops taking hits, because
|
|
275
329
|
* the box moves with the layer's entrance. A finger's press there is still
|
|
276
330
|
* held, because the press hold judges each press by its own pointer. A
|
|
277
|
-
*
|
|
331
|
+
* full shield also leaves open each finger or pen press that was down before
|
|
332
|
+
* it came up (see `openToEarlierPresses`). A dismissal's shield keeps every
|
|
333
|
+
* hit.
|
|
278
334
|
*/
|
|
279
335
|
function openToMouse(state: HeldLayer, doc: Document): void {
|
|
280
336
|
const {shield} = state;
|
|
@@ -282,9 +338,19 @@ function openToMouse(state: HeldLayer, doc: Document): void {
|
|
|
282
338
|
return;
|
|
283
339
|
}
|
|
284
340
|
const view = doc.defaultView;
|
|
285
|
-
const
|
|
341
|
+
const mouse = view == null ? null : getLastMousePoint(view);
|
|
342
|
+
const downPresses = view == null ? null : getDownPresses(view);
|
|
343
|
+
const presses: MousePoint[] = [];
|
|
344
|
+
if (state.isShieldFull && downPresses != null) {
|
|
345
|
+
for (const pointerId of state.pressOpenings) {
|
|
346
|
+
const point = downPresses.get(pointerId);
|
|
347
|
+
if (point != null) {
|
|
348
|
+
presses.push(point);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
286
352
|
if (
|
|
287
|
-
|
|
353
|
+
(mouse == null && presses.length === 0) ||
|
|
288
354
|
state.layer > 0 ||
|
|
289
355
|
shield.style.pointerEvents === 'none'
|
|
290
356
|
) {
|
|
@@ -295,27 +361,46 @@ function openToMouse(state: HeldLayer, doc: Document): void {
|
|
|
295
361
|
shield.style.pointerEvents = 'none';
|
|
296
362
|
return;
|
|
297
363
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
`${right}px ${top}px`,
|
|
314
|
-
`0 ${top}px`,
|
|
315
|
-
];
|
|
364
|
+
// The viewport, then each opening drawn the other way round. The nonzero
|
|
365
|
+
// rule leaves the openings out, and a clipped-out area takes no hits.
|
|
366
|
+
const outline = ['0 0', '100% 0', '100% 100%', '0 100%'];
|
|
367
|
+
for (const {left, right, top, bottom} of openings(
|
|
368
|
+
mouse == null ? presses : [mouse, ...presses],
|
|
369
|
+
)) {
|
|
370
|
+
outline.push(
|
|
371
|
+
`0 ${top}px`,
|
|
372
|
+
`${left}px ${top}px`,
|
|
373
|
+
`${left}px ${bottom}px`,
|
|
374
|
+
`${right}px ${bottom}px`,
|
|
375
|
+
`${right}px ${top}px`,
|
|
376
|
+
`0 ${top}px`,
|
|
377
|
+
);
|
|
378
|
+
}
|
|
316
379
|
shield.style.clipPath = `polygon(${outline.join(', ')})`;
|
|
317
380
|
}
|
|
318
381
|
|
|
382
|
+
/**
|
|
383
|
+
* Leaves an opening in a presentation's full shield at each finger or pen
|
|
384
|
+
* press that went down before the shield came up. WebKit hit-tests the lift
|
|
385
|
+
* of such a press again, even with pointer capture, and the lift would land
|
|
386
|
+
* on the shield, inside the layer: a light-dismissing popover would stay
|
|
387
|
+
* open. Through the opening, the lift reaches what is under it, so light
|
|
388
|
+
* dismiss runs as with no hold. A press the press hold holds started during
|
|
389
|
+
* an earlier hold, and gets no opening.
|
|
390
|
+
*/
|
|
391
|
+
function openToEarlierPresses(state: HeldLayer, doc: Document): void {
|
|
392
|
+
const view = doc.defaultView;
|
|
393
|
+
if (view == null) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const pressHold = pressHolds.get(doc);
|
|
397
|
+
for (const pointerId of getDownPresses(view).keys()) {
|
|
398
|
+
if (pressHold?.holds(pointerId) !== true) {
|
|
399
|
+
state.pressOpenings.add(pointerId);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
319
404
|
/**
|
|
320
405
|
* Holds input away from `layer` until `until` settles. Returns the release
|
|
321
406
|
* (idempotent), for a hold that ends early. Holds on one layer stack, and
|
|
@@ -336,11 +421,14 @@ export function holdInput(
|
|
|
336
421
|
shield: null,
|
|
337
422
|
isShieldFull: false,
|
|
338
423
|
inertContent: null,
|
|
424
|
+
pressOpenings: new Set(),
|
|
339
425
|
};
|
|
340
426
|
held.set(layer, state);
|
|
341
427
|
}
|
|
342
428
|
startHolding(layer);
|
|
343
429
|
const isFull = scope !== 'surface';
|
|
430
|
+
const raisesFullShield =
|
|
431
|
+
isFull && (state.shield == null || !state.isShieldFull);
|
|
344
432
|
if (state.shield != null && isFull && !state.isShieldFull) {
|
|
345
433
|
// A surface hold's shield gives way to one over the viewport.
|
|
346
434
|
liveShields.delete(state.shield);
|
|
@@ -368,6 +456,9 @@ export function holdInput(
|
|
|
368
456
|
state.inertContent = makeContentInert(layer, state.shield);
|
|
369
457
|
}
|
|
370
458
|
}
|
|
459
|
+
if (raisesFullShield) {
|
|
460
|
+
openToEarlierPresses(state, layer.ownerDocument);
|
|
461
|
+
}
|
|
371
462
|
openToMouse(state, layer.ownerDocument);
|
|
372
463
|
let isReleased = false;
|
|
373
464
|
const release = () => {
|
|
@@ -586,8 +677,33 @@ function createPressHold(doc: Document): PressHold | null {
|
|
|
586
677
|
shield.setPointerCapture(event.pointerId);
|
|
587
678
|
};
|
|
588
679
|
|
|
680
|
+
/**
|
|
681
|
+
* An earlier press's opening follows it, and closes when it ends. The
|
|
682
|
+
* stream has already recorded the event's point when the hold hears it.
|
|
683
|
+
*/
|
|
684
|
+
const followEarlierPress = (event: PointerEvent) => {
|
|
685
|
+
const {pointerId, type} = event;
|
|
686
|
+
for (const layer of liveLayers(doc)) {
|
|
687
|
+
const state = held.get(layer);
|
|
688
|
+
if (state == null || !state.pressOpenings.has(pointerId)) {
|
|
689
|
+
continue;
|
|
690
|
+
}
|
|
691
|
+
if (type === 'pointerup' || type === 'pointercancel') {
|
|
692
|
+
state.pressOpenings.delete(pointerId);
|
|
693
|
+
}
|
|
694
|
+
openToMouse(state, doc);
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
|
|
589
698
|
const onPointer = (event: Event): boolean => {
|
|
590
699
|
const {pointerId, pointerType, type} = event as PointerEvent;
|
|
700
|
+
if (
|
|
701
|
+
HELD_POINTERS.has(pointerType) &&
|
|
702
|
+
type !== 'pointerdown' &&
|
|
703
|
+
!pointers.has(pointerId)
|
|
704
|
+
) {
|
|
705
|
+
followEarlierPress(event as PointerEvent);
|
|
706
|
+
}
|
|
591
707
|
// A finger or a pen raises the shields. Only a mouse that moves with no
|
|
592
708
|
// button down lowers them. So a mouse press that began on a shield stays
|
|
593
709
|
// the shield's to its end. Otherwise its click would go to the two
|
|
@@ -751,6 +867,7 @@ function createPressHold(doc: Document): PressHold | null {
|
|
|
751
867
|
isHolding = false;
|
|
752
868
|
settle();
|
|
753
869
|
},
|
|
870
|
+
holds: pointerId => pointers.has(pointerId),
|
|
754
871
|
};
|
|
755
872
|
return pressHold;
|
|
756
873
|
}
|
|
@@ -10,15 +10,42 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {createContext, useState, type Context, type ReactNode} from 'react';
|
|
13
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
14
|
+
import {realmValue, sharedKey} from '../utils/sharedRealm';
|
|
13
15
|
|
|
14
16
|
type Reset = (children: ReactNode) => ReactNode;
|
|
15
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The reset of each layer-scoped context from every copy of Core on this
|
|
19
|
+
* React. A layer boundary from any of those copies resets them all, and never
|
|
20
|
+
* renders another React's contexts.
|
|
21
|
+
*/
|
|
22
|
+
const resetsByReact = realmValue(
|
|
23
|
+
sharedKey('layer-scoped-context-resets', 2),
|
|
24
|
+
() => new WeakMap<typeof createContext, Map<Context<unknown>, Reset>>(),
|
|
25
|
+
value => value instanceof WeakMap,
|
|
26
|
+
);
|
|
27
|
+
let resets = resetsByReact.get(createContext);
|
|
28
|
+
if (resets == null) {
|
|
29
|
+
resets = new Map();
|
|
30
|
+
resetsByReact.set(createContext, resets);
|
|
31
|
+
}
|
|
32
|
+
const reactResets = resets;
|
|
16
33
|
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Create a surface-scoped context whose whole default applies in a new layer.
|
|
36
|
+
* The name and version register it like `createSharedContext`.
|
|
37
|
+
*/
|
|
38
|
+
export function createLayerScopedContext<T>(
|
|
39
|
+
name: string,
|
|
40
|
+
version: number,
|
|
41
|
+
defaultValue: T,
|
|
42
|
+
): Context<T> {
|
|
43
|
+
const Context = createSharedContext(name, version, defaultValue);
|
|
44
|
+
if (!reactResets.has(Context as Context<unknown>)) {
|
|
45
|
+
reactResets.set(Context as Context<unknown>, children => (
|
|
46
|
+
<Context value={defaultValue}>{children}</Context>
|
|
47
|
+
));
|
|
48
|
+
}
|
|
22
49
|
return Context;
|
|
23
50
|
}
|
|
24
51
|
|
|
@@ -29,7 +56,7 @@ export function LayerContentBoundary({
|
|
|
29
56
|
}): ReactNode {
|
|
30
57
|
// Keep the provider chain stable for this mount: lazy imports must not
|
|
31
58
|
// remount existing content and discard its state or focus.
|
|
32
|
-
const [resetChain] = useState(() =>
|
|
59
|
+
const [resetChain] = useState(() => [...reactResets.values()]);
|
|
33
60
|
return resetChain.reduceRight(
|
|
34
61
|
(content, reset): ReactNode => reset(content),
|
|
35
62
|
children,
|