@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,8 @@
1
- import { EditorContent, Editor } from "@tiptap/vue-3";
1
+ import { EditorContent, BubbleMenu, Editor } from "@tiptap/vue-3";
2
2
  import { Extension } from "@tiptap/core";
3
3
  import Blockquote from "@tiptap/extension-blockquote";
4
4
  import CodeBlock from "@tiptap/extension-code-block";
5
+ import Code from "@tiptap/extension-code";
5
6
  import Document from "@tiptap/extension-document";
6
7
  import HardBreak from "@tiptap/extension-hard-break";
7
8
  import Paragraph from "@tiptap/extension-paragraph";
@@ -29,12 +30,18 @@ import mentionSuggestion from "./extensions/mentions/suggestion.js";
29
30
  import channelSuggestion from "./extensions/channels/suggestion.js";
30
31
  import slashCommandSuggestion from "./extensions/slash_command/suggestion.js";
31
32
  import { warnIfUnmounted } from "../../common/utils.js";
32
- import { resolveComponent, openBlock, createBlock, mergeProps } from "vue";
33
+ import deepEqual from "deep-equal";
34
+ import { resolveComponent, openBlock, createElementBlock, createBlock, withCtx, createElementVNode, createVNode, createTextVNode, createCommentVNode, mergeProps } from "vue";
33
35
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
36
+ import DtButton from "../button/button.vue.js";
37
+ import DtStack from "../stack/stack.vue.js";
34
38
  const _sfc_main = {
35
39
  name: "DtRichTextEditor",
36
40
  components: {
37
- EditorContent
41
+ EditorContent,
42
+ BubbleMenu,
43
+ DtButton,
44
+ DtStack
38
45
  },
39
46
  props: {
40
47
  /**
@@ -238,6 +245,13 @@ const _sfc_main = {
238
245
  type: Boolean,
239
246
  default: true
240
247
  },
248
+ /**
249
+ * Whether the input allows inline code (wrapped in backticks).
250
+ */
251
+ allowCode: {
252
+ type: Boolean,
253
+ default: true
254
+ },
241
255
  /**
242
256
  * Whether the input allows codeblock to be introduced in the text.
243
257
  */
@@ -258,6 +272,15 @@ const _sfc_main = {
258
272
  additionalExtensions: {
259
273
  type: Array,
260
274
  default: () => []
275
+ },
276
+ /**
277
+ * Manually hide the link bubble menu. The link bubble menu is shown when a link is selected via the cursor.
278
+ * There are some cases when you may want the link to remain selected but hide the bubble menu such as when You
279
+ * are showing a custom link editor popup.
280
+ */
281
+ hideLinkBubbleMenu: {
282
+ type: Boolean,
283
+ default: false
261
284
  }
262
285
  },
263
286
  emits: [
@@ -267,6 +290,24 @@ const _sfc_main = {
267
290
  * @type {String|JSON}
268
291
  */
269
292
  "input",
293
+ /**
294
+ * Input event always in JSON format.
295
+ * @event input
296
+ * @type {JSON}
297
+ */
298
+ "json-input",
299
+ /**
300
+ * Input event always in HTML format.
301
+ * @event input
302
+ * @type {HTML}
303
+ */
304
+ "html-input",
305
+ /**
306
+ * Input event always in text format.
307
+ * @event input
308
+ * @type {String}
309
+ */
310
+ "text-input",
270
311
  /**
271
312
  * Event to sync the value with the parent
272
313
  * @event update:value
@@ -290,11 +331,32 @@ const _sfc_main = {
290
331
  * @event enter
291
332
  * @type {String}
292
333
  */
293
- "enter"
334
+ "enter",
335
+ /**
336
+ * "Edit link" button was clicked. Fires an event for the consuming component to handle the editing of the link.
337
+ * event contains the link object with two properties href and text.
338
+ * @event edit-link
339
+ * @type {Object}
340
+ */
341
+ "edit-link",
342
+ /**
343
+ * "Selected" event is fired when the user selects text in the editor. returns the currently selected text.
344
+ * If the selected text is partially a link, the full link text is returned.
345
+ * @event selected
346
+ * @type {String}
347
+ */
348
+ "selected"
294
349
  ],
295
350
  data() {
296
351
  return {
297
- editor: null
352
+ editor: null,
353
+ tippyOptions: {
354
+ appendTo: () => {
355
+ var _a;
356
+ return (_a = this.$refs.editor.$el.getRootNode()) == null ? void 0 : _a.querySelector("body");
357
+ },
358
+ placement: "top-start"
359
+ }
298
360
  };
299
361
  },
300
362
  computed: {
@@ -320,7 +382,11 @@ const _sfc_main = {
320
382
  }
321
383
  if (this.allowBulletList) {
322
384
  extensions.push(BulletList);
323
- extensions.push(ListItem);
385
+ extensions.push(ListItem.extend({
386
+ renderText({ node }) {
387
+ return node.textContent;
388
+ }
389
+ }));
324
390
  extensions.push(OrderedList);
325
391
  }
326
392
  if (this.allowItalic) {
@@ -370,6 +436,7 @@ const _sfc_main = {
370
436
  HTMLAttributes: {
371
437
  class: "d-link d-wb-break-all"
372
438
  },
439
+ openOnClick: false,
373
440
  autolink: true,
374
441
  protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS
375
442
  }));
@@ -394,8 +461,17 @@ const _sfc_main = {
394
461
  types: ["paragraph"],
395
462
  defaultAlignment: "left"
396
463
  }));
464
+ if (this.allowCode) {
465
+ extensions.push(Code);
466
+ }
397
467
  if (this.allowCodeblock) {
398
- extensions.push(CodeBlock.configure({
468
+ extensions.push(CodeBlock.extend({
469
+ renderText({ node }) {
470
+ return `\`\`\`
471
+ ${node.textContent}
472
+ \`\`\``;
473
+ }
474
+ }).configure({
399
475
  HTMLAttributes: {
400
476
  class: "d-rich-text-editor__code-block"
401
477
  }
@@ -476,36 +552,103 @@ const _sfc_main = {
476
552
  });
477
553
  this.addEditorListeners();
478
554
  },
479
- processValue(newValue, returnIfEqual = true) {
480
- let currentValue = this.getOutput();
481
- if (this.outputFormat === "json") {
482
- newValue = JSON.stringify(newValue);
483
- currentValue = JSON.stringify(currentValue);
555
+ bubbleMenuShouldShow({ editor, view, state, oldState, from, to }) {
556
+ return editor.isActive("link");
557
+ },
558
+ /**
559
+ * If the selection contains a link, return the existing link text.
560
+ * Otherwise, use just the selected text.
561
+ * @param editor the editor instance.
562
+ */
563
+ getSelectedLinkText(editor) {
564
+ var _a, _b, _c;
565
+ const { view, state } = editor;
566
+ const { from, to } = view.state.selection;
567
+ const text = state.doc.textBetween(from, to, "");
568
+ const linkNode = this.editor.state.doc.nodeAt(from);
569
+ if (linkNode && ((_c = (_b = (_a = linkNode.marks) == null ? void 0 : _a.at(0)) == null ? void 0 : _b.type) == null ? void 0 : _c.name) === "link") {
570
+ return linkNode.textContent;
571
+ } else {
572
+ return text;
484
573
  }
485
- if (returnIfEqual && newValue === currentValue) {
574
+ },
575
+ editLink() {
576
+ const linkText = this.getSelectedLinkText(this.editor);
577
+ const link = {
578
+ href: this.editor.getAttributes("link").href,
579
+ text: linkText
580
+ };
581
+ this.$emit("edit-link", link);
582
+ },
583
+ removeLink() {
584
+ var _a, _b, _c, _d;
585
+ (_d = (_c = (_b = (_a = this.editor) == null ? void 0 : _a.chain()) == null ? void 0 : _b.focus()) == null ? void 0 : _c.unsetLink()) == null ? void 0 : _d.run();
586
+ },
587
+ openLink() {
588
+ var _a, _b;
589
+ (_b = (_a = this.editor) == null ? void 0 : _a.chain()) == null ? void 0 : _b.focus();
590
+ const link = this.editor.getAttributes("link").href;
591
+ window.open(link, "_blank");
592
+ },
593
+ // eslint-disable-next-line complexity
594
+ setLink(linkInput, linkText, linkOptions, linkProtocols = RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS, defaultPrefix) {
595
+ var _a, _b, _c;
596
+ if (!linkInput) {
597
+ this.removeLink();
598
+ return;
599
+ }
600
+ const prefix = linkProtocols.find((prefixRegex) => prefixRegex.test(linkInput));
601
+ if (!prefix) {
602
+ linkInput = `${defaultPrefix}${linkInput}`;
603
+ }
604
+ this.editor.chain().focus().extendMarkRange("link").run();
605
+ const selection = (_c = (_b = (_a = this.editor) == null ? void 0 : _a.view) == null ? void 0 : _b.state) == null ? void 0 : _c.selection;
606
+ this.editor.chain().focus().insertContent(linkText).setTextSelection({ from: selection.from, to: selection.from + linkText.length }).setLink({ href: linkInput, class: linkOptions.class }).run();
607
+ },
608
+ // eslint-disable-next-line complexity
609
+ processValue(newValue, returnIfEqual = true) {
610
+ const currentValue = this.getOutput();
611
+ if (returnIfEqual && deepEqual(newValue, currentValue)) {
486
612
  return;
487
613
  }
488
- const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, "g");
489
- newValue = newValue.replace(inputUnicodeRegex, '<emoji-component code="$1"></emoji-component>');
614
+ if (typeof newValue === "string" && this.outputFormat === "text") {
615
+ const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, "g");
616
+ newValue = newValue == null ? void 0 : newValue.replace(inputUnicodeRegex, '<emoji-component code="$1"></emoji-component>');
617
+ }
490
618
  this.editor.commands.setContent(newValue, false);
491
619
  },
492
620
  destroyEditor() {
493
621
  this.editor.destroy();
494
622
  },
623
+ triggerInputChangeEvents() {
624
+ const value = this.getOutput();
625
+ this.$emit("input", value);
626
+ this.$emit("update:modelValue", value);
627
+ const jsonValue = this.editor.getJSON();
628
+ this.$emit("json-input", jsonValue);
629
+ const htmlValue = this.editor.getHTML();
630
+ this.$emit("html-input", htmlValue);
631
+ const textValue = this.editor.getText({ blockSeparator: "\n" });
632
+ this.$emit("text-input", textValue);
633
+ },
495
634
  /**
496
635
  * The Editor exposes event hooks that we have to map our emits into. See
497
636
  * https://tiptap.dev/api/events for all events.
498
637
  */
499
638
  addEditorListeners() {
639
+ this.editor.on("create", () => {
640
+ this.triggerInputChangeEvents();
641
+ });
500
642
  this.editor.on("update", () => {
501
643
  var _a, _b;
502
- const value = this.getOutput();
503
644
  if (this.preventTyping && ((_b = (_a = this.editor.view) == null ? void 0 : _a.input) == null ? void 0 : _b.lastKeyCode) !== 8) {
504
645
  this.editor.commands.setContent(this.value, false);
505
646
  return;
506
647
  }
507
- this.$emit("input", value);
508
- this.$emit("update:modelValue", value);
648
+ this.triggerInputChangeEvents();
649
+ });
650
+ this.editor.on("selectionUpdate", ({ editor }) => {
651
+ this.$emit("selected", this.getSelectedLinkText(editor));
509
652
  });
510
653
  this.editor.on("focus", ({ event }) => {
511
654
  this.$emit("focus", event);
@@ -548,13 +691,72 @@ const _sfc_main = {
548
691
  }
549
692
  }
550
693
  };
694
+ const _hoisted_1 = { class: "d-popover__dialog" };
551
695
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
696
+ const _component_dt_button = resolveComponent("dt-button");
697
+ const _component_dt_stack = resolveComponent("dt-stack");
698
+ const _component_bubble_menu = resolveComponent("bubble-menu");
552
699
  const _component_editor_content = resolveComponent("editor-content");
553
- return openBlock(), createBlock(_component_editor_content, mergeProps({
554
- editor: $data.editor,
555
- class: "d-rich-text-editor",
556
- "data-qa": "dt-rich-text-editor"
557
- }, $options.attrs), null, 16, ["editor"]);
700
+ return openBlock(), createElementBlock("div", null, [
701
+ $data.editor && $props.link && !$props.hideLinkBubbleMenu ? (openBlock(), createBlock(_component_bubble_menu, {
702
+ key: 0,
703
+ editor: $data.editor,
704
+ "should-show": $options.bubbleMenuShouldShow,
705
+ "tippy-options": $data.tippyOptions,
706
+ style: { "visibility": "visible" }
707
+ }, {
708
+ default: withCtx(() => [
709
+ createElementVNode("div", _hoisted_1, [
710
+ createVNode(_component_dt_stack, {
711
+ direction: "row",
712
+ class: "d-rich-text-editor-bubble-menu__button-stack",
713
+ gap: "0"
714
+ }, {
715
+ default: withCtx(() => [
716
+ createVNode(_component_dt_button, {
717
+ kind: "muted",
718
+ importance: "clear",
719
+ onClick: $options.editLink
720
+ }, {
721
+ default: withCtx(() => [
722
+ createTextVNode(" Edit ")
723
+ ]),
724
+ _: 1
725
+ }, 8, ["onClick"]),
726
+ createVNode(_component_dt_button, {
727
+ kind: "muted",
728
+ importance: "clear",
729
+ onClick: $options.openLink
730
+ }, {
731
+ default: withCtx(() => [
732
+ createTextVNode(" Open link ")
733
+ ]),
734
+ _: 1
735
+ }, 8, ["onClick"]),
736
+ createVNode(_component_dt_button, {
737
+ kind: "danger",
738
+ importance: "clear",
739
+ onClick: $options.removeLink
740
+ }, {
741
+ default: withCtx(() => [
742
+ createTextVNode(" Remove ")
743
+ ]),
744
+ _: 1
745
+ }, 8, ["onClick"])
746
+ ]),
747
+ _: 1
748
+ })
749
+ ])
750
+ ]),
751
+ _: 1
752
+ }, 8, ["editor", "should-show", "tippy-options"])) : createCommentVNode("", true),
753
+ createVNode(_component_editor_content, mergeProps({
754
+ ref: "editor",
755
+ editor: $data.editor,
756
+ class: "d-rich-text-editor",
757
+ "data-qa": "dt-rich-text-editor"
758
+ }, $options.attrs), null, 16, ["editor"])
759
+ ]);
558
760
  }
559
761
  const DtRichTextEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
560
762
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"rich_text_editor.vue.js","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <editor-content\n :editor=\"editor\"\n class=\"d-rich-text-editor\"\n data-qa=\"dt-rich-text-editor\"\n v-bind=\"attrs\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-3';\nimport { Extension } from '@tiptap/core';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Document from '@tiptap/extension-document';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport ConfigurableImage from './extensions/image';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\nimport { emojiPattern } from 'regex-combined-emojis';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n },\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 modelValue: {\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 * 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 * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\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: 'html',\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 * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\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 * Note that slash commands only work when they are the first word in the input.\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 * Whether the input allows inline images to be rendered.\n */\n allowInlineImages: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:modelValue',\n\n /**\n * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n ],\n\n data () {\n return {\n editor: null,\n };\n },\n\n computed: {\n attrs () {\n return {\n ...this.$attrs,\n onInput: () => {},\n onFocus: () => {},\n onBlur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History, HardBreak];\n\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem);\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n const self = this;\n const ShiftEnter = Extension.create({\n addKeyboardShortcuts () {\n return {\n 'Shift-Enter': ({ editor }) => {\n if (self.allowLineBreaks) {\n return false;\n }\n editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => self.allowBulletList && commands.splitListItem('listItem'),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]);\n return true;\n },\n Enter: () => {\n if (self.allowLineBreaks) {\n return false;\n }\n self.$emit('enter');\n return true;\n },\n };\n },\n });\n extensions.push(ShiftEnter);\n\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'd-rich-text-editor__code-block',\n },\n }));\n }\n\n if (this.allowInlineImages) {\n extensions.push(ConfigurableImage);\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n modelValue (newValue) {\n this.processValue(newValue);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n this.processValue(this.modelValue, false);\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.modelValue,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n // Moves the <br /> tags inside the previous closing tag to avoid\n // Prosemirror wrapping them within another </p> tag.\n transformPastedHTML (html) {\n return html.replace(/(<\\/\\w+>)((<br \\/>)+)/g, '$2$3$1');\n },\n },\n });\n this.addEditorListeners();\n },\n\n processValue (newValue, returnIfEqual = true) {\n let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n\n if (returnIfEqual && newValue === currentValue) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n\n const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, 'g');\n\n // If the text contains emoji characters convert them to emoji component tags\n newValue = newValue.replace(inputUnicodeRegex, '<emoji-component code=\"$1\"></emoji-component>');\n\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n // The content has changed.\n this.editor.on('update', () => {\n const value = this.getOutput();\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.$emit('input', value);\n this.$emit('update:modelValue', value);\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText({ blockSeparator: '\\n' });\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n ...attributes,\n },\n },\n });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n"],"names":["_openBlock","_createBlock","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaD,WAAW;AAAA,MACT,MAAM,CAAC,SAAS,QAAQ,MAA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;AAAA,IAED,uBAAwB,YAAY;AAClC,WAAK,OAAO,WAAW;AAAA,QACrB,aAAa;AAAA,UACX,YAAY;AAAA,YACV,GAAG,KAAK;AAAA,YACR,OAAO,KAAK;AAAA,YACZ,GAAG;AAAA,UACJ;AAAA,QACF;AAAA,MACH,CAAC;AAAA,IACF;AAAA,IAED,cAAe;AACb,WAAK,OAAO,SAAS;IACtB;AAAA,EACF;AACH;;;AAvoBE,SAAAA,UAAA,GAAAC,YAKE,2BALFC,WAKE;AAAA,IAJC,QAAQ,MAAM;AAAA,IACf,OAAM;AAAA,IACN,WAAQ;AAAA,KACA,SAAK,KAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA;;;"}
1
+ {"version":3,"file":"rich_text_editor.vue.js","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<!-- eslint-disable vue/no-bare-strings-in-template -->\n<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div>\n <!-- why the hell is this visibility: hidden by default??? -->\n <bubble-menu\n v-if=\"editor && link && !hideLinkBubbleMenu\"\n :editor=\"editor\"\n :should-show=\"bubbleMenuShouldShow\"\n :tippy-options=\"tippyOptions\"\n style=\"visibility: visible;\"\n >\n <div class=\"d-popover__dialog\">\n <dt-stack\n direction=\"row\"\n class=\"d-rich-text-editor-bubble-menu__button-stack\"\n gap=\"0\"\n >\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"editLink\"\n >\n Edit\n </dt-button>\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"openLink\"\n >\n Open link\n </dt-button>\n <dt-button\n kind=\"danger\"\n importance=\"clear\"\n @click=\"removeLink\"\n >\n Remove\n </dt-button>\n </dt-stack>\n </div>\n </bubble-menu>\n <editor-content\n ref=\"editor\"\n :editor=\"editor\"\n class=\"d-rich-text-editor\"\n data-qa=\"dt-rich-text-editor\"\n v-bind=\"attrs\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-3';\nimport { Extension } from '@tiptap/core';\nimport { DtButton } from '../button';\nimport { DtStack } from '../stack';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Code from '@tiptap/extension-code';\nimport Document from '@tiptap/extension-document';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport ConfigurableImage from './extensions/image';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\nimport { emojiPattern } from 'regex-combined-emojis';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport { warnIfUnmounted } from '@/common/utils';\nimport deepEqual from 'deep-equal';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n BubbleMenu,\n DtButton,\n DtStack,\n },\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 modelValue: {\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 * 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 * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\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: 'html',\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 * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\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 * Note that slash commands only work when they are the first word in the input.\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 inline code (wrapped in backticks).\n */\n allowCode: {\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 * Whether the input allows inline images to be rendered.\n */\n allowInlineImages: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Manually hide the link bubble menu. The link bubble menu is shown when a link is selected via the cursor.\n * There are some cases when you may want the link to remain selected but hide the bubble menu such as when You\n * are showing a custom link editor popup.\n */\n hideLinkBubbleMenu: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Input event always in JSON format.\n * @event input\n * @type {JSON}\n */\n 'json-input',\n\n /**\n * Input event always in HTML format.\n * @event input\n * @type {HTML}\n */\n 'html-input',\n\n /**\n * Input event always in text format.\n * @event input\n * @type {String}\n */\n 'text-input',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:modelValue',\n\n /**\n * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n\n /**\n * \"Edit link\" button was clicked. Fires an event for the consuming component to handle the editing of the link.\n * event contains the link object with two properties href and text.\n * @event edit-link\n * @type {Object}\n */\n 'edit-link',\n\n /**\n * \"Selected\" event is fired when the user selects text in the editor. returns the currently selected text.\n * If the selected text is partially a link, the full link text is returned.\n * @event selected\n * @type {String}\n */\n 'selected',\n ],\n\n data () {\n return {\n editor: null,\n tippyOptions: {\n appendTo: () => this.$refs.editor.$el.getRootNode()?.querySelector('body'),\n placement: 'top-start',\n },\n };\n },\n\n computed: {\n attrs () {\n return {\n ...this.$attrs,\n onInput: () => {},\n onFocus: () => {},\n onBlur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History, HardBreak];\n\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem.extend({\n renderText ({ node }) {\n return node.textContent;\n },\n }));\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n const self = this;\n const ShiftEnter = Extension.create({\n addKeyboardShortcuts () {\n return {\n 'Shift-Enter': ({ editor }) => {\n if (self.allowLineBreaks) {\n return false;\n }\n editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => self.allowBulletList && commands.splitListItem('listItem'),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]);\n return true;\n },\n Enter: () => {\n if (self.allowLineBreaks) {\n return false;\n }\n self.$emit('enter');\n return true;\n },\n };\n },\n });\n extensions.push(ShiftEnter);\n\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n openOnClick: false,\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCode) {\n extensions.push(Code);\n }\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.extend({\n renderText ({ node }) {\n return `\\`\\`\\`\\n${node.textContent}\\n\\`\\`\\``;\n },\n }).configure({\n HTMLAttributes: {\n class: 'd-rich-text-editor__code-block',\n },\n }));\n }\n\n if (this.allowInlineImages) {\n extensions.push(ConfigurableImage);\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n modelValue (newValue) {\n this.processValue(newValue);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n this.processValue(this.modelValue, false);\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.modelValue,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n // Moves the <br /> tags inside the previous closing tag to avoid\n // Prosemirror wrapping them within another </p> tag.\n transformPastedHTML (html) {\n return html.replace(/(<\\/\\w+>)((<br \\/>)+)/g, '$2$3$1');\n },\n },\n });\n this.addEditorListeners();\n },\n\n bubbleMenuShouldShow ({ editor, view, state, oldState, from, to }) {\n return editor.isActive('link');\n },\n\n /**\n * If the selection contains a link, return the existing link text.\n * Otherwise, use just the selected text.\n * @param editor the editor instance.\n */\n getSelectedLinkText (editor) {\n const { view, state } = editor;\n const { from, to } = view.state.selection;\n const text = state.doc.textBetween(from, to, '');\n const linkNode = this.editor.state.doc.nodeAt(from);\n if (linkNode && linkNode.marks?.at(0)?.type?.name === 'link') {\n return linkNode.textContent;\n } else {\n return text;\n }\n },\n\n editLink () {\n const linkText = this.getSelectedLinkText(this.editor);\n\n const link = {\n href: this.editor.getAttributes('link').href,\n text: linkText,\n };\n this.$emit('edit-link', link);\n },\n\n removeLink () {\n this.editor?.chain()?.focus()?.unsetLink()?.run();\n },\n\n openLink () {\n this.editor?.chain()?.focus();\n const link = this.editor.getAttributes('link').href;\n window.open(link, '_blank');\n },\n\n // eslint-disable-next-line complexity\n setLink (linkInput, linkText, linkOptions, linkProtocols = RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n defaultPrefix) {\n if (!linkInput) {\n // If link text is set to empty string,\n // remove any existing links.\n this.removeLink();\n return;\n }\n\n // Check if input matches any of the supported link formats\n const prefix = linkProtocols.find(prefixRegex => prefixRegex.test(linkInput));\n\n if (!prefix) {\n // If no matching pattern is found, prepend default prefix\n linkInput = `${defaultPrefix}${linkInput}`;\n }\n\n this.editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .run();\n\n const selection = this.editor?.view?.state?.selection;\n\n this.editor\n .chain()\n .focus()\n .insertContent(linkText)\n .setTextSelection({ from: selection.from, to: selection.from + linkText.length })\n .setLink({ href: linkInput, class: linkOptions.class })\n .run();\n },\n\n // eslint-disable-next-line complexity\n processValue (newValue, returnIfEqual = true) {\n const currentValue = this.getOutput();\n\n if (returnIfEqual && deepEqual(newValue, currentValue)) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n\n // If the text contains emoji characters convert them to emoji component tags\n if (typeof newValue === 'string' && this.outputFormat === 'text') {\n const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, 'g');\n newValue = newValue?.replace(inputUnicodeRegex, '<emoji-component code=\"$1\"></emoji-component>');\n }\n\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n triggerInputChangeEvents () {\n const value = this.getOutput();\n this.$emit('input', value);\n this.$emit('update:modelValue', value);\n\n // Always output JSON in a separate event\n const jsonValue = this.editor.getJSON();\n this.$emit('json-input', jsonValue);\n\n // Always output HTML in a separate event\n const htmlValue = this.editor.getHTML();\n this.$emit('html-input', htmlValue);\n\n // Always output HTML in a separate event\n const textValue = this.editor.getText({ blockSeparator: '\\n' });\n this.$emit('text-input', textValue);\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n this.editor.on('create', () => {\n this.triggerInputChangeEvents();\n });\n // The content has changed.\n this.editor.on('update', () => {\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.triggerInputChangeEvents();\n });\n\n this.editor.on('selectionUpdate', ({ editor }) => {\n this.$emit('selected', this.getSelectedLinkText(editor));\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText({ blockSeparator: '\\n' });\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n ...attributes,\n },\n },\n });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n"],"names":["_createElementBlock","_createBlock","_withCtx","_createElementVNode","_createVNode","_createTextVNode","_createCommentVNode","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,UAAU;AAAA,MACR,MAAM;AAAA,MAC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AAAA,MA1ClB,KAAA;AAAA,MAQO,QAAQ,MAAM;AAAA,MACd,eAAa,SAAoB;AAAA,MACjC,iBAAe,MAAY;AAAA,MAC5B,OAAA,EAA4B,cAAA,UAAA;AAAA;MAXlC,SAAAC,QAaM,MA4BM;AAAA,QA5BNC,mBA4BM,OA5BN,YA4BM;AAAA,UA3BJC,YA0BW,qBAAA;AAAA,YAzBT,WAAU;AAAA,YACV,OAAM;AAAA,YACN,KAAI;AAAA;YAjBd,SAAAF,QAmBU,MAMY;AAAA,cANZE,YAMY,sBAAA;AAAA,gBALV,MAAK;AAAA,gBACL,YAAW;AAAA,gBACV,SAAO,SAAQ;AAAA;gBAtB5B,SAAAF,QAuBW,MAED;AAAA,kBAzBVG,gBAuBW,QAED;AAAA;gBAzBV,GAAA;AAAA;cA0BUD,YAMY,sBAAA;AAAA,gBALV,MAAK;AAAA,gBACL,YAAW;AAAA,gBACV,SAAO,SAAQ;AAAA;gBA7B5B,SAAAF,QA8BW,MAED;AAAA,kBAhCVG,gBA8BW,aAED;AAAA;gBAhCV,GAAA;AAAA;cAiCUD,YAMY,sBAAA;AAAA,gBALV,MAAK;AAAA,gBACL,YAAW;AAAA,gBACV,SAAO,SAAU;AAAA;gBApC9B,SAAAF,QAqCW,MAED;AAAA,kBAvCVG,gBAqCW,UAED;AAAA;gBAvCV,GAAA;AAAA;;YAAA,GAAA;AAAA;;;MAAA,GAAA;AAAA,yDAAAC,mBAAA,IAAA,IAAA;AAAA,IA2CIF,YAME,2BANFG,WAME;AAAA,MALA,KAAI;AAAA,MACH,QAAQ,MAAM;AAAA,MACf,OAAM;AAAA,MACN,WAAQ;AAAA,OACA,SAAK,KAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA;AAAA;;;"}
@@ -747,6 +747,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
747
747
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.internalInputValue = $event),
748
748
  "allow-inline-images": true,
749
749
  "allow-line-breaks": true,
750
+ "hide-link-bubble-menu": true,
750
751
  "auto-focus": $props.autoFocus,
751
752
  editable: $props.editable,
752
753
  "input-aria-label": $props.inputAriaLabel,