stream-chat-react 13.0.0 → 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.
@@ -209,6 +209,7 @@ export declare class Streami18n {
209
209
  "Nobody will be able to vote in this poll anymore.": string;
210
210
  "Nothing yet...": string;
211
211
  Ok: string;
212
+ "Only numbers are allowed": string;
212
213
  "Open emoji picker": string;
213
214
  "Option already exists": string;
214
215
  Options: string;
package/dist/i18n/de.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Niemand kann mehr in dieser Umfrage abstimmen.",
80
80
  "Nothing yet...": "Noch nichts...",
81
81
  "Ok": "Ok",
82
+ "Only numbers are allowed": "Nur Zahlen sind erlaubt",
82
83
  "Open emoji picker": "Emoji-Auswahl öffnen",
83
84
  "Option already exists": "Option existiert bereits",
84
85
  "Options": "Optionen",
package/dist/i18n/en.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Nobody will be able to vote in this poll anymore.",
80
80
  "Nothing yet...": "Nothing yet...",
81
81
  "Ok": "Ok",
82
+ "Only numbers are allowed": "Only numbers are allowed",
82
83
  "Open emoji picker": "Open emoji picker",
83
84
  "Option already exists": "Option already exists",
84
85
  "Options": "Options",
package/dist/i18n/es.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Nadie podrá votar en esta encuesta.",
80
80
  "Nothing yet...": "Nada aún...",
81
81
  "Ok": "Ok",
82
+ "Only numbers are allowed": "Solo se permiten números",
82
83
  "Open emoji picker": "Abrir el selector de emojis",
83
84
  "Option already exists": "La opción ya existe",
84
85
  "Options": "Opciones",
package/dist/i18n/fr.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Personne ne pourra plus voter dans ce sondage.",
80
80
  "Nothing yet...": "Rien pour l'instant...",
81
81
  "Ok": "D'accord",
82
+ "Only numbers are allowed": "Seuls les chiffres sont autorisés",
82
83
  "Open emoji picker": "Ouvrir le sélecteur d'émojis",
83
84
  "Option already exists": "L'option existe déjà",
84
85
  "Options": "Options",
package/dist/i18n/hi.json CHANGED
@@ -80,6 +80,7 @@
80
80
  "Nobody will be able to vote in this poll anymore.": "अब कोई भी इस मतदान में मतदान नहीं कर सकेगा।",
81
81
  "Nothing yet...": "कोई मैसेज नहीं है",
82
82
  "Ok": "ठीक है",
83
+ "Only numbers are allowed": "केवल संख्याएँ अनुमत हैं",
83
84
  "Open emoji picker": "इमोजी पिकर खोलिये",
84
85
  "Option already exists": "विकल्प पहले से मौजूद है",
85
86
  "Options": "विकल्प",
package/dist/i18n/it.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Nessuno potrà più votare in questo sondaggio.",
80
80
  "Nothing yet...": "Ancora niente...",
81
81
  "Ok": "Ok",
82
+ "Only numbers are allowed": "Sono consentiti solo numeri",
82
83
  "Open emoji picker": "Apri il selettore di emoji",
83
84
  "Option already exists": "L'opzione esiste già",
84
85
  "Options": "Opzioni",
package/dist/i18n/ja.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "この投票では、誰も投票できなくなります。",
80
80
  "Nothing yet...": "まだ何もありません...",
81
81
  "Ok": "OK",
82
+ "Only numbers are allowed": "数字のみ許可されています",
82
83
  "Open emoji picker": "絵文字ピッカーを開く",
83
84
  "Option already exists": "オプションは既に存在します",
84
85
  "Options": "オプション",
package/dist/i18n/ko.json CHANGED
@@ -79,7 +79,8 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "이 투표에 더 이상 아무도 투표할 수 없습니다.",
80
80
  "Nothing yet...": "아직 아무것도...",
81
81
  "Ok": "확인",
82
- "Open emoji picker": "이모티콘 선택기 열기",
82
+ "Only numbers are allowed": "숫자만 입력 가능합니다",
83
+ "Open emoji picker": "이모지 선택기 열기",
83
84
  "Option already exists": "옵션이 이미 존재합니다",
84
85
  "Options": "옵션",
85
86
  "People matching": "일치하는 사람",
package/dist/i18n/nl.json CHANGED
@@ -79,7 +79,8 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Niemand kan meer stemmen in deze peiling.",
80
80
  "Nothing yet...": "Nog niets ...",
81
81
  "Ok": "Oké",
82
- "Open emoji picker": "Open emojipicker",
82
+ "Only numbers are allowed": "Alleen nummers zijn toegestaan",
83
+ "Open emoji picker": "Emoji-kiezer openen",
83
84
  "Option already exists": "Optie bestaat al",
84
85
  "Options": "Opties",
85
86
  "People matching": "Mensen die matchen",
package/dist/i18n/pt.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Ninguém mais poderá votar nesta pesquisa.",
80
80
  "Nothing yet...": "Nada ainda...",
81
81
  "Ok": "Ok",
82
+ "Only numbers are allowed": "Apenas números são permitidos",
82
83
  "Open emoji picker": "Abrir seletor de emoji",
83
84
  "Option already exists": "Opção já existe",
84
85
  "Options": "Opções",
package/dist/i18n/ru.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Никто больше не сможет голосовать в этом опросе.",
80
80
  "Nothing yet...": "Пока ничего нет...",
81
81
  "Ok": "Ок",
82
+ "Only numbers are allowed": "Разрешены только цифры",
82
83
  "Open emoji picker": "Открыть выбор смайлов",
83
84
  "Option already exists": "Вариант уже существует",
84
85
  "Options": "Варианты",
package/dist/i18n/tr.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "Nobody will be able to vote in this poll anymore.": "Artık bu ankette kimse oy kullanamayacak.",
80
80
  "Nothing yet...": "Şimdilik hiçbir şey...",
81
81
  "Ok": "Tamam",
82
+ "Only numbers are allowed": "Sadece sayılar kullanılabilir",
82
83
  "Open emoji picker": "Emoji klavyesini aç",
83
84
  "Option already exists": "Seçenek zaten mevcut",
84
85
  "Options": "Seçenekler",
@@ -17667,7 +17667,7 @@ module.exports = __toCommonJS(src_exports);
17667
17667
 
17668
17668
  // src/components/Attachment/Attachment.tsx
17669
17669
  var import_react255 = __toESM(require("react"));
17670
- var import_stream_chat10 = require("stream-chat");
17670
+ var import_stream_chat11 = require("stream-chat");
17671
17671
 
17672
17672
  // src/components/Attachment/AttachmentContainer.tsx
17673
17673
  var import_react254 = __toESM(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
- pollComposer.updateFields({
39768
- max_votes_allowed: e.target.value
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
- "Open emoji picker": "\uC774\uBAA8\uD2F0\uCF58 \uC120\uD0DD\uAE30 \uC5F4\uAE30",
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
- "Open emoji picker": "Open emojipicker",
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 import_stream_chat8 = require("stream-chat");
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"));
@@ -47813,6 +47831,23 @@ var useTextareaRef = (props) => {
47813
47831
 
47814
47832
  // src/components/MessageInput/hooks/useSubmitHandler.ts
47815
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
+ };
47816
47851
  var useSubmitHandler = (props) => {
47817
47852
  const { clearEditingState, overrideSubmitHandler } = props;
47818
47853
  const { addNotification, editMessage, sendMessage } = useChannelActionContext("useSubmitHandler");
@@ -47832,7 +47867,17 @@ var useSubmitHandler = (props) => {
47832
47867
  addNotification(t("Edit message request failed"), "error");
47833
47868
  }
47834
47869
  } else {
47870
+ const restoreComposerStateSnapshot = takeStateSnapshot(messageComposer);
47835
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
+ }
47836
47881
  if (overrideSubmitHandler) {
47837
47882
  await overrideSubmitHandler({
47838
47883
  cid: messageComposer.channel.cid,
@@ -47843,10 +47888,10 @@ var useSubmitHandler = (props) => {
47843
47888
  } else {
47844
47889
  await sendMessage({ localMessage, message, options: sendOptions });
47845
47890
  }
47846
- messageComposer.clear();
47847
47891
  if (messageComposer.config.text.publishTypingEvents)
47848
47892
  await messageComposer.channel.stopTyping();
47849
47893
  } catch (err) {
47894
+ restoreComposerStateSnapshot();
47850
47895
  addNotification(t("Send message request failed"), "error");
47851
47896
  }
47852
47897
  }
@@ -48007,8 +48052,8 @@ var AttachmentPreviewList = ({
48007
48052
  "data-testid": "attachment-list-scroll-container"
48008
48053
  },
48009
48054
  attachments.map((attachment) => {
48010
- if ((0, import_stream_chat8.isScrapedContent)(attachment)) return null;
48011
- if ((0, import_stream_chat8.isLocalVoiceRecordingAttachment)(attachment)) {
48055
+ if ((0, import_stream_chat9.isScrapedContent)(attachment)) return null;
48056
+ if ((0, import_stream_chat9.isLocalVoiceRecordingAttachment)(attachment)) {
48012
48057
  return /* @__PURE__ */ import_react228.default.createElement(
48013
48058
  VoiceRecordingPreview2,
48014
48059
  {
@@ -48018,7 +48063,7 @@ var AttachmentPreviewList = ({
48018
48063
  removeAttachments: messageComposer.attachmentManager.removeAttachments
48019
48064
  }
48020
48065
  );
48021
- } else if ((0, import_stream_chat8.isLocalAudioAttachment)(attachment)) {
48066
+ } else if ((0, import_stream_chat9.isLocalAudioAttachment)(attachment)) {
48022
48067
  return /* @__PURE__ */ import_react228.default.createElement(
48023
48068
  AudioAttachmentPreview,
48024
48069
  {
@@ -48028,7 +48073,7 @@ var AttachmentPreviewList = ({
48028
48073
  removeAttachments: messageComposer.attachmentManager.removeAttachments
48029
48074
  }
48030
48075
  );
48031
- } else if ((0, import_stream_chat8.isLocalVideoAttachment)(attachment)) {
48076
+ } else if ((0, import_stream_chat9.isLocalVideoAttachment)(attachment)) {
48032
48077
  return /* @__PURE__ */ import_react228.default.createElement(
48033
48078
  VideoAttachmentPreview,
48034
48079
  {
@@ -48038,7 +48083,7 @@ var AttachmentPreviewList = ({
48038
48083
  removeAttachments: messageComposer.attachmentManager.removeAttachments
48039
48084
  }
48040
48085
  );
48041
- } else if ((0, import_stream_chat8.isLocalImageAttachment)(attachment)) {
48086
+ } else if ((0, import_stream_chat9.isLocalImageAttachment)(attachment)) {
48042
48087
  return /* @__PURE__ */ import_react228.default.createElement(
48043
48088
  ImageAttachmentPreview2,
48044
48089
  {
@@ -48048,7 +48093,7 @@ var AttachmentPreviewList = ({
48048
48093
  removeAttachments: messageComposer.attachmentManager.removeAttachments
48049
48094
  }
48050
48095
  );
48051
- } else if ((0, import_stream_chat8.isLocalFileAttachment)(attachment)) {
48096
+ } else if ((0, import_stream_chat9.isLocalFileAttachment)(attachment)) {
48052
48097
  return /* @__PURE__ */ import_react228.default.createElement(
48053
48098
  FileAttachmentPreview2,
48054
48099
  {
@@ -48058,7 +48103,7 @@ var AttachmentPreviewList = ({
48058
48103
  removeAttachments: messageComposer.attachmentManager.removeAttachments
48059
48104
  }
48060
48105
  );
48061
- } else if ((0, import_stream_chat8.isLocalAttachment)(attachment)) {
48106
+ } else if ((0, import_stream_chat9.isLocalAttachment)(attachment)) {
48062
48107
  return /* @__PURE__ */ import_react228.default.createElement(
48063
48108
  UnsupportedAttachmentPreview2,
48064
48109
  {
@@ -48228,10 +48273,10 @@ var QuotedMessagePreview = ({
48228
48273
  // src/components/MessageInput/LinkPreviewList.tsx
48229
48274
  var import_clsx57 = __toESM(require("clsx"));
48230
48275
  var import_react234 = __toESM(require("react"));
48231
- var import_stream_chat9 = require("stream-chat");
48276
+ var import_stream_chat10 = require("stream-chat");
48232
48277
  var linkPreviewsManagerStateSelector = (state) => ({
48233
48278
  linkPreviews: Array.from(state.previews.values()).filter(
48234
- (preview) => import_stream_chat9.LinkPreviewsManager.previewIsLoaded(preview) || import_stream_chat9.LinkPreviewsManager.previewIsLoading(preview)
48279
+ (preview) => import_stream_chat10.LinkPreviewsManager.previewIsLoaded(preview) || import_stream_chat10.LinkPreviewsManager.previewIsLoading(preview)
48235
48280
  )
48236
48281
  });
48237
48282
  var messageComposerStateSelector = (state) => ({
@@ -48256,13 +48301,13 @@ var LinkPreviewCard = ({ linkPreview }) => {
48256
48301
  const { linkPreviewsManager } = useMessageComposer();
48257
48302
  const { handleEnter, handleLeave, tooltipVisible } = useEnterLeaveHandlers();
48258
48303
  const [referenceElement, setReferenceElement] = (0, import_react234.useState)(null);
48259
- if (!import_stream_chat9.LinkPreviewsManager.previewIsLoaded(linkPreview) && !import_stream_chat9.LinkPreviewsManager.previewIsLoading(linkPreview))
48304
+ if (!import_stream_chat10.LinkPreviewsManager.previewIsLoaded(linkPreview) && !import_stream_chat10.LinkPreviewsManager.previewIsLoading(linkPreview))
48260
48305
  return null;
48261
48306
  return /* @__PURE__ */ import_react234.default.createElement(
48262
48307
  "div",
48263
48308
  {
48264
48309
  className: (0, import_clsx57.default)("str-chat__link-preview-card", {
48265
- "str-chat__link-preview-card--loading": import_stream_chat9.LinkPreviewsManager.previewIsLoading(linkPreview)
48310
+ "str-chat__link-preview-card--loading": import_stream_chat10.LinkPreviewsManager.previewIsLoading(linkPreview)
48266
48311
  }),
48267
48312
  "data-testid": "link-preview-card"
48268
48313
  },
@@ -48491,7 +48536,7 @@ var TextareaComposer = ({
48491
48536
  closeSuggestionsOnClickOutside,
48492
48537
  containerClassName,
48493
48538
  listClassName,
48494
- maxRows: maxRowsProp = 1,
48539
+ maxRows: maxRowsProp,
48495
48540
  minRows: minRowsProp,
48496
48541
  onBlur,
48497
48542
  onChange,
@@ -48514,7 +48559,7 @@ var TextareaComposer = ({
48514
48559
  shouldSubmit: shouldSubmitContext,
48515
48560
  textareaRef
48516
48561
  } = useMessageInputContext();
48517
- const maxRows = maxRowsProp ?? maxRowsContext;
48562
+ const maxRows = maxRowsProp ?? maxRowsContext ?? 1;
48518
48563
  const minRows = minRowsProp ?? minRowsContext;
48519
48564
  const placeholder = placeholderProp ?? additionalTextareaProps?.placeholder;
48520
48565
  const shouldSubmit = shouldSubmitProp ?? shouldSubmitContext ?? defaultShouldSubmit;
@@ -48558,13 +48603,11 @@ var TextareaComposer = ({
48558
48603
  onKeyDown(event);
48559
48604
  return;
48560
48605
  }
48561
- if (event.key === "Enter") {
48562
- event.preventDefault();
48563
- }
48564
48606
  if (textComposer.suggestions && textComposer.suggestions.searchSource.items?.length) {
48565
48607
  if (event.key === "Escape") return textComposer.closeSuggestions();
48566
48608
  const loadedItems = textComposer.suggestions.searchSource.items;
48567
48609
  if (event.key === "Enter") {
48610
+ event.preventDefault();
48568
48611
  textComposer.handleSelect(loadedItems[focusedItemIndex]);
48569
48612
  }
48570
48613
  if (event.key === "ArrowUp") {
@@ -49570,9 +49613,9 @@ var renderGroupedAttachments = ({
49570
49613
  ...rest
49571
49614
  }) => {
49572
49615
  const uploadedImages = attachments.filter(
49573
- (attachment) => (0, import_stream_chat10.isImageAttachment)(attachment)
49616
+ (attachment) => (0, import_stream_chat11.isImageAttachment)(attachment)
49574
49617
  );
49575
- const containers = attachments.filter((attachment) => !(0, import_stream_chat10.isImageAttachment)(attachment)).reduce(
49618
+ const containers = attachments.filter((attachment) => !(0, import_stream_chat11.isImageAttachment)(attachment)).reduce(
49576
49619
  (typeMap, attachment) => {
49577
49620
  const attachmentType = getAttachmentType(attachment);
49578
49621
  const Container = CONTAINER_MAP[attachmentType];
@@ -49624,15 +49667,15 @@ var renderGroupedAttachments = ({
49624
49667
  return containers;
49625
49668
  };
49626
49669
  var getAttachmentType = (attachment) => {
49627
- if ((0, import_stream_chat10.isScrapedContent)(attachment)) {
49670
+ if ((0, import_stream_chat11.isScrapedContent)(attachment)) {
49628
49671
  return "card";
49629
- } else if ((0, import_stream_chat10.isVideoAttachment)(attachment, SUPPORTED_VIDEO_FORMATS)) {
49672
+ } else if ((0, import_stream_chat11.isVideoAttachment)(attachment, SUPPORTED_VIDEO_FORMATS)) {
49630
49673
  return "media";
49631
- } else if ((0, import_stream_chat10.isAudioAttachment)(attachment)) {
49674
+ } else if ((0, import_stream_chat11.isAudioAttachment)(attachment)) {
49632
49675
  return "audio";
49633
- } else if ((0, import_stream_chat10.isVoiceRecordingAttachment)(attachment)) {
49676
+ } else if ((0, import_stream_chat11.isVoiceRecordingAttachment)(attachment)) {
49634
49677
  return "voiceRecording";
49635
- } else if ((0, import_stream_chat10.isFileAttachment)(attachment, SUPPORTED_VIDEO_FORMATS)) {
49678
+ } else if ((0, import_stream_chat11.isFileAttachment)(attachment, SUPPORTED_VIDEO_FORMATS)) {
49636
49679
  return "file";
49637
49680
  }
49638
49681
  return "unsupported";
@@ -49644,7 +49687,7 @@ var import_clsx66 = __toESM(require("clsx"));
49644
49687
  var import_lodash20 = __toESM(require("lodash.debounce"));
49645
49688
  var import_lodash21 = __toESM(require("lodash.defaultsdeep"));
49646
49689
  var import_lodash22 = __toESM(require("lodash.throttle"));
49647
- var import_stream_chat11 = require("stream-chat");
49690
+ var import_stream_chat12 = require("stream-chat");
49648
49691
 
49649
49692
  // src/components/Channel/channelState.ts
49650
49693
  var makeChannelReducer = () => (state, action) => {
@@ -50797,7 +50840,7 @@ var ChannelInner = (props) => {
50797
50840
  });
50798
50841
  await doSendMessage({
50799
50842
  localMessage,
50800
- message: (0, import_stream_chat11.localMessageToNewMessagePayload)(localMessage)
50843
+ message: (0, import_stream_chat12.localMessageToNewMessagePayload)(localMessage)
50801
50844
  });
50802
50845
  };
50803
50846
  const removeMessage = (message) => {
@@ -51109,7 +51152,7 @@ var ChannelHeader = (props) => {
51109
51152
 
51110
51153
  // src/components/Chat/Chat.tsx
51111
51154
  var import_react267 = __toESM(require("react"));
51112
- var import_stream_chat12 = require("stream-chat");
51155
+ var import_stream_chat13 = require("stream-chat");
51113
51156
 
51114
51157
  // src/components/Chat/hooks/useChat.ts
51115
51158
  var import_react264 = require("react");
@@ -51141,7 +51184,7 @@ var useChat = ({
51141
51184
  };
51142
51185
  (0, import_react264.useEffect)(() => {
51143
51186
  if (!client) return;
51144
- const version = "13.0.0";
51187
+ const version = "13.0.1";
51145
51188
  const userAgent = client.getUserAgent();
51146
51189
  if (!userAgent.includes("stream-chat-react")) {
51147
51190
  client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
@@ -51305,11 +51348,11 @@ var Chat = (props) => {
51305
51348
  } = useChat({ client, defaultLanguage, i18nInstance, initialNavOpen });
51306
51349
  const channelsQueryState = useChannelsQueryState();
51307
51350
  const searchController = (0, import_react267.useMemo)(
51308
- () => customChannelSearchController ?? new import_stream_chat12.SearchController({
51351
+ () => customChannelSearchController ?? new import_stream_chat13.SearchController({
51309
51352
  sources: [
51310
- new import_stream_chat12.ChannelSearchSource(client),
51311
- new import_stream_chat12.UserSearchSource(client),
51312
- new import_stream_chat12.MessageSearchSource(client)
51353
+ new import_stream_chat13.ChannelSearchSource(client),
51354
+ new import_stream_chat13.UserSearchSource(client),
51355
+ new import_stream_chat13.MessageSearchSource(client)
51313
51356
  ]
51314
51357
  }),
51315
51358
  [client, customChannelSearchController]
@@ -51337,7 +51380,7 @@ var Chat = (props) => {
51337
51380
 
51338
51381
  // src/components/Chat/hooks/useCreateChatClient.ts
51339
51382
  var import_react268 = require("react");
51340
- var import_stream_chat13 = require("stream-chat");
51383
+ var import_stream_chat14 = require("stream-chat");
51341
51384
  var useCreateChatClient = ({
51342
51385
  apiKey,
51343
51386
  options,
@@ -51351,7 +51394,7 @@ var useCreateChatClient = ({
51351
51394
  }
51352
51395
  const [cachedOptions] = (0, import_react268.useState)(options);
51353
51396
  (0, import_react268.useEffect)(() => {
51354
- const client = new import_stream_chat13.StreamChat(apiKey, void 0, cachedOptions);
51397
+ const client = new import_stream_chat14.StreamChat(apiKey, void 0, cachedOptions);
51355
51398
  let didUserConnectInterrupt = false;
51356
51399
  const connectionPromise = client.connectUser(cachedUserData, tokenOrProvider).then(() => {
51357
51400
  if (!didUserConnectInterrupt) setChatClient(client);