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.browser.cjs
CHANGED
|
@@ -17666,11 +17666,11 @@ __export(src_exports, {
|
|
|
17666
17666
|
module.exports = __toCommonJS(src_exports);
|
|
17667
17667
|
|
|
17668
17668
|
// src/components/Attachment/Attachment.tsx
|
|
17669
|
-
var
|
|
17670
|
-
var
|
|
17669
|
+
var import_react255 = __toESM(require("react"));
|
|
17670
|
+
var import_stream_chat11 = require("stream-chat");
|
|
17671
17671
|
|
|
17672
17672
|
// src/components/Attachment/AttachmentContainer.tsx
|
|
17673
|
-
var
|
|
17673
|
+
var import_react254 = __toESM(require("react"));
|
|
17674
17674
|
var import_react_player2 = __toESM(require("react-player"));
|
|
17675
17675
|
var import_clsx65 = __toESM(require("clsx"));
|
|
17676
17676
|
var linkify = __toESM(require("linkifyjs"));
|
|
@@ -18915,7 +18915,7 @@ var UnMemoizedAudio = (props) => {
|
|
|
18915
18915
|
var Audio = import_react29.default.memo(UnMemoizedAudio);
|
|
18916
18916
|
|
|
18917
18917
|
// src/components/Attachment/VoiceRecording.tsx
|
|
18918
|
-
var
|
|
18918
|
+
var import_react250 = __toESM(require("react"));
|
|
18919
18919
|
|
|
18920
18920
|
// src/components/ReactFileUtilities/FileIcon/FileIcon.tsx
|
|
18921
18921
|
var import_react31 = __toESM(require("react"));
|
|
@@ -19878,7 +19878,7 @@ var FileIcon = (props) => {
|
|
|
19878
19878
|
// src/components/ReactFileUtilities/UploadButton.tsx
|
|
19879
19879
|
var import_clsx63 = __toESM(require("clsx"));
|
|
19880
19880
|
var import_nanoid5 = require("nanoid");
|
|
19881
|
-
var
|
|
19881
|
+
var import_react249 = __toESM(require("react"));
|
|
19882
19882
|
|
|
19883
19883
|
// src/components/ReactFileUtilities/utils.ts
|
|
19884
19884
|
var import_react32 = require("react");
|
|
@@ -39495,7 +39495,7 @@ var PollOptionWithLatestVotes = ({
|
|
|
39495
39495
|
// src/components/Poll/PollActions/PollResults/PollResults.tsx
|
|
39496
39496
|
var pollStateSelector10 = (nextValue) => ({
|
|
39497
39497
|
name: nextValue.name,
|
|
39498
|
-
options: nextValue.options,
|
|
39498
|
+
options: [...nextValue.options],
|
|
39499
39499
|
vote_counts_by_option: nextValue.vote_counts_by_option
|
|
39500
39500
|
});
|
|
39501
39501
|
var PollResults = ({ close }) => {
|
|
@@ -39764,9 +39764,15 @@ var MultipleAnswersField = () => {
|
|
|
39764
39764
|
pollComposer.handleFieldBlur("max_votes_allowed");
|
|
39765
39765
|
},
|
|
39766
39766
|
onChange: (e) => {
|
|
39767
|
-
|
|
39768
|
-
max_votes_allowed:
|
|
39769
|
-
}
|
|
39767
|
+
const nativeFieldValidation = !e.target.validity.valid ? {
|
|
39768
|
+
max_votes_allowed: t("Only numbers are allowed")
|
|
39769
|
+
} : void 0;
|
|
39770
|
+
pollComposer.updateFields(
|
|
39771
|
+
{
|
|
39772
|
+
max_votes_allowed: !nativeFieldValidation ? e.target.value : pollComposer.max_votes_allowed
|
|
39773
|
+
},
|
|
39774
|
+
nativeFieldValidation
|
|
39775
|
+
);
|
|
39770
39776
|
},
|
|
39771
39777
|
placeholder: t("Maximum number of votes (from 2 to 10)"),
|
|
39772
39778
|
type: "number",
|
|
@@ -40833,6 +40839,7 @@ var de_default = {
|
|
|
40833
40839
|
"Nobody will be able to vote in this poll anymore.": "Niemand kann mehr in dieser Umfrage abstimmen.",
|
|
40834
40840
|
"Nothing yet...": "Noch nichts...",
|
|
40835
40841
|
Ok: "Ok",
|
|
40842
|
+
"Only numbers are allowed": "Nur Zahlen sind erlaubt",
|
|
40836
40843
|
"Open emoji picker": "Emoji-Auswahl \xF6ffnen",
|
|
40837
40844
|
"Option already exists": "Option existiert bereits",
|
|
40838
40845
|
Options: "Optionen",
|
|
@@ -41045,6 +41052,7 @@ var en_default = {
|
|
|
41045
41052
|
"Nobody will be able to vote in this poll anymore.": "Nobody will be able to vote in this poll anymore.",
|
|
41046
41053
|
"Nothing yet...": "Nothing yet...",
|
|
41047
41054
|
Ok: "Ok",
|
|
41055
|
+
"Only numbers are allowed": "Only numbers are allowed",
|
|
41048
41056
|
"Open emoji picker": "Open emoji picker",
|
|
41049
41057
|
"Option already exists": "Option already exists",
|
|
41050
41058
|
Options: "Options",
|
|
@@ -41247,6 +41255,7 @@ var es_default = {
|
|
|
41247
41255
|
"Nobody will be able to vote in this poll anymore.": "Nadie podr\xE1 votar en esta encuesta.",
|
|
41248
41256
|
"Nothing yet...": "Nada a\xFAn...",
|
|
41249
41257
|
Ok: "Ok",
|
|
41258
|
+
"Only numbers are allowed": "Solo se permiten n\xFAmeros",
|
|
41250
41259
|
"Open emoji picker": "Abrir el selector de emojis",
|
|
41251
41260
|
"Option already exists": "La opci\xF3n ya existe",
|
|
41252
41261
|
Options: "Opciones",
|
|
@@ -41467,6 +41476,7 @@ var fr_default = {
|
|
|
41467
41476
|
"Nobody will be able to vote in this poll anymore.": "Personne ne pourra plus voter dans ce sondage.",
|
|
41468
41477
|
"Nothing yet...": "Rien pour l'instant...",
|
|
41469
41478
|
Ok: "D'accord",
|
|
41479
|
+
"Only numbers are allowed": "Seuls les chiffres sont autoris\xE9s",
|
|
41470
41480
|
"Open emoji picker": "Ouvrir le s\xE9lecteur d'\xE9mojis",
|
|
41471
41481
|
"Option already exists": "L'option existe d\xE9j\xE0",
|
|
41472
41482
|
Options: "Options",
|
|
@@ -41688,6 +41698,7 @@ var hi_default = {
|
|
|
41688
41698
|
"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",
|
|
41689
41699
|
"Nothing yet...": "\u0915\u094B\u0908 \u092E\u0948\u0938\u0947\u091C \u0928\u0939\u0940\u0902 \u0939\u0948",
|
|
41690
41700
|
Ok: "\u0920\u0940\u0915 \u0939\u0948",
|
|
41701
|
+
"Only numbers are allowed": "\u0915\u0947\u0935\u0932 \u0938\u0902\u0916\u094D\u092F\u093E\u090F\u0901 \u0905\u0928\u0941\u092E\u0924 \u0939\u0948\u0902",
|
|
41691
41702
|
"Open emoji picker": "\u0907\u092E\u094B\u091C\u0940 \u092A\u093F\u0915\u0930 \u0916\u094B\u0932\u093F\u092F\u0947",
|
|
41692
41703
|
"Option already exists": "\u0935\u093F\u0915\u0932\u094D\u092A \u092A\u0939\u0932\u0947 \u0938\u0947 \u092E\u094C\u091C\u0942\u0926 \u0939\u0948",
|
|
41693
41704
|
Options: "\u0935\u093F\u0915\u0932\u094D\u092A",
|
|
@@ -41900,6 +41911,7 @@ var it_default = {
|
|
|
41900
41911
|
"Nobody will be able to vote in this poll anymore.": "Nessuno potr\xE0 pi\xF9 votare in questo sondaggio.",
|
|
41901
41912
|
"Nothing yet...": "Ancora niente...",
|
|
41902
41913
|
Ok: "Ok",
|
|
41914
|
+
"Only numbers are allowed": "Sono consentiti solo numeri",
|
|
41903
41915
|
"Open emoji picker": "Apri il selettore di emoji",
|
|
41904
41916
|
"Option already exists": "L'opzione esiste gi\xE0",
|
|
41905
41917
|
Options: "Opzioni",
|
|
@@ -42120,6 +42132,7 @@ var ja_default = {
|
|
|
42120
42132
|
"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",
|
|
42121
42133
|
"Nothing yet...": "\u307E\u3060\u4F55\u3082\u3042\u308A\u307E\u305B\u3093...",
|
|
42122
42134
|
Ok: "OK",
|
|
42135
|
+
"Only numbers are allowed": "\u6570\u5B57\u306E\u307F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u3059",
|
|
42123
42136
|
"Open emoji picker": "\u7D75\u6587\u5B57\u30D4\u30C3\u30AB\u30FC\u3092\u958B\u304F",
|
|
42124
42137
|
"Option already exists": "\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059",
|
|
42125
42138
|
Options: "\u30AA\u30D7\u30B7\u30E7\u30F3",
|
|
@@ -42326,7 +42339,8 @@ var ko_default = {
|
|
|
42326
42339
|
"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.",
|
|
42327
42340
|
"Nothing yet...": "\uC544\uC9C1 \uC544\uBB34\uAC83\uB3C4...",
|
|
42328
42341
|
Ok: "\uD655\uC778",
|
|
42329
|
-
"
|
|
42342
|
+
"Only numbers are allowed": "\uC22B\uC790\uB9CC \uC785\uB825 \uAC00\uB2A5\uD569\uB2C8\uB2E4",
|
|
42343
|
+
"Open emoji picker": "\uC774\uBAA8\uC9C0 \uC120\uD0DD\uAE30 \uC5F4\uAE30",
|
|
42330
42344
|
"Option already exists": "\uC635\uC158\uC774 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4",
|
|
42331
42345
|
Options: "\uC635\uC158",
|
|
42332
42346
|
"People matching": "\uC77C\uCE58\uD558\uB294 \uC0AC\uB78C",
|
|
@@ -42532,7 +42546,8 @@ var nl_default = {
|
|
|
42532
42546
|
"Nobody will be able to vote in this poll anymore.": "Niemand kan meer stemmen in deze peiling.",
|
|
42533
42547
|
"Nothing yet...": "Nog niets ...",
|
|
42534
42548
|
Ok: "Ok\xE9",
|
|
42535
|
-
"
|
|
42549
|
+
"Only numbers are allowed": "Alleen nummers zijn toegestaan",
|
|
42550
|
+
"Open emoji picker": "Emoji-kiezer openen",
|
|
42536
42551
|
"Option already exists": "Optie bestaat al",
|
|
42537
42552
|
Options: "Opties",
|
|
42538
42553
|
"People matching": "Mensen die matchen",
|
|
@@ -42744,6 +42759,7 @@ var pt_default = {
|
|
|
42744
42759
|
"Nobody will be able to vote in this poll anymore.": "Ningu\xE9m mais poder\xE1 votar nesta pesquisa.",
|
|
42745
42760
|
"Nothing yet...": "Nada ainda...",
|
|
42746
42761
|
Ok: "Ok",
|
|
42762
|
+
"Only numbers are allowed": "Apenas n\xFAmeros s\xE3o permitidos",
|
|
42747
42763
|
"Open emoji picker": "Abrir seletor de emoji",
|
|
42748
42764
|
"Option already exists": "Op\xE7\xE3o j\xE1 existe",
|
|
42749
42765
|
Options: "Op\xE7\xF5es",
|
|
@@ -42964,6 +42980,7 @@ var ru_default = {
|
|
|
42964
42980
|
"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.",
|
|
42965
42981
|
"Nothing yet...": "\u041F\u043E\u043A\u0430 \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435\u0442...",
|
|
42966
42982
|
Ok: "\u041E\u043A",
|
|
42983
|
+
"Only numbers are allowed": "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u0446\u0438\u0444\u0440\u044B",
|
|
42967
42984
|
"Open emoji picker": "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432\u044B\u0431\u043E\u0440 \u0441\u043C\u0430\u0439\u043B\u043E\u0432",
|
|
42968
42985
|
"Option already exists": "\u0412\u0430\u0440\u0438\u0430\u043D\u0442 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442",
|
|
42969
42986
|
Options: "\u0412\u0430\u0440\u0438\u0430\u043D\u0442\u044B",
|
|
@@ -43192,6 +43209,7 @@ var tr_default = {
|
|
|
43192
43209
|
"Nobody will be able to vote in this poll anymore.": "Art\u0131k bu ankette kimse oy kullanamayacak.",
|
|
43193
43210
|
"Nothing yet...": "\u015Eimdilik hi\xE7bir \u015Fey...",
|
|
43194
43211
|
Ok: "Tamam",
|
|
43212
|
+
"Only numbers are allowed": "Sadece say\u0131lar kullan\u0131labilir",
|
|
43195
43213
|
"Open emoji picker": "Emoji klavyesini a\xE7",
|
|
43196
43214
|
"Option already exists": "Se\xE7enek zaten mevcut",
|
|
43197
43215
|
Options: "Se\xE7enekler",
|
|
@@ -46654,7 +46672,7 @@ var AttachmentSelector = ({
|
|
|
46654
46672
|
|
|
46655
46673
|
// src/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.tsx
|
|
46656
46674
|
var import_react228 = __toESM(require("react"));
|
|
46657
|
-
var
|
|
46675
|
+
var import_stream_chat9 = require("stream-chat");
|
|
46658
46676
|
|
|
46659
46677
|
// src/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx
|
|
46660
46678
|
var import_react211 = __toESM(require("react"));
|
|
@@ -47796,55 +47814,40 @@ var useCooldownTimer = () => {
|
|
|
47796
47814
|
};
|
|
47797
47815
|
};
|
|
47798
47816
|
|
|
47799
|
-
// src/components/MessageInput/hooks/
|
|
47817
|
+
// src/components/MessageInput/hooks/useTextareaRef.ts
|
|
47800
47818
|
var import_react224 = require("react");
|
|
47801
|
-
var
|
|
47802
|
-
text: state.text
|
|
47803
|
-
});
|
|
47804
|
-
var useMessageInputText = (props) => {
|
|
47819
|
+
var useTextareaRef = (props) => {
|
|
47805
47820
|
const { focus } = props;
|
|
47806
|
-
const messageComposer = useMessageComposer();
|
|
47807
47821
|
const textareaRef = (0, import_react224.useRef)(void 0);
|
|
47808
|
-
const { text: text8 } = useStateStore(
|
|
47809
|
-
messageComposer.textComposer.state,
|
|
47810
|
-
messageComposerStateSelector
|
|
47811
|
-
);
|
|
47812
47822
|
(0, import_react224.useEffect)(() => {
|
|
47813
47823
|
if (focus && textareaRef.current) {
|
|
47814
47824
|
textareaRef.current.focus();
|
|
47815
47825
|
}
|
|
47816
47826
|
}, [focus]);
|
|
47817
|
-
const newCursorPosition = (0, import_react224.useRef)(void 0);
|
|
47818
|
-
const insertText = (0, import_react224.useCallback)(
|
|
47819
|
-
(textToInsert) => {
|
|
47820
|
-
const selection = textareaRef?.current && {
|
|
47821
|
-
end: textareaRef.current.selectionEnd,
|
|
47822
|
-
start: textareaRef.current.selectionStart
|
|
47823
|
-
};
|
|
47824
|
-
messageComposer.textComposer.insertText({
|
|
47825
|
-
selection,
|
|
47826
|
-
text: textToInsert
|
|
47827
|
-
});
|
|
47828
|
-
if (selection) newCursorPosition.current = selection.start + textToInsert.length;
|
|
47829
|
-
},
|
|
47830
|
-
[messageComposer, newCursorPosition, textareaRef]
|
|
47831
|
-
);
|
|
47832
|
-
(0, import_react224.useEffect)(() => {
|
|
47833
|
-
const textareaElement = textareaRef.current;
|
|
47834
|
-
if (textareaElement && newCursorPosition.current !== void 0) {
|
|
47835
|
-
textareaElement.selectionStart = newCursorPosition.current;
|
|
47836
|
-
textareaElement.selectionEnd = newCursorPosition.current;
|
|
47837
|
-
newCursorPosition.current = void 0;
|
|
47838
|
-
}
|
|
47839
|
-
}, [text8, newCursorPosition]);
|
|
47840
47827
|
return {
|
|
47841
|
-
insertText,
|
|
47842
47828
|
textareaRef
|
|
47843
47829
|
};
|
|
47844
47830
|
};
|
|
47845
47831
|
|
|
47846
47832
|
// src/components/MessageInput/hooks/useSubmitHandler.ts
|
|
47847
47833
|
var import_react225 = require("react");
|
|
47834
|
+
var import_stream_chat8 = require("stream-chat");
|
|
47835
|
+
var takeStateSnapshot = (messageComposer) => {
|
|
47836
|
+
const textComposerState = messageComposer.textComposer.state.getLatestValue();
|
|
47837
|
+
const attachmentManagerState = messageComposer.attachmentManager.state.getLatestValue();
|
|
47838
|
+
const linkPreviewsManagerState = messageComposer.linkPreviewsManager.state.getLatestValue();
|
|
47839
|
+
const pollComposerState = messageComposer.pollComposer.state.getLatestValue();
|
|
47840
|
+
const customDataManagerState = messageComposer.customDataManager.state.getLatestValue();
|
|
47841
|
+
const state = messageComposer.state.getLatestValue();
|
|
47842
|
+
return () => {
|
|
47843
|
+
messageComposer.state.next(state);
|
|
47844
|
+
messageComposer.textComposer.state.next(textComposerState);
|
|
47845
|
+
messageComposer.attachmentManager.state.next(attachmentManagerState);
|
|
47846
|
+
messageComposer.linkPreviewsManager.state.next(linkPreviewsManagerState);
|
|
47847
|
+
messageComposer.pollComposer.state.next(pollComposerState);
|
|
47848
|
+
messageComposer.customDataManager.state.next(customDataManagerState);
|
|
47849
|
+
};
|
|
47850
|
+
};
|
|
47848
47851
|
var useSubmitHandler = (props) => {
|
|
47849
47852
|
const { clearEditingState, overrideSubmitHandler } = props;
|
|
47850
47853
|
const { addNotification, editMessage, sendMessage } = useChannelActionContext("useSubmitHandler");
|
|
@@ -47864,7 +47867,17 @@ var useSubmitHandler = (props) => {
|
|
|
47864
47867
|
addNotification(t("Edit message request failed"), "error");
|
|
47865
47868
|
}
|
|
47866
47869
|
} else {
|
|
47870
|
+
const restoreComposerStateSnapshot = takeStateSnapshot(messageComposer);
|
|
47867
47871
|
try {
|
|
47872
|
+
const sentPollMessage = !!message.poll_id;
|
|
47873
|
+
if (sentPollMessage) {
|
|
47874
|
+
messageComposer.state.partialNext({
|
|
47875
|
+
id: import_stream_chat8.MessageComposer.generateId(),
|
|
47876
|
+
pollId: null
|
|
47877
|
+
});
|
|
47878
|
+
} else {
|
|
47879
|
+
messageComposer.clear();
|
|
47880
|
+
}
|
|
47868
47881
|
if (overrideSubmitHandler) {
|
|
47869
47882
|
await overrideSubmitHandler({
|
|
47870
47883
|
cid: messageComposer.channel.cid,
|
|
@@ -47875,10 +47888,10 @@ var useSubmitHandler = (props) => {
|
|
|
47875
47888
|
} else {
|
|
47876
47889
|
await sendMessage({ localMessage, message, options: sendOptions });
|
|
47877
47890
|
}
|
|
47878
|
-
messageComposer.clear();
|
|
47879
47891
|
if (messageComposer.config.text.publishTypingEvents)
|
|
47880
47892
|
await messageComposer.channel.stopTyping();
|
|
47881
47893
|
} catch (err) {
|
|
47894
|
+
restoreComposerStateSnapshot();
|
|
47882
47895
|
addNotification(t("Send message request failed"), "error");
|
|
47883
47896
|
}
|
|
47884
47897
|
}
|
|
@@ -47898,8 +47911,8 @@ var useSubmitHandler = (props) => {
|
|
|
47898
47911
|
|
|
47899
47912
|
// src/components/MessageInput/hooks/usePasteHandler.ts
|
|
47900
47913
|
var import_react226 = require("react");
|
|
47901
|
-
var usePasteHandler = (
|
|
47902
|
-
const { attachmentManager } = useMessageComposer();
|
|
47914
|
+
var usePasteHandler = () => {
|
|
47915
|
+
const { attachmentManager, textComposer } = useMessageComposer();
|
|
47903
47916
|
const onPaste = (0, import_react226.useCallback)(
|
|
47904
47917
|
(clipboardEvent) => {
|
|
47905
47918
|
(async (event) => {
|
|
@@ -47920,13 +47933,13 @@ var usePasteHandler = (insertText) => {
|
|
|
47920
47933
|
const fileLikes = await dataTransferItemsToFiles(Array.from(items));
|
|
47921
47934
|
if (plainTextPromise) {
|
|
47922
47935
|
const pastedText = await plainTextPromise;
|
|
47923
|
-
insertText(pastedText);
|
|
47936
|
+
textComposer.insertText({ text: pastedText });
|
|
47924
47937
|
} else {
|
|
47925
47938
|
attachmentManager.uploadFiles(fileLikes);
|
|
47926
47939
|
}
|
|
47927
47940
|
})(clipboardEvent);
|
|
47928
47941
|
},
|
|
47929
|
-
[attachmentManager,
|
|
47942
|
+
[attachmentManager, textComposer]
|
|
47930
47943
|
);
|
|
47931
47944
|
return { onPaste };
|
|
47932
47945
|
};
|
|
@@ -47995,7 +48008,7 @@ var useMediaRecorder = ({
|
|
|
47995
48008
|
// src/components/MessageInput/hooks/useMessageInputControls.ts
|
|
47996
48009
|
var useMessageInputControls = (props) => {
|
|
47997
48010
|
const { asyncMessagesMultiSendEnabled, audioRecordingConfig, audioRecordingEnabled } = props;
|
|
47998
|
-
const {
|
|
48011
|
+
const { textareaRef } = useTextareaRef(props);
|
|
47999
48012
|
const { handleSubmit } = useSubmitHandler(props);
|
|
48000
48013
|
const recordingController = useMediaRecorder({
|
|
48001
48014
|
asyncMessagesMultiSendEnabled,
|
|
@@ -48003,10 +48016,9 @@ var useMessageInputControls = (props) => {
|
|
|
48003
48016
|
handleSubmit,
|
|
48004
48017
|
recordingConfig: audioRecordingConfig
|
|
48005
48018
|
});
|
|
48006
|
-
const { onPaste } = usePasteHandler(
|
|
48019
|
+
const { onPaste } = usePasteHandler();
|
|
48007
48020
|
return {
|
|
48008
48021
|
handleSubmit,
|
|
48009
|
-
insertText,
|
|
48010
48022
|
onPaste,
|
|
48011
48023
|
recordingController,
|
|
48012
48024
|
textareaRef
|
|
@@ -48040,8 +48052,8 @@ var AttachmentPreviewList = ({
|
|
|
48040
48052
|
"data-testid": "attachment-list-scroll-container"
|
|
48041
48053
|
},
|
|
48042
48054
|
attachments.map((attachment) => {
|
|
48043
|
-
if ((0,
|
|
48044
|
-
if ((0,
|
|
48055
|
+
if ((0, import_stream_chat9.isScrapedContent)(attachment)) return null;
|
|
48056
|
+
if ((0, import_stream_chat9.isLocalVoiceRecordingAttachment)(attachment)) {
|
|
48045
48057
|
return /* @__PURE__ */ import_react228.default.createElement(
|
|
48046
48058
|
VoiceRecordingPreview2,
|
|
48047
48059
|
{
|
|
@@ -48051,7 +48063,7 @@ var AttachmentPreviewList = ({
|
|
|
48051
48063
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
48052
48064
|
}
|
|
48053
48065
|
);
|
|
48054
|
-
} else if ((0,
|
|
48066
|
+
} else if ((0, import_stream_chat9.isLocalAudioAttachment)(attachment)) {
|
|
48055
48067
|
return /* @__PURE__ */ import_react228.default.createElement(
|
|
48056
48068
|
AudioAttachmentPreview,
|
|
48057
48069
|
{
|
|
@@ -48061,7 +48073,7 @@ var AttachmentPreviewList = ({
|
|
|
48061
48073
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
48062
48074
|
}
|
|
48063
48075
|
);
|
|
48064
|
-
} else if ((0,
|
|
48076
|
+
} else if ((0, import_stream_chat9.isLocalVideoAttachment)(attachment)) {
|
|
48065
48077
|
return /* @__PURE__ */ import_react228.default.createElement(
|
|
48066
48078
|
VideoAttachmentPreview,
|
|
48067
48079
|
{
|
|
@@ -48071,7 +48083,7 @@ var AttachmentPreviewList = ({
|
|
|
48071
48083
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
48072
48084
|
}
|
|
48073
48085
|
);
|
|
48074
|
-
} else if ((0,
|
|
48086
|
+
} else if ((0, import_stream_chat9.isLocalImageAttachment)(attachment)) {
|
|
48075
48087
|
return /* @__PURE__ */ import_react228.default.createElement(
|
|
48076
48088
|
ImageAttachmentPreview2,
|
|
48077
48089
|
{
|
|
@@ -48081,7 +48093,7 @@ var AttachmentPreviewList = ({
|
|
|
48081
48093
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
48082
48094
|
}
|
|
48083
48095
|
);
|
|
48084
|
-
} else if ((0,
|
|
48096
|
+
} else if ((0, import_stream_chat9.isLocalFileAttachment)(attachment)) {
|
|
48085
48097
|
return /* @__PURE__ */ import_react228.default.createElement(
|
|
48086
48098
|
FileAttachmentPreview2,
|
|
48087
48099
|
{
|
|
@@ -48091,7 +48103,7 @@ var AttachmentPreviewList = ({
|
|
|
48091
48103
|
removeAttachments: messageComposer.attachmentManager.removeAttachments
|
|
48092
48104
|
}
|
|
48093
48105
|
);
|
|
48094
|
-
} else if ((0,
|
|
48106
|
+
} else if ((0, import_stream_chat9.isLocalAttachment)(attachment)) {
|
|
48095
48107
|
return /* @__PURE__ */ import_react228.default.createElement(
|
|
48096
48108
|
UnsupportedAttachmentPreview2,
|
|
48097
48109
|
{
|
|
@@ -48138,13 +48150,13 @@ var CooldownTimer = ({ cooldownInterval }) => {
|
|
|
48138
48150
|
};
|
|
48139
48151
|
|
|
48140
48152
|
// src/components/MessageInput/EditMessageForm.tsx
|
|
48141
|
-
var
|
|
48153
|
+
var import_react248 = __toESM(require("react"));
|
|
48142
48154
|
|
|
48143
48155
|
// src/components/MessageInput/MessageInput.tsx
|
|
48144
|
-
var
|
|
48156
|
+
var import_react247 = __toESM(require("react"));
|
|
48145
48157
|
|
|
48146
48158
|
// src/components/MessageInput/MessageInputFlat.tsx
|
|
48147
|
-
var
|
|
48159
|
+
var import_react245 = __toESM(require("react"));
|
|
48148
48160
|
|
|
48149
48161
|
// src/components/MessageInput/SendButton.tsx
|
|
48150
48162
|
var import_react231 = __toESM(require("react"));
|
|
@@ -48261,13 +48273,13 @@ var QuotedMessagePreview = ({
|
|
|
48261
48273
|
// src/components/MessageInput/LinkPreviewList.tsx
|
|
48262
48274
|
var import_clsx57 = __toESM(require("clsx"));
|
|
48263
48275
|
var import_react234 = __toESM(require("react"));
|
|
48264
|
-
var
|
|
48276
|
+
var import_stream_chat10 = require("stream-chat");
|
|
48265
48277
|
var linkPreviewsManagerStateSelector = (state) => ({
|
|
48266
48278
|
linkPreviews: Array.from(state.previews.values()).filter(
|
|
48267
|
-
(preview) =>
|
|
48279
|
+
(preview) => import_stream_chat10.LinkPreviewsManager.previewIsLoaded(preview) || import_stream_chat10.LinkPreviewsManager.previewIsLoading(preview)
|
|
48268
48280
|
)
|
|
48269
48281
|
});
|
|
48270
|
-
var
|
|
48282
|
+
var messageComposerStateSelector = (state) => ({
|
|
48271
48283
|
quotedMessage: state.quotedMessage
|
|
48272
48284
|
});
|
|
48273
48285
|
var LinkPreviewList = () => {
|
|
@@ -48275,7 +48287,7 @@ var LinkPreviewList = () => {
|
|
|
48275
48287
|
const { linkPreviewsManager } = messageComposer;
|
|
48276
48288
|
const { quotedMessage } = useStateStore(
|
|
48277
48289
|
messageComposer.state,
|
|
48278
|
-
|
|
48290
|
+
messageComposerStateSelector
|
|
48279
48291
|
);
|
|
48280
48292
|
const { linkPreviews } = useStateStore(
|
|
48281
48293
|
linkPreviewsManager.state,
|
|
@@ -48289,13 +48301,13 @@ var LinkPreviewCard = ({ linkPreview }) => {
|
|
|
48289
48301
|
const { linkPreviewsManager } = useMessageComposer();
|
|
48290
48302
|
const { handleEnter, handleLeave, tooltipVisible } = useEnterLeaveHandlers();
|
|
48291
48303
|
const [referenceElement, setReferenceElement] = (0, import_react234.useState)(null);
|
|
48292
|
-
if (!
|
|
48304
|
+
if (!import_stream_chat10.LinkPreviewsManager.previewIsLoaded(linkPreview) && !import_stream_chat10.LinkPreviewsManager.previewIsLoading(linkPreview))
|
|
48293
48305
|
return null;
|
|
48294
48306
|
return /* @__PURE__ */ import_react234.default.createElement(
|
|
48295
48307
|
"div",
|
|
48296
48308
|
{
|
|
48297
48309
|
className: (0, import_clsx57.default)("str-chat__link-preview-card", {
|
|
48298
|
-
"str-chat__link-preview-card--loading":
|
|
48310
|
+
"str-chat__link-preview-card--loading": import_stream_chat10.LinkPreviewsManager.previewIsLoading(linkPreview)
|
|
48299
48311
|
}),
|
|
48300
48312
|
"data-testid": "link-preview-card"
|
|
48301
48313
|
},
|
|
@@ -48501,8 +48513,10 @@ var SuggestionList = ({
|
|
|
48501
48513
|
};
|
|
48502
48514
|
|
|
48503
48515
|
// src/components/TextareaComposer/TextareaComposer.tsx
|
|
48516
|
+
var import_lodash19 = __toESM(require("lodash.debounce"));
|
|
48504
48517
|
var import_clsx61 = __toESM(require("clsx"));
|
|
48505
|
-
var import_react240 =
|
|
48518
|
+
var import_react240 = require("react");
|
|
48519
|
+
var import_react241 = __toESM(require("react"));
|
|
48506
48520
|
var import_react_textarea_autosize = __toESM(require("react-textarea-autosize"));
|
|
48507
48521
|
var textComposerStateSelector2 = (state) => ({
|
|
48508
48522
|
selection: state.selection,
|
|
@@ -48521,33 +48535,32 @@ var TextareaComposer = ({
|
|
|
48521
48535
|
className,
|
|
48522
48536
|
closeSuggestionsOnClickOutside,
|
|
48523
48537
|
containerClassName,
|
|
48524
|
-
// dropdownClassName, // todo: X find a different way to prevent prop drilling
|
|
48525
|
-
grow: growProp,
|
|
48526
|
-
// itemClassName, // todo: X find a different way to prevent prop drilling
|
|
48527
48538
|
listClassName,
|
|
48528
|
-
maxRows: maxRowsProp
|
|
48539
|
+
maxRows: maxRowsProp,
|
|
48540
|
+
minRows: minRowsProp,
|
|
48529
48541
|
onBlur,
|
|
48530
48542
|
onChange,
|
|
48531
48543
|
onKeyDown,
|
|
48532
48544
|
onScroll,
|
|
48545
|
+
onSelect,
|
|
48533
48546
|
placeholder: placeholderProp,
|
|
48534
48547
|
shouldSubmit: shouldSubmitProp,
|
|
48535
|
-
...
|
|
48548
|
+
...restTextareaProps
|
|
48536
48549
|
}) => {
|
|
48537
48550
|
const { t } = useTranslationContext();
|
|
48538
48551
|
const { AutocompleteSuggestionList = SuggestionList } = useComponentContext();
|
|
48539
48552
|
const {
|
|
48540
48553
|
additionalTextareaProps,
|
|
48541
48554
|
cooldownRemaining,
|
|
48542
|
-
grow: growContext,
|
|
48543
48555
|
handleSubmit,
|
|
48544
48556
|
maxRows: maxRowsContext,
|
|
48557
|
+
minRows: minRowsContext,
|
|
48545
48558
|
onPaste,
|
|
48546
48559
|
shouldSubmit: shouldSubmitContext,
|
|
48547
48560
|
textareaRef
|
|
48548
48561
|
} = useMessageInputContext();
|
|
48549
|
-
const
|
|
48550
|
-
const
|
|
48562
|
+
const maxRows = maxRowsProp ?? maxRowsContext ?? 1;
|
|
48563
|
+
const minRows = minRowsProp ?? minRowsContext;
|
|
48551
48564
|
const placeholder = placeholderProp ?? additionalTextareaProps?.placeholder;
|
|
48552
48565
|
const shouldSubmit = shouldSubmitProp ?? shouldSubmitContext ?? defaultShouldSubmit;
|
|
48553
48566
|
const messageComposer = useMessageComposer();
|
|
@@ -48558,10 +48571,10 @@ var TextareaComposer = ({
|
|
|
48558
48571
|
);
|
|
48559
48572
|
const { enabled } = useStateStore(messageComposer.configState, configStateSelector);
|
|
48560
48573
|
const { isLoadingItems } = useStateStore(suggestions?.searchSource.state, searchSourceStateSelector2) ?? {};
|
|
48561
|
-
const containerRef = (0,
|
|
48562
|
-
const [focusedItemIndex, setFocusedItemIndex] = (0,
|
|
48563
|
-
const [isComposing, setIsComposing] = (0,
|
|
48564
|
-
const changeHandler = (0,
|
|
48574
|
+
const containerRef = (0, import_react241.useRef)(null);
|
|
48575
|
+
const [focusedItemIndex, setFocusedItemIndex] = (0, import_react241.useState)(0);
|
|
48576
|
+
const [isComposing, setIsComposing] = (0, import_react241.useState)(false);
|
|
48577
|
+
const changeHandler = (0, import_react241.useCallback)(
|
|
48565
48578
|
(e) => {
|
|
48566
48579
|
if (onChange) {
|
|
48567
48580
|
onChange(e);
|
|
@@ -48578,25 +48591,23 @@ var TextareaComposer = ({
|
|
|
48578
48591
|
},
|
|
48579
48592
|
[onChange, textComposer, textareaRef]
|
|
48580
48593
|
);
|
|
48581
|
-
const onCompositionEnd = (0,
|
|
48594
|
+
const onCompositionEnd = (0, import_react241.useCallback)(() => {
|
|
48582
48595
|
setIsComposing(false);
|
|
48583
48596
|
}, []);
|
|
48584
|
-
const onCompositionStart = (0,
|
|
48597
|
+
const onCompositionStart = (0, import_react241.useCallback)(() => {
|
|
48585
48598
|
setIsComposing(true);
|
|
48586
48599
|
}, []);
|
|
48587
|
-
const keyDownHandler = (0,
|
|
48600
|
+
const keyDownHandler = (0, import_react241.useCallback)(
|
|
48588
48601
|
(event) => {
|
|
48589
48602
|
if (onKeyDown) {
|
|
48590
48603
|
onKeyDown(event);
|
|
48591
48604
|
return;
|
|
48592
48605
|
}
|
|
48593
|
-
if (event.key === "Enter") {
|
|
48594
|
-
event.preventDefault();
|
|
48595
|
-
}
|
|
48596
48606
|
if (textComposer.suggestions && textComposer.suggestions.searchSource.items?.length) {
|
|
48597
48607
|
if (event.key === "Escape") return textComposer.closeSuggestions();
|
|
48598
48608
|
const loadedItems = textComposer.suggestions.searchSource.items;
|
|
48599
48609
|
if (event.key === "Enter") {
|
|
48610
|
+
event.preventDefault();
|
|
48600
48611
|
textComposer.handleSelect(loadedItems[focusedItemIndex]);
|
|
48601
48612
|
}
|
|
48602
48613
|
if (event.key === "ArrowUp") {
|
|
@@ -48638,7 +48649,7 @@ var TextareaComposer = ({
|
|
|
48638
48649
|
textareaRef
|
|
48639
48650
|
]
|
|
48640
48651
|
);
|
|
48641
|
-
const scrollHandler = (0,
|
|
48652
|
+
const scrollHandler = (0, import_react241.useCallback)(
|
|
48642
48653
|
(event) => {
|
|
48643
48654
|
if (onScroll) {
|
|
48644
48655
|
onScroll(event);
|
|
@@ -48648,18 +48659,32 @@ var TextareaComposer = ({
|
|
|
48648
48659
|
},
|
|
48649
48660
|
[onScroll, textComposer]
|
|
48650
48661
|
);
|
|
48651
|
-
(0, import_react240.
|
|
48662
|
+
const setSelectionDebounced = (0, import_react240.useMemo)(
|
|
48663
|
+
() => (0, import_lodash19.default)(
|
|
48664
|
+
(e) => {
|
|
48665
|
+
onSelect?.(e);
|
|
48666
|
+
textComposer.setSelection({
|
|
48667
|
+
end: e.target.selectionEnd,
|
|
48668
|
+
start: e.target.selectionStart
|
|
48669
|
+
});
|
|
48670
|
+
},
|
|
48671
|
+
100,
|
|
48672
|
+
{ leading: false, trailing: true }
|
|
48673
|
+
),
|
|
48674
|
+
[onSelect, textComposer]
|
|
48675
|
+
);
|
|
48676
|
+
(0, import_react241.useEffect)(() => {
|
|
48652
48677
|
if (textareaRef.current && !isComposing) {
|
|
48653
48678
|
textareaRef.current.selectionStart = selection.start;
|
|
48654
48679
|
textareaRef.current.selectionEnd = selection.end;
|
|
48655
48680
|
}
|
|
48656
48681
|
}, [text8, textareaRef, selection.start, selection.end, isComposing]);
|
|
48657
|
-
(0,
|
|
48682
|
+
(0, import_react241.useEffect)(() => {
|
|
48658
48683
|
if (textComposer.suggestions) {
|
|
48659
48684
|
setFocusedItemIndex(0);
|
|
48660
48685
|
}
|
|
48661
48686
|
}, [textComposer.suggestions]);
|
|
48662
|
-
return /* @__PURE__ */
|
|
48687
|
+
return /* @__PURE__ */ import_react241.default.createElement(
|
|
48663
48688
|
"div",
|
|
48664
48689
|
{
|
|
48665
48690
|
className: (0, import_clsx61.default)(
|
|
@@ -48672,10 +48697,10 @@ var TextareaComposer = ({
|
|
|
48672
48697
|
),
|
|
48673
48698
|
ref: containerRef
|
|
48674
48699
|
},
|
|
48675
|
-
/* @__PURE__ */
|
|
48700
|
+
/* @__PURE__ */ import_react241.default.createElement(
|
|
48676
48701
|
import_react_textarea_autosize.default,
|
|
48677
48702
|
{
|
|
48678
|
-
...
|
|
48703
|
+
...{ ...additionalTextareaProps, ...restTextareaProps },
|
|
48679
48704
|
"aria-label": cooldownRemaining ? t("Slow Mode ON") : placeholder,
|
|
48680
48705
|
className: (0, import_clsx61.default)(
|
|
48681
48706
|
"rta__textarea",
|
|
@@ -48684,7 +48709,8 @@ var TextareaComposer = ({
|
|
|
48684
48709
|
),
|
|
48685
48710
|
"data-testid": "message-input",
|
|
48686
48711
|
disabled: !enabled || !!cooldownRemaining,
|
|
48687
|
-
maxRows
|
|
48712
|
+
maxRows,
|
|
48713
|
+
minRows,
|
|
48688
48714
|
onBlur,
|
|
48689
48715
|
onChange: changeHandler,
|
|
48690
48716
|
onCompositionEnd,
|
|
@@ -48692,6 +48718,7 @@ var TextareaComposer = ({
|
|
|
48692
48718
|
onKeyDown: keyDownHandler,
|
|
48693
48719
|
onPaste,
|
|
48694
48720
|
onScroll: scrollHandler,
|
|
48721
|
+
onSelect: setSelectionDebounced,
|
|
48695
48722
|
placeholder: placeholder || t("Type your message"),
|
|
48696
48723
|
ref: (ref) => {
|
|
48697
48724
|
textareaRef.current = ref;
|
|
@@ -48699,7 +48726,7 @@ var TextareaComposer = ({
|
|
|
48699
48726
|
value: text8
|
|
48700
48727
|
}
|
|
48701
48728
|
),
|
|
48702
|
-
!isComposing && /* @__PURE__ */
|
|
48729
|
+
!isComposing && /* @__PURE__ */ import_react241.default.createElement(
|
|
48703
48730
|
AutocompleteSuggestionList,
|
|
48704
48731
|
{
|
|
48705
48732
|
className: listClassName,
|
|
@@ -48712,10 +48739,10 @@ var TextareaComposer = ({
|
|
|
48712
48739
|
};
|
|
48713
48740
|
|
|
48714
48741
|
// src/components/AIStateIndicator/AIStateIndicator.tsx
|
|
48715
|
-
var
|
|
48742
|
+
var import_react243 = __toESM(require("react"));
|
|
48716
48743
|
|
|
48717
48744
|
// src/components/AIStateIndicator/hooks/useAIState.ts
|
|
48718
|
-
var
|
|
48745
|
+
var import_react242 = require("react");
|
|
48719
48746
|
var AIStates = {
|
|
48720
48747
|
Error: "AI_STATE_ERROR",
|
|
48721
48748
|
ExternalSources: "AI_STATE_EXTERNAL_SOURCES",
|
|
@@ -48724,8 +48751,8 @@ var AIStates = {
|
|
|
48724
48751
|
Thinking: "AI_STATE_THINKING"
|
|
48725
48752
|
};
|
|
48726
48753
|
var useAIState = (channel) => {
|
|
48727
|
-
const [aiState, setAiState] = (0,
|
|
48728
|
-
(0,
|
|
48754
|
+
const [aiState, setAiState] = (0, import_react242.useState)(AIStates.Idle);
|
|
48755
|
+
(0, import_react242.useEffect)(() => {
|
|
48729
48756
|
if (!channel) {
|
|
48730
48757
|
return;
|
|
48731
48758
|
}
|
|
@@ -48762,21 +48789,21 @@ var AIStateIndicator = ({
|
|
|
48762
48789
|
[AIStates.Thinking]: t("Thinking..."),
|
|
48763
48790
|
[AIStates.Generating]: t("Generating...")
|
|
48764
48791
|
};
|
|
48765
|
-
return aiState in allowedStates ? /* @__PURE__ */
|
|
48792
|
+
return aiState in allowedStates ? /* @__PURE__ */ import_react243.default.createElement("div", { className: "str-chat__ai-state-indicator-container" }, /* @__PURE__ */ import_react243.default.createElement("p", { className: "str-chat__ai-state-indicator-text" }, allowedStates[aiState])) : null;
|
|
48766
48793
|
};
|
|
48767
48794
|
|
|
48768
48795
|
// src/components/MessageInput/WithDragAndDropUpload.tsx
|
|
48769
|
-
var
|
|
48796
|
+
var import_react244 = __toESM(require("react"));
|
|
48770
48797
|
var import_react_dropzone = require("react-dropzone");
|
|
48771
48798
|
var import_clsx62 = __toESM(require("clsx"));
|
|
48772
|
-
var DragAndDropUploadContext =
|
|
48799
|
+
var DragAndDropUploadContext = import_react244.default.createContext({
|
|
48773
48800
|
subscribeToDrop: null
|
|
48774
48801
|
});
|
|
48775
|
-
var useDragAndDropUploadContext = () => (0,
|
|
48802
|
+
var useDragAndDropUploadContext = () => (0, import_react244.useContext)(DragAndDropUploadContext);
|
|
48776
48803
|
var useRegisterDropHandlers = () => {
|
|
48777
48804
|
const { subscribeToDrop } = useDragAndDropUploadContext();
|
|
48778
48805
|
const messageComposer = useMessageComposer();
|
|
48779
|
-
(0,
|
|
48806
|
+
(0, import_react244.useEffect)(() => {
|
|
48780
48807
|
const unsubscribe = subscribeToDrop?.(messageComposer.attachmentManager.uploadFiles);
|
|
48781
48808
|
return unsubscribe;
|
|
48782
48809
|
}, [subscribeToDrop, messageComposer]);
|
|
@@ -48791,7 +48818,7 @@ var WithDragAndDropUpload = ({
|
|
|
48791
48818
|
component: Component2 = "div",
|
|
48792
48819
|
style
|
|
48793
48820
|
}) => {
|
|
48794
|
-
const dropHandlersRef = (0,
|
|
48821
|
+
const dropHandlersRef = (0, import_react244.useRef)(/* @__PURE__ */ new Set());
|
|
48795
48822
|
const { t } = useTranslationContext();
|
|
48796
48823
|
const messageInputContext = useMessageInputContext();
|
|
48797
48824
|
const dragAndDropUploadContext = useDragAndDropUploadContext();
|
|
@@ -48802,20 +48829,20 @@ var WithDragAndDropUpload = ({
|
|
|
48802
48829
|
attachmentManagerConfigStateSelector
|
|
48803
48830
|
);
|
|
48804
48831
|
const isWithinMessageInputContext = Object.keys(messageInputContext).length > 0;
|
|
48805
|
-
const accept = (0,
|
|
48832
|
+
const accept = (0, import_react244.useMemo)(
|
|
48806
48833
|
() => acceptedFiles.reduce((mediaTypeMap, mediaType) => {
|
|
48807
48834
|
mediaTypeMap[mediaType] ?? (mediaTypeMap[mediaType] = []);
|
|
48808
48835
|
return mediaTypeMap;
|
|
48809
48836
|
}, {}),
|
|
48810
48837
|
[acceptedFiles]
|
|
48811
48838
|
);
|
|
48812
|
-
const subscribeToDrop = (0,
|
|
48839
|
+
const subscribeToDrop = (0, import_react244.useCallback)((fn) => {
|
|
48813
48840
|
dropHandlersRef.current.add(fn);
|
|
48814
48841
|
return () => {
|
|
48815
48842
|
dropHandlersRef.current.delete(fn);
|
|
48816
48843
|
};
|
|
48817
48844
|
}, []);
|
|
48818
|
-
const handleDrop = (0,
|
|
48845
|
+
const handleDrop = (0, import_react244.useCallback)((files) => {
|
|
48819
48846
|
dropHandlersRef.current.forEach((fn) => fn(files));
|
|
48820
48847
|
}, []);
|
|
48821
48848
|
const { getRootProps, isDragActive, isDragReject } = (0, import_react_dropzone.useDropzone)({
|
|
@@ -48828,24 +48855,24 @@ var WithDragAndDropUpload = ({
|
|
|
48828
48855
|
onDrop: isWithinMessageInputContext ? messageComposer.attachmentManager.uploadFiles : handleDrop
|
|
48829
48856
|
});
|
|
48830
48857
|
if (dragAndDropUploadContext.subscribeToDrop !== null) {
|
|
48831
|
-
return /* @__PURE__ */
|
|
48858
|
+
return /* @__PURE__ */ import_react244.default.createElement(Component2, { className }, children);
|
|
48832
48859
|
}
|
|
48833
|
-
return /* @__PURE__ */
|
|
48860
|
+
return /* @__PURE__ */ import_react244.default.createElement(
|
|
48834
48861
|
DragAndDropUploadContext.Provider,
|
|
48835
48862
|
{
|
|
48836
48863
|
value: {
|
|
48837
48864
|
subscribeToDrop
|
|
48838
48865
|
}
|
|
48839
48866
|
},
|
|
48840
|
-
/* @__PURE__ */
|
|
48867
|
+
/* @__PURE__ */ import_react244.default.createElement(Component2, { ...getRootProps({ className, style }) }, isDragActive && /* @__PURE__ */ import_react244.default.createElement(
|
|
48841
48868
|
"div",
|
|
48842
48869
|
{
|
|
48843
48870
|
className: (0, import_clsx62.default)("str-chat__dropzone-container", {
|
|
48844
48871
|
"str-chat__dropzone-container--not-accepted": isDragReject
|
|
48845
48872
|
})
|
|
48846
48873
|
},
|
|
48847
|
-
!isDragReject && /* @__PURE__ */
|
|
48848
|
-
isDragReject && /* @__PURE__ */
|
|
48874
|
+
!isDragReject && /* @__PURE__ */ import_react244.default.createElement("p", null, t("Drag your files here")),
|
|
48875
|
+
isDragReject && /* @__PURE__ */ import_react244.default.createElement("p", null, t("Some of the files will not be accepted"))
|
|
48849
48876
|
), children)
|
|
48850
48877
|
);
|
|
48851
48878
|
};
|
|
@@ -48872,37 +48899,38 @@ var MessageInputFlat = () => {
|
|
|
48872
48899
|
RecordingPermissionDeniedNotification: RecordingPermissionDeniedNotification2 = RecordingPermissionDeniedNotification,
|
|
48873
48900
|
SendButton: SendButton2 = SendButton,
|
|
48874
48901
|
StartRecordingAudioButton: StartRecordingAudioButton2 = StartRecordingAudioButton,
|
|
48875
|
-
StopAIGenerationButton: StopAIGenerationButtonOverride
|
|
48876
|
-
|
|
48902
|
+
StopAIGenerationButton: StopAIGenerationButtonOverride,
|
|
48903
|
+
TextareaComposer: TextareaComposer2 = TextareaComposer
|
|
48904
|
+
} = useComponentContext();
|
|
48877
48905
|
const { channel } = useChatContext("MessageInputFlat");
|
|
48878
48906
|
const { aiState } = useAIState(channel);
|
|
48879
|
-
const stopGenerating = (0,
|
|
48907
|
+
const stopGenerating = (0, import_react245.useCallback)(() => channel?.stopAIResponse(), [channel]);
|
|
48880
48908
|
const [
|
|
48881
48909
|
showRecordingPermissionDeniedNotification,
|
|
48882
48910
|
setShowRecordingPermissionDeniedNotification
|
|
48883
|
-
] = (0,
|
|
48884
|
-
const closePermissionDeniedNotification = (0,
|
|
48911
|
+
] = (0, import_react245.useState)(false);
|
|
48912
|
+
const closePermissionDeniedNotification = (0, import_react245.useCallback)(() => {
|
|
48885
48913
|
setShowRecordingPermissionDeniedNotification(false);
|
|
48886
48914
|
}, []);
|
|
48887
48915
|
const { attachments } = useAttachmentManagerState();
|
|
48888
|
-
if (recordingController.recordingState) return /* @__PURE__ */
|
|
48916
|
+
if (recordingController.recordingState) return /* @__PURE__ */ import_react245.default.createElement(AudioRecorder2, null);
|
|
48889
48917
|
const recordingEnabled = !!(recordingController.recorder && navigator.mediaDevices);
|
|
48890
48918
|
const isRecording = !!recordingController.recordingState;
|
|
48891
48919
|
const StopAIGenerationButton2 = StopAIGenerationButtonOverride === void 0 ? StopAIGenerationButton : StopAIGenerationButtonOverride;
|
|
48892
48920
|
const shouldDisplayStopAIGeneration = [AIStates.Thinking, AIStates.Generating].includes(aiState) && !!StopAIGenerationButton2;
|
|
48893
|
-
return /* @__PURE__ */
|
|
48921
|
+
return /* @__PURE__ */ import_react245.default.createElement(WithDragAndDropUpload, { className: "str-chat__message-input", component: "div" }, recordingEnabled && recordingController.permissionState === "denied" && showRecordingPermissionDeniedNotification && /* @__PURE__ */ import_react245.default.createElement(
|
|
48894
48922
|
RecordingPermissionDeniedNotification2,
|
|
48895
48923
|
{
|
|
48896
48924
|
onClose: closePermissionDeniedNotification,
|
|
48897
48925
|
permissionName: "microphone" /* MIC */
|
|
48898
48926
|
}
|
|
48899
|
-
), /* @__PURE__ */
|
|
48927
|
+
), /* @__PURE__ */ import_react245.default.createElement(LinkPreviewList2, null), /* @__PURE__ */ import_react245.default.createElement(QuotedMessagePreviewHeader, null), /* @__PURE__ */ import_react245.default.createElement("div", { className: "str-chat__message-input-inner" }, /* @__PURE__ */ import_react245.default.createElement(AttachmentSelector2, null), /* @__PURE__ */ import_react245.default.createElement("div", { className: "str-chat__message-textarea-container" }, /* @__PURE__ */ import_react245.default.createElement(QuotedMessagePreview2, null), /* @__PURE__ */ import_react245.default.createElement(AttachmentPreviewList2, null), /* @__PURE__ */ import_react245.default.createElement("div", { className: "str-chat__message-textarea-with-emoji-picker" }, /* @__PURE__ */ import_react245.default.createElement(TextareaComposer2, null), EmojiPicker && /* @__PURE__ */ import_react245.default.createElement(EmojiPicker, null))), shouldDisplayStopAIGeneration ? /* @__PURE__ */ import_react245.default.createElement(StopAIGenerationButton2, { onClick: stopGenerating }) : !hideSendButton && /* @__PURE__ */ import_react245.default.createElement(import_react245.default.Fragment, null, cooldownRemaining ? /* @__PURE__ */ import_react245.default.createElement(
|
|
48900
48928
|
CooldownTimer2,
|
|
48901
48929
|
{
|
|
48902
48930
|
cooldownInterval: cooldownRemaining,
|
|
48903
48931
|
setCooldownRemaining
|
|
48904
48932
|
}
|
|
48905
|
-
) : /* @__PURE__ */
|
|
48933
|
+
) : /* @__PURE__ */ import_react245.default.createElement(import_react245.default.Fragment, null, /* @__PURE__ */ import_react245.default.createElement(SendButton2, { sendMessage: handleSubmit }), recordingEnabled && /* @__PURE__ */ import_react245.default.createElement(
|
|
48906
48934
|
StartRecordingAudioButton2,
|
|
48907
48935
|
{
|
|
48908
48936
|
disabled: isRecording || !asyncMessagesMultiSendEnabled && attachments.some(
|
|
@@ -48917,7 +48945,7 @@ var MessageInputFlat = () => {
|
|
|
48917
48945
|
};
|
|
48918
48946
|
|
|
48919
48947
|
// src/components/MessageInput/hooks/useCreateMessageInputContext.ts
|
|
48920
|
-
var
|
|
48948
|
+
var import_react246 = require("react");
|
|
48921
48949
|
var useCreateMessageInputContext = (value) => {
|
|
48922
48950
|
const {
|
|
48923
48951
|
additionalTextareaProps,
|
|
@@ -48928,10 +48956,8 @@ var useCreateMessageInputContext = (value) => {
|
|
|
48928
48956
|
cooldownRemaining,
|
|
48929
48957
|
emojiSearchIndex,
|
|
48930
48958
|
focus,
|
|
48931
|
-
grow,
|
|
48932
48959
|
handleSubmit,
|
|
48933
48960
|
hideSendButton,
|
|
48934
|
-
insertText,
|
|
48935
48961
|
isThreadInput,
|
|
48936
48962
|
maxRows,
|
|
48937
48963
|
minRows,
|
|
@@ -48943,7 +48969,7 @@ var useCreateMessageInputContext = (value) => {
|
|
|
48943
48969
|
textareaRef
|
|
48944
48970
|
} = value;
|
|
48945
48971
|
const parentId = parent?.id;
|
|
48946
|
-
const messageInputContext = (0,
|
|
48972
|
+
const messageInputContext = (0, import_react246.useMemo)(
|
|
48947
48973
|
() => ({
|
|
48948
48974
|
additionalTextareaProps,
|
|
48949
48975
|
asyncMessagesMultiSendEnabled,
|
|
@@ -48953,10 +48979,8 @@ var useCreateMessageInputContext = (value) => {
|
|
|
48953
48979
|
cooldownRemaining,
|
|
48954
48980
|
emojiSearchIndex,
|
|
48955
48981
|
focus,
|
|
48956
|
-
grow,
|
|
48957
48982
|
handleSubmit,
|
|
48958
48983
|
hideSendButton,
|
|
48959
|
-
insertText,
|
|
48960
48984
|
isThreadInput,
|
|
48961
48985
|
maxRows,
|
|
48962
48986
|
minRows,
|
|
@@ -48997,13 +49021,13 @@ var MessageInputProvider = (props) => {
|
|
|
48997
49021
|
emojiSearchIndex: props.emojiSearchIndex ?? emojiSearchIndex
|
|
48998
49022
|
});
|
|
48999
49023
|
const messageComposer = useMessageComposer();
|
|
49000
|
-
(0,
|
|
49024
|
+
(0, import_react247.useEffect)(
|
|
49001
49025
|
() => () => {
|
|
49002
49026
|
messageComposer.createDraft();
|
|
49003
49027
|
},
|
|
49004
49028
|
[messageComposer]
|
|
49005
49029
|
);
|
|
49006
|
-
(0,
|
|
49030
|
+
(0, import_react247.useEffect)(() => {
|
|
49007
49031
|
const threadId = messageComposer.threadId;
|
|
49008
49032
|
if (!threadId || !messageComposer.channel || !messageComposer.compositionIsEmpty)
|
|
49009
49033
|
return;
|
|
@@ -49014,16 +49038,16 @@ var MessageInputProvider = (props) => {
|
|
|
49014
49038
|
});
|
|
49015
49039
|
}, [messageComposer]);
|
|
49016
49040
|
useRegisterDropHandlers();
|
|
49017
|
-
return /* @__PURE__ */
|
|
49041
|
+
return /* @__PURE__ */ import_react247.default.createElement(MessageInputContextProvider, { value: messageInputContextValue }, props.children);
|
|
49018
49042
|
};
|
|
49019
49043
|
var UnMemoizedMessageInput = (props) => {
|
|
49020
49044
|
const { Input: PropInput } = props;
|
|
49021
49045
|
const { Input: ContextInput } = useComponentContext("MessageInput");
|
|
49022
49046
|
const Input3 = PropInput || ContextInput || MessageInputFlat;
|
|
49023
49047
|
const dialogManagerId = props.isThreadInput ? "message-input-dialog-manager-thread" : "message-input-dialog-manager";
|
|
49024
|
-
return /* @__PURE__ */
|
|
49048
|
+
return /* @__PURE__ */ import_react247.default.createElement(DialogManagerProvider, { id: dialogManagerId }, /* @__PURE__ */ import_react247.default.createElement(MessageInputProvider, { ...props }, /* @__PURE__ */ import_react247.default.createElement(Input3, null)));
|
|
49025
49049
|
};
|
|
49026
|
-
var MessageInput =
|
|
49050
|
+
var MessageInput = import_react247.default.memo(
|
|
49027
49051
|
UnMemoizedMessageInput
|
|
49028
49052
|
);
|
|
49029
49053
|
|
|
@@ -49031,7 +49055,7 @@ var MessageInput = import_react246.default.memo(
|
|
|
49031
49055
|
var EditMessageFormSendButton = () => {
|
|
49032
49056
|
const { t } = useTranslationContext();
|
|
49033
49057
|
const hasSendableData = useMessageComposerHasSendableData();
|
|
49034
|
-
return /* @__PURE__ */
|
|
49058
|
+
return /* @__PURE__ */ import_react248.default.createElement(
|
|
49035
49059
|
"button",
|
|
49036
49060
|
{
|
|
49037
49061
|
className: "str-chat__edit-message-send",
|
|
@@ -49046,26 +49070,26 @@ var EditMessageForm = () => {
|
|
|
49046
49070
|
const { t } = useTranslationContext("EditMessageForm");
|
|
49047
49071
|
const messageComposer = useMessageComposer();
|
|
49048
49072
|
const { clearEditingState, handleSubmit } = useMessageInputContext("EditMessageForm");
|
|
49049
|
-
const cancel = (0,
|
|
49073
|
+
const cancel = (0, import_react248.useCallback)(() => {
|
|
49050
49074
|
clearEditingState?.();
|
|
49051
49075
|
messageComposer.restore();
|
|
49052
49076
|
}, [clearEditingState, messageComposer]);
|
|
49053
|
-
(0,
|
|
49077
|
+
(0, import_react248.useEffect)(() => {
|
|
49054
49078
|
const onKeyDown = (event) => {
|
|
49055
49079
|
if (event.key === "Escape") cancel();
|
|
49056
49080
|
};
|
|
49057
49081
|
document.addEventListener("keydown", onKeyDown);
|
|
49058
49082
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
49059
49083
|
}, [cancel]);
|
|
49060
|
-
return /* @__PURE__ */
|
|
49084
|
+
return /* @__PURE__ */ import_react248.default.createElement(
|
|
49061
49085
|
"form",
|
|
49062
49086
|
{
|
|
49063
49087
|
autoComplete: "off",
|
|
49064
49088
|
className: "str-chat__edit-message-form",
|
|
49065
49089
|
onSubmit: handleSubmit
|
|
49066
49090
|
},
|
|
49067
|
-
/* @__PURE__ */
|
|
49068
|
-
/* @__PURE__ */
|
|
49091
|
+
/* @__PURE__ */ import_react248.default.createElement(MessageInputFlat, null),
|
|
49092
|
+
/* @__PURE__ */ import_react248.default.createElement("div", { className: "str-chat__edit-message-form-options" }, /* @__PURE__ */ import_react248.default.createElement(
|
|
49069
49093
|
"button",
|
|
49070
49094
|
{
|
|
49071
49095
|
className: "str-chat__edit-message-cancel",
|
|
@@ -49073,7 +49097,7 @@ var EditMessageForm = () => {
|
|
|
49073
49097
|
onClick: cancel
|
|
49074
49098
|
},
|
|
49075
49099
|
t("Cancel")
|
|
49076
|
-
), /* @__PURE__ */
|
|
49100
|
+
), /* @__PURE__ */ import_react248.default.createElement(EditMessageFormSendButton, null))
|
|
49077
49101
|
);
|
|
49078
49102
|
};
|
|
49079
49103
|
var EditMessageModal = ({
|
|
@@ -49082,22 +49106,21 @@ var EditMessageModal = ({
|
|
|
49082
49106
|
const { EditMessageInput = EditMessageForm } = useComponentContext();
|
|
49083
49107
|
const { clearEditingState } = useMessageContext();
|
|
49084
49108
|
const messageComposer = useMessageComposer();
|
|
49085
|
-
const onEditModalClose = (0,
|
|
49109
|
+
const onEditModalClose = (0, import_react248.useCallback)(() => {
|
|
49086
49110
|
clearEditingState();
|
|
49087
49111
|
messageComposer.restore();
|
|
49088
49112
|
}, [clearEditingState, messageComposer]);
|
|
49089
|
-
return /* @__PURE__ */
|
|
49113
|
+
return /* @__PURE__ */ import_react248.default.createElement(
|
|
49090
49114
|
Modal,
|
|
49091
49115
|
{
|
|
49092
49116
|
className: "str-chat__edit-message-modal",
|
|
49093
49117
|
onClose: onEditModalClose,
|
|
49094
49118
|
open: true
|
|
49095
49119
|
},
|
|
49096
|
-
/* @__PURE__ */
|
|
49120
|
+
/* @__PURE__ */ import_react248.default.createElement(
|
|
49097
49121
|
MessageInput,
|
|
49098
49122
|
{
|
|
49099
49123
|
clearEditingState,
|
|
49100
|
-
grow: true,
|
|
49101
49124
|
hideSendButton: true,
|
|
49102
49125
|
Input: EditMessageInput,
|
|
49103
49126
|
...additionalMessageInputProps
|
|
@@ -49111,12 +49134,12 @@ var attachmentManagerConfigStateSelector2 = (state) => ({
|
|
|
49111
49134
|
acceptedFiles: state.attachments.acceptedFiles,
|
|
49112
49135
|
maxNumberOfFilesPerMessage: state.attachments.maxNumberOfFilesPerMessage
|
|
49113
49136
|
});
|
|
49114
|
-
var UploadButton = (0,
|
|
49137
|
+
var UploadButton = (0, import_react249.forwardRef)(function UploadButton2({ onFileChange, resetOnChange = true, ...rest }, ref) {
|
|
49115
49138
|
const handleInputChange = useHandleFileChangeWrapper(resetOnChange, onFileChange);
|
|
49116
|
-
return /* @__PURE__ */
|
|
49139
|
+
return /* @__PURE__ */ import_react249.default.createElement("input", { onChange: handleInputChange, ref, type: "file", ...rest });
|
|
49117
49140
|
});
|
|
49118
49141
|
var FileInput = UploadButton;
|
|
49119
|
-
var UploadFileInput = (0,
|
|
49142
|
+
var UploadFileInput = (0, import_react249.forwardRef)(function UploadFileInput2({
|
|
49120
49143
|
className,
|
|
49121
49144
|
onFileChange: onFileChangeCustom,
|
|
49122
49145
|
...props
|
|
@@ -49130,15 +49153,15 @@ var UploadFileInput = (0, import_react248.forwardRef)(function UploadFileInput2(
|
|
|
49130
49153
|
messageComposer.configState,
|
|
49131
49154
|
attachmentManagerConfigStateSelector2
|
|
49132
49155
|
);
|
|
49133
|
-
const id = (0,
|
|
49134
|
-
const onFileChange = (0,
|
|
49156
|
+
const id = (0, import_react249.useMemo)(() => (0, import_nanoid5.nanoid)(), []);
|
|
49157
|
+
const onFileChange = (0, import_react249.useCallback)(
|
|
49135
49158
|
(files) => {
|
|
49136
49159
|
attachmentManager.uploadFiles(files);
|
|
49137
49160
|
onFileChangeCustom?.(files);
|
|
49138
49161
|
},
|
|
49139
49162
|
[onFileChangeCustom, attachmentManager]
|
|
49140
49163
|
);
|
|
49141
|
-
return /* @__PURE__ */
|
|
49164
|
+
return /* @__PURE__ */ import_react249.default.createElement(
|
|
49142
49165
|
FileInput,
|
|
49143
49166
|
{
|
|
49144
49167
|
accept: acceptedFiles?.join(","),
|
|
@@ -49185,7 +49208,7 @@ var VoiceRecordingPlayer = ({
|
|
|
49185
49208
|
});
|
|
49186
49209
|
if (!asset_url) return null;
|
|
49187
49210
|
const displayedDuration = secondsElapsed || duration;
|
|
49188
|
-
return /* @__PURE__ */
|
|
49211
|
+
return /* @__PURE__ */ import_react250.default.createElement("div", { className: rootClassName, "data-testid": "voice-recording-widget" }, /* @__PURE__ */ import_react250.default.createElement("audio", { ref: audioRef }, /* @__PURE__ */ import_react250.default.createElement("source", { "data-testid": "audio-source", src: asset_url, type: mime_type })), /* @__PURE__ */ import_react250.default.createElement(PlayButton, { isPlaying, onClick: togglePlay }), /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__metadata" }, /* @__PURE__ */ import_react250.default.createElement(
|
|
49189
49212
|
"div",
|
|
49190
49213
|
{
|
|
49191
49214
|
className: "str-chat__message-attachment__voice-recording-widget__title",
|
|
@@ -49193,25 +49216,25 @@ var VoiceRecordingPlayer = ({
|
|
|
49193
49216
|
title
|
|
49194
49217
|
},
|
|
49195
49218
|
title
|
|
49196
|
-
), /* @__PURE__ */
|
|
49219
|
+
), /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__audio-state" }, /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__timer" }, attachment.duration ? displayDuration(displayedDuration) : /* @__PURE__ */ import_react250.default.createElement(
|
|
49197
49220
|
FileSizeIndicator,
|
|
49198
49221
|
{
|
|
49199
49222
|
fileSize: attachment.file_size,
|
|
49200
49223
|
maximumFractionDigits: 0
|
|
49201
49224
|
}
|
|
49202
|
-
)), /* @__PURE__ */
|
|
49225
|
+
)), /* @__PURE__ */ import_react250.default.createElement(
|
|
49203
49226
|
WaveProgressBar,
|
|
49204
49227
|
{
|
|
49205
49228
|
progress,
|
|
49206
49229
|
seek,
|
|
49207
49230
|
waveformData: waveform_data || []
|
|
49208
49231
|
}
|
|
49209
|
-
))), /* @__PURE__ */
|
|
49232
|
+
))), /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__right-section" }, isPlaying ? /* @__PURE__ */ import_react250.default.createElement(PlaybackRateButton, { disabled: !audioRef.current, onClick: increasePlaybackRate }, playbackRate.toFixed(1), "x") : /* @__PURE__ */ import_react250.default.createElement(FileIcon, { big: true, mimeType: mime_type, size: 40 })));
|
|
49210
49233
|
};
|
|
49211
49234
|
var QuotedVoiceRecording = ({ attachment }) => {
|
|
49212
49235
|
const { t } = useTranslationContext();
|
|
49213
49236
|
const title = attachment.title || t("Voice message");
|
|
49214
|
-
return /* @__PURE__ */
|
|
49237
|
+
return /* @__PURE__ */ import_react250.default.createElement("div", { className: rootClassName, "data-testid": "quoted-voice-recording-widget" }, /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__metadata" }, title && /* @__PURE__ */ import_react250.default.createElement(
|
|
49215
49238
|
"div",
|
|
49216
49239
|
{
|
|
49217
49240
|
className: "str-chat__message-attachment__voice-recording-widget__title",
|
|
@@ -49219,18 +49242,18 @@ var QuotedVoiceRecording = ({ attachment }) => {
|
|
|
49219
49242
|
title
|
|
49220
49243
|
},
|
|
49221
49244
|
title
|
|
49222
|
-
), /* @__PURE__ */
|
|
49245
|
+
), /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__audio-state" }, /* @__PURE__ */ import_react250.default.createElement("div", { className: "str-chat__message-attachment__voice-recording-widget__timer" }, attachment.duration ? displayDuration(attachment.duration) : /* @__PURE__ */ import_react250.default.createElement(
|
|
49223
49246
|
FileSizeIndicator,
|
|
49224
49247
|
{
|
|
49225
49248
|
fileSize: attachment.file_size,
|
|
49226
49249
|
maximumFractionDigits: 0
|
|
49227
49250
|
}
|
|
49228
|
-
)))), /* @__PURE__ */
|
|
49251
|
+
)))), /* @__PURE__ */ import_react250.default.createElement(FileIcon, { big: true, mimeType: attachment.mime_type, size: 34 }));
|
|
49229
49252
|
};
|
|
49230
|
-
var VoiceRecording = ({ attachment, isQuoted }) => isQuoted ? /* @__PURE__ */
|
|
49253
|
+
var VoiceRecording = ({ attachment, isQuoted }) => isQuoted ? /* @__PURE__ */ import_react250.default.createElement(QuotedVoiceRecording, { attachment }) : /* @__PURE__ */ import_react250.default.createElement(VoiceRecordingPlayer, { attachment });
|
|
49231
49254
|
|
|
49232
49255
|
// src/components/Attachment/Card.tsx
|
|
49233
|
-
var
|
|
49256
|
+
var import_react251 = __toESM(require("react"));
|
|
49234
49257
|
var import_clsx64 = __toESM(require("clsx"));
|
|
49235
49258
|
var import_react_player = __toESM(require("react-player"));
|
|
49236
49259
|
var getHostFromURL = (url) => {
|
|
@@ -49242,26 +49265,26 @@ var getHostFromURL = (url) => {
|
|
|
49242
49265
|
};
|
|
49243
49266
|
var UnableToRenderCard = ({ type }) => {
|
|
49244
49267
|
const { t } = useTranslationContext("Card");
|
|
49245
|
-
return /* @__PURE__ */
|
|
49268
|
+
return /* @__PURE__ */ import_react251.default.createElement(
|
|
49246
49269
|
"div",
|
|
49247
49270
|
{
|
|
49248
49271
|
className: (0, import_clsx64.default)("str-chat__message-attachment-card", {
|
|
49249
49272
|
[`str-chat__message-attachment-card--${type}`]: type
|
|
49250
49273
|
})
|
|
49251
49274
|
},
|
|
49252
|
-
/* @__PURE__ */
|
|
49275
|
+
/* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-card--content" }, /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-card--text" }, t("this content could not be displayed")))
|
|
49253
49276
|
);
|
|
49254
49277
|
};
|
|
49255
49278
|
var SourceLink = ({
|
|
49256
49279
|
author_name,
|
|
49257
49280
|
url
|
|
49258
|
-
}) => /* @__PURE__ */
|
|
49281
|
+
}) => /* @__PURE__ */ import_react251.default.createElement(
|
|
49259
49282
|
"div",
|
|
49260
49283
|
{
|
|
49261
49284
|
className: "str-chat__message-attachment-card--source-link",
|
|
49262
49285
|
"data-testid": "card-source-link"
|
|
49263
49286
|
},
|
|
49264
|
-
/* @__PURE__ */
|
|
49287
|
+
/* @__PURE__ */ import_react251.default.createElement(
|
|
49265
49288
|
SafeAnchor,
|
|
49266
49289
|
{
|
|
49267
49290
|
className: "str-chat__message-attachment-card--url",
|
|
@@ -49276,7 +49299,7 @@ var CardHeader3 = (props) => {
|
|
|
49276
49299
|
const { asset_url, dimensions, image: image4, image_url, thumb_url, title, type } = props;
|
|
49277
49300
|
let visual = null;
|
|
49278
49301
|
if (asset_url && type === "video") {
|
|
49279
|
-
visual = /* @__PURE__ */
|
|
49302
|
+
visual = /* @__PURE__ */ import_react251.default.createElement(
|
|
49280
49303
|
import_react_player.default,
|
|
49281
49304
|
{
|
|
49282
49305
|
className: "react-player",
|
|
@@ -49287,7 +49310,7 @@ var CardHeader3 = (props) => {
|
|
|
49287
49310
|
}
|
|
49288
49311
|
);
|
|
49289
49312
|
} else if (image4) {
|
|
49290
|
-
visual = /* @__PURE__ */
|
|
49313
|
+
visual = /* @__PURE__ */ import_react251.default.createElement(
|
|
49291
49314
|
ImageComponent,
|
|
49292
49315
|
{
|
|
49293
49316
|
dimensions,
|
|
@@ -49297,7 +49320,7 @@ var CardHeader3 = (props) => {
|
|
|
49297
49320
|
}
|
|
49298
49321
|
);
|
|
49299
49322
|
}
|
|
49300
|
-
return visual ? /* @__PURE__ */
|
|
49323
|
+
return visual ? /* @__PURE__ */ import_react251.default.createElement(
|
|
49301
49324
|
"div",
|
|
49302
49325
|
{
|
|
49303
49326
|
className: "str-chat__message-attachment-card--header str-chat__message-attachment-card-react--header",
|
|
@@ -49309,7 +49332,7 @@ var CardHeader3 = (props) => {
|
|
|
49309
49332
|
var CardContent = (props) => {
|
|
49310
49333
|
const { author_name, og_scrape_url, text: text8, title, title_link, type } = props;
|
|
49311
49334
|
const url = title_link || og_scrape_url;
|
|
49312
|
-
return /* @__PURE__ */
|
|
49335
|
+
return /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-card--content" }, type === "audio" ? /* @__PURE__ */ import_react251.default.createElement(CardAudio, { og: props }) : /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-card--flex" }, url && /* @__PURE__ */ import_react251.default.createElement(SourceLink, { author_name, url }), title && /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-card--title" }, title), text8 && /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-card--text" }, text8)));
|
|
49313
49336
|
};
|
|
49314
49337
|
var CardAudio = ({
|
|
49315
49338
|
og: { asset_url, author_name, mime_type, og_scrape_url, text: text8, title, title_link }
|
|
@@ -49320,7 +49343,7 @@ var CardAudio = ({
|
|
|
49320
49343
|
const url = title_link || og_scrape_url;
|
|
49321
49344
|
const dataTestId = "card-audio-widget";
|
|
49322
49345
|
const rootClassName2 = "str-chat__message-attachment-card-audio-widget";
|
|
49323
|
-
return /* @__PURE__ */
|
|
49346
|
+
return /* @__PURE__ */ import_react251.default.createElement("div", { className: rootClassName2, "data-testid": dataTestId }, asset_url && /* @__PURE__ */ import_react251.default.createElement(import_react251.default.Fragment, null, /* @__PURE__ */ import_react251.default.createElement("audio", { ref: audioRef }, /* @__PURE__ */ import_react251.default.createElement("source", { "data-testid": "audio-source", src: asset_url, type: "audio/mp3" })), /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-card-audio-widget--first-row" }, /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-audio-widget--play-controls" }, /* @__PURE__ */ import_react251.default.createElement(PlayButton, { isPlaying, onClick: togglePlay })), /* @__PURE__ */ import_react251.default.createElement(ProgressBar, { onClick: seek, progress }))), /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-audio-widget--second-row" }, url && /* @__PURE__ */ import_react251.default.createElement(SourceLink, { author_name, url }), title && /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-audio-widget--title" }, title), text8 && /* @__PURE__ */ import_react251.default.createElement("div", { className: "str-chat__message-attachment-audio-widget--description" }, text8)));
|
|
49324
49347
|
};
|
|
49325
49348
|
var UnMemoizedCard = (props) => {
|
|
49326
49349
|
const { asset_url, giphy, image_url, thumb_url, title, title_link, type } = props;
|
|
@@ -49334,45 +49357,45 @@ var UnMemoizedCard = (props) => {
|
|
|
49334
49357
|
dimensions.width = giphyVersion.width;
|
|
49335
49358
|
}
|
|
49336
49359
|
if (!title && !title_link && !asset_url && !image4) {
|
|
49337
|
-
return /* @__PURE__ */
|
|
49360
|
+
return /* @__PURE__ */ import_react251.default.createElement(UnableToRenderCard, null);
|
|
49338
49361
|
}
|
|
49339
|
-
return /* @__PURE__ */
|
|
49362
|
+
return /* @__PURE__ */ import_react251.default.createElement(
|
|
49340
49363
|
"div",
|
|
49341
49364
|
{
|
|
49342
49365
|
className: `str-chat__message-attachment-card str-chat__message-attachment-card--${type}`
|
|
49343
49366
|
},
|
|
49344
|
-
/* @__PURE__ */
|
|
49345
|
-
/* @__PURE__ */
|
|
49367
|
+
/* @__PURE__ */ import_react251.default.createElement(CardHeader3, { ...props, dimensions, image: image4 }),
|
|
49368
|
+
/* @__PURE__ */ import_react251.default.createElement(CardContent, { ...props })
|
|
49346
49369
|
);
|
|
49347
49370
|
};
|
|
49348
|
-
var Card3 =
|
|
49371
|
+
var Card3 = import_react251.default.memo(UnMemoizedCard);
|
|
49349
49372
|
|
|
49350
49373
|
// src/components/Attachment/FileAttachment.tsx
|
|
49351
|
-
var
|
|
49352
|
-
var UnMemoizedFileAttachment = ({ attachment }) => /* @__PURE__ */
|
|
49374
|
+
var import_react252 = __toESM(require("react"));
|
|
49375
|
+
var UnMemoizedFileAttachment = ({ attachment }) => /* @__PURE__ */ import_react252.default.createElement("div", { className: "str-chat__message-attachment-file--item", "data-testid": "attachment-file" }, /* @__PURE__ */ import_react252.default.createElement(FileIcon, { className: "str-chat__file-icon", mimeType: attachment.mime_type }), /* @__PURE__ */ import_react252.default.createElement("div", { className: "str-chat__message-attachment-file--item-text" }, /* @__PURE__ */ import_react252.default.createElement("div", { className: "str-chat__message-attachment-file--item-first-row" }, /* @__PURE__ */ import_react252.default.createElement(
|
|
49353
49376
|
"div",
|
|
49354
49377
|
{
|
|
49355
49378
|
className: "str-chat__message-attachment-file--item-name",
|
|
49356
49379
|
"data-testid": "file-title"
|
|
49357
49380
|
},
|
|
49358
49381
|
attachment.title
|
|
49359
|
-
), /* @__PURE__ */
|
|
49360
|
-
var FileAttachment =
|
|
49382
|
+
), /* @__PURE__ */ import_react252.default.createElement(DownloadButton, { assetUrl: attachment.asset_url })), /* @__PURE__ */ import_react252.default.createElement(FileSizeIndicator, { fileSize: attachment.file_size })));
|
|
49383
|
+
var FileAttachment = import_react252.default.memo(
|
|
49361
49384
|
UnMemoizedFileAttachment
|
|
49362
49385
|
);
|
|
49363
49386
|
|
|
49364
49387
|
// src/components/Attachment/UnsupportedAttachment.tsx
|
|
49365
|
-
var
|
|
49388
|
+
var import_react253 = __toESM(require("react"));
|
|
49366
49389
|
var UnsupportedAttachment = ({ attachment }) => {
|
|
49367
49390
|
const { t } = useTranslationContext("UnsupportedAttachment");
|
|
49368
|
-
return /* @__PURE__ */
|
|
49391
|
+
return /* @__PURE__ */ import_react253.default.createElement(
|
|
49369
49392
|
"div",
|
|
49370
49393
|
{
|
|
49371
49394
|
className: "str-chat__message-attachment-unsupported",
|
|
49372
49395
|
"data-testid": "attachment-unsupported"
|
|
49373
49396
|
},
|
|
49374
|
-
/* @__PURE__ */
|
|
49375
|
-
/* @__PURE__ */
|
|
49397
|
+
/* @__PURE__ */ import_react253.default.createElement(FileIcon, { className: "str-chat__file-icon" }),
|
|
49398
|
+
/* @__PURE__ */ import_react253.default.createElement("div", { className: "str-chat__message-attachment-unsupported__metadata" }, /* @__PURE__ */ import_react253.default.createElement(
|
|
49376
49399
|
"div",
|
|
49377
49400
|
{
|
|
49378
49401
|
className: "str-chat__message-attachment-unsupported__title",
|
|
@@ -49404,7 +49427,7 @@ var AttachmentWithinContainer = ({
|
|
|
49404
49427
|
"str-chat__message-attachment-with-actions": extra === "actions"
|
|
49405
49428
|
}
|
|
49406
49429
|
);
|
|
49407
|
-
return /* @__PURE__ */
|
|
49430
|
+
return /* @__PURE__ */ import_react254.default.createElement("div", { className: classNames }, children);
|
|
49408
49431
|
};
|
|
49409
49432
|
var AttachmentActionsContainer = ({
|
|
49410
49433
|
actionHandler,
|
|
@@ -49412,7 +49435,7 @@ var AttachmentActionsContainer = ({
|
|
|
49412
49435
|
AttachmentActions: AttachmentActions2 = AttachmentActions
|
|
49413
49436
|
}) => {
|
|
49414
49437
|
if (!attachment.actions?.length) return null;
|
|
49415
|
-
return /* @__PURE__ */
|
|
49438
|
+
return /* @__PURE__ */ import_react254.default.createElement(
|
|
49416
49439
|
AttachmentActions2,
|
|
49417
49440
|
{
|
|
49418
49441
|
...attachment,
|
|
@@ -49443,10 +49466,10 @@ var GalleryContainer = ({
|
|
|
49443
49466
|
attachment,
|
|
49444
49467
|
Gallery: Gallery2 = Gallery
|
|
49445
49468
|
}) => {
|
|
49446
|
-
const imageElements = (0,
|
|
49469
|
+
const imageElements = (0, import_react254.useRef)([]);
|
|
49447
49470
|
const { imageAttachmentSizeHandler } = useChannelStateContext();
|
|
49448
|
-
const [attachmentConfigurations, setAttachmentConfigurations] = (0,
|
|
49449
|
-
(0,
|
|
49471
|
+
const [attachmentConfigurations, setAttachmentConfigurations] = (0, import_react254.useState)([]);
|
|
49472
|
+
(0, import_react254.useLayoutEffect)(() => {
|
|
49450
49473
|
if (imageElements.current && imageElements.current.every((element4) => !!element4) && imageAttachmentSizeHandler) {
|
|
49451
49474
|
const newConfigurations = [];
|
|
49452
49475
|
imageElements.current.forEach((element4, i) => {
|
|
@@ -49463,15 +49486,15 @@ var GalleryContainer = ({
|
|
|
49463
49486
|
attachment.images[i]?.image_url || attachment.images[i]?.thumb_url || ""
|
|
49464
49487
|
)
|
|
49465
49488
|
}));
|
|
49466
|
-
return /* @__PURE__ */
|
|
49489
|
+
return /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType: "gallery" }, /* @__PURE__ */ import_react254.default.createElement(Gallery2, { images: images || [], innerRefs: imageElements, key: "gallery" }));
|
|
49467
49490
|
};
|
|
49468
49491
|
var ImageContainer = (props) => {
|
|
49469
49492
|
const { attachment, Image: Image4 = ImageComponent } = props;
|
|
49470
49493
|
const componentType = "image";
|
|
49471
|
-
const imageElement = (0,
|
|
49494
|
+
const imageElement = (0, import_react254.useRef)(null);
|
|
49472
49495
|
const { imageAttachmentSizeHandler } = useChannelStateContext();
|
|
49473
|
-
const [attachmentConfiguration, setAttachmentConfiguration] = (0,
|
|
49474
|
-
(0,
|
|
49496
|
+
const [attachmentConfiguration, setAttachmentConfiguration] = (0, import_react254.useState)(void 0);
|
|
49497
|
+
(0, import_react254.useLayoutEffect)(() => {
|
|
49475
49498
|
if (imageElement.current && imageAttachmentSizeHandler) {
|
|
49476
49499
|
const config = imageAttachmentSizeHandler(attachment, imageElement.current);
|
|
49477
49500
|
setAttachmentConfiguration(config);
|
|
@@ -49483,41 +49506,41 @@ var ImageContainer = (props) => {
|
|
|
49483
49506
|
style: getCssDimensionsVariables(attachment.image_url || attachment.thumb_url || "")
|
|
49484
49507
|
};
|
|
49485
49508
|
if (attachment.actions && attachment.actions.length) {
|
|
49486
|
-
return /* @__PURE__ */
|
|
49509
|
+
return /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react254.default.createElement("div", { className: "str-chat__attachment" }, /* @__PURE__ */ import_react254.default.createElement(Image4, { ...imageConfig, innerRef: imageElement }), /* @__PURE__ */ import_react254.default.createElement(AttachmentActionsContainer, { ...props })));
|
|
49487
49510
|
}
|
|
49488
|
-
return /* @__PURE__ */
|
|
49511
|
+
return /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react254.default.createElement(Image4, { ...imageConfig, innerRef: imageElement }));
|
|
49489
49512
|
};
|
|
49490
49513
|
var CardContainer = (props) => {
|
|
49491
49514
|
const { attachment, Card: Card4 = Card3 } = props;
|
|
49492
49515
|
const componentType = "card";
|
|
49493
49516
|
if (attachment.actions && attachment.actions.length) {
|
|
49494
|
-
return /* @__PURE__ */
|
|
49517
|
+
return /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react254.default.createElement("div", { className: "str-chat__attachment" }, /* @__PURE__ */ import_react254.default.createElement(Card4, { ...attachment }), /* @__PURE__ */ import_react254.default.createElement(AttachmentActionsContainer, { ...props })));
|
|
49495
49518
|
}
|
|
49496
|
-
return /* @__PURE__ */
|
|
49519
|
+
return /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react254.default.createElement(Card4, { ...attachment }));
|
|
49497
49520
|
};
|
|
49498
49521
|
var FileContainer = ({
|
|
49499
49522
|
attachment,
|
|
49500
49523
|
File: File2 = FileAttachment
|
|
49501
49524
|
}) => {
|
|
49502
49525
|
if (!attachment.asset_url) return null;
|
|
49503
|
-
return /* @__PURE__ */
|
|
49526
|
+
return /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType: "file" }, /* @__PURE__ */ import_react254.default.createElement(File2, { attachment }));
|
|
49504
49527
|
};
|
|
49505
49528
|
var AudioContainer = ({
|
|
49506
49529
|
attachment,
|
|
49507
49530
|
Audio: Audio2 = Audio
|
|
49508
|
-
}) => /* @__PURE__ */
|
|
49531
|
+
}) => /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType: "audio" }, /* @__PURE__ */ import_react254.default.createElement("div", { className: "str-chat__attachment" }, /* @__PURE__ */ import_react254.default.createElement(Audio2, { og: attachment })));
|
|
49509
49532
|
var VoiceRecordingContainer = ({
|
|
49510
49533
|
attachment,
|
|
49511
49534
|
isQuoted,
|
|
49512
49535
|
VoiceRecording: VoiceRecording2 = VoiceRecording
|
|
49513
|
-
}) => /* @__PURE__ */
|
|
49536
|
+
}) => /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType: "voiceRecording" }, /* @__PURE__ */ import_react254.default.createElement("div", { className: "str-chat__attachment" }, /* @__PURE__ */ import_react254.default.createElement(VoiceRecording2, { attachment, isQuoted })));
|
|
49514
49537
|
var MediaContainer = (props) => {
|
|
49515
49538
|
const { attachment, Media = import_react_player2.default } = props;
|
|
49516
49539
|
const componentType = "media";
|
|
49517
49540
|
const { shouldGenerateVideoThumbnail, videoAttachmentSizeHandler } = useChannelStateContext();
|
|
49518
|
-
const videoElement = (0,
|
|
49519
|
-
const [attachmentConfiguration, setAttachmentConfiguration] = (0,
|
|
49520
|
-
(0,
|
|
49541
|
+
const videoElement = (0, import_react254.useRef)(null);
|
|
49542
|
+
const [attachmentConfiguration, setAttachmentConfiguration] = (0, import_react254.useState)();
|
|
49543
|
+
(0, import_react254.useLayoutEffect)(() => {
|
|
49521
49544
|
if (videoElement.current && videoAttachmentSizeHandler) {
|
|
49522
49545
|
const config = videoAttachmentSizeHandler(
|
|
49523
49546
|
attachment,
|
|
@@ -49527,7 +49550,7 @@ var MediaContainer = (props) => {
|
|
|
49527
49550
|
setAttachmentConfiguration(config);
|
|
49528
49551
|
}
|
|
49529
49552
|
}, [videoElement, videoAttachmentSizeHandler, attachment]);
|
|
49530
|
-
const content3 = /* @__PURE__ */
|
|
49553
|
+
const content3 = /* @__PURE__ */ import_react254.default.createElement(
|
|
49531
49554
|
"div",
|
|
49532
49555
|
{
|
|
49533
49556
|
className: "str-chat__player-wrapper",
|
|
@@ -49535,7 +49558,7 @@ var MediaContainer = (props) => {
|
|
|
49535
49558
|
ref: videoElement,
|
|
49536
49559
|
style: getCssDimensionsVariables(attachment.thumb_url || "")
|
|
49537
49560
|
},
|
|
49538
|
-
/* @__PURE__ */
|
|
49561
|
+
/* @__PURE__ */ import_react254.default.createElement(
|
|
49539
49562
|
Media,
|
|
49540
49563
|
{
|
|
49541
49564
|
className: "react-player",
|
|
@@ -49547,12 +49570,12 @@ var MediaContainer = (props) => {
|
|
|
49547
49570
|
}
|
|
49548
49571
|
)
|
|
49549
49572
|
);
|
|
49550
|
-
return attachment.actions?.length ? /* @__PURE__ */
|
|
49573
|
+
return attachment.actions?.length ? /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType }, /* @__PURE__ */ import_react254.default.createElement("div", { className: "str-chat__attachment" }, content3, /* @__PURE__ */ import_react254.default.createElement(AttachmentActionsContainer, { ...props }))) : /* @__PURE__ */ import_react254.default.createElement(AttachmentWithinContainer, { attachment, componentType }, content3);
|
|
49551
49574
|
};
|
|
49552
49575
|
var UnsupportedAttachmentContainer = ({
|
|
49553
49576
|
attachment,
|
|
49554
49577
|
UnsupportedAttachment: UnsupportedAttachment2 = UnsupportedAttachment
|
|
49555
|
-
}) => /* @__PURE__ */
|
|
49578
|
+
}) => /* @__PURE__ */ import_react254.default.createElement(import_react254.default.Fragment, null, /* @__PURE__ */ import_react254.default.createElement(UnsupportedAttachment2, { attachment }));
|
|
49556
49579
|
|
|
49557
49580
|
// src/components/Attachment/Attachment.tsx
|
|
49558
49581
|
var CONTAINER_MAP = {
|
|
@@ -49575,12 +49598,12 @@ var ATTACHMENT_GROUPS_ORDER = [
|
|
|
49575
49598
|
];
|
|
49576
49599
|
var Attachment = (props) => {
|
|
49577
49600
|
const { attachments } = props;
|
|
49578
|
-
const groupedAttachments = (0,
|
|
49601
|
+
const groupedAttachments = (0, import_react255.useMemo)(
|
|
49579
49602
|
() => renderGroupedAttachments(props),
|
|
49580
49603
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49581
49604
|
[attachments]
|
|
49582
49605
|
);
|
|
49583
|
-
return /* @__PURE__ */
|
|
49606
|
+
return /* @__PURE__ */ import_react255.default.createElement("div", { className: "str-chat__attachment-list" }, ATTACHMENT_GROUPS_ORDER.reduce(
|
|
49584
49607
|
(acc, groupName) => [...acc, ...groupedAttachments[groupName]],
|
|
49585
49608
|
[]
|
|
49586
49609
|
));
|
|
@@ -49590,14 +49613,14 @@ var renderGroupedAttachments = ({
|
|
|
49590
49613
|
...rest
|
|
49591
49614
|
}) => {
|
|
49592
49615
|
const uploadedImages = attachments.filter(
|
|
49593
|
-
(attachment) => (0,
|
|
49616
|
+
(attachment) => (0, import_stream_chat11.isImageAttachment)(attachment)
|
|
49594
49617
|
);
|
|
49595
|
-
const containers = attachments.filter((attachment) => !(0,
|
|
49618
|
+
const containers = attachments.filter((attachment) => !(0, import_stream_chat11.isImageAttachment)(attachment)).reduce(
|
|
49596
49619
|
(typeMap, attachment) => {
|
|
49597
49620
|
const attachmentType = getAttachmentType(attachment);
|
|
49598
49621
|
const Container = CONTAINER_MAP[attachmentType];
|
|
49599
49622
|
typeMap[attachmentType].push(
|
|
49600
|
-
/* @__PURE__ */
|
|
49623
|
+
/* @__PURE__ */ import_react255.default.createElement(
|
|
49601
49624
|
Container,
|
|
49602
49625
|
{
|
|
49603
49626
|
key: `${attachmentType}-${typeMap[attachmentType].length}`,
|
|
@@ -49624,7 +49647,7 @@ var renderGroupedAttachments = ({
|
|
|
49624
49647
|
);
|
|
49625
49648
|
if (uploadedImages.length > 1) {
|
|
49626
49649
|
containers["gallery"] = [
|
|
49627
|
-
/* @__PURE__ */
|
|
49650
|
+
/* @__PURE__ */ import_react255.default.createElement(
|
|
49628
49651
|
GalleryContainer,
|
|
49629
49652
|
{
|
|
49630
49653
|
key: "gallery-container",
|
|
@@ -49638,33 +49661,33 @@ var renderGroupedAttachments = ({
|
|
|
49638
49661
|
];
|
|
49639
49662
|
} else if (uploadedImages.length === 1) {
|
|
49640
49663
|
containers["image"] = [
|
|
49641
|
-
/* @__PURE__ */
|
|
49664
|
+
/* @__PURE__ */ import_react255.default.createElement(ImageContainer, { key: "image-container", ...rest, attachment: uploadedImages[0] })
|
|
49642
49665
|
];
|
|
49643
49666
|
}
|
|
49644
49667
|
return containers;
|
|
49645
49668
|
};
|
|
49646
49669
|
var getAttachmentType = (attachment) => {
|
|
49647
|
-
if ((0,
|
|
49670
|
+
if ((0, import_stream_chat11.isScrapedContent)(attachment)) {
|
|
49648
49671
|
return "card";
|
|
49649
|
-
} else if ((0,
|
|
49672
|
+
} else if ((0, import_stream_chat11.isVideoAttachment)(attachment, SUPPORTED_VIDEO_FORMATS)) {
|
|
49650
49673
|
return "media";
|
|
49651
|
-
} else if ((0,
|
|
49674
|
+
} else if ((0, import_stream_chat11.isAudioAttachment)(attachment)) {
|
|
49652
49675
|
return "audio";
|
|
49653
|
-
} else if ((0,
|
|
49676
|
+
} else if ((0, import_stream_chat11.isVoiceRecordingAttachment)(attachment)) {
|
|
49654
49677
|
return "voiceRecording";
|
|
49655
|
-
} else if ((0,
|
|
49678
|
+
} else if ((0, import_stream_chat11.isFileAttachment)(attachment, SUPPORTED_VIDEO_FORMATS)) {
|
|
49656
49679
|
return "file";
|
|
49657
49680
|
}
|
|
49658
49681
|
return "unsupported";
|
|
49659
49682
|
};
|
|
49660
49683
|
|
|
49661
49684
|
// src/components/Channel/Channel.tsx
|
|
49662
|
-
var
|
|
49685
|
+
var import_react261 = __toESM(require("react"));
|
|
49663
49686
|
var import_clsx66 = __toESM(require("clsx"));
|
|
49664
|
-
var
|
|
49665
|
-
var
|
|
49666
|
-
var
|
|
49667
|
-
var
|
|
49687
|
+
var import_lodash20 = __toESM(require("lodash.debounce"));
|
|
49688
|
+
var import_lodash21 = __toESM(require("lodash.defaultsdeep"));
|
|
49689
|
+
var import_lodash22 = __toESM(require("lodash.throttle"));
|
|
49690
|
+
var import_stream_chat12 = require("stream-chat");
|
|
49668
49691
|
|
|
49669
49692
|
// src/components/Channel/channelState.ts
|
|
49670
49693
|
var makeChannelReducer = () => (state, action) => {
|
|
@@ -49840,7 +49863,7 @@ var initialState = {
|
|
|
49840
49863
|
};
|
|
49841
49864
|
|
|
49842
49865
|
// src/components/Channel/hooks/useCreateChannelStateContext.ts
|
|
49843
|
-
var
|
|
49866
|
+
var import_react256 = require("react");
|
|
49844
49867
|
var useCreateChannelStateContext = (value) => {
|
|
49845
49868
|
const {
|
|
49846
49869
|
channel,
|
|
@@ -49899,7 +49922,7 @@ var useCreateChannelStateContext = (value) => {
|
|
|
49899
49922
|
const memoizedThreadMessageData = threadMessages.map(
|
|
49900
49923
|
({ 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}`
|
|
49901
49924
|
).join();
|
|
49902
|
-
const channelStateContext = (0,
|
|
49925
|
+
const channelStateContext = (0, import_react256.useMemo)(
|
|
49903
49926
|
() => ({
|
|
49904
49927
|
channel,
|
|
49905
49928
|
channelCapabilities,
|
|
@@ -49963,11 +49986,11 @@ var useCreateChannelStateContext = (value) => {
|
|
|
49963
49986
|
};
|
|
49964
49987
|
|
|
49965
49988
|
// src/components/Channel/hooks/useCreateTypingContext.ts
|
|
49966
|
-
var
|
|
49989
|
+
var import_react257 = require("react");
|
|
49967
49990
|
var useCreateTypingContext = (value) => {
|
|
49968
49991
|
const { typing } = value;
|
|
49969
49992
|
const typingValue = Object.keys(typing || {}).join();
|
|
49970
|
-
const typingContext = (0,
|
|
49993
|
+
const typingContext = (0, import_react257.useMemo)(
|
|
49971
49994
|
() => ({
|
|
49972
49995
|
typing
|
|
49973
49996
|
}),
|
|
@@ -49991,10 +50014,10 @@ var useEditMessageHandler = (doUpdateMessageRequest) => {
|
|
|
49991
50014
|
};
|
|
49992
50015
|
|
|
49993
50016
|
// src/components/Channel/hooks/useIsMounted.ts
|
|
49994
|
-
var
|
|
50017
|
+
var import_react258 = require("react");
|
|
49995
50018
|
var useIsMounted = () => {
|
|
49996
|
-
const isMounted = (0,
|
|
49997
|
-
(0,
|
|
50019
|
+
const isMounted = (0, import_react258.useRef)(false);
|
|
50020
|
+
(0, import_react258.useEffect)(() => {
|
|
49998
50021
|
isMounted.current = true;
|
|
49999
50022
|
return () => {
|
|
50000
50023
|
isMounted.current = false;
|
|
@@ -50004,8 +50027,8 @@ var useIsMounted = () => {
|
|
|
50004
50027
|
};
|
|
50005
50028
|
|
|
50006
50029
|
// src/components/Channel/hooks/useMentionsHandlers.ts
|
|
50007
|
-
var
|
|
50008
|
-
var useMentionsHandlers = (onMentionsHover, onMentionsClick) => (0,
|
|
50030
|
+
var import_react259 = require("react");
|
|
50031
|
+
var useMentionsHandlers = (onMentionsHover, onMentionsClick) => (0, import_react259.useCallback)(
|
|
50009
50032
|
(event, mentioned_users) => {
|
|
50010
50033
|
if (!onMentionsHover && !onMentionsClick || !(event.target instanceof HTMLElement)) {
|
|
50011
50034
|
return;
|
|
@@ -50029,11 +50052,11 @@ var useMentionsHandlers = (onMentionsHover, onMentionsClick) => (0, import_react
|
|
|
50029
50052
|
);
|
|
50030
50053
|
|
|
50031
50054
|
// src/components/Channel/LoadingChannel.tsx
|
|
50032
|
-
var
|
|
50033
|
-
var LoadingMessage = () => /* @__PURE__ */
|
|
50034
|
-
var LoadingMessageInput = () => /* @__PURE__ */
|
|
50035
|
-
var LoadingChannelHeader = () => /* @__PURE__ */
|
|
50036
|
-
var LoadingChannel = () => /* @__PURE__ */
|
|
50055
|
+
var import_react260 = __toESM(require("react"));
|
|
50056
|
+
var LoadingMessage = () => /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message" }, /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-avatar" }), /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-end" }, /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-sender" }), /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-last-row" }, /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-text" }), /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-date" }))));
|
|
50057
|
+
var LoadingMessageInput = () => /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-input-row" }, /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-input" }), /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-send" }));
|
|
50058
|
+
var LoadingChannelHeader = () => /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-header" }, /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-header-avatar" }), /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-header-end" }, /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-header-name" }), /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-header-info" })));
|
|
50059
|
+
var LoadingChannel = () => /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel" }, /* @__PURE__ */ import_react260.default.createElement(LoadingChannelHeader, null), /* @__PURE__ */ import_react260.default.createElement("div", { className: "str-chat__loading-channel-message-list" }, Array.from(Array(3)).map((_, i) => /* @__PURE__ */ import_react260.default.createElement(LoadingMessage, { key: `loading-message-${i}` }))), /* @__PURE__ */ import_react260.default.createElement(LoadingMessageInput, null));
|
|
50037
50060
|
|
|
50038
50061
|
// src/components/Channel/hooks/useChannelContainerClasses.ts
|
|
50039
50062
|
var useImageFlagEmojisOnWindowsClass = () => {
|
|
@@ -50220,7 +50243,7 @@ var ChannelContainer = ({
|
|
|
50220
50243
|
customClasses
|
|
50221
50244
|
});
|
|
50222
50245
|
const className = (0, import_clsx66.default)(chatClass, theme, channelClass, additionalClassName);
|
|
50223
|
-
return /* @__PURE__ */
|
|
50246
|
+
return /* @__PURE__ */ import_react261.default.createElement("div", { id: CHANNEL_CONTAINER_ID, ...props, className }, children);
|
|
50224
50247
|
};
|
|
50225
50248
|
var UnMemoizedChannel = (props) => {
|
|
50226
50249
|
const {
|
|
@@ -50232,15 +50255,15 @@ var UnMemoizedChannel = (props) => {
|
|
|
50232
50255
|
const { channel: contextChannel, channelsQueryState } = useChatContext("Channel");
|
|
50233
50256
|
const channel = propsChannel || contextChannel;
|
|
50234
50257
|
if (channelsQueryState.queryInProgress === "reload" && LoadingIndicator2) {
|
|
50235
|
-
return /* @__PURE__ */
|
|
50258
|
+
return /* @__PURE__ */ import_react261.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react261.default.createElement(LoadingIndicator2, null));
|
|
50236
50259
|
}
|
|
50237
50260
|
if (channelsQueryState.error && LoadingErrorIndicator2) {
|
|
50238
|
-
return /* @__PURE__ */
|
|
50261
|
+
return /* @__PURE__ */ import_react261.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react261.default.createElement(LoadingErrorIndicator2, { error: channelsQueryState.error }));
|
|
50239
50262
|
}
|
|
50240
50263
|
if (!channel?.cid) {
|
|
50241
|
-
return /* @__PURE__ */
|
|
50264
|
+
return /* @__PURE__ */ import_react261.default.createElement(ChannelContainer, null, EmptyPlaceholder2);
|
|
50242
50265
|
}
|
|
50243
|
-
return /* @__PURE__ */
|
|
50266
|
+
return /* @__PURE__ */ import_react261.default.createElement(ChannelInner, { ...props, channel, key: channel.cid });
|
|
50244
50267
|
};
|
|
50245
50268
|
var ChannelInner = (props) => {
|
|
50246
50269
|
const {
|
|
@@ -50260,8 +50283,8 @@ var ChannelInner = (props) => {
|
|
|
50260
50283
|
onMentionsHover,
|
|
50261
50284
|
skipMessageDataMemoization
|
|
50262
50285
|
} = props;
|
|
50263
|
-
const channelQueryOptions = (0,
|
|
50264
|
-
() => (0,
|
|
50286
|
+
const channelQueryOptions = (0, import_react261.useMemo)(
|
|
50287
|
+
() => (0, import_lodash21.default)(propChannelQueryOptions, {
|
|
50265
50288
|
messages: { limit: DEFAULT_INITIAL_CHANNEL_PAGE_SIZE }
|
|
50266
50289
|
}),
|
|
50267
50290
|
[propChannelQueryOptions]
|
|
@@ -50271,12 +50294,12 @@ var ChannelInner = (props) => {
|
|
|
50271
50294
|
const chatContainerClass = getChatContainerClass(customClasses?.chatContainer);
|
|
50272
50295
|
const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();
|
|
50273
50296
|
const thread = useThreadContext();
|
|
50274
|
-
const [channelConfig, setChannelConfig] = (0,
|
|
50275
|
-
const [notifications, setNotifications] = (0,
|
|
50276
|
-
const notificationTimeouts = (0,
|
|
50277
|
-
const [channelUnreadUiState, _setChannelUnreadUiState] = (0,
|
|
50278
|
-
const channelReducer = (0,
|
|
50279
|
-
const [state, dispatch] = (0,
|
|
50297
|
+
const [channelConfig, setChannelConfig] = (0, import_react261.useState)(channel.getConfig());
|
|
50298
|
+
const [notifications, setNotifications] = (0, import_react261.useState)([]);
|
|
50299
|
+
const notificationTimeouts = (0, import_react261.useRef)([]);
|
|
50300
|
+
const [channelUnreadUiState, _setChannelUnreadUiState] = (0, import_react261.useState)();
|
|
50301
|
+
const channelReducer = (0, import_react261.useMemo)(() => makeChannelReducer(), []);
|
|
50302
|
+
const [state, dispatch] = (0, import_react261.useReducer)(
|
|
50280
50303
|
channelReducer,
|
|
50281
50304
|
// channel.initialized === false if client.channel().query() was not called, e.g. ChannelList is not used
|
|
50282
50305
|
// => Channel will call channel.watch() in useLayoutEffect => state.loading is used to signal the watch() call state
|
|
@@ -50288,14 +50311,14 @@ var ChannelInner = (props) => {
|
|
|
50288
50311
|
);
|
|
50289
50312
|
const jumpToMessageFromSearch = useSearchFocusedMessage();
|
|
50290
50313
|
const isMounted = useIsMounted();
|
|
50291
|
-
const originalTitle = (0,
|
|
50292
|
-
const lastRead = (0,
|
|
50293
|
-
const online = (0,
|
|
50294
|
-
const clearHighlightedMessageTimeoutId = (0,
|
|
50314
|
+
const originalTitle = (0, import_react261.useRef)("");
|
|
50315
|
+
const lastRead = (0, import_react261.useRef)(void 0);
|
|
50316
|
+
const online = (0, import_react261.useRef)(true);
|
|
50317
|
+
const clearHighlightedMessageTimeoutId = (0, import_react261.useRef)(
|
|
50295
50318
|
null
|
|
50296
50319
|
);
|
|
50297
50320
|
const channelCapabilitiesArray = channel.data?.own_capabilities;
|
|
50298
|
-
const throttledCopyStateFromChannel = (0,
|
|
50321
|
+
const throttledCopyStateFromChannel = (0, import_lodash22.default)(
|
|
50299
50322
|
() => dispatch({ channel, type: "copyStateFromChannelOnEvent" }),
|
|
50300
50323
|
500,
|
|
50301
50324
|
{
|
|
@@ -50303,15 +50326,15 @@ var ChannelInner = (props) => {
|
|
|
50303
50326
|
trailing: true
|
|
50304
50327
|
}
|
|
50305
50328
|
);
|
|
50306
|
-
const setChannelUnreadUiState = (0,
|
|
50307
|
-
() => (0,
|
|
50329
|
+
const setChannelUnreadUiState = (0, import_react261.useMemo)(
|
|
50330
|
+
() => (0, import_lodash22.default)(_setChannelUnreadUiState, 200, {
|
|
50308
50331
|
leading: true,
|
|
50309
50332
|
trailing: false
|
|
50310
50333
|
}),
|
|
50311
50334
|
[]
|
|
50312
50335
|
);
|
|
50313
|
-
const markRead = (0,
|
|
50314
|
-
() => (0,
|
|
50336
|
+
const markRead = (0, import_react261.useMemo)(
|
|
50337
|
+
() => (0, import_lodash22.default)(
|
|
50315
50338
|
async (options) => {
|
|
50316
50339
|
const { updateChannelUiUnreadState = true } = options ?? {};
|
|
50317
50340
|
if (channel.disconnected || !channelConfig?.read_events) {
|
|
@@ -50413,7 +50436,7 @@ var ChannelInner = (props) => {
|
|
|
50413
50436
|
}
|
|
50414
50437
|
throttledCopyStateFromChannel();
|
|
50415
50438
|
};
|
|
50416
|
-
(0,
|
|
50439
|
+
(0, import_react261.useLayoutEffect)(() => {
|
|
50417
50440
|
let errored = false;
|
|
50418
50441
|
let done = false;
|
|
50419
50442
|
(async () => {
|
|
@@ -50479,12 +50502,12 @@ var ChannelInner = (props) => {
|
|
|
50479
50502
|
channelConfig?.read_events,
|
|
50480
50503
|
initializeOnMount
|
|
50481
50504
|
]);
|
|
50482
|
-
(0,
|
|
50505
|
+
(0, import_react261.useEffect)(() => {
|
|
50483
50506
|
if (!state.thread) return;
|
|
50484
50507
|
const message = state.messages?.find((m) => m.id === state.thread?.id);
|
|
50485
50508
|
if (message) dispatch({ message, type: "setThread" });
|
|
50486
50509
|
}, [state.messages, state.thread]);
|
|
50487
|
-
const handleHighlightedMessageChange = (0,
|
|
50510
|
+
const handleHighlightedMessageChange = (0, import_react261.useCallback)(
|
|
50488
50511
|
({
|
|
50489
50512
|
highlightDuration,
|
|
50490
50513
|
highlightedMessageId
|
|
@@ -50507,16 +50530,16 @@ var ChannelInner = (props) => {
|
|
|
50507
50530
|
},
|
|
50508
50531
|
[channel, searchController]
|
|
50509
50532
|
);
|
|
50510
|
-
(0,
|
|
50533
|
+
(0, import_react261.useEffect)(() => {
|
|
50511
50534
|
if (!jumpToMessageFromSearch?.id) return;
|
|
50512
50535
|
handleHighlightedMessageChange({ highlightedMessageId: jumpToMessageFromSearch.id });
|
|
50513
50536
|
}, [jumpToMessageFromSearch, handleHighlightedMessageChange]);
|
|
50514
|
-
const addNotification = (0,
|
|
50537
|
+
const addNotification = (0, import_react261.useMemo)(
|
|
50515
50538
|
() => makeAddNotifications(setNotifications, notificationTimeouts.current),
|
|
50516
50539
|
[]
|
|
50517
50540
|
);
|
|
50518
|
-
const loadMoreFinished = (0,
|
|
50519
|
-
(0,
|
|
50541
|
+
const loadMoreFinished = (0, import_react261.useCallback)(
|
|
50542
|
+
(0, import_lodash20.default)(
|
|
50520
50543
|
(hasMore, messages) => {
|
|
50521
50544
|
if (!isMounted.current) return;
|
|
50522
50545
|
dispatch({ hasMore, messages, type: "loadMoreFinished" });
|
|
@@ -50576,7 +50599,7 @@ var ChannelInner = (props) => {
|
|
|
50576
50599
|
});
|
|
50577
50600
|
return queryResponse.messages.length;
|
|
50578
50601
|
};
|
|
50579
|
-
const jumpToMessage = (0,
|
|
50602
|
+
const jumpToMessage = (0, import_react261.useCallback)(
|
|
50580
50603
|
async (messageId, messageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
|
|
50581
50604
|
dispatch({ loadingMore: true, type: "setLoadingMore" });
|
|
50582
50605
|
await channel.state.loadMessageIntoState(messageId, void 0, messageLimit);
|
|
@@ -50588,14 +50611,14 @@ var ChannelInner = (props) => {
|
|
|
50588
50611
|
},
|
|
50589
50612
|
[channel, handleHighlightedMessageChange, loadMoreFinished]
|
|
50590
50613
|
);
|
|
50591
|
-
const jumpToLatestMessage = (0,
|
|
50614
|
+
const jumpToLatestMessage = (0, import_react261.useCallback)(async () => {
|
|
50592
50615
|
await channel.state.loadMessageIntoState("latest");
|
|
50593
50616
|
loadMoreFinished(channel.state.messagePagination.hasPrev, channel.state.messages);
|
|
50594
50617
|
dispatch({
|
|
50595
50618
|
type: "jumpToLatestMessage"
|
|
50596
50619
|
});
|
|
50597
50620
|
}, [channel, loadMoreFinished]);
|
|
50598
|
-
const jumpToFirstUnreadMessage = (0,
|
|
50621
|
+
const jumpToFirstUnreadMessage = (0, import_react261.useCallback)(
|
|
50599
50622
|
async (queryMessageLimit = DEFAULT_JUMP_TO_PAGE_SIZE, highlightDuration = DEFAULT_HIGHLIGHT_DURATION) => {
|
|
50600
50623
|
if (!channelUnreadUiState?.unread_messages) return;
|
|
50601
50624
|
let lastReadMessageId = channelUnreadUiState?.last_read_message_id;
|
|
@@ -50718,7 +50741,7 @@ var ChannelInner = (props) => {
|
|
|
50718
50741
|
channelUnreadUiState
|
|
50719
50742
|
]
|
|
50720
50743
|
);
|
|
50721
|
-
const deleteMessage = (0,
|
|
50744
|
+
const deleteMessage = (0, import_react261.useCallback)(
|
|
50722
50745
|
async (message) => {
|
|
50723
50746
|
if (!message?.id) {
|
|
50724
50747
|
throw new Error("Cannot delete a message - missing message ID.");
|
|
@@ -50817,7 +50840,7 @@ var ChannelInner = (props) => {
|
|
|
50817
50840
|
});
|
|
50818
50841
|
await doSendMessage({
|
|
50819
50842
|
localMessage,
|
|
50820
|
-
message: (0,
|
|
50843
|
+
message: (0, import_stream_chat12.localMessageToNewMessagePayload)(localMessage)
|
|
50821
50844
|
});
|
|
50822
50845
|
};
|
|
50823
50846
|
const removeMessage = (message) => {
|
|
@@ -50836,8 +50859,8 @@ var ChannelInner = (props) => {
|
|
|
50836
50859
|
event?.preventDefault();
|
|
50837
50860
|
dispatch({ type: "closeThread" });
|
|
50838
50861
|
};
|
|
50839
|
-
const loadMoreThreadFinished = (0,
|
|
50840
|
-
(0,
|
|
50862
|
+
const loadMoreThreadFinished = (0, import_react261.useCallback)(
|
|
50863
|
+
(0, import_lodash20.default)(
|
|
50841
50864
|
(threadHasMore, threadMessages) => {
|
|
50842
50865
|
dispatch({
|
|
50843
50866
|
threadHasMore,
|
|
@@ -50891,7 +50914,7 @@ var ChannelInner = (props) => {
|
|
|
50891
50914
|
videoAttachmentSizeHandler: props.videoAttachmentSizeHandler || getVideoAttachmentConfiguration,
|
|
50892
50915
|
watcher_count: state.watcherCount
|
|
50893
50916
|
});
|
|
50894
|
-
const channelActionContextValue = (0,
|
|
50917
|
+
const channelActionContextValue = (0, import_react261.useMemo)(
|
|
50895
50918
|
() => ({
|
|
50896
50919
|
addNotification,
|
|
50897
50920
|
closeThread,
|
|
@@ -50928,7 +50951,7 @@ var ChannelInner = (props) => {
|
|
|
50928
50951
|
setChannelUnreadUiState
|
|
50929
50952
|
]
|
|
50930
50953
|
);
|
|
50931
|
-
const componentContextValue = (0,
|
|
50954
|
+
const componentContextValue = (0, import_react261.useMemo)(
|
|
50932
50955
|
() => ({
|
|
50933
50956
|
Attachment: props.Attachment,
|
|
50934
50957
|
AttachmentPreviewList: props.AttachmentPreviewList,
|
|
@@ -50982,6 +51005,7 @@ var ChannelInner = (props) => {
|
|
|
50982
51005
|
StartRecordingAudioButton: props.StartRecordingAudioButton,
|
|
50983
51006
|
StopAIGenerationButton: props.StopAIGenerationButton,
|
|
50984
51007
|
StreamedMessageText: props.StreamedMessageText,
|
|
51008
|
+
TextareaComposer: props.TextareaComposer,
|
|
50985
51009
|
ThreadHead: props.ThreadHead,
|
|
50986
51010
|
ThreadHeader: props.ThreadHeader,
|
|
50987
51011
|
ThreadStart: props.ThreadStart,
|
|
@@ -51044,6 +51068,7 @@ var ChannelInner = (props) => {
|
|
|
51044
51068
|
props.StartRecordingAudioButton,
|
|
51045
51069
|
props.StopAIGenerationButton,
|
|
51046
51070
|
props.StreamedMessageText,
|
|
51071
|
+
props.TextareaComposer,
|
|
51047
51072
|
props.ThreadHead,
|
|
51048
51073
|
props.ThreadHeader,
|
|
51049
51074
|
props.ThreadStart,
|
|
@@ -51058,26 +51083,26 @@ var ChannelInner = (props) => {
|
|
|
51058
51083
|
typing
|
|
51059
51084
|
});
|
|
51060
51085
|
if (state.error) {
|
|
51061
|
-
return /* @__PURE__ */
|
|
51086
|
+
return /* @__PURE__ */ import_react261.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react261.default.createElement(LoadingErrorIndicator2, { error: state.error }));
|
|
51062
51087
|
}
|
|
51063
51088
|
if (state.loading) {
|
|
51064
|
-
return /* @__PURE__ */
|
|
51089
|
+
return /* @__PURE__ */ import_react261.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react261.default.createElement(LoadingIndicator2, null));
|
|
51065
51090
|
}
|
|
51066
51091
|
if (!channel.watch) {
|
|
51067
|
-
return /* @__PURE__ */
|
|
51092
|
+
return /* @__PURE__ */ import_react261.default.createElement(ChannelContainer, null, /* @__PURE__ */ import_react261.default.createElement("div", null, t("Channel Missing")));
|
|
51068
51093
|
}
|
|
51069
|
-
return /* @__PURE__ */
|
|
51094
|
+
return /* @__PURE__ */ import_react261.default.createElement(ChannelContainer, { className: windowsEmojiClass }, /* @__PURE__ */ import_react261.default.createElement(ChannelStateProvider, { value: channelStateContextValue }, /* @__PURE__ */ import_react261.default.createElement(ChannelActionProvider, { value: channelActionContextValue }, /* @__PURE__ */ import_react261.default.createElement(WithComponents, { overrides: componentContextValue }, /* @__PURE__ */ import_react261.default.createElement(TypingProvider, { value: typingContextValue }, /* @__PURE__ */ import_react261.default.createElement("div", { className: (0, import_clsx66.default)(chatContainerClass) }, children))))));
|
|
51070
51095
|
};
|
|
51071
|
-
var Channel =
|
|
51096
|
+
var Channel = import_react261.default.memo(UnMemoizedChannel);
|
|
51072
51097
|
|
|
51073
51098
|
// src/components/ChannelHeader/ChannelHeader.tsx
|
|
51074
|
-
var
|
|
51099
|
+
var import_react263 = __toESM(require("react"));
|
|
51075
51100
|
|
|
51076
51101
|
// src/components/ChannelHeader/icons.tsx
|
|
51077
|
-
var
|
|
51102
|
+
var import_react262 = __toESM(require("react"));
|
|
51078
51103
|
var MenuIcon2 = ({ title }) => {
|
|
51079
51104
|
const { t } = useTranslationContext("MenuIcon");
|
|
51080
|
-
return /* @__PURE__ */
|
|
51105
|
+
return /* @__PURE__ */ import_react262.default.createElement("svg", { "data-testid": "menu-icon", viewBox: "0 0 448 512", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react262.default.createElement("title", null, title ?? t("Menu")), /* @__PURE__ */ import_react262.default.createElement(
|
|
51081
51106
|
"path",
|
|
51082
51107
|
{
|
|
51083
51108
|
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",
|
|
@@ -51104,15 +51129,15 @@ var ChannelHeader = (props) => {
|
|
|
51104
51129
|
overrideTitle
|
|
51105
51130
|
});
|
|
51106
51131
|
const { member_count, subtitle } = channel?.data || {};
|
|
51107
|
-
return /* @__PURE__ */
|
|
51132
|
+
return /* @__PURE__ */ import_react263.default.createElement("div", { className: "str-chat__channel-header" }, /* @__PURE__ */ import_react263.default.createElement(
|
|
51108
51133
|
"button",
|
|
51109
51134
|
{
|
|
51110
51135
|
"aria-label": t("aria/Menu"),
|
|
51111
51136
|
className: "str-chat__header-hamburger",
|
|
51112
51137
|
onClick: openMobileNav
|
|
51113
51138
|
},
|
|
51114
|
-
/* @__PURE__ */
|
|
51115
|
-
), /* @__PURE__ */
|
|
51139
|
+
/* @__PURE__ */ import_react263.default.createElement(MenuIcon3, null)
|
|
51140
|
+
), /* @__PURE__ */ import_react263.default.createElement(
|
|
51116
51141
|
Avatar2,
|
|
51117
51142
|
{
|
|
51118
51143
|
className: "str-chat__avatar--channel-header",
|
|
@@ -51120,36 +51145,36 @@ var ChannelHeader = (props) => {
|
|
|
51120
51145
|
image: displayImage,
|
|
51121
51146
|
name: displayTitle
|
|
51122
51147
|
}
|
|
51123
|
-
), /* @__PURE__ */
|
|
51148
|
+
), /* @__PURE__ */ import_react263.default.createElement("div", { className: "str-chat__channel-header-end" }, /* @__PURE__ */ import_react263.default.createElement("p", { className: "str-chat__channel-header-title" }, displayTitle, " ", live && /* @__PURE__ */ import_react263.default.createElement("span", { className: "str-chat__header-livestream-livelabel" }, t("live"))), subtitle && /* @__PURE__ */ import_react263.default.createElement("p", { className: "str-chat__channel-header-subtitle" }, subtitle), /* @__PURE__ */ import_react263.default.createElement("p", { className: "str-chat__channel-header-info" }, !live && !!member_count && member_count > 0 && /* @__PURE__ */ import_react263.default.createElement(import_react263.default.Fragment, null, t("{{ memberCount }} members", {
|
|
51124
51149
|
memberCount: member_count
|
|
51125
51150
|
}), ",", " "), t("{{ watcherCount }} online", { watcherCount: watcher_count }))));
|
|
51126
51151
|
};
|
|
51127
51152
|
|
|
51128
51153
|
// src/components/Chat/Chat.tsx
|
|
51129
|
-
var
|
|
51130
|
-
var
|
|
51154
|
+
var import_react267 = __toESM(require("react"));
|
|
51155
|
+
var import_stream_chat13 = require("stream-chat");
|
|
51131
51156
|
|
|
51132
51157
|
// src/components/Chat/hooks/useChat.ts
|
|
51133
|
-
var
|
|
51158
|
+
var import_react264 = require("react");
|
|
51134
51159
|
var useChat = ({
|
|
51135
51160
|
client,
|
|
51136
51161
|
defaultLanguage = "en",
|
|
51137
51162
|
i18nInstance,
|
|
51138
51163
|
initialNavOpen
|
|
51139
51164
|
}) => {
|
|
51140
|
-
const [translators, setTranslators] = (0,
|
|
51165
|
+
const [translators, setTranslators] = (0, import_react264.useState)({
|
|
51141
51166
|
t: (key) => key,
|
|
51142
51167
|
tDateTimeParser: defaultDateTimeParser,
|
|
51143
51168
|
userLanguage: "en"
|
|
51144
51169
|
});
|
|
51145
|
-
const [channel, setChannel] = (0,
|
|
51146
|
-
const [mutes, setMutes] = (0,
|
|
51147
|
-
const [navOpen, setNavOpen] = (0,
|
|
51148
|
-
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = (0,
|
|
51170
|
+
const [channel, setChannel] = (0, import_react264.useState)();
|
|
51171
|
+
const [mutes, setMutes] = (0, import_react264.useState)([]);
|
|
51172
|
+
const [navOpen, setNavOpen] = (0, import_react264.useState)(initialNavOpen);
|
|
51173
|
+
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = (0, import_react264.useState)({});
|
|
51149
51174
|
const clientMutes = client.user?.mutes ?? [];
|
|
51150
51175
|
const closeMobileNav = () => setNavOpen(false);
|
|
51151
51176
|
const openMobileNav = () => setTimeout(() => setNavOpen(true), 100);
|
|
51152
|
-
const appSettings = (0,
|
|
51177
|
+
const appSettings = (0, import_react264.useRef)(null);
|
|
51153
51178
|
const getAppSettings = () => {
|
|
51154
51179
|
if (appSettings.current) {
|
|
51155
51180
|
return appSettings.current;
|
|
@@ -51157,9 +51182,9 @@ var useChat = ({
|
|
|
51157
51182
|
appSettings.current = client.getAppSettings();
|
|
51158
51183
|
return appSettings.current;
|
|
51159
51184
|
};
|
|
51160
|
-
(0,
|
|
51185
|
+
(0, import_react264.useEffect)(() => {
|
|
51161
51186
|
if (!client) return;
|
|
51162
|
-
const version = "13.0.
|
|
51187
|
+
const version = "13.0.1";
|
|
51163
51188
|
const userAgent = client.getUserAgent();
|
|
51164
51189
|
if (!userAgent.includes("stream-chat-react")) {
|
|
51165
51190
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|
|
@@ -51171,7 +51196,7 @@ var useChat = ({
|
|
|
51171
51196
|
client.polls.unregisterSubscriptions();
|
|
51172
51197
|
};
|
|
51173
51198
|
}, [client]);
|
|
51174
|
-
(0,
|
|
51199
|
+
(0, import_react264.useEffect)(() => {
|
|
51175
51200
|
setMutes(clientMutes);
|
|
51176
51201
|
const handleEvent = (event) => {
|
|
51177
51202
|
setMutes(event.me?.mutes || []);
|
|
@@ -51179,7 +51204,7 @@ var useChat = ({
|
|
|
51179
51204
|
client.on("notification.mutes_updated", handleEvent);
|
|
51180
51205
|
return () => client.off("notification.mutes_updated", handleEvent);
|
|
51181
51206
|
}, [clientMutes?.length]);
|
|
51182
|
-
(0,
|
|
51207
|
+
(0, import_react264.useEffect)(() => {
|
|
51183
51208
|
let userLanguage = client.user?.language;
|
|
51184
51209
|
if (!userLanguage) {
|
|
51185
51210
|
const browserLanguage = window.navigator.language.slice(0, 2);
|
|
@@ -51196,7 +51221,7 @@ var useChat = ({
|
|
|
51196
51221
|
});
|
|
51197
51222
|
});
|
|
51198
51223
|
}, [i18nInstance]);
|
|
51199
|
-
const setActiveChannel = (0,
|
|
51224
|
+
const setActiveChannel = (0, import_react264.useCallback)(
|
|
51200
51225
|
async (activeChannel, watchers = {}, event) => {
|
|
51201
51226
|
if (event && event.preventDefault) event.preventDefault();
|
|
51202
51227
|
if (activeChannel && Object.keys(watchers).length) {
|
|
@@ -51207,7 +51232,7 @@ var useChat = ({
|
|
|
51207
51232
|
},
|
|
51208
51233
|
[]
|
|
51209
51234
|
);
|
|
51210
|
-
(0,
|
|
51235
|
+
(0, import_react264.useEffect)(() => {
|
|
51211
51236
|
setLatestMessageDatesByChannels({});
|
|
51212
51237
|
}, [client.user?.id]);
|
|
51213
51238
|
return {
|
|
@@ -51224,7 +51249,7 @@ var useChat = ({
|
|
|
51224
51249
|
};
|
|
51225
51250
|
|
|
51226
51251
|
// src/components/Chat/hooks/useCreateChatContext.ts
|
|
51227
|
-
var
|
|
51252
|
+
var import_react265 = require("react");
|
|
51228
51253
|
var useCreateChatContext = (value) => {
|
|
51229
51254
|
const {
|
|
51230
51255
|
channel,
|
|
@@ -51249,7 +51274,7 @@ var useCreateChatContext = (value) => {
|
|
|
51249
51274
|
const clientValues = `${client.clientID}${Object.keys(client.activeChannels).length}${Object.keys(client.listeners).length}${client.mutedChannels.length}
|
|
51250
51275
|
${client.user?.id}`;
|
|
51251
51276
|
const mutedUsersLength = mutes.length;
|
|
51252
|
-
const chatContext = (0,
|
|
51277
|
+
const chatContext = (0, import_react265.useMemo)(
|
|
51253
51278
|
() => ({
|
|
51254
51279
|
channel,
|
|
51255
51280
|
channelsQueryState,
|
|
@@ -51284,10 +51309,10 @@ var useCreateChatContext = (value) => {
|
|
|
51284
51309
|
};
|
|
51285
51310
|
|
|
51286
51311
|
// src/components/Chat/hooks/useChannelsQueryState.ts
|
|
51287
|
-
var
|
|
51312
|
+
var import_react266 = require("react");
|
|
51288
51313
|
var useChannelsQueryState = () => {
|
|
51289
|
-
const [error, setError] = (0,
|
|
51290
|
-
const [queryInProgress, setQueryInProgress] = (0,
|
|
51314
|
+
const [error, setError] = (0, import_react266.useState)(null);
|
|
51315
|
+
const [queryInProgress, setQueryInProgress] = (0, import_react266.useState)("uninitialized");
|
|
51291
51316
|
return {
|
|
51292
51317
|
error,
|
|
51293
51318
|
queryInProgress,
|
|
@@ -51322,12 +51347,12 @@ var Chat = (props) => {
|
|
|
51322
51347
|
translators
|
|
51323
51348
|
} = useChat({ client, defaultLanguage, i18nInstance, initialNavOpen });
|
|
51324
51349
|
const channelsQueryState = useChannelsQueryState();
|
|
51325
|
-
const searchController = (0,
|
|
51326
|
-
() => customChannelSearchController ?? new
|
|
51350
|
+
const searchController = (0, import_react267.useMemo)(
|
|
51351
|
+
() => customChannelSearchController ?? new import_stream_chat13.SearchController({
|
|
51327
51352
|
sources: [
|
|
51328
|
-
new
|
|
51329
|
-
new
|
|
51330
|
-
new
|
|
51353
|
+
new import_stream_chat13.ChannelSearchSource(client),
|
|
51354
|
+
new import_stream_chat13.UserSearchSource(client),
|
|
51355
|
+
new import_stream_chat13.MessageSearchSource(client)
|
|
51331
51356
|
]
|
|
51332
51357
|
}),
|
|
51333
51358
|
[client, customChannelSearchController]
|
|
@@ -51350,26 +51375,26 @@ var Chat = (props) => {
|
|
|
51350
51375
|
useImageFlagEmojisOnWindows
|
|
51351
51376
|
});
|
|
51352
51377
|
if (!translators.t) return null;
|
|
51353
|
-
return /* @__PURE__ */
|
|
51378
|
+
return /* @__PURE__ */ import_react267.default.createElement(ChatProvider, { value: chatContextValue }, /* @__PURE__ */ import_react267.default.createElement(TranslationProvider, { value: translators }, children));
|
|
51354
51379
|
};
|
|
51355
51380
|
|
|
51356
51381
|
// src/components/Chat/hooks/useCreateChatClient.ts
|
|
51357
|
-
var
|
|
51358
|
-
var
|
|
51382
|
+
var import_react268 = require("react");
|
|
51383
|
+
var import_stream_chat14 = require("stream-chat");
|
|
51359
51384
|
var useCreateChatClient = ({
|
|
51360
51385
|
apiKey,
|
|
51361
51386
|
options,
|
|
51362
51387
|
tokenOrProvider,
|
|
51363
51388
|
userData
|
|
51364
51389
|
}) => {
|
|
51365
|
-
const [chatClient, setChatClient] = (0,
|
|
51366
|
-
const [cachedUserData, setCachedUserData] = (0,
|
|
51390
|
+
const [chatClient, setChatClient] = (0, import_react268.useState)(null);
|
|
51391
|
+
const [cachedUserData, setCachedUserData] = (0, import_react268.useState)(userData);
|
|
51367
51392
|
if (userData.id !== cachedUserData.id) {
|
|
51368
51393
|
setCachedUserData(userData);
|
|
51369
51394
|
}
|
|
51370
|
-
const [cachedOptions] = (0,
|
|
51371
|
-
(0,
|
|
51372
|
-
const client = new
|
|
51395
|
+
const [cachedOptions] = (0, import_react268.useState)(options);
|
|
51396
|
+
(0, import_react268.useEffect)(() => {
|
|
51397
|
+
const client = new import_stream_chat14.StreamChat(apiKey, void 0, cachedOptions);
|
|
51373
51398
|
let didUserConnectInterrupt = false;
|
|
51374
51399
|
const connectionPromise = client.connectUser(cachedUserData, tokenOrProvider).then(() => {
|
|
51375
51400
|
if (!didUserConnectInterrupt) setChatClient(client);
|
|
@@ -51386,12 +51411,12 @@ var useCreateChatClient = ({
|
|
|
51386
51411
|
};
|
|
51387
51412
|
|
|
51388
51413
|
// src/components/Window/Window.tsx
|
|
51389
|
-
var
|
|
51414
|
+
var import_react269 = __toESM(require("react"));
|
|
51390
51415
|
var import_clsx67 = __toESM(require("clsx"));
|
|
51391
51416
|
var UnMemoizedWindow = (props) => {
|
|
51392
51417
|
const { children, thread: propThread } = props;
|
|
51393
51418
|
const { thread: contextThread } = useChannelStateContext("Window");
|
|
51394
|
-
return /* @__PURE__ */
|
|
51419
|
+
return /* @__PURE__ */ import_react269.default.createElement(
|
|
51395
51420
|
"div",
|
|
51396
51421
|
{
|
|
51397
51422
|
className: (0, import_clsx67.default)("str-chat__main-panel", {
|
|
@@ -51401,7 +51426,7 @@ var UnMemoizedWindow = (props) => {
|
|
|
51401
51426
|
children
|
|
51402
51427
|
);
|
|
51403
51428
|
};
|
|
51404
|
-
var Window =
|
|
51429
|
+
var Window = import_react269.default.memo(UnMemoizedWindow);
|
|
51405
51430
|
/*! Bundled license information:
|
|
51406
51431
|
|
|
51407
51432
|
is-buffer/index.js:
|