@mobilon-dev/chotto 0.3.121 → 0.3.124
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/chotto.css +1 -1
- package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js +4 -29
- package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +59 -40
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue.js +4 -47
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +82 -55
- package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +51 -86
- package/dist/components/1_atoms/EmbedPreview/EmbedPreview.vue.js +4 -32
- package/dist/components/1_atoms/EmbedPreview/EmbedPreview.vue2.js +28 -7
- package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.js +35 -22
- package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue2.js +2 -30
- package/dist/components/1_atoms/LinkPreview/LinkPreview.vue.js +4 -37
- package/dist/components/1_atoms/LinkPreview/LinkPreview.vue2.js +21 -7
- package/dist/components/1_atoms/LoadingIndicator/LoadingIndicator.vue.js +19 -30
- package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +4 -70
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +108 -76
- package/dist/components/1_icons/AvatarIcon.vue.js +8 -8
- package/dist/components/1_icons/CheckIcon.vue.js +13 -26
- package/dist/components/1_icons/CloseButtonIcon.vue.js +10 -16
- package/dist/components/1_icons/CloseIcon.vue.js +10 -16
- package/dist/components/1_icons/ContactCRMIcon.vue.js +10 -16
- package/dist/components/1_icons/DeletedMessageIcon.vue.js +11 -17
- package/dist/components/1_icons/MenuIcon.vue.js +10 -16
- package/dist/components/1_icons/MessageStatus/ErrorStatusIcon.vue.js +3 -23
- package/dist/components/1_icons/MessageStatus/ErrorStatusIcon.vue2.js +21 -12
- package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue.js +4 -36
- package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue2.js +26 -11
- package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue.js +3 -23
- package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue2.js +21 -12
- package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue.js +3 -23
- package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue2.js +20 -11
- package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue.js +4 -33
- package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue2.js +23 -11
- package/dist/components/1_icons/SearchIcon.vue.js +17 -29
- package/dist/components/1_icons/SettingsIcon.vue.js +8 -8
- package/dist/components/1_icons/TelegramIcon.vue.js +20 -32
- package/dist/components/1_icons/VerifiedBadge.vue.js +19 -25
- package/dist/components/1_icons/WhatsAppIcon.vue.js +20 -32
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +402 -552
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +58 -101
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelCheckIcon.vue.js +8 -14
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelConfirmSpinner.vue.js +7 -7
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelMaxIcon.vue.js +7 -7
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelPhoneIcon.vue.js +13 -19
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSMSIcon.vue.js +10 -16
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuMaxIcon.vue.js +23 -35
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuPhoneIcon.vue.js +20 -32
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuSMSIcon.vue.js +11 -17
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuTelegramIcon.vue.js +8 -8
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuWhatsAppIcon.vue.js +20 -32
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelTelegramIcon.vue.js +21 -33
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.js +7 -7
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelWhatsAppIcon.vue.js +8 -8
- package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue.js +4 -74
- package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue2.js +46 -12
- package/dist/components/2_blocks/FeedFoundObjects/FeedFoundObjects.vue.js +4 -62
- package/dist/components/2_blocks/FeedFoundObjects/FeedFoundObjects.vue2.js +36 -15
- package/dist/components/2_blocks/FeedSearch/FeedSearch.vue.js +4 -49
- package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +45 -22
- package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue.js +4 -36
- package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +37 -19
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +4 -62
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +98 -80
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.js +27 -31
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue2.js +2 -13
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.js +4 -72
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +83 -47
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.js +21 -19
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue2.js +2 -13
- package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +45 -76
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +4 -100
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +91 -16
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +4 -79
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +111 -88
- package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.js +17 -15
- package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue2.js +2 -13
- package/dist/components/2_chatinput_elements/PlaceholderComponent/PlaceholderComponent.vue.js +33 -39
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +4 -220
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +256 -146
- package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.js +41 -39
- package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue2.js +2 -13
- package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +163 -233
- package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js +4 -164
- package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +175 -87
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue.js +4 -73
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +58 -32
- package/dist/components/2_chatinput_elements/WABAQuickReplyButtons/WABAQuickReplyButtons.vue.js +4 -47
- package/dist/components/2_chatinput_elements/WABAQuickReplyButtons/WABAQuickReplyButtons.vue2.js +23 -10
- package/dist/components/2_chatinput_elements/WABASeparatedQuickButtons/WABASeparatedQuickButtons.vue.js +4 -52
- package/dist/components/2_chatinput_elements/WABASeparatedQuickButtons/WABASeparatedQuickButtons.vue2.js +26 -8
- package/dist/components/2_chatinput_elements/WABATemplateSelector/WABATemplateSelector.vue.js +220 -299
- package/dist/components/2_chatlist_elements/ChatFilter/ChatFilter.vue.js +35 -41
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +4 -306
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +314 -131
- package/dist/components/2_chatlist_elements/ChatItem/icons/AudioIcon.vue.js +12 -18
- package/dist/components/2_chatlist_elements/ChatItem/icons/FileIcon.vue.js +11 -23
- package/dist/components/2_chatlist_elements/ChatItem/icons/ImageIcon.vue.js +7 -7
- package/dist/components/2_chatlist_elements/ChatItem/icons/MissedCallIcon.vue.js +22 -34
- package/dist/components/2_chatlist_elements/ChatItem/icons/StickerIcon.vue.js +9 -15
- package/dist/components/2_chatlist_elements/ChatItem/icons/VideoIcon.vue.js +14 -26
- package/dist/components/2_chatlist_elements/ChatItem/icons/VoiceIcon.vue.js +7 -7
- package/dist/components/2_chatlist_elements/ChatTabs/ChatTabs.vue.js +24 -52
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +4 -84
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +68 -36
- package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +37 -71
- package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +62 -83
- package/dist/components/2_elements/ChatPanel/ChatPanel.vue.js +29 -41
- package/dist/components/2_elements/ContactInfo/ContactInfo.vue.js +115 -176
- package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +27 -48
- package/dist/components/2_elements/UserProfile/UserProfile.vue.js +28 -58
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +4 -54
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +42 -22
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +4 -460
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +499 -181
- package/dist/components/2_feed_elements/BaseEditMessage/BaseEditMessage.vue.js +4 -19
- package/dist/components/2_feed_elements/BaseEditMessage/BaseEditMessage.vue2.js +22 -12
- package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js +4 -26
- package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue2.js +39 -26
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +4 -482
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +448 -148
- package/dist/components/2_feed_elements/CallMessage/icons/IncomingCallIcon.vue.js +19 -17
- package/dist/components/2_feed_elements/CallMessage/icons/IncomingCallIcon.vue2.js +2 -13
- package/dist/components/2_feed_elements/CallMessage/icons/OutgoingCallIcon.vue.js +19 -17
- package/dist/components/2_feed_elements/CallMessage/icons/OutgoingCallIcon.vue2.js +2 -13
- package/dist/components/2_feed_elements/DateMessage/DateMessage.vue.js +4 -17
- package/dist/components/2_feed_elements/DateMessage/DateMessage.vue2.js +7 -7
- package/dist/components/2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js +3 -16
- package/dist/components/2_feed_elements/DateMessageSticky/DateMessageSticky.vue2.js +7 -7
- package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue.js +4 -67
- package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue2.js +43 -11
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +4 -47
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +46 -37
- package/dist/components/2_feed_elements/EditTextMessage/EditTextMessage.vue.js +4 -22
- package/dist/components/2_feed_elements/EditTextMessage/EditTextMessage.vue2.js +15 -8
- package/dist/components/2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js +4 -43
- package/dist/components/2_feed_elements/FeedKeyboard/FeedKeyboard.vue2.js +25 -10
- package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +4 -52
- package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +39 -16
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +4 -270
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +274 -95
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +4 -409
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +422 -143
- package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js +4 -39
- package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +22 -12
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +4 -57
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +69 -41
- package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue.js +4 -97
- package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue2.js +173 -102
- package/dist/components/2_feed_elements/MessageReactions/icons/DeleteIcon.vue.js +20 -32
- package/dist/components/2_feed_elements/MessageReactions/icons/EditIcon.vue.js +20 -32
- package/dist/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.js +11 -17
- package/dist/components/2_feed_elements/MessageReactions/icons/MessageActionsIcon.vue.js +10 -16
- package/dist/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.js +11 -17
- package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.js +4 -22
- package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue2.js +23 -17
- package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.js +4 -28
- package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue2.js +29 -27
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.js +4 -142
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +121 -33
- package/dist/components/2_feed_elements/MissedCallMessage/icons/MissedCallIcon.vue.js +22 -34
- package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue.js +4 -55
- package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue2.js +30 -8
- package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue.js +4 -47
- package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue2.js +25 -9
- package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue.js +4 -56
- package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue2.js +37 -8
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +4 -72
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +59 -10
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +4 -142
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +118 -34
- package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue.js +4 -49
- package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue2.js +53 -15
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +4 -94
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +76 -10
- package/dist/components/2_feed_elements/SplashScreen/SplashScreen.vue.js +4 -18
- package/dist/components/2_feed_elements/SplashScreen/SplashScreen.vue2.js +17 -9
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +4 -348
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +339 -97
- package/dist/components/2_feed_elements/SystemMessage/SystemMessage.vue.js +4 -17
- package/dist/components/2_feed_elements/SystemMessage/SystemMessage.vue2.js +7 -7
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +4 -308
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +299 -89
- package/dist/components/2_feed_elements/TypingMessage/TypingMessage.vue.js +4 -37
- package/dist/components/2_feed_elements/TypingMessage/TypingMessage.vue2.js +21 -7
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +4 -321
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +338 -96
- package/dist/components/2_modals/ConfirmDeleteMessage/ConfirmDeleteMessage.vue.js +4 -64
- package/dist/components/2_modals/ConfirmDeleteMessage/ConfirmDeleteMessage.vue3.js +45 -10
- package/dist/components/2_modals/CreateChat/CreateChat.vue.js +19 -36
- package/dist/components/2_modals/CreateChat2/CreateChat2.vue.js +92 -140
- package/dist/components/2_modals/CreateDialog/CreateDialog.vue.js +49 -96
- package/dist/components/2_modals/Modal/Modal.vue.js +50 -59
- package/dist/components/2_modals/ModalFullscreen/ModalFullscreen.vue.js +38 -51
- package/dist/components/2_modals/ModalNoFooter/ModalNoFooter.vue.js +30 -39
- package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue.js +4 -155
- package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue2.js +121 -49
- package/dist/components/2_modals/SelectUser/SelectUser.vue.js +43 -60
- package/dist/components/2_modals/SelectUser2/SelectUser2.vue.js +24 -41
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +4 -170
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +336 -239
- package/dist/components/3_compounds/ChatInput/icons/ArrowIcon.vue.js +25 -43
- package/dist/components/3_compounds/ChatInput/icons/SendIcon.vue.js +21 -25
- package/dist/components/3_compounds/ChatInput/icons/SendIcon.vue2.js +2 -13
- package/dist/components/3_compounds/ChatList/ChatList.vue.js +166 -256
- package/dist/components/3_compounds/ChatList/ChatListHeader.vue.js +39 -57
- package/dist/components/3_compounds/ChatList/icons/LogoIcon.vue.js +6 -6
- package/dist/components/3_compounds/Feed/Feed.vue.js +4 -185
- package/dist/components/3_compounds/Feed/Feed.vue2.js +314 -161
- package/dist/components/3_compounds/Feed/composables/useFeedScroll.js +19 -17
- package/dist/components/3_compounds/SideBar/SideBar.vue.js +202 -279
- package/dist/components/4_layouts/AdaptiveExtendedLayout/AdaptiveExtendedLayout.vue.js +36 -43
- package/dist/components/4_layouts/BaseLayout/BaseLayout.vue.js +5 -5
- package/dist/components/4_layouts/ChatWrapper/ChatWrapper.vue.js +4 -32
- package/dist/components/4_layouts/ChatWrapper/ChatWrapper.vue2.js +29 -7
- package/dist/components/4_layouts/ExtendedLayout/ExtendedLayout.vue.js +7 -7
- package/dist/components/4_layouts/FeedLayout/FeedLayout.vue.js +8 -8
- package/dist/components/5_containers/BaseContainer/BaseContainer.vue.js +18 -33
- package/dist/components/5_containers/FloatContainer/FloatContainer.vue.js +59 -90
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/src/apps/data/chats.d.ts +48 -4
- package/dist/types/src/apps/data/messages.d.ts +366 -282
- package/dist/types/src/components/2_chatlist_elements/ChatTabs/styles/types.d.ts +2 -0
- package/dist/types/src/components/3_compounds/Feed/composables/useFeedScroll.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useImmediateDebouncedRef as
|
|
3
|
-
import { MAX_ATTACHED_FILES as
|
|
4
|
-
import { useEmojiNative as
|
|
1
|
+
import { defineComponent as Ge, inject as Oe, watch as p, ref as b, computed as v, provide as Ue, nextTick as F, unref as r, onMounted as Ve, onUnmounted as Ye, createElementBlock as g, openBlock as h, normalizeClass as q, toDisplayString as N, Fragment as ie, createElementVNode as f, createVNode as z, createCommentVNode as V, renderList as Xe, createBlock as Je, renderSlot as oe, withDirectives as Qe, withKeys as Ze, vModelText as et } from "vue";
|
|
2
|
+
import { useImmediateDebouncedRef as tt } from "../../../hooks/useImmediateDebouncedRef.js";
|
|
3
|
+
import { MAX_ATTACHED_FILES as se, resolveMessageDraftStore as nt, useMessageDraft as lt, getDraftFiles as it } from "../../../hooks/useMessageDraft.js";
|
|
4
|
+
import { useEmojiNative as ot } from "../../../hooks/useEmojiNative.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { t as
|
|
7
|
+
import { t as m } from "../../../locale/useLocale.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
10
10
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
11
11
|
import "../../../functions/parseMarkdown.js";
|
|
12
|
-
import { textToAppleEmojiHtml as
|
|
13
|
-
import { useStartEdit as
|
|
14
|
-
import { canStartEditLastSent as
|
|
15
|
-
import { buildEditPayload as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
const
|
|
12
|
+
import { textToAppleEmojiHtml as st, textContainsEmoji as at, previousGraphemeIndex as ae, nextGraphemeIndex as re, snapIndexToGrapheme as ce } from "../../../functions/renderAppleEmojis.js";
|
|
13
|
+
import { useStartEdit as rt, hideEditPreview as ct } from "../../../hooks/messages/useStartEdit.js";
|
|
14
|
+
import { canStartEditLastSent as ut, isEditableLastSentCandidate as dt } from "../../../hooks/messages/canStartEditLastSent.js";
|
|
15
|
+
import { buildEditPayload as ft } from "../../../hooks/messages/buildEditPayload.js";
|
|
16
|
+
import pt from "./icons/SendIcon.vue.js";
|
|
17
|
+
import ue from "./icons/ArrowIcon.vue.js";
|
|
18
|
+
import ht from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
|
|
19
|
+
import mt from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
|
|
20
|
+
const vt = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "chat-input__disabled-placeholder",
|
|
23
|
+
"data-testid": "chat-input-disabled-placeholder"
|
|
24
|
+
}, gt = ["id"], yt = ["id"], St = { class: "chat-input__file-counter" }, _t = { class: "chat-input__file-chips-wrap" }, xt = ["aria-label"], bt = ["aria-label"], It = { class: "chat-input__inline-buttons" }, Ct = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "chat-input__input chat-input__disabled-placeholder"
|
|
27
|
+
}, Ft = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "chat-input__input-wrap"
|
|
30
|
+
}, Tt = ["innerHTML"], Et = ["disabled", "placeholder"], At = ["disabled"], wt = { class: "" }, Mt = { class: "chat-input__third-line" }, Y = 40, Jt = /* @__PURE__ */ Ge({
|
|
21
31
|
__name: "ChatInput",
|
|
22
32
|
props: {
|
|
23
33
|
state: {
|
|
@@ -47,7 +57,7 @@ const K = 40, Tt = /* @__PURE__ */ Pe({
|
|
|
47
57
|
maxAttachedFiles: {
|
|
48
58
|
type: Number,
|
|
49
59
|
required: !1,
|
|
50
|
-
default:
|
|
60
|
+
default: se
|
|
51
61
|
},
|
|
52
62
|
resolveEditLastSentMessage: {
|
|
53
63
|
type: Function,
|
|
@@ -56,46 +66,45 @@ const K = 40, Tt = /* @__PURE__ */ Pe({
|
|
|
56
66
|
}
|
|
57
67
|
},
|
|
58
68
|
emits: ["send", "typing"],
|
|
59
|
-
setup(
|
|
60
|
-
me();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
() => l().id,
|
|
69
|
+
setup(M, { emit: de }) {
|
|
70
|
+
const D = de, I = Oe("chatAppId"), fe = nt(I), { resetMessage: pe, getMessage: o, setMessageText: H, setForceSendMessage: he, resetEdit: me, removeMessageFile: ve } = lt(I), { startEdit: ge } = rt(I), { isNative: ye, emojiSrc: Se } = ot(I);
|
|
71
|
+
let X = o().id;
|
|
72
|
+
p(
|
|
73
|
+
() => o().id,
|
|
65
74
|
(e) => {
|
|
66
|
-
|
|
75
|
+
X = e;
|
|
67
76
|
}
|
|
68
77
|
);
|
|
69
|
-
const
|
|
70
|
-
let
|
|
71
|
-
const
|
|
72
|
-
function
|
|
73
|
-
const e =
|
|
78
|
+
const l = b(), T = b(), L = b(), E = b(null), R = b(!1), _e = tt("", 2e3), B = b(!1), j = b(!1);
|
|
79
|
+
let y = null;
|
|
80
|
+
const S = v(() => it(o()));
|
|
81
|
+
function K() {
|
|
82
|
+
const e = L.value;
|
|
74
83
|
if (!e) {
|
|
75
|
-
|
|
84
|
+
B.value = !1, j.value = !1;
|
|
76
85
|
return;
|
|
77
86
|
}
|
|
78
87
|
const t = e.scrollWidth - e.clientWidth;
|
|
79
|
-
|
|
88
|
+
B.value = e.scrollLeft > 1, j.value = t - e.scrollLeft > 1;
|
|
80
89
|
}
|
|
81
|
-
function
|
|
90
|
+
function xe(e) {
|
|
82
91
|
const t = e.firstElementChild;
|
|
83
92
|
if (!t) return e.clientWidth;
|
|
84
93
|
const n = parseFloat(getComputedStyle(e).gap) || 8;
|
|
85
94
|
return t.offsetWidth + n;
|
|
86
95
|
}
|
|
87
|
-
function
|
|
88
|
-
const t =
|
|
96
|
+
function J(e) {
|
|
97
|
+
const t = L.value;
|
|
89
98
|
if (!t) return;
|
|
90
|
-
const n =
|
|
99
|
+
const n = xe(t);
|
|
91
100
|
t.scrollBy({ left: e === "right" ? n : -n, behavior: "smooth" });
|
|
92
101
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
const e =
|
|
96
|
-
e && (
|
|
102
|
+
function Q() {
|
|
103
|
+
y == null || y.disconnect();
|
|
104
|
+
const e = L.value;
|
|
105
|
+
e && (y = new ResizeObserver(() => K()), y.observe(e));
|
|
97
106
|
}
|
|
98
|
-
function
|
|
107
|
+
function be(e) {
|
|
99
108
|
return e.preview ?? {
|
|
100
109
|
isImage: !1,
|
|
101
110
|
isVideo: !1,
|
|
@@ -104,283 +113,283 @@ const K = 40, Tt = /* @__PURE__ */ Pe({
|
|
|
104
113
|
fileSize: ""
|
|
105
114
|
};
|
|
106
115
|
}
|
|
107
|
-
const
|
|
108
|
-
() =>
|
|
109
|
-
),
|
|
110
|
-
() => !
|
|
111
|
-
),
|
|
112
|
-
if (!T.value || !
|
|
113
|
-
const e =
|
|
116
|
+
const Ie = v(
|
|
117
|
+
() => st(o().text || "", E.value, Se.value)
|
|
118
|
+
), A = v(
|
|
119
|
+
() => !ye.value && at(o().text || "")
|
|
120
|
+
), _ = () => {
|
|
121
|
+
if (!T.value || !l.value) return;
|
|
122
|
+
const e = l.value, t = T.value, n = Math.max(0, e.offsetWidth - e.clientWidth);
|
|
114
123
|
t.style.right = n > 0 ? `${n}px` : "", t.scrollTop = e.scrollTop;
|
|
115
124
|
};
|
|
116
|
-
let
|
|
117
|
-
function
|
|
118
|
-
|
|
125
|
+
let w = 0;
|
|
126
|
+
function $() {
|
|
127
|
+
E.value = null;
|
|
119
128
|
}
|
|
120
|
-
function
|
|
121
|
-
const t =
|
|
122
|
-
if (!t || !
|
|
123
|
-
const n = t.value,
|
|
124
|
-
(
|
|
129
|
+
function Ce(e = "nearest") {
|
|
130
|
+
const t = l.value;
|
|
131
|
+
if (!t || !A.value) return;
|
|
132
|
+
const n = t.value, i = ce(n, t.selectionStart, e), a = ce(n, t.selectionEnd, e);
|
|
133
|
+
(i !== t.selectionStart || a !== t.selectionEnd) && t.setSelectionRange(i, a);
|
|
125
134
|
}
|
|
126
|
-
function
|
|
127
|
-
|
|
135
|
+
function G() {
|
|
136
|
+
Ce("nearest"), C();
|
|
128
137
|
}
|
|
129
|
-
function
|
|
130
|
-
var
|
|
131
|
-
const t =
|
|
132
|
-
if (!
|
|
138
|
+
function Fe(e) {
|
|
139
|
+
var a, c, u;
|
|
140
|
+
const t = o(), n = l.value;
|
|
141
|
+
if (!ut({
|
|
133
142
|
key: e.key,
|
|
134
143
|
altKey: e.altKey,
|
|
135
144
|
metaKey: e.metaKey,
|
|
136
145
|
ctrlKey: e.ctrlKey,
|
|
137
146
|
shiftKey: e.shiftKey,
|
|
138
|
-
hasResolver: typeof
|
|
139
|
-
disabled:
|
|
147
|
+
hasResolver: typeof s.resolveEditLastSentMessage == "function",
|
|
148
|
+
disabled: s.state === "disabled",
|
|
140
149
|
isRecording: t.isRecording,
|
|
141
150
|
draftText: t.text ?? "",
|
|
142
|
-
replyMessageId: (
|
|
143
|
-
editMessageId: (
|
|
151
|
+
replyMessageId: (a = t.reply) == null ? void 0 : a.messageId,
|
|
152
|
+
editMessageId: (c = t.edit) == null ? void 0 : c.messageId,
|
|
144
153
|
textareaText: (n == null ? void 0 : n.value) ?? t.text ?? "",
|
|
145
154
|
selectionStart: (n == null ? void 0 : n.selectionStart) ?? 0
|
|
146
155
|
})) return !1;
|
|
147
|
-
const
|
|
148
|
-
return
|
|
156
|
+
const i = (u = s.resolveEditLastSentMessage) == null ? void 0 : u.call(s);
|
|
157
|
+
return dt(i) ? (e.preventDefault(), ge(ft(i)), !0) : !1;
|
|
149
158
|
}
|
|
150
|
-
function
|
|
151
|
-
if (
|
|
152
|
-
const t =
|
|
159
|
+
function Te(e) {
|
|
160
|
+
if (Fe(e) || !A.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.altKey || e.metaKey || e.ctrlKey) return;
|
|
161
|
+
const t = l.value;
|
|
153
162
|
if (!t) return;
|
|
154
|
-
const n = t.value,
|
|
163
|
+
const n = t.value, i = t.selectionStart !== t.selectionEnd;
|
|
155
164
|
if (e.shiftKey) {
|
|
156
|
-
requestAnimationFrame(() =>
|
|
165
|
+
requestAnimationFrame(() => G());
|
|
157
166
|
return;
|
|
158
167
|
}
|
|
159
|
-
if (
|
|
168
|
+
if (i) {
|
|
160
169
|
e.preventDefault();
|
|
161
|
-
const u = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd,
|
|
162
|
-
t.setSelectionRange(
|
|
170
|
+
const u = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd, x = e.key === "ArrowLeft" ? ae(n, u) : re(n, u);
|
|
171
|
+
t.setSelectionRange(x, x), C();
|
|
163
172
|
return;
|
|
164
173
|
}
|
|
165
174
|
e.preventDefault();
|
|
166
|
-
const
|
|
167
|
-
t.setSelectionRange(
|
|
175
|
+
const a = t.selectionStart, c = e.key === "ArrowLeft" ? ae(n, a) : re(n, a);
|
|
176
|
+
t.setSelectionRange(c, c), C();
|
|
168
177
|
}
|
|
169
|
-
function
|
|
170
|
-
if (!
|
|
171
|
-
|
|
178
|
+
function C() {
|
|
179
|
+
if (!A.value) {
|
|
180
|
+
$();
|
|
172
181
|
return;
|
|
173
182
|
}
|
|
174
|
-
|
|
175
|
-
var
|
|
176
|
-
|
|
177
|
-
const e =
|
|
183
|
+
w && cancelAnimationFrame(w), w = requestAnimationFrame(() => {
|
|
184
|
+
var c;
|
|
185
|
+
w = 0;
|
|
186
|
+
const e = l.value;
|
|
178
187
|
if (!e) {
|
|
179
|
-
|
|
188
|
+
$();
|
|
180
189
|
return;
|
|
181
190
|
}
|
|
182
191
|
const t = e.selectionStart, n = e.selectionEnd;
|
|
183
192
|
if (t === n) {
|
|
184
|
-
|
|
193
|
+
E.value !== null && (E.value = null, F(_));
|
|
185
194
|
return;
|
|
186
195
|
}
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
T.value && (T.value.scrollTop =
|
|
196
|
+
const i = E.value;
|
|
197
|
+
if (i && i.start === t && i.end === n) return;
|
|
198
|
+
const a = ((c = T.value) == null ? void 0 : c.scrollTop) ?? 0;
|
|
199
|
+
E.value = { start: t, end: n }, F(() => {
|
|
200
|
+
T.value && (T.value.scrollTop = a), _();
|
|
192
201
|
});
|
|
193
202
|
});
|
|
194
203
|
}
|
|
195
|
-
function
|
|
196
|
-
e.buttons &&
|
|
204
|
+
function Ee(e) {
|
|
205
|
+
e.buttons && C();
|
|
197
206
|
}
|
|
198
|
-
function
|
|
199
|
-
document.activeElement ===
|
|
207
|
+
function Z() {
|
|
208
|
+
document.activeElement === l.value && C();
|
|
200
209
|
}
|
|
201
|
-
const
|
|
202
|
-
() =>
|
|
203
|
-
),
|
|
204
|
-
const e = Number(
|
|
205
|
-
return Number.isFinite(e) && e > 0 ? Math.floor(e) :
|
|
210
|
+
const s = M, ee = v(
|
|
211
|
+
() => s.state === "disabled" && !!s.disabledPlaceholder
|
|
212
|
+
), te = v(() => {
|
|
213
|
+
const e = Number(s.maxAttachedFiles);
|
|
214
|
+
return Number.isFinite(e) && e > 0 ? Math.floor(e) : se;
|
|
206
215
|
});
|
|
207
|
-
|
|
208
|
-
const Ae =
|
|
209
|
-
() =>
|
|
210
|
-
),
|
|
216
|
+
Ue("maxAttachedFiles", te);
|
|
217
|
+
const Ae = v(
|
|
218
|
+
() => m("component.ChatInput.FilesSelectedCount").replace("{count}", String(S.value.length)).replace("{max}", String(te.value))
|
|
219
|
+
), we = v(() => !!(s.state == "disabled" || o().text == "" && !S.value.length || o().isRecording)), Me = v(() => {
|
|
211
220
|
var t;
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
214
|
-
if (!((t =
|
|
221
|
+
if (s.inputButtonColor)
|
|
222
|
+
return s.inputButtonColor;
|
|
223
|
+
if (!((t = s.selectedChannel) != null && t.channelId))
|
|
215
224
|
return "#25D366";
|
|
216
|
-
const e =
|
|
225
|
+
const e = s.selectedChannel.channelId.toLowerCase();
|
|
217
226
|
return e.includes("whatsapp") || e.includes("waba") ? "#25D366" : e.includes("telegram") ? "#37AFE2" : e.includes("sms") ? "#6C757D" : e.includes("max") ? "#4B0082" : "#25D366";
|
|
218
|
-
}),
|
|
227
|
+
}), Le = v(() => {
|
|
219
228
|
var t;
|
|
220
|
-
if (!((t =
|
|
221
|
-
return
|
|
222
|
-
const e =
|
|
223
|
-
return e.includes("whatsapp") || e.includes("waba") ?
|
|
229
|
+
if (!((t = s.selectedChannel) != null && t.channelId))
|
|
230
|
+
return m("component.ChatInput.InputPlaceholder");
|
|
231
|
+
const e = s.selectedChannel.channelId.toLowerCase();
|
|
232
|
+
return e.includes("whatsapp") || e.includes("waba") ? m("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? m("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? m("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? m("component.ChatInput.MaxInputPlaceholder") : m("component.ChatInput.InputPlaceholder");
|
|
224
233
|
});
|
|
225
|
-
|
|
226
|
-
() =>
|
|
234
|
+
p(
|
|
235
|
+
() => _e.value,
|
|
227
236
|
() => {
|
|
228
|
-
|
|
237
|
+
D("typing");
|
|
229
238
|
}
|
|
230
239
|
);
|
|
231
|
-
function
|
|
232
|
-
|
|
233
|
-
if (e && !
|
|
234
|
-
const t =
|
|
235
|
-
t && (
|
|
240
|
+
function ne(e = !1) {
|
|
241
|
+
F(() => {
|
|
242
|
+
if (e && !R.value) return;
|
|
243
|
+
const t = l.value;
|
|
244
|
+
t && (k(t), e && (R.value = !1), P(t), requestAnimationFrame(() => P(t)));
|
|
236
245
|
});
|
|
237
246
|
}
|
|
238
|
-
|
|
239
|
-
() =>
|
|
247
|
+
p(
|
|
248
|
+
() => o().edit,
|
|
240
249
|
(e) => {
|
|
241
|
-
(e == null ? void 0 : e.messageId) != null && (
|
|
250
|
+
(e == null ? void 0 : e.messageId) != null && (R.value = !0, ne(!0));
|
|
242
251
|
}
|
|
243
|
-
),
|
|
244
|
-
() =>
|
|
252
|
+
), p(
|
|
253
|
+
() => o().reply,
|
|
245
254
|
(e) => {
|
|
246
|
-
(e == null ? void 0 : e.messageId) != null &&
|
|
255
|
+
(e == null ? void 0 : e.messageId) != null && ne();
|
|
247
256
|
}
|
|
248
|
-
),
|
|
249
|
-
() =>
|
|
257
|
+
), p(
|
|
258
|
+
() => s.focusOnInputArea,
|
|
250
259
|
() => {
|
|
251
|
-
|
|
252
|
-
const e =
|
|
260
|
+
s.focusOnInputArea && F(() => {
|
|
261
|
+
const e = r(l);
|
|
253
262
|
e == null || e.focus();
|
|
254
263
|
});
|
|
255
264
|
},
|
|
256
265
|
{ immediate: !0 }
|
|
257
|
-
),
|
|
258
|
-
() =>
|
|
266
|
+
), p(
|
|
267
|
+
() => o().text,
|
|
259
268
|
() => {
|
|
260
|
-
const e =
|
|
261
|
-
e && (
|
|
269
|
+
const e = l.value;
|
|
270
|
+
e && (k(e), R.value && (R.value = !1, P(e), requestAnimationFrame(() => P(e))));
|
|
262
271
|
},
|
|
263
272
|
{ immediate: !0, flush: "post" }
|
|
264
|
-
),
|
|
265
|
-
() =>
|
|
273
|
+
), p(
|
|
274
|
+
() => o().id,
|
|
266
275
|
() => {
|
|
267
|
-
const e =
|
|
268
|
-
e && (
|
|
269
|
-
const t =
|
|
270
|
-
t &&
|
|
276
|
+
const e = l.value;
|
|
277
|
+
e && (W(e), requestAnimationFrame(() => {
|
|
278
|
+
const t = l.value;
|
|
279
|
+
t && k(t);
|
|
271
280
|
}));
|
|
272
281
|
}
|
|
273
|
-
),
|
|
274
|
-
e &&
|
|
275
|
-
const t =
|
|
282
|
+
), p(A, (e) => {
|
|
283
|
+
e && F(() => {
|
|
284
|
+
const t = l.value;
|
|
276
285
|
if (!t) return;
|
|
277
286
|
const n = t.scrollTop;
|
|
278
|
-
|
|
287
|
+
k(t), t.scrollTop = n, _(), requestAnimationFrame(_);
|
|
279
288
|
});
|
|
280
289
|
});
|
|
281
|
-
function
|
|
282
|
-
const t =
|
|
283
|
-
e.style.height = (t ||
|
|
290
|
+
function W(e) {
|
|
291
|
+
const t = o().inputHeight;
|
|
292
|
+
e.style.height = (t || Y) + "px", (!t || t <= Y) && (e.style.overflowY = "hidden");
|
|
284
293
|
}
|
|
285
|
-
function
|
|
294
|
+
function Re(e) {
|
|
286
295
|
const t = parseFloat(e.style.height);
|
|
287
|
-
Number.isFinite(t) && (
|
|
296
|
+
Number.isFinite(t) && (o().inputHeight = t);
|
|
288
297
|
}
|
|
289
|
-
function
|
|
290
|
-
const t =
|
|
298
|
+
function k(e) {
|
|
299
|
+
const t = o().text || "";
|
|
291
300
|
if (e.value !== t || e.clientWidth === 0) {
|
|
292
|
-
|
|
301
|
+
W(e);
|
|
293
302
|
return;
|
|
294
303
|
}
|
|
295
304
|
const n = e.scrollTop;
|
|
296
305
|
e.style.height = "auto";
|
|
297
|
-
const
|
|
298
|
-
`).length > 1,
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
document.body.removeChild(
|
|
302
|
-
const
|
|
303
|
-
if (
|
|
304
|
-
|
|
306
|
+
const i = getComputedStyle(e), a = parseFloat(i.fontSize) || 16, c = parseFloat(i.lineHeight) || a * 1.4, u = Y, x = c * 11, U = e.scrollHeight, qe = t.split(`
|
|
307
|
+
`).length > 1, d = document.createElement("div");
|
|
308
|
+
d.style.position = "absolute", d.style.visibility = "hidden", d.style.whiteSpace = "nowrap", d.style.font = i.font, d.style.fontSize = i.fontSize, d.style.fontFamily = i.fontFamily, d.style.fontWeight = i.fontWeight, d.style.letterSpacing = i.letterSpacing, d.textContent = t, document.body.appendChild(d);
|
|
309
|
+
const Ne = d.offsetWidth;
|
|
310
|
+
document.body.removeChild(d);
|
|
311
|
+
const ze = parseFloat(i.paddingLeft) || 0, Be = parseFloat(i.paddingRight) || 0, je = e.clientWidth - ze - Be, $e = Ne > je, le = qe || $e;
|
|
312
|
+
if (le && U <= u + 1) {
|
|
313
|
+
W(e);
|
|
305
314
|
return;
|
|
306
315
|
}
|
|
307
|
-
t.trim() &&
|
|
316
|
+
t.trim() && le ? U <= x ? (e.style.height = U + "px", e.style.overflowY = "hidden") : (e.style.height = x + "px", e.style.overflowY = "auto", e.scrollTop = n) : (e.style.height = u + "px", e.style.overflowY = "hidden"), Re(e), _(), requestAnimationFrame(_);
|
|
308
317
|
}
|
|
309
|
-
function
|
|
310
|
-
if (
|
|
318
|
+
function P(e) {
|
|
319
|
+
if (s.state === "disabled" || o().isRecording) return;
|
|
311
320
|
const t = e.value.length;
|
|
312
|
-
e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight,
|
|
321
|
+
e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight, _();
|
|
313
322
|
}
|
|
314
|
-
|
|
315
|
-
() =>
|
|
323
|
+
p(
|
|
324
|
+
() => o().forceSend,
|
|
316
325
|
() => {
|
|
317
|
-
|
|
326
|
+
o().forceSend && (O(), he(!1));
|
|
318
327
|
}
|
|
319
328
|
);
|
|
320
|
-
const
|
|
329
|
+
const ke = (e) => {
|
|
321
330
|
const t = e.target;
|
|
322
|
-
|
|
331
|
+
D("typing", t.value), C();
|
|
323
332
|
};
|
|
324
|
-
|
|
325
|
-
|
|
333
|
+
p(
|
|
334
|
+
S,
|
|
326
335
|
(e, t) => {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
const n =
|
|
336
|
+
F(() => {
|
|
337
|
+
Q(), K();
|
|
338
|
+
const n = L.value;
|
|
330
339
|
n && e.length > ((t == null ? void 0 : t.length) ?? 0) && n.scrollTo({ left: n.scrollWidth, behavior: "smooth" });
|
|
331
340
|
});
|
|
332
341
|
},
|
|
333
342
|
{ flush: "post" }
|
|
334
|
-
),
|
|
335
|
-
const e =
|
|
336
|
-
e && (
|
|
337
|
-
}),
|
|
338
|
-
|
|
343
|
+
), Ve(() => {
|
|
344
|
+
const e = l.value;
|
|
345
|
+
e && (W(e), k(e)), Q(), K(), document.addEventListener("selectionchange", Z);
|
|
346
|
+
}), Ye(() => {
|
|
347
|
+
fe.commitChatDraftToList(X), document.removeEventListener("selectionchange", Z), y == null || y.disconnect(), w && cancelAnimationFrame(w);
|
|
339
348
|
});
|
|
340
|
-
const
|
|
349
|
+
const De = (e) => {
|
|
341
350
|
if (e.shiftKey) {
|
|
342
|
-
if (
|
|
343
|
-
let t =
|
|
344
|
-
t && (
|
|
345
|
-
`, t, t, "end"),
|
|
351
|
+
if (l.value instanceof HTMLTextAreaElement) {
|
|
352
|
+
let t = l.value.selectionStart;
|
|
353
|
+
t && (l.value.setRangeText(`
|
|
354
|
+
`, t, t, "end"), H(l.value.value));
|
|
346
355
|
}
|
|
347
356
|
e.preventDefault();
|
|
348
357
|
} else if (e.ctrlKey) {
|
|
349
|
-
if (
|
|
350
|
-
let t =
|
|
351
|
-
t && (
|
|
352
|
-
`, t, t, "end"),
|
|
358
|
+
if (l.value instanceof HTMLTextAreaElement) {
|
|
359
|
+
let t = l.value.selectionStart;
|
|
360
|
+
t && (l.value.setRangeText(`
|
|
361
|
+
`, t, t, "end"), H(l.value.value));
|
|
353
362
|
}
|
|
354
363
|
e.preventDefault();
|
|
355
364
|
} else
|
|
356
|
-
e.preventDefault(),
|
|
357
|
-
},
|
|
358
|
-
if (
|
|
359
|
-
const t =
|
|
360
|
-
|
|
361
|
-
const n = e.newText.length - (t.length - (e.end - e.start)),
|
|
362
|
-
|
|
363
|
-
|
|
365
|
+
e.preventDefault(), O();
|
|
366
|
+
}, He = (e) => {
|
|
367
|
+
if (l.value) {
|
|
368
|
+
const t = l.value.value;
|
|
369
|
+
l.value.value = e.newText;
|
|
370
|
+
const n = e.newText.length - (t.length - (e.end - e.start)), i = e.start + n;
|
|
371
|
+
H(e.newText), F(() => {
|
|
372
|
+
l.value && (l.value.setSelectionRange(i, i), l.value.focus());
|
|
364
373
|
});
|
|
365
374
|
}
|
|
366
375
|
};
|
|
367
|
-
function
|
|
368
|
-
|
|
376
|
+
function Ke(e) {
|
|
377
|
+
ve(e);
|
|
369
378
|
}
|
|
370
|
-
function
|
|
371
|
-
|
|
379
|
+
function We() {
|
|
380
|
+
me(), H(""), ct(I), l.value && l.value.focus();
|
|
372
381
|
}
|
|
373
|
-
function
|
|
374
|
-
const e =
|
|
382
|
+
function Pe() {
|
|
383
|
+
const e = o();
|
|
375
384
|
return e.edit ? (e.text ?? "").trim() === (e.edit.text ?? "").trim() : !1;
|
|
376
385
|
}
|
|
377
|
-
const
|
|
378
|
-
const e =
|
|
379
|
-
if (e.value.edit &&
|
|
380
|
-
|
|
386
|
+
const O = () => {
|
|
387
|
+
const e = b(o());
|
|
388
|
+
if (e.value.edit && Pe() && !S.value.length) {
|
|
389
|
+
We();
|
|
381
390
|
return;
|
|
382
391
|
}
|
|
383
|
-
if (e.value.text != "" ||
|
|
392
|
+
if (e.value.text != "" || S.value.length) {
|
|
384
393
|
const t = {
|
|
385
394
|
type: "",
|
|
386
395
|
text: "",
|
|
@@ -388,46 +397,134 @@ const K = 40, Tt = /* @__PURE__ */ Pe({
|
|
|
388
397
|
filename: "",
|
|
389
398
|
size: "",
|
|
390
399
|
reply: void 0
|
|
391
|
-
}, n =
|
|
400
|
+
}, n = S.value;
|
|
392
401
|
if (n.length) {
|
|
393
|
-
const
|
|
394
|
-
n.forEach((
|
|
395
|
-
var
|
|
402
|
+
const i = e.value.text.trim();
|
|
403
|
+
n.forEach((a, c) => {
|
|
404
|
+
var x;
|
|
396
405
|
const u = {
|
|
397
|
-
type: "message." +
|
|
398
|
-
url:
|
|
399
|
-
filename:
|
|
400
|
-
size: (
|
|
401
|
-
text:
|
|
406
|
+
type: "message." + a.type,
|
|
407
|
+
url: a.url,
|
|
408
|
+
filename: a.name,
|
|
409
|
+
size: (x = a.size) == null ? void 0 : x.toString(),
|
|
410
|
+
text: c === 0 ? i : ""
|
|
402
411
|
};
|
|
403
|
-
|
|
412
|
+
c === 0 && (e.value.reply && (u.reply = e.value.reply), e.value.edit && (u.edit = e.value.edit)), D("send", u);
|
|
404
413
|
});
|
|
405
414
|
} else
|
|
406
|
-
t.type = "message.text", t.text = e.value.text.trim(), e.value.reply && (t.reply = e.value.reply), e.value.edit && (t.edit = e.value.edit),
|
|
407
|
-
|
|
415
|
+
t.type = "message.text", t.text = e.value.text.trim(), e.value.reply && (t.reply = e.value.reply), e.value.edit && (t.edit = e.value.edit), D("send", t);
|
|
416
|
+
pe(), l.value && l.value.focus();
|
|
408
417
|
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
418
|
+
};
|
|
419
|
+
return (e, t) => (h(), g("div", {
|
|
420
|
+
class: q(["chat-input__container", { "chat-input__container--disabled-notice": ee.value }]),
|
|
421
|
+
"data-testid": "chat-input"
|
|
422
|
+
}, [
|
|
423
|
+
ee.value ? (h(), g("div", vt, N(M.disabledPlaceholder), 1)) : (h(), g(ie, { key: 1 }, [
|
|
424
|
+
f("div", {
|
|
425
|
+
id: "chat-input-reply-line-" + r(I),
|
|
426
|
+
class: "chat-input__reply-line",
|
|
427
|
+
"data-testid": "chat-input-reply-line"
|
|
428
|
+
}, null, 8, gt),
|
|
429
|
+
f("div", {
|
|
430
|
+
id: "chat-input-file-line-" + r(I),
|
|
431
|
+
class: q(["chat-input__file-line", { "chat-input__file-line--visible": S.value.length > 0 }])
|
|
432
|
+
}, [
|
|
433
|
+
f("span", St, [
|
|
434
|
+
f("span", null, N(r(m)("component.ChatInput.FilesSelected")), 1),
|
|
435
|
+
f("span", null, N(Ae.value), 1)
|
|
436
|
+
]),
|
|
437
|
+
f("div", _t, [
|
|
438
|
+
B.value ? (h(), g("button", {
|
|
439
|
+
key: 0,
|
|
440
|
+
type: "button",
|
|
441
|
+
class: "chat-input__file-scroll chat-input__file-scroll--left",
|
|
442
|
+
"aria-label": r(m)("component.ChatInput.FilesScrollLeft"),
|
|
443
|
+
onClick: t[0] || (t[0] = (n) => J("left"))
|
|
444
|
+
}, [
|
|
445
|
+
z(r(ue))
|
|
446
|
+
], 8, xt)) : V("", !0),
|
|
447
|
+
f("div", {
|
|
448
|
+
ref_key: "refFileChips",
|
|
449
|
+
ref: L,
|
|
450
|
+
class: "chat-input__file-chips",
|
|
451
|
+
onScroll: K
|
|
452
|
+
}, [
|
|
453
|
+
(h(!0), g(ie, null, Xe(S.value, (n, i) => (h(), Je(mt, {
|
|
454
|
+
key: (n.url || n.name || "") + "-" + i,
|
|
455
|
+
"file-info": be(n),
|
|
456
|
+
onReset: (a) => Ke(i)
|
|
457
|
+
}, null, 8, ["file-info", "onReset"]))), 128))
|
|
458
|
+
], 544),
|
|
459
|
+
j.value ? (h(), g("button", {
|
|
460
|
+
key: 1,
|
|
461
|
+
type: "button",
|
|
462
|
+
class: "chat-input__file-scroll chat-input__file-scroll--right",
|
|
463
|
+
"aria-label": r(m)("component.ChatInput.FilesScrollRight"),
|
|
464
|
+
onClick: t[1] || (t[1] = (n) => J("right"))
|
|
465
|
+
}, [
|
|
466
|
+
z(r(ue))
|
|
467
|
+
], 8, bt)) : V("", !0)
|
|
468
|
+
])
|
|
469
|
+
], 10, yt),
|
|
470
|
+
f("div", It, [
|
|
471
|
+
oe(e.$slots, "inline-buttons", {}, void 0, !0)
|
|
472
|
+
]),
|
|
473
|
+
M.disabledPlaceholder && r(o)().isRecording ? (h(), g("div", Ct, N(M.disabledPlaceholder), 1)) : (h(), g("div", Ft, [
|
|
474
|
+
A.value ? (h(), g("div", {
|
|
475
|
+
key: 0,
|
|
476
|
+
ref_key: "refMirror",
|
|
477
|
+
ref: T,
|
|
478
|
+
class: "chat-input__input-mirror",
|
|
479
|
+
"aria-hidden": "true",
|
|
480
|
+
innerHTML: Ie.value
|
|
481
|
+
}, null, 8, Tt)) : V("", !0),
|
|
482
|
+
Qe(f("textarea", {
|
|
483
|
+
ref_key: "refInput",
|
|
484
|
+
ref: l,
|
|
485
|
+
"onUpdate:modelValue": t[2] || (t[2] = (n) => r(o)().text = n),
|
|
486
|
+
rows: "1",
|
|
487
|
+
"data-testid": "chat-input-textarea",
|
|
488
|
+
disabled: M.state == "disabled" || r(o)().isRecording,
|
|
489
|
+
class: q(["chat-input__input", { "chat-input__input--emoji-images": A.value }]),
|
|
490
|
+
placeholder: Le.value,
|
|
491
|
+
onKeydown: [
|
|
492
|
+
Te,
|
|
493
|
+
Ze(De, ["enter"])
|
|
494
|
+
],
|
|
495
|
+
onInput: ke,
|
|
496
|
+
onScroll: _,
|
|
497
|
+
onSelect: C,
|
|
498
|
+
onMouseup: G,
|
|
499
|
+
onKeyup: G,
|
|
500
|
+
onMousemove: Ee,
|
|
501
|
+
onBlur: $
|
|
502
|
+
}, null, 42, Et), [
|
|
503
|
+
[et, r(o)().text]
|
|
504
|
+
])
|
|
505
|
+
])),
|
|
506
|
+
z(ht, {
|
|
507
|
+
textarea: l.value,
|
|
508
|
+
onFormatApplied: He
|
|
509
|
+
}, null, 8, ["textarea"]),
|
|
510
|
+
f("button", {
|
|
511
|
+
type: "button",
|
|
512
|
+
class: q(["chat-input__button", { "chat-input__button-disabled": we.value }]),
|
|
513
|
+
"data-testid": "chat-input-send",
|
|
514
|
+
disabled: r(o)().isRecording,
|
|
515
|
+
onClick: O
|
|
516
|
+
}, [
|
|
517
|
+
f("span", wt, [
|
|
518
|
+
z(r(pt), { color: Me.value }, null, 8, ["color"])
|
|
519
|
+
])
|
|
520
|
+
], 10, At),
|
|
521
|
+
f("div", Mt, [
|
|
522
|
+
oe(e.$slots, "buttons", {}, void 0, !0)
|
|
523
|
+
])
|
|
524
|
+
], 64))
|
|
525
|
+
], 2));
|
|
429
526
|
}
|
|
430
527
|
});
|
|
431
528
|
export {
|
|
432
|
-
|
|
529
|
+
Jt as default
|
|
433
530
|
};
|