@dialpad/dialtone 9.95.0 → 9.97.0
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/css/dialtone-default-theme.css +45 -1
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +45 -1
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +15432 -15432
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/components/hovercard/hovercard.vue.cjs +41 -2
- package/dist/vue2/components/hovercard/hovercard.vue.cjs.map +1 -1
- package/dist/vue2/components/hovercard/hovercard.vue.js +41 -2
- package/dist/vue2/components/hovercard/hovercard.vue.js.map +1 -1
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +2 -2
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.js +2 -2
- package/dist/vue2/components/popover/popover.vue.cjs +36 -60
- package/dist/vue2/components/popover/popover.vue.cjs.map +1 -1
- package/dist/vue2/components/popover/popover.vue.js +36 -60
- package/dist/vue2/components/popover/popover.vue.js.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs +160 -17
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js +161 -18
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.cjs +87 -0
- package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.cjs.map +1 -0
- package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.js +87 -0
- package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.js.map +1 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs +229 -46
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js +229 -46
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.cjs +58 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.cjs.map +1 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.js +58 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.js.map +1 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.cjs +108 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.cjs.map +1 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.js +108 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.js.map +1 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.cjs +106 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.cjs.map +1 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.js +106 -0
- package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.js.map +1 -0
- package/dist/vue2/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/popover/popover.vue.d.ts +380 -2
- package/dist/vue2/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +37 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/last_active_nodes.d.ts +3 -0
- package/dist/vue2/types/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +1 -0
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +183 -60
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +48 -0
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -0
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +38 -0
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -0
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +87 -0
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -0
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/hovercard/hovercard.vue.cjs +55 -22
- package/dist/vue3/components/hovercard/hovercard.vue.cjs.map +1 -1
- package/dist/vue3/components/hovercard/hovercard.vue.js +56 -23
- package/dist/vue3/components/hovercard/hovercard.vue.js.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +2 -2
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.js +2 -2
- package/dist/vue3/components/popover/popover.vue.cjs +40 -64
- package/dist/vue3/components/popover/popover.vue.cjs.map +1 -1
- package/dist/vue3/components/popover/popover.vue.js +40 -64
- package/dist/vue3/components/popover/popover.vue.js.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs +223 -21
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js +225 -23
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs +1 -0
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js +1 -0
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.cjs +87 -0
- package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.cjs.map +1 -0
- package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.js +87 -0
- package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.js.map +1 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs +279 -65
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js +280 -66
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.cjs +81 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.cjs.map +1 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.js +81 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.js.map +1 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.cjs +193 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.cjs.map +1 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.js +193 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.js.map +1 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.cjs +223 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.cjs.map +1 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.js +223 -0
- package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.js.map +1 -0
- package/dist/vue3/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/popover/popover.vue.d.ts +432 -1
- package/dist/vue3/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +42 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/last_active_nodes.d.ts +3 -0
- package/dist/vue3/types/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +1 -0
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +185 -61
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +50 -0
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -0
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +42 -0
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -0
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +89 -0
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -0
- package/package.json +7 -4
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import lastActiveNodes from "./last_active_nodes.js";
|
|
1
2
|
import MeetingPill from "./extensions/meeting_pill/meeting_pill.js";
|
|
2
3
|
import { DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend } from "@dialpad/dialtone-icons/vue2";
|
|
4
|
+
import DtRecipeMessageInputTopbar from "./message_input_topbar.vue.js";
|
|
5
|
+
import DtRecipeMessageInputLink from "./message_input_link.vue.js";
|
|
6
|
+
import { EDITOR_SUPPORTED_LINK_PROTOCOLS, EDITOR_DEFAULT_LINK_PREFIX } from "../editor/editor_constants.js";
|
|
3
7
|
import normalizeComponent from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
8
|
import DtButton from "../../../components/button/button.vue.js";
|
|
5
9
|
import DtEmojiPicker from "../../../components/emoji_picker/emoji_picker.vue.js";
|
|
@@ -16,6 +20,8 @@ const _sfc_main = {
|
|
|
16
20
|
DtEmojiPicker,
|
|
17
21
|
DtInput,
|
|
18
22
|
DtPopover,
|
|
23
|
+
DtRecipeMessageInputTopbar,
|
|
24
|
+
DtRecipeMessageInputLink,
|
|
19
25
|
DtRichTextEditor,
|
|
20
26
|
DtTooltip,
|
|
21
27
|
DtStack,
|
|
@@ -27,6 +33,18 @@ const _sfc_main = {
|
|
|
27
33
|
mixins: [],
|
|
28
34
|
inheritAttrs: false,
|
|
29
35
|
props: {
|
|
36
|
+
/**
|
|
37
|
+
* Displays all the buttons for rich text formatting above the message input, and enables it within the editor.
|
|
38
|
+
* Rich text formatting for the purposes of this component is defined as:
|
|
39
|
+
*
|
|
40
|
+
* bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.
|
|
41
|
+
*
|
|
42
|
+
* If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.
|
|
43
|
+
*/
|
|
44
|
+
richText: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true
|
|
47
|
+
},
|
|
30
48
|
/**
|
|
31
49
|
* Value of the input. The object format should match TipTap's JSON
|
|
32
50
|
* document structure: https://tiptap.dev/guide/output#option-1-json
|
|
@@ -95,18 +113,11 @@ const _sfc_main = {
|
|
|
95
113
|
*/
|
|
96
114
|
outputFormat: {
|
|
97
115
|
type: String,
|
|
98
|
-
default: "
|
|
116
|
+
default: "json",
|
|
99
117
|
validator(outputFormat) {
|
|
100
118
|
return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);
|
|
101
119
|
}
|
|
102
120
|
},
|
|
103
|
-
/**
|
|
104
|
-
* Enables the Link extension and optionally passes configurations to it
|
|
105
|
-
*/
|
|
106
|
-
link: {
|
|
107
|
-
type: [Boolean, Object],
|
|
108
|
-
default: true
|
|
109
|
-
},
|
|
110
121
|
/**
|
|
111
122
|
* Placeholder text
|
|
112
123
|
*/
|
|
@@ -238,53 +249,139 @@ const _sfc_main = {
|
|
|
238
249
|
default: null
|
|
239
250
|
},
|
|
240
251
|
/**
|
|
241
|
-
*
|
|
252
|
+
* descriptive text fields for the bold button
|
|
253
|
+
*
|
|
254
|
+
* object format:
|
|
255
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
242
256
|
*/
|
|
243
|
-
|
|
244
|
-
type:
|
|
245
|
-
default:
|
|
257
|
+
boldButtonOptions: {
|
|
258
|
+
type: Object,
|
|
259
|
+
default: () => ({
|
|
260
|
+
ariaLabel: "Toggle bold on selected text",
|
|
261
|
+
tooltipText: "Bold",
|
|
262
|
+
keyboardShortcutText: "Mod + B"
|
|
263
|
+
})
|
|
246
264
|
},
|
|
247
265
|
/**
|
|
248
|
-
*
|
|
266
|
+
* descriptive text fields for the italic button
|
|
267
|
+
*
|
|
268
|
+
* object format:
|
|
269
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
249
270
|
*/
|
|
250
|
-
|
|
251
|
-
type:
|
|
252
|
-
default:
|
|
271
|
+
italicButtonOptions: {
|
|
272
|
+
type: Object,
|
|
273
|
+
default: () => ({
|
|
274
|
+
ariaLabel: "Toggle italic on selected text",
|
|
275
|
+
tooltipText: "Italic",
|
|
276
|
+
keyboardShortcutText: "Mod + I"
|
|
277
|
+
})
|
|
253
278
|
},
|
|
254
279
|
/**
|
|
255
|
-
*
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
280
|
+
* descriptive text fields for the strikethrough button
|
|
281
|
+
*
|
|
282
|
+
* object format:
|
|
283
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
284
|
+
*/
|
|
285
|
+
strikeButtonOptions: {
|
|
286
|
+
type: Object,
|
|
287
|
+
default: () => ({
|
|
288
|
+
ariaLabel: "Toggle strikethrough on selected text",
|
|
289
|
+
tooltipText: "Strikethrough",
|
|
290
|
+
keyboardShortcutText: "Mod + Shift + S"
|
|
291
|
+
})
|
|
260
292
|
},
|
|
261
293
|
/**
|
|
262
|
-
*
|
|
294
|
+
* descriptive text fields for the link button
|
|
295
|
+
*
|
|
296
|
+
* object format:
|
|
297
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
263
298
|
*/
|
|
264
|
-
|
|
265
|
-
type:
|
|
266
|
-
default:
|
|
299
|
+
linkButtonOptions: {
|
|
300
|
+
type: Object,
|
|
301
|
+
default: () => ({
|
|
302
|
+
ariaLabel: "Create or edit link on selected text",
|
|
303
|
+
tooltipText: "Link",
|
|
304
|
+
// TODO: implement mod k
|
|
305
|
+
keyboardShortcutText: "Mod + K",
|
|
306
|
+
dialogTitle: "Add a link",
|
|
307
|
+
textLabel: "Text to display (optional)",
|
|
308
|
+
linkLabel: "Link",
|
|
309
|
+
linkPlaceholder: "e.g. https://www.dialpad.com",
|
|
310
|
+
removeLabel: "Remove",
|
|
311
|
+
cancelLabel: "Cancel",
|
|
312
|
+
confirmLabel: "Done",
|
|
313
|
+
visuallyHiddenCloseText: "Close link dialog"
|
|
314
|
+
})
|
|
315
|
+
},
|
|
316
|
+
/**
|
|
317
|
+
* descriptive text fields for the bullet list button
|
|
318
|
+
*
|
|
319
|
+
* object format:
|
|
320
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
321
|
+
*/
|
|
322
|
+
bulletListButtonOptions: {
|
|
323
|
+
type: Object,
|
|
324
|
+
default: () => ({
|
|
325
|
+
ariaLabel: "Toggle bullet list on selected text",
|
|
326
|
+
tooltipText: "Bullet list",
|
|
327
|
+
keyboardShortcutText: "Mod + Shift + 8"
|
|
328
|
+
})
|
|
267
329
|
},
|
|
268
330
|
/**
|
|
269
|
-
*
|
|
331
|
+
* descriptive text fields for the ordered list button
|
|
332
|
+
*
|
|
333
|
+
* object format:
|
|
334
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
270
335
|
*/
|
|
271
|
-
|
|
272
|
-
type:
|
|
273
|
-
default:
|
|
336
|
+
orderedListButtonOptions: {
|
|
337
|
+
type: Object,
|
|
338
|
+
default: () => ({
|
|
339
|
+
ariaLabel: "Toggle ordered list on selected text",
|
|
340
|
+
tooltipText: "Ordered list",
|
|
341
|
+
keyboardShortcutText: "Mod + Shift + 7"
|
|
342
|
+
})
|
|
274
343
|
},
|
|
275
344
|
/**
|
|
276
|
-
*
|
|
345
|
+
* descriptive text fields for the italic button
|
|
346
|
+
*
|
|
347
|
+
* object format:
|
|
348
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
277
349
|
*/
|
|
278
|
-
|
|
279
|
-
type:
|
|
280
|
-
default:
|
|
350
|
+
blockQuoteButtonOptions: {
|
|
351
|
+
type: Object,
|
|
352
|
+
default: () => ({
|
|
353
|
+
ariaLabel: "Toggle Blockquote on selected text",
|
|
354
|
+
tooltipText: "Blockquote",
|
|
355
|
+
keyboardShortcutText: "Mod + Shift + B"
|
|
356
|
+
})
|
|
281
357
|
},
|
|
282
358
|
/**
|
|
283
|
-
*
|
|
359
|
+
* descriptive text fields for the code button
|
|
360
|
+
*
|
|
361
|
+
* object format:
|
|
362
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
284
363
|
*/
|
|
285
|
-
|
|
286
|
-
type:
|
|
287
|
-
default:
|
|
364
|
+
codeButtonOptions: {
|
|
365
|
+
type: Object,
|
|
366
|
+
default: () => ({
|
|
367
|
+
ariaLabel: "Toggle code tag on selected text",
|
|
368
|
+
tooltipText: "Code",
|
|
369
|
+
keyboardShortcutText: "Mod + E"
|
|
370
|
+
})
|
|
371
|
+
},
|
|
372
|
+
/**
|
|
373
|
+
* descriptive text fields for the code block button
|
|
374
|
+
*
|
|
375
|
+
* object format:
|
|
376
|
+
* { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
|
|
377
|
+
*/
|
|
378
|
+
codeBlockButtonOptions: {
|
|
379
|
+
type: Object,
|
|
380
|
+
default: () => ({
|
|
381
|
+
ariaLabel: "Toggle code block on selected text",
|
|
382
|
+
tooltipText: "Code block",
|
|
383
|
+
keyboardShortcutText: "Mod + Alt + C"
|
|
384
|
+
})
|
|
288
385
|
}
|
|
289
386
|
},
|
|
290
387
|
emits: [
|
|
@@ -356,16 +453,33 @@ const _sfc_main = {
|
|
|
356
453
|
* @event update:value
|
|
357
454
|
* @type {String|JSON}
|
|
358
455
|
*/
|
|
359
|
-
"update:value"
|
|
456
|
+
"update:value",
|
|
457
|
+
/**
|
|
458
|
+
* Emitted when input changes, returns text content only
|
|
459
|
+
* @event text-input
|
|
460
|
+
* @type {String}
|
|
461
|
+
*/
|
|
462
|
+
"text-input"
|
|
360
463
|
],
|
|
361
464
|
data() {
|
|
362
465
|
return {
|
|
466
|
+
// If an ordered list is nested within an unordered list, we only want to show the currently selected list as
|
|
467
|
+
// active. This function performs the logic to determine the farthest active node from the root.
|
|
468
|
+
lastActiveNodes,
|
|
363
469
|
additionalExtensions: [MeetingPill],
|
|
364
470
|
internalInputValue: this.value,
|
|
365
471
|
// internal input content
|
|
366
472
|
imagePickerFocus: false,
|
|
367
473
|
emojiPickerFocus: false,
|
|
368
|
-
emojiPickerOpened: false
|
|
474
|
+
emojiPickerOpened: false,
|
|
475
|
+
isFocused: false,
|
|
476
|
+
linkOptions: {
|
|
477
|
+
class: "d-link d-c-text d-d-inline-block"
|
|
478
|
+
},
|
|
479
|
+
linkDialogOpen: false,
|
|
480
|
+
selectedText: "",
|
|
481
|
+
text: "",
|
|
482
|
+
hideLinkBubbleMenu: false
|
|
369
483
|
};
|
|
370
484
|
},
|
|
371
485
|
computed: {
|
|
@@ -373,7 +487,7 @@ const _sfc_main = {
|
|
|
373
487
|
return !this.showSend.text;
|
|
374
488
|
},
|
|
375
489
|
inputLength() {
|
|
376
|
-
return this.
|
|
490
|
+
return this.text.length;
|
|
377
491
|
},
|
|
378
492
|
displayCharacterLimitWarning() {
|
|
379
493
|
return Boolean(this.showCharacterLimit) && this.showCharacterLimit.count - this.inputLength <= this.showCharacterLimit.warning;
|
|
@@ -410,9 +524,68 @@ const _sfc_main = {
|
|
|
410
524
|
created() {
|
|
411
525
|
if (this.value && this.outputFormat === "text") {
|
|
412
526
|
this.internalInputValue = this.value.replace(/\n/g, "<br>");
|
|
527
|
+
} else {
|
|
528
|
+
this.internalInputValue = this.value;
|
|
413
529
|
}
|
|
414
530
|
},
|
|
415
531
|
methods: {
|
|
532
|
+
linkDialogOpened(value) {
|
|
533
|
+
var _a;
|
|
534
|
+
this.linkDialogOpen = value;
|
|
535
|
+
if (value === true) {
|
|
536
|
+
this.initLinkDialog();
|
|
537
|
+
} else {
|
|
538
|
+
this.hideLinkBubbleMenu = false;
|
|
539
|
+
(_a = this.$refs.richTextEditor) == null ? void 0 : _a.focusEditor();
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
// eslint-disable-next-line complexity
|
|
543
|
+
handleTopbarClick(type) {
|
|
544
|
+
var _a;
|
|
545
|
+
const editor = (_a = this.$refs.richTextEditor) == null ? void 0 : _a.editor;
|
|
546
|
+
const typeToCommandMap = {
|
|
547
|
+
bold: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run(),
|
|
548
|
+
italic: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run(),
|
|
549
|
+
strike: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run(),
|
|
550
|
+
bulletList: () => editor == null ? void 0 : editor.chain().focus().toggleBulletList().run(),
|
|
551
|
+
orderedList: () => editor == null ? void 0 : editor.chain().focus().toggleOrderedList().run(),
|
|
552
|
+
blockquote: () => editor == null ? void 0 : editor.chain().focus().toggleBlockquote().run(),
|
|
553
|
+
code: () => editor == null ? void 0 : editor.chain().focus().toggleCode().run(),
|
|
554
|
+
codeBlock: () => editor == null ? void 0 : editor.chain().focus().toggleCodeBlock().run()
|
|
555
|
+
};
|
|
556
|
+
if (editor && typeToCommandMap[type]) {
|
|
557
|
+
typeToCommandMap[type]();
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
// Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold
|
|
561
|
+
isSelectionActive(type) {
|
|
562
|
+
var _a, _b, _c, _d;
|
|
563
|
+
if (["bulletList", "orderedList"].includes(type)) {
|
|
564
|
+
return this.lastActiveNodes((_b = (_a = this.$refs.richTextEditor) == null ? void 0 : _a.editor) == null ? void 0 : _b.state, [{ type: "bulletList" }, { type: "orderedList" }]).includes(type) && this.isFocused;
|
|
565
|
+
}
|
|
566
|
+
return ((_d = (_c = this.$refs.richTextEditor) == null ? void 0 : _c.editor) == null ? void 0 : _d.isActive(type)) && this.isFocused;
|
|
567
|
+
},
|
|
568
|
+
initLinkDialog() {
|
|
569
|
+
var _a, _b, _c;
|
|
570
|
+
this.$refs.link.setInitialValues(this.selectedText, (_c = (_b = (_a = this.$refs.richTextEditor) == null ? void 0 : _a.editor) == null ? void 0 : _b.getAttributes("link")) == null ? void 0 : _c.href);
|
|
571
|
+
this.hideLinkBubbleMenu = true;
|
|
572
|
+
this.linkDialogOpen = true;
|
|
573
|
+
},
|
|
574
|
+
removeLink() {
|
|
575
|
+
var _a;
|
|
576
|
+
(_a = this.$refs.richTextEditor) == null ? void 0 : _a.removeLink();
|
|
577
|
+
this.linkDialogOpen = false;
|
|
578
|
+
},
|
|
579
|
+
setLink(linkText, linkInput) {
|
|
580
|
+
this.$refs.richTextEditor.setLink(
|
|
581
|
+
linkInput,
|
|
582
|
+
linkText,
|
|
583
|
+
this.linkOptions,
|
|
584
|
+
EDITOR_SUPPORTED_LINK_PROTOCOLS,
|
|
585
|
+
EDITOR_DEFAULT_LINK_PREFIX
|
|
586
|
+
);
|
|
587
|
+
this.linkDialogOpen = false;
|
|
588
|
+
},
|
|
416
589
|
// Mousedown instead of click because it fires before the blur event.
|
|
417
590
|
onMousedown(e) {
|
|
418
591
|
const isWithinInput = this.$refs.richTextEditor.$el.querySelector(".tiptap").contains(e.target);
|
|
@@ -472,18 +645,30 @@ const _sfc_main = {
|
|
|
472
645
|
},
|
|
473
646
|
onInput(event) {
|
|
474
647
|
this.$emit("update:value", event);
|
|
648
|
+
},
|
|
649
|
+
onTextInput(event) {
|
|
650
|
+
this.text = event;
|
|
651
|
+
this.$emit("text-input", event);
|
|
475
652
|
}
|
|
476
653
|
}
|
|
477
654
|
};
|
|
478
655
|
var _sfc_render = function render() {
|
|
479
656
|
var _a;
|
|
480
657
|
var _vm = this, _c = _vm._self._c;
|
|
481
|
-
return _c("div", {
|
|
658
|
+
return _c("div", { staticClass: "d-recipe-message-input", attrs: { "data-qa": "dt-recipe-message-input", "role": "presentation" }, on: { "dragover": function($event) {
|
|
482
659
|
$event.preventDefault();
|
|
483
660
|
}, "drop": function($event) {
|
|
484
661
|
$event.preventDefault();
|
|
485
662
|
return _vm.onDrop.apply(null, arguments);
|
|
486
|
-
}, "paste": _vm.onPaste, "mousedown": _vm.onMousedown } }, [_vm._t("top"), _c("
|
|
663
|
+
}, "paste": _vm.onPaste, "mousedown": _vm.onMousedown } }, [_vm._t("top"), _vm.richText ? _c("dt-recipe-message-input-topbar", { key: _vm.selectedText, attrs: { "bold-button-options": _vm.boldButtonOptions, "italic-button-options": _vm.italicButtonOptions, "strike-button-options": _vm.strikeButtonOptions, "bullet-list-button-options": _vm.bulletListButtonOptions, "ordered-list-button-options": _vm.orderedListButtonOptions, "block-quote-button-options": _vm.blockQuoteButtonOptions, "code-button-options": _vm.codeButtonOptions, "code-block-button-options": _vm.codeBlockButtonOptions, "is-selection-active": _vm.isSelectionActive }, on: { "click": _vm.handleTopbarClick }, scopedSlots: _vm._u([{ key: "link", fn: function() {
|
|
664
|
+
return [_c("dt-recipe-message-input-link", { ref: "link", attrs: { "open": _vm.linkDialogOpen, "link-button-options": _vm.linkButtonOptions, "is-selection-active": _vm.isSelectionActive }, on: { "opened": _vm.linkDialogOpened, "set-link": _vm.setLink, "remove-link": _vm.removeLink } })];
|
|
665
|
+
}, proxy: true }], null, false, 1527282285) }) : _vm._e(), _c("div", { directives: [{ name: "dt-scrollbar", rawName: "v-dt-scrollbar" }], staticClass: "d-recipe-message-input__editor-wrapper", style: { "max-height": _vm.maxHeight } }, [_c("dt-rich-text-editor", _vm._g(_vm._b({ ref: "richTextEditor", attrs: { "editable": _vm.editable, "input-aria-label": _vm.inputAriaLabel, "input-class": _vm.inputClass, "output-format": _vm.outputFormat, "auto-focus": _vm.autoFocus, "link": _vm.richText, "placeholder": _vm.placeholder, "prevent-typing": _vm.preventTyping, "mention-suggestion": _vm.mentionSuggestion, "channel-suggestion": _vm.channelSuggestion, "slash-command-suggestion": _vm.slashCommandSuggestion, "allow-blockquote": _vm.richText, "allow-bold": _vm.richText, "allow-bullet-list": _vm.richText, "allow-code": _vm.richText, "allow-codeblock": _vm.richText, "allow-italic": _vm.richText, "allow-strike": _vm.richText, "allow-underline": _vm.richText, "additional-extensions": _vm.additionalExtensions, "hide-link-bubble-menu": _vm.hideLinkBubbleMenu }, on: { "input": _vm.onInput, "text-input": _vm.onTextInput, "enter": _vm.onSend, "selected": function($event) {
|
|
666
|
+
_vm.selectedText = $event;
|
|
667
|
+
}, "edit-link": _vm.initLinkDialog, "focus": function($event) {
|
|
668
|
+
_vm.isFocused = true;
|
|
669
|
+
}, "blur": function($event) {
|
|
670
|
+
_vm.isFocused = false;
|
|
671
|
+
} }, model: { value: _vm.internalInputValue, callback: function($$v) {
|
|
487
672
|
_vm.internalInputValue = $$v;
|
|
488
673
|
}, expression: "internalInputValue" } }, "dt-rich-text-editor", _vm.$attrs, false), _vm.$listeners))], 1), _vm._t("middle"), _c("section", { staticClass: "d-recipe-message-input__bottom-section" }, [_c("div", { staticClass: "d-recipe-message-input__bottom-section-left" }, [_c("dt-stack", { attrs: { "direction": "row", "gap": "200" } }, [_vm.showImagePicker ? _c("dt-button", { directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip:top-start", value: (_a = _vm.showImagePicker) == null ? void 0 : _a.tooltipLabel, expression: "showImagePicker?.tooltipLabel", arg: "top-start" }], staticClass: "d-recipe-message-input__button", attrs: { "data-qa": "dt-recipe-message-input-image-btn", "size": "sm", "kind": "muted", "importance": "clear", "aria-label": _vm.showImagePicker.ariaLabel }, on: { "click": _vm.onSelectImage, "mouseenter": function($event) {
|
|
489
674
|
_vm.imagePickerFocus = true;
|
|
@@ -495,7 +680,7 @@ var _sfc_render = function render() {
|
|
|
495
680
|
_vm.imagePickerFocus = false;
|
|
496
681
|
} }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
497
682
|
return [_c("dt-icon-image", { attrs: { "size": "300" } })];
|
|
498
|
-
}, proxy: true }], null, false, 4195307205) }) : _vm._e(), _c("dt-input", { ref: "messageInputImageUpload", staticClass: "d-recipe-message-input__image-input", attrs: { "data-qa": "dt-recipe-message-input-image-input", "accept": "image/*, video/*", "type": "file", "multiple": "", "hidden": "" }, on: { "input": _vm.onImageUpload } }), _vm.showEmojiPicker ? _c("dt-popover", { attrs: { "data-qa": "dt-recipe-message-input-emoji-picker-popover", "initial-focus-element": "#searchInput", "padding": "none" }, scopedSlots: _vm._u([{ key: "anchor", fn: function({ attrs }) {
|
|
683
|
+
}, proxy: true }], null, false, 4195307205) }) : _vm._e(), _c("dt-input", { ref: "messageInputImageUpload", staticClass: "d-recipe-message-input__image-input", attrs: { "data-qa": "dt-recipe-message-input-image-input", "accept": "image/*, video/*", "type": "file", "multiple": "", "hidden": "" }, on: { "input": _vm.onImageUpload } }), _vm.showEmojiPicker ? _c("dt-popover", { attrs: { "open.sync": "emojiPickerOpened", "data-qa": "dt-recipe-message-input-emoji-picker-popover", "initial-focus-element": "#searchInput", "padding": "none" }, scopedSlots: _vm._u([{ key: "anchor", fn: function({ attrs }) {
|
|
499
684
|
return [_c("dt-button", _vm._b({ directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip", value: _vm.emojiTooltipMessage, expression: "emojiTooltipMessage" }], staticClass: "d-recipe-message-input__button", attrs: { "data-qa": "dt-recipe-message-input-emoji-picker-btn", "size": "sm", "kind": "muted", "importance": "clear", "aria-label": _vm.emojiButtonAriaLabel }, on: { "click": _vm.toggleEmojiPicker, "mouseenter": function($event) {
|
|
500
685
|
_vm.emojiPickerFocus = true;
|
|
501
686
|
}, "mouseleave": function($event) {
|
|
@@ -509,9 +694,7 @@ var _sfc_render = function render() {
|
|
|
509
694
|
}, proxy: true }], null, true) }, "dt-button", attrs, false))];
|
|
510
695
|
} }, { key: "content", fn: function({ close }) {
|
|
511
696
|
return [_c("dt-emoji-picker", _vm._b({ on: { "skin-tone": _vm.onSkinTone, "selected-emoji": (emoji) => _vm.onSelectEmoji(emoji, close) } }, "dt-emoji-picker", _vm.emojiPickerProps, false))];
|
|
512
|
-
} }], null, false, 3974835042),
|
|
513
|
-
_vm.emojiPickerOpened = $$v;
|
|
514
|
-
}, expression: "emojiPickerOpened" } }) : _vm._e(), _vm._t("emojiGiphyPicker")], 2)], 1), _c("div", { staticClass: "d-recipe-message-input__bottom-section-right" }, [_c("dt-stack", { attrs: { "direction": "row", "gap": "300" } }, [_c("div", { staticClass: "d-recipe-message-input__sms-count" }, [_vm._t("smsCount")], 2), Boolean(_vm.showCharacterLimit) ? _c("dt-tooltip", { staticClass: "d-recipe-message-input__remaining-char-tooltip", attrs: { "placement": "top-end", "enabled": _vm.characterLimitTooltipEnabled, "message": _vm.showCharacterLimit.message, "offset": [10, 8] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
697
|
+
} }], null, false, 3974835042) }) : _vm._e(), _vm._t("emojiGiphyPicker")], 2)], 1), _c("div", { staticClass: "d-recipe-message-input__bottom-section-right" }, [_c("dt-stack", { attrs: { "direction": "row", "gap": "300" } }, [_c("div", { staticClass: "d-recipe-message-input__sms-count" }, [_vm._t("smsCount")], 2), Boolean(_vm.showCharacterLimit) ? _c("dt-tooltip", { staticClass: "d-recipe-message-input__remaining-char-tooltip", attrs: { "placement": "top-end", "enabled": _vm.characterLimitTooltipEnabled, "message": _vm.showCharacterLimit.message, "offset": [10, 8] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
515
698
|
return [_c("p", { directives: [{ name: "show", rawName: "v-show", value: _vm.displayCharacterLimitWarning, expression: "displayCharacterLimitWarning" }], staticClass: "d-recipe-message-input__remaining-char", attrs: { "data-qa": "dt-recipe-message-input-character-limit" } }, [_vm._v(" " + _vm._s(_vm.showCharacterLimit.count - _vm.inputLength) + " ")])];
|
|
516
699
|
}, proxy: true }], null, false, 1021505058) }) : _vm._e(), _vm.showCancel ? _c("dt-button", { staticClass: "d-recipe-message-input__button d-recipe-message-input__cancel-button", attrs: { "data-qa": "dt-recipe-message-input-cancel-button", "size": "sm", "kind": "muted", "importance": "clear", "aria-label": _vm.showCancel.ariaLabel }, on: { "click": _vm.onCancel } }, [_c("p", [_vm._v(_vm._s(_vm.showCancel.text))])]) : _vm._e(), _vm._t("sendButton", function() {
|
|
517
700
|
var _a2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_input.vue.js","sources":["../../../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <div\n data-qa=\"dt-recipe-message-input\"\n role=\"presentation\"\n :class=\"['d-recipe-message-input']\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"d-recipe-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"link\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :allow-blockquote=\"allowBlockquote\"\n :allow-bold=\"allowBold\"\n :allow-bullet-list=\"allowBulletList\"\n :allow-codeblock=\"allowCodeblock\"\n :allow-italic=\"allowItalic\"\n :allow-strike=\"allowStrike\"\n :allow-underline=\"allowUnderline\"\n :additional-extensions=\"additionalExtensions\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n @enter=\"onSend\"\n v-on=\"$listeners\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-recipe-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"d-recipe-message-input__bottom-section-left\">\n <dt-stack\n direction=\"row\"\n gap=\"200\"\n >\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"showImagePicker?.tooltipLabel\"\n data-qa=\"dt-recipe-message-input-image-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showImagePicker.ariaLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon-image size=\"300\" />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-recipe-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-recipe-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n v-model:open=\"emojiPickerOpened\"\n data-qa=\"dt-recipe-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiTooltipMessage\"\n v-bind=\"attrs\"\n data-qa=\"dt-recipe-message-input-emoji-picker-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"emojiButtonAriaLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon-very-satisfied\n v-if=\"emojiPickerHovered\"\n size=\"300\"\n />\n <dt-icon-satisfied\n v-else\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template #content=\"{ close }\">\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => onSelectEmoji(emoji, close)\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n </dt-stack>\n </div>\n <!-- Right content -->\n <div class=\"d-recipe-message-input__bottom-section-right\">\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n >\n <!-- @slot Slot for sms count -->\n <div class=\"d-recipe-message-input__sms-count\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"d-recipe-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"d-recipe-message-input__remaining-char\"\n data-qa=\"dt-recipe-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n data-qa=\"dt-recipe-message-input-cancel-button\"\n class=\"d-recipe-message-input__button d-recipe-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showCancel.ariaLabel\"\n @click=\"onCancel\"\n >\n <p>{{ showCancel.text }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"showSend?.tooltipLabel\"\n data-qa=\"dt-recipe-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n 'd-recipe-message-input__button d-recipe-message-input__send-button',\n {\n 'd-recipe-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--icon-only': showSendIcon,\n },\n ]\"\n :aria-label=\"showSend.ariaLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSendIcon\"\n #icon\n >\n <!-- @slot Slot for send button icon -->\n <slot\n name=\"sendIcon\"\n :icon-size=\"sendIconSize\"\n >\n <dt-icon-send\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </dt-stack>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport MeetingPill from './extensions/meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport { DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend } from '@dialpad/dialtone-icons/vue2';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtInput,\n DtPopover,\n DtRichTextEditor,\n DtTooltip,\n DtStack,\n DtIconImage,\n DtIconVerySatisfied,\n DtIconSatisfied,\n DtIconSend,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'text',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Enables the Link extension and optionally passes configurations to it\n */\n link: {\n type: [Boolean, Object],\n default: true,\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n validate (emojiPickerProps) {\n return [\n 'searchNoResultsLabel',\n 'searchResultsLabel',\n 'searchPlaceholderLabel',\n 'skinSelectorButtonTooltipLabel',\n 'tabSetLabels',\n ].every(prop => emojiPickerProps[prop] != null);\n },\n },\n\n /**\n * Emoji button tooltip label\n */\n emojiTooltipMessage: {\n type: String,\n default: 'Emoji',\n },\n\n // Aria label for buttons\n /**\n * Emoji button aria label\n */\n emojiButtonAriaLabel: {\n type: String,\n default: 'emoji button',\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({ tooltipLabel: 'Attach Image', ariaLabel: 'image button' }),\n },\n\n /**\n * Send button defaults.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * Cancel button defaults.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({ text: 'Cancel' }),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n ],\n\n data () {\n return {\n additionalExtensions: [MeetingPill],\n internalInputValue: this.value, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n };\n },\n\n computed: {\n showSendIcon () {\n return !this.showSend.text;\n },\n\n inputLength () {\n return this.internalInputValue.length;\n },\n\n displayCharacterLimitWarning () {\n return Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\n },\n\n computedCloseButtonProps () {\n return {\n ariaLabel: 'Close',\n };\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n\n sendIconSize () {\n return '300';\n },\n },\n\n watch: {\n value (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n }\n },\n\n methods: {\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = this.$refs.richTextEditor.$el.querySelector('.tiptap').contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji, close) {\n if (!emoji) {\n return;\n }\n\n if (!emoji.shift_key) {\n close();\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:value', event);\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;AAkPA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,QAAA,CAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA,WAAA;AAAA,MACA,MAAA,CAAA,SAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA,WAAA;AACA,YAAA,OAAA,cAAA,UAAA;AACA,iBAAA,iCAAA,SAAA,SAAA;AAAA,QACA;AACA,eAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,cAAA;AAAA,MAC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;AACA,WAAA,MAAA,gBAAA,KAAA,MAAA,wBAAA,MAAA,MAAA,KAAA;AAAA,IACA;AAAA,IAEA,oBAAA;AACA,WAAA,oBAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,UAAA,KAAA,gBAAA;AACA;AAAA,MACA;AACA,WAAA,MAAA,UAAA,KAAA,kBAAA;AAAA,IACA;AAAA,IAEA,WAAA;AACA,WAAA,MAAA,QAAA;AAAA,IACA;AAAA,IAEA,QAAA,OAAA;AACA,WAAA,MAAA,gBAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"message_input.vue.js","sources":["../../../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <div\n data-qa=\"dt-recipe-message-input\"\n role=\"presentation\"\n class=\"d-recipe-message-input\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n\n <!-- set key to selectedText to force update. otherwise this component may not reflect the active selection -->\n <dt-recipe-message-input-topbar\n v-if=\"richText\"\n :key=\"selectedText\"\n :bold-button-options=\"boldButtonOptions\"\n :italic-button-options=\"italicButtonOptions\"\n :strike-button-options=\"strikeButtonOptions\"\n :bullet-list-button-options=\"bulletListButtonOptions\"\n :ordered-list-button-options=\"orderedListButtonOptions\"\n :block-quote-button-options=\"blockQuoteButtonOptions\"\n :code-button-options=\"codeButtonOptions\"\n :code-block-button-options=\"codeBlockButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @click=\"handleTopbarClick\"\n >\n <template #link>\n <dt-recipe-message-input-link\n ref=\"link\"\n :open=\"linkDialogOpen\"\n :link-button-options=\"linkButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @opened=\"linkDialogOpened\"\n @set-link=\"setLink\"\n @remove-link=\"removeLink\"\n />\n </template>\n </dt-recipe-message-input-topbar>\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"d-recipe-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"richText\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :allow-blockquote=\"richText\"\n :allow-bold=\"richText\"\n :allow-bullet-list=\"richText\"\n :allow-code=\"richText\"\n :allow-codeblock=\"richText\"\n :allow-italic=\"richText\"\n :allow-strike=\"richText\"\n :allow-underline=\"richText\"\n :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\n @enter=\"onSend\"\n @selected=\"selectedText = $event\"\n @edit-link=\"initLinkDialog\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n v-on=\"$listeners\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-recipe-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"d-recipe-message-input__bottom-section-left\">\n <dt-stack\n direction=\"row\"\n gap=\"200\"\n >\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"showImagePicker?.tooltipLabel\"\n data-qa=\"dt-recipe-message-input-image-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showImagePicker.ariaLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon-image size=\"300\" />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-recipe-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-recipe-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n open.sync=\"emojiPickerOpened\"\n data-qa=\"dt-recipe-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiTooltipMessage\"\n v-bind=\"attrs\"\n data-qa=\"dt-recipe-message-input-emoji-picker-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"emojiButtonAriaLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon-very-satisfied\n v-if=\"emojiPickerHovered\"\n size=\"300\"\n />\n <dt-icon-satisfied\n v-else\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template #content=\"{ close }\">\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => onSelectEmoji(emoji, close)\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n </dt-stack>\n </div>\n <!-- Right content -->\n <div class=\"d-recipe-message-input__bottom-section-right\">\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n >\n <!-- @slot Slot for sms count -->\n <div class=\"d-recipe-message-input__sms-count\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"d-recipe-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"d-recipe-message-input__remaining-char\"\n data-qa=\"dt-recipe-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n data-qa=\"dt-recipe-message-input-cancel-button\"\n class=\"d-recipe-message-input__button d-recipe-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showCancel.ariaLabel\"\n @click=\"onCancel\"\n >\n <p>{{ showCancel.text }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"showSend?.tooltipLabel\"\n data-qa=\"dt-recipe-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n 'd-recipe-message-input__button d-recipe-message-input__send-button',\n {\n 'd-recipe-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--icon-only': showSendIcon,\n },\n ]\"\n :aria-label=\"showSend.ariaLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSendIcon\"\n #icon\n >\n <!-- @slot Slot for send button icon -->\n <slot\n name=\"sendIcon\"\n :icon-size=\"sendIconSize\"\n >\n <dt-icon-send\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </dt-stack>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport lastActiveNodes from './last_active_nodes';\nimport MeetingPill from './extensions/meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport {\n DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend,\n} from '@dialpad/dialtone-icons/vue2';\nimport DtRecipeMessageInputTopbar from './message_input_topbar.vue';\nimport DtRecipeMessageInputLink from './message_input_link.vue';\n\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from '../editor/editor_constants.js';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtInput,\n DtPopover,\n DtRecipeMessageInputTopbar,\n DtRecipeMessageInputLink,\n DtRichTextEditor,\n DtTooltip,\n DtStack,\n DtIconImage,\n DtIconVerySatisfied,\n DtIconSatisfied,\n DtIconSend,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Displays all the buttons for rich text formatting above the message input, and enables it within the editor.\n * Rich text formatting for the purposes of this component is defined as:\n *\n * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.\n *\n * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.\n */\n richText: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'json',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n validate (emojiPickerProps) {\n return [\n 'searchNoResultsLabel',\n 'searchResultsLabel',\n 'searchPlaceholderLabel',\n 'skinSelectorButtonTooltipLabel',\n 'tabSetLabels',\n ].every(prop => emojiPickerProps[prop] != null);\n },\n },\n\n /**\n * Emoji button tooltip label\n */\n emojiTooltipMessage: {\n type: String,\n default: 'Emoji',\n },\n\n // Aria label for buttons\n /**\n * Emoji button aria label\n */\n emojiButtonAriaLabel: {\n type: String,\n default: 'emoji button',\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({ tooltipLabel: 'Attach Image', ariaLabel: 'image button' }),\n },\n\n /**\n * Send button defaults.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * Cancel button defaults.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({ text: 'Cancel' }),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * descriptive text fields for the bold button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n boldButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle bold on selected text',\n tooltipText: 'Bold',\n keyboardShortcutText: 'Mod + B',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n italicButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle italic on selected text',\n tooltipText: 'Italic',\n keyboardShortcutText: 'Mod + I',\n }),\n },\n\n /**\n * descriptive text fields for the strikethrough button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n strikeButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle strikethrough on selected text',\n tooltipText: 'Strikethrough',\n keyboardShortcutText: 'Mod + Shift + S',\n }),\n },\n\n /**\n * descriptive text fields for the link button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n linkButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Create or edit link on selected text',\n tooltipText: 'Link',\n // TODO: implement mod k\n keyboardShortcutText: 'Mod + K',\n dialogTitle: 'Add a link',\n textLabel: 'Text to display (optional)',\n linkLabel: 'Link',\n linkPlaceholder: 'e.g. https://www.dialpad.com',\n removeLabel: 'Remove',\n cancelLabel: 'Cancel',\n confirmLabel: 'Done',\n visuallyHiddenCloseText: 'Close link dialog',\n }),\n },\n\n /**\n * descriptive text fields for the bullet list button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n bulletListButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle bullet list on selected text',\n tooltipText: 'Bullet list',\n keyboardShortcutText: 'Mod + Shift + 8',\n }),\n },\n\n /**\n * descriptive text fields for the ordered list button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n orderedListButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle ordered list on selected text',\n tooltipText: 'Ordered list',\n keyboardShortcutText: 'Mod + Shift + 7',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n blockQuoteButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle Blockquote on selected text',\n tooltipText: 'Blockquote',\n keyboardShortcutText: 'Mod + Shift + B',\n }),\n },\n\n /**\n * descriptive text fields for the code button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n codeButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle code tag on selected text',\n tooltipText: 'Code',\n keyboardShortcutText: 'Mod + E',\n }),\n },\n\n /**\n * descriptive text fields for the code block button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n codeBlockButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle code block on selected text',\n tooltipText: 'Code block',\n keyboardShortcutText: 'Mod + Alt + C',\n }),\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Emitted when input changes, returns text content only\n * @event text-input\n * @type {String}\n */\n 'text-input',\n ],\n\n data () {\n return {\n // If an ordered list is nested within an unordered list, we only want to show the currently selected list as\n // active. This function performs the logic to determine the farthest active node from the root.\n lastActiveNodes,\n additionalExtensions: [MeetingPill],\n internalInputValue: this.value, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n isFocused: false,\n linkOptions: {\n class: 'd-link d-c-text d-d-inline-block',\n },\n\n linkDialogOpen: false,\n selectedText: '',\n text: '',\n hideLinkBubbleMenu: false,\n };\n },\n\n computed: {\n\n showSendIcon () {\n return !this.showSend.text;\n },\n\n inputLength () {\n return this.text.length;\n },\n\n displayCharacterLimitWarning () {\n return Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\n },\n\n computedCloseButtonProps () {\n return {\n ariaLabel: 'Close',\n };\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n\n sendIconSize () {\n return '300';\n },\n },\n\n watch: {\n value (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\n linkDialogOpened (value) {\n this.linkDialogOpen = value;\n if (value === true) {\n this.initLinkDialog();\n } else {\n this.hideLinkBubbleMenu = false;\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n\n // eslint-disable-next-line complexity\n handleTopbarClick (type) {\n const editor = this.$refs.richTextEditor?.editor;\n // Key is the name returned in the event, value is the name of the TipTap command function to run.\n const typeToCommandMap = {\n bold: () => editor?.chain().focus().toggleBold().run(),\n italic: () => editor?.chain().focus().toggleItalic().run(),\n strike: () => editor?.chain().focus().toggleStrike().run(),\n bulletList: () => editor?.chain().focus().toggleBulletList().run(),\n orderedList: () => editor?.chain().focus().toggleOrderedList().run(),\n blockquote: () => editor?.chain().focus().toggleBlockquote().run(),\n code: () => editor?.chain().focus().toggleCode().run(),\n codeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n };\n\n if (editor && typeToCommandMap[type]) {\n typeToCommandMap[type]();\n }\n },\n\n // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\n return this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state, [{ type: 'bulletList' }, { type: 'orderedList' }]).includes(type) && this.isFocused;\n }\n return this.$refs.richTextEditor?.editor?.isActive(type) && this.isFocused;\n },\n\n initLinkDialog () {\n this.$refs.link.setInitialValues(this.selectedText, this.$refs.richTextEditor?.editor?.getAttributes('link')?.href);\n this.hideLinkBubbleMenu = true;\n this.linkDialogOpen = true;\n },\n\n removeLink () {\n this.$refs.richTextEditor?.removeLink();\n this.linkDialogOpen = false;\n },\n\n setLink (linkText, linkInput) {\n this.$refs.richTextEditor.setLink(\n linkInput, linkText, this.linkOptions, EDITOR_SUPPORTED_LINK_PROTOCOLS, EDITOR_DEFAULT_LINK_PREFIX,\n );\n this.linkDialogOpen = false;\n },\n\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = this.$refs.richTextEditor.$el.querySelector('.tiptap').contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji, close) {\n if (!emoji) {\n return;\n }\n\n if (!emoji.shift_key) {\n close();\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:value', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgSA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,Q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A,wBAAA,MAAA,MAAA,KAAA;AAAA,IACA;AAAA,IAEA,oBAAA;AACA,WAAA,oBAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,UAAA,KAAA,gBAAA;AACA;AAAA,MACA;AACA,WAAA,MAAA,UAAA,KAAA,kBAAA;AAAA,IACA;AAAA,IAEA,WAAA;AACA,WAAA,MAAA,QAAA;AAAA,IACA;AAAA,IAEA,QAAA,OAAA;AACA,WAAA,MAAA,gBAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA,OAAA;AACA,WAAA,OAAA;AACA,WAAA,MAAA,cAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const _pluginVue2_normalizer = require("../../../_virtual/_plugin-vue2_normalizer.cjs");
|
|
4
|
+
const button = require("../../../components/button/button.vue.cjs");
|
|
5
|
+
const tooltip = require("../../../components/tooltip/tooltip.vue.cjs");
|
|
6
|
+
const stack = require("../../../components/stack/stack.vue.cjs");
|
|
7
|
+
const keyboard_shortcut = require("../../../components/keyboard_shortcut/keyboard_shortcut.vue.cjs");
|
|
8
|
+
const _sfc_main = {
|
|
9
|
+
name: "DtRecipeMessageInputButton",
|
|
10
|
+
components: {
|
|
11
|
+
DtButton: button.default,
|
|
12
|
+
DtTooltip: tooltip.default,
|
|
13
|
+
DtStack: stack.default,
|
|
14
|
+
DtKeyboardShortcut: keyboard_shortcut.default
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
ariaLabel: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
tooltipText: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
keyboardShortcutText: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
isActive: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
dataQa: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
emits: ["click"]
|
|
39
|
+
};
|
|
40
|
+
var _sfc_render = function render() {
|
|
41
|
+
var _vm = this, _c = _vm._self._c;
|
|
42
|
+
return _c("dt-tooltip", { scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
43
|
+
return [_c("dt-button", { attrs: { "data-qa": _vm.dataQa, "importance": "clear", "kind": "muted", "aria-label": _vm.ariaLabel, "size": "xs", "active": _vm.isActive }, on: { "click": function($event) {
|
|
44
|
+
return _vm.$emit("click", $event);
|
|
45
|
+
} }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
46
|
+
return [_vm._t("icon")];
|
|
47
|
+
}, proxy: true }], null, true) })];
|
|
48
|
+
}, proxy: true }]) }, [_c("dt-stack", { attrs: { "gap": "200" } }, [_c("p", [_vm._v(_vm._s(_vm.tooltipText))]), _vm.keyboardShortcutText ? _c("dt-keyboard-shortcut", { attrs: { "inverted": "", "shortcut": _vm.keyboardShortcutText } }) : _vm._e()], 1)], 1);
|
|
49
|
+
};
|
|
50
|
+
var _sfc_staticRenderFns = [];
|
|
51
|
+
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default(
|
|
52
|
+
_sfc_main,
|
|
53
|
+
_sfc_render,
|
|
54
|
+
_sfc_staticRenderFns
|
|
55
|
+
);
|
|
56
|
+
const DtRecipeMessageInputButton = __component__.exports;
|
|
57
|
+
exports.default = DtRecipeMessageInputButton;
|
|
58
|
+
//# sourceMappingURL=message_input_button.vue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message_input_button.vue.cjs","sources":["../../../../recipes/conversation_view/message_input/message_input_button.vue"],"sourcesContent":["<template>\n <dt-tooltip>\n <template #anchor>\n <dt-button\n :data-qa=\"dataQa\"\n importance=\"clear\"\n kind=\"muted\"\n :aria-label=\"ariaLabel\"\n size=\"xs\"\n :active=\"isActive\"\n @click=\"$emit('click', $event)\"\n >\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </template>\n <dt-stack gap=\"200\">\n <p>{{ tooltipText }}</p>\n <dt-keyboard-shortcut\n v-if=\"keyboardShortcutText\"\n inverted\n :shortcut=\"keyboardShortcutText\"\n />\n </dt-stack>\n </dt-tooltip>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport { DtKeyboardShortcut } from '@/components/keyboard_shortcut';\nexport default {\n name: 'DtRecipeMessageInputButton',\n components: {\n DtButton,\n DtTooltip,\n DtStack,\n DtKeyboardShortcut,\n },\n\n props: {\n ariaLabel: {\n type: String,\n required: true,\n },\n\n tooltipText: {\n type: String,\n required: true,\n },\n\n keyboardShortcutText: {\n type: String,\n default: '',\n },\n\n isActive: {\n type: Boolean,\n default: false,\n },\n\n dataQa: {\n type: String,\n required: true,\n },\n },\n\n emits: ['click'],\n};\n</script>\n"],"names":["DtButton","DtTooltip","DtStack","DtKeyboardShortcut"],"mappings":";;;;;;;AAiCA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAA,OAAA;AAAA,IACA,WAAAC,QAAA;AAAA,IACA,SAAAC,MAAA;AAAA,IACA,oBAAAC,kBAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,sBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IAEA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IAEA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA,CAAA,OAAA;AACA;;;;;;;;;;;;;;;;;;;"}
|