@dialpad/dialtone-vue 2.127.0 → 2.127.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/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-eJ-WWRdf.js +442 -0
- package/dist/chunks/{index-2jPosQBn.js.map → index-eJ-WWRdf.js.map} +1 -1
- package/dist/chunks/index-gj1jEXP4.js +441 -0
- package/dist/chunks/{index-nIyl_PL6.js.map → index-gj1jEXP4.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,89 +1,93 @@
|
|
|
1
|
-
import { NodeViewWrapper
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { Node
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import "
|
|
32
|
-
import "emoji-toolkit/emoji_strategy.json";
|
|
1
|
+
import { NodeViewWrapper, nodeViewProps, VueRenderer, VueNodeViewRenderer, EditorContent, Editor } from "@tiptap/vue-2";
|
|
2
|
+
import Blockquote from "@tiptap/extension-blockquote";
|
|
3
|
+
import CodeBlock from "@tiptap/extension-code-block";
|
|
4
|
+
import Document from "@tiptap/extension-document";
|
|
5
|
+
import HardBreak from "@tiptap/extension-hard-break";
|
|
6
|
+
import Paragraph from "@tiptap/extension-paragraph";
|
|
7
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
8
|
+
import Bold from "@tiptap/extension-bold";
|
|
9
|
+
import BulletList from "@tiptap/extension-bullet-list";
|
|
10
|
+
import Italic from "@tiptap/extension-italic";
|
|
11
|
+
import TipTapLink from "@tiptap/extension-link";
|
|
12
|
+
import ListItem from "@tiptap/extension-list-item";
|
|
13
|
+
import OrderedList from "@tiptap/extension-ordered-list";
|
|
14
|
+
import Strike from "@tiptap/extension-strike";
|
|
15
|
+
import Underline from "@tiptap/extension-underline";
|
|
16
|
+
import Text from "@tiptap/extension-text";
|
|
17
|
+
import TextAlign from "@tiptap/extension-text-align";
|
|
18
|
+
import { Node, mergeAttributes, nodeInputRule, nodePasteRule, getMarksBetween, combineTransactionSteps, getChangedRanges, findChildrenInRange, Mark } from "@tiptap/core";
|
|
19
|
+
import { normalizeComponent } from "../chunks/_plugin-vue2_normalizer-sOSkiPF3.js";
|
|
20
|
+
import { DtEmoji } from "./emoji.js";
|
|
21
|
+
import { shortcodeToEmojiData, codeToEmojiData } from "../common/emoji.js";
|
|
22
|
+
import { PluginKey, Plugin } from "@tiptap/pm/state";
|
|
23
|
+
import Suggestion from "@tiptap/suggestion";
|
|
24
|
+
import { emojisIndexed } from "@dialpad/dialtone-emojis";
|
|
25
|
+
import { DtListItem } from "./list-item.js";
|
|
26
|
+
import { DtStack } from "./stack.js";
|
|
27
|
+
import tippy from "tippy.js";
|
|
28
|
+
import { linkRegex, getPhoneNumberRegex } from "../common/utils.js";
|
|
29
|
+
import Mention from "@tiptap/extension-mention";
|
|
30
|
+
import { DtLink } from "./link.js";
|
|
31
|
+
import { DtAvatar } from "./avatar.js";
|
|
33
32
|
import "./skeleton.js";
|
|
34
|
-
import "../chunks/icon_constants-
|
|
33
|
+
import "../chunks/icon_constants-Dy4MEUJL.js";
|
|
35
34
|
import "@dialpad/dialtone-icons/icons.json";
|
|
36
|
-
import "
|
|
35
|
+
import "emoji-regex";
|
|
36
|
+
import "emoji-toolkit/emoji_strategy.json";
|
|
37
|
+
import "../chunks/list_item_constants-u1xcN9Dd.js";
|
|
37
38
|
import "./item-layout.js";
|
|
38
39
|
import "./icon.js";
|
|
39
40
|
import "@dialpad/dialtone-icons/vue2";
|
|
40
|
-
import "../chunks/stack_constants-
|
|
41
|
-
import "
|
|
41
|
+
import "../chunks/stack_constants-HraCekPm.js";
|
|
42
|
+
import "../common/constants.js";
|
|
42
43
|
import "vue";
|
|
43
|
-
import "../chunks/link_constants-
|
|
44
|
+
import "../chunks/link_constants-nWVlXQBs.js";
|
|
44
45
|
import "./presence.js";
|
|
45
|
-
const
|
|
46
|
+
const _sfc_main$5 = {
|
|
46
47
|
name: "EmojiComponent",
|
|
47
48
|
components: {
|
|
48
|
-
NodeViewWrapper
|
|
49
|
-
DtEmoji
|
|
49
|
+
NodeViewWrapper,
|
|
50
|
+
DtEmoji
|
|
50
51
|
},
|
|
51
|
-
props:
|
|
52
|
+
props: nodeViewProps
|
|
53
|
+
};
|
|
54
|
+
var _sfc_render$5 = function render() {
|
|
55
|
+
var _vm = this, _c = _vm._self._c;
|
|
56
|
+
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);
|
|
52
57
|
};
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
gt,
|
|
60
|
-
!1,
|
|
58
|
+
var _sfc_staticRenderFns$5 = [];
|
|
59
|
+
var __component__$5 = /* @__PURE__ */ normalizeComponent(
|
|
60
|
+
_sfc_main$5,
|
|
61
|
+
_sfc_render$5,
|
|
62
|
+
_sfc_staticRenderFns$5,
|
|
63
|
+
false,
|
|
61
64
|
null,
|
|
62
65
|
null,
|
|
63
66
|
null,
|
|
64
67
|
null
|
|
65
68
|
);
|
|
66
|
-
const
|
|
69
|
+
const EmojiComponent = __component__$5.exports;
|
|
70
|
+
const _sfc_main$4 = {
|
|
67
71
|
name: "SuggestionList",
|
|
68
72
|
components: {
|
|
69
|
-
DtListItem
|
|
73
|
+
DtListItem
|
|
70
74
|
},
|
|
71
75
|
props: {
|
|
72
76
|
items: {
|
|
73
77
|
type: Array,
|
|
74
|
-
required:
|
|
78
|
+
required: true
|
|
75
79
|
},
|
|
76
80
|
command: {
|
|
77
81
|
type: Function,
|
|
78
|
-
required:
|
|
82
|
+
required: true
|
|
79
83
|
},
|
|
80
84
|
itemComponent: {
|
|
81
85
|
type: Object,
|
|
82
|
-
required:
|
|
86
|
+
required: true
|
|
83
87
|
},
|
|
84
88
|
itemType: {
|
|
85
89
|
type: String,
|
|
86
|
-
required:
|
|
90
|
+
required: true
|
|
87
91
|
}
|
|
88
92
|
},
|
|
89
93
|
data() {
|
|
@@ -97,169 +101,238 @@ const yt = _t.exports, vt = {
|
|
|
97
101
|
}
|
|
98
102
|
},
|
|
99
103
|
methods: {
|
|
100
|
-
onKeyDown({ event
|
|
101
|
-
|
|
104
|
+
onKeyDown({ event }) {
|
|
105
|
+
if (event.key === "ArrowUp") {
|
|
106
|
+
this.upHandler();
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
if (event.key === "ArrowDown") {
|
|
110
|
+
this.downHandler();
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
if (event.key === "Enter" || event.key === "Tab") {
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
this.selectHandler();
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
102
120
|
},
|
|
103
121
|
upHandler() {
|
|
104
|
-
this.selectedIndex = (this.selectedIndex + this.items.length - 1) % this.items.length
|
|
122
|
+
this.selectedIndex = (this.selectedIndex + this.items.length - 1) % this.items.length;
|
|
123
|
+
this.scrollActiveElementIntoView();
|
|
105
124
|
},
|
|
106
125
|
downHandler() {
|
|
107
|
-
this.selectedIndex = (this.selectedIndex + 1) % this.items.length
|
|
126
|
+
this.selectedIndex = (this.selectedIndex + 1) % this.items.length;
|
|
127
|
+
this.scrollActiveElementIntoView();
|
|
108
128
|
},
|
|
109
129
|
scrollActiveElementIntoView() {
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
130
|
+
const activeElement = this.$refs.suggestionList.querySelector(".dt-list-item--highlighted");
|
|
131
|
+
if (activeElement) {
|
|
132
|
+
activeElement.scrollIntoView({
|
|
133
|
+
behaviour: "smooth",
|
|
134
|
+
block: "center"
|
|
135
|
+
});
|
|
136
|
+
}
|
|
115
137
|
},
|
|
116
138
|
selectHandler() {
|
|
117
139
|
this.selectItem(this.selectedIndex);
|
|
118
140
|
},
|
|
119
|
-
selectItem(
|
|
120
|
-
const
|
|
141
|
+
selectItem(index) {
|
|
142
|
+
const item = this.items[index];
|
|
121
143
|
switch (this.itemType) {
|
|
122
144
|
case "emoji":
|
|
123
|
-
this.command(
|
|
145
|
+
this.command(item);
|
|
124
146
|
return;
|
|
125
147
|
case "mention":
|
|
126
|
-
this.command({ name:
|
|
148
|
+
this.command({ name: item.name, id: item.id, avatarSrc: item.avatarSrc });
|
|
127
149
|
break;
|
|
128
150
|
}
|
|
129
151
|
}
|
|
130
152
|
}
|
|
131
153
|
};
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
return
|
|
135
|
-
return
|
|
154
|
+
var _sfc_render$4 = function render2() {
|
|
155
|
+
var _vm = this, _c = _vm._self._c;
|
|
156
|
+
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) {
|
|
157
|
+
return _c("dt-list-item", { key: item.id, class: [
|
|
136
158
|
"dt-suggestion-list--item",
|
|
137
|
-
{ "dt-list-item--highlighted":
|
|
138
|
-
], attrs: { "navigation-type": "arrow-keys" }, on: { click: function(
|
|
139
|
-
return
|
|
140
|
-
}, keydown: function(
|
|
141
|
-
|
|
142
|
-
|
|
159
|
+
{ "dt-list-item--highlighted": index === _vm.selectedIndex }
|
|
160
|
+
], attrs: { "navigation-type": "arrow-keys" }, on: { "click": function($event) {
|
|
161
|
+
return _vm.selectItem(index);
|
|
162
|
+
}, "keydown": function($event) {
|
|
163
|
+
$event.preventDefault();
|
|
164
|
+
$event.stopPropagation();
|
|
165
|
+
return _vm.onKeyDown.apply(null, arguments);
|
|
166
|
+
} } }, [_c(_vm.itemComponent, { tag: "component", attrs: { "item": item } })], 1);
|
|
143
167
|
}), 1)]);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
168
|
+
};
|
|
169
|
+
var _sfc_staticRenderFns$4 = [];
|
|
170
|
+
var __component__$4 = /* @__PURE__ */ normalizeComponent(
|
|
171
|
+
_sfc_main$4,
|
|
172
|
+
_sfc_render$4,
|
|
173
|
+
_sfc_staticRenderFns$4,
|
|
174
|
+
false,
|
|
149
175
|
null,
|
|
150
176
|
null,
|
|
151
177
|
null,
|
|
152
178
|
null
|
|
153
179
|
);
|
|
154
|
-
const
|
|
180
|
+
const SuggestionList = __component__$4.exports;
|
|
181
|
+
const _sfc_main$3 = {
|
|
155
182
|
name: "EmojiSuggestion",
|
|
156
183
|
components: {
|
|
157
|
-
DtEmoji
|
|
158
|
-
DtStack
|
|
184
|
+
DtEmoji,
|
|
185
|
+
DtStack
|
|
159
186
|
},
|
|
160
187
|
props: {
|
|
161
188
|
item: {
|
|
162
189
|
type: Object,
|
|
163
|
-
required:
|
|
190
|
+
required: true
|
|
164
191
|
}
|
|
165
192
|
}
|
|
166
193
|
};
|
|
167
|
-
var
|
|
168
|
-
var
|
|
169
|
-
return
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
194
|
+
var _sfc_render$3 = function render3() {
|
|
195
|
+
var _vm = this, _c = _vm._self._c;
|
|
196
|
+
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);
|
|
197
|
+
};
|
|
198
|
+
var _sfc_staticRenderFns$3 = [];
|
|
199
|
+
var __component__$3 = /* @__PURE__ */ normalizeComponent(
|
|
200
|
+
_sfc_main$3,
|
|
201
|
+
_sfc_render$3,
|
|
202
|
+
_sfc_staticRenderFns$3,
|
|
203
|
+
false,
|
|
175
204
|
null,
|
|
176
205
|
null,
|
|
177
206
|
null,
|
|
178
207
|
null
|
|
179
208
|
);
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
|
|
209
|
+
const EmojiSuggestion = __component__$3.exports;
|
|
210
|
+
const suggestionOptions = {
|
|
211
|
+
items: ({ query }) => {
|
|
212
|
+
if (query.length < 2) {
|
|
213
|
+
return [];
|
|
214
|
+
}
|
|
215
|
+
const emojiList = Object.values(emojisIndexed);
|
|
216
|
+
const filteredEmoji = emojiList.filter(function(item) {
|
|
217
|
+
if (item.shortname.substring(1, item.shortname.length - 1).startsWith(query.toLowerCase())) {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
221
|
+
});
|
|
222
|
+
return filteredEmoji.map((item) => {
|
|
223
|
+
return { id: item.unicode_character, code: item.shortname };
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
command: ({ editor, range, props }) => {
|
|
227
|
+
var _a, _b;
|
|
228
|
+
const nodeAfter = editor.view.state.selection.$to.nodeAfter;
|
|
229
|
+
const overrideSpace = (_a = nodeAfter == null ? void 0 : nodeAfter.text) == null ? void 0 : _a.startsWith(" ");
|
|
230
|
+
if (overrideSpace) {
|
|
231
|
+
range.to += 1;
|
|
232
|
+
}
|
|
233
|
+
editor.chain().focus().insertContentAt(range, [
|
|
188
234
|
{
|
|
189
235
|
type: "emoji",
|
|
190
|
-
attrs:
|
|
236
|
+
attrs: props
|
|
191
237
|
},
|
|
192
238
|
{
|
|
193
239
|
type: "text",
|
|
194
240
|
text: " "
|
|
195
241
|
}
|
|
196
|
-
]).run()
|
|
242
|
+
]).run();
|
|
243
|
+
(_b = window.getSelection()) == null ? void 0 : _b.collapseToEnd();
|
|
197
244
|
},
|
|
198
245
|
render: () => {
|
|
199
|
-
let
|
|
246
|
+
let component;
|
|
247
|
+
let popup;
|
|
200
248
|
return {
|
|
201
|
-
onStart: (
|
|
202
|
-
|
|
249
|
+
onStart: (props) => {
|
|
250
|
+
component = new VueRenderer(SuggestionList, {
|
|
203
251
|
parent: void 0,
|
|
204
252
|
propsData: {
|
|
205
|
-
itemComponent:
|
|
253
|
+
itemComponent: EmojiSuggestion,
|
|
206
254
|
itemType: "emoji",
|
|
207
|
-
...
|
|
255
|
+
...props
|
|
208
256
|
},
|
|
209
|
-
editor:
|
|
210
|
-
})
|
|
211
|
-
|
|
257
|
+
editor: props.editor
|
|
258
|
+
});
|
|
259
|
+
if (!props.clientRect) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
popup = tippy("body", {
|
|
263
|
+
getReferenceClientRect: props.clientRect,
|
|
212
264
|
appendTo: () => document.body,
|
|
213
|
-
content:
|
|
214
|
-
showOnCreate:
|
|
215
|
-
interactive:
|
|
265
|
+
content: component.element,
|
|
266
|
+
showOnCreate: true,
|
|
267
|
+
interactive: true,
|
|
216
268
|
trigger: "manual",
|
|
217
269
|
placement: "top-start",
|
|
218
270
|
contentElement: null,
|
|
219
271
|
zIndex: 650
|
|
220
|
-
})
|
|
272
|
+
});
|
|
221
273
|
},
|
|
222
|
-
onUpdate(
|
|
223
|
-
|
|
224
|
-
|
|
274
|
+
onUpdate(props) {
|
|
275
|
+
component.updateProps(props);
|
|
276
|
+
if (!props.clientRect) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
popup[0].setProps({
|
|
280
|
+
getReferenceClientRect: props.clientRect
|
|
225
281
|
});
|
|
226
282
|
},
|
|
227
|
-
onKeyDown(
|
|
228
|
-
var
|
|
229
|
-
|
|
283
|
+
onKeyDown(props) {
|
|
284
|
+
var _a;
|
|
285
|
+
if (props.event.key === "Escape") {
|
|
286
|
+
popup[0].hide();
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
return (_a = component.ref) == null ? void 0 : _a.onKeyDown(props);
|
|
230
290
|
},
|
|
231
291
|
onExit() {
|
|
232
|
-
|
|
292
|
+
popup[0].destroy();
|
|
293
|
+
component.destroy();
|
|
233
294
|
}
|
|
234
295
|
};
|
|
235
296
|
}
|
|
236
|
-
}
|
|
237
|
-
|
|
297
|
+
};
|
|
298
|
+
const EmojiPluginKey = new PluginKey("emoji");
|
|
299
|
+
const inputShortCodeRegex = /:\w+:$/;
|
|
300
|
+
const pasteShortCodeRegex = /:\w+:/g;
|
|
301
|
+
const inputUnicodeRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])$/;
|
|
302
|
+
const pasteUnicodeRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g;
|
|
303
|
+
const inputRuleMatch = (match) => {
|
|
304
|
+
if (match && codeToEmojiData(match[0])) {
|
|
238
305
|
return {
|
|
239
|
-
index:
|
|
240
|
-
text:
|
|
241
|
-
match
|
|
306
|
+
index: match.index,
|
|
307
|
+
text: match[0],
|
|
308
|
+
match
|
|
242
309
|
};
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
const shortCodePasteMatch = (text) => {
|
|
313
|
+
const matches = [...text.matchAll(pasteShortCodeRegex)];
|
|
314
|
+
return matches.filter((match) => codeToEmojiData(match[0])).map((match) => ({
|
|
315
|
+
index: match.index,
|
|
316
|
+
text: match[0],
|
|
317
|
+
match
|
|
318
|
+
}));
|
|
319
|
+
};
|
|
320
|
+
const Emoji = Node.create({
|
|
248
321
|
addOptions() {
|
|
249
322
|
return {
|
|
250
323
|
HTMLAttributes: {},
|
|
251
324
|
suggestion: {
|
|
252
325
|
char: ":",
|
|
253
|
-
pluginKey:
|
|
326
|
+
pluginKey: EmojiPluginKey
|
|
254
327
|
}
|
|
255
328
|
};
|
|
256
329
|
},
|
|
257
330
|
name: "emoji",
|
|
258
331
|
group: "inline",
|
|
259
|
-
inline:
|
|
260
|
-
selectable:
|
|
332
|
+
inline: true,
|
|
333
|
+
selectable: true,
|
|
261
334
|
addNodeView() {
|
|
262
|
-
return
|
|
335
|
+
return VueNodeViewRenderer(EmojiComponent);
|
|
263
336
|
},
|
|
264
337
|
addAttributes() {
|
|
265
338
|
return {
|
|
@@ -278,37 +351,38 @@ const Ct = Tt.exports, St = {
|
|
|
278
351
|
}
|
|
279
352
|
];
|
|
280
353
|
},
|
|
281
|
-
renderText({ node
|
|
282
|
-
return
|
|
354
|
+
renderText({ node }) {
|
|
355
|
+
return node.attrs.code;
|
|
283
356
|
},
|
|
284
|
-
renderHTML({ HTMLAttributes
|
|
285
|
-
return ["emoji-component",
|
|
357
|
+
renderHTML({ HTMLAttributes }) {
|
|
358
|
+
return ["emoji-component", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
|
|
286
359
|
},
|
|
287
360
|
addInputRules() {
|
|
288
361
|
return [
|
|
289
362
|
// shortcode input
|
|
290
|
-
|
|
291
|
-
find: (
|
|
292
|
-
const
|
|
293
|
-
return
|
|
363
|
+
nodeInputRule({
|
|
364
|
+
find: (text) => {
|
|
365
|
+
const match = text.match(inputShortCodeRegex);
|
|
366
|
+
return inputRuleMatch(match);
|
|
294
367
|
},
|
|
295
368
|
type: this.type,
|
|
296
|
-
getAttributes(
|
|
369
|
+
getAttributes(attrs) {
|
|
297
370
|
return {
|
|
298
|
-
code:
|
|
371
|
+
code: attrs[0]
|
|
299
372
|
};
|
|
300
373
|
}
|
|
301
374
|
}),
|
|
302
|
-
|
|
303
|
-
find: (
|
|
304
|
-
const
|
|
305
|
-
return
|
|
375
|
+
nodeInputRule({
|
|
376
|
+
find: (text) => {
|
|
377
|
+
const match = text.match(inputUnicodeRegex);
|
|
378
|
+
return inputRuleMatch(match);
|
|
306
379
|
},
|
|
307
380
|
type: this.type,
|
|
308
|
-
getAttributes(
|
|
309
|
-
const
|
|
381
|
+
getAttributes(attrs) {
|
|
382
|
+
const unicode = shortcodeToEmojiData(attrs[0]).unicode_output;
|
|
383
|
+
const emoji = String.fromCodePoint(parseInt(unicode, 16));
|
|
310
384
|
return {
|
|
311
|
-
code:
|
|
385
|
+
code: emoji,
|
|
312
386
|
label: "emoji"
|
|
313
387
|
};
|
|
314
388
|
}
|
|
@@ -317,21 +391,21 @@ const Ct = Tt.exports, St = {
|
|
|
317
391
|
},
|
|
318
392
|
addPasteRules() {
|
|
319
393
|
return [
|
|
320
|
-
|
|
321
|
-
find:
|
|
394
|
+
nodePasteRule({
|
|
395
|
+
find: shortCodePasteMatch,
|
|
322
396
|
type: this.type,
|
|
323
|
-
getAttributes(
|
|
397
|
+
getAttributes(attrs) {
|
|
324
398
|
return {
|
|
325
|
-
code:
|
|
399
|
+
code: attrs[0]
|
|
326
400
|
};
|
|
327
401
|
}
|
|
328
402
|
}),
|
|
329
|
-
|
|
330
|
-
find:
|
|
403
|
+
nodePasteRule({
|
|
404
|
+
find: pasteUnicodeRegex,
|
|
331
405
|
type: this.type,
|
|
332
|
-
getAttributes(
|
|
406
|
+
getAttributes(attrs) {
|
|
333
407
|
return {
|
|
334
|
-
code:
|
|
408
|
+
code: attrs[0]
|
|
335
409
|
};
|
|
336
410
|
}
|
|
337
411
|
})
|
|
@@ -339,171 +413,207 @@ const Ct = Tt.exports, St = {
|
|
|
339
413
|
},
|
|
340
414
|
addProseMirrorPlugins() {
|
|
341
415
|
return [
|
|
342
|
-
|
|
416
|
+
Suggestion({
|
|
343
417
|
editor: this.editor,
|
|
344
418
|
...this.options.suggestion,
|
|
345
|
-
...
|
|
419
|
+
...suggestionOptions
|
|
346
420
|
})
|
|
347
421
|
];
|
|
348
422
|
}
|
|
349
423
|
});
|
|
350
|
-
function
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
let
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
424
|
+
function getRegexMatches(text, regex, validator = () => true) {
|
|
425
|
+
const matches = [];
|
|
426
|
+
regex.lastIndex = 0;
|
|
427
|
+
let match;
|
|
428
|
+
while (match = regex.exec(text)) {
|
|
429
|
+
if (validator(text, match)) {
|
|
430
|
+
matches.push(match);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return matches;
|
|
357
434
|
}
|
|
358
|
-
function
|
|
359
|
-
return !["#", "@"].includes(
|
|
435
|
+
function hasValidPrefix(text, match) {
|
|
436
|
+
return !["#", "@"].includes(text.charAt(match.index)) && !["#", "@"].includes(text.charAt(match.index - 1));
|
|
360
437
|
}
|
|
361
|
-
function
|
|
362
|
-
const
|
|
438
|
+
function trimEndPunctiation(string) {
|
|
439
|
+
const endPunctuationRegex = new RegExp(
|
|
363
440
|
"(?:" + [
|
|
364
441
|
`[!?.,:;'"]`,
|
|
365
442
|
"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"
|
|
366
443
|
].join("|"),
|
|
367
444
|
"g"
|
|
368
445
|
);
|
|
369
|
-
return
|
|
446
|
+
return string.replace(endPunctuationRegex, "");
|
|
370
447
|
}
|
|
371
|
-
function
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
|
|
448
|
+
function getWordAt(text, index) {
|
|
449
|
+
const left = text.slice(0, index + 1).search(/\S+\s*$/);
|
|
450
|
+
const right = text.slice(index).search(/\s/);
|
|
451
|
+
if (right < 0) {
|
|
452
|
+
const word = text.slice(left);
|
|
375
453
|
return {
|
|
376
|
-
text:
|
|
377
|
-
from:
|
|
378
|
-
to:
|
|
454
|
+
text: word,
|
|
455
|
+
from: left,
|
|
456
|
+
to: left + word.length
|
|
379
457
|
};
|
|
380
458
|
}
|
|
381
459
|
return {
|
|
382
|
-
text:
|
|
383
|
-
from:
|
|
384
|
-
to:
|
|
460
|
+
text: text.slice(left, right + index),
|
|
461
|
+
from: left,
|
|
462
|
+
to: right + index
|
|
385
463
|
};
|
|
386
464
|
}
|
|
387
|
-
function
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
465
|
+
function getWordAtUntil(text, index, direction, regex) {
|
|
466
|
+
const word = getWordAt(text, index);
|
|
467
|
+
regex.lastIndex = 0;
|
|
468
|
+
if (!regex.test(word.text)) {
|
|
469
|
+
return word;
|
|
470
|
+
}
|
|
471
|
+
const newIndex = direction === "left" ? word.from - 1 : word.to + 1;
|
|
472
|
+
if (newIndex <= 0 || newIndex >= text.length || newIndex === index) {
|
|
473
|
+
return word;
|
|
474
|
+
}
|
|
475
|
+
return getWordAtUntil(text, newIndex, direction, regex);
|
|
393
476
|
}
|
|
394
|
-
function
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
477
|
+
function removeMarks(range, doc, tr, type) {
|
|
478
|
+
const from = Math.max(range.from - 1, 0);
|
|
479
|
+
const to = Math.min(range.to + 1, doc.content.size);
|
|
480
|
+
const marksInRange = getMarksBetween(from, to, doc);
|
|
481
|
+
for (const mark of marksInRange) {
|
|
482
|
+
if (mark.mark.type !== type) {
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
tr.removeMark(mark.from, mark.to, type);
|
|
486
|
+
}
|
|
398
487
|
}
|
|
399
|
-
const
|
|
400
|
-
function
|
|
401
|
-
if (!
|
|
488
|
+
const partialPhoneNumberRegex = getPhoneNumberRegex(1, 15);
|
|
489
|
+
function addMarks(text, pos, from, to, tr, type) {
|
|
490
|
+
if (!text) {
|
|
402
491
|
return;
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
492
|
+
}
|
|
493
|
+
let rangeFrom = from - pos - 1;
|
|
494
|
+
rangeFrom = rangeFrom < 0 ? 0 : rangeFrom;
|
|
495
|
+
const rangeTo = to - pos;
|
|
496
|
+
const firstWordInRange = getWordAtUntil(
|
|
497
|
+
text,
|
|
498
|
+
rangeFrom,
|
|
408
499
|
"left",
|
|
409
|
-
|
|
410
|
-
)
|
|
411
|
-
|
|
412
|
-
|
|
500
|
+
partialPhoneNumberRegex
|
|
501
|
+
);
|
|
502
|
+
const lastWordInRange = getWordAtUntil(
|
|
503
|
+
text,
|
|
504
|
+
rangeTo,
|
|
413
505
|
"right",
|
|
414
|
-
|
|
415
|
-
)
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
506
|
+
partialPhoneNumberRegex
|
|
507
|
+
);
|
|
508
|
+
const wordsInRange = text.slice(firstWordInRange.from, lastWordInRange.to);
|
|
509
|
+
const matches = getRegexMatches(wordsInRange, linkRegex, hasValidPrefix);
|
|
510
|
+
matches.forEach((match) => {
|
|
511
|
+
const word = trimEndPunctiation(match[0]);
|
|
512
|
+
const from2 = pos + firstWordInRange.from + match.index + 1;
|
|
513
|
+
const to2 = from2 + word.length;
|
|
514
|
+
tr.addMark(from2, to2, type.create());
|
|
419
515
|
});
|
|
420
516
|
}
|
|
421
|
-
function
|
|
422
|
-
let
|
|
423
|
-
return new
|
|
424
|
-
key: new
|
|
425
|
-
appendTransaction: (
|
|
426
|
-
const
|
|
427
|
-
if (
|
|
517
|
+
function autolink(options) {
|
|
518
|
+
let hasInitialized = false;
|
|
519
|
+
return new Plugin({
|
|
520
|
+
key: new PluginKey("autolink"),
|
|
521
|
+
appendTransaction: (transactions, oldState, newState) => {
|
|
522
|
+
const contentChanged = transactions.some((tr2) => tr2.docChanged) && !oldState.doc.eq(newState.doc);
|
|
523
|
+
if (hasInitialized && !contentChanged) {
|
|
428
524
|
return;
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
525
|
+
}
|
|
526
|
+
const { tr } = newState;
|
|
527
|
+
const { textContent } = newState.doc;
|
|
528
|
+
if (!hasInitialized) {
|
|
529
|
+
addMarks(textContent, 0, 0, textContent.length, tr, options.type);
|
|
530
|
+
}
|
|
531
|
+
hasInitialized = true;
|
|
532
|
+
const transform = combineTransactionSteps(
|
|
533
|
+
oldState.doc,
|
|
534
|
+
[...transactions]
|
|
434
535
|
);
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
536
|
+
const changes = getChangedRanges(transform);
|
|
537
|
+
changes.forEach(({ oldRange, newRange }) => {
|
|
538
|
+
removeMarks(newRange, newState.doc, tr, options.type);
|
|
539
|
+
const paragraphs = findChildrenInRange(
|
|
540
|
+
newState.doc,
|
|
541
|
+
newRange,
|
|
542
|
+
(node) => node.isTextblock
|
|
543
|
+
);
|
|
544
|
+
paragraphs.forEach(({ node, pos }) => {
|
|
545
|
+
addMarks(
|
|
546
|
+
node.textContent,
|
|
547
|
+
pos,
|
|
548
|
+
oldRange.from,
|
|
549
|
+
newRange.to,
|
|
550
|
+
tr,
|
|
551
|
+
options.type
|
|
448
552
|
);
|
|
449
553
|
});
|
|
450
|
-
})
|
|
554
|
+
});
|
|
555
|
+
return tr;
|
|
451
556
|
}
|
|
452
557
|
});
|
|
453
558
|
}
|
|
454
|
-
const
|
|
559
|
+
const defaultAttributes = {
|
|
455
560
|
class: "d-link d-c-text d-d-inline-block",
|
|
456
561
|
rel: "noopener noreferrer nofollow"
|
|
457
|
-
}
|
|
562
|
+
};
|
|
563
|
+
const Link = Mark.create({
|
|
458
564
|
name: "Link",
|
|
459
|
-
renderHTML({ HTMLAttributes
|
|
565
|
+
renderHTML({ HTMLAttributes }) {
|
|
460
566
|
return [
|
|
461
567
|
"a",
|
|
462
|
-
|
|
568
|
+
mergeAttributes(
|
|
463
569
|
this.options.HTMLAttributes,
|
|
464
|
-
|
|
465
|
-
|
|
570
|
+
HTMLAttributes,
|
|
571
|
+
defaultAttributes
|
|
466
572
|
),
|
|
467
573
|
0
|
|
468
574
|
];
|
|
469
575
|
},
|
|
470
|
-
renderText({ node
|
|
471
|
-
return
|
|
576
|
+
renderText({ node }) {
|
|
577
|
+
return node.attrs.text;
|
|
472
578
|
},
|
|
473
579
|
addProseMirrorPlugins() {
|
|
474
580
|
return [
|
|
475
|
-
|
|
581
|
+
autolink({ type: this.type })
|
|
476
582
|
];
|
|
477
583
|
}
|
|
478
|
-
})
|
|
584
|
+
});
|
|
585
|
+
const _sfc_main$2 = {
|
|
479
586
|
name: "MentionComponent",
|
|
480
587
|
components: {
|
|
481
|
-
NodeViewWrapper
|
|
482
|
-
DtLink
|
|
588
|
+
NodeViewWrapper,
|
|
589
|
+
DtLink
|
|
483
590
|
},
|
|
484
|
-
props:
|
|
591
|
+
props: nodeViewProps,
|
|
485
592
|
computed: {
|
|
486
593
|
text() {
|
|
487
594
|
return "@" + this.$props.node.attrs.name;
|
|
488
595
|
}
|
|
489
596
|
}
|
|
490
597
|
};
|
|
491
|
-
var
|
|
492
|
-
var
|
|
493
|
-
return
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
598
|
+
var _sfc_render$2 = function render4() {
|
|
599
|
+
var _vm = this, _c = _vm._self._c;
|
|
600
|
+
return _c("node-view-wrapper", { staticClass: "d-d-inline-block" }, [_c("dt-link", { attrs: { "kind": "mention" } }, [_vm._v(" " + _vm._s(_vm.text) + " ")])], 1);
|
|
601
|
+
};
|
|
602
|
+
var _sfc_staticRenderFns$2 = [];
|
|
603
|
+
var __component__$2 = /* @__PURE__ */ normalizeComponent(
|
|
604
|
+
_sfc_main$2,
|
|
605
|
+
_sfc_render$2,
|
|
606
|
+
_sfc_staticRenderFns$2,
|
|
607
|
+
false,
|
|
499
608
|
null,
|
|
500
609
|
null,
|
|
501
610
|
null,
|
|
502
611
|
null
|
|
503
612
|
);
|
|
504
|
-
const
|
|
613
|
+
const MentionComponent = __component__$2.exports;
|
|
614
|
+
const MentionPlugin = Mention.extend({
|
|
505
615
|
addNodeView() {
|
|
506
|
-
return
|
|
616
|
+
return VueNodeViewRenderer(MentionComponent);
|
|
507
617
|
},
|
|
508
618
|
parseHTML() {
|
|
509
619
|
return [
|
|
@@ -525,37 +635,41 @@ const Jt = Wt.exports, Xt = dt.extend({
|
|
|
525
635
|
}
|
|
526
636
|
};
|
|
527
637
|
},
|
|
528
|
-
renderText({ node
|
|
529
|
-
return `@${
|
|
638
|
+
renderText({ node }) {
|
|
639
|
+
return `@${node.attrs.id}`;
|
|
530
640
|
},
|
|
531
|
-
renderHTML({ HTMLAttributes
|
|
532
|
-
return ["mention-component",
|
|
641
|
+
renderHTML({ HTMLAttributes }) {
|
|
642
|
+
return ["mention-component", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
533
643
|
}
|
|
534
|
-
})
|
|
644
|
+
});
|
|
645
|
+
const RICH_TEXT_EDITOR_OUTPUT_FORMATS = [
|
|
535
646
|
"text",
|
|
536
647
|
"json",
|
|
537
648
|
"html"
|
|
538
|
-
]
|
|
649
|
+
];
|
|
650
|
+
const RICH_TEXT_EDITOR_AUTOFOCUS_TYPES = [
|
|
539
651
|
"start",
|
|
540
652
|
"end",
|
|
541
653
|
"all"
|
|
542
|
-
]
|
|
654
|
+
];
|
|
655
|
+
const RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS = [
|
|
543
656
|
"https",
|
|
544
657
|
"http",
|
|
545
658
|
"ftp",
|
|
546
659
|
"ftps",
|
|
547
660
|
"sftp",
|
|
548
661
|
"mailto"
|
|
549
|
-
]
|
|
662
|
+
];
|
|
663
|
+
const _sfc_main$1 = {
|
|
550
664
|
name: "MentionSuggestion",
|
|
551
665
|
components: {
|
|
552
|
-
DtAvatar
|
|
553
|
-
DtStack
|
|
666
|
+
DtAvatar,
|
|
667
|
+
DtStack
|
|
554
668
|
},
|
|
555
669
|
props: {
|
|
556
670
|
item: {
|
|
557
671
|
type: Object,
|
|
558
|
-
required:
|
|
672
|
+
required: true
|
|
559
673
|
}
|
|
560
674
|
},
|
|
561
675
|
computed: {
|
|
@@ -567,63 +681,81 @@ const Jt = Wt.exports, Xt = dt.extend({
|
|
|
567
681
|
}
|
|
568
682
|
}
|
|
569
683
|
};
|
|
570
|
-
var
|
|
571
|
-
var
|
|
572
|
-
return
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
684
|
+
var _sfc_render$1 = function render5() {
|
|
685
|
+
var _vm = this, _c = _vm._self._c;
|
|
686
|
+
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);
|
|
687
|
+
};
|
|
688
|
+
var _sfc_staticRenderFns$1 = [];
|
|
689
|
+
var __component__$1 = /* @__PURE__ */ normalizeComponent(
|
|
690
|
+
_sfc_main$1,
|
|
691
|
+
_sfc_render$1,
|
|
692
|
+
_sfc_staticRenderFns$1,
|
|
693
|
+
false,
|
|
578
694
|
null,
|
|
579
695
|
null,
|
|
580
696
|
null,
|
|
581
697
|
null
|
|
582
698
|
);
|
|
583
|
-
const
|
|
699
|
+
const MentionSuggestion = __component__$1.exports;
|
|
700
|
+
const suggestion = {
|
|
584
701
|
// This function comes from the user and passed to the editor directly.
|
|
585
702
|
// This will also activate the mention plugin on the editor
|
|
586
703
|
// items: ({ query }) => { return [] },
|
|
587
|
-
allowSpaces:
|
|
704
|
+
allowSpaces: true,
|
|
588
705
|
render: () => {
|
|
589
|
-
let
|
|
706
|
+
let component;
|
|
707
|
+
let popup;
|
|
590
708
|
return {
|
|
591
|
-
onStart: (
|
|
592
|
-
|
|
709
|
+
onStart: (props) => {
|
|
710
|
+
component = new VueRenderer(SuggestionList, {
|
|
593
711
|
parent: void 0,
|
|
594
712
|
propsData: {
|
|
595
|
-
itemComponent:
|
|
713
|
+
itemComponent: MentionSuggestion,
|
|
596
714
|
itemType: "mention",
|
|
597
|
-
...
|
|
715
|
+
...props
|
|
598
716
|
},
|
|
599
|
-
editor:
|
|
600
|
-
})
|
|
601
|
-
|
|
717
|
+
editor: props.editor
|
|
718
|
+
});
|
|
719
|
+
if (!props.clientRect) {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
popup = tippy("body", {
|
|
723
|
+
getReferenceClientRect: props.clientRect,
|
|
602
724
|
appendTo: () => document.body,
|
|
603
|
-
content:
|
|
604
|
-
showOnCreate:
|
|
605
|
-
interactive:
|
|
725
|
+
content: component.element,
|
|
726
|
+
showOnCreate: true,
|
|
727
|
+
interactive: true,
|
|
606
728
|
trigger: "manual",
|
|
607
729
|
placement: "top-start"
|
|
608
|
-
})
|
|
730
|
+
});
|
|
609
731
|
},
|
|
610
|
-
onUpdate(
|
|
611
|
-
|
|
612
|
-
|
|
732
|
+
onUpdate(props) {
|
|
733
|
+
component.updateProps(props);
|
|
734
|
+
if (!props.clientRect) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
popup[0].setProps({
|
|
738
|
+
getReferenceClientRect: props.clientRect
|
|
613
739
|
});
|
|
614
740
|
},
|
|
615
|
-
onKeyDown(
|
|
616
|
-
|
|
741
|
+
onKeyDown(props) {
|
|
742
|
+
if (props.event.key === "Escape") {
|
|
743
|
+
popup[0].hide();
|
|
744
|
+
return true;
|
|
745
|
+
}
|
|
746
|
+
return component == null ? void 0 : component.ref.onKeyDown(props);
|
|
617
747
|
},
|
|
618
748
|
onExit() {
|
|
619
|
-
|
|
749
|
+
popup[0].destroy();
|
|
750
|
+
component.destroy();
|
|
620
751
|
}
|
|
621
752
|
};
|
|
622
753
|
}
|
|
623
|
-
}
|
|
754
|
+
};
|
|
755
|
+
const _sfc_main = {
|
|
624
756
|
name: "DtRichTextEditor",
|
|
625
757
|
components: {
|
|
626
|
-
EditorContent
|
|
758
|
+
EditorContent
|
|
627
759
|
},
|
|
628
760
|
props: {
|
|
629
761
|
/**
|
|
@@ -639,21 +771,21 @@ const ne = re.exports, oe = {
|
|
|
639
771
|
*/
|
|
640
772
|
editable: {
|
|
641
773
|
type: Boolean,
|
|
642
|
-
default:
|
|
774
|
+
default: true
|
|
643
775
|
},
|
|
644
776
|
/**
|
|
645
777
|
* Whether the input allows for line breaks to be introduced in the text.
|
|
646
778
|
*/
|
|
647
779
|
allowLineBreaks: {
|
|
648
780
|
type: Boolean,
|
|
649
|
-
default:
|
|
781
|
+
default: false
|
|
650
782
|
},
|
|
651
783
|
/**
|
|
652
784
|
* Descriptive label for the input element
|
|
653
785
|
*/
|
|
654
786
|
inputAriaLabel: {
|
|
655
787
|
type: String,
|
|
656
|
-
required:
|
|
788
|
+
required: true
|
|
657
789
|
},
|
|
658
790
|
/**
|
|
659
791
|
* Additional class name for the input element. Only accepts a String value
|
|
@@ -677,9 +809,12 @@ const ne = re.exports, oe = {
|
|
|
677
809
|
*/
|
|
678
810
|
autoFocus: {
|
|
679
811
|
type: [Boolean, String, Number],
|
|
680
|
-
default:
|
|
681
|
-
validator(
|
|
682
|
-
|
|
812
|
+
default: false,
|
|
813
|
+
validator(autoFocus) {
|
|
814
|
+
if (typeof autoFocus === "string") {
|
|
815
|
+
return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);
|
|
816
|
+
}
|
|
817
|
+
return true;
|
|
683
818
|
}
|
|
684
819
|
},
|
|
685
820
|
/**
|
|
@@ -691,8 +826,8 @@ const ne = re.exports, oe = {
|
|
|
691
826
|
outputFormat: {
|
|
692
827
|
type: String,
|
|
693
828
|
default: "text",
|
|
694
|
-
validator(
|
|
695
|
-
return
|
|
829
|
+
validator(outputFormat) {
|
|
830
|
+
return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);
|
|
696
831
|
}
|
|
697
832
|
},
|
|
698
833
|
/**
|
|
@@ -707,7 +842,7 @@ const ne = re.exports, oe = {
|
|
|
707
842
|
*/
|
|
708
843
|
link: {
|
|
709
844
|
type: [Boolean, Object],
|
|
710
|
-
default:
|
|
845
|
+
default: false
|
|
711
846
|
},
|
|
712
847
|
/**
|
|
713
848
|
* suggestion object containing the items query function.
|
|
@@ -729,42 +864,42 @@ const ne = re.exports, oe = {
|
|
|
729
864
|
*/
|
|
730
865
|
allowBlockquote: {
|
|
731
866
|
type: Boolean,
|
|
732
|
-
default:
|
|
867
|
+
default: true
|
|
733
868
|
},
|
|
734
869
|
/**
|
|
735
870
|
* Whether the input allows for bold to be introduced in the text.
|
|
736
871
|
*/
|
|
737
872
|
allowBold: {
|
|
738
873
|
type: Boolean,
|
|
739
|
-
default:
|
|
874
|
+
default: true
|
|
740
875
|
},
|
|
741
876
|
/**
|
|
742
877
|
* Whether the input allows for bullet list to be introduced in the text.
|
|
743
878
|
*/
|
|
744
879
|
allowBulletList: {
|
|
745
880
|
type: Boolean,
|
|
746
|
-
default:
|
|
881
|
+
default: true
|
|
747
882
|
},
|
|
748
883
|
/**
|
|
749
884
|
* Whether the input allows for italic to be introduced in the text.
|
|
750
885
|
*/
|
|
751
886
|
allowItalic: {
|
|
752
887
|
type: Boolean,
|
|
753
|
-
default:
|
|
888
|
+
default: true
|
|
754
889
|
},
|
|
755
890
|
/**
|
|
756
891
|
* Whether the input allows for strike to be introduced in the text.
|
|
757
892
|
*/
|
|
758
893
|
allowStrike: {
|
|
759
894
|
type: Boolean,
|
|
760
|
-
default:
|
|
895
|
+
default: true
|
|
761
896
|
},
|
|
762
897
|
/**
|
|
763
898
|
* Whether the input allows for underline to be introduced in the text.
|
|
764
899
|
*/
|
|
765
900
|
allowUnderline: {
|
|
766
901
|
type: Boolean,
|
|
767
|
-
default:
|
|
902
|
+
default: true
|
|
768
903
|
}
|
|
769
904
|
},
|
|
770
905
|
emits: [
|
|
@@ -796,54 +931,88 @@ const ne = re.exports, oe = {
|
|
|
796
931
|
data() {
|
|
797
932
|
return {
|
|
798
933
|
editor: null,
|
|
799
|
-
popoverOpened:
|
|
934
|
+
popoverOpened: false
|
|
800
935
|
};
|
|
801
936
|
},
|
|
802
937
|
computed: {
|
|
803
938
|
// eslint-disable-next-line complexity
|
|
804
939
|
extensions() {
|
|
805
|
-
const
|
|
806
|
-
if (this.link
|
|
807
|
-
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
}
|
|
831
|
-
|
|
940
|
+
const extensions = [Document, Paragraph, Text];
|
|
941
|
+
if (this.link) {
|
|
942
|
+
extensions.push(this.getExtension(Link, this.link));
|
|
943
|
+
}
|
|
944
|
+
if (this.allowBlockquote) {
|
|
945
|
+
extensions.push(Blockquote);
|
|
946
|
+
}
|
|
947
|
+
if (this.allowBold) {
|
|
948
|
+
extensions.push(Bold);
|
|
949
|
+
}
|
|
950
|
+
if (this.allowBulletList) {
|
|
951
|
+
extensions.push(BulletList);
|
|
952
|
+
extensions.push(ListItem);
|
|
953
|
+
extensions.push(OrderedList.configure({
|
|
954
|
+
itemTypeName: "listItem"
|
|
955
|
+
}));
|
|
956
|
+
}
|
|
957
|
+
if (this.allowItalic) {
|
|
958
|
+
extensions.push(Italic);
|
|
959
|
+
}
|
|
960
|
+
if (this.allowStrike) {
|
|
961
|
+
extensions.push(Strike);
|
|
962
|
+
}
|
|
963
|
+
if (this.allowUnderline) {
|
|
964
|
+
extensions.push(Underline);
|
|
965
|
+
}
|
|
966
|
+
extensions.push(
|
|
967
|
+
Placeholder.configure({ placeholder: this.placeholder })
|
|
968
|
+
);
|
|
969
|
+
if (!this.allowLineBreaks) {
|
|
970
|
+
extensions.push(
|
|
971
|
+
HardBreak.extend({
|
|
972
|
+
addKeyboardShortcuts() {
|
|
973
|
+
return {
|
|
974
|
+
Enter: () => true,
|
|
975
|
+
"Shift-Enter": () => this.editor.commands.first(({ commands }) => [
|
|
976
|
+
() => commands.newlineInCode(),
|
|
977
|
+
() => commands.createParagraphNear(),
|
|
978
|
+
() => commands.liftEmptyBlock(),
|
|
979
|
+
() => commands.splitBlock()
|
|
980
|
+
])
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
})
|
|
984
|
+
);
|
|
985
|
+
}
|
|
986
|
+
extensions.push(TipTapLink.extend({ inclusive: false }).configure({
|
|
987
|
+
autolink: true,
|
|
988
|
+
protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS
|
|
989
|
+
}));
|
|
990
|
+
if (this.mentionSuggestion) {
|
|
991
|
+
const suggestionObject = { ...this.mentionSuggestion, ...suggestion };
|
|
992
|
+
extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));
|
|
993
|
+
}
|
|
994
|
+
extensions.push(Emoji);
|
|
995
|
+
extensions.push(TextAlign.configure({
|
|
832
996
|
types: ["paragraph"],
|
|
833
997
|
defaultAlignment: "left"
|
|
834
|
-
}))
|
|
998
|
+
}));
|
|
999
|
+
extensions.push(CodeBlock.configure({
|
|
835
1000
|
HTMLAttributes: {
|
|
836
1001
|
class: "dt-rich-text-editor--code-block"
|
|
837
1002
|
}
|
|
838
|
-
}))
|
|
1003
|
+
}));
|
|
1004
|
+
return extensions;
|
|
839
1005
|
},
|
|
840
1006
|
inputAttrs() {
|
|
841
|
-
const
|
|
1007
|
+
const attrs = {
|
|
842
1008
|
"aria-label": this.inputAriaLabel,
|
|
843
|
-
"aria-multiline":
|
|
1009
|
+
"aria-multiline": true,
|
|
844
1010
|
role: "textbox"
|
|
845
1011
|
};
|
|
846
|
-
|
|
1012
|
+
if (!this.editable) {
|
|
1013
|
+
attrs["aria-readonly"] = true;
|
|
1014
|
+
}
|
|
1015
|
+
return attrs;
|
|
847
1016
|
}
|
|
848
1017
|
},
|
|
849
1018
|
/**
|
|
@@ -852,21 +1021,30 @@ const ne = re.exports, oe = {
|
|
|
852
1021
|
* to be hooked up to the Editor's own API.
|
|
853
1022
|
*/
|
|
854
1023
|
watch: {
|
|
855
|
-
editable(
|
|
856
|
-
this.editor.setEditable(
|
|
1024
|
+
editable(isEditable) {
|
|
1025
|
+
this.editor.setEditable(isEditable);
|
|
1026
|
+
this.updateEditorAttributes({ "aria-readonly": !isEditable });
|
|
857
1027
|
},
|
|
858
|
-
inputClass(
|
|
859
|
-
this.updateEditorAttributes({ class:
|
|
1028
|
+
inputClass(newClass) {
|
|
1029
|
+
this.updateEditorAttributes({ class: newClass });
|
|
860
1030
|
},
|
|
861
|
-
inputAriaLabel(
|
|
862
|
-
this.updateEditorAttributes({ "aria-label":
|
|
1031
|
+
inputAriaLabel(newLabel) {
|
|
1032
|
+
this.updateEditorAttributes({ "aria-label": newLabel });
|
|
863
1033
|
},
|
|
864
1034
|
extensions() {
|
|
865
|
-
this.destroyEditor()
|
|
1035
|
+
this.destroyEditor();
|
|
1036
|
+
this.createEditor();
|
|
866
1037
|
},
|
|
867
|
-
value(
|
|
868
|
-
let
|
|
869
|
-
this.outputFormat === "json"
|
|
1038
|
+
value(newValue) {
|
|
1039
|
+
let currentValue = this.getOutput();
|
|
1040
|
+
if (this.outputFormat === "json") {
|
|
1041
|
+
newValue = JSON.stringify(newValue);
|
|
1042
|
+
currentValue = JSON.stringify(currentValue);
|
|
1043
|
+
}
|
|
1044
|
+
if (newValue === currentValue) {
|
|
1045
|
+
return;
|
|
1046
|
+
}
|
|
1047
|
+
this.editor.commands.setContent(newValue, false);
|
|
870
1048
|
}
|
|
871
1049
|
},
|
|
872
1050
|
created() {
|
|
@@ -877,7 +1055,7 @@ const ne = re.exports, oe = {
|
|
|
877
1055
|
},
|
|
878
1056
|
methods: {
|
|
879
1057
|
createEditor() {
|
|
880
|
-
this.editor = new
|
|
1058
|
+
this.editor = new Editor({
|
|
881
1059
|
autofocus: this.autoFocus,
|
|
882
1060
|
content: this.value,
|
|
883
1061
|
editable: this.editable,
|
|
@@ -888,7 +1066,8 @@ const ne = re.exports, oe = {
|
|
|
888
1066
|
class: this.inputClass
|
|
889
1067
|
}
|
|
890
1068
|
}
|
|
891
|
-
})
|
|
1069
|
+
});
|
|
1070
|
+
this.addEditorListeners();
|
|
892
1071
|
},
|
|
893
1072
|
destroyEditor() {
|
|
894
1073
|
this.editor.destroy();
|
|
@@ -899,12 +1078,15 @@ const ne = re.exports, oe = {
|
|
|
899
1078
|
*/
|
|
900
1079
|
addEditorListeners() {
|
|
901
1080
|
this.editor.on("update", () => {
|
|
902
|
-
const
|
|
903
|
-
this.$emit("input",
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
this.$emit("
|
|
1081
|
+
const value = this.getOutput();
|
|
1082
|
+
this.$emit("input", value);
|
|
1083
|
+
this.$emit("update:value", value);
|
|
1084
|
+
});
|
|
1085
|
+
this.editor.on("focus", ({ event }) => {
|
|
1086
|
+
this.$emit("focus", event);
|
|
1087
|
+
});
|
|
1088
|
+
this.editor.on("blur", ({ event }) => {
|
|
1089
|
+
this.$emit("blur", event);
|
|
908
1090
|
});
|
|
909
1091
|
},
|
|
910
1092
|
getOutput() {
|
|
@@ -918,35 +1100,40 @@ const ne = re.exports, oe = {
|
|
|
918
1100
|
return this.editor.getText();
|
|
919
1101
|
}
|
|
920
1102
|
},
|
|
921
|
-
getExtension(
|
|
922
|
-
var
|
|
923
|
-
|
|
1103
|
+
getExtension(extension, options) {
|
|
1104
|
+
var _a;
|
|
1105
|
+
if (typeof options === "boolean") {
|
|
1106
|
+
return extension;
|
|
1107
|
+
}
|
|
1108
|
+
return (_a = extension.configure) == null ? void 0 : _a.call(extension, options);
|
|
924
1109
|
},
|
|
925
|
-
updateEditorAttributes(
|
|
926
|
-
this.editor.setOptions({ editorProps: { attributes
|
|
1110
|
+
updateEditorAttributes(attributes) {
|
|
1111
|
+
this.editor.setOptions({ editorProps: { attributes } });
|
|
927
1112
|
},
|
|
928
1113
|
focusEditor() {
|
|
929
1114
|
this.editor.commands.focus();
|
|
930
1115
|
}
|
|
931
1116
|
}
|
|
932
1117
|
};
|
|
933
|
-
var
|
|
934
|
-
var
|
|
935
|
-
return
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
1118
|
+
var _sfc_render = function render6() {
|
|
1119
|
+
var _vm = this, _c = _vm._self._c;
|
|
1120
|
+
return _c("editor-content", { staticClass: "dt-rich-text-editor", attrs: { "editor": _vm.editor, "data-qa": "dt-rich-text-editor" } });
|
|
1121
|
+
};
|
|
1122
|
+
var _sfc_staticRenderFns = [];
|
|
1123
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
1124
|
+
_sfc_main,
|
|
1125
|
+
_sfc_render,
|
|
1126
|
+
_sfc_staticRenderFns,
|
|
1127
|
+
false,
|
|
941
1128
|
null,
|
|
942
1129
|
null,
|
|
943
1130
|
null,
|
|
944
1131
|
null
|
|
945
1132
|
);
|
|
946
|
-
const
|
|
1133
|
+
const DtRichTextEditor = __component__.exports;
|
|
947
1134
|
export {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
1135
|
+
DtRichTextEditor,
|
|
1136
|
+
RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,
|
|
1137
|
+
RICH_TEXT_EDITOR_OUTPUT_FORMATS
|
|
951
1138
|
};
|
|
952
1139
|
//# sourceMappingURL=rich-text-editor.js.map
|