stream-chat-react 14.7.0 → 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 +2888 -730
- 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 +2868 -728
- 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/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/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
|
-
import {
|
|
1
|
+
import { Jr as useChatContext, R as useLegacyThreadContext, Vr as useStateStore, Zr as useChannelStateContext, g as useThreadContext } from "./useNotificationApi.ed6bff88.mjs";
|
|
2
2
|
import { createContext, useContext, useEffect, useMemo } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { MessageComposer } from "stream-chat";
|
|
@@ -66,4 +66,4 @@ var useMessageComposerController = () => {
|
|
|
66
66
|
//#endregion
|
|
67
67
|
export { useMessageComposerContext as a, MessageComposerContextProvider as i, useIsCooldownActive as n, MessageComposerContext as r, useMessageComposerController as t };
|
|
68
68
|
|
|
69
|
-
//# sourceMappingURL=useMessageComposerController.
|
|
69
|
+
//# sourceMappingURL=useMessageComposerController.d50f6168.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessageComposerController.
|
|
1
|
+
{"version":3,"file":"useMessageComposerController.d50f6168.mjs","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,yBAAyB,cAEpC,KAAA,CAAS;AAEX,IAAa,kCAAkC,EAC7C,UACA,YAIA,oBAAC,uBAAuB,UAAxB;CACS;CAEN;AAC8B,CAAA;AAGnC,IAAa,6BAEX,kBACG;CACH,MAAM,eAAe,WAAW,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,uBAAuB;CAC3C,OAAO,cAAc,QAAQ,cAAc,OAAO,0BAA0B,CAAC,CAC1E;AACL;;;ACNA,IAAa,qCAAqC;CAChD,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,sBAAsB,eAAe;CAC7C,MAAM,EAAE,YAAY,uBAAuB;CAC3C,MAAM,EAAE,cAAc,kBAAkB,uBAAuB;CAC/D,MAAM,iBAAiB,iBAAiB;CAExC,MAAM,sBAAsB,cAAc;EACxC,IAAI,CAAC,eAAe,OAAO,KAAA;EAE3B,OAAO;CAET,GAAG,CAAC,eAAe,EAAE,CAAC;CAKtB,MAAM,kBAAkB,cAAc;EACpC,IAAI,gBACF,OAAO,eAAe;OACjB,IAAI,qBAAqB;GAC9B,MAAM,qBAAqB;IACzB,GAAG;IACH,gBAAgB,oBAAoB;GACtC;GAEA,MAAM,MAAM,gBAA0B,aAAa,kBAAkB;GAErE,MAAM,iBAAiB,WAAW,IAAI,GAAG;GACzC,IAAI,gBAAgB,OAAO;GAE3B,OAAO,IAAI,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,gBAAgB;EACd,MAAM,cAAc,gBAAgB,sBAAsB;EAC1D,aAAa;GACX,YAAY;EACd;CACF,GAAG,CAAC,eAAe,CAAC;CAEpB,OAAO;AACT"}
|
|
@@ -665,6 +665,92 @@ var useTypingContext = (componentName) => {
|
|
|
665
665
|
return contextValue;
|
|
666
666
|
};
|
|
667
667
|
//#endregion
|
|
668
|
+
//#region src/components/Accessibility/useAriaLiveAnnouncer.ts
|
|
669
|
+
var noopAnnounce = () => () => void 0;
|
|
670
|
+
var AriaLiveAnnouncerContext = createContext(void 0);
|
|
671
|
+
var useAriaLiveAnnouncer = () => {
|
|
672
|
+
const contextValue = useContext(AriaLiveAnnouncerContext);
|
|
673
|
+
if (!contextValue) {
|
|
674
|
+
console.warn("The useAriaLiveAnnouncer hook was called outside of an AriaLiveAnnouncerProvider.");
|
|
675
|
+
return noopAnnounce;
|
|
676
|
+
}
|
|
677
|
+
return contextValue.announce;
|
|
678
|
+
};
|
|
679
|
+
//#endregion
|
|
680
|
+
//#region src/components/Accessibility/scheduling/useDebouncedAnnounce.ts
|
|
681
|
+
/**
|
|
682
|
+
* L2 scheduling policy: a per-key debounce over the provided `announce` (from
|
|
683
|
+
* `useAriaLiveAnnouncer`). Keeps an independent timer per `key` and takes the delay per call, so
|
|
684
|
+
* distinct rapidly-updating streams can coexist with different debounce windows without clobbering
|
|
685
|
+
* one another (e.g. the autocomplete count, which is a consequence of typing and wants a longer
|
|
686
|
+
* window to clear the screen reader's typing echo, vs. some other future debounced stream). For a
|
|
687
|
+
* single stream, use a constant key.
|
|
688
|
+
*
|
|
689
|
+
* React 17/18/19 compatible — `useCallback`/`useRef`/`useEffect` only. All pending timers are
|
|
690
|
+
* cleared on unmount.
|
|
691
|
+
*
|
|
692
|
+
* ## When to use this vs. {@link useSettledAnnouncement}
|
|
693
|
+
*
|
|
694
|
+
* Both wait out screen-reader noise (the typing echo / field re-read) before speaking, but they
|
|
695
|
+
* model different problems:
|
|
696
|
+
*
|
|
697
|
+
* - **`useDebouncedAnnounce` — an imperative throttle for a value you announce REPEATEDLY.** You
|
|
698
|
+
* call `announce(key, message, ...)` yourself whenever you have a fresh value (from an event
|
|
699
|
+
* handler or effect); rapid calls on a key collapse to the last one. The message typically
|
|
700
|
+
* *changes* each time, it can fire *again and again* (once per pause), and you drive it. Canonical
|
|
701
|
+
* case: the autocomplete result count re-announced as the user keeps typing. It has no notion of
|
|
702
|
+
* "active", "once", or re-arming — it just throttles whatever you push through it.
|
|
703
|
+
*
|
|
704
|
+
* - **{@link useSettledAnnouncement} — a declarative ONE-SHOT cue for a state change.** You pass
|
|
705
|
+
* `{ active, message, settleKey }`; it announces *once* when `active`, deferred until `settleKey`
|
|
706
|
+
* stops changing, then stays silent until `active` flips back and forth. The message is fixed and
|
|
707
|
+
* the point is "say this single fact once the UI settles", not "announce the latest value".
|
|
708
|
+
*
|
|
709
|
+
* | | `useDebouncedAnnounce` | `useSettledAnnouncement` |
|
|
710
|
+
* | --- | --- | --- |
|
|
711
|
+
* | Style | Imperative — you call `announce(key, …)` | Declarative — reacts to `{ active, message, settleKey }` |
|
|
712
|
+
* | Repetition | Fires repeatedly, once per pause | Once per `active` epoch (re-arms on reset) |
|
|
713
|
+
* | Message | Typically changes each time | Fixed fact |
|
|
714
|
+
* | Timer reset | Each explicit call | Each `settleKey` change |
|
|
715
|
+
* | Streams | Many, independent per `key` | One logical cue |
|
|
716
|
+
* | Canonical case | Autocomplete count while typing | "Controls just became available" |
|
|
717
|
+
*
|
|
718
|
+
* Rule of thumb: announcing the **latest value of a changing thing** → this hook. Announcing a
|
|
719
|
+
* **fixed fact once, after things settle** → `useSettledAnnouncement`.
|
|
720
|
+
*/
|
|
721
|
+
var useDebouncedAnnounce = (announce) => {
|
|
722
|
+
const timersRef = useRef(/* @__PURE__ */ new Map());
|
|
723
|
+
const announceRef = useRef(announce);
|
|
724
|
+
announceRef.current = announce;
|
|
725
|
+
const cancel = useCallback((key) => {
|
|
726
|
+
const timers = timersRef.current;
|
|
727
|
+
if (key === void 0) {
|
|
728
|
+
timers.forEach((timerId) => clearTimeout(timerId));
|
|
729
|
+
timers.clear();
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
const timerId = timers.get(key);
|
|
733
|
+
if (timerId !== void 0) {
|
|
734
|
+
clearTimeout(timerId);
|
|
735
|
+
timers.delete(key);
|
|
736
|
+
}
|
|
737
|
+
}, []);
|
|
738
|
+
useEffect(() => () => cancel(), [cancel]);
|
|
739
|
+
return {
|
|
740
|
+
announce: useCallback((key, message, delayMs, priority) => {
|
|
741
|
+
const timers = timersRef.current;
|
|
742
|
+
const existing = timers.get(key);
|
|
743
|
+
if (existing !== void 0) clearTimeout(existing);
|
|
744
|
+
const timerId = setTimeout(() => {
|
|
745
|
+
timers.delete(key);
|
|
746
|
+
announceRef.current(message, { priority });
|
|
747
|
+
}, delayMs);
|
|
748
|
+
timers.set(key, timerId);
|
|
749
|
+
}, []),
|
|
750
|
+
cancel
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
//#endregion
|
|
668
754
|
//#region src/components/Notifications/notificationTarget.ts
|
|
669
755
|
var NOTIFICATION_TARGET_PANELS = [
|
|
670
756
|
"channel",
|
|
@@ -2690,6 +2776,168 @@ var audioPlayerNotificationsPluginFactory = ({ addNotification, panel = "channel
|
|
|
2690
2776
|
};
|
|
2691
2777
|
};
|
|
2692
2778
|
//#endregion
|
|
2779
|
+
//#region src/components/Accessibility/hooks/useInteractionAnnouncements.ts
|
|
2780
|
+
/**
|
|
2781
|
+
* One entry per interaction — the single place an interaction is registered. Each
|
|
2782
|
+
* resolver contains a LITERAL `t('aria/…')` call so that `i18next-cli extract`
|
|
2783
|
+
* (run via `yarn build-translations`) discovers and generates the key across all
|
|
2784
|
+
* locales. Keys must never be built dynamically (e.g. `t(someVariable)`) or
|
|
2785
|
+
* extraction silently misses them. Adding an interaction = one line here + one
|
|
2786
|
+
* line in {@link InteractionAnnouncementParams} (+ an override in
|
|
2787
|
+
* {@link INTERACTION_PRIORITIES} only if it is not `polite`).
|
|
2788
|
+
*/
|
|
2789
|
+
var INTERACTION_MESSAGES = {
|
|
2790
|
+
"audioPlayer.playbackRateChanged": (t, params) => t("Playback speed {{ rate }}x", { rate: params.rate }),
|
|
2791
|
+
"channel.opened": (t, params) => t("aria/Opened channel: {{ name }}", { name: params.name }),
|
|
2792
|
+
"command.selected": (t, params) => t("aria/Command activated: {{ command }}", { command: params.command }),
|
|
2793
|
+
"giphy.canceled": (t) => t("aria/Giphy canceled"),
|
|
2794
|
+
"giphy.sent": (t) => t("aria/Giphy sent"),
|
|
2795
|
+
"giphy.shuffled": (t, params) => params.title ? t("aria/Giphy image changed: {{ title }}", { title: params.title }) : t("aria/Giphy image changed"),
|
|
2796
|
+
"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")}.`,
|
|
2797
|
+
"poll.optionDropped": (t, params) => t("aria/Dropped \"{{ option }}\" at position {{ position }}.", {
|
|
2798
|
+
option: params.option,
|
|
2799
|
+
position: params.position
|
|
2800
|
+
}),
|
|
2801
|
+
"poll.optionPickedUp": (t, params) => t("aria/Picked up \"{{ option }}\". Use arrow keys to reorder. Press Space or Tab to drop.", { option: params.option }),
|
|
2802
|
+
"poll.optionRemoved": (t, params) => t("aria/Removed option {{ option }}", { option: params.option }),
|
|
2803
|
+
"poll.sent": (t) => t("aria/Poll sent"),
|
|
2804
|
+
"search.cleared": (t) => t("aria/Search cleared"),
|
|
2805
|
+
"search.resultCount": (t, params) => {
|
|
2806
|
+
if (params.count <= 0) return t("aria/No search results found");
|
|
2807
|
+
const count = t("aria/{{ count }} search results", { count: params.count });
|
|
2808
|
+
return params.allResultsLoaded ? `${count}. ${t("All results loaded")}` : count;
|
|
2809
|
+
},
|
|
2810
|
+
"suggestions.count": (t, params) => params.suggestionsLabel ? t("aria/{{ count }} {{ suggestionsLabel }}", {
|
|
2811
|
+
count: params.count,
|
|
2812
|
+
suggestionsLabel: params.suggestionsLabel
|
|
2813
|
+
}) : t("aria/{{ count }} suggestions", { count: params.count }),
|
|
2814
|
+
"thread.opened": (t, params) => t("aria/Opened thread in {{ name }}", { name: params.name }),
|
|
2815
|
+
"user.selected": (t, params) => t("aria/User selected: {{ user }}", { user: params.user }),
|
|
2816
|
+
"voiceRecording.attached": (t) => t("aria/Voice recording attached"),
|
|
2817
|
+
"voiceRecording.paused": (t) => t("aria/Recording paused"),
|
|
2818
|
+
"voiceRecording.resumed": (t) => t("aria/Recording resumed"),
|
|
2819
|
+
"voiceRecording.sent": (t) => t("aria/Voice message sent"),
|
|
2820
|
+
"voiceRecording.started": (t) => t("aria/Recording started")
|
|
2821
|
+
};
|
|
2822
|
+
/**
|
|
2823
|
+
* Per-interaction aria-live priority. Interactions default to `polite`; list one
|
|
2824
|
+
* here only to override it (e.g. with `assertive`).
|
|
2825
|
+
*/
|
|
2826
|
+
var INTERACTION_PRIORITIES = {
|
|
2827
|
+
"poll.dialogOpened": "assertive",
|
|
2828
|
+
"poll.optionDropped": "assertive",
|
|
2829
|
+
"poll.optionPickedUp": "assertive"
|
|
2830
|
+
};
|
|
2831
|
+
/**
|
|
2832
|
+
* Per-interaction dedupe window (ms): an identical message for this interaction is announced at
|
|
2833
|
+
* most once per window (see {@link AriaLiveAnnounceOptions.dedupeMs}). List an interaction here
|
|
2834
|
+
* only when the SAME open/mount can fire it more than once in quick succession — e.g. a mount
|
|
2835
|
+
* effect double-invoked by React StrictMode (dev) — so the user does not hear a duplicate.
|
|
2836
|
+
*/
|
|
2837
|
+
var INTERACTION_DEDUPE_MS = {
|
|
2838
|
+
"audioPlayer.playbackRateChanged": 300,
|
|
2839
|
+
"poll.dialogOpened": 1e3
|
|
2840
|
+
};
|
|
2841
|
+
/**
|
|
2842
|
+
* Default per-interaction debounce delay (ms). Only list rapidly-updating streams where just the
|
|
2843
|
+
* settled value should be read (e.g. the autocomplete count as the query filters). Discrete
|
|
2844
|
+
* confirmations (Giphy/Poll sent, user selected) are NOT listed and announce immediately. A call
|
|
2845
|
+
* site can override (or opt into) a delay for a single call via `params.debounceMs` — see
|
|
2846
|
+
* {@link InteractionDeliveryOptions}.
|
|
2847
|
+
*
|
|
2848
|
+
* `suggestions.count` is a CONSEQUENCE OF TYPING, so the delay does double duty: it coalesces
|
|
2849
|
+
* rapid filters into the settled value AND lets the screen reader's per-keystroke typing echo
|
|
2850
|
+
* (the spoken character + field re-read) finish first. A polite update that lands mid-echo gets
|
|
2851
|
+
* queued behind a long re-read and is perceived as buried; waiting past the echo makes the count
|
|
2852
|
+
* the next thing spoken once the user pauses. This is a heuristic — echo length varies with the
|
|
2853
|
+
* SR's "speak typed words/characters" setting and field content — so tune if it still collides.
|
|
2854
|
+
*/
|
|
2855
|
+
var INTERACTION_DEBOUNCE_MS = {
|
|
2856
|
+
"search.resultCount": 1e3,
|
|
2857
|
+
"suggestions.count": 500
|
|
2858
|
+
};
|
|
2859
|
+
/**
|
|
2860
|
+
* Default per-interaction delay (ms) for the immediate (non-debounced) path — a single deferred
|
|
2861
|
+
* emit scheduled in the announcer PROVIDER (see {@link AriaLiveAnnounceOptions.delayMs}), so it
|
|
2862
|
+
* SURVIVES the calling component unmounting (unlike a debounce, whose timer is cleared on unmount).
|
|
2863
|
+
*
|
|
2864
|
+
* Opening a channel/thread moves focus to the (auto-focusing) message composer; the screen reader
|
|
2865
|
+
* announces that newly-focused element first, and a live-region message emitted alongside it is
|
|
2866
|
+
* superseded and dropped. The delay defers the confirmation past that focus read-out so it is spoken
|
|
2867
|
+
* next, in a calm moment. It is a provider delay rather than a debounce specifically because
|
|
2868
|
+
* selecting the item can unmount its list row (and the whole list, on mobile) — a per-row debounce
|
|
2869
|
+
* would be cancelled mid-flight, swallowing the confirmation.
|
|
2870
|
+
*/
|
|
2871
|
+
var INTERACTION_DELAY_MS = {
|
|
2872
|
+
"channel.opened": 1500,
|
|
2873
|
+
"command.selected": 1500,
|
|
2874
|
+
"thread.opened": 1500
|
|
2875
|
+
};
|
|
2876
|
+
/**
|
|
2877
|
+
* Thin, typed wrapper over the aria-live announcer exposing intention-revealing
|
|
2878
|
+
* helpers for transient, user-initiated UI interactions (e.g. a Giphy being
|
|
2879
|
+
* sent, a poll being created, a mention being picked). They map to i18n keys with
|
|
2880
|
+
* baked-in priorities and reuse the existing live region via
|
|
2881
|
+
* {@link useAriaLiveAnnouncer}. New interactions are registered as a single entry
|
|
2882
|
+
* in {@link INTERACTION_MESSAGES}.
|
|
2883
|
+
*/
|
|
2884
|
+
var useInteractionAnnouncements = () => {
|
|
2885
|
+
const announce = useAriaLiveAnnouncer();
|
|
2886
|
+
const { t } = useTranslationContext();
|
|
2887
|
+
const { announce: announceDebounced, cancel: cancelDebounced } = useDebouncedAnnounce(announce);
|
|
2888
|
+
const pendingImmediateCancelsRef = useRef({});
|
|
2889
|
+
return useMemo(() => ({
|
|
2890
|
+
announceInteraction: (interaction, params) => {
|
|
2891
|
+
const resolveMessage = INTERACTION_MESSAGES[interaction];
|
|
2892
|
+
if (!resolveMessage) return;
|
|
2893
|
+
const message = resolveMessage(t, params);
|
|
2894
|
+
const priority = INTERACTION_PRIORITIES[interaction] ?? "polite";
|
|
2895
|
+
const debounceMs = params?.debounceMs ?? INTERACTION_DEBOUNCE_MS[interaction];
|
|
2896
|
+
if (debounceMs === void 0) {
|
|
2897
|
+
const delayMs = params?.delayMs ?? INTERACTION_DELAY_MS[interaction];
|
|
2898
|
+
pendingImmediateCancelsRef.current[interaction]?.();
|
|
2899
|
+
pendingImmediateCancelsRef.current[interaction] = announce(message, {
|
|
2900
|
+
dedupeMs: INTERACTION_DEDUPE_MS[interaction],
|
|
2901
|
+
delayMs,
|
|
2902
|
+
priority
|
|
2903
|
+
});
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2906
|
+
announceDebounced(interaction, message, debounceMs, priority);
|
|
2907
|
+
},
|
|
2908
|
+
cancelInteraction: (interaction) => {
|
|
2909
|
+
cancelDebounced(interaction);
|
|
2910
|
+
const pending = pendingImmediateCancelsRef.current;
|
|
2911
|
+
if (interaction) {
|
|
2912
|
+
pending[interaction]?.();
|
|
2913
|
+
delete pending[interaction];
|
|
2914
|
+
} else {
|
|
2915
|
+
Object.values(pending).forEach((cancel) => cancel?.());
|
|
2916
|
+
pendingImmediateCancelsRef.current = {};
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
}), [
|
|
2920
|
+
announce,
|
|
2921
|
+
announceDebounced,
|
|
2922
|
+
cancelDebounced,
|
|
2923
|
+
t
|
|
2924
|
+
]);
|
|
2925
|
+
};
|
|
2926
|
+
//#endregion
|
|
2927
|
+
//#region src/components/Accessibility/hooks/useAudioPlaybackChangeAnnouncements.ts
|
|
2928
|
+
var playbackRateSelector = (state) => ({ currentPlaybackRate: state.currentPlaybackRate });
|
|
2929
|
+
var useAudioPlaybackChangeAnnouncements = (audioPlayer) => {
|
|
2930
|
+
const { announceInteraction } = useInteractionAnnouncements();
|
|
2931
|
+
const { currentPlaybackRate } = useStateStore(audioPlayer?.state, playbackRateSelector) ?? {};
|
|
2932
|
+
const previousPlaybackRateRef = useRef(currentPlaybackRate);
|
|
2933
|
+
useEffect(() => {
|
|
2934
|
+
const previous = previousPlaybackRateRef.current;
|
|
2935
|
+
previousPlaybackRateRef.current = currentPlaybackRate;
|
|
2936
|
+
if (currentPlaybackRate === void 0 || previous === void 0 || previous === currentPlaybackRate) return;
|
|
2937
|
+
announceInteraction("audioPlayer.playbackRateChanged", { rate: currentPlaybackRate });
|
|
2938
|
+
}, [announceInteraction, currentPlaybackRate]);
|
|
2939
|
+
};
|
|
2940
|
+
//#endregion
|
|
2693
2941
|
//#region src/components/AudioPlayback/WithAudioPlayback.tsx
|
|
2694
2942
|
var AudioPlayerContext = React.createContext({ audioPlayers: null });
|
|
2695
2943
|
var WithAudioPlayback = ({ allowConcurrentPlayback, children }) => {
|
|
@@ -2722,6 +2970,7 @@ var useAudioPlayer = ({ durationSeconds, fileSize, mimeType, playbackRates, plug
|
|
|
2722
2970
|
title,
|
|
2723
2971
|
waveformData
|
|
2724
2972
|
}) : void 0;
|
|
2973
|
+
useAudioPlaybackChangeAnnouncements(audioPlayer);
|
|
2725
2974
|
useEffect(() => {
|
|
2726
2975
|
if (!audioPlayer) return;
|
|
2727
2976
|
/**
|
|
@@ -3816,32 +4065,21 @@ var ThreadProvider = ({ children, thread }) => /* @__PURE__ */ jsx(ThreadContext
|
|
|
3816
4065
|
var UnreadCountBadge = ({ children, count, position }) => /* @__PURE__ */ jsxs("div", {
|
|
3817
4066
|
className: "str-chat__unread-count-badge-container",
|
|
3818
4067
|
children: [children, count > 0 && /* @__PURE__ */ jsx("div", {
|
|
4068
|
+
"aria-hidden": "true",
|
|
3819
4069
|
className: clsx("str-chat__unread-count-badge", position && `str-chat__unread-count-badge--${position}`),
|
|
3820
4070
|
children: count
|
|
3821
4071
|
})]
|
|
3822
4072
|
});
|
|
3823
4073
|
//#endregion
|
|
3824
4074
|
//#region src/components/ChatView/ChatView.a11y.utility.ts
|
|
3825
|
-
var DEFAULT_CHAT_VIEW_A11Y_CONTEXT_VALUE = {
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
}
|
|
3834
|
-
};
|
|
3835
|
-
var createChatViewA11yContextValue = (chatViewId) => ({
|
|
3836
|
-
chatViewPanelIds: {
|
|
3837
|
-
channels: `str-chat__chat-view-${chatViewId}-panel-channels`,
|
|
3838
|
-
threads: `str-chat__chat-view-${chatViewId}-panel-threads`
|
|
3839
|
-
},
|
|
3840
|
-
chatViewTabIds: {
|
|
3841
|
-
channels: `str-chat__chat-view-${chatViewId}-tab-channels`,
|
|
3842
|
-
threads: `str-chat__chat-view-${chatViewId}-tab-threads`
|
|
3843
|
-
}
|
|
3844
|
-
});
|
|
4075
|
+
var DEFAULT_CHAT_VIEW_A11Y_CONTEXT_VALUE = { chatViewPanelIds: {
|
|
4076
|
+
channels: "str-chat__chat-view-panel-channels",
|
|
4077
|
+
threads: "str-chat__chat-view-panel-threads"
|
|
4078
|
+
} };
|
|
4079
|
+
var createChatViewA11yContextValue = (chatViewId) => ({ chatViewPanelIds: {
|
|
4080
|
+
channels: `str-chat__chat-view-${chatViewId}-panel-channels`,
|
|
4081
|
+
threads: `str-chat__chat-view-${chatViewId}-panel-threads`
|
|
4082
|
+
} });
|
|
3845
4083
|
//#endregion
|
|
3846
4084
|
//#region src/components/ChatView/ChatView.tsx
|
|
3847
4085
|
var ChatViewContext = createContext(void 0);
|
|
@@ -3877,13 +4115,11 @@ var ChatView = ({ children }) => {
|
|
|
3877
4115
|
};
|
|
3878
4116
|
var ChannelsView = ({ children }) => {
|
|
3879
4117
|
const { activeChatView } = useChatViewContext();
|
|
3880
|
-
const { chatViewPanelIds
|
|
4118
|
+
const { chatViewPanelIds } = useChatViewA11yContext();
|
|
3881
4119
|
if (!(activeChatView === "channels")) return null;
|
|
3882
4120
|
return /* @__PURE__ */ jsx("div", {
|
|
3883
|
-
"aria-labelledby": chatViewTabIds.channels,
|
|
3884
4121
|
className: "str-chat__chat-view__channels",
|
|
3885
4122
|
id: chatViewPanelIds.channels,
|
|
3886
|
-
role: "tabpanel",
|
|
3887
4123
|
children
|
|
3888
4124
|
});
|
|
3889
4125
|
};
|
|
@@ -3894,7 +4130,7 @@ var ThreadsViewContext = createContext({
|
|
|
3894
4130
|
var useThreadsViewContext = () => useContext(ThreadsViewContext);
|
|
3895
4131
|
var ThreadsView = ({ children }) => {
|
|
3896
4132
|
const { activeChatView } = useChatViewContext();
|
|
3897
|
-
const { chatViewPanelIds
|
|
4133
|
+
const { chatViewPanelIds } = useChatViewA11yContext();
|
|
3898
4134
|
const [activeThread, setActiveThread] = useState(void 0);
|
|
3899
4135
|
const value = useMemo(() => ({
|
|
3900
4136
|
activeThread,
|
|
@@ -3904,10 +4140,8 @@ var ThreadsView = ({ children }) => {
|
|
|
3904
4140
|
return /* @__PURE__ */ jsx(ThreadsViewContext.Provider, {
|
|
3905
4141
|
value,
|
|
3906
4142
|
children: /* @__PURE__ */ jsx("div", {
|
|
3907
|
-
"aria-labelledby": chatViewTabIds.threads,
|
|
3908
4143
|
className: "str-chat__chat-view__threads",
|
|
3909
4144
|
id: chatViewPanelIds.threads,
|
|
3910
|
-
role: "tabpanel",
|
|
3911
4145
|
children
|
|
3912
4146
|
})
|
|
3913
4147
|
});
|
|
@@ -3973,9 +4207,9 @@ var ChatViewSelectorButton = ({ ActiveIcon, children, className, Icon, iconOnly
|
|
|
3973
4207
|
className: "str-chat__chat-view__selector-button-container",
|
|
3974
4208
|
children: [/* @__PURE__ */ jsxs(Button, {
|
|
3975
4209
|
appearance: "ghost",
|
|
4210
|
+
"aria-current": isActive || void 0,
|
|
3976
4211
|
"aria-label": props["aria-label"] ?? (shouldShowTooltip ? text : void 0),
|
|
3977
4212
|
className: clsx("str-chat__chat-view__selector-button", className),
|
|
3978
|
-
role: "tab",
|
|
3979
4213
|
variant: "secondary",
|
|
3980
4214
|
...props,
|
|
3981
4215
|
children: [children ?? (SelectorIcon && /* @__PURE__ */ jsx(SelectorIcon, {})), !iconOnly && text && /* @__PURE__ */ jsx("div", {
|
|
@@ -3996,20 +4230,16 @@ var threadAdapterSelector = ({ pagination, ready }) => ({
|
|
|
3996
4230
|
var unreadThreadCountSelector = ({ unreadThreadCount }) => ({ unreadThreadCount });
|
|
3997
4231
|
var ChatViewChannelsSelectorButton = ({ iconOnly = true }) => {
|
|
3998
4232
|
const { activeChatView, setActiveChatView } = useChatViewContext();
|
|
3999
|
-
const { chatViewPanelIds, chatViewTabIds } = useChatViewA11yContext();
|
|
4000
4233
|
const { t } = useTranslationContext();
|
|
4001
4234
|
const isActive = activeChatView === "channels";
|
|
4002
4235
|
return /* @__PURE__ */ jsx(ChatViewSelectorButton, {
|
|
4003
4236
|
ActiveIcon: IconMessageBubbleFill,
|
|
4004
|
-
"aria-
|
|
4005
|
-
"aria-selected": isActive,
|
|
4237
|
+
"aria-label": t("aria/Open channels view"),
|
|
4006
4238
|
Icon: IconMessageBubble,
|
|
4007
4239
|
iconOnly,
|
|
4008
|
-
id: chatViewTabIds.channels,
|
|
4009
4240
|
isActive,
|
|
4010
4241
|
onClick: () => setActiveChatView("channels"),
|
|
4011
4242
|
onPointerDown: () => setActiveChatView("channels"),
|
|
4012
|
-
tabIndex: 0,
|
|
4013
4243
|
text: t("Channels")
|
|
4014
4244
|
});
|
|
4015
4245
|
};
|
|
@@ -4017,20 +4247,16 @@ var ChatViewThreadsSelectorButton = ({ iconOnly = true }) => {
|
|
|
4017
4247
|
const { client } = useChatContext();
|
|
4018
4248
|
const { unreadThreadCount } = useStateStore(client.threads.state, unreadThreadCountSelector) ?? { unreadThreadCount: 0 };
|
|
4019
4249
|
const { activeChatView, setActiveChatView } = useChatViewContext();
|
|
4020
|
-
const { chatViewPanelIds, chatViewTabIds } = useChatViewA11yContext();
|
|
4021
4250
|
const { t } = useTranslationContext();
|
|
4022
4251
|
const isActive = activeChatView === "threads";
|
|
4023
4252
|
return /* @__PURE__ */ jsx(ChatViewSelectorButton, {
|
|
4024
4253
|
ActiveIcon: IconThreadFill,
|
|
4025
|
-
"aria-
|
|
4026
|
-
"aria-selected": isActive,
|
|
4254
|
+
"aria-label": unreadThreadCount > 0 ? t("aria/Open threads view with unread threads", { count: unreadThreadCount }) : t("aria/Open threads view"),
|
|
4027
4255
|
Icon: IconThread,
|
|
4028
4256
|
iconOnly,
|
|
4029
|
-
id: chatViewTabIds.threads,
|
|
4030
4257
|
isActive,
|
|
4031
4258
|
onClick: () => setActiveChatView("threads"),
|
|
4032
4259
|
onPointerDown: () => setActiveChatView("threads"),
|
|
4033
|
-
tabIndex: 0,
|
|
4034
4260
|
text: t("Threads"),
|
|
4035
4261
|
children: /* @__PURE__ */ jsx(UnreadCountBadge, {
|
|
4036
4262
|
count: unreadThreadCount,
|
|
@@ -4049,9 +4275,9 @@ var defaultChatViewSelectorItemSet = [{
|
|
|
4049
4275
|
var ChatViewSelector = ({ iconOnly = true, itemSet = defaultChatViewSelectorItemSet }) => {
|
|
4050
4276
|
const { t } = useTranslationContext();
|
|
4051
4277
|
return /* @__PURE__ */ jsx("div", {
|
|
4052
|
-
"aria-label": t("aria/Chat view
|
|
4278
|
+
"aria-label": t("aria/Chat view controls"),
|
|
4053
4279
|
className: "str-chat__chat-view__selector",
|
|
4054
|
-
role: "
|
|
4280
|
+
role: "navigation",
|
|
4055
4281
|
children: itemSet.map(({ Component, type }) => /* @__PURE__ */ jsx(Component, { iconOnly }, type))
|
|
4056
4282
|
});
|
|
4057
4283
|
};
|
|
@@ -4109,7 +4335,7 @@ var useNotificationApi = () => {
|
|
|
4109
4335
|
const inferredPanel = useNotificationTarget();
|
|
4110
4336
|
const modalManagerHasOpenDialog = useStateStore(useModalDialogManager()?.state, modalDialogManagerStateSelector)?.hasOpenDialog ?? false;
|
|
4111
4337
|
return {
|
|
4112
|
-
addNotification: useCallback(({ actions, context, duration, emitter, error, incident, message, severity, tags, targetPanels, type }) => {
|
|
4338
|
+
addNotification: useCallback(({ actions, ariaLive, context, duration, emitter, error, incident, message, severity, tags, targetPanels, type }) => {
|
|
4113
4339
|
const notificationTags = getTargetTags(targetPanels, inferredPanel, tags, modalManagerHasOpenDialog);
|
|
4114
4340
|
const resolvedType = getTypeFromIncident({
|
|
4115
4341
|
incident,
|
|
@@ -4124,6 +4350,7 @@ var useNotificationApi = () => {
|
|
|
4124
4350
|
...actions ? { actions } : {},
|
|
4125
4351
|
...typeof duration === "number" ? { duration } : {},
|
|
4126
4352
|
...error ? { originalError: error } : {},
|
|
4353
|
+
...ariaLive ? { metadata: { ariaLive } } : {},
|
|
4127
4354
|
...notificationTags.length > 0 ? { tags: notificationTags } : {},
|
|
4128
4355
|
...severity ? { severity } : {},
|
|
4129
4356
|
...resolvedType ? { type: resolvedType } : {}
|
|
@@ -4138,7 +4365,7 @@ var useNotificationApi = () => {
|
|
|
4138
4365
|
inferredPanel,
|
|
4139
4366
|
modalManagerHasOpenDialog
|
|
4140
4367
|
]),
|
|
4141
|
-
addSystemNotification: useCallback(({ actions, context, duration, emitter, error, incident, message, severity, tags, type }) => {
|
|
4368
|
+
addSystemNotification: useCallback(({ actions, ariaLive, context, duration, emitter, error, incident, message, severity, tags, type }) => {
|
|
4142
4369
|
const notificationTags = Array.from(/* @__PURE__ */ new Set([SYSTEM_NOTIFICATION_TAG, ...tags ?? []]));
|
|
4143
4370
|
const resolvedType = getTypeFromIncident({
|
|
4144
4371
|
incident,
|
|
@@ -4153,6 +4380,7 @@ var useNotificationApi = () => {
|
|
|
4153
4380
|
...actions ? { actions } : {},
|
|
4154
4381
|
...typeof duration === "number" ? { duration } : {},
|
|
4155
4382
|
...error ? { originalError: error } : {},
|
|
4383
|
+
...ariaLive ? { metadata: { ariaLive } } : {},
|
|
4156
4384
|
...notificationTags.length > 0 ? { tags: notificationTags } : {},
|
|
4157
4385
|
...severity ? { severity } : {},
|
|
4158
4386
|
...resolvedType ? { type: resolvedType } : {}
|
|
@@ -4172,6 +4400,6 @@ var useNotificationApi = () => {
|
|
|
4172
4400
|
};
|
|
4173
4401
|
};
|
|
4174
4402
|
//#endregion
|
|
4175
|
-
export {
|
|
4403
|
+
export { isMessageEdited as $, useStableId as $n, ChannelListContextProvider as $r, IconFolder as $t, WithAudioPlayback as A, IconSearch as An, DialogPortalEntry as Ar, IconBookmarkRemove as At, ACTIONS_NOT_WORKING_IN_THREAD as B, IconUser as Bn, useOpenedDialogCount as Br, IconCopy as Bt, insertIntro as C, IconPlusSmall as Cn, DialogManagerProvider as Cr, IconArrowUpRight as Ct, makeDateMessageId as D, IconReorder as Dn, useModalDialogManager as Dr, IconBellOff as Dt, isLocalMessage as E, IconRefresh as En, useDialogManager as Er, IconBell as Et, defaultRegisterAudioPlayerError as F, IconTranslate as Fn, useDialogIsTopmost as Fr, IconChevronDown as Ft, countEmojis as G, IconVideo as Gn, useComponentContext as Gr, IconEmojiAdd as Gt, OPTIONAL_MESSAGE_ACTIONS as H, IconUserCheck as Hn, DialogManager as Hr, IconDownload as Ht, elementIsPlaying as I, IconTrophy as In, useDialogOnNearestManager as Ir, IconChevronLeft as It, getNonImageAttachments as J, IconXCircle as Jn, useChatContext as Jr, IconExclamationMarkFill as Jt, getImages as K, IconVideoFill as Kn, ChatContext as Kr, IconExclamationCircleFill as Kt, LegacyThreadContext as L, IconUnpin as Ln, useModalDialog as Lr, IconChevronRight as Lt, useAudioPlayer as M, IconShield as Mn, modalDialogId as Mr, IconCheckmark as Mt, useInteractionAnnouncements as N, IconThread as Nn, useDialog as Nr, IconCheckmark1Small as Nt, makeIntroMessage as O, IconReply as On, useNearestDialogManagerContext as Or, IconBolt as Ot, AudioPlayer as P, IconThreadFill as Pn, useDialogIsOpen as Pr, IconChecks as Pt, isMessageDeleted as Q, Button as Qn, ChannelListContext as Qr, IconFlag as Qt, useLegacyThreadContext as R, IconUnsupportedAttachment as Rn, useModalDialogIsOpen as Rr, IconClock as Rt, hasMoreMessagesProbably as S, IconPlus as Sn, predefinedFormatters as Sr, IconArrowUp as St, isIntroMessage as T, IconQuote as Tn, modalDialogManagerId as Tr, IconAudio as Tt, areMessagePropsEqual as U, IconUserRemove as Un, ComponentContext as Ur, IconEdit as Ut, MESSAGE_ACTIONS as V, IconUserAdd as Vn, useStateStore as Vr, IconDelete as Vt, areMessageUIPropsEqual as W, IconUsers as Wn, ComponentProvider as Wr, IconEmoji as Wt, isMessageBlocked as X, IconXmarkSmall as Xn, ChannelStateProvider as Xr, IconEyeFill as Xt, getReadByTooltipText as Y, IconXmark as Yn, ChannelStateContext as Yr, IconExclamationTriangleFill as Yt, isMessageBounced as Z, createIcon as Zn, useChannelStateContext as Zr, IconFile as Zt, Channel as _, IconNoSign as _n, getDateString as _r, EmptyStateIndicator as _t, ChatView as a, IconLoading as an, isNotificationTargetPanel as ar, messageHasGiphyAttachment as at, getIsFirstUnreadMessage as b, IconPin as bn, isLanguageSupported as br, IconArrowDownCircle as bt, ChatViewSelectorButton as c, IconMenu as cn, useAriaLiveAnnouncer as cr, messageHasSingleAttachment as ct, useActiveThread as d, IconMessageBubbles as dn, useTypingContext as dr, EMOJI_REGEX as dt, useChannelListContext as ei, IconGiphy as en, addNotificationTargetTag as er, isMessageErrorRetryable as et, useChatViewContext as f, IconMicrophoneSolid as fn, TranslationContext as fr, CHANNEL_CONTAINER_ID as ft, useThreadContext as g, IconMute as gn, defaultTranslatorFunction as gr, useEditMessageHandler as gt, ThreadProvider as h, IconMore as hn, defaultDateTimeParser as hr, useMentionsHandlers as ht, useNotificationTarget as i, IconLink as in, isNotificationForPanel as ir, messageHasAttachments as it, useActiveAudioPlayer as j, IconSend as jn, Portal as jr, IconCamera as jt, processMessages as k, IconRetry as kn, DialogPortalDestination as kr, IconBookmark as kt, ChatViewThreadsSelectorButton as l, IconMessageBubble as ln, TypingContext as lr, messageTextHasEmojisOnly as lt, ThreadContext as m, IconMinusCircle as mn, useTranslationContext as mr, LoadingChannel as mt, hasSystemNotificationTag as n, ChannelActionProvider as ni, IconInfo as nn, getNotificationTargetPanels as nr, isUserMuted as nt, ChatViewChannelsSelectorButton as o, IconLocation as on, useDebouncedAnnounce as or, messageHasQuotedMessage as ot, useThreadsViewContext as p, IconMinus as pn, TranslationProvider as pr, LoadingErrorIndicator as pt, getMessageActions as q, IconVoice as qn, ChatProvider as qr, IconExclamationMark as qt, useNotificationApi as r, useChannelActionContext as ri, IconLeave as rn, getNotificationTargetTag as rr, mapToUserNameOrId as rt, ChatViewContext as s, IconMegaphone as sn, AriaLiveAnnouncerContext as sr, messageHasReactions as st, SYSTEM_NOTIFICATION_TAG as t, ChannelActionContext as ti, IconImage as tn, getNotificationTargetPanel as tr, isNetworkSendFailure as tt, defaultChatViewSelectorItemSet as u, IconMessageBubbleFill as un, TypingProvider as ur, validateAndGetMessage as ut, getChannel as v, IconNotification as vn, isDate as vr, IconArchive as vt, isDateSeparatorMessage as w, IconPoll as wn, ModalDialogManagerProvider as wr, IconAttachment as wt, getLastReceived as x, IconPlayFill as xn, isNumberOrString as xr, IconArrowLeft as xt, getGroupStyles as y, IconPauseFill as yn, isDayOrMoment as yr, IconArrowDown as yt, usePopoverPosition as z, IconUpload as zn, useModalDialogIsTopmost as zr, IconCommand as zt };
|
|
4176
4404
|
|
|
4177
|
-
//# sourceMappingURL=useNotificationApi.
|
|
4405
|
+
//# sourceMappingURL=useNotificationApi.ed6bff88.mjs.map
|