@dialpad/dialtone 9.96.0 → 9.98.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 (126) 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/css/tokens/tokens-base-deca-dark.css +293 -391
  6. package/dist/css/tokens/tokens-base-deca-light.css +284 -382
  7. package/dist/css/tokens/tokens-deca-dark.css +1001 -966
  8. package/dist/css/tokens/tokens-deca-light.css +731 -696
  9. package/dist/tokens/css/tokens-base-deca-dark.css +293 -391
  10. package/dist/tokens/css/tokens-base-deca-light.css +284 -382
  11. package/dist/tokens/css/tokens-deca-dark.css +1001 -966
  12. package/dist/tokens/css/tokens-deca-light.css +731 -696
  13. package/dist/tokens/doc.json +31965 -32211
  14. package/dist/tokens/less/tokens-base-deca-dark.less +77 -91
  15. package/dist/tokens/less/tokens-base-deca-light.less +75 -89
  16. package/dist/tokens/less/tokens-deca-dark.less +225 -220
  17. package/dist/tokens/less/tokens-deca-light.less +229 -224
  18. package/dist/tokens/themes/dp-deca-dark.cjs +1 -1
  19. package/dist/tokens/themes/dp-deca-dark.js +1 -1
  20. package/dist/tokens/themes/dp-deca-light.cjs +1 -1
  21. package/dist/tokens/themes/dp-deca-light.js +1 -1
  22. package/dist/tokens/tokens-base-deca-dark.json +77 -91
  23. package/dist/tokens/tokens-base-deca-light.json +75 -89
  24. package/dist/tokens/tokens-deca-dark.json +224 -219
  25. package/dist/tokens/tokens-deca-light.json +229 -224
  26. package/dist/vue2/component-documentation.json +1 -1
  27. package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +2 -2
  28. package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.js +2 -2
  29. package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map +1 -1
  30. package/dist/vue2/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map +1 -1
  31. package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map +1 -1
  32. package/dist/vue2/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map +1 -1
  33. package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs +160 -17
  34. package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
  35. package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js +161 -18
  36. package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
  37. package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs +1 -1
  38. package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
  39. package/dist/vue2/recipes/conversation_view/editor/editor.vue.js +1 -1
  40. package/dist/vue2/recipes/conversation_view/editor/editor.vue.js.map +1 -1
  41. package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.cjs +87 -0
  42. package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.cjs.map +1 -0
  43. package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.js +87 -0
  44. package/dist/vue2/recipes/conversation_view/message_input/last_active_nodes.js.map +1 -0
  45. package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs +229 -46
  46. package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
  47. package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js +229 -46
  48. package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
  49. package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.cjs +58 -0
  50. package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.cjs.map +1 -0
  51. package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.js +58 -0
  52. package/dist/vue2/recipes/conversation_view/message_input/message_input_button.vue.js.map +1 -0
  53. package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.cjs +108 -0
  54. package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.cjs.map +1 -0
  55. package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.js +108 -0
  56. package/dist/vue2/recipes/conversation_view/message_input/message_input_link.vue.js.map +1 -0
  57. package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.cjs +106 -0
  58. package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.cjs.map +1 -0
  59. package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.js +106 -0
  60. package/dist/vue2/recipes/conversation_view/message_input/message_input_topbar.vue.js.map +1 -0
  61. package/dist/vue2/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
  62. package/dist/vue2/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts.map +1 -1
  63. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +37 -1
  64. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  65. package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  66. package/dist/vue2/types/recipes/conversation_view/message_input/last_active_nodes.d.ts +3 -0
  67. package/dist/vue2/types/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +1 -0
  68. package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +183 -60
  69. package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  70. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +48 -0
  71. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -0
  72. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +38 -0
  73. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -0
  74. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +87 -0
  75. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -0
  76. package/dist/vue3/component-documentation.json +1 -1
  77. package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +2 -2
  78. package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.js +2 -2
  79. package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.cjs.map +1 -1
  80. package/dist/vue3/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.js.map +1 -1
  81. package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.cjs.map +1 -1
  82. package/dist/vue3/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.js.map +1 -1
  83. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs +223 -21
  84. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
  85. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js +225 -23
  86. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
  87. package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs +1 -0
  88. package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
  89. package/dist/vue3/recipes/conversation_view/editor/editor.vue.js +1 -0
  90. package/dist/vue3/recipes/conversation_view/editor/editor.vue.js.map +1 -1
  91. package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.cjs +87 -0
  92. package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.cjs.map +1 -0
  93. package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.js +87 -0
  94. package/dist/vue3/recipes/conversation_view/message_input/last_active_nodes.js.map +1 -0
  95. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs +279 -65
  96. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
  97. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js +280 -66
  98. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
  99. package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.cjs +81 -0
  100. package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.cjs.map +1 -0
  101. package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.js +81 -0
  102. package/dist/vue3/recipes/conversation_view/message_input/message_input_button.vue.js.map +1 -0
  103. package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.cjs +193 -0
  104. package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.cjs.map +1 -0
  105. package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.js +193 -0
  106. package/dist/vue3/recipes/conversation_view/message_input/message_input_link.vue.js.map +1 -0
  107. package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.cjs +223 -0
  108. package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.cjs.map +1 -0
  109. package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.js +223 -0
  110. package/dist/vue3/recipes/conversation_view/message_input/message_input_topbar.vue.js.map +1 -0
  111. package/dist/vue3/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
  112. package/dist/vue3/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts.map +1 -1
  113. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +42 -1
  114. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  115. package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  116. package/dist/vue3/types/recipes/conversation_view/message_input/last_active_nodes.d.ts +3 -0
  117. package/dist/vue3/types/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +1 -0
  118. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +185 -61
  119. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  120. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +50 -0
  121. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -0
  122. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +42 -0
  123. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -0
  124. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +89 -0
  125. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -0
  126. package/package.json +7 -4
@@ -95,6 +95,6 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default(
95
95
  _sfc_render,
96
96
  _sfc_staticRenderFns
97
97
  );
98
- const keyboard_shortcut = __component__.exports;
99
- exports.default = keyboard_shortcut;
98
+ const DtKeyboardShortcut = __component__.exports;
99
+ exports.default = DtKeyboardShortcut;
100
100
  //# sourceMappingURL=keyboard_shortcut.vue.cjs.map
@@ -93,8 +93,8 @@ var __component__ = /* @__PURE__ */ normalizeComponent(
93
93
  _sfc_render,
94
94
  _sfc_staticRenderFns
95
95
  );
96
- const keyboard_shortcut = __component__.exports;
96
+ const DtKeyboardShortcut = __component__.exports;
97
97
  export {
98
- keyboard_shortcut as default
98
+ DtKeyboardShortcut as default
99
99
  };
100
100
  //# sourceMappingURL=keyboard_shortcut.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MentionSuggestion.vue.cjs","sources":["../../../../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue"],"sourcesContent":["<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-avatar\n :full-name=\"name\"\n :image-src=\"avatarSrc\"\n :image-alt=\"name\"\n size=\"xs\"\n />\n <span class=\"d-mention-suggestion__name\">\n {{ name }}\n </span>\n </dt-stack>\n</template>\n\n<script>\nimport { DtAvatar } from '@/components/avatar';\nimport { DtStack } from '@/components/stack';\n\nexport default {\n name: 'MentionSuggestion',\n components: {\n DtAvatar,\n DtStack,\n },\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n name () {\n return this.item.name;\n },\n\n avatarSrc () {\n return this.item.avatarSrc;\n },\n },\n};\n</script>\n"],"names":["DtAvatar","DtStack"],"mappings":";;;;;AAqBA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAA,OAAA;AAAA,IACA,SAAAC,MAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"MentionSuggestion.vue.cjs","sources":["../../../../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue"],"sourcesContent":["<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-avatar\n :full-name=\"name\"\n :image-src=\"avatarSrc\"\n :image-alt=\"name\"\n size=\"xs\"\n />\n <!-- eslint-disable-next-line vue/no-restricted-class -->\n <span class=\"d-mention-suggestion__name\">\n {{ name }}\n </span>\n </dt-stack>\n</template>\n\n<script>\nimport { DtAvatar } from '@/components/avatar';\nimport { DtStack } from '@/components/stack';\n\nexport default {\n name: 'MentionSuggestion',\n components: {\n DtAvatar,\n DtStack,\n },\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n name () {\n return this.item.name;\n },\n\n avatarSrc () {\n return this.item.avatarSrc;\n },\n },\n};\n</script>\n"],"names":["DtAvatar","DtStack"],"mappings":";;;;;AAsBA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAA,OAAA;AAAA,IACA,SAAAC,MAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MentionSuggestion.vue.js","sources":["../../../../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue"],"sourcesContent":["<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-avatar\n :full-name=\"name\"\n :image-src=\"avatarSrc\"\n :image-alt=\"name\"\n size=\"xs\"\n />\n <span class=\"d-mention-suggestion__name\">\n {{ name }}\n </span>\n </dt-stack>\n</template>\n\n<script>\nimport { DtAvatar } from '@/components/avatar';\nimport { DtStack } from '@/components/stack';\n\nexport default {\n name: 'MentionSuggestion',\n components: {\n DtAvatar,\n DtStack,\n },\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n name () {\n return this.item.name;\n },\n\n avatarSrc () {\n return this.item.avatarSrc;\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;AAqBA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"MentionSuggestion.vue.js","sources":["../../../../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue"],"sourcesContent":["<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-avatar\n :full-name=\"name\"\n :image-src=\"avatarSrc\"\n :image-alt=\"name\"\n size=\"xs\"\n />\n <!-- eslint-disable-next-line vue/no-restricted-class -->\n <span class=\"d-mention-suggestion__name\">\n {{ name }}\n </span>\n </dt-stack>\n</template>\n\n<script>\nimport { DtAvatar } from '@/components/avatar';\nimport { DtStack } from '@/components/stack';\n\nexport default {\n name: 'MentionSuggestion',\n components: {\n DtAvatar,\n DtStack,\n },\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n name () {\n return this.item.name;\n },\n\n avatarSrc () {\n return this.item.avatarSrc;\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;AAsBA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,KAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SuggestionList.vue.cjs","sources":["../../../../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue"],"sourcesContent":["<template>\n <div class=\"d-popover__dialog d-suggestion-list__container\">\n <ul\n v-show=\"items.length\"\n ref=\"suggestionList\"\n class=\"d-suggestion-list\"\n >\n <dt-list-item\n v-for=\"(item, index) in items\"\n :key=\"item.id\"\n :class=\"[\n 'd-suggestion-list__item',\n { 'd-list-item--highlighted': index === selectedIndex },\n ]\"\n navigation-type=\"arrow-keys\"\n @click=\"selectItem(index)\"\n @keydown.prevent=\"onKeyDown\"\n >\n <component\n :is=\"itemComponent\"\n :item=\"item\"\n />\n </dt-list-item>\n </ul>\n </div>\n</template>\n\n<script>\nimport { DtListItem } from '@/components/list_item';\n\nexport default {\n name: 'SuggestionList',\n components: {\n DtListItem,\n },\n\n props: {\n items: {\n type: Array,\n required: true,\n },\n\n command: {\n type: Function,\n required: true,\n },\n\n itemComponent: {\n type: Object,\n required: true,\n },\n\n itemType: {\n type: String,\n required: true,\n },\n },\n\n data () {\n return {\n selectedIndex: 0,\n };\n },\n\n watch: {\n items () {\n this.selectedIndex = 0;\n },\n },\n\n methods: {\n onKeyDown ({ event }) {\n if (event.key === 'ArrowUp') {\n this.upHandler();\n return true;\n }\n\n if (event.key === 'ArrowDown') {\n this.downHandler();\n return true;\n }\n\n if (event.key === 'Enter' || event.key === 'Tab') {\n this.selectHandler();\n return true;\n }\n\n return false;\n },\n\n upHandler () {\n this.selectedIndex = ((this.selectedIndex + this.items.length) - 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n downHandler () {\n this.selectedIndex = (this.selectedIndex + 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n async scrollActiveElementIntoView () {\n await this.$nextTick();\n const activeElement = this.$refs.suggestionList.querySelector('.d-list-item--highlighted');\n if (activeElement) {\n activeElement.scrollIntoView({\n behaviour: 'smooth',\n block: 'center',\n });\n }\n },\n\n selectHandler () {\n this.selectItem(this.selectedIndex);\n },\n\n selectItem (index) {\n const item = this.items[index];\n\n switch (this.itemType) {\n case 'emoji':\n this.command(item);\n return;\n case 'mention':\n this.command({ name: item.name, id: item.id, avatarSrc: item.avatarSrc });\n break;\n case 'channel':\n this.command({ name: item.name, id: item.id });\n break;\n case 'slash-command':\n this.command({ command: item.command });\n break;\n }\n },\n },\n};\n</script>\n"],"names":["DtListItem"],"mappings":";;;;AA8BA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,YAAAA,UAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,eAAA;AAAA,MACA,MAAA;AAAA,MACA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A,QACA,KAAA;AACA,eAAA,QAAA,EAAA,MAAA,KAAA,MAAA,IAAA,KAAA,GAAA,CAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,SAAA,KAAA,QAAA,CAAA;AACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SuggestionList.vue.cjs","sources":["../../../../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div class=\"d-popover__dialog d-suggestion-list__container\">\n <ul\n v-show=\"items.length\"\n ref=\"suggestionList\"\n class=\"d-suggestion-list\"\n >\n <dt-list-item\n v-for=\"(item, index) in items\"\n :key=\"item.id\"\n :class=\"[\n 'd-suggestion-list__item',\n { 'd-list-item--highlighted': index === selectedIndex },\n ]\"\n navigation-type=\"arrow-keys\"\n @click=\"selectItem(index)\"\n @keydown.prevent=\"onKeyDown\"\n >\n <component\n :is=\"itemComponent\"\n :item=\"item\"\n />\n </dt-list-item>\n </ul>\n </div>\n</template>\n\n<script>\nimport { DtListItem } from '@/components/list_item';\n\nexport default {\n name: 'SuggestionList',\n components: {\n DtListItem,\n },\n\n props: {\n items: {\n type: Array,\n required: true,\n },\n\n command: {\n type: Function,\n required: true,\n },\n\n itemComponent: {\n type: Object,\n required: true,\n },\n\n itemType: {\n type: String,\n required: true,\n },\n },\n\n data () {\n return {\n selectedIndex: 0,\n };\n },\n\n watch: {\n items () {\n this.selectedIndex = 0;\n },\n },\n\n methods: {\n onKeyDown ({ event }) {\n if (event.key === 'ArrowUp') {\n this.upHandler();\n return true;\n }\n\n if (event.key === 'ArrowDown') {\n this.downHandler();\n return true;\n }\n\n if (event.key === 'Enter' || event.key === 'Tab') {\n this.selectHandler();\n return true;\n }\n\n return false;\n },\n\n upHandler () {\n this.selectedIndex = ((this.selectedIndex + this.items.length) - 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n downHandler () {\n this.selectedIndex = (this.selectedIndex + 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n async scrollActiveElementIntoView () {\n await this.$nextTick();\n const activeElement = this.$refs.suggestionList.querySelector('.d-list-item--highlighted');\n if (activeElement) {\n activeElement.scrollIntoView({\n behaviour: 'smooth',\n block: 'center',\n });\n }\n },\n\n selectHandler () {\n this.selectItem(this.selectedIndex);\n },\n\n selectItem (index) {\n const item = this.items[index];\n\n switch (this.itemType) {\n case 'emoji':\n this.command(item);\n return;\n case 'mention':\n this.command({ name: item.name, id: item.id, avatarSrc: item.avatarSrc });\n break;\n case 'channel':\n this.command({ name: item.name, id: item.id });\n break;\n case 'slash-command':\n this.command({ command: item.command });\n break;\n }\n },\n },\n};\n</script>\n"],"names":["DtListItem"],"mappings":";;;;AA+BA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,YAAAA,UAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,eAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,QAAA;AACA,WAAA,gBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,UAAA,EAAA,SAAA;AACA,UAAA,MAAA,QAAA,WAAA;AACA,aAAA,UAAA;AACA,eAAA;AAAA,MACA;AAEA,UAAA,MAAA,QAAA,aAAA;AACA,aAAA,YAAA;AACA,eAAA;AAAA,MACA;AAEA,UAAA,MAAA,QAAA,WAAA,MAAA,QAAA,OAAA;AACA,aAAA,cAAA;AACA,eAAA;AAAA,MACA;AAEA,aAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,WAAA,iBAAA,KAAA,gBAAA,KAAA,MAAA,SAAA,KAAA,KAAA,MAAA;AAEA,WAAA,4BAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,iBAAA,KAAA,gBAAA,KAAA,KAAA,MAAA;AAEA,WAAA,4BAAA;AAAA,IACA;AAAA,IAEA,MAAA,8BAAA;AACA,YAAA,KAAA;AACA,YAAA,gBAAA,KAAA,MAAA,eAAA,cAAA,2BAAA;AACA,UAAA,eAAA;AACA,sBAAA,eAAA;AAAA,UACA,WAAA;AAAA,UACA,OAAA;AAAA,QACA,CAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,WAAA,KAAA,aAAA;AAAA,IACA;AAAA,IAEA,WAAA,OAAA;AACA,YAAA,OAAA,KAAA,MAAA,KAAA;AAEA,cAAA,KAAA,UAAA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,IAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,MAAA,KAAA,MAAA,IAAA,KAAA,IAAA,WAAA,KAAA,UAAA,CAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,MAAA,KAAA,MAAA,IAAA,KAAA,GAAA,CAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,SAAA,KAAA,QAAA,CAAA;AACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SuggestionList.vue.js","sources":["../../../../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue"],"sourcesContent":["<template>\n <div class=\"d-popover__dialog d-suggestion-list__container\">\n <ul\n v-show=\"items.length\"\n ref=\"suggestionList\"\n class=\"d-suggestion-list\"\n >\n <dt-list-item\n v-for=\"(item, index) in items\"\n :key=\"item.id\"\n :class=\"[\n 'd-suggestion-list__item',\n { 'd-list-item--highlighted': index === selectedIndex },\n ]\"\n navigation-type=\"arrow-keys\"\n @click=\"selectItem(index)\"\n @keydown.prevent=\"onKeyDown\"\n >\n <component\n :is=\"itemComponent\"\n :item=\"item\"\n />\n </dt-list-item>\n </ul>\n </div>\n</template>\n\n<script>\nimport { DtListItem } from '@/components/list_item';\n\nexport default {\n name: 'SuggestionList',\n components: {\n DtListItem,\n },\n\n props: {\n items: {\n type: Array,\n required: true,\n },\n\n command: {\n type: Function,\n required: true,\n },\n\n itemComponent: {\n type: Object,\n required: true,\n },\n\n itemType: {\n type: String,\n required: true,\n },\n },\n\n data () {\n return {\n selectedIndex: 0,\n };\n },\n\n watch: {\n items () {\n this.selectedIndex = 0;\n },\n },\n\n methods: {\n onKeyDown ({ event }) {\n if (event.key === 'ArrowUp') {\n this.upHandler();\n return true;\n }\n\n if (event.key === 'ArrowDown') {\n this.downHandler();\n return true;\n }\n\n if (event.key === 'Enter' || event.key === 'Tab') {\n this.selectHandler();\n return true;\n }\n\n return false;\n },\n\n upHandler () {\n this.selectedIndex = ((this.selectedIndex + this.items.length) - 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n downHandler () {\n this.selectedIndex = (this.selectedIndex + 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n async scrollActiveElementIntoView () {\n await this.$nextTick();\n const activeElement = this.$refs.suggestionList.querySelector('.d-list-item--highlighted');\n if (activeElement) {\n activeElement.scrollIntoView({\n behaviour: 'smooth',\n block: 'center',\n });\n }\n },\n\n selectHandler () {\n this.selectItem(this.selectedIndex);\n },\n\n selectItem (index) {\n const item = this.items[index];\n\n switch (this.itemType) {\n case 'emoji':\n this.command(item);\n return;\n case 'mention':\n this.command({ name: item.name, id: item.id, avatarSrc: item.avatarSrc });\n break;\n case 'channel':\n this.command({ name: item.name, id: item.id });\n break;\n case 'slash-command':\n this.command({ command: item.command });\n break;\n }\n },\n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A,IAEA,gBAAA;AACA,WAAA,WAAA,KAAA,aAAA;AAAA,IACA;AAAA,IAEA,WAAA,OAAA;AACA,YAAA,OAAA,KAAA,MAAA,KAAA;AAEA,cAAA,KAAA,UAAA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,IAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,MAAA,KAAA,MAAA,IAAA,KAAA,IAAA,WAAA,KAAA,UAAA,CAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,MAAA,KAAA,MAAA,IAAA,KAAA,GAAA,CAAA;AACA;AAAA,QACA,KAAA;AACA,eAAA,QAAA,EAAA,SAAA,KAAA,QAAA,CAAA;AACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SuggestionList.vue.js","sources":["../../../../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div class=\"d-popover__dialog d-suggestion-list__container\">\n <ul\n v-show=\"items.length\"\n ref=\"suggestionList\"\n class=\"d-suggestion-list\"\n >\n <dt-list-item\n v-for=\"(item, index) in items\"\n :key=\"item.id\"\n :class=\"[\n 'd-suggestion-list__item',\n { 'd-list-item--highlighted': index === selectedIndex },\n ]\"\n navigation-type=\"arrow-keys\"\n @click=\"selectItem(index)\"\n @keydown.prevent=\"onKeyDown\"\n >\n <component\n :is=\"itemComponent\"\n :item=\"item\"\n />\n </dt-list-item>\n </ul>\n </div>\n</template>\n\n<script>\nimport { DtListItem } from '@/components/list_item';\n\nexport default {\n name: 'SuggestionList',\n components: {\n DtListItem,\n },\n\n props: {\n items: {\n type: Array,\n required: true,\n },\n\n command: {\n type: Function,\n required: true,\n },\n\n itemComponent: {\n type: Object,\n required: true,\n },\n\n itemType: {\n type: String,\n required: true,\n },\n },\n\n data () {\n return {\n selectedIndex: 0,\n };\n },\n\n watch: {\n items () {\n this.selectedIndex = 0;\n },\n },\n\n methods: {\n onKeyDown ({ event }) {\n if (event.key === 'ArrowUp') {\n this.upHandler();\n return true;\n }\n\n if (event.key === 'ArrowDown') {\n this.downHandler();\n return true;\n }\n\n if (event.key === 'Enter' || event.key === 'Tab') {\n this.selectHandler();\n return true;\n }\n\n return false;\n },\n\n upHandler () {\n this.selectedIndex = ((this.selectedIndex + this.items.length) - 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n downHandler () {\n this.selectedIndex = (this.selectedIndex + 1) % this.items.length;\n\n this.scrollActiveElementIntoView();\n },\n\n async scrollActiveElementIntoView () {\n await this.$nextTick();\n const activeElement = this.$refs.suggestionList.querySelector('.d-list-item--highlighted');\n if (activeElement) {\n activeElement.scrollIntoView({\n behaviour: 'smooth',\n block: 'center',\n });\n }\n },\n\n selectHandler () {\n this.selectItem(this.selectedIndex);\n },\n\n selectItem (index) {\n const item = this.items[index];\n\n switch (this.itemType) {\n case 'emoji':\n this.command(item);\n return;\n case 'mention':\n this.command({ name: item.name, id: item.id, avatarSrc: item.avatarSrc });\n break;\n case 'channel':\n this.command({ name: item.name, id: item.id });\n break;\n case 'slash-command':\n this.command({ command: item.command });\n break;\n }\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;AA+BA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,eAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IAC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ACA;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,7 @@ const vue2 = require("@tiptap/vue-2");
4
4
  const core = require("@tiptap/core");
5
5
  const Blockquote = require("@tiptap/extension-blockquote");
6
6
  const CodeBlock = require("@tiptap/extension-code-block");
7
+ const Code = require("@tiptap/extension-code");
7
8
  const Document = require("@tiptap/extension-document");
8
9
  const Paragraph = require("@tiptap/extension-paragraph");
9
10
  const Placeholder = require("@tiptap/extension-placeholder");
@@ -31,11 +32,17 @@ const suggestion = require("./extensions/mentions/suggestion.cjs");
31
32
  const suggestion$1 = require("./extensions/channels/suggestion.cjs");
32
33
  const suggestion$2 = require("./extensions/slash_command/suggestion.cjs");
33
34
  const common_utils = require("../../common/utils.cjs");
35
+ const deepEqual = require("deep-equal");
34
36
  const _pluginVue2_normalizer = require("../../_virtual/_plugin-vue2_normalizer.cjs");
37
+ const button = require("../button/button.vue.cjs");
38
+ const stack = require("../stack/stack.vue.cjs");
35
39
  const _sfc_main = {
36
40
  name: "DtRichTextEditor",
37
41
  components: {
38
- EditorContent: vue2.EditorContent
42
+ EditorContent: vue2.EditorContent,
43
+ BubbleMenu: vue2.BubbleMenu,
44
+ DtButton: button.default,
45
+ DtStack: stack.default
39
46
  },
40
47
  props: {
41
48
  /**
@@ -239,6 +246,13 @@ const _sfc_main = {
239
246
  type: Boolean,
240
247
  default: true
241
248
  },
249
+ /**
250
+ * Whether the input allows inline code (wrapped in backticks).
251
+ */
252
+ allowCode: {
253
+ type: Boolean,
254
+ default: true
255
+ },
242
256
  /**
243
257
  * Whether the input allows codeblock to be introduced in the text.
244
258
  */
@@ -259,6 +273,15 @@ const _sfc_main = {
259
273
  additionalExtensions: {
260
274
  type: Array,
261
275
  default: () => []
276
+ },
277
+ /**
278
+ * Manually hide the link bubble menu. The link bubble menu is shown when a link is selected via the cursor.
279
+ * There are some cases when you may want the link to remain selected but hide the bubble menu such as when You
280
+ * are showing a custom link editor popup.
281
+ */
282
+ hideLinkBubbleMenu: {
283
+ type: Boolean,
284
+ default: false
262
285
  }
263
286
  },
264
287
  emits: [
@@ -268,6 +291,24 @@ const _sfc_main = {
268
291
  * @type {String|JSON}
269
292
  */
270
293
  "input",
294
+ /**
295
+ * Input event always in JSON format.
296
+ * @event input
297
+ * @type {JSON}
298
+ */
299
+ "json-input",
300
+ /**
301
+ * Input event always in HTML format.
302
+ * @event input
303
+ * @type {HTML}
304
+ */
305
+ "html-input",
306
+ /**
307
+ * Input event always in text format.
308
+ * @event input
309
+ * @type {String}
310
+ */
311
+ "text-input",
271
312
  /**
272
313
  * Event to sync the value with the parent
273
314
  * @event update:value
@@ -291,11 +332,32 @@ const _sfc_main = {
291
332
  * @event enter
292
333
  * @type {String}
293
334
  */
294
- "enter"
335
+ "enter",
336
+ /**
337
+ * "Edit link" button was clicked. Fires an event for the consuming component to handle the editing of the link.
338
+ * event contains the link object with two properties href and text.
339
+ * @event edit-link
340
+ * @type {Object}
341
+ */
342
+ "edit-link",
343
+ /**
344
+ * "Selected" event is fired when the user selects text in the editor. returns the currently selected text.
345
+ * If the selected text is partially a link, the full link text is returned.
346
+ * @event selected
347
+ * @type {String}
348
+ */
349
+ "selected"
295
350
  ],
296
351
  data() {
297
352
  return {
298
- editor: null
353
+ editor: null,
354
+ tippyOptions: {
355
+ appendTo: () => {
356
+ var _a;
357
+ return (_a = this.$refs.editor.$el.getRootNode()) == null ? void 0 : _a.querySelector("body");
358
+ },
359
+ placement: "top-start"
360
+ }
299
361
  };
300
362
  },
301
363
  computed: {
@@ -321,7 +383,11 @@ const _sfc_main = {
321
383
  }
322
384
  if (this.allowBulletList) {
323
385
  extensions.push(BulletList);
324
- extensions.push(ListItem);
386
+ extensions.push(ListItem.extend({
387
+ renderText({ node }) {
388
+ return node.textContent;
389
+ }
390
+ }));
325
391
  extensions.push(OrderedList);
326
392
  }
327
393
  if (this.allowItalic) {
@@ -371,6 +437,7 @@ const _sfc_main = {
371
437
  HTMLAttributes: {
372
438
  class: "d-link d-wb-break-all"
373
439
  },
440
+ openOnClick: false,
374
441
  autolink: true,
375
442
  protocols: rich_text_editor_constants.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS
376
443
  }));
@@ -395,8 +462,17 @@ const _sfc_main = {
395
462
  types: ["paragraph"],
396
463
  defaultAlignment: "left"
397
464
  }));
465
+ if (this.allowCode) {
466
+ extensions.push(Code);
467
+ }
398
468
  if (this.allowCodeblock) {
399
- extensions.push(CodeBlock.configure({
469
+ extensions.push(CodeBlock.extend({
470
+ renderText({ node }) {
471
+ return `\`\`\`
472
+ ${node.textContent}
473
+ \`\`\``;
474
+ }
475
+ }).configure({
400
476
  HTMLAttributes: {
401
477
  class: "d-rich-text-editor__code-block"
402
478
  }
@@ -477,36 +553,103 @@ const _sfc_main = {
477
553
  });
478
554
  this.addEditorListeners();
479
555
  },
480
- processValue(newValue, returnIfEqual = true) {
481
- let currentValue = this.getOutput();
482
- if (this.outputFormat === "json") {
483
- newValue = JSON.stringify(newValue);
484
- currentValue = JSON.stringify(currentValue);
556
+ bubbleMenuShouldShow({ editor, view, state, oldState, from, to }) {
557
+ return editor.isActive("link");
558
+ },
559
+ /**
560
+ * If the selection contains a link, return the existing link text.
561
+ * Otherwise, use just the selected text.
562
+ * @param editor the editor instance.
563
+ */
564
+ getSelectedLinkText(editor) {
565
+ var _a, _b, _c;
566
+ const { view, state } = editor;
567
+ const { from, to } = view.state.selection;
568
+ const text = state.doc.textBetween(from, to, "");
569
+ const linkNode = this.editor.state.doc.nodeAt(from);
570
+ if (linkNode && ((_c = (_b = (_a = linkNode.marks) == null ? void 0 : _a.at(0)) == null ? void 0 : _b.type) == null ? void 0 : _c.name) === "link") {
571
+ return linkNode.textContent;
572
+ } else {
573
+ return text;
485
574
  }
486
- if (returnIfEqual && newValue === currentValue) {
575
+ },
576
+ editLink() {
577
+ const linkText = this.getSelectedLinkText(this.editor);
578
+ const link = {
579
+ href: this.editor.getAttributes("link").href,
580
+ text: linkText
581
+ };
582
+ this.$emit("edit-link", link);
583
+ },
584
+ removeLink() {
585
+ var _a, _b, _c, _d;
586
+ (_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();
587
+ },
588
+ openLink() {
589
+ var _a, _b;
590
+ (_b = (_a = this.editor) == null ? void 0 : _a.chain()) == null ? void 0 : _b.focus();
591
+ const link = this.editor.getAttributes("link").href;
592
+ window.open(link, "_blank");
593
+ },
594
+ // eslint-disable-next-line complexity
595
+ setLink(linkInput, linkText, linkOptions, linkProtocols = rich_text_editor_constants.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS, defaultPrefix) {
596
+ var _a, _b, _c;
597
+ if (!linkInput) {
598
+ this.removeLink();
599
+ return;
600
+ }
601
+ const prefix = linkProtocols.find((prefixRegex) => prefixRegex.test(linkInput));
602
+ if (!prefix) {
603
+ linkInput = `${defaultPrefix}${linkInput}`;
604
+ }
605
+ this.editor.chain().focus().extendMarkRange("link").run();
606
+ const selection = (_c = (_b = (_a = this.editor) == null ? void 0 : _a.view) == null ? void 0 : _b.state) == null ? void 0 : _c.selection;
607
+ this.editor.chain().focus().insertContent(linkText).setTextSelection({ from: selection.from, to: selection.from + linkText.length }).setLink({ href: linkInput, class: linkOptions.class }).run();
608
+ },
609
+ // eslint-disable-next-line complexity
610
+ processValue(newValue, returnIfEqual = true) {
611
+ const currentValue = this.getOutput();
612
+ if (returnIfEqual && deepEqual(newValue, currentValue)) {
487
613
  return;
488
614
  }
489
- const inputUnicodeRegex = new RegExp(`(${regexCombinedEmojis.emojiPattern})`, "g");
490
- newValue = newValue.replace(inputUnicodeRegex, '<emoji-component code="$1"></emoji-component>');
615
+ if (typeof newValue === "string" && this.outputFormat === "text") {
616
+ const inputUnicodeRegex = new RegExp(`(${regexCombinedEmojis.emojiPattern})`, "g");
617
+ newValue = newValue == null ? void 0 : newValue.replace(inputUnicodeRegex, '<emoji-component code="$1"></emoji-component>');
618
+ }
491
619
  this.editor.commands.setContent(newValue, false);
492
620
  },
493
621
  destroyEditor() {
494
622
  this.editor.destroy();
495
623
  },
624
+ triggerInputChangeEvents() {
625
+ const value = this.getOutput();
626
+ this.$emit("input", value);
627
+ this.$emit("update:value", value);
628
+ const jsonValue = this.editor.getJSON();
629
+ this.$emit("json-input", jsonValue);
630
+ const htmlValue = this.editor.getHTML();
631
+ this.$emit("html-input", htmlValue);
632
+ const textValue = this.editor.getText({ blockSeparator: "\n" });
633
+ this.$emit("text-input", textValue);
634
+ },
496
635
  /**
497
636
  * The Editor exposes event hooks that we have to map our emits into. See
498
637
  * https://tiptap.dev/api/events for all events.
499
638
  */
500
639
  addEditorListeners() {
640
+ this.editor.on("create", () => {
641
+ this.triggerInputChangeEvents();
642
+ });
501
643
  this.editor.on("update", () => {
502
644
  var _a, _b;
503
- const value = this.getOutput();
504
645
  if (this.preventTyping && ((_b = (_a = this.editor.view) == null ? void 0 : _a.input) == null ? void 0 : _b.lastKeyCode) !== 8) {
505
646
  this.editor.commands.setContent(this.value, false);
506
647
  return;
507
648
  }
508
- this.$emit("input", value);
509
- this.$emit("update:value", value);
649
+ this.triggerInputChangeEvents();
650
+ });
651
+ this.editor.on("selectionUpdate", ({ editor }) => {
652
+ this.$emit("selected", this.getSelectedLinkText(editor));
510
653
  });
511
654
  this.editor.on("focus", ({ event }) => {
512
655
  this.$emit("focus", event);
@@ -551,7 +694,7 @@ const _sfc_main = {
551
694
  };
552
695
  var _sfc_render = function render() {
553
696
  var _vm = this, _c = _vm._self._c;
554
- return _c("editor-content", _vm._g({ staticClass: "d-rich-text-editor", attrs: { "editor": _vm.editor, "data-qa": "dt-rich-text-editor" } }, _vm.editorListeners));
697
+ return _c("div", [_vm.editor && _vm.link && !_vm.hideLinkBubbleMenu ? _c("bubble-menu", { staticStyle: { "visibility": "visible" }, attrs: { "editor": _vm.editor, "should-show": _vm.bubbleMenuShouldShow, "tippy-options": _vm.tippyOptions } }, [_c("div", { staticClass: "d-popover__dialog" }, [_c("dt-stack", { staticClass: "d-rich-text-editor-bubble-menu__button-stack", attrs: { "direction": "row", "gap": "0" } }, [_c("dt-button", { attrs: { "kind": "muted", "importance": "clear" }, on: { "click": _vm.editLink } }, [_vm._v(" Edit ")]), _c("dt-button", { attrs: { "kind": "muted", "importance": "clear" }, on: { "click": _vm.openLink } }, [_vm._v(" Open link ")]), _c("dt-button", { attrs: { "kind": "danger", "importance": "clear" }, on: { "click": _vm.removeLink } }, [_vm._v(" Remove ")])], 1)], 1)]) : _vm._e(), _c("editor-content", _vm._g({ ref: "editor", staticClass: "d-rich-text-editor", attrs: { "editor": _vm.editor, "data-qa": "dt-rich-text-editor" } }, _vm.editorListeners))], 1);
555
698
  };
556
699
  var _sfc_staticRenderFns = [];
557
700
  var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default(
@@ -1 +1 @@
1
- {"version":3,"file":"rich_text_editor.vue.cjs","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-on=\"editorListeners\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\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 Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport HardBreak from '@tiptap/extension-hard-break';\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 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 * 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:value',\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 editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\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 value (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.value, 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.value,\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:value', 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":["EditorContent","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_OUTPUT_FORMATS","Extension","RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS","CustomLink","mentionSuggestion","MentionPlugin","channelSuggestion","ChannelPlugin","slashCommandSuggestion","SlashCommandPlugin","Emoji","ConfigurableImage","warnIfUnmounted","Editor","emojiPattern"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,eAAAA,KAAA;AAAA,EACA;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,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,M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;AAAA,MACA;AAAA,IACA;AAAA,IAEA,aAAA,WAAA,SAAA;;AACA,UAAA,OAAA,YAAA,WAAA;AACA,eAAA;AAAA,MACA;AACA,cAAA,eAAA,cAAA,mCAAA;AAAA,IACA;AAAA,IAEA,uBAAA,YAAA;AACA,WAAA,OAAA,WAAA;AAAA,QACA,aAAA;AAAA,UACA,YAAA;AAAA,YACA,GAAA,KAAA;AAAA,YACA,OAAA,KAAA;AAAA,YACA,GAAA;AAAA,UACA;AAAA,QACA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rich_text_editor.vue.cjs","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-on=\"editorListeners\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-2';\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 Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport HardBreak from '@tiptap/extension-hard-break';\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 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 * 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:value',\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 editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\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 value (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.value, 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.value,\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:value', 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":["EditorContent","BubbleMenu","DtButton","DtStack","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_OUTPUT_FORMATS","Extension","RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS","CustomLink","mentionSuggestion","MentionPlugin","channelSuggestion","ChannelPlugin","slashCommandSuggestion","SlashCommandPlugin","Emoji","ConfigurableImage","warnIfUnmounted","Editor","emojiPattern"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,eAAAA,KAAA;AAAA,IACA,YAAAC,KAAA;AAAA,IACA,UAAAC,OAAA;AAAA,IACA,SA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