stream-chat-react 11.20.0 → 11.22.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/{Window-06cc5899.js → Window-b4032c33.js} +141 -9733
- package/dist/browser.full-bundle.js +19204 -19139
- package/dist/browser.full-bundle.js.map +1 -1
- package/dist/browser.full-bundle.min.js +4 -4
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/components/Channel/Channel.d.ts.map +1 -1
- package/dist/components/Channel/Channel.js +4 -4
- package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts.map +1 -1
- package/dist/components/ChatAutoComplete/ChatAutoComplete.js +1 -1
- package/dist/components/DateSeparator/DateSeparator.d.ts +2 -1
- package/dist/components/DateSeparator/DateSeparator.d.ts.map +1 -1
- package/dist/components/DateSeparator/DateSeparator.js +4 -8
- package/dist/components/Emojis/index.cjs.js +13 -13
- package/dist/components/EventComponent/EventComponent.d.ts +2 -1
- package/dist/components/EventComponent/EventComponent.d.ts.map +1 -1
- package/dist/components/EventComponent/EventComponent.js +4 -8
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts.map +1 -1
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.js +9 -3
- package/dist/components/MediaRecorder/transcode/mp3.d.ts.map +1 -1
- package/dist/components/MediaRecorder/transcode/mp3.js +7 -6
- package/dist/components/Message/MessageTimestamp.d.ts +2 -3
- package/dist/components/Message/MessageTimestamp.d.ts.map +1 -1
- package/dist/components/Message/Timestamp.d.ts +2 -3
- package/dist/components/Message/Timestamp.d.ts.map +1 -1
- package/dist/components/Message/Timestamp.js +6 -3
- package/dist/components/Message/renderText/remarkPlugins/keepLineBreaksPlugin.js +1 -1
- package/dist/components/MessageInput/MessageInput.d.ts +2 -0
- package/dist/components/MessageInput/MessageInput.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.d.ts.map +1 -1
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +3 -1
- package/dist/components/MessageList/VirtualizedMessageList.d.ts +2 -2
- package/dist/components/MessageList/VirtualizedMessageList.d.ts.map +1 -1
- package/dist/components/MessageList/VirtualizedMessageList.js +2 -1
- package/dist/components/MessageList/VirtualizedMessageListComponents.d.ts.map +1 -1
- package/dist/components/MessageList/VirtualizedMessageListComponents.js +2 -2
- package/dist/context/ChannelActionContext.d.ts +2 -2
- package/dist/context/ChannelActionContext.d.ts.map +1 -1
- package/dist/i18n/Streami18n.d.ts +7 -0
- package/dist/i18n/Streami18n.d.ts.map +1 -1
- package/dist/i18n/Streami18n.js +16 -3
- package/dist/i18n/de.json +3 -0
- package/dist/i18n/en.json +3 -0
- package/dist/i18n/es.json +3 -0
- package/dist/i18n/fr.json +3 -0
- package/dist/i18n/hi.json +3 -0
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/it.json +3 -0
- package/dist/i18n/ja.json +3 -0
- package/dist/i18n/ko.json +3 -0
- package/dist/i18n/nl.json +3 -0
- package/dist/i18n/pt.json +3 -0
- package/dist/i18n/ru.json +3 -0
- package/dist/i18n/tr.json +3 -0
- package/dist/i18n/utils.d.ts +18 -5
- package/dist/i18n/utils.d.ts.map +1 -1
- package/dist/i18n/utils.js +43 -2
- package/dist/index.cjs.js +22 -15
- package/dist/lamejs-261a59f5.js +9648 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelActionContext.d.ts","sourceRoot":"","sources":["../../src/context/ChannelActionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,YAAY,EACb,MAAM,aAAa,CAAC;AAErB,OA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C;IACvD,WAAW,EAAE,CACX,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAC1C,iBAAiB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EACxD,OAAO,CAAC,EAAE,kBAAkB,KACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,uBAAuB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC,CAAC;IAChG,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAC9B,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC,CACpE,CAAC;IACF,aAAa,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;CACrE,CAAC;AAEF,eAAO,MAAM,oBAAoB,iFAEhC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;wBAWjC,CAAC;AAEF,eAAO,MAAM,uBAAuB,qGAGlB,MAAM,kDAavB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;CAqBpC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { TFunction } from 'i18next';
|
|
|
2
2
|
import Dayjs from 'dayjs';
|
|
3
3
|
import type momentTimezone from 'moment-timezone';
|
|
4
4
|
import type { TranslationLanguages } from 'stream-chat';
|
|
5
|
+
import type { CustomFormatters, PredefinedFormatters } from './utils';
|
|
5
6
|
import type { TDateTimeParser } from '../context/TranslationContext';
|
|
6
7
|
import type { UnknownType } from '../types/types';
|
|
7
8
|
import { enTranslations } from './translations';
|
|
@@ -33,6 +34,7 @@ export type Streami18nOptions = {
|
|
|
33
34
|
};
|
|
34
35
|
debug?: boolean;
|
|
35
36
|
disableDateTimeTranslations?: boolean;
|
|
37
|
+
formatters?: Partial<PredefinedFormatters> & CustomFormatters;
|
|
36
38
|
language?: TranslationLanguages;
|
|
37
39
|
logger?: (message?: string) => void;
|
|
38
40
|
parseMissingKeyHandler?: (key: string, defaultValue?: string) => string;
|
|
@@ -67,12 +69,14 @@ export declare class Streami18n {
|
|
|
67
69
|
logger: (msg?: string) => void;
|
|
68
70
|
currentLanguage: TranslationLanguages;
|
|
69
71
|
DateTimeParser: DateTimeParserModule;
|
|
72
|
+
formatters: PredefinedFormatters & CustomFormatters;
|
|
70
73
|
isCustomDateTimeParser: boolean;
|
|
71
74
|
i18nextConfig: {
|
|
72
75
|
debug: boolean;
|
|
73
76
|
fallbackLng: false;
|
|
74
77
|
interpolation: {
|
|
75
78
|
escapeValue: boolean;
|
|
79
|
+
formatSeparator: string;
|
|
76
80
|
};
|
|
77
81
|
keySeparator: false;
|
|
78
82
|
lng: string;
|
|
@@ -244,6 +248,9 @@ export declare class Streami18n {
|
|
|
244
248
|
searchResultsCount_one: string;
|
|
245
249
|
searchResultsCount_other: string;
|
|
246
250
|
"this content could not be displayed": string;
|
|
251
|
+
"timestamp/DateSeparator": string;
|
|
252
|
+
"timestamp/MessageTimestamp": string;
|
|
253
|
+
"timestamp/SystemMessage": string;
|
|
247
254
|
unreadMessagesSeparatorText_one: string;
|
|
248
255
|
unreadMessagesSeparatorText_other: string;
|
|
249
256
|
"{{ commaSeparatedUsers }} and {{ moreCount }} more": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Streami18n.d.ts","sourceRoot":"","sources":["../../src/i18n/Streami18n.ts"],"names":[],"mappings":"AAAA,OAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Streami18n.d.ts","sourceRoot":"","sources":["../../src/i18n/Streami18n.ts"],"names":[],"mappings":"AAAA,OAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,KAAK,cAAc,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAA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ACpB,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,KAAK,CAAC;QACnB,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;KACzE,CAAC;IACF;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;gBACS,OAAO,GAAE,iBAAsB;IAgG3C;;OAEG;IACG,IAAI;;;;IA0BV,YAAY,aAAc,oBAAoB,aAI5C;IAEF,uBAAuB,aAWrB;IAEF,qEAAqE;IACrE,cAAc,+BAA2B;IAEzC,2CAA2C;IAC3C,qBAAqB,iBAAwC;IAE7D,uEAAuE;IACvE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA2B;IAE1C;;OAEG;IACG,cAAc;;;;IAepB,mBAAmB,CACjB,QAAQ,EAAE,oBAAoB,EAC9B,WAAW,EAAE,OAAO,cAAc,EAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;IA+BtC,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC;IAS/D,WAAW,CAAC,QAAQ,EAAE,oBAAoB;IAmBhD,2BAA2B,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI;CAG7D"}
|
package/dist/i18n/Streami18n.js
CHANGED
|
@@ -8,9 +8,8 @@ import localeData from 'dayjs/plugin/localeData';
|
|
|
8
8
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
9
9
|
import utc from 'dayjs/plugin/utc';
|
|
10
10
|
import timezone from 'dayjs/plugin/timezone';
|
|
11
|
+
import { predefinedFormatters } from './utils';
|
|
11
12
|
import { deTranslations, enTranslations, esTranslations, frTranslations, hiTranslations, itTranslations, jaTranslations, koTranslations, nlTranslations, ptTranslations, ruTranslations, trTranslations, } from './translations';
|
|
12
|
-
var defaultNS = 'translation';
|
|
13
|
-
var defaultLng = 'en';
|
|
14
13
|
import 'dayjs/locale/de';
|
|
15
14
|
import 'dayjs/locale/es';
|
|
16
15
|
import 'dayjs/locale/fr';
|
|
@@ -26,6 +25,8 @@ import 'dayjs/locale/tr';
|
|
|
26
25
|
// So As a last step I am going to import english locale
|
|
27
26
|
// to make sure I don't mess up language at other places in app.
|
|
28
27
|
import 'dayjs/locale/en';
|
|
28
|
+
var defaultNS = 'translation';
|
|
29
|
+
var defaultLng = 'en';
|
|
29
30
|
Dayjs.extend(updateLocale);
|
|
30
31
|
Dayjs.extend(utc);
|
|
31
32
|
Dayjs.extend(timezone);
|
|
@@ -418,6 +419,7 @@ var Streami18n = /** @class */ (function () {
|
|
|
418
419
|
* with moment, when setLanguage is called.
|
|
419
420
|
* */
|
|
420
421
|
this.dayjsLocales = {};
|
|
422
|
+
this.formatters = predefinedFormatters;
|
|
421
423
|
this.localeExists = function (language) {
|
|
422
424
|
if (_this.isCustomDateTimeParser)
|
|
423
425
|
return true;
|
|
@@ -444,6 +446,7 @@ var Streami18n = /** @class */ (function () {
|
|
|
444
446
|
this.currentLanguage = finalOptions.language;
|
|
445
447
|
this.DateTimeParser = finalOptions.DateTimeParser;
|
|
446
448
|
this.timezone = finalOptions.timezone;
|
|
449
|
+
this.formatters = __assign(__assign({}, predefinedFormatters), options === null || options === void 0 ? void 0 : options.formatters);
|
|
447
450
|
try {
|
|
448
451
|
if (this.DateTimeParser && isDayJs(this.DateTimeParser)) {
|
|
449
452
|
this.DateTimeParser.extend(LocalizedFormat);
|
|
@@ -473,7 +476,7 @@ var Streami18n = /** @class */ (function () {
|
|
|
473
476
|
this.i18nextConfig = {
|
|
474
477
|
debug: finalOptions.debug,
|
|
475
478
|
fallbackLng: false,
|
|
476
|
-
interpolation: { escapeValue: false },
|
|
479
|
+
interpolation: { escapeValue: false, formatSeparator: '|' },
|
|
477
480
|
keySeparator: false,
|
|
478
481
|
lng: this.currentLanguage,
|
|
479
482
|
nsSeparator: false,
|
|
@@ -512,6 +515,7 @@ var Streami18n = /** @class */ (function () {
|
|
|
512
515
|
Streami18n.prototype.init = function () {
|
|
513
516
|
return __awaiter(this, void 0, void 0, function () {
|
|
514
517
|
var _a, error_1;
|
|
518
|
+
var _this = this;
|
|
515
519
|
return __generator(this, function (_b) {
|
|
516
520
|
switch (_b.label) {
|
|
517
521
|
case 0:
|
|
@@ -524,6 +528,15 @@ var Streami18n = /** @class */ (function () {
|
|
|
524
528
|
case 2:
|
|
525
529
|
_a.t = _b.sent();
|
|
526
530
|
this.initialized = true;
|
|
531
|
+
if (this.formatters) {
|
|
532
|
+
Object.entries(this.formatters).forEach(function (_a) {
|
|
533
|
+
var _b;
|
|
534
|
+
var name = _a[0], formatterFactory = _a[1];
|
|
535
|
+
if (!formatterFactory)
|
|
536
|
+
return;
|
|
537
|
+
(_b = _this.i18nInstance.services.formatter) === null || _b === void 0 ? void 0 : _b.add(name, formatterFactory(_this));
|
|
538
|
+
});
|
|
539
|
+
}
|
|
527
540
|
return [3 /*break*/, 4];
|
|
528
541
|
case 3:
|
|
529
542
|
error_1 = _b.sent();
|
package/dist/i18n/de.json
CHANGED
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"searchResultsCount_one": "1 Ergebnis",
|
|
123
123
|
"searchResultsCount_other": "{{ count }} Ergebnisse",
|
|
124
124
|
"this content could not be displayed": "Dieser Inhalt konnte nicht angezeigt werden",
|
|
125
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
126
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
127
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
125
128
|
"unban-command-args": "[@Benutzername]",
|
|
126
129
|
"unban-command-description": "Einen Benutzer entbannen",
|
|
127
130
|
"unmute-command-args": "[@Benutzername]",
|
package/dist/i18n/en.json
CHANGED
|
@@ -116,6 +116,9 @@
|
|
|
116
116
|
"searchResultsCount_one": "1 result",
|
|
117
117
|
"searchResultsCount_other": "{{ count }} results",
|
|
118
118
|
"this content could not be displayed": "this content could not be displayed",
|
|
119
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
120
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
121
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
119
122
|
"unreadMessagesSeparatorText_one": "1 unread message",
|
|
120
123
|
"unreadMessagesSeparatorText_other": "{{count}} unread messages",
|
|
121
124
|
"{{ commaSeparatedUsers }} and {{ moreCount }} more": "{{ commaSeparatedUsers }} and {{ moreCount }} more",
|
package/dist/i18n/es.json
CHANGED
|
@@ -124,6 +124,9 @@
|
|
|
124
124
|
"searchResultsCount_one": "1 resultado",
|
|
125
125
|
"searchResultsCount_other": "{{ count }} resultados",
|
|
126
126
|
"this content could not be displayed": "este contenido no se pudo mostrar",
|
|
127
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
128
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
129
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
127
130
|
"unban-command-args": "[@usuario]",
|
|
128
131
|
"unban-command-description": "Quitar la prohibición a un usuario",
|
|
129
132
|
"unmute-command-args": "[@usuario]",
|
package/dist/i18n/fr.json
CHANGED
|
@@ -124,6 +124,9 @@
|
|
|
124
124
|
"searchResultsCount_one": "1 résultat",
|
|
125
125
|
"searchResultsCount_other": "{{ count }} résultats",
|
|
126
126
|
"this content could not be displayed": "ce contenu n'a pu être affiché",
|
|
127
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
128
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
129
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
127
130
|
"unban-command-args": "[@nomdutilisateur]",
|
|
128
131
|
"unban-command-description": "Débannir un utilisateur",
|
|
129
132
|
"unmute-command-args": "[@nomdutilisateur]",
|
package/dist/i18n/hi.json
CHANGED
|
@@ -123,6 +123,9 @@
|
|
|
123
123
|
"searchResultsCount_one": "1 परिणाम",
|
|
124
124
|
"searchResultsCount_other": "{{ count }} परिणाम",
|
|
125
125
|
"this content could not be displayed": "यह कॉन्टेंट लोड नहीं हो पाया",
|
|
126
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
127
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
128
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
126
129
|
"unban-command-args": "[@उपयोगकर्तनाम]",
|
|
127
130
|
"unban-command-description": "एक उपयोगकर्ता को प्रतिषेध से मुक्त करें",
|
|
128
131
|
"unmute-command-args": "[@उपयोगकर्तनाम]",
|
package/dist/i18n/index.d.ts
CHANGED
package/dist/i18n/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/i18n/it.json
CHANGED
|
@@ -124,6 +124,9 @@
|
|
|
124
124
|
"searchResultsCount_one": "1 risultato",
|
|
125
125
|
"searchResultsCount_other": "{{ count }} risultati",
|
|
126
126
|
"this content could not be displayed": "questo contenuto non puó essere mostrato",
|
|
127
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
128
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
129
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
127
130
|
"unban-command-args": "[@nomeutente]",
|
|
128
131
|
"unban-command-description": "Togliere il divieto a un utente",
|
|
129
132
|
"unmute-command-args": "[@nomeutente]",
|
package/dist/i18n/ja.json
CHANGED
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"searchResultsCount_one": "1件の結果",
|
|
123
123
|
"searchResultsCount_other": "{{ count }}件の結果",
|
|
124
124
|
"this content could not be displayed": "このコンテンツは表示できませんでした",
|
|
125
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
126
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
127
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
125
128
|
"unban-command-args": "[@ユーザ名]",
|
|
126
129
|
"unban-command-description": "ユーザーの禁止を解除する",
|
|
127
130
|
"unmute-command-args": "[@ユーザ名]",
|
package/dist/i18n/ko.json
CHANGED
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"searchResultsCount_one": "1개의 결과",
|
|
123
123
|
"searchResultsCount_other": "{{ count }}개 결과",
|
|
124
124
|
"this content could not be displayed": "이 콘텐츠를 표시할 수 없습니다",
|
|
125
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
126
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
127
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
125
128
|
"unban-command-args": "[@사용자이름]",
|
|
126
129
|
"unban-command-description": "사용자 차단 해제",
|
|
127
130
|
"unmute-command-args": "[@사용자이름]",
|
package/dist/i18n/nl.json
CHANGED
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"searchResultsCount_one": "1 resultaat",
|
|
123
123
|
"searchResultsCount_other": "{{ count }} resultaten",
|
|
124
124
|
"this content could not be displayed": "Deze inhoud kan niet weergegeven worden",
|
|
125
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
126
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
127
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
125
128
|
"unban-command-args": "[@gebruikersnaam]",
|
|
126
129
|
"unban-command-description": "Een gebruiker debannen",
|
|
127
130
|
"unmute-command-args": "[@gebruikersnaam]",
|
package/dist/i18n/pt.json
CHANGED
|
@@ -124,6 +124,9 @@
|
|
|
124
124
|
"searchResultsCount_one": "1 resultado",
|
|
125
125
|
"searchResultsCount_other": "{{ count }} resultados",
|
|
126
126
|
"this content could not be displayed": "este conteúdo não pôde ser exibido",
|
|
127
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
128
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
129
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
127
130
|
"unban-command-args": "[@nomedeusuário]",
|
|
128
131
|
"unban-command-description": "Desbanir um usuário",
|
|
129
132
|
"unmute-command-args": "[@nomedeusuário]",
|
package/dist/i18n/ru.json
CHANGED
|
@@ -126,6 +126,9 @@
|
|
|
126
126
|
"searchResultsCount_one": "1 результат",
|
|
127
127
|
"searchResultsCount_other": "{{ count }} результатов",
|
|
128
128
|
"this content could not be displayed": "Этот контент не может быть отображен в данный момент",
|
|
129
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
130
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
131
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
129
132
|
"unban-command-args": "[@имяпользователя]",
|
|
130
133
|
"unban-command-description": "Разблокировать пользователя",
|
|
131
134
|
"unmute-command-args": "[@имяпользователя]",
|
package/dist/i18n/tr.json
CHANGED
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"searchResultsCount_one": "1 sonuç",
|
|
123
123
|
"searchResultsCount_other": "{{ count }} sonuç",
|
|
124
124
|
"this content could not be displayed": "bu içerik gösterilemiyor",
|
|
125
|
+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
|
|
126
|
+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true; format: h:mmA) }}",
|
|
127
|
+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
|
|
125
128
|
"unban-command-args": "[@kullanıcıadı]",
|
|
126
129
|
"unban-command-description": "Bir kullanıcının yasağını kaldır",
|
|
127
130
|
"unmute-command-args": "[@kullanıcıadı]",
|
package/dist/i18n/utils.d.ts
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { MessageContextValue, TDateTimeParser } from '../context';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { TFunction } from 'i18next';
|
|
3
|
+
import type { Streami18n } from './Streami18n';
|
|
4
|
+
export type TimestampFormatterOptions = {
|
|
5
|
+
calendar?: boolean | null;
|
|
6
|
+
calendarFormats?: Record<string, string> | null;
|
|
7
|
+
format?: string | null;
|
|
8
|
+
};
|
|
9
|
+
type DateFormatterOptions = TimestampFormatterOptions & {
|
|
5
10
|
formatDate?: MessageContextValue['formatDate'];
|
|
6
11
|
messageCreatedAt?: string | Date;
|
|
12
|
+
t?: TFunction;
|
|
7
13
|
tDateTimeParser?: TDateTimeParser;
|
|
8
|
-
|
|
14
|
+
timestampTranslationKey?: string;
|
|
15
|
+
};
|
|
9
16
|
export declare const notValidDateWarning = "MessageTimestamp was called without a message, or message has invalid created_at date.";
|
|
10
17
|
export declare const noParsingFunctionWarning = "MessageTimestamp was called but there is no datetime parsing function available";
|
|
11
|
-
export declare function getDateString({ calendar, format, formatDate, messageCreatedAt, tDateTimeParser, }: DateFormatterOptions): string | number | null;
|
|
18
|
+
export declare function getDateString({ calendar, calendarFormats, format, formatDate, messageCreatedAt, t, tDateTimeParser, timestampTranslationKey, }: DateFormatterOptions): string | number | null;
|
|
19
|
+
export type FormatterFactory<V> = (streamI18n: Streami18n) => (value: V, lng: string | undefined, options: Record<string, unknown>) => string;
|
|
20
|
+
export type CustomFormatters = Record<string, FormatterFactory<any>>;
|
|
21
|
+
export type PredefinedFormatters = {
|
|
22
|
+
timestampFormatter: FormatterFactory<string | Date>;
|
|
23
|
+
};
|
|
24
|
+
export declare const predefinedFormatters: PredefinedFormatters;
|
|
12
25
|
export {};
|
|
13
26
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/i18n/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/i18n/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,mBAAmB,EACnB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,UAAU,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/i18n/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,mBAAmB,EACnB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAA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AM,GAAG,IAAI,CAAC,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,oBAmClC,CAAC"}
|
package/dist/i18n/utils.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
1
2
|
import { isDate, isDayOrMoment, isNumberOrString, } from '../context';
|
|
2
3
|
export var notValidDateWarning = 'MessageTimestamp was called without a message, or message has invalid created_at date.';
|
|
3
4
|
export var noParsingFunctionWarning = 'MessageTimestamp was called but there is no datetime parsing function available';
|
|
4
5
|
export function getDateString(_a) {
|
|
5
|
-
var calendar = _a.calendar, format = _a.format, formatDate = _a.formatDate, messageCreatedAt = _a.messageCreatedAt, tDateTimeParser = _a.tDateTimeParser;
|
|
6
|
+
var calendar = _a.calendar, calendarFormats = _a.calendarFormats, format = _a.format, formatDate = _a.formatDate, messageCreatedAt = _a.messageCreatedAt, t = _a.t, tDateTimeParser = _a.tDateTimeParser, timestampTranslationKey = _a.timestampTranslationKey;
|
|
6
7
|
if (!messageCreatedAt ||
|
|
7
8
|
(typeof messageCreatedAt === 'string' && !Date.parse(messageCreatedAt))) {
|
|
8
9
|
console.warn(notValidDateWarning);
|
|
@@ -11,6 +12,19 @@ export function getDateString(_a) {
|
|
|
11
12
|
if (typeof formatDate === 'function') {
|
|
12
13
|
return formatDate(new Date(messageCreatedAt));
|
|
13
14
|
}
|
|
15
|
+
if (t && timestampTranslationKey) {
|
|
16
|
+
var options = {};
|
|
17
|
+
if (typeof calendar !== 'undefined' && calendar !== null)
|
|
18
|
+
options.calendar = calendar;
|
|
19
|
+
if (typeof calendarFormats !== 'undefined' && calendarFormats !== null)
|
|
20
|
+
options.calendarFormats = calendarFormats;
|
|
21
|
+
if (typeof format !== 'undefined' && format !== null)
|
|
22
|
+
options.format = format;
|
|
23
|
+
var translatedTimestamp = t(timestampTranslationKey, __assign(__assign({}, options), { timestamp: new Date(messageCreatedAt) }));
|
|
24
|
+
var translationKeyFound = timestampTranslationKey !== translatedTimestamp;
|
|
25
|
+
if (translationKeyFound)
|
|
26
|
+
return translatedTimestamp;
|
|
27
|
+
}
|
|
14
28
|
if (!tDateTimeParser) {
|
|
15
29
|
console.warn(noParsingFunctionWarning);
|
|
16
30
|
return null;
|
|
@@ -21,7 +35,9 @@ export function getDateString(_a) {
|
|
|
21
35
|
* parsedTime.calendar is guaranteed on the type but is only
|
|
22
36
|
* available when a user calls dayjs.extend(calendar)
|
|
23
37
|
*/
|
|
24
|
-
return calendar && parsedTime.calendar
|
|
38
|
+
return calendar && parsedTime.calendar
|
|
39
|
+
? parsedTime.calendar(undefined, calendarFormats || undefined)
|
|
40
|
+
: parsedTime.format(format || undefined);
|
|
25
41
|
}
|
|
26
42
|
if (isDate(parsedTime)) {
|
|
27
43
|
return parsedTime.toDateString();
|
|
@@ -31,3 +47,28 @@ export function getDateString(_a) {
|
|
|
31
47
|
}
|
|
32
48
|
return null;
|
|
33
49
|
}
|
|
50
|
+
export var predefinedFormatters = {
|
|
51
|
+
timestampFormatter: function (streamI18n) { return function (value, _, _a) {
|
|
52
|
+
var calendarFormats = _a.calendarFormats, options = __rest(_a, ["calendarFormats"]);
|
|
53
|
+
var parsedCalendarFormats;
|
|
54
|
+
try {
|
|
55
|
+
if (!options.calendar) {
|
|
56
|
+
parsedCalendarFormats = {};
|
|
57
|
+
}
|
|
58
|
+
else if (typeof calendarFormats === 'string') {
|
|
59
|
+
parsedCalendarFormats = JSON.parse(calendarFormats);
|
|
60
|
+
}
|
|
61
|
+
else if (typeof calendarFormats === 'object') {
|
|
62
|
+
parsedCalendarFormats = calendarFormats;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
console.error('[TIMESTAMP FORMATTER]', e);
|
|
67
|
+
}
|
|
68
|
+
var result = getDateString(__assign(__assign({}, options), { calendarFormats: parsedCalendarFormats, messageCreatedAt: value, tDateTimeParser: streamI18n.tDateTimeParser }));
|
|
69
|
+
if (!result || typeof result === 'number') {
|
|
70
|
+
return JSON.stringify(value);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}; },
|
|
74
|
+
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Window = require('./Window-
|
|
5
|
+
var Window = require('./Window-b4032c33.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var streamChat = require('stream-chat');
|
|
8
8
|
var throttle = require('lodash.throttle');
|
|
@@ -25,6 +25,14 @@ require('dayjs/plugin/localeData');
|
|
|
25
25
|
require('dayjs/plugin/relativeTime');
|
|
26
26
|
require('dayjs/plugin/utc');
|
|
27
27
|
require('dayjs/plugin/timezone');
|
|
28
|
+
require('prop-types');
|
|
29
|
+
require('@babel/runtime/helpers/extends');
|
|
30
|
+
require('@babel/runtime/helpers/defineProperty');
|
|
31
|
+
require('react-textarea-autosize');
|
|
32
|
+
require('textarea-caret');
|
|
33
|
+
require('react-is');
|
|
34
|
+
require('crypto');
|
|
35
|
+
require('react/jsx-runtime');
|
|
28
36
|
require('dayjs/locale/de');
|
|
29
37
|
require('dayjs/locale/es');
|
|
30
38
|
require('dayjs/locale/fr');
|
|
@@ -37,14 +45,6 @@ require('dayjs/locale/pt');
|
|
|
37
45
|
require('dayjs/locale/ru');
|
|
38
46
|
require('dayjs/locale/tr');
|
|
39
47
|
require('dayjs/locale/en');
|
|
40
|
-
require('prop-types');
|
|
41
|
-
require('@babel/runtime/helpers/extends');
|
|
42
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
43
|
-
require('react-textarea-autosize');
|
|
44
|
-
require('textarea-caret');
|
|
45
|
-
require('react-is');
|
|
46
|
-
require('crypto');
|
|
47
|
-
require('react/jsx-runtime');
|
|
48
48
|
|
|
49
49
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
50
50
|
|
|
@@ -526,6 +526,8 @@ var InfiniteScroll = function (props) {
|
|
|
526
526
|
var hasNextPageFlag = hasNextPage || hasMoreNewer;
|
|
527
527
|
var hasPreviousPageFlag = hasPreviousPage || hasMore;
|
|
528
528
|
var scrollComponent = React.useRef();
|
|
529
|
+
var previousOffset = React.useRef();
|
|
530
|
+
var previousReverseOffset = React.useRef();
|
|
529
531
|
var scrollListenerRef = React.useRef();
|
|
530
532
|
scrollListenerRef.current = function () {
|
|
531
533
|
var element = scrollComponent.current;
|
|
@@ -541,7 +543,11 @@ var InfiniteScroll = function (props) {
|
|
|
541
543
|
}
|
|
542
544
|
if (isLoading)
|
|
543
545
|
return;
|
|
544
|
-
|
|
546
|
+
if (previousOffset.current === offset && previousReverseOffset.current === reverseOffset)
|
|
547
|
+
return;
|
|
548
|
+
previousOffset.current = offset;
|
|
549
|
+
previousReverseOffset.current = reverseOffset;
|
|
550
|
+
// FIXME: this triggers loadMore call when a user types messages in thread and the scroll container expands
|
|
545
551
|
if (reverseOffset < Number(threshold) &&
|
|
546
552
|
typeof loadPreviousPageFn === 'function' &&
|
|
547
553
|
hasPreviousPageFlag) {
|
|
@@ -560,7 +566,7 @@ var InfiniteScroll = function (props) {
|
|
|
560
566
|
], 'InfiniteScroll');
|
|
561
567
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
562
568
|
}, []);
|
|
563
|
-
React.
|
|
569
|
+
React.useEffect(function () {
|
|
564
570
|
var _a;
|
|
565
571
|
var scrollElement = (_a = scrollComponent.current) === null || _a === void 0 ? void 0 : _a.parentNode;
|
|
566
572
|
if (!scrollElement)
|
|
@@ -1075,7 +1081,7 @@ var Footer = function () {
|
|
|
1075
1081
|
};
|
|
1076
1082
|
var messageRenderer = function (virtuosoIndex, _data, virtuosoContext) {
|
|
1077
1083
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1078
|
-
var additionalMessageInputProps = virtuosoContext.additionalMessageInputProps, closeReactionSelectorOnClick = virtuosoContext.closeReactionSelectorOnClick, customMessageActions = virtuosoContext.customMessageActions, customMessageRenderer = virtuosoContext.customMessageRenderer, DateSeparator = virtuosoContext.DateSeparator, firstUnreadMessageId = virtuosoContext.firstUnreadMessageId, lastReadDate = virtuosoContext.lastReadDate, lastReadMessageId = virtuosoContext.lastReadMessageId, lastReceivedMessageId = virtuosoContext.lastReceivedMessageId, MessageUIComponent = virtuosoContext.Message, messageActions = virtuosoContext.messageActions, MessageSystem = virtuosoContext.MessageSystem, numItemsPrepended = virtuosoContext.numItemsPrepended, ownMessagesReadByOthers = virtuosoContext.ownMessagesReadByOthers, messageList = virtuosoContext.processedMessages, reactionDetailsSort = virtuosoContext.reactionDetailsSort, shouldGroupByUser = virtuosoContext.shouldGroupByUser, sortReactionDetails = virtuosoContext.sortReactionDetails, sortReactions = virtuosoContext.sortReactions, _h = virtuosoContext.unreadMessageCount, unreadMessageCount = _h === void 0 ? 0 : _h, UnreadMessagesSeparator = virtuosoContext.UnreadMessagesSeparator, virtuosoRef = virtuosoContext.virtuosoRef;
|
|
1084
|
+
var additionalMessageInputProps = virtuosoContext.additionalMessageInputProps, closeReactionSelectorOnClick = virtuosoContext.closeReactionSelectorOnClick, customMessageActions = virtuosoContext.customMessageActions, customMessageRenderer = virtuosoContext.customMessageRenderer, DateSeparator = virtuosoContext.DateSeparator, firstUnreadMessageId = virtuosoContext.firstUnreadMessageId, formatDate = virtuosoContext.formatDate, lastReadDate = virtuosoContext.lastReadDate, lastReadMessageId = virtuosoContext.lastReadMessageId, lastReceivedMessageId = virtuosoContext.lastReceivedMessageId, MessageUIComponent = virtuosoContext.Message, messageActions = virtuosoContext.messageActions, MessageSystem = virtuosoContext.MessageSystem, numItemsPrepended = virtuosoContext.numItemsPrepended, ownMessagesReadByOthers = virtuosoContext.ownMessagesReadByOthers, messageList = virtuosoContext.processedMessages, reactionDetailsSort = virtuosoContext.reactionDetailsSort, shouldGroupByUser = virtuosoContext.shouldGroupByUser, sortReactionDetails = virtuosoContext.sortReactionDetails, sortReactions = virtuosoContext.sortReactions, _h = virtuosoContext.unreadMessageCount, unreadMessageCount = _h === void 0 ? 0 : _h, UnreadMessagesSeparator = virtuosoContext.UnreadMessagesSeparator, virtuosoRef = virtuosoContext.virtuosoRef;
|
|
1079
1085
|
var streamMessageIndex = calculateItemIndex(virtuosoIndex, numItemsPrepended);
|
|
1080
1086
|
if (customMessageRenderer) {
|
|
1081
1087
|
return customMessageRenderer(messageList, streamMessageIndex);
|
|
@@ -1116,7 +1122,7 @@ var messageRenderer = function (virtuosoIndex, _data, virtuosoContext) {
|
|
|
1116
1122
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1117
1123
|
showUnreadSeparatorAbove && (React__default["default"].createElement("div", { className: 'str-chat__unread-messages-separator-wrapper' },
|
|
1118
1124
|
React__default["default"].createElement(UnreadMessagesSeparator, { unreadCount: unreadMessageCount }))),
|
|
1119
|
-
React__default["default"].createElement(Window.Message, { additionalMessageInputProps: additionalMessageInputProps, autoscrollToBottom: (_g = virtuosoRef.current) === null || _g === void 0 ? void 0 : _g.autoscrollToBottom, closeReactionSelectorOnClick: closeReactionSelectorOnClick, customMessageActions: customMessageActions, endOfGroup: endOfGroup, firstOfGroup: firstOfGroup, groupedByUser: groupedByUser, lastReceivedId: lastReceivedMessageId, message: message, Message: MessageUIComponent, messageActions: messageActions, reactionDetailsSort: reactionDetailsSort, readBy: ownMessagesReadByOthers[message.id] || [], sortReactionDetails: sortReactionDetails, sortReactions: sortReactions }),
|
|
1125
|
+
React__default["default"].createElement(Window.Message, { additionalMessageInputProps: additionalMessageInputProps, autoscrollToBottom: (_g = virtuosoRef.current) === null || _g === void 0 ? void 0 : _g.autoscrollToBottom, closeReactionSelectorOnClick: closeReactionSelectorOnClick, customMessageActions: customMessageActions, endOfGroup: endOfGroup, firstOfGroup: firstOfGroup, formatDate: formatDate, groupedByUser: groupedByUser, lastReceivedId: lastReceivedMessageId, message: message, Message: MessageUIComponent, messageActions: messageActions, reactionDetailsSort: reactionDetailsSort, readBy: ownMessagesReadByOthers[message.id] || [], sortReactionDetails: sortReactionDetails, sortReactions: sortReactions }),
|
|
1120
1126
|
showUnreadSeparatorBelow && (React__default["default"].createElement("div", { className: 'str-chat__unread-messages-separator-wrapper' },
|
|
1121
1127
|
React__default["default"].createElement(UnreadMessagesSeparator, { unreadCount: unreadMessageCount })))));
|
|
1122
1128
|
};
|
|
@@ -1152,7 +1158,7 @@ function calculateInitialTopMostItemIndex(messages, highlightedMessageId) {
|
|
|
1152
1158
|
}
|
|
1153
1159
|
var VirtualizedMessageListWithContext = function (props) {
|
|
1154
1160
|
var _a, _b;
|
|
1155
|
-
var additionalMessageInputProps = props.additionalMessageInputProps, _c = props.additionalVirtuosoProps, additionalVirtuosoProps = _c === void 0 ? {} : _c, channel = props.channel, channelUnreadUiState = props.channelUnreadUiState, closeReactionSelectorOnClick = props.closeReactionSelectorOnClick, customMessageActions = props.customMessageActions, customMessageRenderer = props.customMessageRenderer, defaultItemHeight = props.defaultItemHeight, _d = props.disableDateSeparator, disableDateSeparator = _d === void 0 ? true : _d, groupStyles = props.groupStyles, hasMoreNewer = props.hasMoreNewer, head = props.head, _e = props.hideDeletedMessages, hideDeletedMessages = _e === void 0 ? false : _e, _f = props.hideNewMessageSeparator, hideNewMessageSeparator = _f === void 0 ? false : _f, highlightedMessageId = props.highlightedMessageId, jumpToLatestMessage = props.jumpToLatestMessage, loadingMore = props.loadingMore, loadMore = props.loadMore, loadMoreNewer = props.loadMoreNewer, MessageUIComponentFromProps = props.Message, messageActions = props.messageActions, _g = props.messageLimit, messageLimit = _g === void 0 ? Window.DEFAULT_NEXT_CHANNEL_PAGE_SIZE : _g, messages = props.messages, notifications = props.notifications,
|
|
1161
|
+
var additionalMessageInputProps = props.additionalMessageInputProps, _c = props.additionalVirtuosoProps, additionalVirtuosoProps = _c === void 0 ? {} : _c, channel = props.channel, channelUnreadUiState = props.channelUnreadUiState, closeReactionSelectorOnClick = props.closeReactionSelectorOnClick, customMessageActions = props.customMessageActions, customMessageRenderer = props.customMessageRenderer, defaultItemHeight = props.defaultItemHeight, _d = props.disableDateSeparator, disableDateSeparator = _d === void 0 ? true : _d, formatDate = props.formatDate, groupStyles = props.groupStyles, hasMoreNewer = props.hasMoreNewer, head = props.head, _e = props.hideDeletedMessages, hideDeletedMessages = _e === void 0 ? false : _e, _f = props.hideNewMessageSeparator, hideNewMessageSeparator = _f === void 0 ? false : _f, highlightedMessageId = props.highlightedMessageId, jumpToLatestMessage = props.jumpToLatestMessage, loadingMore = props.loadingMore, loadMore = props.loadMore, loadMoreNewer = props.loadMoreNewer, MessageUIComponentFromProps = props.Message, messageActions = props.messageActions, _g = props.messageLimit, messageLimit = _g === void 0 ? Window.DEFAULT_NEXT_CHANNEL_PAGE_SIZE : _g, messages = props.messages, notifications = props.notifications,
|
|
1156
1162
|
// TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
|
|
1157
1163
|
_h = props.overscan,
|
|
1158
1164
|
// TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
|
|
@@ -1318,6 +1324,7 @@ var VirtualizedMessageListWithContext = function (props) {
|
|
|
1318
1324
|
customMessageRenderer: customMessageRenderer,
|
|
1319
1325
|
DateSeparator: DateSeparator,
|
|
1320
1326
|
firstUnreadMessageId: channelUnreadUiState === null || channelUnreadUiState === void 0 ? void 0 : channelUnreadUiState.first_unread_message_id,
|
|
1327
|
+
formatDate: formatDate,
|
|
1321
1328
|
head: head,
|
|
1322
1329
|
lastReadDate: channelUnreadUiState === null || channelUnreadUiState === void 0 ? void 0 : channelUnreadUiState.last_read,
|
|
1323
1330
|
lastReadMessageId: channelUnreadUiState === null || channelUnreadUiState === void 0 ? void 0 : channelUnreadUiState.last_read_message_id,
|
|
@@ -1353,7 +1360,7 @@ function VirtualizedMessageList(props) {
|
|
|
1353
1360
|
return (React__default["default"].createElement(VirtualizedMessageListWithContext, Window.__assign({ channel: channel, channelUnreadUiState: channelUnreadUiState, hasMore: !!hasMore, hasMoreNewer: !!hasMoreNewer, highlightedMessageId: highlightedMessageId, jumpToLatestMessage: jumpToLatestMessage, loadingMore: !!loadingMore, loadingMoreNewer: !!loadingMoreNewer, loadMore: loadMore, loadMoreNewer: loadMoreNewer, messages: messages, notifications: notifications, read: read, suppressAutoscroll: suppressAutoscroll }, props)));
|
|
1354
1361
|
}
|
|
1355
1362
|
|
|
1356
|
-
var version = '11.
|
|
1363
|
+
var version = '11.22.0';
|
|
1357
1364
|
|
|
1358
1365
|
var useChat = function (_a) {
|
|
1359
1366
|
var _b, _c;
|