@astryxdesign/core 0.7.5 → 0.7.6-canary.0ef60dd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +5 -5
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +12 -3
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +7 -1
- package/dist/BottomSheet/BottomSheet.js +1 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +2 -1
- package/dist/BottomSheet/useSheetGestures.d.ts +12 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +30 -3
- package/dist/Button/Button.js +4 -4
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +6 -5
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +37 -4
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +12 -4
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +101 -15
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +8 -3
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts +5 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +23 -12
- package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeTimeSegment.js +5 -4
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +4 -3
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +34 -9
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +5 -4
- package/dist/Divider/Divider.d.ts.map +1 -1
- package/dist/Divider/Divider.js +2 -1
- package/dist/Drawer/Drawer.d.ts +1 -0
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +7 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +7 -3
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +6 -5
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +20 -2
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +31 -3
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +21 -16
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +2 -1
- package/dist/Field/FieldLabel.d.ts +1 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +4 -4
- package/dist/Field/InputClearButton.js +3 -3
- package/dist/Field/PanelSearchInput.js +2 -2
- package/dist/FieldStatus/FieldStatus.js +2 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +7 -1
- package/dist/Heading/Heading.js +1 -1
- package/dist/Icon/Icon.js +1 -1
- package/dist/Indicator/CheckIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckIndicator.js +2 -1
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckboxIndicator.js +3 -1
- package/dist/Indicator/RadioIndicator.d.ts.map +1 -1
- package/dist/Indicator/RadioIndicator.js +3 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +2 -1
- package/dist/Item/ItemSwipeLayer.js +1 -1
- package/dist/Layer/popoverOperations.d.ts +27 -0
- package/dist/Layer/popoverOperations.d.ts.map +1 -0
- package/dist/Layer/popoverOperations.js +159 -0
- package/dist/Layer/useLayer.d.ts +1 -1
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +93 -59
- package/dist/Layout/Layout.js +1 -1
- package/dist/Layout/LayoutContent.js +1 -1
- package/dist/Layout/LayoutFooter.js +1 -1
- package/dist/Layout/LayoutHeader.js +1 -1
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +5 -0
- package/dist/Lightbox/LightboxViewport.a11y.browser.spec.js +5 -4
- package/dist/List/List.js +1 -1
- package/dist/List/ListItem.js +3 -3
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +7 -2
- package/dist/MultiSelector/CreateRow.a11y.chromium.spec.js +7 -6
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +26 -10
- package/dist/NumberInput/NumberInput.d.ts +3 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +3 -3
- package/dist/NumberInput/numberParser.d.ts +3 -0
- package/dist/NumberInput/numberParser.d.ts.map +1 -1
- package/dist/NumberInput/numberParser.js +7 -44
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +16 -12
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +28 -2
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +4 -1
- package/dist/Selector/useSelectorPresentation.d.ts +8 -1
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
- package/dist/Selector/useSelectorPresentation.js +20 -4
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +10 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +3 -3
- package/dist/Stack/Stack.js +1 -1
- package/dist/Stack/StackItem.js +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +16 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +9 -1
- package/dist/Text/Text.js +1 -1
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +23 -5
- package/dist/TextArea/TextArea.d.ts +1 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +13 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +3 -3
- package/dist/TimeInput/TimeInput.d.ts +6 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +21 -14
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +5 -4
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +2 -2
- package/dist/Timestamp/TimestampHoverCard.js +4 -4
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +60 -20
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +82 -51
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +13 -2
- package/dist/Tokenizer/TokenizerBottomSheet.js +3 -3
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +2 -1
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +3 -0
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +1 -0
- package/dist/Typeahead/Typeahead.d.ts +1 -1
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +9 -1
- package/dist/astryx.css +20 -4
- package/dist/gestures/GestureArena.d.ts +6 -0
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +39 -0
- package/dist/gestures/GestureHost.d.ts +352 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -0
- package/dist/gestures/GestureHost.js +1773 -0
- package/dist/gestures/GestureRecognizer.d.ts +10 -0
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +16 -0
- package/dist/gestures/LongPressGestureRecognizer.d.ts +1 -0
- package/dist/gestures/LongPressGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/LongPressGestureRecognizer.js +3 -0
- package/dist/gestures/PanGestureRecognizer.d.ts +1 -0
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +3 -0
- package/dist/gestures/PinchGestureRecognizer.d.ts +31 -0
- package/dist/gestures/PinchGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/PinchGestureRecognizer.js +128 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +71 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.js +223 -0
- package/dist/gestures/SwipeGestureRecognizer.d.ts +37 -0
- package/dist/gestures/SwipeGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/SwipeGestureRecognizer.js +148 -0
- package/dist/gestures/TapGestureRecognizer.d.ts +1 -0
- package/dist/gestures/TapGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/TapGestureRecognizer.js +3 -0
- package/dist/gestures/VelocityTracker.d.ts +6 -2
- package/dist/gestures/VelocityTracker.d.ts.map +1 -1
- package/dist/gestures/VelocityTracker.js +7 -3
- package/dist/gestures/haptics.d.ts +65 -0
- package/dist/gestures/haptics.d.ts.map +1 -0
- package/dist/gestures/haptics.js +182 -0
- package/dist/gestures/nativeScroll.d.ts +42 -0
- package/dist/gestures/nativeScroll.d.ts.map +1 -0
- package/dist/gestures/nativeScroll.js +228 -0
- package/dist/gestures/touchAction.d.ts +60 -0
- package/dist/gestures/touchAction.d.ts.map +1 -0
- package/dist/gestures/touchAction.js +157 -0
- package/dist/gestures/touchActionRule.d.ts +34 -0
- package/dist/gestures/touchActionRule.d.ts.map +1 -0
- package/dist/gestures/touchActionRule.js +140 -0
- package/dist/gestures/types.d.ts +18 -7
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/types.js +22 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/modalAnnounce.d.ts.map +1 -1
- package/dist/hooks/modalAnnounce.js +107 -61
- package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -1
- package/dist/hooks/useAdaptivePresentation.js +4 -1
- package/dist/hooks/useAnnounce.d.ts +101 -42
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +161 -75
- package/dist/hooks/useAnnounceRenderedText.d.ts +11 -3
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +5 -3
- package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
- package/dist/hooks/useBusyAnnouncement.js +6 -12
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +12 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +5 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +5 -0
- package/dist/motion/animator.d.ts +7 -1
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +119 -27
- package/dist/theme/defineTheme.d.ts +19 -5
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +64 -4
- package/dist/theme/domainTokens/domainTokenDefaults.d.ts +3 -0
- package/dist/theme/domainTokens/domainTokenDefaults.d.ts.map +1 -0
- package/dist/theme/domainTokens/domainTokenDefaults.js +19 -0
- package/dist/theme/domainTokens/index.d.ts +5 -4
- package/dist/theme/domainTokens/index.d.ts.map +1 -1
- package/dist/theme/domainTokens/index.js +5 -9
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/motionKnobs.d.ts +56 -0
- package/dist/theme/motionKnobs.d.ts.map +1 -0
- package/dist/theme/motionKnobs.js +48 -0
- package/dist/theme/resolveThemeValues.d.ts +11 -4
- package/dist/theme/resolveThemeValues.d.ts.map +1 -1
- package/dist/theme/resolveThemeValues.js +40 -4
- package/dist/theme/themeAdaptations.d.ts +7 -3
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +36 -7
- package/dist/theme/themeMotion.d.ts +96 -0
- package/dist/theme/themeMotion.d.ts.map +1 -0
- package/dist/theme/themeMotion.js +177 -0
- package/dist/theme/tokenReferences.d.ts +31 -0
- package/dist/theme/tokenReferences.d.ts.map +1 -0
- package/dist/theme/tokenReferences.js +132 -0
- package/dist/theme/tokens.d.ts +1 -0
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +9 -129
- package/dist/theme/tokens.stylex.d.ts +12 -0
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +12 -0
- package/dist/utils/focusReturn.d.ts +17 -1
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +11 -4
- package/dist/utils/getNodeText.d.ts +8 -0
- package/dist/utils/getNodeText.d.ts.map +1 -0
- package/dist/utils/getNodeText.js +37 -0
- package/dist/utils/interactionModality.d.ts +11 -2
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +58 -5
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +17 -8
- package/dist/utils/plainDate.d.ts +2 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +46 -3
- package/dist/utils/presentation.d.ts +50 -0
- package/dist/utils/presentation.d.ts.map +1 -0
- package/dist/utils/presentation.js +125 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +20 -1
- package/dist/utils/primaryClick.d.ts +11 -0
- package/dist/utils/primaryClick.d.ts.map +1 -0
- package/dist/utils/primaryClick.js +25 -0
- package/dist/utils/timeFormat.d.ts +47 -0
- package/dist/utils/timeFormat.d.ts.map +1 -0
- package/dist/utils/timeFormat.js +240 -0
- package/dist/utils/touchPresentation.d.ts.map +1 -1
- package/dist/utils/touchPresentation.js +5 -3
- package/dist/utils/touchPresentation.stylex.d.ts +15 -0
- package/dist/utils/touchPresentation.stylex.d.ts.map +1 -0
- package/dist/utils/touchPresentation.stylex.js +33 -0
- package/dist/utils/unicodeDigits.d.ts +20 -0
- package/dist/utils/unicodeDigits.d.ts.map +1 -0
- package/dist/utils/unicodeDigits.js +70 -0
- package/locales/en.json +23 -3
- package/locales/pseudo.json +15 -0
- package/package.json +5 -4
- package/src/AlertDialog/AlertDialog.tsx +6 -5
- package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +18 -6
- package/src/Avatar/Avatar.spec.md +22 -22
- package/src/Avatar/Avatar.tsx +18 -1
- package/src/Avatar/__tests__/AvatarForcedColors.a11y.chromium.spec.ts +126 -0
- package/src/Badge/Badge.doc.mjs +1 -1
- package/src/Badge/Badge.tsx +19 -2
- package/src/Badge/__tests__/BadgeLargerText.a11y.chromium.spec.ts +260 -0
- package/src/BottomSheet/BottomSheet.test.tsx +46 -0
- package/src/BottomSheet/BottomSheet.tsx +1 -1
- package/src/BottomSheet/BottomSheetPanel.tsx +2 -1
- package/src/BottomSheet/useSheetGestures.test.ts +52 -0
- package/src/BottomSheet/useSheetGestures.ts +37 -6
- package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts +18 -6
- package/src/Button/Button.tsx +4 -4
- package/src/Calendar/Calendar.spec.md +87 -48
- package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +21 -7
- package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +21 -7
- package/src/CheckboxInput/CheckboxInput.tsx +6 -5
- package/src/ClickableCard/ClickableCard.test.tsx +96 -0
- package/src/ClickableCard/ClickableCard.tsx +48 -4
- package/src/Collapsible/Collapsible.spec.md +2 -0
- package/src/Collapsible/CollapsibleGroup.spec.md +57 -29
- package/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts +18 -7
- package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +18 -6
- package/src/ComplexSelector/ComplexSelector.test.tsx +37 -0
- package/src/ContextMenu/ContextMenu.test.tsx +35 -0
- package/src/DateInput/DateInput.test.tsx +115 -3
- package/src/DateInput/DateInput.tsx +29 -14
- package/src/DateInput/DateInputTouch.test.tsx +76 -0
- package/src/DateInput/MonthScroller.tsx +106 -20
- package/src/DateInput/MonthScrollerSettle.test.tsx +165 -0
- package/src/DateInput/TouchDateField.tsx +14 -3
- package/src/DateInput/__tests__/MonthScrollerSteps.interaction.browser.spec.ts +312 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +46 -3
- package/src/DateRangeInput/DateRangeInput.tsx +16 -12
- package/src/DateTimeInput/DateTimeInput.doc.mjs +10 -8
- package/src/DateTimeInput/DateTimeInput.spec.md +75 -51
- package/src/DateTimeInput/DateTimeInput.test.tsx +81 -0
- package/src/DateTimeInput/DateTimeInput.tsx +46 -24
- package/src/DateTimeInput/NativeTimeSegment.tsx +4 -6
- package/src/DateTimeInput/TouchDateTimeField.tsx +3 -7
- package/src/Dialog/Dialog.test.tsx +216 -2
- package/src/Dialog/Dialog.tsx +42 -9
- package/src/Dialog/DialogHeader.tsx +5 -4
- package/src/Dialog/__tests__/DialogSecondDocument.a11y.browser.spec.ts +202 -0
- package/src/Divider/Divider.tsx +2 -1
- package/src/Drawer/Drawer.spec.md +111 -80
- package/src/Drawer/Drawer.test.tsx +35 -0
- package/src/Drawer/Drawer.tsx +13 -2
- package/src/Drawer/DrawerHeader.spec.md +181 -0
- package/src/Drawer/__tests__/DrawerNonModalPageScroll.a11y.chromium.spec.ts +267 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +41 -0
- package/src/DropdownMenu/DropdownMenu.tsx +10 -3
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +34 -0
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +6 -5
- package/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts +19 -7
- package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +21 -9
- package/src/DropdownMenu/lazyMenuBottomSheet.test.ts +60 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +36 -7
- package/src/DropdownMenu/renderDropdownItems.tsx +24 -19
- package/src/EmptyState/EmptyState.tsx +2 -1
- package/src/Field/FieldLabel.tsx +5 -4
- package/src/Field/InputClearButton.tsx +3 -3
- package/src/Field/PanelSearchInput.tsx +2 -2
- package/src/FieldStatus/FieldStatus.tsx +2 -2
- package/src/FileInput/FileInput.test.tsx +21 -0
- package/src/FileInput/FileInput.tsx +4 -1
- package/src/FormLayout/FormLayout.spec.md +7 -8
- package/src/Heading/Heading.tsx +1 -1
- package/src/Icon/Icon.tsx +1 -1
- package/src/Indicator/CheckIndicator.spec.md +47 -42
- package/src/Indicator/CheckIndicator.tsx +2 -1
- package/src/Indicator/CheckboxIndicator.spec.md +40 -37
- package/src/Indicator/CheckboxIndicator.tsx +3 -1
- package/src/Indicator/Indicator.spec.md +188 -0
- package/src/Indicator/RadioIndicator.tsx +3 -1
- package/src/Item/Item.tsx +2 -1
- package/src/Item/ItemSwipeLayer.tsx +1 -1
- package/src/Kbd/Kbd.spec.md +81 -38
- package/src/Layer/__tests__/LayerBrowserHide.a11y.chromium.spec.ts +126 -0
- package/src/Layer/popoverOperations.test.ts +205 -0
- package/src/Layer/popoverOperations.ts +172 -0
- package/src/Layer/useLayer.test.tsx +348 -1
- package/src/Layer/useLayer.tsx +118 -71
- package/src/Layout/Layout.spec.md +127 -131
- package/src/Layout/Layout.tsx +1 -1
- package/src/Layout/LayoutContent.spec.md +205 -0
- package/src/Layout/LayoutContent.tsx +1 -1
- package/src/Layout/LayoutFooter.spec.md +190 -0
- package/src/Layout/LayoutFooter.tsx +1 -1
- package/src/Layout/LayoutHeader.spec.md +193 -0
- package/src/Layout/LayoutHeader.tsx +1 -1
- package/src/Layout/LayoutPanel.spec.md +194 -0
- package/src/Layout/__tests__/Layout.a11y.chromium.spec.ts +18 -6
- package/src/Lightbox/Lightbox.test.tsx +18 -0
- package/src/Lightbox/Lightbox.tsx +5 -0
- package/src/Lightbox/LightboxViewport.a11y.browser.spec.ts +8 -4
- package/src/Link/__tests__/Link.a11y.chromium.spec.ts +18 -8
- package/src/List/List.tsx +1 -1
- package/src/List/ListItem.spec.md +205 -0
- package/src/List/ListItem.tsx +3 -3
- package/src/MetadataList/MetadataList.spec.md +187 -0
- package/src/MetadataList/MetadataListItem.spec.md +165 -0
- package/src/MobileNav/MobileNav.test.tsx +15 -0
- package/src/MobileNav/MobileNav.tsx +9 -1
- package/src/MobileNav/__tests__/MobileNavHeader.a11y.chromium.spec.ts +89 -0
- package/src/MoreMenu/MoreMenu.test.tsx +11 -0
- package/src/MultiSelector/CreateRow.a11y.chromium.spec.ts +7 -8
- package/src/MultiSelector/MultiSelector.spec.md +7 -4
- package/src/MultiSelector/MultiSelector.test.tsx +270 -1
- package/src/MultiSelector/MultiSelector.tsx +25 -10
- package/src/MultiSelector/__tests__/MultiSelector.listbox.a11y.test.tsx +8 -1
- package/src/NavMenu/NavHeadingMenu.spec.md +1 -5
- package/src/NumberInput/NumberInput.doc.mjs +13 -7
- package/src/NumberInput/NumberInput.spec.md +59 -37
- package/src/NumberInput/NumberInput.tsx +13 -3
- package/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts +102 -0
- package/src/NumberInput/numberParser.ts +7 -45
- package/src/ProgressBar/ProgressBar.test.tsx +108 -32
- package/src/ProgressBar/ProgressBar.tsx +58 -10
- package/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts +21 -9
- package/src/ProgressBar/__tests__/ProgressBarMotion.a11y.chromium.spec.ts +831 -0
- package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +21 -14
- package/src/Resizable/useResizable.test.ts +43 -0
- package/src/Resizable/useResizable.ts +32 -9
- package/src/SegmentedControl/SegmentedControl.test.tsx +84 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +11 -5
- package/src/Selector/Selector.test.tsx +90 -1
- package/src/Selector/__tests__/Selector.combobox.a11y.test.tsx +8 -1
- package/src/Selector/__tests__/Selector.listbox.a11y.test.tsx +8 -1
- package/src/Selector/useSelectorPresentation.ts +31 -3
- package/src/SideNav/SideNav.test.tsx +27 -0
- package/src/SideNav/__tests__/SideNavRailMotion.interaction.browser.spec.ts +176 -51
- package/src/Skeleton/Skeleton.tsx +3 -1
- package/src/Slider/Slider.test.tsx +31 -0
- package/src/Slider/Slider.tsx +8 -3
- package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +19 -7
- package/src/Spinner/Spinner.tsx +5 -3
- package/src/Stack/Stack.tsx +1 -1
- package/src/Stack/StackItem.tsx +1 -1
- package/src/TabList/TabList.test.tsx +58 -4
- package/src/TabList/TabList.tsx +16 -1
- package/src/TabList/__tests__/TabPressPointer.interaction.browser.spec.ts +163 -0
- package/src/Table/__tests__/Table.a11y.chromium.spec.ts +18 -6
- package/src/Table/plugins/columnResize/useTableColumnResize.test.tsx +22 -0
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +8 -4
- package/src/Text/Text.tsx +1 -1
- package/src/Text/useTruncation.test.tsx +128 -1
- package/src/Text/useTruncation.ts +23 -5
- package/src/TextArea/TextArea.spec.md +10 -13
- package/src/TextArea/TextArea.test.tsx +60 -0
- package/src/TextArea/TextArea.tsx +15 -1
- package/src/TextInput/TextInput.test.tsx +21 -0
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/TimeInput/NativeTimeInput.test.tsx +17 -0
- package/src/TimeInput/Presentation.test.tsx +21 -0
- package/src/TimeInput/TimeInput.doc.mjs +8 -8
- package/src/TimeInput/TimeInput.spec.md +45 -48
- package/src/TimeInput/TimeInput.test.tsx +76 -0
- package/src/TimeInput/TimeInput.tsx +36 -18
- package/src/TimeInput/TouchTimeField.tsx +4 -6
- package/src/Timestamp/Timestamp.spec.md +6 -12
- package/src/Timestamp/Timestamp.test.tsx +30 -5
- package/src/Timestamp/Timestamp.tsx +6 -2
- package/src/Timestamp/TimestampHoverCard.tsx +4 -4
- package/src/Toast/Toast.spec.md +14 -20
- package/src/Toast/Toast.tsx +104 -36
- package/src/Toast/ToastViewport.test.tsx +719 -1
- package/src/Toast/ToastViewport.tsx +100 -50
- package/src/Tokenizer/Tokenizer.spec.md +5 -3
- package/src/Tokenizer/Tokenizer.test.tsx +68 -0
- package/src/Tokenizer/Tokenizer.tsx +14 -2
- package/src/Tokenizer/TokenizerBottomSheet.test.tsx +15 -4
- package/src/Tokenizer/TokenizerBottomSheet.tsx +3 -3
- package/src/Toolbar/Toolbar.spec.md +5 -6
- package/src/Toolbar/Toolbar.test.tsx +30 -0
- package/src/Toolbar/Toolbar.tsx +2 -1
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +18 -6
- package/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts +18 -7
- package/src/TopNav/TopNav.test.tsx +27 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +21 -0
- package/src/TopNav/TopNavMegaMenu.tsx +4 -1
- package/src/TopNav/TopNavMenu.test.tsx +17 -0
- package/src/TopNav/TopNavMenu.tsx +1 -0
- package/src/Typeahead/Typeahead.test.tsx +40 -0
- package/src/Typeahead/Typeahead.tsx +12 -1
- package/src/__tests__/pressState.ts +8 -4
- package/src/gestures/GestureArena.ts +35 -0
- package/src/gestures/GestureHost.ts +2065 -0
- package/src/gestures/GestureRecognizer.ts +18 -0
- package/src/gestures/LongPressGestureRecognizer.ts +4 -0
- package/src/gestures/PanGestureRecognizer.ts +4 -0
- package/src/gestures/PinchGestureRecognizer.ts +148 -0
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +256 -0
- package/src/gestures/SwipeGestureRecognizer.ts +197 -0
- package/src/gestures/TapGestureRecognizer.ts +4 -0
- package/src/gestures/VelocityTracker.ts +10 -3
- package/src/gestures/__tests__/GestureHost.test.ts +2087 -0
- package/src/gestures/__tests__/PanGestureRecognizer.test.ts +4 -4
- package/src/gestures/__tests__/PinchGestureRecognizer.test.ts +74 -0
- package/src/gestures/__tests__/ScreenEdgePanGestureRecognizer.test.ts +498 -0
- package/src/gestures/__tests__/SwipeGestureRecognizer.test.ts +108 -0
- package/src/gestures/__tests__/arena.test.ts +5 -0
- package/src/gestures/__tests__/arenaPinchSwipeEdge.test.ts +193 -0
- package/src/gestures/__tests__/browser/build-fixture.mjs +46 -0
- package/src/gestures/__tests__/browser/fixture.ts +307 -0
- package/src/gestures/__tests__/browser/gestures.interaction.browser.spec.ts +1137 -0
- package/src/gestures/__tests__/browserNegotiation.test.ts +293 -0
- package/src/gestures/__tests__/haptics.test.ts +187 -0
- package/src/gestures/__tests__/harness.ts +21 -2
- package/src/gestures/__tests__/recognizerKind.test.ts +78 -0
- package/src/gestures/__tests__/touchActionRule.test.ts +54 -0
- package/src/gestures/haptics.ts +203 -0
- package/src/gestures/nativeScroll.ts +277 -0
- package/src/gestures/touchAction.ts +191 -0
- package/src/gestures/touchActionRule.ts +157 -0
- package/src/gestures/types.ts +30 -9
- package/src/hooks/index.ts +5 -1
- package/src/hooks/modalAnnounce.ts +129 -72
- package/src/hooks/useAdaptivePresentation.ts +4 -1
- package/src/hooks/useAnnounce.doc.mjs +35 -3
- package/src/hooks/useAnnounce.replace.test.tsx +516 -0
- package/src/hooks/useAnnounce.ts +209 -102
- package/src/hooks/useAnnounceRenderedText.adopters.test.tsx +10 -1
- package/src/hooks/useAnnounceRenderedText.ts +17 -3
- package/src/hooks/useBusyAnnouncement.ts +7 -10
- package/src/hooks/useMenuHover.ts +15 -1
- package/src/i18n/generated-locales/en.generated.ts +6 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +6 -0
- package/src/motion/README.md +11 -1
- package/src/motion/animator.test.ts +151 -3
- package/src/motion/animator.ts +149 -33
- package/src/theme/Theme.doc.mjs +1 -1
- package/src/theme/defineTheme.ts +117 -8
- package/src/theme/derivedVarRegistry.test.ts +4 -0
- package/src/theme/domainTokens/domainTokenDefaults.ts +19 -0
- package/src/theme/domainTokens/index.ts +6 -10
- package/src/theme/expandMotionScale.test.ts +1 -1
- package/src/theme/index.ts +5 -0
- package/src/theme/motionKnobs.ts +82 -0
- package/src/theme/resolveThemeValues.ts +68 -6
- package/src/theme/themeAdaptations.ts +52 -12
- package/src/theme/themeMotion.test.ts +620 -0
- package/src/theme/themeMotion.ts +221 -0
- package/src/theme/tokenReferences.ts +149 -0
- package/src/theme/tokens.stylex.ts +10 -0
- package/src/theme/tokens.ts +15 -158
- package/src/utils/focusReturn.ts +17 -6
- package/src/utils/getNodeText.test.ts +24 -0
- package/src/utils/getNodeText.ts +37 -0
- package/src/utils/interactionModality.test.ts +45 -1
- package/src/utils/interactionModality.ts +64 -5
- package/src/utils/interactionOverlay.stylex.ts +12 -3
- package/src/utils/plainDate.test.ts +90 -0
- package/src/utils/plainDate.ts +58 -3
- package/src/utils/presentation.test.ts +380 -0
- package/src/utils/presentation.ts +180 -0
- package/src/utils/pressFeedback.test.ts +138 -0
- package/src/utils/pressFeedback.ts +34 -11
- package/src/utils/pressPaintPriority.test.ts +80 -0
- package/src/utils/primaryClick.test.ts +38 -0
- package/src/utils/primaryClick.ts +28 -0
- package/src/utils/timeFormat.test.ts +204 -0
- package/src/utils/timeFormat.ts +314 -0
- package/src/utils/touchPresentation.stylex.ts +43 -0
- package/src/utils/touchPresentation.test.ts +140 -1
- package/src/utils/touchPresentation.ts +5 -3
- package/src/utils/unicodeDigits.test.ts +44 -0
- package/src/utils/unicodeDigits.ts +71 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/gestures/types.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,MAAM,YAAY,GACtB,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEtE,qEAAqE;AACrE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAEpD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,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C;IAClE,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG;QACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,GAAG,IAAI,CAAC;CACV;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAoBjC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACtC,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACtC,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACtC,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1C;;;;OAIG;IACH,wBAAwB,CAAC,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC;IACxD;;;;;OAKG;IACH,SAAS,CAAC,IAAI,OAAO,CAAC;CACvB"}
|
package/dist/gestures/types.js
CHANGED
|
@@ -54,8 +54,28 @@ export const DEFAULT_ENVIRONMENT = {
|
|
|
54
54
|
height: window.innerHeight
|
|
55
55
|
};
|
|
56
56
|
},
|
|
57
|
-
isRtl() {
|
|
58
|
-
|
|
57
|
+
isRtl(view) {
|
|
58
|
+
if (typeof window === 'undefined' || !(view instanceof Element)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return window.getComputedStyle(view).direction === 'rtl';
|
|
62
|
+
},
|
|
63
|
+
viewRect(view) {
|
|
64
|
+
if (typeof Element === 'undefined' || !(view instanceof Element)) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const {
|
|
68
|
+
left,
|
|
69
|
+
top,
|
|
70
|
+
width,
|
|
71
|
+
height
|
|
72
|
+
} = view.getBoundingClientRect();
|
|
73
|
+
return {
|
|
74
|
+
left,
|
|
75
|
+
top,
|
|
76
|
+
width,
|
|
77
|
+
height
|
|
78
|
+
};
|
|
59
79
|
}
|
|
60
80
|
};
|
|
61
81
|
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export { hasActiveFocusTrapEscape, useFocusTrap } from './useFocusTrap.js';
|
|
10
10
|
export type { UseFocusTrapOptions, UseFocusTrapReturn } from './useFocusTrap.js';
|
|
11
11
|
export { useAnnounce } from './useAnnounce.js';
|
|
12
|
-
export type { AnnounceFn, AnnouncePoliteness } from './useAnnounce.js';
|
|
12
|
+
export type { AnnounceFn, AnnouncePoliteness, UseAnnounceOptions, } from './useAnnounce.js';
|
|
13
13
|
export { useClipboard } from './useClipboard.js';
|
|
14
14
|
export type { UseClipboardOptions, UseClipboardReturn } from './useClipboard.js';
|
|
15
15
|
export { useGridFocus } from './useGridFocus.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,wBAAwB,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACtE,YAAY,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,wBAAwB,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACtE,YAAY,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAA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O,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,YAAY,EAAC,wBAAwB,EAAC,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,YAAY,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modalAnnounce.d.ts","sourceRoot":"","sources":["../../src/hooks/modalAnnounce.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"modalAnnounce.d.ts","sourceRoot":"","sources":["../../src/hooks/modalAnnounce.ts"],"names":[],"mappings":"AA6CA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAM5D;AAyBD,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAQ7D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAK/D;AA0JD,wBAAgB,cAAc,IAAI,IAAI,CAIrC;AA4BD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAQhE"}
|
|
@@ -14,13 +14,17 @@
|
|
|
14
14
|
* handed to the channel exposed then, or held while an exiting modal still
|
|
15
15
|
* covers everything, and released at its real close; a covered modal is
|
|
16
16
|
* not written to; a caller inside a modal being presented in this commit
|
|
17
|
-
* waits one frame for the route.
|
|
17
|
+
* waits one frame for the route. Words move with their announcers'
|
|
18
|
+
* receipts, one delivery per announcer, so an announcer can take back its
|
|
19
|
+
* own share while it waits wherever it went: a `hasReplace` instance's
|
|
20
|
+
* next message (FR9), a busy start overtaken by its outcome (FR8). Loaded
|
|
21
|
+
* only by ModalAnnounceProvider, so
|
|
18
22
|
* a component that calls useAnnounce and renders no modal does not carry
|
|
19
23
|
* it.
|
|
20
24
|
*
|
|
21
25
|
* SYNC: not exported from /packages/core/src/hooks/index.ts.
|
|
22
26
|
*/
|
|
23
|
-
import { announceMessage, clearModalRegion, clearRegion, installModalRoute, isOpenModal, modalRegion,
|
|
27
|
+
import { announceMessage, clearModalRegion, clearRegion, forwardWaiting, handleOf, installModalRoute, isOpenModal, modalRegion, unexposedWords, writeModalRegion } from "./useAnnounce.js";
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
30
|
* Whether what is written inside `dialog` reaches assistive technology: open
|
|
@@ -130,8 +134,15 @@ function isAnyModalOpen() {
|
|
|
130
134
|
// the accessibility tree for its exit but is still an open native modal, or
|
|
131
135
|
// such a dialog covers the channel they would go to, so nothing is exposed
|
|
132
136
|
// yet. They are delivered when a dialog closes (or theirs is exposed again).
|
|
137
|
+
// Each text keeps its announcers' receipts, so one taking its share back
|
|
138
|
+
// leaves it for the others, and a receipt follows the words when they are
|
|
139
|
+
// released; an entry is gone once delivered, so a receipt never reaches
|
|
140
|
+
// equal words held later.
|
|
141
|
+
|
|
133
142
|
const held = new Map();
|
|
134
|
-
|
|
143
|
+
|
|
144
|
+
/** Hold `message` for `dialog`, for the announcer `receipt` stands for. */
|
|
145
|
+
function hold(dialog, message, politeness, receipt) {
|
|
135
146
|
let slot = held.get(dialog);
|
|
136
147
|
if (slot == null) {
|
|
137
148
|
slot = {
|
|
@@ -140,8 +151,32 @@ function hold(dialog, message, politeness) {
|
|
|
140
151
|
};
|
|
141
152
|
held.set(dialog, slot);
|
|
142
153
|
}
|
|
143
|
-
|
|
144
|
-
|
|
154
|
+
let words = slot[politeness].find(entry => entry.text === message);
|
|
155
|
+
if (words == null) {
|
|
156
|
+
words = {
|
|
157
|
+
text: message,
|
|
158
|
+
receipts: []
|
|
159
|
+
};
|
|
160
|
+
slot[politeness].push(words);
|
|
161
|
+
}
|
|
162
|
+
words.receipts.push(receipt);
|
|
163
|
+
const entry = words;
|
|
164
|
+
receipt.withdraw = () => dropHeldShare(dialog, politeness, entry, receipt);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** One announcer takes back its share of `words`, while they are held. */
|
|
168
|
+
function dropHeldShare(dialog, politeness, words, receipt) {
|
|
169
|
+
const slot = held.get(dialog);
|
|
170
|
+
const at = words.receipts.indexOf(receipt);
|
|
171
|
+
if (slot == null || !slot[politeness].includes(words) || at < 0) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
words.receipts.splice(at, 1);
|
|
175
|
+
if (words.receipts.length === 0) {
|
|
176
|
+
slot[politeness] = slot[politeness].filter(entry => entry !== words);
|
|
177
|
+
if (slot.polite.length === 0 && slot.assertive.length === 0) {
|
|
178
|
+
held.delete(dialog);
|
|
179
|
+
}
|
|
145
180
|
}
|
|
146
181
|
}
|
|
147
182
|
|
|
@@ -165,15 +200,10 @@ function releaseHeld(dialog) {
|
|
|
165
200
|
}
|
|
166
201
|
held.delete(dialog);
|
|
167
202
|
for (const politeness of ['polite', 'assertive']) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
} else {
|
|
173
|
-
// Holds again if still nothing is exposed.
|
|
174
|
-
deliverBeyond(dialog, message, politeness);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
203
|
+
// One delivery per announcer, so each receipt follows its words.
|
|
204
|
+
forwardWaiting(slot[politeness], text => isExposed(dialog) ? announceInModalRouted(dialog, text, politeness) :
|
|
205
|
+
// Holds again if still nothing is exposed.
|
|
206
|
+
deliverBeyond(dialog, text, politeness));
|
|
177
207
|
}
|
|
178
208
|
}
|
|
179
209
|
export function releaseAllHeld() {
|
|
@@ -194,14 +224,16 @@ function deliverBeyond(dialog, message, politeness) {
|
|
|
194
224
|
// An exiting modal — this one, or one above the next candidate — is
|
|
195
225
|
// still open and covers what is beneath it: nothing is exposed until
|
|
196
226
|
// it closes.
|
|
197
|
-
|
|
198
|
-
|
|
227
|
+
const receipt = {
|
|
228
|
+
withdraw: null
|
|
229
|
+
};
|
|
230
|
+
hold(dialog, message, politeness, receipt);
|
|
231
|
+
return handleOf(receipt);
|
|
199
232
|
}
|
|
200
233
|
if (next != null) {
|
|
201
|
-
announceInModalRouted(next, message, politeness);
|
|
202
|
-
return;
|
|
234
|
+
return announceInModalRouted(next, message, politeness);
|
|
203
235
|
}
|
|
204
|
-
announceMessage(message, politeness);
|
|
236
|
+
return announceMessage(message, politeness);
|
|
205
237
|
}
|
|
206
238
|
|
|
207
239
|
/**
|
|
@@ -212,10 +244,9 @@ function deliverBeyond(dialog, message, politeness) {
|
|
|
212
244
|
*/
|
|
213
245
|
export function handOffUnexposed(dialog) {
|
|
214
246
|
for (const politeness of ['polite', 'assertive']) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
247
|
+
// One delivery per announcer, so each receipt follows its words and a
|
|
248
|
+
// `hasReplace` instance's next message can still take its own back.
|
|
249
|
+
forwardWaiting(takeUnexposed(dialog, politeness), text => deliverBeyond(dialog, text, politeness));
|
|
219
250
|
}
|
|
220
251
|
}
|
|
221
252
|
|
|
@@ -231,20 +262,22 @@ function withdrawFromModal(dialog, politeness) {
|
|
|
231
262
|
dropHeld(dialog, politeness);
|
|
232
263
|
}
|
|
233
264
|
|
|
234
|
-
/**
|
|
265
|
+
/**
|
|
266
|
+
* Take the unexposed words out of a dialog's region, with their receipts,
|
|
267
|
+
* clearing it.
|
|
268
|
+
*/
|
|
235
269
|
function takeUnexposed(dialog, politeness) {
|
|
236
270
|
const region = modalRegion(dialog, politeness);
|
|
237
271
|
if (region == null) {
|
|
238
272
|
return [];
|
|
239
273
|
}
|
|
240
|
-
const waiting =
|
|
274
|
+
const waiting = unexposedWords(region);
|
|
241
275
|
clearModalRegion(dialog, politeness);
|
|
242
276
|
return waiting;
|
|
243
277
|
}
|
|
244
278
|
function announceInModalRouted(dialog, message, politeness = 'polite') {
|
|
245
279
|
if (!isExposed(dialog)) {
|
|
246
|
-
deliverBeyond(dialog, message, politeness);
|
|
247
|
-
return;
|
|
280
|
+
return deliverBeyond(dialog, message, politeness);
|
|
248
281
|
}
|
|
249
282
|
const top = topExposedModal();
|
|
250
283
|
if (top != null && top !== dialog && presented.includes(dialog)) {
|
|
@@ -252,27 +285,19 @@ function announceInModalRouted(dialog, message, politeness = 'polite') {
|
|
|
252
285
|
// one closes, and a message announced meanwhile is not heard — the
|
|
253
286
|
// container is clear before this modal is on top again.
|
|
254
287
|
clearModalRegion(dialog, politeness);
|
|
255
|
-
return;
|
|
288
|
+
return null;
|
|
256
289
|
}
|
|
257
|
-
writeModalRegion(dialog, message, politeness, {
|
|
290
|
+
return writeModalRegion(dialog, message, politeness, {
|
|
258
291
|
isExposed: () => isExposed(dialog),
|
|
259
|
-
redirect:
|
|
292
|
+
redirect: waiting => forwardWaiting(waiting, text => deliverBeyond(dialog, text, politeness))
|
|
260
293
|
});
|
|
261
294
|
}
|
|
262
|
-
function withdrawFromModalPendingRouted(dialog, message, politeness) {
|
|
263
|
-
withdrawFromModalRegion(dialog, message, politeness);
|
|
264
|
-
const slot = held.get(dialog);
|
|
265
|
-
if (slot != null) {
|
|
266
|
-
slot[politeness] = slot[politeness].filter(text => text !== message);
|
|
267
|
-
if (slot.polite.length === 0 && slot.assertive.length === 0) {
|
|
268
|
-
held.delete(dialog);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
295
|
|
|
273
296
|
// Messages from callers whose enclosing modal is being presented in this
|
|
274
297
|
// commit, waiting one frame for the route; an empty message among them
|
|
275
298
|
// withdraws the earlier ones of its urgency, as it would on a channel.
|
|
299
|
+
// Each message keeps a receipt per announcer: before the frame, taking it
|
|
300
|
+
// back drops that announcer's share; the frame points it at its write.
|
|
276
301
|
|
|
277
302
|
const deferredByScope = new WeakMap();
|
|
278
303
|
function deferUntilPresented(scope, message, politeness) {
|
|
@@ -290,16 +315,11 @@ function deferUntilPresented(scope, message, politeness) {
|
|
|
290
315
|
clearRegion(urgency);
|
|
291
316
|
}
|
|
292
317
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
announceInModalRouted(opened, text, urgency);
|
|
296
|
-
} else {
|
|
297
|
-
announceMessage(text, urgency);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
318
|
+
// One write per announcer, so each can take back its own share.
|
|
319
|
+
forwardWaiting(created.words[urgency], text => opened != null ? announceInModalRouted(opened, text, urgency) : announceMessage(text, urgency));
|
|
300
320
|
}
|
|
301
321
|
}),
|
|
302
|
-
|
|
322
|
+
words: {
|
|
303
323
|
polite: [],
|
|
304
324
|
assertive: []
|
|
305
325
|
},
|
|
@@ -311,14 +331,43 @@ function deferUntilPresented(scope, message, politeness) {
|
|
|
311
331
|
deferred = created;
|
|
312
332
|
deferredByScope.set(scope, deferred);
|
|
313
333
|
}
|
|
334
|
+
const waiting = deferred;
|
|
314
335
|
if (!message) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
336
|
+
// Taken back: the receipts of what waited have nothing left to take.
|
|
337
|
+
for (const words of waiting.words[politeness]) {
|
|
338
|
+
for (const receipt of words.receipts) {
|
|
339
|
+
receipt.withdraw = null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
waiting.words[politeness] = [];
|
|
343
|
+
waiting.clears[politeness] = true;
|
|
344
|
+
return null;
|
|
318
345
|
}
|
|
319
|
-
|
|
320
|
-
|
|
346
|
+
let words = waiting.words[politeness].find(entry => entry.text === message);
|
|
347
|
+
if (words == null) {
|
|
348
|
+
words = {
|
|
349
|
+
text: message,
|
|
350
|
+
receipts: []
|
|
351
|
+
};
|
|
352
|
+
waiting.words[politeness].push(words);
|
|
321
353
|
}
|
|
354
|
+
const entry = words;
|
|
355
|
+
const receipt = {
|
|
356
|
+
withdraw: null
|
|
357
|
+
};
|
|
358
|
+
receipt.withdraw = () => {
|
|
359
|
+
// Before the frame: drop this announcer's share of the waiting words.
|
|
360
|
+
const at = entry.receipts.indexOf(receipt);
|
|
361
|
+
if (at < 0) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
entry.receipts.splice(at, 1);
|
|
365
|
+
if (entry.receipts.length === 0) {
|
|
366
|
+
waiting.words[politeness] = waiting.words[politeness].filter(other => other !== entry);
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
entry.receipts.push(receipt);
|
|
370
|
+
return handleOf(receipt);
|
|
322
371
|
}
|
|
323
372
|
|
|
324
373
|
/**
|
|
@@ -355,8 +404,7 @@ function announceFromScope(scope, message, politeness) {
|
|
|
355
404
|
// (FR9). A caller inside a modal that is meant to be closed (its content
|
|
356
405
|
// stays mounted) is not waiting for anything: it takes the route of
|
|
357
406
|
// where it is now, joined with the frame's other messages.
|
|
358
|
-
deferUntilPresented(scope, message, politeness);
|
|
359
|
-
return;
|
|
407
|
+
return deferUntilPresented(scope, message, politeness);
|
|
360
408
|
}
|
|
361
409
|
const dialog = enclosingOpenModal(scope);
|
|
362
410
|
if (!message) {
|
|
@@ -367,16 +415,14 @@ function announceFromScope(scope, message, politeness) {
|
|
|
367
415
|
} else {
|
|
368
416
|
clearRegion(politeness);
|
|
369
417
|
}
|
|
370
|
-
return;
|
|
418
|
+
return null;
|
|
371
419
|
}
|
|
372
420
|
if (dialog != null) {
|
|
373
|
-
announceInModalRouted(dialog, message, politeness);
|
|
374
|
-
return;
|
|
421
|
+
return announceInModalRouted(dialog, message, politeness);
|
|
375
422
|
}
|
|
376
|
-
announceMessage(message, politeness);
|
|
423
|
+
return announceMessage(message, politeness);
|
|
377
424
|
}
|
|
378
425
|
installModalRoute({
|
|
379
426
|
announce: announceFromScope,
|
|
380
|
-
announceInModal: announceInModalRouted
|
|
381
|
-
withdrawFromModalPending: withdrawFromModalPendingRouted
|
|
427
|
+
announceInModal: announceInModalRouted
|
|
382
428
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAdaptivePresentation.d.ts","sourceRoot":"","sources":["../../src/hooks/useAdaptivePresentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAdaptivePresentation.d.ts","sourceRoot":"","sources":["../../src/hooks/useAdaptivePresentation.ts"],"names":[],"mappings":"AAqBA,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,cAAc,GAAG,UAAU,CAAC;AAC3E,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAChD,oBAAoB,EACpB,UAAU,CACX,CAAC;AAMF,eAAO,MAAM,gCAAgC,QAAsB,CAAC;AAKpE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,GACjC,4BAA4B,CA4B9B"}
|
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
* @input Uses React's external-store subscription over window.matchMedia
|
|
8
8
|
* and the touch presentation's compact-touch query
|
|
9
9
|
* @output Resolves popover/bottom-sheet presentation policy
|
|
10
|
-
* @position Internal overlay policy shared across component families
|
|
10
|
+
* @position Internal overlay policy shared across component families. A
|
|
11
|
+
* component that also switches input modes under a finger resolves its
|
|
12
|
+
* `presentation` with usePresentation (utils/presentation.ts), whose
|
|
13
|
+
* surface is this one's
|
|
11
14
|
*/
|
|
12
15
|
import { useCallback, useSyncExternalStore } from 'react';
|
|
13
16
|
import { COMPACT_TOUCH_QUERY, useCompactDefinition } from "../utils/touchPresentation.js";
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* @input Uses React context and useCallback; DOM APIs and cancellable
|
|
4
4
|
* animation frames for a singleton live-region pair on the page body and
|
|
5
5
|
* one persistent polite/assertive pair inside each open Astryx modal
|
|
6
|
-
* @output Exports useAnnounce hook
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* @output Exports useAnnounce hook (with its `hasReplace` option),
|
|
7
|
+
* AnnouncePoliteness and UseAnnounceOptions types; the internal modal
|
|
8
|
+
* context, the in-dialog region writer the busy-announcement hook uses, and
|
|
9
|
+
* the hook the modal route (`modalAnnounce.ts`, loaded only with an Astryx
|
|
10
|
+
* modal) installs itself through
|
|
10
11
|
* @position Core a11y hook; provides imperative screen-reader announcements.
|
|
11
12
|
* A message follows the nearest open native modal enclosing its caller
|
|
12
13
|
* (`spec:AST-086` FR14): inside an Astryx modal it is written to that
|
|
@@ -14,10 +15,14 @@
|
|
|
14
15
|
* while a native modal is open; otherwise to the shared page-body pair.
|
|
15
16
|
* Containers are created empty (FR3), carry the two urgencies (FR5), join
|
|
16
17
|
* messages written before the previous is exposed and say an identical
|
|
17
|
-
* same-frame repeat once (FR9),
|
|
18
|
+
* same-frame repeat once (FR9), except that a `hasReplace` instance's
|
|
19
|
+
* message withdraws that instance's previous one not yet exposed, and clear
|
|
20
|
+
* shortly after each announcement;
|
|
18
21
|
* the route in `modalAnnounce.ts` hands a message still unexposed when its
|
|
19
22
|
* modal stops being exposed to the channel exposed after it — the modal
|
|
20
|
-
* then on top, or the page body once no modal is open.
|
|
23
|
+
* then on top, or the page body once no modal is open. Each write keeps a
|
|
24
|
+
* receipt per announcer beside the words, which follows them wherever
|
|
25
|
+
* they are moved, so the announcer can take back its own share.
|
|
21
26
|
*
|
|
22
27
|
* SYNC: When modified, update:
|
|
23
28
|
* - /packages/core/src/hooks/index.ts
|
|
@@ -35,7 +40,57 @@ export type AnnouncePoliteness = 'polite' | 'assertive';
|
|
|
35
40
|
* Imperative screen-reader announcement function.
|
|
36
41
|
*/
|
|
37
42
|
export type AnnounceFn = (message: string, politeness?: AnnouncePoliteness) => void;
|
|
38
|
-
|
|
43
|
+
/** Options for `useAnnounce`. */
|
|
44
|
+
export interface UseAnnounceOptions {
|
|
45
|
+
/**
|
|
46
|
+
* The instance states one current state of its owner, such as a search's
|
|
47
|
+
* result count: each message it writes withdraws the instance's previous
|
|
48
|
+
* message while that one is not yet exposed, whatever their urgencies, and
|
|
49
|
+
* is spoken in the region of its own urgency; a message already exposed has
|
|
50
|
+
* been heard and stays. Messages from other instances, and from instances
|
|
51
|
+
* without `hasReplace`, still join (`spec:AST-086` FR9). Give each state a
|
|
52
|
+
* component reports its own instance.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
hasReplace?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Takes back one announcer's share of a message while it is not yet exposed,
|
|
59
|
+
* wherever the route put it. @internal
|
|
60
|
+
*/
|
|
61
|
+
export type WithdrawAnnouncement = () => void;
|
|
62
|
+
/**
|
|
63
|
+
* One announcer's share of words on their way to being exposed. Whatever
|
|
64
|
+
* holds the words keeps the receipt beside them; when the words move — a
|
|
65
|
+
* modal hands them to the channel exposed after it, or releases words it
|
|
66
|
+
* held through an exit — the mover points the receipt at the new place, so
|
|
67
|
+
* the announcer's handle follows its words. @internal
|
|
68
|
+
*/
|
|
69
|
+
export interface AnnounceReceipt {
|
|
70
|
+
withdraw: WithdrawAnnouncement | null;
|
|
71
|
+
}
|
|
72
|
+
/** Words waiting to be exposed, with their announcers' receipts. @internal */
|
|
73
|
+
export interface WaitingWords {
|
|
74
|
+
readonly text: string;
|
|
75
|
+
readonly receipts: ReadonlyArray<AnnounceReceipt>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The announcer's handle to `receipt`: it takes back the words wherever they
|
|
79
|
+
* are now, once. @internal
|
|
80
|
+
*/
|
|
81
|
+
export declare function handleOf(receipt: AnnounceReceipt): WithdrawAnnouncement;
|
|
82
|
+
/**
|
|
83
|
+
* Move `waiting` words elsewhere, one delivery per announcer and in order,
|
|
84
|
+
* and point each receipt at its delivery, so every announcer can still take
|
|
85
|
+
* back its own share (`spec:AST-086` FR9, FR14). The deliveries join where
|
|
86
|
+
* they land, so the words are spoken once. @internal
|
|
87
|
+
*/
|
|
88
|
+
export declare function forwardWaiting(waiting: ReadonlyArray<WaitingWords>, deliver: (text: string) => WithdrawAnnouncement | null): void;
|
|
89
|
+
/**
|
|
90
|
+
* Write `message` to the shared region for `politeness`, joining the messages
|
|
91
|
+
* not yet exposed. Returns how to take this write back while it waits.
|
|
92
|
+
*/
|
|
93
|
+
export declare function announceMessage(message: string, politeness: AnnouncePoliteness): WithdrawAnnouncement | null;
|
|
39
94
|
/**
|
|
40
95
|
* Clear any pending announcement from a region without announcing anything new.
|
|
41
96
|
* Used when the triggering context goes away (e.g. a search query is cleared),
|
|
@@ -54,6 +109,12 @@ export declare function clearRegion(politeness: AnnouncePoliteness): void;
|
|
|
54
109
|
* announced, so users browsing the DOM later do not encounter stale status
|
|
55
110
|
* text; announcing again before the clear simply resets the countdown.
|
|
56
111
|
*
|
|
112
|
+
* An instance created with `hasReplace` states one current state, such as a
|
|
113
|
+
* search's result count: each message it writes withdraws its previous one
|
|
114
|
+
* while that one is not yet exposed, so typing faster than a frame says only
|
|
115
|
+
* the latest count (`spec:AST-086` FR9).
|
|
116
|
+
*
|
|
117
|
+
* @param options - `hasReplace` (default false)
|
|
57
118
|
* @example
|
|
58
119
|
* ```
|
|
59
120
|
* function Search() {
|
|
@@ -65,7 +126,7 @@ export declare function clearRegion(politeness: AnnouncePoliteness): void;
|
|
|
65
126
|
* }
|
|
66
127
|
* ```
|
|
67
128
|
*/
|
|
68
|
-
export declare function useAnnounce(): AnnounceFn;
|
|
129
|
+
export declare function useAnnounce({ hasReplace, }?: UseAnnounceOptions): AnnounceFn;
|
|
69
130
|
/**
|
|
70
131
|
* What an Astryx modal tells the hooks beneath it: where its dialog element
|
|
71
132
|
* is, and the modal above it, so a caller inside a non-modal sheet nested in
|
|
@@ -79,12 +140,17 @@ export interface ModalAnnounceScope {
|
|
|
79
140
|
export declare const ModalAnnounceContext: import("react").Context<ModalAnnounceScope | null>;
|
|
80
141
|
/** The modal route `modalAnnounce.ts` installs when a provider loads it. */
|
|
81
142
|
export interface ModalRoute {
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
143
|
+
/**
|
|
144
|
+
* `useAnnounce` from inside `scope`: route `message` by where it is, and
|
|
145
|
+
* return how to take this write back while it waits (a `hasReplace`
|
|
146
|
+
* instance's next message does).
|
|
147
|
+
*/
|
|
148
|
+
announce(scope: ModalAnnounceScope, message: string, politeness: AnnouncePoliteness): WithdrawAnnouncement | null;
|
|
149
|
+
/**
|
|
150
|
+
* Speak inside `dialog` with the exposure, covered and hold rules, and
|
|
151
|
+
* return how to take this write back while it waits.
|
|
152
|
+
*/
|
|
153
|
+
announceInModal(dialog: HTMLDialogElement, message: string, politeness: AnnouncePoliteness): WithdrawAnnouncement | null;
|
|
88
154
|
}
|
|
89
155
|
/** Called once by `modalAnnounce.ts` as it loads. @internal */
|
|
90
156
|
export declare function installModalRoute(route: ModalRoute): void;
|
|
@@ -103,45 +169,38 @@ export declare function enclosingModalDialog(element: Element | null | undefined
|
|
|
103
169
|
* exposure, covered and hold rules; without it — a native modal an app
|
|
104
170
|
* renders without Astryx, and no Astryx modal anywhere — the words are
|
|
105
171
|
* written to the dialog while it is open as a modal, else to the shared
|
|
106
|
-
* channel.
|
|
172
|
+
* channel. Returns how to take the words back while they wait, wherever they
|
|
173
|
+
* move, so a busy start overtaken by its own outcome is never heard ahead of
|
|
174
|
+
* it inside a modal (`spec:AST-086` FR8). Internal: used by the
|
|
175
|
+
* busy-announcement hook.
|
|
107
176
|
*/
|
|
108
|
-
export declare function announceInModal(dialog: HTMLDialogElement, message: string, politeness?: AnnouncePoliteness):
|
|
109
|
-
/**
|
|
110
|
-
* Withdraw one announcer's share of `message` from `dialog` before it is
|
|
111
|
-
* exposed, written to its region or held by the route for the dialog's
|
|
112
|
-
* close, so a busy start overtaken by its own outcome is never heard ahead
|
|
113
|
-
* of it inside a modal (`spec:AST-086` FR8). Internal: used by the
|
|
114
|
-
* busy-announcement hook's settle function.
|
|
115
|
-
*/
|
|
116
|
-
export declare function withdrawFromModalPending(dialog: HTMLDialogElement, message: string, politeness?: AnnouncePoliteness): void;
|
|
177
|
+
export declare function announceInModal(dialog: HTMLDialogElement, message: string, politeness?: AnnouncePoliteness): WithdrawAnnouncement | null;
|
|
117
178
|
/** What the route asks of the writer in the write frame. @internal */
|
|
118
179
|
export interface ModalWriteGuard {
|
|
119
180
|
isExposed: () => boolean;
|
|
120
|
-
|
|
181
|
+
/** Deliver the waiting words elsewhere, forwarding their receipts. */
|
|
182
|
+
redirect: (waiting: ReadonlyArray<WaitingWords>) => void;
|
|
121
183
|
}
|
|
122
184
|
/** Words written to `target` that assistive technology has not had yet. */
|
|
123
185
|
export declare function unexposedMessages(target: HTMLElement): string[];
|
|
186
|
+
/**
|
|
187
|
+
* The words written to `target` that assistive technology has not had yet,
|
|
188
|
+
* with their announcers' receipts, for a hand-off that forwards them.
|
|
189
|
+
*/
|
|
190
|
+
export declare function unexposedWords(target: HTMLElement): WaitingWords[];
|
|
124
191
|
export declare function modalRegion(dialog: HTMLDialogElement, politeness: AnnouncePoliteness): HTMLElement | null;
|
|
125
192
|
/**
|
|
126
193
|
* Write `message` to the modal `dialog`'s own live region for `politeness`,
|
|
127
194
|
* joining it to messages written there that are not yet exposed and saying
|
|
128
|
-
* an identical repeat once
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
* Withdraw one announcer's share of `message` from `dialog`'s region before
|
|
138
|
-
* it is exposed — written but not yet spoken — so a busy start overtaken by
|
|
139
|
-
* its own outcome is never heard ahead of it (`spec:AST-086` FR8). The
|
|
140
|
-
* message stays while another announcer holds it. The region half of
|
|
141
|
-
* `withdrawFromModalPending`; the route also drops words it holds for the
|
|
142
|
-
* dialog's close.
|
|
143
|
-
*/
|
|
144
|
-
export declare function withdrawFromModalRegion(dialog: HTMLDialogElement, message: string, politeness?: AnnouncePoliteness): void;
|
|
195
|
+
* an identical repeat once. The region-writing core, shared by the full
|
|
196
|
+
* modal route and by the busy-announcement hook's fallback for a native
|
|
197
|
+
* modal an app renders without Astryx. `guard`, supplied by the route,
|
|
198
|
+
* re-checks exposure in the write frame and redirects the waiting words when
|
|
199
|
+
* the dialog stopped being exposed meanwhile. Returns this announcer's
|
|
200
|
+
* handle: it takes back only its own share, only while the words wait, and
|
|
201
|
+
* follows them when the route moves them.
|
|
202
|
+
*/
|
|
203
|
+
export declare function writeModalRegion(dialog: HTMLDialogElement, message: string, politeness: AnnouncePoliteness, guard?: ModalWriteGuard): WithdrawAnnouncement;
|
|
145
204
|
/**
|
|
146
205
|
* Withdraw whatever the dialog's region for `politeness` holds or is about to
|
|
147
206
|
* hold, as an empty message does on the shared channel. A dialog that never
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnnounce.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnnounce.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"useAnnounce.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnnounce.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAA0C,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CACvB,O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