@mobilon-dev/chotto 0.3.120 → 0.3.121
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 +29 -4
- package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +40 -59
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue.js +47 -4
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +55 -82
- package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +86 -51
- package/dist/components/1_atoms/EmbedPreview/EmbedPreview.vue.js +32 -4
- package/dist/components/1_atoms/EmbedPreview/EmbedPreview.vue2.js +7 -28
- package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.js +22 -35
- package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue2.js +30 -2
- package/dist/components/1_atoms/LinkPreview/LinkPreview.vue.js +37 -4
- package/dist/components/1_atoms/LinkPreview/LinkPreview.vue2.js +7 -21
- package/dist/components/1_atoms/LoadingIndicator/LoadingIndicator.vue.js +30 -19
- package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +70 -4
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +76 -108
- package/dist/components/1_icons/AvatarIcon.vue.js +8 -8
- package/dist/components/1_icons/CheckIcon.vue.js +26 -13
- package/dist/components/1_icons/CloseButtonIcon.vue.js +16 -10
- package/dist/components/1_icons/CloseIcon.vue.js +16 -10
- package/dist/components/1_icons/ContactCRMIcon.vue.js +16 -10
- package/dist/components/1_icons/DeletedMessageIcon.vue.js +27 -0
- package/dist/components/1_icons/MenuIcon.vue.js +16 -10
- package/dist/components/1_icons/MessageStatus/ErrorStatusIcon.vue.js +23 -3
- package/dist/components/1_icons/MessageStatus/ErrorStatusIcon.vue2.js +12 -21
- package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue.js +36 -4
- package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue2.js +11 -26
- package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue.js +23 -3
- package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue2.js +12 -21
- package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue.js +23 -3
- package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue2.js +11 -20
- package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue.js +33 -4
- package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue2.js +11 -23
- package/dist/components/1_icons/SearchIcon.vue.js +29 -17
- package/dist/components/1_icons/SettingsIcon.vue.js +8 -8
- package/dist/components/1_icons/TelegramIcon.vue.js +32 -20
- package/dist/components/1_icons/VerifiedBadge.vue.js +25 -19
- package/dist/components/1_icons/WhatsAppIcon.vue.js +32 -20
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +552 -402
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +101 -58
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelCheckIcon.vue.js +14 -8
- 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 +19 -13
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSMSIcon.vue.js +16 -10
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuMaxIcon.vue.js +35 -23
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuPhoneIcon.vue.js +32 -20
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuSMSIcon.vue.js +17 -11
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuTelegramIcon.vue.js +8 -8
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuWhatsAppIcon.vue.js +32 -20
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelTelegramIcon.vue.js +33 -21
- 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 +74 -4
- package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue2.js +12 -46
- package/dist/components/2_blocks/FeedFoundObjects/FeedFoundObjects.vue.js +62 -4
- package/dist/components/2_blocks/FeedFoundObjects/FeedFoundObjects.vue2.js +15 -36
- package/dist/components/2_blocks/FeedSearch/FeedSearch.vue.js +49 -4
- package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +22 -45
- package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue.js +36 -4
- package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +19 -37
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +62 -4
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +80 -98
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.js +31 -27
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue2.js +13 -2
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.js +72 -4
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +47 -83
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.js +19 -21
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue2.js +13 -2
- package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +76 -45
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +100 -4
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +16 -91
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +79 -4
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +88 -111
- package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.js +15 -17
- package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue2.js +13 -2
- package/dist/components/2_chatinput_elements/PlaceholderComponent/PlaceholderComponent.vue.js +39 -33
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +220 -4
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +146 -256
- package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.js +39 -41
- package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue2.js +13 -2
- package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +233 -163
- package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js +164 -4
- package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +87 -175
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue.js +73 -4
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +32 -58
- package/dist/components/2_chatinput_elements/WABAQuickReplyButtons/WABAQuickReplyButtons.vue.js +47 -4
- package/dist/components/2_chatinput_elements/WABAQuickReplyButtons/WABAQuickReplyButtons.vue2.js +10 -23
- package/dist/components/2_chatinput_elements/WABASeparatedQuickButtons/WABASeparatedQuickButtons.vue.js +52 -4
- package/dist/components/2_chatinput_elements/WABASeparatedQuickButtons/WABASeparatedQuickButtons.vue2.js +8 -26
- package/dist/components/2_chatinput_elements/WABATemplateSelector/WABATemplateSelector.vue.js +299 -220
- package/dist/components/2_chatlist_elements/ChatFilter/ChatFilter.vue.js +41 -35
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +306 -4
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +143 -323
- package/dist/components/2_chatlist_elements/ChatItem/icons/AudioIcon.vue.js +18 -12
- package/dist/components/2_chatlist_elements/ChatItem/icons/FileIcon.vue.js +23 -11
- package/dist/components/2_chatlist_elements/ChatItem/icons/ImageIcon.vue.js +7 -7
- package/dist/components/2_chatlist_elements/ChatItem/icons/MissedCallIcon.vue.js +34 -22
- package/dist/components/2_chatlist_elements/ChatItem/icons/StickerIcon.vue.js +15 -9
- package/dist/components/2_chatlist_elements/ChatItem/icons/VideoIcon.vue.js +26 -14
- package/dist/components/2_chatlist_elements/ChatItem/icons/VoiceIcon.vue.js +7 -7
- package/dist/components/2_chatlist_elements/ChatTabs/ChatTabs.vue.js +52 -24
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +84 -4
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +36 -68
- package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +71 -37
- package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +83 -62
- package/dist/components/2_elements/ChatPanel/ChatPanel.vue.js +41 -29
- package/dist/components/2_elements/ContactInfo/ContactInfo.vue.js +176 -115
- package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +48 -27
- package/dist/components/2_elements/UserProfile/UserProfile.vue.js +58 -28
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +54 -4
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +22 -42
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +460 -4
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +181 -499
- package/dist/components/2_feed_elements/BaseEditMessage/BaseEditMessage.vue.js +19 -4
- package/dist/components/2_feed_elements/BaseEditMessage/BaseEditMessage.vue2.js +12 -22
- package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js +26 -4
- package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue2.js +26 -39
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +482 -4
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +148 -448
- package/dist/components/2_feed_elements/CallMessage/icons/IncomingCallIcon.vue.js +17 -19
- package/dist/components/2_feed_elements/CallMessage/icons/IncomingCallIcon.vue2.js +13 -2
- package/dist/components/2_feed_elements/CallMessage/icons/OutgoingCallIcon.vue.js +17 -19
- package/dist/components/2_feed_elements/CallMessage/icons/OutgoingCallIcon.vue2.js +13 -2
- package/dist/components/2_feed_elements/DateMessage/DateMessage.vue.js +17 -4
- package/dist/components/2_feed_elements/DateMessage/DateMessage.vue2.js +7 -7
- package/dist/components/2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js +16 -3
- package/dist/components/2_feed_elements/DateMessageSticky/DateMessageSticky.vue2.js +7 -7
- package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue.js +67 -4
- package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue2.js +11 -43
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +47 -4
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +37 -46
- package/dist/components/2_feed_elements/EditTextMessage/EditTextMessage.vue.js +22 -4
- package/dist/components/2_feed_elements/EditTextMessage/EditTextMessage.vue2.js +8 -15
- package/dist/components/2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js +43 -4
- package/dist/components/2_feed_elements/FeedKeyboard/FeedKeyboard.vue2.js +10 -25
- package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +52 -4
- package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +16 -39
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +270 -4
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +95 -274
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +409 -4
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +143 -422
- package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js +39 -4
- package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +12 -22
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +57 -4
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +41 -69
- package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue.js +97 -4
- package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue2.js +102 -173
- package/dist/components/2_feed_elements/MessageReactions/icons/DeleteIcon.vue.js +32 -20
- package/dist/components/2_feed_elements/MessageReactions/icons/EditIcon.vue.js +32 -20
- package/dist/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.js +17 -11
- package/dist/components/2_feed_elements/MessageReactions/icons/MessageActionsIcon.vue.js +16 -10
- package/dist/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.js +17 -11
- package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.js +22 -4
- package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue2.js +17 -23
- package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.js +28 -4
- package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue2.js +27 -29
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.js +142 -4
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +33 -121
- package/dist/components/2_feed_elements/MissedCallMessage/icons/MissedCallIcon.vue.js +34 -22
- package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue.js +55 -4
- package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue2.js +8 -30
- package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue.js +47 -4
- package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue2.js +9 -25
- package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue.js +56 -4
- package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue2.js +8 -37
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +72 -4
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +10 -59
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +142 -4
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +34 -118
- package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue.js +49 -4
- package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue2.js +15 -53
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +94 -4
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +10 -76
- package/dist/components/2_feed_elements/SplashScreen/SplashScreen.vue.js +18 -4
- package/dist/components/2_feed_elements/SplashScreen/SplashScreen.vue2.js +9 -17
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +348 -4
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +97 -339
- package/dist/components/2_feed_elements/SystemMessage/SystemMessage.vue.js +17 -4
- package/dist/components/2_feed_elements/SystemMessage/SystemMessage.vue2.js +7 -7
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +308 -4
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +89 -299
- package/dist/components/2_feed_elements/TypingMessage/TypingMessage.vue.js +37 -4
- package/dist/components/2_feed_elements/TypingMessage/TypingMessage.vue2.js +7 -21
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +321 -4
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +96 -338
- package/dist/components/2_modals/ConfirmDeleteMessage/ConfirmDeleteMessage.vue.js +64 -4
- package/dist/components/2_modals/ConfirmDeleteMessage/ConfirmDeleteMessage.vue3.js +10 -45
- package/dist/components/2_modals/CreateChat/CreateChat.vue.js +36 -19
- package/dist/components/2_modals/CreateChat2/CreateChat2.vue.js +140 -92
- package/dist/components/2_modals/CreateDialog/CreateDialog.vue.js +96 -49
- package/dist/components/2_modals/Modal/Modal.vue.js +59 -50
- package/dist/components/2_modals/ModalFullscreen/ModalFullscreen.vue.js +51 -38
- package/dist/components/2_modals/ModalNoFooter/ModalNoFooter.vue.js +39 -30
- package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue.js +155 -4
- package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue2.js +49 -121
- package/dist/components/2_modals/SelectUser/SelectUser.vue.js +60 -43
- package/dist/components/2_modals/SelectUser2/SelectUser2.vue.js +41 -24
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +170 -4
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +239 -336
- package/dist/components/3_compounds/ChatInput/icons/ArrowIcon.vue.js +43 -25
- package/dist/components/3_compounds/ChatInput/icons/SendIcon.vue.js +25 -21
- package/dist/components/3_compounds/ChatInput/icons/SendIcon.vue2.js +13 -2
- package/dist/components/3_compounds/ChatList/ChatList.vue.js +256 -166
- package/dist/components/3_compounds/ChatList/ChatListHeader.vue.js +57 -39
- package/dist/components/3_compounds/ChatList/icons/LogoIcon.vue.js +6 -6
- package/dist/components/3_compounds/Feed/Feed.vue.js +185 -4
- package/dist/components/3_compounds/Feed/Feed.vue2.js +161 -305
- package/dist/components/3_compounds/SideBar/SideBar.vue.js +279 -202
- package/dist/components/4_layouts/AdaptiveExtendedLayout/AdaptiveExtendedLayout.vue.js +43 -36
- package/dist/components/4_layouts/BaseLayout/BaseLayout.vue.js +5 -5
- package/dist/components/4_layouts/ChatWrapper/ChatWrapper.vue.js +32 -4
- package/dist/components/4_layouts/ChatWrapper/ChatWrapper.vue2.js +7 -29
- 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 +33 -18
- package/dist/components/5_containers/FloatContainer/FloatContainer.vue.js +90 -59
- package/dist/types/src/apps/data/chats.d.ts +9 -2
- package/dist/types/src/components/2_chatlist_elements/ChatItem/stories/ChatItem.stories.d.ts +1 -0
- package/dist/types/src/components/2_chatlist_elements/ChatItem/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/2_feed_elements/DeletedMessageContent/icons/DeletedMessageIcon.vue.js +0 -21
- /package/dist/types/src/components/{2_feed_elements/DeletedMessageContent/icons → 1_icons}/DeletedMessageIcon.vue.d.ts +0 -0
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useImmediateDebouncedRef as
|
|
3
|
-
import { MAX_ATTACHED_FILES as
|
|
4
|
-
import { useEmojiNative as
|
|
1
|
+
import { defineComponent as Pe, inject as _e, watch as d, ref as v, computed as p, provide as qe, nextTick as A, unref as ze, onMounted as je, onUnmounted as ke } from "vue";
|
|
2
|
+
import { useImmediateDebouncedRef as Ne } from "../../../hooks/useImmediateDebouncedRef.js";
|
|
3
|
+
import { MAX_ATTACHED_FILES as ue, resolveMessageDraftStore as Be, useMessageDraft as Oe, getDraftFiles as Ge } from "../../../hooks/useMessageDraft.js";
|
|
4
|
+
import { useEmojiNative as Ye } from "../../../hooks/useEmojiNative.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { t as
|
|
7
|
+
import { t as y } 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
|
|
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({
|
|
12
|
+
import { textToAppleEmojiHtml as Ue, textContainsEmoji as Ve, snapIndexToGrapheme as ce, previousGraphemeIndex as fe, nextGraphemeIndex as de } from "../../../functions/renderAppleEmojis.js";
|
|
13
|
+
import { useStartEdit as Xe, hideEditPreview as $e } from "../../../hooks/messages/useStartEdit.js";
|
|
14
|
+
import { canStartEditLastSent as Je, isEditableLastSentCandidate as Qe } from "../../../hooks/messages/canStartEditLastSent.js";
|
|
15
|
+
import { buildEditPayload as Ze } from "../../../hooks/messages/buildEditPayload.js";
|
|
16
|
+
import et from "./icons/SendIcon.vue.js";
|
|
17
|
+
import tt from "./icons/ArrowIcon.vue.js";
|
|
18
|
+
import nt from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
|
|
19
|
+
import ot from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
|
|
20
|
+
const K = 40, Tt = /* @__PURE__ */ Pe({
|
|
31
21
|
__name: "ChatInput",
|
|
32
22
|
props: {
|
|
33
23
|
state: {
|
|
@@ -57,7 +47,7 @@ const vt = {
|
|
|
57
47
|
maxAttachedFiles: {
|
|
58
48
|
type: Number,
|
|
59
49
|
required: !1,
|
|
60
|
-
default:
|
|
50
|
+
default: ue
|
|
61
51
|
},
|
|
62
52
|
resolveEditLastSentMessage: {
|
|
63
53
|
type: Function,
|
|
@@ -66,45 +56,46 @@ const vt = {
|
|
|
66
56
|
}
|
|
67
57
|
},
|
|
68
58
|
emits: ["send", "typing"],
|
|
69
|
-
setup(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
setup(pe, { expose: me, emit: he }) {
|
|
60
|
+
me();
|
|
61
|
+
const w = he, E = _e("chatAppId"), G = Be(E), { resetMessage: Y, getMessage: l, setMessageText: b, setForceSendMessage: U, resetEdit: V, removeMessageFile: X } = Oe(E), { startEdit: $ } = Xe(E), { isNative: J, emojiSrc: Q } = Ye(E);
|
|
62
|
+
let H = l().id;
|
|
63
|
+
d(
|
|
64
|
+
() => l().id,
|
|
74
65
|
(e) => {
|
|
75
|
-
|
|
66
|
+
H = e;
|
|
76
67
|
}
|
|
77
68
|
);
|
|
78
|
-
const
|
|
79
|
-
let
|
|
80
|
-
const
|
|
81
|
-
function
|
|
82
|
-
const e =
|
|
69
|
+
const o = v(), T = v(), M = v(), S = v(null), F = v(!1), Z = Ne("", 2e3), P = v(!1), _ = v(!1);
|
|
70
|
+
let f = null;
|
|
71
|
+
const x = p(() => Ge(l()));
|
|
72
|
+
function W() {
|
|
73
|
+
const e = M.value;
|
|
83
74
|
if (!e) {
|
|
84
|
-
|
|
75
|
+
P.value = !1, _.value = !1;
|
|
85
76
|
return;
|
|
86
77
|
}
|
|
87
78
|
const t = e.scrollWidth - e.clientWidth;
|
|
88
|
-
|
|
79
|
+
P.value = e.scrollLeft > 1, _.value = t - e.scrollLeft > 1;
|
|
89
80
|
}
|
|
90
|
-
function
|
|
81
|
+
function ee(e) {
|
|
91
82
|
const t = e.firstElementChild;
|
|
92
83
|
if (!t) return e.clientWidth;
|
|
93
84
|
const n = parseFloat(getComputedStyle(e).gap) || 8;
|
|
94
85
|
return t.offsetWidth + n;
|
|
95
86
|
}
|
|
96
|
-
function
|
|
97
|
-
const t =
|
|
87
|
+
function ge(e) {
|
|
88
|
+
const t = M.value;
|
|
98
89
|
if (!t) return;
|
|
99
|
-
const n =
|
|
90
|
+
const n = ee(t);
|
|
100
91
|
t.scrollBy({ left: e === "right" ? n : -n, behavior: "smooth" });
|
|
101
92
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
const e =
|
|
105
|
-
e && (
|
|
93
|
+
function q() {
|
|
94
|
+
f == null || f.disconnect();
|
|
95
|
+
const e = M.value;
|
|
96
|
+
e && (f = new ResizeObserver(() => W()), f.observe(e));
|
|
106
97
|
}
|
|
107
|
-
function
|
|
98
|
+
function ve(e) {
|
|
108
99
|
return e.preview ?? {
|
|
109
100
|
isImage: !1,
|
|
110
101
|
isVideo: !1,
|
|
@@ -113,283 +104,283 @@ const vt = {
|
|
|
113
104
|
fileSize: ""
|
|
114
105
|
};
|
|
115
106
|
}
|
|
116
|
-
const
|
|
117
|
-
() =>
|
|
118
|
-
),
|
|
119
|
-
() => !
|
|
120
|
-
),
|
|
121
|
-
if (!T.value || !
|
|
122
|
-
const e =
|
|
107
|
+
const ye = p(
|
|
108
|
+
() => Ue(l().text || "", S.value, Q.value)
|
|
109
|
+
), L = p(
|
|
110
|
+
() => !J.value && Ve(l().text || "")
|
|
111
|
+
), m = () => {
|
|
112
|
+
if (!T.value || !o.value) return;
|
|
113
|
+
const e = o.value, t = T.value, n = Math.max(0, e.offsetWidth - e.clientWidth);
|
|
123
114
|
t.style.right = n > 0 ? `${n}px` : "", t.scrollTop = e.scrollTop;
|
|
124
115
|
};
|
|
125
|
-
let
|
|
126
|
-
function
|
|
127
|
-
|
|
116
|
+
let h = 0;
|
|
117
|
+
function z() {
|
|
118
|
+
S.value = null;
|
|
128
119
|
}
|
|
129
|
-
function
|
|
130
|
-
const t =
|
|
131
|
-
if (!t || !
|
|
132
|
-
const n = t.value,
|
|
133
|
-
(
|
|
120
|
+
function te(e = "nearest") {
|
|
121
|
+
const t = o.value;
|
|
122
|
+
if (!t || !L.value) return;
|
|
123
|
+
const n = t.value, s = ce(n, t.selectionStart, e), r = ce(n, t.selectionEnd, e);
|
|
124
|
+
(s !== t.selectionStart || r !== t.selectionEnd) && t.setSelectionRange(s, r);
|
|
134
125
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
126
|
+
function ne() {
|
|
127
|
+
te("nearest"), I();
|
|
137
128
|
}
|
|
138
|
-
function
|
|
139
|
-
var
|
|
140
|
-
const t =
|
|
141
|
-
if (!
|
|
129
|
+
function oe(e) {
|
|
130
|
+
var r, a, u;
|
|
131
|
+
const t = l(), n = o.value;
|
|
132
|
+
if (!Je({
|
|
142
133
|
key: e.key,
|
|
143
134
|
altKey: e.altKey,
|
|
144
135
|
metaKey: e.metaKey,
|
|
145
136
|
ctrlKey: e.ctrlKey,
|
|
146
137
|
shiftKey: e.shiftKey,
|
|
147
|
-
hasResolver: typeof
|
|
148
|
-
disabled:
|
|
138
|
+
hasResolver: typeof i.resolveEditLastSentMessage == "function",
|
|
139
|
+
disabled: i.state === "disabled",
|
|
149
140
|
isRecording: t.isRecording,
|
|
150
141
|
draftText: t.text ?? "",
|
|
151
|
-
replyMessageId: (
|
|
152
|
-
editMessageId: (
|
|
142
|
+
replyMessageId: (r = t.reply) == null ? void 0 : r.messageId,
|
|
143
|
+
editMessageId: (a = t.edit) == null ? void 0 : a.messageId,
|
|
153
144
|
textareaText: (n == null ? void 0 : n.value) ?? t.text ?? "",
|
|
154
145
|
selectionStart: (n == null ? void 0 : n.selectionStart) ?? 0
|
|
155
146
|
})) return !1;
|
|
156
|
-
const
|
|
157
|
-
return
|
|
147
|
+
const s = (u = i.resolveEditLastSentMessage) == null ? void 0 : u.call(i);
|
|
148
|
+
return Qe(s) ? (e.preventDefault(), $(Ze(s)), !0) : !1;
|
|
158
149
|
}
|
|
159
|
-
function
|
|
160
|
-
if (
|
|
161
|
-
const t =
|
|
150
|
+
function Se(e) {
|
|
151
|
+
if (oe(e) || !L.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.altKey || e.metaKey || e.ctrlKey) return;
|
|
152
|
+
const t = o.value;
|
|
162
153
|
if (!t) return;
|
|
163
|
-
const n = t.value,
|
|
154
|
+
const n = t.value, s = t.selectionStart !== t.selectionEnd;
|
|
164
155
|
if (e.shiftKey) {
|
|
165
|
-
requestAnimationFrame(() =>
|
|
156
|
+
requestAnimationFrame(() => ne());
|
|
166
157
|
return;
|
|
167
158
|
}
|
|
168
|
-
if (
|
|
159
|
+
if (s) {
|
|
169
160
|
e.preventDefault();
|
|
170
|
-
const u = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd,
|
|
171
|
-
t.setSelectionRange(
|
|
161
|
+
const u = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd, g = e.key === "ArrowLeft" ? fe(n, u) : de(n, u);
|
|
162
|
+
t.setSelectionRange(g, g), I();
|
|
172
163
|
return;
|
|
173
164
|
}
|
|
174
165
|
e.preventDefault();
|
|
175
|
-
const
|
|
176
|
-
t.setSelectionRange(
|
|
166
|
+
const r = t.selectionStart, a = e.key === "ArrowLeft" ? fe(n, r) : de(n, r);
|
|
167
|
+
t.setSelectionRange(a, a), I();
|
|
177
168
|
}
|
|
178
|
-
function
|
|
179
|
-
if (!
|
|
180
|
-
|
|
169
|
+
function I() {
|
|
170
|
+
if (!L.value) {
|
|
171
|
+
z();
|
|
181
172
|
return;
|
|
182
173
|
}
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
|
|
186
|
-
const e =
|
|
174
|
+
h && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
175
|
+
var a;
|
|
176
|
+
h = 0;
|
|
177
|
+
const e = o.value;
|
|
187
178
|
if (!e) {
|
|
188
|
-
|
|
179
|
+
z();
|
|
189
180
|
return;
|
|
190
181
|
}
|
|
191
182
|
const t = e.selectionStart, n = e.selectionEnd;
|
|
192
183
|
if (t === n) {
|
|
193
|
-
|
|
184
|
+
S.value !== null && (S.value = null, A(m));
|
|
194
185
|
return;
|
|
195
186
|
}
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
T.value && (T.value.scrollTop =
|
|
187
|
+
const s = S.value;
|
|
188
|
+
if (s && s.start === t && s.end === n) return;
|
|
189
|
+
const r = ((a = T.value) == null ? void 0 : a.scrollTop) ?? 0;
|
|
190
|
+
S.value = { start: t, end: n }, A(() => {
|
|
191
|
+
T.value && (T.value.scrollTop = r), m();
|
|
201
192
|
});
|
|
202
193
|
});
|
|
203
194
|
}
|
|
204
|
-
function
|
|
205
|
-
e.buttons &&
|
|
195
|
+
function xe(e) {
|
|
196
|
+
e.buttons && I();
|
|
206
197
|
}
|
|
207
|
-
function
|
|
208
|
-
document.activeElement ===
|
|
198
|
+
function j() {
|
|
199
|
+
document.activeElement === o.value && I();
|
|
209
200
|
}
|
|
210
|
-
const
|
|
211
|
-
() =>
|
|
212
|
-
),
|
|
213
|
-
const e = Number(
|
|
214
|
-
return Number.isFinite(e) && e > 0 ? Math.floor(e) :
|
|
201
|
+
const i = pe, Ie = p(
|
|
202
|
+
() => i.state === "disabled" && !!i.disabledPlaceholder
|
|
203
|
+
), k = p(() => {
|
|
204
|
+
const e = Number(i.maxAttachedFiles);
|
|
205
|
+
return Number.isFinite(e) && e > 0 ? Math.floor(e) : ue;
|
|
215
206
|
});
|
|
216
|
-
|
|
217
|
-
const Ae =
|
|
218
|
-
() =>
|
|
219
|
-
),
|
|
207
|
+
qe("maxAttachedFiles", k);
|
|
208
|
+
const Ae = p(
|
|
209
|
+
() => y("component.ChatInput.FilesSelectedCount").replace("{count}", String(x.value.length)).replace("{max}", String(k.value))
|
|
210
|
+
), Ee = p(() => !!(i.state == "disabled" || l().text == "" && !x.value.length || l().isRecording)), Te = p(() => {
|
|
220
211
|
var t;
|
|
221
|
-
if (
|
|
222
|
-
return
|
|
223
|
-
if (!((t =
|
|
212
|
+
if (i.inputButtonColor)
|
|
213
|
+
return i.inputButtonColor;
|
|
214
|
+
if (!((t = i.selectedChannel) != null && t.channelId))
|
|
224
215
|
return "#25D366";
|
|
225
|
-
const e =
|
|
216
|
+
const e = i.selectedChannel.channelId.toLowerCase();
|
|
226
217
|
return e.includes("whatsapp") || e.includes("waba") ? "#25D366" : e.includes("telegram") ? "#37AFE2" : e.includes("sms") ? "#6C757D" : e.includes("max") ? "#4B0082" : "#25D366";
|
|
227
|
-
}),
|
|
218
|
+
}), Fe = p(() => {
|
|
228
219
|
var t;
|
|
229
|
-
if (!((t =
|
|
230
|
-
return
|
|
231
|
-
const e =
|
|
232
|
-
return e.includes("whatsapp") || e.includes("waba") ?
|
|
220
|
+
if (!((t = i.selectedChannel) != null && t.channelId))
|
|
221
|
+
return y("component.ChatInput.InputPlaceholder");
|
|
222
|
+
const e = i.selectedChannel.channelId.toLowerCase();
|
|
223
|
+
return e.includes("whatsapp") || e.includes("waba") ? y("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? y("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? y("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? y("component.ChatInput.MaxInputPlaceholder") : y("component.ChatInput.InputPlaceholder");
|
|
233
224
|
});
|
|
234
|
-
|
|
235
|
-
() =>
|
|
225
|
+
d(
|
|
226
|
+
() => Z.value,
|
|
236
227
|
() => {
|
|
237
|
-
|
|
228
|
+
w("typing");
|
|
238
229
|
}
|
|
239
230
|
);
|
|
240
|
-
function
|
|
241
|
-
|
|
242
|
-
if (e && !
|
|
243
|
-
const t =
|
|
244
|
-
t && (
|
|
231
|
+
function N(e = !1) {
|
|
232
|
+
A(() => {
|
|
233
|
+
if (e && !F.value) return;
|
|
234
|
+
const t = o.value;
|
|
235
|
+
t && (C(t), e && (F.value = !1), D(t), requestAnimationFrame(() => D(t)));
|
|
245
236
|
});
|
|
246
237
|
}
|
|
247
|
-
|
|
248
|
-
() =>
|
|
238
|
+
d(
|
|
239
|
+
() => l().edit,
|
|
249
240
|
(e) => {
|
|
250
|
-
(e == null ? void 0 : e.messageId) != null && (
|
|
241
|
+
(e == null ? void 0 : e.messageId) != null && (F.value = !0, N(!0));
|
|
251
242
|
}
|
|
252
|
-
),
|
|
253
|
-
() =>
|
|
243
|
+
), d(
|
|
244
|
+
() => l().reply,
|
|
254
245
|
(e) => {
|
|
255
|
-
(e == null ? void 0 : e.messageId) != null &&
|
|
246
|
+
(e == null ? void 0 : e.messageId) != null && N();
|
|
256
247
|
}
|
|
257
|
-
),
|
|
258
|
-
() =>
|
|
248
|
+
), d(
|
|
249
|
+
() => i.focusOnInputArea,
|
|
259
250
|
() => {
|
|
260
|
-
|
|
261
|
-
const e =
|
|
251
|
+
i.focusOnInputArea && A(() => {
|
|
252
|
+
const e = ze(o);
|
|
262
253
|
e == null || e.focus();
|
|
263
254
|
});
|
|
264
255
|
},
|
|
265
256
|
{ immediate: !0 }
|
|
266
|
-
),
|
|
267
|
-
() =>
|
|
257
|
+
), d(
|
|
258
|
+
() => l().text,
|
|
268
259
|
() => {
|
|
269
|
-
const e =
|
|
270
|
-
e && (
|
|
260
|
+
const e = o.value;
|
|
261
|
+
e && (C(e), F.value && (F.value = !1, D(e), requestAnimationFrame(() => D(e))));
|
|
271
262
|
},
|
|
272
263
|
{ immediate: !0, flush: "post" }
|
|
273
|
-
),
|
|
274
|
-
() =>
|
|
264
|
+
), d(
|
|
265
|
+
() => l().id,
|
|
275
266
|
() => {
|
|
276
|
-
const e =
|
|
277
|
-
e && (
|
|
278
|
-
const t =
|
|
279
|
-
t &&
|
|
267
|
+
const e = o.value;
|
|
268
|
+
e && (R(e), requestAnimationFrame(() => {
|
|
269
|
+
const t = o.value;
|
|
270
|
+
t && C(t);
|
|
280
271
|
}));
|
|
281
272
|
}
|
|
282
|
-
),
|
|
283
|
-
e &&
|
|
284
|
-
const t =
|
|
273
|
+
), d(L, (e) => {
|
|
274
|
+
e && A(() => {
|
|
275
|
+
const t = o.value;
|
|
285
276
|
if (!t) return;
|
|
286
277
|
const n = t.scrollTop;
|
|
287
|
-
|
|
278
|
+
C(t), t.scrollTop = n, m(), requestAnimationFrame(m);
|
|
288
279
|
});
|
|
289
280
|
});
|
|
290
|
-
function
|
|
291
|
-
const t =
|
|
292
|
-
e.style.height = (t ||
|
|
281
|
+
function R(e) {
|
|
282
|
+
const t = l().inputHeight;
|
|
283
|
+
e.style.height = (t || K) + "px", (!t || t <= K) && (e.style.overflowY = "hidden");
|
|
293
284
|
}
|
|
294
|
-
function
|
|
285
|
+
function se(e) {
|
|
295
286
|
const t = parseFloat(e.style.height);
|
|
296
|
-
Number.isFinite(t) && (
|
|
287
|
+
Number.isFinite(t) && (l().inputHeight = t);
|
|
297
288
|
}
|
|
298
|
-
function
|
|
299
|
-
const t =
|
|
289
|
+
function C(e) {
|
|
290
|
+
const t = l().text || "";
|
|
300
291
|
if (e.value !== t || e.clientWidth === 0) {
|
|
301
|
-
|
|
292
|
+
R(e);
|
|
302
293
|
return;
|
|
303
294
|
}
|
|
304
295
|
const n = e.scrollTop;
|
|
305
296
|
e.style.height = "auto";
|
|
306
|
-
const
|
|
307
|
-
`).length > 1,
|
|
308
|
-
|
|
309
|
-
const
|
|
310
|
-
document.body.removeChild(
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
313
|
-
|
|
297
|
+
const s = getComputedStyle(e), r = parseFloat(s.fontSize) || 16, a = parseFloat(s.lineHeight) || r * 1.4, u = K, g = a * 11, O = e.scrollHeight, Le = t.split(`
|
|
298
|
+
`).length > 1, c = document.createElement("div");
|
|
299
|
+
c.style.position = "absolute", c.style.visibility = "hidden", c.style.whiteSpace = "nowrap", c.style.font = s.font, c.style.fontSize = s.fontSize, c.style.fontFamily = s.fontFamily, c.style.fontWeight = s.fontWeight, c.style.letterSpacing = s.letterSpacing, c.textContent = t, document.body.appendChild(c);
|
|
300
|
+
const Re = c.offsetWidth;
|
|
301
|
+
document.body.removeChild(c);
|
|
302
|
+
const De = parseFloat(s.paddingLeft) || 0, He = parseFloat(s.paddingRight) || 0, We = e.clientWidth - De - He, Ke = Re > We, ae = Le || Ke;
|
|
303
|
+
if (ae && O <= u + 1) {
|
|
304
|
+
R(e);
|
|
314
305
|
return;
|
|
315
306
|
}
|
|
316
|
-
t.trim() &&
|
|
307
|
+
t.trim() && ae ? O <= g ? (e.style.height = O + "px", e.style.overflowY = "hidden") : (e.style.height = g + "px", e.style.overflowY = "auto", e.scrollTop = n) : (e.style.height = u + "px", e.style.overflowY = "hidden"), se(e), m(), requestAnimationFrame(m);
|
|
317
308
|
}
|
|
318
|
-
function
|
|
319
|
-
if (
|
|
309
|
+
function D(e) {
|
|
310
|
+
if (i.state === "disabled" || l().isRecording) return;
|
|
320
311
|
const t = e.value.length;
|
|
321
|
-
e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight,
|
|
312
|
+
e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight, m();
|
|
322
313
|
}
|
|
323
|
-
|
|
324
|
-
() =>
|
|
314
|
+
d(
|
|
315
|
+
() => l().forceSend,
|
|
325
316
|
() => {
|
|
326
|
-
|
|
317
|
+
l().forceSend && (B(), U(!1));
|
|
327
318
|
}
|
|
328
319
|
);
|
|
329
|
-
const
|
|
320
|
+
const Ce = (e) => {
|
|
330
321
|
const t = e.target;
|
|
331
|
-
|
|
322
|
+
w("typing", t.value), I();
|
|
332
323
|
};
|
|
333
|
-
|
|
334
|
-
|
|
324
|
+
d(
|
|
325
|
+
x,
|
|
335
326
|
(e, t) => {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
const n =
|
|
327
|
+
A(() => {
|
|
328
|
+
q(), W();
|
|
329
|
+
const n = M.value;
|
|
339
330
|
n && e.length > ((t == null ? void 0 : t.length) ?? 0) && n.scrollTo({ left: n.scrollWidth, behavior: "smooth" });
|
|
340
331
|
});
|
|
341
332
|
},
|
|
342
333
|
{ flush: "post" }
|
|
343
|
-
),
|
|
344
|
-
const e =
|
|
345
|
-
e && (
|
|
346
|
-
}),
|
|
347
|
-
|
|
334
|
+
), je(() => {
|
|
335
|
+
const e = o.value;
|
|
336
|
+
e && (R(e), C(e)), q(), W(), document.addEventListener("selectionchange", j);
|
|
337
|
+
}), ke(() => {
|
|
338
|
+
G.commitChatDraftToList(H), document.removeEventListener("selectionchange", j), f == null || f.disconnect(), h && cancelAnimationFrame(h);
|
|
348
339
|
});
|
|
349
|
-
const
|
|
340
|
+
const we = (e) => {
|
|
350
341
|
if (e.shiftKey) {
|
|
351
|
-
if (
|
|
352
|
-
let t =
|
|
353
|
-
t && (
|
|
354
|
-
`, t, t, "end"),
|
|
342
|
+
if (o.value instanceof HTMLTextAreaElement) {
|
|
343
|
+
let t = o.value.selectionStart;
|
|
344
|
+
t && (o.value.setRangeText(`
|
|
345
|
+
`, t, t, "end"), b(o.value.value));
|
|
355
346
|
}
|
|
356
347
|
e.preventDefault();
|
|
357
348
|
} else if (e.ctrlKey) {
|
|
358
|
-
if (
|
|
359
|
-
let t =
|
|
360
|
-
t && (
|
|
361
|
-
`, t, t, "end"),
|
|
349
|
+
if (o.value instanceof HTMLTextAreaElement) {
|
|
350
|
+
let t = o.value.selectionStart;
|
|
351
|
+
t && (o.value.setRangeText(`
|
|
352
|
+
`, t, t, "end"), b(o.value.value));
|
|
362
353
|
}
|
|
363
354
|
e.preventDefault();
|
|
364
355
|
} else
|
|
365
|
-
e.preventDefault(),
|
|
366
|
-
},
|
|
367
|
-
if (
|
|
368
|
-
const t =
|
|
369
|
-
|
|
370
|
-
const n = e.newText.length - (t.length - (e.end - e.start)),
|
|
371
|
-
|
|
372
|
-
|
|
356
|
+
e.preventDefault(), B();
|
|
357
|
+
}, be = (e) => {
|
|
358
|
+
if (o.value) {
|
|
359
|
+
const t = o.value.value;
|
|
360
|
+
o.value.value = e.newText;
|
|
361
|
+
const n = e.newText.length - (t.length - (e.end - e.start)), s = e.start + n;
|
|
362
|
+
b(e.newText), A(() => {
|
|
363
|
+
o.value && (o.value.setSelectionRange(s, s), o.value.focus());
|
|
373
364
|
});
|
|
374
365
|
}
|
|
375
366
|
};
|
|
376
|
-
function
|
|
377
|
-
|
|
367
|
+
function Me(e) {
|
|
368
|
+
X(e);
|
|
378
369
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
370
|
+
function le() {
|
|
371
|
+
V(), b(""), $e(E), o.value && o.value.focus();
|
|
381
372
|
}
|
|
382
|
-
function
|
|
383
|
-
const e =
|
|
373
|
+
function ie() {
|
|
374
|
+
const e = l();
|
|
384
375
|
return e.edit ? (e.text ?? "").trim() === (e.edit.text ?? "").trim() : !1;
|
|
385
376
|
}
|
|
386
|
-
const
|
|
387
|
-
const e =
|
|
388
|
-
if (e.value.edit &&
|
|
389
|
-
|
|
377
|
+
const B = () => {
|
|
378
|
+
const e = v(l());
|
|
379
|
+
if (e.value.edit && ie() && !x.value.length) {
|
|
380
|
+
le();
|
|
390
381
|
return;
|
|
391
382
|
}
|
|
392
|
-
if (e.value.text != "" ||
|
|
383
|
+
if (e.value.text != "" || x.value.length) {
|
|
393
384
|
const t = {
|
|
394
385
|
type: "",
|
|
395
386
|
text: "",
|
|
@@ -397,134 +388,46 @@ const vt = {
|
|
|
397
388
|
filename: "",
|
|
398
389
|
size: "",
|
|
399
390
|
reply: void 0
|
|
400
|
-
}, n =
|
|
391
|
+
}, n = x.value;
|
|
401
392
|
if (n.length) {
|
|
402
|
-
const
|
|
403
|
-
n.forEach((
|
|
404
|
-
var
|
|
393
|
+
const s = e.value.text.trim();
|
|
394
|
+
n.forEach((r, a) => {
|
|
395
|
+
var g;
|
|
405
396
|
const u = {
|
|
406
|
-
type: "message." +
|
|
407
|
-
url:
|
|
408
|
-
filename:
|
|
409
|
-
size: (
|
|
410
|
-
text:
|
|
397
|
+
type: "message." + r.type,
|
|
398
|
+
url: r.url,
|
|
399
|
+
filename: r.name,
|
|
400
|
+
size: (g = r.size) == null ? void 0 : g.toString(),
|
|
401
|
+
text: a === 0 ? s : ""
|
|
411
402
|
};
|
|
412
|
-
|
|
403
|
+
a === 0 && (e.value.reply && (u.reply = e.value.reply), e.value.edit && (u.edit = e.value.edit)), w("send", u);
|
|
413
404
|
});
|
|
414
405
|
} else
|
|
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),
|
|
416
|
-
|
|
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), w("send", t);
|
|
407
|
+
Y(), o.value && o.value.focus();
|
|
417
408
|
}
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
},
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
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));
|
|
409
|
+
}, re = { emit: w, chatAppId: E, messageDraftStore: G, resetMessage: Y, getMessage: l, setMessageText: b, setForceSendMessage: U, resetEdit: V, removeMessageFile: X, startEdit: $, isNative: J, emojiSrc: Q, get ownedDraftId() {
|
|
410
|
+
return H;
|
|
411
|
+
}, set ownedDraftId(e) {
|
|
412
|
+
H = e;
|
|
413
|
+
}, refInput: o, refMirror: T, refFileChips: M, selectionRange: S, focusAtEndAfterResize: F, typing: Z, canScrollLeft: P, canScrollRight: _, get fileChipsObserver() {
|
|
414
|
+
return f;
|
|
415
|
+
}, set fileChipsObserver(e) {
|
|
416
|
+
f = e;
|
|
417
|
+
}, attachedFiles: x, updateFileScrollState: W, getFileScrollStep: ee, scrollFiles: ge, setupFileChipsObserver: q, previewOf: ve, emojiMirrorHtml: ye, useEmojiMirror: L, syncMirrorScroll: m, get selectionSyncRaf() {
|
|
418
|
+
return h;
|
|
419
|
+
}, set selectionSyncRaf(e) {
|
|
420
|
+
h = e;
|
|
421
|
+
}, clearSelectionHighlight: z, snapTextareaCaret: te, snapCaretAndUpdateSelection: ne, tryStartEditLastSent: oe, onInputKeydown: Se, updateSelectionState: I, onInputMouseMove: xe, onDocumentSelectionChange: j, props: i, showDisabledNotice: Ie, maxAttachedFiles: k, filesSelectedCount: Ae, disabledSendButton: Ee, sendIconColor: Te, inputPlaceholder: Fe, scheduleInputFocusAtEnd: N, INPUT_MIN_HEIGHT: K, applySavedInputHeight: R, persistInputHeight: se, resizeTextarea: C, applyFocusAtEnd: D, sendTyping: Ce, keyEnter: we, handleFormatApplied: be, removeAttachedFile: Me, cancelEditMode: le, isEditTextUnchanged: ie, sendMessage: B, get t() {
|
|
422
|
+
return y;
|
|
423
|
+
}, get SendIcon() {
|
|
424
|
+
return et;
|
|
425
|
+
}, get ArrowIcon() {
|
|
426
|
+
return tt;
|
|
427
|
+
}, TextFormatToolbar: nt, FilePreview: ot };
|
|
428
|
+
return Object.defineProperty(re, "__isScriptSetup", { enumerable: !1, value: !0 }), re;
|
|
526
429
|
}
|
|
527
430
|
});
|
|
528
431
|
export {
|
|
529
|
-
|
|
432
|
+
Tt as default
|
|
530
433
|
};
|