UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

975 lines (974 loc) 33.3 kB
import q from "./last-active-nodes.js"; import { removeClassStyleAttrs as z, addClassStyleAttrs as N, returnFirstEl as U } from "../../common/utils/index.js"; import { Node as H, mergeAttributes as W } from "@tiptap/core"; import { NodeViewWrapper as K, nodeViewProps as X, VueNodeViewRenderer as Q } from "../../node_modules/@tiptap/vue-3.js"; import { DtIconClose as G, DtIconVideo as Y, DtIconImage as J, DtIconVerySatisfied as Z, DtIconSatisfied as $, DtIconSend as ee } from "@dialpad/dialtone-icons/vue3"; import { resolveComponent as l, openBlock as r, createBlock as d, withCtx as a, createVNode as c, createElementVNode as u, createTextVNode as te, toDisplayString as T, resolveDirective as I, createElementBlock as v, mergeProps as _, withModifiers as C, renderSlot as g, createCommentVNode as h, withDirectives as f, normalizeStyle as ie, vShow as oe, normalizeClass as ne, createSlots as le } from "vue"; import { _ as B } from "../../_plugin-vue_export-helper-CHgC5LLL.js"; import se from "../item-layout/item-layout.js"; import j from "../button/button.js"; import ae from "./message-input-topbar.js"; import re from "./message-input-link.js"; import { EDITOR_SUPPORTED_LINK_PROTOCOLS as ce, EDITOR_DEFAULT_LINK_PREFIX as de } from "../editor/editor-constants.js"; import ue from "../emoji-picker/emoji-picker.js"; import me from "../input/input.js"; import pe from "../popover/popover.js"; import ge from "../rich-text-editor/rich-text-editor.js"; import he from "../tooltip/tooltip.js"; import be from "../stack/stack.js"; import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as ke, RICH_TEXT_EDITOR_OUTPUT_FORMATS as fe } from "../rich-text-editor/rich-text-editor-constants.js"; const _e = { name: "MeetingPill", components: { NodeViewWrapper: K, DtItemLayout: se, DtIconClose: G, DtButton: j, DtIconVideo: Y }, props: X, emits: ["meeting-pill-close"], methods: { close(t) { this.$parent.$emit("meeting-pill-close", t); } } }, Te = { class: "d-recipe-message-input-meeting-pill__icon" }, Le = { class: "d-recipe-message-input-meeting-pill__close" }; function Se(t, e, i, m, n, o) { const L = l("dt-icon-video"), S = l("dt-icon-close"), x = l("dt-button"), y = l("dt-item-layout"), b = l("node-view-wrapper"); return r(), d(b, { class: "d-recipe-message-input-meeting-pill" }, { default: a(() => [ c(y, { class: "d-recipe-message-input-meeting-pill__layout", unstyled: "" }, { left: a(() => [ u("div", Te, [ c(L, { size: "400" }) ]) ]), right: a(() => [ u("div", Le, [ c(x, { circle: "", "aria-label": t.node.attrs["close-button-aria-label"], size: "xs", importance: "clear", onClick: o.close }, { icon: a(() => [ c(S, { size: "300" }) ]), _: 1 }, 8, ["aria-label", "onClick"]) ]) ]), default: a(() => [ te(" " + T(t.node.attrs.text) + " ", 1) ]), _: 1 }) ]), _: 1 }); } const xe = /* @__PURE__ */ B(_e, [["render", Se]]), ye = H.create({ atom: !0, group: "inline", inline: !0, addNodeView() { return Q(xe); }, addAttributes() { return { text: { default: 'Please pass in "text" attribute' }, "close-button-aria-label": {} }; }, parseHTML() { return [ { tag: "meeting-pill" } ]; }, renderText({ node: t }) { return "/dpm"; }, renderHTML({ HTMLAttributes: t }) { return ["meeting-pill", W(t)]; } }), we = { compatConfig: { MODE: 3 }, name: "DtRecipeMessageInput", components: { DtButton: j, DtEmojiPicker: ue, DtInput: me, DtPopover: pe, DtRecipeMessageInputTopbar: ae, DtRecipeMessageInputLink: re, DtRichTextEditor: ge, DtTooltip: he, DtStack: be, DtIconImage: J, DtIconVerySatisfied: Z, DtIconSatisfied: $, DtIconSend: ee }, mixins: [], inheritAttrs: !1, props: { /** * Displays all the buttons for rich text formatting above the message input, and enables it within the editor. * Rich text formatting for the purposes of this component is defined as: * * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks. * * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false. */ richText: { type: Boolean, default: !0 }, /** * Value of the input. The object format should match TipTap's JSON * document structure: https://tiptap.dev/guide/output#option-1-json */ modelValue: { type: [Object, String], default: "" }, /** * Whether the input is editable */ editable: { type: Boolean, default: !0 }, /** * Descriptive label for the input element */ inputAriaLabel: { type: String, required: !0, default: "" }, /** * Prevents the user from typing any further. Deleting text will still work. */ preventTyping: { type: Boolean, default: !1 }, /** * Additional class name for the input element. Only accepts a String value * because this is passed to the editor via options. For multiple classes, * join them into one string, e.g. "d-p8 d-hmx96" */ inputClass: { type: String, default: "" }, /** * Whether the input should receive focus after the component has been * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number. * - `start` Sets the focus to the beginning of the input * - `end` Sets the focus to the end of the input * - `all` Selects the whole contents of the input * - `Number` Sets the focus to a specific position in the input * - `true` Defaults to `start` * - `false` Disables autofocus * @values true, false, start, end, all, number */ autoFocus: { type: [Boolean, String, Number], default: !1, validator(t) { return typeof t == "string" ? ke.includes(t) : !0; } }, /** * The output format that the editor uses when emitting the "@input" event. * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for * examples. * @values text, json, html */ outputFormat: { type: String, default: "json", validator(t) { return fe.includes(t); } }, /** * Placeholder text */ placeholder: { type: String, default: "" }, /** * Disable Send Button */ disableSend: { type: Boolean, default: !1 }, /** * Content area needs to dynamically adjust height based on the conversation area height. * can be vh|px|rem|em|% */ maxHeight: { type: String, default: "unset" }, // Emoji picker props showEmojiPicker: { type: Boolean, default: !0 }, /** * Props to pass into the emoji picker. */ emojiPickerProps: { type: Object, default: () => ({}), validate(t) { return [ "searchNoResultsLabel", "searchResultsLabel", "searchPlaceholderLabel", "skinSelectorButtonTooltipLabel", "tabSetLabels" ].every((e) => t[e] != null); } }, /** * Emoji button tooltip label */ emojiTooltipMessage: { type: String, default: "Emoji" }, // Aria label for buttons /** * Emoji button aria label */ emojiButtonAriaLabel: { type: String, default: "emoji button" }, /** * Enable character Limit warning */ showCharacterLimit: { type: [Boolean, Object], default: () => ({ count: 1500, warning: 500, message: "" }) }, showImagePicker: { type: [Boolean, Object], default: () => ({ tooltipLabel: "Attach Image", ariaLabel: "image button" }) }, /** * Send button defaults. */ showSend: { type: [Boolean, Object], default: () => ({}) }, /** * Cancel button defaults. */ showCancel: { type: [Boolean, Object], default: () => ({ text: "Cancel" }) }, /** * suggestion object containing the items query function. * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion * * The only required key is the items function which is used to query the contacts for suggestion. * items({ query }) => { return [ContactObject]; } * ContactObject format: * { name: string, avatarSrc: string, id: string } * * When null, it does not add the plugin. */ mentionSuggestion: { type: Object, default: null }, /** * suggestion object containing the items query function. * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion * * The only required key is the items function which is used to query the channels for suggestion. * items({ query }) => { return [ChannelObject]; } * ChannelObject format: * { name: string, id: string, locked: boolean } * * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash. */ channelSuggestion: { type: Object, default: null }, /** * suggestion object containing the items query function. * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion * * The only required key is the items function which is used to query the slash commands for suggestion. * items({ query }) => { return [SlashCommandObject]; } * SlashCommandObject format: * { command: string, description: string, parametersExample?: string } * The "parametersExample" parameter is optional, and describes an example * of the parameters that command can take. * * When null, it does not add the plugin. */ slashCommandSuggestion: { type: Object, default: null }, /** * descriptive text fields for the bold button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ boldButtonOptions: { type: Object, default: () => ({ ariaLabel: "Toggle bold on selected text", tooltipText: "Bold", keyboardShortcutText: "Mod + B" }) }, /** * descriptive text fields for the italic button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ italicButtonOptions: { type: Object, default: () => ({ ariaLabel: "Toggle italic on selected text", tooltipText: "Italic", keyboardShortcutText: "Mod + I" }) }, /** * descriptive text fields for the strikethrough button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ strikeButtonOptions: { type: Object, default: () => ({ ariaLabel: "Toggle strikethrough on selected text", tooltipText: "Strikethrough", keyboardShortcutText: "Mod + Shift + S" }) }, /** * descriptive text fields for the link button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ linkButtonOptions: { type: Object, default: () => ({ ariaLabel: "Create or edit link on selected text", tooltipText: "Link", // TODO: implement mod k keyboardShortcutText: "Mod + K", dialogTitle: "Add a link", textLabel: "Text to display (optional)", linkLabel: "Link", linkPlaceholder: "e.g. https://www.dialpad.com", removeLabel: "Remove", cancelLabel: "Cancel", confirmLabel: "Done", visuallyHiddenCloseText: "Close link dialog" }) }, /** * descriptive text fields for the bullet list button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ bulletListButtonOptions: { type: Object, default: () => ({ ariaLabel: "Toggle bullet list on selected text", tooltipText: "Bullet list", keyboardShortcutText: "Mod + Shift + 8" }) }, /** * descriptive text fields for the ordered list button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ orderedListButtonOptions: { type: Object, default: () => ({ ariaLabel: "Toggle ordered list on selected text", tooltipText: "Ordered list", keyboardShortcutText: "Mod + Shift + 7" }) }, /** * descriptive text fields for the italic button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ blockQuoteButtonOptions: { type: Object, default: () => ({ ariaLabel: "Toggle Blockquote on selected text", tooltipText: "Blockquote", keyboardShortcutText: "Mod + Shift + B" }) }, /** * descriptive text fields for the code button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ codeButtonOptions: { type: Object, default: () => ({ ariaLabel: "Toggle code tag on selected text", tooltipText: "Code", keyboardShortcutText: "Mod + E" }) }, /** * descriptive text fields for the code block button * * object format: * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string } */ codeBlockButtonOptions: { type: Object, default: () => ({ ariaLabel: "Toggle code block on selected text", tooltipText: "Code block", keyboardShortcutText: "Mod + Alt + C" }) } }, emits: [ /** * Fires when send button is clicked * * @event submit * @type {String} */ "submit", /** * Fires when media is selected from image button * * @event select-media * @type {Array} */ "select-media", /** * Fires when media is dropped into the message input * * @event add-media * @type {Array} */ "add-media", /** * Fires when media is pasted into the message input * * @event paste-media * @type {Array} */ "paste-media", /** * Fires when cancel button is pressed (only on edit mode) * * @event cancel * @type {Boolean} */ "cancel", /** * Fires when skin tone is selected from the emoji picker * * @event skin-tone * @type {String} */ "skin-tone", /** * Fires when emoji is selected from the emoji picker * * @event selected-emoji * @type {String} */ "selected-emoji", /** * Fires when a slash command is selected * * @event selected-command * @type {String} */ "selected-command", /** * Fires when meeting pill is closed * * @event meeting-pill-close * @type {String} */ "meeting-pill-close", /** * Event to sync the value with the parent * @event update:modelValue * @type {String|JSON} */ "update:modelValue", /** * Emitted when input changes, returns text content only * @event text-input * @type {String} */ "text-input" ], data() { return { // If an ordered list is nested within an unordered list, we only want to show the currently selected list as // active. This function performs the logic to determine the farthest active node from the root. lastActiveNodes: q, additionalExtensions: [ye], internalInputValue: this.modelValue, // internal input content imagePickerFocus: !1, emojiPickerFocus: !1, emojiPickerOpened: !1, isFocused: !1, linkOptions: { class: "d-link d-c-text d-d-inline-block" }, linkDialogOpen: !1, selectedText: "", text: "", hideLinkBubbleMenu: !1 }; }, computed: { showSendIcon() { return !this.showSend.text; }, inputLength() { return this.text.length; }, displayCharacterLimitWarning() { return !!this.showCharacterLimit && this.showCharacterLimit.count - this.inputLength <= this.showCharacterLimit.warning; }, characterLimitTooltipEnabled() { return this.showCharacterLimit.message && this.showCharacterLimit.count - this.inputLength < 0; }, isSendDisabled() { return this.disableSend || this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count; }, computedCloseButtonProps() { return { ariaLabel: "Close" }; }, emojiPickerHovered() { return this.emojiPickerFocus || this.emojiPickerOpened; }, sendIconSize() { return "300"; } }, watch: { modelValue(t) { this.internalInputValue = t; }, emojiPickerOpened(t) { var e; t || (e = this.$refs.richTextEditor) == null || e.focusEditor(); } }, created() { this.modelValue && this.outputFormat === "text" ? this.internalInputValue = this.modelValue.replace(/\n/g, "<br>") : this.internalInputValue = this.modelValue; }, methods: { removeClassStyleAttrs: z, addClassStyleAttrs: N, linkDialogOpened(t) { var e; this.linkDialogOpen = t, t === !0 ? this.initLinkDialog() : (this.hideLinkBubbleMenu = !1, (e = this.$refs.richTextEditor) == null || e.focusEditor()); }, // eslint-disable-next-line complexity handleTopbarClick(t) { var m; const e = (m = this.$refs.richTextEditor) == null ? void 0 : m.editor, i = { bold: () => e == null ? void 0 : e.chain().focus().toggleBold().run(), italic: () => e == null ? void 0 : e.chain().focus().toggleItalic().run(), strike: () => e == null ? void 0 : e.chain().focus().toggleStrike().run(), bulletList: () => e == null ? void 0 : e.chain().focus().toggleBulletList().run(), orderedList: () => e == null ? void 0 : e.chain().focus().toggleOrderedList().run(), blockquote: () => e == null ? void 0 : e.chain().focus().toggleBlockquote().run(), code: () => e == null ? void 0 : e.chain().focus().toggleCode().run(), codeBlock: () => e == null ? void 0 : e.chain().focus().toggleCodeBlock().run() }; e && i[t] && i[t](); }, // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold isSelectionActive(t) { var e, i, m, n; return ["bulletList", "orderedList"].includes(t) ? this.lastActiveNodes((i = (e = this.$refs.richTextEditor) == null ? void 0 : e.editor) == null ? void 0 : i.state, [{ type: "bulletList" }, { type: "orderedList" }]).includes(t) && this.isFocused : ((n = (m = this.$refs.richTextEditor) == null ? void 0 : m.editor) == null ? void 0 : n.isActive(t)) && this.isFocused; }, initLinkDialog() { var t, e, i; this.$refs.link.setInitialValues(this.selectedText, (i = (e = (t = this.$refs.richTextEditor) == null ? void 0 : t.editor) == null ? void 0 : e.getAttributes("link")) == null ? void 0 : i.href), this.hideLinkBubbleMenu = !0, this.linkDialogOpen = !0; }, removeLink() { var t; (t = this.$refs.richTextEditor) == null || t.removeLink(), this.linkDialogOpen = !1; }, setLink(t, e) { this.$refs.richTextEditor.setLink( e, t, this.linkOptions, ce, de ), this.linkDialogOpen = !1; }, // Mousedown instead of click because it fires before the blur event. onMousedown(t) { U(this.$refs.richTextEditor.$el).querySelector(".tiptap").contains(t.target) || (t.preventDefault(), this.$refs.richTextEditor.focusEditor()); }, onDrop(t) { const e = t.dataTransfer, i = Array.from(e.files); this.$emit("add-media", i); }, onPaste(t) { if (t.clipboardData.files.length) { t.stopPropagation(), t.preventDefault(); const e = [...t.clipboardData.files]; this.$emit("paste-media", e); } }, onSkinTone(t) { this.$emit("skin-tone", t); }, onSelectEmoji(t, e) { t && (t.shift_key || e(), this.$refs.richTextEditor.editor.commands.insertContent({ type: "emoji", attrs: { code: t.shortname } }), this.$emit("selected-emoji", t)); }, onSelectImage() { this.$refs.messageInputImageUpload.$refs.input.click(); }, onImageUpload() { this.$emit( "select-media", this.$refs.messageInputImageUpload.$refs.input.files ); }, toggleEmojiPicker() { this.emojiPickerOpened = !this.emojiPickerOpened; }, onSend() { this.isSendDisabled || this.$emit("submit", this.internalInputValue); }, onCancel() { this.$emit("cancel"); }, onInput(t) { this.$emit("update:modelValue", t); }, onTextInput(t) { this.text = t, this.$emit("text-input", t); } } }, ve = { class: "d-recipe-message-input__bottom-section" }, Oe = { class: "d-recipe-message-input__bottom-section-left" }, Ie = { class: "d-recipe-message-input__bottom-section-right" }, Ce = { class: "d-recipe-message-input__sms-count" }, Be = { key: 0 }; function je(t, e, i, m, n, o) { const L = l("dt-recipe-message-input-link"), S = l("dt-recipe-message-input-topbar"), x = l("dt-rich-text-editor"), y = l("dt-icon-image"), b = l("dt-button"), P = l("dt-input"), D = l("dt-icon-very-satisfied"), E = l("dt-icon-satisfied"), M = l("dt-emoji-picker"), V = l("dt-popover"), O = l("dt-stack"), F = l("dt-tooltip"), A = l("dt-icon-send"), R = I("dt-scrollbar"), w = I("dt-tooltip"); return r(), v("div", _({ "data-qa": "dt-recipe-message-input", role: "presentation", class: "d-recipe-message-input" }, o.addClassStyleAttrs(t.$attrs), { onDragover: e[12] || (e[12] = C(() => { }, ["prevent"])), onDrop: e[13] || (e[13] = C((...s) => o.onDrop && o.onDrop(...s), ["prevent"])), onPaste: e[14] || (e[14] = (...s) => o.onPaste && o.onPaste(...s)), onMousedown: e[15] || (e[15] = (...s) => o.onMousedown && o.onMousedown(...s)) }), [ g(t.$slots, "top"), i.richText ? (r(), d(S, { key: n.selectedText, "bold-button-options": i.boldButtonOptions, "italic-button-options": i.italicButtonOptions, "strike-button-options": i.strikeButtonOptions, "bullet-list-button-options": i.bulletListButtonOptions, "ordered-list-button-options": i.orderedListButtonOptions, "block-quote-button-options": i.blockQuoteButtonOptions, "code-button-options": i.codeButtonOptions, "code-block-button-options": i.codeBlockButtonOptions, "is-selection-active": o.isSelectionActive, onClick: o.handleTopbarClick }, { link: a(() => [ c(L, { ref: "link", open: n.linkDialogOpen, "link-button-options": i.linkButtonOptions, "is-selection-active": o.isSelectionActive, onOpened: o.linkDialogOpened, onSetLink: o.setLink, onRemoveLink: o.removeLink }, null, 8, ["open", "link-button-options", "is-selection-active", "onOpened", "onSetLink", "onRemoveLink"]) ]), _: 1 }, 8, ["bold-button-options", "italic-button-options", "strike-button-options", "bullet-list-button-options", "ordered-list-button-options", "block-quote-button-options", "code-button-options", "code-block-button-options", "is-selection-active", "onClick"])) : h("", !0), f((r(), v("div", { class: "d-recipe-message-input__editor-wrapper", style: ie({ "max-height": i.maxHeight }) }, [ c(x, _({ ref: "richTextEditor", modelValue: n.internalInputValue, "onUpdate:modelValue": e[0] || (e[0] = (s) => n.internalInputValue = s), "allow-blockquote": i.richText, "allow-bold": i.richText, "allow-bullet-list": i.richText, "allow-code": i.richText, "allow-codeblock": i.richText, "allow-italic": i.richText, "allow-strike": i.richText, "allow-underline": i.richText, "paste-rich-text": i.richText, editable: i.editable, "input-aria-label": i.inputAriaLabel, "input-class": i.inputClass, "output-format": i.outputFormat, "auto-focus": i.autoFocus, link: i.richText, placeholder: i.placeholder, "prevent-typing": i.preventTyping, "mention-suggestion": i.mentionSuggestion, "channel-suggestion": i.channelSuggestion, "slash-command-suggestion": i.slashCommandSuggestion, "additional-extensions": n.additionalExtensions, "hide-link-bubble-menu": n.hideLinkBubbleMenu }, o.removeClassStyleAttrs(t.$attrs), { onInput: o.onInput, onTextInput: o.onTextInput, onEnter: o.onSend, onSelected: e[1] || (e[1] = (s) => n.selectedText = s), onEditLink: o.initLinkDialog, onFocus: e[2] || (e[2] = (s) => n.isFocused = !0), onBlur: e[3] || (e[3] = (s) => n.isFocused = !1) }), null, 16, ["modelValue", "allow-blockquote", "allow-bold", "allow-bullet-list", "allow-code", "allow-codeblock", "allow-italic", "allow-strike", "allow-underline", "paste-rich-text", "editable", "input-aria-label", "input-class", "output-format", "auto-focus", "link", "placeholder", "prevent-typing", "mention-suggestion", "channel-suggestion", "slash-command-suggestion", "additional-extensions", "hide-link-bubble-menu", "onInput", "onTextInput", "onEnter", "onEditLink"]) ], 4)), [ [R] ]), g(t.$slots, "middle"), u("section", ve, [ u("div", Oe, [ c(O, { gap: "200", direction: "row" }, { default: a(() => { var s; return [ i.showImagePicker ? f((r(), d(b, { key: 0, "data-qa": "dt-recipe-message-input-image-btn", size: "sm", class: "d-recipe-message-input__button", kind: "muted", importance: "clear", "aria-label": i.showImagePicker.ariaLabel, onClick: o.onSelectImage, onMouseenter: e[4] || (e[4] = (p) => n.imagePickerFocus = !0), onMouseleave: e[5] || (e[5] = (p) => n.imagePickerFocus = !1), onFocus: e[6] || (e[6] = (p) => n.imagePickerFocus = !0), onBlur: e[7] || (e[7] = (p) => n.imagePickerFocus = !1) }, { icon: a(() => [ c(y, { size: "300" }) ]), _: 1 }, 8, ["aria-label", "onClick"])), [ [w, (s = i.showImagePicker) == null ? void 0 : s.tooltipLabel, "top-start"] ]) : h("", !0), c(P, { ref: "messageInputImageUpload", "data-qa": "dt-recipe-message-input-image-input", accept: "image/*, video/*", type: "file", class: "d-recipe-message-input__image-input", multiple: "", hidden: "", onInput: o.onImageUpload }, null, 8, ["onInput"]), i.showEmojiPicker ? (r(), d(V, { key: 1, "open.sync": "emojiPickerOpened", "data-qa": "dt-recipe-message-input-emoji-picker-popover", "initial-focus-element": "#searchInput", padding: "none" }, { anchor: a(({ attrs: p }) => [ f((r(), d(b, _(p, { "data-qa": "dt-recipe-message-input-emoji-picker-btn", size: "sm", class: "d-recipe-message-input__button", kind: "muted", importance: "clear", "aria-label": i.emojiButtonAriaLabel, onClick: o.toggleEmojiPicker, onMouseenter: e[8] || (e[8] = (k) => n.emojiPickerFocus = !0), onMouseleave: e[9] || (e[9] = (k) => n.emojiPickerFocus = !1), onFocus: e[10] || (e[10] = (k) => n.emojiPickerFocus = !0), onBlur: e[11] || (e[11] = (k) => n.emojiPickerFocus = !1) }), { icon: a(() => [ o.emojiPickerHovered ? (r(), d(D, { key: 0, size: "300" })) : (r(), d(E, { key: 1, size: "300" })) ]), _: 2 }, 1040, ["aria-label", "onClick"])), [ [w, i.emojiTooltipMessage] ]) ]), content: a(({ close: p }) => [ c(M, _(i.emojiPickerProps, { onSkinTone: o.onSkinTone, onSelectedEmoji: (k) => o.onSelectEmoji(k, p) }), null, 16, ["onSkinTone", "onSelectedEmoji"]) ]), _: 1 })) : h("", !0), g(t.$slots, "emojiGiphyPicker"), g(t.$slots, "customActionIcons") ]; }), _: 3 }) ]), u("div", Ie, [ c(O, { direction: "row", gap: "300" }, { default: a(() => [ u("div", Ce, [ g(t.$slots, "smsCount") ]), i.showCharacterLimit ? (r(), d(F, { key: 0, class: "d-recipe-message-input__remaining-char-tooltip", placement: "top-end", enabled: o.characterLimitTooltipEnabled, message: i.showCharacterLimit.message, offset: [10, 8] }, { anchor: a(() => [ f(u("p", { class: "d-recipe-message-input__remaining-char", "data-qa": "dt-recipe-message-input-character-limit" }, T(i.showCharacterLimit.count - o.inputLength), 513), [ [oe, o.displayCharacterLimitWarning] ]) ]), _: 1 }, 8, ["enabled", "message"])) : h("", !0), i.showCancel ? (r(), d(b, { key: 1, "data-qa": "dt-recipe-message-input-cancel-button", class: "d-recipe-message-input__button d-recipe-message-input__cancel-button", size: "sm", kind: "muted", importance: "clear", "aria-label": i.showCancel.ariaLabel, onClick: o.onCancel }, { default: a(() => [ u("p", null, T(i.showCancel.text), 1) ]), _: 1 }, 8, ["aria-label", "onClick"])) : h("", !0), g(t.$slots, "sendButton", {}, () => { var s; return [ i.showSend ? f((r(), d(b, { key: 0, "data-qa": "dt-recipe-message-input-send-btn", size: "sm", kind: "default", importance: "primary", class: ne([ "d-recipe-message-input__button d-recipe-message-input__send-button", { "d-recipe-message-input__send-button--disabled": o.isSendDisabled, "d-btn--icon-only": o.showSendIcon } ]), "aria-label": i.showSend.ariaLabel, "aria-disabled": o.isSendDisabled, onClick: o.onSend }, le({ default: a(() => [ i.showSend.text ? (r(), v("p", Be, T(i.showSend.text), 1)) : h("", !0) ]), _: 2 }, [ o.showSendIcon ? { name: "icon", fn: a(() => [ g(t.$slots, "sendIcon", { iconSize: o.sendIconSize }, () => [ c(A, { size: o.sendIconSize }, null, 8, ["size"]) ]) ]), key: "0" } : void 0 ]), 1032, ["class", "aria-label", "aria-disabled", "onClick"])), [ [w, (s = i.showSend) == null ? void 0 : s.tooltipLabel, "top-end"] ]) : h("", !0) ]; }) ]), _: 3 }) ]) ]) ], 16); } const Je = /* @__PURE__ */ B(we, [["render", je]]); export { Je as default }; //# sourceMappingURL=message-input.js.map