@opentiny/tiny-robot 0.4.1 → 0.4.2-alpha.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/index.d.ts +47 -62
- package/dist/index5.js +62 -62
- package/dist/index6.js +61 -61
- package/dist/sender/index.js +782 -783
- package/dist/style.css +1 -1
- package/package.json +6 -4
package/dist/sender/index.js
CHANGED
|
@@ -1,93 +1,90 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
3
|
-
import { NodeViewWrapper as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { j as
|
|
11
|
-
import { PluginKey as re, Plugin as ie, TextSelection as
|
|
12
|
-
import { DecorationSet as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { IconAssociate as
|
|
15
|
-
import { Node as
|
|
16
|
-
const
|
|
1
|
+
import { defineComponent as Y, openBlock as M, createBlock as G, unref as L, withCtx as $, createTextVNode as Yt, toDisplayString as pe, ref as V, watch as N, createElementBlock as O, Fragment as ke, renderList as Be, withModifiers as Ze, normalizeClass as Q, createCommentVNode as K, createElementVNode as B, nextTick as me, isRef as Le, Transition as jt, normalizeStyle as Zt, createVNode as oe, toRaw as Jt, computed as k, onMounted as Qt, onUnmounted as en, Teleport as tn, toRef as De, onBeforeUnmount as nn, provide as on, renderSlot as P, normalizeProps as he, guardReactiveProps as ge, createSlots as ht } from "vue";
|
|
2
|
+
import { a as sn, u as Oe, W as St, D as Ct } from "../index2.js";
|
|
3
|
+
import { NodeViewWrapper as et, VueRenderer as _t, VueNodeViewRenderer as tt, NodeViewContent as rn, useEditor as ln, EditorContent as an } from "@tiptap/vue-3";
|
|
4
|
+
import cn from "@tiptap/extension-document";
|
|
5
|
+
import un from "@tiptap/extension-paragraph";
|
|
6
|
+
import dn from "@tiptap/extension-text";
|
|
7
|
+
import fn from "@tiptap/extension-history";
|
|
8
|
+
import pn from "@tiptap/extension-placeholder";
|
|
9
|
+
import mn from "@tiptap/extension-character-count";
|
|
10
|
+
import { j as hn, k as gn, l as yn } from "../index4.js";
|
|
11
|
+
import { PluginKey as re, Plugin as ie, TextSelection as R } from "@tiptap/pm/state";
|
|
12
|
+
import { DecorationSet as _e, Decoration as Lt } from "@tiptap/pm/view";
|
|
13
|
+
import { _ as j } from "../_plugin-vue_export-helper.js";
|
|
14
|
+
import { IconAssociate as xn, IconArrowDown as Tn } from "@opentiny/tiny-robot-svgs";
|
|
15
|
+
import { Node as nt, mergeAttributes as ot, Extension as Mt } from "@tiptap/core";
|
|
16
|
+
const vn = /* @__PURE__ */ Y({
|
|
17
17
|
__name: "mention-view",
|
|
18
18
|
props: {
|
|
19
19
|
node: {},
|
|
20
20
|
extension: {}
|
|
21
21
|
},
|
|
22
22
|
setup(e) {
|
|
23
|
-
return (t, n) => (M(), G(L(
|
|
23
|
+
return (t, n) => (M(), G(L(et), {
|
|
24
24
|
as: "span",
|
|
25
25
|
class: "mention",
|
|
26
26
|
"data-id": e.node.attrs.id,
|
|
27
27
|
"data-value": e.node.attrs.value
|
|
28
28
|
}, {
|
|
29
29
|
default: $(() => [
|
|
30
|
-
|
|
30
|
+
Yt(pe(e.extension.options.char) + pe(e.node.attrs.label), 1)
|
|
31
31
|
]),
|
|
32
32
|
_: 1
|
|
33
33
|
}, 8, ["data-id", "data-value"]));
|
|
34
34
|
}
|
|
35
|
-
}),
|
|
35
|
+
}), En = /* @__PURE__ */ j(vn, [["__scopeId", "data-v-b42c4fae"]]), Ie = Math.min, fe = Math.max, $e = Math.round, Pe = Math.floor, X = (e) => ({
|
|
36
36
|
x: e,
|
|
37
37
|
y: e
|
|
38
|
-
}),
|
|
38
|
+
}), wn = {
|
|
39
39
|
left: "right",
|
|
40
40
|
right: "left",
|
|
41
41
|
bottom: "top",
|
|
42
42
|
top: "bottom"
|
|
43
|
-
}, En = {
|
|
44
|
-
start: "end",
|
|
45
|
-
end: "start"
|
|
46
43
|
};
|
|
47
|
-
function
|
|
48
|
-
return
|
|
44
|
+
function gt(e, t, n) {
|
|
45
|
+
return fe(e, Ie(t, n));
|
|
49
46
|
}
|
|
50
|
-
function
|
|
47
|
+
function He(e, t) {
|
|
51
48
|
return typeof e == "function" ? e(t) : e;
|
|
52
49
|
}
|
|
53
|
-
function
|
|
50
|
+
function ye(e) {
|
|
54
51
|
return e.split("-")[0];
|
|
55
52
|
}
|
|
56
|
-
function
|
|
53
|
+
function Fe(e) {
|
|
57
54
|
return e.split("-")[1];
|
|
58
55
|
}
|
|
59
|
-
function
|
|
56
|
+
function Ot(e) {
|
|
60
57
|
return e === "x" ? "y" : "x";
|
|
61
58
|
}
|
|
62
|
-
function
|
|
59
|
+
function Rt(e) {
|
|
63
60
|
return e === "y" ? "height" : "width";
|
|
64
61
|
}
|
|
65
|
-
const wn = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
66
62
|
function ne(e) {
|
|
67
|
-
|
|
63
|
+
const t = e[0];
|
|
64
|
+
return t === "t" || t === "b" ? "y" : "x";
|
|
68
65
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
66
|
+
function Pt(e) {
|
|
67
|
+
return Ot(ne(e));
|
|
71
68
|
}
|
|
72
69
|
function bn(e, t, n) {
|
|
73
70
|
n === void 0 && (n = !1);
|
|
74
|
-
const o =
|
|
71
|
+
const o = Fe(e), i = Pt(e), s = Rt(i);
|
|
75
72
|
let l = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
76
|
-
return t.reference[s] > t.floating[s] && (l =
|
|
73
|
+
return t.reference[s] > t.floating[s] && (l = Ne(l)), [l, Ne(l)];
|
|
77
74
|
}
|
|
78
75
|
function An(e) {
|
|
79
|
-
const t =
|
|
80
|
-
return [
|
|
76
|
+
const t = Ne(e);
|
|
77
|
+
return [Je(e), t, Je(t)];
|
|
81
78
|
}
|
|
82
|
-
function
|
|
83
|
-
return e.replace(
|
|
79
|
+
function Je(e) {
|
|
80
|
+
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
84
81
|
}
|
|
85
|
-
const
|
|
82
|
+
const yt = ["left", "right"], xt = ["right", "left"], Sn = ["top", "bottom"], Cn = ["bottom", "top"];
|
|
86
83
|
function _n(e, t, n) {
|
|
87
84
|
switch (e) {
|
|
88
85
|
case "top":
|
|
89
86
|
case "bottom":
|
|
90
|
-
return n ? t ?
|
|
87
|
+
return n ? t ? xt : yt : t ? yt : xt;
|
|
91
88
|
case "left":
|
|
92
89
|
case "right":
|
|
93
90
|
return t ? Sn : Cn;
|
|
@@ -96,12 +93,13 @@ function _n(e, t, n) {
|
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
function Ln(e, t, n, o) {
|
|
99
|
-
const i =
|
|
100
|
-
let s = _n(
|
|
101
|
-
return i && (s = s.map((l) => l + "-" + i), t && (s = s.concat(s.map(
|
|
96
|
+
const i = Fe(e);
|
|
97
|
+
let s = _n(ye(e), n === "start", o);
|
|
98
|
+
return i && (s = s.map((l) => l + "-" + i), t && (s = s.concat(s.map(Je)))), s;
|
|
102
99
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
100
|
+
function Ne(e) {
|
|
101
|
+
const t = ye(e);
|
|
102
|
+
return wn[t] + e.slice(t.length);
|
|
105
103
|
}
|
|
106
104
|
function Mn(e) {
|
|
107
105
|
return {
|
|
@@ -120,7 +118,7 @@ function On(e) {
|
|
|
120
118
|
left: e
|
|
121
119
|
};
|
|
122
120
|
}
|
|
123
|
-
function
|
|
121
|
+
function We(e) {
|
|
124
122
|
const {
|
|
125
123
|
x: t,
|
|
126
124
|
y: n,
|
|
@@ -138,23 +136,23 @@ function Ne(e) {
|
|
|
138
136
|
y: n
|
|
139
137
|
};
|
|
140
138
|
}
|
|
141
|
-
function
|
|
139
|
+
function Tt(e, t, n) {
|
|
142
140
|
let {
|
|
143
141
|
reference: o,
|
|
144
142
|
floating: i
|
|
145
143
|
} = e;
|
|
146
|
-
const s = ne(t), l =
|
|
144
|
+
const s = ne(t), l = Pt(t), r = Rt(l), a = ye(t), c = s === "y", f = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, T = o[r] / 2 - i[r] / 2;
|
|
147
145
|
let y;
|
|
148
146
|
switch (a) {
|
|
149
147
|
case "top":
|
|
150
148
|
y = {
|
|
151
|
-
x:
|
|
149
|
+
x: f,
|
|
152
150
|
y: o.y - i.height
|
|
153
151
|
};
|
|
154
152
|
break;
|
|
155
153
|
case "bottom":
|
|
156
154
|
y = {
|
|
157
|
-
x:
|
|
155
|
+
x: f,
|
|
158
156
|
y: o.y + o.height
|
|
159
157
|
};
|
|
160
158
|
break;
|
|
@@ -176,17 +174,17 @@ function yt(e, t, n) {
|
|
|
176
174
|
y: o.y
|
|
177
175
|
};
|
|
178
176
|
}
|
|
179
|
-
switch (
|
|
177
|
+
switch (Fe(t)) {
|
|
180
178
|
case "start":
|
|
181
|
-
y[l] -=
|
|
179
|
+
y[l] -= T * (n && c ? -1 : 1);
|
|
182
180
|
break;
|
|
183
181
|
case "end":
|
|
184
|
-
y[l] +=
|
|
182
|
+
y[l] += T * (n && c ? -1 : 1);
|
|
185
183
|
break;
|
|
186
184
|
}
|
|
187
185
|
return y;
|
|
188
186
|
}
|
|
189
|
-
async function
|
|
187
|
+
async function Rn(e, t) {
|
|
190
188
|
var n;
|
|
191
189
|
t === void 0 && (t = {});
|
|
192
190
|
const {
|
|
@@ -198,30 +196,30 @@ async function Pn(e, t) {
|
|
|
198
196
|
strategy: a
|
|
199
197
|
} = e, {
|
|
200
198
|
boundary: c = "clippingAncestors",
|
|
201
|
-
rootBoundary:
|
|
199
|
+
rootBoundary: f = "viewport",
|
|
202
200
|
elementContext: u = "floating",
|
|
203
|
-
altBoundary:
|
|
201
|
+
altBoundary: T = !1,
|
|
204
202
|
padding: y = 0
|
|
205
|
-
} =
|
|
206
|
-
element: (n = await (s.isElement == null ? void 0 : s.isElement(
|
|
203
|
+
} = He(t, e), w = On(y), v = r[T ? u === "floating" ? "reference" : "floating" : u], h = We(await s.getClippingRect({
|
|
204
|
+
element: (n = await (s.isElement == null ? void 0 : s.isElement(v))) == null || n ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(r.floating)),
|
|
207
205
|
boundary: c,
|
|
208
|
-
rootBoundary:
|
|
206
|
+
rootBoundary: f,
|
|
209
207
|
strategy: a
|
|
210
208
|
})), x = u === "floating" ? {
|
|
211
209
|
x: o,
|
|
212
210
|
y: i,
|
|
213
211
|
width: l.floating.width,
|
|
214
212
|
height: l.floating.height
|
|
215
|
-
} : l.reference,
|
|
213
|
+
} : l.reference, p = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(r.floating)), d = await (s.isElement == null ? void 0 : s.isElement(p)) ? await (s.getScale == null ? void 0 : s.getScale(p)) || {
|
|
216
214
|
x: 1,
|
|
217
215
|
y: 1
|
|
218
216
|
} : {
|
|
219
217
|
x: 1,
|
|
220
218
|
y: 1
|
|
221
|
-
}, m =
|
|
219
|
+
}, m = We(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
222
220
|
elements: r,
|
|
223
221
|
rect: x,
|
|
224
|
-
offsetParent:
|
|
222
|
+
offsetParent: p,
|
|
225
223
|
strategy: a
|
|
226
224
|
}) : x);
|
|
227
225
|
return {
|
|
@@ -231,71 +229,71 @@ async function Pn(e, t) {
|
|
|
231
229
|
right: (m.right - h.right + w.right) / d.x
|
|
232
230
|
};
|
|
233
231
|
}
|
|
234
|
-
const
|
|
232
|
+
const Pn = 50, Dn = async (e, t, n) => {
|
|
235
233
|
const {
|
|
236
234
|
placement: o = "bottom",
|
|
237
235
|
strategy: i = "absolute",
|
|
238
236
|
middleware: s = [],
|
|
239
237
|
platform: l
|
|
240
|
-
} = n, r =
|
|
238
|
+
} = n, r = l.detectOverflow ? l : {
|
|
239
|
+
...l,
|
|
240
|
+
detectOverflow: Rn
|
|
241
|
+
}, a = await (l.isRTL == null ? void 0 : l.isRTL(t));
|
|
241
242
|
let c = await l.getElementRects({
|
|
242
243
|
reference: e,
|
|
243
244
|
floating: t,
|
|
244
245
|
strategy: i
|
|
245
246
|
}), {
|
|
246
|
-
x:
|
|
247
|
+
x: f,
|
|
247
248
|
y: u
|
|
248
|
-
} =
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
} = Tt(c, o, a), T = o, y = 0;
|
|
250
|
+
const w = {};
|
|
251
|
+
for (let b = 0; b < s.length; b++) {
|
|
252
|
+
const v = s[b];
|
|
253
|
+
if (!v)
|
|
254
|
+
continue;
|
|
251
255
|
const {
|
|
252
256
|
name: h,
|
|
253
257
|
fn: x
|
|
254
|
-
} =
|
|
255
|
-
x:
|
|
258
|
+
} = v, {
|
|
259
|
+
x: p,
|
|
256
260
|
y: d,
|
|
257
261
|
data: m,
|
|
258
262
|
reset: g
|
|
259
263
|
} = await x({
|
|
260
|
-
x:
|
|
264
|
+
x: f,
|
|
261
265
|
y: u,
|
|
262
266
|
initialPlacement: o,
|
|
263
|
-
placement:
|
|
267
|
+
placement: T,
|
|
264
268
|
strategy: i,
|
|
265
|
-
middlewareData:
|
|
269
|
+
middlewareData: w,
|
|
266
270
|
rects: c,
|
|
267
|
-
platform:
|
|
268
|
-
...l,
|
|
269
|
-
detectOverflow: (b = l.detectOverflow) != null ? b : Pn
|
|
270
|
-
},
|
|
271
|
+
platform: r,
|
|
271
272
|
elements: {
|
|
272
273
|
reference: e,
|
|
273
274
|
floating: t
|
|
274
275
|
}
|
|
275
276
|
});
|
|
276
|
-
|
|
277
|
-
...
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
...m
|
|
281
|
-
}
|
|
282
|
-
}, g && w <= 50 && (w++, typeof g == "object" && (g.placement && (v = g.placement), g.rects && (c = g.rects === !0 ? await l.getElementRects({
|
|
277
|
+
f = p ?? f, u = d ?? u, w[h] = {
|
|
278
|
+
...w[h],
|
|
279
|
+
...m
|
|
280
|
+
}, g && y < Pn && (y++, typeof g == "object" && (g.placement && (T = g.placement), g.rects && (c = g.rects === !0 ? await l.getElementRects({
|
|
283
281
|
reference: e,
|
|
284
282
|
floating: t,
|
|
285
283
|
strategy: i
|
|
286
284
|
}) : g.rects), {
|
|
287
|
-
x:
|
|
285
|
+
x: f,
|
|
288
286
|
y: u
|
|
289
|
-
} =
|
|
287
|
+
} = Tt(c, T, a)), b = -1);
|
|
290
288
|
}
|
|
291
289
|
return {
|
|
292
|
-
x:
|
|
290
|
+
x: f,
|
|
293
291
|
y: u,
|
|
294
|
-
placement:
|
|
292
|
+
placement: T,
|
|
295
293
|
strategy: i,
|
|
296
|
-
middlewareData:
|
|
294
|
+
middlewareData: w
|
|
297
295
|
};
|
|
298
|
-
},
|
|
296
|
+
}, kn = function(e) {
|
|
299
297
|
return e === void 0 && (e = {}), {
|
|
300
298
|
name: "flip",
|
|
301
299
|
options: e,
|
|
@@ -309,21 +307,21 @@ const Rn = async (e, t, n) => {
|
|
|
309
307
|
platform: a,
|
|
310
308
|
elements: c
|
|
311
309
|
} = t, {
|
|
312
|
-
mainAxis:
|
|
310
|
+
mainAxis: f = !0,
|
|
313
311
|
crossAxis: u = !0,
|
|
314
|
-
fallbackPlacements:
|
|
312
|
+
fallbackPlacements: T,
|
|
315
313
|
fallbackStrategy: y = "bestFit",
|
|
316
314
|
fallbackAxisSideDirection: w = "none",
|
|
317
315
|
flipAlignment: b = !0,
|
|
318
|
-
...
|
|
319
|
-
} =
|
|
316
|
+
...v
|
|
317
|
+
} = He(e, t);
|
|
320
318
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
321
319
|
return {};
|
|
322
|
-
const h =
|
|
323
|
-
!
|
|
324
|
-
const E = [r, ...m], _ = await a.detectOverflow(t,
|
|
320
|
+
const h = ye(i), x = ne(r), p = ye(r) === r, d = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), m = T || (p || !b ? [Ne(r)] : An(r)), g = w !== "none";
|
|
321
|
+
!T && g && m.push(...Ln(r, b, w, d));
|
|
322
|
+
const E = [r, ...m], _ = await a.detectOverflow(t, v), C = [];
|
|
325
323
|
let I = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
326
|
-
if (
|
|
324
|
+
if (f && C.push(_[h]), u) {
|
|
327
325
|
const ae = bn(i, l, d);
|
|
328
326
|
C.push(_[ae[0]], _[ae[1]]);
|
|
329
327
|
}
|
|
@@ -331,9 +329,9 @@ const Rn = async (e, t, n) => {
|
|
|
331
329
|
placement: i,
|
|
332
330
|
overflows: C
|
|
333
331
|
}], !C.every((ae) => ae <= 0)) {
|
|
334
|
-
var
|
|
335
|
-
const ae = (((
|
|
336
|
-
if (
|
|
332
|
+
var J, pt;
|
|
333
|
+
const ae = (((J = s.flip) == null ? void 0 : J.index) || 0) + 1, Xe = E[ae];
|
|
334
|
+
if (Xe && (!(u === "alignment" ? x !== ne(Xe) : !1) || // We leave the current main axis only if every placement on that axis
|
|
337
335
|
// overflows the main axis.
|
|
338
336
|
I.every((H) => ne(H.placement) === x ? H.overflows[0] > 0 : !0)))
|
|
339
337
|
return {
|
|
@@ -342,15 +340,15 @@ const Rn = async (e, t, n) => {
|
|
|
342
340
|
overflows: I
|
|
343
341
|
},
|
|
344
342
|
reset: {
|
|
345
|
-
placement:
|
|
343
|
+
placement: Xe
|
|
346
344
|
}
|
|
347
345
|
};
|
|
348
|
-
let
|
|
349
|
-
if (!
|
|
346
|
+
let Ce = (pt = I.filter((ce) => ce.overflows[0] <= 0).sort((ce, H) => ce.overflows[1] - H.overflows[1])[0]) == null ? void 0 : pt.placement;
|
|
347
|
+
if (!Ce)
|
|
350
348
|
switch (y) {
|
|
351
349
|
case "bestFit": {
|
|
352
|
-
var
|
|
353
|
-
const ce = (
|
|
350
|
+
var mt;
|
|
351
|
+
const ce = (mt = I.filter((H) => {
|
|
354
352
|
if (g) {
|
|
355
353
|
const te = ne(H.placement);
|
|
356
354
|
return te === x || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -358,33 +356,33 @@ const Rn = async (e, t, n) => {
|
|
|
358
356
|
te === "y";
|
|
359
357
|
}
|
|
360
358
|
return !0;
|
|
361
|
-
}).map((H) => [H.placement, H.overflows.filter((te) => te > 0).reduce((te,
|
|
362
|
-
ce && (
|
|
359
|
+
}).map((H) => [H.placement, H.overflows.filter((te) => te > 0).reduce((te, Gt) => te + Gt, 0)]).sort((H, te) => H[1] - te[1])[0]) == null ? void 0 : mt[0];
|
|
360
|
+
ce && (Ce = ce);
|
|
363
361
|
break;
|
|
364
362
|
}
|
|
365
363
|
case "initialPlacement":
|
|
366
|
-
|
|
364
|
+
Ce = r;
|
|
367
365
|
break;
|
|
368
366
|
}
|
|
369
|
-
if (i !==
|
|
367
|
+
if (i !== Ce)
|
|
370
368
|
return {
|
|
371
369
|
reset: {
|
|
372
|
-
placement:
|
|
370
|
+
placement: Ce
|
|
373
371
|
}
|
|
374
372
|
};
|
|
375
373
|
}
|
|
376
374
|
return {};
|
|
377
375
|
}
|
|
378
376
|
};
|
|
379
|
-
},
|
|
380
|
-
async function
|
|
377
|
+
}, Bn = /* @__PURE__ */ new Set(["left", "top"]);
|
|
378
|
+
async function In(e, t) {
|
|
381
379
|
const {
|
|
382
380
|
placement: n,
|
|
383
381
|
platform: o,
|
|
384
382
|
elements: i
|
|
385
|
-
} = e, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), l =
|
|
383
|
+
} = e, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), l = ye(n), r = Fe(n), a = ne(n) === "y", c = Bn.has(l) ? -1 : 1, f = s && a ? -1 : 1, u = He(t, e);
|
|
386
384
|
let {
|
|
387
|
-
mainAxis:
|
|
385
|
+
mainAxis: T,
|
|
388
386
|
crossAxis: y,
|
|
389
387
|
alignmentAxis: w
|
|
390
388
|
} = typeof u == "number" ? {
|
|
@@ -397,14 +395,14 @@ async function Bn(e, t) {
|
|
|
397
395
|
alignmentAxis: u.alignmentAxis
|
|
398
396
|
};
|
|
399
397
|
return r && typeof w == "number" && (y = r === "end" ? w * -1 : w), a ? {
|
|
400
|
-
x: y *
|
|
401
|
-
y:
|
|
398
|
+
x: y * f,
|
|
399
|
+
y: T * c
|
|
402
400
|
} : {
|
|
403
|
-
x:
|
|
404
|
-
y: y *
|
|
401
|
+
x: T * c,
|
|
402
|
+
y: y * f
|
|
405
403
|
};
|
|
406
404
|
}
|
|
407
|
-
const
|
|
405
|
+
const $n = function(e) {
|
|
408
406
|
return e === void 0 && (e = 0), {
|
|
409
407
|
name: "offset",
|
|
410
408
|
options: e,
|
|
@@ -415,7 +413,7 @@ const In = function(e) {
|
|
|
415
413
|
y: s,
|
|
416
414
|
placement: l,
|
|
417
415
|
middlewareData: r
|
|
418
|
-
} = t, a = await
|
|
416
|
+
} = t, a = await In(t, e);
|
|
419
417
|
return l === ((n = r.offset) == null ? void 0 : n.placement) && (o = r.arrow) != null && o.alignmentOffset ? {} : {
|
|
420
418
|
x: i + a.x,
|
|
421
419
|
y: s + a.y,
|
|
@@ -426,7 +424,7 @@ const In = function(e) {
|
|
|
426
424
|
};
|
|
427
425
|
}
|
|
428
426
|
};
|
|
429
|
-
},
|
|
427
|
+
}, Nn = function(e) {
|
|
430
428
|
return e === void 0 && (e = {}), {
|
|
431
429
|
name: "shift",
|
|
432
430
|
options: e,
|
|
@@ -443,124 +441,124 @@ const In = function(e) {
|
|
|
443
441
|
fn: (h) => {
|
|
444
442
|
let {
|
|
445
443
|
x,
|
|
446
|
-
y:
|
|
444
|
+
y: p
|
|
447
445
|
} = h;
|
|
448
446
|
return {
|
|
449
447
|
x,
|
|
450
|
-
y:
|
|
448
|
+
y: p
|
|
451
449
|
};
|
|
452
450
|
}
|
|
453
451
|
},
|
|
454
452
|
...c
|
|
455
|
-
} =
|
|
453
|
+
} = He(e, t), f = {
|
|
456
454
|
x: n,
|
|
457
455
|
y: o
|
|
458
|
-
}, u = await s.detectOverflow(t, c),
|
|
459
|
-
let w =
|
|
456
|
+
}, u = await s.detectOverflow(t, c), T = ne(ye(i)), y = Ot(T);
|
|
457
|
+
let w = f[y], b = f[T];
|
|
460
458
|
if (l) {
|
|
461
|
-
const h = y === "y" ? "top" : "left", x = y === "y" ? "bottom" : "right",
|
|
462
|
-
w =
|
|
459
|
+
const h = y === "y" ? "top" : "left", x = y === "y" ? "bottom" : "right", p = w + u[h], d = w - u[x];
|
|
460
|
+
w = gt(p, w, d);
|
|
463
461
|
}
|
|
464
462
|
if (r) {
|
|
465
|
-
const h =
|
|
466
|
-
b =
|
|
463
|
+
const h = T === "y" ? "top" : "left", x = T === "y" ? "bottom" : "right", p = b + u[h], d = b - u[x];
|
|
464
|
+
b = gt(p, b, d);
|
|
467
465
|
}
|
|
468
|
-
const
|
|
466
|
+
const v = a.fn({
|
|
469
467
|
...t,
|
|
470
468
|
[y]: w,
|
|
471
|
-
[
|
|
469
|
+
[T]: b
|
|
472
470
|
});
|
|
473
471
|
return {
|
|
474
|
-
...
|
|
472
|
+
...v,
|
|
475
473
|
data: {
|
|
476
|
-
x:
|
|
477
|
-
y:
|
|
474
|
+
x: v.x - n,
|
|
475
|
+
y: v.y - o,
|
|
478
476
|
enabled: {
|
|
479
477
|
[y]: l,
|
|
480
|
-
[
|
|
478
|
+
[T]: r
|
|
481
479
|
}
|
|
482
480
|
}
|
|
483
481
|
};
|
|
484
482
|
}
|
|
485
483
|
};
|
|
486
484
|
};
|
|
487
|
-
function
|
|
485
|
+
function Ve() {
|
|
488
486
|
return typeof window < "u";
|
|
489
487
|
}
|
|
490
|
-
function
|
|
491
|
-
return
|
|
488
|
+
function Se(e) {
|
|
489
|
+
return Dt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
492
490
|
}
|
|
493
491
|
function W(e) {
|
|
494
492
|
var t;
|
|
495
493
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
496
494
|
}
|
|
497
|
-
function
|
|
495
|
+
function Z(e) {
|
|
498
496
|
var t;
|
|
499
|
-
return (t = (
|
|
497
|
+
return (t = (Dt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
500
498
|
}
|
|
501
|
-
function
|
|
502
|
-
return
|
|
499
|
+
function Dt(e) {
|
|
500
|
+
return Ve() ? e instanceof Node || e instanceof W(e).Node : !1;
|
|
503
501
|
}
|
|
504
502
|
function z(e) {
|
|
505
|
-
return
|
|
503
|
+
return Ve() ? e instanceof Element || e instanceof W(e).Element : !1;
|
|
506
504
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
505
|
+
function ee(e) {
|
|
506
|
+
return Ve() ? e instanceof HTMLElement || e instanceof W(e).HTMLElement : !1;
|
|
509
507
|
}
|
|
510
|
-
function
|
|
511
|
-
return !
|
|
508
|
+
function vt(e) {
|
|
509
|
+
return !Ve() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof W(e).ShadowRoot;
|
|
512
510
|
}
|
|
513
|
-
|
|
514
|
-
function Oe(e) {
|
|
511
|
+
function Re(e) {
|
|
515
512
|
const {
|
|
516
513
|
overflow: t,
|
|
517
514
|
overflowX: n,
|
|
518
515
|
overflowY: o,
|
|
519
516
|
display: i
|
|
520
517
|
} = q(e);
|
|
521
|
-
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) &&
|
|
518
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && i !== "inline" && i !== "contents";
|
|
522
519
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
return Wn.has(Ae(e));
|
|
520
|
+
function Wn(e) {
|
|
521
|
+
return /^(table|td|th)$/.test(Se(e));
|
|
526
522
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
}
|
|
523
|
+
function ze(e) {
|
|
524
|
+
try {
|
|
525
|
+
if (e.matches(":popover-open"))
|
|
526
|
+
return !0;
|
|
527
|
+
} catch {
|
|
528
|
+
}
|
|
529
|
+
try {
|
|
530
|
+
return e.matches(":modal");
|
|
531
|
+
} catch {
|
|
532
|
+
return !1;
|
|
533
|
+
}
|
|
536
534
|
}
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
535
|
+
const Kn = /transform|translate|scale|rotate|perspective|filter/, Hn = /paint|layout|strict|content/, ue = (e) => !!e && e !== "none";
|
|
536
|
+
let Ge;
|
|
537
|
+
function st(e) {
|
|
538
|
+
const t = z(e) ? q(e) : e;
|
|
539
|
+
return ue(t.transform) || ue(t.translate) || ue(t.scale) || ue(t.rotate) || ue(t.perspective) || !rt() && (ue(t.backdropFilter) || ue(t.filter)) || Kn.test(t.willChange || "") || Hn.test(t.contain || "");
|
|
541
540
|
}
|
|
542
|
-
function
|
|
541
|
+
function Fn(e) {
|
|
543
542
|
let t = se(e);
|
|
544
|
-
for (;
|
|
545
|
-
if (
|
|
543
|
+
for (; ee(t) && !we(t); ) {
|
|
544
|
+
if (st(t))
|
|
546
545
|
return t;
|
|
547
|
-
if (
|
|
546
|
+
if (ze(t))
|
|
548
547
|
return null;
|
|
549
548
|
t = se(t);
|
|
550
549
|
}
|
|
551
550
|
return null;
|
|
552
551
|
}
|
|
553
|
-
function
|
|
554
|
-
return typeof CSS
|
|
552
|
+
function rt() {
|
|
553
|
+
return Ge == null && (Ge = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), Ge;
|
|
555
554
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
return Un.has(Ae(e));
|
|
555
|
+
function we(e) {
|
|
556
|
+
return /^(html|body|#document)$/.test(Se(e));
|
|
559
557
|
}
|
|
560
558
|
function q(e) {
|
|
561
559
|
return W(e).getComputedStyle(e);
|
|
562
560
|
}
|
|
563
|
-
function
|
|
561
|
+
function qe(e) {
|
|
564
562
|
return z(e) ? {
|
|
565
563
|
scrollLeft: e.scrollLeft,
|
|
566
564
|
scrollTop: e.scrollTop
|
|
@@ -570,161 +568,161 @@ function ze(e) {
|
|
|
570
568
|
};
|
|
571
569
|
}
|
|
572
570
|
function se(e) {
|
|
573
|
-
if (
|
|
571
|
+
if (Se(e) === "html")
|
|
574
572
|
return e;
|
|
575
573
|
const t = (
|
|
576
574
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
577
575
|
e.assignedSlot || // DOM Element detected.
|
|
578
576
|
e.parentNode || // ShadowRoot detected.
|
|
579
|
-
|
|
580
|
-
|
|
577
|
+
vt(e) && e.host || // Fallback.
|
|
578
|
+
Z(e)
|
|
581
579
|
);
|
|
582
|
-
return
|
|
580
|
+
return vt(t) ? t.host : t;
|
|
583
581
|
}
|
|
584
|
-
function
|
|
582
|
+
function kt(e) {
|
|
585
583
|
const t = se(e);
|
|
586
|
-
return
|
|
584
|
+
return we(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : ee(t) && Re(t) ? t : kt(t);
|
|
587
585
|
}
|
|
588
|
-
function
|
|
586
|
+
function Me(e, t, n) {
|
|
589
587
|
var o;
|
|
590
588
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
591
|
-
const i =
|
|
589
|
+
const i = kt(e), s = i === ((o = e.ownerDocument) == null ? void 0 : o.body), l = W(i);
|
|
592
590
|
if (s) {
|
|
593
|
-
const r =
|
|
594
|
-
return t.concat(l, l.visualViewport || [],
|
|
595
|
-
}
|
|
596
|
-
|
|
591
|
+
const r = Qe(l);
|
|
592
|
+
return t.concat(l, l.visualViewport || [], Re(i) ? i : [], r && n ? Me(r) : []);
|
|
593
|
+
} else
|
|
594
|
+
return t.concat(i, Me(i, [], n));
|
|
597
595
|
}
|
|
598
|
-
function
|
|
596
|
+
function Qe(e) {
|
|
599
597
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
600
598
|
}
|
|
601
|
-
function
|
|
599
|
+
function Bt(e) {
|
|
602
600
|
const t = q(e);
|
|
603
601
|
let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
|
604
|
-
const i =
|
|
602
|
+
const i = ee(e), s = i ? e.offsetWidth : n, l = i ? e.offsetHeight : o, r = $e(n) !== s || $e(o) !== l;
|
|
605
603
|
return r && (n = s, o = l), {
|
|
606
604
|
width: n,
|
|
607
605
|
height: o,
|
|
608
606
|
$: r
|
|
609
607
|
};
|
|
610
608
|
}
|
|
611
|
-
function
|
|
609
|
+
function it(e) {
|
|
612
610
|
return z(e) ? e : e.contextElement;
|
|
613
611
|
}
|
|
614
|
-
function
|
|
615
|
-
const t =
|
|
616
|
-
if (!
|
|
612
|
+
function Ee(e) {
|
|
613
|
+
const t = it(e);
|
|
614
|
+
if (!ee(t))
|
|
617
615
|
return X(1);
|
|
618
616
|
const n = t.getBoundingClientRect(), {
|
|
619
617
|
width: o,
|
|
620
618
|
height: i,
|
|
621
619
|
$: s
|
|
622
|
-
} =
|
|
623
|
-
let l = (s ?
|
|
620
|
+
} = Bt(t);
|
|
621
|
+
let l = (s ? $e(n.width) : n.width) / o, r = (s ? $e(n.height) : n.height) / i;
|
|
624
622
|
return (!l || !Number.isFinite(l)) && (l = 1), (!r || !Number.isFinite(r)) && (r = 1), {
|
|
625
623
|
x: l,
|
|
626
624
|
y: r
|
|
627
625
|
};
|
|
628
626
|
}
|
|
629
|
-
const
|
|
630
|
-
function
|
|
627
|
+
const Vn = /* @__PURE__ */ X(0);
|
|
628
|
+
function It(e) {
|
|
631
629
|
const t = W(e);
|
|
632
|
-
return !
|
|
630
|
+
return !rt() || !t.visualViewport ? Vn : {
|
|
633
631
|
x: t.visualViewport.offsetLeft,
|
|
634
632
|
y: t.visualViewport.offsetTop
|
|
635
633
|
};
|
|
636
634
|
}
|
|
637
|
-
function
|
|
635
|
+
function zn(e, t, n) {
|
|
638
636
|
return t === void 0 && (t = !1), !n || t && n !== W(e) ? !1 : t;
|
|
639
637
|
}
|
|
640
|
-
function
|
|
638
|
+
function xe(e, t, n, o) {
|
|
641
639
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
642
|
-
const i = e.getBoundingClientRect(), s =
|
|
640
|
+
const i = e.getBoundingClientRect(), s = it(e);
|
|
643
641
|
let l = X(1);
|
|
644
|
-
t && (o ? z(o) && (l =
|
|
645
|
-
const r =
|
|
646
|
-
let a = (i.left + r.x) / l.x, c = (i.top + r.y) / l.y,
|
|
642
|
+
t && (o ? z(o) && (l = Ee(o)) : l = Ee(e));
|
|
643
|
+
const r = zn(s, n, o) ? It(s) : X(0);
|
|
644
|
+
let a = (i.left + r.x) / l.x, c = (i.top + r.y) / l.y, f = i.width / l.x, u = i.height / l.y;
|
|
647
645
|
if (s) {
|
|
648
|
-
const
|
|
649
|
-
let w =
|
|
646
|
+
const T = W(s), y = o && z(o) ? W(o) : o;
|
|
647
|
+
let w = T, b = Qe(w);
|
|
650
648
|
for (; b && o && y !== w; ) {
|
|
651
|
-
const
|
|
652
|
-
a *=
|
|
649
|
+
const v = Ee(b), h = b.getBoundingClientRect(), x = q(b), p = h.left + (b.clientLeft + parseFloat(x.paddingLeft)) * v.x, d = h.top + (b.clientTop + parseFloat(x.paddingTop)) * v.y;
|
|
650
|
+
a *= v.x, c *= v.y, f *= v.x, u *= v.y, a += p, c += d, w = W(b), b = Qe(w);
|
|
653
651
|
}
|
|
654
652
|
}
|
|
655
|
-
return
|
|
656
|
-
width:
|
|
653
|
+
return We({
|
|
654
|
+
width: f,
|
|
657
655
|
height: u,
|
|
658
656
|
x: a,
|
|
659
657
|
y: c
|
|
660
658
|
});
|
|
661
659
|
}
|
|
662
|
-
function
|
|
663
|
-
const n =
|
|
664
|
-
return t ? t.left + n :
|
|
660
|
+
function Ue(e, t) {
|
|
661
|
+
const n = qe(e).scrollLeft;
|
|
662
|
+
return t ? t.left + n : xe(Z(e)).left + n;
|
|
665
663
|
}
|
|
666
|
-
function
|
|
667
|
-
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft -
|
|
664
|
+
function $t(e, t) {
|
|
665
|
+
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - Ue(e, n), i = n.top + t.scrollTop;
|
|
668
666
|
return {
|
|
669
667
|
x: o,
|
|
670
668
|
y: i
|
|
671
669
|
};
|
|
672
670
|
}
|
|
673
|
-
function
|
|
671
|
+
function qn(e) {
|
|
674
672
|
let {
|
|
675
673
|
elements: t,
|
|
676
674
|
rect: n,
|
|
677
675
|
offsetParent: o,
|
|
678
676
|
strategy: i
|
|
679
677
|
} = e;
|
|
680
|
-
const s = i === "fixed", l =
|
|
678
|
+
const s = i === "fixed", l = Z(o), r = t ? ze(t.floating) : !1;
|
|
681
679
|
if (o === l || r && s)
|
|
682
680
|
return n;
|
|
683
681
|
let a = {
|
|
684
682
|
scrollLeft: 0,
|
|
685
683
|
scrollTop: 0
|
|
686
684
|
}, c = X(1);
|
|
687
|
-
const
|
|
688
|
-
if ((u || !u && !s) && ((
|
|
689
|
-
const y =
|
|
690
|
-
c =
|
|
685
|
+
const f = X(0), u = ee(o);
|
|
686
|
+
if ((u || !u && !s) && ((Se(o) !== "body" || Re(l)) && (a = qe(o)), u)) {
|
|
687
|
+
const y = xe(o);
|
|
688
|
+
c = Ee(o), f.x = y.x + o.clientLeft, f.y = y.y + o.clientTop;
|
|
691
689
|
}
|
|
692
|
-
const
|
|
690
|
+
const T = l && !u && !s ? $t(l, a) : X(0);
|
|
693
691
|
return {
|
|
694
692
|
width: n.width * c.x,
|
|
695
693
|
height: n.height * c.y,
|
|
696
|
-
x: n.x * c.x - a.scrollLeft * c.x +
|
|
697
|
-
y: n.y * c.y - a.scrollTop * c.y +
|
|
694
|
+
x: n.x * c.x - a.scrollLeft * c.x + f.x + T.x,
|
|
695
|
+
y: n.y * c.y - a.scrollTop * c.y + f.y + T.y
|
|
698
696
|
};
|
|
699
697
|
}
|
|
700
|
-
function
|
|
698
|
+
function Un(e) {
|
|
701
699
|
return Array.from(e.getClientRects());
|
|
702
700
|
}
|
|
703
|
-
function
|
|
704
|
-
const t =
|
|
705
|
-
let l = -n.scrollLeft +
|
|
701
|
+
function Xn(e) {
|
|
702
|
+
const t = Z(e), n = qe(e), o = e.ownerDocument.body, i = fe(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), s = fe(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
|
|
703
|
+
let l = -n.scrollLeft + Ue(e);
|
|
706
704
|
const r = -n.scrollTop;
|
|
707
|
-
return q(o).direction === "rtl" && (l +=
|
|
705
|
+
return q(o).direction === "rtl" && (l += fe(t.clientWidth, o.clientWidth) - i), {
|
|
708
706
|
width: i,
|
|
709
707
|
height: s,
|
|
710
708
|
x: l,
|
|
711
709
|
y: r
|
|
712
710
|
};
|
|
713
711
|
}
|
|
714
|
-
const
|
|
715
|
-
function
|
|
716
|
-
const n = W(e), o =
|
|
712
|
+
const Et = 25;
|
|
713
|
+
function Gn(e, t) {
|
|
714
|
+
const n = W(e), o = Z(e), i = n.visualViewport;
|
|
717
715
|
let s = o.clientWidth, l = o.clientHeight, r = 0, a = 0;
|
|
718
716
|
if (i) {
|
|
719
717
|
s = i.width, l = i.height;
|
|
720
|
-
const
|
|
721
|
-
(!
|
|
718
|
+
const f = rt();
|
|
719
|
+
(!f || f && t === "fixed") && (r = i.offsetLeft, a = i.offsetTop);
|
|
722
720
|
}
|
|
723
|
-
const c =
|
|
721
|
+
const c = Ue(o);
|
|
724
722
|
if (c <= 0) {
|
|
725
|
-
const
|
|
726
|
-
w <=
|
|
727
|
-
} else c <=
|
|
723
|
+
const f = o.ownerDocument, u = f.body, T = getComputedStyle(u), y = f.compatMode === "CSS1Compat" && parseFloat(T.marginLeft) + parseFloat(T.marginRight) || 0, w = Math.abs(o.clientWidth - u.clientWidth - y);
|
|
724
|
+
w <= Et && (s -= w);
|
|
725
|
+
} else c <= Et && (s += c);
|
|
728
726
|
return {
|
|
729
727
|
width: s,
|
|
730
728
|
height: l,
|
|
@@ -732,9 +730,8 @@ function Jn(e, t) {
|
|
|
732
730
|
y: a
|
|
733
731
|
};
|
|
734
732
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
const n = ye(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, s = Y(e) ? Te(e) : X(1), l = e.clientWidth * s.x, r = e.clientHeight * s.y, a = i * s.x, c = o * s.y;
|
|
733
|
+
function Yn(e, t) {
|
|
734
|
+
const n = xe(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, s = ee(e) ? Ee(e) : X(1), l = e.clientWidth * s.x, r = e.clientHeight * s.y, a = i * s.x, c = o * s.y;
|
|
738
735
|
return {
|
|
739
736
|
width: l,
|
|
740
737
|
height: r,
|
|
@@ -742,16 +739,16 @@ function eo(e, t) {
|
|
|
742
739
|
y: c
|
|
743
740
|
};
|
|
744
741
|
}
|
|
745
|
-
function
|
|
742
|
+
function wt(e, t, n) {
|
|
746
743
|
let o;
|
|
747
744
|
if (t === "viewport")
|
|
748
|
-
o =
|
|
745
|
+
o = Gn(e, n);
|
|
749
746
|
else if (t === "document")
|
|
750
|
-
o =
|
|
747
|
+
o = Xn(Z(e));
|
|
751
748
|
else if (z(t))
|
|
752
|
-
o =
|
|
749
|
+
o = Yn(t, n);
|
|
753
750
|
else {
|
|
754
|
-
const i =
|
|
751
|
+
const i = It(e);
|
|
755
752
|
o = {
|
|
756
753
|
x: t.x - i.x,
|
|
757
754
|
y: t.y - i.y,
|
|
@@ -759,110 +756,112 @@ function Tt(e, t, n) {
|
|
|
759
756
|
height: t.height
|
|
760
757
|
};
|
|
761
758
|
}
|
|
762
|
-
return
|
|
759
|
+
return We(o);
|
|
763
760
|
}
|
|
764
|
-
function
|
|
761
|
+
function Nt(e, t) {
|
|
765
762
|
const n = se(e);
|
|
766
|
-
return n === t || !z(n) ||
|
|
763
|
+
return n === t || !z(n) || we(n) ? !1 : q(n).position === "fixed" || Nt(n, t);
|
|
767
764
|
}
|
|
768
|
-
function
|
|
765
|
+
function jn(e, t) {
|
|
769
766
|
const n = t.get(e);
|
|
770
767
|
if (n)
|
|
771
768
|
return n;
|
|
772
|
-
let o =
|
|
769
|
+
let o = Me(e, [], !1).filter((r) => z(r) && Se(r) !== "body"), i = null;
|
|
773
770
|
const s = q(e).position === "fixed";
|
|
774
771
|
let l = s ? se(e) : e;
|
|
775
|
-
for (; z(l) && !
|
|
776
|
-
const r = q(l), a =
|
|
777
|
-
!a && r.position === "fixed" && (i = null), (s ? !a && !i : !a && r.position === "static" && !!i &&
|
|
772
|
+
for (; z(l) && !we(l); ) {
|
|
773
|
+
const r = q(l), a = st(l);
|
|
774
|
+
!a && r.position === "fixed" && (i = null), (s ? !a && !i : !a && r.position === "static" && !!i && (i.position === "absolute" || i.position === "fixed") || Re(l) && !a && Nt(e, l)) ? o = o.filter((f) => f !== l) : i = r, l = se(l);
|
|
778
775
|
}
|
|
779
776
|
return t.set(e, o), o;
|
|
780
777
|
}
|
|
781
|
-
function
|
|
778
|
+
function Zn(e) {
|
|
782
779
|
let {
|
|
783
780
|
element: t,
|
|
784
781
|
boundary: n,
|
|
785
782
|
rootBoundary: o,
|
|
786
783
|
strategy: i
|
|
787
784
|
} = e;
|
|
788
|
-
const l = [...n === "clippingAncestors" ?
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
785
|
+
const l = [...n === "clippingAncestors" ? ze(t) ? [] : jn(t, this._c) : [].concat(n), o], r = wt(t, l[0], i);
|
|
786
|
+
let a = r.top, c = r.right, f = r.bottom, u = r.left;
|
|
787
|
+
for (let T = 1; T < l.length; T++) {
|
|
788
|
+
const y = wt(t, l[T], i);
|
|
789
|
+
a = fe(y.top, a), c = Ie(y.right, c), f = Ie(y.bottom, f), u = fe(y.left, u);
|
|
790
|
+
}
|
|
792
791
|
return {
|
|
793
|
-
width:
|
|
794
|
-
height:
|
|
795
|
-
x:
|
|
796
|
-
y: a
|
|
792
|
+
width: c - u,
|
|
793
|
+
height: f - a,
|
|
794
|
+
x: u,
|
|
795
|
+
y: a
|
|
797
796
|
};
|
|
798
797
|
}
|
|
799
|
-
function
|
|
798
|
+
function Jn(e) {
|
|
800
799
|
const {
|
|
801
800
|
width: t,
|
|
802
801
|
height: n
|
|
803
|
-
} =
|
|
802
|
+
} = Bt(e);
|
|
804
803
|
return {
|
|
805
804
|
width: t,
|
|
806
805
|
height: n
|
|
807
806
|
};
|
|
808
807
|
}
|
|
809
|
-
function
|
|
810
|
-
const o =
|
|
808
|
+
function Qn(e, t, n) {
|
|
809
|
+
const o = ee(t), i = Z(t), s = n === "fixed", l = xe(e, !0, s, t);
|
|
811
810
|
let r = {
|
|
812
811
|
scrollLeft: 0,
|
|
813
812
|
scrollTop: 0
|
|
814
813
|
};
|
|
815
814
|
const a = X(0);
|
|
816
815
|
function c() {
|
|
817
|
-
a.x =
|
|
816
|
+
a.x = Ue(i);
|
|
818
817
|
}
|
|
819
818
|
if (o || !o && !s)
|
|
820
|
-
if ((
|
|
821
|
-
const y =
|
|
819
|
+
if ((Se(t) !== "body" || Re(i)) && (r = qe(t)), o) {
|
|
820
|
+
const y = xe(t, !0, s, t);
|
|
822
821
|
a.x = y.x + t.clientLeft, a.y = y.y + t.clientTop;
|
|
823
822
|
} else i && c();
|
|
824
823
|
s && !o && i && c();
|
|
825
|
-
const
|
|
824
|
+
const f = i && !o && !s ? $t(i, r) : X(0), u = l.left + r.scrollLeft - a.x - f.x, T = l.top + r.scrollTop - a.y - f.y;
|
|
826
825
|
return {
|
|
827
826
|
x: u,
|
|
828
|
-
y:
|
|
827
|
+
y: T,
|
|
829
828
|
width: l.width,
|
|
830
829
|
height: l.height
|
|
831
830
|
};
|
|
832
831
|
}
|
|
833
|
-
function
|
|
832
|
+
function Ye(e) {
|
|
834
833
|
return q(e).position === "static";
|
|
835
834
|
}
|
|
836
|
-
function
|
|
837
|
-
if (!
|
|
835
|
+
function bt(e, t) {
|
|
836
|
+
if (!ee(e) || q(e).position === "fixed")
|
|
838
837
|
return null;
|
|
839
838
|
if (t)
|
|
840
839
|
return t(e);
|
|
841
840
|
let n = e.offsetParent;
|
|
842
|
-
return
|
|
841
|
+
return Z(e) === n && (n = n.ownerDocument.body), n;
|
|
843
842
|
}
|
|
844
|
-
function
|
|
843
|
+
function Wt(e, t) {
|
|
845
844
|
const n = W(e);
|
|
846
|
-
if (
|
|
845
|
+
if (ze(e))
|
|
847
846
|
return n;
|
|
848
|
-
if (!
|
|
847
|
+
if (!ee(e)) {
|
|
849
848
|
let i = se(e);
|
|
850
|
-
for (; i && !
|
|
851
|
-
if (z(i) && !
|
|
849
|
+
for (; i && !we(i); ) {
|
|
850
|
+
if (z(i) && !Ye(i))
|
|
852
851
|
return i;
|
|
853
852
|
i = se(i);
|
|
854
853
|
}
|
|
855
854
|
return n;
|
|
856
855
|
}
|
|
857
|
-
let o =
|
|
858
|
-
for (; o &&
|
|
859
|
-
o =
|
|
860
|
-
return o &&
|
|
856
|
+
let o = bt(e, t);
|
|
857
|
+
for (; o && Wn(o) && Ye(o); )
|
|
858
|
+
o = bt(o, t);
|
|
859
|
+
return o && we(o) && Ye(o) && !st(o) ? n : o || Fn(e) || n;
|
|
861
860
|
}
|
|
862
|
-
const
|
|
863
|
-
const t = this.getOffsetParent ||
|
|
861
|
+
const eo = async function(e) {
|
|
862
|
+
const t = this.getOffsetParent || Wt, n = this.getDimensions, o = await n(e.floating);
|
|
864
863
|
return {
|
|
865
|
-
reference:
|
|
864
|
+
reference: Qn(e.reference, await t(e.floating), e.strategy),
|
|
866
865
|
floating: {
|
|
867
866
|
x: 0,
|
|
868
867
|
y: 0,
|
|
@@ -871,27 +870,27 @@ const ro = async function(e) {
|
|
|
871
870
|
}
|
|
872
871
|
};
|
|
873
872
|
};
|
|
874
|
-
function
|
|
873
|
+
function to(e) {
|
|
875
874
|
return q(e).direction === "rtl";
|
|
876
875
|
}
|
|
877
|
-
const
|
|
878
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
879
|
-
getDocumentElement:
|
|
880
|
-
getClippingRect:
|
|
881
|
-
getOffsetParent:
|
|
882
|
-
getElementRects:
|
|
883
|
-
getClientRects:
|
|
884
|
-
getDimensions:
|
|
885
|
-
getScale:
|
|
876
|
+
const no = {
|
|
877
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: qn,
|
|
878
|
+
getDocumentElement: Z,
|
|
879
|
+
getClippingRect: Zn,
|
|
880
|
+
getOffsetParent: Wt,
|
|
881
|
+
getElementRects: eo,
|
|
882
|
+
getClientRects: Un,
|
|
883
|
+
getDimensions: Jn,
|
|
884
|
+
getScale: Ee,
|
|
886
885
|
isElement: z,
|
|
887
|
-
isRTL:
|
|
886
|
+
isRTL: to
|
|
888
887
|
};
|
|
889
|
-
function
|
|
888
|
+
function Kt(e, t) {
|
|
890
889
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
891
890
|
}
|
|
892
|
-
function
|
|
891
|
+
function oo(e, t) {
|
|
893
892
|
let n = null, o;
|
|
894
|
-
const i =
|
|
893
|
+
const i = Z(e);
|
|
895
894
|
function s() {
|
|
896
895
|
var r;
|
|
897
896
|
clearTimeout(o), (r = n) == null || r.disconnect(), n = null;
|
|
@@ -899,16 +898,16 @@ function ao(e, t) {
|
|
|
899
898
|
function l(r, a) {
|
|
900
899
|
r === void 0 && (r = !1), a === void 0 && (a = 1), s();
|
|
901
900
|
const c = e.getBoundingClientRect(), {
|
|
902
|
-
left:
|
|
901
|
+
left: f,
|
|
903
902
|
top: u,
|
|
904
|
-
width:
|
|
903
|
+
width: T,
|
|
905
904
|
height: y
|
|
906
905
|
} = c;
|
|
907
|
-
if (r || t(), !
|
|
906
|
+
if (r || t(), !T || !y)
|
|
908
907
|
return;
|
|
909
|
-
const w = Pe(u), b = Pe(i.clientWidth - (
|
|
910
|
-
rootMargin: -w + "px " + -b + "px " + -
|
|
911
|
-
threshold:
|
|
908
|
+
const w = Pe(u), b = Pe(i.clientWidth - (f + T)), v = Pe(i.clientHeight - (u + y)), h = Pe(f), p = {
|
|
909
|
+
rootMargin: -w + "px " + -b + "px " + -v + "px " + -h + "px",
|
|
910
|
+
threshold: fe(0, Ie(1, a)) || 1
|
|
912
911
|
};
|
|
913
912
|
let d = !0;
|
|
914
913
|
function m(g) {
|
|
@@ -920,22 +919,22 @@ function ao(e, t) {
|
|
|
920
919
|
l(!1, 1e-7);
|
|
921
920
|
}, 1e3);
|
|
922
921
|
}
|
|
923
|
-
E === 1 && !
|
|
922
|
+
E === 1 && !Kt(c, e.getBoundingClientRect()) && l(), d = !1;
|
|
924
923
|
}
|
|
925
924
|
try {
|
|
926
925
|
n = new IntersectionObserver(m, {
|
|
927
|
-
...
|
|
926
|
+
...p,
|
|
928
927
|
// Handle <iframe>s
|
|
929
928
|
root: i.ownerDocument
|
|
930
929
|
});
|
|
931
930
|
} catch {
|
|
932
|
-
n = new IntersectionObserver(m,
|
|
931
|
+
n = new IntersectionObserver(m, p);
|
|
933
932
|
}
|
|
934
933
|
n.observe(e);
|
|
935
934
|
}
|
|
936
935
|
return l(!0), s;
|
|
937
936
|
}
|
|
938
|
-
function
|
|
937
|
+
function lt(e, t, n, o) {
|
|
939
938
|
o === void 0 && (o = {});
|
|
940
939
|
const {
|
|
941
940
|
ancestorScroll: i = !0,
|
|
@@ -943,43 +942,43 @@ function rt(e, t, n, o) {
|
|
|
943
942
|
elementResize: l = typeof ResizeObserver == "function",
|
|
944
943
|
layoutShift: r = typeof IntersectionObserver == "function",
|
|
945
944
|
animationFrame: a = !1
|
|
946
|
-
} = o, c =
|
|
947
|
-
|
|
945
|
+
} = o, c = it(e), f = i || s ? [...c ? Me(c) : [], ...t ? Me(t) : []] : [];
|
|
946
|
+
f.forEach((h) => {
|
|
948
947
|
i && h.addEventListener("scroll", n, {
|
|
949
948
|
passive: !0
|
|
950
949
|
}), s && h.addEventListener("resize", n);
|
|
951
950
|
});
|
|
952
|
-
const u = c && r ?
|
|
953
|
-
let
|
|
951
|
+
const u = c && r ? oo(c, n) : null;
|
|
952
|
+
let T = -1, y = null;
|
|
954
953
|
l && (y = new ResizeObserver((h) => {
|
|
955
954
|
let [x] = h;
|
|
956
|
-
x && x.target === c && y && (y.unobserve(t), cancelAnimationFrame(
|
|
957
|
-
var
|
|
958
|
-
(
|
|
955
|
+
x && x.target === c && y && t && (y.unobserve(t), cancelAnimationFrame(T), T = requestAnimationFrame(() => {
|
|
956
|
+
var p;
|
|
957
|
+
(p = y) == null || p.observe(t);
|
|
959
958
|
})), n();
|
|
960
|
-
}), c && !a && y.observe(c), y.observe(t));
|
|
961
|
-
let w, b = a ?
|
|
962
|
-
a &&
|
|
963
|
-
function
|
|
964
|
-
const h =
|
|
965
|
-
b && !
|
|
959
|
+
}), c && !a && y.observe(c), t && y.observe(t));
|
|
960
|
+
let w, b = a ? xe(e) : null;
|
|
961
|
+
a && v();
|
|
962
|
+
function v() {
|
|
963
|
+
const h = xe(e);
|
|
964
|
+
b && !Kt(b, h) && n(), b = h, w = requestAnimationFrame(v);
|
|
966
965
|
}
|
|
967
966
|
return n(), () => {
|
|
968
967
|
var h;
|
|
969
|
-
|
|
968
|
+
f.forEach((x) => {
|
|
970
969
|
i && x.removeEventListener("scroll", n), s && x.removeEventListener("resize", n);
|
|
971
970
|
}), u == null || u(), (h = y) == null || h.disconnect(), y = null, a && cancelAnimationFrame(w);
|
|
972
971
|
};
|
|
973
972
|
}
|
|
974
|
-
const
|
|
973
|
+
const at = $n, ct = Nn, ut = kn, dt = (e, t, n) => {
|
|
975
974
|
const o = /* @__PURE__ */ new Map(), i = {
|
|
976
|
-
platform:
|
|
975
|
+
platform: no,
|
|
977
976
|
...n
|
|
978
977
|
}, s = {
|
|
979
978
|
...i.platform,
|
|
980
979
|
_c: o
|
|
981
980
|
};
|
|
982
|
-
return
|
|
981
|
+
return Dn(e, t, {
|
|
983
982
|
...i,
|
|
984
983
|
platform: s
|
|
985
984
|
});
|
|
@@ -987,7 +986,7 @@ const it = In, lt = $n, at = Dn, ct = (e, t, n) => {
|
|
|
987
986
|
function ve(e) {
|
|
988
987
|
return `${e}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
989
988
|
}
|
|
990
|
-
function
|
|
989
|
+
function so(e, t, n = !1) {
|
|
991
990
|
const { $from: o } = e;
|
|
992
991
|
if (!e.empty || !o.parent.isTextblock)
|
|
993
992
|
return null;
|
|
@@ -1003,7 +1002,7 @@ function co(e, t, n = !1) {
|
|
|
1003
1002
|
query: l
|
|
1004
1003
|
};
|
|
1005
1004
|
}
|
|
1006
|
-
const
|
|
1005
|
+
const Te = {
|
|
1007
1006
|
/** Template 扩展(包含 TemplateBlock 和 TemplateSelect 子扩展) */
|
|
1008
1007
|
TEMPLATE: "template",
|
|
1009
1008
|
/** Mention 扩展 */
|
|
@@ -1047,7 +1046,7 @@ const xe = {
|
|
|
1047
1046
|
SELECT: "select",
|
|
1048
1047
|
/** Mention 类型 */
|
|
1049
1048
|
MENTION: "mention"
|
|
1050
|
-
},
|
|
1049
|
+
}, Ht = {
|
|
1051
1050
|
/** Enter 键 */
|
|
1052
1051
|
ENTER: "Enter",
|
|
1053
1052
|
/** Escape 键 */
|
|
@@ -1068,13 +1067,13 @@ const xe = {
|
|
|
1068
1067
|
ARROW_RIGHT: "ArrowRight",
|
|
1069
1068
|
/** 空格键 */
|
|
1070
1069
|
SPACE: " "
|
|
1071
|
-
}, D = (e, t) => e.key ===
|
|
1070
|
+
}, D = (e, t) => e.key === Ht[t], be = (e, t) => t.some((n) => e.key === Ht[n]), ro = ["onMousedown", "onMouseenter"], io = {
|
|
1072
1071
|
key: 0,
|
|
1073
1072
|
class: "mention-icon"
|
|
1074
|
-
},
|
|
1073
|
+
}, lo = { class: "mention-label" }, ao = {
|
|
1075
1074
|
key: 0,
|
|
1076
1075
|
class: "mention-empty"
|
|
1077
|
-
},
|
|
1076
|
+
}, co = /* @__PURE__ */ Y({
|
|
1078
1077
|
__name: "mention-list",
|
|
1079
1078
|
props: {
|
|
1080
1079
|
items: {},
|
|
@@ -1089,12 +1088,12 @@ const xe = {
|
|
|
1089
1088
|
}
|
|
1090
1089
|
);
|
|
1091
1090
|
function s({ event: c }) {
|
|
1092
|
-
return D(c, "ARROW_UP") ? (o.value = Math.max(0, o.value - 1), l(), !0) : D(c, "ARROW_DOWN") ? (o.value = Math.min(n.items.length - 1, o.value + 1), l(), !0) :
|
|
1091
|
+
return D(c, "ARROW_UP") ? (o.value = Math.max(0, o.value - 1), l(), !0) : D(c, "ARROW_DOWN") ? (o.value = Math.min(n.items.length - 1, o.value + 1), l(), !0) : be(c, ["ENTER", "TAB"]) ? (r(o.value), !0) : !1;
|
|
1093
1092
|
}
|
|
1094
1093
|
function l() {
|
|
1095
|
-
|
|
1096
|
-
var
|
|
1097
|
-
const c = (
|
|
1094
|
+
me(() => {
|
|
1095
|
+
var f;
|
|
1096
|
+
const c = (f = i.value) == null ? void 0 : f.querySelector(".mention-item.is-selected");
|
|
1098
1097
|
c && c.scrollIntoView({
|
|
1099
1098
|
block: "nearest",
|
|
1100
1099
|
behavior: "smooth"
|
|
@@ -1102,11 +1101,11 @@ const xe = {
|
|
|
1102
1101
|
});
|
|
1103
1102
|
}
|
|
1104
1103
|
function r(c) {
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
id:
|
|
1108
|
-
label:
|
|
1109
|
-
value:
|
|
1104
|
+
const f = n.items[c];
|
|
1105
|
+
f && n.command({
|
|
1106
|
+
id: f.id,
|
|
1107
|
+
label: f.label,
|
|
1108
|
+
value: f.value
|
|
1110
1109
|
});
|
|
1111
1110
|
}
|
|
1112
1111
|
function a(c) {
|
|
@@ -1114,28 +1113,28 @@ const xe = {
|
|
|
1114
1113
|
}
|
|
1115
1114
|
return t({
|
|
1116
1115
|
onKeyDown: s
|
|
1117
|
-
}), (c,
|
|
1116
|
+
}), (c, f) => (M(), O("div", {
|
|
1118
1117
|
ref_key: "listRef",
|
|
1119
1118
|
ref: i,
|
|
1120
1119
|
class: "mention-list"
|
|
1121
1120
|
}, [
|
|
1122
|
-
(M(!0), O(
|
|
1121
|
+
(M(!0), O(ke, null, Be(e.items, (u, T) => (M(), O("button", {
|
|
1123
1122
|
key: u.id,
|
|
1124
1123
|
type: "button",
|
|
1125
|
-
class:
|
|
1126
|
-
onMousedown:
|
|
1127
|
-
onMouseenter: (y) => a(
|
|
1124
|
+
class: Q(["mention-item", { "is-selected": T === o.value }]),
|
|
1125
|
+
onMousedown: Ze((y) => r(T), ["prevent"]),
|
|
1126
|
+
onMouseenter: (y) => a(T)
|
|
1128
1127
|
}, [
|
|
1129
|
-
u.icon ? (M(), O("span",
|
|
1130
|
-
B("span",
|
|
1131
|
-
], 42,
|
|
1132
|
-
e.items.length === 0 ? (M(), O("div",
|
|
1128
|
+
u.icon ? (M(), O("span", io, pe(u.icon), 1)) : K("", !0),
|
|
1129
|
+
B("span", lo, pe(u.label), 1)
|
|
1130
|
+
], 42, ro))), 128)),
|
|
1131
|
+
e.items.length === 0 ? (M(), O("div", ao, [...f[0] || (f[0] = [
|
|
1133
1132
|
B("span", null, "未找到匹配的提及项", -1)
|
|
1134
1133
|
])])) : K("", !0)
|
|
1135
1134
|
], 512));
|
|
1136
1135
|
}
|
|
1137
|
-
}),
|
|
1138
|
-
function
|
|
1136
|
+
}), uo = /* @__PURE__ */ j(co, [["__scopeId", "data-v-aaa34d1a"]]), de = new re(le.MENTION);
|
|
1137
|
+
function fo(e, t) {
|
|
1139
1138
|
if (!t)
|
|
1140
1139
|
return e;
|
|
1141
1140
|
const n = t.toLowerCase();
|
|
@@ -1144,11 +1143,11 @@ function yo(e, t) {
|
|
|
1144
1143
|
return !!(o.label.toLowerCase().includes(n) || (i = o.value) != null && i.toLowerCase().includes(n));
|
|
1145
1144
|
});
|
|
1146
1145
|
}
|
|
1147
|
-
function
|
|
1146
|
+
function po(e) {
|
|
1148
1147
|
const { editor: t, char: n, items: o, allowSpaces: i } = e;
|
|
1149
1148
|
let s = null, l = null, r = null;
|
|
1150
1149
|
return new ie({
|
|
1151
|
-
key:
|
|
1150
|
+
key: de,
|
|
1152
1151
|
state: {
|
|
1153
1152
|
init() {
|
|
1154
1153
|
return {
|
|
@@ -1159,8 +1158,8 @@ function xo(e) {
|
|
|
1159
1158
|
};
|
|
1160
1159
|
},
|
|
1161
1160
|
apply(a, c) {
|
|
1162
|
-
const
|
|
1163
|
-
if (
|
|
1161
|
+
const f = a.getMeta(de);
|
|
1162
|
+
if (f && f.type === "close")
|
|
1164
1163
|
return {
|
|
1165
1164
|
active: !1,
|
|
1166
1165
|
range: null,
|
|
@@ -1169,7 +1168,7 @@ function xo(e) {
|
|
|
1169
1168
|
};
|
|
1170
1169
|
if (!a.docChanged && !a.selectionSet)
|
|
1171
1170
|
return c;
|
|
1172
|
-
const u =
|
|
1171
|
+
const u = so(a.selection, n, i);
|
|
1173
1172
|
if (!u)
|
|
1174
1173
|
return {
|
|
1175
1174
|
active: !1,
|
|
@@ -1177,7 +1176,7 @@ function xo(e) {
|
|
|
1177
1176
|
query: "",
|
|
1178
1177
|
filteredItems: []
|
|
1179
1178
|
};
|
|
1180
|
-
const
|
|
1179
|
+
const T = Le(o) ? o.value : o, y = fo(T, u.query);
|
|
1181
1180
|
return {
|
|
1182
1181
|
active: y.length > 0,
|
|
1183
1182
|
range: u.range,
|
|
@@ -1191,71 +1190,71 @@ function xo(e) {
|
|
|
1191
1190
|
decorations(a) {
|
|
1192
1191
|
const c = this.getState(a);
|
|
1193
1192
|
if (!(c != null && c.active) || !c.range)
|
|
1194
|
-
return
|
|
1195
|
-
const
|
|
1193
|
+
return _e.empty;
|
|
1194
|
+
const f = Lt.inline(c.range.from, c.range.to, {
|
|
1196
1195
|
class: "mention-trigger"
|
|
1197
1196
|
});
|
|
1198
|
-
return
|
|
1197
|
+
return _e.create(a.doc, [f]);
|
|
1199
1198
|
},
|
|
1200
1199
|
// 键盘处理
|
|
1201
1200
|
handleKeyDown(a, c) {
|
|
1202
|
-
var u,
|
|
1203
|
-
const
|
|
1201
|
+
var u, T, y, w;
|
|
1202
|
+
const f = de.getState(a.state);
|
|
1204
1203
|
if (D(c, "BACKSPACE")) {
|
|
1205
|
-
const { selection: b } = a.state, { $from:
|
|
1206
|
-
if (
|
|
1204
|
+
const { selection: b } = a.state, { $from: v } = b;
|
|
1205
|
+
if (v.nodeBefore && v.nodeBefore.type.name === S.MENTION) {
|
|
1207
1206
|
c.preventDefault();
|
|
1208
|
-
const { tr: h } = a.state, x =
|
|
1209
|
-
return h.delete(x,
|
|
1207
|
+
const { tr: h } = a.state, x = v.pos - v.nodeBefore.nodeSize;
|
|
1208
|
+
return h.delete(x, v.pos), h.insertText(n, x), h.setSelection(R.create(h.doc, x + 1)), a.dispatch(h), a.focus(), !0;
|
|
1210
1209
|
}
|
|
1211
1210
|
}
|
|
1212
|
-
if (!(
|
|
1211
|
+
if (!(f != null && f.active))
|
|
1213
1212
|
return !1;
|
|
1214
1213
|
if (D(c, "ESCAPE")) {
|
|
1215
1214
|
c.preventDefault();
|
|
1216
1215
|
const b = a.state.tr;
|
|
1217
|
-
return b.setMeta(
|
|
1216
|
+
return b.setMeta(de, {
|
|
1218
1217
|
type: "close"
|
|
1219
1218
|
}), a.dispatch(b), s && (r == null || r(), r = null, s.destroy(), s = null), l && (l.remove(), l = null), !0;
|
|
1220
1219
|
}
|
|
1221
|
-
if (
|
|
1222
|
-
if (c.preventDefault(), (
|
|
1220
|
+
if (be(c, ["ENTER", "TAB"])) {
|
|
1221
|
+
if (c.preventDefault(), (T = (u = s == null ? void 0 : s.ref) == null ? void 0 : u.onKeyDown) == null ? void 0 : T.call(u, { event: c }))
|
|
1223
1222
|
return !0;
|
|
1224
|
-
if (
|
|
1225
|
-
const
|
|
1226
|
-
return
|
|
1223
|
+
if (f.filteredItems.length > 0 && f.range) {
|
|
1224
|
+
const v = f.filteredItems[0];
|
|
1225
|
+
return At(a, f.range, v), !0;
|
|
1227
1226
|
}
|
|
1228
1227
|
return !0;
|
|
1229
1228
|
}
|
|
1230
|
-
return
|
|
1229
|
+
return be(c, ["ARROW_UP", "ARROW_DOWN"]) && ((w = (y = s == null ? void 0 : s.ref) == null ? void 0 : y.onKeyDown) == null ? void 0 : w.call(y, { event: c })) || !1;
|
|
1231
1230
|
}
|
|
1232
1231
|
},
|
|
1233
1232
|
view() {
|
|
1234
1233
|
return {
|
|
1235
1234
|
update(a) {
|
|
1236
|
-
const c =
|
|
1235
|
+
const c = de.getState(a.state);
|
|
1237
1236
|
if (c != null && c.active && c.filteredItems.length > 0) {
|
|
1238
1237
|
s ? s.updateProps({
|
|
1239
1238
|
items: c.filteredItems
|
|
1240
|
-
}) : (s = new
|
|
1239
|
+
}) : (s = new _t(uo, {
|
|
1241
1240
|
props: {
|
|
1242
1241
|
items: c.filteredItems,
|
|
1243
1242
|
command: (u) => {
|
|
1244
|
-
const
|
|
1243
|
+
const T = {
|
|
1245
1244
|
id: u.id,
|
|
1246
1245
|
label: u.label,
|
|
1247
1246
|
value: u.value || ""
|
|
1248
1247
|
};
|
|
1249
|
-
c.range &&
|
|
1248
|
+
c.range && At(a, c.range, T);
|
|
1250
1249
|
}
|
|
1251
1250
|
},
|
|
1252
1251
|
editor: t
|
|
1253
1252
|
}), l = s.element, l.style.position = "absolute", l.style.zIndex = "1000", document.body.appendChild(l));
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1256
|
-
|
|
1253
|
+
const f = a.dom.querySelector(".mention-trigger");
|
|
1254
|
+
f && l && (r == null || r(), r = lt(f, l, () => {
|
|
1255
|
+
dt(f, l, {
|
|
1257
1256
|
placement: "bottom-start",
|
|
1258
|
-
middleware: [
|
|
1257
|
+
middleware: [at(8), ut(), ct({ padding: 8 })]
|
|
1259
1258
|
}).then((u) => {
|
|
1260
1259
|
l && Object.assign(l.style, {
|
|
1261
1260
|
left: `${u.x}px`,
|
|
@@ -1273,7 +1272,7 @@ function xo(e) {
|
|
|
1273
1272
|
}
|
|
1274
1273
|
});
|
|
1275
1274
|
}
|
|
1276
|
-
function
|
|
1275
|
+
function At(e, t, n) {
|
|
1277
1276
|
e.focus();
|
|
1278
1277
|
const { state: o, dispatch: i } = e, { tr: s } = o, l = o.schema.nodes.mention.create({
|
|
1279
1278
|
id: n.id || ve("mention"),
|
|
@@ -1282,9 +1281,9 @@ function wt(e, t, n) {
|
|
|
1282
1281
|
}), r = o.schema.text(" ");
|
|
1283
1282
|
s.delete(t.from, t.to), s.insert(t.from, [l, r]);
|
|
1284
1283
|
const a = t.from + 2;
|
|
1285
|
-
s.setSelection(
|
|
1284
|
+
s.setSelection(R.create(s.doc, a)), s.scrollIntoView(), i(s);
|
|
1286
1285
|
}
|
|
1287
|
-
const
|
|
1286
|
+
const mo = {
|
|
1288
1287
|
/**
|
|
1289
1288
|
* 插入 mention 节点
|
|
1290
1289
|
*/
|
|
@@ -1306,8 +1305,8 @@ const vo = {
|
|
|
1306
1305
|
return t.delete(s, s + i.nodeSize), o = !0, !1;
|
|
1307
1306
|
}), o;
|
|
1308
1307
|
}
|
|
1309
|
-
},
|
|
1310
|
-
name:
|
|
1308
|
+
}, Ft = nt.create({
|
|
1309
|
+
name: Te.MENTION,
|
|
1311
1310
|
// 节点配置
|
|
1312
1311
|
group: "inline",
|
|
1313
1312
|
inline: !0,
|
|
@@ -1353,7 +1352,7 @@ const vo = {
|
|
|
1353
1352
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
1354
1353
|
return [
|
|
1355
1354
|
"span",
|
|
1356
|
-
|
|
1355
|
+
ot(this.options.HTMLAttributes || {}, t, {
|
|
1357
1356
|
"data-mention": "",
|
|
1358
1357
|
"data-id": e.attrs.id,
|
|
1359
1358
|
"data-label": e.attrs.label,
|
|
@@ -1364,7 +1363,7 @@ const vo = {
|
|
|
1364
1363
|
},
|
|
1365
1364
|
// 使用 Vue 组件渲染
|
|
1366
1365
|
addNodeView() {
|
|
1367
|
-
return
|
|
1366
|
+
return tt(En);
|
|
1368
1367
|
},
|
|
1369
1368
|
// 添加 storage 用于存储实例状态
|
|
1370
1369
|
addStorage() {
|
|
@@ -1374,11 +1373,11 @@ const vo = {
|
|
|
1374
1373
|
},
|
|
1375
1374
|
onCreate() {
|
|
1376
1375
|
const { items: e } = this.options;
|
|
1377
|
-
|
|
1376
|
+
Le(e) && (this.storage.watchStopHandle = N(
|
|
1378
1377
|
e,
|
|
1379
1378
|
() => {
|
|
1380
1379
|
const t = this.editor.state.tr;
|
|
1381
|
-
t.setMeta(
|
|
1380
|
+
t.setMeta(de, { type: "mention-update" }), this.editor.view.dispatch(t);
|
|
1382
1381
|
},
|
|
1383
1382
|
{ deep: !0 }
|
|
1384
1383
|
));
|
|
@@ -1389,7 +1388,7 @@ const vo = {
|
|
|
1389
1388
|
// 添加 Suggestion 插件
|
|
1390
1389
|
addProseMirrorPlugins() {
|
|
1391
1390
|
return [
|
|
1392
|
-
|
|
1391
|
+
po({
|
|
1393
1392
|
editor: this.editor,
|
|
1394
1393
|
char: this.options.char,
|
|
1395
1394
|
items: this.options.items,
|
|
@@ -1406,18 +1405,18 @@ const vo = {
|
|
|
1406
1405
|
},
|
|
1407
1406
|
// 自定义命令
|
|
1408
1407
|
addCommands() {
|
|
1409
|
-
return
|
|
1408
|
+
return mo;
|
|
1410
1409
|
}
|
|
1411
1410
|
});
|
|
1412
|
-
function
|
|
1411
|
+
function ho(e) {
|
|
1413
1412
|
var i;
|
|
1414
|
-
const t = e.extensionManager.extensions.find((s) => s.name ===
|
|
1413
|
+
const t = e.extensionManager.extensions.find((s) => s.name === Te.MENTION), n = ((i = t == null ? void 0 : t.options) == null ? void 0 : i.char) || "@";
|
|
1415
1414
|
let o = "";
|
|
1416
1415
|
return e.state.doc.descendants((s) => {
|
|
1417
1416
|
s.type.name === S.MENTION ? o += `${n}${s.attrs.label}` : s.type.name === S.TEXT && (o += s.text || "");
|
|
1418
1417
|
}), o.trim();
|
|
1419
1418
|
}
|
|
1420
|
-
function
|
|
1419
|
+
function go(e) {
|
|
1421
1420
|
const t = [];
|
|
1422
1421
|
return e.state.doc.descendants((n, o, i) => {
|
|
1423
1422
|
if (i && i.type.name === S.PARAGRAPH) {
|
|
@@ -1440,14 +1439,14 @@ function Eo(e) {
|
|
|
1440
1439
|
}
|
|
1441
1440
|
}), t;
|
|
1442
1441
|
}
|
|
1443
|
-
function
|
|
1444
|
-
return
|
|
1442
|
+
function yo(e, t = "@", n) {
|
|
1443
|
+
return Ft.configure({
|
|
1445
1444
|
items: e,
|
|
1446
1445
|
char: t,
|
|
1447
1446
|
...n
|
|
1448
1447
|
});
|
|
1449
1448
|
}
|
|
1450
|
-
const
|
|
1449
|
+
const Vt = (e, t) => {
|
|
1451
1450
|
if (!t.length)
|
|
1452
1451
|
return [{ text: e, isMatch: !1 }];
|
|
1453
1452
|
const n = [];
|
|
@@ -1456,12 +1455,12 @@ const Ht = (e, t) => {
|
|
|
1456
1455
|
let r = 0;
|
|
1457
1456
|
const a = e.toLowerCase(), c = l.toLowerCase();
|
|
1458
1457
|
for (; ; ) {
|
|
1459
|
-
const
|
|
1460
|
-
if (
|
|
1458
|
+
const f = a.indexOf(c, r);
|
|
1459
|
+
if (f === -1) break;
|
|
1461
1460
|
n.push({
|
|
1462
|
-
start:
|
|
1463
|
-
end:
|
|
1464
|
-
}), r =
|
|
1461
|
+
start: f,
|
|
1462
|
+
end: f + l.length
|
|
1463
|
+
}), r = f + 1;
|
|
1465
1464
|
}
|
|
1466
1465
|
}
|
|
1467
1466
|
if (n.length === 0)
|
|
@@ -1489,10 +1488,10 @@ const Ht = (e, t) => {
|
|
|
1489
1488
|
text: e.substring(s),
|
|
1490
1489
|
isMatch: !1
|
|
1491
1490
|
}), i;
|
|
1492
|
-
},
|
|
1491
|
+
}, xo = (e, t) => !t || !e ? [{ text: e, isMatch: !1 }] : Vt(e, [t]), To = (e, t) => {
|
|
1493
1492
|
const { content: n, highlights: o } = e;
|
|
1494
|
-
return typeof o == "function" ? o(n, t) : Array.isArray(o) ?
|
|
1495
|
-
},
|
|
1493
|
+
return typeof o == "function" ? o(n, t) : Array.isArray(o) ? Vt(n, o) : xo(n, t);
|
|
1494
|
+
}, vo = ["onMouseenter", "onClick"], Eo = { class: "suggestion-list__text" }, wo = /* @__PURE__ */ Y({
|
|
1496
1495
|
__name: "suggestion-list",
|
|
1497
1496
|
props: {
|
|
1498
1497
|
show: { type: Boolean },
|
|
@@ -1515,7 +1514,7 @@ const Ht = (e, t) => {
|
|
|
1515
1514
|
}, l = (r) => {
|
|
1516
1515
|
var c;
|
|
1517
1516
|
const a = t.suggestions[r];
|
|
1518
|
-
a && ((c = t.onSelect) == null || c.call(t,
|
|
1517
|
+
a && ((c = t.onSelect) == null || c.call(t, Jt(a)));
|
|
1519
1518
|
};
|
|
1520
1519
|
return N(
|
|
1521
1520
|
() => t.activeKeyboardIndex,
|
|
@@ -1525,39 +1524,39 @@ const Ht = (e, t) => {
|
|
|
1525
1524
|
a && a.scrollIntoView({ block: "nearest" });
|
|
1526
1525
|
}
|
|
1527
1526
|
}
|
|
1528
|
-
), (r, a) => (M(), G(
|
|
1527
|
+
), (r, a) => (M(), G(jt, { name: "suggestion-slide-up" }, {
|
|
1529
1528
|
default: $(() => [
|
|
1530
1529
|
t.show && t.suggestions.length ? (M(), O("div", {
|
|
1531
1530
|
key: 0,
|
|
1532
1531
|
ref_key: "suggestionsListRef",
|
|
1533
1532
|
ref: n,
|
|
1534
1533
|
class: "suggestion-list",
|
|
1535
|
-
style:
|
|
1534
|
+
style: Zt(t.popupStyle)
|
|
1536
1535
|
}, [
|
|
1537
|
-
(M(!0), O(
|
|
1538
|
-
key:
|
|
1539
|
-
class:
|
|
1540
|
-
onMouseenter: (u) => i(
|
|
1536
|
+
(M(!0), O(ke, null, Be(t.suggestions, (c, f) => (M(), O("div", {
|
|
1537
|
+
key: f,
|
|
1538
|
+
class: Q(["suggestion-list__item", { highlighted: o(f) }]),
|
|
1539
|
+
onMouseenter: (u) => i(f),
|
|
1541
1540
|
onMouseleave: s,
|
|
1542
|
-
onClick: (u) => l(
|
|
1541
|
+
onClick: (u) => l(f)
|
|
1543
1542
|
}, [
|
|
1544
|
-
oe(L(
|
|
1545
|
-
B("span",
|
|
1546
|
-
(M(!0), O(
|
|
1547
|
-
key:
|
|
1548
|
-
class:
|
|
1543
|
+
oe(L(xn), { class: "suggestion-list__icon" }),
|
|
1544
|
+
B("span", Eo, [
|
|
1545
|
+
(M(!0), O(ke, null, Be(L(To)(c, t.inputValue), (u, T) => (M(), O("span", {
|
|
1546
|
+
key: T,
|
|
1547
|
+
class: Q({
|
|
1549
1548
|
"suggestion-list__text--match": u.isMatch,
|
|
1550
1549
|
"suggestion-list__text--normal": !u.isMatch
|
|
1551
1550
|
})
|
|
1552
|
-
},
|
|
1551
|
+
}, pe(u.text), 3))), 128))
|
|
1553
1552
|
])
|
|
1554
|
-
], 42,
|
|
1553
|
+
], 42, vo))), 128))
|
|
1555
1554
|
], 4)) : K("", !0)
|
|
1556
1555
|
]),
|
|
1557
1556
|
_: 1
|
|
1558
1557
|
}));
|
|
1559
1558
|
}
|
|
1560
|
-
}),
|
|
1559
|
+
}), bo = /* @__PURE__ */ j(wo, [["__scopeId", "data-v-76a6f35e"]]), Ao = (e, t) => {
|
|
1561
1560
|
if (!e || !t)
|
|
1562
1561
|
return { text: "", show: !1, showTab: !1 };
|
|
1563
1562
|
const n = e.toLowerCase(), o = t.toLowerCase();
|
|
@@ -1570,7 +1569,7 @@ const Ht = (e, t) => {
|
|
|
1570
1569
|
showTab: s
|
|
1571
1570
|
};
|
|
1572
1571
|
}, F = new re(le.SUGGESTION);
|
|
1573
|
-
function
|
|
1572
|
+
function So(e) {
|
|
1574
1573
|
const {
|
|
1575
1574
|
editor: t,
|
|
1576
1575
|
activeSuggestionKeys: n = ["Enter"],
|
|
@@ -1579,39 +1578,39 @@ function Oo(e) {
|
|
|
1579
1578
|
filterFn: s,
|
|
1580
1579
|
onSelect: l
|
|
1581
1580
|
} = e;
|
|
1582
|
-
let r = null, a = null, c = null,
|
|
1581
|
+
let r = null, a = null, c = null, f = !1;
|
|
1583
1582
|
function u() {
|
|
1584
|
-
const
|
|
1585
|
-
(g) => g.name ===
|
|
1586
|
-
), d =
|
|
1583
|
+
const p = t.extensionManager.extensions.find(
|
|
1584
|
+
(g) => g.name === Te.SUGGESTION
|
|
1585
|
+
), d = p == null ? void 0 : p.options, m = (d == null ? void 0 : d.items) || (d == null ? void 0 : d.suggestions) || [];
|
|
1587
1586
|
return m && typeof m == "object" && "value" in m ? m.value : m;
|
|
1588
1587
|
}
|
|
1589
|
-
function
|
|
1588
|
+
function T(p) {
|
|
1590
1589
|
const d = u();
|
|
1591
|
-
return s ? s(d,
|
|
1590
|
+
return s ? s(d, p) : d;
|
|
1592
1591
|
}
|
|
1593
|
-
function y(
|
|
1594
|
-
return
|
|
1592
|
+
function y(p) {
|
|
1593
|
+
return p;
|
|
1595
1594
|
}
|
|
1596
|
-
function w(
|
|
1597
|
-
if (
|
|
1595
|
+
function w(p, d, m) {
|
|
1596
|
+
if (p === -1 || !m[p])
|
|
1598
1597
|
return { text: "", show: !1, showTab: !1 };
|
|
1599
|
-
const g = m[
|
|
1600
|
-
return
|
|
1598
|
+
const g = m[p];
|
|
1599
|
+
return Ao(g.content, d);
|
|
1601
1600
|
}
|
|
1602
|
-
function b(
|
|
1601
|
+
function b(p, d, m) {
|
|
1603
1602
|
if (!d) return;
|
|
1604
1603
|
(l == null ? void 0 : l(m)) !== !1 && t.commands.setContent(m.content), t.commands.focus();
|
|
1605
1604
|
}
|
|
1606
|
-
function
|
|
1605
|
+
function v(p, d) {
|
|
1607
1606
|
const m = d.filteredSuggestions[d.selectedIndex];
|
|
1608
|
-
m && b(
|
|
1609
|
-
const g =
|
|
1610
|
-
g.setMeta(F, { type: "close" }),
|
|
1607
|
+
m && b(p, d.range, m);
|
|
1608
|
+
const g = p.state.tr;
|
|
1609
|
+
g.setMeta(F, { type: "close" }), p.dispatch(g);
|
|
1611
1610
|
}
|
|
1612
|
-
function h(
|
|
1611
|
+
function h(p, d) {
|
|
1613
1612
|
c == null || c();
|
|
1614
|
-
const g =
|
|
1613
|
+
const g = p.dom.closest(".tr-sender") || p.dom, E = () => {
|
|
1615
1614
|
if (typeof o == "number")
|
|
1616
1615
|
return `${o}px`;
|
|
1617
1616
|
if (typeof o == "string") {
|
|
@@ -1623,36 +1622,36 @@ function Oo(e) {
|
|
|
1623
1622
|
}
|
|
1624
1623
|
return "400px";
|
|
1625
1624
|
};
|
|
1626
|
-
c =
|
|
1627
|
-
|
|
1625
|
+
c = lt(g, d, () => {
|
|
1626
|
+
dt(g, d, {
|
|
1628
1627
|
placement: "top-start",
|
|
1629
1628
|
middleware: [
|
|
1630
|
-
|
|
1631
|
-
|
|
1629
|
+
at(8),
|
|
1630
|
+
ut({
|
|
1632
1631
|
fallbackPlacements: ["bottom-start", "top-start"]
|
|
1633
1632
|
}),
|
|
1634
|
-
|
|
1633
|
+
ct({ padding: 8 })
|
|
1635
1634
|
]
|
|
1636
1635
|
}).then(({ x: _, y: C }) => {
|
|
1637
1636
|
d.style.position = "absolute", d.style.left = `${_}px`, d.style.top = `${C}px`, d.style.zIndex = "2000", d.style.width = E();
|
|
1638
1637
|
});
|
|
1639
1638
|
});
|
|
1640
1639
|
}
|
|
1641
|
-
function x(
|
|
1642
|
-
if (!i || !
|
|
1643
|
-
return
|
|
1640
|
+
function x(p) {
|
|
1641
|
+
if (!i || !p.active || !p.autoCompleteText || !p.range)
|
|
1642
|
+
return _e.empty;
|
|
1644
1643
|
const d = t.state.doc, { selection: m } = t.state, g = m.$head.pos;
|
|
1645
1644
|
if (!(g >= d.content.size - 1))
|
|
1646
|
-
return
|
|
1647
|
-
const _ =
|
|
1645
|
+
return _e.empty;
|
|
1646
|
+
const _ = Lt.widget(
|
|
1648
1647
|
g,
|
|
1649
1648
|
() => {
|
|
1650
1649
|
const C = document.createElement("span");
|
|
1651
1650
|
C.className = "suggestion-autocomplete", C.contentEditable = "false";
|
|
1652
1651
|
const I = document.createElement("span");
|
|
1653
|
-
if (I.className = "autocomplete-text", I.textContent =
|
|
1654
|
-
const
|
|
1655
|
-
|
|
1652
|
+
if (I.className = "autocomplete-text", I.textContent = p.autoCompleteText, C.appendChild(I), p.showTabIndicator) {
|
|
1653
|
+
const J = document.createElement("span");
|
|
1654
|
+
J.className = "tab-hint", J.textContent = "TAB", C.appendChild(J);
|
|
1656
1655
|
}
|
|
1657
1656
|
return C;
|
|
1658
1657
|
},
|
|
@@ -1661,7 +1660,7 @@ function Oo(e) {
|
|
|
1661
1660
|
// 显示在光标右侧
|
|
1662
1661
|
}
|
|
1663
1662
|
);
|
|
1664
|
-
return
|
|
1663
|
+
return _e.create(d, [_]);
|
|
1665
1664
|
}
|
|
1666
1665
|
return new ie({
|
|
1667
1666
|
key: F,
|
|
@@ -1677,12 +1676,12 @@ function Oo(e) {
|
|
|
1677
1676
|
showTabIndicator: !1
|
|
1678
1677
|
};
|
|
1679
1678
|
},
|
|
1680
|
-
apply(
|
|
1681
|
-
const m =
|
|
1679
|
+
apply(p, d) {
|
|
1680
|
+
const m = p.getMeta(F);
|
|
1682
1681
|
if (m) {
|
|
1683
1682
|
if (m.type === "close")
|
|
1684
|
-
return
|
|
1685
|
-
|
|
1683
|
+
return f = !0, setTimeout(() => {
|
|
1684
|
+
f = !1;
|
|
1686
1685
|
}, 0), {
|
|
1687
1686
|
active: !1,
|
|
1688
1687
|
range: null,
|
|
@@ -1693,17 +1692,17 @@ function Oo(e) {
|
|
|
1693
1692
|
showTabIndicator: !1
|
|
1694
1693
|
};
|
|
1695
1694
|
if (m.type === "updateIndex") {
|
|
1696
|
-
const I = { ...d, selectedIndex: m.index },
|
|
1695
|
+
const I = { ...d, selectedIndex: m.index }, J = w(m.index, d.query, d.filteredSuggestions);
|
|
1697
1696
|
return {
|
|
1698
1697
|
...I,
|
|
1699
|
-
autoCompleteText:
|
|
1700
|
-
showTabIndicator:
|
|
1698
|
+
autoCompleteText: J.text,
|
|
1699
|
+
showTabIndicator: J.showTab
|
|
1701
1700
|
};
|
|
1702
1701
|
}
|
|
1703
1702
|
}
|
|
1704
|
-
if (
|
|
1703
|
+
if (f || !p.docChanged && !p.selectionSet)
|
|
1705
1704
|
return d;
|
|
1706
|
-
const g =
|
|
1705
|
+
const g = p.doc.textContent.trim(), E = g;
|
|
1707
1706
|
if (!g)
|
|
1708
1707
|
return {
|
|
1709
1708
|
active: !1,
|
|
@@ -1714,7 +1713,7 @@ function Oo(e) {
|
|
|
1714
1713
|
autoCompleteText: "",
|
|
1715
1714
|
showTabIndicator: !1
|
|
1716
1715
|
};
|
|
1717
|
-
const _ =
|
|
1716
|
+
const _ = T(E);
|
|
1718
1717
|
if (_.length === 0)
|
|
1719
1718
|
return {
|
|
1720
1719
|
active: !1,
|
|
@@ -1728,7 +1727,7 @@ function Oo(e) {
|
|
|
1728
1727
|
const C = w(0, E, _);
|
|
1729
1728
|
return {
|
|
1730
1729
|
active: !0,
|
|
1731
|
-
range: { from: 0, to:
|
|
1730
|
+
range: { from: 0, to: p.doc.content.size },
|
|
1732
1731
|
query: E,
|
|
1733
1732
|
filteredSuggestions: _,
|
|
1734
1733
|
selectedIndex: 0,
|
|
@@ -1738,8 +1737,8 @@ function Oo(e) {
|
|
|
1738
1737
|
}
|
|
1739
1738
|
},
|
|
1740
1739
|
props: {
|
|
1741
|
-
decorations(
|
|
1742
|
-
const d = this.getState(
|
|
1740
|
+
decorations(p) {
|
|
1741
|
+
const d = this.getState(p);
|
|
1743
1742
|
return x(
|
|
1744
1743
|
d || {
|
|
1745
1744
|
active: !1,
|
|
@@ -1749,37 +1748,37 @@ function Oo(e) {
|
|
|
1749
1748
|
}
|
|
1750
1749
|
);
|
|
1751
1750
|
},
|
|
1752
|
-
handleKeyDown(
|
|
1753
|
-
const m = F.getState(
|
|
1751
|
+
handleKeyDown(p, d) {
|
|
1752
|
+
const m = F.getState(p.state);
|
|
1754
1753
|
if (!(m != null && m.active))
|
|
1755
1754
|
return !1;
|
|
1756
1755
|
if (D(d, "TAB") && m.autoCompleteText)
|
|
1757
|
-
return d.preventDefault(),
|
|
1758
|
-
if (
|
|
1756
|
+
return d.preventDefault(), v(p, m), !0;
|
|
1757
|
+
if (be(d, ["ARROW_UP", "ARROW_DOWN"])) {
|
|
1759
1758
|
d.preventDefault();
|
|
1760
1759
|
const g = D(d, "ARROW_DOWN") ? 1 : -1, E = m.filteredSuggestions.length;
|
|
1761
1760
|
let _ = m.selectedIndex + g;
|
|
1762
1761
|
_ < 0 ? _ = E - 1 : _ >= E && (_ = 0);
|
|
1763
|
-
const C =
|
|
1762
|
+
const C = p.state.tr;
|
|
1764
1763
|
return C.setMeta(F, {
|
|
1765
1764
|
type: "updateIndex",
|
|
1766
1765
|
index: _
|
|
1767
|
-
}),
|
|
1766
|
+
}), p.dispatch(C), !0;
|
|
1768
1767
|
}
|
|
1769
1768
|
if (n.includes(d.key))
|
|
1770
|
-
return d.preventDefault(),
|
|
1769
|
+
return d.preventDefault(), v(p, m), !0;
|
|
1771
1770
|
if (D(d, "ESCAPE")) {
|
|
1772
1771
|
d.preventDefault();
|
|
1773
|
-
const g =
|
|
1774
|
-
return g.setMeta(F, { type: "close" }),
|
|
1772
|
+
const g = p.state.tr;
|
|
1773
|
+
return g.setMeta(F, { type: "close" }), p.dispatch(g), !0;
|
|
1775
1774
|
}
|
|
1776
1775
|
return !1;
|
|
1777
1776
|
}
|
|
1778
1777
|
},
|
|
1779
1778
|
view() {
|
|
1780
1779
|
return {
|
|
1781
|
-
update(
|
|
1782
|
-
const d = F.getState(
|
|
1780
|
+
update(p) {
|
|
1781
|
+
const d = F.getState(p.state);
|
|
1783
1782
|
d != null && d.active && d.filteredSuggestions.length > 0 ? (r ? r.updateProps({
|
|
1784
1783
|
show: d.active && d.filteredSuggestions.length > 0,
|
|
1785
1784
|
suggestions: d.filteredSuggestions,
|
|
@@ -1789,7 +1788,7 @@ function Oo(e) {
|
|
|
1789
1788
|
},
|
|
1790
1789
|
activeKeyboardIndex: d.selectedIndex,
|
|
1791
1790
|
inputValue: d.query
|
|
1792
|
-
}) : (r = new
|
|
1791
|
+
}) : (r = new _t(bo, {
|
|
1793
1792
|
props: {
|
|
1794
1793
|
show: d.active && d.filteredSuggestions.length > 0,
|
|
1795
1794
|
suggestions: d.filteredSuggestions,
|
|
@@ -1801,17 +1800,17 @@ function Oo(e) {
|
|
|
1801
1800
|
activeMouseIndex: -1,
|
|
1802
1801
|
inputValue: d.query,
|
|
1803
1802
|
onSelect: (m) => {
|
|
1804
|
-
b(
|
|
1805
|
-
const g =
|
|
1806
|
-
g.setMeta(F, { type: "close" }),
|
|
1803
|
+
b(p, d.range, m);
|
|
1804
|
+
const g = p.state.tr;
|
|
1805
|
+
g.setMeta(F, { type: "close" }), p.dispatch(g);
|
|
1807
1806
|
},
|
|
1808
1807
|
onMouseEnter: (m) => {
|
|
1809
|
-
const g =
|
|
1810
|
-
g.setMeta(F, { type: "updateIndex", index: m }),
|
|
1808
|
+
const g = p.state.tr;
|
|
1809
|
+
g.setMeta(F, { type: "updateIndex", index: m }), p.dispatch(g);
|
|
1811
1810
|
}
|
|
1812
1811
|
},
|
|
1813
1812
|
editor: t
|
|
1814
|
-
}), a = r.element, document.body.appendChild(a)), a && h(
|
|
1813
|
+
}), a = r.element, document.body.appendChild(a)), a && h(p, a)) : (r && (c == null || c(), c = null, r.destroy(), r = null), a && (a.remove(), a = null));
|
|
1815
1814
|
},
|
|
1816
1815
|
destroy() {
|
|
1817
1816
|
c == null || c(), r == null || r.destroy(), a == null || a.remove();
|
|
@@ -1820,8 +1819,8 @@ function Oo(e) {
|
|
|
1820
1819
|
}
|
|
1821
1820
|
});
|
|
1822
1821
|
}
|
|
1823
|
-
const
|
|
1824
|
-
name:
|
|
1822
|
+
const zt = Mt.create({
|
|
1823
|
+
name: Te.SUGGESTION,
|
|
1825
1824
|
addOptions() {
|
|
1826
1825
|
return {
|
|
1827
1826
|
items: [],
|
|
@@ -1837,7 +1836,7 @@ const Ft = _t.create({
|
|
|
1837
1836
|
};
|
|
1838
1837
|
},
|
|
1839
1838
|
onCreate() {
|
|
1840
|
-
|
|
1839
|
+
Le(this.options.items) && (this.storage.watchStopHandle = N(
|
|
1841
1840
|
this.options.items,
|
|
1842
1841
|
() => {
|
|
1843
1842
|
const e = this.editor.state.tr;
|
|
@@ -1851,26 +1850,26 @@ const Ft = _t.create({
|
|
|
1851
1850
|
},
|
|
1852
1851
|
addProseMirrorPlugins() {
|
|
1853
1852
|
return [
|
|
1854
|
-
|
|
1853
|
+
So({
|
|
1855
1854
|
editor: this.editor,
|
|
1856
1855
|
...this.options
|
|
1857
1856
|
})
|
|
1858
1857
|
];
|
|
1859
1858
|
}
|
|
1860
1859
|
});
|
|
1861
|
-
function
|
|
1862
|
-
return
|
|
1860
|
+
function Co(e, t) {
|
|
1861
|
+
return zt.configure({
|
|
1863
1862
|
items: e,
|
|
1864
1863
|
...t
|
|
1865
1864
|
});
|
|
1866
1865
|
}
|
|
1867
|
-
function
|
|
1866
|
+
function _o(e) {
|
|
1868
1867
|
const t = [];
|
|
1869
1868
|
return e.state.doc.descendants((n, o) => {
|
|
1870
1869
|
n.type.name === S.TEMPLATE_BLOCK && t.push({ node: n, pos: o });
|
|
1871
1870
|
}), t;
|
|
1872
1871
|
}
|
|
1873
|
-
const
|
|
1872
|
+
const Lo = {
|
|
1874
1873
|
/**
|
|
1875
1874
|
* 设置模板数据(批量)
|
|
1876
1875
|
*/
|
|
@@ -1930,7 +1929,7 @@ const Do = {
|
|
|
1930
1929
|
* 聚焦到第一个模板块
|
|
1931
1930
|
*/
|
|
1932
1931
|
focusFirstTemplate: () => ({ editor: e }) => {
|
|
1933
|
-
const t =
|
|
1932
|
+
const t = _o(e);
|
|
1934
1933
|
return setTimeout(() => {
|
|
1935
1934
|
var s;
|
|
1936
1935
|
const { state: n, view: o } = e, i = n.tr;
|
|
@@ -1939,10 +1938,10 @@ const Do = {
|
|
|
1939
1938
|
if (t.length === 0)
|
|
1940
1939
|
l = n.doc.content.size - 1;
|
|
1941
1940
|
else {
|
|
1942
|
-
const { node: a, pos: c } = t[0],
|
|
1943
|
-
l = c + 1 +
|
|
1941
|
+
const { node: a, pos: c } = t[0], f = ((s = a.textContent) == null ? void 0 : s.length) || 0;
|
|
1942
|
+
l = c + 1 + f;
|
|
1944
1943
|
}
|
|
1945
|
-
const r =
|
|
1944
|
+
const r = R.create(n.doc, l);
|
|
1946
1945
|
i.setSelection(r), o.dispatch(i), o.focus();
|
|
1947
1946
|
} catch (l) {
|
|
1948
1947
|
console.error("[focusFirstTemplate] 设置光标失败", l);
|
|
@@ -1962,10 +1961,10 @@ const Do = {
|
|
|
1962
1961
|
}
|
|
1963
1962
|
})
|
|
1964
1963
|
}, A = "";
|
|
1965
|
-
function
|
|
1966
|
-
return
|
|
1964
|
+
function je(e) {
|
|
1965
|
+
return qt(e).map((n) => n.content).join("");
|
|
1967
1966
|
}
|
|
1968
|
-
function
|
|
1967
|
+
function qt(e) {
|
|
1969
1968
|
const t = [];
|
|
1970
1969
|
return e.state.doc.descendants((n, o, i) => {
|
|
1971
1970
|
if (i && i.type.name === S.PARAGRAPH) {
|
|
@@ -1994,7 +1993,7 @@ function Vt(e) {
|
|
|
1994
1993
|
}
|
|
1995
1994
|
}), t;
|
|
1996
1995
|
}
|
|
1997
|
-
const
|
|
1996
|
+
const Mo = /* @__PURE__ */ Y({
|
|
1998
1997
|
__name: "template-block-view",
|
|
1999
1998
|
props: {
|
|
2000
1999
|
node: {}
|
|
@@ -2004,9 +2003,9 @@ const ko = /* @__PURE__ */ j({
|
|
|
2004
2003
|
const o = t.node.textContent || "";
|
|
2005
2004
|
return o.length === 0 || o === A;
|
|
2006
2005
|
});
|
|
2007
|
-
return (o, i) => (M(), G(L(
|
|
2006
|
+
return (o, i) => (M(), G(L(et), {
|
|
2008
2007
|
as: "span",
|
|
2009
|
-
class:
|
|
2008
|
+
class: Q(["template-block", { "is-empty": n.value }]),
|
|
2010
2009
|
"data-id": e.node.attrs.id
|
|
2011
2010
|
}, {
|
|
2012
2011
|
default: $(() => [
|
|
@@ -2014,7 +2013,7 @@ const ko = /* @__PURE__ */ j({
|
|
|
2014
2013
|
contenteditable: "false",
|
|
2015
2014
|
class: "template-block__prefix"
|
|
2016
2015
|
}, " ", -1)),
|
|
2017
|
-
oe(L(
|
|
2016
|
+
oe(L(rn), {
|
|
2018
2017
|
as: "span",
|
|
2019
2018
|
class: "template-block__content"
|
|
2020
2019
|
}),
|
|
@@ -2026,8 +2025,8 @@ const ko = /* @__PURE__ */ j({
|
|
|
2026
2025
|
_: 1
|
|
2027
2026
|
}, 8, ["class", "data-id"]));
|
|
2028
2027
|
}
|
|
2029
|
-
}),
|
|
2030
|
-
function
|
|
2028
|
+
}), Oo = /* @__PURE__ */ j(Mo, [["__scopeId", "data-v-aa55b9db"]]);
|
|
2029
|
+
function Ro(e) {
|
|
2031
2030
|
const t = [];
|
|
2032
2031
|
let { tr: n } = e;
|
|
2033
2032
|
return e.doc.descendants((o, i, s) => {
|
|
@@ -2055,91 +2054,91 @@ function Io(e) {
|
|
|
2055
2054
|
Array.isArray(o) && o[0] === "remove" ? n = n.delete(o[1], o[1] + 1) : typeof o == "number" && (n = n.insertText(A, o, o));
|
|
2056
2055
|
}), n) : null;
|
|
2057
2056
|
}
|
|
2058
|
-
function
|
|
2057
|
+
function Po() {
|
|
2059
2058
|
return new ie({
|
|
2060
2059
|
key: new re(le.TEMPLATE_BLOCK_ZERO_WIDTH),
|
|
2061
2060
|
appendTransaction(e, t, n) {
|
|
2062
|
-
return e.some((i) => i.docChanged) ?
|
|
2061
|
+
return e.some((i) => i.docChanged) ? Ro(n) : null;
|
|
2063
2062
|
}
|
|
2064
2063
|
});
|
|
2065
2064
|
}
|
|
2066
|
-
function
|
|
2065
|
+
function Do() {
|
|
2067
2066
|
return new ie({
|
|
2068
2067
|
key: new re(le.TEMPLATE_BLOCK_KEYBOARD),
|
|
2069
2068
|
props: {
|
|
2070
2069
|
handleKeyDown(e, t) {
|
|
2071
|
-
var r, a, c,
|
|
2070
|
+
var r, a, c, f, u, T, y, w, b;
|
|
2072
2071
|
const { state: n, dispatch: o } = e, { selection: i } = n, { $from: s } = i;
|
|
2073
2072
|
if (D(t, "ARROW_LEFT") && s.nodeBefore && s.nodeBefore.isText && s.nodeBefore.text && s.nodeBefore.text === A) {
|
|
2074
|
-
const
|
|
2073
|
+
const v = s.parent, h = s.index();
|
|
2075
2074
|
if (h >= 2) {
|
|
2076
|
-
if (
|
|
2077
|
-
const
|
|
2078
|
-
return o(n.tr.setSelection(
|
|
2075
|
+
if (v.child(h - 2).type.name === S.TEMPLATE_BLOCK) {
|
|
2076
|
+
const p = s.pos - 2;
|
|
2077
|
+
return o(n.tr.setSelection(R.create(n.doc, p))), t.preventDefault(), !0;
|
|
2079
2078
|
}
|
|
2080
2079
|
} else if (h === 1 && s.pos !== 0) {
|
|
2081
2080
|
const x = s.before() - 1;
|
|
2082
2081
|
if (x >= 0)
|
|
2083
|
-
return o(n.tr.setSelection(
|
|
2082
|
+
return o(n.tr.setSelection(R.create(n.doc, x))), t.preventDefault(), !0;
|
|
2084
2083
|
}
|
|
2085
2084
|
}
|
|
2086
2085
|
if (D(t, "ARROW_RIGHT") && s.nodeAfter && s.nodeAfter.isText && s.nodeAfter.text === A) {
|
|
2087
|
-
const
|
|
2088
|
-
if (h <
|
|
2089
|
-
if (
|
|
2090
|
-
const
|
|
2091
|
-
return o(n.tr.setSelection(
|
|
2086
|
+
const v = s.parent, h = s.index();
|
|
2087
|
+
if (h < v.childCount - 1) {
|
|
2088
|
+
if (v.child(h + 1).type.name === S.TEMPLATE_BLOCK) {
|
|
2089
|
+
const p = s.pos + 2;
|
|
2090
|
+
return o(n.tr.setSelection(R.create(n.doc, p))), t.preventDefault(), !0;
|
|
2092
2091
|
}
|
|
2093
|
-
} else if (h ===
|
|
2092
|
+
} else if (h === v.childCount - 1 && n.doc.lastChild !== s.node()) {
|
|
2094
2093
|
const x = s.after() + 1;
|
|
2095
|
-
return o(n.tr.setSelection(
|
|
2094
|
+
return o(n.tr.setSelection(R.create(n.doc, x))), t.preventDefault(), !0;
|
|
2096
2095
|
}
|
|
2097
2096
|
}
|
|
2098
2097
|
const l = s.node();
|
|
2099
2098
|
if (l.type.name === S.TEMPLATE_BLOCK) {
|
|
2100
|
-
const
|
|
2101
|
-
if (
|
|
2102
|
-
if (
|
|
2099
|
+
const v = l.textContent || "";
|
|
2100
|
+
if (v === "" || v === A) {
|
|
2101
|
+
if (be(t, ["ARROW_LEFT", "ARROW_RIGHT"])) {
|
|
2103
2102
|
const h = D(t, "ARROW_LEFT") ? s.before() : s.after();
|
|
2104
2103
|
if (i.from !== h)
|
|
2105
|
-
return o(n.tr.setSelection(
|
|
2104
|
+
return o(n.tr.setSelection(R.create(n.doc, h))), t.preventDefault(), !0;
|
|
2106
2105
|
}
|
|
2107
2106
|
} else {
|
|
2108
2107
|
if (D(t, "ARROW_LEFT") && s.pos === s.start()) {
|
|
2109
2108
|
const h = s.before();
|
|
2110
|
-
return o(n.tr.setSelection(
|
|
2109
|
+
return o(n.tr.setSelection(R.create(n.doc, h))), t.preventDefault(), !0;
|
|
2111
2110
|
}
|
|
2112
2111
|
if (D(t, "ARROW_RIGHT") && s.pos === s.end()) {
|
|
2113
2112
|
const h = s.after();
|
|
2114
|
-
return o(n.tr.setSelection(
|
|
2113
|
+
return o(n.tr.setSelection(R.create(n.doc, h))), t.preventDefault(), !0;
|
|
2115
2114
|
}
|
|
2116
2115
|
}
|
|
2117
2116
|
}
|
|
2118
2117
|
if (D(t, "BACKSPACE") && i.empty) {
|
|
2119
|
-
const
|
|
2120
|
-
if (
|
|
2121
|
-
const x =
|
|
2118
|
+
const v = s.node(), h = s.nodeBefore;
|
|
2119
|
+
if (v.type.name === S.TEMPLATE_BLOCK) {
|
|
2120
|
+
const x = v.textContent || "";
|
|
2122
2121
|
if (s.pos === s.end() && x.length === 1 && x !== A) {
|
|
2123
|
-
const
|
|
2124
|
-
return o(n.tr.insertText(A,
|
|
2122
|
+
const p = s.pos - 1;
|
|
2123
|
+
return o(n.tr.insertText(A, p, p + 1)), t.preventDefault(), !0;
|
|
2125
2124
|
}
|
|
2126
2125
|
if (x === A) {
|
|
2127
|
-
const
|
|
2126
|
+
const p = s.before(), d = n.tr.setSelection(R.create(n.doc, p));
|
|
2128
2127
|
return o(d), t.preventDefault(), !0;
|
|
2129
2128
|
}
|
|
2130
2129
|
if (x === "") {
|
|
2131
|
-
const
|
|
2130
|
+
const p = s.before(), d = n.tr.setSelection(R.create(n.doc, p));
|
|
2132
2131
|
return o(d), t.preventDefault(), !0;
|
|
2133
2132
|
}
|
|
2134
2133
|
if (s.pos === s.start() && x.length > 0 && x !== A) {
|
|
2135
|
-
const
|
|
2136
|
-
return o(n.tr.setSelection(
|
|
2134
|
+
const p = s.before();
|
|
2135
|
+
return o(n.tr.setSelection(R.create(n.doc, p))), t.preventDefault(), !0;
|
|
2137
2136
|
}
|
|
2138
2137
|
return !1;
|
|
2139
2138
|
}
|
|
2140
2139
|
if (h && h.isText && ((r = h.text) == null ? void 0 : r.length) === 1 && h.text !== A && s.nodeAfter && s.nodeAfter.type.name === S.TEMPLATE_BLOCK) {
|
|
2141
|
-
const x = s.pos - h.nodeSize,
|
|
2142
|
-
let d = n.tr.delete(x,
|
|
2140
|
+
const x = s.pos - h.nodeSize, p = s.pos;
|
|
2141
|
+
let d = n.tr.delete(x, p);
|
|
2143
2142
|
return d = d.insertText(A, x, x), o(d), t.preventDefault(), !0;
|
|
2144
2143
|
}
|
|
2145
2144
|
if (h && h.type.name === S.TEMPLATE_BLOCK) {
|
|
@@ -2154,14 +2153,14 @@ function No() {
|
|
|
2154
2153
|
return g && g.isText && ((a = g.text) != null && a.startsWith(A)) && (_ = _ + 1), o(n.tr.delete(E, _)), t.preventDefault(), !0;
|
|
2155
2154
|
} else {
|
|
2156
2155
|
const d = s.pos - 1;
|
|
2157
|
-
return o(n.tr.setSelection(
|
|
2156
|
+
return o(n.tr.setSelection(R.create(n.doc, d))), t.preventDefault(), !0;
|
|
2158
2157
|
}
|
|
2159
2158
|
}
|
|
2160
2159
|
if (h && h.isText) {
|
|
2161
|
-
const x = s.parent,
|
|
2160
|
+
const x = s.parent, p = s.index();
|
|
2162
2161
|
if (h.text === A) {
|
|
2163
|
-
if (
|
|
2164
|
-
const d = x.child(
|
|
2162
|
+
if (p > 1) {
|
|
2163
|
+
const d = x.child(p - 2);
|
|
2165
2164
|
if (d.type.name === S.TEMPLATE_BLOCK) {
|
|
2166
2165
|
const m = d.textContent || "";
|
|
2167
2166
|
if (m.length === 0 || m === A) {
|
|
@@ -2171,11 +2170,11 @@ function No() {
|
|
|
2171
2170
|
} else {
|
|
2172
2171
|
const E = s.pos - 2;
|
|
2173
2172
|
if (E >= 0)
|
|
2174
|
-
return o(n.tr.setSelection(
|
|
2173
|
+
return o(n.tr.setSelection(R.create(n.doc, E))), t.preventDefault(), !0;
|
|
2175
2174
|
}
|
|
2176
2175
|
}
|
|
2177
2176
|
}
|
|
2178
|
-
} else if (
|
|
2177
|
+
} else if (p === 1 && s.pos !== 1 && h.text === A) {
|
|
2179
2178
|
const d = i.from - 1 - 2;
|
|
2180
2179
|
if (d >= 0)
|
|
2181
2180
|
return o(n.tr.delete(d, i.to)), t.preventDefault(), !0;
|
|
@@ -2183,38 +2182,38 @@ function No() {
|
|
|
2183
2182
|
}
|
|
2184
2183
|
}
|
|
2185
2184
|
if (D(t, "BACKSPACE") && !i.empty) {
|
|
2186
|
-
let
|
|
2187
|
-
const x = s.nodeBefore,
|
|
2188
|
-
if (x && x.isText && ((c = x.text) != null && c.endsWith(A)) && (
|
|
2189
|
-
const d = n.tr.delete(
|
|
2185
|
+
let v = i.from, h = i.to;
|
|
2186
|
+
const x = s.nodeBefore, p = s.nodeAfter;
|
|
2187
|
+
if (x && x.isText && ((c = x.text) != null && c.endsWith(A)) && (v -= 1), p && p.isText && ((f = p.text) != null && f.startsWith(A)) && (h += 1), v !== i.from || h !== i.to) {
|
|
2188
|
+
const d = n.tr.delete(v, h);
|
|
2190
2189
|
return o(d), t.preventDefault(), !0;
|
|
2191
2190
|
}
|
|
2192
2191
|
}
|
|
2193
2192
|
if (D(t, "DELETE") && i.empty) {
|
|
2194
|
-
const
|
|
2195
|
-
if (
|
|
2196
|
-
const x =
|
|
2193
|
+
const v = s.node(), h = s.nodeAfter;
|
|
2194
|
+
if (v.type.name === S.TEMPLATE_BLOCK) {
|
|
2195
|
+
const x = v.textContent || "";
|
|
2197
2196
|
if (s.pos === s.start() && x.length === 1 && x !== A) {
|
|
2198
|
-
const
|
|
2199
|
-
return o(n.tr.insertText(A,
|
|
2197
|
+
const p = s.pos;
|
|
2198
|
+
return o(n.tr.insertText(A, p, p + 1)), t.preventDefault(), !0;
|
|
2200
2199
|
}
|
|
2201
2200
|
if (x === A) {
|
|
2202
|
-
const
|
|
2201
|
+
const p = s.after(), d = n.tr.setSelection(R.create(n.doc, p));
|
|
2203
2202
|
return o(d), t.preventDefault(), !0;
|
|
2204
2203
|
}
|
|
2205
2204
|
if (x === "") {
|
|
2206
|
-
const
|
|
2205
|
+
const p = s.after(), d = n.tr.setSelection(R.create(n.doc, p));
|
|
2207
2206
|
return o(d), t.preventDefault(), !0;
|
|
2208
2207
|
}
|
|
2209
2208
|
if (s.pos === s.end() && x.length > 0 && x !== A) {
|
|
2210
|
-
const
|
|
2211
|
-
return o(n.tr.setSelection(
|
|
2209
|
+
const p = s.after();
|
|
2210
|
+
return o(n.tr.setSelection(R.create(n.doc, p))), t.preventDefault(), !0;
|
|
2212
2211
|
}
|
|
2213
2212
|
return !1;
|
|
2214
2213
|
}
|
|
2215
2214
|
if (h && h.isText && ((u = h.text) == null ? void 0 : u.length) === 1 && h.text !== A && s.nodeBefore && s.nodeBefore.type.name === S.TEMPLATE_BLOCK) {
|
|
2216
|
-
const x = s.pos,
|
|
2217
|
-
let d = n.tr.delete(x,
|
|
2215
|
+
const x = s.pos, p = s.pos + h.nodeSize;
|
|
2216
|
+
let d = n.tr.delete(x, p);
|
|
2218
2217
|
return d = d.insertText(A, x, x), o(d), t.preventDefault(), !0;
|
|
2219
2218
|
}
|
|
2220
2219
|
if (h && h.type.name === S.TEMPLATE_BLOCK) {
|
|
@@ -2229,33 +2228,33 @@ function No() {
|
|
|
2229
2228
|
return o(n.tr.delete(E, _)), t.preventDefault(), !0;
|
|
2230
2229
|
} else {
|
|
2231
2230
|
const d = s.pos + 1;
|
|
2232
|
-
return o(n.tr.setSelection(
|
|
2231
|
+
return o(n.tr.setSelection(R.create(n.doc, d))), t.preventDefault(), !0;
|
|
2233
2232
|
}
|
|
2234
2233
|
}
|
|
2235
2234
|
if (h && h.isText) {
|
|
2236
|
-
const x = s.parent,
|
|
2237
|
-
if (
|
|
2238
|
-
const d = x.child(
|
|
2235
|
+
const x = s.parent, p = s.index();
|
|
2236
|
+
if (p < x.childCount - 1) {
|
|
2237
|
+
const d = x.child(p + 1);
|
|
2239
2238
|
if (d.type.name === S.TEMPLATE_BLOCK) {
|
|
2240
2239
|
const m = d.textContent || "";
|
|
2241
2240
|
if (m.length === 0 || m === A) {
|
|
2242
2241
|
let E = s.pos;
|
|
2243
2242
|
const _ = s.pos + h.nodeSize + d.nodeSize, C = s.nodeBefore;
|
|
2244
|
-
return C && C.isText && ((
|
|
2243
|
+
return C && C.isText && ((T = C.text) != null && T.endsWith(A)) && (E = E - 1), o(n.tr.delete(E, _)), t.preventDefault(), !0;
|
|
2245
2244
|
}
|
|
2246
2245
|
if (h.text === A || (y = h.text) != null && y.startsWith(A)) {
|
|
2247
2246
|
const E = s.pos + 2;
|
|
2248
|
-
return o(n.tr.setSelection(
|
|
2247
|
+
return o(n.tr.setSelection(R.create(n.doc, E))), t.preventDefault(), !0;
|
|
2249
2248
|
}
|
|
2250
2249
|
}
|
|
2251
2250
|
}
|
|
2252
2251
|
}
|
|
2253
2252
|
}
|
|
2254
2253
|
if (D(t, "DELETE") && !i.empty) {
|
|
2255
|
-
let
|
|
2256
|
-
const x = s.nodeBefore,
|
|
2257
|
-
if (x && x.isText && ((w = x.text) != null && w.endsWith(A)) && (
|
|
2258
|
-
const d = n.tr.delete(
|
|
2254
|
+
let v = i.from, h = i.to;
|
|
2255
|
+
const x = s.nodeBefore, p = s.nodeAfter;
|
|
2256
|
+
if (x && x.isText && ((w = x.text) != null && w.endsWith(A)) && (v -= 1), p && p.isText && ((b = p.text) != null && b.startsWith(A)) && (h += 1), v !== i.from || h !== i.to) {
|
|
2257
|
+
const d = n.tr.delete(v, h);
|
|
2259
2258
|
return o(d), t.preventDefault(), !0;
|
|
2260
2259
|
}
|
|
2261
2260
|
}
|
|
@@ -2264,7 +2263,7 @@ function No() {
|
|
|
2264
2263
|
}
|
|
2265
2264
|
});
|
|
2266
2265
|
}
|
|
2267
|
-
function
|
|
2266
|
+
function ko() {
|
|
2268
2267
|
return new ie({
|
|
2269
2268
|
key: new re(le.TEMPLATE_BLOCK_PASTE),
|
|
2270
2269
|
props: {
|
|
@@ -2275,31 +2274,31 @@ function Wo() {
|
|
|
2275
2274
|
return !1;
|
|
2276
2275
|
const i = (r = t.clipboardData) == null ? void 0 : r.getData("text/plain");
|
|
2277
2276
|
if (i) {
|
|
2278
|
-
const { state: a, dispatch: c } = e,
|
|
2277
|
+
const { state: a, dispatch: c } = e, f = a.selection.$from;
|
|
2279
2278
|
let u = a.tr;
|
|
2280
|
-
|
|
2281
|
-
const
|
|
2279
|
+
f.nodeBefore && f.nodeBefore.isText && f.nodeBefore.text === A && (u = u.delete(f.pos - f.nodeBefore.nodeSize, f.pos)), f.nodeAfter && f.nodeAfter.isText && f.nodeAfter.text === A && (u = u.delete(f.pos, f.pos + f.nodeAfter.nodeSize));
|
|
2280
|
+
const T = i.split(`
|
|
2282
2281
|
`);
|
|
2283
2282
|
let y;
|
|
2284
|
-
if (
|
|
2285
|
-
u = u.insertText(
|
|
2283
|
+
if (T.length === 1)
|
|
2284
|
+
u = u.insertText(T[0], u.selection.from, u.selection.to), y = u.selection.$to.pos;
|
|
2286
2285
|
else {
|
|
2287
|
-
u = u.insertText(
|
|
2286
|
+
u = u.insertText(T[0], u.selection.from, u.selection.to);
|
|
2288
2287
|
let w = u.selection.$to.pos;
|
|
2289
|
-
for (let b = 1; b <
|
|
2290
|
-
const
|
|
2291
|
-
u = u.insert(w,
|
|
2288
|
+
for (let b = 1; b < T.length; b++) {
|
|
2289
|
+
const v = a.schema.nodes.paragraph.create({}, T[b] ? a.schema.text(T[b]) : null);
|
|
2290
|
+
u = u.insert(w, v), w += v.nodeSize;
|
|
2292
2291
|
}
|
|
2293
2292
|
y = w;
|
|
2294
2293
|
}
|
|
2295
|
-
return u = u.setSelection(
|
|
2294
|
+
return u = u.setSelection(R.create(u.doc, y)), u = u.scrollIntoView(), c(u), t.preventDefault(), !0;
|
|
2296
2295
|
}
|
|
2297
2296
|
return !1;
|
|
2298
2297
|
}
|
|
2299
2298
|
}
|
|
2300
2299
|
});
|
|
2301
2300
|
}
|
|
2302
|
-
const
|
|
2301
|
+
const Bo = nt.create({
|
|
2303
2302
|
name: S.TEMPLATE_BLOCK,
|
|
2304
2303
|
// 节点配置
|
|
2305
2304
|
group: "inline",
|
|
@@ -2312,10 +2311,10 @@ const Ko = et.create({
|
|
|
2312
2311
|
draggable: !1,
|
|
2313
2312
|
onCreate() {
|
|
2314
2313
|
const { items: e } = this.options;
|
|
2315
|
-
e &&
|
|
2314
|
+
e && Le(e) && N(
|
|
2316
2315
|
e,
|
|
2317
2316
|
() => {
|
|
2318
|
-
const t =
|
|
2317
|
+
const t = Le(e) ? e.value : e;
|
|
2319
2318
|
t != null && (this.editor.commands.setTemplateData(t), this.editor.commands.focusFirstTemplate());
|
|
2320
2319
|
},
|
|
2321
2320
|
{ deep: !0, immediate: !0 }
|
|
@@ -2353,7 +2352,7 @@ const Ko = et.create({
|
|
|
2353
2352
|
const n = e.textContent || "";
|
|
2354
2353
|
return [
|
|
2355
2354
|
"span",
|
|
2356
|
-
|
|
2355
|
+
ot(this.options.HTMLAttributes || {}, t, {
|
|
2357
2356
|
"data-template": "",
|
|
2358
2357
|
"data-id": e.attrs.id,
|
|
2359
2358
|
"data-content": n
|
|
@@ -2363,18 +2362,18 @@ const Ko = et.create({
|
|
|
2363
2362
|
},
|
|
2364
2363
|
// 使用 Vue 组件渲染
|
|
2365
2364
|
addNodeView() {
|
|
2366
|
-
return
|
|
2365
|
+
return tt(Oo);
|
|
2367
2366
|
},
|
|
2368
2367
|
// 添加插件
|
|
2369
2368
|
addProseMirrorPlugins() {
|
|
2370
|
-
return [
|
|
2369
|
+
return [Po(), Do(), ko()];
|
|
2371
2370
|
}
|
|
2372
|
-
}),
|
|
2371
|
+
}), Ae = new re(
|
|
2373
2372
|
le.TEMPLATE_SELECT_DROPDOWN
|
|
2374
2373
|
);
|
|
2375
|
-
function
|
|
2374
|
+
function Io() {
|
|
2376
2375
|
return new ie({
|
|
2377
|
-
key:
|
|
2376
|
+
key: Ae,
|
|
2378
2377
|
state: {
|
|
2379
2378
|
init() {
|
|
2380
2379
|
return {
|
|
@@ -2383,7 +2382,7 @@ function Ho() {
|
|
|
2383
2382
|
};
|
|
2384
2383
|
},
|
|
2385
2384
|
apply(e, t) {
|
|
2386
|
-
const n = e.getMeta(
|
|
2385
|
+
const n = e.getMeta(Ae);
|
|
2387
2386
|
if (n) {
|
|
2388
2387
|
if (n.type === "open")
|
|
2389
2388
|
return {
|
|
@@ -2401,7 +2400,7 @@ function Ho() {
|
|
|
2401
2400
|
}
|
|
2402
2401
|
});
|
|
2403
2402
|
}
|
|
2404
|
-
function
|
|
2403
|
+
function $o() {
|
|
2405
2404
|
return new ie({
|
|
2406
2405
|
key: new re(le.TEMPLATE_SELECT_ZERO_WIDTH),
|
|
2407
2406
|
appendTransaction(e, t, n) {
|
|
@@ -2419,13 +2418,13 @@ function Fo() {
|
|
|
2419
2418
|
}
|
|
2420
2419
|
});
|
|
2421
2420
|
}
|
|
2422
|
-
function
|
|
2421
|
+
function No() {
|
|
2423
2422
|
return new ie({
|
|
2424
2423
|
key: new re(le.TEMPLATE_SELECT_KEYBOARD),
|
|
2425
2424
|
props: {
|
|
2426
2425
|
handleKeyDown(e, t) {
|
|
2427
|
-
const { state: n, dispatch: o } = e, { selection: i } = n, { $from: s } = i, l =
|
|
2428
|
-
if (l != null && l.isOpen &&
|
|
2426
|
+
const { state: n, dispatch: o } = e, { selection: i } = n, { $from: s } = i, l = Ae.getState(e.state);
|
|
2427
|
+
if (l != null && l.isOpen && be(t, ["ENTER", "ARROW_UP", "ARROW_DOWN", "ESCAPE"]))
|
|
2429
2428
|
return !0;
|
|
2430
2429
|
if (D(t, "BACKSPACE") && i.empty) {
|
|
2431
2430
|
const r = s.nodeBefore, a = s.nodeAfter;
|
|
@@ -2434,8 +2433,8 @@ function Vo() {
|
|
|
2434
2433
|
if (r != null && r.isText && r.text === A) {
|
|
2435
2434
|
const c = s.pos - 1, u = n.doc.resolve(c).nodeBefore;
|
|
2436
2435
|
if ((u == null ? void 0 : u.type.name) === S.TEMPLATE_SELECT) {
|
|
2437
|
-
const
|
|
2438
|
-
return o(n.tr.delete(
|
|
2436
|
+
const T = c - u.nodeSize, y = s.pos;
|
|
2437
|
+
return o(n.tr.delete(T, y)), t.preventDefault(), !0;
|
|
2439
2438
|
}
|
|
2440
2439
|
}
|
|
2441
2440
|
if ((a == null ? void 0 : a.type.name) === S.TEMPLATE_SELECT) {
|
|
@@ -2454,8 +2453,8 @@ function Vo() {
|
|
|
2454
2453
|
if (r != null && r.isText && r.text === A) {
|
|
2455
2454
|
const c = s.pos + 1, u = n.doc.resolve(c).nodeAfter;
|
|
2456
2455
|
if ((u == null ? void 0 : u.type.name) === S.TEMPLATE_SELECT) {
|
|
2457
|
-
const
|
|
2458
|
-
return o(n.tr.delete(s.pos,
|
|
2456
|
+
const T = c + u.nodeSize;
|
|
2457
|
+
return o(n.tr.delete(s.pos, T)), t.preventDefault(), !0;
|
|
2459
2458
|
}
|
|
2460
2459
|
}
|
|
2461
2460
|
if ((a == null ? void 0 : a.type.name) === S.TEMPLATE_SELECT) {
|
|
@@ -2472,7 +2471,7 @@ function Vo() {
|
|
|
2472
2471
|
}
|
|
2473
2472
|
});
|
|
2474
2473
|
}
|
|
2475
|
-
function
|
|
2474
|
+
function Wo(e, t, n) {
|
|
2476
2475
|
const o = (i) => {
|
|
2477
2476
|
const s = i.target;
|
|
2478
2477
|
!e.contains(s) && !t.contains(s) && (n(), document.removeEventListener("click", o));
|
|
@@ -2483,7 +2482,7 @@ function zo(e, t, n) {
|
|
|
2483
2482
|
document.removeEventListener("click", o);
|
|
2484
2483
|
};
|
|
2485
2484
|
}
|
|
2486
|
-
const
|
|
2485
|
+
const Ko = { class: "template-select__icon" }, Ho = ["onMousedown", "onMouseenter"], Fo = /* @__PURE__ */ Y({
|
|
2487
2486
|
__name: "template-select-view",
|
|
2488
2487
|
props: {
|
|
2489
2488
|
node: {},
|
|
@@ -2496,23 +2495,23 @@ const qo = { class: "template-select__icon" }, Uo = ["onMousedown", "onMouseente
|
|
|
2496
2495
|
const a = k(() => t.node.attrs.options.find((m) => m.value === t.node.attrs.value)), c = k(() => {
|
|
2497
2496
|
var m;
|
|
2498
2497
|
return ((m = a.value) == null ? void 0 : m.label) || t.node.attrs.placeholder;
|
|
2499
|
-
}),
|
|
2500
|
-
n.value ? y() :
|
|
2501
|
-
},
|
|
2498
|
+
}), f = k(() => !t.node.attrs.value), u = () => {
|
|
2499
|
+
n.value ? y() : T();
|
|
2500
|
+
}, T = async () => {
|
|
2502
2501
|
var m;
|
|
2503
2502
|
if (n.value = !0, (m = t.editor) != null && m.view) {
|
|
2504
2503
|
const g = t.editor.view, E = g.state.tr;
|
|
2505
|
-
E.setMeta(
|
|
2504
|
+
E.setMeta(Ae, {
|
|
2506
2505
|
type: "open",
|
|
2507
2506
|
selectId: t.node.attrs.id
|
|
2508
2507
|
}), g.dispatch(E);
|
|
2509
2508
|
}
|
|
2510
|
-
t.node.attrs.value ? o.value = t.node.attrs.options.findIndex((g) => g.value === t.node.attrs.value) : o.value = -1, await
|
|
2509
|
+
t.node.attrs.value ? o.value = t.node.attrs.options.findIndex((g) => g.value === t.node.attrs.value) : o.value = -1, await me(), b(), i.value && s.value && (l = Wo(i.value, s.value, y));
|
|
2511
2510
|
}, y = async () => {
|
|
2512
2511
|
var m;
|
|
2513
2512
|
if (n.value = !1, o.value = -1, (m = t.editor) != null && m.view) {
|
|
2514
2513
|
const g = t.editor.view, E = g.state.tr;
|
|
2515
|
-
E.setMeta(
|
|
2514
|
+
E.setMeta(Ae, {
|
|
2516
2515
|
type: "close"
|
|
2517
2516
|
}), g.dispatch(E);
|
|
2518
2517
|
}
|
|
@@ -2520,12 +2519,12 @@ const qo = { class: "template-select__icon" }, Uo = ["onMousedown", "onMouseente
|
|
|
2520
2519
|
}, w = (m) => {
|
|
2521
2520
|
t.updateAttributes({ value: m.value }), y();
|
|
2522
2521
|
}, b = () => {
|
|
2523
|
-
!i.value || !s.value || (r && (r(), r = null), r =
|
|
2524
|
-
!i.value || !s.value ||
|
|
2522
|
+
!i.value || !s.value || (r && (r(), r = null), r = lt(i.value, s.value, () => {
|
|
2523
|
+
!i.value || !s.value || dt(i.value, s.value, {
|
|
2525
2524
|
placement: "bottom-start",
|
|
2526
2525
|
strategy: "fixed",
|
|
2527
2526
|
// 使用 fixed 定位策略,相对于视口
|
|
2528
|
-
middleware: [
|
|
2527
|
+
middleware: [at(4), ut(), ct({ padding: 8 })]
|
|
2529
2528
|
}).then(({ x: m, y: g }) => {
|
|
2530
2529
|
s.value && Object.assign(s.value.style, {
|
|
2531
2530
|
left: `${m}px`,
|
|
@@ -2533,7 +2532,7 @@ const qo = { class: "template-select__icon" }, Uo = ["onMousedown", "onMouseente
|
|
|
2533
2532
|
});
|
|
2534
2533
|
});
|
|
2535
2534
|
}));
|
|
2536
|
-
},
|
|
2535
|
+
}, v = (m) => {
|
|
2537
2536
|
if (n.value)
|
|
2538
2537
|
switch (m.key) {
|
|
2539
2538
|
case "ArrowUp":
|
|
@@ -2550,11 +2549,11 @@ const qo = { class: "template-select__icon" }, Uo = ["onMousedown", "onMouseente
|
|
|
2550
2549
|
break;
|
|
2551
2550
|
}
|
|
2552
2551
|
}, h = () => {
|
|
2553
|
-
o.value === -1 || o.value <= 0 ? o.value = t.node.attrs.options.length - 1 : o.value -= 1,
|
|
2552
|
+
o.value === -1 || o.value <= 0 ? o.value = t.node.attrs.options.length - 1 : o.value -= 1, p();
|
|
2554
2553
|
}, x = () => {
|
|
2555
|
-
o.value === -1 || o.value >= t.node.attrs.options.length - 1 ? o.value = 0 : o.value += 1,
|
|
2556
|
-
},
|
|
2557
|
-
|
|
2554
|
+
o.value === -1 || o.value >= t.node.attrs.options.length - 1 ? o.value = 0 : o.value += 1, p();
|
|
2555
|
+
}, p = () => {
|
|
2556
|
+
me(() => {
|
|
2558
2557
|
if (!s.value) return;
|
|
2559
2558
|
const m = s.value.querySelector(".template-select__option.is-highlighted");
|
|
2560
2559
|
m && m.scrollIntoView({
|
|
@@ -2565,11 +2564,11 @@ const qo = { class: "template-select__icon" }, Uo = ["onMousedown", "onMouseente
|
|
|
2565
2564
|
}, d = () => {
|
|
2566
2565
|
o.value >= 0 && o.value < t.node.attrs.options.length ? w(t.node.attrs.options[o.value]) : y();
|
|
2567
2566
|
};
|
|
2568
|
-
return
|
|
2569
|
-
document.addEventListener("keydown",
|
|
2570
|
-
}),
|
|
2571
|
-
document.removeEventListener("keydown",
|
|
2572
|
-
}), (m, g) => (M(), G(L(
|
|
2567
|
+
return Qt(() => {
|
|
2568
|
+
document.addEventListener("keydown", v);
|
|
2569
|
+
}), en(() => {
|
|
2570
|
+
document.removeEventListener("keydown", v), l && l(), r && r();
|
|
2571
|
+
}), (m, g) => (M(), G(L(et), {
|
|
2573
2572
|
as: "span",
|
|
2574
2573
|
class: "template-select"
|
|
2575
2574
|
}, {
|
|
@@ -2581,43 +2580,43 @@ const qo = { class: "template-select__icon" }, Uo = ["onMousedown", "onMouseente
|
|
|
2581
2580
|
B("span", {
|
|
2582
2581
|
ref_key: "triggerRef",
|
|
2583
2582
|
ref: i,
|
|
2584
|
-
class:
|
|
2585
|
-
onMousedown:
|
|
2583
|
+
class: Q(["template-select__trigger", { "is-open": n.value }]),
|
|
2584
|
+
onMousedown: Ze(u, ["prevent"])
|
|
2586
2585
|
}, [
|
|
2587
2586
|
B("span", {
|
|
2588
|
-
class:
|
|
2589
|
-
},
|
|
2590
|
-
B("span",
|
|
2591
|
-
oe(L(
|
|
2587
|
+
class: Q(["template-select__text", { "is-placeholder": f.value }])
|
|
2588
|
+
}, pe(c.value), 3),
|
|
2589
|
+
B("span", Ko, [
|
|
2590
|
+
oe(L(Tn))
|
|
2592
2591
|
])
|
|
2593
2592
|
], 34),
|
|
2594
2593
|
g[1] || (g[1] = B("span", {
|
|
2595
2594
|
contenteditable: "false",
|
|
2596
2595
|
class: "template-select__suffix"
|
|
2597
2596
|
}, "", -1)),
|
|
2598
|
-
(M(), G(
|
|
2597
|
+
(M(), G(tn, { to: "body" }, [
|
|
2599
2598
|
n.value ? (M(), O("div", {
|
|
2600
2599
|
key: 0,
|
|
2601
2600
|
ref_key: "dropdownRef",
|
|
2602
2601
|
ref: s,
|
|
2603
2602
|
class: "template-select__dropdown"
|
|
2604
2603
|
}, [
|
|
2605
|
-
(M(!0), O(
|
|
2604
|
+
(M(!0), O(ke, null, Be(e.node.attrs.options, (E, _) => (M(), O("div", {
|
|
2606
2605
|
key: E.value,
|
|
2607
|
-
class:
|
|
2606
|
+
class: Q(["template-select__option", {
|
|
2608
2607
|
"is-highlighted": _ === o.value,
|
|
2609
2608
|
"is-selected": E.value === e.node.attrs.value
|
|
2610
2609
|
}]),
|
|
2611
|
-
onMousedown:
|
|
2610
|
+
onMousedown: Ze((C) => w(E), ["prevent"]),
|
|
2612
2611
|
onMouseenter: (C) => o.value = _
|
|
2613
|
-
},
|
|
2612
|
+
}, pe(E.label), 43, Ho))), 128))
|
|
2614
2613
|
], 512)) : K("", !0)
|
|
2615
2614
|
]))
|
|
2616
2615
|
]),
|
|
2617
2616
|
_: 1
|
|
2618
2617
|
}));
|
|
2619
2618
|
}
|
|
2620
|
-
}),
|
|
2619
|
+
}), Vo = /* @__PURE__ */ j(Fo, [["__scopeId", "data-v-dbb18436"]]), zo = nt.create({
|
|
2621
2620
|
name: S.TEMPLATE_SELECT,
|
|
2622
2621
|
// 节点配置
|
|
2623
2622
|
group: "inline",
|
|
@@ -2686,7 +2685,7 @@ const qo = { class: "template-select__icon" }, Uo = ["onMousedown", "onMouseente
|
|
|
2686
2685
|
}
|
|
2687
2686
|
return [
|
|
2688
2687
|
"span",
|
|
2689
|
-
|
|
2688
|
+
ot(t, {
|
|
2690
2689
|
"data-template-select": "",
|
|
2691
2690
|
"data-id": e.attrs.id,
|
|
2692
2691
|
"data-placeholder": e.attrs.placeholder,
|
|
@@ -2698,46 +2697,46 @@ const qo = { class: "template-select__icon" }, Uo = ["onMousedown", "onMouseente
|
|
|
2698
2697
|
},
|
|
2699
2698
|
// 使用 Vue 组件渲染
|
|
2700
2699
|
addNodeView() {
|
|
2701
|
-
return
|
|
2700
|
+
return tt(Vo);
|
|
2702
2701
|
},
|
|
2703
2702
|
// 添加插件
|
|
2704
2703
|
addProseMirrorPlugins() {
|
|
2705
|
-
return [
|
|
2704
|
+
return [Io(), $o(), No()];
|
|
2706
2705
|
}
|
|
2707
|
-
}),
|
|
2708
|
-
name:
|
|
2706
|
+
}), Ut = Mt.create({
|
|
2707
|
+
name: Te.TEMPLATE,
|
|
2709
2708
|
addExtensions() {
|
|
2710
|
-
return [
|
|
2709
|
+
return [Bo.configure(this.options), zo];
|
|
2711
2710
|
},
|
|
2712
2711
|
// 添加命令(统一命令入口)
|
|
2713
2712
|
addCommands() {
|
|
2714
|
-
return
|
|
2713
|
+
return Lo;
|
|
2715
2714
|
}
|
|
2716
2715
|
});
|
|
2717
|
-
function
|
|
2718
|
-
return
|
|
2716
|
+
function qo(e, t) {
|
|
2717
|
+
return Ut.configure({
|
|
2719
2718
|
items: e,
|
|
2720
2719
|
...t
|
|
2721
2720
|
});
|
|
2722
2721
|
}
|
|
2723
|
-
function
|
|
2724
|
-
const n = V(null), o =
|
|
2722
|
+
function Uo(e, t) {
|
|
2723
|
+
const n = V(null), o = De(e, "placeholder"), i = () => {
|
|
2725
2724
|
var r;
|
|
2726
2725
|
const l = [
|
|
2727
|
-
ln,
|
|
2728
|
-
an,
|
|
2729
2726
|
cn,
|
|
2730
2727
|
un,
|
|
2728
|
+
dn,
|
|
2729
|
+
fn,
|
|
2731
2730
|
// 提供 undo/redo 功能
|
|
2732
|
-
|
|
2731
|
+
pn.configure({
|
|
2733
2732
|
placeholder: () => o.value || "请输入内容..."
|
|
2734
2733
|
}),
|
|
2735
|
-
|
|
2734
|
+
mn.configure({
|
|
2736
2735
|
mode: "textSize"
|
|
2737
2736
|
})
|
|
2738
2737
|
];
|
|
2739
2738
|
return (r = e.extensions) != null && r.length && l.push(...e.extensions), l;
|
|
2740
|
-
}, s =
|
|
2739
|
+
}, s = ln({
|
|
2741
2740
|
content: e.modelValue ?? e.defaultValue ?? "",
|
|
2742
2741
|
extensions: i(),
|
|
2743
2742
|
autofocus: e.autofocus ? "end" : !1,
|
|
@@ -2748,11 +2747,11 @@ function Zo(e, t) {
|
|
|
2748
2747
|
},
|
|
2749
2748
|
// 处理粘贴事件 - 只粘贴纯文本
|
|
2750
2749
|
handlePaste(l, r) {
|
|
2751
|
-
var
|
|
2752
|
-
const a = (
|
|
2750
|
+
var T;
|
|
2751
|
+
const a = (T = r.clipboardData) == null ? void 0 : T.getData("text/plain");
|
|
2753
2752
|
if (!a) return !1;
|
|
2754
|
-
const c = e.mode === "single" ? a.replace(/\r?\n/g, " ") : a, { state:
|
|
2755
|
-
return u.insertText(c), l.dispatch(u),
|
|
2753
|
+
const c = e.mode === "single" ? a.replace(/\r?\n/g, " ") : a, { state: f } = l, { tr: u } = f;
|
|
2754
|
+
return u.insertText(c), l.dispatch(u), me(() => {
|
|
2756
2755
|
var y;
|
|
2757
2756
|
(y = s.value) == null || y.commands.scrollIntoView();
|
|
2758
2757
|
}), !0;
|
|
@@ -2790,7 +2789,7 @@ function Zo(e, t) {
|
|
|
2790
2789
|
l ? r.setAttribute("enterkeyhint", l) : r.removeAttribute("enterkeyhint");
|
|
2791
2790
|
}
|
|
2792
2791
|
}
|
|
2793
|
-
),
|
|
2792
|
+
), nn(() => {
|
|
2794
2793
|
var l;
|
|
2795
2794
|
(l = s.value) == null || l.destroy();
|
|
2796
2795
|
}), {
|
|
@@ -2798,7 +2797,7 @@ function Zo(e, t) {
|
|
|
2798
2797
|
editorRef: n
|
|
2799
2798
|
};
|
|
2800
2799
|
}
|
|
2801
|
-
function
|
|
2800
|
+
function Xo(e) {
|
|
2802
2801
|
const { submitType: t } = e;
|
|
2803
2802
|
return {
|
|
2804
2803
|
checkSubmitShortcut: (i) => {
|
|
@@ -2828,8 +2827,8 @@ function Jo(e) {
|
|
|
2828
2827
|
}
|
|
2829
2828
|
};
|
|
2830
2829
|
}
|
|
2831
|
-
function
|
|
2832
|
-
const o = V(e.mode || "single"), i = V(!1), s = V(e.mode || "single"), { start: l, stop: r } =
|
|
2830
|
+
function Go(e, t, n) {
|
|
2831
|
+
const o = V(e.mode || "single"), i = V(!1), s = V(e.mode || "single"), { start: l, stop: r } = hn(
|
|
2833
2832
|
() => {
|
|
2834
2833
|
i.value = !1;
|
|
2835
2834
|
},
|
|
@@ -2842,31 +2841,31 @@ function Qo(e, t, n) {
|
|
|
2842
2841
|
if (s.value !== "single" || i.value || !t.value || !n.value) return;
|
|
2843
2842
|
const u = n.value.querySelector(".ProseMirror");
|
|
2844
2843
|
if (!u) return;
|
|
2845
|
-
const
|
|
2846
|
-
o.value === "single" ? u.scrollWidth > u.clientWidth &&
|
|
2847
|
-
},
|
|
2848
|
-
o.value !== u && (i.value = !0, o.value = u,
|
|
2844
|
+
const T = t.value.getText();
|
|
2845
|
+
o.value === "single" ? u.scrollWidth > u.clientWidth && f("multiple") : T.length || f("single");
|
|
2846
|
+
}, f = (u) => {
|
|
2847
|
+
o.value !== u && (i.value = !0, o.value = u, me(() => {
|
|
2849
2848
|
t.value && t.value.commands.focus("end"), r(), l();
|
|
2850
2849
|
}));
|
|
2851
2850
|
};
|
|
2852
|
-
return
|
|
2851
|
+
return gn(a, () => {
|
|
2853
2852
|
requestAnimationFrame(() => {
|
|
2854
2853
|
c();
|
|
2855
2854
|
});
|
|
2856
2855
|
}), N(
|
|
2857
2856
|
() => e.mode,
|
|
2858
2857
|
(u) => {
|
|
2859
|
-
u && u !== o.value && (s.value = u,
|
|
2858
|
+
u && u !== o.value && (s.value = u, f(u));
|
|
2860
2859
|
}
|
|
2861
2860
|
), {
|
|
2862
2861
|
currentMode: o,
|
|
2863
2862
|
isAutoSwitching: i,
|
|
2864
|
-
setMode:
|
|
2863
|
+
setMode: f,
|
|
2865
2864
|
checkOverflow: c
|
|
2866
2865
|
};
|
|
2867
2866
|
}
|
|
2868
|
-
function
|
|
2869
|
-
const o =
|
|
2867
|
+
function Yo(e, t, n) {
|
|
2868
|
+
const o = yn("--tr-sender-line-height", t), i = k(() => {
|
|
2870
2869
|
const r = o.value;
|
|
2871
2870
|
if (r) {
|
|
2872
2871
|
const a = parseFloat(r);
|
|
@@ -2888,15 +2887,15 @@ function es(e, t, n) {
|
|
|
2888
2887
|
}
|
|
2889
2888
|
const a = s.value;
|
|
2890
2889
|
if (e.value === "multiple" && a) {
|
|
2891
|
-
const c = i.value * a.minRows,
|
|
2892
|
-
r.style.minHeight = `${c}px`, r.style.maxHeight = `${
|
|
2890
|
+
const c = i.value * a.minRows, f = i.value * a.maxRows;
|
|
2891
|
+
r.style.minHeight = `${c}px`, r.style.maxHeight = `${f}px`, r.style.overflowY = "auto";
|
|
2893
2892
|
} else
|
|
2894
2893
|
r.style.minHeight = "", r.style.maxHeight = "", r.style.overflowY = e.value === "single" ? "hidden" : "auto";
|
|
2895
2894
|
};
|
|
2896
2895
|
return N(
|
|
2897
2896
|
e,
|
|
2898
2897
|
() => {
|
|
2899
|
-
|
|
2898
|
+
me(() => {
|
|
2900
2899
|
l();
|
|
2901
2900
|
});
|
|
2902
2901
|
},
|
|
@@ -2904,7 +2903,7 @@ function es(e, t, n) {
|
|
|
2904
2903
|
), N(
|
|
2905
2904
|
s,
|
|
2906
2905
|
() => {
|
|
2907
|
-
|
|
2906
|
+
me(() => {
|
|
2908
2907
|
l();
|
|
2909
2908
|
});
|
|
2910
2909
|
},
|
|
@@ -2913,22 +2912,22 @@ function es(e, t, n) {
|
|
|
2913
2912
|
updateHeight: l
|
|
2914
2913
|
};
|
|
2915
2914
|
}
|
|
2916
|
-
function
|
|
2917
|
-
const { editor: n, editorRef: o } =
|
|
2915
|
+
function jo(e, t) {
|
|
2916
|
+
const { editor: n, editorRef: o } = Uo(e, t), i = k(() => n.value ? je(n.value).trim().length > 0 : !1), s = k(() => n.value ? je(n.value).length : 0), l = k(() => e.maxLength ? s.value > e.maxLength : !1), r = k(() => {
|
|
2918
2917
|
var m, g;
|
|
2919
2918
|
return !e.disabled && !e.loading && i.value && !l.value && !((g = (m = e.defaultActions) == null ? void 0 : m.submit) != null && g.disabled);
|
|
2920
2919
|
}), a = () => {
|
|
2921
2920
|
if (!r.value || !n.value) return;
|
|
2922
2921
|
let m, g = "";
|
|
2923
|
-
if (n.value.extensionManager.extensions.some((E) => E.name ===
|
|
2924
|
-
const E =
|
|
2925
|
-
E.length > 0 && (m = E), g =
|
|
2926
|
-
} else if (n.value.extensionManager.extensions.some((E) => E.name ===
|
|
2927
|
-
const E =
|
|
2928
|
-
E.length > 0 && (m = E), g =
|
|
2922
|
+
if (n.value.extensionManager.extensions.some((E) => E.name === Te.TEMPLATE)) {
|
|
2923
|
+
const E = qt(n.value);
|
|
2924
|
+
E.length > 0 && (m = E), g = je(n.value);
|
|
2925
|
+
} else if (n.value.extensionManager.extensions.some((E) => E.name === Te.MENTION)) {
|
|
2926
|
+
const E = go(n.value);
|
|
2927
|
+
E.length > 0 && (m = E), g = ho(n.value);
|
|
2929
2928
|
}
|
|
2930
2929
|
g || (g = n.value.getText()), t("submit", g, m);
|
|
2931
|
-
}, { currentMode: c, isAutoSwitching:
|
|
2930
|
+
}, { currentMode: c, isAutoSwitching: f, setMode: u, checkOverflow: T } = Go(e, n, o), y = Xo({
|
|
2932
2931
|
submitType: k(() => e.submitType ?? "enter")
|
|
2933
2932
|
});
|
|
2934
2933
|
N(
|
|
@@ -2938,7 +2937,7 @@ function ts(e, t) {
|
|
|
2938
2937
|
editorProps: {
|
|
2939
2938
|
...m.options.editorProps,
|
|
2940
2939
|
handleKeyDown: (g, E) => {
|
|
2941
|
-
const _ =
|
|
2940
|
+
const _ = de.getState(g.state), C = F.getState(g.state), I = Ae.getState(g.state);
|
|
2942
2941
|
return _ && _.active || C && C.active || I && I.isOpen ? !1 : y.checkSubmitShortcut(E) ? (E.preventDefault(), a(), !0) : y.checkNewlineShortcut(E) ? (E.preventDefault(), c.value === "single" ? (u("multiple"), setTimeout(() => {
|
|
2943
2942
|
m.commands.splitBlock(), m.commands.focus();
|
|
2944
2943
|
}, 0)) : m.commands.splitBlock(), !0) : !1;
|
|
@@ -2947,14 +2946,14 @@ function ts(e, t) {
|
|
|
2947
2946
|
});
|
|
2948
2947
|
},
|
|
2949
2948
|
{ immediate: !0 }
|
|
2950
|
-
),
|
|
2949
|
+
), Yo(c, o, e.autoSize), N(
|
|
2951
2950
|
() => {
|
|
2952
2951
|
var m;
|
|
2953
2952
|
return (m = n.value) == null ? void 0 : m.state.doc.content;
|
|
2954
2953
|
},
|
|
2955
2954
|
() => {
|
|
2956
2955
|
setTimeout(() => {
|
|
2957
|
-
|
|
2956
|
+
T();
|
|
2958
2957
|
}, 0);
|
|
2959
2958
|
},
|
|
2960
2959
|
{ deep: !0 }
|
|
@@ -2965,7 +2964,7 @@ function ts(e, t) {
|
|
|
2965
2964
|
}, b = () => {
|
|
2966
2965
|
var m, g;
|
|
2967
2966
|
(m = n.value) == null || m.commands.clearContent(), (g = n.value) == null || g.commands.focus(), t("clear");
|
|
2968
|
-
},
|
|
2967
|
+
}, v = () => {
|
|
2969
2968
|
t("cancel");
|
|
2970
2969
|
}, h = () => {
|
|
2971
2970
|
var m;
|
|
@@ -2973,51 +2972,51 @@ function ts(e, t) {
|
|
|
2973
2972
|
}, x = (m) => {
|
|
2974
2973
|
var g;
|
|
2975
2974
|
(g = n.value) == null || g.commands.setContent(m);
|
|
2976
|
-
},
|
|
2975
|
+
}, p = () => {
|
|
2977
2976
|
var m;
|
|
2978
2977
|
return ((m = n.value) == null ? void 0 : m.getText()) || "";
|
|
2979
2978
|
}, d = {
|
|
2980
2979
|
editor: n,
|
|
2981
2980
|
editorRef: o,
|
|
2982
2981
|
mode: c,
|
|
2983
|
-
isAutoSwitching:
|
|
2982
|
+
isAutoSwitching: f,
|
|
2984
2983
|
loading: k(() => e.loading ?? !1),
|
|
2985
2984
|
disabled: k(() => e.disabled ?? !1),
|
|
2986
2985
|
hasContent: i,
|
|
2987
2986
|
canSubmit: r,
|
|
2988
2987
|
isOverLimit: l,
|
|
2989
2988
|
characterCount: s,
|
|
2990
|
-
maxLength:
|
|
2989
|
+
maxLength: De(e, "maxLength"),
|
|
2991
2990
|
size: k(() => e.size ?? "normal"),
|
|
2992
2991
|
showWordLimit: k(() => e.showWordLimit ?? !1),
|
|
2993
2992
|
clearable: k(() => e.clearable ?? !1),
|
|
2994
|
-
defaultActions:
|
|
2993
|
+
defaultActions: De(e, "defaultActions"),
|
|
2995
2994
|
submitType: k(() => e.submitType ?? "enter"),
|
|
2996
|
-
stopText:
|
|
2995
|
+
stopText: De(e, "stopText"),
|
|
2997
2996
|
submit: a,
|
|
2998
2997
|
clear: b,
|
|
2999
|
-
cancel:
|
|
2998
|
+
cancel: v,
|
|
3000
2999
|
focus: w,
|
|
3001
3000
|
blur: h,
|
|
3002
3001
|
setContent: x,
|
|
3003
|
-
getContent:
|
|
3002
|
+
getContent: p
|
|
3004
3003
|
};
|
|
3005
|
-
return
|
|
3004
|
+
return on(sn, d), {
|
|
3006
3005
|
context: d,
|
|
3007
3006
|
expose: {
|
|
3008
3007
|
submit: a,
|
|
3009
3008
|
clear: b,
|
|
3010
|
-
cancel:
|
|
3009
|
+
cancel: v,
|
|
3011
3010
|
focus: w,
|
|
3012
3011
|
blur: h,
|
|
3013
3012
|
setContent: x,
|
|
3014
|
-
getContent:
|
|
3013
|
+
getContent: p,
|
|
3015
3014
|
editor: n
|
|
3016
3015
|
}
|
|
3017
3016
|
};
|
|
3018
3017
|
}
|
|
3019
|
-
function
|
|
3020
|
-
const e =
|
|
3018
|
+
function ft() {
|
|
3019
|
+
const e = Oe();
|
|
3021
3020
|
return k(() => ({
|
|
3022
3021
|
// 编辑器实例
|
|
3023
3022
|
editor: e.editor.value,
|
|
@@ -3045,17 +3044,17 @@ function ut() {
|
|
|
3045
3044
|
hasContent: e.hasContent.value
|
|
3046
3045
|
}));
|
|
3047
3046
|
}
|
|
3048
|
-
const
|
|
3047
|
+
const Zo = { class: "tr-sender-editor-scroll" }, Jo = /* @__PURE__ */ Y({
|
|
3049
3048
|
__name: "index",
|
|
3050
3049
|
setup(e) {
|
|
3051
|
-
const { editor: t, editorRef: n } =
|
|
3050
|
+
const { editor: t, editorRef: n } = Oe();
|
|
3052
3051
|
return (o, i) => (M(), O("div", {
|
|
3053
3052
|
ref_key: "editorRef",
|
|
3054
3053
|
ref: n,
|
|
3055
3054
|
class: "tr-sender-editor-wrapper"
|
|
3056
3055
|
}, [
|
|
3057
|
-
B("div",
|
|
3058
|
-
L(t) ? (M(), G(L(
|
|
3056
|
+
B("div", Zo, [
|
|
3057
|
+
L(t) ? (M(), G(L(an), {
|
|
3059
3058
|
key: 0,
|
|
3060
3059
|
editor: L(t),
|
|
3061
3060
|
class: "tr-sender-editor-content"
|
|
@@ -3063,97 +3062,97 @@ const ns = { class: "tr-sender-editor-scroll" }, os = /* @__PURE__ */ j({
|
|
|
3063
3062
|
])
|
|
3064
3063
|
], 512));
|
|
3065
3064
|
}
|
|
3066
|
-
}),
|
|
3065
|
+
}), Xt = /* @__PURE__ */ j(Jo, [["__scopeId", "data-v-7f5b51aa"]]), Qo = { class: "tr-sender-single-layout" }, es = {
|
|
3067
3066
|
key: 0,
|
|
3068
3067
|
class: "tr-sender-header"
|
|
3069
|
-
},
|
|
3068
|
+
}, ts = { class: "tr-sender-container" }, ns = { class: "tr-sender-main" }, os = {
|
|
3070
3069
|
key: 0,
|
|
3071
3070
|
class: "tr-sender-prefix"
|
|
3072
|
-
},
|
|
3071
|
+
}, ss = { class: "tr-sender-content" }, rs = /* @__PURE__ */ Y({
|
|
3073
3072
|
__name: "SingleLineLayout",
|
|
3074
3073
|
setup(e) {
|
|
3075
|
-
const { editor: t, hasContent: n, loading: o, showWordLimit: i, maxLength: s } =
|
|
3076
|
-
return (r, a) => (M(), O("div",
|
|
3077
|
-
r.$slots.header ? (M(), O("div",
|
|
3078
|
-
|
|
3074
|
+
const { editor: t, hasContent: n, loading: o, showWordLimit: i, maxLength: s } = Oe(), l = ft();
|
|
3075
|
+
return (r, a) => (M(), O("div", Qo, [
|
|
3076
|
+
r.$slots.header ? (M(), O("div", es, [
|
|
3077
|
+
P(r.$slots, "header", {}, void 0, !0)
|
|
3079
3078
|
])) : K("", !0),
|
|
3080
|
-
B("div",
|
|
3081
|
-
B("div",
|
|
3082
|
-
r.$slots.prefix ? (M(), O("div",
|
|
3083
|
-
|
|
3079
|
+
B("div", ts, [
|
|
3080
|
+
B("div", ns, [
|
|
3081
|
+
r.$slots.prefix ? (M(), O("div", os, [
|
|
3082
|
+
P(r.$slots, "prefix", {}, void 0, !0)
|
|
3084
3083
|
])) : K("", !0),
|
|
3085
|
-
B("div",
|
|
3086
|
-
|
|
3087
|
-
oe(
|
|
3084
|
+
B("div", ss, [
|
|
3085
|
+
P(r.$slots, "content", { editor: L(t) }, () => [
|
|
3086
|
+
oe(Xt)
|
|
3088
3087
|
], !0)
|
|
3089
3088
|
])
|
|
3090
3089
|
]),
|
|
3091
3090
|
B("div", {
|
|
3092
|
-
class:
|
|
3091
|
+
class: Q(["tr-sender-actions-inline", { "has-content": L(n) || L(o) }])
|
|
3093
3092
|
}, [
|
|
3094
|
-
L(i) && L(s) ? (M(), G(L(
|
|
3095
|
-
|
|
3096
|
-
oe(L(
|
|
3093
|
+
L(i) && L(s) ? (M(), G(L(St), { key: 0 })) : K("", !0),
|
|
3094
|
+
P(r.$slots, "actions-inline", he(ge(L(l))), void 0, !0),
|
|
3095
|
+
oe(L(Ct))
|
|
3097
3096
|
], 2)
|
|
3098
3097
|
])
|
|
3099
3098
|
]));
|
|
3100
3099
|
}
|
|
3101
|
-
}),
|
|
3100
|
+
}), is = /* @__PURE__ */ j(rs, [["__scopeId", "data-v-87bc03b2"]]), ls = {
|
|
3102
3101
|
key: 0,
|
|
3103
3102
|
class: "tr-sender-footer"
|
|
3104
|
-
},
|
|
3103
|
+
}, as = { class: "tr-sender-footer-left" }, cs = { class: "tr-sender-footer-right" }, us = /* @__PURE__ */ Y({
|
|
3105
3104
|
__name: "index",
|
|
3106
3105
|
setup(e) {
|
|
3107
|
-
const { mode: t, showWordLimit: n, maxLength: o } =
|
|
3108
|
-
return (s, l) => L(t) === "multiple" ? (M(), O("div",
|
|
3109
|
-
B("div",
|
|
3110
|
-
|
|
3106
|
+
const { mode: t, showWordLimit: n, maxLength: o } = Oe(), i = ft();
|
|
3107
|
+
return (s, l) => L(t) === "multiple" ? (M(), O("div", ls, [
|
|
3108
|
+
B("div", as, [
|
|
3109
|
+
P(s.$slots, "footer", he(ge(L(i))), void 0, !0)
|
|
3111
3110
|
]),
|
|
3112
|
-
B("div",
|
|
3113
|
-
L(n) && L(o) ? (M(), G(L(
|
|
3114
|
-
|
|
3115
|
-
oe(L(
|
|
3111
|
+
B("div", cs, [
|
|
3112
|
+
L(n) && L(o) ? (M(), G(L(St), { key: 0 })) : K("", !0),
|
|
3113
|
+
P(s.$slots, "footer-right", he(ge(L(i))), void 0, !0),
|
|
3114
|
+
oe(L(Ct))
|
|
3116
3115
|
])
|
|
3117
3116
|
])) : K("", !0);
|
|
3118
3117
|
}
|
|
3119
|
-
}),
|
|
3118
|
+
}), ds = /* @__PURE__ */ j(us, [["__scopeId", "data-v-3a92a161"]]), fs = { class: "tr-sender-multi-layout" }, ps = {
|
|
3120
3119
|
key: 0,
|
|
3121
3120
|
class: "tr-sender-header"
|
|
3122
|
-
},
|
|
3121
|
+
}, ms = { class: "tr-sender-main" }, hs = {
|
|
3123
3122
|
key: 0,
|
|
3124
3123
|
class: "tr-sender-prefix"
|
|
3125
|
-
},
|
|
3124
|
+
}, gs = { class: "tr-sender-content" }, ys = /* @__PURE__ */ Y({
|
|
3126
3125
|
__name: "MultiLineLayout",
|
|
3127
3126
|
setup(e) {
|
|
3128
|
-
const t =
|
|
3129
|
-
return (o, i) => (M(), O("div",
|
|
3130
|
-
o.$slots.header ? (M(), O("div",
|
|
3131
|
-
|
|
3127
|
+
const t = Oe(), n = ft();
|
|
3128
|
+
return (o, i) => (M(), O("div", fs, [
|
|
3129
|
+
o.$slots.header ? (M(), O("div", ps, [
|
|
3130
|
+
P(o.$slots, "header", {}, void 0, !0)
|
|
3132
3131
|
])) : K("", !0),
|
|
3133
|
-
B("div",
|
|
3134
|
-
o.$slots.prefix ? (M(), O("div",
|
|
3135
|
-
|
|
3132
|
+
B("div", ms, [
|
|
3133
|
+
o.$slots.prefix ? (M(), O("div", hs, [
|
|
3134
|
+
P(o.$slots, "prefix", {}, void 0, !0)
|
|
3136
3135
|
])) : K("", !0),
|
|
3137
|
-
B("div",
|
|
3138
|
-
|
|
3136
|
+
B("div", gs, [
|
|
3137
|
+
P(o.$slots, "content", {
|
|
3139
3138
|
editor: L(t).editor
|
|
3140
3139
|
}, () => [
|
|
3141
|
-
oe(
|
|
3140
|
+
oe(Xt)
|
|
3142
3141
|
], !0)
|
|
3143
3142
|
])
|
|
3144
3143
|
]),
|
|
3145
|
-
oe(
|
|
3144
|
+
oe(ds, null, {
|
|
3146
3145
|
footer: $(() => [
|
|
3147
|
-
|
|
3146
|
+
P(o.$slots, "footer", he(ge(L(n))), void 0, !0)
|
|
3148
3147
|
]),
|
|
3149
3148
|
"footer-right": $(() => [
|
|
3150
|
-
|
|
3149
|
+
P(o.$slots, "footer-right", he(ge(L(n))), void 0, !0)
|
|
3151
3150
|
]),
|
|
3152
3151
|
_: 3
|
|
3153
3152
|
})
|
|
3154
3153
|
]));
|
|
3155
3154
|
}
|
|
3156
|
-
}),
|
|
3155
|
+
}), xs = /* @__PURE__ */ j(ys, [["__scopeId", "data-v-0b507198"]]), Ts = /* @__PURE__ */ Y({
|
|
3157
3156
|
__name: "index",
|
|
3158
3157
|
props: {
|
|
3159
3158
|
modelValue: {},
|
|
@@ -3176,9 +3175,9 @@ const ns = { class: "tr-sender-editor-scroll" }, os = /* @__PURE__ */ j({
|
|
|
3176
3175
|
},
|
|
3177
3176
|
emits: ["update:modelValue", "submit", "focus", "blur", "clear", "cancel", "input"],
|
|
3178
3177
|
setup(e, { expose: t, emit: n }) {
|
|
3179
|
-
const o = e, i = n, { context: s, expose: l } =
|
|
3178
|
+
const o = e, i = n, { context: s, expose: l } = jo(o, i);
|
|
3180
3179
|
return t(l), (r, a) => (M(), O("div", {
|
|
3181
|
-
class:
|
|
3180
|
+
class: Q([
|
|
3182
3181
|
"tr-sender",
|
|
3183
3182
|
`tr-sender--${L(s).mode.value}`,
|
|
3184
3183
|
`tr-sender--${L(s).size.value}`,
|
|
@@ -3188,90 +3187,90 @@ const ns = { class: "tr-sender-editor-scroll" }, os = /* @__PURE__ */ j({
|
|
|
3188
3187
|
}
|
|
3189
3188
|
])
|
|
3190
3189
|
}, [
|
|
3191
|
-
L(s).mode.value === "single" ? (M(), G(
|
|
3190
|
+
L(s).mode.value === "single" ? (M(), G(is, { key: 0 }, ht({ _: 2 }, [
|
|
3192
3191
|
r.$slots.header ? {
|
|
3193
3192
|
name: "header",
|
|
3194
3193
|
fn: $(() => [
|
|
3195
|
-
|
|
3194
|
+
P(r.$slots, "header", {}, void 0, !0)
|
|
3196
3195
|
]),
|
|
3197
3196
|
key: "0"
|
|
3198
3197
|
} : void 0,
|
|
3199
3198
|
r.$slots.prefix ? {
|
|
3200
3199
|
name: "prefix",
|
|
3201
3200
|
fn: $(() => [
|
|
3202
|
-
|
|
3201
|
+
P(r.$slots, "prefix", {}, void 0, !0)
|
|
3203
3202
|
]),
|
|
3204
3203
|
key: "1"
|
|
3205
3204
|
} : void 0,
|
|
3206
3205
|
r.$slots.content ? {
|
|
3207
3206
|
name: "content",
|
|
3208
3207
|
fn: $((c) => [
|
|
3209
|
-
|
|
3208
|
+
P(r.$slots, "content", he(ge(c)), void 0, !0)
|
|
3210
3209
|
]),
|
|
3211
3210
|
key: "2"
|
|
3212
3211
|
} : void 0,
|
|
3213
3212
|
r.$slots["actions-inline"] ? {
|
|
3214
3213
|
name: "actions-inline",
|
|
3215
3214
|
fn: $(() => [
|
|
3216
|
-
|
|
3215
|
+
P(r.$slots, "actions-inline", {}, void 0, !0)
|
|
3217
3216
|
]),
|
|
3218
3217
|
key: "3"
|
|
3219
3218
|
} : void 0
|
|
3220
|
-
]), 1024)) : (M(), G(
|
|
3219
|
+
]), 1024)) : (M(), G(xs, { key: 1 }, ht({ _: 2 }, [
|
|
3221
3220
|
r.$slots.header ? {
|
|
3222
3221
|
name: "header",
|
|
3223
3222
|
fn: $(() => [
|
|
3224
|
-
|
|
3223
|
+
P(r.$slots, "header", {}, void 0, !0)
|
|
3225
3224
|
]),
|
|
3226
3225
|
key: "0"
|
|
3227
3226
|
} : void 0,
|
|
3228
3227
|
r.$slots.prefix ? {
|
|
3229
3228
|
name: "prefix",
|
|
3230
3229
|
fn: $(() => [
|
|
3231
|
-
|
|
3230
|
+
P(r.$slots, "prefix", {}, void 0, !0)
|
|
3232
3231
|
]),
|
|
3233
3232
|
key: "1"
|
|
3234
3233
|
} : void 0,
|
|
3235
3234
|
r.$slots.content ? {
|
|
3236
3235
|
name: "content",
|
|
3237
3236
|
fn: $((c) => [
|
|
3238
|
-
|
|
3237
|
+
P(r.$slots, "content", he(ge(c)), void 0, !0)
|
|
3239
3238
|
]),
|
|
3240
3239
|
key: "2"
|
|
3241
3240
|
} : void 0,
|
|
3242
3241
|
r.$slots.footer ? {
|
|
3243
3242
|
name: "footer",
|
|
3244
3243
|
fn: $(() => [
|
|
3245
|
-
|
|
3244
|
+
P(r.$slots, "footer", {}, void 0, !0)
|
|
3246
3245
|
]),
|
|
3247
3246
|
key: "3"
|
|
3248
3247
|
} : void 0,
|
|
3249
3248
|
r.$slots["footer-right"] ? {
|
|
3250
3249
|
name: "footer-right",
|
|
3251
3250
|
fn: $(() => [
|
|
3252
|
-
|
|
3251
|
+
P(r.$slots, "footer-right", {}, void 0, !0)
|
|
3253
3252
|
]),
|
|
3254
3253
|
key: "4"
|
|
3255
3254
|
} : void 0
|
|
3256
3255
|
]), 1024))
|
|
3257
3256
|
], 2));
|
|
3258
3257
|
}
|
|
3259
|
-
}),
|
|
3260
|
-
|
|
3261
|
-
const
|
|
3262
|
-
e.component(
|
|
3263
|
-
},
|
|
3264
|
-
install:
|
|
3258
|
+
}), Ke = /* @__PURE__ */ j(Ts, [["__scopeId", "data-v-6c700cc1"]]);
|
|
3259
|
+
Ke.name = "TrSender";
|
|
3260
|
+
const vs = function(e) {
|
|
3261
|
+
e.component(Ke.name, Ke);
|
|
3262
|
+
}, Is = Object.assign(Ke, {
|
|
3263
|
+
install: vs,
|
|
3265
3264
|
// 扩展类(用于继承)
|
|
3266
|
-
Mention:
|
|
3267
|
-
Suggestion:
|
|
3268
|
-
Template:
|
|
3265
|
+
Mention: Ft,
|
|
3266
|
+
Suggestion: zt,
|
|
3267
|
+
Template: Ut,
|
|
3269
3268
|
// 便捷函数(用于简单场景)
|
|
3270
|
-
mention:
|
|
3271
|
-
suggestion:
|
|
3272
|
-
template:
|
|
3269
|
+
mention: yo,
|
|
3270
|
+
suggestion: Co,
|
|
3271
|
+
template: qo
|
|
3273
3272
|
});
|
|
3274
3273
|
export {
|
|
3275
|
-
|
|
3276
|
-
|
|
3274
|
+
Is as default,
|
|
3275
|
+
Oe as useSenderContext
|
|
3277
3276
|
};
|