@mobilon-dev/chotto 0.3.98 → 0.3.100
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 +61 -42
- 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 +38 -22
- package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue2.js +2 -33
- 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/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/WhatsAppIcon.vue.js +20 -32
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +396 -546
- 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 +42 -8
- 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 -61
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +111 -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 +51 -80
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +4 -182
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +135 -25
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +4 -78
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +95 -73
- 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 +60 -34
- 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 +33 -39
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +4 -306
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +312 -135
- 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 +67 -35
- package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +38 -72
- package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +57 -76
- 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 +39 -19
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +4 -458
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +471 -160
- 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/DeletedMessageContent/icons/DeletedMessageIcon.vue.js +10 -16
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +4 -60
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +53 -36
- 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/FileMessage/FileMessage.vue.js +4 -250
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +233 -67
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +4 -315
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +319 -98
- 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 -155
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +213 -110
- 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 +120 -36
- 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 -75
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +63 -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 -346
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +307 -73
- 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 -307
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +269 -65
- 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 -307
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +298 -76
- 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 +18 -35
- 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 -85
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +210 -149
- 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 +163 -253
- package/dist/components/3_compounds/ChatList/ChatListHeader.vue.js +32 -50
- package/dist/components/3_compounds/ChatList/icons/LogoIcon.vue.js +6 -6
- package/dist/components/3_compounds/Feed/Feed.vue.js +4 -172
- package/dist/components/3_compounds/Feed/Feed.vue2.js +257 -126
- 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 -31
- package/dist/components/5_containers/FloatContainer/FloatContainer.vue.js +56 -85
- package/dist/functions/renderAppleEmojis.js +120 -91
- package/dist/hooks/messages/useMessageLinks.js +15 -15
- package/dist/hooks/useEmojiNative.js +24 -12
- package/dist/node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js +581 -555
- 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/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +21 -2
- package/dist/types/functions/renderAppleEmojis.d.ts +13 -10
- package/dist/types/hooks/useEmojiNative.d.ts +5 -2
- package/package.json +2 -2
|
@@ -1,88 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createElementBlock as o, openBlock as i, createElementVNode as t, createVNode as d, normalizeClass as l, createBlock as p, createCommentVNode as c, renderSlot as s, toDisplayString as u, withDirectives as m, withKeys as f, vModelText as v } from "vue";
|
|
1
|
+
import t from "./ChatInput.vue2.js";
|
|
3
2
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "chat-input__input chat-input__disabled-placeholder"
|
|
8
|
-
}, w = {
|
|
9
|
-
key: 1,
|
|
10
|
-
class: "chat-input__input-wrap"
|
|
11
|
-
}, k = ["innerHTML"], C = ["disabled", "placeholder"], x = ["disabled"], P = { class: "" }, A = { class: "chat-input__third-line" };
|
|
12
|
-
function T(a, r, n, e, j, B) {
|
|
13
|
-
return i(), o("div", g, [
|
|
14
|
-
t("div", {
|
|
15
|
-
id: "chat-input-reply-line-" + e.chatAppId,
|
|
16
|
-
class: "chat-input__reply-line"
|
|
17
|
-
}, null, 8, M),
|
|
18
|
-
t("div", {
|
|
19
|
-
id: "chat-input-file-line-" + e.chatAppId,
|
|
20
|
-
class: l(["chat-input__file-line", { "chat-input__file-line--visible": !!e.filePreview }])
|
|
21
|
-
}, [
|
|
22
|
-
e.filePreview ? (i(), p(e.FilePreview, {
|
|
23
|
-
key: 0,
|
|
24
|
-
"file-info": e.filePreview,
|
|
25
|
-
onReset: e.resetSelectedFile
|
|
26
|
-
}, null, 8, ["file-info"])) : c("v-if", !0)
|
|
27
|
-
], 10, y),
|
|
28
|
-
t("div", I, [
|
|
29
|
-
s(a.$slots, "inline-buttons", {}, void 0, !0)
|
|
30
|
-
]),
|
|
31
|
-
n.disabledPlaceholder && (n.state == "disabled" || e.getMessage().isRecording) ? (i(), o(
|
|
32
|
-
"div",
|
|
33
|
-
S,
|
|
34
|
-
u(n.disabledPlaceholder),
|
|
35
|
-
1
|
|
36
|
-
/* TEXT */
|
|
37
|
-
)) : (i(), o("div", w, [
|
|
38
|
-
e.useEmojiMirror ? (i(), o("div", {
|
|
39
|
-
key: 0,
|
|
40
|
-
ref: "refMirror",
|
|
41
|
-
class: "chat-input__input-mirror",
|
|
42
|
-
"aria-hidden": "true",
|
|
43
|
-
innerHTML: e.emojiMirrorHtml
|
|
44
|
-
}, null, 8, k)) : c("v-if", !0),
|
|
45
|
-
m(t("textarea", {
|
|
46
|
-
ref: "refInput",
|
|
47
|
-
"onUpdate:modelValue": r[0] || (r[0] = (_) => e.getMessage().text = _),
|
|
48
|
-
rows: "1",
|
|
49
|
-
disabled: n.state == "disabled" || e.getMessage().isRecording,
|
|
50
|
-
class: l(["chat-input__input", { "chat-input__input--emoji-images": e.useEmojiMirror }]),
|
|
51
|
-
placeholder: e.inputPlaceholder,
|
|
52
|
-
onKeydown: [
|
|
53
|
-
e.onInputKeydown,
|
|
54
|
-
f(e.keyEnter, ["enter"])
|
|
55
|
-
],
|
|
56
|
-
onInput: e.sendTyping,
|
|
57
|
-
onScroll: e.syncMirrorScroll,
|
|
58
|
-
onSelect: e.updateSelectionState,
|
|
59
|
-
onMouseup: e.snapCaretAndUpdateSelection,
|
|
60
|
-
onKeyup: e.snapCaretAndUpdateSelection,
|
|
61
|
-
onMousemove: e.onInputMouseMove,
|
|
62
|
-
onBlur: e.clearSelectionHighlight
|
|
63
|
-
}, null, 42, C), [
|
|
64
|
-
[v, e.getMessage().text]
|
|
65
|
-
])
|
|
66
|
-
])),
|
|
67
|
-
d(e.TextFormatToolbar, {
|
|
68
|
-
textarea: e.refInput,
|
|
69
|
-
onFormatApplied: e.handleFormatApplied
|
|
70
|
-
}, null, 8, ["textarea"]),
|
|
71
|
-
t("button", {
|
|
72
|
-
class: l(["chat-input__button", { "chat-input__button-disabled": e.disabledSendButton }]),
|
|
73
|
-
disabled: e.getMessage().isRecording,
|
|
74
|
-
onClick: e.sendMessage
|
|
75
|
-
}, [
|
|
76
|
-
t("span", P, [
|
|
77
|
-
d(e.SendIcon, { color: e.sendIconColor }, null, 8, ["color"])
|
|
78
|
-
])
|
|
79
|
-
], 10, x),
|
|
80
|
-
t("div", A, [
|
|
81
|
-
s(a.$slots, "buttons", {}, void 0, !0)
|
|
82
|
-
])
|
|
83
|
-
]);
|
|
84
|
-
}
|
|
85
|
-
const R = /* @__PURE__ */ b(h, [["render", T], ["__scopeId", "data-v-c1d61267"], ["__file", "/var/store/dev-space/repos-projects/chotto/chotto/src/components/3_compounds/ChatInput/ChatInput.vue"]]);
|
|
3
|
+
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-c13af78f"]]);
|
|
86
5
|
export {
|
|
87
|
-
|
|
6
|
+
r as default
|
|
88
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useImmediateDebouncedRef as
|
|
3
|
-
import { useMessageDraft as
|
|
1
|
+
import { defineComponent as we, inject as Ce, watch as d, ref as E, computed as _, nextTick as S, unref as u, onMounted as Ae, onUnmounted as Ee, createElementBlock as k, openBlock as F, createElementVNode as h, createVNode as O, normalizeClass as j, createBlock as Fe, createCommentVNode as U, renderSlot as Y, toDisplayString as Me, withDirectives as Re, withKeys as He, vModelText as ke } from "vue";
|
|
2
|
+
import { useImmediateDebouncedRef as Le } from "../../../hooks/useImmediateDebouncedRef.js";
|
|
3
|
+
import { useMessageDraft as De, commitChatDraftToList as Pe } from "../../../hooks/useMessageDraft.js";
|
|
4
4
|
import "../../../hooks/useSearchModel.js";
|
|
5
5
|
import "../../../hooks/useTheme.js";
|
|
6
|
-
import { useEmojiNative as
|
|
6
|
+
import { useEmojiNative as We } from "../../../hooks/useEmojiNative.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
9
|
import { t as I } from "../../../locale/useLocale.js";
|
|
@@ -11,12 +11,18 @@ import { t as I } from "../../../locale/useLocale.js";
|
|
|
11
11
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
12
12
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
13
13
|
import "../../../functions/parseMarkdown.js";
|
|
14
|
-
import { textToAppleEmojiHtml as
|
|
15
|
-
import { hideEditPreview as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
14
|
+
import { textToAppleEmojiHtml as qe, textContainsEmoji as Be, previousGraphemeIndex as V, nextGraphemeIndex as $, snapIndexToGrapheme as J } from "../../../functions/renderAppleEmojis.js";
|
|
15
|
+
import { hideEditPreview as je } from "../../../hooks/messages/useStartEdit.js";
|
|
16
|
+
import ze from "./icons/SendIcon.vue.js";
|
|
17
|
+
import Ke from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
|
|
18
|
+
import Ne from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
|
|
19
|
+
const Ge = { class: "chat-input__container" }, Oe = ["id"], Ue = ["id"], Ye = { class: "chat-input__inline-buttons" }, Ve = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "chat-input__input chat-input__disabled-placeholder"
|
|
22
|
+
}, $e = {
|
|
23
|
+
key: 1,
|
|
24
|
+
class: "chat-input__input-wrap"
|
|
25
|
+
}, Je = ["innerHTML"], Qe = ["disabled", "placeholder"], Xe = ["disabled"], Ze = { class: "" }, et = { class: "chat-input__third-line" }, z = 40, _t = /* @__PURE__ */ we({
|
|
20
26
|
__name: "ChatInput",
|
|
21
27
|
props: {
|
|
22
28
|
state: {
|
|
@@ -45,252 +51,251 @@ const H = 40, Xe = /* @__PURE__ */ ye({
|
|
|
45
51
|
}
|
|
46
52
|
},
|
|
47
53
|
emits: ["send", "typing"],
|
|
48
|
-
setup(
|
|
49
|
-
Z();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
f(
|
|
54
|
+
setup(T, { emit: Q }) {
|
|
55
|
+
const L = Q, b = Ce("chatAppId"), { resetMessage: X, getMessage: l, setMessageText: M, setForceSendMessage: Z, resetEdit: ee, resetMessageFile: te } = De(b), { isNative: ne, emojiSrc: ie } = We(b);
|
|
56
|
+
let K = l().id;
|
|
57
|
+
d(
|
|
53
58
|
() => l().id,
|
|
54
59
|
(e) => {
|
|
55
|
-
|
|
60
|
+
K = e;
|
|
56
61
|
}
|
|
57
62
|
);
|
|
58
|
-
const n =
|
|
63
|
+
const n = E(), m = E(), v = E(null), w = E(!1), oe = Le("", 2e3), D = _(() => {
|
|
59
64
|
var e;
|
|
60
65
|
return (e = l().file) == null ? void 0 : e.preview;
|
|
61
|
-
}),
|
|
62
|
-
() =>
|
|
63
|
-
),
|
|
64
|
-
() => !
|
|
65
|
-
),
|
|
66
|
-
if (!
|
|
67
|
-
const e = n.value, t =
|
|
68
|
-
t.style.right =
|
|
66
|
+
}), le = _(
|
|
67
|
+
() => qe(l().text || "", v.value, ie.value)
|
|
68
|
+
), g = _(
|
|
69
|
+
() => !ne.value && Be(l().text || "")
|
|
70
|
+
), c = () => {
|
|
71
|
+
if (!m.value || !n.value) return;
|
|
72
|
+
const e = n.value, t = m.value, o = Math.max(0, e.offsetWidth - e.clientWidth);
|
|
73
|
+
t.style.right = o > 0 ? `${o}px` : "", t.scrollTop = e.scrollTop;
|
|
69
74
|
};
|
|
70
|
-
let
|
|
71
|
-
function
|
|
72
|
-
|
|
75
|
+
let y = 0;
|
|
76
|
+
function P() {
|
|
77
|
+
v.value = null;
|
|
73
78
|
}
|
|
74
|
-
function
|
|
79
|
+
function se(e = "nearest") {
|
|
75
80
|
const t = n.value;
|
|
76
|
-
if (!t || !
|
|
77
|
-
const
|
|
78
|
-
(
|
|
81
|
+
if (!t || !g.value) return;
|
|
82
|
+
const o = t.value, i = J(o, t.selectionStart, e), r = J(o, t.selectionEnd, e);
|
|
83
|
+
(i !== t.selectionStart || r !== t.selectionEnd) && t.setSelectionRange(i, r);
|
|
79
84
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
85
|
+
function W() {
|
|
86
|
+
se("nearest"), f();
|
|
82
87
|
}
|
|
83
|
-
function
|
|
84
|
-
if (!
|
|
88
|
+
function ae(e) {
|
|
89
|
+
if (!g.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.altKey || e.metaKey || e.ctrlKey) return;
|
|
85
90
|
const t = n.value;
|
|
86
91
|
if (!t) return;
|
|
87
|
-
const
|
|
92
|
+
const o = t.value, i = t.selectionStart !== t.selectionEnd;
|
|
88
93
|
if (e.shiftKey) {
|
|
89
|
-
requestAnimationFrame(() =>
|
|
94
|
+
requestAnimationFrame(() => W());
|
|
90
95
|
return;
|
|
91
96
|
}
|
|
92
|
-
if (
|
|
97
|
+
if (i) {
|
|
93
98
|
e.preventDefault();
|
|
94
|
-
const
|
|
95
|
-
t.setSelectionRange(
|
|
99
|
+
const x = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd, A = e.key === "ArrowLeft" ? V(o, x) : $(o, x);
|
|
100
|
+
t.setSelectionRange(A, A), f();
|
|
96
101
|
return;
|
|
97
102
|
}
|
|
98
103
|
e.preventDefault();
|
|
99
|
-
const
|
|
100
|
-
t.setSelectionRange(
|
|
104
|
+
const r = t.selectionStart, p = e.key === "ArrowLeft" ? V(o, r) : $(o, r);
|
|
105
|
+
t.setSelectionRange(p, p), f();
|
|
101
106
|
}
|
|
102
|
-
function
|
|
103
|
-
if (!
|
|
104
|
-
|
|
107
|
+
function f() {
|
|
108
|
+
if (!g.value) {
|
|
109
|
+
P();
|
|
105
110
|
return;
|
|
106
111
|
}
|
|
107
|
-
|
|
108
|
-
var
|
|
109
|
-
|
|
112
|
+
y && cancelAnimationFrame(y), y = requestAnimationFrame(() => {
|
|
113
|
+
var p;
|
|
114
|
+
y = 0;
|
|
110
115
|
const e = n.value;
|
|
111
116
|
if (!e) {
|
|
112
|
-
|
|
117
|
+
P();
|
|
113
118
|
return;
|
|
114
119
|
}
|
|
115
|
-
const t = e.selectionStart,
|
|
116
|
-
if (t ===
|
|
117
|
-
|
|
120
|
+
const t = e.selectionStart, o = e.selectionEnd;
|
|
121
|
+
if (t === o) {
|
|
122
|
+
v.value !== null && (v.value = null, S(c));
|
|
118
123
|
return;
|
|
119
124
|
}
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
const i = v.value;
|
|
126
|
+
if (i && i.start === t && i.end === o) return;
|
|
127
|
+
const r = ((p = m.value) == null ? void 0 : p.scrollTop) ?? 0;
|
|
128
|
+
v.value = { start: t, end: o }, S(() => {
|
|
129
|
+
m.value && (m.value.scrollTop = r), c();
|
|
125
130
|
});
|
|
126
131
|
});
|
|
127
132
|
}
|
|
128
|
-
function
|
|
129
|
-
e.buttons &&
|
|
133
|
+
function re(e) {
|
|
134
|
+
e.buttons && f();
|
|
130
135
|
}
|
|
131
|
-
function
|
|
132
|
-
document.activeElement === n.value &&
|
|
136
|
+
function N() {
|
|
137
|
+
document.activeElement === n.value && f();
|
|
133
138
|
}
|
|
134
|
-
const
|
|
139
|
+
const a = T, ue = _(() => !!(a.state == "disabled" || l().text == "" && !l().file || l().isRecording)), ce = _(() => {
|
|
135
140
|
var t;
|
|
136
|
-
if (
|
|
137
|
-
return
|
|
138
|
-
if (!((t =
|
|
141
|
+
if (a.inputButtonColor)
|
|
142
|
+
return a.inputButtonColor;
|
|
143
|
+
if (!((t = a.selectedChannel) != null && t.channelId))
|
|
139
144
|
return "#25D366";
|
|
140
|
-
const e =
|
|
145
|
+
const e = a.selectedChannel.channelId.toLowerCase();
|
|
141
146
|
return e.includes("whatsapp") || e.includes("waba") ? "#25D366" : e.includes("telegram") ? "#37AFE2" : e.includes("sms") ? "#6C757D" : e.includes("max") ? "#4B0082" : "#25D366";
|
|
142
|
-
}),
|
|
147
|
+
}), de = _(() => {
|
|
143
148
|
var t;
|
|
144
|
-
if (!((t =
|
|
149
|
+
if (!((t = a.selectedChannel) != null && t.channelId))
|
|
145
150
|
return I("component.ChatInput.InputPlaceholder");
|
|
146
|
-
const e =
|
|
151
|
+
const e = a.selectedChannel.channelId.toLowerCase();
|
|
147
152
|
return e.includes("whatsapp") || e.includes("waba") ? I("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? I("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? I("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? I("component.ChatInput.MaxInputPlaceholder") : I("component.ChatInput.InputPlaceholder");
|
|
148
153
|
});
|
|
149
|
-
|
|
150
|
-
() =>
|
|
154
|
+
d(
|
|
155
|
+
() => oe.value,
|
|
151
156
|
() => {
|
|
152
|
-
|
|
157
|
+
L("typing");
|
|
153
158
|
}
|
|
154
|
-
),
|
|
159
|
+
), d(
|
|
155
160
|
() => {
|
|
156
161
|
var e;
|
|
157
162
|
return (e = l().edit) == null ? void 0 : e.messageId;
|
|
158
163
|
},
|
|
159
164
|
(e, t) => {
|
|
160
|
-
e != null && e !== t && (
|
|
161
|
-
if (!
|
|
162
|
-
const
|
|
163
|
-
|
|
165
|
+
e != null && e !== t && (w.value = !0, S(() => {
|
|
166
|
+
if (!w.value) return;
|
|
167
|
+
const o = n.value;
|
|
168
|
+
o && (C(o), w.value = !1, H(o), requestAnimationFrame(() => H(o)));
|
|
164
169
|
}));
|
|
165
170
|
}
|
|
166
|
-
),
|
|
167
|
-
() =>
|
|
171
|
+
), d(
|
|
172
|
+
() => a.focusOnInputArea,
|
|
168
173
|
() => {
|
|
169
|
-
|
|
170
|
-
const e =
|
|
174
|
+
a.focusOnInputArea && S(() => {
|
|
175
|
+
const e = u(n);
|
|
171
176
|
e == null || e.focus();
|
|
172
177
|
});
|
|
173
178
|
},
|
|
174
179
|
{ immediate: !0 }
|
|
175
|
-
),
|
|
180
|
+
), d(
|
|
176
181
|
() => l().text,
|
|
177
182
|
() => {
|
|
178
183
|
const e = n.value;
|
|
179
|
-
e && (
|
|
184
|
+
e && (C(e), w.value && (w.value = !1, H(e), requestAnimationFrame(() => H(e))));
|
|
180
185
|
},
|
|
181
186
|
{ immediate: !0, flush: "post" }
|
|
182
|
-
),
|
|
187
|
+
), d(
|
|
183
188
|
() => l().id,
|
|
184
189
|
() => {
|
|
185
190
|
const e = n.value;
|
|
186
|
-
e && (
|
|
191
|
+
e && (R(e), requestAnimationFrame(() => {
|
|
187
192
|
const t = n.value;
|
|
188
|
-
t &&
|
|
193
|
+
t && C(t);
|
|
189
194
|
}));
|
|
190
195
|
}
|
|
191
|
-
),
|
|
196
|
+
), d(g, (e) => {
|
|
192
197
|
e && S(() => {
|
|
193
198
|
const t = n.value;
|
|
194
199
|
if (!t) return;
|
|
195
|
-
const
|
|
196
|
-
|
|
200
|
+
const o = t.scrollTop;
|
|
201
|
+
C(t), t.scrollTop = o, c(), requestAnimationFrame(c);
|
|
197
202
|
});
|
|
198
203
|
});
|
|
199
|
-
function
|
|
204
|
+
function R(e) {
|
|
200
205
|
const t = l().inputHeight;
|
|
201
|
-
e.style.height = (t ||
|
|
206
|
+
e.style.height = (t || z) + "px", (!t || t <= z) && (e.style.overflowY = "hidden");
|
|
202
207
|
}
|
|
203
|
-
function
|
|
208
|
+
function fe(e) {
|
|
204
209
|
const t = parseFloat(e.style.height);
|
|
205
210
|
Number.isFinite(t) && (l().inputHeight = t);
|
|
206
211
|
}
|
|
207
|
-
function
|
|
212
|
+
function C(e) {
|
|
208
213
|
const t = l().text || "";
|
|
209
214
|
if (e.value !== t || e.clientWidth === 0) {
|
|
210
|
-
|
|
215
|
+
R(e);
|
|
211
216
|
return;
|
|
212
217
|
}
|
|
213
|
-
const
|
|
218
|
+
const o = e.scrollTop;
|
|
214
219
|
e.style.height = "auto";
|
|
215
|
-
const
|
|
216
|
-
`).length > 1,
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
document.body.removeChild(
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
222
|
-
|
|
220
|
+
const i = getComputedStyle(e), r = parseFloat(i.fontSize) || 16, p = parseFloat(i.lineHeight) || r * 1.4, x = z, A = p * 11, B = e.scrollHeight, xe = t.split(`
|
|
221
|
+
`).length > 1, s = document.createElement("div");
|
|
222
|
+
s.style.position = "absolute", s.style.visibility = "hidden", s.style.whiteSpace = "nowrap", s.style.font = i.font, s.style.fontSize = i.fontSize, s.style.fontFamily = i.fontFamily, s.style.fontWeight = i.fontWeight, s.style.letterSpacing = i.letterSpacing, s.textContent = t, document.body.appendChild(s);
|
|
223
|
+
const _e = s.offsetWidth;
|
|
224
|
+
document.body.removeChild(s);
|
|
225
|
+
const Se = parseFloat(i.paddingLeft) || 0, Ie = parseFloat(i.paddingRight) || 0, Te = e.clientWidth - Se - Ie, be = _e > Te, G = xe || be;
|
|
226
|
+
if (G && B <= x + 1) {
|
|
227
|
+
R(e);
|
|
223
228
|
return;
|
|
224
229
|
}
|
|
225
|
-
t.trim() &&
|
|
230
|
+
t.trim() && G ? B <= A ? (e.style.height = B + "px", e.style.overflowY = "hidden") : (e.style.height = A + "px", e.style.overflowY = "auto", e.scrollTop = o) : (e.style.height = x + "px", e.style.overflowY = "hidden"), fe(e), c(), requestAnimationFrame(c);
|
|
226
231
|
}
|
|
227
|
-
function
|
|
228
|
-
if (
|
|
232
|
+
function H(e) {
|
|
233
|
+
if (a.state === "disabled" || l().isRecording) return;
|
|
229
234
|
const t = e.value.length;
|
|
230
|
-
e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight,
|
|
235
|
+
e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight, c();
|
|
231
236
|
}
|
|
232
|
-
|
|
237
|
+
d(
|
|
233
238
|
() => l().forceSend,
|
|
234
239
|
() => {
|
|
235
|
-
l().forceSend && (
|
|
240
|
+
l().forceSend && (q(), Z(!1));
|
|
236
241
|
}
|
|
237
242
|
);
|
|
238
|
-
const
|
|
243
|
+
const pe = (e) => {
|
|
239
244
|
const t = e.target;
|
|
240
|
-
|
|
245
|
+
L("typing", t.value), f();
|
|
241
246
|
};
|
|
242
|
-
|
|
247
|
+
Ae(() => {
|
|
243
248
|
const e = n.value;
|
|
244
|
-
e && (
|
|
245
|
-
}),
|
|
246
|
-
|
|
249
|
+
e && (R(e), C(e)), document.addEventListener("selectionchange", N);
|
|
250
|
+
}), Ee(() => {
|
|
251
|
+
Pe(K), document.removeEventListener("selectionchange", N), y && cancelAnimationFrame(y);
|
|
247
252
|
});
|
|
248
|
-
const
|
|
253
|
+
const he = (e) => {
|
|
249
254
|
if (e.shiftKey) {
|
|
250
255
|
if (n.value instanceof HTMLTextAreaElement) {
|
|
251
256
|
let t = n.value.selectionStart;
|
|
252
257
|
t && (n.value.setRangeText(`
|
|
253
|
-
`, t, t, "end"),
|
|
258
|
+
`, t, t, "end"), M(n.value.value));
|
|
254
259
|
}
|
|
255
260
|
e.preventDefault();
|
|
256
261
|
} else if (e.ctrlKey) {
|
|
257
262
|
if (n.value instanceof HTMLTextAreaElement) {
|
|
258
263
|
let t = n.value.selectionStart;
|
|
259
264
|
t && (n.value.setRangeText(`
|
|
260
|
-
`, t, t, "end"),
|
|
265
|
+
`, t, t, "end"), M(n.value.value));
|
|
261
266
|
}
|
|
262
267
|
e.preventDefault();
|
|
263
268
|
} else
|
|
264
|
-
e.preventDefault(),
|
|
265
|
-
},
|
|
269
|
+
e.preventDefault(), q();
|
|
270
|
+
}, me = (e) => {
|
|
266
271
|
if (n.value) {
|
|
267
272
|
const t = n.value.value;
|
|
268
273
|
n.value.value = e.newText;
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
n.value && (n.value.setSelectionRange(
|
|
274
|
+
const o = e.newText.length - (t.length - (e.end - e.start)), i = e.start + o;
|
|
275
|
+
M(e.newText), S(() => {
|
|
276
|
+
n.value && (n.value.setSelectionRange(i, i), n.value.focus());
|
|
272
277
|
});
|
|
273
278
|
}
|
|
274
279
|
};
|
|
275
|
-
function
|
|
276
|
-
|
|
280
|
+
function ve() {
|
|
281
|
+
te();
|
|
277
282
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
283
|
+
function ge() {
|
|
284
|
+
ee(), M(""), je(b), n.value && n.value.focus();
|
|
280
285
|
}
|
|
281
|
-
function
|
|
286
|
+
function ye() {
|
|
282
287
|
const e = l();
|
|
283
288
|
return e.edit ? (e.text ?? "").trim() === (e.edit.text ?? "").trim() : !1;
|
|
284
289
|
}
|
|
285
|
-
const
|
|
286
|
-
var t,
|
|
287
|
-
const e =
|
|
288
|
-
if (e.value.edit &&
|
|
289
|
-
|
|
290
|
+
const q = () => {
|
|
291
|
+
var t, o;
|
|
292
|
+
const e = E(l());
|
|
293
|
+
if (e.value.edit && ye()) {
|
|
294
|
+
ge();
|
|
290
295
|
return;
|
|
291
296
|
}
|
|
292
297
|
if (e.value.text != "" || e.value.file) {
|
|
293
|
-
const
|
|
298
|
+
const i = {
|
|
294
299
|
type: "",
|
|
295
300
|
text: "",
|
|
296
301
|
url: "",
|
|
@@ -298,22 +303,78 @@ const H = 40, Xe = /* @__PURE__ */ ye({
|
|
|
298
303
|
size: "",
|
|
299
304
|
reply: void 0
|
|
300
305
|
};
|
|
301
|
-
e.value.file ? (
|
|
306
|
+
e.value.file ? (i.type = "message." + e.value.file.type, i.url = e.value.file.url, i.filename = e.value.file.name, i.size = (t = e.value.file.size) == null ? void 0 : t.toString(), i.text = (o = e == null ? void 0 : e.value) == null ? void 0 : o.text.trim()) : (i.type = "message.text", i.text = e.value.text.trim()), e.value.reply && (i.reply = e.value.reply), e.value.edit && (i.edit = e.value.edit), L("send", i), X(), n.value && n.value.focus();
|
|
302
307
|
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
308
|
+
};
|
|
309
|
+
return (e, t) => (F(), k("div", Ge, [
|
|
310
|
+
h("div", {
|
|
311
|
+
id: "chat-input-reply-line-" + u(b),
|
|
312
|
+
class: "chat-input__reply-line"
|
|
313
|
+
}, null, 8, Oe),
|
|
314
|
+
h("div", {
|
|
315
|
+
id: "chat-input-file-line-" + u(b),
|
|
316
|
+
class: j(["chat-input__file-line", { "chat-input__file-line--visible": !!D.value }])
|
|
317
|
+
}, [
|
|
318
|
+
D.value ? (F(), Fe(Ne, {
|
|
319
|
+
key: 0,
|
|
320
|
+
"file-info": D.value,
|
|
321
|
+
onReset: ve
|
|
322
|
+
}, null, 8, ["file-info"])) : U("", !0)
|
|
323
|
+
], 10, Ue),
|
|
324
|
+
h("div", Ye, [
|
|
325
|
+
Y(e.$slots, "inline-buttons", {}, void 0, !0)
|
|
326
|
+
]),
|
|
327
|
+
T.disabledPlaceholder && (T.state == "disabled" || u(l)().isRecording) ? (F(), k("div", Ve, Me(T.disabledPlaceholder), 1)) : (F(), k("div", $e, [
|
|
328
|
+
g.value ? (F(), k("div", {
|
|
329
|
+
key: 0,
|
|
330
|
+
ref_key: "refMirror",
|
|
331
|
+
ref: m,
|
|
332
|
+
class: "chat-input__input-mirror",
|
|
333
|
+
"aria-hidden": "true",
|
|
334
|
+
innerHTML: le.value
|
|
335
|
+
}, null, 8, Je)) : U("", !0),
|
|
336
|
+
Re(h("textarea", {
|
|
337
|
+
ref_key: "refInput",
|
|
338
|
+
ref: n,
|
|
339
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => u(l)().text = o),
|
|
340
|
+
rows: "1",
|
|
341
|
+
disabled: T.state == "disabled" || u(l)().isRecording,
|
|
342
|
+
class: j(["chat-input__input", { "chat-input__input--emoji-images": g.value }]),
|
|
343
|
+
placeholder: de.value,
|
|
344
|
+
onKeydown: [
|
|
345
|
+
ae,
|
|
346
|
+
He(he, ["enter"])
|
|
347
|
+
],
|
|
348
|
+
onInput: pe,
|
|
349
|
+
onScroll: c,
|
|
350
|
+
onSelect: f,
|
|
351
|
+
onMouseup: W,
|
|
352
|
+
onKeyup: W,
|
|
353
|
+
onMousemove: re,
|
|
354
|
+
onBlur: P
|
|
355
|
+
}, null, 42, Qe), [
|
|
356
|
+
[ke, u(l)().text]
|
|
357
|
+
])
|
|
358
|
+
])),
|
|
359
|
+
O(Ke, {
|
|
360
|
+
textarea: n.value,
|
|
361
|
+
onFormatApplied: me
|
|
362
|
+
}, null, 8, ["textarea"]),
|
|
363
|
+
h("button", {
|
|
364
|
+
class: j(["chat-input__button", { "chat-input__button-disabled": ue.value }]),
|
|
365
|
+
disabled: u(l)().isRecording,
|
|
366
|
+
onClick: q
|
|
367
|
+
}, [
|
|
368
|
+
h("span", Ze, [
|
|
369
|
+
O(u(ze), { color: ce.value }, null, 8, ["color"])
|
|
370
|
+
])
|
|
371
|
+
], 10, Xe),
|
|
372
|
+
h("div", et, [
|
|
373
|
+
Y(e.$slots, "buttons", {}, void 0, !0)
|
|
374
|
+
])
|
|
375
|
+
]));
|
|
315
376
|
}
|
|
316
377
|
});
|
|
317
378
|
export {
|
|
318
|
-
|
|
379
|
+
_t as default
|
|
319
380
|
};
|