stream-chat-react 14.0.0-beta.4 → 14.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{WithAudioPlayback.236d404c.js → WithAudioPlayback.f9abf707.js} +94 -116
- package/dist/cjs/WithAudioPlayback.f9abf707.js.map +1 -0
- package/dist/cjs/emojis.js +1 -1
- package/dist/cjs/index.js +161 -188
- package/dist/cjs/index.js.map +1 -1
- package/dist/css/index.css +219 -595
- package/dist/css/index.css.map +1 -1
- package/dist/es/{WithAudioPlayback.89700cb5.mjs → WithAudioPlayback.d90f1a99.mjs} +184 -206
- package/dist/es/WithAudioPlayback.d90f1a99.mjs.map +1 -0
- package/dist/es/emojis.mjs +1 -1
- package/dist/es/index.mjs +221 -248
- package/dist/es/index.mjs.map +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/components/Avatar/AvatarStack.d.ts +2 -2
- package/dist/types/components/Avatar/AvatarStack.d.ts.map +1 -1
- package/dist/types/components/Avatar/ChannelAvatar.d.ts +2 -6
- package/dist/types/components/Avatar/ChannelAvatar.d.ts.map +1 -1
- package/dist/types/components/Avatar/GroupAvatar.d.ts +6 -7
- package/dist/types/components/Avatar/GroupAvatar.d.ts.map +1 -1
- package/dist/types/components/ChannelHeader/ChannelHeader.d.ts +1 -1
- package/dist/types/components/ChannelHeader/ChannelHeader.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/ChannelListItemUI.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/utils.d.ts.map +1 -1
- package/dist/types/components/Dialog/service/DialogPortal.d.ts.map +1 -1
- package/dist/types/components/Form/SwitchField.d.ts.map +1 -1
- package/dist/types/components/Icons/createIcon.d.ts +1 -1
- package/dist/types/components/Icons/createIcon.d.ts.map +1 -1
- package/dist/types/components/Icons/icons.d.ts +9 -41
- package/dist/types/components/Icons/icons.d.ts.map +1 -1
- package/dist/types/components/Icons/index.d.ts +0 -1
- package/dist/types/components/Icons/index.d.ts.map +1 -1
- package/dist/types/components/Message/Message.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/useUserRole.d.ts.map +1 -1
- package/dist/types/components/Message/types.d.ts +1 -5
- package/dist/types/components/Message/types.d.ts.map +1 -1
- package/dist/types/components/MessageActions/MessageActions.defaults.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/MessageComposerUI.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/hooks/useSubmitHandler.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/preEditSnapshot.d.ts +16 -0
- package/dist/types/components/MessageComposer/preEditSnapshot.d.ts.map +1 -0
- package/dist/types/components/MessageList/MessageList.d.ts +1 -1
- package/dist/types/components/MessageList/MessageList.d.ts.map +1 -1
- package/dist/types/components/MessageList/VirtualizedMessageList.d.ts +1 -1
- package/dist/types/components/MessageList/VirtualizedMessageList.d.ts.map +1 -1
- package/dist/types/components/MessageList/VirtualizedMessageListComponents.d.ts.map +1 -1
- package/dist/types/components/Reactions/MessageReactions.d.ts +4 -16
- package/dist/types/components/Reactions/MessageReactions.d.ts.map +1 -1
- package/dist/types/components/Reactions/MessageReactionsDetail.d.ts +4 -4
- package/dist/types/components/Reactions/MessageReactionsDetail.d.ts.map +1 -1
- package/dist/types/components/Reactions/hooks/useProcessReactions.d.ts +4 -2
- package/dist/types/components/Reactions/hooks/useProcessReactions.d.ts.map +1 -1
- package/dist/types/components/Reactions/types.d.ts +0 -1
- package/dist/types/components/Reactions/types.d.ts.map +1 -1
- package/dist/types/components/SummarizedMessagePreview/SummarizedMessagePreview.d.ts.map +1 -1
- package/dist/types/components/SummarizedMessagePreview/hooks/useLatestMessagePreview.d.ts.map +1 -1
- package/dist/types/components/Thread/ThreadHeader.d.ts +1 -1
- package/dist/types/components/Thread/ThreadHeader.d.ts.map +1 -1
- package/dist/types/components/TypingIndicator/TypingIndicator.d.ts.map +1 -1
- package/dist/types/context/ComponentContext.d.ts +2 -2
- package/dist/types/context/ComponentContext.d.ts.map +1 -1
- package/dist/types/context/MessageBounceContext.d.ts.map +1 -1
- package/dist/types/context/MessageContext.d.ts +1 -5
- package/dist/types/context/MessageContext.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/WithAudioPlayback.236d404c.js.map +0 -1
- package/dist/es/WithAudioPlayback.89700cb5.mjs.map +0 -1
- package/dist/types/components/Icons/IconGiphy.d.ts +0 -3
- package/dist/types/components/Icons/IconGiphy.d.ts.map +0 -1
package/dist/es/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import clsx from "clsx";
|
|
|
3
3
|
import { nanoid } from "nanoid";
|
|
4
4
|
import React, { useState, useEffect, useCallback, useLayoutEffect, useMemo, useContext, createContext, useRef, forwardRef, createElement, Component, Fragment as Fragment$1 } from "react";
|
|
5
5
|
import { u as useHandleFileChangeWrapper, d as dataTransferItemsToFiles, r as renderAudio, t as toAudioBuffer, c as createFileFromBlobs, g as getExtensionFromMimeType, a as getRecordedMediaTypeFromMimeType } from "./audioProcessing.21cb49e1.mjs";
|
|
6
|
-
import { u as useStateStore, a as useMessageComposerController, i as isMessageBounced, b as useChannelActionContext, C as ComponentContext, c as useTranslationContext, d as useChannelStateContext, e as useChatContext, f as isNotificationForPanel, B as
|
|
7
|
-
import { bu, bx,
|
|
6
|
+
import { u as useStateStore, a as useMessageComposerController, i as isMessageBounced, b as useChannelActionContext, C as ComponentContext, c as useTranslationContext, d as useChannelStateContext, e as useChatContext, f as isNotificationForPanel, B as Button, I as IconPauseFill, g as IconPlayFill, h as getDefaultExportFromCjs, j as defaultTranslatorFunction, p as predefinedFormatters, L as LocalizedFormat, k as calendar, l as IconLoading, m as isNetworkSendFailure, v as validateAndGetMessage, n as isUserMuted, o as defaultPinPermissions, q as useThreadContext, r as usePopoverPosition, s as useComponentContext, t as IconXmark, w as IconUser, x as IconExclamationMarkFill, y as IconChevronRight, z as IconChevronLeft, A as IconArrowLeft, D as IconExclamationMark, E as IconNoSign, F as isMessageErrorRetryable, G as ACTIONS_NOT_WORKING_IN_THREAD, H as useNotificationTarget, J as IconArrowUpRight, K as addNotificationTargetTag, M as IconPin, N as mapToUserNameOrId, O as IconClock, P as IconCheckmark1Small, Q as IconChecks, R as getReadByTooltipText, S as messageHasAttachments, T as messageTextHasEmojisOnly, U as isDate, V as getDateString, W as IconTranslate, X as useMessageComposerContext, Y as useIsCooldownActive, Z as IconXmarkSmall, _ as IconImage, $ as IconPoll, a0 as IconLocation, a1 as IconFile, a2 as IconLink, a3 as IconVideo, a4 as IconVideoFill, a5 as IconVoice, a6 as IconSave, a7 as IconBell, a8 as IconChevronDown, a9 as IconPlusSmall, aa as IconCheckmark, ab as DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD, ac as IconTrophy, ad as IconReorder, ae as IconMinusCircle, af as IconSend, ag as IconAudio, ah as IconUserAdd, ai as IconMute, aj as IconGiphy, ak as IconFlag, al as IconUserRemove, am as IconAttachment, an as IconCommand, ao as CHANNEL_CONTAINER_ID, ap as IconPlus, aq as IconExclamationTriangleFill, ar as useAudioPlayer, as as IconRetry, at as IconArrowDownCircle, au as IconBolt, av as IconDelete, aw as IconUpload, ax as MessageComposerContextProvider, ay as useTypingContext, az as defaultDateTimeParser, aA as isLanguageSupported, aB as IconSidebar, aC as useChatViewContext, aD as MESSAGE_ACTIONS, aE as LegacyThreadContext, aF as IconReply, aG as IconEmoji, aH as IconMore, aI as IconUserCheck, aJ as IconUnsave, aK as IconBellOff, aL as IconNotification, aM as IconEdit, aN as IconCopy, aO as IconUnpin, aP as IconQuote, aQ as IconThread, aR as areMessageUIPropsEqual, aS as isDateSeparatorMessage, aT as isMessageBlocked, aU as messageHasSingleAttachment, aV as messageHasGiphyAttachment, aW as messageHasReactions, aX as isMessageEdited, aY as countEmojis, aZ as areMessagePropsEqual, a_ as getMessageActions, a$ as processMessages, b0 as insertIntro, b1 as getGroupStyles, b2 as getLastReceived, b3 as IconArrowUp, b4 as isIntroMessage, b5 as isLocalMessage, b6 as getIsFirstUnreadMessage, b7 as IconArrowDown, b8 as DEFAULT_NEXT_CHANNEL_PAGE_SIZE, b9 as EmptyStateIndicator, ba as getChannel, bb as IconSearch, bc as IconXCircle, bd as useChannelListContext, be as DEFAULT_JUMP_TO_PAGE_SIZE, bf as ChannelListContextProvider, bg as IconArchive, bh as IconLeave, bi as IconCamera, bj as IconExclamationCircleFill, bk as ChatProvider, bl as TranslationProvider, bm as useThreadsViewContext, bn as IconMessageBubbles, bo as IconRefresh, bp as IconEyeFill } from "./WithAudioPlayback.d90f1a99.mjs";
|
|
7
|
+
import { bu, bx, bY, bZ, b_, b$, c0, c1, bz, bC, by, bB, bD, c2, bG, bH, bI, bJ, bK, c3, bL, bW, bX, c4, c5, c6, br, bF, bE, bs, bt, bM, bN, bT, bU, bQ, bR, c7, bS, c8, bP, bO, bq, bA, bv, bw, bV } from "./WithAudioPlayback.d90f1a99.mjs";
|
|
8
8
|
import { StateStore, formatMessage, MessageComposer as MessageComposer$1, isGiphyAttachment, isScrapedContent, isLocalVideoAttachment, isVideoAttachment, isLocalImageAttachment, isImageAttachment, isAudioAttachment, isVoiceRecordingAttachment, isFileAttachment, isVoteAnswer, VotingVisibility, isLocalVoiceRecordingAttachment, isLocalAudioAttachment, isLocalFileAttachment, isLocalAttachment, LinkPreviewsManager, SearchController, ChannelSearchSource, UserSearchSource, MessageSearchSource, StreamChat, isSharedLocationResponse, LiveLocationManager } from "stream-chat";
|
|
9
9
|
import throttle from "lodash.throttle";
|
|
10
10
|
import * as linkify from "linkifyjs";
|
|
@@ -275,7 +275,8 @@ const DialogPortalDestination = () => {
|
|
|
275
275
|
useEffect(() => {
|
|
276
276
|
if (!destinationRoot || !dialogManager) return;
|
|
277
277
|
const handleDocumentClick = (event) => {
|
|
278
|
-
|
|
278
|
+
const target = event.target;
|
|
279
|
+
if (target !== destinationRoot && destinationRoot.contains(target)) return;
|
|
279
280
|
setTimeout(() => {
|
|
280
281
|
Object.values(dialogManager.state.getLatestValue().dialogsById).forEach(
|
|
281
282
|
(dialog) => {
|
|
@@ -302,21 +303,6 @@ const DialogPortalDestination = () => {
|
|
|
302
303
|
className: "str-chat__dialog-overlay",
|
|
303
304
|
"data-str-chat__portal-id": dialogManager?.id,
|
|
304
305
|
"data-testid": "str-chat__dialog-overlay",
|
|
305
|
-
onClick: (event) => {
|
|
306
|
-
if (!dialogManager) return;
|
|
307
|
-
if (event.target !== event.currentTarget) return;
|
|
308
|
-
Object.values(dialogManager.state.getLatestValue().dialogsById).forEach(
|
|
309
|
-
(dialog) => {
|
|
310
|
-
if (!dialog.isOpen) return;
|
|
311
|
-
if (!shouldCloseOnOutsideClick({
|
|
312
|
-
dialog,
|
|
313
|
-
managerCloseOnClickOutside: dialogManager.closeOnClickOutside
|
|
314
|
-
}))
|
|
315
|
-
return;
|
|
316
|
-
dialogManager.close(dialog.id);
|
|
317
|
-
}
|
|
318
|
-
);
|
|
319
|
-
},
|
|
320
306
|
ref: setDestinationRoot,
|
|
321
307
|
style: {
|
|
322
308
|
"--str-chat__dialog-overlay-height": openedDialogCount > 0 ? "100%" : "0"
|
|
@@ -474,6 +460,38 @@ const useMessageContext = (_componentName) => {
|
|
|
474
460
|
}
|
|
475
461
|
return contextValue;
|
|
476
462
|
};
|
|
463
|
+
const snapshots = /* @__PURE__ */ new WeakMap();
|
|
464
|
+
const savePreEditSnapshot = (messageComposer) => {
|
|
465
|
+
if (snapshots.has(messageComposer)) return;
|
|
466
|
+
const composerState = messageComposer.state.getLatestValue();
|
|
467
|
+
const textState = messageComposer.textComposer.state.getLatestValue();
|
|
468
|
+
const attachmentState = messageComposer.attachmentManager.state.getLatestValue();
|
|
469
|
+
const linkPreviewState = messageComposer.linkPreviewsManager.state.getLatestValue();
|
|
470
|
+
const locationState = messageComposer.locationComposer.state.getLatestValue();
|
|
471
|
+
const pollState = messageComposer.pollComposer.state.getLatestValue();
|
|
472
|
+
const customDataState = messageComposer.customDataManager.state.getLatestValue();
|
|
473
|
+
snapshots.set(messageComposer, () => {
|
|
474
|
+
messageComposer.state.next(composerState);
|
|
475
|
+
messageComposer.textComposer.state.next(textState);
|
|
476
|
+
messageComposer.attachmentManager.state.next(attachmentState);
|
|
477
|
+
messageComposer.linkPreviewsManager.state.next(linkPreviewState);
|
|
478
|
+
messageComposer.locationComposer.state.next(locationState);
|
|
479
|
+
messageComposer.pollComposer.state.next(pollState);
|
|
480
|
+
messageComposer.customDataManager.state.next(customDataState);
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
const restorePreEditSnapshot = (messageComposer) => {
|
|
484
|
+
const restore = snapshots.get(messageComposer);
|
|
485
|
+
snapshots.delete(messageComposer);
|
|
486
|
+
if (restore) {
|
|
487
|
+
restore();
|
|
488
|
+
} else {
|
|
489
|
+
messageComposer.clear();
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
const discardPreEditSnapshot = (messageComposer) => {
|
|
493
|
+
snapshots.delete(messageComposer);
|
|
494
|
+
};
|
|
477
495
|
const MessageBounceContext = createContext(
|
|
478
496
|
void 0
|
|
479
497
|
);
|
|
@@ -502,6 +520,7 @@ function MessageBounceProvider({ children }) {
|
|
|
502
520
|
const handleEdit = useCallback(
|
|
503
521
|
(e) => {
|
|
504
522
|
e.preventDefault();
|
|
523
|
+
savePreEditSnapshot(messageComposer);
|
|
505
524
|
messageComposer.initState({ composition: message });
|
|
506
525
|
},
|
|
507
526
|
[message, messageComposer]
|
|
@@ -710,47 +729,6 @@ const useNotifications = (options) => {
|
|
|
710
729
|
const { notifications } = useStateStore(client.notifications.store, selector2);
|
|
711
730
|
return notifications;
|
|
712
731
|
};
|
|
713
|
-
const IconGiphy = ({ className, ...props }) => /* @__PURE__ */ jsxs(
|
|
714
|
-
BaseIcon,
|
|
715
|
-
{
|
|
716
|
-
...props,
|
|
717
|
-
className: clsx("str-chat__icon--giphy", className),
|
|
718
|
-
viewBox: "0 0 16 16",
|
|
719
|
-
children: [
|
|
720
|
-
/* @__PURE__ */ jsx("rect", { fill: "black", height: "16", rx: "8", width: "16" }),
|
|
721
|
-
/* @__PURE__ */ jsx(
|
|
722
|
-
"path",
|
|
723
|
-
{
|
|
724
|
-
clipRule: "evenodd",
|
|
725
|
-
d: "M5.27976 4.40015H10.7206V11.5999H5.2793L5.27976 4.40015Z",
|
|
726
|
-
fill: "black",
|
|
727
|
-
fillRule: "evenodd"
|
|
728
|
-
}
|
|
729
|
-
),
|
|
730
|
-
/* @__PURE__ */ jsx("path", { d: "M4.19189 4.1333H5.27969V11.8669H4.19189V4.1333Z", fill: "#04FF8E" }),
|
|
731
|
-
/* @__PURE__ */ jsx("path", { d: "M10.7202 6.26685H11.808V11.8668H10.7202V6.26685Z", fill: "#8E2EFF" }),
|
|
732
|
-
/* @__PURE__ */ jsx("path", { d: "M4.19189 11.5999H11.8079V12.6667H4.19189V11.5999Z", fill: "#00C5FF" }),
|
|
733
|
-
/* @__PURE__ */ jsx("path", { d: "M4.19189 3.33325H8.54403V4.40005H4.19189V3.33325Z", fill: "#FFF152" }),
|
|
734
|
-
/* @__PURE__ */ jsx(
|
|
735
|
-
"path",
|
|
736
|
-
{
|
|
737
|
-
d: "M10.72 5.46638V4.40005H9.63174V3.33325H8.54395V6.53318H11.8078V5.46638",
|
|
738
|
-
fill: "#FF5B5B"
|
|
739
|
-
}
|
|
740
|
-
),
|
|
741
|
-
/* @__PURE__ */ jsx("path", { d: "M10.7202 7.6V6.5332H11.808", fill: "#551C99" }),
|
|
742
|
-
/* @__PURE__ */ jsx(
|
|
743
|
-
"path",
|
|
744
|
-
{
|
|
745
|
-
clipRule: "evenodd",
|
|
746
|
-
d: "M8.54432 3.33325V4.40005H7.45605",
|
|
747
|
-
fill: "#999131",
|
|
748
|
-
fillRule: "evenodd"
|
|
749
|
-
}
|
|
750
|
-
)
|
|
751
|
-
]
|
|
752
|
-
}
|
|
753
|
-
);
|
|
754
732
|
const PlayButton = ({ className, isPlaying, ...props }) => /* @__PURE__ */ jsx(
|
|
755
733
|
Button,
|
|
756
734
|
{
|
|
@@ -7358,77 +7336,77 @@ function requireDuration() {
|
|
|
7358
7336
|
}
|
|
7359
7337
|
return this;
|
|
7360
7338
|
}
|
|
7361
|
-
var
|
|
7362
|
-
return
|
|
7339
|
+
var c9 = h2.prototype;
|
|
7340
|
+
return c9.calMilliseconds = function() {
|
|
7363
7341
|
var t2 = this;
|
|
7364
7342
|
this.$ms = Object.keys(this.$d).reduce(function(s2, n2) {
|
|
7365
7343
|
return s2 + (t2.$d[n2] || 0) * e[n2];
|
|
7366
7344
|
}, 0);
|
|
7367
|
-
},
|
|
7345
|
+
}, c9.parseFromMilliseconds = function() {
|
|
7368
7346
|
var t2 = this.$ms;
|
|
7369
7347
|
this.$d.years = a(t2 / 31536e6), t2 %= 31536e6, this.$d.months = a(t2 / 2592e6), t2 %= 2592e6, this.$d.days = a(t2 / 864e5), t2 %= 864e5, this.$d.hours = a(t2 / 36e5), t2 %= 36e5, this.$d.minutes = a(t2 / 6e4), t2 %= 6e4, this.$d.seconds = a(t2 / 1e3), t2 %= 1e3, this.$d.milliseconds = t2;
|
|
7370
|
-
},
|
|
7348
|
+
}, c9.toISOString = function() {
|
|
7371
7349
|
var t2 = d(this.$d.years, "Y"), s2 = d(this.$d.months, "M"), n2 = +this.$d.days || 0;
|
|
7372
7350
|
this.$d.weeks && (n2 += 7 * this.$d.weeks);
|
|
7373
7351
|
var i2 = d(n2, "D"), e2 = d(this.$d.hours, "H"), r2 = d(this.$d.minutes, "M"), o2 = this.$d.seconds || 0;
|
|
7374
7352
|
this.$d.milliseconds && (o2 += this.$d.milliseconds / 1e3);
|
|
7375
|
-
var u3 = d(o2, "S"), h3 = t2.negative || s2.negative || i2.negative || e2.negative || r2.negative || u3.negative, a2 = e2.format || r2.format || u3.format ? "T" : "",
|
|
7376
|
-
return "P" ===
|
|
7377
|
-
},
|
|
7353
|
+
var u3 = d(o2, "S"), h3 = t2.negative || s2.negative || i2.negative || e2.negative || r2.negative || u3.negative, a2 = e2.format || r2.format || u3.format ? "T" : "", c10 = (h3 ? "-" : "") + "P" + t2.format + s2.format + i2.format + a2 + e2.format + r2.format + u3.format;
|
|
7354
|
+
return "P" === c10 || "-P" === c10 ? "P0D" : c10;
|
|
7355
|
+
}, c9.toJSON = function() {
|
|
7378
7356
|
return this.toISOString();
|
|
7379
|
-
},
|
|
7357
|
+
}, c9.format = function(t2) {
|
|
7380
7358
|
var i2 = t2 || "YYYY-MM-DDTHH:mm:ss", e2 = { Y: this.$d.years, YY: s.s(this.$d.years, 2, "0"), YYYY: s.s(this.$d.years, 4, "0"), M: this.$d.months, MM: s.s(this.$d.months, 2, "0"), D: this.$d.days, DD: s.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: s.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: s.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: s.s(this.$d.seconds, 2, "0"), SSS: s.s(this.$d.milliseconds, 3, "0") };
|
|
7381
7359
|
return i2.replace(n, function(t3, s2) {
|
|
7382
7360
|
return s2 || String(e2[t3]);
|
|
7383
7361
|
});
|
|
7384
|
-
},
|
|
7362
|
+
}, c9.as = function(t2) {
|
|
7385
7363
|
return this.$ms / e[u2(t2)];
|
|
7386
|
-
},
|
|
7364
|
+
}, c9.get = function(t2) {
|
|
7387
7365
|
var s2 = this.$ms, n2 = u2(t2);
|
|
7388
7366
|
return "milliseconds" === n2 ? s2 %= 1e3 : s2 = "weeks" === n2 ? a(s2 / e[n2]) : this.$d[n2], 0 === s2 ? 0 : s2;
|
|
7389
|
-
},
|
|
7367
|
+
}, c9.add = function(t2, s2, n2) {
|
|
7390
7368
|
var i2;
|
|
7391
7369
|
return i2 = s2 ? t2 * e[u2(s2)] : r(t2) ? t2.$ms : o(t2, this).$ms, o(this.$ms + i2 * (n2 ? -1 : 1), this);
|
|
7392
|
-
},
|
|
7370
|
+
}, c9.subtract = function(t2, s2) {
|
|
7393
7371
|
return this.add(t2, s2, true);
|
|
7394
|
-
},
|
|
7372
|
+
}, c9.locale = function(t2) {
|
|
7395
7373
|
var s2 = this.clone();
|
|
7396
7374
|
return s2.$l = t2, s2;
|
|
7397
|
-
},
|
|
7375
|
+
}, c9.clone = function() {
|
|
7398
7376
|
return o(this.$ms, this);
|
|
7399
|
-
},
|
|
7377
|
+
}, c9.humanize = function(s2) {
|
|
7400
7378
|
return t().add(this.$ms, "ms").locale(this.$l).fromNow(!s2);
|
|
7401
|
-
},
|
|
7379
|
+
}, c9.milliseconds = function() {
|
|
7402
7380
|
return this.get("milliseconds");
|
|
7403
|
-
},
|
|
7381
|
+
}, c9.asMilliseconds = function() {
|
|
7404
7382
|
return this.as("milliseconds");
|
|
7405
|
-
},
|
|
7383
|
+
}, c9.seconds = function() {
|
|
7406
7384
|
return this.get("seconds");
|
|
7407
|
-
},
|
|
7385
|
+
}, c9.asSeconds = function() {
|
|
7408
7386
|
return this.as("seconds");
|
|
7409
|
-
},
|
|
7387
|
+
}, c9.minutes = function() {
|
|
7410
7388
|
return this.get("minutes");
|
|
7411
|
-
},
|
|
7389
|
+
}, c9.asMinutes = function() {
|
|
7412
7390
|
return this.as("minutes");
|
|
7413
|
-
},
|
|
7391
|
+
}, c9.hours = function() {
|
|
7414
7392
|
return this.get("hours");
|
|
7415
|
-
},
|
|
7393
|
+
}, c9.asHours = function() {
|
|
7416
7394
|
return this.as("hours");
|
|
7417
|
-
},
|
|
7395
|
+
}, c9.days = function() {
|
|
7418
7396
|
return this.get("days");
|
|
7419
|
-
},
|
|
7397
|
+
}, c9.asDays = function() {
|
|
7420
7398
|
return this.as("days");
|
|
7421
|
-
},
|
|
7399
|
+
}, c9.weeks = function() {
|
|
7422
7400
|
return this.get("weeks");
|
|
7423
|
-
},
|
|
7401
|
+
}, c9.asWeeks = function() {
|
|
7424
7402
|
return this.as("weeks");
|
|
7425
|
-
},
|
|
7403
|
+
}, c9.months = function() {
|
|
7426
7404
|
return this.get("months");
|
|
7427
|
-
},
|
|
7405
|
+
}, c9.asMonths = function() {
|
|
7428
7406
|
return this.as("months");
|
|
7429
|
-
},
|
|
7407
|
+
}, c9.years = function() {
|
|
7430
7408
|
return this.get("years");
|
|
7431
|
-
},
|
|
7409
|
+
}, c9.asYears = function() {
|
|
7432
7410
|
return this.as("years");
|
|
7433
7411
|
}, h2;
|
|
7434
7412
|
})();
|
|
@@ -8908,7 +8886,7 @@ const useUserRole = (message, onlySenderCanEdit, disableQuotedMessages) => {
|
|
|
8908
8886
|
const isOwner = channel.state.membership.role === "owner";
|
|
8909
8887
|
const isModerator = client.user?.role === "channel_moderator" || channel.state.membership.role === "channel_moderator" || channel.state.membership.role === "moderator" || channel.state.membership.is_moderator === true || channel.state.membership.channel_role === "channel_moderator";
|
|
8910
8888
|
const isMyMessage = client.userID === message.user?.id;
|
|
8911
|
-
const canEdit = !message.poll && (!onlySenderCanEdit && channelCapabilities["update-any-message"] || isMyMessage && channelCapabilities["update-own-message"]);
|
|
8889
|
+
const canEdit = !message.poll && message.command !== "giphy" && (!onlySenderCanEdit && channelCapabilities["update-any-message"] || isMyMessage && channelCapabilities["update-own-message"]);
|
|
8912
8890
|
const canDelete = channelCapabilities["delete-any-message"] || isMyMessage && channelCapabilities["delete-own-message"];
|
|
8913
8891
|
const canFlag = !isMyMessage && channelCapabilities["flag-message"];
|
|
8914
8892
|
const canMute = !isMyMessage && channelCapabilities["mute-channel"];
|
|
@@ -9314,12 +9292,17 @@ const ErrorBadge = ({
|
|
|
9314
9292
|
}) => /* @__PURE__ */ jsx(Badge, { ...rest, className, size, variant: "error", children: /* @__PURE__ */ jsx(IconExclamationMarkFill, {}) });
|
|
9315
9293
|
function AvatarStack({
|
|
9316
9294
|
badgeSize,
|
|
9295
|
+
capLimit = 3,
|
|
9317
9296
|
component: Component2 = "div",
|
|
9318
9297
|
displayInfo = [],
|
|
9319
|
-
overflowCount,
|
|
9320
9298
|
size
|
|
9321
9299
|
}) {
|
|
9322
9300
|
const { Avatar: Avatar$1 = Avatar } = useComponentContext(AvatarStack.name);
|
|
9301
|
+
const displayInfoToRender = useMemo(
|
|
9302
|
+
() => displayInfo.length > capLimit ? displayInfo.slice(0, capLimit) : displayInfo,
|
|
9303
|
+
[displayInfo, capLimit]
|
|
9304
|
+
);
|
|
9305
|
+
const overflowCount = displayInfo.length - displayInfoToRender.length;
|
|
9323
9306
|
if (!displayInfo.length) {
|
|
9324
9307
|
return null;
|
|
9325
9308
|
}
|
|
@@ -9329,8 +9312,9 @@ function AvatarStack({
|
|
|
9329
9312
|
className: clsx("str-chat__avatar-stack", {
|
|
9330
9313
|
[`str-chat__avatar-stack--size-${size}`]: typeof size === "string"
|
|
9331
9314
|
}),
|
|
9315
|
+
"data-testid": "avatar-stack",
|
|
9332
9316
|
children: [
|
|
9333
|
-
|
|
9317
|
+
displayInfoToRender.map((info, index) => /* @__PURE__ */ jsx(
|
|
9334
9318
|
Avatar$1,
|
|
9335
9319
|
{
|
|
9336
9320
|
imageUrl: info.imageUrl,
|
|
@@ -9343,6 +9327,7 @@ function AvatarStack({
|
|
|
9343
9327
|
Badge,
|
|
9344
9328
|
{
|
|
9345
9329
|
className: "str-chat__avatar-stack__count-badge",
|
|
9330
|
+
"data-testid": "avatar-stack-count-badge",
|
|
9346
9331
|
size: badgeSize ?? size,
|
|
9347
9332
|
variant: "counter",
|
|
9348
9333
|
children: [
|
|
@@ -9358,34 +9343,36 @@ function AvatarStack({
|
|
|
9358
9343
|
const ChannelAvatar = ({
|
|
9359
9344
|
displayMembers,
|
|
9360
9345
|
imageUrl,
|
|
9361
|
-
overflowCount,
|
|
9362
9346
|
size,
|
|
9363
9347
|
userName,
|
|
9364
9348
|
...sharedProps
|
|
9365
9349
|
}) => {
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9350
|
+
const displayInfo = useMemo(() => {
|
|
9351
|
+
if (displayMembers && displayMembers.length > 0) {
|
|
9352
|
+
return displayMembers;
|
|
9353
|
+
}
|
|
9354
|
+
return [
|
|
9369
9355
|
{
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
size,
|
|
9373
|
-
...sharedProps
|
|
9356
|
+
imageUrl,
|
|
9357
|
+
userName
|
|
9374
9358
|
}
|
|
9375
|
-
|
|
9376
|
-
}
|
|
9377
|
-
return /* @__PURE__ */ jsx(
|
|
9359
|
+
];
|
|
9360
|
+
}, [displayMembers, imageUrl, userName]);
|
|
9361
|
+
return /* @__PURE__ */ jsx(GroupAvatar, { displayMembers: displayInfo, size, ...sharedProps });
|
|
9378
9362
|
};
|
|
9379
9363
|
const GroupAvatar = ({
|
|
9380
9364
|
badgeSize,
|
|
9381
9365
|
className,
|
|
9382
9366
|
displayMembers = [],
|
|
9383
9367
|
isOnline,
|
|
9384
|
-
overflowCount,
|
|
9385
9368
|
size,
|
|
9386
9369
|
...rest
|
|
9387
9370
|
}) => {
|
|
9388
|
-
const
|
|
9371
|
+
const displayMembersToRender = useMemo(
|
|
9372
|
+
() => displayMembers.length > 4 ? displayMembers.slice(0, 2) : displayMembers,
|
|
9373
|
+
[displayMembers]
|
|
9374
|
+
);
|
|
9375
|
+
const overflowCount = displayMembers.length - displayMembersToRender.length;
|
|
9389
9376
|
if (displayMembers.length < 2) {
|
|
9390
9377
|
const firstUser = displayMembers[0];
|
|
9391
9378
|
return /* @__PURE__ */ jsx(
|
|
@@ -9423,19 +9410,20 @@ const GroupAvatar = ({
|
|
|
9423
9410
|
role: "button",
|
|
9424
9411
|
...rest,
|
|
9425
9412
|
children: [
|
|
9426
|
-
|
|
9413
|
+
displayMembersToRender.map(({ id, imageUrl, userName }, index) => /* @__PURE__ */ jsx(
|
|
9427
9414
|
Avatar,
|
|
9428
9415
|
{
|
|
9429
9416
|
imageUrl,
|
|
9430
9417
|
size: avatarSize,
|
|
9431
9418
|
userName
|
|
9432
9419
|
},
|
|
9433
|
-
`${userName}-${imageUrl}-${index}`
|
|
9420
|
+
id || `${userName}-${imageUrl}-${index}`
|
|
9434
9421
|
)),
|
|
9435
|
-
|
|
9422
|
+
typeof overflowCount === "number" && overflowCount > 0 && /* @__PURE__ */ jsxs(
|
|
9436
9423
|
Badge,
|
|
9437
9424
|
{
|
|
9438
9425
|
className: "str-chat__avatar-group__count-badge",
|
|
9426
|
+
"data-testid": "group-avatar-count-badge",
|
|
9439
9427
|
size: badgeSize,
|
|
9440
9428
|
variant: "counter",
|
|
9441
9429
|
children: [
|
|
@@ -11177,6 +11165,7 @@ const useSubmitHandler = (props) => {
|
|
|
11177
11165
|
if (messageComposer.editedMessage && localMessage.type !== "error") {
|
|
11178
11166
|
try {
|
|
11179
11167
|
await editMessage(localMessage, sendOptions);
|
|
11168
|
+
discardPreEditSnapshot(messageComposer);
|
|
11180
11169
|
messageComposer.clear();
|
|
11181
11170
|
} catch (err) {
|
|
11182
11171
|
client.notifications.addError({
|
|
@@ -12032,7 +12021,7 @@ const RemoveAttachmentPreviewButton = ({
|
|
|
12032
12021
|
"data-testid": "preview-item-delete-button",
|
|
12033
12022
|
disabled: uploadState === "uploading",
|
|
12034
12023
|
...props,
|
|
12035
|
-
children: /* @__PURE__ */ jsx(
|
|
12024
|
+
children: /* @__PURE__ */ jsx(IconXmarkSmall, {})
|
|
12036
12025
|
}
|
|
12037
12026
|
);
|
|
12038
12027
|
};
|
|
@@ -13567,15 +13556,7 @@ const SwitchField = ({
|
|
|
13567
13556
|
ref: inputRef
|
|
13568
13557
|
}
|
|
13569
13558
|
),
|
|
13570
|
-
title ? /* @__PURE__ */ jsx(
|
|
13571
|
-
SwitchFieldLabel,
|
|
13572
|
-
{
|
|
13573
|
-
description,
|
|
13574
|
-
htmlFor: id,
|
|
13575
|
-
onClick: () => inputRef.current?.click(),
|
|
13576
|
-
title
|
|
13577
|
-
}
|
|
13578
|
-
) : children,
|
|
13559
|
+
title ? /* @__PURE__ */ jsx(SwitchFieldLabel, { description, htmlFor: id, title }) : children,
|
|
13579
13560
|
/* @__PURE__ */ jsx(
|
|
13580
13561
|
Switch,
|
|
13581
13562
|
{
|
|
@@ -14634,7 +14615,7 @@ const PollVoteTimestamp = ({ timestamp }) => {
|
|
|
14634
14615
|
const PollVoteAuthor = ({ vote }) => {
|
|
14635
14616
|
const { t } = useTranslationContext();
|
|
14636
14617
|
const { client } = useChatContext();
|
|
14637
|
-
const displayName = client.user?.id && client.user.id === vote.user?.id ? t("You") : vote.user?.name || t("Anonymous");
|
|
14618
|
+
const displayName = client.user?.id && client.user.id === vote.user?.id ? t("You") : vote.user?.name || vote.user?.id || t("Anonymous");
|
|
14638
14619
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__poll-vote__author", children: [
|
|
14639
14620
|
vote.user && /* @__PURE__ */ jsx(
|
|
14640
14621
|
Avatar,
|
|
@@ -16256,7 +16237,7 @@ const FileAttachmentPreview = ({
|
|
|
16256
16237
|
/* @__PURE__ */ jsx("span", { children: hasSizeLimitError ? t("File too large") : uploadState === "blocked" ? t("Upload blocked") : t("Upload failed") })
|
|
16257
16238
|
] }),
|
|
16258
16239
|
hasRetriableError && /* @__PURE__ */ jsxs("div", { className: "str-chat__attachment-preview-file__retriable-error", children: [
|
|
16259
|
-
/* @__PURE__ */ jsx(
|
|
16240
|
+
/* @__PURE__ */ jsx(IconExclamationTriangleFill, {}),
|
|
16260
16241
|
/* @__PURE__ */ jsx("span", { children: t("Upload error") }),
|
|
16261
16242
|
/* @__PURE__ */ jsx(
|
|
16262
16243
|
"button",
|
|
@@ -16476,7 +16457,7 @@ const ProgressBar = ({ className, progress, seek }) => {
|
|
|
16476
16457
|
{
|
|
16477
16458
|
className: "str-chat__message-attachment-audio-widget--progress-indicator",
|
|
16478
16459
|
ref: setProgressIndicator,
|
|
16479
|
-
style: {
|
|
16460
|
+
style: { insetInlineStart: `${indicatorLeft}px` }
|
|
16480
16461
|
}
|
|
16481
16462
|
)
|
|
16482
16463
|
}
|
|
@@ -16712,7 +16693,7 @@ const WaveProgressBar = ({
|
|
|
16712
16693
|
"data-testid": "wave-progress-bar-progress-indicator",
|
|
16713
16694
|
ref: setProgressIndicator,
|
|
16714
16695
|
style: {
|
|
16715
|
-
|
|
16696
|
+
insetInlineStart: `${indicatorLeft}px`
|
|
16716
16697
|
}
|
|
16717
16698
|
}
|
|
16718
16699
|
)
|
|
@@ -16811,7 +16792,7 @@ const AudioAttachmentPreview = ({
|
|
|
16811
16792
|
/* @__PURE__ */ jsx(IconExclamationMark, {}),
|
|
16812
16793
|
/* @__PURE__ */ jsx("span", { children: hasSizeLimitError ? t("File too large") : uploadState === "blocked" ? t("Upload blocked") : t("Upload failed") })
|
|
16813
16794
|
] }) : /* @__PURE__ */ jsxs("div", { className: "str-chat__attachment-preview-file__retriable-error", children: [
|
|
16814
|
-
/* @__PURE__ */ jsx(
|
|
16795
|
+
/* @__PURE__ */ jsx(IconExclamationTriangleFill, {}),
|
|
16815
16796
|
/* @__PURE__ */ jsx("span", { children: t("Upload error") }),
|
|
16816
16797
|
/* @__PURE__ */ jsx(
|
|
16817
16798
|
"button",
|
|
@@ -16854,7 +16835,7 @@ const MediaAttachmentPreview = ({
|
|
|
16854
16835
|
removeAttachments
|
|
16855
16836
|
}) => {
|
|
16856
16837
|
const { t } = useTranslationContext();
|
|
16857
|
-
const { BaseImage: BaseImage$1 = BaseImage, LoadingIndicator:
|
|
16838
|
+
const { BaseImage: BaseImage$1 = BaseImage, LoadingIndicator: LoadingIndicator$1 = LoadingIndicator } = useComponentContext();
|
|
16858
16839
|
const [thumbnailPreviewError, setThumbnailPreviewError] = useState(false);
|
|
16859
16840
|
const { id, uploadPermissionCheck, uploadState } = attachment.localMetadata ?? {};
|
|
16860
16841
|
const isUploading = uploadState === "uploading";
|
|
@@ -16905,7 +16886,7 @@ const MediaAttachmentPreview = ({
|
|
|
16905
16886
|
}
|
|
16906
16887
|
),
|
|
16907
16888
|
/* @__PURE__ */ jsxs("div", { className: clsx("str-chat__attachment-preview-media__overlay"), children: [
|
|
16908
|
-
isUploading && /* @__PURE__ */ jsx(
|
|
16889
|
+
isUploading && /* @__PURE__ */ jsx(LoadingIndicator$1, { "data-testid": "loading-indicator" }),
|
|
16909
16890
|
isVideoAttachment(attachment) && !hasUploadError && uploadState !== "uploading" && /* @__PURE__ */ jsxs("div", { className: "str-chat__attachment-preview-media__video-indicator", children: [
|
|
16910
16891
|
/* @__PURE__ */ jsx(IconVideoFill, {}),
|
|
16911
16892
|
attachment.duration && /* @__PURE__ */ jsx("div", { children: attachment.duration })
|
|
@@ -17456,7 +17437,7 @@ const CommandChip = ({ command }) => {
|
|
|
17456
17437
|
const { textareaRef } = useMessageComposerContext();
|
|
17457
17438
|
if (!command) return null;
|
|
17458
17439
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__command-chip", children: [
|
|
17459
|
-
/* @__PURE__ */ jsx(
|
|
17440
|
+
/* @__PURE__ */ jsx(IconBolt, {}),
|
|
17460
17441
|
/* @__PURE__ */ jsx("span", { children: command.name }),
|
|
17461
17442
|
/* @__PURE__ */ jsx(
|
|
17462
17443
|
"button",
|
|
@@ -18761,7 +18742,7 @@ const MessageComposerPreviews = () => {
|
|
|
18761
18742
|
{
|
|
18762
18743
|
message: editedMessage,
|
|
18763
18744
|
onCancel: () => {
|
|
18764
|
-
messageComposer
|
|
18745
|
+
restorePreEditSnapshot(messageComposer);
|
|
18765
18746
|
}
|
|
18766
18747
|
}
|
|
18767
18748
|
) }) : /* @__PURE__ */ jsx(QuotedMessagePreview$1, {}),
|
|
@@ -18997,8 +18978,7 @@ const getGroupChannelDisplayInfo = (channel) => {
|
|
|
18997
18978
|
memberList.push({ imageUrl: user.image, userName: user.name });
|
|
18998
18979
|
}
|
|
18999
18980
|
return {
|
|
19000
|
-
members: memberList
|
|
19001
|
-
overflowCount: memberList.length > 4 ? memberList.length - 2 : void 0
|
|
18981
|
+
members: memberList
|
|
19002
18982
|
};
|
|
19003
18983
|
};
|
|
19004
18984
|
function computeChannelDisplayName(channel, directMessageLabel) {
|
|
@@ -19204,7 +19184,7 @@ const useChat = ({
|
|
|
19204
19184
|
};
|
|
19205
19185
|
useEffect(() => {
|
|
19206
19186
|
if (!client) return;
|
|
19207
|
-
const version = "14.0.0-beta.
|
|
19187
|
+
const version = "14.0.0-beta.6";
|
|
19208
19188
|
const userAgent = client.getUserAgent();
|
|
19209
19189
|
if (!userAgent.includes("stream-chat-react")) {
|
|
19210
19190
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|
|
@@ -19338,7 +19318,7 @@ const ThreadHeaderSubtitle = ({
|
|
|
19338
19318
|
) });
|
|
19339
19319
|
};
|
|
19340
19320
|
const ThreadHeader = (props) => {
|
|
19341
|
-
const { closeThread, MenuIcon =
|
|
19321
|
+
const { closeThread, MenuIcon = IconSidebar, overrideTitle, thread } = props;
|
|
19342
19322
|
const { t } = useTranslationContext();
|
|
19343
19323
|
const { channel } = useChannelStateContext();
|
|
19344
19324
|
const { activeChatView } = useChatViewContext();
|
|
@@ -19348,7 +19328,7 @@ const ThreadHeader = (props) => {
|
|
|
19348
19328
|
const replyCount = threadInstance ? replyCountThreadInstance : thread ? thread.reply_count ?? 0 : 0;
|
|
19349
19329
|
const threadDisplayName = overrideTitle ?? channelDisplayTitle ?? displayNameFromParentMessage(thread) ?? void 0;
|
|
19350
19330
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__thread-header", children: [
|
|
19351
|
-
activeChatView === "threads" && /* @__PURE__ */ jsx(ToggleSidebarButton, { canCollapse: !!threadInstance, mode: "expand", children: /* @__PURE__ */ jsx(MenuIcon, {}) }),
|
|
19331
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__thread-header__start", children: activeChatView === "threads" && /* @__PURE__ */ jsx(ToggleSidebarButton, { canCollapse: !!threadInstance, mode: "expand", children: /* @__PURE__ */ jsx(MenuIcon, {}) }) }),
|
|
19352
19332
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__thread-header-details", children: [
|
|
19353
19333
|
/* @__PURE__ */ jsx("div", { className: "str-chat__thread-header-title", children: t("Thread") }),
|
|
19354
19334
|
/* @__PURE__ */ jsx(
|
|
@@ -19360,7 +19340,7 @@ const ThreadHeader = (props) => {
|
|
|
19360
19340
|
}
|
|
19361
19341
|
)
|
|
19362
19342
|
] }),
|
|
19363
|
-
!threadInstance && /* @__PURE__ */ jsx(
|
|
19343
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__thread-header__end", children: !threadInstance && /* @__PURE__ */ jsx(
|
|
19364
19344
|
Button,
|
|
19365
19345
|
{
|
|
19366
19346
|
appearance: "ghost",
|
|
@@ -19373,7 +19353,7 @@ const ThreadHeader = (props) => {
|
|
|
19373
19353
|
variant: "secondary",
|
|
19374
19354
|
children: /* @__PURE__ */ jsx(IconXmark, {})
|
|
19375
19355
|
}
|
|
19376
|
-
)
|
|
19356
|
+
) })
|
|
19377
19357
|
] });
|
|
19378
19358
|
};
|
|
19379
19359
|
const threadStateSelector = ({ replyCount }) => ({
|
|
@@ -19963,6 +19943,7 @@ const DefaultMessageActionComponents = {
|
|
|
19963
19943
|
className: msgActionsBoxButtonClassName,
|
|
19964
19944
|
Icon: IconEdit,
|
|
19965
19945
|
onClick: () => {
|
|
19946
|
+
savePreEditSnapshot(messageComposer);
|
|
19966
19947
|
messageComposer.initState({ composition: message });
|
|
19967
19948
|
closeMenu();
|
|
19968
19949
|
},
|
|
@@ -20338,9 +20319,9 @@ function MessageReactionsDetail({
|
|
|
20338
20319
|
handleFetchReactions,
|
|
20339
20320
|
onSelectedReactionTypeChange,
|
|
20340
20321
|
reactionDetailsSort: propReactionDetailsSort,
|
|
20322
|
+
reactionGroups,
|
|
20341
20323
|
reactions,
|
|
20342
20324
|
selectedReactionType,
|
|
20343
|
-
sortReactionDetails: propSortReactionDetails,
|
|
20344
20325
|
totalReactionCount
|
|
20345
20326
|
}) {
|
|
20346
20327
|
const { client } = useChatContext();
|
|
@@ -20352,10 +20333,8 @@ function MessageReactionsDetail({
|
|
|
20352
20333
|
const { t } = useTranslationContext();
|
|
20353
20334
|
const {
|
|
20354
20335
|
handleReaction: contextHandleReaction,
|
|
20355
|
-
reactionDetailsSort: contextReactionDetailsSort
|
|
20356
|
-
sortReactionDetails: contextSortReactionDetails
|
|
20336
|
+
reactionDetailsSort: contextReactionDetailsSort
|
|
20357
20337
|
} = useMessageContext(MessageReactionsDetail.name);
|
|
20358
|
-
const legacySortReactionDetails = propSortReactionDetails ?? contextSortReactionDetails;
|
|
20359
20338
|
const reactionDetailsSort = propReactionDetailsSort ?? contextReactionDetailsSort ?? defaultReactionDetailsSort;
|
|
20360
20339
|
const {
|
|
20361
20340
|
isLoading: areReactionsLoading,
|
|
@@ -20367,10 +20346,6 @@ function MessageReactionsDetail({
|
|
|
20367
20346
|
shouldFetch: true,
|
|
20368
20347
|
sort: reactionDetailsSort
|
|
20369
20348
|
});
|
|
20370
|
-
const reactionDetailsWithLegacyFallback = useMemo(
|
|
20371
|
-
() => legacySortReactionDetails ? [...reactionDetails].sort(legacySortReactionDetails) : reactionDetails,
|
|
20372
|
-
[legacySortReactionDetails, reactionDetails]
|
|
20373
|
-
);
|
|
20374
20349
|
return /* @__PURE__ */ jsxs(
|
|
20375
20350
|
"div",
|
|
20376
20351
|
{
|
|
@@ -20415,7 +20390,7 @@ function MessageReactionsDetail({
|
|
|
20415
20390
|
"data-testid": "all-reacting-users",
|
|
20416
20391
|
children: [
|
|
20417
20392
|
areReactionsLoading && /* @__PURE__ */ jsx(LoadingIndicator2, {}),
|
|
20418
|
-
!areReactionsLoading && /* @__PURE__ */ jsx(Fragment, { children:
|
|
20393
|
+
!areReactionsLoading && /* @__PURE__ */ jsx(Fragment, { children: reactionDetails.map(({ type, user }) => {
|
|
20419
20394
|
const belongsToCurrentUser = client.user?.id === user?.id;
|
|
20420
20395
|
const EmojiComponent = Array.isArray(reactionOptions) ? void 0 : reactionOptions.quick[type]?.Component ?? reactionOptions.extended?.[type]?.Component;
|
|
20421
20396
|
return /* @__PURE__ */ jsxs(
|
|
@@ -20448,8 +20423,13 @@ function MessageReactionsDetail({
|
|
|
20448
20423
|
className: "str-chat__message-reactions-detail__user-list-item-button",
|
|
20449
20424
|
"data-testid": "remove-reaction-button",
|
|
20450
20425
|
onClick: async (e) => {
|
|
20426
|
+
const reactionCountBeforeRemoval = reactionGroups?.[type]?.count ?? 0;
|
|
20451
20427
|
await contextHandleReaction(type, e);
|
|
20452
|
-
|
|
20428
|
+
if (reactionCountBeforeRemoval <= 1) {
|
|
20429
|
+
onSelectedReactionTypeChange?.(null);
|
|
20430
|
+
} else {
|
|
20431
|
+
refetch();
|
|
20432
|
+
}
|
|
20453
20433
|
},
|
|
20454
20434
|
children: t("Tap to remove")
|
|
20455
20435
|
}
|
|
@@ -20478,17 +20458,15 @@ const useProcessReactions = (params) => {
|
|
|
20478
20458
|
const {
|
|
20479
20459
|
own_reactions: propOwnReactions,
|
|
20480
20460
|
reaction_groups: propReactionGroups,
|
|
20481
|
-
reactionOptions: propReactionOptions,
|
|
20482
20461
|
reactions: propReactions,
|
|
20483
20462
|
sortReactions: propSortReactions
|
|
20484
20463
|
} = params;
|
|
20485
20464
|
const { message, sortReactions: contextSortReactions } = useMessageContext();
|
|
20486
|
-
const { reactionOptions
|
|
20487
|
-
const reactionOptions = propReactionOptions ?? contextReactionOptions;
|
|
20465
|
+
const { reactionOptions = defaultReactionOptions } = useComponentContext();
|
|
20488
20466
|
const sortReactions = propSortReactions ?? contextSortReactions ?? defaultReactionsSort;
|
|
20489
|
-
const latestReactions = propReactions
|
|
20490
|
-
const ownReactions = propOwnReactions
|
|
20491
|
-
const reactionGroups = propReactionGroups
|
|
20467
|
+
const latestReactions = propReactions ?? message.latest_reactions;
|
|
20468
|
+
const ownReactions = propOwnReactions ?? message?.own_reactions;
|
|
20469
|
+
const reactionGroups = propReactionGroups ?? message?.reaction_groups ?? void 0;
|
|
20492
20470
|
const isOwnReaction = useCallback(
|
|
20493
20471
|
(reactionType) => ownReactions?.some((reaction) => reaction.type === reactionType) ?? false,
|
|
20494
20472
|
[ownReactions]
|
|
@@ -20572,6 +20550,7 @@ const useProcessReactions = (params) => {
|
|
|
20572
20550
|
return {
|
|
20573
20551
|
existingReactions,
|
|
20574
20552
|
hasReactions,
|
|
20553
|
+
reactionGroups,
|
|
20575
20554
|
totalReactionCount,
|
|
20576
20555
|
uniqueReactionTypeCount
|
|
20577
20556
|
};
|
|
@@ -20588,16 +20567,22 @@ const FragmentOrButton = ({
|
|
|
20588
20567
|
};
|
|
20589
20568
|
const UnMemoizedMessageReactions = (props) => {
|
|
20590
20569
|
const {
|
|
20570
|
+
capLimit: { clustered: capLimitClustered = 5, segmented: capLimitSegmented = 4 } = {},
|
|
20591
20571
|
flipHorizontalPosition = false,
|
|
20592
20572
|
handleFetchReactions,
|
|
20593
20573
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20594
20574
|
reactionDetailsSort,
|
|
20595
|
-
sortReactionDetails,
|
|
20596
20575
|
verticalPosition = "top",
|
|
20597
20576
|
visualStyle = "clustered",
|
|
20598
20577
|
...rest
|
|
20599
20578
|
} = props;
|
|
20600
|
-
const {
|
|
20579
|
+
const {
|
|
20580
|
+
existingReactions,
|
|
20581
|
+
hasReactions,
|
|
20582
|
+
reactionGroups,
|
|
20583
|
+
totalReactionCount,
|
|
20584
|
+
uniqueReactionTypeCount
|
|
20585
|
+
} = useProcessReactions(rest);
|
|
20601
20586
|
const [selectedReactionType, setSelectedReactionType] = useState(
|
|
20602
20587
|
null
|
|
20603
20588
|
);
|
|
@@ -20616,16 +20601,27 @@ const UnMemoizedMessageReactions = (props) => {
|
|
|
20616
20601
|
dialog.open();
|
|
20617
20602
|
};
|
|
20618
20603
|
const cappedExistingReactions = useMemo(() => {
|
|
20619
|
-
if (visualStyle
|
|
20620
|
-
const
|
|
20604
|
+
if (visualStyle === "segmented" && verticalPosition !== "top") return null;
|
|
20605
|
+
const capLimit = visualStyle === "segmented" ? capLimitSegmented : capLimitClustered;
|
|
20606
|
+
const sliced = existingReactions.slice(0, capLimit);
|
|
20621
20607
|
return {
|
|
20608
|
+
/**
|
|
20609
|
+
* Accumulated reaction count of capped reaction types, first four in case of
|
|
20610
|
+
* segmented(top) and first five in case of clustered(top/bottom) variations.
|
|
20611
|
+
*/
|
|
20622
20612
|
reactionCountToDisplay: sliced.reduce(
|
|
20623
20613
|
(accumulatedCount, { reactionCount }) => accumulatedCount + reactionCount,
|
|
20624
20614
|
0
|
|
20625
20615
|
),
|
|
20626
20616
|
reactionsToDisplay: sliced
|
|
20627
20617
|
};
|
|
20628
|
-
}, [
|
|
20618
|
+
}, [
|
|
20619
|
+
capLimitClustered,
|
|
20620
|
+
capLimitSegmented,
|
|
20621
|
+
existingReactions,
|
|
20622
|
+
verticalPosition,
|
|
20623
|
+
visualStyle
|
|
20624
|
+
]);
|
|
20629
20625
|
if (!hasReactions) return null;
|
|
20630
20626
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20631
20627
|
/* @__PURE__ */ jsx(
|
|
@@ -20646,7 +20642,7 @@ const UnMemoizedMessageReactions = (props) => {
|
|
|
20646
20642
|
"aria-pressed": isDialogOpen,
|
|
20647
20643
|
buttonIf: visualStyle === "clustered",
|
|
20648
20644
|
className: "str-chat__message-reactions__list-button",
|
|
20649
|
-
onClick: () => handleReactionButtonClick(
|
|
20645
|
+
onClick: () => handleReactionButtonClick(null),
|
|
20650
20646
|
children: [
|
|
20651
20647
|
/* @__PURE__ */ jsxs("ul", { className: "str-chat__message-reactions__list", children: [
|
|
20652
20648
|
(cappedExistingReactions?.reactionsToDisplay ?? existingReactions).map(
|
|
@@ -20677,7 +20673,7 @@ const UnMemoizedMessageReactions = (props) => {
|
|
|
20677
20673
|
reactionType
|
|
20678
20674
|
)
|
|
20679
20675
|
),
|
|
20680
|
-
uniqueReactionTypeCount > 4 && cappedExistingReactions && /* @__PURE__ */ jsx("li", { className: "str-chat__message-reactions__list-item str-chat__message-reactions__list-item--more", children: /* @__PURE__ */ jsx(
|
|
20676
|
+
uniqueReactionTypeCount > 4 && cappedExistingReactions && visualStyle === "segmented" && /* @__PURE__ */ jsx("li", { className: "str-chat__message-reactions__list-item str-chat__message-reactions__list-item--more", children: /* @__PURE__ */ jsx(
|
|
20681
20677
|
"button",
|
|
20682
20678
|
{
|
|
20683
20679
|
className: "str-chat__message-reactions__list-item-button",
|
|
@@ -20710,9 +20706,9 @@ const UnMemoizedMessageReactions = (props) => {
|
|
|
20710
20706
|
{
|
|
20711
20707
|
handleFetchReactions,
|
|
20712
20708
|
onSelectedReactionTypeChange: setSelectedReactionType,
|
|
20709
|
+
reactionGroups,
|
|
20713
20710
|
reactions: existingReactions,
|
|
20714
20711
|
selectedReactionType,
|
|
20715
|
-
sortReactionDetails,
|
|
20716
20712
|
totalReactionCount
|
|
20717
20713
|
}
|
|
20718
20714
|
)
|
|
@@ -21193,7 +21189,6 @@ const Message = (props) => {
|
|
|
21193
21189
|
pinPermissions,
|
|
21194
21190
|
reactionDetailsSort,
|
|
21195
21191
|
retrySendMessage: propRetrySendMessage,
|
|
21196
|
-
sortReactionDetails,
|
|
21197
21192
|
sortReactions
|
|
21198
21193
|
} = props;
|
|
21199
21194
|
const { client } = useChatContext("Message");
|
|
@@ -21287,7 +21282,6 @@ const Message = (props) => {
|
|
|
21287
21282
|
readBy: props.readBy,
|
|
21288
21283
|
renderText: props.renderText,
|
|
21289
21284
|
returnAllReadData: props.returnAllReadData,
|
|
21290
|
-
sortReactionDetails,
|
|
21291
21285
|
sortReactions,
|
|
21292
21286
|
threadList: props.threadList,
|
|
21293
21287
|
unsafeHTML: props.unsafeHTML,
|
|
@@ -22333,7 +22327,6 @@ const InfiniteScroll = (props) => {
|
|
|
22333
22327
|
children
|
|
22334
22328
|
] });
|
|
22335
22329
|
};
|
|
22336
|
-
const MAX_AVATARS = 3;
|
|
22337
22330
|
const UnMemoizedTypingIndicator = (props) => {
|
|
22338
22331
|
const { isMessageListScrolledToBottom = true, scrollToBottom, threadList } = props;
|
|
22339
22332
|
const { channelConfig, thread } = useChannelStateContext("TypingIndicator");
|
|
@@ -22350,11 +22343,16 @@ const UnMemoizedTypingIndicator = (props) => {
|
|
|
22350
22343
|
const typingUsers = threadList ? typingInThread : typingInChannel;
|
|
22351
22344
|
const { displayUsers } = useDebouncedTypingActive(typingUsers);
|
|
22352
22345
|
const showIndicator = displayUsers.length > 0;
|
|
22353
|
-
const displayInfo =
|
|
22354
|
-
|
|
22355
|
-
|
|
22356
|
-
|
|
22357
|
-
|
|
22346
|
+
const displayInfo = useMemo(
|
|
22347
|
+
() => displayUsers.map(
|
|
22348
|
+
({ user }) => ({
|
|
22349
|
+
id: user?.id,
|
|
22350
|
+
imageUrl: user?.image,
|
|
22351
|
+
userName: user?.name
|
|
22352
|
+
})
|
|
22353
|
+
),
|
|
22354
|
+
[displayUsers]
|
|
22355
|
+
);
|
|
22358
22356
|
useEffect(() => {
|
|
22359
22357
|
if (showIndicator && isMessageListScrolledToBottom) scrollToBottom();
|
|
22360
22358
|
}, [scrollToBottom, isMessageListScrolledToBottom, showIndicator]);
|
|
@@ -22364,7 +22362,6 @@ const UnMemoizedTypingIndicator = (props) => {
|
|
|
22364
22362
|
if (!showIndicator || !isMessageListScrolledToBottom) {
|
|
22365
22363
|
return null;
|
|
22366
22364
|
}
|
|
22367
|
-
const overflowCount = displayUsers.length > MAX_AVATARS ? displayUsers.length - MAX_AVATARS : 0;
|
|
22368
22365
|
return /* @__PURE__ */ jsxs(
|
|
22369
22366
|
"div",
|
|
22370
22367
|
{
|
|
@@ -22377,15 +22374,7 @@ const UnMemoizedTypingIndicator = (props) => {
|
|
|
22377
22374
|
),
|
|
22378
22375
|
"data-testid": "typing-indicator",
|
|
22379
22376
|
children: [
|
|
22380
|
-
displayInfo.length > 0 && /* @__PURE__ */ jsx(
|
|
22381
|
-
AvatarStack,
|
|
22382
|
-
{
|
|
22383
|
-
badgeSize: "md",
|
|
22384
|
-
displayInfo,
|
|
22385
|
-
overflowCount: overflowCount > 0 ? overflowCount : void 0,
|
|
22386
|
-
size: "md"
|
|
22387
|
-
}
|
|
22388
|
-
),
|
|
22377
|
+
displayInfo.length > 0 && /* @__PURE__ */ jsx(AvatarStack, { badgeSize: "md", displayInfo, size: "md" }),
|
|
22389
22378
|
/* @__PURE__ */ jsx("div", { className: "str-chat__typing-indicator__bubble", children: /* @__PURE__ */ jsx("div", { className: "str-chat__typing-indicator__dots", children: /* @__PURE__ */ jsx(TypingIndicatorDots, {}) }) })
|
|
22390
22379
|
]
|
|
22391
22380
|
}
|
|
@@ -22916,7 +22905,6 @@ const MessageListWithContext = (props) => {
|
|
|
22916
22905
|
returnAllReadData = false,
|
|
22917
22906
|
reviewProcessedMessage,
|
|
22918
22907
|
showUnreadNotificationAlways,
|
|
22919
|
-
sortReactionDetails,
|
|
22920
22908
|
sortReactions,
|
|
22921
22909
|
suppressAutoscroll,
|
|
22922
22910
|
threadList = false,
|
|
@@ -23034,7 +23022,6 @@ const MessageListWithContext = (props) => {
|
|
|
23034
23022
|
renderText: props.renderText,
|
|
23035
23023
|
retrySendMessage: props.retrySendMessage,
|
|
23036
23024
|
showAvatar: props.showAvatar,
|
|
23037
|
-
sortReactionDetails,
|
|
23038
23025
|
sortReactions,
|
|
23039
23026
|
unsafeHTML
|
|
23040
23027
|
},
|
|
@@ -23329,7 +23316,6 @@ const messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
|
|
|
23329
23316
|
renderText: renderText2,
|
|
23330
23317
|
returnAllReadData,
|
|
23331
23318
|
showAvatar,
|
|
23332
|
-
sortReactionDetails,
|
|
23333
23319
|
sortReactions,
|
|
23334
23320
|
threadList,
|
|
23335
23321
|
unreadMessageCount = 0,
|
|
@@ -23379,7 +23365,6 @@ const messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
|
|
|
23379
23365
|
renderText: renderText2,
|
|
23380
23366
|
returnAllReadData,
|
|
23381
23367
|
showAvatar,
|
|
23382
|
-
sortReactionDetails,
|
|
23383
23368
|
sortReactions,
|
|
23384
23369
|
threadList
|
|
23385
23370
|
}
|
|
@@ -23464,7 +23449,6 @@ const VirtualizedMessageListWithContext = (props) => {
|
|
|
23464
23449
|
shouldGroupByUser = false,
|
|
23465
23450
|
showAvatar,
|
|
23466
23451
|
showUnreadNotificationAlways,
|
|
23467
|
-
sortReactionDetails,
|
|
23468
23452
|
sortReactions,
|
|
23469
23453
|
stickToBottomScrollBehavior = "smooth",
|
|
23470
23454
|
suppressAutoscroll,
|
|
@@ -23733,7 +23717,6 @@ const VirtualizedMessageListWithContext = (props) => {
|
|
|
23733
23717
|
returnAllReadData,
|
|
23734
23718
|
shouldGroupByUser,
|
|
23735
23719
|
showAvatar,
|
|
23736
|
-
sortReactionDetails,
|
|
23737
23720
|
sortReactions,
|
|
23738
23721
|
threadList,
|
|
23739
23722
|
unreadMessageCount: channelUnreadUiState?.unread_messages,
|
|
@@ -25072,7 +25055,7 @@ const LoadMorePaginator = React.memo(
|
|
|
25072
25055
|
UnMemoizedLoadMorePaginator
|
|
25073
25056
|
);
|
|
25074
25057
|
const ChannelListHeader = ({
|
|
25075
|
-
ToggleButtonIcon =
|
|
25058
|
+
ToggleButtonIcon = IconSidebar
|
|
25076
25059
|
}) => {
|
|
25077
25060
|
const { t } = useTranslationContext();
|
|
25078
25061
|
const { channel, navOpen } = useChatContext();
|
|
@@ -25244,11 +25227,11 @@ const UnMemoizedChannelList = (props) => {
|
|
|
25244
25227
|
}
|
|
25245
25228
|
);
|
|
25246
25229
|
const showChannelList = !searchIsActive;
|
|
25247
|
-
return /* @__PURE__ */ jsx(
|
|
25230
|
+
return /* @__PURE__ */ jsx(
|
|
25248
25231
|
ChannelListContextProvider,
|
|
25249
25232
|
{
|
|
25250
25233
|
value: { channels, hasNextPage, loadNextPage, setChannels },
|
|
25251
|
-
children: /* @__PURE__ */
|
|
25234
|
+
children: /* @__PURE__ */ jsx("div", { className, ref: channelListRef, children: /* @__PURE__ */ jsxs(DialogManagerProvider, { id: `channel-list-dialog-manager-${stableId}`, children: [
|
|
25252
25235
|
/* @__PURE__ */ jsx(ChannelListHeader, {}),
|
|
25253
25236
|
showChannelSearch && /* @__PURE__ */ jsx(Search$12, {}),
|
|
25254
25237
|
showChannelList && /* @__PURE__ */ jsx(
|
|
@@ -25270,9 +25253,9 @@ const UnMemoizedChannelList = (props) => {
|
|
|
25270
25253
|
}
|
|
25271
25254
|
),
|
|
25272
25255
|
/* @__PURE__ */ jsx(NotificationList$1, { panel: "channel-list" })
|
|
25273
|
-
] })
|
|
25256
|
+
] }) })
|
|
25274
25257
|
}
|
|
25275
|
-
)
|
|
25258
|
+
);
|
|
25276
25259
|
};
|
|
25277
25260
|
const ChannelList = React.memo(
|
|
25278
25261
|
UnMemoizedChannelList
|
|
@@ -25999,11 +25982,13 @@ function ChannelListItemTimestamp({ lastMessage }) {
|
|
|
25999
25982
|
function getAttachmentContentType(attachment) {
|
|
26000
25983
|
if (!attachment) return "text";
|
|
26001
25984
|
if (attachment.type === "giphy") return "giphy";
|
|
26002
|
-
if (attachment.type === "image")
|
|
25985
|
+
if (attachment.type === "image") {
|
|
25986
|
+
if (attachment.og_scrape_url || attachment.title_link) return "link";
|
|
25987
|
+
return "image";
|
|
25988
|
+
}
|
|
26003
25989
|
if (attachment.type === "video") return "video";
|
|
26004
25990
|
if (attachment.type === "voiceRecording") return "voice";
|
|
26005
25991
|
if (attachment.type === "file") return "file";
|
|
26006
|
-
if (attachment.og_scrape_url || attachment.title_link) return "link";
|
|
26007
25992
|
return "file";
|
|
26008
25993
|
}
|
|
26009
25994
|
function getAttachmentFallbackText(type, count, t) {
|
|
@@ -26083,13 +26068,13 @@ const useLatestMessagePreview = ({
|
|
|
26083
26068
|
} else {
|
|
26084
26069
|
contentType = "file";
|
|
26085
26070
|
}
|
|
26086
|
-
let text2 = contentType === "giphy" ? "
|
|
26071
|
+
let text2 = contentType === "giphy" ? `GIPHY ${firstAttachment.title ?? ""}`.trim() : (
|
|
26087
26072
|
// prioritize message text content if available
|
|
26088
26073
|
textContent || // then fallback text of the single attachment if only one attachment is present and it's not a voice recording (fallback text is generic for voice recordings, so not useful in the preview)
|
|
26089
26074
|
(attachments.length === 1 && contentType !== "voice" ? firstAttachment.fallback || firstAttachment.title : "") || // then generic fallback text based on attachment type and count
|
|
26090
26075
|
getAttachmentFallbackText(contentType, attachments.length, t)
|
|
26091
26076
|
);
|
|
26092
|
-
if (
|
|
26077
|
+
if (attachments.length === 1 && typeof firstAttachment.duration === "number") {
|
|
26093
26078
|
const minutes = Math.floor(firstAttachment.duration / 60);
|
|
26094
26079
|
const seconds = Math.ceil(firstAttachment.duration) % 60;
|
|
26095
26080
|
const durationString = `${minutes}:${seconds.toString().padStart(2, "0")}`;
|
|
@@ -26130,7 +26115,7 @@ const contentTypeIconMap = {
|
|
|
26130
26115
|
deleted: IconNoSign,
|
|
26131
26116
|
error: IconExclamationCircleFill,
|
|
26132
26117
|
file: IconFile,
|
|
26133
|
-
giphy:
|
|
26118
|
+
giphy: IconGiphy,
|
|
26134
26119
|
image: IconCamera,
|
|
26135
26120
|
link: IconLink,
|
|
26136
26121
|
location: IconLocation,
|
|
@@ -26232,7 +26217,6 @@ const UnMemoizedChannelListItemUI = (props) => {
|
|
|
26232
26217
|
{
|
|
26233
26218
|
displayMembers: groupChannelDisplayInfo?.members,
|
|
26234
26219
|
imageUrl: displayImage,
|
|
26235
|
-
overflowCount: groupChannelDisplayInfo?.overflowCount,
|
|
26236
26220
|
size: "xl",
|
|
26237
26221
|
userName: avatarName
|
|
26238
26222
|
}
|
|
@@ -26778,7 +26762,7 @@ const ThreadListLoadingIndicator = () => {
|
|
|
26778
26762
|
return /* @__PURE__ */ jsx("div", { className: "str-chat__thread-list-loading-indicator", children: /* @__PURE__ */ jsx(LoadingIndicator$1, {}) });
|
|
26779
26763
|
};
|
|
26780
26764
|
const ThreadListHeader = ({
|
|
26781
|
-
ToggleButtonIcon =
|
|
26765
|
+
ToggleButtonIcon = IconSidebar
|
|
26782
26766
|
}) => {
|
|
26783
26767
|
const { t } = useTranslationContext();
|
|
26784
26768
|
const { navOpen } = useChatContext();
|
|
@@ -26911,10 +26895,9 @@ const ThreadList = ({ virtuosoProps }) => {
|
|
|
26911
26895
|
const IconsBySeverity = {
|
|
26912
26896
|
error: IconExclamationMark,
|
|
26913
26897
|
info: null,
|
|
26914
|
-
// IconInfo,
|
|
26915
26898
|
loading: IconRefresh,
|
|
26916
26899
|
success: IconCheckmark,
|
|
26917
|
-
warning:
|
|
26900
|
+
warning: IconExclamationTriangleFill
|
|
26918
26901
|
};
|
|
26919
26902
|
const DefaultNotificationIcon = ({ notification }) => {
|
|
26920
26903
|
if (!notification.severity) return null;
|
|
@@ -27854,7 +27837,7 @@ const UnsupportedAttachment = ({ attachment }) => {
|
|
|
27854
27837
|
const VisibilityDisclaimer = () => {
|
|
27855
27838
|
const { t } = useTranslationContext();
|
|
27856
27839
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__visibility-disclaimer", children: [
|
|
27857
|
-
/* @__PURE__ */ jsx(
|
|
27840
|
+
/* @__PURE__ */ jsx(IconEyeFill, {}),
|
|
27858
27841
|
t("Only visible to you")
|
|
27859
27842
|
] });
|
|
27860
27843
|
};
|
|
@@ -28287,7 +28270,7 @@ const ChannelHeader = (props) => {
|
|
|
28287
28270
|
const {
|
|
28288
28271
|
Avatar: Avatar2 = ChannelAvatar,
|
|
28289
28272
|
image: overrideImage,
|
|
28290
|
-
MenuIcon =
|
|
28273
|
+
MenuIcon = IconSidebar,
|
|
28291
28274
|
title: overrideTitle
|
|
28292
28275
|
} = props;
|
|
28293
28276
|
const { channel } = useChannelStateContext();
|
|
@@ -28304,22 +28287,21 @@ const ChannelHeader = (props) => {
|
|
|
28304
28287
|
"str-chat__channel-header--sidebar-collapsed": !navOpen
|
|
28305
28288
|
}),
|
|
28306
28289
|
children: [
|
|
28307
|
-
/* @__PURE__ */ jsx(ToggleSidebarButton, { mode: "expand", children: /* @__PURE__ */ jsx(MenuIcon, {}) }),
|
|
28290
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__channel-header__start", children: /* @__PURE__ */ jsx(ToggleSidebarButton, { mode: "expand", children: /* @__PURE__ */ jsx(MenuIcon, {}) }) }),
|
|
28308
28291
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__channel-header__data", children: [
|
|
28309
28292
|
/* @__PURE__ */ jsx("div", { className: "str-chat__channel-header__data__title", children: displayTitle }),
|
|
28310
28293
|
/* @__PURE__ */ jsx(ChannelHeaderSubtitle, {})
|
|
28311
28294
|
] }),
|
|
28312
|
-
/* @__PURE__ */ jsx(
|
|
28295
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__channel-header__end", children: /* @__PURE__ */ jsx(
|
|
28313
28296
|
Avatar2,
|
|
28314
28297
|
{
|
|
28315
28298
|
className: "str-chat__avatar--channel-header",
|
|
28316
28299
|
displayMembers: groupChannelDisplayInfo?.members,
|
|
28317
28300
|
imageUrl: displayImage,
|
|
28318
|
-
overflowCount: groupChannelDisplayInfo?.overflowCount,
|
|
28319
28301
|
size: "lg",
|
|
28320
28302
|
userName: displayTitle
|
|
28321
28303
|
}
|
|
28322
|
-
)
|
|
28304
|
+
) })
|
|
28323
28305
|
]
|
|
28324
28306
|
}
|
|
28325
28307
|
);
|
|
@@ -28368,12 +28350,12 @@ export {
|
|
|
28368
28350
|
Card,
|
|
28369
28351
|
CardContainer,
|
|
28370
28352
|
bx as Channel,
|
|
28371
|
-
|
|
28372
|
-
|
|
28353
|
+
bY as ChannelActionContext,
|
|
28354
|
+
bZ as ChannelActionProvider,
|
|
28373
28355
|
ChannelAvatar,
|
|
28374
28356
|
ChannelHeader,
|
|
28375
28357
|
ChannelList,
|
|
28376
|
-
|
|
28358
|
+
b_ as ChannelListContext,
|
|
28377
28359
|
ChannelListContextProvider,
|
|
28378
28360
|
ChannelListItem,
|
|
28379
28361
|
ChannelListItemActionButtons,
|
|
@@ -28381,10 +28363,10 @@ export {
|
|
|
28381
28363
|
ChannelListItemUI,
|
|
28382
28364
|
ChannelListUI,
|
|
28383
28365
|
ChannelSearchResultItem,
|
|
28384
|
-
|
|
28385
|
-
|
|
28366
|
+
b$ as ChannelStateContext,
|
|
28367
|
+
c0 as ChannelStateProvider,
|
|
28386
28368
|
Chat,
|
|
28387
|
-
|
|
28369
|
+
c1 as ChatContext,
|
|
28388
28370
|
ChatProvider,
|
|
28389
28371
|
bz as ChatView,
|
|
28390
28372
|
bC as ChatViewChannelsSelectorButton,
|
|
@@ -28396,7 +28378,7 @@ export {
|
|
|
28396
28378
|
CommandChip,
|
|
28397
28379
|
CommandItem,
|
|
28398
28380
|
ComponentContext,
|
|
28399
|
-
|
|
28381
|
+
c2 as ComponentProvider,
|
|
28400
28382
|
ConnectionStatus,
|
|
28401
28383
|
ContextMenu,
|
|
28402
28384
|
ContextMenuBackButton,
|
|
@@ -28446,15 +28428,13 @@ export {
|
|
|
28446
28428
|
IconArrowDown,
|
|
28447
28429
|
IconArrowDownCircle,
|
|
28448
28430
|
IconArrowLeft,
|
|
28449
|
-
bG as IconArrowRight,
|
|
28450
28431
|
IconArrowUp,
|
|
28451
28432
|
IconArrowUpRight,
|
|
28452
28433
|
IconAttachment,
|
|
28453
28434
|
IconAudio,
|
|
28454
28435
|
IconBell,
|
|
28455
28436
|
IconBellOff,
|
|
28456
|
-
|
|
28457
|
-
bK as IconBubbleText6SolidChatMessage,
|
|
28437
|
+
IconBolt,
|
|
28458
28438
|
IconCamera,
|
|
28459
28439
|
IconCheckmark,
|
|
28460
28440
|
IconCheckmark1Small,
|
|
@@ -28465,32 +28445,26 @@ export {
|
|
|
28465
28445
|
IconClock,
|
|
28466
28446
|
IconCommand,
|
|
28467
28447
|
IconCopy,
|
|
28468
|
-
IconCrossSmall,
|
|
28469
28448
|
IconDelete,
|
|
28470
28449
|
IconEdit,
|
|
28471
28450
|
IconEmoji,
|
|
28472
28451
|
IconExclamationCircleFill,
|
|
28473
28452
|
IconExclamationMark,
|
|
28474
28453
|
IconExclamationMarkFill,
|
|
28475
|
-
|
|
28476
|
-
|
|
28454
|
+
IconExclamationTriangleFill,
|
|
28455
|
+
IconEyeFill,
|
|
28477
28456
|
IconFile,
|
|
28478
28457
|
IconFlag,
|
|
28479
28458
|
IconGiphy,
|
|
28480
28459
|
IconImage,
|
|
28481
|
-
bM as IconInfo,
|
|
28482
|
-
IconLayoutAlignLeft,
|
|
28483
28460
|
IconLeave,
|
|
28484
|
-
bN as IconLightBulbSimple,
|
|
28485
28461
|
IconLink,
|
|
28486
28462
|
IconLoading,
|
|
28487
28463
|
IconLocation,
|
|
28488
|
-
|
|
28489
|
-
|
|
28464
|
+
bG as IconMessageBubble,
|
|
28465
|
+
bH as IconMessageBubbleFill,
|
|
28490
28466
|
IconMessageBubbles,
|
|
28491
|
-
bP as IconMinus,
|
|
28492
28467
|
IconMinusCircle,
|
|
28493
|
-
bQ as IconMinusSmall,
|
|
28494
28468
|
IconMore,
|
|
28495
28469
|
IconMute,
|
|
28496
28470
|
IconNoSign,
|
|
@@ -28509,10 +28483,9 @@ export {
|
|
|
28509
28483
|
IconSave,
|
|
28510
28484
|
IconSearch,
|
|
28511
28485
|
IconSend,
|
|
28512
|
-
|
|
28486
|
+
IconSidebar,
|
|
28513
28487
|
IconThread,
|
|
28514
|
-
|
|
28515
|
-
IconThunder,
|
|
28488
|
+
bI as IconThreadFill,
|
|
28516
28489
|
IconTranslate,
|
|
28517
28490
|
IconTrophy,
|
|
28518
28491
|
IconUnpin,
|
|
@@ -28525,9 +28498,9 @@ export {
|
|
|
28525
28498
|
IconVideo,
|
|
28526
28499
|
IconVideoFill,
|
|
28527
28500
|
IconVoice,
|
|
28528
|
-
bO as IconVoiceFill,
|
|
28529
28501
|
IconXCircle,
|
|
28530
28502
|
IconXmark,
|
|
28503
|
+
IconXmarkSmall,
|
|
28531
28504
|
ImageComponent,
|
|
28532
28505
|
ImageContainer,
|
|
28533
28506
|
ImagePlaceholder,
|
|
@@ -28536,9 +28509,9 @@ export {
|
|
|
28536
28509
|
LinkPreviewList,
|
|
28537
28510
|
LoadMoreButton,
|
|
28538
28511
|
LoadMorePaginator,
|
|
28539
|
-
|
|
28512
|
+
bJ as LoadingChannel,
|
|
28540
28513
|
LoadingChannels,
|
|
28541
|
-
|
|
28514
|
+
bK as LoadingErrorIndicator,
|
|
28542
28515
|
LoadingIndicator,
|
|
28543
28516
|
LoadingIndicatorIcon,
|
|
28544
28517
|
MAX_MESSAGE_REACTIONS_TO_FETCH,
|
|
@@ -28553,7 +28526,7 @@ export {
|
|
|
28553
28526
|
MessageBouncePrompt,
|
|
28554
28527
|
MessageBounceProvider,
|
|
28555
28528
|
MessageComposer,
|
|
28556
|
-
|
|
28529
|
+
c3 as MessageComposerContext,
|
|
28557
28530
|
MessageComposerContextProvider,
|
|
28558
28531
|
MessageComposerUI,
|
|
28559
28532
|
MessageContext,
|
|
@@ -28586,7 +28559,7 @@ export {
|
|
|
28586
28559
|
NotificationList,
|
|
28587
28560
|
NotificationTranslationTopic,
|
|
28588
28561
|
NumericInput,
|
|
28589
|
-
|
|
28562
|
+
bL as OPTIONAL_MESSAGE_ACTIONS,
|
|
28590
28563
|
OtherFilesContainer,
|
|
28591
28564
|
PauseIcon,
|
|
28592
28565
|
PinIndicator,
|
|
@@ -28653,22 +28626,22 @@ export {
|
|
|
28653
28626
|
TextInputFieldSet,
|
|
28654
28627
|
TextareaComposer,
|
|
28655
28628
|
Thread,
|
|
28656
|
-
|
|
28629
|
+
bW as ThreadContext,
|
|
28657
28630
|
ThreadHeader,
|
|
28658
28631
|
ThreadList,
|
|
28659
28632
|
ThreadListItem,
|
|
28660
28633
|
ThreadListItemUI,
|
|
28661
|
-
|
|
28634
|
+
bX as ThreadProvider,
|
|
28662
28635
|
ThreadStart,
|
|
28663
28636
|
Tooltip,
|
|
28664
28637
|
TranslationBuilder,
|
|
28665
|
-
|
|
28638
|
+
c4 as TranslationContext,
|
|
28666
28639
|
TranslationProvider,
|
|
28667
28640
|
TranslationTopic,
|
|
28668
|
-
|
|
28641
|
+
c5 as TypingContext,
|
|
28669
28642
|
TypingIndicator,
|
|
28670
28643
|
TypingIndicatorHeader,
|
|
28671
|
-
|
|
28644
|
+
c6 as TypingProvider,
|
|
28672
28645
|
UNREAD_MESSAGE_SEPARATOR_CLASS,
|
|
28673
28646
|
UnMemoizedLoadMorePaginator,
|
|
28674
28647
|
UnreadMessagesNotification,
|
|
@@ -28726,21 +28699,21 @@ export {
|
|
|
28726
28699
|
getCssDimensionsVariables,
|
|
28727
28700
|
getGroupChannelDisplayInfo,
|
|
28728
28701
|
getGroupStyles,
|
|
28729
|
-
|
|
28702
|
+
bM as getImages,
|
|
28730
28703
|
getIsFirstUnreadMessage,
|
|
28731
28704
|
getLastReceived,
|
|
28732
28705
|
getLatestMessagePreview,
|
|
28733
28706
|
getMessageActions,
|
|
28734
|
-
|
|
28735
|
-
|
|
28736
|
-
|
|
28707
|
+
bN as getNonImageAttachments,
|
|
28708
|
+
bT as getNotificationTargetPanel,
|
|
28709
|
+
bU as getNotificationTargetTag,
|
|
28737
28710
|
getReadByTooltipText,
|
|
28738
28711
|
getTextareaCaretRect,
|
|
28739
28712
|
getTranslatedMessageText,
|
|
28740
28713
|
getWholeChar,
|
|
28741
28714
|
handleActionWarning,
|
|
28742
|
-
|
|
28743
|
-
|
|
28715
|
+
bQ as hasMoreMessagesProbably,
|
|
28716
|
+
bR as hasNotMoreMessages,
|
|
28744
28717
|
hiTranslations,
|
|
28745
28718
|
htmlToTextPlugin,
|
|
28746
28719
|
imageToLink,
|
|
@@ -28750,7 +28723,7 @@ export {
|
|
|
28750
28723
|
isChrome,
|
|
28751
28724
|
isDate,
|
|
28752
28725
|
isDateSeparatorMessage,
|
|
28753
|
-
|
|
28726
|
+
c7 as isDayOrMoment,
|
|
28754
28727
|
isFirefox,
|
|
28755
28728
|
isGalleryAttachmentType,
|
|
28756
28729
|
isIntroMessage,
|
|
@@ -28762,8 +28735,8 @@ export {
|
|
|
28762
28735
|
isMessageErrorRetryable,
|
|
28763
28736
|
isNetworkSendFailure,
|
|
28764
28737
|
isNotificationForPanel,
|
|
28765
|
-
|
|
28766
|
-
|
|
28738
|
+
bS as isNotificationTargetPanel,
|
|
28739
|
+
c8 as isNumberOrString,
|
|
28767
28740
|
isSafari,
|
|
28768
28741
|
isSvgAttachment,
|
|
28769
28742
|
isUserMuted,
|
|
@@ -28771,8 +28744,8 @@ export {
|
|
|
28771
28744
|
jaTranslations,
|
|
28772
28745
|
keepLineBreaksPlugin,
|
|
28773
28746
|
koTranslations,
|
|
28774
|
-
|
|
28775
|
-
|
|
28747
|
+
bP as makeDateMessageId,
|
|
28748
|
+
bO as makeIntroMessage,
|
|
28776
28749
|
mapEmojiMartData,
|
|
28777
28750
|
mapToUserNameOrId,
|
|
28778
28751
|
markDownRenderers,
|
|
@@ -28850,7 +28823,7 @@ export {
|
|
|
28850
28823
|
useFlagHandler,
|
|
28851
28824
|
useGalleryContext,
|
|
28852
28825
|
useLastReadData,
|
|
28853
|
-
|
|
28826
|
+
bV as useLegacyThreadContext,
|
|
28854
28827
|
useLiveLocationSharingManager,
|
|
28855
28828
|
useMarkUnreadHandler,
|
|
28856
28829
|
useMentionsHandler,
|