stream-chat-react 11.20.0 → 11.21.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-6c9f7581.js} +131 -83
- package/dist/browser.full-bundle.js +124 -75
- 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/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/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/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 +14 -13
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
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,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,MAAM,yBAAyB,GAAG;IAEtC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE1B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAEhD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,KAAK,oBAAoB,GAAG,yBAAyB,GAAG;IACtD,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC/C,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,CAAC,CAAC,EAAE,SAAS,CAAC;IACd,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,mBAAmB,2FAC0D,CAAC;AAC3F,eAAO,MAAM,wBAAwB,oFAC8C,CAAC;AAEpF,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,eAAe,EACf,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,CAAC,EACD,eAAe,EACf,uBAAuB,GACxB,EAAE,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAsD/C;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAChC,UAAU,EAAE,UAAU,KACnB,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAKrF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG;IACjC,kBAAkB,EAAE,gBAAgB,CAAC,MAAM,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-6c9f7581.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
|
|
|
@@ -1075,7 +1075,7 @@ var Footer = function () {
|
|
|
1075
1075
|
};
|
|
1076
1076
|
var messageRenderer = function (virtuosoIndex, _data, virtuosoContext) {
|
|
1077
1077
|
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;
|
|
1078
|
+
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
1079
|
var streamMessageIndex = calculateItemIndex(virtuosoIndex, numItemsPrepended);
|
|
1080
1080
|
if (customMessageRenderer) {
|
|
1081
1081
|
return customMessageRenderer(messageList, streamMessageIndex);
|
|
@@ -1116,7 +1116,7 @@ var messageRenderer = function (virtuosoIndex, _data, virtuosoContext) {
|
|
|
1116
1116
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1117
1117
|
showUnreadSeparatorAbove && (React__default["default"].createElement("div", { className: 'str-chat__unread-messages-separator-wrapper' },
|
|
1118
1118
|
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 }),
|
|
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, formatDate: formatDate, groupedByUser: groupedByUser, lastReceivedId: lastReceivedMessageId, message: message, Message: MessageUIComponent, messageActions: messageActions, reactionDetailsSort: reactionDetailsSort, readBy: ownMessagesReadByOthers[message.id] || [], sortReactionDetails: sortReactionDetails, sortReactions: sortReactions }),
|
|
1120
1120
|
showUnreadSeparatorBelow && (React__default["default"].createElement("div", { className: 'str-chat__unread-messages-separator-wrapper' },
|
|
1121
1121
|
React__default["default"].createElement(UnreadMessagesSeparator, { unreadCount: unreadMessageCount })))));
|
|
1122
1122
|
};
|
|
@@ -1152,7 +1152,7 @@ function calculateInitialTopMostItemIndex(messages, highlightedMessageId) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
var VirtualizedMessageListWithContext = function (props) {
|
|
1154
1154
|
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,
|
|
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, 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
1156
|
// TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
|
|
1157
1157
|
_h = props.overscan,
|
|
1158
1158
|
// TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
|
|
@@ -1318,6 +1318,7 @@ var VirtualizedMessageListWithContext = function (props) {
|
|
|
1318
1318
|
customMessageRenderer: customMessageRenderer,
|
|
1319
1319
|
DateSeparator: DateSeparator,
|
|
1320
1320
|
firstUnreadMessageId: channelUnreadUiState === null || channelUnreadUiState === void 0 ? void 0 : channelUnreadUiState.first_unread_message_id,
|
|
1321
|
+
formatDate: formatDate,
|
|
1321
1322
|
head: head,
|
|
1322
1323
|
lastReadDate: channelUnreadUiState === null || channelUnreadUiState === void 0 ? void 0 : channelUnreadUiState.last_read,
|
|
1323
1324
|
lastReadMessageId: channelUnreadUiState === null || channelUnreadUiState === void 0 ? void 0 : channelUnreadUiState.last_read_message_id,
|
|
@@ -1353,7 +1354,7 @@ function VirtualizedMessageList(props) {
|
|
|
1353
1354
|
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
1355
|
}
|
|
1355
1356
|
|
|
1356
|
-
var version = '11.
|
|
1357
|
+
var version = '11.21.0';
|
|
1357
1358
|
|
|
1358
1359
|
var useChat = function (_a) {
|
|
1359
1360
|
var _b, _c;
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "11.
|
|
1
|
+
export declare const version = "11.21.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var version = '11.
|
|
1
|
+
export var version = '11.21.0';
|
package/package.json
CHANGED