stream-chat-react 10.17.0 → 10.19.0
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/browser.full-bundle.js +120 -44
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +5 -5
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/ChannelList/hooks/usePaginatedChannels.d.ts.map +1 -1
- package/dist/components/ChannelList/hooks/usePaginatedChannels.js +2 -2
- package/dist/components/Chat/Chat.d.ts.map +1 -1
- package/dist/components/Chat/Chat.js +3 -1
- package/dist/components/Chat/hooks/useChat.d.ts +2 -0
- package/dist/components/Chat/hooks/useChat.d.ts.map +1 -1
- package/dist/components/Chat/hooks/useChat.js +7 -4
- package/dist/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
- package/dist/components/Chat/hooks/useCreateChatContext.js +5 -1
- package/dist/components/Message/renderText/index.d.ts +3 -1
- package/dist/components/Message/renderText/index.d.ts.map +1 -1
- package/dist/components/Message/renderText/index.js +2 -1
- package/dist/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.d.ts +3 -0
- package/dist/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.d.ts.map +1 -0
- package/dist/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.js +10 -0
- package/dist/components/Message/renderText/rehypePlugins/index.d.ts +3 -0
- package/dist/components/Message/renderText/rehypePlugins/index.d.ts.map +1 -0
- package/dist/components/Message/renderText/rehypePlugins/index.js +2 -0
- package/dist/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts +5 -0
- package/dist/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts.map +1 -0
- package/dist/components/Message/renderText/{rehypePlugins.js → rehypePlugins/mentionsMarkdownPlugin.js} +1 -9
- package/dist/components/Message/renderText/remarkPlugins/htmlToTextPlugin.d.ts +3 -0
- package/dist/components/Message/renderText/remarkPlugins/htmlToTextPlugin.d.ts.map +1 -0
- package/dist/components/Message/renderText/remarkPlugins/htmlToTextPlugin.js +10 -0
- package/dist/components/Message/renderText/remarkPlugins/index.d.ts +3 -0
- package/dist/components/Message/renderText/remarkPlugins/index.d.ts.map +1 -0
- package/dist/components/Message/renderText/remarkPlugins/index.js +2 -0
- package/dist/components/Message/renderText/remarkPlugins/keepLineBreaksPlugin.d.ts +3 -0
- package/dist/components/Message/renderText/remarkPlugins/keepLineBreaksPlugin.d.ts.map +1 -0
- package/dist/components/Message/renderText/remarkPlugins/keepLineBreaksPlugin.js +32 -0
- package/dist/components/Message/renderText/types.d.ts +3 -0
- package/dist/components/Message/renderText/types.d.ts.map +1 -0
- package/dist/components/Message/renderText/types.js +1 -0
- package/dist/components/MessageList/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList/MessageList.js +2 -1
- package/dist/context/ChatContext.d.ts +29 -2
- package/dist/context/ChatContext.d.ts.map +1 -1
- package/dist/context/MessageListContext.d.ts +16 -0
- package/dist/context/MessageListContext.d.ts.map +1 -0
- package/dist/context/MessageListContext.js +17 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/index.cjs.js +110 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/components/Message/renderText/rehypePlugins.d.ts +0 -7
- package/dist/components/Message/renderText/rehypePlugins.d.ts.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -429,6 +429,23 @@ var useMessageInputContext = function (componentName) {
|
|
|
429
429
|
return contextValue;
|
|
430
430
|
};
|
|
431
431
|
|
|
432
|
+
var MessageListContext = React.createContext(undefined);
|
|
433
|
+
/**
|
|
434
|
+
* Context provider for components rendered within the `MessageList`
|
|
435
|
+
*/
|
|
436
|
+
var MessageListContextProvider = function (_a) {
|
|
437
|
+
var children = _a.children, value = _a.value;
|
|
438
|
+
return (React__default["default"].createElement(MessageListContext.Provider, { value: value }, children));
|
|
439
|
+
};
|
|
440
|
+
var useMessageListContext = function (componentName) {
|
|
441
|
+
var contextValue = React.useContext(MessageListContext);
|
|
442
|
+
if (!contextValue) {
|
|
443
|
+
console.warn("The useMessageListContext hook was called outside of the MessageListContext provider. Make sure this hook is called within the MessageList component. The errored call is located in the ".concat(componentName, " component."));
|
|
444
|
+
return {};
|
|
445
|
+
}
|
|
446
|
+
return contextValue;
|
|
447
|
+
};
|
|
448
|
+
|
|
432
449
|
var Cancel$b="Stornieren";var Close$b="Schließen";var Delete$b="Löschen";var Delivered$b="Zugestellt";var Flag$b="Meldung";var Menu$b="Menü";var Mute$b="Stumm schalten";var New$b="Neu";var Pin$b="Pin";var Reply$b="Antworten";var Search$b="Suche";var Send$b="Senden";var Shuffle$b="Mischen";var Thread$c="Thread";var Unmute$b="Stummschaltung aufheben";var Unpin$b="Pin entfernen";var live$b="live";var replyCount_one$b="1 Antwort";var replyCount_other$b="{{ count }} Antworten";var searchResultsCount_one$b="1 Ergebnis";var searchResultsCount_other$b="{{ count }} Ergebnisse";var deTranslations = {"Attach files":"Dateien anhängen",Cancel:Cancel$b,"Channel Missing":"Kanal fehlt",Close:Close$b,"Close emoji picker":"Emoji-Picker schließen","Commands matching":"Übereinstimmende Befehle","Connection failure, reconnecting now...":"Verbindungsfehler, Wiederherstellung der Verbindung...",Delete:Delete$b,Delivered:Delivered$b,"Drag your files here":"Ziehen Sie Ihre Dateien hierher","Drag your files here to add to your post":"Ziehen Sie Ihre Dateien hierher, um sie Ihrem Beitrag hinzuzufügen","Edit Message":"Nachricht bearbeiten","Edit message request failed":"Anfrage zum Bearbeiten der Nachricht fehlgeschlagen","Emoji matching":"Emoji passend","Empty message...":"Leere Nachricht...","Error adding flag":"Fehler beim Hinzufügen des Flags","Error connecting to chat, refresh the page to try again.":"Verbindungsfehler zum Chat, Aktualisiere die Seite um es erneut zu versuchen.","Error deleting message":"Fehler beim Löschen der Nachricht","Error muting a user ...":"Fehler beim Stummschalten eines Nutzers.","Error pinning message":"Fehler beim Pinnen der Nachricht","Error removing message pin":"Fehler beim Entfernen der gepinnten Nachricht","Error unmuting a user ...":"Stummschaltung des Nutzers fehlgeschlagen ...","Error uploading file":"Fehler beim Hochladen der Datei","Error uploading image":"Hochladen des Bildes fehlgeschlagen","Error · Unsent":"Fehler nicht gesendet","Error: {{ errorMessage }}":"Fehler: {{ errorMessage }}",Flag:Flag$b,"Latest Messages":"Neueste Nachrichten","Load more":"Mehr laden",Menu:Menu$b,"Message Failed · Click to try again":"Nachricht fehlgeschlagen · Klicken, um es erneut zu versuchen","Message Failed · Unauthorized":"Nachricht fehlgeschlagen · Nicht autorisiert","Message deleted":"Nachricht gelöscht","Message has been successfully flagged":"Nachricht wurde erfolgreich gemeldet","Message pinned":"Nachricht gepinnt",Mute:Mute$b,New:New$b,"New Messages!":"Neue Nachrichten!","No chats here yet…":"Noch keine Chats hier...","No results found":"keine Ergebnisse gefunden","Nothing yet...":"Noch nichts...","Open emoji picker":"Emoji-Picker öffnen","People matching":"Passende Personen","Pick your emoji":"Emoji wählen",Pin:Pin$b,"Pinned by":"Gepinnt von",Reply:Reply$b,"Reply to Message":"Auf Nachricht antworten",Search:Search$b,"Searching...":"Suchen...",Send:Send$b,"Send message request failed":"Senden der Nachrichtenanfrage fehlgeschlagen","Sending...":"Senden...",Shuffle:Shuffle$b,"Slow Mode ON":"Slow-Mode EIN","Some of the files will not be accepted":"Einige der Dateien werden nicht akzeptiert","This message was deleted...":"Diese Nachricht wurde gelöscht...",Thread:Thread$c,"Type your message":"Nachricht eingeben",Unmute:Unmute$b,Unpin:Unpin$b,"Upload type: \"{{ type }}\" is not allowed":"Upload-Typ: \"{{ type }}\" ist nicht erlaubt","Wait until all attachments have uploaded":"Bitte warten, bis alle Anhänge hochgeladen wurden","You have no channels currently":"Du hast momentan noch keinen Channels","You've reached the maximum number of files":"Die maximale Dateianzahl ist erreicht","ban-command-args":"[@Benutzername] [Text]","ban-command-description":"Einen Benutzer verbannen","giphy-command-args":"[Text]","giphy-command-description":"Poste ein zufälliges Gif in den Kanal",live:live$b,"mute-command-args":"[@Benutzername]","mute-command-description":"Stummschalten eines Benutzers",replyCount_one:replyCount_one$b,replyCount_other:replyCount_other$b,searchResultsCount_one:searchResultsCount_one$b,searchResultsCount_other:searchResultsCount_other$b,"this content could not be displayed":"Dieser Inhalt konnte nicht angezeigt werden","unban-command-args":"[@Benutzername]","unban-command-description":"Einen Benutzer entbannen","unmute-command-args":"[@Benutzername]","unmute-command-description":"Stummschaltung eines Benutzers aufheben","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} und {{moreCount}} Mehr","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} und {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} und {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} mehr","{{ memberCount }} members":"{{ memberCount }} Mitglieder","{{ user }} has been muted":"{{ user }} wurde stummgeschaltet","{{ user }} has been unmuted":"{{ user }} wurde nicht stummgeschaltet","{{ user }} is typing...":"{{ user }} tippt...","{{ users }} and more are typing...":"{{ users }} und mehr tippen...","{{ users }} and {{ user }} are typing...":"{{ users }} und {{ user }} tippen...","{{ watcherCount }} online":"{{ watcherCount }} online","🏙 Attachment...":"🏙 Anhang..."};
|
|
433
450
|
|
|
434
451
|
var Cancel$a="Cancel";var Close$a="Close";var Delete$a="Delete";var Delivered$a="Delivered";var Flag$a="Flag";var Menu$a="Menu";var Mute$a="Mute";var New$a="New";var Pin$a="Pin";var Reply$a="Reply";var Search$a="Search";var Send$a="Send";var Shuffle$a="Shuffle";var Thread$b="Thread";var Unmute$a="Unmute";var Unpin$a="Unpin";var live$a="live";var replyCount_one$a="1 reply";var replyCount_other$a="{{ count }} replies";var searchResultsCount_one$a="1 result";var searchResultsCount_other$a="{{ count }} results";var enTranslations = {"Attach files":"Attach files",Cancel:Cancel$a,"Channel Missing":"Channel Missing",Close:Close$a,"Close emoji picker":"Close emoji picker","Commands matching":"Commands matching","Connection failure, reconnecting now...":"Connection failure, reconnecting now...",Delete:Delete$a,Delivered:Delivered$a,"Drag your files here":"Drag your files here","Drag your files here to add to your post":"Drag your files here to add to your post","Edit Message":"Edit Message","Edit message request failed":"Edit message request failed","Emoji matching":"Emoji matching","Empty message...":"Empty message...","Error adding flag":"Error adding flag","Error connecting to chat, refresh the page to try again.":"Error connecting to chat, refresh the page to try again.","Error deleting message":"Error deleting message","Error muting a user ...":"Error muting a user ...","Error pinning message":"Error pinning message","Error removing message pin":"Error removing message pin","Error unmuting a user ...":"Error unmuting a user ...","Error uploading file":"Error uploading file","Error uploading image":"Error uploading image","Error · Unsent":"Error · Unsent","Error: {{ errorMessage }}":"Error: {{ errorMessage }}",Flag:Flag$a,"Latest Messages":"Latest Messages","Load more":"Load more",Menu:Menu$a,"Message Failed · Click to try again":"Message Failed · Click to try again","Message Failed · Unauthorized":"Message Failed · Unauthorized","Message deleted":"Message deleted","Message has been successfully flagged":"Message has been successfully flagged","Message pinned":"Message pinned",Mute:Mute$a,New:New$a,"New Messages!":"New Messages!","No chats here yet…":"No chats here yet…","No results found":"No results found","Nothing yet...":"Nothing yet...","Open emoji picker":"Open emoji picker","People matching":"People matching","Pick your emoji":"Pick your emoji",Pin:Pin$a,"Pinned by":"Pinned by",Reply:Reply$a,"Reply to Message":"Reply to Message",Search:Search$a,"Searching...":"Searching...",Send:Send$a,"Send message request failed":"Send message request failed","Sending...":"Sending...",Shuffle:Shuffle$a,"Slow Mode ON":"Slow Mode ON","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"This message was deleted...",Thread:Thread$b,"Type your message":"Type your message",Unmute:Unmute$a,Unpin:Unpin$a,"Upload type: \"{{ type }}\" is not allowed":"Upload type: \"{{ type }}\" is not allowed","Wait until all attachments have uploaded":"Wait until all attachments have uploaded","You have no channels currently":"You have no channels currently","You've reached the maximum number of files":"You've reached the maximum number of files",live:live$a,replyCount_one:replyCount_one$a,replyCount_other:replyCount_other$a,searchResultsCount_one:searchResultsCount_one$a,searchResultsCount_other:searchResultsCount_other$a,"this content could not be displayed":"this content could not be displayed","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} and {{ moreCount }} more","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }}, and {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} and {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} more","{{ memberCount }} members":"{{ memberCount }} members","{{ user }} has been muted":"{{ user }} has been muted","{{ user }} has been unmuted":"{{ user }} has been unmuted","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} online","🏙 Attachment...":"🏙 Attachment..."};
|
|
@@ -4404,6 +4421,28 @@ var DefaultSuggestionListHeader = function (props) {
|
|
|
4404
4421
|
return null;
|
|
4405
4422
|
};
|
|
4406
4423
|
|
|
4424
|
+
function escapeRegExp(text) {
|
|
4425
|
+
return text.replace(/[-[\]{}()*+?.,/\\^$|#]/g, '\\$&');
|
|
4426
|
+
}
|
|
4427
|
+
var detectHttp = /(http(s?):\/\/)?(www\.)?/;
|
|
4428
|
+
var messageCodeBlocks = function (message) {
|
|
4429
|
+
var codeRegex = /```[a-z]*\n[\s\S]*?\n```|`[a-z]*[\s\S]*?`/gm;
|
|
4430
|
+
var matches = message.match(codeRegex);
|
|
4431
|
+
return matches || [];
|
|
4432
|
+
};
|
|
4433
|
+
var matchMarkdownLinks = function (message) {
|
|
4434
|
+
var regexMdLinks = /\[([^[]+)\](\(.*\))/gm;
|
|
4435
|
+
var matches = message.match(regexMdLinks);
|
|
4436
|
+
var singleMatch = /\[([^[]+)\]\((.*)\)/;
|
|
4437
|
+
var links = matches
|
|
4438
|
+
? matches.map(function (match) {
|
|
4439
|
+
var i = singleMatch.exec(match);
|
|
4440
|
+
return i && [i[1], i[2]];
|
|
4441
|
+
})
|
|
4442
|
+
: [];
|
|
4443
|
+
return links.flat();
|
|
4444
|
+
};
|
|
4445
|
+
|
|
4407
4446
|
/**
|
|
4408
4447
|
* @typedef {import('unist').Node} Node
|
|
4409
4448
|
* @typedef {import('unist').Parent} Parent
|
|
@@ -5127,6 +5166,14 @@ var u = /**
|
|
|
5127
5166
|
}
|
|
5128
5167
|
);
|
|
5129
5168
|
|
|
5169
|
+
var emojiMarkdownPlugin = function () {
|
|
5170
|
+
var replace = function (match) {
|
|
5171
|
+
return u('element', { tagName: 'emoji' }, [u('text', match)]);
|
|
5172
|
+
};
|
|
5173
|
+
var transform = function (node) { return findAndReplace$1(node, emojiRegex__default["default"](), replace); };
|
|
5174
|
+
return transform;
|
|
5175
|
+
};
|
|
5176
|
+
|
|
5130
5177
|
/**
|
|
5131
5178
|
* @param {string} d
|
|
5132
5179
|
* @returns {string}
|
|
@@ -5347,28 +5394,6 @@ const visit =
|
|
|
5347
5394
|
}
|
|
5348
5395
|
);
|
|
5349
5396
|
|
|
5350
|
-
function escapeRegExp(text) {
|
|
5351
|
-
return text.replace(/[-[\]{}()*+?.,/\\^$|#]/g, '\\$&');
|
|
5352
|
-
}
|
|
5353
|
-
var detectHttp = /(http(s?):\/\/)?(www\.)?/;
|
|
5354
|
-
var messageCodeBlocks = function (message) {
|
|
5355
|
-
var codeRegex = /```[a-z]*\n[\s\S]*?\n```|`[a-z]*[\s\S]*?`/gm;
|
|
5356
|
-
var matches = message.match(codeRegex);
|
|
5357
|
-
return matches || [];
|
|
5358
|
-
};
|
|
5359
|
-
var matchMarkdownLinks = function (message) {
|
|
5360
|
-
var regexMdLinks = /\[([^[]+)\](\(.*\))/gm;
|
|
5361
|
-
var matches = message.match(regexMdLinks);
|
|
5362
|
-
var singleMatch = /\[([^[]+)\]\((.*)\)/;
|
|
5363
|
-
var links = matches
|
|
5364
|
-
? matches.map(function (match) {
|
|
5365
|
-
var i = singleMatch.exec(match);
|
|
5366
|
-
return i && [i[1], i[2]];
|
|
5367
|
-
})
|
|
5368
|
-
: [];
|
|
5369
|
-
return links.flat();
|
|
5370
|
-
};
|
|
5371
|
-
|
|
5372
5397
|
var mentionsMarkdownPlugin = function (mentioned_users) { return function () {
|
|
5373
5398
|
var mentioned_usernames = mentioned_users
|
|
5374
5399
|
.map(function (user) { return user.name || user.id; })
|
|
@@ -5417,13 +5442,46 @@ var mentionsMarkdownPlugin = function (mentioned_users) { return function () {
|
|
|
5417
5442
|
};
|
|
5418
5443
|
return transform;
|
|
5419
5444
|
}; };
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5445
|
+
|
|
5446
|
+
var visitor$1 = function (node) {
|
|
5447
|
+
if (node.type !== 'html')
|
|
5448
|
+
return;
|
|
5449
|
+
node.type = 'text';
|
|
5450
|
+
};
|
|
5451
|
+
var transform$1 = function (tree) {
|
|
5452
|
+
visit(tree, visitor$1);
|
|
5453
|
+
};
|
|
5454
|
+
var htmlToTextPlugin = function () { return transform$1; };
|
|
5455
|
+
|
|
5456
|
+
var visitor = function (node, index, parent) {
|
|
5457
|
+
if (index === null || index === 0)
|
|
5458
|
+
return;
|
|
5459
|
+
if (!parent)
|
|
5460
|
+
return;
|
|
5461
|
+
if (!node.position)
|
|
5462
|
+
return;
|
|
5463
|
+
var prevSibling = parent.children.at(index - 1);
|
|
5464
|
+
if (!(prevSibling === null || prevSibling === void 0 ? void 0 : prevSibling.position))
|
|
5465
|
+
return;
|
|
5466
|
+
if (node.position.start.line === prevSibling.position.start.line)
|
|
5467
|
+
return false;
|
|
5468
|
+
var ownStartLine = node.position.start.line;
|
|
5469
|
+
var prevEndLine = prevSibling.position.end.line;
|
|
5470
|
+
// the -1 is adjustment for the single line break into which multiple line breaks are converted
|
|
5471
|
+
var countTruncatedLineBreaks = ownStartLine - prevEndLine - 1;
|
|
5472
|
+
if (countTruncatedLineBreaks < 1)
|
|
5473
|
+
return;
|
|
5474
|
+
var lineBreaks = Array.from({ length: countTruncatedLineBreaks }, function () {
|
|
5475
|
+
return u('break', { tagName: 'br' });
|
|
5476
|
+
});
|
|
5477
|
+
// @ts-ignore
|
|
5478
|
+
parent.children = __spreadArray(__spreadArray(__spreadArray([], parent.children.slice(0, index), true), lineBreaks, true), parent.children.slice(index), true);
|
|
5479
|
+
return;
|
|
5426
5480
|
};
|
|
5481
|
+
var transform = function (tree) {
|
|
5482
|
+
visit(tree, visitor);
|
|
5483
|
+
};
|
|
5484
|
+
var keepLineBreaksPlugin = function () { return transform; };
|
|
5427
5485
|
|
|
5428
5486
|
const protocols = ['http', 'https', 'mailto', 'tel'];
|
|
5429
5487
|
|
|
@@ -34217,8 +34275,7 @@ var RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS = 5000;
|
|
|
34217
34275
|
var MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS = 2000;
|
|
34218
34276
|
var usePaginatedChannels = function (client, filters, sort, options, activeChannelHandler, recoveryThrottleIntervalMs) {
|
|
34219
34277
|
if (recoveryThrottleIntervalMs === void 0) { recoveryThrottleIntervalMs = RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS; }
|
|
34220
|
-
var _a = useChatContext('usePaginatedChannels').channelsQueryState, error =
|
|
34221
|
-
var _b = React.useState([]), channels = _b[0], setChannels = _b[1];
|
|
34278
|
+
var _a = useChatContext('usePaginatedChannels'), channels = _a.channels, _b = _a.channelsQueryState, error = _b.error, setError = _b.setError, setQueryInProgress = _b.setQueryInProgress, setChannels = _a.setChannels;
|
|
34222
34279
|
var _c = React.useState(true), hasNextPage = _c[0], setHasNextPage = _c[1];
|
|
34223
34280
|
var lastRecoveryTimestamp = React.useRef();
|
|
34224
34281
|
var recoveryThrottleInterval = recoveryThrottleIntervalMs < MIN_RECOVER_LOADED_CHANNELS_THROTTLE_INTERVAL_IN_MS
|
|
@@ -34298,6 +34355,7 @@ var usePaginatedChannels = function (client, filters, sort, options, activeChann
|
|
|
34298
34355
|
React.useEffect(function () {
|
|
34299
34356
|
queryChannels('reload');
|
|
34300
34357
|
}, [filterString, sortString]);
|
|
34358
|
+
// FIXME: state refactor (breaking change) is needed - do not forward `channels` and `setChannel`
|
|
34301
34359
|
return {
|
|
34302
34360
|
channels: channels,
|
|
34303
34361
|
hasNextPage: hasNextPage,
|
|
@@ -35052,7 +35110,7 @@ var UnMemoizedChannelList = function (props) {
|
|
|
35052
35110
|
*/
|
|
35053
35111
|
var ChannelList = React__default["default"].memo(UnMemoizedChannelList);
|
|
35054
35112
|
|
|
35055
|
-
var version = '10.
|
|
35113
|
+
var version = '10.19.0';
|
|
35056
35114
|
|
|
35057
35115
|
var useChat = function (_a) {
|
|
35058
35116
|
var _b, _c;
|
|
@@ -35062,10 +35120,11 @@ var useChat = function (_a) {
|
|
|
35062
35120
|
tDateTimeParser: defaultDateTimeParser,
|
|
35063
35121
|
userLanguage: 'en',
|
|
35064
35122
|
}), translators = _e[0], setTranslators = _e[1];
|
|
35065
|
-
var _f = React.useState(),
|
|
35066
|
-
var _g = React.useState(
|
|
35067
|
-
var _h = React.useState(
|
|
35068
|
-
var _j = React.useState(
|
|
35123
|
+
var _f = React.useState([]), channels = _f[0], setChannels = _f[1];
|
|
35124
|
+
var _g = React.useState(), channel = _g[0], setChannel = _g[1];
|
|
35125
|
+
var _h = React.useState([]), mutes = _h[0], setMutes = _h[1];
|
|
35126
|
+
var _j = React.useState(initialNavOpen), navOpen = _j[0], setNavOpen = _j[1];
|
|
35127
|
+
var _k = React.useState({}), latestMessageDatesByChannels = _k[0], setLatestMessageDatesByChannels = _k[1];
|
|
35069
35128
|
var clientMutes = ((_b = client.user) === null || _b === void 0 ? void 0 : _b.mutes) || [];
|
|
35070
35129
|
var closeMobileNav = function () { return setNavOpen(false); };
|
|
35071
35130
|
var openMobileNav = function () { return setTimeout(function () { return setNavOpen(true); }, 100); };
|
|
@@ -35136,6 +35195,7 @@ var useChat = function (_a) {
|
|
|
35136
35195
|
}, [(_c = client.user) === null || _c === void 0 ? void 0 : _c.id]);
|
|
35137
35196
|
return {
|
|
35138
35197
|
channel: channel,
|
|
35198
|
+
channels: channels,
|
|
35139
35199
|
closeMobileNav: closeMobileNav,
|
|
35140
35200
|
getAppSettings: getAppSettings,
|
|
35141
35201
|
latestMessageDatesByChannels: latestMessageDatesByChannels,
|
|
@@ -35143,13 +35203,14 @@ var useChat = function (_a) {
|
|
|
35143
35203
|
navOpen: navOpen,
|
|
35144
35204
|
openMobileNav: openMobileNav,
|
|
35145
35205
|
setActiveChannel: setActiveChannel,
|
|
35206
|
+
setChannels: setChannels,
|
|
35146
35207
|
translators: translators,
|
|
35147
35208
|
};
|
|
35148
35209
|
};
|
|
35149
35210
|
|
|
35150
35211
|
var useCreateChatContext = function (value) {
|
|
35151
35212
|
var _a;
|
|
35152
|
-
var channel = value.channel, channelsQueryState = value.channelsQueryState, client = value.client, closeMobileNav = value.closeMobileNav, customClasses = value.customClasses, getAppSettings = value.getAppSettings, latestMessageDatesByChannels = value.latestMessageDatesByChannels, mutes = value.mutes, navOpen = value.navOpen, openMobileNav = value.openMobileNav, setActiveChannel = value.setActiveChannel, theme = value.theme, themeVersion = value.themeVersion, useImageFlagEmojisOnWindows = value.useImageFlagEmojisOnWindows;
|
|
35213
|
+
var channel = value.channel, channels = value.channels, channelsQueryState = value.channelsQueryState, client = value.client, closeMobileNav = value.closeMobileNav, customClasses = value.customClasses, getAppSettings = value.getAppSettings, latestMessageDatesByChannels = value.latestMessageDatesByChannels, mutes = value.mutes, navOpen = value.navOpen, openMobileNav = value.openMobileNav, setActiveChannel = value.setActiveChannel, setChannels = value.setChannels, theme = value.theme, themeVersion = value.themeVersion, useImageFlagEmojisOnWindows = value.useImageFlagEmojisOnWindows;
|
|
35153
35214
|
var channelCid = channel === null || channel === void 0 ? void 0 : channel.cid;
|
|
35154
35215
|
var channelsQueryError = channelsQueryState.error;
|
|
35155
35216
|
var channelsQueryInProgress = channelsQueryState.queryInProgress;
|
|
@@ -35157,6 +35218,7 @@ var useCreateChatContext = function (value) {
|
|
|
35157
35218
|
var mutedUsersLength = mutes.length;
|
|
35158
35219
|
var chatContext = React.useMemo(function () { return ({
|
|
35159
35220
|
channel: channel,
|
|
35221
|
+
channels: channels,
|
|
35160
35222
|
channelsQueryState: channelsQueryState,
|
|
35161
35223
|
client: client,
|
|
35162
35224
|
closeMobileNav: closeMobileNav,
|
|
@@ -35167,6 +35229,7 @@ var useCreateChatContext = function (value) {
|
|
|
35167
35229
|
navOpen: navOpen,
|
|
35168
35230
|
openMobileNav: openMobileNav,
|
|
35169
35231
|
setActiveChannel: setActiveChannel,
|
|
35232
|
+
setChannels: setChannels,
|
|
35170
35233
|
theme: theme,
|
|
35171
35234
|
themeVersion: themeVersion,
|
|
35172
35235
|
useImageFlagEmojisOnWindows: useImageFlagEmojisOnWindows,
|
|
@@ -35174,10 +35237,12 @@ var useCreateChatContext = function (value) {
|
|
|
35174
35237
|
channelCid,
|
|
35175
35238
|
channelsQueryError,
|
|
35176
35239
|
channelsQueryInProgress,
|
|
35240
|
+
channels,
|
|
35177
35241
|
clientValues,
|
|
35178
35242
|
getAppSettings,
|
|
35179
35243
|
mutedUsersLength,
|
|
35180
35244
|
navOpen,
|
|
35245
|
+
setChannels,
|
|
35181
35246
|
]);
|
|
35182
35247
|
return chatContext;
|
|
35183
35248
|
};
|
|
@@ -35236,7 +35301,7 @@ var useCustomStyles = function (customStyles) {
|
|
|
35236
35301
|
*/
|
|
35237
35302
|
var Chat = function (props) {
|
|
35238
35303
|
var children = props.children, client = props.client, customClasses = props.customClasses, customStyles = props.customStyles, _a = props.darkMode, darkMode = _a === void 0 ? false : _a, defaultLanguage = props.defaultLanguage, i18nInstance = props.i18nInstance, _b = props.initialNavOpen, initialNavOpen = _b === void 0 ? true : _b, _c = props.theme, theme = _c === void 0 ? 'messaging light' : _c, _d = props.useImageFlagEmojisOnWindows, useImageFlagEmojisOnWindows = _d === void 0 ? false : _d;
|
|
35239
|
-
var _e = useChat({ client: client, defaultLanguage: defaultLanguage, i18nInstance: i18nInstance, initialNavOpen: initialNavOpen }), channel = _e.channel, closeMobileNav = _e.closeMobileNav, getAppSettings = _e.getAppSettings, latestMessageDatesByChannels = _e.latestMessageDatesByChannels, mutes = _e.mutes, navOpen = _e.navOpen, openMobileNav = _e.openMobileNav, setActiveChannel = _e.setActiveChannel, translators = _e.translators;
|
|
35304
|
+
var _e = useChat({ client: client, defaultLanguage: defaultLanguage, i18nInstance: i18nInstance, initialNavOpen: initialNavOpen }), channel = _e.channel, channels = _e.channels, closeMobileNav = _e.closeMobileNav, getAppSettings = _e.getAppSettings, latestMessageDatesByChannels = _e.latestMessageDatesByChannels, mutes = _e.mutes, navOpen = _e.navOpen, openMobileNav = _e.openMobileNav, setActiveChannel = _e.setActiveChannel, setChannels = _e.setChannels, translators = _e.translators;
|
|
35240
35305
|
var channelsQueryState = useChannelsQueryState();
|
|
35241
35306
|
var themeVersion = typeof window !== 'undefined'
|
|
35242
35307
|
? (window
|
|
@@ -35247,6 +35312,7 @@ var Chat = function (props) {
|
|
|
35247
35312
|
useCustomStyles(darkMode ? darkModeTheme : customStyles);
|
|
35248
35313
|
var chatContextValue = useCreateChatContext({
|
|
35249
35314
|
channel: channel,
|
|
35315
|
+
channels: channels,
|
|
35250
35316
|
channelsQueryState: channelsQueryState,
|
|
35251
35317
|
client: client,
|
|
35252
35318
|
closeMobileNav: closeMobileNav,
|
|
@@ -35257,6 +35323,7 @@ var Chat = function (props) {
|
|
|
35257
35323
|
navOpen: navOpen,
|
|
35258
35324
|
openMobileNav: openMobileNav,
|
|
35259
35325
|
setActiveChannel: setActiveChannel,
|
|
35326
|
+
setChannels: setChannels,
|
|
35260
35327
|
theme: theme,
|
|
35261
35328
|
themeVersion: themeVersion,
|
|
35262
35329
|
useImageFlagEmojisOnWindows: useImageFlagEmojisOnWindows,
|
|
@@ -36497,7 +36564,7 @@ var MessageListWithContext = function (props) {
|
|
|
36497
36564
|
}
|
|
36498
36565
|
}, [highlightedMessageId]);
|
|
36499
36566
|
var showEmptyStateIndicator = elements.length === 0 && !threadList;
|
|
36500
|
-
return (React__default["default"].createElement(
|
|
36567
|
+
return (React__default["default"].createElement(MessageListContextProvider, { value: { listElement: listElement, scrollToBottom: scrollToBottom } },
|
|
36501
36568
|
React__default["default"].createElement(MessageListMainPanel, null,
|
|
36502
36569
|
React__default["default"].createElement("div", { className: "".concat(messageListClass, " ").concat(threadListClass), onScroll: onScroll, ref: setListElement, tabIndex: 0 }, showEmptyStateIndicator ? (React__default["default"].createElement(EmptyStateIndicator$1, { key: 'empty-state-indicator', listType: threadList ? 'thread' : 'message' })) : (React__default["default"].createElement(InfiniteScroll, __assign({ className: 'str-chat__reverse-infinite-scroll str-chat__message-list-scroll', "data-testid": 'reverse-infinite-scroll', hasNextPage: props.hasMoreNewer, hasPreviousPage: props.hasMore, head: props.head, isLoading: props.loadingMore, loader: React__default["default"].createElement("div", { className: 'str-chat__list__loading', key: 'loading-indicator' }, props.loadingMore && React__default["default"].createElement(LoadingIndicator$1, { size: 20 })), loadNextPage: loadMoreNewer, loadPreviousPage: loadMore }, props.internalInfiniteScrollProps, { threshold: loadMoreScrollThreshold }),
|
|
36503
36570
|
React__default["default"].createElement("ul", { className: 'str-chat__ul', ref: setUlElement }, elements),
|
|
@@ -37235,6 +37302,8 @@ exports.MessageInputContextProvider = MessageInputContextProvider;
|
|
|
37235
37302
|
exports.MessageInputFlat = MessageInputFlat;
|
|
37236
37303
|
exports.MessageInputSmall = MessageInputSmall;
|
|
37237
37304
|
exports.MessageList = MessageList;
|
|
37305
|
+
exports.MessageListContext = MessageListContext;
|
|
37306
|
+
exports.MessageListContextProvider = MessageListContextProvider;
|
|
37238
37307
|
exports.MessageNotification = MessageNotification;
|
|
37239
37308
|
exports.MessageOptions = MessageOptions;
|
|
37240
37309
|
exports.MessageProvider = MessageProvider;
|
|
@@ -37321,6 +37390,7 @@ exports.handleActionWarning = handleActionWarning;
|
|
|
37321
37390
|
exports.hasMoreMessagesProbably = hasMoreMessagesProbably;
|
|
37322
37391
|
exports.hasNotMoreMessages = hasNotMoreMessages;
|
|
37323
37392
|
exports.hiTranslations = hiTranslations;
|
|
37393
|
+
exports.htmlToTextPlugin = htmlToTextPlugin;
|
|
37324
37394
|
exports.insertIntro = insertIntro;
|
|
37325
37395
|
exports.isAudioAttachment = isAudioAttachment;
|
|
37326
37396
|
exports.isChannel = isChannel;
|
|
@@ -37338,6 +37408,7 @@ exports.isUploadedImage = isUploadedImage;
|
|
|
37338
37408
|
exports.isUserMuted = isUserMuted;
|
|
37339
37409
|
exports.itTranslations = itTranslations;
|
|
37340
37410
|
exports.jaTranslations = jaTranslations;
|
|
37411
|
+
exports.keepLineBreaksPlugin = keepLineBreaksPlugin;
|
|
37341
37412
|
exports.koTranslations = koTranslations;
|
|
37342
37413
|
exports.makeDateMessageId = makeDateMessageId;
|
|
37343
37414
|
exports.mapToUserNameOrId = mapToUserNameOrId;
|
|
@@ -37394,6 +37465,7 @@ exports.useMentionsHandler = useMentionsHandler;
|
|
|
37394
37465
|
exports.useMessageContext = useMessageContext;
|
|
37395
37466
|
exports.useMessageInputContext = useMessageInputContext;
|
|
37396
37467
|
exports.useMessageInputState = useMessageInputState;
|
|
37468
|
+
exports.useMessageListContext = useMessageListContext;
|
|
37397
37469
|
exports.useMessageListElements = useMessageListElements;
|
|
37398
37470
|
exports.useMessageListScrollManager = useMessageListScrollManager;
|
|
37399
37471
|
exports.useMessageNewListener = useMessageNewListener;
|