stream-chat-react 13.0.0-rc.2 → 13.0.1
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/components/Channel/Channel.d.ts +1 -1
- package/dist/components/Channel/Channel.js +2 -0
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/MessageInput/EditMessageForm.js +1 -1
- package/dist/components/MessageInput/MessageInput.d.ts +1 -3
- package/dist/components/MessageInput/MessageInputFlat.js +2 -2
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +1 -3
- package/dist/components/MessageInput/hooks/useMessageInputControls.d.ts +0 -1
- package/dist/components/MessageInput/hooks/useMessageInputControls.js +3 -4
- package/dist/components/MessageInput/hooks/usePasteHandler.d.ts +1 -1
- package/dist/components/MessageInput/hooks/usePasteHandler.js +4 -4
- package/dist/components/MessageInput/hooks/useSubmitHandler.js +31 -1
- package/dist/components/MessageInput/hooks/{useMessageInputText.d.ts → useTextareaRef.d.ts} +1 -2
- package/dist/components/MessageInput/hooks/useTextareaRef.js +14 -0
- package/dist/components/Poll/PollActions/PollResults/PollResults.js +1 -1
- package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.js +9 -2
- package/dist/components/TextareaComposer/TextareaComposer.d.ts +3 -5
- package/dist/components/TextareaComposer/TextareaComposer.js +15 -13
- package/dist/context/ComponentContext.d.ts +3 -3
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/experimental/index.browser.cjs.map +2 -2
- package/dist/experimental/index.node.cjs.map +2 -2
- package/dist/i18n/Streami18n.d.ts +1 -0
- package/dist/i18n/de.json +1 -0
- package/dist/i18n/en.json +1 -0
- package/dist/i18n/es.json +1 -0
- package/dist/i18n/fr.json +1 -0
- package/dist/i18n/hi.json +1 -0
- package/dist/i18n/it.json +1 -0
- package/dist/i18n/ja.json +1 -0
- package/dist/i18n/ko.json +2 -1
- package/dist/i18n/nl.json +2 -1
- package/dist/i18n/pt.json +1 -0
- package/dist/i18n/ru.json +1 -0
- package/dist/i18n/tr.json +1 -0
- package/dist/index.browser.cjs +348 -323
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +348 -323
- package/dist/index.node.cjs.map +4 -4
- package/dist/plugins/Emojis/EmojiPicker.js +9 -4
- package/dist/plugins/Emojis/index.browser.cjs +208 -96
- package/dist/plugins/Emojis/index.browser.cjs.map +4 -4
- package/dist/plugins/Emojis/index.node.cjs +208 -96
- package/dist/plugins/Emojis/index.node.cjs.map +4 -4
- package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.d.ts +4 -48
- package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.js +52 -58
- package/dist/scss/v2/MessageInput/MessageInput-layout.scss +5 -0
- package/package.json +4 -4
- package/dist/components/MessageInput/hooks/useMessageInputText.js +0 -44
package/dist/index.node.cjs
CHANGED
|
@@ -20473,11 +20473,11 @@ __export(src_exports, {
|
|
|
20473
20473
|
module.exports = __toCommonJS(src_exports);
|
|
20474
20474
|
|
|
20475
20475
|
// src/components/Attachment/Attachment.tsx
|
|
20476
|
-
var
|
|
20477
|
-
var
|
|
20476
|
+
var import_react254 = __toESM(require("react"));
|
|
20477
|
+
var import_stream_chat11 = require("stream-chat");
|
|
20478
20478
|
|
|
20479
20479
|
// src/components/Attachment/AttachmentContainer.tsx
|
|
20480
|
-
var
|
|
20480
|
+
var import_react253 = __toESM(require("react"));
|
|
20481
20481
|
var import_react_player2 = __toESM(require("react-player"));
|
|
20482
20482
|
var import_clsx65 = __toESM(require("clsx"));
|
|
20483
20483
|
var linkify = __toESM(require("linkifyjs"));
|
|
@@ -21722,7 +21722,7 @@ var UnMemoizedAudio = (props) => {
|
|
|
21722
21722
|
var Audio = import_react29.default.memo(UnMemoizedAudio);
|
|
21723
21723
|
|
|
21724
21724
|
// src/components/Attachment/VoiceRecording.tsx
|
|
21725
|
-
var
|
|
21725
|
+
var import_react249 = __toESM(require("react"));
|
|
21726
21726
|
|
|
21727
21727
|
// src/components/ReactFileUtilities/FileIcon/FileIcon.tsx
|
|
21728
21728
|
var import_react31 = __toESM(require("react"));
|
|
@@ -22685,7 +22685,7 @@ var FileIcon = (props) => {
|
|
|
22685
22685
|
// src/components/ReactFileUtilities/UploadButton.tsx
|
|
22686
22686
|
var import_clsx63 = __toESM(require("clsx"));
|
|
22687
22687
|
var import_nanoid5 = require("nanoid");
|
|
22688
|
-
var
|
|
22688
|
+
var import_react248 = __toESM(require("react"));
|
|
22689
22689
|
|
|
22690
22690
|
// src/components/ReactFileUtilities/utils.ts
|
|
22691
22691
|
var import_react32 = require("react");
|
|
@@ -44172,7 +44172,7 @@ var PollOptionWithLatestVotes = ({
|
|
|
44172
44172
|
// src/components/Poll/PollActions/PollResults/PollResults.tsx
|
|
44173
44173
|
var pollStateSelector10 = (nextValue) => ({
|
|
44174
44174
|
name: nextValue.name,
|
|
44175
|
-
options: nextValue.options,
|
|
44175
|
+
options: [...nextValue.options],
|
|
44176
44176
|
vote_counts_by_option: nextValue.vote_counts_by_option
|
|
44177
44177
|
});
|
|
44178
44178
|
var PollResults = ({ close }) => {
|
|
@@ -44441,9 +44441,15 @@ var MultipleAnswersField = () => {
|
|
|
44441
44441
|
pollComposer.handleFieldBlur("max_votes_allowed");
|
|
44442
44442
|
},
|
|
44443
44443
|
onChange: (e) => {
|
|
44444
|
-
|
|
44445
|
-
max_votes_allowed:
|
|
44446
|
-
}
|
|
44444
|
+
const nativeFieldValidation = !e.target.validity.valid ? {
|
|
44445
|
+
max_votes_allowed: t("Only numbers are allowed")
|
|
44446
|
+
} : void 0;
|
|
44447
|
+
pollComposer.updateFields(
|
|
44448
|
+
{
|
|
44449
|
+
max_votes_allowed: !nativeFieldValidation ? e.target.value : pollComposer.max_votes_allowed
|
|
44450
|
+
},
|
|
44451
|
+
nativeFieldValidation
|
|
44452
|
+
);
|
|
44447
44453
|
},
|
|
44448
44454
|
placeholder: t("Maximum number of votes (from 2 to 10)"),
|
|
44449
44455
|
type: "number",
|
|
@@ -45510,6 +45516,7 @@ var de_default = {
|
|
|
45510
45516
|
"Nobody will be able to vote in this poll anymore.": "Niemand kann mehr in dieser Umfrage abstimmen.",
|
|
45511
45517
|
"Nothing yet...": "Noch nichts...",
|
|
45512
45518
|
Ok: "Ok",
|
|
45519
|
+
"Only numbers are allowed": "Nur Zahlen sind erlaubt",
|
|
45513
45520
|
"Open emoji picker": "Emoji-Auswahl \xF6ffnen",
|
|
45514
45521
|
"Option already exists": "Option existiert bereits",
|
|
45515
45522
|
Options: "Optionen",
|
|
@@ -45722,6 +45729,7 @@ var en_default = {
|
|
|
45722
45729
|
"Nobody will be able to vote in this poll anymore.": "Nobody will be able to vote in this poll anymore.",
|
|
45723
45730
|
"Nothing yet...": "Nothing yet...",
|
|
45724
45731
|
Ok: "Ok",
|
|
45732
|
+
"Only numbers are allowed": "Only numbers are allowed",
|
|
45725
45733
|
"Open emoji picker": "Open emoji picker",
|
|
45726
45734
|
"Option already exists": "Option already exists",
|
|
45727
45735
|
Options: "Options",
|
|
@@ -45924,6 +45932,7 @@ var es_default = {
|
|
|
45924
45932
|
"Nobody will be able to vote in this poll anymore.": "Nadie podr\xE1 votar en esta encuesta.",
|
|
45925
45933
|
"Nothing yet...": "Nada a\xFAn...",
|
|
45926
45934
|
Ok: "Ok",
|
|
45935
|
+
"Only numbers are allowed": "Solo se permiten n\xFAmeros",
|
|
45927
45936
|
"Open emoji picker": "Abrir el selector de emojis",
|
|
45928
45937
|
"Option already exists": "La opci\xF3n ya existe",
|
|
45929
45938
|
Options: "Opciones",
|
|
@@ -46144,6 +46153,7 @@ var fr_default = {
|
|
|
46144
46153
|
"Nobody will be able to vote in this poll anymore.": "Personne ne pourra plus voter dans ce sondage.",
|
|
46145
46154
|
"Nothing yet...": "Rien pour l'instant...",
|
|
46146
46155
|
Ok: "D'accord",
|
|
46156
|
+
"Only numbers are allowed": "Seuls les chiffres sont autoris\xE9s",
|
|
46147
46157
|
"Open emoji picker": "Ouvrir le s\xE9lecteur d'\xE9mojis",
|
|
46148
46158
|
"Option already exists": "L'option existe d\xE9j\xE0",
|
|
46149
46159
|
Options: "Options",
|
|
@@ -46365,6 +46375,7 @@ var hi_default = {
|
|
|
46365
46375
|
"Nobody will be able to vote in this poll anymore.": "\u0905\u092C \u0915\u094B\u0908 \u092D\u0940 \u0907\u0938 \u092E\u0924\u0926\u093E\u0928 \u092E\u0947\u0902 \u092E\u0924\u0926\u093E\u0928 \u0928\u0939\u0940\u0902 \u0915\u0930 \u0938\u0915\u0947\u0917\u093E\u0964",
|
|
46366
46376
|
"Nothing yet...": "\u0915\u094B\u0908 \u092E\u0948\u0938\u0947\u091C \u0928\u0939\u0940\u0902 \u0939\u0948",
|
|
46367
46377
|
Ok: "\u0920\u0940\u0915 \u0939\u0948",
|
|
46378
|
+
"Only numbers are allowed": "\u0915\u0947\u0935\u0932 \u0938\u0902\u0916\u094D\u092F\u093E\u090F\u0901 \u0905\u0928\u0941\u092E\u0924 \u0939\u0948\u0902",
|
|
46368
46379
|
"Open emoji picker": "\u0907\u092E\u094B\u091C\u0940 \u092A\u093F\u0915\u0930 \u0916\u094B\u0932\u093F\u092F\u0947",
|
|
46369
46380
|
"Option already exists": "\u0935\u093F\u0915\u0932\u094D\u092A \u092A\u0939\u0932\u0947 \u0938\u0947 \u092E\u094C\u091C\u0942\u0926 \u0939\u0948",
|
|
46370
46381
|
Options: "\u0935\u093F\u0915\u0932\u094D\u092A",
|
|
@@ -46577,6 +46588,7 @@ var it_default = {
|
|
|
46577
46588
|
"Nobody will be able to vote in this poll anymore.": "Nessuno potr\xE0 pi\xF9 votare in questo sondaggio.",
|
|
46578
46589
|
"Nothing yet...": "Ancora niente...",
|
|
46579
46590
|
Ok: "Ok",
|
|
46591
|
+
"Only numbers are allowed": "Sono consentiti solo numeri",
|
|
46580
46592
|
"Open emoji picker": "Apri il selettore di emoji",
|
|
46581
46593
|
"Option already exists": "L'opzione esiste gi\xE0",
|
|
46582
46594
|
Options: "Opzioni",
|
|
@@ -46797,6 +46809,7 @@ var ja_default = {
|
|
|
46797
46809
|
"Nobody will be able to vote in this poll anymore.": "\u3053\u306E\u6295\u7968\u3067\u306F\u3001\u8AB0\u3082\u6295\u7968\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002",
|
|
46798
46810
|
"Nothing yet...": "\u307E\u3060\u4F55\u3082\u3042\u308A\u307E\u305B\u3093...",
|
|
46799
46811
|
Ok: "OK",
|
|
46812
|
+
"Only numbers are allowed": "\u6570\u5B57\u306E\u307F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u3059",
|
|
46800
46813
|
"Open emoji picker": "\u7D75\u6587\u5B57\u30D4\u30C3\u30AB\u30FC\u3092\u958B\u304F",
|
|
46801
46814
|
"Option already exists": "\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059",
|
|
46802
46815
|
Options: "\u30AA\u30D7\u30B7\u30E7\u30F3",
|
|
@@ -47003,7 +47016,8 @@ var ko_default = {
|
|
|
47003
47016
|
"Nobody will be able to vote in this poll anymore.": "\uC774 \uD22C\uD45C\uC5D0 \uB354 \uC774\uC0C1 \uC544\uBB34\uB3C4 \uD22C\uD45C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
47004
47017
|
"Nothing yet...": "\uC544\uC9C1 \uC544\uBB34\uAC83\uB3C4...",
|
|
47005
47018
|
Ok: "\uD655\uC778",
|
|
47006
|
-
"
|
|
47019
|
+
"Only numbers are allowed": "\uC22B\uC790\uB9CC \uC785\uB825 \uAC00\uB2A5\uD569\uB2C8\uB2E4",
|
|
47020
|
+
"Open emoji picker": "\uC774\uBAA8\uC9C0 \uC120\uD0DD\uAE30 \uC5F4\uAE30",
|
|
47007
47021
|
"Option already exists": "\uC635\uC158\uC774 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4",
|
|
47008
47022
|
Options: "\uC635\uC158",
|
|
47009
47023
|
"People matching": "\uC77C\uCE58\uD558\uB294 \uC0AC\uB78C",
|
|
@@ -47209,7 +47223,8 @@ var nl_default = {
|
|
|
47209
47223
|
"Nobody will be able to vote in this poll anymore.": "Niemand kan meer stemmen in deze peiling.",
|
|
47210
47224
|
"Nothing yet...": "Nog niets ...",
|
|
47211
47225
|
Ok: "Ok\xE9",
|
|
47212
|
-
"
|
|
47226
|
+
"Only numbers are allowed": "Alleen nummers zijn toegestaan",
|
|
47227
|
+
"Open emoji picker": "Emoji-kiezer openen",
|
|
47213
47228
|
"Option already exists": "Optie bestaat al",
|
|
47214
47229
|
Options: "Opties",
|
|
47215
47230
|
"People matching": "Mensen die matchen",
|
|
@@ -47421,6 +47436,7 @@ var pt_default = {
|
|
|
47421
47436
|
"Nobody will be able to vote in this poll anymore.": "Ningu\xE9m mais poder\xE1 votar nesta pesquisa.",
|
|
47422
47437
|
"Nothing yet...": "Nada ainda...",
|
|
47423
47438
|
Ok: "Ok",
|
|
47439
|
+
"Only numbers are allowed": "Apenas n\xFAmeros s\xE3o permitidos",
|
|
47424
47440
|
"Open emoji picker": "Abrir seletor de emoji",
|
|
47425
47441
|
"Option already exists": "Op\xE7\xE3o j\xE1 existe",
|
|
47426
47442
|
Options: "Op\xE7\xF5es",
|
|
@@ -47641,6 +47657,7 @@ var ru_default = {
|
|
|
47641
47657
|
"Nobody will be able to vote in this poll anymore.": "\u041D\u0438\u043A\u0442\u043E \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u043C\u043E\u0436\u0435\u0442 \u0433\u043E\u043B\u043E\u0441\u043E\u0432\u0430\u0442\u044C \u0432 \u044D\u0442\u043E\u043C \u043E\u043F\u0440\u043E\u0441\u0435.",
|
|
47642
47658
|
"Nothing yet...": "\u041F\u043E\u043A\u0430 \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435\u0442...",
|
|
47643
47659
|
Ok: "\u041E\u043A",
|
|
47660
|
+
"Only numbers are allowed": "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u0446\u0438\u0444\u0440\u044B",
|
|
47644
47661
|
"Open emoji picker": "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432\u044B\u0431\u043E\u0440 \u0441\u043C\u0430\u0439\u043B\u043E\u0432",
|
|
47645
47662
|
"Option already exists": "\u0412\u0430\u0440\u0438\u0430\u043D\u0442 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442",
|
|
47646
47663
|
Options: "\u0412\u0430\u0440\u0438\u0430\u043D\u0442\u044B",
|
|
@@ -47869,6 +47886,7 @@ var tr_default = {
|
|
|
47869
47886
|
"Nobody will be able to vote in this poll anymore.": "Art\u0131k bu ankette kimse oy kullanamayacak.",
|
|
47870
47887
|
"Nothing yet...": "\u015Eimdilik hi\xE7bir \u015Fey...",
|
|
47871
47888
|
Ok: "Tamam",
|
|
47889
|
+
"Only numbers are allowed": "Sadece say\u0131lar kullan\u0131labilir",
|
|
47872
47890
|
"Open emoji picker": "Emoji klavyesini a\xE7",
|
|
47873
47891
|
"Option already exists": "Se\xE7enek zaten mevcut",
|
|
47874
47892
|
Options: "Se\xE7enekler",
|
|
@@ -51331,7 +51349,7 @@ var AttachmentSelector = ({
|
|
|
51331
51349
|
|
|
51332
51350
|
// src/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.tsx
|
|
51333
51351
|
var import_react227 = __toESM(require("react"));
|
|
51334
|
-
var
|
|
51352
|
+
var import_stream_chat9 = require("stream-chat");
|
|
51335
51353
|
|
|
51336
51354
|
// src/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx
|
|
51337
51355
|
var import_react210 = __toESM(require("react"));
|
|
@@ -52473,55 +52491,40 @@ var useCooldownTimer = () => {
|
|
|
52473
52491
|
};
|
|
52474
52492
|
};
|
|
52475
52493
|
|
|
52476
|
-
// src/components/MessageInput/hooks/
|
|
52494
|
+
// src/components/MessageInput/hooks/useTextareaRef.ts
|
|
52477
52495
|
var import_react223 = require("react");
|
|
52478
|
-
var
|
|
52479
|
-
text: state.text
|
|
52480
|
-
});
|
|
52481
|
-
var useMessageInputText = (props) => {
|
|
52496
|
+
var useTextareaRef = (props) => {
|
|
52482
52497
|
const { focus } = props;
|
|
52483
|
-
const messageComposer = useMessageComposer();
|
|
52484
52498
|
const textareaRef = (0, import_react223.useRef)(void 0);
|
|
52485
|
-
const { text: text7 } = useStateStore(
|
|
52486
|
-
messageComposer.textComposer.state,
|
|
52487
|
-
messageComposerStateSelector
|
|
52488
|
-
);
|
|
52489
52499
|
(0, import_react223.useEffect)(() => {
|
|
52490
52500
|
if (focus && textareaRef.current) {
|
|
52491
52501
|
textareaRef.current.focus();
|
|
52492
52502
|
}
|
|
52493
52503
|
}, [focus]);
|
|
52494
|
-
const newCursorPosition = (0, import_react223.useRef)(void 0);
|
|
52495
|
-
const insertText = (0, import_react223.useCallback)(
|
|
52496
|
-
(textToInsert) => {
|
|
52497
|
-
const selection = textareaRef?.current && {
|
|
52498
|
-
end: textareaRef.current.selectionEnd,
|
|
52499
|
-
start: textareaRef.current.selectionStart
|
|
52500
|
-
};
|
|
52501
|
-
messageComposer.textComposer.insertText({
|
|
52502
|
-
selection,
|
|
52503
|
-
text: textToInsert
|
|
52504
|
-
});
|
|
52505
|
-
if (selection) newCursorPosition.current = selection.start + textToInsert.length;
|
|
52506
|
-
},
|
|
52507
|
-
[messageComposer, newCursorPosition, textareaRef]
|
|
52508
|
-
);
|
|
52509
|
-
(0, import_react223.useEffect)(() => {
|
|
52510
|
-
const textareaElement = textareaRef.current;
|
|
52511
|
-
if (textareaElement && newCursorPosition.current !== void 0) {
|
|
52512
|
-
textareaElement.selectionStart = newCursorPosition.current;
|
|
52513
|
-
textareaElement.selectionEnd = newCursorPosition.current;
|
|
52514
|
-
newCursorPosition.current = void 0;
|
|
52515
|
-
}
|
|
52516
|
-
}, [text7, newCursorPosition]);
|
|
52517
52504
|
return {
|
|
52518
|
-
insertText,
|
|
52519
52505
|
textareaRef
|
|
52520
52506
|
};
|
|
52521
52507
|
};
|
|
52522
52508
|
|
|
52523
52509
|
// src/components/MessageInput/hooks/useSubmitHandler.ts
|
|
52524
52510
|
var import_react224 = require("react");
|
|
52511
|
+
var import_stream_chat8 = require("stream-chat");
|
|
52512
|
+
var takeStateSnapshot = (messageComposer) => {
|
|
52513
|
+
const textComposerState = messageComposer.textComposer.state.getLatestValue();
|
|
52514
|
+
const attachmentManagerState = messageComposer.attachmentManager.state.getLatestValue();
|
|
52515
|
+
const linkPreviewsManagerState = messageComposer.linkPreviewsManager.state.getLatestValue();
|
|
52516
|
+
const pollComposerState = messageComposer.pollComposer.state.getLatestValue();
|
|
52517
|
+
const customDataManagerState = messageComposer.customDataManager.state.getLatestValue();
|
|
52518
|
+
const state = messageComposer.state.getLatestValue();
|
|
52519
|
+
return () => {
|
|
52520
|
+
messageComposer.state.next(state);
|
|
52521
|
+
messageComposer.textComposer.state.next(textComposerState);
|
|
52522
|
+
messageComposer.attachmentManager.state.next(attachmentManagerState);
|
|
52523
|
+
messageComposer.linkPreviewsManager.state.next(linkPreviewsManagerState);
|
|
52524
|
+
messageComposer.pollComposer.state.next(pollComposerState);
|
|
52525
|
+
messageComposer.customDataManager.state.next(customDataManagerState);
|
|
52526
|
+
};
|
|
52527
|
+
};
|
|
52525
52528
|
var useSubmitHandler = (props) => {
|
|
52526
52529
|
const { clearEditingState, overrideSubmitHandler } = props;
|
|
52527
52530
|
const { addNotification, editMessage, sendMessage } = useChannelActionContext("useSubmitHandler");
|
|
@@ -52541,7 +52544,17 @@ var useSubmitHandler = (props) => {
|
|
|
52541
52544
|
addNotification(t("Edit message request failed"), "error");
|
|
52542
52545
|
}
|
|
52543
52546
|
} else {
|
|
52547
|
+
const restoreComposerStateSnapshot = takeStateSnapshot(messageComposer);
|
|
52544
52548
|
try {
|
|
52549
|
+
const sentPollMessage = !!message.poll_id;
|
|
52550
|
+
if (sentPollMessage) {
|
|
52551
|
+
messageComposer.state.partialNext({
|
|
52552
|
+
id: import_stream_chat8.MessageComposer.generateId(),
|
|
52553
|
+
pollId: null
|
|
52554
|
+
});
|
|
52555
|
+
} else {
|
|
52556
|
+
messageComposer.clear();
|
|
52557
|
+
}
|
|
52545
52558
|
if (overrideSubmitHandler) {
|
|
52546
52559
|
await overrideSubmitHandler({
|
|
52547
52560
|
cid: messageComposer.channel.cid,
|
|
@@ -52552,10 +52565,10 @@ var useSubmitHandler = (props) => {
|
|
|
52552
52565
|
} else {
|
|
52553
52566
|
await sendMessage({ localMessage, message, options: sendOptions });
|
|
52554
52567
|
}
|
|
52555
|
-
messageComposer.clear();
|
|
52556
52568
|
if (messageComposer.config.text.publishTypingEvents)
|
|
52557
52569
|
await messageComposer.channel.stopTyping();
|
|
52558
52570
|
} catch (err) {
|
|
52571
|
+
restoreComposerStateSnapshot();
|
|
52559
52572
|
addNotification(t("Send message request failed"), "error");
|
|
52560
52573
|
}
|
|
52561
52574
|
}
|
|
@@ -52575,8 +52588,8 @@ var useSubmitHandler = (props) => {
|
|
|
52575
52588
|
|
|
52576
52589
|
// src/components/MessageInput/hooks/usePasteHandler.ts
|
|
52577
52590
|
var import_react225 = require("react");
|
|
52578
|
-
var usePasteHandler = (
|
|
52579
|
-
const { attachmentManager } = useMessageComposer();
|
|
52591
|
+
var usePasteHandler = () => {
|
|
52592
|
+
const { attachmentManager, textComposer } = useMessageComposer();
|
|
52580
52593
|
const onPaste = (0, import_react225.useCallback)(
|
|
52581
52594
|
(clipboardEvent) => {
|
|
52582
52595
|
(async (event) => {
|
|
@@ -52597,13 +52610,13 @@ var usePasteHandler = (insertText) => {
|
|
|
52597
52610
|
const fileLikes = await dataTransferItemsToFiles(Array.from(items));
|
|
52598
52611
|
if (plainTextPromise) {
|
|
52599
52612
|
const pastedText = await plainTextPromise;
|
|
52600
|
-
insertText(pastedText);
|
|
52613
|
+
textComposer.insertText({ text: pastedText });
|
|
52601
52614
|
} else {
|
|
52602
52615
|
attachmentManager.uploadFiles(fileLikes);
|
|
52603
52616
|
}
|
|
52604
52617
|
})(clipboardEvent);
|
|
52605
52618
|
},
|
|
52606
|
-
[attachmentManager,
|
|
52619
|
+
[attachmentManager, textComposer]
|
|
52607
52620
|
);
|
|
52608
52621
|
return { onPaste };
|
|
52609
52622
|
};
|
|
@@ -52672,7 +52685,7 @@ var useMediaRecorder = ({
|
|
|
52672
52685
|
// src/components/MessageInput/hooks/useMessageInputControls.ts
|
|
52673
52686
|
var useMessageInputControls = (props) => {
|
|
52674
52687
|
const { asyncMessagesMultiSendEnabled, audioRecordingConfig, audioRecordingEnabled } = props;
|
|
52675
|
-
const {
|
|
52688
|
+
const { textareaRef } = useTextareaRef(props);
|
|
52676
52689
|
const { handleSubmit } = useSubmitHandler(props);
|
|
52677
52690
|
const recordingController = useMediaRecorder({
|
|
52678
52691
|
asyncMessagesMultiSendEnabled,
|
|
@@ -52680,10 +52693,9 @@ var useMessageInputControls = (props) => {
|
|
|
52680
52693
|
handleSubmit,
|
|
52681
52694
|
recordingConfig: audioRecordingConfig
|
|
52682
52695
|
});
|
|
52683
|
-
const { onPaste } = usePasteHandler(
|
|
52696
|
+
const { onPaste } = usePasteHandler();
|
|
52684
52697
|
return {
|
|
52685
52698
|
handleSubmit,
|
|
52686
|
-
insertText,
|
|
52687
52699
|
onPaste,
|
|
52688
52700
|
recordingController,
|
|
52689
52701
|
textareaRef
|
|
@@ -52717,8 +52729,8 @@ var AttachmentPreviewList = ({
|
|
|
52717
52729
|
"data-testid": "attachment-list-scroll-container"
|
|
52718
52730
|
},
|
|
52719
52731
|
attachments.map((attachment) => {
|
|
52720
|
-
if ((0,
|
|
52721
|
-
if ((0,
|
|
52732
|
+
if ((0, import_stream_chat9.isScrapedContent)(attachment)) return null;
|
|
52733
|
+
if ((0, import_stream_chat9.isLocalVoiceRecordingAttachment)(attachment)) {
|
|
52722
52734
|
return /* @__PURE__ */ import_react227.default.createElement(
|
|
52723
52735
|
VoiceRecordingPreview2,
|
|
52724
52736
|
{
|
|
@@ -52728,7 +52740,7 @@ var AttachmentPreviewList = ({
|
|
|
52728
52740
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
52729
52741
|
}
|
|
52730
52742
|
);
|
|
52731
|
-
} else if ((0,
|
|
52743
|
+
} else if ((0, import_stream_chat9.isLocalAudioAttachment)(attachment)) {
|
|
52732
52744
|
return /* @__PURE__ */ import_react227.default.createElement(
|
|
52733
52745
|
AudioAttachmentPreview,
|
|
52734
52746
|
{
|
|
@@ -52738,7 +52750,7 @@ var AttachmentPreviewList = ({
|
|
|
52738
52750
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
52739
52751
|
}
|
|
52740
52752
|
);
|
|
52741
|
-
} else if ((0,
|
|
52753
|
+
} else if ((0, import_stream_chat9.isLocalVideoAttachment)(attachment)) {
|
|
52742
52754
|
return /* @__PURE__ */ import_react227.default.createElement(
|
|
52743
52755
|
VideoAttachmentPreview,
|
|
52744
52756
|
{
|
|
@@ -52748,7 +52760,7 @@ var AttachmentPreviewList = ({
|
|
|
52748
52760
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
52749
52761
|
}
|
|
52750
52762
|
);
|
|
52751
|
-
} else if ((0,
|
|
52763
|
+
} else if ((0, import_stream_chat9.isLocalImageAttachment)(attachment)) {
|
|
52752
52764
|
return /* @__PURE__ */ import_react227.default.createElement(
|
|
52753
52765
|
ImageAttachmentPreview2,
|
|
52754
52766
|
{
|
|
@@ -52758,7 +52770,7 @@ var AttachmentPreviewList = ({
|
|
|
52758
52770
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
52759
52771
|
}
|
|
52760
52772
|
);
|
|
52761
|
-
} else if ((0,
|
|
52773
|
+
} else if ((0, import_stream_chat9.isLocalFileAttachment)(attachment)) {
|
|
52762
52774
|
return /* @__PURE__ */ import_react227.default.createElement(
|
|
52763
52775
|
FileAttachmentPreview2,
|
|
52764
52776
|
{
|
|
@@ -52768,7 +52780,7 @@ var AttachmentPreviewList = ({
|
|
|
52768
52780
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
52769
52781
|
}
|
|
52770
52782
|
);
|
|
52771
|
-
} else if ((0,
|
|
52783
|
+
} else if ((0, import_stream_chat9.isLocalAttachment)(attachment)) {
|
|
52772
52784
|
return /* @__PURE__ */ import_react227.default.createElement(
|
|
52773
52785
|
UnsupportedAttachmentPreview2,
|
|
52774
52786
|
{
|
|
@@ -52815,13 +52827,13 @@ var CooldownTimer = ({ cooldownInterval }) => {
|
|
|
52815
52827
|
};
|
|
52816
52828
|
|
|
52817
52829
|
// src/components/MessageInput/EditMessageForm.tsx
|
|
52818
|
-
var
|
|
52830
|
+
var import_react247 = __toESM(require("react"));
|
|
52819
52831
|
|
|
52820
52832
|
// src/components/MessageInput/MessageInput.tsx
|
|
52821
|
-
var
|
|
52833
|
+
var import_react246 = __toESM(require("react"));
|
|
52822
52834
|
|
|
52823
52835
|
// src/components/MessageInput/MessageInputFlat.tsx
|
|
52824
|
-
var
|
|
52836
|
+
var import_react244 = __toESM(require("react"));
|
|
52825
52837
|
|
|
52826
52838
|
// src/components/MessageInput/SendButton.tsx
|
|
52827
52839
|
var import_react230 = __toESM(require("react"));
|
|
@@ -52938,13 +52950,13 @@ var QuotedMessagePreview = ({
|
|
|
52938
52950
|
// src/components/MessageInput/LinkPreviewList.tsx
|
|
52939
52951
|
var import_clsx57 = __toESM(require("clsx"));
|
|
52940
52952
|
var import_react233 = __toESM(require("react"));
|
|
52941
|
-
var
|
|
52953
|
+
var import_stream_chat10 = require("stream-chat");
|
|
52942
52954
|
var linkPreviewsManagerStateSelector = (state) => ({
|
|
52943
52955
|
linkPreviews: Array.from(state.previews.values()).filter(
|
|
52944
|
-
(preview) =>
|
|
52956
|
+
(preview) => import_stream_chat10.LinkPreviewsManager.previewIsLoaded(preview) || import_stream_chat10.LinkPreviewsManager.previewIsLoading(preview)
|
|
52945
52957
|
)
|
|
52946
52958
|
});
|
|
52947
|
-
var
|
|
52959
|
+
var messageComposerStateSelector = (state) => ({
|
|
52948
52960
|
quotedMessage: state.quotedMessage
|
|
52949
52961
|
});
|
|
52950
52962
|
var LinkPreviewList = () => {
|
|
@@ -52952,7 +52964,7 @@ var LinkPreviewList = () => {
|
|
|
52952
52964
|
const { linkPreviewsManager } = messageComposer;
|
|
52953
52965
|
const { quotedMessage } = useStateStore(
|
|
52954
52966
|
messageComposer.state,
|
|
52955
|
-
|
|
52967
|
+
messageComposerStateSelector
|
|
52956
52968
|
);
|
|
52957
52969
|
const { linkPreviews } = useStateStore(
|
|
52958
52970
|
linkPreviewsManager.state,
|
|
@@ -52966,13 +52978,13 @@ var LinkPreviewCard = ({ linkPreview }) => {
|
|
|
52966
52978
|
const { linkPreviewsManager } = useMessageComposer();
|
|
52967
52979
|
const { handleEnter, handleLeave, tooltipVisible } = useEnterLeaveHandlers();
|
|
52968
52980
|
const [referenceElement, setReferenceElement] = (0, import_react233.useState)(null);
|
|
52969
|
-
if (!
|
|
52981
|
+
if (!import_stream_chat10.LinkPreviewsManager.previewIsLoaded(linkPreview) && !import_stream_chat10.LinkPreviewsManager.previewIsLoading(linkPreview))
|
|
52970
52982
|
return null;
|
|
52971
52983
|
return /* @__PURE__ */ import_react233.default.createElement(
|
|
52972
52984
|
"div",
|
|
52973
52985
|
{
|
|
52974
52986
|
className: (0, import_clsx57.default)("str-chat__link-preview-card", {
|
|
52975
|
-
"str-chat__link-preview-card--loading":
|
|
52987
|
+
"str-chat__link-preview-card--loading": import_stream_chat10.LinkPreviewsManager.previewIsLoading(linkPreview)
|
|
52976
52988
|
}),
|
|
52977
52989
|
"data-testid": "link-preview-card"
|
|
52978
52990
|
},
|
|
@@ -53178,8 +53190,10 @@ var SuggestionList = ({
|
|
|
53178
53190
|
};
|
|
53179
53191
|
|
|
53180
53192
|
// src/components/TextareaComposer/TextareaComposer.tsx
|
|
53193
|
+
var import_lodash19 = __toESM(require("lodash.debounce"));
|
|
53181
53194
|
var import_clsx61 = __toESM(require("clsx"));
|
|
53182
|
-
var import_react239 =
|
|
53195
|
+
var import_react239 = require("react");
|
|
53196
|
+
var import_react240 = __toESM(require("react"));
|
|
53183
53197
|
var import_react_textarea_autosize = __toESM(require("react-textarea-autosize"));
|
|
53184
53198
|
var textComposerStateSelector2 = (state) => ({
|
|
53185
53199
|
selection: state.selection,
|
|
@@ -53198,33 +53212,32 @@ var TextareaComposer = ({
|
|
|
53198
53212
|
className,
|
|
53199
53213
|
closeSuggestionsOnClickOutside,
|
|
53200
53214
|
containerClassName,
|
|
53201
|
-
// dropdownClassName, // todo: X find a different way to prevent prop drilling
|
|
53202
|
-
grow: growProp,
|
|
53203
|
-
// itemClassName, // todo: X find a different way to prevent prop drilling
|
|
53204
53215
|
listClassName,
|
|
53205
|
-
maxRows: maxRowsProp
|
|
53216
|
+
maxRows: maxRowsProp,
|
|
53217
|
+
minRows: minRowsProp,
|
|
53206
53218
|
onBlur,
|
|
53207
53219
|
onChange,
|
|
53208
53220
|
onKeyDown,
|
|
53209
53221
|
onScroll,
|
|
53222
|
+
onSelect,
|
|
53210
53223
|
placeholder: placeholderProp,
|
|
53211
53224
|
shouldSubmit: shouldSubmitProp,
|
|
53212
|
-
...
|
|
53225
|
+
...restTextareaProps
|
|
53213
53226
|
}) => {
|
|
53214
53227
|
const { t } = useTranslationContext();
|
|
53215
53228
|
const { AutocompleteSuggestionList = SuggestionList } = useComponentContext();
|
|
53216
53229
|
const {
|
|
53217
53230
|
additionalTextareaProps,
|
|
53218
53231
|
cooldownRemaining,
|
|
53219
|
-
grow: growContext,
|
|
53220
53232
|
handleSubmit,
|
|
53221
53233
|
maxRows: maxRowsContext,
|
|
53234
|
+
minRows: minRowsContext,
|
|
53222
53235
|
onPaste,
|
|
53223
53236
|
shouldSubmit: shouldSubmitContext,
|
|
53224
53237
|
textareaRef
|
|
53225
53238
|
} = useMessageInputContext();
|
|
53226
|
-
const
|
|
53227
|
-
const
|
|
53239
|
+
const maxRows = maxRowsProp ?? maxRowsContext ?? 1;
|
|
53240
|
+
const minRows = minRowsProp ?? minRowsContext;
|
|
53228
53241
|
const placeholder = placeholderProp ?? additionalTextareaProps?.placeholder;
|
|
53229
53242
|
const shouldSubmit = shouldSubmitProp ?? shouldSubmitContext ?? defaultShouldSubmit;
|
|
53230
53243
|
const messageComposer = useMessageComposer();
|
|
@@ -53235,10 +53248,10 @@ var TextareaComposer = ({
|
|
|
53235
53248
|
);
|
|
53236
53249
|
const { enabled } = useStateStore(messageComposer.configState, configStateSelector);
|
|
53237
53250
|
const { isLoadingItems } = useStateStore(suggestions?.searchSource.state, searchSourceStateSelector2) ?? {};
|
|
53238
|
-
const containerRef = (0,
|
|
53239
|
-
const [focusedItemIndex, setFocusedItemIndex] = (0,
|
|
53240
|
-
const [isComposing, setIsComposing] = (0,
|
|
53241
|
-
const changeHandler = (0,
|
|
53251
|
+
const containerRef = (0, import_react240.useRef)(null);
|
|
53252
|
+
const [focusedItemIndex, setFocusedItemIndex] = (0, import_react240.useState)(0);
|
|
53253
|
+
const [isComposing, setIsComposing] = (0, import_react240.useState)(false);
|
|
53254
|
+
const changeHandler = (0, import_react240.useCallback)(
|
|
53242
53255
|
(e) => {
|
|
53243
53256
|
if (onChange) {
|
|
53244
53257
|
onChange(e);
|
|
@@ -53255,25 +53268,23 @@ var TextareaComposer = ({
|
|
|
53255
53268
|
},
|
|
53256
53269
|
[onChange, textComposer, textareaRef]
|
|
53257
53270
|
);
|
|
53258
|
-
const onCompositionEnd = (0,
|
|
53271
|
+
const onCompositionEnd = (0, import_react240.useCallback)(() => {
|
|
53259
53272
|
setIsComposing(false);
|
|
53260
53273
|
}, []);
|
|
53261
|
-
const onCompositionStart = (0,
|
|
53274
|
+
const onCompositionStart = (0, import_react240.useCallback)(() => {
|
|
53262
53275
|
setIsComposing(true);
|
|
53263
53276
|
}, []);
|
|
53264
|
-
const keyDownHandler = (0,
|
|
53277
|
+
const keyDownHandler = (0, import_react240.useCallback)(
|
|
53265
53278
|
(event) => {
|
|
53266
53279
|
if (onKeyDown) {
|
|
53267
53280
|
onKeyDown(event);
|
|
53268
53281
|
return;
|
|
53269
53282
|
}
|
|
53270
|
-
if (event.key === "Enter") {
|
|
53271
|
-
event.preventDefault();
|
|
53272
|
-
}
|
|
53273
53283
|
if (textComposer.suggestions && textComposer.suggestions.searchSource.items?.length) {
|
|
53274
53284
|
if (event.key === "Escape") return textComposer.closeSuggestions();
|
|
53275
53285
|
const loadedItems = textComposer.suggestions.searchSource.items;
|
|
53276
53286
|
if (event.key === "Enter") {
|
|
53287
|
+
event.preventDefault();
|
|
53277
53288
|
textComposer.handleSelect(loadedItems[focusedItemIndex]);
|
|
53278
53289
|
}
|
|
53279
53290
|
if (event.key === "ArrowUp") {
|
|
@@ -53315,7 +53326,7 @@ var TextareaComposer = ({
|
|
|
53315
53326
|
textareaRef
|
|
53316
53327
|
]
|
|
53317
53328
|
);
|
|
53318
|
-
const scrollHandler = (0,
|
|
53329
|
+
const scrollHandler = (0, import_react240.useCallback)(
|
|
53319
53330
|
(event) => {
|
|
53320
53331
|
if (onScroll) {
|
|
53321
53332
|
onScroll(event);
|
|
@@ -53325,18 +53336,32 @@ var TextareaComposer = ({
|
|
|
53325
53336
|
},
|
|
53326
53337
|
[onScroll, textComposer]
|
|
53327
53338
|
);
|
|
53328
|
-
(0, import_react239.
|
|
53339
|
+
const setSelectionDebounced = (0, import_react239.useMemo)(
|
|
53340
|
+
() => (0, import_lodash19.default)(
|
|
53341
|
+
(e) => {
|
|
53342
|
+
onSelect?.(e);
|
|
53343
|
+
textComposer.setSelection({
|
|
53344
|
+
end: e.target.selectionEnd,
|
|
53345
|
+
start: e.target.selectionStart
|
|
53346
|
+
});
|
|
53347
|
+
},
|
|
53348
|
+
100,
|
|
53349
|
+
{ leading: false, trailing: true }
|
|
53350
|
+
),
|
|
53351
|
+
[onSelect, textComposer]
|
|
53352
|
+
);
|
|
53353
|
+
(0, import_react240.useEffect)(() => {
|
|
53329
53354
|
if (textareaRef.current && !isComposing) {
|
|
53330
53355
|
textareaRef.current.selectionStart = selection.start;
|
|
53331
53356
|
textareaRef.current.selectionEnd = selection.end;
|
|
53332
53357
|
}
|
|
53333
53358
|
}, [text7, textareaRef, selection.start, selection.end, isComposing]);
|
|
53334
|
-
(0,
|
|
53359
|
+
(0, import_react240.useEffect)(() => {
|
|
53335
53360
|
if (textComposer.suggestions) {
|
|
53336
53361
|
setFocusedItemIndex(0);
|
|
53337
53362
|
}
|
|
53338
53363
|
}, [textComposer.suggestions]);
|
|
53339
|
-
return /* @__PURE__ */
|
|
53364
|
+
return /* @__PURE__ */ import_react240.default.createElement(
|
|
53340
53365
|
"div",
|
|
53341
53366
|
{
|
|
53342
53367
|
className: (0, import_clsx61.default)(
|
|
@@ -53349,10 +53374,10 @@ var TextareaComposer = ({
|
|
|
53349
53374
|
),
|
|
53350
53375
|
ref: containerRef
|
|
53351
53376
|
},
|
|
53352
|
-
/* @__PURE__ */
|
|
53377
|
+
/* @__PURE__ */ import_react240.default.createElement(
|
|
53353
53378
|
import_react_textarea_autosize.default,
|
|
53354
53379
|
{
|
|
53355
|
-
...
|
|
53380
|
+
...{ ...additionalTextareaProps, ...restTextareaProps },
|
|
53356
53381
|
"aria-label": cooldownRemaining ? t("Slow Mode ON") : placeholder,
|
|
53357
53382
|
className: (0, import_clsx61.default)(
|
|
53358
53383
|
"rta__textarea",
|
|
@@ -53361,7 +53386,8 @@ var TextareaComposer = ({
|
|
|
53361
53386
|
),
|
|
53362
53387
|
"data-testid": "message-input",
|
|
53363
53388
|
disabled: !enabled || !!cooldownRemaining,
|
|
53364
|
-
maxRows
|
|
53389
|
+
maxRows,
|
|
53390
|
+
minRows,
|
|
53365
53391
|
onBlur,
|
|
53366
53392
|
onChange: changeHandler,
|
|
53367
53393
|
onCompositionEnd,
|
|
@@ -53369,6 +53395,7 @@ var TextareaComposer = ({
|
|
|
53369
53395
|
onKeyDown: keyDownHandler,
|
|
53370
53396
|
onPaste,
|
|
53371
53397
|
onScroll: scrollHandler,
|
|
53398
|
+
onSelect: setSelectionDebounced,
|
|
53372
53399
|
placeholder: placeholder || t("Type your message"),
|
|
53373
53400
|
ref: (ref) => {
|
|
53374
53401
|
textareaRef.current = ref;
|
|
@@ -53376,7 +53403,7 @@ var TextareaComposer = ({
|
|
|
53376
53403
|
value: text7
|
|
53377
53404
|
}
|
|
53378
53405
|
),
|
|
53379
|
-
!isComposing && /* @__PURE__ */
|
|
53406
|
+
!isComposing && /* @__PURE__ */ import_react240.default.createElement(
|
|
53380
53407
|
AutocompleteSuggestionList,
|
|
53381
53408
|
{
|
|
53382
53409
|
className: listClassName,
|
|
@@ -53389,10 +53416,10 @@ var TextareaComposer = ({
|
|
|
53389
53416
|
};
|
|
53390
53417
|
|
|
53391
53418
|
// src/components/AIStateIndicator/AIStateIndicator.tsx
|
|
53392
|
-
var
|
|
53419
|
+
var import_react242 = __toESM(require("react"));
|
|
53393
53420
|
|
|
53394
53421
|
// src/components/AIStateIndicator/hooks/useAIState.ts
|
|
53395
|
-
var
|
|
53422
|
+
var import_react241 = require("react");
|
|
53396
53423
|
var AIStates = {
|
|
53397
53424
|
Error: "AI_STATE_ERROR",
|
|
53398
53425
|
ExternalSources: "AI_STATE_EXTERNAL_SOURCES",
|
|
@@ -53401,8 +53428,8 @@ var AIStates = {
|
|
|
53401
53428
|
Thinking: "AI_STATE_THINKING"
|
|
53402
53429
|
};
|
|
53403
53430
|
var useAIState = (channel) => {
|
|
53404
|
-
const [aiState, setAiState] = (0,
|
|
53405
|
-
(0,
|
|
53431
|
+
const [aiState, setAiState] = (0, import_react241.useState)(AIStates.Idle);
|
|
53432
|
+
(0, import_react241.useEffect)(() => {
|
|
53406
53433
|
if (!channel) {
|
|
53407
53434
|
return;
|
|
53408
53435
|
}
|
|
@@ -53439,21 +53466,21 @@ var AIStateIndicator = ({
|
|
|
53439
53466
|
[AIStates.Thinking]: t("Thinking..."),
|
|
53440
53467
|
[AIStates.Generating]: t("Generating...")
|
|
53441
53468
|
};
|
|
53442
|
-
return aiState in allowedStates ? /* @__PURE__ */
|
|
53469
|
+
return aiState in allowedStates ? /* @__PURE__ */ import_react242.default.createElement("div", { className: "str-chat__ai-state-indicator-container" }, /* @__PURE__ */ import_react242.default.createElement("p", { className: "str-chat__ai-state-indicator-text" }, allowedStates[aiState])) : null;
|
|
53443
53470
|
};
|
|
53444
53471
|
|
|
53445
53472
|
// src/components/MessageInput/WithDragAndDropUpload.tsx
|
|
53446
|
-
var
|
|
53473
|
+
var import_react243 = __toESM(require("react"));
|
|
53447
53474
|
var import_react_dropzone = require("react-dropzone");
|
|
53448
53475
|
var import_clsx62 = __toESM(require("clsx"));
|
|
53449
|
-
var DragAndDropUploadContext =
|
|
53476
|
+
var DragAndDropUploadContext = import_react243.default.createContext({
|
|
53450
53477
|
subscribeToDrop: null
|
|
53451
53478
|
});
|
|
53452
|
-
var useDragAndDropUploadContext = () => (0,
|
|
53479
|
+
var useDragAndDropUploadContext = () => (0, import_react243.useContext)(DragAndDropUploadContext);
|
|
53453
53480
|
var useRegisterDropHandlers = () => {
|
|
53454
53481
|
const { subscribeToDrop } = useDragAndDropUploadContext();
|
|
53455
53482
|
const messageComposer = useMessageComposer();
|
|
53456
|
-
(0,
|
|
53483
|
+
(0, import_react243.useEffect)(() => {
|
|
53457
53484
|
const unsubscribe = subscribeToDrop?.(messageComposer.attachmentManager.uploadFiles);
|
|
53458
53485
|
return unsubscribe;
|
|
53459
53486
|
}, [subscribeToDrop, messageComposer]);
|
|
@@ -53468,7 +53495,7 @@ var WithDragAndDropUpload = ({
|
|
|
53468
53495
|
component: Component2 = "div",
|
|
53469
53496
|
style
|
|
53470
53497
|
}) => {
|
|
53471
|
-
const dropHandlersRef = (0,
|
|
53498
|
+
const dropHandlersRef = (0, import_react243.useRef)(/* @__PURE__ */ new Set());
|
|
53472
53499
|
const { t } = useTranslationContext();
|
|
53473
53500
|
const messageInputContext = useMessageInputContext();
|
|
53474
53501
|
const dragAndDropUploadContext = useDragAndDropUploadContext();
|
|
@@ -53479,20 +53506,20 @@ var WithDragAndDropUpload = ({
|
|
|
53479
53506
|
attachmentManagerConfigStateSelector
|
|
53480
53507
|
);
|
|
53481
53508
|
const isWithinMessageInputContext = Object.keys(messageInputContext).length > 0;
|
|
53482
|
-
const accept = (0,
|
|
53509
|
+
const accept = (0, import_react243.useMemo)(
|
|
53483
53510
|
() => acceptedFiles.reduce((mediaTypeMap, mediaType) => {
|
|
53484
53511
|
mediaTypeMap[mediaType] ?? (mediaTypeMap[mediaType] = []);
|
|
53485
53512
|
return mediaTypeMap;
|
|
53486
53513
|
}, {}),
|
|
53487
53514
|
[acceptedFiles]
|
|
53488
53515
|
);
|
|
53489
|
-
const subscribeToDrop = (0,
|
|
53516
|
+
const subscribeToDrop = (0, import_react243.useCallback)((fn) => {
|
|
53490
53517
|
dropHandlersRef.current.add(fn);
|
|
53491
53518
|
return () => {
|
|
53492
53519
|
dropHandlersRef.current.delete(fn);
|
|
53493
53520
|
};
|
|
53494
53521
|
}, []);
|
|
53495
|
-
const handleDrop = (0,
|
|
53522
|
+
const handleDrop = (0, import_react243.useCallback)((files) => {
|
|
53496
53523
|
dropHandlersRef.current.forEach((fn) => fn(files));
|
|
53497
53524
|
}, []);
|
|
53498
53525
|
const { getRootProps, isDragActive, isDragReject } = (0, import_react_dropzone.useDropzone)({
|
|
@@ -53505,24 +53532,24 @@ var WithDragAndDropUpload = ({
|
|
|
53505
53532
|
onDrop: isWithinMessageInputContext ? messageComposer.attachmentManager.uploadFiles : handleDrop
|
|
53506
53533
|
});
|
|
53507
53534
|
if (dragAndDropUploadContext.subscribeToDrop !== null) {
|
|
53508
|
-
return /* @__PURE__ */
|
|
53535
|
+
return /* @__PURE__ */ import_react243.default.createElement(Component2, { className }, children);
|
|
53509
53536
|
}
|
|
53510
|
-
return /* @__PURE__ */
|
|
53537
|
+
return /* @__PURE__ */ import_react243.default.createElement(
|
|
53511
53538
|
DragAndDropUploadContext.Provider,
|
|
53512
53539
|
{
|
|
53513
53540
|
value: {
|
|
53514
53541
|
subscribeToDrop
|
|
53515
53542
|
}
|
|
53516
53543
|
},
|
|
53517
|
-
/* @__PURE__ */
|
|
53544
|
+
/* @__PURE__ */ import_react243.default.createElement(Component2, { ...getRootProps({ className, style }) }, isDragActive && /* @__PURE__ */ import_react243.default.createElement(
|
|
53518
53545
|
"div",
|
|
53519
53546
|
{
|
|
53520
53547
|
className: (0, import_clsx62.default)("str-chat__dropzone-container", {
|
|
53521
53548
|
"str-chat__dropzone-container--not-accepted": isDragReject
|
|
53522
53549
|
})
|
|
53523
53550
|
},
|
|
53524
|
-
!isDragReject && /* @__PURE__ */
|
|
53525
|
-
isDragReject && /* @__PURE__ */
|
|
53551
|
+
!isDragReject && /* @__PURE__ */ import_react243.default.createElement("p", null, t("Drag your files here")),
|
|
53552
|
+
isDragReject && /* @__PURE__ */ import_react243.default.createElement("p", null, t("Some of the files will not be accepted"))
|
|
53526
53553
|
), children)
|
|
53527
53554
|
);
|
|
53528
53555
|
};
|
|
@@ -53549,37 +53576,38 @@ var MessageInputFlat = () => {
|
|
|
53549
53576
|
RecordingPermissionDeniedNotification: RecordingPermissionDeniedNotification2 = RecordingPermissionDeniedNotification,
|
|
53550
53577
|
SendButton: SendButton2 = SendButton,
|
|
53551
53578
|
StartRecordingAudioButton: StartRecordingAudioButton2 = StartRecordingAudioButton,
|
|
53552
|
-
StopAIGenerationButton: StopAIGenerationButtonOverride
|
|
53553
|
-
|
|
53579
|
+
StopAIGenerationButton: StopAIGenerationButtonOverride,
|
|
53580
|
+
TextareaComposer: TextareaComposer2 = TextareaComposer
|
|
53581
|
+
} = useComponentContext();
|
|
53554
53582
|
const { channel } = useChatContext("MessageInputFlat");
|
|
53555
53583
|
const { aiState } = useAIState(channel);
|
|
53556
|
-
const stopGenerating = (0,
|
|
53584
|
+
const stopGenerating = (0, import_react244.useCallback)(() => channel?.stopAIResponse(), [channel]);
|
|
53557
53585
|
const [
|
|
53558
53586
|
showRecordingPermissionDeniedNotification,
|
|
53559
53587
|
setShowRecordingPermissionDeniedNotification
|
|
53560
|
-
] = (0,
|
|
53561
|
-
const closePermissionDeniedNotification = (0,
|
|
53588
|
+
] = (0, import_react244.useState)(false);
|
|
53589
|
+
const closePermissionDeniedNotification = (0, import_react244.useCallback)(() => {
|
|
53562
53590
|
setShowRecordingPermissionDeniedNotification(false);
|
|
53563
53591
|
}, []);
|
|
53564
53592
|
const { attachments } = useAttachmentManagerState();
|
|
53565
|
-
if (recordingController.recordingState) return /* @__PURE__ */
|
|
53593
|
+
if (recordingController.recordingState) return /* @__PURE__ */ import_react244.default.createElement(AudioRecorder2, null);
|
|
53566
53594
|
const recordingEnabled = !!(recordingController.recorder && navigator.mediaDevices);
|
|
53567
53595
|
const isRecording = !!recordingController.recordingState;
|
|
53568
53596
|
const StopAIGenerationButton2 = StopAIGenerationButtonOverride === void 0 ? StopAIGenerationButton : StopAIGenerationButtonOverride;
|
|
53569
53597
|
const shouldDisplayStopAIGeneration = [AIStates.Thinking, AIStates.Generating].includes(aiState) && !!StopAIGenerationButton2;
|
|
53570
|
-
return /* @__PURE__ */
|
|
53598
|
+
return /* @__PURE__ */ import_react244.default.createElement(WithDragAndDropUpload, { className: "str-chat__message-input", component: "div" }, recordingEnabled && recordingController.permissionState === "denied" && showRecordingPermissionDeniedNotification && /* @__PURE__ */ import_react244.default.createElement(
|
|
53571
53599
|
RecordingPermissionDeniedNotification2,
|
|
53572
53600
|
{
|
|
53573
53601
|
onClose: closePermissionDeniedNotification,
|
|
53574
53602
|
permissionName: "microphone" /* MIC */
|
|
53575
53603
|
}
|
|
53576
|
-
), /* @__PURE__ */
|
|
53604
|
+
), /* @__PURE__ */ import_react244.default.createElement(LinkPreviewList2, null), /* @__PURE__ */ import_react244.default.createElement(QuotedMessagePreviewHeader, null), /* @__PURE__ */ import_react244.default.createElement("div", { className: "str-chat__message-input-inner" }, /* @__PURE__ */ import_react244.default.createElement(AttachmentSelector2, null), /* @__PURE__ */ import_react244.default.createElement("div", { className: "str-chat__message-textarea-container" }, /* @__PURE__ */ import_react244.default.createElement(QuotedMessagePreview2, null), /* @__PURE__ */ import_react244.default.createElement(AttachmentPreviewList2, null), /* @__PURE__ */ import_react244.default.createElement("div", { className: "str-chat__message-textarea-with-emoji-picker" }, /* @__PURE__ */ import_react244.default.createElement(TextareaComposer2, null), EmojiPicker && /* @__PURE__ */ import_react244.default.createElement(EmojiPicker, null))), shouldDisplayStopAIGeneration ? /* @__PURE__ */ import_react244.default.createElement(StopAIGenerationButton2, { onClick: stopGenerating }) : !hideSendButton && /* @__PURE__ */ import_react244.default.createElement(import_react244.default.Fragment, null, cooldownRemaining ? /* @__PURE__ */ import_react244.default.createElement(
|
|
53577
53605
|
CooldownTimer2,
|
|
53578
53606
|
{
|
|
53579
53607
|
cooldownInterval: cooldownRemaining,
|
|
53580
53608
|
setCooldownRemaining
|
|
53581
53609
|
}
|
|
53582
|
-
) : /* @__PURE__ */
|
|
53610
|
+
) : /* @__PURE__ */ import_react244.default.createElement(import_react244.default.Fragment, null, /* @__PURE__ */ import_react244.default.createElement(SendButton2, { sendMessage: handleSubmit }), recordingEnabled && /* @__PURE__ */ import_react244.default.createElement(
|
|
53583
53611
|
StartRecordingAudioButton2,
|
|
53584
53612
|
{
|
|
53585
53613
|
disabled: isRecording || !asyncMessagesMultiSendEnabled && attachments.some(
|
|
@@ -53594,7 +53622,7 @@ var MessageInputFlat = () => {
|
|
|
53594
53622
|
};
|
|
53595
53623
|
|
|
53596
53624
|
// src/components/MessageInput/hooks/useCreateMessageInputContext.ts
|
|
53597
|
-
var
|
|
53625
|
+
var import_react245 = require("react");
|
|
53598
53626
|
var useCreateMessageInputContext = (value) => {
|
|
53599
53627
|
const {
|
|
53600
53628
|
additionalTextareaProps,
|
|
@@ -53605,10 +53633,8 @@ var useCreateMessageInputContext = (value) => {
|
|
|
53605
53633
|
cooldownRemaining,
|
|
53606
53634
|
emojiSearchIndex,
|
|
53607
53635
|
focus,
|
|
53608
|
-
grow,
|
|
53609
53636
|
handleSubmit,
|
|
53610
53637
|
hideSendButton,
|
|
53611
|
-
insertText,
|
|
53612
53638
|
isThreadInput,
|
|
53613
53639
|
maxRows,
|
|
53614
53640
|
minRows,
|
|
@@ -53620,7 +53646,7 @@ var useCreateMessageInputContext = (value) => {
|
|
|
53620
53646
|
textareaRef
|
|
53621
53647
|
} = value;
|
|
53622
53648
|
const parentId = parent?.id;
|
|
53623
|
-
const messageInputContext = (0,
|
|
53649
|
+
const messageInputContext = (0, import_react245.useMemo)(
|
|
53624
53650
|
() => ({
|
|
53625
53651
|
additionalTextareaProps,
|
|
53626
53652
|
asyncMessagesMultiSendEnabled,
|
|
@@ -53630,10 +53656,8 @@ var useCreateMessageInputContext = (value) => {
|
|
|
53630
53656
|
cooldownRemaining,
|
|
53631
53657
|
emojiSearchIndex,
|
|
53632
53658
|
focus,
|
|
53633
|
-
grow,
|
|
53634
53659
|
handleSubmit,
|
|
53635
53660
|
hideSendButton,
|
|
53636
|
-
insertText,
|
|
53637
53661
|
isThreadInput,
|
|
53638
53662
|
maxRows,
|
|
53639
53663
|
minRows,
|
|
@@ -53674,13 +53698,13 @@ var MessageInputProvider = (props) => {
|
|
|
53674
53698
|
emojiSearchIndex: props.emojiSearchIndex ?? emojiSearchIndex
|
|
53675
53699
|
});
|
|
53676
53700
|
const messageComposer = useMessageComposer();
|
|
53677
|
-
(0,
|
|
53701
|
+
(0, import_react246.useEffect)(
|
|
53678
53702
|
() => () => {
|
|
53679
53703
|
messageComposer.createDraft();
|
|
53680
53704
|
},
|
|
53681
53705
|
[messageComposer]
|
|
53682
53706
|
);
|
|
53683
|
-
(0,
|
|
53707
|
+
(0, import_react246.useEffect)(() => {
|
|
53684
53708
|
const threadId = messageComposer.threadId;
|
|
53685
53709
|
if (!threadId || !messageComposer.channel || !messageComposer.compositionIsEmpty)
|
|
53686
53710
|
return;
|
|
@@ -53691,16 +53715,16 @@ var MessageInputProvider = (props) => {
|
|
|
53691
53715
|
});
|
|
53692
53716
|
}, [messageComposer]);
|
|
53693
53717
|
useRegisterDropHandlers();
|
|
53694
|
-
return /* @__PURE__ */
|
|
53718
|
+
return /* @__PURE__ */ import_react246.default.createElement(MessageInputContextProvider, { value: messageInputContextValue }, props.children);
|
|
53695
53719
|
};
|
|
53696
53720
|
var UnMemoizedMessageInput = (props) => {
|
|
53697
53721
|
const { Input: PropInput } = props;
|
|
53698
53722
|
const { Input: ContextInput } = useComponentContext("MessageInput");
|
|
53699
53723
|
const Input = PropInput || ContextInput || MessageInputFlat;
|
|
53700
53724
|
const dialogManagerId = props.isThreadInput ? "message-input-dialog-manager-thread" : "message-input-dialog-manager";
|
|
53701
|
-
return /* @__PURE__ */
|
|
53725
|
+
return /* @__PURE__ */ import_react246.default.createElement(DialogManagerProvider, { id: dialogManagerId }, /* @__PURE__ */ import_react246.default.createElement(MessageInputProvider, { ...props }, /* @__PURE__ */ import_react246.default.createElement(Input, null)));
|
|
53702
53726
|
};
|
|
53703
|
-
var MessageInput =
|
|
53727
|
+
var MessageInput = import_react246.default.memo(
|
|
53704
53728
|
UnMemoizedMessageInput
|
|
53705
53729
|
);
|
|
53706
53730
|
|
|
@@ -53708,7 +53732,7 @@ var MessageInput = import_react245.default.memo(
|
|
|
53708
53732
|
var EditMessageFormSendButton = () => {
|
|
53709
53733
|
const { t } = useTranslationContext();
|
|
53710
53734
|
const hasSendableData = useMessageComposerHasSendableData();
|
|
53711
|
-
return /* @__PURE__ */
|
|
53735
|
+
return /* @__PURE__ */ import_react247.default.createElement(
|
|
53712
53736
|
"button",
|
|
53713
53737
|
{
|
|
53714
53738
|
className: "str-chat__edit-message-send",
|
|
@@ -53723,26 +53747,26 @@ var EditMessageForm = () => {
|
|
|
53723
53747
|
const { t } = useTranslationContext("EditMessageForm");
|
|
53724
53748
|
const messageComposer = useMessageComposer();
|
|
53725
53749
|
const { clearEditingState, handleSubmit } = useMessageInputContext("EditMessageForm");
|
|
53726
|
-
const cancel = (0,
|
|
53750
|
+
const cancel = (0, import_react247.useCallback)(() => {
|
|
53727
53751
|
clearEditingState?.();
|
|
53728
53752
|
messageComposer.restore();
|
|
53729
53753
|
}, [clearEditingState, messageComposer]);
|
|
53730
|
-
(0,
|
|
53754
|
+
(0, import_react247.useEffect)(() => {
|
|
53731
53755
|
const onKeyDown = (event) => {
|
|
53732
53756
|
if (event.key === "Escape") cancel();
|
|
53733
53757
|
};
|
|
53734
53758
|
document.addEventListener("keydown", onKeyDown);
|
|
53735
53759
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
53736
53760
|
}, [cancel]);
|
|
53737
|
-
return /* @__PURE__ */
|
|
53761
|
+
return /* @__PURE__ */ import_react247.default.createElement(
|
|
53738
53762
|
"form",
|
|
53739
53763
|
{
|
|
53740
53764
|
autoComplete: "off",
|
|
53741
53765
|
className: "str-chat__edit-message-form",
|
|
53742
53766
|
onSubmit: handleSubmit
|
|
53743
53767
|
},
|
|
53744
|
-
/* @__PURE__ */
|
|
53745
|
-
/* @__PURE__ */
|
|
53768
|
+
/* @__PURE__ */ import_react247.default.createElement(MessageInputFlat, null),
|
|
53769
|
+
/* @__PURE__ */ import_react247.default.createElement("div", { className: "str-chat__edit-message-form-options" }, /* @__PURE__ */ import_react247.default.createElement(
|
|
53746
53770
|
"button",
|
|
53747
53771
|
{
|
|
53748
53772
|
className: "str-chat__edit-message-cancel",
|
|
@@ -53750,7 +53774,7 @@ var EditMessageForm = () => {
|
|
|
53750
53774
|
onClick: cancel
|
|
53751
53775
|
},
|
|
53752
53776
|
t("Cancel")
|
|
53753
|
-
), /* @__PURE__ */
|
|
53777
|
+
), /* @__PURE__ */ import_react247.default.createElement(EditMessageFormSendButton, null))
|
|
53754
53778
|
);
|
|
53755
53779
|
};
|
|
53756
53780
|
var EditMessageModal = ({
|
|
@@ -53759,22 +53783,21 @@ var EditMessageModal = ({
|
|
|
53759
53783
|
const { EditMessageInput = EditMessageForm } = useComponentContext();
|
|
53760
53784
|
const { clearEditingState } = useMessageContext();
|
|
53761
53785
|
const messageComposer = useMessageComposer();
|
|
53762
|
-
const onEditModalClose = (0,
|
|
53786
|
+
const onEditModalClose = (0, import_react247.useCallback)(() => {
|
|
53763
53787
|
clearEditingState();
|
|
53764
53788
|
messageComposer.restore();
|
|
53765
53789
|
}, [clearEditingState, messageComposer]);
|
|
53766
|
-
return /* @__PURE__ */
|
|
53790
|
+
return /* @__PURE__ */ import_react247.default.createElement(
|
|
53767
53791
|
Modal,
|
|
53768
53792
|
{
|
|
53769
53793
|
className: "str-chat__edit-message-modal",
|
|
53770
53794
|
onClose: onEditModalClose,
|
|
53771
53795
|
open: true
|
|
53772
53796
|
},
|
|
53773
|
-
/* @__PURE__ */
|
|
53797
|
+
/* @__PURE__ */ import_react247.default.createElement(
|
|
53774
53798
|
MessageInput,
|
|
53775
53799
|
{
|
|
53776
53800
|
clearEditingState,
|
|
53777
|
-
grow: true,
|
|
53778
53801
|
hideSendButton: true,
|
|
53779
53802
|
Input: EditMessageInput,
|
|
53780
53803
|
...additionalMessageInputProps
|
|
@@ -53788,12 +53811,12 @@ var attachmentManagerConfigStateSelector2 = (state) => ({
|
|
|
53788
53811
|
acceptedFiles: state.attachments.acceptedFiles,
|
|
53789
53812
|
maxNumberOfFilesPerMessage: state.attachments.maxNumberOfFilesPerMessage
|
|
53790
53813
|
});
|
|
53791
|
-
var UploadButton = (0,
|
|
53814
|
+
var UploadButton = (0, import_react248.forwardRef)(function UploadButton2({ onFileChange, resetOnChange = true, ...rest }, ref) {
|
|
53792
53815
|
const handleInputChange = useHandleFileChangeWrapper(resetOnChange, onFileChange);
|
|
53793
|
-
return /* @__PURE__ */
|
|
53816
|
+
return /* @__PURE__ */ import_react248.default.createElement("input", { onChange: handleInputChange, ref, type: "file", ...rest });
|
|
53794
53817
|
});
|
|
53795
53818
|
var FileInput = UploadButton;
|
|
53796
|
-
var UploadFileInput = (0,
|
|
53819
|
+
var UploadFileInput = (0, import_react248.forwardRef)(function UploadFileInput2({
|
|
53797
53820
|
className,
|
|
53798
53821
|
onFileChange: onFileChangeCustom,
|
|
53799
53822
|
...props
|
|
@@ -53807,15 +53830,15 @@ var UploadFileInput = (0, import_react247.forwardRef)(function UploadFileInput2(
|
|
|
53807
53830
|
messageComposer.configState,
|
|
53808
53831
|
attachmentManagerConfigStateSelector2
|
|
53809
53832
|
);
|
|
53810
|
-
const id = (0,
|
|
53811
|
-
const onFileChange = (0,
|
|
53833
|
+
const id = (0, import_react248.useMemo)(() => (0, import_nanoid5.nanoid)(), []);
|
|
53834
|
+
const onFileChange = (0, import_react248.useCallback)(
|
|
53812
53835
|
(files) => {
|
|
53813
53836
|
attachmentManager.uploadFiles(files);
|
|
53814
53837
|
onFileChangeCustom?.(files);
|
|
53815
53838
|
},
|
|
53816
53839
|
[onFileChangeCustom, attachmentManager]
|
|
53817
53840
|
);
|
|
53818
|
-
return /* @__PURE__ */
|
|
53841
|
+
return /* @__PURE__ */ import_react248.default.createElement(
|
|
53819
53842
|
FileInput,
|
|
53820
53843
|
{
|
|
53821
53844
|
accept: acceptedFiles?.join(","),
|
|
@@ -53862,7 +53885,7 @@ var VoiceRecordingPlayer = ({
|
|
|
53862
53885
|
});
|
|
53863
53886
|
if (!asset_url) return null;
|
|
53864
53887
|
const displayedDuration = secondsElapsed || duration;
|
|
53865
|
-
return /* @__PURE__ */
|
|
53888
|
+
return /* @__PURE__ */ import_react249.default.createElement("div", { className: rootClassName, "data-testid": "voice-recording-widget" }, /* @__PURE__ */ import_react249.default.createElement("audio", { ref: audioRef }, /* @__PURE__ */ import_react249.default.createElement("source", { "data-testid": "audio-source", src: asset_url, type: mime_type })), /* @__PURE__ */ import_react249.default.createElement(PlayButton, { isPlaying, onClick: togglePlay }), /* @__PURE__ */ import_react249.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__metadata" }, /* @__PURE__ */ import_react249.default.createElement(
|
|
53866
53889
|
"div",
|
|
53867
53890
|
{
|
|
53868
53891
|
className: "str-chat__message-attachment__voice-recording-widget__title",
|
|
@@ -53870,25 +53893,25 @@ var VoiceRecordingPlayer = ({
|
|
|
53870
53893
|
title
|
|
53871
53894
|
},
|
|
53872
53895
|
title
|
|
53873
|
-
), /* @__PURE__ */
|
|
53896
|
+
), /* @__PURE__ */ import_react249.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__audio-state" }, /* @__PURE__ */ import_react249.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__timer" }, attachment.duration ? displayDuration(displayedDuration) : /* @__PURE__ */ import_react249.default.createElement(
|
|
53874
53897
|
FileSizeIndicator,
|
|
53875
53898
|
{
|
|
53876
53899
|
fileSize: attachment.file_size,
|
|
53877
53900
|
maximumFractionDigits: 0
|
|
53878
53901
|
}
|
|
53879
|
-
)), /* @__PURE__ */
|
|
53902
|
+
)), /* @__PURE__ */ import_react249.default.createElement(
|
|
53880
53903
|
WaveProgressBar,
|
|
53881
53904
|
{
|
|
53882
53905
|
progress,
|
|
53883
53906
|
seek,
|
|
53884
53907
|
waveformData: waveform_data || []
|
|
53885
53908
|
}
|
|
53886
|
-
))), /* @__PURE__ */
|
|
53909
|
+
))), /* @__PURE__ */ import_react249.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__right-section" }, isPlaying ? /* @__PURE__ */ import_react249.default.createElement(PlaybackRateButton, { disabled: !audioRef.current, onClick: increasePlaybackRate }, playbackRate.toFixed(1), "x") : /* @__PURE__ */ import_react249.default.createElement(FileIcon, { big: true, mimeType: mime_type, size: 40 })));
|
|
53887
53910
|
};
|
|
53888
53911
|
var QuotedVoiceRecording = ({ attachment }) => {
|
|
53889
53912
|
const { t } = useTranslationContext();
|
|
53890
53913
|
const title = attachment.title || t("Voice message");
|
|
53891
|
-
return /* @__PURE__ */
|
|
53914
|
+
return /* @__PURE__ */ import_react249.default.createElement("div", { className: rootClassName, "data-testid": "quoted-voice-recording-widget" }, /* @__PURE__ */ import_react249.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__metadata" }, title && /* @__PURE__ */ import_react249.default.createElement(
|
|
53892
53915
|
"div",
|
|
53893
53916
|
{
|
|
53894
53917
|
className: "str-chat__message-attachment__voice-recording-widget__title",
|
|
@@ -53896,18 +53919,18 @@ var QuotedVoiceRecording = ({ attachment }) => {
|
|
|
53896
53919
|
title
|
|
53897
53920
|
},
|
|
53898
53921
|
title
|
|
53899
|
-
), /* @__PURE__ */
|
|
53922
|
+
), /* @__PURE__ */ import_react249.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__audio-state" }, /* @__PURE__ */ import_react249.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__timer" }, attachment.duration ? displayDuration(attachment.duration) : /* @__PURE__ */ import_react249.default.createElement(
|
|
53900
53923
|
FileSizeIndicator,
|
|
53901
53924
|
{
|
|
53902
53925
|
fileSize: attachment.file_size,
|
|
53903
53926
|
maximumFractionDigits: 0
|
|
53904
53927
|
}
|
|
53905
|
-
)))), /* @__PURE__ */
|
|
53928
|
+
)))), /* @__PURE__ */ import_react249.default.createElement(FileIcon, { big: true, mimeType: attachment.mime_type, size: 34 }));
|
|
53906
53929
|
};
|
|
53907
|
-
var VoiceRecording = ({ attachment, isQuoted }) => isQuoted ? /* @__PURE__ */
|
|
53930
|
+
var VoiceRecording = ({ attachment, isQuoted }) => isQuoted ? /* @__PURE__ */ import_react249.default.createElement(QuotedVoiceRecording, { attachment }) : /* @__PURE__ */ import_react249.default.createElement(VoiceRecordingPlayer, { attachment });
|
|
53908
53931
|
|
|
53909
53932
|
// src/components/Attachment/Card.tsx
|
|
53910
|
-
var
|
|
53933
|
+
var import_react250 = __toESM(require("react"));
|
|
53911
53934
|
var import_clsx64 = __toESM(require("clsx"));
|
|
53912
53935
|
var import_react_player = __toESM(require("react-player"));
|
|
53913
53936
|
var getHostFromURL = (url) => {
|
|
@@ -53919,26 +53942,26 @@ var getHostFromURL = (url) => {
|
|
|
53919
53942
|
};
|
|
53920
53943
|
var UnableToRenderCard = ({ type }) => {
|
|
53921
53944
|
const { t } = useTranslationContext("Card");
|
|
53922
|
-
return /* @__PURE__ */
|
|
53945
|
+
return /* @__PURE__ */ import_react250.default.createElement(
|
|
53923
53946
|
"div",
|
|
53924
53947
|
{
|
|
53925
53948
|
className: (0, import_clsx64.default)("str-chat__message-attachment-card", {
|
|
53926
53949
|
[`str-chat__message-attachment-card--${type}`]: type
|
|
53927
53950
|
})
|
|
53928
53951
|
},
|
|
53929
|
-
/* @__PURE__ */
|
|
53952
|
+
/* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-card--content" }, /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-card--text" }, t("this content could not be displayed")))
|
|
53930
53953
|
);
|
|
53931
53954
|
};
|
|
53932
53955
|
var SourceLink = ({
|
|
53933
53956
|
author_name,
|
|
53934
53957
|
url
|
|
53935
|
-
}) => /* @__PURE__ */
|
|
53958
|
+
}) => /* @__PURE__ */ import_react250.default.createElement(
|
|
53936
53959
|
"div",
|
|
53937
53960
|
{
|
|
53938
53961
|
className: "str-chat__message-attachment-card--source-link",
|
|
53939
53962
|
"data-testid": "card-source-link"
|
|
53940
53963
|
},
|
|
53941
|
-
/* @__PURE__ */
|
|
53964
|
+
/* @__PURE__ */ import_react250.default.createElement(
|
|
53942
53965
|
SafeAnchor,
|
|
53943
53966
|
{
|
|
53944
53967
|
className: "str-chat__message-attachment-card--url",
|
|
@@ -53953,7 +53976,7 @@ var CardHeader = (props) => {
|
|
|
53953
53976
|
const { asset_url, dimensions, image: image3, image_url, thumb_url, title, type } = props;
|
|
53954
53977
|
let visual = null;
|
|
53955
53978
|
if (asset_url && type === "video") {
|
|
53956
|
-
visual = /* @__PURE__ */
|
|
53979
|
+
visual = /* @__PURE__ */ import_react250.default.createElement(
|
|
53957
53980
|
import_react_player.default,
|
|
53958
53981
|
{
|
|
53959
53982
|
className: "react-player",
|
|
@@ -53964,7 +53987,7 @@ var CardHeader = (props) => {
|
|
|
53964
53987
|
}
|
|
53965
53988
|
);
|
|
53966
53989
|
} else if (image3) {
|
|
53967
|
-
visual = /* @__PURE__ */
|
|
53990
|
+
visual = /* @__PURE__ */ import_react250.default.createElement(
|
|
53968
53991
|
ImageComponent,
|
|
53969
53992
|
{
|
|
53970
53993
|
dimensions,
|
|
@@ -53974,7 +53997,7 @@ var CardHeader = (props) => {
|
|
|
53974
53997
|
}
|
|
53975
53998
|
);
|
|
53976
53999
|
}
|
|
53977
|
-
return visual ? /* @__PURE__ */
|
|
54000
|
+
return visual ? /* @__PURE__ */ import_react250.default.createElement(
|
|
53978
54001
|
"div",
|
|
53979
54002
|
{
|
|
53980
54003
|
className: "str-chat__message-attachment-card--header str-chat__message-attachment-card-react--header",
|
|
@@ -53986,7 +54009,7 @@ var CardHeader = (props) => {
|
|
|
53986
54009
|
var CardContent = (props) => {
|
|
53987
54010
|
const { author_name, og_scrape_url, text: text7, title, title_link, type } = props;
|
|
53988
54011
|
const url = title_link || og_scrape_url;
|
|
53989
|
-
return /* @__PURE__ */
|
|
54012
|
+
return /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-card--content" }, type === "audio" ? /* @__PURE__ */ import_react250.default.createElement(CardAudio, { og: props }) : /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-card--flex" }, url && /* @__PURE__ */ import_react250.default.createElement(SourceLink, { author_name, url }), title && /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-card--title" }, title), text7 && /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-card--text" }, text7)));
|
|
53990
54013
|
};
|
|
53991
54014
|
var CardAudio = ({
|
|
53992
54015
|
og: { asset_url, author_name, mime_type, og_scrape_url, text: text7, title, title_link }
|
|
@@ -53997,7 +54020,7 @@ var CardAudio = ({
|
|
|
53997
54020
|
const url = title_link || og_scrape_url;
|
|
53998
54021
|
const dataTestId = "card-audio-widget";
|
|
53999
54022
|
const rootClassName2 = "str-chat__message-attachment-card-audio-widget";
|
|
54000
|
-
return /* @__PURE__ */
|
|
54023
|
+
return /* @__PURE__ */ import_react250.default.createElement("div", { className: rootClassName2, "data-testid": dataTestId }, asset_url && /* @__PURE__ */ import_react250.default.createElement(import_react250.default.Fragment, null, /* @__PURE__ */ import_react250.default.createElement("audio", { ref: audioRef }, /* @__PURE__ */ import_react250.default.createElement("source", { "data-testid": "audio-source", src: asset_url, type: "audio/mp3" })), /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-card-audio-widget--first-row" }, /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-audio-widget--play-controls" }, /* @__PURE__ */ import_react250.default.createElement(PlayButton, { isPlaying, onClick: togglePlay })), /* @__PURE__ */ import_react250.default.createElement(ProgressBar, { onClick: seek, progress }))), /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-audio-widget--second-row" }, url && /* @__PURE__ */ import_react250.default.createElement(SourceLink, { author_name, url }), title && /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-audio-widget--title" }, title), text7 && /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment-audio-widget--description" }, text7)));
|
|
54001
54024
|
};
|
|
54002
54025
|
var UnMemoizedCard = (props) => {
|
|
54003
54026
|
const { asset_url, giphy, image_url, thumb_url, title, title_link, type } = props;
|
|
@@ -54011,45 +54034,45 @@ var UnMemoizedCard = (props) => {
|
|
|
54011
54034
|
dimensions.width = giphyVersion.width;
|
|
54012
54035
|
}
|
|
54013
54036
|
if (!title && !title_link && !asset_url && !image3) {
|
|
54014
|
-
return /* @__PURE__ */
|
|
54037
|
+
return /* @__PURE__ */ import_react250.default.createElement(UnableToRenderCard, null);
|
|
54015
54038
|
}
|
|
54016
|
-
return /* @__PURE__ */
|
|
54039
|
+
return /* @__PURE__ */ import_react250.default.createElement(
|
|
54017
54040
|
"div",
|
|
54018
54041
|
{
|
|
54019
54042
|
className: `str-chat__message-attachment-card str-chat__message-attachment-card--${type}`
|
|
54020
54043
|
},
|
|
54021
|
-
/* @__PURE__ */
|
|
54022
|
-
/* @__PURE__ */
|
|
54044
|
+
/* @__PURE__ */ import_react250.default.createElement(CardHeader, { ...props, dimensions, image: image3 }),
|
|
54045
|
+
/* @__PURE__ */ import_react250.default.createElement(CardContent, { ...props })
|
|
54023
54046
|
);
|
|
54024
54047
|
};
|
|
54025
|
-
var Card =
|
|
54048
|
+
var Card = import_react250.default.memo(UnMemoizedCard);
|
|
54026
54049
|
|
|
54027
54050
|
// src/components/Attachment/FileAttachment.tsx
|
|
54028
|
-
var
|
|
54029
|
-
var UnMemoizedFileAttachment = ({ attachment }) => /* @__PURE__ */
|
|
54051
|
+
var import_react251 = __toESM(require("react"));
|
|
54052
|
+
var UnMemoizedFileAttachment = ({ attachment }) => /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-file--item", "data-testid": "attachment-file" }, /* @__PURE__ */ import_react251.default.createElement(FileIcon, { className: "str-chat__file-icon", mimeType: attachment.mime_type }), /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-file--item-text" }, /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-file--item-first-row" }, /* @__PURE__ */ import_react251.default.createElement(
|
|
54030
54053
|
"div",
|
|
54031
54054
|
{
|
|
54032
54055
|
className: "str-chat__message-attachment-file--item-name",
|
|
54033
54056
|
"data-testid": "file-title"
|
|
54034
54057
|
},
|
|
54035
54058
|
attachment.title
|
|
54036
|
-
), /* @__PURE__ */
|
|
54037
|
-
var FileAttachment =
|
|
54059
|
+
), /* @__PURE__ */ import_react251.default.createElement(DownloadButton, { assetUrl: attachment.asset_url })), /* @__PURE__ */ import_react251.default.createElement(FileSizeIndicator, { fileSize: attachment.file_size })));
|
|
54060
|
+
var FileAttachment = import_react251.default.memo(
|
|
54038
54061
|
UnMemoizedFileAttachment
|
|
54039
54062
|
);
|
|
54040
54063
|
|
|
54041
54064
|
// src/components/Attachment/UnsupportedAttachment.tsx
|
|
54042
|
-
var
|
|
54065
|
+
var import_react252 = __toESM(require("react"));
|
|
54043
54066
|
var UnsupportedAttachment = ({ attachment }) => {
|
|
54044
54067
|
const { t } = useTranslationContext("UnsupportedAttachment");
|
|
54045
|
-
return /* @__PURE__ */
|
|
54068
|
+
return /* @__PURE__ */ import_react252.default.createElement(
|
|
54046
54069
|
"div",
|
|
54047
54070
|
{
|
|
54048
54071
|
className: "str-chat__message-attachment-unsupported",
|
|
54049
54072
|
"data-testid": "attachment-unsupported"
|
|
54050
54073
|
},
|
|
54051
|
-
/* @__PURE__ */
|
|
54052
|
-
/* @__PURE__ */
|
|
54074
|
+
/* @__PURE__ */ import_react252.default.createElement(FileIcon, { className: "str-chat__file-icon" }),
|
|
54075
|
+
/* @__PURE__ */ import_react252.default.createElement("div", { className: "str-chat__message-attachment-unsupported__metadata" }, /* @__PURE__ */ import_react252.default.createElement(
|
|
54053
54076
|
"div",
|
|
54054
54077
|
{
|
|
54055
54078
|
className: "str-chat__message-attachment-unsupported__title",
|
|
@@ -54081,7 +54104,7 @@ var AttachmentWithinContainer = ({
|
|
|
54081
54104
|
"str-chat__message-attachment-with-actions": extra === "actions"
|
|
54082
54105
|
}
|
|
54083
54106
|
);
|
|
54084
|
-
return /* @__PURE__ */
|
|
54107
|
+
return /* @__PURE__ */ import_react253.default.createElement("div", { className: classNames }, children);
|
|
54085
54108
|
};
|
|
54086
54109
|
var AttachmentActionsContainer = ({
|
|
54087
54110
|
actionHandler,
|
|
@@ -54089,7 +54112,7 @@ var AttachmentActionsContainer = ({
|
|
|
54089
54112
|
AttachmentActions: AttachmentActions2 = AttachmentActions
|
|
54090
54113
|
}) => {
|
|
54091
54114
|
if (!attachment.actions?.length) return null;
|
|
54092
|
-
return /* @__PURE__ */
|
|
54115
|
+
return /* @__PURE__ */ import_react253.default.createElement(
|
|
54093
54116
|
AttachmentActions2,
|
|
54094
54117
|
{
|
|
54095
54118
|
...attachment,
|
|
@@ -54120,10 +54143,10 @@ var GalleryContainer = ({
|
|
|
54120
54143
|
attachment,
|
|
54121
54144
|
Gallery: Gallery2 = Gallery
|
|
54122
54145
|
}) => {
|
|
54123
|
-
const imageElements = (0,
|
|
54146
|
+
const imageElements = (0, import_react253.useRef)([]);
|
|
54124
54147
|
const { imageAttachmentSizeHandler } = useChannelStateContext();
|
|
54125
|
-
const [attachmentConfigurations, setAttachmentConfigurations] = (0,
|
|
54126
|
-
(0,
|
|
54148
|
+
const [attachmentConfigurations, setAttachmentConfigurations] = (0, import_react253.useState)([]);
|
|
54149
|
+
(0, import_react253.useLayoutEffect)(() => {
|
|
54127
54150
|
if (imageElements.current && imageElements.current.every((element3) => !!element3) && imageAttachmentSizeHandler) {
|
|
54128
54151
|
const newConfigurations = [];
|
|
54129
54152
|
imageElements.current.forEach((element3, i) => {
|
|
@@ -54140,15 +54163,15 @@ var GalleryContainer = ({
|
|
|
54140
54163
|
attachment.images[i]?.image_url || attachment.images[i]?.thumb_url || ""
|
|
54141
54164
|
)
|
|
54142
54165
|
}));
|
|
54143
|
-
return /* @__PURE__ */
|
|
54166
|
+
return /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType: "gallery" }, /* @__PURE__ */ import_react253.default.createElement(Gallery2, { images: images || [], innerRefs: imageElements, key: "gallery" }));
|
|
54144
54167
|
};
|
|
54145
54168
|
var ImageContainer = (props) => {
|
|
54146
54169
|
const { attachment, Image: Image2 = ImageComponent } = props;
|
|
54147
54170
|
const componentType = "image";
|
|
54148
|
-
const imageElement = (0,
|
|
54171
|
+
const imageElement = (0, import_react253.useRef)(null);
|
|
54149
54172
|
const { imageAttachmentSizeHandler } = useChannelStateContext();
|
|
54150
|
-
const [attachmentConfiguration, setAttachmentConfiguration] = (0,
|
|
54151
|
-
(0,
|
|
54173
|
+
const [attachmentConfiguration, setAttachmentConfiguration] = (0, import_react253.useState)(void 0);
|
|
54174
|
+
(0, import_react253.useLayoutEffect)(() => {
|
|
54152
54175
|
if (imageElement.current && imageAttachmentSizeHandler) {
|
|
54153
54176
|
const config = imageAttachmentSizeHandler(attachment, imageElement.current);
|
|
54154
54177
|
setAttachmentConfiguration(config);
|
|
@@ -54160,41 +54183,41 @@ var ImageContainer = (props) => {
|
|
|
54160
54183
|
style: getCssDimensionsVariables(attachment.image_url || attachment.thumb_url || "")
|
|
54161
54184
|
};
|
|
54162
54185
|
if (attachment.actions && attachment.actions.length) {
|
|
54163
|
-
return /* @__PURE__ */
|
|
54186
|
+
return /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react253.default.createElement("div", { className: "str-chat__attachment" }, /* @__PURE__ */ import_react253.default.createElement(Image2, { ...imageConfig, innerRef: imageElement }), /* @__PURE__ */ import_react253.default.createElement(AttachmentActionsContainer, { ...props })));
|
|
54164
54187
|
}
|
|
54165
|
-
return /* @__PURE__ */
|
|
54188
|
+
return /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react253.default.createElement(Image2, { ...imageConfig, innerRef: imageElement }));
|
|
54166
54189
|
};
|
|
54167
54190
|
var CardContainer = (props) => {
|
|
54168
54191
|
const { attachment, Card: Card2 = Card } = props;
|
|
54169
54192
|
const componentType = "card";
|
|
54170
54193
|
if (attachment.actions && attachment.actions.length) {
|
|
54171
|
-
return /* @__PURE__ */
|
|
54194
|
+
return /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react253.default.createElement("div", { className: "str-chat__attachment" }, /* @__PURE__ */ import_react253.default.createElement(Card2, { ...attachment }), /* @__PURE__ */ import_react253.default.createElement(AttachmentActionsContainer, { ...props })));
|
|
54172
54195
|
}
|
|
54173
|
-
return /* @__PURE__ */
|
|
54196
|
+
return /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react253.default.createElement(Card2, { ...attachment }));
|
|
54174
54197
|
};
|
|
54175
54198
|
var FileContainer = ({
|
|
54176
54199
|
attachment,
|
|
54177
54200
|
File: File2 = FileAttachment
|
|
54178
54201
|
}) => {
|
|
54179
54202
|
if (!attachment.asset_url) return null;
|
|
54180
|
-
return /* @__PURE__ */
|
|
54203
|
+
return /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType: "file" }, /* @__PURE__ */ import_react253.default.createElement(File2, { attachment }));
|
|
54181
54204
|
};
|
|
54182
54205
|
var AudioContainer = ({
|
|
54183
54206
|
attachment,
|
|
54184
54207
|
Audio: Audio2 = Audio
|
|
54185
|
-
}) => /* @__PURE__ */
|
|
54208
|
+
}) => /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType: "audio" }, /* @__PURE__ */ import_react253.default.createElement("div", { className: "str-chat__attachment" }, /* @__PURE__ */ import_react253.default.createElement(Audio2, { og: attachment })));
|
|
54186
54209
|
var VoiceRecordingContainer = ({
|
|
54187
54210
|
attachment,
|
|
54188
54211
|
isQuoted,
|
|
54189
54212
|
VoiceRecording: VoiceRecording2 = VoiceRecording
|
|
54190
|
-
}) => /* @__PURE__ */
|
|
54213
|
+
}) => /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType: "voiceRecording" }, /* @__PURE__ */ import_react253.default.createElement("div", { className: "str-chat__attachment" }, /* @__PURE__ */ import_react253.default.createElement(VoiceRecording2, { attachment, isQuoted })));
|
|
54191
54214
|
var MediaContainer = (props) => {
|
|
54192
54215
|
const { attachment, Media = import_react_player2.default } = props;
|
|
54193
54216
|
const componentType = "media";
|
|
54194
54217
|
const { shouldGenerateVideoThumbnail, videoAttachmentSizeHandler } = useChannelStateContext();
|
|
54195
|
-
const videoElement = (0,
|
|
54196
|
-
const [attachmentConfiguration, setAttachmentConfiguration] = (0,
|
|
54197
|
-
(0,
|
|
54218
|
+
const videoElement = (0, import_react253.useRef)(null);
|
|
54219
|
+
const [attachmentConfiguration, setAttachmentConfiguration] = (0, import_react253.useState)();
|
|
54220
|
+
(0, import_react253.useLayoutEffect)(() => {
|
|
54198
54221
|
if (videoElement.current && videoAttachmentSizeHandler) {
|
|
54199
54222
|
const config = videoAttachmentSizeHandler(
|
|
54200
54223
|
attachment,
|
|
@@ -54204,7 +54227,7 @@ var MediaContainer = (props) => {
|
|
|
54204
54227
|
setAttachmentConfiguration(config);
|
|
54205
54228
|
}
|
|
54206
54229
|
}, [videoElement, videoAttachmentSizeHandler, attachment]);
|
|
54207
|
-
const content3 = /* @__PURE__ */
|
|
54230
|
+
const content3 = /* @__PURE__ */ import_react253.default.createElement(
|
|
54208
54231
|
"div",
|
|
54209
54232
|
{
|
|
54210
54233
|
className: "str-chat__player-wrapper",
|
|
@@ -54212,7 +54235,7 @@ var MediaContainer = (props) => {
|
|
|
54212
54235
|
ref: videoElement,
|
|
54213
54236
|
style: getCssDimensionsVariables(attachment.thumb_url || "")
|
|
54214
54237
|
},
|
|
54215
|
-
/* @__PURE__ */
|
|
54238
|
+
/* @__PURE__ */ import_react253.default.createElement(
|
|
54216
54239
|
Media,
|
|
54217
54240
|
{
|
|
54218
54241
|
className: "react-player",
|
|
@@ -54224,12 +54247,12 @@ var MediaContainer = (props) => {
|
|
|
54224
54247
|
}
|
|
54225
54248
|
)
|
|
54226
54249
|
);
|
|
54227
|
-
return attachment.actions?.length ? /* @__PURE__ */
|
|
54250
|
+
return attachment.actions?.length ? /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react253.default.createElement("div", { className: "str-chat__attachment" }, content3, /* @__PURE__ */ import_react253.default.createElement(AttachmentActionsContainer, { ...props }))) : /* @__PURE__ */ import_react253.default.createElement(AttachmentWithinContainer, { attachment, componentType }, content3);
|
|
54228
54251
|
};
|
|
54229
54252
|
var UnsupportedAttachmentContainer = ({
|
|
54230
54253
|
attachment,
|
|
54231
54254
|
UnsupportedAttachment: UnsupportedAttachment2 = UnsupportedAttachment
|
|
54232
|
-
}) => /* @__PURE__ */
|
|
54255
|
+
}) => /* @__PURE__ */ import_react253.default.createElement(import_react253.default.Fragment, null, /* @__PURE__ */ import_react253.default.createElement(UnsupportedAttachment2, { attachment }));
|
|
54233
54256
|
|
|
54234
54257
|
// src/components/Attachment/Attachment.tsx
|
|
54235
54258
|
var CONTAINER_MAP = {
|
|
@@ -54252,12 +54275,12 @@ var ATTACHMENT_GROUPS_ORDER = [
|
|
|
54252
54275
|
];
|
|
54253
54276
|
var Attachment = (props) => {
|
|
54254
54277
|
const { attachments } = props;
|
|
54255
|
-
const groupedAttachments = (0,
|
|
54278
|
+
const groupedAttachments = (0, import_react254.useMemo)(
|
|
54256
54279
|
() => renderGroupedAttachments(props),
|
|
54257
54280
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54258
54281
|
[attachments]
|
|
54259
54282
|
);
|
|
54260
|
-
return /* @__PURE__ */
|
|
54283
|
+
return /* @__PURE__ */ import_react254.default.createElement("div", { className: "str-chat__attachment-list" }, ATTACHMENT_GROUPS_ORDER.reduce(
|
|
54261
54284
|
(acc, groupName) => [...acc, ...groupedAttachments[groupName]],
|
|
54262
54285
|
[]
|
|
54263
54286
|
));
|
|
@@ -54267,14 +54290,14 @@ var renderGroupedAttachments = ({
|
|
|
54267
54290
|
...rest
|
|
54268
54291
|
}) => {
|
|
54269
54292
|
const uploadedImages = attachments.filter(
|
|
54270
|
-
(attachment) => (0,
|
|
54293
|
+
(attachment) => (0, import_stream_chat11.isImageAttachment)(attachment)
|
|
54271
54294
|
);
|
|
54272
|
-
const containers = attachments.filter((attachment) => !(0,
|
|
54295
|
+
const containers = attachments.filter((attachment) => !(0, import_stream_chat11.isImageAttachment)(attachment)).reduce(
|
|
54273
54296
|
(typeMap, attachment) => {
|
|
54274
54297
|
const attachmentType = getAttachmentType(attachment);
|
|
54275
54298
|
const Container = CONTAINER_MAP[attachmentType];
|
|
54276
54299
|
typeMap[attachmentType].push(
|
|
54277
|
-
/* @__PURE__ */
|
|
54300
|
+
/* @__PURE__ */ import_react254.default.createElement(
|
|
54278
54301
|
Container,
|
|
54279
54302
|
{
|
|
54280
54303
|
key: `${attachmentType}-${typeMap[attachmentType].length}`,
|
|
@@ -54301,7 +54324,7 @@ var renderGroupedAttachments = ({
|
|
|
54301
54324
|
);
|
|
54302
54325
|
if (uploadedImages.length > 1) {
|
|
54303
54326
|
containers["gallery"] = [
|
|
54304
|
-
/* @__PURE__ */
|
|
54327
|
+
/* @__PURE__ */ import_react254.default.createElement(
|
|
54305
54328
|
GalleryContainer,
|
|
54306
54329
|
{
|
|
54307
54330
|
key: "gallery-container",
|
|
@@ -54315,33 +54338,33 @@ var renderGroupedAttachments = ({
|
|
|
54315
54338
|
];
|
|
54316
54339
|
} else if (uploadedImages.length === 1) {
|
|
54317
54340
|
containers["image"] = [
|
|
54318
|
-
/* @__PURE__ */
|
|
54341
|
+
/* @__PURE__ */ import_react254.default.createElement(ImageContainer, { key: "image-container", ...rest, attachment: uploadedImages[0] })
|
|
54319
54342
|
];
|
|
54320
54343
|
}
|
|
54321
54344
|
return containers;
|
|
54322
54345
|
};
|
|
54323
54346
|
var getAttachmentType = (attachment) => {
|
|
54324
|
-
if ((0,
|
|
54347
|
+
if ((0, import_stream_chat11.isScrapedContent)(attachment)) {
|
|
54325
54348
|
return "card";
|
|
54326
|
-
} else if ((0,
|
|
54349
|
+
} else if ((0, import_stream_chat11.isVideoAttachment)(attachment, SUPPORTED_VIDEO_FORMATS)) {
|
|
54327
54350
|
return "media";
|
|
54328
|
-
} else if ((0,
|
|
54351
|
+
} else if ((0, import_stream_chat11.isAudioAttachment)(attachment)) {
|
|
54329
54352
|
return "audio";
|
|
54330
|
-
} else if ((0,
|
|
54353
|
+
} else if ((0, import_stream_chat11.isVoiceRecordingAttachment)(attachment)) {
|
|
54331
54354
|
return "voiceRecording";
|
|
54332
|
-
} else if ((0,
|
|
54355
|
+
} else if ((0, import_stream_chat11.isFileAttachment)(attachment, SUPPORTED_VIDEO_FORMATS)) {
|
|
54333
54356
|
return "file";
|
|
54334
54357
|
}
|
|
54335
54358
|
return "unsupported";
|
|
54336
54359
|
};
|
|
54337
54360
|
|
|
54338
54361
|
// src/components/Channel/Channel.tsx
|
|
54339
|
-
var
|
|
54362
|
+
var import_react260 = __toESM(require("react"));
|
|
54340
54363
|
var import_clsx66 = __toESM(require("clsx"));
|
|
54341
|
-
var
|
|
54342
|
-
var
|
|
54343
|
-
var
|
|
54344
|
-
var
|
|
54364
|
+
var import_lodash20 = __toESM(require("lodash.debounce"));
|
|
54365
|
+
var import_lodash21 = __toESM(require("lodash.defaultsdeep"));
|
|
54366
|
+
var import_lodash22 = __toESM(require("lodash.throttle"));
|
|
54367
|
+
var import_stream_chat12 = require("stream-chat");
|
|
54345
54368
|
|
|
54346
54369
|
// src/components/Channel/channelState.ts
|
|
54347
54370
|
var makeChannelReducer = () => (state, action) => {
|
|
@@ -54517,7 +54540,7 @@ var initialState = {
|
|
|
54517
54540
|
};
|
|
54518
54541
|
|
|
54519
54542
|
// src/components/Channel/hooks/useCreateChannelStateContext.ts
|
|
54520
|
-
var
|
|
54543
|
+
var import_react255 = require("react");
|
|
54521
54544
|
var useCreateChannelStateContext = (value) => {
|
|
54522
54545
|
const {
|
|
54523
54546
|
channel,
|
|
@@ -54576,7 +54599,7 @@ var useCreateChannelStateContext = (value) => {
|
|
|
54576
54599
|
const memoizedThreadMessageData = threadMessages.map(
|
|
54577
54600
|
({ deleted_at, latest_reactions, pinned, status, updated_at, user }) => `${deleted_at}${latest_reactions ? latest_reactions.map(({ type }) => type).join() : ""}${pinned}${status}${updated_at && (isDayOrMoment(updated_at) || isDate(updated_at)) ? updated_at.toISOString() : updated_at || ""}${user?.updated_at}`
|
|
54578
54601
|
).join();
|
|
54579
|
-
const channelStateContext = (0,
|
|
54602
|
+
const channelStateContext = (0, import_react255.useMemo)(
|
|
54580
54603
|
() => ({
|
|
54581
54604
|
channel,
|
|
54582
54605
|
channelCapabilities,
|
|
@@ -54640,11 +54663,11 @@ var useCreateChannelStateContext = (value) => {
|
|
|
54640
54663
|
};
|
|
54641
54664
|
|
|
54642
54665
|
// src/components/Channel/hooks/useCreateTypingContext.ts
|
|
54643
|
-
var
|
|
54666
|
+
var import_react256 = require("react");
|
|
54644
54667
|
var useCreateTypingContext = (value) => {
|
|
54645
54668
|
const { typing } = value;
|
|
54646
54669
|
const typingValue = Object.keys(typing || {}).join();
|
|
54647
|
-
const typingContext = (0,
|
|
54670
|
+
const typingContext = (0, import_react256.useMemo)(
|
|
54648
54671
|
() => ({
|
|
54649
54672
|
typing
|
|
54650
54673
|
}),
|
|
@@ -54668,10 +54691,10 @@ var useEditMessageHandler = (doUpdateMessageRequest) => {
|
|
|
54668
54691
|
};
|
|
54669
54692
|
|
|
54670
54693
|
// src/components/Channel/hooks/useIsMounted.ts
|
|
54671
|
-
var
|
|
54694
|
+
var import_react257 = require("react");
|
|
54672
54695
|
var useIsMounted = () => {
|
|
54673
|
-
const isMounted = (0,
|
|
54674
|
-
(0,
|
|
54696
|
+
const isMounted = (0, import_react257.useRef)(false);
|
|
54697
|
+
(0, import_react257.useEffect)(() => {
|
|
54675
54698
|
isMounted.current = true;
|
|
54676
54699
|
return () => {
|
|
54677
54700
|
isMounted.current = false;
|
|
@@ -54681,8 +54704,8 @@ var useIsMounted = () => {
|
|
|
54681
54704
|
};
|
|
54682
54705
|
|
|
54683
54706
|
// src/components/Channel/hooks/useMentionsHandlers.ts
|
|
54684
|
-
var
|
|
54685
|
-
var useMentionsHandlers = (onMentionsHover, onMentionsClick) => (0,
|
|
54707
|
+
var import_react258 = require("react");
|
|
54708
|
+
var useMentionsHandlers = (onMentionsHover, onMentionsClick) => (0, import_react258.useCallback)(
|
|
54686
54709
|
(event, mentioned_users) => {
|
|
54687
54710
|
if (!onMentionsHover && !onMentionsClick || !(event.target instanceof HTMLElement)) {
|
|
54688
54711
|
return;
|
|
@@ -54706,11 +54729,11 @@ var useMentionsHandlers = (onMentionsHover, onMentionsClick) => (0, import_react
|
|
|
54706
54729
|
);
|
|
54707
54730
|
|
|
54708
54731
|
// src/components/Channel/LoadingChannel.tsx
|
|
54709
|
-
var
|
|
54710
|
-
var LoadingMessage = () => /* @__PURE__ */
|
|
54711
|
-
var LoadingMessageInput = () => /* @__PURE__ */
|
|
54712
|
-
var LoadingChannelHeader = () => /* @__PURE__ */
|
|
54713
|
-
var LoadingChannel = () => /* @__PURE__ */
|
|
54732
|
+
var import_react259 = __toESM(require("react"));
|
|
54733
|
+
var LoadingMessage = () => /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message" }, /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-avatar" }), /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-end" }, /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-sender" }), /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-last-row" }, /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-text" }), /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-date" }))));
|
|
54734
|
+
var LoadingMessageInput = () => /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-input-row" }, /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-input" }), /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-send" }));
|
|
54735
|
+
var LoadingChannelHeader = () => /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-header" }, /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-header-avatar" }), /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-header-end" }, /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-header-name" }), /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-header-info" })));
|
|
54736
|
+
var LoadingChannel = () => /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel" }, /* @__PURE__ */ import_react259.default.createElement(LoadingChannelHeader, null), /* @__PURE__ */ import_react259.default.createElement("div", { className: "str-chat__loading-channel-message-list" }, Array.from(Array(3)).map((_, i) => /* @__PURE__ */ import_react259.default.createElement(LoadingMessage, { key: `loading-message-${i}` }))), /* @__PURE__ */ import_react259.default.createElement(LoadingMessageInput, null));
|
|
54714
54737
|
|
|
54715
54738
|
// src/components/Channel/hooks/useChannelContainerClasses.ts
|
|
54716
54739
|
var useImageFlagEmojisOnWindowsClass = () => {
|
|
@@ -54897,7 +54920,7 @@ var ChannelContainer = ({
|
|
|
54897
54920
|
customClasses
|
|
54898
54921
|
});
|
|
54899
54922
|
const className = (0, import_clsx66.default)(chatClass, theme, channelClass, additionalClassName);
|
|
54900
|
-
return /* @__PURE__ */
|
|
54923
|
+
return /* @__PURE__ */ import_react260.default.createElement("div", { id: CHANNEL_CONTAINER_ID, ...props, className }, children);
|
|
54901
54924
|
};
|
|
54902
54925
|
var UnMemoizedChannel = (props) => {
|
|
54903
54926
|
const {
|
|
@@ -54909,15 +54932,15 @@ var UnMemoizedChannel = (props) => {
|
|
|
54909
54932
|
const { channel: contextChannel, channelsQueryState } = useChatContext("Channel");
|
|
54910
54933
|
const channel = propsChannel || contextChannel;
|
|
54911
54934
|
if (channelsQueryState.queryInProgress === "reload" && LoadingIndicator2) {
|
|
54912
|
-
return /* @__PURE__ */
|
|
54935
|
+
return /* @__PURE__ */ import_react260.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react260.default.createElement(LoadingIndicator2, null));
|
|
54913
54936
|
}
|
|
54914
54937
|
if (channelsQueryState.error && LoadingErrorIndicator2) {
|
|
54915
|
-
return /* @__PURE__ */
|
|
54938
|
+
return /* @__PURE__ */ import_react260.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react260.default.createElement(LoadingErrorIndicator2, { error: channelsQueryState.error }));
|
|
54916
54939
|
}
|
|
54917
54940
|
if (!channel?.cid) {
|
|
54918
|
-
return /* @__PURE__ */
|
|
54941
|
+
return /* @__PURE__ */ import_react260.default.createElement(ChannelContainer, null, EmptyPlaceholder2);
|
|
54919
54942
|
}
|
|
54920
|
-
return /* @__PURE__ */
|
|
54943
|
+
return /* @__PURE__ */ import_react260.default.createElement(ChannelInner, { ...props, channel, key: channel.cid });
|
|
54921
54944
|
};
|
|
54922
54945
|
var ChannelInner = (props) => {
|
|
54923
54946
|
const {
|
|
@@ -54937,8 +54960,8 @@ var ChannelInner = (props) => {
|
|
|
54937
54960
|
onMentionsHover,
|
|
54938
54961
|
skipMessageDataMemoization
|
|
54939
54962
|
} = props;
|
|
54940
|
-
const channelQueryOptions = (0,
|
|
54941
|
-
() => (0,
|
|
54963
|
+
const channelQueryOptions = (0, import_react260.useMemo)(
|
|
54964
|
+
() => (0, import_lodash21.default)(propChannelQueryOptions, {
|
|
54942
54965
|
messages: { limit: DEFAULT_INITIAL_CHANNEL_PAGE_SIZE }
|
|
54943
54966
|
}),
|
|
54944
54967
|
[propChannelQueryOptions]
|
|
@@ -54948,12 +54971,12 @@ var ChannelInner = (props) => {
|
|
|
54948
54971
|
const chatContainerClass = getChatContainerClass(customClasses?.chatContainer);
|
|
54949
54972
|
const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();
|
|
54950
54973
|
const thread = useThreadContext();
|
|
54951
|
-
const [channelConfig, setChannelConfig] = (0,
|
|
54952
|
-
const [notifications, setNotifications] = (0,
|
|
54953
|
-
const notificationTimeouts = (0,
|
|
54954
|
-
const [channelUnreadUiState, _setChannelUnreadUiState] = (0,
|
|
54955
|
-
const channelReducer = (0,
|
|
54956
|
-
const [state, dispatch] = (0,
|
|
54974
|
+
const [channelConfig, setChannelConfig] = (0, import_react260.useState)(channel.getConfig());
|
|
54975
|
+
const [notifications, setNotifications] = (0, import_react260.useState)([]);
|
|
54976
|
+
const notificationTimeouts = (0, import_react260.useRef)([]);
|
|
54977
|
+
const [channelUnreadUiState, _setChannelUnreadUiState] = (0, import_react260.useState)();
|
|
54978
|
+
const channelReducer = (0, import_react260.useMemo)(() => makeChannelReducer(), []);
|
|
54979
|
+
const [state, dispatch] = (0, import_react260.useReducer)(
|
|
54957
54980
|
channelReducer,
|
|
54958
54981
|
// channel.initialized === false if client.channel().query() was not called, e.g. ChannelList is not used
|
|
54959
54982
|
// => Channel will call channel.watch() in useLayoutEffect => state.loading is used to signal the watch() call state
|
|
@@ -54965,14 +54988,14 @@ var ChannelInner = (props) => {
|
|
|
54965
54988
|
);
|
|
54966
54989
|
const jumpToMessageFromSearch = useSearchFocusedMessage();
|
|
54967
54990
|
const isMounted = useIsMounted();
|
|
54968
|
-
const originalTitle = (0,
|
|
54969
|
-
const lastRead = (0,
|
|
54970
|
-
const online = (0,
|
|
54971
|
-
const clearHighlightedMessageTimeoutId = (0,
|
|
54991
|
+
const originalTitle = (0, import_react260.useRef)("");
|
|
54992
|
+
const lastRead = (0, import_react260.useRef)(void 0);
|
|
54993
|
+
const online = (0, import_react260.useRef)(true);
|
|
54994
|
+
const clearHighlightedMessageTimeoutId = (0, import_react260.useRef)(
|
|
54972
54995
|
null
|
|
54973
54996
|
);
|
|
54974
54997
|
const channelCapabilitiesArray = channel.data?.own_capabilities;
|
|
54975
|
-
const throttledCopyStateFromChannel = (0,
|
|
54998
|
+
const throttledCopyStateFromChannel = (0, import_lodash22.default)(
|
|
54976
54999
|
() => dispatch({ channel, type: "copyStateFromChannelOnEvent" }),
|
|
54977
55000
|
500,
|
|
54978
55001
|
{
|
|
@@ -54980,15 +55003,15 @@ var ChannelInner = (props) => {
|
|
|
54980
55003
|
trailing: true
|
|
54981
55004
|
}
|
|
54982
55005
|
);
|
|
54983
|
-
const setChannelUnreadUiState = (0,
|
|
54984
|
-
() => (0,
|
|
55006
|
+
const setChannelUnreadUiState = (0, import_react260.useMemo)(
|
|
55007
|
+
() => (0, import_lodash22.default)(_setChannelUnreadUiState, 200, {
|
|
54985
55008
|
leading: true,
|
|
54986
55009
|
trailing: false
|
|
54987
55010
|
}),
|
|
54988
55011
|
[]
|
|
54989
55012
|
);
|
|
54990
|
-
const markRead = (0,
|
|
54991
|
-
() => (0,
|
|
55013
|
+
const markRead = (0, import_react260.useMemo)(
|
|
55014
|
+
() => (0, import_lodash22.default)(
|
|
54992
55015
|
async (options) => {
|
|
54993
55016
|
const { updateChannelUiUnreadState = true } = options ?? {};
|
|
54994
55017
|
if (channel.disconnected || !channelConfig?.read_events) {
|
|
@@ -55090,7 +55113,7 @@ var ChannelInner = (props) => {
|
|
|
55090
55113
|
}
|
|
55091
55114
|
throttledCopyStateFromChannel();
|
|
55092
55115
|
};
|
|
55093
|
-
(0,
|
|
55116
|
+
(0, import_react260.useLayoutEffect)(() => {
|
|
55094
55117
|
let errored = false;
|
|
55095
55118
|
let done = false;
|
|
55096
55119
|
(async () => {
|
|
@@ -55156,12 +55179,12 @@ var ChannelInner = (props) => {
|
|
|
55156
55179
|
channelConfig?.read_events,
|
|
55157
55180
|
initializeOnMount
|
|
55158
55181
|
]);
|
|
55159
|
-
(0,
|
|
55182
|
+
(0, import_react260.useEffect)(() => {
|
|
55160
55183
|
if (!state.thread) return;
|
|
55161
55184
|
const message = state.messages?.find((m) => m.id === state.thread?.id);
|
|
55162
55185
|
if (message) dispatch({ message, type: "setThread" });
|
|
55163
55186
|
}, [state.messages, state.thread]);
|
|
55164
|
-
const handleHighlightedMessageChange = (0,
|
|
55187
|
+
const handleHighlightedMessageChange = (0, import_react260.useCallback)(
|
|
55165
55188
|
({
|
|
55166
55189
|
highlightDuration,
|
|
55167
55190
|
highlightedMessageId
|
|
@@ -55184,16 +55207,16 @@ var ChannelInner = (props) => {
|
|
|
55184
55207
|
},
|
|
55185
55208
|
[channel, searchController]
|
|
55186
55209
|
);
|
|
55187
|
-
(0,
|
|
55210
|
+
(0, import_react260.useEffect)(() => {
|
|
55188
55211
|
if (!jumpToMessageFromSearch?.id) return;
|
|
55189
55212
|
handleHighlightedMessageChange({ highlightedMessageId: jumpToMessageFromSearch.id });
|
|
55190
55213
|
}, [jumpToMessageFromSearch, handleHighlightedMessageChange]);
|
|
55191
|
-
const addNotification = (0,
|
|
55214
|
+
const addNotification = (0, import_react260.useMemo)(
|
|
55192
55215
|
() => makeAddNotifications(setNotifications, notificationTimeouts.current),
|
|
55193
55216
|
[]
|
|
55194
55217
|
);
|
|
55195
|
-
const loadMoreFinished = (0,
|
|
55196
|
-
(0,
|
|
55218
|
+
const loadMoreFinished = (0, import_react260.useCallback)(
|
|
55219
|
+
(0, import_lodash20.default)(
|
|
55197
55220
|
(hasMore, messages) => {
|
|
55198
55221
|
if (!isMounted.current) return;
|
|
55199
55222
|
dispatch({ hasMore, messages, type: "loadMoreFinished" });
|
|
@@ -55253,7 +55276,7 @@ var ChannelInner = (props) => {
|
|
|
55253
55276
|
});
|
|
55254
55277
|
return queryResponse.messages.length;
|
|
55255
55278
|
};
|
|
55256
|
-
const jumpToMessage = (0,
|
|
55279
|
+
const jumpToMessage = (0, import_react260.useCallback)(
|
|
55257
55280
|
async (messageId, messageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
|
|
55258
55281
|
dispatch({ loadingMore: true, type: "setLoadingMore" });
|
|
55259
55282
|
await channel.state.loadMessageIntoState(messageId, void 0, messageLimit);
|
|
@@ -55265,14 +55288,14 @@ var ChannelInner = (props) => {
|
|
|
55265
55288
|
},
|
|
55266
55289
|
[channel, handleHighlightedMessageChange, loadMoreFinished]
|
|
55267
55290
|
);
|
|
55268
|
-
const jumpToLatestMessage = (0,
|
|
55291
|
+
const jumpToLatestMessage = (0, import_react260.useCallback)(async () => {
|
|
55269
55292
|
await channel.state.loadMessageIntoState("latest");
|
|
55270
55293
|
loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages);
|
|
55271
55294
|
dispatch({
|
|
55272
55295
|
type: "jumpToLatestMessage"
|
|
55273
55296
|
});
|
|
55274
55297
|
}, [channel, loadMoreFinished]);
|
|
55275
|
-
const jumpToFirstUnreadMessage = (0,
|
|
55298
|
+
const jumpToFirstUnreadMessage = (0, import_react260.useCallback)(
|
|
55276
55299
|
async (queryMessageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
|
|
55277
55300
|
if (!channelUnreadUiState?.unread_messages) return;
|
|
55278
55301
|
let lastReadMessageId = channelUnreadUiState?.last_read_message_id;
|
|
@@ -55395,7 +55418,7 @@ var ChannelInner = (props) => {
|
|
|
55395
55418
|
channelUnreadUiState
|
|
55396
55419
|
]
|
|
55397
55420
|
);
|
|
55398
|
-
const deleteMessage = (0,
|
|
55421
|
+
const deleteMessage = (0, import_react260.useCallback)(
|
|
55399
55422
|
async (message) => {
|
|
55400
55423
|
if (!message?.id) {
|
|
55401
55424
|
throw new Error("Cannot delete a message - missing message ID.");
|
|
@@ -55494,7 +55517,7 @@ var ChannelInner = (props) => {
|
|
|
55494
55517
|
});
|
|
55495
55518
|
await doSendMessage({
|
|
55496
55519
|
localMessage,
|
|
55497
|
-
message: (0,
|
|
55520
|
+
message: (0, import_stream_chat12.localMessageToNewMessagePayload)(localMessage)
|
|
55498
55521
|
});
|
|
55499
55522
|
};
|
|
55500
55523
|
const removeMessage = (message) => {
|
|
@@ -55513,8 +55536,8 @@ var ChannelInner = (props) => {
|
|
|
55513
55536
|
event?.preventDefault();
|
|
55514
55537
|
dispatch({ type: "closeThread" });
|
|
55515
55538
|
};
|
|
55516
|
-
const loadMoreThreadFinished = (0,
|
|
55517
|
-
(0,
|
|
55539
|
+
const loadMoreThreadFinished = (0, import_react260.useCallback)(
|
|
55540
|
+
(0, import_lodash20.default)(
|
|
55518
55541
|
(threadHasMore, threadMessages) => {
|
|
55519
55542
|
dispatch({
|
|
55520
55543
|
threadHasMore,
|
|
@@ -55568,7 +55591,7 @@ var ChannelInner = (props) => {
|
|
|
55568
55591
|
videoAttachmentSizeHandler: props.videoAttachmentSizeHandler || getVideoAttachmentConfiguration,
|
|
55569
55592
|
watcher_count: state.watcherCount
|
|
55570
55593
|
});
|
|
55571
|
-
const channelActionContextValue = (0,
|
|
55594
|
+
const channelActionContextValue = (0, import_react260.useMemo)(
|
|
55572
55595
|
() => ({
|
|
55573
55596
|
addNotification,
|
|
55574
55597
|
closeThread,
|
|
@@ -55605,7 +55628,7 @@ var ChannelInner = (props) => {
|
|
|
55605
55628
|
setChannelUnreadUiState
|
|
55606
55629
|
]
|
|
55607
55630
|
);
|
|
55608
|
-
const componentContextValue = (0,
|
|
55631
|
+
const componentContextValue = (0, import_react260.useMemo)(
|
|
55609
55632
|
() => ({
|
|
55610
55633
|
Attachment: props.Attachment,
|
|
55611
55634
|
AttachmentPreviewList: props.AttachmentPreviewList,
|
|
@@ -55659,6 +55682,7 @@ var ChannelInner = (props) => {
|
|
|
55659
55682
|
StartRecordingAudioButton: props.StartRecordingAudioButton,
|
|
55660
55683
|
StopAIGenerationButton: props.StopAIGenerationButton,
|
|
55661
55684
|
StreamedMessageText: props.StreamedMessageText,
|
|
55685
|
+
TextareaComposer: props.TextareaComposer,
|
|
55662
55686
|
ThreadHead: props.ThreadHead,
|
|
55663
55687
|
ThreadHeader: props.ThreadHeader,
|
|
55664
55688
|
ThreadStart: props.ThreadStart,
|
|
@@ -55721,6 +55745,7 @@ var ChannelInner = (props) => {
|
|
|
55721
55745
|
props.StartRecordingAudioButton,
|
|
55722
55746
|
props.StopAIGenerationButton,
|
|
55723
55747
|
props.StreamedMessageText,
|
|
55748
|
+
props.TextareaComposer,
|
|
55724
55749
|
props.ThreadHead,
|
|
55725
55750
|
props.ThreadHeader,
|
|
55726
55751
|
props.ThreadStart,
|
|
@@ -55735,26 +55760,26 @@ var ChannelInner = (props) => {
|
|
|
55735
55760
|
typing
|
|
55736
55761
|
});
|
|
55737
55762
|
if (state.error) {
|
|
55738
|
-
return /* @__PURE__ */
|
|
55763
|
+
return /* @__PURE__ */ import_react260.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react260.default.createElement(LoadingErrorIndicator2, { error: state.error }));
|
|
55739
55764
|
}
|
|
55740
55765
|
if (state.loading) {
|
|
55741
|
-
return /* @__PURE__ */
|
|
55766
|
+
return /* @__PURE__ */ import_react260.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react260.default.createElement(LoadingIndicator2, null));
|
|
55742
55767
|
}
|
|
55743
55768
|
if (!channel.watch) {
|
|
55744
|
-
return /* @__PURE__ */
|
|
55769
|
+
return /* @__PURE__ */ import_react260.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react260.default.createElement("div", null, t("Channel Missing")));
|
|
55745
55770
|
}
|
|
55746
|
-
return /* @__PURE__ */
|
|
55771
|
+
return /* @__PURE__ */ import_react260.default.createElement(ChannelContainer, { className: windowsEmojiClass }, /* @__PURE__ */ import_react260.default.createElement(ChannelStateProvider, { value: channelStateContextValue }, /* @__PURE__ */ import_react260.default.createElement(ChannelActionProvider, { value: channelActionContextValue }, /* @__PURE__ */ import_react260.default.createElement(WithComponents, { overrides: componentContextValue }, /* @__PURE__ */ import_react260.default.createElement(TypingProvider, { value: typingContextValue }, /* @__PURE__ */ import_react260.default.createElement("div", { className: (0, import_clsx66.default)(chatContainerClass) }, children))))));
|
|
55747
55772
|
};
|
|
55748
|
-
var Channel =
|
|
55773
|
+
var Channel = import_react260.default.memo(UnMemoizedChannel);
|
|
55749
55774
|
|
|
55750
55775
|
// src/components/ChannelHeader/ChannelHeader.tsx
|
|
55751
|
-
var
|
|
55776
|
+
var import_react262 = __toESM(require("react"));
|
|
55752
55777
|
|
|
55753
55778
|
// src/components/ChannelHeader/icons.tsx
|
|
55754
|
-
var
|
|
55779
|
+
var import_react261 = __toESM(require("react"));
|
|
55755
55780
|
var MenuIcon2 = ({ title }) => {
|
|
55756
55781
|
const { t } = useTranslationContext("MenuIcon");
|
|
55757
|
-
return /* @__PURE__ */
|
|
55782
|
+
return /* @__PURE__ */ import_react261.default.createElement("svg", { "data-testid": "menu-icon", viewBox: "0 0 448 512", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react261.default.createElement("title", null, title ?? t("Menu")), /* @__PURE__ */ import_react261.default.createElement(
|
|
55758
55783
|
"path",
|
|
55759
55784
|
{
|
|
55760
55785
|
d: "M0 88C0 74.75 10.75 64 24 64H424C437.3 64 448 74.75 448 88C448 101.3 437.3 112 424 112H24C10.75 112 0 101.3 0 88zM0 248C0 234.7 10.75 224 24 224H424C437.3 224 448 234.7 448 248C448 261.3 437.3 272 424 272H24C10.75 272 0 261.3 0 248zM424 432H24C10.75 432 0 421.3 0 408C0 394.7 10.75 384 24 384H424C437.3 384 448 394.7 448 408C448 421.3 437.3 432 424 432z",
|
|
@@ -55781,15 +55806,15 @@ var ChannelHeader = (props) => {
|
|
|
55781
55806
|
overrideTitle
|
|
55782
55807
|
});
|
|
55783
55808
|
const { member_count, subtitle } = channel?.data || {};
|
|
55784
|
-
return /* @__PURE__ */
|
|
55809
|
+
return /* @__PURE__ */ import_react262.default.createElement("div", { className: "str-chat__channel-header" }, /* @__PURE__ */ import_react262.default.createElement(
|
|
55785
55810
|
"button",
|
|
55786
55811
|
{
|
|
55787
55812
|
"aria-label": t("aria/Menu"),
|
|
55788
55813
|
className: "str-chat__header-hamburger",
|
|
55789
55814
|
onClick: openMobileNav
|
|
55790
55815
|
},
|
|
55791
|
-
/* @__PURE__ */
|
|
55792
|
-
), /* @__PURE__ */
|
|
55816
|
+
/* @__PURE__ */ import_react262.default.createElement(MenuIcon3, null)
|
|
55817
|
+
), /* @__PURE__ */ import_react262.default.createElement(
|
|
55793
55818
|
Avatar2,
|
|
55794
55819
|
{
|
|
55795
55820
|
className: "str-chat__avatar--channel-header",
|
|
@@ -55797,36 +55822,36 @@ var ChannelHeader = (props) => {
|
|
|
55797
55822
|
image: displayImage,
|
|
55798
55823
|
name: displayTitle
|
|
55799
55824
|
}
|
|
55800
|
-
), /* @__PURE__ */
|
|
55825
|
+
), /* @__PURE__ */ import_react262.default.createElement("div", { className: "str-chat__channel-header-end" }, /* @__PURE__ */ import_react262.default.createElement("p", { className: "str-chat__channel-header-title" }, displayTitle, " ", live && /* @__PURE__ */ import_react262.default.createElement("span", { className: "str-chat__header-livestream-livelabel" }, t("live"))), subtitle && /* @__PURE__ */ import_react262.default.createElement("p", { className: "str-chat__channel-header-subtitle" }, subtitle), /* @__PURE__ */ import_react262.default.createElement("p", { className: "str-chat__channel-header-info" }, !live && !!member_count && member_count > 0 && /* @__PURE__ */ import_react262.default.createElement(import_react262.default.Fragment, null, t("{{ memberCount }} members", {
|
|
55801
55826
|
memberCount: member_count
|
|
55802
55827
|
}), ",", " "), t("{{ watcherCount }} online", { watcherCount: watcher_count }))));
|
|
55803
55828
|
};
|
|
55804
55829
|
|
|
55805
55830
|
// src/components/Chat/Chat.tsx
|
|
55806
|
-
var
|
|
55807
|
-
var
|
|
55831
|
+
var import_react266 = __toESM(require("react"));
|
|
55832
|
+
var import_stream_chat13 = require("stream-chat");
|
|
55808
55833
|
|
|
55809
55834
|
// src/components/Chat/hooks/useChat.ts
|
|
55810
|
-
var
|
|
55835
|
+
var import_react263 = require("react");
|
|
55811
55836
|
var useChat = ({
|
|
55812
55837
|
client,
|
|
55813
55838
|
defaultLanguage = "en",
|
|
55814
55839
|
i18nInstance,
|
|
55815
55840
|
initialNavOpen
|
|
55816
55841
|
}) => {
|
|
55817
|
-
const [translators, setTranslators] = (0,
|
|
55842
|
+
const [translators, setTranslators] = (0, import_react263.useState)({
|
|
55818
55843
|
t: (key) => key,
|
|
55819
55844
|
tDateTimeParser: defaultDateTimeParser,
|
|
55820
55845
|
userLanguage: "en"
|
|
55821
55846
|
});
|
|
55822
|
-
const [channel, setChannel] = (0,
|
|
55823
|
-
const [mutes, setMutes] = (0,
|
|
55824
|
-
const [navOpen, setNavOpen] = (0,
|
|
55825
|
-
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = (0,
|
|
55847
|
+
const [channel, setChannel] = (0, import_react263.useState)();
|
|
55848
|
+
const [mutes, setMutes] = (0, import_react263.useState)([]);
|
|
55849
|
+
const [navOpen, setNavOpen] = (0, import_react263.useState)(initialNavOpen);
|
|
55850
|
+
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = (0, import_react263.useState)({});
|
|
55826
55851
|
const clientMutes = client.user?.mutes ?? [];
|
|
55827
55852
|
const closeMobileNav = () => setNavOpen(false);
|
|
55828
55853
|
const openMobileNav = () => setTimeout(() => setNavOpen(true), 100);
|
|
55829
|
-
const appSettings = (0,
|
|
55854
|
+
const appSettings = (0, import_react263.useRef)(null);
|
|
55830
55855
|
const getAppSettings = () => {
|
|
55831
55856
|
if (appSettings.current) {
|
|
55832
55857
|
return appSettings.current;
|
|
@@ -55834,9 +55859,9 @@ var useChat = ({
|
|
|
55834
55859
|
appSettings.current = client.getAppSettings();
|
|
55835
55860
|
return appSettings.current;
|
|
55836
55861
|
};
|
|
55837
|
-
(0,
|
|
55862
|
+
(0, import_react263.useEffect)(() => {
|
|
55838
55863
|
if (!client) return;
|
|
55839
|
-
const version = "13.0.
|
|
55864
|
+
const version = "13.0.1";
|
|
55840
55865
|
const userAgent = client.getUserAgent();
|
|
55841
55866
|
if (!userAgent.includes("stream-chat-react")) {
|
|
55842
55867
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|
|
@@ -55848,7 +55873,7 @@ var useChat = ({
|
|
|
55848
55873
|
client.polls.unregisterSubscriptions();
|
|
55849
55874
|
};
|
|
55850
55875
|
}, [client]);
|
|
55851
|
-
(0,
|
|
55876
|
+
(0, import_react263.useEffect)(() => {
|
|
55852
55877
|
setMutes(clientMutes);
|
|
55853
55878
|
const handleEvent = (event) => {
|
|
55854
55879
|
setMutes(event.me?.mutes || []);
|
|
@@ -55856,7 +55881,7 @@ var useChat = ({
|
|
|
55856
55881
|
client.on("notification.mutes_updated", handleEvent);
|
|
55857
55882
|
return () => client.off("notification.mutes_updated", handleEvent);
|
|
55858
55883
|
}, [clientMutes?.length]);
|
|
55859
|
-
(0,
|
|
55884
|
+
(0, import_react263.useEffect)(() => {
|
|
55860
55885
|
let userLanguage = client.user?.language;
|
|
55861
55886
|
if (!userLanguage) {
|
|
55862
55887
|
const browserLanguage = window.navigator.language.slice(0, 2);
|
|
@@ -55873,7 +55898,7 @@ var useChat = ({
|
|
|
55873
55898
|
});
|
|
55874
55899
|
});
|
|
55875
55900
|
}, [i18nInstance]);
|
|
55876
|
-
const setActiveChannel = (0,
|
|
55901
|
+
const setActiveChannel = (0, import_react263.useCallback)(
|
|
55877
55902
|
async (activeChannel, watchers = {}, event) => {
|
|
55878
55903
|
if (event && event.preventDefault) event.preventDefault();
|
|
55879
55904
|
if (activeChannel && Object.keys(watchers).length) {
|
|
@@ -55884,7 +55909,7 @@ var useChat = ({
|
|
|
55884
55909
|
},
|
|
55885
55910
|
[]
|
|
55886
55911
|
);
|
|
55887
|
-
(0,
|
|
55912
|
+
(0, import_react263.useEffect)(() => {
|
|
55888
55913
|
setLatestMessageDatesByChannels({});
|
|
55889
55914
|
}, [client.user?.id]);
|
|
55890
55915
|
return {
|
|
@@ -55901,7 +55926,7 @@ var useChat = ({
|
|
|
55901
55926
|
};
|
|
55902
55927
|
|
|
55903
55928
|
// src/components/Chat/hooks/useCreateChatContext.ts
|
|
55904
|
-
var
|
|
55929
|
+
var import_react264 = require("react");
|
|
55905
55930
|
var useCreateChatContext = (value) => {
|
|
55906
55931
|
const {
|
|
55907
55932
|
channel,
|
|
@@ -55926,7 +55951,7 @@ var useCreateChatContext = (value) => {
|
|
|
55926
55951
|
const clientValues = `${client.clientID}${Object.keys(client.activeChannels).length}${Object.keys(client.listeners).length}${client.mutedChannels.length}
|
|
55927
55952
|
${client.user?.id}`;
|
|
55928
55953
|
const mutedUsersLength = mutes.length;
|
|
55929
|
-
const chatContext = (0,
|
|
55954
|
+
const chatContext = (0, import_react264.useMemo)(
|
|
55930
55955
|
() => ({
|
|
55931
55956
|
channel,
|
|
55932
55957
|
channelsQueryState,
|
|
@@ -55961,10 +55986,10 @@ var useCreateChatContext = (value) => {
|
|
|
55961
55986
|
};
|
|
55962
55987
|
|
|
55963
55988
|
// src/components/Chat/hooks/useChannelsQueryState.ts
|
|
55964
|
-
var
|
|
55989
|
+
var import_react265 = require("react");
|
|
55965
55990
|
var useChannelsQueryState = () => {
|
|
55966
|
-
const [error, setError] = (0,
|
|
55967
|
-
const [queryInProgress, setQueryInProgress] = (0,
|
|
55991
|
+
const [error, setError] = (0, import_react265.useState)(null);
|
|
55992
|
+
const [queryInProgress, setQueryInProgress] = (0, import_react265.useState)("uninitialized");
|
|
55968
55993
|
return {
|
|
55969
55994
|
error,
|
|
55970
55995
|
queryInProgress,
|
|
@@ -55999,12 +56024,12 @@ var Chat = (props) => {
|
|
|
55999
56024
|
translators
|
|
56000
56025
|
} = useChat({ client, defaultLanguage, i18nInstance, initialNavOpen });
|
|
56001
56026
|
const channelsQueryState = useChannelsQueryState();
|
|
56002
|
-
const searchController = (0,
|
|
56003
|
-
() => customChannelSearchController ?? new
|
|
56027
|
+
const searchController = (0, import_react266.useMemo)(
|
|
56028
|
+
() => customChannelSearchController ?? new import_stream_chat13.SearchController({
|
|
56004
56029
|
sources: [
|
|
56005
|
-
new
|
|
56006
|
-
new
|
|
56007
|
-
new
|
|
56030
|
+
new import_stream_chat13.ChannelSearchSource(client),
|
|
56031
|
+
new import_stream_chat13.UserSearchSource(client),
|
|
56032
|
+
new import_stream_chat13.MessageSearchSource(client)
|
|
56008
56033
|
]
|
|
56009
56034
|
}),
|
|
56010
56035
|
[client, customChannelSearchController]
|
|
@@ -56027,26 +56052,26 @@ var Chat = (props) => {
|
|
|
56027
56052
|
useImageFlagEmojisOnWindows
|
|
56028
56053
|
});
|
|
56029
56054
|
if (!translators.t) return null;
|
|
56030
|
-
return /* @__PURE__ */
|
|
56055
|
+
return /* @__PURE__ */ import_react266.default.createElement(ChatProvider, { value: chatContextValue }, /* @__PURE__ */ import_react266.default.createElement(TranslationProvider, { value: translators }, children));
|
|
56031
56056
|
};
|
|
56032
56057
|
|
|
56033
56058
|
// src/components/Chat/hooks/useCreateChatClient.ts
|
|
56034
|
-
var
|
|
56035
|
-
var
|
|
56059
|
+
var import_react267 = require("react");
|
|
56060
|
+
var import_stream_chat14 = require("stream-chat");
|
|
56036
56061
|
var useCreateChatClient = ({
|
|
56037
56062
|
apiKey,
|
|
56038
56063
|
options,
|
|
56039
56064
|
tokenOrProvider,
|
|
56040
56065
|
userData
|
|
56041
56066
|
}) => {
|
|
56042
|
-
const [chatClient, setChatClient] = (0,
|
|
56043
|
-
const [cachedUserData, setCachedUserData] = (0,
|
|
56067
|
+
const [chatClient, setChatClient] = (0, import_react267.useState)(null);
|
|
56068
|
+
const [cachedUserData, setCachedUserData] = (0, import_react267.useState)(userData);
|
|
56044
56069
|
if (userData.id !== cachedUserData.id) {
|
|
56045
56070
|
setCachedUserData(userData);
|
|
56046
56071
|
}
|
|
56047
|
-
const [cachedOptions] = (0,
|
|
56048
|
-
(0,
|
|
56049
|
-
const client = new
|
|
56072
|
+
const [cachedOptions] = (0, import_react267.useState)(options);
|
|
56073
|
+
(0, import_react267.useEffect)(() => {
|
|
56074
|
+
const client = new import_stream_chat14.StreamChat(apiKey, void 0, cachedOptions);
|
|
56050
56075
|
let didUserConnectInterrupt = false;
|
|
56051
56076
|
const connectionPromise = client.connectUser(cachedUserData, tokenOrProvider).then(() => {
|
|
56052
56077
|
if (!didUserConnectInterrupt) setChatClient(client);
|
|
@@ -56063,12 +56088,12 @@ var useCreateChatClient = ({
|
|
|
56063
56088
|
};
|
|
56064
56089
|
|
|
56065
56090
|
// src/components/Window/Window.tsx
|
|
56066
|
-
var
|
|
56091
|
+
var import_react268 = __toESM(require("react"));
|
|
56067
56092
|
var import_clsx67 = __toESM(require("clsx"));
|
|
56068
56093
|
var UnMemoizedWindow = (props) => {
|
|
56069
56094
|
const { children, thread: propThread } = props;
|
|
56070
56095
|
const { thread: contextThread } = useChannelStateContext("Window");
|
|
56071
|
-
return /* @__PURE__ */
|
|
56096
|
+
return /* @__PURE__ */ import_react268.default.createElement(
|
|
56072
56097
|
"div",
|
|
56073
56098
|
{
|
|
56074
56099
|
className: (0, import_clsx67.default)("str-chat__main-panel", {
|
|
@@ -56078,7 +56103,7 @@ var UnMemoizedWindow = (props) => {
|
|
|
56078
56103
|
children
|
|
56079
56104
|
);
|
|
56080
56105
|
};
|
|
56081
|
-
var Window =
|
|
56106
|
+
var Window = import_react268.default.memo(UnMemoizedWindow);
|
|
56082
56107
|
// Annotate the CommonJS export names for ESM import in node:
|
|
56083
56108
|
0 && (module.exports = {
|
|
56084
56109
|
ACTIONS_NOT_WORKING_IN_THREAD,
|