stream-chat-react 14.8.0 → 14.10.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/channel-detail.js +30 -22
- package/dist/cjs/channel-detail.js.map +1 -1
- package/dist/cjs/index.js +73 -72
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{useChannelHeaderOnlineStatus.72753090.js → useChannelHeaderOnlineStatus.6ace991c.js} +42 -26
- package/dist/cjs/useChannelHeaderOnlineStatus.6ace991c.js.map +1 -0
- package/dist/cjs/useNotificationApi.bf76a16b.js.map +1 -1
- package/dist/css/index.css +22 -19
- package/dist/css/index.css.map +1 -1
- package/dist/es/channel-detail.mjs +30 -22
- package/dist/es/channel-detail.mjs.map +1 -1
- package/dist/es/index.mjs +66 -73
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/{useChannelHeaderOnlineStatus.c86db868.mjs → useChannelHeaderOnlineStatus.d6065c22.mjs} +37 -27
- package/dist/es/useChannelHeaderOnlineStatus.d6065c22.mjs.map +1 -0
- package/dist/es/useNotificationApi.ed6bff88.mjs.map +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +7 -2
- package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/components/Avatar/utils.d.ts +3 -0
- package/dist/types/components/Avatar/utils.d.ts.map +1 -0
- package/dist/types/components/ChannelListItem/utils.d.ts.map +1 -1
- package/dist/types/components/Dialog/components/ContextMenu.d.ts.map +1 -1
- package/dist/types/components/Message/MessageRepliesCountButton.d.ts.map +1 -1
- package/dist/types/components/Message/MessageUI.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentSelector/AttachmentSelector.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/Poll/PollOptionSelector.d.ts.map +1 -1
- package/dist/types/components/Poll/PollVote.d.ts.map +1 -1
- package/dist/types/components/ReactFileUtilities/UploadButton.d.ts.map +1 -1
- package/dist/types/components/Reactions/MessageReactionsDetail.d.ts.map +1 -1
- package/dist/types/components/Search/SearchResults/SearchResultItem.d.ts.map +1 -1
- package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/UserItem.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadListItemUI.d.ts.map +1 -1
- package/dist/types/components/TypingIndicator/TypingIndicator.d.ts.map +1 -1
- package/dist/types/components/TypingIndicator/hooks/useDebouncedTypingActive.d.ts +2 -8
- package/dist/types/components/TypingIndicator/hooks/useDebouncedTypingActive.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/context/ComponentContext.d.ts +4 -0
- package/dist/types/context/ComponentContext.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/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesView.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/useChannelHeaderOnlineStatus.72753090.js.map +0 -1
- package/dist/es/useChannelHeaderOnlineStatus.c86db868.mjs.map +0 -1
|
@@ -530,16 +530,19 @@ var getInitials = (name) => {
|
|
|
530
530
|
/**
|
|
531
531
|
* A round avatar image with fallback to username's first letter
|
|
532
532
|
*/
|
|
533
|
-
var Avatar = ({ className, FallbackIcon = IconUser, imageUrl, isOnline, size, userName, ...rest }) => {
|
|
533
|
+
var Avatar = ({ className, FallbackIcon = IconUser, imageUrl, initials: customInitials, isOnline, size, userName, ...rest }) => {
|
|
534
534
|
const [error, setError] = useState(false);
|
|
535
535
|
useEffect(() => () => setError(false), [imageUrl]);
|
|
536
|
-
const nameString = userName?.toString() || "";
|
|
537
|
-
const avatarImageAlt = nameString.trim();
|
|
536
|
+
const nameString = userName?.toString().trim() || "";
|
|
538
537
|
const sizeAwareInitials = useMemo(() => {
|
|
539
|
-
const initials = getInitials(nameString);
|
|
538
|
+
const initials = customInitials || getInitials(nameString);
|
|
540
539
|
if (size === "sm" || size === "xs") return initials.charAt(0);
|
|
541
540
|
return initials;
|
|
542
|
-
}, [
|
|
541
|
+
}, [
|
|
542
|
+
nameString,
|
|
543
|
+
size,
|
|
544
|
+
customInitials
|
|
545
|
+
]);
|
|
543
546
|
const showImage = typeof imageUrl === "string" && imageUrl && !error;
|
|
544
547
|
return /* @__PURE__ */ jsxs("div", {
|
|
545
548
|
className: clsx(`str-chat__avatar`, className, {
|
|
@@ -556,7 +559,7 @@ var Avatar = ({ className, FallbackIcon = IconUser, imageUrl, isOnline, size, us
|
|
|
556
559
|
"str-chat__avatar-status-badge--offline": !isOnline,
|
|
557
560
|
"str-chat__avatar-status-badge--online": isOnline
|
|
558
561
|
}) }), showImage ? /* @__PURE__ */ jsx("img", {
|
|
559
|
-
alt:
|
|
562
|
+
alt: nameString,
|
|
560
563
|
className: "str-chat__avatar-image",
|
|
561
564
|
"data-testid": "avatar-img",
|
|
562
565
|
onError: () => setError(true),
|
|
@@ -714,21 +717,24 @@ var BaseContextMenuButton = ({ children, className, details, hasSubMenu, Icon, l
|
|
|
714
717
|
!!hasSubMenu && /* @__PURE__ */ jsx(SubmenuIcon, { className: "str-chat__context-menu__button__submenu-icon" })
|
|
715
718
|
]
|
|
716
719
|
});
|
|
717
|
-
var UserContextMenuButton = ({ children, className, imageUrl, role = "menuitem", userName, ...props }) =>
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
"
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
720
|
+
var UserContextMenuButton = ({ children, className, imageUrl, role = "menuitem", userName, ...props }) => {
|
|
721
|
+
const { Avatar: Avatar$1 = Avatar } = useComponentContext();
|
|
722
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
723
|
+
...props,
|
|
724
|
+
className: clsx("str-chat__context-menu__button str-chat__user-context-menu__button", className),
|
|
725
|
+
role,
|
|
726
|
+
type: "button",
|
|
727
|
+
children: [/* @__PURE__ */ jsx(Avatar$1, {
|
|
728
|
+
"aria-hidden": true,
|
|
729
|
+
imageUrl,
|
|
730
|
+
size: "sm",
|
|
731
|
+
userName
|
|
732
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
733
|
+
className: "str-chat__context-menu__button__label",
|
|
734
|
+
children: children ?? userName
|
|
735
|
+
})]
|
|
736
|
+
});
|
|
737
|
+
};
|
|
732
738
|
var EmojiContextMenuButton = ({ children, className, emoji, label, role = "menuitem", ...props }) => /* @__PURE__ */ jsxs("button", {
|
|
733
739
|
...props,
|
|
734
740
|
className: clsx("str-chat__context-menu__button str-chat__emoji-context-menu__button", className),
|
|
@@ -1484,6 +1490,13 @@ var GlobalModal = ({ "aria-describedby": ariaDescribedby, "aria-label": ariaLabe
|
|
|
1484
1490
|
});
|
|
1485
1491
|
};
|
|
1486
1492
|
//#endregion
|
|
1493
|
+
//#region src/components/Avatar/utils.ts
|
|
1494
|
+
var extractDisplayInfo = ({ user }) => ({
|
|
1495
|
+
id: user?.id,
|
|
1496
|
+
imageUrl: user?.image,
|
|
1497
|
+
userName: user?.name
|
|
1498
|
+
});
|
|
1499
|
+
//#endregion
|
|
1487
1500
|
//#region src/components/Message/renderText/remarkPlugins/htmlToTextPlugin.ts
|
|
1488
1501
|
var visitor = (node) => {
|
|
1489
1502
|
if (node.type !== "html") return;
|
|
@@ -3260,10 +3273,7 @@ var getGroupChannelDisplayInfo = (channel) => {
|
|
|
3260
3273
|
for (const member of members) {
|
|
3261
3274
|
const { user } = member;
|
|
3262
3275
|
if (!user?.name && !user?.image) continue;
|
|
3263
|
-
memberList.push(
|
|
3264
|
-
imageUrl: user.image,
|
|
3265
|
-
userName: user.name
|
|
3266
|
-
});
|
|
3276
|
+
memberList.push(extractDisplayInfo(member));
|
|
3267
3277
|
}
|
|
3268
3278
|
return { members: memberList };
|
|
3269
3279
|
};
|
|
@@ -3884,6 +3894,6 @@ function useChannelHeaderOnlineStatus({ channel: channelOverride, watcherCount:
|
|
|
3884
3894
|
return `${t("{{ memberCount }} members", { memberCount })} · ${t("{{ watcherCount }} online", { watcherCount })}`;
|
|
3885
3895
|
}
|
|
3886
3896
|
//#endregion
|
|
3887
|
-
export {
|
|
3897
|
+
export { BaseContextMenuButton as $, Gallery as A, AriaLiveOutlet as At, formatTime as B, useMessageTranslationViewContext as Bt, Checkbox as C, useAriaIdentifiers as Ct, SwitchFieldDescription as D, useNotifications as Dt, SwitchField as E, LoadingIndicator as Et, toGalleryItemDescriptors as F, ModalContextProvider as Ft, MessageTimestamp as G, FILE_ICON_GRAPHIC_CLASSNAME as H, MessageProvider as Ht, useGalleryContext as I, useModalContext as It, imageToLink as J, Timestamp as K, toBaseImageDescriptors as L, MessageTranslationViewContext as Lt, VideoThumbnail as M, AriaLiveOutletContext as Mt, VideoPlayer as N, useAriaLiveOutletContext as Nt, SwitchFieldLabel as O, NotificationConfigurationProvider as Ot, GalleryContext as P, ModalContext as Pt, Prompt as Q, BaseImage as R, MessageTranslationViewProvider as Rt, TextInput as S, Root as St, Switch as T, FileSizeIndicator as Tt, FILE_ICON_NO_LABEL_CLASSNAME as U, useMessageContext as Ut, FileIcon as V, MessageContext as Vt, DownloadButton as W, extractDisplayInfo as X, htmlToTextPlugin as Y, GlobalModal as Z, getLatestMessagePreview as _, Avatar as _t, pickNewest as a, ContextMenuHeader as at, ListItemLayout as b, Alert as bt, useIsUserMuted as c, EmojiContextMenuButton as ct, useSelectedChannelState as d, createRovingFocusKeyDownHandler as dt, ContextMenu as et, isDmChannel as f, getNextRovingFocusIndex as ft, getGroupChannelDisplayInfo as g, ErrorBadge as gt, getChannelDisplayImage as h, Badge as ht, createDefaultPickNext as i, ContextMenuContent as it, GalleryUI as j, VisuallyHidden as jt, SwitchFieldTitle as k, useNotificationConfigurationContext as kt, useIsChannelMuted as l, UserContextMenuButton as lt, useChannelDisplayName as m, ChannelAvatar as mt, useChannelHasMembersOnline as n, ContextMenuBody as nt, pickOldest as o, ContextMenuRoot as ot, useChannelPreviewInfo as p, GroupAvatar as pt, plusPlusToEmphasis as q, NotificationList as r, ContextMenuButton as rt, Notification as s, DEFAULT_CONTEXT_MENU_KEYBOARD_NAVIGATION_ITEM_SELECTOR as st, useChannelHeaderOnlineStatus as t, ContextMenuBackButton as tt, useChannelMembershipState as u, useContextMenuContext as ut, getLatestMessagePreviewText as v, DialogAnchor as vt, Checkmark as w, useStableCallback as wt, ListItemLayoutContent as x, Header as xt, renderPreviewText as y, useDialogAnchor as yt, ImagePlaceholder as z, getTranslatedMessageText as zt };
|
|
3888
3898
|
|
|
3889
|
-
//# sourceMappingURL=useChannelHeaderOnlineStatus.
|
|
3899
|
+
//# sourceMappingURL=useChannelHeaderOnlineStatus.d6065c22.mjs.map
|