@dialpad/dialtone-vue 2.127.0 → 2.127.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/_plugin-vue2_normalizer-1aBeR4AK.js +59 -0
- package/dist/chunks/_plugin-vue2_normalizer-1aBeR4AK.js.map +1 -0
- package/dist/chunks/_plugin-vue2_normalizer-sOSkiPF3.js +60 -0
- package/dist/chunks/_plugin-vue2_normalizer-sOSkiPF3.js.map +1 -0
- package/dist/chunks/{dropdown-SMWaTWyF.js → dropdown-DTtcQEFC.js} +131 -84
- package/dist/chunks/{dropdown-SMWaTWyF.js.map → dropdown-DTtcQEFC.js.map} +1 -1
- package/dist/chunks/dropdown-IaLNHmVd.js +403 -0
- package/dist/chunks/{dropdown-zhMEz3bn.js.map → dropdown-IaLNHmVd.js.map} +1 -1
- package/dist/chunks/dropdown_constants-2pGCXy7m.js +8 -0
- package/dist/chunks/dropdown_constants-2pGCXy7m.js.map +1 -0
- package/dist/chunks/dropdown_constants-w1MXGC3Z.js +9 -0
- package/dist/chunks/dropdown_constants-w1MXGC3Z.js.map +1 -0
- package/dist/chunks/{icon_constants-OpYAAKwF.js → icon_constants-Dy4MEUJL.js} +7 -6
- package/dist/chunks/{icon_constants-2S_OSQ1t.js.map → icon_constants-Dy4MEUJL.js.map} +1 -1
- package/dist/chunks/icon_constants-QYpmdE0R.js +16 -0
- package/dist/chunks/{icon_constants-OpYAAKwF.js.map → icon_constants-QYpmdE0R.js.map} +1 -1
- package/dist/chunks/index-DUr1xHR0.js +442 -0
- package/dist/chunks/{index-2jPosQBn.js.map → index-DUr1xHR0.js.map} +1 -1
- package/dist/chunks/index-IA-Z8fgm.js +441 -0
- package/dist/chunks/{index-nIyl_PL6.js.map → index-IA-Z8fgm.js.map} +1 -1
- package/dist/chunks/{input-1tm09l_-.js → input-6kbd8Pju.js} +83 -60
- package/dist/chunks/{input-o-fc1X4b.js.map → input-6kbd8Pju.js.map} +1 -1
- package/dist/chunks/input-Axw-wFj2.js +295 -0
- package/dist/chunks/{input-1tm09l_-.js.map → input-Axw-wFj2.js.map} +1 -1
- package/dist/chunks/input_group-m3cWYUfI.js +143 -0
- package/dist/chunks/{input_group-zcAq3DQl.js.map → input_group-m3cWYUfI.js.map} +1 -1
- package/dist/chunks/{input_group-zcAq3DQl.js → input_group-qVZaS5Bb.js} +27 -24
- package/dist/chunks/{input_group-j2gTtc1C.js.map → input_group-qVZaS5Bb.js.map} +1 -1
- package/dist/chunks/keyboard_list_navigation-ScXhrxya.js +284 -0
- package/dist/chunks/{keyboard_list_navigation-N74Bpdq7.js.map → keyboard_list_navigation-ScXhrxya.js.map} +1 -1
- package/dist/chunks/keyboard_list_navigation-fJnl_Iox.js +283 -0
- package/dist/chunks/{keyboard_list_navigation-F0O8nht0.js.map → keyboard_list_navigation-fJnl_Iox.js.map} +1 -1
- package/dist/chunks/link_constants-Huj7D_hm.js +22 -0
- package/dist/chunks/{link_constants-Kn6kP4i1.js.map → link_constants-Huj7D_hm.js.map} +1 -1
- package/dist/chunks/link_constants-nWVlXQBs.js +23 -0
- package/dist/chunks/{link_constants-vIUB92L4.js.map → link_constants-nWVlXQBs.js.map} +1 -1
- package/dist/chunks/list_item_constants-EiqkqZvP.js +13 -0
- package/dist/chunks/{list_item_constants-Tsz5CO1m.js.map → list_item_constants-EiqkqZvP.js.map} +1 -1
- package/dist/chunks/list_item_constants-u1xcN9Dd.js +14 -0
- package/dist/chunks/{list_item_constants-LTUc74pD.js.map → list_item_constants-u1xcN9Dd.js.map} +1 -1
- package/dist/chunks/modal-VgxXAQFP.js +105 -0
- package/dist/chunks/{modal-qEzlo0Sj.js.map → modal-VgxXAQFP.js.map} +1 -1
- package/dist/chunks/modal-XOr4kiNZ.js +106 -0
- package/dist/chunks/{modal-VuMFkZFH.js.map → modal-XOr4kiNZ.js.map} +1 -1
- package/dist/chunks/notice_action-IRUoLX2d.js +196 -0
- package/dist/chunks/{notice_action-u3ZKIhit.js.map → notice_action-IRUoLX2d.js.map} +1 -1
- package/dist/chunks/notice_action-P6uDyE9x.js +195 -0
- package/dist/chunks/{notice_action-9NmtQRai.js.map → notice_action-P6uDyE9x.js.map} +1 -1
- package/dist/chunks/notice_constants-7Qt2CQEY.js +7 -0
- package/dist/chunks/{notice_constants-mC6al2Dm.js.map → notice_constants-7Qt2CQEY.js.map} +1 -1
- package/dist/chunks/notice_constants-UXo9e3bS.js +6 -0
- package/dist/chunks/{notice_constants-c--hBFQw.js.map → notice_constants-UXo9e3bS.js.map} +1 -1
- package/dist/chunks/popover_constants-JwBF9h1Z.js +143 -0
- package/dist/chunks/{popover_constants-hOEhklvr.js.map → popover_constants-JwBF9h1Z.js.map} +1 -1
- package/dist/chunks/popover_constants-Qkpb0yh2.js +144 -0
- package/dist/chunks/{popover_constants-qjlEkroB.js.map → popover_constants-Qkpb0yh2.js.map} +1 -1
- package/dist/chunks/sr_only_close_button-81bHIpPu.js +95 -0
- package/dist/chunks/{sr_only_close_button-ErijKGYR.js.map → sr_only_close_button-81bHIpPu.js.map} +1 -1
- package/dist/chunks/sr_only_close_button-ZaGdAHz7.js +94 -0
- package/dist/chunks/{sr_only_close_button-JGole5Xi.js.map → sr_only_close_button-ZaGdAHz7.js.map} +1 -1
- package/dist/chunks/stack_constants-HraCekPm.js +15 -0
- package/dist/chunks/{stack_constants-m9Ickqw0.js.map → stack_constants-HraCekPm.js.map} +1 -1
- package/dist/chunks/stack_constants-SMzMWnAQ.js +14 -0
- package/dist/chunks/{stack_constants-u7tNqGtc.js.map → stack_constants-SMzMWnAQ.js.map} +1 -1
- package/dist/chunks/tab-FcsV5VmK.js +386 -0
- package/dist/chunks/{tab-7hJQSLFx.js.map → tab-FcsV5VmK.js.map} +1 -1
- package/dist/chunks/tab-V4cb44Ry.js +387 -0
- package/dist/chunks/{tab-Qm9LVkYj.js.map → tab-V4cb44Ry.js.map} +1 -1
- package/dist/common/constants.cjs +60 -0
- package/dist/{lib → common}/constants.cjs.map +1 -1
- package/dist/{lib → common}/constants.js +25 -18
- package/dist/{lib → common}/constants.js.map +1 -1
- package/dist/common/dates.cjs +72 -0
- package/dist/{lib → common}/dates.cjs.map +1 -1
- package/dist/common/dates.js +72 -0
- package/dist/{lib → common}/dates.js.map +1 -1
- package/dist/common/emoji.cjs +163 -0
- package/dist/common/emoji.cjs.map +1 -0
- package/dist/common/emoji.js +168 -0
- package/dist/common/emoji.js.map +1 -0
- package/dist/common/mixins.cjs +17 -0
- package/dist/{lib → common}/mixins.cjs.map +1 -1
- package/dist/common/mixins.js +17 -0
- package/dist/common/utils.cjs +237 -0
- package/dist/{lib → common}/utils.cjs.map +1 -1
- package/dist/common/utils.js +237 -0
- package/dist/{lib → common}/utils.js.map +1 -1
- package/dist/common/validators.cjs +23 -0
- package/dist/{lib → common}/validators.cjs.map +1 -1
- package/dist/common/validators.js +23 -0
- package/dist/{lib → common}/validators.js.map +1 -1
- package/dist/dialtone-vue.cjs +372 -1
- package/dist/dialtone-vue.cjs.map +1 -1
- package/dist/dialtone-vue.js +325 -324
- package/dist/dialtone-vue.js.map +1 -1
- package/dist/lib/attachment-carousel.cjs +260 -1
- package/dist/lib/attachment-carousel.cjs.map +1 -1
- package/dist/lib/attachment-carousel.js +96 -84
- package/dist/lib/attachment-carousel.js.map +1 -1
- package/dist/lib/avatar.cjs +399 -1
- package/dist/lib/avatar.cjs.map +1 -1
- package/dist/lib/avatar.js +111 -79
- package/dist/lib/avatar.js.map +1 -1
- package/dist/lib/badge.cjs +182 -1
- package/dist/lib/badge.cjs.map +1 -1
- package/dist/lib/badge.js +53 -38
- package/dist/lib/badge.js.map +1 -1
- package/dist/lib/banner.cjs +209 -2
- package/dist/lib/banner.cjs.map +1 -1
- package/dist/lib/banner.js +58 -47
- package/dist/lib/banner.js.map +1 -1
- package/dist/lib/breadcrumbs.cjs +146 -1
- package/dist/lib/breadcrumbs.cjs.map +1 -1
- package/dist/lib/breadcrumbs.js +57 -48
- package/dist/lib/breadcrumbs.js.map +1 -1
- package/dist/lib/button-group.cjs +47 -1
- package/dist/lib/button-group.cjs.map +1 -1
- package/dist/lib/button-group.js +21 -18
- package/dist/lib/button-group.js.map +1 -1
- package/dist/lib/button.cjs +349 -1
- package/dist/lib/button.cjs.map +1 -1
- package/dist/lib/button.js +98 -76
- package/dist/lib/button.js.map +1 -1
- package/dist/lib/callbar-button-with-popover.cjs +249 -1
- package/dist/lib/callbar-button-with-popover.cjs.map +1 -1
- package/dist/lib/callbar-button-with-popover.js +66 -50
- package/dist/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/lib/callbar-button.cjs +182 -1
- package/dist/lib/callbar-button.cjs.map +1 -1
- package/dist/lib/callbar-button.js +42 -34
- package/dist/lib/callbar-button.js.map +1 -1
- package/dist/lib/callbox.cjs +146 -1
- package/dist/lib/callbox.cjs.map +1 -1
- package/dist/lib/callbox.js +38 -32
- package/dist/lib/callbox.js.map +1 -1
- package/dist/lib/card.cjs +73 -1
- package/dist/lib/card.cjs.map +1 -1
- package/dist/lib/card.js +22 -20
- package/dist/lib/card.js.map +1 -1
- package/dist/lib/checkbox-group.cjs +129 -1
- package/dist/lib/checkbox-group.cjs.map +1 -1
- package/dist/lib/checkbox-group.js +42 -29
- package/dist/lib/checkbox-group.js.map +1 -1
- package/dist/lib/checkbox.cjs +127 -1
- package/dist/lib/checkbox.cjs.map +1 -1
- package/dist/lib/checkbox.js +46 -35
- package/dist/lib/checkbox.js.map +1 -1
- package/dist/lib/chip.cjs +198 -1
- package/dist/lib/chip.cjs.map +1 -1
- package/dist/lib/chip.js +59 -45
- package/dist/lib/chip.js.map +1 -1
- package/dist/lib/codeblock.cjs +29 -2
- package/dist/lib/codeblock.cjs.map +1 -1
- package/dist/lib/codeblock.js +15 -14
- package/dist/lib/codeblock.js.map +1 -1
- package/dist/lib/collapsible.cjs +334 -1
- package/dist/lib/collapsible.cjs.map +1 -1
- package/dist/lib/collapsible.js +91 -68
- package/dist/lib/collapsible.js.map +1 -1
- package/dist/lib/combobox-multi-select.cjs +519 -1
- package/dist/lib/combobox-multi-select.cjs.map +1 -1
- package/dist/lib/combobox-multi-select.js +223 -136
- package/dist/lib/combobox-multi-select.js.map +1 -1
- package/dist/lib/combobox-with-popover.cjs +384 -1
- package/dist/lib/combobox-with-popover.cjs.map +1 -1
- package/dist/lib/combobox-with-popover.js +130 -86
- package/dist/lib/combobox-with-popover.js.map +1 -1
- package/dist/lib/combobox.cjs +18 -1
- package/dist/lib/combobox.cjs.map +1 -1
- package/dist/lib/combobox.js +9 -9
- package/dist/lib/contact-info.cjs +145 -1
- package/dist/lib/contact-info.cjs.map +1 -1
- package/dist/lib/contact-info.js +34 -32
- package/dist/lib/contact-info.js.map +1 -1
- package/dist/lib/contact-row.cjs +205 -1
- package/dist/lib/contact-row.cjs.map +1 -1
- package/dist/lib/contact-row.js +42 -39
- package/dist/lib/contact-row.js.map +1 -1
- package/dist/lib/datepicker.cjs +662 -1
- package/dist/lib/datepicker.cjs.map +1 -1
- package/dist/lib/datepicker.js +330 -218
- package/dist/lib/datepicker.js.map +1 -1
- package/dist/lib/description-list.cjs +114 -1
- package/dist/lib/description-list.cjs.map +1 -1
- package/dist/lib/description-list.js +51 -19
- package/dist/lib/description-list.js.map +1 -1
- package/dist/lib/dropdown.cjs +45 -1
- package/dist/lib/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown.js +27 -25
- package/dist/lib/dropdown.js.map +1 -1
- package/dist/lib/editor.cjs +555 -1
- package/dist/lib/editor.cjs.map +1 -1
- package/dist/lib/editor.js +191 -162
- package/dist/lib/editor.js.map +1 -1
- package/dist/lib/emoji-picker.cjs +1063 -1
- package/dist/lib/emoji-picker.cjs.map +1 -1
- package/dist/lib/emoji-picker.js +638 -374
- package/dist/lib/emoji-picker.js.map +1 -1
- package/dist/lib/emoji-row.cjs +88 -1
- package/dist/lib/emoji-row.cjs.map +1 -1
- package/dist/lib/emoji-row.js +46 -40
- package/dist/lib/emoji-row.js.map +1 -1
- package/dist/lib/emoji-text-wrapper.cjs +109 -1
- package/dist/lib/emoji-text-wrapper.cjs.map +1 -1
- package/dist/lib/emoji-text-wrapper.js +49 -35
- package/dist/lib/emoji-text-wrapper.js.map +1 -1
- package/dist/lib/emoji.cjs +145 -1
- package/dist/lib/emoji.cjs.map +1 -1
- package/dist/lib/emoji.js +140 -5
- package/dist/lib/emoji.js.map +1 -1
- package/dist/lib/feed-item-row.cjs +213 -1
- package/dist/lib/feed-item-row.cjs.map +1 -1
- package/dist/lib/feed-item-row.js +71 -63
- package/dist/lib/feed-item-row.js.map +1 -1
- package/dist/lib/feed-pill.cjs +149 -1
- package/dist/lib/feed-pill.cjs.map +1 -1
- package/dist/lib/feed-pill.js +60 -51
- package/dist/lib/feed-pill.js.map +1 -1
- package/dist/lib/general-row.cjs +405 -1
- package/dist/lib/general-row.cjs.map +1 -1
- package/dist/lib/general-row.js +133 -106
- package/dist/lib/general-row.js.map +1 -1
- package/dist/lib/group-row.cjs +117 -1
- package/dist/lib/group-row.cjs.map +1 -1
- package/dist/lib/group-row.js +33 -30
- package/dist/lib/group-row.js.map +1 -1
- package/dist/lib/grouped-chip.cjs +45 -1
- package/dist/lib/grouped-chip.cjs.map +1 -1
- package/dist/lib/grouped-chip.js +28 -26
- package/dist/lib/grouped-chip.js.map +1 -1
- package/dist/lib/hovercard.cjs +227 -1
- package/dist/lib/hovercard.cjs.map +1 -1
- package/dist/lib/hovercard.js +98 -63
- package/dist/lib/hovercard.js.map +1 -1
- package/dist/lib/icon.cjs +59 -1
- package/dist/lib/icon.cjs.map +1 -1
- package/dist/lib/icon.js +22 -20
- package/dist/lib/icon.js.map +1 -1
- package/dist/lib/image-viewer.cjs +190 -1
- package/dist/lib/image-viewer.cjs.map +1 -1
- package/dist/lib/image-viewer.js +83 -62
- package/dist/lib/image-viewer.js.map +1 -1
- package/dist/lib/input-group.cjs +91 -1
- package/dist/lib/input-group.cjs.map +1 -1
- package/dist/lib/input-group.js +29 -27
- package/dist/lib/input-group.js.map +1 -1
- package/dist/lib/input.cjs +492 -1
- package/dist/lib/input.cjs.map +1 -1
- package/dist/lib/input.js +127 -89
- package/dist/lib/input.js.map +1 -1
- package/dist/lib/item-layout.cjs +40 -1
- package/dist/lib/item-layout.cjs.map +1 -1
- package/dist/lib/item-layout.js +15 -13
- package/dist/lib/item-layout.js.map +1 -1
- package/dist/lib/ivr-node.cjs +209 -1
- package/dist/lib/ivr-node.cjs.map +1 -1
- package/dist/lib/ivr-node.js +115 -99
- package/dist/lib/ivr-node.js.map +1 -1
- package/dist/lib/keyboard-shortcut.cjs +106 -1
- package/dist/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/lib/keyboard-shortcut.js +42 -34
- package/dist/lib/keyboard-shortcut.js.map +1 -1
- package/dist/lib/lazy-show.cjs +80 -1
- package/dist/lib/lazy-show.cjs.map +1 -1
- package/dist/lib/lazy-show.js +20 -16
- package/dist/lib/lazy-show.js.map +1 -1
- package/dist/lib/link.cjs +70 -1
- package/dist/lib/link.cjs.map +1 -1
- package/dist/lib/link.js +22 -20
- package/dist/lib/link.js.map +1 -1
- package/dist/lib/list-item-group.cjs +60 -1
- package/dist/lib/list-item-group.cjs.map +1 -1
- package/dist/lib/list-item-group.js +19 -17
- package/dist/lib/list-item-group.js.map +1 -1
- package/dist/lib/list-item.cjs +204 -1
- package/dist/lib/list-item.cjs.map +1 -1
- package/dist/lib/list-item.js +67 -56
- package/dist/lib/list-item.js.map +1 -1
- package/dist/lib/message-input.cjs +554 -1
- package/dist/lib/message-input.cjs.map +1 -1
- package/dist/lib/message-input.js +174 -152
- package/dist/lib/message-input.js.map +1 -1
- package/dist/lib/modal.cjs +350 -2
- package/dist/lib/modal.cjs.map +1 -1
- package/dist/lib/modal.js +118 -90
- package/dist/lib/modal.js.map +1 -1
- package/dist/lib/notice.cjs +159 -1
- package/dist/lib/notice.cjs.map +1 -1
- package/dist/lib/notice.js +46 -43
- package/dist/lib/notice.js.map +1 -1
- package/dist/lib/pagination.cjs +152 -1
- package/dist/lib/pagination.cjs.map +1 -1
- package/dist/lib/pagination.js +60 -48
- package/dist/lib/pagination.js.map +1 -1
- package/dist/lib/popover.cjs +956 -1
- package/dist/lib/popover.cjs.map +1 -1
- package/dist/lib/popover.js +401 -221
- package/dist/lib/popover.js.map +1 -1
- package/dist/lib/presence.cjs +65 -1
- package/dist/lib/presence.cjs.map +1 -1
- package/dist/lib/presence.js +32 -26
- package/dist/lib/presence.js.map +1 -1
- package/dist/lib/radio-group.cjs +98 -1
- package/dist/lib/radio-group.cjs.map +1 -1
- package/dist/lib/radio-group.js +24 -22
- package/dist/lib/radio-group.js.map +1 -1
- package/dist/lib/radio.cjs +118 -1
- package/dist/lib/radio.cjs.map +1 -1
- package/dist/lib/radio.js +43 -35
- package/dist/lib/radio.js.map +1 -1
- package/dist/lib/rich-text-editor.cjs +1138 -1
- package/dist/lib/rich-text-editor.cjs.map +1 -1
- package/dist/lib/rich-text-editor.js +574 -387
- package/dist/lib/rich-text-editor.js.map +1 -1
- package/dist/lib/root-layout.cjs +130 -1
- package/dist/lib/root-layout.cjs.map +1 -1
- package/dist/lib/root-layout.js +28 -24
- package/dist/lib/root-layout.js.map +1 -1
- package/dist/lib/select-menu.cjs +282 -1
- package/dist/lib/select-menu.cjs.map +1 -1
- package/dist/lib/select-menu.js +101 -61
- package/dist/lib/select-menu.js.map +1 -1
- package/dist/lib/settings-menu-button.cjs +65 -1
- package/dist/lib/settings-menu-button.cjs.map +1 -1
- package/dist/lib/settings-menu-button.js +26 -24
- package/dist/lib/settings-menu-button.js.map +1 -1
- package/dist/lib/skeleton.cjs +612 -1
- package/dist/lib/skeleton.cjs.map +1 -1
- package/dist/lib/skeleton.js +174 -135
- package/dist/lib/skeleton.js.map +1 -1
- package/dist/lib/stack.cjs +127 -1
- package/dist/lib/stack.cjs.map +1 -1
- package/dist/lib/stack.js +66 -56
- package/dist/lib/stack.js.map +1 -1
- package/dist/lib/tabs.cjs +99 -1
- package/dist/lib/tabs.cjs.map +1 -1
- package/dist/lib/tabs.js +42 -35
- package/dist/lib/tabs.js.map +1 -1
- package/dist/lib/time-pill.cjs +47 -1
- package/dist/lib/time-pill.cjs.map +1 -1
- package/dist/lib/time-pill.js +21 -16
- package/dist/lib/time-pill.js.map +1 -1
- package/dist/lib/toast.cjs +247 -1
- package/dist/lib/toast.cjs.map +1 -1
- package/dist/lib/toast.js +78 -55
- package/dist/lib/toast.js.map +1 -1
- package/dist/lib/toggle.cjs +177 -1
- package/dist/lib/toggle.cjs.map +1 -1
- package/dist/lib/toggle.js +46 -37
- package/dist/lib/toggle.js.map +1 -1
- package/dist/lib/tooltip-directive.cjs +87 -1
- package/dist/lib/tooltip-directive.cjs.map +1 -1
- package/dist/lib/tooltip-directive.js +55 -41
- package/dist/lib/tooltip-directive.js.map +1 -1
- package/dist/lib/tooltip.cjs +436 -1
- package/dist/lib/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip.js +152 -90
- package/dist/lib/tooltip.js.map +1 -1
- package/dist/lib/top-banner-info.cjs +63 -1
- package/dist/lib/top-banner-info.cjs.map +1 -1
- package/dist/lib/top-banner-info.js +22 -18
- package/dist/lib/top-banner-info.js.map +1 -1
- package/dist/lib/unread-pill.cjs +63 -1
- package/dist/lib/unread-pill.cjs.map +1 -1
- package/dist/lib/unread-pill.js +25 -21
- package/dist/lib/unread-pill.js.map +1 -1
- package/dist/lib/validation-messages.cjs +85 -1
- package/dist/lib/validation-messages.cjs.map +1 -1
- package/dist/lib/validation-messages.js +32 -29
- package/dist/lib/validation-messages.js.map +1 -1
- package/dist/style.css +1214 -1
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +2 -2
- package/package.json +31 -30
- package/dist/chunks/_plugin-vue2_normalizer-ZK80B3OL.js +0 -2
- package/dist/chunks/_plugin-vue2_normalizer-ZK80B3OL.js.map +0 -1
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +0 -33
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +0 -1
- package/dist/chunks/dropdown-zhMEz3bn.js +0 -2
- package/dist/chunks/dropdown_constants-EUcDxBrX.js +0 -9
- package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +0 -1
- package/dist/chunks/dropdown_constants-KHFvVI2L.js +0 -2
- package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +0 -1
- package/dist/chunks/icon_constants-2S_OSQ1t.js +0 -2
- package/dist/chunks/index-2jPosQBn.js +0 -3
- package/dist/chunks/index-YkSDT8-g.js +0 -244
- package/dist/chunks/index-YkSDT8-g.js.map +0 -1
- package/dist/chunks/index-nIyl_PL6.js +0 -372
- package/dist/chunks/index-sdfB7Aok.js +0 -2
- package/dist/chunks/index-sdfB7Aok.js.map +0 -1
- package/dist/chunks/input-o-fc1X4b.js +0 -2
- package/dist/chunks/input_group-j2gTtc1C.js +0 -2
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +0 -197
- package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +0 -2
- package/dist/chunks/link_constants-Kn6kP4i1.js +0 -2
- package/dist/chunks/link_constants-vIUB92L4.js +0 -16
- package/dist/chunks/list_item_constants-LTUc74pD.js +0 -13
- package/dist/chunks/list_item_constants-Tsz5CO1m.js +0 -2
- package/dist/chunks/modal-VuMFkZFH.js +0 -82
- package/dist/chunks/modal-qEzlo0Sj.js +0 -2
- package/dist/chunks/notice_action-9NmtQRai.js +0 -182
- package/dist/chunks/notice_action-u3ZKIhit.js +0 -2
- package/dist/chunks/notice_constants-c--hBFQw.js +0 -6
- package/dist/chunks/notice_constants-mC6al2Dm.js +0 -2
- package/dist/chunks/popover_constants-hOEhklvr.js +0 -2
- package/dist/chunks/popover_constants-qjlEkroB.js +0 -114
- package/dist/chunks/sr_only_close_button-ErijKGYR.js +0 -3
- package/dist/chunks/sr_only_close_button-JGole5Xi.js +0 -86
- package/dist/chunks/stack_constants-m9Ickqw0.js +0 -2
- package/dist/chunks/stack_constants-u7tNqGtc.js +0 -13
- package/dist/chunks/tab-7hJQSLFx.js +0 -2
- package/dist/chunks/tab-Qm9LVkYj.js +0 -346
- package/dist/lib/constants.cjs +0 -2
- package/dist/lib/dates.cjs +0 -2
- package/dist/lib/dates.js +0 -57
- package/dist/lib/mixins.cjs +0 -2
- package/dist/lib/mixins.js +0 -17
- package/dist/lib/utils.cjs +0 -2
- package/dist/lib/utils.js +0 -175
- package/dist/lib/validators.cjs +0 -2
- package/dist/lib/validators.js +0 -12
- /package/dist/{lib → common}/mixins.js.map +0 -0
|
@@ -1,2 +1,1139 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@tiptap/vue-2"),A=require("@tiptap/extension-blockquote"),j=require("@tiptap/extension-code-block"),P=require("@tiptap/extension-document"),L=require("@tiptap/extension-hard-break"),O=require("@tiptap/extension-paragraph"),D=require("@tiptap/extension-placeholder"),M=require("@tiptap/extension-bold"),$=require("@tiptap/extension-bullet-list"),B=require("@tiptap/extension-italic"),H=require("@tiptap/extension-link"),N=require("@tiptap/extension-list-item"),U=require("@tiptap/extension-ordered-list"),V=require("@tiptap/extension-strike"),F=require("@tiptap/extension-underline"),K=require("@tiptap/extension-text"),W=require("@tiptap/extension-text-align"),u=require("@tiptap/core"),l=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js"),m=require("../chunks/index-sdfB7Aok.js"),y=require("@tiptap/pm/state"),z=require("@tiptap/suggestion"),X=require("@dialpad/dialtone-emojis"),J=require("./list-item.cjs"),T=require("./stack.cjs"),k=require("tippy.js"),x=require("./utils.cjs"),Y=require("@tiptap/extension-mention"),G=require("./link.cjs"),Q=require("./avatar.cjs");require("emoji-regex");require("emoji-toolkit/emoji_strategy.json");require("./skeleton.cjs");require("../chunks/icon_constants-2S_OSQ1t.js");require("@dialpad/dialtone-icons/icons.json");require("../chunks/list_item_constants-Tsz5CO1m.js");require("./item-layout.cjs");require("./icon.cjs");require("@dialpad/dialtone-icons/vue2");require("../chunks/stack_constants-m9Ickqw0.js");require("./constants.cjs");require("vue");require("../chunks/link_constants-Kn6kP4i1.js");require("./presence.cjs");const Z={name:"EmojiComponent",components:{NodeViewWrapper:a.NodeViewWrapper,DtEmoji:m.D},props:a.nodeViewProps};var ee=function(){var t=this,r=t._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block d-va-bottom d-lh0"},[r("dt-emoji",{attrs:{size:"500",code:t.node.attrs.code}})],1)},te=[],re=l.n(Z,ee,te,!1,null,null,null,null);const ne=re.exports,ie={name:"SuggestionList",components:{DtListItem:J.DtListItem},props:{items:{type:Array,required:!0},command:{type:Function,required:!0},itemComponent:{type:Object,required:!0},itemType:{type:String,required:!0}},data(){return{selectedIndex:0}},watch:{items(){this.selectedIndex=0}},methods:{onKeyDown({event:e}){return e.key==="ArrowUp"?(this.upHandler(),!0):e.key==="ArrowDown"?(this.downHandler(),!0):e.key==="Enter"||e.key==="Tab"?(e.preventDefault(),this.selectHandler(),e.stopPropagation(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length,this.scrollActiveElementIntoView()},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length,this.scrollActiveElementIntoView()},scrollActiveElementIntoView(){const e=this.$refs.suggestionList.querySelector(".dt-list-item--highlighted");e&&e.scrollIntoView({behaviour:"smooth",block:"center"})},selectHandler(){this.selectItem(this.selectedIndex)},selectItem(e){const t=this.items[e];switch(this.itemType){case"emoji":this.command(t);return;case"mention":this.command({name:t.name,id:t.id,avatarSrc:t.avatarSrc});break}}}};var oe=function(){var t=this,r=t._self._c;return r("div",{staticClass:"d-popover__dialog"},[r("ul",{directives:[{name:"show",rawName:"v-show",value:t.items.length,expression:"items.length"}],ref:"suggestionList",staticClass:"dt-suggestion-list"},t._l(t.items,function(n,i){return r("dt-list-item",{key:n.id,class:["dt-suggestion-list--item",{"dt-list-item--highlighted":i===t.selectedIndex}],attrs:{"navigation-type":"arrow-keys"},on:{click:function(o){return t.selectItem(i)},keydown:function(o){return o.preventDefault(),o.stopPropagation(),t.onKeyDown.apply(null,arguments)}}},[r(t.itemComponent,{tag:"component",attrs:{item:n}})],1)}),1)])},se=[],ue=l.n(ie,oe,se,!1,null,null,null,null);const q=ue.exports,ae={name:"EmojiSuggestion",components:{DtEmoji:m.D,DtStack:T.DtStack},props:{item:{type:Object,required:!0}}};var ce=function(){var t=this,r=t._self._c;return r("dt-stack",{attrs:{direction:"row",gap:"400"}},[r("dt-emoji",{attrs:{size:"200",code:t.item.code}}),t._v(" "+t._s(t.item.code)+" ")],1)},le=[],de=l.n(ae,ce,le,!1,null,null,null,null);const pe=de.exports,me={items:({query:e})=>e.length<2?[]:Object.values(X.emojisIndexed).filter(function(n){return!!n.shortname.substring(1,n.shortname.length-1).startsWith(e.toLowerCase())}).map(n=>({id:n.unicode_character,code:n.shortname})),command:({editor:e,range:t,props:r})=>{var o,s;const n=e.view.state.selection.$to.nodeAfter;((o=n==null?void 0:n.text)==null?void 0:o.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:"emoji",attrs:r},{type:"text",text:" "}]).run(),(s=window.getSelection())==null||s.collapseToEnd()},render:()=>{let e,t;return{onStart:r=>{e=new a.VueRenderer(q,{parent:void 0,propsData:{itemComponent:pe,itemType:"emoji",...r},editor:r.editor}),r.clientRect&&(t=k("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",contentElement:null,zIndex:650}))},onUpdate(r){e.updateProps(r),r.clientRect&&t[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown(r){var n;return r.event.key==="Escape"?(t[0].hide(),!0):(n=e.ref)==null?void 0:n.onKeyDown(r)},onExit(){t[0].destroy(),e.destroy()}}}},fe=new y.PluginKey("emoji"),he=/:\w+:$/,ge=/:\w+:/g,_e=/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])$/,ye=/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g,w=e=>{if(e&&m.o(e[0]))return{index:e.index,text:e[0],match:e}},ve=e=>[...e.matchAll(ge)].filter(r=>m.o(r[0])).map(r=>({index:r.index,text:r[0],match:r})),be=u.Node.create({addOptions(){return{HTMLAttributes:{},suggestion:{char:":",pluginKey:fe}}},name:"emoji",group:"inline",inline:!0,selectable:!0,addNodeView(){return a.VueNodeViewRenderer(ne)},addAttributes(){return{code:{default:null},id:{default:null}}},parseHTML(){return[{tag:"emoji-component"}]},renderText({node:e}){return e.attrs.code},renderHTML({HTMLAttributes:e}){return["emoji-component",u.mergeAttributes(this.options.HTMLAttributes,e)]},addInputRules(){return[u.nodeInputRule({find:e=>{const t=e.match(he);return w(t)},type:this.type,getAttributes(e){return{code:e[0]}}}),u.nodeInputRule({find:e=>{const t=e.match(_e);return w(t)},type:this.type,getAttributes(e){const t=m.m(e[0]).unicode_output;return{code:String.fromCodePoint(parseInt(t,16)),label:"emoji"}}})]},addPasteRules(){return[u.nodePasteRule({find:ve,type:this.type,getAttributes(e){return{code:e[0]}}}),u.nodePasteRule({find:ye,type:this.type,getAttributes(e){return{code:e[0]}}})]},addProseMirrorPlugins(){return[z({editor:this.editor,...this.options.suggestion,...me})]}});function we(e,t,r=()=>!0){const n=[];t.lastIndex=0;let i;for(;i=t.exec(e);)r(e,i)&&n.push(i);return n}function Ee(e,t){return!["#","@"].includes(e.charAt(t.index))&&!["#","@"].includes(e.charAt(t.index-1))}function Re(e){const t=new RegExp("(?:"+[`[!?.,:;'"]`,"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"].join("|"),"g");return e.replace(t,"")}function Te(e,t){const r=e.slice(0,t+1).search(/\S+\s*$/),n=e.slice(t).search(/\s/);if(n<0){const i=e.slice(r);return{text:i,from:r,to:r+i.length}}return{text:e.slice(r,n+t),from:r,to:n+t}}function v(e,t,r,n){const i=Te(e,t);if(n.lastIndex=0,!n.test(i.text))return i;const o=r==="left"?i.from-1:i.to+1;return o<=0||o>=e.length||o===t?i:v(e,o,r,n)}function ke(e,t,r,n){const i=Math.max(e.from-1,0),o=Math.min(e.to+1,t.content.size),s=u.getMarksBetween(i,o,t);for(const c of s)c.mark.type===n&&r.removeMark(c.from,c.to,n)}const E=x.getPhoneNumberRegex(1,15);function R(e,t,r,n,i,o){if(!e)return;let s=r-t-1;s=s<0?0:s;const c=n-t,f=v(e,s,"left",E),b=v(e,c,"right",E),d=e.slice(f.from,b.to);we(d,x.linkRegex,Ee).forEach(_=>{const p=Re(_[0]),g=t+f.from+_.index+1,C=g+p.length;i.addMark(g,C,o.create())})}function xe(e){let t=!1;return new y.Plugin({key:new y.PluginKey("autolink"),appendTransaction:(r,n,i)=>{const o=r.some(d=>d.docChanged)&&!n.doc.eq(i.doc);if(t&&!o)return;const{tr:s}=i,{textContent:c}=i.doc;t||R(c,0,0,c.length,s,e.type),t=!0;const f=u.combineTransactionSteps(n.doc,[...r]);return u.getChangedRanges(f).forEach(({oldRange:d,newRange:h})=>{ke(h,i.doc,s,e.type),u.findChildrenInRange(i.doc,h,p=>p.isTextblock).forEach(({node:p,pos:g})=>{R(p.textContent,g,d.from,h.to,s,e.type)})}),s}})}const qe={class:"d-link d-c-text d-d-inline-block",rel:"noopener noreferrer nofollow"},Se=u.Mark.create({name:"Link",renderHTML({HTMLAttributes:e}){return["a",u.mergeAttributes(this.options.HTMLAttributes,e,qe),0]},renderText({node:e}){return e.attrs.text},addProseMirrorPlugins(){return[xe({type:this.type})]}}),Ie={name:"MentionComponent",components:{NodeViewWrapper:a.NodeViewWrapper,DtLink:G.DtLink},props:a.nodeViewProps,computed:{text(){return"@"+this.$props.node.attrs.name}}};var Ce=function(){var t=this,r=t._self._c;return r("node-view-wrapper",{staticClass:"d-d-inline-block"},[r("dt-link",{attrs:{kind:"mention"}},[t._v(" "+t._s(t.text)+" ")])],1)},Ae=[],je=l.n(Ie,Ce,Ae,!1,null,null,null,null);const Pe=je.exports,Le=Y.extend({addNodeView(){return a.VueNodeViewRenderer(Pe)},parseHTML(){return[{tag:"mention-component"}]},addAttributes(){return{name:{default:""},avatarSrc:{default:""},id:{default:""}}},renderText({node:e}){return`@${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return["mention-component",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),S=["text","json","html"],I=["start","end","all"],Oe=["https","http","ftp","ftps","sftp","mailto"],De={name:"MentionSuggestion",components:{DtAvatar:Q.DtAvatar,DtStack:T.DtStack},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name},avatarSrc(){return this.item.avatarSrc}}};var Me=function(){var t=this,r=t._self._c;return r("dt-stack",{attrs:{direction:"row",gap:"400"}},[r("dt-avatar",{attrs:{"full-name":t.name,"image-src":t.avatarSrc,"image-alt":t.name,size:"xs"}}),t._v(" "+t._s(t.name)+" ")],1)},$e=[],Be=l.n(De,Me,$e,!1,null,null,null,null);const He=Be.exports,Ne={allowSpaces:!0,render:()=>{let e,t;return{onStart:r=>{e=new a.VueRenderer(q,{parent:void 0,propsData:{itemComponent:He,itemType:"mention",...r},editor:r.editor}),r.clientRect&&(t=k("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start"}))},onUpdate(r){e.updateProps(r),r.clientRect&&t[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown(r){return r.event.key==="Escape"?(t[0].hide(),!0):e==null?void 0:e.ref.onKeyDown(r)},onExit(){t[0].destroy(),e.destroy()}}}},Ue={name:"DtRichTextEditor",components:{EditorContent:a.EditorContent},props:{value:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},allowLineBreaks:{type:Boolean,default:!1},inputAriaLabel:{type:String,required:!0},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e=="string"?I.includes(e):!0}},outputFormat:{type:String,default:"text",validator(e){return S.includes(e)}},placeholder:{type:String,default:""},link:{type:[Boolean,Object],default:!1},mentionSuggestion:{type:Object,default:null},allowBlockquote:{type:Boolean,default:!0},allowBold:{type:Boolean,default:!0},allowBulletList:{type:Boolean,default:!0},allowItalic:{type:Boolean,default:!0},allowStrike:{type:Boolean,default:!0},allowUnderline:{type:Boolean,default:!0}},emits:["input","update:value","blur","focus"],data(){return{editor:null,popoverOpened:!1}},computed:{extensions(){const e=[P,O,K];if(this.link&&e.push(this.getExtension(Se,this.link)),this.allowBlockquote&&e.push(A),this.allowBold&&e.push(M),this.allowBulletList&&(e.push($),e.push(N),e.push(U.configure({itemTypeName:"listItem"}))),this.allowItalic&&e.push(B),this.allowStrike&&e.push(V),this.allowUnderline&&e.push(F),e.push(D.configure({placeholder:this.placeholder})),this.allowLineBreaks||e.push(L.extend({addKeyboardShortcuts(){return{Enter:()=>!0,"Shift-Enter":()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])}}})),e.push(H.extend({inclusive:!1}).configure({autolink:!0,protocols:Oe})),this.mentionSuggestion){const t={...this.mentionSuggestion,...Ne};e.push(Le.configure({suggestion:t}))}return e.push(be),e.push(W.configure({types:["paragraph"],defaultAlignment:"left"})),e.push(j.configure({HTMLAttributes:{class:"dt-rich-text-editor--code-block"}})),e},inputAttrs(){const e={"aria-label":this.inputAriaLabel,"aria-multiline":!0,role:"textbox"};return this.editable||(e["aria-readonly"]=!0),e}},watch:{editable(e){this.editor.setEditable(e),this.updateEditorAttributes({"aria-readonly":!e})},inputClass(e){this.updateEditorAttributes({class:e})},inputAriaLabel(e){this.updateEditorAttributes({"aria-label":e})},extensions(){this.destroyEditor(),this.createEditor()},value(e){let t=this.getOutput();this.outputFormat==="json"&&(e=JSON.stringify(e),t=JSON.stringify(t)),e!==t&&this.editor.commands.setContent(e,!1)}},created(){this.createEditor()},beforeUnmount(){this.destroyEditor()},methods:{createEditor(){this.editor=new a.Editor({autofocus:this.autoFocus,content:this.value,editable:this.editable,extensions:this.extensions,editorProps:{attributes:{...this.inputAttrs,class:this.inputClass}}}),this.addEditorListeners()},destroyEditor(){this.editor.destroy()},addEditorListeners(){this.editor.on("update",()=>{const e=this.getOutput();this.$emit("input",e),this.$emit("update:value",e)}),this.editor.on("focus",({event:e})=>{this.$emit("focus",e)}),this.editor.on("blur",({event:e})=>{this.$emit("blur",e)})},getOutput(){switch(this.outputFormat){case"json":return this.editor.getJSON();case"html":return this.editor.getHTML();case"text":default:return this.editor.getText()}},getExtension(e,t){var r;return typeof t=="boolean"?e:(r=e.configure)==null?void 0:r.call(e,t)},updateEditorAttributes(e){this.editor.setOptions({editorProps:{attributes:e}})},focusEditor(){this.editor.commands.focus()}}};var Ve=function(){var t=this,r=t._self._c;return r("editor-content",{staticClass:"dt-rich-text-editor",attrs:{editor:t.editor,"data-qa":"dt-rich-text-editor"}})},Fe=[],Ke=l.n(Ue,Ve,Fe,!1,null,null,null,null);const We=Ke.exports;exports.DtRichTextEditor=We;exports.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES=I;exports.RICH_TEXT_EDITOR_OUTPUT_FORMATS=S;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue2 = require("@tiptap/vue-2");
|
|
4
|
+
const Blockquote = require("@tiptap/extension-blockquote");
|
|
5
|
+
const CodeBlock = require("@tiptap/extension-code-block");
|
|
6
|
+
const Document = require("@tiptap/extension-document");
|
|
7
|
+
const HardBreak = require("@tiptap/extension-hard-break");
|
|
8
|
+
const Paragraph = require("@tiptap/extension-paragraph");
|
|
9
|
+
const Placeholder = require("@tiptap/extension-placeholder");
|
|
10
|
+
const Bold = require("@tiptap/extension-bold");
|
|
11
|
+
const BulletList = require("@tiptap/extension-bullet-list");
|
|
12
|
+
const Italic = require("@tiptap/extension-italic");
|
|
13
|
+
const TipTapLink = require("@tiptap/extension-link");
|
|
14
|
+
const ListItem = require("@tiptap/extension-list-item");
|
|
15
|
+
const OrderedList = require("@tiptap/extension-ordered-list");
|
|
16
|
+
const Strike = require("@tiptap/extension-strike");
|
|
17
|
+
const Underline = require("@tiptap/extension-underline");
|
|
18
|
+
const Text = require("@tiptap/extension-text");
|
|
19
|
+
const TextAlign = require("@tiptap/extension-text-align");
|
|
20
|
+
const core = require("@tiptap/core");
|
|
21
|
+
const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-1aBeR4AK.js");
|
|
22
|
+
const lib_emoji = require("./emoji.cjs");
|
|
23
|
+
const common_emoji = require("../common/emoji.cjs");
|
|
24
|
+
const state = require("@tiptap/pm/state");
|
|
25
|
+
const Suggestion = require("@tiptap/suggestion");
|
|
26
|
+
const dialtoneEmojis = require("@dialpad/dialtone-emojis");
|
|
27
|
+
const lib_listItem = require("./list-item.cjs");
|
|
28
|
+
const lib_stack = require("./stack.cjs");
|
|
29
|
+
const tippy = require("tippy.js");
|
|
30
|
+
const common_utils = require("../common/utils.cjs");
|
|
31
|
+
const Mention = require("@tiptap/extension-mention");
|
|
32
|
+
const lib_link = require("./link.cjs");
|
|
33
|
+
const lib_avatar = require("./avatar.cjs");
|
|
34
|
+
require("./skeleton.cjs");
|
|
35
|
+
require("../chunks/icon_constants-QYpmdE0R.js");
|
|
36
|
+
require("@dialpad/dialtone-icons/icons.json");
|
|
37
|
+
require("emoji-regex");
|
|
38
|
+
require("emoji-toolkit/emoji_strategy.json");
|
|
39
|
+
require("../chunks/list_item_constants-EiqkqZvP.js");
|
|
40
|
+
require("./item-layout.cjs");
|
|
41
|
+
require("./icon.cjs");
|
|
42
|
+
require("@dialpad/dialtone-icons/vue2");
|
|
43
|
+
require("../chunks/stack_constants-SMzMWnAQ.js");
|
|
44
|
+
require("../common/constants.cjs");
|
|
45
|
+
require("vue");
|
|
46
|
+
require("../chunks/link_constants-Huj7D_hm.js");
|
|
47
|
+
require("./presence.cjs");
|
|
48
|
+
const _sfc_main$5 = {
|
|
49
|
+
name: "EmojiComponent",
|
|
50
|
+
components: {
|
|
51
|
+
NodeViewWrapper: vue2.NodeViewWrapper,
|
|
52
|
+
DtEmoji: lib_emoji.DtEmoji
|
|
53
|
+
},
|
|
54
|
+
props: vue2.nodeViewProps
|
|
55
|
+
};
|
|
56
|
+
var _sfc_render$5 = function render() {
|
|
57
|
+
var _vm = this, _c = _vm._self._c;
|
|
58
|
+
return _c("node-view-wrapper", { staticClass: "d-d-inline-block d-va-bottom d-lh0" }, [_c("dt-emoji", { attrs: { "size": "500", "code": _vm.node.attrs.code } })], 1);
|
|
59
|
+
};
|
|
60
|
+
var _sfc_staticRenderFns$5 = [];
|
|
61
|
+
var __component__$5 = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
62
|
+
_sfc_main$5,
|
|
63
|
+
_sfc_render$5,
|
|
64
|
+
_sfc_staticRenderFns$5,
|
|
65
|
+
false,
|
|
66
|
+
null,
|
|
67
|
+
null,
|
|
68
|
+
null,
|
|
69
|
+
null
|
|
70
|
+
);
|
|
71
|
+
const EmojiComponent = __component__$5.exports;
|
|
72
|
+
const _sfc_main$4 = {
|
|
73
|
+
name: "SuggestionList",
|
|
74
|
+
components: {
|
|
75
|
+
DtListItem: lib_listItem.DtListItem
|
|
76
|
+
},
|
|
77
|
+
props: {
|
|
78
|
+
items: {
|
|
79
|
+
type: Array,
|
|
80
|
+
required: true
|
|
81
|
+
},
|
|
82
|
+
command: {
|
|
83
|
+
type: Function,
|
|
84
|
+
required: true
|
|
85
|
+
},
|
|
86
|
+
itemComponent: {
|
|
87
|
+
type: Object,
|
|
88
|
+
required: true
|
|
89
|
+
},
|
|
90
|
+
itemType: {
|
|
91
|
+
type: String,
|
|
92
|
+
required: true
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
data() {
|
|
96
|
+
return {
|
|
97
|
+
selectedIndex: 0
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
watch: {
|
|
101
|
+
items() {
|
|
102
|
+
this.selectedIndex = 0;
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
onKeyDown({ event }) {
|
|
107
|
+
if (event.key === "ArrowUp") {
|
|
108
|
+
this.upHandler();
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
if (event.key === "ArrowDown") {
|
|
112
|
+
this.downHandler();
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
if (event.key === "Enter" || event.key === "Tab") {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
this.selectHandler();
|
|
118
|
+
event.stopPropagation();
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
},
|
|
123
|
+
upHandler() {
|
|
124
|
+
this.selectedIndex = (this.selectedIndex + this.items.length - 1) % this.items.length;
|
|
125
|
+
this.scrollActiveElementIntoView();
|
|
126
|
+
},
|
|
127
|
+
downHandler() {
|
|
128
|
+
this.selectedIndex = (this.selectedIndex + 1) % this.items.length;
|
|
129
|
+
this.scrollActiveElementIntoView();
|
|
130
|
+
},
|
|
131
|
+
scrollActiveElementIntoView() {
|
|
132
|
+
const activeElement = this.$refs.suggestionList.querySelector(".dt-list-item--highlighted");
|
|
133
|
+
if (activeElement) {
|
|
134
|
+
activeElement.scrollIntoView({
|
|
135
|
+
behaviour: "smooth",
|
|
136
|
+
block: "center"
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
selectHandler() {
|
|
141
|
+
this.selectItem(this.selectedIndex);
|
|
142
|
+
},
|
|
143
|
+
selectItem(index) {
|
|
144
|
+
const item = this.items[index];
|
|
145
|
+
switch (this.itemType) {
|
|
146
|
+
case "emoji":
|
|
147
|
+
this.command(item);
|
|
148
|
+
return;
|
|
149
|
+
case "mention":
|
|
150
|
+
this.command({ name: item.name, id: item.id, avatarSrc: item.avatarSrc });
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
var _sfc_render$4 = function render2() {
|
|
157
|
+
var _vm = this, _c = _vm._self._c;
|
|
158
|
+
return _c("div", { staticClass: "d-popover__dialog" }, [_c("ul", { directives: [{ name: "show", rawName: "v-show", value: _vm.items.length, expression: "items.length" }], ref: "suggestionList", staticClass: "dt-suggestion-list" }, _vm._l(_vm.items, function(item, index) {
|
|
159
|
+
return _c("dt-list-item", { key: item.id, class: [
|
|
160
|
+
"dt-suggestion-list--item",
|
|
161
|
+
{ "dt-list-item--highlighted": index === _vm.selectedIndex }
|
|
162
|
+
], attrs: { "navigation-type": "arrow-keys" }, on: { "click": function($event) {
|
|
163
|
+
return _vm.selectItem(index);
|
|
164
|
+
}, "keydown": function($event) {
|
|
165
|
+
$event.preventDefault();
|
|
166
|
+
$event.stopPropagation();
|
|
167
|
+
return _vm.onKeyDown.apply(null, arguments);
|
|
168
|
+
} } }, [_c(_vm.itemComponent, { tag: "component", attrs: { "item": item } })], 1);
|
|
169
|
+
}), 1)]);
|
|
170
|
+
};
|
|
171
|
+
var _sfc_staticRenderFns$4 = [];
|
|
172
|
+
var __component__$4 = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
173
|
+
_sfc_main$4,
|
|
174
|
+
_sfc_render$4,
|
|
175
|
+
_sfc_staticRenderFns$4,
|
|
176
|
+
false,
|
|
177
|
+
null,
|
|
178
|
+
null,
|
|
179
|
+
null,
|
|
180
|
+
null
|
|
181
|
+
);
|
|
182
|
+
const SuggestionList = __component__$4.exports;
|
|
183
|
+
const _sfc_main$3 = {
|
|
184
|
+
name: "EmojiSuggestion",
|
|
185
|
+
components: {
|
|
186
|
+
DtEmoji: lib_emoji.DtEmoji,
|
|
187
|
+
DtStack: lib_stack.DtStack
|
|
188
|
+
},
|
|
189
|
+
props: {
|
|
190
|
+
item: {
|
|
191
|
+
type: Object,
|
|
192
|
+
required: true
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
var _sfc_render$3 = function render3() {
|
|
197
|
+
var _vm = this, _c = _vm._self._c;
|
|
198
|
+
return _c("dt-stack", { attrs: { "direction": "row", "gap": "400" } }, [_c("dt-emoji", { attrs: { "size": "200", "code": _vm.item.code } }), _vm._v(" " + _vm._s(_vm.item.code) + " ")], 1);
|
|
199
|
+
};
|
|
200
|
+
var _sfc_staticRenderFns$3 = [];
|
|
201
|
+
var __component__$3 = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
202
|
+
_sfc_main$3,
|
|
203
|
+
_sfc_render$3,
|
|
204
|
+
_sfc_staticRenderFns$3,
|
|
205
|
+
false,
|
|
206
|
+
null,
|
|
207
|
+
null,
|
|
208
|
+
null,
|
|
209
|
+
null
|
|
210
|
+
);
|
|
211
|
+
const EmojiSuggestion = __component__$3.exports;
|
|
212
|
+
const suggestionOptions = {
|
|
213
|
+
items: ({ query }) => {
|
|
214
|
+
if (query.length < 2) {
|
|
215
|
+
return [];
|
|
216
|
+
}
|
|
217
|
+
const emojiList = Object.values(dialtoneEmojis.emojisIndexed);
|
|
218
|
+
const filteredEmoji = emojiList.filter(function(item) {
|
|
219
|
+
if (item.shortname.substring(1, item.shortname.length - 1).startsWith(query.toLowerCase())) {
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
return false;
|
|
223
|
+
});
|
|
224
|
+
return filteredEmoji.map((item) => {
|
|
225
|
+
return { id: item.unicode_character, code: item.shortname };
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
command: ({ editor, range, props }) => {
|
|
229
|
+
var _a, _b;
|
|
230
|
+
const nodeAfter = editor.view.state.selection.$to.nodeAfter;
|
|
231
|
+
const overrideSpace = (_a = nodeAfter == null ? void 0 : nodeAfter.text) == null ? void 0 : _a.startsWith(" ");
|
|
232
|
+
if (overrideSpace) {
|
|
233
|
+
range.to += 1;
|
|
234
|
+
}
|
|
235
|
+
editor.chain().focus().insertContentAt(range, [
|
|
236
|
+
{
|
|
237
|
+
type: "emoji",
|
|
238
|
+
attrs: props
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
type: "text",
|
|
242
|
+
text: " "
|
|
243
|
+
}
|
|
244
|
+
]).run();
|
|
245
|
+
(_b = window.getSelection()) == null ? void 0 : _b.collapseToEnd();
|
|
246
|
+
},
|
|
247
|
+
render: () => {
|
|
248
|
+
let component;
|
|
249
|
+
let popup;
|
|
250
|
+
return {
|
|
251
|
+
onStart: (props) => {
|
|
252
|
+
component = new vue2.VueRenderer(SuggestionList, {
|
|
253
|
+
parent: void 0,
|
|
254
|
+
propsData: {
|
|
255
|
+
itemComponent: EmojiSuggestion,
|
|
256
|
+
itemType: "emoji",
|
|
257
|
+
...props
|
|
258
|
+
},
|
|
259
|
+
editor: props.editor
|
|
260
|
+
});
|
|
261
|
+
if (!props.clientRect) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
popup = tippy("body", {
|
|
265
|
+
getReferenceClientRect: props.clientRect,
|
|
266
|
+
appendTo: () => document.body,
|
|
267
|
+
content: component.element,
|
|
268
|
+
showOnCreate: true,
|
|
269
|
+
interactive: true,
|
|
270
|
+
trigger: "manual",
|
|
271
|
+
placement: "top-start",
|
|
272
|
+
contentElement: null,
|
|
273
|
+
zIndex: 650
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
onUpdate(props) {
|
|
277
|
+
component.updateProps(props);
|
|
278
|
+
if (!props.clientRect) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
popup[0].setProps({
|
|
282
|
+
getReferenceClientRect: props.clientRect
|
|
283
|
+
});
|
|
284
|
+
},
|
|
285
|
+
onKeyDown(props) {
|
|
286
|
+
var _a;
|
|
287
|
+
if (props.event.key === "Escape") {
|
|
288
|
+
popup[0].hide();
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
return (_a = component.ref) == null ? void 0 : _a.onKeyDown(props);
|
|
292
|
+
},
|
|
293
|
+
onExit() {
|
|
294
|
+
popup[0].destroy();
|
|
295
|
+
component.destroy();
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
const EmojiPluginKey = new state.PluginKey("emoji");
|
|
301
|
+
const inputShortCodeRegex = /:\w+:$/;
|
|
302
|
+
const pasteShortCodeRegex = /:\w+:/g;
|
|
303
|
+
const inputUnicodeRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])$/;
|
|
304
|
+
const pasteUnicodeRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g;
|
|
305
|
+
const inputRuleMatch = (match) => {
|
|
306
|
+
if (match && common_emoji.codeToEmojiData(match[0])) {
|
|
307
|
+
return {
|
|
308
|
+
index: match.index,
|
|
309
|
+
text: match[0],
|
|
310
|
+
match
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
const shortCodePasteMatch = (text) => {
|
|
315
|
+
const matches = [...text.matchAll(pasteShortCodeRegex)];
|
|
316
|
+
return matches.filter((match) => common_emoji.codeToEmojiData(match[0])).map((match) => ({
|
|
317
|
+
index: match.index,
|
|
318
|
+
text: match[0],
|
|
319
|
+
match
|
|
320
|
+
}));
|
|
321
|
+
};
|
|
322
|
+
const Emoji = core.Node.create({
|
|
323
|
+
addOptions() {
|
|
324
|
+
return {
|
|
325
|
+
HTMLAttributes: {},
|
|
326
|
+
suggestion: {
|
|
327
|
+
char: ":",
|
|
328
|
+
pluginKey: EmojiPluginKey
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
},
|
|
332
|
+
name: "emoji",
|
|
333
|
+
group: "inline",
|
|
334
|
+
inline: true,
|
|
335
|
+
selectable: true,
|
|
336
|
+
addNodeView() {
|
|
337
|
+
return vue2.VueNodeViewRenderer(EmojiComponent);
|
|
338
|
+
},
|
|
339
|
+
addAttributes() {
|
|
340
|
+
return {
|
|
341
|
+
code: {
|
|
342
|
+
default: null
|
|
343
|
+
},
|
|
344
|
+
id: {
|
|
345
|
+
default: null
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
parseHTML() {
|
|
350
|
+
return [
|
|
351
|
+
{
|
|
352
|
+
tag: "emoji-component"
|
|
353
|
+
}
|
|
354
|
+
];
|
|
355
|
+
},
|
|
356
|
+
renderText({ node }) {
|
|
357
|
+
return node.attrs.code;
|
|
358
|
+
},
|
|
359
|
+
renderHTML({ HTMLAttributes }) {
|
|
360
|
+
return ["emoji-component", core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
|
|
361
|
+
},
|
|
362
|
+
addInputRules() {
|
|
363
|
+
return [
|
|
364
|
+
// shortcode input
|
|
365
|
+
core.nodeInputRule({
|
|
366
|
+
find: (text) => {
|
|
367
|
+
const match = text.match(inputShortCodeRegex);
|
|
368
|
+
return inputRuleMatch(match);
|
|
369
|
+
},
|
|
370
|
+
type: this.type,
|
|
371
|
+
getAttributes(attrs) {
|
|
372
|
+
return {
|
|
373
|
+
code: attrs[0]
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
}),
|
|
377
|
+
core.nodeInputRule({
|
|
378
|
+
find: (text) => {
|
|
379
|
+
const match = text.match(inputUnicodeRegex);
|
|
380
|
+
return inputRuleMatch(match);
|
|
381
|
+
},
|
|
382
|
+
type: this.type,
|
|
383
|
+
getAttributes(attrs) {
|
|
384
|
+
const unicode = common_emoji.shortcodeToEmojiData(attrs[0]).unicode_output;
|
|
385
|
+
const emoji = String.fromCodePoint(parseInt(unicode, 16));
|
|
386
|
+
return {
|
|
387
|
+
code: emoji,
|
|
388
|
+
label: "emoji"
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
})
|
|
392
|
+
];
|
|
393
|
+
},
|
|
394
|
+
addPasteRules() {
|
|
395
|
+
return [
|
|
396
|
+
core.nodePasteRule({
|
|
397
|
+
find: shortCodePasteMatch,
|
|
398
|
+
type: this.type,
|
|
399
|
+
getAttributes(attrs) {
|
|
400
|
+
return {
|
|
401
|
+
code: attrs[0]
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
}),
|
|
405
|
+
core.nodePasteRule({
|
|
406
|
+
find: pasteUnicodeRegex,
|
|
407
|
+
type: this.type,
|
|
408
|
+
getAttributes(attrs) {
|
|
409
|
+
return {
|
|
410
|
+
code: attrs[0]
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
})
|
|
414
|
+
];
|
|
415
|
+
},
|
|
416
|
+
addProseMirrorPlugins() {
|
|
417
|
+
return [
|
|
418
|
+
Suggestion({
|
|
419
|
+
editor: this.editor,
|
|
420
|
+
...this.options.suggestion,
|
|
421
|
+
...suggestionOptions
|
|
422
|
+
})
|
|
423
|
+
];
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
function getRegexMatches(text, regex, validator = () => true) {
|
|
427
|
+
const matches = [];
|
|
428
|
+
regex.lastIndex = 0;
|
|
429
|
+
let match;
|
|
430
|
+
while (match = regex.exec(text)) {
|
|
431
|
+
if (validator(text, match)) {
|
|
432
|
+
matches.push(match);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return matches;
|
|
436
|
+
}
|
|
437
|
+
function hasValidPrefix(text, match) {
|
|
438
|
+
return !["#", "@"].includes(text.charAt(match.index)) && !["#", "@"].includes(text.charAt(match.index - 1));
|
|
439
|
+
}
|
|
440
|
+
function trimEndPunctiation(string) {
|
|
441
|
+
const endPunctuationRegex = new RegExp(
|
|
442
|
+
"(?:" + [
|
|
443
|
+
`[!?.,:;'"]`,
|
|
444
|
+
"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"
|
|
445
|
+
].join("|"),
|
|
446
|
+
"g"
|
|
447
|
+
);
|
|
448
|
+
return string.replace(endPunctuationRegex, "");
|
|
449
|
+
}
|
|
450
|
+
function getWordAt(text, index) {
|
|
451
|
+
const left = text.slice(0, index + 1).search(/\S+\s*$/);
|
|
452
|
+
const right = text.slice(index).search(/\s/);
|
|
453
|
+
if (right < 0) {
|
|
454
|
+
const word = text.slice(left);
|
|
455
|
+
return {
|
|
456
|
+
text: word,
|
|
457
|
+
from: left,
|
|
458
|
+
to: left + word.length
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
return {
|
|
462
|
+
text: text.slice(left, right + index),
|
|
463
|
+
from: left,
|
|
464
|
+
to: right + index
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
function getWordAtUntil(text, index, direction, regex) {
|
|
468
|
+
const word = getWordAt(text, index);
|
|
469
|
+
regex.lastIndex = 0;
|
|
470
|
+
if (!regex.test(word.text)) {
|
|
471
|
+
return word;
|
|
472
|
+
}
|
|
473
|
+
const newIndex = direction === "left" ? word.from - 1 : word.to + 1;
|
|
474
|
+
if (newIndex <= 0 || newIndex >= text.length || newIndex === index) {
|
|
475
|
+
return word;
|
|
476
|
+
}
|
|
477
|
+
return getWordAtUntil(text, newIndex, direction, regex);
|
|
478
|
+
}
|
|
479
|
+
function removeMarks(range, doc, tr, type) {
|
|
480
|
+
const from = Math.max(range.from - 1, 0);
|
|
481
|
+
const to = Math.min(range.to + 1, doc.content.size);
|
|
482
|
+
const marksInRange = core.getMarksBetween(from, to, doc);
|
|
483
|
+
for (const mark of marksInRange) {
|
|
484
|
+
if (mark.mark.type !== type) {
|
|
485
|
+
continue;
|
|
486
|
+
}
|
|
487
|
+
tr.removeMark(mark.from, mark.to, type);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
const partialPhoneNumberRegex = common_utils.getPhoneNumberRegex(1, 15);
|
|
491
|
+
function addMarks(text, pos, from, to, tr, type) {
|
|
492
|
+
if (!text) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
let rangeFrom = from - pos - 1;
|
|
496
|
+
rangeFrom = rangeFrom < 0 ? 0 : rangeFrom;
|
|
497
|
+
const rangeTo = to - pos;
|
|
498
|
+
const firstWordInRange = getWordAtUntil(
|
|
499
|
+
text,
|
|
500
|
+
rangeFrom,
|
|
501
|
+
"left",
|
|
502
|
+
partialPhoneNumberRegex
|
|
503
|
+
);
|
|
504
|
+
const lastWordInRange = getWordAtUntil(
|
|
505
|
+
text,
|
|
506
|
+
rangeTo,
|
|
507
|
+
"right",
|
|
508
|
+
partialPhoneNumberRegex
|
|
509
|
+
);
|
|
510
|
+
const wordsInRange = text.slice(firstWordInRange.from, lastWordInRange.to);
|
|
511
|
+
const matches = getRegexMatches(wordsInRange, common_utils.linkRegex, hasValidPrefix);
|
|
512
|
+
matches.forEach((match) => {
|
|
513
|
+
const word = trimEndPunctiation(match[0]);
|
|
514
|
+
const from2 = pos + firstWordInRange.from + match.index + 1;
|
|
515
|
+
const to2 = from2 + word.length;
|
|
516
|
+
tr.addMark(from2, to2, type.create());
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
function autolink(options) {
|
|
520
|
+
let hasInitialized = false;
|
|
521
|
+
return new state.Plugin({
|
|
522
|
+
key: new state.PluginKey("autolink"),
|
|
523
|
+
appendTransaction: (transactions, oldState, newState) => {
|
|
524
|
+
const contentChanged = transactions.some((tr2) => tr2.docChanged) && !oldState.doc.eq(newState.doc);
|
|
525
|
+
if (hasInitialized && !contentChanged) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
const { tr } = newState;
|
|
529
|
+
const { textContent } = newState.doc;
|
|
530
|
+
if (!hasInitialized) {
|
|
531
|
+
addMarks(textContent, 0, 0, textContent.length, tr, options.type);
|
|
532
|
+
}
|
|
533
|
+
hasInitialized = true;
|
|
534
|
+
const transform = core.combineTransactionSteps(
|
|
535
|
+
oldState.doc,
|
|
536
|
+
[...transactions]
|
|
537
|
+
);
|
|
538
|
+
const changes = core.getChangedRanges(transform);
|
|
539
|
+
changes.forEach(({ oldRange, newRange }) => {
|
|
540
|
+
removeMarks(newRange, newState.doc, tr, options.type);
|
|
541
|
+
const paragraphs = core.findChildrenInRange(
|
|
542
|
+
newState.doc,
|
|
543
|
+
newRange,
|
|
544
|
+
(node) => node.isTextblock
|
|
545
|
+
);
|
|
546
|
+
paragraphs.forEach(({ node, pos }) => {
|
|
547
|
+
addMarks(
|
|
548
|
+
node.textContent,
|
|
549
|
+
pos,
|
|
550
|
+
oldRange.from,
|
|
551
|
+
newRange.to,
|
|
552
|
+
tr,
|
|
553
|
+
options.type
|
|
554
|
+
);
|
|
555
|
+
});
|
|
556
|
+
});
|
|
557
|
+
return tr;
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
const defaultAttributes = {
|
|
562
|
+
class: "d-link d-c-text d-d-inline-block",
|
|
563
|
+
rel: "noopener noreferrer nofollow"
|
|
564
|
+
};
|
|
565
|
+
const Link = core.Mark.create({
|
|
566
|
+
name: "Link",
|
|
567
|
+
renderHTML({ HTMLAttributes }) {
|
|
568
|
+
return [
|
|
569
|
+
"a",
|
|
570
|
+
core.mergeAttributes(
|
|
571
|
+
this.options.HTMLAttributes,
|
|
572
|
+
HTMLAttributes,
|
|
573
|
+
defaultAttributes
|
|
574
|
+
),
|
|
575
|
+
0
|
|
576
|
+
];
|
|
577
|
+
},
|
|
578
|
+
renderText({ node }) {
|
|
579
|
+
return node.attrs.text;
|
|
580
|
+
},
|
|
581
|
+
addProseMirrorPlugins() {
|
|
582
|
+
return [
|
|
583
|
+
autolink({ type: this.type })
|
|
584
|
+
];
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
const _sfc_main$2 = {
|
|
588
|
+
name: "MentionComponent",
|
|
589
|
+
components: {
|
|
590
|
+
NodeViewWrapper: vue2.NodeViewWrapper,
|
|
591
|
+
DtLink: lib_link.DtLink
|
|
592
|
+
},
|
|
593
|
+
props: vue2.nodeViewProps,
|
|
594
|
+
computed: {
|
|
595
|
+
text() {
|
|
596
|
+
return "@" + this.$props.node.attrs.name;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
var _sfc_render$2 = function render4() {
|
|
601
|
+
var _vm = this, _c = _vm._self._c;
|
|
602
|
+
return _c("node-view-wrapper", { staticClass: "d-d-inline-block" }, [_c("dt-link", { attrs: { "kind": "mention" } }, [_vm._v(" " + _vm._s(_vm.text) + " ")])], 1);
|
|
603
|
+
};
|
|
604
|
+
var _sfc_staticRenderFns$2 = [];
|
|
605
|
+
var __component__$2 = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
606
|
+
_sfc_main$2,
|
|
607
|
+
_sfc_render$2,
|
|
608
|
+
_sfc_staticRenderFns$2,
|
|
609
|
+
false,
|
|
610
|
+
null,
|
|
611
|
+
null,
|
|
612
|
+
null,
|
|
613
|
+
null
|
|
614
|
+
);
|
|
615
|
+
const MentionComponent = __component__$2.exports;
|
|
616
|
+
const MentionPlugin = Mention.extend({
|
|
617
|
+
addNodeView() {
|
|
618
|
+
return vue2.VueNodeViewRenderer(MentionComponent);
|
|
619
|
+
},
|
|
620
|
+
parseHTML() {
|
|
621
|
+
return [
|
|
622
|
+
{
|
|
623
|
+
tag: "mention-component"
|
|
624
|
+
}
|
|
625
|
+
];
|
|
626
|
+
},
|
|
627
|
+
addAttributes() {
|
|
628
|
+
return {
|
|
629
|
+
name: {
|
|
630
|
+
default: ""
|
|
631
|
+
},
|
|
632
|
+
avatarSrc: {
|
|
633
|
+
default: ""
|
|
634
|
+
},
|
|
635
|
+
id: {
|
|
636
|
+
default: ""
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
},
|
|
640
|
+
renderText({ node }) {
|
|
641
|
+
return `@${node.attrs.id}`;
|
|
642
|
+
},
|
|
643
|
+
renderHTML({ HTMLAttributes }) {
|
|
644
|
+
return ["mention-component", core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
const RICH_TEXT_EDITOR_OUTPUT_FORMATS = [
|
|
648
|
+
"text",
|
|
649
|
+
"json",
|
|
650
|
+
"html"
|
|
651
|
+
];
|
|
652
|
+
const RICH_TEXT_EDITOR_AUTOFOCUS_TYPES = [
|
|
653
|
+
"start",
|
|
654
|
+
"end",
|
|
655
|
+
"all"
|
|
656
|
+
];
|
|
657
|
+
const RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS = [
|
|
658
|
+
"https",
|
|
659
|
+
"http",
|
|
660
|
+
"ftp",
|
|
661
|
+
"ftps",
|
|
662
|
+
"sftp",
|
|
663
|
+
"mailto"
|
|
664
|
+
];
|
|
665
|
+
const _sfc_main$1 = {
|
|
666
|
+
name: "MentionSuggestion",
|
|
667
|
+
components: {
|
|
668
|
+
DtAvatar: lib_avatar.DtAvatar,
|
|
669
|
+
DtStack: lib_stack.DtStack
|
|
670
|
+
},
|
|
671
|
+
props: {
|
|
672
|
+
item: {
|
|
673
|
+
type: Object,
|
|
674
|
+
required: true
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
computed: {
|
|
678
|
+
name() {
|
|
679
|
+
return this.item.name;
|
|
680
|
+
},
|
|
681
|
+
avatarSrc() {
|
|
682
|
+
return this.item.avatarSrc;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
var _sfc_render$1 = function render5() {
|
|
687
|
+
var _vm = this, _c = _vm._self._c;
|
|
688
|
+
return _c("dt-stack", { attrs: { "direction": "row", "gap": "400" } }, [_c("dt-avatar", { attrs: { "full-name": _vm.name, "image-src": _vm.avatarSrc, "image-alt": _vm.name, "size": "xs" } }), _vm._v(" " + _vm._s(_vm.name) + " ")], 1);
|
|
689
|
+
};
|
|
690
|
+
var _sfc_staticRenderFns$1 = [];
|
|
691
|
+
var __component__$1 = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
692
|
+
_sfc_main$1,
|
|
693
|
+
_sfc_render$1,
|
|
694
|
+
_sfc_staticRenderFns$1,
|
|
695
|
+
false,
|
|
696
|
+
null,
|
|
697
|
+
null,
|
|
698
|
+
null,
|
|
699
|
+
null
|
|
700
|
+
);
|
|
701
|
+
const MentionSuggestion = __component__$1.exports;
|
|
702
|
+
const suggestion = {
|
|
703
|
+
// This function comes from the user and passed to the editor directly.
|
|
704
|
+
// This will also activate the mention plugin on the editor
|
|
705
|
+
// items: ({ query }) => { return [] },
|
|
706
|
+
allowSpaces: true,
|
|
707
|
+
render: () => {
|
|
708
|
+
let component;
|
|
709
|
+
let popup;
|
|
710
|
+
return {
|
|
711
|
+
onStart: (props) => {
|
|
712
|
+
component = new vue2.VueRenderer(SuggestionList, {
|
|
713
|
+
parent: void 0,
|
|
714
|
+
propsData: {
|
|
715
|
+
itemComponent: MentionSuggestion,
|
|
716
|
+
itemType: "mention",
|
|
717
|
+
...props
|
|
718
|
+
},
|
|
719
|
+
editor: props.editor
|
|
720
|
+
});
|
|
721
|
+
if (!props.clientRect) {
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
popup = tippy("body", {
|
|
725
|
+
getReferenceClientRect: props.clientRect,
|
|
726
|
+
appendTo: () => document.body,
|
|
727
|
+
content: component.element,
|
|
728
|
+
showOnCreate: true,
|
|
729
|
+
interactive: true,
|
|
730
|
+
trigger: "manual",
|
|
731
|
+
placement: "top-start"
|
|
732
|
+
});
|
|
733
|
+
},
|
|
734
|
+
onUpdate(props) {
|
|
735
|
+
component.updateProps(props);
|
|
736
|
+
if (!props.clientRect) {
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
popup[0].setProps({
|
|
740
|
+
getReferenceClientRect: props.clientRect
|
|
741
|
+
});
|
|
742
|
+
},
|
|
743
|
+
onKeyDown(props) {
|
|
744
|
+
if (props.event.key === "Escape") {
|
|
745
|
+
popup[0].hide();
|
|
746
|
+
return true;
|
|
747
|
+
}
|
|
748
|
+
return component == null ? void 0 : component.ref.onKeyDown(props);
|
|
749
|
+
},
|
|
750
|
+
onExit() {
|
|
751
|
+
popup[0].destroy();
|
|
752
|
+
component.destroy();
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
const _sfc_main = {
|
|
758
|
+
name: "DtRichTextEditor",
|
|
759
|
+
components: {
|
|
760
|
+
EditorContent: vue2.EditorContent
|
|
761
|
+
},
|
|
762
|
+
props: {
|
|
763
|
+
/**
|
|
764
|
+
* Value of the input. The object format should match TipTap's JSON
|
|
765
|
+
* document structure: https://tiptap.dev/guide/output#option-1-json
|
|
766
|
+
*/
|
|
767
|
+
value: {
|
|
768
|
+
type: [Object, String],
|
|
769
|
+
default: ""
|
|
770
|
+
},
|
|
771
|
+
/**
|
|
772
|
+
* Whether the input is editable
|
|
773
|
+
*/
|
|
774
|
+
editable: {
|
|
775
|
+
type: Boolean,
|
|
776
|
+
default: true
|
|
777
|
+
},
|
|
778
|
+
/**
|
|
779
|
+
* Whether the input allows for line breaks to be introduced in the text.
|
|
780
|
+
*/
|
|
781
|
+
allowLineBreaks: {
|
|
782
|
+
type: Boolean,
|
|
783
|
+
default: false
|
|
784
|
+
},
|
|
785
|
+
/**
|
|
786
|
+
* Descriptive label for the input element
|
|
787
|
+
*/
|
|
788
|
+
inputAriaLabel: {
|
|
789
|
+
type: String,
|
|
790
|
+
required: true
|
|
791
|
+
},
|
|
792
|
+
/**
|
|
793
|
+
* Additional class name for the input element. Only accepts a String value
|
|
794
|
+
* because this is passed to the editor via options. For multiple classes,
|
|
795
|
+
* join them into one string, e.g. "d-p8 d-hmx96"
|
|
796
|
+
*/
|
|
797
|
+
inputClass: {
|
|
798
|
+
type: String,
|
|
799
|
+
default: ""
|
|
800
|
+
},
|
|
801
|
+
/**
|
|
802
|
+
* Whether the input should receive focus after the component has been
|
|
803
|
+
* mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.
|
|
804
|
+
* - `start` Sets the focus to the beginning of the input
|
|
805
|
+
* - `end` Sets the focus to the end of the input
|
|
806
|
+
* - `all` Selects the whole contents of the input
|
|
807
|
+
* - `Number` Sets the focus to a specific position in the input
|
|
808
|
+
* - `true` Defaults to `start`
|
|
809
|
+
* - `false` Disables autofocus
|
|
810
|
+
* @values true, false, start, end, all, number
|
|
811
|
+
*/
|
|
812
|
+
autoFocus: {
|
|
813
|
+
type: [Boolean, String, Number],
|
|
814
|
+
default: false,
|
|
815
|
+
validator(autoFocus) {
|
|
816
|
+
if (typeof autoFocus === "string") {
|
|
817
|
+
return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);
|
|
818
|
+
}
|
|
819
|
+
return true;
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
/**
|
|
823
|
+
* The output format that the editor uses when emitting the "@input" event.
|
|
824
|
+
* One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for
|
|
825
|
+
* examples.
|
|
826
|
+
* @values text, json, html
|
|
827
|
+
*/
|
|
828
|
+
outputFormat: {
|
|
829
|
+
type: String,
|
|
830
|
+
default: "text",
|
|
831
|
+
validator(outputFormat) {
|
|
832
|
+
return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
/**
|
|
836
|
+
* Placeholder text
|
|
837
|
+
*/
|
|
838
|
+
placeholder: {
|
|
839
|
+
type: String,
|
|
840
|
+
default: ""
|
|
841
|
+
},
|
|
842
|
+
/**
|
|
843
|
+
* Enables the Link extension and optionally passes configurations to it
|
|
844
|
+
*/
|
|
845
|
+
link: {
|
|
846
|
+
type: [Boolean, Object],
|
|
847
|
+
default: false
|
|
848
|
+
},
|
|
849
|
+
/**
|
|
850
|
+
* suggestion object containing the items query function.
|
|
851
|
+
* The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion
|
|
852
|
+
*
|
|
853
|
+
* The only required key is the items function which is used to query the contacts for suggestion.
|
|
854
|
+
* items({ query }) => { return [ContactObject]; }
|
|
855
|
+
* ContactObject format:
|
|
856
|
+
* { name: string, avatarSrc: string, id: string }
|
|
857
|
+
*
|
|
858
|
+
* When null, it does not add the plugin.
|
|
859
|
+
*/
|
|
860
|
+
mentionSuggestion: {
|
|
861
|
+
type: Object,
|
|
862
|
+
default: null
|
|
863
|
+
},
|
|
864
|
+
/**
|
|
865
|
+
* Whether the input allows for block quote.
|
|
866
|
+
*/
|
|
867
|
+
allowBlockquote: {
|
|
868
|
+
type: Boolean,
|
|
869
|
+
default: true
|
|
870
|
+
},
|
|
871
|
+
/**
|
|
872
|
+
* Whether the input allows for bold to be introduced in the text.
|
|
873
|
+
*/
|
|
874
|
+
allowBold: {
|
|
875
|
+
type: Boolean,
|
|
876
|
+
default: true
|
|
877
|
+
},
|
|
878
|
+
/**
|
|
879
|
+
* Whether the input allows for bullet list to be introduced in the text.
|
|
880
|
+
*/
|
|
881
|
+
allowBulletList: {
|
|
882
|
+
type: Boolean,
|
|
883
|
+
default: true
|
|
884
|
+
},
|
|
885
|
+
/**
|
|
886
|
+
* Whether the input allows for italic to be introduced in the text.
|
|
887
|
+
*/
|
|
888
|
+
allowItalic: {
|
|
889
|
+
type: Boolean,
|
|
890
|
+
default: true
|
|
891
|
+
},
|
|
892
|
+
/**
|
|
893
|
+
* Whether the input allows for strike to be introduced in the text.
|
|
894
|
+
*/
|
|
895
|
+
allowStrike: {
|
|
896
|
+
type: Boolean,
|
|
897
|
+
default: true
|
|
898
|
+
},
|
|
899
|
+
/**
|
|
900
|
+
* Whether the input allows for underline to be introduced in the text.
|
|
901
|
+
*/
|
|
902
|
+
allowUnderline: {
|
|
903
|
+
type: Boolean,
|
|
904
|
+
default: true
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
emits: [
|
|
908
|
+
/**
|
|
909
|
+
* Editor input event
|
|
910
|
+
* @event input
|
|
911
|
+
* @type {String|JSON}
|
|
912
|
+
*/
|
|
913
|
+
"input",
|
|
914
|
+
/**
|
|
915
|
+
* Event to sync the value with the parent
|
|
916
|
+
* @event input
|
|
917
|
+
* @type {String|JSON}
|
|
918
|
+
*/
|
|
919
|
+
"update:value",
|
|
920
|
+
/**
|
|
921
|
+
* Editor blur event
|
|
922
|
+
* @event blur
|
|
923
|
+
* @type {FocusEvent}
|
|
924
|
+
*/
|
|
925
|
+
"blur",
|
|
926
|
+
/**
|
|
927
|
+
* Editor focus event
|
|
928
|
+
* @event focus
|
|
929
|
+
* @type {FocusEvent}
|
|
930
|
+
*/
|
|
931
|
+
"focus"
|
|
932
|
+
],
|
|
933
|
+
data() {
|
|
934
|
+
return {
|
|
935
|
+
editor: null,
|
|
936
|
+
popoverOpened: false
|
|
937
|
+
};
|
|
938
|
+
},
|
|
939
|
+
computed: {
|
|
940
|
+
// eslint-disable-next-line complexity
|
|
941
|
+
extensions() {
|
|
942
|
+
const extensions = [Document, Paragraph, Text];
|
|
943
|
+
if (this.link) {
|
|
944
|
+
extensions.push(this.getExtension(Link, this.link));
|
|
945
|
+
}
|
|
946
|
+
if (this.allowBlockquote) {
|
|
947
|
+
extensions.push(Blockquote);
|
|
948
|
+
}
|
|
949
|
+
if (this.allowBold) {
|
|
950
|
+
extensions.push(Bold);
|
|
951
|
+
}
|
|
952
|
+
if (this.allowBulletList) {
|
|
953
|
+
extensions.push(BulletList);
|
|
954
|
+
extensions.push(ListItem);
|
|
955
|
+
extensions.push(OrderedList.configure({
|
|
956
|
+
itemTypeName: "listItem"
|
|
957
|
+
}));
|
|
958
|
+
}
|
|
959
|
+
if (this.allowItalic) {
|
|
960
|
+
extensions.push(Italic);
|
|
961
|
+
}
|
|
962
|
+
if (this.allowStrike) {
|
|
963
|
+
extensions.push(Strike);
|
|
964
|
+
}
|
|
965
|
+
if (this.allowUnderline) {
|
|
966
|
+
extensions.push(Underline);
|
|
967
|
+
}
|
|
968
|
+
extensions.push(
|
|
969
|
+
Placeholder.configure({ placeholder: this.placeholder })
|
|
970
|
+
);
|
|
971
|
+
if (!this.allowLineBreaks) {
|
|
972
|
+
extensions.push(
|
|
973
|
+
HardBreak.extend({
|
|
974
|
+
addKeyboardShortcuts() {
|
|
975
|
+
return {
|
|
976
|
+
Enter: () => true,
|
|
977
|
+
"Shift-Enter": () => this.editor.commands.first(({ commands }) => [
|
|
978
|
+
() => commands.newlineInCode(),
|
|
979
|
+
() => commands.createParagraphNear(),
|
|
980
|
+
() => commands.liftEmptyBlock(),
|
|
981
|
+
() => commands.splitBlock()
|
|
982
|
+
])
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
})
|
|
986
|
+
);
|
|
987
|
+
}
|
|
988
|
+
extensions.push(TipTapLink.extend({ inclusive: false }).configure({
|
|
989
|
+
autolink: true,
|
|
990
|
+
protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS
|
|
991
|
+
}));
|
|
992
|
+
if (this.mentionSuggestion) {
|
|
993
|
+
const suggestionObject = { ...this.mentionSuggestion, ...suggestion };
|
|
994
|
+
extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));
|
|
995
|
+
}
|
|
996
|
+
extensions.push(Emoji);
|
|
997
|
+
extensions.push(TextAlign.configure({
|
|
998
|
+
types: ["paragraph"],
|
|
999
|
+
defaultAlignment: "left"
|
|
1000
|
+
}));
|
|
1001
|
+
extensions.push(CodeBlock.configure({
|
|
1002
|
+
HTMLAttributes: {
|
|
1003
|
+
class: "dt-rich-text-editor--code-block"
|
|
1004
|
+
}
|
|
1005
|
+
}));
|
|
1006
|
+
return extensions;
|
|
1007
|
+
},
|
|
1008
|
+
inputAttrs() {
|
|
1009
|
+
const attrs = {
|
|
1010
|
+
"aria-label": this.inputAriaLabel,
|
|
1011
|
+
"aria-multiline": true,
|
|
1012
|
+
role: "textbox"
|
|
1013
|
+
};
|
|
1014
|
+
if (!this.editable) {
|
|
1015
|
+
attrs["aria-readonly"] = true;
|
|
1016
|
+
}
|
|
1017
|
+
return attrs;
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
/**
|
|
1021
|
+
* Because the Editor instance is initialized when mounted it does not get
|
|
1022
|
+
* updated props automatically, so the ones that can change after mount have
|
|
1023
|
+
* to be hooked up to the Editor's own API.
|
|
1024
|
+
*/
|
|
1025
|
+
watch: {
|
|
1026
|
+
editable(isEditable) {
|
|
1027
|
+
this.editor.setEditable(isEditable);
|
|
1028
|
+
this.updateEditorAttributes({ "aria-readonly": !isEditable });
|
|
1029
|
+
},
|
|
1030
|
+
inputClass(newClass) {
|
|
1031
|
+
this.updateEditorAttributes({ class: newClass });
|
|
1032
|
+
},
|
|
1033
|
+
inputAriaLabel(newLabel) {
|
|
1034
|
+
this.updateEditorAttributes({ "aria-label": newLabel });
|
|
1035
|
+
},
|
|
1036
|
+
extensions() {
|
|
1037
|
+
this.destroyEditor();
|
|
1038
|
+
this.createEditor();
|
|
1039
|
+
},
|
|
1040
|
+
value(newValue) {
|
|
1041
|
+
let currentValue = this.getOutput();
|
|
1042
|
+
if (this.outputFormat === "json") {
|
|
1043
|
+
newValue = JSON.stringify(newValue);
|
|
1044
|
+
currentValue = JSON.stringify(currentValue);
|
|
1045
|
+
}
|
|
1046
|
+
if (newValue === currentValue) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
this.editor.commands.setContent(newValue, false);
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
created() {
|
|
1053
|
+
this.createEditor();
|
|
1054
|
+
},
|
|
1055
|
+
beforeUnmount() {
|
|
1056
|
+
this.destroyEditor();
|
|
1057
|
+
},
|
|
1058
|
+
methods: {
|
|
1059
|
+
createEditor() {
|
|
1060
|
+
this.editor = new vue2.Editor({
|
|
1061
|
+
autofocus: this.autoFocus,
|
|
1062
|
+
content: this.value,
|
|
1063
|
+
editable: this.editable,
|
|
1064
|
+
extensions: this.extensions,
|
|
1065
|
+
editorProps: {
|
|
1066
|
+
attributes: {
|
|
1067
|
+
...this.inputAttrs,
|
|
1068
|
+
class: this.inputClass
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
this.addEditorListeners();
|
|
1073
|
+
},
|
|
1074
|
+
destroyEditor() {
|
|
1075
|
+
this.editor.destroy();
|
|
1076
|
+
},
|
|
1077
|
+
/**
|
|
1078
|
+
* The Editor exposes event hooks that we have to map our emits into. See
|
|
1079
|
+
* https://tiptap.dev/api/events for all events.
|
|
1080
|
+
*/
|
|
1081
|
+
addEditorListeners() {
|
|
1082
|
+
this.editor.on("update", () => {
|
|
1083
|
+
const value = this.getOutput();
|
|
1084
|
+
this.$emit("input", value);
|
|
1085
|
+
this.$emit("update:value", value);
|
|
1086
|
+
});
|
|
1087
|
+
this.editor.on("focus", ({ event }) => {
|
|
1088
|
+
this.$emit("focus", event);
|
|
1089
|
+
});
|
|
1090
|
+
this.editor.on("blur", ({ event }) => {
|
|
1091
|
+
this.$emit("blur", event);
|
|
1092
|
+
});
|
|
1093
|
+
},
|
|
1094
|
+
getOutput() {
|
|
1095
|
+
switch (this.outputFormat) {
|
|
1096
|
+
case "json":
|
|
1097
|
+
return this.editor.getJSON();
|
|
1098
|
+
case "html":
|
|
1099
|
+
return this.editor.getHTML();
|
|
1100
|
+
case "text":
|
|
1101
|
+
default:
|
|
1102
|
+
return this.editor.getText();
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
getExtension(extension, options) {
|
|
1106
|
+
var _a;
|
|
1107
|
+
if (typeof options === "boolean") {
|
|
1108
|
+
return extension;
|
|
1109
|
+
}
|
|
1110
|
+
return (_a = extension.configure) == null ? void 0 : _a.call(extension, options);
|
|
1111
|
+
},
|
|
1112
|
+
updateEditorAttributes(attributes) {
|
|
1113
|
+
this.editor.setOptions({ editorProps: { attributes } });
|
|
1114
|
+
},
|
|
1115
|
+
focusEditor() {
|
|
1116
|
+
this.editor.commands.focus();
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
var _sfc_render = function render6() {
|
|
1121
|
+
var _vm = this, _c = _vm._self._c;
|
|
1122
|
+
return _c("editor-content", { staticClass: "dt-rich-text-editor", attrs: { "editor": _vm.editor, "data-qa": "dt-rich-text-editor" } });
|
|
1123
|
+
};
|
|
1124
|
+
var _sfc_staticRenderFns = [];
|
|
1125
|
+
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
1126
|
+
_sfc_main,
|
|
1127
|
+
_sfc_render,
|
|
1128
|
+
_sfc_staticRenderFns,
|
|
1129
|
+
false,
|
|
1130
|
+
null,
|
|
1131
|
+
null,
|
|
1132
|
+
null,
|
|
1133
|
+
null
|
|
1134
|
+
);
|
|
1135
|
+
const DtRichTextEditor = __component__.exports;
|
|
1136
|
+
exports.DtRichTextEditor = DtRichTextEditor;
|
|
1137
|
+
exports.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES = RICH_TEXT_EDITOR_AUTOFOCUS_TYPES;
|
|
1138
|
+
exports.RICH_TEXT_EDITOR_OUTPUT_FORMATS = RICH_TEXT_EDITOR_OUTPUT_FORMATS;
|
|
2
1139
|
//# sourceMappingURL=rich-text-editor.cjs.map
|