stream-chat-react 14.7.0 → 14.9.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 +2909 -744
- 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 +56 -26
- 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 +2874 -735
- 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/MessageComposer/hooks/useAttachmentManagerState.d.ts +2 -0
- package/dist/types/components/MessageComposer/hooks/useAttachmentManagerState.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/index.d.ts +2 -1
- package/dist/types/components/MessageComposer/index.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/ReactFileUtilities/UploadButton.d.ts.map +1 -1
- 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/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/context/index.d.ts +1 -0
- package/dist/types/context/index.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 +6 -3
- 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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AriaLiveAnnounce, AriaLivePriority } from '../useAriaLiveAnnouncer';
|
|
2
|
+
export type DebouncedAnnounceResult = {
|
|
3
|
+
/**
|
|
4
|
+
* Schedule an announcement on the channel identified by `key`. Each call on the same key
|
|
5
|
+
* resets that key's timer, so only the last call within its `delayMs` fires. Different keys
|
|
6
|
+
* debounce independently — scheduling key `a` never cancels a pending key `b`, and each may
|
|
7
|
+
* use its own `delayMs`.
|
|
8
|
+
*/
|
|
9
|
+
announce: (key: string, message: string, delayMs: number, priority?: AriaLivePriority) => void;
|
|
10
|
+
/** Cancel pending announcement(s): a single `key`, or all when omitted (also runs on unmount). */
|
|
11
|
+
cancel: (key?: string) => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* L2 scheduling policy: a per-key debounce over the provided `announce` (from
|
|
15
|
+
* `useAriaLiveAnnouncer`). Keeps an independent timer per `key` and takes the delay per call, so
|
|
16
|
+
* distinct rapidly-updating streams can coexist with different debounce windows without clobbering
|
|
17
|
+
* one another (e.g. the autocomplete count, which is a consequence of typing and wants a longer
|
|
18
|
+
* window to clear the screen reader's typing echo, vs. some other future debounced stream). For a
|
|
19
|
+
* single stream, use a constant key.
|
|
20
|
+
*
|
|
21
|
+
* React 17/18/19 compatible — `useCallback`/`useRef`/`useEffect` only. All pending timers are
|
|
22
|
+
* cleared on unmount.
|
|
23
|
+
*
|
|
24
|
+
* ## When to use this vs. {@link useSettledAnnouncement}
|
|
25
|
+
*
|
|
26
|
+
* Both wait out screen-reader noise (the typing echo / field re-read) before speaking, but they
|
|
27
|
+
* model different problems:
|
|
28
|
+
*
|
|
29
|
+
* - **`useDebouncedAnnounce` — an imperative throttle for a value you announce REPEATEDLY.** You
|
|
30
|
+
* call `announce(key, message, ...)` yourself whenever you have a fresh value (from an event
|
|
31
|
+
* handler or effect); rapid calls on a key collapse to the last one. The message typically
|
|
32
|
+
* *changes* each time, it can fire *again and again* (once per pause), and you drive it. Canonical
|
|
33
|
+
* case: the autocomplete result count re-announced as the user keeps typing. It has no notion of
|
|
34
|
+
* "active", "once", or re-arming — it just throttles whatever you push through it.
|
|
35
|
+
*
|
|
36
|
+
* - **{@link useSettledAnnouncement} — a declarative ONE-SHOT cue for a state change.** You pass
|
|
37
|
+
* `{ active, message, settleKey }`; it announces *once* when `active`, deferred until `settleKey`
|
|
38
|
+
* stops changing, then stays silent until `active` flips back and forth. The message is fixed and
|
|
39
|
+
* the point is "say this single fact once the UI settles", not "announce the latest value".
|
|
40
|
+
*
|
|
41
|
+
* | | `useDebouncedAnnounce` | `useSettledAnnouncement` |
|
|
42
|
+
* | --- | --- | --- |
|
|
43
|
+
* | Style | Imperative — you call `announce(key, …)` | Declarative — reacts to `{ active, message, settleKey }` |
|
|
44
|
+
* | Repetition | Fires repeatedly, once per pause | Once per `active` epoch (re-arms on reset) |
|
|
45
|
+
* | Message | Typically changes each time | Fixed fact |
|
|
46
|
+
* | Timer reset | Each explicit call | Each `settleKey` change |
|
|
47
|
+
* | Streams | Many, independent per `key` | One logical cue |
|
|
48
|
+
* | Canonical case | Autocomplete count while typing | "Controls just became available" |
|
|
49
|
+
*
|
|
50
|
+
* Rule of thumb: announcing the **latest value of a changing thing** → this hook. Announcing a
|
|
51
|
+
* **fixed fact once, after things settle** → `useSettledAnnouncement`.
|
|
52
|
+
*/
|
|
53
|
+
export declare const useDebouncedAnnounce: (announce: AriaLiveAnnounce) => DebouncedAnnounceResult;
|
|
54
|
+
//# sourceMappingURL=useDebouncedAnnounce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedAnnounce.d.ts","sourceRoot":"","sources":["../../../../../src/components/Accessibility/scheduling/useDebouncedAnnounce.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAElF,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;;OAKG;IACH,QAAQ,EAAE,CACR,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,gBAAgB,KACxB,IAAI,CAAC;IACV,kGAAkG;IAClG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,gBAAgB,KACzB,uBAsCF,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { AriaLiveAnnounce, AriaLivePriority } from '../useAriaLiveAnnouncer';
|
|
2
|
+
export type UseSettledAnnouncementParams = {
|
|
3
|
+
/**
|
|
4
|
+
* While `true`, the announcement is (re)scheduled; when it flips back to `false` the armed/spoken
|
|
5
|
+
* state resets, so the message can fire again the next time `active` becomes `true`.
|
|
6
|
+
*/
|
|
7
|
+
active: boolean;
|
|
8
|
+
/** The message to announce. The latest value is used when the announcement fires. */
|
|
9
|
+
message: string;
|
|
10
|
+
/**
|
|
11
|
+
* A value whose identity changes whenever the surrounding UI is still "in motion" — e.g. the
|
|
12
|
+
* array/string being edited, or a counter you bump on each relevant change. Every change restarts
|
|
13
|
+
* the idle timer, so the announcement only fires once activity has stopped. Pass a value that is
|
|
14
|
+
* stable between changes (an immutably-updated array/string works; avoid a fresh object literal
|
|
15
|
+
* each render, which would reset the timer forever).
|
|
16
|
+
*/
|
|
17
|
+
settleKey: unknown;
|
|
18
|
+
/** Idle window (ms) the `settleKey` must be unchanged before announcing. Default `1500`. */
|
|
19
|
+
idleMs?: number;
|
|
20
|
+
/** Announce at most once per `active` epoch. When `false`, re-announces each time it settles again
|
|
21
|
+
* while still active. Default `true`. */
|
|
22
|
+
once?: boolean;
|
|
23
|
+
/** Live-region priority. Default `'polite'`. */
|
|
24
|
+
priority?: AriaLivePriority;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Announce a message via a live region, but only after the surrounding UI has gone idle.
|
|
28
|
+
*
|
|
29
|
+
* Use this when an immediate announcement would be **swallowed by the screen reader's own speech** —
|
|
30
|
+
* its typing echo, or the field/group re-read it performs when nearby DOM mutates. Such a read-out
|
|
31
|
+
* supersedes a competing live-region update *at any priority*, so the fix is not to fight it but to
|
|
32
|
+
* wait it out: each change to `settleKey` restarts an idle timer, and the message is announced only
|
|
33
|
+
* once the user has paused and the screen reader has fallen quiet — landing in a calm moment instead
|
|
34
|
+
* of being cut off.
|
|
35
|
+
*
|
|
36
|
+
* Typical shape: `active` is the condition that makes the announcement relevant (e.g. some controls
|
|
37
|
+
* just became available), and `settleKey` is the thing still changing (e.g. the list/text being
|
|
38
|
+
* edited). The announcement fires once per `active` epoch and re-arms when `active` goes false.
|
|
39
|
+
*
|
|
40
|
+
* Composable L2 policy over `announce` (from `useAriaLiveAnnouncer`), like
|
|
41
|
+
* {@link useDebouncedAnnounce}. React 17/18/19 compatible — `useEffect`/`useRef` only; the pending
|
|
42
|
+
* timer is cleared on unmount.
|
|
43
|
+
*
|
|
44
|
+
* ## When to use this vs. {@link useDebouncedAnnounce}
|
|
45
|
+
*
|
|
46
|
+
* Both wait out screen-reader noise (the typing echo / field re-read) before speaking, but they
|
|
47
|
+
* model different problems:
|
|
48
|
+
*
|
|
49
|
+
* - **`useSettledAnnouncement` — a declarative ONE-SHOT cue for a STATE CHANGE.** You pass
|
|
50
|
+
* `{ active, message, settleKey }` and it reacts: it announces *once* when `active`, deferred
|
|
51
|
+
* until `settleKey` stops changing, then stays silent until `active` flips false and true again.
|
|
52
|
+
* The message is fixed; the point is "say this single fact once the UI settles". Canonical case:
|
|
53
|
+
* "the reorder/remove controls just became available" once the option list stops mutating.
|
|
54
|
+
*
|
|
55
|
+
* - **{@link useDebouncedAnnounce} — an imperative throttle for a value you announce REPEATEDLY.**
|
|
56
|
+
* You call `announce(key, message, ...)` yourself whenever you have a fresh value; rapid calls on
|
|
57
|
+
* a key collapse to the last. The message typically *changes* and it fires *again and again* (once
|
|
58
|
+
* per pause). Canonical case: the autocomplete result count re-announced as the user keeps typing.
|
|
59
|
+
* It has no notion of `active`/`once`/re-arming.
|
|
60
|
+
*
|
|
61
|
+
* | | `useDebouncedAnnounce` | `useSettledAnnouncement` |
|
|
62
|
+
* | --- | --- | --- |
|
|
63
|
+
* | Style | Imperative — you call `announce(key, …)` | Declarative — reacts to `{ active, message, settleKey }` |
|
|
64
|
+
* | Repetition | Fires repeatedly, once per pause | Once per `active` epoch (re-arms on reset) |
|
|
65
|
+
* | Message | Typically changes each time | Fixed fact |
|
|
66
|
+
* | Timer reset | Each explicit call | Each `settleKey` change |
|
|
67
|
+
* | Streams | Many, independent per `key` | One logical cue |
|
|
68
|
+
* | Canonical case | Autocomplete count while typing | "Controls just became available" |
|
|
69
|
+
*
|
|
70
|
+
* Rule of thumb: announcing a **fixed fact once, after things settle** → this hook. Announcing the
|
|
71
|
+
* **latest value of a changing thing** (repeatedly) → `useDebouncedAnnounce`.
|
|
72
|
+
*/
|
|
73
|
+
export declare const useSettledAnnouncement: (announce: AriaLiveAnnounce, { active, idleMs, message, once, priority, settleKey, }: UseSettledAnnouncementParams) => void;
|
|
74
|
+
//# sourceMappingURL=useSettledAnnouncement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSettledAnnouncement.d.ts","sourceRoot":"","sources":["../../../../../src/components/Accessibility/scheduling/useSettledAnnouncement.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAElF,MAAM,MAAM,4BAA4B,GAAG;IACzC;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,qFAAqF;IACrF,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;6CACyC;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gDAAgD;IAChD,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,gBAAgB,EAC1B,yDAOG,4BAA4B,SA4ChC,CAAC"}
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
export type AriaLivePriority = 'assertive' | 'polite';
|
|
2
|
-
export type
|
|
2
|
+
export type AriaLiveAnnounceOptions = {
|
|
3
|
+
priority?: AriaLivePriority;
|
|
4
|
+
/**
|
|
5
|
+
* Delay (ms) before the message is placed in the live region. Use to let a competing
|
|
6
|
+
* screen-reader utterance settle first — e.g. a dialog-identity announcement made while a
|
|
7
|
+
* field is being auto-focused is otherwise superseded by the field's focus announcement.
|
|
8
|
+
* Omitted/0 announces immediately.
|
|
9
|
+
*/
|
|
10
|
+
delayMs?: number;
|
|
11
|
+
/**
|
|
12
|
+
* When set, an identical `message` is announced at most once per this window (ms); a repeat
|
|
13
|
+
* within the window is suppressed (returns a no-op cancel). The window starts when the message
|
|
14
|
+
* is actually announced. Guards against duplicate announcements — e.g. an effect double-invoked
|
|
15
|
+
* by React StrictMode, or rapid re-renders firing the same message.
|
|
16
|
+
*/
|
|
17
|
+
dedupeMs?: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Announce `message` to assistive technology. Delivery is controlled by an options object
|
|
21
|
+
* (`priority` defaults to `'polite'`). Returns a `cancel` function: for a delayed announcement it
|
|
22
|
+
* prevents a still-pending message from being announced (call it from effect cleanup so a closing
|
|
23
|
+
* surface does not announce after unmount); for an immediate announcement it is a no-op.
|
|
24
|
+
*/
|
|
25
|
+
export type AriaLiveAnnounce = (message: string, options?: AriaLiveAnnounceOptions) => () => void;
|
|
3
26
|
export type AriaLiveAnnouncerContextValue = {
|
|
4
27
|
announce: AriaLiveAnnounce;
|
|
5
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAriaLiveAnnouncer.d.ts","sourceRoot":"","sources":["../../../../src/components/Accessibility/useAriaLiveAnnouncer.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"useAriaLiveAnnouncer.d.ts","sourceRoot":"","sources":["../../../../src/components/Accessibility/useAriaLiveAnnouncer.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEtD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,uBAAuB,KAC9B,MAAM,IAAI,CAAC;AAEhB,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAIF,eAAO,MAAM,wBAAwB,oEAEzB,CAAC;AAEb,eAAO,MAAM,oBAAoB,wBAYhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentActions.d.ts","sourceRoot":"","sources":["../../../../src/components/Attachment/AttachmentActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentActions.d.ts","sourceRoot":"","sources":["../../../../src/components/Attachment/AttachmentActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAMjF,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG;IAChD,wBAAwB;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,+HAA+H;IAC/H,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,+EAA+E;IAC/E,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,OAAO,CACvD,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAChD,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,mCAElD,CAAC;AAEF,QAAA,MAAM,2BAA2B,GAAI,OAAO,sBAAsB,4CAoKjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAEzB,OAAO,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Giphy.d.ts","sourceRoot":"","sources":["../../../../src/components/Attachment/Giphy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Giphy.d.ts","sourceRoot":"","sources":["../../../../src/components/Attachment/Giphy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAc9C,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,gBAAgB,oBAAoB,mDA4DzD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** True when a string looks like a media URL (so it must NOT be used as an accessible name). */
|
|
2
|
+
export declare const looksLikeUrl: (value?: string | null) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a human, non-URL giphy title for accessible naming/announcements, or `undefined`.
|
|
5
|
+
* Giphy payloads rarely carry a real title (they often fall back to a media URL), so callers
|
|
6
|
+
* should provide a generic label when this returns `undefined`. Shared by `Giphy` (the image's
|
|
7
|
+
* accessible name) and `AttachmentActions` (the shuffle announcement) so the
|
|
8
|
+
* two stay in sync.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getGiphyDescriptiveTitle: (title?: string | null) => string | undefined;
|
|
11
|
+
//# sourceMappingURL=giphyAccessibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"giphyAccessibility.d.ts","sourceRoot":"","sources":["../../../../src/components/Attachment/giphyAccessibility.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,OACV,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,MAAM,GAAG,SAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithAudioPlayback.d.ts","sourceRoot":"","sources":["../../../../src/components/AudioPlayback/WithAudioPlayback.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"WithAudioPlayback.d.ts","sourceRoot":"","sources":["../../../../src/components/AudioPlayback/WithAudioPlayback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AASxD,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAMF,eAAO,MAAM,iBAAiB,GAAI,wCAG/B,sBAAsB,4CAexB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AAKrD,eAAO,MAAM,cAAc,GAAI,uGAU5B,mBAAmB,oDAyCrB,CAAC;AAMF,eAAO,MAAM,oBAAoB,8DAKhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelListUI.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelList/ChannelListUI.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ChannelListUI.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelList/ChannelListUI.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAOhF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,qEAAqE;IACrE,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAClD,+GAA+G;IAC/G,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC;IAC3B,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,WAAW,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;CAC/D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,iBAAiB,CAAC,kBAAkB,CAAC,4CA2BzE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './useConnectionRecoveredListener';
|
|
2
2
|
export * from './usePaginatedChannels';
|
|
3
|
+
export * from './useChannelListKeyboardNavigation';
|
|
3
4
|
export * from './useChannelMembershipState';
|
|
4
5
|
export * from './useChannelMembersState';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChannelList/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChannelList/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MouseEvent as ReactMouseEvent, RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Keyboard navigation for the channel list (`role="listbox"`). Returns handlers to spread onto the
|
|
4
|
+
* listbox element:
|
|
5
|
+
* - **ArrowUp/ArrowDown/Home/End** move focus between the channel rows (`role="option"`) and the
|
|
6
|
+
* **Load more** button (the last roving target when present).
|
|
7
|
+
* - **ArrowRight** moves focus from a row to its actions button (the menu is then navigable with
|
|
8
|
+
* Up/Down via the ContextMenu's own roving focus).
|
|
9
|
+
* - **ArrowLeft** moves focus from a row's actions back to the row.
|
|
10
|
+
* - When **Load more** is activated, focus moves to the **first item of the newly loaded page** once
|
|
11
|
+
* it renders.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useChannelListKeyboardNavigation: (listboxRef: RefObject<HTMLElement | null>) => {
|
|
14
|
+
onClickCapture: (event: ReactMouseEvent<HTMLElement>) => void;
|
|
15
|
+
onKeyDown: (event: import("react").KeyboardEvent<HTMLElement>) => void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useChannelListKeyboardNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChannelListKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChannelList/hooks/useChannelListKeyboardNavigation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBtE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gCAAgC,GAC3C,YAAY,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;4BAyCV,eAAe,CAAC,WAAW,CAAC;;CA+C5D,CAAC"}
|
|
@@ -3,8 +3,15 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
import type { Channel, LocalMessage } from 'stream-chat';
|
|
4
4
|
import type { MessageDeliveryStatus } from './hooks/useMessageDeliveryStatus';
|
|
5
5
|
import type { GroupChannelDisplayInfo } from './utils';
|
|
6
|
+
import type { ChannelListItemLabelConfig } from './utils.a11y';
|
|
6
7
|
import { type ChatContextValue, type TranslationContextValue } from '../../context';
|
|
7
8
|
export type ChannelListItemUIProps = ChannelListItemProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Configures the row's composed accessible name (part overrides, order, separator, or a full
|
|
11
|
+
* `build`). Supply it from a `ComponentContext`-provided `ChannelListItemUI` to customize the
|
|
12
|
+
* announcement. See `composeChannelListItemAccessibleLabel`.
|
|
13
|
+
*/
|
|
14
|
+
accessibleLabelConfig?: ChannelListItemLabelConfig;
|
|
8
15
|
/** Image of Channel to display */
|
|
9
16
|
displayImage?: string;
|
|
10
17
|
/** Title of Channel to display */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/ChannelListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KA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C;AAMF,eAAO,MAAM,yBAAyB;aAJwB,OAAO;CAIY,CAAC;AAElF,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,mDA4I1D,CAAC"}
|
package/dist/types/components/ChannelListItem/ChannelListItemActionButtons.defaults.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelListItemActionButtons.defaults.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ChannelListItemActionButtons.defaults.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAK3B,MAAM,OAAO,CAAC;AAiUf,KAAK,iBAAiB,GAClB,CAAC,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,UAAU,CAAA;CAAE,CAAC,GAAG;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC;CAChC,CAAC,GACF;IACE,SAAS,EAAE,uBAAuB,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;CACjE,CAAC;AAoJN,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,EA8BtD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,kBAAkB,iBAAiB,EAAE,wBAiClF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelListItemUI.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/ChannelListItemUI.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChannelListItemUI.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/ChannelListItemUI.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAIhE,QAAA,MAAM,2BAA2B,GAAI,OAAO,sBAAsB,4CAkJjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAEzB,OAAO,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Channel, LocalMessage, StreamChat } from 'stream-chat';
|
|
2
|
+
import type { ChatContextValue } from '../../context';
|
|
3
|
+
import type { TranslationContextValue } from '../../context/TranslationContext';
|
|
4
|
+
import { type AccessibleLabelConfig, type AccessibleLabelPart } from '../../a11y/accessibleLabel';
|
|
5
|
+
import { MessageDeliveryStatus } from './hooks/useMessageDeliveryStatus';
|
|
6
|
+
/**
|
|
7
|
+
* Everything a label part needs. Gathered by `ChannelListItemUI` from its props + contexts and
|
|
8
|
+
* handed to each {@link ChannelListItemLabelPart}.
|
|
9
|
+
*/
|
|
10
|
+
export type ChannelListItemLabelData = {
|
|
11
|
+
/** Whether the row is the active (currently open) channel. */
|
|
12
|
+
active?: boolean;
|
|
13
|
+
/** The channel whose latest message is summarized. */
|
|
14
|
+
channel: Channel;
|
|
15
|
+
/** Client, used to detect whether the latest message is the current user's own. */
|
|
16
|
+
client: StreamChat;
|
|
17
|
+
/** Channel display name. */
|
|
18
|
+
displayTitle?: string;
|
|
19
|
+
isMessageAIGenerated?: ChatContextValue['isMessageAIGenerated'];
|
|
20
|
+
/**
|
|
21
|
+
* The channel's latest message. {@link composeChannelListItemAccessibleLabel} resolves this once
|
|
22
|
+
* (to the last entry of `channel.state.latestMessages` when omitted) and passes the SAME message
|
|
23
|
+
* to every part, so all segments (sender, preview, attachments, time) describe one message.
|
|
24
|
+
*/
|
|
25
|
+
latestMessage?: LocalMessage;
|
|
26
|
+
/** Delivery/read status of the latest message when it is the current user's own. */
|
|
27
|
+
messageDeliveryStatus?: MessageDeliveryStatus;
|
|
28
|
+
t: TranslationContextValue['t'];
|
|
29
|
+
tDateTimeParser: TranslationContextValue['tDateTimeParser'];
|
|
30
|
+
/** Unread count for the channel. */
|
|
31
|
+
unreadCount?: number;
|
|
32
|
+
userLanguage?: TranslationContextValue['userLanguage'];
|
|
33
|
+
};
|
|
34
|
+
/** Produces one segment of the accessible name; return `undefined`/empty to omit it. */
|
|
35
|
+
export type ChannelListItemLabelPart = AccessibleLabelPart<ChannelListItemLabelData>;
|
|
36
|
+
/**
|
|
37
|
+
* The default, named label parts. Each is independently overridable via
|
|
38
|
+
* {@link ChannelListItemLabelConfig.parts}. The active (currently open) state is announced here (not
|
|
39
|
+
* left to the row's `aria-selected` alone, which is not reliably spoken across screen readers for an
|
|
40
|
+
* option with a custom name); `aria-selected` is kept on the active row for listbox semantics.
|
|
41
|
+
*/
|
|
42
|
+
export declare const defaultChannelListItemLabelParts: {
|
|
43
|
+
active: AccessibleLabelPart<{
|
|
44
|
+
t: TranslationContextValue["t"];
|
|
45
|
+
} & {
|
|
46
|
+
active?: boolean;
|
|
47
|
+
}>;
|
|
48
|
+
attachments: ({ latestMessage, t }: ChannelListItemLabelData) => string | undefined;
|
|
49
|
+
deliveryStatus: ({ messageDeliveryStatus, t }: ChannelListItemLabelData) => string | undefined;
|
|
50
|
+
lastMessage: ({ channel, client, isMessageAIGenerated, latestMessage, t, userLanguage, }: ChannelListItemLabelData) => string;
|
|
51
|
+
linkPreview: ({ latestMessage, t }: ChannelListItemLabelData) => string | undefined;
|
|
52
|
+
name: ({ displayTitle }: ChannelListItemLabelData) => string | undefined;
|
|
53
|
+
time: ({ latestMessage, t, tDateTimeParser }: ChannelListItemLabelData) => string | undefined;
|
|
54
|
+
unreadCount: AccessibleLabelPart<{
|
|
55
|
+
t: TranslationContextValue["t"];
|
|
56
|
+
} & {
|
|
57
|
+
unreadCount?: number;
|
|
58
|
+
}>;
|
|
59
|
+
};
|
|
60
|
+
/** Default order the parts are assembled in (reading order). */
|
|
61
|
+
export declare const DEFAULT_CHANNEL_LIST_ITEM_LABEL_ORDER: readonly ["name", "active", "unreadCount", "lastMessage", "attachments", "linkPreview", "deliveryStatus", "time"];
|
|
62
|
+
export type ChannelListItemLabelConfig = AccessibleLabelConfig<ChannelListItemLabelData>;
|
|
63
|
+
/**
|
|
64
|
+
* Composes a single, coherent accessible name for a channel list row from named parts. The default
|
|
65
|
+
* reading order is name → unread → last message (sender + preview) → delivery status → time.
|
|
66
|
+
*
|
|
67
|
+
* ## Customizing the label
|
|
68
|
+
*
|
|
69
|
+
* The label is generated by `ChannelListItemUI`, which accepts an `accessibleLabelConfig` prop. To
|
|
70
|
+
* customize it, supply your own `ChannelListItemUI` through `ComponentContext` (the same way the
|
|
71
|
+
* component is overridden) and forward the config — no new plumbing:
|
|
72
|
+
*
|
|
73
|
+
* ```tsx
|
|
74
|
+
* const MyChannelPreview = (props) => (
|
|
75
|
+
* <DefaultChannelListItemUI {...props} accessibleLabelConfig={accessibleLabelConfig} />
|
|
76
|
+
* );
|
|
77
|
+
* // <ComponentProvider value={{ ChannelListItemUI: MyChannelPreview }}> … </ComponentProvider>
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* ### Adding custom parts (e.g. Pinned, Muted, Frozen)
|
|
81
|
+
*
|
|
82
|
+
* - {@link ChannelListItemLabelConfig.parts} is merged over {@link defaultChannelListItemLabelParts},
|
|
83
|
+
* so a new key is *added* and a same-named key *overrides* the default.
|
|
84
|
+
* - A part returns its segment string, or `undefined`/`''` to be omitted (so e.g. "Pinned" is only
|
|
85
|
+
* spoken when actually pinned).
|
|
86
|
+
* - {@link ChannelListItemLabelConfig.order} decides which parts are included AND their sequence —
|
|
87
|
+
* **a part not listed in `order` is never rendered**, even if defined. Spread
|
|
88
|
+
* {@link DEFAULT_CHANNEL_LIST_ITEM_LABEL_ORDER} to keep the defaults and insert your own.
|
|
89
|
+
* - Each part receives {@link ChannelListItemLabelData}. `active`/`unreadCount`/
|
|
90
|
+
* `messageDeliveryStatus` are passed directly and `latestMessage` is pre-resolved by the composer
|
|
91
|
+
* (see its doc); everything else (mute/pin state, `frozen`, member count, custom `channel.data`) is
|
|
92
|
+
* read off `channel`. Parts call `t`, so provide your own i18n keys (or return plain strings) —
|
|
93
|
+
* the SDK does not ship `Pinned`/`Muted`/`Frozen` strings.
|
|
94
|
+
*
|
|
95
|
+
* ```tsx
|
|
96
|
+
* const accessibleLabelConfig: ChannelListItemLabelConfig = {
|
|
97
|
+
* parts: {
|
|
98
|
+
* pinned: ({ channel, t }) => (channel.state.membership?.pinned_at ? t('Pinned') : undefined),
|
|
99
|
+
* muted: ({ channel, t }) => (channel.muteStatus().muted ? t('Muted') : undefined),
|
|
100
|
+
* frozen: ({ channel, t }) => (channel.data?.frozen ? t('Frozen') : undefined),
|
|
101
|
+
* },
|
|
102
|
+
* order: ['name', 'pinned', 'muted', 'frozen', ...DEFAULT_CHANNEL_LIST_ITEM_LABEL_ORDER.slice(1)],
|
|
103
|
+
* };
|
|
104
|
+
* // → "General. Pinned. Muted. 3 unread messages. Last message from Alice: hi. 2 days ago"
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* For full control, set {@link ChannelListItemLabelConfig.build} (return the entire string), or
|
|
108
|
+
* write a custom `ChannelListItemUI` that calls this function directly — importing
|
|
109
|
+
* {@link defaultChannelListItemLabelParts} to reuse the built-ins.
|
|
110
|
+
*/
|
|
111
|
+
export declare const composeChannelListItemAccessibleLabel: (data: ChannelListItemLabelData, config?: ChannelListItemLabelConfig) => string;
|
|
112
|
+
//# sourceMappingURL=utils.a11y.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.a11y.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/utils.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAIzB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,OAAO,EAAE,OAAO,CAAC;IACjB,mFAAmF;IACnF,MAAM,EAAE,UAAU,CAAC;IACnB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;IAChE;;;;OAIG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,oFAAoF;IACpF,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,CAAC,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC;IAChC,eAAe,EAAE,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;IAC5D,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;CACxD,CAAC;AAEF,wFAAwF;AACxF,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;CA6EO,CAAC;AAErD,gEAAgE;AAChE,eAAO,MAAM,qCAAqC,mHASxC,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,wBAAwB,CAAC,CAAC;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,qCAAqC,GAChD,MAAM,wBAAwB,EAC9B,SAAQ,0BAA+B,KACtC,MAcA,CAAC"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { Channel } from 'stream-chat';
|
|
2
|
+
import type { Channel, LocalMessage } from 'stream-chat';
|
|
3
3
|
import type { ChatContextValue } from '../../context';
|
|
4
4
|
import type { TranslationContextValue } from '../../context/TranslationContext';
|
|
5
5
|
export declare const renderPreviewText: (text: string) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The text announced for the channel's latest message (for an accessible name / live region).
|
|
8
|
+
* Non-text content gets a concise, screen-reader-friendly phrasing that may differ from the visible
|
|
9
|
+
* preview: a poll announces its question, an attachment its type, a shared location and a deleted
|
|
10
|
+
* message a plain phrase. User-message text is stripped of markdown so the words are read, not the
|
|
11
|
+
* syntax (AI-generated text is returned verbatim, matching the display path).
|
|
12
|
+
*/
|
|
13
|
+
export declare const getLatestMessagePreviewText: (channel: Channel, t: TranslationContextValue["t"], userLanguage?: TranslationContextValue["userLanguage"], isMessageAIGenerated?: ChatContextValue["isMessageAIGenerated"], latestMessage?: LocalMessage) => string;
|
|
14
|
+
export declare const getLatestMessagePreview: (channel: Channel, t: TranslationContextValue["t"], userLanguage?: TranslationContextValue["userLanguage"], isMessageAIGenerated?: ChatContextValue["isMessageAIGenerated"], latestMessage?: LocalMessage) => ReactNode;
|
|
7
15
|
export type GroupChannelDisplayInfoMember = {
|
|
8
16
|
imageUrl?: string;
|
|
9
17
|
userName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/ChannelListItem/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAY,MAAM,aAAa,CAAC;AAKnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAahF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,4CAI7C,CAAC;AAkNF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,OAAO,EAChB,GAAG,uBAAuB,CAAC,GAAG,CAAC,EAC/B,eAAc,uBAAuB,CAAC,cAAc,CAAQ,EAC5D,uBAAuB,gBAAgB,CAAC,sBAAsB,CAAC,EAC/D,gBAAgB,YAAY,KAC3B,MA2CF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,SAAS,OAAO,EAChB,GAAG,uBAAuB,CAAC,GAAG,CAAC,EAC/B,eAAc,uBAAuB,CAAC,cAAc,CAAQ,EAC5D,uBAAuB,gBAAgB,CAAC,sBAAsB,CAAC,EAC/D,gBAAgB,YAAY,KAC3B,SAeF,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,6BAA6B,EAAE,CAAC;IACzC,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,OAAO,EAChB,gBAAgB,MAAM,KACrB,MAAM,GAAG,SAWX,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,SAAS,OAAO,KACf,uBAAuB,GAAG,SAa5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAGL,gBAAgB,EAEjB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAGL,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAqDxD,MAAM,MAAM,SAAS,GAAG;IACtB,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,8FAA8F;IAC9F,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,oGAAoG;IACpG,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,8BAA8B;IAC9B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,8EAA8E;IAC9E,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,iBAAiB,CAAC,SAAS,CAAC,mDA8EvD,CAAC"}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* ChatView is a top-level view switcher between two parallel, independent
|
|
3
|
+
* surfaces (channels and threads). It is NOT a WAI-ARIA Tabs widget: each view
|
|
4
|
+
* owns its own composer and message list and is not a panel of a single
|
|
5
|
+
* composite widget. The selector is a navigation landmark (role="navigation")
|
|
6
|
+
* whose buttons mark the active surface via aria-current="true" (generic
|
|
7
|
+
* "current item"; not "page", since the SDK may be embedded in a larger host UI).
|
|
4
8
|
*
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
7
|
-
*
|
|
8
|
-
* - unique id
|
|
9
|
-
* - aria-controls=<panel-id>
|
|
10
|
-
* - aria-selected
|
|
11
|
-
* - tabIndex=0 (all tabs tabbable)
|
|
12
|
-
* - Active panel container is role="tabpanel" with:
|
|
13
|
-
* - id=<panel-id>
|
|
14
|
-
* - aria-labelledby=<tab-id>
|
|
15
|
-
*
|
|
16
|
-
* The a11y helper module exists to generate and share those tab/panel IDs per
|
|
17
|
-
* ChatView instance, so tab ↔ tabpanel linkage stays correct and collision-safe
|
|
18
|
-
* when multiple ChatViews exist.
|
|
9
|
+
* The helper generates stable per-instance DOM ids for the view containers so
|
|
10
|
+
* integrators (skip-links, programmatic focus) have predictable hooks even
|
|
11
|
+
* when multiple ChatViews coexist.
|
|
19
12
|
*/
|
|
20
13
|
export type ChatViewA11yContextValue = {
|
|
21
14
|
chatViewPanelIds: Record<'channels' | 'threads', string>;
|
|
22
|
-
chatViewTabIds: Record<'channels' | 'threads', string>;
|
|
23
15
|
};
|
|
24
16
|
export declare const DEFAULT_CHAT_VIEW_A11Y_CONTEXT_VALUE: ChatViewA11yContextValue;
|
|
25
17
|
export declare const createChatViewA11yContextValue: (chatViewId: string) => ChatViewA11yContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatView.a11y.utility.d.ts","sourceRoot":"","sources":["../../../../src/components/ChatView/ChatView.a11y.utility.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ChatView.a11y.utility.d.ts","sourceRoot":"","sources":["../../../../src/components/ChatView/ChatView.a11y.utility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,gBAAgB,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,EAAE,MAAM,CAAC,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,wBAKlD,CAAC;AAEF,eAAO,MAAM,8BAA8B,GACzC,YAAY,MAAM,KACjB,wBAKD,CAAC"}
|
|
@@ -4,13 +4,13 @@ import type { PropsWithChildren } from 'react';
|
|
|
4
4
|
import type { Thread } from 'stream-chat';
|
|
5
5
|
export type ChatView = 'channels' | 'threads';
|
|
6
6
|
/**
|
|
7
|
-
* ChatView
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* ChatView switches between two independent surfaces, not panels in a single
|
|
8
|
+
* WAI-ARIA Tabs widget. The selector is a navigation landmark
|
|
9
|
+
* (`role="navigation"`) holding one button per surface; the button for the
|
|
10
|
+
* surface currently shown is marked with `aria-current="true"` (the "current
|
|
11
|
+
* item in a set" — not `"page"`, since this SDK view may be embedded in a larger
|
|
12
|
+
* host UI that owns the page). View wrappers stay plain `<div>`s to avoid leaking
|
|
13
|
+
* ancestor context into descendants like the composer textarea.
|
|
14
14
|
*/
|
|
15
15
|
type ChatViewContextValue = {
|
|
16
16
|
activeChatView: ChatView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatView.d.ts","sourceRoot":"","sources":["../../../../src/components/ChatView/ChatView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,KAAK,aAAa,EAMnB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAsBrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAsB,MAAM,aAAa,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAE9C;;;;;;;;GAQG;AACH,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,QAAQ,CAAC;IACzB,iBAAiB,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,eAAe,iDAA6D,CAAC;AAK1F,eAAO,MAAM,kBAAkB,4BAW9B,CAAC;AAGF,eAAO,MAAM,QAAQ;mBAAkB,iBAAiB;6BAsBpB,iBAAiB;
|
|
1
|
+
{"version":3,"file":"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IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,4CA6BA,CAAC;AAWF,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,eAE5C,yBAAyB,4CAkB3B,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,eAE3C,yBAAyB,4CAmC3B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAC1D,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,qBAAqB,EASjE,CAAC"}
|
|
@@ -84,7 +84,7 @@ type ButtonWithSubmenuProps = {
|
|
|
84
84
|
};
|
|
85
85
|
type ContextMenuButtonProps = BaseContextMenuButtonProps & Partial<ButtonWithSubmenuProps>;
|
|
86
86
|
export declare const ContextMenuButton: (props: ContextMenuButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
87
|
-
export declare const ContextMenuBackButton: ({ children, className, role, ...props }: ComponentProps<"button">) => import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export declare const ContextMenuBackButton: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, role, ...props }: ComponentProps<"button">) => import("react/jsx-runtime").JSX.Element;
|
|
88
88
|
export declare const ContextMenuHeader: ({ children, className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
89
89
|
export declare const ContextMenuBody: ({ children, className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
90
90
|
export declare const ContextMenuRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -101,6 +101,15 @@ type ContextMenuFocusRestoreRequest = {
|
|
|
101
101
|
index: number;
|
|
102
102
|
target: HTMLElement | null;
|
|
103
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Where focus should land when a submenu OPENS (forward navigation):
|
|
106
|
+
* - `'first-item'` (default): the first focusable item that is NOT in the header — i.e. the first
|
|
107
|
+
* real menu option, skipping a back-button header — falling back to the very first item when the
|
|
108
|
+
* body has none.
|
|
109
|
+
* - `'first'`: the first focusable item overall (the back-button header when present).
|
|
110
|
+
* - `'none'`: do not move focus on open.
|
|
111
|
+
*/
|
|
112
|
+
export type ContextMenuSubmenuInitialFocus = 'first' | 'first-item' | 'none';
|
|
104
113
|
export type ContextMenuKeyboardNavigation = {
|
|
105
114
|
/**
|
|
106
115
|
* CSS selector used to collect focusable menu items.
|
|
@@ -119,6 +128,11 @@ type ContextMenuContextValue = {
|
|
|
119
128
|
export declare const useContextMenuContext: () => ContextMenuContextValue;
|
|
120
129
|
type ContextMenuLevel = {
|
|
121
130
|
focusRestoreRequest?: ContextMenuFocusRestoreRequest;
|
|
131
|
+
/**
|
|
132
|
+
* Where focus lands when this level is opened as a submenu (forward navigation). Defaults to
|
|
133
|
+
* `'first-item'`. Ignored for the root level (its initial focus is the dialog's `autoFocus`).
|
|
134
|
+
*/
|
|
135
|
+
initialFocus?: ContextMenuSubmenuInitialFocus;
|
|
122
136
|
items?: ContextMenuItemComponent[];
|
|
123
137
|
Submenu?: ContextMenuSubmenu;
|
|
124
138
|
Header?: ContextMenuHeaderComponent;
|
|
@@ -126,6 +140,7 @@ type ContextMenuLevel = {
|
|
|
126
140
|
menuClassName?: string;
|
|
127
141
|
};
|
|
128
142
|
type ContextMenuBaseProps = ComponentPropsWithoutRef<'div'> & {
|
|
143
|
+
backButtonAriaLabel?: string;
|
|
129
144
|
backLabel?: ReactNode;
|
|
130
145
|
enableAnimations?: boolean;
|
|
131
146
|
Header?: ContextMenuHeaderComponent;
|
|
@@ -155,7 +170,7 @@ export type ContextMenuContentProps = ContextMenuBaseProps & {
|
|
|
155
170
|
* customize submenu/back navigation behavior while keeping the same anchor/focus
|
|
156
171
|
* handling from `ContextMenu`.
|
|
157
172
|
*/
|
|
158
|
-
export declare function ContextMenuContent({ anchorReferenceElement, backLabel, children, className, enableAnimations, Header, items, ItemsWrapper, keyboardNavigation, menuClassName, onClose, onMenuLevelChange, transitionDirection, ...props }: ContextMenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
173
|
+
export declare function ContextMenuContent({ anchorReferenceElement, backButtonAriaLabel, backLabel, children, className, enableAnimations, Header, items, ItemsWrapper, keyboardNavigation, menuClassName, onClose, onMenuLevelChange, transitionDirection, ...props }: ContextMenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
159
174
|
/**
|
|
160
175
|
* Contextual actions menu that can be used in two modes:
|
|
161
176
|
*
|