stream-chat-react 13.0.4 → 13.1.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/components/Channel/Channel.d.ts +1 -1
- package/dist/components/Channel/Channel.js +7 -0
- package/dist/components/ChannelList/hooks/useChannelListShape.js +3 -3
- package/dist/components/Chat/hooks/useChat.js +7 -3
- package/dist/components/Dialog/ButtonWithSubmenu.d.ts +11 -0
- package/dist/components/Dialog/ButtonWithSubmenu.js +88 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +1 -0
- package/dist/components/Loading/LoadingErrorIndicator.js +1 -1
- package/dist/components/Message/Message.js +3 -2
- package/dist/components/Message/MessageSimple.js +11 -4
- package/dist/components/Message/MessageThreadReplyInChannelButtonIndicator.d.ts +2 -0
- package/dist/components/Message/MessageThreadReplyInChannelButtonIndicator.js +63 -0
- package/dist/components/Message/ReminderNotification.d.ts +6 -0
- package/dist/components/Message/ReminderNotification.js +30 -0
- package/dist/components/Message/hooks/index.d.ts +1 -0
- package/dist/components/Message/hooks/index.js +1 -0
- package/dist/components/Message/hooks/useMessageReminder.d.ts +1 -0
- package/dist/components/Message/hooks/useMessageReminder.js +11 -0
- package/dist/components/Message/index.d.ts +1 -0
- package/dist/components/Message/index.js +1 -0
- package/dist/components/Message/utils.d.ts +4 -2
- package/dist/components/Message/utils.js +11 -1
- package/dist/components/MessageActions/MessageActionsBox.js +12 -6
- package/dist/components/MessageActions/RemindMeSubmenu.d.ts +6 -0
- package/dist/components/MessageActions/RemindMeSubmenu.js +18 -0
- package/dist/components/MessageInput/MessageInputFlat.js +5 -3
- package/dist/components/MessageInput/SendToChannelCheckbox.d.ts +2 -0
- package/dist/components/MessageInput/SendToChannelCheckbox.js +20 -0
- package/dist/components/MessageList/MessageListNotifications.js +8 -3
- package/dist/components/MessageList/VirtualizedMessageListComponents.d.ts +1 -1
- package/dist/components/MessageList/VirtualizedMessageListComponents.js +4 -0
- package/dist/components/Notifications/hooks/index.d.ts +1 -0
- package/dist/components/Notifications/hooks/index.js +1 -0
- package/dist/components/Notifications/hooks/useNotifications.d.ts +2 -0
- package/dist/components/Notifications/hooks/useNotifications.js +10 -0
- package/dist/components/Notifications/index.d.ts +1 -0
- package/dist/components/Notifications/index.js +1 -0
- package/dist/components/TextareaComposer/TextareaComposer.js +4 -0
- package/dist/components/Thread/LegacyThreadContext.d.ts +8 -0
- package/dist/components/Thread/LegacyThreadContext.js +3 -0
- package/dist/components/Thread/Thread.d.ts +0 -4
- package/dist/components/Thread/Thread.js +2 -3
- package/dist/components/Thread/index.d.ts +1 -0
- package/dist/components/Thread/index.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/context/ComponentContext.d.ts +6 -1
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/experimental/MessageActions/defaults.d.ts +1 -1
- package/dist/experimental/MessageActions/defaults.js +27 -4
- package/dist/experimental/index.browser.cjs +382 -169
- package/dist/experimental/index.browser.cjs.map +4 -4
- package/dist/experimental/index.node.cjs +382 -169
- package/dist/experimental/index.node.cjs.map +4 -4
- package/dist/i18n/Streami18n.d.ts +32 -3
- package/dist/i18n/Streami18n.js +34 -5
- package/dist/i18n/TranslationBuilder/TranslationBuilder.d.ts +31 -0
- package/dist/i18n/TranslationBuilder/TranslationBuilder.js +68 -0
- package/dist/i18n/TranslationBuilder/index.d.ts +2 -0
- package/dist/i18n/TranslationBuilder/index.js +2 -0
- package/dist/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.d.ts +11 -0
- package/dist/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.js +27 -0
- package/dist/i18n/TranslationBuilder/notifications/attachmentUpload.d.ts +4 -0
- package/dist/i18n/TranslationBuilder/notifications/attachmentUpload.js +32 -0
- package/dist/i18n/TranslationBuilder/notifications/index.d.ts +1 -0
- package/dist/i18n/TranslationBuilder/notifications/index.js +1 -0
- package/dist/i18n/TranslationBuilder/notifications/pollComposition.d.ts +3 -0
- package/dist/i18n/TranslationBuilder/notifications/pollComposition.js +9 -0
- package/dist/i18n/TranslationBuilder/notifications/types.d.ts +4 -0
- package/dist/i18n/TranslationBuilder/notifications/types.js +1 -0
- package/dist/i18n/de.json +23 -0
- package/dist/i18n/en.json +23 -0
- package/dist/i18n/es.json +23 -0
- package/dist/i18n/fr.json +23 -0
- package/dist/i18n/hi.json +23 -0
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/it.json +23 -0
- package/dist/i18n/ja.json +23 -0
- package/dist/i18n/ko.json +23 -0
- package/dist/i18n/nl.json +23 -0
- package/dist/i18n/pt.json +23 -0
- package/dist/i18n/ru.json +23 -0
- package/dist/i18n/tr.json +23 -0
- package/dist/i18n/types.d.ts +54 -0
- package/dist/i18n/utils.d.ts +1 -1
- package/dist/i18n/utils.js +8 -2
- package/dist/index.browser.cjs +3589 -2162
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +3645 -2156
- package/dist/index.node.cjs.map +4 -4
- package/dist/plugins/Emojis/index.browser.cjs +1 -2
- package/dist/plugins/Emojis/index.browser.cjs.map +3 -3
- package/dist/plugins/Emojis/index.node.cjs +1 -2
- package/dist/plugins/Emojis/index.node.cjs.map +3 -3
- package/dist/scss/v2/Message/Message-layout.scss +13 -2
- package/dist/scss/v2/Message/Message-theme.scss +31 -1
- package/dist/scss/v2/MessageActionsBox/MessageActionsBox-theme.scss +8 -0
- package/dist/scss/v2/MessageInput/MessageInput-layout.scss +19 -0
- package/dist/scss/v2/MessageInput/MessageInput-theme.scss +11 -0
- package/package.json +6 -8
package/dist/i18n/types.d.ts
CHANGED
|
@@ -9,6 +9,59 @@ export type TimestampFormatterOptions = {
|
|
|
9
9
|
calendarFormats?: Record<string, string>;
|
|
10
10
|
format?: string;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* import dayjs from 'dayjs';
|
|
14
|
+
* import duration from 'dayjs/plugin/duration';
|
|
15
|
+
*
|
|
16
|
+
* dayjs.extend(duration);
|
|
17
|
+
*
|
|
18
|
+
* // Basic formatting
|
|
19
|
+
* dayjs.duration(1000).format('HH:mm:ss'); // "00:00:01"
|
|
20
|
+
* dayjs.duration(3661000).format('HH:mm:ss'); // "01:01:01"
|
|
21
|
+
*
|
|
22
|
+
* // Different format tokens
|
|
23
|
+
* dayjs.duration(3661000).format('D[d] H[h] m[m] s[s]'); // "0d 1h 1m 1s"
|
|
24
|
+
* dayjs.duration(3661000).format('D [days] H [hours] m [minutes] s [seconds]'); // "0 days 1 hours 1 minutes 1 seconds"
|
|
25
|
+
*
|
|
26
|
+
* // Zero padding
|
|
27
|
+
* dayjs.duration(1000).format('HH:mm:ss'); // "00:00:01"
|
|
28
|
+
* dayjs.duration(1000).format('H:m:s'); // "0:0:1"
|
|
29
|
+
*
|
|
30
|
+
* // Different units
|
|
31
|
+
* dayjs.duration(3661000).format('D'); // "0"
|
|
32
|
+
* dayjs.duration(3661000).format('H'); // "1"
|
|
33
|
+
* dayjs.duration(3661000).format('m'); // "1"
|
|
34
|
+
* dayjs.duration(3661000).format('s'); // "1"
|
|
35
|
+
*
|
|
36
|
+
* // Complex examples
|
|
37
|
+
* dayjs.duration(3661000).format('DD:HH:mm:ss'); // "00:01:01:01"
|
|
38
|
+
* dayjs.duration(3661000).format('D [days] HH:mm:ss'); // "0 days 01:01:01"
|
|
39
|
+
* dayjs.duration(3661000).format('H[h] m[m] s[s]'); // "1h 1m 1s"
|
|
40
|
+
*
|
|
41
|
+
* // Negative durations
|
|
42
|
+
* dayjs.duration(-3661000).format('HH:mm:ss'); // "-01:01:01"
|
|
43
|
+
*
|
|
44
|
+
* // Long durations
|
|
45
|
+
* dayjs.duration(86400000).format('D [days]'); // "1 days"
|
|
46
|
+
* dayjs.duration(2592000000).format('M [months]'); // "30 months"
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* Format tokens:
|
|
50
|
+
* D - days
|
|
51
|
+
* H - hours
|
|
52
|
+
* m - minutes
|
|
53
|
+
* s - seconds
|
|
54
|
+
* S - milliseconds
|
|
55
|
+
* M - months
|
|
56
|
+
* Y - years
|
|
57
|
+
* You can also use:
|
|
58
|
+
* HH, mm, ss for zero-padded numbers
|
|
59
|
+
* [text] for literal text
|
|
60
|
+
*/
|
|
61
|
+
export type DurationFormatterOptions = {
|
|
62
|
+
format?: string;
|
|
63
|
+
withSuffix?: boolean;
|
|
64
|
+
};
|
|
12
65
|
export type TDateTimeParserInput = string | number | Date;
|
|
13
66
|
export type TDateTimeParserOutput = string | number | Date | Dayjs.Dayjs | Moment;
|
|
14
67
|
export type TDateTimeParser = (input?: TDateTimeParserInput) => TDateTimeParserOutput;
|
|
@@ -22,5 +75,6 @@ export type DateFormatterOptions = TimestampFormatterOptions & {
|
|
|
22
75
|
};
|
|
23
76
|
export type CustomFormatters = Record<string, FormatterFactory<any>>;
|
|
24
77
|
export type PredefinedFormatters = {
|
|
78
|
+
durationFormatter: FormatterFactory<number>;
|
|
25
79
|
timestampFormatter: FormatterFactory<string | Date>;
|
|
26
80
|
};
|
package/dist/i18n/utils.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare const isDayOrMoment: (output: TDateTimeParserOutput) => output is
|
|
|
9
9
|
export declare const isDate: (output: unknown) => output is Date;
|
|
10
10
|
export declare function getDateString({ calendar, calendarFormats, format, formatDate, messageCreatedAt, t, tDateTimeParser, timestampTranslationKey, }: DateFormatterOptions): string | number | null;
|
|
11
11
|
export declare const predefinedFormatters: PredefinedFormatters;
|
|
12
|
-
export declare const defaultTranslatorFunction: TFunction
|
|
12
|
+
export declare const defaultTranslatorFunction: TFunction<"translation", undefined>;
|
|
13
13
|
export declare const defaultDateTimeParser: (input?: TDateTimeParserInput) => Dayjs.Dayjs;
|
|
14
14
|
export declare const isLanguageSupported: (language: string) => language is SupportedTranslations;
|
package/dist/i18n/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Dayjs from 'dayjs';
|
|
1
|
+
import Dayjs, { isDayjs } from 'dayjs';
|
|
2
2
|
export const notValidDateWarning = 'MessageTimestamp was called without a message, or message has invalid created_at date.';
|
|
3
3
|
export const noParsingFunctionWarning = 'MessageTimestamp was called but there is no datetime parsing function available';
|
|
4
4
|
export const isNumberOrString = (output) => typeof output === 'string' || typeof output === 'number';
|
|
@@ -54,6 +54,12 @@ export function getDateString({ calendar, calendarFormats, format, formatDate, m
|
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
export const predefinedFormatters = {
|
|
57
|
+
durationFormatter: (streamI18n) => (value, _, { format, withSuffix }) => {
|
|
58
|
+
if (format && isDayjs(streamI18n.DateTimeParser)) {
|
|
59
|
+
return streamI18n.DateTimeParser.duration(value).format(format);
|
|
60
|
+
}
|
|
61
|
+
return streamI18n.DateTimeParser.duration(value).humanize(!!withSuffix);
|
|
62
|
+
},
|
|
57
63
|
timestampFormatter: (streamI18n) => (value, _, { calendarFormats, ...options }) => {
|
|
58
64
|
let parsedCalendarFormats;
|
|
59
65
|
try {
|
|
@@ -82,7 +88,7 @@ export const predefinedFormatters = {
|
|
|
82
88
|
return result;
|
|
83
89
|
},
|
|
84
90
|
};
|
|
85
|
-
export const defaultTranslatorFunction = (key) => key;
|
|
91
|
+
export const defaultTranslatorFunction = ((key) => key);
|
|
86
92
|
export const defaultDateTimeParser = (input) => Dayjs(input);
|
|
87
93
|
export const isLanguageSupported = (language) => {
|
|
88
94
|
const translations = [
|