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