stream-chat-react 14.6.1 → 14.8.0
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/cjs/{ReactPlayerWrapper.c340ab05.js → ReactPlayerWrapper.60a93742.js} +2 -2
- package/dist/cjs/{ReactPlayerWrapper.c340ab05.js.map → ReactPlayerWrapper.60a93742.js.map} +1 -1
- package/dist/cjs/channel-detail.js +2 -2
- package/dist/cjs/emojis.js +2 -2
- package/dist/cjs/index.js +2890 -732
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{useChannelHeaderOnlineStatus.d39ede24.js → useChannelHeaderOnlineStatus.72753090.js} +373 -63
- package/dist/cjs/useChannelHeaderOnlineStatus.72753090.js.map +1 -0
- package/dist/cjs/{useMessageComposerController.f1a3d182.js → useMessageComposerController.f8f20e3d.js} +2 -2
- package/dist/cjs/{useMessageComposerController.f1a3d182.js.map → useMessageComposerController.f8f20e3d.js.map} +1 -1
- package/dist/cjs/{useNotificationApi.87ba0b39.js → useNotificationApi.bf76a16b.js} +294 -42
- package/dist/cjs/useNotificationApi.bf76a16b.js.map +1 -0
- package/dist/css/index.css +34 -7
- package/dist/css/index.css.map +1 -1
- package/dist/es/channel-detail.mjs +2 -2
- package/dist/es/emojis.mjs +2 -2
- package/dist/es/index.mjs +2870 -730
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/{useChannelHeaderOnlineStatus.b3a51ca7.mjs → useChannelHeaderOnlineStatus.c86db868.mjs} +337 -64
- package/dist/es/useChannelHeaderOnlineStatus.c86db868.mjs.map +1 -0
- package/dist/es/{useMessageComposerController.2309f433.mjs → useMessageComposerController.d50f6168.mjs} +2 -2
- package/dist/es/{useMessageComposerController.2309f433.mjs.map → useMessageComposerController.d50f6168.mjs.map} +1 -1
- package/dist/es/{useNotificationApi.eff88f29.mjs → useNotificationApi.ed6bff88.mjs} +271 -43
- package/dist/es/useNotificationApi.ed6bff88.mjs.map +1 -0
- package/dist/types/a11y/accessibleLabel.d.ts +38 -0
- package/dist/types/a11y/accessibleLabel.d.ts.map +1 -0
- package/dist/types/a11y/hooks/useListboxKeyboardNavigation.d.ts +73 -0
- package/dist/types/a11y/hooks/useListboxKeyboardNavigation.d.ts.map +1 -0
- package/dist/types/a11y/hooks/useVirtualizedListboxKeyboardNavigation.d.ts +41 -0
- package/dist/types/a11y/hooks/useVirtualizedListboxKeyboardNavigation.d.ts.map +1 -0
- package/dist/types/components/Accessibility/AriaLiveAnnouncerProvider.d.ts +13 -0
- package/dist/types/components/Accessibility/AriaLiveAnnouncerProvider.d.ts.map +1 -0
- package/dist/types/components/Accessibility/AriaLiveOutlet.d.ts +24 -0
- package/dist/types/components/Accessibility/AriaLiveOutlet.d.ts.map +1 -0
- package/dist/types/components/Accessibility/AriaLiveOutletContext.d.ts +25 -0
- package/dist/types/components/Accessibility/AriaLiveOutletContext.d.ts.map +1 -0
- package/dist/types/components/Accessibility/NotificationAnnouncer.d.ts +21 -1
- package/dist/types/components/Accessibility/NotificationAnnouncer.d.ts.map +1 -1
- package/dist/types/components/Accessibility/hooks/useAudioPlaybackChangeAnnouncements.d.ts +3 -0
- package/dist/types/components/Accessibility/hooks/useAudioPlaybackChangeAnnouncements.d.ts.map +1 -0
- package/dist/types/components/Accessibility/hooks/useFocusReturn.d.ts +44 -0
- package/dist/types/components/Accessibility/hooks/useFocusReturn.d.ts.map +1 -0
- package/dist/types/components/Accessibility/hooks/useInertWhenHidden.d.ts +88 -0
- package/dist/types/components/Accessibility/hooks/useInertWhenHidden.d.ts.map +1 -0
- package/dist/types/components/Accessibility/hooks/useInteractionAnnouncements.d.ts +114 -0
- package/dist/types/components/Accessibility/hooks/useInteractionAnnouncements.d.ts.map +1 -0
- package/dist/types/components/Accessibility/index.d.ts +7 -1
- package/dist/types/components/Accessibility/index.d.ts.map +1 -1
- package/dist/types/components/Accessibility/scheduling/index.d.ts +4 -0
- package/dist/types/components/Accessibility/scheduling/index.d.ts.map +1 -0
- package/dist/types/components/Accessibility/scheduling/useAnnouncementQueue.d.ts +25 -0
- package/dist/types/components/Accessibility/scheduling/useAnnouncementQueue.d.ts.map +1 -0
- package/dist/types/components/Accessibility/scheduling/useDebouncedAnnounce.d.ts +54 -0
- package/dist/types/components/Accessibility/scheduling/useDebouncedAnnounce.d.ts.map +1 -0
- package/dist/types/components/Accessibility/scheduling/useSettledAnnouncement.d.ts +74 -0
- package/dist/types/components/Accessibility/scheduling/useSettledAnnouncement.d.ts.map +1 -0
- package/dist/types/components/Accessibility/useAriaLiveAnnouncer.d.ts +24 -1
- package/dist/types/components/Accessibility/useAriaLiveAnnouncer.d.ts.map +1 -1
- package/dist/types/components/Attachment/AttachmentActions.d.ts.map +1 -1
- package/dist/types/components/Attachment/Giphy.d.ts.map +1 -1
- package/dist/types/components/Attachment/giphyAccessibility.d.ts +11 -0
- package/dist/types/components/Attachment/giphyAccessibility.d.ts.map +1 -0
- package/dist/types/components/AudioPlayback/WithAudioPlayback.d.ts.map +1 -1
- package/dist/types/components/ChannelList/ChannelList.d.ts.map +1 -1
- package/dist/types/components/ChannelList/ChannelListUI.d.ts.map +1 -1
- package/dist/types/components/ChannelList/hooks/index.d.ts +1 -0
- package/dist/types/components/ChannelList/hooks/index.d.ts.map +1 -1
- package/dist/types/components/ChannelList/hooks/useChannelListKeyboardNavigation.d.ts +17 -0
- package/dist/types/components/ChannelList/hooks/useChannelListKeyboardNavigation.d.ts.map +1 -0
- package/dist/types/components/ChannelListItem/ChannelListItem.d.ts +7 -0
- package/dist/types/components/ChannelListItem/ChannelListItem.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/ChannelListItemActionButtons.defaults.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/ChannelListItemUI.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/index.d.ts +1 -0
- package/dist/types/components/ChannelListItem/index.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/utils.a11y.d.ts +112 -0
- package/dist/types/components/ChannelListItem/utils.a11y.d.ts.map +1 -0
- package/dist/types/components/ChannelListItem/utils.d.ts +10 -2
- package/dist/types/components/ChannelListItem/utils.d.ts.map +1 -1
- package/dist/types/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/components/ChatView/ChatView.a11y.utility.d.ts +9 -17
- package/dist/types/components/ChatView/ChatView.a11y.utility.d.ts.map +1 -1
- package/dist/types/components/ChatView/ChatView.d.ts +7 -7
- package/dist/types/components/ChatView/ChatView.d.ts.map +1 -1
- package/dist/types/components/Dialog/components/ContextMenu.d.ts +17 -2
- package/dist/types/components/Dialog/components/ContextMenu.d.ts.map +1 -1
- package/dist/types/components/Dialog/components/Prompt.d.ts.map +1 -1
- package/dist/types/components/Dialog/service/DialogAnchor.d.ts.map +1 -1
- package/dist/types/components/Form/SwitchField.d.ts.map +1 -1
- package/dist/types/components/Form/TextInput.d.ts.map +1 -1
- package/dist/types/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts +7 -0
- package/dist/types/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts.map +1 -1
- package/dist/types/components/MediaRecorder/hooks/useMediaRecorder.d.ts +2 -2
- package/dist/types/components/MediaRecorder/hooks/useMediaRecorder.d.ts.map +1 -1
- package/dist/types/components/MessageActions/DownloadSubmenu.d.ts.map +1 -1
- package/dist/types/components/MessageActions/RemindMeSubmenu.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentSelector/AttachmentSelector.d.ts +8 -2
- package/dist/types/components/MessageComposer/AttachmentSelector/AttachmentSelector.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentSelector/CommandsMenu.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/CommandChip.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/MessageComposerActions.d.ts.map +1 -1
- package/dist/types/components/MessageList/MessageList.d.ts.map +1 -1
- package/dist/types/components/MessageList/VirtualizedMessageList.d.ts.map +1 -1
- package/dist/types/components/Modal/GlobalModal.d.ts +6 -1
- package/dist/types/components/Modal/GlobalModal.d.ts.map +1 -1
- package/dist/types/components/Notifications/Notification.d.ts.map +1 -1
- package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts +7 -0
- package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts.map +1 -1
- package/dist/types/components/Poll/PollCreationDialog/NameField.d.ts.map +1 -1
- package/dist/types/components/Poll/PollCreationDialog/OptionFieldSet.d.ts.map +1 -1
- package/dist/types/components/Poll/PollCreationDialog/PollCreationDialog.d.ts.map +1 -1
- package/dist/types/components/Poll/PollCreationDialog/PollCreationDialogControls.d.ts.map +1 -1
- package/dist/types/components/Poll/PollCreationDialog/PollOptionReorderHandle.d.ts +17 -0
- package/dist/types/components/Poll/PollCreationDialog/PollOptionReorderHandle.d.ts.map +1 -0
- package/dist/types/components/Search/Search.d.ts +9 -1
- package/dist/types/components/Search/Search.d.ts.map +1 -1
- package/dist/types/components/Search/SearchBar/SearchBar.d.ts.map +1 -1
- package/dist/types/components/Search/SearchContext.d.ts +1 -1
- package/dist/types/components/Search/SearchContext.d.ts.map +1 -1
- package/dist/types/components/Search/SearchResults/SearchResults.d.ts.map +1 -1
- package/dist/types/components/Search/SearchResults/SearchSourceResultListFooter.d.ts.map +1 -1
- package/dist/types/components/Search/hooks/index.d.ts +2 -0
- package/dist/types/components/Search/hooks/index.d.ts.map +1 -1
- package/dist/types/components/Search/hooks/useAnnounceSearchResultCount.d.ts +27 -0
- package/dist/types/components/Search/hooks/useAnnounceSearchResultCount.d.ts.map +1 -0
- package/dist/types/components/Search/hooks/useSearchResultsKeyboardNavigation.d.ts +13 -0
- package/dist/types/components/Search/hooks/useSearchResultsKeyboardNavigation.d.ts.map +1 -0
- package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/UserItem.d.ts.map +1 -1
- package/dist/types/components/TextareaComposer/SuggestionList/SuggestionList.d.ts +21 -1
- package/dist/types/components/TextareaComposer/SuggestionList/SuggestionList.d.ts.map +1 -1
- package/dist/types/components/TextareaComposer/TextareaComposer.d.ts +9 -1
- package/dist/types/components/TextareaComposer/TextareaComposer.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadList.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadListItemUI.d.ts +7 -1
- package/dist/types/components/Threads/ThreadList/ThreadListItemUI.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/index.d.ts +1 -0
- package/dist/types/components/Threads/ThreadList/index.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/utils.a11y.d.ts +111 -0
- package/dist/types/components/Threads/ThreadList/utils.a11y.d.ts.map +1 -0
- package/dist/types/components/Threads/UnreadCountBadge.d.ts.map +1 -1
- package/dist/types/components/UtilityComponents/hooks/useMutationObserver.d.ts +23 -0
- package/dist/types/components/UtilityComponents/hooks/useMutationObserver.d.ts.map +1 -0
- package/dist/types/context/ComponentContext.d.ts +2 -0
- package/dist/types/context/ComponentContext.d.ts.map +1 -1
- package/dist/types/i18n/Streami18n.d.ts +79 -13
- package/dist/types/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +4 -1
- package/dist/cjs/useChannelHeaderOnlineStatus.d39ede24.js.map +0 -1
- package/dist/cjs/useNotificationApi.87ba0b39.js.map +0 -1
- package/dist/es/useChannelHeaderOnlineStatus.b3a51ca7.mjs.map +0 -1
- package/dist/es/useNotificationApi.eff88f29.mjs.map +0 -1
- package/dist/types/components/Accessibility/AriaLiveRegion.d.ts +0 -3
- package/dist/types/components/Accessibility/AriaLiveRegion.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_useNotificationApi = require("./useNotificationApi.
|
|
1
|
+
const require_useNotificationApi = require("./useNotificationApi.bf76a16b.js");
|
|
2
2
|
let react = require("react");
|
|
3
3
|
react = require_useNotificationApi.__toESM(react);
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -96,4 +96,4 @@ Object.defineProperty(exports, "useMessageComposerController", {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
//# sourceMappingURL=useMessageComposerController.
|
|
99
|
+
//# sourceMappingURL=useMessageComposerController.f8f20e3d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessageComposerController.
|
|
1
|
+
{"version":3,"file":"useMessageComposerController.f8f20e3d.js","names":[],"sources":["../../src/context/MessageComposerContext.tsx","../../src/components/MessageComposer/hooks/useIsCooldownActive.ts","../../src/components/MessageComposer/hooks/useMessageComposerController.ts"],"sourcesContent":["import React, { createContext, useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport type { MessageComposerProps } from '../components/MessageComposer';\nimport type { UseMessageComposerBindingsParams } from '../components/MessageComposer/hooks/useMessageComposerBindings';\n\nexport type MessageComposerContextValue = UseMessageComposerBindingsParams &\n Omit<MessageComposerProps, 'Input'>;\n\nexport const MessageComposerContext = createContext<\n UseMessageComposerBindingsParams | undefined\n>(undefined);\n\nexport const MessageComposerContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value: MessageComposerContextValue;\n}>) => (\n <MessageComposerContext.Provider\n value={value as unknown as MessageComposerContextValue}\n >\n {children}\n </MessageComposerContext.Provider>\n);\n\nexport const useMessageComposerContext = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n componentName?: string,\n) => {\n const contextValue = useContext(MessageComposerContext);\n\n if (!contextValue) {\n return {} as MessageComposerContextValue;\n }\n\n return contextValue as unknown as MessageComposerContextValue;\n};\n","import { useChannelStateContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport type { CooldownTimerState } from 'stream-chat';\n\nconst cooldownTimerStateSelector = (state: CooldownTimerState) => ({\n isCooldownActive: !!state.cooldownRemaining,\n});\n\nexport const useIsCooldownActive = () => {\n const { channel } = useChannelStateContext();\n return useStateStore(channel.cooldownTimer.state, cooldownTimerStateSelector)\n .isCooldownActive;\n};\n","import { useEffect, useMemo } from 'react';\nimport { MessageComposer as MessageComposerController } from 'stream-chat';\nimport { useThreadContext } from '../../Threads';\nimport { useChannelStateContext, useChatContext } from '../../../context';\nimport { useLegacyThreadContext } from '../../Thread';\n\nexport const useMessageComposerController = () => {\n const { client } = useChatContext();\n const { messageComposerCache: queueCache } = client;\n const { channel } = useChannelStateContext();\n const { legacyThread: parentMessage } = useLegacyThreadContext();\n const threadInstance = useThreadContext();\n\n const cachedParentMessage = useMemo(() => {\n if (!parentMessage) return undefined;\n\n return parentMessage;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [parentMessage?.id]);\n\n // composer hierarchy\n // edited message (always new) -> thread instance (own) -> thread message (always new) -> channel (own)\n // editedMessage ?? thread ?? parentMessage ?? channel;\n const messageComposer = useMemo(() => {\n if (threadInstance) {\n return threadInstance.messageComposer;\n } else if (cachedParentMessage) {\n const compositionContext = {\n ...cachedParentMessage,\n legacyThreadId: cachedParentMessage.id,\n };\n\n const tag = MessageComposerController.constructTag(compositionContext);\n\n const cachedComposer = queueCache.get(tag);\n if (cachedComposer) return cachedComposer;\n\n return new MessageComposerController({\n client,\n compositionContext,\n });\n } else {\n return channel.messageComposer;\n }\n }, [cachedParentMessage, channel, client, queueCache, threadInstance]);\n\n if (\n (['legacy_thread', 'message'] as MessageComposerController['contextType'][]).includes(\n messageComposer.contextType,\n ) &&\n !queueCache.peek(messageComposer.tag)\n ) {\n queueCache.add(messageComposer.tag, messageComposer);\n }\n\n useEffect(() => {\n const unsubscribe = messageComposer.registerSubscriptions();\n return () => {\n unsubscribe();\n };\n }, [messageComposer]);\n\n return messageComposer;\n};\n"],"mappings":";;;;;;AASA,IAAa,0BAAA,GAAA,MAAA,cAAA,CAEX,KAAA,CAAS;AAEX,IAAa,kCAAkC,EAC7C,UACA,YAIA,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAuB,UAAxB;CACS;CAEN;AAC8B,CAAA;AAGnC,IAAa,6BAEX,kBACG;CACH,MAAM,gBAAA,GAAA,MAAA,WAAA,CAA0B,sBAAsB;CAEtD,IAAI,CAAC,cACH,OAAO,CAAC;CAGV,OAAO;AACT;;;ACjCA,IAAM,8BAA8B,WAA+B,EACjE,kBAAkB,CAAC,CAAC,MAAM,kBAC5B;AAEA,IAAa,4BAA4B;CACvC,MAAM,EAAE,YAAY,2BAAA,uBAAuB;CAC3C,OAAO,2BAAA,cAAc,QAAQ,cAAc,OAAO,0BAA0B,CAAC,CAC1E;AACL;;;ACNA,IAAa,qCAAqC;CAChD,MAAM,EAAE,WAAW,2BAAA,eAAe;CAClC,MAAM,EAAE,sBAAsB,eAAe;CAC7C,MAAM,EAAE,YAAY,2BAAA,uBAAuB;CAC3C,MAAM,EAAE,cAAc,kBAAkB,2BAAA,uBAAuB;CAC/D,MAAM,iBAAiB,2BAAA,iBAAiB;CAExC,MAAM,uBAAA,GAAA,MAAA,QAAA,OAAoC;EACxC,IAAI,CAAC,eAAe,OAAO,KAAA;EAE3B,OAAO;CAET,GAAG,CAAC,eAAe,EAAE,CAAC;CAKtB,MAAM,mBAAA,GAAA,MAAA,QAAA,OAAgC;EACpC,IAAI,gBACF,OAAO,eAAe;OACjB,IAAI,qBAAqB;GAC9B,MAAM,qBAAqB;IACzB,GAAG;IACH,gBAAgB,oBAAoB;GACtC;GAEA,MAAM,MAAM,YAAA,gBAA0B,aAAa,kBAAkB;GAErE,MAAM,iBAAiB,WAAW,IAAI,GAAG;GACzC,IAAI,gBAAgB,OAAO;GAE3B,OAAO,IAAI,YAAA,gBAA0B;IACnC;IACA;GACF,CAAC;EACH,OACE,OAAO,QAAQ;CAEnB,GAAG;EAAC;EAAqB;EAAS;EAAQ;EAAY;CAAc,CAAC;CAErE,IACG,CAAC,iBAAiB,SAAS,CAAC,CAAgD,SAC3E,gBAAgB,WAClB,KACA,CAAC,WAAW,KAAK,gBAAgB,GAAG,GAEpC,WAAW,IAAI,gBAAgB,KAAK,eAAe;CAGrD,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,MAAM,cAAc,gBAAgB,sBAAsB;EAC1D,aAAa;GACX,YAAY;EACd;CACF,GAAG,CAAC,eAAe,CAAC;CAEpB,OAAO;AACT"}
|
|
@@ -697,6 +697,92 @@ var useTypingContext = (componentName) => {
|
|
|
697
697
|
return contextValue;
|
|
698
698
|
};
|
|
699
699
|
//#endregion
|
|
700
|
+
//#region src/components/Accessibility/useAriaLiveAnnouncer.ts
|
|
701
|
+
var noopAnnounce = () => () => void 0;
|
|
702
|
+
var AriaLiveAnnouncerContext = (0, react.createContext)(void 0);
|
|
703
|
+
var useAriaLiveAnnouncer = () => {
|
|
704
|
+
const contextValue = (0, react.useContext)(AriaLiveAnnouncerContext);
|
|
705
|
+
if (!contextValue) {
|
|
706
|
+
console.warn("The useAriaLiveAnnouncer hook was called outside of an AriaLiveAnnouncerProvider.");
|
|
707
|
+
return noopAnnounce;
|
|
708
|
+
}
|
|
709
|
+
return contextValue.announce;
|
|
710
|
+
};
|
|
711
|
+
//#endregion
|
|
712
|
+
//#region src/components/Accessibility/scheduling/useDebouncedAnnounce.ts
|
|
713
|
+
/**
|
|
714
|
+
* L2 scheduling policy: a per-key debounce over the provided `announce` (from
|
|
715
|
+
* `useAriaLiveAnnouncer`). Keeps an independent timer per `key` and takes the delay per call, so
|
|
716
|
+
* distinct rapidly-updating streams can coexist with different debounce windows without clobbering
|
|
717
|
+
* one another (e.g. the autocomplete count, which is a consequence of typing and wants a longer
|
|
718
|
+
* window to clear the screen reader's typing echo, vs. some other future debounced stream). For a
|
|
719
|
+
* single stream, use a constant key.
|
|
720
|
+
*
|
|
721
|
+
* React 17/18/19 compatible — `useCallback`/`useRef`/`useEffect` only. All pending timers are
|
|
722
|
+
* cleared on unmount.
|
|
723
|
+
*
|
|
724
|
+
* ## When to use this vs. {@link useSettledAnnouncement}
|
|
725
|
+
*
|
|
726
|
+
* Both wait out screen-reader noise (the typing echo / field re-read) before speaking, but they
|
|
727
|
+
* model different problems:
|
|
728
|
+
*
|
|
729
|
+
* - **`useDebouncedAnnounce` — an imperative throttle for a value you announce REPEATEDLY.** You
|
|
730
|
+
* call `announce(key, message, ...)` yourself whenever you have a fresh value (from an event
|
|
731
|
+
* handler or effect); rapid calls on a key collapse to the last one. The message typically
|
|
732
|
+
* *changes* each time, it can fire *again and again* (once per pause), and you drive it. Canonical
|
|
733
|
+
* case: the autocomplete result count re-announced as the user keeps typing. It has no notion of
|
|
734
|
+
* "active", "once", or re-arming — it just throttles whatever you push through it.
|
|
735
|
+
*
|
|
736
|
+
* - **{@link useSettledAnnouncement} — a declarative ONE-SHOT cue for a state change.** You pass
|
|
737
|
+
* `{ active, message, settleKey }`; it announces *once* when `active`, deferred until `settleKey`
|
|
738
|
+
* stops changing, then stays silent until `active` flips back and forth. The message is fixed and
|
|
739
|
+
* the point is "say this single fact once the UI settles", not "announce the latest value".
|
|
740
|
+
*
|
|
741
|
+
* | | `useDebouncedAnnounce` | `useSettledAnnouncement` |
|
|
742
|
+
* | --- | --- | --- |
|
|
743
|
+
* | Style | Imperative — you call `announce(key, …)` | Declarative — reacts to `{ active, message, settleKey }` |
|
|
744
|
+
* | Repetition | Fires repeatedly, once per pause | Once per `active` epoch (re-arms on reset) |
|
|
745
|
+
* | Message | Typically changes each time | Fixed fact |
|
|
746
|
+
* | Timer reset | Each explicit call | Each `settleKey` change |
|
|
747
|
+
* | Streams | Many, independent per `key` | One logical cue |
|
|
748
|
+
* | Canonical case | Autocomplete count while typing | "Controls just became available" |
|
|
749
|
+
*
|
|
750
|
+
* Rule of thumb: announcing the **latest value of a changing thing** → this hook. Announcing a
|
|
751
|
+
* **fixed fact once, after things settle** → `useSettledAnnouncement`.
|
|
752
|
+
*/
|
|
753
|
+
var useDebouncedAnnounce = (announce) => {
|
|
754
|
+
const timersRef = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
755
|
+
const announceRef = (0, react.useRef)(announce);
|
|
756
|
+
announceRef.current = announce;
|
|
757
|
+
const cancel = (0, react.useCallback)((key) => {
|
|
758
|
+
const timers = timersRef.current;
|
|
759
|
+
if (key === void 0) {
|
|
760
|
+
timers.forEach((timerId) => clearTimeout(timerId));
|
|
761
|
+
timers.clear();
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
const timerId = timers.get(key);
|
|
765
|
+
if (timerId !== void 0) {
|
|
766
|
+
clearTimeout(timerId);
|
|
767
|
+
timers.delete(key);
|
|
768
|
+
}
|
|
769
|
+
}, []);
|
|
770
|
+
(0, react.useEffect)(() => () => cancel(), [cancel]);
|
|
771
|
+
return {
|
|
772
|
+
announce: (0, react.useCallback)((key, message, delayMs, priority) => {
|
|
773
|
+
const timers = timersRef.current;
|
|
774
|
+
const existing = timers.get(key);
|
|
775
|
+
if (existing !== void 0) clearTimeout(existing);
|
|
776
|
+
const timerId = setTimeout(() => {
|
|
777
|
+
timers.delete(key);
|
|
778
|
+
announceRef.current(message, { priority });
|
|
779
|
+
}, delayMs);
|
|
780
|
+
timers.set(key, timerId);
|
|
781
|
+
}, []),
|
|
782
|
+
cancel
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
//#endregion
|
|
700
786
|
//#region src/components/Notifications/notificationTarget.ts
|
|
701
787
|
var NOTIFICATION_TARGET_PANELS = [
|
|
702
788
|
"channel",
|
|
@@ -2722,6 +2808,168 @@ var audioPlayerNotificationsPluginFactory = ({ addNotification, panel = "channel
|
|
|
2722
2808
|
};
|
|
2723
2809
|
};
|
|
2724
2810
|
//#endregion
|
|
2811
|
+
//#region src/components/Accessibility/hooks/useInteractionAnnouncements.ts
|
|
2812
|
+
/**
|
|
2813
|
+
* One entry per interaction — the single place an interaction is registered. Each
|
|
2814
|
+
* resolver contains a LITERAL `t('aria/…')` call so that `i18next-cli extract`
|
|
2815
|
+
* (run via `yarn build-translations`) discovers and generates the key across all
|
|
2816
|
+
* locales. Keys must never be built dynamically (e.g. `t(someVariable)`) or
|
|
2817
|
+
* extraction silently misses them. Adding an interaction = one line here + one
|
|
2818
|
+
* line in {@link InteractionAnnouncementParams} (+ an override in
|
|
2819
|
+
* {@link INTERACTION_PRIORITIES} only if it is not `polite`).
|
|
2820
|
+
*/
|
|
2821
|
+
var INTERACTION_MESSAGES = {
|
|
2822
|
+
"audioPlayer.playbackRateChanged": (t, params) => t("Playback speed {{ rate }}x", { rate: params.rate }),
|
|
2823
|
+
"channel.opened": (t, params) => t("aria/Opened channel: {{ name }}", { name: params.name }),
|
|
2824
|
+
"command.selected": (t, params) => t("aria/Command activated: {{ command }}", { command: params.command }),
|
|
2825
|
+
"giphy.canceled": (t) => t("aria/Giphy canceled"),
|
|
2826
|
+
"giphy.sent": (t) => t("aria/Giphy sent"),
|
|
2827
|
+
"giphy.shuffled": (t, params) => params.title ? t("aria/Giphy image changed: {{ title }}", { title: params.title }) : t("aria/Giphy image changed"),
|
|
2828
|
+
"poll.dialogOpened": (t) => `${t("aria/Poll dialog opened")}. ${t("Create a question, add options, and configure poll settings")}. ${t("aria/Press Enter to start typing")}.`,
|
|
2829
|
+
"poll.optionDropped": (t, params) => t("aria/Dropped \"{{ option }}\" at position {{ position }}.", {
|
|
2830
|
+
option: params.option,
|
|
2831
|
+
position: params.position
|
|
2832
|
+
}),
|
|
2833
|
+
"poll.optionPickedUp": (t, params) => t("aria/Picked up \"{{ option }}\". Use arrow keys to reorder. Press Space or Tab to drop.", { option: params.option }),
|
|
2834
|
+
"poll.optionRemoved": (t, params) => t("aria/Removed option {{ option }}", { option: params.option }),
|
|
2835
|
+
"poll.sent": (t) => t("aria/Poll sent"),
|
|
2836
|
+
"search.cleared": (t) => t("aria/Search cleared"),
|
|
2837
|
+
"search.resultCount": (t, params) => {
|
|
2838
|
+
if (params.count <= 0) return t("aria/No search results found");
|
|
2839
|
+
const count = t("aria/{{ count }} search results", { count: params.count });
|
|
2840
|
+
return params.allResultsLoaded ? `${count}. ${t("All results loaded")}` : count;
|
|
2841
|
+
},
|
|
2842
|
+
"suggestions.count": (t, params) => params.suggestionsLabel ? t("aria/{{ count }} {{ suggestionsLabel }}", {
|
|
2843
|
+
count: params.count,
|
|
2844
|
+
suggestionsLabel: params.suggestionsLabel
|
|
2845
|
+
}) : t("aria/{{ count }} suggestions", { count: params.count }),
|
|
2846
|
+
"thread.opened": (t, params) => t("aria/Opened thread in {{ name }}", { name: params.name }),
|
|
2847
|
+
"user.selected": (t, params) => t("aria/User selected: {{ user }}", { user: params.user }),
|
|
2848
|
+
"voiceRecording.attached": (t) => t("aria/Voice recording attached"),
|
|
2849
|
+
"voiceRecording.paused": (t) => t("aria/Recording paused"),
|
|
2850
|
+
"voiceRecording.resumed": (t) => t("aria/Recording resumed"),
|
|
2851
|
+
"voiceRecording.sent": (t) => t("aria/Voice message sent"),
|
|
2852
|
+
"voiceRecording.started": (t) => t("aria/Recording started")
|
|
2853
|
+
};
|
|
2854
|
+
/**
|
|
2855
|
+
* Per-interaction aria-live priority. Interactions default to `polite`; list one
|
|
2856
|
+
* here only to override it (e.g. with `assertive`).
|
|
2857
|
+
*/
|
|
2858
|
+
var INTERACTION_PRIORITIES = {
|
|
2859
|
+
"poll.dialogOpened": "assertive",
|
|
2860
|
+
"poll.optionDropped": "assertive",
|
|
2861
|
+
"poll.optionPickedUp": "assertive"
|
|
2862
|
+
};
|
|
2863
|
+
/**
|
|
2864
|
+
* Per-interaction dedupe window (ms): an identical message for this interaction is announced at
|
|
2865
|
+
* most once per window (see {@link AriaLiveAnnounceOptions.dedupeMs}). List an interaction here
|
|
2866
|
+
* only when the SAME open/mount can fire it more than once in quick succession — e.g. a mount
|
|
2867
|
+
* effect double-invoked by React StrictMode (dev) — so the user does not hear a duplicate.
|
|
2868
|
+
*/
|
|
2869
|
+
var INTERACTION_DEDUPE_MS = {
|
|
2870
|
+
"audioPlayer.playbackRateChanged": 300,
|
|
2871
|
+
"poll.dialogOpened": 1e3
|
|
2872
|
+
};
|
|
2873
|
+
/**
|
|
2874
|
+
* Default per-interaction debounce delay (ms). Only list rapidly-updating streams where just the
|
|
2875
|
+
* settled value should be read (e.g. the autocomplete count as the query filters). Discrete
|
|
2876
|
+
* confirmations (Giphy/Poll sent, user selected) are NOT listed and announce immediately. A call
|
|
2877
|
+
* site can override (or opt into) a delay for a single call via `params.debounceMs` — see
|
|
2878
|
+
* {@link InteractionDeliveryOptions}.
|
|
2879
|
+
*
|
|
2880
|
+
* `suggestions.count` is a CONSEQUENCE OF TYPING, so the delay does double duty: it coalesces
|
|
2881
|
+
* rapid filters into the settled value AND lets the screen reader's per-keystroke typing echo
|
|
2882
|
+
* (the spoken character + field re-read) finish first. A polite update that lands mid-echo gets
|
|
2883
|
+
* queued behind a long re-read and is perceived as buried; waiting past the echo makes the count
|
|
2884
|
+
* the next thing spoken once the user pauses. This is a heuristic — echo length varies with the
|
|
2885
|
+
* SR's "speak typed words/characters" setting and field content — so tune if it still collides.
|
|
2886
|
+
*/
|
|
2887
|
+
var INTERACTION_DEBOUNCE_MS = {
|
|
2888
|
+
"search.resultCount": 1e3,
|
|
2889
|
+
"suggestions.count": 500
|
|
2890
|
+
};
|
|
2891
|
+
/**
|
|
2892
|
+
* Default per-interaction delay (ms) for the immediate (non-debounced) path — a single deferred
|
|
2893
|
+
* emit scheduled in the announcer PROVIDER (see {@link AriaLiveAnnounceOptions.delayMs}), so it
|
|
2894
|
+
* SURVIVES the calling component unmounting (unlike a debounce, whose timer is cleared on unmount).
|
|
2895
|
+
*
|
|
2896
|
+
* Opening a channel/thread moves focus to the (auto-focusing) message composer; the screen reader
|
|
2897
|
+
* announces that newly-focused element first, and a live-region message emitted alongside it is
|
|
2898
|
+
* superseded and dropped. The delay defers the confirmation past that focus read-out so it is spoken
|
|
2899
|
+
* next, in a calm moment. It is a provider delay rather than a debounce specifically because
|
|
2900
|
+
* selecting the item can unmount its list row (and the whole list, on mobile) — a per-row debounce
|
|
2901
|
+
* would be cancelled mid-flight, swallowing the confirmation.
|
|
2902
|
+
*/
|
|
2903
|
+
var INTERACTION_DELAY_MS = {
|
|
2904
|
+
"channel.opened": 1500,
|
|
2905
|
+
"command.selected": 1500,
|
|
2906
|
+
"thread.opened": 1500
|
|
2907
|
+
};
|
|
2908
|
+
/**
|
|
2909
|
+
* Thin, typed wrapper over the aria-live announcer exposing intention-revealing
|
|
2910
|
+
* helpers for transient, user-initiated UI interactions (e.g. a Giphy being
|
|
2911
|
+
* sent, a poll being created, a mention being picked). They map to i18n keys with
|
|
2912
|
+
* baked-in priorities and reuse the existing live region via
|
|
2913
|
+
* {@link useAriaLiveAnnouncer}. New interactions are registered as a single entry
|
|
2914
|
+
* in {@link INTERACTION_MESSAGES}.
|
|
2915
|
+
*/
|
|
2916
|
+
var useInteractionAnnouncements = () => {
|
|
2917
|
+
const announce = useAriaLiveAnnouncer();
|
|
2918
|
+
const { t } = useTranslationContext();
|
|
2919
|
+
const { announce: announceDebounced, cancel: cancelDebounced } = useDebouncedAnnounce(announce);
|
|
2920
|
+
const pendingImmediateCancelsRef = (0, react.useRef)({});
|
|
2921
|
+
return (0, react.useMemo)(() => ({
|
|
2922
|
+
announceInteraction: (interaction, params) => {
|
|
2923
|
+
const resolveMessage = INTERACTION_MESSAGES[interaction];
|
|
2924
|
+
if (!resolveMessage) return;
|
|
2925
|
+
const message = resolveMessage(t, params);
|
|
2926
|
+
const priority = INTERACTION_PRIORITIES[interaction] ?? "polite";
|
|
2927
|
+
const debounceMs = params?.debounceMs ?? INTERACTION_DEBOUNCE_MS[interaction];
|
|
2928
|
+
if (debounceMs === void 0) {
|
|
2929
|
+
const delayMs = params?.delayMs ?? INTERACTION_DELAY_MS[interaction];
|
|
2930
|
+
pendingImmediateCancelsRef.current[interaction]?.();
|
|
2931
|
+
pendingImmediateCancelsRef.current[interaction] = announce(message, {
|
|
2932
|
+
dedupeMs: INTERACTION_DEDUPE_MS[interaction],
|
|
2933
|
+
delayMs,
|
|
2934
|
+
priority
|
|
2935
|
+
});
|
|
2936
|
+
return;
|
|
2937
|
+
}
|
|
2938
|
+
announceDebounced(interaction, message, debounceMs, priority);
|
|
2939
|
+
},
|
|
2940
|
+
cancelInteraction: (interaction) => {
|
|
2941
|
+
cancelDebounced(interaction);
|
|
2942
|
+
const pending = pendingImmediateCancelsRef.current;
|
|
2943
|
+
if (interaction) {
|
|
2944
|
+
pending[interaction]?.();
|
|
2945
|
+
delete pending[interaction];
|
|
2946
|
+
} else {
|
|
2947
|
+
Object.values(pending).forEach((cancel) => cancel?.());
|
|
2948
|
+
pendingImmediateCancelsRef.current = {};
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
}), [
|
|
2952
|
+
announce,
|
|
2953
|
+
announceDebounced,
|
|
2954
|
+
cancelDebounced,
|
|
2955
|
+
t
|
|
2956
|
+
]);
|
|
2957
|
+
};
|
|
2958
|
+
//#endregion
|
|
2959
|
+
//#region src/components/Accessibility/hooks/useAudioPlaybackChangeAnnouncements.ts
|
|
2960
|
+
var playbackRateSelector = (state) => ({ currentPlaybackRate: state.currentPlaybackRate });
|
|
2961
|
+
var useAudioPlaybackChangeAnnouncements = (audioPlayer) => {
|
|
2962
|
+
const { announceInteraction } = useInteractionAnnouncements();
|
|
2963
|
+
const { currentPlaybackRate } = useStateStore(audioPlayer?.state, playbackRateSelector) ?? {};
|
|
2964
|
+
const previousPlaybackRateRef = (0, react.useRef)(currentPlaybackRate);
|
|
2965
|
+
(0, react.useEffect)(() => {
|
|
2966
|
+
const previous = previousPlaybackRateRef.current;
|
|
2967
|
+
previousPlaybackRateRef.current = currentPlaybackRate;
|
|
2968
|
+
if (currentPlaybackRate === void 0 || previous === void 0 || previous === currentPlaybackRate) return;
|
|
2969
|
+
announceInteraction("audioPlayer.playbackRateChanged", { rate: currentPlaybackRate });
|
|
2970
|
+
}, [announceInteraction, currentPlaybackRate]);
|
|
2971
|
+
};
|
|
2972
|
+
//#endregion
|
|
2725
2973
|
//#region src/components/AudioPlayback/WithAudioPlayback.tsx
|
|
2726
2974
|
var AudioPlayerContext = react.default.createContext({ audioPlayers: null });
|
|
2727
2975
|
var WithAudioPlayback = ({ allowConcurrentPlayback, children }) => {
|
|
@@ -2754,6 +3002,7 @@ var useAudioPlayer = ({ durationSeconds, fileSize, mimeType, playbackRates, plug
|
|
|
2754
3002
|
title,
|
|
2755
3003
|
waveformData
|
|
2756
3004
|
}) : void 0;
|
|
3005
|
+
useAudioPlaybackChangeAnnouncements(audioPlayer);
|
|
2757
3006
|
(0, react.useEffect)(() => {
|
|
2758
3007
|
if (!audioPlayer) return;
|
|
2759
3008
|
/**
|
|
@@ -3848,32 +4097,21 @@ var ThreadProvider = ({ children, thread }) => /* @__PURE__ */ (0, react_jsx_run
|
|
|
3848
4097
|
var UnreadCountBadge = ({ children, count, position }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3849
4098
|
className: "str-chat__unread-count-badge-container",
|
|
3850
4099
|
children: [children, count > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4100
|
+
"aria-hidden": "true",
|
|
3851
4101
|
className: (0, clsx.default)("str-chat__unread-count-badge", position && `str-chat__unread-count-badge--${position}`),
|
|
3852
4102
|
children: count
|
|
3853
4103
|
})]
|
|
3854
4104
|
});
|
|
3855
4105
|
//#endregion
|
|
3856
4106
|
//#region src/components/ChatView/ChatView.a11y.utility.ts
|
|
3857
|
-
var DEFAULT_CHAT_VIEW_A11Y_CONTEXT_VALUE = {
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
}
|
|
3866
|
-
};
|
|
3867
|
-
var createChatViewA11yContextValue = (chatViewId) => ({
|
|
3868
|
-
chatViewPanelIds: {
|
|
3869
|
-
channels: `str-chat__chat-view-${chatViewId}-panel-channels`,
|
|
3870
|
-
threads: `str-chat__chat-view-${chatViewId}-panel-threads`
|
|
3871
|
-
},
|
|
3872
|
-
chatViewTabIds: {
|
|
3873
|
-
channels: `str-chat__chat-view-${chatViewId}-tab-channels`,
|
|
3874
|
-
threads: `str-chat__chat-view-${chatViewId}-tab-threads`
|
|
3875
|
-
}
|
|
3876
|
-
});
|
|
4107
|
+
var DEFAULT_CHAT_VIEW_A11Y_CONTEXT_VALUE = { chatViewPanelIds: {
|
|
4108
|
+
channels: "str-chat__chat-view-panel-channels",
|
|
4109
|
+
threads: "str-chat__chat-view-panel-threads"
|
|
4110
|
+
} };
|
|
4111
|
+
var createChatViewA11yContextValue = (chatViewId) => ({ chatViewPanelIds: {
|
|
4112
|
+
channels: `str-chat__chat-view-${chatViewId}-panel-channels`,
|
|
4113
|
+
threads: `str-chat__chat-view-${chatViewId}-panel-threads`
|
|
4114
|
+
} });
|
|
3877
4115
|
//#endregion
|
|
3878
4116
|
//#region src/components/ChatView/ChatView.tsx
|
|
3879
4117
|
var ChatViewContext = (0, react.createContext)(void 0);
|
|
@@ -3909,13 +4147,11 @@ var ChatView = ({ children }) => {
|
|
|
3909
4147
|
};
|
|
3910
4148
|
var ChannelsView = ({ children }) => {
|
|
3911
4149
|
const { activeChatView } = useChatViewContext();
|
|
3912
|
-
const { chatViewPanelIds
|
|
4150
|
+
const { chatViewPanelIds } = useChatViewA11yContext();
|
|
3913
4151
|
if (!(activeChatView === "channels")) return null;
|
|
3914
4152
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3915
|
-
"aria-labelledby": chatViewTabIds.channels,
|
|
3916
4153
|
className: "str-chat__chat-view__channels",
|
|
3917
4154
|
id: chatViewPanelIds.channels,
|
|
3918
|
-
role: "tabpanel",
|
|
3919
4155
|
children
|
|
3920
4156
|
});
|
|
3921
4157
|
};
|
|
@@ -3926,7 +4162,7 @@ var ThreadsViewContext = (0, react.createContext)({
|
|
|
3926
4162
|
var useThreadsViewContext = () => (0, react.useContext)(ThreadsViewContext);
|
|
3927
4163
|
var ThreadsView = ({ children }) => {
|
|
3928
4164
|
const { activeChatView } = useChatViewContext();
|
|
3929
|
-
const { chatViewPanelIds
|
|
4165
|
+
const { chatViewPanelIds } = useChatViewA11yContext();
|
|
3930
4166
|
const [activeThread, setActiveThread] = (0, react.useState)(void 0);
|
|
3931
4167
|
const value = (0, react.useMemo)(() => ({
|
|
3932
4168
|
activeThread,
|
|
@@ -3936,10 +4172,8 @@ var ThreadsView = ({ children }) => {
|
|
|
3936
4172
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThreadsViewContext.Provider, {
|
|
3937
4173
|
value,
|
|
3938
4174
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3939
|
-
"aria-labelledby": chatViewTabIds.threads,
|
|
3940
4175
|
className: "str-chat__chat-view__threads",
|
|
3941
4176
|
id: chatViewPanelIds.threads,
|
|
3942
|
-
role: "tabpanel",
|
|
3943
4177
|
children
|
|
3944
4178
|
})
|
|
3945
4179
|
});
|
|
@@ -4005,9 +4239,9 @@ var ChatViewSelectorButton = ({ ActiveIcon, children, className, Icon, iconOnly
|
|
|
4005
4239
|
className: "str-chat__chat-view__selector-button-container",
|
|
4006
4240
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button, {
|
|
4007
4241
|
appearance: "ghost",
|
|
4242
|
+
"aria-current": isActive || void 0,
|
|
4008
4243
|
"aria-label": props["aria-label"] ?? (shouldShowTooltip ? text : void 0),
|
|
4009
4244
|
className: (0, clsx.default)("str-chat__chat-view__selector-button", className),
|
|
4010
|
-
role: "tab",
|
|
4011
4245
|
variant: "secondary",
|
|
4012
4246
|
...props,
|
|
4013
4247
|
children: [children ?? (SelectorIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectorIcon, {})), !iconOnly && text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -4028,20 +4262,16 @@ var threadAdapterSelector = ({ pagination, ready }) => ({
|
|
|
4028
4262
|
var unreadThreadCountSelector = ({ unreadThreadCount }) => ({ unreadThreadCount });
|
|
4029
4263
|
var ChatViewChannelsSelectorButton = ({ iconOnly = true }) => {
|
|
4030
4264
|
const { activeChatView, setActiveChatView } = useChatViewContext();
|
|
4031
|
-
const { chatViewPanelIds, chatViewTabIds } = useChatViewA11yContext();
|
|
4032
4265
|
const { t } = useTranslationContext();
|
|
4033
4266
|
const isActive = activeChatView === "channels";
|
|
4034
4267
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChatViewSelectorButton, {
|
|
4035
4268
|
ActiveIcon: IconMessageBubbleFill,
|
|
4036
|
-
"aria-
|
|
4037
|
-
"aria-selected": isActive,
|
|
4269
|
+
"aria-label": t("aria/Open channels view"),
|
|
4038
4270
|
Icon: IconMessageBubble,
|
|
4039
4271
|
iconOnly,
|
|
4040
|
-
id: chatViewTabIds.channels,
|
|
4041
4272
|
isActive,
|
|
4042
4273
|
onClick: () => setActiveChatView("channels"),
|
|
4043
4274
|
onPointerDown: () => setActiveChatView("channels"),
|
|
4044
|
-
tabIndex: 0,
|
|
4045
4275
|
text: t("Channels")
|
|
4046
4276
|
});
|
|
4047
4277
|
};
|
|
@@ -4049,20 +4279,16 @@ var ChatViewThreadsSelectorButton = ({ iconOnly = true }) => {
|
|
|
4049
4279
|
const { client } = useChatContext();
|
|
4050
4280
|
const { unreadThreadCount } = useStateStore(client.threads.state, unreadThreadCountSelector) ?? { unreadThreadCount: 0 };
|
|
4051
4281
|
const { activeChatView, setActiveChatView } = useChatViewContext();
|
|
4052
|
-
const { chatViewPanelIds, chatViewTabIds } = useChatViewA11yContext();
|
|
4053
4282
|
const { t } = useTranslationContext();
|
|
4054
4283
|
const isActive = activeChatView === "threads";
|
|
4055
4284
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChatViewSelectorButton, {
|
|
4056
4285
|
ActiveIcon: IconThreadFill,
|
|
4057
|
-
"aria-
|
|
4058
|
-
"aria-selected": isActive,
|
|
4286
|
+
"aria-label": unreadThreadCount > 0 ? t("aria/Open threads view with unread threads", { count: unreadThreadCount }) : t("aria/Open threads view"),
|
|
4059
4287
|
Icon: IconThread,
|
|
4060
4288
|
iconOnly,
|
|
4061
|
-
id: chatViewTabIds.threads,
|
|
4062
4289
|
isActive,
|
|
4063
4290
|
onClick: () => setActiveChatView("threads"),
|
|
4064
4291
|
onPointerDown: () => setActiveChatView("threads"),
|
|
4065
|
-
tabIndex: 0,
|
|
4066
4292
|
text: t("Threads"),
|
|
4067
4293
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnreadCountBadge, {
|
|
4068
4294
|
count: unreadThreadCount,
|
|
@@ -4081,9 +4307,9 @@ var defaultChatViewSelectorItemSet = [{
|
|
|
4081
4307
|
var ChatViewSelector = ({ iconOnly = true, itemSet = defaultChatViewSelectorItemSet }) => {
|
|
4082
4308
|
const { t } = useTranslationContext();
|
|
4083
4309
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4084
|
-
"aria-label": t("aria/Chat view
|
|
4310
|
+
"aria-label": t("aria/Chat view controls"),
|
|
4085
4311
|
className: "str-chat__chat-view__selector",
|
|
4086
|
-
role: "
|
|
4312
|
+
role: "navigation",
|
|
4087
4313
|
children: itemSet.map(({ Component, type }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, { iconOnly }, type))
|
|
4088
4314
|
});
|
|
4089
4315
|
};
|
|
@@ -4141,7 +4367,7 @@ var useNotificationApi = () => {
|
|
|
4141
4367
|
const inferredPanel = useNotificationTarget();
|
|
4142
4368
|
const modalManagerHasOpenDialog = useStateStore(useModalDialogManager()?.state, modalDialogManagerStateSelector)?.hasOpenDialog ?? false;
|
|
4143
4369
|
return {
|
|
4144
|
-
addNotification: (0, react.useCallback)(({ actions, context, duration, emitter, error, incident, message, severity, tags, targetPanels, type }) => {
|
|
4370
|
+
addNotification: (0, react.useCallback)(({ actions, ariaLive, context, duration, emitter, error, incident, message, severity, tags, targetPanels, type }) => {
|
|
4145
4371
|
const notificationTags = getTargetTags(targetPanels, inferredPanel, tags, modalManagerHasOpenDialog);
|
|
4146
4372
|
const resolvedType = getTypeFromIncident({
|
|
4147
4373
|
incident,
|
|
@@ -4156,6 +4382,7 @@ var useNotificationApi = () => {
|
|
|
4156
4382
|
...actions ? { actions } : {},
|
|
4157
4383
|
...typeof duration === "number" ? { duration } : {},
|
|
4158
4384
|
...error ? { originalError: error } : {},
|
|
4385
|
+
...ariaLive ? { metadata: { ariaLive } } : {},
|
|
4159
4386
|
...notificationTags.length > 0 ? { tags: notificationTags } : {},
|
|
4160
4387
|
...severity ? { severity } : {},
|
|
4161
4388
|
...resolvedType ? { type: resolvedType } : {}
|
|
@@ -4170,7 +4397,7 @@ var useNotificationApi = () => {
|
|
|
4170
4397
|
inferredPanel,
|
|
4171
4398
|
modalManagerHasOpenDialog
|
|
4172
4399
|
]),
|
|
4173
|
-
addSystemNotification: (0, react.useCallback)(({ actions, context, duration, emitter, error, incident, message, severity, tags, type }) => {
|
|
4400
|
+
addSystemNotification: (0, react.useCallback)(({ actions, ariaLive, context, duration, emitter, error, incident, message, severity, tags, type }) => {
|
|
4174
4401
|
const notificationTags = Array.from(/* @__PURE__ */ new Set([SYSTEM_NOTIFICATION_TAG, ...tags ?? []]));
|
|
4175
4402
|
const resolvedType = getTypeFromIncident({
|
|
4176
4403
|
incident,
|
|
@@ -4185,6 +4412,7 @@ var useNotificationApi = () => {
|
|
|
4185
4412
|
...actions ? { actions } : {},
|
|
4186
4413
|
...typeof duration === "number" ? { duration } : {},
|
|
4187
4414
|
...error ? { originalError: error } : {},
|
|
4415
|
+
...ariaLive ? { metadata: { ariaLive } } : {},
|
|
4188
4416
|
...notificationTags.length > 0 ? { tags: notificationTags } : {},
|
|
4189
4417
|
...severity ? { severity } : {},
|
|
4190
4418
|
...resolvedType ? { type: resolvedType } : {}
|
|
@@ -4210,6 +4438,12 @@ Object.defineProperty(exports, "ACTIONS_NOT_WORKING_IN_THREAD", {
|
|
|
4210
4438
|
return ACTIONS_NOT_WORKING_IN_THREAD;
|
|
4211
4439
|
}
|
|
4212
4440
|
});
|
|
4441
|
+
Object.defineProperty(exports, "AriaLiveAnnouncerContext", {
|
|
4442
|
+
enumerable: true,
|
|
4443
|
+
get: function() {
|
|
4444
|
+
return AriaLiveAnnouncerContext;
|
|
4445
|
+
}
|
|
4446
|
+
});
|
|
4213
4447
|
Object.defineProperty(exports, "AudioPlayer", {
|
|
4214
4448
|
enumerable: true,
|
|
4215
4449
|
get: function() {
|
|
@@ -5314,6 +5548,12 @@ Object.defineProperty(exports, "useActiveThread", {
|
|
|
5314
5548
|
return useActiveThread;
|
|
5315
5549
|
}
|
|
5316
5550
|
});
|
|
5551
|
+
Object.defineProperty(exports, "useAriaLiveAnnouncer", {
|
|
5552
|
+
enumerable: true,
|
|
5553
|
+
get: function() {
|
|
5554
|
+
return useAriaLiveAnnouncer;
|
|
5555
|
+
}
|
|
5556
|
+
});
|
|
5317
5557
|
Object.defineProperty(exports, "useAudioPlayer", {
|
|
5318
5558
|
enumerable: true,
|
|
5319
5559
|
get: function() {
|
|
@@ -5356,6 +5596,12 @@ Object.defineProperty(exports, "useComponentContext", {
|
|
|
5356
5596
|
return useComponentContext;
|
|
5357
5597
|
}
|
|
5358
5598
|
});
|
|
5599
|
+
Object.defineProperty(exports, "useDebouncedAnnounce", {
|
|
5600
|
+
enumerable: true,
|
|
5601
|
+
get: function() {
|
|
5602
|
+
return useDebouncedAnnounce;
|
|
5603
|
+
}
|
|
5604
|
+
});
|
|
5359
5605
|
Object.defineProperty(exports, "useDialog", {
|
|
5360
5606
|
enumerable: true,
|
|
5361
5607
|
get: function() {
|
|
@@ -5392,6 +5638,12 @@ Object.defineProperty(exports, "useEditMessageHandler", {
|
|
|
5392
5638
|
return useEditMessageHandler;
|
|
5393
5639
|
}
|
|
5394
5640
|
});
|
|
5641
|
+
Object.defineProperty(exports, "useInteractionAnnouncements", {
|
|
5642
|
+
enumerable: true,
|
|
5643
|
+
get: function() {
|
|
5644
|
+
return useInteractionAnnouncements;
|
|
5645
|
+
}
|
|
5646
|
+
});
|
|
5395
5647
|
Object.defineProperty(exports, "useLegacyThreadContext", {
|
|
5396
5648
|
enumerable: true,
|
|
5397
5649
|
get: function() {
|
|
@@ -5501,4 +5753,4 @@ Object.defineProperty(exports, "validateAndGetMessage", {
|
|
|
5501
5753
|
}
|
|
5502
5754
|
});
|
|
5503
5755
|
|
|
5504
|
-
//# sourceMappingURL=useNotificationApi.
|
|
5756
|
+
//# sourceMappingURL=useNotificationApi.bf76a16b.js.map
|