stream-chat-react 14.9.0 → 14.11.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/README.md +20 -1
- package/dist/cjs/{useNotificationApi.bf76a16b.js → NotificationList.6abbee1c.js} +4935 -1232
- package/dist/cjs/NotificationList.6abbee1c.js.map +1 -0
- package/dist/cjs/{ReactPlayerWrapper.60a93742.js → ReactPlayerWrapper.a94a0cd1.js} +3 -3
- package/dist/cjs/{ReactPlayerWrapper.60a93742.js.map → ReactPlayerWrapper.a94a0cd1.js.map} +1 -1
- package/dist/cjs/channel-detail.js +288 -217
- package/dist/cjs/channel-detail.js.map +1 -1
- package/dist/cjs/emojis.js +31 -15
- package/dist/cjs/emojis.js.map +1 -1
- package/dist/cjs/index.js +2114 -7670
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/useChannelHeaderOnlineStatus.7e17671e.js +961 -0
- package/dist/cjs/useChannelHeaderOnlineStatus.7e17671e.js.map +1 -0
- package/dist/cjs/useInertWhenHidden.22151beb.js +6426 -0
- package/dist/cjs/useInertWhenHidden.22151beb.js.map +1 -0
- package/dist/es/{useNotificationApi.ed6bff88.mjs → NotificationList.db01a56d.mjs} +4556 -1258
- package/dist/es/NotificationList.db01a56d.mjs.map +1 -0
- package/dist/es/channel-detail.mjs +115 -44
- package/dist/es/channel-detail.mjs.map +1 -1
- package/dist/es/emojis.mjs +25 -8
- package/dist/es/emojis.mjs.map +1 -1
- package/dist/es/index.mjs +1056 -6612
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/useChannelHeaderOnlineStatus.a9357343.mjs +771 -0
- package/dist/es/useChannelHeaderOnlineStatus.a9357343.mjs.map +1 -0
- package/dist/es/useInertWhenHidden.3d5fbdba.mjs +5765 -0
- package/dist/es/useInertWhenHidden.3d5fbdba.mjs.map +1 -0
- package/dist/types/components/Attachment/Geolocation.d.ts.map +1 -1
- package/dist/types/components/Attachment/LinkPreview/Card.d.ts.map +1 -1
- package/dist/types/components/Attachment/LinkPreview/CardAudio.d.ts.map +1 -1
- package/dist/types/components/Attachment/ModalGallery.d.ts.map +1 -1
- package/dist/types/components/Attachment/UnsupportedAttachment.d.ts.map +1 -1
- package/dist/types/components/Attachment/VisibilityDisclaimer.d.ts.map +1 -1
- package/dist/types/components/Attachment/components/DownloadButton.d.ts.map +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +12 -3
- 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/Badge/Badge.d.ts.map +1 -1
- package/dist/types/components/Badge/MediaBadge.d.ts.map +1 -1
- package/dist/types/components/BaseImage/ImagePlaceholder.d.ts.map +1 -1
- package/dist/types/components/Button/PlayButton.d.ts.map +1 -1
- package/dist/types/components/Channel/Channel.d.ts.map +1 -1
- 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/hooks/useMessageDeliveryStatus.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/utils.d.ts.map +1 -1
- package/dist/types/components/ChatView/ChatView.d.ts.map +1 -1
- package/dist/types/components/Dialog/components/Callout.d.ts.map +1 -1
- package/dist/types/components/Dialog/components/ContextMenu.d.ts +4 -0
- 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/components/Viewer.d.ts.map +1 -1
- package/dist/types/components/EmptyStateIndicator/EmptyStateIndicator.d.ts.map +1 -1
- package/dist/types/components/Form/NumericInput.d.ts.map +1 -1
- package/dist/types/components/Form/TextInput.d.ts.map +1 -1
- package/dist/types/components/Gallery/GalleryHeader.d.ts.map +1 -1
- package/dist/types/components/Gallery/GalleryUI.d.ts.map +1 -1
- package/dist/types/components/Icons/index.d.ts +1 -0
- package/dist/types/components/Icons/index.d.ts.map +1 -1
- package/dist/types/components/Icons/slots.d.ts +10 -0
- package/dist/types/components/Icons/slots.d.ts.map +1 -0
- package/dist/types/components/Loading/LoadingIndicator.d.ts +2 -2
- package/dist/types/components/Loading/LoadingIndicator.d.ts.map +1 -1
- 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/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.d.ts.map +1 -1
- package/dist/types/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.d.ts.map +1 -1
- package/dist/types/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.d.ts.map +1 -1
- package/dist/types/components/Message/MessageAlsoSentInChannelIndicator.d.ts.map +1 -1
- package/dist/types/components/Message/MessageDeletedBubble.d.ts.map +1 -1
- package/dist/types/components/Message/MessageRepliesCountButton.d.ts.map +1 -1
- package/dist/types/components/Message/MessageStatus.d.ts.map +1 -1
- package/dist/types/components/Message/MessageTranslationIndicator.d.ts.map +1 -1
- package/dist/types/components/Message/MessageUI.d.ts.map +1 -1
- package/dist/types/components/Message/PinIndicator.d.ts.map +1 -1
- package/dist/types/components/Message/ReminderNotification.d.ts.map +1 -1
- package/dist/types/components/MessageActions/DownloadSubmenu.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/MessageBounce/MessageBouncePrompt.d.ts.map +1 -1
- 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/GeolocationPreview.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.map +1 -1
- 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/LinkPreviewList.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/MessageComposer.d.ts +10 -1
- package/dist/types/components/MessageComposer/MessageComposer.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/MessageComposerActions.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/QuotedMessagePreview.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/RemoveAttachmentPreviewButton.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/SendButton.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/SendToChannelCheckbox.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/WithDragAndDropUpload.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/hooks/useMessageComposerCommands.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/hooks/useMessageComposerController.d.ts.map +1 -1
- package/dist/types/components/MessageList/ScrollToLatestMessageButton.d.ts.map +1 -1
- package/dist/types/components/MessageList/UnreadMessagesNotification.d.ts.map +1 -1
- package/dist/types/components/MessageList/UnreadMessagesSeparator.d.ts.map +1 -1
- package/dist/types/components/MessageList/hooks/useMarkRead.d.ts.map +1 -1
- package/dist/types/components/Modal/CloseButtonOnModalOverlay.d.ts.map +1 -1
- package/dist/types/components/Notifications/Notification.d.ts.map +1 -1
- package/dist/types/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.d.ts.map +1 -1
- package/dist/types/components/Poll/PollCreationDialog/OptionFieldSet.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.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/Reactions/MessageReactionsDetail.d.ts.map +1 -1
- package/dist/types/components/Reactions/ReactionSelector.d.ts.map +1 -1
- package/dist/types/components/Reactions/ReactionSelectorWithButton.d.ts +6 -1
- package/dist/types/components/Reactions/ReactionSelectorWithButton.d.ts.map +1 -1
- package/dist/types/components/Search/SearchResults/SearchResultItem.d.ts.map +1 -1
- package/dist/types/components/SummarizedMessagePreview/SummarizedMessagePreview.d.ts.map +1 -1
- package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.d.ts.map +1 -1
- package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.d.ts.map +1 -1
- package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.d.ts.map +1 -1
- package/dist/types/components/TextareaComposer/SuggestionList/MentionItem/UserItem.d.ts.map +1 -1
- package/dist/types/components/Thread/ThreadHeader.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadListEmptyPlaceholder.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadListItemUI.d.ts.map +1 -1
- package/dist/types/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.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/VideoPlayer/VideoThumbnail.d.ts.map +1 -1
- package/dist/types/context/ComponentContext.d.ts +7 -0
- package/dist/types/context/ComponentContext.d.ts.map +1 -1
- package/dist/types/context/WithComponents.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/context/useComponentContextIcons.d.ts +16 -0
- package/dist/types/context/useComponentContextIcons.d.ts.map +1 -0
- package/dist/types/plugins/ChannelDetail/ChannelDetail.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/ChannelDetailEmptyList.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/ChannelDetailSearchInput.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.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/ChannelMembersView/ChannelMembersHeaderActions.defaults.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.d.ts.map +1 -1
- package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesView.d.ts.map +1 -1
- package/dist/types/plugins/Emojis/EmojiPicker.d.ts +6 -1
- package/dist/types/plugins/Emojis/EmojiPicker.d.ts.map +1 -1
- package/dist/types/plugins/Emojis/Picker.d.ts +7 -0
- package/dist/types/plugins/Emojis/Picker.d.ts.map +1 -0
- package/dist/types/utils/getChannelConfig.d.ts +8 -0
- package/dist/types/utils/getChannelConfig.d.ts.map +1 -0
- package/package.json +3 -9
- package/AI.md +0 -423
- package/dist/cjs/useChannelHeaderOnlineStatus.72753090.js +0 -4469
- package/dist/cjs/useChannelHeaderOnlineStatus.72753090.js.map +0 -1
- package/dist/cjs/useMessageComposerController.f8f20e3d.js +0 -99
- package/dist/cjs/useMessageComposerController.f8f20e3d.js.map +0 -1
- package/dist/cjs/useNotificationApi.bf76a16b.js.map +0 -1
- package/dist/es/useChannelHeaderOnlineStatus.c86db868.mjs +0 -3889
- package/dist/es/useChannelHeaderOnlineStatus.c86db868.mjs.map +0 -1
- package/dist/es/useMessageComposerController.d50f6168.mjs +0 -69
- package/dist/es/useMessageComposerController.d50f6168.mjs.map +0 -1
- package/dist/es/useNotificationApi.ed6bff88.mjs.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_useChannelHeaderOnlineStatus = require("./useChannelHeaderOnlineStatus.
|
|
2
|
+
const require_NotificationList = require("./NotificationList.6abbee1c.js");
|
|
3
|
+
const require_useChannelHeaderOnlineStatus = require("./useChannelHeaderOnlineStatus.7e17671e.js");
|
|
4
4
|
let react = require("react");
|
|
5
|
-
react =
|
|
5
|
+
react = require_NotificationList.__toESM(react);
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
let stream_chat = require("stream-chat");
|
|
8
7
|
let clsx = require("clsx");
|
|
9
|
-
clsx =
|
|
8
|
+
clsx = require_NotificationList.__toESM(clsx);
|
|
9
|
+
let stream_chat = require("stream-chat");
|
|
10
10
|
let lodash_debounce = require("lodash.debounce");
|
|
11
|
-
lodash_debounce =
|
|
11
|
+
lodash_debounce = require_NotificationList.__toESM(lodash_debounce);
|
|
12
12
|
let lodash_uniqby = require("lodash.uniqby");
|
|
13
|
-
lodash_uniqby =
|
|
13
|
+
lodash_uniqby = require_NotificationList.__toESM(lodash_uniqby);
|
|
14
14
|
let react_virtuoso = require("react-virtuoso");
|
|
15
15
|
//#region src/plugins/ChannelDetail/SectionNavigator/SectionNavigator.tsx
|
|
16
16
|
var SECTION_NAVIGATOR_LAYOUT = {
|
|
@@ -179,13 +179,14 @@ var SectionNavigator = ({ className, createLayoutObserver = defaultCreateLayoutO
|
|
|
179
179
|
* (`goBack`), where it would compete with the back affordance.
|
|
180
180
|
*/
|
|
181
181
|
var SectionNavigatorHeader = (props) => {
|
|
182
|
-
const {
|
|
182
|
+
const { IconMenu } = require_NotificationList.useComponentContextIcons();
|
|
183
|
+
const { t } = require_NotificationList.useTranslationContext("SectionNavigatorHeader");
|
|
183
184
|
const { layout, openNavigation } = useSectionNavigatorContext();
|
|
184
185
|
const MenuButton = (0, react.useMemo)(() => {
|
|
185
186
|
if (layout !== SECTION_NAVIGATOR_LAYOUT.inline) return void 0;
|
|
186
187
|
if (props.goBack) return void 0;
|
|
187
188
|
return function SectionNavigatorHeaderMenuButton() {
|
|
188
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
189
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
189
190
|
appearance: "ghost",
|
|
190
191
|
"aria-label": t("Open menu"),
|
|
191
192
|
circular: true,
|
|
@@ -193,16 +194,17 @@ var SectionNavigatorHeader = (props) => {
|
|
|
193
194
|
onClick: openNavigation,
|
|
194
195
|
size: "md",
|
|
195
196
|
variant: "secondary",
|
|
196
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
197
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconMenu, {})
|
|
197
198
|
});
|
|
198
199
|
};
|
|
199
200
|
}, [
|
|
201
|
+
IconMenu,
|
|
200
202
|
layout,
|
|
201
203
|
openNavigation,
|
|
202
204
|
props.goBack,
|
|
203
205
|
t
|
|
204
206
|
]);
|
|
205
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
207
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.Header, {
|
|
206
208
|
...props,
|
|
207
209
|
LeadingContent: MenuButton
|
|
208
210
|
});
|
|
@@ -214,7 +216,7 @@ var SectionNavigatorHeader = (props) => {
|
|
|
214
216
|
* `ListItemLayout` as a `<button>` and wires the SectionNavigator selection
|
|
215
217
|
* state into `aria-current` and the click handler.
|
|
216
218
|
*/
|
|
217
|
-
var ChannelDetailNavButton = ({ className, LeadingIcon, sectionId: _sectionId, select, selected, title, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
219
|
+
var ChannelDetailNavButton = ({ className, LeadingIcon, sectionId: _sectionId, select, selected, title, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
218
220
|
LeadingIcon,
|
|
219
221
|
RootElement: "button",
|
|
220
222
|
rootProps: {
|
|
@@ -244,10 +246,11 @@ var useChannelDetailContext = () => {
|
|
|
244
246
|
//#endregion
|
|
245
247
|
//#region src/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.tsx
|
|
246
248
|
var ChannelFilesEmptyList = () => {
|
|
247
|
-
const {
|
|
249
|
+
const { IconFolder } = require_NotificationList.useComponentContextIcons();
|
|
250
|
+
const { t } = require_NotificationList.useTranslationContext("ChannelFilesEmptyList");
|
|
248
251
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
249
252
|
className: "str-chat__channel-detail__files-view__empty-state",
|
|
250
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
253
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolder, { className: "str-chat__channel-detail__files-view__empty-state__icon" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
251
254
|
className: "str-chat__channel-detail__files-view__empty-state__content",
|
|
252
255
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
253
256
|
className: "str-chat__channel-detail__files-view__empty-state__title",
|
|
@@ -266,11 +269,11 @@ var searchSourceFooterStateSelector = (state) => ({
|
|
|
266
269
|
isLoading: state.isLoading
|
|
267
270
|
});
|
|
268
271
|
var ChannelDetailListLoadingIndicator = ({ searchSource }) => {
|
|
269
|
-
const { hasNextPage, isLoading } =
|
|
272
|
+
const { hasNextPage, isLoading } = require_NotificationList.useStateStore(searchSource.state, searchSourceFooterStateSelector);
|
|
270
273
|
if (!hasNextPage || !isLoading) return null;
|
|
271
274
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
272
275
|
className: "str-chat__loading-indicator-placeholder",
|
|
273
|
-
children: isLoading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
276
|
+
children: isLoading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.LoadingIndicator, {})
|
|
274
277
|
});
|
|
275
278
|
};
|
|
276
279
|
//#endregion
|
|
@@ -280,7 +283,7 @@ var FILE_ATTACHMENT_TYPES = ["file", "audio"];
|
|
|
280
283
|
var FILE_ATTACHMENT_TYPE_SET = new Set(FILE_ATTACHMENT_TYPES);
|
|
281
284
|
var normalizeTimestamp$1 = (timestamp) => {
|
|
282
285
|
if (!timestamp) return void 0;
|
|
283
|
-
return
|
|
286
|
+
return require_NotificationList.isDate(timestamp) ? timestamp.toISOString() : timestamp;
|
|
284
287
|
};
|
|
285
288
|
var isChannelFileAttachment = (attachment) => !(0, stream_chat.isScrapedContent)(attachment) && !!attachment.type && FILE_ATTACHMENT_TYPE_SET.has(attachment.type);
|
|
286
289
|
var byCreatedAtDesc = (a, b) => (b.createdAt ?? "").localeCompare(a.createdAt ?? "");
|
|
@@ -339,7 +342,7 @@ var channelFilesSearchSourceStateSelector = (state) => ({
|
|
|
339
342
|
messages: state.items
|
|
340
343
|
});
|
|
341
344
|
var useChannelFilesSearch = () => {
|
|
342
|
-
const { client } =
|
|
345
|
+
const { client } = require_NotificationList.useChatContext();
|
|
343
346
|
const { channel } = useChannelDetailContext();
|
|
344
347
|
const channelFilesSearchSource = (0, react.useMemo)(() => {
|
|
345
348
|
const source = new stream_chat.MessageSearchSource(client, {
|
|
@@ -351,7 +354,7 @@ var useChannelFilesSearch = () => {
|
|
|
351
354
|
source.messageSearchFilters = { "attachments.type": { $in: [...FILE_ATTACHMENT_TYPES] } };
|
|
352
355
|
return source;
|
|
353
356
|
}, [channel.cid, client]);
|
|
354
|
-
const { isLoading, messages } =
|
|
357
|
+
const { isLoading, messages } = require_NotificationList.useStateStore(channelFilesSearchSource.state, channelFilesSearchSourceStateSelector);
|
|
355
358
|
const { groupCounts, items, sections } = (0, react.useMemo)(() => toChannelFileSections(messages ?? []), [messages]);
|
|
356
359
|
(0, react.useEffect)(() => {
|
|
357
360
|
channelFilesSearchSource.activate();
|
|
@@ -386,8 +389,8 @@ var ChannelFilesGroup = (0, react.forwardRef)(function ChannelFilesGroup({ class
|
|
|
386
389
|
});
|
|
387
390
|
});
|
|
388
391
|
var ChannelFilesSectionHeader = ({ timestamp }) => {
|
|
389
|
-
const { t, tDateTimeParser } =
|
|
390
|
-
const label =
|
|
392
|
+
const { t, tDateTimeParser } = require_NotificationList.useTranslationContext("ChannelFilesView");
|
|
393
|
+
const label = require_NotificationList.getDateString({
|
|
391
394
|
format: "MMMM YYYY",
|
|
392
395
|
messageCreatedAt: timestamp,
|
|
393
396
|
t,
|
|
@@ -405,7 +408,7 @@ var ChannelFileListItem = ({ item }) => {
|
|
|
405
408
|
const fileName = getAttachmentFileName(attachment);
|
|
406
409
|
const assetUrl = attachment.asset_url;
|
|
407
410
|
const LeadingSlot = (0, react.useMemo)(() => function FileListItemIcon() {
|
|
408
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
411
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.FileIcon, {
|
|
409
412
|
className: "str-chat__channel-detail__files-view__list-item__icon",
|
|
410
413
|
fileName,
|
|
411
414
|
mimeType: attachment.mime_type,
|
|
@@ -414,7 +417,7 @@ var ChannelFileListItem = ({ item }) => {
|
|
|
414
417
|
}, [attachment.mime_type, fileName]);
|
|
415
418
|
const sharedProps = (0, react.useMemo)(() => ({
|
|
416
419
|
LeadingSlot,
|
|
417
|
-
subtitle: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
420
|
+
subtitle: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.FileSizeIndicator, { fileSize: attachment.file_size }),
|
|
418
421
|
subtitleClassName: "str-chat__channel-detail__files-view__list-item__size",
|
|
419
422
|
title: fileName,
|
|
420
423
|
titleClassName: "str-chat__channel-detail__files-view__list-item__name"
|
|
@@ -431,20 +434,20 @@ var ChannelFileListItem = ({ item }) => {
|
|
|
431
434
|
target: "_blank"
|
|
432
435
|
}), [assetUrl, fileName]);
|
|
433
436
|
const divRootProps = (0, react.useMemo)(() => ({ className: "str-chat__channel-detail__files-view__list-item" }), []);
|
|
434
|
-
if (assetUrl) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
437
|
+
if (assetUrl) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
435
438
|
...sharedProps,
|
|
436
439
|
RootElement: "a",
|
|
437
440
|
rootProps: linkRootProps
|
|
438
441
|
});
|
|
439
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
442
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
440
443
|
...sharedProps,
|
|
441
444
|
RootElement: "div",
|
|
442
445
|
rootProps: divRootProps
|
|
443
446
|
});
|
|
444
447
|
};
|
|
445
448
|
var ChannelFilesView = () => {
|
|
446
|
-
const { t } =
|
|
447
|
-
const { close } =
|
|
449
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
450
|
+
const { close } = require_NotificationList.useModalContext();
|
|
448
451
|
const { channelFilesSearchSource, fileItems, groupCounts, hasResultsLoaded, sections } = useChannelFilesSearch();
|
|
449
452
|
const groupContent = (0, react.useCallback)((groupIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelFilesSectionHeader, { timestamp: sections[groupIndex]?.timestamp }), [sections]);
|
|
450
453
|
const itemContent = (0, react.useCallback)((index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelFileListItem, { item: fileItems[index] }), [fileItems]);
|
|
@@ -468,7 +471,7 @@ var ChannelFilesView = () => {
|
|
|
468
471
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SectionNavigatorHeader, {
|
|
469
472
|
close,
|
|
470
473
|
title: t("Files")
|
|
471
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
474
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.Body, {
|
|
472
475
|
className: "str-chat__channel-detail__files-view__body",
|
|
473
476
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_virtuoso.GroupedVirtuoso, {
|
|
474
477
|
atBottomStateChange,
|
|
@@ -485,11 +488,26 @@ var ChannelFilesView = () => {
|
|
|
485
488
|
//#region src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.tsx
|
|
486
489
|
var toError$1 = (error) => error instanceof Error ? error : /* @__PURE__ */ new Error("An unknown error occurred");
|
|
487
490
|
var getDisplayName = (name, fallback) => name || fallback || "";
|
|
488
|
-
var BlockUserActionIcon$1 = () =>
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
var
|
|
491
|
+
var BlockUserActionIcon$1 = () => {
|
|
492
|
+
const { IconNoSign } = require_NotificationList.useComponentContextIcons();
|
|
493
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNoSign, { className: "str-chat__icon--destructive str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--block-user" });
|
|
494
|
+
};
|
|
495
|
+
var DeleteChatActionIcon = () => {
|
|
496
|
+
const { IconDelete } = require_NotificationList.useComponentContextIcons();
|
|
497
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDelete, { className: "str-chat__icon--destructive str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--delete-chat" });
|
|
498
|
+
};
|
|
499
|
+
var MuteActionIcon = () => {
|
|
500
|
+
const { IconMute } = require_NotificationList.useComponentContextIcons();
|
|
501
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconMute, { className: "str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--mute" });
|
|
502
|
+
};
|
|
503
|
+
var MutedActionIcon = () => {
|
|
504
|
+
const { IconAudio } = require_NotificationList.useComponentContextIcons();
|
|
505
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconAudio, { className: "str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--unmute" });
|
|
506
|
+
};
|
|
507
|
+
var LeaveChannelActionIcon = () => {
|
|
508
|
+
const { IconLeave } = require_NotificationList.useComponentContextIcons();
|
|
509
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLeave, { className: "str-chat__icon--destructive str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--leave-channel" });
|
|
510
|
+
};
|
|
493
511
|
var channelManagementViewActionClassName = "str-chat__channel-management-view-action";
|
|
494
512
|
var blockedUsersSelector$1 = ({ userIds }) => ({ userIds });
|
|
495
513
|
var ChannelManagementConfirmationAlert = ({ action, cancelLabel, confirmLabel, description, isSubmitting, onCancel, onConfirm, testId, title }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_useChannelHeaderOnlineStatus.Alert.Root, {
|
|
@@ -498,7 +516,7 @@ var ChannelManagementConfirmationAlert = ({ action, cancelLabel, confirmLabel, d
|
|
|
498
516
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useChannelHeaderOnlineStatus.Alert.Header, {
|
|
499
517
|
description,
|
|
500
518
|
title
|
|
501
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_useChannelHeaderOnlineStatus.Alert.Actions, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
519
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_useChannelHeaderOnlineStatus.Alert.Actions, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
502
520
|
appearance: "solid",
|
|
503
521
|
"data-testid": `${testId}-confirm-button`,
|
|
504
522
|
disabled: isSubmitting,
|
|
@@ -506,7 +524,7 @@ var ChannelManagementConfirmationAlert = ({ action, cancelLabel, confirmLabel, d
|
|
|
506
524
|
size: "md",
|
|
507
525
|
variant: "danger",
|
|
508
526
|
children: confirmLabel
|
|
509
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
527
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
510
528
|
appearance: "outline",
|
|
511
529
|
autoFocus: true,
|
|
512
530
|
"data-testid": `${testId}-cancel-button`,
|
|
@@ -518,7 +536,7 @@ var ChannelManagementConfirmationAlert = ({ action, cancelLabel, confirmLabel, d
|
|
|
518
536
|
})] })]
|
|
519
537
|
});
|
|
520
538
|
var useOtherMember = () => {
|
|
521
|
-
const { client } =
|
|
539
|
+
const { client } = require_NotificationList.useChatContext();
|
|
522
540
|
const { channel } = useChannelDetailContext();
|
|
523
541
|
return (0, react.useMemo)(() => {
|
|
524
542
|
const stateMembers = Object.values(channel.state?.members ?? {});
|
|
@@ -526,7 +544,7 @@ var useOtherMember = () => {
|
|
|
526
544
|
}, [channel, client.user?.id]);
|
|
527
545
|
};
|
|
528
546
|
var useChannelManagementActionFilterState = () => {
|
|
529
|
-
const { client } =
|
|
547
|
+
const { client } = require_NotificationList.useChatContext();
|
|
530
548
|
const { channel } = useChannelDetailContext();
|
|
531
549
|
const otherMember = useOtherMember();
|
|
532
550
|
const resolvedIsDmChannel = require_useChannelHeaderOnlineStatus.isDmChannel({
|
|
@@ -566,8 +584,8 @@ var useBaseChannelManagementActionSetFilter = (channelManagementActionSet) => {
|
|
|
566
584
|
};
|
|
567
585
|
var ChannelMuteAction = () => {
|
|
568
586
|
const { channel } = useChannelDetailContext();
|
|
569
|
-
const { addNotification } =
|
|
570
|
-
const { t } =
|
|
587
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
588
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
571
589
|
const { muted: channelMuted } = require_useChannelHeaderOnlineStatus.useIsChannelMuted(channel);
|
|
572
590
|
const [optimisticChannelMuted, setOptimisticChannelMuted] = (0, react.useState)(channelMuted);
|
|
573
591
|
(0, react.useEffect)(() => {
|
|
@@ -629,14 +647,14 @@ var ChannelMuteAction = () => {
|
|
|
629
647
|
}), [optimisticChannelMuted, toggleOptimisticChannelMute]);
|
|
630
648
|
const TrailingSlot = (0, react.useMemo)(() => {
|
|
631
649
|
function ChannelMuteSwitch() {
|
|
632
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
650
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Switch, {
|
|
633
651
|
on: optimisticChannelMuted,
|
|
634
652
|
presentation: true
|
|
635
653
|
});
|
|
636
654
|
}
|
|
637
655
|
return ChannelMuteSwitch;
|
|
638
656
|
}, [optimisticChannelMuted]);
|
|
639
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
657
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
640
658
|
LeadingIcon: optimisticChannelMuted ? MutedActionIcon : MuteActionIcon,
|
|
641
659
|
RootElement: "button",
|
|
642
660
|
rootProps,
|
|
@@ -645,10 +663,10 @@ var ChannelMuteAction = () => {
|
|
|
645
663
|
});
|
|
646
664
|
};
|
|
647
665
|
var UserMuteAction$1 = () => {
|
|
648
|
-
const { client, mutes } =
|
|
666
|
+
const { client, mutes } = require_NotificationList.useChatContext();
|
|
649
667
|
const { channel } = useChannelDetailContext();
|
|
650
|
-
const { addNotification } =
|
|
651
|
-
const { t } =
|
|
668
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
669
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
652
670
|
const otherMember = useOtherMember();
|
|
653
671
|
const userMuted = !!mutes.find((mute) => mute.target.id === otherMember?.user?.id);
|
|
654
672
|
const [optimisticUserMuted, setOptimisticUserMuted] = (0, react.useState)(userMuted);
|
|
@@ -713,14 +731,14 @@ var UserMuteAction$1 = () => {
|
|
|
713
731
|
}), [optimisticUserMuted, toggleOptimisticUserMute]);
|
|
714
732
|
const TrailingSlot = (0, react.useMemo)(() => {
|
|
715
733
|
function UserMuteSwitch() {
|
|
716
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
734
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Switch, {
|
|
717
735
|
on: optimisticUserMuted,
|
|
718
736
|
presentation: true
|
|
719
737
|
});
|
|
720
738
|
}
|
|
721
739
|
return UserMuteSwitch;
|
|
722
740
|
}, [optimisticUserMuted]);
|
|
723
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
741
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
724
742
|
LeadingIcon: optimisticUserMuted ? MutedActionIcon : MuteActionIcon,
|
|
725
743
|
RootElement: "button",
|
|
726
744
|
rootProps,
|
|
@@ -729,13 +747,13 @@ var UserMuteAction$1 = () => {
|
|
|
729
747
|
});
|
|
730
748
|
};
|
|
731
749
|
var BlockUserAction$1 = () => {
|
|
732
|
-
const { client } =
|
|
733
|
-
const { Modal =
|
|
750
|
+
const { client } = require_NotificationList.useChatContext();
|
|
751
|
+
const { Modal = require_NotificationList.GlobalModal } = require_NotificationList.useComponentContext();
|
|
734
752
|
const { channel } = useChannelDetailContext();
|
|
735
|
-
const { addNotification } =
|
|
736
|
-
const { t } =
|
|
753
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
754
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
737
755
|
const targetUserId = useOtherMember()?.user?.id;
|
|
738
|
-
const { userIds: blockedUserIds } =
|
|
756
|
+
const { userIds: blockedUserIds } = require_NotificationList.useStateStore(client.blockedUsers, blockedUsersSelector$1);
|
|
739
757
|
const isBlocked = (0, react.useMemo)(() => !!targetUserId && new Set(blockedUserIds).has(targetUserId), [blockedUserIds, targetUserId]);
|
|
740
758
|
const [alertOpen, setAlertOpen] = (0, react.useState)(false);
|
|
741
759
|
const [userBlockInProgress, setUserBlockInProgress] = (0, react.useState)(false);
|
|
@@ -809,7 +827,7 @@ var BlockUserAction$1 = () => {
|
|
|
809
827
|
targetUserId,
|
|
810
828
|
t
|
|
811
829
|
]);
|
|
812
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
830
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
813
831
|
destructive: true,
|
|
814
832
|
LeadingIcon: BlockUserActionIcon$1,
|
|
815
833
|
RootElement: "button",
|
|
@@ -836,12 +854,12 @@ var BlockUserAction$1 = () => {
|
|
|
836
854
|
})] });
|
|
837
855
|
};
|
|
838
856
|
var LeaveChannelAction = () => {
|
|
839
|
-
const { client } =
|
|
857
|
+
const { client } = require_NotificationList.useChatContext();
|
|
840
858
|
const { channel } = useChannelDetailContext();
|
|
841
|
-
const { Modal =
|
|
842
|
-
const { close } =
|
|
843
|
-
const { addNotification } =
|
|
844
|
-
const { t } =
|
|
859
|
+
const { Modal = require_NotificationList.GlobalModal } = require_NotificationList.useComponentContext();
|
|
860
|
+
const { close } = require_NotificationList.useModalContext();
|
|
861
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
862
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
845
863
|
const [alertOpen, setAlertOpen] = (0, react.useState)(false);
|
|
846
864
|
const [leaveChannelInProgress, setLeaveChannelInProgress] = (0, react.useState)(false);
|
|
847
865
|
const closeLeaveChannelAlert = (0, react.useCallback)(() => {
|
|
@@ -883,7 +901,7 @@ var LeaveChannelAction = () => {
|
|
|
883
901
|
close,
|
|
884
902
|
t
|
|
885
903
|
]);
|
|
886
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
904
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
887
905
|
destructive: true,
|
|
888
906
|
LeadingIcon: LeaveChannelActionIcon,
|
|
889
907
|
RootElement: "button",
|
|
@@ -911,10 +929,10 @@ var LeaveChannelAction = () => {
|
|
|
911
929
|
};
|
|
912
930
|
var DeleteChatAction = () => {
|
|
913
931
|
const { channel } = useChannelDetailContext();
|
|
914
|
-
const { Modal =
|
|
915
|
-
const { close: closeChannelDetail } =
|
|
916
|
-
const { addNotification } =
|
|
917
|
-
const { t } =
|
|
932
|
+
const { Modal = require_NotificationList.GlobalModal } = require_NotificationList.useComponentContext();
|
|
933
|
+
const { close: closeChannelDetail } = require_NotificationList.useModalContext();
|
|
934
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
935
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
918
936
|
const otherMember = useOtherMember();
|
|
919
937
|
const [alertOpen, setAlertOpen] = (0, react.useState)(false);
|
|
920
938
|
const [deleteChatInProgress, setDeleteChatInProgress] = (0, react.useState)(false);
|
|
@@ -956,7 +974,7 @@ var DeleteChatAction = () => {
|
|
|
956
974
|
closeChannelDetail,
|
|
957
975
|
t
|
|
958
976
|
]);
|
|
959
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
977
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
960
978
|
destructive: true,
|
|
961
979
|
LeadingIcon: DeleteChatActionIcon,
|
|
962
980
|
RootElement: "button",
|
|
@@ -1014,9 +1032,10 @@ var defaultChannelManagementActionSet = [
|
|
|
1014
1032
|
//#endregion
|
|
1015
1033
|
//#region src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
|
|
1016
1034
|
var ChannelManagementInfoBody = ({ actions }) => {
|
|
1017
|
-
const {
|
|
1035
|
+
const { IconMute, IconPin } = require_NotificationList.useComponentContextIcons();
|
|
1036
|
+
const { client } = require_NotificationList.useChatContext();
|
|
1018
1037
|
const { channel } = useChannelDetailContext();
|
|
1019
|
-
const { Avatar = require_useChannelHeaderOnlineStatus.ChannelAvatar } =
|
|
1038
|
+
const { Avatar = require_useChannelHeaderOnlineStatus.ChannelAvatar } = require_NotificationList.useComponentContext();
|
|
1020
1039
|
const { displayImage, displayTitle, groupChannelDisplayInfo } = require_useChannelHeaderOnlineStatus.useChannelPreviewInfo({ channel });
|
|
1021
1040
|
const resolvedIsDmChannel = require_useChannelHeaderOnlineStatus.isDmChannel({
|
|
1022
1041
|
channel,
|
|
@@ -1036,7 +1055,7 @@ var ChannelManagementInfoBody = ({ actions }) => {
|
|
|
1036
1055
|
const membership = require_useChannelHeaderOnlineStatus.useChannelMembershipState(channel);
|
|
1037
1056
|
const onlineStatusText = require_useChannelHeaderOnlineStatus.useChannelHeaderOnlineStatus({ channel });
|
|
1038
1057
|
const pinned = !!membership.pinned_at;
|
|
1039
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1058
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Prompt.Body, {
|
|
1040
1059
|
className: "str-chat__channel-detail__channel-management-view__body",
|
|
1041
1060
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1042
1061
|
className: "str-chat__channel-detail__channel-management-view__profile",
|
|
@@ -1052,8 +1071,8 @@ var ChannelManagementInfoBody = ({ actions }) => {
|
|
|
1052
1071
|
className: "str-chat__channel-detail__channel-management-view__profile__details__title",
|
|
1053
1072
|
children: [
|
|
1054
1073
|
displayTitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: displayTitle }),
|
|
1055
|
-
pinned && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1056
|
-
resolvedIsDmChannel && userMuted || !resolvedIsDmChannel && channelMuted ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1074
|
+
pinned && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPin, {}),
|
|
1075
|
+
resolvedIsDmChannel && userMuted || !resolvedIsDmChannel && channelMuted ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconMute, {}) : null
|
|
1057
1076
|
]
|
|
1058
1077
|
}), onlineStatusText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1059
1078
|
className: "str-chat__channel-detail__channel-management-view__profile__details__connection-status",
|
|
@@ -1087,11 +1106,11 @@ var buildChannelUpdatePayload = ({ image, name }) => {
|
|
|
1087
1106
|
* notify). The component is left to render the values this returns.
|
|
1088
1107
|
*/
|
|
1089
1108
|
var useChannelManagementEditForm = ({ uploadImage }) => {
|
|
1090
|
-
const { t } =
|
|
1091
|
-
const { client } =
|
|
1109
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1110
|
+
const { client } = require_NotificationList.useChatContext();
|
|
1092
1111
|
const { channel } = useChannelDetailContext();
|
|
1093
1112
|
const { displayImage, displayTitle, groupChannelDisplayInfo } = require_useChannelHeaderOnlineStatus.useChannelPreviewInfo({ channel });
|
|
1094
|
-
const { addNotification } =
|
|
1113
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
1095
1114
|
const resolvedIsDmChannel = require_useChannelHeaderOnlineStatus.isDmChannel({
|
|
1096
1115
|
channel,
|
|
1097
1116
|
ownUserId: client.user?.id
|
|
@@ -1203,12 +1222,13 @@ var useChannelManagementEditForm = ({ uploadImage }) => {
|
|
|
1203
1222
|
};
|
|
1204
1223
|
};
|
|
1205
1224
|
var ChannelManagementEditBody = (props) => {
|
|
1206
|
-
const {
|
|
1225
|
+
const { IconCheckmark } = require_NotificationList.useComponentContextIcons();
|
|
1226
|
+
const { Avatar = require_useChannelHeaderOnlineStatus.ChannelAvatar } = require_NotificationList.useComponentContext();
|
|
1207
1227
|
const { canSubmit, displayTitle, fileInputRef, groupChannelDisplayInfo, handleDeleteImage, handleFileChange, handleOpenFilePicker, handleSubmit, hasAvatarImage, isOnline, name, nameLabel, previewImageUrl, setName, t, trimmedName } = useChannelManagementEditForm(props);
|
|
1208
1228
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
1209
1229
|
className: "str-chat__channel-detail__channel-management-view__form",
|
|
1210
1230
|
onSubmit: handleSubmit,
|
|
1211
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1231
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Prompt.Body, {
|
|
1212
1232
|
className: "str-chat__channel-detail__channel-management-view__body",
|
|
1213
1233
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1214
1234
|
className: "str-chat__channel-detail__channel-management-view__avatar-row",
|
|
@@ -1221,7 +1241,7 @@ var ChannelManagementEditBody = (props) => {
|
|
|
1221
1241
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1222
1242
|
className: "str-chat__channel-detail__channel-management-view__avatar-row__actions",
|
|
1223
1243
|
children: [
|
|
1224
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1244
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
1225
1245
|
appearance: "outline",
|
|
1226
1246
|
onClick: handleOpenFilePicker,
|
|
1227
1247
|
size: "sm",
|
|
@@ -1229,7 +1249,7 @@ var ChannelManagementEditBody = (props) => {
|
|
|
1229
1249
|
variant: "secondary",
|
|
1230
1250
|
children: t("Upload Picture")
|
|
1231
1251
|
}),
|
|
1232
|
-
hasAvatarImage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1252
|
+
hasAvatarImage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
1233
1253
|
appearance: "outline",
|
|
1234
1254
|
onClick: handleDeleteImage,
|
|
1235
1255
|
size: "sm",
|
|
@@ -1248,7 +1268,7 @@ var ChannelManagementEditBody = (props) => {
|
|
|
1248
1268
|
})
|
|
1249
1269
|
]
|
|
1250
1270
|
})]
|
|
1251
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1271
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.TextInput, {
|
|
1252
1272
|
"aria-label": nameLabel,
|
|
1253
1273
|
autoFocus: true,
|
|
1254
1274
|
className: "str-chat__channel-detail__channel-management-view__name-input",
|
|
@@ -1257,21 +1277,21 @@ var ChannelManagementEditBody = (props) => {
|
|
|
1257
1277
|
placeholder: nameLabel,
|
|
1258
1278
|
value: name
|
|
1259
1279
|
})]
|
|
1260
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1280
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.Footer, {
|
|
1261
1281
|
className: "str-chat__channel-detail__channel-management-view__footer",
|
|
1262
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1282
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.FooterControls, { children: canSubmit && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Prompt.FooterControlsButtonPrimary, {
|
|
1263
1283
|
className: "str-chat__channel-detail__channel-management-view__footer__save-button",
|
|
1264
1284
|
type: "submit",
|
|
1265
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1285
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckmark, {}), t("Save")]
|
|
1266
1286
|
}) })
|
|
1267
1287
|
})]
|
|
1268
1288
|
});
|
|
1269
1289
|
};
|
|
1270
1290
|
var ChannelManagementView = ({ channelManagementActionSet = defaultChannelManagementActionSet, EditModeComponent = ChannelManagementEditBody, uploadImage, ViewModeComponent = ChannelManagementInfoBody }) => {
|
|
1271
|
-
const { t } =
|
|
1272
|
-
const { client } =
|
|
1291
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1292
|
+
const { client } = require_NotificationList.useChatContext();
|
|
1273
1293
|
const { channel } = useChannelDetailContext();
|
|
1274
|
-
const { close } =
|
|
1294
|
+
const { close } = require_NotificationList.useModalContext();
|
|
1275
1295
|
const resolvedIsDmChannel = require_useChannelHeaderOnlineStatus.isDmChannel({
|
|
1276
1296
|
channel,
|
|
1277
1297
|
ownUserId: client.user?.id
|
|
@@ -1284,7 +1304,7 @@ var ChannelManagementView = ({ channelManagementActionSet = defaultChannelManage
|
|
|
1284
1304
|
setIsEditing(false);
|
|
1285
1305
|
}, [channel.cid]);
|
|
1286
1306
|
const EditChannelButton = (0, react.useMemo)(() => function EditChannelButton() {
|
|
1287
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1307
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
1288
1308
|
appearance: "outline",
|
|
1289
1309
|
"aria-label": t("Edit chat data"),
|
|
1290
1310
|
className: "str-chat__channel-detail__channel-management-view__edit-button",
|
|
@@ -1311,10 +1331,11 @@ var ChannelManagementView = ({ channelManagementActionSet = defaultChannelManage
|
|
|
1311
1331
|
//#endregion
|
|
1312
1332
|
//#region src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.tsx
|
|
1313
1333
|
var ChannelMediaEmptyList = () => {
|
|
1314
|
-
const {
|
|
1334
|
+
const { IconImage } = require_NotificationList.useComponentContextIcons();
|
|
1335
|
+
const { t } = require_NotificationList.useTranslationContext("ChannelMediaEmptyList");
|
|
1315
1336
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1316
1337
|
className: "str-chat__channel-detail__media-view__empty-state",
|
|
1317
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1338
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconImage, { className: "str-chat__channel-detail__media-view__empty-state__icon" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1318
1339
|
className: "str-chat__channel-detail__media-view__empty-state__content",
|
|
1319
1340
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1320
1341
|
className: "str-chat__channel-detail__media-view__empty-state__title",
|
|
@@ -1351,7 +1372,7 @@ var toChannelMediaItems = (messages) => {
|
|
|
1351
1372
|
message.attachments?.forEach((attachment, index) => {
|
|
1352
1373
|
const type = getMediaAttachmentType(attachment);
|
|
1353
1374
|
if (!type) return;
|
|
1354
|
-
const descriptor =
|
|
1375
|
+
const descriptor = require_NotificationList.toBaseImageDescriptors(attachment);
|
|
1355
1376
|
if (!descriptor) return;
|
|
1356
1377
|
if (!(type === "video" ? Boolean(descriptor.videoThumbnailUrl || descriptor.videoUrl) : Boolean(descriptor.imageUrl))) return;
|
|
1357
1378
|
items.push({
|
|
@@ -1374,7 +1395,7 @@ var channelMediaSearchSourceItemsStateSelector = (state) => ({
|
|
|
1374
1395
|
messages: state.items
|
|
1375
1396
|
});
|
|
1376
1397
|
var useChannelMediaSearch = () => {
|
|
1377
|
-
const { client } =
|
|
1398
|
+
const { client } = require_NotificationList.useChatContext();
|
|
1378
1399
|
const { channel } = useChannelDetailContext();
|
|
1379
1400
|
const channelMediaSearchSource = (0, react.useMemo)(() => {
|
|
1380
1401
|
const source = new stream_chat.MessageSearchSource(client, {
|
|
@@ -1386,7 +1407,7 @@ var useChannelMediaSearch = () => {
|
|
|
1386
1407
|
source.messageSearchFilters = { "attachments.type": { $in: [...MEDIA_ATTACHMENT_TYPES] } };
|
|
1387
1408
|
return source;
|
|
1388
1409
|
}, [channel.cid, client]);
|
|
1389
|
-
const { hasNext, isLoading, messages } =
|
|
1410
|
+
const { hasNext, isLoading, messages } = require_NotificationList.useStateStore(channelMediaSearchSource.state, channelMediaSearchSourceItemsStateSelector);
|
|
1390
1411
|
const mediaItems = (0, react.useMemo)(() => toChannelMediaItems(messages ?? []), [messages]);
|
|
1391
1412
|
(0, react.useEffect)(() => {
|
|
1392
1413
|
channelMediaSearchSource.activate();
|
|
@@ -1407,10 +1428,12 @@ var useChannelMediaSearch = () => {
|
|
|
1407
1428
|
//#region src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.tsx
|
|
1408
1429
|
var DEFAULT_CHANNEL_MEDIA_ITEMS_PER_PAGE = 30;
|
|
1409
1430
|
var ChannelMediaGridItem = ({ BaseImage, item, onClick }) => {
|
|
1410
|
-
const { t } =
|
|
1431
|
+
const { t } = require_NotificationList.useTranslationContext("ChannelMediaView");
|
|
1432
|
+
const { Avatar: Avatar$4 = require_NotificationList.Avatar, extractDisplayInfo: extractDisplayInfo$4 = require_NotificationList.extractDisplayInfo } = require_NotificationList.useComponentContext();
|
|
1433
|
+
const { IconImage, IconVideoFill } = require_NotificationList.useComponentContextIcons();
|
|
1411
1434
|
const displayName = getUserDisplayName(item.user);
|
|
1412
1435
|
const mediaSrc = item.type === "video" ? item.galleryItem.videoThumbnailUrl : item.galleryItem.imageUrl;
|
|
1413
|
-
const durationLabel =
|
|
1436
|
+
const durationLabel = require_NotificationList.formatTime(item.durationSeconds, "floor");
|
|
1414
1437
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1415
1438
|
"aria-label": item.type === "video" ? t("aria/Open video shared by {{ name }}", { name: displayName }) : t("aria/Open image shared by {{ name }}", { name: displayName }),
|
|
1416
1439
|
className: "str-chat__channel-detail__media-view__item",
|
|
@@ -1424,29 +1447,29 @@ var ChannelMediaGridItem = ({ BaseImage, item, onClick }) => {
|
|
|
1424
1447
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1425
1448
|
"aria-hidden": "true",
|
|
1426
1449
|
className: "str-chat__channel-detail__media-view__item__placeholder",
|
|
1427
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1450
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconImage, {})
|
|
1428
1451
|
}),
|
|
1429
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1452
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Avatar$4, {
|
|
1453
|
+
...extractDisplayInfo$4({ user: item.user }),
|
|
1430
1454
|
"aria-hidden": "true",
|
|
1431
1455
|
className: "str-chat__channel-detail__media-view__item__avatar",
|
|
1432
|
-
|
|
1433
|
-
size: "sm",
|
|
1434
|
-
userName: displayName
|
|
1456
|
+
size: "sm"
|
|
1435
1457
|
}),
|
|
1436
1458
|
item.type === "video" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_useChannelHeaderOnlineStatus.Badge, {
|
|
1437
1459
|
className: "str-chat__channel-detail__media-view__item__duration",
|
|
1438
1460
|
size: "sm",
|
|
1439
1461
|
variant: "inverse",
|
|
1440
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1462
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconVideoFill, { className: "str-chat__channel-detail__media-view__item__duration-icon" }), durationLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: durationLabel }) : null]
|
|
1441
1463
|
})
|
|
1442
1464
|
]
|
|
1443
1465
|
});
|
|
1444
1466
|
};
|
|
1445
1467
|
var ChannelMediaPagination = ({ nextDisabled, onNext, onPrevious, previousDisabled }) => {
|
|
1446
|
-
const { t } =
|
|
1468
|
+
const { t } = require_NotificationList.useTranslationContext("ChannelMediaView");
|
|
1469
|
+
const { IconChevronLeft, IconChevronRight } = require_NotificationList.useComponentContextIcons();
|
|
1447
1470
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1448
1471
|
className: "str-chat__channel-detail__media-view__pagination",
|
|
1449
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1472
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Button, {
|
|
1450
1473
|
appearance: "outline",
|
|
1451
1474
|
"aria-label": t("aria/Previous page"),
|
|
1452
1475
|
className: "str-chat__channel-detail__media-view__pagination__button str-chat__channel-detail__media-view__pagination__button--previous",
|
|
@@ -1454,8 +1477,8 @@ var ChannelMediaPagination = ({ nextDisabled, onNext, onPrevious, previousDisabl
|
|
|
1454
1477
|
onClick: onPrevious,
|
|
1455
1478
|
size: "md",
|
|
1456
1479
|
variant: "secondary",
|
|
1457
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1458
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1480
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronLeft, {}), t("Previous")]
|
|
1481
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Button, {
|
|
1459
1482
|
appearance: "outline",
|
|
1460
1483
|
"aria-label": t("aria/Next page"),
|
|
1461
1484
|
className: "str-chat__channel-detail__media-view__pagination__button str-chat__channel-detail__media-view__pagination__button--next",
|
|
@@ -1463,14 +1486,14 @@ var ChannelMediaPagination = ({ nextDisabled, onNext, onPrevious, previousDisabl
|
|
|
1463
1486
|
onClick: onNext,
|
|
1464
1487
|
size: "md",
|
|
1465
1488
|
variant: "secondary",
|
|
1466
|
-
children: [t("Next"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1489
|
+
children: [t("Next"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronRight, {})]
|
|
1467
1490
|
})]
|
|
1468
1491
|
});
|
|
1469
1492
|
};
|
|
1470
1493
|
var ChannelMediaView = ({ itemsPerPage = DEFAULT_CHANNEL_MEDIA_ITEMS_PER_PAGE }) => {
|
|
1471
|
-
const { t } =
|
|
1472
|
-
const { close } =
|
|
1473
|
-
const { BaseImage: BaseImage$1 =
|
|
1494
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1495
|
+
const { close } = require_NotificationList.useModalContext();
|
|
1496
|
+
const { BaseImage: BaseImage$1 = require_NotificationList.BaseImage, Gallery: Gallery$1 = require_NotificationList.Gallery, Modal = require_NotificationList.GlobalModal } = require_NotificationList.useComponentContext();
|
|
1474
1497
|
const { channelMediaSearchSource, hasNext, hasResultsLoaded, isLoading, mediaItems } = useChannelMediaSearch();
|
|
1475
1498
|
const [viewerOpen, setViewerOpen] = (0, react.useState)(false);
|
|
1476
1499
|
const [selectedIndex, setSelectedIndex] = (0, react.useState)(0);
|
|
@@ -1550,7 +1573,7 @@ var ChannelMediaView = ({ itemsPerPage = DEFAULT_CHANNEL_MEDIA_ITEMS_PER_PAGE })
|
|
|
1550
1573
|
close,
|
|
1551
1574
|
title: t("Photos & videos")
|
|
1552
1575
|
}),
|
|
1553
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1576
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.Body, {
|
|
1554
1577
|
className: "str-chat__channel-detail__media-view__body",
|
|
1555
1578
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1556
1579
|
className: "str-chat__channel-detail__media-view__grid",
|
|
@@ -1582,7 +1605,7 @@ var ChannelMediaView = ({ itemsPerPage = DEFAULT_CHANNEL_MEDIA_ITEMS_PER_PAGE })
|
|
|
1582
1605
|
onClose: closeViewer,
|
|
1583
1606
|
open: viewerOpen,
|
|
1584
1607
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Gallery$1, {
|
|
1585
|
-
GalleryUI:
|
|
1608
|
+
GalleryUI: require_NotificationList.GalleryUI,
|
|
1586
1609
|
initialIndex: selectedIndex,
|
|
1587
1610
|
items: galleryItems,
|
|
1588
1611
|
onRequestClose: closeViewer
|
|
@@ -1612,9 +1635,9 @@ var useBaseChannelMembersHeaderActionSetFilter = (channelMembersHeaderActionSet)
|
|
|
1612
1635
|
]);
|
|
1613
1636
|
};
|
|
1614
1637
|
var AddMembersHeaderAction = ({ modeController }) => {
|
|
1615
|
-
const { t } =
|
|
1638
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1616
1639
|
if (modeController.mode !== "browse") return null;
|
|
1617
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1640
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
1618
1641
|
appearance: "outline",
|
|
1619
1642
|
"aria-label": t("Add channel members"),
|
|
1620
1643
|
className: "str-chat__channel-detail__channel-members-view__add-button",
|
|
@@ -1625,11 +1648,12 @@ var AddMembersHeaderAction = ({ modeController }) => {
|
|
|
1625
1648
|
});
|
|
1626
1649
|
};
|
|
1627
1650
|
var AddMembersMenuAction = ({ closeMenu, modeController }) => {
|
|
1628
|
-
const { t } =
|
|
1651
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1652
|
+
const { IconUserAdd } = require_NotificationList.useComponentContextIcons();
|
|
1629
1653
|
if (modeController.mode !== "browse") return null;
|
|
1630
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1654
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ContextMenuButton, {
|
|
1631
1655
|
"aria-label": t("Add channel members"),
|
|
1632
|
-
Icon:
|
|
1656
|
+
Icon: IconUserAdd,
|
|
1633
1657
|
onClick: () => {
|
|
1634
1658
|
modeController.setMode("add");
|
|
1635
1659
|
closeMenu?.();
|
|
@@ -1647,8 +1671,8 @@ var defaultChannelMembersHeaderActionSet = [{
|
|
|
1647
1671
|
type: "addMembers"
|
|
1648
1672
|
}];
|
|
1649
1673
|
var DefaultHeaderActionsMenuTrigger = ({ referenceRef, ...props }) => {
|
|
1650
|
-
const { t } =
|
|
1651
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1674
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1675
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
1652
1676
|
appearance: "outline",
|
|
1653
1677
|
"aria-label": t("Open members actions"),
|
|
1654
1678
|
className: "str-chat__channel-detail__channel-members-view__actions-button",
|
|
@@ -1661,14 +1685,14 @@ var DefaultHeaderActionsMenuTrigger = ({ referenceRef, ...props }) => {
|
|
|
1661
1685
|
};
|
|
1662
1686
|
var getHeaderActionsDialogId = (channelId) => `channel-members-header-actions-${channelId ?? "unknown"}`;
|
|
1663
1687
|
var DefaultHeaderActions = ({ headerActionSet, HeaderActionsMenuTrigger = DefaultHeaderActionsMenuTrigger, modeController }) => {
|
|
1664
|
-
const { ContextMenu: ContextMenuComponent =
|
|
1688
|
+
const { ContextMenu: ContextMenuComponent = require_NotificationList.ContextMenu } = require_NotificationList.useComponentContext();
|
|
1665
1689
|
const { channel } = useChannelDetailContext();
|
|
1666
1690
|
const actions = useBaseChannelMembersHeaderActionSetFilter(headerActionSet);
|
|
1667
1691
|
const [referenceElement, setReferenceElement] = (0, react.useState)(null);
|
|
1668
1692
|
const dialogId = getHeaderActionsDialogId(channel.id);
|
|
1669
|
-
const { dialog, dialogManager } =
|
|
1693
|
+
const { dialog, dialogManager } = require_NotificationList.useDialogOnNearestManager({ id: dialogId });
|
|
1670
1694
|
const dialogManagerId = dialogManager?.id;
|
|
1671
|
-
const dialogIsOpen =
|
|
1695
|
+
const dialogIsOpen = require_NotificationList.useDialogIsOpen(dialogId, dialogManagerId);
|
|
1672
1696
|
if (!actions.length) return null;
|
|
1673
1697
|
const quickActions = actions.filter((action) => action.placement === "quick");
|
|
1674
1698
|
const menuActions = actions.filter((action) => action.placement === "menu");
|
|
@@ -1753,7 +1777,8 @@ var useChannelMemberIds = (channel) => {
|
|
|
1753
1777
|
//#endregion
|
|
1754
1778
|
//#region src/plugins/ChannelDetail/ChannelDetailSearchInput.tsx
|
|
1755
1779
|
var ChannelDetailSearchInput = react.default.memo(({ autoFocus, onSearchChange, resetKey }) => {
|
|
1756
|
-
const {
|
|
1780
|
+
const { IconSearch } = require_NotificationList.useComponentContextIcons();
|
|
1781
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1757
1782
|
const [searchInput, setSearchInput] = (0, react.useState)("");
|
|
1758
1783
|
(0, react.useEffect)(() => {
|
|
1759
1784
|
setSearchInput("");
|
|
@@ -1763,12 +1788,12 @@ var ChannelDetailSearchInput = react.default.memo(({ autoFocus, onSearchChange,
|
|
|
1763
1788
|
setSearchInput(value);
|
|
1764
1789
|
onSearchChange(value);
|
|
1765
1790
|
}, [onSearchChange]);
|
|
1766
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1791
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.TextInput, {
|
|
1767
1792
|
"aria-label": t("Search"),
|
|
1768
1793
|
autoComplete: "off",
|
|
1769
1794
|
autoFocus,
|
|
1770
1795
|
className: "str-chat__channel-detail__search-input",
|
|
1771
|
-
leading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1796
|
+
leading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSearch, {}),
|
|
1772
1797
|
onChange: handleSearchChange,
|
|
1773
1798
|
placeholder: t("Search"),
|
|
1774
1799
|
type: "search",
|
|
@@ -1778,10 +1803,13 @@ var ChannelDetailSearchInput = react.default.memo(({ autoFocus, onSearchChange,
|
|
|
1778
1803
|
ChannelDetailSearchInput.displayName = "ChannelDetailSearchInput";
|
|
1779
1804
|
//#endregion
|
|
1780
1805
|
//#region src/plugins/ChannelDetail/ChannelDetailEmptyList.tsx
|
|
1781
|
-
var ChannelDetailEmptyList = ({ children }) =>
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1806
|
+
var ChannelDetailEmptyList = ({ children }) => {
|
|
1807
|
+
const { IconSearch } = require_NotificationList.useComponentContextIcons();
|
|
1808
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1809
|
+
className: "str-chat__channel-detail__channel-members-view__empty-state",
|
|
1810
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSearch, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children })]
|
|
1811
|
+
});
|
|
1812
|
+
};
|
|
1785
1813
|
//#endregion
|
|
1786
1814
|
//#region src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.tsx
|
|
1787
1815
|
var USER_SEARCH_PAGE_SIZE = 30;
|
|
@@ -1791,22 +1819,25 @@ var searchSourceItemsStateSelector = (state) => ({
|
|
|
1791
1819
|
});
|
|
1792
1820
|
var EMPTY_USERS = [];
|
|
1793
1821
|
var computeUserItemKey = (_, user) => user.id;
|
|
1794
|
-
var MuteIndicator = () =>
|
|
1822
|
+
var MuteIndicator = () => {
|
|
1823
|
+
const { IconMute } = require_NotificationList.useComponentContextIcons();
|
|
1824
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconMute, { className: "str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--mute" });
|
|
1825
|
+
};
|
|
1795
1826
|
var readOnlyRootProps = { className: "str-chat__channel-detail__channel-members-view__list-item" };
|
|
1796
1827
|
var ChannelMembersAddViewItem = ({ canManageChannelMembers, isMember, isMuted, isSelected, toggleSelectedUser, user }) => {
|
|
1797
|
-
const { t } =
|
|
1828
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1829
|
+
const { Avatar: Avatar$3 = require_NotificationList.Avatar, extractDisplayInfo: extractDisplayInfo$3 = require_NotificationList.extractDisplayInfo } = require_NotificationList.useComponentContext();
|
|
1798
1830
|
const displayName = getUserDisplayName(user);
|
|
1799
1831
|
const LeadingSlot = (0, react.useMemo)(() => function MemberAvatar() {
|
|
1800
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1801
|
-
|
|
1832
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Avatar$3, {
|
|
1833
|
+
...extractDisplayInfo$3({ user }),
|
|
1802
1834
|
isOnline: user.online,
|
|
1803
|
-
size: "md"
|
|
1804
|
-
userName: displayName
|
|
1835
|
+
size: "md"
|
|
1805
1836
|
});
|
|
1806
1837
|
}, [
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
user
|
|
1838
|
+
Avatar$3,
|
|
1839
|
+
extractDisplayInfo$3,
|
|
1840
|
+
user
|
|
1810
1841
|
]);
|
|
1811
1842
|
const SelectableTrailingSlot = (0, react.useMemo)(() => function SelectCheckbox() {
|
|
1812
1843
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useChannelHeaderOnlineStatus.Checkbox, {
|
|
@@ -1823,14 +1854,14 @@ var ChannelMembersAddViewItem = ({ canManageChannelMembers, isMember, isMuted, i
|
|
|
1823
1854
|
toggleSelectedUser,
|
|
1824
1855
|
user.id
|
|
1825
1856
|
]);
|
|
1826
|
-
if (canManageChannelMembers && !isMember) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1857
|
+
if (canManageChannelMembers && !isMember) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
1827
1858
|
LeadingSlot,
|
|
1828
1859
|
RootElement: "button",
|
|
1829
1860
|
rootProps: selectableRootProps,
|
|
1830
1861
|
title: displayName,
|
|
1831
1862
|
TrailingSlot: SelectableTrailingSlot
|
|
1832
1863
|
});
|
|
1833
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1864
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
1834
1865
|
LeadingSlot,
|
|
1835
1866
|
rootProps: readOnlyRootProps,
|
|
1836
1867
|
subtitle: isMember ? t("Already a member") : void 0,
|
|
@@ -1839,11 +1870,11 @@ var ChannelMembersAddViewItem = ({ canManageChannelMembers, isMember, isMuted, i
|
|
|
1839
1870
|
});
|
|
1840
1871
|
};
|
|
1841
1872
|
var ChannelMembersAddView = ({ modeController, searchSource }) => {
|
|
1842
|
-
const { client, mutes } =
|
|
1843
|
-
const { t } =
|
|
1873
|
+
const { client, mutes } = require_NotificationList.useChatContext();
|
|
1874
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
1844
1875
|
const { channel } = useChannelDetailContext();
|
|
1845
1876
|
const canManageChannelMembers = canUpdateChannelMembers(channel);
|
|
1846
|
-
const { addNotification } =
|
|
1877
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
1847
1878
|
const memberUserIds = useChannelMemberIds(channel);
|
|
1848
1879
|
const memberIdSet = (0, react.useMemo)(() => new Set(memberUserIds), [memberUserIds]);
|
|
1849
1880
|
const userSearchSource = (0, react.useMemo)(() => searchSource ?? new stream_chat.UserSearchSource(client, {
|
|
@@ -1851,7 +1882,7 @@ var ChannelMembersAddView = ({ modeController, searchSource }) => {
|
|
|
1851
1882
|
pageSize: USER_SEARCH_PAGE_SIZE,
|
|
1852
1883
|
resetOnNewSearchQuery: false
|
|
1853
1884
|
}), [client, searchSource]);
|
|
1854
|
-
const { isLoading, users } =
|
|
1885
|
+
const { isLoading, users } = require_NotificationList.useStateStore(userSearchSource.state, searchSourceItemsStateSelector);
|
|
1855
1886
|
const [isSaving, setIsSaving] = (0, react.useState)(false);
|
|
1856
1887
|
const [selectedUserIds, setSelectedUserIds] = (0, react.useState)([]);
|
|
1857
1888
|
(0, react.useEffect)(() => {
|
|
@@ -1917,7 +1948,7 @@ var ChannelMembersAddView = ({ modeController, searchSource }) => {
|
|
|
1917
1948
|
});
|
|
1918
1949
|
}
|
|
1919
1950
|
};
|
|
1920
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1951
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Prompt.Body, {
|
|
1921
1952
|
className: "str-chat__channel-members-view__body",
|
|
1922
1953
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelDetailSearchInput, {
|
|
1923
1954
|
autoFocus: true,
|
|
@@ -1931,7 +1962,7 @@ var ChannelMembersAddView = ({ modeController, searchSource }) => {
|
|
|
1931
1962
|
itemContent: renderItem,
|
|
1932
1963
|
loadNext: userSearchSource.search
|
|
1933
1964
|
})]
|
|
1934
|
-
}), canManageChannelMembers && selectedUserIds.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1965
|
+
}), canManageChannelMembers && selectedUserIds.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.Footer, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.FooterControls, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.FooterControlsButtonPrimary, {
|
|
1935
1966
|
disabled: isSaving,
|
|
1936
1967
|
onClick: handleSave,
|
|
1937
1968
|
children: t("Add {{ count }} members", { count: selectedUserIds.length })
|
|
@@ -1970,7 +2001,7 @@ var useChannelMembersSearch = () => {
|
|
|
1970
2001
|
pageSize: 100,
|
|
1971
2002
|
resetOnNewSearchQuery: false
|
|
1972
2003
|
}), [channel]);
|
|
1973
|
-
const { members } =
|
|
2004
|
+
const { members } = require_NotificationList.useStateStore(membersSearchSource.state, membersSearchSourceItemsStateSelector);
|
|
1974
2005
|
const [searchInputResetKey, setSearchInputResetKey] = (0, react.useState)(0);
|
|
1975
2006
|
const resetMembersSearch = (0, react.useCallback)(() => {
|
|
1976
2007
|
membersSearchSource.cancelScheduledQuery();
|
|
@@ -2012,28 +2043,33 @@ var getPresenceStatusText$1 = (user, t) => {
|
|
|
2012
2043
|
return t("Offline");
|
|
2013
2044
|
};
|
|
2014
2045
|
var ChannelMembersBrowseViewItem = ({ isMuted, member, onMemberSelect }) => {
|
|
2015
|
-
const { t } =
|
|
2046
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2047
|
+
const { Avatar: Avatar$2 = require_NotificationList.Avatar, extractDisplayInfo: extractDisplayInfo$2 = require_NotificationList.extractDisplayInfo } = require_NotificationList.useComponentContext();
|
|
2016
2048
|
const user = member.user;
|
|
2017
2049
|
const displayName = getMemberDisplayName(member);
|
|
2018
2050
|
const roleTranslation = getMemberRoleTranslation(member, t);
|
|
2019
2051
|
const LeadingSlot = (0, react.useMemo)(() => function MemberAvatar() {
|
|
2020
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2021
|
-
|
|
2052
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Avatar$2, {
|
|
2053
|
+
...extractDisplayInfo$2({ user: user ?? void 0 }),
|
|
2022
2054
|
isOnline: user?.online,
|
|
2023
|
-
size: "md"
|
|
2024
|
-
userName: getUserDisplayName(user)
|
|
2055
|
+
size: "md"
|
|
2025
2056
|
});
|
|
2026
|
-
}, [
|
|
2057
|
+
}, [
|
|
2058
|
+
Avatar$2,
|
|
2059
|
+
extractDisplayInfo$2,
|
|
2060
|
+
user
|
|
2061
|
+
]);
|
|
2027
2062
|
const TrailingSlot = (0, react.useMemo)(() => function MemberTrailingSlot() {
|
|
2063
|
+
const { IconMute } = require_NotificationList.useComponentContextIcons();
|
|
2028
2064
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2029
2065
|
className: "str-chat__channel-detail__channel-members-view__list-item__trailing-slot",
|
|
2030
2066
|
children: [roleTranslation ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2031
2067
|
className: "str-chat__channel-detail__channel-members-view__role-label",
|
|
2032
2068
|
children: roleTranslation
|
|
2033
|
-
}) : null, isMuted ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2069
|
+
}) : null, isMuted ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconMute, { className: "str-chat__channel-detail__channel-members-view__list-item__indicator-icon str-chat__channel-detail__channel-members-view__list-item__indicator-icon--mute" }) : null]
|
|
2034
2070
|
});
|
|
2035
2071
|
}, [isMuted, roleTranslation]);
|
|
2036
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2072
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
2037
2073
|
LeadingSlot,
|
|
2038
2074
|
RootElement: "button",
|
|
2039
2075
|
rootProps: (0, react.useMemo)(() => ({
|
|
@@ -2053,8 +2089,8 @@ var ChannelMembersBrowseViewItem = ({ isMuted, member, onMemberSelect }) => {
|
|
|
2053
2089
|
};
|
|
2054
2090
|
var computeMemberItemKey = (_, member) => getMemberUserId(member);
|
|
2055
2091
|
var ChannelMembersBrowseView = ({ onMemberSelect }) => {
|
|
2056
|
-
const { mutes } =
|
|
2057
|
-
const { t } =
|
|
2092
|
+
const { mutes } = require_NotificationList.useChatContext();
|
|
2093
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2058
2094
|
const { displayedMembers, handleSearchChange, hasMembers, membersSearchSource, searchInputResetKey } = useChannelMembersSearch();
|
|
2059
2095
|
const mutedUserIdSet = (0, react.useMemo)(() => new Set(mutes.map((mute) => mute.target.id)), [mutes]);
|
|
2060
2096
|
const renderableMembers = (0, react.useMemo)(() => displayedMembers.filter((member) => getMemberUserId(member)), [displayedMembers]);
|
|
@@ -2069,7 +2105,7 @@ var ChannelMembersBrowseView = ({ onMemberSelect }) => {
|
|
|
2069
2105
|
const Footer = (0, react.useMemo)(() => function ChannelMembersListFooter() {
|
|
2070
2106
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelDetailListLoadingIndicator, { searchSource: membersSearchSource });
|
|
2071
2107
|
}, [membersSearchSource]);
|
|
2072
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
2108
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Prompt.Body, {
|
|
2073
2109
|
className: "str-chat__channel-members-view__body",
|
|
2074
2110
|
children: [hasMembers && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelDetailSearchInput, {
|
|
2075
2111
|
onSearchChange: handleSearchChange,
|
|
@@ -2098,11 +2134,26 @@ var useChannelMemberActionContext = () => {
|
|
|
2098
2134
|
return contextValue;
|
|
2099
2135
|
};
|
|
2100
2136
|
var toError = (error) => error instanceof Error ? error : /* @__PURE__ */ new Error("An unknown error occurred");
|
|
2101
|
-
var MemberMuteActionIcon = () =>
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
var
|
|
2137
|
+
var MemberMuteActionIcon = () => {
|
|
2138
|
+
const { IconMute } = require_NotificationList.useComponentContextIcons();
|
|
2139
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconMute, { className: "str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--mute" });
|
|
2140
|
+
};
|
|
2141
|
+
var MemberUnmuteActionIcon = () => {
|
|
2142
|
+
const { IconAudio } = require_NotificationList.useComponentContextIcons();
|
|
2143
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconAudio, { className: "str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--unmute" });
|
|
2144
|
+
};
|
|
2145
|
+
var SendDirectMessageActionIcon = () => {
|
|
2146
|
+
const { IconMessageBubble } = require_NotificationList.useComponentContextIcons();
|
|
2147
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconMessageBubble, { className: "str-chat__channel-detail__action-icon" });
|
|
2148
|
+
};
|
|
2149
|
+
var BlockUserActionIcon = () => {
|
|
2150
|
+
const { IconNoSign } = require_NotificationList.useComponentContextIcons();
|
|
2151
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNoSign, { className: "str-chat__icon--destructive str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--block-user" });
|
|
2152
|
+
};
|
|
2153
|
+
var RemoveUserActionIcon = () => {
|
|
2154
|
+
const { IconUserRemove } = require_NotificationList.useComponentContextIcons();
|
|
2155
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUserRemove, { className: "str-chat__icon--destructive str-chat__channel-detail__action-icon str-chat__channel-detail__action-icon--remove-user" });
|
|
2156
|
+
};
|
|
2106
2157
|
var channelMemberDetailActionClassName = "str-chat__channel-member-detail-action";
|
|
2107
2158
|
var blockedUsersSelector = ({ userIds }) => ({ userIds });
|
|
2108
2159
|
var ChannelMemberConfirmationAlert = ({ action, cancelLabel, confirmLabel, description, isSubmitting, onCancel, onConfirm, testId, title }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_useChannelHeaderOnlineStatus.Alert.Root, {
|
|
@@ -2111,7 +2162,7 @@ var ChannelMemberConfirmationAlert = ({ action, cancelLabel, confirmLabel, descr
|
|
|
2111
2162
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useChannelHeaderOnlineStatus.Alert.Header, {
|
|
2112
2163
|
description,
|
|
2113
2164
|
title
|
|
2114
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_useChannelHeaderOnlineStatus.Alert.Actions, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2165
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_useChannelHeaderOnlineStatus.Alert.Actions, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
2115
2166
|
appearance: "solid",
|
|
2116
2167
|
"data-testid": `${testId}-confirm-button`,
|
|
2117
2168
|
disabled: isSubmitting,
|
|
@@ -2119,7 +2170,7 @@ var ChannelMemberConfirmationAlert = ({ action, cancelLabel, confirmLabel, descr
|
|
|
2119
2170
|
size: "md",
|
|
2120
2171
|
variant: "danger",
|
|
2121
2172
|
children: confirmLabel
|
|
2122
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2173
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Button, {
|
|
2123
2174
|
appearance: "outline",
|
|
2124
2175
|
autoFocus: true,
|
|
2125
2176
|
"data-testid": `${testId}-cancel-button`,
|
|
@@ -2131,7 +2182,7 @@ var ChannelMemberConfirmationAlert = ({ action, cancelLabel, confirmLabel, descr
|
|
|
2131
2182
|
})] })]
|
|
2132
2183
|
});
|
|
2133
2184
|
var useChannelMemberActionFilterState = () => {
|
|
2134
|
-
const { client } =
|
|
2185
|
+
const { client } = require_NotificationList.useChatContext();
|
|
2135
2186
|
const { channel } = useChannelDetailContext();
|
|
2136
2187
|
const { targetUserId } = useChannelMemberActionContext();
|
|
2137
2188
|
const ownCapabilities = channel.data?.own_capabilities;
|
|
@@ -2162,12 +2213,12 @@ var useBaseChannelMemberActionSetFilter = (channelMemberActionSet) => {
|
|
|
2162
2213
|
]);
|
|
2163
2214
|
};
|
|
2164
2215
|
var SendDirectMessageAction = () => {
|
|
2165
|
-
const { client, setActiveChannel } =
|
|
2166
|
-
const { setChannels } =
|
|
2167
|
-
const { close } =
|
|
2216
|
+
const { client, setActiveChannel } = require_NotificationList.useChatContext();
|
|
2217
|
+
const { setChannels } = require_NotificationList.useChannelListContext();
|
|
2218
|
+
const { close } = require_NotificationList.useModalContext();
|
|
2168
2219
|
const { channel } = useChannelDetailContext();
|
|
2169
|
-
const { addNotification } =
|
|
2170
|
-
const { t } =
|
|
2220
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
2221
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2171
2222
|
const { targetUserId } = useChannelMemberActionContext();
|
|
2172
2223
|
const [isSending, setIsSending] = (0, react.useState)(false);
|
|
2173
2224
|
const openDirectMessage = (0, react.useCallback)(async () => {
|
|
@@ -2202,7 +2253,7 @@ var SendDirectMessageAction = () => {
|
|
|
2202
2253
|
t,
|
|
2203
2254
|
targetUserId
|
|
2204
2255
|
]);
|
|
2205
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2256
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
2206
2257
|
LeadingIcon: SendDirectMessageActionIcon,
|
|
2207
2258
|
RootElement: "button",
|
|
2208
2259
|
rootProps: (0, react.useMemo)(() => ({
|
|
@@ -2215,9 +2266,9 @@ var SendDirectMessageAction = () => {
|
|
|
2215
2266
|
};
|
|
2216
2267
|
var UserMuteAction = () => {
|
|
2217
2268
|
const { channel } = useChannelDetailContext();
|
|
2218
|
-
const { client, mutes } =
|
|
2219
|
-
const { addNotification } =
|
|
2220
|
-
const { t } =
|
|
2269
|
+
const { client, mutes } = require_NotificationList.useChatContext();
|
|
2270
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
2271
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2221
2272
|
const { targetUserId } = useChannelMemberActionContext();
|
|
2222
2273
|
const userMuted = !!targetUserId && mutes.some((mute) => mute.target.id === targetUserId);
|
|
2223
2274
|
const [optimisticUserMuted, setOptimisticUserMuted] = (0, react.useState)(userMuted);
|
|
@@ -2281,14 +2332,14 @@ var UserMuteAction = () => {
|
|
|
2281
2332
|
}), [optimisticUserMuted, toggleOptimisticUserMute]);
|
|
2282
2333
|
const TrailingSlot = (0, react.useMemo)(() => {
|
|
2283
2334
|
function UserMuteSwitch() {
|
|
2284
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2335
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Switch, {
|
|
2285
2336
|
on: optimisticUserMuted,
|
|
2286
2337
|
presentation: true
|
|
2287
2338
|
});
|
|
2288
2339
|
}
|
|
2289
2340
|
return UserMuteSwitch;
|
|
2290
2341
|
}, [optimisticUserMuted]);
|
|
2291
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2342
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
2292
2343
|
LeadingIcon: optimisticUserMuted ? MemberUnmuteActionIcon : MemberMuteActionIcon,
|
|
2293
2344
|
RootElement: "button",
|
|
2294
2345
|
rootProps,
|
|
@@ -2297,13 +2348,13 @@ var UserMuteAction = () => {
|
|
|
2297
2348
|
});
|
|
2298
2349
|
};
|
|
2299
2350
|
var BlockUserAction = () => {
|
|
2300
|
-
const { client } =
|
|
2301
|
-
const { Modal =
|
|
2351
|
+
const { client } = require_NotificationList.useChatContext();
|
|
2352
|
+
const { Modal = require_NotificationList.GlobalModal } = require_NotificationList.useComponentContext();
|
|
2302
2353
|
const { channel } = useChannelDetailContext();
|
|
2303
|
-
const { addNotification } =
|
|
2304
|
-
const { t } =
|
|
2354
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
2355
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2305
2356
|
const { memberDisplayName, targetUserId } = useChannelMemberActionContext();
|
|
2306
|
-
const { userIds: blockedUserIds } =
|
|
2357
|
+
const { userIds: blockedUserIds } = require_NotificationList.useStateStore(client.blockedUsers, blockedUsersSelector);
|
|
2307
2358
|
const isBlocked = !!targetUserId && new Set(blockedUserIds).has(targetUserId);
|
|
2308
2359
|
const [alertOpen, setAlertOpen] = (0, react.useState)(false);
|
|
2309
2360
|
const [userBlockInProgress, setUserBlockInProgress] = (0, react.useState)(false);
|
|
@@ -2377,7 +2428,7 @@ var BlockUserAction = () => {
|
|
|
2377
2428
|
t,
|
|
2378
2429
|
targetUserId
|
|
2379
2430
|
]);
|
|
2380
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2431
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
2381
2432
|
destructive: true,
|
|
2382
2433
|
LeadingIcon: BlockUserActionIcon,
|
|
2383
2434
|
RootElement: "button",
|
|
@@ -2404,10 +2455,10 @@ var BlockUserAction = () => {
|
|
|
2404
2455
|
})] });
|
|
2405
2456
|
};
|
|
2406
2457
|
var RemoveUserAction = () => {
|
|
2407
|
-
const { Modal =
|
|
2458
|
+
const { Modal = require_NotificationList.GlobalModal } = require_NotificationList.useComponentContext();
|
|
2408
2459
|
const { channel } = useChannelDetailContext();
|
|
2409
|
-
const { addNotification } =
|
|
2410
|
-
const { t } =
|
|
2460
|
+
const { addNotification } = require_NotificationList.useNotificationApi();
|
|
2461
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2411
2462
|
const { memberDisplayName, targetUserId } = useChannelMemberActionContext();
|
|
2412
2463
|
const [alertOpen, setAlertOpen] = (0, react.useState)(false);
|
|
2413
2464
|
const [removeMemberInProgress, setRemoveMemberInProgress] = (0, react.useState)(false);
|
|
@@ -2448,7 +2499,7 @@ var RemoveUserAction = () => {
|
|
|
2448
2499
|
t,
|
|
2449
2500
|
targetUserId
|
|
2450
2501
|
]);
|
|
2451
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2502
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
2452
2503
|
destructive: true,
|
|
2453
2504
|
LeadingIcon: RemoveUserActionIcon,
|
|
2454
2505
|
RootElement: "button",
|
|
@@ -2506,7 +2557,7 @@ var getPresenceStatusText = (user, t) => {
|
|
|
2506
2557
|
return t("Offline");
|
|
2507
2558
|
};
|
|
2508
2559
|
var ChannelMemberDetail = ({ channelMemberActionSet = defaultChannelMemberActionSet, member, onBack }) => {
|
|
2509
|
-
const { t } =
|
|
2560
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2510
2561
|
const memberDisplayName = getMemberDisplayName(member);
|
|
2511
2562
|
const memberStatusText = getPresenceStatusText(member.user, t);
|
|
2512
2563
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelMemberActionProvider, {
|
|
@@ -2524,9 +2575,9 @@ var ChannelMemberDetail = ({ channelMemberActionSet = defaultChannelMemberAction
|
|
|
2524
2575
|
});
|
|
2525
2576
|
};
|
|
2526
2577
|
var ChannelMemberDetailContent = ({ channelMemberActionSet, memberDisplayName, memberStatusText, onBack }) => {
|
|
2527
|
-
const { close } =
|
|
2528
|
-
const { t } =
|
|
2529
|
-
const { Avatar = require_useChannelHeaderOnlineStatus.ChannelAvatar } =
|
|
2578
|
+
const { close } = require_NotificationList.useModalContext();
|
|
2579
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2580
|
+
const { Avatar = require_useChannelHeaderOnlineStatus.ChannelAvatar } = require_NotificationList.useComponentContext();
|
|
2530
2581
|
const { member } = useChannelMemberActionContext();
|
|
2531
2582
|
const filteredActions = useBaseChannelMemberActionSetFilter(channelMemberActionSet);
|
|
2532
2583
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2535,7 +2586,7 @@ var ChannelMemberDetailContent = ({ channelMemberActionSet, memberDisplayName, m
|
|
|
2535
2586
|
close,
|
|
2536
2587
|
goBack: onBack,
|
|
2537
2588
|
title: t("Member detail")
|
|
2538
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
2589
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Prompt.Body, {
|
|
2539
2590
|
className: "str-chat__channel-detail__channel-member-detail-view__body",
|
|
2540
2591
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2541
2592
|
className: "str-chat__channel-detail__channel-member-detail-view__profile",
|
|
@@ -2566,7 +2617,7 @@ var ChannelMemberDetailContent = ({ channelMemberActionSet, memberDisplayName, m
|
|
|
2566
2617
|
var RESERVED_MODES = ["browse", "memberDetail"];
|
|
2567
2618
|
var isReservedMode = (mode) => RESERVED_MODES.includes(mode);
|
|
2568
2619
|
var AddMembersModeTitle = () => {
|
|
2569
|
-
const { t } =
|
|
2620
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2570
2621
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t("Add members") });
|
|
2571
2622
|
};
|
|
2572
2623
|
/** Built-in mode descriptors. Merged with (and overridable by) the `modeViews` prop. */
|
|
@@ -2575,9 +2626,9 @@ var defaultChannelMembersModeViews = { add: {
|
|
|
2575
2626
|
Title: AddMembersModeTitle
|
|
2576
2627
|
} };
|
|
2577
2628
|
var ChannelMembersView = ({ HeaderActions = DefaultHeaderActions, headerActionSet = defaultChannelMembersHeaderActionSet, HeaderActionsMenuTrigger, layout, modeViews: customModeViews }) => {
|
|
2578
|
-
const { t } =
|
|
2629
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2579
2630
|
const { channel } = useChannelDetailContext();
|
|
2580
|
-
const { close } =
|
|
2631
|
+
const { close } = require_NotificationList.useModalContext();
|
|
2581
2632
|
const [mode, setMode] = (0, react.useState)("browse");
|
|
2582
2633
|
const [selectedMember, setSelectedMember] = (0, react.useState)();
|
|
2583
2634
|
const memberCount = useChannelMemberCount(channel);
|
|
@@ -2641,10 +2692,11 @@ var ChannelMembersView = ({ HeaderActions = DefaultHeaderActions, headerActionSe
|
|
|
2641
2692
|
//#endregion
|
|
2642
2693
|
//#region src/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.tsx
|
|
2643
2694
|
var PinnedMessagesEmptyList = () => {
|
|
2644
|
-
const {
|
|
2695
|
+
const { IconPin } = require_NotificationList.useComponentContextIcons();
|
|
2696
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2645
2697
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2646
2698
|
className: "str-chat__channel-detail__pinned-messages-view__empty-state",
|
|
2647
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2699
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPin, { className: "str-chat__channel-detail__pinned-messages-view__empty-state__icon" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2648
2700
|
className: "str-chat__channel-detail__pinned-messages-view__empty-state__content",
|
|
2649
2701
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2650
2702
|
className: "str-chat__channel-detail__pinned-messages-view__empty-state__title",
|
|
@@ -2682,7 +2734,7 @@ var PINNED_MESSAGES_SEARCH_PAGE_SIZE = 30;
|
|
|
2682
2734
|
var PINNED_MESSAGES_SEARCH_DEBOUNCE_MS = 300;
|
|
2683
2735
|
var pinnedMessagesSearchSourceItemsStateSelector = (state) => ({ messages: state.items });
|
|
2684
2736
|
var usePinnedMessagesSearch = ({ searchSource } = {}) => {
|
|
2685
|
-
const { client } =
|
|
2737
|
+
const { client } = require_NotificationList.useChatContext();
|
|
2686
2738
|
const { channel } = useChannelDetailContext();
|
|
2687
2739
|
const pinnedMessagesSearchSource = (0, react.useMemo)(() => {
|
|
2688
2740
|
const source = searchSource ?? new stream_chat.MessageSearchSource(client, {
|
|
@@ -2704,7 +2756,7 @@ var usePinnedMessagesSearch = ({ searchSource } = {}) => {
|
|
|
2704
2756
|
client,
|
|
2705
2757
|
searchSource
|
|
2706
2758
|
]);
|
|
2707
|
-
const { messages } =
|
|
2759
|
+
const { messages } = require_NotificationList.useStateStore(pinnedMessagesSearchSource.state, pinnedMessagesSearchSourceItemsStateSelector);
|
|
2708
2760
|
(0, react.useEffect)(() => {
|
|
2709
2761
|
pinnedMessagesSearchSource.activate();
|
|
2710
2762
|
return () => {
|
|
@@ -2740,7 +2792,7 @@ var usePinnedMessagesSearch = ({ searchSource } = {}) => {
|
|
|
2740
2792
|
var computeItemKey = (_, message) => message.id;
|
|
2741
2793
|
var normalizeTimestamp = (timestamp) => {
|
|
2742
2794
|
if (!timestamp) return void 0;
|
|
2743
|
-
return
|
|
2795
|
+
return require_NotificationList.isDate(timestamp) ? timestamp.toISOString() : timestamp;
|
|
2744
2796
|
};
|
|
2745
2797
|
var getPinnedMessagePreview = (message, t) => {
|
|
2746
2798
|
const text = message.text?.trim();
|
|
@@ -2749,9 +2801,9 @@ var getPinnedMessagePreview = (message, t) => {
|
|
|
2749
2801
|
return attachment?.title || attachment?.text || attachment?.fallback || attachment?.type || t("Pinned message");
|
|
2750
2802
|
};
|
|
2751
2803
|
var PinnedMessageDate = ({ message }) => {
|
|
2752
|
-
const { t, tDateTimeParser } =
|
|
2804
|
+
const { t, tDateTimeParser } = require_NotificationList.useTranslationContext("PinnedMessageDate");
|
|
2753
2805
|
const normalizedTimestamp = normalizeTimestamp(message.created_at);
|
|
2754
|
-
const when = (0, react.useMemo)(() =>
|
|
2806
|
+
const when = (0, react.useMemo)(() => require_NotificationList.getDateString({
|
|
2755
2807
|
messageCreatedAt: normalizedTimestamp,
|
|
2756
2808
|
t,
|
|
2757
2809
|
tDateTimeParser,
|
|
@@ -2769,19 +2821,23 @@ var PinnedMessageDate = ({ message }) => {
|
|
|
2769
2821
|
});
|
|
2770
2822
|
};
|
|
2771
2823
|
var PinnedMessagesViewItem = ({ message, onSelect }) => {
|
|
2772
|
-
const { t } =
|
|
2824
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2825
|
+
const { Avatar: Avatar$1 = require_NotificationList.Avatar, extractDisplayInfo: extractDisplayInfo$1 = require_NotificationList.extractDisplayInfo } = require_NotificationList.useComponentContext();
|
|
2773
2826
|
const displayName = getUserDisplayName(message.user ?? void 0);
|
|
2774
2827
|
const LeadingSlot = (0, react.useMemo)(() => function MessageAuthorAvatar() {
|
|
2775
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2776
|
-
|
|
2777
|
-
size: "md"
|
|
2778
|
-
userName: displayName
|
|
2828
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Avatar$1, {
|
|
2829
|
+
...extractDisplayInfo$1({ user: message.user ?? void 0 }),
|
|
2830
|
+
size: "md"
|
|
2779
2831
|
});
|
|
2780
|
-
}, [
|
|
2832
|
+
}, [
|
|
2833
|
+
Avatar$1,
|
|
2834
|
+
extractDisplayInfo$1,
|
|
2835
|
+
message.user
|
|
2836
|
+
]);
|
|
2781
2837
|
const TrailingSlot = (0, react.useMemo)(() => function MessageDate() {
|
|
2782
2838
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinnedMessageDate, { message });
|
|
2783
2839
|
}, [message]);
|
|
2784
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2840
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.ListItemLayout, {
|
|
2785
2841
|
LeadingSlot,
|
|
2786
2842
|
RootElement: "button",
|
|
2787
2843
|
rootProps: (0, react.useMemo)(() => ({
|
|
@@ -2795,10 +2851,10 @@ var PinnedMessagesViewItem = ({ message, onSelect }) => {
|
|
|
2795
2851
|
});
|
|
2796
2852
|
};
|
|
2797
2853
|
var PinnedMessagesView = ({ searchSource }) => {
|
|
2798
|
-
const { setActiveChannel } =
|
|
2799
|
-
const { t } =
|
|
2800
|
-
const { close } =
|
|
2801
|
-
const { jumpToMessage } =
|
|
2854
|
+
const { setActiveChannel } = require_NotificationList.useChatContext();
|
|
2855
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
2856
|
+
const { close } = require_NotificationList.useModalContext();
|
|
2857
|
+
const { jumpToMessage } = require_NotificationList.useChannelActionContext();
|
|
2802
2858
|
const { channel } = useChannelDetailContext();
|
|
2803
2859
|
const { displayedMessages, handleSearchChange, hasPinnedMessages, hasSearchResultsLoaded, pinnedMessagesSearchSource } = usePinnedMessagesSearch({ searchSource });
|
|
2804
2860
|
const handleSelectMessage = (0, react.useCallback)((message) => {
|
|
@@ -2833,7 +2889,7 @@ var PinnedMessagesView = ({ searchSource }) => {
|
|
|
2833
2889
|
close,
|
|
2834
2890
|
description: t("Browse pinned messages"),
|
|
2835
2891
|
title: t("Pinned messages")
|
|
2836
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
2892
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_NotificationList.Prompt.Body, {
|
|
2837
2893
|
className: "str-chat__channel-detail__pinned-messages-view__body",
|
|
2838
2894
|
children: [hasPinnedMessages && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelDetailSearchInput, { onSearchChange: handleSearchChange }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VirtualizedList, {
|
|
2839
2895
|
className: "str-chat__channel-detail__pinned-messages-view__list",
|
|
@@ -2849,11 +2905,26 @@ var PinnedMessagesView = ({ searchSource }) => {
|
|
|
2849
2905
|
};
|
|
2850
2906
|
//#endregion
|
|
2851
2907
|
//#region src/plugins/ChannelDetail/ChannelDetail.tsx
|
|
2852
|
-
var ChannelManagementNavButtonIcon = () =>
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
var
|
|
2908
|
+
var ChannelManagementNavButtonIcon = () => {
|
|
2909
|
+
const { IconInfo } = require_NotificationList.useComponentContextIcons();
|
|
2910
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconInfo, { className: "str-chat__channel-detail__action-icon" });
|
|
2911
|
+
};
|
|
2912
|
+
var ChannelMembersNavButtonIcon = () => {
|
|
2913
|
+
const { IconUser } = require_NotificationList.useComponentContextIcons();
|
|
2914
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUser, { className: "str-chat__channel-detail__action-icon" });
|
|
2915
|
+
};
|
|
2916
|
+
var PinnedMessagesNavButtonIcon = () => {
|
|
2917
|
+
const { IconPin } = require_NotificationList.useComponentContextIcons();
|
|
2918
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPin, { className: "str-chat__channel-detail__action-icon" });
|
|
2919
|
+
};
|
|
2920
|
+
var ChannelMediaNavButtonIcon = () => {
|
|
2921
|
+
const { IconImage } = require_NotificationList.useComponentContextIcons();
|
|
2922
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconImage, { className: "str-chat__channel-detail__action-icon" });
|
|
2923
|
+
};
|
|
2924
|
+
var ChannelFilesNavButtonIcon = () => {
|
|
2925
|
+
const { IconFolder } = require_NotificationList.useComponentContextIcons();
|
|
2926
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolder, { className: "str-chat__channel-detail__action-icon" });
|
|
2927
|
+
};
|
|
2857
2928
|
var ChannelManagementNavButton = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelDetailNavButton, {
|
|
2858
2929
|
...props,
|
|
2859
2930
|
LeadingIcon: ChannelManagementNavButtonIcon,
|
|
@@ -2910,7 +2981,7 @@ var ChannelDetail = ({ channel, className, defaultLayout = SECTION_NAVIGATOR_LAY
|
|
|
2910
2981
|
const [layout, setLayout] = (0, react.useState)(defaultLayout);
|
|
2911
2982
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelDetailProvider, {
|
|
2912
2983
|
channel,
|
|
2913
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2984
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotificationList.Prompt.Root, {
|
|
2914
2985
|
className: (0, clsx.default)("str-chat__channel-detail", { "str-chat__channel-detail--inline": layout === SECTION_NAVIGATOR_LAYOUT.inline }, className),
|
|
2915
2986
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SectionNavigator, {
|
|
2916
2987
|
...props,
|
|
@@ -2925,9 +2996,9 @@ var ChannelDetail = ({ channel, className, defaultLayout = SECTION_NAVIGATOR_LAY
|
|
|
2925
2996
|
//#region src/plugins/ChannelDetail/AvatarWithChannelDetail.tsx
|
|
2926
2997
|
var avatarWithChannelDetailDialogRootProps = { className: "str-chat__channel-detail-modal" };
|
|
2927
2998
|
var AvatarWithChannelDetail = ({ Avatar, ChannelDetail: ChannelDetail$1 = ChannelDetail, className, ...avatarProps }) => {
|
|
2928
|
-
const { t } =
|
|
2929
|
-
const { channel } =
|
|
2930
|
-
const { Avatar: ContextAvatar, Modal =
|
|
2999
|
+
const { t } = require_NotificationList.useTranslationContext();
|
|
3000
|
+
const { channel } = require_NotificationList.useChannelStateContext();
|
|
3001
|
+
const { Avatar: ContextAvatar, Modal = require_NotificationList.GlobalModal } = require_NotificationList.useComponentContext();
|
|
2931
3002
|
const [isModalOpen, setIsModalOpen] = (0, react.useState)(false);
|
|
2932
3003
|
const openModal = (0, react.useCallback)(() => setIsModalOpen(true), []);
|
|
2933
3004
|
const closeModal = (0, react.useCallback)(() => setIsModalOpen(false), []);
|