@cometchat/chat-uikit-react-native 5.5.4 → 5.7.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/android/src/main/java/com/reactnativecometchatuikit/CometChatKeyboardModule.kt +101 -0
- package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +1 -0
- package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +78 -3
- package/android/src/main/java/com/reactnativecometchatuikit/KeyboardDirectionWatcher.kt +64 -0
- package/android/src/main/java/com/reactnativecometchatuikit/KeyboardLanguageDirection.kt +44 -0
- package/android/src/main/java/com/reactnativecometchatuikit/RichTextEditorView.kt +287 -49
- package/android/src/main/java/com/reactnativecometchatuikit/SafeFileName.java +78 -0
- package/ios/CCLocalFileGuard.h +19 -0
- package/ios/CCLocalFileGuard.m +34 -0
- package/ios/CometChatKeyboardModule.m +9 -0
- package/ios/CometChatKeyboardModule.swift +71 -0
- package/ios/FileManager.m +70 -6
- package/ios/KeyboardLanguageDirection.swift +24 -0
- package/ios/RichTextEditorView.swift +253 -51
- package/ios/RichTextEditorViewManager.m +1 -0
- package/ios/VideoManager.m +1 -1
- package/package.json +18 -3
- package/src/CometChatAIAssistantChatHistory/CometChatAIAssistantChatHistory.tsx +41 -57
- package/src/CometChatAIAssistantChatHistory/Skeleton.tsx +4 -1
- package/src/CometChatAIAssistantChatHistory/style.ts +5 -2
- package/src/CometChatCompactMessageComposer/CometChatCompactMessageComposer.tsx +145 -63
- package/src/CometChatCompactMessageComposer/styles.ts +7 -7
- package/src/CometChatConversations/CometChatConversations.tsx +276 -147
- package/src/CometChatConversations/Skeleton.tsx +4 -1
- package/src/CometChatConversations/style.ts +1 -1
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +39 -18
- package/src/CometChatGroupMembers/Skeleton.tsx +4 -1
- package/src/CometChatGroupMembers/style.ts +6 -4
- package/src/CometChatGroups/CometChatGroups.tsx +74 -58
- package/src/CometChatGroups/GroupsStyle.ts +1 -1
- package/src/CometChatGroups/Skeleton.tsx +4 -1
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +190 -96
- package/src/CometChatMessageComposer/styles.tsx +1 -1
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +28 -15
- package/src/CometChatMessageHeader/listners.ts +76 -56
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +8 -1
- package/src/CometChatMessageInformation/Skeleton.tsx +4 -1
- package/src/CometChatMessageList/CometChatMessageList.tsx +1465 -313
- package/src/CometChatMessageList/SwipeToReplyView.tsx +61 -0
- package/src/CometChatMessageList/style.ts +32 -32
- package/src/CometChatMessageList/swipeToReply.ts +25 -0
- package/src/CometChatNotificationFeed/CometChatNotificationFeed.tsx +81 -10
- package/src/CometChatNotificationFeed/style.ts +1 -1
- package/src/CometChatNotificationFeed/utils.ts +17 -18
- package/src/CometChatPinnedMessages/CometChatPinnedMessages.tsx +82 -3
- package/src/CometChatPinnedMessages/style.ts +5 -5
- package/src/CometChatRichTextEditor/RichTextEditorViewNativeComponent.ts +2 -0
- package/src/CometChatRichTextEditor/index.tsx +3 -0
- package/src/CometChatSavedMessages/CometChatSavedMessages.tsx +83 -15
- package/src/CometChatSavedMessages/style.ts +3 -3
- package/src/CometChatSearch/CometChatSearch.tsx +391 -136
- package/src/CometChatSearch/Skeleton.tsx +4 -1
- package/src/CometChatSearch/searchLabels.ts +26 -0
- package/src/CometChatSearch/style.ts +7 -7
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +34 -8
- package/src/CometChatThreadHeader/Header.tsx +2 -2
- package/src/CometChatUsers/CometChatUsers.tsx +10 -1
- package/src/CometChatUsers/Skeleton.tsx +4 -1
- package/src/CometChatUsers/style.ts +1 -1
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +27 -1
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +16 -4
- package/src/calls/CometChatCallLogs/Skeleton.tsx +4 -1
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +11 -3
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +10 -2
- package/src/extensions/CollaborativeBubble/style.ts +4 -4
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +1 -1
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +1 -1
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +11 -6
- package/src/extensions/LinkPreview/style.ts +6 -6
- package/src/extensions/Polls/Header.tsx +1 -1
- package/src/extensions/Polls/Polls.tsx +25 -12
- package/src/extensions/Polls/PollsBubble.tsx +10 -6
- package/src/extensions/Polls/style.ts +4 -4
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +2 -2
- package/src/extensions/Stickers/CometChatStickerKeyboard/Skeleton.tsx +1 -1
- package/src/extensions/Stickers/CometChatStickerKeyboard/style.ts +1 -1
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +4 -2
- package/src/index.ts +11 -1
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +102 -2
- package/src/shared/CometChatUiKit/UIKitSettings.ts +28 -0
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +10 -0
- package/src/shared/events/index.ts +4 -0
- package/src/shared/events/offline.ts +28 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +18 -13
- package/src/shared/formatters/CometChatRichTextFormatter/index.tsx +15 -7
- package/src/shared/formatters/CometChatTextFormatter.ts +11 -0
- package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +7 -4
- package/src/shared/framework/MessageDataSource.tsx +51 -108
- package/src/shared/helper/LocalizedDateHelper.ts +64 -4
- package/src/shared/helper/helperFunctions.ts +71 -4
- package/src/shared/helper/keyboardDirection.ts +54 -0
- package/src/shared/helper/layoutDirection.ts +205 -0
- package/src/shared/helper/pluralRules.ts +67 -0
- package/src/shared/helper/textDirection.ts +118 -0
- package/src/shared/icons/Icon.tsx +37 -2
- package/src/shared/icons/components/format-list-numbered-rtl.tsx +15 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/offline/OfflineHub.ts +651 -0
- package/src/shared/offline/OfflineMediaBubble.tsx +49 -0
- package/src/shared/offline/OfflineViews.tsx +222 -0
- package/src/shared/offline/conversationPins.ts +137 -0
- package/src/shared/offline/conversations.ts +325 -0
- package/src/shared/offline/frameProbe.ts +24 -0
- package/src/shared/offline/gate.ts +94 -0
- package/src/shared/offline/groupActions.ts +81 -0
- package/src/shared/offline/identity.ts +162 -0
- package/src/shared/offline/index.ts +76 -0
- package/src/shared/offline/media.ts +247 -0
- package/src/shared/offline/notices.ts +84 -0
- package/src/shared/offline/reconcile.ts +296 -0
- package/src/shared/offline/searchOutcome.ts +62 -0
- package/src/shared/offline/send.ts +430 -0
- package/src/shared/offline/stateContract.ts +85 -0
- package/src/shared/offline/threadReplies.ts +125 -0
- package/src/shared/offline/twoPhase.ts +372 -0
- package/src/shared/offline/unsentActions.ts +168 -0
- package/src/shared/offline/useOfflineMediaUri.ts +87 -0
- package/src/shared/offline/useOfflineReconnect.ts +25 -0
- package/src/shared/offline/useOfflineSessionEnded.ts +22 -0
- package/src/shared/offline/useOfflineUploadTray.ts +76 -0
- package/src/shared/offline/usePresenceHidden.ts +33 -0
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizationHelper.ts +2 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ar/translation.json +720 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +75 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +75 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +82 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +90 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +74 -3
- package/src/shared/services/UploadQueueService.ts +106 -1
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +13 -12
- package/src/shared/utils/CometChatMessagePreview/style.ts +1 -1
- package/src/shared/utils/MessageReceiptUtils.ts +8 -0
- package/src/shared/utils/MessageUtils.tsx +14 -14
- package/src/shared/utils/PermissionUtil.ts +16 -5
- package/src/shared/utils/SavedMessagesHelper.ts +18 -1
- package/src/shared/utils/attachmentLimits.ts +3 -2
- package/src/shared/utils/catchUpCursor.ts +36 -0
- package/src/shared/utils/conversationUtils.ts +3 -5
- package/src/shared/utils/failedMessageRetry.ts +73 -0
- package/src/shared/utils/fileIconFontSize.ts +10 -0
- package/src/shared/utils/fileSizeLabel.ts +16 -0
- package/src/shared/utils/groupActionText.ts +75 -0
- package/src/shared/utils/messageIdentity.ts +38 -0
- package/src/shared/views/CometChatAIAssistantMessageBubble/CometChatAIAssistantMessageBubble.tsx +12 -8
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreview.style.ts +1 -1
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreviewItem.tsx +5 -3
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentTile.tsx +22 -17
- package/src/shared/views/CometChatAttachmentViewer/CometChatAttachmentViewer.tsx +45 -12
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +16 -10
- package/src/shared/views/CometChatAudiosBubble/CometChatAudiosBubble.tsx +20 -8
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +8 -4
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +6 -2
- package/src/shared/views/CometChatComposerErrorBanner.tsx +3 -1
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +8 -3
- package/src/shared/views/CometChatConversationStarter/CometChatConversationStarter.tsx +2 -2
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +5 -3
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +8 -8
- package/src/shared/views/CometChatEmojiKeyboard/style.ts +2 -2
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +13 -27
- package/src/shared/views/CometChatFilesBubble/CometChatFilesBubble.tsx +65 -15
- package/src/shared/views/CometChatImageViewerModal/ImageViewerModal.tsx +7 -3
- package/src/shared/views/CometChatImagesBubble/CometChatImagesBubble.tsx +56 -25
- package/src/shared/views/CometChatInlineAudioRecorder/CometChatInlineAudioRecorder.tsx +41 -21
- package/src/shared/views/CometChatInlineAudioRecorder/useAudioRecorder.ts +7 -3
- package/src/shared/views/CometChatLinkConfirmPopup/CometChatLinkConfirmPopup.tsx +7 -3
- package/src/shared/views/CometChatList/CometChatList.tsx +478 -21
- package/src/shared/views/CometChatList/Header.tsx +5 -2
- package/src/shared/views/CometChatList/sectionLetter.ts +44 -0
- package/src/shared/views/CometChatList/styles.ts +7 -7
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +6 -4
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPlayer.tsx +16 -10
- package/src/shared/views/CometChatMediaRecorder/Timer.tsx +5 -1
- package/src/shared/views/CometChatMediaViewer/CometChatMediaViewer.tsx +43 -16
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +24 -4
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +19 -2
- package/src/shared/views/CometChatNewMessageIndicator/CometChatNewMessageIndicator.tsx +3 -2
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +59 -12
- package/src/shared/views/CometChatReactionList/ReactionListStyle.tsx +2 -2
- package/src/shared/views/CometChatReactionList/Skeleton.tsx +4 -1
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +6 -2
- package/src/shared/views/CometChatReportDialog/CometChatReportDialog.tsx +7 -3
- package/src/shared/views/CometChatReportDialog/style.ts +1 -1
- package/src/shared/views/CometChatSmartReplies/CometChatSmartReplies.tsx +1 -1
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +4 -0
- package/src/shared/views/CometChatStreamMessageBubble/CometChatStreamMessageBubble.tsx +20 -13
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +3 -2
- package/src/shared/views/CometChatSuggestionList/Skeleton.tsx +1 -1
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +29 -3
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +20 -30
- package/src/shared/views/CometChatTooltipMenu/tooltipPosition.ts +43 -0
- package/src/shared/views/CometChatVideoBubble/style.ts +2 -2
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +4 -1
- package/src/shared/views/CometChatVideosBubble/CometChatVideosBubble.tsx +58 -24
- package/src/shared/views/CometChatVoiceNoteBubble/CometChatVoiceNoteBubble.tsx +24 -12
- package/src/shared/views/SenderLabel.tsx +41 -0
- package/src/theme/default/default.ts +1 -1
- package/src/theme/type.ts +17 -0
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { Animated } from "react-native";
|
|
3
|
+
import {
|
|
4
|
+
PanGestureHandler,
|
|
5
|
+
PanGestureHandlerGestureEvent,
|
|
6
|
+
PanGestureHandlerStateChangeEvent,
|
|
7
|
+
State,
|
|
8
|
+
} from "react-native-gesture-handler";
|
|
9
|
+
import { useKitRTL } from "../shared/helper/layoutDirection";
|
|
10
|
+
import { shouldReply, swipeOffset } from "./swipeToReply";
|
|
11
|
+
|
|
12
|
+
type Props = {
|
|
13
|
+
/** Emits the reply. Called only when a released drag qualifies (swipeToReply.ts). */
|
|
14
|
+
onReply: () => void;
|
|
15
|
+
/** Checked on release — e.g. an outgoing message still under moderation can't be replied to. */
|
|
16
|
+
canReply: () => boolean;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* ENG-41315: a message bubble that slides toward the end side to reply — right in LTR, left in RTL.
|
|
22
|
+
* Its own component so only swipeable rows pay for the gesture state, and its hooks never sit
|
|
23
|
+
* behind the message list's template checks.
|
|
24
|
+
*/
|
|
25
|
+
export const SwipeToReplyView = ({ onReply, canReply, children }: Props) => {
|
|
26
|
+
// useState initialiser: one Animated.Value per row, not a new one discarded every render.
|
|
27
|
+
const [offset] = useState(() => new Animated.Value(0));
|
|
28
|
+
const isRTL = useKitRTL();
|
|
29
|
+
|
|
30
|
+
const onGestureEvent = useCallback(
|
|
31
|
+
(event: PanGestureHandlerGestureEvent) => {
|
|
32
|
+
offset.setValue(swipeOffset(event.nativeEvent.translationX, isRTL));
|
|
33
|
+
},
|
|
34
|
+
[offset, isRTL]
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const onHandlerStateChange = useCallback(
|
|
38
|
+
(event: PanGestureHandlerStateChangeEvent) => {
|
|
39
|
+
const { state, translationX, velocityX } = event.nativeEvent;
|
|
40
|
+
// Cancelled or failed (the list's scroll took over, the app went to the background) must
|
|
41
|
+
// spring back too, or the bubble stays shifted sideways.
|
|
42
|
+
if (state !== State.END && state !== State.CANCELLED && state !== State.FAILED) return;
|
|
43
|
+
Animated.spring(offset, { toValue: 0, useNativeDriver: true }).start();
|
|
44
|
+
if (state === State.END && canReply() && shouldReply(translationX, velocityX, isRTL)) {
|
|
45
|
+
onReply();
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
[offset, isRTL, canReply, onReply]
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<PanGestureHandler
|
|
53
|
+
onGestureEvent={onGestureEvent}
|
|
54
|
+
onHandlerStateChange={onHandlerStateChange}
|
|
55
|
+
activeOffsetX={[-10, 10]}
|
|
56
|
+
failOffsetY={[-50, 50]}
|
|
57
|
+
>
|
|
58
|
+
<Animated.View style={{ transform: [{ translateX: offset }] }}>{children}</Animated.View>
|
|
59
|
+
</PanGestureHandler>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -105,7 +105,7 @@ export const getMessageListStylesLight = (
|
|
|
105
105
|
flexDirection: "column",
|
|
106
106
|
alignItems: "center",
|
|
107
107
|
backgroundColor: color.background1,
|
|
108
|
-
|
|
108
|
+
end: 10,
|
|
109
109
|
bottom: 2,
|
|
110
110
|
gap: spacing.padding.p1,
|
|
111
111
|
borderRadius: spacing.radius.max,
|
|
@@ -211,7 +211,7 @@ export const getMessageListStylesLight = (
|
|
|
211
211
|
containerStyle: {
|
|
212
212
|
paddingTop: spacing.padding.p2,
|
|
213
213
|
paddingBottom: spacing.padding.p2,
|
|
214
|
-
|
|
214
|
+
paddingStart: spacing.padding.p1,
|
|
215
215
|
},
|
|
216
216
|
textStyle: {
|
|
217
217
|
color: color.receiveBubbleTimestamp,
|
|
@@ -257,9 +257,9 @@ export const getMessageListStylesLight = (
|
|
|
257
257
|
// Figma: padding 4px top/right/left, 0 bottom — leaves a thin bubble-color
|
|
258
258
|
// frame around the media; the timestamp row sits flush under the grid.
|
|
259
259
|
paddingTop: spacing.padding.p1,
|
|
260
|
-
|
|
260
|
+
paddingEnd: spacing.padding.p1,
|
|
261
261
|
paddingBottom: spacing.padding.p0,
|
|
262
|
-
|
|
262
|
+
paddingStart: spacing.padding.p1,
|
|
263
263
|
borderRadius: spacing.radius.r3,
|
|
264
264
|
alignSelf: "flex-start",
|
|
265
265
|
},
|
|
@@ -272,7 +272,7 @@ export const getMessageListStylesLight = (
|
|
|
272
272
|
dateReceiptContainerStyle: {
|
|
273
273
|
// Figma: 2px gap between the media grid and the timestamp row.
|
|
274
274
|
paddingTop: spacing.padding.p0_5,
|
|
275
|
-
|
|
275
|
+
paddingEnd: spacing.padding.p1,
|
|
276
276
|
paddingBottom: spacing.padding.p1,
|
|
277
277
|
},
|
|
278
278
|
},
|
|
@@ -348,9 +348,9 @@ export const getMessageListStylesLight = (
|
|
|
348
348
|
borderRadius: spacing.radius.r5,
|
|
349
349
|
backgroundColor: color.primary,
|
|
350
350
|
paddingTop: 1,
|
|
351
|
-
|
|
351
|
+
paddingEnd: spacing.padding.p1,
|
|
352
352
|
paddingBottom: 3,
|
|
353
|
-
|
|
353
|
+
paddingStart: spacing.padding.p1,
|
|
354
354
|
},
|
|
355
355
|
textStyle: {
|
|
356
356
|
...typography.caption2.regular,
|
|
@@ -403,10 +403,10 @@ export const getMessageListStylesLight = (
|
|
|
403
403
|
containerStyle: {
|
|
404
404
|
backgroundColor: "#F9EAEF",
|
|
405
405
|
paddingVertical: 6,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
406
|
+
borderBottomStartRadius: 8,
|
|
407
|
+
borderBottomEndRadius: 8,
|
|
408
|
+
borderTopStartRadius: 0,
|
|
409
|
+
borderTopEndRadius: 0,
|
|
410
410
|
flexDirection: "row",
|
|
411
411
|
alignItems: "center",
|
|
412
412
|
},
|
|
@@ -496,9 +496,9 @@ export const getMessageListStylesLight = (
|
|
|
496
496
|
// Figma: padding 4px top/right/left, 0 bottom — leaves a thin bubble-color
|
|
497
497
|
// frame around the media; the timestamp row sits flush under the grid.
|
|
498
498
|
paddingTop: spacing.padding.p1,
|
|
499
|
-
|
|
499
|
+
paddingEnd: spacing.padding.p1,
|
|
500
500
|
paddingBottom: spacing.padding.p0,
|
|
501
|
-
|
|
501
|
+
paddingStart: spacing.padding.p1,
|
|
502
502
|
borderRadius: spacing.radius.r3,
|
|
503
503
|
overflow: "hidden",
|
|
504
504
|
},
|
|
@@ -512,7 +512,7 @@ export const getMessageListStylesLight = (
|
|
|
512
512
|
dateReceiptContainerStyle: {
|
|
513
513
|
// Figma: 2px gap between the media grid and the timestamp row.
|
|
514
514
|
paddingTop: spacing.padding.p0_5,
|
|
515
|
-
|
|
515
|
+
paddingEnd: spacing.padding.p1,
|
|
516
516
|
paddingBottom: spacing.padding.p1,
|
|
517
517
|
},
|
|
518
518
|
},
|
|
@@ -552,9 +552,9 @@ export const getMessageListStylesLight = (
|
|
|
552
552
|
borderRadius: spacing.radius.r5,
|
|
553
553
|
backgroundColor: color.primary,
|
|
554
554
|
paddingTop: 1,
|
|
555
|
-
|
|
555
|
+
paddingEnd: spacing.padding.p1,
|
|
556
556
|
paddingBottom: 3,
|
|
557
|
-
|
|
557
|
+
paddingStart: spacing.padding.p1,
|
|
558
558
|
},
|
|
559
559
|
textStyle: {
|
|
560
560
|
...typography.caption2.regular,
|
|
@@ -621,7 +621,7 @@ export const getMessageListStylesDark = (
|
|
|
621
621
|
flexDirection: "column",
|
|
622
622
|
alignItems: "center",
|
|
623
623
|
backgroundColor: color.background3,
|
|
624
|
-
|
|
624
|
+
end: 10,
|
|
625
625
|
bottom: 2,
|
|
626
626
|
gap: spacing.padding.p1,
|
|
627
627
|
borderRadius: spacing.radius.max,
|
|
@@ -729,7 +729,7 @@ export const getMessageListStylesDark = (
|
|
|
729
729
|
containerStyle: {
|
|
730
730
|
paddingTop: spacing.padding.p2,
|
|
731
731
|
paddingBottom: spacing.padding.p2,
|
|
732
|
-
|
|
732
|
+
paddingStart: spacing.padding.p1,
|
|
733
733
|
},
|
|
734
734
|
textStyle: {
|
|
735
735
|
color: color.receiveBubbleTimestamp,
|
|
@@ -775,9 +775,9 @@ export const getMessageListStylesDark = (
|
|
|
775
775
|
// Figma: padding 4px top/right/left, 0 bottom — leaves a thin bubble-color
|
|
776
776
|
// frame around the media; the timestamp row sits flush under the grid.
|
|
777
777
|
paddingTop: spacing.padding.p1,
|
|
778
|
-
|
|
778
|
+
paddingEnd: spacing.padding.p1,
|
|
779
779
|
paddingBottom: spacing.padding.p0,
|
|
780
|
-
|
|
780
|
+
paddingStart: spacing.padding.p1,
|
|
781
781
|
borderRadius: spacing.radius.r3,
|
|
782
782
|
alignSelf: "flex-start",
|
|
783
783
|
},
|
|
@@ -790,7 +790,7 @@ export const getMessageListStylesDark = (
|
|
|
790
790
|
dateReceiptContainerStyle: {
|
|
791
791
|
// Figma: 2px gap between the media grid and the timestamp row.
|
|
792
792
|
paddingTop: spacing.padding.p0_5,
|
|
793
|
-
|
|
793
|
+
paddingEnd: spacing.padding.p1,
|
|
794
794
|
paddingBottom: spacing.padding.p1,
|
|
795
795
|
},
|
|
796
796
|
},
|
|
@@ -875,9 +875,9 @@ export const getMessageListStylesDark = (
|
|
|
875
875
|
borderRadius: spacing.radius.r5,
|
|
876
876
|
backgroundColor: color.primary,
|
|
877
877
|
paddingTop: 1,
|
|
878
|
-
|
|
878
|
+
paddingEnd: spacing.padding.p1,
|
|
879
879
|
paddingBottom: 3,
|
|
880
|
-
|
|
880
|
+
paddingStart: spacing.padding.p1,
|
|
881
881
|
},
|
|
882
882
|
textStyle: {
|
|
883
883
|
...typography.caption2.regular,
|
|
@@ -921,10 +921,10 @@ export const getMessageListStylesDark = (
|
|
|
921
921
|
containerStyle: {
|
|
922
922
|
backgroundColor: "#3A0C05",
|
|
923
923
|
paddingVertical: 6,
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
924
|
+
borderBottomStartRadius: 8,
|
|
925
|
+
borderBottomEndRadius: 8,
|
|
926
|
+
borderTopStartRadius: 0,
|
|
927
|
+
borderTopEndRadius: 0,
|
|
928
928
|
flexDirection: "row",
|
|
929
929
|
alignItems: "center",
|
|
930
930
|
overflow: 'hidden',
|
|
@@ -1015,9 +1015,9 @@ export const getMessageListStylesDark = (
|
|
|
1015
1015
|
// Figma: padding 4px top/right/left, 0 bottom — leaves a thin bubble-color
|
|
1016
1016
|
// frame around the media; the timestamp row sits flush under the grid.
|
|
1017
1017
|
paddingTop: spacing.padding.p1,
|
|
1018
|
-
|
|
1018
|
+
paddingEnd: spacing.padding.p1,
|
|
1019
1019
|
paddingBottom: spacing.padding.p0,
|
|
1020
|
-
|
|
1020
|
+
paddingStart: spacing.padding.p1,
|
|
1021
1021
|
borderRadius: spacing.radius.r3,
|
|
1022
1022
|
overflow: "hidden",
|
|
1023
1023
|
},
|
|
@@ -1031,7 +1031,7 @@ export const getMessageListStylesDark = (
|
|
|
1031
1031
|
dateReceiptContainerStyle: {
|
|
1032
1032
|
// Figma: 2px gap between the media grid and the timestamp row.
|
|
1033
1033
|
paddingTop: spacing.padding.p0_5,
|
|
1034
|
-
|
|
1034
|
+
paddingEnd: spacing.padding.p1,
|
|
1035
1035
|
paddingBottom: spacing.padding.p1,
|
|
1036
1036
|
},
|
|
1037
1037
|
},
|
|
@@ -1080,9 +1080,9 @@ export const getMessageListStylesDark = (
|
|
|
1080
1080
|
borderRadius: spacing.radius.r5,
|
|
1081
1081
|
backgroundColor: color.primary,
|
|
1082
1082
|
paddingTop: 1,
|
|
1083
|
-
|
|
1083
|
+
paddingEnd: spacing.padding.p1,
|
|
1084
1084
|
paddingBottom: 3,
|
|
1085
|
-
|
|
1085
|
+
paddingStart: spacing.padding.p1,
|
|
1086
1086
|
},
|
|
1087
1087
|
textStyle: {
|
|
1088
1088
|
...typography.caption2.regular,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// ENG-41315: swipe-to-reply goes toward the end side — right in LTR, left in RTL. Gesture
|
|
2
|
+
// translation/velocity and translateX are physical; these helpers work in "toward the end" terms.
|
|
3
|
+
|
|
4
|
+
export const SWIPE_REPLY_THRESHOLD = 80;
|
|
5
|
+
export const SWIPE_MAX_DISTANCE = 120;
|
|
6
|
+
export const SWIPE_FLICK_VELOCITY = 500;
|
|
7
|
+
|
|
8
|
+
/** Physical translateX for the bubble while dragging; 0 when dragged toward the start side. */
|
|
9
|
+
export function swipeOffset(translationX: number, isRTL: boolean): number {
|
|
10
|
+
const sign = isRTL ? -1 : 1;
|
|
11
|
+
const towardEnd = translationX * sign;
|
|
12
|
+
return towardEnd <= 0 ? 0 : Math.min(towardEnd, SWIPE_MAX_DISTANCE) * sign;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Whether a released drag replies: far enough toward the end, or flicked toward the end. The flick
|
|
17
|
+
* only counts when the drag itself went toward the end — a drag back toward the start followed
|
|
18
|
+
* by a quick end-ward flick on release doesn't reply.
|
|
19
|
+
*/
|
|
20
|
+
export function shouldReply(translationX: number, velocityX: number, isRTL: boolean): boolean {
|
|
21
|
+
const sign = isRTL ? -1 : 1;
|
|
22
|
+
const towardEnd = translationX * sign;
|
|
23
|
+
if (towardEnd <= 0) return false;
|
|
24
|
+
return towardEnd > SWIPE_REPLY_THRESHOLD || velocityX * sign > SWIPE_FLICK_VELOCITY;
|
|
25
|
+
}
|
|
@@ -38,6 +38,15 @@ import { Skeleton } from "./Skeleton";
|
|
|
38
38
|
import Header from "../shared/views/CometChatList/Header";
|
|
39
39
|
import { ErrorEmptyView } from "../shared/views/ErrorEmptyView/ErrorEmptyView";
|
|
40
40
|
import NotificationEmptyIcon from "../shared/icons/components/notification-empty";
|
|
41
|
+
import { LayoutDirectionContext, directionStyle, useComponentLayoutDirection } from "../shared/helper/layoutDirection";
|
|
42
|
+
import { readListPage } from "../shared/offline/twoPhase";
|
|
43
|
+
import { useOfflineSessionEnded } from "../shared/offline/useOfflineSessionEnded";
|
|
44
|
+
import { useOfflineReconnect } from "../shared/offline/useOfflineReconnect";
|
|
45
|
+
import { isOfflineOn, sdkConnected } from "../shared/offline/gate";
|
|
46
|
+
import { isNotConnectedError } from "../shared/offline/reconcile";
|
|
47
|
+
import { ConnectStateView } from "../shared/offline/OfflineViews";
|
|
48
|
+
import { OFFLINE_STRING_KEYS } from "../shared/offline/notices";
|
|
49
|
+
import { CONTRACT_IDS } from "../shared/offline/stateContract";
|
|
41
50
|
|
|
42
51
|
// ───────────────────────────────────────────────────────────────
|
|
43
52
|
// Module-level constants (hoisted — no GC churn)
|
|
@@ -69,6 +78,8 @@ interface CardAction {
|
|
|
69
78
|
* Props interface for CometChatNotificationFeed.
|
|
70
79
|
*/
|
|
71
80
|
export interface CometChatNotificationFeedInterface {
|
|
81
|
+
/** Lays this component out `"ltr"` or `"rtl"`, overriding the kit's global `layoutDirection`. Not set = inherit. */
|
|
82
|
+
layoutDirection?: "ltr" | "rtl";
|
|
72
83
|
// ─── Content Configuration ───────────────────────────────────
|
|
73
84
|
/** Feed title. Default: "Notifications" */
|
|
74
85
|
title?: string;
|
|
@@ -136,6 +147,8 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
136
147
|
cardThemeMode = "auto",
|
|
137
148
|
cardThemeOverride,
|
|
138
149
|
} = props;
|
|
150
|
+
// ENG-41333: own setting → enclosing component → global; drives the root and the context.
|
|
151
|
+
const direction = useComponentLayoutDirection(props.layoutDirection);
|
|
139
152
|
|
|
140
153
|
// ─── Theme & Styles ──────────────────────────────────────────
|
|
141
154
|
const theme = useTheme();
|
|
@@ -148,6 +161,16 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
148
161
|
// ─── State ───────────────────────────────────────────────────
|
|
149
162
|
const [screenState, setScreenState] = useState<ScreenState>("loading");
|
|
150
163
|
const [feedItems, setFeedItems] = useState<NotificationFeedItem[]>([]);
|
|
164
|
+
// Offline ON: nothing of the old session stays on screen (UIK-LIFE-01).
|
|
165
|
+
useOfflineSessionEnded(() => {
|
|
166
|
+
setFeedItems([]);
|
|
167
|
+
setScreenState("empty");
|
|
168
|
+
});
|
|
169
|
+
// Offline ON (D84): the device was not connected and has nothing saved: "Connect to load
|
|
170
|
+
// notifications" shows (the app's own ErrorView instead, if it passed one) and the feed loads
|
|
171
|
+
// again once, by itself, when the connection is back. Any other error is not loaded again.
|
|
172
|
+
const [offlineMiss, setOfflineMiss] = useState(false);
|
|
173
|
+
const reloadOnConnectRef = useRef(false);
|
|
151
174
|
const [categories, setCategories] = useState<NotificationCategory[]>([]);
|
|
152
175
|
const [activeCategory, setActiveCategory] = useState<string | null>(null);
|
|
153
176
|
const [totalUnreadCount, setTotalUnreadCount] = useState<number>(0);
|
|
@@ -243,8 +266,22 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
243
266
|
feedRequestRef.current = builder;
|
|
244
267
|
|
|
245
268
|
try {
|
|
246
|
-
|
|
247
|
-
|
|
269
|
+
// Offline ON: two-phase; offline past the cache the device's feed shows (U6).
|
|
270
|
+
const page = await readListPage<any>(builder, "next");
|
|
271
|
+
const items = page.rows;
|
|
272
|
+
if (page.offline && items.length === 0) {
|
|
273
|
+
// Nothing on the device and not connected: the offline state and onError once (D84 rule 3),
|
|
274
|
+
// not an empty feed; it loads again once on reconnect.
|
|
275
|
+
reloadOnConnectRef.current = true;
|
|
276
|
+
setOfflineMiss(true);
|
|
277
|
+
setScreenState("error");
|
|
278
|
+
onError?.(page.error as CometChat.CometChatException);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
reloadOnConnectRef.current = false;
|
|
282
|
+
setOfflineMiss(false);
|
|
283
|
+
// The device's rows are shown and the server read could not be reached: the rows stay and
|
|
284
|
+
// nothing is reported (D84 rule 2).
|
|
248
285
|
if (!items || items.length === 0) {
|
|
249
286
|
setScreenState("empty");
|
|
250
287
|
setFeedItems([]);
|
|
@@ -273,6 +310,8 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
273
310
|
}
|
|
274
311
|
}
|
|
275
312
|
} catch (err: any) {
|
|
313
|
+
reloadOnConnectRef.current = false;
|
|
314
|
+
setOfflineMiss(false);
|
|
276
315
|
setScreenState("error");
|
|
277
316
|
onError?.(err);
|
|
278
317
|
} finally {
|
|
@@ -290,13 +329,20 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
290
329
|
setIsLoadingMore(true);
|
|
291
330
|
setLoadMoreError(false);
|
|
292
331
|
try {
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
if (
|
|
332
|
+
const page = await readListPage<any>(feedRequestRef.current, "next");
|
|
333
|
+
const items = page.rows;
|
|
334
|
+
if (page.offline && items.length === 0) {
|
|
335
|
+
// A cached page never ends the feed (BEH-READ-09b): "load more" errors, retry reads on.
|
|
336
|
+
setLoadMoreError(true);
|
|
337
|
+
} else if (!items || items.length === 0) {
|
|
296
338
|
setHasMorePages(false);
|
|
297
339
|
hasMorePagesRef.current = false;
|
|
298
340
|
} else {
|
|
299
|
-
|
|
341
|
+
// Reading past the last page can repeat items (SDK known issue): dedupe by id.
|
|
342
|
+
setFeedItems((prev) => {
|
|
343
|
+
const seen = new Set(prev.map((i: any) => String(i?.id ?? i?.getId?.() ?? "")));
|
|
344
|
+
return [...prev, ...items.filter((i: any) => !seen.has(String(i?.id ?? i?.getId?.() ?? "")))];
|
|
345
|
+
});
|
|
300
346
|
markItemsAsDelivered(items);
|
|
301
347
|
}
|
|
302
348
|
} catch (err: any) {
|
|
@@ -327,7 +373,8 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
327
373
|
markItemsAsDelivered(items);
|
|
328
374
|
}
|
|
329
375
|
} catch (err: any) {
|
|
330
|
-
|
|
376
|
+
// D84 rule 2: not connected over the rows on screen is not an error. A real one is reported (rule 5).
|
|
377
|
+
if (!(isOfflineOn() && (isNotConnectedError(err) || sdkConnected() === false))) onError?.(err);
|
|
331
378
|
} finally {
|
|
332
379
|
setIsRefreshing(false);
|
|
333
380
|
}
|
|
@@ -469,6 +516,13 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
469
516
|
fetchInitialItems();
|
|
470
517
|
}, [activeCategory]);
|
|
471
518
|
|
|
519
|
+
// D84 rule 8: the one load again of the offline state.
|
|
520
|
+
useOfflineReconnect(() => {
|
|
521
|
+
if (!reloadOnConnectRef.current) return;
|
|
522
|
+
reloadOnConnectRef.current = false;
|
|
523
|
+
void fetchInitialItems();
|
|
524
|
+
});
|
|
525
|
+
|
|
472
526
|
// ─── Lifecycle: WebSocket Listener ───────────────────────────
|
|
473
527
|
useEffect(() => {
|
|
474
528
|
const listenerId = listenerIdRef.current;
|
|
@@ -542,7 +596,7 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
542
596
|
containerStyle={mergedStyles.headerContainerStyle}
|
|
543
597
|
titleStyle={mergedStyles.titleStyle}
|
|
544
598
|
backButtonIconStyle={mergedStyles.backButtonIconStyle}
|
|
545
|
-
backButtonIconContainerStyle={{
|
|
599
|
+
backButtonIconContainerStyle={{ paddingEnd: theme.spacing.spacing.s2 }}
|
|
546
600
|
hideSearch={true}
|
|
547
601
|
/>
|
|
548
602
|
);
|
|
@@ -553,7 +607,7 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
553
607
|
if (!showFilterChips) return null;
|
|
554
608
|
|
|
555
609
|
const allChips = [
|
|
556
|
-
{ id: ALL_CATEGORY_ID, label: "
|
|
610
|
+
{ id: ALL_CATEGORY_ID, label: t("ALL"), filterKey: null as string | null },
|
|
557
611
|
...categories.map((cat: any, index: number) => ({
|
|
558
612
|
id: `chip_${index}_${cat.label ?? cat.id}`,
|
|
559
613
|
label: cat?.label || "",
|
|
@@ -751,6 +805,21 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
751
805
|
</View>
|
|
752
806
|
);
|
|
753
807
|
}
|
|
808
|
+
if (offlineMiss) {
|
|
809
|
+
// D84 rule 3: offline with nothing saved: the offline state, no Retry.
|
|
810
|
+
return (
|
|
811
|
+
<View style={mergedStyles.containerStyle}>
|
|
812
|
+
{renderHeader()}
|
|
813
|
+
<ConnectStateView
|
|
814
|
+
testID={CONTRACT_IDS.emptyConnectToLoad}
|
|
815
|
+
title={t(OFFLINE_STRING_KEYS.connectToLoadNotifications)}
|
|
816
|
+
containerStyle={mergedStyles.errorStateStyle?.containerStyle}
|
|
817
|
+
titleStyle={mergedStyles.errorStateStyle?.titleStyle}
|
|
818
|
+
subtitleStyle={mergedStyles.errorStateStyle?.subTitleStyle}
|
|
819
|
+
/>
|
|
820
|
+
</View>
|
|
821
|
+
);
|
|
822
|
+
}
|
|
754
823
|
return (
|
|
755
824
|
<View style={mergedStyles.containerStyle}>
|
|
756
825
|
{renderHeader()}
|
|
@@ -774,7 +843,8 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
774
843
|
|
|
775
844
|
// ─── Render: Loaded State ────────────────────────────────────
|
|
776
845
|
return (
|
|
777
|
-
<
|
|
846
|
+
<LayoutDirectionContext.Provider value={direction}>
|
|
847
|
+
<View style={[mergedStyles.containerStyle, directionStyle(direction)]}>
|
|
778
848
|
{renderHeader()}
|
|
779
849
|
{renderFilterChips()}
|
|
780
850
|
{isFetchingItems ? (
|
|
@@ -807,5 +877,6 @@ export const CometChatNotificationFeed = (props: CometChatNotificationFeedInterf
|
|
|
807
877
|
/>
|
|
808
878
|
)}
|
|
809
879
|
</View>
|
|
880
|
+
</LayoutDirectionContext.Provider>
|
|
810
881
|
);
|
|
811
882
|
};
|
|
@@ -257,7 +257,7 @@ export const getNotificationFeedStyleLight = (
|
|
|
257
257
|
borderRadius: spacing.radius.max,
|
|
258
258
|
position: "absolute",
|
|
259
259
|
top: spacing.spacing.s3,
|
|
260
|
-
|
|
260
|
+
start: spacing.spacing.s2,
|
|
261
261
|
},
|
|
262
262
|
unreadIndicatorColor: color.primary,
|
|
263
263
|
|
|
@@ -8,22 +8,19 @@
|
|
|
8
8
|
* Total count invariant: no items lost or duplicated.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { getCometChatTranslation, getCurrentLanguage } from "../shared/resources/CometChatLocalizeNew/LocalizationManager";
|
|
12
|
+
import { LocalizedDateHelper, localizeDigits } from "../shared/helper/LocalizedDateHelper";
|
|
13
|
+
|
|
11
14
|
/** Represents a single timestamp group (section) for SectionList */
|
|
12
15
|
export interface TimestampGroup<T> {
|
|
13
16
|
title: string;
|
|
14
17
|
data: T[];
|
|
15
18
|
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"Tuesday",
|
|
22
|
-
"Wednesday",
|
|
23
|
-
"Thursday",
|
|
24
|
-
"Friday",
|
|
25
|
-
"Saturday",
|
|
26
|
-
] as const;
|
|
20
|
+
const t = getCometChatTranslation();
|
|
21
|
+
|
|
22
|
+
/** The kit language as a date-formatting locale (e.g. "ar" → Arabic day and month names). */
|
|
23
|
+
const dateLocale = () => LocalizedDateHelper.getFullLocaleForDateFormatting(getCurrentLanguage());
|
|
27
24
|
|
|
28
25
|
/**
|
|
29
26
|
* Returns the start of a given day (midnight) for comparison purposes.
|
|
@@ -50,21 +47,23 @@ const getGroupLabel = (sentAt: number, now: Date): string => {
|
|
|
50
47
|
const diffDays = Math.floor(diffMs / (24 * 60 * 60 * 1000));
|
|
51
48
|
|
|
52
49
|
if (diffDays === 0) {
|
|
53
|
-
return "
|
|
50
|
+
return t("TODAY");
|
|
54
51
|
}
|
|
55
52
|
if (diffDays === 1) {
|
|
56
|
-
return "
|
|
53
|
+
return t("YESTERDAY");
|
|
57
54
|
}
|
|
58
55
|
// Within this week (2-6 days ago) — show day name
|
|
59
56
|
if (diffDays >= 2 && diffDays <= 6) {
|
|
60
|
-
return
|
|
57
|
+
return itemDate.toLocaleDateString(dateLocale(), { weekday: "long" });
|
|
61
58
|
}
|
|
62
59
|
// Older — show localized date
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
return localizeDigits(
|
|
61
|
+
itemDate.toLocaleDateString(dateLocale(), {
|
|
62
|
+
month: "short",
|
|
63
|
+
day: "numeric",
|
|
64
|
+
year: "numeric",
|
|
65
|
+
})
|
|
66
|
+
);
|
|
68
67
|
};
|
|
69
68
|
|
|
70
69
|
/**
|