@kesha-antonov/react-native-chat 5.0.1 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +486 -179
- 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,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry and formatting shared by the voice-note players.
|
|
3
|
+
*/
|
|
4
|
+
/** The play/pause circle is 44x44. */
|
|
5
|
+
export declare const VOICE_BUTTON_SIZE = 44;
|
|
6
|
+
/** The waveform area is 30 tall. */
|
|
7
|
+
export declare const WAVEFORM_HEIGHT = 30;
|
|
8
|
+
/** Each bar is a 2-wide stroke, one every 3, so a 1 gap. */
|
|
9
|
+
export declare const BAR_WIDTH = 2;
|
|
10
|
+
export declare const BAR_STEP = 3;
|
|
11
|
+
/** Waveform levels are 5-bit samples. */
|
|
12
|
+
export declare const LEVEL_MAX = 31;
|
|
13
|
+
/** A full-level bar reaches 7 either side of the centre line. */
|
|
14
|
+
export declare const BAR_HALF_MAX = 7;
|
|
15
|
+
/** A 0.2cm drag slop, in points. */
|
|
16
|
+
export declare const DRAG_SLOP = 8;
|
|
17
|
+
/** Gap between the button and the waveform/time column. */
|
|
18
|
+
export declare const VOICE_COLUMN_GAP = 10;
|
|
19
|
+
/** Bubble content width before the time label is added (`174 + timeWidth`). */
|
|
20
|
+
export declare const VOICE_BASE_WIDTH = 174;
|
|
21
|
+
export declare const VOICE_TIME_FONT_SIZE = 12;
|
|
22
|
+
/**
|
|
23
|
+
* Space above and below the button. A voice cell is 70 tall with the button
|
|
24
|
+
* 44 across, 13 from the top, which leaves about 12 inside the bubble on
|
|
25
|
+
* either side once its 1dp outer margins are taken off.
|
|
26
|
+
*/
|
|
27
|
+
export declare const VOICE_ROW_PADDING_V = 12;
|
|
28
|
+
/**
|
|
29
|
+
* A voice bubble is widened by the message's own time as well
|
|
30
|
+
* (174 + time width + duration width), since the
|
|
31
|
+
* time shares the duration's line at the bubble's bottom-right. `timeWidth`
|
|
32
|
+
* is the `h:mm a` label, plus 20dp for the ticks on an outgoing note.
|
|
33
|
+
*/
|
|
34
|
+
export declare const VOICE_META_WIDTH = 48;
|
|
35
|
+
export declare const VOICE_META_TICKS_WIDTH = 20;
|
|
36
|
+
/**
|
|
37
|
+
* Height the bubble's time takes below content it cannot sit beside - an
|
|
38
|
+
* open transcription, or the fallback card - so it never covers it.
|
|
39
|
+
*/
|
|
40
|
+
export declare const VOICE_META_HEIGHT = 20;
|
|
41
|
+
/**
|
|
42
|
+
* Zero-padded `00:12`, and `h:mm:ss` once a
|
|
43
|
+
* note runs past an hour.
|
|
44
|
+
*/
|
|
45
|
+
export declare const formatVoiceDuration: (seconds: number) => string;
|
|
46
|
+
/**
|
|
47
|
+
* Width the time label takes, estimated from the string rather than measured:
|
|
48
|
+
* the label changes every second while playing, and measuring it would re-lay
|
|
49
|
+
* the bubble out on each tick. Digits are tabular, so the estimate holds.
|
|
50
|
+
*/
|
|
51
|
+
export declare const estimateTimeWidth: (label: string) => number;
|
|
52
|
+
/**
|
|
53
|
+
* A voice bubble is sized from a constant plus the time labels, not
|
|
54
|
+
* from the note's length, so a 2s and a 2min note are equally wide.
|
|
55
|
+
*/
|
|
56
|
+
export declare const voiceContentWidth: (durationSeconds: number, isOutgoing?: boolean) => number;
|
|
57
|
+
/**
|
|
58
|
+
* The transcribe button: a 30x24 rounded rect, radius 8, and the
|
|
59
|
+
* waveform gives up 34 of its width to it - the bubble itself stays as wide.
|
|
60
|
+
*/
|
|
61
|
+
export declare const TRANSCRIBE_BUTTON_WIDTH = 30;
|
|
62
|
+
export declare const TRANSCRIBE_BUTTON_HEIGHT = 24;
|
|
63
|
+
export declare const TRANSCRIBE_BUTTON_RADIUS = 8;
|
|
64
|
+
export declare const TRANSCRIBE_SLOT_WIDTH = 34;
|
|
65
|
+
/**
|
|
66
|
+
* Width left for the waveform inside a voice bubble of `contentWidth`, after
|
|
67
|
+
* the row padding, the play button, the gap and, when shown, the transcribe
|
|
68
|
+
* button's slot.
|
|
69
|
+
*/
|
|
70
|
+
export declare const voiceTrackWidth: (contentWidth: number, rowPaddingH: number, hasTranscribeButton: boolean) => number;
|
|
71
|
+
/**
|
|
72
|
+
* Where the view-once badge sits: centred 22.6274
|
|
73
|
+
* from the play button's centre at 45 degrees, i.e. 16 right and 16 down, a
|
|
74
|
+
* 10-radius disc with a 1.5 ring cut out of the button around it, holding a
|
|
75
|
+
* 14-across "1".
|
|
76
|
+
*/
|
|
77
|
+
export declare const VIEW_ONCE_BADGE_OFFSET = 16;
|
|
78
|
+
export declare const VIEW_ONCE_BADGE_SIZE = 20;
|
|
79
|
+
export declare const VIEW_ONCE_BADGE_CUT = 1.5;
|
|
80
|
+
export declare const VIEW_ONCE_RING_SIZE = 14;
|
|
81
|
+
/** One bar per 3 points of track. */
|
|
82
|
+
export declare const barCountForWidth: (width: number) => number;
|
|
83
|
+
/**
|
|
84
|
+
* Bar height for a level in 0..1. Quantised to 5-bit 0..31, scaled
|
|
85
|
+
* to 0..7 each side of the centre line, plus the 1-point round caps, so a bar
|
|
86
|
+
* runs 2..16 tall. The loudest bar is deliberately not stretched to the full
|
|
87
|
+
* area: no normalising, so a quiet note looks quiet.
|
|
88
|
+
*/
|
|
89
|
+
export declare const barHeight: (level: number) => number;
|
|
90
|
+
/**
|
|
91
|
+
* Buckets decoded samples into `count` levels in 0..1, using each bucket's
|
|
92
|
+
* peak amplitude. Levels are absolute (0..1 of full scale), never rescaled
|
|
93
|
+
* against the loudest bucket.
|
|
94
|
+
*/
|
|
95
|
+
export declare const levelsFromSamples: (data: ArrayLike<number>, count: number) => number[];
|
|
96
|
+
/**
|
|
97
|
+
* `IMessage.waveform` resampled to `count` bars: levels in 0..1, or 5-bit 0..31
|
|
98
|
+
* values (read on that scale when any is above 1).
|
|
99
|
+
*/
|
|
100
|
+
export declare const levelsFromWaveform: (waveform: ArrayLike<number> | undefined, count: number) => number[];
|
|
101
|
+
/**
|
|
102
|
+
* The bar-growth animation runs only on a note that has
|
|
103
|
+
* just been sent from this device. We approximate "just sent" as an outgoing
|
|
104
|
+
* message created in the last couple of seconds.
|
|
105
|
+
*/
|
|
106
|
+
export declare const FRESH_NOTE_MS = 2000;
|
|
107
|
+
export declare const isFreshOutgoingNote: (position: "left" | "right", createdAt: Date | number | undefined, now?: number) => boolean;
|
|
108
|
+
//# sourceMappingURL=voiceWaveform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceWaveform.d.ts","sourceRoot":"","sources":["../../src/components/voiceWaveform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,sCAAsC;AACtC,eAAO,MAAM,iBAAiB,KAAK,CAAA;AACnC,oCAAoC;AACpC,eAAO,MAAM,eAAe,KAAK,CAAA;AACjC,4DAA4D;AAC5D,eAAO,MAAM,SAAS,IAAI,CAAA;AAC1B,eAAO,MAAM,QAAQ,IAAI,CAAA;AACzB,yCAAyC;AACzC,eAAO,MAAM,SAAS,KAAK,CAAA;AAC3B,iEAAiE;AACjE,eAAO,MAAM,YAAY,IAAI,CAAA;AAC7B,oCAAoC;AACpC,eAAO,MAAM,SAAS,IAAI,CAAA;AAC1B,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,MAAM,CAAA;AACnC,eAAO,MAAM,oBAAoB,KAAK,CAAA;AACtC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,eAAO,MAAM,sBAAsB,KAAK,CAAA;AACxC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,WAOlD,CAAA;AAED;;;;GAIG;AACH,eAA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4
|
+
|
|
5
|
+
/** The play/pause circle is 44x44. */
|
|
6
|
+
export const VOICE_BUTTON_SIZE = 44;
|
|
7
|
+
/** The waveform area is 30 tall. */
|
|
8
|
+
export const WAVEFORM_HEIGHT = 30;
|
|
9
|
+
/** Each bar is a 2-wide stroke, one every 3, so a 1 gap. */
|
|
10
|
+
export const BAR_WIDTH = 2;
|
|
11
|
+
export const BAR_STEP = 3;
|
|
12
|
+
/** Waveform levels are 5-bit samples. */
|
|
13
|
+
export const LEVEL_MAX = 31;
|
|
14
|
+
/** A full-level bar reaches 7 either side of the centre line. */
|
|
15
|
+
export const BAR_HALF_MAX = 7;
|
|
16
|
+
/** A 0.2cm drag slop, in points. */
|
|
17
|
+
export const DRAG_SLOP = 8;
|
|
18
|
+
/** Gap between the button and the waveform/time column. */
|
|
19
|
+
export const VOICE_COLUMN_GAP = 10;
|
|
20
|
+
/** Bubble content width before the time label is added (`174 + timeWidth`). */
|
|
21
|
+
export const VOICE_BASE_WIDTH = 174;
|
|
22
|
+
export const VOICE_TIME_FONT_SIZE = 12;
|
|
23
|
+
/**
|
|
24
|
+
* Space above and below the button. A voice cell is 70 tall with the button
|
|
25
|
+
* 44 across, 13 from the top, which leaves about 12 inside the bubble on
|
|
26
|
+
* either side once its 1dp outer margins are taken off.
|
|
27
|
+
*/
|
|
28
|
+
export const VOICE_ROW_PADDING_V = 12;
|
|
29
|
+
/**
|
|
30
|
+
* A voice bubble is widened by the message's own time as well
|
|
31
|
+
* (174 + time width + duration width), since the
|
|
32
|
+
* time shares the duration's line at the bubble's bottom-right. `timeWidth`
|
|
33
|
+
* is the `h:mm a` label, plus 20dp for the ticks on an outgoing note.
|
|
34
|
+
*/
|
|
35
|
+
export const VOICE_META_WIDTH = 48;
|
|
36
|
+
export const VOICE_META_TICKS_WIDTH = 20;
|
|
37
|
+
/**
|
|
38
|
+
* Height the bubble's time takes below content it cannot sit beside - an
|
|
39
|
+
* open transcription, or the fallback card - so it never covers it.
|
|
40
|
+
*/
|
|
41
|
+
export const VOICE_META_HEIGHT = 20;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Zero-padded `00:12`, and `h:mm:ss` once a
|
|
45
|
+
* note runs past an hour.
|
|
46
|
+
*/
|
|
47
|
+
export const formatVoiceDuration = seconds => {
|
|
48
|
+
const total = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;
|
|
49
|
+
const h = Math.floor(total / 3600);
|
|
50
|
+
const m = Math.floor(total / 60) % 60;
|
|
51
|
+
const s = total % 60;
|
|
52
|
+
const pad = n => n.toString().padStart(2, '0');
|
|
53
|
+
return h > 0 ? `${h}:${pad(m)}:${pad(s)}` : `${pad(m)}:${pad(s)}`;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Width the time label takes, estimated from the string rather than measured:
|
|
58
|
+
* the label changes every second while playing, and measuring it would re-lay
|
|
59
|
+
* the bubble out on each tick. Digits are tabular, so the estimate holds.
|
|
60
|
+
*/
|
|
61
|
+
export const estimateTimeWidth = label => Math.ceil(label.length * VOICE_TIME_FONT_SIZE * 0.6);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A voice bubble is sized from a constant plus the time labels, not
|
|
65
|
+
* from the note's length, so a 2s and a 2min note are equally wide.
|
|
66
|
+
*/
|
|
67
|
+
export const voiceContentWidth = (durationSeconds, isOutgoing = false) => VOICE_BASE_WIDTH + estimateTimeWidth(formatVoiceDuration(durationSeconds)) + VOICE_META_WIDTH + (isOutgoing ? VOICE_META_TICKS_WIDTH : 0);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The transcribe button: a 30x24 rounded rect, radius 8, and the
|
|
71
|
+
* waveform gives up 34 of its width to it - the bubble itself stays as wide.
|
|
72
|
+
*/
|
|
73
|
+
export const TRANSCRIBE_BUTTON_WIDTH = 30;
|
|
74
|
+
export const TRANSCRIBE_BUTTON_HEIGHT = 24;
|
|
75
|
+
export const TRANSCRIBE_BUTTON_RADIUS = 8;
|
|
76
|
+
export const TRANSCRIBE_SLOT_WIDTH = 34;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Width left for the waveform inside a voice bubble of `contentWidth`, after
|
|
80
|
+
* the row padding, the play button, the gap and, when shown, the transcribe
|
|
81
|
+
* button's slot.
|
|
82
|
+
*/
|
|
83
|
+
export const voiceTrackWidth = (contentWidth, rowPaddingH, hasTranscribeButton) => Math.max(0, contentWidth - 2 * rowPaddingH - VOICE_BUTTON_SIZE - VOICE_COLUMN_GAP - (hasTranscribeButton ? TRANSCRIBE_SLOT_WIDTH : 0));
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Where the view-once badge sits: centred 22.6274
|
|
87
|
+
* from the play button's centre at 45 degrees, i.e. 16 right and 16 down, a
|
|
88
|
+
* 10-radius disc with a 1.5 ring cut out of the button around it, holding a
|
|
89
|
+
* 14-across "1".
|
|
90
|
+
*/
|
|
91
|
+
export const VIEW_ONCE_BADGE_OFFSET = 16;
|
|
92
|
+
export const VIEW_ONCE_BADGE_SIZE = 20;
|
|
93
|
+
export const VIEW_ONCE_BADGE_CUT = 1.5;
|
|
94
|
+
export const VIEW_ONCE_RING_SIZE = 14;
|
|
95
|
+
|
|
96
|
+
/** One bar per 3 points of track. */
|
|
97
|
+
export const barCountForWidth = width => width > 0 ? Math.max(1, Math.floor((width + (BAR_STEP - BAR_WIDTH)) / BAR_STEP)) : 0;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Bar height for a level in 0..1. Quantised to 5-bit 0..31, scaled
|
|
101
|
+
* to 0..7 each side of the centre line, plus the 1-point round caps, so a bar
|
|
102
|
+
* runs 2..16 tall. The loudest bar is deliberately not stretched to the full
|
|
103
|
+
* area: no normalising, so a quiet note looks quiet.
|
|
104
|
+
*/
|
|
105
|
+
export const barHeight = level => {
|
|
106
|
+
const clamped = Number.isFinite(level) ? Math.max(0, Math.min(1, level)) : 0;
|
|
107
|
+
const quantised = Math.round(clamped * LEVEL_MAX);
|
|
108
|
+
const half = BAR_HALF_MAX * quantised / LEVEL_MAX;
|
|
109
|
+
return half * 2 + BAR_WIDTH;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Buckets decoded samples into `count` levels in 0..1, using each bucket's
|
|
114
|
+
* peak amplitude. Levels are absolute (0..1 of full scale), never rescaled
|
|
115
|
+
* against the loudest bucket.
|
|
116
|
+
*/
|
|
117
|
+
export const levelsFromSamples = (data, count) => {
|
|
118
|
+
if (count <= 0 || !data.length) return [];
|
|
119
|
+
const block = data.length / count;
|
|
120
|
+
const out = [];
|
|
121
|
+
for (let i = 0; i < count; i++) {
|
|
122
|
+
const start = Math.floor(i * block);
|
|
123
|
+
const end = Math.max(start + 1, Math.floor((i + 1) * block));
|
|
124
|
+
let peak = 0;
|
|
125
|
+
for (let j = start; j < end && j < data.length; j++) {
|
|
126
|
+
const v = Math.abs(data[j] || 0);
|
|
127
|
+
if (v > peak) peak = v;
|
|
128
|
+
}
|
|
129
|
+
out.push(Math.min(1, peak));
|
|
130
|
+
}
|
|
131
|
+
return out;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* `IMessage.waveform` resampled to `count` bars: levels in 0..1, or 5-bit 0..31
|
|
136
|
+
* values (read on that scale when any is above 1).
|
|
137
|
+
*/
|
|
138
|
+
export const levelsFromWaveform = (waveform, count) => {
|
|
139
|
+
if (!waveform?.length || count <= 0) return [];
|
|
140
|
+
let max = 0;
|
|
141
|
+
for (let i = 0; i < waveform.length; i++) max = Math.max(max, waveform[i] || 0);
|
|
142
|
+
const scale = max > 1 ? LEVEL_MAX : 1;
|
|
143
|
+
const normalized = Array.from(waveform, value => Math.max(0, (value || 0) / scale));
|
|
144
|
+
if (normalized.length >= count) return levelsFromSamples(normalized, count);
|
|
145
|
+
|
|
146
|
+
// Fewer values than bars: each value covers several bars.
|
|
147
|
+
return Array.from({
|
|
148
|
+
length: count
|
|
149
|
+
}, (_, i) => Math.min(1, normalized[Math.floor(i * normalized.length / count)]));
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The bar-growth animation runs only on a note that has
|
|
154
|
+
* just been sent from this device. We approximate "just sent" as an outgoing
|
|
155
|
+
* message created in the last couple of seconds.
|
|
156
|
+
*/
|
|
157
|
+
export const FRESH_NOTE_MS = 2000;
|
|
158
|
+
export const isFreshOutgoingNote = (position, createdAt, now = Date.now()) => {
|
|
159
|
+
if (position !== 'right' || createdAt == null) return false;
|
|
160
|
+
const created = typeof createdAt === 'number' ? createdAt : createdAt.getTime?.();
|
|
161
|
+
if (created == null || !Number.isFinite(created)) return false;
|
|
162
|
+
const age = now - created;
|
|
163
|
+
return age >= -FRESH_NOTE_MS && age <= FRESH_NOTE_MS;
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=voiceWaveform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceWaveform.js","names":["VOICE_BUTTON_SIZE","WAVEFORM_HEIGHT","BAR_WIDTH","BAR_STEP","LEVEL_MAX","BAR_HALF_MAX","DRAG_SLOP","VOICE_COLUMN_GAP","VOICE_BASE_WIDTH","VOICE_TIME_FONT_SIZE","VOICE_ROW_PADDING_V","VOICE_META_WIDTH","VOICE_META_TICKS_WIDTH","VOICE_META_HEIGHT","formatVoiceDuration","seconds","total","Number","isFinite","Math","floor","h","m","s","pad","n","toString","padStart","estimateTimeWidth","label","ceil","length","voiceContentWidth","durationSeconds","isOutgoing","TRANSCRIBE_BUTTON_WIDTH","TRANSCRIBE_BUTTON_HEIGHT","TRANSCRIBE_BUTTON_RADIUS","TRANSCRIBE_SLOT_WIDTH","voiceTrackWidth","contentWidth","rowPaddingH","hasTranscribeButton","max","VIEW_ONCE_BADGE_OFFSET","VIEW_ONCE_BADGE_SIZE","VIEW_ONCE_BADGE_CUT","VIEW_ONCE_RING_SIZE","barCountForWidth","width","barHeight","level","clamped","min","quantised","round","half","levelsFromSamples","data","count","block","out","i","start","end","peak","j","v","abs","push","levelsFromWaveform","waveform","scale","normalized","Array","from","value","_","FRESH_NOTE_MS","isFreshOutgoingNote","position","createdAt","now","Date","created","getTime","age"],"sources":["../../src/components/voiceWaveform.ts"],"sourcesContent":["/**\n * Geometry and formatting shared by the voice-note players.\n */\n\n/** The play/pause circle is 44x44. */\nexport const VOICE_BUTTON_SIZE = 44\n/** The waveform area is 30 tall. */\nexport const WAVEFORM_HEIGHT = 30\n/** Each bar is a 2-wide stroke, one every 3, so a 1 gap. */\nexport const BAR_WIDTH = 2\nexport const BAR_STEP = 3\n/** Waveform levels are 5-bit samples. */\nexport const LEVEL_MAX = 31\n/** A full-level bar reaches 7 either side of the centre line. */\nexport const BAR_HALF_MAX = 7\n/** A 0.2cm drag slop, in points. */\nexport const DRAG_SLOP = 8\n/** Gap between the button and the waveform/time column. */\nexport const VOICE_COLUMN_GAP = 10\n/** Bubble content width before the time label is added (`174 + timeWidth`). */\nexport const VOICE_BASE_WIDTH = 174\nexport const VOICE_TIME_FONT_SIZE = 12\n/**\n * Space above and below the button. A voice cell is 70 tall with the button\n * 44 across, 13 from the top, which leaves about 12 inside the bubble on\n * either side once its 1dp outer margins are taken off.\n */\nexport const VOICE_ROW_PADDING_V = 12\n/**\n * A voice bubble is widened by the message's own time as well\n * (174 + time width + duration width), since the\n * time shares the duration's line at the bubble's bottom-right. `timeWidth`\n * is the `h:mm a` label, plus 20dp for the ticks on an outgoing note.\n */\nexport const VOICE_META_WIDTH = 48\nexport const VOICE_META_TICKS_WIDTH = 20\n/**\n * Height the bubble's time takes below content it cannot sit beside - an\n * open transcription, or the fallback card - so it never covers it.\n */\nexport const VOICE_META_HEIGHT = 20\n\n/**\n * Zero-padded `00:12`, and `h:mm:ss` once a\n * note runs past an hour.\n */\nexport const formatVoiceDuration = (seconds: number) => {\n const total = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0\n const h = Math.floor(total / 3600)\n const m = Math.floor(total / 60) % 60\n const s = total % 60\n const pad = (n: number) => n.toString().padStart(2, '0')\n return h > 0 ? `${h}:${pad(m)}:${pad(s)}` : `${pad(m)}:${pad(s)}`\n}\n\n/**\n * Width the time label takes, estimated from the string rather than measured:\n * the label changes every second while playing, and measuring it would re-lay\n * the bubble out on each tick. Digits are tabular, so the estimate holds.\n */\nexport const estimateTimeWidth = (label: string) =>\n Math.ceil(label.length * VOICE_TIME_FONT_SIZE * 0.6)\n\n/**\n * A voice bubble is sized from a constant plus the time labels, not\n * from the note's length, so a 2s and a 2min note are equally wide.\n */\nexport const voiceContentWidth = (durationSeconds: number, isOutgoing = false) =>\n VOICE_BASE_WIDTH + estimateTimeWidth(formatVoiceDuration(durationSeconds))\n + VOICE_META_WIDTH + (isOutgoing ? VOICE_META_TICKS_WIDTH : 0)\n\n/**\n * The transcribe button: a 30x24 rounded rect, radius 8, and the\n * waveform gives up 34 of its width to it - the bubble itself stays as wide.\n */\nexport const TRANSCRIBE_BUTTON_WIDTH = 30\nexport const TRANSCRIBE_BUTTON_HEIGHT = 24\nexport const TRANSCRIBE_BUTTON_RADIUS = 8\nexport const TRANSCRIBE_SLOT_WIDTH = 34\n\n/**\n * Width left for the waveform inside a voice bubble of `contentWidth`, after\n * the row padding, the play button, the gap and, when shown, the transcribe\n * button's slot.\n */\nexport const voiceTrackWidth = (\n contentWidth: number,\n rowPaddingH: number,\n hasTranscribeButton: boolean\n) =>\n Math.max(\n 0,\n contentWidth - 2 * rowPaddingH - VOICE_BUTTON_SIZE - VOICE_COLUMN_GAP\n - (hasTranscribeButton ? TRANSCRIBE_SLOT_WIDTH : 0)\n )\n\n/**\n * Where the view-once badge sits: centred 22.6274\n * from the play button's centre at 45 degrees, i.e. 16 right and 16 down, a\n * 10-radius disc with a 1.5 ring cut out of the button around it, holding a\n * 14-across \"1\".\n */\nexport const VIEW_ONCE_BADGE_OFFSET = 16\nexport const VIEW_ONCE_BADGE_SIZE = 20\nexport const VIEW_ONCE_BADGE_CUT = 1.5\nexport const VIEW_ONCE_RING_SIZE = 14\n\n/** One bar per 3 points of track. */\nexport const barCountForWidth = (width: number) =>\n width > 0 ? Math.max(1, Math.floor((width + (BAR_STEP - BAR_WIDTH)) / BAR_STEP)) : 0\n\n/**\n * Bar height for a level in 0..1. Quantised to 5-bit 0..31, scaled\n * to 0..7 each side of the centre line, plus the 1-point round caps, so a bar\n * runs 2..16 tall. The loudest bar is deliberately not stretched to the full\n * area: no normalising, so a quiet note looks quiet.\n */\nexport const barHeight = (level: number) => {\n const clamped = Number.isFinite(level) ? Math.max(0, Math.min(1, level)) : 0\n const quantised = Math.round(clamped * LEVEL_MAX)\n const half = (BAR_HALF_MAX * quantised) / LEVEL_MAX\n return half * 2 + BAR_WIDTH\n}\n\n/**\n * Buckets decoded samples into `count` levels in 0..1, using each bucket's\n * peak amplitude. Levels are absolute (0..1 of full scale), never rescaled\n * against the loudest bucket.\n */\nexport const levelsFromSamples = (data: ArrayLike<number>, count: number) => {\n if (count <= 0 || !data.length)\n return []\n\n const block = data.length / count\n const out: number[] = []\n for (let i = 0; i < count; i++) {\n const start = Math.floor(i * block)\n const end = Math.max(start + 1, Math.floor((i + 1) * block))\n let peak = 0\n for (let j = start; j < end && j < data.length; j++) {\n const v = Math.abs(data[j] || 0)\n if (v > peak)\n peak = v\n }\n out.push(Math.min(1, peak))\n }\n return out\n}\n\n/**\n * `IMessage.waveform` resampled to `count` bars: levels in 0..1, or 5-bit 0..31\n * values (read on that scale when any is above 1).\n */\nexport const levelsFromWaveform = (waveform: ArrayLike<number> | undefined, count: number) => {\n if (!waveform?.length || count <= 0)\n return []\n\n let max = 0\n for (let i = 0; i < waveform.length; i++)\n max = Math.max(max, waveform[i] || 0)\n const scale = max > 1 ? LEVEL_MAX : 1\n const normalized = Array.from(waveform, value => Math.max(0, (value || 0) / scale))\n if (normalized.length >= count)\n return levelsFromSamples(normalized, count)\n\n // Fewer values than bars: each value covers several bars.\n return Array.from({ length: count }, (_, i) => Math.min(1, normalized[Math.floor((i * normalized.length) / count)]))\n}\n\n/**\n * The bar-growth animation runs only on a note that has\n * just been sent from this device. We approximate \"just sent\" as an outgoing\n * message created in the last couple of seconds.\n */\nexport const FRESH_NOTE_MS = 2000\n\nexport const isFreshOutgoingNote = (\n position: 'left' | 'right',\n createdAt: Date | number | undefined,\n now = Date.now()\n) => {\n if (position !== 'right' || createdAt == null)\n return false\n\n const created = typeof createdAt === 'number' ? createdAt : createdAt.getTime?.()\n if (created == null || !Number.isFinite(created))\n return false\n\n const age = now - created\n return age >= -FRESH_NOTE_MS && age <= FRESH_NOTE_MS\n}\n"],"mappings":"AAAA;AACA;AACA;;AAEA;AACA,OAAO,MAAMA,iBAAiB,GAAG,EAAE;AACnC;AACA,OAAO,MAAMC,eAAe,GAAG,EAAE;AACjC;AACA,OAAO,MAAMC,SAAS,GAAG,CAAC;AAC1B,OAAO,MAAMC,QAAQ,GAAG,CAAC;AACzB;AACA,OAAO,MAAMC,SAAS,GAAG,EAAE;AAC3B;AACA,OAAO,MAAMC,YAAY,GAAG,CAAC;AAC7B;AACA,OAAO,MAAMC,SAAS,GAAG,CAAC;AAC1B;AACA,OAAO,MAAMC,gBAAgB,GAAG,EAAE;AAClC;AACA,OAAO,MAAMC,gBAAgB,GAAG,GAAG;AACnC,OAAO,MAAMC,oBAAoB,GAAG,EAAE;AACtC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,EAAE;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,EAAE;AAClC,OAAO,MAAMC,sBAAsB,GAAG,EAAE;AACxC;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG,EAAE;;AAEnC;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAIC,OAAe,IAAK;EACtD,MAAMC,KAAK,GAAGC,MAAM,CAACC,QAAQ,CAACH,OAAO,CAAC,IAAIA,OAAO,GAAG,CAAC,GAAGI,IAAI,CAACC,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IQ,GAAG,IAAIR,aAAa;AACtD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const WALLPAPER_WIDTH = 60;
|
|
2
|
+
export declare const WALLPAPER_HEIGHT = 80;
|
|
3
|
+
export declare const WALLPAPER_PHASES = 8;
|
|
4
|
+
/** Where the four colors sit in a phase: color `i` at spot `(phase + 2i) mod 8` (`gatherPositions`). */
|
|
5
|
+
export declare function gatherPositions(phase: number): Array<[number, number]>;
|
|
6
|
+
/**
|
|
7
|
+
* The gradient's pixels as RGB bytes, row by row. `progress` moves the colors from the
|
|
8
|
+
* previous phase's spots (`phase + 1`) to this one's, animating a step.
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateWallpaperPixels(colors: string[], phase: number, progress?: number, width?: number, height?: number): Uint8Array;
|
|
11
|
+
/** An RGB image as a PNG with a stored (uncompressed) deflate stream - small images only. */
|
|
12
|
+
export declare function encodePng(pixels: Uint8Array, width: number, height: number): Uint8Array;
|
|
13
|
+
export declare function toBase64(bytes: Uint8Array): string;
|
|
14
|
+
/** The gradient for a phase as a `data:` URI, cached per color set and phase. */
|
|
15
|
+
export declare function getWallpaperUri(colors: string[], phase: number): string;
|
|
16
|
+
//# sourceMappingURL=wallpaperGradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallpaperGradient.d.ts","sourceRoot":"","sources":["../../src/components/wallpaperGradient.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,KAAK,CAAA;AACjC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAA;AAcjC,wGAAwG;AACxG,wBAAgB,eAAe,CAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAOvE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EAAE,EAChB,KAAK,EAAE,MAAM,EACb,QAAQ,SAAI,EACZ,KAAK,SAAkB,EACvB,MAAM,SAAmB,GACxB,UAAU,CAmDZ;AAgCD,6FAA6F;AAC7F,wBAAgB,SAAS,CAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAuDxF;AAID,wBAAgB,QAAQ,CAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAgBnD;AAID,iFAAiF;AACjF,wBAAgB,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAUxE"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chat wallpaper gradient: four colors placed at four of eight fixed spots,
|
|
3
|
+
* each pixel swirled around the centre and then colored by inverse-distance weights. It is
|
|
4
|
+
* rendered into a 60x80 bitmap that the GPU scales up, as an uncompressed PNG, so React
|
|
5
|
+
* Native's `Image` can draw it with no dependency.
|
|
6
|
+
*/
|
|
7
|
+
import { parseColor } from '../colorUtils';
|
|
8
|
+
export const WALLPAPER_WIDTH = 60;
|
|
9
|
+
export const WALLPAPER_HEIGHT = 80;
|
|
10
|
+
export const WALLPAPER_PHASES = 8;
|
|
11
|
+
|
|
12
|
+
// The eight spots; y is flipped when they are gathered.
|
|
13
|
+
const POSITIONS = [[0.80, 0.10], [0.60, 0.20], [0.35, 0.25], [0.25, 0.60], [0.20, 0.90], [0.40, 0.80], [0.65, 0.75], [0.75, 0.40]];
|
|
14
|
+
|
|
15
|
+
/** Where the four colors sit in a phase: color `i` at spot `(phase + 2i) mod 8` (`gatherPositions`). */
|
|
16
|
+
export function gatherPositions(phase) {
|
|
17
|
+
const result = [];
|
|
18
|
+
for (let i = 0; i < 4; i += 1) {
|
|
19
|
+
const [x, y] = POSITIONS[((phase + i * 2) % 8 + 8) % 8];
|
|
20
|
+
result.push([x, 1 - y]);
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The gradient's pixels as RGB bytes, row by row. `progress` moves the colors from the
|
|
27
|
+
* previous phase's spots (`phase + 1`) to this one's, animating a step.
|
|
28
|
+
*/
|
|
29
|
+
export function generateWallpaperPixels(colors, phase, progress = 1, width = WALLPAPER_WIDTH, height = WALLPAPER_HEIGHT) {
|
|
30
|
+
const parsed = colors.slice(0, 4).map(color => parseColor(color) ?? {
|
|
31
|
+
r: 0,
|
|
32
|
+
g: 0,
|
|
33
|
+
b: 0,
|
|
34
|
+
a: 1
|
|
35
|
+
});
|
|
36
|
+
const count = parsed.length;
|
|
37
|
+
const pixels = new Uint8Array(width * height * 3);
|
|
38
|
+
if (count === 0) return pixels;
|
|
39
|
+
const previous = gatherPositions((phase + 1) % 8);
|
|
40
|
+
const current = gatherPositions(phase);
|
|
41
|
+
const spots = previous.map(([px, py], i) => [px + (current[i][0] - px) * progress, py + (current[i][1] - py) * progress]);
|
|
42
|
+
let offset = 0;
|
|
43
|
+
for (let y = 0; y < height; y += 1) {
|
|
44
|
+
const centerDistanceY = y / height - 0.5;
|
|
45
|
+
for (let x = 0; x < width; x += 1) {
|
|
46
|
+
const centerDistanceX = x / width - 0.5;
|
|
47
|
+
const centerDistance = Math.sqrt(centerDistanceX * centerDistanceX + centerDistanceY * centerDistanceY);
|
|
48
|
+
const swirlFactor = 0.35 * centerDistance;
|
|
49
|
+
const theta = swirlFactor * swirlFactor * 0.8 * 8;
|
|
50
|
+
const sinTheta = Math.sin(theta);
|
|
51
|
+
const cosTheta = Math.cos(theta);
|
|
52
|
+
const pixelX = Math.max(0, Math.min(1, 0.5 + centerDistanceX * cosTheta - centerDistanceY * sinTheta));
|
|
53
|
+
const pixelY = Math.max(0, Math.min(1, 0.5 + centerDistanceX * sinTheta + centerDistanceY * cosTheta));
|
|
54
|
+
let distanceSum = 0;
|
|
55
|
+
let r = 0;
|
|
56
|
+
let g = 0;
|
|
57
|
+
let b = 0;
|
|
58
|
+
for (let i = 0; i < count; i += 1) {
|
|
59
|
+
const distanceX = pixelX - spots[i][0];
|
|
60
|
+
const distanceY = pixelY - spots[i][1];
|
|
61
|
+
let distance = Math.max(0, 0.9 - Math.sqrt(distanceX * distanceX + distanceY * distanceY));
|
|
62
|
+
distance = distance * distance * distance * distance;
|
|
63
|
+
distanceSum += distance;
|
|
64
|
+
r += distance * parsed[i].r;
|
|
65
|
+
g += distance * parsed[i].g;
|
|
66
|
+
b += distance * parsed[i].b;
|
|
67
|
+
}
|
|
68
|
+
const scale = distanceSum > 0 ? 1 / distanceSum : 0;
|
|
69
|
+
pixels[offset] = Math.round(r * scale);
|
|
70
|
+
pixels[offset + 1] = Math.round(g * scale);
|
|
71
|
+
pixels[offset + 2] = Math.round(b * scale);
|
|
72
|
+
offset += 3;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return pixels;
|
|
76
|
+
}
|
|
77
|
+
let crcTable = null;
|
|
78
|
+
const getCrcTable = () => {
|
|
79
|
+
if (crcTable) return crcTable;
|
|
80
|
+
crcTable = new Uint32Array(256);
|
|
81
|
+
for (let n = 0; n < 256; n += 1) {
|
|
82
|
+
let c = n;
|
|
83
|
+
for (let k = 0; k < 8; k += 1) c = c & 1 ? 0xEDB88320 ^ c >>> 1 : c >>> 1;
|
|
84
|
+
crcTable[n] = c >>> 0;
|
|
85
|
+
}
|
|
86
|
+
return crcTable;
|
|
87
|
+
};
|
|
88
|
+
const crc32 = (bytes, start, end) => {
|
|
89
|
+
const table = getCrcTable();
|
|
90
|
+
let crc = 0xFFFFFFFF;
|
|
91
|
+
for (let i = start; i < end; i += 1) crc = table[(crc ^ bytes[i]) & 0xFF] ^ crc >>> 8;
|
|
92
|
+
return (crc ^ 0xFFFFFFFF) >>> 0;
|
|
93
|
+
};
|
|
94
|
+
const writeUint32 = (bytes, offset, value) => {
|
|
95
|
+
bytes[offset] = value >>> 24 & 0xFF;
|
|
96
|
+
bytes[offset + 1] = value >>> 16 & 0xFF;
|
|
97
|
+
bytes[offset + 2] = value >>> 8 & 0xFF;
|
|
98
|
+
bytes[offset + 3] = value & 0xFF;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** An RGB image as a PNG with a stored (uncompressed) deflate stream - small images only. */
|
|
102
|
+
export function encodePng(pixels, width, height) {
|
|
103
|
+
const rowLength = width * 3 + 1;
|
|
104
|
+
const raw = new Uint8Array(rowLength * height);
|
|
105
|
+
for (let y = 0; y < height; y += 1) {
|
|
106
|
+
raw[y * rowLength] = 0;
|
|
107
|
+
raw.set(pixels.subarray(y * width * 3, (y + 1) * width * 3), y * rowLength + 1);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// zlib: header, stored blocks of at most 65535 bytes, Adler-32.
|
|
111
|
+
const blockCount = Math.max(1, Math.ceil(raw.length / 65535));
|
|
112
|
+
const zlib = new Uint8Array(2 + raw.length + blockCount * 5 + 4);
|
|
113
|
+
zlib[0] = 0x78;
|
|
114
|
+
zlib[1] = 0x01;
|
|
115
|
+
let zOffset = 2;
|
|
116
|
+
for (let block = 0; block < blockCount; block += 1) {
|
|
117
|
+
const start = block * 65535;
|
|
118
|
+
const length = Math.min(65535, raw.length - start);
|
|
119
|
+
zlib[zOffset] = block === blockCount - 1 ? 1 : 0;
|
|
120
|
+
zlib[zOffset + 1] = length & 0xFF;
|
|
121
|
+
zlib[zOffset + 2] = length >>> 8 & 0xFF;
|
|
122
|
+
zlib[zOffset + 3] = ~length & 0xFF;
|
|
123
|
+
zlib[zOffset + 4] = ~length >>> 8 & 0xFF;
|
|
124
|
+
zlib.set(raw.subarray(start, start + length), zOffset + 5);
|
|
125
|
+
zOffset += 5 + length;
|
|
126
|
+
}
|
|
127
|
+
let a = 1;
|
|
128
|
+
let b = 0;
|
|
129
|
+
for (let i = 0; i < raw.length; i += 1) {
|
|
130
|
+
a = (a + raw[i]) % 65521;
|
|
131
|
+
b = (b + a) % 65521;
|
|
132
|
+
}
|
|
133
|
+
writeUint32(zlib, zOffset, (b << 16 | a) >>> 0);
|
|
134
|
+
const chunks = [];
|
|
135
|
+
const header = new Uint8Array(13);
|
|
136
|
+
writeUint32(header, 0, width);
|
|
137
|
+
writeUint32(header, 4, height);
|
|
138
|
+
header[8] = 8; // bit depth
|
|
139
|
+
header[9] = 2; // truecolor RGB
|
|
140
|
+
chunks.push(['IHDR', header], ['IDAT', zlib], ['IEND', new Uint8Array(0)]);
|
|
141
|
+
const total = 8 + chunks.reduce((sum, [, data]) => sum + 12 + data.length, 0);
|
|
142
|
+
const png = new Uint8Array(total);
|
|
143
|
+
png.set([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A], 0);
|
|
144
|
+
let offset = 8;
|
|
145
|
+
for (const [type, data] of chunks) {
|
|
146
|
+
writeUint32(png, offset, data.length);
|
|
147
|
+
for (let i = 0; i < 4; i += 1) png[offset + 4 + i] = type.charCodeAt(i);
|
|
148
|
+
png.set(data, offset + 8);
|
|
149
|
+
writeUint32(png, offset + 8 + data.length, crc32(png, offset + 4, offset + 8 + data.length));
|
|
150
|
+
offset += 12 + data.length;
|
|
151
|
+
}
|
|
152
|
+
return png;
|
|
153
|
+
}
|
|
154
|
+
const BASE64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
155
|
+
export function toBase64(bytes) {
|
|
156
|
+
let out = '';
|
|
157
|
+
let i = 0;
|
|
158
|
+
for (; i + 2 < bytes.length; i += 3) {
|
|
159
|
+
const n = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2];
|
|
160
|
+
out += BASE64[n >>> 18 & 63] + BASE64[n >>> 12 & 63] + BASE64[n >>> 6 & 63] + BASE64[n & 63];
|
|
161
|
+
}
|
|
162
|
+
const rest = bytes.length - i;
|
|
163
|
+
if (rest === 1) {
|
|
164
|
+
const n = bytes[i] << 16;
|
|
165
|
+
out += BASE64[n >>> 18 & 63] + BASE64[n >>> 12 & 63] + '==';
|
|
166
|
+
} else if (rest === 2) {
|
|
167
|
+
const n = bytes[i] << 16 | bytes[i + 1] << 8;
|
|
168
|
+
out += BASE64[n >>> 18 & 63] + BASE64[n >>> 12 & 63] + BASE64[n >>> 6 & 63] + '=';
|
|
169
|
+
}
|
|
170
|
+
return out;
|
|
171
|
+
}
|
|
172
|
+
const cache = new Map();
|
|
173
|
+
|
|
174
|
+
/** The gradient for a phase as a `data:` URI, cached per color set and phase. */
|
|
175
|
+
export function getWallpaperUri(colors, phase) {
|
|
176
|
+
const normalized = (phase % WALLPAPER_PHASES + WALLPAPER_PHASES) % WALLPAPER_PHASES;
|
|
177
|
+
const key = `${colors.join(',')}|${normalized}`;
|
|
178
|
+
let uri = cache.get(key);
|
|
179
|
+
if (!uri) {
|
|
180
|
+
const pixels = generateWallpaperPixels(colors, normalized);
|
|
181
|
+
uri = `data:image/png;base64,${toBase64(encodePng(pixels, WALLPAPER_WIDTH, WALLPAPER_HEIGHT))}`;
|
|
182
|
+
cache.set(key, uri);
|
|
183
|
+
}
|
|
184
|
+
return uri;
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=wallpaperGradient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallpaperGradient.js","names":["parseColor","WALLPAPER_WIDTH","WALLPAPER_HEIGHT","WALLPAPER_PHASES","POSITIONS","gatherPositions","phase","result","i","x","y","push","generateWallpaperPixels","colors","progress","width","height","parsed","slice","map","color","r","g","b","a","count","length","pixels","Uint8Array","previous","current","spots","px","py","offset","centerDistanceY","centerDistanceX","centerDistance","Math","sqrt","swirlFactor","theta","sinTheta","sin","cosTheta","cos","pixelX","max","min","pixelY","distanceSum","distanceX","distanceY","distance","scale","round","crcTable","getCrcTable","Uint32Array","n","c","k","crc32","bytes","start","end","table","crc","writeUint32","value","encodePng","rowLength","raw","set","subarray","blockCount","ceil","zlib","zOffset","block","chunks","header","total","reduce","sum","data","png","type","charCodeAt","BASE64","toBase64","out","rest","cache","Map","getWallpaperUri","normalized","key","join","uri","get"],"sources":["../../src/components/wallpaperGradient.ts"],"sourcesContent":["/**\n * The chat wallpaper gradient: four colors placed at four of eight fixed spots,\n * each pixel swirled around the centre and then colored by inverse-distance weights. It is\n * rendered into a 60x80 bitmap that the GPU scales up, as an uncompressed PNG, so React\n * Native's `Image` can draw it with no dependency.\n */\nimport { parseColor } from '../colorUtils'\n\nexport const WALLPAPER_WIDTH = 60\nexport const WALLPAPER_HEIGHT = 80\nexport const WALLPAPER_PHASES = 8\n\n// The eight spots; y is flipped when they are gathered.\nconst POSITIONS: Array<[number, number]> = [\n [0.80, 0.10],\n [0.60, 0.20],\n [0.35, 0.25],\n [0.25, 0.60],\n [0.20, 0.90],\n [0.40, 0.80],\n [0.65, 0.75],\n [0.75, 0.40],\n]\n\n/** Where the four colors sit in a phase: color `i` at spot `(phase + 2i) mod 8` (`gatherPositions`). */\nexport function gatherPositions (phase: number): Array<[number, number]> {\n const result: Array<[number, number]> = []\n for (let i = 0; i < 4; i += 1) {\n const [x, y] = POSITIONS[(((phase + i * 2) % 8) + 8) % 8]\n result.push([x, 1 - y])\n }\n return result\n}\n\n/**\n * The gradient's pixels as RGB bytes, row by row. `progress` moves the colors from the\n * previous phase's spots (`phase + 1`) to this one's, animating a step.\n */\nexport function generateWallpaperPixels (\n colors: string[],\n phase: number,\n progress = 1,\n width = WALLPAPER_WIDTH,\n height = WALLPAPER_HEIGHT\n): Uint8Array {\n const parsed = colors.slice(0, 4).map(color => parseColor(color) ?? { r: 0, g: 0, b: 0, a: 1 })\n const count = parsed.length\n const pixels = new Uint8Array(width * height * 3)\n if (count === 0)\n return pixels\n\n const previous = gatherPositions((phase + 1) % 8)\n const current = gatherPositions(phase)\n const spots = previous.map(([px, py], i) => [\n px + (current[i][0] - px) * progress,\n py + (current[i][1] - py) * progress,\n ])\n\n let offset = 0\n for (let y = 0; y < height; y += 1) {\n const centerDistanceY = y / height - 0.5\n for (let x = 0; x < width; x += 1) {\n const centerDistanceX = x / width - 0.5\n const centerDistance = Math.sqrt(centerDistanceX * centerDistanceX + centerDistanceY * centerDistanceY)\n const swirlFactor = 0.35 * centerDistance\n const theta = swirlFactor * swirlFactor * 0.8 * 8\n const sinTheta = Math.sin(theta)\n const cosTheta = Math.cos(theta)\n const pixelX = Math.max(0, Math.min(1, 0.5 + centerDistanceX * cosTheta - centerDistanceY * sinTheta))\n const pixelY = Math.max(0, Math.min(1, 0.5 + centerDistanceX * sinTheta + centerDistanceY * cosTheta))\n\n let distanceSum = 0\n let r = 0\n let g = 0\n let b = 0\n for (let i = 0; i < count; i += 1) {\n const distanceX = pixelX - spots[i][0]\n const distanceY = pixelY - spots[i][1]\n let distance = Math.max(0, 0.9 - Math.sqrt(distanceX * distanceX + distanceY * distanceY))\n distance = distance * distance * distance * distance\n distanceSum += distance\n r += distance * parsed[i].r\n g += distance * parsed[i].g\n b += distance * parsed[i].b\n }\n\n const scale = distanceSum > 0 ? 1 / distanceSum : 0\n pixels[offset] = Math.round(r * scale)\n pixels[offset + 1] = Math.round(g * scale)\n pixels[offset + 2] = Math.round(b * scale)\n offset += 3\n }\n }\n\n return pixels\n}\n\nlet crcTable: Uint32Array | null = null\nconst getCrcTable = () => {\n if (crcTable)\n return crcTable\n\n crcTable = new Uint32Array(256)\n for (let n = 0; n < 256; n += 1) {\n let c = n\n for (let k = 0; k < 8; k += 1)\n c = c & 1 ? 0xEDB88320 ^ (c >>> 1) : c >>> 1\n crcTable[n] = c >>> 0\n }\n return crcTable\n}\n\nconst crc32 = (bytes: Uint8Array, start: number, end: number) => {\n const table = getCrcTable()\n let crc = 0xFFFFFFFF\n for (let i = start; i < end; i += 1)\n crc = table[(crc ^ bytes[i]) & 0xFF] ^ (crc >>> 8)\n return (crc ^ 0xFFFFFFFF) >>> 0\n}\n\nconst writeUint32 = (bytes: Uint8Array, offset: number, value: number) => {\n bytes[offset] = (value >>> 24) & 0xFF\n bytes[offset + 1] = (value >>> 16) & 0xFF\n bytes[offset + 2] = (value >>> 8) & 0xFF\n bytes[offset + 3] = value & 0xFF\n}\n\n/** An RGB image as a PNG with a stored (uncompressed) deflate stream - small images only. */\nexport function encodePng (pixels: Uint8Array, width: number, height: number): Uint8Array {\n const rowLength = width * 3 + 1\n const raw = new Uint8Array(rowLength * height)\n for (let y = 0; y < height; y += 1) {\n raw[y * rowLength] = 0\n raw.set(pixels.subarray(y * width * 3, (y + 1) * width * 3), y * rowLength + 1)\n }\n\n // zlib: header, stored blocks of at most 65535 bytes, Adler-32.\n const blockCount = Math.max(1, Math.ceil(raw.length / 65535))\n const zlib = new Uint8Array(2 + raw.length + blockCount * 5 + 4)\n zlib[0] = 0x78\n zlib[1] = 0x01\n let zOffset = 2\n for (let block = 0; block < blockCount; block += 1) {\n const start = block * 65535\n const length = Math.min(65535, raw.length - start)\n zlib[zOffset] = block === blockCount - 1 ? 1 : 0\n zlib[zOffset + 1] = length & 0xFF\n zlib[zOffset + 2] = (length >>> 8) & 0xFF\n zlib[zOffset + 3] = ~length & 0xFF\n zlib[zOffset + 4] = (~length >>> 8) & 0xFF\n zlib.set(raw.subarray(start, start + length), zOffset + 5)\n zOffset += 5 + length\n }\n let a = 1\n let b = 0\n for (let i = 0; i < raw.length; i += 1) {\n a = (a + raw[i]) % 65521\n b = (b + a) % 65521\n }\n writeUint32(zlib, zOffset, ((b << 16) | a) >>> 0)\n\n const chunks: Array<[string, Uint8Array]> = []\n const header = new Uint8Array(13)\n writeUint32(header, 0, width)\n writeUint32(header, 4, height)\n header[8] = 8 // bit depth\n header[9] = 2 // truecolor RGB\n chunks.push(['IHDR', header], ['IDAT', zlib], ['IEND', new Uint8Array(0)])\n\n const total = 8 + chunks.reduce((sum, [, data]) => sum + 12 + data.length, 0)\n const png = new Uint8Array(total)\n png.set([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A], 0)\n let offset = 8\n for (const [type, data] of chunks) {\n writeUint32(png, offset, data.length)\n for (let i = 0; i < 4; i += 1)\n png[offset + 4 + i] = type.charCodeAt(i)\n png.set(data, offset + 8)\n writeUint32(png, offset + 8 + data.length, crc32(png, offset + 4, offset + 8 + data.length))\n offset += 12 + data.length\n }\n\n return png\n}\n\nconst BASE64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n\nexport function toBase64 (bytes: Uint8Array): string {\n let out = ''\n let i = 0\n for (; i + 2 < bytes.length; i += 3) {\n const n = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]\n out += BASE64[(n >>> 18) & 63] + BASE64[(n >>> 12) & 63] + BASE64[(n >>> 6) & 63] + BASE64[n & 63]\n }\n const rest = bytes.length - i\n if (rest === 1) {\n const n = bytes[i] << 16\n out += BASE64[(n >>> 18) & 63] + BASE64[(n >>> 12) & 63] + '=='\n } else if (rest === 2) {\n const n = (bytes[i] << 16) | (bytes[i + 1] << 8)\n out += BASE64[(n >>> 18) & 63] + BASE64[(n >>> 12) & 63] + BASE64[(n >>> 6) & 63] + '='\n }\n return out\n}\n\nconst cache = new Map<string, string>()\n\n/** The gradient for a phase as a `data:` URI, cached per color set and phase. */\nexport function getWallpaperUri (colors: string[], phase: number): string {\n const normalized = ((phase % WALLPAPER_PHASES) + WALLPAPER_PHASES) % WALLPAPER_PHASES\n const key = `${colors.join(',')}|${normalized}`\n let uri = cache.get(key)\n if (!uri) {\n const pixels = generateWallpaperPixels(colors, normalized)\n uri = `data:image/png;base64,${toBase64(encodePng(pixels, WALLPAPER_WIDTH, WALLPAPER_HEIGHT))}`\n cache.set(key, uri)\n }\n return uri\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,eAAe;AAE1C,OAAO,MAAMC,eAAe,GAAG,EAAE;AACjC,OAAO,MAAMC,gBAAgB,GAAG,EAAE;AAClC,OAAO,MAAMC,gBAAgB,GAAG,CAAC;;AAEjC;AACA,MAAMC,SAAkC,GAAG,CACzC,CAAC,IAAI,EAAE,IAAI,CAAC,EACZ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AAMxE,MAAM,GAAGf,uBAAuB,CAACC,MAAM,EAAEmF,UAAU,CAAC;IAC1DG,GAAG,GAAG,yBAAyBT,QAAQ,CAACpB,SAAS,CAAC3C,MAAM,EAAE1B,eAAe,EAAEC,gBAAgB,CAAC,CAAC,EAAE;IAC/F2F,KAAK,CAACpB,GAAG,CAACwB,GAAG,EAAEE,GAAG,CAAC;EACrB;EACA,OAAOA,GAAG;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insets for an overlay that covers the whole window (a `Modal`). The nearest provider's are
|
|
3
|
+
* often smaller - a navigator hands its screens what the header and tab bar left over, so a
|
|
4
|
+
* stack screen reads a bottom inset of 0 - so keep whichever is larger of those and the
|
|
5
|
+
* window's at launch.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useWindowInsets: () => {
|
|
8
|
+
top: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=windowInsets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windowInsets.d.ts","sourceRoot":"","sources":["../../src/components/windowInsets.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;CAU3B,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import * as SafeArea from 'react-native-safe-area-context';
|
|
5
|
+
|
|
6
|
+
// Without a provider (or before it measured) keep clear of the notch and the home indicator.
|
|
7
|
+
const FALLBACK_INSETS = Platform.OS === 'ios' ? {
|
|
8
|
+
top: 47,
|
|
9
|
+
bottom: 34
|
|
10
|
+
} : {
|
|
11
|
+
top: 24,
|
|
12
|
+
bottom: 0
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Insets for an overlay that covers the whole window (a `Modal`). The nearest provider's are
|
|
17
|
+
* often smaller - a navigator hands its screens what the header and tab bar left over, so a
|
|
18
|
+
* stack screen reads a bottom inset of 0 - so keep whichever is larger of those and the
|
|
19
|
+
* window's at launch.
|
|
20
|
+
*/
|
|
21
|
+
export const useWindowInsets = () => {
|
|
22
|
+
const $ = _c(3);
|
|
23
|
+
const context = useContext(SafeArea.SafeAreaInsetsContext);
|
|
24
|
+
const initial = SafeArea.initialWindowMetrics?.insets;
|
|
25
|
+
if (!context && !initial) {
|
|
26
|
+
return FALLBACK_INSETS;
|
|
27
|
+
}
|
|
28
|
+
const t0 = Math.max(context?.top ?? 0, initial?.top ?? 0);
|
|
29
|
+
const t1 = Math.max(context?.bottom ?? 0, initial?.bottom ?? 0);
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[0] !== t0 || $[1] !== t1) {
|
|
32
|
+
t2 = {
|
|
33
|
+
top: t0,
|
|
34
|
+
bottom: t1
|
|
35
|
+
};
|
|
36
|
+
$[0] = t0;
|
|
37
|
+
$[1] = t1;
|
|
38
|
+
$[2] = t2;
|
|
39
|
+
} else {
|
|
40
|
+
t2 = $[2];
|
|
41
|
+
}
|
|
42
|
+
return t2;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=windowInsets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windowInsets.js","names":["useContext","Platform","SafeArea","FALLBACK_INSETS","OS","top","bottom","useWindowInsets","$","_c","context","SafeAreaInsetsContext","initial","initialWindowMetrics","insets","t0","Math","max","t1","t2"],"sources":["../../src/components/windowInsets.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { Platform } from 'react-native'\nimport * as SafeArea from 'react-native-safe-area-context'\n\n// Without a provider (or before it measured) keep clear of the notch and the home indicator.\nconst FALLBACK_INSETS = Platform.OS === 'ios'\n ? { top: 47, bottom: 34 }\n : { top: 24, bottom: 0 }\n\n/**\n * Insets for an overlay that covers the whole window (a `Modal`). The nearest provider's are\n * often smaller - a navigator hands its screens what the header and tab bar left over, so a\n * stack screen reads a bottom inset of 0 - so keep whichever is larger of those and the\n * window's at launch.\n */\nexport const useWindowInsets = () => {\n const context = useContext(SafeArea.SafeAreaInsetsContext)\n const initial = SafeArea.initialWindowMetrics?.insets\n if (!context && !initial)\n return FALLBACK_INSETS\n\n return {\n top: Math.max(context?.top ?? 0, initial?.top ?? 0),\n bottom: Math.max(context?.bottom ?? 0, initial?.bottom ?? 0),\n }\n}\n"],"mappings":";AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,QAAQ,QAAQ,cAAc;AACvC,OAAO,KAAKC,QAAQ,MAAM,gCAAgC;;AAE1D;AACA,MAAMC,eAAe,GAAGF,QAAQ,CAACG,EAAE,KAAK,KAAK,GACzC;EAAEC,GAAG,EAAE,EAAE;EAAEC,MAAM,EAAE;AAAG,CAAC,GACvB;EAAED,GAAG,EAAE,EAAE;EAAEC,MAAM,EAAE;AAAE,CAAC;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAC7B,MAAAC,OAAA,GAAgBV,UAAU,CAACE,QAAQ,CAAAS,qBAAsB,CAAC;EAC1D,MAAAC,OAAA,GAAgBV,QAAQ,CAAAW,oBAA6B,EAAAC,MAAA;EACrD,IAAI,CAACJ,OAAmB,IAApB,CAAaE,OAAO;IAAA,OACfT,eAAe;EAAA;EAGjB,MAAAY,EAAA,GAAAC,IAAI,CAAAC,GAAI,CAACP,OAAO,EAAAL,GAAU,IAAjB,CAAiB,EAAEO,OAAO,EAAAP,GAAU,IAAjB,CAAiB,CAAC;EAC3C,MAAAa,EAAA,GAAAF,IAAI,CAAAC,GAAI,CAACP,OAAO,EAAAJ,MAAa,IAApB,CAAoB,EAAEM,OAAO,EAAAN,MAAa,IAApB,CAAoB,CAAC;EAAA,IAAAa,EAAA;EAAA,IAAAX,CAAA,QAAAO,EAAA,IAAAP,CA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