@dialpad/dialtone-vue 2.125.0 → 2.125.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +33 -0
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +1 -0
- package/dist/chunks/dropdown-SMWaTWyF.js +357 -0
- package/dist/chunks/dropdown-SMWaTWyF.js.map +1 -0
- package/dist/chunks/dropdown_constants-EUcDxBrX.js +9 -0
- package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +1 -0
- package/dist/chunks/icon_constants-OpYAAKwF.js +16 -0
- package/dist/chunks/icon_constants-OpYAAKwF.js.map +1 -0
- package/dist/chunks/index-nIyl_PL6.js +372 -0
- package/dist/chunks/index-nIyl_PL6.js.map +1 -0
- package/dist/chunks/index-o4OMWMuv.js +244 -0
- package/dist/chunks/index-o4OMWMuv.js.map +1 -0
- package/dist/chunks/input-1tm09l_-.js +273 -0
- package/dist/chunks/input-1tm09l_-.js.map +1 -0
- package/dist/chunks/input_group-zcAq3DQl.js +141 -0
- package/dist/chunks/input_group-zcAq3DQl.js.map +1 -0
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +197 -0
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js.map +1 -0
- package/dist/chunks/link_constants-vIUB92L4.js +16 -0
- package/dist/chunks/link_constants-vIUB92L4.js.map +1 -0
- package/dist/chunks/list_item_constants-LTUc74pD.js +13 -0
- package/dist/chunks/list_item_constants-LTUc74pD.js.map +1 -0
- package/dist/chunks/modal-VuMFkZFH.js +82 -0
- package/dist/chunks/modal-VuMFkZFH.js.map +1 -0
- package/dist/chunks/notice_action-9NmtQRai.js +182 -0
- package/dist/chunks/notice_action-9NmtQRai.js.map +1 -0
- package/dist/chunks/notice_constants-c--hBFQw.js +6 -0
- package/dist/chunks/notice_constants-c--hBFQw.js.map +1 -0
- package/dist/chunks/popover_constants-qjlEkroB.js +114 -0
- package/dist/chunks/popover_constants-qjlEkroB.js.map +1 -0
- package/dist/chunks/sr_only_close_button-JGole5Xi.js +86 -0
- package/dist/chunks/sr_only_close_button-JGole5Xi.js.map +1 -0
- package/dist/chunks/stack_constants-u7tNqGtc.js +13 -0
- package/dist/chunks/stack_constants-u7tNqGtc.js.map +1 -0
- package/dist/chunks/tab-Qm9LVkYj.js +346 -0
- package/dist/chunks/tab-Qm9LVkYj.js.map +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.js +354 -10368
- package/dist/dialtone-vue.js.map +1 -1
- package/dist/lib/attachment-carousel.js +250 -0
- package/dist/lib/attachment-carousel.js.map +1 -0
- package/dist/lib/avatar.js +369 -0
- package/dist/lib/avatar.js.map +1 -0
- package/dist/lib/badge.js +169 -0
- package/dist/lib/badge.js.map +1 -0
- package/dist/lib/banner.js +200 -0
- package/dist/lib/banner.js.map +1 -0
- package/dist/lib/breadcrumbs.js +138 -0
- package/dist/lib/breadcrumbs.js.map +1 -0
- package/dist/lib/button-group.js +45 -0
- package/dist/lib/button-group.js.map +1 -0
- package/dist/lib/button.js +328 -0
- package/dist/lib/button.js.map +1 -0
- package/dist/lib/callbar-button-with-popover.js +235 -0
- package/dist/lib/callbar-button-with-popover.js.map +1 -0
- package/dist/lib/callbar-button.js +175 -0
- package/dist/lib/callbar-button.js.map +1 -0
- package/dist/lib/callbox.js +142 -0
- package/dist/lib/callbox.js.map +1 -0
- package/dist/lib/card.js +72 -0
- package/dist/lib/card.js.map +1 -0
- package/dist/lib/checkbox-group.js +117 -0
- package/dist/lib/checkbox-group.js.map +1 -0
- package/dist/lib/checkbox.js +117 -0
- package/dist/lib/checkbox.js.map +1 -0
- package/dist/lib/chip.js +186 -0
- package/dist/lib/chip.js.map +1 -0
- package/dist/lib/codeblock.js +29 -0
- package/dist/lib/codeblock.js.map +1 -0
- package/dist/lib/collapsible.js +313 -0
- package/dist/lib/collapsible.js.map +1 -0
- package/dist/lib/combobox-multi-select.js +433 -0
- package/dist/lib/combobox-multi-select.js.map +1 -0
- package/dist/lib/combobox-with-popover.js +341 -0
- package/dist/lib/combobox-with-popover.js.map +1 -0
- package/dist/lib/combobox.js +19 -0
- package/dist/lib/combobox.js.map +1 -0
- package/dist/lib/constants.js +53 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/contact-info.js +145 -0
- package/dist/lib/contact-info.js.map +1 -0
- package/dist/lib/contact-row.js +203 -0
- package/dist/lib/contact-row.js.map +1 -0
- package/dist/lib/datepicker.js +552 -0
- package/dist/lib/datepicker.js.map +1 -0
- package/dist/lib/dates.js +57 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/description-list.js +83 -0
- package/dist/lib/description-list.js.map +1 -0
- package/dist/lib/dropdown.js +45 -0
- package/dist/lib/dropdown.js.map +1 -0
- package/dist/lib/editor.js +527 -0
- package/dist/lib/editor.js.map +1 -0
- package/dist/{emoji_picker-kiTOKaq8.js → lib/emoji-picker.js} +30 -12
- package/dist/lib/emoji-picker.js.map +1 -0
- package/dist/lib/emoji-row.js +83 -0
- package/dist/lib/emoji-row.js.map +1 -0
- package/dist/{emoji_text_wrapper-48ClwKvf.js → lib/emoji-text-wrapper.js} +19 -14
- package/dist/lib/emoji-text-wrapper.js.map +1 -0
- package/dist/lib/emoji.js +11 -0
- package/dist/{emoji.js.map → lib/emoji.js.map} +1 -1
- package/dist/lib/feed-item-row.js +207 -0
- package/dist/lib/feed-item-row.js.map +1 -0
- package/dist/lib/feed-pill.js +142 -0
- package/dist/lib/feed-pill.js.map +1 -0
- package/dist/lib/general-row.js +379 -0
- package/dist/lib/general-row.js.map +1 -0
- package/dist/lib/group-row.js +115 -0
- package/dist/lib/group-row.js.map +1 -0
- package/dist/lib/grouped-chip.js +45 -0
- package/dist/lib/grouped-chip.js.map +1 -0
- package/dist/lib/hovercard.js +194 -0
- package/dist/lib/hovercard.js.map +1 -0
- package/dist/lib/icon.js +82 -0
- package/dist/lib/icon.js.map +1 -0
- package/dist/lib/image-viewer.js +171 -0
- package/dist/lib/image-viewer.js.map +1 -0
- package/dist/lib/input-group.js +90 -0
- package/dist/lib/input-group.js.map +1 -0
- package/dist/lib/input.js +455 -0
- package/dist/lib/input.js.map +1 -0
- package/dist/lib/item-layout.js +39 -0
- package/dist/lib/item-layout.js.map +1 -0
- package/dist/lib/ivr-node.js +195 -0
- package/dist/lib/ivr-node.js.map +1 -0
- package/dist/lib/keyboard-shortcut.js +100 -0
- package/dist/lib/keyboard-shortcut.js.map +1 -0
- package/dist/lib/lazy-show.js +77 -0
- package/dist/lib/lazy-show.js.map +1 -0
- package/dist/lib/link.js +69 -0
- package/dist/lib/link.js.map +1 -0
- package/dist/lib/list-item-group.js +59 -0
- package/dist/lib/list-item-group.js.map +1 -0
- package/dist/lib/list-item.js +195 -0
- package/dist/lib/list-item.js.map +1 -0
- package/dist/{message_input.js → lib/message-input.js} +107 -56
- package/dist/lib/message-input.js.map +1 -0
- package/dist/lib/mixins.js +17 -0
- package/dist/lib/mixins.js.map +1 -0
- package/dist/lib/modal.js +324 -0
- package/dist/lib/modal.js.map +1 -0
- package/dist/lib/notice.js +158 -0
- package/dist/lib/notice.js.map +1 -0
- package/dist/lib/pagination.js +142 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/lib/popover.js +779 -0
- package/dist/lib/popover.js.map +1 -0
- package/dist/lib/presence.js +60 -0
- package/dist/lib/presence.js.map +1 -0
- package/dist/lib/radio-group.js +97 -0
- package/dist/lib/radio-group.js.map +1 -0
- package/dist/lib/radio.js +111 -0
- package/dist/lib/radio.js.map +1 -0
- package/dist/lib/rich-text-editor.js +920 -0
- package/dist/lib/rich-text-editor.js.map +1 -0
- package/dist/lib/root-layout.js +127 -0
- package/dist/lib/root-layout.js.map +1 -0
- package/dist/lib/select-menu.js +243 -0
- package/dist/lib/select-menu.js.map +1 -0
- package/dist/lib/settings-menu-button.js +65 -0
- package/dist/lib/settings-menu-button.js.map +1 -0
- package/dist/lib/skeleton.js +574 -0
- package/dist/lib/skeleton.js.map +1 -0
- package/dist/lib/stack.js +118 -0
- package/dist/lib/stack.js.map +1 -0
- package/dist/lib/tabs.js +93 -0
- package/dist/lib/tabs.js.map +1 -0
- package/dist/lib/time-pill.js +43 -0
- package/dist/lib/time-pill.js.map +1 -0
- package/dist/lib/toast.js +226 -0
- package/dist/lib/toast.js.map +1 -0
- package/dist/lib/toggle.js +169 -0
- package/dist/lib/toggle.js.map +1 -0
- package/dist/{directives.js → lib/tooltip-directive.js} +24 -18
- package/dist/lib/tooltip-directive.js.map +1 -0
- package/dist/lib/tooltip.js +376 -0
- package/dist/lib/tooltip.js.map +1 -0
- package/dist/lib/top-banner-info.js +60 -0
- package/dist/lib/top-banner-info.js.map +1 -0
- package/dist/lib/unread-pill.js +61 -0
- package/dist/lib/unread-pill.js.map +1 -0
- package/dist/lib/utils.js +175 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validation-messages.js +83 -0
- package/dist/lib/validation-messages.js.map +1 -0
- package/dist/lib/validators.js +12 -0
- package/dist/lib/validators.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/common/{constants.d.ts → constants/index.d.ts} +1 -1
- package/dist/types/common/constants/index.d.ts.map +1 -0
- package/dist/types/common/{dates.d.ts → dates/index.d.ts} +1 -1
- package/dist/types/common/dates/index.d.ts.map +1 -0
- package/dist/types/common/{emoji.d.ts → emoji/index.d.ts} +1 -1
- package/dist/types/common/{emoji.d.ts.map → emoji/index.d.ts.map} +1 -1
- package/dist/types/common/{utils.d.ts → utils/index.d.ts} +1 -1
- package/dist/types/common/utils/index.d.ts.map +1 -0
- package/dist/types/common/{validators.d.ts → validators/index.d.ts} +1 -1
- package/dist/types/common/validators/index.d.ts.map +1 -0
- package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/components/button/button.vue.d.ts +2 -2
- package/dist/types/components/card/card.vue.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.vue.d.ts +7 -7
- package/dist/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +2 -2
- package/dist/types/components/collapsible/collapsible.vue.d.ts +3 -3
- package/dist/types/components/combobox/combobox.vue.d.ts +7 -8
- package/dist/types/components/combobox/combobox.vue.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
- package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts +1 -219
- package/dist/types/components/icon/icon.vue.d.ts +20 -16
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/icon/icon_constants.d.ts +2 -0
- package/dist/types/components/icon/icon_constants.d.ts.map +1 -1
- package/dist/types/components/icon/index.d.ts +1 -1
- package/dist/types/components/input_group/input_group.vue.d.ts +15 -6
- package/dist/types/components/input_group/input_group.vue.d.ts.map +1 -1
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +7 -2
- package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_action.vue.d.ts +3 -1
- package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
- package/dist/types/components/radio/radio.vue.d.ts +2 -12
- package/dist/types/components/radio/radio.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts +8 -3
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
- package/dist/types/components/toggle/toggle.vue.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
- package/dist/types/index.d.ts +36 -29
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +2 -2
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
- package/package.json +18 -58
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -2904
- package/dist/dialtone-vue.cjs +0 -6
- package/dist/dialtone-vue.cjs.map +0 -1
- package/dist/directives.cjs +0 -2
- package/dist/directives.cjs.map +0 -1
- package/dist/directives.js.map +0 -1
- package/dist/emoji.cjs +0 -2
- package/dist/emoji.cjs.map +0 -1
- package/dist/emoji.js +0 -36
- package/dist/emoji_picker-kiTOKaq8.js.map +0 -1
- package/dist/emoji_picker-njWWAm6V.cjs +0 -2
- package/dist/emoji_picker-njWWAm6V.cjs.map +0 -1
- package/dist/emoji_text_wrapper-48ClwKvf.js.map +0 -1
- package/dist/emoji_text_wrapper-ZlynvHnd.cjs +0 -2
- package/dist/emoji_text_wrapper-ZlynvHnd.cjs.map +0 -1
- package/dist/index-OF94C6nQ.js +0 -142834
- package/dist/index-OF94C6nQ.js.map +0 -1
- package/dist/index-Wx7Jagcr.cjs +0 -2
- package/dist/index-Wx7Jagcr.cjs.map +0 -1
- package/dist/message_input.cjs +0 -2
- package/dist/message_input.cjs.map +0 -1
- package/dist/message_input.js.map +0 -1
- package/dist/rich_text_editor-RVMsCB8N.cjs +0 -98
- package/dist/rich_text_editor-RVMsCB8N.cjs.map +0 -1
- package/dist/rich_text_editor-eMvTs_Gp.js +0 -16479
- package/dist/rich_text_editor-eMvTs_Gp.js.map +0 -1
- package/dist/tooltip-88U5vFMA.js +0 -2517
- package/dist/tooltip-88U5vFMA.js.map +0 -1
- package/dist/tooltip-i2wxFIIi.cjs +0 -22
- package/dist/tooltip-i2wxFIIi.cjs.map +0 -1
- package/dist/types/common/constants.d.ts.map +0 -1
- package/dist/types/common/dates.d.ts.map +0 -1
- package/dist/types/common/utils.d.ts.map +0 -1
- package/dist/types/common/validators.d.ts.map +0 -1
- package/dist/types/components/emoji_picker/emojis/index.d.ts +0 -50
- package/dist/types/components/emoji_picker/emojis/index.d.ts.map +0 -1
- package/dist/types/directives.d.ts +0 -2
- package/dist/types/directives.d.ts.map +0 -1
- package/dist/types/emoji.d.ts +0 -5
- package/dist/types/emoji.d.ts.map +0 -1
- package/dist/types/message_input.d.ts +0 -3
- package/dist/types/message_input.d.ts.map +0 -1
|
@@ -0,0 +1,920 @@
|
|
|
1
|
+
import { NodeViewWrapper as R, nodeViewProps as w, VueRenderer as k, VueNodeViewRenderer as T, EditorContent as O, Editor as $ } from "@tiptap/vue-2";
|
|
2
|
+
import M from "@tiptap/extension-blockquote";
|
|
3
|
+
import D from "@tiptap/extension-code-block";
|
|
4
|
+
import H from "@tiptap/extension-document";
|
|
5
|
+
import q from "@tiptap/extension-hard-break";
|
|
6
|
+
import N from "@tiptap/extension-paragraph";
|
|
7
|
+
import B from "@tiptap/extension-placeholder";
|
|
8
|
+
import F from "@tiptap/extension-bold";
|
|
9
|
+
import U from "@tiptap/extension-bullet-list";
|
|
10
|
+
import K from "@tiptap/extension-italic";
|
|
11
|
+
import V from "@tiptap/extension-link";
|
|
12
|
+
import z from "@tiptap/extension-list-item";
|
|
13
|
+
import W from "@tiptap/extension-ordered-list";
|
|
14
|
+
import J from "@tiptap/extension-strike";
|
|
15
|
+
import X from "@tiptap/extension-underline";
|
|
16
|
+
import Y from "@tiptap/extension-text";
|
|
17
|
+
import G from "@tiptap/extension-text-align";
|
|
18
|
+
import { Node as Q, mergeAttributes as g, nodeInputRule as y, nodePasteRule as v, getMarksBetween as Z, combineTransactionSteps as tt, getChangedRanges as et, findChildrenInRange as rt, Mark as nt } from "@tiptap/core";
|
|
19
|
+
import { n as u } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
|
|
20
|
+
import { D as C, m as ot, o as S } from "../chunks/index-o4OMWMuv.js";
|
|
21
|
+
import { PluginKey as I, Plugin as it } from "@tiptap/pm/state";
|
|
22
|
+
import st from "@tiptap/suggestion";
|
|
23
|
+
import { emojisIndexed as at } from "@dialpad/dialtone-emojis";
|
|
24
|
+
import { DtListItem as ut } from "./list-item.js";
|
|
25
|
+
import { DtStack as A } from "./stack.js";
|
|
26
|
+
import j from "tippy.js";
|
|
27
|
+
import { linkRegex as ct, getPhoneNumberRegex as dt } from "./utils.js";
|
|
28
|
+
import lt from "@tiptap/extension-mention";
|
|
29
|
+
import { DtLink as mt } from "./link.js";
|
|
30
|
+
import { DtAvatar as pt } from "./avatar.js";
|
|
31
|
+
import "emoji-regex";
|
|
32
|
+
import "emoji-toolkit/emoji_strategy.json";
|
|
33
|
+
import "./skeleton.js";
|
|
34
|
+
import "../chunks/icon_constants-OpYAAKwF.js";
|
|
35
|
+
import "@dialpad/dialtone-icons/icons.json";
|
|
36
|
+
import "../chunks/list_item_constants-LTUc74pD.js";
|
|
37
|
+
import "./item-layout.js";
|
|
38
|
+
import "./icon.js";
|
|
39
|
+
import "@dialpad/dialtone-icons/vue2";
|
|
40
|
+
import "../chunks/stack_constants-u7tNqGtc.js";
|
|
41
|
+
import "./constants.js";
|
|
42
|
+
import "vue";
|
|
43
|
+
import "../chunks/link_constants-vIUB92L4.js";
|
|
44
|
+
import "./presence.js";
|
|
45
|
+
const ft = {
|
|
46
|
+
name: "EmojiComponent",
|
|
47
|
+
components: {
|
|
48
|
+
NodeViewWrapper: R,
|
|
49
|
+
DtEmoji: C
|
|
50
|
+
},
|
|
51
|
+
props: w
|
|
52
|
+
};
|
|
53
|
+
var ht = function() {
|
|
54
|
+
var e = this, r = e._self._c;
|
|
55
|
+
return r("node-view-wrapper", { staticClass: "d-d-inline-block d-va-bottom d-lh0" }, [r("dt-emoji", { attrs: { size: "500", code: e.node.attrs.code } })], 1);
|
|
56
|
+
}, gt = [], _t = /* @__PURE__ */ u(
|
|
57
|
+
ft,
|
|
58
|
+
ht,
|
|
59
|
+
gt,
|
|
60
|
+
!1,
|
|
61
|
+
null,
|
|
62
|
+
null,
|
|
63
|
+
null,
|
|
64
|
+
null
|
|
65
|
+
);
|
|
66
|
+
const yt = _t.exports, vt = {
|
|
67
|
+
name: "SuggestionList",
|
|
68
|
+
components: {
|
|
69
|
+
DtListItem: ut
|
|
70
|
+
},
|
|
71
|
+
props: {
|
|
72
|
+
items: {
|
|
73
|
+
type: Array,
|
|
74
|
+
required: !0
|
|
75
|
+
},
|
|
76
|
+
command: {
|
|
77
|
+
type: Function,
|
|
78
|
+
required: !0
|
|
79
|
+
},
|
|
80
|
+
itemComponent: {
|
|
81
|
+
type: Object,
|
|
82
|
+
required: !0
|
|
83
|
+
},
|
|
84
|
+
itemType: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: !0
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
data() {
|
|
90
|
+
return {
|
|
91
|
+
selectedIndex: 0
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
watch: {
|
|
95
|
+
items() {
|
|
96
|
+
this.selectedIndex = 0;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
onKeyDown({ event: t }) {
|
|
101
|
+
return t.key === "ArrowUp" ? (this.upHandler(), !0) : t.key === "ArrowDown" ? (this.downHandler(), !0) : t.key === "Enter" || t.key === "Tab" ? (t.preventDefault(), this.selectHandler(), t.stopPropagation(), !0) : !1;
|
|
102
|
+
},
|
|
103
|
+
upHandler() {
|
|
104
|
+
this.selectedIndex = (this.selectedIndex + this.items.length - 1) % this.items.length, this.scrollActiveElementIntoView();
|
|
105
|
+
},
|
|
106
|
+
downHandler() {
|
|
107
|
+
this.selectedIndex = (this.selectedIndex + 1) % this.items.length, this.scrollActiveElementIntoView();
|
|
108
|
+
},
|
|
109
|
+
scrollActiveElementIntoView() {
|
|
110
|
+
const t = this.$refs.suggestionList.querySelector(".dt-list-item--highlighted");
|
|
111
|
+
t && t.scrollIntoView({
|
|
112
|
+
behaviour: "smooth",
|
|
113
|
+
block: "center"
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
selectHandler() {
|
|
117
|
+
this.selectItem(this.selectedIndex);
|
|
118
|
+
},
|
|
119
|
+
selectItem(t) {
|
|
120
|
+
const e = this.items[t];
|
|
121
|
+
switch (this.itemType) {
|
|
122
|
+
case "emoji":
|
|
123
|
+
this.command(e);
|
|
124
|
+
return;
|
|
125
|
+
case "mention":
|
|
126
|
+
this.command({ name: e.name, id: e.id, avatarSrc: e.avatarSrc });
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
var bt = function() {
|
|
133
|
+
var e = this, r = e._self._c;
|
|
134
|
+
return r("div", { staticClass: "d-popover__dialog" }, [r("ul", { directives: [{ name: "show", rawName: "v-show", value: e.items.length, expression: "items.length" }], ref: "suggestionList", staticClass: "dt-suggestion-list" }, e._l(e.items, function(n, o) {
|
|
135
|
+
return r("dt-list-item", { key: n.id, class: [
|
|
136
|
+
"dt-suggestion-list--item",
|
|
137
|
+
{ "dt-list-item--highlighted": o === e.selectedIndex }
|
|
138
|
+
], attrs: { "navigation-type": "arrow-keys" }, on: { click: function(i) {
|
|
139
|
+
return e.selectItem(o);
|
|
140
|
+
}, keydown: function(i) {
|
|
141
|
+
return i.preventDefault(), i.stopPropagation(), e.onKeyDown.apply(null, arguments);
|
|
142
|
+
} } }, [r(e.itemComponent, { tag: "component", attrs: { item: n } })], 1);
|
|
143
|
+
}), 1)]);
|
|
144
|
+
}, xt = [], Et = /* @__PURE__ */ u(
|
|
145
|
+
vt,
|
|
146
|
+
bt,
|
|
147
|
+
xt,
|
|
148
|
+
!1,
|
|
149
|
+
null,
|
|
150
|
+
null,
|
|
151
|
+
null,
|
|
152
|
+
null
|
|
153
|
+
);
|
|
154
|
+
const L = Et.exports, Rt = {
|
|
155
|
+
name: "EmojiSuggestion",
|
|
156
|
+
components: {
|
|
157
|
+
DtEmoji: C,
|
|
158
|
+
DtStack: A
|
|
159
|
+
},
|
|
160
|
+
props: {
|
|
161
|
+
item: {
|
|
162
|
+
type: Object,
|
|
163
|
+
required: !0
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
var wt = function() {
|
|
168
|
+
var e = this, r = e._self._c;
|
|
169
|
+
return r("dt-stack", { attrs: { direction: "row", gap: "400" } }, [r("dt-emoji", { attrs: { size: "200", code: e.item.code } }), e._v(" " + e._s(e.item.code) + " ")], 1);
|
|
170
|
+
}, kt = [], Tt = /* @__PURE__ */ u(
|
|
171
|
+
Rt,
|
|
172
|
+
wt,
|
|
173
|
+
kt,
|
|
174
|
+
!1,
|
|
175
|
+
null,
|
|
176
|
+
null,
|
|
177
|
+
null,
|
|
178
|
+
null
|
|
179
|
+
);
|
|
180
|
+
const Ct = Tt.exports, St = {
|
|
181
|
+
items: ({ query: t }) => t.length < 2 ? [] : Object.values(at).filter(function(n) {
|
|
182
|
+
return !!n.shortname.substring(1, n.shortname.length - 1).startsWith(t.toLowerCase());
|
|
183
|
+
}).map((n) => ({ id: n.unicode_character, code: n.shortname })),
|
|
184
|
+
command: ({ editor: t, range: e, props: r }) => {
|
|
185
|
+
var i, s;
|
|
186
|
+
const n = t.view.state.selection.$to.nodeAfter;
|
|
187
|
+
((i = n == null ? void 0 : n.text) == null ? void 0 : i.startsWith(" ")) && (e.to += 1), t.chain().focus().insertContentAt(e, [
|
|
188
|
+
{
|
|
189
|
+
type: "emoji",
|
|
190
|
+
attrs: r
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
type: "text",
|
|
194
|
+
text: " "
|
|
195
|
+
}
|
|
196
|
+
]).run(), (s = window.getSelection()) == null || s.collapseToEnd();
|
|
197
|
+
},
|
|
198
|
+
render: () => {
|
|
199
|
+
let t, e;
|
|
200
|
+
return {
|
|
201
|
+
onStart: (r) => {
|
|
202
|
+
t = new k(L, {
|
|
203
|
+
parent: void 0,
|
|
204
|
+
propsData: {
|
|
205
|
+
itemComponent: Ct,
|
|
206
|
+
itemType: "emoji",
|
|
207
|
+
...r
|
|
208
|
+
},
|
|
209
|
+
editor: r.editor
|
|
210
|
+
}), r.clientRect && (e = j("body", {
|
|
211
|
+
getReferenceClientRect: r.clientRect,
|
|
212
|
+
appendTo: () => document.body,
|
|
213
|
+
content: t.element,
|
|
214
|
+
showOnCreate: !0,
|
|
215
|
+
interactive: !0,
|
|
216
|
+
trigger: "manual",
|
|
217
|
+
placement: "top-start",
|
|
218
|
+
contentElement: null,
|
|
219
|
+
zIndex: 650
|
|
220
|
+
}));
|
|
221
|
+
},
|
|
222
|
+
onUpdate(r) {
|
|
223
|
+
t.updateProps(r), r.clientRect && e[0].setProps({
|
|
224
|
+
getReferenceClientRect: r.clientRect
|
|
225
|
+
});
|
|
226
|
+
},
|
|
227
|
+
onKeyDown(r) {
|
|
228
|
+
var n;
|
|
229
|
+
return r.event.key === "Escape" ? (e[0].hide(), !0) : (n = t.ref) == null ? void 0 : n.onKeyDown(r);
|
|
230
|
+
},
|
|
231
|
+
onExit() {
|
|
232
|
+
e[0].destroy(), t.destroy();
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}, It = new I("emoji"), At = /:\w+:$/, jt = /:\w+:/g, Lt = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])$/, Pt = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g, b = (t) => {
|
|
237
|
+
if (t && S(t[0]))
|
|
238
|
+
return {
|
|
239
|
+
index: t.index,
|
|
240
|
+
text: t[0],
|
|
241
|
+
match: t
|
|
242
|
+
};
|
|
243
|
+
}, Ot = (t) => [...t.matchAll(jt)].filter((r) => S(r[0])).map((r) => ({
|
|
244
|
+
index: r.index,
|
|
245
|
+
text: r[0],
|
|
246
|
+
match: r
|
|
247
|
+
})), $t = Q.create({
|
|
248
|
+
addOptions() {
|
|
249
|
+
return {
|
|
250
|
+
HTMLAttributes: {},
|
|
251
|
+
suggestion: {
|
|
252
|
+
char: ":",
|
|
253
|
+
pluginKey: It
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
name: "emoji",
|
|
258
|
+
group: "inline",
|
|
259
|
+
inline: !0,
|
|
260
|
+
selectable: !0,
|
|
261
|
+
addNodeView() {
|
|
262
|
+
return T(yt);
|
|
263
|
+
},
|
|
264
|
+
addAttributes() {
|
|
265
|
+
return {
|
|
266
|
+
code: {
|
|
267
|
+
default: null
|
|
268
|
+
},
|
|
269
|
+
id: {
|
|
270
|
+
default: null
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
},
|
|
274
|
+
parseHTML() {
|
|
275
|
+
return [
|
|
276
|
+
{
|
|
277
|
+
tag: "emoji-component"
|
|
278
|
+
}
|
|
279
|
+
];
|
|
280
|
+
},
|
|
281
|
+
renderText({ node: t }) {
|
|
282
|
+
return t.attrs.code;
|
|
283
|
+
},
|
|
284
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
285
|
+
return ["emoji-component", g(this.options.HTMLAttributes, t)];
|
|
286
|
+
},
|
|
287
|
+
addInputRules() {
|
|
288
|
+
return [
|
|
289
|
+
// shortcode input
|
|
290
|
+
y({
|
|
291
|
+
find: (t) => {
|
|
292
|
+
const e = t.match(At);
|
|
293
|
+
return b(e);
|
|
294
|
+
},
|
|
295
|
+
type: this.type,
|
|
296
|
+
getAttributes(t) {
|
|
297
|
+
return {
|
|
298
|
+
code: t[0]
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
}),
|
|
302
|
+
y({
|
|
303
|
+
find: (t) => {
|
|
304
|
+
const e = t.match(Lt);
|
|
305
|
+
return b(e);
|
|
306
|
+
},
|
|
307
|
+
type: this.type,
|
|
308
|
+
getAttributes(t) {
|
|
309
|
+
const e = ot(t[0]).unicode_output;
|
|
310
|
+
return {
|
|
311
|
+
code: String.fromCodePoint(parseInt(e, 16)),
|
|
312
|
+
label: "emoji"
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
})
|
|
316
|
+
];
|
|
317
|
+
},
|
|
318
|
+
addPasteRules() {
|
|
319
|
+
return [
|
|
320
|
+
v({
|
|
321
|
+
find: Ot,
|
|
322
|
+
type: this.type,
|
|
323
|
+
getAttributes(t) {
|
|
324
|
+
return {
|
|
325
|
+
code: t[0]
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
}),
|
|
329
|
+
v({
|
|
330
|
+
find: Pt,
|
|
331
|
+
type: this.type,
|
|
332
|
+
getAttributes(t) {
|
|
333
|
+
return {
|
|
334
|
+
code: t[0]
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
})
|
|
338
|
+
];
|
|
339
|
+
},
|
|
340
|
+
addProseMirrorPlugins() {
|
|
341
|
+
return [
|
|
342
|
+
st({
|
|
343
|
+
editor: this.editor,
|
|
344
|
+
...this.options.suggestion,
|
|
345
|
+
...St
|
|
346
|
+
})
|
|
347
|
+
];
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
function Mt(t, e, r = () => !0) {
|
|
351
|
+
const n = [];
|
|
352
|
+
e.lastIndex = 0;
|
|
353
|
+
let o;
|
|
354
|
+
for (; o = e.exec(t); )
|
|
355
|
+
r(t, o) && n.push(o);
|
|
356
|
+
return n;
|
|
357
|
+
}
|
|
358
|
+
function Dt(t, e) {
|
|
359
|
+
return !["#", "@"].includes(t.charAt(e.index)) && !["#", "@"].includes(t.charAt(e.index - 1));
|
|
360
|
+
}
|
|
361
|
+
function Ht(t) {
|
|
362
|
+
const e = new RegExp(
|
|
363
|
+
"(?:" + [
|
|
364
|
+
`[!?.,:;'"]`,
|
|
365
|
+
"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"
|
|
366
|
+
].join("|"),
|
|
367
|
+
"g"
|
|
368
|
+
);
|
|
369
|
+
return t.replace(e, "");
|
|
370
|
+
}
|
|
371
|
+
function qt(t, e) {
|
|
372
|
+
const r = t.slice(0, e + 1).search(/\S+\s*$/), n = t.slice(e).search(/\s/);
|
|
373
|
+
if (n < 0) {
|
|
374
|
+
const o = t.slice(r);
|
|
375
|
+
return {
|
|
376
|
+
text: o,
|
|
377
|
+
from: r,
|
|
378
|
+
to: r + o.length
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
text: t.slice(r, n + e),
|
|
383
|
+
from: r,
|
|
384
|
+
to: n + e
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
function h(t, e, r, n) {
|
|
388
|
+
const o = qt(t, e);
|
|
389
|
+
if (n.lastIndex = 0, !n.test(o.text))
|
|
390
|
+
return o;
|
|
391
|
+
const i = r === "left" ? o.from - 1 : o.to + 1;
|
|
392
|
+
return i <= 0 || i >= t.length || i === e ? o : h(t, i, r, n);
|
|
393
|
+
}
|
|
394
|
+
function Nt(t, e, r, n) {
|
|
395
|
+
const o = Math.max(t.from - 1, 0), i = Math.min(t.to + 1, e.content.size), s = Z(o, i, e);
|
|
396
|
+
for (const a of s)
|
|
397
|
+
a.mark.type === n && r.removeMark(a.from, a.to, n);
|
|
398
|
+
}
|
|
399
|
+
const x = dt(1, 15);
|
|
400
|
+
function E(t, e, r, n, o, i) {
|
|
401
|
+
if (!t)
|
|
402
|
+
return;
|
|
403
|
+
let s = r - e - 1;
|
|
404
|
+
s = s < 0 ? 0 : s;
|
|
405
|
+
const a = n - e, l = h(
|
|
406
|
+
t,
|
|
407
|
+
s,
|
|
408
|
+
"left",
|
|
409
|
+
x
|
|
410
|
+
), _ = h(
|
|
411
|
+
t,
|
|
412
|
+
a,
|
|
413
|
+
"right",
|
|
414
|
+
x
|
|
415
|
+
), c = t.slice(l.from, _.to);
|
|
416
|
+
Mt(c, ct, Dt).forEach((f) => {
|
|
417
|
+
const d = Ht(f[0]), p = e + l.from + f.index + 1, P = p + d.length;
|
|
418
|
+
o.addMark(p, P, i.create());
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function Bt(t) {
|
|
422
|
+
let e = !1;
|
|
423
|
+
return new it({
|
|
424
|
+
key: new I("autolink"),
|
|
425
|
+
appendTransaction: (r, n, o) => {
|
|
426
|
+
const i = r.some((c) => c.docChanged) && !n.doc.eq(o.doc);
|
|
427
|
+
if (e && !i)
|
|
428
|
+
return;
|
|
429
|
+
const { tr: s } = o, { textContent: a } = o.doc;
|
|
430
|
+
e || E(a, 0, 0, a.length, s, t.type), e = !0;
|
|
431
|
+
const l = tt(
|
|
432
|
+
n.doc,
|
|
433
|
+
[...r]
|
|
434
|
+
);
|
|
435
|
+
return et(l).forEach(({ oldRange: c, newRange: m }) => {
|
|
436
|
+
Nt(m, o.doc, s, t.type), rt(
|
|
437
|
+
o.doc,
|
|
438
|
+
m,
|
|
439
|
+
(d) => d.isTextblock
|
|
440
|
+
).forEach(({ node: d, pos: p }) => {
|
|
441
|
+
E(
|
|
442
|
+
d.textContent,
|
|
443
|
+
p,
|
|
444
|
+
c.from,
|
|
445
|
+
m.to,
|
|
446
|
+
s,
|
|
447
|
+
t.type
|
|
448
|
+
);
|
|
449
|
+
});
|
|
450
|
+
}), s;
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
const Ft = {
|
|
455
|
+
class: "d-link d-c-text d-d-inline-block",
|
|
456
|
+
rel: "noopener noreferrer nofollow"
|
|
457
|
+
}, Ut = nt.create({
|
|
458
|
+
name: "Link",
|
|
459
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
460
|
+
return [
|
|
461
|
+
"a",
|
|
462
|
+
g(
|
|
463
|
+
this.options.HTMLAttributes,
|
|
464
|
+
t,
|
|
465
|
+
Ft
|
|
466
|
+
),
|
|
467
|
+
0
|
|
468
|
+
];
|
|
469
|
+
},
|
|
470
|
+
renderText({ node: t }) {
|
|
471
|
+
return t.attrs.text;
|
|
472
|
+
},
|
|
473
|
+
addProseMirrorPlugins() {
|
|
474
|
+
return [
|
|
475
|
+
Bt({ type: this.type })
|
|
476
|
+
];
|
|
477
|
+
}
|
|
478
|
+
}), Kt = {
|
|
479
|
+
name: "MentionComponent",
|
|
480
|
+
components: {
|
|
481
|
+
NodeViewWrapper: R,
|
|
482
|
+
DtLink: mt
|
|
483
|
+
},
|
|
484
|
+
props: w,
|
|
485
|
+
computed: {
|
|
486
|
+
text() {
|
|
487
|
+
return "@" + this.$props.node.attrs.name;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
var Vt = function() {
|
|
492
|
+
var e = this, r = e._self._c;
|
|
493
|
+
return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [r("dt-link", { attrs: { kind: "mention" } }, [e._v(" " + e._s(e.text) + " ")])], 1);
|
|
494
|
+
}, zt = [], Wt = /* @__PURE__ */ u(
|
|
495
|
+
Kt,
|
|
496
|
+
Vt,
|
|
497
|
+
zt,
|
|
498
|
+
!1,
|
|
499
|
+
null,
|
|
500
|
+
null,
|
|
501
|
+
null,
|
|
502
|
+
null
|
|
503
|
+
);
|
|
504
|
+
const Jt = Wt.exports, Xt = lt.extend({
|
|
505
|
+
addNodeView() {
|
|
506
|
+
return T(Jt);
|
|
507
|
+
},
|
|
508
|
+
parseHTML() {
|
|
509
|
+
return [
|
|
510
|
+
{
|
|
511
|
+
tag: "mention-component"
|
|
512
|
+
}
|
|
513
|
+
];
|
|
514
|
+
},
|
|
515
|
+
addAttributes() {
|
|
516
|
+
return {
|
|
517
|
+
name: {
|
|
518
|
+
default: ""
|
|
519
|
+
},
|
|
520
|
+
avatarSrc: {
|
|
521
|
+
default: ""
|
|
522
|
+
},
|
|
523
|
+
id: {
|
|
524
|
+
default: ""
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
},
|
|
528
|
+
renderText({ node: t }) {
|
|
529
|
+
return `@${t.attrs.id}`;
|
|
530
|
+
},
|
|
531
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
532
|
+
return ["mention-component", g(this.options.HTMLAttributes, t), 0];
|
|
533
|
+
}
|
|
534
|
+
}), Yt = [
|
|
535
|
+
"text",
|
|
536
|
+
"json",
|
|
537
|
+
"html"
|
|
538
|
+
], Gt = [
|
|
539
|
+
"start",
|
|
540
|
+
"end",
|
|
541
|
+
"all"
|
|
542
|
+
], Qt = [
|
|
543
|
+
"https",
|
|
544
|
+
"http",
|
|
545
|
+
"ftp",
|
|
546
|
+
"ftps",
|
|
547
|
+
"sftp",
|
|
548
|
+
"mailto"
|
|
549
|
+
], Zt = {
|
|
550
|
+
name: "MentionSuggestion",
|
|
551
|
+
components: {
|
|
552
|
+
DtAvatar: pt,
|
|
553
|
+
DtStack: A
|
|
554
|
+
},
|
|
555
|
+
props: {
|
|
556
|
+
item: {
|
|
557
|
+
type: Object,
|
|
558
|
+
required: !0
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
computed: {
|
|
562
|
+
name() {
|
|
563
|
+
return this.item.name;
|
|
564
|
+
},
|
|
565
|
+
avatarSrc() {
|
|
566
|
+
return this.item.avatarSrc;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
var te = function() {
|
|
571
|
+
var e = this, r = e._self._c;
|
|
572
|
+
return r("dt-stack", { attrs: { direction: "row", gap: "400" } }, [r("dt-avatar", { attrs: { "full-name": e.name, "image-src": e.avatarSrc, "image-alt": e.name, size: "xs" } }), e._v(" " + e._s(e.name) + " ")], 1);
|
|
573
|
+
}, ee = [], re = /* @__PURE__ */ u(
|
|
574
|
+
Zt,
|
|
575
|
+
te,
|
|
576
|
+
ee,
|
|
577
|
+
!1,
|
|
578
|
+
null,
|
|
579
|
+
null,
|
|
580
|
+
null,
|
|
581
|
+
null
|
|
582
|
+
);
|
|
583
|
+
const ne = re.exports, oe = {
|
|
584
|
+
// This function comes from the user and passed to the editor directly.
|
|
585
|
+
// This will also activate the mention plugin on the editor
|
|
586
|
+
// items: ({ query }) => { return [] },
|
|
587
|
+
allowSpaces: !0,
|
|
588
|
+
render: () => {
|
|
589
|
+
let t, e;
|
|
590
|
+
return {
|
|
591
|
+
onStart: (r) => {
|
|
592
|
+
t = new k(L, {
|
|
593
|
+
parent: void 0,
|
|
594
|
+
propsData: {
|
|
595
|
+
itemComponent: ne,
|
|
596
|
+
itemType: "mention",
|
|
597
|
+
...r
|
|
598
|
+
},
|
|
599
|
+
editor: r.editor
|
|
600
|
+
}), r.clientRect && (e = j("body", {
|
|
601
|
+
getReferenceClientRect: r.clientRect,
|
|
602
|
+
appendTo: () => document.body,
|
|
603
|
+
content: t.element,
|
|
604
|
+
showOnCreate: !0,
|
|
605
|
+
interactive: !0,
|
|
606
|
+
trigger: "manual",
|
|
607
|
+
placement: "top-start"
|
|
608
|
+
}));
|
|
609
|
+
},
|
|
610
|
+
onUpdate(r) {
|
|
611
|
+
t.updateProps(r), r.clientRect && e[0].setProps({
|
|
612
|
+
getReferenceClientRect: r.clientRect
|
|
613
|
+
});
|
|
614
|
+
},
|
|
615
|
+
onKeyDown(r) {
|
|
616
|
+
return r.event.key === "Escape" ? (e[0].hide(), !0) : t == null ? void 0 : t.ref.onKeyDown(r);
|
|
617
|
+
},
|
|
618
|
+
onExit() {
|
|
619
|
+
e[0].destroy(), t.destroy();
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
}, ie = {
|
|
624
|
+
name: "DtRichTextEditor",
|
|
625
|
+
components: {
|
|
626
|
+
EditorContent: O
|
|
627
|
+
},
|
|
628
|
+
props: {
|
|
629
|
+
/**
|
|
630
|
+
* Value of the input. The object format should match TipTap's JSON
|
|
631
|
+
* document structure: https://tiptap.dev/guide/output#option-1-json
|
|
632
|
+
*/
|
|
633
|
+
value: {
|
|
634
|
+
type: [Object, String],
|
|
635
|
+
default: ""
|
|
636
|
+
},
|
|
637
|
+
/**
|
|
638
|
+
* Whether the input is editable
|
|
639
|
+
*/
|
|
640
|
+
editable: {
|
|
641
|
+
type: Boolean,
|
|
642
|
+
default: !0
|
|
643
|
+
},
|
|
644
|
+
/**
|
|
645
|
+
* Whether the input allows for line breaks to be introduced in the text.
|
|
646
|
+
*/
|
|
647
|
+
allowLineBreaks: {
|
|
648
|
+
type: Boolean,
|
|
649
|
+
default: !1
|
|
650
|
+
},
|
|
651
|
+
/**
|
|
652
|
+
* Descriptive label for the input element
|
|
653
|
+
*/
|
|
654
|
+
inputAriaLabel: {
|
|
655
|
+
type: String,
|
|
656
|
+
required: !0
|
|
657
|
+
},
|
|
658
|
+
/**
|
|
659
|
+
* Additional class name for the input element. Only accepts a String value
|
|
660
|
+
* because this is passed to the editor via options. For multiple classes,
|
|
661
|
+
* join them into one string, e.g. "d-p8 d-hmx96"
|
|
662
|
+
*/
|
|
663
|
+
inputClass: {
|
|
664
|
+
type: String,
|
|
665
|
+
default: ""
|
|
666
|
+
},
|
|
667
|
+
/**
|
|
668
|
+
* Whether the input should receive focus after the component has been
|
|
669
|
+
* mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.
|
|
670
|
+
* - `start` Sets the focus to the beginning of the input
|
|
671
|
+
* - `end` Sets the focus to the end of the input
|
|
672
|
+
* - `all` Selects the whole contents of the input
|
|
673
|
+
* - `Number` Sets the focus to a specific position in the input
|
|
674
|
+
* - `true` Defaults to `start`
|
|
675
|
+
* - `false` Disables autofocus
|
|
676
|
+
* @values true, false, start, end, all, number
|
|
677
|
+
*/
|
|
678
|
+
autoFocus: {
|
|
679
|
+
type: [Boolean, String, Number],
|
|
680
|
+
default: !1,
|
|
681
|
+
validator(t) {
|
|
682
|
+
return typeof t == "string" ? Gt.includes(t) : !0;
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
/**
|
|
686
|
+
* The output format that the editor uses when emitting the "@input" event.
|
|
687
|
+
* One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for
|
|
688
|
+
* examples.
|
|
689
|
+
* @values text, json, html
|
|
690
|
+
*/
|
|
691
|
+
outputFormat: {
|
|
692
|
+
type: String,
|
|
693
|
+
default: "text",
|
|
694
|
+
validator(t) {
|
|
695
|
+
return Yt.includes(t);
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
/**
|
|
699
|
+
* Placeholder text
|
|
700
|
+
*/
|
|
701
|
+
placeholder: {
|
|
702
|
+
type: String,
|
|
703
|
+
default: ""
|
|
704
|
+
},
|
|
705
|
+
/**
|
|
706
|
+
* Enables the Link extension and optionally passes configurations to it
|
|
707
|
+
*/
|
|
708
|
+
link: {
|
|
709
|
+
type: [Boolean, Object],
|
|
710
|
+
default: !1
|
|
711
|
+
},
|
|
712
|
+
/**
|
|
713
|
+
* suggestion object containing the items query function.
|
|
714
|
+
* The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion
|
|
715
|
+
*
|
|
716
|
+
* The only required key is the items function which is used to query the contacts for suggestion.
|
|
717
|
+
* items({ query }) => { return [ContactObject]; }
|
|
718
|
+
* ContactObject format:
|
|
719
|
+
* { name: string, avatarSrc: string, id: string }
|
|
720
|
+
*
|
|
721
|
+
* When null, it does not add the plugin.
|
|
722
|
+
*/
|
|
723
|
+
mentionSuggestion: {
|
|
724
|
+
type: Object,
|
|
725
|
+
default: null
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
emits: [
|
|
729
|
+
/**
|
|
730
|
+
* Editor input event
|
|
731
|
+
* @event input
|
|
732
|
+
* @type {String|JSON}
|
|
733
|
+
*/
|
|
734
|
+
"input",
|
|
735
|
+
/**
|
|
736
|
+
* Event to sync the value with the parent
|
|
737
|
+
* @event input
|
|
738
|
+
* @type {String|JSON}
|
|
739
|
+
*/
|
|
740
|
+
"update:value",
|
|
741
|
+
/**
|
|
742
|
+
* Editor blur event
|
|
743
|
+
* @event blur
|
|
744
|
+
* @type {FocusEvent}
|
|
745
|
+
*/
|
|
746
|
+
"blur",
|
|
747
|
+
/**
|
|
748
|
+
* Editor focus event
|
|
749
|
+
* @event focus
|
|
750
|
+
* @type {FocusEvent}
|
|
751
|
+
*/
|
|
752
|
+
"focus"
|
|
753
|
+
],
|
|
754
|
+
data() {
|
|
755
|
+
return {
|
|
756
|
+
editor: null,
|
|
757
|
+
popoverOpened: !1
|
|
758
|
+
};
|
|
759
|
+
},
|
|
760
|
+
computed: {
|
|
761
|
+
extensions() {
|
|
762
|
+
const t = [
|
|
763
|
+
M,
|
|
764
|
+
F,
|
|
765
|
+
U,
|
|
766
|
+
H,
|
|
767
|
+
K,
|
|
768
|
+
z,
|
|
769
|
+
N,
|
|
770
|
+
J,
|
|
771
|
+
Y,
|
|
772
|
+
X
|
|
773
|
+
];
|
|
774
|
+
if (this.link && t.push(this.getExtension(Ut, this.link)), t.push(
|
|
775
|
+
B.configure({ placeholder: this.placeholder })
|
|
776
|
+
), this.allowLineBreaks || t.push(
|
|
777
|
+
q.extend({
|
|
778
|
+
addKeyboardShortcuts() {
|
|
779
|
+
return {
|
|
780
|
+
Enter: () => !0,
|
|
781
|
+
"Shift-Enter": () => this.editor.commands.first(({ commands: e }) => [
|
|
782
|
+
() => e.newlineInCode(),
|
|
783
|
+
() => e.createParagraphNear(),
|
|
784
|
+
() => e.liftEmptyBlock(),
|
|
785
|
+
() => e.splitBlock()
|
|
786
|
+
])
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
})
|
|
790
|
+
), t.push(V.extend({ inclusive: !1 }).configure({
|
|
791
|
+
autolink: !0,
|
|
792
|
+
protocols: Qt
|
|
793
|
+
})), this.mentionSuggestion) {
|
|
794
|
+
const e = { ...this.mentionSuggestion, ...oe };
|
|
795
|
+
t.push(Xt.configure({ suggestion: e }));
|
|
796
|
+
}
|
|
797
|
+
return t.push($t), t.push(G.configure({
|
|
798
|
+
types: ["paragraph"],
|
|
799
|
+
defaultAlignment: "left"
|
|
800
|
+
})), t.push(D.configure({
|
|
801
|
+
HTMLAttributes: {
|
|
802
|
+
class: "dt-rich-text-editor--code-block"
|
|
803
|
+
}
|
|
804
|
+
})), t.push(W.configure({
|
|
805
|
+
itemTypeName: "listItem"
|
|
806
|
+
})), t;
|
|
807
|
+
},
|
|
808
|
+
inputAttrs() {
|
|
809
|
+
const t = {
|
|
810
|
+
"aria-label": this.inputAriaLabel,
|
|
811
|
+
"aria-multiline": !0,
|
|
812
|
+
role: "textbox"
|
|
813
|
+
};
|
|
814
|
+
return this.editable || (t["aria-readonly"] = !0), t;
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
/**
|
|
818
|
+
* Because the Editor instance is initialized when mounted it does not get
|
|
819
|
+
* updated props automatically, so the ones that can change after mount have
|
|
820
|
+
* to be hooked up to the Editor's own API.
|
|
821
|
+
*/
|
|
822
|
+
watch: {
|
|
823
|
+
editable(t) {
|
|
824
|
+
this.editor.setEditable(t), this.updateEditorAttributes({ "aria-readonly": !t });
|
|
825
|
+
},
|
|
826
|
+
inputClass(t) {
|
|
827
|
+
this.updateEditorAttributes({ class: t });
|
|
828
|
+
},
|
|
829
|
+
inputAriaLabel(t) {
|
|
830
|
+
this.updateEditorAttributes({ "aria-label": t });
|
|
831
|
+
},
|
|
832
|
+
extensions() {
|
|
833
|
+
this.destroyEditor(), this.createEditor();
|
|
834
|
+
},
|
|
835
|
+
value(t) {
|
|
836
|
+
let e = this.getOutput();
|
|
837
|
+
this.outputFormat === "json" && (t = JSON.stringify(t), e = JSON.stringify(e)), t !== e && this.editor.commands.setContent(t, !1);
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
created() {
|
|
841
|
+
this.createEditor();
|
|
842
|
+
},
|
|
843
|
+
beforeUnmount() {
|
|
844
|
+
this.destroyEditor();
|
|
845
|
+
},
|
|
846
|
+
methods: {
|
|
847
|
+
createEditor() {
|
|
848
|
+
this.editor = new $({
|
|
849
|
+
autofocus: this.autoFocus,
|
|
850
|
+
content: this.value,
|
|
851
|
+
editable: this.editable,
|
|
852
|
+
extensions: this.extensions,
|
|
853
|
+
editorProps: {
|
|
854
|
+
attributes: {
|
|
855
|
+
...this.inputAttrs,
|
|
856
|
+
class: this.inputClass
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}), this.addEditorListeners();
|
|
860
|
+
},
|
|
861
|
+
destroyEditor() {
|
|
862
|
+
this.editor.destroy();
|
|
863
|
+
},
|
|
864
|
+
/**
|
|
865
|
+
* The Editor exposes event hooks that we have to map our emits into. See
|
|
866
|
+
* https://tiptap.dev/api/events for all events.
|
|
867
|
+
*/
|
|
868
|
+
addEditorListeners() {
|
|
869
|
+
this.editor.on("update", () => {
|
|
870
|
+
const t = this.getOutput();
|
|
871
|
+
this.$emit("input", t), this.$emit("update:value", t);
|
|
872
|
+
}), this.editor.on("focus", ({ event: t }) => {
|
|
873
|
+
this.$emit("focus", t);
|
|
874
|
+
}), this.editor.on("blur", ({ event: t }) => {
|
|
875
|
+
this.$emit("blur", t);
|
|
876
|
+
});
|
|
877
|
+
},
|
|
878
|
+
getOutput() {
|
|
879
|
+
switch (this.outputFormat) {
|
|
880
|
+
case "json":
|
|
881
|
+
return this.editor.getJSON();
|
|
882
|
+
case "html":
|
|
883
|
+
return this.editor.getHTML();
|
|
884
|
+
case "text":
|
|
885
|
+
default:
|
|
886
|
+
return this.editor.getText();
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
getExtension(t, e) {
|
|
890
|
+
var r;
|
|
891
|
+
return typeof e == "boolean" ? t : (r = t.configure) == null ? void 0 : r.call(t, e);
|
|
892
|
+
},
|
|
893
|
+
updateEditorAttributes(t) {
|
|
894
|
+
this.editor.setOptions({ editorProps: { attributes: t } });
|
|
895
|
+
},
|
|
896
|
+
focusEditor() {
|
|
897
|
+
this.editor.commands.focus();
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
var se = function() {
|
|
902
|
+
var e = this, r = e._self._c;
|
|
903
|
+
return r("editor-content", { staticClass: "dt-rich-text-editor", attrs: { editor: e.editor, "data-qa": "dt-rich-text-editor" } });
|
|
904
|
+
}, ae = [], ue = /* @__PURE__ */ u(
|
|
905
|
+
ie,
|
|
906
|
+
se,
|
|
907
|
+
ae,
|
|
908
|
+
!1,
|
|
909
|
+
null,
|
|
910
|
+
null,
|
|
911
|
+
null,
|
|
912
|
+
null
|
|
913
|
+
);
|
|
914
|
+
const Ze = ue.exports;
|
|
915
|
+
export {
|
|
916
|
+
Ze as DtRichTextEditor,
|
|
917
|
+
Gt as RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,
|
|
918
|
+
Yt as RICH_TEXT_EDITOR_OUTPUT_FORMATS
|
|
919
|
+
};
|
|
920
|
+
//# sourceMappingURL=rich-text-editor.js.map
|