stream-chat-react 14.0.0-beta.4 → 14.0.0-beta.5
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.0c10cb67.js} +58 -90
- package/dist/cjs/WithAudioPlayback.0c10cb67.js.map +1 -0
- package/dist/cjs/emojis.js +1 -1
- package/dist/cjs/index.js +109 -138
- package/dist/cjs/index.js.map +1 -1
- package/dist/css/index.css +72 -53
- package/dist/css/index.css.map +1 -1
- package/dist/es/{WithAudioPlayback.89700cb5.mjs → WithAudioPlayback.e7821fd4.mjs} +149 -181
- package/dist/es/WithAudioPlayback.e7821fd4.mjs.map +1 -0
- package/dist/es/emojis.mjs +1 -1
- package/dist/es/index.mjs +169 -198
- package/dist/es/index.mjs.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/Dialog/service/DialogPortal.d.ts.map +1 -1
- package/dist/types/components/Form/SwitchField.d.ts.map +1 -1
- package/dist/types/components/Icons/icons.d.ts +6 -38
- 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/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 IconCrossSmall, _ 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 IconExclamationTriangle, 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 IconEyeOpen } from "./WithAudioPlayback.e7821fd4.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.e7821fd4.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"];
|
|
@@ -11177,6 +11155,7 @@ const useSubmitHandler = (props) => {
|
|
|
11177
11155
|
if (messageComposer.editedMessage && localMessage.type !== "error") {
|
|
11178
11156
|
try {
|
|
11179
11157
|
await editMessage(localMessage, sendOptions);
|
|
11158
|
+
discardPreEditSnapshot(messageComposer);
|
|
11180
11159
|
messageComposer.clear();
|
|
11181
11160
|
} catch (err) {
|
|
11182
11161
|
client.notifications.addError({
|
|
@@ -13567,15 +13546,7 @@ const SwitchField = ({
|
|
|
13567
13546
|
ref: inputRef
|
|
13568
13547
|
}
|
|
13569
13548
|
),
|
|
13570
|
-
title ? /* @__PURE__ */ jsx(
|
|
13571
|
-
SwitchFieldLabel,
|
|
13572
|
-
{
|
|
13573
|
-
description,
|
|
13574
|
-
htmlFor: id,
|
|
13575
|
-
onClick: () => inputRef.current?.click(),
|
|
13576
|
-
title
|
|
13577
|
-
}
|
|
13578
|
-
) : children,
|
|
13549
|
+
title ? /* @__PURE__ */ jsx(SwitchFieldLabel, { description, htmlFor: id, title }) : children,
|
|
13579
13550
|
/* @__PURE__ */ jsx(
|
|
13580
13551
|
Switch,
|
|
13581
13552
|
{
|
|
@@ -14634,7 +14605,7 @@ const PollVoteTimestamp = ({ timestamp }) => {
|
|
|
14634
14605
|
const PollVoteAuthor = ({ vote }) => {
|
|
14635
14606
|
const { t } = useTranslationContext();
|
|
14636
14607
|
const { client } = useChatContext();
|
|
14637
|
-
const displayName = client.user?.id && client.user.id === vote.user?.id ? t("You") : vote.user?.name || t("Anonymous");
|
|
14608
|
+
const displayName = client.user?.id && client.user.id === vote.user?.id ? t("You") : vote.user?.name || vote.user?.id || t("Anonymous");
|
|
14638
14609
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__poll-vote__author", children: [
|
|
14639
14610
|
vote.user && /* @__PURE__ */ jsx(
|
|
14640
14611
|
Avatar,
|
|
@@ -17456,7 +17427,7 @@ const CommandChip = ({ command }) => {
|
|
|
17456
17427
|
const { textareaRef } = useMessageComposerContext();
|
|
17457
17428
|
if (!command) return null;
|
|
17458
17429
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__command-chip", children: [
|
|
17459
|
-
/* @__PURE__ */ jsx(
|
|
17430
|
+
/* @__PURE__ */ jsx(IconBolt, {}),
|
|
17460
17431
|
/* @__PURE__ */ jsx("span", { children: command.name }),
|
|
17461
17432
|
/* @__PURE__ */ jsx(
|
|
17462
17433
|
"button",
|
|
@@ -18761,7 +18732,7 @@ const MessageComposerPreviews = () => {
|
|
|
18761
18732
|
{
|
|
18762
18733
|
message: editedMessage,
|
|
18763
18734
|
onCancel: () => {
|
|
18764
|
-
messageComposer
|
|
18735
|
+
restorePreEditSnapshot(messageComposer);
|
|
18765
18736
|
}
|
|
18766
18737
|
}
|
|
18767
18738
|
) }) : /* @__PURE__ */ jsx(QuotedMessagePreview$1, {}),
|
|
@@ -19204,7 +19175,7 @@ const useChat = ({
|
|
|
19204
19175
|
};
|
|
19205
19176
|
useEffect(() => {
|
|
19206
19177
|
if (!client) return;
|
|
19207
|
-
const version = "14.0.0-beta.
|
|
19178
|
+
const version = "14.0.0-beta.5";
|
|
19208
19179
|
const userAgent = client.getUserAgent();
|
|
19209
19180
|
if (!userAgent.includes("stream-chat-react")) {
|
|
19210
19181
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|
|
@@ -19338,7 +19309,7 @@ const ThreadHeaderSubtitle = ({
|
|
|
19338
19309
|
) });
|
|
19339
19310
|
};
|
|
19340
19311
|
const ThreadHeader = (props) => {
|
|
19341
|
-
const { closeThread, MenuIcon =
|
|
19312
|
+
const { closeThread, MenuIcon = IconSidebar, overrideTitle, thread } = props;
|
|
19342
19313
|
const { t } = useTranslationContext();
|
|
19343
19314
|
const { channel } = useChannelStateContext();
|
|
19344
19315
|
const { activeChatView } = useChatViewContext();
|
|
@@ -19348,7 +19319,7 @@ const ThreadHeader = (props) => {
|
|
|
19348
19319
|
const replyCount = threadInstance ? replyCountThreadInstance : thread ? thread.reply_count ?? 0 : 0;
|
|
19349
19320
|
const threadDisplayName = overrideTitle ?? channelDisplayTitle ?? displayNameFromParentMessage(thread) ?? void 0;
|
|
19350
19321
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__thread-header", children: [
|
|
19351
|
-
activeChatView === "threads" && /* @__PURE__ */ jsx(ToggleSidebarButton, { canCollapse: !!threadInstance, mode: "expand", children: /* @__PURE__ */ jsx(MenuIcon, {}) }),
|
|
19322
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__thread-header__start", children: activeChatView === "threads" && /* @__PURE__ */ jsx(ToggleSidebarButton, { canCollapse: !!threadInstance, mode: "expand", children: /* @__PURE__ */ jsx(MenuIcon, {}) }) }),
|
|
19352
19323
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__thread-header-details", children: [
|
|
19353
19324
|
/* @__PURE__ */ jsx("div", { className: "str-chat__thread-header-title", children: t("Thread") }),
|
|
19354
19325
|
/* @__PURE__ */ jsx(
|
|
@@ -19360,7 +19331,7 @@ const ThreadHeader = (props) => {
|
|
|
19360
19331
|
}
|
|
19361
19332
|
)
|
|
19362
19333
|
] }),
|
|
19363
|
-
!threadInstance && /* @__PURE__ */ jsx(
|
|
19334
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__thread-header__end", children: !threadInstance && /* @__PURE__ */ jsx(
|
|
19364
19335
|
Button,
|
|
19365
19336
|
{
|
|
19366
19337
|
appearance: "ghost",
|
|
@@ -19373,7 +19344,7 @@ const ThreadHeader = (props) => {
|
|
|
19373
19344
|
variant: "secondary",
|
|
19374
19345
|
children: /* @__PURE__ */ jsx(IconXmark, {})
|
|
19375
19346
|
}
|
|
19376
|
-
)
|
|
19347
|
+
) })
|
|
19377
19348
|
] });
|
|
19378
19349
|
};
|
|
19379
19350
|
const threadStateSelector = ({ replyCount }) => ({
|
|
@@ -19963,6 +19934,7 @@ const DefaultMessageActionComponents = {
|
|
|
19963
19934
|
className: msgActionsBoxButtonClassName,
|
|
19964
19935
|
Icon: IconEdit,
|
|
19965
19936
|
onClick: () => {
|
|
19937
|
+
savePreEditSnapshot(messageComposer);
|
|
19966
19938
|
messageComposer.initState({ composition: message });
|
|
19967
19939
|
closeMenu();
|
|
19968
19940
|
},
|
|
@@ -20338,9 +20310,9 @@ function MessageReactionsDetail({
|
|
|
20338
20310
|
handleFetchReactions,
|
|
20339
20311
|
onSelectedReactionTypeChange,
|
|
20340
20312
|
reactionDetailsSort: propReactionDetailsSort,
|
|
20313
|
+
reactionGroups,
|
|
20341
20314
|
reactions,
|
|
20342
20315
|
selectedReactionType,
|
|
20343
|
-
sortReactionDetails: propSortReactionDetails,
|
|
20344
20316
|
totalReactionCount
|
|
20345
20317
|
}) {
|
|
20346
20318
|
const { client } = useChatContext();
|
|
@@ -20352,10 +20324,8 @@ function MessageReactionsDetail({
|
|
|
20352
20324
|
const { t } = useTranslationContext();
|
|
20353
20325
|
const {
|
|
20354
20326
|
handleReaction: contextHandleReaction,
|
|
20355
|
-
reactionDetailsSort: contextReactionDetailsSort
|
|
20356
|
-
sortReactionDetails: contextSortReactionDetails
|
|
20327
|
+
reactionDetailsSort: contextReactionDetailsSort
|
|
20357
20328
|
} = useMessageContext(MessageReactionsDetail.name);
|
|
20358
|
-
const legacySortReactionDetails = propSortReactionDetails ?? contextSortReactionDetails;
|
|
20359
20329
|
const reactionDetailsSort = propReactionDetailsSort ?? contextReactionDetailsSort ?? defaultReactionDetailsSort;
|
|
20360
20330
|
const {
|
|
20361
20331
|
isLoading: areReactionsLoading,
|
|
@@ -20367,10 +20337,6 @@ function MessageReactionsDetail({
|
|
|
20367
20337
|
shouldFetch: true,
|
|
20368
20338
|
sort: reactionDetailsSort
|
|
20369
20339
|
});
|
|
20370
|
-
const reactionDetailsWithLegacyFallback = useMemo(
|
|
20371
|
-
() => legacySortReactionDetails ? [...reactionDetails].sort(legacySortReactionDetails) : reactionDetails,
|
|
20372
|
-
[legacySortReactionDetails, reactionDetails]
|
|
20373
|
-
);
|
|
20374
20340
|
return /* @__PURE__ */ jsxs(
|
|
20375
20341
|
"div",
|
|
20376
20342
|
{
|
|
@@ -20415,7 +20381,7 @@ function MessageReactionsDetail({
|
|
|
20415
20381
|
"data-testid": "all-reacting-users",
|
|
20416
20382
|
children: [
|
|
20417
20383
|
areReactionsLoading && /* @__PURE__ */ jsx(LoadingIndicator2, {}),
|
|
20418
|
-
!areReactionsLoading && /* @__PURE__ */ jsx(Fragment, { children:
|
|
20384
|
+
!areReactionsLoading && /* @__PURE__ */ jsx(Fragment, { children: reactionDetails.map(({ type, user }) => {
|
|
20419
20385
|
const belongsToCurrentUser = client.user?.id === user?.id;
|
|
20420
20386
|
const EmojiComponent = Array.isArray(reactionOptions) ? void 0 : reactionOptions.quick[type]?.Component ?? reactionOptions.extended?.[type]?.Component;
|
|
20421
20387
|
return /* @__PURE__ */ jsxs(
|
|
@@ -20448,8 +20414,13 @@ function MessageReactionsDetail({
|
|
|
20448
20414
|
className: "str-chat__message-reactions-detail__user-list-item-button",
|
|
20449
20415
|
"data-testid": "remove-reaction-button",
|
|
20450
20416
|
onClick: async (e) => {
|
|
20417
|
+
const reactionCountBeforeRemoval = reactionGroups?.[type]?.count ?? 0;
|
|
20451
20418
|
await contextHandleReaction(type, e);
|
|
20452
|
-
|
|
20419
|
+
if (reactionCountBeforeRemoval <= 1) {
|
|
20420
|
+
onSelectedReactionTypeChange?.(null);
|
|
20421
|
+
} else {
|
|
20422
|
+
refetch();
|
|
20423
|
+
}
|
|
20453
20424
|
},
|
|
20454
20425
|
children: t("Tap to remove")
|
|
20455
20426
|
}
|
|
@@ -20478,17 +20449,15 @@ const useProcessReactions = (params) => {
|
|
|
20478
20449
|
const {
|
|
20479
20450
|
own_reactions: propOwnReactions,
|
|
20480
20451
|
reaction_groups: propReactionGroups,
|
|
20481
|
-
reactionOptions: propReactionOptions,
|
|
20482
20452
|
reactions: propReactions,
|
|
20483
20453
|
sortReactions: propSortReactions
|
|
20484
20454
|
} = params;
|
|
20485
20455
|
const { message, sortReactions: contextSortReactions } = useMessageContext();
|
|
20486
|
-
const { reactionOptions
|
|
20487
|
-
const reactionOptions = propReactionOptions ?? contextReactionOptions;
|
|
20456
|
+
const { reactionOptions = defaultReactionOptions } = useComponentContext();
|
|
20488
20457
|
const sortReactions = propSortReactions ?? contextSortReactions ?? defaultReactionsSort;
|
|
20489
|
-
const latestReactions = propReactions
|
|
20490
|
-
const ownReactions = propOwnReactions
|
|
20491
|
-
const reactionGroups = propReactionGroups
|
|
20458
|
+
const latestReactions = propReactions ?? message.latest_reactions;
|
|
20459
|
+
const ownReactions = propOwnReactions ?? message?.own_reactions;
|
|
20460
|
+
const reactionGroups = propReactionGroups ?? message?.reaction_groups ?? void 0;
|
|
20492
20461
|
const isOwnReaction = useCallback(
|
|
20493
20462
|
(reactionType) => ownReactions?.some((reaction) => reaction.type === reactionType) ?? false,
|
|
20494
20463
|
[ownReactions]
|
|
@@ -20572,6 +20541,7 @@ const useProcessReactions = (params) => {
|
|
|
20572
20541
|
return {
|
|
20573
20542
|
existingReactions,
|
|
20574
20543
|
hasReactions,
|
|
20544
|
+
reactionGroups,
|
|
20575
20545
|
totalReactionCount,
|
|
20576
20546
|
uniqueReactionTypeCount
|
|
20577
20547
|
};
|
|
@@ -20588,16 +20558,22 @@ const FragmentOrButton = ({
|
|
|
20588
20558
|
};
|
|
20589
20559
|
const UnMemoizedMessageReactions = (props) => {
|
|
20590
20560
|
const {
|
|
20561
|
+
capLimit: { clustered: capLimitClustered = 5, segmented: capLimitSegmented = 4 } = {},
|
|
20591
20562
|
flipHorizontalPosition = false,
|
|
20592
20563
|
handleFetchReactions,
|
|
20593
20564
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20594
20565
|
reactionDetailsSort,
|
|
20595
|
-
sortReactionDetails,
|
|
20596
20566
|
verticalPosition = "top",
|
|
20597
20567
|
visualStyle = "clustered",
|
|
20598
20568
|
...rest
|
|
20599
20569
|
} = props;
|
|
20600
|
-
const {
|
|
20570
|
+
const {
|
|
20571
|
+
existingReactions,
|
|
20572
|
+
hasReactions,
|
|
20573
|
+
reactionGroups,
|
|
20574
|
+
totalReactionCount,
|
|
20575
|
+
uniqueReactionTypeCount
|
|
20576
|
+
} = useProcessReactions(rest);
|
|
20601
20577
|
const [selectedReactionType, setSelectedReactionType] = useState(
|
|
20602
20578
|
null
|
|
20603
20579
|
);
|
|
@@ -20616,16 +20592,27 @@ const UnMemoizedMessageReactions = (props) => {
|
|
|
20616
20592
|
dialog.open();
|
|
20617
20593
|
};
|
|
20618
20594
|
const cappedExistingReactions = useMemo(() => {
|
|
20619
|
-
if (visualStyle
|
|
20620
|
-
const
|
|
20595
|
+
if (visualStyle === "segmented" && verticalPosition !== "top") return null;
|
|
20596
|
+
const capLimit = visualStyle === "segmented" ? capLimitSegmented : capLimitClustered;
|
|
20597
|
+
const sliced = existingReactions.slice(0, capLimit);
|
|
20621
20598
|
return {
|
|
20599
|
+
/**
|
|
20600
|
+
* Accumulated reaction count of capped reaction types, first four in case of
|
|
20601
|
+
* segmented(top) and first five in case of clustered(top/bottom) variations.
|
|
20602
|
+
*/
|
|
20622
20603
|
reactionCountToDisplay: sliced.reduce(
|
|
20623
20604
|
(accumulatedCount, { reactionCount }) => accumulatedCount + reactionCount,
|
|
20624
20605
|
0
|
|
20625
20606
|
),
|
|
20626
20607
|
reactionsToDisplay: sliced
|
|
20627
20608
|
};
|
|
20628
|
-
}, [
|
|
20609
|
+
}, [
|
|
20610
|
+
capLimitClustered,
|
|
20611
|
+
capLimitSegmented,
|
|
20612
|
+
existingReactions,
|
|
20613
|
+
verticalPosition,
|
|
20614
|
+
visualStyle
|
|
20615
|
+
]);
|
|
20629
20616
|
if (!hasReactions) return null;
|
|
20630
20617
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20631
20618
|
/* @__PURE__ */ jsx(
|
|
@@ -20646,7 +20633,7 @@ const UnMemoizedMessageReactions = (props) => {
|
|
|
20646
20633
|
"aria-pressed": isDialogOpen,
|
|
20647
20634
|
buttonIf: visualStyle === "clustered",
|
|
20648
20635
|
className: "str-chat__message-reactions__list-button",
|
|
20649
|
-
onClick: () => handleReactionButtonClick(
|
|
20636
|
+
onClick: () => handleReactionButtonClick(null),
|
|
20650
20637
|
children: [
|
|
20651
20638
|
/* @__PURE__ */ jsxs("ul", { className: "str-chat__message-reactions__list", children: [
|
|
20652
20639
|
(cappedExistingReactions?.reactionsToDisplay ?? existingReactions).map(
|
|
@@ -20677,7 +20664,7 @@ const UnMemoizedMessageReactions = (props) => {
|
|
|
20677
20664
|
reactionType
|
|
20678
20665
|
)
|
|
20679
20666
|
),
|
|
20680
|
-
uniqueReactionTypeCount > 4 && cappedExistingReactions && /* @__PURE__ */ jsx("li", { className: "str-chat__message-reactions__list-item str-chat__message-reactions__list-item--more", children: /* @__PURE__ */ jsx(
|
|
20667
|
+
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
20668
|
"button",
|
|
20682
20669
|
{
|
|
20683
20670
|
className: "str-chat__message-reactions__list-item-button",
|
|
@@ -20710,9 +20697,9 @@ const UnMemoizedMessageReactions = (props) => {
|
|
|
20710
20697
|
{
|
|
20711
20698
|
handleFetchReactions,
|
|
20712
20699
|
onSelectedReactionTypeChange: setSelectedReactionType,
|
|
20700
|
+
reactionGroups,
|
|
20713
20701
|
reactions: existingReactions,
|
|
20714
20702
|
selectedReactionType,
|
|
20715
|
-
sortReactionDetails,
|
|
20716
20703
|
totalReactionCount
|
|
20717
20704
|
}
|
|
20718
20705
|
)
|
|
@@ -21193,7 +21180,6 @@ const Message = (props) => {
|
|
|
21193
21180
|
pinPermissions,
|
|
21194
21181
|
reactionDetailsSort,
|
|
21195
21182
|
retrySendMessage: propRetrySendMessage,
|
|
21196
|
-
sortReactionDetails,
|
|
21197
21183
|
sortReactions
|
|
21198
21184
|
} = props;
|
|
21199
21185
|
const { client } = useChatContext("Message");
|
|
@@ -21287,7 +21273,6 @@ const Message = (props) => {
|
|
|
21287
21273
|
readBy: props.readBy,
|
|
21288
21274
|
renderText: props.renderText,
|
|
21289
21275
|
returnAllReadData: props.returnAllReadData,
|
|
21290
|
-
sortReactionDetails,
|
|
21291
21276
|
sortReactions,
|
|
21292
21277
|
threadList: props.threadList,
|
|
21293
21278
|
unsafeHTML: props.unsafeHTML,
|
|
@@ -22916,7 +22901,6 @@ const MessageListWithContext = (props) => {
|
|
|
22916
22901
|
returnAllReadData = false,
|
|
22917
22902
|
reviewProcessedMessage,
|
|
22918
22903
|
showUnreadNotificationAlways,
|
|
22919
|
-
sortReactionDetails,
|
|
22920
22904
|
sortReactions,
|
|
22921
22905
|
suppressAutoscroll,
|
|
22922
22906
|
threadList = false,
|
|
@@ -23034,7 +23018,6 @@ const MessageListWithContext = (props) => {
|
|
|
23034
23018
|
renderText: props.renderText,
|
|
23035
23019
|
retrySendMessage: props.retrySendMessage,
|
|
23036
23020
|
showAvatar: props.showAvatar,
|
|
23037
|
-
sortReactionDetails,
|
|
23038
23021
|
sortReactions,
|
|
23039
23022
|
unsafeHTML
|
|
23040
23023
|
},
|
|
@@ -23329,7 +23312,6 @@ const messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
|
|
|
23329
23312
|
renderText: renderText2,
|
|
23330
23313
|
returnAllReadData,
|
|
23331
23314
|
showAvatar,
|
|
23332
|
-
sortReactionDetails,
|
|
23333
23315
|
sortReactions,
|
|
23334
23316
|
threadList,
|
|
23335
23317
|
unreadMessageCount = 0,
|
|
@@ -23379,7 +23361,6 @@ const messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
|
|
|
23379
23361
|
renderText: renderText2,
|
|
23380
23362
|
returnAllReadData,
|
|
23381
23363
|
showAvatar,
|
|
23382
|
-
sortReactionDetails,
|
|
23383
23364
|
sortReactions,
|
|
23384
23365
|
threadList
|
|
23385
23366
|
}
|
|
@@ -23464,7 +23445,6 @@ const VirtualizedMessageListWithContext = (props) => {
|
|
|
23464
23445
|
shouldGroupByUser = false,
|
|
23465
23446
|
showAvatar,
|
|
23466
23447
|
showUnreadNotificationAlways,
|
|
23467
|
-
sortReactionDetails,
|
|
23468
23448
|
sortReactions,
|
|
23469
23449
|
stickToBottomScrollBehavior = "smooth",
|
|
23470
23450
|
suppressAutoscroll,
|
|
@@ -23733,7 +23713,6 @@ const VirtualizedMessageListWithContext = (props) => {
|
|
|
23733
23713
|
returnAllReadData,
|
|
23734
23714
|
shouldGroupByUser,
|
|
23735
23715
|
showAvatar,
|
|
23736
|
-
sortReactionDetails,
|
|
23737
23716
|
sortReactions,
|
|
23738
23717
|
threadList,
|
|
23739
23718
|
unreadMessageCount: channelUnreadUiState?.unread_messages,
|
|
@@ -25072,7 +25051,7 @@ const LoadMorePaginator = React.memo(
|
|
|
25072
25051
|
UnMemoizedLoadMorePaginator
|
|
25073
25052
|
);
|
|
25074
25053
|
const ChannelListHeader = ({
|
|
25075
|
-
ToggleButtonIcon =
|
|
25054
|
+
ToggleButtonIcon = IconSidebar
|
|
25076
25055
|
}) => {
|
|
25077
25056
|
const { t } = useTranslationContext();
|
|
25078
25057
|
const { channel, navOpen } = useChatContext();
|
|
@@ -25244,11 +25223,11 @@ const UnMemoizedChannelList = (props) => {
|
|
|
25244
25223
|
}
|
|
25245
25224
|
);
|
|
25246
25225
|
const showChannelList = !searchIsActive;
|
|
25247
|
-
return /* @__PURE__ */ jsx(
|
|
25226
|
+
return /* @__PURE__ */ jsx(
|
|
25248
25227
|
ChannelListContextProvider,
|
|
25249
25228
|
{
|
|
25250
25229
|
value: { channels, hasNextPage, loadNextPage, setChannels },
|
|
25251
|
-
children: /* @__PURE__ */
|
|
25230
|
+
children: /* @__PURE__ */ jsx("div", { className, ref: channelListRef, children: /* @__PURE__ */ jsxs(DialogManagerProvider, { id: `channel-list-dialog-manager-${stableId}`, children: [
|
|
25252
25231
|
/* @__PURE__ */ jsx(ChannelListHeader, {}),
|
|
25253
25232
|
showChannelSearch && /* @__PURE__ */ jsx(Search$12, {}),
|
|
25254
25233
|
showChannelList && /* @__PURE__ */ jsx(
|
|
@@ -25270,9 +25249,9 @@ const UnMemoizedChannelList = (props) => {
|
|
|
25270
25249
|
}
|
|
25271
25250
|
),
|
|
25272
25251
|
/* @__PURE__ */ jsx(NotificationList$1, { panel: "channel-list" })
|
|
25273
|
-
] })
|
|
25252
|
+
] }) })
|
|
25274
25253
|
}
|
|
25275
|
-
)
|
|
25254
|
+
);
|
|
25276
25255
|
};
|
|
25277
25256
|
const ChannelList = React.memo(
|
|
25278
25257
|
UnMemoizedChannelList
|
|
@@ -25999,11 +25978,13 @@ function ChannelListItemTimestamp({ lastMessage }) {
|
|
|
25999
25978
|
function getAttachmentContentType(attachment) {
|
|
26000
25979
|
if (!attachment) return "text";
|
|
26001
25980
|
if (attachment.type === "giphy") return "giphy";
|
|
26002
|
-
if (attachment.type === "image")
|
|
25981
|
+
if (attachment.type === "image") {
|
|
25982
|
+
if (attachment.og_scrape_url || attachment.title_link) return "link";
|
|
25983
|
+
return "image";
|
|
25984
|
+
}
|
|
26003
25985
|
if (attachment.type === "video") return "video";
|
|
26004
25986
|
if (attachment.type === "voiceRecording") return "voice";
|
|
26005
25987
|
if (attachment.type === "file") return "file";
|
|
26006
|
-
if (attachment.og_scrape_url || attachment.title_link) return "link";
|
|
26007
25988
|
return "file";
|
|
26008
25989
|
}
|
|
26009
25990
|
function getAttachmentFallbackText(type, count, t) {
|
|
@@ -26083,13 +26064,13 @@ const useLatestMessagePreview = ({
|
|
|
26083
26064
|
} else {
|
|
26084
26065
|
contentType = "file";
|
|
26085
26066
|
}
|
|
26086
|
-
let text2 = contentType === "giphy" ? "
|
|
26067
|
+
let text2 = contentType === "giphy" ? `GIPHY ${firstAttachment.title ?? ""}`.trim() : (
|
|
26087
26068
|
// prioritize message text content if available
|
|
26088
26069
|
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
26070
|
(attachments.length === 1 && contentType !== "voice" ? firstAttachment.fallback || firstAttachment.title : "") || // then generic fallback text based on attachment type and count
|
|
26090
26071
|
getAttachmentFallbackText(contentType, attachments.length, t)
|
|
26091
26072
|
);
|
|
26092
|
-
if (
|
|
26073
|
+
if (attachments.length === 1 && typeof firstAttachment.duration === "number") {
|
|
26093
26074
|
const minutes = Math.floor(firstAttachment.duration / 60);
|
|
26094
26075
|
const seconds = Math.ceil(firstAttachment.duration) % 60;
|
|
26095
26076
|
const durationString = `${minutes}:${seconds.toString().padStart(2, "0")}`;
|
|
@@ -26130,7 +26111,7 @@ const contentTypeIconMap = {
|
|
|
26130
26111
|
deleted: IconNoSign,
|
|
26131
26112
|
error: IconExclamationCircleFill,
|
|
26132
26113
|
file: IconFile,
|
|
26133
|
-
giphy:
|
|
26114
|
+
giphy: IconGiphy,
|
|
26134
26115
|
image: IconCamera,
|
|
26135
26116
|
link: IconLink,
|
|
26136
26117
|
location: IconLocation,
|
|
@@ -26778,7 +26759,7 @@ const ThreadListLoadingIndicator = () => {
|
|
|
26778
26759
|
return /* @__PURE__ */ jsx("div", { className: "str-chat__thread-list-loading-indicator", children: /* @__PURE__ */ jsx(LoadingIndicator$1, {}) });
|
|
26779
26760
|
};
|
|
26780
26761
|
const ThreadListHeader = ({
|
|
26781
|
-
ToggleButtonIcon =
|
|
26762
|
+
ToggleButtonIcon = IconSidebar
|
|
26782
26763
|
}) => {
|
|
26783
26764
|
const { t } = useTranslationContext();
|
|
26784
26765
|
const { navOpen } = useChatContext();
|
|
@@ -26911,7 +26892,6 @@ const ThreadList = ({ virtuosoProps }) => {
|
|
|
26911
26892
|
const IconsBySeverity = {
|
|
26912
26893
|
error: IconExclamationMark,
|
|
26913
26894
|
info: null,
|
|
26914
|
-
// IconInfo,
|
|
26915
26895
|
loading: IconRefresh,
|
|
26916
26896
|
success: IconCheckmark,
|
|
26917
26897
|
warning: IconExclamationTriangle
|
|
@@ -28287,7 +28267,7 @@ const ChannelHeader = (props) => {
|
|
|
28287
28267
|
const {
|
|
28288
28268
|
Avatar: Avatar2 = ChannelAvatar,
|
|
28289
28269
|
image: overrideImage,
|
|
28290
|
-
MenuIcon =
|
|
28270
|
+
MenuIcon = IconSidebar,
|
|
28291
28271
|
title: overrideTitle
|
|
28292
28272
|
} = props;
|
|
28293
28273
|
const { channel } = useChannelStateContext();
|
|
@@ -28304,12 +28284,12 @@ const ChannelHeader = (props) => {
|
|
|
28304
28284
|
"str-chat__channel-header--sidebar-collapsed": !navOpen
|
|
28305
28285
|
}),
|
|
28306
28286
|
children: [
|
|
28307
|
-
/* @__PURE__ */ jsx(ToggleSidebarButton, { mode: "expand", children: /* @__PURE__ */ jsx(MenuIcon, {}) }),
|
|
28287
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__channel-header__start", children: /* @__PURE__ */ jsx(ToggleSidebarButton, { mode: "expand", children: /* @__PURE__ */ jsx(MenuIcon, {}) }) }),
|
|
28308
28288
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__channel-header__data", children: [
|
|
28309
28289
|
/* @__PURE__ */ jsx("div", { className: "str-chat__channel-header__data__title", children: displayTitle }),
|
|
28310
28290
|
/* @__PURE__ */ jsx(ChannelHeaderSubtitle, {})
|
|
28311
28291
|
] }),
|
|
28312
|
-
/* @__PURE__ */ jsx(
|
|
28292
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__channel-header__end", children: /* @__PURE__ */ jsx(
|
|
28313
28293
|
Avatar2,
|
|
28314
28294
|
{
|
|
28315
28295
|
className: "str-chat__avatar--channel-header",
|
|
@@ -28319,7 +28299,7 @@ const ChannelHeader = (props) => {
|
|
|
28319
28299
|
size: "lg",
|
|
28320
28300
|
userName: displayTitle
|
|
28321
28301
|
}
|
|
28322
|
-
)
|
|
28302
|
+
) })
|
|
28323
28303
|
]
|
|
28324
28304
|
}
|
|
28325
28305
|
);
|
|
@@ -28368,12 +28348,12 @@ export {
|
|
|
28368
28348
|
Card,
|
|
28369
28349
|
CardContainer,
|
|
28370
28350
|
bx as Channel,
|
|
28371
|
-
|
|
28372
|
-
|
|
28351
|
+
bY as ChannelActionContext,
|
|
28352
|
+
bZ as ChannelActionProvider,
|
|
28373
28353
|
ChannelAvatar,
|
|
28374
28354
|
ChannelHeader,
|
|
28375
28355
|
ChannelList,
|
|
28376
|
-
|
|
28356
|
+
b_ as ChannelListContext,
|
|
28377
28357
|
ChannelListContextProvider,
|
|
28378
28358
|
ChannelListItem,
|
|
28379
28359
|
ChannelListItemActionButtons,
|
|
@@ -28381,10 +28361,10 @@ export {
|
|
|
28381
28361
|
ChannelListItemUI,
|
|
28382
28362
|
ChannelListUI,
|
|
28383
28363
|
ChannelSearchResultItem,
|
|
28384
|
-
|
|
28385
|
-
|
|
28364
|
+
b$ as ChannelStateContext,
|
|
28365
|
+
c0 as ChannelStateProvider,
|
|
28386
28366
|
Chat,
|
|
28387
|
-
|
|
28367
|
+
c1 as ChatContext,
|
|
28388
28368
|
ChatProvider,
|
|
28389
28369
|
bz as ChatView,
|
|
28390
28370
|
bC as ChatViewChannelsSelectorButton,
|
|
@@ -28396,7 +28376,7 @@ export {
|
|
|
28396
28376
|
CommandChip,
|
|
28397
28377
|
CommandItem,
|
|
28398
28378
|
ComponentContext,
|
|
28399
|
-
|
|
28379
|
+
c2 as ComponentProvider,
|
|
28400
28380
|
ConnectionStatus,
|
|
28401
28381
|
ContextMenu,
|
|
28402
28382
|
ContextMenuBackButton,
|
|
@@ -28446,15 +28426,13 @@ export {
|
|
|
28446
28426
|
IconArrowDown,
|
|
28447
28427
|
IconArrowDownCircle,
|
|
28448
28428
|
IconArrowLeft,
|
|
28449
|
-
bG as IconArrowRight,
|
|
28450
28429
|
IconArrowUp,
|
|
28451
28430
|
IconArrowUpRight,
|
|
28452
28431
|
IconAttachment,
|
|
28453
28432
|
IconAudio,
|
|
28454
28433
|
IconBell,
|
|
28455
28434
|
IconBellOff,
|
|
28456
|
-
|
|
28457
|
-
bK as IconBubbleText6SolidChatMessage,
|
|
28435
|
+
IconBolt,
|
|
28458
28436
|
IconCamera,
|
|
28459
28437
|
IconCheckmark,
|
|
28460
28438
|
IconCheckmark1Small,
|
|
@@ -28478,19 +28456,14 @@ export {
|
|
|
28478
28456
|
IconFlag,
|
|
28479
28457
|
IconGiphy,
|
|
28480
28458
|
IconImage,
|
|
28481
|
-
bM as IconInfo,
|
|
28482
|
-
IconLayoutAlignLeft,
|
|
28483
28459
|
IconLeave,
|
|
28484
|
-
bN as IconLightBulbSimple,
|
|
28485
28460
|
IconLink,
|
|
28486
28461
|
IconLoading,
|
|
28487
28462
|
IconLocation,
|
|
28488
|
-
|
|
28489
|
-
|
|
28463
|
+
bG as IconMessageBubble,
|
|
28464
|
+
bH as IconMessageBubbleFill,
|
|
28490
28465
|
IconMessageBubbles,
|
|
28491
|
-
bP as IconMinus,
|
|
28492
28466
|
IconMinusCircle,
|
|
28493
|
-
bQ as IconMinusSmall,
|
|
28494
28467
|
IconMore,
|
|
28495
28468
|
IconMute,
|
|
28496
28469
|
IconNoSign,
|
|
@@ -28509,10 +28482,9 @@ export {
|
|
|
28509
28482
|
IconSave,
|
|
28510
28483
|
IconSearch,
|
|
28511
28484
|
IconSend,
|
|
28512
|
-
|
|
28485
|
+
IconSidebar,
|
|
28513
28486
|
IconThread,
|
|
28514
|
-
|
|
28515
|
-
IconThunder,
|
|
28487
|
+
bI as IconThreadFill,
|
|
28516
28488
|
IconTranslate,
|
|
28517
28489
|
IconTrophy,
|
|
28518
28490
|
IconUnpin,
|
|
@@ -28525,7 +28497,6 @@ export {
|
|
|
28525
28497
|
IconVideo,
|
|
28526
28498
|
IconVideoFill,
|
|
28527
28499
|
IconVoice,
|
|
28528
|
-
bO as IconVoiceFill,
|
|
28529
28500
|
IconXCircle,
|
|
28530
28501
|
IconXmark,
|
|
28531
28502
|
ImageComponent,
|
|
@@ -28536,9 +28507,9 @@ export {
|
|
|
28536
28507
|
LinkPreviewList,
|
|
28537
28508
|
LoadMoreButton,
|
|
28538
28509
|
LoadMorePaginator,
|
|
28539
|
-
|
|
28510
|
+
bJ as LoadingChannel,
|
|
28540
28511
|
LoadingChannels,
|
|
28541
|
-
|
|
28512
|
+
bK as LoadingErrorIndicator,
|
|
28542
28513
|
LoadingIndicator,
|
|
28543
28514
|
LoadingIndicatorIcon,
|
|
28544
28515
|
MAX_MESSAGE_REACTIONS_TO_FETCH,
|
|
@@ -28553,7 +28524,7 @@ export {
|
|
|
28553
28524
|
MessageBouncePrompt,
|
|
28554
28525
|
MessageBounceProvider,
|
|
28555
28526
|
MessageComposer,
|
|
28556
|
-
|
|
28527
|
+
c3 as MessageComposerContext,
|
|
28557
28528
|
MessageComposerContextProvider,
|
|
28558
28529
|
MessageComposerUI,
|
|
28559
28530
|
MessageContext,
|
|
@@ -28586,7 +28557,7 @@ export {
|
|
|
28586
28557
|
NotificationList,
|
|
28587
28558
|
NotificationTranslationTopic,
|
|
28588
28559
|
NumericInput,
|
|
28589
|
-
|
|
28560
|
+
bL as OPTIONAL_MESSAGE_ACTIONS,
|
|
28590
28561
|
OtherFilesContainer,
|
|
28591
28562
|
PauseIcon,
|
|
28592
28563
|
PinIndicator,
|
|
@@ -28653,22 +28624,22 @@ export {
|
|
|
28653
28624
|
TextInputFieldSet,
|
|
28654
28625
|
TextareaComposer,
|
|
28655
28626
|
Thread,
|
|
28656
|
-
|
|
28627
|
+
bW as ThreadContext,
|
|
28657
28628
|
ThreadHeader,
|
|
28658
28629
|
ThreadList,
|
|
28659
28630
|
ThreadListItem,
|
|
28660
28631
|
ThreadListItemUI,
|
|
28661
|
-
|
|
28632
|
+
bX as ThreadProvider,
|
|
28662
28633
|
ThreadStart,
|
|
28663
28634
|
Tooltip,
|
|
28664
28635
|
TranslationBuilder,
|
|
28665
|
-
|
|
28636
|
+
c4 as TranslationContext,
|
|
28666
28637
|
TranslationProvider,
|
|
28667
28638
|
TranslationTopic,
|
|
28668
|
-
|
|
28639
|
+
c5 as TypingContext,
|
|
28669
28640
|
TypingIndicator,
|
|
28670
28641
|
TypingIndicatorHeader,
|
|
28671
|
-
|
|
28642
|
+
c6 as TypingProvider,
|
|
28672
28643
|
UNREAD_MESSAGE_SEPARATOR_CLASS,
|
|
28673
28644
|
UnMemoizedLoadMorePaginator,
|
|
28674
28645
|
UnreadMessagesNotification,
|
|
@@ -28726,21 +28697,21 @@ export {
|
|
|
28726
28697
|
getCssDimensionsVariables,
|
|
28727
28698
|
getGroupChannelDisplayInfo,
|
|
28728
28699
|
getGroupStyles,
|
|
28729
|
-
|
|
28700
|
+
bM as getImages,
|
|
28730
28701
|
getIsFirstUnreadMessage,
|
|
28731
28702
|
getLastReceived,
|
|
28732
28703
|
getLatestMessagePreview,
|
|
28733
28704
|
getMessageActions,
|
|
28734
|
-
|
|
28735
|
-
|
|
28736
|
-
|
|
28705
|
+
bN as getNonImageAttachments,
|
|
28706
|
+
bT as getNotificationTargetPanel,
|
|
28707
|
+
bU as getNotificationTargetTag,
|
|
28737
28708
|
getReadByTooltipText,
|
|
28738
28709
|
getTextareaCaretRect,
|
|
28739
28710
|
getTranslatedMessageText,
|
|
28740
28711
|
getWholeChar,
|
|
28741
28712
|
handleActionWarning,
|
|
28742
|
-
|
|
28743
|
-
|
|
28713
|
+
bQ as hasMoreMessagesProbably,
|
|
28714
|
+
bR as hasNotMoreMessages,
|
|
28744
28715
|
hiTranslations,
|
|
28745
28716
|
htmlToTextPlugin,
|
|
28746
28717
|
imageToLink,
|
|
@@ -28750,7 +28721,7 @@ export {
|
|
|
28750
28721
|
isChrome,
|
|
28751
28722
|
isDate,
|
|
28752
28723
|
isDateSeparatorMessage,
|
|
28753
|
-
|
|
28724
|
+
c7 as isDayOrMoment,
|
|
28754
28725
|
isFirefox,
|
|
28755
28726
|
isGalleryAttachmentType,
|
|
28756
28727
|
isIntroMessage,
|
|
@@ -28762,8 +28733,8 @@ export {
|
|
|
28762
28733
|
isMessageErrorRetryable,
|
|
28763
28734
|
isNetworkSendFailure,
|
|
28764
28735
|
isNotificationForPanel,
|
|
28765
|
-
|
|
28766
|
-
|
|
28736
|
+
bS as isNotificationTargetPanel,
|
|
28737
|
+
c8 as isNumberOrString,
|
|
28767
28738
|
isSafari,
|
|
28768
28739
|
isSvgAttachment,
|
|
28769
28740
|
isUserMuted,
|
|
@@ -28771,8 +28742,8 @@ export {
|
|
|
28771
28742
|
jaTranslations,
|
|
28772
28743
|
keepLineBreaksPlugin,
|
|
28773
28744
|
koTranslations,
|
|
28774
|
-
|
|
28775
|
-
|
|
28745
|
+
bP as makeDateMessageId,
|
|
28746
|
+
bO as makeIntroMessage,
|
|
28776
28747
|
mapEmojiMartData,
|
|
28777
28748
|
mapToUserNameOrId,
|
|
28778
28749
|
markDownRenderers,
|
|
@@ -28850,7 +28821,7 @@ export {
|
|
|
28850
28821
|
useFlagHandler,
|
|
28851
28822
|
useGalleryContext,
|
|
28852
28823
|
useLastReadData,
|
|
28853
|
-
|
|
28824
|
+
bV as useLegacyThreadContext,
|
|
28854
28825
|
useLiveLocationSharingManager,
|
|
28855
28826
|
useMarkUnreadHandler,
|
|
28856
28827
|
useMentionsHandler,
|