@dialpad/dialtone-vue 2.126.0 → 2.127.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/_plugin-vue2_normalizer-ZK80B3OL.js +2 -0
- package/dist/chunks/_plugin-vue2_normalizer-ZK80B3OL.js.map +1 -0
- package/dist/chunks/dropdown-zhMEz3bn.js +2 -0
- package/dist/chunks/dropdown-zhMEz3bn.js.map +1 -0
- package/dist/chunks/dropdown_constants-KHFvVI2L.js +2 -0
- package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +1 -0
- package/dist/chunks/icon_constants-2S_OSQ1t.js +2 -0
- package/dist/chunks/icon_constants-2S_OSQ1t.js.map +1 -0
- package/dist/chunks/index-2jPosQBn.js +3 -0
- package/dist/chunks/index-2jPosQBn.js.map +1 -0
- package/dist/chunks/index-sdfB7Aok.js +2 -0
- package/dist/chunks/index-sdfB7Aok.js.map +1 -0
- package/dist/chunks/input-o-fc1X4b.js +2 -0
- package/dist/chunks/input-o-fc1X4b.js.map +1 -0
- package/dist/chunks/input_group-j2gTtc1C.js +2 -0
- package/dist/chunks/input_group-j2gTtc1C.js.map +1 -0
- package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +2 -0
- package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js.map +1 -0
- package/dist/chunks/link_constants-Kn6kP4i1.js +2 -0
- package/dist/chunks/link_constants-Kn6kP4i1.js.map +1 -0
- package/dist/chunks/list_item_constants-Tsz5CO1m.js +2 -0
- package/dist/chunks/list_item_constants-Tsz5CO1m.js.map +1 -0
- package/dist/chunks/modal-qEzlo0Sj.js +2 -0
- package/dist/chunks/modal-qEzlo0Sj.js.map +1 -0
- package/dist/chunks/notice_action-u3ZKIhit.js +2 -0
- package/dist/chunks/notice_action-u3ZKIhit.js.map +1 -0
- package/dist/chunks/notice_constants-mC6al2Dm.js +2 -0
- package/dist/chunks/notice_constants-mC6al2Dm.js.map +1 -0
- package/dist/chunks/popover_constants-hOEhklvr.js +2 -0
- package/dist/chunks/popover_constants-hOEhklvr.js.map +1 -0
- package/dist/chunks/sr_only_close_button-ErijKGYR.js +3 -0
- package/dist/chunks/sr_only_close_button-ErijKGYR.js.map +1 -0
- package/dist/chunks/stack_constants-m9Ickqw0.js +2 -0
- package/dist/chunks/stack_constants-m9Ickqw0.js.map +1 -0
- package/dist/chunks/tab-7hJQSLFx.js +2 -0
- package/dist/chunks/tab-7hJQSLFx.js.map +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +2 -0
- package/dist/dialtone-vue.cjs.map +1 -0
- package/dist/lib/attachment-carousel.cjs +2 -0
- package/dist/lib/attachment-carousel.cjs.map +1 -0
- package/dist/lib/attachment-carousel.js +2 -3
- package/dist/lib/attachment-carousel.js.map +1 -1
- package/dist/lib/avatar.cjs +2 -0
- package/dist/lib/avatar.cjs.map +1 -0
- package/dist/lib/avatar.js +2 -3
- package/dist/lib/avatar.js.map +1 -1
- package/dist/lib/badge.cjs +2 -0
- package/dist/lib/badge.cjs.map +1 -0
- package/dist/lib/badge.js +2 -3
- package/dist/lib/badge.js.map +1 -1
- package/dist/lib/banner.cjs +3 -0
- package/dist/lib/banner.cjs.map +1 -0
- package/dist/lib/banner.js +2 -3
- package/dist/lib/banner.js.map +1 -1
- package/dist/lib/breadcrumbs.cjs +2 -0
- package/dist/lib/breadcrumbs.cjs.map +1 -0
- package/dist/lib/button-group.cjs +2 -0
- package/dist/lib/button-group.cjs.map +1 -0
- package/dist/lib/button.cjs +2 -0
- package/dist/lib/button.cjs.map +1 -0
- package/dist/lib/callbar-button-with-popover.cjs +2 -0
- package/dist/lib/callbar-button-with-popover.cjs.map +1 -0
- package/dist/lib/callbar-button-with-popover.js +2 -3
- package/dist/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/lib/callbar-button.cjs +2 -0
- package/dist/lib/callbar-button.cjs.map +1 -0
- package/dist/lib/callbox.cjs +2 -0
- package/dist/lib/callbox.cjs.map +1 -0
- package/dist/lib/callbox.js +2 -3
- package/dist/lib/callbox.js.map +1 -1
- package/dist/lib/card.cjs +2 -0
- package/dist/lib/card.cjs.map +1 -0
- package/dist/lib/checkbox-group.cjs +2 -0
- package/dist/lib/checkbox-group.cjs.map +1 -0
- package/dist/lib/checkbox.cjs +2 -0
- package/dist/lib/checkbox.cjs.map +1 -0
- package/dist/lib/chip.cjs +2 -0
- package/dist/lib/chip.cjs.map +1 -0
- package/dist/lib/chip.js +2 -3
- package/dist/lib/chip.js.map +1 -1
- package/dist/lib/codeblock.cjs +3 -0
- package/dist/lib/codeblock.cjs.map +1 -0
- package/dist/lib/collapsible.cjs +2 -0
- package/dist/lib/collapsible.cjs.map +1 -0
- package/dist/lib/collapsible.js +2 -3
- package/dist/lib/collapsible.js.map +1 -1
- package/dist/lib/combobox-multi-select.cjs +2 -0
- package/dist/lib/combobox-multi-select.cjs.map +1 -0
- package/dist/lib/combobox-with-popover.cjs +2 -0
- package/dist/lib/combobox-with-popover.cjs.map +1 -0
- package/dist/lib/combobox-with-popover.js +1 -1
- package/dist/lib/combobox.cjs +2 -0
- package/dist/lib/combobox.cjs.map +1 -0
- package/dist/lib/constants.cjs +2 -0
- package/dist/lib/constants.cjs.map +1 -0
- package/dist/lib/contact-info.cjs +2 -0
- package/dist/lib/contact-info.cjs.map +1 -0
- package/dist/lib/contact-info.js +2 -3
- package/dist/lib/contact-info.js.map +1 -1
- package/dist/lib/contact-row.cjs +2 -0
- package/dist/lib/contact-row.cjs.map +1 -0
- package/dist/lib/datepicker.cjs +2 -0
- package/dist/lib/datepicker.cjs.map +1 -0
- package/dist/lib/datepicker.js +12 -13
- package/dist/lib/datepicker.js.map +1 -1
- package/dist/lib/dates.cjs +2 -0
- package/dist/lib/dates.cjs.map +1 -0
- package/dist/lib/description-list.cjs +2 -0
- package/dist/lib/description-list.cjs.map +1 -0
- package/dist/lib/dropdown.cjs +2 -0
- package/dist/lib/dropdown.cjs.map +1 -0
- package/dist/lib/dropdown.js +6 -7
- package/dist/lib/dropdown.js.map +1 -1
- package/dist/lib/editor.cjs +2 -0
- package/dist/lib/editor.cjs.map +1 -0
- package/dist/lib/emoji-picker.cjs +2 -0
- package/dist/lib/emoji-picker.cjs.map +1 -0
- package/dist/lib/emoji-picker.js +2 -3
- package/dist/lib/emoji-picker.js.map +1 -1
- package/dist/lib/emoji-row.cjs +2 -0
- package/dist/lib/emoji-row.cjs.map +1 -0
- package/dist/lib/emoji-text-wrapper.cjs +2 -0
- package/dist/lib/emoji-text-wrapper.cjs.map +1 -0
- package/dist/lib/emoji.cjs +2 -0
- package/dist/lib/emoji.cjs.map +1 -0
- package/dist/lib/feed-item-row.cjs +2 -0
- package/dist/lib/feed-item-row.cjs.map +1 -0
- package/dist/lib/feed-item-row.js +2 -3
- package/dist/lib/feed-item-row.js.map +1 -1
- package/dist/lib/feed-pill.cjs +2 -0
- package/dist/lib/feed-pill.cjs.map +1 -0
- package/dist/lib/feed-pill.js +2 -3
- package/dist/lib/feed-pill.js.map +1 -1
- package/dist/lib/general-row.cjs +2 -0
- package/dist/lib/general-row.cjs.map +1 -0
- package/dist/lib/group-row.cjs +2 -0
- package/dist/lib/group-row.cjs.map +1 -0
- package/dist/lib/group-row.js +1 -1
- package/dist/lib/grouped-chip.cjs +2 -0
- package/dist/lib/grouped-chip.cjs.map +1 -0
- package/dist/lib/grouped-chip.js +6 -7
- package/dist/lib/grouped-chip.js.map +1 -1
- package/dist/lib/hovercard.cjs +2 -0
- package/dist/lib/hovercard.cjs.map +1 -0
- package/dist/lib/hovercard.js +6 -7
- package/dist/lib/hovercard.js.map +1 -1
- package/dist/lib/icon.cjs +2 -0
- package/dist/lib/icon.cjs.map +1 -0
- package/dist/lib/icon.js +14 -38
- package/dist/lib/icon.js.map +1 -1
- package/dist/lib/image-viewer.cjs +2 -0
- package/dist/lib/image-viewer.cjs.map +1 -0
- package/dist/lib/image-viewer.js +11 -12
- package/dist/lib/image-viewer.js.map +1 -1
- package/dist/lib/input-group.cjs +2 -0
- package/dist/lib/input-group.cjs.map +1 -0
- package/dist/lib/input.cjs +2 -0
- package/dist/lib/input.cjs.map +1 -0
- package/dist/lib/item-layout.cjs +2 -0
- package/dist/lib/item-layout.cjs.map +1 -0
- package/dist/lib/ivr-node.cjs +2 -0
- package/dist/lib/ivr-node.cjs.map +1 -0
- package/dist/lib/ivr-node.js +4 -5
- package/dist/lib/ivr-node.js.map +1 -1
- package/dist/lib/keyboard-shortcut.cjs +2 -0
- package/dist/lib/keyboard-shortcut.cjs.map +1 -0
- package/dist/lib/keyboard-shortcut.js +4 -5
- package/dist/lib/keyboard-shortcut.js.map +1 -1
- package/dist/lib/lazy-show.cjs +2 -0
- package/dist/lib/lazy-show.cjs.map +1 -0
- package/dist/lib/link.cjs +2 -0
- package/dist/lib/link.cjs.map +1 -0
- package/dist/lib/list-item-group.cjs +2 -0
- package/dist/lib/list-item-group.cjs.map +1 -0
- package/dist/lib/list-item.cjs +2 -0
- package/dist/lib/list-item.cjs.map +1 -0
- package/dist/lib/list-item.js +2 -3
- package/dist/lib/list-item.js.map +1 -1
- package/dist/lib/message-input.cjs +2 -0
- package/dist/lib/message-input.cjs.map +1 -0
- package/dist/lib/message-input.js +89 -47
- package/dist/lib/message-input.js.map +1 -1
- package/dist/lib/mixins.cjs +2 -0
- package/dist/lib/mixins.cjs.map +1 -0
- package/dist/lib/modal.cjs +3 -0
- package/dist/lib/modal.cjs.map +1 -0
- package/dist/lib/modal.js +10 -11
- package/dist/lib/modal.js.map +1 -1
- package/dist/lib/notice.cjs +2 -0
- package/dist/lib/notice.cjs.map +1 -0
- package/dist/lib/notice.js +2 -3
- package/dist/lib/notice.js.map +1 -1
- package/dist/lib/pagination.cjs +2 -0
- package/dist/lib/pagination.cjs.map +1 -0
- package/dist/lib/pagination.js +2 -3
- package/dist/lib/pagination.js.map +1 -1
- package/dist/lib/popover.cjs +2 -0
- package/dist/lib/popover.cjs.map +1 -0
- package/dist/lib/popover.js +4 -5
- package/dist/lib/popover.js.map +1 -1
- package/dist/lib/presence.cjs +2 -0
- package/dist/lib/presence.cjs.map +1 -0
- package/dist/lib/radio-group.cjs +2 -0
- package/dist/lib/radio-group.cjs.map +1 -0
- package/dist/lib/radio.cjs +2 -0
- package/dist/lib/radio.cjs.map +1 -0
- package/dist/lib/rich-text-editor.cjs +2 -0
- package/dist/lib/rich-text-editor.cjs.map +1 -0
- package/dist/lib/rich-text-editor.js +106 -74
- package/dist/lib/rich-text-editor.js.map +1 -1
- package/dist/lib/root-layout.cjs +2 -0
- package/dist/lib/root-layout.cjs.map +1 -0
- package/dist/lib/select-menu.cjs +2 -0
- package/dist/lib/select-menu.cjs.map +1 -0
- package/dist/lib/settings-menu-button.cjs +2 -0
- package/dist/lib/settings-menu-button.cjs.map +1 -0
- package/dist/lib/settings-menu-button.js +2 -3
- package/dist/lib/settings-menu-button.js.map +1 -1
- package/dist/lib/skeleton.cjs +2 -0
- package/dist/lib/skeleton.cjs.map +1 -0
- package/dist/lib/stack.cjs +2 -0
- package/dist/lib/stack.cjs.map +1 -0
- package/dist/lib/tabs.cjs +2 -0
- package/dist/lib/tabs.cjs.map +1 -0
- package/dist/lib/time-pill.cjs +2 -0
- package/dist/lib/time-pill.cjs.map +1 -0
- package/dist/lib/toast.cjs +2 -0
- package/dist/lib/toast.cjs.map +1 -0
- package/dist/lib/toast.js +2 -3
- package/dist/lib/toast.js.map +1 -1
- package/dist/lib/toggle.cjs +2 -0
- package/dist/lib/toggle.cjs.map +1 -0
- package/dist/lib/tooltip-directive.cjs +2 -0
- package/dist/lib/tooltip-directive.cjs.map +1 -0
- package/dist/lib/tooltip.cjs +2 -0
- package/dist/lib/tooltip.cjs.map +1 -0
- package/dist/lib/top-banner-info.cjs +2 -0
- package/dist/lib/top-banner-info.cjs.map +1 -0
- package/dist/lib/unread-pill.cjs +2 -0
- package/dist/lib/unread-pill.cjs.map +1 -0
- package/dist/lib/unread-pill.js +3 -4
- package/dist/lib/unread-pill.js.map +1 -1
- package/dist/lib/utils.cjs +2 -0
- package/dist/lib/utils.cjs.map +1 -0
- package/dist/lib/validation-messages.cjs +2 -0
- package/dist/lib/validation-messages.cjs.map +1 -0
- package/dist/lib/validators.cjs +2 -0
- package/dist/lib/validators.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/components/button/button.vue.d.ts +2 -2
- package/dist/types/components/card/card.vue.d.ts +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/types/components/collapsible/collapsible.vue.d.ts +2 -2
- package/dist/types/components/combobox/combobox.vue.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
- package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
- package/dist/types/components/icon/icon.vue.d.ts +2 -22
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +2 -2
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts +91 -1
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +90 -0
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts +1 -1
- package/dist/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +1 -1
- package/package.json +10 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor.js","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/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/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 }\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 { shortcodeToEmojiData, 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+:$/;\nconst pasteShortCodeRegex = /:\\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(pasteShortCodeRegex)];\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 = shortcodeToEmojiData(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 '(?:&|&)(?: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 { VueNodeViewRenderer } from '@tiptap/vue-2';\n\n// Mention component\nimport MentionComponent from './MentionComponent.vue';\nimport { mergeAttributes } from '@tiptap/core';\n\nexport const MentionPlugin = Mention.extend({\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), 0];\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 <editor-content\n :editor=\"editor\"\n data-qa=\"dt-rich-text-editor\"\n class=\"dt-rich-text-editor\"\n />\n</template>\n\n<script>\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 } from './extensions/mentions/mention';\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 suggestion from './extensions/mentions/suggestion';\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 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 input\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 };\n },\n\n computed: {\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [\n Blockquote,\n Bold,\n BulletList,\n Document,\n Italic,\n ListItem,\n Paragraph,\n Strike,\n Text,\n Underline,\n ];\n if (this.link) {\n extensions.push(this.getExtension(Link, this.link));\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, ...suggestion };\n extensions.push(MentionPlugin.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 extensions.push(OrderedList.configure({\n itemTypeName: 'listItem',\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 // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n methods: {\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n },\n });\n this.addEditorListeners();\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","event","activeElement","index","item","DtStack","suggestionOptions","query","emojisIndexed","editor","range","props","nodeAfter","_a","_b","component","popup","VueRenderer","SuggestionList","this","EmojiSuggestion","tippy","EmojiPluginKey","PluginKey","inputShortCodeRegex","pasteShortCodeRegex","inputUnicodeRegex","pasteUnicodeRegex","inputRuleMatch","match","codeToEmojiData","shortCodePasteMatch","text","Emoji","Node","VueNodeViewRenderer","EmojiComponent","node","HTMLAttributes","mergeAttributes","nodeInputRule","attrs","unicode","shortcodeToEmojiData","nodePasteRule","Suggestion","getRegexMatches","regex","validator","matches","hasValidPrefix","trimEndPunctiation","string","endPunctuationRegex","getWordAt","left","right","word","getWordAtUntil","direction","newIndex","removeMarks","doc","tr","type","from","to","marksInRange","getMarksBetween","mark","partialPhoneNumberRegex","getPhoneNumberRegex","addMarks","pos","rangeFrom","rangeTo","firstWordInRange","lastWordInRange","wordsInRange","linkRegex","autolink","options","hasInitialized","Plugin","transactions","oldState","newState","contentChanged","textContent","transform","combineTransactionSteps","getChangedRanges","oldRange","newRange","findChildrenInRange","defaultAttributes","Link","Mark","DtLink","MentionPlugin","Mention","MentionComponent","RICH_TEXT_EDITOR_OUTPUT_FORMATS","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS","DtAvatar","suggestion","MentionSuggestion","EditorContent","autoFocus","outputFormat","extensions","Blockquote","Bold","BulletList","Document","Italic","ListItem","Paragraph","Strike","Text","Underline","Placeholder","HardBreak","commands","TipTapLink","suggestionObject","TextAlign","CodeBlock","OrderedList","isEditable","newClass","newLabel","newValue","currentValue","Editor","value","extension","attributes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAAA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,iBAAAC;AAAA,IACA,SAAAC;AAAA,EACA;AAAA,EAEA,OAAAC;AACA;;;;;;;;;;;;;;uBCKAH,KAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,YAAAI;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;AAA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A;AAEA,WAAA,OAAA,GAAA,UAAA,MAAA;AACA,cAAAC,IAAA,KAAA;AACA,aAAA,MAAA,SAAAA,CAAA,GACA,KAAA,MAAA,gBAAAA,CAAA;AAAA,MACA,CAAA,GAGA,KAAA,OAAA,GAAA,SAAA,CAAA,EAAA,OAAAvI,EAAA,MAAA;AACA,aAAA,MAAA,SAAAA,CAAA;AAAA,MACA,CAAA,GAGA,KAAA,OAAA,GAAA,QAAA,CAAA,EAAA,OAAAA,EAAA,MAAA;AACA,aAAA,MAAA,QAAAA,CAAA;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,aAAAwI,GAAAxD,GAAA;;AACA,aAAA,OAAAA,KAAA,YACAwD,KAEA5H,IAAA4H,EAAA,cAAA,gBAAA5H,EAAA,KAAA4H,GAAAxD;AAAA,IACA;AAAA,IAEA,uBAAAyD,GAAA;AACA,WAAA,OAAA,WAAA,EAAA,aAAA,EAAA,YAAAA,EAAA,EAAA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"rich-text-editor.js","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/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/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 }\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 { shortcodeToEmojiData, 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+:$/;\nconst pasteShortCodeRegex = /:\\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(pasteShortCodeRegex)];\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 = shortcodeToEmojiData(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 '(?:&|&)(?: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 { VueNodeViewRenderer } from '@tiptap/vue-2';\n\n// Mention component\nimport MentionComponent from './MentionComponent.vue';\nimport { mergeAttributes } from '@tiptap/core';\n\nexport const MentionPlugin = Mention.extend({\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), 0];\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 <editor-content\n :editor=\"editor\"\n data-qa=\"dt-rich-text-editor\"\n class=\"dt-rich-text-editor\"\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 } from './extensions/mentions/mention';\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 suggestion from './extensions/mentions/suggestion';\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 * 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 input\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 };\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, ...suggestion };\n extensions.push(MentionPlugin.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 // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n methods: {\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n },\n });\n this.addEditorListeners();\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","event","activeElement","index","item","DtStack","suggestionOptions","query","emojisIndexed","editor","range","props","nodeAfter","_a","_b","component","popup","VueRenderer","SuggestionList","this","EmojiSuggestion","tippy","EmojiPluginKey","PluginKey","inputShortCodeRegex","pasteShortCodeRegex","inputUnicodeRegex","pasteUnicodeRegex","inputRuleMatch","match","codeToEmojiData","shortCodePasteMatch","text","Emoji","Node","VueNodeViewRenderer","EmojiComponent","node","HTMLAttributes","mergeAttributes","nodeInputRule","attrs","unicode","shortcodeToEmojiData","nodePasteRule","Suggestion","getRegexMatches","regex","validator","matches","hasValidPrefix","trimEndPunctiation","string","endPunctuationRegex","getWordAt","left","right","word","getWordAtUntil","direction","newIndex","removeMarks","doc","tr","type","from","to","marksInRange","getMarksBetween","mark","partialPhoneNumberRegex","getPhoneNumberRegex","addMarks","pos","rangeFrom","rangeTo","firstWordInRange","lastWordInRange","wordsInRange","linkRegex","autolink","options","hasInitialized","Plugin","transactions","oldState","newState","contentChanged","textContent","transform","combineTransactionSteps","getChangedRanges","oldRange","newRange","findChildrenInRange","defaultAttributes","Link","Mark","DtLink","MentionPlugin","Mention","MentionComponent","RICH_TEXT_EDITOR_OUTPUT_FORMATS","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS","DtAvatar","suggestion","MentionSuggestion","EditorContent","autoFocus","outputFormat","extensions","Document","Paragraph","Text","Blockquote","Bold","BulletList","ListItem","OrderedList","Italic","Strike","Underline","Placeholder","HardBreak","commands","TipTapLink","suggestionObject","TextAlign","CodeBlock","isEditable","newClass","newLabel","newValue","currentValue","Editor","value","extension","attributes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAAA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,iBAAAC;AAAA,IACA,SAAAC;AAAA,EACA;AAAA,EAEA,OAAAC;AACA;;;;;;;;;;;;;;uBCKAH,KAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,YAAAI;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,OA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A;MACA;AAAA,IACA;AAAA,IAEA,aAAAwI,GAAAxD,GAAA;;AACA,aAAA,OAAAA,KAAA,YACAwD,KAEA5H,IAAA4H,EAAA,cAAA,gBAAA5H,EAAA,KAAA4H,GAAAxD;AAAA,IACA;AAAA,IAEA,uBAAAyD,GAAA;AACA,WAAA,OAAA,WAAA,EAAA,aAAA,EAAA,YAAAA,EAAA,EAAA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js"),o={LEFT:"left",RIGHT:"right"},r=["sm","md","lg",null],l={name:"DtRootLayout",props:{fixed:{type:Boolean,default:!0},headerClass:{type:[String,Array,Object],default:""},headerHeight:{type:String,default:"64px"},headerSticky:{type:Boolean,default:!1},contentClass:{type:[String,Array,Object],default:""},sidebarClass:{type:[String,Array,Object],default:""},sidebarWidth:{type:String,default:"256px"},sidebarPosition:{type:String,default:"left",validator:a=>Object.values(o).includes(a)},footerClass:{type:[String,Array,Object],default:""},footerHeight:{type:String,default:"64px"},responsiveBreakpoint:{type:String,default:null,validator:a=>r.includes(a)}},computed:{isInverted(){return this.sidebarPosition===o.RIGHT}}};var d=function(){var t=this,e=t._self._c;return e("div",{class:["root-layout","d-root-layout",{"d-root-layout--fixed":t.fixed,"d-root-layout--inverted":t.isInverted,[`d-root-layout__responsive--${t.responsiveBreakpoint}`]:!!t.responsiveBreakpoint}],attrs:{"data-qa":"dt-root-layout"}},[e("header",{class:["d-root-layout__header",{"d-root-layout__header--sticky":t.headerSticky},t.headerClass],attrs:{"data-qa":"dt-root-layout-header"}},[t._t("header")],2),e("aside",{ref:"root-layout-sidebar",class:["d-root-layout__sidebar",t.sidebarClass],attrs:{tabindex:"0","data-qa":"dt-root-layout-sidebar"}},[t._t("sidebar")],2),e("main",{ref:"root-layout-content",class:["d-root-layout__content",t.contentClass],attrs:{"data-qa":"dt-root-layout-content",tabindex:"0"}},[t._t("default")],2),e("footer",{class:["d-root-layout__footer",t.footerClass],attrs:{"data-qa":"dt-root-layout-footer"}},[t._t("footer")],2)])},n=[],i=s.n(l,d,n,!1,null,null,null,null);const u=i.exports;exports.DtRootLayout=u;exports.ROOT_LAYOUT_RESPONSIVE_BREAKPOINTS=r;exports.ROOT_LAYOUT_SIDEBAR_POSITIONS=o;
|
|
2
|
+
//# sourceMappingURL=root-layout.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-layout.cjs","sources":["../../components/root_layout/root_layout_constants.js","../../components/root_layout/root_layout.vue"],"sourcesContent":["export const ROOT_LAYOUT_SIDEBAR_POSITIONS = {\n LEFT: 'left',\n RIGHT: 'right',\n};\n\nexport const ROOT_LAYOUT_RESPONSIVE_BREAKPOINTS = ['sm', 'md', 'lg', null];\n\nexport default {\n ROOT_LAYOUT_SIDEBAR_POSITIONS,\n ROOT_LAYOUT_RESPONSIVE_BREAKPOINTS,\n};\n","<template>\n <div\n :class=\"[\n 'root-layout',\n 'd-root-layout',\n {\n 'd-root-layout--fixed': fixed,\n 'd-root-layout--inverted': isInverted,\n [`d-root-layout__responsive--${responsiveBreakpoint}`]: !!responsiveBreakpoint,\n },\n ]\"\n data-qa=\"dt-root-layout\"\n >\n <header\n :class=\"['d-root-layout__header', { 'd-root-layout__header--sticky': headerSticky }, headerClass]\"\n data-qa=\"dt-root-layout-header\"\n >\n <!-- @slot Slot for header content, be sure to set a height on the element inside this\n if you want a fixed height. -->\n <slot name=\"header\" />\n </header>\n <aside\n ref=\"root-layout-sidebar\"\n tabindex=\"0\"\n :class=\"['d-root-layout__sidebar', sidebarClass]\"\n data-qa=\"dt-root-layout-sidebar\"\n >\n <!-- @slot Slot for sidebar content, be sure to set a width on the element within this. -->\n <slot name=\"sidebar\" />\n </aside>\n <main\n ref=\"root-layout-content\"\n :class=\"['d-root-layout__content', contentClass]\"\n data-qa=\"dt-root-layout-content\"\n tabindex=\"0\"\n >\n <!-- @slot Slot for the main content -->\n <slot />\n </main>\n <footer\n :class=\"['d-root-layout__footer', footerClass]\"\n data-qa=\"dt-root-layout-footer\"\n >\n <!-- @slot Slot for footer content, be sure to set a height on the element inside this\n if you want a fixed height. -->\n <slot name=\"footer\" />\n </footer>\n </div>\n</template>\n\n<script>\nimport { ROOT_LAYOUT_SIDEBAR_POSITIONS, ROOT_LAYOUT_RESPONSIVE_BREAKPOINTS } from './root_layout_constants';\n\n/**\n * A root layout provides a standardized group of containers to display content at the root level.\n */\nexport default {\n name: 'DtRootLayout',\n\n props: {\n /**\n * When true, the header, footer and sidebar will be locked in position and the content will\n * be scrollable. When false the header, footer and sidebar will scroll out of view.\n * @values true, false\n */\n fixed: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional class name for the header element\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * DEPRECATED: set the height of the inner element instead.\n */\n headerHeight: {\n type: String,\n default: '64px',\n },\n\n /**\n * Scroll the header with the page\n * @values true, false\n */\n headerSticky: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the content element\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the sidebar element\n */\n sidebarClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * DEPRECATED: set the width of the inner element instead.\n */\n sidebarWidth: {\n type: String,\n default: '256px',\n },\n\n /**\n * Whether the sidebar is on the left or right side\n * Possible options: 'left', 'right'\n * @values left, right\n */\n sidebarPosition: {\n type: String,\n default: 'left',\n validator: (s) => Object.values(ROOT_LAYOUT_SIDEBAR_POSITIONS).includes(s),\n },\n\n /**\n * Additional class name for the footer element\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * DEPRECATED: set the height of the inner element instead.\n */\n footerHeight: {\n type: String,\n default: '64px',\n },\n\n /**\n * Defines the breakpoint when the root layout will change to responsive version\n * @values 'sm', 'md', 'lg', null\n */\n responsiveBreakpoint: {\n type: String,\n default: null,\n validator: (bp) => ROOT_LAYOUT_RESPONSIVE_BREAKPOINTS.includes(bp),\n },\n },\n\n computed: {\n isInverted () {\n return this.sidebarPosition === ROOT_LAYOUT_SIDEBAR_POSITIONS.RIGHT;\n },\n },\n};\n</script>\n"],"names":["ROOT_LAYOUT_SIDEBAR_POSITIONS","ROOT_LAYOUT_RESPONSIVE_BREAKPOINTS","_sfc_main","s","bp"],"mappings":"iJAAaA,EAAgC,CAC3C,KAAM,OACN,MAAO,OACT,EAEaC,EAAqC,CAAC,KAAM,KAAM,KAAM,IAAI,ECmDzEC,EAAA,CACA,KAAA,eAEA,MAAA,CAMA,MAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAKA,aAAA,CACA,KAAA,OACA,QAAA,MACA,EAMA,aAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,aAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAKA,aAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAKA,aAAA,CACA,KAAA,OACA,QAAA,OACA,EAOA,gBAAA,CACA,KAAA,OACA,QAAA,OACA,UAAAC,GAAA,OAAA,OAAAH,CAAA,EAAA,SAAAG,CAAA,CACA,EAKA,YAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAKA,aAAA,CACA,KAAA,OACA,QAAA,MACA,EAMA,qBAAA,CACA,KAAA,OACA,QAAA,KACA,UAAAC,GAAAH,EAAA,SAAAG,CAAA,CACA,CACA,EAEA,SAAA,CACA,YAAA,CACA,OAAA,KAAA,kBAAAJ,EAAA,KACA,CACA,CACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("vue"),i=require("./constants.cjs"),r=require("./utils.cjs"),o=require("../chunks/input-o-fc1X4b.js"),c=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js"),u=require("./validation-messages.cjs");require("./validators.cjs");const l={xs:"d-select--xs",sm:"d-select--sm",md:"",lg:"d-select--lg",xl:"d-select--xl"},n={error:"d-select__input--error",warning:"d-select__input--warning",success:"d-select__input--success"},p=t=>!t.index||typeof t.index=="number",_=t=>t.value?typeof t.value=="string"||typeof t.value=="number":!1,f=t=>t.label?typeof t.label=="string":!1,S=t=>t?t.every(e=>!(!p(e)||!_(e)||!f(e))):!0,b={name:"DtSelectMenu",components:{DtValidationMessages:u.DtValidationMessages},mixins:[o.M],inheritAttrs:!1,props:{label:{type:String,default:""},description:{type:String,default:""},options:{type:Array,default:()=>[],validator:t=>S(t)},value:{type:String,default:null},size:{type:String,default:"md",validator:t=>Object.keys(l).includes(t)},labelClass:{type:[String,Array,Object],default:""},descriptionClass:{type:[String,Array,Object],default:""},selectClass:{type:[String,Array,Object],default:""},optionClass:{type:[String,Array,Object],default:""},labelChildProps:{type:Object,default:()=>({})},descriptionChildProps:{type:Object,default:()=>({})},optionChildProps:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},emits:["input","change"],data(){return{LABEL_SIZE_MODIFIERS:i.LABEL_SIZE_MODIFIERS,DESCRIPTION_SIZE_MODIFIERS:i.DESCRIPTION_SIZE_MODIFIERS,SELECT_SIZE_MODIFIERS:l,SELECT_STATE_MODIFIERS:n}},computed:{selectListeners(){return{...this.$listeners,input:()=>{},change:t=>this.emitValue(t.target.value,t)}},state(){return r.getValidationState(this.formattedMessages)},selectKey(){return r.getUniqueString()},descriptionKey(){return`select-${this.selectKey}-description`},labelAriaDetails(){return this.$slots.description||this.description?this.descriptionKey:this.$attrs["aria-details"]}},mounted(){this.validateOptionsPresence()},beforeUpdate(){this.validateOptionsPresence()},methods:{emitValue(t,e){this.$emit("input",t,e),this.$emit("change",t,e)},getOptionKey(t){return`select-${this.selectKey}-option-${t}`},validateOptionsPresence(){var t;((t=this.options)==null?void 0:t.length)<1&&!this.$slots.default&&d.util.warn("Options are expected to be provided via prop or slot",this)}}};var E=function(){var e=this,s=e._self._c;return s("div",[s("label",[e.$slots.label||e.label?s("div",e._b({class:["d-label",e.LABEL_SIZE_MODIFIERS[e.size],e.labelClass],attrs:{"aria-details":e.labelAriaDetails,"data-qa":"dt-select-label"}},"div",e.labelChildProps,!1),[e._t("label",function(){return[e._v(e._s(e.label))]})],2):e._e(),e.$slots.description||e.description?s("div",e._b({class:["d-description",e.DESCRIPTION_SIZE_MODIFIERS[e.size],e.descriptionClass],attrs:{id:e.descriptionKey,"data-qa":"dt-select-description"}},"div",e.descriptionChildProps,!1),[e._t("description",function(){return[e._v(e._s(e.description))]})],2):e._e(),s("div",{class:["d-select",e.SELECT_SIZE_MODIFIERS[e.size],e.selectClass,{"d-select--disabled":e.disabled}],attrs:{"data-qa":"dt-select-wrapper"}},[s("select",e._g(e._b({ref:"selectElement",class:["d-select__input",e.SELECT_STATE_MODIFIERS[e.state]],attrs:{"data-qa":"dt-select",disabled:e.disabled},domProps:{value:e.value}},"select",e.$attrs,!1),e.selectListeners),[e._t("default",function(){return e._l(e.options,function(a){return s("option",e._b({key:e.getOptionKey(a.value),class:e.optionClass,domProps:{value:a.value}},"option",e.optionChildProps,!1),[e._v(" "+e._s(a.label)+" ")])})})],2)])]),s("dt-validation-messages",e._b({class:e.messagesClass,attrs:{"validation-messages":e.formattedMessages,"show-messages":e.showMessages,"data-qa":"dt-select-messages"}},"dt-validation-messages",e.messagesChildProps,!1))],1)},g=[],I=c.n(b,E,g,!1,null,null,null,null);const h=I.exports;exports.DtSelectMenu=h;exports.SELECT_SIZE_MODIFIERS=l;exports.SELECT_STATE_MODIFIERS=n;
|
|
2
|
+
//# sourceMappingURL=select-menu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-menu.cjs","sources":["../../components/select_menu/select_menu_constants.js","../../components/select_menu/select_menu_validators.js","../../components/select_menu/select_menu.vue"],"sourcesContent":["export const SELECT_SIZE_MODIFIERS = {\n xs: 'd-select--xs',\n sm: 'd-select--sm',\n md: '',\n lg: 'd-select--lg',\n xl: 'd-select--xl',\n};\n\nexport const SELECT_STATE_MODIFIERS = {\n error: 'd-select__input--error',\n warning: 'd-select__input--warning',\n success: 'd-select__input--success',\n};\n\nexport default {\n SELECT_SIZE_MODIFIERS,\n SELECT_STATE_MODIFIERS,\n};\n","const hasValidOptionIndex = option => !option.index || typeof option.index === 'number';\n\nconst hasValidOptionValue = option => {\n if (!option.value) {\n return false;\n }\n\n return typeof option.value === 'string' || typeof option.value === 'number';\n};\n\nconst hasValidOptionLabel = option => {\n if (!option.label) {\n return false;\n }\n\n return typeof option.label === 'string';\n};\n\nexport const optionsValidator = options => {\n if (!options) {\n return true;\n }\n\n return options.every(option => {\n if (!hasValidOptionIndex(option)) {\n return false;\n }\n\n if (!hasValidOptionValue(option)) {\n return false;\n }\n\n if (!hasValidOptionLabel(option)) {\n return false;\n }\n\n return true;\n });\n};\n","<template>\n <div>\n <label>\n <div\n v-if=\"$slots.label || label\"\n :aria-details=\"labelAriaDetails\"\n :class=\"[\n 'd-label',\n LABEL_SIZE_MODIFIERS[size],\n labelClass,\n ]\"\n v-bind=\"labelChildProps\"\n data-qa=\"dt-select-label\"\n >\n <!-- @slot Slot for label, defaults to label prop -->\n <slot name=\"label\">{{ label }}</slot>\n </div>\n <div\n v-if=\"$slots.description || description\"\n :id=\"descriptionKey\"\n :class=\"[\n 'd-description',\n DESCRIPTION_SIZE_MODIFIERS[size],\n descriptionClass,\n ]\"\n v-bind=\"descriptionChildProps\"\n data-qa=\"dt-select-description\"\n >\n <!-- @slot Slot for description, defaults to description prop -->\n <slot name=\"description\">{{ description }}</slot>\n </div>\n <div\n :class=\"[\n 'd-select',\n SELECT_SIZE_MODIFIERS[size],\n selectClass,\n { 'd-select--disabled': disabled },\n ]\"\n data-qa=\"dt-select-wrapper\"\n >\n <select\n ref=\"selectElement\"\n :class=\"[\n 'd-select__input',\n SELECT_STATE_MODIFIERS[state],\n ]\"\n v-bind=\"$attrs\"\n :value=\"value\"\n data-qa=\"dt-select\"\n :disabled=\"disabled\"\n v-on=\"selectListeners\"\n >\n <!-- @slot Slot for select menu options, defaults to options prop -->\n <slot>\n <option\n v-for=\"option in options\"\n :key=\"getOptionKey(option.value)\"\n :value=\"option.value\"\n :class=\"optionClass\"\n v-bind=\"optionChildProps\"\n >\n {{ option.label }}\n </option>\n </slot>\n </select>\n </div>\n </label>\n <dt-validation-messages\n :validation-messages=\"formattedMessages\"\n :show-messages=\"showMessages\"\n :class=\"messagesClass\"\n v-bind=\"messagesChildProps\"\n data-qa=\"dt-select-messages\"\n />\n </div>\n</template>\n\n<script>\nimport Vue from 'vue';\nimport {\n LABEL_SIZE_MODIFIERS,\n DESCRIPTION_SIZE_MODIFIERS,\n} from '@/common/constants';\nimport {\n SELECT_SIZE_MODIFIERS,\n SELECT_STATE_MODIFIERS,\n} from './select_menu_constants';\nimport {\n getUniqueString,\n getValidationState,\n} from '@/common/utils';\nimport { MessagesMixin } from '@/common/mixins/input';\nimport { optionsValidator } from './select_menu_validators.js';\nimport { DtValidationMessages } from '../validation_messages';\n\n/**\n * A select menu is an input control that allows users to choose one option from a list.\n * @property {Boolean} disabled attribute\n * @property {String} name attribute\n * @property {String} value attribute\n * @see https://dialtone.dialpad.com/components/select.html\n */\nexport default {\n name: 'DtSelectMenu',\n\n components: { DtValidationMessages },\n\n mixins: [MessagesMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Label for the select\n */\n label: {\n type: String,\n default: '',\n },\n\n /**\n * Description for the select\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Select Menu Options, overridden by default slot. Each option has the following structure:\n * `{ index: number (optional), value: number || string (required), label: string (required) }`\n * @param {Object[]} options - Optional - A list that can be used to create a list of select menu options\n * @param {number} options[].index - Optional - The index of the option\n * @param {number|string} options[].value - Required - The option value\n * @param {string} options[].label - Required - The option Label\n */\n options: {\n type: Array,\n default: () => [],\n validator: options => optionsValidator(options),\n },\n\n /**\n * Sets the selected value of the select menu. If it does not match a value in the options array, then it will be\n * 'unselected'.\n */\n value: {\n type: String,\n default: null,\n },\n\n /**\n * Controls the size of the select\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(SELECT_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Used to customize the description container\n */\n descriptionClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Used to customize the select\n */\n selectClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Used to customize each option, should options be provided via prop\n */\n optionClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * A set of props that are passed into the label container\n */\n labelChildProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * A set of props that are passed into the description container\n */\n descriptionChildProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * A set of props that are passed into each option, should options be provided via prop\n */\n optionChildProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Disabled state of the select\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String | Number}\n */\n 'input',\n\n /**\n * Native change event\n *\n * @event change\n * @type {String | Number}\n */\n 'change',\n ],\n\n data () {\n return {\n LABEL_SIZE_MODIFIERS,\n DESCRIPTION_SIZE_MODIFIERS,\n SELECT_SIZE_MODIFIERS,\n SELECT_STATE_MODIFIERS,\n };\n },\n\n computed: {\n selectListeners () {\n return {\n /* TODO\n Check if any usages of this component leverage $listeners and either remove if unused or scope the removal\n and migration prior to upgrading to Vue 3.x\n */\n ...this.$listeners,\n /*\n * Override input listener to as no-op. Prevents parent input listeners from being passed through onto the input\n * element which will result in the hander being called twice (once on the select element and once by the\n * emitted input event by the change listener).\n */\n input: () => {},\n change: event => this.emitValue(event.target.value, event),\n };\n },\n\n state () {\n return getValidationState(this.formattedMessages);\n },\n\n selectKey () {\n return getUniqueString();\n },\n\n descriptionKey () {\n return `select-${this.selectKey}-description`;\n },\n\n labelAriaDetails () {\n if (this.$slots.description || this.description) {\n return this.descriptionKey;\n }\n\n return this.$attrs['aria-details'];\n },\n },\n\n mounted () {\n this.validateOptionsPresence();\n },\n\n beforeUpdate () {\n this.validateOptionsPresence();\n },\n\n methods: {\n emitValue (value, event) {\n this.$emit('input', value, event);\n this.$emit('change', value, event);\n },\n\n getOptionKey (value) {\n return `select-${this.selectKey}-option-${value}`;\n },\n\n validateOptionsPresence () {\n if (this.options?.length < 1 && !this.$slots.default) {\n Vue.util.warn('Options are expected to be provided via prop or slot', this);\n }\n },\n },\n};\n</script>\n"],"names":["SELECT_SIZE_MODIFIERS","SELECT_STATE_MODIFIERS","hasValidOptionIndex","option","hasValidOptionValue","hasValidOptionLabel","optionsValidator","options","_sfc_main","DtValidationMessages","MessagesMixin","s","LABEL_SIZE_MODIFIERS","DESCRIPTION_SIZE_MODIFIERS","event","getValidationState","getUniqueString","value","_a","Vue"],"mappings":"oUAAY,MAACA,EAAwB,CACnC,GAAI,eACJ,GAAI,eACJ,GAAI,GACJ,GAAI,eACJ,GAAI,cACN,EAEaC,EAAyB,CACpC,MAAO,yBACP,QAAS,2BACT,QAAS,0BACX,ECZMC,EAAsBC,GAAU,CAACA,EAAO,OAAS,OAAOA,EAAO,OAAU,SAEzEC,EAAsBD,GACrBA,EAAO,MAIL,OAAOA,EAAO,OAAU,UAAY,OAAOA,EAAO,OAAU,SAH1D,GAMLE,EAAsBF,GACrBA,EAAO,MAIL,OAAOA,EAAO,OAAU,SAHtB,GAMEG,EAAmBC,GACzBA,EAIEA,EAAQ,MAAMJ,GACf,GAACD,EAAoBC,CAAM,GAI3B,CAACC,EAAoBD,CAAM,G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CACA,EAEA,WAAA,CACA,OAAAC,EAAA,gBAAA,CACA,EAEA,gBAAA,CACA,MAAA,UAAA,KAAA,SAAA,cACA,EAEA,kBAAA,CACA,OAAA,KAAA,OAAA,aAAA,KAAA,YACA,KAAA,eAGA,KAAA,OAAA,cAAA,CACA,CACA,EAEA,SAAA,CACA,KAAA,wBAAA,CACA,EAEA,cAAA,CACA,KAAA,wBAAA,CACA,EAEA,QAAA,CACA,UAAAC,EAAAH,EAAA,CACA,KAAA,MAAA,QAAAG,EAAAH,CAAA,EACA,KAAA,MAAA,SAAAG,EAAAH,CAAA,CACA,EAEA,aAAAG,EAAA,CACA,MAAA,UAAA,KAAA,SAAA,WAAAA,CAAA,EACA,EAEA,yBAAA,SACAC,EAAA,KAAA,UAAA,YAAAA,EAAA,QAAA,GAAA,CAAA,KAAA,OAAA,SACAC,EAAA,KAAA,KAAA,uDAAA,IAAA,CAEA,CACA,CACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./button.cjs"),r=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js"),i=require("./icon.cjs");require("vue");require("../chunks/link_constants-Kn6kP4i1.js");require("@dialpad/dialtone-icons/vue2");require("../chunks/icon_constants-2S_OSQ1t.js");require("@dialpad/dialtone-icons/icons.json");const a={name:"DtRecipeSettingsMenuButton",components:{DtButton:n.DtButton,DtIcon:i.DtIcon},props:{updateAvailable:{type:Boolean,default:!1},ariaLabel:{type:String,required:!0}},emits:["click"]};var o=function(){var e=this,t=e._self._c;return e.updateAvailable?t("dt-button",e._g({staticClass:"settings-menu-button-update",attrs:{importance:"outlined",size:"xs","icon-position":"right","aria-label":e.ariaLabel},scopedSlots:e._u([{key:"icon",fn:function(){return[t("dt-icon",{attrs:{name:"more-vertical",size:"300"}})]},proxy:!0}],null,!1,3418040308)},e.$listeners),[e._t("default")],2):t("dt-button",e._g({staticClass:"settings-menu-button",attrs:{importance:"clear",kind:"inverted","aria-label":e.ariaLabel},scopedSlots:e._u([{key:"icon",fn:function(){return[t("dt-icon",{attrs:{name:"more-vertical",size:"300"}})]},proxy:!0}])},e.$listeners))},s=[],u=r.n(a,o,s,!1,null,"4ee1371d",null,null);const l=u.exports;exports.DtRecipeSettingsMenuButton=l;
|
|
2
|
+
//# sourceMappingURL=settings-menu-button.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-menu-button.cjs","sources":["../../recipes/header/settings_menu_button/settings_menu_button.vue"],"sourcesContent":["<template>\n <dt-button\n v-if=\"updateAvailable\"\n importance=\"outlined\"\n size=\"xs\"\n icon-position=\"right\"\n class=\"settings-menu-button-update\"\n :aria-label=\"ariaLabel\"\n v-on=\"$listeners\"\n >\n <slot />\n <template #icon>\n <dt-icon\n name=\"more-vertical\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <dt-button\n v-else\n importance=\"clear\"\n kind=\"inverted\"\n class=\"settings-menu-button\"\n :aria-label=\"ariaLabel\"\n v-on=\"$listeners\"\n >\n <template #icon>\n <dt-icon\n name=\"more-vertical\"\n size=\"300\"\n />\n </template>\n </dt-button>\n</template>\n\n<script>\nimport DtButton from '@/components/button/button.vue';\nimport { DtIcon } from '@/components/icon';\n\nexport default {\n name: 'DtRecipeSettingsMenuButton',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * Determines whether the button should display the update state\n * default is false\n * @values true, false\n */\n updateAvailable: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Aria label\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n};\n</script>\n\n<style scoped lang=\"less\">\n.settings-menu-button {\n padding: var(--dt-space-0);\n border-radius: var(--dt-size-550);\n height: var(--dt-size-600);\n width: var(--dt-size-550);\n color: var(--dt-theme-topbar-button-color-foreground);\n background-color: var(--dt-theme-topbar-button-color-background);\n\n &:hover {\n background-color: var(--dt-theme-topbar-button-color-background-hover);\n color: var(--dt-theme-topbar-button-color-foreground-hover);\n }\n\n &:active {\n background-color: var(--dt-theme-topbar-button-color-background-active);\n }\n}\n\n.settings-menu-button-update {\n background-color: hsla(var(--dt-color-blue-200-hsl) / 25%);\n color: var(--dt-color-blue-500);\n border-color: hsla(var(--dt-color-blue-200-hsl) / 25%);\n border-radius: var(--dt-size-radius-pill);\n height: var(--dt-size-600);\n\n &:hover {\n background-color: hsla(var(--dt-color-blue-200-hsl) / 50%);\n color: var(--dt-theme-topbar-button-color-foreground-hover);\n }\n}\n</style>\n"],"names":["_sfc_main","DtButton","DtIcon"],"mappings":"wYAuCA,MAAAA,EAAA,CACA,KAAA,6BAEA,WAAA,CACA,SAAAC,EAAA,SACA,OAAAC,EAAA,MACA,EAEA,MAAA,CAMA,gBAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,UAAA,CACA,KAAA,OACA,SAAA,EACA,CACA,EAEA,MAAA,CAOA,OACA,CAEA"}
|
|
@@ -6,7 +6,6 @@ import "../chunks/link_constants-vIUB92L4.js";
|
|
|
6
6
|
import "@dialpad/dialtone-icons/vue2";
|
|
7
7
|
import "../chunks/icon_constants-OpYAAKwF.js";
|
|
8
8
|
import "@dialpad/dialtone-icons/icons.json";
|
|
9
|
-
import "./skeleton.js";
|
|
10
9
|
const o = {
|
|
11
10
|
name: "DtRecipeSettingsMenuButton",
|
|
12
11
|
components: {
|
|
@@ -58,8 +57,8 @@ var a = function() {
|
|
|
58
57
|
null,
|
|
59
58
|
null
|
|
60
59
|
);
|
|
61
|
-
const
|
|
60
|
+
const g = l.exports;
|
|
62
61
|
export {
|
|
63
|
-
|
|
62
|
+
g as DtRecipeSettingsMenuButton
|
|
64
63
|
};
|
|
65
64
|
//# sourceMappingURL=settings-menu-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-menu-button.js","sources":["../../recipes/header/settings_menu_button/settings_menu_button.vue"],"sourcesContent":["<template>\n <dt-button\n v-if=\"updateAvailable\"\n importance=\"outlined\"\n size=\"xs\"\n icon-position=\"right\"\n class=\"settings-menu-button-update\"\n :aria-label=\"ariaLabel\"\n v-on=\"$listeners\"\n >\n <slot />\n <template #icon>\n <dt-icon\n name=\"more-vertical\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <dt-button\n v-else\n importance=\"clear\"\n kind=\"inverted\"\n class=\"settings-menu-button\"\n :aria-label=\"ariaLabel\"\n v-on=\"$listeners\"\n >\n <template #icon>\n <dt-icon\n name=\"more-vertical\"\n size=\"300\"\n />\n </template>\n </dt-button>\n</template>\n\n<script>\nimport DtButton from '@/components/button/button.vue';\nimport { DtIcon } from '@/components/icon';\n\nexport default {\n name: 'DtRecipeSettingsMenuButton',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * Determines whether the button should display the update state\n * default is false\n * @values true, false\n */\n updateAvailable: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Aria label\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n};\n</script>\n\n<style scoped lang=\"less\">\n.settings-menu-button {\n padding: var(--dt-space-0);\n border-radius: var(--dt-size-550);\n height: var(--dt-size-600);\n width: var(--dt-size-550);\n color: var(--dt-theme-topbar-button-color-foreground);\n background-color: var(--dt-theme-topbar-button-color-background);\n\n &:hover {\n background-color: var(--dt-theme-topbar-button-color-background-hover);\n color: var(--dt-theme-topbar-button-color-foreground-hover);\n }\n\n &:active {\n background-color: var(--dt-theme-topbar-button-color-background-active);\n }\n}\n\n.settings-menu-button-update {\n background-color: hsla(var(--dt-color-blue-200-hsl) / 25%);\n color: var(--dt-color-blue-500);\n border-color: hsla(var(--dt-color-blue-200-hsl) / 25%);\n border-radius: var(--dt-size-radius-pill);\n height: var(--dt-size-600);\n\n &:hover {\n background-color: hsla(var(--dt-color-blue-200-hsl) / 50%);\n color: var(--dt-theme-topbar-button-color-foreground-hover);\n }\n}\n</style>\n"],"names":["_sfc_main","DtButton","DtIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings-menu-button.js","sources":["../../recipes/header/settings_menu_button/settings_menu_button.vue"],"sourcesContent":["<template>\n <dt-button\n v-if=\"updateAvailable\"\n importance=\"outlined\"\n size=\"xs\"\n icon-position=\"right\"\n class=\"settings-menu-button-update\"\n :aria-label=\"ariaLabel\"\n v-on=\"$listeners\"\n >\n <slot />\n <template #icon>\n <dt-icon\n name=\"more-vertical\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <dt-button\n v-else\n importance=\"clear\"\n kind=\"inverted\"\n class=\"settings-menu-button\"\n :aria-label=\"ariaLabel\"\n v-on=\"$listeners\"\n >\n <template #icon>\n <dt-icon\n name=\"more-vertical\"\n size=\"300\"\n />\n </template>\n </dt-button>\n</template>\n\n<script>\nimport DtButton from '@/components/button/button.vue';\nimport { DtIcon } from '@/components/icon';\n\nexport default {\n name: 'DtRecipeSettingsMenuButton',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * Determines whether the button should display the update state\n * default is false\n * @values true, false\n */\n updateAvailable: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Aria label\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n};\n</script>\n\n<style scoped lang=\"less\">\n.settings-menu-button {\n padding: var(--dt-space-0);\n border-radius: var(--dt-size-550);\n height: var(--dt-size-600);\n width: var(--dt-size-550);\n color: var(--dt-theme-topbar-button-color-foreground);\n background-color: var(--dt-theme-topbar-button-color-background);\n\n &:hover {\n background-color: var(--dt-theme-topbar-button-color-background-hover);\n color: var(--dt-theme-topbar-button-color-foreground-hover);\n }\n\n &:active {\n background-color: var(--dt-theme-topbar-button-color-background-active);\n }\n}\n\n.settings-menu-button-update {\n background-color: hsla(var(--dt-color-blue-200-hsl) / 25%);\n color: var(--dt-color-blue-500);\n border-color: hsla(var(--dt-color-blue-200-hsl) / 25%);\n border-radius: var(--dt-size-radius-pill);\n height: var(--dt-size-600);\n\n &:hover {\n background-color: hsla(var(--dt-color-blue-200-hsl) / 50%);\n color: var(--dt-theme-topbar-button-color-foreground-hover);\n }\n}\n</style>\n"],"names":["_sfc_main","DtButton","DtIcon"],"mappings":";;;;;;;;AAuCA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAEA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js"),u=3e6,i={circle:"d-bar-circle",square:"d-bar2"},m=["body","heading"],c={sm:"24px",md:"32px",lg:"48px"},r={sm:"d-h16",md:"d-h24",lg:"d-h32"},f={computed:{skeletonOffset(){const e=this.$refs.skeleton;if(!e)return this.offset;const{top:t,height:a}=e.getBoundingClientRect();return t+a/2},skeletonStyle(){const e={};if(this.skeletonOffset===-1||!this.animate&&this.animationDuration===-1)return e;const t=this.skeletonOffset*u/1e3,a=this.animationDuration===-1?1e3:this.animationDuration;return e.animationDelay=`${t}ms`,e.animationDuration=`${a}ms`,e}}},S={name:"DtSkeletonShape",mixins:[f],props:{shape:{type:String,default:"circle",validator:e=>Object.keys(i).includes(e)},size:{type:String,default:"md"},animationDuration:{type:Number,default:-1},animate:{type:Boolean,default:!0},offset:{type:Number,default:1},contentClass:{type:[String,Object,Array],default:""}},data(){return{SKELETON_SHAPES:i}},computed:{shapeStyles(){const e=c[this.size]||this.size;return{...this.skeletonStyle,"min-width":e,"max-width":e,"min-height":e,"max-height":e}}}};var y=function(){var t=this,a=t._self._c;return a("div",{ref:"skeleton",class:["skeleton-placeholder",t.SKELETON_SHAPES[t.shape],{"skeleton-placeholder--animate":t.animate},t.contentClass],style:t.shapeStyles,attrs:{"data-qa":"skeleton-shape"}})},g=[],k=s.n(S,y,g,!1,null,null,null,null);const l=k.exports,O={name:"DtSkeletonText",mixins:[f],props:{type:{type:String,default:"body",validator:e=>m.includes(e)},headingHeight:{type:String,default:"md",validator:e=>Object.keys(r).includes(e)},width:{type:String,default:"100%"},animationDuration:{type:Number,default:-1},animate:{type:Boolean,default:!1},offset:{type:Number,default:1},contentClass:{type:String,default:""}},data(){return{SKELETON_HEADING_HEIGHTS:r}}};var E=function(){var t=this,a=t._self._c;return t.type==="body"?a("div",{ref:"skeleton",class:["d-skeleton-text","skeleton-placeholder",{"skeleton-placeholder--animate":t.animate},t.contentClass],style:{width:t.width,...t.skeletonStyle},attrs:{"data-qa":"skeleton-text-body"}}):t.type==="heading"?a("div",{ref:"skeleton",class:[t.SKELETON_HEADING_HEIGHTS[t.headingHeight],"d-skeleton-text--heading","skeleton-placeholder",{"skeleton-placeholder--animate":t.animate},t.contentClass],style:{width:t.width,...t.skeletonStyle},attrs:{"data-qa":"skeleton-text-heading"}}):t._e()},b=[],v=s.n(O,E,b,!1,null,null,null,null);const d=v.exports,o=e=>e!==""&&!Number.isNaN(Number(e)),D={name:"DtSkeletonParagraph",components:{DtSkeletonText:d},props:{rows:{type:[Number,String],default:3,validator:o},animate:{type:Boolean,default:!0},minWidth:{type:[Number,String],default:30,validator:o},maxWidth:{type:[Number,String],default:100,validator:o},width:{type:[String,Array],default:null},randomWidth:{type:Boolean,default:!1},offset:{type:Number,default:1},animationDuration:{type:Number,default:-1},contentClass:{type:String,default:""},rowClass:{type:String,default:""}},computed:{integerRows(){return Number(this.rows)}},methods:{randomWidthPercentage(){const e=Math.min(this.minWidth,this.maxWidth),t=Math.max(this.minWidth,this.maxWidth);return`${Math.round(Math.random()*(t-e))+e}%`},getSizeParagraphRow(e){const t=this.width,a=Array.isArray(t),n=t==null?void 0:t[e-1],_=e===this.rows;return this.randomWidth?this.randomWidthPercentage():t&&!a?t:t&&a&&n?n:_?"38%":"100%"}}};var N=function(){var t=this,a=t._self._c;return a("div",{class:["d-skeleton-paragraph",t.contentClass],attrs:{contentClass:"","data-qa":"skeleton-paragraph"}},t._l(t.integerRows,function(n){return a("dt-skeleton-text",{key:n,attrs:{"data-qa":"skeleton-paragraph-row","content-class":t.rowClass,animate:t.animate,offset:t.offset,"animation-duration":t.animationDuration,width:t.getSizeParagraphRow(n)}})}),1)},x=[],T=s.n(D,N,x,!1,null,null,null,null);const p=T.exports,w={name:"DtSkeletonListItem",components:{DtSkeletonShape:l,DtSkeletonParagraph:p},props:{shape:{type:String,default:"circle",validator:e=>Object.keys(i).includes(e)},shapeSize:{type:String,default:"md"},paragraphs:{type:Object,default:()=>({rows:3,randomWidth:!0})},animationDuration:{type:Number,default:-1},animate:{type:Boolean,default:!0},offset:{type:Number,default:1},shapeClass:{type:String,default:""},contentClass:{type:String,default:""}}};var $=function(){var t=this,a=t._self._c;return a("div",{class:["d-skeleton-list-item",{"d-skeleton-list-item--single":t.paragraphs.rows===1},t.contentClass],attrs:{"data-qa":"skeleton-list-item"}},[a("dt-skeleton-shape",{staticClass:"d-skeleton-list-item__shape",attrs:{size:t.shapeSize,shape:t.shape,"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset,"content-class":t.shapeClass}}),a("div",{staticClass:"d-skeleton-list-item__paragraph-container"},[a("dt-skeleton-paragraph",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-paragraph",t.paragraphs,!1))],1)],1)},I=[],L=s.n(w,$,I,!1,null,null,null,null);const h=L.exports,P={name:"DtSkeleton",components:{DtSkeletonText:d,DtSkeletonShape:l,DtSkeletonListItem:h,DtSkeletonParagraph:p},props:{paragraphOption:{type:[Object,Boolean],default:null},listItemOption:{type:[Object,Boolean],default:null},textOption:{type:Object,default:null},shapeOption:{type:[Object,Boolean],default:null},animationDuration:{type:Number,default:-1},ariaLabel:{type:String,default:""},animate:{type:Boolean,default:!0},offset:{type:Number,default:1}},computed:{validationOptions(){return{paragraphOption:this.paragraphOption,listItemOption:this.listItemOption,textOption:this.textOption,shapeOption:this.shapeOption}}},watch:{$props:{immediate:!0,handler:"validator"}},methods:{validator(){const e=Object.entries(this.validationOptions).filter(([t,a])=>a);if(e.length>=2){const t=`Use only one of ${e.map(([a])=>a).join(" | ")} options at the same time`;console.error(t)}}}};var C=function(){var t=this,a=t._self._c;return a("div",{attrs:{"aria-busy":"true",role:"status","aria-label":t.ariaLabel}},[t.listItemOption?a("dt-skeleton-list-item",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-list-item",t.listItemOption===!0?{}:t.listItemOption,!1)):t.shapeOption?a("dt-skeleton-shape",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-shape",t.shapeOption===!0?{}:t.shapeOption,!1)):t.paragraphOption?a("dt-skeleton-paragraph",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-paragraph",t.paragraphOption===!0?{}:t.paragraphOption,!1)):a("dt-skeleton-text",t._b({attrs:{"animation-duration":t.animationDuration,animate:t.animate,offset:t.offset}},"dt-skeleton-text",t.textOption||{},!1))],1)},A=[],H=s.n(P,C,A,!1,null,null,null,null);const R=H.exports;exports.DtSkeleton=R;exports.DtSkeletonListItem=h;exports.DtSkeletonParagraph=p;exports.DtSkeletonShape=l;exports.DtSkeletonText=d;exports.SKELETON_HEADING_HEIGHTS=r;exports.SKELETON_RIPPLE_DURATION=u;exports.SKELETON_SHAPES=i;exports.SKELETON_SHAPE_SIZES=c;exports.SKELETON_TEXT_TYPES=m;
|
|
2
|
+
//# sourceMappingURL=skeleton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.cjs","sources":["../../components/skeleton/skeleton_constants.js","../../common/mixins/skeleton.js","../../components/skeleton/skeleton-shape.vue","../../components/skeleton/skeleton-text.vue","../../components/skeleton/skeleton-paragraph.vue","../../components/skeleton/skeleton-list-item.vue","../../components/skeleton/skeleton.vue"],"sourcesContent":["// NOTE: RippleDuration controls how long the delay is for the animation\n// of a skeleton 1000 pixels from the top of the page. Each skeleton\n// from the top down will have a delay duration from 0 to this offset.\n// The delay of each skeleton animation is based on how far down the page\n// the skeleton is rendered. This is a linear relationship. The unit\n// is miliseconds.\nexport const SKELETON_RIPPLE_DURATION = 3000000;\n\nexport const SKELETON_SHAPES = {\n circle: 'd-bar-circle',\n square: 'd-bar2',\n};\n\nexport const SKELETON_TEXT_TYPES = [\n 'body',\n 'heading',\n];\n\nexport const SKELETON_SHAPE_SIZES = {\n sm: '24px',\n md: '32px',\n lg: '48px',\n};\n\nexport const SKELETON_HEADING_HEIGHTS = {\n sm: 'd-h16',\n md: 'd-h24',\n lg: 'd-h32',\n};\n\nexport default {\n SKELETON_RIPPLE_DURATION,\n SKELETON_SHAPES,\n SKELETON_TEXT_TYPES,\n SKELETON_HEADING_HEIGHTS,\n};\n","import { SKELETON_RIPPLE_DURATION } from '@/components/skeleton/skeleton_constants';\n\n/**\n * @displayName Skeleton Animation Mixin\n */\nexport default {\n computed: {\n skeletonOffset () {\n const skeletonText = this.$refs.skeleton;\n if (!skeletonText) { return this.offset; }\n const { top, height } = skeletonText.getBoundingClientRect();\n return top + (height / 2);\n },\n\n skeletonStyle () {\n const style = {};\n\n if (this.skeletonOffset === -1 || (!this.animate && this.animationDuration === -1)) {\n return style;\n }\n const animationDelay = this.skeletonOffset * SKELETON_RIPPLE_DURATION / 1000;\n const animationDuration = this.animationDuration === -1 ? 1000 : this.animationDuration;\n style.animationDelay = `${animationDelay}ms`;\n style.animationDuration = `${animationDuration}ms`;\n return style;\n },\n },\n};\n","<template>\n <div\n ref=\"skeleton\"\n data-qa=\"skeleton-shape\"\n :class=\"[\n 'skeleton-placeholder',\n SKELETON_SHAPES[shape],\n {\n 'skeleton-placeholder--animate': animate,\n },\n contentClass,\n ]\"\n :style=\"shapeStyles\"\n />\n</template>\n\n<script>\nimport SkeletonAnimation from '@/common/mixins/skeleton';\nimport {\n SKELETON_SHAPES,\n SKELETON_SHAPE_SIZES,\n} from './skeleton_constants';\n\nexport default {\n name: 'DtSkeletonShape',\n\n mixins: [SkeletonAnimation],\n\n props: {\n /**\n * Defines the shape of the skeleton, accepts circle or square.\n * @values circle, square\n */\n shape: {\n type: String,\n default: 'circle',\n validator: shape => Object.keys(SKELETON_SHAPES).includes(shape),\n },\n\n /**\n * Size of the shape\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n },\n\n /**\n * Duration time of the animation (ms), set -1 for an infinite animation.\n */\n animationDuration: {\n type: Number,\n default: -1,\n },\n\n /**\n * This property has higher priority than \"option.animate\"\n * @values true, false\n */\n animate: {\n type: Boolean,\n default: true,\n },\n\n /**\n * RippleDuration controls how long the delay is for the animation of a\n * placeholder 1000 pixels from the top of the page. Each placeholder\n * from the top down will have a delay duration from 0 to this offset.\n * The delay of each placeholder animation is based on how far down the page\n * the placeholder is rendered. This is a linear relationship. The unit\n * is milliseconds.\n */\n offset: {\n type: Number,\n default: 1,\n },\n\n /**\n * Additional class name for the content.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n data () {\n return {\n SKELETON_SHAPES,\n };\n },\n\n computed: {\n shapeStyles () {\n const size = SKELETON_SHAPE_SIZES[this.size] || this.size;\n return {\n ...this.skeletonStyle,\n 'min-width': size,\n 'max-width': size,\n 'min-height': size,\n 'max-height': size,\n };\n },\n },\n};\n</script>\n","<template>\n <div\n v-if=\"type === 'body'\"\n ref=\"skeleton\"\n data-qa=\"skeleton-text-body\"\n :class=\"[\n 'd-skeleton-text',\n 'skeleton-placeholder',\n {\n 'skeleton-placeholder--animate': animate,\n },\n contentClass,\n ]\"\n :style=\"{\n width,\n ...skeletonStyle,\n }\"\n />\n <div\n v-else-if=\"type === 'heading'\"\n ref=\"skeleton\"\n data-qa=\"skeleton-text-heading\"\n :class=\"[\n SKELETON_HEADING_HEIGHTS[headingHeight],\n 'd-skeleton-text--heading',\n 'skeleton-placeholder',\n {\n 'skeleton-placeholder--animate': animate,\n },\n contentClass,\n ]\"\n :style=\"{\n width,\n ...skeletonStyle,\n }\"\n />\n</template>\n\n<script>\nimport { SKELETON_HEADING_HEIGHTS, SKELETON_TEXT_TYPES } from './skeleton_constants';\nimport SkeletonAnimation from '@/common/mixins/skeleton';\n\nexport default {\n name: 'DtSkeletonText',\n\n mixins: [SkeletonAnimation],\n\n props: {\n /**\n * Skeleton type\n * @values body, heading\n */\n type: {\n type: String,\n default: 'body',\n validator: type => SKELETON_TEXT_TYPES.includes(type),\n },\n\n /**\n * Heading height\n * @values sm, md, lg\n */\n headingHeight: {\n type: String,\n default: 'md',\n validator: headingHeight => Object.keys(SKELETON_HEADING_HEIGHTS).includes(headingHeight),\n },\n\n /**\n * Width of the skeleton\n */\n width: {\n type: String,\n default: '100%',\n },\n\n /**\n * Duration time of the animation (ms), set -1 for an infinite animation.\n */\n animationDuration: {\n type: Number,\n default: -1,\n },\n\n /**\n * This property has higher priority than \"option.animate\"\n * @values true, false\n */\n animate: {\n type: Boolean,\n default: false,\n },\n\n /**\n * RippleDuration controls how long the delay is for the animation of a\n * placeholder 1000 pixels from the top of the page. Each placeholder\n * from the top down will have a delay duration from 0 to this offset.\n * The delay of each placeholder animation is based on how far down the page\n * the placeholder is rendered. This is a linear relationship. The unit\n * is milliseconds.\n */\n offset: {\n type: Number,\n default: 1,\n },\n\n /**\n * Additional class name for the content.\n */\n contentClass: {\n type: String,\n default: '',\n },\n },\n\n data () {\n return {\n SKELETON_HEADING_HEIGHTS,\n };\n },\n};\n</script>\n","<template>\n <div\n :class=\"[\n 'd-skeleton-paragraph',\n contentClass,\n ]\"\n contentClass\n data-qa=\"skeleton-paragraph\"\n >\n <dt-skeleton-text\n v-for=\"row in integerRows\"\n :key=\"row\"\n data-qa=\"skeleton-paragraph-row\"\n :content-class=\"rowClass\"\n :animate=\"animate\"\n :offset=\"offset\"\n :animation-duration=\"animationDuration\"\n :width=\"getSizeParagraphRow(row)\"\n />\n </div>\n</template>\n\n<script>\nimport DtSkeletonText from './skeleton-text.vue';\n\nconst validator = number => number !== '' && !Number.isNaN(Number(number));\nexport default {\n name: 'DtSkeletonParagraph',\n components: {\n DtSkeletonText,\n },\n\n props: {\n /**\n * Quantity of rows to display\n */\n rows: {\n type: [Number, String],\n default: 3,\n validator,\n },\n\n /**\n * This property has higher priority than \"option.animate\"\n * @values true, false\n */\n animate: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Controls the min width of paragraphs\n */\n minWidth: {\n type: [Number, String],\n default: 30,\n validator,\n },\n\n /**\n * Controls the max width of paragraphs\n */\n maxWidth: {\n type: [Number, String],\n default: 100,\n validator,\n },\n\n /**\n * Controls the width of paragraphs\n */\n width: {\n type: [String, Array],\n default: null,\n },\n\n /**\n * If true, row widths will be random\n * @values true, false\n */\n randomWidth: {\n type: Boolean,\n default: false,\n },\n\n /**\n * RippleDuration controls how long the delay is for the animation of a\n * placeholder 1000 pixels from the top of the page. Each placeholder\n * from the top down will have a delay duration from 0 to this offset.\n * The delay of each placeholder animation is based on how far down the page\n * the placeholder is rendered. This is a linear relationship. The unit\n * is milliseconds.\n */\n offset: {\n type: Number,\n default: 1,\n },\n\n /**\n * Duration time of the animation (ms), set -1 for an infinite animation.\n */\n animationDuration: {\n type: Number,\n default: -1,\n },\n\n /**\n * Additional class name for the content.\n */\n contentClass: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the row.\n */\n rowClass: {\n type: String,\n default: '',\n },\n },\n\n computed: {\n integerRows () {\n return Number(this.rows);\n },\n },\n\n methods: {\n randomWidthPercentage () {\n const min = Math.min(this.minWidth, this.maxWidth);\n const max = Math.max(this.minWidth, this.maxWidth);\n return `${Math.round(Math.random() * (max - min)) + min}%`;\n },\n\n getSizeParagraphRow (row) {\n const paragraphWidth = this.width;\n const isArrayWidth = Array.isArray(paragraphWidth);\n const currentWidth = paragraphWidth?.[row - 1];\n const isLastRow = row === this.rows;\n\n if (this.randomWidth) {\n return this.randomWidthPercentage();\n }\n\n if (paragraphWidth && !isArrayWidth) {\n return paragraphWidth;\n }\n\n if (paragraphWidth && isArrayWidth && currentWidth) {\n return currentWidth;\n }\n\n return isLastRow ? '38%' : '100%';\n },\n },\n};\n</script>\n","<template>\n <div\n data-qa=\"skeleton-list-item\"\n :class=\"[\n 'd-skeleton-list-item',\n {\n 'd-skeleton-list-item--single': paragraphs.rows === 1,\n },\n contentClass,\n ]\"\n >\n <dt-skeleton-shape\n class=\"d-skeleton-list-item__shape\"\n :size=\"shapeSize\"\n :shape=\"shape\"\n :animation-duration=\"animationDuration\"\n :animate=\"animate\"\n :offset=\"offset\"\n :content-class=\"shapeClass\"\n />\n <div class=\"d-skeleton-list-item__paragraph-container\">\n <dt-skeleton-paragraph\n v-bind=\"paragraphs\"\n :animation-duration=\"animationDuration\"\n :animate=\"animate\"\n :offset=\"offset\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport { SKELETON_SHAPES } from './skeleton_constants';\nimport DtSkeletonShape from './skeleton-shape.vue';\nimport DtSkeletonParagraph from './skeleton-paragraph.vue';\n\nexport default {\n name: 'DtSkeletonListItem',\n\n components: {\n DtSkeletonShape,\n DtSkeletonParagraph,\n },\n\n props: {\n /**\n * Defines the shape of the skeleton, accepts circle or square.\n * @values circle, square\n */\n shape: {\n type: String,\n default: 'circle',\n validator: shape => Object.keys(SKELETON_SHAPES).includes(shape),\n },\n\n /**\n * Size of the shape\n * @values xs, sm, md, lg, xl\n */\n shapeSize: {\n type: String,\n default: 'md',\n },\n\n /**\n * Object containing quantity of paragraphs to display\n * and a randomWidth boolean.\n */\n paragraphs: {\n type: Object,\n default: () => ({ rows: 3, randomWidth: true }),\n },\n\n /**\n * Duration time of the animation (ms), set -1 for an infinite animation.\n */\n animationDuration: {\n type: Number,\n default: -1,\n },\n\n /**\n * This property has higher priority than \"option.animate\"\n * @values true, false\n */\n animate: {\n type: Boolean,\n default: true,\n },\n\n /**\n * RippleDuration controls how long the delay is for the animation of a\n * placeholder 1000 pixels from the top of the page. Each placeholder\n * from the top down will have a delay duration from 0 to this offset.\n * The delay of each placeholder animation is based on how far down the page\n * the placeholder is rendered. This is a linear relationship. The unit\n * is milliseconds.\n */\n offset: {\n type: Number,\n default: 1,\n },\n\n /**\n * Additional class name for the shape.\n */\n shapeClass: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the content.\n */\n contentClass: {\n type: String,\n default: '',\n },\n },\n};\n</script>\n","<template>\n <div\n aria-busy=\"true\"\n role=\"status\"\n :aria-label=\"ariaLabel\"\n >\n <dt-skeleton-list-item\n v-if=\"listItemOption\"\n v-bind=\"listItemOption === true ? {} : listItemOption\"\n :animation-duration=\"animationDuration\"\n :animate=\"animate\"\n :offset=\"offset\"\n />\n <dt-skeleton-shape\n v-else-if=\"shapeOption\"\n v-bind=\"shapeOption === true ? {} : shapeOption\"\n :animation-duration=\"animationDuration\"\n :animate=\"animate\"\n :offset=\"offset\"\n />\n <dt-skeleton-paragraph\n v-else-if=\"paragraphOption\"\n v-bind=\"paragraphOption === true ? {} : paragraphOption\"\n :animation-duration=\"animationDuration\"\n :animate=\"animate\"\n :offset=\"offset\"\n />\n <dt-skeleton-text\n v-else\n v-bind=\"textOption || {}\"\n :animation-duration=\"animationDuration\"\n :animate=\"animate\"\n :offset=\"offset\"\n />\n </div>\n</template>\n\n<script>\nimport DtSkeletonShape from './skeleton-shape.vue';\nimport DtSkeletonListItem from './skeleton-list-item.vue';\nimport DtSkeletonParagraph from './skeleton-paragraph.vue';\nimport DtSkeletonText from './skeleton-text.vue';\n\n/**\n * Skeleton loader is a non-interactive placeholder that displays a preview of the UI to visually communicate\n * that content is in the process of loading. Skeleton is used to provide a low fidelity\n * representation of the user interface (UI) before content appears on the page.\n * @see https://dialtone.dialpad.com/components/skeleton.html\n */\nexport default {\n name: 'DtSkeleton',\n components: {\n DtSkeletonText,\n DtSkeletonShape,\n DtSkeletonListItem,\n DtSkeletonParagraph,\n },\n\n props: {\n /**\n * Set this prop to have the skeleton render as multiple lines of text.\n * Set only one option prop at a time.\n */\n paragraphOption: {\n type: [Object, Boolean],\n default: null,\n },\n\n /**\n * Set this prop to have the skeleton render as a list item with an avatar and wrapping text.\n * Set only one option prop at a time.\n */\n listItemOption: {\n type: [Object, Boolean],\n default: null,\n },\n\n /**\n * Set this prop to have the skeleton render as a single line of text.\n * Set only one option prop at a time.\n */\n textOption: {\n type: Object,\n default: null,\n },\n\n /**\n * Set this prop to have the skeleton render as a specific shape.\n * Set only one option prop at a time.\n */\n shapeOption: {\n type: [Object, Boolean],\n default: null,\n },\n\n /**\n * Duration time of the animation (ms), set -1 for an infinite animation.\n */\n animationDuration: {\n type: Number,\n default: -1,\n },\n\n /**\n * Descriptive label for the content.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * This property has higher priority than \"option.animate\"\n * @values true, false\n */\n animate: {\n type: Boolean,\n default: true,\n },\n\n /**\n * RippleDuration controls how long the delay is for the animation of a\n * placeholder 1000 pixels from the top of the page. Each placeholder\n * from the top down will have a delay duration from 0 to this offset.\n * The delay of each placeholder animation is based on how far down the page\n * the placeholder is rendered. This is a linear relationship. The unit\n * is milliseconds.\n */\n offset: {\n type: Number,\n default: 1,\n },\n },\n\n computed: {\n validationOptions () {\n return {\n paragraphOption: this.paragraphOption,\n listItemOption: this.listItemOption,\n textOption: this.textOption,\n shapeOption: this.shapeOption,\n };\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n handler: 'validator',\n },\n },\n\n methods: {\n validator () {\n const filtered = Object.entries(this.validationOptions)\n .filter(([_, option]) => option);\n if (filtered.length >= 2) {\n const errorMessage = `Use only one of ${filtered.map(([key]) => key).join(' | ')} options at the same time`;\n console.error(errorMessage);\n }\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n// The --placeholder-from-color and --placeholder-to-color\n// custom properties can be set on the parent class of the\n// placeholder to control the animation colors.\n.skeleton-placeholder {\n display: flex;\n stroke: none;\n fill: var(--placeholder-from-color, var(--dt-color-black-300));\n background: var(--placeholder-from-color, var(--dt-color-black-300));\n\n &--animate {\n animation-name: placeholder-throb;\n animation-iteration-count: infinite;\n }\n}\n\n// the animation is used by the skeleton component\n@keyframes placeholder-throb {\n 10% {\n fill: var(--placeholder-from-color, var(--dt-color-black-300));\n background: var(--placeholder-from-color, var(--dt-color-black-300));\n }\n 50% {\n fill: var(--placeholder-to-color, var(--dt-color-black-100));\n background: var(--placeholder-to-color, var(--dt-color-black-100));\n }\n 90% {\n fill: var(--placeholder-from-color, var(--dt-color-black-300));\n background: var(--placeholder-from-color, var(--dt-color-black-300));\n }\n}\n</style>\n"],"names":["SKELETON_RIPPLE_DURATION","SKELETON_SHAPES","SKELETON_TEXT_TYPES","SKELETON_SHAPE_SIZES","SKELETON_HEADING_HEIGHTS","SkeletonAnimation","skeletonText","top","height","style","animationDelay","animationDuration","_sfc_main","shape","size","type","headingHeight","validator","number","DtSkeletonText","min","max","row","paragraphWidth","isArrayWidth","currentWidth","isLastRow","DtSkeletonShape","DtSkeletonParagraph","DtSkeletonListItem","filtered","_","option","errorMessage","key"],"mappings":"iJAMaA,EAA2B,IAE3BC,EAAkB,CAC7B,OAAQ,eACR,OAAQ,QACV,EAEaC,EAAsB,CACjC,OACA,SACF,EAEaC,EAAuB,CAClC,GAAI,OACJ,GAAI,OACJ,GAAI,MACN,EAEaC,EAA2B,CACtC,G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A,CACA,KAAA,QACA,QAAA,EACA,EAUA,OAAA,CACA,KAAA,OACA,QAAA,CACA,CACA,EAEA,SAAA,CACA,mBAAA,CACA,MAAA,CACA,gBAAA,KAAA,gBACA,eAAA,KAAA,eACA,WAAA,KAAA,WACA,YAAA,KAAA,WACA,CACA,CACA,EAEA,MAAA,CACA,OAAA,CACA,UAAA,GACA,QAAA,WACA,CACA,EAEA,QAAA,CACA,WAAA,CACA,MAAAE,EAAA,OAAA,QAAA,KAAA,iBAAA,EACA,OAAA,CAAA,CAAAC,EAAAC,CAAA,IAAAA,CAAA,EACA,GAAAF,EAAA,QAAA,EAAA,CACA,MAAAG,EAAA,mBAAAH,EAAA,IAAA,CAAA,CAAAI,CAAA,IAAAA,CAAA,EAAA,KAAA,KAAA,CAAA,4BACA,QAAA,MAAAD,CAAA,CACA,CACA,CACA,CACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../chunks/stack_constants-m9Ickqw0.js"),s=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js");function u(t){return t===n.D.default}function l(t){if(r(t)==="string")return u(t)?null:n.D[t];if(r(t)==="object"){const{default:e}=t;return u(e)?null:n.D[e]}else return null}function r(t){return typeof t}function c(t){return l(t)?`d-stack--${n.D[l(t)]}`:null}function i(t){return r(t)==="object"?[...n.a.map(e=>t[e]?`d-stack--${e}--${t[e]}`:null)]:null}function o(t){return n.b.includes(t)?`d-stack--gap-${t}`:null}function f(t){if(r(t)==="string")return Object.keys(n.D).includes(t);if(r(t)==="object"){const{default:e}=t;return Object.keys(n.D).includes(e)}else return null}function _(t){return n.b.includes(t)}const d={name:"DtStack",props:{direction:{type:[String,Object],default:"column",validator:t=>f(t)},as:{type:String,default:"div"},gap:{type:String,default:"0",validator:t=>_(t)}},data(){return{DT_STACK_DIRECTION:n.D,DT_STACK_GAP:n.b,DT_STACK_RESPONSIVE_BREAKPOINTS:n.a}},computed:{stackGap(){return o(this.gap)},defaultDirection(){return c(this.direction)},stackResponsive(){return i(this.direction)}}};var D=function(){var e=this,a=e._self._c;return a(e.as,{tag:"component",class:["d-stack",e.defaultDirection,e.stackResponsive,e.stackGap]},[e._t("default")],2)},p=[],S=s.n(d,D,p,!1,null,null,null,null);const T=S.exports;exports.DT_STACK_DIRECTION=n.D;exports.DT_STACK_GAP=n.b;exports.DT_STACK_RESPONSIVE_BREAKPOINTS=n.a;exports.DtStack=T;
|
|
2
|
+
//# sourceMappingURL=stack.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.cjs","sources":["../../components/stack/utils.js","../../components/stack/validators.js","../../components/stack/stack.vue"],"sourcesContent":["import { DT_STACK_DIRECTION, DT_STACK_GAP, DT_STACK_RESPONSIVE_BREAKPOINTS } from '@/components/stack/stack_constants';\n\nfunction _isDefaultDirection (direction) {\n return direction === DT_STACK_DIRECTION.default;\n}\n\nfunction _getValidDirection (direction) {\n if (directionPropType(direction) === 'string') {\n return !_isDefaultDirection(direction) ? DT_STACK_DIRECTION[direction] : null;\n } else if (directionPropType(direction) === 'object') {\n const { default: defaultStyle } = direction;\n\n return !_isDefaultDirection(defaultStyle) ? DT_STACK_DIRECTION[defaultStyle] : null;\n } else { return null; }\n}\n\nexport function directionPropType (value) {\n return typeof value;\n}\n\nexport function getDefaultDirectionClass (direction) {\n return _getValidDirection(direction)\n ? `d-stack--${DT_STACK_DIRECTION[_getValidDirection(direction)]}`\n : null;\n}\n\nexport function getResponsiveClasses (direction) {\n if (directionPropType(direction) === 'object') {\n return [\n ...DT_STACK_RESPONSIVE_BREAKPOINTS.map((breakpoint) => {\n return direction[breakpoint]\n ? `d-stack--${breakpoint}--${direction[breakpoint]}`\n : null;\n })];\n } else { return null; }\n}\n\nexport function getGapClass (gap) {\n return DT_STACK_GAP.includes(gap) ? `d-stack--gap-${gap}` : null;\n}\n","import { DT_STACK_DIRECTION, DT_STACK_GAP } from '@/components/stack/stack_constants';\nimport { directionPropType } from './utils';\n\nexport function directionValidator (direction) {\n if (directionPropType(direction) === 'string') {\n return Object.keys(DT_STACK_DIRECTION).includes(direction);\n } else if (directionPropType(direction) === 'object') {\n const { default: defaultStyle } = direction;\n\n return Object.keys(DT_STACK_DIRECTION).includes(defaultStyle);\n } else { return null; }\n}\n\nexport function gapValidator (gap) {\n return DT_STACK_GAP.includes(gap);\n}\n","<template>\n <component\n :is=\"as\"\n :class=\"[\n 'd-stack',\n defaultDirection,\n stackResponsive,\n stackGap,\n ]\"\n >\n <!-- @slot Slot for main content -->\n <slot />\n </component>\n</template>\n\n<script>\nimport { DT_STACK_DIRECTION, DT_STACK_GAP, DT_STACK_RESPONSIVE_BREAKPOINTS } from './stack_constants';\nimport { directionValidator, gapValidator } from './validators';\nimport { getDefaultDirectionClass, getResponsiveClasses, getGapClass } from './utils';\n\nexport default {\n name: 'DtStack',\n\n props: {\n /**\n * Set this prop to the direction to stack the items.\n * You can override the default direction with 'default' key.\n * All the undefined breakpoints will have 'default' value.\n * By default, for the column direction it will have `justify-content: flex-start`\n * and for the row direction `align-items: center`. This can be overriden\n * by utility classes.\n */\n direction: {\n type: [String, Object],\n default: 'column',\n validator: (direction) => directionValidator(direction),\n },\n\n /**\n * Set this prop to render stack as a specific HTML element.\n */\n as: {\n type: String,\n default: 'div',\n },\n\n /**\n * Set this prop to have the space between each stack item\n * @values 0, 100, 200, 300, 400, 500, 600\n */\n gap: {\n type: String,\n default: '0',\n validator: (gap) => gapValidator(gap),\n },\n },\n\n data () {\n return {\n DT_STACK_DIRECTION,\n DT_STACK_GAP,\n DT_STACK_RESPONSIVE_BREAKPOINTS,\n };\n },\n\n computed: {\n stackGap () {\n return getGapClass(this.gap);\n },\n\n defaultDirection () {\n return getDefaultDirectionClass(this.direction);\n },\n\n stackResponsive () {\n return getResponsiveClasses(this.direction);\n },\n },\n};\n</script>\n"],"names":["_isDefaultDirection","direction","DT_STACK_DIRECTION","_getValidDirection","directionPropType","defaultStyle","value","getDefaultDirectionClass","getResponsiveClasses","DT_STACK_RESPONSIVE_BREAKPOINTS","breakpoint","getGapClass","gap","DT_STACK_GAP","directionValidator","gapValidator","_sfc_main"],"mappings":"oMAEA,SAASA,EAAqBC,EAAW,CACvC,OAAOA,IAAcC,EAAkB,EAAC,OAC1C,CAEA,SAASC,EAAoBF,EAAW,CACtC,GAAIG,EAAkBH,CAAS,IAAM,SACnC,OAAQD,EAAoBC,CAAS,EAAoC,KAAhCC,EAAAA,EAAmBD,CAAS,EAChE,GAAIG,EAAkBH,CAAS,IAAM,SAAU,CACpD,KAAM,CAAE,QAASI,CAAc,EAAGJ,EAElC,OAAQD,EAAoBK,CAAY,EAAuC,KAAnCH,EAAAA,EAAmBG,CAAY,CAC/E,KAAW,QAAO,IAClB,CAEO,SAASD,EAAmBE,EAAO,CACxC,OAAO,OAAOA,CAChB,CAEO,SAASC,EAA0BN,EAAW,CACnD,OAAOE,EAAmBF,CAAS,EAC/B,YAAYC,EAAkB,EAACC,EAAmBF,CAAS,CAAC,CAAC,GAC7D,IACN,CAEO,SAASO,EAAsBP,EAAW,CAC/C,OAAIG,EAAkBH,CAAS,IAAM,SAC5B,CACL,GAAGQ,EAA+B,EAAC,IAAKC,GAC/BT,EAAUS,CAAU,EACvB,YAAYA,CAAU,KAAKT,EAAUS,CAAU,CAAC,GAChD,IACL,CAAC,EACU,IAClB,CAEO,SAASC,EAAaC,EAAK,CAChC,OAAOC,EAAY,EAAC,SAASD,CAAG,EAAI,gBAAgBA,CAAG,GAAK,IAC9D,CCpCO,SAASE,EAAoBb,EAAW,CAC7C,GAAIG,EAAkBH,CAAS,IAAM,SACnC,OAAO,OAAO,KAAKC,EAAAA,CAAkB,EAAE,SAASD,CAAS,EACpD,GAAIG,EAAkBH,CAAS,IAAM,SAAU,CACpD,KAAM,CAAE,QAASI,CAAc,EAAGJ,EAElC,OAAO,OAAO,KAAKC,EAAAA,CAAkB,EAAE,SAASG,CAAY,CAChE,KAAW,QAAO,IAClB,CAEO,SAASU,EAAcH,EAAK,CACjC,OAAOC,EAAY,EAAC,SAASD,CAAG,CAClC,CCKA,MAAAI,EAAA,CACA,KAAA,UAEA,MAAA,CASA,UAAA,CACA,KAAA,CAAA,OAAA,MAAA,EACA,QAAA,SACA,UAAAf,GAAAa,EAAAb,CAAA,CACA,EAKA,GAAA,CACA,KAAA,OACA,QAAA,KACA,EAMA,IAAA,CACA,KAAA,OACA,QAAA,IACA,UAAAW,GAAAG,EAAAH,CAAA,CACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,mBAAAV,EAAA,EACA,aAAAW,EAAA,EACA,gCAAAJ,EAAA,CACA,CACA,EAEA,SAAA,CACA,UAAA,CACA,OAAAE,EAAA,KAAA,GAAA,CACA,EAEA,kBAAA,CACA,OAAAJ,EAAA,KAAA,SAAA,CACA,EAEA,iBAAA,CACA,OAAAC,EAAA,KAAA,SAAA,CACA,CACA,CACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chunks/tab-7hJQSLFx.js"),l=require("../chunks/modal-qEzlo0Sj.js"),r=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js");require("./button.cjs");require("vue");require("../chunks/link_constants-Kn6kP4i1.js");const i={name:"DtTabPanel",mixins:[l.M],inject:["groupContext"],props:{id:{type:String,required:!0},tabId:{type:String,required:!0},hidden:{type:Boolean,default:!1},tabPanelClass:{type:[String,Array,Object],default:""}},data(){return{isFirstElementFocusable:!1}},computed:{hidePanel(){return this.groupContext.selected!==this.id||this.hidden}},async mounted(){const a=await this.getFirstFocusableElement(this.$el);a?this.isFirstElementFocusable=this.isFirstElementOfPanel(a):this.isFirstElementFocusable=!1},methods:{isFirstElementOfPanel(a){let e=a,n=!0;for(;e;){if(e.previousElementSibling!==null){n=!1;break}e=e.parentNode!==this.$el?e.parentNode:null}return n}}};var s=function(){var e=this,n=e._self._c;return n("div",{directives:[{name:"show",rawName:"v-show",value:!e.hidePanel,expression:"!hidePanel"}],class:e.tabPanelClass,attrs:{id:`dt-panel-${e.id}`,role:"tabpanel",tabindex:e.isFirstElementFocusable?-1:0,"aria-labelledby":`dt-tab-${e.tabId}`,"aria-hidden":`${e.hidePanel}`,"data-qa":"dt-tab-panel"}},[e._t("default")],2)},u=[],d=r.n(i,s,u,!1,null,null,null,null);const o=d.exports;exports.DtTab=t.a;exports.DtTabGroup=t.D;exports.TAB_IMPORTANCE_MODIFIERS=t.d;exports.TAB_LIST_IMPORTANCE_MODIFIERS=t.c;exports.TAB_LIST_KIND_MODIFIERS=t.T;exports.TAB_LIST_SIZES=t.b;exports.DtTabPanel=o;
|
|
2
|
+
//# sourceMappingURL=tabs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.cjs","sources":["../../components/tabs/tab_panel.vue"],"sourcesContent":["<template>\n <div\n v-show=\"!hidePanel\"\n :id=\"`dt-panel-${id}`\"\n role=\"tabpanel\"\n :tabindex=\"isFirstElementFocusable ? -1 : 0\"\n :aria-labelledby=\"`dt-tab-${tabId}`\"\n :aria-hidden=\"`${hidePanel}`\"\n :class=\"tabPanelClass\"\n data-qa=\"dt-tab-panel\"\n >\n <!-- @slot Default slot for Tab Panel -->\n <slot v-show=\"!hidden\" />\n </div>\n</template>\n\n<script>\nimport Modal from '@/common/mixins/modal';\n\n/**\n * Tabs allow users to navigation between grouped content in different views while within the same page context.\n * @see https://dialtone.dialpad.com/components/tabs.html\n */\nexport default {\n name: 'DtTabPanel',\n\n mixins: [Modal],\n\n inject: ['groupContext'],\n\n props: {\n /**\n * Id of the panel\n */\n id: {\n type: String,\n required: true,\n },\n\n /**\n * Id of the associated tab\n */\n tabId: {\n type: String,\n required: true,\n },\n\n /**\n * If true, hides the tab content\n * @values true, false\n */\n hidden: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Used to customize the tab element\n */\n tabPanelClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n data () {\n return {\n isFirstElementFocusable: false,\n };\n },\n\n computed: {\n hidePanel () {\n return this.groupContext.selected !== this.id || this.hidden;\n },\n },\n\n async mounted () {\n const firstFocusableElement = await this.getFirstFocusableElement(this.$el);\n\n if (!firstFocusableElement) {\n this.isFirstElementFocusable = false;\n } else {\n // If the first focusable element isn't the first element in the panel,\n // then we need to set the panel tabindex to 0.\n // See notes in https://www.w3.org/WAI/ARIA/apg/patterns/tabpanel/\n this.isFirstElementFocusable = this.isFirstElementOfPanel(firstFocusableElement);\n }\n },\n\n methods: {\n isFirstElementOfPanel (element) {\n let current = element;\n let isFirstElement = true;\n\n while (current) {\n if (current.previousElementSibling !== null) {\n isFirstElement = false;\n break;\n }\n current = current.parentNode !== this.$el ? current.parentNode : null;\n }\n\n return isFirstElement;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","Modal","firstFocusableElement","element","current","isFirstElement"],"mappings":"wTAuBA,MAAAA,EAAA,CACA,KAAA,aAEA,OAAA,CAAAC,EAAAA,CAAA,EAEA,OAAA,CAAA,cAAA,EAEA,MAAA,CAIA,GAAA,CACA,KAAA,OACA,SAAA,EACA,EAKA,MAAA,CACA,KAAA,OACA,SAAA,EACA,EAMA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,cAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,wBAAA,EACA,CACA,EAEA,SAAA,CACA,WAAA,CACA,OAAA,KAAA,aAAA,WAAA,KAAA,IAAA,KAAA,MACA,CACA,EAEA,MAAA,SAAA,CACA,MAAAC,EAAA,MAAA,KAAA,yBAAA,KAAA,GAAA,EAEAA,EAMA,KAAA,wBAAA,KAAA,sBAAAA,CAAA,EALA,KAAA,wBAAA,EAOA,EAEA,QAAA,CACA,sBAAAC,EAAA,CACA,IAAAC,EAAAD,EACAE,EAAA,GAEA,KAAAD,GAAA,CACA,GAAAA,EAAA,yBAAA,KAAA,CACAC,EAAA,GACA,KACA,CACAD,EAAAA,EAAA,aAAA,KAAA,IAAAA,EAAA,WAAA,IACA,CAEA,OAAAC,CACA,CACA,CACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js"),a={name:"DtRecipeTimePill",props:{dateTimeDisplay:{type:String,required:!0},dateTime:{type:String,required:!0,validator:t=>{const e=new Date(t);return e instanceof Date&&!isNaN(e)}}}};var n=function(){var e=this,i=e._self._c;return i("time",{staticClass:"dt-time-pill",attrs:{"data-qa":"dt-time-pill",dateTime:e.dateTime}},[e._v(" "+e._s(e.dateTimeDisplay)+" ")])},l=[],s=r.n(a,n,l,!1,null,null,null,null);const u=s.exports;exports.DtRecipeTimePill=u;
|
|
2
|
+
//# sourceMappingURL=time-pill.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-pill.cjs","sources":["../../recipes/conversation_view/time_pill/time_pill.vue"],"sourcesContent":["<template>\n <time\n data-qa=\"dt-time-pill\"\n :dateTime=\"dateTime\"\n class=\"dt-time-pill\"\n >\n {{ dateTimeDisplay }}\n </time>\n</template>\n\n<script>\nimport {} from './time_pill_constants';\n\nexport default {\n name: 'DtRecipeTimePill',\n\n props: {\n /**\n * Date time display value\n */\n dateTimeDisplay: {\n type: String,\n required: true,\n },\n\n /**\n * Machine-readable attribute\n * Accepts a string value of YYYY-MM-DD or YYYY-MM-DDThh:mm:ssTZD\n */\n dateTime: {\n type: String,\n required: true,\n validator: (t) => {\n // Since this will only ever be used in the context of a date, we're rejecting non date inputs\n const x = new Date(t);\n if (x instanceof Date && !isNaN(x)) {\n return true;\n }\n return false;\n },\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-time-pill {\n color: var(--dt-color-foreground-primary);\n border-radius: var(--dt-size-radius-pill);\n line-height: var(--dt-font-line-height-300);\n font-size: var(--dt-font-size-100);\n border: var(--dt-size-border-100) solid var(--dt-color-border-default);\n background-color: var(--dt-color-surface-primary);\n padding: var(--dt-space-300) var(--dt-space-500);\n}\n</style>\n"],"names":["_sfc_main","x"],"mappings":"iJAaAA,EAAA,CACA,KAAA,mBAEA,MAAA,CAIA,gBAAA,CACA,KAAA,OACA,SAAA,EACA,EAMA,SAAA,CACA,KAAA,OACA,SAAA,GACA,UAAA,GAAA,CAEA,MAAAC,EAAA,IAAA,KAAA,CAAA,EACA,OAAAA,aAAA,MAAA,CAAA,MAAAA,CAAA,CAIA,CACA,CACA,CACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./utils.cjs"),a=require("../chunks/sr_only_close_button-ErijKGYR.js"),l=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js"),s=require("../chunks/notice_action-u3ZKIhit.js"),u=require("../chunks/notice_constants-mC6al2Dm.js");require("./constants.cjs");require("vue");require("./icon.cjs");require("@dialpad/dialtone-icons/vue2");require("../chunks/icon_constants-2S_OSQ1t.js");require("@dialpad/dialtone-icons/icons.json");require("./button.cjs");require("../chunks/link_constants-Kn6kP4i1.js");const r=["status","alert"],n=6e3,d={name:"DtToast",components:{DtNoticeIcon:s.a,DtNoticeContent:s.b,DtNoticeAction:s.D},mixins:[a.a],props:{titleId:{type:String,default(){return o.default.getUniqueString()}},contentId:{type:String,default(){return o.default.getUniqueString()}},title:{type:String,default:""},message:{type:String,default:""},role:{type:String,default:"status",validator:e=>r.includes(e)},kind:{type:String,default:"base",validator:e=>u.N.includes(e)},important:{type:Boolean,default:!1},show:{type:Boolean,default:!1},closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1},hideIcon:{type:Boolean,default:!1},hideAction:{type:Boolean,default:!1},duration:{type:Number,default:null,validator:e=>e>=n}},emits:["close","update:show"],data(){return{isShown:!1,minDuration:n}},computed:{kindClass(){return{error:"d-toast--error",info:"d-toast--info",success:"d-toast--success",warning:"d-toast--warning",base:"d-toast--base"}[this.kind]},noticeActionListeners(){return{...this.$listeners,close:e=>{this.isShown=!1,this.$emit("update:show",!1),this.$emit("close",e)}}},shouldSetTimeout(){return!!this.duration&&this.duration>=this.minDuration}},watch:{show:{handler:function(e){this.isShown=e,e?this.setTimeout():clearTimeout(this.displayTimer)},immediate:!0}},destroyed(){this.shouldSetTimeout&&clearTimeout(this.displayTimer)},methods:{setTimeout(){this.shouldSetTimeout&&(this.displayTimer=setTimeout(()=>{this.isShown=!1,this.$emit("update:show",!1)},this.duration))}}};var c=function(){var t=this,i=t._self._c;return t.isShown?i("div",{class:["d-toast",t.kindClass,{"d-toast--important":t.important}],attrs:{"data-qa":"dt-toast","aria-hidden":(!t.isShown).toString()}},[i("div",{staticClass:"d-toast__dialog"},[t.hideIcon?t._e():i("dt-notice-icon",t._g({attrs:{kind:t.kind}},t.$listeners),[t._t("icon")],2),i("dt-notice-content",t._g({attrs:{"title-id":t.titleId,"content-id":t.contentId,title:t.title,role:t.role},scopedSlots:t._u([{key:"titleOverride",fn:function(){return[t._t("titleOverride")]},proxy:!0}],null,!0)},t.$listeners),[t._t("default",function(){return[t._v(" "+t._s(t.message)+" ")]})],2),i("dt-notice-action",t._g({attrs:{"hide-action":t.hideAction,"hide-close":t.hideClose,"close-button-props":t.closeButtonProps,"visually-hidden-close":t.visuallyHiddenClose,"visually-hidden-close-label":t.visuallyHiddenCloseLabel}},t.noticeActionListeners),[t._t("action")],2)],1)]):t._e()},h=[],f=l.n(d,c,h,!1,null,null,null,null);const _=f.exports;exports.DtToast=_;exports.TOAST_MIN_DURATION=n;exports.TOAST_ROLES=r;
|
|
2
|
+
//# sourceMappingURL=toast.cjs.map
|