@opentiny/tiny-robot 0.4.2-alpha.0 → 0.4.2-alpha.10
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/action-group/index.js +5 -5
- package/dist/anchor/index.js +856 -0
- package/dist/attachments/index.js +326 -269
- package/dist/bubble/index.js +10 -9
- package/dist/container/index.js +13 -13
- package/dist/dropdown-menu/index.js +17 -17
- package/dist/feedback/index.js +2 -2
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/index.d.ts +1306 -803
- package/dist/index.js +152 -137
- package/dist/index2.js +152 -126
- package/dist/index3.js +1 -1
- package/dist/index4.js +393 -324
- package/dist/index5.js +230 -177
- package/dist/index6.js +592 -503
- package/dist/index7.js +42 -42
- package/dist/layout/index.js +1243 -0
- package/dist/mcp-server-picker/index.js +178 -177
- package/dist/sender/index.js +1575 -1467
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +12 -12
- package/dist/suggestion-popover/index.js +122 -125
- package/dist/welcome/index.js +9 -9
- package/package.json +19 -13
- package/dist/no-data.js +0 -4
package/dist/sender/index.js
CHANGED
|
@@ -1,370 +1,360 @@
|
|
|
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 {
|
|
11
|
-
import { PluginKey as
|
|
12
|
-
import { DecorationSet as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { IconAssociate as
|
|
15
|
-
import { Node as
|
|
16
|
-
const
|
|
1
|
+
import { defineComponent as U, openBlock as k, createBlock as F, unref as L, withCtx as $, createTextVNode as ln, toDisplayString as fe, ref as H, watch as N, createElementBlock as M, Fragment as Pe, renderList as De, withModifiers as et, normalizeClass as Z, createCommentVNode as W, createElementVNode as B, nextTick as pe, isRef as _e, Transition as an, normalizeStyle as cn, createVNode as ne, toRaw as un, computed as I, onMounted as dn, onUnmounted as fn, Teleport as pn, toRef as Oe, onBeforeUnmount as mn, provide as hn, renderSlot as O, createSlots as Ie, normalizeProps as me, guardReactiveProps as he } from "vue";
|
|
2
|
+
import { a as gn, u as Me, W as Rt, D as Ot } from "../index2.js";
|
|
3
|
+
import { NodeViewWrapper as rt, VueRenderer as Pt, VueNodeViewRenderer as it, NodeViewContent as xn, useEditor as yn, EditorContent as bn } from "@tiptap/vue-3";
|
|
4
|
+
import vn from "@tiptap/extension-document";
|
|
5
|
+
import Tn from "@tiptap/extension-paragraph";
|
|
6
|
+
import En from "@tiptap/extension-text";
|
|
7
|
+
import wn from "@tiptap/extension-history";
|
|
8
|
+
import An from "@tiptap/extension-placeholder";
|
|
9
|
+
import Cn from "@tiptap/extension-character-count";
|
|
10
|
+
import { h as Sn, j as _n, p as Ln } from "../index4.js";
|
|
11
|
+
import { PluginKey as oe, Plugin as se, TextSelection as R } from "@tiptap/pm/state";
|
|
12
|
+
import { DecorationSet as Se, Decoration as Dt } from "@tiptap/pm/view";
|
|
13
|
+
import { _ as X } from "../_plugin-vue_export-helper.js";
|
|
14
|
+
import { IconAssociate as kn, IconArrowDown as Mn } from "@opentiny/tiny-robot-svgs";
|
|
15
|
+
import { Node as lt, mergeAttributes as at, Extension as It } from "@tiptap/core";
|
|
16
|
+
const Rn = /* @__PURE__ */ U({
|
|
17
17
|
__name: "mention-view",
|
|
18
18
|
props: {
|
|
19
19
|
node: {},
|
|
20
20
|
extension: {}
|
|
21
21
|
},
|
|
22
22
|
setup(e) {
|
|
23
|
-
return (t, n) => (
|
|
23
|
+
return (t, n) => (k(), F(L(rt), {
|
|
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
|
+
ln(fe(e.extension.options.char) + fe(e.node.attrs.label), 1)
|
|
31
31
|
]),
|
|
32
32
|
_: 1
|
|
33
33
|
}, 8, ["data-id", "data-value"]));
|
|
34
34
|
}
|
|
35
|
-
}),
|
|
35
|
+
}), On = /* @__PURE__ */ X(Rn, [["__scopeId", "data-v-b42c4fae"]]), Be = Math.min, de = Math.max, $e = Math.round, Re = Math.floor, J = (e) => ({
|
|
36
36
|
x: e,
|
|
37
37
|
y: e
|
|
38
|
-
}),
|
|
38
|
+
}), Pn = {
|
|
39
39
|
left: "right",
|
|
40
40
|
right: "left",
|
|
41
41
|
bottom: "top",
|
|
42
42
|
top: "bottom"
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
return
|
|
44
|
+
function Dn(e, t, n) {
|
|
45
|
+
return de(e, Be(t, n));
|
|
46
46
|
}
|
|
47
47
|
function He(e, t) {
|
|
48
48
|
return typeof e == "function" ? e(t) : e;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Te(e) {
|
|
51
51
|
return e.split("-")[0];
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ze(e) {
|
|
54
54
|
return e.split("-")[1];
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Bt(e) {
|
|
57
57
|
return e === "x" ? "y" : "x";
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function $t(e) {
|
|
60
60
|
return e === "y" ? "height" : "width";
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function te(e) {
|
|
63
63
|
const t = e[0];
|
|
64
64
|
return t === "t" || t === "b" ? "y" : "x";
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function jt(e) {
|
|
67
|
+
return Bt(te(e));
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function In(e, t, n) {
|
|
70
70
|
n === void 0 && (n = !1);
|
|
71
|
-
const
|
|
72
|
-
let l =
|
|
73
|
-
return t.reference[
|
|
71
|
+
const s = ze(e), r = jt(e), o = $t(r);
|
|
72
|
+
let l = r === "x" ? s === (n ? "end" : "start") ? "right" : "left" : s === "start" ? "bottom" : "top";
|
|
73
|
+
return t.reference[o] > t.floating[o] && (l = je(l)), [l, je(l)];
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const t =
|
|
77
|
-
return [
|
|
75
|
+
function Bn(e) {
|
|
76
|
+
const t = je(e);
|
|
77
|
+
return [tt(e), t, tt(t)];
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function tt(e) {
|
|
80
80
|
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
function
|
|
82
|
+
const vt = ["left", "right"], Tt = ["right", "left"], $n = ["top", "bottom"], jn = ["bottom", "top"];
|
|
83
|
+
function Nn(e, t, n) {
|
|
84
84
|
switch (e) {
|
|
85
85
|
case "top":
|
|
86
86
|
case "bottom":
|
|
87
|
-
return n ? t ?
|
|
87
|
+
return n ? t ? Tt : vt : t ? vt : Tt;
|
|
88
88
|
case "left":
|
|
89
89
|
case "right":
|
|
90
|
-
return t ?
|
|
90
|
+
return t ? $n : jn;
|
|
91
91
|
default:
|
|
92
92
|
return [];
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
let
|
|
98
|
-
return
|
|
95
|
+
function Wn(e, t, n, s) {
|
|
96
|
+
const r = ze(e);
|
|
97
|
+
let o = Nn(Te(e), n === "start", s);
|
|
98
|
+
return r && (o = o.map((l) => l + "-" + r), t && (o = o.concat(o.map(tt)))), o;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
const t =
|
|
102
|
-
return
|
|
100
|
+
function je(e) {
|
|
101
|
+
const t = Te(e);
|
|
102
|
+
return Pn[t] + e.slice(t.length);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Kn(e) {
|
|
105
|
+
var t, n, s, r;
|
|
105
106
|
return {
|
|
106
|
-
top: 0,
|
|
107
|
-
right: 0,
|
|
108
|
-
bottom: 0,
|
|
109
|
-
left: 0
|
|
110
|
-
...e
|
|
107
|
+
top: (t = e.top) != null ? t : 0,
|
|
108
|
+
right: (n = e.right) != null ? n : 0,
|
|
109
|
+
bottom: (s = e.bottom) != null ? s : 0,
|
|
110
|
+
left: (r = e.left) != null ? r : 0
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return typeof e != "number" ?
|
|
113
|
+
function qn(e) {
|
|
114
|
+
return typeof e != "number" ? Kn(e) : {
|
|
115
115
|
top: e,
|
|
116
116
|
right: e,
|
|
117
117
|
bottom: e,
|
|
118
118
|
left: e
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Ne(e) {
|
|
122
122
|
const {
|
|
123
123
|
x: t,
|
|
124
124
|
y: n,
|
|
125
|
-
width:
|
|
126
|
-
height:
|
|
125
|
+
width: s,
|
|
126
|
+
height: r
|
|
127
127
|
} = e;
|
|
128
128
|
return {
|
|
129
|
-
width:
|
|
130
|
-
height:
|
|
129
|
+
width: s,
|
|
130
|
+
height: r,
|
|
131
131
|
top: n,
|
|
132
132
|
left: t,
|
|
133
|
-
right: t +
|
|
134
|
-
bottom: n +
|
|
133
|
+
right: t + s,
|
|
134
|
+
bottom: n + r,
|
|
135
135
|
x: t,
|
|
136
136
|
y: n
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Et(e, t, n) {
|
|
140
140
|
let {
|
|
141
|
-
reference:
|
|
142
|
-
floating:
|
|
141
|
+
reference: s,
|
|
142
|
+
floating: r
|
|
143
143
|
} = e;
|
|
144
|
-
const
|
|
145
|
-
let
|
|
144
|
+
const o = te(t), l = jt(t), i = $t(l), a = Te(t), c = o === "y", d = s.x + s.width / 2 - r.width / 2, u = s.y + s.height / 2 - r.height / 2, x = s[i] / 2 - r[i] / 2;
|
|
145
|
+
let g;
|
|
146
146
|
switch (a) {
|
|
147
147
|
case "top":
|
|
148
|
-
|
|
149
|
-
x:
|
|
150
|
-
y:
|
|
148
|
+
g = {
|
|
149
|
+
x: d,
|
|
150
|
+
y: s.y - r.height
|
|
151
151
|
};
|
|
152
152
|
break;
|
|
153
153
|
case "bottom":
|
|
154
|
-
|
|
155
|
-
x:
|
|
156
|
-
y:
|
|
154
|
+
g = {
|
|
155
|
+
x: d,
|
|
156
|
+
y: s.y + s.height
|
|
157
157
|
};
|
|
158
158
|
break;
|
|
159
159
|
case "right":
|
|
160
|
-
|
|
161
|
-
x:
|
|
160
|
+
g = {
|
|
161
|
+
x: s.x + s.width,
|
|
162
162
|
y: u
|
|
163
163
|
};
|
|
164
164
|
break;
|
|
165
165
|
case "left":
|
|
166
|
-
|
|
167
|
-
x:
|
|
166
|
+
g = {
|
|
167
|
+
x: s.x - r.width,
|
|
168
168
|
y: u
|
|
169
169
|
};
|
|
170
170
|
break;
|
|
171
171
|
default:
|
|
172
|
-
|
|
173
|
-
x:
|
|
174
|
-
y:
|
|
172
|
+
g = {
|
|
173
|
+
x: s.x,
|
|
174
|
+
y: s.y
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
y[l] -= T * (n && c ? -1 : 1);
|
|
180
|
-
break;
|
|
181
|
-
case "end":
|
|
182
|
-
y[l] += T * (n && c ? -1 : 1);
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
return y;
|
|
177
|
+
const E = ze(t);
|
|
178
|
+
return E && (g[l] += x * (E === "end" ? 1 : -1) * (n && c ? -1 : 1)), g;
|
|
186
179
|
}
|
|
187
|
-
async function
|
|
180
|
+
async function Hn(e, t) {
|
|
188
181
|
var n;
|
|
189
182
|
t === void 0 && (t = {});
|
|
190
183
|
const {
|
|
191
|
-
x:
|
|
192
|
-
y:
|
|
193
|
-
platform:
|
|
184
|
+
x: s,
|
|
185
|
+
y: r,
|
|
186
|
+
platform: o,
|
|
194
187
|
rects: l,
|
|
195
|
-
elements:
|
|
188
|
+
elements: i,
|
|
196
189
|
strategy: a
|
|
197
190
|
} = e, {
|
|
198
191
|
boundary: c = "clippingAncestors",
|
|
199
|
-
rootBoundary:
|
|
192
|
+
rootBoundary: d = "viewport",
|
|
200
193
|
elementContext: u = "floating",
|
|
201
|
-
altBoundary:
|
|
202
|
-
padding:
|
|
203
|
-
} = He(t, e),
|
|
204
|
-
element: (n = await (
|
|
194
|
+
altBoundary: x = !1,
|
|
195
|
+
padding: g = 0
|
|
196
|
+
} = He(t, e), E = qn(g), v = i[x ? u === "floating" ? "reference" : "floating" : u], h = Ne(await o.getClippingRect({
|
|
197
|
+
element: (n = await (o.isElement == null ? void 0 : o.isElement(v))) == null || n ? v : v.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(i.floating)),
|
|
205
198
|
boundary: c,
|
|
206
|
-
rootBoundary:
|
|
199
|
+
rootBoundary: d,
|
|
207
200
|
strategy: a
|
|
208
|
-
})),
|
|
209
|
-
x:
|
|
210
|
-
y:
|
|
201
|
+
})), b = u === "floating" ? {
|
|
202
|
+
x: s,
|
|
203
|
+
y: r,
|
|
211
204
|
width: l.floating.width,
|
|
212
205
|
height: l.floating.height
|
|
213
|
-
} : l.reference, p = await (
|
|
214
|
-
x: 1,
|
|
215
|
-
y: 1
|
|
216
|
-
} : {
|
|
206
|
+
} : l.reference, p = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(i.floating)), f = await (o.isElement == null ? void 0 : o.isElement(p)) && await (o.getScale == null ? void 0 : o.getScale(p)) || {
|
|
217
207
|
x: 1,
|
|
218
208
|
y: 1
|
|
219
|
-
}, m =
|
|
220
|
-
elements:
|
|
221
|
-
rect:
|
|
209
|
+
}, m = Ne(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
210
|
+
elements: i,
|
|
211
|
+
rect: b,
|
|
222
212
|
offsetParent: p,
|
|
223
213
|
strategy: a
|
|
224
|
-
}) :
|
|
214
|
+
}) : b);
|
|
225
215
|
return {
|
|
226
|
-
top: (h.top - m.top +
|
|
227
|
-
bottom: (m.bottom - h.bottom +
|
|
228
|
-
left: (h.left - m.left +
|
|
229
|
-
right: (m.right - h.right +
|
|
216
|
+
top: (h.top - m.top + E.top) / f.y,
|
|
217
|
+
bottom: (m.bottom - h.bottom + E.bottom) / f.y,
|
|
218
|
+
left: (h.left - m.left + E.left) / f.x,
|
|
219
|
+
right: (m.right - h.right + E.right) / f.x
|
|
230
220
|
};
|
|
231
221
|
}
|
|
232
|
-
const
|
|
222
|
+
const zn = 50, Fn = async (e, t, n) => {
|
|
233
223
|
const {
|
|
234
|
-
placement:
|
|
235
|
-
strategy:
|
|
236
|
-
middleware:
|
|
224
|
+
placement: s = "bottom",
|
|
225
|
+
strategy: r = "absolute",
|
|
226
|
+
middleware: o = [],
|
|
237
227
|
platform: l
|
|
238
|
-
} = n,
|
|
228
|
+
} = n, i = l.detectOverflow ? l : {
|
|
239
229
|
...l,
|
|
240
|
-
detectOverflow:
|
|
230
|
+
detectOverflow: Hn
|
|
241
231
|
}, a = await (l.isRTL == null ? void 0 : l.isRTL(t));
|
|
242
232
|
let c = await l.getElementRects({
|
|
243
233
|
reference: e,
|
|
244
234
|
floating: t,
|
|
245
|
-
strategy:
|
|
235
|
+
strategy: r
|
|
246
236
|
}), {
|
|
247
|
-
x:
|
|
237
|
+
x: d,
|
|
248
238
|
y: u
|
|
249
|
-
} =
|
|
250
|
-
const
|
|
251
|
-
for (let
|
|
252
|
-
const v =
|
|
239
|
+
} = Et(c, s, a), x = s, g = 0;
|
|
240
|
+
const E = {};
|
|
241
|
+
for (let w = 0; w < o.length; w++) {
|
|
242
|
+
const v = o[w];
|
|
253
243
|
if (!v)
|
|
254
244
|
continue;
|
|
255
245
|
const {
|
|
256
246
|
name: h,
|
|
257
|
-
fn:
|
|
247
|
+
fn: b
|
|
258
248
|
} = v, {
|
|
259
249
|
x: p,
|
|
260
|
-
y:
|
|
250
|
+
y: f,
|
|
261
251
|
data: m,
|
|
262
|
-
reset:
|
|
263
|
-
} = await
|
|
264
|
-
x:
|
|
252
|
+
reset: y
|
|
253
|
+
} = await b({
|
|
254
|
+
x: d,
|
|
265
255
|
y: u,
|
|
266
|
-
initialPlacement:
|
|
267
|
-
placement:
|
|
268
|
-
strategy:
|
|
269
|
-
middlewareData:
|
|
256
|
+
initialPlacement: s,
|
|
257
|
+
placement: x,
|
|
258
|
+
strategy: r,
|
|
259
|
+
middlewareData: E,
|
|
270
260
|
rects: c,
|
|
271
|
-
platform:
|
|
261
|
+
platform: i,
|
|
272
262
|
elements: {
|
|
273
263
|
reference: e,
|
|
274
264
|
floating: t
|
|
275
265
|
}
|
|
276
266
|
});
|
|
277
|
-
|
|
278
|
-
...
|
|
267
|
+
d = p ?? d, u = f ?? u, E[h] = {
|
|
268
|
+
...E[h],
|
|
279
269
|
...m
|
|
280
|
-
},
|
|
270
|
+
}, y && g < zn && (g++, typeof y == "object" && (y.placement && (x = y.placement), y.rects && (c = y.rects === !0 ? await l.getElementRects({
|
|
281
271
|
reference: e,
|
|
282
272
|
floating: t,
|
|
283
|
-
strategy:
|
|
284
|
-
}) :
|
|
285
|
-
x:
|
|
273
|
+
strategy: r
|
|
274
|
+
}) : y.rects), {
|
|
275
|
+
x: d,
|
|
286
276
|
y: u
|
|
287
|
-
} =
|
|
277
|
+
} = Et(c, x, a)), w = -1);
|
|
288
278
|
}
|
|
289
279
|
return {
|
|
290
|
-
x:
|
|
280
|
+
x: d,
|
|
291
281
|
y: u,
|
|
292
|
-
placement:
|
|
293
|
-
strategy:
|
|
294
|
-
middlewareData:
|
|
282
|
+
placement: x,
|
|
283
|
+
strategy: r,
|
|
284
|
+
middlewareData: E
|
|
295
285
|
};
|
|
296
|
-
},
|
|
286
|
+
}, Vn = function(e) {
|
|
297
287
|
return e === void 0 && (e = {}), {
|
|
298
288
|
name: "flip",
|
|
299
289
|
options: e,
|
|
300
290
|
async fn(t) {
|
|
301
|
-
var n,
|
|
291
|
+
var n, s;
|
|
302
292
|
const {
|
|
303
|
-
placement:
|
|
304
|
-
middlewareData:
|
|
293
|
+
placement: r,
|
|
294
|
+
middlewareData: o,
|
|
305
295
|
rects: l,
|
|
306
|
-
initialPlacement:
|
|
296
|
+
initialPlacement: i,
|
|
307
297
|
platform: a,
|
|
308
298
|
elements: c
|
|
309
299
|
} = t, {
|
|
310
|
-
mainAxis:
|
|
300
|
+
mainAxis: d = !0,
|
|
311
301
|
crossAxis: u = !0,
|
|
312
|
-
fallbackPlacements:
|
|
313
|
-
fallbackStrategy:
|
|
314
|
-
fallbackAxisSideDirection:
|
|
315
|
-
flipAlignment:
|
|
302
|
+
fallbackPlacements: x,
|
|
303
|
+
fallbackStrategy: g = "bestFit",
|
|
304
|
+
fallbackAxisSideDirection: E = "none",
|
|
305
|
+
flipAlignment: w = !0,
|
|
316
306
|
...v
|
|
317
307
|
} = He(e, t);
|
|
318
|
-
if ((n =
|
|
308
|
+
if ((n = o.arrow) != null && n.alignmentOffset)
|
|
319
309
|
return {};
|
|
320
|
-
const h =
|
|
321
|
-
!
|
|
322
|
-
const
|
|
323
|
-
let
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
|
|
310
|
+
const h = Te(r), b = te(i), p = Te(i) === i, f = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), m = x || (p || !w ? [je(i)] : Bn(i)), y = E !== "none";
|
|
311
|
+
!x && y && m.push(...Wn(i, w, E, f));
|
|
312
|
+
const T = [i, ...m], _ = await a.detectOverflow(t, v), S = [];
|
|
313
|
+
let D = ((s = o.flip) == null ? void 0 : s.overflows) || [];
|
|
314
|
+
if (d && S.push(_[h]), u) {
|
|
315
|
+
const le = In(r, l, f);
|
|
316
|
+
S.push(_[le[0]], _[le[1]]);
|
|
327
317
|
}
|
|
328
|
-
if (
|
|
329
|
-
placement:
|
|
330
|
-
overflows:
|
|
331
|
-
}], !
|
|
332
|
-
var
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
318
|
+
if (D = [...D, {
|
|
319
|
+
placement: r,
|
|
320
|
+
overflows: S
|
|
321
|
+
}], !S.every((le) => le <= 0)) {
|
|
322
|
+
var Y, yt;
|
|
323
|
+
const le = (((Y = o.flip) == null ? void 0 : Y.index) || 0) + 1, Ye = T[le];
|
|
324
|
+
if (Ye && (!(u === "alignment" ? b !== te(Ye) : !1) || // We leave the current main axis only if every placement on that axis
|
|
335
325
|
// overflows the main axis.
|
|
336
|
-
|
|
326
|
+
D.every((K) => te(K.placement) === b ? K.overflows[0] > 0 : !0)))
|
|
337
327
|
return {
|
|
338
328
|
data: {
|
|
339
|
-
index:
|
|
340
|
-
overflows:
|
|
329
|
+
index: le,
|
|
330
|
+
overflows: D
|
|
341
331
|
},
|
|
342
332
|
reset: {
|
|
343
|
-
placement:
|
|
333
|
+
placement: Ye
|
|
344
334
|
}
|
|
345
335
|
};
|
|
346
|
-
let Ce = (
|
|
336
|
+
let Ce = (yt = D.filter((ae) => ae.overflows[0] <= 0).sort((ae, K) => ae.overflows[1] - K.overflows[1])[0]) == null ? void 0 : yt.placement;
|
|
347
337
|
if (!Ce)
|
|
348
|
-
switch (
|
|
338
|
+
switch (g) {
|
|
349
339
|
case "bestFit": {
|
|
350
|
-
var
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const
|
|
354
|
-
return
|
|
340
|
+
var bt;
|
|
341
|
+
const ae = (bt = D.filter((K) => {
|
|
342
|
+
if (y) {
|
|
343
|
+
const ee = te(K.placement);
|
|
344
|
+
return ee === b || // Create a bias to the `y` side axis due to horizontal
|
|
355
345
|
// reading directions favoring greater width.
|
|
356
|
-
|
|
346
|
+
ee === "y";
|
|
357
347
|
}
|
|
358
348
|
return !0;
|
|
359
|
-
}).map((
|
|
360
|
-
|
|
349
|
+
}).map((K) => [K.placement, K.overflows.filter((ee) => ee > 0).reduce((ee, rn) => ee + rn, 0)]).sort((K, ee) => K[1] - ee[1])[0]) == null ? void 0 : bt[0];
|
|
350
|
+
ae && (Ce = ae);
|
|
361
351
|
break;
|
|
362
352
|
}
|
|
363
353
|
case "initialPlacement":
|
|
364
|
-
Ce =
|
|
354
|
+
Ce = i;
|
|
365
355
|
break;
|
|
366
356
|
}
|
|
367
|
-
if (
|
|
357
|
+
if (r !== Ce)
|
|
368
358
|
return {
|
|
369
359
|
reset: {
|
|
370
360
|
placement: Ce
|
|
@@ -374,17 +364,17 @@ const Pn = 50, Dn = async (e, t, n) => {
|
|
|
374
364
|
return {};
|
|
375
365
|
}
|
|
376
366
|
};
|
|
377
|
-
},
|
|
378
|
-
async function
|
|
367
|
+
}, Gn = /* @__PURE__ */ new Set(["left", "top"]);
|
|
368
|
+
async function Un(e, t) {
|
|
379
369
|
const {
|
|
380
370
|
placement: n,
|
|
381
|
-
platform:
|
|
382
|
-
elements:
|
|
383
|
-
} = e,
|
|
371
|
+
platform: s,
|
|
372
|
+
elements: r
|
|
373
|
+
} = e, o = await (s.isRTL == null ? void 0 : s.isRTL(r.floating)), l = Te(n), i = ze(n), a = te(n) === "y", c = Gn.has(l) ? -1 : 1, d = o && a ? -1 : 1, u = He(t, e);
|
|
384
374
|
let {
|
|
385
|
-
mainAxis:
|
|
386
|
-
crossAxis:
|
|
387
|
-
alignmentAxis:
|
|
375
|
+
mainAxis: x,
|
|
376
|
+
crossAxis: g,
|
|
377
|
+
alignmentAxis: E
|
|
388
378
|
} = typeof u == "number" ? {
|
|
389
379
|
mainAxis: u,
|
|
390
380
|
crossAxis: 0,
|
|
@@ -394,29 +384,29 @@ async function In(e, t) {
|
|
|
394
384
|
crossAxis: u.crossAxis || 0,
|
|
395
385
|
alignmentAxis: u.alignmentAxis
|
|
396
386
|
};
|
|
397
|
-
return
|
|
398
|
-
x:
|
|
399
|
-
y:
|
|
387
|
+
return i && typeof E == "number" && (g = i === "end" ? E * -1 : E), a ? {
|
|
388
|
+
x: g * d,
|
|
389
|
+
y: x * c
|
|
400
390
|
} : {
|
|
401
|
-
x:
|
|
402
|
-
y:
|
|
391
|
+
x: x * c,
|
|
392
|
+
y: g * d
|
|
403
393
|
};
|
|
404
394
|
}
|
|
405
|
-
const
|
|
395
|
+
const Xn = function(e) {
|
|
406
396
|
return e === void 0 && (e = 0), {
|
|
407
397
|
name: "offset",
|
|
408
398
|
options: e,
|
|
409
399
|
async fn(t) {
|
|
410
|
-
var n,
|
|
400
|
+
var n, s;
|
|
411
401
|
const {
|
|
412
|
-
x:
|
|
413
|
-
y:
|
|
402
|
+
x: r,
|
|
403
|
+
y: o,
|
|
414
404
|
placement: l,
|
|
415
|
-
middlewareData:
|
|
416
|
-
} = t, a = await
|
|
417
|
-
return l === ((n =
|
|
418
|
-
x:
|
|
419
|
-
y:
|
|
405
|
+
middlewareData: i
|
|
406
|
+
} = t, a = await Un(t, e);
|
|
407
|
+
return l === ((n = i.offset) == null ? void 0 : n.placement) && (s = i.arrow) != null && s.alignmentOffset ? {} : {
|
|
408
|
+
x: r + a.x,
|
|
409
|
+
y: o + a.y,
|
|
420
410
|
data: {
|
|
421
411
|
...a,
|
|
422
412
|
placement: l
|
|
@@ -424,103 +414,97 @@ const $n = function(e) {
|
|
|
424
414
|
};
|
|
425
415
|
}
|
|
426
416
|
};
|
|
427
|
-
},
|
|
417
|
+
}, Yn = function(e) {
|
|
428
418
|
return e === void 0 && (e = {}), {
|
|
429
419
|
name: "shift",
|
|
430
420
|
options: e,
|
|
431
421
|
async fn(t) {
|
|
432
422
|
const {
|
|
433
423
|
x: n,
|
|
434
|
-
y:
|
|
435
|
-
placement:
|
|
436
|
-
platform:
|
|
424
|
+
y: s,
|
|
425
|
+
placement: r,
|
|
426
|
+
platform: o
|
|
437
427
|
} = t, {
|
|
438
428
|
mainAxis: l = !0,
|
|
439
|
-
crossAxis:
|
|
429
|
+
crossAxis: i = !1,
|
|
440
430
|
limiter: a = {
|
|
441
|
-
fn: (
|
|
431
|
+
fn: (b) => {
|
|
442
432
|
let {
|
|
443
|
-
x,
|
|
444
|
-
y:
|
|
445
|
-
} =
|
|
433
|
+
x: p,
|
|
434
|
+
y: f
|
|
435
|
+
} = b;
|
|
446
436
|
return {
|
|
447
|
-
x,
|
|
448
|
-
y:
|
|
437
|
+
x: p,
|
|
438
|
+
y: f
|
|
449
439
|
};
|
|
450
440
|
}
|
|
451
441
|
},
|
|
452
442
|
...c
|
|
453
|
-
} = He(e, t),
|
|
443
|
+
} = He(e, t), d = {
|
|
454
444
|
x: n,
|
|
455
|
-
y:
|
|
456
|
-
}, u = await
|
|
457
|
-
let
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
if (r) {
|
|
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);
|
|
465
|
-
}
|
|
466
|
-
const v = a.fn({
|
|
445
|
+
y: s
|
|
446
|
+
}, u = await o.detectOverflow(t, c), x = te(r), g = Bt(x);
|
|
447
|
+
let E = d[g], w = d[x];
|
|
448
|
+
const v = (b, p) => Dn(p + u[b === "y" ? "top" : "left"], p, p - u[b === "y" ? "bottom" : "right"]);
|
|
449
|
+
l && (E = v(g, E)), i && (w = v(x, w));
|
|
450
|
+
const h = a.fn({
|
|
467
451
|
...t,
|
|
468
|
-
[
|
|
469
|
-
[
|
|
452
|
+
[g]: E,
|
|
453
|
+
[x]: w
|
|
470
454
|
});
|
|
471
455
|
return {
|
|
472
|
-
...
|
|
456
|
+
...h,
|
|
473
457
|
data: {
|
|
474
|
-
x:
|
|
475
|
-
y:
|
|
458
|
+
x: h.x - n,
|
|
459
|
+
y: h.y - s,
|
|
476
460
|
enabled: {
|
|
477
|
-
[
|
|
478
|
-
[
|
|
461
|
+
[g]: l,
|
|
462
|
+
[x]: i
|
|
479
463
|
}
|
|
480
464
|
}
|
|
481
465
|
};
|
|
482
466
|
}
|
|
483
467
|
};
|
|
484
468
|
};
|
|
485
|
-
function
|
|
469
|
+
function Fe() {
|
|
486
470
|
return typeof window < "u";
|
|
487
471
|
}
|
|
488
|
-
function
|
|
489
|
-
return
|
|
472
|
+
function Ae(e) {
|
|
473
|
+
return Nt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
490
474
|
}
|
|
491
|
-
function
|
|
475
|
+
function j(e) {
|
|
492
476
|
var t;
|
|
493
477
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
494
478
|
}
|
|
495
|
-
function
|
|
479
|
+
function Q(e) {
|
|
496
480
|
var t;
|
|
497
|
-
return (t = (
|
|
481
|
+
return (t = (Nt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
498
482
|
}
|
|
499
|
-
function
|
|
500
|
-
return
|
|
483
|
+
function Nt(e) {
|
|
484
|
+
return Fe() ? e instanceof Node || e instanceof j(e).Node : !1;
|
|
501
485
|
}
|
|
502
|
-
function
|
|
503
|
-
return
|
|
486
|
+
function V(e) {
|
|
487
|
+
return Fe() ? e instanceof Element || e instanceof j(e).Element : !1;
|
|
504
488
|
}
|
|
505
|
-
function
|
|
506
|
-
return
|
|
489
|
+
function re(e) {
|
|
490
|
+
return Fe() ? e instanceof HTMLElement || e instanceof j(e).HTMLElement : !1;
|
|
507
491
|
}
|
|
508
|
-
function
|
|
509
|
-
return !
|
|
492
|
+
function wt(e) {
|
|
493
|
+
return !Fe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof j(e).ShadowRoot;
|
|
510
494
|
}
|
|
511
|
-
function
|
|
495
|
+
function Ve(e) {
|
|
512
496
|
const {
|
|
513
497
|
overflow: t,
|
|
514
498
|
overflowX: n,
|
|
515
|
-
overflowY:
|
|
516
|
-
display:
|
|
517
|
-
} =
|
|
518
|
-
return /auto|scroll|overlay|hidden|clip/.test(t +
|
|
499
|
+
overflowY: s,
|
|
500
|
+
display: r
|
|
501
|
+
} = G(e);
|
|
502
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + s + n) && r !== "inline" && r !== "contents";
|
|
519
503
|
}
|
|
520
|
-
function
|
|
521
|
-
return /^(table|td|th)$/.test(
|
|
504
|
+
function Zn(e) {
|
|
505
|
+
return /^(table|td|th)$/.test(Ae(e));
|
|
522
506
|
}
|
|
523
|
-
function
|
|
507
|
+
function Ge(e) {
|
|
524
508
|
try {
|
|
525
509
|
if (e.matches(":popover-open"))
|
|
526
510
|
return !0;
|
|
@@ -532,34 +516,34 @@ function ze(e) {
|
|
|
532
516
|
return !1;
|
|
533
517
|
}
|
|
534
518
|
}
|
|
535
|
-
const
|
|
536
|
-
let
|
|
537
|
-
function
|
|
538
|
-
const t =
|
|
539
|
-
return
|
|
519
|
+
const Jn = /transform|translate|scale|rotate|perspective|filter/, Qn = /paint|layout|strict|content/, ce = (e) => !!e && e !== "none";
|
|
520
|
+
let Ze;
|
|
521
|
+
function ct(e) {
|
|
522
|
+
const t = V(e) ? G(e) : e;
|
|
523
|
+
return ce(t.transform) || ce(t.translate) || ce(t.scale) || ce(t.rotate) || ce(t.perspective) || !ut() && (ce(t.backdropFilter) || ce(t.filter)) || Jn.test(t.willChange || "") || Qn.test(t.contain || "");
|
|
540
524
|
}
|
|
541
|
-
function
|
|
542
|
-
let t =
|
|
543
|
-
for (;
|
|
544
|
-
if (
|
|
525
|
+
function eo(e) {
|
|
526
|
+
let t = ge(e);
|
|
527
|
+
for (; re(t) && !Le(t); ) {
|
|
528
|
+
if (ct(t))
|
|
545
529
|
return t;
|
|
546
|
-
if (
|
|
530
|
+
if (Ge(t))
|
|
547
531
|
return null;
|
|
548
|
-
t =
|
|
532
|
+
t = ge(t);
|
|
549
533
|
}
|
|
550
534
|
return null;
|
|
551
535
|
}
|
|
552
|
-
function
|
|
553
|
-
return
|
|
536
|
+
function ut() {
|
|
537
|
+
return Ze == null && (Ze = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), Ze;
|
|
554
538
|
}
|
|
555
|
-
function
|
|
556
|
-
return /^(html|body|#document)$/.test(
|
|
539
|
+
function Le(e) {
|
|
540
|
+
return /^(html|body|#document)$/.test(Ae(e));
|
|
557
541
|
}
|
|
558
|
-
function
|
|
559
|
-
return
|
|
542
|
+
function G(e) {
|
|
543
|
+
return j(e).getComputedStyle(e);
|
|
560
544
|
}
|
|
561
|
-
function
|
|
562
|
-
return
|
|
545
|
+
function Ue(e) {
|
|
546
|
+
return V(e) ? {
|
|
563
547
|
scrollLeft: e.scrollLeft,
|
|
564
548
|
scrollTop: e.scrollTop
|
|
565
549
|
} : {
|
|
@@ -567,449 +551,441 @@ function qe(e) {
|
|
|
567
551
|
scrollTop: e.scrollY
|
|
568
552
|
};
|
|
569
553
|
}
|
|
570
|
-
function
|
|
571
|
-
if (
|
|
554
|
+
function ge(e) {
|
|
555
|
+
if (Ae(e) === "html")
|
|
572
556
|
return e;
|
|
573
557
|
const t = (
|
|
574
558
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
575
559
|
e.assignedSlot || // DOM Element detected.
|
|
576
560
|
e.parentNode || // ShadowRoot detected.
|
|
577
|
-
|
|
578
|
-
|
|
561
|
+
wt(e) && e.host || // Fallback.
|
|
562
|
+
Q(e)
|
|
579
563
|
);
|
|
580
|
-
return
|
|
564
|
+
return wt(t) ? t.host : t;
|
|
581
565
|
}
|
|
582
|
-
function
|
|
583
|
-
const t =
|
|
584
|
-
return
|
|
566
|
+
function Wt(e) {
|
|
567
|
+
const t = ge(e);
|
|
568
|
+
return Le(t) ? (e.ownerDocument || e).body : re(t) && Ve(t) ? t : Wt(t);
|
|
585
569
|
}
|
|
586
|
-
function
|
|
587
|
-
var
|
|
570
|
+
function ke(e, t, n) {
|
|
571
|
+
var s;
|
|
588
572
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
589
|
-
const
|
|
590
|
-
if (
|
|
591
|
-
const
|
|
592
|
-
return t.concat(l, l.visualViewport || [],
|
|
573
|
+
const r = Wt(e), o = r === ((s = e.ownerDocument) == null ? void 0 : s.body), l = j(r);
|
|
574
|
+
if (o) {
|
|
575
|
+
const i = nt(l);
|
|
576
|
+
return t.concat(l, l.visualViewport || [], Ve(r) ? r : [], i && n ? ke(i) : []);
|
|
593
577
|
} else
|
|
594
|
-
return t.concat(
|
|
578
|
+
return t.concat(r, ke(r, [], n));
|
|
595
579
|
}
|
|
596
|
-
function
|
|
580
|
+
function nt(e) {
|
|
597
581
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
598
582
|
}
|
|
599
|
-
function
|
|
600
|
-
const t =
|
|
601
|
-
let n = parseFloat(t.width) || 0,
|
|
602
|
-
const
|
|
603
|
-
return
|
|
583
|
+
function Kt(e) {
|
|
584
|
+
const t = G(e);
|
|
585
|
+
let n = parseFloat(t.width) || 0, s = parseFloat(t.height) || 0;
|
|
586
|
+
const r = re(e), o = r ? e.offsetWidth : n, l = r ? e.offsetHeight : s, i = $e(n) !== o || $e(s) !== l;
|
|
587
|
+
return i && (n = o, s = l), {
|
|
604
588
|
width: n,
|
|
605
|
-
height:
|
|
606
|
-
$:
|
|
589
|
+
height: s,
|
|
590
|
+
$: i
|
|
607
591
|
};
|
|
608
592
|
}
|
|
609
|
-
function
|
|
610
|
-
return
|
|
593
|
+
function dt(e) {
|
|
594
|
+
return V(e) ? e : e.contextElement;
|
|
611
595
|
}
|
|
612
|
-
function
|
|
613
|
-
const t =
|
|
614
|
-
if (!
|
|
615
|
-
return
|
|
596
|
+
function ve(e) {
|
|
597
|
+
const t = dt(e);
|
|
598
|
+
if (!re(t))
|
|
599
|
+
return J(1);
|
|
616
600
|
const n = t.getBoundingClientRect(), {
|
|
617
|
-
width:
|
|
618
|
-
height:
|
|
619
|
-
$:
|
|
620
|
-
} =
|
|
621
|
-
let l = (
|
|
622
|
-
return (!l || !Number.isFinite(l)) && (l = 1), (!
|
|
601
|
+
width: s,
|
|
602
|
+
height: r,
|
|
603
|
+
$: o
|
|
604
|
+
} = Kt(t);
|
|
605
|
+
let l = (o ? $e(n.width) : n.width) / s, i = (o ? $e(n.height) : n.height) / r;
|
|
606
|
+
return (!l || !Number.isFinite(l)) && (l = 1), (!i || !Number.isFinite(i)) && (i = 1), {
|
|
623
607
|
x: l,
|
|
624
|
-
y:
|
|
608
|
+
y: i
|
|
625
609
|
};
|
|
626
610
|
}
|
|
627
|
-
const
|
|
628
|
-
function
|
|
629
|
-
const t =
|
|
630
|
-
return !
|
|
611
|
+
const to = /* @__PURE__ */ J(0);
|
|
612
|
+
function qt(e) {
|
|
613
|
+
const t = j(e);
|
|
614
|
+
return !ut() || !t.visualViewport ? to : {
|
|
631
615
|
x: t.visualViewport.offsetLeft,
|
|
632
616
|
y: t.visualViewport.offsetTop
|
|
633
617
|
};
|
|
634
618
|
}
|
|
635
|
-
function
|
|
636
|
-
return t === void 0 && (t = !1),
|
|
619
|
+
function no(e, t, n) {
|
|
620
|
+
return t === void 0 && (t = !1), !!n && t && n === j(e);
|
|
637
621
|
}
|
|
638
|
-
function xe(e, t, n,
|
|
622
|
+
function xe(e, t, n, s) {
|
|
639
623
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
640
|
-
const
|
|
641
|
-
let l =
|
|
642
|
-
t && (
|
|
643
|
-
const
|
|
644
|
-
let a = (
|
|
645
|
-
if (s) {
|
|
646
|
-
const
|
|
647
|
-
let
|
|
648
|
-
for (;
|
|
649
|
-
const v =
|
|
650
|
-
a *= v.x, c *= v.y,
|
|
624
|
+
const r = e.getBoundingClientRect(), o = dt(e);
|
|
625
|
+
let l = J(1);
|
|
626
|
+
t && (s ? V(s) && (l = ve(s)) : l = ve(e));
|
|
627
|
+
const i = no(o, n, s) ? qt(o) : J(0);
|
|
628
|
+
let a = (r.left + i.x) / l.x, c = (r.top + i.y) / l.y, d = r.width / l.x, u = r.height / l.y;
|
|
629
|
+
if (o && s) {
|
|
630
|
+
const x = j(o), g = V(s) ? j(s) : s;
|
|
631
|
+
let E = x, w = nt(E);
|
|
632
|
+
for (; w && g !== E; ) {
|
|
633
|
+
const v = ve(w), h = w.getBoundingClientRect(), b = G(w), p = h.left + (w.clientLeft + parseFloat(b.paddingLeft)) * v.x, f = h.top + (w.clientTop + parseFloat(b.paddingTop)) * v.y;
|
|
634
|
+
a *= v.x, c *= v.y, d *= v.x, u *= v.y, a += p, c += f, E = j(w), w = nt(E);
|
|
651
635
|
}
|
|
652
636
|
}
|
|
653
|
-
return
|
|
654
|
-
width:
|
|
637
|
+
return Ne({
|
|
638
|
+
width: d,
|
|
655
639
|
height: u,
|
|
656
640
|
x: a,
|
|
657
641
|
y: c
|
|
658
642
|
});
|
|
659
643
|
}
|
|
660
|
-
function
|
|
661
|
-
const n =
|
|
662
|
-
return t ? t.left + n : xe(
|
|
644
|
+
function Xe(e, t) {
|
|
645
|
+
const n = Ue(e).scrollLeft;
|
|
646
|
+
return t ? t.left + n : xe(Q(e)).left + n;
|
|
663
647
|
}
|
|
664
|
-
function
|
|
665
|
-
const n = e.getBoundingClientRect(),
|
|
648
|
+
function Ht(e, t) {
|
|
649
|
+
const n = e.getBoundingClientRect(), s = n.left + t.scrollLeft - Xe(e, n), r = n.top + t.scrollTop;
|
|
666
650
|
return {
|
|
667
|
-
x:
|
|
668
|
-
y:
|
|
651
|
+
x: s,
|
|
652
|
+
y: r
|
|
669
653
|
};
|
|
670
654
|
}
|
|
671
|
-
function
|
|
655
|
+
function oo(e) {
|
|
672
656
|
let {
|
|
673
657
|
elements: t,
|
|
674
658
|
rect: n,
|
|
675
|
-
offsetParent:
|
|
676
|
-
strategy:
|
|
659
|
+
offsetParent: s,
|
|
660
|
+
strategy: r
|
|
677
661
|
} = e;
|
|
678
|
-
const
|
|
679
|
-
if (
|
|
662
|
+
const o = r === "fixed", l = Q(s), i = t ? Ge(t.floating) : !1;
|
|
663
|
+
if (s === l || i && o)
|
|
680
664
|
return n;
|
|
681
665
|
let a = {
|
|
682
666
|
scrollLeft: 0,
|
|
683
667
|
scrollTop: 0
|
|
684
|
-
}, c =
|
|
685
|
-
const
|
|
686
|
-
if ((u || !
|
|
687
|
-
const
|
|
688
|
-
c =
|
|
668
|
+
}, c = J(1);
|
|
669
|
+
const d = J(0), u = re(s);
|
|
670
|
+
if ((u || !o) && ((Ae(s) !== "body" || Ve(l)) && (a = Ue(s)), u)) {
|
|
671
|
+
const g = xe(s);
|
|
672
|
+
c = ve(s), d.x = g.x + s.clientLeft, d.y = g.y + s.clientTop;
|
|
689
673
|
}
|
|
690
|
-
const
|
|
674
|
+
const x = l && !u && !o ? Ht(l, a) : J(0);
|
|
691
675
|
return {
|
|
692
676
|
width: n.width * c.x,
|
|
693
677
|
height: n.height * c.y,
|
|
694
|
-
x: n.x * c.x - a.scrollLeft * c.x +
|
|
695
|
-
y: n.y * c.y - a.scrollTop * c.y +
|
|
678
|
+
x: n.x * c.x - a.scrollLeft * c.x + d.x + x.x,
|
|
679
|
+
y: n.y * c.y - a.scrollTop * c.y + d.y + x.y
|
|
696
680
|
};
|
|
697
681
|
}
|
|
698
|
-
function
|
|
699
|
-
return Array.from(e.getClientRects());
|
|
682
|
+
function so(e) {
|
|
683
|
+
return e.getClientRects ? Array.from(e.getClientRects()) : [];
|
|
700
684
|
}
|
|
701
|
-
function
|
|
702
|
-
const t =
|
|
703
|
-
let
|
|
704
|
-
const
|
|
705
|
-
return
|
|
706
|
-
width:
|
|
707
|
-
height:
|
|
708
|
-
x:
|
|
709
|
-
y:
|
|
685
|
+
function ro(e) {
|
|
686
|
+
const t = Ue(e), n = e.ownerDocument.body, s = de(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = de(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
687
|
+
let o = -t.scrollLeft + Xe(e);
|
|
688
|
+
const l = -t.scrollTop;
|
|
689
|
+
return G(n).direction === "rtl" && (o += de(e.clientWidth, n.clientWidth) - s), {
|
|
690
|
+
width: s,
|
|
691
|
+
height: r,
|
|
692
|
+
x: o,
|
|
693
|
+
y: l
|
|
710
694
|
};
|
|
711
695
|
}
|
|
712
|
-
const
|
|
713
|
-
function
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
const
|
|
719
|
-
|
|
696
|
+
const io = 25;
|
|
697
|
+
function lo(e, t, n) {
|
|
698
|
+
n === void 0 && (n = "viewport");
|
|
699
|
+
const s = n === "layoutViewport", r = j(e), o = Q(e), l = r.visualViewport;
|
|
700
|
+
let i = o.clientWidth, a = o.clientHeight, c = 0, d = 0;
|
|
701
|
+
if (l) {
|
|
702
|
+
const x = !ut() || t === "fixed";
|
|
703
|
+
s ? x || (c = -l.offsetLeft, d = -l.offsetTop) : (i = l.width, a = l.height, x && (c = l.offsetLeft, d = l.offsetTop));
|
|
704
|
+
}
|
|
705
|
+
if (Xe(o) <= 0) {
|
|
706
|
+
const x = o.ownerDocument, g = x.body, E = getComputedStyle(g), w = x.compatMode === "CSS1Compat" && parseFloat(E.marginLeft) + parseFloat(E.marginRight) || 0, v = Math.abs(o.clientWidth - g.clientWidth - w), h = getComputedStyle(o).scrollbarGutter === "stable both-edges" ? v / 2 : v;
|
|
707
|
+
h <= io && (i -= h);
|
|
720
708
|
}
|
|
721
|
-
const c = Ue(o);
|
|
722
|
-
if (c <= 0) {
|
|
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);
|
|
726
709
|
return {
|
|
727
|
-
width:
|
|
728
|
-
height:
|
|
729
|
-
x:
|
|
730
|
-
y:
|
|
710
|
+
width: i,
|
|
711
|
+
height: a,
|
|
712
|
+
x: c,
|
|
713
|
+
y: d
|
|
731
714
|
};
|
|
732
715
|
}
|
|
733
|
-
function
|
|
734
|
-
const n = xe(e, !0, t === "fixed"),
|
|
716
|
+
function ao(e, t) {
|
|
717
|
+
const n = xe(e, !0, t === "fixed"), s = n.top + e.clientTop, r = n.left + e.clientLeft, o = ve(e), l = e.clientWidth * o.x, i = e.clientHeight * o.y, a = r * o.x, c = s * o.y;
|
|
735
718
|
return {
|
|
736
719
|
width: l,
|
|
737
|
-
height:
|
|
720
|
+
height: i,
|
|
738
721
|
x: a,
|
|
739
722
|
y: c
|
|
740
723
|
};
|
|
741
724
|
}
|
|
742
|
-
function
|
|
743
|
-
let
|
|
744
|
-
if (t === "viewport")
|
|
745
|
-
|
|
725
|
+
function At(e, t, n) {
|
|
726
|
+
let s;
|
|
727
|
+
if (t === "viewport" || t === "layoutViewport")
|
|
728
|
+
s = lo(e, n, t);
|
|
746
729
|
else if (t === "document")
|
|
747
|
-
|
|
748
|
-
else if (
|
|
749
|
-
|
|
730
|
+
s = ro(Q(e));
|
|
731
|
+
else if (V(t))
|
|
732
|
+
s = ao(t, n);
|
|
750
733
|
else {
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
x: t.x -
|
|
754
|
-
y: t.y -
|
|
734
|
+
const r = qt(e);
|
|
735
|
+
s = {
|
|
736
|
+
x: t.x - r.x,
|
|
737
|
+
y: t.y - r.y,
|
|
755
738
|
width: t.width,
|
|
756
739
|
height: t.height
|
|
757
740
|
};
|
|
758
741
|
}
|
|
759
|
-
return
|
|
742
|
+
return Ne(s);
|
|
760
743
|
}
|
|
761
|
-
function
|
|
762
|
-
const n = se(e);
|
|
763
|
-
return n === t || !z(n) || we(n) ? !1 : q(n).position === "fixed" || Nt(n, t);
|
|
764
|
-
}
|
|
765
|
-
function jn(e, t) {
|
|
744
|
+
function co(e, t) {
|
|
766
745
|
const n = t.get(e);
|
|
767
746
|
if (n)
|
|
768
747
|
return n;
|
|
769
|
-
let
|
|
770
|
-
const
|
|
771
|
-
let l =
|
|
772
|
-
for (;
|
|
773
|
-
const
|
|
774
|
-
!a &&
|
|
748
|
+
let s = ke(e, [], !1).filter((i) => V(i) && Ae(i) !== "body"), r = null;
|
|
749
|
+
const o = G(e).position === "fixed";
|
|
750
|
+
let l = o ? ge(e) : e;
|
|
751
|
+
for (; V(l) && !Le(l); ) {
|
|
752
|
+
const i = G(l), a = ct(l), c = r ? r.position : o ? "fixed" : "";
|
|
753
|
+
!a && (c === "fixed" || c === "absolute" && i.position === "static") ? s = s.filter((u) => u !== l) : r = i, l = ge(l);
|
|
775
754
|
}
|
|
776
|
-
return t.set(e,
|
|
755
|
+
return t.set(e, s), s;
|
|
777
756
|
}
|
|
778
|
-
function
|
|
757
|
+
function uo(e) {
|
|
779
758
|
let {
|
|
780
759
|
element: t,
|
|
781
760
|
boundary: n,
|
|
782
|
-
rootBoundary:
|
|
783
|
-
strategy:
|
|
761
|
+
rootBoundary: s,
|
|
762
|
+
strategy: r
|
|
784
763
|
} = e;
|
|
785
|
-
const l = [...n === "clippingAncestors" ?
|
|
786
|
-
let a =
|
|
787
|
-
for (let
|
|
788
|
-
const
|
|
789
|
-
a =
|
|
764
|
+
const l = [...n === "clippingAncestors" ? Ge(t) ? [] : co(t, this._c) : [].concat(n), s], i = At(t, l[0], r);
|
|
765
|
+
let a = i.top, c = i.right, d = i.bottom, u = i.left;
|
|
766
|
+
for (let x = 1; x < l.length; x++) {
|
|
767
|
+
const g = At(t, l[x], r);
|
|
768
|
+
a = de(g.top, a), c = Be(g.right, c), d = Be(g.bottom, d), u = de(g.left, u);
|
|
790
769
|
}
|
|
791
770
|
return {
|
|
792
771
|
width: c - u,
|
|
793
|
-
height:
|
|
772
|
+
height: d - a,
|
|
794
773
|
x: u,
|
|
795
774
|
y: a
|
|
796
775
|
};
|
|
797
776
|
}
|
|
798
|
-
function
|
|
777
|
+
function fo(e) {
|
|
799
778
|
const {
|
|
800
779
|
width: t,
|
|
801
780
|
height: n
|
|
802
|
-
} =
|
|
781
|
+
} = Kt(e);
|
|
803
782
|
return {
|
|
804
783
|
width: t,
|
|
805
784
|
height: n
|
|
806
785
|
};
|
|
807
786
|
}
|
|
808
|
-
function
|
|
809
|
-
const
|
|
810
|
-
let
|
|
787
|
+
function po(e, t, n) {
|
|
788
|
+
const s = re(t), r = Q(t), o = n === "fixed", l = xe(e, !0, o, t);
|
|
789
|
+
let i = {
|
|
811
790
|
scrollLeft: 0,
|
|
812
791
|
scrollTop: 0
|
|
813
792
|
};
|
|
814
|
-
const a =
|
|
815
|
-
|
|
816
|
-
|
|
793
|
+
const a = J(0);
|
|
794
|
+
if ((s || !o) && ((Ae(t) !== "body" || Ve(r)) && (i = Ue(t)), s)) {
|
|
795
|
+
const x = xe(t, !0, o, t);
|
|
796
|
+
a.x = x.x + t.clientLeft, a.y = x.y + t.clientTop;
|
|
817
797
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
const y = xe(t, !0, s, t);
|
|
821
|
-
a.x = y.x + t.clientLeft, a.y = y.y + t.clientTop;
|
|
822
|
-
} else i && c();
|
|
823
|
-
s && !o && i && c();
|
|
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;
|
|
798
|
+
!s && r && (a.x = Xe(r));
|
|
799
|
+
const c = r && !s && !o ? Ht(r, i) : J(0), d = l.left + i.scrollLeft - a.x - c.x, u = l.top + i.scrollTop - a.y - c.y;
|
|
825
800
|
return {
|
|
826
|
-
x:
|
|
827
|
-
y:
|
|
801
|
+
x: d,
|
|
802
|
+
y: u,
|
|
828
803
|
width: l.width,
|
|
829
804
|
height: l.height
|
|
830
805
|
};
|
|
831
806
|
}
|
|
832
|
-
function
|
|
833
|
-
return
|
|
807
|
+
function Je(e) {
|
|
808
|
+
return G(e).position === "static";
|
|
834
809
|
}
|
|
835
|
-
function
|
|
836
|
-
if (!
|
|
810
|
+
function Ct(e, t) {
|
|
811
|
+
if (!re(e) || G(e).position === "fixed")
|
|
837
812
|
return null;
|
|
838
813
|
if (t)
|
|
839
814
|
return t(e);
|
|
840
815
|
let n = e.offsetParent;
|
|
841
|
-
return
|
|
816
|
+
return Q(e) === n && (n = n.ownerDocument.body), n;
|
|
842
817
|
}
|
|
843
|
-
function
|
|
844
|
-
const n =
|
|
845
|
-
if (
|
|
818
|
+
function zt(e, t) {
|
|
819
|
+
const n = j(e);
|
|
820
|
+
if (Ge(e))
|
|
846
821
|
return n;
|
|
847
|
-
if (!
|
|
848
|
-
let
|
|
849
|
-
for (;
|
|
850
|
-
if (
|
|
851
|
-
return
|
|
852
|
-
|
|
822
|
+
if (!re(e)) {
|
|
823
|
+
let r = ge(e);
|
|
824
|
+
for (; r && !Le(r); ) {
|
|
825
|
+
if (V(r) && !Je(r))
|
|
826
|
+
return r;
|
|
827
|
+
r = ge(r);
|
|
853
828
|
}
|
|
854
829
|
return n;
|
|
855
830
|
}
|
|
856
|
-
let
|
|
857
|
-
for (;
|
|
858
|
-
|
|
859
|
-
return
|
|
831
|
+
let s = Ct(e, t);
|
|
832
|
+
for (; s && Zn(s) && Je(s); )
|
|
833
|
+
s = Ct(s, t);
|
|
834
|
+
return s && Le(s) && Je(s) && !ct(s) ? n : s || eo(e) || n;
|
|
860
835
|
}
|
|
861
|
-
const
|
|
862
|
-
const t = this.getOffsetParent ||
|
|
836
|
+
const mo = async function(e) {
|
|
837
|
+
const t = this.getOffsetParent || zt, n = this.getDimensions, s = await n(e.floating);
|
|
863
838
|
return {
|
|
864
|
-
reference:
|
|
839
|
+
reference: po(e.reference, await t(e.floating), e.strategy),
|
|
865
840
|
floating: {
|
|
866
841
|
x: 0,
|
|
867
842
|
y: 0,
|
|
868
|
-
width:
|
|
869
|
-
height:
|
|
843
|
+
width: s.width,
|
|
844
|
+
height: s.height
|
|
870
845
|
}
|
|
871
846
|
};
|
|
872
847
|
};
|
|
873
|
-
function
|
|
874
|
-
return
|
|
875
|
-
}
|
|
876
|
-
const
|
|
877
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
878
|
-
getDocumentElement:
|
|
879
|
-
getClippingRect:
|
|
880
|
-
getOffsetParent:
|
|
881
|
-
getElementRects:
|
|
882
|
-
getClientRects:
|
|
883
|
-
getDimensions:
|
|
884
|
-
getScale:
|
|
885
|
-
isElement:
|
|
886
|
-
isRTL:
|
|
848
|
+
function ho(e) {
|
|
849
|
+
return G(e).direction === "rtl";
|
|
850
|
+
}
|
|
851
|
+
const go = {
|
|
852
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: oo,
|
|
853
|
+
getDocumentElement: Q,
|
|
854
|
+
getClippingRect: uo,
|
|
855
|
+
getOffsetParent: zt,
|
|
856
|
+
getElementRects: mo,
|
|
857
|
+
getClientRects: so,
|
|
858
|
+
getDimensions: fo,
|
|
859
|
+
getScale: ve,
|
|
860
|
+
isElement: V,
|
|
861
|
+
isRTL: ho
|
|
887
862
|
};
|
|
888
|
-
function
|
|
863
|
+
function Ft(e, t) {
|
|
889
864
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
890
865
|
}
|
|
891
|
-
function
|
|
892
|
-
let
|
|
893
|
-
const
|
|
894
|
-
function
|
|
895
|
-
var
|
|
896
|
-
clearTimeout(
|
|
866
|
+
function xo(e, t, n) {
|
|
867
|
+
let s = null, r;
|
|
868
|
+
const o = Q(e);
|
|
869
|
+
function l() {
|
|
870
|
+
var d;
|
|
871
|
+
clearTimeout(r), (d = s) == null || d.disconnect(), s = null;
|
|
897
872
|
}
|
|
898
|
-
function
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
left:
|
|
902
|
-
top:
|
|
903
|
-
width:
|
|
904
|
-
height:
|
|
905
|
-
} =
|
|
906
|
-
if (
|
|
873
|
+
function i(d, u) {
|
|
874
|
+
d === void 0 && (d = !1), u === void 0 && (u = 1), l();
|
|
875
|
+
const x = e.getBoundingClientRect(), {
|
|
876
|
+
left: g,
|
|
877
|
+
top: E,
|
|
878
|
+
width: w,
|
|
879
|
+
height: v
|
|
880
|
+
} = x;
|
|
881
|
+
if (d || t(), !w || !v)
|
|
907
882
|
return;
|
|
908
|
-
const
|
|
909
|
-
rootMargin: -
|
|
910
|
-
threshold:
|
|
883
|
+
const h = Re(E), b = Re(o.clientWidth - (g + w)), p = Re(o.clientHeight - (E + v)), f = Re(g), y = {
|
|
884
|
+
rootMargin: -h + "px " + -b + "px " + -p + "px " + -f + "px",
|
|
885
|
+
threshold: de(0, Be(1, u)) || 1
|
|
911
886
|
};
|
|
912
|
-
let
|
|
913
|
-
function
|
|
914
|
-
const
|
|
915
|
-
if (
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
887
|
+
let T = !0;
|
|
888
|
+
function _(S) {
|
|
889
|
+
const D = S[0].intersectionRatio;
|
|
890
|
+
if (!Ft(x, e.getBoundingClientRect()))
|
|
891
|
+
return i();
|
|
892
|
+
if (D !== u) {
|
|
893
|
+
if (!T)
|
|
894
|
+
return i();
|
|
895
|
+
D ? i(!1, D) : r = setTimeout(() => {
|
|
896
|
+
i(!1, 1e-7);
|
|
920
897
|
}, 1e3);
|
|
921
898
|
}
|
|
922
|
-
|
|
899
|
+
T = !1;
|
|
923
900
|
}
|
|
924
901
|
try {
|
|
925
|
-
|
|
926
|
-
...
|
|
902
|
+
s = new IntersectionObserver(_, {
|
|
903
|
+
...y,
|
|
927
904
|
// Handle <iframe>s
|
|
928
|
-
root:
|
|
905
|
+
root: o.ownerDocument
|
|
929
906
|
});
|
|
930
907
|
} catch {
|
|
931
|
-
|
|
908
|
+
s = new IntersectionObserver(_, y);
|
|
932
909
|
}
|
|
933
|
-
|
|
910
|
+
s.observe(e);
|
|
934
911
|
}
|
|
935
|
-
|
|
912
|
+
const a = j(e), c = () => i(n);
|
|
913
|
+
return a.addEventListener("resize", c), i(!0), () => {
|
|
914
|
+
a.removeEventListener("resize", c), l();
|
|
915
|
+
};
|
|
936
916
|
}
|
|
937
|
-
function
|
|
938
|
-
|
|
917
|
+
function ft(e, t, n, s) {
|
|
918
|
+
s === void 0 && (s = {});
|
|
939
919
|
const {
|
|
940
|
-
ancestorScroll:
|
|
941
|
-
ancestorResize:
|
|
920
|
+
ancestorScroll: r = !0,
|
|
921
|
+
ancestorResize: o = !0,
|
|
942
922
|
elementResize: l = typeof ResizeObserver == "function",
|
|
943
|
-
layoutShift:
|
|
923
|
+
layoutShift: i = typeof IntersectionObserver == "function",
|
|
944
924
|
animationFrame: a = !1
|
|
945
|
-
} =
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
passive: !0
|
|
949
|
-
}), s && h.addEventListener("resize", n);
|
|
925
|
+
} = s, c = dt(e), d = r || o ? [...c ? ke(c) : [], ...t ? ke(t) : []] : [];
|
|
926
|
+
d.forEach((h) => {
|
|
927
|
+
r && h.addEventListener("scroll", n), o && h.addEventListener("resize", n);
|
|
950
928
|
});
|
|
951
|
-
const u = c &&
|
|
952
|
-
let
|
|
953
|
-
l && (
|
|
954
|
-
let [
|
|
955
|
-
|
|
929
|
+
const u = c && i ? xo(c, n, o) : null;
|
|
930
|
+
let x = -1, g = null;
|
|
931
|
+
l && (g = new ResizeObserver((h) => {
|
|
932
|
+
let [b] = h;
|
|
933
|
+
b && b.target === c && g && t && (g.unobserve(t), cancelAnimationFrame(x), x = requestAnimationFrame(() => {
|
|
956
934
|
var p;
|
|
957
|
-
(p =
|
|
935
|
+
(p = g) == null || p.observe(t);
|
|
958
936
|
})), n();
|
|
959
|
-
}), c && !a &&
|
|
960
|
-
let
|
|
937
|
+
}), c && !a && g.observe(c), t && g.observe(t));
|
|
938
|
+
let E, w = a ? xe(e) : null;
|
|
961
939
|
a && v();
|
|
962
940
|
function v() {
|
|
963
941
|
const h = xe(e);
|
|
964
|
-
|
|
942
|
+
w && !Ft(w, h) && n(), w = h, E = requestAnimationFrame(v);
|
|
965
943
|
}
|
|
966
944
|
return n(), () => {
|
|
967
945
|
var h;
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
}), u == null || u(), (h =
|
|
946
|
+
d.forEach((b) => {
|
|
947
|
+
r && b.removeEventListener("scroll", n), o && b.removeEventListener("resize", n);
|
|
948
|
+
}), u == null || u(), (h = g) == null || h.disconnect(), g = null, a && cancelAnimationFrame(E);
|
|
971
949
|
};
|
|
972
950
|
}
|
|
973
|
-
const
|
|
974
|
-
const
|
|
975
|
-
|
|
976
|
-
...
|
|
977
|
-
|
|
978
|
-
...i.platform,
|
|
979
|
-
_c: o
|
|
951
|
+
const pt = Xn, mt = Yn, ht = Vn, gt = (e, t, n) => {
|
|
952
|
+
const s = /* @__PURE__ */ new Map(), r = n ?? {}, o = {
|
|
953
|
+
...go,
|
|
954
|
+
...r.platform,
|
|
955
|
+
_c: s
|
|
980
956
|
};
|
|
981
|
-
return
|
|
982
|
-
...
|
|
983
|
-
platform:
|
|
957
|
+
return Fn(e, t, {
|
|
958
|
+
...r,
|
|
959
|
+
platform: o
|
|
984
960
|
});
|
|
985
961
|
};
|
|
986
|
-
function
|
|
962
|
+
function be(e) {
|
|
987
963
|
return `${e}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
988
964
|
}
|
|
989
|
-
function
|
|
990
|
-
const { $from:
|
|
991
|
-
if (!e.empty || !
|
|
965
|
+
function yo(e, t, n = !1) {
|
|
966
|
+
const { $from: s } = e;
|
|
967
|
+
if (!e.empty || !s.parent.isTextblock)
|
|
992
968
|
return null;
|
|
993
|
-
const
|
|
994
|
-
if (
|
|
969
|
+
const r = s.parent.textBetween(0, s.parentOffset, void 0, ""), o = r.lastIndexOf(t);
|
|
970
|
+
if (o === -1)
|
|
995
971
|
return null;
|
|
996
|
-
const l =
|
|
972
|
+
const l = r.slice(o + t.length);
|
|
997
973
|
if (!n && l.includes(" "))
|
|
998
974
|
return null;
|
|
999
|
-
const
|
|
975
|
+
const i = s.start() + o, a = s.pos;
|
|
1000
976
|
return {
|
|
1001
|
-
range: { from:
|
|
977
|
+
range: { from: i, to: a },
|
|
1002
978
|
query: l
|
|
1003
979
|
};
|
|
1004
980
|
}
|
|
1005
|
-
const
|
|
981
|
+
const ye = {
|
|
1006
982
|
/** Template 扩展(包含 TemplateBlock 和 TemplateSelect 子扩展) */
|
|
1007
983
|
TEMPLATE: "template",
|
|
1008
984
|
/** Mention 扩展 */
|
|
1009
985
|
MENTION: "mention",
|
|
1010
986
|
/** Suggestion 扩展 */
|
|
1011
987
|
SUGGESTION: "suggestion"
|
|
1012
|
-
},
|
|
988
|
+
}, C = {
|
|
1013
989
|
/** TemplateBlock 节点类型(可编辑块) */
|
|
1014
990
|
TEMPLATE_BLOCK: "templateBlock",
|
|
1015
991
|
/** TemplateSelect 节点类型(下拉选择) */
|
|
@@ -1020,7 +996,7 @@ const Te = {
|
|
|
1020
996
|
PARAGRAPH: "paragraph",
|
|
1021
997
|
/** Text 节点类型(ProseMirror 内置) */
|
|
1022
998
|
TEXT: "text"
|
|
1023
|
-
},
|
|
999
|
+
}, ie = {
|
|
1024
1000
|
/** Mention 插件 */
|
|
1025
1001
|
MENTION: "mention",
|
|
1026
1002
|
/** Suggestion 插件 */
|
|
@@ -1037,7 +1013,7 @@ const Te = {
|
|
|
1037
1013
|
TEMPLATE_BLOCK_KEYBOARD: "templateBlockKeyboard",
|
|
1038
1014
|
/** Template Block 粘贴处理插件 */
|
|
1039
1015
|
TEMPLATE_BLOCK_PASTE: "templateBlockPaste"
|
|
1040
|
-
},
|
|
1016
|
+
}, z = {
|
|
1041
1017
|
/** 文本类型 */
|
|
1042
1018
|
TEXT: "text",
|
|
1043
1019
|
/** 模板块类型(对应内部的 TemplateBlock 节点) */
|
|
@@ -1046,7 +1022,7 @@ const Te = {
|
|
|
1046
1022
|
SELECT: "select",
|
|
1047
1023
|
/** Mention 类型 */
|
|
1048
1024
|
MENTION: "mention"
|
|
1049
|
-
},
|
|
1025
|
+
}, Vt = {
|
|
1050
1026
|
/** Enter 键 */
|
|
1051
1027
|
ENTER: "Enter",
|
|
1052
1028
|
/** Escape 键 */
|
|
@@ -1067,87 +1043,87 @@ const Te = {
|
|
|
1067
1043
|
ARROW_RIGHT: "ArrowRight",
|
|
1068
1044
|
/** 空格键 */
|
|
1069
1045
|
SPACE: " "
|
|
1070
|
-
},
|
|
1046
|
+
}, P = (e, t) => e.key === Vt[t], Ee = (e, t) => t.some((n) => e.key === Vt[n]), bo = ["onMousedown", "onMouseenter"], vo = {
|
|
1071
1047
|
key: 0,
|
|
1072
1048
|
class: "mention-icon"
|
|
1073
|
-
},
|
|
1049
|
+
}, To = { class: "mention-label" }, Eo = {
|
|
1074
1050
|
key: 0,
|
|
1075
1051
|
class: "mention-empty"
|
|
1076
|
-
},
|
|
1052
|
+
}, wo = /* @__PURE__ */ U({
|
|
1077
1053
|
__name: "mention-list",
|
|
1078
1054
|
props: {
|
|
1079
1055
|
items: {},
|
|
1080
1056
|
command: { type: Function }
|
|
1081
1057
|
},
|
|
1082
1058
|
setup(e, { expose: t }) {
|
|
1083
|
-
const n = e,
|
|
1059
|
+
const n = e, s = H(0), r = H(null);
|
|
1084
1060
|
N(
|
|
1085
1061
|
() => n.items,
|
|
1086
1062
|
() => {
|
|
1087
|
-
|
|
1063
|
+
s.value = 0;
|
|
1088
1064
|
}
|
|
1089
1065
|
);
|
|
1090
|
-
function
|
|
1091
|
-
return
|
|
1066
|
+
function o({ event: c }) {
|
|
1067
|
+
return P(c, "ARROW_UP") ? (s.value = Math.max(0, s.value - 1), l(), !0) : P(c, "ARROW_DOWN") ? (s.value = Math.min(n.items.length - 1, s.value + 1), l(), !0) : Ee(c, ["ENTER", "TAB"]) ? (i(s.value), !0) : !1;
|
|
1092
1068
|
}
|
|
1093
1069
|
function l() {
|
|
1094
|
-
|
|
1095
|
-
var
|
|
1096
|
-
const c = (
|
|
1070
|
+
pe(() => {
|
|
1071
|
+
var d;
|
|
1072
|
+
const c = (d = r.value) == null ? void 0 : d.querySelector(".mention-item.is-selected");
|
|
1097
1073
|
c && c.scrollIntoView({
|
|
1098
1074
|
block: "nearest",
|
|
1099
1075
|
behavior: "smooth"
|
|
1100
1076
|
});
|
|
1101
1077
|
});
|
|
1102
1078
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
id:
|
|
1107
|
-
label:
|
|
1108
|
-
value:
|
|
1079
|
+
function i(c) {
|
|
1080
|
+
const d = n.items[c];
|
|
1081
|
+
d && n.command({
|
|
1082
|
+
id: d.id,
|
|
1083
|
+
label: d.label,
|
|
1084
|
+
value: d.value
|
|
1109
1085
|
});
|
|
1110
1086
|
}
|
|
1111
1087
|
function a(c) {
|
|
1112
|
-
|
|
1088
|
+
s.value = c;
|
|
1113
1089
|
}
|
|
1114
1090
|
return t({
|
|
1115
|
-
onKeyDown:
|
|
1116
|
-
}), (c,
|
|
1091
|
+
onKeyDown: o
|
|
1092
|
+
}), (c, d) => (k(), M("div", {
|
|
1117
1093
|
ref_key: "listRef",
|
|
1118
|
-
ref:
|
|
1094
|
+
ref: r,
|
|
1119
1095
|
class: "mention-list"
|
|
1120
1096
|
}, [
|
|
1121
|
-
(
|
|
1097
|
+
(k(!0), M(Pe, null, De(e.items, (u, x) => (k(), M("button", {
|
|
1122
1098
|
key: u.id,
|
|
1123
1099
|
type: "button",
|
|
1124
|
-
class:
|
|
1125
|
-
onMousedown:
|
|
1126
|
-
onMouseenter: (
|
|
1100
|
+
class: Z(["mention-item", { "is-selected": x === s.value }]),
|
|
1101
|
+
onMousedown: et((g) => i(x), ["prevent"]),
|
|
1102
|
+
onMouseenter: (g) => a(x)
|
|
1127
1103
|
}, [
|
|
1128
|
-
u.icon ? (
|
|
1129
|
-
B("span",
|
|
1130
|
-
], 42,
|
|
1131
|
-
e.items.length === 0 ? (
|
|
1104
|
+
u.icon ? (k(), M("span", vo, fe(u.icon), 1)) : W("", !0),
|
|
1105
|
+
B("span", To, fe(u.label), 1)
|
|
1106
|
+
], 42, bo))), 128)),
|
|
1107
|
+
e.items.length === 0 ? (k(), M("div", Eo, [...d[0] || (d[0] = [
|
|
1132
1108
|
B("span", null, "未找到匹配的提及项", -1)
|
|
1133
|
-
])])) :
|
|
1109
|
+
])])) : W("", !0)
|
|
1134
1110
|
], 512));
|
|
1135
1111
|
}
|
|
1136
|
-
}),
|
|
1137
|
-
function
|
|
1112
|
+
}), Ao = /* @__PURE__ */ X(wo, [["__scopeId", "data-v-aaa34d1a"]]), ue = new oe(ie.MENTION);
|
|
1113
|
+
function Co(e, t) {
|
|
1138
1114
|
if (!t)
|
|
1139
1115
|
return e;
|
|
1140
1116
|
const n = t.toLowerCase();
|
|
1141
|
-
return e.filter((
|
|
1142
|
-
var
|
|
1143
|
-
return !!(
|
|
1117
|
+
return e.filter((s) => {
|
|
1118
|
+
var r;
|
|
1119
|
+
return !!(s.label.toLowerCase().includes(n) || (r = s.value) != null && r.toLowerCase().includes(n));
|
|
1144
1120
|
});
|
|
1145
1121
|
}
|
|
1146
|
-
function
|
|
1147
|
-
const { editor: t, char: n, items:
|
|
1148
|
-
let
|
|
1149
|
-
return new
|
|
1150
|
-
key:
|
|
1122
|
+
function So(e) {
|
|
1123
|
+
const { editor: t, char: n, items: s, allowSpaces: r } = e;
|
|
1124
|
+
let o = null, l = null, i = null;
|
|
1125
|
+
return new se({
|
|
1126
|
+
key: ue,
|
|
1151
1127
|
state: {
|
|
1152
1128
|
init() {
|
|
1153
1129
|
return {
|
|
@@ -1158,8 +1134,8 @@ function po(e) {
|
|
|
1158
1134
|
};
|
|
1159
1135
|
},
|
|
1160
1136
|
apply(a, c) {
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1137
|
+
const d = a.getMeta(ue);
|
|
1138
|
+
if (d && d.type === "close")
|
|
1163
1139
|
return {
|
|
1164
1140
|
active: !1,
|
|
1165
1141
|
range: null,
|
|
@@ -1168,7 +1144,7 @@ function po(e) {
|
|
|
1168
1144
|
};
|
|
1169
1145
|
if (!a.docChanged && !a.selectionSet)
|
|
1170
1146
|
return c;
|
|
1171
|
-
const u =
|
|
1147
|
+
const u = yo(a.selection, n, r);
|
|
1172
1148
|
if (!u)
|
|
1173
1149
|
return {
|
|
1174
1150
|
active: !1,
|
|
@@ -1176,12 +1152,12 @@ function po(e) {
|
|
|
1176
1152
|
query: "",
|
|
1177
1153
|
filteredItems: []
|
|
1178
1154
|
};
|
|
1179
|
-
const
|
|
1155
|
+
const x = _e(s) ? s.value : s, g = Co(x, u.query);
|
|
1180
1156
|
return {
|
|
1181
|
-
active:
|
|
1157
|
+
active: g.length > 0,
|
|
1182
1158
|
range: u.range,
|
|
1183
1159
|
query: u.query,
|
|
1184
|
-
filteredItems:
|
|
1160
|
+
filteredItems: g
|
|
1185
1161
|
};
|
|
1186
1162
|
}
|
|
1187
1163
|
},
|
|
@@ -1190,71 +1166,71 @@ function po(e) {
|
|
|
1190
1166
|
decorations(a) {
|
|
1191
1167
|
const c = this.getState(a);
|
|
1192
1168
|
if (!(c != null && c.active) || !c.range)
|
|
1193
|
-
return
|
|
1194
|
-
const
|
|
1169
|
+
return Se.empty;
|
|
1170
|
+
const d = Dt.inline(c.range.from, c.range.to, {
|
|
1195
1171
|
class: "mention-trigger"
|
|
1196
1172
|
});
|
|
1197
|
-
return
|
|
1173
|
+
return Se.create(a.doc, [d]);
|
|
1198
1174
|
},
|
|
1199
1175
|
// 键盘处理
|
|
1200
1176
|
handleKeyDown(a, c) {
|
|
1201
|
-
var u,
|
|
1202
|
-
const
|
|
1203
|
-
if (
|
|
1204
|
-
const { selection:
|
|
1205
|
-
if (v.nodeBefore && v.nodeBefore.type.name ===
|
|
1177
|
+
var u, x, g, E;
|
|
1178
|
+
const d = ue.getState(a.state);
|
|
1179
|
+
if (P(c, "BACKSPACE")) {
|
|
1180
|
+
const { selection: w } = a.state, { $from: v } = w;
|
|
1181
|
+
if (v.nodeBefore && v.nodeBefore.type.name === C.MENTION) {
|
|
1206
1182
|
c.preventDefault();
|
|
1207
|
-
const { tr: h } = a.state,
|
|
1208
|
-
return h.delete(
|
|
1183
|
+
const { tr: h } = a.state, b = v.pos - v.nodeBefore.nodeSize;
|
|
1184
|
+
return h.delete(b, v.pos), h.insertText(n, b), h.setSelection(R.create(h.doc, b + 1)), a.dispatch(h), a.focus(), !0;
|
|
1209
1185
|
}
|
|
1210
1186
|
}
|
|
1211
|
-
if (!(
|
|
1187
|
+
if (!(d != null && d.active))
|
|
1212
1188
|
return !1;
|
|
1213
|
-
if (
|
|
1189
|
+
if (P(c, "ESCAPE")) {
|
|
1214
1190
|
c.preventDefault();
|
|
1215
|
-
const
|
|
1216
|
-
return
|
|
1191
|
+
const w = a.state.tr;
|
|
1192
|
+
return w.setMeta(ue, {
|
|
1217
1193
|
type: "close"
|
|
1218
|
-
}), a.dispatch(
|
|
1194
|
+
}), a.dispatch(w), o && (i == null || i(), i = null, o.destroy(), o = null), l && (l.remove(), l = null), !0;
|
|
1219
1195
|
}
|
|
1220
|
-
if (
|
|
1221
|
-
if (c.preventDefault(), (
|
|
1196
|
+
if (Ee(c, ["ENTER", "TAB"])) {
|
|
1197
|
+
if (c.preventDefault(), (x = (u = o == null ? void 0 : o.ref) == null ? void 0 : u.onKeyDown) == null ? void 0 : x.call(u, { event: c }))
|
|
1222
1198
|
return !0;
|
|
1223
|
-
if (
|
|
1224
|
-
const v =
|
|
1225
|
-
return
|
|
1199
|
+
if (d.filteredItems.length > 0 && d.range) {
|
|
1200
|
+
const v = d.filteredItems[0];
|
|
1201
|
+
return St(a, d.range, v), !0;
|
|
1226
1202
|
}
|
|
1227
1203
|
return !0;
|
|
1228
1204
|
}
|
|
1229
|
-
return
|
|
1205
|
+
return Ee(c, ["ARROW_UP", "ARROW_DOWN"]) && ((E = (g = o == null ? void 0 : o.ref) == null ? void 0 : g.onKeyDown) == null ? void 0 : E.call(g, { event: c })) || !1;
|
|
1230
1206
|
}
|
|
1231
1207
|
},
|
|
1232
1208
|
view() {
|
|
1233
1209
|
return {
|
|
1234
1210
|
update(a) {
|
|
1235
|
-
const c =
|
|
1211
|
+
const c = ue.getState(a.state);
|
|
1236
1212
|
if (c != null && c.active && c.filteredItems.length > 0) {
|
|
1237
|
-
|
|
1213
|
+
o ? o.updateProps({
|
|
1238
1214
|
items: c.filteredItems
|
|
1239
|
-
}) : (
|
|
1215
|
+
}) : (o = new Pt(Ao, {
|
|
1240
1216
|
props: {
|
|
1241
1217
|
items: c.filteredItems,
|
|
1242
1218
|
command: (u) => {
|
|
1243
|
-
const
|
|
1219
|
+
const x = {
|
|
1244
1220
|
id: u.id,
|
|
1245
1221
|
label: u.label,
|
|
1246
1222
|
value: u.value || ""
|
|
1247
1223
|
};
|
|
1248
|
-
c.range &&
|
|
1224
|
+
c.range && St(a, c.range, x);
|
|
1249
1225
|
}
|
|
1250
1226
|
},
|
|
1251
1227
|
editor: t
|
|
1252
|
-
}), l =
|
|
1253
|
-
const
|
|
1254
|
-
|
|
1255
|
-
|
|
1228
|
+
}), l = o.element, l.style.position = "absolute", l.style.zIndex = "1000", document.body.appendChild(l));
|
|
1229
|
+
const d = a.dom.querySelector(".mention-trigger");
|
|
1230
|
+
d && l && (i == null || i(), i = ft(d, l, () => {
|
|
1231
|
+
gt(d, l, {
|
|
1256
1232
|
placement: "bottom-start",
|
|
1257
|
-
middleware: [
|
|
1233
|
+
middleware: [pt(8), ht(), mt({ padding: 8 })]
|
|
1258
1234
|
}).then((u) => {
|
|
1259
1235
|
l && Object.assign(l.style, {
|
|
1260
1236
|
left: `${u.x}px`,
|
|
@@ -1263,34 +1239,34 @@ function po(e) {
|
|
|
1263
1239
|
});
|
|
1264
1240
|
}));
|
|
1265
1241
|
} else
|
|
1266
|
-
|
|
1242
|
+
o && (i == null || i(), i = null, o.destroy(), o = null), l && (l.remove(), l = null);
|
|
1267
1243
|
},
|
|
1268
1244
|
destroy() {
|
|
1269
|
-
|
|
1245
|
+
i == null || i(), o == null || o.destroy(), l == null || l.remove();
|
|
1270
1246
|
}
|
|
1271
1247
|
};
|
|
1272
1248
|
}
|
|
1273
1249
|
});
|
|
1274
1250
|
}
|
|
1275
|
-
function
|
|
1251
|
+
function St(e, t, n) {
|
|
1276
1252
|
e.focus();
|
|
1277
|
-
const { state:
|
|
1278
|
-
id: n.id ||
|
|
1253
|
+
const { state: s, dispatch: r } = e, { tr: o } = s, l = s.schema.nodes.mention.create({
|
|
1254
|
+
id: n.id || be("mention"),
|
|
1279
1255
|
label: n.label,
|
|
1280
1256
|
value: n.value || ""
|
|
1281
|
-
}),
|
|
1282
|
-
|
|
1257
|
+
}), i = s.schema.text(" ");
|
|
1258
|
+
o.delete(t.from, t.to), o.insert(t.from, [l, i]);
|
|
1283
1259
|
const a = t.from + 2;
|
|
1284
|
-
|
|
1260
|
+
o.setSelection(R.create(o.doc, a)), o.scrollIntoView(), r(o);
|
|
1285
1261
|
}
|
|
1286
|
-
const
|
|
1262
|
+
const _o = {
|
|
1287
1263
|
/**
|
|
1288
1264
|
* 插入 mention 节点
|
|
1289
1265
|
*/
|
|
1290
1266
|
insertMention: (e) => ({ commands: t }) => t.insertContent({
|
|
1291
|
-
type:
|
|
1267
|
+
type: C.MENTION,
|
|
1292
1268
|
attrs: {
|
|
1293
|
-
id: e.id ||
|
|
1269
|
+
id: e.id || be("mention"),
|
|
1294
1270
|
label: e.label || "",
|
|
1295
1271
|
value: e.value
|
|
1296
1272
|
}
|
|
@@ -1299,14 +1275,14 @@ const mo = {
|
|
|
1299
1275
|
* 删除 mention 节点
|
|
1300
1276
|
*/
|
|
1301
1277
|
deleteMention: (e) => ({ tr: t, state: n }) => {
|
|
1302
|
-
let
|
|
1303
|
-
return n.doc.descendants((
|
|
1304
|
-
if (
|
|
1305
|
-
return t.delete(
|
|
1306
|
-
}),
|
|
1278
|
+
let s = !1;
|
|
1279
|
+
return n.doc.descendants((r, o) => {
|
|
1280
|
+
if (r.type.name === C.MENTION && r.attrs.id === e)
|
|
1281
|
+
return t.delete(o, o + r.nodeSize), s = !0, !1;
|
|
1282
|
+
}), s;
|
|
1307
1283
|
}
|
|
1308
|
-
},
|
|
1309
|
-
name:
|
|
1284
|
+
}, Gt = lt.create({
|
|
1285
|
+
name: ye.MENTION,
|
|
1310
1286
|
// 节点配置
|
|
1311
1287
|
group: "inline",
|
|
1312
1288
|
inline: !0,
|
|
@@ -1352,7 +1328,7 @@ const mo = {
|
|
|
1352
1328
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
1353
1329
|
return [
|
|
1354
1330
|
"span",
|
|
1355
|
-
|
|
1331
|
+
at(this.options.HTMLAttributes || {}, t, {
|
|
1356
1332
|
"data-mention": "",
|
|
1357
1333
|
"data-id": e.attrs.id,
|
|
1358
1334
|
"data-label": e.attrs.label,
|
|
@@ -1363,7 +1339,7 @@ const mo = {
|
|
|
1363
1339
|
},
|
|
1364
1340
|
// 使用 Vue 组件渲染
|
|
1365
1341
|
addNodeView() {
|
|
1366
|
-
return
|
|
1342
|
+
return it(On);
|
|
1367
1343
|
},
|
|
1368
1344
|
// 添加 storage 用于存储实例状态
|
|
1369
1345
|
addStorage() {
|
|
@@ -1373,11 +1349,11 @@ const mo = {
|
|
|
1373
1349
|
},
|
|
1374
1350
|
onCreate() {
|
|
1375
1351
|
const { items: e } = this.options;
|
|
1376
|
-
|
|
1352
|
+
_e(e) && (this.storage.watchStopHandle = N(
|
|
1377
1353
|
e,
|
|
1378
1354
|
() => {
|
|
1379
1355
|
const t = this.editor.state.tr;
|
|
1380
|
-
t.setMeta(
|
|
1356
|
+
t.setMeta(ue, { type: "mention-update" }), this.editor.view.dispatch(t);
|
|
1381
1357
|
},
|
|
1382
1358
|
{ deep: !0 }
|
|
1383
1359
|
));
|
|
@@ -1388,7 +1364,7 @@ const mo = {
|
|
|
1388
1364
|
// 添加 Suggestion 插件
|
|
1389
1365
|
addProseMirrorPlugins() {
|
|
1390
1366
|
return [
|
|
1391
|
-
|
|
1367
|
+
So({
|
|
1392
1368
|
editor: this.editor,
|
|
1393
1369
|
char: this.options.char,
|
|
1394
1370
|
items: this.options.items,
|
|
@@ -1405,93 +1381,93 @@ const mo = {
|
|
|
1405
1381
|
},
|
|
1406
1382
|
// 自定义命令
|
|
1407
1383
|
addCommands() {
|
|
1408
|
-
return
|
|
1384
|
+
return _o;
|
|
1409
1385
|
}
|
|
1410
1386
|
});
|
|
1411
|
-
function
|
|
1412
|
-
var
|
|
1413
|
-
const t = e.extensionManager.extensions.find((
|
|
1414
|
-
let
|
|
1415
|
-
return e.state.doc.descendants((
|
|
1416
|
-
|
|
1417
|
-
}),
|
|
1418
|
-
}
|
|
1419
|
-
function
|
|
1387
|
+
function Lo(e) {
|
|
1388
|
+
var r;
|
|
1389
|
+
const t = e.extensionManager.extensions.find((o) => o.name === ye.MENTION), n = ((r = t == null ? void 0 : t.options) == null ? void 0 : r.char) || "@";
|
|
1390
|
+
let s = "";
|
|
1391
|
+
return e.state.doc.descendants((o) => {
|
|
1392
|
+
o.type.name === C.MENTION ? s += `${n}${o.attrs.label}` : o.type.name === C.TEXT && (s += o.text || "");
|
|
1393
|
+
}), s.trim();
|
|
1394
|
+
}
|
|
1395
|
+
function ko(e) {
|
|
1420
1396
|
const t = [];
|
|
1421
|
-
return e.state.doc.descendants((n,
|
|
1422
|
-
if (
|
|
1423
|
-
if (n.type.name ===
|
|
1397
|
+
return e.state.doc.descendants((n, s, r) => {
|
|
1398
|
+
if (r && r.type.name === C.PARAGRAPH) {
|
|
1399
|
+
if (n.type.name === C.MENTION)
|
|
1424
1400
|
t.push({
|
|
1425
|
-
type:
|
|
1401
|
+
type: z.MENTION,
|
|
1426
1402
|
content: n.attrs.label,
|
|
1427
1403
|
value: n.attrs.value || ""
|
|
1428
1404
|
});
|
|
1429
|
-
else if (n.type.name ===
|
|
1430
|
-
const
|
|
1431
|
-
if (
|
|
1405
|
+
else if (n.type.name === C.TEXT) {
|
|
1406
|
+
const o = n.text || "";
|
|
1407
|
+
if (o) {
|
|
1432
1408
|
const l = t[t.length - 1];
|
|
1433
|
-
l && l.type ===
|
|
1434
|
-
type:
|
|
1435
|
-
content:
|
|
1409
|
+
l && l.type === z.TEXT ? l.content = (l.content || "") + o : t.push({
|
|
1410
|
+
type: z.TEXT,
|
|
1411
|
+
content: o
|
|
1436
1412
|
});
|
|
1437
1413
|
}
|
|
1438
1414
|
}
|
|
1439
1415
|
}
|
|
1440
1416
|
}), t;
|
|
1441
1417
|
}
|
|
1442
|
-
function
|
|
1443
|
-
return
|
|
1418
|
+
function Mo(e, t = "@", n) {
|
|
1419
|
+
return Gt.configure({
|
|
1444
1420
|
items: e,
|
|
1445
1421
|
char: t,
|
|
1446
1422
|
...n
|
|
1447
1423
|
});
|
|
1448
1424
|
}
|
|
1449
|
-
const
|
|
1425
|
+
const Ut = (e, t) => {
|
|
1450
1426
|
if (!t.length)
|
|
1451
1427
|
return [{ text: e, isMatch: !1 }];
|
|
1452
1428
|
const n = [];
|
|
1453
1429
|
for (const l of t) {
|
|
1454
1430
|
if (!l) continue;
|
|
1455
|
-
let
|
|
1431
|
+
let i = 0;
|
|
1456
1432
|
const a = e.toLowerCase(), c = l.toLowerCase();
|
|
1457
1433
|
for (; ; ) {
|
|
1458
|
-
const
|
|
1459
|
-
if (
|
|
1434
|
+
const d = a.indexOf(c, i);
|
|
1435
|
+
if (d === -1) break;
|
|
1460
1436
|
n.push({
|
|
1461
|
-
start:
|
|
1462
|
-
end:
|
|
1463
|
-
}),
|
|
1437
|
+
start: d,
|
|
1438
|
+
end: d + l.length
|
|
1439
|
+
}), i = d + 1;
|
|
1464
1440
|
}
|
|
1465
1441
|
}
|
|
1466
1442
|
if (n.length === 0)
|
|
1467
1443
|
return [{ text: e, isMatch: !1 }];
|
|
1468
|
-
n.sort((l,
|
|
1469
|
-
const
|
|
1444
|
+
n.sort((l, i) => l.start - i.start);
|
|
1445
|
+
const s = [];
|
|
1470
1446
|
for (const l of n)
|
|
1471
|
-
if (
|
|
1472
|
-
|
|
1447
|
+
if (s.length === 0)
|
|
1448
|
+
s.push(l);
|
|
1473
1449
|
else {
|
|
1474
|
-
const
|
|
1475
|
-
l.start <=
|
|
1450
|
+
const i = s[s.length - 1];
|
|
1451
|
+
l.start <= i.end ? i.end = Math.max(i.end, l.end) : s.push(l);
|
|
1476
1452
|
}
|
|
1477
|
-
const
|
|
1478
|
-
let
|
|
1479
|
-
for (const l of
|
|
1480
|
-
|
|
1481
|
-
text: e.substring(
|
|
1453
|
+
const r = [];
|
|
1454
|
+
let o = 0;
|
|
1455
|
+
for (const l of s)
|
|
1456
|
+
o < l.start && r.push({
|
|
1457
|
+
text: e.substring(o, l.start),
|
|
1482
1458
|
isMatch: !1
|
|
1483
|
-
}),
|
|
1459
|
+
}), r.push({
|
|
1484
1460
|
text: e.substring(l.start, l.end),
|
|
1485
1461
|
isMatch: !0
|
|
1486
|
-
}),
|
|
1487
|
-
return
|
|
1488
|
-
text: e.substring(
|
|
1462
|
+
}), o = l.end;
|
|
1463
|
+
return o < e.length && r.push({
|
|
1464
|
+
text: e.substring(o),
|
|
1489
1465
|
isMatch: !1
|
|
1490
|
-
}),
|
|
1491
|
-
},
|
|
1492
|
-
const { content: n, highlights:
|
|
1493
|
-
return typeof
|
|
1494
|
-
},
|
|
1466
|
+
}), r;
|
|
1467
|
+
}, Ro = (e, t) => !t || !e ? [{ text: e, isMatch: !1 }] : Ut(e, [t]), Oo = (e, t) => {
|
|
1468
|
+
const { content: n, highlights: s } = e;
|
|
1469
|
+
return typeof s == "function" ? s(n, t) : Array.isArray(s) ? Ut(n, s) : Ro(n, t);
|
|
1470
|
+
}, Po = ["onMouseenter", "onClick"], Do = { class: "suggestion-list__text" }, Io = /* @__PURE__ */ U({
|
|
1495
1471
|
__name: "suggestion-list",
|
|
1496
1472
|
props: {
|
|
1497
1473
|
show: { type: Boolean },
|
|
@@ -1505,165 +1481,165 @@ const Vt = (e, t) => {
|
|
|
1505
1481
|
onMouseLeave: { type: Function }
|
|
1506
1482
|
},
|
|
1507
1483
|
setup(e) {
|
|
1508
|
-
const t = e, n =
|
|
1484
|
+
const t = e, n = H(null), s = (i) => i === t.activeKeyboardIndex || i === t.activeMouseIndex, r = (i) => {
|
|
1509
1485
|
var a;
|
|
1510
|
-
(a = t.onMouseEnter) == null || a.call(t,
|
|
1511
|
-
},
|
|
1512
|
-
var
|
|
1513
|
-
(
|
|
1514
|
-
}, l = (
|
|
1486
|
+
(a = t.onMouseEnter) == null || a.call(t, i);
|
|
1487
|
+
}, o = () => {
|
|
1488
|
+
var i;
|
|
1489
|
+
(i = t.onMouseLeave) == null || i.call(t);
|
|
1490
|
+
}, l = (i) => {
|
|
1515
1491
|
var c;
|
|
1516
|
-
const a = t.suggestions[
|
|
1517
|
-
a && ((c = t.onSelect) == null || c.call(t,
|
|
1492
|
+
const a = t.suggestions[i];
|
|
1493
|
+
a && ((c = t.onSelect) == null || c.call(t, un(a)));
|
|
1518
1494
|
};
|
|
1519
1495
|
return N(
|
|
1520
1496
|
() => t.activeKeyboardIndex,
|
|
1521
|
-
(
|
|
1522
|
-
if (
|
|
1523
|
-
const a = n.value.children[
|
|
1497
|
+
(i) => {
|
|
1498
|
+
if (i !== -1 && n.value) {
|
|
1499
|
+
const a = n.value.children[i];
|
|
1524
1500
|
a && a.scrollIntoView({ block: "nearest" });
|
|
1525
1501
|
}
|
|
1526
1502
|
}
|
|
1527
|
-
), (
|
|
1503
|
+
), (i, a) => (k(), F(an, { name: "suggestion-slide-up" }, {
|
|
1528
1504
|
default: $(() => [
|
|
1529
|
-
t.show && t.suggestions.length ? (
|
|
1505
|
+
t.show && t.suggestions.length ? (k(), M("div", {
|
|
1530
1506
|
key: 0,
|
|
1531
1507
|
ref_key: "suggestionsListRef",
|
|
1532
1508
|
ref: n,
|
|
1533
1509
|
class: "suggestion-list",
|
|
1534
|
-
style:
|
|
1510
|
+
style: cn(t.popupStyle)
|
|
1535
1511
|
}, [
|
|
1536
|
-
(
|
|
1537
|
-
key:
|
|
1538
|
-
class:
|
|
1539
|
-
onMouseenter: (u) =>
|
|
1540
|
-
onMouseleave:
|
|
1541
|
-
onClick: (u) => l(
|
|
1512
|
+
(k(!0), M(Pe, null, De(t.suggestions, (c, d) => (k(), M("div", {
|
|
1513
|
+
key: d,
|
|
1514
|
+
class: Z(["suggestion-list__item", { highlighted: s(d) }]),
|
|
1515
|
+
onMouseenter: (u) => r(d),
|
|
1516
|
+
onMouseleave: o,
|
|
1517
|
+
onClick: (u) => l(d)
|
|
1542
1518
|
}, [
|
|
1543
|
-
|
|
1544
|
-
B("span",
|
|
1545
|
-
(
|
|
1546
|
-
key:
|
|
1547
|
-
class:
|
|
1519
|
+
ne(L(kn), { class: "suggestion-list__icon" }),
|
|
1520
|
+
B("span", Do, [
|
|
1521
|
+
(k(!0), M(Pe, null, De(L(Oo)(c, t.inputValue), (u, x) => (k(), M("span", {
|
|
1522
|
+
key: x,
|
|
1523
|
+
class: Z({
|
|
1548
1524
|
"suggestion-list__text--match": u.isMatch,
|
|
1549
1525
|
"suggestion-list__text--normal": !u.isMatch
|
|
1550
1526
|
})
|
|
1551
|
-
},
|
|
1527
|
+
}, fe(u.text), 3))), 128))
|
|
1552
1528
|
])
|
|
1553
|
-
], 42,
|
|
1554
|
-
], 4)) :
|
|
1529
|
+
], 42, Po))), 128))
|
|
1530
|
+
], 4)) : W("", !0)
|
|
1555
1531
|
]),
|
|
1556
1532
|
_: 1
|
|
1557
1533
|
}));
|
|
1558
1534
|
}
|
|
1559
|
-
}),
|
|
1535
|
+
}), Bo = /* @__PURE__ */ X(Io, [["__scopeId", "data-v-76a6f35e"]]), $o = (e, t) => {
|
|
1560
1536
|
if (!e || !t)
|
|
1561
1537
|
return { text: "", show: !1, showTab: !1 };
|
|
1562
|
-
const n = e.toLowerCase(),
|
|
1563
|
-
if (!n.startsWith(
|
|
1538
|
+
const n = e.toLowerCase(), s = t.toLowerCase();
|
|
1539
|
+
if (!n.startsWith(s))
|
|
1564
1540
|
return { text: "", show: !1, showTab: !1 };
|
|
1565
|
-
const
|
|
1541
|
+
const r = e.substring(t.length), o = r.length > 0;
|
|
1566
1542
|
return {
|
|
1567
|
-
text:
|
|
1568
|
-
show:
|
|
1569
|
-
showTab:
|
|
1543
|
+
text: r,
|
|
1544
|
+
show: o,
|
|
1545
|
+
showTab: o
|
|
1570
1546
|
};
|
|
1571
|
-
},
|
|
1572
|
-
function
|
|
1547
|
+
}, q = new oe(ie.SUGGESTION);
|
|
1548
|
+
function jo(e) {
|
|
1573
1549
|
const {
|
|
1574
1550
|
editor: t,
|
|
1575
1551
|
activeSuggestionKeys: n = ["Enter"],
|
|
1576
|
-
popupWidth:
|
|
1577
|
-
showAutoComplete:
|
|
1578
|
-
filterFn:
|
|
1552
|
+
popupWidth: s = 400,
|
|
1553
|
+
showAutoComplete: r = !0,
|
|
1554
|
+
filterFn: o,
|
|
1579
1555
|
onSelect: l
|
|
1580
1556
|
} = e;
|
|
1581
|
-
let
|
|
1557
|
+
let i = null, a = null, c = null, d = !1;
|
|
1582
1558
|
function u() {
|
|
1583
1559
|
const p = t.extensionManager.extensions.find(
|
|
1584
|
-
(
|
|
1585
|
-
),
|
|
1560
|
+
(y) => y.name === ye.SUGGESTION
|
|
1561
|
+
), f = p == null ? void 0 : p.options, m = (f == null ? void 0 : f.items) || (f == null ? void 0 : f.suggestions) || [];
|
|
1586
1562
|
return m && typeof m == "object" && "value" in m ? m.value : m;
|
|
1587
1563
|
}
|
|
1588
|
-
function
|
|
1589
|
-
const
|
|
1590
|
-
return
|
|
1564
|
+
function x(p) {
|
|
1565
|
+
const f = u();
|
|
1566
|
+
return o ? o(f, p) : f;
|
|
1591
1567
|
}
|
|
1592
|
-
function
|
|
1568
|
+
function g(p) {
|
|
1593
1569
|
return p;
|
|
1594
1570
|
}
|
|
1595
|
-
function
|
|
1571
|
+
function E(p, f, m) {
|
|
1596
1572
|
if (p === -1 || !m[p])
|
|
1597
1573
|
return { text: "", show: !1, showTab: !1 };
|
|
1598
|
-
const
|
|
1599
|
-
return
|
|
1574
|
+
const y = m[p];
|
|
1575
|
+
return $o(y.content, f);
|
|
1600
1576
|
}
|
|
1601
|
-
function
|
|
1602
|
-
if (!
|
|
1577
|
+
function w(p, f, m) {
|
|
1578
|
+
if (!f) return;
|
|
1603
1579
|
(l == null ? void 0 : l(m)) !== !1 && t.commands.setContent(m.content), t.commands.focus();
|
|
1604
1580
|
}
|
|
1605
|
-
function v(p,
|
|
1606
|
-
const m =
|
|
1607
|
-
m &&
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1581
|
+
function v(p, f) {
|
|
1582
|
+
const m = f.filteredSuggestions[f.selectedIndex];
|
|
1583
|
+
m && w(p, f.range, m);
|
|
1584
|
+
const y = p.state.tr;
|
|
1585
|
+
y.setMeta(q, { type: "close" }), p.dispatch(y);
|
|
1610
1586
|
}
|
|
1611
|
-
function h(p,
|
|
1587
|
+
function h(p, f) {
|
|
1612
1588
|
c == null || c();
|
|
1613
|
-
const
|
|
1614
|
-
if (typeof
|
|
1615
|
-
return `${
|
|
1616
|
-
if (typeof
|
|
1617
|
-
if (
|
|
1618
|
-
const _ = parseFloat(
|
|
1619
|
-
return `${
|
|
1589
|
+
const y = p.dom.closest(".tr-sender") || p.dom, T = () => {
|
|
1590
|
+
if (typeof s == "number")
|
|
1591
|
+
return `${s}px`;
|
|
1592
|
+
if (typeof s == "string") {
|
|
1593
|
+
if (s.endsWith("%")) {
|
|
1594
|
+
const _ = parseFloat(s) / 100;
|
|
1595
|
+
return `${y.offsetWidth * _}px`;
|
|
1620
1596
|
}
|
|
1621
|
-
return
|
|
1597
|
+
return s;
|
|
1622
1598
|
}
|
|
1623
1599
|
return "400px";
|
|
1624
1600
|
};
|
|
1625
|
-
c =
|
|
1626
|
-
|
|
1601
|
+
c = ft(y, f, () => {
|
|
1602
|
+
gt(y, f, {
|
|
1627
1603
|
placement: "top-start",
|
|
1628
1604
|
middleware: [
|
|
1629
|
-
|
|
1630
|
-
|
|
1605
|
+
pt(8),
|
|
1606
|
+
ht({
|
|
1631
1607
|
fallbackPlacements: ["bottom-start", "top-start"]
|
|
1632
1608
|
}),
|
|
1633
|
-
|
|
1609
|
+
mt({ padding: 8 })
|
|
1634
1610
|
]
|
|
1635
|
-
}).then(({ x: _, y:
|
|
1636
|
-
|
|
1611
|
+
}).then(({ x: _, y: S }) => {
|
|
1612
|
+
f.style.position = "absolute", f.style.left = `${_}px`, f.style.top = `${S}px`, f.style.zIndex = "2000", f.style.width = T();
|
|
1637
1613
|
});
|
|
1638
1614
|
});
|
|
1639
1615
|
}
|
|
1640
|
-
function
|
|
1641
|
-
if (!
|
|
1642
|
-
return
|
|
1643
|
-
const
|
|
1644
|
-
if (!(
|
|
1645
|
-
return
|
|
1646
|
-
const _ =
|
|
1647
|
-
|
|
1616
|
+
function b(p) {
|
|
1617
|
+
if (!r || !p.active || !p.autoCompleteText || !p.range)
|
|
1618
|
+
return Se.empty;
|
|
1619
|
+
const f = t.state.doc, { selection: m } = t.state, y = m.$head.pos;
|
|
1620
|
+
if (!(y >= f.content.size - 1))
|
|
1621
|
+
return Se.empty;
|
|
1622
|
+
const _ = Dt.widget(
|
|
1623
|
+
y,
|
|
1648
1624
|
() => {
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1652
|
-
if (
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1625
|
+
const S = document.createElement("span");
|
|
1626
|
+
S.className = "suggestion-autocomplete", S.contentEditable = "false";
|
|
1627
|
+
const D = document.createElement("span");
|
|
1628
|
+
if (D.className = "autocomplete-text", D.textContent = p.autoCompleteText, S.appendChild(D), p.showTabIndicator) {
|
|
1629
|
+
const Y = document.createElement("span");
|
|
1630
|
+
Y.className = "tab-hint", Y.textContent = "TAB", S.appendChild(Y);
|
|
1655
1631
|
}
|
|
1656
|
-
return
|
|
1632
|
+
return S;
|
|
1657
1633
|
},
|
|
1658
1634
|
{
|
|
1659
1635
|
side: 1
|
|
1660
1636
|
// 显示在光标右侧
|
|
1661
1637
|
}
|
|
1662
1638
|
);
|
|
1663
|
-
return
|
|
1639
|
+
return Se.create(f, [_]);
|
|
1664
1640
|
}
|
|
1665
|
-
return new
|
|
1666
|
-
key:
|
|
1641
|
+
return new se({
|
|
1642
|
+
key: q,
|
|
1667
1643
|
state: {
|
|
1668
1644
|
init() {
|
|
1669
1645
|
return {
|
|
@@ -1676,12 +1652,12 @@ function So(e) {
|
|
|
1676
1652
|
showTabIndicator: !1
|
|
1677
1653
|
};
|
|
1678
1654
|
},
|
|
1679
|
-
apply(p,
|
|
1680
|
-
const m = p.getMeta(
|
|
1655
|
+
apply(p, f) {
|
|
1656
|
+
const m = p.getMeta(q);
|
|
1681
1657
|
if (m) {
|
|
1682
1658
|
if (m.type === "close")
|
|
1683
|
-
return
|
|
1684
|
-
|
|
1659
|
+
return d = !0, setTimeout(() => {
|
|
1660
|
+
d = !1;
|
|
1685
1661
|
}, 0), {
|
|
1686
1662
|
active: !1,
|
|
1687
1663
|
range: null,
|
|
@@ -1692,18 +1668,18 @@ function So(e) {
|
|
|
1692
1668
|
showTabIndicator: !1
|
|
1693
1669
|
};
|
|
1694
1670
|
if (m.type === "updateIndex") {
|
|
1695
|
-
const
|
|
1671
|
+
const D = { ...f, selectedIndex: m.index }, Y = E(m.index, f.query, f.filteredSuggestions);
|
|
1696
1672
|
return {
|
|
1697
|
-
...
|
|
1698
|
-
autoCompleteText:
|
|
1699
|
-
showTabIndicator:
|
|
1673
|
+
...D,
|
|
1674
|
+
autoCompleteText: Y.text,
|
|
1675
|
+
showTabIndicator: Y.showTab
|
|
1700
1676
|
};
|
|
1701
1677
|
}
|
|
1702
1678
|
}
|
|
1703
|
-
if (
|
|
1704
|
-
return
|
|
1705
|
-
const
|
|
1706
|
-
if (!
|
|
1679
|
+
if (d || !p.docChanged && !p.selectionSet)
|
|
1680
|
+
return f;
|
|
1681
|
+
const y = p.doc.textContent.trim(), T = y;
|
|
1682
|
+
if (!y)
|
|
1707
1683
|
return {
|
|
1708
1684
|
active: !1,
|
|
1709
1685
|
range: null,
|
|
@@ -1713,7 +1689,7 @@ function So(e) {
|
|
|
1713
1689
|
autoCompleteText: "",
|
|
1714
1690
|
showTabIndicator: !1
|
|
1715
1691
|
};
|
|
1716
|
-
const _ = T
|
|
1692
|
+
const _ = x(T);
|
|
1717
1693
|
if (_.length === 0)
|
|
1718
1694
|
return {
|
|
1719
1695
|
active: !1,
|
|
@@ -1724,23 +1700,23 @@ function So(e) {
|
|
|
1724
1700
|
autoCompleteText: "",
|
|
1725
1701
|
showTabIndicator: !1
|
|
1726
1702
|
};
|
|
1727
|
-
const
|
|
1703
|
+
const S = E(0, T, _);
|
|
1728
1704
|
return {
|
|
1729
1705
|
active: !0,
|
|
1730
1706
|
range: { from: 0, to: p.doc.content.size },
|
|
1731
|
-
query:
|
|
1707
|
+
query: T,
|
|
1732
1708
|
filteredSuggestions: _,
|
|
1733
1709
|
selectedIndex: 0,
|
|
1734
|
-
autoCompleteText:
|
|
1735
|
-
showTabIndicator:
|
|
1710
|
+
autoCompleteText: S.text,
|
|
1711
|
+
showTabIndicator: S.showTab
|
|
1736
1712
|
};
|
|
1737
1713
|
}
|
|
1738
1714
|
},
|
|
1739
1715
|
props: {
|
|
1740
1716
|
decorations(p) {
|
|
1741
|
-
const
|
|
1742
|
-
return
|
|
1743
|
-
|
|
1717
|
+
const f = this.getState(p);
|
|
1718
|
+
return b(
|
|
1719
|
+
f || {
|
|
1744
1720
|
active: !1,
|
|
1745
1721
|
range: null,
|
|
1746
1722
|
autoCompleteText: "",
|
|
@@ -1748,29 +1724,29 @@ function So(e) {
|
|
|
1748
1724
|
}
|
|
1749
1725
|
);
|
|
1750
1726
|
},
|
|
1751
|
-
handleKeyDown(p,
|
|
1752
|
-
const m =
|
|
1727
|
+
handleKeyDown(p, f) {
|
|
1728
|
+
const m = q.getState(p.state);
|
|
1753
1729
|
if (!(m != null && m.active))
|
|
1754
1730
|
return !1;
|
|
1755
|
-
if (
|
|
1756
|
-
return
|
|
1757
|
-
if (
|
|
1758
|
-
|
|
1759
|
-
const
|
|
1760
|
-
let _ = m.selectedIndex +
|
|
1761
|
-
_ < 0 ? _ =
|
|
1762
|
-
const
|
|
1763
|
-
return
|
|
1731
|
+
if (P(f, "TAB") && m.autoCompleteText)
|
|
1732
|
+
return f.preventDefault(), v(p, m), !0;
|
|
1733
|
+
if (Ee(f, ["ARROW_UP", "ARROW_DOWN"])) {
|
|
1734
|
+
f.preventDefault();
|
|
1735
|
+
const y = P(f, "ARROW_DOWN") ? 1 : -1, T = m.filteredSuggestions.length;
|
|
1736
|
+
let _ = m.selectedIndex + y;
|
|
1737
|
+
_ < 0 ? _ = T - 1 : _ >= T && (_ = 0);
|
|
1738
|
+
const S = p.state.tr;
|
|
1739
|
+
return S.setMeta(q, {
|
|
1764
1740
|
type: "updateIndex",
|
|
1765
1741
|
index: _
|
|
1766
|
-
}), p.dispatch(
|
|
1742
|
+
}), p.dispatch(S), !0;
|
|
1767
1743
|
}
|
|
1768
|
-
if (n.includes(
|
|
1769
|
-
return
|
|
1770
|
-
if (
|
|
1771
|
-
|
|
1772
|
-
const
|
|
1773
|
-
return
|
|
1744
|
+
if (n.includes(f.key))
|
|
1745
|
+
return f.preventDefault(), v(p, m), !0;
|
|
1746
|
+
if (P(f, "ESCAPE")) {
|
|
1747
|
+
f.preventDefault();
|
|
1748
|
+
const y = p.state.tr;
|
|
1749
|
+
return y.setMeta(q, { type: "close" }), p.dispatch(y), !0;
|
|
1774
1750
|
}
|
|
1775
1751
|
return !1;
|
|
1776
1752
|
}
|
|
@@ -1778,49 +1754,49 @@ function So(e) {
|
|
|
1778
1754
|
view() {
|
|
1779
1755
|
return {
|
|
1780
1756
|
update(p) {
|
|
1781
|
-
const
|
|
1782
|
-
|
|
1783
|
-
show:
|
|
1784
|
-
suggestions:
|
|
1757
|
+
const f = q.getState(p.state);
|
|
1758
|
+
f != null && f.active && f.filteredSuggestions.length > 0 ? (i ? i.updateProps({
|
|
1759
|
+
show: f.active && f.filteredSuggestions.length > 0,
|
|
1760
|
+
suggestions: f.filteredSuggestions,
|
|
1785
1761
|
popupStyle: {
|
|
1786
1762
|
// 宽度在 computePosition 回调中动态设置,这里只设置 maxWidth
|
|
1787
1763
|
maxWidth: "100%"
|
|
1788
1764
|
},
|
|
1789
|
-
activeKeyboardIndex:
|
|
1790
|
-
inputValue:
|
|
1791
|
-
}) : (
|
|
1765
|
+
activeKeyboardIndex: f.selectedIndex,
|
|
1766
|
+
inputValue: f.query
|
|
1767
|
+
}) : (i = new Pt(Bo, {
|
|
1792
1768
|
props: {
|
|
1793
|
-
show:
|
|
1794
|
-
suggestions:
|
|
1769
|
+
show: f.active && f.filteredSuggestions.length > 0,
|
|
1770
|
+
suggestions: f.filteredSuggestions,
|
|
1795
1771
|
popupStyle: {
|
|
1796
1772
|
// 宽度在 computePosition 回调中动态设置,这里只设置 maxWidth
|
|
1797
1773
|
maxWidth: "100%"
|
|
1798
1774
|
},
|
|
1799
|
-
activeKeyboardIndex:
|
|
1775
|
+
activeKeyboardIndex: f.selectedIndex,
|
|
1800
1776
|
activeMouseIndex: -1,
|
|
1801
|
-
inputValue:
|
|
1777
|
+
inputValue: f.query,
|
|
1802
1778
|
onSelect: (m) => {
|
|
1803
|
-
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1779
|
+
w(p, f.range, m);
|
|
1780
|
+
const y = p.state.tr;
|
|
1781
|
+
y.setMeta(q, { type: "close" }), p.dispatch(y);
|
|
1806
1782
|
},
|
|
1807
1783
|
onMouseEnter: (m) => {
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1784
|
+
const y = p.state.tr;
|
|
1785
|
+
y.setMeta(q, { type: "updateIndex", index: m }), p.dispatch(y);
|
|
1810
1786
|
}
|
|
1811
1787
|
},
|
|
1812
1788
|
editor: t
|
|
1813
|
-
}), a =
|
|
1789
|
+
}), a = i.element, document.body.appendChild(a)), a && h(p, a)) : (i && (c == null || c(), c = null, i.destroy(), i = null), a && (a.remove(), a = null));
|
|
1814
1790
|
},
|
|
1815
1791
|
destroy() {
|
|
1816
|
-
c == null || c(),
|
|
1792
|
+
c == null || c(), i == null || i.destroy(), a == null || a.remove();
|
|
1817
1793
|
}
|
|
1818
1794
|
};
|
|
1819
1795
|
}
|
|
1820
1796
|
});
|
|
1821
1797
|
}
|
|
1822
|
-
const
|
|
1823
|
-
name:
|
|
1798
|
+
const Xt = It.create({
|
|
1799
|
+
name: ye.SUGGESTION,
|
|
1824
1800
|
addOptions() {
|
|
1825
1801
|
return {
|
|
1826
1802
|
items: [],
|
|
@@ -1836,11 +1812,11 @@ const zt = Mt.create({
|
|
|
1836
1812
|
};
|
|
1837
1813
|
},
|
|
1838
1814
|
onCreate() {
|
|
1839
|
-
|
|
1815
|
+
_e(this.options.items) && (this.storage.watchStopHandle = N(
|
|
1840
1816
|
this.options.items,
|
|
1841
1817
|
() => {
|
|
1842
1818
|
const e = this.editor.state.tr;
|
|
1843
|
-
e.setMeta(
|
|
1819
|
+
e.setMeta(q, { type: "update" }), this.editor.view.dispatch(e);
|
|
1844
1820
|
},
|
|
1845
1821
|
{ deep: !0 }
|
|
1846
1822
|
));
|
|
@@ -1850,59 +1826,59 @@ const zt = Mt.create({
|
|
|
1850
1826
|
},
|
|
1851
1827
|
addProseMirrorPlugins() {
|
|
1852
1828
|
return [
|
|
1853
|
-
|
|
1829
|
+
jo({
|
|
1854
1830
|
editor: this.editor,
|
|
1855
1831
|
...this.options
|
|
1856
1832
|
})
|
|
1857
1833
|
];
|
|
1858
1834
|
}
|
|
1859
1835
|
});
|
|
1860
|
-
function
|
|
1861
|
-
return
|
|
1836
|
+
function No(e, t) {
|
|
1837
|
+
return Xt.configure({
|
|
1862
1838
|
items: e,
|
|
1863
1839
|
...t
|
|
1864
1840
|
});
|
|
1865
1841
|
}
|
|
1866
|
-
function
|
|
1842
|
+
function Wo(e) {
|
|
1867
1843
|
const t = [];
|
|
1868
|
-
return e.state.doc.descendants((n,
|
|
1869
|
-
n.type.name ===
|
|
1844
|
+
return e.state.doc.descendants((n, s) => {
|
|
1845
|
+
n.type.name === C.TEMPLATE_BLOCK && t.push({ node: n, pos: s });
|
|
1870
1846
|
}), t;
|
|
1871
1847
|
}
|
|
1872
|
-
const
|
|
1848
|
+
const Ko = {
|
|
1873
1849
|
/**
|
|
1874
1850
|
* 设置模板数据(批量)
|
|
1875
1851
|
*/
|
|
1876
1852
|
setTemplateData: (e) => ({ commands: t }) => {
|
|
1877
1853
|
t.clearContent();
|
|
1878
1854
|
const n = [];
|
|
1879
|
-
return e.forEach((
|
|
1880
|
-
|
|
1881
|
-
type:
|
|
1882
|
-
text:
|
|
1883
|
-
}) :
|
|
1884
|
-
type:
|
|
1855
|
+
return e.forEach((s) => {
|
|
1856
|
+
s.type === z.TEXT ? s.content && n.push({
|
|
1857
|
+
type: C.TEXT,
|
|
1858
|
+
text: s.content
|
|
1859
|
+
}) : s.type === z.BLOCK ? n.push({
|
|
1860
|
+
type: C.TEMPLATE_BLOCK,
|
|
1885
1861
|
attrs: {
|
|
1886
|
-
id:
|
|
1887
|
-
content:
|
|
1862
|
+
id: s.id || be("template"),
|
|
1863
|
+
content: s.content
|
|
1888
1864
|
},
|
|
1889
|
-
content:
|
|
1865
|
+
content: s.content ? [
|
|
1890
1866
|
{
|
|
1891
|
-
type:
|
|
1892
|
-
text:
|
|
1867
|
+
type: C.TEXT,
|
|
1868
|
+
text: s.content
|
|
1893
1869
|
}
|
|
1894
1870
|
] : []
|
|
1895
|
-
}) :
|
|
1896
|
-
type:
|
|
1871
|
+
}) : s.type === z.SELECT && n.push({
|
|
1872
|
+
type: C.TEMPLATE_SELECT,
|
|
1897
1873
|
attrs: {
|
|
1898
|
-
id:
|
|
1899
|
-
placeholder:
|
|
1900
|
-
options:
|
|
1901
|
-
value:
|
|
1874
|
+
id: s.id || be("select"),
|
|
1875
|
+
placeholder: s.placeholder,
|
|
1876
|
+
options: s.options,
|
|
1877
|
+
value: s.value || null
|
|
1902
1878
|
}
|
|
1903
1879
|
});
|
|
1904
1880
|
}), n.length > 0 && t.insertContent({
|
|
1905
|
-
type:
|
|
1881
|
+
type: C.PARAGRAPH,
|
|
1906
1882
|
content: n
|
|
1907
1883
|
}), !0;
|
|
1908
1884
|
},
|
|
@@ -1912,14 +1888,14 @@ const Lo = {
|
|
|
1912
1888
|
insertTemplate: (e) => ({ commands: t }) => {
|
|
1913
1889
|
const n = e.content || "";
|
|
1914
1890
|
return t.insertContent({
|
|
1915
|
-
type:
|
|
1891
|
+
type: C.TEMPLATE_BLOCK,
|
|
1916
1892
|
attrs: {
|
|
1917
|
-
id: e.id ||
|
|
1893
|
+
id: e.id || be("template"),
|
|
1918
1894
|
content: n
|
|
1919
1895
|
},
|
|
1920
1896
|
content: n ? [
|
|
1921
1897
|
{
|
|
1922
|
-
type:
|
|
1898
|
+
type: C.TEXT,
|
|
1923
1899
|
text: n
|
|
1924
1900
|
}
|
|
1925
1901
|
] : []
|
|
@@ -1929,20 +1905,20 @@ const Lo = {
|
|
|
1929
1905
|
* 聚焦到第一个模板块
|
|
1930
1906
|
*/
|
|
1931
1907
|
focusFirstTemplate: () => ({ editor: e }) => {
|
|
1932
|
-
const t =
|
|
1908
|
+
const t = Wo(e);
|
|
1933
1909
|
return setTimeout(() => {
|
|
1934
|
-
var
|
|
1935
|
-
const { state: n, view:
|
|
1910
|
+
var o;
|
|
1911
|
+
const { state: n, view: s } = e, r = n.tr;
|
|
1936
1912
|
try {
|
|
1937
1913
|
let l;
|
|
1938
1914
|
if (t.length === 0)
|
|
1939
1915
|
l = n.doc.content.size - 1;
|
|
1940
1916
|
else {
|
|
1941
|
-
const { node: a, pos: c } = t[0],
|
|
1942
|
-
l = c + 1 +
|
|
1917
|
+
const { node: a, pos: c } = t[0], d = ((o = a.textContent) == null ? void 0 : o.length) || 0;
|
|
1918
|
+
l = c + 1 + d;
|
|
1943
1919
|
}
|
|
1944
|
-
const
|
|
1945
|
-
|
|
1920
|
+
const i = R.create(n.doc, l);
|
|
1921
|
+
r.setSelection(i), s.dispatch(r), s.focus();
|
|
1946
1922
|
} catch (l) {
|
|
1947
1923
|
console.error("[focusFirstTemplate] 设置光标失败", l);
|
|
1948
1924
|
}
|
|
@@ -1952,72 +1928,72 @@ const Lo = {
|
|
|
1952
1928
|
* 插入选择器
|
|
1953
1929
|
*/
|
|
1954
1930
|
insertTemplateSelect: (e) => ({ commands: t }) => t.insertContent({
|
|
1955
|
-
type:
|
|
1931
|
+
type: C.TEMPLATE_SELECT,
|
|
1956
1932
|
attrs: {
|
|
1957
|
-
id: e.id ||
|
|
1933
|
+
id: e.id || be("select"),
|
|
1958
1934
|
placeholder: e.placeholder || "Please select",
|
|
1959
1935
|
options: e.options || [],
|
|
1960
1936
|
value: e.value || null
|
|
1961
1937
|
}
|
|
1962
1938
|
})
|
|
1963
1939
|
}, A = "";
|
|
1964
|
-
function
|
|
1965
|
-
return
|
|
1940
|
+
function Qe(e) {
|
|
1941
|
+
return Yt(e).map((n) => n.content).join("");
|
|
1966
1942
|
}
|
|
1967
|
-
function
|
|
1943
|
+
function Yt(e) {
|
|
1968
1944
|
const t = [];
|
|
1969
|
-
return e.state.doc.descendants((n,
|
|
1970
|
-
if (
|
|
1971
|
-
if (n.type.name ===
|
|
1972
|
-
const
|
|
1945
|
+
return e.state.doc.descendants((n, s, r) => {
|
|
1946
|
+
if (r && r.type.name === C.PARAGRAPH) {
|
|
1947
|
+
if (n.type.name === C.TEMPLATE_BLOCK) {
|
|
1948
|
+
const o = (n.textContent || "").replace(new RegExp(A, "g"), "");
|
|
1973
1949
|
t.push({
|
|
1974
|
-
type:
|
|
1975
|
-
content:
|
|
1950
|
+
type: z.BLOCK,
|
|
1951
|
+
content: o
|
|
1976
1952
|
});
|
|
1977
|
-
} else if (n.type.name ===
|
|
1978
|
-
const
|
|
1953
|
+
} else if (n.type.name === C.TEMPLATE_SELECT) {
|
|
1954
|
+
const o = n.attrs.options.find((i) => i.value === n.attrs.value), l = (o == null ? void 0 : o.value) || "";
|
|
1979
1955
|
t.push({
|
|
1980
|
-
type:
|
|
1956
|
+
type: z.SELECT,
|
|
1981
1957
|
content: l
|
|
1982
1958
|
});
|
|
1983
|
-
} else if (n.type.name ===
|
|
1984
|
-
const
|
|
1985
|
-
if (
|
|
1959
|
+
} else if (n.type.name === C.TEXT) {
|
|
1960
|
+
const o = (n.text || "").replace(new RegExp(A, "g"), "");
|
|
1961
|
+
if (o) {
|
|
1986
1962
|
const l = t[t.length - 1];
|
|
1987
|
-
l && l.type ===
|
|
1988
|
-
type:
|
|
1989
|
-
content:
|
|
1963
|
+
l && l.type === z.TEXT ? l.content += o : t.push({
|
|
1964
|
+
type: z.TEXT,
|
|
1965
|
+
content: o
|
|
1990
1966
|
});
|
|
1991
1967
|
}
|
|
1992
1968
|
}
|
|
1993
1969
|
}
|
|
1994
1970
|
}), t;
|
|
1995
1971
|
}
|
|
1996
|
-
const
|
|
1972
|
+
const qo = /* @__PURE__ */ U({
|
|
1997
1973
|
__name: "template-block-view",
|
|
1998
1974
|
props: {
|
|
1999
1975
|
node: {}
|
|
2000
1976
|
},
|
|
2001
1977
|
setup(e) {
|
|
2002
|
-
const t = e, n =
|
|
2003
|
-
const
|
|
2004
|
-
return
|
|
1978
|
+
const t = e, n = I(() => {
|
|
1979
|
+
const s = t.node.textContent || "";
|
|
1980
|
+
return s.length === 0 || s === A;
|
|
2005
1981
|
});
|
|
2006
|
-
return (
|
|
1982
|
+
return (s, r) => (k(), F(L(rt), {
|
|
2007
1983
|
as: "span",
|
|
2008
|
-
class:
|
|
1984
|
+
class: Z(["template-block", { "is-empty": n.value }]),
|
|
2009
1985
|
"data-id": e.node.attrs.id
|
|
2010
1986
|
}, {
|
|
2011
1987
|
default: $(() => [
|
|
2012
|
-
|
|
1988
|
+
r[0] || (r[0] = B("span", {
|
|
2013
1989
|
contenteditable: "false",
|
|
2014
1990
|
class: "template-block__prefix"
|
|
2015
1991
|
}, " ", -1)),
|
|
2016
|
-
|
|
1992
|
+
ne(L(xn), {
|
|
2017
1993
|
as: "span",
|
|
2018
1994
|
class: "template-block__content"
|
|
2019
1995
|
}),
|
|
2020
|
-
|
|
1996
|
+
r[1] || (r[1] = B("span", {
|
|
2021
1997
|
contenteditable: "false",
|
|
2022
1998
|
class: "template-block__suffix"
|
|
2023
1999
|
}, " ", -1))
|
|
@@ -2025,237 +2001,237 @@ const Mo = /* @__PURE__ */ Y({
|
|
|
2025
2001
|
_: 1
|
|
2026
2002
|
}, 8, ["class", "data-id"]));
|
|
2027
2003
|
}
|
|
2028
|
-
}),
|
|
2029
|
-
function
|
|
2004
|
+
}), Ho = /* @__PURE__ */ X(qo, [["__scopeId", "data-v-aa55b9db"]]);
|
|
2005
|
+
function zo(e) {
|
|
2030
2006
|
const t = [];
|
|
2031
2007
|
let { tr: n } = e;
|
|
2032
|
-
return e.doc.descendants((
|
|
2033
|
-
if (
|
|
2034
|
-
const { lastChild: l, firstChild:
|
|
2035
|
-
if (
|
|
2036
|
-
const a =
|
|
2008
|
+
return e.doc.descendants((s, r, o) => {
|
|
2009
|
+
if (s.type.name === C.PARAGRAPH && s.childCount > 0) {
|
|
2010
|
+
const { lastChild: l, firstChild: i } = s;
|
|
2011
|
+
if (i && i.type.name === C.TEMPLATE_BLOCK && t.push(r + 1), l && l.type.name === C.TEMPLATE_BLOCK) {
|
|
2012
|
+
const a = r + s.nodeSize - 1;
|
|
2037
2013
|
n.doc.textBetween(a - 1, a, "", "") !== A && t.push(a);
|
|
2038
2014
|
}
|
|
2039
|
-
l ===
|
|
2015
|
+
l === i && l && l.isText && l.text === A && t.push(["remove", r + 1]);
|
|
2040
2016
|
}
|
|
2041
|
-
if (
|
|
2017
|
+
if (s.type.name === C.TEMPLATE_BLOCK && s.content.size === 0 && t.push(r + 1), s.type.name === C.TEMPLATE_BLOCK && o) {
|
|
2042
2018
|
let l = -1;
|
|
2043
|
-
if (
|
|
2044
|
-
|
|
2045
|
-
}), l > -1 && l <
|
|
2046
|
-
const a =
|
|
2019
|
+
if (o.forEach((i, a, c) => {
|
|
2020
|
+
i === s && (l = c);
|
|
2021
|
+
}), l > -1 && l < o.childCount - 1 && o.child(l + 1).type.name === C.TEMPLATE_BLOCK) {
|
|
2022
|
+
const a = r + s.nodeSize;
|
|
2047
2023
|
n.doc.textBetween(a, a + 1, "", "") !== A && t.push(a);
|
|
2048
2024
|
}
|
|
2049
2025
|
}
|
|
2050
|
-
}), t.length > 0 ? (t.sort((
|
|
2051
|
-
const
|
|
2052
|
-
return (Array.isArray(
|
|
2053
|
-
}).forEach((
|
|
2054
|
-
Array.isArray(
|
|
2026
|
+
}), t.length > 0 ? (t.sort((s, r) => {
|
|
2027
|
+
const o = Array.isArray(s) ? s[1] : s;
|
|
2028
|
+
return (Array.isArray(r) ? r[1] : r) - o;
|
|
2029
|
+
}).forEach((s) => {
|
|
2030
|
+
Array.isArray(s) && s[0] === "remove" ? n = n.delete(s[1], s[1] + 1) : typeof s == "number" && (n = n.insertText(A, s, s));
|
|
2055
2031
|
}), n) : null;
|
|
2056
2032
|
}
|
|
2057
|
-
function
|
|
2058
|
-
return new
|
|
2059
|
-
key: new
|
|
2033
|
+
function Fo() {
|
|
2034
|
+
return new se({
|
|
2035
|
+
key: new oe(ie.TEMPLATE_BLOCK_ZERO_WIDTH),
|
|
2060
2036
|
appendTransaction(e, t, n) {
|
|
2061
|
-
return e.some((
|
|
2037
|
+
return e.some((r) => r.docChanged) ? zo(n) : null;
|
|
2062
2038
|
}
|
|
2063
2039
|
});
|
|
2064
2040
|
}
|
|
2065
|
-
function
|
|
2066
|
-
return new
|
|
2067
|
-
key: new
|
|
2041
|
+
function Vo() {
|
|
2042
|
+
return new se({
|
|
2043
|
+
key: new oe(ie.TEMPLATE_BLOCK_KEYBOARD),
|
|
2068
2044
|
props: {
|
|
2069
2045
|
handleKeyDown(e, t) {
|
|
2070
|
-
var
|
|
2071
|
-
const { state: n, dispatch:
|
|
2072
|
-
if (
|
|
2073
|
-
const v =
|
|
2046
|
+
var i, a, c, d, u, x, g, E, w;
|
|
2047
|
+
const { state: n, dispatch: s } = e, { selection: r } = n, { $from: o } = r;
|
|
2048
|
+
if (P(t, "ARROW_LEFT") && o.nodeBefore && o.nodeBefore.isText && o.nodeBefore.text && o.nodeBefore.text === A) {
|
|
2049
|
+
const v = o.parent, h = o.index();
|
|
2074
2050
|
if (h >= 2) {
|
|
2075
|
-
if (v.child(h - 2).type.name ===
|
|
2076
|
-
const p =
|
|
2077
|
-
return
|
|
2051
|
+
if (v.child(h - 2).type.name === C.TEMPLATE_BLOCK) {
|
|
2052
|
+
const p = o.pos - 2;
|
|
2053
|
+
return s(n.tr.setSelection(R.create(n.doc, p))), t.preventDefault(), !0;
|
|
2078
2054
|
}
|
|
2079
|
-
} else if (h === 1 &&
|
|
2080
|
-
const
|
|
2081
|
-
if (
|
|
2082
|
-
return
|
|
2055
|
+
} else if (h === 1 && o.pos !== 0) {
|
|
2056
|
+
const b = o.before() - 1;
|
|
2057
|
+
if (b >= 0)
|
|
2058
|
+
return s(n.tr.setSelection(R.create(n.doc, b))), t.preventDefault(), !0;
|
|
2083
2059
|
}
|
|
2084
2060
|
}
|
|
2085
|
-
if (
|
|
2086
|
-
const v =
|
|
2061
|
+
if (P(t, "ARROW_RIGHT") && o.nodeAfter && o.nodeAfter.isText && o.nodeAfter.text === A) {
|
|
2062
|
+
const v = o.parent, h = o.index();
|
|
2087
2063
|
if (h < v.childCount - 1) {
|
|
2088
|
-
if (v.child(h + 1).type.name ===
|
|
2089
|
-
const p =
|
|
2090
|
-
return
|
|
2064
|
+
if (v.child(h + 1).type.name === C.TEMPLATE_BLOCK) {
|
|
2065
|
+
const p = o.pos + 2;
|
|
2066
|
+
return s(n.tr.setSelection(R.create(n.doc, p))), t.preventDefault(), !0;
|
|
2091
2067
|
}
|
|
2092
|
-
} else if (h === v.childCount - 1 && n.doc.lastChild !==
|
|
2093
|
-
const
|
|
2094
|
-
return
|
|
2068
|
+
} else if (h === v.childCount - 1 && n.doc.lastChild !== o.node()) {
|
|
2069
|
+
const b = o.after() + 1;
|
|
2070
|
+
return s(n.tr.setSelection(R.create(n.doc, b))), t.preventDefault(), !0;
|
|
2095
2071
|
}
|
|
2096
2072
|
}
|
|
2097
|
-
const l =
|
|
2098
|
-
if (l.type.name ===
|
|
2073
|
+
const l = o.node();
|
|
2074
|
+
if (l.type.name === C.TEMPLATE_BLOCK) {
|
|
2099
2075
|
const v = l.textContent || "";
|
|
2100
2076
|
if (v === "" || v === A) {
|
|
2101
|
-
if (
|
|
2102
|
-
const h =
|
|
2103
|
-
if (
|
|
2104
|
-
return
|
|
2077
|
+
if (Ee(t, ["ARROW_LEFT", "ARROW_RIGHT"])) {
|
|
2078
|
+
const h = P(t, "ARROW_LEFT") ? o.before() : o.after();
|
|
2079
|
+
if (r.from !== h)
|
|
2080
|
+
return s(n.tr.setSelection(R.create(n.doc, h))), t.preventDefault(), !0;
|
|
2105
2081
|
}
|
|
2106
2082
|
} else {
|
|
2107
|
-
if (
|
|
2108
|
-
const h =
|
|
2109
|
-
return
|
|
2083
|
+
if (P(t, "ARROW_LEFT") && o.pos === o.start()) {
|
|
2084
|
+
const h = o.before();
|
|
2085
|
+
return s(n.tr.setSelection(R.create(n.doc, h))), t.preventDefault(), !0;
|
|
2110
2086
|
}
|
|
2111
|
-
if (
|
|
2112
|
-
const h =
|
|
2113
|
-
return
|
|
2087
|
+
if (P(t, "ARROW_RIGHT") && o.pos === o.end()) {
|
|
2088
|
+
const h = o.after();
|
|
2089
|
+
return s(n.tr.setSelection(R.create(n.doc, h))), t.preventDefault(), !0;
|
|
2114
2090
|
}
|
|
2115
2091
|
}
|
|
2116
2092
|
}
|
|
2117
|
-
if (
|
|
2118
|
-
const v =
|
|
2119
|
-
if (v.type.name ===
|
|
2120
|
-
const
|
|
2121
|
-
if (
|
|
2122
|
-
const p =
|
|
2123
|
-
return
|
|
2093
|
+
if (P(t, "BACKSPACE") && r.empty) {
|
|
2094
|
+
const v = o.node(), h = o.nodeBefore;
|
|
2095
|
+
if (v.type.name === C.TEMPLATE_BLOCK) {
|
|
2096
|
+
const b = v.textContent || "";
|
|
2097
|
+
if (o.pos === o.end() && b.length === 1 && b !== A) {
|
|
2098
|
+
const p = o.pos - 1;
|
|
2099
|
+
return s(n.tr.insertText(A, p, p + 1)), t.preventDefault(), !0;
|
|
2124
2100
|
}
|
|
2125
|
-
if (
|
|
2126
|
-
const p =
|
|
2127
|
-
return
|
|
2101
|
+
if (b === A) {
|
|
2102
|
+
const p = o.before(), f = n.tr.setSelection(R.create(n.doc, p));
|
|
2103
|
+
return s(f), t.preventDefault(), !0;
|
|
2128
2104
|
}
|
|
2129
|
-
if (
|
|
2130
|
-
const p =
|
|
2131
|
-
return
|
|
2105
|
+
if (b === "") {
|
|
2106
|
+
const p = o.before(), f = n.tr.setSelection(R.create(n.doc, p));
|
|
2107
|
+
return s(f), t.preventDefault(), !0;
|
|
2132
2108
|
}
|
|
2133
|
-
if (
|
|
2134
|
-
const p =
|
|
2135
|
-
return
|
|
2109
|
+
if (o.pos === o.start() && b.length > 0 && b !== A) {
|
|
2110
|
+
const p = o.before();
|
|
2111
|
+
return s(n.tr.setSelection(R.create(n.doc, p))), t.preventDefault(), !0;
|
|
2136
2112
|
}
|
|
2137
2113
|
return !1;
|
|
2138
2114
|
}
|
|
2139
|
-
if (h && h.isText && ((
|
|
2140
|
-
const
|
|
2141
|
-
let
|
|
2142
|
-
return
|
|
2115
|
+
if (h && h.isText && ((i = h.text) == null ? void 0 : i.length) === 1 && h.text !== A && o.nodeAfter && o.nodeAfter.type.name === C.TEMPLATE_BLOCK) {
|
|
2116
|
+
const b = o.pos - h.nodeSize, p = o.pos;
|
|
2117
|
+
let f = n.tr.delete(b, p);
|
|
2118
|
+
return f = f.insertText(A, b, b), s(f), t.preventDefault(), !0;
|
|
2143
2119
|
}
|
|
2144
|
-
if (h && h.type.name ===
|
|
2145
|
-
const
|
|
2146
|
-
if (
|
|
2147
|
-
const
|
|
2148
|
-
let
|
|
2120
|
+
if (h && h.type.name === C.TEMPLATE_BLOCK) {
|
|
2121
|
+
const b = h.textContent || "";
|
|
2122
|
+
if (b.length === 0 || b === A) {
|
|
2123
|
+
const f = o.parent, m = o.index(), y = o.nodeAfter;
|
|
2124
|
+
let T = o.pos - h.nodeSize, _ = o.pos;
|
|
2149
2125
|
if (m > 1) {
|
|
2150
|
-
const
|
|
2151
|
-
|
|
2126
|
+
const S = f.child(m - 2);
|
|
2127
|
+
S && S.isText && S.text === A && (T = T - 1);
|
|
2152
2128
|
}
|
|
2153
|
-
return
|
|
2129
|
+
return y && y.isText && ((a = y.text) != null && a.startsWith(A)) && (_ = _ + 1), s(n.tr.delete(T, _)), t.preventDefault(), !0;
|
|
2154
2130
|
} else {
|
|
2155
|
-
const
|
|
2156
|
-
return
|
|
2131
|
+
const f = o.pos - 1;
|
|
2132
|
+
return s(n.tr.setSelection(R.create(n.doc, f))), t.preventDefault(), !0;
|
|
2157
2133
|
}
|
|
2158
2134
|
}
|
|
2159
2135
|
if (h && h.isText) {
|
|
2160
|
-
const
|
|
2136
|
+
const b = o.parent, p = o.index();
|
|
2161
2137
|
if (h.text === A) {
|
|
2162
2138
|
if (p > 1) {
|
|
2163
|
-
const
|
|
2164
|
-
if (
|
|
2165
|
-
const m =
|
|
2139
|
+
const f = b.child(p - 2);
|
|
2140
|
+
if (f.type.name === C.TEMPLATE_BLOCK) {
|
|
2141
|
+
const m = f.textContent || "";
|
|
2166
2142
|
if (m.length === 0 || m === A) {
|
|
2167
|
-
const
|
|
2168
|
-
let
|
|
2169
|
-
return _ && _.isText && _.text === A && (
|
|
2143
|
+
const T = o.pos - h.nodeSize - f.nodeSize, _ = o.nodeAfter;
|
|
2144
|
+
let S = o.pos;
|
|
2145
|
+
return _ && _.isText && _.text === A && (S = S + 1), s(n.tr.delete(T, S)), t.preventDefault(), !0;
|
|
2170
2146
|
} else {
|
|
2171
|
-
const
|
|
2172
|
-
if (
|
|
2173
|
-
return
|
|
2147
|
+
const T = o.pos - 2;
|
|
2148
|
+
if (T >= 0)
|
|
2149
|
+
return s(n.tr.setSelection(R.create(n.doc, T))), t.preventDefault(), !0;
|
|
2174
2150
|
}
|
|
2175
2151
|
}
|
|
2176
2152
|
}
|
|
2177
|
-
} else if (p === 1 &&
|
|
2178
|
-
const
|
|
2179
|
-
if (
|
|
2180
|
-
return
|
|
2153
|
+
} else if (p === 1 && o.pos !== 1 && h.text === A) {
|
|
2154
|
+
const f = r.from - 1 - 2;
|
|
2155
|
+
if (f >= 0)
|
|
2156
|
+
return s(n.tr.delete(f, r.to)), t.preventDefault(), !0;
|
|
2181
2157
|
}
|
|
2182
2158
|
}
|
|
2183
2159
|
}
|
|
2184
|
-
if (
|
|
2185
|
-
let v =
|
|
2186
|
-
const
|
|
2187
|
-
if (
|
|
2188
|
-
const
|
|
2189
|
-
return
|
|
2160
|
+
if (P(t, "BACKSPACE") && !r.empty) {
|
|
2161
|
+
let v = r.from, h = r.to;
|
|
2162
|
+
const b = o.nodeBefore, p = o.nodeAfter;
|
|
2163
|
+
if (b && b.isText && ((c = b.text) != null && c.endsWith(A)) && (v -= 1), p && p.isText && ((d = p.text) != null && d.startsWith(A)) && (h += 1), v !== r.from || h !== r.to) {
|
|
2164
|
+
const f = n.tr.delete(v, h);
|
|
2165
|
+
return s(f), t.preventDefault(), !0;
|
|
2190
2166
|
}
|
|
2191
2167
|
}
|
|
2192
|
-
if (
|
|
2193
|
-
const v =
|
|
2194
|
-
if (v.type.name ===
|
|
2195
|
-
const
|
|
2196
|
-
if (
|
|
2197
|
-
const p =
|
|
2198
|
-
return
|
|
2168
|
+
if (P(t, "DELETE") && r.empty) {
|
|
2169
|
+
const v = o.node(), h = o.nodeAfter;
|
|
2170
|
+
if (v.type.name === C.TEMPLATE_BLOCK) {
|
|
2171
|
+
const b = v.textContent || "";
|
|
2172
|
+
if (o.pos === o.start() && b.length === 1 && b !== A) {
|
|
2173
|
+
const p = o.pos;
|
|
2174
|
+
return s(n.tr.insertText(A, p, p + 1)), t.preventDefault(), !0;
|
|
2199
2175
|
}
|
|
2200
|
-
if (
|
|
2201
|
-
const p =
|
|
2202
|
-
return
|
|
2176
|
+
if (b === A) {
|
|
2177
|
+
const p = o.after(), f = n.tr.setSelection(R.create(n.doc, p));
|
|
2178
|
+
return s(f), t.preventDefault(), !0;
|
|
2203
2179
|
}
|
|
2204
|
-
if (
|
|
2205
|
-
const p =
|
|
2206
|
-
return
|
|
2180
|
+
if (b === "") {
|
|
2181
|
+
const p = o.after(), f = n.tr.setSelection(R.create(n.doc, p));
|
|
2182
|
+
return s(f), t.preventDefault(), !0;
|
|
2207
2183
|
}
|
|
2208
|
-
if (
|
|
2209
|
-
const p =
|
|
2210
|
-
return
|
|
2184
|
+
if (o.pos === o.end() && b.length > 0 && b !== A) {
|
|
2185
|
+
const p = o.after();
|
|
2186
|
+
return s(n.tr.setSelection(R.create(n.doc, p))), t.preventDefault(), !0;
|
|
2211
2187
|
}
|
|
2212
2188
|
return !1;
|
|
2213
2189
|
}
|
|
2214
|
-
if (h && h.isText && ((u = h.text) == null ? void 0 : u.length) === 1 && h.text !== A &&
|
|
2215
|
-
const
|
|
2216
|
-
let
|
|
2217
|
-
return
|
|
2190
|
+
if (h && h.isText && ((u = h.text) == null ? void 0 : u.length) === 1 && h.text !== A && o.nodeBefore && o.nodeBefore.type.name === C.TEMPLATE_BLOCK) {
|
|
2191
|
+
const b = o.pos, p = o.pos + h.nodeSize;
|
|
2192
|
+
let f = n.tr.delete(b, p);
|
|
2193
|
+
return f = f.insertText(A, b, b), s(f), t.preventDefault(), !0;
|
|
2218
2194
|
}
|
|
2219
|
-
if (h && h.type.name ===
|
|
2220
|
-
const
|
|
2221
|
-
if (
|
|
2222
|
-
const
|
|
2223
|
-
let
|
|
2224
|
-
if (
|
|
2225
|
-
const
|
|
2226
|
-
|
|
2195
|
+
if (h && h.type.name === C.TEMPLATE_BLOCK) {
|
|
2196
|
+
const b = h.textContent || "";
|
|
2197
|
+
if (b.length === 0 || b === A) {
|
|
2198
|
+
const f = o.parent, m = o.index(), y = o.nodeBefore;
|
|
2199
|
+
let T = o.pos, _ = o.pos + h.nodeSize;
|
|
2200
|
+
if (y && y.isText && y.text === A && (T = T - 1), m < f.childCount - 1) {
|
|
2201
|
+
const S = f.child(m + 1);
|
|
2202
|
+
S && S.isText && S.text === A && (_ = _ + 1);
|
|
2227
2203
|
}
|
|
2228
|
-
return
|
|
2204
|
+
return s(n.tr.delete(T, _)), t.preventDefault(), !0;
|
|
2229
2205
|
} else {
|
|
2230
|
-
const
|
|
2231
|
-
return
|
|
2206
|
+
const f = o.pos + 1;
|
|
2207
|
+
return s(n.tr.setSelection(R.create(n.doc, f))), t.preventDefault(), !0;
|
|
2232
2208
|
}
|
|
2233
2209
|
}
|
|
2234
2210
|
if (h && h.isText) {
|
|
2235
|
-
const
|
|
2236
|
-
if (p <
|
|
2237
|
-
const
|
|
2238
|
-
if (
|
|
2239
|
-
const m =
|
|
2211
|
+
const b = o.parent, p = o.index();
|
|
2212
|
+
if (p < b.childCount - 1) {
|
|
2213
|
+
const f = b.child(p + 1);
|
|
2214
|
+
if (f.type.name === C.TEMPLATE_BLOCK) {
|
|
2215
|
+
const m = f.textContent || "";
|
|
2240
2216
|
if (m.length === 0 || m === A) {
|
|
2241
|
-
let
|
|
2242
|
-
const _ =
|
|
2243
|
-
return
|
|
2217
|
+
let T = o.pos;
|
|
2218
|
+
const _ = o.pos + h.nodeSize + f.nodeSize, S = o.nodeBefore;
|
|
2219
|
+
return S && S.isText && ((x = S.text) != null && x.endsWith(A)) && (T = T - 1), s(n.tr.delete(T, _)), t.preventDefault(), !0;
|
|
2244
2220
|
}
|
|
2245
|
-
if (h.text === A || (
|
|
2246
|
-
const
|
|
2247
|
-
return
|
|
2221
|
+
if (h.text === A || (g = h.text) != null && g.startsWith(A)) {
|
|
2222
|
+
const T = o.pos + 2;
|
|
2223
|
+
return s(n.tr.setSelection(R.create(n.doc, T))), t.preventDefault(), !0;
|
|
2248
2224
|
}
|
|
2249
2225
|
}
|
|
2250
2226
|
}
|
|
2251
2227
|
}
|
|
2252
2228
|
}
|
|
2253
|
-
if (
|
|
2254
|
-
let v =
|
|
2255
|
-
const
|
|
2256
|
-
if (
|
|
2257
|
-
const
|
|
2258
|
-
return
|
|
2229
|
+
if (P(t, "DELETE") && !r.empty) {
|
|
2230
|
+
let v = r.from, h = r.to;
|
|
2231
|
+
const b = o.nodeBefore, p = o.nodeAfter;
|
|
2232
|
+
if (b && b.isText && ((E = b.text) != null && E.endsWith(A)) && (v -= 1), p && p.isText && ((w = p.text) != null && w.startsWith(A)) && (h += 1), v !== r.from || h !== r.to) {
|
|
2233
|
+
const f = n.tr.delete(v, h);
|
|
2234
|
+
return s(f), t.preventDefault(), !0;
|
|
2259
2235
|
}
|
|
2260
2236
|
}
|
|
2261
2237
|
return !1;
|
|
@@ -2263,43 +2239,43 @@ function Do() {
|
|
|
2263
2239
|
}
|
|
2264
2240
|
});
|
|
2265
2241
|
}
|
|
2266
|
-
function
|
|
2267
|
-
return new
|
|
2268
|
-
key: new
|
|
2242
|
+
function Go() {
|
|
2243
|
+
return new se({
|
|
2244
|
+
key: new oe(ie.TEMPLATE_BLOCK_PASTE),
|
|
2269
2245
|
props: {
|
|
2270
2246
|
handlePaste(e, t) {
|
|
2271
|
-
var
|
|
2272
|
-
const n = ((
|
|
2273
|
-
if (n.includes("text/html") && (
|
|
2247
|
+
var o, l, i;
|
|
2248
|
+
const n = ((o = t.clipboardData) == null ? void 0 : o.types) || [], s = (l = t.clipboardData) == null ? void 0 : l.getData("text/html");
|
|
2249
|
+
if (n.includes("text/html") && (s != null && s.includes("data-template")) || n.includes("application/x-prosemirror-slice"))
|
|
2274
2250
|
return !1;
|
|
2275
|
-
const
|
|
2276
|
-
if (
|
|
2277
|
-
const { state: a, dispatch: c } = e,
|
|
2251
|
+
const r = (i = t.clipboardData) == null ? void 0 : i.getData("text/plain");
|
|
2252
|
+
if (r) {
|
|
2253
|
+
const { state: a, dispatch: c } = e, d = a.selection.$from;
|
|
2278
2254
|
let u = a.tr;
|
|
2279
|
-
|
|
2280
|
-
const
|
|
2255
|
+
d.nodeBefore && d.nodeBefore.isText && d.nodeBefore.text === A && (u = u.delete(d.pos - d.nodeBefore.nodeSize, d.pos)), d.nodeAfter && d.nodeAfter.isText && d.nodeAfter.text === A && (u = u.delete(d.pos, d.pos + d.nodeAfter.nodeSize));
|
|
2256
|
+
const x = r.split(`
|
|
2281
2257
|
`);
|
|
2282
|
-
let
|
|
2283
|
-
if (
|
|
2284
|
-
u = u.insertText(
|
|
2258
|
+
let g;
|
|
2259
|
+
if (x.length === 1)
|
|
2260
|
+
u = u.insertText(x[0], u.selection.from, u.selection.to), g = u.selection.$to.pos;
|
|
2285
2261
|
else {
|
|
2286
|
-
u = u.insertText(
|
|
2287
|
-
let
|
|
2288
|
-
for (let
|
|
2289
|
-
const v = a.schema.nodes.paragraph.create({},
|
|
2290
|
-
u = u.insert(
|
|
2262
|
+
u = u.insertText(x[0], u.selection.from, u.selection.to);
|
|
2263
|
+
let E = u.selection.$to.pos;
|
|
2264
|
+
for (let w = 1; w < x.length; w++) {
|
|
2265
|
+
const v = a.schema.nodes.paragraph.create({}, x[w] ? a.schema.text(x[w]) : null);
|
|
2266
|
+
u = u.insert(E, v), E += v.nodeSize;
|
|
2291
2267
|
}
|
|
2292
|
-
|
|
2268
|
+
g = E;
|
|
2293
2269
|
}
|
|
2294
|
-
return u = u.setSelection(R.create(u.doc,
|
|
2270
|
+
return u = u.setSelection(R.create(u.doc, g)), u = u.scrollIntoView(), c(u), t.preventDefault(), !0;
|
|
2295
2271
|
}
|
|
2296
2272
|
return !1;
|
|
2297
2273
|
}
|
|
2298
2274
|
}
|
|
2299
2275
|
});
|
|
2300
2276
|
}
|
|
2301
|
-
const
|
|
2302
|
-
name:
|
|
2277
|
+
const Uo = lt.create({
|
|
2278
|
+
name: C.TEMPLATE_BLOCK,
|
|
2303
2279
|
// 节点配置
|
|
2304
2280
|
group: "inline",
|
|
2305
2281
|
inline: !0,
|
|
@@ -2311,10 +2287,10 @@ const Bo = nt.create({
|
|
|
2311
2287
|
draggable: !1,
|
|
2312
2288
|
onCreate() {
|
|
2313
2289
|
const { items: e } = this.options;
|
|
2314
|
-
e &&
|
|
2290
|
+
e && _e(e) && N(
|
|
2315
2291
|
e,
|
|
2316
2292
|
() => {
|
|
2317
|
-
const t =
|
|
2293
|
+
const t = _e(e) ? e.value : e;
|
|
2318
2294
|
t != null && (this.editor.commands.setTemplateData(t), this.editor.commands.focusFirstTemplate());
|
|
2319
2295
|
},
|
|
2320
2296
|
{ deep: !0, immediate: !0 }
|
|
@@ -2352,7 +2328,7 @@ const Bo = nt.create({
|
|
|
2352
2328
|
const n = e.textContent || "";
|
|
2353
2329
|
return [
|
|
2354
2330
|
"span",
|
|
2355
|
-
|
|
2331
|
+
at(this.options.HTMLAttributes || {}, t, {
|
|
2356
2332
|
"data-template": "",
|
|
2357
2333
|
"data-id": e.attrs.id,
|
|
2358
2334
|
"data-content": n
|
|
@@ -2362,18 +2338,18 @@ const Bo = nt.create({
|
|
|
2362
2338
|
},
|
|
2363
2339
|
// 使用 Vue 组件渲染
|
|
2364
2340
|
addNodeView() {
|
|
2365
|
-
return
|
|
2341
|
+
return it(Ho);
|
|
2366
2342
|
},
|
|
2367
2343
|
// 添加插件
|
|
2368
2344
|
addProseMirrorPlugins() {
|
|
2369
|
-
return [
|
|
2345
|
+
return [Fo(), Vo(), Go()];
|
|
2370
2346
|
}
|
|
2371
|
-
}),
|
|
2372
|
-
|
|
2347
|
+
}), we = new oe(
|
|
2348
|
+
ie.TEMPLATE_SELECT_DROPDOWN
|
|
2373
2349
|
);
|
|
2374
|
-
function
|
|
2375
|
-
return new
|
|
2376
|
-
key:
|
|
2350
|
+
function Xo() {
|
|
2351
|
+
return new se({
|
|
2352
|
+
key: we,
|
|
2377
2353
|
state: {
|
|
2378
2354
|
init() {
|
|
2379
2355
|
return {
|
|
@@ -2382,7 +2358,7 @@ function Io() {
|
|
|
2382
2358
|
};
|
|
2383
2359
|
},
|
|
2384
2360
|
apply(e, t) {
|
|
2385
|
-
const n = e.getMeta(
|
|
2361
|
+
const n = e.getMeta(we);
|
|
2386
2362
|
if (n) {
|
|
2387
2363
|
if (n.type === "open")
|
|
2388
2364
|
return {
|
|
@@ -2400,89 +2376,89 @@ function Io() {
|
|
|
2400
2376
|
}
|
|
2401
2377
|
});
|
|
2402
2378
|
}
|
|
2403
|
-
function
|
|
2404
|
-
return new
|
|
2405
|
-
key: new
|
|
2379
|
+
function Yo() {
|
|
2380
|
+
return new se({
|
|
2381
|
+
key: new oe(ie.TEMPLATE_SELECT_ZERO_WIDTH),
|
|
2406
2382
|
appendTransaction(e, t, n) {
|
|
2407
2383
|
if (!e.some((l) => l.docChanged)) return null;
|
|
2408
|
-
const
|
|
2409
|
-
let { tr:
|
|
2410
|
-
return n.doc.descendants((l,
|
|
2411
|
-
if (l.type.name ===
|
|
2384
|
+
const r = [];
|
|
2385
|
+
let { tr: o } = n;
|
|
2386
|
+
return n.doc.descendants((l, i) => {
|
|
2387
|
+
if (l.type.name === C.PARAGRAPH && l.childCount > 0) {
|
|
2412
2388
|
const { lastChild: a, firstChild: c } = l;
|
|
2413
|
-
a === c && a && a.isText && a.text === A &&
|
|
2389
|
+
a === c && a && a.isText && a.text === A && r.push(["remove", i + 1]);
|
|
2414
2390
|
}
|
|
2415
|
-
}),
|
|
2416
|
-
|
|
2417
|
-
}),
|
|
2391
|
+
}), r.length > 0 ? (r.forEach(([, l]) => {
|
|
2392
|
+
o = o.delete(l, l + 1);
|
|
2393
|
+
}), o) : null;
|
|
2418
2394
|
}
|
|
2419
2395
|
});
|
|
2420
2396
|
}
|
|
2421
|
-
function
|
|
2422
|
-
return new
|
|
2423
|
-
key: new
|
|
2397
|
+
function Zo() {
|
|
2398
|
+
return new se({
|
|
2399
|
+
key: new oe(ie.TEMPLATE_SELECT_KEYBOARD),
|
|
2424
2400
|
props: {
|
|
2425
2401
|
handleKeyDown(e, t) {
|
|
2426
|
-
const { state: n, dispatch:
|
|
2427
|
-
if (l != null && l.isOpen &&
|
|
2402
|
+
const { state: n, dispatch: s } = e, { selection: r } = n, { $from: o } = r, l = we.getState(e.state);
|
|
2403
|
+
if (l != null && l.isOpen && Ee(t, ["ENTER", "ARROW_UP", "ARROW_DOWN", "ESCAPE"]))
|
|
2428
2404
|
return !0;
|
|
2429
|
-
if (
|
|
2430
|
-
const
|
|
2431
|
-
if ((
|
|
2432
|
-
return
|
|
2433
|
-
if (
|
|
2434
|
-
const c =
|
|
2435
|
-
if ((u == null ? void 0 : u.type.name) ===
|
|
2436
|
-
const
|
|
2437
|
-
return
|
|
2405
|
+
if (P(t, "BACKSPACE") && r.empty) {
|
|
2406
|
+
const i = o.nodeBefore, a = o.nodeAfter;
|
|
2407
|
+
if ((i == null ? void 0 : i.type.name) === C.TEMPLATE_SELECT)
|
|
2408
|
+
return s(n.tr.delete(o.pos - i.nodeSize, o.pos)), t.preventDefault(), !0;
|
|
2409
|
+
if (i != null && i.isText && i.text === A) {
|
|
2410
|
+
const c = o.pos - 1, u = n.doc.resolve(c).nodeBefore;
|
|
2411
|
+
if ((u == null ? void 0 : u.type.name) === C.TEMPLATE_SELECT) {
|
|
2412
|
+
const x = c - u.nodeSize, g = o.pos;
|
|
2413
|
+
return s(n.tr.delete(x, g)), t.preventDefault(), !0;
|
|
2438
2414
|
}
|
|
2439
2415
|
}
|
|
2440
|
-
if ((a == null ? void 0 : a.type.name) ===
|
|
2441
|
-
if (
|
|
2442
|
-
return
|
|
2443
|
-
if ((
|
|
2416
|
+
if ((a == null ? void 0 : a.type.name) === C.TEMPLATE_SELECT) {
|
|
2417
|
+
if (i != null && i.isText && i.text !== A)
|
|
2418
|
+
return s(n.tr.delete(o.pos - 1, o.pos)), t.preventDefault(), !0;
|
|
2419
|
+
if ((i == null ? void 0 : i.type.name) === C.TEMPLATE_BLOCK)
|
|
2444
2420
|
return !1;
|
|
2445
2421
|
}
|
|
2446
|
-
if (!a && (
|
|
2447
|
-
return
|
|
2422
|
+
if (!a && (i != null && i.isText) && i.text !== A)
|
|
2423
|
+
return s(n.tr.delete(o.pos - 1, o.pos)), t.preventDefault(), !0;
|
|
2448
2424
|
}
|
|
2449
|
-
if (
|
|
2450
|
-
const
|
|
2451
|
-
if ((
|
|
2452
|
-
return
|
|
2453
|
-
if (
|
|
2454
|
-
const c =
|
|
2455
|
-
if ((u == null ? void 0 : u.type.name) ===
|
|
2456
|
-
const
|
|
2457
|
-
return
|
|
2425
|
+
if (P(t, "DELETE") && r.empty) {
|
|
2426
|
+
const i = o.nodeAfter, a = o.nodeBefore;
|
|
2427
|
+
if ((i == null ? void 0 : i.type.name) === C.TEMPLATE_SELECT)
|
|
2428
|
+
return s(n.tr.delete(o.pos, o.pos + i.nodeSize)), t.preventDefault(), !0;
|
|
2429
|
+
if (i != null && i.isText && i.text === A) {
|
|
2430
|
+
const c = o.pos + 1, u = n.doc.resolve(c).nodeAfter;
|
|
2431
|
+
if ((u == null ? void 0 : u.type.name) === C.TEMPLATE_SELECT) {
|
|
2432
|
+
const x = c + u.nodeSize;
|
|
2433
|
+
return s(n.tr.delete(o.pos, x)), t.preventDefault(), !0;
|
|
2458
2434
|
}
|
|
2459
2435
|
}
|
|
2460
|
-
if ((a == null ? void 0 : a.type.name) ===
|
|
2461
|
-
if (
|
|
2462
|
-
return
|
|
2463
|
-
if ((
|
|
2436
|
+
if ((a == null ? void 0 : a.type.name) === C.TEMPLATE_SELECT) {
|
|
2437
|
+
if (i != null && i.isText && i.text !== A)
|
|
2438
|
+
return s(n.tr.delete(o.pos, o.pos + 1)), t.preventDefault(), !0;
|
|
2439
|
+
if ((i == null ? void 0 : i.type.name) === C.TEMPLATE_BLOCK)
|
|
2464
2440
|
return !1;
|
|
2465
2441
|
}
|
|
2466
|
-
if (!a && (
|
|
2467
|
-
return
|
|
2442
|
+
if (!a && (i != null && i.isText) && i.text !== A)
|
|
2443
|
+
return s(n.tr.delete(o.pos, o.pos + 1)), t.preventDefault(), !0;
|
|
2468
2444
|
}
|
|
2469
2445
|
return !1;
|
|
2470
2446
|
}
|
|
2471
2447
|
}
|
|
2472
2448
|
});
|
|
2473
2449
|
}
|
|
2474
|
-
function
|
|
2475
|
-
const
|
|
2476
|
-
const
|
|
2477
|
-
!e.contains(
|
|
2450
|
+
function Jo(e, t, n) {
|
|
2451
|
+
const s = (r) => {
|
|
2452
|
+
const o = r.target;
|
|
2453
|
+
!e.contains(o) && !t.contains(o) && (n(), document.removeEventListener("click", s));
|
|
2478
2454
|
};
|
|
2479
2455
|
return setTimeout(() => {
|
|
2480
|
-
document.addEventListener("click",
|
|
2456
|
+
document.addEventListener("click", s);
|
|
2481
2457
|
}, 0), () => {
|
|
2482
|
-
document.removeEventListener("click",
|
|
2458
|
+
document.removeEventListener("click", s);
|
|
2483
2459
|
};
|
|
2484
2460
|
}
|
|
2485
|
-
const
|
|
2461
|
+
const Qo = { class: "template-select__icon" }, es = ["onMousedown", "onMouseenter"], ts = /* @__PURE__ */ U({
|
|
2486
2462
|
__name: "template-select-view",
|
|
2487
2463
|
props: {
|
|
2488
2464
|
node: {},
|
|
@@ -2490,45 +2466,45 @@ const Ko = { class: "template-select__icon" }, Ho = ["onMousedown", "onMouseente
|
|
|
2490
2466
|
editor: {}
|
|
2491
2467
|
},
|
|
2492
2468
|
setup(e) {
|
|
2493
|
-
const t = e, n =
|
|
2494
|
-
let l = null,
|
|
2495
|
-
const a =
|
|
2469
|
+
const t = e, n = H(!1), s = H(-1), r = H(), o = H();
|
|
2470
|
+
let l = null, i = null;
|
|
2471
|
+
const a = I(() => t.node.attrs.options.find((m) => m.value === t.node.attrs.value)), c = I(() => {
|
|
2496
2472
|
var m;
|
|
2497
2473
|
return ((m = a.value) == null ? void 0 : m.label) || t.node.attrs.placeholder;
|
|
2498
|
-
}),
|
|
2499
|
-
n.value ?
|
|
2500
|
-
},
|
|
2474
|
+
}), d = I(() => !t.node.attrs.value), u = () => {
|
|
2475
|
+
n.value ? g() : x();
|
|
2476
|
+
}, x = async () => {
|
|
2501
2477
|
var m;
|
|
2502
2478
|
if (n.value = !0, (m = t.editor) != null && m.view) {
|
|
2503
|
-
const
|
|
2504
|
-
|
|
2479
|
+
const y = t.editor.view, T = y.state.tr;
|
|
2480
|
+
T.setMeta(we, {
|
|
2505
2481
|
type: "open",
|
|
2506
2482
|
selectId: t.node.attrs.id
|
|
2507
|
-
}),
|
|
2483
|
+
}), y.dispatch(T);
|
|
2508
2484
|
}
|
|
2509
|
-
t.node.attrs.value ?
|
|
2510
|
-
},
|
|
2485
|
+
t.node.attrs.value ? s.value = t.node.attrs.options.findIndex((y) => y.value === t.node.attrs.value) : s.value = -1, await pe(), w(), r.value && o.value && (l = Jo(r.value, o.value, g));
|
|
2486
|
+
}, g = async () => {
|
|
2511
2487
|
var m;
|
|
2512
|
-
if (n.value = !1,
|
|
2513
|
-
const
|
|
2514
|
-
|
|
2488
|
+
if (n.value = !1, s.value = -1, (m = t.editor) != null && m.view) {
|
|
2489
|
+
const y = t.editor.view, T = y.state.tr;
|
|
2490
|
+
T.setMeta(we, {
|
|
2515
2491
|
type: "close"
|
|
2516
|
-
}),
|
|
2492
|
+
}), y.dispatch(T);
|
|
2517
2493
|
}
|
|
2518
|
-
l && (l(), l = null),
|
|
2519
|
-
},
|
|
2520
|
-
t.updateAttributes({ value: m.value }),
|
|
2521
|
-
},
|
|
2522
|
-
!
|
|
2523
|
-
!
|
|
2494
|
+
l && (l(), l = null), i && (i(), i = null);
|
|
2495
|
+
}, E = (m) => {
|
|
2496
|
+
t.updateAttributes({ value: m.value }), g();
|
|
2497
|
+
}, w = () => {
|
|
2498
|
+
!r.value || !o.value || (i && (i(), i = null), i = ft(r.value, o.value, () => {
|
|
2499
|
+
!r.value || !o.value || gt(r.value, o.value, {
|
|
2524
2500
|
placement: "bottom-start",
|
|
2525
2501
|
strategy: "fixed",
|
|
2526
2502
|
// 使用 fixed 定位策略,相对于视口
|
|
2527
|
-
middleware: [
|
|
2528
|
-
}).then(({ x: m, y
|
|
2529
|
-
|
|
2503
|
+
middleware: [pt(4), ht(), mt({ padding: 8 })]
|
|
2504
|
+
}).then(({ x: m, y }) => {
|
|
2505
|
+
o.value && Object.assign(o.value.style, {
|
|
2530
2506
|
left: `${m}px`,
|
|
2531
|
-
top: `${
|
|
2507
|
+
top: `${y}px`
|
|
2532
2508
|
});
|
|
2533
2509
|
});
|
|
2534
2510
|
}));
|
|
@@ -2539,85 +2515,85 @@ const Ko = { class: "template-select__icon" }, Ho = ["onMousedown", "onMouseente
|
|
|
2539
2515
|
m.preventDefault(), h();
|
|
2540
2516
|
break;
|
|
2541
2517
|
case "ArrowDown":
|
|
2542
|
-
m.preventDefault(),
|
|
2518
|
+
m.preventDefault(), b();
|
|
2543
2519
|
break;
|
|
2544
2520
|
case "Enter":
|
|
2545
|
-
m.preventDefault(),
|
|
2521
|
+
m.preventDefault(), f();
|
|
2546
2522
|
break;
|
|
2547
2523
|
case "Escape":
|
|
2548
|
-
m.preventDefault(),
|
|
2524
|
+
m.preventDefault(), g();
|
|
2549
2525
|
break;
|
|
2550
2526
|
}
|
|
2551
2527
|
}, h = () => {
|
|
2552
|
-
|
|
2553
|
-
},
|
|
2554
|
-
|
|
2528
|
+
s.value === -1 || s.value <= 0 ? s.value = t.node.attrs.options.length - 1 : s.value -= 1, p();
|
|
2529
|
+
}, b = () => {
|
|
2530
|
+
s.value === -1 || s.value >= t.node.attrs.options.length - 1 ? s.value = 0 : s.value += 1, p();
|
|
2555
2531
|
}, p = () => {
|
|
2556
|
-
|
|
2557
|
-
if (!
|
|
2558
|
-
const m =
|
|
2532
|
+
pe(() => {
|
|
2533
|
+
if (!o.value) return;
|
|
2534
|
+
const m = o.value.querySelector(".template-select__option.is-highlighted");
|
|
2559
2535
|
m && m.scrollIntoView({
|
|
2560
2536
|
block: "nearest",
|
|
2561
2537
|
behavior: "smooth"
|
|
2562
2538
|
});
|
|
2563
2539
|
});
|
|
2564
|
-
},
|
|
2565
|
-
|
|
2540
|
+
}, f = () => {
|
|
2541
|
+
s.value >= 0 && s.value < t.node.attrs.options.length ? E(t.node.attrs.options[s.value]) : g();
|
|
2566
2542
|
};
|
|
2567
|
-
return
|
|
2543
|
+
return dn(() => {
|
|
2568
2544
|
document.addEventListener("keydown", v);
|
|
2569
|
-
}),
|
|
2570
|
-
document.removeEventListener("keydown", v), l && l(),
|
|
2571
|
-
}), (m,
|
|
2545
|
+
}), fn(() => {
|
|
2546
|
+
document.removeEventListener("keydown", v), l && l(), i && i();
|
|
2547
|
+
}), (m, y) => (k(), F(L(rt), {
|
|
2572
2548
|
as: "span",
|
|
2573
2549
|
class: "template-select"
|
|
2574
2550
|
}, {
|
|
2575
2551
|
default: $(() => [
|
|
2576
|
-
|
|
2552
|
+
y[0] || (y[0] = B("span", {
|
|
2577
2553
|
contenteditable: "false",
|
|
2578
2554
|
class: "template-select__prefix"
|
|
2579
2555
|
}, "", -1)),
|
|
2580
2556
|
B("span", {
|
|
2581
2557
|
ref_key: "triggerRef",
|
|
2582
|
-
ref:
|
|
2583
|
-
class:
|
|
2584
|
-
onMousedown:
|
|
2558
|
+
ref: r,
|
|
2559
|
+
class: Z(["template-select__trigger", { "is-open": n.value }]),
|
|
2560
|
+
onMousedown: et(u, ["prevent"])
|
|
2585
2561
|
}, [
|
|
2586
2562
|
B("span", {
|
|
2587
|
-
class:
|
|
2588
|
-
},
|
|
2589
|
-
B("span",
|
|
2590
|
-
|
|
2563
|
+
class: Z(["template-select__text", { "is-placeholder": d.value }])
|
|
2564
|
+
}, fe(c.value), 3),
|
|
2565
|
+
B("span", Qo, [
|
|
2566
|
+
ne(L(Mn))
|
|
2591
2567
|
])
|
|
2592
2568
|
], 34),
|
|
2593
|
-
|
|
2569
|
+
y[1] || (y[1] = B("span", {
|
|
2594
2570
|
contenteditable: "false",
|
|
2595
2571
|
class: "template-select__suffix"
|
|
2596
2572
|
}, "", -1)),
|
|
2597
|
-
(
|
|
2598
|
-
n.value ? (
|
|
2573
|
+
(k(), F(pn, { to: "body" }, [
|
|
2574
|
+
n.value ? (k(), M("div", {
|
|
2599
2575
|
key: 0,
|
|
2600
2576
|
ref_key: "dropdownRef",
|
|
2601
|
-
ref:
|
|
2577
|
+
ref: o,
|
|
2602
2578
|
class: "template-select__dropdown"
|
|
2603
2579
|
}, [
|
|
2604
|
-
(
|
|
2605
|
-
key:
|
|
2606
|
-
class:
|
|
2607
|
-
"is-highlighted": _ ===
|
|
2608
|
-
"is-selected":
|
|
2580
|
+
(k(!0), M(Pe, null, De(e.node.attrs.options, (T, _) => (k(), M("div", {
|
|
2581
|
+
key: T.value,
|
|
2582
|
+
class: Z(["template-select__option", {
|
|
2583
|
+
"is-highlighted": _ === s.value,
|
|
2584
|
+
"is-selected": T.value === e.node.attrs.value
|
|
2609
2585
|
}]),
|
|
2610
|
-
onMousedown:
|
|
2611
|
-
onMouseenter: (
|
|
2612
|
-
},
|
|
2613
|
-
], 512)) :
|
|
2586
|
+
onMousedown: et((S) => E(T), ["prevent"]),
|
|
2587
|
+
onMouseenter: (S) => s.value = _
|
|
2588
|
+
}, fe(T.label), 43, es))), 128))
|
|
2589
|
+
], 512)) : W("", !0)
|
|
2614
2590
|
]))
|
|
2615
2591
|
]),
|
|
2616
2592
|
_: 1
|
|
2617
2593
|
}));
|
|
2618
2594
|
}
|
|
2619
|
-
}),
|
|
2620
|
-
name:
|
|
2595
|
+
}), ns = /* @__PURE__ */ X(ts, [["__scopeId", "data-v-dbb18436"]]), os = lt.create({
|
|
2596
|
+
name: C.TEMPLATE_SELECT,
|
|
2621
2597
|
// 节点配置
|
|
2622
2598
|
group: "inline",
|
|
2623
2599
|
inline: !0,
|
|
@@ -2675,70 +2651,188 @@ const Ko = { class: "template-select__icon" }, Ho = ["onMousedown", "onMouseente
|
|
|
2675
2651
|
// HTML 渲染
|
|
2676
2652
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
2677
2653
|
const n = e.attrs.options.find(
|
|
2678
|
-
(
|
|
2679
|
-
),
|
|
2680
|
-
let
|
|
2654
|
+
(o) => o.value === e.attrs.value
|
|
2655
|
+
), s = (n == null ? void 0 : n.label) || e.attrs.placeholder;
|
|
2656
|
+
let r = "[]";
|
|
2681
2657
|
try {
|
|
2682
|
-
|
|
2683
|
-
} catch (
|
|
2684
|
-
console.error("Failed to stringify template select options in renderHTML:",
|
|
2658
|
+
r = JSON.stringify(e.attrs.options);
|
|
2659
|
+
} catch (o) {
|
|
2660
|
+
console.error("Failed to stringify template select options in renderHTML:", o);
|
|
2685
2661
|
}
|
|
2686
2662
|
return [
|
|
2687
2663
|
"span",
|
|
2688
|
-
|
|
2664
|
+
at(t, {
|
|
2689
2665
|
"data-template-select": "",
|
|
2690
2666
|
"data-id": e.attrs.id,
|
|
2691
2667
|
"data-placeholder": e.attrs.placeholder,
|
|
2692
|
-
"data-options":
|
|
2668
|
+
"data-options": r,
|
|
2693
2669
|
"data-value": e.attrs.value || ""
|
|
2694
2670
|
}),
|
|
2695
|
-
|
|
2671
|
+
s
|
|
2696
2672
|
];
|
|
2697
2673
|
},
|
|
2698
2674
|
// 使用 Vue 组件渲染
|
|
2699
2675
|
addNodeView() {
|
|
2700
|
-
return
|
|
2676
|
+
return it(ns);
|
|
2701
2677
|
},
|
|
2702
2678
|
// 添加插件
|
|
2703
2679
|
addProseMirrorPlugins() {
|
|
2704
|
-
return [
|
|
2680
|
+
return [Xo(), Yo(), Zo()];
|
|
2705
2681
|
}
|
|
2706
|
-
}),
|
|
2707
|
-
name:
|
|
2682
|
+
}), Zt = It.create({
|
|
2683
|
+
name: ye.TEMPLATE,
|
|
2708
2684
|
addExtensions() {
|
|
2709
|
-
return [
|
|
2685
|
+
return [Uo.configure(this.options), os];
|
|
2710
2686
|
},
|
|
2711
2687
|
// 添加命令(统一命令入口)
|
|
2712
2688
|
addCommands() {
|
|
2713
|
-
return
|
|
2689
|
+
return Ko;
|
|
2714
2690
|
}
|
|
2715
2691
|
});
|
|
2716
|
-
function
|
|
2717
|
-
return
|
|
2692
|
+
function ss(e, t) {
|
|
2693
|
+
return Zt.configure({
|
|
2718
2694
|
items: e,
|
|
2719
2695
|
...t
|
|
2720
2696
|
});
|
|
2721
2697
|
}
|
|
2722
|
-
function
|
|
2723
|
-
|
|
2724
|
-
|
|
2698
|
+
function Jt(e, t = "") {
|
|
2699
|
+
let n = (
|
|
2700
|
+
/** @type {Array<CategorizedUnicodeRange<T>>} */
|
|
2701
|
+
[]
|
|
2702
|
+
), s = e.split(",").map((o) => o ? parseInt(o, 36) : 0), r = 0;
|
|
2703
|
+
for (let o = 0; o < s.length; o++)
|
|
2704
|
+
o % 2 ? n.push([
|
|
2705
|
+
r,
|
|
2706
|
+
r + s[o],
|
|
2707
|
+
/** @type {T} */
|
|
2708
|
+
t ? parseInt(t[o >> 1], 36) : 0
|
|
2709
|
+
]) : r = s[o];
|
|
2710
|
+
return n;
|
|
2711
|
+
}
|
|
2712
|
+
function Qt(e, t, n = 0, s = t.length - 1) {
|
|
2713
|
+
for (; n <= s; ) {
|
|
2714
|
+
let r = n + s >>> 1, o = t[r];
|
|
2715
|
+
if (e < o[0]) s = r - 1;
|
|
2716
|
+
else if (e > o[1]) n = r + 1;
|
|
2717
|
+
else return r;
|
|
2718
|
+
}
|
|
2719
|
+
return -1;
|
|
2720
|
+
}
|
|
2721
|
+
const ot = Jt(
|
|
2722
|
+
/** @type {UnicodeDataEncoding} */
|
|
2723
|
+
",9,a,,b,1,d,,e,h,3j,w,4p,,4t,,4u,,lc,33,w3,6,13l,18,14v,,14x,1,150,1,153,,16o,5,174,a,17g,,18r,k,19s,,1cm,6,1ct,,1cv,5,1d3,1,1d6,3,1e7,,1e9,,1f4,q,1ie,a,1kb,8,1kt,,1li,3,1ln,8,1lx,2,1m1,4,1nd,2,1ow,1,1p3,8,1qi,n,1r6,,1r7,v,1s3,,1tm,,1tn,,1to,,1tq,2,1tt,7,1u1,3,1u5,,1u6,1,1u9,6,1uq,1,1vl,,1vm,1,1x8,,1xa,,1xb,1,1xd,3,1xj,1,1xn,1,1xp,,1xz,,1ya,1,1z2,,1z5,1,1z7,,20s,,20u,2,20x,1,213,1,217,2,21d,,228,1,22d,,22p,1,22r,,24c,,24e,2,24h,4,24n,1,24p,,24r,1,24t,,25e,1,262,5,269,,26a,1,27w,,27y,1,280,,281,3,287,1,28b,1,28d,,28l,2,28y,1,29u,,2bi,,2bj,,2bk,,2bl,1,2bq,2,2bu,2,2bx,,2c7,,2dc,,2dd,2,2dg,,2f0,,2f2,2,2f5,3,2fa,2,2fe,3,2fp,1,2g2,1,2gx,,2gy,1,2ik,,2im,,2in,1,2ip,,2iq,,2ir,1,2iu,2,2iy,3,2j9,1,2jm,1,2k3,,2kg,1,2ki,1,2m3,1,2m6,,2m7,1,2m9,3,2me,2,2mi,2,2ml,,2mm,,2mv,,2n6,1,2o1,,2o2,1,2q2,,2q7,,2q8,1,2qa,2,2qe,,2qg,6,2qn,,2r6,1,2sx,,2sz,,2t0,6,2tj,7,2wh,,2wj,,2wk,8,2x4,6,2zc,1,305,,307,,309,,30e,1,31t,d,327,,328,4,32e,1,32l,a,32x,z,346,,371,3,375,,376,5,37d,1,37f,1,37h,1,386,1,388,1,38e,2,38x,3,39e,,39g,,39h,1,39p,,3a5,,3cw,2n,3fk,1z,3hk,2f,3tp,2,4k2,3,4ky,2,4lu,1,4mq,1,4ok,1,4om,,4on,6,4ou,7,4p2,,4p3,1,4p5,a,4pp,,4qz,2,4r2,,4r3,,4ud,1,4vd,,4yo,2,4yr,3,4yv,1,4yx,2,4z4,1,4z6,,4z7,5,4zd,2,55j,1,55l,1,55n,,579,,57a,,57b,,57c,6,57k,,57m,,57p,7,57x,5,583,9,58f,,59s,u,5c0,3,5c4,,5dg,9,5dq,3,5du,2,5ez,8,5fk,1,5fm,,5gh,,5gi,3,5gm,1,5go,5,5ie,,5if,,5ig,1,5ii,2,5il,,5im,,5in,4,5k4,7,5kc,7,5kk,1,5km,1,5ow,2,5p0,c,5pd,,5pe,6,5pp,,5pw,,5pz,,5q0,1,5vk,1r,6bv,,6bw,,6bx,,6by,1,6co,6,6d8,,6dl,,6e8,f,6hc,w,6jm,,6k9,,6ms,5,6nd,1,6xm,1,6y0,,70o,,72n,,73d,a,73s,2,79e,,7fu,1,7g6,,7gg,,7i3,3,7i8,5,7if,b,7is,35,7m8,39,7pk,a,7pw,,7py,,7q5,,7q9,,7qg,,7qr,1,7r8,,7rb,,7rg,,7ri,,7rn,2,7rr,,7s3,4,7th,2,7tt,,7u8,,7un,,850,1,8hx,2,8ij,1,8k0,,8k5,,8vj,2,8zj,,928,v,wvj,3,wvo,9,wwu,1,wz4,1,x6q,,x6u,,x6z,,x7n,1,x7p,1,x7r,,x7w,,xa8,1,xbo,f,xc4,1,xcw,h,xdr,,xeu,7,xfr,a,xg2,,xg3,,xgg,s,xhc,2,xhf,,xir,,xis,1,xiu,3,xiy,1,xj0,1,xj2,1,xj4,,xk5,,xm1,5,xm7,1,xm9,1,xmb,1,xmd,1,xmr,,xn0,,xn1,,xoc,,xps,,xpu,2,xpz,1,xq6,1,xq9,,xrf,,xrg,1,xri,1,xrp,,xrq,,xyb,1,xyd,,xye,1,xyg,,xyh,1,xyk,,xyl,,1e68,f,1e74,f,1edb,,1ehq,1,1ek0,b,1eyl,,1f4w,,1f92,4,1gjl,2,1gjp,1,1gjw,3,1gl4,2,1glb,,1gpx,1,1h5w,3,1h7t,4,1hgr,1,1hj0,3,1hl2,a,1hmq,3,1hq8,,1hq9,,1hqa,,1hrs,e,1htc,,1htf,1,1htr,2,1htu,,1hv4,2,1hv7,3,1hvb,1,1hvd,1,1hvh,,1hvm,,1hvx,,1hxc,2,1hyf,4,1hyk,,1hyl,7,1hz9,1,1i0j,,1i0w,1,1i0y,,1i2b,2,1i2e,8,1i2n,,1i2o,,1i2q,1,1i2x,3,1i32,,1i33,,1i5o,2,1i5r,2,1i5u,1,1i5w,3,1i66,,1i69,,1ian,,1iao,2,1iar,7,1ibk,1,1ibm,1,1id7,1,1ida,,1idb,,1idc,,1idd,3,1idj,1,1idn,1,1idp,,1idz,,1iea,1,1iee,6,1ieo,4,1igo,,1igp,1,1igr,5,1igy,,1ih1,,1ih3,2,1ih6,,1ih8,1,1iha,2,1ihd,,1ihe,,1iht,1,1ik5,2,1ik8,7,1ikg,1,1iki,2,1ikl,,1ikm,,1ila,,1ink,,1inl,1,1inn,5,1int,,1inu,,1inv,1,1inx,,1iny,,1inz,1,1io1,,1io2,1,1iun,,1iuo,1,1iuq,3,1iuw,3,1iv0,1,1iv2,,1iv3,1,1ivw,1,1iy8,2,1iyb,7,1iyj,1,1iyl,,1iym,,1iyn,1,1j1n,,1j1o,,1j1p,,1j1q,1,1j1s,7,1j4t,,1j4u,,1j4v,,1j4y,3,1j52,,1j53,4,1jcc,2,1jcf,8,1jco,,1jcp,1,1jjk,,1jjl,4,1jjr,1,1jjv,3,1jjz,,1jk0,,1jk1,,1jk2,,1jk3,,1jo1,2,1jo4,3,1joa,1,1joc,3,1jog,,1jok,,1jpd,9,1jqr,5,1jqx,,1jqy,,1jqz,3,1jrb,,1jrl,5,1jrr,1,1jrt,2,1jt0,5,1jt6,c,1jtj,,1jtk,1,1k4v,,1k4w,6,1k54,5,1k5a,,1k5b,,1k7m,l,1k89,,1k8a,6,1k8h,,1k8i,1,1k8k,,1k8l,1,1kc1,5,1kca,,1kcc,1,1kcf,6,1kcm,,1kcn,,1kei,4,1keo,1,1ker,1,1ket,,1keu,,1kev,,1koj,1,1kol,1,1kow,1,1koy,,1koz,,1kqc,1,1kqe,4,1kqm,1,1kqo,2,1kre,,1ovk,f,1ow0,,1ow7,e,1xr2,b,1xre,2,1xrh,2,1zow,4,1zqo,6,206b,,206f,3,20jz,,20k1,1i,20lr,3,20o4,,20og,1,2ftp,1,2fts,3,2jgg,19,2jhs,m,2jxh,4,2jxp,5,2jxv,7,2jy3,7,2jyd,6,2jze,3,2k3m,2,2lmo,1i,2lob,1d,2lpx,,2lqc,,2lqz,4,2lr5,e,2mtc,6,2mtk,g,2mu3,6,2mub,1,2mue,4,2mxb,,2n1s,6,2nce,,2ne4,3,2nsc,3,2nzi,1,2ok0,6,2on8,6,2pz4,73,2q6l,2,2q7j,,2q98,5,2q9q,1,2qa6,,2qa9,9,2qb1,1k,2qcm,p,2qdd,e,2qe2,,2qen,,2qeq,8,2qf0,3,2qfd,c1,2qrf,4,2qrk,8t,2r0m,7d,2r9c,3j,2rg4,b,2rit,16,2rkc,3,2rm0,7,2rmi,5,2rns,7,2rou,29,2rrg,1a,2rss,9,2rt3,c8,2scg,sd,jny8,v,jnz4,2n,jo1s,3j,jo5c,6n,joc0,2rz",
|
|
2724
|
+
"262122424333333393233393339333333333393393b3b3b3b3b333b33b3bb33333b3b3333333b3b33bb3333b33b3bb33333b3bbb333b333b33333b3b3b3b3333b3b33b3bb39333b33b33b3b3b333b333333b3b333333b33b3b3333b3335dc333333b3b3b33323333b3bb3b33b3b3b3333b3333b3b333bb3b33b3b3b3b3b333b333b3323e2244234444444444444444444444444444444444444444443333333333b3b3bb33333b353b3b3b3b333b3b333b333333b3bb3b3b3bb333232333333333333333b3b3333bb3b393933b3b33bb3b393b3b3b3333b33b33b3bbb33b333b3333bb3933b3b3b333b3b3b3b3b33b3b3b33b3b3b33b3b33b33b3b3b33bb39b9b3b33b3b33b9333b393b3b33b33b3b3b3333393b3b3b33b39bb3b332333b333dd3b33332333323333333333333333333333344444444a44444434444444444444423232"
|
|
2725
|
+
), rs = Jt(
|
|
2726
|
+
/** @type {UnicodeDataEncoding} */
|
|
2727
|
+
"1sl,10,1ug,7,1vc,7,1w5,j,1wq,6,1wy,,1x2,3,1y4,1,1y7,,1yo,1,239,j,23u,6,242,1,245,4,261,,26t,j,27e,6,27m,1,27p,4,28s,1,28v,,29d,,2dx,j,2ei,f,2fs,2,2l1,11"
|
|
2728
|
+
), _t = 65535;
|
|
2729
|
+
function* is(e) {
|
|
2730
|
+
let t = e.codePointAt(0);
|
|
2731
|
+
if (t == null) return;
|
|
2732
|
+
let n = t <= _t ? 1 : 2, s = e.length, r = Lt(t), o = 0, l = 0, i = !1, a = !1, c = !1, d = 0, u = r, x = t;
|
|
2733
|
+
for (; n < s; ) {
|
|
2734
|
+
t = /** @type {number} */
|
|
2735
|
+
e.codePointAt(n), o = Lt(t);
|
|
2736
|
+
let g = !0;
|
|
2737
|
+
r === 1 ? g = o !== 6 : r === 2 || r === 6 || o === 1 || o === 2 || o === 6 ? g = !0 : o === 3 || o === 14 || o === 11 || r === 9 ? g = !1 : r === 14 && o === 4 ? g = !i : r === 10 && o === 10 ? g = l++ % 2 === 1 : r === 5 ? g = !(o === 5 || o === 13 || o === 7 || o === 8) : ((r === 7 || r === 13) && (o === 13 || o === 12) || (r === 8 || r === 12) && o === 12 || o === 0 && a && c && kt(t)) && (g = !1), g ? (yield {
|
|
2738
|
+
segment: e.slice(d, n),
|
|
2739
|
+
index: d,
|
|
2740
|
+
input: e,
|
|
2741
|
+
_hd: x,
|
|
2742
|
+
_catBegin: u,
|
|
2743
|
+
_catEnd: r
|
|
2744
|
+
}, i = !1, l = 0, d = n, u = o, x = t) : o === 14 && (r === 3 || r === 4) ? i = !0 : t >= 2325 && (!a && r === 0 && (a = kt(x)), a && o === 3 ? c = c || t === 2381 || t === 2509 || t === 2637 || t === 2765 || t === 2893 || t === 3149 || t === 3405 : c = !1), n += t <= _t ? 1 : 2, r = o;
|
|
2745
|
+
}
|
|
2746
|
+
d < s && (yield {
|
|
2747
|
+
segment: e.slice(d),
|
|
2748
|
+
index: d,
|
|
2749
|
+
input: e,
|
|
2750
|
+
_hd: x,
|
|
2751
|
+
_catBegin: u,
|
|
2752
|
+
_catEnd: r
|
|
2753
|
+
});
|
|
2754
|
+
}
|
|
2755
|
+
function ls(e) {
|
|
2756
|
+
let t = 0;
|
|
2757
|
+
for (let n of is(e)) t += 1;
|
|
2758
|
+
return t;
|
|
2759
|
+
}
|
|
2760
|
+
const en = new Uint8Array(6080), We = 128, st = 12287, tn = new Uint8Array(1536), Ke = 40960, nn = 44031, as = (() => {
|
|
2761
|
+
let e = 0;
|
|
2762
|
+
for (; ; ) {
|
|
2763
|
+
let [t, n, s] = ot[e];
|
|
2764
|
+
if (t > nn) break;
|
|
2765
|
+
if (e++, !(n < We || t > st && n < Ke))
|
|
2766
|
+
for (let r = t; r <= n; r++) {
|
|
2767
|
+
let o, l = 0;
|
|
2768
|
+
r <= st ? (o = en, l = r - We >> 1) : (o = tn, l = r - Ke >> 1), o[l] = r & 1 ? o[l] & 15 | s << 4 : o[l] & 240 | s;
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
return e;
|
|
2772
|
+
})();
|
|
2773
|
+
function Lt(e) {
|
|
2774
|
+
if (e < We)
|
|
2775
|
+
return e >= 32 ? 0 : e === 10 ? 6 : e === 13 ? 1 : 2;
|
|
2776
|
+
if (e <= st) {
|
|
2777
|
+
let n = en[e - We >> 1];
|
|
2778
|
+
return (
|
|
2779
|
+
/** @type {GraphemeCategoryNum} */
|
|
2780
|
+
e & 1 ? n >> 4 : n & 15
|
|
2781
|
+
);
|
|
2782
|
+
}
|
|
2783
|
+
if (e < Ke)
|
|
2784
|
+
return e < 12336 ? e >= 12330 ? 3 : 0 : e < 12443 ? e === 12336 || e === 12349 ? 4 : e >= 12441 ? 3 : 0 : e === 12951 || e === 12953 ? 4 : 0;
|
|
2785
|
+
if (e <= nn) {
|
|
2786
|
+
let n = tn[e - Ke >> 1];
|
|
2787
|
+
return (
|
|
2788
|
+
/** @type {GraphemeCategoryNum} */
|
|
2789
|
+
e & 1 ? n >> 4 : n & 15
|
|
2790
|
+
);
|
|
2791
|
+
}
|
|
2792
|
+
if (e <= 55203)
|
|
2793
|
+
return (e - 44032) % 28 === 0 ? 7 : 8;
|
|
2794
|
+
if (e <= 55295)
|
|
2795
|
+
return e <= 55238 ? e >= 55216 ? 13 : 0 : e >= 55243 ? 12 : 0;
|
|
2796
|
+
if (e < 65024)
|
|
2797
|
+
return e === 64286 ? 3 : 0;
|
|
2798
|
+
let t = Qt(e, ot, as);
|
|
2799
|
+
return t < 0 ? 0 : ot[t][2];
|
|
2800
|
+
}
|
|
2801
|
+
function kt(e) {
|
|
2802
|
+
return Qt(e, rs) >= 0;
|
|
2803
|
+
}
|
|
2804
|
+
const Mt = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
|
|
2805
|
+
function on(e) {
|
|
2806
|
+
if (!e) return 0;
|
|
2807
|
+
if (Mt) {
|
|
2808
|
+
let t = 0;
|
|
2809
|
+
for (const n of Mt.segment(e))
|
|
2810
|
+
t++;
|
|
2811
|
+
return t;
|
|
2812
|
+
}
|
|
2813
|
+
return ls(e);
|
|
2814
|
+
}
|
|
2815
|
+
function cs(e, t) {
|
|
2816
|
+
const n = H(null), s = Oe(e, "placeholder"), r = () => {
|
|
2817
|
+
var i;
|
|
2725
2818
|
const l = [
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2819
|
+
vn,
|
|
2820
|
+
Tn,
|
|
2821
|
+
En,
|
|
2822
|
+
wn,
|
|
2730
2823
|
// 提供 undo/redo 功能
|
|
2731
|
-
|
|
2732
|
-
placeholder: () =>
|
|
2824
|
+
An.configure({
|
|
2825
|
+
placeholder: () => s.value || "请输入内容..."
|
|
2733
2826
|
}),
|
|
2734
|
-
|
|
2735
|
-
mode: "textSize"
|
|
2827
|
+
Cn.configure({
|
|
2828
|
+
mode: "textSize",
|
|
2829
|
+
textCounter: on
|
|
2736
2830
|
})
|
|
2737
2831
|
];
|
|
2738
|
-
return (
|
|
2739
|
-
},
|
|
2832
|
+
return (i = e.extensions) != null && i.length && l.push(...e.extensions), l;
|
|
2833
|
+
}, o = yn({
|
|
2740
2834
|
content: e.modelValue ?? e.defaultValue ?? "",
|
|
2741
|
-
extensions:
|
|
2835
|
+
extensions: r(),
|
|
2742
2836
|
autofocus: e.autofocus ? "end" : !1,
|
|
2743
2837
|
editorProps: {
|
|
2744
2838
|
attributes: {
|
|
@@ -2746,20 +2840,20 @@ function Uo(e, t) {
|
|
|
2746
2840
|
enterkeyhint: e.enterkeyhint
|
|
2747
2841
|
},
|
|
2748
2842
|
// 处理粘贴事件 - 只粘贴纯文本
|
|
2749
|
-
handlePaste(l,
|
|
2750
|
-
var
|
|
2751
|
-
const a = (
|
|
2843
|
+
handlePaste(l, i) {
|
|
2844
|
+
var x;
|
|
2845
|
+
const a = (x = i.clipboardData) == null ? void 0 : x.getData("text/plain");
|
|
2752
2846
|
if (!a) return !1;
|
|
2753
|
-
const c = e.mode === "single" ? a.replace(/\r?\n/g, " ") : a, { state:
|
|
2754
|
-
return u.insertText(c), l.dispatch(u),
|
|
2755
|
-
var
|
|
2756
|
-
(
|
|
2847
|
+
const c = e.mode === "single" ? a.replace(/\r?\n/g, " ") : a, { state: d } = l, { tr: u } = d;
|
|
2848
|
+
return u.insertText(c), l.dispatch(u), pe(() => {
|
|
2849
|
+
var g;
|
|
2850
|
+
(g = o.value) == null || g.commands.scrollIntoView();
|
|
2757
2851
|
}), !0;
|
|
2758
2852
|
}
|
|
2759
2853
|
},
|
|
2760
2854
|
onUpdate: (l) => {
|
|
2761
|
-
const
|
|
2762
|
-
t("update:modelValue",
|
|
2855
|
+
const i = l.editor.getText();
|
|
2856
|
+
t("update:modelValue", i), t("input", i);
|
|
2763
2857
|
},
|
|
2764
2858
|
onFocus: (l) => {
|
|
2765
2859
|
t("focus", l.event);
|
|
@@ -2771,108 +2865,108 @@ function Uo(e, t) {
|
|
|
2771
2865
|
return N(
|
|
2772
2866
|
() => e.modelValue,
|
|
2773
2867
|
(l) => {
|
|
2774
|
-
|
|
2868
|
+
o.value && l !== o.value.getText() && o.value.commands.setContent(l ?? "", { emitUpdate: !1 });
|
|
2775
2869
|
}
|
|
2776
2870
|
), N(
|
|
2777
2871
|
() => e.placeholder,
|
|
2778
2872
|
() => {
|
|
2779
|
-
if (
|
|
2780
|
-
const { state: l } =
|
|
2781
|
-
|
|
2873
|
+
if (o.value) {
|
|
2874
|
+
const { state: l } = o.value, i = l.tr;
|
|
2875
|
+
o.value.view.dispatch(i);
|
|
2782
2876
|
}
|
|
2783
2877
|
}
|
|
2784
2878
|
), N(
|
|
2785
2879
|
() => e.enterkeyhint,
|
|
2786
2880
|
(l) => {
|
|
2787
|
-
if (
|
|
2788
|
-
const
|
|
2789
|
-
l ?
|
|
2881
|
+
if (o.value) {
|
|
2882
|
+
const i = o.value.view.dom;
|
|
2883
|
+
l ? i.setAttribute("enterkeyhint", l) : i.removeAttribute("enterkeyhint");
|
|
2790
2884
|
}
|
|
2791
2885
|
}
|
|
2792
|
-
),
|
|
2886
|
+
), mn(() => {
|
|
2793
2887
|
var l;
|
|
2794
|
-
(l =
|
|
2888
|
+
(l = o.value) == null || l.destroy();
|
|
2795
2889
|
}), {
|
|
2796
|
-
editor:
|
|
2890
|
+
editor: o,
|
|
2797
2891
|
editorRef: n
|
|
2798
2892
|
};
|
|
2799
2893
|
}
|
|
2800
|
-
function
|
|
2894
|
+
function us(e) {
|
|
2801
2895
|
const { submitType: t } = e;
|
|
2802
2896
|
return {
|
|
2803
|
-
checkSubmitShortcut: (
|
|
2804
|
-
if (!
|
|
2897
|
+
checkSubmitShortcut: (r) => {
|
|
2898
|
+
if (!P(r, "ENTER")) return !1;
|
|
2805
2899
|
switch (t.value) {
|
|
2806
2900
|
case "enter":
|
|
2807
|
-
return !
|
|
2901
|
+
return !r.shiftKey && !r.ctrlKey && !r.metaKey;
|
|
2808
2902
|
case "ctrlEnter":
|
|
2809
|
-
return (
|
|
2903
|
+
return (r.ctrlKey || r.metaKey) && !r.shiftKey;
|
|
2810
2904
|
case "shiftEnter":
|
|
2811
|
-
return
|
|
2905
|
+
return r.shiftKey && !r.ctrlKey && !r.metaKey;
|
|
2812
2906
|
default:
|
|
2813
2907
|
return !1;
|
|
2814
2908
|
}
|
|
2815
2909
|
},
|
|
2816
|
-
checkNewlineShortcut: (
|
|
2817
|
-
if (!
|
|
2910
|
+
checkNewlineShortcut: (r) => {
|
|
2911
|
+
if (!P(r, "ENTER")) return !1;
|
|
2818
2912
|
switch (t.value) {
|
|
2819
2913
|
case "enter":
|
|
2820
|
-
return
|
|
2914
|
+
return r.shiftKey || r.ctrlKey || r.metaKey;
|
|
2821
2915
|
case "ctrlEnter":
|
|
2822
2916
|
case "shiftEnter":
|
|
2823
|
-
return !
|
|
2917
|
+
return !r.shiftKey && !r.ctrlKey && !r.metaKey;
|
|
2824
2918
|
default:
|
|
2825
2919
|
return !1;
|
|
2826
2920
|
}
|
|
2827
2921
|
}
|
|
2828
2922
|
};
|
|
2829
2923
|
}
|
|
2830
|
-
function
|
|
2831
|
-
const
|
|
2924
|
+
function ds(e, t, n) {
|
|
2925
|
+
const s = H(e.mode || "single"), r = H(!1), o = H(e.mode || "single"), { start: l, stop: i } = Sn(
|
|
2832
2926
|
() => {
|
|
2833
|
-
|
|
2927
|
+
r.value = !1;
|
|
2834
2928
|
},
|
|
2835
2929
|
300,
|
|
2836
2930
|
{ immediate: !1 }
|
|
2837
|
-
), a =
|
|
2931
|
+
), a = I(() => {
|
|
2838
2932
|
var u;
|
|
2839
2933
|
return (u = n.value) == null ? void 0 : u.closest(".tr-sender-main");
|
|
2840
2934
|
}), c = () => {
|
|
2841
|
-
if (
|
|
2935
|
+
if (o.value !== "single" || r.value || !t.value || !n.value) return;
|
|
2842
2936
|
const u = n.value.querySelector(".ProseMirror");
|
|
2843
2937
|
if (!u) return;
|
|
2844
|
-
const
|
|
2845
|
-
|
|
2846
|
-
},
|
|
2847
|
-
|
|
2848
|
-
t.value && t.value.commands.focus("end"),
|
|
2938
|
+
const x = t.value.getText();
|
|
2939
|
+
s.value === "single" ? u.scrollWidth > u.clientWidth && d("multiple") : x.length || d("single");
|
|
2940
|
+
}, d = (u) => {
|
|
2941
|
+
s.value !== u && (r.value = !0, s.value = u, pe(() => {
|
|
2942
|
+
t.value && t.value.commands.focus("end"), i(), l();
|
|
2849
2943
|
}));
|
|
2850
2944
|
};
|
|
2851
|
-
return
|
|
2945
|
+
return _n(a, () => {
|
|
2852
2946
|
requestAnimationFrame(() => {
|
|
2853
2947
|
c();
|
|
2854
2948
|
});
|
|
2855
2949
|
}), N(
|
|
2856
2950
|
() => e.mode,
|
|
2857
2951
|
(u) => {
|
|
2858
|
-
u && u !==
|
|
2952
|
+
u && u !== s.value && (o.value = u, d(u));
|
|
2859
2953
|
}
|
|
2860
2954
|
), {
|
|
2861
|
-
currentMode:
|
|
2862
|
-
isAutoSwitching:
|
|
2863
|
-
setMode:
|
|
2955
|
+
currentMode: s,
|
|
2956
|
+
isAutoSwitching: r,
|
|
2957
|
+
setMode: d,
|
|
2864
2958
|
checkOverflow: c
|
|
2865
2959
|
};
|
|
2866
2960
|
}
|
|
2867
|
-
function
|
|
2868
|
-
const
|
|
2869
|
-
const
|
|
2870
|
-
if (
|
|
2871
|
-
const a = parseFloat(
|
|
2961
|
+
function fs(e, t, n) {
|
|
2962
|
+
const s = Ln("--tr-sender-line-height", t), r = I(() => {
|
|
2963
|
+
const i = s.value;
|
|
2964
|
+
if (i) {
|
|
2965
|
+
const a = parseFloat(i);
|
|
2872
2966
|
return isNaN(a) ? 26 : a;
|
|
2873
2967
|
}
|
|
2874
2968
|
return 26;
|
|
2875
|
-
}),
|
|
2969
|
+
}), o = I(() => n === !1 || n === void 0 ? null : n === !0 ? {
|
|
2876
2970
|
minRows: 1,
|
|
2877
2971
|
maxRows: 5
|
|
2878
2972
|
} : typeof n == "object" ? {
|
|
@@ -2880,30 +2974,30 @@ function Yo(e, t, n) {
|
|
|
2880
2974
|
maxRows: n.maxRows
|
|
2881
2975
|
} : null), l = () => {
|
|
2882
2976
|
if (!t.value) return;
|
|
2883
|
-
const
|
|
2884
|
-
if (!
|
|
2977
|
+
const i = t.value.querySelector(".tr-sender-editor-scroll");
|
|
2978
|
+
if (!i) {
|
|
2885
2979
|
console.warn("⚠️ 找不到滚动容器 .tr-sender-editor-scroll");
|
|
2886
2980
|
return;
|
|
2887
2981
|
}
|
|
2888
|
-
const a =
|
|
2982
|
+
const a = o.value;
|
|
2889
2983
|
if (e.value === "multiple" && a) {
|
|
2890
|
-
const c =
|
|
2891
|
-
|
|
2984
|
+
const c = r.value * a.minRows, d = r.value * a.maxRows;
|
|
2985
|
+
i.style.minHeight = `${c}px`, i.style.maxHeight = `${d}px`, i.style.overflowY = "auto";
|
|
2892
2986
|
} else
|
|
2893
|
-
|
|
2987
|
+
i.style.minHeight = "", i.style.maxHeight = "", i.style.overflowY = e.value === "single" ? "hidden" : "auto";
|
|
2894
2988
|
};
|
|
2895
2989
|
return N(
|
|
2896
2990
|
e,
|
|
2897
2991
|
() => {
|
|
2898
|
-
|
|
2992
|
+
pe(() => {
|
|
2899
2993
|
l();
|
|
2900
2994
|
});
|
|
2901
2995
|
},
|
|
2902
2996
|
{ immediate: !0 }
|
|
2903
2997
|
), N(
|
|
2904
|
-
|
|
2998
|
+
o,
|
|
2905
2999
|
() => {
|
|
2906
|
-
|
|
3000
|
+
pe(() => {
|
|
2907
3001
|
l();
|
|
2908
3002
|
});
|
|
2909
3003
|
},
|
|
@@ -2912,23 +3006,23 @@ function Yo(e, t, n) {
|
|
|
2912
3006
|
updateHeight: l
|
|
2913
3007
|
};
|
|
2914
3008
|
}
|
|
2915
|
-
function
|
|
2916
|
-
const { editor: n, editorRef:
|
|
2917
|
-
var m,
|
|
2918
|
-
return !e.disabled && !e.loading &&
|
|
3009
|
+
function ps(e, t) {
|
|
3010
|
+
const { editor: n, editorRef: s } = cs(e, t), r = I(() => n.value ? Qe(n.value).trim().length > 0 : !1), o = I(() => n.value ? on(Qe(n.value)) : 0), l = I(() => e.maxLength ? o.value > e.maxLength : !1), i = I(() => {
|
|
3011
|
+
var m, y;
|
|
3012
|
+
return !e.disabled && !e.loading && r.value && !l.value && !((y = (m = e.defaultActions) == null ? void 0 : m.submit) != null && y.disabled);
|
|
2919
3013
|
}), a = () => {
|
|
2920
|
-
if (!
|
|
2921
|
-
let m,
|
|
2922
|
-
if (n.value.extensionManager.extensions.some((
|
|
2923
|
-
const
|
|
2924
|
-
|
|
2925
|
-
} else if (n.value.extensionManager.extensions.some((
|
|
2926
|
-
const
|
|
2927
|
-
|
|
3014
|
+
if (!i.value || !n.value) return;
|
|
3015
|
+
let m, y = "";
|
|
3016
|
+
if (n.value.extensionManager.extensions.some((T) => T.name === ye.TEMPLATE)) {
|
|
3017
|
+
const T = Yt(n.value);
|
|
3018
|
+
T.length > 0 && (m = T), y = Qe(n.value);
|
|
3019
|
+
} else if (n.value.extensionManager.extensions.some((T) => T.name === ye.MENTION)) {
|
|
3020
|
+
const T = ko(n.value);
|
|
3021
|
+
T.length > 0 && (m = T), y = Lo(n.value);
|
|
2928
3022
|
}
|
|
2929
|
-
|
|
2930
|
-
}, { currentMode: c, isAutoSwitching:
|
|
2931
|
-
submitType:
|
|
3023
|
+
y || (y = n.value.getText()), t("submit", y, m);
|
|
3024
|
+
}, { currentMode: c, isAutoSwitching: d, setMode: u, checkOverflow: x } = ds(e, n, s), g = us({
|
|
3025
|
+
submitType: I(() => e.submitType ?? "enter")
|
|
2932
3026
|
});
|
|
2933
3027
|
N(
|
|
2934
3028
|
n,
|
|
@@ -2936,9 +3030,9 @@ function jo(e, t) {
|
|
|
2936
3030
|
m && m.setOptions({
|
|
2937
3031
|
editorProps: {
|
|
2938
3032
|
...m.options.editorProps,
|
|
2939
|
-
handleKeyDown: (
|
|
2940
|
-
const _ =
|
|
2941
|
-
return _ && _.active ||
|
|
3033
|
+
handleKeyDown: (y, T) => {
|
|
3034
|
+
const _ = ue.getState(y.state), S = q.getState(y.state), D = we.getState(y.state);
|
|
3035
|
+
return _ && _.active || S && S.active || D && D.isOpen ? !1 : g.checkSubmitShortcut(T) ? (T.preventDefault(), a(), !0) : g.checkNewlineShortcut(T) ? (T.preventDefault(), c.value === "single" ? (u("multiple"), setTimeout(() => {
|
|
2942
3036
|
m.commands.splitBlock(), m.commands.focus();
|
|
2943
3037
|
}, 0)) : m.commands.splitBlock(), !0) : !1;
|
|
2944
3038
|
}
|
|
@@ -2946,78 +3040,78 @@ function jo(e, t) {
|
|
|
2946
3040
|
});
|
|
2947
3041
|
},
|
|
2948
3042
|
{ immediate: !0 }
|
|
2949
|
-
),
|
|
3043
|
+
), fs(c, s, e.autoSize), N(
|
|
2950
3044
|
() => {
|
|
2951
3045
|
var m;
|
|
2952
3046
|
return (m = n.value) == null ? void 0 : m.state.doc.content;
|
|
2953
3047
|
},
|
|
2954
3048
|
() => {
|
|
2955
3049
|
setTimeout(() => {
|
|
2956
|
-
|
|
3050
|
+
x();
|
|
2957
3051
|
}, 0);
|
|
2958
3052
|
},
|
|
2959
3053
|
{ deep: !0 }
|
|
2960
3054
|
);
|
|
2961
|
-
const
|
|
3055
|
+
const E = () => {
|
|
2962
3056
|
var m;
|
|
2963
3057
|
(m = n.value) == null || m.commands.focus();
|
|
2964
|
-
},
|
|
2965
|
-
var m,
|
|
2966
|
-
(m = n.value) == null || m.commands.clearContent(), (
|
|
3058
|
+
}, w = () => {
|
|
3059
|
+
var m, y;
|
|
3060
|
+
(m = n.value) == null || m.commands.clearContent(), (y = n.value) == null || y.commands.focus(), t("clear");
|
|
2967
3061
|
}, v = () => {
|
|
2968
3062
|
t("cancel");
|
|
2969
3063
|
}, h = () => {
|
|
2970
3064
|
var m;
|
|
2971
3065
|
(m = n.value) == null || m.commands.blur();
|
|
2972
|
-
},
|
|
2973
|
-
var
|
|
2974
|
-
(
|
|
3066
|
+
}, b = (m) => {
|
|
3067
|
+
var y;
|
|
3068
|
+
(y = n.value) == null || y.commands.setContent(m);
|
|
2975
3069
|
}, p = () => {
|
|
2976
3070
|
var m;
|
|
2977
3071
|
return ((m = n.value) == null ? void 0 : m.getText()) || "";
|
|
2978
|
-
},
|
|
3072
|
+
}, f = {
|
|
2979
3073
|
editor: n,
|
|
2980
|
-
editorRef:
|
|
3074
|
+
editorRef: s,
|
|
2981
3075
|
mode: c,
|
|
2982
|
-
isAutoSwitching:
|
|
2983
|
-
loading:
|
|
2984
|
-
disabled:
|
|
2985
|
-
hasContent:
|
|
2986
|
-
canSubmit:
|
|
3076
|
+
isAutoSwitching: d,
|
|
3077
|
+
loading: I(() => e.loading ?? !1),
|
|
3078
|
+
disabled: I(() => e.disabled ?? !1),
|
|
3079
|
+
hasContent: r,
|
|
3080
|
+
canSubmit: i,
|
|
2987
3081
|
isOverLimit: l,
|
|
2988
|
-
characterCount:
|
|
2989
|
-
maxLength:
|
|
2990
|
-
size:
|
|
2991
|
-
showWordLimit:
|
|
2992
|
-
clearable:
|
|
2993
|
-
defaultActions:
|
|
2994
|
-
submitType:
|
|
2995
|
-
stopText:
|
|
3082
|
+
characterCount: o,
|
|
3083
|
+
maxLength: Oe(e, "maxLength"),
|
|
3084
|
+
size: I(() => e.size ?? "normal"),
|
|
3085
|
+
showWordLimit: I(() => e.showWordLimit ?? !1),
|
|
3086
|
+
clearable: I(() => e.clearable ?? !1),
|
|
3087
|
+
defaultActions: Oe(e, "defaultActions"),
|
|
3088
|
+
submitType: I(() => e.submitType ?? "enter"),
|
|
3089
|
+
stopText: Oe(e, "stopText"),
|
|
2996
3090
|
submit: a,
|
|
2997
|
-
clear:
|
|
3091
|
+
clear: w,
|
|
2998
3092
|
cancel: v,
|
|
2999
|
-
focus:
|
|
3093
|
+
focus: E,
|
|
3000
3094
|
blur: h,
|
|
3001
|
-
setContent:
|
|
3095
|
+
setContent: b,
|
|
3002
3096
|
getContent: p
|
|
3003
3097
|
};
|
|
3004
|
-
return
|
|
3005
|
-
context:
|
|
3098
|
+
return hn(gn, f), {
|
|
3099
|
+
context: f,
|
|
3006
3100
|
expose: {
|
|
3007
3101
|
submit: a,
|
|
3008
|
-
clear:
|
|
3102
|
+
clear: w,
|
|
3009
3103
|
cancel: v,
|
|
3010
|
-
focus:
|
|
3104
|
+
focus: E,
|
|
3011
3105
|
blur: h,
|
|
3012
|
-
setContent:
|
|
3106
|
+
setContent: b,
|
|
3013
3107
|
getContent: p,
|
|
3014
3108
|
editor: n
|
|
3015
3109
|
}
|
|
3016
3110
|
};
|
|
3017
3111
|
}
|
|
3018
|
-
function
|
|
3019
|
-
const e =
|
|
3020
|
-
return
|
|
3112
|
+
function xt() {
|
|
3113
|
+
const e = Me();
|
|
3114
|
+
return I(() => ({
|
|
3021
3115
|
// 编辑器实例
|
|
3022
3116
|
editor: e.editor.value,
|
|
3023
3117
|
// 基础操作
|
|
@@ -3031,8 +3125,8 @@ function ft() {
|
|
|
3031
3125
|
append: (t) => {
|
|
3032
3126
|
const n = e.editor.value;
|
|
3033
3127
|
if (n) {
|
|
3034
|
-
const
|
|
3035
|
-
n.chain().focus().insertContentAt(
|
|
3128
|
+
const s = n.state.doc.content.size;
|
|
3129
|
+
n.chain().focus().insertContentAt(s, t).run();
|
|
3036
3130
|
}
|
|
3037
3131
|
},
|
|
3038
3132
|
replace: (t) => {
|
|
@@ -3044,115 +3138,129 @@ function ft() {
|
|
|
3044
3138
|
hasContent: e.hasContent.value
|
|
3045
3139
|
}));
|
|
3046
3140
|
}
|
|
3047
|
-
const
|
|
3141
|
+
const ms = { class: "tr-sender-editor-scroll" }, hs = /* @__PURE__ */ U({
|
|
3048
3142
|
__name: "index",
|
|
3049
3143
|
setup(e) {
|
|
3050
|
-
const { editor: t, editorRef: n } =
|
|
3051
|
-
return (
|
|
3144
|
+
const { editor: t, editorRef: n } = Me();
|
|
3145
|
+
return (s, r) => (k(), M("div", {
|
|
3052
3146
|
ref_key: "editorRef",
|
|
3053
3147
|
ref: n,
|
|
3054
3148
|
class: "tr-sender-editor-wrapper"
|
|
3055
3149
|
}, [
|
|
3056
|
-
B("div",
|
|
3057
|
-
L(t) ? (
|
|
3150
|
+
B("div", ms, [
|
|
3151
|
+
L(t) ? (k(), F(L(bn), {
|
|
3058
3152
|
key: 0,
|
|
3059
3153
|
editor: L(t),
|
|
3060
3154
|
class: "tr-sender-editor-content"
|
|
3061
|
-
}, null, 8, ["editor"])) :
|
|
3155
|
+
}, null, 8, ["editor"])) : W("", !0)
|
|
3062
3156
|
])
|
|
3063
3157
|
], 512));
|
|
3064
3158
|
}
|
|
3065
|
-
}),
|
|
3159
|
+
}), sn = /* @__PURE__ */ X(hs, [["__scopeId", "data-v-7f5b51aa"]]), gs = { class: "tr-sender-single-layout" }, xs = {
|
|
3066
3160
|
key: 0,
|
|
3067
3161
|
class: "tr-sender-header"
|
|
3068
|
-
},
|
|
3162
|
+
}, ys = { class: "tr-sender-container" }, bs = { class: "tr-sender-main" }, vs = {
|
|
3069
3163
|
key: 0,
|
|
3070
3164
|
class: "tr-sender-prefix"
|
|
3071
|
-
},
|
|
3165
|
+
}, Ts = { class: "tr-sender-content" }, Es = /* @__PURE__ */ U({
|
|
3072
3166
|
__name: "SingleLineLayout",
|
|
3073
3167
|
setup(e) {
|
|
3074
|
-
const { editor: t, hasContent: n, loading:
|
|
3075
|
-
return (
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
])) :
|
|
3079
|
-
B("div",
|
|
3080
|
-
B("div",
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
])) :
|
|
3084
|
-
B("div",
|
|
3085
|
-
|
|
3086
|
-
|
|
3168
|
+
const { editor: t, hasContent: n, loading: s, showWordLimit: r, maxLength: o } = Me(), l = xt();
|
|
3169
|
+
return (i, a) => (k(), M("div", gs, [
|
|
3170
|
+
i.$slots.header ? (k(), M("div", xs, [
|
|
3171
|
+
O(i.$slots, "header", {}, void 0, !0)
|
|
3172
|
+
])) : W("", !0),
|
|
3173
|
+
B("div", ys, [
|
|
3174
|
+
B("div", bs, [
|
|
3175
|
+
i.$slots.prefix ? (k(), M("div", vs, [
|
|
3176
|
+
O(i.$slots, "prefix", {}, void 0, !0)
|
|
3177
|
+
])) : W("", !0),
|
|
3178
|
+
B("div", Ts, [
|
|
3179
|
+
O(i.$slots, "content", { editor: L(t) }, () => [
|
|
3180
|
+
ne(sn)
|
|
3087
3181
|
], !0)
|
|
3088
3182
|
])
|
|
3089
3183
|
]),
|
|
3090
3184
|
B("div", {
|
|
3091
|
-
class:
|
|
3185
|
+
class: Z(["tr-sender-actions-inline", { "has-content": L(n) || L(s) }])
|
|
3092
3186
|
}, [
|
|
3093
|
-
L(
|
|
3094
|
-
|
|
3095
|
-
|
|
3187
|
+
L(r) && L(o) ? (k(), F(L(Rt), { key: 0 })) : W("", !0),
|
|
3188
|
+
ne(L(Ot), null, Ie({ _: 2 }, [
|
|
3189
|
+
i.$slots["actions-inline"] ? {
|
|
3190
|
+
name: "prepend",
|
|
3191
|
+
fn: $(() => [
|
|
3192
|
+
O(i.$slots, "actions-inline", me(he(L(l))), void 0, !0)
|
|
3193
|
+
]),
|
|
3194
|
+
key: "0"
|
|
3195
|
+
} : void 0
|
|
3196
|
+
]), 1024)
|
|
3096
3197
|
], 2)
|
|
3097
3198
|
])
|
|
3098
3199
|
]));
|
|
3099
3200
|
}
|
|
3100
|
-
}),
|
|
3201
|
+
}), ws = /* @__PURE__ */ X(Es, [["__scopeId", "data-v-7b0a576c"]]), As = {
|
|
3101
3202
|
key: 0,
|
|
3102
3203
|
class: "tr-sender-footer"
|
|
3103
|
-
},
|
|
3204
|
+
}, Cs = { class: "tr-sender-footer-left" }, Ss = { class: "tr-sender-footer-right" }, _s = /* @__PURE__ */ U({
|
|
3104
3205
|
__name: "index",
|
|
3105
3206
|
setup(e) {
|
|
3106
|
-
const { mode: t, showWordLimit: n, maxLength:
|
|
3107
|
-
return (
|
|
3108
|
-
B("div",
|
|
3109
|
-
|
|
3207
|
+
const { mode: t, showWordLimit: n, maxLength: s } = Me(), r = xt();
|
|
3208
|
+
return (o, l) => L(t) === "multiple" ? (k(), M("div", As, [
|
|
3209
|
+
B("div", Cs, [
|
|
3210
|
+
O(o.$slots, "footer", me(he(L(r))), void 0, !0)
|
|
3110
3211
|
]),
|
|
3111
|
-
B("div",
|
|
3112
|
-
L(n) && L(
|
|
3113
|
-
|
|
3114
|
-
|
|
3212
|
+
B("div", Ss, [
|
|
3213
|
+
L(n) && L(s) ? (k(), F(L(Rt), { key: 0 })) : W("", !0),
|
|
3214
|
+
ne(L(Ot), null, Ie({ _: 2 }, [
|
|
3215
|
+
o.$slots["footer-right"] ? {
|
|
3216
|
+
name: "prepend",
|
|
3217
|
+
fn: $(() => [
|
|
3218
|
+
O(o.$slots, "footer-right", me(he(L(r))), void 0, !0)
|
|
3219
|
+
]),
|
|
3220
|
+
key: "0"
|
|
3221
|
+
} : void 0
|
|
3222
|
+
]), 1024)
|
|
3115
3223
|
])
|
|
3116
|
-
])) :
|
|
3224
|
+
])) : W("", !0);
|
|
3117
3225
|
}
|
|
3118
|
-
}),
|
|
3226
|
+
}), Ls = /* @__PURE__ */ X(_s, [["__scopeId", "data-v-ffcdce27"]]), ks = { class: "tr-sender-multi-layout" }, Ms = {
|
|
3119
3227
|
key: 0,
|
|
3120
3228
|
class: "tr-sender-header"
|
|
3121
|
-
},
|
|
3229
|
+
}, Rs = { class: "tr-sender-main" }, Os = {
|
|
3122
3230
|
key: 0,
|
|
3123
3231
|
class: "tr-sender-prefix"
|
|
3124
|
-
},
|
|
3232
|
+
}, Ps = { class: "tr-sender-content" }, Ds = /* @__PURE__ */ U({
|
|
3125
3233
|
__name: "MultiLineLayout",
|
|
3126
3234
|
setup(e) {
|
|
3127
|
-
const t =
|
|
3128
|
-
return (
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
])) :
|
|
3132
|
-
B("div",
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
])) :
|
|
3136
|
-
B("div",
|
|
3137
|
-
|
|
3235
|
+
const t = Me(), n = xt();
|
|
3236
|
+
return (s, r) => (k(), M("div", ks, [
|
|
3237
|
+
s.$slots.header ? (k(), M("div", Ms, [
|
|
3238
|
+
O(s.$slots, "header", {}, void 0, !0)
|
|
3239
|
+
])) : W("", !0),
|
|
3240
|
+
B("div", Rs, [
|
|
3241
|
+
s.$slots.prefix ? (k(), M("div", Os, [
|
|
3242
|
+
O(s.$slots, "prefix", {}, void 0, !0)
|
|
3243
|
+
])) : W("", !0),
|
|
3244
|
+
B("div", Ps, [
|
|
3245
|
+
O(s.$slots, "content", {
|
|
3138
3246
|
editor: L(t).editor
|
|
3139
3247
|
}, () => [
|
|
3140
|
-
|
|
3248
|
+
ne(sn)
|
|
3141
3249
|
], !0)
|
|
3142
3250
|
])
|
|
3143
3251
|
]),
|
|
3144
|
-
|
|
3252
|
+
ne(Ls, null, {
|
|
3145
3253
|
footer: $(() => [
|
|
3146
|
-
|
|
3254
|
+
O(s.$slots, "footer", me(he(L(n))), void 0, !0)
|
|
3147
3255
|
]),
|
|
3148
3256
|
"footer-right": $(() => [
|
|
3149
|
-
|
|
3257
|
+
O(s.$slots, "footer-right", me(he(L(n))), void 0, !0)
|
|
3150
3258
|
]),
|
|
3151
3259
|
_: 3
|
|
3152
3260
|
})
|
|
3153
3261
|
]));
|
|
3154
3262
|
}
|
|
3155
|
-
}),
|
|
3263
|
+
}), Is = /* @__PURE__ */ X(Ds, [["__scopeId", "data-v-0b507198"]]), Bs = /* @__PURE__ */ U({
|
|
3156
3264
|
__name: "index",
|
|
3157
3265
|
props: {
|
|
3158
3266
|
modelValue: {},
|
|
@@ -3175,102 +3283,102 @@ const Zo = { class: "tr-sender-editor-scroll" }, Jo = /* @__PURE__ */ Y({
|
|
|
3175
3283
|
},
|
|
3176
3284
|
emits: ["update:modelValue", "submit", "focus", "blur", "clear", "cancel", "input"],
|
|
3177
3285
|
setup(e, { expose: t, emit: n }) {
|
|
3178
|
-
const
|
|
3179
|
-
return t(l), (
|
|
3180
|
-
class:
|
|
3286
|
+
const s = e, r = n, { context: o, expose: l } = ps(s, r);
|
|
3287
|
+
return t(l), (i, a) => (k(), M("div", {
|
|
3288
|
+
class: Z([
|
|
3181
3289
|
"tr-sender",
|
|
3182
|
-
`tr-sender--${L(
|
|
3183
|
-
`tr-sender--${L(
|
|
3290
|
+
`tr-sender--${L(o).mode.value}`,
|
|
3291
|
+
`tr-sender--${L(o).size.value}`,
|
|
3184
3292
|
{
|
|
3185
|
-
"is-auto-switching": L(
|
|
3186
|
-
"is-disabled": L(
|
|
3293
|
+
"is-auto-switching": L(o).isAutoSwitching.value,
|
|
3294
|
+
"is-disabled": L(o).disabled.value
|
|
3187
3295
|
}
|
|
3188
3296
|
])
|
|
3189
3297
|
}, [
|
|
3190
|
-
L(
|
|
3191
|
-
|
|
3298
|
+
L(o).mode.value === "single" ? (k(), F(ws, { key: 0 }, Ie({ _: 2 }, [
|
|
3299
|
+
i.$slots.header ? {
|
|
3192
3300
|
name: "header",
|
|
3193
3301
|
fn: $(() => [
|
|
3194
|
-
|
|
3302
|
+
O(i.$slots, "header", {}, void 0, !0)
|
|
3195
3303
|
]),
|
|
3196
3304
|
key: "0"
|
|
3197
3305
|
} : void 0,
|
|
3198
|
-
|
|
3306
|
+
i.$slots.prefix ? {
|
|
3199
3307
|
name: "prefix",
|
|
3200
3308
|
fn: $(() => [
|
|
3201
|
-
|
|
3309
|
+
O(i.$slots, "prefix", {}, void 0, !0)
|
|
3202
3310
|
]),
|
|
3203
3311
|
key: "1"
|
|
3204
3312
|
} : void 0,
|
|
3205
|
-
|
|
3313
|
+
i.$slots.content ? {
|
|
3206
3314
|
name: "content",
|
|
3207
3315
|
fn: $((c) => [
|
|
3208
|
-
|
|
3316
|
+
O(i.$slots, "content", me(he(c)), void 0, !0)
|
|
3209
3317
|
]),
|
|
3210
3318
|
key: "2"
|
|
3211
3319
|
} : void 0,
|
|
3212
|
-
|
|
3320
|
+
i.$slots["actions-inline"] ? {
|
|
3213
3321
|
name: "actions-inline",
|
|
3214
3322
|
fn: $(() => [
|
|
3215
|
-
|
|
3323
|
+
O(i.$slots, "actions-inline", {}, void 0, !0)
|
|
3216
3324
|
]),
|
|
3217
3325
|
key: "3"
|
|
3218
3326
|
} : void 0
|
|
3219
|
-
]), 1024)) : (
|
|
3220
|
-
|
|
3327
|
+
]), 1024)) : (k(), F(Is, { key: 1 }, Ie({ _: 2 }, [
|
|
3328
|
+
i.$slots.header ? {
|
|
3221
3329
|
name: "header",
|
|
3222
3330
|
fn: $(() => [
|
|
3223
|
-
|
|
3331
|
+
O(i.$slots, "header", {}, void 0, !0)
|
|
3224
3332
|
]),
|
|
3225
3333
|
key: "0"
|
|
3226
3334
|
} : void 0,
|
|
3227
|
-
|
|
3335
|
+
i.$slots.prefix ? {
|
|
3228
3336
|
name: "prefix",
|
|
3229
3337
|
fn: $(() => [
|
|
3230
|
-
|
|
3338
|
+
O(i.$slots, "prefix", {}, void 0, !0)
|
|
3231
3339
|
]),
|
|
3232
3340
|
key: "1"
|
|
3233
3341
|
} : void 0,
|
|
3234
|
-
|
|
3342
|
+
i.$slots.content ? {
|
|
3235
3343
|
name: "content",
|
|
3236
3344
|
fn: $((c) => [
|
|
3237
|
-
|
|
3345
|
+
O(i.$slots, "content", me(he(c)), void 0, !0)
|
|
3238
3346
|
]),
|
|
3239
3347
|
key: "2"
|
|
3240
3348
|
} : void 0,
|
|
3241
|
-
|
|
3349
|
+
i.$slots.footer ? {
|
|
3242
3350
|
name: "footer",
|
|
3243
3351
|
fn: $(() => [
|
|
3244
|
-
|
|
3352
|
+
O(i.$slots, "footer", {}, void 0, !0)
|
|
3245
3353
|
]),
|
|
3246
3354
|
key: "3"
|
|
3247
3355
|
} : void 0,
|
|
3248
|
-
|
|
3356
|
+
i.$slots["footer-right"] ? {
|
|
3249
3357
|
name: "footer-right",
|
|
3250
3358
|
fn: $(() => [
|
|
3251
|
-
|
|
3359
|
+
O(i.$slots, "footer-right", {}, void 0, !0)
|
|
3252
3360
|
]),
|
|
3253
3361
|
key: "4"
|
|
3254
3362
|
} : void 0
|
|
3255
3363
|
]), 1024))
|
|
3256
3364
|
], 2));
|
|
3257
3365
|
}
|
|
3258
|
-
}),
|
|
3259
|
-
|
|
3260
|
-
const
|
|
3261
|
-
e.component(
|
|
3262
|
-
},
|
|
3263
|
-
install:
|
|
3366
|
+
}), qe = /* @__PURE__ */ X(Bs, [["__scopeId", "data-v-6c700cc1"]]);
|
|
3367
|
+
qe.name = "TrSender";
|
|
3368
|
+
const $s = function(e) {
|
|
3369
|
+
e.component(qe.name, qe);
|
|
3370
|
+
}, Qs = Object.assign(qe, {
|
|
3371
|
+
install: $s,
|
|
3264
3372
|
// 扩展类(用于继承)
|
|
3265
|
-
Mention:
|
|
3266
|
-
Suggestion:
|
|
3267
|
-
Template:
|
|
3373
|
+
Mention: Gt,
|
|
3374
|
+
Suggestion: Xt,
|
|
3375
|
+
Template: Zt,
|
|
3268
3376
|
// 便捷函数(用于简单场景)
|
|
3269
|
-
mention:
|
|
3270
|
-
suggestion:
|
|
3271
|
-
template:
|
|
3377
|
+
mention: Mo,
|
|
3378
|
+
suggestion: No,
|
|
3379
|
+
template: ss
|
|
3272
3380
|
});
|
|
3273
3381
|
export {
|
|
3274
|
-
|
|
3275
|
-
|
|
3382
|
+
Qs as default,
|
|
3383
|
+
Me as useSenderContext
|
|
3276
3384
|
};
|