@cometchat/chat-uikit-react-native 4.3.23 → 5.0.0-beta.1
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/.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
- package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
- package/android/src/main/AndroidManifest.xml +0 -6
- package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +171 -27
- package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +31 -15
- package/ios/CometchatUiKit.mm +25 -25
- package/ios/FileManager.m +108 -4
- package/ios/SoundPlayer.m +32 -5
- package/package.json +13 -29
- package/react-native-cometchat-ui-kit.podspec +6 -6
- package/src/CometChatConversations/CometChatConversations.tsx +1376 -1263
- package/src/CometChatConversations/Skeleton.tsx +143 -0
- package/src/CometChatConversations/index.ts +7 -21
- package/src/CometChatConversations/resources/index.ts +22 -36
- package/src/CometChatConversations/style.ts +237 -62
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +844 -683
- package/src/CometChatGroupMembers/Skeleton.tsx +197 -0
- package/src/CometChatGroupMembers/index.ts +2 -8
- package/src/CometChatGroupMembers/resources/index.ts +3 -14
- package/src/CometChatGroupMembers/style.ts +532 -22
- package/src/CometChatGroups/CometChatGroups.tsx +417 -562
- package/src/CometChatGroups/GroupsStyle.ts +176 -109
- package/src/CometChatGroups/Skeleton.tsx +328 -0
- package/src/CometChatGroups/index.ts +3 -11
- package/src/CometChatGroups/resources/index.ts +17 -24
- package/src/CometChatGroups/style.ts +15 -16
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +585 -1044
- package/src/CometChatMessageComposer/index.ts +4 -8
- package/src/CometChatMessageComposer/resources/index.ts +21 -31
- package/src/CometChatMessageComposer/styles.tsx +152 -0
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +315 -422
- package/src/CometChatMessageHeader/index.ts +3 -15
- package/src/CometChatMessageHeader/listners.ts +50 -26
- package/src/CometChatMessageHeader/styles.ts +57 -10
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +350 -295
- package/src/CometChatMessageInformation/Skeleton.tsx +143 -0
- package/src/CometChatMessageInformation/index.ts +5 -9
- package/src/CometChatMessageInformation/resources/index.ts +1 -4
- package/src/CometChatMessageInformation/styles.ts +147 -16
- package/src/CometChatMessageList/CometChatMessageList.tsx +2344 -2080
- package/src/CometChatMessageList/Skeleton.tsx +98 -0
- package/src/CometChatMessageList/index.ts +5 -12
- package/src/CometChatMessageList/resources/index.ts +13 -20
- package/src/CometChatMessageList/style.ts +989 -51
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +208 -0
- package/src/CometChatThreadHeader/Header.tsx +47 -0
- package/src/CometChatThreadHeader/index.ts +8 -0
- package/src/CometChatThreadHeader/resources/index.ts +14 -0
- package/src/CometChatThreadHeader/style.ts +70 -0
- package/src/CometChatUsers/CometChatUsers.tsx +276 -114
- package/src/CometChatUsers/Skeleton.tsx +195 -0
- package/src/CometChatUsers/index.ts +3 -11
- package/src/CometChatUsers/style.ts +181 -0
- package/src/calls/CallEvents.ts +9 -9
- package/src/calls/CallUtils.ts +102 -31
- package/src/calls/CallingConfiguration.ts +22 -4
- package/src/calls/CallingExtension.tsx +43 -40
- package/src/calls/CallingExtensionDecorator.tsx +416 -0
- package/src/calls/CallingPackage.ts +11 -12
- package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +121 -52
- package/src/calls/CometChatCallBubble/index.ts +8 -13
- package/src/calls/CometChatCallBubble/resources/index.ts +1 -8
- package/src/calls/CometChatCallBubble/styles.ts +155 -22
- package/src/calls/CometChatCallButtons/CometChatCallButtonConfiguration.ts +17 -36
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +319 -323
- package/src/calls/CometChatCallButtons/index.ts +9 -11
- package/src/calls/CometChatCallButtons/style.ts +34 -12
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +429 -377
- package/src/calls/CometChatCallLogs/Skeleton.tsx +143 -0
- package/src/calls/CometChatCallLogs/index.ts +4 -15
- package/src/calls/CometChatCallLogs/resources/index.ts +20 -31
- package/src/calls/CometChatCallLogs/style.ts +169 -22
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +279 -217
- package/src/calls/CometChatIncomingCall/index.ts +7 -9
- package/src/calls/CometChatIncomingCall/resources/index.ts +3 -12
- package/src/calls/CometChatIncomingCall/style.ts +75 -0
- package/src/calls/CometChatOngoingCall/CometChatOngoingCall.tsx +74 -56
- package/src/calls/CometChatOngoingCall/index.ts +3 -7
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +207 -171
- package/src/calls/CometChatOutgoingCall/OutgoingCallConfiguration.ts +31 -31
- package/src/calls/CometChatOutgoingCall/index.ts +5 -11
- package/src/calls/CometChatOutgoingCall/resources/index.ts +1 -4
- package/src/calls/CometChatOutgoingCall/styles.ts +58 -0
- package/src/calls/index.ts +14 -88
- package/src/calls/resources/index.ts +1 -8
- package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +72 -96
- package/src/extensions/CollaborativeBubble/resources/index.ts +2 -4
- package/src/extensions/CollaborativeBubble/style.ts +112 -0
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtension.tsx +21 -35
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +220 -189
- package/src/extensions/CollaborativeDocument/index.ts +2 -8
- package/src/extensions/CollaborativeDocument/resources/index.ts +4 -6
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtension.tsx +25 -35
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +298 -199
- package/src/extensions/CollaborativeWhiteboard/index.ts +2 -8
- package/src/extensions/CollaborativeWhiteboard/resources/index.ts +4 -6
- package/src/extensions/ExtensionConstants.tsx +3 -4
- package/src/extensions/ExtensionModerator.tsx +47 -47
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +187 -116
- package/src/extensions/LinkPreview/LinkPreviewExtension.tsx +22 -0
- package/src/extensions/LinkPreview/LinkPreviewExtensionDecorator.tsx +94 -0
- package/src/extensions/LinkPreview/index.ts +6 -16
- package/src/extensions/LinkPreview/resources/index.ts +1 -4
- package/src/extensions/LinkPreview/style.ts +100 -0
- package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +112 -116
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +235 -152
- package/src/extensions/MessageTranslation/MessageTranslationExtension.tsx +7 -25
- package/src/extensions/MessageTranslation/index.ts +3 -5
- package/src/extensions/MessageTranslation/resources/index.ts +2 -3
- package/src/extensions/Polls/Header.tsx +56 -21
- package/src/extensions/Polls/Polls.tsx +368 -332
- package/src/extensions/Polls/PollsBubble.tsx +250 -205
- package/src/extensions/Polls/PollsConfigurations.ts +0 -9
- package/src/extensions/Polls/PollsDecorator.tsx +148 -77
- package/src/extensions/Polls/PollsExtension.tsx +5 -12
- package/src/extensions/Polls/index.ts +6 -8
- package/src/extensions/Polls/resources/index.ts +6 -12
- package/src/extensions/Polls/style.ts +185 -1
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +249 -115
- package/src/extensions/Stickers/CometChatStickerKeyboard/Skeleton.tsx +167 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardConfiguration.ts +2 -6
- package/src/extensions/Stickers/CometChatStickerKeyboard/hooks.ts +58 -64
- package/src/extensions/Stickers/CometChatStickerKeyboard/index.ts +2 -3
- package/src/extensions/Stickers/CometChatStickerKeyboard/style.ts +67 -41
- package/src/extensions/Stickers/StickerConfiguration.ts +5 -9
- package/src/extensions/Stickers/StickersBubble.tsx +22 -46
- package/src/extensions/Stickers/StickersExtension.ts +5 -6
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +290 -104
- package/src/extensions/Stickers/index.ts +7 -9
- package/src/extensions/Stickers/resources/index.ts +1 -4
- package/src/extensions/Stickers/style.ts +53 -0
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +83 -64
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationExtension.tsx +5 -25
- package/src/extensions/ThumbnailGeneration/index.ts +1 -3
- package/src/extensions/ThumbnailGeneration/resources/index.ts +1 -4
- package/src/extensions/index.ts +11 -50
- package/src/index.ts +193 -670
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +342 -491
- package/src/shared/CometChatUiKit/CometChatUIKitHelper.ts +147 -117
- package/src/shared/CometChatUiKit/UIKitSettings.ts +38 -38
- package/src/shared/CometChatUiKit/index.ts +2 -6
- package/src/shared/assets/images/index.ts +13 -29
- package/src/shared/base/BaseStyle.ts +9 -8
- package/src/shared/base/BorderStyle.ts +4 -4
- package/src/shared/base/FontStyle.ts +25 -3
- package/src/shared/base/ShadowStyle.ts +1 -1
- package/src/shared/base/Types.ts +16 -22
- package/src/shared/base/index.ts +7 -25
- package/src/shared/base/vars.ts +5 -5
- package/src/shared/constants/UIKitConstants.ts +322 -294
- package/src/shared/events/CometChatMessageEvents/index.ts +83 -87
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +260 -238
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +412 -377
- package/src/shared/events/CometChatUIEvents.ts +15 -16
- package/src/shared/events/ListenerInitializer.ts +79 -80
- package/src/shared/events/conversations.ts +2 -2
- package/src/shared/events/groups.ts +8 -8
- package/src/shared/events/index.ts +6 -6
- package/src/shared/events/messages.ts +26 -29
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +191 -121
- package/src/shared/formatters/CometChatMentionsFormatter/MentionTextStyle.ts +3 -3
- package/src/shared/formatters/CometChatMentionsFormatter/index.ts +3 -6
- package/src/shared/formatters/CometChatTextFormatter.ts +15 -14
- package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +127 -131
- package/src/shared/formatters/index.ts +7 -8
- package/src/shared/framework/ChatConfigurator.ts +3 -4
- package/src/shared/framework/DataSource.ts +181 -92
- package/src/shared/framework/DataSourceDecorator.tsx +307 -233
- package/src/shared/framework/ExtensionsDataSource.tsx +8 -11
- package/src/shared/framework/MessageDataSource.tsx +1364 -867
- package/src/shared/framework/index.ts +8 -6
- package/src/shared/framework/resources/index.ts +37 -57
- package/src/shared/helper/Toast.tsx +20 -18
- package/src/shared/helper/dateHelper.ts +138 -0
- package/src/shared/helper/functions.js +1 -1
- package/src/shared/helper/helperFunctions.ts +71 -19
- package/src/shared/helper/types/index.ts +49 -15
- package/src/shared/helper/useKeyboard.tsx +12 -23
- package/src/shared/icons/Icon.tsx +73 -0
- package/src/shared/icons/components/ListItemCheck.tsx +18 -0
- package/src/shared/icons/components/StickerBase-icon.tsx +16 -0
- package/src/shared/icons/components/account-circle-fill.tsx +26 -0
- package/src/shared/icons/components/account-circle.tsx +11 -0
- package/src/shared/icons/components/activity.tsx +20 -0
- package/src/shared/icons/components/add-a-photo-fill.tsx +26 -0
- package/src/shared/icons/components/add-a-photo.tsx +11 -0
- package/src/shared/icons/components/add-box-fill.tsx +26 -0
- package/src/shared/icons/components/add-box.tsx +11 -0
- package/src/shared/icons/components/add-call-fill.tsx +26 -0
- package/src/shared/icons/components/add-call.tsx +11 -0
- package/src/shared/icons/components/add-circle-fill.tsx +11 -0
- package/src/shared/icons/components/add-circle.tsx +11 -0
- package/src/shared/icons/components/add-comment-fill.tsx +26 -0
- package/src/shared/icons/components/add-comment.tsx +11 -0
- package/src/shared/icons/components/add-fill.tsx +26 -0
- package/src/shared/icons/components/add-reaction-fill.tsx +26 -0
- package/src/shared/icons/components/add-reaction.tsx +11 -0
- package/src/shared/icons/components/add.tsx +11 -0
- package/src/shared/icons/components/ai-conversation-summary-fill.tsx +13 -0
- package/src/shared/icons/components/ai-conversation-summary.tsx +13 -0
- package/src/shared/icons/components/ai-fill.tsx +11 -0
- package/src/shared/icons/components/ai-suggest-reply-fill.tsx +13 -0
- package/src/shared/icons/components/ai-suggest-reply.tsx +20 -0
- package/src/shared/icons/components/ai.tsx +12 -0
- package/src/shared/icons/components/alternate-email-fill.tsx +26 -0
- package/src/shared/icons/components/alternate-email.tsx +11 -0
- package/src/shared/icons/components/animals-&-nature.tsx +18 -0
- package/src/shared/icons/components/archive-fill.tsx +26 -0
- package/src/shared/icons/components/archive.tsx +11 -0
- package/src/shared/icons/components/arrow-back-fill.tsx +26 -0
- package/src/shared/icons/components/arrow-back.tsx +11 -0
- package/src/shared/icons/components/arrow-forward-fill.tsx +26 -0
- package/src/shared/icons/components/arrow-forward.tsx +11 -0
- package/src/shared/icons/components/attach-file-fill.tsx +26 -0
- package/src/shared/icons/components/attach-file.tsx +11 -0
- package/src/shared/icons/components/audio-file-type.tsx +36 -0
- package/src/shared/icons/components/bar-chart-fill.tsx +11 -0
- package/src/shared/icons/components/bar-chart.tsx +11 -0
- package/src/shared/icons/components/base-icon.tsx +16 -0
- package/src/shared/icons/components/bedtime-fill.tsx +26 -0
- package/src/shared/icons/components/bedtime.tsx +11 -0
- package/src/shared/icons/components/block-fill.tsx +26 -0
- package/src/shared/icons/components/block.tsx +11 -0
- package/src/shared/icons/components/bookmark-add-fill.tsx +26 -0
- package/src/shared/icons/components/bookmark-add.tsx +11 -0
- package/src/shared/icons/components/bookmark-fill.tsx +26 -0
- package/src/shared/icons/components/bookmark.tsx +11 -0
- package/src/shared/icons/components/calendar-add-on-fill.tsx +26 -0
- package/src/shared/icons/components/calendar-add-on.tsx +11 -0
- package/src/shared/icons/components/calendar-today-fill.tsx +26 -0
- package/src/shared/icons/components/calendar-today.tsx +11 -0
- package/src/shared/icons/components/call-end-fill.tsx +26 -0
- package/src/shared/icons/components/call-end.tsx +11 -0
- package/src/shared/icons/components/call-fill.tsx +26 -0
- package/src/shared/icons/components/call-log-fill.tsx +26 -0
- package/src/shared/icons/components/call-log.tsx +11 -0
- package/src/shared/icons/components/call-made-fill.tsx +26 -0
- package/src/shared/icons/components/call-made.tsx +11 -0
- package/src/shared/icons/components/call-missed-fill.tsx +26 -0
- package/src/shared/icons/components/call-missed-outgoing-fill.tsx +26 -0
- package/src/shared/icons/components/call-missed-outgoing.tsx +11 -0
- package/src/shared/icons/components/call-missed.tsx +11 -0
- package/src/shared/icons/components/call-received-fill.tsx +26 -0
- package/src/shared/icons/components/call-received.tsx +11 -0
- package/src/shared/icons/components/call.tsx +11 -0
- package/src/shared/icons/components/cancel-fill.tsx +26 -0
- package/src/shared/icons/components/cancel.tsx +11 -0
- package/src/shared/icons/components/change-circle-fill.tsx +11 -0
- package/src/shared/icons/components/change-circle.tsx +11 -0
- package/src/shared/icons/components/chat-bot-fill.tsx +13 -0
- package/src/shared/icons/components/chat-bot.tsx +17 -0
- package/src/shared/icons/components/chat-fill.tsx +26 -0
- package/src/shared/icons/components/chat.tsx +11 -0
- package/src/shared/icons/components/check-circle-fill.tsx +11 -0
- package/src/shared/icons/components/check-circle.tsx +11 -0
- package/src/shared/icons/components/check-fill.tsx +26 -0
- package/src/shared/icons/components/check.tsx +11 -0
- package/src/shared/icons/components/chevron-left-fill.tsx +26 -0
- package/src/shared/icons/components/chevron-left.tsx +11 -0
- package/src/shared/icons/components/chevron-right-fill.tsx +26 -0
- package/src/shared/icons/components/chevron-right.tsx +11 -0
- package/src/shared/icons/components/close-fill.tsx +26 -0
- package/src/shared/icons/components/close.tsx +11 -0
- package/src/shared/icons/components/collaborative-document-fill.tsx +17 -0
- package/src/shared/icons/components/collaborative-document-icon.tsx +11 -0
- package/src/shared/icons/components/collaborative-document.tsx +13 -0
- package/src/shared/icons/components/collaborative-whiteboard-fill.tsx +15 -0
- package/src/shared/icons/components/collaborative-whiteboard-icon.tsx +15 -0
- package/src/shared/icons/components/collaborative-whiteboard.tsx +12 -0
- package/src/shared/icons/components/content-copy-fill.tsx +26 -0
- package/src/shared/icons/components/content-copy.tsx +11 -0
- package/src/shared/icons/components/crop-fill.tsx +26 -0
- package/src/shared/icons/components/crop.tsx +11 -0
- package/src/shared/icons/components/delete-fill.tsx +26 -0
- package/src/shared/icons/components/delete.tsx +11 -0
- package/src/shared/icons/components/description-fill.tsx +26 -0
- package/src/shared/icons/components/description.tsx +11 -0
- package/src/shared/icons/components/document-file-type.tsx +38 -0
- package/src/shared/icons/components/done-all-fill.tsx +26 -0
- package/src/shared/icons/components/done-all.tsx +11 -0
- package/src/shared/icons/components/download-fill.tsx +26 -0
- package/src/shared/icons/components/download.tsx +11 -0
- package/src/shared/icons/components/edit-calendar-fill.tsx +26 -0
- package/src/shared/icons/components/edit-calendar.tsx +11 -0
- package/src/shared/icons/components/edit-fill.tsx +26 -0
- package/src/shared/icons/components/edit-square-fill.tsx +11 -0
- package/src/shared/icons/components/edit-square.tsx +11 -0
- package/src/shared/icons/components/edit.tsx +11 -0
- package/src/shared/icons/components/empty-state.tsx +82 -0
- package/src/shared/icons/components/error-fill.tsx +34 -0
- package/src/shared/icons/components/error-state.tsx +92 -0
- package/src/shared/icons/components/error.tsx +11 -0
- package/src/shared/icons/components/event-available-fill.tsx +11 -0
- package/src/shared/icons/components/event-available.tsx +11 -0
- package/src/shared/icons/components/event-fill.tsx +26 -0
- package/src/shared/icons/components/event.tsx +11 -0
- package/src/shared/icons/components/favorite-fill.tsx +26 -0
- package/src/shared/icons/components/favorite.tsx +11 -0
- package/src/shared/icons/components/filter-list-fill.tsx +26 -0
- package/src/shared/icons/components/filter-list-off-fill.tsx +26 -0
- package/src/shared/icons/components/filter-list-off.tsx +11 -0
- package/src/shared/icons/components/filter-list.tsx +11 -0
- package/src/shared/icons/components/flags.tsx +13 -0
- package/src/shared/icons/components/flip-camera-ios-fill.tsx +26 -0
- package/src/shared/icons/components/flip-camera-ios.tsx +11 -0
- package/src/shared/icons/components/food-&-drink.tsx +18 -0
- package/src/shared/icons/components/forward-fill.tsx +26 -0
- package/src/shared/icons/components/forward.tsx +11 -0
- package/src/shared/icons/components/gif-fill.tsx +13 -0
- package/src/shared/icons/components/gif.tsx +12 -0
- package/src/shared/icons/components/graphic-eq-fill.tsx +11 -0
- package/src/shared/icons/components/graphic-eq.tsx +11 -0
- package/src/shared/icons/components/group-add.tsx +11 -0
- package/src/shared/icons/components/group-fill.tsx +26 -0
- package/src/shared/icons/components/group.tsx +11 -0
- package/src/shared/icons/components/help-fill.tsx +26 -0
- package/src/shared/icons/components/help.tsx +11 -0
- package/src/shared/icons/components/history-fill.tsx +26 -0
- package/src/shared/icons/components/history.tsx +11 -0
- package/src/shared/icons/components/image-file-type.tsx +35 -0
- package/src/shared/icons/components/incoming-audio-fill.tsx +11 -0
- package/src/shared/icons/components/incoming-audio.tsx +13 -0
- package/src/shared/icons/components/incoming-video-fill.tsx +28 -0
- package/src/shared/icons/components/incoming-video.tsx +15 -0
- package/src/shared/icons/components/info-fill.tsx +26 -0
- package/src/shared/icons/components/info.tsx +11 -0
- package/src/shared/icons/components/keep-fill.tsx +26 -0
- package/src/shared/icons/components/keep-off-fill.tsx +26 -0
- package/src/shared/icons/components/keep-off.tsx +11 -0
- package/src/shared/icons/components/keep.tsx +11 -0
- package/src/shared/icons/components/keyboard-arrow-down-fill.tsx +26 -0
- package/src/shared/icons/components/keyboard-arrow-down.tsx +11 -0
- package/src/shared/icons/components/keyboard-arrow-up-fill.tsx +26 -0
- package/src/shared/icons/components/keyboard-arrow-up.tsx +11 -0
- package/src/shared/icons/components/keyboard-fill.tsx +26 -0
- package/src/shared/icons/components/keyboard.tsx +11 -0
- package/src/shared/icons/components/language-fill.tsx +26 -0
- package/src/shared/icons/components/language.tsx +11 -0
- package/src/shared/icons/components/link-fill.tsx +26 -0
- package/src/shared/icons/components/link.tsx +11 -0
- package/src/shared/icons/components/loading-fill.tsx +12 -0
- package/src/shared/icons/components/loading.tsx +12 -0
- package/src/shared/icons/components/location-on-fill.tsx +26 -0
- package/src/shared/icons/components/location-on.tsx +11 -0
- package/src/shared/icons/components/lock-fill.tsx +26 -0
- package/src/shared/icons/components/lock-open-fill.tsx +26 -0
- package/src/shared/icons/components/lock-open.tsx +11 -0
- package/src/shared/icons/components/lock.tsx +11 -0
- package/src/shared/icons/components/logout-fill.tsx +11 -0
- package/src/shared/icons/components/logout.tsx +11 -0
- package/src/shared/icons/components/mail-fill.tsx +26 -0
- package/src/shared/icons/components/mail.tsx +11 -0
- package/src/shared/icons/components/mic-fill.tsx +26 -0
- package/src/shared/icons/components/mic-off-fill.tsx +26 -0
- package/src/shared/icons/components/mic-off.tsx +11 -0
- package/src/shared/icons/components/mic.tsx +11 -0
- package/src/shared/icons/components/missed-video-call-fill.tsx +26 -0
- package/src/shared/icons/components/missed-video-call.tsx +11 -0
- package/src/shared/icons/components/mood-fill.tsx +26 -0
- package/src/shared/icons/components/mood.tsx +11 -0
- package/src/shared/icons/components/more-vert-fill.tsx +26 -0
- package/src/shared/icons/components/more-vert.tsx +11 -0
- package/src/shared/icons/components/near-me-fill.tsx +11 -0
- package/src/shared/icons/components/near-me.tsx +11 -0
- package/src/shared/icons/components/no-photography-fill.tsx +26 -0
- package/src/shared/icons/components/no-photography.tsx +11 -0
- package/src/shared/icons/components/notifications-fill.tsx +26 -0
- package/src/shared/icons/components/notifications-off-fill.tsx +26 -0
- package/src/shared/icons/components/notifications-off.tsx +11 -0
- package/src/shared/icons/components/notifications.tsx +11 -0
- package/src/shared/icons/components/objects.tsx +20 -0
- package/src/shared/icons/components/outgoing-audio-fill.tsx +15 -0
- package/src/shared/icons/components/outgoing-audio.tsx +15 -0
- package/src/shared/icons/components/outgoing-video-fill.tsx +28 -0
- package/src/shared/icons/components/outgoing-video.tsx +15 -0
- package/src/shared/icons/components/pause-fill.tsx +26 -0
- package/src/shared/icons/components/pause.tsx +11 -0
- package/src/shared/icons/components/pdf-file-type.tsx +36 -0
- package/src/shared/icons/components/person-add-fill.tsx +26 -0
- package/src/shared/icons/components/person-add.tsx +11 -0
- package/src/shared/icons/components/person-fill.tsx +26 -0
- package/src/shared/icons/components/person-off.tsx +16 -0
- package/src/shared/icons/components/person.tsx +11 -0
- package/src/shared/icons/components/phone-in-talk-fill.tsx +26 -0
- package/src/shared/icons/components/phone-in-talk.tsx +11 -0
- package/src/shared/icons/components/phone-incoming-fill.tsx +11 -0
- package/src/shared/icons/components/phone-incoming.tsx +11 -0
- package/src/shared/icons/components/phone-missed-fill.tsx +26 -0
- package/src/shared/icons/components/phone-missed.tsx +11 -0
- package/src/shared/icons/components/phone-outgoing-fill.tsx +15 -0
- package/src/shared/icons/components/phone-outgoing.tsx +15 -0
- package/src/shared/icons/components/photo-camera-fill.tsx +26 -0
- package/src/shared/icons/components/photo-camera.tsx +11 -0
- package/src/shared/icons/components/photo-fill.tsx +26 -0
- package/src/shared/icons/components/photo.tsx +11 -0
- package/src/shared/icons/components/play-arrow-fill.tsx +26 -0
- package/src/shared/icons/components/play-arrow.tsx +11 -0
- package/src/shared/icons/components/play-circle-fill.tsx +26 -0
- package/src/shared/icons/components/play-circle.tsx +11 -0
- package/src/shared/icons/components/poll-Icon.tsx +10 -0
- package/src/shared/icons/components/poll-fill.tsx +11 -0
- package/src/shared/icons/components/poll.tsx +11 -0
- package/src/shared/icons/components/presentation-file-type.tsx +38 -0
- package/src/shared/icons/components/rearrange-fill.tsx +13 -0
- package/src/shared/icons/components/rearrange.tsx +13 -0
- package/src/shared/icons/components/refresh-fill.tsx +26 -0
- package/src/shared/icons/components/refresh.tsx +11 -0
- package/src/shared/icons/components/reply-all-fill.tsx +26 -0
- package/src/shared/icons/components/reply-all.tsx +11 -0
- package/src/shared/icons/components/reply-fill.tsx +26 -0
- package/src/shared/icons/components/reply.tsx +11 -0
- package/src/shared/icons/components/retry-fill.tsx +11 -0
- package/src/shared/icons/components/retry.tsx +11 -0
- package/src/shared/icons/components/schedule-fill.tsx +26 -0
- package/src/shared/icons/components/schedule.tsx +11 -0
- package/src/shared/icons/components/screen-share-fill.tsx +26 -0
- package/src/shared/icons/components/screen-share.tsx +11 -0
- package/src/shared/icons/components/search-fill.tsx +26 -0
- package/src/shared/icons/components/search.tsx +11 -0
- package/src/shared/icons/components/send-fill.tsx +26 -0
- package/src/shared/icons/components/send.tsx +11 -0
- package/src/shared/icons/components/settings-fill.tsx +26 -0
- package/src/shared/icons/components/settings.tsx +11 -0
- package/src/shared/icons/components/share-fill.tsx +26 -0
- package/src/shared/icons/components/share.tsx +11 -0
- package/src/shared/icons/components/shield-fill.tsx +11 -0
- package/src/shared/icons/components/shield.tsx +11 -0
- package/src/shared/icons/components/smileys-&-people.tsx +18 -0
- package/src/shared/icons/components/spreadsheet-file-type.tsx +38 -0
- package/src/shared/icons/components/star-fill.tsx +26 -0
- package/src/shared/icons/components/star.tsx +11 -0
- package/src/shared/icons/components/sticker-fill.tsx +12 -0
- package/src/shared/icons/components/sticker.tsx +11 -0
- package/src/shared/icons/components/stop-circle-fill.tsx +26 -0
- package/src/shared/icons/components/stop-circle.tsx +11 -0
- package/src/shared/icons/components/stop-fill.tsx +26 -0
- package/src/shared/icons/components/stop-screen-share-fill.tsx +26 -0
- package/src/shared/icons/components/stop-screen-share.tsx +11 -0
- package/src/shared/icons/components/stop.tsx +11 -0
- package/src/shared/icons/components/subdirectory-arrow-left-fill.tsx +26 -0
- package/src/shared/icons/components/subdirectory-arrow-left.tsx +11 -0
- package/src/shared/icons/components/subdirectory-arrow-right-fill.tsx +26 -0
- package/src/shared/icons/components/subdirectory-arrow-right.tsx +11 -0
- package/src/shared/icons/components/sunny-fill.tsx +26 -0
- package/src/shared/icons/components/sunny.tsx +11 -0
- package/src/shared/icons/components/symbols.tsx +15 -0
- package/src/shared/icons/components/text-file-type.tsx +35 -0
- package/src/shared/icons/components/thumb-down-fill.tsx +26 -0
- package/src/shared/icons/components/thumb-down.tsx +11 -0
- package/src/shared/icons/components/thumb-up-fill.tsx +26 -0
- package/src/shared/icons/components/thumb-up.tsx +11 -0
- package/src/shared/icons/components/translate-fill.tsx +11 -0
- package/src/shared/icons/components/translate.tsx +11 -0
- package/src/shared/icons/components/travel-&-places.tsx +18 -0
- package/src/shared/icons/components/unknown-file-type.tsx +38 -0
- package/src/shared/icons/components/upload-fill.tsx +11 -0
- package/src/shared/icons/components/upload.tsx +11 -0
- package/src/shared/icons/components/user-empty-icon.tsx +26 -0
- package/src/shared/icons/components/video-call-fill.tsx +26 -0
- package/src/shared/icons/components/video-call.tsx +11 -0
- package/src/shared/icons/components/video-file-type.tsx +38 -0
- package/src/shared/icons/components/videocam-fill.tsx +26 -0
- package/src/shared/icons/components/videocam-off-fill.tsx +26 -0
- package/src/shared/icons/components/videocam-off.tsx +11 -0
- package/src/shared/icons/components/videocam.tsx +11 -0
- package/src/shared/icons/components/visibility-off-fill.tsx +11 -0
- package/src/shared/icons/components/visibility-off.tsx +11 -0
- package/src/shared/icons/components/volume-down-fill.tsx +26 -0
- package/src/shared/icons/components/volume-down.tsx +11 -0
- package/src/shared/icons/components/volume-mute-fill.tsx +26 -0
- package/src/shared/icons/components/volume-mute.tsx +11 -0
- package/src/shared/icons/components/volume-off-fill.tsx +26 -0
- package/src/shared/icons/components/volume-off.tsx +11 -0
- package/src/shared/icons/components/volume-up-fill.tsx +26 -0
- package/src/shared/icons/components/volume-up.tsx +11 -0
- package/src/shared/icons/components/warning-fill.tsx +26 -0
- package/src/shared/icons/components/warning.tsx +11 -0
- package/src/shared/icons/components/wifi-fill.tsx +26 -0
- package/src/shared/icons/components/wifi.tsx +11 -0
- package/src/shared/icons/components/zip-file-type.tsx +38 -0
- package/src/shared/icons/components/zoom-in-map-fill.tsx +26 -0
- package/src/shared/icons/components/zoom-in-map.tsx +11 -0
- package/src/shared/icons/components/zoom-out-map-fill.tsx +26 -0
- package/src/shared/icons/components/zoom-out-map.tsx +11 -0
- package/src/shared/icons/icon-mapping.tsx +620 -0
- package/src/shared/index.ts +114 -333
- package/src/shared/libs/ImageZoom/ReactNativeZoomableView.tsx +0 -1
- package/src/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.tsx +19 -26
- package/src/shared/libs/ImageZoom/helper.ts +11 -27
- package/src/shared/libs/ImageZoom/index.tsx +4 -7
- package/src/shared/libs/ImageZoom/types/index.ts +7 -17
- package/src/shared/libs/VideoPlayer/VideoResizeMode.js +1 -1
- package/src/shared/modals/CometChatMessageOption.ts +11 -8
- package/src/shared/modals/CometChatMessageTemplate.ts +180 -140
- package/src/shared/modals/index.ts +2 -57
- package/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +153 -152
- package/src/shared/resources/CometChatLocalize/index.ts +2 -8
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +445 -315
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +445 -315
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +444 -316
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +445 -315
- package/src/shared/resources/CometChatLocalize/resources/hu/translation.json +444 -315
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +444 -316
- package/src/shared/resources/CometChatSoundManager/index.ts +1 -2
- package/src/shared/resources/index.ts +1 -9
- package/src/shared/utils/CometChatMessageHelper/index.ts +16 -14
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +50 -0
- package/src/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js +1 -1
- package/src/shared/utils/CometChatMessagePreview/index.ts +1 -5
- package/src/shared/utils/CometChatMessagePreview/resources/index.ts +1 -4
- package/src/shared/utils/CometChatMessagePreview/style.ts +45 -0
- package/src/shared/utils/CommonUtils.ts +163 -172
- package/src/shared/utils/MessageUtils.tsx +326 -146
- package/src/shared/utils/NetworkUtils.tsx +32 -24
- package/src/shared/utils/PermissionUtil.ts +30 -30
- package/src/shared/utils/conversationUtils.ts +93 -86
- package/src/shared/utils/index.ts +4 -25
- package/src/shared/views/CometChatAICard/CometChatAICard.tsx +100 -66
- package/src/shared/views/CometChatAICard/resources/index.ts +2 -4
- package/src/shared/views/CometChatActionSheet/ActionItem.ts +12 -57
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +68 -249
- package/src/shared/views/CometChatActionSheet/hooks.ts +5 -3
- package/src/shared/views/CometChatActionSheet/index.ts +1 -4
- package/src/shared/views/CometChatActionSheet/resources/index.ts +5 -7
- package/src/shared/views/CometChatActionSheet/style.ts +2 -41
- package/src/shared/views/CometChatAudioBubble/AnimatedAudioWaves.tsx +131 -0
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +211 -189
- package/src/shared/views/CometChatAudioBubble/index.ts +10 -10
- package/src/shared/views/CometChatAudioBubble/resources/index.ts +2 -7
- package/src/shared/views/CometChatAudioBubble/style.ts +203 -27
- package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +26 -104
- package/src/shared/views/CometChatAvatar/index.ts +3 -9
- package/src/shared/views/CometChatAvatar/styles.ts +37 -24
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +27 -46
- package/src/shared/views/CometChatBadge/index.ts +4 -8
- package/src/shared/views/CometChatBadge/styles.ts +29 -16
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +133 -152
- package/src/shared/views/CometChatBottomSheet/index.ts +2 -5
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +104 -106
- package/src/shared/views/CometChatConfirmDialog/index.ts +2 -9
- package/src/shared/views/CometChatConfirmDialog/style.ts +121 -62
- package/src/shared/views/CometChatDate/CometChatDate.tsx +23 -157
- package/src/shared/views/CometChatDate/index.ts +4 -12
- package/src/shared/views/CometChatDate/styles.ts +36 -0
- package/src/shared/views/CometChatDateSeperator/CometChatDateSeparator.tsx +48 -0
- package/src/shared/views/CometChatDateSeperator/index.ts +6 -0
- package/src/shared/views/CometChatDateSeperator/styles.ts +52 -0
- package/src/shared/views/CometChatDeletedBubble/CometChatDeletedBubble.tsx +42 -0
- package/src/shared/views/CometChatDeletedBubble/index.ts +5 -0
- package/src/shared/views/CometChatDeletedBubble/styles.ts +42 -0
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +284 -205
- package/src/shared/views/CometChatEmojiKeyboard/Emoji.ts +1 -1
- package/src/shared/views/CometChatEmojiKeyboard/EmojiCategory.ts +1 -1
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +169 -1405
- package/src/shared/views/CometChatEmojiKeyboard/index.ts +1 -3
- package/src/shared/views/CometChatEmojiKeyboard/resources/index.ts +8 -16
- package/src/shared/views/CometChatEmojiKeyboard/style.ts +72 -61
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +203 -173
- package/src/shared/views/CometChatFileBubble/index.ts +10 -6
- package/src/shared/views/CometChatFileBubble/resources/index.ts +1 -6
- package/src/shared/views/CometChatFileBubble/style.ts +120 -47
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +57 -251
- package/src/shared/views/CometChatImageBubble/CometChatImageLoader.tsx +154 -0
- package/src/shared/views/CometChatImageBubble/assets/index.ts +1 -5
- package/src/shared/views/CometChatImageBubble/index.ts +7 -9
- package/src/shared/views/CometChatImageViewerModal/ImageViewerModal.tsx +28 -43
- package/src/shared/views/CometChatImageViewerModal/index.tsx +1 -1
- package/src/shared/views/CometChatImageViewerModal/resources/index.ts +1 -2
- package/src/shared/views/CometChatList/CometChatList.tsx +667 -700
- package/src/shared/views/CometChatList/Header.tsx +185 -110
- package/src/shared/views/CometChatList/index.ts +7 -4
- package/src/shared/views/CometChatList/resources/index.ts +4 -13
- package/src/shared/views/CometChatList/styles.ts +58 -44
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +132 -259
- package/src/shared/views/CometChatListItem/index.ts +3 -15
- package/src/shared/views/CometChatListItem/style.ts +25 -29
- package/src/shared/views/CometChatMediaRecorder/AnimatingMic.tsx +129 -0
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPlayer.tsx +115 -0
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPreview/CometChatAudioPreview.tsx +233 -0
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +359 -284
- package/src/shared/views/CometChatMediaRecorder/Timer.tsx +83 -0
- package/src/shared/views/CometChatMediaRecorder/index.ts +4 -10
- package/src/shared/views/CometChatMediaRecorder/style.ts +69 -23
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +111 -124
- package/src/shared/views/CometChatMessageBubble/index.ts +2 -5
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +44 -85
- package/src/shared/views/CometChatMessageInput/index.ts +10 -3
- package/src/shared/views/CometChatMessageInput/styles.ts +2 -2
- package/src/shared/views/CometChatPanel/CometChatPanel.tsx +51 -45
- package/src/shared/views/CometChatPanel/PanelStyle.tsx +36 -36
- package/src/shared/views/CometChatPanel/resources/index.ts +1 -4
- package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +51 -73
- package/src/shared/views/CometChatQuickReactions/QuickReactionsStyle.tsx +33 -33
- package/src/shared/views/CometChatQuickReactions/index.ts +4 -5
- package/src/shared/views/CometChatQuickReactions/resources/index.ts +1 -2
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +365 -311
- package/src/shared/views/CometChatReactionList/ReactionListStyle.tsx +152 -64
- package/src/shared/views/CometChatReactionList/Skeleton.tsx +143 -0
- package/src/shared/views/CometChatReactionList/index.ts +6 -5
- package/src/shared/views/CometChatReactionList/resources/index.ts +1 -4
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +103 -171
- package/src/shared/views/CometChatReactions/index.ts +7 -14
- package/src/shared/views/CometChatReactions/style.ts +193 -41
- package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +75 -76
- package/src/shared/views/CometChatReceipt/index.ts +4 -10
- package/src/shared/views/CometChatReceipt/resources/blue-double-tick-icon.png +0 -0
- package/src/shared/views/CometChatReceipt/resources/error.png +0 -0
- package/src/shared/views/CometChatReceipt/resources/grey-double-tick-icon.png +0 -0
- package/src/shared/views/CometChatReceipt/resources/grey-tick-icon.png +0 -0
- package/src/shared/views/CometChatReceipt/resources/index.ts +5 -10
- package/src/shared/views/CometChatReceipt/resources/sending.png +0 -0
- package/src/shared/views/CometChatReceipt/style.ts +50 -9
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +56 -59
- package/src/shared/views/CometChatStatusIndicator/index.ts +6 -22
- package/src/shared/views/CometChatStatusIndicator/private.png +0 -0
- package/src/shared/views/CometChatStatusIndicator/protected.png +0 -0
- package/src/shared/views/CometChatStatusIndicator/styles.ts +47 -15
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +74 -56
- package/src/shared/views/CometChatSuggestionList/Skeleton.tsx +185 -0
- package/src/shared/views/CometChatSuggestionList/SuggestionItem.ts +44 -46
- package/src/shared/views/CometChatSuggestionList/index.ts +3 -7
- package/src/shared/views/CometChatSuggestionList/style.ts +69 -0
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +46 -101
- package/src/shared/views/CometChatTextBubble/index.ts +8 -7
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +166 -0
- package/src/shared/views/CometChatTooltipMenu/index.ts +3 -0
- package/src/shared/views/CometChatTooltipMenu/styles.ts +24 -0
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +155 -195
- package/src/shared/views/CometChatVideoBubble/index.ts +7 -9
- package/src/shared/views/CometChatVideoBubble/resources/index.ts +2 -7
- package/src/shared/views/CometChatVideoBubble/style.ts +101 -5
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +135 -90
- package/src/shared/views/CometChatVideoPlayer/index.tsx +1 -1
- package/src/shared/views/ErrorEmptyView/ErrorEmptyView.tsx +47 -0
- package/src/shared/views/index.ts +72 -214
- package/src/theme/CometChatThemeHelper.ts +427 -0
- package/src/theme/context.ts +20 -0
- package/src/theme/default/color/dark.ts +99 -0
- package/src/theme/default/color/light.ts +105 -0
- package/src/theme/default/index.ts +242 -0
- package/src/theme/default/resources/icons/Base_Icon.png +0 -0
- package/src/theme/default/resources/icons/collaborative_document_1x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_document_2x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_document_3x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_whiteboard_1x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_whiteboard_2x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_whiteboard_3x.png +0 -0
- package/src/theme/default/resources/icons/dark_error_icon.png +0 -0
- package/src/theme/default/resources/icons/index.ts +19 -0
- package/src/theme/default/resources/icons/light_error_icon.png +0 -0
- package/src/theme/default/resources/icons/thread_replies.png +0 -0
- package/src/theme/default/spacing.ts +86 -0
- package/src/theme/default/typography.ts +184 -0
- package/src/theme/hook.ts +19 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/provider.tsx +135 -0
- package/src/theme/type.ts +446 -0
- package/screenshots/logo.png +0 -0
- package/src/AI/AIAssistBot/AIAssistBotDecorator.tsx +0 -166
- package/src/AI/AIAssistBot/AIAssistBotExtension.tsx +0 -22
- package/src/AI/AIAssistBot/AIAssistBotStyle.ts +0 -43
- package/src/AI/AIAssistBot/AIAssistBotView.tsx +0 -297
- package/src/AI/AIAssistBot/configuration.ts +0 -23
- package/src/AI/AIAssistBot/resources/CloseIcon.png +0 -0
- package/src/AI/AIAssistBot/resources/index.ts +0 -6
- package/src/AI/AIBaseConfiguration.ts +0 -15
- package/src/AI/AIBaseStyle.ts +0 -58
- package/src/AI/AIConversationStarter/AIConversationStarter.ts +0 -19
- package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +0 -249
- package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +0 -14
- package/src/AI/AIConversationStarter/configuration.ts +0 -11
- package/src/AI/AIConversationStarter/style.ts +0 -74
- package/src/AI/AIConversationSummary/AIConversationSummaryDecorator.tsx +0 -179
- package/src/AI/AIConversationSummary/AIConversationSummaryExtension.ts +0 -21
- package/src/AI/AIConversationSummary/AIConversationSummaryStyle.tsx +0 -20
- package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +0 -195
- package/src/AI/AIConversationSummary/configuration.ts +0 -14
- package/src/AI/AIConversationSummary/resources/index.ts +0 -6
- package/src/AI/AIExtensionDataSource.ts +0 -18
- package/src/AI/AIOptionsStyle.ts +0 -14
- package/src/AI/AISmartReplies/AISmartReplies.ts +0 -19
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.tsx +0 -306
- package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +0 -16
- package/src/AI/AISmartReplies/configuration.ts +0 -12
- package/src/AI/CardView.tsx +0 -83
- package/src/AI/CardViewStyle.ts +0 -37
- package/src/AI/resources/ai-empty.png +0 -0
- package/src/AI/resources/ai-error.png +0 -0
- package/src/AI/resources/index.ts +0 -12
- package/src/AI/resources/spineer.png +0 -0
- package/src/AI/style.ts +0 -165
- package/src/AI/utils.ts +0 -39
- package/src/CometChatAddMembers/AddMembersConfiguration.tsx +0 -58
- package/src/CometChatAddMembers/CometChatAddMembers.tsx +0 -114
- package/src/CometChatAddMembers/index.ts +0 -10
- package/src/CometChatBannedMembers/BannedMembersConfiguration.tsx +0 -61
- package/src/CometChatBannedMembers/CometChatBannedMembers.tsx +0 -148
- package/src/CometChatBannedMembers/index.ts +0 -13
- package/src/CometChatBannedMembers/resources/clear.png +0 -0
- package/src/CometChatBannedMembers/resources/index.ts +0 -4
- package/src/CometChatContacts/CometChatContacts.tsx +0 -229
- package/src/CometChatContacts/ContactsConfiguration.tsx +0 -69
- package/src/CometChatContacts/ContactsStyle.ts +0 -60
- package/src/CometChatContacts/Header.tsx +0 -167
- package/src/CometChatContacts/index.ts +0 -13
- package/src/CometChatContacts/styles.ts +0 -105
- package/src/CometChatConversations/ConversationsConfiguration.ts +0 -226
- package/src/CometChatConversations/ConversationsStyle.ts +0 -88
- package/src/CometChatConversationsWithMessages/CometChatConversationsWithMessages.tsx +0 -232
- package/src/CometChatConversationsWithMessages/index.ts +0 -6
- package/src/CometChatConversationsWithMessages/resources/index.ts +0 -6
- package/src/CometChatConversationsWithMessages/resources/start.png +0 -0
- package/src/CometChatConversationsWithMessages/styles.ts +0 -15
- package/src/CometChatCreateGroup/CometChatCreateGroup.tsx +0 -382
- package/src/CometChatCreateGroup/CreateGroupConfiguration.ts +0 -36
- package/src/CometChatCreateGroup/Header.tsx +0 -60
- package/src/CometChatCreateGroup/index.ts +0 -15
- package/src/CometChatCreateGroup/resources/close.png +0 -0
- package/src/CometChatCreateGroup/resources/index.ts +0 -11
- package/src/CometChatCreateGroup/resources/rightTick.png +0 -0
- package/src/CometChatCreateGroup/resources/warning.png +0 -0
- package/src/CometChatCreateGroup/style.ts +0 -44
- package/src/CometChatDetails/CometChatDetails.tsx +0 -983
- package/src/CometChatDetails/DetailsConfiguration.tsx +0 -72
- package/src/CometChatDetails/Header.tsx +0 -42
- package/src/CometChatDetails/index.ts +0 -19
- package/src/CometChatDetails/listners.ts +0 -109
- package/src/CometChatDetails/resources/close.png +0 -0
- package/src/CometChatDetails/resources/index.ts +0 -17
- package/src/CometChatDetails/styles.ts +0 -23
- package/src/CometChatGroupMembers/GroupMemberConfiguration.ts +0 -118
- package/src/CometChatGroupMembers/GroupMemberStyle.ts +0 -91
- package/src/CometChatGroupMembers/GroupScopeStyle.ts +0 -68
- package/src/CometChatGroups/GroupsConfiguration.ts +0 -93
- package/src/CometChatGroupsWithMessages/CometChatGroupsWithMessages.tsx +0 -234
- package/src/CometChatGroupsWithMessages/index.ts +0 -6
- package/src/CometChatGroupsWithMessages/resources/index.ts +0 -5
- package/src/CometChatGroupsWithMessages/resources/write.png +0 -0
- package/src/CometChatGroupsWithMessages/styles.ts +0 -15
- package/src/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.tsx +0 -268
- package/src/CometChatJoinProtectedGroup/Header.tsx +0 -52
- package/src/CometChatJoinProtectedGroup/JoinProtectedGroupConfiguration.ts +0 -30
- package/src/CometChatJoinProtectedGroup/index.ts +0 -15
- package/src/CometChatJoinProtectedGroup/resources/close.png +0 -0
- package/src/CometChatJoinProtectedGroup/resources/index.ts +0 -8
- package/src/CometChatJoinProtectedGroup/resources/rightTick.png +0 -0
- package/src/CometChatJoinProtectedGroup/style.ts +0 -11
- package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +0 -96
- package/src/CometChatMessageComposer/styles.ts +0 -28
- package/src/CometChatMessageHeader/MessageHeaderConfiguration.tsx +0 -62
- package/src/CometChatMessageHeader/resources/Back.png +0 -0
- package/src/CometChatMessageHeader/resources/index.ts +0 -11
- package/src/CometChatMessageHeader/resources/password.png +0 -0
- package/src/CometChatMessageHeader/resources/private.png +0 -0
- package/src/CometChatMessageInformation/MessageInformationConfiguration.tsx +0 -32
- package/src/CometChatMessageInformation/MessageInformationStyle.ts +0 -12
- package/src/CometChatMessageList/MessageListConfiguration.ts +0 -250
- package/src/CometChatMessageList/MessageListStyle.ts +0 -75
- package/src/CometChatMessages/CometChatMessages.tsx +0 -347
- package/src/CometChatMessages/MessageStyle.ts +0 -34
- package/src/CometChatMessages/MessagesConfiguration.ts +0 -55
- package/src/CometChatMessages/index.ts +0 -16
- package/src/CometChatMessages/resources/index.ts +0 -6
- package/src/CometChatMessages/resources/info.png +0 -0
- package/src/CometChatMessages/style.ts +0 -23
- package/src/CometChatTabs/CometChatTabs.tsx +0 -178
- package/src/CometChatTabs/CometChatTabsStyle.ts +0 -45
- package/src/CometChatTabs/TabItemStyle.ts +0 -55
- package/src/CometChatTabs/TabItems.ts +0 -11
- package/src/CometChatTabs/index.ts +0 -6
- package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +0 -345
- package/src/CometChatThreadedMessages/Header.tsx +0 -57
- package/src/CometChatThreadedMessages/ThreadedMessagesConfiguration.ts +0 -45
- package/src/CometChatThreadedMessages/index.ts +0 -15
- package/src/CometChatThreadedMessages/resources/Back.png +0 -0
- package/src/CometChatThreadedMessages/resources/close.png +0 -0
- package/src/CometChatThreadedMessages/resources/index.ts +0 -20
- package/src/CometChatThreadedMessages/resources/password.png +0 -0
- package/src/CometChatThreadedMessages/resources/private.png +0 -0
- package/src/CometChatThreadedMessages/resources/right-arrow.png +0 -0
- package/src/CometChatThreadedMessages/style.ts +0 -29
- package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +0 -145
- package/src/CometChatTransferOwnership/TransferOwnershipConfiguration.ts +0 -60
- package/src/CometChatTransferOwnership/index.ts +0 -14
- package/src/CometChatUsers/UsersConfiguration.tsx +0 -59
- package/src/CometChatUsers/UsersStyle.ts +0 -101
- package/src/CometChatUsersWithMessages/CometChatUsersWithMessages.tsx +0 -130
- package/src/CometChatUsersWithMessages/index.ts +0 -6
- package/src/CometChatUsersWithMessages/styles.ts +0 -15
- package/src/calls/CallingDetailsUtils.tsx +0 -158
- package/src/calls/CallingExtentionDecorator.tsx +0 -222
- package/src/calls/CometChatCallBubble/CallBubbleConfiguration.ts +0 -23
- package/src/calls/CometChatCallBubble/CallBubbleStyle.ts +0 -47
- package/src/calls/CometChatCallButtons/CallButtonStyle.ts +0 -35
- package/src/calls/CometChatCallButtons/resources/Call.png +0 -0
- package/src/calls/CometChatCallButtons/resources/Video.png +0 -0
- package/src/calls/CometChatCallButtons/resources/index.ts +0 -9
- package/src/calls/CometChatCallLogDetails/CallLogDetailsConfiguration.ts +0 -118
- package/src/calls/CometChatCallLogDetails/CallLogDetailsStyle.ts +0 -36
- package/src/calls/CometChatCallLogDetails/CometChatCallLogDetails.tsx +0 -309
- package/src/calls/CometChatCallLogDetails/index.ts +0 -23
- package/src/calls/CometChatCallLogDetails/resources/CloseIcon.png +0 -0
- package/src/calls/CometChatCallLogDetails/resources/index.ts +0 -5
- package/src/calls/CometChatCallLogDetails/style.ts +0 -15
- package/src/calls/CometChatCallLogHistory/CallLogHistoryConfiguration.ts +0 -67
- package/src/calls/CometChatCallLogHistory/CallLogHistoryStyle.ts +0 -46
- package/src/calls/CometChatCallLogHistory/CometChatCallLogHistory.tsx +0 -350
- package/src/calls/CometChatCallLogHistory/index.ts +0 -23
- package/src/calls/CometChatCallLogHistory/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Call.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Info.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Selection.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Spineer.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Video.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/check.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/incomingcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/incomingvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/index.ts +0 -42
- package/src/calls/CometChatCallLogHistory/resources/missedcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/missedvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/outgoingcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/outgoingvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/style.ts +0 -24
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsConfiguration.ts +0 -63
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsStyle.ts +0 -59
- package/src/calls/CometChatCallLogParticipants/CometChatCallLogParticipants.tsx +0 -221
- package/src/calls/CometChatCallLogParticipants/index.ts +0 -23
- package/src/calls/CometChatCallLogParticipants/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogParticipants/resources/index.ts +0 -5
- package/src/calls/CometChatCallLogParticipants/style.ts +0 -24
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsConfiguration.ts +0 -65
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsStyle.ts +0 -63
- package/src/calls/CometChatCallLogRecordings/CometChatCallLogRecordings.tsx +0 -254
- package/src/calls/CometChatCallLogRecordings/index.ts +0 -23
- package/src/calls/CometChatCallLogRecordings/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/download.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/index.ts +0 -8
- package/src/calls/CometChatCallLogRecordings/style.ts +0 -24
- package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +0 -89
- package/src/calls/CometChatCallLogs/CallLogsStyle.ts +0 -95
- package/src/calls/CometChatCallLogsWithDetails/CallLogsWithDetailsConfiguration.ts +0 -10
- package/src/calls/CometChatCallLogsWithDetails/CometChatCallLogsWithDetails.tsx +0 -56
- package/src/calls/CometChatCallLogsWithDetails/index.ts +0 -5
- package/src/calls/CometChatCallLogsWithDetails/style.ts +0 -11
- package/src/calls/CometChatIncomingCall/IncomingCallStyle.ts +0 -75
- package/src/calls/CometChatIncomingCall/styles.ts +0 -10
- package/src/calls/CometChatOngoingCall/OngoingCallStyle.ts +0 -25
- package/src/calls/CometChatOutgoingCall/OutgoingCallStyle.ts +0 -39
- package/src/extensions/CollaborativeBubble/CollaborativeBubbleStyle.ts +0 -97
- package/src/extensions/CollaborativeBubble/styles.ts +0 -82
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentConfiguration.tsx +0 -26
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardConfiguration.tsx +0 -26
- package/src/extensions/ImageModeration/ImageModerationDecorator.tsx +0 -82
- package/src/extensions/ImageModeration/ImageModerationExtension.tsx +0 -43
- package/src/extensions/ImageModeration/ImageModerationFilter.tsx +0 -145
- package/src/extensions/ImageModeration/index.ts +0 -18
- package/src/extensions/ImageModeration/resources/index.ts +0 -4
- package/src/extensions/ImageModeration/resources/unsafe.png +0 -0
- package/src/extensions/LinkPreview/LInkPreviewBubbleStyle.ts +0 -28
- package/src/extensions/LinkPreview/LinkPreviewConfiguration.ts +0 -27
- package/src/extensions/LinkPreview/LinkPreviewExtention.tsx +0 -25
- package/src/extensions/LinkPreview/LinkPreviewExtentionDecorator.tsx +0 -55
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +0 -144
- package/src/extensions/SmartReplies/SmartRepliesExtension.tsx +0 -52
- package/src/extensions/SmartReplies/SmartRepliesView.tsx +0 -213
- package/src/extensions/SmartReplies/index.ts +0 -7
- package/src/extensions/SmartReplies/resources/close.png +0 -0
- package/src/extensions/SmartReplies/resources/index.ts +0 -6
- package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardStyle.ts +0 -52
- package/src/extensions/Stickers/StickerStyle.ts +0 -15
- package/src/extensions/TextModeration/TextModerationConfiguration.tsx +0 -25
- package/src/extensions/TextModeration/TextModerationExtension.tsx +0 -51
- package/src/extensions/TextModeration/TextModerationExtensionDecorator.tsx +0 -93
- package/src/extensions/TextModeration/index.ts +0 -6
- package/src/shared/CometChatContext.tsx +0 -43
- package/src/shared/helper/SwipeRow.js +0 -944
- package/src/shared/libs/CometChatCalendar/Calendars/BaseCalendar.tsx +0 -229
- package/src/shared/libs/CometChatCalendar/Calendars/DateSelectionCalendar.tsx +0 -90
- package/src/shared/libs/CometChatCalendar/Calendars/MultiDateSelectionCalendar.tsx +0 -108
- package/src/shared/libs/CometChatCalendar/Calendars/Providers.tsx +0 -27
- package/src/shared/libs/CometChatCalendar/Calendars/index.ts +0 -3
- package/src/shared/libs/CometChatCalendar/Components/Arrow.tsx +0 -46
- package/src/shared/libs/CometChatCalendar/Components/Day.tsx +0 -95
- package/src/shared/libs/CometChatCalendar/Components/Days.tsx +0 -110
- package/src/shared/libs/CometChatCalendar/Components/Month.tsx +0 -47
- package/src/shared/libs/CometChatCalendar/Components/Months.tsx +0 -79
- package/src/shared/libs/CometChatCalendar/Components/Title.tsx +0 -47
- package/src/shared/libs/CometChatCalendar/Components/Weekdays.tsx +0 -29
- package/src/shared/libs/CometChatCalendar/Components/index.ts +0 -7
- package/src/shared/libs/CometChatCalendar/Constants/View.ts +0 -4
- package/src/shared/libs/CometChatCalendar/Constants/index.ts +0 -1
- package/src/shared/libs/CometChatCalendar/Contexts/LocaleContext.tsx +0 -7
- package/src/shared/libs/CometChatCalendar/Contexts/ThemeContext.tsx +0 -7
- package/src/shared/libs/CometChatCalendar/Contexts/index.ts +0 -2
- package/src/shared/libs/CometChatCalendar/Entities/ArrowDirections.ts +0 -1
- package/src/shared/libs/CometChatCalendar/Entities/Calendar.ts +0 -26
- package/src/shared/libs/CometChatCalendar/Entities/Components.ts +0 -13
- package/src/shared/libs/CometChatCalendar/Entities/DateProperties.ts +0 -6
- package/src/shared/libs/CometChatCalendar/Entities/Locale.ts +0 -12
- package/src/shared/libs/CometChatCalendar/Entities/Theme.ts +0 -70
- package/src/shared/libs/CometChatCalendar/Entities/index.ts +0 -6
- package/src/shared/libs/CometChatCalendar/Hooks/index.ts +0 -1
- package/src/shared/libs/CometChatCalendar/Hooks/useSurroundingTimeUnits.ts +0 -63
- package/src/shared/libs/CometChatCalendar/Icons/BackArrow.png +0 -0
- package/src/shared/libs/CometChatCalendar/Icons/chevron-left-16.png +0 -0
- package/src/shared/libs/CometChatCalendar/Icons/index.ts +0 -7
- package/src/shared/libs/CometChatCalendar/Locales/index.ts +0 -4
- package/src/shared/libs/CometChatCalendar/Themes/Colors.ts +0 -31
- package/src/shared/libs/CometChatCalendar/Themes/DarkTheme.ts +0 -79
- package/src/shared/libs/CometChatCalendar/Themes/DefaultTheme.ts +0 -164
- package/src/shared/libs/CometChatCalendar/Themes/index.ts +0 -3
- package/src/shared/libs/CometChatCalendar/Utils/addOpacity.ts +0 -15
- package/src/shared/libs/CometChatCalendar/Utils/checkChangedProps.ts +0 -10
- package/src/shared/libs/CometChatCalendar/Utils/clamp.ts +0 -5
- package/src/shared/libs/CometChatCalendar/Utils/dateRange.ts +0 -23
- package/src/shared/libs/CometChatCalendar/Utils/getExtraDays.ts +0 -25
- package/src/shared/libs/CometChatCalendar/Utils/getSurroundingTimeUnits.ts +0 -20
- package/src/shared/libs/CometChatCalendar/Utils/index.ts +0 -6
- package/src/shared/libs/CometChatCalendar/index.ts +0 -5
- package/src/shared/libs/VideoPlayer/Video.js +0 -494
- package/src/shared/libs/VideoPlayerControls/OSSupport/PlatformSupport.tsx +0 -43
- package/src/shared/libs/VideoPlayerControls/OSSupport/TVOSSupport.tsx +0 -17
- package/src/shared/libs/VideoPlayerControls/OSSupport/index.tsx +0 -1
- package/src/shared/libs/VideoPlayerControls/VideoPlayer.tsx +0 -512
- package/src/shared/libs/VideoPlayerControls/assets/img/back.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/components/Back/Back.tsx +0 -28
- package/src/shared/libs/VideoPlayerControls/components/Back/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/BottomControls.tsx +0 -142
- package/src/shared/libs/VideoPlayerControls/components/Control.tsx +0 -45
- package/src/shared/libs/VideoPlayerControls/components/Error/Error.tsx +0 -22
- package/src/shared/libs/VideoPlayerControls/components/Error/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Error/styles.ts +0 -21
- package/src/shared/libs/VideoPlayerControls/components/Fullscreen.tsx +0 -36
- package/src/shared/libs/VideoPlayerControls/components/Loader/Loader.tsx +0 -15
- package/src/shared/libs/VideoPlayerControls/components/Loader/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Loader/styles.ts +0 -16
- package/src/shared/libs/VideoPlayerControls/components/NullControl.tsx +0 -7
- package/src/shared/libs/VideoPlayerControls/components/Overlay.tsx +0 -23
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/PlayPause.tsx +0 -109
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/styles.ts +0 -21
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/Seekbar.tsx +0 -47
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/styles.ts +0 -37
- package/src/shared/libs/VideoPlayerControls/components/Timer/Timer.tsx +0 -28
- package/src/shared/libs/VideoPlayerControls/components/Timer/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Timer/styles.ts +0 -12
- package/src/shared/libs/VideoPlayerControls/components/Title.tsx +0 -35
- package/src/shared/libs/VideoPlayerControls/components/TopControls.tsx +0 -110
- package/src/shared/libs/VideoPlayerControls/components/Volume/Volume.tsx +0 -37
- package/src/shared/libs/VideoPlayerControls/components/Volume/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Volume/styles.ts +0 -31
- package/src/shared/libs/VideoPlayerControls/components/index.ts +0 -14
- package/src/shared/libs/VideoPlayerControls/components/styles.ts +0 -30
- package/src/shared/libs/VideoPlayerControls/hooks/index.ts +0 -3
- package/src/shared/libs/VideoPlayerControls/hooks/useAnimations.ts +0 -68
- package/src/shared/libs/VideoPlayerControls/hooks/useControlTimeout.tsx +0 -67
- package/src/shared/libs/VideoPlayerControls/hooks/usePanResponders.tsx +0 -96
- package/src/shared/libs/VideoPlayerControls/index.ts +0 -4
- package/src/shared/libs/VideoPlayerControls/styles.ts +0 -19
- package/src/shared/libs/VideoPlayerControls/types.ts +0 -290
- package/src/shared/libs/VideoPlayerControls/utils.ts +0 -76
- package/src/shared/libs/datePickerModal/DateTimePickerModal.android.js +0 -75
- package/src/shared/libs/datePickerModal/DateTimePickerModal.ios.js +0 -363
- package/src/shared/libs/datePickerModal/DateTimePickerModal.js +0 -9
- package/src/shared/libs/datePickerModal/Modal.js +0 -180
- package/src/shared/libs/datePickerModal/index.d.ts +0 -310
- package/src/shared/libs/datePickerModal/index.js +0 -5
- package/src/shared/libs/datePickerModal/utils.js +0 -25
- package/src/shared/libs/luxon/src/datetime.js +0 -2422
- package/src/shared/libs/luxon/src/duration.js +0 -990
- package/src/shared/libs/luxon/src/errors.js +0 -61
- package/src/shared/libs/luxon/src/impl/conversions.js +0 -206
- package/src/shared/libs/luxon/src/impl/diff.js +0 -95
- package/src/shared/libs/luxon/src/impl/digits.js +0 -75
- package/src/shared/libs/luxon/src/impl/english.js +0 -233
- package/src/shared/libs/luxon/src/impl/formats.js +0 -176
- package/src/shared/libs/luxon/src/impl/formatter.js +0 -409
- package/src/shared/libs/luxon/src/impl/invalid.js +0 -14
- package/src/shared/libs/luxon/src/impl/locale.js +0 -542
- package/src/shared/libs/luxon/src/impl/regexParser.js +0 -335
- package/src/shared/libs/luxon/src/impl/tokenParser.js +0 -473
- package/src/shared/libs/luxon/src/impl/util.js +0 -309
- package/src/shared/libs/luxon/src/impl/zoneUtil.js +0 -30
- package/src/shared/libs/luxon/src/info.js +0 -205
- package/src/shared/libs/luxon/src/interval.js +0 -657
- package/src/shared/libs/luxon/src/luxon.js +0 -26
- package/src/shared/libs/luxon/src/package.json +0 -4
- package/src/shared/libs/luxon/src/settings.js +0 -175
- package/src/shared/libs/luxon/src/zone.js +0 -91
- package/src/shared/libs/luxon/src/zones/IANAZone.js +0 -189
- package/src/shared/libs/luxon/src/zones/fixedOffsetZone.js +0 -102
- package/src/shared/libs/luxon/src/zones/invalidZone.js +0 -53
- package/src/shared/libs/luxon/src/zones/systemZone.js +0 -61
- package/src/shared/modals/CometChatCallLogDetailsOptions.ts +0 -23
- package/src/shared/modals/CometChatCallLogDetailsTemplate.ts +0 -16
- package/src/shared/modals/CometChatDetailsOption.ts +0 -24
- package/src/shared/modals/CometChatDetailsTemplate.ts +0 -16
- package/src/shared/modals/CometChatOptions.ts +0 -13
- package/src/shared/modals/InteractiveData/InteractiveActions/APIAction.ts +0 -118
- package/src/shared/modals/InteractiveData/InteractiveActions/CustomAction.ts +0 -19
- package/src/shared/modals/InteractiveData/InteractiveActions/URLNavigationAction.ts +0 -34
- package/src/shared/modals/InteractiveData/InteractiveActions/index.ts +0 -3
- package/src/shared/modals/InteractiveData/InteractiveData/InteractiveCardData.ts +0 -69
- package/src/shared/modals/InteractiveData/InteractiveData/InteractiveFormData.ts +0 -119
- package/src/shared/modals/InteractiveData/InteractiveData/index.ts +0 -2
- package/src/shared/modals/InteractiveData/InteractiveElements/BaseInputElement.ts +0 -102
- package/src/shared/modals/InteractiveData/InteractiveElements/BaseInteractiveElement.ts +0 -45
- package/src/shared/modals/InteractiveData/InteractiveElements/ButtonElement.ts +0 -61
- package/src/shared/modals/InteractiveData/InteractiveElements/CheckboxElement.ts +0 -75
- package/src/shared/modals/InteractiveData/InteractiveElements/DateTimeElement.ts +0 -103
- package/src/shared/modals/InteractiveData/InteractiveElements/DropdownElement.ts +0 -83
- package/src/shared/modals/InteractiveData/InteractiveElements/LabelElement.ts +0 -32
- package/src/shared/modals/InteractiveData/InteractiveElements/OptionElement.ts +0 -39
- package/src/shared/modals/InteractiveData/InteractiveElements/RadioButtonElement.ts +0 -76
- package/src/shared/modals/InteractiveData/InteractiveElements/SingleSelectElement.ts +0 -76
- package/src/shared/modals/InteractiveData/InteractiveElements/TextInputElement.ts +0 -101
- package/src/shared/modals/InteractiveData/InteractiveElements/index.ts +0 -11
- package/src/shared/modals/InteractiveData/InteractiveEntities/ActionEntity.ts +0 -41
- package/src/shared/modals/InteractiveData/InteractiveEntities/ElementEntity.ts +0 -66
- package/src/shared/modals/InteractiveData/InteractiveEntities/index.ts +0 -2
- package/src/shared/modals/InteractiveData/InteractiveMessage/CardMessage.ts +0 -143
- package/src/shared/modals/InteractiveData/InteractiveMessage/CustomInteractiveMessage.ts +0 -39
- package/src/shared/modals/InteractiveData/InteractiveMessage/FormMessage.ts +0 -153
- package/src/shared/modals/InteractiveData/InteractiveMessage/SchedulerMessage.ts +0 -150
- package/src/shared/modals/InteractiveData/InteractiveMessage/index.ts +0 -4
- package/src/shared/modals/InteractiveData/index.ts +0 -30
- package/src/shared/resources/CometChatTheme/CometChatTheme.ts +0 -28
- package/src/shared/resources/CometChatTheme/Palette.ts +0 -584
- package/src/shared/resources/CometChatTheme/Typography.ts +0 -396
- package/src/shared/resources/CometChatTheme/index.ts +0 -2
- package/src/shared/utils/CometChatLiveReactions/CometChatLiveReaction.tsx +0 -124
- package/src/shared/utils/CometChatLiveReactions/LiveReactionstyles.ts +0 -37
- package/src/shared/utils/CometChatLiveReactions/index.ts +0 -1
- package/src/shared/utils/CometChatLiveReactions/resources/heart.png +0 -0
- package/src/shared/utils/CometChatLiveReactions/resources/index.ts +0 -5
- package/src/shared/utils/CometChatLiveReactions/style.ts +0 -8
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +0 -109
- package/src/shared/utils/CometChatMessagePreview/MessagePreviewConfiguration.js +0 -30
- package/src/shared/utils/CometChatMessagePreview/style.js +0 -71
- package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +0 -399
- package/src/shared/utils/DetailsUtils/resources/Back.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/banIcon.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/close.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/index.ts +0 -23
- package/src/shared/utils/DetailsUtils/resources/kickIcon.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/password.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/private.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/right-arrow.png +0 -0
- package/src/shared/utils/InteractiveMessageUtils.ts +0 -60
- package/src/shared/utils/SchedulerUtils.ts +0 -198
- package/src/shared/utils/TypeUtils.ts +0 -3
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +0 -61
- package/src/shared/views/CometChatAudioBubble/AudioBubbleStyle.ts +0 -43
- package/src/shared/views/CometChatAvatar/AvatarConfiguration.ts +0 -27
- package/src/shared/views/CometChatAvatar/AvatarStyle.ts +0 -57
- package/src/shared/views/CometChatAvatar/resources/default.jpg +0 -0
- package/src/shared/views/CometChatAvatar/resources/index.ts +0 -5
- package/src/shared/views/CometChatBadge/BadgeConfiguration.ts +0 -55
- package/src/shared/views/CometChatBadge/BadgeStyle.ts +0 -39
- package/src/shared/views/CometChatBottomSheet/style.ts +0 -50
- package/src/shared/views/CometChatButton/CometChatButton.tsx +0 -76
- package/src/shared/views/CometChatButton/CometChatButtonStyle.ts +0 -47
- package/src/shared/views/CometChatButton/index.ts +0 -5
- package/src/shared/views/CometChatButton/style.ts +0 -8
- package/src/shared/views/CometChatCard/CometChatCard.tsx +0 -77
- package/src/shared/views/CometChatCard/CometChatCardStyle.ts +0 -31
- package/src/shared/views/CometChatCard/index.ts +0 -8
- package/src/shared/views/CometChatCard/style.ts +0 -13
- package/src/shared/views/CometChatCardBubble/CardBubbleStyle.tsx +0 -47
- package/src/shared/views/CometChatCardBubble/CometChatCardBubble.tsx +0 -174
- package/src/shared/views/CometChatCardBubble/index.tsx +0 -2
- package/src/shared/views/CometChatCheckBox/CheckBoxStyle.tsx +0 -43
- package/src/shared/views/CometChatCheckBox/CometChatCheckBox.tsx +0 -79
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialogStyle.ts +0 -36
- package/src/shared/views/CometChatDate/DateConfiguration.ts +0 -32
- package/src/shared/views/CometChatDate/DateStyle.ts +0 -26
- package/src/shared/views/CometChatDate/style.ts +0 -8
- package/src/shared/views/CometChatDateTimePicker/CometChatDateTimePicker.tsx +0 -206
- package/src/shared/views/CometChatDateTimePicker/DateTimePickerStyle.ts +0 -19
- package/src/shared/views/CometChatDateTimePicker/index.ts +0 -3
- package/src/shared/views/CometChatDropDown/CometChatDropDown.tsx +0 -127
- package/src/shared/views/CometChatDropDown/DropDownStyle.tsx +0 -39
- package/src/shared/views/CometChatDropDown/resources/downArrowIcon.png +0 -0
- package/src/shared/views/CometChatDropDown/resources/index.js +0 -5
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.ts +0 -27
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.ts +0 -44
- package/src/shared/views/CometChatFileBubble/FileBubbleStyle.ts +0 -58
- package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +0 -542
- package/src/shared/views/CometChatFormBubble/FormBubbleStyle.tsx +0 -96
- package/src/shared/views/CometChatFormBubble/index.tsx +0 -2
- package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +0 -34
- package/src/shared/views/CometChatImageBubble/assets/default_image.png +0 -0
- package/src/shared/views/CometChatLabel/CometChatLabel.tsx +0 -27
- package/src/shared/views/CometChatLabel/LabelStyle.ts +0 -19
- package/src/shared/views/CometChatList/resources/Back.png +0 -0
- package/src/shared/views/CometChatList/resources/Search.png +0 -0
- package/src/shared/views/CometChatListItem/ListItemConfiguration.tsx +0 -21
- package/src/shared/views/CometChatListItem/ListItemStyle.ts +0 -47
- package/src/shared/views/CometChatMediaRecorder/MediaRecorderStyle.ts +0 -63
- package/src/shared/views/CometChatMessageBubble/MessageBubbleStyle.ts +0 -26
- package/src/shared/views/CometChatQuickReactions/QuickReactionsConfiguration.tsx +0 -13
- package/src/shared/views/CometChatQuickView/CometChatQuickView.tsx +0 -66
- package/src/shared/views/CometChatQuickView/QuickViewStyle.ts +0 -55
- package/src/shared/views/CometChatRadioButton/CometChatRadioButton.tsx +0 -67
- package/src/shared/views/CometChatRadioButton/RadioButtonStyle.tsx +0 -38
- package/src/shared/views/CometChatReactionList/ReactionListConfiguration.tsx +0 -15
- package/src/shared/views/CometChatReactions/ReactionsConfiguration.tsx +0 -13
- package/src/shared/views/CometChatReactions/ReactionsStyle.tsx +0 -43
- package/src/shared/views/CometChatReceipt/MessageConfiguration.ts +0 -65
- package/src/shared/views/CometChatReceipt/ReceiptStyle.ts +0 -3
- package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +0 -1519
- package/src/shared/views/CometChatSchedulerBubble/index.ts +0 -3
- package/src/shared/views/CometChatSchedulerBubble/styles.ts +0 -92
- package/src/shared/views/CometChatSingleSelect/CometChatSingleSelect.tsx +0 -63
- package/src/shared/views/CometChatSingleSelect/SingleStyle.tsx +0 -35
- package/src/shared/views/CometChatStatusIndicator/StatusIndicatorConfiguration.ts +0 -25
- package/src/shared/views/CometChatStatusIndicator/StatusIndicatorStyle.ts +0 -37
- package/src/shared/views/CometChatSuggestionList/SuggestionListConfiguration.ts +0 -23
- package/src/shared/views/CometChatTextBubble/TextBubbleStyle.ts +0 -37
- package/src/shared/views/CometChatTextInput/CometChatTextInput.tsx +0 -67
- package/src/shared/views/CometChatTextInput/TextInputStyle.tsx +0 -26
- package/src/shared/views/CometChatTimeSlotSelector/CometChatTimeSlotSelector.tsx +0 -113
- package/src/shared/views/CometChatTimeSlotSelector/index.ts +0 -3
- package/src/shared/views/CometChatTimeSlotSelector/styles.ts +0 -30
- package/src/shared/views/CometChatVideoBubble/VideoBubbleStyle.ts +0 -87
- package/src/shared/views/SwipeRow/SwipeRow.tsx +0 -126
- package/src/shared/views/SwipeRow/index.ts +0 -3
- package/src/shared/views/SwipeRow/style.ts +0 -30
- /package/src/{shared/assets/images → CometChatGroups/resources}/search.png +0 -0
- /package/src/{CometChatDetails → CometChatThreadHeader}/resources/Back.png +0 -0
- /package/src/{AI/AIConversationSummary → CometChatThreadHeader}/resources/close.png +0 -0
- /package/src/{CometChatThreadedMessages → CometChatThreadHeader}/resources/more.png +0 -0
- /package/src/{CometChatDetails → CometChatThreadHeader}/resources/password.png +0 -0
- /package/src/{CometChatDetails → CometChatThreadHeader}/resources/private.png +0 -0
- /package/src/{CometChatDetails → CometChatThreadHeader}/resources/right-arrow.png +0 -0
|
@@ -1,990 +0,0 @@
|
|
|
1
|
-
import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from "./errors.js";
|
|
2
|
-
import Formatter from "./impl/formatter.js";
|
|
3
|
-
import Invalid from "./impl/invalid.js";
|
|
4
|
-
import Locale from "./impl/locale.js";
|
|
5
|
-
import { parseISODuration, parseISOTimeOnly } from "./impl/regexParser.js";
|
|
6
|
-
import {
|
|
7
|
-
asNumber,
|
|
8
|
-
hasOwnProperty,
|
|
9
|
-
isNumber,
|
|
10
|
-
isUndefined,
|
|
11
|
-
normalizeObject,
|
|
12
|
-
roundTo,
|
|
13
|
-
} from "./impl/util.js";
|
|
14
|
-
import Settings from "./settings.js";
|
|
15
|
-
import DateTime from "./datetime.js";
|
|
16
|
-
|
|
17
|
-
const INVALID = "Invalid Duration";
|
|
18
|
-
|
|
19
|
-
// unit conversion constants
|
|
20
|
-
export const lowOrderMatrix = {
|
|
21
|
-
weeks: {
|
|
22
|
-
days: 7,
|
|
23
|
-
hours: 7 * 24,
|
|
24
|
-
minutes: 7 * 24 * 60,
|
|
25
|
-
seconds: 7 * 24 * 60 * 60,
|
|
26
|
-
milliseconds: 7 * 24 * 60 * 60 * 1000,
|
|
27
|
-
},
|
|
28
|
-
days: {
|
|
29
|
-
hours: 24,
|
|
30
|
-
minutes: 24 * 60,
|
|
31
|
-
seconds: 24 * 60 * 60,
|
|
32
|
-
milliseconds: 24 * 60 * 60 * 1000,
|
|
33
|
-
},
|
|
34
|
-
hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },
|
|
35
|
-
minutes: { seconds: 60, milliseconds: 60 * 1000 },
|
|
36
|
-
seconds: { milliseconds: 1000 },
|
|
37
|
-
},
|
|
38
|
-
casualMatrix = {
|
|
39
|
-
years: {
|
|
40
|
-
quarters: 4,
|
|
41
|
-
months: 12,
|
|
42
|
-
weeks: 52,
|
|
43
|
-
days: 365,
|
|
44
|
-
hours: 365 * 24,
|
|
45
|
-
minutes: 365 * 24 * 60,
|
|
46
|
-
seconds: 365 * 24 * 60 * 60,
|
|
47
|
-
milliseconds: 365 * 24 * 60 * 60 * 1000,
|
|
48
|
-
},
|
|
49
|
-
quarters: {
|
|
50
|
-
months: 3,
|
|
51
|
-
weeks: 13,
|
|
52
|
-
days: 91,
|
|
53
|
-
hours: 91 * 24,
|
|
54
|
-
minutes: 91 * 24 * 60,
|
|
55
|
-
seconds: 91 * 24 * 60 * 60,
|
|
56
|
-
milliseconds: 91 * 24 * 60 * 60 * 1000,
|
|
57
|
-
},
|
|
58
|
-
months: {
|
|
59
|
-
weeks: 4,
|
|
60
|
-
days: 30,
|
|
61
|
-
hours: 30 * 24,
|
|
62
|
-
minutes: 30 * 24 * 60,
|
|
63
|
-
seconds: 30 * 24 * 60 * 60,
|
|
64
|
-
milliseconds: 30 * 24 * 60 * 60 * 1000,
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
...lowOrderMatrix,
|
|
68
|
-
},
|
|
69
|
-
daysInYearAccurate = 146097.0 / 400,
|
|
70
|
-
daysInMonthAccurate = 146097.0 / 4800,
|
|
71
|
-
accurateMatrix = {
|
|
72
|
-
years: {
|
|
73
|
-
quarters: 4,
|
|
74
|
-
months: 12,
|
|
75
|
-
weeks: daysInYearAccurate / 7,
|
|
76
|
-
days: daysInYearAccurate,
|
|
77
|
-
hours: daysInYearAccurate * 24,
|
|
78
|
-
minutes: daysInYearAccurate * 24 * 60,
|
|
79
|
-
seconds: daysInYearAccurate * 24 * 60 * 60,
|
|
80
|
-
milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,
|
|
81
|
-
},
|
|
82
|
-
quarters: {
|
|
83
|
-
months: 3,
|
|
84
|
-
weeks: daysInYearAccurate / 28,
|
|
85
|
-
days: daysInYearAccurate / 4,
|
|
86
|
-
hours: (daysInYearAccurate * 24) / 4,
|
|
87
|
-
minutes: (daysInYearAccurate * 24 * 60) / 4,
|
|
88
|
-
seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,
|
|
89
|
-
milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,
|
|
90
|
-
},
|
|
91
|
-
months: {
|
|
92
|
-
weeks: daysInMonthAccurate / 7,
|
|
93
|
-
days: daysInMonthAccurate,
|
|
94
|
-
hours: daysInMonthAccurate * 24,
|
|
95
|
-
minutes: daysInMonthAccurate * 24 * 60,
|
|
96
|
-
seconds: daysInMonthAccurate * 24 * 60 * 60,
|
|
97
|
-
milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,
|
|
98
|
-
},
|
|
99
|
-
...lowOrderMatrix,
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// units ordered by size
|
|
103
|
-
const orderedUnits = [
|
|
104
|
-
"years",
|
|
105
|
-
"quarters",
|
|
106
|
-
"months",
|
|
107
|
-
"weeks",
|
|
108
|
-
"days",
|
|
109
|
-
"hours",
|
|
110
|
-
"minutes",
|
|
111
|
-
"seconds",
|
|
112
|
-
"milliseconds",
|
|
113
|
-
];
|
|
114
|
-
|
|
115
|
-
const reverseUnits = orderedUnits.slice(0).reverse();
|
|
116
|
-
|
|
117
|
-
// clone really means "create another instance just like this one, but with these changes"
|
|
118
|
-
function clone(dur, alts, clear = false) {
|
|
119
|
-
// deep merge for vals
|
|
120
|
-
const conf = {
|
|
121
|
-
values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },
|
|
122
|
-
loc: dur.loc.clone(alts.loc),
|
|
123
|
-
conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,
|
|
124
|
-
matrix: alts.matrix || dur.matrix,
|
|
125
|
-
};
|
|
126
|
-
return new Duration(conf);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function durationToMillis(matrix, vals) {
|
|
130
|
-
let sum = vals.milliseconds ?? 0;
|
|
131
|
-
for (const unit of reverseUnits.slice(1)) {
|
|
132
|
-
if (vals[unit]) {
|
|
133
|
-
sum += vals[unit] * matrix[unit]["milliseconds"];
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return sum;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// NB: mutates parameters
|
|
140
|
-
function normalizeValues(matrix, vals) {
|
|
141
|
-
// the logic below assumes the overall value of the duration is positive
|
|
142
|
-
// if this is not the case, factor is used to make it so
|
|
143
|
-
const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;
|
|
144
|
-
|
|
145
|
-
orderedUnits.reduceRight((previous, current) => {
|
|
146
|
-
if (!isUndefined(vals[current])) {
|
|
147
|
-
if (previous) {
|
|
148
|
-
const previousVal = vals[previous] * factor;
|
|
149
|
-
const conv = matrix[current][previous];
|
|
150
|
-
|
|
151
|
-
// if (previousVal < 0):
|
|
152
|
-
// lower order unit is negative (e.g. { years: 2, days: -2 })
|
|
153
|
-
// normalize this by reducing the higher order unit by the appropriate amount
|
|
154
|
-
// and increasing the lower order unit
|
|
155
|
-
// this can never make the higher order unit negative, because this function only operates
|
|
156
|
-
// on positive durations, so the amount of time represented by the lower order unit cannot
|
|
157
|
-
// be larger than the higher order unit
|
|
158
|
-
// else:
|
|
159
|
-
// lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })
|
|
160
|
-
// in this case we attempt to convert as much as possible from the lower order unit into
|
|
161
|
-
// the higher order one
|
|
162
|
-
//
|
|
163
|
-
// Math.floor takes care of both of these cases, rounding away from 0
|
|
164
|
-
// if previousVal < 0 it makes the absolute value larger
|
|
165
|
-
// if previousVal >= it makes the absolute value smaller
|
|
166
|
-
const rollUp = Math.floor(previousVal / conv);
|
|
167
|
-
vals[current] += rollUp * factor;
|
|
168
|
-
vals[previous] -= rollUp * conv * factor;
|
|
169
|
-
}
|
|
170
|
-
return current;
|
|
171
|
-
} else {
|
|
172
|
-
return previous;
|
|
173
|
-
}
|
|
174
|
-
}, null);
|
|
175
|
-
|
|
176
|
-
// try to convert any decimals into smaller units if possible
|
|
177
|
-
// for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }
|
|
178
|
-
orderedUnits.reduce((previous, current) => {
|
|
179
|
-
if (!isUndefined(vals[current])) {
|
|
180
|
-
if (previous) {
|
|
181
|
-
const fraction = vals[previous] % 1;
|
|
182
|
-
vals[previous] -= fraction;
|
|
183
|
-
vals[current] += fraction * matrix[previous][current];
|
|
184
|
-
}
|
|
185
|
-
return current;
|
|
186
|
-
} else {
|
|
187
|
-
return previous;
|
|
188
|
-
}
|
|
189
|
-
}, null);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Remove all properties with a value of 0 from an object
|
|
193
|
-
function removeZeroes(vals) {
|
|
194
|
-
const newVals = {};
|
|
195
|
-
for (const [key, value] of Object.entries(vals)) {
|
|
196
|
-
if (value !== 0) {
|
|
197
|
-
newVals[key] = value;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return newVals;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.
|
|
205
|
-
*
|
|
206
|
-
* Here is a brief overview of commonly used methods and getters in Duration:
|
|
207
|
-
*
|
|
208
|
-
* * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.
|
|
209
|
-
* * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.
|
|
210
|
-
* * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.
|
|
211
|
-
* * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.
|
|
212
|
-
* * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}
|
|
213
|
-
*
|
|
214
|
-
* There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.
|
|
215
|
-
*/
|
|
216
|
-
export default class Duration {
|
|
217
|
-
/**
|
|
218
|
-
* @private
|
|
219
|
-
*/
|
|
220
|
-
constructor(config) {
|
|
221
|
-
const accurate = config.conversionAccuracy === "longterm" || false;
|
|
222
|
-
let matrix = accurate ? accurateMatrix : casualMatrix;
|
|
223
|
-
|
|
224
|
-
if (config.matrix) {
|
|
225
|
-
matrix = config.matrix;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* @access private
|
|
230
|
-
*/
|
|
231
|
-
this.values = config.values;
|
|
232
|
-
/**
|
|
233
|
-
* @access private
|
|
234
|
-
*/
|
|
235
|
-
this.loc = config.loc || Locale.create();
|
|
236
|
-
/**
|
|
237
|
-
* @access private
|
|
238
|
-
*/
|
|
239
|
-
this.conversionAccuracy = accurate ? "longterm" : "casual";
|
|
240
|
-
/**
|
|
241
|
-
* @access private
|
|
242
|
-
*/
|
|
243
|
-
this.invalid = config.invalid || null;
|
|
244
|
-
/**
|
|
245
|
-
* @access private
|
|
246
|
-
*/
|
|
247
|
-
this.matrix = matrix;
|
|
248
|
-
/**
|
|
249
|
-
* @access private
|
|
250
|
-
*/
|
|
251
|
-
this.isLuxonDuration = true;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Create Duration from a number of milliseconds.
|
|
256
|
-
* @param {number} count of milliseconds
|
|
257
|
-
* @param {Object} opts - options for parsing
|
|
258
|
-
* @param {string} [opts.locale='en-US'] - the locale to use
|
|
259
|
-
* @param {string} opts.numberingSystem - the numbering system to use
|
|
260
|
-
* @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use
|
|
261
|
-
* @return {Duration}
|
|
262
|
-
*/
|
|
263
|
-
static fromMillis(count, opts) {
|
|
264
|
-
return Duration.fromObject({ milliseconds: count }, opts);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Create a Duration from a JavaScript object with keys like 'years' and 'hours'.
|
|
269
|
-
* If this object is empty then a zero milliseconds duration is returned.
|
|
270
|
-
* @param {Object} obj - the object to create the DateTime from
|
|
271
|
-
* @param {number} obj.years
|
|
272
|
-
* @param {number} obj.quarters
|
|
273
|
-
* @param {number} obj.months
|
|
274
|
-
* @param {number} obj.weeks
|
|
275
|
-
* @param {number} obj.days
|
|
276
|
-
* @param {number} obj.hours
|
|
277
|
-
* @param {number} obj.minutes
|
|
278
|
-
* @param {number} obj.seconds
|
|
279
|
-
* @param {number} obj.milliseconds
|
|
280
|
-
* @param {Object} [opts=[]] - options for creating this Duration
|
|
281
|
-
* @param {string} [opts.locale='en-US'] - the locale to use
|
|
282
|
-
* @param {string} opts.numberingSystem - the numbering system to use
|
|
283
|
-
* @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use
|
|
284
|
-
* @param {string} [opts.matrix=Object] - the custom conversion system to use
|
|
285
|
-
* @return {Duration}
|
|
286
|
-
*/
|
|
287
|
-
static fromObject(obj, opts = {}) {
|
|
288
|
-
if (obj == null || typeof obj !== "object") {
|
|
289
|
-
throw new InvalidArgumentError(
|
|
290
|
-
`Duration.fromObject: argument expected to be an object, got ${
|
|
291
|
-
obj === null ? "null" : typeof obj
|
|
292
|
-
}`
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
return new Duration({
|
|
297
|
-
values: normalizeObject(obj, Duration.normalizeUnit),
|
|
298
|
-
loc: Locale.fromObject(opts),
|
|
299
|
-
conversionAccuracy: opts.conversionAccuracy,
|
|
300
|
-
matrix: opts.matrix,
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Create a Duration from DurationLike.
|
|
306
|
-
*
|
|
307
|
-
* @param {Object | number | Duration} durationLike
|
|
308
|
-
* One of:
|
|
309
|
-
* - object with keys like 'years' and 'hours'.
|
|
310
|
-
* - number representing milliseconds
|
|
311
|
-
* - Duration instance
|
|
312
|
-
* @return {Duration}
|
|
313
|
-
*/
|
|
314
|
-
static fromDurationLike(durationLike) {
|
|
315
|
-
if (isNumber(durationLike)) {
|
|
316
|
-
return Duration.fromMillis(durationLike);
|
|
317
|
-
} else if (Duration.isDuration(durationLike)) {
|
|
318
|
-
return durationLike;
|
|
319
|
-
} else if (typeof durationLike === "object") {
|
|
320
|
-
return Duration.fromObject(durationLike);
|
|
321
|
-
} else {
|
|
322
|
-
throw new InvalidArgumentError(
|
|
323
|
-
`Unknown duration argument ${durationLike} of type ${typeof durationLike}`
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Create a Duration from an ISO 8601 duration string.
|
|
330
|
-
* @param {string} text - text to parse
|
|
331
|
-
* @param {Object} opts - options for parsing
|
|
332
|
-
* @param {string} [opts.locale='en-US'] - the locale to use
|
|
333
|
-
* @param {string} opts.numberingSystem - the numbering system to use
|
|
334
|
-
* @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use
|
|
335
|
-
* @param {string} [opts.matrix=Object] - the preset conversion system to use
|
|
336
|
-
* @see https://en.wikipedia.org/wiki/ISO_8601#Durations
|
|
337
|
-
* @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }
|
|
338
|
-
* @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }
|
|
339
|
-
* @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }
|
|
340
|
-
* @return {Duration}
|
|
341
|
-
*/
|
|
342
|
-
static fromISO(text, opts) {
|
|
343
|
-
const [parsed] = parseISODuration(text);
|
|
344
|
-
if (parsed) {
|
|
345
|
-
return Duration.fromObject(parsed, opts);
|
|
346
|
-
} else {
|
|
347
|
-
return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Create a Duration from an ISO 8601 time string.
|
|
353
|
-
* @param {string} text - text to parse
|
|
354
|
-
* @param {Object} opts - options for parsing
|
|
355
|
-
* @param {string} [opts.locale='en-US'] - the locale to use
|
|
356
|
-
* @param {string} opts.numberingSystem - the numbering system to use
|
|
357
|
-
* @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use
|
|
358
|
-
* @param {string} [opts.matrix=Object] - the conversion system to use
|
|
359
|
-
* @see https://en.wikipedia.org/wiki/ISO_8601#Times
|
|
360
|
-
* @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }
|
|
361
|
-
* @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
|
|
362
|
-
* @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
|
|
363
|
-
* @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
|
|
364
|
-
* @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
|
|
365
|
-
* @return {Duration}
|
|
366
|
-
*/
|
|
367
|
-
static fromISOTime(text, opts) {
|
|
368
|
-
const [parsed] = parseISOTimeOnly(text);
|
|
369
|
-
if (parsed) {
|
|
370
|
-
return Duration.fromObject(parsed, opts);
|
|
371
|
-
} else {
|
|
372
|
-
return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Create an invalid Duration.
|
|
378
|
-
* @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent
|
|
379
|
-
* @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information
|
|
380
|
-
* @return {Duration}
|
|
381
|
-
*/
|
|
382
|
-
static invalid(reason, explanation = null) {
|
|
383
|
-
if (!reason) {
|
|
384
|
-
throw new InvalidArgumentError("need to specify a reason the Duration is invalid");
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
|
|
388
|
-
|
|
389
|
-
if (Settings.throwOnInvalid) {
|
|
390
|
-
throw new InvalidDurationError(invalid);
|
|
391
|
-
} else {
|
|
392
|
-
return new Duration({ invalid });
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* @private
|
|
398
|
-
*/
|
|
399
|
-
static normalizeUnit(unit) {
|
|
400
|
-
const normalized = {
|
|
401
|
-
year: "years",
|
|
402
|
-
years: "years",
|
|
403
|
-
quarter: "quarters",
|
|
404
|
-
quarters: "quarters",
|
|
405
|
-
month: "months",
|
|
406
|
-
months: "months",
|
|
407
|
-
week: "weeks",
|
|
408
|
-
weeks: "weeks",
|
|
409
|
-
day: "days",
|
|
410
|
-
days: "days",
|
|
411
|
-
hour: "hours",
|
|
412
|
-
hours: "hours",
|
|
413
|
-
minute: "minutes",
|
|
414
|
-
minutes: "minutes",
|
|
415
|
-
second: "seconds",
|
|
416
|
-
seconds: "seconds",
|
|
417
|
-
millisecond: "milliseconds",
|
|
418
|
-
milliseconds: "milliseconds",
|
|
419
|
-
}[unit ? unit.toLowerCase() : unit];
|
|
420
|
-
|
|
421
|
-
if (!normalized) throw new InvalidUnitError(unit);
|
|
422
|
-
|
|
423
|
-
return normalized;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Check if an object is a Duration. Works across context boundaries
|
|
428
|
-
* @param {object} o
|
|
429
|
-
* @return {boolean}
|
|
430
|
-
*/
|
|
431
|
-
static isDuration(o) {
|
|
432
|
-
return (o && o.isLuxonDuration) || false;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* Get the locale of a Duration, such 'en-GB'
|
|
437
|
-
* @type {string}
|
|
438
|
-
*/
|
|
439
|
-
get locale() {
|
|
440
|
-
return this.isValid ? this.loc.locale : null;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration
|
|
445
|
-
*
|
|
446
|
-
* @type {string}
|
|
447
|
-
*/
|
|
448
|
-
get numberingSystem() {
|
|
449
|
-
return this.isValid ? this.loc.numberingSystem : null;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:
|
|
454
|
-
* * `S` for milliseconds
|
|
455
|
-
* * `s` for seconds
|
|
456
|
-
* * `m` for minutes
|
|
457
|
-
* * `h` for hours
|
|
458
|
-
* * `d` for days
|
|
459
|
-
* * `w` for weeks
|
|
460
|
-
* * `M` for months
|
|
461
|
-
* * `y` for years
|
|
462
|
-
* Notes:
|
|
463
|
-
* * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits
|
|
464
|
-
* * Tokens can be escaped by wrapping with single quotes.
|
|
465
|
-
* * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.
|
|
466
|
-
* @param {string} fmt - the format string
|
|
467
|
-
* @param {Object} opts - options
|
|
468
|
-
* @param {boolean} [opts.floor=true] - floor numerical values
|
|
469
|
-
* @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2"
|
|
470
|
-
* @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002"
|
|
471
|
-
* @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000"
|
|
472
|
-
* @return {string}
|
|
473
|
-
*/
|
|
474
|
-
toFormat(fmt, opts = {}) {
|
|
475
|
-
// reverse-compat since 1.2; we always round down now, never up, and we do it by default
|
|
476
|
-
const fmtOpts = {
|
|
477
|
-
...opts,
|
|
478
|
-
floor: opts.round !== false && opts.floor !== false,
|
|
479
|
-
};
|
|
480
|
-
return this.isValid
|
|
481
|
-
? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)
|
|
482
|
-
: INVALID;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Returns a string representation of a Duration with all units included.
|
|
487
|
-
* To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.
|
|
488
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
|
|
489
|
-
* @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.
|
|
490
|
-
* @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.
|
|
491
|
-
* @example
|
|
492
|
-
* ```js
|
|
493
|
-
* var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })
|
|
494
|
-
* dur.toHuman() //=> '1 day, 5 hours, 6 minutes'
|
|
495
|
-
* dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes'
|
|
496
|
-
* dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min'
|
|
497
|
-
* ```
|
|
498
|
-
*/
|
|
499
|
-
toHuman(opts = {}) {
|
|
500
|
-
if (!this.isValid) return INVALID;
|
|
501
|
-
|
|
502
|
-
const l = orderedUnits
|
|
503
|
-
.map((unit) => {
|
|
504
|
-
const val = this.values[unit];
|
|
505
|
-
if (isUndefined(val)) {
|
|
506
|
-
return null;
|
|
507
|
-
}
|
|
508
|
-
return this.loc
|
|
509
|
-
.numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit.slice(0, -1) })
|
|
510
|
-
.format(val);
|
|
511
|
-
})
|
|
512
|
-
.filter((n) => n);
|
|
513
|
-
|
|
514
|
-
return this.loc
|
|
515
|
-
.listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts })
|
|
516
|
-
.format(l);
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* Returns a JavaScript object with this Duration's values.
|
|
521
|
-
* @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }
|
|
522
|
-
* @return {Object}
|
|
523
|
-
*/
|
|
524
|
-
toObject() {
|
|
525
|
-
if (!this.isValid) return {};
|
|
526
|
-
return { ...this.values };
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Returns an ISO 8601-compliant string representation of this Duration.
|
|
531
|
-
* @see https://en.wikipedia.org/wiki/ISO_8601#Durations
|
|
532
|
-
* @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'
|
|
533
|
-
* @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'
|
|
534
|
-
* @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'
|
|
535
|
-
* @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'
|
|
536
|
-
* @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'
|
|
537
|
-
* @return {string}
|
|
538
|
-
*/
|
|
539
|
-
toISO() {
|
|
540
|
-
// we could use the formatter, but this is an easier way to get the minimum string
|
|
541
|
-
if (!this.isValid) return null;
|
|
542
|
-
|
|
543
|
-
let s = "P";
|
|
544
|
-
if (this.years !== 0) s += this.years + "Y";
|
|
545
|
-
if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M";
|
|
546
|
-
if (this.weeks !== 0) s += this.weeks + "W";
|
|
547
|
-
if (this.days !== 0) s += this.days + "D";
|
|
548
|
-
if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)
|
|
549
|
-
s += "T";
|
|
550
|
-
if (this.hours !== 0) s += this.hours + "H";
|
|
551
|
-
if (this.minutes !== 0) s += this.minutes + "M";
|
|
552
|
-
if (this.seconds !== 0 || this.milliseconds !== 0)
|
|
553
|
-
// this will handle "floating point madness" by removing extra decimal places
|
|
554
|
-
// https://stackoverflow.com/questions/588004/is-floating-point-math-broken
|
|
555
|
-
s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S";
|
|
556
|
-
if (s === "P") s += "T0S";
|
|
557
|
-
return s;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.
|
|
562
|
-
* Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.
|
|
563
|
-
* @see https://en.wikipedia.org/wiki/ISO_8601#Times
|
|
564
|
-
* @param {Object} opts - options
|
|
565
|
-
* @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0
|
|
566
|
-
* @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0
|
|
567
|
-
* @param {boolean} [opts.includePrefix=false] - include the `T` prefix
|
|
568
|
-
* @param {string} [opts.format='extended'] - choose between the basic and extended format
|
|
569
|
-
* @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'
|
|
570
|
-
* @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'
|
|
571
|
-
* @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'
|
|
572
|
-
* @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'
|
|
573
|
-
* @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'
|
|
574
|
-
* @return {string}
|
|
575
|
-
*/
|
|
576
|
-
toISOTime(opts = {}) {
|
|
577
|
-
if (!this.isValid) return null;
|
|
578
|
-
|
|
579
|
-
const millis = this.toMillis();
|
|
580
|
-
if (millis < 0 || millis >= 86400000) return null;
|
|
581
|
-
|
|
582
|
-
opts = {
|
|
583
|
-
suppressMilliseconds: false,
|
|
584
|
-
suppressSeconds: false,
|
|
585
|
-
includePrefix: false,
|
|
586
|
-
format: "extended",
|
|
587
|
-
...opts,
|
|
588
|
-
includeOffset: false,
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
const dateTime = DateTime.fromMillis(millis, { zone: "UTC" });
|
|
592
|
-
return dateTime.toISOTime(opts);
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
* Returns an ISO 8601 representation of this Duration appropriate for use in JSON.
|
|
597
|
-
* @return {string}
|
|
598
|
-
*/
|
|
599
|
-
toJSON() {
|
|
600
|
-
return this.toISO();
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
/**
|
|
604
|
-
* Returns an ISO 8601 representation of this Duration appropriate for use in debugging.
|
|
605
|
-
* @return {string}
|
|
606
|
-
*/
|
|
607
|
-
toString() {
|
|
608
|
-
return this.toISO();
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* Returns a string representation of this Duration appropriate for the REPL.
|
|
613
|
-
* @return {string}
|
|
614
|
-
*/
|
|
615
|
-
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
616
|
-
if (this.isValid) {
|
|
617
|
-
return `Duration { values: ${JSON.stringify(this.values)} }`;
|
|
618
|
-
} else {
|
|
619
|
-
return `Duration { Invalid, reason: ${this.invalidReason} }`;
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* Returns an milliseconds value of this Duration.
|
|
625
|
-
* @return {number}
|
|
626
|
-
*/
|
|
627
|
-
toMillis() {
|
|
628
|
-
if (!this.isValid) return NaN;
|
|
629
|
-
|
|
630
|
-
return durationToMillis(this.matrix, this.values);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
635
|
-
* @return {number}
|
|
636
|
-
*/
|
|
637
|
-
valueOf() {
|
|
638
|
-
return this.toMillis();
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
/**
|
|
642
|
-
* Make this Duration longer by the specified amount. Return a newly-constructed Duration.
|
|
643
|
-
* @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
|
|
644
|
-
* @return {Duration}
|
|
645
|
-
*/
|
|
646
|
-
plus(duration) {
|
|
647
|
-
if (!this.isValid) return this;
|
|
648
|
-
|
|
649
|
-
const dur = Duration.fromDurationLike(duration),
|
|
650
|
-
result = {};
|
|
651
|
-
|
|
652
|
-
for (const k of orderedUnits) {
|
|
653
|
-
if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {
|
|
654
|
-
result[k] = dur.get(k) + this.get(k);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
return clone(this, { values: result }, true);
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* Make this Duration shorter by the specified amount. Return a newly-constructed Duration.
|
|
663
|
-
* @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
|
|
664
|
-
* @return {Duration}
|
|
665
|
-
*/
|
|
666
|
-
minus(duration) {
|
|
667
|
-
if (!this.isValid) return this;
|
|
668
|
-
|
|
669
|
-
const dur = Duration.fromDurationLike(duration);
|
|
670
|
-
return this.plus(dur.negate());
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
/**
|
|
674
|
-
* Scale this Duration by the specified amount. Return a newly-constructed Duration.
|
|
675
|
-
* @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.
|
|
676
|
-
* @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }
|
|
677
|
-
* @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 }
|
|
678
|
-
* @return {Duration}
|
|
679
|
-
*/
|
|
680
|
-
mapUnits(fn) {
|
|
681
|
-
if (!this.isValid) return this;
|
|
682
|
-
const result = {};
|
|
683
|
-
for (const k of Object.keys(this.values)) {
|
|
684
|
-
result[k] = asNumber(fn(this.values[k], k));
|
|
685
|
-
}
|
|
686
|
-
return clone(this, { values: result }, true);
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* Get the value of unit.
|
|
691
|
-
* @param {string} unit - a unit such as 'minute' or 'day'
|
|
692
|
-
* @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2
|
|
693
|
-
* @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0
|
|
694
|
-
* @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3
|
|
695
|
-
* @return {number}
|
|
696
|
-
*/
|
|
697
|
-
get(unit) {
|
|
698
|
-
return this[Duration.normalizeUnit(unit)];
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* "Set" the values of specified units. Return a newly-constructed Duration.
|
|
703
|
-
* @param {Object} values - a mapping of units to numbers
|
|
704
|
-
* @example dur.set({ years: 2017 })
|
|
705
|
-
* @example dur.set({ hours: 8, minutes: 30 })
|
|
706
|
-
* @return {Duration}
|
|
707
|
-
*/
|
|
708
|
-
set(values) {
|
|
709
|
-
if (!this.isValid) return this;
|
|
710
|
-
|
|
711
|
-
const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };
|
|
712
|
-
return clone(this, { values: mixed });
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration.
|
|
717
|
-
* @example dur.reconfigure({ locale: 'en-GB' })
|
|
718
|
-
* @return {Duration}
|
|
719
|
-
*/
|
|
720
|
-
reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {
|
|
721
|
-
const loc = this.loc.clone({ locale, numberingSystem });
|
|
722
|
-
const opts = { loc, matrix, conversionAccuracy };
|
|
723
|
-
return clone(this, opts);
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* Return the length of the duration in the specified unit.
|
|
728
|
-
* @param {string} unit - a unit such as 'minutes' or 'days'
|
|
729
|
-
* @example Duration.fromObject({years: 1}).as('days') //=> 365
|
|
730
|
-
* @example Duration.fromObject({years: 1}).as('months') //=> 12
|
|
731
|
-
* @example Duration.fromObject({hours: 60}).as('days') //=> 2.5
|
|
732
|
-
* @return {number}
|
|
733
|
-
*/
|
|
734
|
-
as(unit) {
|
|
735
|
-
return this.isValid ? this.shiftTo(unit).get(unit) : NaN;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* Reduce this Duration to its canonical representation in its current units.
|
|
740
|
-
* Assuming the overall value of the Duration is positive, this means:
|
|
741
|
-
* - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)
|
|
742
|
-
* - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise
|
|
743
|
-
* the overall value would be negative, see third example)
|
|
744
|
-
* - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)
|
|
745
|
-
*
|
|
746
|
-
* If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.
|
|
747
|
-
* @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }
|
|
748
|
-
* @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }
|
|
749
|
-
* @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }
|
|
750
|
-
* @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }
|
|
751
|
-
* @return {Duration}
|
|
752
|
-
*/
|
|
753
|
-
normalize() {
|
|
754
|
-
if (!this.isValid) return this;
|
|
755
|
-
const vals = this.toObject();
|
|
756
|
-
normalizeValues(this.matrix, vals);
|
|
757
|
-
return clone(this, { values: vals }, true);
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
/**
|
|
761
|
-
* Rescale units to its largest representation
|
|
762
|
-
* @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }
|
|
763
|
-
* @return {Duration}
|
|
764
|
-
*/
|
|
765
|
-
rescale() {
|
|
766
|
-
if (!this.isValid) return this;
|
|
767
|
-
const vals = removeZeroes(this.normalize().shiftToAll().toObject());
|
|
768
|
-
return clone(this, { values: vals }, true);
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
/**
|
|
772
|
-
* Convert this Duration into its representation in a different set of units.
|
|
773
|
-
* @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }
|
|
774
|
-
* @return {Duration}
|
|
775
|
-
*/
|
|
776
|
-
shiftTo(...units) {
|
|
777
|
-
if (!this.isValid) return this;
|
|
778
|
-
|
|
779
|
-
if (units.length === 0) {
|
|
780
|
-
return this;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
units = units.map((u) => Duration.normalizeUnit(u));
|
|
784
|
-
|
|
785
|
-
const built = {},
|
|
786
|
-
accumulated = {},
|
|
787
|
-
vals = this.toObject();
|
|
788
|
-
let lastUnit;
|
|
789
|
-
|
|
790
|
-
for (const k of orderedUnits) {
|
|
791
|
-
if (units.indexOf(k) >= 0) {
|
|
792
|
-
lastUnit = k;
|
|
793
|
-
|
|
794
|
-
let own = 0;
|
|
795
|
-
|
|
796
|
-
// anything we haven't boiled down yet should get boiled to this unit
|
|
797
|
-
for (const ak in accumulated) {
|
|
798
|
-
own += this.matrix[ak][k] * accumulated[ak];
|
|
799
|
-
accumulated[ak] = 0;
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
// plus anything that's already in this unit
|
|
803
|
-
if (isNumber(vals[k])) {
|
|
804
|
-
own += vals[k];
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
// only keep the integer part for now in the hopes of putting any decimal part
|
|
808
|
-
// into a smaller unit later
|
|
809
|
-
const i = Math.trunc(own);
|
|
810
|
-
built[k] = i;
|
|
811
|
-
accumulated[k] = (own * 1000 - i * 1000) / 1000;
|
|
812
|
-
|
|
813
|
-
// otherwise, keep it in the wings to boil it later
|
|
814
|
-
} else if (isNumber(vals[k])) {
|
|
815
|
-
accumulated[k] = vals[k];
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
// anything leftover becomes the decimal for the last unit
|
|
820
|
-
// lastUnit must be defined since units is not empty
|
|
821
|
-
for (const key in accumulated) {
|
|
822
|
-
if (accumulated[key] !== 0) {
|
|
823
|
-
built[lastUnit] +=
|
|
824
|
-
key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
normalizeValues(this.matrix, built);
|
|
829
|
-
return clone(this, { values: built }, true);
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
/**
|
|
833
|
-
* Shift this Duration to all available units.
|
|
834
|
-
* Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds")
|
|
835
|
-
* @return {Duration}
|
|
836
|
-
*/
|
|
837
|
-
shiftToAll() {
|
|
838
|
-
if (!this.isValid) return this;
|
|
839
|
-
return this.shiftTo(
|
|
840
|
-
"years",
|
|
841
|
-
"months",
|
|
842
|
-
"weeks",
|
|
843
|
-
"days",
|
|
844
|
-
"hours",
|
|
845
|
-
"minutes",
|
|
846
|
-
"seconds",
|
|
847
|
-
"milliseconds"
|
|
848
|
-
);
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
/**
|
|
852
|
-
* Return the negative of this Duration.
|
|
853
|
-
* @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }
|
|
854
|
-
* @return {Duration}
|
|
855
|
-
*/
|
|
856
|
-
negate() {
|
|
857
|
-
if (!this.isValid) return this;
|
|
858
|
-
const negated = {};
|
|
859
|
-
for (const k of Object.keys(this.values)) {
|
|
860
|
-
negated[k] = this.values[k] === 0 ? 0 : -this.values[k];
|
|
861
|
-
}
|
|
862
|
-
return clone(this, { values: negated }, true);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
/**
|
|
866
|
-
* Get the years.
|
|
867
|
-
* @type {number}
|
|
868
|
-
*/
|
|
869
|
-
get years() {
|
|
870
|
-
return this.isValid ? this.values.years || 0 : NaN;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
/**
|
|
874
|
-
* Get the quarters.
|
|
875
|
-
* @type {number}
|
|
876
|
-
*/
|
|
877
|
-
get quarters() {
|
|
878
|
-
return this.isValid ? this.values.quarters || 0 : NaN;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* Get the months.
|
|
883
|
-
* @type {number}
|
|
884
|
-
*/
|
|
885
|
-
get months() {
|
|
886
|
-
return this.isValid ? this.values.months || 0 : NaN;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
/**
|
|
890
|
-
* Get the weeks
|
|
891
|
-
* @type {number}
|
|
892
|
-
*/
|
|
893
|
-
get weeks() {
|
|
894
|
-
return this.isValid ? this.values.weeks || 0 : NaN;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* Get the days.
|
|
899
|
-
* @type {number}
|
|
900
|
-
*/
|
|
901
|
-
get days() {
|
|
902
|
-
return this.isValid ? this.values.days || 0 : NaN;
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
/**
|
|
906
|
-
* Get the hours.
|
|
907
|
-
* @type {number}
|
|
908
|
-
*/
|
|
909
|
-
get hours() {
|
|
910
|
-
return this.isValid ? this.values.hours || 0 : NaN;
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
/**
|
|
914
|
-
* Get the minutes.
|
|
915
|
-
* @type {number}
|
|
916
|
-
*/
|
|
917
|
-
get minutes() {
|
|
918
|
-
return this.isValid ? this.values.minutes || 0 : NaN;
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
/**
|
|
922
|
-
* Get the seconds.
|
|
923
|
-
* @return {number}
|
|
924
|
-
*/
|
|
925
|
-
get seconds() {
|
|
926
|
-
return this.isValid ? this.values.seconds || 0 : NaN;
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
* Get the milliseconds.
|
|
931
|
-
* @return {number}
|
|
932
|
-
*/
|
|
933
|
-
get milliseconds() {
|
|
934
|
-
return this.isValid ? this.values.milliseconds || 0 : NaN;
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
/**
|
|
938
|
-
* Returns whether the Duration is invalid. Invalid durations are returned by diff operations
|
|
939
|
-
* on invalid DateTimes or Intervals.
|
|
940
|
-
* @return {boolean}
|
|
941
|
-
*/
|
|
942
|
-
get isValid() {
|
|
943
|
-
return this.invalid === null;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
/**
|
|
947
|
-
* Returns an error code if this Duration became invalid, or null if the Duration is valid
|
|
948
|
-
* @return {string}
|
|
949
|
-
*/
|
|
950
|
-
get invalidReason() {
|
|
951
|
-
return this.invalid ? this.invalid.reason : null;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
/**
|
|
955
|
-
* Returns an explanation of why this Duration became invalid, or null if the Duration is valid
|
|
956
|
-
* @type {string}
|
|
957
|
-
*/
|
|
958
|
-
get invalidExplanation() {
|
|
959
|
-
return this.invalid ? this.invalid.explanation : null;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
/**
|
|
963
|
-
* Equality check
|
|
964
|
-
* Two Durations are equal iff they have the same units and the same values for each unit.
|
|
965
|
-
* @param {Duration} other
|
|
966
|
-
* @return {boolean}
|
|
967
|
-
*/
|
|
968
|
-
equals(other) {
|
|
969
|
-
if (!this.isValid || !other.isValid) {
|
|
970
|
-
return false;
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
if (!this.loc.equals(other.loc)) {
|
|
974
|
-
return false;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
function eq(v1, v2) {
|
|
978
|
-
// Consider 0 and undefined as equal
|
|
979
|
-
if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;
|
|
980
|
-
return v1 === v2;
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
for (const u of orderedUnits) {
|
|
984
|
-
if (!eq(this.values[u], other.values[u])) {
|
|
985
|
-
return false;
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
return true;
|
|
989
|
-
}
|
|
990
|
-
}
|