stream-chat-react 14.0.0-beta.1 → 14.0.0-beta.2
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/{WithAudioPlayback-BcKZ5Lbh.mjs → WithAudioPlayback-C1hfFIcu.mjs} +349 -256
- package/dist/WithAudioPlayback-C1hfFIcu.mjs.map +1 -0
- package/dist/{WithAudioPlayback-TERIQpZ6.js → WithAudioPlayback-myzUS2m6.js} +101 -8
- package/dist/WithAudioPlayback-myzUS2m6.js.map +1 -0
- package/dist/cjs/emojis.js +1 -1
- package/dist/cjs/index.js +703 -769
- package/dist/cjs/index.js.map +1 -1
- package/dist/css/index.css +51 -36
- package/dist/css/index.css.map +1 -1
- package/dist/es/emojis.mjs +1 -1
- package/dist/es/index.mjs +827 -893
- package/dist/es/index.mjs.map +1 -1
- package/dist/types/components/Badge/Badge.d.ts +1 -0
- package/dist/types/components/Badge/Badge.d.ts.map +1 -1
- package/dist/types/components/Channel/Channel.d.ts.map +1 -1
- package/dist/types/components/Channel/utils.d.ts +7 -1
- package/dist/types/components/Channel/utils.d.ts.map +1 -1
- package/dist/types/components/ChatView/ChatView.d.ts.map +1 -1
- package/dist/types/components/Gallery/Gallery.d.ts.map +1 -1
- package/dist/types/components/Icons/icons.d.ts +4 -0
- package/dist/types/components/Icons/icons.d.ts.map +1 -1
- package/dist/types/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.d.ts.map +1 -1
- package/dist/types/components/Message/MessageErrorText.d.ts +0 -5
- package/dist/types/components/Message/MessageErrorText.d.ts.map +1 -1
- package/dist/types/components/Message/MessageText.d.ts.map +1 -1
- package/dist/types/components/Message/MessageUI.d.ts.map +1 -1
- package/dist/types/components/Message/hooks/useDeleteHandler.d.ts.map +1 -1
- package/dist/types/components/Message/index.d.ts +0 -1
- package/dist/types/components/Message/index.d.ts.map +1 -1
- package/dist/types/components/Message/utils.d.ts +1 -0
- package/dist/types/components/Message/utils.d.ts.map +1 -1
- package/dist/types/components/MessageActions/MessageActions.d.ts.map +1 -1
- package/dist/types/components/MessageActions/MessageActions.defaults.d.ts.map +1 -1
- package/dist/types/components/MessageActions/hooks/useBaseMessageActionSetFilter.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/AttachmentPreviewList.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/ImageAttachmentPreview.d.ts +3 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/ImageAttachmentPreview.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.d.ts +4 -2
- package/dist/types/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/utils/AttachmentPreviewRoot.d.ts +6 -1
- package/dist/types/components/MessageComposer/AttachmentPreviewList/utils/AttachmentPreviewRoot.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/AttachmentSelector/AttachmentSelector.d.ts +9 -2
- package/dist/types/components/MessageComposer/AttachmentSelector/AttachmentSelector.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/CommandChip.d.ts +5 -1
- package/dist/types/components/MessageComposer/CommandChip.d.ts.map +1 -1
- package/dist/types/components/MessageComposer/MessageComposerUI.d.ts.map +1 -1
- package/dist/types/components/Notifications/Notification.d.ts.map +1 -1
- package/dist/types/components/Notifications/hooks/useNotificationTarget.d.ts +1 -1
- package/dist/types/components/Notifications/hooks/useNotificationTarget.d.ts.map +1 -1
- package/dist/types/components/Notifications/notificationTarget.d.ts +1 -1
- package/dist/types/components/Notifications/notificationTarget.d.ts.map +1 -1
- package/dist/types/components/Poll/PollOptionSelector.d.ts.map +1 -1
- package/dist/types/components/TextareaComposer/TextareaComposer.d.ts +1 -2
- package/dist/types/components/TextareaComposer/TextareaComposer.d.ts.map +1 -1
- package/dist/types/context/ComponentContext.d.ts +5 -2
- package/dist/types/context/ComponentContext.d.ts.map +1 -1
- package/dist/types/i18n/Streami18n.d.ts +11 -6
- package/dist/types/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +11 -41
- package/dist/WithAudioPlayback-BcKZ5Lbh.mjs.map +0 -1
- package/dist/WithAudioPlayback-TERIQpZ6.js.map +0 -1
- package/dist/types/components/Message/icons.d.ts +0 -7
- package/dist/types/components/Message/icons.d.ts.map +0 -1
package/dist/es/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { nanoid } from "nanoid";
|
|
4
|
-
import React, { useState, useEffect,
|
|
4
|
+
import React, { useState, useEffect, useCallback, useLayoutEffect, useMemo, useContext, createContext, useRef, forwardRef, Component, createElement, 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-ByEVSjGG.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 BaseIcon, g as Button, I as IconPause, h as IconPlaySolid, j as getDefaultExportFromCjs, k as defaultTranslatorFunction, p as predefinedFormatters, L as LocalizedFormat, l as calendar, m as IconLoadingCircle,
|
|
7
|
-
import {
|
|
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 BaseIcon, g as Button, I as IconPause, h as IconPlaySolid, j as getDefaultExportFromCjs, k as defaultTranslatorFunction, p as predefinedFormatters, L as LocalizedFormat, l as calendar, m as IconLoadingCircle, n as isNetworkSendFailure, v as validateAndGetMessage, o as isUserMuted, q as defaultPinPermissions, r as useThreadContext, s as usePopoverPosition, t as useComponentContext, w as IconCrossMedium, x as IconPeople, y as IconExclamation, z as IconChevronRight, A as IconChevronLeft, D as IconArrowLeft, E as IconExclamationCircle, F as IconCircleBanSign, G as isMessageErrorRetryable, H as ACTIONS_NOT_WORKING_IN_THREAD, J as useNotificationTarget, K as IconArrowRightUp, M as addNotificationTargetTag, N as IconPin, O as mapToUserNameOrId, P as IconClock, Q as IconCheckmark1Small, R as IconDoubleCheckmark1Small, S as getReadByTooltipText, T as messageHasAttachments, U as messageTextHasEmojisOnly, V as isDate, W as getDateString, X as IconTranslate, Y as useMessageComposerContext, Z as useIsCooldownActive, _ as IconCrossSmall, $ as IconImages1Alt, a0 as IconChart5, a1 as IconMapPin, a2 as IconFileBend, a3 as IconChainLink, a4 as IconVideo, a5 as IconVideoSolid, a6 as IconMicrophone, a7 as IconBookmark, a8 as IconBellNotification, a9 as IconChevronDown, aa as IconPlusSmall, ab as IconCheckmark2, ac as DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD, ad as IconTrophy, ae as IconDotGrid2x3, af as IconCircleMinus, ag as IconPaperPlane, ah as IconVolumeFull, ai as IconPeopleAdd, aj as IconMute, ak as IconFlag2, al as IconPeopleRemove, am as IconPaperclip, an as IconRunShortcut, ao as CHANNEL_CONTAINER_ID, ap as IconPlusLarge, aq as IconExclamationTriangle, ar as useAudioPlayer, as as IconArrowRotateClockwise, at as IconArrowDownCircle, au as IconThunder, av as IconTrashBin, aw as IconFileArrowLeftIn, ax as MessageComposerContextProvider, ay as useTypingContext, az as defaultDateTimeParser, aA as isLanguageSupported, aB as IconLayoutAlignLeft, aC as useChatViewContext, aD as MESSAGE_ACTIONS, aE as LegacyThreadContext, aF as IconArrowShareLeft, aG as IconEmojiSmile, aH as IconPeopleAdded, aI as IconBookmarkRemove, aJ as IconBellOff, aK as IconBubbleWideNotificationChatMessage, aL as IconEditBig, aM as IconSquareBehindSquare2_Copy, aN as IconUnpin, aO as IconCloseQuote2, aP as IconBubbleText6ChatMessage, aQ as IconDotGrid1x3Horizontal, 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 IconMagnifyingGlassSearch, bc as IconCircleX, bd as useChannelListContext, be as DEFAULT_JUMP_TO_PAGE_SIZE, bf as ChannelListContextProvider, bg as IconArchive, bh as IconArrowBoxLeft, bi as IconCamera1, bj as IconExclamationCircle1, bk as ChatProvider, bl as TranslationProvider, bm as useThreadsViewContext, bn as IconBubbles, bo as IconArrowRotateRightLeftRepeatRefresh, bp as IconEyeOpen } from "../WithAudioPlayback-C1hfFIcu.mjs";
|
|
7
|
+
import { bu, bx, dc, dd, de, df, dg, dh, bz, bC, by, bB, bD, di, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bT, bS, bU, bV, bW, bX, bY, bZ, b_, b$, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, cs, ct, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ, cK, cL, cM, cN, cO, cP, cQ, cR, cS, cT, cU, cV, cW, cX, cY, cZ, c_, dj, c$, da, db, dk, dl, dm, br, bF, bE, bs, bt, d0, d1, d7, d8, d4, d5, dn, d6, dp, d3, d2, bq, bA, bv, bw, d9 } from "../WithAudioPlayback-C1hfFIcu.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";
|
|
@@ -71,23 +71,6 @@ const useAIState = (channel) => {
|
|
|
71
71
|
}, [channel]);
|
|
72
72
|
return { aiState };
|
|
73
73
|
};
|
|
74
|
-
const ChannelListContext = createContext(
|
|
75
|
-
void 0
|
|
76
|
-
);
|
|
77
|
-
const ChannelListContextProvider = ({
|
|
78
|
-
children,
|
|
79
|
-
value
|
|
80
|
-
}) => /* @__PURE__ */ jsx(ChannelListContext.Provider, { value, children });
|
|
81
|
-
const useChannelListContext = (componentName) => {
|
|
82
|
-
const contextValue = useContext(ChannelListContext);
|
|
83
|
-
if (!contextValue) {
|
|
84
|
-
console.warn(
|
|
85
|
-
`The useChannelListContext hook was called outside of the ChannelListContext provider. Make sure this hook is called within the ChannelList component. The errored call is located in the ${componentName} component.`
|
|
86
|
-
);
|
|
87
|
-
return {};
|
|
88
|
-
}
|
|
89
|
-
return contextValue;
|
|
90
|
-
};
|
|
91
74
|
class DialogManager {
|
|
92
75
|
constructor({ id } = {}) {
|
|
93
76
|
this.state = new StateStore({
|
|
@@ -950,7 +933,6 @@ const deTranslations = {
|
|
|
950
933
|
"End vote": "Abstimmung beenden",
|
|
951
934
|
"Enforce unique vote is enabled": "Eindeutige Abstimmung ist aktiviert",
|
|
952
935
|
"Error": "Fehler",
|
|
953
|
-
"Error · Unsent": "Fehler · Nicht gesendet",
|
|
954
936
|
"Error adding flag": "Fehler beim Hinzufügen des Flags",
|
|
955
937
|
"Error connecting to chat, refresh the page to try again.": "Verbindungsfehler zum Chat, aktualisieren Sie die Seite, um es erneut zu versuchen.",
|
|
956
938
|
"Error deleting message": "Fehler beim Löschen der Nachricht",
|
|
@@ -1072,8 +1054,6 @@ const deTranslations = {
|
|
|
1072
1054
|
"Maximum number of votes (from 2 to 10)": "Maximale Anzahl der Stimmen (von 2 bis 10)",
|
|
1073
1055
|
Menu: Menu$b,
|
|
1074
1056
|
"Message deleted": "Nachricht gelöscht",
|
|
1075
|
-
"Message Failed · Click to try again": "Nachricht fehlgeschlagen · Klicken, um es erneut zu versuchen",
|
|
1076
|
-
"Message Failed · Unauthorized": "Nachricht fehlgeschlagen · Nicht autorisiert",
|
|
1077
1057
|
"Message failed to send": "Nachricht konnte nicht gesendet werden",
|
|
1078
1058
|
"Message has been successfully flagged": "Nachricht wurde erfolgreich gemeldet",
|
|
1079
1059
|
"Message pinned": "Nachricht angeheftet",
|
|
@@ -1243,6 +1223,7 @@ const deTranslations = {
|
|
|
1243
1223
|
"View translation": "Übersetzung anzeigen",
|
|
1244
1224
|
"Voice message": "Sprachnachricht",
|
|
1245
1225
|
"Voice message {{ duration }}": "Sprachnachricht {{ duration }}",
|
|
1226
|
+
"Voice message deleted": "Sprachnachricht gelöscht",
|
|
1246
1227
|
voiceMessageCount_one: voiceMessageCount_one$9,
|
|
1247
1228
|
voiceMessageCount_other: voiceMessageCount_other$b,
|
|
1248
1229
|
"Vote ended": "Abstimmung beendet",
|
|
@@ -1473,7 +1454,6 @@ const enTranslations = {
|
|
|
1473
1454
|
"End vote": "End Vote",
|
|
1474
1455
|
"Enforce unique vote is enabled": "Enforce unique vote is enabled",
|
|
1475
1456
|
"Error": "Error",
|
|
1476
|
-
"Error · Unsent": "Error · Unsent",
|
|
1477
1457
|
"Error adding flag": "Error adding flag",
|
|
1478
1458
|
"Error connecting to chat, refresh the page to try again.": "Error connecting to chat, refresh the page to try again.",
|
|
1479
1459
|
"Error deleting message": "Error deleting message",
|
|
@@ -1595,8 +1575,6 @@ const enTranslations = {
|
|
|
1595
1575
|
"Maximum number of votes (from 2 to 10)": "Maximum number of votes (from 2 to 10)",
|
|
1596
1576
|
Menu: Menu$a,
|
|
1597
1577
|
"Message deleted": "Message deleted",
|
|
1598
|
-
"Message Failed · Click to try again": "Message Failed · Click to try again",
|
|
1599
|
-
"Message Failed · Unauthorized": "Message Failed · Unauthorized",
|
|
1600
1578
|
"Message failed to send": "Message failed to send",
|
|
1601
1579
|
"Message has been successfully flagged": "Message has been successfully flagged",
|
|
1602
1580
|
"Message pinned": "Message pinned",
|
|
@@ -1766,6 +1744,7 @@ const enTranslations = {
|
|
|
1766
1744
|
"View translation": "View translation",
|
|
1767
1745
|
"Voice message": "Voice message",
|
|
1768
1746
|
"Voice message {{ duration }}": "Voice message {{ duration }}",
|
|
1747
|
+
"Voice message deleted": "Voice message deleted",
|
|
1769
1748
|
voiceMessageCount_one: voiceMessageCount_one$8,
|
|
1770
1749
|
voiceMessageCount_other: voiceMessageCount_other$a,
|
|
1771
1750
|
"Vote ended": "Vote ended",
|
|
@@ -2012,7 +1991,6 @@ const esTranslations = {
|
|
|
2012
1991
|
"End vote": "Finalizar votación",
|
|
2013
1992
|
"Enforce unique vote is enabled": "El voto único está habilitado",
|
|
2014
1993
|
"Error": "Error",
|
|
2015
|
-
"Error · Unsent": "Error · No enviado",
|
|
2016
1994
|
"Error adding flag": "Error al agregar la bandera",
|
|
2017
1995
|
"Error connecting to chat, refresh the page to try again.": "Error al conectarse al chat, actualice la página para volver a intentarlo.",
|
|
2018
1996
|
"Error deleting message": "Error al eliminar el mensaje",
|
|
@@ -2137,8 +2115,6 @@ const esTranslations = {
|
|
|
2137
2115
|
"Maximum number of votes (from 2 to 10)": "Número máximo de votos (de 2 a 10)",
|
|
2138
2116
|
Menu: Menu$9,
|
|
2139
2117
|
"Message deleted": "Mensaje eliminado",
|
|
2140
|
-
"Message Failed · Click to try again": "Mensaje fallido · Haga clic para volver a intentarlo",
|
|
2141
|
-
"Message Failed · Unauthorized": "Mensaje fallido · No autorizado",
|
|
2142
2118
|
"Message failed to send": "No se pudo enviar el mensaje",
|
|
2143
2119
|
"Message has been successfully flagged": "El mensaje se marcó correctamente",
|
|
2144
2120
|
"Message pinned": "Mensaje fijado",
|
|
@@ -2315,6 +2291,7 @@ const esTranslations = {
|
|
|
2315
2291
|
"View translation": "Ver traducción",
|
|
2316
2292
|
"Voice message": "Mensaje de voz",
|
|
2317
2293
|
"Voice message {{ duration }}": "Mensaje de voz {{ duration }}",
|
|
2294
|
+
"Voice message deleted": "Mensaje de voz eliminado",
|
|
2318
2295
|
voiceMessageCount_one: voiceMessageCount_one$7,
|
|
2319
2296
|
voiceMessageCount_many: voiceMessageCount_many$4,
|
|
2320
2297
|
voiceMessageCount_other: voiceMessageCount_other$9,
|
|
@@ -2562,7 +2539,6 @@ const frTranslations = {
|
|
|
2562
2539
|
"End vote": "Fin du vote",
|
|
2563
2540
|
"Enforce unique vote is enabled": "Le vote unique est activé",
|
|
2564
2541
|
"Error": "Erreur",
|
|
2565
|
-
"Error · Unsent": "Erreur - Non envoyé",
|
|
2566
2542
|
"Error adding flag": "Erreur lors de l'ajout du signalement",
|
|
2567
2543
|
"Error connecting to chat, refresh the page to try again.": "Erreur de connexion au chat, rafraîchissez la page pour réessayer.",
|
|
2568
2544
|
"Error deleting message": "Erreur lors de la suppression du message",
|
|
@@ -2687,8 +2663,6 @@ const frTranslations = {
|
|
|
2687
2663
|
"Maximum number of votes (from 2 to 10)": "Nombre maximum de votes (de 2 à 10)",
|
|
2688
2664
|
Menu: Menu$8,
|
|
2689
2665
|
"Message deleted": "Message supprimé",
|
|
2690
|
-
"Message Failed · Click to try again": "Échec de l'envoi du message - Cliquez pour réessayer",
|
|
2691
|
-
"Message Failed · Unauthorized": "Échec de l'envoi du message - Non autorisé",
|
|
2692
2666
|
"Message failed to send": "Échec de l'envoi du message",
|
|
2693
2667
|
"Message has been successfully flagged": "Le message a été signalé avec succès",
|
|
2694
2668
|
"Message pinned": "Message épinglé",
|
|
@@ -2865,6 +2839,7 @@ const frTranslations = {
|
|
|
2865
2839
|
"View translation": "Voir la traduction",
|
|
2866
2840
|
"Voice message": "Message vocal",
|
|
2867
2841
|
"Voice message {{ duration }}": "Message vocal {{ duration }}",
|
|
2842
|
+
"Voice message deleted": "Message vocal supprimé",
|
|
2868
2843
|
voiceMessageCount_one: voiceMessageCount_one$6,
|
|
2869
2844
|
voiceMessageCount_many: voiceMessageCount_many$3,
|
|
2870
2845
|
voiceMessageCount_other: voiceMessageCount_other$8,
|
|
@@ -3096,7 +3071,6 @@ const hiTranslations = {
|
|
|
3096
3071
|
"End vote": "मत समाप्त करें",
|
|
3097
3072
|
"Enforce unique vote is enabled": "अनोखा वोट सक्षम है",
|
|
3098
3073
|
"Error": "त्रुटि",
|
|
3099
|
-
"Error · Unsent": "फेल",
|
|
3100
3074
|
"Error adding flag": "ध्वज जोड़ने में त्रुटि",
|
|
3101
3075
|
"Error connecting to chat, refresh the page to try again.": "चैट से कनेक्ट करने में त्रुटि, पेज को रिफ्रेश करें",
|
|
3102
3076
|
"Error deleting message": "संदेश हटाने में त्रुटि",
|
|
@@ -3219,8 +3193,6 @@ const hiTranslations = {
|
|
|
3219
3193
|
"Maximum number of votes (from 2 to 10)": "अधिकतम वोटों की संख्या (2 से 10)",
|
|
3220
3194
|
Menu: Menu$7,
|
|
3221
3195
|
"Message deleted": "मैसेज हटा दिया गया",
|
|
3222
|
-
"Message Failed · Click to try again": "मैसेज फ़ैल - पुनः कोशिश करें",
|
|
3223
|
-
"Message Failed · Unauthorized": "मैसेज फ़ैल - अनधिकृत",
|
|
3224
3196
|
"Message failed to send": "संदेश भेजने में विफल",
|
|
3225
3197
|
"Message has been successfully flagged": "मैसेज को फ्लैग कर दिया गया है",
|
|
3226
3198
|
"Message pinned": "संदेश पिन किया गया",
|
|
@@ -3390,6 +3362,7 @@ const hiTranslations = {
|
|
|
3390
3362
|
"View translation": "अनुवाद देखें",
|
|
3391
3363
|
"Voice message": "आवाज संदेश",
|
|
3392
3364
|
"Voice message {{ duration }}": "वॉइस संदेश {{ duration }}",
|
|
3365
|
+
"Voice message deleted": "वॉइस संदेश हटा दिया गया",
|
|
3393
3366
|
voiceMessageCount_one: voiceMessageCount_one$5,
|
|
3394
3367
|
voiceMessageCount_other: voiceMessageCount_other$7,
|
|
3395
3368
|
"Vote ended": "मतदान समाप्त",
|
|
@@ -3636,7 +3609,6 @@ const itTranslations = {
|
|
|
3636
3609
|
"End vote": "Termina il voto",
|
|
3637
3610
|
"Enforce unique vote is enabled": "Il voto unico è abilitato",
|
|
3638
3611
|
"Error": "Errore",
|
|
3639
|
-
"Error · Unsent": "Errore · Non inviato",
|
|
3640
3612
|
"Error adding flag": "Errore durante l'aggiunta del flag",
|
|
3641
3613
|
"Error connecting to chat, refresh the page to try again.": "Errore di connessione alla chat, aggiorna la pagina per riprovare.",
|
|
3642
3614
|
"Error deleting message": "Errore durante l'eliminazione del messaggio",
|
|
@@ -3761,8 +3733,6 @@ const itTranslations = {
|
|
|
3761
3733
|
"Maximum number of votes (from 2 to 10)": "Numero massimo di voti (da 2 a 10)",
|
|
3762
3734
|
Menu: Menu$6,
|
|
3763
3735
|
"Message deleted": "Messaggio cancellato",
|
|
3764
|
-
"Message Failed · Click to try again": "Invio messaggio fallito · Clicca per riprovare",
|
|
3765
|
-
"Message Failed · Unauthorized": "Invio messaggio fallito · Non autorizzato",
|
|
3766
3736
|
"Message failed to send": "Invio del messaggio non riuscito",
|
|
3767
3737
|
"Message has been successfully flagged": "Il messaggio è stato segnalato con successo",
|
|
3768
3738
|
"Message pinned": "Messaggio bloccato",
|
|
@@ -3939,6 +3909,7 @@ const itTranslations = {
|
|
|
3939
3909
|
"View translation": "Visualizza traduzione",
|
|
3940
3910
|
"Voice message": "Messaggio vocale",
|
|
3941
3911
|
"Voice message {{ duration }}": "Messaggio vocale {{ duration }}",
|
|
3912
|
+
"Voice message deleted": "Messaggio vocale eliminato",
|
|
3942
3913
|
voiceMessageCount_one: voiceMessageCount_one$4,
|
|
3943
3914
|
voiceMessageCount_many: voiceMessageCount_many$2,
|
|
3944
3915
|
voiceMessageCount_other: voiceMessageCount_other$6,
|
|
@@ -4163,7 +4134,6 @@ const jaTranslations = {
|
|
|
4163
4134
|
"End vote": "投票を終了",
|
|
4164
4135
|
"Enforce unique vote is enabled": "一意の投票が有効になっています",
|
|
4165
4136
|
"Error": "エラー",
|
|
4166
|
-
"Error · Unsent": "エラー・未送信",
|
|
4167
4137
|
"Error adding flag": "フラグを追加のエラーが発生しました",
|
|
4168
4138
|
"Error connecting to chat, refresh the page to try again.": "チャットへの接続ができませんでした。ページを更新してください。",
|
|
4169
4139
|
"Error deleting message": "メッセージを削除するエラーが発生しました",
|
|
@@ -4282,8 +4252,6 @@ const jaTranslations = {
|
|
|
4282
4252
|
"Maximum number of votes (from 2 to 10)": "最大投票数(2から10まで)",
|
|
4283
4253
|
Menu: Menu$5,
|
|
4284
4254
|
"Message deleted": "メッセージが削除されました",
|
|
4285
|
-
"Message Failed · Click to try again": "メッセージが失敗しました · クリックして再試行してください",
|
|
4286
|
-
"Message Failed · Unauthorized": "メッセージが失敗しました · 許可されていません",
|
|
4287
4255
|
"Message failed to send": "メッセージの送信に失敗しました",
|
|
4288
4256
|
"Message has been successfully flagged": "メッセージに正常にフラグが付けられました",
|
|
4289
4257
|
"Message pinned": "メッセージにピンが付けられました",
|
|
@@ -4450,6 +4418,7 @@ const jaTranslations = {
|
|
|
4450
4418
|
"View translation": "翻訳を表示",
|
|
4451
4419
|
"Voice message": "ボイスメッセージ",
|
|
4452
4420
|
"Voice message {{ duration }}": "ボイスメッセージ {{ duration }}",
|
|
4421
|
+
"Voice message deleted": "ボイスメッセージが削除されました",
|
|
4453
4422
|
voiceMessageCount_other: voiceMessageCount_other$5,
|
|
4454
4423
|
"Vote ended": "投票が終了しました",
|
|
4455
4424
|
Votes: Votes$5,
|
|
@@ -4672,7 +4641,6 @@ const koTranslations = {
|
|
|
4672
4641
|
"End vote": "투표 종료",
|
|
4673
4642
|
"Enforce unique vote is enabled": "고유 투표가 활성화되었습니다",
|
|
4674
4643
|
"Error": "오류",
|
|
4675
|
-
"Error · Unsent": "오류 · 전송되지 않음",
|
|
4676
4644
|
"Error adding flag": "플래그를 추가하는 동안 오류가 발생했습니다.",
|
|
4677
4645
|
"Error connecting to chat, refresh the page to try again.": "채팅에 연결하는 동안 오류가 발생했습니다. 페이지를 새로고침하여 다시 시도하세요.",
|
|
4678
4646
|
"Error deleting message": "메시지를 삭제하는 중에 오류가 발생했습니다.",
|
|
@@ -4791,8 +4759,6 @@ const koTranslations = {
|
|
|
4791
4759
|
"Maximum number of votes (from 2 to 10)": "최대 투표 수 (2에서 10까지)",
|
|
4792
4760
|
Menu: Menu$4,
|
|
4793
4761
|
"Message deleted": "메시지가 삭제되었습니다.",
|
|
4794
|
-
"Message Failed · Click to try again": "메시지 실패 · 다시 시도하려면 클릭하세요.",
|
|
4795
|
-
"Message Failed · Unauthorized": "메시지 실패 · 승인되지 않음",
|
|
4796
4762
|
"Message failed to send": "메시지 전송 실패",
|
|
4797
4763
|
"Message has been successfully flagged": "메시지에 플래그가 지정되었습니다.",
|
|
4798
4764
|
"Message pinned": "메시지 핀했습니다",
|
|
@@ -4959,6 +4925,7 @@ const koTranslations = {
|
|
|
4959
4925
|
"View translation": "번역 보기",
|
|
4960
4926
|
"Voice message": "음성 메시지",
|
|
4961
4927
|
"Voice message {{ duration }}": "음성 메시지 {{ duration }}",
|
|
4928
|
+
"Voice message deleted": "음성 메시지가 삭제됨",
|
|
4962
4929
|
voiceMessageCount_other: voiceMessageCount_other$4,
|
|
4963
4930
|
"Vote ended": "투표 종료",
|
|
4964
4931
|
Votes: Votes$4,
|
|
@@ -5188,7 +5155,6 @@ const nlTranslations = {
|
|
|
5188
5155
|
"End vote": "Einde stem",
|
|
5189
5156
|
"Enforce unique vote is enabled": "Unieke stem is ingeschakeld",
|
|
5190
5157
|
"Error": "Fout",
|
|
5191
|
-
"Error · Unsent": "Fout · niet verzonden",
|
|
5192
5158
|
"Error adding flag": "Fout bij toevoegen van vlag",
|
|
5193
5159
|
"Error connecting to chat, refresh the page to try again.": "Fout bij het verbinden, ververs de pagina om nogmaals te proberen",
|
|
5194
5160
|
"Error deleting message": "Fout bij verwijderen van bericht",
|
|
@@ -5310,8 +5276,6 @@ const nlTranslations = {
|
|
|
5310
5276
|
"Maximum number of votes (from 2 to 10)": "Maximaal aantal stemmen (van 2 tot 10)",
|
|
5311
5277
|
Menu: Menu$3,
|
|
5312
5278
|
"Message deleted": "Bericht verwijderd",
|
|
5313
|
-
"Message Failed · Click to try again": "Bericht mislukt, klik om het nogmaals te proberen",
|
|
5314
|
-
"Message Failed · Unauthorized": "Bericht mislukt, ongeautoriseerd",
|
|
5315
5279
|
"Message failed to send": "Bericht kon niet worden verzonden",
|
|
5316
5280
|
"Message has been successfully flagged": "Bericht is succesvol gemarkeerd",
|
|
5317
5281
|
"Message pinned": "Bericht vastgezet",
|
|
@@ -5483,6 +5447,7 @@ const nlTranslations = {
|
|
|
5483
5447
|
"View translation": "Vertaling bekijken",
|
|
5484
5448
|
"Voice message": "Spraakbericht",
|
|
5485
5449
|
"Voice message {{ duration }}": "Spraakbericht {{ duration }}",
|
|
5450
|
+
"Voice message deleted": "Spraakbericht verwijderd",
|
|
5486
5451
|
voiceMessageCount_one: voiceMessageCount_one$3,
|
|
5487
5452
|
voiceMessageCount_other: voiceMessageCount_other$3,
|
|
5488
5453
|
"Vote ended": "Stemmen beëindigd",
|
|
@@ -5729,7 +5694,6 @@ const ptTranslations = {
|
|
|
5729
5694
|
"End vote": "Encerrar votação",
|
|
5730
5695
|
"Enforce unique vote is enabled": "Voto único está habilitado",
|
|
5731
5696
|
"Error": "Erro",
|
|
5732
|
-
"Error · Unsent": "Erro · Não enviado",
|
|
5733
5697
|
"Error adding flag": "Erro ao reportar",
|
|
5734
5698
|
"Error connecting to chat, refresh the page to try again.": "Erro ao conectar ao bate-papo, atualize a página para tentar novamente.",
|
|
5735
5699
|
"Error deleting message": "Erro ao deletar mensagem",
|
|
@@ -5854,8 +5818,6 @@ const ptTranslations = {
|
|
|
5854
5818
|
"Maximum number of votes (from 2 to 10)": "Número máximo de votos (de 2 a 10)",
|
|
5855
5819
|
Menu: Menu$2,
|
|
5856
5820
|
"Message deleted": "Mensagem apagada",
|
|
5857
|
-
"Message Failed · Click to try again": "A mensagem falhou · Clique para tentar novamente",
|
|
5858
|
-
"Message Failed · Unauthorized": "A mensagem falhou · não autorizado",
|
|
5859
5821
|
"Message failed to send": "Falha ao enviar a mensagem",
|
|
5860
5822
|
"Message has been successfully flagged": "A mensagem foi reportada com sucesso",
|
|
5861
5823
|
"Message pinned": "Mensagem fixada",
|
|
@@ -6032,6 +5994,7 @@ const ptTranslations = {
|
|
|
6032
5994
|
"View translation": "Ver tradução",
|
|
6033
5995
|
"Voice message": "Mensagem de voz",
|
|
6034
5996
|
"Voice message {{ duration }}": "Mensagem de voz {{ duration }}",
|
|
5997
|
+
"Voice message deleted": "Mensagem de voz excluída",
|
|
6035
5998
|
voiceMessageCount_one: voiceMessageCount_one$2,
|
|
6036
5999
|
voiceMessageCount_many: voiceMessageCount_many$1,
|
|
6037
6000
|
voiceMessageCount_other: voiceMessageCount_other$2,
|
|
@@ -6299,7 +6262,6 @@ const ruTranslations = {
|
|
|
6299
6262
|
"End vote": "Закончить голосование",
|
|
6300
6263
|
"Enforce unique vote is enabled": "Уникальное голосование включено",
|
|
6301
6264
|
"Error": "Ошибка",
|
|
6302
|
-
"Error · Unsent": "Ошибка · Не отправлено",
|
|
6303
6265
|
"Error adding flag": "Ошибка добавления флага",
|
|
6304
6266
|
"Error connecting to chat, refresh the page to try again.": "Ошибка подключения к чату, обновите страницу чтобы попробовать снова.",
|
|
6305
6267
|
"Error deleting message": "Ошибка при удалении сообщения",
|
|
@@ -6430,8 +6392,6 @@ const ruTranslations = {
|
|
|
6430
6392
|
"Maximum number of votes (from 2 to 10)": "Максимальное количество голосов (от 2 до 10)",
|
|
6431
6393
|
Menu: Menu$1,
|
|
6432
6394
|
"Message deleted": "Сообщение удалено",
|
|
6433
|
-
"Message Failed · Click to try again": "Ошибка отправки сообщения · Нажмите чтобы повторить",
|
|
6434
|
-
"Message Failed · Unauthorized": "Ошибка отправки сообщения · Неавторизованный",
|
|
6435
6395
|
"Message failed to send": "Не удалось отправить сообщение",
|
|
6436
6396
|
"Message has been successfully flagged": "Жалоба на сообщение была принята",
|
|
6437
6397
|
"Message pinned": "Сообщение закреплено",
|
|
@@ -6615,6 +6575,7 @@ const ruTranslations = {
|
|
|
6615
6575
|
"View translation": "Показать перевод",
|
|
6616
6576
|
"Voice message": "Голосовое сообщение",
|
|
6617
6577
|
"Voice message {{ duration }}": "Голосовое сообщение {{ duration }}",
|
|
6578
|
+
"Voice message deleted": "Голосовое сообщение удалено",
|
|
6618
6579
|
voiceMessageCount_one: voiceMessageCount_one$1,
|
|
6619
6580
|
voiceMessageCount_few,
|
|
6620
6581
|
voiceMessageCount_many,
|
|
@@ -6847,7 +6808,6 @@ const trTranslations = {
|
|
|
6847
6808
|
"End vote": "Oyu bitir",
|
|
6848
6809
|
"Enforce unique vote is enabled": "Benzersiz oy etkinleştirildi",
|
|
6849
6810
|
"Error": "Hata",
|
|
6850
|
-
"Error · Unsent": "Hata · Gönderilemedi",
|
|
6851
6811
|
"Error adding flag": "Bayrak eklenirken hata oluştu",
|
|
6852
6812
|
"Error connecting to chat, refresh the page to try again.": "Bağlantı hatası, sayfayı yenileyip tekrar deneyin.",
|
|
6853
6813
|
"Error deleting message": "Mesaj silinirken hata oluştu",
|
|
@@ -6969,8 +6929,6 @@ const trTranslations = {
|
|
|
6969
6929
|
"Maximum number of votes (from 2 to 10)": "Maksimum oy sayısı (2 ile 10 arası)",
|
|
6970
6930
|
Menu,
|
|
6971
6931
|
"Message deleted": "Mesaj silindi",
|
|
6972
|
-
"Message Failed · Click to try again": "Mesaj Başarısız · Tekrar denemek için tıklayın",
|
|
6973
|
-
"Message Failed · Unauthorized": "Mesaj Başarısız · Yetkisiz",
|
|
6974
6932
|
"Message failed to send": "Mesaj gönderilemedi",
|
|
6975
6933
|
"Message has been successfully flagged": "Mesaj başarıyla bayraklandı",
|
|
6976
6934
|
"Message pinned": "Mesaj sabitlendi",
|
|
@@ -7140,6 +7098,7 @@ const trTranslations = {
|
|
|
7140
7098
|
"View translation": "Çeviriyi görüntüle",
|
|
7141
7099
|
"Voice message": "Sesli mesaj",
|
|
7142
7100
|
"Voice message {{ duration }}": "Sesli mesaj {{ duration }}",
|
|
7101
|
+
"Voice message deleted": "Sesli mesaj silindi",
|
|
7143
7102
|
voiceMessageCount_one,
|
|
7144
7103
|
voiceMessageCount_other,
|
|
7145
7104
|
"Vote ended": "Oylama sona erdi",
|
|
@@ -8569,11 +8528,18 @@ function useActionHandler(message) {
|
|
|
8569
8528
|
}
|
|
8570
8529
|
const useDeleteHandler = (message, notifications = {}) => {
|
|
8571
8530
|
const { getErrorNotification, notify } = notifications;
|
|
8572
|
-
const { deleteMessage, updateMessage } = useChannelActionContext("useDeleteHandler");
|
|
8531
|
+
const { deleteMessage, removeMessage, updateMessage } = useChannelActionContext("useDeleteHandler");
|
|
8573
8532
|
const { client } = useChatContext("useDeleteHandler");
|
|
8574
8533
|
const { t } = useTranslationContext("useDeleteHandler");
|
|
8575
8534
|
return async (options) => {
|
|
8576
|
-
if (!message
|
|
8535
|
+
if (!message) {
|
|
8536
|
+
return;
|
|
8537
|
+
}
|
|
8538
|
+
if (message.type === "error" || isNetworkSendFailure(message)) {
|
|
8539
|
+
removeMessage?.(message);
|
|
8540
|
+
return;
|
|
8541
|
+
}
|
|
8542
|
+
if (!message.id || !client || !updateMessage) {
|
|
8577
8543
|
return;
|
|
8578
8544
|
}
|
|
8579
8545
|
try {
|
|
@@ -8582,6 +8548,7 @@ const useDeleteHandler = (message, notifications = {}) => {
|
|
|
8582
8548
|
} catch (e) {
|
|
8583
8549
|
const errorMessage = getErrorNotification && validateAndGetMessage(getErrorNotification, [message]);
|
|
8584
8550
|
if (notify) notify(errorMessage || t("Error deleting message"), "error");
|
|
8551
|
+
throw e;
|
|
8585
8552
|
}
|
|
8586
8553
|
};
|
|
8587
8554
|
};
|
|
@@ -8893,7 +8860,7 @@ const useUserRole = (message, onlySenderCanEdit, disableQuotedMessages) => {
|
|
|
8893
8860
|
const canFlag = !isMyMessage && channelCapabilities["flag-message"];
|
|
8894
8861
|
const canMute = !isMyMessage && channelCapabilities["mute-channel"];
|
|
8895
8862
|
const canBlockUser = !isMyMessage;
|
|
8896
|
-
const canMarkUnread = channelCapabilities["read-events"];
|
|
8863
|
+
const canMarkUnread = !isMyMessage && channelCapabilities["read-events"];
|
|
8897
8864
|
const canQuote = !disableQuotedMessages && channelCapabilities["quote-message"];
|
|
8898
8865
|
const canReact = channelCapabilities["send-reaction"];
|
|
8899
8866
|
const canReply = channelCapabilities["send-reply"];
|
|
@@ -8990,73 +8957,6 @@ const useMessageReminder = (messageId) => {
|
|
|
8990
8957
|
const { reminder } = useStateStore(client.reminders.state, reminderSelector);
|
|
8991
8958
|
return reminder;
|
|
8992
8959
|
};
|
|
8993
|
-
const ActionsIcon = ({ className = "" }) => /* @__PURE__ */ jsx(
|
|
8994
|
-
"svg",
|
|
8995
|
-
{
|
|
8996
|
-
className,
|
|
8997
|
-
height: "4",
|
|
8998
|
-
viewBox: "0 0 11 4",
|
|
8999
|
-
width: "11",
|
|
9000
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9001
|
-
children: /* @__PURE__ */ jsx(
|
|
9002
|
-
"path",
|
|
9003
|
-
{
|
|
9004
|
-
d: "M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z",
|
|
9005
|
-
fillRule: "nonzero"
|
|
9006
|
-
}
|
|
9007
|
-
)
|
|
9008
|
-
}
|
|
9009
|
-
);
|
|
9010
|
-
const ReactionIcon = ({ className = "" }) => /* @__PURE__ */ jsx(
|
|
9011
|
-
"svg",
|
|
9012
|
-
{
|
|
9013
|
-
className,
|
|
9014
|
-
height: "12",
|
|
9015
|
-
viewBox: "0 0 12 12",
|
|
9016
|
-
width: "12",
|
|
9017
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9018
|
-
children: /* @__PURE__ */ jsxs("g", { clipRule: "evenodd", fillRule: "evenodd", children: [
|
|
9019
|
-
/* @__PURE__ */ jsx("path", { d: "M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z" }),
|
|
9020
|
-
/* @__PURE__ */ jsx("path", { d: "M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z" })
|
|
9021
|
-
] })
|
|
9022
|
-
}
|
|
9023
|
-
);
|
|
9024
|
-
const ThreadIcon = ({ className = "" }) => /* @__PURE__ */ jsx("svg", { className, height: "10", width: "14", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
|
|
9025
|
-
"path",
|
|
9026
|
-
{
|
|
9027
|
-
d: "M8.516 3c4.78 0 4.972 6.5 4.972 6.5-1.6-2.906-2.847-3.184-4.972-3.184v2.872L3.772 4.994 8.516.5V3zM.484 5l4.5-4.237v1.78L2.416 5l2.568 2.125v1.828L.484 5z",
|
|
9028
|
-
fillRule: "evenodd"
|
|
9029
|
-
}
|
|
9030
|
-
) });
|
|
9031
|
-
const PinIcon = () => /* @__PURE__ */ jsx("svg", { height: "13", viewBox: "0 0 14 13", width: "14", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
|
|
9032
|
-
"path",
|
|
9033
|
-
{
|
|
9034
|
-
d: "M13.3518 6.686L6.75251 0.0866699L5.80984 1.02867L6.75318 1.972V1.97334L3.45318 5.272L3.45251 5.27334L2.50984 4.32934L1.56718 5.27267L4.39584 8.10067L0.624512 11.8713L1.56718 12.814L5.33851 9.04334L8.16718 11.8713L9.10984 10.9293L8.16718 9.986L11.4672 6.686L12.4098 7.62867L13.3518 6.686ZM7.22451 9.04267L7.22385 9.04334L4.39584 6.21467L7.69518 2.91467L10.5232 5.74267L7.22451 9.04267Z",
|
|
9035
|
-
fillRule: "evenodd"
|
|
9036
|
-
}
|
|
9037
|
-
) });
|
|
9038
|
-
const MessageErrorIcon = () => /* @__PURE__ */ jsx("div", { className: "str-chat__message-error-icon", children: /* @__PURE__ */ jsxs(
|
|
9039
|
-
"svg",
|
|
9040
|
-
{
|
|
9041
|
-
"data-testid": "error",
|
|
9042
|
-
fill: "none",
|
|
9043
|
-
height: "24",
|
|
9044
|
-
viewBox: "0 0 24 24",
|
|
9045
|
-
width: "24",
|
|
9046
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9047
|
-
children: [
|
|
9048
|
-
/* @__PURE__ */ jsx(
|
|
9049
|
-
"path",
|
|
9050
|
-
{
|
|
9051
|
-
d: "M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2Z",
|
|
9052
|
-
fill: "black",
|
|
9053
|
-
id: "background"
|
|
9054
|
-
}
|
|
9055
|
-
),
|
|
9056
|
-
/* @__PURE__ */ jsx("path", { d: "M13 17H11V15H13V17ZM13 13H11V7H13V13Z", fill: "white" })
|
|
9057
|
-
]
|
|
9058
|
-
}
|
|
9059
|
-
) });
|
|
9060
8960
|
const Root = forwardRef(function AlertRoot({ children, className, ...props }, ref) {
|
|
9061
8961
|
return /* @__PURE__ */ jsx("div", { ...props, className: clsx("str-chat__alert-root", className), ref, children });
|
|
9062
8962
|
});
|
|
@@ -9317,6 +9217,11 @@ const Badge = ({
|
|
|
9317
9217
|
children
|
|
9318
9218
|
}
|
|
9319
9219
|
);
|
|
9220
|
+
const ErrorBadge = ({
|
|
9221
|
+
className,
|
|
9222
|
+
size = "sm",
|
|
9223
|
+
...rest
|
|
9224
|
+
}) => /* @__PURE__ */ jsx(Badge, { ...rest, className, size, variant: "error", children: /* @__PURE__ */ jsx(IconExclamation, {}) });
|
|
9320
9225
|
function AvatarStack({
|
|
9321
9226
|
badgeSize,
|
|
9322
9227
|
component: Component2 = "div",
|
|
@@ -9841,9 +9746,9 @@ const GlobalModal = ({
|
|
|
9841
9746
|
(source, event) => {
|
|
9842
9747
|
const allow = onCloseAttempt?.(source, event);
|
|
9843
9748
|
if (allow !== false) {
|
|
9844
|
-
onClose?.(event);
|
|
9845
9749
|
dialog.close();
|
|
9846
9750
|
closingRef.current = true;
|
|
9751
|
+
onClose?.(event);
|
|
9847
9752
|
}
|
|
9848
9753
|
},
|
|
9849
9754
|
[dialog, onClose, onCloseAttempt]
|
|
@@ -10019,6 +9924,7 @@ const useBaseMessageActionSetFilter = (messageActionSet, disable = false) => {
|
|
|
10019
9924
|
const isMessageThreadReply = typeof message.parent_id === "string";
|
|
10020
9925
|
const isBounced = isMessageBounced(message);
|
|
10021
9926
|
const allowRetry = isMessageErrorRetryable(message);
|
|
9927
|
+
const hasNetworkSendFailure = isNetworkSendFailure(message);
|
|
10022
9928
|
return useMemo(() => {
|
|
10023
9929
|
if (disable) return messageActionSet;
|
|
10024
9930
|
if (isBounced || isInitialMessage || // not sure whether this thing even works anymore
|
|
@@ -10028,7 +9934,7 @@ const useBaseMessageActionSetFilter = (messageActionSet, disable = false) => {
|
|
|
10028
9934
|
if (ACTIONS_NOT_WORKING_IN_THREAD.includes(type) && isMessageThreadReply)
|
|
10029
9935
|
return false;
|
|
10030
9936
|
if (message.error) {
|
|
10031
|
-
return type === "resendMessage" && canSendMessage && (allowRetry || isBounced) || type === "edit" &&
|
|
9937
|
+
return type === "resendMessage" && canSendMessage && (allowRetry || isBounced) || type === "edit" && (isBounced && canEdit || hasNetworkSendFailure) || type === "delete" && (isBounced && canDelete || hasNetworkSendFailure);
|
|
10032
9938
|
}
|
|
10033
9939
|
if (type === "resendMessage" || type === "blockUser" && !canBlockUser || type === "copyMessageText" && !message.text || type === "delete" && !canDelete || type === "edit" && !canEdit || type === "flag" && !canFlag || type === "markUnread" && !canMarkUnread || type === "mute" && !canMute || type === "quote" && !canQuote || type === "react" && !canReact || type === "reply" && !canReply || type === "remindMe" && !channelConfig?.["user_message_reminders"] || type === "saveForLater" && !channelConfig?.["user_message_reminders"])
|
|
10034
9940
|
return false;
|
|
@@ -10055,6 +9961,7 @@ const useBaseMessageActionSetFilter = (messageActionSet, disable = false) => {
|
|
|
10055
9961
|
message.text,
|
|
10056
9962
|
message.type,
|
|
10057
9963
|
disable,
|
|
9964
|
+
hasNetworkSendFailure,
|
|
10058
9965
|
messageActionSet
|
|
10059
9966
|
]);
|
|
10060
9967
|
};
|
|
@@ -10679,17 +10586,6 @@ const renderText = (text2, mentionedUsers, {
|
|
|
10679
10586
|
}
|
|
10680
10587
|
) });
|
|
10681
10588
|
};
|
|
10682
|
-
const ROOT_CLASS_NAME = "str-chat__message--error-message";
|
|
10683
|
-
function MessageErrorText({ message }) {
|
|
10684
|
-
const { t } = useTranslationContext("MessageText");
|
|
10685
|
-
if (message.type === "error" && !isMessageBounced(message)) {
|
|
10686
|
-
return /* @__PURE__ */ jsx("div", { className: ROOT_CLASS_NAME, children: t("Error · Unsent") });
|
|
10687
|
-
}
|
|
10688
|
-
if (message.status === "failed") {
|
|
10689
|
-
return /* @__PURE__ */ jsx("div", { className: ROOT_CLASS_NAME, children: message.error?.status !== 403 ? t("Message Failed · Click to try again") : t("Message Failed · Unauthorized") });
|
|
10690
|
-
}
|
|
10691
|
-
return null;
|
|
10692
|
-
}
|
|
10693
10589
|
const UnMemoizedMessageTextComponent = (props) => {
|
|
10694
10590
|
const {
|
|
10695
10591
|
customInnerClass,
|
|
@@ -10717,7 +10613,7 @@ const UnMemoizedMessageTextComponent = (props) => {
|
|
|
10717
10613
|
const wrapperClass = customWrapperClass || "str-chat__message-text";
|
|
10718
10614
|
const innerClass = customInnerClass;
|
|
10719
10615
|
if (!messageTextToRender) return null;
|
|
10720
|
-
return /* @__PURE__ */ jsx("div", { className: wrapperClass, tabIndex: 0, children: /* @__PURE__ */
|
|
10616
|
+
return /* @__PURE__ */ jsx("div", { className: wrapperClass, tabIndex: 0, children: /* @__PURE__ */ jsx(
|
|
10721
10617
|
"div",
|
|
10722
10618
|
{
|
|
10723
10619
|
className: clsx(innerClass, {
|
|
@@ -10727,10 +10623,7 @@ const UnMemoizedMessageTextComponent = (props) => {
|
|
|
10727
10623
|
"data-testid": "message-text-inner-wrapper",
|
|
10728
10624
|
onClick: onMentionsClickMessage,
|
|
10729
10625
|
onMouseOver: onMentionsHoverMessage,
|
|
10730
|
-
children:
|
|
10731
|
-
/* @__PURE__ */ jsx(MessageErrorText, { message }),
|
|
10732
|
-
unsafeHTML && message.html ? /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: message.html } }) : /* @__PURE__ */ jsx("div", { children: messageText })
|
|
10733
|
-
]
|
|
10626
|
+
children: unsafeHTML && message.html ? /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: message.html } }) : /* @__PURE__ */ jsx("div", { children: messageText })
|
|
10734
10627
|
}
|
|
10735
10628
|
) });
|
|
10736
10629
|
};
|
|
@@ -15076,10 +14969,12 @@ const PollOptionSelector = ({
|
|
|
15076
14969
|
canCastVote && /* @__PURE__ */ jsx(Checkmark, { checked: !!ownVotesByOptionId[option.id] }),
|
|
15077
14970
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__poll-option-data", children: [
|
|
15078
14971
|
/* @__PURE__ */ jsx("p", { className: "str-chat__poll-option-text", children: option.text }),
|
|
15079
|
-
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
14972
|
+
/* @__PURE__ */ jsxs("div", { className: "str-chat__poll-option-votes", children: [
|
|
14973
|
+
displayAvatarCount && voting_visibility === "public" && /* @__PURE__ */ jsx("div", { className: "str-chat__poll-option-voters", children: /* @__PURE__ */ jsx(AvatarStack$1, { displayInfo: avatarDisplayInfo, size: "xs" }) }),
|
|
14974
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__poll-option-vote-count", children: voteCountVerbose ? t("{{count}} votes", {
|
|
14975
|
+
count: vote_counts_by_option[option.id] ?? 0
|
|
14976
|
+
}) : vote_counts_by_option[option.id] ?? 0 })
|
|
14977
|
+
] })
|
|
15083
14978
|
] }),
|
|
15084
14979
|
/* @__PURE__ */ jsx(
|
|
15085
14980
|
AmountBar,
|
|
@@ -15594,31 +15489,34 @@ const CommandContextMenuItem = ({
|
|
|
15594
15489
|
}
|
|
15595
15490
|
);
|
|
15596
15491
|
};
|
|
15597
|
-
const AttachmentSelectorMenuInitButtonIcon = () => {
|
|
15492
|
+
const AttachmentSelectorMenuInitButtonIcon = ({ className }) => {
|
|
15598
15493
|
const { AttachmentSelectorInitiationButtonContents } = useComponentContext();
|
|
15599
15494
|
if (AttachmentSelectorInitiationButtonContents) {
|
|
15600
|
-
return /* @__PURE__ */ jsx(AttachmentSelectorInitiationButtonContents, {});
|
|
15495
|
+
return /* @__PURE__ */ jsx("span", { className, children: /* @__PURE__ */ jsx(AttachmentSelectorInitiationButtonContents, {}) });
|
|
15601
15496
|
}
|
|
15602
|
-
return /* @__PURE__ */ jsx(
|
|
15497
|
+
return /* @__PURE__ */ jsx(
|
|
15498
|
+
IconPlusLarge,
|
|
15499
|
+
{
|
|
15500
|
+
className: clsx("str-chat__attachment-selector__menu-button__icon", className)
|
|
15501
|
+
}
|
|
15502
|
+
);
|
|
15603
15503
|
};
|
|
15604
|
-
const AttachmentSelectorButton = forwardRef(
|
|
15605
|
-
|
|
15606
|
-
|
|
15607
|
-
|
|
15608
|
-
|
|
15609
|
-
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
|
|
15613
|
-
|
|
15614
|
-
|
|
15615
|
-
|
|
15616
|
-
|
|
15617
|
-
|
|
15618
|
-
|
|
15619
|
-
|
|
15620
|
-
}
|
|
15621
|
-
);
|
|
15504
|
+
const AttachmentSelectorButton = forwardRef(function AttachmentSelectorButton2({ className, iconClassName, ...props }, ref) {
|
|
15505
|
+
return /* @__PURE__ */ jsx(
|
|
15506
|
+
Button,
|
|
15507
|
+
{
|
|
15508
|
+
appearance: "outline",
|
|
15509
|
+
circular: true,
|
|
15510
|
+
className: clsx("str-chat__attachment-selector__menu-button", className),
|
|
15511
|
+
"data-testid": "invoke-attachment-selector-button",
|
|
15512
|
+
size: "lg",
|
|
15513
|
+
variant: "secondary",
|
|
15514
|
+
...props,
|
|
15515
|
+
ref,
|
|
15516
|
+
children: /* @__PURE__ */ jsx(AttachmentSelectorMenuInitButtonIcon, { className: iconClassName })
|
|
15517
|
+
}
|
|
15518
|
+
);
|
|
15519
|
+
});
|
|
15622
15520
|
const SimpleAttachmentSelector = () => {
|
|
15623
15521
|
const { channelCapabilities } = useChannelStateContext();
|
|
15624
15522
|
const inputRef = useRef(null);
|
|
@@ -15841,10 +15739,10 @@ const AttachmentSelector = ({
|
|
|
15841
15739
|
"aria-expanded": menuDialogIsOpen,
|
|
15842
15740
|
"aria-haspopup": "true",
|
|
15843
15741
|
"aria-label": t("aria/Open Attachment Selector"),
|
|
15844
|
-
|
|
15742
|
+
disabled: isCooldownActive,
|
|
15743
|
+
iconClassName: clsx("str-chat__prepare-rotate45", {
|
|
15845
15744
|
"str-chat__rotate45": menuDialogIsOpen
|
|
15846
15745
|
}),
|
|
15847
|
-
disabled: isCooldownActive,
|
|
15848
15746
|
onClick: () => menuDialog?.toggle(),
|
|
15849
15747
|
ref: menuButtonRef
|
|
15850
15748
|
}
|
|
@@ -15969,449 +15867,62 @@ const PlayIcon = () => /* @__PURE__ */ jsx(
|
|
|
15969
15867
|
}
|
|
15970
15868
|
);
|
|
15971
15869
|
const CheckSignIcon = () => /* @__PURE__ */ jsx("svg", { fill: "currentColor", viewBox: "0 0 18 14", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M5.79457 10.875L2.32457 7.40502C1.93457 7.01502 1.30457 7.01502 0.91457 7.40502C0.52457 7.79502 0.52457 8.42502 0.91457 8.81502L5.09457 12.995C5.48457 13.385 6.11457 13.385 6.50457 12.995L17.0846 2.41502C17.4746 2.02502 17.4746 1.39502 17.0846 1.00502C16.6946 0.615024 16.0646 0.615024 15.6746 1.00502L5.79457 10.875Z" }) });
|
|
15972
|
-
const
|
|
15973
|
-
|
|
15974
|
-
|
|
15975
|
-
|
|
15976
|
-
|
|
15977
|
-
|
|
15978
|
-
|
|
15979
|
-
);
|
|
15980
|
-
return {};
|
|
15870
|
+
const INTERACTIVE_SELECTOR = 'button, a, input, textarea, select, [role="button"], [role="link"], [data-interactive="true"]';
|
|
15871
|
+
function hasInteractiveAncestorBeforeRoot(target, root) {
|
|
15872
|
+
if (!(target instanceof Element) || !root) return false;
|
|
15873
|
+
let el = target;
|
|
15874
|
+
while (el && el !== root) {
|
|
15875
|
+
if (el.matches(INTERACTIVE_SELECTOR)) return true;
|
|
15876
|
+
el = el.parentElement;
|
|
15981
15877
|
}
|
|
15982
|
-
return
|
|
15983
|
-
}
|
|
15984
|
-
const
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
onRequestClose
|
|
15878
|
+
return false;
|
|
15879
|
+
}
|
|
15880
|
+
const AttachmentPreviewRoot = ({
|
|
15881
|
+
attachment,
|
|
15882
|
+
onPressed,
|
|
15883
|
+
openPreview,
|
|
15884
|
+
tabIndex = 0,
|
|
15885
|
+
...props
|
|
15991
15886
|
}) => {
|
|
15992
|
-
const [currentIndex, setCurrentIndex] = useState(initialIndex);
|
|
15993
|
-
const itemCount = items.length;
|
|
15994
|
-
const goToIndex = useCallback(
|
|
15995
|
-
(index) => {
|
|
15996
|
-
if (index >= 0 && index < itemCount) {
|
|
15997
|
-
setCurrentIndex(index);
|
|
15998
|
-
}
|
|
15999
|
-
},
|
|
16000
|
-
[itemCount]
|
|
16001
|
-
);
|
|
16002
|
-
const goToNext = useCallback(() => {
|
|
16003
|
-
setCurrentIndex((prev) => prev < itemCount - 1 ? prev + 1 : prev);
|
|
16004
|
-
}, [itemCount]);
|
|
16005
|
-
const goToPrevious = useCallback(() => {
|
|
16006
|
-
setCurrentIndex((prev) => prev > 0 ? prev - 1 : prev);
|
|
16007
|
-
}, []);
|
|
16008
|
-
useEffect(() => {
|
|
16009
|
-
onIndexChange?.(currentIndex);
|
|
16010
|
-
}, [currentIndex, onIndexChange]);
|
|
16011
|
-
const hasNext = currentIndex < itemCount - 1;
|
|
16012
|
-
const hasPrevious = currentIndex > 0;
|
|
16013
|
-
const currentItem = items[currentIndex];
|
|
16014
|
-
const contextValue = useMemo(
|
|
16015
|
-
() => ({
|
|
16016
|
-
closeOnBackgroundClick,
|
|
16017
|
-
currentIndex,
|
|
16018
|
-
currentItem,
|
|
16019
|
-
goToIndex,
|
|
16020
|
-
goToNext,
|
|
16021
|
-
goToPrevious,
|
|
16022
|
-
hasNext,
|
|
16023
|
-
hasPrevious,
|
|
16024
|
-
itemCount,
|
|
16025
|
-
items,
|
|
16026
|
-
onRequestClose
|
|
16027
|
-
}),
|
|
16028
|
-
[
|
|
16029
|
-
closeOnBackgroundClick,
|
|
16030
|
-
currentIndex,
|
|
16031
|
-
currentItem,
|
|
16032
|
-
goToIndex,
|
|
16033
|
-
goToNext,
|
|
16034
|
-
goToPrevious,
|
|
16035
|
-
hasNext,
|
|
16036
|
-
hasPrevious,
|
|
16037
|
-
itemCount,
|
|
16038
|
-
items,
|
|
16039
|
-
onRequestClose
|
|
16040
|
-
]
|
|
16041
|
-
);
|
|
16042
|
-
return /* @__PURE__ */ jsx(GalleryContext.Provider, { value: contextValue, children: GalleryUI2 ? /* @__PURE__ */ jsx(GalleryUI2, {}) : null });
|
|
16043
|
-
};
|
|
16044
|
-
const GalleryHeader = ({ currentItem }) => {
|
|
16045
15887
|
const { t } = useTranslationContext();
|
|
16046
|
-
const
|
|
16047
|
-
const
|
|
16048
|
-
const
|
|
16049
|
-
const
|
|
16050
|
-
const
|
|
16051
|
-
|
|
16052
|
-
if (
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
const downloadLabel = t("aria/Download attachment");
|
|
16057
|
-
return /* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__header", children: [
|
|
16058
|
-
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "str-chat__gallery__header-spacer" }),
|
|
16059
|
-
/* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__header-meta", children: [
|
|
16060
|
-
/* @__PURE__ */ jsx("div", { className: "str-chat__gallery__title", children: headerTitle }),
|
|
16061
|
-
message?.created_at ? /* @__PURE__ */ jsx(MessageTimestamp$1, { customClass: "str-chat__gallery__timestamp" }) : null
|
|
16062
|
-
] }),
|
|
16063
|
-
/* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__header-actions", children: [
|
|
16064
|
-
downloadUrl ? /* @__PURE__ */ jsx(
|
|
16065
|
-
"a",
|
|
16066
|
-
{
|
|
16067
|
-
"aria-label": downloadLabel,
|
|
16068
|
-
className: "str-chat__gallery__action-button str-chat__gallery__action-button--download",
|
|
16069
|
-
download: true,
|
|
16070
|
-
href: downloadUrl,
|
|
16071
|
-
rel: "noreferrer",
|
|
16072
|
-
target: "_blank",
|
|
16073
|
-
title: downloadLabel,
|
|
16074
|
-
children: /* @__PURE__ */ jsx(IconArrowDownCircle, {})
|
|
16075
|
-
}
|
|
16076
|
-
) : null,
|
|
16077
|
-
modalContext?.close ? /* @__PURE__ */ jsx(
|
|
16078
|
-
Button,
|
|
16079
|
-
{
|
|
16080
|
-
"aria-label": t("Close"),
|
|
16081
|
-
className: "str-chat__gallery__action-button str-chat__gallery__action-button--close",
|
|
16082
|
-
onClick: modalContext.close,
|
|
16083
|
-
title: t("Close"),
|
|
16084
|
-
children: /* @__PURE__ */ jsx(IconCrossMedium, {})
|
|
16085
|
-
}
|
|
16086
|
-
) : null
|
|
16087
|
-
] })
|
|
16088
|
-
] });
|
|
16089
|
-
};
|
|
16090
|
-
const VideoPlayer = ({ isPlaying, thumbnailUrl, videoUrl }) => {
|
|
16091
|
-
const { VideoPlayer: VideoPlayerContext } = useComponentContext();
|
|
16092
|
-
return VideoPlayerContext ? /* @__PURE__ */ jsx(VideoPlayerContext, { thumbnailUrl, videoUrl }) : /* @__PURE__ */ jsx(
|
|
16093
|
-
ReactPlayer,
|
|
16094
|
-
{
|
|
16095
|
-
className: "react-player",
|
|
16096
|
-
config: { file: { attributes: { poster: thumbnailUrl } } },
|
|
16097
|
-
controls: true,
|
|
16098
|
-
height: "100%",
|
|
16099
|
-
playing: isPlaying,
|
|
16100
|
-
url: videoUrl,
|
|
16101
|
-
width: "100%"
|
|
15888
|
+
const [root, setRoot] = useState(null);
|
|
15889
|
+
const url = attachment.asset_url || attachment.image_url || attachment.localMetadata.previewUri;
|
|
15890
|
+
const canDownloadAttachment = false;
|
|
15891
|
+
const canPreviewAttachment = !!openPreview && (!!url && isImageAttachment(attachment) || isVideoAttachment(attachment));
|
|
15892
|
+
const handlePressed = (e) => {
|
|
15893
|
+
if (e.defaultPrevented) return;
|
|
15894
|
+
if (hasInteractiveAncestorBeforeRoot(e.target, root)) return;
|
|
15895
|
+
if (onPressed) {
|
|
15896
|
+
const shouldContinue = onPressed(e);
|
|
15897
|
+
if (!shouldContinue) return;
|
|
16102
15898
|
}
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
const VideoThumbnail = ({
|
|
16106
|
-
className,
|
|
16107
|
-
onPlay,
|
|
16108
|
-
...imageProps
|
|
16109
|
-
}) => {
|
|
16110
|
-
const { t } = useTranslationContext();
|
|
16111
|
-
return /* @__PURE__ */ jsxs("div", { className: "str-chat__message-attachment__video-thumbnail", children: [
|
|
16112
|
-
/* @__PURE__ */ jsx(
|
|
16113
|
-
BaseImage,
|
|
16114
|
-
{
|
|
16115
|
-
className: clsx("str-chat__message-attachment__video-thumbnail-image", className),
|
|
16116
|
-
...imageProps
|
|
16117
|
-
}
|
|
16118
|
-
),
|
|
16119
|
-
onPlay ? /* @__PURE__ */ jsx(
|
|
16120
|
-
Button,
|
|
16121
|
-
{
|
|
16122
|
-
appearance: "solid",
|
|
16123
|
-
"aria-label": t("Play video"),
|
|
16124
|
-
circular: true,
|
|
16125
|
-
className: clsx(
|
|
16126
|
-
"str-chat__message-attachment__video-thumbnail__play-indicator"
|
|
16127
|
-
),
|
|
16128
|
-
onClick: onPlay,
|
|
16129
|
-
size: "lg",
|
|
16130
|
-
variant: "secondary",
|
|
16131
|
-
children: /* @__PURE__ */ jsx(IconPlaySolid, {})
|
|
16132
|
-
}
|
|
16133
|
-
) : /* @__PURE__ */ jsx("div", { className: "str-chat__message-attachment__video-thumbnail__play-indicator", children: /* @__PURE__ */ jsx(IconPlaySolid, {}) })
|
|
16134
|
-
] });
|
|
16135
|
-
};
|
|
16136
|
-
const SWIPE_THRESHOLD = 50;
|
|
16137
|
-
const TRANSITION_DURATION = 300;
|
|
16138
|
-
const GalleryUI = () => {
|
|
16139
|
-
const { t } = useTranslationContext();
|
|
16140
|
-
const {
|
|
16141
|
-
closeOnBackgroundClick,
|
|
16142
|
-
currentIndex,
|
|
16143
|
-
currentItem,
|
|
16144
|
-
goToNext,
|
|
16145
|
-
goToPrevious,
|
|
16146
|
-
hasNext,
|
|
16147
|
-
hasPrevious,
|
|
16148
|
-
itemCount,
|
|
16149
|
-
onRequestClose
|
|
16150
|
-
} = useGalleryContext();
|
|
16151
|
-
const modalContext = useContext(ModalContext);
|
|
16152
|
-
const [showVideo, setShowVideo] = useState(false);
|
|
16153
|
-
const isTransitioningRef = useRef(false);
|
|
16154
|
-
const [slideOffset, setSlideOffset] = useState(0);
|
|
16155
|
-
const [isDragging, setIsDragging] = useState(false);
|
|
16156
|
-
const [slideDirection, setSlideDirection] = useState(
|
|
16157
|
-
null
|
|
16158
|
-
);
|
|
16159
|
-
const ignoreNextClickRef = useRef(false);
|
|
16160
|
-
const touchStartRef = useRef(null);
|
|
16161
|
-
const isVerticalSwipeRef = useRef(false);
|
|
16162
|
-
const containerRef = useRef(null);
|
|
16163
|
-
useEffect(() => {
|
|
16164
|
-
setShowVideo(false);
|
|
16165
|
-
}, [currentIndex]);
|
|
16166
|
-
const prevIndexRef = useRef(currentIndex);
|
|
16167
|
-
useEffect(() => {
|
|
16168
|
-
if (prevIndexRef.current === currentIndex) return;
|
|
16169
|
-
const direction = currentIndex > prevIndexRef.current ? "forward" : "backward";
|
|
16170
|
-
setSlideDirection(direction);
|
|
16171
|
-
setSlideOffset(0);
|
|
16172
|
-
setIsDragging(false);
|
|
16173
|
-
isTransitioningRef.current = true;
|
|
16174
|
-
const timer = setTimeout(() => {
|
|
16175
|
-
setSlideDirection(null);
|
|
16176
|
-
isTransitioningRef.current = false;
|
|
16177
|
-
}, TRANSITION_DURATION);
|
|
16178
|
-
prevIndexRef.current = currentIndex;
|
|
16179
|
-
return () => clearTimeout(timer);
|
|
16180
|
-
}, [currentIndex]);
|
|
16181
|
-
const handleGoToNext = useCallback(() => {
|
|
16182
|
-
if (isTransitioningRef.current) return;
|
|
16183
|
-
goToNext();
|
|
16184
|
-
}, [goToNext]);
|
|
16185
|
-
const handleGoToPrevious = useCallback(() => {
|
|
16186
|
-
if (isTransitioningRef.current) return;
|
|
16187
|
-
goToPrevious();
|
|
16188
|
-
}, [goToPrevious]);
|
|
16189
|
-
const handleKeyDown = useCallback(
|
|
16190
|
-
(event) => {
|
|
16191
|
-
if (event.key === "ArrowLeft") {
|
|
16192
|
-
event.preventDefault();
|
|
16193
|
-
handleGoToPrevious();
|
|
16194
|
-
} else if (event.key === "ArrowRight") {
|
|
16195
|
-
event.preventDefault();
|
|
16196
|
-
handleGoToNext();
|
|
16197
|
-
}
|
|
16198
|
-
},
|
|
16199
|
-
[handleGoToNext, handleGoToPrevious]
|
|
16200
|
-
);
|
|
16201
|
-
useEffect(() => {
|
|
16202
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
16203
|
-
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
16204
|
-
}, [handleKeyDown]);
|
|
16205
|
-
const handleTouchStart = useCallback((event) => {
|
|
16206
|
-
if (isTransitioningRef.current) return;
|
|
16207
|
-
const touch = event.touches[0];
|
|
16208
|
-
ignoreNextClickRef.current = false;
|
|
16209
|
-
touchStartRef.current = { x: touch.clientX, y: touch.clientY };
|
|
16210
|
-
isVerticalSwipeRef.current = false;
|
|
16211
|
-
}, []);
|
|
16212
|
-
const handleTouchMove = useCallback(
|
|
16213
|
-
(event) => {
|
|
16214
|
-
if (!touchStartRef.current || isTransitioningRef.current) return;
|
|
16215
|
-
const touch = event.touches[0];
|
|
16216
|
-
const deltaX = touch.clientX - touchStartRef.current.x;
|
|
16217
|
-
const deltaY = touch.clientY - touchStartRef.current.y;
|
|
16218
|
-
if (!isDragging && !isVerticalSwipeRef.current) {
|
|
16219
|
-
if (Math.abs(deltaY) > Math.abs(deltaX) && Math.abs(deltaY) > 10) {
|
|
16220
|
-
ignoreNextClickRef.current = true;
|
|
16221
|
-
isVerticalSwipeRef.current = true;
|
|
16222
|
-
return;
|
|
16223
|
-
}
|
|
16224
|
-
if (Math.abs(deltaX) > 10) {
|
|
16225
|
-
ignoreNextClickRef.current = true;
|
|
16226
|
-
setIsDragging(true);
|
|
16227
|
-
}
|
|
16228
|
-
}
|
|
16229
|
-
if (isVerticalSwipeRef.current) return;
|
|
16230
|
-
if (!hasNext && deltaX < 0 || !hasPrevious && deltaX > 0) {
|
|
16231
|
-
setSlideOffset(deltaX * 0.3);
|
|
16232
|
-
} else {
|
|
16233
|
-
setSlideOffset(deltaX);
|
|
16234
|
-
}
|
|
16235
|
-
},
|
|
16236
|
-
[isDragging, hasNext, hasPrevious]
|
|
16237
|
-
);
|
|
16238
|
-
const handleTouchEnd = useCallback(() => {
|
|
16239
|
-
if (!touchStartRef.current || isVerticalSwipeRef.current) {
|
|
16240
|
-
if (isVerticalSwipeRef.current) ignoreNextClickRef.current = true;
|
|
16241
|
-
touchStartRef.current = null;
|
|
15899
|
+
if (canPreviewAttachment) {
|
|
15900
|
+
openPreview();
|
|
16242
15901
|
return;
|
|
16243
15902
|
}
|
|
16244
|
-
|
|
16245
|
-
|
|
16246
|
-
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16254
|
-
|
|
16255
|
-
|
|
16256
|
-
}
|
|
16257
|
-
|
|
16258
|
-
|
|
15903
|
+
};
|
|
15904
|
+
const isInteractive = canPreviewAttachment || canDownloadAttachment;
|
|
15905
|
+
return /* @__PURE__ */ jsx(
|
|
15906
|
+
"div",
|
|
15907
|
+
{
|
|
15908
|
+
"aria-label": isInteractive ? t(canPreviewAttachment ? "aria/Show preview" : "aria/Download attachment") : void 0,
|
|
15909
|
+
...props,
|
|
15910
|
+
onClick: handlePressed,
|
|
15911
|
+
onKeyDown: isInteractive ? (e) => {
|
|
15912
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
15913
|
+
e.preventDefault();
|
|
15914
|
+
handlePressed(e);
|
|
15915
|
+
} : void 0,
|
|
15916
|
+
ref: setRoot,
|
|
15917
|
+
tabIndex: isInteractive ? tabIndex : -1,
|
|
15918
|
+
children: props.children
|
|
16259
15919
|
}
|
|
16260
|
-
setIsDragging(false);
|
|
16261
|
-
}, [slideOffset, hasNext, hasPrevious, goToNext, goToPrevious, isDragging]);
|
|
16262
|
-
const requestClose = modalContext?.close ?? onRequestClose;
|
|
16263
|
-
const handleBackgroundClick = useCallback(
|
|
16264
|
-
(event) => {
|
|
16265
|
-
if (event.target !== event.currentTarget) return;
|
|
16266
|
-
if (ignoreNextClickRef.current) {
|
|
16267
|
-
ignoreNextClickRef.current = false;
|
|
16268
|
-
return;
|
|
16269
|
-
}
|
|
16270
|
-
if (!closeOnBackgroundClick) return;
|
|
16271
|
-
requestClose?.();
|
|
16272
|
-
},
|
|
16273
|
-
[closeOnBackgroundClick, requestClose]
|
|
16274
15920
|
);
|
|
16275
|
-
const mediaStyle = isDragging || slideOffset !== 0 && slideDirection === null ? { transform: `translateX(${slideOffset}px)` } : {};
|
|
16276
|
-
return /* @__PURE__ */ jsxs("div", { className: "str-chat__gallery", children: [
|
|
16277
|
-
/* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__main", children: [
|
|
16278
|
-
/* @__PURE__ */ jsx(GalleryHeader, { currentItem }),
|
|
16279
|
-
/* @__PURE__ */ jsx(
|
|
16280
|
-
NavButton,
|
|
16281
|
-
{
|
|
16282
|
-
"aria-label": t("Previous image"),
|
|
16283
|
-
className: clsx(
|
|
16284
|
-
"str-chat__gallery__nav-button--prev",
|
|
16285
|
-
!hasPrevious && "str-chat__gallery__nav-button--hidden"
|
|
16286
|
-
),
|
|
16287
|
-
disabled: !hasPrevious,
|
|
16288
|
-
onClick: handleGoToPrevious,
|
|
16289
|
-
children: /* @__PURE__ */ jsx(IconChevronLeft, {})
|
|
16290
|
-
}
|
|
16291
|
-
),
|
|
16292
|
-
/* @__PURE__ */ jsx(
|
|
16293
|
-
"div",
|
|
16294
|
-
{
|
|
16295
|
-
className: "str-chat__gallery__slide-container",
|
|
16296
|
-
onClick: handleBackgroundClick,
|
|
16297
|
-
onTouchEnd: handleTouchEnd,
|
|
16298
|
-
onTouchMove: handleTouchMove,
|
|
16299
|
-
onTouchStart: handleTouchStart,
|
|
16300
|
-
ref: containerRef,
|
|
16301
|
-
children: /* @__PURE__ */ jsx(
|
|
16302
|
-
"div",
|
|
16303
|
-
{
|
|
16304
|
-
className: clsx({
|
|
16305
|
-
"str-chat__gallery__media--dragging": isDragging,
|
|
16306
|
-
"str-chat__gallery__media--slide-backward": !isDragging && slideDirection === "backward",
|
|
16307
|
-
"str-chat__gallery__media--slide-forward": !isDragging && slideDirection === "forward"
|
|
16308
|
-
}),
|
|
16309
|
-
style: mediaStyle,
|
|
16310
|
-
children: currentItem.videoUrl && currentItem.videoThumbnailUrl ? /* @__PURE__ */ jsx("div", { className: "str-chat__gallery__media str-chat__gallery__media--video", children: showVideo ? /* @__PURE__ */ jsx(VideoPlayer, { isPlaying: true, videoUrl: currentItem.videoUrl }) : /* @__PURE__ */ jsx(
|
|
16311
|
-
VideoThumbnail,
|
|
16312
|
-
{
|
|
16313
|
-
alt: currentItem.title ?? "",
|
|
16314
|
-
onPlay: () => setShowVideo(true),
|
|
16315
|
-
src: currentItem.videoThumbnailUrl
|
|
16316
|
-
}
|
|
16317
|
-
) }) : /* @__PURE__ */ jsx("div", { className: "str-chat__gallery__media str-chat__gallery__media--image", children: /* @__PURE__ */ jsx(BaseImage, { alt: currentItem.alt, src: currentItem.imageUrl }) })
|
|
16318
|
-
}
|
|
16319
|
-
)
|
|
16320
|
-
}
|
|
16321
|
-
),
|
|
16322
|
-
/* @__PURE__ */ jsx(
|
|
16323
|
-
NavButton,
|
|
16324
|
-
{
|
|
16325
|
-
"aria-label": t("Next image"),
|
|
16326
|
-
className: clsx(
|
|
16327
|
-
"str-chat__gallery__nav-button--next",
|
|
16328
|
-
!hasNext && "str-chat__gallery__nav-button--hidden"
|
|
16329
|
-
),
|
|
16330
|
-
disabled: !hasNext,
|
|
16331
|
-
onClick: handleGoToNext,
|
|
16332
|
-
children: /* @__PURE__ */ jsx(IconChevronRight, {})
|
|
16333
|
-
}
|
|
16334
|
-
)
|
|
16335
|
-
] }),
|
|
16336
|
-
itemCount > 1 && /* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__position-indicator", children: [
|
|
16337
|
-
currentIndex + 1,
|
|
16338
|
-
" of ",
|
|
16339
|
-
itemCount
|
|
16340
|
-
] })
|
|
16341
|
-
] });
|
|
16342
15921
|
};
|
|
16343
|
-
const
|
|
16344
|
-
const INTERACTIVE_SELECTOR = 'button, a, input, textarea, select, [role="button"], [role="link"], [data-interactive="true"]';
|
|
16345
|
-
function hasInteractiveAncestorBeforeRoot(target, root) {
|
|
16346
|
-
if (!(target instanceof Element) || !root) return false;
|
|
16347
|
-
let el = target;
|
|
16348
|
-
while (el && el !== root) {
|
|
16349
|
-
if (el.matches(INTERACTIVE_SELECTOR)) return true;
|
|
16350
|
-
el = el.parentElement;
|
|
16351
|
-
}
|
|
16352
|
-
return false;
|
|
16353
|
-
}
|
|
16354
|
-
const AttachmentPreviewRoot = ({
|
|
15922
|
+
const FileAttachmentPreview = ({
|
|
16355
15923
|
attachment,
|
|
16356
|
-
|
|
16357
|
-
|
|
16358
|
-
...props
|
|
16359
|
-
}) => {
|
|
16360
|
-
const { t } = useTranslationContext("FilePreview");
|
|
16361
|
-
const { Modal = GlobalModal } = useComponentContext();
|
|
16362
|
-
const [showPreview, setShowPreview] = useState(false);
|
|
16363
|
-
const [root, setRoot] = useState(null);
|
|
16364
|
-
const url = attachment.asset_url || attachment.image_url || attachment.localMetadata.previewUri;
|
|
16365
|
-
const canDownloadAttachment = false;
|
|
16366
|
-
const canPreviewAttachment = !!url && isImageAttachment(attachment) || isVideoAttachment(attachment);
|
|
16367
|
-
const handlePressed = (e) => {
|
|
16368
|
-
if (e.defaultPrevented) return;
|
|
16369
|
-
if (hasInteractiveAncestorBeforeRoot(e.target, root)) return;
|
|
16370
|
-
if (onPressed) {
|
|
16371
|
-
const shouldContinue = onPressed(e);
|
|
16372
|
-
if (!shouldContinue) return;
|
|
16373
|
-
}
|
|
16374
|
-
if (canPreviewAttachment) {
|
|
16375
|
-
setShowPreview(true);
|
|
16376
|
-
return;
|
|
16377
|
-
}
|
|
16378
|
-
};
|
|
16379
|
-
return /* @__PURE__ */ jsxs(
|
|
16380
|
-
"div",
|
|
16381
|
-
{
|
|
16382
|
-
"aria-label": t(showPreview ? "aria/Show preview" : "aria/Download attachment"),
|
|
16383
|
-
...props,
|
|
16384
|
-
onClick: handlePressed,
|
|
16385
|
-
onKeyDown: (e) => {
|
|
16386
|
-
if (e.key !== "Enter" && e.key !== " ") return;
|
|
16387
|
-
e.preventDefault();
|
|
16388
|
-
handlePressed(e);
|
|
16389
|
-
},
|
|
16390
|
-
ref: setRoot,
|
|
16391
|
-
role: showPreview ? "button" : props.role,
|
|
16392
|
-
tabIndex: showPreview || canDownloadAttachment ? tabIndex : -1,
|
|
16393
|
-
children: [
|
|
16394
|
-
props.children,
|
|
16395
|
-
/* @__PURE__ */ jsx(
|
|
16396
|
-
Modal,
|
|
16397
|
-
{
|
|
16398
|
-
className: "str-chat__gallery-modal",
|
|
16399
|
-
onClose: (e) => {
|
|
16400
|
-
e.stopPropagation();
|
|
16401
|
-
setShowPreview(false);
|
|
16402
|
-
},
|
|
16403
|
-
open: showPreview && canPreviewAttachment,
|
|
16404
|
-
children: isImageAttachment(attachment) || isVideoAttachment(attachment) ? /* @__PURE__ */ jsx(Gallery, { items: [attachment] }) : null
|
|
16405
|
-
}
|
|
16406
|
-
)
|
|
16407
|
-
]
|
|
16408
|
-
}
|
|
16409
|
-
);
|
|
16410
|
-
};
|
|
16411
|
-
const FileAttachmentPreview = ({
|
|
16412
|
-
attachment,
|
|
16413
|
-
handleRetry,
|
|
16414
|
-
removeAttachments
|
|
15924
|
+
handleRetry,
|
|
15925
|
+
removeAttachments
|
|
16415
15926
|
}) => {
|
|
16416
15927
|
const { t } = useTranslationContext("FilePreview");
|
|
16417
15928
|
const { id, uploadPermissionCheck, uploadState } = attachment.localMetadata ?? {};
|
|
@@ -17031,6 +16542,7 @@ const AudioAttachmentPreview = ({
|
|
|
17031
16542
|
const MediaAttachmentPreview = ({
|
|
17032
16543
|
attachment,
|
|
17033
16544
|
handleRetry,
|
|
16545
|
+
openPreview,
|
|
17034
16546
|
removeAttachments
|
|
17035
16547
|
}) => {
|
|
17036
16548
|
const { t } = useTranslationContext();
|
|
@@ -17060,65 +16572,440 @@ const MediaAttachmentPreview = ({
|
|
|
17060
16572
|
},
|
|
17061
16573
|
[attachment]
|
|
17062
16574
|
);
|
|
17063
|
-
return /* @__PURE__ */ jsxs(
|
|
17064
|
-
AttachmentPreviewRoot,
|
|
17065
|
-
{
|
|
17066
|
-
attachment,
|
|
17067
|
-
className: clsx("str-chat__attachment-preview-media", {
|
|
17068
|
-
"str-chat__attachment-preview-media--thumbnail-preview-error": thumbnailPreviewError,
|
|
17069
|
-
"str-chat__attachment-preview-media--upload-error": hasUploadError,
|
|
17070
|
-
"str-chat__attachment-preview-media--uploading": isUploading
|
|
17071
|
-
}),
|
|
17072
|
-
"data-testid": "attachment-preview-media",
|
|
17073
|
-
onPressed: hasRetriableError ? retry : void 0,
|
|
17074
|
-
|
|
17075
|
-
|
|
17076
|
-
|
|
17077
|
-
|
|
16575
|
+
return /* @__PURE__ */ jsxs(
|
|
16576
|
+
AttachmentPreviewRoot,
|
|
16577
|
+
{
|
|
16578
|
+
attachment,
|
|
16579
|
+
className: clsx("str-chat__attachment-preview-media", {
|
|
16580
|
+
"str-chat__attachment-preview-media--thumbnail-preview-error": thumbnailPreviewError,
|
|
16581
|
+
"str-chat__attachment-preview-media--upload-error": hasUploadError,
|
|
16582
|
+
"str-chat__attachment-preview-media--uploading": isUploading
|
|
16583
|
+
}),
|
|
16584
|
+
"data-testid": "attachment-preview-media",
|
|
16585
|
+
onPressed: hasRetriableError ? retry : void 0,
|
|
16586
|
+
openPreview: !isUploading && !hasUploadError ? openPreview : void 0,
|
|
16587
|
+
children: [
|
|
16588
|
+
/* @__PURE__ */ jsxs("div", { className: "str-chat__attachment-preview-media__thumbnail-wrapper", children: [
|
|
16589
|
+
thumbnail.url && /* @__PURE__ */ jsx(
|
|
16590
|
+
BaseImage$1,
|
|
16591
|
+
{
|
|
16592
|
+
alt: thumbnail.alt,
|
|
16593
|
+
className: "str-chat__attachment-preview-media__thumbnail",
|
|
16594
|
+
onError: handleThumbnailLoadError,
|
|
16595
|
+
src: thumbnail.url,
|
|
16596
|
+
title: thumbnail.title
|
|
16597
|
+
}
|
|
16598
|
+
),
|
|
16599
|
+
/* @__PURE__ */ jsxs("div", { className: clsx("str-chat__attachment-preview-media__overlay"), children: [
|
|
16600
|
+
isUploading && /* @__PURE__ */ jsx(LoadingIndicator2, {}),
|
|
16601
|
+
isVideoAttachment(attachment) && !hasUploadError && uploadState !== "uploading" && /* @__PURE__ */ jsxs("div", { className: "str-chat__attachment-preview-media__video-indicator", children: [
|
|
16602
|
+
/* @__PURE__ */ jsx(IconVideoSolid, {}),
|
|
16603
|
+
attachment.duration && /* @__PURE__ */ jsx("div", { children: attachment.duration })
|
|
16604
|
+
] }),
|
|
16605
|
+
hasFatalError && /* @__PURE__ */ jsx(IconExclamationCircle, {}),
|
|
16606
|
+
hasRetriableError && /* @__PURE__ */ jsx(
|
|
16607
|
+
Button,
|
|
16608
|
+
{
|
|
16609
|
+
appearance: "solid",
|
|
16610
|
+
"aria-label": t("aria/Retry upload"),
|
|
16611
|
+
circular: true,
|
|
16612
|
+
className: "str-chat__attachment-preview-media__retry-upload-button",
|
|
16613
|
+
"data-testid": "video-preview-item-retry-button",
|
|
16614
|
+
onClick: retry,
|
|
16615
|
+
size: "sm",
|
|
16616
|
+
variant: "danger",
|
|
16617
|
+
children: /* @__PURE__ */ jsx(IconArrowRotateClockwise, {})
|
|
16618
|
+
}
|
|
16619
|
+
)
|
|
16620
|
+
] })
|
|
16621
|
+
] }),
|
|
16622
|
+
/* @__PURE__ */ jsx(
|
|
16623
|
+
RemoveAttachmentPreviewButton,
|
|
16624
|
+
{
|
|
16625
|
+
"data-testid": "video-preview-item-delete-button",
|
|
16626
|
+
onClick: () => {
|
|
16627
|
+
if (id) removeAttachments([id]);
|
|
16628
|
+
},
|
|
16629
|
+
uploadState
|
|
16630
|
+
}
|
|
16631
|
+
)
|
|
16632
|
+
]
|
|
16633
|
+
}
|
|
16634
|
+
);
|
|
16635
|
+
};
|
|
16636
|
+
const toGalleryItemDescriptors = (...args) => toBaseImageDescriptors(...args);
|
|
16637
|
+
const GalleryContext = createContext(void 0);
|
|
16638
|
+
const useGalleryContext = () => {
|
|
16639
|
+
const contextValue = useContext(GalleryContext);
|
|
16640
|
+
if (!contextValue) {
|
|
16641
|
+
console.warn(
|
|
16642
|
+
`The useGalleryContext hook was called outside of the GalleryContext provider. Make sure this hook is called within a child of the Gallery component.`
|
|
16643
|
+
);
|
|
16644
|
+
return {};
|
|
16645
|
+
}
|
|
16646
|
+
return contextValue;
|
|
16647
|
+
};
|
|
16648
|
+
const GalleryHeader = ({ currentItem }) => {
|
|
16649
|
+
const { t } = useTranslationContext();
|
|
16650
|
+
const { MessageTimestamp: MessageTimestamp$1 = MessageTimestamp } = useComponentContext();
|
|
16651
|
+
const { isMyMessage, message } = useMessageContext();
|
|
16652
|
+
const modalContext = useContext(ModalContext);
|
|
16653
|
+
const headerTitle = isMyMessage?.() && t("You") || message?.user?.name || message?.user?.id || currentItem.title || t("User uploaded content");
|
|
16654
|
+
const downloadUrl = useMemo(() => {
|
|
16655
|
+
const rawDownloadUrl = currentItem.videoUrl ?? currentItem.imageUrl;
|
|
16656
|
+
if (!rawDownloadUrl) return void 0;
|
|
16657
|
+
const sanitizedUrl = sanitizeUrl(rawDownloadUrl);
|
|
16658
|
+
return sanitizedUrl === "about:blank" ? void 0 : sanitizedUrl;
|
|
16659
|
+
}, [currentItem.imageUrl, currentItem.videoUrl]);
|
|
16660
|
+
const downloadLabel = t("aria/Download attachment");
|
|
16661
|
+
return /* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__header", children: [
|
|
16662
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "str-chat__gallery__header-spacer" }),
|
|
16663
|
+
/* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__header-meta", children: [
|
|
16664
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__gallery__title", children: headerTitle }),
|
|
16665
|
+
message?.created_at ? /* @__PURE__ */ jsx(MessageTimestamp$1, { customClass: "str-chat__gallery__timestamp" }) : null
|
|
16666
|
+
] }),
|
|
16667
|
+
/* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__header-actions", children: [
|
|
16668
|
+
downloadUrl ? /* @__PURE__ */ jsx(
|
|
16669
|
+
"a",
|
|
16670
|
+
{
|
|
16671
|
+
"aria-label": downloadLabel,
|
|
16672
|
+
className: "str-chat__gallery__action-button str-chat__gallery__action-button--download",
|
|
16673
|
+
download: true,
|
|
16674
|
+
href: downloadUrl,
|
|
16675
|
+
rel: "noreferrer",
|
|
16676
|
+
target: "_blank",
|
|
16677
|
+
title: downloadLabel,
|
|
16678
|
+
children: /* @__PURE__ */ jsx(IconArrowDownCircle, {})
|
|
16679
|
+
}
|
|
16680
|
+
) : null,
|
|
16681
|
+
modalContext?.close ? /* @__PURE__ */ jsx(
|
|
16682
|
+
Button,
|
|
16683
|
+
{
|
|
16684
|
+
"aria-label": t("Close"),
|
|
16685
|
+
className: "str-chat__gallery__action-button str-chat__gallery__action-button--close",
|
|
16686
|
+
onClick: modalContext.close,
|
|
16687
|
+
title: t("Close"),
|
|
16688
|
+
children: /* @__PURE__ */ jsx(IconCrossMedium, {})
|
|
16689
|
+
}
|
|
16690
|
+
) : null
|
|
16691
|
+
] })
|
|
16692
|
+
] });
|
|
16693
|
+
};
|
|
16694
|
+
const VideoPlayer = ({ isPlaying, thumbnailUrl, videoUrl }) => {
|
|
16695
|
+
const { VideoPlayer: VideoPlayerContext } = useComponentContext();
|
|
16696
|
+
return VideoPlayerContext ? /* @__PURE__ */ jsx(VideoPlayerContext, { thumbnailUrl, videoUrl }) : /* @__PURE__ */ jsx(
|
|
16697
|
+
ReactPlayer,
|
|
16698
|
+
{
|
|
16699
|
+
className: "react-player",
|
|
16700
|
+
config: { file: { attributes: { poster: thumbnailUrl } } },
|
|
16701
|
+
controls: true,
|
|
16702
|
+
height: "100%",
|
|
16703
|
+
playing: isPlaying,
|
|
16704
|
+
url: videoUrl,
|
|
16705
|
+
width: "100%"
|
|
16706
|
+
}
|
|
16707
|
+
);
|
|
16708
|
+
};
|
|
16709
|
+
const VideoThumbnail = ({
|
|
16710
|
+
className,
|
|
16711
|
+
onPlay,
|
|
16712
|
+
...imageProps
|
|
16713
|
+
}) => {
|
|
16714
|
+
const { t } = useTranslationContext();
|
|
16715
|
+
return /* @__PURE__ */ jsxs("div", { className: "str-chat__message-attachment__video-thumbnail", children: [
|
|
16716
|
+
/* @__PURE__ */ jsx(
|
|
16717
|
+
BaseImage,
|
|
16718
|
+
{
|
|
16719
|
+
className: clsx("str-chat__message-attachment__video-thumbnail-image", className),
|
|
16720
|
+
...imageProps
|
|
16721
|
+
}
|
|
16722
|
+
),
|
|
16723
|
+
onPlay ? /* @__PURE__ */ jsx(
|
|
16724
|
+
Button,
|
|
16725
|
+
{
|
|
16726
|
+
appearance: "solid",
|
|
16727
|
+
"aria-label": t("Play video"),
|
|
16728
|
+
circular: true,
|
|
16729
|
+
className: clsx(
|
|
16730
|
+
"str-chat__message-attachment__video-thumbnail__play-indicator"
|
|
16731
|
+
),
|
|
16732
|
+
onClick: onPlay,
|
|
16733
|
+
size: "lg",
|
|
16734
|
+
variant: "secondary",
|
|
16735
|
+
children: /* @__PURE__ */ jsx(IconPlaySolid, {})
|
|
16736
|
+
}
|
|
16737
|
+
) : /* @__PURE__ */ jsx("div", { className: "str-chat__message-attachment__video-thumbnail__play-indicator", children: /* @__PURE__ */ jsx(IconPlaySolid, {}) })
|
|
16738
|
+
] });
|
|
16739
|
+
};
|
|
16740
|
+
const SWIPE_THRESHOLD = 50;
|
|
16741
|
+
const TRANSITION_DURATION = 300;
|
|
16742
|
+
const GalleryUI = () => {
|
|
16743
|
+
const { t } = useTranslationContext();
|
|
16744
|
+
const {
|
|
16745
|
+
closeOnBackgroundClick,
|
|
16746
|
+
currentIndex,
|
|
16747
|
+
currentItem,
|
|
16748
|
+
goToNext,
|
|
16749
|
+
goToPrevious,
|
|
16750
|
+
hasNext,
|
|
16751
|
+
hasPrevious,
|
|
16752
|
+
itemCount,
|
|
16753
|
+
onRequestClose
|
|
16754
|
+
} = useGalleryContext();
|
|
16755
|
+
const modalContext = useContext(ModalContext);
|
|
16756
|
+
const [showVideo, setShowVideo] = useState(false);
|
|
16757
|
+
const isTransitioningRef = useRef(false);
|
|
16758
|
+
const [slideOffset, setSlideOffset] = useState(0);
|
|
16759
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
16760
|
+
const [slideDirection, setSlideDirection] = useState(
|
|
16761
|
+
null
|
|
16762
|
+
);
|
|
16763
|
+
const ignoreNextClickRef = useRef(false);
|
|
16764
|
+
const touchStartRef = useRef(null);
|
|
16765
|
+
const isVerticalSwipeRef = useRef(false);
|
|
16766
|
+
const containerRef = useRef(null);
|
|
16767
|
+
useEffect(() => {
|
|
16768
|
+
setShowVideo(false);
|
|
16769
|
+
}, [currentIndex]);
|
|
16770
|
+
const prevIndexRef = useRef(currentIndex);
|
|
16771
|
+
useEffect(() => {
|
|
16772
|
+
if (prevIndexRef.current === currentIndex) return;
|
|
16773
|
+
const direction = currentIndex > prevIndexRef.current ? "forward" : "backward";
|
|
16774
|
+
setSlideDirection(direction);
|
|
16775
|
+
setSlideOffset(0);
|
|
16776
|
+
setIsDragging(false);
|
|
16777
|
+
isTransitioningRef.current = true;
|
|
16778
|
+
const timer = setTimeout(() => {
|
|
16779
|
+
setSlideDirection(null);
|
|
16780
|
+
isTransitioningRef.current = false;
|
|
16781
|
+
}, TRANSITION_DURATION);
|
|
16782
|
+
prevIndexRef.current = currentIndex;
|
|
16783
|
+
return () => clearTimeout(timer);
|
|
16784
|
+
}, [currentIndex]);
|
|
16785
|
+
const handleGoToNext = useCallback(() => {
|
|
16786
|
+
if (isTransitioningRef.current) return;
|
|
16787
|
+
goToNext();
|
|
16788
|
+
}, [goToNext]);
|
|
16789
|
+
const handleGoToPrevious = useCallback(() => {
|
|
16790
|
+
if (isTransitioningRef.current) return;
|
|
16791
|
+
goToPrevious();
|
|
16792
|
+
}, [goToPrevious]);
|
|
16793
|
+
const handleKeyDown = useCallback(
|
|
16794
|
+
(event) => {
|
|
16795
|
+
if (event.key === "ArrowLeft") {
|
|
16796
|
+
event.preventDefault();
|
|
16797
|
+
handleGoToPrevious();
|
|
16798
|
+
} else if (event.key === "ArrowRight") {
|
|
16799
|
+
event.preventDefault();
|
|
16800
|
+
handleGoToNext();
|
|
16801
|
+
}
|
|
16802
|
+
},
|
|
16803
|
+
[handleGoToNext, handleGoToPrevious]
|
|
16804
|
+
);
|
|
16805
|
+
useEffect(() => {
|
|
16806
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
16807
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
16808
|
+
}, [handleKeyDown]);
|
|
16809
|
+
const handleTouchStart = useCallback((event) => {
|
|
16810
|
+
if (isTransitioningRef.current) return;
|
|
16811
|
+
const touch = event.touches[0];
|
|
16812
|
+
ignoreNextClickRef.current = false;
|
|
16813
|
+
touchStartRef.current = { x: touch.clientX, y: touch.clientY };
|
|
16814
|
+
isVerticalSwipeRef.current = false;
|
|
16815
|
+
}, []);
|
|
16816
|
+
const handleTouchMove = useCallback(
|
|
16817
|
+
(event) => {
|
|
16818
|
+
if (!touchStartRef.current || isTransitioningRef.current) return;
|
|
16819
|
+
const touch = event.touches[0];
|
|
16820
|
+
const deltaX = touch.clientX - touchStartRef.current.x;
|
|
16821
|
+
const deltaY = touch.clientY - touchStartRef.current.y;
|
|
16822
|
+
if (!isDragging && !isVerticalSwipeRef.current) {
|
|
16823
|
+
if (Math.abs(deltaY) > Math.abs(deltaX) && Math.abs(deltaY) > 10) {
|
|
16824
|
+
ignoreNextClickRef.current = true;
|
|
16825
|
+
isVerticalSwipeRef.current = true;
|
|
16826
|
+
return;
|
|
16827
|
+
}
|
|
16828
|
+
if (Math.abs(deltaX) > 10) {
|
|
16829
|
+
ignoreNextClickRef.current = true;
|
|
16830
|
+
setIsDragging(true);
|
|
16831
|
+
}
|
|
16832
|
+
}
|
|
16833
|
+
if (isVerticalSwipeRef.current) return;
|
|
16834
|
+
if (!hasNext && deltaX < 0 || !hasPrevious && deltaX > 0) {
|
|
16835
|
+
setSlideOffset(deltaX * 0.3);
|
|
16836
|
+
} else {
|
|
16837
|
+
setSlideOffset(deltaX);
|
|
16838
|
+
}
|
|
16839
|
+
},
|
|
16840
|
+
[isDragging, hasNext, hasPrevious]
|
|
16841
|
+
);
|
|
16842
|
+
const handleTouchEnd = useCallback(() => {
|
|
16843
|
+
if (!touchStartRef.current || isVerticalSwipeRef.current) {
|
|
16844
|
+
if (isVerticalSwipeRef.current) ignoreNextClickRef.current = true;
|
|
16845
|
+
touchStartRef.current = null;
|
|
16846
|
+
return;
|
|
16847
|
+
}
|
|
16848
|
+
const offset = slideOffset;
|
|
16849
|
+
if (isDragging || Math.abs(offset) > 10) {
|
|
16850
|
+
ignoreNextClickRef.current = true;
|
|
16851
|
+
}
|
|
16852
|
+
touchStartRef.current = null;
|
|
16853
|
+
if (Math.abs(offset) >= SWIPE_THRESHOLD) {
|
|
16854
|
+
if (offset < 0 && hasNext) {
|
|
16855
|
+
goToNext();
|
|
16856
|
+
} else if (offset > 0 && hasPrevious) {
|
|
16857
|
+
goToPrevious();
|
|
16858
|
+
} else {
|
|
16859
|
+
setSlideOffset(0);
|
|
16860
|
+
}
|
|
16861
|
+
} else {
|
|
16862
|
+
setSlideOffset(0);
|
|
16863
|
+
}
|
|
16864
|
+
setIsDragging(false);
|
|
16865
|
+
}, [slideOffset, hasNext, hasPrevious, goToNext, goToPrevious, isDragging]);
|
|
16866
|
+
const requestClose = modalContext?.close ?? onRequestClose;
|
|
16867
|
+
const handleBackgroundClick = useCallback(
|
|
16868
|
+
(event) => {
|
|
16869
|
+
if (event.target !== event.currentTarget) return;
|
|
16870
|
+
if (ignoreNextClickRef.current) {
|
|
16871
|
+
ignoreNextClickRef.current = false;
|
|
16872
|
+
return;
|
|
16873
|
+
}
|
|
16874
|
+
if (!closeOnBackgroundClick) return;
|
|
16875
|
+
requestClose?.();
|
|
16876
|
+
},
|
|
16877
|
+
[closeOnBackgroundClick, requestClose]
|
|
16878
|
+
);
|
|
16879
|
+
const mediaStyle = isDragging || slideOffset !== 0 && slideDirection === null ? { transform: `translateX(${slideOffset}px)` } : {};
|
|
16880
|
+
return /* @__PURE__ */ jsxs("div", { className: "str-chat__gallery", children: [
|
|
16881
|
+
/* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__main", children: [
|
|
16882
|
+
/* @__PURE__ */ jsx(GalleryHeader, { currentItem }),
|
|
16883
|
+
/* @__PURE__ */ jsx(
|
|
16884
|
+
NavButton,
|
|
16885
|
+
{
|
|
16886
|
+
"aria-label": t("Previous image"),
|
|
16887
|
+
className: clsx(
|
|
16888
|
+
"str-chat__gallery__nav-button--prev",
|
|
16889
|
+
!hasPrevious && "str-chat__gallery__nav-button--hidden"
|
|
16890
|
+
),
|
|
16891
|
+
disabled: !hasPrevious,
|
|
16892
|
+
onClick: handleGoToPrevious,
|
|
16893
|
+
children: /* @__PURE__ */ jsx(IconChevronLeft, {})
|
|
16894
|
+
}
|
|
16895
|
+
),
|
|
16896
|
+
/* @__PURE__ */ jsx(
|
|
16897
|
+
"div",
|
|
16898
|
+
{
|
|
16899
|
+
className: "str-chat__gallery__slide-container",
|
|
16900
|
+
onClick: handleBackgroundClick,
|
|
16901
|
+
onTouchEnd: handleTouchEnd,
|
|
16902
|
+
onTouchMove: handleTouchMove,
|
|
16903
|
+
onTouchStart: handleTouchStart,
|
|
16904
|
+
ref: containerRef,
|
|
16905
|
+
children: /* @__PURE__ */ jsx(
|
|
16906
|
+
"div",
|
|
17078
16907
|
{
|
|
17079
|
-
|
|
17080
|
-
|
|
17081
|
-
|
|
17082
|
-
|
|
17083
|
-
|
|
16908
|
+
className: clsx({
|
|
16909
|
+
"str-chat__gallery__media--dragging": isDragging,
|
|
16910
|
+
"str-chat__gallery__media--slide-backward": !isDragging && slideDirection === "backward",
|
|
16911
|
+
"str-chat__gallery__media--slide-forward": !isDragging && slideDirection === "forward"
|
|
16912
|
+
}),
|
|
16913
|
+
style: mediaStyle,
|
|
16914
|
+
children: currentItem.videoUrl && currentItem.videoThumbnailUrl ? /* @__PURE__ */ jsx("div", { className: "str-chat__gallery__media str-chat__gallery__media--video", children: showVideo ? /* @__PURE__ */ jsx(VideoPlayer, { isPlaying: true, videoUrl: currentItem.videoUrl }) : /* @__PURE__ */ jsx(
|
|
16915
|
+
VideoThumbnail,
|
|
16916
|
+
{
|
|
16917
|
+
alt: currentItem.title ?? "",
|
|
16918
|
+
onPlay: () => setShowVideo(true),
|
|
16919
|
+
src: currentItem.videoThumbnailUrl
|
|
16920
|
+
}
|
|
16921
|
+
) }) : /* @__PURE__ */ jsx("div", { className: "str-chat__gallery__media str-chat__gallery__media--image", children: /* @__PURE__ */ jsx(BaseImage, { alt: currentItem.alt, src: currentItem.imageUrl }) })
|
|
17084
16922
|
}
|
|
16923
|
+
)
|
|
16924
|
+
}
|
|
16925
|
+
),
|
|
16926
|
+
/* @__PURE__ */ jsx(
|
|
16927
|
+
NavButton,
|
|
16928
|
+
{
|
|
16929
|
+
"aria-label": t("Next image"),
|
|
16930
|
+
className: clsx(
|
|
16931
|
+
"str-chat__gallery__nav-button--next",
|
|
16932
|
+
!hasNext && "str-chat__gallery__nav-button--hidden"
|
|
17085
16933
|
),
|
|
17086
|
-
|
|
17087
|
-
|
|
17088
|
-
|
|
17089
|
-
|
|
17090
|
-
|
|
17091
|
-
|
|
17092
|
-
|
|
17093
|
-
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
|
|
17099
|
-
|
|
17100
|
-
|
|
17101
|
-
|
|
17102
|
-
|
|
17103
|
-
|
|
17104
|
-
|
|
17105
|
-
|
|
17106
|
-
|
|
17107
|
-
|
|
17108
|
-
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
|
|
17112
|
-
|
|
17113
|
-
|
|
17114
|
-
|
|
17115
|
-
|
|
17116
|
-
|
|
17117
|
-
|
|
17118
|
-
|
|
17119
|
-
|
|
17120
|
-
|
|
16934
|
+
disabled: !hasNext,
|
|
16935
|
+
onClick: handleGoToNext,
|
|
16936
|
+
children: /* @__PURE__ */ jsx(IconChevronRight, {})
|
|
16937
|
+
}
|
|
16938
|
+
)
|
|
16939
|
+
] }),
|
|
16940
|
+
itemCount > 1 && /* @__PURE__ */ jsxs("div", { className: "str-chat__gallery__position-indicator", children: [
|
|
16941
|
+
currentIndex + 1,
|
|
16942
|
+
" of ",
|
|
16943
|
+
itemCount
|
|
16944
|
+
] })
|
|
16945
|
+
] });
|
|
16946
|
+
};
|
|
16947
|
+
const NavButton = ({ className, ...props }) => /* @__PURE__ */ jsx(Button, { ...props, className: clsx("str-chat__gallery__nav-button", className) });
|
|
16948
|
+
const Gallery = ({
|
|
16949
|
+
closeOnBackgroundClick = true,
|
|
16950
|
+
GalleryUI: GalleryUI$1,
|
|
16951
|
+
initialIndex = 0,
|
|
16952
|
+
items,
|
|
16953
|
+
onIndexChange,
|
|
16954
|
+
onRequestClose
|
|
16955
|
+
}) => {
|
|
16956
|
+
const { GalleryUI: ContextGalleryUI } = useComponentContext();
|
|
16957
|
+
const ResolvedGalleryUI = GalleryUI$1 ?? ContextGalleryUI ?? GalleryUI;
|
|
16958
|
+
const [currentIndex, setCurrentIndex] = useState(initialIndex);
|
|
16959
|
+
const itemCount = items.length;
|
|
16960
|
+
const goToIndex = useCallback(
|
|
16961
|
+
(index) => {
|
|
16962
|
+
if (index >= 0 && index < itemCount) {
|
|
16963
|
+
setCurrentIndex(index);
|
|
16964
|
+
}
|
|
16965
|
+
},
|
|
16966
|
+
[itemCount]
|
|
16967
|
+
);
|
|
16968
|
+
const goToNext = useCallback(() => {
|
|
16969
|
+
setCurrentIndex((prev) => prev < itemCount - 1 ? prev + 1 : prev);
|
|
16970
|
+
}, [itemCount]);
|
|
16971
|
+
const goToPrevious = useCallback(() => {
|
|
16972
|
+
setCurrentIndex((prev) => prev > 0 ? prev - 1 : prev);
|
|
16973
|
+
}, []);
|
|
16974
|
+
useEffect(() => {
|
|
16975
|
+
onIndexChange?.(currentIndex);
|
|
16976
|
+
}, [currentIndex, onIndexChange]);
|
|
16977
|
+
const hasNext = currentIndex < itemCount - 1;
|
|
16978
|
+
const hasPrevious = currentIndex > 0;
|
|
16979
|
+
const currentItem = items[currentIndex];
|
|
16980
|
+
const contextValue = useMemo(
|
|
16981
|
+
() => ({
|
|
16982
|
+
closeOnBackgroundClick,
|
|
16983
|
+
currentIndex,
|
|
16984
|
+
currentItem,
|
|
16985
|
+
goToIndex,
|
|
16986
|
+
goToNext,
|
|
16987
|
+
goToPrevious,
|
|
16988
|
+
hasNext,
|
|
16989
|
+
hasPrevious,
|
|
16990
|
+
itemCount,
|
|
16991
|
+
items,
|
|
16992
|
+
onRequestClose
|
|
16993
|
+
}),
|
|
16994
|
+
[
|
|
16995
|
+
closeOnBackgroundClick,
|
|
16996
|
+
currentIndex,
|
|
16997
|
+
currentItem,
|
|
16998
|
+
goToIndex,
|
|
16999
|
+
goToNext,
|
|
17000
|
+
goToPrevious,
|
|
17001
|
+
hasNext,
|
|
17002
|
+
hasPrevious,
|
|
17003
|
+
itemCount,
|
|
17004
|
+
items,
|
|
17005
|
+
onRequestClose
|
|
17006
|
+
]
|
|
17121
17007
|
);
|
|
17008
|
+
return /* @__PURE__ */ jsx(GalleryContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ResolvedGalleryUI, {}) });
|
|
17122
17009
|
};
|
|
17123
17010
|
const AttachmentPreviewList = ({
|
|
17124
17011
|
AudioAttachmentPreview: AudioAttachmentPreview2 = FileAttachmentPreview,
|
|
@@ -17128,73 +17015,107 @@ const AttachmentPreviewList = ({
|
|
|
17128
17015
|
VideoAttachmentPreview = MediaAttachmentPreview
|
|
17129
17016
|
}) => {
|
|
17130
17017
|
const messageComposer = useMessageComposerController();
|
|
17018
|
+
const { Modal = GlobalModal } = useComponentContext();
|
|
17019
|
+
const [showPreview, setShowPreview] = useState(false);
|
|
17020
|
+
const initialIndexRef = useRef(0);
|
|
17131
17021
|
const { attachments } = useAttachmentsForPreview();
|
|
17132
17022
|
const filteredAttachments = useMemo(
|
|
17133
17023
|
() => attachments.filter((a) => !isVoiceRecordingAttachment(a)),
|
|
17134
17024
|
[attachments]
|
|
17135
17025
|
);
|
|
17026
|
+
const { galleryItems, previewIndexById } = useMemo(() => {
|
|
17027
|
+
const items = [];
|
|
17028
|
+
const indexById = {};
|
|
17029
|
+
for (const a of attachments) {
|
|
17030
|
+
if (isLocalImageAttachment(a) || isLocalVideoAttachment(a)) {
|
|
17031
|
+
const descriptor = toBaseImageDescriptors(a);
|
|
17032
|
+
if (descriptor) {
|
|
17033
|
+
indexById[a.localMetadata.id] = items.length;
|
|
17034
|
+
items.push(descriptor);
|
|
17035
|
+
}
|
|
17036
|
+
}
|
|
17037
|
+
}
|
|
17038
|
+
return { galleryItems: items, previewIndexById: indexById };
|
|
17039
|
+
}, [attachments]);
|
|
17040
|
+
const openPreviewAtIndex = useCallback((index) => {
|
|
17041
|
+
initialIndexRef.current = index;
|
|
17042
|
+
setShowPreview(true);
|
|
17043
|
+
}, []);
|
|
17136
17044
|
if (!filteredAttachments.length) return null;
|
|
17137
|
-
return /* @__PURE__ */
|
|
17045
|
+
return /* @__PURE__ */ jsxs(
|
|
17138
17046
|
"div",
|
|
17139
17047
|
{
|
|
17140
17048
|
className: "str-chat__attachment-preview-list",
|
|
17141
17049
|
"data-testid": "attachment-preview-list",
|
|
17142
|
-
children:
|
|
17143
|
-
|
|
17144
|
-
|
|
17145
|
-
|
|
17146
|
-
|
|
17147
|
-
|
|
17148
|
-
|
|
17149
|
-
|
|
17150
|
-
|
|
17151
|
-
|
|
17152
|
-
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
|
-
|
|
17156
|
-
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17160
|
-
|
|
17161
|
-
|
|
17162
|
-
|
|
17163
|
-
|
|
17164
|
-
|
|
17165
|
-
|
|
17166
|
-
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17180
|
-
|
|
17181
|
-
|
|
17182
|
-
|
|
17183
|
-
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
|
|
17197
|
-
|
|
17050
|
+
children: [
|
|
17051
|
+
attachments.map((attachment) => {
|
|
17052
|
+
if (isScrapedContent(attachment)) return null;
|
|
17053
|
+
if (isLocalVoiceRecordingAttachment(attachment)) return null;
|
|
17054
|
+
if (isLocalAudioAttachment(attachment)) {
|
|
17055
|
+
return /* @__PURE__ */ jsx(
|
|
17056
|
+
AudioAttachmentPreview2,
|
|
17057
|
+
{
|
|
17058
|
+
attachment,
|
|
17059
|
+
handleRetry: messageComposer.attachmentManager.uploadAttachment,
|
|
17060
|
+
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
17061
|
+
},
|
|
17062
|
+
attachment.localMetadata.id || attachment.asset_url
|
|
17063
|
+
);
|
|
17064
|
+
} else if (isLocalVideoAttachment(attachment)) {
|
|
17065
|
+
return /* @__PURE__ */ jsx(
|
|
17066
|
+
VideoAttachmentPreview,
|
|
17067
|
+
{
|
|
17068
|
+
attachment,
|
|
17069
|
+
handleRetry: messageComposer.attachmentManager.uploadAttachment,
|
|
17070
|
+
openPreview: () => openPreviewAtIndex(previewIndexById[attachment.localMetadata.id] ?? 0),
|
|
17071
|
+
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
17072
|
+
},
|
|
17073
|
+
attachment.localMetadata.id || attachment.asset_url
|
|
17074
|
+
);
|
|
17075
|
+
} else if (isLocalImageAttachment(attachment)) {
|
|
17076
|
+
return /* @__PURE__ */ jsx(
|
|
17077
|
+
ImageAttachmentPreview,
|
|
17078
|
+
{
|
|
17079
|
+
attachment,
|
|
17080
|
+
handleRetry: messageComposer.attachmentManager.uploadAttachment,
|
|
17081
|
+
openPreview: () => openPreviewAtIndex(previewIndexById[attachment.localMetadata.id] ?? 0),
|
|
17082
|
+
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
17083
|
+
},
|
|
17084
|
+
attachment.localMetadata.id || attachment.image_url
|
|
17085
|
+
);
|
|
17086
|
+
} else if (isLocalFileAttachment(attachment)) {
|
|
17087
|
+
return /* @__PURE__ */ jsx(
|
|
17088
|
+
FileAttachmentPreview$1,
|
|
17089
|
+
{
|
|
17090
|
+
attachment,
|
|
17091
|
+
handleRetry: messageComposer.attachmentManager.uploadAttachment,
|
|
17092
|
+
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
17093
|
+
},
|
|
17094
|
+
attachment.localMetadata.id || attachment.asset_url
|
|
17095
|
+
);
|
|
17096
|
+
} else if (isLocalAttachment(attachment)) {
|
|
17097
|
+
return /* @__PURE__ */ jsx(
|
|
17098
|
+
UnsupportedAttachmentPreview$1,
|
|
17099
|
+
{
|
|
17100
|
+
attachment,
|
|
17101
|
+
handleRetry: messageComposer.attachmentManager.uploadAttachment,
|
|
17102
|
+
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
17103
|
+
},
|
|
17104
|
+
attachment.localMetadata.id
|
|
17105
|
+
);
|
|
17106
|
+
}
|
|
17107
|
+
return null;
|
|
17108
|
+
}),
|
|
17109
|
+
galleryItems.length > 0 && /* @__PURE__ */ jsx(
|
|
17110
|
+
Modal,
|
|
17111
|
+
{
|
|
17112
|
+
className: "str-chat__gallery-modal",
|
|
17113
|
+
onClose: () => setShowPreview(false),
|
|
17114
|
+
open: showPreview,
|
|
17115
|
+
children: /* @__PURE__ */ jsx(Gallery, { initialIndex: initialIndexRef.current, items: galleryItems })
|
|
17116
|
+
}
|
|
17117
|
+
)
|
|
17118
|
+
]
|
|
17198
17119
|
}
|
|
17199
17120
|
);
|
|
17200
17121
|
};
|
|
@@ -17222,11 +17143,9 @@ const VoiceRecordingPreviewSlot = ({
|
|
|
17222
17143
|
}
|
|
17223
17144
|
);
|
|
17224
17145
|
};
|
|
17225
|
-
const
|
|
17226
|
-
const CommandChip = () => {
|
|
17146
|
+
const CommandChip = ({ command }) => {
|
|
17227
17147
|
const { textComposer } = useMessageComposerController();
|
|
17228
17148
|
const { textareaRef } = useMessageComposerContext();
|
|
17229
|
-
const { command } = useStateStore(textComposer.state, textComposerStateSelector$4);
|
|
17230
17149
|
if (!command) return null;
|
|
17231
17150
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__command-chip", children: [
|
|
17232
17151
|
/* @__PURE__ */ jsx(IconThunder, {}),
|
|
@@ -17525,9 +17444,12 @@ const ToggleRecordingButton = () => {
|
|
|
17525
17444
|
);
|
|
17526
17445
|
};
|
|
17527
17446
|
const AudioRecorderRecordingControls = () => {
|
|
17447
|
+
const { client } = useChatContext();
|
|
17448
|
+
const { t } = useTranslationContext();
|
|
17528
17449
|
const {
|
|
17529
17450
|
recordingController: { completeRecording, recorder, recording, recordingState }
|
|
17530
17451
|
} = useMessageComposerContext();
|
|
17452
|
+
const panel = useNotificationTarget();
|
|
17531
17453
|
const isUploadingFile = recording?.localMetadata?.uploadState === "uploading";
|
|
17532
17454
|
if (!recorder) return null;
|
|
17533
17455
|
return /* @__PURE__ */ jsxs("div", { className: "str-chat__audio_recorder__recording-controls", children: [
|
|
@@ -17539,7 +17461,17 @@ const AudioRecorderRecordingControls = () => {
|
|
|
17539
17461
|
className: "str-chat__audio_recorder__cancel-button",
|
|
17540
17462
|
"data-testid": "cancel-recording-audio-button",
|
|
17541
17463
|
disabled: isUploadingFile,
|
|
17542
|
-
onClick:
|
|
17464
|
+
onClick: () => {
|
|
17465
|
+
recorder.cancel();
|
|
17466
|
+
client.notifications.addInfo({
|
|
17467
|
+
message: t("Voice message deleted"),
|
|
17468
|
+
options: {
|
|
17469
|
+
tags: addNotificationTargetTag(panel),
|
|
17470
|
+
type: "audioRecording:cancel:success"
|
|
17471
|
+
},
|
|
17472
|
+
origin: { emitter: "AudioRecorder" }
|
|
17473
|
+
});
|
|
17474
|
+
},
|
|
17543
17475
|
size: "sm",
|
|
17544
17476
|
variant: "secondary",
|
|
17545
17477
|
children: /* @__PURE__ */ jsx(IconTrashBin, {})
|
|
@@ -18063,6 +17995,12 @@ const TextareaComposer = ({
|
|
|
18063
17995
|
textComposer.state,
|
|
18064
17996
|
textComposerStateSelector$1
|
|
18065
17997
|
);
|
|
17998
|
+
const autosizeRows = !text2 && minRows == null ? 1 : void 0;
|
|
17999
|
+
const textareaStyle = text2 ? void 0 : {
|
|
18000
|
+
overflow: "hidden",
|
|
18001
|
+
textOverflow: "ellipsis",
|
|
18002
|
+
whiteSpace: "nowrap"
|
|
18003
|
+
};
|
|
18066
18004
|
const { enabled } = useStateStore(messageComposer.configState, configStateSelector);
|
|
18067
18005
|
const { quotedMessage } = useStateStore(
|
|
18068
18006
|
messageComposer.state,
|
|
@@ -18184,6 +18122,12 @@ const TextareaComposer = ({
|
|
|
18184
18122
|
if (!textareaRef.current || textareaIsFocused || !focus) return;
|
|
18185
18123
|
textareaRef.current.focus();
|
|
18186
18124
|
}, [attachments, focus, quotedMessage, textareaRef]);
|
|
18125
|
+
useEffect(
|
|
18126
|
+
() => () => {
|
|
18127
|
+
messageComposer.clear();
|
|
18128
|
+
},
|
|
18129
|
+
[messageComposer]
|
|
18130
|
+
);
|
|
18187
18131
|
useLayoutEffect(() => {
|
|
18188
18132
|
const textarea = textareaRef.current;
|
|
18189
18133
|
if (!textarea || isComposing) return;
|
|
@@ -18216,8 +18160,8 @@ const TextareaComposer = ({
|
|
|
18216
18160
|
),
|
|
18217
18161
|
"data-testid": "message-input",
|
|
18218
18162
|
disabled: !enabled || !!cooldownRemaining,
|
|
18219
|
-
maxRows,
|
|
18220
|
-
minRows,
|
|
18163
|
+
maxRows: autosizeRows ?? maxRows,
|
|
18164
|
+
minRows: autosizeRows ?? minRows,
|
|
18221
18165
|
onBlur,
|
|
18222
18166
|
onChange: changeHandler,
|
|
18223
18167
|
onCompositionEnd,
|
|
@@ -18229,7 +18173,8 @@ const TextareaComposer = ({
|
|
|
18229
18173
|
placeholder,
|
|
18230
18174
|
ref: (ref) => {
|
|
18231
18175
|
textareaRef.current = ref;
|
|
18232
|
-
}
|
|
18176
|
+
},
|
|
18177
|
+
style: textareaStyle
|
|
18233
18178
|
}
|
|
18234
18179
|
),
|
|
18235
18180
|
!isComposing && /* @__PURE__ */ jsx(
|
|
@@ -18561,7 +18506,7 @@ const MessageComposerUI = () => {
|
|
|
18561
18506
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__message-composer-controls", children: [
|
|
18562
18507
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__message-composer-controls__text-composition-controls", children: [
|
|
18563
18508
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__message-composer-controls__text-composition-controls__text", children: [
|
|
18564
|
-
/* @__PURE__ */ jsx("div", { className: "str-chat__message-composer-controls__text-composition-controls__command-chip-container", children: /* @__PURE__ */ jsx(CommandChip$1, {}) }),
|
|
18509
|
+
command && /* @__PURE__ */ jsx("div", { className: "str-chat__message-composer-controls__text-composition-controls__command-chip-container", children: /* @__PURE__ */ jsx(CommandChip$1, { command }) }),
|
|
18565
18510
|
/* @__PURE__ */ jsx(TextareaComposer$1, {})
|
|
18566
18511
|
] }),
|
|
18567
18512
|
/* @__PURE__ */ jsx(SendToChannelCheckbox$1, {})
|
|
@@ -18954,7 +18899,7 @@ const useChat = ({
|
|
|
18954
18899
|
};
|
|
18955
18900
|
useEffect(() => {
|
|
18956
18901
|
if (!client) return;
|
|
18957
|
-
const version = "14.0.0-beta.
|
|
18902
|
+
const version = "14.0.0-beta.2";
|
|
18958
18903
|
const userAgent = client.getUserAgent();
|
|
18959
18904
|
if (!userAgent.includes("stream-chat-react")) {
|
|
18960
18905
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|
|
@@ -19461,7 +19406,7 @@ ReactionSelector.getDialogId = (({ messageId, threadList }) => {
|
|
|
19461
19406
|
});
|
|
19462
19407
|
ReactionSelector.displayName = "ReactionSelector";
|
|
19463
19408
|
const ReactionSelectorWithButton = ({
|
|
19464
|
-
ReactionIcon
|
|
19409
|
+
ReactionIcon
|
|
19465
19410
|
}) => {
|
|
19466
19411
|
const { t } = useTranslationContext("ReactionSelectorWithButton");
|
|
19467
19412
|
const { isMyMessage, message, threadList } = useMessageContext();
|
|
@@ -19495,7 +19440,7 @@ const ReactionSelectorWithButton = ({
|
|
|
19495
19440
|
"data-testid": "message-reaction-action",
|
|
19496
19441
|
onClick: () => dialog?.toggle(),
|
|
19497
19442
|
ref: buttonRef,
|
|
19498
|
-
children: /* @__PURE__ */ jsx(
|
|
19443
|
+
children: /* @__PURE__ */ jsx(ReactionIcon, { className: "str-chat__message-action-icon" })
|
|
19499
19444
|
}
|
|
19500
19445
|
)
|
|
19501
19446
|
] });
|
|
@@ -19832,8 +19777,7 @@ const DefaultMessageActionComponents = {
|
|
|
19832
19777
|
const { closeMenu } = useContextMenuContext();
|
|
19833
19778
|
const { client } = useChatContext();
|
|
19834
19779
|
const { Modal = GlobalModal } = useComponentContext();
|
|
19835
|
-
const {
|
|
19836
|
-
const { handleDelete, message } = useMessageContext();
|
|
19780
|
+
const { handleDelete } = useMessageContext();
|
|
19837
19781
|
const panel = useNotificationTarget();
|
|
19838
19782
|
const { t } = useTranslationContext();
|
|
19839
19783
|
const [openModal, setOpenModal] = useState(false);
|
|
@@ -19859,29 +19803,20 @@ const DefaultMessageActionComponents = {
|
|
|
19859
19803
|
closeMenu();
|
|
19860
19804
|
},
|
|
19861
19805
|
onDelete: async () => {
|
|
19862
|
-
|
|
19863
|
-
|
|
19864
|
-
|
|
19865
|
-
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
message: t("Failed to delete the message"),
|
|
19876
|
-
options: {
|
|
19877
|
-
tags: addNotificationTargetTag(panel)
|
|
19878
|
-
},
|
|
19879
|
-
origin: { emitter: "MessageActions" }
|
|
19880
|
-
});
|
|
19881
|
-
}
|
|
19806
|
+
try {
|
|
19807
|
+
await handleDelete();
|
|
19808
|
+
client.notifications.addSuccess({
|
|
19809
|
+
message: t("Message deleted"),
|
|
19810
|
+
options: {
|
|
19811
|
+
tags: addNotificationTargetTag(panel)
|
|
19812
|
+
},
|
|
19813
|
+
origin: { emitter: "MessageActions" }
|
|
19814
|
+
});
|
|
19815
|
+
} catch {
|
|
19816
|
+
} finally {
|
|
19817
|
+
setOpenModal(false);
|
|
19818
|
+
closeMenu();
|
|
19882
19819
|
}
|
|
19883
|
-
setOpenModal(false);
|
|
19884
|
-
closeMenu();
|
|
19885
19820
|
}
|
|
19886
19821
|
}
|
|
19887
19822
|
) })
|
|
@@ -19914,7 +19849,7 @@ const DefaultMessageActionComponents = {
|
|
|
19914
19849
|
},
|
|
19915
19850
|
quick: {
|
|
19916
19851
|
React() {
|
|
19917
|
-
return /* @__PURE__ */ jsx(ReactionSelectorWithButton, { ReactionIcon });
|
|
19852
|
+
return /* @__PURE__ */ jsx(ReactionSelectorWithButton, { ReactionIcon: IconEmojiSmile });
|
|
19918
19853
|
},
|
|
19919
19854
|
Reply() {
|
|
19920
19855
|
const { handleOpenThread } = useMessageContext();
|
|
@@ -19926,7 +19861,7 @@ const DefaultMessageActionComponents = {
|
|
|
19926
19861
|
className: "str-chat__message-reply-in-thread-button",
|
|
19927
19862
|
"data-testid": "thread-action",
|
|
19928
19863
|
onClick: handleOpenThread,
|
|
19929
|
-
children: /* @__PURE__ */ jsx(
|
|
19864
|
+
children: /* @__PURE__ */ jsx(IconArrowShareLeft, { className: "str-chat__message-action-icon" })
|
|
19930
19865
|
}
|
|
19931
19866
|
);
|
|
19932
19867
|
}
|
|
@@ -20598,7 +20533,7 @@ const MessageActions = ({
|
|
|
20598
20533
|
},
|
|
20599
20534
|
ref: setActionsBoxButtonElement,
|
|
20600
20535
|
variant: "secondary",
|
|
20601
|
-
children: /* @__PURE__ */ jsx(
|
|
20536
|
+
children: /* @__PURE__ */ jsx(IconDotGrid1x3Horizontal, { className: "str-chat__message-action-icon" })
|
|
20602
20537
|
}
|
|
20603
20538
|
),
|
|
20604
20539
|
/* @__PURE__ */ jsx(
|
|
@@ -20787,7 +20722,7 @@ const MessageUIWithContext = ({
|
|
|
20787
20722
|
isAIGenerated ? /* @__PURE__ */ jsx(StreamedMessageText$1, { message, renderText: renderText2 }) : /* @__PURE__ */ jsx(MessageText, { message, renderText: renderText2 })
|
|
20788
20723
|
] }),
|
|
20789
20724
|
/* @__PURE__ */ jsx("div", { className: "str-chat__message-reactions-host", children: hasReactions && /* @__PURE__ */ jsx(MessageReactions$1, { reverse: true }) }),
|
|
20790
|
-
/* @__PURE__ */ jsx(
|
|
20725
|
+
/* @__PURE__ */ jsx("div", { className: "str-chat__message-error-indicator", children: /* @__PURE__ */ jsx(ErrorBadge, {}) })
|
|
20791
20726
|
] })
|
|
20792
20727
|
]
|
|
20793
20728
|
}
|
|
@@ -22471,7 +22406,7 @@ function defaultRenderMessages({
|
|
|
22471
22406
|
return renderedMessages;
|
|
22472
22407
|
}
|
|
22473
22408
|
const findReverse = (items, matches) => {
|
|
22474
|
-
for (let i = items.length - 1; i
|
|
22409
|
+
for (let i = items.length - 1; i >= 0; i -= 1) {
|
|
22475
22410
|
if (matches(items[i])) {
|
|
22476
22411
|
return items[i];
|
|
22477
22412
|
}
|
|
@@ -26605,7 +26540,8 @@ const ThreadList = ({ virtuosoProps }) => {
|
|
|
26605
26540
|
};
|
|
26606
26541
|
const IconsBySeverity = {
|
|
26607
26542
|
error: IconExclamationCircle,
|
|
26608
|
-
info:
|
|
26543
|
+
info: null,
|
|
26544
|
+
// IconCircleInfoTooltip,
|
|
26609
26545
|
loading: IconArrowRotateRightLeftRepeatRefresh,
|
|
26610
26546
|
success: IconCheckmark2,
|
|
26611
26547
|
warning: IconExclamationTriangle
|
|
@@ -26613,7 +26549,7 @@ const IconsBySeverity = {
|
|
|
26613
26549
|
const DefaultNotificationIcon = ({ notification }) => {
|
|
26614
26550
|
if (!notification.severity) return null;
|
|
26615
26551
|
const Icon = IconsBySeverity[notification.severity] ?? null;
|
|
26616
|
-
return Icon && /* @__PURE__ */ jsx(Icon, {});
|
|
26552
|
+
return Icon && /* @__PURE__ */ jsx("div", { className: "str-chat__notification-icon", children: /* @__PURE__ */ jsx(Icon, {}) });
|
|
26617
26553
|
};
|
|
26618
26554
|
const Notification = forwardRef(
|
|
26619
26555
|
({
|
|
@@ -26657,7 +26593,7 @@ const Notification = forwardRef(
|
|
|
26657
26593
|
ref,
|
|
26658
26594
|
children: [
|
|
26659
26595
|
/* @__PURE__ */ jsxs("div", { className: "str-chat__notification-content", children: [
|
|
26660
|
-
Icon && /* @__PURE__ */ jsx(
|
|
26596
|
+
Icon && /* @__PURE__ */ jsx(Icon, { notification }),
|
|
26661
26597
|
/* @__PURE__ */ jsx("div", { className: "str-chat__notification-message", children: displayMessage })
|
|
26662
26598
|
] }),
|
|
26663
26599
|
notification.actions && notification.actions.length > 0 && /* @__PURE__ */ jsx("div", { className: "str-chat__notification-actions", children: notification.actions.map((action, index) => /* @__PURE__ */ jsx(
|
|
@@ -28016,7 +27952,6 @@ export {
|
|
|
28016
27952
|
AIStateIndicator,
|
|
28017
27953
|
AIStates,
|
|
28018
27954
|
ATTACHMENT_GROUPS_ORDER,
|
|
28019
|
-
ActionsIcon,
|
|
28020
27955
|
AddCommentPrompt,
|
|
28021
27956
|
Alert,
|
|
28022
27957
|
AmountBar,
|
|
@@ -28029,7 +27964,7 @@ export {
|
|
|
28029
27964
|
AttachmentWithinContainer,
|
|
28030
27965
|
Audio,
|
|
28031
27966
|
AudioContainer,
|
|
28032
|
-
|
|
27967
|
+
bu as AudioPlayer,
|
|
28033
27968
|
AudioRecorder,
|
|
28034
27969
|
Avatar,
|
|
28035
27970
|
AvatarStack,
|
|
@@ -28041,13 +27976,13 @@ export {
|
|
|
28041
27976
|
Callout,
|
|
28042
27977
|
Card,
|
|
28043
27978
|
CardContainer,
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
27979
|
+
bx as Channel,
|
|
27980
|
+
dc as ChannelActionContext,
|
|
27981
|
+
dd as ChannelActionProvider,
|
|
28047
27982
|
ChannelAvatar,
|
|
28048
27983
|
ChannelHeader,
|
|
28049
27984
|
ChannelList,
|
|
28050
|
-
ChannelListContext,
|
|
27985
|
+
de as ChannelListContext,
|
|
28051
27986
|
ChannelListContextProvider,
|
|
28052
27987
|
ChannelListItem,
|
|
28053
27988
|
ChannelListItemActionButtons,
|
|
@@ -28055,22 +27990,22 @@ export {
|
|
|
28055
27990
|
ChannelListItemUI,
|
|
28056
27991
|
ChannelListUI,
|
|
28057
27992
|
ChannelSearchResultItem,
|
|
28058
|
-
|
|
28059
|
-
|
|
27993
|
+
df as ChannelStateContext,
|
|
27994
|
+
dg as ChannelStateProvider,
|
|
28060
27995
|
Chat,
|
|
28061
|
-
|
|
27996
|
+
dh as ChatContext,
|
|
28062
27997
|
ChatProvider,
|
|
28063
|
-
|
|
28064
|
-
|
|
28065
|
-
|
|
28066
|
-
|
|
28067
|
-
|
|
27998
|
+
bz as ChatView,
|
|
27999
|
+
bC as ChatViewChannelsSelectorButton,
|
|
28000
|
+
by as ChatViewContext,
|
|
28001
|
+
bB as ChatViewSelectorButton,
|
|
28002
|
+
bD as ChatViewThreadsSelectorButton,
|
|
28068
28003
|
CheckSignIcon,
|
|
28069
28004
|
Checkmark,
|
|
28070
28005
|
CommandChip,
|
|
28071
28006
|
CommandItem,
|
|
28072
28007
|
ComponentContext,
|
|
28073
|
-
|
|
28008
|
+
di as ComponentProvider,
|
|
28074
28009
|
ConnectionStatus,
|
|
28075
28010
|
ContextMenu,
|
|
28076
28011
|
ContextMenuBackButton,
|
|
@@ -28094,6 +28029,7 @@ export {
|
|
|
28094
28029
|
EmoticonItem,
|
|
28095
28030
|
EmptyStateIndicator,
|
|
28096
28031
|
EndPollAlert,
|
|
28032
|
+
ErrorBadge,
|
|
28097
28033
|
EventComponent,
|
|
28098
28034
|
FILE_ICON_GRAPHIC_CLASSNAME,
|
|
28099
28035
|
FILE_ICON_NO_LABEL_CLASSNAME,
|
|
@@ -28114,162 +28050,163 @@ export {
|
|
|
28114
28050
|
GlobalModal,
|
|
28115
28051
|
GroupAvatar,
|
|
28116
28052
|
Header$1 as Header,
|
|
28117
|
-
|
|
28118
|
-
|
|
28053
|
+
bG as IconApiAggregate,
|
|
28054
|
+
bH as IconApples,
|
|
28119
28055
|
IconArchive,
|
|
28120
28056
|
IconArrowBoxLeft,
|
|
28121
28057
|
IconArrowDown,
|
|
28122
28058
|
IconArrowDownCircle,
|
|
28123
28059
|
IconArrowLeft,
|
|
28124
|
-
|
|
28060
|
+
bI as IconArrowRight,
|
|
28125
28061
|
IconArrowRightUp,
|
|
28126
28062
|
IconArrowRotateClockwise,
|
|
28127
28063
|
IconArrowRotateRightLeftRepeatRefresh,
|
|
28128
|
-
|
|
28064
|
+
IconArrowShareLeft,
|
|
28129
28065
|
IconArrowUp,
|
|
28130
|
-
|
|
28131
|
-
|
|
28132
|
-
|
|
28066
|
+
bJ as IconArrowsRepeatLeftRight,
|
|
28067
|
+
bK as IconAt,
|
|
28068
|
+
bL as IconAtSolid,
|
|
28133
28069
|
IconBellNotification,
|
|
28134
28070
|
IconBellOff,
|
|
28135
28071
|
IconBookmark,
|
|
28136
28072
|
IconBookmarkRemove,
|
|
28137
|
-
|
|
28138
|
-
|
|
28139
|
-
|
|
28140
|
-
|
|
28141
|
-
|
|
28142
|
-
|
|
28073
|
+
bM as IconBrowserAISparkle,
|
|
28074
|
+
bN as IconBubble2ChatMessage,
|
|
28075
|
+
bO as IconBubble2Solid,
|
|
28076
|
+
bP as IconBubble3ChatMessage,
|
|
28077
|
+
bQ as IconBubble3Solid,
|
|
28078
|
+
bR as IconBubbleAnnotation2ChatMessage,
|
|
28143
28079
|
IconBubbleText6ChatMessage,
|
|
28144
|
-
|
|
28145
|
-
|
|
28080
|
+
bT as IconBubbleText6Solid,
|
|
28081
|
+
bS as IconBubbleText6SolidChatMessage,
|
|
28146
28082
|
IconBubbleWideNotificationChatMessage,
|
|
28147
|
-
|
|
28083
|
+
bU as IconBubbleWideSparkleChatMessage,
|
|
28148
28084
|
IconBubbles,
|
|
28149
|
-
|
|
28150
|
-
|
|
28085
|
+
bV as IconCalendar1,
|
|
28086
|
+
bW as IconCallCancel,
|
|
28151
28087
|
IconCamera1,
|
|
28152
|
-
|
|
28153
|
-
|
|
28088
|
+
bX as IconCar1,
|
|
28089
|
+
bY as IconCat,
|
|
28154
28090
|
IconChainLink,
|
|
28155
28091
|
IconChart5,
|
|
28156
28092
|
IconCheckmark1Small,
|
|
28157
28093
|
IconCheckmark2,
|
|
28158
|
-
|
|
28094
|
+
bZ as IconCheckmark2Small,
|
|
28159
28095
|
IconChevronDown,
|
|
28160
|
-
|
|
28096
|
+
b_ as IconChevronGrabberVerticalSelector,
|
|
28161
28097
|
IconChevronLeft,
|
|
28162
28098
|
IconChevronRight,
|
|
28163
|
-
|
|
28099
|
+
b$ as IconChevronTop,
|
|
28164
28100
|
IconCircleBanSign,
|
|
28165
|
-
|
|
28166
|
-
IconCircleInfoTooltip,
|
|
28101
|
+
c0 as IconCircleCheck,
|
|
28102
|
+
c1 as IconCircleInfoTooltip,
|
|
28167
28103
|
IconCircleMinus,
|
|
28168
|
-
|
|
28169
|
-
|
|
28104
|
+
c2 as IconCircleQuestionmark,
|
|
28105
|
+
c3 as IconCircleQuestionmarkFilled,
|
|
28170
28106
|
IconCircleX,
|
|
28171
28107
|
IconClock,
|
|
28172
|
-
|
|
28108
|
+
c4 as IconClockSolid,
|
|
28173
28109
|
IconCloseQuote2,
|
|
28174
|
-
|
|
28175
|
-
|
|
28176
|
-
|
|
28177
|
-
|
|
28178
|
-
|
|
28110
|
+
c5 as IconCode,
|
|
28111
|
+
c6 as IconCodeBrackets,
|
|
28112
|
+
c7 as IconCodeEditorInsert,
|
|
28113
|
+
c8 as IconCompass,
|
|
28114
|
+
c9 as IconCreditCard2Billing,
|
|
28179
28115
|
IconCrossMedium,
|
|
28180
28116
|
IconCrossSmall,
|
|
28181
28117
|
IconDotGrid1x3Horizontal,
|
|
28182
28118
|
IconDotGrid2x3,
|
|
28183
|
-
|
|
28119
|
+
ca as IconDotsGrid1x3Vertical,
|
|
28184
28120
|
IconDoubleCheckmark1Small,
|
|
28185
28121
|
IconEditBig,
|
|
28186
|
-
|
|
28187
|
-
|
|
28188
|
-
|
|
28189
|
-
|
|
28122
|
+
cb as IconEditBigSolid,
|
|
28123
|
+
cc as IconEmojiAddReaction,
|
|
28124
|
+
cd as IconEmojiSad,
|
|
28125
|
+
IconEmojiSmile,
|
|
28126
|
+
IconExclamation,
|
|
28190
28127
|
IconExclamationCircle,
|
|
28191
28128
|
IconExclamationCircle1,
|
|
28192
28129
|
IconExclamationTriangle,
|
|
28193
|
-
|
|
28130
|
+
ce as IconExclamationTriangle1,
|
|
28194
28131
|
IconEyeOpen,
|
|
28195
28132
|
IconFileArrowLeftIn,
|
|
28196
28133
|
IconFileBend,
|
|
28197
|
-
|
|
28198
|
-
|
|
28134
|
+
cf as IconFilledCircleInfoTooltip,
|
|
28135
|
+
cg as IconFilter1,
|
|
28199
28136
|
IconFlag2,
|
|
28200
|
-
|
|
28137
|
+
ch as IconGauge,
|
|
28201
28138
|
IconGiphy,
|
|
28202
|
-
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
28139
|
+
ci as IconGoogle,
|
|
28140
|
+
cj as IconHashtagChannel,
|
|
28141
|
+
ck as IconHeart2,
|
|
28142
|
+
cl as IconHistory,
|
|
28206
28143
|
IconImages1Alt,
|
|
28207
|
-
|
|
28208
|
-
|
|
28144
|
+
cm as IconInvite,
|
|
28145
|
+
cn as IconLayersBehind,
|
|
28209
28146
|
IconLayoutAlignLeft,
|
|
28210
|
-
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
|
|
28147
|
+
co as IconLayoutGrid1,
|
|
28148
|
+
cp as IconLightBulbSimple,
|
|
28149
|
+
cq as IconLimits,
|
|
28150
|
+
cr as IconLineChart3,
|
|
28214
28151
|
IconLoadingCircle,
|
|
28215
|
-
|
|
28152
|
+
cs as IconLock,
|
|
28216
28153
|
IconMagnifyingGlassSearch,
|
|
28217
28154
|
IconMapPin,
|
|
28218
28155
|
IconMicrophone,
|
|
28219
|
-
|
|
28220
|
-
|
|
28221
|
-
|
|
28156
|
+
ct as IconMicrophoneSolid,
|
|
28157
|
+
cu as IconMinusLarge,
|
|
28158
|
+
cv as IconMinusSmall,
|
|
28222
28159
|
IconMute,
|
|
28223
|
-
|
|
28224
|
-
|
|
28160
|
+
cw as IconNewspaper2,
|
|
28161
|
+
cx as IconOrganization,
|
|
28225
28162
|
IconPaperPlane,
|
|
28226
|
-
|
|
28163
|
+
cy as IconPaperPlaneTopRight,
|
|
28227
28164
|
IconPaperclip,
|
|
28228
|
-
|
|
28165
|
+
cz as IconParagraphsText,
|
|
28229
28166
|
IconPause,
|
|
28230
|
-
|
|
28167
|
+
cA as IconPencil,
|
|
28231
28168
|
IconPeople,
|
|
28232
|
-
|
|
28169
|
+
cB as IconPeople2,
|
|
28233
28170
|
IconPeopleAdd,
|
|
28234
28171
|
IconPeopleAdded,
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
|
|
28172
|
+
cC as IconPeopleCircle,
|
|
28173
|
+
cD as IconPeopleCopy,
|
|
28174
|
+
cE as IconPeopleEditUserRights,
|
|
28238
28175
|
IconPeopleRemove,
|
|
28239
|
-
|
|
28176
|
+
cF as IconPersona,
|
|
28240
28177
|
IconPin,
|
|
28241
28178
|
IconPlaySolid,
|
|
28242
28179
|
IconPlusLarge,
|
|
28243
28180
|
IconPlusSmall,
|
|
28244
28181
|
IconRunShortcut,
|
|
28245
|
-
|
|
28246
|
-
|
|
28247
|
-
|
|
28248
|
-
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28182
|
+
cG as IconSearchText,
|
|
28183
|
+
cH as IconSettingsGear2,
|
|
28184
|
+
cI as IconSettingsSliderVer,
|
|
28185
|
+
cJ as IconShapesPlusCloseSquareCircle,
|
|
28186
|
+
cK as IconShapesTriangleSquareCircle,
|
|
28187
|
+
cL as IconShareRedirectLink,
|
|
28188
|
+
cM as IconShield,
|
|
28252
28189
|
IconSquareBehindSquare2_Copy,
|
|
28253
|
-
|
|
28254
|
-
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28190
|
+
cN as IconSquareCircleTopRightFeeds,
|
|
28191
|
+
cO as IconStop,
|
|
28192
|
+
cP as IconTable,
|
|
28193
|
+
cQ as IconTeam,
|
|
28194
|
+
cR as IconTennis,
|
|
28195
|
+
cS as IconTextToImageURLEnrichment,
|
|
28259
28196
|
IconThunder,
|
|
28260
28197
|
IconTranslate,
|
|
28261
28198
|
IconTrashBin,
|
|
28262
|
-
|
|
28199
|
+
cT as IconTrending4,
|
|
28263
28200
|
IconTrophy,
|
|
28264
|
-
|
|
28201
|
+
cU as IconUnlocked,
|
|
28265
28202
|
IconUnpin,
|
|
28266
|
-
|
|
28203
|
+
cV as IconUsers,
|
|
28267
28204
|
IconVideo,
|
|
28268
28205
|
IconVideoSolid,
|
|
28269
|
-
|
|
28270
|
-
|
|
28206
|
+
cW as IconVoiceAndVideo,
|
|
28207
|
+
cX as IconVoiceHigh,
|
|
28271
28208
|
IconVolumeFull,
|
|
28272
|
-
|
|
28209
|
+
cY as IconWebhook,
|
|
28273
28210
|
ImageComponent,
|
|
28274
28211
|
ImageContainer,
|
|
28275
28212
|
ImagePlaceholder,
|
|
@@ -28278,9 +28215,9 @@ export {
|
|
|
28278
28215
|
LinkPreviewList,
|
|
28279
28216
|
LoadMoreButton,
|
|
28280
28217
|
LoadMorePaginator,
|
|
28281
|
-
|
|
28218
|
+
cZ as LoadingChannel,
|
|
28282
28219
|
LoadingChannels,
|
|
28283
|
-
|
|
28220
|
+
c_ as LoadingErrorIndicator,
|
|
28284
28221
|
LoadingIndicator,
|
|
28285
28222
|
LoadingIndicatorIcon,
|
|
28286
28223
|
MAX_MESSAGE_REACTIONS_TO_FETCH,
|
|
@@ -28295,14 +28232,13 @@ export {
|
|
|
28295
28232
|
MessageBouncePrompt,
|
|
28296
28233
|
MessageBounceProvider,
|
|
28297
28234
|
MessageComposer,
|
|
28298
|
-
|
|
28235
|
+
dj as MessageComposerContext,
|
|
28299
28236
|
MessageComposerContextProvider,
|
|
28300
28237
|
MessageComposerUI,
|
|
28301
28238
|
MessageContext,
|
|
28302
28239
|
MessageDeletedBubble,
|
|
28303
28240
|
MessageDeliveryStatus,
|
|
28304
28241
|
MessageEditedIndicator,
|
|
28305
|
-
MessageErrorIcon,
|
|
28306
28242
|
MessageList,
|
|
28307
28243
|
MessageListContext,
|
|
28308
28244
|
MessageListContextProvider,
|
|
@@ -28328,10 +28264,9 @@ export {
|
|
|
28328
28264
|
NotificationList,
|
|
28329
28265
|
NotificationTranslationTopic,
|
|
28330
28266
|
NumericInput,
|
|
28331
|
-
|
|
28267
|
+
c$ as OPTIONAL_MESSAGE_ACTIONS,
|
|
28332
28268
|
OtherFilesContainer,
|
|
28333
28269
|
PauseIcon,
|
|
28334
|
-
PinIcon,
|
|
28335
28270
|
PinIndicator,
|
|
28336
28271
|
PlayButton,
|
|
28337
28272
|
PlayIcon,
|
|
@@ -28358,7 +28293,6 @@ export {
|
|
|
28358
28293
|
QuotedMessagePreview,
|
|
28359
28294
|
QuotedMessagePreviewUI,
|
|
28360
28295
|
QuotedVoiceRecording,
|
|
28361
|
-
ReactionIcon,
|
|
28362
28296
|
ReactionSelector,
|
|
28363
28297
|
RecordingPermission,
|
|
28364
28298
|
RecordingPermissionDeniedNotification,
|
|
@@ -28397,23 +28331,22 @@ export {
|
|
|
28397
28331
|
TextInputFieldSet,
|
|
28398
28332
|
TextareaComposer,
|
|
28399
28333
|
Thread,
|
|
28400
|
-
|
|
28334
|
+
da as ThreadContext,
|
|
28401
28335
|
ThreadHeader,
|
|
28402
|
-
ThreadIcon,
|
|
28403
28336
|
ThreadList,
|
|
28404
28337
|
ThreadListItem,
|
|
28405
28338
|
ThreadListItemUI,
|
|
28406
|
-
|
|
28339
|
+
db as ThreadProvider,
|
|
28407
28340
|
ThreadStart,
|
|
28408
28341
|
Tooltip,
|
|
28409
28342
|
TranslationBuilder,
|
|
28410
|
-
|
|
28343
|
+
dk as TranslationContext,
|
|
28411
28344
|
TranslationProvider,
|
|
28412
28345
|
TranslationTopic,
|
|
28413
|
-
|
|
28346
|
+
dl as TypingContext,
|
|
28414
28347
|
TypingIndicator,
|
|
28415
28348
|
TypingIndicatorHeader,
|
|
28416
|
-
|
|
28349
|
+
dm as TypingProvider,
|
|
28417
28350
|
UNREAD_MESSAGE_SEPARATOR_CLASS,
|
|
28418
28351
|
UnMemoizedLoadMorePaginator,
|
|
28419
28352
|
UnreadMessagesNotification,
|
|
@@ -28433,31 +28366,31 @@ export {
|
|
|
28433
28366
|
VoiceRecordingPlayer,
|
|
28434
28367
|
WaveProgressBar,
|
|
28435
28368
|
Window,
|
|
28436
|
-
|
|
28369
|
+
br as WithAudioPlayback,
|
|
28437
28370
|
WithComponents,
|
|
28438
28371
|
WithDragAndDropUpload,
|
|
28439
28372
|
addNotificationTargetTag,
|
|
28440
28373
|
areMessagePropsEqual,
|
|
28441
28374
|
areMessageUIPropsEqual,
|
|
28442
28375
|
countEmojis,
|
|
28443
|
-
|
|
28376
|
+
bF as createIcon,
|
|
28444
28377
|
deTranslations,
|
|
28445
28378
|
defaultAllowedTagNames,
|
|
28446
28379
|
defaultAttachmentActionsDefaultFocus,
|
|
28447
28380
|
defaultAttachmentSelectorActionSet,
|
|
28448
|
-
|
|
28381
|
+
bE as defaultChatViewSelectorItemSet,
|
|
28449
28382
|
defaultComponents,
|
|
28450
28383
|
defaultDateTimeParser,
|
|
28451
28384
|
defaultMessageActionSet,
|
|
28452
28385
|
defaultPinPermissions,
|
|
28453
28386
|
defaultReactionOptions,
|
|
28454
|
-
|
|
28387
|
+
bs as defaultRegisterAudioPlayerError,
|
|
28455
28388
|
defaultRenderMessages,
|
|
28456
28389
|
defaultTranslatorFunction,
|
|
28457
28390
|
displayDuration,
|
|
28458
28391
|
divMod,
|
|
28459
28392
|
downSample,
|
|
28460
|
-
|
|
28393
|
+
bt as elementIsPlaying,
|
|
28461
28394
|
emojiMarkdownPlugin,
|
|
28462
28395
|
emojiToUnicode,
|
|
28463
28396
|
enTranslations,
|
|
@@ -28471,21 +28404,21 @@ export {
|
|
|
28471
28404
|
getCssDimensionsVariables,
|
|
28472
28405
|
getGroupChannelDisplayInfo,
|
|
28473
28406
|
getGroupStyles,
|
|
28474
|
-
|
|
28407
|
+
d0 as getImages,
|
|
28475
28408
|
getIsFirstUnreadMessage,
|
|
28476
28409
|
getLastReceived,
|
|
28477
28410
|
getLatestMessagePreview,
|
|
28478
28411
|
getMessageActions,
|
|
28479
|
-
|
|
28480
|
-
|
|
28481
|
-
|
|
28412
|
+
d1 as getNonImageAttachments,
|
|
28413
|
+
d7 as getNotificationTargetPanel,
|
|
28414
|
+
d8 as getNotificationTargetTag,
|
|
28482
28415
|
getReadByTooltipText,
|
|
28483
28416
|
getTextareaCaretRect,
|
|
28484
28417
|
getTranslatedMessageText,
|
|
28485
28418
|
getWholeChar,
|
|
28486
28419
|
handleActionWarning,
|
|
28487
|
-
|
|
28488
|
-
|
|
28420
|
+
d4 as hasMoreMessagesProbably,
|
|
28421
|
+
d5 as hasNotMoreMessages,
|
|
28489
28422
|
hiTranslations,
|
|
28490
28423
|
htmlToTextPlugin,
|
|
28491
28424
|
imageToLink,
|
|
@@ -28495,7 +28428,7 @@ export {
|
|
|
28495
28428
|
isChrome,
|
|
28496
28429
|
isDate,
|
|
28497
28430
|
isDateSeparatorMessage,
|
|
28498
|
-
|
|
28431
|
+
dn as isDayOrMoment,
|
|
28499
28432
|
isFirefox,
|
|
28500
28433
|
isGalleryAttachmentType,
|
|
28501
28434
|
isIntroMessage,
|
|
@@ -28505,9 +28438,10 @@ export {
|
|
|
28505
28438
|
isMessageBounced,
|
|
28506
28439
|
isMessageEdited,
|
|
28507
28440
|
isMessageErrorRetryable,
|
|
28441
|
+
isNetworkSendFailure,
|
|
28508
28442
|
isNotificationForPanel,
|
|
28509
|
-
|
|
28510
|
-
|
|
28443
|
+
d6 as isNotificationTargetPanel,
|
|
28444
|
+
dp as isNumberOrString,
|
|
28511
28445
|
isSafari,
|
|
28512
28446
|
isSvgAttachment,
|
|
28513
28447
|
isUserMuted,
|
|
@@ -28515,8 +28449,8 @@ export {
|
|
|
28515
28449
|
jaTranslations,
|
|
28516
28450
|
keepLineBreaksPlugin,
|
|
28517
28451
|
koTranslations,
|
|
28518
|
-
|
|
28519
|
-
|
|
28452
|
+
d3 as makeDateMessageId,
|
|
28453
|
+
d2 as makeIntroMessage,
|
|
28520
28454
|
mapEmojiMartData,
|
|
28521
28455
|
mapToUserNameOrId,
|
|
28522
28456
|
markDownRenderers,
|
|
@@ -28553,8 +28487,8 @@ export {
|
|
|
28553
28487
|
upSample,
|
|
28554
28488
|
useAIState,
|
|
28555
28489
|
useActionHandler,
|
|
28556
|
-
|
|
28557
|
-
|
|
28490
|
+
bq as useActiveAudioPlayer,
|
|
28491
|
+
bA as useActiveThread,
|
|
28558
28492
|
useAttachmentManagerState,
|
|
28559
28493
|
useAttachmentsForPreview,
|
|
28560
28494
|
useAudioPlayer,
|
|
@@ -28563,13 +28497,13 @@ export {
|
|
|
28563
28497
|
useChannelActionContext,
|
|
28564
28498
|
useChannelDeletedListener,
|
|
28565
28499
|
useChannelDisplayName,
|
|
28566
|
-
|
|
28500
|
+
bv as useChannelEditMessageHandler,
|
|
28567
28501
|
useChannelHiddenListener,
|
|
28568
28502
|
useChannelListContext,
|
|
28569
28503
|
useChannelListItemContext,
|
|
28570
28504
|
useChannelMembersState,
|
|
28571
28505
|
useChannelMembershipState,
|
|
28572
|
-
|
|
28506
|
+
bw as useChannelMentionsHandler,
|
|
28573
28507
|
useChannelPreviewInfo,
|
|
28574
28508
|
useChannelStateContext,
|
|
28575
28509
|
useChannelTruncatedListener,
|
|
@@ -28594,7 +28528,7 @@ export {
|
|
|
28594
28528
|
useFlagHandler,
|
|
28595
28529
|
useGalleryContext,
|
|
28596
28530
|
useLastReadData,
|
|
28597
|
-
|
|
28531
|
+
d9 as useLegacyThreadContext,
|
|
28598
28532
|
useLiveLocationSharingManager,
|
|
28599
28533
|
useMarkUnreadHandler,
|
|
28600
28534
|
useMentionsHandler,
|