stream-chat-react-native-core 5.32.0-beta.1 → 5.32.0-beta.3
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/lib/commonjs/components/Channel/Channel.js +7 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +18 -3
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js +4 -17
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +9 -6
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageEditedTimestamp.js +4 -5
- package/lib/commonjs/components/Message/MessageSimple/MessageEditedTimestamp.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +8 -8
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTimestamp.js +21 -18
- package/lib/commonjs/components/Message/MessageSimple/MessageTimestamp.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js +14 -12
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +4 -28
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js +14 -8
- package/lib/commonjs/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/commonjs/components/MessageList/StickyHeader.js +36 -0
- package/lib/commonjs/components/MessageList/StickyHeader.js.map +1 -0
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/hooks/useStreami18n.js +1 -1
- package/lib/commonjs/i18n/en.json +88 -81
- package/lib/commonjs/i18n/es.json +88 -81
- package/lib/commonjs/i18n/fr.json +88 -81
- package/lib/commonjs/i18n/he.json +88 -81
- package/lib/commonjs/i18n/hi.json +88 -81
- package/lib/commonjs/i18n/it.json +88 -81
- package/lib/commonjs/i18n/ja.json +88 -81
- package/lib/commonjs/i18n/ko.json +88 -81
- package/lib/commonjs/i18n/nl.json +88 -81
- package/lib/commonjs/i18n/pt-br.json +90 -0
- package/lib/commonjs/i18n/ru.json +88 -81
- package/lib/commonjs/i18n/tr.json +88 -81
- package/lib/commonjs/index.js +2 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/{module/utils → commonjs/utils/i18n}/Streami18n.js +62 -69
- package/lib/commonjs/utils/i18n/Streami18n.js.map +1 -0
- package/lib/commonjs/utils/i18n/calendarFormats.js +104 -0
- package/lib/commonjs/utils/i18n/calendarFormats.js.map +1 -0
- package/lib/commonjs/utils/i18n/getDateString.js +47 -0
- package/lib/commonjs/utils/i18n/getDateString.js.map +1 -0
- package/lib/commonjs/utils/i18n/predefinedFormatters.js +40 -0
- package/lib/commonjs/utils/i18n/predefinedFormatters.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Channel/Channel.js +7 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +18 -3
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js +4 -17
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +9 -6
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageEditedTimestamp.js +4 -5
- package/lib/module/components/Message/MessageSimple/MessageEditedTimestamp.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +8 -8
- package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTimestamp.js +21 -18
- package/lib/module/components/Message/MessageSimple/MessageTimestamp.js.map +1 -1
- package/lib/module/components/MessageList/InlineDateSeparator.js +14 -12
- package/lib/module/components/MessageList/InlineDateSeparator.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +4 -28
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/MessageSystem.js +14 -8
- package/lib/module/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/module/components/MessageList/StickyHeader.js +36 -0
- package/lib/module/components/MessageList/StickyHeader.js.map +1 -0
- package/lib/module/components/index.js +11 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/hooks/useStreami18n.js +1 -1
- package/lib/module/i18n/en.json +88 -81
- package/lib/module/i18n/es.json +88 -81
- package/lib/module/i18n/fr.json +88 -81
- package/lib/module/i18n/he.json +88 -81
- package/lib/module/i18n/hi.json +88 -81
- package/lib/module/i18n/it.json +88 -81
- package/lib/module/i18n/ja.json +88 -81
- package/lib/module/i18n/ko.json +88 -81
- package/lib/module/i18n/nl.json +88 -81
- package/lib/module/i18n/pt-br.json +90 -0
- package/lib/module/i18n/ru.json +88 -81
- package/lib/module/i18n/tr.json +88 -81
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/{commonjs/utils → module/utils/i18n}/Streami18n.js +62 -69
- package/lib/module/utils/i18n/Streami18n.js.map +1 -0
- package/lib/module/utils/i18n/calendarFormats.js +104 -0
- package/lib/module/utils/i18n/calendarFormats.js.map +1 -0
- package/lib/module/utils/i18n/getDateString.js +47 -0
- package/lib/module/utils/i18n/getDateString.js.map +1 -0
- package/lib/module/utils/i18n/predefinedFormatters.js +40 -0
- package/lib/module/utils/i18n/predefinedFormatters.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewStatus.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts.map +1 -1
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/Chat/Chat.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageEditedTimestamp.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageEditedTimestamp.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageTimestamp.d.ts +2 -13
- package/lib/typescript/components/Message/MessageSimple/MessageTimestamp.d.ts.map +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
- package/lib/typescript/components/MessageList/DateHeader.d.ts +1 -1
- package/lib/typescript/components/MessageList/DateHeader.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/InlineDateSeparator.d.ts +7 -1
- package/lib/typescript/components/MessageList/InlineDateSeparator.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts +1 -2
- package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageSystem.d.ts +3 -0
- package/lib/typescript/components/MessageList/MessageSystem.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/StickyHeader.d.ts +18 -0
- package/lib/typescript/components/MessageList/StickyHeader.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +2 -3
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +1 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +6 -0
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts.map +1 -1
- package/lib/typescript/hooks/useStreami18n.d.ts +1 -1
- package/lib/typescript/hooks/useStreami18n.d.ts.map +1 -1
- package/lib/typescript/i18n/en.json +88 -81
- package/lib/typescript/i18n/es.json +88 -81
- package/lib/typescript/i18n/fr.json +88 -81
- package/lib/typescript/i18n/he.json +88 -81
- package/lib/typescript/i18n/hi.json +88 -81
- package/lib/typescript/i18n/it.json +88 -81
- package/lib/typescript/i18n/ja.json +88 -81
- package/lib/typescript/i18n/ko.json +88 -81
- package/lib/typescript/i18n/nl.json +88 -81
- package/lib/typescript/i18n/pt-br.json +90 -0
- package/lib/typescript/i18n/ru.json +88 -81
- package/lib/typescript/i18n/tr.json +88 -81
- package/lib/typescript/index.d.ts +3 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/{Streami18n.d.ts → i18n/Streami18n.d.ts} +16 -10
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -0
- package/lib/typescript/utils/i18n/calendarFormats.d.ts +14 -0
- package/lib/typescript/utils/i18n/calendarFormats.d.ts.map +1 -0
- package/lib/typescript/utils/i18n/getDateString.d.ts +16 -0
- package/lib/typescript/utils/i18n/getDateString.d.ts.map +1 -0
- package/lib/typescript/utils/i18n/predefinedFormatters.d.ts +13 -0
- package/lib/typescript/utils/i18n/predefinedFormatters.d.ts.map +1 -0
- package/package.json +10 -10
- package/src/components/Attachment/__tests__/Giphy.test.js +1 -1
- package/src/components/Channel/Channel.tsx +6 -1
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +2 -0
- package/src/components/ChannelPreview/ChannelPreviewStatus.tsx +16 -2
- package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +7 -28
- package/src/components/Chat/Chat.tsx +1 -1
- package/src/components/Chat/__tests__/Chat.test.js +1 -1
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +13 -3
- package/src/components/Message/MessageSimple/MessageEditedTimestamp.tsx +10 -5
- package/src/components/Message/MessageSimple/MessageFooter.tsx +10 -7
- package/src/components/Message/MessageSimple/MessageTimestamp.tsx +20 -29
- package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js +1 -1
- package/src/components/MessageList/DateHeader.tsx +1 -1
- package/src/components/MessageList/InlineDateSeparator.tsx +20 -15
- package/src/components/MessageList/MessageList.tsx +4 -31
- package/src/components/MessageList/MessageSystem.tsx +20 -8
- package/src/components/MessageList/StickyHeader.tsx +42 -0
- package/src/components/MessageList/__tests__/MessageSystem.test.js +8 -3
- package/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +1 -1
- package/src/components/MessageList/__tests__/TypingIndicator.test.js +1 -1
- package/src/components/Thread/__tests__/Thread.test.js +1 -1
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +1 -1
- package/src/components/index.ts +1 -0
- package/src/contexts/channelContext/ChannelContext.tsx +2 -1
- package/src/contexts/messagesContext/MessagesContext.tsx +6 -0
- package/src/contexts/overlayContext/OverlayContext.tsx +1 -1
- package/src/hooks/useStreami18n.ts +1 -1
- package/src/i18n/en.json +8 -1
- package/src/i18n/es.json +73 -66
- package/src/i18n/fr.json +73 -66
- package/src/i18n/he.json +73 -66
- package/src/i18n/hi.json +73 -66
- package/src/i18n/it.json +73 -66
- package/src/i18n/ja.json +73 -66
- package/src/i18n/ko.json +75 -68
- package/src/i18n/nl.json +73 -66
- package/src/i18n/pt-br.json +90 -0
- package/src/i18n/ru.json +73 -66
- package/src/i18n/tr.json +73 -66
- package/src/index.ts +4 -1
- package/src/utils/__tests__/Streami18n.test.js +23 -1
- package/src/utils/{Streami18n.ts → i18n/Streami18n.ts} +60 -71
- package/src/utils/i18n/calendarFormats.ts +110 -0
- package/src/utils/i18n/getDateString.ts +76 -0
- package/src/utils/i18n/predefinedFormatters.ts +63 -0
- package/src/version.json +1 -1
- package/lib/commonjs/i18n/pt-BR.json +0 -83
- package/lib/commonjs/utils/Streami18n.js.map +0 -1
- package/lib/commonjs/utils/getDateString.js +0 -31
- package/lib/commonjs/utils/getDateString.js.map +0 -1
- package/lib/module/i18n/pt-BR.json +0 -83
- package/lib/module/utils/Streami18n.js.map +0 -1
- package/lib/module/utils/getDateString.js +0 -31
- package/lib/module/utils/getDateString.js.map +0 -1
- package/lib/typescript/i18n/pt-BR.json +0 -83
- package/lib/typescript/utils/Streami18n.d.ts.map +0 -1
- package/lib/typescript/utils/getDateString.d.ts +0 -30
- package/lib/typescript/utils/getDateString.d.ts.map +0 -1
- package/src/i18n/pt-BR.json +0 -83
- package/src/utils/getDateString.ts +0 -67
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isDayOrMoment,
|
|
3
|
-
TDateTimeParser,
|
|
4
|
-
TDateTimeParserInput,
|
|
5
|
-
} from '../contexts/translationContext/TranslationContext';
|
|
6
|
-
|
|
7
|
-
interface DateFormatterOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Whether to show the time in Calendar time format. Calendar time displays time relative to a today's date.
|
|
10
|
-
*/
|
|
11
|
-
calendar?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* The timestamp to be formatted.
|
|
14
|
-
*/
|
|
15
|
-
date?: string | Date;
|
|
16
|
-
/**
|
|
17
|
-
* The format in which the date should be displayed.
|
|
18
|
-
*/
|
|
19
|
-
format?: string;
|
|
20
|
-
/**
|
|
21
|
-
* A function to format the date.
|
|
22
|
-
*/
|
|
23
|
-
formatDate?: (date: TDateTimeParserInput) => string;
|
|
24
|
-
/**
|
|
25
|
-
* The datetime parsing function.
|
|
26
|
-
*/
|
|
27
|
-
tDateTimeParser?: TDateTimeParser;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const noParsingFunctionWarning =
|
|
31
|
-
'MessageTimestamp was called but there is no datetime parsing function available';
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Utility funcyion to format the date string.
|
|
35
|
-
*/
|
|
36
|
-
export function getDateString({
|
|
37
|
-
calendar,
|
|
38
|
-
date,
|
|
39
|
-
format,
|
|
40
|
-
formatDate,
|
|
41
|
-
tDateTimeParser,
|
|
42
|
-
}: DateFormatterOptions): string | number | undefined {
|
|
43
|
-
if (!date || (typeof date === 'string' && !Date.parse(date))) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (typeof formatDate === 'function') {
|
|
48
|
-
return formatDate(new Date(date));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (!tDateTimeParser) {
|
|
52
|
-
console.log(noParsingFunctionWarning);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const parsedTime = tDateTimeParser(date);
|
|
57
|
-
|
|
58
|
-
if (isDayOrMoment(parsedTime)) {
|
|
59
|
-
/**
|
|
60
|
-
* parsedTime.calendar is guaranteed on the type but is only
|
|
61
|
-
* available when a user calls dayjs.extend(calendar)
|
|
62
|
-
*/
|
|
63
|
-
return calendar && parsedTime.calendar ? parsedTime.calendar() : parsedTime.format(format);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return new Date(date).toDateString();
|
|
67
|
-
}
|