stream-chat-react-native-core 9.1.3-beta.2 → 9.2.0-beta.1
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/lib/commonjs/a11y/a11yUtils.js +40 -0
- package/lib/commonjs/a11y/a11yUtils.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useA11yLabel.js +15 -0
- package/lib/commonjs/a11y/hooks/useA11yLabel.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useAnnounceOnStateChange.js +36 -0
- package/lib/commonjs/a11y/hooks/useAnnounceOnStateChange.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useReducedMotionPreference.js +34 -0
- package/lib/commonjs/a11y/hooks/useReducedMotionPreference.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useResolvedModalAccessibilityProps.js +20 -0
- package/lib/commonjs/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -0
- package/lib/commonjs/a11y/hooks/useScreenReaderEnabled.js +37 -0
- package/lib/commonjs/a11y/hooks/useScreenReaderEnabled.js.map +1 -0
- package/lib/commonjs/a11y/index.js +70 -0
- package/lib/commonjs/a11y/index.js.map +1 -0
- package/lib/commonjs/components/AITypingIndicatorView/AITypingIndicatorView.js +10 -0
- package/lib/commonjs/components/AITypingIndicatorView/AITypingIndicatorView.js.map +1 -1
- package/lib/commonjs/components/Accessibility/NotificationAnnouncer.js +37 -0
- package/lib/commonjs/components/Accessibility/NotificationAnnouncer.js.map +1 -0
- package/lib/commonjs/components/Accessibility/hooks/useIncomingMessageAnnouncements.js +109 -0
- package/lib/commonjs/components/Accessibility/hooks/useIncomingMessageAnnouncements.js.map +1 -0
- package/lib/commonjs/components/Accessibility/index.js +37 -0
- package/lib/commonjs/components/Accessibility/index.js.map +1 -0
- package/lib/commonjs/components/Accessibility/useAccessibilityAnnouncer.js +15 -0
- package/lib/commonjs/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -0
- package/lib/commonjs/components/Channel/Channel.js +2 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js +4 -0
- package/lib/commonjs/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingDots.js +2 -0
- package/lib/commonjs/components/Indicators/LoadingDots.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +3 -0
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +2 -0
- package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +13 -6
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +5 -0
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageActionList.js +4 -1
- package/lib/commonjs/components/MessageMenu/MessageActionList.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageActionListItem.js +1 -0
- package/lib/commonjs/components/MessageMenu/MessageActionListItem.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js +1 -0
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/ReactionButton.js +6 -1
- package/lib/commonjs/components/MessageMenu/ReactionButton.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollOption.js +15 -0
- package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
- package/lib/commonjs/components/ProgressControl/ProgressControl.js +10 -0
- package/lib/commonjs/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +2 -0
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js +6 -3
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/Avatar.js +14 -2
- package/lib/commonjs/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/ChannelAvatar.js +3 -1
- package/lib/commonjs/components/ui/Avatar/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/UserAvatar.js +1 -0
- package/lib/commonjs/components/ui/Avatar/UserAvatar.js.map +1 -1
- package/lib/commonjs/components/ui/Button/Button.js +49 -19
- package/lib/commonjs/components/ui/Button/Button.js.map +1 -1
- package/lib/commonjs/components/ui/Input/Input.js +63 -21
- package/lib/commonjs/components/ui/Input/Input.js.map +1 -1
- package/lib/commonjs/contexts/accessibilityContext/AccessibilityContext.js +114 -0
- package/lib/commonjs/contexts/accessibilityContext/AccessibilityContext.js.map +1 -0
- package/lib/commonjs/contexts/accessibilityContext/index.js +15 -0
- package/lib/commonjs/contexts/accessibilityContext/index.js.map +1 -0
- package/lib/commonjs/contexts/index.js +11 -0
- package/lib/commonjs/contexts/index.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +19 -14
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/hooks/index.js +11 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/i18n/en.json +23 -1
- package/lib/commonjs/i18n/es.json +23 -1
- package/lib/commonjs/i18n/fr.json +23 -1
- package/lib/commonjs/i18n/he.json +23 -1
- package/lib/commonjs/i18n/hi.json +23 -1
- package/lib/commonjs/i18n/it.json +23 -1
- package/lib/commonjs/i18n/ja.json +23 -1
- package/lib/commonjs/i18n/ko.json +23 -1
- package/lib/commonjs/i18n/nl.json +23 -1
- package/lib/commonjs/i18n/pt-br.json +23 -1
- package/lib/commonjs/i18n/ru.json +23 -1
- package/lib/commonjs/i18n/tr.json +23 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/a11y/a11yUtils.js +40 -0
- package/lib/module/a11y/a11yUtils.js.map +1 -0
- package/lib/module/a11y/hooks/useA11yLabel.js +15 -0
- package/lib/module/a11y/hooks/useA11yLabel.js.map +1 -0
- package/lib/module/a11y/hooks/useAnnounceOnStateChange.js +36 -0
- package/lib/module/a11y/hooks/useAnnounceOnStateChange.js.map +1 -0
- package/lib/module/a11y/hooks/useReducedMotionPreference.js +34 -0
- package/lib/module/a11y/hooks/useReducedMotionPreference.js.map +1 -0
- package/lib/module/a11y/hooks/useResolvedModalAccessibilityProps.js +20 -0
- package/lib/module/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -0
- package/lib/module/a11y/hooks/useScreenReaderEnabled.js +37 -0
- package/lib/module/a11y/hooks/useScreenReaderEnabled.js.map +1 -0
- package/lib/module/a11y/index.js +70 -0
- package/lib/module/a11y/index.js.map +1 -0
- package/lib/module/components/AITypingIndicatorView/AITypingIndicatorView.js +10 -0
- package/lib/module/components/AITypingIndicatorView/AITypingIndicatorView.js.map +1 -1
- package/lib/module/components/Accessibility/NotificationAnnouncer.js +37 -0
- package/lib/module/components/Accessibility/NotificationAnnouncer.js.map +1 -0
- package/lib/module/components/Accessibility/hooks/useIncomingMessageAnnouncements.js +109 -0
- package/lib/module/components/Accessibility/hooks/useIncomingMessageAnnouncements.js.map +1 -0
- package/lib/module/components/Accessibility/index.js +37 -0
- package/lib/module/components/Accessibility/index.js.map +1 -0
- package/lib/module/components/Accessibility/useAccessibilityAnnouncer.js +15 -0
- package/lib/module/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -0
- package/lib/module/components/Channel/Channel.js +2 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js +4 -0
- package/lib/module/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.js.map +1 -1
- package/lib/module/components/Indicators/LoadingDots.js +2 -0
- package/lib/module/components/Indicators/LoadingDots.js.map +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +3 -0
- package/lib/module/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +2 -0
- package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +13 -6
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +5 -0
- package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageActionList.js +4 -1
- package/lib/module/components/MessageMenu/MessageActionList.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageActionListItem.js +1 -0
- package/lib/module/components/MessageMenu/MessageActionListItem.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageReactionPicker.js +1 -0
- package/lib/module/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/module/components/MessageMenu/ReactionButton.js +6 -1
- package/lib/module/components/MessageMenu/ReactionButton.js.map +1 -1
- package/lib/module/components/Poll/components/PollOption.js +15 -0
- package/lib/module/components/Poll/components/PollOption.js.map +1 -1
- package/lib/module/components/ProgressControl/ProgressControl.js +10 -0
- package/lib/module/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +2 -0
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/UIComponents/BottomSheetModal.js +6 -3
- package/lib/module/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/module/components/index.js +11 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/ui/Avatar/Avatar.js +14 -2
- package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/ui/Avatar/ChannelAvatar.js +3 -1
- package/lib/module/components/ui/Avatar/ChannelAvatar.js.map +1 -1
- package/lib/module/components/ui/Avatar/UserAvatar.js +1 -0
- package/lib/module/components/ui/Avatar/UserAvatar.js.map +1 -1
- package/lib/module/components/ui/Button/Button.js +49 -19
- package/lib/module/components/ui/Button/Button.js.map +1 -1
- package/lib/module/components/ui/Input/Input.js +63 -21
- package/lib/module/components/ui/Input/Input.js.map +1 -1
- package/lib/module/contexts/accessibilityContext/AccessibilityContext.js +114 -0
- package/lib/module/contexts/accessibilityContext/AccessibilityContext.js.map +1 -0
- package/lib/module/contexts/accessibilityContext/index.js +15 -0
- package/lib/module/contexts/accessibilityContext/index.js.map +1 -0
- package/lib/module/contexts/index.js +11 -0
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +19 -14
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/hooks/index.js +11 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/i18n/en.json +23 -1
- package/lib/module/i18n/es.json +23 -1
- package/lib/module/i18n/fr.json +23 -1
- package/lib/module/i18n/he.json +23 -1
- package/lib/module/i18n/hi.json +23 -1
- package/lib/module/i18n/it.json +23 -1
- package/lib/module/i18n/ja.json +23 -1
- package/lib/module/i18n/ko.json +23 -1
- package/lib/module/i18n/nl.json +23 -1
- package/lib/module/i18n/pt-br.json +23 -1
- package/lib/module/i18n/ru.json +23 -1
- package/lib/module/i18n/tr.json +23 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/a11y/a11yUtils.d.ts +31 -0
- package/lib/typescript/a11y/a11yUtils.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useA11yLabel.d.ts +12 -0
- package/lib/typescript/a11y/hooks/useA11yLabel.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useAnnounceOnStateChange.d.ts +14 -0
- package/lib/typescript/a11y/hooks/useAnnounceOnStateChange.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useReducedMotionPreference.d.ts +6 -0
- package/lib/typescript/a11y/hooks/useReducedMotionPreference.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts +18 -0
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts.map +1 -0
- package/lib/typescript/a11y/hooks/useScreenReaderEnabled.d.ts +10 -0
- package/lib/typescript/a11y/hooks/useScreenReaderEnabled.d.ts.map +1 -0
- package/lib/typescript/a11y/index.d.ts +7 -0
- package/lib/typescript/a11y/index.d.ts.map +1 -0
- package/lib/typescript/components/AITypingIndicatorView/AITypingIndicatorView.d.ts.map +1 -1
- package/lib/typescript/components/Accessibility/NotificationAnnouncer.d.ts +12 -0
- package/lib/typescript/components/Accessibility/NotificationAnnouncer.d.ts.map +1 -0
- package/lib/typescript/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts +20 -0
- package/lib/typescript/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts.map +1 -0
- package/lib/typescript/components/Accessibility/index.d.ts +4 -0
- package/lib/typescript/components/Accessibility/index.d.ts.map +1 -0
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts +15 -0
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts.map +1 -0
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.d.ts.map +1 -1
- package/lib/typescript/components/Indicators/LoadingDots.d.ts.map +1 -1
- package/lib/typescript/components/Indicators/LoadingErrorIndicator.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/ScrollToBottomButton.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageActionList.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageActionListItem.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageReactionPicker.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/ReactionButton.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
- package/lib/typescript/components/ProgressControl/ProgressControl.d.ts.map +1 -1
- package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
- package/lib/typescript/components/UIComponents/BottomSheetModal.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/ui/Avatar/Avatar.d.ts +12 -1
- package/lib/typescript/components/ui/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/ui/Avatar/ChannelAvatar.d.ts.map +1 -1
- package/lib/typescript/components/ui/Avatar/UserAvatar.d.ts.map +1 -1
- package/lib/typescript/components/ui/Button/Button.d.ts.map +1 -1
- package/lib/typescript/components/ui/Input/Input.d.ts.map +1 -1
- package/lib/typescript/contexts/accessibilityContext/AccessibilityContext.d.ts +34 -0
- package/lib/typescript/contexts/accessibilityContext/AccessibilityContext.d.ts.map +1 -0
- package/lib/typescript/contexts/accessibilityContext/index.d.ts +2 -0
- package/lib/typescript/contexts/accessibilityContext/index.d.ts.map +1 -0
- package/lib/typescript/contexts/index.d.ts +1 -0
- package/lib/typescript/contexts/index.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +7 -0
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts.map +1 -1
- package/lib/typescript/hooks/index.d.ts +1 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -1
- package/lib/typescript/hooks/useTranslatedMessage.d.ts +2 -2
- package/lib/typescript/i18n/en.json +23 -1
- package/lib/typescript/i18n/es.json +23 -1
- package/lib/typescript/i18n/fr.json +23 -1
- package/lib/typescript/i18n/he.json +23 -1
- package/lib/typescript/i18n/hi.json +23 -1
- package/lib/typescript/i18n/it.json +23 -1
- package/lib/typescript/i18n/ja.json +23 -1
- package/lib/typescript/i18n/ko.json +23 -1
- package/lib/typescript/i18n/nl.json +23 -1
- package/lib/typescript/i18n/pt-br.json +23 -1
- package/lib/typescript/i18n/ru.json +23 -1
- package/lib/typescript/i18n/tr.json +23 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +22 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/a11y/__tests__/a11yUtils.test.ts +70 -0
- package/src/a11y/a11yUtils.ts +50 -0
- package/src/a11y/hooks/useA11yLabel.ts +19 -0
- package/src/a11y/hooks/useAnnounceOnStateChange.ts +47 -0
- package/src/a11y/hooks/useReducedMotionPreference.ts +38 -0
- package/src/a11y/hooks/useResolvedModalAccessibilityProps.ts +30 -0
- package/src/a11y/hooks/useScreenReaderEnabled.ts +44 -0
- package/src/a11y/index.ts +6 -0
- package/src/components/AITypingIndicatorView/AITypingIndicatorView.tsx +17 -2
- package/src/components/AITypingIndicatorView/__tests__/AITypingIndicatorView.test.tsx +73 -0
- package/src/components/Accessibility/NotificationAnnouncer.tsx +43 -0
- package/src/components/Accessibility/__tests__/AccessibilityAnnouncer.test.tsx +75 -0
- package/src/components/Accessibility/hooks/useIncomingMessageAnnouncements.ts +157 -0
- package/src/components/Accessibility/index.ts +3 -0
- package/src/components/Accessibility/useAccessibilityAnnouncer.ts +30 -0
- package/src/components/Channel/Channel.tsx +3 -0
- package/src/components/ChannelPreview/ChannelMessagePreviewDeliveryStatus.tsx +14 -1
- package/src/components/Indicators/LoadingDots.tsx +5 -1
- package/src/components/Indicators/LoadingErrorIndicator.tsx +7 -1
- package/src/components/Indicators/LoadingIndicator.tsx +1 -1
- package/src/components/Message/MessageItemView/__tests__/__snapshots__/MessageAuthor.test.tsx.snap +2 -0
- package/src/components/MessageInput/__tests__/__snapshots__/AttachButton.test.tsx.snap +30 -15
- package/src/components/MessageInput/__tests__/__snapshots__/SendButton.test.tsx.snap +20 -10
- package/src/components/MessageList/MessageList.tsx +9 -0
- package/src/components/MessageList/ScrollToBottomButton.tsx +6 -0
- package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.tsx.snap +2 -1
- package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.tsx.snap +6 -0
- package/src/components/MessageMenu/MessageActionList.tsx +4 -1
- package/src/components/MessageMenu/MessageActionListItem.tsx +1 -0
- package/src/components/MessageMenu/MessageReactionPicker.tsx +1 -0
- package/src/components/MessageMenu/ReactionButton.tsx +9 -1
- package/src/components/Poll/components/PollOption.tsx +11 -0
- package/src/components/ProgressControl/ProgressControl.tsx +8 -0
- package/src/components/Reply/Reply.tsx +5 -1
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.tsx.snap +20 -6
- package/src/components/UIComponents/BottomSheetModal.tsx +4 -0
- package/src/components/index.ts +2 -0
- package/src/components/ui/Avatar/Avatar.tsx +23 -2
- package/src/components/ui/Avatar/ChannelAvatar.tsx +3 -0
- package/src/components/ui/Avatar/UserAvatar.tsx +1 -0
- package/src/components/ui/Button/Button.tsx +24 -0
- package/src/components/ui/Input/Input.tsx +35 -0
- package/src/contexts/accessibilityContext/AccessibilityContext.tsx +165 -0
- package/src/contexts/accessibilityContext/__tests__/AccessibilityContext.test.tsx +65 -0
- package/src/contexts/accessibilityContext/index.ts +1 -0
- package/src/contexts/index.ts +1 -0
- package/src/contexts/overlayContext/OverlayContext.tsx +7 -0
- package/src/contexts/overlayContext/OverlayProvider.tsx +18 -14
- package/src/contexts/overlayContext/__tests__/OverlayProvider.test.tsx +51 -0
- package/src/hooks/index.ts +1 -0
- package/src/i18n/en.json +23 -1
- package/src/i18n/es.json +23 -1
- package/src/i18n/fr.json +23 -1
- package/src/i18n/he.json +23 -1
- package/src/i18n/hi.json +23 -1
- package/src/i18n/it.json +23 -1
- package/src/i18n/ja.json +23 -1
- package/src/i18n/ko.json +23 -1
- package/src/i18n/nl.json +23 -1
- package/src/i18n/pt-br.json +23 -1
- package/src/i18n/ru.json +23 -1
- package/src/i18n/tr.json +23 -1
- package/src/version.json +1 -1
|
@@ -12,6 +12,27 @@ import { primitives } from '../../../theme';
|
|
|
12
12
|
|
|
13
13
|
export type IconRenderer = (props: IconProps) => React.ReactNode;
|
|
14
14
|
|
|
15
|
+
const buttonAccessibilityStates = {
|
|
16
|
+
disabled: { disabled: true, selected: false },
|
|
17
|
+
disabledSelected: { disabled: true, selected: true },
|
|
18
|
+
enabled: { disabled: false, selected: false },
|
|
19
|
+
selected: { disabled: false, selected: true },
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
const getButtonAccessibilityState = ({
|
|
23
|
+
disabled,
|
|
24
|
+
selected,
|
|
25
|
+
}: {
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
selected: boolean;
|
|
28
|
+
}) => {
|
|
29
|
+
if (disabled)
|
|
30
|
+
return selected
|
|
31
|
+
? buttonAccessibilityStates.disabledSelected
|
|
32
|
+
: buttonAccessibilityStates.disabled;
|
|
33
|
+
return selected ? buttonAccessibilityStates.selected : buttonAccessibilityStates.enabled;
|
|
34
|
+
};
|
|
35
|
+
|
|
15
36
|
export type ButtonProps = PressableProps & {
|
|
16
37
|
/**
|
|
17
38
|
* The style of the button.
|
|
@@ -78,6 +99,7 @@ export const Button = ({
|
|
|
78
99
|
const RightIcon = isRTL ? LeadingIcon : TrailingIcon;
|
|
79
100
|
const IconOnlyIcon = LeadingIcon ?? TrailingIcon;
|
|
80
101
|
const PrimaryIcon = iconOnly ? IconOnlyIcon : LeftIcon;
|
|
102
|
+
const accessibilityState = getButtonAccessibilityState({ disabled: !!disabled, selected });
|
|
81
103
|
|
|
82
104
|
return (
|
|
83
105
|
<View
|
|
@@ -97,6 +119,8 @@ export const Button = ({
|
|
|
97
119
|
onLayout={onLayout}
|
|
98
120
|
>
|
|
99
121
|
<Pressable
|
|
122
|
+
accessibilityRole='button'
|
|
123
|
+
accessibilityState={accessibilityState}
|
|
100
124
|
style={({ pressed }) => [
|
|
101
125
|
{
|
|
102
126
|
backgroundColor: pressed
|
|
@@ -18,6 +18,25 @@ import { InfoTooltip } from '../../../icons/info';
|
|
|
18
18
|
import { primitives } from '../../../theme';
|
|
19
19
|
import { IconRenderer } from '../Button';
|
|
20
20
|
|
|
21
|
+
const inputAccessibilityStates = {
|
|
22
|
+
disabled: { disabled: true, selected: false },
|
|
23
|
+
disabledSelected: { disabled: true, selected: true },
|
|
24
|
+
enabled: { disabled: false, selected: false },
|
|
25
|
+
selected: { disabled: false, selected: true },
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
const getInputAccessibilityState = ({
|
|
29
|
+
disabled,
|
|
30
|
+
selected,
|
|
31
|
+
}: {
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
selected: boolean;
|
|
34
|
+
}) => {
|
|
35
|
+
if (disabled)
|
|
36
|
+
return selected ? inputAccessibilityStates.disabledSelected : inputAccessibilityStates.disabled;
|
|
37
|
+
return selected ? inputAccessibilityStates.selected : inputAccessibilityStates.enabled;
|
|
38
|
+
};
|
|
39
|
+
|
|
21
40
|
export type InputProps = TextInputProps & {
|
|
22
41
|
title?: string;
|
|
23
42
|
description?: string;
|
|
@@ -59,6 +78,10 @@ export const Input = ({
|
|
|
59
78
|
|
|
60
79
|
const LeftIcon = isRTL ? TrailingIcon : LeadingIcon;
|
|
61
80
|
const RightIcon = isRTL ? LeadingIcon : TrailingIcon;
|
|
81
|
+
const accessibilityState = getInputAccessibilityState({
|
|
82
|
+
disabled: !editable,
|
|
83
|
+
selected: isFocused,
|
|
84
|
+
});
|
|
62
85
|
|
|
63
86
|
const handleFocus = useCallback(
|
|
64
87
|
(e: TextInputFocusEvent) => {
|
|
@@ -104,6 +127,9 @@ export const Input = ({
|
|
|
104
127
|
/>
|
|
105
128
|
) : null}
|
|
106
129
|
<TextInput
|
|
130
|
+
accessibilityHint={description}
|
|
131
|
+
accessibilityLabel={props.accessibilityLabel ?? title}
|
|
132
|
+
accessibilityState={accessibilityState}
|
|
107
133
|
editable={editable}
|
|
108
134
|
onFocus={handleFocus}
|
|
109
135
|
onBlur={handleBlur}
|
|
@@ -111,6 +137,15 @@ export const Input = ({
|
|
|
111
137
|
placeholderTextColor={semantics.inputTextPlaceholder}
|
|
112
138
|
{...props}
|
|
113
139
|
/>
|
|
140
|
+
{state === 'error' && errorMessage ? (
|
|
141
|
+
<View
|
|
142
|
+
accessibilityLiveRegion='assertive'
|
|
143
|
+
accessibilityRole='alert'
|
|
144
|
+
style={{ width: 0, height: 0 }}
|
|
145
|
+
>
|
|
146
|
+
<Text>{errorMessage}</Text>
|
|
147
|
+
</View>
|
|
148
|
+
) : null}
|
|
114
149
|
{RightIcon ? (
|
|
115
150
|
<RightIcon
|
|
116
151
|
height={20}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
PropsWithChildren,
|
|
3
|
+
useCallback,
|
|
4
|
+
useContext,
|
|
5
|
+
useEffect,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { AccessibilityInfo } from 'react-native';
|
|
10
|
+
|
|
11
|
+
import { AccessibilityAnnouncerContext } from '../../components/Accessibility/useAccessibilityAnnouncer';
|
|
12
|
+
import type {
|
|
13
|
+
AccessibilityAnnounce,
|
|
14
|
+
AccessibilityAnnouncePriority,
|
|
15
|
+
} from '../../components/Accessibility/useAccessibilityAnnouncer';
|
|
16
|
+
|
|
17
|
+
const ANNOUNCE_DEBOUNCE_MS = 50;
|
|
18
|
+
|
|
19
|
+
type SequenceByPriority = { [key in AccessibilityAnnouncePriority]: number };
|
|
20
|
+
type TimeoutByPriority = {
|
|
21
|
+
[key in AccessibilityAnnouncePriority]: ReturnType<typeof setTimeout> | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** Tri-state for gesture-alternative toggles. */
|
|
25
|
+
export type A11yMode = 'auto' | 'always' | 'never';
|
|
26
|
+
|
|
27
|
+
export type AccessibilityConfig = {
|
|
28
|
+
/**
|
|
29
|
+
* Master toggle. Default FALSE — integrators must opt in. When false, the SDK
|
|
30
|
+
* behaves exactly as it does today; no a11y attributes are added, no announcer
|
|
31
|
+
* mounts, no listeners attached.
|
|
32
|
+
*/
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
/** For testing — force "screen reader on" UI even when no SR is active. */
|
|
35
|
+
forceScreenReaderMode?: boolean;
|
|
36
|
+
/** Announce new messages via the announcer. Default true (when enabled). */
|
|
37
|
+
announceNewMessages?: boolean;
|
|
38
|
+
/** Announce typing indicator. Default false (noisy on mobile). */
|
|
39
|
+
announceTypingIndicator?: boolean;
|
|
40
|
+
/** Announce connection state (offline/online). Default true. */
|
|
41
|
+
announceConnectionState?: boolean;
|
|
42
|
+
/** Audio recorder gesture-alternative. 'auto' (default), 'always', 'never'. */
|
|
43
|
+
audioRecorderTapMode?: A11yMode;
|
|
44
|
+
/** Image gallery gesture-alternative. 'auto' (default), 'always', 'never'. */
|
|
45
|
+
imageGalleryScreenReaderMode?: A11yMode;
|
|
46
|
+
/** Message actions trigger. 'long-press' (no alt button), 'auto' (default — show button when SR is on), 'always-button'. */
|
|
47
|
+
messageActionsTrigger?: 'long-press' | 'auto' | 'always-button';
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** Fully-resolved config — every field is populated with its default. */
|
|
51
|
+
export type ResolvedAccessibilityConfig = Required<AccessibilityConfig>;
|
|
52
|
+
|
|
53
|
+
export const accessibilityContextDefaultValue: ResolvedAccessibilityConfig = {
|
|
54
|
+
announceConnectionState: true,
|
|
55
|
+
announceNewMessages: true,
|
|
56
|
+
announceTypingIndicator: false,
|
|
57
|
+
audioRecorderTapMode: 'auto',
|
|
58
|
+
enabled: false,
|
|
59
|
+
forceScreenReaderMode: false,
|
|
60
|
+
imageGalleryScreenReaderMode: 'auto',
|
|
61
|
+
messageActionsTrigger: 'auto',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const AccessibilityContext = React.createContext<ResolvedAccessibilityConfig>(
|
|
65
|
+
accessibilityContextDefaultValue,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const AccessibilityAnnouncerProvider = ({ children }: PropsWithChildren) => {
|
|
69
|
+
const sequenceByPriorityRef = useRef<SequenceByPriority>({ assertive: 0, polite: 0 });
|
|
70
|
+
const timeoutByPriorityRef = useRef<TimeoutByPriority>({
|
|
71
|
+
assertive: undefined,
|
|
72
|
+
polite: undefined,
|
|
73
|
+
});
|
|
74
|
+
const unmountedRef = useRef(false);
|
|
75
|
+
|
|
76
|
+
const clearPendingTimeout = useCallback((priority: AccessibilityAnnouncePriority) => {
|
|
77
|
+
if (!timeoutByPriorityRef.current[priority]) return;
|
|
78
|
+
clearTimeout(timeoutByPriorityRef.current[priority]);
|
|
79
|
+
timeoutByPriorityRef.current[priority] = undefined;
|
|
80
|
+
}, []);
|
|
81
|
+
|
|
82
|
+
const announce = useCallback<AccessibilityAnnounce>(
|
|
83
|
+
(message, priority = 'polite') => {
|
|
84
|
+
if (!message) return;
|
|
85
|
+
const sequence = sequenceByPriorityRef.current[priority] + 1;
|
|
86
|
+
sequenceByPriorityRef.current[priority] = sequence;
|
|
87
|
+
clearPendingTimeout(priority);
|
|
88
|
+
timeoutByPriorityRef.current[priority] = setTimeout(() => {
|
|
89
|
+
if (unmountedRef.current) return;
|
|
90
|
+
if (sequenceByPriorityRef.current[priority] !== sequence) return;
|
|
91
|
+
AccessibilityInfo.announceForAccessibility(message);
|
|
92
|
+
timeoutByPriorityRef.current[priority] = undefined;
|
|
93
|
+
}, ANNOUNCE_DEBOUNCE_MS);
|
|
94
|
+
},
|
|
95
|
+
[clearPendingTimeout],
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
unmountedRef.current = false;
|
|
100
|
+
return () => {
|
|
101
|
+
unmountedRef.current = true;
|
|
102
|
+
clearPendingTimeout('assertive');
|
|
103
|
+
clearPendingTimeout('polite');
|
|
104
|
+
};
|
|
105
|
+
}, [clearPendingTimeout]);
|
|
106
|
+
|
|
107
|
+
const contextValue = useMemo(() => ({ announce }), [announce]);
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<AccessibilityAnnouncerContext.Provider value={contextValue}>
|
|
111
|
+
{children}
|
|
112
|
+
</AccessibilityAnnouncerContext.Provider>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const AccessibilityProvider = ({
|
|
117
|
+
children,
|
|
118
|
+
value,
|
|
119
|
+
}: PropsWithChildren<{ value?: AccessibilityConfig }>) => {
|
|
120
|
+
const {
|
|
121
|
+
announceConnectionState = accessibilityContextDefaultValue.announceConnectionState,
|
|
122
|
+
announceNewMessages = accessibilityContextDefaultValue.announceNewMessages,
|
|
123
|
+
announceTypingIndicator = accessibilityContextDefaultValue.announceTypingIndicator,
|
|
124
|
+
audioRecorderTapMode = accessibilityContextDefaultValue.audioRecorderTapMode,
|
|
125
|
+
enabled = accessibilityContextDefaultValue.enabled,
|
|
126
|
+
forceScreenReaderMode = accessibilityContextDefaultValue.forceScreenReaderMode,
|
|
127
|
+
imageGalleryScreenReaderMode = accessibilityContextDefaultValue.imageGalleryScreenReaderMode,
|
|
128
|
+
messageActionsTrigger = accessibilityContextDefaultValue.messageActionsTrigger,
|
|
129
|
+
} = value ?? {};
|
|
130
|
+
|
|
131
|
+
const resolved = useMemo<ResolvedAccessibilityConfig>(
|
|
132
|
+
() => ({
|
|
133
|
+
announceConnectionState,
|
|
134
|
+
announceNewMessages,
|
|
135
|
+
announceTypingIndicator,
|
|
136
|
+
audioRecorderTapMode,
|
|
137
|
+
enabled,
|
|
138
|
+
forceScreenReaderMode,
|
|
139
|
+
imageGalleryScreenReaderMode,
|
|
140
|
+
messageActionsTrigger,
|
|
141
|
+
}),
|
|
142
|
+
[
|
|
143
|
+
announceConnectionState,
|
|
144
|
+
announceNewMessages,
|
|
145
|
+
announceTypingIndicator,
|
|
146
|
+
audioRecorderTapMode,
|
|
147
|
+
enabled,
|
|
148
|
+
forceScreenReaderMode,
|
|
149
|
+
imageGalleryScreenReaderMode,
|
|
150
|
+
messageActionsTrigger,
|
|
151
|
+
],
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<AccessibilityContext.Provider value={resolved}>
|
|
156
|
+
{enabled ? (
|
|
157
|
+
<AccessibilityAnnouncerProvider>{children}</AccessibilityAnnouncerProvider>
|
|
158
|
+
) : (
|
|
159
|
+
children
|
|
160
|
+
)}
|
|
161
|
+
</AccessibilityContext.Provider>
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const useAccessibilityContext = () => useContext(AccessibilityContext);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render, renderHook } from '@testing-library/react-native';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
AccessibilityConfig,
|
|
7
|
+
AccessibilityProvider,
|
|
8
|
+
ResolvedAccessibilityConfig,
|
|
9
|
+
accessibilityContextDefaultValue,
|
|
10
|
+
useAccessibilityContext,
|
|
11
|
+
} from '../AccessibilityContext';
|
|
12
|
+
|
|
13
|
+
const wrap =
|
|
14
|
+
(props: Parameters<typeof AccessibilityProvider>[0]) =>
|
|
15
|
+
({ children }: { children: React.ReactNode }) => (
|
|
16
|
+
<AccessibilityProvider {...props}>{children}</AccessibilityProvider>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
describe('AccessibilityContext', () => {
|
|
20
|
+
it('defaults to disabled', () => {
|
|
21
|
+
const { result } = renderHook(() => useAccessibilityContext(), {
|
|
22
|
+
wrapper: wrap({ children: null }),
|
|
23
|
+
});
|
|
24
|
+
expect(result.current.enabled).toBe(false);
|
|
25
|
+
expect(result.current).toEqual(accessibilityContextDefaultValue);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('merges integrator config with defaults', () => {
|
|
29
|
+
const { result } = renderHook(() => useAccessibilityContext(), {
|
|
30
|
+
wrapper: wrap({ children: null, value: { enabled: true, audioRecorderTapMode: 'always' } }),
|
|
31
|
+
});
|
|
32
|
+
expect(result.current.enabled).toBe(true);
|
|
33
|
+
expect(result.current.audioRecorderTapMode).toBe('always');
|
|
34
|
+
expect(result.current.announceNewMessages).toBe(true);
|
|
35
|
+
expect(result.current.announceTypingIndicator).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('returns defaults when used outside the provider', () => {
|
|
39
|
+
const { result } = renderHook(() => useAccessibilityContext());
|
|
40
|
+
expect(result.current).toEqual(accessibilityContextDefaultValue);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('keeps the resolved value stable when equivalent config objects are recreated', () => {
|
|
44
|
+
const contextValues: ResolvedAccessibilityConfig[] = [];
|
|
45
|
+
|
|
46
|
+
const ContextValueProbe = () => {
|
|
47
|
+
contextValues.push(useAccessibilityContext());
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const renderProvider = (value: AccessibilityConfig) => (
|
|
52
|
+
<AccessibilityProvider value={value}>
|
|
53
|
+
<ContextValueProbe />
|
|
54
|
+
</AccessibilityProvider>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const { rerender } = render(renderProvider({ audioRecorderTapMode: 'always', enabled: true }));
|
|
58
|
+
const firstValue = contextValues[contextValues.length - 1];
|
|
59
|
+
|
|
60
|
+
rerender(renderProvider({ audioRecorderTapMode: 'always', enabled: true }));
|
|
61
|
+
const secondValue = contextValues[contextValues.length - 1];
|
|
62
|
+
|
|
63
|
+
expect(secondValue).toBe(firstValue);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AccessibilityContext';
|
package/src/contexts/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import React, { useContext } from 'react';
|
|
|
3
3
|
import { SharedValue } from 'react-native-reanimated';
|
|
4
4
|
|
|
5
5
|
import type { Streami18n } from '../../utils/i18n/Streami18n';
|
|
6
|
+
import type { AccessibilityConfig } from '../accessibilityContext/AccessibilityContext';
|
|
6
7
|
import { ImageGalleryProviderProps } from '../imageGalleryContext/ImageGalleryContext';
|
|
7
8
|
import type { DeepPartial } from '../themeContext/ThemeContext';
|
|
8
9
|
import type { Theme } from '../themeContext/utils/theme';
|
|
@@ -24,6 +25,12 @@ export const OverlayContext = React.createContext(
|
|
|
24
25
|
);
|
|
25
26
|
|
|
26
27
|
export type OverlayProviderProps = ImageGalleryProviderProps & {
|
|
28
|
+
/**
|
|
29
|
+
* Opt-in accessibility configuration. A11y is OFF by default — pass
|
|
30
|
+
* `accessibility={{ enabled: true }}` to enable screen-reader announcements,
|
|
31
|
+
* gesture alternatives, and semantic a11y attributes across the SDK.
|
|
32
|
+
*/
|
|
33
|
+
accessibility?: AccessibilityConfig;
|
|
27
34
|
/** https://github.com/GetStream/stream-chat-react-native/wiki/Internationalization-(i18n) */
|
|
28
35
|
i18nInstance?: Streami18n;
|
|
29
36
|
value?: Partial<OverlayContextValue>;
|
|
@@ -12,6 +12,7 @@ import { OverlayContext, OverlayProviderProps } from './OverlayContext';
|
|
|
12
12
|
import { ImageGallery } from '../../components/ImageGallery/ImageGallery';
|
|
13
13
|
import { useStreami18n } from '../../hooks/useStreami18n';
|
|
14
14
|
|
|
15
|
+
import { AccessibilityProvider } from '../accessibilityContext/AccessibilityContext';
|
|
15
16
|
import { ImageGalleryProvider } from '../imageGalleryContext/ImageGalleryContext';
|
|
16
17
|
import { ThemeProvider } from '../themeContext/ThemeContext';
|
|
17
18
|
|
|
@@ -42,12 +43,13 @@ import {
|
|
|
42
43
|
*/
|
|
43
44
|
export const OverlayProvider = (props: PropsWithChildren<OverlayProviderProps>) => {
|
|
44
45
|
const {
|
|
45
|
-
|
|
46
|
-
i18nInstance,
|
|
47
|
-
value,
|
|
46
|
+
accessibility,
|
|
48
47
|
autoPlayVideo,
|
|
48
|
+
children,
|
|
49
49
|
giphyVersion,
|
|
50
|
+
i18nInstance,
|
|
50
51
|
numberOfImageGalleryGridColumns,
|
|
52
|
+
value,
|
|
51
53
|
} = props;
|
|
52
54
|
|
|
53
55
|
const [overlay, setOverlay] = useState(value?.overlay || 'none');
|
|
@@ -100,17 +102,19 @@ export const OverlayProvider = (props: PropsWithChildren<OverlayProviderProps>)
|
|
|
100
102
|
|
|
101
103
|
return (
|
|
102
104
|
<TranslationProvider value={{ ...translators, userLanguage: DEFAULT_USER_LANGUAGE }}>
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
<AccessibilityProvider value={accessibility}>
|
|
106
|
+
<OverlayContext.Provider value={overlayContext}>
|
|
107
|
+
<ImageGalleryProvider value={imageGalleryProviderProps}>
|
|
108
|
+
<ThemeProvider style={overlayContext.style}>
|
|
109
|
+
<PortalProvider>
|
|
110
|
+
{children}
|
|
111
|
+
{overlay === 'gallery' && <ImageGallery overlayOpacity={overlayOpacity} />}
|
|
112
|
+
<MessageOverlayHostLayer />
|
|
113
|
+
</PortalProvider>
|
|
114
|
+
</ThemeProvider>
|
|
115
|
+
</ImageGalleryProvider>
|
|
116
|
+
</OverlayContext.Provider>
|
|
117
|
+
</AccessibilityProvider>
|
|
114
118
|
</TranslationProvider>
|
|
115
119
|
);
|
|
116
120
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AccessibilityInfo } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { renderHook, waitFor } from '@testing-library/react-native';
|
|
5
|
+
|
|
6
|
+
import { useAccessibilityAnnouncer } from '../../../components/Accessibility/useAccessibilityAnnouncer';
|
|
7
|
+
import { useAccessibilityContext } from '../../accessibilityContext/AccessibilityContext';
|
|
8
|
+
import { OverlayProvider } from '../OverlayProvider';
|
|
9
|
+
|
|
10
|
+
jest.mock('react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo', () => ({
|
|
11
|
+
__esModule: true,
|
|
12
|
+
default: {
|
|
13
|
+
addEventListener: jest.fn().mockReturnValue({ remove: jest.fn() }),
|
|
14
|
+
announceForAccessibility: jest.fn(),
|
|
15
|
+
isReduceMotionEnabled: jest.fn().mockResolvedValue(false),
|
|
16
|
+
isScreenReaderEnabled: jest.fn().mockResolvedValue(false),
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
describe('OverlayProvider accessibility', () => {
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
(AccessibilityInfo.announceForAccessibility as jest.Mock).mockClear();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('provides accessibility config and announcer to descendants', async () => {
|
|
26
|
+
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
27
|
+
<OverlayProvider accessibility={{ audioRecorderTapMode: 'always', enabled: true }}>
|
|
28
|
+
{children}
|
|
29
|
+
</OverlayProvider>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const { result } = renderHook(
|
|
33
|
+
() => ({
|
|
34
|
+
announce: useAccessibilityAnnouncer(),
|
|
35
|
+
accessibility: useAccessibilityContext(),
|
|
36
|
+
}),
|
|
37
|
+
{ wrapper },
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
expect(result.current.accessibility.enabled).toBe(true);
|
|
41
|
+
expect(result.current.accessibility.audioRecorderTapMode).toBe('always');
|
|
42
|
+
|
|
43
|
+
result.current.announce('overlay announcement');
|
|
44
|
+
|
|
45
|
+
await waitFor(() =>
|
|
46
|
+
expect(AccessibilityInfo.announceForAccessibility).toHaveBeenCalledWith(
|
|
47
|
+
'overlay announcement',
|
|
48
|
+
),
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
});
|
package/src/hooks/index.ts
CHANGED
package/src/i18n/en.json
CHANGED
|
@@ -236,5 +236,27 @@
|
|
|
236
236
|
"Unsupported Attachment": "Unsupported Attachment",
|
|
237
237
|
"+{{count}} More Options_one": "+{{count}} More Option",
|
|
238
238
|
"+{{count}} More Options_other": "+{{count}} More Options",
|
|
239
|
-
"+{{count}} More Options_many": "+{{count}} More Options"
|
|
239
|
+
"+{{count}} More Options_many": "+{{count}} More Options",
|
|
240
|
+
"a11y/AI is generating": "AI is generating",
|
|
241
|
+
"a11y/AI is thinking": "AI is thinking",
|
|
242
|
+
"a11y/Avatar of {{name}}": "Avatar of {{name}}",
|
|
243
|
+
"a11y/Connected": "Connected",
|
|
244
|
+
"a11y/Delivered": "Delivered",
|
|
245
|
+
"a11y/Loading": "Loading",
|
|
246
|
+
"a11y/Loading failed": "Loading failed",
|
|
247
|
+
"a11y/Message actions": "Message actions",
|
|
248
|
+
"a11y/New message from {{user}}": "New message from {{user}}",
|
|
249
|
+
"a11y/Offline": "Offline",
|
|
250
|
+
"a11y/Open message actions": "Open message actions",
|
|
251
|
+
"a11y/Reaction {{emoji}} by {{count}} users": "Reaction {{emoji}} by {{count}} users",
|
|
252
|
+
"a11y/Read": "Read",
|
|
253
|
+
"a11y/Reconnecting": "Reconnecting",
|
|
254
|
+
"a11y/Reply to {{user}}": "Reply to {{user}}",
|
|
255
|
+
"a11y/Scroll to latest": "Scroll to latest",
|
|
256
|
+
"a11y/Scroll to latest, {{count}} unread": "Scroll to latest, {{count}} unread",
|
|
257
|
+
"a11y/Send message": "Send message",
|
|
258
|
+
"a11y/Sending": "Sending",
|
|
259
|
+
"a11y/Sent": "Sent",
|
|
260
|
+
"a11y/Voice message recording. Hold to record.": "Voice message recording. Hold to record.",
|
|
261
|
+
"a11y/{{count}} new messages": "{{count}} new messages"
|
|
240
262
|
}
|
package/src/i18n/es.json
CHANGED
|
@@ -236,5 +236,27 @@
|
|
|
236
236
|
"Unsupported Attachment": "Adjunto no admitido",
|
|
237
237
|
"+{{count}} More Options_one": "+{{count}} opción más",
|
|
238
238
|
"+{{count}} More Options_other": "+{{count}} opciones más",
|
|
239
|
-
"+{{count}} More Options_many": "+{{count}} opciones más"
|
|
239
|
+
"+{{count}} More Options_many": "+{{count}} opciones más",
|
|
240
|
+
"a11y/AI is generating": "La IA está generando",
|
|
241
|
+
"a11y/AI is thinking": "La IA está pensando",
|
|
242
|
+
"a11y/Avatar of {{name}}": "Avatar de {{name}}",
|
|
243
|
+
"a11y/Connected": "Conectado",
|
|
244
|
+
"a11y/Delivered": "Entregado",
|
|
245
|
+
"a11y/Loading": "Cargando",
|
|
246
|
+
"a11y/Loading failed": "Error al cargar",
|
|
247
|
+
"a11y/Message actions": "Acciones del mensaje",
|
|
248
|
+
"a11y/New message from {{user}}": "Nuevo mensaje de {{user}}",
|
|
249
|
+
"a11y/Offline": "Sin conexión",
|
|
250
|
+
"a11y/Open message actions": "Abrir acciones del mensaje",
|
|
251
|
+
"a11y/Reaction {{emoji}} by {{count}} users": "Reacción {{emoji}} de {{count}} usuarios",
|
|
252
|
+
"a11y/Read": "Leído",
|
|
253
|
+
"a11y/Reconnecting": "Reconectando",
|
|
254
|
+
"a11y/Reply to {{user}}": "Responder a {{user}}",
|
|
255
|
+
"a11y/Scroll to latest": "Ir al último mensaje",
|
|
256
|
+
"a11y/Scroll to latest, {{count}} unread": "Ir al último mensaje, {{count}} sin leer",
|
|
257
|
+
"a11y/Send message": "Enviar mensaje",
|
|
258
|
+
"a11y/Sending": "Enviando",
|
|
259
|
+
"a11y/Sent": "Enviado",
|
|
260
|
+
"a11y/Voice message recording. Hold to record.": "Grabación de mensaje de voz. Mantén pulsado para grabar.",
|
|
261
|
+
"a11y/{{count}} new messages": "{{count}} mensajes nuevos"
|
|
240
262
|
}
|
package/src/i18n/fr.json
CHANGED
|
@@ -236,5 +236,27 @@
|
|
|
236
236
|
"Unsupported Attachment": "Pièce jointe non prise en charge",
|
|
237
237
|
"+{{count}} More Options_one": "+{{count}} option supplémentaire",
|
|
238
238
|
"+{{count}} More Options_other": "+{{count}} options supplémentaires",
|
|
239
|
-
"+{{count}} More Options_many": "+{{count}} options supplémentaires"
|
|
239
|
+
"+{{count}} More Options_many": "+{{count}} options supplémentaires",
|
|
240
|
+
"a11y/AI is generating": "L'IA génère une réponse",
|
|
241
|
+
"a11y/AI is thinking": "L'IA réfléchit",
|
|
242
|
+
"a11y/Avatar of {{name}}": "Avatar de {{name}}",
|
|
243
|
+
"a11y/Connected": "Connecté",
|
|
244
|
+
"a11y/Delivered": "Distribué",
|
|
245
|
+
"a11y/Loading": "Chargement",
|
|
246
|
+
"a11y/Loading failed": "Échec du chargement",
|
|
247
|
+
"a11y/Message actions": "Actions du message",
|
|
248
|
+
"a11y/New message from {{user}}": "Nouveau message de {{user}}",
|
|
249
|
+
"a11y/Offline": "Hors ligne",
|
|
250
|
+
"a11y/Open message actions": "Ouvrir les actions du message",
|
|
251
|
+
"a11y/Reaction {{emoji}} by {{count}} users": "Réaction {{emoji}} par {{count}} utilisateurs",
|
|
252
|
+
"a11y/Read": "Lu",
|
|
253
|
+
"a11y/Reconnecting": "Reconnexion",
|
|
254
|
+
"a11y/Reply to {{user}}": "Répondre à {{user}}",
|
|
255
|
+
"a11y/Scroll to latest": "Aller au dernier message",
|
|
256
|
+
"a11y/Scroll to latest, {{count}} unread": "Aller au dernier message, {{count}} non lus",
|
|
257
|
+
"a11y/Send message": "Envoyer le message",
|
|
258
|
+
"a11y/Sending": "Envoi",
|
|
259
|
+
"a11y/Sent": "Envoyé",
|
|
260
|
+
"a11y/Voice message recording. Hold to record.": "Enregistrement d'un message vocal. Maintenez appuyé pour enregistrer.",
|
|
261
|
+
"a11y/{{count}} new messages": "{{count}} nouveaux messages"
|
|
240
262
|
}
|
package/src/i18n/he.json
CHANGED
|
@@ -236,5 +236,27 @@
|
|
|
236
236
|
"Unsupported Attachment": "קובץ לא נתמך",
|
|
237
237
|
"+{{count}} More Options_one": "+עוד אפשרות {{count}}",
|
|
238
238
|
"+{{count}} More Options_other": "+עוד {{count}} אפשרויות",
|
|
239
|
-
"+{{count}} More Options_many": "+עוד {{count}} אפשרויות"
|
|
239
|
+
"+{{count}} More Options_many": "+עוד {{count}} אפשרויות",
|
|
240
|
+
"a11y/AI is generating": "הבינה המלאכותית יוצרת תשובה",
|
|
241
|
+
"a11y/AI is thinking": "הבינה המלאכותית חושבת",
|
|
242
|
+
"a11y/Avatar of {{name}}": "תמונת פרופיל של {{name}}",
|
|
243
|
+
"a11y/Connected": "מחובר",
|
|
244
|
+
"a11y/Delivered": "נמסר",
|
|
245
|
+
"a11y/Loading": "טוען",
|
|
246
|
+
"a11y/Loading failed": "הטעינה נכשלה",
|
|
247
|
+
"a11y/Message actions": "פעולות הודעה",
|
|
248
|
+
"a11y/New message from {{user}}": "הודעה חדשה מ-{{user}}",
|
|
249
|
+
"a11y/Offline": "לא מקוון",
|
|
250
|
+
"a11y/Open message actions": "פתח פעולות הודעה",
|
|
251
|
+
"a11y/Reaction {{emoji}} by {{count}} users": "תגובה {{emoji}} מאת {{count}} משתמשים",
|
|
252
|
+
"a11y/Read": "נקרא",
|
|
253
|
+
"a11y/Reconnecting": "מתחבר מחדש",
|
|
254
|
+
"a11y/Reply to {{user}}": "השב ל-{{user}}",
|
|
255
|
+
"a11y/Scroll to latest": "גלול להודעה האחרונה",
|
|
256
|
+
"a11y/Scroll to latest, {{count}} unread": "גלול להודעה האחרונה, {{count}} לא נקראו",
|
|
257
|
+
"a11y/Send message": "שלח הודעה",
|
|
258
|
+
"a11y/Sending": "שולח",
|
|
259
|
+
"a11y/Sent": "נשלח",
|
|
260
|
+
"a11y/Voice message recording. Hold to record.": "הקלטת הודעה קולית. החזק כדי להקליט.",
|
|
261
|
+
"a11y/{{count}} new messages": "{{count}} הודעות חדשות"
|
|
240
262
|
}
|
package/src/i18n/hi.json
CHANGED
|
@@ -236,5 +236,27 @@
|
|
|
236
236
|
"Unsupported Attachment": "असमर्थित अटैचमेंट",
|
|
237
237
|
"+{{count}} More Options_one": "+{{count}} और विकल्प",
|
|
238
238
|
"+{{count}} More Options_other": "+{{count}} और विकल्प",
|
|
239
|
-
"+{{count}} More Options_many": "+{{count}} और विकल्प"
|
|
239
|
+
"+{{count}} More Options_many": "+{{count}} और विकल्प",
|
|
240
|
+
"a11y/AI is generating": "AI जवाब तैयार कर रहा है",
|
|
241
|
+
"a11y/AI is thinking": "AI सोच रहा है",
|
|
242
|
+
"a11y/Avatar of {{name}}": "{{name}} का अवतार",
|
|
243
|
+
"a11y/Connected": "कनेक्टेड",
|
|
244
|
+
"a11y/Delivered": "डिलीवर हुआ",
|
|
245
|
+
"a11y/Loading": "लोड हो रहा है",
|
|
246
|
+
"a11y/Loading failed": "लोड नहीं हो सका",
|
|
247
|
+
"a11y/Message actions": "संदेश की कार्रवाइयां",
|
|
248
|
+
"a11y/New message from {{user}}": "{{user}} से नया संदेश",
|
|
249
|
+
"a11y/Offline": "ऑफलाइन",
|
|
250
|
+
"a11y/Open message actions": "संदेश की कार्रवाइयां खोलें",
|
|
251
|
+
"a11y/Reaction {{emoji}} by {{count}} users": "{{count}} उपयोगकर्ताओं की {{emoji}} प्रतिक्रिया",
|
|
252
|
+
"a11y/Read": "पढ़ा गया",
|
|
253
|
+
"a11y/Reconnecting": "फिर से कनेक्ट हो रहा है",
|
|
254
|
+
"a11y/Reply to {{user}}": "{{user}} को जवाब दें",
|
|
255
|
+
"a11y/Scroll to latest": "नवीनतम संदेश पर जाएं",
|
|
256
|
+
"a11y/Scroll to latest, {{count}} unread": "नवीनतम संदेश पर जाएं, {{count}} अपठित",
|
|
257
|
+
"a11y/Send message": "संदेश भेजें",
|
|
258
|
+
"a11y/Sending": "भेजा जा रहा है",
|
|
259
|
+
"a11y/Sent": "भेजा गया",
|
|
260
|
+
"a11y/Voice message recording. Hold to record.": "वॉइस संदेश रिकॉर्डिंग। रिकॉर्ड करने के लिए दबाकर रखें।",
|
|
261
|
+
"a11y/{{count}} new messages": "{{count}} नए संदेश"
|
|
240
262
|
}
|
package/src/i18n/it.json
CHANGED
|
@@ -236,5 +236,27 @@
|
|
|
236
236
|
"Unsupported Attachment": "Allegato non supportato",
|
|
237
237
|
"+{{count}} More Options_one": "+{{count}} altra opzione",
|
|
238
238
|
"+{{count}} More Options_other": "+{{count}} altre opzioni",
|
|
239
|
-
"+{{count}} More Options_many": "+{{count}} altre opzioni"
|
|
239
|
+
"+{{count}} More Options_many": "+{{count}} altre opzioni",
|
|
240
|
+
"a11y/AI is generating": "L'IA sta generando",
|
|
241
|
+
"a11y/AI is thinking": "L'IA sta pensando",
|
|
242
|
+
"a11y/Avatar of {{name}}": "Avatar di {{name}}",
|
|
243
|
+
"a11y/Connected": "Connesso",
|
|
244
|
+
"a11y/Delivered": "Consegnato",
|
|
245
|
+
"a11y/Loading": "Caricamento",
|
|
246
|
+
"a11y/Loading failed": "Caricamento non riuscito",
|
|
247
|
+
"a11y/Message actions": "Azioni del messaggio",
|
|
248
|
+
"a11y/New message from {{user}}": "Nuovo messaggio da {{user}}",
|
|
249
|
+
"a11y/Offline": "Offline",
|
|
250
|
+
"a11y/Open message actions": "Apri azioni del messaggio",
|
|
251
|
+
"a11y/Reaction {{emoji}} by {{count}} users": "Reazione {{emoji}} di {{count}} utenti",
|
|
252
|
+
"a11y/Read": "Letto",
|
|
253
|
+
"a11y/Reconnecting": "Riconnessione",
|
|
254
|
+
"a11y/Reply to {{user}}": "Rispondi a {{user}}",
|
|
255
|
+
"a11y/Scroll to latest": "Vai al messaggio più recente",
|
|
256
|
+
"a11y/Scroll to latest, {{count}} unread": "Vai al messaggio più recente, {{count}} non letti",
|
|
257
|
+
"a11y/Send message": "Invia messaggio",
|
|
258
|
+
"a11y/Sending": "Invio in corso",
|
|
259
|
+
"a11y/Sent": "Inviato",
|
|
260
|
+
"a11y/Voice message recording. Hold to record.": "Registrazione del messaggio vocale. Tieni premuto per registrare.",
|
|
261
|
+
"a11y/{{count}} new messages": "{{count}} nuovi messaggi"
|
|
240
262
|
}
|