@dialpad/dialtone-vue 2.161.0 → 2.161.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/emoji_picker/emoji_picker.vue.cjs +3 -7
- package/dist/components/emoji_picker/emoji_picker.vue.cjs.map +1 -1
- package/dist/components/emoji_picker/emoji_picker.vue.js +3 -7
- package/dist/components/emoji_picker/emoji_picker.vue.js.map +1 -1
- package/dist/components/emoji_picker/modules/emoji_selector.vue.cjs +6 -20
- package/dist/components/emoji_picker/modules/emoji_selector.vue.cjs.map +1 -1
- package/dist/components/emoji_picker/modules/emoji_selector.vue.js +6 -20
- package/dist/components/emoji_picker/modules/emoji_selector.vue.js.map +1 -1
- package/dist/components/emoji_picker/modules/emoji_tabset.vue.cjs +5 -9
- package/dist/components/emoji_picker/modules/emoji_tabset.vue.cjs.map +1 -1
- package/dist/components/emoji_picker/modules/emoji_tabset.vue.js +5 -9
- package/dist/components/emoji_picker/modules/emoji_tabset.vue.js.map +1 -1
- package/dist/components/rich_text_editor/rich_text_editor.vue.cjs +31 -0
- package/dist/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/components/rich_text_editor/rich_text_editor.vue.js +31 -0
- package/dist/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/types/common/dates/index.d.ts +0 -44
- package/dist/types/common/dates/index.d.ts.map +1 -1
- package/dist/types/common/emoji/index.d.ts +0 -3
- package/dist/types/common/emoji/index.d.ts.map +1 -1
- package/dist/types/common/mixins/dom.d.ts +0 -8
- package/dist/types/common/mixins/dom.d.ts.map +1 -1
- package/dist/types/common/mixins/index.d.ts +3 -3
- package/dist/types/common/mixins/input.d.ts +2 -6
- package/dist/types/common/mixins/input.d.ts.map +1 -1
- package/dist/types/common/mixins/input_group.d.ts +2 -2
- package/dist/types/common/mixins/modal.d.ts +0 -32
- package/dist/types/common/mixins/modal.d.ts.map +1 -1
- package/dist/types/common/sr_only_close_button.vue.d.ts +2 -10
- package/dist/types/common/sr_only_close_button.vue.d.ts.map +1 -1
- package/dist/types/common/utils/index.d.ts +0 -66
- package/dist/types/common/utils/index.d.ts.map +1 -1
- package/dist/types/components/avatar/avatar.vue.d.ts +3 -149
- package/dist/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/types/components/avatar/index.d.ts +2 -2
- package/dist/types/components/badge/badge.vue.d.ts +3 -82
- package/dist/types/components/badge/badge.vue.d.ts.map +1 -1
- package/dist/types/components/badge/index.d.ts +2 -2
- package/dist/types/components/banner/banner.vue.d.ts +2 -106
- package/dist/types/components/banner/banner.vue.d.ts.map +1 -1
- package/dist/types/components/banner/index.d.ts +1 -1
- package/dist/types/components/breadcrumbs/breadcrumb_item.vue.d.ts +2 -20
- package/dist/types/components/breadcrumbs/breadcrumb_item.vue.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/breadcrumbs.vue.d.ts +2 -22
- package/dist/types/components/breadcrumbs/breadcrumbs.vue.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/index.d.ts +3 -3
- package/dist/types/components/button/button.vue.d.ts +4 -156
- package/dist/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/types/components/button/index.d.ts +2 -2
- package/dist/types/components/button_group/button_group.vue.d.ts +2 -8
- package/dist/types/components/button_group/button_group.vue.d.ts.map +1 -1
- package/dist/types/components/button_group/index.d.ts +2 -2
- package/dist/types/components/card/card.vue.d.ts +2 -34
- package/dist/types/components/card/card.vue.d.ts.map +1 -1
- package/dist/types/components/card/index.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.vue.d.ts +5 -10
- package/dist/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
- package/dist/types/components/checkbox/index.d.ts +1 -1
- package/dist/types/components/checkbox_group/checkbox_group.vue.d.ts +9 -47
- package/dist/types/components/checkbox_group/checkbox_group.vue.d.ts.map +1 -1
- package/dist/types/components/checkbox_group/index.d.ts +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +3 -61
- package/dist/types/components/chip/chip.vue.d.ts.map +1 -1
- package/dist/types/components/chip/index.d.ts +2 -2
- package/dist/types/components/codeblock/codeblock.vue.d.ts +2 -2
- package/dist/types/components/codeblock/codeblock.vue.d.ts.map +1 -1
- package/dist/types/components/codeblock/index.d.ts +1 -1
- package/dist/types/components/collapsible/collapsible.vue.d.ts +4 -86
- package/dist/types/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/types/components/collapsible/collapsible_lazy_show.vue.d.ts +2 -44
- package/dist/types/components/collapsible/collapsible_lazy_show.vue.d.ts.map +1 -1
- package/dist/types/components/collapsible/index.d.ts +1 -1
- package/dist/types/components/combobox/combobox.vue.d.ts +4 -118
- package/dist/types/components/combobox/combobox.vue.d.ts.map +1 -1
- package/dist/types/components/combobox/combobox_empty-list.vue.d.ts +2 -18
- package/dist/types/components/combobox/combobox_empty-list.vue.d.ts.map +1 -1
- package/dist/types/components/combobox/combobox_loading-list.vue.d.ts +1 -1
- package/dist/types/components/combobox/combobox_loading-list.vue.d.ts.map +1 -1
- package/dist/types/components/combobox/index.d.ts +2 -2
- package/dist/types/components/datepicker/datepicker.vue.d.ts +1 -1
- package/dist/types/components/datepicker/datepicker.vue.d.ts.map +1 -1
- package/dist/types/components/datepicker/datepicker_constants.d.ts +0 -5
- package/dist/types/components/datepicker/datepicker_constants.d.ts.map +1 -1
- package/dist/types/components/datepicker/formatUtils.d.ts +0 -36
- package/dist/types/components/datepicker/formatUtils.d.ts.map +1 -1
- package/dist/types/components/datepicker/index.d.ts +2 -2
- package/dist/types/components/datepicker/modules/calendar.vue.d.ts +2 -2
- package/dist/types/components/datepicker/modules/calendar.vue.d.ts.map +1 -1
- package/dist/types/components/datepicker/modules/month-year-picker.vue.d.ts +2 -2
- package/dist/types/components/datepicker/modules/month-year-picker.vue.d.ts.map +1 -1
- package/dist/types/components/description_list/description_list.vue.d.ts +2 -36
- package/dist/types/components/description_list/description_list.vue.d.ts.map +1 -1
- package/dist/types/components/description_list/index.d.ts +2 -2
- package/dist/types/components/dropdown/dropdown.vue.d.ts +28 -196
- package/dist/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown_separator.vue.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown_separator.vue.d.ts.map +1 -1
- package/dist/types/components/dropdown/index.d.ts +3 -3
- package/dist/types/components/emoji/emoji.vue.d.ts +2 -52
- package/dist/types/components/emoji/emoji.vue.d.ts.map +1 -1
- package/dist/types/components/emoji/index.d.ts +1 -1
- package/dist/types/components/emoji_picker/emoji_picker.vue.d.ts +1 -1
- package/dist/types/components/emoji_picker/emoji_picker.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/index.d.ts +2 -2
- package/dist/types/components/emoji_picker/modules/emoji_description.vue.d.ts +2 -12
- package/dist/types/components/emoji_picker/modules/emoji_description.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_search.vue.d.ts +2 -2
- package/dist/types/components/emoji_picker/modules/emoji_search.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts +2 -2
- package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_skin_selector.vue.d.ts +2 -2
- package/dist/types/components/emoji_picker/modules/emoji_skin_selector.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_tabset.vue.d.ts +2 -11
- package/dist/types/components/emoji_picker/modules/emoji_tabset.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_text_wrapper/emoji_text_wrapper.vue.d.ts +2 -28
- package/dist/types/components/emoji_text_wrapper/emoji_text_wrapper.vue.d.ts.map +1 -1
- package/dist/types/components/emoji_text_wrapper/index.d.ts +1 -1
- package/dist/types/components/empty_state/empty_state.vue.d.ts +1 -1
- package/dist/types/components/empty_state/empty_state.vue.d.ts.map +1 -1
- package/dist/types/components/empty_state/index.d.ts +2 -2
- package/dist/types/components/hovercard/hovercard.vue.d.ts +1 -1
- package/dist/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/types/components/hovercard/index.d.ts +1 -1
- package/dist/types/components/icon/icon.vue.d.ts +2 -22
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/icon/index.d.ts +2 -2
- package/dist/types/components/illustration/illustration.vue.d.ts +2 -8
- package/dist/types/components/illustration/illustration.vue.d.ts.map +1 -1
- package/dist/types/components/illustration/index.d.ts +2 -2
- package/dist/types/components/image_viewer/image_viewer.vue.d.ts +2 -58
- package/dist/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/types/components/image_viewer/index.d.ts +1 -1
- package/dist/types/components/input/index.d.ts +2 -2
- package/dist/types/components/input/input.vue.d.ts +3 -119
- package/dist/types/components/input/input.vue.d.ts.map +1 -1
- package/dist/types/components/input_group/index.d.ts +1 -1
- package/dist/types/components/input_group/input_group.vue.d.ts +8 -37
- package/dist/types/components/input_group/input_group.vue.d.ts.map +1 -1
- package/dist/types/components/item_layout/index.d.ts +1 -1
- package/dist/types/components/item_layout/item_layout.vue.d.ts +2 -16
- package/dist/types/components/item_layout/item_layout.vue.d.ts.map +1 -1
- package/dist/types/components/keyboard_shortcut/index.d.ts +2 -2
- package/dist/types/components/keyboard_shortcut/keyboard_shortcut.vue.d.ts +2 -24
- package/dist/types/components/keyboard_shortcut/keyboard_shortcut.vue.d.ts.map +1 -1
- package/dist/types/components/lazy_show/index.d.ts +1 -1
- package/dist/types/components/lazy_show/lazy_show.vue.d.ts +2 -30
- package/dist/types/components/lazy_show/lazy_show.vue.d.ts.map +1 -1
- package/dist/types/components/link/index.d.ts +2 -2
- package/dist/types/components/link/link.vue.d.ts +2 -20
- package/dist/types/components/link/link.vue.d.ts.map +1 -1
- package/dist/types/components/list_item/index.d.ts +2 -2
- package/dist/types/components/list_item/list_item.vue.d.ts +5 -58
- package/dist/types/components/list_item/list_item.vue.d.ts.map +1 -1
- package/dist/types/components/list_item_group/index.d.ts +1 -1
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts +2 -26
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts.map +1 -1
- package/dist/types/components/modal/index.d.ts +2 -2
- package/dist/types/components/modal/modal.vue.d.ts +2 -161
- package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/types/components/notice/index.d.ts +5 -5
- package/dist/types/components/notice/notice.vue.d.ts +2 -94
- package/dist/types/components/notice/notice.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_action.vue.d.ts +3 -27
- package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_content.vue.d.ts +2 -24
- package/dist/types/components/notice/notice_content.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_icon.vue.d.ts +2 -10
- package/dist/types/components/notice/notice_icon.vue.d.ts.map +1 -1
- package/dist/types/components/pagination/index.d.ts +1 -1
- package/dist/types/components/pagination/pagination.vue.d.ts +2 -48
- package/dist/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/types/components/popover/index.d.ts +2 -2
- package/dist/types/components/popover/popover.vue.d.ts +2 -2
- package/dist/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +2 -24
- package/dist/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
- package/dist/types/components/popover/tippy_utils.d.ts +2 -2
- package/dist/types/components/presence/index.d.ts +2 -2
- package/dist/types/components/presence/presence.vue.d.ts +2 -22
- package/dist/types/components/presence/presence.vue.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +2 -2
- package/dist/types/components/radio/radio.vue.d.ts +4 -10
- package/dist/types/components/radio/radio.vue.d.ts.map +1 -1
- package/dist/types/components/radio_group/index.d.ts +1 -1
- package/dist/types/components/radio_group/radio_group.vue.d.ts +8 -39
- package/dist/types/components/radio_group/radio_group.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +18 -18
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelSuggestion.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelSuggestion.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/channels/channel.d.ts +1 -1
- package/dist/types/components/rich_text_editor/extensions/custom_link/autolink.d.ts +1 -4
- package/dist/types/components/rich_text_editor/extensions/custom_link/autolink.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/custom_link/custom_link.d.ts +1 -1
- package/dist/types/components/rich_text_editor/extensions/custom_link/index.d.ts +1 -1
- package/dist/types/components/rich_text_editor/extensions/custom_link/utils.d.ts +0 -28
- package/dist/types/components/rich_text_editor/extensions/custom_link/utils.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +18 -18
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiSuggestion.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiSuggestion.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/emoji/emoji.d.ts +1 -1
- package/dist/types/components/rich_text_editor/extensions/emoji/index.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +18 -18
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/mentions/mention.d.ts +1 -1
- package/dist/types/components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue.d.ts +18 -18
- package/dist/types/components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/slash_command/SlashCommandSuggestion.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/slash_command/SlashCommandSuggestion.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/slash_command/slash_command.d.ts +1 -1
- package/dist/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/suggestion/SuggestionList.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/index.d.ts +2 -2
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts +5 -245
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/types/components/root_layout/index.d.ts +2 -2
- package/dist/types/components/root_layout/root_layout.vue.d.ts +2 -80
- package/dist/types/components/root_layout/root_layout.vue.d.ts.map +1 -1
- package/dist/types/components/select_menu/index.d.ts +2 -2
- package/dist/types/components/select_menu/select_menu.vue.d.ts +3 -97
- package/dist/types/components/select_menu/select_menu.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/index.d.ts +6 -6
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +2 -68
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +2 -76
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -54
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts +3 -66
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton.vue.d.ts +2 -70
- package/dist/types/components/skeleton/skeleton.vue.d.ts.map +1 -1
- package/dist/types/components/split_button/index.d.ts +2 -2
- package/dist/types/components/split_button/split_button-alpha.vue.d.ts +4 -74
- package/dist/types/components/split_button/split_button-alpha.vue.d.ts.map +1 -1
- package/dist/types/components/split_button/split_button-omega.vue.d.ts +4 -54
- package/dist/types/components/split_button/split_button-omega.vue.d.ts.map +1 -1
- package/dist/types/components/split_button/split_button.vue.d.ts +4 -150
- package/dist/types/components/split_button/split_button.vue.d.ts.map +1 -1
- package/dist/types/components/stack/index.d.ts +2 -2
- package/dist/types/components/stack/stack.vue.d.ts +1 -1
- package/dist/types/components/stack/stack.vue.d.ts.map +1 -1
- package/dist/types/components/tabs/index.d.ts +4 -4
- package/dist/types/components/tabs/tab.vue.d.ts +3 -43
- package/dist/types/components/tabs/tab.vue.d.ts.map +1 -1
- package/dist/types/components/tabs/tab_group.vue.d.ts +3 -59
- package/dist/types/components/tabs/tab_group.vue.d.ts.map +1 -1
- package/dist/types/components/tabs/tab_panel.vue.d.ts +2 -28
- package/dist/types/components/tabs/tab_panel.vue.d.ts.map +1 -1
- package/dist/types/components/toast/index.d.ts +2 -2
- package/dist/types/components/toast/toast.vue.d.ts +3 -111
- package/dist/types/components/toast/toast.vue.d.ts.map +1 -1
- package/dist/types/components/toggle/index.d.ts +2 -2
- package/dist/types/components/toggle/toggle.vue.d.ts +5 -67
- package/dist/types/components/toggle/toggle.vue.d.ts.map +1 -1
- package/dist/types/components/tooltip/index.d.ts +2 -2
- package/dist/types/components/tooltip/tooltip.vue.d.ts +6 -212
- package/dist/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/types/components/validation_messages/index.d.ts +1 -1
- package/dist/types/components/validation_messages/validation_messages.vue.d.ts +3 -24
- package/dist/types/components/validation_messages/validation_messages.vue.d.ts.map +1 -1
- package/dist/types/directives/scrollbar/index.d.ts +1 -1
- package/dist/types/directives/tooltip/index.d.ts +1 -1
- package/dist/types/index.d.ts +80 -80
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +6 -82
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +1 -1
- package/dist/types/recipes/buttons/callbar_button/index.d.ts +2 -2
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +5 -149
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_popover/index.d.ts +1 -1
- package/dist/types/recipes/cards/ivr_node/index.d.ts +2 -2
- package/dist/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +2 -32
- package/dist/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts +1 -1
- package/dist/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
- package/dist/types/recipes/chips/grouped_chip/index.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +2 -2
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
- package/dist/types/recipes/comboboxes/combobox_multi_select/index.d.ts +2 -2
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -167
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/index.d.ts +1 -1
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +2 -20
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/attachment_carousel/index.d.ts +1 -1
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +2 -2
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue.d.ts +2 -2
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/editor/editor.vue.d.ts +4 -178
- package/dist/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/editor/index.d.ts +1 -1
- package/dist/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +2 -8
- package/dist/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/emoji_row/index.d.ts +2 -2
- package/dist/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +2 -68
- package/dist/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/feed_item_row/index.d.ts +2 -2
- package/dist/types/recipes/conversation_view/feed_pill/feed_item_pill.vue.d.ts +2 -46
- package/dist/types/recipes/conversation_view/feed_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/feed_pill/index.d.ts +2 -2
- package/dist/types/recipes/conversation_view/message_input/index.d.ts +1 -1
- package/dist/types/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.d.ts +18 -18
- package/dist/types/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/meeting_pill/meeting_pill.d.ts +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +5 -249
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/time_pill/index.d.ts +1 -1
- package/dist/types/recipes/conversation_view/time_pill/time_pill.vue.d.ts +2 -16
- package/dist/types/recipes/conversation_view/time_pill/time_pill.vue.d.ts.map +1 -1
- package/dist/types/recipes/header/settings_menu_button/index.d.ts +1 -1
- package/dist/types/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts +2 -18
- package/dist/types/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts.map +1 -1
- package/dist/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +3 -95
- package/dist/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/dist/types/recipes/item_layout/contact_info/index.d.ts +1 -1
- package/dist/types/recipes/leftbar/callbox/callbox.vue.d.ts +2 -66
- package/dist/types/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/callbox/index.d.ts +2 -2
- package/dist/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +2 -38
- package/dist/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/contact_centers_row/index.d.ts +1 -1
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +2 -110
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/contact_row/index.d.ts +1 -1
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts +2 -125
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/general_row/index.d.ts +2 -2
- package/dist/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +2 -2
- package/dist/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/group_row/group_row.vue.d.ts +2 -46
- package/dist/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/group_row/index.d.ts +1 -1
- package/dist/types/recipes/leftbar/unread_pill/index.d.ts +2 -2
- package/dist/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +2 -18
- package/dist/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/dist/types/recipes/notices/top_banner_info/index.d.ts +2 -2
- package/dist/types/recipes/notices/top_banner_info/top_banner_info.vue.d.ts +2 -8
- package/dist/types/recipes/notices/top_banner_info/top_banner_info.vue.d.ts.map +1 -1
- package/package.json +10 -60
- package/dist/component-documentation.json +0 -1
- package/dist/types/common/storybook_utils.d.ts +0 -35
- package/dist/types/common/storybook_utils.d.ts.map +0 -1
- package/dist/types/components/button_group/buttons_decorator.vue.d.ts +0 -3
- package/dist/types/components/button_group/buttons_decorator.vue.d.ts.map +0 -1
- package/dist/types/components/checkbox_group/checkboxes_decorator.vue.d.ts +0 -3
- package/dist/types/components/checkbox_group/checkboxes_decorator.vue.d.ts.map +0 -1
- package/dist/types/components/dropdown/dropdown_list.vue.d.ts +0 -36
- package/dist/types/components/dropdown/dropdown_list.vue.d.ts.map +0 -1
- package/dist/types/components/input_group/decorators/input.vue.d.ts +0 -102
- package/dist/types/components/input_group/decorators/input.vue.d.ts.map +0 -1
- package/dist/types/components/input_group/decorators/inputs.vue.d.ts +0 -3
- package/dist/types/components/input_group/decorators/inputs.vue.d.ts.map +0 -1
- package/dist/types/components/radio_group/radios_decorator.vue.d.ts +0 -3
- package/dist/types/components/radio_group/radios_decorator.vue.d.ts.map +0 -1
|
@@ -20,10 +20,6 @@ const _sfc_main = {
|
|
|
20
20
|
type: Number,
|
|
21
21
|
required: true
|
|
22
22
|
},
|
|
23
|
-
isScrolling: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: false
|
|
26
|
-
},
|
|
27
23
|
emojiFilter: {
|
|
28
24
|
type: String,
|
|
29
25
|
default: ""
|
|
@@ -56,6 +52,7 @@ const _sfc_main = {
|
|
|
56
52
|
return tabsData.map((tab2, index) => ({
|
|
57
53
|
...tab2,
|
|
58
54
|
label: this.tabSetLabels[index],
|
|
55
|
+
// IDs on dt-tab component need to be on string
|
|
59
56
|
id: (index + 1).toString(),
|
|
60
57
|
panelId: (index + 1).toString()
|
|
61
58
|
}));
|
|
@@ -66,7 +63,7 @@ const _sfc_main = {
|
|
|
66
63
|
},
|
|
67
64
|
watch: {
|
|
68
65
|
scrollIntoTab: function(newVal) {
|
|
69
|
-
if (!this.
|
|
66
|
+
if (!this.isSearching) {
|
|
70
67
|
this.selectedTab = (newVal + 1).toString();
|
|
71
68
|
}
|
|
72
69
|
},
|
|
@@ -83,10 +80,9 @@ const _sfc_main = {
|
|
|
83
80
|
},
|
|
84
81
|
methods: {
|
|
85
82
|
selectTabset(id) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
this.$emit("selected-tabset", id);
|
|
83
|
+
const parseId = parseInt(id);
|
|
84
|
+
this.selectedTab = id;
|
|
85
|
+
this.$emit("selected-tabset", parseId);
|
|
90
86
|
},
|
|
91
87
|
setTabsetRef() {
|
|
92
88
|
this.tabs.forEach((skin, index) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji_tabset.vue.cjs","sources":["../../../../components/emoji_picker/modules/emoji_tabset.vue"],"sourcesContent":["<template>\n <div class=\"d-emoji-picker__tabset\">\n <dt-tab-group\n size=\"sm\"\n tab-list-class=\"d-emoji-picker__tabset-list\"\n :selected=\"selectedTab\"\n >\n <template #tabs>\n <dt-tab\n v-for=\"(tab, index) in tabs\"\n :id=\"tab.id\"\n :ref=\"`tabsetRef-${index}`\"\n :key=\"tab.id\"\n :panel-id=\"tab.panelId\"\n :label=\"tab.label\"\n aria-controls=\"d-emoji-picker-list\"\n :tabindex=\"index + 1\"\n @click.capture.stop=\"selectTabset(tab.id)\"\n @keydown=\"handleKeyDown($event, tab.id)\"\n >\n <dt-icon\n size=\"400\"\n :name=\"tab.icon\"\n />\n </dt-tab>\n </template>\n </dt-tab-group>\n </div>\n</template>\n\n<script>\nimport DtTabGroup from '@/components/tabs/tab_group.vue';\nimport DtTab from '@/components/tabs/tab.vue';\nimport DtIcon from '@/components/icon/icon.vue';\nimport { EMOJI_PICKER_CATEGORIES } from '@/components/emoji_picker';\n\nexport default {\n name: 'EmojiTabset',\n\n components: {\n DtTabGroup,\n DtTab,\n DtIcon,\n },\n\n props: {\n showRecentlyUsedTab: {\n type: Boolean,\n default: false,\n },\n\n scrollIntoTab: {\n type: Number,\n required: true,\n },\n\n
|
|
1
|
+
{"version":3,"file":"emoji_tabset.vue.cjs","sources":["../../../../components/emoji_picker/modules/emoji_tabset.vue"],"sourcesContent":["<template>\n <div class=\"d-emoji-picker__tabset\">\n <dt-tab-group\n size=\"sm\"\n tab-list-class=\"d-emoji-picker__tabset-list\"\n :selected=\"selectedTab\"\n >\n <template #tabs>\n <dt-tab\n v-for=\"(tab, index) in tabs\"\n :id=\"tab.id\"\n :ref=\"`tabsetRef-${index}`\"\n :key=\"tab.id\"\n :panel-id=\"tab.panelId\"\n :label=\"tab.label\"\n aria-controls=\"d-emoji-picker-list\"\n :tabindex=\"index + 1\"\n @click.capture.stop=\"selectTabset(tab.id)\"\n @keydown=\"handleKeyDown($event, tab.id)\"\n >\n <dt-icon\n size=\"400\"\n :name=\"tab.icon\"\n />\n </dt-tab>\n </template>\n </dt-tab-group>\n </div>\n</template>\n\n<script>\nimport DtTabGroup from '@/components/tabs/tab_group.vue';\nimport DtTab from '@/components/tabs/tab.vue';\nimport DtIcon from '@/components/icon/icon.vue';\nimport { EMOJI_PICKER_CATEGORIES } from '@/components/emoji_picker';\n\nexport default {\n name: 'EmojiTabset',\n\n components: {\n DtTabGroup,\n DtTab,\n DtIcon,\n },\n\n props: {\n showRecentlyUsedTab: {\n type: Boolean,\n default: false,\n },\n\n scrollIntoTab: {\n type: Number,\n required: true,\n },\n\n emojiFilter: {\n type: String,\n default: '',\n },\n\n tabSetLabels: {\n type: Array,\n required: true,\n },\n },\n\n data () {\n return {\n selectedTab: '1',\n tabsetRef: [],\n TABS_DATA: [\n { label: EMOJI_PICKER_CATEGORIES.MOST_RECENTLY_USED, icon: 'clock' },\n { label: EMOJI_PICKER_CATEGORIES.SMILEYS_AND_PEOPLE, icon: 'satisfied' },\n { label: EMOJI_PICKER_CATEGORIES.NATURE, icon: 'living-thing' },\n { label: EMOJI_PICKER_CATEGORIES.FOOD, icon: 'food' },\n { label: EMOJI_PICKER_CATEGORIES.ACTIVITY, icon: 'object' },\n { label: EMOJI_PICKER_CATEGORIES.TRAVEL, icon: 'transportation' },\n { label: EMOJI_PICKER_CATEGORIES.OBJECTS, icon: 'lightbulb' },\n { label: EMOJI_PICKER_CATEGORIES.SYMBOLS, icon: 'heart' },\n { label: EMOJI_PICKER_CATEGORIES.FLAGS, icon: 'flag' },\n ],\n };\n },\n\n computed: {\n tabs () {\n const tabsData = this.showRecentlyUsedTab ? this.TABS_DATA : this.TABS_DATA.slice(1);\n return tabsData.map((tab, index) => ({\n ...tab,\n label: this.tabSetLabels[index],\n // IDs on dt-tab component need to be on string\n id: (index + 1).toString(),\n panelId: (index + 1).toString(),\n }));\n },\n\n isSearching () {\n return this.emojiFilter.length > 0;\n },\n },\n\n watch: {\n scrollIntoTab: function (newVal) {\n if (!this.isSearching) {\n this.selectedTab = (newVal + 1).toString();\n }\n },\n\n isSearching: function (newVal) {\n if (newVal) {\n this.selectedTab = null;\n }\n },\n },\n\n mounted () {\n this.$nextTick(() => {\n this.setTabsetRef();\n });\n },\n\n methods: {\n selectTabset (id) {\n // IDs on scrollToTab need to be on number\n const parseId = parseInt(id);\n // IDs on dt-tab component need to be on string\n this.selectedTab = id;\n this.$emit('selected-tabset', parseId);\n },\n\n setTabsetRef () {\n this.tabs.forEach((skin, index) => {\n const refKey = `tabsetRef-${index}`;\n if (this.$refs[refKey]) {\n this.$set(this.tabsetRef, index, this.$refs[refKey][0].$el);\n }\n });\n },\n\n focusTabset () {\n if (this.tabsetRef[0]) {\n this.tabsetRef[0].focus();\n }\n },\n\n // eslint-disable-next-line complexity\n handleKeyDown (event, tabId) {\n if (event.key === 'Enter') {\n this.selectTabset(tabId);\n if (this.tabsetRef[tabId - 1]) {\n this.tabsetRef[tabId - 1].blur();\n }\n }\n\n if (event.key === 'Tab') {\n event.preventDefault();\n if (event.shiftKey) {\n this.$emit('focus-skin-selector');\n } else {\n this.$emit('focus-search-input');\n }\n }\n\n if (event.key === 'ArrowDown') {\n this.$emit('focus-search-input');\n }\n },\n },\n};\n</script>\n"],"names":["DtTabGroup","DtTab","DtIcon","EMOJI_PICKER_C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AAA,MAAA,UAAA;AACA,eAAA,MAAA,qBAAA;AAAA,QACA,OAAA;AACA,eAAA,MAAA,oBAAA;AAAA,QACA;AAAA,MACA;AAEA,UAAA,MAAA,QAAA,aAAA;AACA,aAAA,MAAA,oBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -19,10 +19,6 @@ const _sfc_main = {
|
|
|
19
19
|
type: Number,
|
|
20
20
|
required: true
|
|
21
21
|
},
|
|
22
|
-
isScrolling: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
},
|
|
26
22
|
emojiFilter: {
|
|
27
23
|
type: String,
|
|
28
24
|
default: ""
|
|
@@ -55,6 +51,7 @@ const _sfc_main = {
|
|
|
55
51
|
return tabsData.map((tab, index) => ({
|
|
56
52
|
...tab,
|
|
57
53
|
label: this.tabSetLabels[index],
|
|
54
|
+
// IDs on dt-tab component need to be on string
|
|
58
55
|
id: (index + 1).toString(),
|
|
59
56
|
panelId: (index + 1).toString()
|
|
60
57
|
}));
|
|
@@ -65,7 +62,7 @@ const _sfc_main = {
|
|
|
65
62
|
},
|
|
66
63
|
watch: {
|
|
67
64
|
scrollIntoTab: function(newVal) {
|
|
68
|
-
if (!this.
|
|
65
|
+
if (!this.isSearching) {
|
|
69
66
|
this.selectedTab = (newVal + 1).toString();
|
|
70
67
|
}
|
|
71
68
|
},
|
|
@@ -82,10 +79,9 @@ const _sfc_main = {
|
|
|
82
79
|
},
|
|
83
80
|
methods: {
|
|
84
81
|
selectTabset(id) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.$emit("selected-tabset", id);
|
|
82
|
+
const parseId = parseInt(id);
|
|
83
|
+
this.selectedTab = id;
|
|
84
|
+
this.$emit("selected-tabset", parseId);
|
|
89
85
|
},
|
|
90
86
|
setTabsetRef() {
|
|
91
87
|
this.tabs.forEach((skin, index) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji_tabset.vue.js","sources":["../../../../components/emoji_picker/modules/emoji_tabset.vue"],"sourcesContent":["<template>\n <div class=\"d-emoji-picker__tabset\">\n <dt-tab-group\n size=\"sm\"\n tab-list-class=\"d-emoji-picker__tabset-list\"\n :selected=\"selectedTab\"\n >\n <template #tabs>\n <dt-tab\n v-for=\"(tab, index) in tabs\"\n :id=\"tab.id\"\n :ref=\"`tabsetRef-${index}`\"\n :key=\"tab.id\"\n :panel-id=\"tab.panelId\"\n :label=\"tab.label\"\n aria-controls=\"d-emoji-picker-list\"\n :tabindex=\"index + 1\"\n @click.capture.stop=\"selectTabset(tab.id)\"\n @keydown=\"handleKeyDown($event, tab.id)\"\n >\n <dt-icon\n size=\"400\"\n :name=\"tab.icon\"\n />\n </dt-tab>\n </template>\n </dt-tab-group>\n </div>\n</template>\n\n<script>\nimport DtTabGroup from '@/components/tabs/tab_group.vue';\nimport DtTab from '@/components/tabs/tab.vue';\nimport DtIcon from '@/components/icon/icon.vue';\nimport { EMOJI_PICKER_CATEGORIES } from '@/components/emoji_picker';\n\nexport default {\n name: 'EmojiTabset',\n\n components: {\n DtTabGroup,\n DtTab,\n DtIcon,\n },\n\n props: {\n showRecentlyUsedTab: {\n type: Boolean,\n default: false,\n },\n\n scrollIntoTab: {\n type: Number,\n required: true,\n },\n\n
|
|
1
|
+
{"version":3,"file":"emoji_tabset.vue.js","sources":["../../../../components/emoji_picker/modules/emoji_tabset.vue"],"sourcesContent":["<template>\n <div class=\"d-emoji-picker__tabset\">\n <dt-tab-group\n size=\"sm\"\n tab-list-class=\"d-emoji-picker__tabset-list\"\n :selected=\"selectedTab\"\n >\n <template #tabs>\n <dt-tab\n v-for=\"(tab, index) in tabs\"\n :id=\"tab.id\"\n :ref=\"`tabsetRef-${index}`\"\n :key=\"tab.id\"\n :panel-id=\"tab.panelId\"\n :label=\"tab.label\"\n aria-controls=\"d-emoji-picker-list\"\n :tabindex=\"index + 1\"\n @click.capture.stop=\"selectTabset(tab.id)\"\n @keydown=\"handleKeyDown($event, tab.id)\"\n >\n <dt-icon\n size=\"400\"\n :name=\"tab.icon\"\n />\n </dt-tab>\n </template>\n </dt-tab-group>\n </div>\n</template>\n\n<script>\nimport DtTabGroup from '@/components/tabs/tab_group.vue';\nimport DtTab from '@/components/tabs/tab.vue';\nimport DtIcon from '@/components/icon/icon.vue';\nimport { EMOJI_PICKER_CATEGORIES } from '@/components/emoji_picker';\n\nexport default {\n name: 'EmojiTabset',\n\n components: {\n DtTabGroup,\n DtTab,\n DtIcon,\n },\n\n props: {\n showRecentlyUsedTab: {\n type: Boolean,\n default: false,\n },\n\n scrollIntoTab: {\n type: Number,\n required: true,\n },\n\n emojiFilter: {\n type: String,\n default: '',\n },\n\n tabSetLabels: {\n type: Array,\n required: true,\n },\n },\n\n data () {\n return {\n selectedTab: '1',\n tabsetRef: [],\n TABS_DATA: [\n { label: EMOJI_PICKER_CATEGORIES.MOST_RECENTLY_USED, icon: 'clock' },\n { label: EMOJI_PICKER_CATEGORIES.SMILEYS_AND_PEOPLE, icon: 'satisfied' },\n { label: EMOJI_PICKER_CATEGORIES.NATURE, icon: 'living-thing' },\n { label: EMOJI_PICKER_CATEGORIES.FOOD, icon: 'food' },\n { label: EMOJI_PICKER_CATEGORIES.ACTIVITY, icon: 'object' },\n { label: EMOJI_PICKER_CATEGORIES.TRAVEL, icon: 'transportation' },\n { label: EMOJI_PICKER_CATEGORIES.OBJECTS, icon: 'lightbulb' },\n { label: EMOJI_PICKER_CATEGORIES.SYMBOLS, icon: 'heart' },\n { label: EMOJI_PICKER_CATEGORIES.FLAGS, icon: 'flag' },\n ],\n };\n },\n\n computed: {\n tabs () {\n const tabsData = this.showRecentlyUsedTab ? this.TABS_DATA : this.TABS_DATA.slice(1);\n return tabsData.map((tab, index) => ({\n ...tab,\n label: this.tabSetLabels[index],\n // IDs on dt-tab component need to be on string\n id: (index + 1).toString(),\n panelId: (index + 1).toString(),\n }));\n },\n\n isSearching () {\n return this.emojiFilter.length > 0;\n },\n },\n\n watch: {\n scrollIntoTab: function (newVal) {\n if (!this.isSearching) {\n this.selectedTab = (newVal + 1).toString();\n }\n },\n\n isSearching: function (newVal) {\n if (newVal) {\n this.selectedTab = null;\n }\n },\n },\n\n mounted () {\n this.$nextTick(() => {\n this.setTabsetRef();\n });\n },\n\n methods: {\n selectTabset (id) {\n // IDs on scrollToTab need to be on number\n const parseId = parseInt(id);\n // IDs on dt-tab component need to be on string\n this.selectedTab = id;\n this.$emit('selected-tabset', parseId);\n },\n\n setTabsetRef () {\n this.tabs.forEach((skin, index) => {\n const refKey = `tabsetRef-${index}`;\n if (this.$refs[refKey]) {\n this.$set(this.tabsetRef, index, this.$refs[refKey][0].$el);\n }\n });\n },\n\n focusTabset () {\n if (this.tabsetRef[0]) {\n this.tabsetRef[0].focus();\n }\n },\n\n // eslint-disable-next-line complexity\n handleKeyDown (event, tabId) {\n if (event.key === 'Enter') {\n this.selectTabset(tabId);\n if (this.tabsetRef[tabId - 1]) {\n this.tabsetRef[tabId - 1].blur();\n }\n }\n\n if (event.key === 'Tab') {\n event.preventDefault();\n if (event.shiftKey) {\n this.$emit('focus-skin-selector');\n } else {\n this.$emit('focus-search-input');\n }\n }\n\n if (event.key === 'ArrowDown') {\n this.$emit('focus-search-input');\n }\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;AAoCA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IAEA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IAEA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IAEA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAE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EAEA,SAAA;AAAA,IACA,aAAA,IAAA;AAEA,YAAA,UAAA,SAAA,EAAA;AAEA,WAAA,cAAA;AACA,WAAA,MAAA,mBAAA,OAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,WAAA,KAAA,QAAA,CAAA,MAAA,UAAA;AACA,cAAA,SAAA,aAAA,KAAA;AACA,YAAA,KAAA,MAAA,MAAA,GAAA;AACA,eAAA,KAAA,KAAA,WAAA,OAAA,KAAA,MAAA,MAAA,EAAA,CAAA,EAAA,GAAA;AAAA,QACA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,UAAA,KAAA,UAAA,CAAA,GAAA;AACA,aAAA,UAAA,CAAA,EAAA,MAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA,IAGA,cAAA,OAAA,OAAA;AACA,UAAA,MAAA,QAAA,SAAA;AACA,aAAA,aAAA,KAAA;AACA,YAAA,KAAA,UAAA,QAAA,CAAA,GAAA;AACA,eAAA,UAAA,QAAA,CAAA,EAAA,KAAA;AAAA,QACA;AAAA,MACA;AAEA,UAAA,MAAA,QAAA,OAAA;AACA,cAAA,eAAA;AACA,YAAA,MAAA,UAAA;AACA,eAAA,MAAA,qBAAA;AAAA,QACA,OAAA;AACA,eAAA,MAAA,oBAAA;AAAA,QACA;AAAA,MACA;AAEA,UAAA,MAAA,QAAA,aAAA;AACA,aAAA,MAAA,oBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue2 = require("@tiptap/vue-2");
|
|
3
|
+
const model = require("@tiptap/pm/model");
|
|
3
4
|
const Blockquote = require("@tiptap/extension-blockquote");
|
|
4
5
|
const CodeBlock = require("@tiptap/extension-code-block");
|
|
5
6
|
const Document = require("@tiptap/extension-document");
|
|
@@ -450,6 +451,36 @@ const _sfc_main = {
|
|
|
450
451
|
attributes: {
|
|
451
452
|
...this.inputAttrs,
|
|
452
453
|
class: this.inputClass
|
|
454
|
+
},
|
|
455
|
+
/* Absolutely crazy that this is what's needed to paste line breaks properly in prosemirror, but it does seem
|
|
456
|
+
to fix our issue of line breaks outputting as paragraphs. Code taken from this thread:
|
|
457
|
+
https://discuss.prosemirror.net/t/how-to-preserve-hard-breaks-when-pasting-html-into-a-plain-text-schema/4202/4
|
|
458
|
+
*/
|
|
459
|
+
handlePaste: function(view, event, slice) {
|
|
460
|
+
var _a;
|
|
461
|
+
const { state } = view;
|
|
462
|
+
const { tr } = state;
|
|
463
|
+
if (!state.schema.nodes.hardBreak) {
|
|
464
|
+
return false;
|
|
465
|
+
}
|
|
466
|
+
const clipboardText = (_a = event.clipboardData) == null ? void 0 : _a.getData("text/plain").trim();
|
|
467
|
+
if (!clipboardText) {
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
const textLines = clipboardText.split(/(?:\r\n|\r|\n)/g);
|
|
471
|
+
const nodes = textLines.reduce((nodes2, line, index) => {
|
|
472
|
+
if (line.length > 0) {
|
|
473
|
+
nodes2.push(state.schema.text(line));
|
|
474
|
+
}
|
|
475
|
+
if (index < textLines.length - 1) {
|
|
476
|
+
nodes2.push(state.schema.nodes.hardBreak.create());
|
|
477
|
+
}
|
|
478
|
+
return nodes2;
|
|
479
|
+
}, []);
|
|
480
|
+
view.dispatch(
|
|
481
|
+
tr.replaceSelection(model.Slice.maxOpen(model.Fragment.fromArray(nodes))).scrollIntoView()
|
|
482
|
+
);
|
|
483
|
+
return true;
|
|
453
484
|
}
|
|
454
485
|
}
|
|
455
486
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich_text_editor.vue.cjs","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<template>\n <editor-content\n :editor=\"editor\"\n data-qa=\"dt-rich-text-editor\"\n class=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Document from '@tiptap/extension-document';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n },\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'html',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n * Note that slash commands only work when they are the first word in the input.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n ],\n\n data () {\n return {\n editor: null,\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History];\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem);\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n // make sure that this is defined before any other extensions\n // where Enter and Shift+Enter should have its own interaction. otherwise it will be ignored\n if (!this.allowLineBreaks) {\n const self = this;\n extensions.push(\n HardBreak.extend({\n addKeyboardShortcuts () {\n return {\n Enter: () => {\n self.$emit('enter');\n return true;\n },\n 'Shift-Enter': () => {\n this.editor.commands.setHardBreak();\n return true;\n },\n };\n },\n }),\n );\n } else {\n extensions.push(HardBreak);\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'dt-rich-text-editor--code-block',\n },\n }));\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n if (newValue === currentValue) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n },\n });\n this.addEditorListeners();\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n // The content has changed.\n this.editor.on('update', () => {\n const value = this.getOutput();\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.$emit('input', value);\n this.$emit('update:value', value);\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText();\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({ editorProps: { attributes } });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n .dt-rich-text-editor {\n &--code-block {\n background: var(--dt-color-surface-secondary);\n padding: var(--dt-space-400);\n }\n\n > .ProseMirror {\n box-shadow: none;\n\n p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--dt-color-foreground-placeholder);\n pointer-events: none;\n height: 0;\n }\n\n ul, ol {\n padding-left: var(--dt-space-525);\n }\n\n ul > li {\n list-style-type: disc;\n }\n\n ol > li {\n list-style-type: decimal;\n }\n\n blockquote {\n padding-left: var(--dt-space-400);\n border-left: var(--dt-size-border-300) solid var(--dt-color-foreground-muted-inverted);\n margin-left: 0;\n }\n }\n }\n</style>\n"],"names":["EditorContent","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_OUTPUT_FORMATS","RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS","CustomLink","mentionSuggestion","MentionPlugin","channelSuggestion","ChannelPlugin","slashCommandSuggestion","SlashCommandPlugin","Emoji","Editor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,eAAAA,KAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA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;AACA;AAAA,QACA;AACA,aAAA,MAAA,SAAA,KAAA;AACA,aAAA,MAAA,gBAAA,KAAA;AAAA,MACA,CAAA;AAGA,WAAA,OAAA,GAAA,SAAA,CAAA,EAAA,MAAA,MAAA;AACA,aAAA,MAAA,SAAA,KAAA;AAAA,MACA,CAAA;AAGA,WAAA,OAAA,GAAA,QAAA,CAAA,EAAA,MAAA,MAAA;AACA,aAAA,MAAA,QAAA,KAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,cAAA,KAAA,cAAA;AAAA,QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AAAA,QACA;AACA,iBAAA,KAAA,OAAA;MACA;AAAA,IACA;AAAA,IAEA,aAAA,WAAA,SAAA;;AACA,UAAA,OAAA,YAAA,WAAA;AACA,eAAA;AAAA,MACA;AACA,cAAA,eAAA,cAAA,mCAAA;AAAA,IACA;AAAA,IAEA,uBAAA,YAAA;AACA,WAAA,OAAA,WAAA,EAAA,aAAA,EAAA,WAAA,EAAA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"rich_text_editor.vue.cjs","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<template>\n <editor-content\n :editor=\"editor\"\n data-qa=\"dt-rich-text-editor\"\n class=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\nimport { Slice, Fragment } from '@tiptap/pm/model';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Document from '@tiptap/extension-document';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n },\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'html',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n * Note that slash commands only work when they are the first word in the input.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n ],\n\n data () {\n return {\n editor: null,\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History];\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem);\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n // make sure that this is defined before any other extensions\n // where Enter and Shift+Enter should have its own interaction. otherwise it will be ignored\n if (!this.allowLineBreaks) {\n const self = this;\n extensions.push(\n HardBreak.extend({\n addKeyboardShortcuts () {\n return {\n Enter: () => {\n self.$emit('enter');\n return true;\n },\n 'Shift-Enter': () => {\n this.editor.commands.setHardBreak();\n return true;\n },\n };\n },\n }),\n );\n } else {\n extensions.push(HardBreak);\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'dt-rich-text-editor--code-block',\n },\n }));\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n if (newValue === currentValue) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n /* Absolutely crazy that this is what's needed to paste line breaks properly in prosemirror, but it does seem\n to fix our issue of line breaks outputting as paragraphs. Code taken from this thread:\n https://discuss.prosemirror.net/t/how-to-preserve-hard-breaks-when-pasting-html-into-a-plain-text-schema/4202/4\n */\n handlePaste: function (view, event, slice) {\n const { state } = view;\n const { tr } = state;\n\n if (!state.schema.nodes.hardBreak) {\n return false;\n }\n\n const clipboardText = event.clipboardData?.getData('text/plain').trim();\n\n if (!clipboardText) {\n return false;\n }\n\n const textLines = clipboardText.split(/(?:\\r\\n|\\r|\\n)/g);\n\n const nodes = textLines.reduce((nodes, line, index) => {\n if (line.length > 0) {\n nodes.push(state.schema.text(line));\n }\n\n if (index < textLines.length - 1) {\n nodes.push(state.schema.nodes.hardBreak.create());\n }\n\n return nodes;\n }, []);\n\n view.dispatch(\n tr.replaceSelection(Slice.maxOpen(Fragment.fromArray(nodes))).scrollIntoView(),\n );\n\n return true;\n },\n },\n });\n this.addEditorListeners();\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n // The content has changed.\n this.editor.on('update', () => {\n const value = this.getOutput();\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.$emit('input', value);\n this.$emit('update:value', value);\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText();\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({ editorProps: { attributes } });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n .dt-rich-text-editor {\n &--code-block {\n background: var(--dt-color-surface-secondary);\n padding: var(--dt-space-400);\n }\n\n > .ProseMirror {\n box-shadow: none;\n\n p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--dt-color-foreground-placeholder);\n pointer-events: none;\n height: 0;\n }\n\n ul, ol {\n padding-left: var(--dt-space-525);\n }\n\n ul > li {\n list-style-type: disc;\n }\n\n ol > li {\n list-style-type: decimal;\n }\n\n blockquote {\n padding-left: var(--dt-space-400);\n border-left: var(--dt-size-border-300) solid var(--dt-color-foreground-muted-inverted);\n margin-left: 0;\n }\n }\n }\n</style>\n"],"names":["EditorContent","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_OUTPUT_FORMATS","RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS","CustomLink","mentionSuggestion","MentionPlugin","channelSuggestion","ChannelPlugin","slashCommandSuggestion","SlashCommandPlugin","Emoji","Editor","nodes","Slice","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,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,gBAAA,KAAA;AAAA,MACA,CAAA;AAGA,WAAA,OAAA,GAAA,SAAA,CAAA,EAAA,MAAA,MAAA;AACA,aAAA,MAAA,SAAA,KAAA;AAAA,MACA,CAAA;AAGA,WAAA,OAAA,GAAA,QAAA,CAAA,EAAA,MAAA,MAAA;AACA,aAAA,MAAA,QAAA,KAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,cAAA,KAAA,cAAA;AAAA,QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AAAA,QACA;AACA,iBAAA,KAAA,OAAA;MACA;AAAA,IACA;AAAA,IAEA,aAAA,WAAA,SAAA;;AACA,UAAA,OAAA,YAAA,WAAA;AACA,eAAA;AAAA,MACA;AACA,cAAA,eAAA,cAAA,mCAAA;AAAA,IACA;AAAA,IAEA,uBAAA,YAAA;AACA,WAAA,OAAA,WAAA,EAAA,aAAA,EAAA,WAAA,EAAA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorContent, Editor } from "@tiptap/vue-2";
|
|
2
|
+
import { Slice, Fragment } from "@tiptap/pm/model";
|
|
2
3
|
import Blockquote from "@tiptap/extension-blockquote";
|
|
3
4
|
import CodeBlock from "@tiptap/extension-code-block";
|
|
4
5
|
import Document from "@tiptap/extension-document";
|
|
@@ -449,6 +450,36 @@ const _sfc_main = {
|
|
|
449
450
|
attributes: {
|
|
450
451
|
...this.inputAttrs,
|
|
451
452
|
class: this.inputClass
|
|
453
|
+
},
|
|
454
|
+
/* Absolutely crazy that this is what's needed to paste line breaks properly in prosemirror, but it does seem
|
|
455
|
+
to fix our issue of line breaks outputting as paragraphs. Code taken from this thread:
|
|
456
|
+
https://discuss.prosemirror.net/t/how-to-preserve-hard-breaks-when-pasting-html-into-a-plain-text-schema/4202/4
|
|
457
|
+
*/
|
|
458
|
+
handlePaste: function(view, event, slice) {
|
|
459
|
+
var _a;
|
|
460
|
+
const { state } = view;
|
|
461
|
+
const { tr } = state;
|
|
462
|
+
if (!state.schema.nodes.hardBreak) {
|
|
463
|
+
return false;
|
|
464
|
+
}
|
|
465
|
+
const clipboardText = (_a = event.clipboardData) == null ? void 0 : _a.getData("text/plain").trim();
|
|
466
|
+
if (!clipboardText) {
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
const textLines = clipboardText.split(/(?:\r\n|\r|\n)/g);
|
|
470
|
+
const nodes = textLines.reduce((nodes2, line, index) => {
|
|
471
|
+
if (line.length > 0) {
|
|
472
|
+
nodes2.push(state.schema.text(line));
|
|
473
|
+
}
|
|
474
|
+
if (index < textLines.length - 1) {
|
|
475
|
+
nodes2.push(state.schema.nodes.hardBreak.create());
|
|
476
|
+
}
|
|
477
|
+
return nodes2;
|
|
478
|
+
}, []);
|
|
479
|
+
view.dispatch(
|
|
480
|
+
tr.replaceSelection(Slice.maxOpen(Fragment.fromArray(nodes))).scrollIntoView()
|
|
481
|
+
);
|
|
482
|
+
return true;
|
|
452
483
|
}
|
|
453
484
|
}
|
|
454
485
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich_text_editor.vue.js","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<template>\n <editor-content\n :editor=\"editor\"\n data-qa=\"dt-rich-text-editor\"\n class=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Document from '@tiptap/extension-document';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n },\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'html',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n * Note that slash commands only work when they are the first word in the input.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n ],\n\n data () {\n return {\n editor: null,\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History];\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem);\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n // make sure that this is defined before any other extensions\n // where Enter and Shift+Enter should have its own interaction. otherwise it will be ignored\n if (!this.allowLineBreaks) {\n const self = this;\n extensions.push(\n HardBreak.extend({\n addKeyboardShortcuts () {\n return {\n Enter: () => {\n self.$emit('enter');\n return true;\n },\n 'Shift-Enter': () => {\n this.editor.commands.setHardBreak();\n return true;\n },\n };\n },\n }),\n );\n } else {\n extensions.push(HardBreak);\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'dt-rich-text-editor--code-block',\n },\n }));\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n if (newValue === currentValue) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n },\n });\n this.addEditorListeners();\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n // The content has changed.\n this.editor.on('update', () => {\n const value = this.getOutput();\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.$emit('input', value);\n this.$emit('update:value', value);\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText();\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({ editorProps: { attributes } });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n .dt-rich-text-editor {\n &--code-block {\n background: var(--dt-color-surface-secondary);\n padding: var(--dt-space-400);\n }\n\n > .ProseMirror {\n box-shadow: none;\n\n p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--dt-color-foreground-placeholder);\n pointer-events: none;\n height: 0;\n }\n\n ul, ol {\n padding-left: var(--dt-space-525);\n }\n\n ul > li {\n list-style-type: disc;\n }\n\n ol > li {\n list-style-type: decimal;\n }\n\n blockquote {\n padding-left: var(--dt-space-400);\n border-left: var(--dt-size-border-300) solid var(--dt-color-foreground-muted-inverted);\n margin-left: 0;\n }\n }\n }\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA,WAAA;AAAA,MACA,MAAA,CAAA,SAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA,WAAA;AACA,YAAA,OAAA,cAAA,UAAA;AACA,iBAAA,iCAAA,SAAA,SAAA;AAAA,QACA;AACA,eAAA;AAAA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,SAAA;;AACA,UAAA,OAAA,YAAA,WAAA;AACA,eAAA;AAAA,MACA;AACA,cAAA,eAAA,cAAA,mCAAA;AAAA,IACA;AAAA,IAEA,uBAAA,YAAA;AACA,WAAA,OAAA,WAAA,EAAA,aAAA,EAAA,WAAA,EAAA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"rich_text_editor.vue.js","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<template>\n <editor-content\n :editor=\"editor\"\n data-qa=\"dt-rich-text-editor\"\n class=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent } from '@tiptap/vue-2';\nimport { Slice, Fragment } from '@tiptap/pm/model';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Document from '@tiptap/extension-document';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n },\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'html',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n * Note that slash commands only work when they are the first word in the input.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n ],\n\n data () {\n return {\n editor: null,\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History];\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem);\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n // make sure that this is defined before any other extensions\n // where Enter and Shift+Enter should have its own interaction. otherwise it will be ignored\n if (!this.allowLineBreaks) {\n const self = this;\n extensions.push(\n HardBreak.extend({\n addKeyboardShortcuts () {\n return {\n Enter: () => {\n self.$emit('enter');\n return true;\n },\n 'Shift-Enter': () => {\n this.editor.commands.setHardBreak();\n return true;\n },\n };\n },\n }),\n );\n } else {\n extensions.push(HardBreak);\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.configure({\n HTMLAttributes: {\n class: 'dt-rich-text-editor--code-block',\n },\n }));\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n let currentValue = this.getOutput();\n if (this.outputFormat === 'json') {\n newValue = JSON.stringify(newValue);\n currentValue = JSON.stringify(currentValue);\n }\n if (newValue === currentValue) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n /* Absolutely crazy that this is what's needed to paste line breaks properly in prosemirror, but it does seem\n to fix our issue of line breaks outputting as paragraphs. Code taken from this thread:\n https://discuss.prosemirror.net/t/how-to-preserve-hard-breaks-when-pasting-html-into-a-plain-text-schema/4202/4\n */\n handlePaste: function (view, event, slice) {\n const { state } = view;\n const { tr } = state;\n\n if (!state.schema.nodes.hardBreak) {\n return false;\n }\n\n const clipboardText = event.clipboardData?.getData('text/plain').trim();\n\n if (!clipboardText) {\n return false;\n }\n\n const textLines = clipboardText.split(/(?:\\r\\n|\\r|\\n)/g);\n\n const nodes = textLines.reduce((nodes, line, index) => {\n if (line.length > 0) {\n nodes.push(state.schema.text(line));\n }\n\n if (index < textLines.length - 1) {\n nodes.push(state.schema.nodes.hardBreak.create());\n }\n\n return nodes;\n }, []);\n\n view.dispatch(\n tr.replaceSelection(Slice.maxOpen(Fragment.fromArray(nodes))).scrollIntoView(),\n );\n\n return true;\n },\n },\n });\n this.addEditorListeners();\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n // The content has changed.\n this.editor.on('update', () => {\n const value = this.getOutput();\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.$emit('input', value);\n this.$emit('update:value', value);\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText();\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({ editorProps: { attributes } });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n .dt-rich-text-editor {\n &--code-block {\n background: var(--dt-color-surface-secondary);\n padding: var(--dt-space-400);\n }\n\n > .ProseMirror {\n box-shadow: none;\n\n p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--dt-color-foreground-placeholder);\n pointer-events: none;\n height: 0;\n }\n\n ul, ol {\n padding-left: var(--dt-space-525);\n }\n\n ul > li {\n list-style-type: disc;\n }\n\n ol > li {\n list-style-type: decimal;\n }\n\n blockquote {\n padding-left: var(--dt-space-400);\n border-left: var(--dt-size-border-300) solid var(--dt-color-foreground-muted-inverted);\n margin-left: 0;\n }\n }\n }\n</style>\n"],"names":["nodes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA,WAAA;AAAA,MACA,MAAA,CAAA,SAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAA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are called.
|
|
3
|
-
* @param {Locale} locale A date-fns locale object
|
|
4
|
-
*/
|
|
5
1
|
export function setDateLocale(locale: Locale): void;
|
|
6
|
-
/**
|
|
7
|
-
* This formats a date to the Dialtone standard medium date format as shown here:
|
|
8
|
-
* https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length
|
|
9
|
-
* @param {Date} date A javascript date object
|
|
10
|
-
* @returns {string} A string in the format of 'September 2, 2022'
|
|
11
|
-
*/
|
|
12
2
|
export function getDateMedium(date: Date): string;
|
|
13
|
-
/**
|
|
14
|
-
* Converts a call duration in total number of seconds to a human readable string
|
|
15
|
-
* such as 'less than a minute' or '4 hours 34 minutes'.
|
|
16
|
-
* @param {number} durationInSeconds The duration of the call in seconds
|
|
17
|
-
* @returns {string} A human readable string representing the duration of the call
|
|
18
|
-
*/
|
|
19
3
|
export function durationInHHMM(durationInSeconds: number): string;
|
|
20
|
-
/**
|
|
21
|
-
* Returns the distance between the passed in date and now in a human readable format, typically used
|
|
22
|
-
* when showing a history of items in a log such as a feed list.
|
|
23
|
-
*
|
|
24
|
-
* datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.
|
|
25
|
-
*
|
|
26
|
-
* examples below to explain
|
|
27
|
-
* the different potential formats:
|
|
28
|
-
*
|
|
29
|
-
* If current day:
|
|
30
|
-
* Today
|
|
31
|
-
*
|
|
32
|
-
* If previous day:
|
|
33
|
-
* Yesterday
|
|
34
|
-
*
|
|
35
|
-
* Older than yesterday, but in the same calendar week:
|
|
36
|
-
* Monday
|
|
37
|
-
*
|
|
38
|
-
* Older than the most recent calendar week, but in the same year:
|
|
39
|
-
* Monday, October 14
|
|
40
|
-
*
|
|
41
|
-
* older than a calendar year:
|
|
42
|
-
* October 14, 2022
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @param {Date} date The timestamp of the item's date
|
|
46
|
-
* @returns {string} A human readable string representing the distance between the date and now
|
|
47
|
-
*/
|
|
48
4
|
export function relativeDate(date: Date): string;
|
|
49
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../common/dates/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../common/dates/index.js"],"names":[],"mappings":"AAqDA,sCAFW,MAAM,QAIhB;AAQD,oCAHW,IAAI,GACF,MAAM,CAIlB;AAQD,kDAHW,MAAM,GACJ,MAAM,CAalB;AAyCD,mCAHW,IAAI,GACF,MAAM,CAclB"}
|
|
@@ -29620,9 +29620,6 @@ export function setEmojiAssetUrlSmall(url: any, fileExtension?: string): void;
|
|
|
29620
29620
|
export function setEmojiAssetUrlLarge(url: any, fileExtension?: string): void;
|
|
29621
29621
|
export function setCustomEmojiUrl(url: any): void;
|
|
29622
29622
|
export function setCustomEmojiJson(json: any): void;
|
|
29623
|
-
/**
|
|
29624
|
-
* Validate custom emoji json
|
|
29625
|
-
*/
|
|
29626
29623
|
export function validateCustomEmojiJson(json: any): void;
|
|
29627
29624
|
export function shortcodeToEmojiData(shortcode: any): undefined;
|
|
29628
29625
|
export function unicodeToString(emoji: any): string;
|