@astryxdesign/core 0.7.17-canary.gffd1c8e → 0.7.17
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/CHANGELOG.md +334 -0
- package/README.md +26 -9
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +6 -8
- package/dist/AppShell/AppShell.d.ts +7 -3
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +74 -36
- package/dist/AppShell/unreadWidthPoint.d.ts +29 -0
- package/dist/AppShell/unreadWidthPoint.d.ts.map +1 -0
- package/dist/AppShell/unreadWidthPoint.js +134 -0
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +5 -1
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +2 -2
- package/dist/Banner/Banner.d.ts +6 -4
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +32 -29
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +3 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +11 -7
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +57 -2
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +5 -0
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +6 -14
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +12 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +4 -0
- package/dist/Calendar/Calendar.js +8 -2
- package/dist/Calendar/styles.d.ts +10 -6
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +7 -3
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +23 -4
- package/dist/Chat/ChatComposer.d.ts +1 -1
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +4 -4
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +8 -4
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +7 -0
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +3 -9
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +3 -0
- package/dist/Chat/ChatSystemMessage.d.ts.map +1 -1
- package/dist/Chat/ChatSystemMessage.js +1 -0
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +8 -0
- package/dist/Chat/pastedTextLabel.d.ts +4 -0
- package/dist/Chat/pastedTextLabel.d.ts.map +1 -0
- package/dist/Chat/pastedTextLabel.js +21 -0
- package/dist/Chat/useChatPasteAsToken.d.ts.map +1 -1
- package/dist/Chat/useChatPasteAsToken.js +8 -8
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +3 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +69 -18
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +8 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +17 -3
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +2 -0
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +1 -0
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +8 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +32 -5
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +1 -0
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +3 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +2 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +8 -8
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
- package/dist/DateInput/usePointerDragScroll.js +5 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +7 -0
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +2 -1
- package/dist/DateTimeInput/nativePickerSegmentStyles.d.ts +2 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +104 -18
- package/dist/Dialog/DialogContext.d.ts +5 -4
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +38 -12
- package/dist/Drawer/DrawerHeader.d.ts.map +1 -1
- package/dist/Drawer/DrawerHeader.js +23 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +23 -17
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -3
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -3
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +19 -2
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +6 -3
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +31 -7
- package/dist/DropdownMenu/menuRowCorners.stylex.d.ts +24 -0
- package/dist/DropdownMenu/menuRowCorners.stylex.d.ts.map +1 -0
- package/dist/DropdownMenu/menuRowCorners.stylex.js +29 -0
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +2 -2
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +2 -2
- package/dist/Field/inputDisabledFocus.d.ts +4 -0
- package/dist/Field/inputDisabledFocus.d.ts.map +1 -1
- package/dist/Field/inputDisabledFocus.js +5 -0
- package/dist/Field/inputStyles.stylex.d.ts +31 -4
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +30 -5
- package/dist/Grid/Grid.d.ts +2 -1
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +5 -2
- package/dist/Heading/Heading.d.ts +1 -1
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +15 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +32 -2
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckboxIndicator.js +12 -6
- package/dist/Indicator/RadioIndicator.d.ts.map +1 -1
- package/dist/Indicator/RadioIndicator.js +18 -4
- package/dist/Indicator/indicatorRegistry.d.ts +3 -26
- package/dist/Indicator/indicatorRegistry.d.ts.map +1 -1
- package/dist/Indicator/indicatorRegistry.js +2 -11
- package/dist/Indicator/themeIndicators.d.ts +15 -0
- package/dist/Indicator/themeIndicators.d.ts.map +1 -0
- package/dist/Indicator/themeIndicators.js +21 -0
- package/dist/Indicator/types.d.ts +14 -0
- package/dist/Indicator/types.d.ts.map +1 -1
- package/dist/Indicator/useThemeIndicator.d.ts +3 -0
- package/dist/Indicator/useThemeIndicator.d.ts.map +1 -0
- package/dist/Indicator/useThemeIndicator.js +19 -0
- package/dist/Item/Item.d.ts +6 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +30 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +9 -2
- package/dist/Layer/layerExitCopy.d.ts.map +1 -1
- package/dist/Layer/layerExitCopy.js +1 -1
- package/dist/Layer/layerSlideRules.d.ts +23 -15
- package/dist/Layer/layerSlideRules.d.ts.map +1 -1
- package/dist/Layer/layerSlideRules.js +54 -54
- package/dist/Layer/useLayer.d.ts +41 -29
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +199 -126
- package/dist/Layer/useLayerKeyboardClearance.d.ts +5 -5
- package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -1
- package/dist/Layer/useLayerKeyboardClearance.js +5 -5
- package/dist/Layout/LayoutContainerContext.d.ts +4 -0
- package/dist/Layout/LayoutContainerContext.d.ts.map +1 -0
- package/dist/Layout/LayoutContainerContext.js +20 -0
- package/dist/Layout/LayoutContainerScope.d.ts +15 -0
- package/dist/Layout/LayoutContainerScope.d.ts.map +1 -0
- package/dist/Layout/LayoutContainerScope.js +23 -0
- package/dist/Layout/LayoutContent.d.ts +2 -1
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +7 -2
- package/dist/Layout/LayoutFooter.d.ts.map +1 -1
- package/dist/Layout/LayoutFooter.js +5 -1
- package/dist/Layout/LayoutHeader.d.ts.map +1 -1
- package/dist/Layout/LayoutHeader.js +5 -1
- package/dist/Layout/containerCorners.stylex.d.ts +15 -7
- package/dist/Layout/containerCorners.stylex.d.ts.map +1 -1
- package/dist/Layout/containerCorners.stylex.js +16 -7
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +324 -6
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +1 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +14 -6
- package/dist/List/ListContext.d.ts +38 -1
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +50 -2
- package/dist/List/ListItem.js +2 -2
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +85 -96
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.js +12 -5
- package/dist/Markdown/plugins/protocol.js +3 -3
- package/dist/MetadataList/MetadataListItem.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListItem.js +11 -3
- package/dist/MobileNav/MobileNav.d.ts +1 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +6 -3
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +33 -9
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +5 -2
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -0
- package/dist/NavMenu/NavMenuContext.d.ts +7 -0
- package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
- package/dist/NavMenu/NavMenuContext.js +9 -0
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +8 -2
- package/dist/Outline/Outline.d.ts +7 -3
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +11 -3
- package/dist/Outline/useScrollSpy.d.ts +1 -1
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +6 -2
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +51 -25
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +33 -13
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +5 -1
- package/dist/Popover/popoverAnchor.d.ts +11 -0
- package/dist/Popover/popoverAnchor.d.ts.map +1 -0
- package/dist/Popover/popoverAnchor.js +33 -0
- package/dist/Popover/usePopover.d.ts +20 -3
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +110 -10
- package/dist/PowerSearch/PowerSearch.d.ts +1 -0
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +46 -9
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.js +7 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -0
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +2 -4
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +6 -13
- package/dist/ProgressBar/ProgressBar.d.ts +5 -4
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +26 -26
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +51 -0
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +1 -1
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +1 -1
- package/dist/Resizable/resizableModel.d.ts +45 -3
- package/dist/Resizable/resizableModel.d.ts.map +1 -1
- package/dist/Resizable/resizableModel.js +91 -3
- package/dist/Resizable/resizeGesture.d.ts +3 -0
- package/dist/Resizable/resizeGesture.d.ts.map +1 -1
- package/dist/Resizable/resizeGesture.js +6 -0
- package/dist/Resizable/useResizable.d.ts +1 -33
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +8 -72
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +1 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +27 -5
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +70 -8
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +34 -14
- package/dist/Selector/hooks.d.ts +5 -0
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +72 -16
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
- package/dist/Selector/useSelectorPresentation.js +9 -3
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +18 -5
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +2 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +47 -33
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +21 -12
- package/dist/Swipe/useSwipeAction.js +3 -3
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +64 -46
- package/dist/Switch/useSwitchTouch.d.ts +22 -1
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +54 -3
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +3 -3
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +37 -18
- package/dist/Table/Table.d.ts +4 -3
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +32 -14
- package/dist/Table/TableBody.d.ts.map +1 -1
- package/dist/Table/TableBody.js +5 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +6 -0
- package/dist/Table/TableHeaderCell.d.ts +1 -1
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +42 -9
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +9 -1
- package/dist/Table/TableRowPlacementContext.d.ts +18 -0
- package/dist/Table/TableRowPlacementContext.d.ts.map +1 -0
- package/dist/Table/TableRowPlacementContext.js +41 -0
- package/dist/Table/TableSelectionToolbar.d.ts.map +1 -1
- package/dist/Table/TableSelectionToolbar.js +7 -0
- package/dist/Table/columnUtils.d.ts +5 -0
- package/dist/Table/columnUtils.d.ts.map +1 -1
- package/dist/Table/columnUtils.js +9 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +2 -2
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +8 -3
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +10 -6
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +5 -1
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +2 -1
- package/dist/Table/table.stylex.d.ts +31 -5
- package/dist/Table/table.stylex.d.ts.map +1 -1
- package/dist/Table/table.stylex.js +33 -5
- package/dist/Table/types.d.ts +3 -1
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.js +17 -6
- package/dist/Text/text.stylex.d.ts +2 -2
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +23 -4
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +15 -1
- package/dist/TextInput/TextInput.d.ts +9 -3
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +19 -18
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +13 -4
- package/dist/Timer/Timer.d.ts.map +1 -1
- package/dist/Timer/Timer.js +10 -7
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +55 -4
- package/dist/Toast/Toast.d.ts +1 -6
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +77 -44
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +48 -21
- package/dist/Toast/types.d.ts +8 -0
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +14 -7
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +2 -1
- package/dist/Token/Token.d.ts +1 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +6 -2
- package/dist/Tokenizer/Tokenizer.d.ts +2 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +102 -62
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +33 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +20 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +24 -8
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +21 -9
- package/dist/TopNav/TopNavMegaMenu.js +1 -1
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +9 -2
- package/dist/TopNav/TopNavRenderContext.d.ts +13 -0
- package/dist/TopNav/TopNavRenderContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavRenderContext.js +24 -9
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +7 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +20 -2
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +24 -9
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/Typeahead/TypeaheadItem.js +7 -0
- package/dist/astryx.css +211 -56
- package/dist/gestures/GestureHost.d.ts +7 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +37 -0
- package/dist/hooks/anchoredHint.d.ts.map +1 -1
- package/dist/hooks/anchoredHint.js +0 -1
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +7 -0
- package/dist/hooks/focusableSelector.d.ts +16 -9
- package/dist/hooks/focusableSelector.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.js +53 -2
- package/dist/hooks/scrollEdgeFade.d.ts +34 -0
- package/dist/hooks/scrollEdgeFade.d.ts.map +1 -0
- package/dist/hooks/scrollEdgeFade.js +173 -0
- package/dist/hooks/statusButtonPress.d.ts +15 -0
- package/dist/hooks/statusButtonPress.d.ts.map +1 -0
- package/dist/hooks/statusButtonPress.js +19 -0
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +2 -1
- package/dist/hooks/useFocusTrap.d.ts +26 -16
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +75 -112
- package/dist/hooks/useGroupPressTracking.d.ts +1 -1
- package/dist/hooks/useGroupPressTracking.js +1 -1
- package/dist/hooks/useOverflow.d.ts +25 -2
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +137 -8
- package/dist/hooks/useResolvedRequired.d.ts +27 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -1
- package/dist/hooks/useResolvedRequired.js +30 -1
- package/dist/hooks/useTreeFocus.d.ts.map +1 -1
- package/dist/hooks/useTreeFocus.js +4 -2
- package/dist/hooks/useTypeahead.d.ts.map +1 -1
- package/dist/hooks/useTypeahead.js +8 -8
- package/dist/i18n/InternationalizationContext.d.ts +13 -6
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +11 -6
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +7 -0
- package/dist/i18n/defaultTranslator.d.ts +17 -0
- package/dist/i18n/defaultTranslator.d.ts.map +1 -0
- package/dist/i18n/defaultTranslator.js +18 -0
- package/dist/i18n/firstStrongDirection.d.ts +3 -2
- package/dist/i18n/firstStrongDirection.d.ts.map +1 -1
- package/dist/i18n/firstStrongDirection.js +50 -12
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.js +1 -2
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.js +1 -0
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.js +2 -1
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.js +2 -1
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.js +1 -0
- package/dist/i18n/generated-english/Slider/Slider.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Slider/Slider.generated.js +2 -1
- package/dist/i18n/generated-english/TextArea/TextArea.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/TextArea/TextArea.generated.js +1 -0
- package/dist/i18n/generated-english/TextInput/TextInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/TextInput/TextInput.generated.js +1 -0
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.js +2 -1
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.js +1 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +9 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +9 -0
- package/dist/i18n/publicContext.d.ts.map +1 -1
- package/dist/i18n/publicContext.js +4 -2
- package/dist/i18n/translatingContext.d.ts +2 -0
- package/dist/i18n/translatingContext.d.ts.map +1 -0
- package/dist/i18n/translatingContext.js +25 -0
- package/dist/i18n/useComponentTranslator.d.ts.map +1 -1
- package/dist/i18n/useComponentTranslator.js +3 -2
- package/dist/i18n/useListFormatter.d.ts.map +1 -1
- package/dist/i18n/useListFormatter.js +3 -2
- package/dist/i18n/useTranslator.d.ts.map +1 -1
- package/dist/i18n/useTranslator.js +3 -2
- package/dist/internal/touch.d.ts +2 -0
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +5 -1
- package/dist/keyboard/keyboardHeight.d.ts +34 -3
- package/dist/keyboard/keyboardHeight.d.ts.map +1 -1
- package/dist/keyboard/keyboardHeight.js +101 -24
- package/dist/keyboard/keyboardTarget.d.ts +19 -16
- package/dist/keyboard/keyboardTarget.d.ts.map +1 -1
- package/dist/keyboard/keyboardTarget.js +529 -72
- package/dist/keyboard/useMobileKeyboard.d.ts.map +1 -1
- package/dist/keyboard/useMobileKeyboard.js +1 -8
- package/dist/palette/color.d.ts +23 -0
- package/dist/palette/color.d.ts.map +1 -0
- package/dist/palette/color.js +126 -0
- package/dist/palette/generator.d.ts +69 -0
- package/dist/palette/generator.d.ts.map +1 -0
- package/dist/palette/generator.js +778 -0
- package/dist/palette/index.d.ts +12 -0
- package/dist/palette/index.d.ts.map +1 -0
- package/dist/palette/index.js +13 -0
- package/dist/palette/mapping.d.ts +319 -0
- package/dist/palette/mapping.d.ts.map +1 -0
- package/dist/palette/mapping.js +1312 -0
- package/dist/palette/themePalette.d.ts +20 -0
- package/dist/palette/themePalette.d.ts.map +1 -0
- package/dist/palette/themePalette.js +145 -0
- package/dist/palette/types.d.ts +178 -0
- package/dist/palette/types.d.ts.map +1 -0
- package/dist/palette/types.js +1 -0
- package/dist/privateAttributes/mediaDarkPage.d.ts +5 -0
- package/dist/privateAttributes/mediaDarkPage.d.ts.map +1 -0
- package/dist/privateAttributes/mediaDarkPage.js +27 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +2 -1
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/pressGroupItem.stylex.js +2 -1
- package/dist/privateAttributes/scheme.d.ts +10 -0
- package/dist/privateAttributes/scheme.d.ts.map +1 -0
- package/dist/privateAttributes/scheme.js +34 -0
- package/dist/privateAttributes/travelling.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/travelling.stylex.js +2 -2
- package/dist/theme/MediaDarkPage.d.ts +18 -0
- package/dist/theme/MediaDarkPage.d.ts.map +1 -0
- package/dist/theme/MediaDarkPage.js +35 -0
- package/dist/theme/MediaTheme.d.ts.map +1 -1
- package/dist/theme/MediaTheme.js +9 -1
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +99 -31
- package/dist/theme/defineTheme.d.ts +31 -6
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +65 -29
- package/dist/theme/derivedVarRegistry.d.ts +19 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +49 -4
- package/dist/theme/expandRadiusScale.d.ts +1 -2
- package/dist/theme/expandRadiusScale.d.ts.map +1 -1
- package/dist/theme/expandRadiusScale.js +1 -5
- package/dist/theme/generateThemeRules.d.ts +10 -3
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +310 -207
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/invertedSurfaceSide.d.ts +17 -0
- package/dist/theme/invertedSurfaceSide.d.ts.map +1 -0
- package/dist/theme/invertedSurfaceSide.js +47 -0
- package/dist/theme/resolveThemeValues.d.ts +5 -2
- package/dist/theme/resolveThemeValues.d.ts.map +1 -1
- package/dist/theme/resolveThemeValues.js +7 -1
- package/dist/theme/statusRoleDefaults.d.ts +43 -0
- package/dist/theme/statusRoleDefaults.d.ts.map +1 -0
- package/dist/theme/statusRoleDefaults.js +196 -0
- package/dist/theme/statusRoleDerivation.d.ts +4 -0
- package/dist/theme/statusRoleDerivation.d.ts.map +1 -1
- package/dist/theme/statusRoleDerivation.js +3 -1
- package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +7 -0
- package/dist/theme/themeAdaptations.d.ts +24 -1
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +48 -5
- package/dist/theme/tokenDefaults.d.ts +3 -0
- package/dist/theme/tokenDefaults.d.ts.map +1 -0
- package/dist/theme/tokenDefaults.js +30 -0
- package/dist/theme/tokenValues.d.ts +26 -0
- package/dist/theme/tokenValues.d.ts.map +1 -0
- package/dist/theme/tokenValues.js +180 -0
- package/dist/theme/tokens.d.ts +3 -2
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +7 -161
- package/dist/theme/tokens.stylex.d.ts +4 -4
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +7 -5
- package/dist/theme/useTheme.d.ts +40 -3
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +137 -32
- package/dist/utils/devWarning.d.ts +17 -0
- package/dist/utils/devWarning.d.ts.map +1 -1
- package/dist/utils/devWarning.js +20 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +7 -4
- package/dist/utils/focusReturn.d.ts +110 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +418 -12
- package/dist/utils/hitArea.d.ts +28 -0
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +52 -18
- package/dist/utils/inputStream.d.ts +27 -0
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +72 -5
- package/dist/utils/nodeType.d.ts +2 -0
- package/dist/utils/nodeType.d.ts.map +1 -1
- package/dist/utils/nodeType.js +10 -0
- package/dist/utils/timeFormat.d.ts +14 -4
- package/dist/utils/timeFormat.d.ts.map +1 -1
- package/dist/utils/timeFormat.js +42 -4
- package/dist/utils/touchPresentation.d.ts +2 -2
- package/dist/utils/touchPresentation.d.ts.map +1 -1
- package/dist/utils/touchPresentation.js +10 -7
- package/dist/utils/touchPresentation.stylex.d.ts +4 -3
- package/dist/utils/touchPresentation.stylex.d.ts.map +1 -1
- package/dist/utils/touchPresentation.stylex.js +3 -3
- package/dist/utils/touchQueries.d.ts +3 -2
- package/dist/utils/touchQueries.d.ts.map +1 -1
- package/dist/utils/touchQueries.js +3 -2
- package/dist/utils/typeaheadMatch.d.ts +13 -0
- package/dist/utils/typeaheadMatch.d.ts.map +1 -1
- package/dist/utils/typeaheadMatch.js +15 -1
- package/dist/virtualization/useInlineListWindow.d.ts.map +1 -1
- package/dist/virtualization/useInlineListWindow.js +38 -22
- package/locales/en.json +36 -0
- package/locales/pseudo.json +27 -0
- package/package.json +10 -5
- package/scripts/agent-doc-state.mjs +71 -4
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -1
- package/src/AlertDialog/AlertDialog.tsx +34 -7
- package/src/AppShell/AppShell.doc.mjs +22 -0
- package/src/AppShell/AppShell.tsx +112 -65
- package/src/AppShell/unreadWidthPoint.ts +162 -0
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +6 -1
- package/src/Badge/Badge.tsx +5 -2
- package/src/Banner/Banner.doc.mjs +15 -0
- package/src/Banner/Banner.tsx +56 -45
- package/src/BottomSheet/BottomSheet.doc.mjs +6 -3
- package/src/BottomSheet/BottomSheet.tsx +3 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +15 -7
- package/src/BottomSheet/BottomSheetSwitcher.tsx +73 -1
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +5 -0
- package/src/BottomSheet/bottomSheetStack.ts +6 -14
- package/src/Breadcrumbs/BreadcrumbItem.tsx +14 -1
- package/src/Button/Button.doc.mjs +6 -0
- package/src/Button/Button.tsx +6 -0
- package/src/Calendar/Calendar.doc.mjs +16 -0
- package/src/Calendar/Calendar.tsx +32 -20
- package/src/Calendar/styles.ts +12 -3
- package/src/Card/Card.doc.mjs +2 -2
- package/src/Card/Card.tsx +22 -3
- package/src/Chat/Chat.doc.mjs +1 -1
- package/src/Chat/ChatComposer.doc.mjs +3 -3
- package/src/Chat/ChatComposer.tsx +11 -5
- package/src/Chat/ChatComposerDrawer.tsx +11 -7
- package/src/Chat/ChatDictationButton.tsx +12 -0
- package/src/Chat/ChatMessageBubble.tsx +2 -2
- package/src/Chat/ChatPastedTextToken.tsx +3 -9
- package/src/Chat/ChatSendButton.tsx +5 -0
- package/src/Chat/ChatSystemMessage.tsx +1 -0
- package/src/Chat/ChatToolCalls.tsx +16 -0
- package/src/Chat/pastedTextLabel.ts +23 -0
- package/src/Chat/useChatPasteAsToken.ts +9 -8
- package/src/Chat/useTriggerMenu.tsx +4 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +20 -0
- package/src/CheckboxInput/CheckboxInput.tsx +83 -26
- package/src/CheckboxList/CheckboxList.doc.mjs +15 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/Citation/Citation.tsx +16 -1
- package/src/CodeBlock/CodeBlock.tsx +29 -2
- package/src/Collapsible/Collapsible.tsx +2 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +30 -2
- package/src/ComplexSelector/ComplexSelector.tsx +19 -1
- package/src/ContextMenu/ContextMenu.doc.mjs +5 -1
- package/src/ContextMenu/ContextMenu.tsx +44 -5
- package/src/ContextMenu/ContextMenuItem.doc.mjs +55 -5
- package/src/DateInput/MonthScroller.tsx +1 -0
- package/src/DateInput/PickerWheel.tsx +1 -0
- package/src/DateInput/TouchDateField.tsx +2 -0
- package/src/DateInput/Wheel.tsx +1 -0
- package/src/DateInput/usePointerDragScroll.ts +6 -2
- package/src/DateRangeInput/DateRangeInput.tsx +16 -0
- package/src/DateTimeInput/TouchDateTimeField.tsx +2 -0
- package/src/Dialog/Dialog.doc.mjs +11 -1
- package/src/Dialog/Dialog.tsx +116 -19
- package/src/Dialog/DialogContext.ts +5 -4
- package/src/Dialog/DialogHeader.tsx +50 -12
- package/src/Drawer/DrawerHeader.tsx +31 -6
- package/src/DropdownMenu/DropdownMenu.doc.mjs +20 -1
- package/src/DropdownMenu/DropdownMenu.tsx +29 -22
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +4 -4
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +3 -2
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +5 -5
- package/src/DropdownMenu/DropdownMenuItem.tsx +3 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +4 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +3 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +3 -3
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +23 -1
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +37 -9
- package/src/DropdownMenu/menuRowCorners.stylex.ts +40 -0
- package/src/EmptyState/EmptyState.tsx +2 -0
- package/src/Field/Field.doc.mjs +1 -1
- package/src/Field/FieldLabel.doc.mjs +3 -3
- package/src/Field/FieldLabel.tsx +9 -2
- package/src/Field/inputDisabledFocus.ts +18 -0
- package/src/Field/inputStyles.stylex.ts +52 -1
- package/src/Grid/Grid.doc.mjs +6 -3
- package/src/Grid/Grid.tsx +5 -2
- package/src/Heading/Heading.tsx +24 -1
- package/src/Icon/Icon.doc.mjs +1 -1
- package/src/Icon/Icon.tsx +40 -2
- package/src/Indicator/CheckboxIndicator.tsx +11 -6
- package/src/Indicator/Indicator.doc.mjs +1 -1
- package/src/Indicator/RadioIndicator.tsx +31 -4
- package/src/Indicator/indicatorRegistry.ts +7 -23
- package/src/Indicator/themeIndicators.ts +29 -0
- package/src/Indicator/types.ts +14 -0
- package/src/Indicator/useThemeIndicator.ts +24 -0
- package/src/Item/Item.doc.mjs +3 -3
- package/src/Item/Item.tsx +48 -7
- package/src/Kbd/Kbd.doc.mjs +6 -2
- package/src/Kbd/Kbd.tsx +16 -1
- package/src/Layer/layerExitCopy.ts +0 -1
- package/src/Layer/layerSlideRules.ts +62 -74
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Layer/useLayer.tsx +293 -137
- package/src/Layer/useLayerKeyboardClearance.ts +9 -12
- package/src/Layout/Layout.doc.mjs +3 -3
- package/src/Layout/LayoutContainerContext.ts +27 -0
- package/src/Layout/LayoutContainerScope.tsx +32 -0
- package/src/Layout/LayoutContent.tsx +5 -2
- package/src/Layout/LayoutFooter.tsx +3 -1
- package/src/Layout/LayoutHeader.tsx +3 -1
- package/src/Layout/containerCorners.stylex.ts +44 -7
- package/src/Lightbox/Lightbox.tsx +460 -8
- package/src/Link/Link.doc.mjs +18 -0
- package/src/Link/Link.tsx +3 -1
- package/src/List/List.tsx +14 -2
- package/src/List/ListContext.tsx +60 -1
- package/src/List/ListItem.doc.mjs +11 -9
- package/src/List/ListItem.tsx +4 -4
- package/src/Markdown/Markdown.doc.mjs +1 -1
- package/src/Markdown/Markdown.tsx +189 -190
- package/src/Markdown/plugins/HeadingLinksRenderer.tsx +14 -4
- package/src/Markdown/plugins/protocol.ts +3 -3
- package/src/MetadataList/MetadataListItem.tsx +18 -3
- package/src/MobileNav/MobileNav.doc.mjs +134 -52
- package/src/MobileNav/MobileNav.tsx +13 -9
- package/src/MultiSelector/MultiSelector.doc.mjs +2 -2
- package/src/MultiSelector/MultiSelector.tsx +51 -8
- package/src/NavMenu/NavHeadingMenu.tsx +5 -1
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -0
- package/src/NavMenu/NavMenu.doc.mjs +105 -2
- package/src/NavMenu/NavMenuContext.tsx +13 -0
- package/src/NumberInput/NumberInput.doc.mjs +12 -10
- package/src/NumberInput/NumberInput.tsx +19 -11
- package/src/Outline/Outline.doc.mjs +26 -8
- package/src/Outline/Outline.tsx +35 -5
- package/src/Outline/useScrollSpy.ts +8 -3
- package/src/OverflowList/OverflowList.doc.mjs +15 -0
- package/src/OverflowList/OverflowList.tsx +62 -26
- package/src/Pagination/Pagination.doc.mjs +12 -0
- package/src/Pagination/Pagination.tsx +40 -6
- package/src/Popover/Popover.doc.mjs +10 -0
- package/src/Popover/Popover.tsx +8 -4
- package/src/Popover/popoverAnchor.ts +47 -0
- package/src/Popover/usePopover.doc.mjs +16 -2
- package/src/Popover/usePopover.tsx +152 -16
- package/src/PowerSearch/PowerSearch.doc.mjs +8 -8
- package/src/PowerSearch/PowerSearch.tsx +65 -12
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -0
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +12 -0
- package/src/PowerSearch/PowerSearchToken.tsx +12 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +14 -19
- package/src/ProgressBar/ProgressBar.doc.mjs +2 -2
- package/src/ProgressBar/ProgressBar.tsx +44 -30
- package/src/RadioList/RadioList.tsx +63 -0
- package/src/RadioList/RadioListItem.tsx +4 -1
- package/src/Resizable/ResizeHandle.tsx +2 -3
- package/src/Resizable/resizableModel.ts +105 -3
- package/src/Resizable/resizeGesture.ts +14 -0
- package/src/Resizable/useResizable.ts +14 -75
- package/src/SegmentedControl/SegmentedControlItem.tsx +1 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +76 -12
- package/src/Selector/Selector.doc.mjs +34 -7
- package/src/Selector/Selector.tsx +55 -25
- package/src/Selector/SelectorOption.doc.mjs +5 -5
- package/src/Selector/hooks.ts +92 -17
- package/src/Selector/useSelectorPresentation.ts +18 -3
- package/src/SideNav/SideNavHeading.tsx +15 -4
- package/src/SideNav/SideNavItem.doc.mjs +10 -10
- package/src/Slider/Slider.tsx +4 -1
- package/src/Spinner/Spinner.tsx +56 -41
- package/src/Stepper/Step.tsx +18 -3
- package/src/Stepper/Stepper.doc.mjs +14 -2
- package/src/Swipe/useSwipeAction.ts +3 -3
- package/src/Switch/Switch.doc.mjs +61 -5
- package/src/Switch/Switch.tsx +72 -35
- package/src/Switch/useSwitchTouch.ts +68 -3
- package/src/TabList/Tab.tsx +6 -0
- package/src/Table/BaseTable.tsx +73 -35
- package/src/Table/Table.doc.mjs +109 -5
- package/src/Table/Table.tsx +42 -17
- package/src/Table/TableBody.tsx +10 -1
- package/src/Table/TableCell.tsx +6 -0
- package/src/Table/TableHeaderCell.tsx +52 -7
- package/src/Table/TableRow.tsx +8 -1
- package/src/Table/TableRowPlacementContext.ts +58 -0
- package/src/Table/TableSelectionToolbar.tsx +12 -0
- package/src/Table/columnUtils.ts +9 -1
- package/src/Table/plugins/columnSettings/useTableColumnSettingsState.doc.mjs +1 -1
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +1 -0
- package/src/Table/plugins/sortable/useTableSortable.tsx +15 -2
- package/src/Table/plugins/sortable/useTableSortableState.doc.mjs +5 -5
- package/src/Table/plugins/sortable/useTableSortableState.tsx +15 -8
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +8 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +2 -4
- package/src/Table/table.stylex.ts +44 -5
- package/src/Table/types.ts +3 -1
- package/src/Table/useTableColumnResize.doc.mjs +3 -3
- package/src/Table/useTableColumnSettings.doc.mjs +3 -3
- package/src/Table/useTableFilterState.doc.mjs +6 -3
- package/src/Table/useTableFiltering.doc.mjs +71 -4
- package/src/Table/useTableInfiniteScroll.doc.mjs +2 -2
- package/src/Table/useTablePagination.doc.mjs +24 -3
- package/src/Table/useTableSelection.doc.mjs +30 -6
- package/src/Table/useTableSelectionState.doc.mjs +30 -2
- package/src/Table/useTableSortable.doc.mjs +104 -17
- package/src/Table/useTableStickyColumns.doc.mjs +3 -3
- package/src/Text/Heading.doc.mjs +2 -2
- package/src/Text/Text.doc.mjs +1 -1
- package/src/Text/TruncationTooltip.tsx +18 -11
- package/src/Text/useTruncation.ts +20 -4
- package/src/TextArea/TextArea.doc.mjs +5 -5
- package/src/TextArea/TextArea.tsx +20 -1
- package/src/TextInput/TextInput.doc.mjs +5 -5
- package/src/TextInput/TextInput.tsx +23 -18
- package/src/Thumbnail/Thumbnail.tsx +2 -1
- package/src/Timer/Timer.tsx +21 -6
- package/src/Timestamp/Timestamp.tsx +67 -4
- package/src/Toast/Toast.doc.mjs +15 -5
- package/src/Toast/Toast.tsx +83 -62
- package/src/Toast/ToastViewport.tsx +62 -23
- package/src/Toast/types.ts +8 -0
- package/src/Toast/useToast.doc.mjs +80 -15
- package/src/Toast/useToast.tsx +18 -7
- package/src/ToggleButton/ToggleButton.doc.mjs +1 -1
- package/src/ToggleButton/ToggleButton.tsx +1 -0
- package/src/Token/Token.tsx +5 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +15 -3
- package/src/Tokenizer/Tokenizer.tsx +130 -75
- package/src/Toolbar/Toolbar.tsx +55 -4
- package/src/Tooltip/useTooltip.tsx +26 -0
- package/src/TopNav/TopNav.doc.mjs +1 -1
- package/src/TopNav/TopNav.tsx +13 -3
- package/src/TopNav/TopNavHeading.tsx +22 -9
- package/src/TopNav/TopNavMegaMenu.tsx +4 -4
- package/src/TopNav/TopNavMenu.tsx +13 -0
- package/src/TopNav/TopNavRenderContext.ts +30 -9
- package/src/TreeList/TreeList.tsx +12 -0
- package/src/TreeList/TreeListItem.tsx +26 -5
- package/src/Typeahead/BaseTypeahead.doc.mjs +6 -0
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
- package/src/Typeahead/Typeahead.doc.mjs +15 -2
- package/src/Typeahead/Typeahead.tsx +37 -13
- package/src/Typeahead/TypeaheadItem.tsx +12 -0
- package/src/gestures/GestureHost.ts +34 -0
- package/src/gestures/README.md +9 -6
- package/src/hooks/anchoredHint.tsx +1 -2
- package/src/hooks/computeOverflow.ts +10 -0
- package/src/hooks/focusableSelector.ts +59 -2
- package/src/hooks/scrollEdgeFade.ts +129 -0
- package/src/hooks/statusButtonPress.ts +26 -0
- package/src/hooks/useAnnounce.ts +2 -1
- package/src/hooks/useFocusTrap.ts +110 -141
- package/src/hooks/useGroupPressTracking.ts +1 -1
- package/src/hooks/useOverflow.ts +227 -13
- package/src/hooks/useResolvedRequired.ts +50 -1
- package/src/hooks/useTreeFocus.ts +8 -4
- package/src/hooks/useTypeahead.ts +12 -10
- package/src/i18n/InternationalizationContext.ts +16 -7
- package/src/i18n/InternationalizationProvider.doc.mjs +1 -1
- package/src/i18n/InternationalizationProvider.tsx +12 -0
- package/src/i18n/defaultTranslator.ts +25 -0
- package/src/i18n/firstStrongDirection.ts +54 -13
- package/src/i18n/generated-english/Chat/ChatPastedTextToken.generated.ts +1 -2
- package/src/i18n/generated-english/Chat/pastedTextLabel.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/useTriggerMenu.generated.ts +1 -0
- package/src/i18n/generated-english/CodeBlock/CodeBlock.generated.ts +2 -1
- package/src/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.ts +2 -1
- package/src/i18n/generated-english/MultiSelector/MultiSelector.generated.ts +1 -0
- package/src/i18n/generated-english/Slider/Slider.generated.ts +2 -1
- package/src/i18n/generated-english/TextArea/TextArea.generated.ts +1 -0
- package/src/i18n/generated-english/TextInput/TextInput.generated.ts +1 -0
- package/src/i18n/generated-english/Timestamp/Timestamp.generated.ts +2 -1
- package/src/i18n/generated-english/Tokenizer/Tokenizer.generated.ts +1 -0
- package/src/i18n/generated-locales/en.generated.ts +11 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +11 -0
- package/src/i18n/publicContext.ts +4 -2
- package/src/i18n/translatingContext.ts +28 -0
- package/src/i18n/useComponentTranslator.ts +3 -2
- package/src/i18n/useListFormatter.ts +3 -2
- package/src/i18n/useTranslator.ts +3 -2
- package/src/internal/touch.ts +7 -0
- package/src/keyboard/README.md +58 -16
- package/src/keyboard/keyboardHeight.ts +138 -26
- package/src/keyboard/keyboardTarget.ts +667 -71
- package/src/keyboard/useMobileKeyboard.ts +1 -7
- package/src/palette/color.ts +205 -0
- package/src/palette/generator.ts +1134 -0
- package/src/palette/index.ts +35 -0
- package/src/palette/mapping.ts +1630 -0
- package/src/palette/themePalette.ts +175 -0
- package/src/palette/types.ts +194 -0
- package/src/privateAttributes/mediaDarkPage.ts +27 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +2 -1
- package/src/privateAttributes/scheme.ts +37 -0
- package/src/privateAttributes/travelling.stylex.ts +6 -4
- package/src/reset.css +1 -1
- package/src/theme/MediaDarkPage.tsx +41 -0
- package/src/theme/MediaTheme.tsx +8 -1
- package/src/theme/Theme.doc.mjs +4 -4
- package/src/theme/Theme.tsx +140 -35
- package/src/theme/defineTheme.ts +103 -40
- package/src/theme/derivedVarRegistry.ts +61 -4
- package/src/theme/expandRadiusScale.ts +1 -5
- package/src/theme/generateThemeRules.ts +398 -342
- package/src/theme/index.ts +2 -4
- package/src/theme/invertedSurfaceSide.ts +65 -0
- package/src/theme/resolveThemeValues.ts +8 -2
- package/src/theme/statusRoleDefaults.ts +330 -0
- package/src/theme/statusRoleDerivation.ts +2 -1
- package/src/theme/syntax/SyntaxTheme.tsx +12 -0
- package/src/theme/themeAdaptations.ts +53 -5
- package/src/theme/tokenDefaults.ts +44 -0
- package/src/theme/tokenValues.ts +193 -0
- package/src/theme/tokens.stylex.ts +7 -5
- package/src/theme/tokens.ts +14 -176
- package/src/theme/useTheme.ts +164 -35
- package/src/utils/devWarning.ts +24 -0
- package/src/utils/focusOutline.stylex.ts +7 -4
- package/src/utils/focusReturn.ts +578 -16
- package/src/utils/hitArea.ts +70 -33
- package/src/utils/inputStream.ts +81 -5
- package/src/utils/nodeType.ts +10 -0
- package/src/utils/timeFormat.ts +54 -4
- package/src/utils/touchPresentation.stylex.ts +7 -6
- package/src/utils/touchPresentation.ts +10 -7
- package/src/utils/touchQueries.ts +3 -2
- package/src/utils/typeaheadMatch.ts +20 -1
- package/src/virtualization/useInlineListWindow.ts +57 -33
|
@@ -5,19 +5,21 @@
|
|
|
5
5
|
* @input The document's current active element and the shared interaction
|
|
6
6
|
* modality.
|
|
7
7
|
* @output Whether focus would be lost if a surface hid now; a focus move whose
|
|
8
|
-
* ring follows the last input;
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
8
|
+
* ring follows the last input; an overlay's focus return that never
|
|
9
|
+
* scrolls the page; the path that moves focus out of removed or hidden
|
|
10
|
+
* content; and the focus return that Popover, Dialog and DropdownMenu run
|
|
11
|
+
* as they close (`trackLayerFocus`, `restoreLayerFocus`).
|
|
12
|
+
* @position Utility; used by the focus trap (Popover, Drawer) and by Dialog,
|
|
13
|
+
* DropdownMenu, BottomSheet and disclosures that hide focused content.
|
|
14
|
+
* isFocusDetached lives in isFocusDetached.ts, outside this module.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { FOCUSABLE_SELECTOR } from "../hooks/focusableSelector.js";
|
|
18
|
-
import { sharedWeakMap } from "./sharedRealm.js";
|
|
17
|
+
import { FOCUSABLE_SELECTOR, getFocusableElements, isVisiblyFocusable } from "../hooks/focusableSelector.js";
|
|
18
|
+
import { sharedState, sharedWeakMap } from "./sharedRealm.js";
|
|
19
19
|
import { getInteractionModality } from "./interactionModality.js";
|
|
20
20
|
import { isFocusDetached } from "./isFocusDetached.js";
|
|
21
|
+
import { isElement, isHTMLElement, isModalDialog } from "./nodeType.js";
|
|
22
|
+
import { devWarn } from "./devWarning.js";
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* True when focus would be lost if `surface` hid now: nothing is focused (see
|
|
@@ -72,11 +74,15 @@ export function releaseTemporaryFocus(element) {
|
|
|
72
74
|
temporaryFocus.get(element)?.();
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
/** Whether the element takes focus as it is, with no temporary tab stop. Internal. */
|
|
78
|
+
export function takesFocusAsIs(element) {
|
|
79
|
+
return element.hasAttribute('tabindex') || element.tabIndex >= 0 || element.isContentEditable || element.matches(FOCUSABLE_SELECTOR);
|
|
80
|
+
}
|
|
81
|
+
|
|
75
82
|
/** Focuses the element. A nonfocusable element gets a tab stop until blur or disposal. Internal. */
|
|
76
83
|
export function focusForLastInputTemporarily(element, options, modality = getInteractionModality(element)) {
|
|
77
84
|
releaseTemporaryFocus(element);
|
|
78
|
-
|
|
79
|
-
if (!needsTabIndex) {
|
|
85
|
+
if (takesFocusAsIs(element)) {
|
|
80
86
|
focusForLastInput(element, options, modality);
|
|
81
87
|
return () => {};
|
|
82
88
|
}
|
|
@@ -139,7 +145,7 @@ export function focusForLastInput(element, options, modality = getInteractionMod
|
|
|
139
145
|
// browser already drew would stay. WebKit draws one when its own focus
|
|
140
146
|
// restoration (a dialog's close, a popover's hide) moves focus itself, so
|
|
141
147
|
// clear that focus first.
|
|
142
|
-
if (element.matches(':focus-visible')) {
|
|
148
|
+
if (element.ownerDocument.activeElement === element && element.matches(':focus-visible')) {
|
|
143
149
|
element.blur();
|
|
144
150
|
}
|
|
145
151
|
element.focus({
|
|
@@ -220,4 +226,404 @@ export function prepareFocusReturnOnRemoval(surface) {
|
|
|
220
226
|
}
|
|
221
227
|
});
|
|
222
228
|
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** Where the opener sat among one ancestor's tab stops when its layer opened. */
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* One open layer's focus return: its opener, the stand-ins for the opener,
|
|
235
|
+
* and the layer that opened it. `trackLayerFocus` creates it as the layer
|
|
236
|
+
* opens; `restoreLayerFocus` runs it as the layer starts to close.
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
const openLayerRecords = sharedState('utils/focus-return/open-layer-records', 1, () => new Set());
|
|
240
|
+
|
|
241
|
+
// How many ancestors of the opener keep a record of its place. The nearest
|
|
242
|
+
// ones hold a remounted control's siblings; farther ones only cost a query
|
|
243
|
+
// over a larger subtree.
|
|
244
|
+
const RECORDED_PLACES = 4;
|
|
245
|
+
function tabStopsIn(container) {
|
|
246
|
+
return getFocusableElements(container).filter(element => element.tabIndex >= 0 && !element.matches(':disabled'));
|
|
247
|
+
}
|
|
248
|
+
function isPageRoot(element) {
|
|
249
|
+
const doc = element.ownerDocument;
|
|
250
|
+
return element === doc.body || element === doc.documentElement;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** The open layer record whose layer holds `element`, innermost first. */
|
|
254
|
+
function recordHolding(element) {
|
|
255
|
+
if (element == null) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
let holder = null;
|
|
259
|
+
for (const record of openLayerRecords) {
|
|
260
|
+
const layer = record.getLayer();
|
|
261
|
+
if (layer != null && layer.contains(element) && (holder == null || holder.getLayer()?.contains(layer) === true)) {
|
|
262
|
+
holder = record;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return holder;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Starts focus return for a layer that is opening. It records the opener, the
|
|
270
|
+
* opener's place among its ancestors' tab stops, and the open layer that holds
|
|
271
|
+
* the opener. Call it as the layer opens, before initial focus moves into it,
|
|
272
|
+
* and call `restoreLayerFocus` as it starts to close.
|
|
273
|
+
*/
|
|
274
|
+
export function trackLayerFocus(options) {
|
|
275
|
+
const doc = options.doc ?? options.getLayer()?.ownerDocument ?? (typeof document === 'undefined' ? null : document);
|
|
276
|
+
if (doc == null) {
|
|
277
|
+
throw new Error('trackLayerFocus needs a document');
|
|
278
|
+
}
|
|
279
|
+
const active = doc.activeElement;
|
|
280
|
+
const fromFocus = isHTMLElement(active) && !isPageRoot(active) ? active : null;
|
|
281
|
+
const opener = options.opener ?? fromFocus;
|
|
282
|
+
const ancestors = [];
|
|
283
|
+
const places = [];
|
|
284
|
+
for (let current = opener?.parentElement ?? null; current != null && !isPageRoot(current); current = current.parentElement) {
|
|
285
|
+
ancestors.push(current);
|
|
286
|
+
if (ancestors.length <= RECORDED_PLACES && opener != null) {
|
|
287
|
+
const index = tabStopsIn(current).indexOf(opener);
|
|
288
|
+
if (index >= 0) {
|
|
289
|
+
places.push({
|
|
290
|
+
container: current,
|
|
291
|
+
index
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
const layer = options.getLayer();
|
|
297
|
+
const record = {
|
|
298
|
+
getLayer: options.getLayer,
|
|
299
|
+
opener,
|
|
300
|
+
getTrigger: options.getTrigger ?? (() => null),
|
|
301
|
+
getRestoreFallback: options.getRestoreFallback ?? (() => null),
|
|
302
|
+
getAnchor: options.getAnchor ?? (() => null),
|
|
303
|
+
layerId: options.layerId ?? null,
|
|
304
|
+
ancestors,
|
|
305
|
+
places,
|
|
306
|
+
parent: recordHolding(opener),
|
|
307
|
+
focus: options.focus ?? focusReturnTarget,
|
|
308
|
+
doc,
|
|
309
|
+
layerDoc: layer?.ownerDocument ?? doc,
|
|
310
|
+
inherited: null,
|
|
311
|
+
hadFocusInside: options.isFocusMovedInOnOpen === true || layer != null && layer.contains(active),
|
|
312
|
+
awaitsFocus: options.isFocusMovedInOnOpen === true && !(layer != null && layer.contains(active)),
|
|
313
|
+
isClosing: false,
|
|
314
|
+
isDone: false,
|
|
315
|
+
stopListening: () => {}
|
|
316
|
+
};
|
|
317
|
+
const markFocusInside = event => {
|
|
318
|
+
const target = event.target;
|
|
319
|
+
if (isElement(target) && record.getLayer()?.contains(target)) {
|
|
320
|
+
record.hadFocusInside = true;
|
|
321
|
+
record.awaitsFocus = false;
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
// The layer may render in another document than its opener (a same-origin
|
|
325
|
+
// iframe, a Picture-in-Picture window): focus inside it is reported there.
|
|
326
|
+
const docs = new Set([doc]);
|
|
327
|
+
if (layer != null) {
|
|
328
|
+
docs.add(layer.ownerDocument);
|
|
329
|
+
}
|
|
330
|
+
for (const each of docs) {
|
|
331
|
+
each.addEventListener('focusin', markFocusInside, true);
|
|
332
|
+
}
|
|
333
|
+
record.stopListening = () => {
|
|
334
|
+
for (const each of docs) {
|
|
335
|
+
each.removeEventListener('focusin', markFocusInside, true);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
openLayerRecords.add(record);
|
|
339
|
+
return record;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/** Whether focus in `layerDoc` is inside `layer` or on nothing. */
|
|
343
|
+
function isInsideOrLost(layerDoc, layer) {
|
|
344
|
+
return isFocusDetached(layerDoc) || layer != null && layer.contains(layerDoc.activeElement);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* The default return move. A control takes a plain focus, which scrolls it
|
|
349
|
+
* into view. A container that only stands in (an ancestor, `main`) takes
|
|
350
|
+
* focus with no scroll: a reveal would jump the page to its top edge.
|
|
351
|
+
*/
|
|
352
|
+
function focusReturnTarget(element) {
|
|
353
|
+
// A modality other than a pointer's takes the plain focus path.
|
|
354
|
+
focusForLastInputTemporarily(element, takesFocusAsIs(element) ? undefined : {
|
|
355
|
+
preventScroll: true
|
|
356
|
+
}, 'keyboard');
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// A caller's own focus function may do a plain focus, which a nonfocusable
|
|
360
|
+
// fallback (an ancestor, `main`) ignores. Such a fallback gets a tab stop
|
|
361
|
+
// until it loses focus.
|
|
362
|
+
function focusCandidate(record, element) {
|
|
363
|
+
if (record.focus === focusReturnTarget || takesFocusAsIs(element)) {
|
|
364
|
+
record.focus(element);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
element.setAttribute('tabindex', '-1');
|
|
368
|
+
record.focus(element);
|
|
369
|
+
const dispose = () => {
|
|
370
|
+
if (element.getAttribute('tabindex') === '-1') {
|
|
371
|
+
element.removeAttribute('tabindex');
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
if (element.ownerDocument.activeElement === element) {
|
|
375
|
+
element.addEventListener('blur', dispose, {
|
|
376
|
+
once: true
|
|
377
|
+
});
|
|
378
|
+
} else {
|
|
379
|
+
dispose();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/** Whether `element` sits inside a layer that is closing or already closed. */
|
|
384
|
+
function isInsideClosingLayer(element) {
|
|
385
|
+
for (const record of openLayerRecords) {
|
|
386
|
+
if (record.isClosing && record.getLayer()?.contains(element)) {
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
function isRendered(element) {
|
|
393
|
+
const checkVisibility = element.checkVisibility;
|
|
394
|
+
if (typeof checkVisibility === 'function') {
|
|
395
|
+
return checkVisibility.call(element, {
|
|
396
|
+
visibilityProperty: true
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
const view = element.ownerDocument.defaultView;
|
|
400
|
+
for (let current = element; current != null; current = current.parentElement) {
|
|
401
|
+
if (current.hasAttribute('hidden')) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
// A popover's own display follows its open state, which an engine
|
|
405
|
+
// without `checkVisibility` may not reflect in computed style; an open
|
|
406
|
+
// layer that holds a candidate is not the reason to skip it.
|
|
407
|
+
const style = view?.getComputedStyle(current);
|
|
408
|
+
if (style?.display === 'none' && !current.hasAttribute('popover')) {
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
if (current === element && style?.visibility === 'hidden') {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Whether an open modal dialog makes `element` inert: it is outside every
|
|
420
|
+
* modal dialog while one is open. The browser sets no `inert` attribute for
|
|
421
|
+
* this, so `[inert]` alone does not find it.
|
|
422
|
+
*/
|
|
423
|
+
function isInertUnderModalDialog(element) {
|
|
424
|
+
let hasModal = false;
|
|
425
|
+
for (const dialog of element.ownerDocument.querySelectorAll('dialog[open]')) {
|
|
426
|
+
if (isModalDialog(dialog)) {
|
|
427
|
+
if (dialog.contains(element)) {
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
hasModal = true;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return hasModal;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** Whether returned focus may land on `element`. */
|
|
437
|
+
function canTakeReturnedFocus(element) {
|
|
438
|
+
return isHTMLElement(element) && element.isConnected && !isPageRoot(element) && !element.matches(':disabled') &&
|
|
439
|
+
// Inert, hidden and aria-hidden subtrees, and a dialog that is neither
|
|
440
|
+
// shown (open, or shown as a popover) nor displayed in flow, judged as
|
|
441
|
+
// the focus trap judges them.
|
|
442
|
+
isVisiblyFocusable(element) && !isInertUnderModalDialog(element) && !isInsideClosingLayer(element) && isRendered(element);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/** How a development warning names the layer: by its id when it has one. */
|
|
446
|
+
function nameOf(record, layer) {
|
|
447
|
+
const id = layer?.id || record.layerId;
|
|
448
|
+
return id ? `layer "${id}"` : 'a layer';
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/** The element itself when it takes focus, else its first tab stop. */
|
|
452
|
+
function focusableWithin(element) {
|
|
453
|
+
if (element == null) {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
if (isHTMLElement(element) && takesFocusAsIs(element)) {
|
|
457
|
+
return element;
|
|
458
|
+
}
|
|
459
|
+
return tabStopsIn(element)[0] ?? null;
|
|
460
|
+
}
|
|
461
|
+
function* candidatesOf(record) {
|
|
462
|
+
yield record.opener;
|
|
463
|
+
// A trigger may be a wrapper around the control (Popover's anchor wrapper).
|
|
464
|
+
yield focusableWithin(record.getTrigger());
|
|
465
|
+
if (record.layerId != null && record.layerId !== '') {
|
|
466
|
+
const escaped = typeof CSS !== 'undefined' && typeof CSS.escape === 'function' ? CSS.escape(record.layerId) : record.layerId;
|
|
467
|
+
yield record.doc.querySelector(`[aria-controls="${escaped}"]`);
|
|
468
|
+
}
|
|
469
|
+
yield record.getRestoreFallback();
|
|
470
|
+
yield focusableWithin(record.getAnchor());
|
|
471
|
+
const place = record.places.find(({
|
|
472
|
+
container
|
|
473
|
+
}) => container.isConnected);
|
|
474
|
+
if (place != null) {
|
|
475
|
+
const stops = tabStopsIn(place.container);
|
|
476
|
+
yield stops[place.index] ?? null;
|
|
477
|
+
yield stops[place.index - 1] ?? null;
|
|
478
|
+
yield stops[place.index + 1] ?? null;
|
|
479
|
+
yield stops[0] ?? null;
|
|
480
|
+
}
|
|
481
|
+
// The nearest connected ancestor that can take focus: the caller's check
|
|
482
|
+
// skips an inert or hidden one for the next.
|
|
483
|
+
for (const ancestor of record.ancestors) {
|
|
484
|
+
if (ancestor.isConnected) {
|
|
485
|
+
yield ancestor;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
function* fullChain(record) {
|
|
490
|
+
for (let current = record; current != null; current = current.inherited) {
|
|
491
|
+
yield* candidatesOf(current);
|
|
492
|
+
}
|
|
493
|
+
for (let current = record.parent; current != null; current = current.parent) {
|
|
494
|
+
if (!current.isClosing) {
|
|
495
|
+
yield current.getLayer();
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
yield record.doc.querySelector('main');
|
|
500
|
+
}
|
|
501
|
+
function endRecord(record) {
|
|
502
|
+
record.isDone = true;
|
|
503
|
+
record.stopListening();
|
|
504
|
+
openLayerRecords.delete(record);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/** Whether focus is inside the record's layer now. */
|
|
508
|
+
function holdsFocus(record) {
|
|
509
|
+
const layer = record.getLayer();
|
|
510
|
+
const active = (layer?.ownerDocument ?? record.layerDoc).activeElement;
|
|
511
|
+
return layer != null && active != null && layer.contains(active);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Whether closing the layer now would strand focus: focus entered the layer
|
|
516
|
+
* and is now inside it, inside another closing layer, or on nothing. Focus
|
|
517
|
+
* that already left stays where it is.
|
|
518
|
+
*/
|
|
519
|
+
export function isLayerFocusStranded(record) {
|
|
520
|
+
const {
|
|
521
|
+
doc
|
|
522
|
+
} = record;
|
|
523
|
+
const layer = record.getLayer();
|
|
524
|
+
const active = doc.activeElement;
|
|
525
|
+
const layerDoc = layer?.ownerDocument ?? record.layerDoc;
|
|
526
|
+
const layerActive = layerDoc.activeElement;
|
|
527
|
+
const isInside = layer != null && layerActive != null && layer.contains(layerActive);
|
|
528
|
+
if (!(record.hadFocusInside || isInside)) {
|
|
529
|
+
return false;
|
|
530
|
+
}
|
|
531
|
+
// A layer in a frame holds the page's focus as the frame element's.
|
|
532
|
+
const frameHost = layerDoc === doc ? null : layerDoc.defaultView?.frameElement ?? null;
|
|
533
|
+
return isFocusDetached(doc) || isInside || frameHost != null && active === frameHost && isInsideOrLost(layerDoc, layer) || active != null && isInsideClosingLayer(active);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Returns focus as a layer starts to close. Runs once per record. Call it
|
|
538
|
+
* while the layer still holds focus: in the popover's `beforetoggle` to
|
|
539
|
+
* closed, or before a dialog's `close()`. The browser's own restore acts only
|
|
540
|
+
* while focus is in the closing layer, so it then has nothing to do.
|
|
541
|
+
*/
|
|
542
|
+
export function restoreLayerFocus(record, options) {
|
|
543
|
+
if (record.isDone || record.isClosing) {
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
546
|
+
if (options?.isOpenerOnly === true) {
|
|
547
|
+
const {
|
|
548
|
+
opener
|
|
549
|
+
} = record;
|
|
550
|
+
if (!isLayerFocusStranded(record) || !canTakeReturnedFocus(opener)) {
|
|
551
|
+
return false;
|
|
552
|
+
}
|
|
553
|
+
record.isClosing = true;
|
|
554
|
+
focusCandidate(record, opener);
|
|
555
|
+
endRecord(record);
|
|
556
|
+
return true;
|
|
557
|
+
}
|
|
558
|
+
const isStranded = options?.wasStranded ?? isLayerFocusStranded(record);
|
|
559
|
+
record.isClosing = true;
|
|
560
|
+
const {
|
|
561
|
+
doc
|
|
562
|
+
} = record;
|
|
563
|
+
const layer = record.getLayer();
|
|
564
|
+
if (!isStranded) {
|
|
565
|
+
endRecord(record);
|
|
566
|
+
return false;
|
|
567
|
+
}
|
|
568
|
+
// A layer this one opened takes over the chain, and runs it at its own
|
|
569
|
+
// close. Only a layer that holds focus, or is opening and still to take
|
|
570
|
+
// it, does. One that never took focus (a typeahead's result list), or that
|
|
571
|
+
// focus has left, would drop the chain, so this layer runs it now.
|
|
572
|
+
for (const other of openLayerRecords) {
|
|
573
|
+
if (other !== record && !other.isClosing && other.parent === record && (holdsFocus(other) || other.awaitsFocus)) {
|
|
574
|
+
other.inherited = record;
|
|
575
|
+
endRecord(record);
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
for (const candidate of fullChain(record)) {
|
|
580
|
+
if (canTakeReturnedFocus(candidate)) {
|
|
581
|
+
focusCandidate(record, candidate);
|
|
582
|
+
if (doc.activeElement === candidate) {
|
|
583
|
+
endRecord(record);
|
|
584
|
+
return true;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
if (options?.warnsWhenNothingQualifies === false) {
|
|
589
|
+
endRecord(record);
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
devWarn('focus return', `no element could take focus when ${nameOf(record, layer)} closed; focus is left where it is.`);
|
|
593
|
+
endRecord(record);
|
|
594
|
+
return false;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Moves focus out of a layer that hides without closing: to the first of
|
|
599
|
+
* `first` that can take focus, then along the record's chain. The record
|
|
600
|
+
* stays open for the layer's close.
|
|
601
|
+
*/
|
|
602
|
+
export function moveFocusOutOfHiddenLayer(record, first) {
|
|
603
|
+
const layer = record.getLayer();
|
|
604
|
+
for (const candidate of [...first, ...fullChain(record)]) {
|
|
605
|
+
if (canTakeReturnedFocus(candidate) && !(layer?.contains(candidate) ?? false)) {
|
|
606
|
+
focusCandidate(record, candidate);
|
|
607
|
+
if (record.doc.activeElement === candidate) {
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
devWarn('focus return', `no element could take focus when ${nameOf(record, layer)} hid; focus falls to the page body.`);
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/** Stops a record without moving focus: the layer unmounted before it opened. */
|
|
617
|
+
export function cancelLayerFocus(record) {
|
|
618
|
+
if (!record.isDone) {
|
|
619
|
+
endRecord(record);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/** Test seam: forgets every open record. Internal. */
|
|
624
|
+
export function resetLayerFocusRecordsForTests() {
|
|
625
|
+
for (const record of openLayerRecords) {
|
|
626
|
+
record.stopListening();
|
|
627
|
+
}
|
|
628
|
+
openLayerRecords.clear();
|
|
223
629
|
}
|
package/dist/utils/hitArea.d.ts
CHANGED
|
@@ -60,6 +60,34 @@ export declare function resolveHitTarget(x: number, y: number, rects: ReadonlyAr
|
|
|
60
60
|
export declare function writeHitInsets(element: HTMLElement, insets: HitInsets): void;
|
|
61
61
|
/** What a touch can land on: the neighbours a hit area must not take from. */
|
|
62
62
|
export declare const INTERACTIVE_SELECTOR: string;
|
|
63
|
+
/**
|
|
64
|
+
* What `screenScale` reads as unscaled. `pixels`: a box within this many
|
|
65
|
+
* pixels of its whole-pixel offset size, read without a style lookup (0 turns
|
|
66
|
+
* the shortcut off). `ratio`: a scale less than this far from 1.
|
|
67
|
+
*/
|
|
68
|
+
export interface ScreenScaleTolerance {
|
|
69
|
+
readonly pixels: number;
|
|
70
|
+
readonly ratio: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A box's border-box size in layout px, from its computed style. Transforms
|
|
74
|
+
* do not change it, and it keeps the sub-pixel size a scaled rect loses to
|
|
75
|
+
* the browser's rounding. Null when the style has no pixel width.
|
|
76
|
+
*/
|
|
77
|
+
export declare function layoutSize(element: Element): {
|
|
78
|
+
width: number;
|
|
79
|
+
height: number;
|
|
80
|
+
} | null;
|
|
81
|
+
/**
|
|
82
|
+
* How far the transforms around `element` scale its box on screen, per axis.
|
|
83
|
+
* A layer that opens from a smaller scale scales every rect inside it, while
|
|
84
|
+
* the layout box keeps the size the layer settles at. Only a scale is
|
|
85
|
+
* expected: a rotated or skewed box would read as a larger scale.
|
|
86
|
+
*/
|
|
87
|
+
export declare function screenScale(element: Element, onScreen: HitRect, tolerance: ScreenScaleTolerance): {
|
|
88
|
+
x: number;
|
|
89
|
+
y: number;
|
|
90
|
+
};
|
|
63
91
|
/**
|
|
64
92
|
* The finite animations running or held in `root` and its subtree. An endless
|
|
65
93
|
* one, such as a spinner, moves nothing that comes to rest. Core pauses an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hitArea.d.ts","sourceRoot":"","sources":["../../src/utils/hitArea.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hitArea.d.ts","sourceRoot":"","sources":["../../src/utils/hitArea.ts"],"names":[],"mappings":"AA2CA,+BAA+B;AAC/B,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,qDAAqD;AACrD,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,6CAA6C;AAC7C,eAAO,MAAM,aAAa,EAAE,SAAkD,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAmCX;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,EAC/B,OAAO,GAAE,MAAyB,GACjC,SAAS,CAwBX;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAClC,OAAO,GAAE,MAAyB,EAClC,IAAI,GAAE,SAAmC,GACxC,SAAS,CAgDX;AAYD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,OAAO,GAAE,MAAyB,GACjC,MAAM,CAoBR;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAI5E;AAID,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,QA4BtB,CAAC;AA4JZ;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAkBD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,OAAO,GACf;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAyBxC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,oBAAoB,GAC9B;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CA6BxB;AAkND;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,CAcxE;AAgCD,sEAAsE;AACtE,wBAAgB,WAAW,CACzB,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,EACpC,IAAI,EAAE,MAAM,IAAI,GACf,IAAI,CAIN;AA+fD,iCAAiC;AACjC,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAChB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,KACjC,SAAS,CAAC;IACf;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAW3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,EACrC,EACE,OAA0B,EAC1B,qBAA6B,EAC7B,MAAM,EAAE,QAAQ,EAChB,YAAmB,GACpB,GAAE,mBAAwB,GAC1B,MAAM,IAAI,CA+DZ"}
|
package/dist/utils/hitArea.js
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
* and `resolveHitTarget` answer from rects. `watchHitArea` keeps a control's
|
|
12
12
|
* insets live where the primary pointer is coarse. `groupGrowth` sizes a
|
|
13
13
|
* group's box from its edge members, and shrinks a side the members do not
|
|
14
|
-
* reach. `INTERACTIVE_SELECTOR` names what a touch can land on
|
|
14
|
+
* reach. `INTERACTIVE_SELECTOR` names what a touch can land on.
|
|
15
|
+
* `screenScale` reads how far transforms scale a box, and `layoutSize` a
|
|
16
|
+
* box's untransformed size (hooks/useOverflow.ts uses both)
|
|
15
17
|
* @position Core-internal utility, not exported from `@astryxdesign/core/utils`.
|
|
16
18
|
* Groups that measure their actions at press start pass `resolveHitTarget`;
|
|
17
19
|
* a standalone control writes `watchHitArea`'s insets to an invisible
|
|
@@ -349,14 +351,47 @@ const UNSCALED = {
|
|
|
349
351
|
y: 1
|
|
350
352
|
};
|
|
351
353
|
|
|
354
|
+
/**
|
|
355
|
+
* What `screenScale` reads as unscaled. `pixels`: a box within this many
|
|
356
|
+
* pixels of its whole-pixel offset size, read without a style lookup (0 turns
|
|
357
|
+
* the shortcut off). `ratio`: a scale less than this far from 1.
|
|
358
|
+
*/
|
|
359
|
+
|
|
352
360
|
/** One axis of a box's scale on screen: its client size over its layout size. */
|
|
353
|
-
function axisScale(onScreen, layout) {
|
|
361
|
+
function axisScale(onScreen, layout, ratio) {
|
|
354
362
|
if (!(layout > 0) || !(onScreen > 0)) {
|
|
355
363
|
return 1;
|
|
356
364
|
}
|
|
357
365
|
const scale = onScreen / layout;
|
|
358
|
-
// Within
|
|
359
|
-
return Math.abs(scale - 1) <
|
|
366
|
+
// Within the tolerance of 1 the box is at its layout size.
|
|
367
|
+
return Math.abs(scale - 1) < ratio ? 1 : scale;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Hit areas: within a pixel of its layout size a box reads as unscaled, which
|
|
372
|
+
* bounds the inset error at about a pixel and skips a style lookup.
|
|
373
|
+
*/
|
|
374
|
+
const HIT_AREA_TOLERANCE = {
|
|
375
|
+
pixels: 1,
|
|
376
|
+
ratio: 1e-3
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* A box's border-box size in layout px, from its computed style. Transforms
|
|
381
|
+
* do not change it, and it keeps the sub-pixel size a scaled rect loses to
|
|
382
|
+
* the browser's rounding. Null when the style has no pixel width.
|
|
383
|
+
*/
|
|
384
|
+
export function layoutSize(element) {
|
|
385
|
+
const style = element.ownerDocument.defaultView?.getComputedStyle(element);
|
|
386
|
+
if (style == null || !style.width.endsWith('px')) {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
const px = value => Number.parseFloat(value) || 0;
|
|
390
|
+
const isContentBox = style.boxSizing !== 'border-box';
|
|
391
|
+
return {
|
|
392
|
+
width: px(style.width) + (isContentBox ? px(style.paddingLeft) + px(style.paddingRight) + px(style.borderLeftWidth) + px(style.borderRightWidth) : 0),
|
|
393
|
+
height: px(style.height) + (isContentBox ? px(style.paddingTop) + px(style.paddingBottom) + px(style.borderTopWidth) + px(style.borderBottomWidth) : 0)
|
|
394
|
+
};
|
|
360
395
|
}
|
|
361
396
|
|
|
362
397
|
/**
|
|
@@ -365,7 +400,7 @@ function axisScale(onScreen, layout) {
|
|
|
365
400
|
* the layout box keeps the size the layer settles at. Only a scale is
|
|
366
401
|
* expected: a rotated or skewed box would read as a larger scale.
|
|
367
402
|
*/
|
|
368
|
-
function screenScale(element, onScreen) {
|
|
403
|
+
export function screenScale(element, onScreen, tolerance) {
|
|
369
404
|
// The offset size is the layout size in whole pixels, unaffected by
|
|
370
405
|
// transforms, and costs no style resolution. A box with none, such as an SVG
|
|
371
406
|
// element or a jsdom box, reads as unscaled.
|
|
@@ -375,23 +410,22 @@ function screenScale(element, onScreen) {
|
|
|
375
410
|
if (offsetWidth === 0 || offsetHeight === 0) {
|
|
376
411
|
return UNSCALED;
|
|
377
412
|
}
|
|
378
|
-
// Within
|
|
379
|
-
//
|
|
380
|
-
|
|
381
|
-
if (Math.abs(onScreen.right - onScreen.left - offsetWidth) <= 1 && Math.abs(onScreen.bottom - onScreen.top - offsetHeight) <= 1) {
|
|
413
|
+
// Within `tolerance.pixels` of its layout size the box reads as unscaled.
|
|
414
|
+
// Any other box reads its exact size from the computed style.
|
|
415
|
+
if (tolerance.pixels > 0 && Math.abs(onScreen.right - onScreen.left - offsetWidth) <= tolerance.pixels && Math.abs(onScreen.bottom - onScreen.top - offsetHeight) <= tolerance.pixels) {
|
|
382
416
|
return UNSCALED;
|
|
383
417
|
}
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
418
|
+
const size = layoutSize(element);
|
|
419
|
+
if (size == null) {
|
|
386
420
|
return UNSCALED;
|
|
387
421
|
}
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
422
|
+
const {
|
|
423
|
+
width,
|
|
424
|
+
height
|
|
425
|
+
} = size;
|
|
392
426
|
return {
|
|
393
|
-
x: axisScale(onScreen.right - onScreen.left, width),
|
|
394
|
-
y: axisScale(onScreen.bottom - onScreen.top, height)
|
|
427
|
+
x: axisScale(onScreen.right - onScreen.left, width, tolerance.ratio),
|
|
428
|
+
y: axisScale(onScreen.bottom - onScreen.top, height, tolerance.ratio)
|
|
395
429
|
};
|
|
396
430
|
}
|
|
397
431
|
|
|
@@ -545,7 +579,7 @@ function readCandidates(doc) {
|
|
|
545
579
|
/** A control's rect and clamped insets, from candidates already read. */
|
|
546
580
|
function measureOne(watch, candidates) {
|
|
547
581
|
const target = plainRect(watch.element);
|
|
548
|
-
const scale = screenScale(watch.element, target);
|
|
582
|
+
const scale = screenScale(watch.element, target, HIT_AREA_TOLERANCE);
|
|
549
583
|
// Two targets each growing up to half the minimum reach each other from a
|
|
550
584
|
// minimum apart.
|
|
551
585
|
const reach = Math.max(0, watch.minSize);
|
|
@@ -15,6 +15,16 @@ export interface InputSubscriptionOptions {
|
|
|
15
15
|
}
|
|
16
16
|
/** The events a window's capture phase sees: its own, and the document's. */
|
|
17
17
|
export type InputEventMap = WindowEventMap & DocumentEventMap;
|
|
18
|
+
/** The fingers on a window's screen, and the touches that started there. */
|
|
19
|
+
export interface TouchRecord {
|
|
20
|
+
/** How many fingers are on the screen. */
|
|
21
|
+
readonly fingers: number;
|
|
22
|
+
/**
|
|
23
|
+
* How many touches started. It never goes down, so a count a caller notes
|
|
24
|
+
* stays comparable: a different count later says a touch started since.
|
|
25
|
+
*/
|
|
26
|
+
readonly starts: number;
|
|
27
|
+
}
|
|
18
28
|
/** A point in the viewport, in CSS pixels. */
|
|
19
29
|
export interface MousePoint {
|
|
20
30
|
readonly x: number;
|
|
@@ -41,6 +51,23 @@ export declare function getLastMousePoint(view: Window): MousePoint | null;
|
|
|
41
51
|
* do. Reading it adds no listener.
|
|
42
52
|
*/
|
|
43
53
|
export declare function getDownPresses(view: Window): ReadonlyMap<number, MousePoint>;
|
|
54
|
+
/**
|
|
55
|
+
* The fingers on `view`'s screen and the touches that started there, from the
|
|
56
|
+
* touch events its stream delivered. A native pan keeps the finger on the
|
|
57
|
+
* screen, though the pan's `pointercancel` drops its press from
|
|
58
|
+
* getDownPresses. The stream counts only while subscribers listen to
|
|
59
|
+
* `touchstart`, `touchend` and `touchcancel`, as the keyboard module does.
|
|
60
|
+
* Reading it adds no listener. It counts a stylus too, since a stylus drag
|
|
61
|
+
* moves the page as a finger does. The gesture host's own count skips a
|
|
62
|
+
* stylus, and it listens only while a recognizer needs input, so it cannot
|
|
63
|
+
* serve here.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```
|
|
67
|
+
* const isFingerDown = getTouches(window).fingers > 0;
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function getTouches(view: Window): TouchRecord;
|
|
44
71
|
/**
|
|
45
72
|
* Listen to `type` on `view`'s capture phase through its shared native
|
|
46
73
|
* listener. Returns the unsubscribe; calling it again does nothing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputStream.d.ts","sourceRoot":"","sources":["../../src/utils/inputStream.ts"],"names":[],"mappings":"AAoDA,0CAA0C;AAC1C,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,6EAA6E;AAC7E,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAkB9D,8CAA8C;AAC9C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAE5E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,aAAa,EAC1D,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,OAAO,EAC9C,EAAC,OAAe,EAAE,KAAa,EAAC,GAAE,wBAA6B,GAC9D,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"inputStream.d.ts","sourceRoot":"","sources":["../../src/utils/inputStream.ts"],"names":[],"mappings":"AAoDA,0CAA0C;AAC1C,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,6EAA6E;AAC7E,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAkB9D,4EAA4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAcD,8CAA8C;AAC9C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAE5E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAEpD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,aAAa,EAC1D,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,OAAO,EAC9C,EAAC,OAAe,EAAE,KAAa,EAAC,GAAE,wBAA6B,GAC9D,MAAM,IAAI,CAoDZ"}
|