@dialpad/dialtone 9.34.1 → 9.34.2

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.
@@ -7480,7 +7480,7 @@ body {
7480
7480
  }
7481
7481
  /**
7482
7482
  * Do not edit directly
7483
- * Generated on Mon, 06 May 2024 17:50:27 GMT
7483
+ * Generated on Tue, 07 May 2024 22:12:36 GMT
7484
7484
  */
7485
7485
 
7486
7486
  .dialtone-theme-light {
@@ -8297,7 +8297,7 @@ body {
8297
8297
 
8298
8298
  /**
8299
8299
  * Do not edit directly
8300
- * Generated on Mon, 06 May 2024 17:50:28 GMT
8300
+ * Generated on Tue, 07 May 2024 22:12:36 GMT
8301
8301
  */
8302
8302
 
8303
8303
  .dialtone-theme-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 May 2024 17:50:28 GMT
3
+ * Generated on Tue, 07 May 2024 22:12:36 GMT
4
4
  */
5
5
 
6
6
  .dialtone-theme-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 May 2024 17:50:30 GMT
3
+ * Generated on Tue, 07 May 2024 22:12:38 GMT
4
4
  */
5
5
 
6
6
  .dialtone-theme-expressive-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 May 2024 17:50:29 GMT
3
+ * Generated on Tue, 07 May 2024 22:12:38 GMT
4
4
  */
5
5
 
6
6
  .dialtone-theme-expressive-light {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 May 2024 17:50:31 GMT
3
+ * Generated on Tue, 07 May 2024 22:12:39 GMT
4
4
  */
5
5
 
6
6
  .dialtone-theme-expressive-sm-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 May 2024 17:50:31 GMT
3
+ * Generated on Tue, 07 May 2024 22:12:39 GMT
4
4
  */
5
5
 
6
6
  .dialtone-theme-expressive-sm-light {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 May 2024 17:50:27 GMT
3
+ * Generated on Tue, 07 May 2024 22:12:36 GMT
4
4
  */
5
5
 
6
6
  .dialtone-theme-light {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 May 2024 17:50:29 GMT
3
+ * Generated on Tue, 07 May 2024 22:12:37 GMT
4
4
  */
5
5
 
6
6
  .dialtone-theme-tmo-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 May 2024 17:50:28 GMT
3
+ * Generated on Tue, 07 May 2024 22:12:37 GMT
4
4
  */
5
5
 
6
6
  .dialtone-theme-tmo-light {
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 May 2024 17:50:28 GMT
3
+ // Generated on Tue, 07 May 2024 22:12:36 GMT
4
4
 
5
5
  @dt-font-size-100: 1.2rem; // small
6
6
  @dt-font-size-200: 1.5rem; // medium / base
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 May 2024 17:50:30 GMT
3
+ // Generated on Tue, 07 May 2024 22:12:38 GMT
4
4
 
5
5
  @dt-font-size-100: 1.6rem; // small
6
6
  @dt-font-size-200: 2rem; // medium / base
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 May 2024 17:50:30 GMT
3
+ // Generated on Tue, 07 May 2024 22:12:38 GMT
4
4
 
5
5
  @dt-font-size-100: 1.6rem; // small
6
6
  @dt-font-size-200: 2rem; // medium / base
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 May 2024 17:50:31 GMT
3
+ // Generated on Tue, 07 May 2024 22:12:40 GMT
4
4
 
5
5
  @dt-font-size-100: 1.2rem; // small
6
6
  @dt-font-size-200: 1.6rem; // medium / base
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 May 2024 17:50:31 GMT
3
+ // Generated on Tue, 07 May 2024 22:12:39 GMT
4
4
 
5
5
  @dt-font-size-100: 1.2rem; // small
6
6
  @dt-font-size-200: 1.6rem; // medium / base
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 May 2024 17:50:27 GMT
3
+ // Generated on Tue, 07 May 2024 22:12:36 GMT
4
4
 
5
5
  @dt-font-size-100: 1.2rem; // small
6
6
  @dt-font-size-200: 1.5rem; // medium / base
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 May 2024 17:50:29 GMT
3
+ // Generated on Tue, 07 May 2024 22:12:37 GMT
4
4
 
5
5
  @dt-font-size-100: 1.2rem; // small
6
6
  @dt-font-size-200: 1.5rem; // medium / base
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 May 2024 17:50:28 GMT
3
+ // Generated on Tue, 07 May 2024 22:12:37 GMT
4
4
 
5
5
  @dt-font-size-100: 1.2rem; // small
6
6
  @dt-font-size-200: 1.5rem; // medium / base
@@ -567,7 +567,7 @@ function autolink(options) {
567
567
  });
568
568
  }
569
569
  const defaultAttributes = {
570
- class: "d-link d-c-text d-d-inline-block",
570
+ class: "d-link d-c-text d-d-inline-block d-wb-break-all",
571
571
  rel: "noopener noreferrer nofollow"
572
572
  };
573
573
  const Link = core.Mark.create({
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-editor.cjs","sources":["../../components/rich_text_editor/extensions/emoji/EmojiComponent.vue","../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue","../../components/rich_text_editor/extensions/emoji/EmojiSuggestion.vue","../../components/rich_text_editor/extensions/emoji/suggestion.js","../../components/rich_text_editor/extensions/emoji/emoji.js","../../components/rich_text_editor/extensions/link/utils.js","../../components/rich_text_editor/extensions/link/autolink.js","../../components/rich_text_editor/extensions/link/link.js","../../components/rich_text_editor/extensions/mentions/MentionComponent.vue","../../components/rich_text_editor/extensions/mentions/mention.js","../../components/rich_text_editor/extensions/channels/ChannelComponent.vue","../../components/rich_text_editor/extensions/channels/channel.js","../../components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue","../../components/rich_text_editor/extensions/slash_command/slash_command.js","../../components/rich_text_editor/rich_text_editor_constants.js","../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue","../../components/rich_text_editor/extensions/mentions/suggestion.js","../../components/rich_text_editor/extensions/channels/ChannelSuggestion.vue","../../components/rich_text_editor/extensions/channels/suggestion.js","../../components/rich_text_editor/extensions/slash_command/SlashCommandSuggestion.vue","../../components/rich_text_editor/extensions/slash_command/suggestion.js","../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <node-view-wrapper\n class=\"d-d-inline-block d-va-bottom d-lh0\"\n >\n <dt-emoji\n size=\"500\"\n :code=\"node.attrs.code\"\n />\n </node-view-wrapper>\n</template>\n\n<script>\nimport { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-2';\n\nimport { DtEmoji } from '@/components/emoji';\n\nexport default {\n name: 'EmojiComponent',\n components: {\n NodeViewWrapper,\n DtEmoji,\n },\n\n props: nodeViewProps,\n};\n</script>\n","<template>\n <div class=\"d-popover__dialog\">\n <ul\n v-show=\"items.length\"\n ref=\"suggestionList\"\n class=\"dt-suggestion-list\"\n >\n <dt-list-item\n v-for=\"(item, index) in items\"\n :key=\"item.id\"\n :class=\"[\n 'dt-suggestion-list--item',\n { 'dt-list-item--highlighted': index === selectedIndex },\n ]\"\n navigation-type=\"arrow-keys\"\n @click=\"selectItem(index)\"\n @keydown.prevent.stop=\"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 event.preventDefault(); // prevent moving the focus for the tab key\n this.selectHandler();\n event.stopPropagation();\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 scrollActiveElementIntoView () {\n const activeElement = this.$refs.suggestionList.querySelector('.dt-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\n<style>\n.dt-suggestion-list {\n position: relative;\n padding: var(--dt-size-300);\n max-height: var(--dt-size-875) !important;\n min-width: var(--dt-size-925);\n max-width: var(--dt-size-975);\n}\n\n.dt-suggestion-list--item {\n border: var(--dt-size-100) solid transparent;\n}\n</style>\n","<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-emoji\n size=\"200\"\n :code=\"item.code\"\n />\n {{ item.code }}\n </dt-stack>\n</template>\n\n<script>\nimport { DtEmoji } from '@/components/emoji';\nimport { DtStack } from '@/components/stack';\n\nexport default {\n name: 'EmojiSuggestion',\n components: {\n DtEmoji,\n DtStack,\n },\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n};\n</script>\n","import { VueRenderer } from '@tiptap/vue-2';\nimport { emojisIndexed } from '@dialpad/dialtone-emojis';\n\nimport SuggestionList from '../suggestion/SuggestionList.vue';\nimport EmojiSuggestion from './EmojiSuggestion.vue';\n\nimport tippy from 'tippy.js';\n\nexport default {\n items: ({ query }) => {\n if (query.length < 2) {\n return [];\n }\n const emojiList = Object.values(emojisIndexed);\n const filteredEmoji = emojiList.filter(function (item) {\n if (item.shortname.substring(1, item.shortname.length - 1).startsWith(query.toLowerCase())) {\n return true;\n }\n return false;\n });\n return filteredEmoji.map(item => { return { id: item.unicode_character, code: item.shortname }; });\n },\n\n command: ({ editor, range, props }) => {\n // increase range.to by one when the next node is of type \"text\"\n // and starts with a space character\n const nodeAfter = editor.view.state.selection.$to.nodeAfter;\n const overrideSpace = nodeAfter?.text?.startsWith(' ');\n\n if (overrideSpace) {\n range.to += 1;\n }\n\n editor\n .chain()\n .focus()\n .insertContentAt(range, [\n {\n type: 'emoji',\n attrs: props,\n },\n {\n type: 'text',\n text: ' ',\n },\n ])\n .run();\n\n window.getSelection()?.collapseToEnd();\n },\n\n render: () => {\n let component;\n let popup;\n\n return {\n onStart: props => {\n component = new VueRenderer(SuggestionList, {\n parent: this,\n propsData: {\n itemComponent: EmojiSuggestion,\n itemType: 'emoji',\n ...props,\n },\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n getReferenceClientRect: props.clientRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'top-start',\n contentElement: null,\n zIndex: 650,\n });\n },\n\n onUpdate (props) {\n component.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup[0].setProps({\n getReferenceClientRect: props.clientRect,\n });\n },\n\n onKeyDown (props) {\n if (props.event.key === 'Escape') {\n popup[0].hide();\n\n return true;\n }\n\n return component.ref?.onKeyDown(props);\n },\n\n onExit () {\n popup[0].destroy();\n component.destroy();\n },\n };\n },\n};\n","import { mergeAttributes, Node, nodeInputRule, nodePasteRule } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport EmojiComponent from './EmojiComponent.vue';\nimport { codeToEmojiData } from '@/common/emoji';\nimport { PluginKey } from '@tiptap/pm/state';\n\nimport Suggestion from '@tiptap/suggestion';\nimport suggestionOptions from './suggestion';\n\nexport const EmojiPluginKey = new PluginKey('emoji');\n\nconst inputShortCodeRegex = /:\\w+:$/;\nexport const emojiShortCodeRegex = /:\\w+:/g;\n/* eslint-disable max-len */\nconst inputUnicodeRegex = /(\\u00a9|\\u00ae|[\\u2000-\\u3300]|\\ud83c[\\ud000-\\udfff]|\\ud83d[\\ud000-\\udfff]|\\ud83e[\\ud000-\\udfff])$/;\nconst pasteUnicodeRegex = /(\\u00a9|\\u00ae|[\\u2000-\\u3300]|\\ud83c[\\ud000-\\udfff]|\\ud83d[\\ud000-\\udfff]|\\ud83e[\\ud000-\\udfff])/g;\n/* eslint-enable max-len */\n\nconst inputRuleMatch = (match) => {\n if (match && codeToEmojiData(match[0])) {\n // needs to be a dict returned\n // ref type InputRuleMatch:\n // https://github.com/ueberdosis/tiptap/blob/main/packages/core/src/InputRule.ts#L16\n return {\n index: match.index,\n text: match[0],\n match,\n };\n }\n};\n\nconst shortCodePasteMatch = (text) => {\n const matches = [...text.matchAll(emojiShortCodeRegex)];\n\n return matches\n .filter(match => codeToEmojiData(match[0]))\n .map(match => ({\n index: match.index,\n text: match[0],\n match,\n }));\n};\n\nexport const Emoji = Node.create({\n addOptions () {\n return {\n HTMLAttributes: {},\n suggestion: {\n char: ':',\n pluginKey: EmojiPluginKey,\n },\n };\n },\n name: 'emoji',\n group: 'inline',\n inline: true,\n selectable: true,\n\n addNodeView () {\n return VueNodeViewRenderer(EmojiComponent);\n },\n\n addAttributes () {\n return {\n code: {\n default: null,\n },\n\n id: {\n default: null,\n },\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'emoji-component',\n },\n ];\n },\n\n renderText ({ node }) {\n return node.attrs.code;\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['emoji-component', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n\n addInputRules () {\n return [\n // shortcode input\n nodeInputRule({\n find: (text) => {\n const match = text.match(inputShortCodeRegex);\n return inputRuleMatch(match);\n },\n type: this.type,\n getAttributes (attrs) {\n return {\n code: attrs[0],\n };\n },\n }),\n\n nodeInputRule({\n find: (text) => {\n const match = text.match(inputUnicodeRegex);\n return inputRuleMatch(match);\n },\n type: this.type,\n getAttributes (attrs) {\n const unicode = codeToEmojiData(attrs[0]).unicode_output;\n const emoji = String.fromCodePoint(parseInt(unicode, 16));\n return {\n code: emoji,\n label: 'emoji',\n };\n },\n }),\n ];\n },\n\n addPasteRules () {\n return [\n nodePasteRule({\n find: shortCodePasteMatch,\n type: this.type,\n getAttributes (attrs) {\n return {\n code: attrs[0],\n };\n },\n }),\n nodePasteRule({\n find: pasteUnicodeRegex,\n type: this.type,\n getAttributes (attrs) {\n return {\n code: attrs[0],\n };\n },\n }),\n ];\n },\n\n addProseMirrorPlugins () {\n return [\n Suggestion({\n editor: this.editor,\n ...this.options.suggestion,\n ...suggestionOptions,\n }),\n ];\n },\n});\n","import { getMarksBetween } from '@tiptap/core';\nimport {\n getPhoneNumberRegex,\n linkRegex,\n} from '@/common/utils';\n\n/**\n * Get matches in a string and return the ones that pass the optional extra\n * validation or if no validator is provided return all matches.\n */\nexport function getRegexMatches (text, regex, validator = () => true) {\n const matches = [];\n\n // Reset the lastIndex since the last time this was run.\n regex.lastIndex = 0;\n\n let match;\n while ((match = regex.exec(text))) {\n if (validator(text, match)) {\n matches.push(match);\n }\n }\n\n return matches;\n}\n\n/**\n * Validate the prefix of a match in a string not to contain certain characters.\n */\nexport function hasValidPrefix (text, match) {\n // The string match can't start with # or @ or have either preceding the match\n // as they're reserved for mentions and hashtags.\n return !['#', '@'].includes(text.charAt(match.index)) &&\n !['#', '@'].includes(text.charAt(match.index - 1));\n}\n\n/**\n * Trim punctuation characters at the a of the string, e.g. \"dialpad.com!\" =>\n * \"dialpad.com\"\n */\nexport function trimEndPunctiation (string) {\n const endPunctuationRegex = new RegExp(\n '(?:' +\n [\n '[!?.,:;\\'\"]',\n '(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$',\n ].join('|'),\n 'g',\n );\n return string.replace(endPunctuationRegex, '');\n}\n\n/**\n * Find the word from a string at a given index. For example for \"example here\"\n * - indices 0-7 => \"example\"\n * - indices 8-12 => \"here\".\n * Modified from https://stackoverflow.com/a/5174867\n */\nexport function getWordAt (text, index) {\n // Position of the first non-whitespace character following a possible\n // whitespace when looking from the index to the left.\n const left = text.slice(0, index + 1).search(/\\S+\\s*$/);\n\n // Position of the first whitespace when looking from the index to the right.\n const right = text.slice(index).search(/\\s/);\n\n // If the word is at the end of the string, right is -1.\n if (right < 0) {\n const word = text.slice(left);\n return {\n text: word,\n from: left,\n to: left + word.length,\n };\n }\n\n return {\n text: text.slice(left, right + index),\n from: left,\n to: right + index,\n };\n}\n\n/**\n * Helper to check if a word at a given index matches a regex and if true, finds\n * the previous or next word until the regex doesn't match anymore. Useful to\n * find for example the entire phone number when it is separated by whitespace.\n */\nexport function getWordAtUntil (text, index, direction, regex) {\n const word = getWordAt(text, index);\n\n // Reset the lastIndex since the last time this was run.\n regex.lastIndex = 0;\n\n // If the word doesn't match the regex we can just return it.\n if (!regex.test(word.text)) {\n return word;\n }\n\n // Depending on the direction take one step to the left or right to find the\n // preceding or following word.\n const newIndex = direction === 'left' ? word.from - 1 : word.to + 1;\n\n // Prevent an infinite loop for the base cases.\n if (newIndex <= 0 || newIndex >= text.length || newIndex === index) {\n return word;\n }\n\n // Run the preceding/following word through the validator until we meet the\n // string boundaries or find a word that doesn't match the regex.\n return getWordAtUntil(text, newIndex, direction, regex);\n}\n\n/**\n * Remove marks from a range.\n */\nexport function removeMarks (range, doc, tr, type) {\n const from = Math.max(range.from - 1, 0);\n const to = Math.min(range.to + 1, doc.content.size);\n const marksInRange = getMarksBetween(from, to, doc);\n\n for (const mark of marksInRange) {\n if (mark.mark.type !== type) {\n continue;\n }\n\n tr.removeMark(mark.from, mark.to, type);\n }\n}\n\n// Regex to match partial phone numbers.\nconst partialPhoneNumberRegex = getPhoneNumberRegex(1, 15);\n\n/**\n * Find matches from text and add marks on them.\n */\nexport function addMarks (text, pos, from, to, tr, type) {\n if (!text) {\n return;\n }\n\n // from = start index for the change\n // pos = start index of the node\n // 1 = range uses 1-based indexing, deduct 1\n let rangeFrom = from - pos - 1;\n\n // If the change spans multiple nodes/paragraphs the start index can become\n // negative, so default to 0.\n rangeFrom = rangeFrom < 0 ? 0 : rangeFrom;\n\n // to = end index of the change\n // pos = start index of the node\n const rangeTo = to - pos;\n\n // Get the first word in the range.\n const firstWordInRange = getWordAtUntil(\n text,\n rangeFrom,\n 'left',\n partialPhoneNumberRegex,\n );\n\n // Get the last word in the range.\n const lastWordInRange = getWordAtUntil(\n text,\n rangeTo,\n 'right',\n partialPhoneNumberRegex,\n );\n\n // Create a substring that consists of whole words only.\n const wordsInRange = text.slice(firstWordInRange.from, lastWordInRange.to);\n\n // Find all valid matches within the substring.\n const matches = getRegexMatches(wordsInRange, linkRegex, hasValidPrefix);\n\n // Loop through the matches and add marks.\n matches.forEach(match => {\n // Trim any punctuation characters at the end of the match.\n const word = trimEndPunctiation(match[0]);\n\n // pos = start index of the node\n // firstWordInRange.from = start index of the first word in range\n // match.index = index of the regex match\n // 1 = addMark() uses 1-based indexing, add 1\n const from = pos + firstWordInRange.from + match.index + 1;\n\n // Sum up the from index and the match length to get the end index.\n const to = from + word.length;\n\n tr.addMark(from, to, type.create());\n });\n}\n","import {\n combineTransactionSteps,\n findChildrenInRange,\n getChangedRanges,\n} from '@tiptap/core';\nimport {\n Plugin,\n PluginKey,\n} from '@tiptap/pm/state';\nimport {\n addMarks,\n removeMarks,\n} from './utils';\n\n/**\n * Plugin to automatically add links into content.\n */\nexport function autolink (options) {\n // Flag to see if we've loaded this plugin once already. This is used to run\n // the initial content through the plugin if the editor was mounted with some.\n let hasInitialized = false;\n\n return new Plugin({\n key: new PluginKey('autolink'),\n\n appendTransaction: (transactions, oldState, newState) => {\n const contentChanged = transactions.some(tr => tr.docChanged) &&\n !oldState.doc.eq(newState.doc);\n\n // Every interaction with the editor is a transaction, but we only care\n // about the ones with content changes.\n if (hasInitialized && !contentChanged) {\n return;\n }\n\n // The original transaction that we're manipulating.\n const { tr } = newState;\n\n // Text content after the original transaction.\n const { textContent } = newState.doc;\n\n // When the editor is initialized we want to add links to it.\n if (!hasInitialized) {\n addMarks(textContent, 0, 0, textContent.length, tr, options.type);\n }\n\n hasInitialized = true;\n\n // The transformed state of the document.\n const transform = combineTransactionSteps(\n oldState.doc,\n [...transactions],\n );\n\n // All the changes within the document.\n const changes = getChangedRanges(transform);\n\n changes.forEach(({ oldRange, newRange }) => {\n // Remove all link marks in the changed range since we'll add them\n // right back if they're still valid links.\n removeMarks(newRange, newState.doc, tr, options.type);\n\n // Find all paragraphs (Textblocks) that were affected since we want to\n // handle matches in each paragraph separately.\n const paragraphs = findChildrenInRange(\n newState.doc,\n newRange,\n node => node.isTextblock,\n );\n\n paragraphs.forEach(({ node, pos }) => {\n addMarks(\n node.textContent,\n pos,\n oldRange.from,\n newRange.to,\n tr,\n options.type,\n );\n });\n });\n\n // Return the modified transaction or the changes above wont have effect.\n return tr;\n },\n });\n}\n","import {\n mergeAttributes,\n Mark,\n} from '@tiptap/core';\nimport { autolink } from './autolink';\n\nconst defaultAttributes = {\n class: 'd-link d-c-text d-d-inline-block',\n rel: 'noopener noreferrer nofollow',\n};\n\n// This is the actual extension code, which is mostly showing that all the\n// functionality comes from the ProseMirror plugin.\nexport const Link = Mark.create({\n name: 'Link',\n\n renderHTML ({ HTMLAttributes }) {\n return [\n 'a',\n mergeAttributes(\n this.options.HTMLAttributes,\n HTMLAttributes,\n defaultAttributes,\n ),\n 0,\n ];\n },\n\n renderText ({ node }) {\n return node.attrs.text;\n },\n\n addProseMirrorPlugins () {\n return [\n autolink({ type: this.type }),\n ];\n },\n});\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <node-view-wrapper\n class=\"d-d-inline-block\"\n >\n <dt-link\n kind=\"mention\"\n >\n {{ text }}\n </dt-link>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-2';\n\nimport { DtLink } from '@/components/link';\n\nexport default {\n name: 'MentionComponent',\n components: {\n NodeViewWrapper,\n DtLink,\n },\n\n props: nodeViewProps,\n\n computed: {\n text () {\n return '@' + this.$props.node.attrs.name;\n },\n },\n};\n</script>\n","import Mention from '@tiptap/extension-mention';\nimport { mergeAttributes, nodeInputRule, nodePasteRule } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport { PluginKey } from '@tiptap/pm/state';\n\n// Mention component\nimport MentionComponent from './MentionComponent.vue';\n\nexport const mentionRegex = /@([\\w.-]+)[^\\w.-]?/g;\n\nconst mentionPasteMatch = (text, suggestions) => {\n const matches = [...text.matchAll(mentionRegex)];\n\n return matches\n .filter(match => suggestions.some(({ id }) => id === match[1].trim()))\n .map(match => {\n let mention = match[1];\n if (!mention.endsWith(' ')) mention += ' ';\n return {\n index: match.index,\n text: mention,\n match,\n };\n });\n};\n\nconst mentionInputMatch = (text, suggestions) => {\n const match = text.match(/@([\\w.-]+)[^\\w.-]$/);\n if (!match || !suggestions.some(({ id }) => id === match[1])) return;\n\n return {\n index: match.index,\n text: match[0],\n match,\n };\n};\n\nexport const MentionPlugin = Mention.extend({\n name: 'mention',\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(MentionComponent);\n },\n\n parseHTML () {\n return [\n {\n tag: 'mention-component',\n },\n ];\n },\n\n addAttributes () {\n return {\n name: {\n default: '',\n },\n avatarSrc: {\n default: '',\n },\n id: {\n default: '',\n },\n };\n },\n\n renderText ({ node }) {\n return `@${node.attrs.id}`;\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['mention-component', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n\n addInputRules () {\n const suggestions = this.options.suggestion?.items({ query: '' });\n return [\n nodeInputRule({\n find: (text) => mentionInputMatch(text, suggestions),\n type: this.type,\n getAttributes (attrs) {\n return suggestions.find(({ id }) => id === attrs[0].replace('@', '').trim());\n },\n }),\n ];\n },\n\n addPasteRules () {\n const suggestions = this.options.suggestion?.items({ query: '' });\n return [\n nodePasteRule({\n find: (text) => mentionPasteMatch(text, suggestions),\n type: this.type,\n getAttributes (attrs) {\n return suggestions.find(({ id }) => id === attrs[0].trim());\n },\n }),\n ];\n },\n}).configure({\n suggestion: {\n char: '@',\n pluginKey: new PluginKey('mentionSuggestion'),\n },\n});\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <node-view-wrapper\n class=\"d-d-inline-block\"\n >\n <dt-link\n kind=\"mention\"\n >\n {{ text }}\n </dt-link>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-2';\n\nimport { DtLink } from '@/components/link';\n\nexport default {\n name: 'ChannelComponent',\n components: {\n NodeViewWrapper,\n DtLink,\n },\n\n props: nodeViewProps,\n\n computed: {\n text () {\n return '#' + this.$props.node.attrs.name;\n },\n },\n};\n</script>\n","import Mention from '@tiptap/extension-mention';\nimport { mergeAttributes, nodeInputRule, nodePasteRule } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport { PluginKey } from '@tiptap/pm/state';\n\n// Channel Mention component\nimport ChannelComponent from './ChannelComponent.vue';\n\nexport const channelRegex = /#([\\w-]+)[^\\w-]?/g;\n\nconst channelPasteMatch = (text, suggestions) => {\n const matches = [...text.matchAll(channelRegex)];\n\n return matches\n .filter(match => suggestions.some(({ id }) => id === match[1].trim()))\n .map(match => {\n let channel = match[1];\n if (!channel.endsWith(' ')) channel += ' ';\n return {\n index: match.index,\n text: channel,\n match,\n };\n });\n};\n\nconst channelInputMatch = (text, suggestions) => {\n const match = text.match(/#([\\w-]+)[^\\w-]$/);\n if (!match || !suggestions.some(({ id }) => id === match[1])) return;\n\n return {\n index: match.index,\n text: match[0],\n match,\n };\n};\n\nexport const ChannelPlugin = Mention.extend({\n name: 'channel',\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(ChannelComponent);\n },\n\n parseHTML () {\n return [\n {\n tag: 'channel-component',\n },\n ];\n },\n\n addAttributes () {\n return {\n name: {\n default: '',\n },\n id: {\n default: '',\n },\n locked: {\n default: false,\n },\n };\n },\n\n renderText ({ node }) {\n return `#${node.attrs.id}`;\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['channel-component', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n\n addInputRules () {\n const suggestions = this.options.suggestion?.items({ query: '' });\n return [\n nodeInputRule({\n find: (text) => channelInputMatch(text, suggestions),\n type: this.type,\n getAttributes (attrs) {\n return suggestions.find(({ id }) => id === attrs[0].replace('#', '').trim());\n },\n }),\n ];\n },\n\n addPasteRules () {\n const suggestions = this.options.suggestion?.items({ query: '' });\n return [\n nodePasteRule({\n find: (text) => channelPasteMatch(text, suggestions),\n type: this.type,\n getAttributes (attrs) {\n return suggestions.find(({ id }) => id === attrs[0].trim());\n },\n }),\n ];\n },\n}).configure({\n suggestion: {\n char: '#',\n pluginKey: new PluginKey('channelSuggestion'),\n },\n});\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <node-view-wrapper\n class=\"d-d-inline-block\"\n >\n {{ text }}\n </node-view-wrapper>\n</template>\n\n<script>\nimport { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-2';\n\nexport default {\n name: 'SlashCommandsComponent',\n components: {\n NodeViewWrapper,\n },\n\n props: nodeViewProps,\n\n emits: ['selected-command'],\n\n computed: {\n text () {\n return '/' + this.$props.node.attrs.command;\n },\n },\n\n created () {\n this.$parent.$emit('selected-command', this.$props.node.attrs.command);\n },\n};\n</script>\n","import Mention from '@tiptap/extension-mention';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport { PluginKey } from '@tiptap/pm/state';\n\n// Slash Command Mention component\nimport SlashCommandComponent from './SlashCommandComponent.vue';\nimport { mergeAttributes, nodeInputRule, nodePasteRule } from '@tiptap/core';\n\nconst slashCommandPasteMatch = (text, slashCommandRegex) => {\n const matches = [...text.matchAll(slashCommandRegex)];\n\n return matches\n .map(match => {\n let slashCommand = match[2];\n if (!slashCommand.endsWith(' ')) slashCommand += ' ';\n return {\n index: match.index,\n text: slashCommand,\n match,\n };\n });\n};\n\nexport const SlashCommandPlugin = Mention.extend({\n name: 'slash-commands',\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(SlashCommandComponent);\n },\n\n parseHTML () {\n return [\n {\n tag: 'command-component',\n },\n ];\n },\n\n addAttributes () {\n return {\n command: {\n default: '',\n },\n paramentersExample: {\n default: '',\n },\n description: {\n default: '',\n },\n };\n },\n\n renderText ({ node }) {\n return `/${node.attrs.command}`;\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['command-component', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n\n addInputRules () {\n const suggestions = this.options.suggestion?.items({ query: '' }).map(suggestion => suggestion.command);\n const slashCommandRegex = new RegExp(`^((?:\\\\/)(${suggestions.join('|')})) $`);\n return [\n nodeInputRule({\n find: slashCommandRegex,\n type: this.type,\n getAttributes (attrs) {\n return { command: attrs[2] };\n },\n }),\n ];\n },\n\n addPasteRules () {\n const suggestions = this.options.suggestion?.items({ query: '' }).map(suggestion => suggestion.command);\n const slashCommandRegex = new RegExp(`^((?:\\\\/)(${suggestions.join('|')})) ?$`, 'g');\n return [\n nodePasteRule({\n find: (text) => slashCommandPasteMatch(text, slashCommandRegex),\n type: this.type,\n getAttributes (attrs) {\n return { command: attrs[0].trim() };\n },\n }),\n ];\n },\n}).configure({\n suggestion: {\n char: '/',\n pluginKey: new PluginKey('slashCommandSuggestion'),\n },\n});\n","export const RICH_TEXT_EDITOR_OUTPUT_FORMATS = [\n 'text',\n 'json',\n 'html',\n];\n\nexport const RICH_TEXT_EDITOR_AUTOFOCUS_TYPES = [\n 'start',\n 'end',\n 'all',\n];\n\nexport const RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS = [\n 'https',\n 'http',\n 'ftp',\n 'ftps',\n 'sftp',\n 'mailto',\n];\n\nexport default {\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n};\n","<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 {{ name }}\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","import { VueRenderer } from '@tiptap/vue-2';\nimport tippy from 'tippy.js';\n\nimport SuggestionList from '../suggestion/SuggestionList.vue';\nimport MentionSuggestion from './MentionSuggestion.vue';\n\nexport default {\n\n // This function comes from the user and passed to the editor directly.\n // This will also activate the mention plugin on the editor\n // items: ({ query }) => { return [] },\n\n allowSpaces: true,\n\n render: () => {\n let component;\n let popup;\n\n return {\n onStart: props => {\n component = new VueRenderer(SuggestionList, {\n parent: this,\n propsData: {\n itemComponent: MentionSuggestion,\n itemType: 'mention',\n ...props,\n },\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n getReferenceClientRect: props.clientRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'top-start',\n });\n },\n\n onUpdate (props) {\n component.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup[0].setProps({\n getReferenceClientRect: props.clientRect,\n });\n },\n\n onKeyDown (props) {\n if (props.event.key === 'Escape') {\n popup[0].hide();\n\n return true;\n }\n\n return component?.ref.onKeyDown(props);\n },\n\n onExit () {\n popup[0].destroy();\n component.destroy();\n },\n };\n },\n};\n","<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-icon-hash\n v-if=\"!item.locked\"\n size=\"300\"\n />\n <dt-icon-lock\n v-else\n size=\"300\"\n />\n <span>{{ name }}</span>\n </dt-stack>\n</template>\n\n<script>\nimport { DtStack } from '@/components/stack';\nimport DtIconHash from '@dialpad/dialtone-icons/vue2/hash';\nimport DtIconLock from '@dialpad/dialtone-icons/vue2/lock';\n\nexport default {\n name: 'ChannelSuggestion',\n components: {\n DtStack,\n DtIconHash,\n DtIconLock,\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};\n</script>\n","import { VueRenderer } from '@tiptap/vue-2';\nimport tippy from 'tippy.js';\n\nimport SuggestionList from '../suggestion/SuggestionList.vue';\nimport ChannelSuggestion from './ChannelSuggestion.vue';\n\nexport default {\n\n // This function comes from the user and passed to the editor directly.\n // This will also activate the mention plugin on the editor\n // items: ({ query }) => { return [] },\n\n allowSpaces: true,\n\n render: () => {\n let component;\n let popup;\n\n return {\n onStart: props => {\n component = new VueRenderer(SuggestionList, {\n parent: this,\n propsData: {\n itemComponent: ChannelSuggestion,\n itemType: 'channel',\n ...props,\n },\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n getReferenceClientRect: props.clientRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'top-start',\n });\n },\n\n onUpdate (props) {\n component.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup[0].setProps({\n getReferenceClientRect: props.clientRect,\n });\n },\n\n onKeyDown (props) {\n if (props.event.key === 'Escape') {\n popup[0].hide();\n\n return true;\n }\n\n return component?.ref.onKeyDown(props);\n },\n\n onExit () {\n popup[0].destroy();\n component.destroy();\n },\n };\n },\n};\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div>\n <div class=\"d-body--md-compact\">\n <span>/{{ command }}</span><span v-if=\"parametersExample\"> {{ parametersExample }}</span>\n </div>\n <div class=\"d-body--sm\">\n {{ description }}\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'SlashCommandSuggestion',\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n command () {\n return this.item.command;\n },\n\n description () {\n return this.item.description;\n },\n\n parametersExample () {\n return this.item.parametersExample;\n },\n },\n};\n</script>\n","import { VueRenderer } from '@tiptap/vue-2';\nimport tippy from 'tippy.js';\n\nimport SuggestionList from '../suggestion/SuggestionList.vue';\nimport SlashCommandSuggestion from './SlashCommandSuggestion.vue';\n\nexport default {\n\n // This function comes from the user and passed to the editor directly.\n // This will also activate the mention plugin on the editor\n // items: ({ query }) => { return [] },\n\n allowSpaces: true,\n startOfLine: true,\n\n render: () => {\n let component;\n let popup;\n\n return {\n onStart: props => {\n component = new VueRenderer(SuggestionList, {\n parent: this,\n propsData: {\n itemComponent: SlashCommandSuggestion,\n itemType: 'slash-command',\n ...props,\n },\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n getReferenceClientRect: props.clientRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'top-start',\n });\n },\n\n onUpdate (props) {\n component.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup[0].setProps({\n getReferenceClientRect: props.clientRect,\n });\n },\n\n onKeyDown (props) {\n if (props.event.key === 'Escape') {\n popup[0].hide();\n\n return true;\n }\n\n return component?.ref.onKeyDown(props);\n },\n\n onExit () {\n popup[0].destroy();\n component.destroy();\n },\n };\n },\n};\n","<template>\n <editor-content\n :editor=\"editor\"\n data-qa=\"dt-rich-text-editor\"\n class=\"dt-rich-text-editor\"\n @selected-command=\"onSelectedCommand\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\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 Emoji from './extensions/emoji';\nimport Link from './extensions/link';\nimport { MentionPlugin, mentionRegex } from './extensions/mentions/mention';\nimport { ChannelPlugin, channelRegex } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport { emojiShortCodeRegex } from './extensions/emoji/emoji.js';\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';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport emojiRegex from 'emoji-regex';\nimport { codeToEmojiData } from '@/common/emoji';\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 * Whether the input allows for line breaks to be introduced in the text.\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: 'text',\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 Link extension and optionally passes configurations to it\n */\n link: {\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 */\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 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 data () {\n return {\n editor: null,\n popoverOpened: false,\n internalValue: this.value,\n };\n },\n\n computed: {\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];\n if (this.link) {\n extensions.push(this.getExtension(Link, this.link));\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.configure({\n itemTypeName: 'listItem',\n }));\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 extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n\n // make sure that this is defined before any other extensions\n // where Enter and Shift+Enter should have its own interaction. otherwise it will be ignored\n if (!this.allowLineBreaks) {\n extensions.push(\n HardBreak.extend({\n addKeyboardShortcuts () {\n return {\n Enter: () => true,\n 'Shift-Enter': () => this.editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]),\n };\n },\n }),\n );\n }\n\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\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 extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'dt-rich-text-editor--code-block',\n },\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 let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n if (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 this.internalValue = newValue;\n this.insertContent();\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n methods: {\n onSelectedCommand (command) {\n this.$emit('selected-command', command);\n },\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 editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n },\n });\n this.insertContent();\n this.addEditorListeners();\n },\n\n /**\n * This function is necessary as tiptap doesn't render the content passed\n * directly through `editor.commands.setContent` the content passed down to it\n * should be already parsed. So We're parsing the elements into it's corresponding\n * HTML version before setting it.\n */\n insertContent () {\n this.parseMentions();\n this.parseChannels();\n this.parseEmojis();\n this.editor.commands.setContent(this.internalValue, true);\n },\n\n parseEmojis () {\n const matches = [...this.value.matchAll(emojiRegex()), ...this.value.matchAll(emojiShortCodeRegex)];\n if (!matches) return;\n\n matches.forEach(match => {\n const emoji = codeToEmojiData(match[0]);\n if (!emoji) return;\n this.internalValue = this.internalValue.replace(new RegExp(` ${match[0]}`), ` <emoji-component code=\"${emoji.shortname}\"></emoji-component>`);\n });\n },\n\n parseChannels () {\n if (!this.channelSuggestion) return;\n\n const suggestions = this.channelSuggestion.items({ query: '' });\n const matches = [...this.value.matchAll(channelRegex)]\n .filter(match => suggestions.some(({ id }) => id === match[1]));\n\n if (!matches) return;\n\n matches.forEach(match => {\n const channel = suggestions.find(({ id }) => id === match[1]);\n this.internalValue = this.internalValue.replace(\n `#${match[1]}`,\n /** The space at the beginning is important as tiptap removes that while rendering.\n * So if multiple mentions, channels or emojis are next to each other it will fail\n */\n ` <channel-component name=\"${channel.name}\" id=\"${channel.id}\"></channel-component>`,\n );\n });\n },\n\n parseMentions () {\n if (!this.mentionSuggestion) return;\n\n const suggestions = this.mentionSuggestion.items({ query: '' });\n const matches = [...this.value.matchAll(mentionRegex)]\n .filter(match => suggestions.some(({ id }) => id === match[1]));\n\n if (!matches) return;\n\n matches.forEach(match => {\n const mention = suggestions.find(({ id }) => id === match[1]);\n this.internalValue = this.internalValue.replace(`@${match[1]}`, ` <mention-component name=\"${mention.name}\" id=\"${mention.id}\"></mention-component>`);\n });\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 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();\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({ editorProps: { attributes } });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n .ProseMirror p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--dt-color-foreground-placeholder);\n pointer-events: none;\n height: 0;\n }\n\n .ProseMirror ul > li {\n list-style-type: disc;\n }\n\n .ProseMirror ol > li {\n list-style-type: decimal;\n }\n\n .ProseMirror blockquote {\n padding-left: var(--dt-space-400);\n border-left: var(--dt-size-border-300) solid var(--dt-color-foreground-muted-inverted);\n margin-left: 0;\n }\n\n .dt-rich-text-editor--code-block {\n background: var(--dt-color-surface-secondary);\n padding: var(--dt-space-400);\n }\n\n .dt-rich-text-editor {\n overflow: hidden;\n }\n</style>\n"],"names":["_sfc_main","NodeViewWrapper","DtEmoji","nodeViewProps","DtListItem","DtStack","emojisIndexed","VueRenderer","this","PluginKey","codeToEmojiData","Node","VueNodeViewRenderer","mergeAttributes","nodeInputRule","nodePasteRule","getMarksBetween","getPhoneNumberRegex","linkRegex","from","to","Plugin","tr","combineTransactionSteps","getChangedRanges","findChildrenInRange","Mark","DtLink","DtAvatar","EditorContent","Editor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,iBAAAC,KAAA;AAAA,IACA,SAAAC,UAAA;AAAA,EACA;AAAA,EAEA,OAAAC,KAAA;AACA;;;;;;;;;;;;;;;;;ACKA,MAAAH,cAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,YAAAI,aAAA;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;AAC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AAA,KAAA;AACA,aAAA,MAAA,gBAAA,KAAA;AAAA,MACA,CAAA;AAGA,WAAA,OAAA,GAAA,SAAA,CAAA,EAAA,MAAA,MAAA;AACA,aAAA,MAAA,SAAA,KAAA;AAAA,MACA,CAAA;AAGA,WAAA,OAAA,GAAA,QAAA,CAAA,EAAA,MAAA,MAAA;AACA,aAAA,MAAA,QAAA,KAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,cAAA,KAAA,cAAA;AAAA,QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AAAA,QACA;AACA,iBAAA,KAAA,OAAA;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,EAAA,aAAA,EAAA,WAAA,EAAA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rich-text-editor.cjs","sources":["../../components/rich_text_editor/extensions/emoji/EmojiComponent.vue","../../components/rich_text_editor/extensions/suggestion/SuggestionList.vue","../../components/rich_text_editor/extensions/emoji/EmojiSuggestion.vue","../../components/rich_text_editor/extensions/emoji/suggestion.js","../../components/rich_text_editor/extensions/emoji/emoji.js","../../components/rich_text_editor/extensions/link/utils.js","../../components/rich_text_editor/extensions/link/autolink.js","../../components/rich_text_editor/extensions/link/link.js","../../components/rich_text_editor/extensions/mentions/MentionComponent.vue","../../components/rich_text_editor/extensions/mentions/mention.js","../../components/rich_text_editor/extensions/channels/ChannelComponent.vue","../../components/rich_text_editor/extensions/channels/channel.js","../../components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue","../../components/rich_text_editor/extensions/slash_command/slash_command.js","../../components/rich_text_editor/rich_text_editor_constants.js","../../components/rich_text_editor/extensions/mentions/MentionSuggestion.vue","../../components/rich_text_editor/extensions/mentions/suggestion.js","../../components/rich_text_editor/extensions/channels/ChannelSuggestion.vue","../../components/rich_text_editor/extensions/channels/suggestion.js","../../components/rich_text_editor/extensions/slash_command/SlashCommandSuggestion.vue","../../components/rich_text_editor/extensions/slash_command/suggestion.js","../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <node-view-wrapper\n class=\"d-d-inline-block d-va-bottom d-lh0\"\n >\n <dt-emoji\n size=\"500\"\n :code=\"node.attrs.code\"\n />\n </node-view-wrapper>\n</template>\n\n<script>\nimport { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-2';\n\nimport { DtEmoji } from '@/components/emoji';\n\nexport default {\n name: 'EmojiComponent',\n components: {\n NodeViewWrapper,\n DtEmoji,\n },\n\n props: nodeViewProps,\n};\n</script>\n","<template>\n <div class=\"d-popover__dialog\">\n <ul\n v-show=\"items.length\"\n ref=\"suggestionList\"\n class=\"dt-suggestion-list\"\n >\n <dt-list-item\n v-for=\"(item, index) in items\"\n :key=\"item.id\"\n :class=\"[\n 'dt-suggestion-list--item',\n { 'dt-list-item--highlighted': index === selectedIndex },\n ]\"\n navigation-type=\"arrow-keys\"\n @click=\"selectItem(index)\"\n @keydown.prevent.stop=\"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 event.preventDefault(); // prevent moving the focus for the tab key\n this.selectHandler();\n event.stopPropagation();\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 scrollActiveElementIntoView () {\n const activeElement = this.$refs.suggestionList.querySelector('.dt-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\n<style>\n.dt-suggestion-list {\n position: relative;\n padding: var(--dt-size-300);\n max-height: var(--dt-size-875) !important;\n min-width: var(--dt-size-925);\n max-width: var(--dt-size-975);\n}\n\n.dt-suggestion-list--item {\n border: var(--dt-size-100) solid transparent;\n}\n</style>\n","<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-emoji\n size=\"200\"\n :code=\"item.code\"\n />\n {{ item.code }}\n </dt-stack>\n</template>\n\n<script>\nimport { DtEmoji } from '@/components/emoji';\nimport { DtStack } from '@/components/stack';\n\nexport default {\n name: 'EmojiSuggestion',\n components: {\n DtEmoji,\n DtStack,\n },\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n};\n</script>\n","import { VueRenderer } from '@tiptap/vue-2';\nimport { emojisIndexed } from '@dialpad/dialtone-emojis';\n\nimport SuggestionList from '../suggestion/SuggestionList.vue';\nimport EmojiSuggestion from './EmojiSuggestion.vue';\n\nimport tippy from 'tippy.js';\n\nexport default {\n items: ({ query }) => {\n if (query.length < 2) {\n return [];\n }\n const emojiList = Object.values(emojisIndexed);\n const filteredEmoji = emojiList.filter(function (item) {\n if (item.shortname.substring(1, item.shortname.length - 1).startsWith(query.toLowerCase())) {\n return true;\n }\n return false;\n });\n return filteredEmoji.map(item => { return { id: item.unicode_character, code: item.shortname }; });\n },\n\n command: ({ editor, range, props }) => {\n // increase range.to by one when the next node is of type \"text\"\n // and starts with a space character\n const nodeAfter = editor.view.state.selection.$to.nodeAfter;\n const overrideSpace = nodeAfter?.text?.startsWith(' ');\n\n if (overrideSpace) {\n range.to += 1;\n }\n\n editor\n .chain()\n .focus()\n .insertContentAt(range, [\n {\n type: 'emoji',\n attrs: props,\n },\n {\n type: 'text',\n text: ' ',\n },\n ])\n .run();\n\n window.getSelection()?.collapseToEnd();\n },\n\n render: () => {\n let component;\n let popup;\n\n return {\n onStart: props => {\n component = new VueRenderer(SuggestionList, {\n parent: this,\n propsData: {\n itemComponent: EmojiSuggestion,\n itemType: 'emoji',\n ...props,\n },\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n getReferenceClientRect: props.clientRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'top-start',\n contentElement: null,\n zIndex: 650,\n });\n },\n\n onUpdate (props) {\n component.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup[0].setProps({\n getReferenceClientRect: props.clientRect,\n });\n },\n\n onKeyDown (props) {\n if (props.event.key === 'Escape') {\n popup[0].hide();\n\n return true;\n }\n\n return component.ref?.onKeyDown(props);\n },\n\n onExit () {\n popup[0].destroy();\n component.destroy();\n },\n };\n },\n};\n","import { mergeAttributes, Node, nodeInputRule, nodePasteRule } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport EmojiComponent from './EmojiComponent.vue';\nimport { codeToEmojiData } from '@/common/emoji';\nimport { PluginKey } from '@tiptap/pm/state';\n\nimport Suggestion from '@tiptap/suggestion';\nimport suggestionOptions from './suggestion';\n\nexport const EmojiPluginKey = new PluginKey('emoji');\n\nconst inputShortCodeRegex = /:\\w+:$/;\nexport const emojiShortCodeRegex = /:\\w+:/g;\n/* eslint-disable max-len */\nconst inputUnicodeRegex = /(\\u00a9|\\u00ae|[\\u2000-\\u3300]|\\ud83c[\\ud000-\\udfff]|\\ud83d[\\ud000-\\udfff]|\\ud83e[\\ud000-\\udfff])$/;\nconst pasteUnicodeRegex = /(\\u00a9|\\u00ae|[\\u2000-\\u3300]|\\ud83c[\\ud000-\\udfff]|\\ud83d[\\ud000-\\udfff]|\\ud83e[\\ud000-\\udfff])/g;\n/* eslint-enable max-len */\n\nconst inputRuleMatch = (match) => {\n if (match && codeToEmojiData(match[0])) {\n // needs to be a dict returned\n // ref type InputRuleMatch:\n // https://github.com/ueberdosis/tiptap/blob/main/packages/core/src/InputRule.ts#L16\n return {\n index: match.index,\n text: match[0],\n match,\n };\n }\n};\n\nconst shortCodePasteMatch = (text) => {\n const matches = [...text.matchAll(emojiShortCodeRegex)];\n\n return matches\n .filter(match => codeToEmojiData(match[0]))\n .map(match => ({\n index: match.index,\n text: match[0],\n match,\n }));\n};\n\nexport const Emoji = Node.create({\n addOptions () {\n return {\n HTMLAttributes: {},\n suggestion: {\n char: ':',\n pluginKey: EmojiPluginKey,\n },\n };\n },\n name: 'emoji',\n group: 'inline',\n inline: true,\n selectable: true,\n\n addNodeView () {\n return VueNodeViewRenderer(EmojiComponent);\n },\n\n addAttributes () {\n return {\n code: {\n default: null,\n },\n\n id: {\n default: null,\n },\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'emoji-component',\n },\n ];\n },\n\n renderText ({ node }) {\n return node.attrs.code;\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['emoji-component', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n\n addInputRules () {\n return [\n // shortcode input\n nodeInputRule({\n find: (text) => {\n const match = text.match(inputShortCodeRegex);\n return inputRuleMatch(match);\n },\n type: this.type,\n getAttributes (attrs) {\n return {\n code: attrs[0],\n };\n },\n }),\n\n nodeInputRule({\n find: (text) => {\n const match = text.match(inputUnicodeRegex);\n return inputRuleMatch(match);\n },\n type: this.type,\n getAttributes (attrs) {\n const unicode = codeToEmojiData(attrs[0]).unicode_output;\n const emoji = String.fromCodePoint(parseInt(unicode, 16));\n return {\n code: emoji,\n label: 'emoji',\n };\n },\n }),\n ];\n },\n\n addPasteRules () {\n return [\n nodePasteRule({\n find: shortCodePasteMatch,\n type: this.type,\n getAttributes (attrs) {\n return {\n code: attrs[0],\n };\n },\n }),\n nodePasteRule({\n find: pasteUnicodeRegex,\n type: this.type,\n getAttributes (attrs) {\n return {\n code: attrs[0],\n };\n },\n }),\n ];\n },\n\n addProseMirrorPlugins () {\n return [\n Suggestion({\n editor: this.editor,\n ...this.options.suggestion,\n ...suggestionOptions,\n }),\n ];\n },\n});\n","import { getMarksBetween } from '@tiptap/core';\nimport {\n getPhoneNumberRegex,\n linkRegex,\n} from '@/common/utils';\n\n/**\n * Get matches in a string and return the ones that pass the optional extra\n * validation or if no validator is provided return all matches.\n */\nexport function getRegexMatches (text, regex, validator = () => true) {\n const matches = [];\n\n // Reset the lastIndex since the last time this was run.\n regex.lastIndex = 0;\n\n let match;\n while ((match = regex.exec(text))) {\n if (validator(text, match)) {\n matches.push(match);\n }\n }\n\n return matches;\n}\n\n/**\n * Validate the prefix of a match in a string not to contain certain characters.\n */\nexport function hasValidPrefix (text, match) {\n // The string match can't start with # or @ or have either preceding the match\n // as they're reserved for mentions and hashtags.\n return !['#', '@'].includes(text.charAt(match.index)) &&\n !['#', '@'].includes(text.charAt(match.index - 1));\n}\n\n/**\n * Trim punctuation characters at the a of the string, e.g. \"dialpad.com!\" =>\n * \"dialpad.com\"\n */\nexport function trimEndPunctiation (string) {\n const endPunctuationRegex = new RegExp(\n '(?:' +\n [\n '[!?.,:;\\'\"]',\n '(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$',\n ].join('|'),\n 'g',\n );\n return string.replace(endPunctuationRegex, '');\n}\n\n/**\n * Find the word from a string at a given index. For example for \"example here\"\n * - indices 0-7 => \"example\"\n * - indices 8-12 => \"here\".\n * Modified from https://stackoverflow.com/a/5174867\n */\nexport function getWordAt (text, index) {\n // Position of the first non-whitespace character following a possible\n // whitespace when looking from the index to the left.\n const left = text.slice(0, index + 1).search(/\\S+\\s*$/);\n\n // Position of the first whitespace when looking from the index to the right.\n const right = text.slice(index).search(/\\s/);\n\n // If the word is at the end of the string, right is -1.\n if (right < 0) {\n const word = text.slice(left);\n return {\n text: word,\n from: left,\n to: left + word.length,\n };\n }\n\n return {\n text: text.slice(left, right + index),\n from: left,\n to: right + index,\n };\n}\n\n/**\n * Helper to check if a word at a given index matches a regex and if true, finds\n * the previous or next word until the regex doesn't match anymore. Useful to\n * find for example the entire phone number when it is separated by whitespace.\n */\nexport function getWordAtUntil (text, index, direction, regex) {\n const word = getWordAt(text, index);\n\n // Reset the lastIndex since the last time this was run.\n regex.lastIndex = 0;\n\n // If the word doesn't match the regex we can just return it.\n if (!regex.test(word.text)) {\n return word;\n }\n\n // Depending on the direction take one step to the left or right to find the\n // preceding or following word.\n const newIndex = direction === 'left' ? word.from - 1 : word.to + 1;\n\n // Prevent an infinite loop for the base cases.\n if (newIndex <= 0 || newIndex >= text.length || newIndex === index) {\n return word;\n }\n\n // Run the preceding/following word through the validator until we meet the\n // string boundaries or find a word that doesn't match the regex.\n return getWordAtUntil(text, newIndex, direction, regex);\n}\n\n/**\n * Remove marks from a range.\n */\nexport function removeMarks (range, doc, tr, type) {\n const from = Math.max(range.from - 1, 0);\n const to = Math.min(range.to + 1, doc.content.size);\n const marksInRange = getMarksBetween(from, to, doc);\n\n for (const mark of marksInRange) {\n if (mark.mark.type !== type) {\n continue;\n }\n\n tr.removeMark(mark.from, mark.to, type);\n }\n}\n\n// Regex to match partial phone numbers.\nconst partialPhoneNumberRegex = getPhoneNumberRegex(1, 15);\n\n/**\n * Find matches from text and add marks on them.\n */\nexport function addMarks (text, pos, from, to, tr, type) {\n if (!text) {\n return;\n }\n\n // from = start index for the change\n // pos = start index of the node\n // 1 = range uses 1-based indexing, deduct 1\n let rangeFrom = from - pos - 1;\n\n // If the change spans multiple nodes/paragraphs the start index can become\n // negative, so default to 0.\n rangeFrom = rangeFrom < 0 ? 0 : rangeFrom;\n\n // to = end index of the change\n // pos = start index of the node\n const rangeTo = to - pos;\n\n // Get the first word in the range.\n const firstWordInRange = getWordAtUntil(\n text,\n rangeFrom,\n 'left',\n partialPhoneNumberRegex,\n );\n\n // Get the last word in the range.\n const lastWordInRange = getWordAtUntil(\n text,\n rangeTo,\n 'right',\n partialPhoneNumberRegex,\n );\n\n // Create a substring that consists of whole words only.\n const wordsInRange = text.slice(firstWordInRange.from, lastWordInRange.to);\n\n // Find all valid matches within the substring.\n const matches = getRegexMatches(wordsInRange, linkRegex, hasValidPrefix);\n\n // Loop through the matches and add marks.\n matches.forEach(match => {\n // Trim any punctuation characters at the end of the match.\n const word = trimEndPunctiation(match[0]);\n\n // pos = start index of the node\n // firstWordInRange.from = start index of the first word in range\n // match.index = index of the regex match\n // 1 = addMark() uses 1-based indexing, add 1\n const from = pos + firstWordInRange.from + match.index + 1;\n\n // Sum up the from index and the match length to get the end index.\n const to = from + word.length;\n\n tr.addMark(from, to, type.create());\n });\n}\n","import {\n combineTransactionSteps,\n findChildrenInRange,\n getChangedRanges,\n} from '@tiptap/core';\nimport {\n Plugin,\n PluginKey,\n} from '@tiptap/pm/state';\nimport {\n addMarks,\n removeMarks,\n} from './utils';\n\n/**\n * Plugin to automatically add links into content.\n */\nexport function autolink (options) {\n // Flag to see if we've loaded this plugin once already. This is used to run\n // the initial content through the plugin if the editor was mounted with some.\n let hasInitialized = false;\n\n return new Plugin({\n key: new PluginKey('autolink'),\n\n appendTransaction: (transactions, oldState, newState) => {\n const contentChanged = transactions.some(tr => tr.docChanged) &&\n !oldState.doc.eq(newState.doc);\n\n // Every interaction with the editor is a transaction, but we only care\n // about the ones with content changes.\n if (hasInitialized && !contentChanged) {\n return;\n }\n\n // The original transaction that we're manipulating.\n const { tr } = newState;\n\n // Text content after the original transaction.\n const { textContent } = newState.doc;\n\n // When the editor is initialized we want to add links to it.\n if (!hasInitialized) {\n addMarks(textContent, 0, 0, textContent.length, tr, options.type);\n }\n\n hasInitialized = true;\n\n // The transformed state of the document.\n const transform = combineTransactionSteps(\n oldState.doc,\n [...transactions],\n );\n\n // All the changes within the document.\n const changes = getChangedRanges(transform);\n\n changes.forEach(({ oldRange, newRange }) => {\n // Remove all link marks in the changed range since we'll add them\n // right back if they're still valid links.\n removeMarks(newRange, newState.doc, tr, options.type);\n\n // Find all paragraphs (Textblocks) that were affected since we want to\n // handle matches in each paragraph separately.\n const paragraphs = findChildrenInRange(\n newState.doc,\n newRange,\n node => node.isTextblock,\n );\n\n paragraphs.forEach(({ node, pos }) => {\n addMarks(\n node.textContent,\n pos,\n oldRange.from,\n newRange.to,\n tr,\n options.type,\n );\n });\n });\n\n // Return the modified transaction or the changes above wont have effect.\n return tr;\n },\n });\n}\n","import {\n mergeAttributes,\n Mark,\n} from '@tiptap/core';\nimport { autolink } from './autolink';\n\nconst defaultAttributes = {\n class: 'd-link d-c-text d-d-inline-block d-wb-break-all',\n rel: 'noopener noreferrer nofollow',\n};\n\n// This is the actual extension code, which is mostly showing that all the\n// functionality comes from the ProseMirror plugin.\nexport const Link = Mark.create({\n name: 'Link',\n\n renderHTML ({ HTMLAttributes }) {\n return [\n 'a',\n mergeAttributes(\n this.options.HTMLAttributes,\n HTMLAttributes,\n defaultAttributes,\n ),\n 0,\n ];\n },\n\n renderText ({ node }) {\n return node.attrs.text;\n },\n\n addProseMirrorPlugins () {\n return [\n autolink({ type: this.type }),\n ];\n },\n});\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <node-view-wrapper\n class=\"d-d-inline-block\"\n >\n <dt-link\n kind=\"mention\"\n >\n {{ text }}\n </dt-link>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-2';\n\nimport { DtLink } from '@/components/link';\n\nexport default {\n name: 'MentionComponent',\n components: {\n NodeViewWrapper,\n DtLink,\n },\n\n props: nodeViewProps,\n\n computed: {\n text () {\n return '@' + this.$props.node.attrs.name;\n },\n },\n};\n</script>\n","import Mention from '@tiptap/extension-mention';\nimport { mergeAttributes, nodeInputRule, nodePasteRule } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport { PluginKey } from '@tiptap/pm/state';\n\n// Mention component\nimport MentionComponent from './MentionComponent.vue';\n\nexport const mentionRegex = /@([\\w.-]+)[^\\w.-]?/g;\n\nconst mentionPasteMatch = (text, suggestions) => {\n const matches = [...text.matchAll(mentionRegex)];\n\n return matches\n .filter(match => suggestions.some(({ id }) => id === match[1].trim()))\n .map(match => {\n let mention = match[1];\n if (!mention.endsWith(' ')) mention += ' ';\n return {\n index: match.index,\n text: mention,\n match,\n };\n });\n};\n\nconst mentionInputMatch = (text, suggestions) => {\n const match = text.match(/@([\\w.-]+)[^\\w.-]$/);\n if (!match || !suggestions.some(({ id }) => id === match[1])) return;\n\n return {\n index: match.index,\n text: match[0],\n match,\n };\n};\n\nexport const MentionPlugin = Mention.extend({\n name: 'mention',\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(MentionComponent);\n },\n\n parseHTML () {\n return [\n {\n tag: 'mention-component',\n },\n ];\n },\n\n addAttributes () {\n return {\n name: {\n default: '',\n },\n avatarSrc: {\n default: '',\n },\n id: {\n default: '',\n },\n };\n },\n\n renderText ({ node }) {\n return `@${node.attrs.id}`;\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['mention-component', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n\n addInputRules () {\n const suggestions = this.options.suggestion?.items({ query: '' });\n return [\n nodeInputRule({\n find: (text) => mentionInputMatch(text, suggestions),\n type: this.type,\n getAttributes (attrs) {\n return suggestions.find(({ id }) => id === attrs[0].replace('@', '').trim());\n },\n }),\n ];\n },\n\n addPasteRules () {\n const suggestions = this.options.suggestion?.items({ query: '' });\n return [\n nodePasteRule({\n find: (text) => mentionPasteMatch(text, suggestions),\n type: this.type,\n getAttributes (attrs) {\n return suggestions.find(({ id }) => id === attrs[0].trim());\n },\n }),\n ];\n },\n}).configure({\n suggestion: {\n char: '@',\n pluginKey: new PluginKey('mentionSuggestion'),\n },\n});\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <node-view-wrapper\n class=\"d-d-inline-block\"\n >\n <dt-link\n kind=\"mention\"\n >\n {{ text }}\n </dt-link>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-2';\n\nimport { DtLink } from '@/components/link';\n\nexport default {\n name: 'ChannelComponent',\n components: {\n NodeViewWrapper,\n DtLink,\n },\n\n props: nodeViewProps,\n\n computed: {\n text () {\n return '#' + this.$props.node.attrs.name;\n },\n },\n};\n</script>\n","import Mention from '@tiptap/extension-mention';\nimport { mergeAttributes, nodeInputRule, nodePasteRule } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport { PluginKey } from '@tiptap/pm/state';\n\n// Channel Mention component\nimport ChannelComponent from './ChannelComponent.vue';\n\nexport const channelRegex = /#([\\w-]+)[^\\w-]?/g;\n\nconst channelPasteMatch = (text, suggestions) => {\n const matches = [...text.matchAll(channelRegex)];\n\n return matches\n .filter(match => suggestions.some(({ id }) => id === match[1].trim()))\n .map(match => {\n let channel = match[1];\n if (!channel.endsWith(' ')) channel += ' ';\n return {\n index: match.index,\n text: channel,\n match,\n };\n });\n};\n\nconst channelInputMatch = (text, suggestions) => {\n const match = text.match(/#([\\w-]+)[^\\w-]$/);\n if (!match || !suggestions.some(({ id }) => id === match[1])) return;\n\n return {\n index: match.index,\n text: match[0],\n match,\n };\n};\n\nexport const ChannelPlugin = Mention.extend({\n name: 'channel',\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(ChannelComponent);\n },\n\n parseHTML () {\n return [\n {\n tag: 'channel-component',\n },\n ];\n },\n\n addAttributes () {\n return {\n name: {\n default: '',\n },\n id: {\n default: '',\n },\n locked: {\n default: false,\n },\n };\n },\n\n renderText ({ node }) {\n return `#${node.attrs.id}`;\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['channel-component', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n\n addInputRules () {\n const suggestions = this.options.suggestion?.items({ query: '' });\n return [\n nodeInputRule({\n find: (text) => channelInputMatch(text, suggestions),\n type: this.type,\n getAttributes (attrs) {\n return suggestions.find(({ id }) => id === attrs[0].replace('#', '').trim());\n },\n }),\n ];\n },\n\n addPasteRules () {\n const suggestions = this.options.suggestion?.items({ query: '' });\n return [\n nodePasteRule({\n find: (text) => channelPasteMatch(text, suggestions),\n type: this.type,\n getAttributes (attrs) {\n return suggestions.find(({ id }) => id === attrs[0].trim());\n },\n }),\n ];\n },\n}).configure({\n suggestion: {\n char: '#',\n pluginKey: new PluginKey('channelSuggestion'),\n },\n});\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <node-view-wrapper\n class=\"d-d-inline-block\"\n >\n {{ text }}\n </node-view-wrapper>\n</template>\n\n<script>\nimport { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-2';\n\nexport default {\n name: 'SlashCommandsComponent',\n components: {\n NodeViewWrapper,\n },\n\n props: nodeViewProps,\n\n emits: ['selected-command'],\n\n computed: {\n text () {\n return '/' + this.$props.node.attrs.command;\n },\n },\n\n created () {\n this.$parent.$emit('selected-command', this.$props.node.attrs.command);\n },\n};\n</script>\n","import Mention from '@tiptap/extension-mention';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport { PluginKey } from '@tiptap/pm/state';\n\n// Slash Command Mention component\nimport SlashCommandComponent from './SlashCommandComponent.vue';\nimport { mergeAttributes, nodeInputRule, nodePasteRule } from '@tiptap/core';\n\nconst slashCommandPasteMatch = (text, slashCommandRegex) => {\n const matches = [...text.matchAll(slashCommandRegex)];\n\n return matches\n .map(match => {\n let slashCommand = match[2];\n if (!slashCommand.endsWith(' ')) slashCommand += ' ';\n return {\n index: match.index,\n text: slashCommand,\n match,\n };\n });\n};\n\nexport const SlashCommandPlugin = Mention.extend({\n name: 'slash-commands',\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(SlashCommandComponent);\n },\n\n parseHTML () {\n return [\n {\n tag: 'command-component',\n },\n ];\n },\n\n addAttributes () {\n return {\n command: {\n default: '',\n },\n paramentersExample: {\n default: '',\n },\n description: {\n default: '',\n },\n };\n },\n\n renderText ({ node }) {\n return `/${node.attrs.command}`;\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['command-component', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n\n addInputRules () {\n const suggestions = this.options.suggestion?.items({ query: '' }).map(suggestion => suggestion.command);\n const slashCommandRegex = new RegExp(`^((?:\\\\/)(${suggestions.join('|')})) $`);\n return [\n nodeInputRule({\n find: slashCommandRegex,\n type: this.type,\n getAttributes (attrs) {\n return { command: attrs[2] };\n },\n }),\n ];\n },\n\n addPasteRules () {\n const suggestions = this.options.suggestion?.items({ query: '' }).map(suggestion => suggestion.command);\n const slashCommandRegex = new RegExp(`^((?:\\\\/)(${suggestions.join('|')})) ?$`, 'g');\n return [\n nodePasteRule({\n find: (text) => slashCommandPasteMatch(text, slashCommandRegex),\n type: this.type,\n getAttributes (attrs) {\n return { command: attrs[0].trim() };\n },\n }),\n ];\n },\n}).configure({\n suggestion: {\n char: '/',\n pluginKey: new PluginKey('slashCommandSuggestion'),\n },\n});\n","export const RICH_TEXT_EDITOR_OUTPUT_FORMATS = [\n 'text',\n 'json',\n 'html',\n];\n\nexport const RICH_TEXT_EDITOR_AUTOFOCUS_TYPES = [\n 'start',\n 'end',\n 'all',\n];\n\nexport const RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS = [\n 'https',\n 'http',\n 'ftp',\n 'ftps',\n 'sftp',\n 'mailto',\n];\n\nexport default {\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n};\n","<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 {{ name }}\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","import { VueRenderer } from '@tiptap/vue-2';\nimport tippy from 'tippy.js';\n\nimport SuggestionList from '../suggestion/SuggestionList.vue';\nimport MentionSuggestion from './MentionSuggestion.vue';\n\nexport default {\n\n // This function comes from the user and passed to the editor directly.\n // This will also activate the mention plugin on the editor\n // items: ({ query }) => { return [] },\n\n allowSpaces: true,\n\n render: () => {\n let component;\n let popup;\n\n return {\n onStart: props => {\n component = new VueRenderer(SuggestionList, {\n parent: this,\n propsData: {\n itemComponent: MentionSuggestion,\n itemType: 'mention',\n ...props,\n },\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n getReferenceClientRect: props.clientRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'top-start',\n });\n },\n\n onUpdate (props) {\n component.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup[0].setProps({\n getReferenceClientRect: props.clientRect,\n });\n },\n\n onKeyDown (props) {\n if (props.event.key === 'Escape') {\n popup[0].hide();\n\n return true;\n }\n\n return component?.ref.onKeyDown(props);\n },\n\n onExit () {\n popup[0].destroy();\n component.destroy();\n },\n };\n },\n};\n","<template>\n <dt-stack\n direction=\"row\"\n gap=\"400\"\n >\n <dt-icon-hash\n v-if=\"!item.locked\"\n size=\"300\"\n />\n <dt-icon-lock\n v-else\n size=\"300\"\n />\n <span>{{ name }}</span>\n </dt-stack>\n</template>\n\n<script>\nimport { DtStack } from '@/components/stack';\nimport DtIconHash from '@dialpad/dialtone-icons/vue2/hash';\nimport DtIconLock from '@dialpad/dialtone-icons/vue2/lock';\n\nexport default {\n name: 'ChannelSuggestion',\n components: {\n DtStack,\n DtIconHash,\n DtIconLock,\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};\n</script>\n","import { VueRenderer } from '@tiptap/vue-2';\nimport tippy from 'tippy.js';\n\nimport SuggestionList from '../suggestion/SuggestionList.vue';\nimport ChannelSuggestion from './ChannelSuggestion.vue';\n\nexport default {\n\n // This function comes from the user and passed to the editor directly.\n // This will also activate the mention plugin on the editor\n // items: ({ query }) => { return [] },\n\n allowSpaces: true,\n\n render: () => {\n let component;\n let popup;\n\n return {\n onStart: props => {\n component = new VueRenderer(SuggestionList, {\n parent: this,\n propsData: {\n itemComponent: ChannelSuggestion,\n itemType: 'channel',\n ...props,\n },\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n getReferenceClientRect: props.clientRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'top-start',\n });\n },\n\n onUpdate (props) {\n component.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup[0].setProps({\n getReferenceClientRect: props.clientRect,\n });\n },\n\n onKeyDown (props) {\n if (props.event.key === 'Escape') {\n popup[0].hide();\n\n return true;\n }\n\n return component?.ref.onKeyDown(props);\n },\n\n onExit () {\n popup[0].destroy();\n component.destroy();\n },\n };\n },\n};\n","<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div>\n <div class=\"d-body--md-compact\">\n <span>/{{ command }}</span><span v-if=\"parametersExample\"> {{ parametersExample }}</span>\n </div>\n <div class=\"d-body--sm\">\n {{ description }}\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'SlashCommandSuggestion',\n\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n\n computed: {\n command () {\n return this.item.command;\n },\n\n description () {\n return this.item.description;\n },\n\n parametersExample () {\n return this.item.parametersExample;\n },\n },\n};\n</script>\n","import { VueRenderer } from '@tiptap/vue-2';\nimport tippy from 'tippy.js';\n\nimport SuggestionList from '../suggestion/SuggestionList.vue';\nimport SlashCommandSuggestion from './SlashCommandSuggestion.vue';\n\nexport default {\n\n // This function comes from the user and passed to the editor directly.\n // This will also activate the mention plugin on the editor\n // items: ({ query }) => { return [] },\n\n allowSpaces: true,\n startOfLine: true,\n\n render: () => {\n let component;\n let popup;\n\n return {\n onStart: props => {\n component = new VueRenderer(SuggestionList, {\n parent: this,\n propsData: {\n itemComponent: SlashCommandSuggestion,\n itemType: 'slash-command',\n ...props,\n },\n editor: props.editor,\n });\n\n if (!props.clientRect) {\n return;\n }\n\n popup = tippy('body', {\n getReferenceClientRect: props.clientRect,\n appendTo: () => document.body,\n content: component.element,\n showOnCreate: true,\n interactive: true,\n trigger: 'manual',\n placement: 'top-start',\n });\n },\n\n onUpdate (props) {\n component.updateProps(props);\n\n if (!props.clientRect) {\n return;\n }\n\n popup[0].setProps({\n getReferenceClientRect: props.clientRect,\n });\n },\n\n onKeyDown (props) {\n if (props.event.key === 'Escape') {\n popup[0].hide();\n\n return true;\n }\n\n return component?.ref.onKeyDown(props);\n },\n\n onExit () {\n popup[0].destroy();\n component.destroy();\n },\n };\n },\n};\n","<template>\n <editor-content\n :editor=\"editor\"\n data-qa=\"dt-rich-text-editor\"\n class=\"dt-rich-text-editor\"\n @selected-command=\"onSelectedCommand\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\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 Emoji from './extensions/emoji';\nimport Link from './extensions/link';\nimport { MentionPlugin, mentionRegex } from './extensions/mentions/mention';\nimport { ChannelPlugin, channelRegex } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport { emojiShortCodeRegex } from './extensions/emoji/emoji.js';\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';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport emojiRegex from 'emoji-regex';\nimport { codeToEmojiData } from '@/common/emoji';\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 * Whether the input allows for line breaks to be introduced in the text.\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: 'text',\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 Link extension and optionally passes configurations to it\n */\n link: {\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 */\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 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 data () {\n return {\n editor: null,\n popoverOpened: false,\n internalValue: this.value,\n };\n },\n\n computed: {\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];\n if (this.link) {\n extensions.push(this.getExtension(Link, this.link));\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.configure({\n itemTypeName: 'listItem',\n }));\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 extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n\n // make sure that this is defined before any other extensions\n // where Enter and Shift+Enter should have its own interaction. otherwise it will be ignored\n if (!this.allowLineBreaks) {\n extensions.push(\n HardBreak.extend({\n addKeyboardShortcuts () {\n return {\n Enter: () => true,\n 'Shift-Enter': () => this.editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]),\n };\n },\n }),\n );\n }\n\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\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 extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'dt-rich-text-editor--code-block',\n },\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 let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n if (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 this.internalValue = newValue;\n this.insertContent();\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n methods: {\n onSelectedCommand (command) {\n this.$emit('selected-command', command);\n },\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 editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n },\n });\n this.insertContent();\n this.addEditorListeners();\n },\n\n /**\n * This function is necessary as tiptap doesn't render the content passed\n * directly through `editor.commands.setContent` the content passed down to it\n * should be already parsed. So We're parsing the elements into it's corresponding\n * HTML version before setting it.\n */\n insertContent () {\n this.parseMentions();\n this.parseChannels();\n this.parseEmojis();\n this.editor.commands.setContent(this.internalValue, true);\n },\n\n parseEmojis () {\n const matches = [...this.value.matchAll(emojiRegex()), ...this.value.matchAll(emojiShortCodeRegex)];\n if (!matches) return;\n\n matches.forEach(match => {\n const emoji = codeToEmojiData(match[0]);\n if (!emoji) return;\n this.internalValue = this.internalValue.replace(new RegExp(` ${match[0]}`), ` <emoji-component code=\"${emoji.shortname}\"></emoji-component>`);\n });\n },\n\n parseChannels () {\n if (!this.channelSuggestion) return;\n\n const suggestions = this.channelSuggestion.items({ query: '' });\n const matches = [...this.value.matchAll(channelRegex)]\n .filter(match => suggestions.some(({ id }) => id === match[1]));\n\n if (!matches) return;\n\n matches.forEach(match => {\n const channel = suggestions.find(({ id }) => id === match[1]);\n this.internalValue = this.internalValue.replace(\n `#${match[1]}`,\n /** The space at the beginning is important as tiptap removes that while rendering.\n * So if multiple mentions, channels or emojis are next to each other it will fail\n */\n ` <channel-component name=\"${channel.name}\" id=\"${channel.id}\"></channel-component>`,\n );\n });\n },\n\n parseMentions () {\n if (!this.mentionSuggestion) return;\n\n const suggestions = this.mentionSuggestion.items({ query: '' });\n const matches = [...this.value.matchAll(mentionRegex)]\n .filter(match => suggestions.some(({ id }) => id === match[1]));\n\n if (!matches) return;\n\n matches.forEach(match => {\n const mention = suggestions.find(({ id }) => id === match[1]);\n this.internalValue = this.internalValue.replace(`@${match[1]}`, ` <mention-component name=\"${mention.name}\" id=\"${mention.id}\"></mention-component>`);\n });\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 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();\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({ editorProps: { attributes } });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n .ProseMirror p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--dt-color-foreground-placeholder);\n pointer-events: none;\n height: 0;\n }\n\n .ProseMirror ul > li {\n list-style-type: disc;\n }\n\n .ProseMirror ol > li {\n list-style-type: decimal;\n }\n\n .ProseMirror blockquote {\n padding-left: var(--dt-space-400);\n border-left: var(--dt-size-border-300) solid var(--dt-color-foreground-muted-inverted);\n margin-left: 0;\n }\n\n .dt-rich-text-editor--code-block {\n background: var(--dt-color-surface-secondary);\n padding: var(--dt-space-400);\n }\n\n .dt-rich-text-editor {\n overflow: hidden;\n }\n</style>\n"],"names":["_sfc_main","NodeViewWrapper","DtEmoji","nodeViewProps","DtListItem","DtStack","emojisIndexed","VueRenderer","this","PluginKey","codeToEmojiData","Node","VueNodeViewRenderer","mergeAttributes","nodeInputRule","nodePasteRule","getMarksBetween","getPhoneNumberRegex","linkRegex","from","to","Plugin","tr","combineTransactionSteps","getChangedRanges","findChildrenInRange","Mark","DtLink","DtAv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