@dialpad/dialtone 9.161.0 → 9.162.0
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/tokens/doc.json +102311 -102311
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +10 -10
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +2351 -830
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/node_modules/@tiptap/vue-3.cjs +1 -1
- package/dist/vue3/node_modules/@tiptap/vue-3.cjs.map +1 -1
- package/dist/vue3/node_modules/@tiptap/vue-3.js +233 -209
- package/dist/vue3/node_modules/@tiptap/vue-3.js.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/channels/suggestion.d.ts +1 -6
- package/dist/vue3/types/components/rich_text_editor/extensions/channels/suggestion.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts +1 -6
- package/dist/vue3/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/mentions/suggestion.d.ts +1 -6
- package/dist/vue3/types/components/rich_text_editor/extensions/mentions/suggestion.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/slash_command/suggestion.d.ts +1 -6
- package/dist/vue3/types/components/rich_text_editor/extensions/slash_command/suggestion.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/utils/suggestion_utils.d.ts +29 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/utils/suggestion_utils.d.ts.map +1 -0
- package/package.json +31 -37
- package/dist/vue3/types/components/rich_text_editor/extensions/tippy_plugins/hide_on_esc.d.ts +0 -12
- package/dist/vue3/types/components/rich_text_editor/extensions/tippy_plugins/hide_on_esc.d.ts.map +0 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +0 -768
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +0 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +0 -4072
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +0 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +0 -8005
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +0 -1
|
@@ -1,72 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineComponent as d, ref as l, onMounted as c, onBeforeUnmount as a, h as u, getCurrentInstance as y, watchEffect as b, nextTick as C, unref as w, markRaw as f, reactive as S, render as h, shallowRef as _, customRef as x, provide as v } from "vue";
|
|
3
|
-
import { Editor as N, NodeView as O } from "@tiptap/core";
|
|
1
|
+
import { Editor as y, MarkView as g, NodeView as w } from "@tiptap/core";
|
|
4
2
|
export * from "@tiptap/core";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
props: {
|
|
9
|
-
pluginKey: {
|
|
10
|
-
type: [String, Object],
|
|
11
|
-
default: "bubbleMenu"
|
|
12
|
-
},
|
|
13
|
-
editor: {
|
|
14
|
-
type: Object,
|
|
15
|
-
required: !0
|
|
16
|
-
},
|
|
17
|
-
updateDelay: {
|
|
18
|
-
type: Number,
|
|
19
|
-
default: void 0
|
|
20
|
-
},
|
|
21
|
-
tippyOptions: {
|
|
22
|
-
type: Object,
|
|
23
|
-
default: () => ({})
|
|
24
|
-
},
|
|
25
|
-
shouldShow: {
|
|
26
|
-
type: Function,
|
|
27
|
-
default: null
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
setup(r, { slots: t }) {
|
|
31
|
-
const n = l(null);
|
|
32
|
-
return c(() => {
|
|
33
|
-
const { updateDelay: e, editor: o, pluginKey: i, shouldShow: s, tippyOptions: p } = r;
|
|
34
|
-
o.registerPlugin(g({
|
|
35
|
-
updateDelay: e,
|
|
36
|
-
editor: o,
|
|
37
|
-
element: n.value,
|
|
38
|
-
pluginKey: i,
|
|
39
|
-
shouldShow: s,
|
|
40
|
-
tippyOptions: p
|
|
41
|
-
}));
|
|
42
|
-
}), a(() => {
|
|
43
|
-
const { pluginKey: e, editor: o } = r;
|
|
44
|
-
o.unregisterPlugin(e);
|
|
45
|
-
}), () => {
|
|
46
|
-
var e;
|
|
47
|
-
return u("div", { ref: n }, (e = t.default) === null || e === void 0 ? void 0 : e.call(t));
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
function m(r) {
|
|
52
|
-
return x((t, n) => ({
|
|
3
|
+
import { defineComponent as d, h as a, ref as p, getCurrentInstance as _, watchEffect as S, nextTick as x, unref as C, onBeforeUnmount as h, markRaw as v, toRaw as b, reactive as N, render as u, shallowRef as q, onMounted as E, customRef as O, provide as l } from "vue";
|
|
4
|
+
function c(e) {
|
|
5
|
+
return O((t, r) => ({
|
|
53
6
|
get() {
|
|
54
|
-
return t(),
|
|
7
|
+
return t(), e;
|
|
55
8
|
},
|
|
56
|
-
set(
|
|
57
|
-
|
|
9
|
+
set(n) {
|
|
10
|
+
e = n, requestAnimationFrame(() => {
|
|
58
11
|
requestAnimationFrame(() => {
|
|
59
|
-
|
|
12
|
+
r();
|
|
60
13
|
});
|
|
61
14
|
});
|
|
62
15
|
}
|
|
63
16
|
}));
|
|
64
17
|
}
|
|
65
|
-
class
|
|
66
|
-
constructor(
|
|
67
|
-
return super(
|
|
68
|
-
this.reactiveState.value =
|
|
69
|
-
}),
|
|
18
|
+
var V = class extends y {
|
|
19
|
+
constructor(e = {}) {
|
|
20
|
+
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = c(this.view.state), this.reactiveExtensionStorage = c(this.extensionStorage), this.on("beforeTransaction", ({ nextState: t }) => {
|
|
21
|
+
this.reactiveState.value = t, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
22
|
+
}), v(this);
|
|
70
23
|
}
|
|
71
24
|
get state() {
|
|
72
25
|
return this.reactiveState ? this.reactiveState.value : this.view.state;
|
|
@@ -77,19 +30,18 @@ class D extends N {
|
|
|
77
30
|
/**
|
|
78
31
|
* Register a ProseMirror plugin.
|
|
79
32
|
*/
|
|
80
|
-
registerPlugin(
|
|
81
|
-
const
|
|
82
|
-
return this.reactiveState && (this.reactiveState.value =
|
|
33
|
+
registerPlugin(e, t) {
|
|
34
|
+
const r = super.registerPlugin(e, t);
|
|
35
|
+
return this.reactiveState && (this.reactiveState.value = r), r;
|
|
83
36
|
}
|
|
84
37
|
/**
|
|
85
38
|
* Unregister a ProseMirror plugin.
|
|
86
39
|
*/
|
|
87
|
-
unregisterPlugin(
|
|
88
|
-
const
|
|
89
|
-
return this.reactiveState &&
|
|
40
|
+
unregisterPlugin(e) {
|
|
41
|
+
const t = super.unregisterPlugin(e);
|
|
42
|
+
return this.reactiveState && t && (this.reactiveState.value = t), t;
|
|
90
43
|
}
|
|
91
|
-
}
|
|
92
|
-
const U = d({
|
|
44
|
+
}, k = d({
|
|
93
45
|
name: "EditorContent",
|
|
94
46
|
props: {
|
|
95
47
|
editor: {
|
|
@@ -97,78 +49,38 @@ const U = d({
|
|
|
97
49
|
type: Object
|
|
98
50
|
}
|
|
99
51
|
},
|
|
100
|
-
setup(
|
|
101
|
-
const t =
|
|
102
|
-
return
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
52
|
+
setup(e) {
|
|
53
|
+
const t = p(), r = _();
|
|
54
|
+
return S(() => {
|
|
55
|
+
const n = e.editor;
|
|
56
|
+
n && n.options.element && t.value && x(() => {
|
|
57
|
+
var i;
|
|
58
|
+
if (!t.value || !((i = n.view.dom) != null && i.parentNode))
|
|
106
59
|
return;
|
|
107
|
-
const o =
|
|
108
|
-
t.value.append(...
|
|
109
|
-
...
|
|
60
|
+
const o = C(t.value);
|
|
61
|
+
t.value.append(...n.view.dom.parentNode.childNodes), n.contentComponent = r.ctx._, r && (n.appContext = {
|
|
62
|
+
...r.appContext,
|
|
110
63
|
// Vue internally uses prototype chain to forward/shadow injects across the entire component chain
|
|
111
64
|
// so don't use object spread operator or 'Object.assign' and just set `provides` as is on editor's appContext
|
|
112
65
|
// @ts-expect-error forward instance's 'provides' into appContext
|
|
113
|
-
provides:
|
|
114
|
-
}),
|
|
66
|
+
provides: r.provides
|
|
67
|
+
}), n.setOptions({
|
|
115
68
|
element: o
|
|
116
|
-
}),
|
|
69
|
+
}), n.createNodeViews();
|
|
117
70
|
});
|
|
118
|
-
}),
|
|
119
|
-
const
|
|
120
|
-
|
|
71
|
+
}), h(() => {
|
|
72
|
+
const n = e.editor;
|
|
73
|
+
n && (n.contentComponent = null, n.appContext = null);
|
|
121
74
|
}), { rootEl: t };
|
|
122
75
|
},
|
|
123
76
|
render() {
|
|
124
|
-
return
|
|
125
|
-
ref: (
|
|
126
|
-
this.rootEl =
|
|
77
|
+
return a("div", {
|
|
78
|
+
ref: (e) => {
|
|
79
|
+
this.rootEl = e;
|
|
127
80
|
}
|
|
128
81
|
});
|
|
129
82
|
}
|
|
130
|
-
}),
|
|
131
|
-
name: "FloatingMenu",
|
|
132
|
-
props: {
|
|
133
|
-
pluginKey: {
|
|
134
|
-
// TODO: TypeScript breaks :(
|
|
135
|
-
// type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
|
|
136
|
-
type: null,
|
|
137
|
-
default: "floatingMenu"
|
|
138
|
-
},
|
|
139
|
-
editor: {
|
|
140
|
-
type: Object,
|
|
141
|
-
required: !0
|
|
142
|
-
},
|
|
143
|
-
tippyOptions: {
|
|
144
|
-
type: Object,
|
|
145
|
-
default: () => ({})
|
|
146
|
-
},
|
|
147
|
-
shouldShow: {
|
|
148
|
-
type: Function,
|
|
149
|
-
default: null
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
setup(r, { slots: t }) {
|
|
153
|
-
const n = l(null);
|
|
154
|
-
return c(() => {
|
|
155
|
-
const { pluginKey: e, editor: o, tippyOptions: i, shouldShow: s } = r;
|
|
156
|
-
o.registerPlugin(P({
|
|
157
|
-
pluginKey: e,
|
|
158
|
-
editor: o,
|
|
159
|
-
element: n.value,
|
|
160
|
-
tippyOptions: i,
|
|
161
|
-
shouldShow: s
|
|
162
|
-
}));
|
|
163
|
-
}), a(() => {
|
|
164
|
-
const { pluginKey: e, editor: o } = r;
|
|
165
|
-
o.unregisterPlugin(e);
|
|
166
|
-
}), () => {
|
|
167
|
-
var e;
|
|
168
|
-
return u("div", { ref: n }, (e = t.default) === null || e === void 0 ? void 0 : e.call(t));
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
}), L = d({
|
|
83
|
+
}), A = d({
|
|
172
84
|
name: "NodeViewContent",
|
|
173
85
|
props: {
|
|
174
86
|
as: {
|
|
@@ -177,14 +89,14 @@ const U = d({
|
|
|
177
89
|
}
|
|
178
90
|
},
|
|
179
91
|
render() {
|
|
180
|
-
return
|
|
92
|
+
return a(this.as, {
|
|
181
93
|
style: {
|
|
182
94
|
whiteSpace: "pre-wrap"
|
|
183
95
|
},
|
|
184
96
|
"data-node-view-content": ""
|
|
185
97
|
});
|
|
186
98
|
}
|
|
187
|
-
}),
|
|
99
|
+
}), W = d({
|
|
188
100
|
name: "NodeViewWrapper",
|
|
189
101
|
props: {
|
|
190
102
|
as: {
|
|
@@ -194,55 +106,146 @@ const U = d({
|
|
|
194
106
|
},
|
|
195
107
|
inject: ["onDragStart", "decorationClasses"],
|
|
196
108
|
render() {
|
|
197
|
-
var
|
|
198
|
-
return
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
109
|
+
var e, t;
|
|
110
|
+
return a(
|
|
111
|
+
this.as,
|
|
112
|
+
{
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
class: this.decorationClasses,
|
|
115
|
+
style: {
|
|
116
|
+
whiteSpace: "normal"
|
|
117
|
+
},
|
|
118
|
+
"data-node-view-wrapper": "",
|
|
119
|
+
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
|
|
120
|
+
onDragstart: this.onDragStart
|
|
203
121
|
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const i = (n = t.value) === null || n === void 0 ? void 0 : n.options.element, s = i == null ? void 0 : i.cloneNode(!0);
|
|
216
|
-
(e = i == null ? void 0 : i.parentNode) === null || e === void 0 || e.replaceChild(s, i), (o = t.value) === null || o === void 0 || o.destroy();
|
|
122
|
+
(t = (e = this.$slots).default) == null ? void 0 : t.call(e)
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}), R = (e = {}) => {
|
|
126
|
+
const t = q();
|
|
127
|
+
return E(() => {
|
|
128
|
+
t.value = new V(e);
|
|
129
|
+
}), h(() => {
|
|
130
|
+
var r, n, i, o;
|
|
131
|
+
const s = (n = (r = t.value) == null ? void 0 : r.view.dom) == null ? void 0 : n.parentNode, f = s == null ? void 0 : s.cloneNode(!0);
|
|
132
|
+
(i = s == null ? void 0 : s.parentNode) == null || i.replaceChild(f, s), (o = t.value) == null || o.destroy();
|
|
217
133
|
}), t;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
this.editor = e, this.component = f(t), this.el = document.createElement("div"), this.props = S(n), this.renderedComponent = this.renderComponent();
|
|
134
|
+
}, m = class {
|
|
135
|
+
constructor(e, { props: t = {}, editor: r }) {
|
|
136
|
+
this.destroyed = !1, this.editor = r, this.component = v(e), this.el = document.createElement("div"), this.props = N(t), this.renderedComponent = this.renderComponent();
|
|
222
137
|
}
|
|
223
138
|
get element() {
|
|
224
139
|
return this.renderedComponent.el;
|
|
225
140
|
}
|
|
226
141
|
get ref() {
|
|
227
|
-
var
|
|
228
|
-
return
|
|
142
|
+
var e, t, r, n;
|
|
143
|
+
return (t = (e = this.renderedComponent.vNode) == null ? void 0 : e.component) != null && t.exposed ? this.renderedComponent.vNode.component.exposed : (n = (r = this.renderedComponent.vNode) == null ? void 0 : r.component) == null ? void 0 : n.proxy;
|
|
229
144
|
}
|
|
230
145
|
renderComponent() {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
146
|
+
if (this.destroyed)
|
|
147
|
+
return this.renderedComponent;
|
|
148
|
+
let e = a(this.component, this.props);
|
|
149
|
+
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && u(e, this.el), { vNode: e, destroy: () => {
|
|
150
|
+
this.el && u(null, this.el), this.el = null, e = null;
|
|
234
151
|
}, el: this.el ? this.el.firstElementChild : null };
|
|
235
152
|
}
|
|
236
|
-
updateProps(
|
|
237
|
-
Object.entries(
|
|
238
|
-
this.props[
|
|
239
|
-
}), this.renderComponent();
|
|
153
|
+
updateProps(e = {}) {
|
|
154
|
+
this.destroyed || (Object.entries(e).forEach(([t, r]) => {
|
|
155
|
+
this.props[t] = r;
|
|
156
|
+
}), this.renderComponent());
|
|
240
157
|
}
|
|
241
158
|
destroy() {
|
|
242
|
-
this.renderedComponent.destroy();
|
|
159
|
+
this.destroyed || (this.destroyed = !0, this.renderedComponent.destroy());
|
|
243
160
|
}
|
|
161
|
+
}, U = {
|
|
162
|
+
editor: {
|
|
163
|
+
type: Object,
|
|
164
|
+
required: !0
|
|
165
|
+
},
|
|
166
|
+
mark: {
|
|
167
|
+
type: Object,
|
|
168
|
+
required: !0
|
|
169
|
+
},
|
|
170
|
+
extension: {
|
|
171
|
+
type: Object,
|
|
172
|
+
required: !0
|
|
173
|
+
},
|
|
174
|
+
inline: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
required: !0
|
|
177
|
+
},
|
|
178
|
+
view: {
|
|
179
|
+
type: Object,
|
|
180
|
+
required: !0
|
|
181
|
+
},
|
|
182
|
+
updateAttributes: {
|
|
183
|
+
type: Function,
|
|
184
|
+
required: !0
|
|
185
|
+
},
|
|
186
|
+
HTMLAttributes: {
|
|
187
|
+
type: Object,
|
|
188
|
+
required: !0
|
|
189
|
+
}
|
|
190
|
+
}, L = d({
|
|
191
|
+
name: "MarkViewContent",
|
|
192
|
+
props: {
|
|
193
|
+
as: {
|
|
194
|
+
type: String,
|
|
195
|
+
default: "span"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
render() {
|
|
199
|
+
return a(this.as, {
|
|
200
|
+
style: {
|
|
201
|
+
whiteSpace: "inherit"
|
|
202
|
+
},
|
|
203
|
+
"data-mark-view-content": ""
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}), M = class extends g {
|
|
207
|
+
constructor(e, t, r) {
|
|
208
|
+
super(e, t, r);
|
|
209
|
+
const n = { ...t, updateAttributes: this.updateAttributes.bind(this) }, i = d({
|
|
210
|
+
extends: { ...e },
|
|
211
|
+
props: Object.keys(n),
|
|
212
|
+
template: this.component.template,
|
|
213
|
+
setup: (o) => {
|
|
214
|
+
var s;
|
|
215
|
+
return (s = e.setup) == null ? void 0 : s.call(e, o, {
|
|
216
|
+
expose: () => {
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
// Add support for scoped styles
|
|
221
|
+
__scopeId: e.__scopeId,
|
|
222
|
+
__cssModules: e.__cssModules,
|
|
223
|
+
__name: e.__name,
|
|
224
|
+
__file: e.__file
|
|
225
|
+
});
|
|
226
|
+
this.renderer = new m(i, {
|
|
227
|
+
editor: this.editor,
|
|
228
|
+
props: n
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
get dom() {
|
|
232
|
+
return this.renderer.element;
|
|
233
|
+
}
|
|
234
|
+
get contentDOM() {
|
|
235
|
+
return this.dom.querySelector("[data-mark-view-content]");
|
|
236
|
+
}
|
|
237
|
+
updateAttributes(e) {
|
|
238
|
+
const t = b(this.mark);
|
|
239
|
+
super.updateAttributes(e, t);
|
|
240
|
+
}
|
|
241
|
+
destroy() {
|
|
242
|
+
this.renderer.destroy();
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
function F(e, t = {}) {
|
|
246
|
+
return (r) => r.editor.contentComponent ? new M(e, r, t) : {};
|
|
244
247
|
}
|
|
245
|
-
|
|
248
|
+
var I = {
|
|
246
249
|
editor: {
|
|
247
250
|
type: Object,
|
|
248
251
|
required: !0
|
|
@@ -287,30 +290,49 @@ const T = {
|
|
|
287
290
|
type: Object,
|
|
288
291
|
required: !0
|
|
289
292
|
}
|
|
290
|
-
}
|
|
291
|
-
|
|
293
|
+
}, P = class extends w {
|
|
294
|
+
constructor() {
|
|
295
|
+
super(...arguments), this.cachedExtensionWithSyncedStorage = null;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Returns a proxy of the extension that redirects storage access to the editor's mutable storage.
|
|
299
|
+
* This preserves the original prototype chain (instanceof checks, methods like configure/extend work).
|
|
300
|
+
* Cached to avoid proxy creation on every update.
|
|
301
|
+
*/
|
|
302
|
+
get extensionWithSyncedStorage() {
|
|
303
|
+
if (!this.cachedExtensionWithSyncedStorage) {
|
|
304
|
+
const e = this.editor, t = this.extension;
|
|
305
|
+
this.cachedExtensionWithSyncedStorage = new Proxy(t, {
|
|
306
|
+
get(r, n, i) {
|
|
307
|
+
var o;
|
|
308
|
+
return n === "storage" ? (o = e.storage[t.name]) != null ? o : {} : Reflect.get(r, n, i);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
return this.cachedExtensionWithSyncedStorage;
|
|
313
|
+
}
|
|
292
314
|
mount() {
|
|
293
|
-
const
|
|
315
|
+
const e = {
|
|
294
316
|
editor: this.editor,
|
|
295
317
|
node: this.node,
|
|
296
318
|
decorations: this.decorations,
|
|
297
319
|
innerDecorations: this.innerDecorations,
|
|
298
320
|
view: this.view,
|
|
299
321
|
selected: !1,
|
|
300
|
-
extension: this.
|
|
322
|
+
extension: this.extensionWithSyncedStorage,
|
|
301
323
|
HTMLAttributes: this.HTMLAttributes,
|
|
302
324
|
getPos: () => this.getPos(),
|
|
303
|
-
updateAttributes: (
|
|
325
|
+
updateAttributes: (n = {}) => this.updateAttributes(n),
|
|
304
326
|
deleteNode: () => this.deleteNode()
|
|
305
|
-
},
|
|
306
|
-
this.decorationClasses =
|
|
307
|
-
const
|
|
327
|
+
}, t = this.onDragStart.bind(this);
|
|
328
|
+
this.decorationClasses = p(this.getDecorationClasses());
|
|
329
|
+
const r = d({
|
|
308
330
|
extends: { ...this.component },
|
|
309
|
-
props: Object.keys(
|
|
331
|
+
props: Object.keys(e),
|
|
310
332
|
template: this.component.template,
|
|
311
|
-
setup: (
|
|
312
|
-
var i,
|
|
313
|
-
return
|
|
333
|
+
setup: (n) => {
|
|
334
|
+
var i, o;
|
|
335
|
+
return l("onDragStart", t), l("decorationClasses", this.decorationClasses), (o = (i = this.component).setup) == null ? void 0 : o.call(i, n, {
|
|
314
336
|
expose: () => {
|
|
315
337
|
}
|
|
316
338
|
});
|
|
@@ -331,9 +353,9 @@ class j extends O {
|
|
|
331
353
|
// eslint-disable-next-line
|
|
332
354
|
__file: this.component.__file
|
|
333
355
|
});
|
|
334
|
-
this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.renderer = new
|
|
356
|
+
this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.renderer = new m(r, {
|
|
335
357
|
editor: this.editor,
|
|
336
|
-
props:
|
|
358
|
+
props: e
|
|
337
359
|
});
|
|
338
360
|
}
|
|
339
361
|
/**
|
|
@@ -357,9 +379,9 @@ class j extends O {
|
|
|
357
379
|
* If it is, call `selectNode`, otherwise call `deselectNode`.
|
|
358
380
|
*/
|
|
359
381
|
handleSelectionUpdate() {
|
|
360
|
-
const { from:
|
|
361
|
-
if (typeof
|
|
362
|
-
if (
|
|
382
|
+
const { from: e, to: t } = this.editor.state.selection, r = this.getPos();
|
|
383
|
+
if (typeof r == "number")
|
|
384
|
+
if (e <= r && t >= r + this.node.nodeSize) {
|
|
363
385
|
if (this.renderer.props.selected)
|
|
364
386
|
return;
|
|
365
387
|
this.selectNode();
|
|
@@ -373,23 +395,23 @@ class j extends O {
|
|
|
373
395
|
* On update, update the React component.
|
|
374
396
|
* To prevent unnecessary updates, the `update` option can be used.
|
|
375
397
|
*/
|
|
376
|
-
update(
|
|
377
|
-
const
|
|
398
|
+
update(e, t, r) {
|
|
399
|
+
const n = (i) => {
|
|
378
400
|
this.decorationClasses.value = this.getDecorationClasses(), this.renderer.updateProps(i);
|
|
379
401
|
};
|
|
380
402
|
if (typeof this.options.update == "function") {
|
|
381
|
-
const i = this.node,
|
|
382
|
-
return this.node =
|
|
403
|
+
const i = this.node, o = this.decorations, s = this.innerDecorations;
|
|
404
|
+
return this.node = e, this.decorations = t, this.innerDecorations = r, this.options.update({
|
|
383
405
|
oldNode: i,
|
|
384
|
-
oldDecorations:
|
|
385
|
-
newNode:
|
|
386
|
-
newDecorations:
|
|
387
|
-
oldInnerDecorations:
|
|
388
|
-
innerDecorations:
|
|
389
|
-
updateProps: () =>
|
|
406
|
+
oldDecorations: o,
|
|
407
|
+
newNode: e,
|
|
408
|
+
newDecorations: t,
|
|
409
|
+
oldInnerDecorations: s,
|
|
410
|
+
innerDecorations: r,
|
|
411
|
+
updateProps: () => n({ node: e, decorations: t, innerDecorations: r, extension: this.extensionWithSyncedStorage })
|
|
390
412
|
});
|
|
391
413
|
}
|
|
392
|
-
return
|
|
414
|
+
return e.type !== this.node.type ? !1 : (e === this.node && this.decorations === t && this.innerDecorations === r || (this.node = e, this.decorations = t, this.innerDecorations = r, n({ node: e, decorations: t, innerDecorations: r, extension: this.extensionWithSyncedStorage })), !0);
|
|
393
415
|
}
|
|
394
416
|
/**
|
|
395
417
|
* Select the node.
|
|
@@ -410,30 +432,32 @@ class j extends O {
|
|
|
410
432
|
}), this.renderer.element && this.renderer.element.classList.remove("ProseMirror-selectednode");
|
|
411
433
|
}
|
|
412
434
|
getDecorationClasses() {
|
|
413
|
-
return this.decorations.
|
|
435
|
+
return this.decorations.flatMap((e) => e.type.attrs.class).join(" ");
|
|
414
436
|
}
|
|
415
437
|
destroy() {
|
|
416
438
|
this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate);
|
|
417
439
|
}
|
|
418
|
-
}
|
|
419
|
-
function
|
|
420
|
-
return (
|
|
421
|
-
if (!
|
|
440
|
+
};
|
|
441
|
+
function T(e, t) {
|
|
442
|
+
return (r) => {
|
|
443
|
+
if (!r.editor.contentComponent)
|
|
422
444
|
return {};
|
|
423
|
-
const
|
|
424
|
-
return new
|
|
445
|
+
const n = typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e;
|
|
446
|
+
return new P(n, r, t);
|
|
425
447
|
};
|
|
426
448
|
}
|
|
427
449
|
export {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
450
|
+
V as Editor,
|
|
451
|
+
k as EditorContent,
|
|
452
|
+
L as MarkViewContent,
|
|
453
|
+
A as NodeViewContent,
|
|
454
|
+
W as NodeViewWrapper,
|
|
455
|
+
M as VueMarkView,
|
|
456
|
+
F as VueMarkViewRenderer,
|
|
457
|
+
T as VueNodeViewRenderer,
|
|
458
|
+
m as VueRenderer,
|
|
459
|
+
U as markViewProps,
|
|
460
|
+
I as nodeViewProps,
|
|
461
|
+
R as useEditor
|
|
438
462
|
};
|
|
439
463
|
//# sourceMappingURL=vue-3.js.map
|