@kesha-antonov/react-native-chat 5.0.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +485 -178
- package/lib/Actions.d.ts.map +1 -1
- package/lib/Actions.js +121 -42
- package/lib/Actions.js.map +1 -1
- package/lib/Avatar.d.ts.map +1 -1
- package/lib/Avatar.js +171 -86
- package/lib/Avatar.js.map +1 -1
- package/lib/Bubble/BubbleBody.d.ts +15 -0
- package/lib/Bubble/BubbleBody.d.ts.map +1 -0
- package/lib/Bubble/BubbleBody.js +218 -0
- package/lib/Bubble/BubbleBody.js.map +1 -0
- package/lib/Bubble/BubbleContent.d.ts +23 -0
- package/lib/Bubble/BubbleContent.d.ts.map +1 -0
- package/lib/Bubble/BubbleContent.js +446 -0
- package/lib/Bubble/BubbleContent.js.map +1 -0
- package/lib/Bubble/BubbleMenu.d.ts +45 -0
- package/lib/Bubble/BubbleMenu.d.ts.map +1 -0
- package/lib/Bubble/BubbleMenu.js +289 -0
- package/lib/Bubble/BubbleMenu.js.map +1 -0
- package/lib/Bubble/BubbleMeta.d.ts +17 -0
- package/lib/Bubble/BubbleMeta.d.ts.map +1 -0
- package/lib/Bubble/BubbleMeta.js +453 -0
- package/lib/Bubble/BubbleMeta.js.map +1 -0
- package/lib/Bubble/LiftedBubble.d.ts +18 -0
- package/lib/Bubble/LiftedBubble.d.ts.map +1 -0
- package/lib/Bubble/LiftedBubble.js +109 -0
- package/lib/Bubble/LiftedBubble.js.map +1 -0
- package/lib/Bubble/PressableBubbleRow.d.ts +33 -0
- package/lib/Bubble/PressableBubbleRow.d.ts.map +1 -0
- package/lib/Bubble/PressableBubbleRow.js +172 -0
- package/lib/Bubble/PressableBubbleRow.js.map +1 -0
- package/lib/Bubble/index.d.ts +6 -13
- package/lib/Bubble/index.d.ts.map +1 -1
- package/lib/Bubble/index.js +379 -509
- package/lib/Bubble/index.js.map +1 -1
- package/lib/Bubble/layout.d.ts +47 -0
- package/lib/Bubble/layout.d.ts.map +1 -0
- package/lib/Bubble/layout.js +258 -0
- package/lib/Bubble/layout.js.map +1 -0
- package/lib/Bubble/styles.d.ts +108 -16
- package/lib/Bubble/styles.d.ts.map +1 -1
- package/lib/Bubble/styles.js +227 -107
- package/lib/Bubble/styles.js.map +1 -1
- package/lib/Bubble/types.d.ts +19 -3
- package/lib/Bubble/types.d.ts.map +1 -1
- package/lib/Bubble/types.js.map +1 -1
- package/lib/Chat/Chat.d.ts +5 -0
- package/lib/Chat/Chat.d.ts.map +1 -0
- package/lib/Chat/Chat.js +464 -0
- package/lib/Chat/Chat.js.map +1 -0
- package/lib/Chat/ChatBackground.d.ts +16 -0
- package/lib/Chat/ChatBackground.d.ts.map +1 -0
- package/lib/Chat/ChatBackground.js +43 -0
- package/lib/Chat/ChatBackground.js.map +1 -0
- package/lib/Chat/ChatKeyboardAvoidingView.js +19 -4
- package/lib/Chat/ChatKeyboardAvoidingView.js.map +1 -1
- package/lib/Chat/ChatMessageList.d.ts +27 -0
- package/lib/Chat/ChatMessageList.d.ts.map +1 -0
- package/lib/Chat/ChatMessageList.js +220 -0
- package/lib/Chat/ChatMessageList.js.map +1 -0
- package/lib/Chat/ChatProviders.d.ts +18 -0
- package/lib/Chat/ChatProviders.d.ts.map +1 -0
- package/lib/Chat/ChatProviders.js +87 -0
- package/lib/Chat/ChatProviders.js.map +1 -0
- package/lib/Chat/ChatSafeAreaProvider.d.ts +35 -0
- package/lib/Chat/ChatSafeAreaProvider.d.ts.map +1 -0
- package/lib/Chat/ChatSafeAreaProvider.js +123 -0
- package/lib/Chat/ChatSafeAreaProvider.js.map +1 -0
- package/lib/Chat/ChatSelectionBar.d.ts +20 -0
- package/lib/Chat/ChatSelectionBar.d.ts.map +1 -0
- package/lib/Chat/ChatSelectionBar.js +141 -0
- package/lib/Chat/ChatSelectionBar.js.map +1 -0
- package/lib/Chat/ChatWrapper.d.ts +11 -0
- package/lib/Chat/ChatWrapper.d.ts.map +1 -0
- package/lib/Chat/ChatWrapper.js +98 -0
- package/lib/Chat/ChatWrapper.js.map +1 -0
- package/lib/Chat/ComposerHost.d.ts +20 -0
- package/lib/Chat/ComposerHost.d.ts.map +1 -0
- package/lib/Chat/ComposerHost.js +118 -0
- package/lib/Chat/ComposerHost.js.map +1 -0
- package/lib/Chat/index.d.ts +1 -8
- package/lib/Chat/index.d.ts.map +1 -1
- package/lib/Chat/index.js +1 -337
- package/lib/Chat/index.js.map +1 -1
- package/lib/Chat/styles.d.ts +14 -2
- package/lib/Chat/styles.d.ts.map +1 -1
- package/lib/Chat/styles.js +19 -9
- package/lib/Chat/styles.js.map +1 -1
- package/lib/Chat/types.d.ts +145 -11
- package/lib/Chat/types.d.ts.map +1 -1
- package/lib/Chat/types.js.map +1 -1
- package/lib/Chat/useChatContextValue.d.ts +19 -0
- package/lib/Chat/useChatContextValue.d.ts.map +1 -0
- package/lib/Chat/useChatContextValue.js +158 -0
- package/lib/Chat/useChatContextValue.js.map +1 -0
- package/lib/Chat/useChatMedia.d.ts +22 -0
- package/lib/Chat/useChatMedia.d.ts.map +1 -0
- package/lib/Chat/useChatMedia.js +127 -0
- package/lib/Chat/useChatMedia.js.map +1 -0
- package/lib/Chat/useChatSelection.d.ts +15 -0
- package/lib/Chat/useChatSelection.d.ts.map +1 -0
- package/lib/Chat/useChatSelection.js +106 -0
- package/lib/Chat/useChatSelection.js.map +1 -0
- package/lib/Chat/useComposerHandlers.d.ts +34 -0
- package/lib/Chat/useComposerHandlers.d.ts.map +1 -0
- package/lib/Chat/useComposerHandlers.js +330 -0
- package/lib/Chat/useComposerHandlers.js.map +1 -0
- package/lib/Chat/useComposerState.d.ts +27 -0
- package/lib/Chat/useComposerState.d.ts.map +1 -0
- package/lib/Chat/useComposerState.js +272 -0
- package/lib/Chat/useComposerState.js.map +1 -0
- package/lib/Chat/useInitialLayout.d.ts +19 -0
- package/lib/Chat/useInitialLayout.d.ts.map +1 -0
- package/lib/Chat/useInitialLayout.js +70 -0
- package/lib/Chat/useInitialLayout.js.map +1 -0
- package/lib/Chat/useMessageActions.d.ts +37 -0
- package/lib/Chat/useMessageActions.d.ts.map +1 -0
- package/lib/Chat/useMessageActions.js +323 -0
- package/lib/Chat/useMessageActions.js.map +1 -0
- package/lib/Chat/useMessageNavigation.d.ts +21 -0
- package/lib/Chat/useMessageNavigation.d.ts.map +1 -0
- package/lib/Chat/useMessageNavigation.js +149 -0
- package/lib/Chat/useMessageNavigation.js.map +1 -0
- package/lib/Chat/useOptionalPeerHints.d.ts +6 -0
- package/lib/Chat/useOptionalPeerHints.d.ts.map +1 -0
- package/lib/Chat/useOptionalPeerHints.js +63 -0
- package/lib/Chat/useOptionalPeerHints.js.map +1 -0
- package/lib/Chat/useResolvedReactions.d.ts +31 -0
- package/lib/Chat/useResolvedReactions.d.ts.map +1 -0
- package/lib/Chat/useResolvedReactions.js +95 -0
- package/lib/Chat/useResolvedReactions.js.map +1 -0
- package/lib/ChatAvatar.d.ts.map +1 -1
- package/lib/ChatAvatar.js +229 -84
- package/lib/ChatAvatar.js.map +1 -1
- package/lib/ChatContext.js +20 -10
- package/lib/ChatContext.js.map +1 -1
- package/lib/ChatList/ChatListAvatar.d.ts +21 -0
- package/lib/ChatList/ChatListAvatar.d.ts.map +1 -0
- package/lib/ChatList/ChatListAvatar.js +178 -0
- package/lib/ChatList/ChatListAvatar.js.map +1 -0
- package/lib/ChatList/ChatListCell.d.ts +16 -0
- package/lib/ChatList/ChatListCell.d.ts.map +1 -0
- package/lib/ChatList/ChatListCell.js +506 -0
- package/lib/ChatList/ChatListCell.js.map +1 -0
- package/lib/ChatList/ChatListShimmer.d.ts +3 -0
- package/lib/ChatList/ChatListShimmer.d.ts.map +1 -0
- package/lib/ChatList/ChatListShimmer.js +235 -0
- package/lib/ChatList/ChatListShimmer.js.map +1 -0
- package/lib/ChatList/index.d.ts +16 -0
- package/lib/ChatList/index.d.ts.map +1 -0
- package/lib/ChatList/index.js +1301 -0
- package/lib/ChatList/index.js.map +1 -0
- package/lib/ChatList/types.d.ts +128 -0
- package/lib/ChatList/types.d.ts.map +1 -0
- package/lib/ChatList/types.js +2 -0
- package/lib/ChatList/types.js.map +1 -0
- package/lib/ChatList/useChatList.d.ts +30 -0
- package/lib/ChatList/useChatList.d.ts.map +1 -0
- package/lib/ChatList/useChatList.js +211 -0
- package/lib/ChatList/useChatList.js.map +1 -0
- package/lib/ChatList/utils.d.ts +28 -0
- package/lib/ChatList/utils.d.ts.map +1 -0
- package/lib/ChatList/utils.js +60 -0
- package/lib/ChatList/utils.js.map +1 -0
- package/lib/Color.js +19 -19
- package/lib/Color.js.map +1 -1
- package/lib/Composer.d.ts.map +1 -1
- package/lib/Composer.js +148 -70
- package/lib/Composer.js.map +1 -1
- package/lib/Constant.js +4 -4
- package/lib/Constant.js.map +1 -1
- package/lib/Day/index.d.ts.map +1 -1
- package/lib/Day/index.js +115 -28
- package/lib/Day/index.js.map +1 -1
- package/lib/Day/styles.d.ts +3 -3
- package/lib/Day/styles.d.ts.map +1 -1
- package/lib/Day/styles.js +20 -17
- package/lib/Day/styles.js.map +1 -1
- package/lib/Day/types.js.map +1 -1
- package/lib/Icons.d.ts +1 -1
- package/lib/Icons.d.ts.map +1 -1
- package/lib/Icons.js.map +1 -1
- package/lib/InputToolbar/FieldGroup.d.ts +28 -0
- package/lib/InputToolbar/FieldGroup.d.ts.map +1 -0
- package/lib/InputToolbar/FieldGroup.js +143 -0
- package/lib/InputToolbar/FieldGroup.js.map +1 -0
- package/lib/InputToolbar/TakePreviewBar.d.ts +17 -0
- package/lib/InputToolbar/TakePreviewBar.d.ts.map +1 -0
- package/lib/InputToolbar/TakePreviewBar.js +126 -0
- package/lib/InputToolbar/TakePreviewBar.js.map +1 -0
- package/lib/InputToolbar/animations.d.ts +105 -0
- package/lib/InputToolbar/animations.d.ts.map +1 -0
- package/lib/InputToolbar/animations.js +238 -0
- package/lib/InputToolbar/animations.js.map +1 -0
- package/lib/InputToolbar/fragments.d.ts +13 -0
- package/lib/InputToolbar/fragments.d.ts.map +1 -0
- package/lib/InputToolbar/fragments.js +207 -0
- package/lib/InputToolbar/fragments.js.map +1 -0
- package/lib/InputToolbar/index.d.ts +7 -0
- package/lib/InputToolbar/index.d.ts.map +1 -0
- package/lib/InputToolbar/index.js +444 -0
- package/lib/InputToolbar/index.js.map +1 -0
- package/lib/InputToolbar/recordingOptions.d.ts +14 -0
- package/lib/InputToolbar/recordingOptions.d.ts.map +1 -0
- package/lib/InputToolbar/recordingOptions.js +38 -0
- package/lib/InputToolbar/recordingOptions.js.map +1 -0
- package/lib/InputToolbar/styles.d.ts +118 -0
- package/lib/InputToolbar/styles.d.ts.map +1 -0
- package/lib/InputToolbar/styles.js +139 -0
- package/lib/InputToolbar/styles.js.map +1 -0
- package/lib/InputToolbar/types.d.ts +77 -0
- package/lib/InputToolbar/types.d.ts.map +1 -0
- package/lib/InputToolbar/types.js +2 -0
- package/lib/InputToolbar/types.js.map +1 -0
- package/lib/InputToolbar/useActionsFragment.d.ts +6 -0
- package/lib/InputToolbar/useActionsFragment.d.ts.map +1 -0
- package/lib/InputToolbar/useActionsFragment.js +139 -0
- package/lib/InputToolbar/useActionsFragment.js.map +1 -0
- package/lib/InputToolbar/useComposerEditing.d.ts +11 -0
- package/lib/InputToolbar/useComposerEditing.d.ts.map +1 -0
- package/lib/InputToolbar/useComposerEditing.js +116 -0
- package/lib/InputToolbar/useComposerEditing.js.map +1 -0
- package/lib/InputToolbar/useEmojiButton.d.ts +14 -0
- package/lib/InputToolbar/useEmojiButton.d.ts.map +1 -0
- package/lib/InputToolbar/useEmojiButton.js +120 -0
- package/lib/InputToolbar/useEmojiButton.js.map +1 -0
- package/lib/InputToolbar/useKeyboardInset.d.ts +9 -0
- package/lib/InputToolbar/useKeyboardInset.d.ts.map +1 -0
- package/lib/InputToolbar/useKeyboardInset.js +25 -0
- package/lib/InputToolbar/useKeyboardInset.js.map +1 -0
- package/lib/InputToolbar/useRecordMode.d.ts +19 -0
- package/lib/InputToolbar/useRecordMode.d.ts.map +1 -0
- package/lib/InputToolbar/useRecordMode.js +124 -0
- package/lib/InputToolbar/useRecordMode.js.map +1 -0
- package/lib/InputToolbar/useRecordTake.d.ts +46 -0
- package/lib/InputToolbar/useRecordTake.d.ts.map +1 -0
- package/lib/InputToolbar/useRecordTake.js +315 -0
- package/lib/InputToolbar/useRecordTake.js.map +1 -0
- package/lib/InputToolbar/useReturnAnimations.d.ts +18 -0
- package/lib/InputToolbar/useReturnAnimations.d.ts.map +1 -0
- package/lib/InputToolbar/useReturnAnimations.js +30 -0
- package/lib/InputToolbar/useReturnAnimations.js.map +1 -0
- package/lib/InputToolbar/useRightControl.d.ts +40 -0
- package/lib/InputToolbar/useRightControl.d.ts.map +1 -0
- package/lib/InputToolbar/useRightControl.js +129 -0
- package/lib/InputToolbar/useRightControl.js.map +1 -0
- package/lib/LoadEarlierMessages.d.ts +2 -0
- package/lib/LoadEarlierMessages.d.ts.map +1 -1
- package/lib/LoadEarlierMessages.js +153 -40
- package/lib/LoadEarlierMessages.js.map +1 -1
- package/lib/Message/SwipeToReply.d.ts +23 -0
- package/lib/Message/SwipeToReply.d.ts.map +1 -0
- package/lib/Message/SwipeToReply.js +337 -0
- package/lib/Message/SwipeToReply.js.map +1 -0
- package/lib/Message/index.d.ts.map +1 -1
- package/lib/Message/index.js +415 -176
- package/lib/Message/index.js.map +1 -1
- package/lib/Message/styles.d.ts +2 -2
- package/lib/Message/styles.js +14 -14
- package/lib/Message/styles.js.map +1 -1
- package/lib/Message/types.d.ts +5 -0
- package/lib/Message/types.d.ts.map +1 -1
- package/lib/Message/types.js.map +1 -1
- package/lib/MessageAudio.d.ts.map +1 -1
- package/lib/MessageAudio.js +647 -107
- package/lib/MessageAudio.js.map +1 -1
- package/lib/MessageFile.d.ts +11 -0
- package/lib/MessageFile.d.ts.map +1 -0
- package/lib/MessageFile.js +315 -0
- package/lib/MessageFile.js.map +1 -0
- package/lib/MessageImage.d.ts +2 -0
- package/lib/MessageImage.d.ts.map +1 -1
- package/lib/MessageImage.js +430 -161
- package/lib/MessageImage.js.map +1 -1
- package/lib/MessageLocation.d.ts.map +1 -1
- package/lib/MessageLocation.js +180 -68
- package/lib/MessageLocation.js.map +1 -1
- package/lib/MessageText.d.ts +8 -1
- package/lib/MessageText.d.ts.map +1 -1
- package/lib/MessageText.js +261 -69
- package/lib/MessageText.js.map +1 -1
- package/lib/MessageVideo/ExpoVideoPlayer.d.ts +6 -0
- package/lib/MessageVideo/ExpoVideoPlayer.d.ts.map +1 -0
- package/lib/MessageVideo/ExpoVideoPlayer.js +68 -0
- package/lib/MessageVideo/ExpoVideoPlayer.js.map +1 -0
- package/lib/MessageVideo/MirroredVideo.d.ts +17 -0
- package/lib/MessageVideo/MirroredVideo.d.ts.map +1 -0
- package/lib/MessageVideo/MirroredVideo.js +223 -0
- package/lib/MessageVideo/MirroredVideo.js.map +1 -0
- package/lib/MessageVideo/RoundNotePlayer.d.ts +4 -0
- package/lib/MessageVideo/RoundNotePlayer.d.ts.map +1 -0
- package/lib/MessageVideo/RoundNotePlayer.js +560 -0
- package/lib/MessageVideo/RoundNotePlayer.js.map +1 -0
- package/lib/MessageVideo/RoundTranscription.d.ts +27 -0
- package/lib/MessageVideo/RoundTranscription.d.ts.map +1 -0
- package/lib/MessageVideo/RoundTranscription.js +151 -0
- package/lib/MessageVideo/RoundTranscription.js.map +1 -0
- package/lib/MessageVideo/VideoTransferOverlay.d.ts +11 -0
- package/lib/MessageVideo/VideoTransferOverlay.d.ts.map +1 -0
- package/lib/MessageVideo/VideoTransferOverlay.js +88 -0
- package/lib/MessageVideo/VideoTransferOverlay.js.map +1 -0
- package/lib/MessageVideo/constants.d.ts +13 -0
- package/lib/MessageVideo/constants.d.ts.map +1 -0
- package/lib/MessageVideo/constants.js +15 -0
- package/lib/MessageVideo/constants.js.map +1 -0
- package/lib/{MessageVideo.d.ts → MessageVideo/index.d.ts} +2 -2
- package/lib/MessageVideo/index.d.ts.map +1 -0
- package/lib/MessageVideo/index.js +92 -0
- package/lib/MessageVideo/index.js.map +1 -0
- package/lib/MessageVideo/liftedMedia.d.ts +13 -0
- package/lib/MessageVideo/liftedMedia.d.ts.map +1 -0
- package/lib/MessageVideo/liftedMedia.js +106 -0
- package/lib/MessageVideo/liftedMedia.js.map +1 -0
- package/lib/MessageVideo/styles.d.ts +71 -0
- package/lib/MessageVideo/styles.d.ts.map +1 -0
- package/lib/MessageVideo/styles.js +78 -0
- package/lib/MessageVideo/styles.js.map +1 -0
- package/lib/MessageVideo/types.d.ts +27 -0
- package/lib/MessageVideo/types.d.ts.map +1 -0
- package/lib/MessageVideo/types.js +2 -0
- package/lib/MessageVideo/types.js.map +1 -0
- package/lib/MessageVideo/useNoteGrow.d.ts +16 -0
- package/lib/MessageVideo/useNoteGrow.d.ts.map +1 -0
- package/lib/MessageVideo/useNoteGrow.js +122 -0
- package/lib/MessageVideo/useNoteGrow.js.map +1 -0
- package/lib/MessageVideo/useNotePlayer.d.ts +14 -0
- package/lib/MessageVideo/useNotePlayer.d.ts.map +1 -0
- package/lib/MessageVideo/useNotePlayer.js +142 -0
- package/lib/MessageVideo/useNotePlayer.js.map +1 -0
- package/lib/MessageVideo/useRingSeek.d.ts +16 -0
- package/lib/MessageVideo/useRingSeek.d.ts.map +1 -0
- package/lib/MessageVideo/useRingSeek.js +157 -0
- package/lib/MessageVideo/useRingSeek.js.map +1 -0
- package/lib/MessageVideo/useRoundNotePlayback.d.ts +46 -0
- package/lib/MessageVideo/useRoundNotePlayback.d.ts.map +1 -0
- package/lib/MessageVideo/useRoundNotePlayback.js +508 -0
- package/lib/MessageVideo/useRoundNotePlayback.js.map +1 -0
- package/lib/MessageVideo/useSendFlightReveal.d.ts +9 -0
- package/lib/MessageVideo/useSendFlightReveal.d.ts.map +1 -0
- package/lib/MessageVideo/useSendFlightReveal.js +85 -0
- package/lib/MessageVideo/useSendFlightReveal.js.map +1 -0
- package/lib/MessageVideo/videoPlayers.d.ts +8 -0
- package/lib/MessageVideo/videoPlayers.d.ts.map +1 -0
- package/lib/MessageVideo/videoPlayers.js +33 -0
- package/lib/MessageVideo/videoPlayers.js.map +1 -0
- package/lib/MessagesContainer/components/DayAnimated/debug.js +38 -24
- package/lib/MessagesContainer/components/DayAnimated/debug.js.map +1 -1
- package/lib/MessagesContainer/components/DayAnimated/index.d.ts +1 -1
- package/lib/MessagesContainer/components/DayAnimated/index.d.ts.map +1 -1
- package/lib/MessagesContainer/components/DayAnimated/index.js +244 -112
- package/lib/MessagesContainer/components/DayAnimated/index.js.map +1 -1
- package/lib/MessagesContainer/components/DayAnimated/styles.d.ts +3 -3
- package/lib/MessagesContainer/components/DayAnimated/styles.js +8 -8
- package/lib/MessagesContainer/components/DayAnimated/styles.js.map +1 -1
- package/lib/MessagesContainer/components/DayAnimated/types.d.ts +4 -2
- package/lib/MessagesContainer/components/DayAnimated/types.d.ts.map +1 -1
- package/lib/MessagesContainer/components/DayAnimated/types.js.map +1 -1
- package/lib/MessagesContainer/components/DayAnimated/useScrollGatedOpacity.d.ts.map +1 -1
- package/lib/MessagesContainer/components/DayAnimated/useScrollGatedOpacity.js +34 -25
- package/lib/MessagesContainer/components/DayAnimated/useScrollGatedOpacity.js.map +1 -1
- package/lib/MessagesContainer/components/Item/index.d.ts +3 -4
- package/lib/MessagesContainer/components/Item/index.d.ts.map +1 -1
- package/lib/MessagesContainer/components/Item/index.js +289 -119
- package/lib/MessagesContainer/components/Item/index.js.map +1 -1
- package/lib/MessagesContainer/components/Item/types.d.ts +5 -0
- package/lib/MessagesContainer/components/Item/types.d.ts.map +1 -1
- package/lib/MessagesContainer/components/Item/types.js.map +1 -1
- package/lib/MessagesContainer/components/PageDownCounter.d.ts +14 -0
- package/lib/MessagesContainer/components/PageDownCounter.d.ts.map +1 -0
- package/lib/MessagesContainer/components/PageDownCounter.js +209 -0
- package/lib/MessagesContainer/components/PageDownCounter.js.map +1 -0
- package/lib/MessagesContainer/components/ScrollToBottomButton.d.ts +21 -0
- package/lib/MessagesContainer/components/ScrollToBottomButton.d.ts.map +1 -0
- package/lib/MessagesContainer/components/ScrollToBottomButton.js +195 -0
- package/lib/MessagesContainer/components/ScrollToBottomButton.js.map +1 -0
- package/lib/MessagesContainer/components/dayLayout.d.ts +2 -2
- package/lib/MessagesContainer/components/dayLayout.d.ts.map +1 -1
- package/lib/MessagesContainer/components/dayLayout.js +18 -13
- package/lib/MessagesContainer/components/dayLayout.js.map +1 -1
- package/lib/MessagesContainer/index.d.ts.map +1 -1
- package/lib/MessagesContainer/index.js +361 -420
- package/lib/MessagesContainer/index.js.map +1 -1
- package/lib/MessagesContainer/listState.d.ts +18 -0
- package/lib/MessagesContainer/listState.d.ts.map +1 -0
- package/lib/MessagesContainer/listState.js +25 -0
- package/lib/MessagesContainer/listState.js.map +1 -0
- package/lib/MessagesContainer/listTransitions.d.ts +10 -0
- package/lib/MessagesContainer/listTransitions.d.ts.map +1 -0
- package/lib/MessagesContainer/listTransitions.js +12 -0
- package/lib/MessagesContainer/listTransitions.js.map +1 -0
- package/lib/MessagesContainer/pageDownReturn.d.ts +11 -0
- package/lib/MessagesContainer/pageDownReturn.d.ts.map +1 -0
- package/lib/MessagesContainer/pageDownReturn.js +9 -0
- package/lib/MessagesContainer/pageDownReturn.js.map +1 -0
- package/lib/MessagesContainer/rowConfig.d.ts +39 -0
- package/lib/MessagesContainer/rowConfig.d.ts.map +1 -0
- package/lib/MessagesContainer/rowConfig.js +161 -0
- package/lib/MessagesContainer/rowConfig.js.map +1 -0
- package/lib/MessagesContainer/rowStore.d.ts +37 -0
- package/lib/MessagesContainer/rowStore.d.ts.map +1 -0
- package/lib/MessagesContainer/rowStore.js +140 -0
- package/lib/MessagesContainer/rowStore.js.map +1 -0
- package/lib/MessagesContainer/styles.d.ts +37 -31
- package/lib/MessagesContainer/styles.d.ts.map +1 -1
- package/lib/MessagesContainer/styles.js +75 -54
- package/lib/MessagesContainer/styles.js.map +1 -1
- package/lib/MessagesContainer/types.d.ts +33 -30
- package/lib/MessagesContainer/types.d.ts.map +1 -1
- package/lib/MessagesContainer/types.js +1 -9
- package/lib/MessagesContainer/types.js.map +1 -1
- package/lib/MessagesContainer/useCellLayouts.d.ts +17 -0
- package/lib/MessagesContainer/useCellLayouts.d.ts.map +1 -0
- package/lib/MessagesContainer/useCellLayouts.js +133 -0
- package/lib/MessagesContainer/useCellLayouts.js.map +1 -0
- package/lib/MessagesContainer/useDaysPositions.d.ts +18 -0
- package/lib/MessagesContainer/useDaysPositions.d.ts.map +1 -0
- package/lib/MessagesContainer/useDaysPositions.js +109 -0
- package/lib/MessagesContainer/useDaysPositions.js.map +1 -0
- package/lib/MessagesContainer/useListChrome.d.ts +14 -0
- package/lib/MessagesContainer/useListChrome.d.ts.map +1 -0
- package/lib/MessagesContainer/useListChrome.js +176 -0
- package/lib/MessagesContainer/useListChrome.js.map +1 -0
- package/lib/MessagesContainer/useListMetrics.d.ts +32 -0
- package/lib/MessagesContainer/useListMetrics.d.ts.map +1 -0
- package/lib/MessagesContainer/useListMetrics.js +176 -0
- package/lib/MessagesContainer/useListMetrics.js.map +1 -0
- package/lib/MessagesContainer/useMessageRows.d.ts +46 -0
- package/lib/MessagesContainer/useMessageRows.d.ts.map +1 -0
- package/lib/MessagesContainer/useMessageRows.js +228 -0
- package/lib/MessagesContainer/useMessageRows.js.map +1 -0
- package/lib/MessagesContainer/usePageDownUnread.d.ts +27 -0
- package/lib/MessagesContainer/usePageDownUnread.d.ts.map +1 -0
- package/lib/MessagesContainer/usePageDownUnread.js +152 -0
- package/lib/MessagesContainer/usePageDownUnread.js.map +1 -0
- package/lib/MessagesContainer/useScrollActivity.d.ts +13 -0
- package/lib/MessagesContainer/useScrollActivity.d.ts.map +1 -0
- package/lib/MessagesContainer/useScrollActivity.js +84 -0
- package/lib/MessagesContainer/useScrollActivity.js.map +1 -0
- package/lib/MessagesContainer/useScrollToBottom.d.ts +26 -0
- package/lib/MessagesContainer/useScrollToBottom.d.ts.map +1 -0
- package/lib/MessagesContainer/useScrollToBottom.js +164 -0
- package/lib/MessagesContainer/useScrollToBottom.js.map +1 -0
- package/lib/MessagesContainer/useTapToClosePanels.d.ts +7 -0
- package/lib/MessagesContainer/useTapToClosePanels.d.ts.map +1 -0
- package/lib/MessagesContainer/useTapToClosePanels.js +55 -0
- package/lib/MessagesContainer/useTapToClosePanels.js.map +1 -0
- package/lib/MessagesContainer/viewability.d.ts +9 -0
- package/lib/MessagesContainer/viewability.d.ts.map +1 -0
- package/lib/MessagesContainer/viewability.js +110 -0
- package/lib/MessagesContainer/viewability.js.map +1 -0
- package/lib/Models.d.ts +188 -3
- package/lib/Models.d.ts.map +1 -1
- package/lib/Models.js.map +1 -1
- package/lib/QuickReplies.js +234 -101
- package/lib/QuickReplies.js.map +1 -1
- package/lib/Reactions/MessageReactions.d.ts +5 -0
- package/lib/Reactions/MessageReactions.d.ts.map +1 -1
- package/lib/Reactions/MessageReactions.js +359 -80
- package/lib/Reactions/MessageReactions.js.map +1 -1
- package/lib/Reactions/ReactionPicker.d.ts +5 -3
- package/lib/Reactions/ReactionPicker.d.ts.map +1 -1
- package/lib/Reactions/ReactionPicker.js +68 -82
- package/lib/Reactions/ReactionPicker.js.map +1 -1
- package/lib/Reactions/index.js +1 -0
- package/lib/Reactions/index.js.map +1 -1
- package/lib/Reactions/types.d.ts +49 -5
- package/lib/Reactions/types.d.ts.map +1 -1
- package/lib/Reactions/types.js.map +1 -1
- package/lib/Reply/index.js.map +1 -1
- package/lib/Reply/types.d.ts +19 -3
- package/lib/Reply/types.d.ts.map +1 -1
- package/lib/Reply/types.js.map +1 -1
- package/lib/Send.d.ts +2 -2
- package/lib/Send.d.ts.map +1 -1
- package/lib/Send.js +218 -47
- package/lib/Send.js.map +1 -1
- package/lib/SystemMessage.d.ts.map +1 -1
- package/lib/SystemMessage.js +106 -37
- package/lib/SystemMessage.js.map +1 -1
- package/lib/Theme.d.ts +320 -23
- package/lib/Theme.d.ts.map +1 -1
- package/lib/Theme.js +548 -119
- package/lib/Theme.js.map +1 -1
- package/lib/Time.d.ts +7 -0
- package/lib/Time.d.ts.map +1 -1
- package/lib/Time.js +122 -30
- package/lib/Time.js.map +1 -1
- package/lib/TypingIndicator/index.d.ts +9 -1
- package/lib/TypingIndicator/index.d.ts.map +1 -1
- package/lib/TypingIndicator/index.js +318 -94
- package/lib/TypingIndicator/index.js.map +1 -1
- package/lib/TypingIndicator/styles.d.ts +6 -2
- package/lib/TypingIndicator/styles.d.ts.map +1 -1
- package/lib/TypingIndicator/styles.js +22 -18
- package/lib/TypingIndicator/styles.js.map +1 -1
- package/lib/TypingIndicator/types.js.map +1 -1
- package/lib/attachments/AttachmentButton.d.ts +18 -0
- package/lib/attachments/AttachmentButton.d.ts.map +1 -0
- package/lib/attachments/AttachmentButton.js +110 -0
- package/lib/attachments/AttachmentButton.js.map +1 -0
- package/lib/attachments/AttachmentMenu/CaptionBar.d.ts +15 -0
- package/lib/attachments/AttachmentMenu/CaptionBar.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/CaptionBar.js +165 -0
- package/lib/attachments/AttachmentMenu/CaptionBar.js.map +1 -0
- package/lib/attachments/AttachmentMenu/GalleryCell.d.ts +14 -0
- package/lib/attachments/AttachmentMenu/GalleryCell.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/GalleryCell.js +267 -0
- package/lib/attachments/AttachmentMenu/GalleryCell.js.map +1 -0
- package/lib/attachments/AttachmentMenu/GalleryGrid.d.ts +18 -0
- package/lib/attachments/AttachmentMenu/GalleryGrid.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/GalleryGrid.js +184 -0
- package/lib/attachments/AttachmentMenu/GalleryGrid.js.map +1 -0
- package/lib/attachments/AttachmentMenu/TabBar.d.ts +14 -0
- package/lib/attachments/AttachmentMenu/TabBar.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/TabBar.js +127 -0
- package/lib/attachments/AttachmentMenu/TabBar.js.map +1 -0
- package/lib/attachments/AttachmentMenu/TabButton.d.ts +15 -0
- package/lib/attachments/AttachmentMenu/TabButton.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/TabButton.js +219 -0
- package/lib/attachments/AttachmentMenu/TabButton.js.map +1 -0
- package/lib/attachments/AttachmentMenu/TabPanel.d.ts +17 -0
- package/lib/attachments/AttachmentMenu/TabPanel.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/TabPanel.js +170 -0
- package/lib/attachments/AttachmentMenu/TabPanel.js.map +1 -0
- package/lib/attachments/AttachmentMenu/constants.d.ts +54 -0
- package/lib/attachments/AttachmentMenu/constants.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/constants.js +79 -0
- package/lib/attachments/AttachmentMenu/constants.js.map +1 -0
- package/lib/attachments/AttachmentMenu/index.d.ts +16 -0
- package/lib/attachments/AttachmentMenu/index.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/index.js +498 -0
- package/lib/attachments/AttachmentMenu/index.js.map +1 -0
- package/lib/attachments/AttachmentMenu/styles.d.ts +259 -0
- package/lib/attachments/AttachmentMenu/styles.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/styles.js +262 -0
- package/lib/attachments/AttachmentMenu/styles.js.map +1 -0
- package/lib/attachments/AttachmentMenu/useSheetPresence.d.ts +14 -0
- package/lib/attachments/AttachmentMenu/useSheetPresence.d.ts.map +1 -0
- package/lib/attachments/AttachmentMenu/useSheetPresence.js +74 -0
- package/lib/attachments/AttachmentMenu/useSheetPresence.js.map +1 -0
- package/lib/attachments/buildMessages.d.ts +36 -0
- package/lib/attachments/buildMessages.d.ts.map +1 -0
- package/lib/attachments/buildMessages.js +192 -0
- package/lib/attachments/buildMessages.js.map +1 -0
- package/lib/attachments/gallery.d.ts +28 -0
- package/lib/attachments/gallery.d.ts.map +1 -0
- package/lib/attachments/gallery.js +245 -0
- package/lib/attachments/gallery.js.map +1 -0
- package/lib/attachments/types.d.ts +69 -0
- package/lib/attachments/types.d.ts.map +1 -0
- package/lib/attachments/types.js +2 -0
- package/lib/attachments/types.js.map +1 -0
- package/lib/colorUtils.d.ts +24 -0
- package/lib/colorUtils.d.ts.map +1 -0
- package/lib/colorUtils.js +71 -0
- package/lib/colorUtils.js.map +1 -0
- package/lib/components/AttachmentSheet.d.ts +1 -1
- package/lib/components/AttachmentSheet.d.ts.map +1 -1
- package/lib/components/AttachmentSheet.js +515 -155
- package/lib/components/AttachmentSheet.js.map +1 -1
- package/lib/components/BasicMarkdown.d.ts +7 -1
- package/lib/components/BasicMarkdown.d.ts.map +1 -1
- package/lib/components/BasicMarkdown.js +234 -184
- package/lib/components/BasicMarkdown.js.map +1 -1
- package/lib/components/BubbleBackground.d.ts +55 -0
- package/lib/components/BubbleBackground.d.ts.map +1 -0
- package/lib/components/BubbleBackground.js +513 -0
- package/lib/components/BubbleBackground.js.map +1 -0
- package/lib/components/ChatEmpty.d.ts +18 -0
- package/lib/components/ChatEmpty.d.ts.map +1 -0
- package/lib/components/ChatEmpty.js +125 -0
- package/lib/components/ChatEmpty.js.map +1 -0
- package/lib/components/ChatLoadingOverlay.d.ts +10 -0
- package/lib/components/ChatLoadingOverlay.d.ts.map +1 -0
- package/lib/components/ChatLoadingOverlay.js +89 -0
- package/lib/components/ChatLoadingOverlay.js.map +1 -0
- package/lib/components/ChatOverlay.d.ts +9 -0
- package/lib/components/ChatOverlay.d.ts.map +1 -0
- package/lib/components/ChatOverlay.js +60 -0
- package/lib/components/ChatOverlay.js.map +1 -0
- package/lib/components/ChatWallpaper.d.ts +32 -0
- package/lib/components/ChatWallpaper.d.ts.map +1 -0
- package/lib/components/ChatWallpaper.js +277 -0
- package/lib/components/ChatWallpaper.js.map +1 -0
- package/lib/components/ContextMenu/MenuCard.d.ts +21 -0
- package/lib/components/ContextMenu/MenuCard.d.ts.map +1 -0
- package/lib/components/ContextMenu/MenuCard.js +265 -0
- package/lib/components/ContextMenu/MenuCard.js.map +1 -0
- package/lib/components/ContextMenu/ReactionButton.d.ts +15 -0
- package/lib/components/ContextMenu/ReactionButton.d.ts.map +1 -0
- package/lib/components/ContextMenu/ReactionButton.js +116 -0
- package/lib/components/ContextMenu/ReactionButton.js.map +1 -0
- package/lib/components/ContextMenu/ReactionFlight.d.ts +14 -0
- package/lib/components/ContextMenu/ReactionFlight.d.ts.map +1 -0
- package/lib/components/ContextMenu/ReactionFlight.js +111 -0
- package/lib/components/ContextMenu/ReactionFlight.js.map +1 -0
- package/lib/components/ContextMenu/ReactionsBar.d.ts +35 -0
- package/lib/components/ContextMenu/ReactionsBar.d.ts.map +1 -0
- package/lib/components/ContextMenu/ReactionsBar.js +354 -0
- package/lib/components/ContextMenu/ReactionsBar.js.map +1 -0
- package/lib/components/ContextMenu/constants.d.ts +68 -0
- package/lib/components/ContextMenu/constants.d.ts.map +1 -0
- package/lib/components/ContextMenu/constants.js +105 -0
- package/lib/components/ContextMenu/constants.js.map +1 -0
- package/lib/components/ContextMenu/index.d.ts +12 -0
- package/lib/components/ContextMenu/index.d.ts.map +1 -0
- package/lib/components/ContextMenu/index.js +476 -0
- package/lib/components/ContextMenu/index.js.map +1 -0
- package/lib/components/ContextMenu/placement.d.ts +50 -0
- package/lib/components/ContextMenu/placement.d.ts.map +1 -0
- package/lib/components/ContextMenu/placement.js +117 -0
- package/lib/components/ContextMenu/placement.js.map +1 -0
- package/lib/components/ContextMenu/styles.d.ts +199 -0
- package/lib/components/ContextMenu/styles.d.ts.map +1 -0
- package/lib/components/ContextMenu/styles.js +169 -0
- package/lib/components/ContextMenu/styles.js.map +1 -0
- package/lib/components/ContextMenu/types.d.ts +62 -0
- package/lib/components/ContextMenu/types.d.ts.map +1 -0
- package/lib/components/ContextMenu/types.js +2 -0
- package/lib/components/ContextMenu/types.js.map +1 -0
- package/lib/components/ContextMenu/useExpandPanel.d.ts +11 -0
- package/lib/components/ContextMenu/useExpandPanel.d.ts.map +1 -0
- package/lib/components/ContextMenu/useExpandPanel.js +81 -0
- package/lib/components/ContextMenu/useExpandPanel.js.map +1 -0
- package/lib/components/ContextMenu/useMenuPresence.d.ts +17 -0
- package/lib/components/ContextMenu/useMenuPresence.d.ts.map +1 -0
- package/lib/components/ContextMenu/useMenuPresence.js +125 -0
- package/lib/components/ContextMenu/useMenuPresence.js.map +1 -0
- package/lib/components/FloatingRoundNote.d.ts +13 -0
- package/lib/components/FloatingRoundNote.d.ts.map +1 -0
- package/lib/components/FloatingRoundNote.js +541 -0
- package/lib/components/FloatingRoundNote.js.map +1 -0
- package/lib/components/GlassSurface.d.ts +16 -0
- package/lib/components/GlassSurface.d.ts.map +1 -0
- package/lib/components/GlassSurface.js +114 -0
- package/lib/components/GlassSurface.js.map +1 -0
- package/lib/components/Icon.js +57 -8
- package/lib/components/Icon.js.map +1 -1
- package/lib/components/LinkPreviewCard.d.ts +36 -0
- package/lib/components/LinkPreviewCard.d.ts.map +1 -0
- package/lib/components/LinkPreviewCard.js +416 -0
- package/lib/components/LinkPreviewCard.js.map +1 -0
- package/lib/components/LucideIcon.d.ts.map +1 -1
- package/lib/components/LucideIcon.js +103 -106
- package/lib/components/LucideIcon.js.map +1 -1
- package/lib/components/MarkdownMessageText.d.ts +17 -2
- package/lib/components/MarkdownMessageText.d.ts.map +1 -1
- package/lib/components/MarkdownMessageText.js +270 -22
- package/lib/components/MarkdownMessageText.js.map +1 -1
- package/lib/components/MediaCard.d.ts.map +1 -1
- package/lib/components/MediaCard.js +223 -85
- package/lib/components/MediaCard.js.map +1 -1
- package/lib/components/MediaControls.js +1094 -450
- package/lib/components/MediaControls.js.map +1 -1
- package/lib/components/MediaLoader.d.ts +21 -0
- package/lib/components/MediaLoader.d.ts.map +1 -0
- package/lib/components/MediaLoader.js +61 -0
- package/lib/components/MediaLoader.js.map +1 -0
- package/lib/components/MessageReply.d.ts +2 -2
- package/lib/components/MessageReply.d.ts.map +1 -1
- package/lib/components/MessageReply.js +266 -83
- package/lib/components/MessageReply.js.map +1 -1
- package/lib/components/MessageStatus.d.ts +23 -0
- package/lib/components/MessageStatus.d.ts.map +1 -0
- package/lib/components/MessageStatus.js +499 -0
- package/lib/components/MessageStatus.js.map +1 -0
- package/lib/components/NoteIndicators.d.ts +25 -0
- package/lib/components/NoteIndicators.d.ts.map +1 -0
- package/lib/components/NoteIndicators.js +206 -0
- package/lib/components/NoteIndicators.js.map +1 -0
- package/lib/components/NowPlayingBar.d.ts +15 -0
- package/lib/components/NowPlayingBar.d.ts.map +1 -0
- package/lib/components/NowPlayingBar.js +261 -0
- package/lib/components/NowPlayingBar.js.map +1 -0
- package/lib/components/PlayPauseIcon.d.ts +13 -0
- package/lib/components/PlayPauseIcon.d.ts.map +1 -0
- package/lib/components/PlayPauseIcon.js +187 -0
- package/lib/components/PlayPauseIcon.js.map +1 -0
- package/lib/components/PlaybackSpeedPill.d.ts +11 -0
- package/lib/components/PlaybackSpeedPill.d.ts.map +1 -0
- package/lib/components/PlaybackSpeedPill.js +350 -0
- package/lib/components/PlaybackSpeedPill.js.map +1 -0
- package/lib/components/RadialProgress.d.ts +70 -0
- package/lib/components/RadialProgress.d.ts.map +1 -0
- package/lib/components/RadialProgress.js +864 -0
- package/lib/components/RadialProgress.js.map +1 -0
- package/lib/components/RecordButton/LockPill.d.ts +27 -0
- package/lib/components/RecordButton/LockPill.d.ts.map +1 -0
- package/lib/components/RecordButton/LockPill.js +182 -0
- package/lib/components/RecordButton/LockPill.js.map +1 -0
- package/lib/components/RecordButton/ModeButton.d.ts +18 -0
- package/lib/components/RecordButton/ModeButton.d.ts.map +1 -0
- package/lib/components/RecordButton/ModeButton.js +154 -0
- package/lib/components/RecordButton/ModeButton.js.map +1 -0
- package/lib/components/RecordButton/ResumeButton.d.ts +20 -0
- package/lib/components/RecordButton/ResumeButton.d.ts.map +1 -0
- package/lib/components/RecordButton/ResumeButton.js +63 -0
- package/lib/components/RecordButton/ResumeButton.js.map +1 -0
- package/lib/components/RecordButton/Tooltips.d.ts +20 -0
- package/lib/components/RecordButton/Tooltips.d.ts.map +1 -0
- package/lib/components/RecordButton/Tooltips.js +191 -0
- package/lib/components/RecordButton/Tooltips.js.map +1 -0
- package/lib/components/RecordButton/ViewOnceButton.d.ts +16 -0
- package/lib/components/RecordButton/ViewOnceButton.d.ts.map +1 -0
- package/lib/components/RecordButton/ViewOnceButton.js +96 -0
- package/lib/components/RecordButton/ViewOnceButton.js.map +1 -0
- package/lib/components/RecordButton/constants.d.ts +52 -0
- package/lib/components/RecordButton/constants.d.ts.map +1 -0
- package/lib/components/RecordButton/constants.js +58 -0
- package/lib/components/RecordButton/constants.js.map +1 -0
- package/lib/components/RecordButton/index.d.ts +14 -0
- package/lib/components/RecordButton/index.d.ts.map +1 -0
- package/lib/components/RecordButton/index.js +382 -0
- package/lib/components/RecordButton/index.js.map +1 -0
- package/lib/components/RecordButton/styles.d.ts +155 -0
- package/lib/components/RecordButton/styles.d.ts.map +1 -0
- package/lib/components/RecordButton/styles.js +161 -0
- package/lib/components/RecordButton/styles.js.map +1 -0
- package/lib/components/RecordButton/types.d.ts +63 -0
- package/lib/components/RecordButton/types.d.ts.map +1 -0
- package/lib/components/RecordButton/types.js +2 -0
- package/lib/components/RecordButton/types.js.map +1 -0
- package/lib/components/RecordButton/useRecordGesture.d.ts +28 -0
- package/lib/components/RecordButton/useRecordGesture.d.ts.map +1 -0
- package/lib/components/RecordButton/useRecordGesture.js +263 -0
- package/lib/components/RecordButton/useRecordGesture.js.map +1 -0
- package/lib/components/RecordButton/useRecordHints.d.ts +27 -0
- package/lib/components/RecordButton/useRecordHints.d.ts.map +1 -0
- package/lib/components/RecordButton/useRecordHints.js +210 -0
- package/lib/components/RecordButton/useRecordHints.js.map +1 -0
- package/lib/components/RecordButton/useRecordSlideDistance.d.ts +3 -0
- package/lib/components/RecordButton/useRecordSlideDistance.d.ts.map +1 -0
- package/lib/components/RecordButton/useRecordSlideDistance.js +15 -0
- package/lib/components/RecordButton/useRecordSlideDistance.js.map +1 -0
- package/lib/components/RecordButton/useRecordTake.d.ts +41 -0
- package/lib/components/RecordButton/useRecordTake.d.ts.map +1 -0
- package/lib/components/RecordButton/useRecordTake.js +349 -0
- package/lib/components/RecordButton/useRecordTake.js.map +1 -0
- package/lib/components/RecordButton/useSendFlight.d.ts +25 -0
- package/lib/components/RecordButton/useSendFlight.d.ts.map +1 -0
- package/lib/components/RecordButton/useSendFlight.js +162 -0
- package/lib/components/RecordButton/useSendFlight.js.map +1 -0
- package/lib/components/RecordCircle.d.ts +92 -0
- package/lib/components/RecordCircle.d.ts.map +1 -0
- package/lib/components/RecordCircle.js +629 -0
- package/lib/components/RecordCircle.js.map +1 -0
- package/lib/components/RecordingBar.d.ts +24 -0
- package/lib/components/RecordingBar.d.ts.map +1 -0
- package/lib/components/RecordingBar.js +766 -0
- package/lib/components/RecordingBar.js.map +1 -0
- package/lib/components/ReplyPreview.js +318 -135
- package/lib/components/ReplyPreview.js.map +1 -1
- package/lib/components/SelectionBar.d.ts +17 -0
- package/lib/components/SelectionBar.d.ts.map +1 -0
- package/lib/components/SelectionBar.js +214 -0
- package/lib/components/SelectionBar.js.map +1 -0
- package/lib/components/SelectionCheckbox.d.ts +12 -0
- package/lib/components/SelectionCheckbox.d.ts.map +1 -0
- package/lib/components/SelectionCheckbox.js +104 -0
- package/lib/components/SelectionCheckbox.js.map +1 -0
- package/lib/components/SendIcon.js +60 -26
- package/lib/components/SendIcon.js.map +1 -1
- package/lib/components/ServiceSpinner.d.ts +17 -0
- package/lib/components/ServiceSpinner.d.ts.map +1 -0
- package/lib/components/ServiceSpinner.js +77 -0
- package/lib/components/ServiceSpinner.js.map +1 -0
- package/lib/components/Spinner.d.ts +18 -0
- package/lib/components/Spinner.d.ts.map +1 -0
- package/lib/components/Spinner.js +169 -0
- package/lib/components/Spinner.js.map +1 -0
- package/lib/components/StreamingCursor.js +54 -9
- package/lib/components/StreamingCursor.js.map +1 -1
- package/lib/components/Ticks.d.ts +6 -5
- package/lib/components/Ticks.d.ts.map +1 -1
- package/lib/components/Ticks.js +272 -82
- package/lib/components/Ticks.js.map +1 -1
- package/lib/components/TouchableOpacity.d.ts.map +1 -1
- package/lib/components/TouchableOpacity.js +153 -51
- package/lib/components/TouchableOpacity.js.map +1 -1
- package/lib/components/TranscribeButton.d.ts +45 -0
- package/lib/components/TranscribeButton.d.ts.map +1 -0
- package/lib/components/TranscribeButton.js +549 -0
- package/lib/components/TranscribeButton.js.map +1 -0
- package/lib/components/TypingStatus.d.ts +29 -0
- package/lib/components/TypingStatus.d.ts.map +1 -0
- package/lib/components/TypingStatus.js +446 -0
- package/lib/components/TypingStatus.js.map +1 -0
- package/lib/components/UnreadSeparator.d.ts +8 -0
- package/lib/components/UnreadSeparator.d.ts.map +1 -0
- package/lib/components/UnreadSeparator.js +101 -0
- package/lib/components/UnreadSeparator.js.map +1 -0
- package/lib/components/VideoNoteCapture/ProgressRing.d.ts +16 -0
- package/lib/components/VideoNoteCapture/ProgressRing.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/ProgressRing.js +75 -0
- package/lib/components/VideoNoteCapture/ProgressRing.js.map +1 -0
- package/lib/components/VideoNoteCapture/VideoNoteCaptureView.d.ts +31 -0
- package/lib/components/VideoNoteCapture/VideoNoteCaptureView.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/VideoNoteCaptureView.js +500 -0
- package/lib/components/VideoNoteCapture/VideoNoteCaptureView.js.map +1 -0
- package/lib/components/VideoNoteCapture/VideoNotePreviewView.d.ts +12 -0
- package/lib/components/VideoNoteCapture/VideoNotePreviewView.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/VideoNotePreviewView.js +105 -0
- package/lib/components/VideoNoteCapture/VideoNotePreviewView.js.map +1 -0
- package/lib/components/VideoNoteCapture/VideoNoteStage.d.ts +12 -0
- package/lib/components/VideoNoteCapture/VideoNoteStage.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/VideoNoteStage.js +95 -0
- package/lib/components/VideoNoteCapture/VideoNoteStage.js.map +1 -0
- package/lib/components/VideoNoteCapture/constants.d.ts +50 -0
- package/lib/components/VideoNoteCapture/constants.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/constants.js +53 -0
- package/lib/components/VideoNoteCapture/constants.js.map +1 -0
- package/lib/components/VideoNoteCapture/index.d.ts +3 -0
- package/lib/components/VideoNoteCapture/index.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/index.js +2 -0
- package/lib/components/VideoNoteCapture/index.js.map +1 -0
- package/lib/components/VideoNoteCapture/optional.d.ts +6 -0
- package/lib/components/VideoNoteCapture/optional.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/optional.js +15 -0
- package/lib/components/VideoNoteCapture/optional.js.map +1 -0
- package/lib/components/VideoNoteCapture/sessionState.d.ts +10 -0
- package/lib/components/VideoNoteCapture/sessionState.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/sessionState.js +19 -0
- package/lib/components/VideoNoteCapture/sessionState.js.map +1 -0
- package/lib/components/VideoNoteCapture/styles.d.ts +84 -0
- package/lib/components/VideoNoteCapture/styles.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/styles.js +86 -0
- package/lib/components/VideoNoteCapture/styles.js.map +1 -0
- package/lib/components/VideoNoteCapture/types.d.ts +54 -0
- package/lib/components/VideoNoteCapture/types.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/types.js +2 -0
- package/lib/components/VideoNoteCapture/types.js.map +1 -0
- package/lib/components/VideoNoteCapture/useRoundAnimation.d.ts +47 -0
- package/lib/components/VideoNoteCapture/useRoundAnimation.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/useRoundAnimation.js +216 -0
- package/lib/components/VideoNoteCapture/useRoundAnimation.js.map +1 -0
- package/lib/components/VideoNoteCapture/useRoundLayout.d.ts +14 -0
- package/lib/components/VideoNoteCapture/useRoundLayout.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/useRoundLayout.js +61 -0
- package/lib/components/VideoNoteCapture/useRoundLayout.js.map +1 -0
- package/lib/components/VideoNoteCapture/useVideoNoteSession.d.ts +25 -0
- package/lib/components/VideoNoteCapture/useVideoNoteSession.d.ts.map +1 -0
- package/lib/components/VideoNoteCapture/useVideoNoteSession.js +611 -0
- package/lib/components/VideoNoteCapture/useVideoNoteSession.js.map +1 -0
- package/lib/components/VideoNoteOverlay.d.ts +42 -11
- package/lib/components/VideoNoteOverlay.d.ts.map +1 -1
- package/lib/components/VideoNoteOverlay.js +722 -135
- package/lib/components/VideoNoteOverlay.js.map +1 -1
- package/lib/components/VideoNoteRecorder/LiveVideoNote.d.ts +6 -0
- package/lib/components/VideoNoteRecorder/LiveVideoNote.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/LiveVideoNote.js +205 -0
- package/lib/components/VideoNoteRecorder/LiveVideoNote.js.map +1 -0
- package/lib/components/VideoNoteRecorder/RecorderChrome.d.ts +35 -0
- package/lib/components/VideoNoteRecorder/RecorderChrome.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/RecorderChrome.js +350 -0
- package/lib/components/VideoNoteRecorder/RecorderChrome.js.map +1 -0
- package/lib/components/VideoNoteRecorder/UnavailableVideoNote.d.ts +10 -0
- package/lib/components/VideoNoteRecorder/UnavailableVideoNote.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/UnavailableVideoNote.js +52 -0
- package/lib/components/VideoNoteRecorder/UnavailableVideoNote.js.map +1 -0
- package/lib/components/VideoNoteRecorder/constants.d.ts +16 -0
- package/lib/components/VideoNoteRecorder/constants.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/constants.js +30 -0
- package/lib/components/VideoNoteRecorder/constants.js.map +1 -0
- package/lib/components/{VideoNoteRecorder.d.ts → VideoNoteRecorder/index.d.ts} +5 -10
- package/lib/components/VideoNoteRecorder/index.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/index.js +26 -0
- package/lib/components/VideoNoteRecorder/index.js.map +1 -0
- package/lib/components/VideoNoteRecorder/styles.d.ts +159 -0
- package/lib/components/VideoNoteRecorder/styles.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/styles.js +170 -0
- package/lib/components/VideoNoteRecorder/styles.js.map +1 -0
- package/lib/components/VideoNoteRecorder/types.d.ts +7 -0
- package/lib/components/VideoNoteRecorder/types.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/types.js +2 -0
- package/lib/components/VideoNoteRecorder/types.js.map +1 -0
- package/lib/components/VideoNoteRecorder/useRecordingTimer.d.ts +10 -0
- package/lib/components/VideoNoteRecorder/useRecordingTimer.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/useRecordingTimer.js +134 -0
- package/lib/components/VideoNoteRecorder/useRecordingTimer.js.map +1 -0
- package/lib/components/VideoNoteRecorder/useVideoNoteRecording.d.ts +28 -0
- package/lib/components/VideoNoteRecorder/useVideoNoteRecording.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/useVideoNoteRecording.js +287 -0
- package/lib/components/VideoNoteRecorder/useVideoNoteRecording.js.map +1 -0
- package/lib/components/VideoNoteRecorder/visionCameraHooks.d.ts +6 -0
- package/lib/components/VideoNoteRecorder/visionCameraHooks.d.ts.map +1 -0
- package/lib/components/VideoNoteRecorder/visionCameraHooks.js +11 -0
- package/lib/components/VideoNoteRecorder/visionCameraHooks.js.map +1 -0
- package/lib/components/VideoRecordButton.d.ts +1 -1
- package/lib/components/VideoRecordButton.d.ts.map +1 -1
- package/lib/components/VideoRecordButton.js +221 -92
- package/lib/components/VideoRecordButton.js.map +1 -1
- package/lib/components/ViewOnceBadge.d.ts +23 -0
- package/lib/components/ViewOnceBadge.d.ts.map +1 -0
- package/lib/components/ViewOnceBadge.js +233 -0
- package/lib/components/ViewOnceBadge.js.map +1 -0
- package/lib/components/VoiceMessageInput/RecordedVoicePreview.d.ts +16 -0
- package/lib/components/VoiceMessageInput/RecordedVoicePreview.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/RecordedVoicePreview.js +503 -0
- package/lib/components/VoiceMessageInput/RecordedVoicePreview.js.map +1 -0
- package/lib/components/VoiceMessageInput/constants.d.ts +16 -0
- package/lib/components/VoiceMessageInput/constants.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/constants.js +22 -0
- package/lib/components/VoiceMessageInput/constants.js.map +1 -0
- package/lib/components/VoiceMessageInput/formatElapsed.d.ts +2 -0
- package/lib/components/VoiceMessageInput/formatElapsed.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/formatElapsed.js +7 -0
- package/lib/components/VoiceMessageInput/formatElapsed.js.map +1 -0
- package/lib/components/VoiceMessageInput/index.d.ts +9 -0
- package/lib/components/VoiceMessageInput/index.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/index.js +148 -0
- package/lib/components/VoiceMessageInput/index.js.map +1 -0
- package/lib/components/VoiceMessageInput/previewStyles.d.ts +77 -0
- package/lib/components/VoiceMessageInput/previewStyles.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/previewStyles.js +80 -0
- package/lib/components/VoiceMessageInput/previewStyles.js.map +1 -0
- package/lib/components/VoiceMessageInput/previewWaveform.d.ts +15 -0
- package/lib/components/VoiceMessageInput/previewWaveform.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/previewWaveform.js +27 -0
- package/lib/components/VoiceMessageInput/previewWaveform.js.map +1 -0
- package/lib/components/VoiceMessageInput/recorder.d.ts +18 -0
- package/lib/components/VoiceMessageInput/recorder.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/recorder.js +80 -0
- package/lib/components/VoiceMessageInput/recorder.js.map +1 -0
- package/lib/components/VoiceMessageInput/types.d.ts +56 -0
- package/lib/components/VoiceMessageInput/types.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/types.js +2 -0
- package/lib/components/VoiceMessageInput/types.js.map +1 -0
- package/lib/components/VoiceMessageInput/useLazyRecorder.d.ts +7 -0
- package/lib/components/VoiceMessageInput/useLazyRecorder.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/useLazyRecorder.js +61 -0
- package/lib/components/VoiceMessageInput/useLazyRecorder.js.map +1 -0
- package/lib/components/VoiceMessageInput/useStateReport.d.ts +16 -0
- package/lib/components/VoiceMessageInput/useStateReport.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/useStateReport.js +81 -0
- package/lib/components/VoiceMessageInput/useStateReport.js.map +1 -0
- package/lib/components/VoiceMessageInput/useTakePreviewActions.d.ts +34 -0
- package/lib/components/VoiceMessageInput/useTakePreviewActions.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/useTakePreviewActions.js +207 -0
- package/lib/components/VoiceMessageInput/useTakePreviewActions.js.map +1 -0
- package/lib/components/VoiceMessageInput/useVoiceTake.d.ts +25 -0
- package/lib/components/VoiceMessageInput/useVoiceTake.d.ts.map +1 -0
- package/lib/components/VoiceMessageInput/useVoiceTake.js +424 -0
- package/lib/components/VoiceMessageInput/useVoiceTake.js.map +1 -0
- package/lib/components/WaveformPlayer/Bars.d.ts +30 -0
- package/lib/components/WaveformPlayer/Bars.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/Bars.js +171 -0
- package/lib/components/WaveformPlayer/Bars.js.map +1 -0
- package/lib/components/WaveformPlayer/VoiceButton.d.ts +23 -0
- package/lib/components/WaveformPlayer/VoiceButton.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/VoiceButton.js +111 -0
- package/lib/components/WaveformPlayer/VoiceButton.js.map +1 -0
- package/lib/components/WaveformPlayer/WaveformTrack.d.ts +31 -0
- package/lib/components/WaveformPlayer/WaveformTrack.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/WaveformTrack.js +199 -0
- package/lib/components/WaveformPlayer/WaveformTrack.js.map +1 -0
- package/lib/components/WaveformPlayer/audio.d.ts +23 -0
- package/lib/components/WaveformPlayer/audio.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/audio.js +97 -0
- package/lib/components/WaveformPlayer/audio.js.map +1 -0
- package/lib/components/WaveformPlayer/index.d.ts +13 -0
- package/lib/components/WaveformPlayer/index.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/index.js +475 -0
- package/lib/components/WaveformPlayer/index.js.map +1 -0
- package/lib/components/WaveformPlayer/styles.d.ts +257 -0
- package/lib/components/WaveformPlayer/styles.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/styles.js +120 -0
- package/lib/components/WaveformPlayer/styles.js.map +1 -0
- package/lib/components/WaveformPlayer/types.d.ts +32 -0
- package/lib/components/WaveformPlayer/types.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/types.js +2 -0
- package/lib/components/WaveformPlayer/types.js.map +1 -0
- package/lib/components/WaveformPlayer/useSendFlightReveal.d.ts +21 -0
- package/lib/components/WaveformPlayer/useSendFlightReveal.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/useSendFlightReveal.js +105 -0
- package/lib/components/WaveformPlayer/useSendFlightReveal.js.map +1 -0
- package/lib/components/WaveformPlayer/useVoicePlayback.d.ts +39 -0
- package/lib/components/WaveformPlayer/useVoicePlayback.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/useVoicePlayback.js +401 -0
- package/lib/components/WaveformPlayer/useVoicePlayback.js.map +1 -0
- package/lib/components/WaveformPlayer/useVoiceSource.d.ts +38 -0
- package/lib/components/WaveformPlayer/useVoiceSource.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/useVoiceSource.js +244 -0
- package/lib/components/WaveformPlayer/useVoiceSource.js.map +1 -0
- package/lib/components/WaveformPlayer/useWaveformMotion.d.ts +16 -0
- package/lib/components/WaveformPlayer/useWaveformMotion.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/useWaveformMotion.js +135 -0
- package/lib/components/WaveformPlayer/useWaveformMotion.js.map +1 -0
- package/lib/components/WaveformPlayer/useWaveformScrub.d.ts +16 -0
- package/lib/components/WaveformPlayer/useWaveformScrub.d.ts.map +1 -0
- package/lib/components/WaveformPlayer/useWaveformScrub.js +168 -0
- package/lib/components/WaveformPlayer/useWaveformScrub.js.map +1 -0
- package/lib/components/composerPanels.d.ts +13 -0
- package/lib/components/composerPanels.d.ts.map +1 -0
- package/lib/components/composerPanels.js +22 -0
- package/lib/components/composerPanels.js.map +1 -0
- package/lib/components/defaultMessageActions.d.ts +30 -0
- package/lib/components/defaultMessageActions.d.ts.map +1 -0
- package/lib/components/defaultMessageActions.js +124 -0
- package/lib/components/defaultMessageActions.js.map +1 -0
- package/lib/components/earpiece.d.ts +56 -0
- package/lib/components/earpiece.d.ts.map +1 -0
- package/lib/components/earpiece.js +218 -0
- package/lib/components/earpiece.js.map +1 -0
- package/lib/components/floatingNoteMath.d.ts +66 -0
- package/lib/components/floatingNoteMath.d.ts.map +1 -0
- package/lib/components/floatingNoteMath.js +143 -0
- package/lib/components/floatingNoteMath.js.map +1 -0
- package/lib/components/haptics.d.ts +5 -0
- package/lib/components/haptics.d.ts.map +1 -0
- package/lib/components/haptics.js +26 -0
- package/lib/components/haptics.js.map +1 -0
- package/lib/components/mediaDownload.d.ts +14 -0
- package/lib/components/mediaDownload.d.ts.map +1 -0
- package/lib/components/mediaDownload.js +43 -0
- package/lib/components/mediaDownload.js.map +1 -0
- package/lib/components/mediaPalette.d.ts +7 -2
- package/lib/components/mediaPalette.d.ts.map +1 -1
- package/lib/components/mediaPalette.js +27 -15
- package/lib/components/mediaPalette.js.map +1 -1
- package/lib/components/mediaPlayback.d.ts +204 -5
- package/lib/components/mediaPlayback.d.ts.map +1 -1
- package/lib/components/mediaPlayback.js +746 -17
- package/lib/components/mediaPlayback.js.map +1 -1
- package/lib/components/mediaTransfer.d.ts +29 -0
- package/lib/components/mediaTransfer.d.ts.map +1 -0
- package/lib/components/mediaTransfer.js +52 -0
- package/lib/components/mediaTransfer.js.map +1 -0
- package/lib/components/mediaViewer/MediaViewer.d.ts +17 -0
- package/lib/components/mediaViewer/MediaViewer.d.ts.map +1 -0
- package/lib/components/mediaViewer/MediaViewer.js +347 -0
- package/lib/components/mediaViewer/MediaViewer.js.map +1 -0
- package/lib/components/mediaViewer/MediaViewerChrome.d.ts +14 -0
- package/lib/components/mediaViewer/MediaViewerChrome.d.ts.map +1 -0
- package/lib/components/mediaViewer/MediaViewerChrome.js +164 -0
- package/lib/components/mediaViewer/MediaViewerChrome.js.map +1 -0
- package/lib/components/mediaViewer/MediaViewerHost.d.ts +10 -0
- package/lib/components/mediaViewer/MediaViewerHost.d.ts.map +1 -0
- package/lib/components/mediaViewer/MediaViewerHost.js +76 -0
- package/lib/components/mediaViewer/MediaViewerHost.js.map +1 -0
- package/lib/components/mediaViewer/MediaViewerPage.d.ts +25 -0
- package/lib/components/mediaViewer/MediaViewerPage.d.ts.map +1 -0
- package/lib/components/mediaViewer/MediaViewerPage.js +194 -0
- package/lib/components/mediaViewer/MediaViewerPage.js.map +1 -0
- package/lib/components/mediaViewer/gallery.d.ts +27 -0
- package/lib/components/mediaViewer/gallery.d.ts.map +1 -0
- package/lib/components/mediaViewer/gallery.js +41 -0
- package/lib/components/mediaViewer/gallery.js.map +1 -0
- package/lib/components/messageHighlight.d.ts +41 -0
- package/lib/components/messageHighlight.d.ts.map +1 -0
- package/lib/components/messageHighlight.js +157 -0
- package/lib/components/messageHighlight.js.map +1 -0
- package/lib/components/messagePress.d.ts +14 -0
- package/lib/components/messagePress.d.ts.map +1 -0
- package/lib/components/messagePress.js +18 -0
- package/lib/components/messagePress.js.map +1 -0
- package/lib/components/messageSelection.d.ts +39 -0
- package/lib/components/messageSelection.d.ts.map +1 -0
- package/lib/components/messageSelection.js +135 -0
- package/lib/components/messageSelection.js.map +1 -0
- package/lib/components/recordingFeedback.d.ts +22 -0
- package/lib/components/recordingFeedback.d.ts.map +1 -0
- package/lib/components/recordingFeedback.js +80 -0
- package/lib/components/recordingFeedback.js.map +1 -0
- package/lib/components/recordingMeter.d.ts +19 -0
- package/lib/components/recordingMeter.d.ts.map +1 -0
- package/lib/components/recordingMeter.js +21 -0
- package/lib/components/recordingMeter.js.map +1 -0
- package/lib/components/roundNoteChrome.d.ts +107 -0
- package/lib/components/roundNoteChrome.d.ts.map +1 -0
- package/lib/components/roundNoteChrome.js +249 -0
- package/lib/components/roundNoteChrome.js.map +1 -0
- package/lib/components/roundNotePlayers.d.ts +78 -0
- package/lib/components/roundNotePlayers.d.ts.map +1 -0
- package/lib/components/roundNotePlayers.js +230 -0
- package/lib/components/roundNotePlayers.js.map +1 -0
- package/lib/components/sendFlight.d.ts +88 -0
- package/lib/components/sendFlight.d.ts.map +1 -0
- package/lib/components/sendFlight.js +146 -0
- package/lib/components/sendFlight.js.map +1 -0
- package/lib/components/viewOnce.d.ts +27 -0
- package/lib/components/viewOnce.d.ts.map +1 -0
- package/lib/components/viewOnce.js +168 -0
- package/lib/components/viewOnce.js.map +1 -0
- package/lib/components/visionCamera.d.ts +45 -0
- package/lib/components/visionCamera.d.ts.map +1 -0
- package/lib/components/visionCamera.js +117 -0
- package/lib/components/visionCamera.js.map +1 -0
- package/lib/components/voiceEditing.d.ts +34 -0
- package/lib/components/voiceEditing.d.ts.map +1 -0
- package/lib/components/voiceEditing.js +159 -0
- package/lib/components/voiceEditing.js.map +1 -0
- package/lib/components/voiceWaveform.d.ts +108 -0
- package/lib/components/voiceWaveform.d.ts.map +1 -0
- package/lib/components/voiceWaveform.js +165 -0
- package/lib/components/voiceWaveform.js.map +1 -0
- package/lib/components/wallpaperGradient.d.ts +16 -0
- package/lib/components/wallpaperGradient.d.ts.map +1 -0
- package/lib/components/wallpaperGradient.js +186 -0
- package/lib/components/wallpaperGradient.js.map +1 -0
- package/lib/components/windowInsets.d.ts +11 -0
- package/lib/components/windowInsets.d.ts.map +1 -0
- package/lib/components/windowInsets.js +44 -0
- package/lib/components/windowInsets.js.map +1 -0
- package/lib/dayjsLocales.js +15 -2
- package/lib/dayjsLocales.js.map +1 -1
- package/lib/emoji/EmojiGrid/BackspaceButton.d.ts +11 -0
- package/lib/emoji/EmojiGrid/BackspaceButton.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/BackspaceButton.js +111 -0
- package/lib/emoji/EmojiGrid/BackspaceButton.js.map +1 -0
- package/lib/emoji/EmojiGrid/EmojiRow.d.ts +15 -0
- package/lib/emoji/EmojiGrid/EmojiRow.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/EmojiRow.js +71 -0
- package/lib/emoji/EmojiGrid/EmojiRow.js.map +1 -0
- package/lib/emoji/EmojiGrid/Search.d.ts +29 -0
- package/lib/emoji/EmojiGrid/Search.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/Search.js +234 -0
- package/lib/emoji/EmojiGrid/Search.js.map +1 -0
- package/lib/emoji/EmojiGrid/TabStrip.d.ts +16 -0
- package/lib/emoji/EmojiGrid/TabStrip.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/TabStrip.js +237 -0
- package/lib/emoji/EmojiGrid/TabStrip.js.map +1 -0
- package/lib/emoji/EmojiGrid/TonePopup.d.ts +12 -0
- package/lib/emoji/EmojiGrid/TonePopup.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/TonePopup.js +137 -0
- package/lib/emoji/EmojiGrid/TonePopup.js.map +1 -0
- package/lib/emoji/EmojiGrid/constants.d.ts +29 -0
- package/lib/emoji/EmojiGrid/constants.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/constants.js +65 -0
- package/lib/emoji/EmojiGrid/constants.js.map +1 -0
- package/lib/emoji/EmojiGrid/index.d.ts +10 -0
- package/lib/emoji/EmojiGrid/index.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/index.js +450 -0
- package/lib/emoji/EmojiGrid/index.js.map +1 -0
- package/lib/emoji/EmojiGrid/items.d.ts +25 -0
- package/lib/emoji/EmojiGrid/items.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/items.js +75 -0
- package/lib/emoji/EmojiGrid/items.js.map +1 -0
- package/lib/emoji/EmojiGrid/styles.d.ts +181 -0
- package/lib/emoji/EmojiGrid/styles.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/styles.js +184 -0
- package/lib/emoji/EmojiGrid/styles.js.map +1 -0
- package/lib/emoji/EmojiGrid/types.d.ts +53 -0
- package/lib/emoji/EmojiGrid/types.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/types.js +2 -0
- package/lib/emoji/EmojiGrid/types.js.map +1 -0
- package/lib/emoji/EmojiGrid/useTabScroll.d.ts +19 -0
- package/lib/emoji/EmojiGrid/useTabScroll.d.ts.map +1 -0
- package/lib/emoji/EmojiGrid/useTabScroll.js +124 -0
- package/lib/emoji/EmojiGrid/useTabScroll.js.map +1 -0
- package/lib/emoji/EmojiKeyboard.d.ts +79 -0
- package/lib/emoji/EmojiKeyboard.d.ts.map +1 -0
- package/lib/emoji/EmojiKeyboard.js +445 -0
- package/lib/emoji/EmojiKeyboard.js.map +1 -0
- package/lib/emoji/defaultExpandedPicker.d.ts +5 -0
- package/lib/emoji/defaultExpandedPicker.d.ts.map +1 -0
- package/lib/emoji/defaultExpandedPicker.js +11 -0
- package/lib/emoji/defaultExpandedPicker.js.map +1 -0
- package/lib/emoji/emojiData.d.ts +2 -0
- package/lib/emoji/emojiData.d.ts.map +1 -0
- package/lib/emoji/emojiData.js +5 -0
- package/lib/emoji/emojiData.js.map +1 -0
- package/lib/emoji/emojiStore.d.ts +70 -0
- package/lib/emoji/emojiStore.d.ts.map +1 -0
- package/lib/emoji/emojiStore.js +246 -0
- package/lib/emoji/emojiStore.js.map +1 -0
- package/lib/emoji/textEditing.d.ts +20 -0
- package/lib/emoji/textEditing.d.ts.map +1 -0
- package/lib/emoji/textEditing.js +97 -0
- package/lib/emoji/textEditing.js.map +1 -0
- package/lib/emojiOnly.d.ts +11 -0
- package/lib/emojiOnly.d.ts.map +1 -0
- package/lib/emojiOnly.js +79 -0
- package/lib/emojiOnly.js.map +1 -0
- package/lib/gestures/useRowSwipe.d.ts +43 -0
- package/lib/gestures/useRowSwipe.d.ts.map +1 -0
- package/lib/gestures/useRowSwipe.js +74 -0
- package/lib/gestures/useRowSwipe.js.map +1 -0
- package/lib/hooks/useAnimatedPresence.d.ts +22 -0
- package/lib/hooks/useAnimatedPresence.d.ts.map +1 -0
- package/lib/hooks/useAnimatedPresence.js +97 -0
- package/lib/hooks/useAnimatedPresence.js.map +1 -0
- package/lib/hooks/useChatMessages.d.ts +39 -0
- package/lib/hooks/useChatMessages.d.ts.map +1 -0
- package/lib/hooks/useChatMessages.js +125 -0
- package/lib/hooks/useChatMessages.js.map +1 -0
- package/lib/hooks/useColorScheme.d.ts +7 -1
- package/lib/hooks/useColorScheme.d.ts.map +1 -1
- package/lib/hooks/useColorScheme.js +46 -8
- package/lib/hooks/useColorScheme.js.map +1 -1
- package/lib/hooks/useHasKeyboardProvider.js +18 -7
- package/lib/hooks/useHasKeyboardProvider.js.map +1 -1
- package/lib/hooks/useIcons.js +15 -2
- package/lib/hooks/useIcons.js.map +1 -1
- package/lib/hooks/useIsKeyboardVisible.js +39 -17
- package/lib/hooks/useIsKeyboardVisible.js.map +1 -1
- package/lib/hooks/useIsRTL.js +15 -2
- package/lib/hooks/useIsRTL.js.map +1 -1
- package/lib/hooks/useKeyboardVerticalOffset.d.ts +5 -3
- package/lib/hooks/useKeyboardVerticalOffset.d.ts.map +1 -1
- package/lib/hooks/useKeyboardVerticalOffset.js +52 -18
- package/lib/hooks/useKeyboardVerticalOffset.js.map +1 -1
- package/lib/hooks/useLabels.js +15 -2
- package/lib/hooks/useLabels.js.map +1 -1
- package/lib/hooks/useStreamingMessages.js +200 -86
- package/lib/hooks/useStreamingMessages.js.map +1 -1
- package/lib/hooks/useTheme.js +56 -7
- package/lib/hooks/useTheme.js.map +1 -1
- package/lib/hooks/useUpdateLayoutEffect.d.ts.map +1 -1
- package/lib/hooks/useUpdateLayoutEffect.js +35 -11
- package/lib/hooks/useUpdateLayoutEffect.js.map +1 -1
- package/lib/i18n.d.ts +182 -0
- package/lib/i18n.d.ts.map +1 -1
- package/lib/i18n.js +121 -23
- package/lib/i18n.js.map +1 -1
- package/lib/index.d.ts +31 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +18 -1
- package/lib/index.js.map +1 -1
- package/lib/linkParser.js +318 -185
- package/lib/linkParser.js.map +1 -1
- package/lib/locales/ar.d.ts.map +1 -1
- package/lib/locales/ar.js +110 -19
- package/lib/locales/ar.js.map +1 -1
- package/lib/locales/de.d.ts.map +1 -1
- package/lib/locales/de.js +110 -19
- package/lib/locales/de.js.map +1 -1
- package/lib/locales/es.d.ts.map +1 -1
- package/lib/locales/es.js +110 -19
- package/lib/locales/es.js.map +1 -1
- package/lib/locales/fr.d.ts.map +1 -1
- package/lib/locales/fr.js +110 -19
- package/lib/locales/fr.js.map +1 -1
- package/lib/locales/hi.d.ts.map +1 -1
- package/lib/locales/hi.js +110 -19
- package/lib/locales/hi.js.map +1 -1
- package/lib/locales/id.d.ts.map +1 -1
- package/lib/locales/id.js +110 -19
- package/lib/locales/id.js.map +1 -1
- package/lib/locales/index.js +19 -5
- package/lib/locales/index.js.map +1 -1
- package/lib/locales/it.d.ts.map +1 -1
- package/lib/locales/it.js +110 -19
- package/lib/locales/it.js.map +1 -1
- package/lib/locales/ja.d.ts.map +1 -1
- package/lib/locales/ja.js +110 -19
- package/lib/locales/ja.js.map +1 -1
- package/lib/locales/ko.d.ts.map +1 -1
- package/lib/locales/ko.js +110 -19
- package/lib/locales/ko.js.map +1 -1
- package/lib/locales/nl.d.ts.map +1 -1
- package/lib/locales/nl.js +110 -19
- package/lib/locales/nl.js.map +1 -1
- package/lib/locales/pl.d.ts.map +1 -1
- package/lib/locales/pl.js +110 -19
- package/lib/locales/pl.js.map +1 -1
- package/lib/locales/pt.d.ts.map +1 -1
- package/lib/locales/pt.js +110 -19
- package/lib/locales/pt.js.map +1 -1
- package/lib/locales/ru.d.ts.map +1 -1
- package/lib/locales/ru.js +110 -19
- package/lib/locales/ru.js.map +1 -1
- package/lib/locales/tr.d.ts.map +1 -1
- package/lib/locales/tr.js +110 -19
- package/lib/locales/tr.js.map +1 -1
- package/lib/locales/zh.d.ts.map +1 -1
- package/lib/locales/zh.js +110 -19
- package/lib/locales/zh.js.map +1 -1
- package/lib/logging.d.ts +5 -0
- package/lib/logging.d.ts.map +1 -1
- package/lib/logging.js +13 -1
- package/lib/logging.js.map +1 -1
- package/lib/messageUtils.d.ts +19 -0
- package/lib/messageUtils.d.ts.map +1 -0
- package/lib/messageUtils.js +61 -0
- package/lib/messageUtils.js.map +1 -0
- package/lib/motion.d.ts +21 -0
- package/lib/motion.d.ts.map +1 -0
- package/lib/motion.js +30 -0
- package/lib/motion.js.map +1 -0
- package/lib/optional/index.d.ts +99 -0
- package/lib/optional/index.d.ts.map +1 -0
- package/lib/optional/index.js +284 -0
- package/lib/optional/index.js.map +1 -0
- package/lib/rtl.js +7 -5
- package/lib/rtl.js.map +1 -1
- package/lib/store.d.ts +40 -0
- package/lib/store.d.ts.map +1 -0
- package/lib/store.js +127 -0
- package/lib/store.js.map +1 -0
- package/lib/styles.d.ts +2 -2
- package/lib/styles.d.ts.map +1 -1
- package/lib/styles.js +15 -15
- package/lib/styles.js.map +1 -1
- package/lib/types.js +1 -0
- package/lib/types.js.map +1 -1
- package/lib/utils.d.ts +15 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +199 -94
- package/lib/utils.js.map +1 -1
- package/llms.txt +133 -31
- package/package.json +89 -46
- package/lib/InputToolbar.d.ts +0 -49
- package/lib/InputToolbar.d.ts.map +0 -1
- package/lib/InputToolbar.js +0 -338
- package/lib/InputToolbar.js.map +0 -1
- package/lib/MessageVideo.d.ts.map +0 -1
- package/lib/MessageVideo.js +0 -162
- package/lib/MessageVideo.js.map +0 -1
- package/lib/MessagesContainer/FlashList.d.ts +0 -9
- package/lib/MessagesContainer/FlashList.d.ts.map +0 -1
- package/lib/MessagesContainer/FlashList.js +0 -23
- package/lib/MessagesContainer/FlashList.js.map +0 -1
- package/lib/components/ContextMenu.d.ts +0 -25
- package/lib/components/ContextMenu.d.ts.map +0 -1
- package/lib/components/ContextMenu.js +0 -122
- package/lib/components/ContextMenu.js.map +0 -1
- package/lib/components/VideoNoteRecorder.d.ts.map +0 -1
- package/lib/components/VideoNoteRecorder.js +0 -634
- package/lib/components/VideoNoteRecorder.js.map +0 -1
- package/lib/components/VoiceMessageInput.d.ts +0 -33
- package/lib/components/VoiceMessageInput.d.ts.map +0 -1
- package/lib/components/VoiceMessageInput.js +0 -403
- package/lib/components/VoiceMessageInput.js.map +0 -1
- package/lib/components/WaveformPlayer.d.ts +0 -19
- package/lib/components/WaveformPlayer.d.ts.map +0 -1
- package/lib/components/WaveformPlayer.js +0 -367
- package/lib/components/WaveformPlayer.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Text edits the emoji keyboard makes in the composer, at the caret or over the selection. */
|
|
2
|
+
export interface TextSelection {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
}
|
|
6
|
+
export interface TextEdit {
|
|
7
|
+
text: string;
|
|
8
|
+
selection: TextSelection;
|
|
9
|
+
}
|
|
10
|
+
/** Put `insert` in place of the selection (or at the caret; at the end without one). */
|
|
11
|
+
export declare const insertText: (text: string, insert: string, selection?: TextSelection | null) => TextEdit;
|
|
12
|
+
/**
|
|
13
|
+
* Where the character before `index` starts, keeping an emoji whole: ZWJ sequences
|
|
14
|
+
* (👨👩👧), skin tones, variation selectors, keycaps, flags and tag sequences (🏴) are one
|
|
15
|
+
* character to the user, so one backspace removes all of it.
|
|
16
|
+
*/
|
|
17
|
+
export declare const previousCharacterStart: (text: string, index: number) => number;
|
|
18
|
+
/** The backspace key: removes the selection, or the whole character before the caret. */
|
|
19
|
+
export declare const deleteBackward: (text: string, selection?: TextSelection | null) => TextEdit;
|
|
20
|
+
//# sourceMappingURL=textEditing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textEditing.d.ts","sourceRoot":"","sources":["../../src/emoji/textEditing.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAE/F,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,aAAa,CAAA;CACzB;AAWD,wFAAwF;AACxF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,EAAE,YAAY,aAAa,GAAG,IAAI,KAAG,QAO3F,CAAA;AASD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MA+BpE,CAAA;AAED,yFAAyF;AACzF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,YAAY,aAAa,GAAG,IAAI,KAAG,QAY/E,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Text edits the emoji keyboard makes in the composer, at the caret or over the selection. */
|
|
2
|
+
|
|
3
|
+
const clampSelection = (text, selection) => {
|
|
4
|
+
if (!selection) return {
|
|
5
|
+
start: text.length,
|
|
6
|
+
end: text.length
|
|
7
|
+
};
|
|
8
|
+
const start = Math.max(0, Math.min(selection.start, text.length));
|
|
9
|
+
const end = Math.max(start, Math.min(selection.end, text.length));
|
|
10
|
+
return {
|
|
11
|
+
start,
|
|
12
|
+
end
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** Put `insert` in place of the selection (or at the caret; at the end without one). */
|
|
17
|
+
export const insertText = (text, insert, selection) => {
|
|
18
|
+
const {
|
|
19
|
+
start,
|
|
20
|
+
end
|
|
21
|
+
} = clampSelection(text, selection);
|
|
22
|
+
const caret = start + insert.length;
|
|
23
|
+
return {
|
|
24
|
+
text: text.slice(0, start) + insert + text.slice(end),
|
|
25
|
+
selection: {
|
|
26
|
+
start: caret,
|
|
27
|
+
end: caret
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const isVariationSelector = point => point === 0xFE0F || point === 0xFE0E;
|
|
32
|
+
const isSkinTone = point => point >= 0x1F3FB && point <= 0x1F3FF;
|
|
33
|
+
const isRegionalIndicator = point => point >= 0x1F1E6 && point <= 0x1F1FF;
|
|
34
|
+
const isTag = point => point >= 0xE0020 && point <= 0xE007F;
|
|
35
|
+
const ZWJ = 0x200D;
|
|
36
|
+
const KEYCAP = 0x20E3;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Where the character before `index` starts, keeping an emoji whole: ZWJ sequences
|
|
40
|
+
* (👨👩👧), skin tones, variation selectors, keycaps, flags and tag sequences (🏴) are one
|
|
41
|
+
* character to the user, so one backspace removes all of it.
|
|
42
|
+
*/
|
|
43
|
+
export const previousCharacterStart = (text, index) => {
|
|
44
|
+
const points = Array.from(text.slice(0, index));
|
|
45
|
+
if (points.length === 0) return 0;
|
|
46
|
+
let i = points.length - 1;
|
|
47
|
+
const code = at => points[at]?.codePointAt(0) ?? 0;
|
|
48
|
+
|
|
49
|
+
// Trailing modifiers belong to the character before them.
|
|
50
|
+
while (i > 0 && (isVariationSelector(code(i)) || isSkinTone(code(i)) || isTag(code(i)) || code(i) === KEYCAP)) i -= 1;
|
|
51
|
+
if (i > 0 && isVariationSelector(code(i))) i -= 1;
|
|
52
|
+
|
|
53
|
+
// A flag is a pair of regional indicators.
|
|
54
|
+
if (isRegionalIndicator(code(i))) {
|
|
55
|
+
let run = 0;
|
|
56
|
+
for (let j = i; j >= 0 && isRegionalIndicator(code(j)); j -= 1) run += 1;
|
|
57
|
+
if (run % 2 === 0) i -= 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Joined parts: keep walking back while a ZWJ links this part to the previous one.
|
|
61
|
+
while (i > 1 && code(i - 1) === ZWJ) {
|
|
62
|
+
i -= 2;
|
|
63
|
+
while (i > 0 && (isVariationSelector(code(i)) || isSkinTone(code(i)))) i -= 1;
|
|
64
|
+
}
|
|
65
|
+
return points.slice(0, i).join('').length;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** The backspace key: removes the selection, or the whole character before the caret. */
|
|
69
|
+
export const deleteBackward = (text, selection) => {
|
|
70
|
+
const {
|
|
71
|
+
start,
|
|
72
|
+
end
|
|
73
|
+
} = clampSelection(text, selection);
|
|
74
|
+
if (start !== end) return {
|
|
75
|
+
text: text.slice(0, start) + text.slice(end),
|
|
76
|
+
selection: {
|
|
77
|
+
start,
|
|
78
|
+
end: start
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
if (start === 0) return {
|
|
82
|
+
text,
|
|
83
|
+
selection: {
|
|
84
|
+
start: 0,
|
|
85
|
+
end: 0
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const from = previousCharacterStart(text, start);
|
|
89
|
+
return {
|
|
90
|
+
text: text.slice(0, from) + text.slice(start),
|
|
91
|
+
selection: {
|
|
92
|
+
start: from,
|
|
93
|
+
end: from
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=textEditing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textEditing.js","names":["clampSelection","text","selection","start","length","end","Math","max","min","insertText","insert","caret","slice","isVariationSelector","point","isSkinTone","isRegionalIndicator","isTag","ZWJ","KEYCAP","previousCharacterStart","index","points","Array","from","i","code","at","codePointAt","run","j","join","deleteBackward"],"sources":["../../src/emoji/textEditing.ts"],"sourcesContent":["/** Text edits the emoji keyboard makes in the composer, at the caret or over the selection. */\n\nexport interface TextSelection {\n start: number\n end: number\n}\n\nexport interface TextEdit {\n text: string\n selection: TextSelection\n}\n\nconst clampSelection = (text: string, selection?: TextSelection | null): TextSelection => {\n if (!selection)\n return { start: text.length, end: text.length }\n\n const start = Math.max(0, Math.min(selection.start, text.length))\n const end = Math.max(start, Math.min(selection.end, text.length))\n return { start, end }\n}\n\n/** Put `insert` in place of the selection (or at the caret; at the end without one). */\nexport const insertText = (text: string, insert: string, selection?: TextSelection | null): TextEdit => {\n const { start, end } = clampSelection(text, selection)\n const caret = start + insert.length\n return {\n text: text.slice(0, start) + insert + text.slice(end),\n selection: { start: caret, end: caret },\n }\n}\n\nconst isVariationSelector = (point: number) => point === 0xFE0F || point === 0xFE0E\nconst isSkinTone = (point: number) => point >= 0x1F3FB && point <= 0x1F3FF\nconst isRegionalIndicator = (point: number) => point >= 0x1F1E6 && point <= 0x1F1FF\nconst isTag = (point: number) => point >= 0xE0020 && point <= 0xE007F\nconst ZWJ = 0x200D\nconst KEYCAP = 0x20E3\n\n/**\n * Where the character before `index` starts, keeping an emoji whole: ZWJ sequences\n * (👨👩👧), skin tones, variation selectors, keycaps, flags and tag sequences (🏴) are one\n * character to the user, so one backspace removes all of it.\n */\nexport const previousCharacterStart = (text: string, index: number): number => {\n const points = Array.from(text.slice(0, index))\n if (points.length === 0)\n return 0\n\n let i = points.length - 1\n const code = (at: number) => points[at]?.codePointAt(0) ?? 0\n\n // Trailing modifiers belong to the character before them.\n while (i > 0 && (isVariationSelector(code(i)) || isSkinTone(code(i)) || isTag(code(i)) || code(i) === KEYCAP))\n i -= 1\n if (i > 0 && isVariationSelector(code(i)))\n i -= 1\n\n // A flag is a pair of regional indicators.\n if (isRegionalIndicator(code(i))) {\n let run = 0\n for (let j = i; j >= 0 && isRegionalIndicator(code(j)); j -= 1)\n run += 1\n if (run % 2 === 0)\n i -= 1\n }\n\n // Joined parts: keep walking back while a ZWJ links this part to the previous one.\n while (i > 1 && code(i - 1) === ZWJ) {\n i -= 2\n while (i > 0 && (isVariationSelector(code(i)) || isSkinTone(code(i))))\n i -= 1\n }\n\n return points.slice(0, i).join('').length\n}\n\n/** The backspace key: removes the selection, or the whole character before the caret. */\nexport const deleteBackward = (text: string, selection?: TextSelection | null): TextEdit => {\n const { start, end } = clampSelection(text, selection)\n if (start !== end)\n return { text: text.slice(0, start) + text.slice(end), selection: { start, end: start } }\n if (start === 0)\n return { text, selection: { start: 0, end: 0 } }\n\n const from = previousCharacterStart(text, start)\n return {\n text: text.slice(0, from) + text.slice(start),\n selection: { start: from, end: from },\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Counting the emoji in an emoji-only message, for big-emoji messages: a message made of
|
|
3
|
+
* nothing but emoji (and spaces) drops its
|
|
4
|
+
* bubble and draws them large.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* How many emoji `text` holds when it holds nothing else (spaces aside), or 0. A ZWJ family,
|
|
8
|
+
* a flag, a keycap or a skin-toned hand counts as one. Gives up past `max`, returning 0.
|
|
9
|
+
*/
|
|
10
|
+
export declare function countEmojiOnly(text: string | undefined | null, max?: number): number;
|
|
11
|
+
//# sourceMappingURL=emojiOnly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emojiOnly.d.ts","sourceRoot":"","sources":["../src/emojiOnly.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiCH;;;GAGG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,GAAG,SAAW,GAAG,MAAM,CA0DvF"}
|
package/lib/emojiOnly.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Counting the emoji in an emoji-only message, for big-emoji messages: a message made of
|
|
3
|
+
* nothing but emoji (and spaces) drops its
|
|
4
|
+
* bubble and draws them large.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Hermes and V8 both support Unicode property escapes; the range test below is only a fallback
|
|
8
|
+
// for an engine that does not.
|
|
9
|
+
let pictographic = null;
|
|
10
|
+
try {
|
|
11
|
+
pictographic = new RegExp('\\p{Extended_Pictographic}', 'u');
|
|
12
|
+
} catch {
|
|
13
|
+
pictographic = null;
|
|
14
|
+
}
|
|
15
|
+
const isPictographic = (codePoint, char) => {
|
|
16
|
+
if (pictographic) return pictographic.test(char);
|
|
17
|
+
return codePoint >= 0x1F000 && codePoint <= 0x1FAFF || codePoint >= 0x2600 && codePoint <= 0x27BF || codePoint >= 0x2300 && codePoint <= 0x23FF || codePoint >= 0x2B00 && codePoint <= 0x2BFF || codePoint === 0x00A9 || codePoint === 0x00AE || codePoint === 0x203C || codePoint === 0x2049 || codePoint === 0x2122 || codePoint === 0x2139 || codePoint === 0x3030 || codePoint === 0x303D;
|
|
18
|
+
};
|
|
19
|
+
const isRegionalIndicator = codePoint => codePoint >= 0x1F1E6 && codePoint <= 0x1F1FF;
|
|
20
|
+
const isSkinTone = codePoint => codePoint >= 0x1F3FB && codePoint <= 0x1F3FF;
|
|
21
|
+
const isTag = codePoint => codePoint >= 0xE0020 && codePoint <= 0xE007F;
|
|
22
|
+
const VS15 = 0xFE0E;
|
|
23
|
+
const VS16 = 0xFE0F;
|
|
24
|
+
const ZWJ = 0x200D;
|
|
25
|
+
const KEYCAP = 0x20E3;
|
|
26
|
+
const isWhitespace = char => /\s/.test(char);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* How many emoji `text` holds when it holds nothing else (spaces aside), or 0. A ZWJ family,
|
|
30
|
+
* a flag, a keycap or a skin-toned hand counts as one. Gives up past `max`, returning 0.
|
|
31
|
+
*/
|
|
32
|
+
export function countEmojiOnly(text, max = Infinity) {
|
|
33
|
+
if (!text) return 0;
|
|
34
|
+
const chars = Array.from(text);
|
|
35
|
+
let count = 0;
|
|
36
|
+
let i = 0;
|
|
37
|
+
const codeAt = index => chars[index]?.codePointAt(0) ?? -1;
|
|
38
|
+
while (i < chars.length) {
|
|
39
|
+
const char = chars[i];
|
|
40
|
+
const codePoint = codeAt(i);
|
|
41
|
+
if (isWhitespace(char)) {
|
|
42
|
+
i += 1;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (isRegionalIndicator(codePoint)) {
|
|
46
|
+
// A flag is a pair; a lone indicator still draws as one glyph.
|
|
47
|
+
i += isRegionalIndicator(codeAt(i + 1)) ? 2 : 1;
|
|
48
|
+
} else if (/[0-9#*]/.test(char)) {
|
|
49
|
+
// A keycap: the digit, an optional VS16, then U+20E3.
|
|
50
|
+
let next = i + 1;
|
|
51
|
+
if (codeAt(next) === VS16) next += 1;
|
|
52
|
+
if (codeAt(next) !== KEYCAP) return 0;
|
|
53
|
+
i = next + 1;
|
|
54
|
+
} else if (isPictographic(codePoint, char)) {
|
|
55
|
+
i += 1;
|
|
56
|
+
// Modifiers, then any ZWJ-joined parts of the same sequence.
|
|
57
|
+
for (;;) {
|
|
58
|
+
const next = codeAt(i);
|
|
59
|
+
if (next === VS16 || next === VS15 || isSkinTone(next) || isTag(next) || next === KEYCAP) {
|
|
60
|
+
i += 1;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (next === ZWJ && i + 1 < chars.length && isPictographic(codeAt(i + 1), chars[i + 1])) {
|
|
64
|
+
i += 2;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
// A text-style symbol (© without VS16, ♥ with VS15) is not drawn as an emoji.
|
|
70
|
+
if (codePoint < 0x2000 && codeAt(i - 1) !== VS16) return 0;
|
|
71
|
+
} else {
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
count += 1;
|
|
75
|
+
if (count > max) return 0;
|
|
76
|
+
}
|
|
77
|
+
return count;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=emojiOnly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emojiOnly.js","names":["pictographic","RegExp","isPictographic","codePoint","char","test","isRegionalIndicator","isSkinTone","isTag","VS15","VS16","ZWJ","KEYCAP","isWhitespace","countEmojiOnly","text","max","Infinity","chars","Array","from","count","i","codeAt","index","codePointAt","length","next"],"sources":["../src/emojiOnly.ts"],"sourcesContent":["/**\n * Counting the emoji in an emoji-only message, for big-emoji messages: a message made of\n * nothing but emoji (and spaces) drops its\n * bubble and draws them large.\n */\n\n// Hermes and V8 both support Unicode property escapes; the range test below is only a fallback\n// for an engine that does not.\nlet pictographic: RegExp | null = null\ntry {\n pictographic = new RegExp('\\\\p{Extended_Pictographic}', 'u')\n} catch {\n pictographic = null\n}\n\nconst isPictographic = (codePoint: number, char: string): boolean => {\n if (pictographic)\n return pictographic.test(char)\n\n return (codePoint >= 0x1F000 && codePoint <= 0x1FAFF) ||\n (codePoint >= 0x2600 && codePoint <= 0x27BF) ||\n (codePoint >= 0x2300 && codePoint <= 0x23FF) ||\n (codePoint >= 0x2B00 && codePoint <= 0x2BFF) ||\n codePoint === 0x00A9 || codePoint === 0x00AE || codePoint === 0x203C || codePoint === 0x2049 ||\n codePoint === 0x2122 || codePoint === 0x2139 || codePoint === 0x3030 || codePoint === 0x303D\n}\n\nconst isRegionalIndicator = (codePoint: number) => codePoint >= 0x1F1E6 && codePoint <= 0x1F1FF\nconst isSkinTone = (codePoint: number) => codePoint >= 0x1F3FB && codePoint <= 0x1F3FF\nconst isTag = (codePoint: number) => codePoint >= 0xE0020 && codePoint <= 0xE007F\nconst VS15 = 0xFE0E\nconst VS16 = 0xFE0F\nconst ZWJ = 0x200D\nconst KEYCAP = 0x20E3\n\nconst isWhitespace = (char: string) => /\\s/.test(char)\n\n/**\n * How many emoji `text` holds when it holds nothing else (spaces aside), or 0. A ZWJ family,\n * a flag, a keycap or a skin-toned hand counts as one. Gives up past `max`, returning 0.\n */\nexport function countEmojiOnly (text: string | undefined | null, max = Infinity): number {\n if (!text)\n return 0\n\n const chars = Array.from(text)\n let count = 0\n let i = 0\n\n const codeAt = (index: number) => chars[index]?.codePointAt(0) ?? -1\n\n while (i < chars.length) {\n const char = chars[i]\n const codePoint = codeAt(i)\n\n if (isWhitespace(char)) {\n i += 1\n continue\n }\n\n if (isRegionalIndicator(codePoint)) {\n // A flag is a pair; a lone indicator still draws as one glyph.\n i += isRegionalIndicator(codeAt(i + 1)) ? 2 : 1\n } else if (/[0-9#*]/.test(char)) {\n // A keycap: the digit, an optional VS16, then U+20E3.\n let next = i + 1\n if (codeAt(next) === VS16)\n next += 1\n if (codeAt(next) !== KEYCAP)\n return 0\n i = next + 1\n } else if (isPictographic(codePoint, char)) {\n i += 1\n // Modifiers, then any ZWJ-joined parts of the same sequence.\n for (;;) {\n const next = codeAt(i)\n if (next === VS16 || next === VS15 || isSkinTone(next) || isTag(next) || next === KEYCAP) {\n i += 1\n continue\n }\n if (next === ZWJ && i + 1 < chars.length && isPictographic(codeAt(i + 1), chars[i + 1])) {\n i += 2\n continue\n }\n break\n }\n // A text-style symbol (© without VS16, ♥ with VS15) is not drawn as an emoji.\n if (codePoint < 0x2000 && codeAt(i - 1) !== VS16)\n return 0\n } else {\n return 0\n }\n\n count += 1\n if (count > max)\n return 0\n }\n\n return count\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SharedValue } from 'react-native-reanimated';
|
|
2
|
+
export interface RowSwipeOptions {
|
|
3
|
+
testID?: string;
|
|
4
|
+
isEnabled: boolean;
|
|
5
|
+
/** Which way the row moves: -1 to the left, 1 to the right. */
|
|
6
|
+
sign: 1 | -1;
|
|
7
|
+
/** How far the finger goes sideways before the swipe takes the touch. */
|
|
8
|
+
activeOffsetX: number;
|
|
9
|
+
/** How far it may go up or down first; past that the list scrolls instead. */
|
|
10
|
+
failOffsetY: number;
|
|
11
|
+
/** How far the row must travel for letting go to act. */
|
|
12
|
+
threshold: number;
|
|
13
|
+
/** Count the travel from where the swipe took the touch, so the row does not jump. */
|
|
14
|
+
isMeasuredFromStart?: boolean;
|
|
15
|
+
/** The farthest the row follows the finger. */
|
|
16
|
+
maxDistance?: number;
|
|
17
|
+
/** Worklet: the swipe took the touch. */
|
|
18
|
+
onActivate?: () => void;
|
|
19
|
+
/** Worklet: the row moved, `distance` along `sign`, before `offset` is written. */
|
|
20
|
+
onMove?: (distance: number) => void;
|
|
21
|
+
/** Worklet: the row crossed the threshold, either way. */
|
|
22
|
+
onThresholdChange?: (isPast: boolean) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Worklet: the finger lifted. A cancelled swipe reports neither past the threshold nor any
|
|
25
|
+
* velocity, so it only puts the row back. `velocity` is along `sign`. The row's `offset` is
|
|
26
|
+
* handed in rather than read from the hook's result, which a worklet created in the same call
|
|
27
|
+
* cannot capture yet.
|
|
28
|
+
*/
|
|
29
|
+
onRelease?: (isPast: boolean, velocity: number, offset: SharedValue<number>) => void;
|
|
30
|
+
/** Worklet: the swipe ended, however it ended; animate `offset` back here. */
|
|
31
|
+
onFinalize?: (offset: SharedValue<number>) => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A row that follows a sideways swipe and acts past a threshold: swipe-to-reply on a message,
|
|
35
|
+
* swipe-to-archive in the chat list. It owns the gesture, the row's offset and the threshold
|
|
36
|
+
* crossing; each caller draws its own action and decides how the row goes back.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useRowSwipe({ testID, isEnabled, sign, activeOffsetX, failOffsetY, threshold, isMeasuredFromStart, maxDistance, onActivate, onMove, onThresholdChange, onRelease, onFinalize, }: RowSwipeOptions): {
|
|
39
|
+
gesture: import("react-native-gesture-handler").PanGesture;
|
|
40
|
+
offset: SharedValue<number>;
|
|
41
|
+
isPast: SharedValue<boolean>;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=useRowSwipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRowSwipe.d.ts","sourceRoot":"","sources":["../../src/gestures/useRowSwipe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAkB,MAAM,yBAAyB,CAAA;AAErE,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,+DAA+D;IAC/D,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IACZ,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAA;IACrB,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAA;IACnB,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,mFAAmF;IACnF,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACpF,8EAA8E;IAC9E,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;CACnD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAE,EAC3B,MAAM,EACN,SAAS,EACT,IAAI,EACJ,aAAa,EACb,WAAW,EACX,SAAS,EACT,mBAA2B,EAC3B,WAAqC,EACrC,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,UAAU,GACX,EAAE,eAAe;;;;EAkDjB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { usePanGesture } from 'react-native-gesture-handler';
|
|
2
|
+
import { useSharedValue } from 'react-native-reanimated';
|
|
3
|
+
/**
|
|
4
|
+
* A row that follows a sideways swipe and acts past a threshold: swipe-to-reply on a message,
|
|
5
|
+
* swipe-to-archive in the chat list. It owns the gesture, the row's offset and the threshold
|
|
6
|
+
* crossing; each caller draws its own action and decides how the row goes back.
|
|
7
|
+
*/
|
|
8
|
+
export function useRowSwipe({
|
|
9
|
+
testID,
|
|
10
|
+
isEnabled,
|
|
11
|
+
sign,
|
|
12
|
+
activeOffsetX,
|
|
13
|
+
failOffsetY,
|
|
14
|
+
threshold,
|
|
15
|
+
isMeasuredFromStart = false,
|
|
16
|
+
maxDistance = Number.MAX_SAFE_INTEGER,
|
|
17
|
+
onActivate,
|
|
18
|
+
onMove,
|
|
19
|
+
onThresholdChange,
|
|
20
|
+
onRelease,
|
|
21
|
+
onFinalize
|
|
22
|
+
}) {
|
|
23
|
+
// The gesture's callbacks must stay inline in `usePanGesture`'s config: compiled, they are
|
|
24
|
+
// hoisted into memo blocks, where the worklets plugin no longer finds them, and the swipe runs
|
|
25
|
+
// nothing on the UI thread. The 'worklet' directives below say it outright as well.
|
|
26
|
+
'use no memo';
|
|
27
|
+
|
|
28
|
+
// The row's offset along the swipe, signed; callers animate it back.
|
|
29
|
+
const offset = useSharedValue(0);
|
|
30
|
+
const isPast = useSharedValue(false);
|
|
31
|
+
const gesture = usePanGesture({
|
|
32
|
+
testID,
|
|
33
|
+
enabled: isEnabled,
|
|
34
|
+
activeOffsetX: sign < 0 ? [-activeOffsetX, Number.MAX_SAFE_INTEGER] : [-Number.MAX_SAFE_INTEGER, activeOffsetX],
|
|
35
|
+
failOffsetY: [-failOffsetY, failOffsetY],
|
|
36
|
+
onActivate: () => {
|
|
37
|
+
'worklet';
|
|
38
|
+
|
|
39
|
+
onActivate?.();
|
|
40
|
+
},
|
|
41
|
+
onUpdate: event => {
|
|
42
|
+
'worklet';
|
|
43
|
+
|
|
44
|
+
const travelled = event.translationX * sign - (isMeasuredFromStart ? activeOffsetX : 0);
|
|
45
|
+
const distance = Math.min(maxDistance, Math.max(0, travelled));
|
|
46
|
+
onMove?.(distance);
|
|
47
|
+
offset.set(distance * sign);
|
|
48
|
+
|
|
49
|
+
// Only on a change: callers start animations and haptics here.
|
|
50
|
+
const past = distance >= threshold;
|
|
51
|
+
if (past !== isPast.get()) {
|
|
52
|
+
isPast.set(past);
|
|
53
|
+
onThresholdChange?.(past);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
onDeactivate: event_0 => {
|
|
57
|
+
'worklet';
|
|
58
|
+
|
|
59
|
+
onRelease?.(!event_0.canceled && isPast.get(), event_0.canceled ? 0 : event_0.velocityX * sign, offset);
|
|
60
|
+
},
|
|
61
|
+
onFinalize: () => {
|
|
62
|
+
'worklet';
|
|
63
|
+
|
|
64
|
+
onFinalize?.(offset);
|
|
65
|
+
isPast.set(false);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
gesture,
|
|
70
|
+
offset,
|
|
71
|
+
isPast
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=useRowSwipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRowSwipe.js","names":["usePanGesture","useSharedValue","useRowSwipe","testID","isEnabled","sign","activeOffsetX","failOffsetY","threshold","isMeasuredFromStart","maxDistance","Number","MAX_SAFE_INTEGER","onActivate","onMove","onThresholdChange","onRelease","onFinalize","offset","isPast","gesture","enabled","onUpdate","event","travelled","translationX","distance","Math","min","max","set","past","get","onDeactivate","canceled","velocityX"],"sources":["../../src/gestures/useRowSwipe.ts"],"sourcesContent":["import { usePanGesture } from 'react-native-gesture-handler'\nimport { SharedValue, useSharedValue } from 'react-native-reanimated'\n\nexport interface RowSwipeOptions {\n testID?: string\n isEnabled: boolean\n /** Which way the row moves: -1 to the left, 1 to the right. */\n sign: 1 | -1\n /** How far the finger goes sideways before the swipe takes the touch. */\n activeOffsetX: number\n /** How far it may go up or down first; past that the list scrolls instead. */\n failOffsetY: number\n /** How far the row must travel for letting go to act. */\n threshold: number\n /** Count the travel from where the swipe took the touch, so the row does not jump. */\n isMeasuredFromStart?: boolean\n /** The farthest the row follows the finger. */\n maxDistance?: number\n /** Worklet: the swipe took the touch. */\n onActivate?: () => void\n /** Worklet: the row moved, `distance` along `sign`, before `offset` is written. */\n onMove?: (distance: number) => void\n /** Worklet: the row crossed the threshold, either way. */\n onThresholdChange?: (isPast: boolean) => void\n /**\n * Worklet: the finger lifted. A cancelled swipe reports neither past the threshold nor any\n * velocity, so it only puts the row back. `velocity` is along `sign`. The row's `offset` is\n * handed in rather than read from the hook's result, which a worklet created in the same call\n * cannot capture yet.\n */\n onRelease?: (isPast: boolean, velocity: number, offset: SharedValue<number>) => void\n /** Worklet: the swipe ended, however it ended; animate `offset` back here. */\n onFinalize?: (offset: SharedValue<number>) => void\n}\n\n/**\n * A row that follows a sideways swipe and acts past a threshold: swipe-to-reply on a message,\n * swipe-to-archive in the chat list. It owns the gesture, the row's offset and the threshold\n * crossing; each caller draws its own action and decides how the row goes back.\n */\nexport function useRowSwipe ({\n testID,\n isEnabled,\n sign,\n activeOffsetX,\n failOffsetY,\n threshold,\n isMeasuredFromStart = false,\n maxDistance = Number.MAX_SAFE_INTEGER,\n onActivate,\n onMove,\n onThresholdChange,\n onRelease,\n onFinalize,\n}: RowSwipeOptions) {\n // The gesture's callbacks must stay inline in `usePanGesture`'s config: compiled, they are\n // hoisted into memo blocks, where the worklets plugin no longer finds them, and the swipe runs\n // nothing on the UI thread. The 'worklet' directives below say it outright as well.\n 'use no memo'\n // The row's offset along the swipe, signed; callers animate it back.\n const offset = useSharedValue(0)\n const isPast = useSharedValue(false)\n\n const gesture = usePanGesture({\n testID,\n enabled: isEnabled,\n activeOffsetX: sign < 0\n ? [-activeOffsetX, Number.MAX_SAFE_INTEGER]\n : [-Number.MAX_SAFE_INTEGER, activeOffsetX],\n failOffsetY: [-failOffsetY, failOffsetY],\n onActivate: () => {\n 'worklet'\n onActivate?.()\n },\n onUpdate: event => {\n 'worklet'\n const travelled = event.translationX * sign - (isMeasuredFromStart ? activeOffsetX : 0)\n const distance = Math.min(maxDistance, Math.max(0, travelled))\n onMove?.(distance)\n offset.set(distance * sign)\n\n // Only on a change: callers start animations and haptics here.\n const past = distance >= threshold\n if (past !== isPast.get()) {\n isPast.set(past)\n onThresholdChange?.(past)\n }\n },\n onDeactivate: event => {\n 'worklet'\n onRelease?.(\n !event.canceled && isPast.get(),\n event.canceled ? 0 : event.velocityX * sign,\n offset\n )\n },\n onFinalize: () => {\n 'worklet'\n onFinalize?.(offset)\n isPast.set(false)\n },\n })\n\n return { gesture, offset, isPast }\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAAsBC,cAAc,QAAQ,yBAAyB;AAkCrE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAE;EAC3BC,MAAM;EACNC,SAAS;EACTC,IAAI;EACJC,aAAa;EACbC,WAAW;EACXC,SAAS;EACTC,mBAAmB,GAAG,KAAK;EAC3BC,WAAW,GAAGC,MAAM,CAACC,gBAAgB;EACrCC,UAAU;EACVC,MAAM;EACNC,iBAAiB;EACjBC,SAAS;EACTC;AACe,CAAC,EAAE;EAClB;EACA;EACA;EACA,aAAa;;EACb;EACA,MAAMC,MAAM,GAAGjB,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMkB,MAAM,GAAGlB,cAAc,CAAC,KAAK,CAAC;EAEpC,MAAMmB,OAAO,GAAGpB,aAAa,CAAC;IAC5BG,MAAM;IACNkB,OAAO,EAAEjB,SAAS;IAClBE,aAAa,EAAED,IAAI,GAAG,CAAC,GACnB,CAAC,CAACC,aAAa,EAAEK,MAAM,CAACC,gBAAgB,CAAC,GACzC,CAAC,CAACD,MAAM,CAACC,gBAAgB,EAAEN,aAAa,CAAC;IAC7CC,WAAW,EAAE,CAAC,CAACA,WAAW,EAAEA,WAAW,CAAC;IACxCM,UAAU,EAAEA,CAAA,KAAM;MAChB,SAAS;;MACTA,UAAU,GAAG,CAAC;IAChB,CAAC;IACDS,QAAQ,EAAEC,KAAK,IAAI;MACjB,SAAS;;MACT,MAAMC,SAAS,GAAGD,KAAK,CAACE,YAAY,GAAGpB,IAAI,IAAII,mBAAmB,GAAGH,aAAa,GAAG,CAAC,CAAC;MACvF,MAAMoB,QAAQ,GAAGC,IAAI,CAACC,GAAG,CAAClB,WAAW,EAAEiB,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEL,SAAS,CAAC,CAAC;MAC9DV,MAAM,GAAGY,QAAQ,CAAC;MAClBR,MAAM,CAACY,GAAG,CAACJ,QAAQ,GAAGrB,IAAI,CAAC;;MAE3B;MACA,MAAM0B,IAAI,GAAGL,QAAQ,IAAIlB,SAAS;MAClC,IAAIuB,IAAI,KAAKZ,MAAM,CAACa,GAAG,CAAC,CAAC,EAAE;QACzBb,MAAM,CAACW,GAAG,CAACC,IAAI,CAAC;QAChBhB,iBAAiB,GAAGgB,IAAI,CAAC;MAC3B;IACF,CAAC;IACDE,YAAY,EAAEV,OAAK,IAAI;MACrB,SAAS;;MACTP,SAAS,GACP,CAACO,OAAK,CAACW,QAAQ,IAAIf,MAAM,CAACa,GAAG,CAAC,CAAC,EAC/BT,OAAK,CAACW,QAAQ,GAAG,CAAC,GAAGX,OAAK,CAACY,SAAS,GAAG9B,IAAI,EAC3Ca,MACF,CAAC;IACH,CAAC;IACDD,UAAU,EAAEA,CAAA,KAAM;MAChB,SAAS;;MACTA,UAAU,GAAGC,MAAM,CAAC;MACpBC,MAAM,CAACW,GAAG,CAAC,KAAK,CAAC;IACnB;EACF,CAAC,CAAC;EAEF,OAAO;IAAEV,OAAO;IAAEF,MAAM;IAAEC;EAAO,CAAC;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps an overlay mounted for its exit animation.
|
|
3
|
+
*
|
|
4
|
+
* A native `Modal` fade ends the moment `visible` turns false, so a Reanimated
|
|
5
|
+
* exit needs the overlay to outlive that flag. `isMounted` turns true with
|
|
6
|
+
* `visible` and only turns false once `animateOut` reports it has finished.
|
|
7
|
+
*
|
|
8
|
+
* `close(after)` is for exits the overlay starts itself (backdrop tap, a picked
|
|
9
|
+
* item): it plays the exit first and calls `after` - usually the consumer's
|
|
10
|
+
* `onDismiss` - once the overlay is gone, so the callback never cuts the
|
|
11
|
+
* animation short. A second call while closing is ignored, which also absorbs
|
|
12
|
+
* the `visible = false` that `after` typically causes.
|
|
13
|
+
*
|
|
14
|
+
* `animateOut` must call `onDone` from its animation's completion callback
|
|
15
|
+
* (through `runOnJS`) and only when the animation finished, so a reopen that
|
|
16
|
+
* interrupts it does not unmount the overlay.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useAnimatedPresence: (visible: boolean, animateIn: () => void, animateOut: (onDone: () => void) => void) => {
|
|
19
|
+
isMounted: boolean;
|
|
20
|
+
close: (after?: () => void) => void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useAnimatedPresence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimatedPresence.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnimatedPresence.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,OAAO,EAChB,WAAW,MAAM,IAAI,EACrB,YAAY,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK,IAAI;;oBAqBL,MAAM,IAAI;CAqB9C,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Keeps an overlay mounted for its exit animation.
|
|
6
|
+
*
|
|
7
|
+
* A native `Modal` fade ends the moment `visible` turns false, so a Reanimated
|
|
8
|
+
* exit needs the overlay to outlive that flag. `isMounted` turns true with
|
|
9
|
+
* `visible` and only turns false once `animateOut` reports it has finished.
|
|
10
|
+
*
|
|
11
|
+
* `close(after)` is for exits the overlay starts itself (backdrop tap, a picked
|
|
12
|
+
* item): it plays the exit first and calls `after` - usually the consumer's
|
|
13
|
+
* `onDismiss` - once the overlay is gone, so the callback never cuts the
|
|
14
|
+
* animation short. A second call while closing is ignored, which also absorbs
|
|
15
|
+
* the `visible = false` that `after` typically causes.
|
|
16
|
+
*
|
|
17
|
+
* `animateOut` must call `onDone` from its animation's completion callback
|
|
18
|
+
* (through `runOnJS`) and only when the animation finished, so a reopen that
|
|
19
|
+
* interrupts it does not unmount the overlay.
|
|
20
|
+
*/
|
|
21
|
+
export const useAnimatedPresence = (visible, animateIn, animateOut) => {
|
|
22
|
+
const $ = _c(9);
|
|
23
|
+
const [isMounted, setIsMounted] = useState(visible);
|
|
24
|
+
const [wasVisible, setWasVisible] = useState(visible);
|
|
25
|
+
if (visible !== wasVisible) {
|
|
26
|
+
setWasVisible(visible);
|
|
27
|
+
if (visible) {
|
|
28
|
+
setIsMounted(true);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const isOpenRef = useRef(false);
|
|
32
|
+
const animateInRef = useRef(animateIn);
|
|
33
|
+
const animateOutRef = useRef(animateOut);
|
|
34
|
+
let t0;
|
|
35
|
+
if ($[0] !== animateIn || $[1] !== animateOut) {
|
|
36
|
+
t0 = () => {
|
|
37
|
+
animateInRef.current = animateIn;
|
|
38
|
+
animateOutRef.current = animateOut;
|
|
39
|
+
};
|
|
40
|
+
$[0] = animateIn;
|
|
41
|
+
$[1] = animateOut;
|
|
42
|
+
$[2] = t0;
|
|
43
|
+
} else {
|
|
44
|
+
t0 = $[2];
|
|
45
|
+
}
|
|
46
|
+
useLayoutEffect(t0);
|
|
47
|
+
let t1;
|
|
48
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
49
|
+
t1 = after => {
|
|
50
|
+
if (!isOpenRef.current) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
isOpenRef.current = false;
|
|
54
|
+
animateOutRef.current(() => {
|
|
55
|
+
setIsMounted(false);
|
|
56
|
+
after?.();
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
$[3] = t1;
|
|
60
|
+
} else {
|
|
61
|
+
t1 = $[3];
|
|
62
|
+
}
|
|
63
|
+
const close = t1;
|
|
64
|
+
let t2;
|
|
65
|
+
let t3;
|
|
66
|
+
if ($[4] !== visible) {
|
|
67
|
+
t2 = () => {
|
|
68
|
+
if (visible) {
|
|
69
|
+
isOpenRef.current = true;
|
|
70
|
+
animateInRef.current();
|
|
71
|
+
} else {
|
|
72
|
+
close();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
t3 = [visible, close];
|
|
76
|
+
$[4] = visible;
|
|
77
|
+
$[5] = t2;
|
|
78
|
+
$[6] = t3;
|
|
79
|
+
} else {
|
|
80
|
+
t2 = $[5];
|
|
81
|
+
t3 = $[6];
|
|
82
|
+
}
|
|
83
|
+
useEffect(t2, t3);
|
|
84
|
+
let t4;
|
|
85
|
+
if ($[7] !== isMounted) {
|
|
86
|
+
t4 = {
|
|
87
|
+
isMounted,
|
|
88
|
+
close
|
|
89
|
+
};
|
|
90
|
+
$[7] = isMounted;
|
|
91
|
+
$[8] = t4;
|
|
92
|
+
} else {
|
|
93
|
+
t4 = $[8];
|
|
94
|
+
}
|
|
95
|
+
return t4;
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=useAnimatedPresence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimatedPresence.js","names":["useCallback","useEffect","useLayoutEffect","useRef","useState","useAnimatedPresence","visible","animateIn","animateOut","$","_c","isMounted","setIsMounted","wasVisible","setWasVisible","isOpenRef","animateInRef","animateOutRef","t0","current","t1","Symbol","for","after","close","t2","t3","t4"],"sources":["../../src/hooks/useAnimatedPresence.ts"],"sourcesContent":["import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\n\n/**\n * Keeps an overlay mounted for its exit animation.\n *\n * A native `Modal` fade ends the moment `visible` turns false, so a Reanimated\n * exit needs the overlay to outlive that flag. `isMounted` turns true with\n * `visible` and only turns false once `animateOut` reports it has finished.\n *\n * `close(after)` is for exits the overlay starts itself (backdrop tap, a picked\n * item): it plays the exit first and calls `after` - usually the consumer's\n * `onDismiss` - once the overlay is gone, so the callback never cuts the\n * animation short. A second call while closing is ignored, which also absorbs\n * the `visible = false` that `after` typically causes.\n *\n * `animateOut` must call `onDone` from its animation's completion callback\n * (through `runOnJS`) and only when the animation finished, so a reopen that\n * interrupts it does not unmount the overlay.\n */\nexport const useAnimatedPresence = (\n visible: boolean,\n animateIn: () => void,\n animateOut: (onDone: () => void) => void\n) => {\n const [isMounted, setIsMounted] = useState(visible)\n const [wasVisible, setWasVisible] = useState(visible)\n\n // Mount in the same render that `visible` turns true, so the first frame the\n // overlay paints is already the start of its entrance.\n if (visible !== wasVisible) {\n setWasVisible(visible)\n if (visible)\n setIsMounted(true)\n }\n\n const isOpenRef = useRef(false)\n const animateInRef = useRef(animateIn)\n const animateOutRef = useRef(animateOut)\n useLayoutEffect(() => {\n animateInRef.current = animateIn\n animateOutRef.current = animateOut\n })\n\n const close = useCallback((after?: () => void) => {\n if (!isOpenRef.current)\n return\n\n isOpenRef.current = false\n animateOutRef.current(() => {\n setIsMounted(false)\n after?.()\n })\n }, [])\n\n useEffect(() => {\n if (visible) {\n isOpenRef.current = true\n animateInRef.current()\n } else {\n close()\n }\n }, [visible, close])\n\n return { isMounted, close }\n}\n"],"mappings":";AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAGA,CAAAC,OAAA,EAAAC,SAAA,EAAAC,UAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAKjC,OAAAC,SAAA,EAAAC,YAAA,IAAkCR,QAAQ,CAACE,OAAO,CAAC;EACnD,OAAAO,UAAA,EAAAC,aAAA,IAAoCV,QAAQ,CAACE,OAAO,CAAC;EAIrD,IAAIA,OAAO,KAAKO,UAAU;IACxBC,aAAa,CAACR,OAAO,CAAC;IACtB,IAAIA,OAAO;MACTM,YAAY,CAAC,IAAI,CAAC;IAAA;EAAA;EAGtB,MAAAG,SAAA,GAAkBZ,MAAM,CAAC,KAAK,CAAC;EAC/B,MAAAa,YAAA,GAAqBb,MAAM,CAACI,SAAS,CAAC;EACtC,MAAAU,aAAA,GAAsBd,MAAM,CAACK,UAAU,CAAC;EAAA,IAAAU,EAAA;EAAA,IAAAT,CAAA,QAAAF,SAAA,IAAAE,CAAA,QAAAD,UAAA;IACxBU,EAAA,GAAAA,CAAA;MACdF,YAAY,CAAAG,OAAA,GAAWZ,SAAH;MACpBU,aAAa,CAAAE,OAAA,GAAWX,UAAH;IAAA,CACtB;IAAAC,CAAA,MAAAF,SAAA;IAAAE,CAAA,MAAAD,UAAA;IAAAC,CAAA,MAAAS,EAAA;EAAA;IAAAA,EAAA,GAAAT,CAAA;EAAA;EAHDP,eAAe,CAACgB,EAGf,CAAC;EAAA,IAAAE,EAAA;EAAA,IAAAX,CAAA,QAAAY,MAAA,CAAAC,GAAA;IAEwBF,EAAA,GAAAG,KAAA;MACxB,IAAI,CAACR,SAAS,CAAAI,OAAQ;QAAA;MAAA;MAGtBJ,SAAS,CAAAI,OAAA,GAAW,KAAH;MACjBF,aAAa,CAAAE,OAAQ,CAAC;QACpBP,YAAY,CAAC,KAAK,CAAC;QACnBW,KAAK,GAAG,CAAC;MAAA,CACV,CAAC;IAAA,CACH;IAAAd,CAAA,MAAAW,EAAA;EAAA;IAAAA,EAAA,GAAAX,CAAA;EAAA;EATD,MAAAe,KAAA,GAAcJ,EASR;EAAA,IAAAK,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAjB,CAAA,QAAAH,OAAA;IAEImB,EAAA,GAAAA,CAAA;MACR,IAAInB,OAAO;QACTS,SAAS,CAAAI,OAAA,GAAW,IAAH;QACjBH,YAAY,CAAAG,OAAQ,CAAC,CAAC;MAAA;QAEtBK,KAAK,CAAC,CAAC;MAAA;IACR,CACF;IAAEE,EAAA,IAACpB,OAAO,EAAEkB,KAAK,CAAC;IAAAf,CAAA,MAAAH,OAAA;IAAAG,CAAA,MAAAgB,EAAA;IAAAhB,CAAA,MAAAiB,EAAA;EAAA;IAAAD,EAAA,GAAAhB,CAAA;IAAAiB,EAAA,GAAAjB,CAAA;EAAA;EAPnBR,SAAS,CAACwB,EAOT,EAAEC,EAAgB,CAAC;EAAA,IAAAC,EAAA;EAAA,IAAAlB,CAAA,QAAAE,SAAA;IAEbgB,EAAA;MAAAhB,SAAA;MAAAa;IAAmB,CAAC;IAAAf,CAAA,MAAAE,SAAA;IAAAF,CAAA,MAAAkB,EAAA;EAAA;IAAAA,EAAA,GAAAlB,CAAA;EAAA;EAAA,OAApBkB,EAAoB;AAAA,CAC5B","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IMessage, User } from '../Models';
|
|
2
|
+
export interface UseChatMessagesOptions<TMessage extends IMessage> {
|
|
3
|
+
/** Messages to start with, newest first (the default `isInverted` order). */
|
|
4
|
+
initialMessages?: TMessage[];
|
|
5
|
+
/** The current user; reactions are toggled for them. */
|
|
6
|
+
user: User;
|
|
7
|
+
/** Match `Chat`'s `isInverted`; default true. */
|
|
8
|
+
isInverted?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseChatMessagesResult<TMessage extends IMessage> {
|
|
11
|
+
messages: TMessage[];
|
|
12
|
+
setMessages: React.Dispatch<React.SetStateAction<TMessage[]>>;
|
|
13
|
+
/**
|
|
14
|
+
* Spread onto `<Chat />`: messages, user, and local handlers for sending, reactions,
|
|
15
|
+
* editing and deleting. Pass your own prop after the spread to replace any of them.
|
|
16
|
+
*/
|
|
17
|
+
chatProps: {
|
|
18
|
+
messages: TMessage[];
|
|
19
|
+
user: User;
|
|
20
|
+
onSend: (messages: TMessage[]) => void;
|
|
21
|
+
onEditMessage: (message: TMessage, text: string) => void;
|
|
22
|
+
onDeleteMessage: (message: TMessage) => void;
|
|
23
|
+
reactions: {
|
|
24
|
+
onReactionPress: (message: TMessage, emoji: string) => void;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Local message state wired to every built-in feature, for prototypes and demos:
|
|
30
|
+
*
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const { chatProps } = useChatMessages({ initialMessages, user })
|
|
33
|
+
* return <Chat {...chatProps} />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* Nothing leaves the device; a real app replaces the handlers with calls to its backend.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useChatMessages<TMessage extends IMessage = IMessage>({ initialMessages, user, isInverted, }: UseChatMessagesOptions<TMessage>): UseChatMessagesResult<TMessage>;
|
|
39
|
+
//# sourceMappingURL=useChatMessages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChatMessages.d.ts","sourceRoot":"","sources":["../../src/hooks/useChatMessages.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,WAAW,sBAAsB,CAAC,QAAQ,SAAS,QAAQ;IAC/D,6EAA6E;IAC7E,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAA;IAC5B,wDAAwD;IACxD,IAAI,EAAE,IAAI,CAAA;IACV,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,qBAAqB,CAAC,QAAQ,SAAS,QAAQ;IAC9D,QAAQ,EAAE,QAAQ,EAAE,CAAA;IACpB,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IAC7D;;;OAGG;IACH,SAAS,EAAE;QACT,QAAQ,EAAE,QAAQ,EAAE,CAAA;QACpB,IAAI,EAAE,IAAI,CAAA;QACV,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAA;QACtC,aAAa,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;QACxD,eAAe,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAA;QAC5C,SAAS,EAAE;YAAE,eAAe,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;SAAE,CAAA;KAC3E,CAAA;CACF;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAG,EACrE,eAAoB,EACpB,IAAI,EACJ,UAAiB,GAClB,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAgCpE"}
|