@dialpad/dialtone 9.123.1 → 9.124.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/README.md +3 -3
- package/dist/css/dialtone-default-theme.css +464 -105
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone-docs.json +1 -1
- package/dist/css/dialtone.css +238 -96
- package/dist/css/dialtone.min.css +1 -1
- package/dist/css/svg/spot/playlist.svg +1 -0
- package/dist/css/vue/spot/SpotPlaylist.vue +3 -0
- package/dist/tokens/doc.json +21642 -21642
- package/dist/vue2/_plugin-vue2_normalizer-DSLOjnn3.js +11 -0
- package/dist/vue2/_plugin-vue2_normalizer-DSLOjnn3.js.map +1 -0
- package/dist/vue2/_plugin-vue2_normalizer-e_CkxkSV.cjs +2 -0
- package/dist/vue2/_plugin-vue2_normalizer-e_CkxkSV.cjs.map +1 -0
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs.map +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js +8 -17
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js.map +1 -1
- package/dist/vue2/lib/avatar/avatar.cjs +1 -1
- package/dist/vue2/lib/avatar/avatar.js +2 -5
- package/dist/vue2/lib/avatar/avatar.js.map +1 -1
- package/dist/vue2/lib/badge/badge.cjs +1 -1
- package/dist/vue2/lib/badge/badge.js +4 -7
- package/dist/vue2/lib/badge/badge.js.map +1 -1
- package/dist/vue2/lib/banner/banner.cjs +2 -2
- package/dist/vue2/lib/banner/banner.js +6 -9
- package/dist/vue2/lib/banner/banner.js.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumb-item.cjs +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumb-item.js +4 -7
- package/dist/vue2/lib/breadcrumbs/breadcrumb-item.js.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.js +2 -5
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/vue2/lib/button/button.cjs +1 -1
- package/dist/vue2/lib/button/button.js +2 -5
- package/dist/vue2/lib/button/button.js.map +1 -1
- package/dist/vue2/lib/button-group/button-group.cjs +1 -1
- package/dist/vue2/lib/button-group/button-group.js +8 -11
- package/dist/vue2/lib/button-group/button-group.js.map +1 -1
- package/dist/vue2/lib/button-group/buttons-decorator.cjs +1 -1
- package/dist/vue2/lib/button-group/buttons-decorator.js +4 -7
- package/dist/vue2/lib/button-group/buttons-decorator.js.map +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button.cjs +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button.js +7 -10
- package/dist/vue2/lib/callbar-button/callbar-button.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +2 -5
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js +9 -12
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
- package/dist/vue2/lib/callbox/callbox.cjs +1 -1
- package/dist/vue2/lib/callbox/callbox.js +2 -5
- package/dist/vue2/lib/callbox/callbox.js.map +1 -1
- package/dist/vue2/lib/card/card.cjs +1 -1
- package/dist/vue2/lib/card/card.js +4 -7
- package/dist/vue2/lib/card/card.js.map +1 -1
- package/dist/vue2/lib/checkbox/checkbox.cjs +1 -1
- package/dist/vue2/lib/checkbox/checkbox.js +2 -5
- package/dist/vue2/lib/checkbox/checkbox.js.map +1 -1
- package/dist/vue2/lib/checkbox-group/checkbox-group.cjs +1 -1
- package/dist/vue2/lib/checkbox-group/checkbox-group.js +5 -8
- package/dist/vue2/lib/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/vue2/lib/checkbox-group/checkboxes-decorator.cjs +1 -1
- package/dist/vue2/lib/checkbox-group/checkboxes-decorator.js +9 -12
- package/dist/vue2/lib/checkbox-group/checkboxes-decorator.js.map +1 -1
- package/dist/vue2/lib/chip/chip.cjs +1 -1
- package/dist/vue2/lib/chip/chip.js +8 -11
- package/dist/vue2/lib/chip/chip.js.map +1 -1
- package/dist/vue2/lib/codeblock/codeblock.cjs +2 -2
- package/dist/vue2/lib/codeblock/codeblock.js +8 -11
- package/dist/vue2/lib/codeblock/codeblock.js.map +1 -1
- package/dist/vue2/lib/collapsible/collapsible-lazy-show.cjs +1 -1
- package/dist/vue2/lib/collapsible/collapsible-lazy-show.js +2 -5
- package/dist/vue2/lib/collapsible/collapsible-lazy-show.js.map +1 -1
- package/dist/vue2/lib/collapsible/collapsible.cjs +1 -1
- package/dist/vue2/lib/collapsible/collapsible.js +4 -7
- package/dist/vue2/lib/collapsible/collapsible.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox-empty-list.cjs +1 -1
- package/dist/vue2/lib/combobox/combobox-empty-list.js +7 -10
- package/dist/vue2/lib/combobox/combobox-empty-list.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.cjs +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.js +7 -10
- package/dist/vue2/lib/combobox/combobox-loading-list.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox.cjs +2 -2
- package/dist/vue2/lib/combobox/combobox.js +2 -5
- package/dist/vue2/lib/combobox/combobox.js.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js +9 -11
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js +2 -5
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js +6 -9
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js.map +1 -1
- package/dist/vue2/lib/contact-info/contact-info.cjs +1 -1
- package/dist/vue2/lib/contact-info/contact-info.js +5 -8
- package/dist/vue2/lib/contact-info/contact-info.js.map +1 -1
- package/dist/vue2/lib/contact-row/contact-row.cjs +1 -1
- package/dist/vue2/lib/contact-row/contact-row.js +2 -5
- package/dist/vue2/lib/contact-row/contact-row.js.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.js +4 -13
- package/dist/vue2/lib/datepicker/datepicker.js.map +1 -1
- package/dist/vue2/lib/description-list/description-list.cjs +1 -1
- package/dist/vue2/lib/description-list/description-list.js +10 -13
- package/dist/vue2/lib/description-list/description-list.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown-list.cjs +1 -1
- package/dist/vue2/lib/dropdown/dropdown-list.js +5 -8
- package/dist/vue2/lib/dropdown/dropdown-list.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown-separator.cjs +1 -1
- package/dist/vue2/lib/dropdown/dropdown-separator.js +4 -7
- package/dist/vue2/lib/dropdown/dropdown-separator.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown.cjs +1 -1
- package/dist/vue2/lib/dropdown/dropdown.js +2 -5
- package/dist/vue2/lib/dropdown/dropdown.js.map +1 -1
- package/dist/vue2/lib/editor/editor.cjs +1 -1
- package/dist/vue2/lib/editor/editor.js +46 -49
- package/dist/vue2/lib/editor/editor.js.map +1 -1
- package/dist/vue2/lib/emoji/emoji.cjs +1 -1
- package/dist/vue2/lib/emoji/emoji.js +7 -10
- package/dist/vue2/lib/emoji/emoji.js.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.js +7 -25
- package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +3 -6
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.cjs +1 -1
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.js +6 -9
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.js.map +1 -1
- package/dist/vue2/lib/empty-state/empty-state.cjs +1 -1
- package/dist/vue2/lib/empty-state/empty-state.js +6 -9
- package/dist/vue2/lib/empty-state/empty-state.js.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js +11 -14
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js.map +1 -1
- package/dist/vue2/lib/feed-item-row/feed-item-row.cjs +1 -1
- package/dist/vue2/lib/feed-item-row/feed-item-row.js +6 -9
- package/dist/vue2/lib/feed-item-row/feed-item-row.js.map +1 -1
- package/dist/vue2/lib/general-row/general-row.cjs +1 -1
- package/dist/vue2/lib/general-row/general-row.js +2 -5
- package/dist/vue2/lib/general-row/general-row.js.map +1 -1
- package/dist/vue2/lib/general-row/leftbar-general-row-icon.cjs +1 -1
- package/dist/vue2/lib/general-row/leftbar-general-row-icon.js +7 -10
- package/dist/vue2/lib/general-row/leftbar-general-row-icon.js.map +1 -1
- package/dist/vue2/lib/group-row/group-row.cjs +1 -1
- package/dist/vue2/lib/group-row/group-row.js +4 -7
- package/dist/vue2/lib/group-row/group-row.js.map +1 -1
- package/dist/vue2/lib/grouped-chip/grouped-chip.cjs +1 -1
- package/dist/vue2/lib/grouped-chip/grouped-chip.js +4 -7
- package/dist/vue2/lib/grouped-chip/grouped-chip.js.map +1 -1
- package/dist/vue2/lib/hovercard/hovercard.cjs +1 -1
- package/dist/vue2/lib/hovercard/hovercard.js +6 -9
- package/dist/vue2/lib/hovercard/hovercard.js.map +1 -1
- package/dist/vue2/lib/icon/icon.cjs +1 -1
- package/dist/vue2/lib/icon/icon.js +9 -12
- package/dist/vue2/lib/icon/icon.js.map +1 -1
- package/dist/vue2/lib/illustration/illustration.cjs +1 -1
- package/dist/vue2/lib/illustration/illustration.js +10 -13
- package/dist/vue2/lib/illustration/illustration.js.map +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.cjs +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.js +6 -9
- package/dist/vue2/lib/image-viewer/image-viewer.js.map +1 -1
- package/dist/vue2/lib/input/input.cjs +1 -1
- package/dist/vue2/lib/input/input.js +2 -5
- package/dist/vue2/lib/input/input.js.map +1 -1
- package/dist/vue2/lib/input-group/input-group.cjs +1 -1
- package/dist/vue2/lib/input-group/input-group.js +6 -9
- package/dist/vue2/lib/input-group/input-group.js.map +1 -1
- package/dist/vue2/lib/item-layout/item-layout.cjs +2 -2
- package/dist/vue2/lib/item-layout/item-layout.js +4 -7
- package/dist/vue2/lib/item-layout/item-layout.js.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.cjs +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.js +11 -14
- package/dist/vue2/lib/ivr-node/ivr-node.js.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut/keyboard-shortcut.cjs +1 -1
- package/dist/vue2/lib/keyboard-shortcut/keyboard-shortcut.js +10 -13
- package/dist/vue2/lib/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/vue2/lib/lazy-show/lazy-show.cjs +1 -1
- package/dist/vue2/lib/lazy-show/lazy-show.js +2 -5
- package/dist/vue2/lib/lazy-show/lazy-show.js.map +1 -1
- package/dist/vue2/lib/link/link.cjs +1 -1
- package/dist/vue2/lib/link/link.js +6 -9
- package/dist/vue2/lib/link/link.js.map +1 -1
- package/dist/vue2/lib/list-item/list-item.cjs +1 -1
- package/dist/vue2/lib/list-item/list-item.js +22 -25
- package/dist/vue2/lib/list-item/list-item.js.map +1 -1
- package/dist/vue2/lib/list-item-group/list-item-group.cjs +1 -1
- package/dist/vue2/lib/list-item-group/list-item-group.js +8 -11
- package/dist/vue2/lib/list-item-group/list-item-group.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-button.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-button.js +4 -7
- package/dist/vue2/lib/message-input/message-input-button.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-link.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-link.js +2 -5
- package/dist/vue2/lib/message-input/message-input-link.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.js +2 -5
- package/dist/vue2/lib/message-input/message-input-topbar.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input.js +3 -9
- package/dist/vue2/lib/message-input/message-input.js.map +1 -1
- package/dist/vue2/lib/modal/modal.cjs +2 -2
- package/dist/vue2/lib/modal/modal.js +2 -5
- package/dist/vue2/lib/modal/modal.js.map +1 -1
- package/dist/vue2/lib/notice/notice-action.cjs +1 -1
- package/dist/vue2/lib/notice/notice-action.js +4 -7
- package/dist/vue2/lib/notice/notice-action.js.map +1 -1
- package/dist/vue2/lib/notice/notice-content.cjs +1 -1
- package/dist/vue2/lib/notice/notice-content.js +2 -5
- package/dist/vue2/lib/notice/notice-content.js.map +1 -1
- package/dist/vue2/lib/notice/notice-icon.cjs +1 -1
- package/dist/vue2/lib/notice/notice-icon.js +13 -16
- package/dist/vue2/lib/notice/notice-icon.js.map +1 -1
- package/dist/vue2/lib/notice/notice.cjs +1 -1
- package/dist/vue2/lib/notice/notice.js +7 -10
- package/dist/vue2/lib/notice/notice.js.map +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs +1 -1
- package/dist/vue2/lib/pagination/pagination.js +6 -9
- package/dist/vue2/lib/pagination/pagination.js.map +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.cjs +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.js +5 -8
- package/dist/vue2/lib/popover/popover-header-footer.js.map +1 -1
- package/dist/vue2/lib/popover/popover.cjs +1 -1
- package/dist/vue2/lib/popover/popover.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover.js +3 -6
- package/dist/vue2/lib/popover/popover.js.map +1 -1
- package/dist/vue2/lib/presence/presence.cjs +1 -1
- package/dist/vue2/lib/presence/presence.js +4 -7
- package/dist/vue2/lib/presence/presence.js.map +1 -1
- package/dist/vue2/lib/radio/radio.cjs +1 -1
- package/dist/vue2/lib/radio/radio.js +5 -8
- package/dist/vue2/lib/radio/radio.js.map +1 -1
- package/dist/vue2/lib/radio-group/radio-group.cjs +1 -1
- package/dist/vue2/lib/radio-group/radio-group.js +2 -5
- package/dist/vue2/lib/radio-group/radio-group.js.map +1 -1
- package/dist/vue2/lib/radio-group/radios-decorator.cjs +1 -1
- package/dist/vue2/lib/radio-group/radios-decorator.js +6 -9
- package/dist/vue2/lib/radio-group/radios-decorator.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +3 -3
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +11 -41
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/root-layout/root-layout.cjs +1 -1
- package/dist/vue2/lib/root-layout/root-layout.js +5 -8
- package/dist/vue2/lib/root-layout/root-layout.js.map +1 -1
- package/dist/vue2/lib/select-menu/select-menu.cjs +1 -1
- package/dist/vue2/lib/select-menu/select-menu.js +2 -5
- package/dist/vue2/lib/select-menu/select-menu.js.map +1 -1
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.cjs +1 -1
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.js +4 -7
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-list-item.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton-list-item.js +2 -5
- package/dist/vue2/lib/skeleton/skeleton-list-item.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-paragraph.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton-paragraph.js +5 -8
- package/dist/vue2/lib/skeleton/skeleton-paragraph.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-shape.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton-shape.js +4 -7
- package/dist/vue2/lib/skeleton/skeleton-shape.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-text.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton-text.js +11 -14
- package/dist/vue2/lib/skeleton/skeleton-text.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton.js +6 -9
- package/dist/vue2/lib/skeleton/skeleton.js.map +1 -1
- package/dist/vue2/lib/split-button/split-button-alpha.cjs +1 -1
- package/dist/vue2/lib/split-button/split-button-alpha.js +9 -12
- package/dist/vue2/lib/split-button/split-button-alpha.js.map +1 -1
- package/dist/vue2/lib/split-button/split-button-omega.cjs +1 -1
- package/dist/vue2/lib/split-button/split-button-omega.js +6 -9
- package/dist/vue2/lib/split-button/split-button-omega.js.map +1 -1
- package/dist/vue2/lib/split-button/split-button.cjs +1 -1
- package/dist/vue2/lib/split-button/split-button.js +6 -9
- package/dist/vue2/lib/split-button/split-button.js.map +1 -1
- package/dist/vue2/lib/stack/stack.cjs +1 -1
- package/dist/vue2/lib/stack/stack.js +12 -15
- package/dist/vue2/lib/stack/stack.js.map +1 -1
- package/dist/vue2/lib/tab/tab-group.cjs +1 -1
- package/dist/vue2/lib/tab/tab-group.js +2 -5
- package/dist/vue2/lib/tab/tab-group.js.map +1 -1
- package/dist/vue2/lib/tab/tab-panel.cjs +1 -1
- package/dist/vue2/lib/tab/tab-panel.js +8 -11
- package/dist/vue2/lib/tab/tab-panel.js.map +1 -1
- package/dist/vue2/lib/tab/tab.cjs +1 -1
- package/dist/vue2/lib/tab/tab.js +7 -10
- package/dist/vue2/lib/tab/tab.js.map +1 -1
- package/dist/vue2/lib/time-pill/time-pill.cjs +1 -1
- package/dist/vue2/lib/time-pill/time-pill.js +5 -8
- package/dist/vue2/lib/time-pill/time-pill.js.map +1 -1
- package/dist/vue2/lib/toast/toast.cjs +1 -1
- package/dist/vue2/lib/toast/toast.cjs.map +1 -1
- package/dist/vue2/lib/toast/toast.js +5 -17
- package/dist/vue2/lib/toast/toast.js.map +1 -1
- package/dist/vue2/lib/toggle/toggle.cjs +1 -1
- package/dist/vue2/lib/toggle/toggle.js +2 -5
- package/dist/vue2/lib/toggle/toggle.js.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js +6 -9
- package/dist/vue2/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue2/lib/top-banner-info/top-banner-info.cjs +1 -1
- package/dist/vue2/lib/top-banner-info/top-banner-info.js +2 -5
- package/dist/vue2/lib/top-banner-info/top-banner-info.js.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.cjs +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.js +5 -8
- package/dist/vue2/lib/unread-pill/unread-pill.js.map +1 -1
- package/dist/vue2/lib/validation-messages/validation-messages.cjs +1 -1
- package/dist/vue2/lib/validation-messages/validation-messages.js +7 -10
- package/dist/vue2/lib/validation-messages/validation-messages.js.map +1 -1
- package/dist/vue2/shared/sr_only_close_button.cjs +1 -1
- package/dist/vue2/shared/sr_only_close_button.js +9 -12
- package/dist/vue2/shared/sr_only_close_button.js.map +1 -1
- package/dist/vue2/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js +3 -2
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/vue3/lib/popover/popover.cjs +1 -1
- package/dist/vue3/lib/popover/popover.cjs.map +1 -1
- package/dist/vue3/lib/popover/popover.js +37 -38
- package/dist/vue3/lib/popover/popover.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/types/components/popover/popover.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/vue2/_plugin-vue2_normalizer-CeySl7Fu.js +0 -11
- package/dist/vue2/_plugin-vue2_normalizer-CeySl7Fu.js.map +0 -1
- package/dist/vue2/_plugin-vue2_normalizer-yXi3ZRRD.cjs +0 -2
- package/dist/vue2/_plugin-vue2_normalizer-yXi3ZRRD.cjs.map +0 -1
- package/dist/vue2/style.css +0 -1
- package/dist/vue3/style.css +0 -1
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { n as a } from "../../_plugin-vue2_normalizer-
|
|
1
|
+
import { n as a } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
2
2
|
const e = {
|
|
3
3
|
name: "DtDropdownSeparator"
|
|
4
4
|
};
|
|
5
5
|
var n = function() {
|
|
6
6
|
var r = this, t = r._self._c;
|
|
7
7
|
return t("li", { staticClass: "d-list-item-separator", attrs: { "aria-hidden": "true" } });
|
|
8
|
-
},
|
|
8
|
+
}, o = [], s = /* @__PURE__ */ a(
|
|
9
9
|
e,
|
|
10
10
|
n,
|
|
11
|
-
|
|
12
|
-
!1,
|
|
13
|
-
null,
|
|
14
|
-
null
|
|
11
|
+
o
|
|
15
12
|
);
|
|
16
|
-
const c =
|
|
13
|
+
const c = s.exports;
|
|
17
14
|
export {
|
|
18
15
|
c as default
|
|
19
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-separator.js","sources":["../../../components/dropdown/dropdown_separator.vue"],"sourcesContent":["<template>\n <li\n aria-hidden=\"true\"\n class=\"d-list-item-separator\"\n />\n</template>\n\n<script>\nexport default {\n name: 'DtDropdownSeparator',\n};\n</script>\n"],"names":["_sfc_main"],"mappings":";AAQA,MAAAA,IAAA;AAAA,EACA,MAAA;AACA
|
|
1
|
+
{"version":3,"file":"dropdown-separator.js","sources":["../../../components/dropdown/dropdown_separator.vue"],"sourcesContent":["<template>\n <li\n aria-hidden=\"true\"\n class=\"d-list-item-separator\"\n />\n</template>\n\n<script>\nexport default {\n name: 'DtDropdownSeparator',\n};\n</script>\n"],"names":["_sfc_main"],"mappings":";AAQA,MAAAA,IAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../common/mixins/keyboard-list-navigation.cjs"),s=require("./dropdown-constants.cjs"),l=require("../../common/utils/index.cjs"),n=require("../../common/constants/index.cjs"),d=require("../../common/mixins/sr-only-close-button.cjs"),h=require("../../shared/sr_only_close_button.cjs"),u=require("../../_plugin-vue2_normalizer-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../common/mixins/keyboard-list-navigation.cjs"),s=require("./dropdown-constants.cjs"),l=require("../../common/utils/index.cjs"),n=require("../../common/constants/index.cjs"),d=require("../../common/mixins/sr-only-close-button.cjs"),h=require("../../shared/sr_only_close_button.cjs"),u=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),p=require("../popover/popover.cjs"),r=require("../list-item/list-item-constants.cjs"),c=require("../popover/popover-constants.cjs"),g={name:"DtDropdown",components:{DtPopover:p.default,SrOnlyCloseButton:h.default},mixins:[a.default({indexKey:"highlightIndex",idKey:"highlightId",listElementKey:"getListElement",listItemRole:"menuitem",afterHighlightMethod:"afterHighlight",beginningOfListMethod:"beginningOfListMethod",endOfListMethod:"endOfListMethod",activeItemKey:"activeItemEl",focusOnKeyboardNavigation:!0}),d.default],props:{open:{type:Boolean,default:null},openOnContext:{type:Boolean,default:!1},padding:{type:String,default:"small",validator:t=>Object.keys(s.DROPDOWN_PADDING_CLASSES).some(e=>e===t)},modal:{type:Boolean,default:!0},contentWidth:{type:String,default:null},maxHeight:{type:String,default:""},maxWidth:{type:String,default:""},listId:{type:String,default(){return l.getUniqueString()}},navigationType:{type:String,default:r.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,validator:t=>Object.values(r.LIST_ITEM_NAVIGATION_TYPES).includes(t)},fallbackPlacements:{type:Array,default:()=>["auto"]},placement:{type:String,default:"bottom"},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},listClass:{type:[String,Array,Object],default:""},appendTo:{type:[HTMLElement,String],default:"body",validator:t=>c.POPOVER_APPEND_TO_VALUES.includes(t)||t instanceof HTMLElement},tether:{type:Boolean,default:!0},transition:{type:String,default:"fade"}},emits:["highlight","opened","update:open"],data(){return{LIST_ITEM_NAVIGATION_TYPES:r.LIST_ITEM_NAVIGATION_TYPES,DROPDOWN_PADDING_CLASSES:s.DROPDOWN_PADDING_CLASSES,EVENT_KEYNAMES:n.EVENT_KEYNAMES,openedWithKeyboard:!1,isOpen:null}},computed:{dropdownListeners(){return{...this.$listeners,opened:t=>{this.updateInitialHighlightIndex(t)},keydown:t=>{switch(t.code){case n.EVENT_KEYNAMES.up:case n.EVENT_KEYNAMES.arrowup:this.onUpKeyPress(t),t.stopPropagation(),t.preventDefault();break;case n.EVENT_KEYNAMES.down:case n.EVENT_KEYNAMES.arrowdown:this.onDownKeyPress(t),t.stopPropagation(),t.preventDefault();break;case n.EVENT_KEYNAMES.space:case n.EVENT_KEYNAMES.spacebar:this.onSpaceKey();break;case n.EVENT_KEYNAMES.enter:this.onEnterKey();break;case n.EVENT_KEYNAMES.home:this.onHomeKeyPress(t),t.stopPropagation(),t.preventDefault();break;case n.EVENT_KEYNAMES.end:this.onEndKeyPress(t),t.stopPropagation(),t.preventDefault();break;default:this.onKeyPress(t);break}this.$emit("keydown",t)}}},beginningOfListMethod(){return this.onBeginningOfList||this.jumpToEnd},endOfListMethod(){return this.onEndOfList||this.jumpToBeginning},activeItemEl(){return this.getListElement().querySelector("#"+this.highlightId)},isArrowKeyNav(){return this.navigationType===this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS},listClasses(){return["d-dropdown-list",s.DROPDOWN_PADDING_CLASSES[this.padding],this.listClass,{"d-context-menu-list":this.openOnContext}]},shouldOpenWithArrowKeys(){return!this.openOnContext}},methods:{onMouseHighlight(t){const e=t.target.closest("li");e&&e.role&&this.highlightId!==e.id&&(this.setHighlightId(e.id),e.focus())},getListElement(){return this.$refs.listWrapper},clearHighlightIndex(){this.setHighlightIndex(-1)},afterHighlight(){this.visuallyHiddenClose&&this.highlightIndex===this._itemsLength()-1||this.$emit("highlight",this.highlightIndex)},updateInitialHighlightIndex(t){this.isOpen=t,t?(this.openedWithKeyboard&&this.isArrowKeyNav&&this.setHighlightIndex(0),this.$emit("opened",!0)):(this.clearHighlightIndex(),this.openedWithKeyboard=!1,this.$emit("opened",!1))},onSpaceKey(){this.open||(this.openedWithKeyboard=!0)},onEnterKey(){this.open||(this.openedWithKeyboard=!0)},onUpKeyPress(){if(!this.isOpen){this.openedWithKeyboard=!0;return}if(this.isArrowKeyNav)return this.onUpKey()},onDownKeyPress(){if(!this.isOpen){this.openedWithKeyboard=!0;return}if(this.isArrowKeyNav)return this.onDownKey()},onHomeKeyPress(){if(!(!this.isOpen||!this.isArrowKeyNav))return this.onHomeKey()},onEndKeyPress(){if(!(!this.isOpen||!this.isArrowKeyNav))return this.onEndKey()},onKeyPress(t){if(!(!this.isOpen||!this.isArrowKeyNav||!this.isValidLetter(t.key)))return t.stopPropagation(),t.preventDefault(),this.onNavigationKey(t.key)}}};var f=function(){var e=this,o=e._self._c;return o("dt-popover",e._g({ref:"popover",attrs:{"content-width":e.contentWidth,open:e.open,placement:e.placement,"initial-focus-element":e.openedWithKeyboard?"first":"dialog","fallback-placements":e.fallbackPlacements,padding:"none",role:"menu","append-to":e.appendTo,modal:e.modal,"max-height":e.maxHeight,"max-width":e.maxWidth,"open-with-arrow-keys":e.shouldOpenWithArrowKeys,"open-on-context":e.openOnContext,tether:e.tether,transition:e.transition},scopedSlots:e._u([{key:"anchor",fn:function({attrs:i}){return[e._t("anchor",null,null,i)]}},{key:"content",fn:function({close:i}){return[o("ul",{ref:"listWrapper",class:e.listClasses,attrs:{id:e.listId,"data-qa":"dt-dropdown-list-wrapper"},on:{mouseleave:e.clearHighlightIndex,"!mousemove":function(m){return e.onMouseHighlight.apply(null,arguments)}}},[e._t("list",null,{close:i}),e.showVisuallyHiddenClose?o("sr-only-close-button",{attrs:{"visually-hidden-close-label":e.visuallyHiddenCloseLabel,tabindex:e.isArrowKeyNav?-1:0},on:{close:i}}):e._e()],2)]}},{key:"footerContent",fn:function({close:i}){return[e._t("footer",null,{close:i})]}}],null,!0)},e.dropdownListeners))},y=[],_=u.n(g,f,y);const E=_.exports;exports.default=E;
|
|
2
2
|
//# sourceMappingURL=dropdown.cjs.map
|
|
@@ -4,7 +4,7 @@ import { getUniqueString as l } from "../../common/utils/index.js";
|
|
|
4
4
|
import { EVENT_KEYNAMES as i } from "../../common/constants/index.js";
|
|
5
5
|
import h from "../../common/mixins/sr-only-close-button.js";
|
|
6
6
|
import d from "../../shared/sr_only_close_button.js";
|
|
7
|
-
import { n as p } from "../../_plugin-vue2_normalizer-
|
|
7
|
+
import { n as p } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
8
8
|
import u from "../popover/popover.js";
|
|
9
9
|
import { LIST_ITEM_NAVIGATION_TYPES as r } from "../list-item/list-item-constants.js";
|
|
10
10
|
import { POPOVER_APPEND_TO_VALUES as f } from "../popover/popover-constants.js";
|
|
@@ -346,10 +346,7 @@ var y = function() {
|
|
|
346
346
|
}, m = [], c = /* @__PURE__ */ p(
|
|
347
347
|
g,
|
|
348
348
|
y,
|
|
349
|
-
m
|
|
350
|
-
!1,
|
|
351
|
-
null,
|
|
352
|
-
null
|
|
349
|
+
m
|
|
353
350
|
);
|
|
354
351
|
const L = c.exports;
|
|
355
352
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sources":["../../../components/dropdown/dropdown.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <dt-popover\n ref=\"popover\"\n :content-width=\"contentWidth\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"openedWithKeyboard ? 'first' : 'dialog'\"\n :fallback-placements=\"fallbackPlacements\"\n padding=\"none\"\n role=\"menu\"\n :append-to=\"appendTo\"\n :modal=\"modal\"\n :max-height=\"maxHeight\"\n :max-width=\"maxWidth\"\n :open-with-arrow-keys=\"shouldOpenWithArrowKeys\"\n :open-on-context=\"openOnContext\"\n :tether=\"tether\"\n :transition=\"transition\"\n v-on=\"dropdownListeners\"\n >\n <template #anchor=\"{ attrs }\">\n <!-- @slot Anchor element that activates the dropdown -->\n <slot\n ref=\"anchor\"\n name=\"anchor\"\n v-bind=\"attrs\"\n />\n </template>\n <template #content=\"{ close }\">\n <!-- eslint-disable-next-line max-len -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->\n <ul\n :id=\"listId\"\n ref=\"listWrapper\"\n :class=\"listClasses\"\n data-qa=\"dt-dropdown-list-wrapper\"\n @mouseleave=\"clearHighlightIndex\"\n @mousemove.capture=\"onMouseHighlight\"\n >\n <!-- @slot Slot for the list component -->\n <slot\n name=\"list\"\n :close=\"close\"\n />\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :tabindex=\"isArrowKeyNav ? -1 : 0\"\n @close=\"close\"\n />\n </ul>\n </template>\n <template #footerContent=\"{ close }\">\n <!-- @slot Slot for the footer content -->\n <slot\n name=\"footer\"\n :close=\"close\"\n />\n </template>\n </dt-popover>\n</template>\n\n<script>\nimport KeyboardNavigation from '@/common/mixins/keyboard_list_navigation';\nimport { DtPopover, POPOVER_APPEND_TO_VALUES } from '@/components/popover';\nimport { LIST_ITEM_NAVIGATION_TYPES } from '@/components/list_item';\nimport { DROPDOWN_PADDING_CLASSES } from './dropdown_constants';\nimport { getUniqueString } from '@/common/utils';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\nexport default {\n name: 'DtDropdown',\n\n components: {\n DtPopover,\n SrOnlyCloseButton,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n listItemRole: 'menuitem',\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n focusOnKeyboardNavigation: true,\n }),\n SrOnlyCloseButtonMixin,\n ],\n\n props: {\n /**\n * Controls whether the dropdown is shown. Leaving this null will have the dropdown trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the dropdown on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Vertical padding size around the list element.\n * @values none, small, large\n */\n padding: {\n type: String,\n default: 'small',\n validator: (padding) => {\n return Object.keys(DROPDOWN_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Determines modal state, dropdown has a modal overlay preventing interaction with elements\n * below it, but it is invisible.\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n */\n placement: {\n type: String,\n default: 'bottom',\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Additional class for the wrapper list element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Event fired when dropdown is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n ],\n\n data () {\n return {\n LIST_ITEM_NAVIGATION_TYPES,\n DROPDOWN_PADDING_CLASSES,\n EVENT_KEYNAMES,\n openedWithKeyboard: false,\n isOpen: null,\n };\n },\n\n computed: {\n dropdownListeners () {\n return {\n ...this.$listeners,\n\n opened: isPopoverOpen => {\n this.updateInitialHighlightIndex(isPopoverOpen);\n },\n\n keydown: event => {\n const eventCode = event.code;\n\n switch (eventCode) {\n case EVENT_KEYNAMES.up:\n case EVENT_KEYNAMES.arrowup:\n this.onUpKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.down:\n case EVENT_KEYNAMES.arrowdown:\n this.onDownKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.space:\n case EVENT_KEYNAMES.spacebar:\n this.onSpaceKey();\n break;\n case EVENT_KEYNAMES.enter:\n this.onEnterKey();\n break;\n case EVENT_KEYNAMES.home:\n this.onHomeKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.end:\n this.onEndKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n default:\n this.onKeyPress(event);\n break;\n }\n\n this.$emit('keydown', event);\n },\n };\n },\n\n beginningOfListMethod () {\n return this.onBeginningOfList || this.jumpToEnd;\n },\n\n endOfListMethod () {\n return this.onEndOfList || this.jumpToBeginning;\n },\n\n activeItemEl () {\n return this.getListElement().querySelector('#' + this.highlightId);\n },\n\n isArrowKeyNav () {\n return this.navigationType === this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS;\n },\n\n listClasses () {\n return [\n 'd-dropdown-list',\n DROPDOWN_PADDING_CLASSES[this.padding],\n this.listClass,\n { 'd-context-menu-list': this.openOnContext },\n ];\n },\n\n shouldOpenWithArrowKeys () {\n return !this.openOnContext;\n },\n },\n\n methods: {\n onMouseHighlight (e) {\n const liElement = e.target.closest('li');\n\n if (liElement && liElement.role && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n liElement.focus();\n }\n },\n\n getListElement () {\n return this.$refs.listWrapper;\n },\n\n clearHighlightIndex () {\n this.setHighlightIndex(-1);\n },\n\n afterHighlight () {\n if (this.visuallyHiddenClose && this.highlightIndex === this._itemsLength() - 1) {\n return;\n }\n\n this.$emit('highlight', this.highlightIndex);\n },\n\n updateInitialHighlightIndex (isPopoverOpen) {\n this.isOpen = isPopoverOpen;\n\n if (isPopoverOpen) {\n if (this.openedWithKeyboard && this.isArrowKeyNav) {\n this.setHighlightIndex(0);\n }\n this.$emit('opened', true);\n } else {\n this.clearHighlightIndex();\n this.openedWithKeyboard = false;\n this.$emit('opened', false);\n }\n },\n\n onSpaceKey () {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n },\n\n onEnterKey () {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n },\n\n onUpKeyPress () {\n if (!this.isOpen) {\n this.openedWithKeyboard = true;\n return;\n }\n if (this.isArrowKeyNav) {\n return this.onUpKey();\n }\n },\n\n onDownKeyPress () {\n if (!this.isOpen) {\n this.openedWithKeyboard = true;\n return;\n }\n if (this.isArrowKeyNav) {\n return this.onDownKey();\n }\n },\n\n onHomeKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n return this.onHomeKey();\n },\n\n onEndKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n return this.onEndKey();\n },\n\n onKeyPress (e) {\n if (!this.isOpen || !this.isArrowKeyNav || !this.isValidLetter(e.key)) {\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n\n return this.onNavigationKey(e.key);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtPopover","SrOnlyCloseButton","KeyboardNavigation","SrOnlyCloseButtonMixin","padding","DROPDOWN_PADDING_CLASSES","item","getUniqueString","LIST_ITEM_NAVIGATION_TYPES","appendTo","POPOVER_APPEND_TO_VALUES","EVENT_KEYNAMES","isPopoverOpen","event","e","liElement"],"mappings":";;;;;;;;;;AAyEA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,WAAAC;AAAA,IACA,mBAAAC;AAAA,EACA;AAAA,EAEA,QAAA;AAAA,IACAC,EAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,gBAAA;AAAA,MACA,cAAA;AAAA,MACA,sBAAA;AAAA,MACA,uBAAA;AAAA,MACA,iBAAA;AAAA,MACA,eAAA;AAAA,MACA,2BAAA;AAAA,IACA,CAAA;AAAA,IACAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AA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down.js","sources":["../../../components/dropdown/dropdown.vue"],"sourcesContent":["<!-- eslint-disable max-lines -->\n<template>\n <dt-popover\n ref=\"popover\"\n :content-width=\"contentWidth\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"openedWithKeyboard ? 'first' : 'dialog'\"\n :fallback-placements=\"fallbackPlacements\"\n padding=\"none\"\n role=\"menu\"\n :append-to=\"appendTo\"\n :modal=\"modal\"\n :max-height=\"maxHeight\"\n :max-width=\"maxWidth\"\n :open-with-arrow-keys=\"shouldOpenWithArrowKeys\"\n :open-on-context=\"openOnContext\"\n :tether=\"tether\"\n :transition=\"transition\"\n v-on=\"dropdownListeners\"\n >\n <template #anchor=\"{ attrs }\">\n <!-- @slot Anchor element that activates the dropdown -->\n <slot\n ref=\"anchor\"\n name=\"anchor\"\n v-bind=\"attrs\"\n />\n </template>\n <template #content=\"{ close }\">\n <!-- eslint-disable-next-line max-len -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->\n <ul\n :id=\"listId\"\n ref=\"listWrapper\"\n :class=\"listClasses\"\n data-qa=\"dt-dropdown-list-wrapper\"\n @mouseleave=\"clearHighlightIndex\"\n @mousemove.capture=\"onMouseHighlight\"\n >\n <!-- @slot Slot for the list component -->\n <slot\n name=\"list\"\n :close=\"close\"\n />\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :tabindex=\"isArrowKeyNav ? -1 : 0\"\n @close=\"close\"\n />\n </ul>\n </template>\n <template #footerContent=\"{ close }\">\n <!-- @slot Slot for the footer content -->\n <slot\n name=\"footer\"\n :close=\"close\"\n />\n </template>\n </dt-popover>\n</template>\n\n<script>\nimport KeyboardNavigation from '@/common/mixins/keyboard_list_navigation';\nimport { DtPopover, POPOVER_APPEND_TO_VALUES } from '@/components/popover';\nimport { LIST_ITEM_NAVIGATION_TYPES } from '@/components/list_item';\nimport { DROPDOWN_PADDING_CLASSES } from './dropdown_constants';\nimport { getUniqueString } from '@/common/utils';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\nexport default {\n name: 'DtDropdown',\n\n components: {\n DtPopover,\n SrOnlyCloseButton,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n listItemRole: 'menuitem',\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n focusOnKeyboardNavigation: true,\n }),\n SrOnlyCloseButtonMixin,\n ],\n\n props: {\n /**\n * Controls whether the dropdown is shown. Leaving this null will have the dropdown trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the dropdown on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Vertical padding size around the list element.\n * @values none, small, large\n */\n padding: {\n type: String,\n default: 'small',\n validator: (padding) => {\n return Object.keys(DROPDOWN_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Determines modal state, dropdown has a modal overlay preventing interaction with elements\n * below it, but it is invisible.\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n */\n placement: {\n type: String,\n default: 'bottom',\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Additional class for the wrapper list element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Event fired when dropdown is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n ],\n\n data () {\n return {\n LIST_ITEM_NAVIGATION_TYPES,\n DROPDOWN_PADDING_CLASSES,\n EVENT_KEYNAMES,\n openedWithKeyboard: false,\n isOpen: null,\n };\n },\n\n computed: {\n dropdownListeners () {\n return {\n ...this.$listeners,\n\n opened: isPopoverOpen => {\n this.updateInitialHighlightIndex(isPopoverOpen);\n },\n\n keydown: event => {\n const eventCode = event.code;\n\n switch (eventCode) {\n case EVENT_KEYNAMES.up:\n case EVENT_KEYNAMES.arrowup:\n this.onUpKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.down:\n case EVENT_KEYNAMES.arrowdown:\n this.onDownKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.space:\n case EVENT_KEYNAMES.spacebar:\n this.onSpaceKey();\n break;\n case EVENT_KEYNAMES.enter:\n this.onEnterKey();\n break;\n case EVENT_KEYNAMES.home:\n this.onHomeKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n case EVENT_KEYNAMES.end:\n this.onEndKeyPress(event);\n event.stopPropagation();\n event.preventDefault();\n break;\n default:\n this.onKeyPress(event);\n break;\n }\n\n this.$emit('keydown', event);\n },\n };\n },\n\n beginningOfListMethod () {\n return this.onBeginningOfList || this.jumpToEnd;\n },\n\n endOfListMethod () {\n return this.onEndOfList || this.jumpToBeginning;\n },\n\n activeItemEl () {\n return this.getListElement().querySelector('#' + this.highlightId);\n },\n\n isArrowKeyNav () {\n return this.navigationType === this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS;\n },\n\n listClasses () {\n return [\n 'd-dropdown-list',\n DROPDOWN_PADDING_CLASSES[this.padding],\n this.listClass,\n { 'd-context-menu-list': this.openOnContext },\n ];\n },\n\n shouldOpenWithArrowKeys () {\n return !this.openOnContext;\n },\n },\n\n methods: {\n onMouseHighlight (e) {\n const liElement = e.target.closest('li');\n\n if (liElement && liElement.role && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n liElement.focus();\n }\n },\n\n getListElement () {\n return this.$refs.listWrapper;\n },\n\n clearHighlightIndex () {\n this.setHighlightIndex(-1);\n },\n\n afterHighlight () {\n if (this.visuallyHiddenClose && this.highlightIndex === this._itemsLength() - 1) {\n return;\n }\n\n this.$emit('highlight', this.highlightIndex);\n },\n\n updateInitialHighlightIndex (isPopoverOpen) {\n this.isOpen = isPopoverOpen;\n\n if (isPopoverOpen) {\n if (this.openedWithKeyboard && this.isArrowKeyNav) {\n this.setHighlightIndex(0);\n }\n this.$emit('opened', true);\n } else {\n this.clearHighlightIndex();\n this.openedWithKeyboard = false;\n this.$emit('opened', false);\n }\n },\n\n onSpaceKey () {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n },\n\n onEnterKey () {\n if (!this.open) {\n this.openedWithKeyboard = true;\n }\n },\n\n onUpKeyPress () {\n if (!this.isOpen) {\n this.openedWithKeyboard = true;\n return;\n }\n if (this.isArrowKeyNav) {\n return this.onUpKey();\n }\n },\n\n onDownKeyPress () {\n if (!this.isOpen) {\n this.openedWithKeyboard = true;\n return;\n }\n if (this.isArrowKeyNav) {\n return this.onDownKey();\n }\n },\n\n onHomeKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n return this.onHomeKey();\n },\n\n onEndKeyPress () {\n if (!this.isOpen || !this.isArrowKeyNav) {\n return;\n }\n\n return this.onEndKey();\n },\n\n onKeyPress (e) {\n if (!this.isOpen || !this.isArrowKeyNav || !this.isValidLetter(e.key)) {\n return;\n }\n\n e.stopPropagation();\n e.preventDefault();\n\n return this.onNavigationKey(e.key);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtPopover","SrOnlyCloseButton","KeyboardNavigation","SrOnlyCloseButtonMixin","padding","DROPDOWN_PADDING_CLASSES","item","getUniqueString","LIST_ITEM_NAVIGATION_TYPES","appendTo","POPOVER_APPEND_TO_VALUES","EVENT_KEYNAMES","isPopoverOpen","event","e","liElement"],"mappings":";;;;;;;;;;AAyEA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,WAAAC;AAAA,IACA,mBAAAC;AAAA,EACA;AAAA,EAEA,QAAA;AAAA,IACAC,EAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,gBAAA;AAAA,MACA,cAAA;AAAA,MACA,sBAAA;AAAA,MACA,uBAAA;AAAA,MACA,iBAAA;AAAA,MACA,eAAA;AAAA,MACA,2BAAA;AAAA,IACA,CAAA;AAAA,IACAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MACA,OAAA,KAAAC,CAAA,EAAA,KAAA,CAAAC,MAAAA,MAAAF,CAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,WAAA;AAAA,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IAEA;AAAA,IAEA,eAAA;AACA,UAAA,CAAA,KAAA,QAAA;AACA,aAAA,qBAAA;AACA;AAAA,MACA;AACA,UAAA,KAAA;AACA,eAAA,KAAA;IAEA;AAAA,IAEA,iBAAA;AACA,UAAA,CAAA,KAAA,QAAA;AACA,aAAA,qBAAA;AACA;AAAA,MACA;AACA,UAAA,KAAA;AACA,eAAA,KAAA;IAEA;AAAA,IAEA,iBAAA;AACA,UAAA,GAAA,KAAA,UAAA,CAAA,KAAA;AAIA,eAAA,KAAA;IACA;AAAA,IAEA,gBAAA;AACA,UAAA,GAAA,KAAA,UAAA,CAAA,KAAA;AAIA,eAAA,KAAA;IACA;AAAA,IAEA,WAAAE,GAAA;AACA,UAAA,GAAA,KAAA,UAAA,CAAA,KAAA,iBAAA,CAAA,KAAA,cAAAA,EAAA,GAAA;AAIA,eAAAA,EAAA,gBAAA,GACAA,EAAA,eAAA,GAEA,KAAA,gBAAAA,EAAA,GAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./editor-constants.cjs"),o=require("@dialpad/dialtone-icons/vue2"),d=require("../../_plugin-vue2_normalizer-yXi3ZRRD.cjs"),h=require("../rich-text-editor/rich-text-editor.cjs"),p=require("../button/button.cjs"),f=require("../popover/popover.cjs"),k=require("../stack/stack.cjs"),g=require("../input/input.cjs"),B=require("../tooltip/tooltip.cjs"),a=require("../rich-text-editor/rich-text-editor-constants.cjs"),I={name:"DtRecipeEditor",components:{DtRichTextEditor:h.default,DtButton:p.default,DtPopover:f.default,DtStack:k.default,DtInput:g.default,DtTooltip:B.default,DtIconQuickReply:o.DtIconQuickReply,DtIconBold:o.DtIconBold,DtIconItalic:o.DtIconItalic,DtIconUnderline:o.DtIconUnderline,DtIconStrikethrough:o.DtIconStrikethrough,DtIconListBullet:o.DtIconListBullet,DtIconListOrdered:o.DtIconListOrdered,DtIconAlignLeft:o.DtIconAlignLeft,DtIconAlignCenter:o.DtIconAlignCenter,DtIconAlignRight:o.DtIconAlignRight,DtIconAlignJustify:o.DtIconAlignJustify,DtIconQuote:o.DtIconQuote,DtIconCodeBlock:o.DtIconCodeBlock,DtIconLink2:o.DtIconLink2,DtIconImage:o.DtIconImage},inheritAttrs:!1,props:{value:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e=="string"?a.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},placeholder:{type:String,default:""},maxHeight:{type:String,default:"unset"},confirmSetLinkButton:{type:Object,default:()=>({label:"Confirm",ariaLabel:"Confirm set link"})},removeLinkButton:{type:Object,default:()=>({label:"Remove",ariaLabel:"Remove link"})},cancelSetLinkButton:{type:Object,default:()=>({label:"Cancel",ariaLabel:"Cancel set link"})},setLinkPlaceholder:{type:String,default:""},showBoldButton:{type:Boolean,default:!0},showItalicsButton:{type:Boolean,default:!0},showUnderlineButton:{type:Boolean,default:!0},showStrikeButton:{type:Boolean,default:!0},showListItemsButton:{type:Boolean,default:!0},showOrderedListButton:{type:Boolean,default:!0},showAlignLeftButton:{type:Boolean,default:!0},showAlignCenterButton:{type:Boolean,default:!0},showAlignRightButton:{type:Boolean,default:!0},showAlignJustifyButton:{type:Boolean,default:!0},showQuoteButton:{type:Boolean,default:!0},showCodeBlockButton:{type:Boolean,default:!0},showQuickRepliesButton:{type:Boolean,default:!0},showInlineImageButton:{type:Boolean,default:!1},showAddLink:{type:Object,default:()=>({showAddLinkButton:!0,setLinkTitle:"Add a link",setLinkInputAriaLabel:"Input field to add link"})},useDivTags:{type:Boolean,default:!1}},emits:["focus","blur","input","quick-replies-click","inline-image-click","text-input"],data(){return{internalInputValue:this.value,hasFocus:!1,linkOptions:{class:"d-recipe-editor__link"},showLinkInput:!1,linkInput:"",currentButtonRefIndex:0}},computed:{inputLength(){return this.internalInputValue.length},htmlOutputFormat(){return a.RICH_TEXT_EDITOR_OUTPUT_FORMATS[2]},showingTextFormatButtons(){return this.showBoldButton||this.showItalicsButton||this.showStrikeButton||this.showUnderlineButton},showingAlignmentButtons(){return this.showAlignLeftButton||this.showAlignCenterButton||this.showAlignRightButton||this.showAlignJustifyButton},showingListButtons(){return this.showListItemsButton||this.showOrderedListButton},orderedRefs(){const e=this.buttonGroups.reduce((function(t,i){return i.buttonGroup.forEach(n=>{t.push(this.getButtonRef(i.key,n.selector))},this),t}).bind(this),[]);return e.push(this.getButtonRef("custom","link")),e},buttonGroups(){const e=this.individualButtons.map(t=>({key:t.selector,buttonGroup:[t]}));return[{key:"new",buttonGroup:this.newButtons},{key:"format",buttonGroup:this.textFormatButtons},{key:"alignment",buttonGroup:this.alignmentButtons},{key:"list",buttonGroup:this.listButtons},...e].filter(t=>t.buttonGroup.length>0)},newButtons(){return[{showBtn:this.showQuickRepliesButton,label:"Quick reply",selector:"quickReplies",icon:o.DtIconQuickReply,dataQA:"dt-recipe-editor-quick-replies-btn",tooltipMessage:"Quick Reply",onClick:this.onQuickRepliesClick}].filter(e=>e.showBtn)},textFormatButtons(){return[{showBtn:this.showBoldButton,selector:"bold",icon:o.DtIconBold,dataQA:"dt-recipe-editor-bold-btn",tooltipMessage:"Bold",onClick:this.onBoldTextToggle},{showBtn:this.showItalicsButton,selector:"italic",icon:o.DtIconItalic,dataQA:"dt-recipe-editor-italics-btn",tooltipMessage:"Italics",onClick:this.onItalicTextToggle},{showBtn:this.showUnderlineButton,selector:"underline",icon:o.DtIconUnderline,dataQA:"dt-recipe-editor-underline-btn",tooltipMessage:"Underline",onClick:this.onUnderlineTextToggle},{showBtn:this.showStrikeButton,selector:"strike",icon:o.DtIconStrikethrough,dataQA:"dt-recipe-editor-strike-btn",tooltipMessage:"Strike",onClick:this.onStrikethroughTextToggle}].filter(e=>e.showBtn)},alignmentButtons(){return[{showBtn:this.showAlignLeftButton,selector:{textAlign:"left"},icon:o.DtIconAlignLeft,dataQA:"dt-recipe-editor-align-left-btn",tooltipMessage:"Align Left",onClick:()=>this.onTextAlign("left")},{showBtn:this.showAlignCenterButton,selector:{textAlign:"center"},icon:o.DtIconAlignCenter,dataQA:"dt-recipe-editor-align-center-btn",tooltipMessage:"Align Center",onClick:()=>this.onTextAlign("center")},{showBtn:this.showAlignRightButton,selector:{textAlign:"right"},icon:o.DtIconAlignRight,dataQA:"dt-recipe-editor-align-right-btn",tooltipMessage:"Align Right",onClick:()=>this.onTextAlign("right")},{showBtn:this.showAlignJustifyButton,selector:{textAlign:"justify"},icon:o.DtIconAlignJustify,dataQA:"dt-recipe-editor-align-justify-btn",tooltipMessage:"Align Justify",onClick:()=>this.onTextAlign("justify")}].filter(e=>e.showBtn)},listButtons(){return[{showBtn:this.showListItemsButton,selector:"bulletList",icon:o.DtIconListBullet,dataQA:"dt-recipe-editor-list-items-btn",tooltipMessage:"Bullet List",onClick:this.onBulletListToggle},{showBtn:this.showOrderedListButton,selector:"orderedList",icon:o.DtIconListOrdered,dataQA:"dt-recipe-editor-ordered-list-items-btn",tooltipMessage:"Ordered List",onClick:this.onOrderedListToggle}].filter(e=>e.showBtn)},individualButtons(){return[{showBtn:this.showQuoteButton,selector:"blockquote",icon:o.DtIconQuote,dataQA:"dt-recipe-editor-blockquote-btn",tooltipMessage:"Quote",onClick:this.onBlockquoteToggle},{showBtn:this.showCodeBlockButton,selector:"codeBlock",icon:o.DtIconCodeBlock,dataQA:"dt-recipe-editor-code-block-btn",tooltipMessage:"Code",onClick:this.onCodeBlockToggle},{showBtn:this.showInlineImageButton,selector:"image",icon:o.DtIconImage,dataQA:"dt-recipe-editor-inline-image-btn",tooltipMessage:"Image",onClick:this.onInsertInlineImageClick}].filter(e=>e.showBtn)},linkButton(){return{showBtn:this.showAddLink.showAddLinkButton,selector:"link",icon:o.DtIconLink2,dataQA:"dt-recipe-editor-add-link-btn",tooltipMessage:"Link",onClick:this.openLinkInput}}},watch:{value(e){this.internalInputValue=e}},methods:{onInputFocus(e){e==null||e.stopPropagation()},removeLink(){var e,t,i,n,r;(r=(n=(i=(t=(e=this.$refs.richTextEditor)==null?void 0:e.editor)==null?void 0:t.chain())==null?void 0:i.focus())==null?void 0:n.unsetLink())==null||r.run(),this.closeLinkInput()},setLink(e){var r,s,u;const t=(r=this.$refs.richTextEditor)==null?void 0:r.editor;if(e==null||e.preventDefault(),e==null||e.stopPropagation(),!this.linkInput){this.removeLink();return}c.EDITOR_SUPPORTED_LINK_PROTOCOLS.find(l=>l.test(this.linkInput))||(this.linkInput=`${c.EDITOR_DEFAULT_LINK_PREFIX}${this.linkInput}`);const n=(u=(s=t==null?void 0:t.view)==null?void 0:s.state)==null?void 0:u.selection;n.anchor===n.head?t.chain().focus().insertContentAt(n.anchor,`<a class="${this.linkOptions.class}" href=${this.linkInput}>${this.linkInput}</a>`).run():t.chain().focus().extendMarkRange("link").setLink({href:this.linkInput,class:this.linkOptions.class}).run(),this.closeLinkInput()},openLinkInput(){this.showLinkInput=!0},updateInput(e){var t,i,n;if(!e)return this.closeLinkInput();this.linkInput=(n=(i=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:i.getAttributes("link"))==null?void 0:n.href},closeLinkInput(){var e;this.showLinkInput=!1,this.linkInput="",(e=this.$refs.richTextEditor.editor)==null||e.chain().focus()},onBoldTextToggle(){var e,t;(t=(e=this.$refs.richTextEditor)==null?void 0:e.editor)==null||t.chain().focus().toggleBold().run()},onItalicTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleItalic().run()},onUnderlineTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleUnderline().run()},onStrikethroughTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleStrike().run()},onTextAlign(e){var t,i,n,r;if((i=(t=this.$refs.richTextEditor)==null?void 0:t.editor)!=null&&i.isActive({textAlign:e}))return(n=this.$refs.richTextEditor)==null?void 0:n.editor.chain().focus().unsetTextAlign().run();(r=this.$refs.richTextEditor)==null||r.editor.chain().focus().setTextAlign(e).run()},onBulletListToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleBulletList().run()},onOrderedListToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleOrderedList().run()},onCodeBlockToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleCodeBlock().run()},onQuickRepliesClick(){this.$emit("quick-replies-click")},onInsertInlineImageClick(){this.$emit("inline-image-click")},insertInlineImage(e){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().setImage({src:e}).run()},onBlockquoteToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleBlockquote().run()},insertInMessageBody(e){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().insertContent(e).run()},setCursorPosition(e=null){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus(e).run()},onTextInput(e){this.$emit("text-input",e)},onFocus(e){this.hasFocus=!0,this.$emit("focus",e)},onBlur(e){this.hasFocus=!1,this.$emit("blur",e)},onInput(e){this.$emit("input",e)},getButtonKey(e,t){return`${e}-${JSON.stringify(t)}`},getButtonRef(e,t){return`${this.getButtonKey(e,t)}-ref`},canFocus(e){return e===this.orderedRefs[this.currentButtonRefIndex]},shiftActionBarFocusRight(){this.shiftButtonRefIndex(1)},shiftActionBarFocusLeft(){this.shiftButtonRefIndex(-1)},shiftButtonRefIndex(e){const t=this.$refs[this.orderedRefs[this.currentButtonRefIndex]],i=Array.isArray(t)?t[0]:t,n=(this.currentButtonRefIndex+e)%this.orderedRefs.length;this.currentButtonRefIndex=n>=0?n:this.orderedRefs.length+n;const r=this.$refs[this.orderedRefs[this.currentButtonRefIndex]],s=Array.isArray(r)?r[0]:r;i.$el.blur(),s.$el.focus()}}};var y=function(){var t=this,i=t._self._c;return i("div",{staticClass:"d-recipe-editor",attrs:{"data-qa":"dt-recipe-editor",role:"presentation"},on:{click:function(n){return t.$refs.richTextEditor.focusEditor()}}},[i("dt-stack",{staticClass:"d-recipe-editor__top-bar",attrs:{direction:"row",gap:"450"}},[t._l(t.buttonGroups,function(n){return i("dt-stack",{key:n.key,attrs:{direction:"row",gap:"300"}},[t._l(n.buttonGroup,function(r){return i("dt-tooltip",{key:t.getButtonKey(n.key,r.selector),attrs:{message:r.tooltipMessage,placement:"top"},scopedSlots:t._u([{key:"anchor",fn:function(){var s,u;return[i("dt-button",{ref:t.getButtonRef(n.key,r.selector),refInFor:!0,attrs:{active:(u=(s=t.$refs.richTextEditor)==null?void 0:s.editor)==null?void 0:u.isActive(r.selector),"aria-label":r.tooltipMessage,"data-qa":r.dataQA,tabindex:t.canFocus(t.getButtonRef(n.key,r.selector))?0:-1,importance:"clear",kind:"muted",size:"xs"},on:{click:function(l){return r.onClick()},keydown:[function(l){return!l.type.indexOf("key")&&t._k(l.keyCode,"right",39,l.key,["Right","ArrowRight"])||"button"in l&&l.button!==2?null:(l.stopPropagation(),t.shiftActionBarFocusRight.apply(null,arguments))},function(l){return!l.type.indexOf("key")&&t._k(l.keyCode,"left",37,l.key,["Left","ArrowLeft"])||"button"in l&&l.button!==0?null:(l.stopPropagation(),t.shiftActionBarFocusLeft.apply(null,arguments))}]},scopedSlots:t._u([{key:"icon",fn:function(){return[i(r.icon,{tag:"component",attrs:{size:"200"}})]},proxy:!0}],null,!0)},[r.label?i("span",[t._v(t._s(r.label))]):t._e()])]},proxy:!0}],null,!0)})}),i("div",{staticClass:"d-recipe-editor__button-group-divider"})],2)}),t.linkButton.showBtn?i("dt-stack",{attrs:{direction:"row",gap:"300"}},[i("dt-popover",{attrs:{open:t.showLinkInput,"show-close-button":!1,"visually-hidden-close":!0,"visually-hidden-close-label":"Close link input popover","data-qa":"dt-recipe-editor-link-input-popover",padding:"none",placement:"bottom-start"},on:{"update:open":function(n){t.showLinkInput=n},click:t.onInputFocus,opened:t.updateInput},nativeOn:{click:function(n){return n.stopPropagation(),t.onInputFocus.apply(null,arguments)}},scopedSlots:t._u([{key:"anchor",fn:function(){return[i("dt-tooltip",{key:t.linkButton.key,attrs:{message:t.linkButton.tooltipMessage,placement:"top"},scopedSlots:t._u([{key:"anchor",fn:function(){var n,r;return[i("dt-button",{ref:t.getButtonRef("custom","link"),attrs:{active:(r=(n=t.$refs.richTextEditor)==null?void 0:n.editor)==null?void 0:r.isActive(t.linkButton.selector),"aria-label":t.linkButton.tooltipMessage,"data-qa":t.linkButton.dataQA,tabindex:t.canFocus(t.getButtonRef("custom","link"))?0:-1,importance:"clear",kind:"muted",size:"xs"},on:{click:function(s){return t.linkButton.onClick()},keydown:[function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"right",39,s.key,["Right","ArrowRight"])||"button"in s&&s.button!==2?null:(s.stopPropagation(),t.shiftActionBarFocusRight.apply(null,arguments))},function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"left",37,s.key,["Left","ArrowLeft"])||"button"in s&&s.button!==0?null:(s.stopPropagation(),t.shiftActionBarFocusLeft.apply(null,arguments))}]},scopedSlots:t._u([{key:"icon",fn:function(){return[i(t.linkButton.icon,{tag:"component",attrs:{size:"200"}})]},proxy:!0}],null,!1,3601441856)})]},proxy:!0}],null,!1,1067010212)})]},proxy:!0},{key:"content",fn:function(){return[i("div",{staticClass:"d-recipe-editor__popover-content"},[t.showAddLink.setLinkTitle.length>0?i("span",[t._v(" "+t._s(t.showAddLink.setLinkTitle)+" ")]):t._e(),i("dt-input",{attrs:{"input-aria-label":t.showAddLink.setLinkInputAriaLabel,placeholder:t.setLinkPlaceholder,"data-qa":"dt-recipe-editor-link-input","input-wrapper-class":"d-recipe-editor-link__input-wrapper"},on:{click:t.onInputFocus,focus:t.onInputFocus,keydown:function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"enter",13,n.key,"Enter")?null:t.setLink.apply(null,arguments)}},nativeOn:{click:function(n){return n.stopPropagation(),t.onInputFocus.apply(null,arguments)}},model:{value:t.linkInput,callback:function(n){t.linkInput=n},expression:"linkInput"}})],1)]},proxy:!0},{key:"footerContent",fn:function(){return[i("dt-stack",{staticClass:"d-recipe-editor__popover-footer",attrs:{direction:"row",gap:"300"}},[i("dt-button",{attrs:{"aria-label":t.removeLinkButton.ariaLabel,"data-qa":"dt-recipe-editor-remove-link-btn",importance:"clear",kind:"muted",size:"sm"},on:{click:t.removeLink}},[t._v(" "+t._s(t.removeLinkButton.label)+" ")]),i("dt-button",{attrs:{"aria-label":t.cancelSetLinkButton.ariaLabel,"data-qa":"dt-recipe-editor-set-link-cancel-btn",importance:"clear",kind:"muted",size:"sm"},on:{click:t.closeLinkInput}},[t._v(" "+t._s(t.cancelSetLinkButton.label)+" ")]),i("dt-button",{attrs:{"aria-label":t.confirmSetLinkButton.ariaLabel,"data-qa":"dt-recipe-editor-set-link-confirm-btn",size:"sm"},on:{click:t.setLink}},[t._v(" "+t._s(t.confirmSetLinkButton.label)+" ")])],1)]},proxy:!0}],null,!1,3688481372)})],1):t._e()],2),i("div",{staticClass:"d-recipe-editor__content",style:{"max-height":t.maxHeight}},[i("dt-rich-text-editor",t._b({ref:"richTextEditor",attrs:{"allow-font-color":!0,"allow-font-family":!0,"allow-inline-images":!0,"allow-line-breaks":!0,"hide-link-bubble-menu":!0,"auto-focus":t.autoFocus,editable:t.editable,"input-aria-label":t.inputAriaLabel,"input-class":`d-recipe-editor__content-input ${t.inputClass}`,link:!0,"output-format":t.htmlOutputFormat,placeholder:t.placeholder,"use-div-tags":t.useDivTags,"data-qa":"dt-rich-text-editor"},on:{"text-input":t.onTextInput,blur:t.onBlur,focus:t.onFocus,input:function(n){return t.onInput(n)}},model:{value:t.internalInputValue,callback:function(n){t.internalInputValue=n},expression:"internalInputValue"}},"dt-rich-text-editor",t.$attrs,!1))],1)],1)},m=[],b=d.n(I,y,m,!1,null,null);const L=b.exports;exports.default=L;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./editor-constants.cjs"),o=require("@dialpad/dialtone-icons/vue2"),d=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),h=require("../rich-text-editor/rich-text-editor.cjs"),p=require("../button/button.cjs"),f=require("../popover/popover.cjs"),k=require("../stack/stack.cjs"),g=require("../input/input.cjs"),B=require("../tooltip/tooltip.cjs"),a=require("../rich-text-editor/rich-text-editor-constants.cjs"),I={name:"DtRecipeEditor",components:{DtRichTextEditor:h.default,DtButton:p.default,DtPopover:f.default,DtStack:k.default,DtInput:g.default,DtTooltip:B.default,DtIconQuickReply:o.DtIconQuickReply,DtIconBold:o.DtIconBold,DtIconItalic:o.DtIconItalic,DtIconUnderline:o.DtIconUnderline,DtIconStrikethrough:o.DtIconStrikethrough,DtIconListBullet:o.DtIconListBullet,DtIconListOrdered:o.DtIconListOrdered,DtIconAlignLeft:o.DtIconAlignLeft,DtIconAlignCenter:o.DtIconAlignCenter,DtIconAlignRight:o.DtIconAlignRight,DtIconAlignJustify:o.DtIconAlignJustify,DtIconQuote:o.DtIconQuote,DtIconCodeBlock:o.DtIconCodeBlock,DtIconLink2:o.DtIconLink2,DtIconImage:o.DtIconImage},inheritAttrs:!1,props:{value:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e=="string"?a.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},placeholder:{type:String,default:""},maxHeight:{type:String,default:"unset"},confirmSetLinkButton:{type:Object,default:()=>({label:"Confirm",ariaLabel:"Confirm set link"})},removeLinkButton:{type:Object,default:()=>({label:"Remove",ariaLabel:"Remove link"})},cancelSetLinkButton:{type:Object,default:()=>({label:"Cancel",ariaLabel:"Cancel set link"})},setLinkPlaceholder:{type:String,default:""},showBoldButton:{type:Boolean,default:!0},showItalicsButton:{type:Boolean,default:!0},showUnderlineButton:{type:Boolean,default:!0},showStrikeButton:{type:Boolean,default:!0},showListItemsButton:{type:Boolean,default:!0},showOrderedListButton:{type:Boolean,default:!0},showAlignLeftButton:{type:Boolean,default:!0},showAlignCenterButton:{type:Boolean,default:!0},showAlignRightButton:{type:Boolean,default:!0},showAlignJustifyButton:{type:Boolean,default:!0},showQuoteButton:{type:Boolean,default:!0},showCodeBlockButton:{type:Boolean,default:!0},showQuickRepliesButton:{type:Boolean,default:!0},showInlineImageButton:{type:Boolean,default:!1},showAddLink:{type:Object,default:()=>({showAddLinkButton:!0,setLinkTitle:"Add a link",setLinkInputAriaLabel:"Input field to add link"})},useDivTags:{type:Boolean,default:!1}},emits:["focus","blur","input","quick-replies-click","inline-image-click","text-input"],data(){return{internalInputValue:this.value,hasFocus:!1,linkOptions:{class:"d-recipe-editor__link"},showLinkInput:!1,linkInput:"",currentButtonRefIndex:0}},computed:{inputLength(){return this.internalInputValue.length},htmlOutputFormat(){return a.RICH_TEXT_EDITOR_OUTPUT_FORMATS[2]},showingTextFormatButtons(){return this.showBoldButton||this.showItalicsButton||this.showStrikeButton||this.showUnderlineButton},showingAlignmentButtons(){return this.showAlignLeftButton||this.showAlignCenterButton||this.showAlignRightButton||this.showAlignJustifyButton},showingListButtons(){return this.showListItemsButton||this.showOrderedListButton},orderedRefs(){const e=this.buttonGroups.reduce((function(t,i){return i.buttonGroup.forEach(n=>{t.push(this.getButtonRef(i.key,n.selector))},this),t}).bind(this),[]);return e.push(this.getButtonRef("custom","link")),e},buttonGroups(){const e=this.individualButtons.map(t=>({key:t.selector,buttonGroup:[t]}));return[{key:"new",buttonGroup:this.newButtons},{key:"format",buttonGroup:this.textFormatButtons},{key:"alignment",buttonGroup:this.alignmentButtons},{key:"list",buttonGroup:this.listButtons},...e].filter(t=>t.buttonGroup.length>0)},newButtons(){return[{showBtn:this.showQuickRepliesButton,label:"Quick reply",selector:"quickReplies",icon:o.DtIconQuickReply,dataQA:"dt-recipe-editor-quick-replies-btn",tooltipMessage:"Quick Reply",onClick:this.onQuickRepliesClick}].filter(e=>e.showBtn)},textFormatButtons(){return[{showBtn:this.showBoldButton,selector:"bold",icon:o.DtIconBold,dataQA:"dt-recipe-editor-bold-btn",tooltipMessage:"Bold",onClick:this.onBoldTextToggle},{showBtn:this.showItalicsButton,selector:"italic",icon:o.DtIconItalic,dataQA:"dt-recipe-editor-italics-btn",tooltipMessage:"Italics",onClick:this.onItalicTextToggle},{showBtn:this.showUnderlineButton,selector:"underline",icon:o.DtIconUnderline,dataQA:"dt-recipe-editor-underline-btn",tooltipMessage:"Underline",onClick:this.onUnderlineTextToggle},{showBtn:this.showStrikeButton,selector:"strike",icon:o.DtIconStrikethrough,dataQA:"dt-recipe-editor-strike-btn",tooltipMessage:"Strike",onClick:this.onStrikethroughTextToggle}].filter(e=>e.showBtn)},alignmentButtons(){return[{showBtn:this.showAlignLeftButton,selector:{textAlign:"left"},icon:o.DtIconAlignLeft,dataQA:"dt-recipe-editor-align-left-btn",tooltipMessage:"Align Left",onClick:()=>this.onTextAlign("left")},{showBtn:this.showAlignCenterButton,selector:{textAlign:"center"},icon:o.DtIconAlignCenter,dataQA:"dt-recipe-editor-align-center-btn",tooltipMessage:"Align Center",onClick:()=>this.onTextAlign("center")},{showBtn:this.showAlignRightButton,selector:{textAlign:"right"},icon:o.DtIconAlignRight,dataQA:"dt-recipe-editor-align-right-btn",tooltipMessage:"Align Right",onClick:()=>this.onTextAlign("right")},{showBtn:this.showAlignJustifyButton,selector:{textAlign:"justify"},icon:o.DtIconAlignJustify,dataQA:"dt-recipe-editor-align-justify-btn",tooltipMessage:"Align Justify",onClick:()=>this.onTextAlign("justify")}].filter(e=>e.showBtn)},listButtons(){return[{showBtn:this.showListItemsButton,selector:"bulletList",icon:o.DtIconListBullet,dataQA:"dt-recipe-editor-list-items-btn",tooltipMessage:"Bullet List",onClick:this.onBulletListToggle},{showBtn:this.showOrderedListButton,selector:"orderedList",icon:o.DtIconListOrdered,dataQA:"dt-recipe-editor-ordered-list-items-btn",tooltipMessage:"Ordered List",onClick:this.onOrderedListToggle}].filter(e=>e.showBtn)},individualButtons(){return[{showBtn:this.showQuoteButton,selector:"blockquote",icon:o.DtIconQuote,dataQA:"dt-recipe-editor-blockquote-btn",tooltipMessage:"Quote",onClick:this.onBlockquoteToggle},{showBtn:this.showCodeBlockButton,selector:"codeBlock",icon:o.DtIconCodeBlock,dataQA:"dt-recipe-editor-code-block-btn",tooltipMessage:"Code",onClick:this.onCodeBlockToggle},{showBtn:this.showInlineImageButton,selector:"image",icon:o.DtIconImage,dataQA:"dt-recipe-editor-inline-image-btn",tooltipMessage:"Image",onClick:this.onInsertInlineImageClick}].filter(e=>e.showBtn)},linkButton(){return{showBtn:this.showAddLink.showAddLinkButton,selector:"link",icon:o.DtIconLink2,dataQA:"dt-recipe-editor-add-link-btn",tooltipMessage:"Link",onClick:this.openLinkInput}}},watch:{value(e){this.internalInputValue=e}},methods:{onInputFocus(e){e==null||e.stopPropagation()},removeLink(){var e,t,i,n,r;(r=(n=(i=(t=(e=this.$refs.richTextEditor)==null?void 0:e.editor)==null?void 0:t.chain())==null?void 0:i.focus())==null?void 0:n.unsetLink())==null||r.run(),this.closeLinkInput()},setLink(e){var r,s,u;const t=(r=this.$refs.richTextEditor)==null?void 0:r.editor;if(e==null||e.preventDefault(),e==null||e.stopPropagation(),!this.linkInput){this.removeLink();return}c.EDITOR_SUPPORTED_LINK_PROTOCOLS.find(l=>l.test(this.linkInput))||(this.linkInput=`${c.EDITOR_DEFAULT_LINK_PREFIX}${this.linkInput}`);const n=(u=(s=t==null?void 0:t.view)==null?void 0:s.state)==null?void 0:u.selection;n.anchor===n.head?t.chain().focus().insertContentAt(n.anchor,`<a class="${this.linkOptions.class}" href=${this.linkInput}>${this.linkInput}</a>`).run():t.chain().focus().extendMarkRange("link").setLink({href:this.linkInput,class:this.linkOptions.class}).run(),this.closeLinkInput()},openLinkInput(){this.showLinkInput=!0},updateInput(e){var t,i,n;if(!e)return this.closeLinkInput();this.linkInput=(n=(i=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:i.getAttributes("link"))==null?void 0:n.href},closeLinkInput(){var e;this.showLinkInput=!1,this.linkInput="",(e=this.$refs.richTextEditor.editor)==null||e.chain().focus()},onBoldTextToggle(){var e,t;(t=(e=this.$refs.richTextEditor)==null?void 0:e.editor)==null||t.chain().focus().toggleBold().run()},onItalicTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleItalic().run()},onUnderlineTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleUnderline().run()},onStrikethroughTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleStrike().run()},onTextAlign(e){var t,i,n,r;if((i=(t=this.$refs.richTextEditor)==null?void 0:t.editor)!=null&&i.isActive({textAlign:e}))return(n=this.$refs.richTextEditor)==null?void 0:n.editor.chain().focus().unsetTextAlign().run();(r=this.$refs.richTextEditor)==null||r.editor.chain().focus().setTextAlign(e).run()},onBulletListToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleBulletList().run()},onOrderedListToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleOrderedList().run()},onCodeBlockToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleCodeBlock().run()},onQuickRepliesClick(){this.$emit("quick-replies-click")},onInsertInlineImageClick(){this.$emit("inline-image-click")},insertInlineImage(e){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().setImage({src:e}).run()},onBlockquoteToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleBlockquote().run()},insertInMessageBody(e){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().insertContent(e).run()},setCursorPosition(e=null){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus(e).run()},onTextInput(e){this.$emit("text-input",e)},onFocus(e){this.hasFocus=!0,this.$emit("focus",e)},onBlur(e){this.hasFocus=!1,this.$emit("blur",e)},onInput(e){this.$emit("input",e)},getButtonKey(e,t){return`${e}-${JSON.stringify(t)}`},getButtonRef(e,t){return`${this.getButtonKey(e,t)}-ref`},canFocus(e){return e===this.orderedRefs[this.currentButtonRefIndex]},shiftActionBarFocusRight(){this.shiftButtonRefIndex(1)},shiftActionBarFocusLeft(){this.shiftButtonRefIndex(-1)},shiftButtonRefIndex(e){const t=this.$refs[this.orderedRefs[this.currentButtonRefIndex]],i=Array.isArray(t)?t[0]:t,n=(this.currentButtonRefIndex+e)%this.orderedRefs.length;this.currentButtonRefIndex=n>=0?n:this.orderedRefs.length+n;const r=this.$refs[this.orderedRefs[this.currentButtonRefIndex]],s=Array.isArray(r)?r[0]:r;i.$el.blur(),s.$el.focus()}}};var y=function(){var t=this,i=t._self._c;return i("div",{staticClass:"d-recipe-editor",attrs:{"data-qa":"dt-recipe-editor",role:"presentation"},on:{click:function(n){return t.$refs.richTextEditor.focusEditor()}}},[i("dt-stack",{staticClass:"d-recipe-editor__top-bar",attrs:{direction:"row",gap:"450"}},[t._l(t.buttonGroups,function(n){return i("dt-stack",{key:n.key,attrs:{direction:"row",gap:"300"}},[t._l(n.buttonGroup,function(r){return i("dt-tooltip",{key:t.getButtonKey(n.key,r.selector),attrs:{message:r.tooltipMessage,placement:"top"},scopedSlots:t._u([{key:"anchor",fn:function(){var s,u;return[i("dt-button",{ref:t.getButtonRef(n.key,r.selector),refInFor:!0,attrs:{active:(u=(s=t.$refs.richTextEditor)==null?void 0:s.editor)==null?void 0:u.isActive(r.selector),"aria-label":r.tooltipMessage,"data-qa":r.dataQA,tabindex:t.canFocus(t.getButtonRef(n.key,r.selector))?0:-1,importance:"clear",kind:"muted",size:"xs"},on:{click:function(l){return r.onClick()},keydown:[function(l){return!l.type.indexOf("key")&&t._k(l.keyCode,"right",39,l.key,["Right","ArrowRight"])||"button"in l&&l.button!==2?null:(l.stopPropagation(),t.shiftActionBarFocusRight.apply(null,arguments))},function(l){return!l.type.indexOf("key")&&t._k(l.keyCode,"left",37,l.key,["Left","ArrowLeft"])||"button"in l&&l.button!==0?null:(l.stopPropagation(),t.shiftActionBarFocusLeft.apply(null,arguments))}]},scopedSlots:t._u([{key:"icon",fn:function(){return[i(r.icon,{tag:"component",attrs:{size:"200"}})]},proxy:!0}],null,!0)},[r.label?i("span",[t._v(t._s(r.label))]):t._e()])]},proxy:!0}],null,!0)})}),i("div",{staticClass:"d-recipe-editor__button-group-divider"})],2)}),t.linkButton.showBtn?i("dt-stack",{attrs:{direction:"row",gap:"300"}},[i("dt-popover",{attrs:{open:t.showLinkInput,"show-close-button":!1,"visually-hidden-close":!0,"visually-hidden-close-label":"Close link input popover","data-qa":"dt-recipe-editor-link-input-popover",padding:"none",placement:"bottom-start"},on:{"update:open":function(n){t.showLinkInput=n},click:t.onInputFocus,opened:t.updateInput},nativeOn:{click:function(n){return n.stopPropagation(),t.onInputFocus.apply(null,arguments)}},scopedSlots:t._u([{key:"anchor",fn:function(){return[i("dt-tooltip",{key:t.linkButton.key,attrs:{message:t.linkButton.tooltipMessage,placement:"top"},scopedSlots:t._u([{key:"anchor",fn:function(){var n,r;return[i("dt-button",{ref:t.getButtonRef("custom","link"),attrs:{active:(r=(n=t.$refs.richTextEditor)==null?void 0:n.editor)==null?void 0:r.isActive(t.linkButton.selector),"aria-label":t.linkButton.tooltipMessage,"data-qa":t.linkButton.dataQA,tabindex:t.canFocus(t.getButtonRef("custom","link"))?0:-1,importance:"clear",kind:"muted",size:"xs"},on:{click:function(s){return t.linkButton.onClick()},keydown:[function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"right",39,s.key,["Right","ArrowRight"])||"button"in s&&s.button!==2?null:(s.stopPropagation(),t.shiftActionBarFocusRight.apply(null,arguments))},function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"left",37,s.key,["Left","ArrowLeft"])||"button"in s&&s.button!==0?null:(s.stopPropagation(),t.shiftActionBarFocusLeft.apply(null,arguments))}]},scopedSlots:t._u([{key:"icon",fn:function(){return[i(t.linkButton.icon,{tag:"component",attrs:{size:"200"}})]},proxy:!0}],null,!1,3601441856)})]},proxy:!0}],null,!1,1067010212)})]},proxy:!0},{key:"content",fn:function(){return[i("div",{staticClass:"d-recipe-editor__popover-content"},[t.showAddLink.setLinkTitle.length>0?i("span",[t._v(" "+t._s(t.showAddLink.setLinkTitle)+" ")]):t._e(),i("dt-input",{attrs:{"input-aria-label":t.showAddLink.setLinkInputAriaLabel,placeholder:t.setLinkPlaceholder,"data-qa":"dt-recipe-editor-link-input","input-wrapper-class":"d-recipe-editor-link__input-wrapper"},on:{click:t.onInputFocus,focus:t.onInputFocus,keydown:function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"enter",13,n.key,"Enter")?null:t.setLink.apply(null,arguments)}},nativeOn:{click:function(n){return n.stopPropagation(),t.onInputFocus.apply(null,arguments)}},model:{value:t.linkInput,callback:function(n){t.linkInput=n},expression:"linkInput"}})],1)]},proxy:!0},{key:"footerContent",fn:function(){return[i("dt-stack",{staticClass:"d-recipe-editor__popover-footer",attrs:{direction:"row",gap:"300"}},[i("dt-button",{attrs:{"aria-label":t.removeLinkButton.ariaLabel,"data-qa":"dt-recipe-editor-remove-link-btn",importance:"clear",kind:"muted",size:"sm"},on:{click:t.removeLink}},[t._v(" "+t._s(t.removeLinkButton.label)+" ")]),i("dt-button",{attrs:{"aria-label":t.cancelSetLinkButton.ariaLabel,"data-qa":"dt-recipe-editor-set-link-cancel-btn",importance:"clear",kind:"muted",size:"sm"},on:{click:t.closeLinkInput}},[t._v(" "+t._s(t.cancelSetLinkButton.label)+" ")]),i("dt-button",{attrs:{"aria-label":t.confirmSetLinkButton.ariaLabel,"data-qa":"dt-recipe-editor-set-link-confirm-btn",size:"sm"},on:{click:t.setLink}},[t._v(" "+t._s(t.confirmSetLinkButton.label)+" ")])],1)]},proxy:!0}],null,!1,3688481372)})],1):t._e()],2),i("div",{staticClass:"d-recipe-editor__content",style:{"max-height":t.maxHeight}},[i("dt-rich-text-editor",t._b({ref:"richTextEditor",attrs:{"allow-font-color":!0,"allow-font-family":!0,"allow-inline-images":!0,"allow-line-breaks":!0,"hide-link-bubble-menu":!0,"auto-focus":t.autoFocus,editable:t.editable,"input-aria-label":t.inputAriaLabel,"input-class":`d-recipe-editor__content-input ${t.inputClass}`,link:!0,"output-format":t.htmlOutputFormat,placeholder:t.placeholder,"use-div-tags":t.useDivTags,"data-qa":"dt-rich-text-editor"},on:{"text-input":t.onTextInput,blur:t.onBlur,focus:t.onFocus,input:function(n){return t.onInput(n)}},model:{value:t.internalInputValue,callback:function(n){t.internalInputValue=n},expression:"internalInputValue"}},"dt-rich-text-editor",t.$attrs,!1))],1)],1)},m=[],b=d.n(I,y,m);const L=b.exports;exports.default=L;
|
|
2
2
|
//# sourceMappingURL=editor.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EDITOR_SUPPORTED_LINK_PROTOCOLS as x, EDITOR_DEFAULT_LINK_PREFIX as b } from "./editor-constants.js";
|
|
2
2
|
import { DtIconQuickReply as u, DtIconBold as a, DtIconItalic as c, DtIconUnderline as d, DtIconStrikethrough as h, DtIconListBullet as p, DtIconListOrdered as f, DtIconAlignLeft as k, DtIconAlignCenter as g, DtIconAlignRight as B, DtIconAlignJustify as m, DtIconQuote as y, DtIconCodeBlock as I, DtIconLink2 as w, DtIconImage as L } from "@dialpad/dialtone-icons/vue2";
|
|
3
|
-
import { n as A } from "../../_plugin-vue2_normalizer-
|
|
3
|
+
import { n as A } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
4
4
|
import T from "../rich-text-editor/rich-text-editor.js";
|
|
5
5
|
import _ from "../button/button.js";
|
|
6
6
|
import C from "../popover/popover.js";
|
|
@@ -310,9 +310,9 @@ const D = {
|
|
|
310
310
|
return this.showListItemsButton || this.showOrderedListButton;
|
|
311
311
|
},
|
|
312
312
|
orderedRefs() {
|
|
313
|
-
const e = this.buttonGroups.reduce((function(t,
|
|
314
|
-
return
|
|
315
|
-
t.push(this.getButtonRef(
|
|
313
|
+
const e = this.buttonGroups.reduce((function(t, n) {
|
|
314
|
+
return n.buttonGroup.forEach((i) => {
|
|
315
|
+
t.push(this.getButtonRef(n.key, i.selector));
|
|
316
316
|
}, this), t;
|
|
317
317
|
}).bind(this), []);
|
|
318
318
|
return e.push(this.getButtonRef("custom", "link")), e;
|
|
@@ -484,8 +484,8 @@ const D = {
|
|
|
484
484
|
e == null || e.stopPropagation();
|
|
485
485
|
},
|
|
486
486
|
removeLink() {
|
|
487
|
-
var e, t,
|
|
488
|
-
(o = (
|
|
487
|
+
var e, t, n, i, o;
|
|
488
|
+
(o = (i = (n = (t = (e = this.$refs.richTextEditor) == null ? void 0 : e.editor) == null ? void 0 : t.chain()) == null ? void 0 : n.focus()) == null ? void 0 : i.unsetLink()) == null || o.run(), this.closeLinkInput();
|
|
489
489
|
},
|
|
490
490
|
setLink(e) {
|
|
491
491
|
var o, r, l;
|
|
@@ -495,9 +495,9 @@ const D = {
|
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
497
|
x.find((s) => s.test(this.linkInput)) || (this.linkInput = `${b}${this.linkInput}`);
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
498
|
+
const i = (l = (r = t == null ? void 0 : t.view) == null ? void 0 : r.state) == null ? void 0 : l.selection;
|
|
499
|
+
i.anchor === i.head ? t.chain().focus().insertContentAt(
|
|
500
|
+
i.anchor,
|
|
501
501
|
`<a class="${this.linkOptions.class}" href=${this.linkInput}>${this.linkInput}</a>`
|
|
502
502
|
).run() : t.chain().focus().extendMarkRange("link").setLink({ href: this.linkInput, class: this.linkOptions.class }).run(), this.closeLinkInput();
|
|
503
503
|
},
|
|
@@ -505,10 +505,10 @@ const D = {
|
|
|
505
505
|
this.showLinkInput = !0;
|
|
506
506
|
},
|
|
507
507
|
updateInput(e) {
|
|
508
|
-
var t,
|
|
508
|
+
var t, n, i;
|
|
509
509
|
if (!e)
|
|
510
510
|
return this.closeLinkInput();
|
|
511
|
-
this.linkInput = (
|
|
511
|
+
this.linkInput = (i = (n = (t = this.$refs.richTextEditor) == null ? void 0 : t.editor) == null ? void 0 : n.getAttributes("link")) == null ? void 0 : i.href;
|
|
512
512
|
},
|
|
513
513
|
closeLinkInput() {
|
|
514
514
|
var e;
|
|
@@ -531,9 +531,9 @@ const D = {
|
|
|
531
531
|
(e = this.$refs.richTextEditor) == null || e.editor.chain().focus().toggleStrike().run();
|
|
532
532
|
},
|
|
533
533
|
onTextAlign(e) {
|
|
534
|
-
var t,
|
|
535
|
-
if ((
|
|
536
|
-
return (
|
|
534
|
+
var t, n, i, o;
|
|
535
|
+
if ((n = (t = this.$refs.richTextEditor) == null ? void 0 : t.editor) != null && n.isActive({ textAlign: e }))
|
|
536
|
+
return (i = this.$refs.richTextEditor) == null ? void 0 : i.editor.chain().focus().unsetTextAlign().run();
|
|
537
537
|
(o = this.$refs.richTextEditor) == null || o.editor.chain().focus().setTextAlign(e).run();
|
|
538
538
|
},
|
|
539
539
|
onBulletListToggle() {
|
|
@@ -603,71 +603,68 @@ const D = {
|
|
|
603
603
|
this.shiftButtonRefIndex(-1);
|
|
604
604
|
},
|
|
605
605
|
shiftButtonRefIndex(e) {
|
|
606
|
-
const t = this.$refs[this.orderedRefs[this.currentButtonRefIndex]],
|
|
607
|
-
this.currentButtonRefIndex =
|
|
606
|
+
const t = this.$refs[this.orderedRefs[this.currentButtonRefIndex]], n = Array.isArray(t) ? t[0] : t, i = (this.currentButtonRefIndex + e) % this.orderedRefs.length;
|
|
607
|
+
this.currentButtonRefIndex = i >= 0 ? i : this.orderedRefs.length + i;
|
|
608
608
|
const o = this.$refs[this.orderedRefs[this.currentButtonRefIndex]], r = Array.isArray(o) ? o[0] : o;
|
|
609
|
-
|
|
609
|
+
n.$el.blur(), r.$el.focus();
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
613
|
var Q = function() {
|
|
614
|
-
var t = this,
|
|
615
|
-
return
|
|
614
|
+
var t = this, n = t._self._c;
|
|
615
|
+
return n("div", { staticClass: "d-recipe-editor", attrs: { "data-qa": "dt-recipe-editor", role: "presentation" }, on: { click: function(i) {
|
|
616
616
|
return t.$refs.richTextEditor.focusEditor();
|
|
617
|
-
} } }, [
|
|
618
|
-
return
|
|
619
|
-
return
|
|
617
|
+
} } }, [n("dt-stack", { staticClass: "d-recipe-editor__top-bar", attrs: { direction: "row", gap: "450" } }, [t._l(t.buttonGroups, function(i) {
|
|
618
|
+
return n("dt-stack", { key: i.key, attrs: { direction: "row", gap: "300" } }, [t._l(i.buttonGroup, function(o) {
|
|
619
|
+
return n("dt-tooltip", { key: t.getButtonKey(i.key, o.selector), attrs: { message: o.tooltipMessage, placement: "top" }, scopedSlots: t._u([{ key: "anchor", fn: function() {
|
|
620
620
|
var r, l;
|
|
621
|
-
return [
|
|
621
|
+
return [n("dt-button", { ref: t.getButtonRef(i.key, o.selector), refInFor: !0, attrs: { active: (l = (r = t.$refs.richTextEditor) == null ? void 0 : r.editor) == null ? void 0 : l.isActive(o.selector), "aria-label": o.tooltipMessage, "data-qa": o.dataQA, tabindex: t.canFocus(t.getButtonRef(i.key, o.selector)) ? 0 : -1, importance: "clear", kind: "muted", size: "xs" }, on: { click: function(s) {
|
|
622
622
|
return o.onClick();
|
|
623
623
|
}, keydown: [function(s) {
|
|
624
624
|
return !s.type.indexOf("key") && t._k(s.keyCode, "right", 39, s.key, ["Right", "ArrowRight"]) || "button" in s && s.button !== 2 ? null : (s.stopPropagation(), t.shiftActionBarFocusRight.apply(null, arguments));
|
|
625
625
|
}, function(s) {
|
|
626
626
|
return !s.type.indexOf("key") && t._k(s.keyCode, "left", 37, s.key, ["Left", "ArrowLeft"]) || "button" in s && s.button !== 0 ? null : (s.stopPropagation(), t.shiftActionBarFocusLeft.apply(null, arguments));
|
|
627
627
|
}] }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
628
|
-
return [
|
|
629
|
-
}, proxy: !0 }], null, !0) }, [o.label ?
|
|
628
|
+
return [n(o.icon, { tag: "component", attrs: { size: "200" } })];
|
|
629
|
+
}, proxy: !0 }], null, !0) }, [o.label ? n("span", [t._v(t._s(o.label))]) : t._e()])];
|
|
630
630
|
}, proxy: !0 }], null, !0) });
|
|
631
|
-
}),
|
|
632
|
-
}), t.linkButton.showBtn ?
|
|
633
|
-
t.showLinkInput =
|
|
634
|
-
}, click: t.onInputFocus, opened: t.updateInput }, nativeOn: { click: function(
|
|
635
|
-
return
|
|
631
|
+
}), n("div", { staticClass: "d-recipe-editor__button-group-divider" })], 2);
|
|
632
|
+
}), t.linkButton.showBtn ? n("dt-stack", { attrs: { direction: "row", gap: "300" } }, [n("dt-popover", { attrs: { open: t.showLinkInput, "show-close-button": !1, "visually-hidden-close": !0, "visually-hidden-close-label": "Close link input popover", "data-qa": "dt-recipe-editor-link-input-popover", padding: "none", placement: "bottom-start" }, on: { "update:open": function(i) {
|
|
633
|
+
t.showLinkInput = i;
|
|
634
|
+
}, click: t.onInputFocus, opened: t.updateInput }, nativeOn: { click: function(i) {
|
|
635
|
+
return i.stopPropagation(), t.onInputFocus.apply(null, arguments);
|
|
636
636
|
} }, scopedSlots: t._u([{ key: "anchor", fn: function() {
|
|
637
|
-
return [
|
|
638
|
-
var
|
|
639
|
-
return [
|
|
637
|
+
return [n("dt-tooltip", { key: t.linkButton.key, attrs: { message: t.linkButton.tooltipMessage, placement: "top" }, scopedSlots: t._u([{ key: "anchor", fn: function() {
|
|
638
|
+
var i, o;
|
|
639
|
+
return [n("dt-button", { ref: t.getButtonRef("custom", "link"), attrs: { active: (o = (i = t.$refs.richTextEditor) == null ? void 0 : i.editor) == null ? void 0 : o.isActive(t.linkButton.selector), "aria-label": t.linkButton.tooltipMessage, "data-qa": t.linkButton.dataQA, tabindex: t.canFocus(t.getButtonRef("custom", "link")) ? 0 : -1, importance: "clear", kind: "muted", size: "xs" }, on: { click: function(r) {
|
|
640
640
|
return t.linkButton.onClick();
|
|
641
641
|
}, keydown: [function(r) {
|
|
642
642
|
return !r.type.indexOf("key") && t._k(r.keyCode, "right", 39, r.key, ["Right", "ArrowRight"]) || "button" in r && r.button !== 2 ? null : (r.stopPropagation(), t.shiftActionBarFocusRight.apply(null, arguments));
|
|
643
643
|
}, function(r) {
|
|
644
644
|
return !r.type.indexOf("key") && t._k(r.keyCode, "left", 37, r.key, ["Left", "ArrowLeft"]) || "button" in r && r.button !== 0 ? null : (r.stopPropagation(), t.shiftActionBarFocusLeft.apply(null, arguments));
|
|
645
645
|
}] }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
646
|
-
return [
|
|
646
|
+
return [n(t.linkButton.icon, { tag: "component", attrs: { size: "200" } })];
|
|
647
647
|
}, proxy: !0 }], null, !1, 3601441856) })];
|
|
648
648
|
}, proxy: !0 }], null, !1, 1067010212) })];
|
|
649
649
|
}, proxy: !0 }, { key: "content", fn: function() {
|
|
650
|
-
return [
|
|
651
|
-
return !
|
|
652
|
-
} }, nativeOn: { click: function(
|
|
653
|
-
return
|
|
654
|
-
} }, model: { value: t.linkInput, callback: function(
|
|
655
|
-
t.linkInput =
|
|
650
|
+
return [n("div", { staticClass: "d-recipe-editor__popover-content" }, [t.showAddLink.setLinkTitle.length > 0 ? n("span", [t._v(" " + t._s(t.showAddLink.setLinkTitle) + " ")]) : t._e(), n("dt-input", { attrs: { "input-aria-label": t.showAddLink.setLinkInputAriaLabel, placeholder: t.setLinkPlaceholder, "data-qa": "dt-recipe-editor-link-input", "input-wrapper-class": "d-recipe-editor-link__input-wrapper" }, on: { click: t.onInputFocus, focus: t.onInputFocus, keydown: function(i) {
|
|
651
|
+
return !i.type.indexOf("key") && t._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : t.setLink.apply(null, arguments);
|
|
652
|
+
} }, nativeOn: { click: function(i) {
|
|
653
|
+
return i.stopPropagation(), t.onInputFocus.apply(null, arguments);
|
|
654
|
+
} }, model: { value: t.linkInput, callback: function(i) {
|
|
655
|
+
t.linkInput = i;
|
|
656
656
|
}, expression: "linkInput" } })], 1)];
|
|
657
657
|
}, proxy: !0 }, { key: "footerContent", fn: function() {
|
|
658
|
-
return [
|
|
659
|
-
}, proxy: !0 }], null, !1, 3688481372) })], 1) : t._e()], 2),
|
|
660
|
-
return t.onInput(
|
|
661
|
-
} }, model: { value: t.internalInputValue, callback: function(
|
|
662
|
-
t.internalInputValue =
|
|
658
|
+
return [n("dt-stack", { staticClass: "d-recipe-editor__popover-footer", attrs: { direction: "row", gap: "300" } }, [n("dt-button", { attrs: { "aria-label": t.removeLinkButton.ariaLabel, "data-qa": "dt-recipe-editor-remove-link-btn", importance: "clear", kind: "muted", size: "sm" }, on: { click: t.removeLink } }, [t._v(" " + t._s(t.removeLinkButton.label) + " ")]), n("dt-button", { attrs: { "aria-label": t.cancelSetLinkButton.ariaLabel, "data-qa": "dt-recipe-editor-set-link-cancel-btn", importance: "clear", kind: "muted", size: "sm" }, on: { click: t.closeLinkInput } }, [t._v(" " + t._s(t.cancelSetLinkButton.label) + " ")]), n("dt-button", { attrs: { "aria-label": t.confirmSetLinkButton.ariaLabel, "data-qa": "dt-recipe-editor-set-link-confirm-btn", size: "sm" }, on: { click: t.setLink } }, [t._v(" " + t._s(t.confirmSetLinkButton.label) + " ")])], 1)];
|
|
659
|
+
}, proxy: !0 }], null, !1, 3688481372) })], 1) : t._e()], 2), n("div", { staticClass: "d-recipe-editor__content", style: { "max-height": t.maxHeight } }, [n("dt-rich-text-editor", t._b({ ref: "richTextEditor", attrs: { "allow-font-color": !0, "allow-font-family": !0, "allow-inline-images": !0, "allow-line-breaks": !0, "hide-link-bubble-menu": !0, "auto-focus": t.autoFocus, editable: t.editable, "input-aria-label": t.inputAriaLabel, "input-class": `d-recipe-editor__content-input ${t.inputClass}`, link: !0, "output-format": t.htmlOutputFormat, placeholder: t.placeholder, "use-div-tags": t.useDivTags, "data-qa": "dt-rich-text-editor" }, on: { "text-input": t.onTextInput, blur: t.onBlur, focus: t.onFocus, input: function(i) {
|
|
660
|
+
return t.onInput(i);
|
|
661
|
+
} }, model: { value: t.internalInputValue, callback: function(i) {
|
|
662
|
+
t.internalInputValue = i;
|
|
663
663
|
}, expression: "internalInputValue" } }, "dt-rich-text-editor", t.$attrs, !1))], 1)], 1);
|
|
664
664
|
}, v = [], M = /* @__PURE__ */ A(
|
|
665
665
|
D,
|
|
666
666
|
Q,
|
|
667
|
-
v
|
|
668
|
-
!1,
|
|
669
|
-
null,
|
|
670
|
-
null
|
|
667
|
+
v
|
|
671
668
|
);
|
|
672
669
|
const H = M.exports;
|
|
673
670
|
export {
|