@layers-app/shared 0.4.7 → 0.4.8
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/dist/assets/default-workspace-avatar.jpg.js +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.js +32 -32
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +76 -71
- package/dist/components/AppContainer/AppContainer.module.css.js +14 -14
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +77 -49
- package/dist/components/AppContainer/components/NavbarContent.d.ts.map +1 -1
- package/dist/components/AppContainer/components/NavbarContent.js +16 -2
- package/dist/components/AppContainer/components/ToolSidebar.d.ts +5 -0
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +42 -30
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +90 -90
- package/dist/components/AppContainer/types.d.ts +12 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.d.ts +0 -2
- package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.js +17 -22
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +22 -22
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +120 -172
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +28 -32
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts +3 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +237 -93
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +22 -20
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -4
- package/dist/components/Chat/CallMessage/CallMessage.module.css.js +8 -8
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +1 -1
- package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +1 -1
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +44 -44
- package/dist/components/Chat/ChatInput/index.d.ts +13 -1
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatInput/index.js +264 -164
- package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts +16 -0
- package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/useVoiceRecorder.js +83 -0
- package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +4 -4
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +20 -16
- package/dist/components/Chat/ChatMessage/index.d.ts +16 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatMessage/index.js +153 -118
- package/dist/components/Chat/ChatPill/ChatPill.module.css.js +1 -1
- package/dist/components/Chat/DialogItem/DialogItem.module.css.js +4 -4
- package/dist/components/Chat/DialogList/DialogList.module.css.js +1 -1
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
- package/dist/components/Chat/MessageActions/MessageActions.module.css.js +1 -1
- package/dist/components/Chat/MessageActions/index.d.ts +2 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageActions/index.js +188 -50
- package/dist/components/Chat/MessageAuthor/index.d.ts +7 -1
- package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageAuthor/index.js +39 -25
- package/dist/components/Chat/MessageForward/MessageForward.module.css.js +1 -1
- package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -12
- package/dist/components/Chat/MessageList/index.d.ts +17 -25
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageList/index.js +201 -149
- package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +3 -3
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +12 -12
- package/dist/components/Chat/MessageReply/MessageReply.module.css.js +7 -7
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +8 -8
- package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +1 -1
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +83 -72
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +94 -85
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +53 -11
- package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +43 -20
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +2 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +29 -26
- package/dist/components/CommentComposer/index.d.ts +1 -1
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +70 -68
- package/dist/components/CommentComposer/types.d.ts +6 -0
- package/dist/components/CommentComposer/types.d.ts.map +1 -1
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/CustomKBD/index.js +21 -22
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +129 -121
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EntityTitle/EntityTitle.d.ts +3 -4
- package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
- package/dist/components/EntityTitle/EntityTitle.js +81 -80
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.module.css.js +7 -7
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/helpers/conditions.d.ts.map +1 -1
- package/dist/components/FormViewer/helpers/conditions.js +33 -17
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/InfiniteScroll.d.ts +12 -0
- package/dist/components/Notification/InfiniteScroll.d.ts.map +1 -0
- package/dist/components/Notification/InfiniteScroll.js +42 -0
- package/dist/components/Notification/Notification.d.ts +4 -1
- package/dist/components/Notification/Notification.d.ts.map +1 -1
- package/dist/components/Notification/Notification.module.css.js +28 -4
- package/dist/components/Notification/atoms/ActionBadge.d.ts +11 -0
- package/dist/components/Notification/atoms/ActionBadge.d.ts.map +1 -0
- package/dist/components/Notification/atoms/ActionBadge.js +53 -0
- package/dist/components/Notification/atoms/ArchiveIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/ArchiveIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/ArchiveIcon.js +40 -0
- package/dist/components/Notification/atoms/InboxIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/InboxIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/InboxIcon.js +33 -0
- package/dist/components/Notification/atoms/MarkReadIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/MarkReadIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/MarkReadIcon.js +33 -0
- package/dist/components/Notification/atoms/ResourceIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/ResourceIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/TabBadge.d.ts +7 -0
- package/dist/components/Notification/atoms/TabBadge.d.ts.map +1 -0
- package/dist/components/Notification/atoms/TabBadge.js +32 -0
- package/dist/components/Notification/atoms/UnreadDot.d.ts +6 -0
- package/dist/components/Notification/atoms/UnreadDot.d.ts.map +1 -0
- package/dist/components/Notification/atoms/UnreadDot.js +23 -0
- package/dist/components/Notification/atoms/index.d.ts +5 -0
- package/dist/components/Notification/atoms/index.d.ts.map +1 -0
- package/dist/components/Notification/hooks/index.d.ts +8 -0
- package/dist/components/Notification/hooks/index.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxActions.d.ts +12 -0
- package/dist/components/Notification/hooks/useInboxActions.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxActions.js +58 -0
- package/dist/components/Notification/hooks/useInboxLoader.d.ts +8 -0
- package/dist/components/Notification/hooks/useInboxLoader.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxLoader.js +49 -0
- package/dist/components/Notification/hooks/useNotificationItem.d.ts +26 -0
- package/dist/components/Notification/hooks/useNotificationItem.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationItem.js +51 -0
- package/dist/components/Notification/hooks/useNotificationStore.d.ts +49 -0
- package/dist/components/Notification/hooks/useNotificationStore.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationStore.js +139 -0
- package/dist/components/Notification/hooks/useNotificationStream.d.ts +2 -0
- package/dist/components/Notification/hooks/useNotificationStream.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationStream.js +86 -0
- package/dist/components/Notification/hooks/useNotificationTime.d.ts +2 -0
- package/dist/components/Notification/hooks/useNotificationTime.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationTime.js +23 -0
- package/dist/components/Notification/hooks/useNotificationsApi.d.ts +25 -0
- package/dist/components/Notification/hooks/useNotificationsApi.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationsApi.js +64 -0
- package/dist/components/Notification/lib/api.d.ts +4 -0
- package/dist/components/Notification/lib/api.d.ts.map +1 -0
- package/dist/components/Notification/lib/api.js +19 -0
- package/dist/components/Notification/lib/index.d.ts +5 -0
- package/dist/components/Notification/lib/index.d.ts.map +1 -0
- package/dist/components/Notification/lib/notificationText.d.ts +10 -0
- package/dist/components/Notification/lib/notificationText.d.ts.map +1 -0
- package/dist/components/Notification/lib/notificationText.js +131 -0
- package/dist/components/Notification/lib/stripHtml.d.ts +2 -0
- package/dist/components/Notification/lib/stripHtml.d.ts.map +1 -0
- package/dist/components/Notification/lib/stripHtml.js +6 -0
- package/dist/components/Notification/lib/types.d.ts +45 -0
- package/dist/components/Notification/lib/types.d.ts.map +1 -0
- package/dist/components/Notification/lib/types.js +9 -0
- package/dist/components/Notification/molecules/InboxEmpty.d.ts +8 -0
- package/dist/components/Notification/molecules/InboxEmpty.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxEmpty.js +21 -0
- package/dist/components/Notification/molecules/InboxHeader.d.ts +17 -0
- package/dist/components/Notification/molecules/InboxHeader.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxHeader.js +73 -0
- package/dist/components/Notification/molecules/InboxTabs.d.ts +15 -0
- package/dist/components/Notification/molecules/InboxTabs.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxTabs.js +60 -0
- package/dist/components/Notification/molecules/NotificationActions.d.ts +9 -0
- package/dist/components/Notification/molecules/NotificationActions.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationActions.js +64 -0
- package/dist/components/Notification/molecules/NotificationAvatar.d.ts +17 -0
- package/dist/components/Notification/molecules/NotificationAvatar.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationAvatar.js +38 -0
- package/dist/components/Notification/molecules/NotificationContent.d.ts +22 -0
- package/dist/components/Notification/molecules/NotificationContent.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationContent.js +183 -0
- package/dist/components/Notification/molecules/index.d.ts +7 -0
- package/dist/components/Notification/molecules/index.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxItem.d.ts +14 -0
- package/dist/components/Notification/organisms/InboxItem.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxItem.js +100 -0
- package/dist/components/Notification/organisms/InboxPanel.d.ts +4 -0
- package/dist/components/Notification/organisms/InboxPanel.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxPanel.js +99 -0
- package/dist/components/Notification/organisms/index.d.ts +3 -0
- package/dist/components/Notification/organisms/index.d.ts.map +1 -0
- package/dist/components/PillTabs/PillTabs.module.css.js +1 -1
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/components/modals/RemoveConfirmModal.js +27 -26
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +29 -28
- package/dist/helpers/getFileIcons.js +5 -5
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +11 -2
- package/dist/helpers/platform.d.ts +1 -1
- package/dist/helpers/platform.d.ts.map +1 -1
- package/dist/helpers/platform.js +1 -0
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.module.css.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +560 -571
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.context.js +15 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.js +228 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.module.css.js +4 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioControls.js +19 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioMuteButton.js +30 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioPlayButton.js +40 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSkipButton.js +28 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpectrum.js +137 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpeedControl.js +31 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeDisplay.js +44 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeline.js +71 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioVolumeSlider.js +43 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioWaveform.js +166 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/use-audio.js +201 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.context.js +15 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.js +272 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.module.css.js +4 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoCaptionsButton.js +55 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoControls.js +30 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoFullscreenButton.js +31 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoMuteButton.js +29 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPiPButton.js +29 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPlayButton.js +28 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoSkipButton.js +27 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeDisplay.js +44 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeline.js +70 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/use-video.js +170 -0
- package/docs/README.md +499 -499
- package/package.json +80 -79
- package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.d.ts +0 -15
- package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.d.ts.map +0 -1
- package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.js +0 -36
- package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.d.ts +0 -14
- package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.d.ts.map +0 -1
- package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.js +0 -31
- package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.d.ts +0 -18
- package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.d.ts.map +0 -1
- package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.js +0 -35
- package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts +0 -33
- package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts.map +0 -1
- package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.js +0 -70
- package/dist/components/Notification/Notification.js +0 -119
- package/dist/components/Notification/NotificationCard.d.ts +0 -10
- package/dist/components/Notification/NotificationCard.d.ts.map +0 -1
- package/dist/components/Notification/NotificationCard.js +0 -93
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +0 -24
- package/dist/components/VideoPlayer/VideoPlayer.d.ts.map +0 -1
- package/dist/components/VideoPlayer/VideoPlayer.js +0 -727
- package/dist/components/VideoPlayer/components/MobileDrawer/index.d.ts +0 -8
- package/dist/components/VideoPlayer/components/MobileDrawer/index.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/MobileDrawer/index.js +0 -67
- package/dist/components/VideoPlayer/components/SelectListOptionButton.d.ts +0 -7
- package/dist/components/VideoPlayer/components/SelectListOptionButton.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/SelectListOptionButton.js +0 -44
- package/dist/components/VideoPlayer/components/StoryboardPreview.d.ts +0 -9
- package/dist/components/VideoPlayer/components/StoryboardPreview.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/StoryboardPreview.js +0 -38
- package/dist/components/VideoPlayer/components/VideoCustomControls.d.ts +0 -33
- package/dist/components/VideoPlayer/components/VideoCustomControls.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoCustomControls.js +0 -601
- package/dist/components/VideoPlayer/components/VideoIcons.d.ts +0 -25
- package/dist/components/VideoPlayer/components/VideoIcons.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoIcons.js +0 -145
- package/dist/components/VideoPlayer/components/VideoMenu.d.ts +0 -27
- package/dist/components/VideoPlayer/components/VideoMenu.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoMenu.js +0 -77
- package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.d.ts +0 -17
- package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.js +0 -289
- package/dist/components/VideoPlayer/components/VideoQualityMenu/index.d.ts +0 -10
- package/dist/components/VideoPlayer/components/VideoQualityMenu/index.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoQualityMenu/index.js +0 -55
- package/dist/components/VideoPlayer/components/VideoSelect.d.ts +0 -10
- package/dist/components/VideoPlayer/components/VideoSelect.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSelect.js +0 -168
- package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.d.ts +0 -12
- package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.js +0 -48
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.d.ts +0 -25
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.js +0 -384
- package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.d.ts +0 -21
- package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.js +0 -264
- package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.d.ts +0 -10
- package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.js +0 -39
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.d.ts +0 -14
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.js +0 -360
- package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitleTrackRow.d.ts +0 -16
- package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitleTrackRow.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitlesSection.d.ts +0 -14
- package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitlesSection.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsModal/context.d.ts +0 -4
- package/dist/components/VideoPlayer/components/VideoSettingsModal/context.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsModal/context.js +0 -14
- package/dist/components/VideoPlayer/components/VideoSettingsModal/index.d.ts +0 -22
- package/dist/components/VideoPlayer/components/VideoSettingsModal/index.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSettingsModal/index.js +0 -211
- package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.d.ts +0 -11
- package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.js +0 -41
- package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.d.ts +0 -10
- package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.d.ts.map +0 -1
- package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.js +0 -69
- package/dist/components/VideoPlayer/hooks/useStoryboard.d.ts +0 -21
- package/dist/components/VideoPlayer/hooks/useStoryboard.d.ts.map +0 -1
- package/dist/components/VideoPlayer/hooks/useStoryboard.js +0 -91
- package/dist/components/VideoPlayer/index.d.ts +0 -11
- package/dist/components/VideoPlayer/index.d.ts.map +0 -1
- package/dist/components/VideoPlayer/types.d.ts +0 -101
- package/dist/components/VideoPlayer/types.d.ts.map +0 -1
- package/dist/components/VideoPlayer/utils/chapters.d.ts +0 -8
- package/dist/components/VideoPlayer/utils/chapters.d.ts.map +0 -1
- package/dist/components/VideoPlayer/utils/chapters.js +0 -38
- package/dist/components/VideoPlayer/utils/storyboard.d.ts +0 -5
- package/dist/components/VideoPlayer/utils/storyboard.d.ts.map +0 -1
- package/dist/components/VideoPlayer/utils/storyboard.js +0 -47
- package/dist/components/VideoPlayer/utils/subtitles.d.ts +0 -18
- package/dist/components/VideoPlayer/utils/subtitles.d.ts.map +0 -1
- package/dist/components/VideoPlayer/utils/subtitles.js +0 -23
- package/dist/components/VideoPlayer/utils/touch.d.ts +0 -3
- package/dist/components/VideoPlayer/utils/touch.d.ts.map +0 -1
- package/dist/components/VideoPlayer/utils/touch.js +0 -5
- package/dist/components/VideoPlayer/utils/videoPlayerUtils.d.ts +0 -10
- package/dist/components/VideoPlayer/utils/videoPlayerUtils.d.ts.map +0 -1
- package/dist/components/VideoPlayer/utils/videoPlayerUtils.js +0 -22
- package/dist/components/VideoPlayer/utils/videoSettings.d.ts +0 -69
- package/dist/components/VideoPlayer/utils/videoSettings.d.ts.map +0 -1
- package/dist/components/VideoPlayer/utils/videoSettings.js +0 -90
- package/dist/videoSettings/createVideoSettingsDataSource.d.ts +0 -19
- package/dist/videoSettings/createVideoSettingsDataSource.d.ts.map +0 -1
- package/dist/videoSettings/createVideoSettingsDataSource.js +0 -127
|
@@ -1,257 +1,333 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Edit04Icon as
|
|
4
|
-
import { HugeiconsIcon as
|
|
5
|
-
import { Box as
|
|
6
|
-
import { AttachmentsPreview as
|
|
7
|
-
import { EmojiPicker as
|
|
8
|
-
import { IconEntity as
|
|
9
|
-
import { SmilePlusIcon as
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as O, useRef as N, useEffect as q, useCallback as d } from "react";
|
|
3
|
+
import { Edit04Icon as fe, LinkBackwardIcon as pe, Image01Icon as ve, PlayIcon as ge, File01Icon as xe, AtIcon as Ne, Attachment02Icon as Ie, Delete02Icon as we, Mic01Icon as Ce, Sent02Icon as ze } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as u } from "@hugeicons/react";
|
|
5
|
+
import { Box as J, Button as Re, CloseButton as A, Group as ke, Text as Q, ActionIcon as I, Textarea as Pe } from "@mantine/core";
|
|
6
|
+
import { AttachmentsPreview as be } from "../../AttachmentsPreview/AttachmentsPreview.js";
|
|
7
|
+
import { EmojiPicker as ye } from "../../EmojiPicker/EmojiPicker.js";
|
|
8
|
+
import { IconEntity as Be } from "../../ProjectIcon/ProjectIcon.js";
|
|
9
|
+
import { SmilePlusIcon as De } from "./smilePlusIcon.js";
|
|
10
|
+
import { useVoiceRecorder as Me, isVoiceRecordingSupported as Ae } from "./useVoiceRecorder.js";
|
|
11
|
+
import t from "./ChatInput.module.css.js";
|
|
12
|
+
function Se({
|
|
13
|
+
value: S,
|
|
13
14
|
onChange: E,
|
|
14
|
-
onSend:
|
|
15
|
-
onAttach:
|
|
16
|
-
onEmojiSelect:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
onSend: $,
|
|
16
|
+
onAttach: g,
|
|
17
|
+
onEmojiSelect: R,
|
|
18
|
+
onMention: j,
|
|
19
|
+
onGifSelect: F,
|
|
20
|
+
onVoiceRecorded: k,
|
|
21
|
+
placeholder: W = "Add a message...",
|
|
22
|
+
replyTo: a,
|
|
23
|
+
editing: m,
|
|
24
|
+
notice: c,
|
|
25
|
+
attachments: l,
|
|
26
|
+
onRemoveAttachment: Y,
|
|
27
|
+
maxLength: Z,
|
|
28
|
+
disabled: s,
|
|
29
|
+
disableAttachments: w,
|
|
30
|
+
className: _,
|
|
31
|
+
style: ee
|
|
29
32
|
}) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
(
|
|
38
|
-
}, [
|
|
39
|
-
const
|
|
40
|
-
(
|
|
41
|
-
|
|
33
|
+
const P = S !== void 0, [ne, te] = O(""), p = P ? S : ne, C = N(null), b = N(null), K = N(l?.length ?? 0);
|
|
34
|
+
q(() => {
|
|
35
|
+
const e = l?.length ?? 0;
|
|
36
|
+
e > K.current && b.current?.focus(), K.current = e;
|
|
37
|
+
}, [l?.length]);
|
|
38
|
+
const T = !!a, H = !!m;
|
|
39
|
+
q(() => {
|
|
40
|
+
(T || H) && b.current?.focus();
|
|
41
|
+
}, [T, H]);
|
|
42
|
+
const x = d(
|
|
43
|
+
(e) => {
|
|
44
|
+
P || te(e), E?.(e);
|
|
42
45
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
const
|
|
46
|
-
(
|
|
47
|
-
}, [
|
|
48
|
-
(
|
|
49
|
-
|
|
46
|
+
[P, E]
|
|
47
|
+
), y = d(() => {
|
|
48
|
+
const e = p.trim();
|
|
49
|
+
(e || l && l.length > 0) && ($?.(e), x(""));
|
|
50
|
+
}, [p, l, $, x]), ie = d(
|
|
51
|
+
(e) => {
|
|
52
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), y());
|
|
50
53
|
},
|
|
51
|
-
[
|
|
52
|
-
),
|
|
53
|
-
(
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
[y]
|
|
55
|
+
), ae = d(
|
|
56
|
+
(e) => {
|
|
57
|
+
const i = Be.parse(e)?.emoji ?? e;
|
|
58
|
+
R ? R(i) : x(p + i);
|
|
56
59
|
},
|
|
57
|
-
[
|
|
58
|
-
),
|
|
59
|
-
(
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
[R, x, p]
|
|
61
|
+
), re = d(
|
|
62
|
+
(e) => {
|
|
63
|
+
const i = e.target.files;
|
|
64
|
+
i && i.length > 0 && g?.(Array.from(i)), C.current && (C.current.value = "");
|
|
62
65
|
},
|
|
63
|
-
[
|
|
64
|
-
),
|
|
65
|
-
(
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
const
|
|
70
|
-
for (let
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
|
|
66
|
+
[g]
|
|
67
|
+
), se = d(
|
|
68
|
+
(e) => {
|
|
69
|
+
if (s || w || !g) return;
|
|
70
|
+
const i = e.clipboardData?.items;
|
|
71
|
+
if (!i) return;
|
|
72
|
+
const h = [];
|
|
73
|
+
for (let f = 0; f < i.length; f++) {
|
|
74
|
+
const G = i[f];
|
|
75
|
+
if (G.kind === "file") {
|
|
76
|
+
const L = G.getAsFile();
|
|
77
|
+
L && h.push(L);
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
|
-
|
|
80
|
+
h.length > 0 && (e.preventDefault(), g(h));
|
|
78
81
|
},
|
|
79
|
-
[
|
|
80
|
-
),
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
[s, w, g]
|
|
83
|
+
), oe = p.trim().length > 0, B = l && l.length > 0, U = B && l.some((e) => "isTemp" in e && e.isTemp), V = oe || B && !U, ce = !!(m || a), o = Me(), le = !!k && Ae() && !V && !m && !s, [v, z] = O(!1), D = N(!1), X = N(0), M = d(
|
|
84
|
+
async (e) => {
|
|
85
|
+
if (e || v) {
|
|
86
|
+
o.cancel(), z(!1);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const i = await o.stop();
|
|
90
|
+
if (z(!1), i && i.blob.size > 0 && i.durationMs >= 500) {
|
|
91
|
+
const h = i.mime.includes("mp4") ? "m4a" : i.mime.includes("ogg") ? "ogg" : "webm", f = new File([i.blob], `voice-message.${h}`, {
|
|
92
|
+
type: i.mime
|
|
93
|
+
});
|
|
94
|
+
k?.(f, i.durationMs);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
[v, o, k]
|
|
98
|
+
), de = d(
|
|
99
|
+
async (e) => {
|
|
100
|
+
if (s) return;
|
|
101
|
+
e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId), X.current = e.clientX, D.current = !0, z(!1), await o.start() && !D.current && o.cancel();
|
|
102
|
+
},
|
|
103
|
+
[s, o]
|
|
104
|
+
), me = d(
|
|
105
|
+
(e) => {
|
|
106
|
+
if (!o.isRecording) return;
|
|
107
|
+
const i = e.clientX - X.current;
|
|
108
|
+
z(i < -90);
|
|
109
|
+
},
|
|
110
|
+
[o.isRecording]
|
|
111
|
+
), ue = d(
|
|
112
|
+
(e) => {
|
|
113
|
+
e.currentTarget.releasePointerCapture?.(e.pointerId), D.current = !1, M(!1);
|
|
114
|
+
},
|
|
115
|
+
[M]
|
|
116
|
+
), he = (e) => {
|
|
117
|
+
const i = Math.floor(e / 1e3), h = Math.floor(i / 60), f = i % 60;
|
|
118
|
+
return `${h}:${f.toString().padStart(2, "0")}`;
|
|
119
|
+
};
|
|
120
|
+
return /* @__PURE__ */ r(
|
|
121
|
+
J,
|
|
83
122
|
{
|
|
84
|
-
className: `${
|
|
85
|
-
style:
|
|
123
|
+
className: `${t.root} ${_ || ""}`,
|
|
124
|
+
style: ee,
|
|
86
125
|
"data-testid": "chat-input",
|
|
87
126
|
px: "md",
|
|
88
127
|
pb: "md",
|
|
89
128
|
children: [
|
|
90
|
-
!
|
|
129
|
+
!w && /* @__PURE__ */ n(
|
|
91
130
|
"input",
|
|
92
131
|
{
|
|
93
|
-
ref:
|
|
132
|
+
ref: C,
|
|
94
133
|
type: "file",
|
|
95
134
|
multiple: !0,
|
|
96
135
|
accept: "*/*",
|
|
97
|
-
className:
|
|
98
|
-
onChange:
|
|
136
|
+
className: t.hiddenFileInput,
|
|
137
|
+
onChange: re,
|
|
99
138
|
tabIndex: -1
|
|
100
139
|
}
|
|
101
140
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ r("div", { className: t.inputRow, children: [
|
|
142
|
+
/* @__PURE__ */ r(
|
|
104
143
|
"div",
|
|
105
144
|
{
|
|
106
|
-
className: `${
|
|
107
|
-
"data-disabled":
|
|
145
|
+
className: `${t.inputBox} ${ce ? t.withHeader : ""}`,
|
|
146
|
+
"data-disabled": s || void 0,
|
|
108
147
|
children: [
|
|
109
|
-
|
|
148
|
+
c ? /* @__PURE__ */ r(
|
|
110
149
|
"div",
|
|
111
150
|
{
|
|
112
|
-
className:
|
|
113
|
-
"data-variant":
|
|
151
|
+
className: t.notice,
|
|
152
|
+
"data-variant": c.variant ?? "warning",
|
|
114
153
|
children: [
|
|
115
|
-
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
119
|
-
|
|
154
|
+
c.icon ? /* @__PURE__ */ n("span", { className: t.noticeIcon, children: c.icon }) : null,
|
|
155
|
+
/* @__PURE__ */ r("div", { className: t.noticeMain, children: [
|
|
156
|
+
/* @__PURE__ */ n("span", { className: t.noticeText, children: c.text }),
|
|
157
|
+
c.action ? /* @__PURE__ */ n(
|
|
158
|
+
Re,
|
|
120
159
|
{
|
|
121
160
|
size: "compact-xs",
|
|
122
161
|
variant: "white",
|
|
123
162
|
radius: "xl",
|
|
124
|
-
className:
|
|
125
|
-
onClick:
|
|
126
|
-
children:
|
|
163
|
+
className: t.noticeAction,
|
|
164
|
+
onClick: c.action.onClick,
|
|
165
|
+
children: c.action.label
|
|
127
166
|
}
|
|
128
167
|
) : null
|
|
129
168
|
] }),
|
|
130
|
-
|
|
131
|
-
|
|
169
|
+
c.onDismiss ? /* @__PURE__ */ n(
|
|
170
|
+
A,
|
|
132
171
|
{
|
|
133
172
|
size: "sm",
|
|
134
|
-
className:
|
|
135
|
-
onClick:
|
|
173
|
+
className: t.noticeDismiss,
|
|
174
|
+
onClick: c.onDismiss,
|
|
136
175
|
"aria-label": "Dismiss"
|
|
137
176
|
}
|
|
138
177
|
) : null
|
|
139
178
|
]
|
|
140
179
|
}
|
|
141
180
|
) : null,
|
|
142
|
-
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
181
|
+
m ? /* @__PURE__ */ r("div", { className: t.header, children: [
|
|
182
|
+
/* @__PURE__ */ n("div", { className: t.headerIcon, children: /* @__PURE__ */ n(u, { icon: fe, size: 20 }) }),
|
|
183
|
+
/* @__PURE__ */ r("div", { className: t.headerBar, "data-variant": "edit", children: [
|
|
184
|
+
/* @__PURE__ */ n("div", { className: t.headerTitle, "data-variant": "edit", children: "Edit" }),
|
|
185
|
+
/* @__PURE__ */ n("div", { className: t.headerText, children: m.text })
|
|
147
186
|
] }),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
187
|
+
/* @__PURE__ */ n(
|
|
188
|
+
A,
|
|
150
189
|
{
|
|
151
190
|
size: "sm",
|
|
152
|
-
onClick:
|
|
191
|
+
onClick: m.onCancel,
|
|
153
192
|
"aria-label": "Close"
|
|
154
193
|
}
|
|
155
194
|
)
|
|
156
|
-
] }) :
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
if (
|
|
162
|
-
if (
|
|
163
|
-
const
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
195
|
+
] }) : a ? /* @__PURE__ */ r("div", { className: t.header, children: [
|
|
196
|
+
/* @__PURE__ */ n("div", { className: t.headerIcon, children: /* @__PURE__ */ n(u, { icon: pe, size: 20 }) }),
|
|
197
|
+
/* @__PURE__ */ r("div", { className: t.headerBar, "data-variant": "reply", children: [
|
|
198
|
+
/* @__PURE__ */ n("div", { className: t.headerTitle, "data-variant": "reply", children: a.senderName }),
|
|
199
|
+
/* @__PURE__ */ n("div", { className: t.headerText, children: (() => {
|
|
200
|
+
if (a.text && a.text.trim().length > 0) return a.text;
|
|
201
|
+
if (a.attachmentName) {
|
|
202
|
+
const i = a.attachmentKind === "image" ? ve : a.attachmentKind === "video" ? ge : xe;
|
|
203
|
+
return /* @__PURE__ */ r("span", { className: t.headerAttachment, children: [
|
|
204
|
+
/* @__PURE__ */ n(u, { icon: i, size: 14 }),
|
|
205
|
+
/* @__PURE__ */ n("span", { children: a.attachmentName })
|
|
167
206
|
] });
|
|
168
207
|
}
|
|
169
208
|
return "";
|
|
170
209
|
})() })
|
|
171
210
|
] }),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
|
|
211
|
+
/* @__PURE__ */ n(
|
|
212
|
+
A,
|
|
174
213
|
{
|
|
175
214
|
size: "sm",
|
|
176
|
-
onClick:
|
|
215
|
+
onClick: a.onCancel,
|
|
177
216
|
"aria-label": "Close"
|
|
178
217
|
}
|
|
179
218
|
)
|
|
180
219
|
] }) : null,
|
|
181
|
-
|
|
182
|
-
|
|
220
|
+
B && /* @__PURE__ */ n("div", { className: t.attachments, children: /* @__PURE__ */ n(
|
|
221
|
+
be,
|
|
183
222
|
{
|
|
184
|
-
files:
|
|
223
|
+
files: l,
|
|
185
224
|
mode: "draft",
|
|
186
|
-
onRemove:
|
|
225
|
+
onRemove: Y
|
|
187
226
|
}
|
|
188
227
|
) }),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
228
|
+
o.isRecording ? /* @__PURE__ */ n("div", { className: t.inputArea, children: /* @__PURE__ */ r(ke, { gap: "sm", wrap: "nowrap", w: "100%", px: 6, py: 4, children: [
|
|
229
|
+
/* @__PURE__ */ n(
|
|
230
|
+
J,
|
|
231
|
+
{
|
|
232
|
+
w: 10,
|
|
233
|
+
h: 10,
|
|
234
|
+
style: {
|
|
235
|
+
borderRadius: "50%",
|
|
236
|
+
background: "var(--mantine-color-red-6)"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ n(Q, { fw: 600, c: "red", children: he(o.durationMs) }),
|
|
241
|
+
/* @__PURE__ */ n(
|
|
242
|
+
Q,
|
|
243
|
+
{
|
|
244
|
+
size: "sm",
|
|
245
|
+
c: v ? "red" : "dimmed",
|
|
246
|
+
ml: "auto",
|
|
247
|
+
style: { userSelect: "none" },
|
|
248
|
+
children: v ? "Отпустите для отмены" : "‹ Отведите для отмены"
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
] }) }) : /* @__PURE__ */ r("div", { className: t.inputArea, children: [
|
|
252
|
+
/* @__PURE__ */ n(
|
|
253
|
+
ye,
|
|
192
254
|
{
|
|
193
|
-
onChange:
|
|
255
|
+
onChange: ae,
|
|
194
256
|
showIcons: !1,
|
|
195
|
-
showGifs: !!
|
|
196
|
-
onSelectGif:
|
|
257
|
+
showGifs: !!F && !m,
|
|
258
|
+
onSelectGif: F,
|
|
197
259
|
showRemoveButton: !1,
|
|
198
260
|
showRandomButton: !1,
|
|
199
261
|
position: "top-start",
|
|
200
262
|
closeOnSelect: !1,
|
|
201
263
|
withinPortal: !0,
|
|
202
|
-
children: /* @__PURE__ */
|
|
203
|
-
|
|
264
|
+
children: /* @__PURE__ */ n(
|
|
265
|
+
I,
|
|
204
266
|
{
|
|
205
267
|
variant: "subtle",
|
|
206
268
|
radius: "xl",
|
|
207
269
|
size: 34,
|
|
208
270
|
color: "gray",
|
|
209
|
-
className:
|
|
271
|
+
className: t.iconButton,
|
|
210
272
|
"aria-label": "Emoji",
|
|
211
|
-
disabled:
|
|
212
|
-
children: /* @__PURE__ */
|
|
273
|
+
disabled: s,
|
|
274
|
+
children: /* @__PURE__ */ n(u, { icon: De, size: 24 })
|
|
213
275
|
}
|
|
214
276
|
)
|
|
215
277
|
}
|
|
216
278
|
),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
|
|
279
|
+
/* @__PURE__ */ n(
|
|
280
|
+
Pe,
|
|
219
281
|
{
|
|
220
|
-
ref:
|
|
282
|
+
ref: b,
|
|
221
283
|
classNames: {
|
|
222
|
-
root:
|
|
223
|
-
input:
|
|
284
|
+
root: t.textarea,
|
|
285
|
+
input: t.textareaInput
|
|
224
286
|
},
|
|
225
287
|
w: "100%",
|
|
226
288
|
flex: 1,
|
|
227
|
-
value:
|
|
228
|
-
onChange: (
|
|
229
|
-
onPaste:
|
|
230
|
-
onKeyDown:
|
|
231
|
-
placeholder:
|
|
289
|
+
value: p,
|
|
290
|
+
onChange: (e) => x(e.currentTarget.value),
|
|
291
|
+
onPaste: se,
|
|
292
|
+
onKeyDown: ie,
|
|
293
|
+
placeholder: W,
|
|
232
294
|
autosize: !0,
|
|
233
295
|
minRows: 1,
|
|
234
296
|
maxRows: 6,
|
|
235
|
-
disabled:
|
|
297
|
+
disabled: s,
|
|
236
298
|
variant: "unstyled",
|
|
237
|
-
maxLength:
|
|
299
|
+
maxLength: Z
|
|
238
300
|
}
|
|
239
301
|
),
|
|
240
|
-
|
|
241
|
-
|
|
302
|
+
j && /* @__PURE__ */ n(
|
|
303
|
+
I,
|
|
242
304
|
{
|
|
243
305
|
variant: "subtle",
|
|
244
306
|
radius: "xl",
|
|
245
307
|
size: 34,
|
|
246
308
|
color: "gray",
|
|
247
|
-
className:
|
|
309
|
+
className: t.iconButton,
|
|
310
|
+
"aria-label": "Mention",
|
|
311
|
+
onClick: j,
|
|
312
|
+
disabled: s,
|
|
313
|
+
children: /* @__PURE__ */ n(u, { icon: Ne, size: 24 })
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
!w && !m && /* @__PURE__ */ n(
|
|
317
|
+
I,
|
|
318
|
+
{
|
|
319
|
+
variant: "subtle",
|
|
320
|
+
radius: "xl",
|
|
321
|
+
size: 34,
|
|
322
|
+
color: "gray",
|
|
323
|
+
className: t.iconButton,
|
|
248
324
|
"aria-label": "Attach file",
|
|
249
|
-
onClick: () =>
|
|
250
|
-
disabled:
|
|
251
|
-
children: /* @__PURE__ */
|
|
252
|
-
|
|
325
|
+
onClick: () => C.current?.click(),
|
|
326
|
+
disabled: s,
|
|
327
|
+
children: /* @__PURE__ */ n(
|
|
328
|
+
u,
|
|
253
329
|
{
|
|
254
|
-
icon:
|
|
330
|
+
icon: Ie,
|
|
255
331
|
size: 24,
|
|
256
332
|
style: { transform: "rotate(30deg)" }
|
|
257
333
|
}
|
|
@@ -262,19 +338,43 @@ function he({
|
|
|
262
338
|
]
|
|
263
339
|
}
|
|
264
340
|
),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
|
|
341
|
+
le ? /* @__PURE__ */ n(
|
|
342
|
+
I,
|
|
343
|
+
{
|
|
344
|
+
className: t.sendButton,
|
|
345
|
+
variant: "filled",
|
|
346
|
+
color: v || o.isRecording ? "red" : "indigo",
|
|
347
|
+
radius: 12,
|
|
348
|
+
size: 50,
|
|
349
|
+
onPointerDown: de,
|
|
350
|
+
onPointerMove: me,
|
|
351
|
+
onPointerUp: ue,
|
|
352
|
+
onPointerCancel: () => {
|
|
353
|
+
M(!0);
|
|
354
|
+
},
|
|
355
|
+
"aria-label": "Record voice message",
|
|
356
|
+
style: { touchAction: "none" },
|
|
357
|
+
children: /* @__PURE__ */ n(
|
|
358
|
+
u,
|
|
359
|
+
{
|
|
360
|
+
icon: v ? we : Ce,
|
|
361
|
+
size: 24
|
|
362
|
+
}
|
|
363
|
+
)
|
|
364
|
+
}
|
|
365
|
+
) : /* @__PURE__ */ n(
|
|
366
|
+
I,
|
|
267
367
|
{
|
|
268
|
-
className:
|
|
368
|
+
className: t.sendButton,
|
|
269
369
|
variant: "filled",
|
|
270
370
|
color: "indigo",
|
|
271
371
|
radius: 12,
|
|
272
372
|
size: 50,
|
|
273
|
-
onClick:
|
|
274
|
-
disabled:
|
|
275
|
-
loading:
|
|
373
|
+
onClick: y,
|
|
374
|
+
disabled: s || !V,
|
|
375
|
+
loading: U,
|
|
276
376
|
"aria-label": "Send message",
|
|
277
|
-
children: /* @__PURE__ */
|
|
377
|
+
children: /* @__PURE__ */ n(u, { icon: ze, size: 24 })
|
|
278
378
|
}
|
|
279
379
|
)
|
|
280
380
|
] })
|
|
@@ -282,7 +382,7 @@ function he({
|
|
|
282
382
|
}
|
|
283
383
|
);
|
|
284
384
|
}
|
|
285
|
-
|
|
385
|
+
Se.displayName = "ChatInput";
|
|
286
386
|
export {
|
|
287
|
-
|
|
387
|
+
Se as ChatInput
|
|
288
388
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function isVoiceRecordingSupported(): boolean;
|
|
2
|
+
export interface VoiceRecording {
|
|
3
|
+
blob: Blob;
|
|
4
|
+
durationMs: number;
|
|
5
|
+
mime: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UseVoiceRecorder {
|
|
8
|
+
isRecording: boolean;
|
|
9
|
+
durationMs: number;
|
|
10
|
+
error: string | null;
|
|
11
|
+
start: () => Promise<boolean>;
|
|
12
|
+
stop: () => Promise<VoiceRecording | null>;
|
|
13
|
+
cancel: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function useVoiceRecorder(): UseVoiceRecorder;
|
|
16
|
+
//# sourceMappingURL=useVoiceRecorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVoiceRecorder.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/ChatInput/useVoiceRecorder.ts"],"names":[],"mappings":"AAiBA,wBAAgB,yBAAyB,IAAI,OAAO,CAMnD;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,IAAI,EAAE,MAAM,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,gBAAgB,IAAI,gBAAgB,CA2HnD"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useState as v, useRef as t, useCallback as m, useEffect as A } from "react";
|
|
2
|
+
const C = [
|
|
3
|
+
"audio/webm;codecs=opus",
|
|
4
|
+
"audio/webm",
|
|
5
|
+
"audio/ogg;codecs=opus",
|
|
6
|
+
"audio/mp4"
|
|
7
|
+
];
|
|
8
|
+
function P() {
|
|
9
|
+
if (!(typeof MediaRecorder > "u")) {
|
|
10
|
+
for (const s of C)
|
|
11
|
+
if (MediaRecorder.isTypeSupported(s)) return s;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function V() {
|
|
15
|
+
return typeof window < "u" && typeof MediaRecorder < "u" && !!navigator.mediaDevices?.getUserMedia;
|
|
16
|
+
}
|
|
17
|
+
function _() {
|
|
18
|
+
const [s, n] = v(!1), [D, a] = v(0), [E, y] = v(null), o = t(null), R = t(null), i = t([]), w = t(0), M = t(0), l = t(null), d = t(!1), f = t(null), r = m(() => {
|
|
19
|
+
l.current !== null && (window.clearInterval(l.current), l.current = null), R.current?.getTracks().forEach((e) => e.stop()), R.current = null, o.current = null, i.current = [];
|
|
20
|
+
}, []);
|
|
21
|
+
A(() => () => r(), [r]);
|
|
22
|
+
const k = m(async () => {
|
|
23
|
+
if (o.current) return !1;
|
|
24
|
+
y(null);
|
|
25
|
+
try {
|
|
26
|
+
const e = await navigator.mediaDevices.getUserMedia({ audio: !0 }), c = P(), u = new MediaRecorder(
|
|
27
|
+
e,
|
|
28
|
+
c ? { mimeType: c } : void 0
|
|
29
|
+
);
|
|
30
|
+
return i.current = [], d.current = !1, u.ondataavailable = (p) => {
|
|
31
|
+
p.data.size > 0 && i.current.push(p.data);
|
|
32
|
+
}, u.onstop = () => {
|
|
33
|
+
const p = d.current, b = i.current.slice(), h = u.mimeType || c || "audio/webm", S = M.current - w.current, g = f.current;
|
|
34
|
+
if (f.current = null, r(), n(!1), a(0), !!g) {
|
|
35
|
+
if (p || b.length === 0) {
|
|
36
|
+
g(null);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
g({
|
|
40
|
+
blob: new Blob(b, { type: h }),
|
|
41
|
+
durationMs: S,
|
|
42
|
+
mime: h
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}, u.start(), o.current = u, R.current = e, w.current = Date.now(), a(0), n(!0), l.current = window.setInterval(() => {
|
|
46
|
+
a(Date.now() - w.current);
|
|
47
|
+
}, 100), !0;
|
|
48
|
+
} catch (e) {
|
|
49
|
+
return y(e instanceof Error ? e.message : "mic_unavailable"), r(), n(!1), !1;
|
|
50
|
+
}
|
|
51
|
+
}, [r]), I = m(
|
|
52
|
+
() => new Promise((e) => {
|
|
53
|
+
const c = o.current;
|
|
54
|
+
if (!c) {
|
|
55
|
+
e(null);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
d.current = !1, M.current = Date.now(), f.current = e;
|
|
59
|
+
try {
|
|
60
|
+
c.stop();
|
|
61
|
+
} catch {
|
|
62
|
+
f.current = null, r(), n(!1), e(null);
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
[r]
|
|
66
|
+
), T = m(() => {
|
|
67
|
+
const e = o.current;
|
|
68
|
+
if (d.current = !0, M.current = Date.now(), e)
|
|
69
|
+
try {
|
|
70
|
+
e.stop();
|
|
71
|
+
} catch {
|
|
72
|
+
r(), n(!1);
|
|
73
|
+
}
|
|
74
|
+
else
|
|
75
|
+
r(), n(!1);
|
|
76
|
+
a(0);
|
|
77
|
+
}, [r]);
|
|
78
|
+
return { isRecording: s, durationMs: D, error: E, start: k, stop: I, cancel: T };
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
V as isVoiceRecordingSupported,
|
|
82
|
+
_ as useVoiceRecorder
|
|
83
|
+
};
|