stream-chat-react 14.0.0-beta.6 → 14.0.0-beta.8
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/{WithAudioPlayback.f9abf707.js → WithAudioPlayback.58b0b39b.js} +258 -154
- package/dist/cjs/WithAudioPlayback.58b0b39b.js.map +1 -0
- package/dist/cjs/emojis.js +5 -2
- package/dist/cjs/emojis.js.map +1 -1
- package/dist/cjs/index.js +2935 -2628
- package/dist/cjs/index.js.map +1 -1
- package/dist/css/emoji-picker.css +11 -0
- package/dist/css/emoji-picker.css.map +1 -0
- package/dist/css/index.css +1809 -1369
- package/dist/css/index.css.map +1 -1
- package/dist/es/{WithAudioPlayback.d90f1a99.mjs → WithAudioPlayback.2ffdc4c5.mjs} +404 -300
- package/dist/es/WithAudioPlayback.2ffdc4c5.mjs.map +1 -0
- package/dist/es/emojis.mjs +5 -2
- package/dist/es/emojis.mjs.map +1 -1
- package/dist/es/index.mjs +3016 -2709
- package/dist/es/index.mjs.map +1 -1
- package/dist/types/components/Attachment/Audio.d.ts.map +1 -1
- package/dist/types/components/Attachment/FileAttachment.d.ts.map +1 -1
- package/dist/types/components/Attachment/UnsupportedAttachment.d.ts +1 -1
- package/dist/types/components/Attachment/UnsupportedAttachment.d.ts.map +1 -1
- package/dist/types/components/Attachment/VoiceRecording.d.ts.map +1 -1
- package/dist/types/components/Attachment/components/FileSizeIndicator.d.ts +1 -2
- package/dist/types/components/Attachment/components/FileSizeIndicator.d.ts.map +1 -1
- package/dist/types/components/AudioPlayback/components/useInteractiveProgressBar.d.ts.map +1 -1
- package/dist/types/components/AudioPlayback/plugins/AudioPlayerNotificationsPlugin.d.ts +4 -4
- package/dist/types/components/AudioPlayback/plugins/AudioPlayerNotificationsPlugin.d.ts.map +1 -1
- package/dist/types/components/Badge/MediaBadge.d.ts +8 -0
- package/dist/types/components/Badge/MediaBadge.d.ts.map +1 -0
- package/dist/types/components/Channel/Channel.d.ts.map +1 -1
- package/dist/types/components/ChannelHeader/ChannelHeader.d.ts +0 -2
- package/dist/types/components/ChannelHeader/ChannelHeader.d.ts.map +1 -1
- package/dist/types/components/ChannelList/ChannelList.d.ts.map +1 -1
- package/dist/types/components/ChannelList/ChannelListHeader.d.ts +1 -5
- package/dist/types/components/ChannelList/ChannelListHeader.d.ts.map +1 -1
- package/dist/types/components/ChannelList/hooks/index.d.ts +0 -11
- package/dist/types/components/ChannelList/hooks/index.d.ts.map +1 -1
- package/dist/types/components/ChannelList/utils.d.ts +0 -9
- package/dist/types/components/ChannelList/utils.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/ChannelListItem.d.ts +0 -2
- 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/utils.d.ts.map +1 -1
- package/dist/types/components/Chat/Chat.d.ts +1 -5
- package/dist/types/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/components/Chat/hooks/useChat.d.ts +1 -10
- package/dist/types/components/Chat/hooks/useChat.d.ts.map +1 -1
- package/dist/types/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
- package/dist/types/components/Chat/hooks/useReportLostConnectionSystemNotification.d.ts +6 -0
- package/dist/types/components/Chat/hooks/useReportLostConnectionSystemNotification.d.ts.map +1 -0
- package/dist/types/components/Chat/index.d.ts +1 -0
- package/dist/types/components/Chat/index.d.ts.map +1 -1
- package/dist/types/components/ChatView/ChatView.d.ts.map +1 -1
- package/dist/types/components/Dialog/components/ContextMenu.d.ts +4 -2
- package/dist/types/components/Dialog/components/ContextMenu.d.ts.map +1 -1
- package/dist/types/components/Dialog/hooks/useDialog.d.ts.map +1 -1
- package/dist/types/components/Dialog/service/DialogManager.d.ts +3 -2
- package/dist/types/components/Dialog/service/DialogManager.d.ts.map +1 -1
- package/dist/types/components/Dialog/service/DialogPortal.d.ts.map +1 -1
- package/dist/types/components/Form/NumericInput.d.ts.map +1 -1
- package/dist/types/components/Form/TextInput.d.ts +15 -8
- package/dist/types/components/Form/TextInput.d.ts.map +1 -1
- package/dist/types/components/Form/index.d.ts +1 -0
- package/dist/types/components/Form/index.d.ts.map +1 -1
- package/dist/types/components/Icons/icons.d.ts +18 -6
- package/dist/types/components/Icons/icons.d.ts.map +1 -1
- package/dist/types/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +0 -20
- package/dist/types/components/InfiniteScrollPaginator/InfiniteScroll.d.ts.map +1 -1
- package/dist/types/components/LoadMore/LoadMoreButton.d.ts +1 -6
- package/dist/types/components/LoadMore/LoadMoreButton.d.ts.map +1 -1
- package/dist/types/components/LoadMore/LoadMorePaginator.d.ts.map +1 -1
- package/dist/types/components/Loading/UploadProgressIndicator.d.ts +5 -0
- package/dist/types/components/Loading/UploadProgressIndicator.d.ts.map +1 -0
- package/dist/types/components/Loading/UploadedSizeIndicator.d.ts +6 -0
- package/dist/types/components/Loading/UploadedSizeIndicator.d.ts.map +1 -0
- package/dist/types/components/Loading/index.d.ts +3 -0
- package/dist/types/components/Loading/index.d.ts.map +1 -1
- package/dist/types/components/Loading/progress-indicators.d.ts +7 -0
- package/dist/types/components/Loading/progress-indicators.d.ts.map +1 -0
- package/dist/types/components/Location/ShareLocationDialog.d.ts.map +1 -1
- package/dist/types/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.d.ts.map +1 -1
- package/dist/types/components/Message/Message.d.ts.map +1 -1
- package/dist/types/components/Message/MessageAlsoSentInChannelIndicator.d.ts.map +1 -1
- package/dist/types/components/Message/MessageUI.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/useDeleteHandler.d.ts +1 -5
- package/dist/types/components/Message/hooks/useDeleteHandler.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/useFlagHandler.d.ts +1 -6
- package/dist/types/components/Message/hooks/useFlagHandler.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/useMarkUnreadHandler.d.ts +1 -6
- package/dist/types/components/Message/hooks/useMarkUnreadHandler.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/useMuteHandler.d.ts +2 -7
- package/dist/types/components/Message/hooks/useMuteHandler.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/usePinHandler.d.ts +1 -23
- package/dist/types/components/Message/hooks/usePinHandler.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/useReactionsFetcher.d.ts +1 -6
- package/dist/types/components/Message/hooks/useReactionsFetcher.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/useUserRole.d.ts +1 -1
- package/dist/types/components/Message/hooks/useUserRole.d.ts.map +1 -1
- package/dist/types/components/Message/types.d.ts +1 -23
- package/dist/types/components/Message/types.d.ts.map +1 -1
- package/dist/types/components/Message/utils.d.ts +2 -2
- package/dist/types/components/Message/utils.d.ts.map +1 -1
- package/dist/types/components/MessageActions/MessageActions.d.ts.map +1 -1
- package/dist/types/components/MessageActions/MessageActions.defaults.d.ts.map +1 -1
- package/dist/types/components/MessageActions/RemindMeSubmenu.d.ts.map +1 -1
- package/dist/types/components/MessageActions/hooks/useBaseMessageActionSetFilter.d.ts +1 -1
- package/dist/types/components/MessageActions/hooks/useBaseMessageActionSetFilter.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.d.ts +14 -0
- package/dist/types/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.d.ts.map +1 -0
- package/dist/types/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/hooks/useSubmitHandler.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/icons.d.ts +0 -1
- package/dist/types/components/MessageComposer/icons.d.ts.map +1 -1
- package/dist/types/components/MessageList/MessageList.d.ts +1 -1
- package/dist/types/components/MessageList/MessageList.d.ts.map +1 -1
- package/dist/types/components/MessageList/hooks/MessageList/useFloatingDateSeparatorMessageList.d.ts +2 -2
- package/dist/types/components/MessageList/hooks/MessageList/useFloatingDateSeparatorMessageList.d.ts.map +1 -1
- package/dist/types/components/MessageList/hooks/MessageList/useScrollLocationLogic.d.ts.map +1 -1
- package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useFloatingDateSeparator.d.ts.map +1 -1
- package/dist/types/components/MessageList/index.d.ts +0 -1
- package/dist/types/components/MessageList/index.d.ts.map +1 -1
- package/dist/types/components/MessageList/utils.d.ts +0 -1
- package/dist/types/components/MessageList/utils.d.ts.map +1 -1
- package/dist/types/components/Notifications/NotificationList.d.ts.map +1 -1
- package/dist/types/components/Notifications/hooks/index.d.ts +2 -0
- package/dist/types/components/Notifications/hooks/index.d.ts.map +1 -1
- package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts +63 -0
- package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts.map +1 -0
- package/dist/types/components/Notifications/hooks/useSystemNotifications.d.ts +14 -0
- package/dist/types/components/Notifications/hooks/useSystemNotifications.d.ts.map +1 -0
- package/dist/types/components/Notifications/notificationTarget.d.ts +1 -0
- package/dist/types/components/Notifications/notificationTarget.d.ts.map +1 -1
- package/dist/types/components/Poll/PollActions/EndPollAlert.d.ts.map +1 -1
- package/dist/types/components/Poll/PollCreationDialog/OptionFieldSet.d.ts.map +1 -1
- package/dist/types/components/ReactFileUtilities/UploadButton.d.ts +3 -11
- package/dist/types/components/ReactFileUtilities/UploadButton.d.ts.map +1 -1
- package/dist/types/components/Reactions/MessageReactions.d.ts.map +1 -1
- package/dist/types/components/Reactions/MessageReactionsDetail.d.ts +12 -2
- package/dist/types/components/Reactions/MessageReactionsDetail.d.ts.map +1 -1
- package/dist/types/components/Reactions/ReactionSelector.d.ts +5 -0
- package/dist/types/components/Reactions/ReactionSelector.d.ts.map +1 -1
- package/dist/types/components/Reactions/hooks/useFetchReactions.d.ts.map +1 -1
- package/dist/types/components/Reactions/index.d.ts +0 -1
- package/dist/types/components/Reactions/index.d.ts.map +1 -1
- package/dist/types/components/SummarizedMessagePreview/SummarizedMessagePreview.d.ts.map +1 -1
- package/dist/types/components/SummarizedMessagePreview/hooks/useLatestMessagePreview.d.ts +1 -1
- package/dist/types/components/SummarizedMessagePreview/hooks/useLatestMessagePreview.d.ts.map +1 -1
- package/dist/types/components/Thread/ThreadHeader.d.ts +0 -2
- package/dist/types/components/Thread/ThreadHeader.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadList.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadListHeader.d.ts +1 -5
- package/dist/types/components/Threads/ThreadList/ThreadListHeader.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadListItemUI.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +4 -2
- package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/context/ChatContext.d.ts +0 -3
- package/dist/types/context/ChatContext.d.ts.map +1 -1
- package/dist/types/context/ComponentContext.d.ts +18 -2
- package/dist/types/context/ComponentContext.d.ts.map +1 -1
- package/dist/types/context/MessageContext.d.ts +0 -3
- package/dist/types/context/MessageContext.d.ts.map +1 -1
- package/dist/types/i18n/Streami18n.d.ts +21 -11
- package/dist/types/i18n/Streami18n.d.ts.map +1 -1
- package/dist/types/plugins/Emojis/EmojiPicker.d.ts +0 -6
- package/dist/types/plugins/Emojis/EmojiPicker.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +0 -5
- package/dist/types/types/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/WithAudioPlayback.f9abf707.js.map +0 -1
- package/dist/es/WithAudioPlayback.d90f1a99.mjs.map +0 -1
- package/dist/types/components/Button/ToggleSidebarButton.d.ts +0 -10
- package/dist/types/components/Button/ToggleSidebarButton.d.ts.map +0 -1
- package/dist/types/components/ChannelHeader/hooks/useIsMobileViewport.d.ts +0 -3
- package/dist/types/components/ChannelHeader/hooks/useIsMobileViewport.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useChannelDeletedListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useChannelDeletedListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useChannelHiddenListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useChannelHiddenListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useChannelTruncatedListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useChannelTruncatedListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useChannelUpdatedListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useChannelUpdatedListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useChannelVisibleListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useChannelVisibleListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useMessageNewListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useMessageNewListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useMobileNavigation.d.ts +0 -2
- package/dist/types/components/ChannelList/hooks/useMobileNavigation.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts.map +0 -1
- package/dist/types/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts +0 -3
- package/dist/types/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts.map +0 -1
- package/dist/types/components/MessageList/ConnectionStatus.d.ts +0 -3
- package/dist/types/components/MessageList/ConnectionStatus.d.ts.map +0 -1
- package/dist/types/components/Reactions/StreamEmoji.d.ts +0 -19
- package/dist/types/components/Reactions/StreamEmoji.d.ts.map +0 -1
- package/dist/types/utils/deprecationWarning.d.ts +0 -2
- package/dist/types/utils/deprecationWarning.d.ts.map +0 -1
|
@@ -997,6 +997,33 @@ class AudioPlayerPool {
|
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
|
+
const audioPlayerNotificationsPluginFactory = ({
|
|
1001
|
+
addNotification,
|
|
1002
|
+
panel = "channel",
|
|
1003
|
+
t
|
|
1004
|
+
}) => {
|
|
1005
|
+
const errors = {
|
|
1006
|
+
"failed-to-start": new Error(t("Failed to play the recording")),
|
|
1007
|
+
"not-playable": new Error(
|
|
1008
|
+
t("Recording format is not supported and cannot be reproduced")
|
|
1009
|
+
),
|
|
1010
|
+
"seek-not-supported": new Error(t("Cannot seek in the recording"))
|
|
1011
|
+
};
|
|
1012
|
+
return {
|
|
1013
|
+
id: "AudioPlayerNotificationsPlugin",
|
|
1014
|
+
onError: ({ errCode, error: e }) => {
|
|
1015
|
+
const error = (errCode && errors[errCode]) ?? e ?? new Error(t("Error reproducing the recording"));
|
|
1016
|
+
addNotification({
|
|
1017
|
+
emitter: "AudioPlayer",
|
|
1018
|
+
error,
|
|
1019
|
+
message: error.message,
|
|
1020
|
+
severity: "error",
|
|
1021
|
+
targetPanels: [panel],
|
|
1022
|
+
type: "browser:audio:playback:error"
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1000
1027
|
const NOTIFICATION_TARGET_PANELS = [
|
|
1001
1028
|
"channel",
|
|
1002
1029
|
"thread",
|
|
@@ -1013,46 +1040,29 @@ const getNotificationTargetPanel = (notification) => {
|
|
|
1013
1040
|
const panel = notification.origin.context?.panel;
|
|
1014
1041
|
return isNotificationTargetPanel(panel) ? panel : void 0;
|
|
1015
1042
|
};
|
|
1043
|
+
const getNotificationTargetPanels = (notification) => {
|
|
1044
|
+
const targetPanels = (notification.tags ?? []).filter((tag) => tag.startsWith("target:")).map((tag) => tag.slice("target:".length)).filter(
|
|
1045
|
+
(value) => isNotificationTargetPanel(value)
|
|
1046
|
+
);
|
|
1047
|
+
if (targetPanels.length > 0) {
|
|
1048
|
+
return Array.from(new Set(targetPanels));
|
|
1049
|
+
}
|
|
1050
|
+
const panel = notification.origin.context?.panel;
|
|
1051
|
+
return isNotificationTargetPanel(panel) ? [panel] : [];
|
|
1052
|
+
};
|
|
1016
1053
|
const getNotificationTargetTag = (panel) => `target:${panel}`;
|
|
1017
1054
|
const addNotificationTargetTag = (panel, tags) => {
|
|
1018
1055
|
if (!panel) return tags ?? [];
|
|
1019
1056
|
return Array.from(/* @__PURE__ */ new Set([getNotificationTargetTag(panel), ...tags ?? []]));
|
|
1020
1057
|
};
|
|
1021
1058
|
const isNotificationForPanel = (notification, panel, options) => {
|
|
1022
|
-
const
|
|
1023
|
-
|
|
1059
|
+
const explicitTargetPanels = getNotificationTargetPanels(notification);
|
|
1060
|
+
if (explicitTargetPanels.length > 0) {
|
|
1061
|
+
return explicitTargetPanels.includes(panel);
|
|
1062
|
+
}
|
|
1063
|
+
const resolvedPanel = options?.fallbackPanel ?? "channel";
|
|
1024
1064
|
return resolvedPanel === panel;
|
|
1025
1065
|
};
|
|
1026
|
-
const audioPlayerNotificationsPluginFactory = ({
|
|
1027
|
-
client,
|
|
1028
|
-
panel = "channel",
|
|
1029
|
-
t
|
|
1030
|
-
}) => {
|
|
1031
|
-
const errors = {
|
|
1032
|
-
"failed-to-start": new Error(t("Failed to play the recording")),
|
|
1033
|
-
"not-playable": new Error(
|
|
1034
|
-
t("Recording format is not supported and cannot be reproduced")
|
|
1035
|
-
),
|
|
1036
|
-
"seek-not-supported": new Error(t("Cannot seek in the recording"))
|
|
1037
|
-
};
|
|
1038
|
-
return {
|
|
1039
|
-
id: "AudioPlayerNotificationsPlugin",
|
|
1040
|
-
onError: ({ errCode, error: e }) => {
|
|
1041
|
-
const error = (errCode && errors[errCode]) ?? e ?? new Error(t("Error reproducing the recording"));
|
|
1042
|
-
client?.notifications.addError({
|
|
1043
|
-
message: error.message,
|
|
1044
|
-
options: {
|
|
1045
|
-
originalError: error,
|
|
1046
|
-
tags: addNotificationTargetTag(panel),
|
|
1047
|
-
type: "browser:audio:playback:error"
|
|
1048
|
-
},
|
|
1049
|
-
origin: {
|
|
1050
|
-
emitter: "AudioPlayer"
|
|
1051
|
-
}
|
|
1052
|
-
});
|
|
1053
|
-
}
|
|
1054
|
-
};
|
|
1055
|
-
};
|
|
1056
1066
|
const variantToClass = {
|
|
1057
1067
|
danger: "str-chat__button--destructive",
|
|
1058
1068
|
primary: "str-chat__button--primary",
|
|
@@ -1264,8 +1274,8 @@ const IconBellOff = createIcon(
|
|
|
1264
1274
|
}
|
|
1265
1275
|
)
|
|
1266
1276
|
);
|
|
1267
|
-
const
|
|
1268
|
-
"
|
|
1277
|
+
const IconBookmark = createIcon(
|
|
1278
|
+
"IconBookmark",
|
|
1269
1279
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1270
1280
|
"path",
|
|
1271
1281
|
{
|
|
@@ -1278,8 +1288,8 @@ const IconSave = createIcon(
|
|
|
1278
1288
|
}
|
|
1279
1289
|
)
|
|
1280
1290
|
);
|
|
1281
|
-
const
|
|
1282
|
-
"
|
|
1291
|
+
const IconBookmarkRemove = createIcon(
|
|
1292
|
+
"IconBookmarkRemove",
|
|
1283
1293
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1284
1294
|
"path",
|
|
1285
1295
|
{
|
|
@@ -1511,6 +1521,16 @@ const IconMinusCircle = createIcon(
|
|
|
1511
1521
|
}
|
|
1512
1522
|
)
|
|
1513
1523
|
);
|
|
1524
|
+
const IconMinus = createIcon(
|
|
1525
|
+
"IconMinus",
|
|
1526
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1527
|
+
"path",
|
|
1528
|
+
{
|
|
1529
|
+
d: "M16.875 9.40039C17.2064 9.40039 17.4746 9.66863 17.4746 10C17.4746 10.3314 17.2064 10.5996 16.875 10.5996H3.125C2.79363 10.5996 2.52539 10.3314 2.52539 10C2.52539 9.66863 2.79363 9.40039 3.125 9.40039H16.875Z",
|
|
1530
|
+
fill: "currentColor"
|
|
1531
|
+
}
|
|
1532
|
+
)
|
|
1533
|
+
);
|
|
1514
1534
|
const IconXCircle = createIcon(
|
|
1515
1535
|
"IconXCircle",
|
|
1516
1536
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1563,7 +1583,7 @@ const IconXmark = createIcon(
|
|
|
1563
1583
|
stroke: "currentColor",
|
|
1564
1584
|
strokeLinecap: "round",
|
|
1565
1585
|
strokeLinejoin: "round",
|
|
1566
|
-
strokeWidth: "
|
|
1586
|
+
strokeWidth: "2"
|
|
1567
1587
|
}
|
|
1568
1588
|
)
|
|
1569
1589
|
);
|
|
@@ -1630,6 +1650,46 @@ const IconEmoji = createIcon(
|
|
|
1630
1650
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12.4756 11.499C12.683 11.1407 13.1425 11.0182 13.501 11.2256C13.8593 11.433 13.9818 11.8925 13.7744 12.251C13.0125 13.568 11.6947 14.5 10 14.5C8.30531 14.5 6.98748 13.568 6.22559 12.251C6.01825 11.8925 6.14067 11.433 6.49902 11.2256C6.85749 11.0182 7.31695 11.1407 7.52441 11.499C8.05942 12.424 8.91824 13 10 13C11.0818 13 11.9406 12.424 12.4756 11.499Z" })
|
|
1631
1651
|
] })
|
|
1632
1652
|
);
|
|
1653
|
+
const IconEmojiAdd = createIcon(
|
|
1654
|
+
"IconEmojiAdd",
|
|
1655
|
+
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1656
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1657
|
+
"path",
|
|
1658
|
+
{
|
|
1659
|
+
d: "M1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C10.4142 1.75 10.75 2.08579 10.75 2.5C10.75 2.91421 10.4142 3.25 10 3.25C6.27208 3.25 3.25 6.27208 3.25 10C3.25 13.7279 6.27208 16.75 10 16.75C13.7279 16.75 16.75 13.7279 16.75 10C16.75 9.58579 17.0858 9.25 17.5 9.25C17.9142 9.25 18.25 9.58579 18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10Z",
|
|
1660
|
+
fill: "currentColor"
|
|
1661
|
+
}
|
|
1662
|
+
),
|
|
1663
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1664
|
+
"path",
|
|
1665
|
+
{
|
|
1666
|
+
d: "M7.1875 9.375C7.70527 9.375 8.125 8.95527 8.125 8.4375C8.125 7.91973 7.70527 7.5 7.1875 7.5C6.66973 7.5 6.25 7.91973 6.25 8.4375C6.25 8.95527 6.66973 9.375 7.1875 9.375Z",
|
|
1667
|
+
fill: "currentColor"
|
|
1668
|
+
}
|
|
1669
|
+
),
|
|
1670
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1671
|
+
"path",
|
|
1672
|
+
{
|
|
1673
|
+
d: "M12.8125 9.375C13.3303 9.375 13.75 8.95527 13.75 8.4375C13.75 7.91973 13.3303 7.5 12.8125 7.5C12.2947 7.5 11.875 7.91973 11.875 8.4375C11.875 8.95527 12.2947 9.375 12.8125 9.375Z",
|
|
1674
|
+
fill: "currentColor"
|
|
1675
|
+
}
|
|
1676
|
+
),
|
|
1677
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1678
|
+
"path",
|
|
1679
|
+
{
|
|
1680
|
+
d: "M12.4756 11.499C12.683 11.1407 13.1425 11.0182 13.501 11.2256C13.8593 11.433 13.9818 11.8925 13.7744 12.251C13.0125 13.568 11.6947 14.5 10 14.5C8.30531 14.5 6.98748 13.568 6.22559 12.251C6.01825 11.8925 6.14067 11.433 6.49902 11.2256C6.85749 11.0182 7.31695 11.1407 7.52441 11.499C8.05942 12.424 8.91824 13 10 13C11.0818 13 11.9406 12.424 12.4756 11.499Z",
|
|
1681
|
+
fill: "currentColor"
|
|
1682
|
+
}
|
|
1683
|
+
),
|
|
1684
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1685
|
+
"path",
|
|
1686
|
+
{
|
|
1687
|
+
d: "M15.083 6.87524V4.91626H13.125C12.7108 4.91626 12.375 4.58047 12.375 4.16626C12.3752 3.7522 12.7109 3.41626 13.125 3.41626H15.083V1.45825C15.083 1.04415 15.4189 0.708427 15.833 0.708252C16.2472 0.708252 16.583 1.04404 16.583 1.45825V3.41626H18.542C18.9559 3.41644 19.2918 3.7523 19.292 4.16626C19.292 4.58036 18.9561 4.91608 18.542 4.91626H16.583V6.87524C16.5828 7.28931 16.2471 7.62524 15.833 7.62524C15.4191 7.62507 15.0832 7.2892 15.083 6.87524Z",
|
|
1688
|
+
fill: "currentColor"
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1691
|
+
] })
|
|
1692
|
+
);
|
|
1633
1693
|
const IconExclamationMarkFill = createIcon(
|
|
1634
1694
|
"IconExclamationMarkFill",
|
|
1635
1695
|
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -1657,6 +1717,16 @@ const IconEyeFill = createIcon(
|
|
|
1657
1717
|
"IconEyeFill",
|
|
1658
1718
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19.3211 9.74688C19.2937 9.68516 18.632 8.21719 17.1609 6.74609C15.2008 4.78594 12.725 3.75 9.99999 3.75C7.27499 3.75 4.79921 4.78594 2.83905 6.74609C1.36796 8.21719 0.703118 9.6875 0.678899 9.74688C0.643362 9.82681 0.625 9.91331 0.625 10.0008C0.625 10.0883 0.643362 10.1748 0.678899 10.2547C0.706243 10.3164 1.36796 11.7836 2.83905 13.2547C4.79921 15.2141 7.27499 16.25 9.99999 16.25C12.725 16.25 15.2008 15.2141 17.1609 13.2547C18.632 11.7836 19.2937 10.3164 19.3211 10.2547C19.3566 10.1748 19.375 10.0883 19.375 10.0008C19.375 9.91331 19.3566 9.82681 19.3211 9.74688ZM9.99999 13.125C9.38193 13.125 8.77774 12.9417 8.26384 12.5983C7.74993 12.255 7.34939 11.7669 7.11287 11.1959C6.87634 10.6249 6.81446 9.99653 6.93504 9.39034C7.05562 8.78415 7.35324 8.22733 7.79028 7.79029C8.22732 7.35325 8.78414 7.05562 9.39033 6.93505C9.99652 6.81447 10.6249 6.87635 11.1959 7.11288C11.7669 7.3494 12.255 7.74994 12.5983 8.26384C12.9417 8.77775 13.125 9.38193 13.125 10C13.125 10.8288 12.7958 11.6237 12.2097 12.2097C11.6236 12.7958 10.8288 13.125 9.99999 13.125Z" })
|
|
1659
1719
|
);
|
|
1720
|
+
const IconUnsupportedAttachment = createIcon(
|
|
1721
|
+
"IconUnsupportedAttachment",
|
|
1722
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1723
|
+
"path",
|
|
1724
|
+
{
|
|
1725
|
+
d: "M4.5 16.75H15.5V7.625H11.875C11.4608 7.625 11.125 7.28921 11.125 6.875V3.25H4.5V16.75ZM11.3447 9.46973C11.6376 9.17683 12.1124 9.17683 12.4053 9.46973C12.6982 9.76262 12.6982 10.2374 12.4053 10.5303L11.0605 11.875L12.4053 13.2197C12.6982 13.5126 12.6982 13.9874 12.4053 14.2803C12.1124 14.5732 11.6376 14.5732 11.3447 14.2803L10 12.9355L8.65527 14.2803C8.36238 14.5732 7.88762 14.5732 7.59473 14.2803C7.30183 13.9874 7.30183 13.5126 7.59473 13.2197L8.93945 11.875L7.59473 10.5303C7.30183 10.2374 7.30183 9.76262 7.59473 9.46973C7.88762 9.17683 8.36238 9.17683 8.65527 9.46973L10 10.8145L11.3447 9.46973ZM12.625 6.125H14.4395L12.625 4.31055V6.125ZM17 16.875C17 17.2397 16.8555 17.5898 16.5977 17.8477C16.3398 18.1055 15.9897 18.25 15.625 18.25H4.375C4.01033 18.25 3.66021 18.1055 3.40234 17.8477C3.14448 17.5898 3 17.2397 3 16.875V3.125C3 2.76033 3.14448 2.41021 3.40234 2.15234L3.50391 2.06152C3.74856 1.86111 4.05597 1.75 4.375 1.75H11.875C12.0739 1.75 12.2646 1.82907 12.4053 1.96973L16.7803 6.34473C16.9209 6.48538 17 6.67609 17 6.875V16.875Z",
|
|
1726
|
+
fill: "currentColor"
|
|
1727
|
+
}
|
|
1728
|
+
)
|
|
1729
|
+
);
|
|
1660
1730
|
const IconUpload = createIcon(
|
|
1661
1731
|
"IconUpload",
|
|
1662
1732
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1713,21 +1783,6 @@ const IconImage = createIcon(
|
|
|
1713
1783
|
}
|
|
1714
1784
|
)
|
|
1715
1785
|
);
|
|
1716
|
-
const IconSidebar = createIcon(
|
|
1717
|
-
"IconSidebar",
|
|
1718
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1719
|
-
"path",
|
|
1720
|
-
{
|
|
1721
|
-
d: "M6.875 3.75V16.25M3.125 3.75H16.875C17.2202 3.75 17.5 4.02982 17.5 4.375V15.625C17.5 15.9702 17.2202 16.25 16.875 16.25H3.125C2.77982 16.25 2.5 15.9702 2.5 15.625V4.375C2.5 4.02982 2.77982 3.75 3.125 3.75Z",
|
|
1722
|
-
fill: "none",
|
|
1723
|
-
stroke: "currentColor",
|
|
1724
|
-
strokeLinecap: "round",
|
|
1725
|
-
strokeLinejoin: "round",
|
|
1726
|
-
strokeWidth: "1.5"
|
|
1727
|
-
}
|
|
1728
|
-
),
|
|
1729
|
-
{ "data-rtl-mirror": "" }
|
|
1730
|
-
);
|
|
1731
1786
|
const IconSearch = createIcon(
|
|
1732
1787
|
"IconSearch",
|
|
1733
1788
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1784,6 +1839,16 @@ const IconVoice = createIcon(
|
|
|
1784
1839
|
}
|
|
1785
1840
|
)
|
|
1786
1841
|
);
|
|
1842
|
+
const IconMicrophoneSolid = createIcon(
|
|
1843
|
+
"IconMicrophoneSolid",
|
|
1844
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1845
|
+
"path",
|
|
1846
|
+
{
|
|
1847
|
+
d: "M6.25 10V5C6.25 4.00544 6.64509 3.05161 7.34835 2.34835C8.05161 1.64509 9.00544 1.25 10 1.25C10.9946 1.25 11.9484 1.64509 12.6517 2.34835C13.3549 3.05161 13.75 4.00544 13.75 5V10C13.75 10.9946 13.3549 11.9484 12.6517 12.6517C11.9484 13.3549 10.9946 13.75 10 13.75C9.00544 13.75 8.05161 13.3549 7.34835 12.6517C6.64509 11.9484 6.25 10.9946 6.25 10ZM16.25 10C16.25 9.83424 16.1842 9.67527 16.0669 9.55806C15.9497 9.44085 15.7908 9.375 15.625 9.375C15.4592 9.375 15.3003 9.44085 15.1831 9.55806C15.0658 9.67527 15 9.83424 15 10C15 11.3261 14.4732 12.5979 13.5355 13.5355C12.5979 14.4732 11.3261 15 10 15C8.67392 15 7.40215 14.4732 6.46447 13.5355C5.52678 12.5979 5 11.3261 5 10C5 9.83424 4.93415 9.67527 4.81694 9.55806C4.69973 9.44085 4.54076 9.375 4.375 9.375C4.20924 9.375 4.05027 9.44085 3.93306 9.55806C3.81585 9.67527 3.75 9.83424 3.75 10C3.7519 11.5489 4.32806 13.042 5.36707 14.1907C6.40607 15.3393 7.83409 16.062 9.375 16.2188V18.75C9.375 18.9158 9.44085 19.0747 9.55806 19.1919C9.67527 19.3092 9.83424 19.375 10 19.375C10.1658 19.375 10.3247 19.3092 10.4419 19.1919C10.5592 19.0747 10.625 18.9158 10.625 18.75V16.2188C12.1659 16.062 13.5939 15.3393 14.6329 14.1907C15.6719 13.042 16.2481 11.5489 16.25 10Z",
|
|
1848
|
+
fill: "currentColor"
|
|
1849
|
+
}
|
|
1850
|
+
)
|
|
1851
|
+
);
|
|
1787
1852
|
const IconMute = createIcon(
|
|
1788
1853
|
"IconMute",
|
|
1789
1854
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1925,7 +1990,7 @@ const IconPlus = createIcon(
|
|
|
1925
1990
|
stroke: "currentColor",
|
|
1926
1991
|
strokeLinecap: "round",
|
|
1927
1992
|
strokeLinejoin: "round",
|
|
1928
|
-
strokeWidth: "
|
|
1993
|
+
strokeWidth: "2"
|
|
1929
1994
|
}
|
|
1930
1995
|
)
|
|
1931
1996
|
);
|
|
@@ -2630,63 +2695,6 @@ const MESSAGE_ACTIONS = {
|
|
|
2630
2695
|
reply: "reply",
|
|
2631
2696
|
saveForLater: "saveForLater"
|
|
2632
2697
|
};
|
|
2633
|
-
const defaultPinPermissions = {
|
|
2634
|
-
commerce: {
|
|
2635
|
-
admin: true,
|
|
2636
|
-
anonymous: false,
|
|
2637
|
-
channel_member: false,
|
|
2638
|
-
channel_moderator: true,
|
|
2639
|
-
guest: false,
|
|
2640
|
-
member: false,
|
|
2641
|
-
moderator: true,
|
|
2642
|
-
owner: true,
|
|
2643
|
-
user: false
|
|
2644
|
-
},
|
|
2645
|
-
gaming: {
|
|
2646
|
-
admin: true,
|
|
2647
|
-
anonymous: false,
|
|
2648
|
-
channel_member: false,
|
|
2649
|
-
channel_moderator: true,
|
|
2650
|
-
guest: false,
|
|
2651
|
-
member: false,
|
|
2652
|
-
moderator: true,
|
|
2653
|
-
owner: false,
|
|
2654
|
-
user: false
|
|
2655
|
-
},
|
|
2656
|
-
livestream: {
|
|
2657
|
-
admin: true,
|
|
2658
|
-
anonymous: false,
|
|
2659
|
-
channel_member: false,
|
|
2660
|
-
channel_moderator: true,
|
|
2661
|
-
guest: false,
|
|
2662
|
-
member: false,
|
|
2663
|
-
moderator: true,
|
|
2664
|
-
owner: true,
|
|
2665
|
-
user: false
|
|
2666
|
-
},
|
|
2667
|
-
messaging: {
|
|
2668
|
-
admin: true,
|
|
2669
|
-
anonymous: false,
|
|
2670
|
-
channel_member: true,
|
|
2671
|
-
channel_moderator: true,
|
|
2672
|
-
guest: false,
|
|
2673
|
-
member: true,
|
|
2674
|
-
moderator: true,
|
|
2675
|
-
owner: true,
|
|
2676
|
-
user: false
|
|
2677
|
-
},
|
|
2678
|
-
team: {
|
|
2679
|
-
admin: true,
|
|
2680
|
-
anonymous: false,
|
|
2681
|
-
channel_member: true,
|
|
2682
|
-
channel_moderator: true,
|
|
2683
|
-
guest: false,
|
|
2684
|
-
member: true,
|
|
2685
|
-
moderator: true,
|
|
2686
|
-
owner: true,
|
|
2687
|
-
user: false
|
|
2688
|
-
}
|
|
2689
|
-
};
|
|
2690
2698
|
const getMessageActions = (actions, {
|
|
2691
2699
|
canDelete,
|
|
2692
2700
|
canEdit,
|
|
@@ -2702,7 +2710,7 @@ const getMessageActions = (actions, {
|
|
|
2702
2710
|
let messageActions = [];
|
|
2703
2711
|
if (actions && typeof actions === "boolean") {
|
|
2704
2712
|
messageActions = Object.keys(MESSAGE_ACTIONS);
|
|
2705
|
-
} else if (actions && actions.length > 0) {
|
|
2713
|
+
} else if (actions && Array.isArray(actions) && actions.length > 0) {
|
|
2706
2714
|
messageActions = [...actions];
|
|
2707
2715
|
} else {
|
|
2708
2716
|
return [];
|
|
@@ -2793,6 +2801,7 @@ const areMessageUIPropsEqual = (prevProps, nextProps) => {
|
|
|
2793
2801
|
return areMessagesEqual(prevMessage, nextMessage);
|
|
2794
2802
|
};
|
|
2795
2803
|
const messageHasReactions = (message) => Object.values(message?.reaction_groups ?? {}).some(({ count }) => count > 0);
|
|
2804
|
+
const messageHasQuotedMessage = (message) => !!message?.quoted_message;
|
|
2796
2805
|
const messageHasAttachments = (message) => !!message?.attachments && !!message.attachments.length;
|
|
2797
2806
|
const messageHasSingleAttachment = (message) => message?.attachments?.length === 1;
|
|
2798
2807
|
const messageHasGiphyAttachment = (message) => !!message?.attachments?.some((att) => att.type === "giphy");
|
|
@@ -2861,6 +2870,7 @@ const isMessageErrorRetryable = (message) => message.status === "failed" && mess
|
|
|
2861
2870
|
const isNetworkSendFailure = (message) => message.status === "failed" && message.error?.status === 0;
|
|
2862
2871
|
const isMessageBounced = (message) => message.type === "error" && (message.moderation_details?.action === "MESSAGE_RESPONSE_ACTION_BOUNCE" || message.moderation?.action === "bounce");
|
|
2863
2872
|
const isMessageBlocked = (message) => message.type === "error" && (message.moderation_details?.action === "MESSAGE_RESPONSE_ACTION_REMOVE" || message.moderation?.action === "remove");
|
|
2873
|
+
const isMessageDeleted = (message) => Boolean(message.deleted_at || message.type === "deleted" || message.deleted_for_me);
|
|
2864
2874
|
const isMessageEdited = (message) => !!message.message_text_updated_at;
|
|
2865
2875
|
const hasResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
|
|
2866
2876
|
function autoMiddlewareFor(p) {
|
|
@@ -3112,7 +3122,6 @@ const getGroupStyles = (message, previousMessage, nextMessage, noGroupByUser, ma
|
|
|
3112
3122
|
return "";
|
|
3113
3123
|
};
|
|
3114
3124
|
const hasMoreMessagesProbably = (returnedCountMessages, limit) => returnedCountMessages >= limit;
|
|
3115
|
-
const hasNotMoreMessages = (returnedCountMessages, limit) => returnedCountMessages < limit;
|
|
3116
3125
|
function isIntroMessage(message) {
|
|
3117
3126
|
return message.customType === CUSTOM_MESSAGE_TYPE.intro;
|
|
3118
3127
|
}
|
|
@@ -3441,6 +3450,7 @@ const ChannelInner = (props) => {
|
|
|
3441
3450
|
LoadingIndicator = LoadingChannel
|
|
3442
3451
|
} = useComponentContext();
|
|
3443
3452
|
const { client, customClasses, latestMessageDatesByChannels, mutes, searchController } = useChatContext("Channel");
|
|
3453
|
+
const { addNotification } = useNotificationApi();
|
|
3444
3454
|
const { t } = useTranslationContext("Channel");
|
|
3445
3455
|
const chatContainerClass = getChatContainerClass(customClasses?.chatContainer);
|
|
3446
3456
|
const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();
|
|
@@ -3686,18 +3696,15 @@ const ChannelInner = (props) => {
|
|
|
3686
3696
|
handleHighlightedMessageChange({ highlightedMessageId: jumpToMessageFromSearch.id });
|
|
3687
3697
|
}, [jumpToMessageFromSearch, handleHighlightedMessageChange]);
|
|
3688
3698
|
const notifyJumpToFirstUnreadError = React.useCallback(() => {
|
|
3689
|
-
|
|
3699
|
+
addNotification({
|
|
3700
|
+
context: { feature: "jumpToFirstUnread" },
|
|
3701
|
+
emitter: "Channel",
|
|
3690
3702
|
message: t("Failed to jump to the first unread message"),
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
},
|
|
3695
|
-
origin: {
|
|
3696
|
-
context: { feature: "jumpToFirstUnread" },
|
|
3697
|
-
emitter: "Channel"
|
|
3698
|
-
}
|
|
3703
|
+
severity: "error",
|
|
3704
|
+
targetPanels: ["channel"],
|
|
3705
|
+
type: "channel:jumpToFirstUnread:failed"
|
|
3699
3706
|
});
|
|
3700
|
-
}, [
|
|
3707
|
+
}, [addNotification, t]);
|
|
3701
3708
|
const loadMoreFinished = React.useCallback(
|
|
3702
3709
|
debounce(
|
|
3703
3710
|
(hasMore, messages) => {
|
|
@@ -4298,7 +4305,6 @@ const ChatViewChannelsSelectorButton = ({
|
|
|
4298
4305
|
iconOnly = true
|
|
4299
4306
|
}) => {
|
|
4300
4307
|
const { activeChatView, setActiveChatView } = useChatViewContext();
|
|
4301
|
-
const { openMobileNav } = useChatContext("ChatViewChannelsSelectorButton");
|
|
4302
4308
|
const { t } = useTranslationContext();
|
|
4303
4309
|
const isActive = activeChatView === "channels";
|
|
4304
4310
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4309,10 +4315,7 @@ const ChatViewChannelsSelectorButton = ({
|
|
|
4309
4315
|
Icon: IconMessageBubble,
|
|
4310
4316
|
iconOnly,
|
|
4311
4317
|
isActive,
|
|
4312
|
-
onPointerDown: () =>
|
|
4313
|
-
openMobileNav();
|
|
4314
|
-
setActiveChatView("channels");
|
|
4315
|
-
},
|
|
4318
|
+
onPointerDown: () => setActiveChatView("channels"),
|
|
4316
4319
|
text: t("Channels")
|
|
4317
4320
|
}
|
|
4318
4321
|
);
|
|
@@ -4320,7 +4323,7 @@ const ChatViewChannelsSelectorButton = ({
|
|
|
4320
4323
|
const ChatViewThreadsSelectorButton = ({
|
|
4321
4324
|
iconOnly = true
|
|
4322
4325
|
}) => {
|
|
4323
|
-
const { client
|
|
4326
|
+
const { client } = useChatContext();
|
|
4324
4327
|
const { unreadThreadCount } = useStateStore(
|
|
4325
4328
|
client.threads.state,
|
|
4326
4329
|
unreadThreadCountSelector
|
|
@@ -4338,10 +4341,7 @@ const ChatViewThreadsSelectorButton = ({
|
|
|
4338
4341
|
Icon: IconThread,
|
|
4339
4342
|
iconOnly,
|
|
4340
4343
|
isActive,
|
|
4341
|
-
onPointerDown: () =>
|
|
4342
|
-
openMobileNav();
|
|
4343
|
-
setActiveChatView("threads");
|
|
4344
|
-
},
|
|
4344
|
+
onPointerDown: () => setActiveChatView("threads"),
|
|
4345
4345
|
text: t("Threads"),
|
|
4346
4346
|
children: /* @__PURE__ */ jsxRuntime.jsx(UnreadCountBadge, { count: unreadThreadCount, position: "top-right", children: isActive ? /* @__PURE__ */ jsxRuntime.jsx(IconThreadFill, {}) : /* @__PURE__ */ jsxRuntime.jsx(IconThread, {}) })
|
|
4347
4347
|
}
|
|
@@ -4360,19 +4360,7 @@ const defaultChatViewSelectorItemSet = [
|
|
|
4360
4360
|
const ChatViewSelector = ({
|
|
4361
4361
|
iconOnly = true,
|
|
4362
4362
|
itemSet = defaultChatViewSelectorItemSet
|
|
4363
|
-
}) => {
|
|
4364
|
-
const { navOpen } = useChatContext("ChatView.Selector");
|
|
4365
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4366
|
-
"div",
|
|
4367
|
-
{
|
|
4368
|
-
className: clsx("str-chat__chat-view__selector", {
|
|
4369
|
-
"str-chat__chat-view__selector--nav-closed": navOpen === false,
|
|
4370
|
-
"str-chat__chat-view__selector--nav-open": navOpen === true
|
|
4371
|
-
}),
|
|
4372
|
-
children: itemSet.map(({ Component, type }) => /* @__PURE__ */ jsxRuntime.jsx(Component, { iconOnly }, type))
|
|
4373
|
-
}
|
|
4374
|
-
);
|
|
4375
|
-
};
|
|
4363
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "str-chat__chat-view__selector", children: itemSet.map(({ Component, type }) => /* @__PURE__ */ jsxRuntime.jsx(Component, { iconOnly }, type)) });
|
|
4376
4364
|
ChatView.Channels = ChannelsView;
|
|
4377
4365
|
ChatView.Threads = ThreadsView;
|
|
4378
4366
|
ChatView.ThreadAdapter = ThreadAdapter;
|
|
@@ -4389,6 +4377,115 @@ const useNotificationTarget = () => {
|
|
|
4389
4377
|
if (channels) return "channel-list";
|
|
4390
4378
|
return void 0;
|
|
4391
4379
|
};
|
|
4380
|
+
const SYSTEM_NOTIFICATION_TAG = "system";
|
|
4381
|
+
const hasSystemNotificationTag = (notification) => notification.tags?.includes(SYSTEM_NOTIFICATION_TAG) ?? false;
|
|
4382
|
+
const getTargetTags = (targetPanels, inferredPanel, tags) => {
|
|
4383
|
+
if (targetPanels) {
|
|
4384
|
+
return Array.from(
|
|
4385
|
+
/* @__PURE__ */ new Set([...targetPanels.map(getNotificationTargetTag), ...tags ?? []])
|
|
4386
|
+
);
|
|
4387
|
+
}
|
|
4388
|
+
return addNotificationTargetTag(inferredPanel, tags);
|
|
4389
|
+
};
|
|
4390
|
+
const getTypeFromIncident = ({
|
|
4391
|
+
incident,
|
|
4392
|
+
severity,
|
|
4393
|
+
type
|
|
4394
|
+
}) => {
|
|
4395
|
+
if (type) return type;
|
|
4396
|
+
if (!incident) return void 0;
|
|
4397
|
+
const status = incident.status ?? (severity === "error" ? "failed" : severity === "success" ? "success" : severity);
|
|
4398
|
+
return [incident.domain, incident.entity, incident.operation, status].filter((segment) => !!segment).join(":");
|
|
4399
|
+
};
|
|
4400
|
+
const useNotificationApi = () => {
|
|
4401
|
+
const { client } = useChatContext();
|
|
4402
|
+
const inferredPanel = useNotificationTarget();
|
|
4403
|
+
const addNotification = React.useCallback(
|
|
4404
|
+
({
|
|
4405
|
+
actions,
|
|
4406
|
+
context,
|
|
4407
|
+
duration,
|
|
4408
|
+
emitter,
|
|
4409
|
+
error,
|
|
4410
|
+
incident,
|
|
4411
|
+
message,
|
|
4412
|
+
severity,
|
|
4413
|
+
tags,
|
|
4414
|
+
targetPanels,
|
|
4415
|
+
type
|
|
4416
|
+
}) => {
|
|
4417
|
+
const notificationTags = getTargetTags(targetPanels, inferredPanel, tags);
|
|
4418
|
+
const resolvedType = getTypeFromIncident({ incident, severity, type });
|
|
4419
|
+
const origin = context ? { context, emitter } : { emitter };
|
|
4420
|
+
const options = {
|
|
4421
|
+
...actions ? { actions } : {},
|
|
4422
|
+
...typeof duration === "number" ? { duration } : {},
|
|
4423
|
+
...error ? { originalError: error } : {},
|
|
4424
|
+
...notificationTags.length > 0 ? { tags: notificationTags } : {},
|
|
4425
|
+
...severity ? { severity } : {},
|
|
4426
|
+
...resolvedType ? { type: resolvedType } : {}
|
|
4427
|
+
};
|
|
4428
|
+
client.notifications.add({
|
|
4429
|
+
message,
|
|
4430
|
+
options,
|
|
4431
|
+
origin
|
|
4432
|
+
});
|
|
4433
|
+
},
|
|
4434
|
+
[client, inferredPanel]
|
|
4435
|
+
);
|
|
4436
|
+
const addSystemNotification = React.useCallback(
|
|
4437
|
+
({
|
|
4438
|
+
actions,
|
|
4439
|
+
context,
|
|
4440
|
+
duration,
|
|
4441
|
+
emitter,
|
|
4442
|
+
error,
|
|
4443
|
+
incident,
|
|
4444
|
+
message,
|
|
4445
|
+
severity,
|
|
4446
|
+
tags,
|
|
4447
|
+
type
|
|
4448
|
+
}) => {
|
|
4449
|
+
const notificationTags = Array.from(
|
|
4450
|
+
/* @__PURE__ */ new Set([SYSTEM_NOTIFICATION_TAG, ...tags ?? []])
|
|
4451
|
+
);
|
|
4452
|
+
const resolvedType = getTypeFromIncident({ incident, severity, type });
|
|
4453
|
+
const origin = context ? { context, emitter } : { emitter };
|
|
4454
|
+
const options = {
|
|
4455
|
+
...actions ? { actions } : {},
|
|
4456
|
+
...typeof duration === "number" ? { duration } : {},
|
|
4457
|
+
...error ? { originalError: error } : {},
|
|
4458
|
+
...notificationTags.length > 0 ? { tags: notificationTags } : {},
|
|
4459
|
+
...severity ? { severity } : {},
|
|
4460
|
+
...resolvedType ? { type: resolvedType } : {}
|
|
4461
|
+
};
|
|
4462
|
+
return client.notifications.add({
|
|
4463
|
+
message,
|
|
4464
|
+
options,
|
|
4465
|
+
origin
|
|
4466
|
+
});
|
|
4467
|
+
},
|
|
4468
|
+
[client]
|
|
4469
|
+
);
|
|
4470
|
+
const removeNotification = React.useCallback(
|
|
4471
|
+
(id) => {
|
|
4472
|
+
client.notifications.remove(id);
|
|
4473
|
+
},
|
|
4474
|
+
[client]
|
|
4475
|
+
);
|
|
4476
|
+
const startNotificationTimeout = React.useCallback(
|
|
4477
|
+
(id) => {
|
|
4478
|
+
client.notifications.startTimeout(id);
|
|
4479
|
+
},
|
|
4480
|
+
[client]
|
|
4481
|
+
);
|
|
4482
|
+
return {
|
|
4483
|
+
addNotification,
|
|
4484
|
+
addSystemNotification,
|
|
4485
|
+
removeNotification,
|
|
4486
|
+
startNotificationTimeout
|
|
4487
|
+
};
|
|
4488
|
+
};
|
|
4392
4489
|
const AudioPlayerContext = React.createContext({
|
|
4393
4490
|
audioPlayers: null
|
|
4394
4491
|
});
|
|
@@ -4417,7 +4514,7 @@ const useAudioPlayer = ({
|
|
|
4417
4514
|
title,
|
|
4418
4515
|
waveformData
|
|
4419
4516
|
}) => {
|
|
4420
|
-
const {
|
|
4517
|
+
const { addNotification } = useNotificationApi();
|
|
4421
4518
|
const panel = useNotificationTarget();
|
|
4422
4519
|
const { t } = useTranslationContext();
|
|
4423
4520
|
const { audioPlayers } = React.useContext(AudioPlayerContext);
|
|
@@ -4435,7 +4532,7 @@ const useAudioPlayer = ({
|
|
|
4435
4532
|
React.useEffect(() => {
|
|
4436
4533
|
if (!audioPlayer) return;
|
|
4437
4534
|
const notificationsPlugin = audioPlayerNotificationsPluginFactory({
|
|
4438
|
-
|
|
4535
|
+
addNotification,
|
|
4439
4536
|
panel,
|
|
4440
4537
|
t
|
|
4441
4538
|
});
|
|
@@ -4443,7 +4540,7 @@ const useAudioPlayer = ({
|
|
|
4443
4540
|
...currentPlugins.filter((plugin) => plugin.id !== notificationsPlugin.id),
|
|
4444
4541
|
notificationsPlugin
|
|
4445
4542
|
]);
|
|
4446
|
-
}, [
|
|
4543
|
+
}, [addNotification, audioPlayer, panel, t]);
|
|
4447
4544
|
return audioPlayer;
|
|
4448
4545
|
};
|
|
4449
4546
|
const activeAudioPlayerSelector = ({ activeAudioPlayer }) => ({
|
|
@@ -4489,6 +4586,8 @@ exports.IconAudio = IconAudio;
|
|
|
4489
4586
|
exports.IconBell = IconBell;
|
|
4490
4587
|
exports.IconBellOff = IconBellOff;
|
|
4491
4588
|
exports.IconBolt = IconBolt;
|
|
4589
|
+
exports.IconBookmark = IconBookmark;
|
|
4590
|
+
exports.IconBookmarkRemove = IconBookmarkRemove;
|
|
4492
4591
|
exports.IconCamera = IconCamera;
|
|
4493
4592
|
exports.IconCheckmark = IconCheckmark;
|
|
4494
4593
|
exports.IconCheckmark1Small = IconCheckmark1Small;
|
|
@@ -4502,6 +4601,7 @@ exports.IconCopy = IconCopy;
|
|
|
4502
4601
|
exports.IconDelete = IconDelete;
|
|
4503
4602
|
exports.IconEdit = IconEdit;
|
|
4504
4603
|
exports.IconEmoji = IconEmoji;
|
|
4604
|
+
exports.IconEmojiAdd = IconEmojiAdd;
|
|
4505
4605
|
exports.IconExclamationCircleFill = IconExclamationCircleFill;
|
|
4506
4606
|
exports.IconExclamationMark = IconExclamationMark;
|
|
4507
4607
|
exports.IconExclamationMarkFill = IconExclamationMarkFill;
|
|
@@ -4518,6 +4618,8 @@ exports.IconLocation = IconLocation;
|
|
|
4518
4618
|
exports.IconMessageBubble = IconMessageBubble;
|
|
4519
4619
|
exports.IconMessageBubbleFill = IconMessageBubbleFill;
|
|
4520
4620
|
exports.IconMessageBubbles = IconMessageBubbles;
|
|
4621
|
+
exports.IconMicrophoneSolid = IconMicrophoneSolid;
|
|
4622
|
+
exports.IconMinus = IconMinus;
|
|
4521
4623
|
exports.IconMinusCircle = IconMinusCircle;
|
|
4522
4624
|
exports.IconMore = IconMore;
|
|
4523
4625
|
exports.IconMute = IconMute;
|
|
@@ -4534,16 +4636,14 @@ exports.IconRefresh = IconRefresh;
|
|
|
4534
4636
|
exports.IconReorder = IconReorder;
|
|
4535
4637
|
exports.IconReply = IconReply;
|
|
4536
4638
|
exports.IconRetry = IconRetry;
|
|
4537
|
-
exports.IconSave = IconSave;
|
|
4538
4639
|
exports.IconSearch = IconSearch;
|
|
4539
4640
|
exports.IconSend = IconSend;
|
|
4540
|
-
exports.IconSidebar = IconSidebar;
|
|
4541
4641
|
exports.IconThread = IconThread;
|
|
4542
4642
|
exports.IconThreadFill = IconThreadFill;
|
|
4543
4643
|
exports.IconTranslate = IconTranslate;
|
|
4544
4644
|
exports.IconTrophy = IconTrophy;
|
|
4545
4645
|
exports.IconUnpin = IconUnpin;
|
|
4546
|
-
exports.
|
|
4646
|
+
exports.IconUnsupportedAttachment = IconUnsupportedAttachment;
|
|
4547
4647
|
exports.IconUpload = IconUpload;
|
|
4548
4648
|
exports.IconUser = IconUser;
|
|
4549
4649
|
exports.IconUserAdd = IconUserAdd;
|
|
@@ -4563,6 +4663,7 @@ exports.MESSAGE_ACTIONS = MESSAGE_ACTIONS;
|
|
|
4563
4663
|
exports.MessageComposerContext = MessageComposerContext;
|
|
4564
4664
|
exports.MessageComposerContextProvider = MessageComposerContextProvider;
|
|
4565
4665
|
exports.OPTIONAL_MESSAGE_ACTIONS = OPTIONAL_MESSAGE_ACTIONS;
|
|
4666
|
+
exports.SYSTEM_NOTIFICATION_TAG = SYSTEM_NOTIFICATION_TAG;
|
|
4566
4667
|
exports.ThreadContext = ThreadContext;
|
|
4567
4668
|
exports.ThreadProvider = ThreadProvider;
|
|
4568
4669
|
exports.TranslationContext = TranslationContext;
|
|
@@ -4578,7 +4679,6 @@ exports.countEmojis = countEmojis;
|
|
|
4578
4679
|
exports.createIcon = createIcon;
|
|
4579
4680
|
exports.defaultChatViewSelectorItemSet = defaultChatViewSelectorItemSet;
|
|
4580
4681
|
exports.defaultDateTimeParser = defaultDateTimeParser;
|
|
4581
|
-
exports.defaultPinPermissions = defaultPinPermissions;
|
|
4582
4682
|
exports.defaultRegisterAudioPlayerError = defaultRegisterAudioPlayerError;
|
|
4583
4683
|
exports.defaultTranslatorFunction = defaultTranslatorFunction;
|
|
4584
4684
|
exports.elementIsPlaying = elementIsPlaying;
|
|
@@ -4592,10 +4692,11 @@ exports.getLastReceived = getLastReceived;
|
|
|
4592
4692
|
exports.getMessageActions = getMessageActions;
|
|
4593
4693
|
exports.getNonImageAttachments = getNonImageAttachments;
|
|
4594
4694
|
exports.getNotificationTargetPanel = getNotificationTargetPanel;
|
|
4695
|
+
exports.getNotificationTargetPanels = getNotificationTargetPanels;
|
|
4595
4696
|
exports.getNotificationTargetTag = getNotificationTargetTag;
|
|
4596
4697
|
exports.getReadByTooltipText = getReadByTooltipText;
|
|
4597
4698
|
exports.hasMoreMessagesProbably = hasMoreMessagesProbably;
|
|
4598
|
-
exports.
|
|
4699
|
+
exports.hasSystemNotificationTag = hasSystemNotificationTag;
|
|
4599
4700
|
exports.insertIntro = insertIntro;
|
|
4600
4701
|
exports.isDate = isDate;
|
|
4601
4702
|
exports.isDateSeparatorMessage = isDateSeparatorMessage;
|
|
@@ -4605,6 +4706,7 @@ exports.isLanguageSupported = isLanguageSupported;
|
|
|
4605
4706
|
exports.isLocalMessage = isLocalMessage;
|
|
4606
4707
|
exports.isMessageBlocked = isMessageBlocked;
|
|
4607
4708
|
exports.isMessageBounced = isMessageBounced;
|
|
4709
|
+
exports.isMessageDeleted = isMessageDeleted;
|
|
4608
4710
|
exports.isMessageEdited = isMessageEdited;
|
|
4609
4711
|
exports.isMessageErrorRetryable = isMessageErrorRetryable;
|
|
4610
4712
|
exports.isNetworkSendFailure = isNetworkSendFailure;
|
|
@@ -4617,6 +4719,7 @@ exports.makeIntroMessage = makeIntroMessage;
|
|
|
4617
4719
|
exports.mapToUserNameOrId = mapToUserNameOrId;
|
|
4618
4720
|
exports.messageHasAttachments = messageHasAttachments;
|
|
4619
4721
|
exports.messageHasGiphyAttachment = messageHasGiphyAttachment;
|
|
4722
|
+
exports.messageHasQuotedMessage = messageHasQuotedMessage;
|
|
4620
4723
|
exports.messageHasReactions = messageHasReactions;
|
|
4621
4724
|
exports.messageHasSingleAttachment = messageHasSingleAttachment;
|
|
4622
4725
|
exports.messageTextHasEmojisOnly = messageTextHasEmojisOnly;
|
|
@@ -4637,6 +4740,7 @@ exports.useLegacyThreadContext = useLegacyThreadContext;
|
|
|
4637
4740
|
exports.useMentionsHandlers = useMentionsHandlers;
|
|
4638
4741
|
exports.useMessageComposerContext = useMessageComposerContext;
|
|
4639
4742
|
exports.useMessageComposerController = useMessageComposerController;
|
|
4743
|
+
exports.useNotificationApi = useNotificationApi;
|
|
4640
4744
|
exports.useNotificationTarget = useNotificationTarget;
|
|
4641
4745
|
exports.usePopoverPosition = usePopoverPosition;
|
|
4642
4746
|
exports.useStateStore = useStateStore;
|
|
@@ -4645,4 +4749,4 @@ exports.useThreadsViewContext = useThreadsViewContext;
|
|
|
4645
4749
|
exports.useTranslationContext = useTranslationContext;
|
|
4646
4750
|
exports.useTypingContext = useTypingContext;
|
|
4647
4751
|
exports.validateAndGetMessage = validateAndGetMessage;
|
|
4648
|
-
//# sourceMappingURL=WithAudioPlayback.
|
|
4752
|
+
//# sourceMappingURL=WithAudioPlayback.58b0b39b.js.map
|