@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.
Files changed (127) hide show
  1. package/dist/css/dialtone-default-theme.css +45 -1
  2. package/dist/css/dialtone-default-theme.min.css +1 -1
  3. package/dist/css/dialtone.css +45 -1
  4. package/dist/css/dialtone.min.css +1 -1
  5. package/dist/tokens/doc.json +15432 -15432
  6. package/dist/vue2/component-documentation.json +1 -1
  7. package/dist/vue2/components/hovercard/hovercard.vue.cjs +41 -2
  8. package/dist/vue2/components/hovercard/hovercard.vue.cjs.map +1 -1
  9. package/dist/vue2/components/hovercard/hovercard.vue.js +41 -2
  10. package/dist/vue2/components/hovercard/hovercard.vue.js.map +1 -1
  11. package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +2 -2
  12. package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.js +2 -2
  13. package/dist/vue2/components/popover/popover.vue.cjs +36 -60
  14. package/dist/vue2/components/popover/popover.vue.cjs.map +1 -1
  15. package/dist/vue2/components/popover/popover.vue.js +36 -60
  16. package/dist/vue2/components/popover/popover.vue.js.map +1 -1
  17. package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map +1 -1
  18. package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map +1 -1
  19. package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map +1 -1
  20. package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map +1 -1
  21. package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs +160 -17
  22. package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
  23. package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js +161 -18
  24. package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
  25. package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs +1 -1
  26. package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
  27. package/dist/vue2/recipes/conversation_view/editor/editor.vue.js +1 -1
  28. package/dist/vue2/recipes/conversation_view/editor/editor.vue.js.map +1 -1
  29. package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.cjs +87 -0
  30. package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.cjs.map +1 -0
  31. package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.js +87 -0
  32. package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.js.map +1 -0
  33. package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs +229 -46
  34. package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
  35. package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js +229 -46
  36. package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
  37. package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.cjs +58 -0
  38. package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.cjs.map +1 -0
  39. package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.js +58 -0
  40. package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.js.map +1 -0
  41. package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.cjs +108 -0
  42. package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.cjs.map +1 -0
  43. package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.js +108 -0
  44. package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.js.map +1 -0
  45. package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.cjs +106 -0
  46. package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.cjs.map +1 -0
  47. package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.js +106 -0
  48. package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.js.map +1 -0
  49. package/dist/vue2/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
  50. package/dist/vue2/types/components/popover/popover.vue.d.ts +380 -2
  51. package/dist/vue2/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
  52. package/dist/vue2/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts.map +1 -1
  53. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +37 -1
  54. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  55. package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  56. package/dist/vue2/types/recipes/conversation_view/message_input/last_active_nodes.d.ts +3 -0
  57. package/dist/vue2/types/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +1 -0
  58. package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +183 -60
  59. package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  60. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +48 -0
  61. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -0
  62. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +38 -0
  63. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -0
  64. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +87 -0
  65. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -0
  66. package/dist/vue3/component-documentation.json +1 -1
  67. package/dist/vue3/components/hovercard/hovercard.vue.cjs +55 -22
  68. package/dist/vue3/components/hovercard/hovercard.vue.cjs.map +1 -1
  69. package/dist/vue3/components/hovercard/hovercard.vue.js +56 -23
  70. package/dist/vue3/components/hovercard/hovercard.vue.js.map +1 -1
  71. package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +2 -2
  72. package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.js +2 -2
  73. package/dist/vue3/components/popover/popover.vue.cjs +40 -64
  74. package/dist/vue3/components/popover/popover.vue.cjs.map +1 -1
  75. package/dist/vue3/components/popover/popover.vue.js +40 -64
  76. package/dist/vue3/components/popover/popover.vue.js.map +1 -1
  77. package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map +1 -1
  78. package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map +1 -1
  79. package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map +1 -1
  80. package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map +1 -1
  81. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs +223 -21
  82. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
  83. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js +225 -23
  84. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
  85. package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs +1 -0
  86. package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
  87. package/dist/vue3/recipes/conversation_view/editor/editor.vue.js +1 -0
  88. package/dist/vue3/recipes/conversation_view/editor/editor.vue.js.map +1 -1
  89. package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.cjs +87 -0
  90. package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.cjs.map +1 -0
  91. package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.js +87 -0
  92. package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.js.map +1 -0
  93. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs +279 -65
  94. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
  95. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js +280 -66
  96. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
  97. package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.cjs +81 -0
  98. package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.cjs.map +1 -0
  99. package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.js +81 -0
  100. package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.js.map +1 -0
  101. package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.cjs +193 -0
  102. package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.cjs.map +1 -0
  103. package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.js +193 -0
  104. package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.js.map +1 -0
  105. package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.cjs +223 -0
  106. package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.cjs.map +1 -0
  107. package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.js +223 -0
  108. package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.js.map +1 -0
  109. package/dist/vue3/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
  110. package/dist/vue3/types/components/popover/popover.vue.d.ts +432 -1
  111. package/dist/vue3/types/components/popover/popover.vue.d.ts.map +1 -1
  112. package/dist/vue3/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
  113. package/dist/vue3/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts.map +1 -1
  114. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +42 -1
  115. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  116. package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  117. package/dist/vue3/types/recipes/conversation_view/message_input/last_active_nodes.d.ts +3 -0
  118. package/dist/vue3/types/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +1 -0
  119. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +185 -61
  120. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  121. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +50 -0
  122. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -0
  123. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +42 -0
  124. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -0
  125. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +89 -0
  126. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -0
  127. package/package.json +7 -4
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const last_active_nodes = require("./last_active_nodes.cjs");
3
4
  const meeting_pill = require("./extensions/meeting_pill/meeting_pill.cjs");
4
5
  const vue2 = require("@dialpad/dialtone-icons/vue2");
6
+ const message_input_topbar = require("./message_input_topbar.vue.cjs");
7
+ const message_input_link = require("./message_input_link.vue.cjs");
8
+ const editor_constants = require("../editor/editor_constants.cjs");
5
9
  const _pluginVue2_normalizer = require("../../../_virtual/_plugin-vue2_normalizer.cjs");
6
10
  const button = require("../../../components/button/button.vue.cjs");
7
11
  const emoji_picker = require("../../../components/emoji_picker/emoji_picker.vue.cjs");
@@ -18,6 +22,8 @@ const _sfc_main = {
18
22
  DtEmojiPicker: emoji_picker.default,
19
23
  DtInput: input.default,
20
24
  DtPopover: popover.default,
25
+ DtRecipeMessageInputTopbar: message_input_topbar.default,
26
+ DtRecipeMessageInputLink: message_input_link.default,
21
27
  DtRichTextEditor: rich_text_editor.default,
22
28
  DtTooltip: tooltip.default,
23
29
  DtStack: stack.default,
@@ -29,6 +35,18 @@ const _sfc_main = {
29
35
  mixins: [],
30
36
  inheritAttrs: false,
31
37
  props: {
38
+ /**
39
+ * Displays all the buttons for rich text formatting above the message input, and enables it within the editor.
40
+ * Rich text formatting for the purposes of this component is defined as:
41
+ *
42
+ * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.
43
+ *
44
+ * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.
45
+ */
46
+ richText: {
47
+ type: Boolean,
48
+ default: true
49
+ },
32
50
  /**
33
51
  * Value of the input. The object format should match TipTap's JSON
34
52
  * document structure: https://tiptap.dev/guide/output#option-1-json
@@ -97,18 +115,11 @@ const _sfc_main = {
97
115
  */
98
116
  outputFormat: {
99
117
  type: String,
100
- default: "text",
118
+ default: "json",
101
119
  validator(outputFormat) {
102
120
  return rich_text_editor_constants.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);
103
121
  }
104
122
  },
105
- /**
106
- * Enables the Link extension and optionally passes configurations to it
107
- */
108
- link: {
109
- type: [Boolean, Object],
110
- default: true
111
- },
112
123
  /**
113
124
  * Placeholder text
114
125
  */
@@ -240,53 +251,139 @@ const _sfc_main = {
240
251
  default: null
241
252
  },
242
253
  /**
243
- * Whether the input allows for block quote.
254
+ * descriptive text fields for the bold button
255
+ *
256
+ * object format:
257
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
244
258
  */
245
- allowBlockquote: {
246
- type: Boolean,
247
- default: true
259
+ boldButtonOptions: {
260
+ type: Object,
261
+ default: () => ({
262
+ ariaLabel: "Toggle bold on selected text",
263
+ tooltipText: "Bold",
264
+ keyboardShortcutText: "Mod + B"
265
+ })
248
266
  },
249
267
  /**
250
- * Whether the input allows for bold to be introduced in the text.
268
+ * descriptive text fields for the italic button
269
+ *
270
+ * object format:
271
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
251
272
  */
252
- allowBold: {
253
- type: Boolean,
254
- default: true
273
+ italicButtonOptions: {
274
+ type: Object,
275
+ default: () => ({
276
+ ariaLabel: "Toggle italic on selected text",
277
+ tooltipText: "Italic",
278
+ keyboardShortcutText: "Mod + I"
279
+ })
255
280
  },
256
281
  /**
257
- * Whether the input allows for bullet list to be introduced in the text.
258
- */
259
- allowBulletList: {
260
- type: Boolean,
261
- default: true
282
+ * descriptive text fields for the strikethrough button
283
+ *
284
+ * object format:
285
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
286
+ */
287
+ strikeButtonOptions: {
288
+ type: Object,
289
+ default: () => ({
290
+ ariaLabel: "Toggle strikethrough on selected text",
291
+ tooltipText: "Strikethrough",
292
+ keyboardShortcutText: "Mod + Shift + S"
293
+ })
262
294
  },
263
295
  /**
264
- * Whether the input allows for italic to be introduced in the text.
296
+ * descriptive text fields for the link button
297
+ *
298
+ * object format:
299
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
265
300
  */
266
- allowItalic: {
267
- type: Boolean,
268
- default: true
301
+ linkButtonOptions: {
302
+ type: Object,
303
+ default: () => ({
304
+ ariaLabel: "Create or edit link on selected text",
305
+ tooltipText: "Link",
306
+ // TODO: implement mod k
307
+ keyboardShortcutText: "Mod + K",
308
+ dialogTitle: "Add a link",
309
+ textLabel: "Text to display (optional)",
310
+ linkLabel: "Link",
311
+ linkPlaceholder: "e.g. https://www.dialpad.com",
312
+ removeLabel: "Remove",
313
+ cancelLabel: "Cancel",
314
+ confirmLabel: "Done",
315
+ visuallyHiddenCloseText: "Close link dialog"
316
+ })
317
+ },
318
+ /**
319
+ * descriptive text fields for the bullet list button
320
+ *
321
+ * object format:
322
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
323
+ */
324
+ bulletListButtonOptions: {
325
+ type: Object,
326
+ default: () => ({
327
+ ariaLabel: "Toggle bullet list on selected text",
328
+ tooltipText: "Bullet list",
329
+ keyboardShortcutText: "Mod + Shift + 8"
330
+ })
269
331
  },
270
332
  /**
271
- * Whether the input allows for strike to be introduced in the text.
333
+ * descriptive text fields for the ordered list button
334
+ *
335
+ * object format:
336
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
272
337
  */
273
- allowStrike: {
274
- type: Boolean,
275
- default: true
338
+ orderedListButtonOptions: {
339
+ type: Object,
340
+ default: () => ({
341
+ ariaLabel: "Toggle ordered list on selected text",
342
+ tooltipText: "Ordered list",
343
+ keyboardShortcutText: "Mod + Shift + 7"
344
+ })
276
345
  },
277
346
  /**
278
- * Whether the input allows for underline to be introduced in the text.
347
+ * descriptive text fields for the italic button
348
+ *
349
+ * object format:
350
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
279
351
  */
280
- allowUnderline: {
281
- type: Boolean,
282
- default: true
352
+ blockQuoteButtonOptions: {
353
+ type: Object,
354
+ default: () => ({
355
+ ariaLabel: "Toggle Blockquote on selected text",
356
+ tooltipText: "Blockquote",
357
+ keyboardShortcutText: "Mod + Shift + B"
358
+ })
283
359
  },
284
360
  /**
285
- * Whether the input allows codeblock to be introduced in the text.
361
+ * descriptive text fields for the code button
362
+ *
363
+ * object format:
364
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
286
365
  */
287
- allowCodeblock: {
288
- type: Boolean,
289
- default: true
366
+ codeButtonOptions: {
367
+ type: Object,
368
+ default: () => ({
369
+ ariaLabel: "Toggle code tag on selected text",
370
+ tooltipText: "Code",
371
+ keyboardShortcutText: "Mod + E"
372
+ })
373
+ },
374
+ /**
375
+ * descriptive text fields for the code block button
376
+ *
377
+ * object format:
378
+ * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }
379
+ */
380
+ codeBlockButtonOptions: {
381
+ type: Object,
382
+ default: () => ({
383
+ ariaLabel: "Toggle code block on selected text",
384
+ tooltipText: "Code block",
385
+ keyboardShortcutText: "Mod + Alt + C"
386
+ })
290
387
  }
291
388
  },
292
389
  emits: [
@@ -358,16 +455,33 @@ const _sfc_main = {
358
455
  * @event update:value
359
456
  * @type {String|JSON}
360
457
  */
361
- "update:value"
458
+ "update:value",
459
+ /**
460
+ * Emitted when input changes, returns text content only
461
+ * @event text-input
462
+ * @type {String}
463
+ */
464
+ "text-input"
362
465
  ],
363
466
  data() {
364
467
  return {
468
+ // If an ordered list is nested within an unordered list, we only want to show the currently selected list as
469
+ // active. This function performs the logic to determine the farthest active node from the root.
470
+ lastActiveNodes: last_active_nodes.default,
365
471
  additionalExtensions: [meeting_pill.default],
366
472
  internalInputValue: this.value,
367
473
  // internal input content
368
474
  imagePickerFocus: false,
369
475
  emojiPickerFocus: false,
370
- emojiPickerOpened: false
476
+ emojiPickerOpened: false,
477
+ isFocused: false,
478
+ linkOptions: {
479
+ class: "d-link d-c-text d-d-inline-block"
480
+ },
481
+ linkDialogOpen: false,
482
+ selectedText: "",
483
+ text: "",
484
+ hideLinkBubbleMenu: false
371
485
  };
372
486
  },
373
487
  computed: {
@@ -375,7 +489,7 @@ const _sfc_main = {
375
489
  return !this.showSend.text;
376
490
  },
377
491
  inputLength() {
378
- return this.internalInputValue.length;
492
+ return this.text.length;
379
493
  },
380
494
  displayCharacterLimitWarning() {
381
495
  return Boolean(this.showCharacterLimit) && this.showCharacterLimit.count - this.inputLength <= this.showCharacterLimit.warning;
@@ -412,9 +526,68 @@ const _sfc_main = {
412
526
  created() {
413
527
  if (this.value && this.outputFormat === "text") {
414
528
  this.internalInputValue = this.value.replace(/\n/g, "<br>");
529
+ } else {
530
+ this.internalInputValue = this.value;
415
531
  }
416
532
  },
417
533
  methods: {
534
+ linkDialogOpened(value) {
535
+ var _a;
536
+ this.linkDialogOpen = value;
537
+ if (value === true) {
538
+ this.initLinkDialog();
539
+ } else {
540
+ this.hideLinkBubbleMenu = false;
541
+ (_a = this.$refs.richTextEditor) == null ? void 0 : _a.focusEditor();
542
+ }
543
+ },
544
+ // eslint-disable-next-line complexity
545
+ handleTopbarClick(type) {
546
+ var _a;
547
+ const editor = (_a = this.$refs.richTextEditor) == null ? void 0 : _a.editor;
548
+ const typeToCommandMap = {
549
+ bold: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run(),
550
+ italic: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run(),
551
+ strike: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run(),
552
+ bulletList: () => editor == null ? void 0 : editor.chain().focus().toggleBulletList().run(),
553
+ orderedList: () => editor == null ? void 0 : editor.chain().focus().toggleOrderedList().run(),
554
+ blockquote: () => editor == null ? void 0 : editor.chain().focus().toggleBlockquote().run(),
555
+ code: () => editor == null ? void 0 : editor.chain().focus().toggleCode().run(),
556
+ codeBlock: () => editor == null ? void 0 : editor.chain().focus().toggleCodeBlock().run()
557
+ };
558
+ if (editor && typeToCommandMap[type]) {
559
+ typeToCommandMap[type]();
560
+ }
561
+ },
562
+ // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold
563
+ isSelectionActive(type) {
564
+ var _a, _b, _c, _d;
565
+ if (["bulletList", "orderedList"].includes(type)) {
566
+ 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;
567
+ }
568
+ return ((_d = (_c = this.$refs.richTextEditor) == null ? void 0 : _c.editor) == null ? void 0 : _d.isActive(type)) && this.isFocused;
569
+ },
570
+ initLinkDialog() {
571
+ var _a, _b, _c;
572
+ 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);
573
+ this.hideLinkBubbleMenu = true;
574
+ this.linkDialogOpen = true;
575
+ },
576
+ removeLink() {
577
+ var _a;
578
+ (_a = this.$refs.richTextEditor) == null ? void 0 : _a.removeLink();
579
+ this.linkDialogOpen = false;
580
+ },
581
+ setLink(linkText, linkInput) {
582
+ this.$refs.richTextEditor.setLink(
583
+ linkInput,
584
+ linkText,
585
+ this.linkOptions,
586
+ editor_constants.EDITOR_SUPPORTED_LINK_PROTOCOLS,
587
+ editor_constants.EDITOR_DEFAULT_LINK_PREFIX
588
+ );
589
+ this.linkDialogOpen = false;
590
+ },
418
591
  // Mousedown instead of click because it fires before the blur event.
419
592
  onMousedown(e) {
420
593
  const isWithinInput = this.$refs.richTextEditor.$el.querySelector(".tiptap").contains(e.target);
@@ -474,18 +647,30 @@ const _sfc_main = {
474
647
  },
475
648
  onInput(event) {
476
649
  this.$emit("update:value", event);
650
+ },
651
+ onTextInput(event) {
652
+ this.text = event;
653
+ this.$emit("text-input", event);
477
654
  }
478
655
  }
479
656
  };
480
657
  var _sfc_render = function render() {
481
658
  var _a;
482
659
  var _vm = this, _c = _vm._self._c;
483
- return _c("div", { class: ["d-recipe-message-input"], attrs: { "data-qa": "dt-recipe-message-input", "role": "presentation" }, on: { "dragover": function($event) {
660
+ return _c("div", { staticClass: "d-recipe-message-input", attrs: { "data-qa": "dt-recipe-message-input", "role": "presentation" }, on: { "dragover": function($event) {
484
661
  $event.preventDefault();
485
662
  }, "drop": function($event) {
486
663
  $event.preventDefault();
487
664
  return _vm.onDrop.apply(null, arguments);
488
- }, "paste": _vm.onPaste, "mousedown": _vm.onMousedown } }, [_vm._t("top"), _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.link, "placeholder": _vm.placeholder, "prevent-typing": _vm.preventTyping, "mention-suggestion": _vm.mentionSuggestion, "channel-suggestion": _vm.channelSuggestion, "slash-command-suggestion": _vm.slashCommandSuggestion, "allow-blockquote": _vm.allowBlockquote, "allow-bold": _vm.allowBold, "allow-bullet-list": _vm.allowBulletList, "allow-codeblock": _vm.allowCodeblock, "allow-italic": _vm.allowItalic, "allow-strike": _vm.allowStrike, "allow-underline": _vm.allowUnderline, "additional-extensions": _vm.additionalExtensions }, on: { "input": _vm.onInput, "enter": _vm.onSend }, model: { value: _vm.internalInputValue, callback: function($$v) {
665
+ }, "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() {
666
+ 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 } })];
667
+ }, 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) {
668
+ _vm.selectedText = $event;
669
+ }, "edit-link": _vm.initLinkDialog, "focus": function($event) {
670
+ _vm.isFocused = true;
671
+ }, "blur": function($event) {
672
+ _vm.isFocused = false;
673
+ } }, model: { value: _vm.internalInputValue, callback: function($$v) {
489
674
  _vm.internalInputValue = $$v;
490
675
  }, 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) {
491
676
  _vm.imagePickerFocus = true;
@@ -497,7 +682,7 @@ var _sfc_render = function render() {
497
682
  _vm.imagePickerFocus = false;
498
683
  } }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
499
684
  return [_c("dt-icon-image", { attrs: { "size": "300" } })];
500
- }, 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 }) {
685
+ }, 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 }) {
501
686
  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) {
502
687
  _vm.emojiPickerFocus = true;
503
688
  }, "mouseleave": function($event) {
@@ -511,9 +696,7 @@ var _sfc_render = function render() {
511
696
  }, proxy: true }], null, true) }, "dt-button", attrs, false))];
512
697
  } }, { key: "content", fn: function({ close }) {
513
698
  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))];
514
- } }], null, false, 3974835042), model: { value: _vm.emojiPickerOpened, callback: function($$v) {
515
- _vm.emojiPickerOpened = $$v;
516
- }, 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() {
699
+ } }], 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() {
517
700
  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) + " ")])];
518
701
  }, 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() {
519
702
  var _a2;
@@ -1 +1 @@
1
- {"version":3,"file":"message_input.vue.cjs","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":["DtButton","DtEmojiPicker","DtInput","DtPopover","DtRichTextEditor","DtTooltip","DtStack","DtIconImage","DtIconVerySatisfied","DtIconSatisfied","DtIconSend","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_OUTPUT_FORMATS","MeetingPill"],"mappings":";;;;;;;;;;;;;AAkPA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAA,OAAA;AAAA,IACA,eAAAC,aAAA;AAAA,IACA,SAAAC,MAAA;AAAA,IACA,WAAAC,QAAA;AAAA,IACA,kBAAAC,iBAAA;AAAA,IACA,WAAAC,QAAA;AAAA,IACA,SAAAC,MAAA;AAAA,IACA,aAAAC,KAAA;AAAA,IACA,qBAAAC,KAAA;AAAA,IACA,iBAAAC,KAAA;AAAA,IACA,YAAAC,KAAA;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,SA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,MAAA,eAAA,OAAA,SAAA,cAAA;AAAA,QACA,MAAA;AAAA,QACA,OAAA;AAAA,UACA,MAAA,MAAA;AAAA,QACA;AAAA,MACA,CAAA;AACA,WAAA,MAAA,kBAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,MAAA,wBAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA,IAEA,gBAAA;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.cjs","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":["DtButton","DtEmojiPicker","DtInput","DtPopover","DtRecipeMessageInputTopbar","DtRecipeMessageInputLink","DtRichTextEditor","DtTooltip","DtStack","DtIconImage","DtIconVerySatisfied","DtIconSatisfied","DtIconSend","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_OUTPUT_FORMATS","lastActiveNodes","MeetingPill","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX"],"mappings":";;;;;;;;;;;;;;;;;AAgSA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAA,OAAA;AAAA,IACA,eAAAC,aAAA;AAAA,IACA,SAAAC,MAAA;AAAA,IACA,WAAAC,QAAA;AAAA,IACA,4BAAAC,qBAAA;AAAA,IACA,0BAAAC,mBAAA;AAAA,IACA,kBAAAC,iBAAA;AAAA,IACA,WAAAC,QAAA;AAAA,IACA,SAAAC,MAAA;AAAA,IACA,aAAAC,KAAA;AAAA,IACA,qBAAAC,KAAA;AAAA,IACA,iBAAAC,KAAA;AAAA,IACA,YAAAC,KAAA;AAAA,EACA;AAAA,EAEA,QAAA,CAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,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,IAC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