@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
|
@@ -6,20 +6,23 @@
|
|
|
6
6
|
* rideKeyboard and the shared animator
|
|
7
7
|
* @output The keyboard targets: their registry, followKeyboard for a docked
|
|
8
8
|
* or scrolling target, and keepFieldAboveKeyboard, a covered field's path.
|
|
9
|
-
* Also followsKeyboard, the touch gate, and deliverTap, a tap's delivery
|
|
9
|
+
* Also followsKeyboard, the touch gate, and deliverTap, a tap's delivery.
|
|
10
|
+
* Each scroll a reveal makes goes back when the keyboard goes
|
|
10
11
|
* @position Keyboard module, internal to core. useMobileKeyboard calls it.
|
|
11
12
|
*
|
|
12
13
|
* SYNC: When modified, update /packages/core/src/keyboard/README.md
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
16
|
import { animatorFor } from "../motion/animator.js";
|
|
17
|
+
import { reducedMotionFade } from "../motion/reducedMotion.js";
|
|
16
18
|
import { isCoarsePointer } from "../utils/coarsePointer.js";
|
|
17
|
-
import { subscribeInput } from "../utils/inputStream.js";
|
|
19
|
+
import { getTouches, subscribeInput } from "../utils/inputStream.js";
|
|
18
20
|
import { layoutViewportHeight } from "../utils/layoutViewport.js";
|
|
19
21
|
import { nearestScroller, scrollingAncestor } from "../utils/scrollingAncestor.js";
|
|
20
22
|
import { sharedWeakMap, sharedWeakSet } from "../utils/sharedRealm.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
+
import { isIosWebKit } from "../utils/touchQueries.js";
|
|
24
|
+
import { KEYBOARD_EPSILON, claimTapFocus, findTextEntryControl, focusAtPoint, getKeyboardHeight, isFingerOnScreen, isKeyboardMeasurable, isTextEntryControl, panVisualViewportTo, refuseFocusReveal, subscribeKeyboardHeight, watchRevealPan } from "./keyboardHeight.js";
|
|
25
|
+
import { bringsUpKeyboard, getKeyboardLayoutGuide, hidesField, keyboardProfileOf } from "./keyboardLayoutGuide.js";
|
|
23
26
|
import { distanceIntoBand } from "./revealBand.js";
|
|
24
27
|
import { rideKeyboard } from "./rideKeyboard.js";
|
|
25
28
|
|
|
@@ -34,6 +37,14 @@ import { rideKeyboard } from "./rideKeyboard.js";
|
|
|
34
37
|
*/
|
|
35
38
|
export const FIELD_OFFSET = 10;
|
|
36
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Chrome on Android pans the page itself if the keyboard still covers the
|
|
42
|
+
* focused field about 100 to 170 ms after the report. A field a fraction of a
|
|
43
|
+
* pixel under the keyboard's top still counts as covered. So a show sets the
|
|
44
|
+
* field this far above that top at once, CSS px, and only the rest rides.
|
|
45
|
+
*/
|
|
46
|
+
export const FIELD_CLEARANCE_AT_REPORT = 4;
|
|
47
|
+
|
|
37
48
|
// Targets that keep their own fields above the keyboard. A field inside one
|
|
38
49
|
// moves nothing itself, so nothing moves twice.
|
|
39
50
|
const targets = sharedWeakSet('keyboard/keyboard-target/targets', 1);
|
|
@@ -246,46 +257,97 @@ function liftFor(target, animator, height, offset, win, isHostOwned) {
|
|
|
246
257
|
}
|
|
247
258
|
return animator.get('y') < 0 ? targetCovered : 0;
|
|
248
259
|
}
|
|
249
|
-
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
function scrollBy(scroller, distance, win) {
|
|
260
|
+
function scrollBy(scroller, distance, win, behavior = 'instant') {
|
|
261
|
+
// An explicit 'instant' also overrides a scroller's own smooth
|
|
262
|
+
// `scroll-behavior`.
|
|
253
263
|
const doc = scroller.ownerDocument;
|
|
254
264
|
if (scroller === (doc.scrollingElement ?? doc.documentElement)) {
|
|
255
265
|
win.scrollBy({
|
|
256
266
|
top: distance,
|
|
257
|
-
behavior
|
|
267
|
+
behavior
|
|
268
|
+
});
|
|
269
|
+
} else if (typeof scroller.scrollBy === 'function') {
|
|
270
|
+
scroller.scrollBy({
|
|
271
|
+
top: distance,
|
|
272
|
+
behavior
|
|
258
273
|
});
|
|
259
274
|
} else {
|
|
260
275
|
scroller.scrollTop += distance;
|
|
261
276
|
}
|
|
262
277
|
}
|
|
278
|
+
function scrollRangeOf(scroller, win) {
|
|
279
|
+
const doc = scroller.ownerDocument;
|
|
280
|
+
const view = scroller === (doc.scrollingElement ?? doc.documentElement) ? layoutViewportHeight(win) : scroller.clientHeight;
|
|
281
|
+
return Math.max(0, scroller.scrollHeight - view);
|
|
282
|
+
}
|
|
263
283
|
|
|
264
|
-
//
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
|
|
268
|
-
|
|
284
|
+
// Whether a reveal for a keyboard rises on the browser's smooth scroll. On
|
|
285
|
+
// iOS, the browser runs no reveal after Core takes the focus. Its first report
|
|
286
|
+
// comes as the keyboard starts to slide, so the field rises beside it. Chrome
|
|
287
|
+
// on Android checks the field in the resize's own commit, where a smooth
|
|
288
|
+
// scroll would leave it covered. There, and under Reduce Motion, the field
|
|
289
|
+
// moves at once.
|
|
290
|
+
function risesSmoothly(field) {
|
|
291
|
+
return isIosWebKit(field.ownerDocument.defaultView) && reducedMotionFade(field) == null;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// The band a field must be in. It is inside its scroller's box and the
|
|
295
|
+
// viewport, and `offset` above the keyboard while one shows. A move not yet
|
|
296
|
+
// written shifts the scroller by `shift`.
|
|
297
|
+
function bandOf(scroller, height, offset, win, shift = 0) {
|
|
298
|
+
const doc = scroller.ownerDocument;
|
|
269
299
|
const keyboardTop = layoutViewportHeight(win) - height;
|
|
270
|
-
let
|
|
271
|
-
let
|
|
300
|
+
let top = 0;
|
|
301
|
+
let bottom = height > KEYBOARD_EPSILON ? keyboardTop - offset : keyboardTop;
|
|
272
302
|
if (scroller !== (doc.scrollingElement ?? doc.documentElement)) {
|
|
273
303
|
const box = scroller.getBoundingClientRect();
|
|
274
|
-
|
|
275
|
-
|
|
304
|
+
top = Math.max(top, box.top + shift);
|
|
305
|
+
bottom = Math.min(bottom, box.bottom + shift);
|
|
276
306
|
}
|
|
307
|
+
return {
|
|
308
|
+
top,
|
|
309
|
+
bottom
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// How far `field` sits outside its band (see bandOf). A move not yet written
|
|
314
|
+
// shifts the field and its scroller by `shift`.
|
|
315
|
+
function revealDistance(field, scroller, height, offset, win, shift = 0) {
|
|
316
|
+
const band = bandOf(scroller, height, offset, win, shift);
|
|
277
317
|
const box = field.getBoundingClientRect();
|
|
278
|
-
return distanceIntoBand(box.top + shift, box.bottom + shift,
|
|
318
|
+
return distanceIntoBand(box.top + shift, box.bottom + shift, band.top, band.bottom);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Whether `field` lies wholly in its band. A band too short for the field
|
|
322
|
+
// holds none of it, as when a scroll area sits under the keyboard. A scroll of
|
|
323
|
+
// `scroller` not yet drawn moves the field by `fieldShift`.
|
|
324
|
+
function sitsInBand(field, scroller, height, offset, win, fieldShift = 0) {
|
|
325
|
+
const band = bandOf(scroller, height, offset, win);
|
|
326
|
+
const box = field.getBoundingClientRect();
|
|
327
|
+
return box.top + fieldShift >= band.top - KEYBOARD_EPSILON && box.bottom + fieldShift <= band.bottom + KEYBOARD_EPSILON;
|
|
279
328
|
}
|
|
280
329
|
|
|
281
330
|
// Scrolls `field` into its band with its nearest scroller, the document
|
|
282
331
|
// included. Nothing else moves: a scroller that cannot scroll far enough
|
|
283
|
-
// leaves the rest of the field covered.
|
|
284
|
-
|
|
332
|
+
// leaves the rest of the field covered. A scroll for a keyboard goes back
|
|
333
|
+
// when the keyboard goes. Only a scroll that places the field rises (see
|
|
334
|
+
// risesSmoothly), unless `canRise` is false. Returns the part of the scroll
|
|
335
|
+
// not yet drawn.
|
|
336
|
+
function reveal(field, scroller, height, offset, win, canRise = true) {
|
|
285
337
|
const distance = revealDistance(field, scroller, height, offset, win);
|
|
286
|
-
if (Math.abs(distance)
|
|
287
|
-
|
|
338
|
+
if (Math.abs(distance) <= KEYBOARD_EPSILON) {
|
|
339
|
+
return 0;
|
|
340
|
+
}
|
|
341
|
+
const now = scrollTopOf(scroller, win);
|
|
342
|
+
const target = Math.min(Math.max(now + distance, 0), scrollRangeOf(scroller, win));
|
|
343
|
+
const rises = canRise && height > KEYBOARD_EPSILON && Math.abs(target - now - distance) <= KEYBOARD_EPSILON && sitsInBand(field, scroller, height, offset, win, -distance) && risesSmoothly(field);
|
|
344
|
+
// A rise still on its way extends Core's own scroll.
|
|
345
|
+
const before = keyboardScrollTarget(scroller, win) ?? now;
|
|
346
|
+
scrollBy(scroller, distance, win, rises ? 'smooth' : 'instant');
|
|
347
|
+
if (height > KEYBOARD_EPSILON) {
|
|
348
|
+
noteKeyboardScroll(scroller, before, win, rises ? target : undefined);
|
|
288
349
|
}
|
|
350
|
+
return rises ? target - scrollTopOf(scroller, win) : 0;
|
|
289
351
|
}
|
|
290
352
|
|
|
291
353
|
// Focuses the tapped field without the browser's reveal, then raises the
|
|
@@ -321,26 +383,65 @@ export function deliverTap(control, x, y, touch) {
|
|
|
321
383
|
* Puts back a pan the browser makes on its own after a keyboard report. This
|
|
322
384
|
* happens, for example, after a focus no claim saw: a script's `focus()` while
|
|
323
385
|
* nothing has focus. The field sits in place already, so the pan only displaces
|
|
324
|
-
* the page.
|
|
325
|
-
*
|
|
386
|
+
* the page. A pan made at the last height goes back at the next height's
|
|
387
|
+
* report. The caller's own pan is the new rest once reported (`expectPan`):
|
|
388
|
+
* its report comes after the call returns.
|
|
389
|
+
* Feed `report` each keyboard height the module reports; `owns` says whether a
|
|
390
|
+
* focused element is one this watch keeps in place. `documentScrollIsReveal`
|
|
391
|
+
* is watchRevealPan's option of that name.
|
|
326
392
|
*/
|
|
327
|
-
export function watchPans(win, owns) {
|
|
393
|
+
export function watchPans(win, owns, documentScrollIsReveal = false) {
|
|
328
394
|
const watch = watchRevealPan(win, {
|
|
329
|
-
owns
|
|
395
|
+
owns,
|
|
396
|
+
documentScrollIsReveal
|
|
330
397
|
});
|
|
331
398
|
let lastHeight = getKeyboardHeight(win);
|
|
399
|
+
let ownPanTop = null;
|
|
332
400
|
return {
|
|
333
401
|
report(height) {
|
|
402
|
+
const top = win.visualViewport?.offsetTop ?? 0;
|
|
334
403
|
if (height !== lastHeight) {
|
|
404
|
+
if (ownPanTop == null && lastHeight > KEYBOARD_EPSILON && watch.isRevealPan(height)) {
|
|
405
|
+
watch.putBack();
|
|
406
|
+
}
|
|
335
407
|
lastHeight = height;
|
|
336
408
|
watch.report();
|
|
409
|
+
} else if (ownPanTop != null && Math.abs(top - ownPanTop) <= KEYBOARD_EPSILON) {
|
|
410
|
+
ownPanTop = null;
|
|
411
|
+
watch.report();
|
|
337
412
|
} else if (watch.isRevealPan(height)) {
|
|
338
413
|
watch.putBack();
|
|
339
414
|
}
|
|
340
415
|
},
|
|
416
|
+
expectPan(top) {
|
|
417
|
+
ownPanTop = top;
|
|
418
|
+
},
|
|
341
419
|
stop: () => watch.stop()
|
|
342
420
|
};
|
|
343
421
|
}
|
|
422
|
+
// Pans the visual viewport until `field` sits `offset` above the keyboard,
|
|
423
|
+
// within the keyboard's room and never past the field's top. Returns whether
|
|
424
|
+
// the field is clear. In Safari a document scroll reaches that room first.
|
|
425
|
+
function panIntoView(field, offset, win, pans) {
|
|
426
|
+
const viewport = win.visualViewport;
|
|
427
|
+
if (viewport == null) {
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
const box = field.getBoundingClientRect();
|
|
431
|
+
const need = box.bottom + offset - (viewport.offsetTop + viewport.height);
|
|
432
|
+
if (need <= KEYBOARD_EPSILON) {
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
435
|
+
const room = layoutViewportHeight(win) - viewport.offsetTop - viewport.height;
|
|
436
|
+
const pan = Math.min(need, room, box.top - viewport.offsetTop);
|
|
437
|
+
if (pan <= KEYBOARD_EPSILON) {
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
const top = viewport.offsetTop + pan;
|
|
441
|
+
pans.expectPan(top);
|
|
442
|
+
panVisualViewportTo(win, top);
|
|
443
|
+
return pan >= need - KEYBOARD_EPSILON;
|
|
444
|
+
}
|
|
344
445
|
function focusedFieldIn(target) {
|
|
345
446
|
const active = target.ownerDocument.activeElement;
|
|
346
447
|
return active != null && active !== target && target.contains(active) && isTextEntryControl(active) ? active : null;
|
|
@@ -379,6 +480,7 @@ export function followKeyboard(target, {
|
|
|
379
480
|
return () => {};
|
|
380
481
|
}
|
|
381
482
|
const unregister = registerKeyboardTarget(target);
|
|
483
|
+
const stopScrollBack = claimKeyboardScrollBack(win);
|
|
382
484
|
const stopClaim = refuseFocusReveal(doc, {
|
|
383
485
|
claim: destination => destination instanceof win.HTMLElement && destination !== target && target.contains(destination) && isTextEntryControl(destination) ? destination : null
|
|
384
486
|
});
|
|
@@ -396,34 +498,97 @@ export function followKeyboard(target, {
|
|
|
396
498
|
stopMoving(true);
|
|
397
499
|
stopTaps();
|
|
398
500
|
stopClaim();
|
|
501
|
+
stopScrollBack();
|
|
399
502
|
unregister();
|
|
400
503
|
};
|
|
401
504
|
}
|
|
402
505
|
|
|
506
|
+
// Who reveals a field its scroller cannot place. 'document': the document,
|
|
507
|
+
// then a pan. 'fixed': the same, with a scroll that moves nothing undone.
|
|
508
|
+
// 'keep': nobody, since the scroller holds every field it reveals.
|
|
509
|
+
|
|
403
510
|
// Reveals the focused field `field()` returns through `scroller` when the
|
|
404
511
|
// keyboard's height changes, now, and when focus moves into `region` with the
|
|
405
512
|
// keyboard already up. Returns the call that stops it.
|
|
406
|
-
function revealWithKeyboard(region, field, scroller, offset, win) {
|
|
513
|
+
function revealWithKeyboard(region, field, scroller, offset, win, unplaced = 'keep') {
|
|
514
|
+
// Unless `unplaced` is 'keep', a field its scroller leaves covered is
|
|
515
|
+
// revealed by the document, then by a pan where the document cannot reach.
|
|
516
|
+
const doc = scroller.ownerDocument;
|
|
517
|
+
const root = doc.scrollingElement ?? doc.documentElement;
|
|
518
|
+
let isPlaced = true;
|
|
519
|
+
// A long press focuses with the finger still down. The show's first reveal
|
|
520
|
+
// runs all the same.
|
|
521
|
+
let hasRevealed = false;
|
|
522
|
+
// The input stream's touch-start count at the last reveal. The press that
|
|
523
|
+
// focused the field started before it, so it holds no report. Gboard can
|
|
524
|
+
// report a 48 px keyboard first, then its full height, while that press is
|
|
525
|
+
// still down.
|
|
526
|
+
let startsAtReveal = 0;
|
|
407
527
|
const revealNow = height => {
|
|
408
528
|
const focused = field();
|
|
409
|
-
if (focused
|
|
410
|
-
|
|
529
|
+
if (focused == null) {
|
|
530
|
+
return;
|
|
411
531
|
}
|
|
532
|
+
hasRevealed = height > KEYBOARD_EPSILON;
|
|
533
|
+
startsAtReveal = getTouches(win).starts;
|
|
534
|
+
const rising = reveal(focused, scroller, height, offset, win);
|
|
535
|
+
if (unplaced === 'keep') {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
isPlaced = rising !== 0 || sitsInBand(focused, scroller, height, offset, win);
|
|
539
|
+
if (isPlaced || height <= KEYBOARD_EPSILON) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
if (unplaced === 'document') {
|
|
543
|
+
if (scroller !== root && reveal(focused, root, height, offset, win) !== 0) {
|
|
544
|
+
isPlaced = true;
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
} else {
|
|
548
|
+
// Safari runs no reveal after Core takes the focus. Its document scroll
|
|
549
|
+
// moves a fixed container too, as a visual-viewport offset while its
|
|
550
|
+
// keyboard shows. Where the scroll moves nothing, Core scrolls back.
|
|
551
|
+
const top = focused.getBoundingClientRect().top;
|
|
552
|
+
const scrollY = win.scrollY;
|
|
553
|
+
reveal(focused, root, height, offset, win, false);
|
|
554
|
+
if (Math.abs(focused.getBoundingClientRect().top - top) <= KEYBOARD_EPSILON) {
|
|
555
|
+
const scrolled = win.scrollY - scrollY;
|
|
556
|
+
if (scrolled !== 0) {
|
|
557
|
+
const before = win.scrollY;
|
|
558
|
+
win.scrollBy({
|
|
559
|
+
top: -scrolled,
|
|
560
|
+
behavior: 'instant'
|
|
561
|
+
});
|
|
562
|
+
noteKeyboardScroll(root, before, win);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
// Chrome scrolls the document only within its range. The pan takes the
|
|
567
|
+
// rest at once, so Chrome's own pan finds the field clear.
|
|
568
|
+
isPlaced = panIntoView(focused, offset, win, pans);
|
|
412
569
|
};
|
|
413
|
-
const pans = watchPans(win, focused => focused === field());
|
|
414
|
-
// A report within a pixel of the last height
|
|
415
|
-
//
|
|
570
|
+
const pans = watchPans(win, focused => focused === field() && isPlaced);
|
|
571
|
+
// A report within a pixel of the last height is a pan, a scroll or a
|
|
572
|
+
// zoom's rounding, so the field stays. After the show's first reveal, a
|
|
573
|
+
// report during a press that began after that reveal moves nothing, as
|
|
574
|
+
// when Firefox's toolbar hides in a drag.
|
|
416
575
|
let lastHeight = getKeyboardHeight(win);
|
|
576
|
+
const isLaterPressDown = () => isFingerOnScreen(win) && getTouches(win).starts !== startsAtReveal;
|
|
417
577
|
const stopReports = subscribeKeyboardHeight(win, event => {
|
|
418
578
|
if (event.type === 'viewport') {
|
|
419
579
|
if (Math.abs(event.height - lastHeight) > KEYBOARD_EPSILON) {
|
|
420
580
|
lastHeight = event.height;
|
|
421
|
-
|
|
581
|
+
if (!hasRevealed || !isLaterPressDown()) {
|
|
582
|
+
revealNow(event.height);
|
|
583
|
+
}
|
|
422
584
|
}
|
|
423
585
|
pans.report(event.height);
|
|
424
586
|
}
|
|
425
587
|
});
|
|
426
|
-
const onFocusIn = () =>
|
|
588
|
+
const onFocusIn = () => {
|
|
589
|
+
stopKeyboardScrollBack(win);
|
|
590
|
+
revealNow(getKeyboardHeight(win));
|
|
591
|
+
};
|
|
427
592
|
region.addEventListener('focusin', onFocusIn);
|
|
428
593
|
revealNow(getKeyboardHeight(win));
|
|
429
594
|
return () => {
|
|
@@ -472,6 +637,17 @@ function fieldLift(target, animator, height, offset, win) {
|
|
|
472
637
|
return Math.min(need, overlap);
|
|
473
638
|
}
|
|
474
639
|
|
|
640
|
+
// The move that sets the focused field in `target` FIELD_CLEARANCE_AT_REPORT
|
|
641
|
+
// px above a keyboard `height` px tall, or null with no field to clear.
|
|
642
|
+
function clearanceAtReport(target, animator, height, win) {
|
|
643
|
+
const field = focusedFieldIn(target);
|
|
644
|
+
if (field == null) {
|
|
645
|
+
return null;
|
|
646
|
+
}
|
|
647
|
+
const need = coveredBy(restingBottom(field, animator), height, FIELD_CLEARANCE_AT_REPORT, win);
|
|
648
|
+
return need > 0 ? -need : null;
|
|
649
|
+
}
|
|
650
|
+
|
|
475
651
|
// The ride that moves each target. A new ride on the same target takes over,
|
|
476
652
|
// whether the old one still rides or waits for the keyboard to go. So two never
|
|
477
653
|
// move one target, and the one taken over never moves it again.
|
|
@@ -493,7 +669,9 @@ function rideWithKeyboard(target, offset, win, isHostOwned) {
|
|
|
493
669
|
let state = 'riding';
|
|
494
670
|
let stopReports = null;
|
|
495
671
|
let stopGuide = null;
|
|
496
|
-
|
|
672
|
+
// The guide runs only in Chrome, whose own reveal of a field in the target
|
|
673
|
+
// also scrolls the page behind it.
|
|
674
|
+
const pans = watchPans(win, focused => target.contains(focused), guide != null);
|
|
497
675
|
let frame = 0;
|
|
498
676
|
let pendingSlide = null;
|
|
499
677
|
const end = () => {
|
|
@@ -538,6 +716,14 @@ function rideWithKeyboard(target, offset, win, isHostOwned) {
|
|
|
538
716
|
y
|
|
539
717
|
});
|
|
540
718
|
} else {
|
|
719
|
+
// On a show, the field is set just above the keyboard's top at once,
|
|
720
|
+
// so Chrome's own pan finds it clear. Only the rest rides.
|
|
721
|
+
const atReport = transition.kind === 'show' ? clearanceAtReport(target, animator, height, win) : null;
|
|
722
|
+
if (atReport != null && y < atReport && atReport < animator.get('y')) {
|
|
723
|
+
animator.set({
|
|
724
|
+
y: atReport
|
|
725
|
+
});
|
|
726
|
+
}
|
|
541
727
|
rideKeyboard(animator, {
|
|
542
728
|
y
|
|
543
729
|
}, transition);
|
|
@@ -567,15 +753,18 @@ function rideWithKeyboard(target, offset, win, isHostOwned) {
|
|
|
567
753
|
place(next?.to ?? guide?.inset ?? getKeyboardHeight(win), next);
|
|
568
754
|
});
|
|
569
755
|
};
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
if (
|
|
756
|
+
// Every viewport report feeds the pan watch, so a pan the browser still
|
|
757
|
+
// makes is put back. Without the guide, the report also places the target.
|
|
758
|
+
stopReports = subscribeKeyboardHeight(win, event => {
|
|
759
|
+
if (event.type === 'viewport') {
|
|
760
|
+
if (guide == null) {
|
|
575
761
|
placeOnNextFrame(null);
|
|
576
|
-
pans.report(event.height);
|
|
577
762
|
}
|
|
578
|
-
|
|
763
|
+
pans.report(event.height);
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
if (guide != null) {
|
|
767
|
+
stopGuide = guide.subscribe(placeOnNextFrame);
|
|
579
768
|
}
|
|
580
769
|
// A field gaining focus with the keyboard up places the target. A blur to
|
|
581
770
|
// nothing waits for the keyboard's own report or slide, so the target rides
|
|
@@ -601,57 +790,70 @@ function rideWithKeyboard(target, offset, win, isHostOwned) {
|
|
|
601
790
|
|
|
602
791
|
/** How keepFieldAboveKeyboard keeps its field clear. */
|
|
603
792
|
|
|
793
|
+
// Whether `scroller`, in a fixed container the app positions, can bring
|
|
794
|
+
// `field` into its band. It must scroll the field up to the scroller's own
|
|
795
|
+
// top, since a scroller does not gain the range it lacks at its end yet. With
|
|
796
|
+
// the keyboard up, its box must also leave the field room above the keyboard.
|
|
797
|
+
function canBringUp(field, scroller, offset, win) {
|
|
798
|
+
const range = scroller.scrollHeight - scroller.clientHeight - scroller.scrollTop;
|
|
799
|
+
const box = field.getBoundingClientRect();
|
|
800
|
+
if (range < box.top - scroller.getBoundingClientRect().top - KEYBOARD_EPSILON) {
|
|
801
|
+
return false;
|
|
802
|
+
}
|
|
803
|
+
const height = getKeyboardHeight(win);
|
|
804
|
+
if (height <= KEYBOARD_EPSILON) {
|
|
805
|
+
return true;
|
|
806
|
+
}
|
|
807
|
+
const band = bandOf(scroller, height, offset, win);
|
|
808
|
+
return band.bottom - band.top >= box.height - KEYBOARD_EPSILON;
|
|
809
|
+
}
|
|
810
|
+
|
|
604
811
|
// The placement of `field` when it gains focus. A docked container rides.
|
|
605
|
-
// Page content
|
|
606
|
-
//
|
|
607
|
-
//
|
|
608
|
-
|
|
812
|
+
// Page content reveals the field through its nearest scroller. A fixed
|
|
813
|
+
// container the app positions reveals it through a scroller in it that can
|
|
814
|
+
// bring it up. Null keeps the browser's reveal: inside a keyboard target, on a
|
|
815
|
+
// page with nothing to scroll, or with no such scroller.
|
|
816
|
+
function placementOf(field, offset, win) {
|
|
609
817
|
if (isInsideKeyboardTarget(field)) {
|
|
610
818
|
return null;
|
|
611
819
|
}
|
|
612
820
|
const container = fixedContainerOf(field);
|
|
613
821
|
if (container === 'floating' || container === 'fills-viewport') {
|
|
614
|
-
return revealWithin(field, nearestFixedAncestor(field));
|
|
822
|
+
return revealWithin(field, nearestFixedAncestor(field), offset, win);
|
|
615
823
|
}
|
|
616
824
|
if (container == null) {
|
|
617
825
|
// A page with nothing to scroll keeps the browser's own reveal: a claim
|
|
618
|
-
// there would leave the field under the keyboard.
|
|
826
|
+
// there would leave the field under the keyboard in Safari.
|
|
619
827
|
const scroller = nearestScroller(field);
|
|
828
|
+
// In the page, the document reveals a field its scroll area cannot place.
|
|
620
829
|
return scroller.scrollHeight > scroller.clientHeight ? {
|
|
621
|
-
reveal: scroller
|
|
830
|
+
reveal: scroller,
|
|
831
|
+
unplaced: 'document'
|
|
622
832
|
} : null;
|
|
623
833
|
}
|
|
624
834
|
// A bar the app positions with its own `translate` does not ride: the ride
|
|
625
835
|
// would replace that translate.
|
|
626
836
|
const view = field.ownerDocument.defaultView;
|
|
627
|
-
return view != null && hasOwnTranslate(container.docked, view) ? revealWithin(field, container.docked) : {
|
|
837
|
+
return view != null && hasOwnTranslate(container.docked, view) ? revealWithin(field, container.docked, offset, win) : {
|
|
628
838
|
ride: container.docked
|
|
629
839
|
};
|
|
630
840
|
}
|
|
631
841
|
|
|
632
842
|
// A reveal by the scroller between `field` and the fixed `container` the app
|
|
633
|
-
// positions, or null when no scroller
|
|
634
|
-
function revealWithin(field, container) {
|
|
843
|
+
// positions, or null when no scroller there can bring the field up.
|
|
844
|
+
function revealWithin(field, container, offset, win) {
|
|
635
845
|
const scroller = container == null ? null : scrollingAncestor(field, container);
|
|
636
|
-
return scroller == null ? null : {
|
|
637
|
-
reveal: scroller
|
|
846
|
+
return scroller == null || !canBringUp(field, scroller, offset, win) ? null : {
|
|
847
|
+
reveal: scroller,
|
|
848
|
+
unplaced: 'fixed'
|
|
638
849
|
};
|
|
639
850
|
}
|
|
640
851
|
|
|
641
852
|
/**
|
|
642
|
-
*
|
|
643
|
-
* decides
|
|
644
|
-
*
|
|
645
|
-
*
|
|
646
|
-
* keyboard while one shows. A docked container taller than the room above the
|
|
647
|
-
* keyboard never rides its whole overlap. Its scroller there brings the field
|
|
648
|
-
* up instead, and with none it rides only as far as the field needs. A fixed
|
|
649
|
-
* container the app positions fills the viewport, floats above the bottom edge,
|
|
650
|
-
* or sets its own `translate`. In one, a scroller between the field and the
|
|
651
|
-
* container brings it up. A focus move or a tap into the field arrives without
|
|
652
|
-
* the browser's reveal there, so the page never pans for it. Inside a keyboard
|
|
653
|
-
* target, or in such a container with no scroller around the field, the path
|
|
654
|
-
* does nothing and the browser's own reveal stays.
|
|
853
|
+
* Keeps `field` above the on-screen keyboard until the returned call. On focus,
|
|
854
|
+
* `placementOf` decides who moves it. A claimed focus move or tap arrives
|
|
855
|
+
* without the browser's reveal. Where no placement fits, the browser's own
|
|
856
|
+
* reveal stays.
|
|
655
857
|
*
|
|
656
858
|
* @example
|
|
657
859
|
* ```
|
|
@@ -666,12 +868,13 @@ export function keepFieldAboveKeyboard(field, {
|
|
|
666
868
|
if (!followsKeyboard(win)) {
|
|
667
869
|
return () => {};
|
|
668
870
|
}
|
|
871
|
+
const stopScrollBack = claimKeyboardScrollBack(win);
|
|
669
872
|
const stopClaim = refuseFocusReveal(doc, {
|
|
670
|
-
claim: destination => destination === field && placementOf(field) != null ? field : null
|
|
873
|
+
claim: destination => destination === field && placementOf(field, offset, win) != null ? field : null
|
|
671
874
|
});
|
|
672
875
|
// A first tap moves focus from nothing, so no blur claims it.
|
|
673
876
|
const stopTaps = claimTapFocus(field, {
|
|
674
|
-
claim: () => doc.activeElement !== field && placementOf(field) != null ? field : null,
|
|
877
|
+
claim: () => doc.activeElement !== field && placementOf(field, offset, win) != null ? field : null,
|
|
675
878
|
deliver: deliverTap
|
|
676
879
|
});
|
|
677
880
|
let stopSession = null;
|
|
@@ -683,11 +886,12 @@ export function keepFieldAboveKeyboard(field, {
|
|
|
683
886
|
if (stopSession != null) {
|
|
684
887
|
return;
|
|
685
888
|
}
|
|
686
|
-
const placement = placementOf(field);
|
|
889
|
+
const placement = placementOf(field, offset, win);
|
|
687
890
|
if (placement == null) {
|
|
688
891
|
return;
|
|
689
892
|
}
|
|
690
|
-
|
|
893
|
+
stopKeyboardScrollBack(win);
|
|
894
|
+
stopSession = 'ride' in placement ? rideWithKeyboard(placement.ride, offset, win, false) : revealWithKeyboard(field, () => doc.activeElement === field ? field : null, placement.reveal, offset, win, placement.unplaced);
|
|
691
895
|
};
|
|
692
896
|
const onBlur = () => {
|
|
693
897
|
stopSession?.();
|
|
@@ -696,6 +900,11 @@ export function keepFieldAboveKeyboard(field, {
|
|
|
696
900
|
};
|
|
697
901
|
field.addEventListener('focus', onFocus);
|
|
698
902
|
field.addEventListener('blur', onBlur);
|
|
903
|
+
// A field that has focus before this path attaches, as with `hasAutoFocus`,
|
|
904
|
+
// gets no later focus event. Its session starts here.
|
|
905
|
+
if (doc.activeElement === field) {
|
|
906
|
+
onFocus();
|
|
907
|
+
}
|
|
699
908
|
return () => {
|
|
700
909
|
field.removeEventListener('focus', onFocus);
|
|
701
910
|
field.removeEventListener('blur', onBlur);
|
|
@@ -705,5 +914,253 @@ export function keepFieldAboveKeyboard(field, {
|
|
|
705
914
|
stoppedSession = null;
|
|
706
915
|
stopTaps();
|
|
707
916
|
stopClaim();
|
|
917
|
+
stopScrollBack();
|
|
708
918
|
};
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
// The scroll back: each scroll Core makes for the keyboard goes back when the
|
|
922
|
+
// keyboard goes.
|
|
923
|
+
|
|
924
|
+
// Every copy of Core shares these stores, so one scroll back runs per page.
|
|
925
|
+
const addedScrolls = sharedWeakMap('keyboard/keyboard-target/scroll-back-added-scrolls', 1);
|
|
926
|
+
const stopsOf = sharedWeakMap('keyboard/keyboard-target/scroll-back-stops', 1);
|
|
927
|
+
const foldWaitsOf = sharedWeakMap('keyboard/keyboard-target/scroll-back-fold-waits', 1);
|
|
928
|
+
const claimants = sharedWeakMap('keyboard/keyboard-target/scroll-back-claimants', 1);
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* Counts a field that keeps itself above `win`'s keyboard until the returned
|
|
932
|
+
* call. Once no such field is left, nothing is put back: its page is gone.
|
|
933
|
+
*/
|
|
934
|
+
function claimKeyboardScrollBack(win) {
|
|
935
|
+
claimants.set(win, (claimants.get(win) ?? 0) + 1);
|
|
936
|
+
let isClaimed = true;
|
|
937
|
+
return () => {
|
|
938
|
+
if (!isClaimed) {
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
isClaimed = false;
|
|
942
|
+
const left = (claimants.get(win) ?? 1) - 1;
|
|
943
|
+
claimants.set(win, left);
|
|
944
|
+
if (left === 0) {
|
|
945
|
+
stopsOf.get(win)?.();
|
|
946
|
+
foldWaitsOf.get(win)?.();
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
function isRoot(scroller) {
|
|
951
|
+
const doc = scroller.ownerDocument;
|
|
952
|
+
return scroller === (doc.scrollingElement ?? doc.documentElement);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/** How far `scroller` is scrolled; for the root, the document's scroll. */
|
|
956
|
+
function scrollTopOf(scroller, win) {
|
|
957
|
+
return isRoot(scroller) ? win.scrollY : scroller.scrollTop;
|
|
958
|
+
}
|
|
959
|
+
function scrollTopTo(scroller, top, behavior, win) {
|
|
960
|
+
if (isRoot(scroller)) {
|
|
961
|
+
win.scrollTo({
|
|
962
|
+
top,
|
|
963
|
+
behavior
|
|
964
|
+
});
|
|
965
|
+
} else if (typeof scroller.scrollTo === 'function') {
|
|
966
|
+
scroller.scrollTo({
|
|
967
|
+
top,
|
|
968
|
+
behavior
|
|
969
|
+
});
|
|
970
|
+
} else {
|
|
971
|
+
scroller.scrollTop = top;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Records that Core scrolled `scroller` from `before` to `after`, to keep a
|
|
977
|
+
* field above the keyboard. `after` is where a smooth scroll is headed, and
|
|
978
|
+
* where the scroller is now for any other. When the keyboard goes, the
|
|
979
|
+
* scroller goes back to where it was before Core's first scroll. A scroller
|
|
980
|
+
* anyone else scrolls meanwhile keeps that scroll.
|
|
981
|
+
*/
|
|
982
|
+
function noteKeyboardScroll(scroller, before, win, after = scrollTopOf(scroller, win)) {
|
|
983
|
+
const now = after;
|
|
984
|
+
const added = addedScrolls.get(win)?.get(scroller);
|
|
985
|
+
if (added == null) {
|
|
986
|
+
if (Math.abs(now - before) >= 0.5) {
|
|
987
|
+
const scrolls = addedScrolls.get(win) ?? watchKeyboardGo(win);
|
|
988
|
+
scrolls.set(scroller, {
|
|
989
|
+
from: before,
|
|
990
|
+
at: now,
|
|
991
|
+
isBack: false
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
} else if (added.at != null && Math.abs(before - added.at) <= KEYBOARD_EPSILON) {
|
|
995
|
+
added.at = now;
|
|
996
|
+
} else {
|
|
997
|
+
added.at = null;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Where Core's own scroll of `scroller` is headed, while the scroller lies on
|
|
1003
|
+
* its way there, as during a smooth rise. Null for a scroller Core did not
|
|
1004
|
+
* scroll, or one moved off that way.
|
|
1005
|
+
*/
|
|
1006
|
+
function keyboardScrollTarget(scroller, win) {
|
|
1007
|
+
const added = addedScrolls.get(win)?.get(scroller);
|
|
1008
|
+
if (added?.at == null) {
|
|
1009
|
+
return null;
|
|
1010
|
+
}
|
|
1011
|
+
const now = scrollTopOf(scroller, win);
|
|
1012
|
+
const low = Math.min(added.from, added.at) - KEYBOARD_EPSILON;
|
|
1013
|
+
const high = Math.max(added.from, added.at) + KEYBOARD_EPSILON;
|
|
1014
|
+
return now >= low && now <= high ? added.at : null;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// The scroll back starts at the keyboard's report that it has gone. Safari on
|
|
1018
|
+
// iOS sends that report about half a second after the blur that closes the
|
|
1019
|
+
// keyboard, once the keyboard is down. There the scroll back starts at that
|
|
1020
|
+
// blur, beside the keyboard's slide, and the report ends the watch.
|
|
1021
|
+
function watchKeyboardGo(win) {
|
|
1022
|
+
const scrolls = new Map();
|
|
1023
|
+
const stopReports = subscribeKeyboardHeight(win, event => {
|
|
1024
|
+
if (event.type === 'viewport' && event.height <= KEYBOARD_EPSILON) {
|
|
1025
|
+
end();
|
|
1026
|
+
scrollBack(win, scrolls);
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
let settle = null;
|
|
1030
|
+
const stopBlurs = isIosWebKit(win.document.defaultView) ? watchBlurs() : [];
|
|
1031
|
+
function watchBlurs() {
|
|
1032
|
+
return [
|
|
1033
|
+
// Heard so the stream counts the fingers on the screen.
|
|
1034
|
+
subscribeInput(win, 'touchstart', () => {}), subscribeInput(win, 'touchend', () => {}), subscribeInput(win, 'touchcancel', () => {}), subscribeInput(win, 'focusout', () => {
|
|
1035
|
+
if (settle != null) {
|
|
1036
|
+
win.clearTimeout(settle);
|
|
1037
|
+
}
|
|
1038
|
+
// Focus lands after the event. A field, or a frame or a shadow root
|
|
1039
|
+
// that may hold one, then keeps the keyboard up. A finger on the
|
|
1040
|
+
// screen can be a tap that brings it back, so the report decides.
|
|
1041
|
+
settle = win.setTimeout(() => {
|
|
1042
|
+
settle = null;
|
|
1043
|
+
const active = win.document.activeElement;
|
|
1044
|
+
if (getTouches(win).fingers === 0 && (active == null || !bringsUpKeyboard(active) && !hidesField(active))) {
|
|
1045
|
+
scrollBackAtBlur(win, scrolls);
|
|
1046
|
+
}
|
|
1047
|
+
}, 0);
|
|
1048
|
+
})];
|
|
1049
|
+
}
|
|
1050
|
+
function end() {
|
|
1051
|
+
stopReports();
|
|
1052
|
+
for (const stop of stopBlurs) {
|
|
1053
|
+
stop();
|
|
1054
|
+
}
|
|
1055
|
+
if (settle != null) {
|
|
1056
|
+
win.clearTimeout(settle);
|
|
1057
|
+
settle = null;
|
|
1058
|
+
}
|
|
1059
|
+
addedScrolls.delete(win);
|
|
1060
|
+
stopsOf.delete(win);
|
|
1061
|
+
}
|
|
1062
|
+
addedScrolls.set(win, scrolls);
|
|
1063
|
+
stopsOf.set(win, end);
|
|
1064
|
+
return scrolls;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
// Each scroller Core left where it put it heads back now, on the browser's
|
|
1068
|
+
// own smooth scroll. A focus that brings the keyboard back stops it first
|
|
1069
|
+
// (stopKeyboardScrollBack). Under Reduce Motion, the scroll waits for the
|
|
1070
|
+
// report and lands at once.
|
|
1071
|
+
function scrollBackAtBlur(win, scrolls) {
|
|
1072
|
+
for (const [scroller, added] of scrolls) {
|
|
1073
|
+
if (added.at == null || reducedMotionFade(scroller) != null || Math.abs(scrollTopOf(scroller, win) - added.at) > KEYBOARD_EPSILON) {
|
|
1074
|
+
continue;
|
|
1075
|
+
}
|
|
1076
|
+
added.at = added.from;
|
|
1077
|
+
added.isBack = true;
|
|
1078
|
+
scrollTopTo(scroller, added.from, 'smooth', win);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* Stops a scroll back that runs from the blur, where each scroller is now. A
|
|
1084
|
+
* field that gains focus during the keyboard's slide calls it before its
|
|
1085
|
+
* reveal, so the reveal goes on from there as Core's own scroll. The instant
|
|
1086
|
+
* scroll also ends a scroll back that a touch held, which Safari would run
|
|
1087
|
+
* after the field is placed.
|
|
1088
|
+
*/
|
|
1089
|
+
function stopKeyboardScrollBack(win) {
|
|
1090
|
+
for (const [scroller, added] of addedScrolls.get(win) ?? []) {
|
|
1091
|
+
if (!added.isBack) {
|
|
1092
|
+
continue;
|
|
1093
|
+
}
|
|
1094
|
+
const top = scrollTopOf(scroller, win);
|
|
1095
|
+
scrollTopTo(scroller, top, 'instant', win);
|
|
1096
|
+
added.at = top;
|
|
1097
|
+
added.isBack = false;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// The browser's own smooth scroll carries the scroll back. iOS Safari applies
|
|
1102
|
+
// a scripted scroll a frame late, so a scroll set each frame jitters there. A
|
|
1103
|
+
// touch stops that scroll, so a person's scroll stands. Under Reduce Motion, or
|
|
1104
|
+
// in a theme that reduces motion for everyone, the scroll lands at once.
|
|
1105
|
+
function scrollBack(win, scrolls) {
|
|
1106
|
+
for (const [scroller, {
|
|
1107
|
+
from,
|
|
1108
|
+
at,
|
|
1109
|
+
isBack
|
|
1110
|
+
}] of scrolls) {
|
|
1111
|
+
if (at == null || isBack || !scroller.isConnected) {
|
|
1112
|
+
continue;
|
|
1113
|
+
}
|
|
1114
|
+
const top = scrollTopOf(scroller, win);
|
|
1115
|
+
if (Math.abs(top - at) <= KEYBOARD_EPSILON) {
|
|
1116
|
+
scrollTopTo(scroller, from, scrollBackBehavior(scroller), win);
|
|
1117
|
+
} else if (isRoot(scroller) && Math.abs(top - from) <= KEYBOARD_EPSILON) {
|
|
1118
|
+
awaitFoldedReveal(win, scroller, from, at);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
scrolls.clear();
|
|
1122
|
+
}
|
|
1123
|
+
function scrollBackBehavior(scroller) {
|
|
1124
|
+
return reducedMotionFade(scroller) == null ? 'smooth' : 'instant';
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
// Firefox for Android can carry the reveal's document scroll as a visual-
|
|
1128
|
+
// viewport offset. It then shows the document where it was before the
|
|
1129
|
+
// reveal, and turns the offset back into a document scroll after the hide
|
|
1130
|
+
// report. The scroll back waits for that one document scroll.
|
|
1131
|
+
const FOLD_WAIT_MS = 1000;
|
|
1132
|
+
|
|
1133
|
+
// The first document scroll decides: one that lands where Core left the
|
|
1134
|
+
// document is the browser's own, and the scroll back follows it. A touch, a
|
|
1135
|
+
// keyboard that comes back, the field's page going, or the wait's end puts
|
|
1136
|
+
// nothing back.
|
|
1137
|
+
function awaitFoldedReveal(win, scroller, from, at) {
|
|
1138
|
+
const doc = win.document;
|
|
1139
|
+
const stopScroll = subscribeInput(win, 'scroll', event => {
|
|
1140
|
+
if (event.target !== doc && event.target !== win) {
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
stop();
|
|
1144
|
+
if (Math.abs(scrollTopOf(scroller, win) - at) <= KEYBOARD_EPSILON) {
|
|
1145
|
+
scrollTopTo(scroller, from, scrollBackBehavior(scroller), win);
|
|
1146
|
+
}
|
|
1147
|
+
});
|
|
1148
|
+
const stopTouch = subscribeInput(win, 'touchstart', () => stop());
|
|
1149
|
+
const stopKeyboard = subscribeKeyboardHeight(win, event => {
|
|
1150
|
+
if (event.type === 'viewport' && event.height > KEYBOARD_EPSILON) {
|
|
1151
|
+
stop();
|
|
1152
|
+
}
|
|
1153
|
+
});
|
|
1154
|
+
const timer = win.setTimeout(stop, FOLD_WAIT_MS);
|
|
1155
|
+
foldWaitsOf.get(win)?.();
|
|
1156
|
+
foldWaitsOf.set(win, stop);
|
|
1157
|
+
function stop() {
|
|
1158
|
+
win.clearTimeout(timer);
|
|
1159
|
+
stopScroll();
|
|
1160
|
+
stopTouch();
|
|
1161
|
+
stopKeyboard();
|
|
1162
|
+
if (foldWaitsOf.get(win) === stop) {
|
|
1163
|
+
foldWaitsOf.delete(win);
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
709
1166
|
}
|