@dialpad/dialtone-vue 2.190.1 → 2.191.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/component-documentation.json +1 -1
- package/dist/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/lib/emoji-picker/emoji-picker.js +9 -6
- package/dist/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/lib/message-input/message-input.cjs +1 -1
- package/dist/lib/message-input/message-input.cjs.map +1 -1
- package/dist/lib/message-input/message-input.js +14 -6
- package/dist/lib/message-input/message-input.js.map +1 -1
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +1 -1
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/rich-text-editor/mention-suggestion.cjs +1 -1
- package/dist/lib/rich-text-editor/mention-suggestion.cjs.map +1 -1
- package/dist/lib/rich-text-editor/mention-suggestion.js +33 -14
- package/dist/lib/rich-text-editor/mention-suggestion.js.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +4 -4
- package/dist/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +326 -307
- package/dist/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/node_modules/@tiptap/vue-2.cjs +1 -1
- package/dist/node_modules/@tiptap/vue-2.cjs.map +1 -1
- package/dist/node_modules/@tiptap/vue-2.js +191 -149
- package/dist/node_modules/@tiptap/vue-2.js.map +1 -1
- package/dist/types/components/emoji_picker/emoji_picker.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +16 -16
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +16 -16
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +16 -16
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts +5 -0
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue.d.ts +16 -16
- package/dist/types/components/rich_text_editor/mention_suggestion.d.ts +23 -3
- package/dist/types/components/rich_text_editor/mention_suggestion.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +16 -16
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +1 -1
- package/package.json +35 -35
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { BubbleMenuPlugin as
|
|
2
|
-
import { Editor as
|
|
1
|
+
import { BubbleMenuPlugin as J } from "@tiptap/extension-bubble-menu";
|
|
2
|
+
import { Editor as Q, NodeView as X } from "@tiptap/core";
|
|
3
3
|
export * from "@tiptap/core";
|
|
4
4
|
import { FloatingMenuPlugin as Y } from "@tiptap/extension-floating-menu";
|
|
5
5
|
import v from "vue";
|
|
6
|
-
var L = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
|
|
7
|
-
Object.defineProperty(
|
|
8
|
-
|
|
6
|
+
var L = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, l = {}, h = {}, o = {}, p = {}, m = {};
|
|
7
|
+
Object.defineProperty(m, "__esModule", { value: !0 });
|
|
8
|
+
m.isInstanceOf = void 0;
|
|
9
9
|
const Z = (e) => (t) => {
|
|
10
10
|
if (!(t instanceof e))
|
|
11
11
|
return `value should be an instance of ${e.name}`;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
Object.defineProperty(
|
|
16
|
-
|
|
13
|
+
m.isInstanceOf = Z;
|
|
14
|
+
var g = {};
|
|
15
|
+
Object.defineProperty(g, "__esModule", { value: !0 });
|
|
16
|
+
g.isInteger = void 0;
|
|
17
17
|
const x = (e) => {
|
|
18
18
|
if (typeof e != "number" || !Number.isInteger(e))
|
|
19
19
|
return "value should be an integer";
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
g.isInteger = x;
|
|
22
22
|
var _ = {};
|
|
23
23
|
Object.defineProperty(_, "__esModule", { value: !0 });
|
|
24
24
|
_.isOneOf = void 0;
|
|
@@ -36,73 +36,73 @@ const te = (e) => {
|
|
|
36
36
|
};
|
|
37
37
|
j.isSymbol = te;
|
|
38
38
|
(function(e) {
|
|
39
|
-
var t = L && L.__importDefault || function(
|
|
40
|
-
return
|
|
39
|
+
var t = L && L.__importDefault || function(u) {
|
|
40
|
+
return u && u.__esModule ? u : { default: u };
|
|
41
41
|
};
|
|
42
42
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.isSymbol = e.isOneOf = e.isInteger = e.isInstanceOf = e.vuePropValidator = void 0;
|
|
43
|
-
const
|
|
44
|
-
function
|
|
45
|
-
const y =
|
|
43
|
+
const n = t(v);
|
|
44
|
+
function r(u, ...P) {
|
|
45
|
+
const y = u ? [...P, u] : P;
|
|
46
46
|
if (y.length !== 0)
|
|
47
47
|
return (c) => {
|
|
48
|
-
for (const
|
|
49
|
-
const f =
|
|
48
|
+
for (const U of y) {
|
|
49
|
+
const f = U(c);
|
|
50
50
|
if (f)
|
|
51
|
-
return typeof
|
|
51
|
+
return typeof n.default == "object" && "util" in n.default ? n.default.util.warn(`${f} (received: '${String(c)}')`) : console.warn(`${f} (received: '${String(c)}')`), !1;
|
|
52
52
|
}
|
|
53
53
|
return !0;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
e.vuePropValidator =
|
|
57
|
-
var i =
|
|
56
|
+
e.vuePropValidator = r;
|
|
57
|
+
var i = m;
|
|
58
58
|
Object.defineProperty(e, "isInstanceOf", { enumerable: !0, get: function() {
|
|
59
59
|
return i.isInstanceOf;
|
|
60
60
|
} });
|
|
61
|
-
var
|
|
61
|
+
var s = g;
|
|
62
62
|
Object.defineProperty(e, "isInteger", { enumerable: !0, get: function() {
|
|
63
|
-
return
|
|
63
|
+
return s.isInteger;
|
|
64
64
|
} });
|
|
65
|
-
var
|
|
65
|
+
var a = _;
|
|
66
66
|
Object.defineProperty(e, "isOneOf", { enumerable: !0, get: function() {
|
|
67
|
-
return
|
|
67
|
+
return a.isOneOf;
|
|
68
68
|
} });
|
|
69
|
-
var
|
|
69
|
+
var d = j;
|
|
70
70
|
Object.defineProperty(e, "isSymbol", { enumerable: !0, get: function() {
|
|
71
|
-
return
|
|
71
|
+
return d.isSymbol;
|
|
72
72
|
} });
|
|
73
73
|
})(p);
|
|
74
74
|
Object.defineProperty(o, "__esModule", { value: !0 });
|
|
75
75
|
o.propOptionsGenerator = void 0;
|
|
76
|
-
const O = p,
|
|
76
|
+
const O = p, ne = (e, t, ...n) => ({
|
|
77
77
|
optional: {
|
|
78
78
|
type: e,
|
|
79
79
|
required: !1,
|
|
80
80
|
default: void 0,
|
|
81
|
-
validator: (0, O.vuePropValidator)(t, ...
|
|
81
|
+
validator: (0, O.vuePropValidator)(t, ...n)
|
|
82
82
|
},
|
|
83
83
|
nullable: {
|
|
84
84
|
type: e,
|
|
85
85
|
required: !1,
|
|
86
86
|
default: null,
|
|
87
|
-
validator: (0, O.vuePropValidator)(t, ...
|
|
87
|
+
validator: (0, O.vuePropValidator)(t, ...n)
|
|
88
88
|
},
|
|
89
|
-
withDefault: (
|
|
89
|
+
withDefault: (r) => ({
|
|
90
90
|
type: e,
|
|
91
91
|
required: !1,
|
|
92
|
-
default:
|
|
93
|
-
validator: (0, O.vuePropValidator)(t, ...
|
|
92
|
+
default: r,
|
|
93
|
+
validator: (0, O.vuePropValidator)(t, ...n)
|
|
94
94
|
}),
|
|
95
95
|
required: {
|
|
96
96
|
type: e,
|
|
97
97
|
required: !0,
|
|
98
|
-
validator: (0, O.vuePropValidator)(t, ...
|
|
98
|
+
validator: (0, O.vuePropValidator)(t, ...n)
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
-
o.propOptionsGenerator =
|
|
102
|
-
Object.defineProperty(
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
|
|
101
|
+
o.propOptionsGenerator = ne;
|
|
102
|
+
Object.defineProperty(h, "__esModule", { value: !0 });
|
|
103
|
+
h.stringProp = void 0;
|
|
104
|
+
const re = o, oe = (e) => (0, re.propOptionsGenerator)(String, e);
|
|
105
|
+
h.stringProp = oe;
|
|
106
106
|
var N = {};
|
|
107
107
|
Object.defineProperty(N, "__esModule", { value: !0 });
|
|
108
108
|
N.booleanProp = void 0;
|
|
@@ -123,46 +123,46 @@ Object.defineProperty(M, "__esModule", { value: !0 });
|
|
|
123
123
|
M.symbolProp = void 0;
|
|
124
124
|
const ce = o, fe = p, ve = (e) => (0, ce.propOptionsGenerator)(void 0, e, fe.isSymbol);
|
|
125
125
|
M.symbolProp = ve;
|
|
126
|
-
var C = {};
|
|
127
|
-
Object.defineProperty(C, "__esModule", { value: !0 });
|
|
128
|
-
C.vueComponentProp = void 0;
|
|
129
|
-
const be = o, Pe = (e) => (0, be.propOptionsGenerator)([Object, String], e);
|
|
130
|
-
C.vueComponentProp = Pe;
|
|
131
126
|
var S = {};
|
|
132
127
|
Object.defineProperty(S, "__esModule", { value: !0 });
|
|
133
|
-
S.
|
|
128
|
+
S.vueComponentProp = void 0;
|
|
129
|
+
const be = o, Pe = (e) => (0, be.propOptionsGenerator)([Object, String], e);
|
|
130
|
+
S.vueComponentProp = Pe;
|
|
131
|
+
var C = {};
|
|
132
|
+
Object.defineProperty(C, "__esModule", { value: !0 });
|
|
133
|
+
C.anyProp = void 0;
|
|
134
134
|
const ye = o, Oe = (e) => (0, ye.propOptionsGenerator)(void 0, e);
|
|
135
|
-
|
|
135
|
+
C.anyProp = Oe;
|
|
136
136
|
var D = {};
|
|
137
137
|
Object.defineProperty(D, "__esModule", { value: !0 });
|
|
138
138
|
D.arrayProp = void 0;
|
|
139
|
-
const
|
|
140
|
-
D.arrayProp =
|
|
139
|
+
const he = o, me = (e) => (0, he.propOptionsGenerator)(Array, e);
|
|
140
|
+
D.arrayProp = me;
|
|
141
141
|
var q = {};
|
|
142
142
|
Object.defineProperty(q, "__esModule", { value: !0 });
|
|
143
143
|
q.objectProp = void 0;
|
|
144
|
-
const
|
|
144
|
+
const ge = o, _e = (e) => (0, ge.propOptionsGenerator)(Object, e);
|
|
145
145
|
q.objectProp = _e;
|
|
146
146
|
var I = {};
|
|
147
147
|
Object.defineProperty(I, "__esModule", { value: !0 });
|
|
148
148
|
I.functionProp = void 0;
|
|
149
|
-
const
|
|
149
|
+
const k = p, je = (e) => ({
|
|
150
150
|
optional: {
|
|
151
151
|
type: Function,
|
|
152
152
|
required: !1,
|
|
153
153
|
default: void 0,
|
|
154
|
-
validator: (0,
|
|
154
|
+
validator: (0, k.vuePropValidator)(e)
|
|
155
155
|
},
|
|
156
156
|
nullable: {
|
|
157
157
|
type: Function,
|
|
158
158
|
required: !1,
|
|
159
159
|
default: null,
|
|
160
|
-
validator: (0,
|
|
160
|
+
validator: (0, k.vuePropValidator)(e)
|
|
161
161
|
},
|
|
162
162
|
required: {
|
|
163
163
|
type: Function,
|
|
164
164
|
required: !0,
|
|
165
|
-
validator: (0,
|
|
165
|
+
validator: (0, k.vuePropValidator)(e)
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
I.functionProp = je;
|
|
@@ -171,11 +171,11 @@ Object.defineProperty(b, "__esModule", { value: !0 });
|
|
|
171
171
|
b.oneOfProp = void 0;
|
|
172
172
|
const Ne = o, $e = p, we = (e) => {
|
|
173
173
|
const t = [
|
|
174
|
-
...new Set(e.flatMap((
|
|
175
|
-
var
|
|
176
|
-
return
|
|
174
|
+
...new Set(e.flatMap((n) => {
|
|
175
|
+
var r;
|
|
176
|
+
return n == null ? [] : (
|
|
177
177
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
178
|
-
(
|
|
178
|
+
(r = n.constructor) !== null && r !== void 0 ? r : []
|
|
179
179
|
);
|
|
180
180
|
}))
|
|
181
181
|
];
|
|
@@ -183,29 +183,29 @@ const Ne = o, $e = p, we = (e) => {
|
|
|
183
183
|
return t.length === 1 ? t[0] : t;
|
|
184
184
|
}, Me = (e, t) => (0, Ne.propOptionsGenerator)(we(e), t, (0, $e.isOneOf)(e));
|
|
185
185
|
b.oneOfProp = Me;
|
|
186
|
+
var T = {};
|
|
187
|
+
Object.defineProperty(T, "__esModule", { value: !0 });
|
|
188
|
+
T.oneOfObjectKeysProp = void 0;
|
|
189
|
+
const Se = b, Ce = (e, t) => (0, Se.oneOfProp)(Object.keys(e), t);
|
|
190
|
+
T.oneOfObjectKeysProp = Ce;
|
|
186
191
|
var G = {};
|
|
187
192
|
Object.defineProperty(G, "__esModule", { value: !0 });
|
|
188
|
-
G.
|
|
189
|
-
const
|
|
190
|
-
G.
|
|
193
|
+
G.oneOfTypesProp = void 0;
|
|
194
|
+
const De = o, qe = (e, t) => (0, De.propOptionsGenerator)(e, t);
|
|
195
|
+
G.oneOfTypesProp = qe;
|
|
191
196
|
var K = {};
|
|
192
197
|
Object.defineProperty(K, "__esModule", { value: !0 });
|
|
193
|
-
K.
|
|
194
|
-
const
|
|
195
|
-
K.
|
|
196
|
-
var T = {};
|
|
197
|
-
Object.defineProperty(T, "__esModule", { value: !0 });
|
|
198
|
-
T.instanceOfProp = void 0;
|
|
199
|
-
const Ie = o, Ge = p, Ke = (e, t) => (0, Ie.propOptionsGenerator)(e, t, (0, Ge.isInstanceOf)(e));
|
|
200
|
-
T.instanceOfProp = Ke;
|
|
198
|
+
K.instanceOfProp = void 0;
|
|
199
|
+
const Ie = o, Te = p, Ge = (e, t) => (0, Ie.propOptionsGenerator)(e, t, (0, Te.isInstanceOf)(e));
|
|
200
|
+
K.instanceOfProp = Ge;
|
|
201
201
|
var V = {};
|
|
202
202
|
Object.defineProperty(V, "__esModule", { value: !0 });
|
|
203
203
|
V.isNegative = void 0;
|
|
204
|
-
const
|
|
204
|
+
const Ke = (e) => {
|
|
205
205
|
if (typeof e != "number" || e >= 0 || Number.isNaN(e))
|
|
206
206
|
return "value should be a negative number";
|
|
207
207
|
};
|
|
208
|
-
V.isNegative =
|
|
208
|
+
V.isNegative = Ke;
|
|
209
209
|
var E = {};
|
|
210
210
|
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
211
211
|
E.isPositive = void 0;
|
|
@@ -222,47 +222,47 @@ const Ee = (e) => {
|
|
|
222
222
|
return "value should be a non-negative number";
|
|
223
223
|
};
|
|
224
224
|
F.isNonNegative = Ee;
|
|
225
|
-
var
|
|
226
|
-
Object.defineProperty(
|
|
227
|
-
|
|
225
|
+
var A = {};
|
|
226
|
+
Object.defineProperty(A, "__esModule", { value: !0 });
|
|
227
|
+
A.isNonPositive = void 0;
|
|
228
228
|
const Fe = (e) => {
|
|
229
229
|
if (typeof e != "number" || e > 0 || Number.isNaN(e))
|
|
230
230
|
return "value should be a non-positive number";
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
A.isNonPositive = Fe;
|
|
233
233
|
(function(e) {
|
|
234
234
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.isNonPositive = e.isNonNegative = e.isPositive = e.isNegative = e.instanceOfProp = e.oneOfTypesProp = e.oneOfObjectKeysProp = e.oneOfProp = e.functionProp = e.objectProp = e.arrayProp = e.anyProp = e.vueComponentProp = e.symbolProp = e.integerProp = e.numberProp = e.booleanProp = e.stringProp = void 0;
|
|
235
|
-
var t =
|
|
235
|
+
var t = h;
|
|
236
236
|
Object.defineProperty(e, "stringProp", { enumerable: !0, get: function() {
|
|
237
237
|
return t.stringProp;
|
|
238
238
|
} });
|
|
239
|
-
var
|
|
239
|
+
var n = N;
|
|
240
240
|
Object.defineProperty(e, "booleanProp", { enumerable: !0, get: function() {
|
|
241
|
-
return
|
|
241
|
+
return n.booleanProp;
|
|
242
242
|
} });
|
|
243
|
-
var
|
|
243
|
+
var r = $;
|
|
244
244
|
Object.defineProperty(e, "numberProp", { enumerable: !0, get: function() {
|
|
245
|
-
return
|
|
245
|
+
return r.numberProp;
|
|
246
246
|
} });
|
|
247
247
|
var i = w;
|
|
248
248
|
Object.defineProperty(e, "integerProp", { enumerable: !0, get: function() {
|
|
249
249
|
return i.integerProp;
|
|
250
250
|
} });
|
|
251
|
-
var
|
|
251
|
+
var s = M;
|
|
252
252
|
Object.defineProperty(e, "symbolProp", { enumerable: !0, get: function() {
|
|
253
|
-
return
|
|
253
|
+
return s.symbolProp;
|
|
254
254
|
} });
|
|
255
|
-
var
|
|
255
|
+
var a = S;
|
|
256
256
|
Object.defineProperty(e, "vueComponentProp", { enumerable: !0, get: function() {
|
|
257
|
-
return
|
|
257
|
+
return a.vueComponentProp;
|
|
258
258
|
} });
|
|
259
|
-
var
|
|
259
|
+
var d = C;
|
|
260
260
|
Object.defineProperty(e, "anyProp", { enumerable: !0, get: function() {
|
|
261
|
-
return
|
|
261
|
+
return d.anyProp;
|
|
262
262
|
} });
|
|
263
|
-
var
|
|
263
|
+
var u = D;
|
|
264
264
|
Object.defineProperty(e, "arrayProp", { enumerable: !0, get: function() {
|
|
265
|
-
return
|
|
265
|
+
return u.arrayProp;
|
|
266
266
|
} });
|
|
267
267
|
var P = q;
|
|
268
268
|
Object.defineProperty(e, "objectProp", { enumerable: !0, get: function() {
|
|
@@ -276,36 +276,36 @@ k.isNonPositive = Fe;
|
|
|
276
276
|
Object.defineProperty(e, "oneOfProp", { enumerable: !0, get: function() {
|
|
277
277
|
return c.oneOfProp;
|
|
278
278
|
} });
|
|
279
|
-
var
|
|
279
|
+
var U = T;
|
|
280
280
|
Object.defineProperty(e, "oneOfObjectKeysProp", { enumerable: !0, get: function() {
|
|
281
|
-
return
|
|
281
|
+
return U.oneOfObjectKeysProp;
|
|
282
282
|
} });
|
|
283
|
-
var f =
|
|
283
|
+
var f = G;
|
|
284
284
|
Object.defineProperty(e, "oneOfTypesProp", { enumerable: !0, get: function() {
|
|
285
285
|
return f.oneOfTypesProp;
|
|
286
286
|
} });
|
|
287
|
-
var
|
|
287
|
+
var B = K;
|
|
288
288
|
Object.defineProperty(e, "instanceOfProp", { enumerable: !0, get: function() {
|
|
289
|
-
return
|
|
289
|
+
return B.instanceOfProp;
|
|
290
290
|
} });
|
|
291
|
-
var
|
|
291
|
+
var H = V;
|
|
292
292
|
Object.defineProperty(e, "isNegative", { enumerable: !0, get: function() {
|
|
293
|
-
return
|
|
293
|
+
return H.isNegative;
|
|
294
294
|
} });
|
|
295
|
-
var
|
|
295
|
+
var R = E;
|
|
296
296
|
Object.defineProperty(e, "isPositive", { enumerable: !0, get: function() {
|
|
297
|
-
return
|
|
297
|
+
return R.isPositive;
|
|
298
298
|
} });
|
|
299
|
-
var
|
|
299
|
+
var W = F;
|
|
300
300
|
Object.defineProperty(e, "isNonNegative", { enumerable: !0, get: function() {
|
|
301
|
-
return
|
|
301
|
+
return W.isNonNegative;
|
|
302
302
|
} });
|
|
303
|
-
var
|
|
303
|
+
var z = A;
|
|
304
304
|
Object.defineProperty(e, "isNonPositive", { enumerable: !0, get: function() {
|
|
305
|
-
return
|
|
305
|
+
return z.isNonPositive;
|
|
306
306
|
} });
|
|
307
|
-
})(
|
|
308
|
-
const
|
|
307
|
+
})(l);
|
|
308
|
+
const Re = {
|
|
309
309
|
name: "BubbleMenu",
|
|
310
310
|
props: {
|
|
311
311
|
pluginKey: {
|
|
@@ -333,7 +333,7 @@ const ze = {
|
|
|
333
333
|
immediate: !0,
|
|
334
334
|
handler(e) {
|
|
335
335
|
e && this.$nextTick(() => {
|
|
336
|
-
e.registerPlugin(
|
|
336
|
+
e.registerPlugin(J({
|
|
337
337
|
updateDelay: this.updateDelay,
|
|
338
338
|
editor: e,
|
|
339
339
|
element: this.$el,
|
|
@@ -352,12 +352,12 @@ const ze = {
|
|
|
352
352
|
this.editor.unregisterPlugin(this.pluginKey);
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
class
|
|
355
|
+
class We extends Q {
|
|
356
356
|
constructor() {
|
|
357
357
|
super(...arguments), this.contentComponent = null;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
const
|
|
360
|
+
const ze = {
|
|
361
361
|
name: "EditorContent",
|
|
362
362
|
props: {
|
|
363
363
|
editor: {
|
|
@@ -392,7 +392,7 @@ const Je = {
|
|
|
392
392
|
element: t
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
|
-
},
|
|
395
|
+
}, Je = {
|
|
396
396
|
name: "FloatingMenu",
|
|
397
397
|
props: {
|
|
398
398
|
pluginKey: {
|
|
@@ -434,7 +434,7 @@ const Je = {
|
|
|
434
434
|
beforeDestroy() {
|
|
435
435
|
this.editor.unregisterPlugin(this.pluginKey);
|
|
436
436
|
}
|
|
437
|
-
},
|
|
437
|
+
}, Qe = {
|
|
438
438
|
props: {
|
|
439
439
|
as: {
|
|
440
440
|
type: String,
|
|
@@ -474,94 +474,136 @@ const Je = {
|
|
|
474
474
|
}, this.$slots.default);
|
|
475
475
|
}
|
|
476
476
|
};
|
|
477
|
-
class
|
|
478
|
-
constructor(t,
|
|
479
|
-
const
|
|
480
|
-
this.ref = new n
|
|
477
|
+
class Ae {
|
|
478
|
+
constructor(t, n) {
|
|
479
|
+
const r = typeof t == "function" ? t : v.extend(t);
|
|
480
|
+
this.ref = new r(n).$mount();
|
|
481
481
|
}
|
|
482
482
|
get element() {
|
|
483
483
|
return this.ref.$el;
|
|
484
484
|
}
|
|
485
485
|
updateProps(t = {}) {
|
|
486
|
-
var
|
|
486
|
+
var n, r, i;
|
|
487
487
|
if (!this.ref.$props)
|
|
488
488
|
return;
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
this.ref.$props[
|
|
492
|
-
}),
|
|
489
|
+
const s = (i = (r = (n = this.ref.$props.editor) === null || n === void 0 ? void 0 : n.contentComponent) === null || r === void 0 ? void 0 : r.$options._base) !== null && i !== void 0 ? i : v, a = s.config.silent;
|
|
490
|
+
s.config.silent = !0, Object.entries(t).forEach(([d, u]) => {
|
|
491
|
+
this.ref.$props[d] = u;
|
|
492
|
+
}), s.config.silent = a;
|
|
493
493
|
}
|
|
494
494
|
destroy() {
|
|
495
495
|
this.ref.$destroy();
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
const Ye = {
|
|
499
|
-
editor:
|
|
500
|
-
node:
|
|
501
|
-
decorations:
|
|
502
|
-
selected:
|
|
503
|
-
extension:
|
|
504
|
-
getPos:
|
|
505
|
-
updateAttributes:
|
|
506
|
-
deleteNode:
|
|
499
|
+
editor: l.objectProp().required,
|
|
500
|
+
node: l.objectProp().required,
|
|
501
|
+
decorations: l.objectProp().required,
|
|
502
|
+
selected: l.booleanProp().required,
|
|
503
|
+
extension: l.objectProp().required,
|
|
504
|
+
getPos: l.functionProp().required,
|
|
505
|
+
updateAttributes: l.functionProp().required,
|
|
506
|
+
deleteNode: l.functionProp().required
|
|
507
507
|
};
|
|
508
|
-
class
|
|
508
|
+
class Ue extends X {
|
|
509
509
|
mount() {
|
|
510
|
-
var t,
|
|
511
|
-
const
|
|
510
|
+
var t, n;
|
|
511
|
+
const r = {
|
|
512
512
|
editor: this.editor,
|
|
513
513
|
node: this.node,
|
|
514
514
|
decorations: this.decorations,
|
|
515
|
+
innerDecorations: this.innerDecorations,
|
|
516
|
+
view: this.view,
|
|
515
517
|
selected: !1,
|
|
516
518
|
extension: this.extension,
|
|
519
|
+
HTMLAttributes: this.HTMLAttributes,
|
|
517
520
|
getPos: () => this.getPos(),
|
|
518
|
-
updateAttributes: (
|
|
521
|
+
updateAttributes: (d = {}) => this.updateAttributes(d),
|
|
519
522
|
deleteNode: () => this.deleteNode()
|
|
520
523
|
}, i = this.onDragStart.bind(this);
|
|
521
524
|
this.decorationClasses = v.observable({
|
|
522
525
|
value: this.getDecorationClasses()
|
|
523
526
|
});
|
|
524
|
-
const
|
|
525
|
-
props: Object.keys(
|
|
527
|
+
const a = ((n = (t = this.editor.contentComponent) === null || t === void 0 ? void 0 : t.$options._base) !== null && n !== void 0 ? n : v).extend(this.component).extend({
|
|
528
|
+
props: Object.keys(r),
|
|
526
529
|
provide: () => ({
|
|
527
530
|
onDragStart: i,
|
|
528
531
|
decorationClasses: this.decorationClasses
|
|
529
532
|
})
|
|
530
533
|
});
|
|
531
|
-
this.renderer = new
|
|
534
|
+
this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.renderer = new Ae(a, {
|
|
532
535
|
parent: this.editor.contentComponent,
|
|
533
|
-
propsData:
|
|
536
|
+
propsData: r
|
|
534
537
|
});
|
|
535
538
|
}
|
|
539
|
+
/**
|
|
540
|
+
* Return the DOM element.
|
|
541
|
+
* This is the element that will be used to display the node view.
|
|
542
|
+
*/
|
|
536
543
|
get dom() {
|
|
537
544
|
if (!this.renderer.element.hasAttribute("data-node-view-wrapper"))
|
|
538
545
|
throw Error("Please use the NodeViewWrapper component for your node view.");
|
|
539
546
|
return this.renderer.element;
|
|
540
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* Return the content DOM element.
|
|
550
|
+
* This is the element that will be used to display the rich-text content of the node.
|
|
551
|
+
*/
|
|
541
552
|
get contentDOM() {
|
|
542
553
|
return this.node.isLeaf ? null : this.dom.querySelector("[data-node-view-content]") || this.dom;
|
|
543
554
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
555
|
+
/**
|
|
556
|
+
* On editor selection update, check if the node is selected.
|
|
557
|
+
* If it is, call `selectNode`, otherwise call `deselectNode`.
|
|
558
|
+
*/
|
|
559
|
+
handleSelectionUpdate() {
|
|
560
|
+
const { from: t, to: n } = this.editor.state.selection, r = this.getPos();
|
|
561
|
+
if (typeof r == "number")
|
|
562
|
+
if (t <= r && n >= r + this.node.nodeSize) {
|
|
563
|
+
if (this.renderer.ref.$props.selected)
|
|
564
|
+
return;
|
|
565
|
+
this.selectNode();
|
|
566
|
+
} else {
|
|
567
|
+
if (!this.renderer.ref.$props.selected)
|
|
568
|
+
return;
|
|
569
|
+
this.deselectNode();
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* On update, update the React component.
|
|
574
|
+
* To prevent unnecessary updates, the `update` option can be used.
|
|
575
|
+
*/
|
|
576
|
+
update(t, n, r) {
|
|
577
|
+
const i = (s) => {
|
|
578
|
+
this.decorationClasses.value = this.getDecorationClasses(), this.renderer.updateProps(s);
|
|
547
579
|
};
|
|
548
580
|
if (typeof this.options.update == "function") {
|
|
549
|
-
const
|
|
550
|
-
return this.node = t, this.decorations = r, this.options.update({
|
|
551
|
-
oldNode:
|
|
552
|
-
oldDecorations:
|
|
581
|
+
const s = this.node, a = this.decorations, d = this.innerDecorations;
|
|
582
|
+
return this.node = t, this.decorations = n, this.innerDecorations = r, this.options.update({
|
|
583
|
+
oldNode: s,
|
|
584
|
+
oldDecorations: a,
|
|
553
585
|
newNode: t,
|
|
554
|
-
newDecorations:
|
|
555
|
-
|
|
586
|
+
newDecorations: n,
|
|
587
|
+
oldInnerDecorations: d,
|
|
588
|
+
innerDecorations: r,
|
|
589
|
+
updateProps: () => i({ node: t, decorations: n, innerDecorations: r })
|
|
556
590
|
});
|
|
557
591
|
}
|
|
558
|
-
return t.type !== this.node.type ? !1 : (t === this.node && this.decorations === r || (this.node = t, this.decorations = r,
|
|
592
|
+
return t.type !== this.node.type ? !1 : (t === this.node && this.decorations === n && this.innerDecorations === r || (this.node = t, this.decorations = n, this.innerDecorations = r, i({ node: t, decorations: n, innerDecorations: r })), !0);
|
|
559
593
|
}
|
|
594
|
+
/**
|
|
595
|
+
* Select the node.
|
|
596
|
+
* Add the `selected` prop and the `ProseMirror-selectednode` class.
|
|
597
|
+
*/
|
|
560
598
|
selectNode() {
|
|
561
599
|
this.renderer.updateProps({
|
|
562
600
|
selected: !0
|
|
563
601
|
}), this.renderer.element.classList.add("ProseMirror-selectednode");
|
|
564
602
|
}
|
|
603
|
+
/**
|
|
604
|
+
* Deselect the node.
|
|
605
|
+
* Remove the `selected` prop and the `ProseMirror-selectednode` class.
|
|
606
|
+
*/
|
|
565
607
|
deselectNode() {
|
|
566
608
|
this.renderer.updateProps({
|
|
567
609
|
selected: !1
|
|
@@ -571,21 +613,21 @@ class Ae extends X {
|
|
|
571
613
|
return this.decorations.map((t) => t.type.attrs.class).flat().join(" ");
|
|
572
614
|
}
|
|
573
615
|
destroy() {
|
|
574
|
-
this.renderer.destroy();
|
|
616
|
+
this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate);
|
|
575
617
|
}
|
|
576
618
|
}
|
|
577
619
|
function Ze(e, t) {
|
|
578
|
-
return (
|
|
620
|
+
return (n) => n.editor.contentComponent ? new Ue(e, n, t) : {};
|
|
579
621
|
}
|
|
580
622
|
export {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
623
|
+
Re as BubbleMenu,
|
|
624
|
+
We as Editor,
|
|
625
|
+
ze as EditorContent,
|
|
626
|
+
Je as FloatingMenu,
|
|
627
|
+
Qe as NodeViewContent,
|
|
586
628
|
Xe as NodeViewWrapper,
|
|
587
629
|
Ze as VueNodeViewRenderer,
|
|
588
|
-
|
|
630
|
+
Ae as VueRenderer,
|
|
589
631
|
Ye as nodeViewProps
|
|
590
632
|
};
|
|
591
633
|
//# sourceMappingURL=vue-2.js.map
|