@opentiny/tiny-robot 0.2.14 → 0.2.15
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/base-popper/index.js +50 -49
- package/dist/flow-layout-buttons/index.js +10 -10
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +223 -1060
- package/dist/index3.js +33 -25
- package/dist/index5.js +179 -180
- package/dist/index6.js +610 -613
- package/dist/sender/index.js +761 -756
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +23 -23
- package/dist/suggestion-popover/index.js +198 -207
- package/dist/tiny-robot-svgs.js +11 -15
- package/package.json +3 -3
package/dist/sender/index.js
CHANGED
|
@@ -1,283 +1,278 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { I as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
(p) => {
|
|
14
|
-
p !== void 0 && p !== c.value && (c.value = p);
|
|
1
|
+
import { ref as E, watch as Z, reactive as et, computed as D, nextTick as q, defineComponent as ge, createElementBlock as R, openBlock as m, createCommentVNode as K, normalizeStyle as De, createBlock as X, unref as k, withCtx as pe, createElementVNode as A, createVNode as j, normalizeClass as ee, toDisplayString as le, useAttrs as tt, resolveComponent as nt, mergeProps as fe, Fragment as ce, renderList as he, mergeModels as st, useModel as ot, Transition as Ee, withModifiers as at, useSlots as lt, renderSlot as ae, isRef as it, createTextVNode as Ne } from "vue";
|
|
2
|
+
import { I as rt } from "../index5.js";
|
|
3
|
+
import { T as Me } from "../index4.js";
|
|
4
|
+
import { I as ut, L as ct, v as dt, t as ft, w as pt, P as ht, _ as gt } from "../tiny-robot-svgs.js";
|
|
5
|
+
import { _ as be } from "../_plugin-vue_export-helper.js";
|
|
6
|
+
import { t as vt } from "../utils.js";
|
|
7
|
+
function yt(i, r) {
|
|
8
|
+
const a = E(i.modelValue || i.defaultValue || ""), c = E(null);
|
|
9
|
+
Z(
|
|
10
|
+
() => i.modelValue,
|
|
11
|
+
(h) => {
|
|
12
|
+
h !== void 0 && h !== a.value && (a.value = h);
|
|
15
13
|
}
|
|
16
|
-
),
|
|
17
|
-
() =>
|
|
18
|
-
(
|
|
19
|
-
|
|
14
|
+
), Z(
|
|
15
|
+
() => a.value,
|
|
16
|
+
(h) => {
|
|
17
|
+
r("update:modelValue", h);
|
|
20
18
|
}
|
|
21
19
|
);
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
!
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
20
|
+
const y = (h) => {
|
|
21
|
+
a.value = h, r("update:modelValue", h);
|
|
22
|
+
}, w = (h) => {
|
|
23
|
+
h == null || h.preventDefault();
|
|
24
|
+
const _ = a.value;
|
|
25
|
+
!i.disabled && !i.loading && _.trim() && r("submit", _);
|
|
26
|
+
}, n = () => {
|
|
27
|
+
a.value = "", r("update:modelValue", ""), r("clear");
|
|
28
|
+
}, p = E(!1);
|
|
31
29
|
return {
|
|
32
|
-
inputValue:
|
|
33
|
-
inputWrapper:
|
|
34
|
-
isComposing:
|
|
35
|
-
handleChange:
|
|
36
|
-
handleSubmit:
|
|
37
|
-
handleClear:
|
|
30
|
+
inputValue: a,
|
|
31
|
+
inputWrapper: c,
|
|
32
|
+
isComposing: p,
|
|
33
|
+
handleChange: y,
|
|
34
|
+
handleSubmit: w,
|
|
35
|
+
handleClear: n,
|
|
38
36
|
clearInput: () => {
|
|
39
|
-
|
|
37
|
+
n();
|
|
40
38
|
}
|
|
41
39
|
};
|
|
42
40
|
}
|
|
43
|
-
function
|
|
41
|
+
function mt(i, r, a, c, y, w, n, p, C, h, _, g, I, d, L, U) {
|
|
44
42
|
const $ = () => {
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
if (!(
|
|
48
|
-
switch (
|
|
43
|
+
g.value && (L != null && L.value && (U == null || U()), r("submit", a.value.trim()));
|
|
44
|
+
}, z = (v, F) => {
|
|
45
|
+
if (!(v.key === "Enter")) return !1;
|
|
46
|
+
switch (F) {
|
|
49
47
|
case "enter":
|
|
50
|
-
return !
|
|
48
|
+
return !v.shiftKey && !v.ctrlKey && !v.metaKey;
|
|
51
49
|
case "ctrlEnter":
|
|
52
|
-
return (
|
|
50
|
+
return (v.ctrlKey || v.metaKey) && !v.shiftKey;
|
|
53
51
|
case "shiftEnter":
|
|
54
|
-
return
|
|
52
|
+
return v.shiftKey && !v.ctrlKey && !v.metaKey;
|
|
55
53
|
default:
|
|
56
54
|
return !1;
|
|
57
55
|
}
|
|
58
56
|
};
|
|
59
57
|
return {
|
|
60
|
-
handleKeyPress: (
|
|
61
|
-
if (
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
const V =
|
|
65
|
-
|
|
66
|
-
` +
|
|
67
|
-
V.selectionStart = V.selectionEnd =
|
|
58
|
+
handleKeyPress: (v) => {
|
|
59
|
+
if (c.value) return;
|
|
60
|
+
if (v.key === "Enter" && v.shiftKey && (I == null ? void 0 : I.value) === "single" && d) {
|
|
61
|
+
v.preventDefault(), d();
|
|
62
|
+
const V = v.target, W = V.selectionStart, G = a.value;
|
|
63
|
+
a.value = G.substring(0, W) + `
|
|
64
|
+
` + G.substring(W), setTimeout(() => {
|
|
65
|
+
V.selectionStart = V.selectionEnd = W + 1;
|
|
68
66
|
}, 0);
|
|
69
67
|
return;
|
|
70
68
|
}
|
|
71
|
-
if (
|
|
72
|
-
|
|
69
|
+
if (v.key === "Tab" && w.value && n.value) {
|
|
70
|
+
v.preventDefault(), p();
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
77
|
-
|
|
73
|
+
if (w.value) {
|
|
74
|
+
if (v.key === "ArrowDown") {
|
|
75
|
+
v.preventDefault(), h("down");
|
|
78
76
|
return;
|
|
79
77
|
}
|
|
80
|
-
if (
|
|
81
|
-
|
|
78
|
+
if (v.key === "ArrowUp") {
|
|
79
|
+
v.preventDefault(), h("up");
|
|
82
80
|
return;
|
|
83
81
|
}
|
|
84
|
-
if (
|
|
85
|
-
|
|
82
|
+
if (v.key === "Enter" && n.value) {
|
|
83
|
+
v.preventDefault(), p();
|
|
86
84
|
return;
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
|
-
if (
|
|
90
|
-
|
|
87
|
+
if (v.key === "Escape") {
|
|
88
|
+
w.value ? (C(), v.preventDefault()) : y.isRecording && (_(), v.preventDefault()), r("escape-press");
|
|
91
89
|
return;
|
|
92
90
|
}
|
|
93
|
-
|
|
91
|
+
z(v, i.submitType) && (v.preventDefault(), g.value && $());
|
|
94
92
|
},
|
|
95
93
|
triggerSubmit: $
|
|
96
94
|
};
|
|
97
95
|
}
|
|
98
|
-
function
|
|
99
|
-
const
|
|
96
|
+
function wt(i) {
|
|
97
|
+
const r = et({
|
|
100
98
|
isRecording: !1,
|
|
101
99
|
isSupported: typeof window < "u" && "webkitSpeechRecognition" in window || "SpeechRecognition" in window,
|
|
102
100
|
error: void 0
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
var
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
var
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
var
|
|
116
|
-
|
|
101
|
+
}), a = r.isSupported ? new (window.webkitSpeechRecognition || window.SpeechRecognition)() : void 0;
|
|
102
|
+
a !== void 0 && (a.continuous = i.continuous ?? !1, a.interimResults = i.interimResults ?? !0, a.lang = i.lang ?? navigator.language, a.onstart = () => {
|
|
103
|
+
var n;
|
|
104
|
+
r.isRecording = !0, r.error = void 0, (n = i.onStart) == null || n.call(i);
|
|
105
|
+
}, a.onend = () => {
|
|
106
|
+
var n;
|
|
107
|
+
r.isRecording = !1, (n = i.onEnd) == null || n.call(i);
|
|
108
|
+
}, a.onresult = (n) => {
|
|
109
|
+
var C, h;
|
|
110
|
+
const p = Array.from(n.results).map((_) => _[0].transcript).join("");
|
|
111
|
+
n.results[0].isFinal ? (C = i.onFinal) == null || C.call(i, p) : (h = i.onInterim) == null || h.call(i, p);
|
|
112
|
+
}, a.onerror = (n) => {
|
|
113
|
+
var p;
|
|
114
|
+
r.error = new Error(n.error), r.isRecording = !1, (p = i.onError) == null || p.call(i, r.error);
|
|
117
115
|
});
|
|
118
|
-
const
|
|
119
|
-
var
|
|
120
|
-
if (!
|
|
121
|
-
const
|
|
122
|
-
|
|
116
|
+
const c = () => {
|
|
117
|
+
var n;
|
|
118
|
+
if (!a) {
|
|
119
|
+
const p = new Error("浏览器不支持语音识别");
|
|
120
|
+
r.error = p, (n = i.onError) == null || n.call(i, p);
|
|
123
121
|
return;
|
|
124
122
|
}
|
|
125
|
-
if (
|
|
123
|
+
if (r.isRecording) {
|
|
126
124
|
try {
|
|
127
|
-
|
|
125
|
+
a.stop(), setTimeout(() => {
|
|
128
126
|
try {
|
|
129
|
-
|
|
130
|
-
} catch (
|
|
131
|
-
|
|
127
|
+
a.start();
|
|
128
|
+
} catch (p) {
|
|
129
|
+
w(p);
|
|
132
130
|
}
|
|
133
131
|
}, 100);
|
|
134
|
-
} catch (
|
|
135
|
-
|
|
132
|
+
} catch (p) {
|
|
133
|
+
w(p);
|
|
136
134
|
}
|
|
137
135
|
return;
|
|
138
136
|
}
|
|
139
137
|
try {
|
|
140
|
-
|
|
141
|
-
} catch (
|
|
142
|
-
|
|
138
|
+
a.start();
|
|
139
|
+
} catch (p) {
|
|
140
|
+
w(p);
|
|
143
141
|
}
|
|
144
|
-
},
|
|
145
|
-
if (
|
|
142
|
+
}, y = () => {
|
|
143
|
+
if (a && r.isRecording)
|
|
146
144
|
try {
|
|
147
|
-
|
|
148
|
-
} catch (
|
|
149
|
-
|
|
145
|
+
a.stop();
|
|
146
|
+
} catch (n) {
|
|
147
|
+
w(n);
|
|
150
148
|
}
|
|
151
|
-
},
|
|
152
|
-
var
|
|
153
|
-
|
|
149
|
+
}, w = (n) => {
|
|
150
|
+
var p;
|
|
151
|
+
r.error = n instanceof Error ? n : new Error("语音识别操作失败"), r.isRecording = !1, (p = i.onError) == null || p.call(i, r.error);
|
|
154
152
|
};
|
|
155
153
|
return {
|
|
156
|
-
speechState:
|
|
157
|
-
start:
|
|
158
|
-
stop:
|
|
154
|
+
speechState: r,
|
|
155
|
+
start: c,
|
|
156
|
+
stop: y
|
|
159
157
|
};
|
|
160
158
|
}
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
163
|
-
return [{ text:
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
for (;
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
start:
|
|
171
|
-
end:
|
|
172
|
-
}),
|
|
159
|
+
const St = (i, r) => {
|
|
160
|
+
if (!r || !i)
|
|
161
|
+
return [{ text: i, isMatch: !1 }];
|
|
162
|
+
const a = i.toLowerCase(), c = r.toLowerCase(), y = [];
|
|
163
|
+
let w = 0;
|
|
164
|
+
for (; w < a.length; ) {
|
|
165
|
+
const h = a.indexOf(c, w);
|
|
166
|
+
if (h === -1) break;
|
|
167
|
+
y.push({
|
|
168
|
+
start: h,
|
|
169
|
+
end: h + r.length
|
|
170
|
+
}), w = h + 1;
|
|
173
171
|
}
|
|
174
|
-
if (
|
|
175
|
-
return [{ text:
|
|
176
|
-
const
|
|
177
|
-
for (const
|
|
178
|
-
if (
|
|
179
|
-
|
|
172
|
+
if (y.length === 0)
|
|
173
|
+
return [{ text: i, isMatch: !1 }];
|
|
174
|
+
const n = [];
|
|
175
|
+
for (const h of y)
|
|
176
|
+
if (n.length === 0)
|
|
177
|
+
n.push(h);
|
|
180
178
|
else {
|
|
181
|
-
const
|
|
182
|
-
|
|
179
|
+
const _ = n[n.length - 1];
|
|
180
|
+
h.start <= _.end ? _.end = Math.max(_.end, h.end) : n.push(h);
|
|
183
181
|
}
|
|
184
|
-
const
|
|
185
|
-
let
|
|
186
|
-
for (const
|
|
187
|
-
|
|
188
|
-
text:
|
|
182
|
+
const p = [];
|
|
183
|
+
let C = 0;
|
|
184
|
+
for (const h of n)
|
|
185
|
+
C < h.start && p.push({
|
|
186
|
+
text: i.substring(C, h.start),
|
|
189
187
|
isMatch: !1
|
|
190
|
-
}),
|
|
191
|
-
text:
|
|
188
|
+
}), p.push({
|
|
189
|
+
text: i.substring(h.start, h.end),
|
|
192
190
|
isMatch: !0
|
|
193
|
-
}),
|
|
194
|
-
return
|
|
195
|
-
text:
|
|
191
|
+
}), C = h.end;
|
|
192
|
+
return C < i.length && p.push({
|
|
193
|
+
text: i.substring(C),
|
|
196
194
|
isMatch: !1
|
|
197
|
-
}),
|
|
195
|
+
}), p;
|
|
198
196
|
};
|
|
199
|
-
function
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
202
|
-
const x =
|
|
203
|
-
return
|
|
204
|
-
}),
|
|
197
|
+
function _t(i, r, a, c, y) {
|
|
198
|
+
const w = E(!1), n = E(-1), p = E(-1), C = E(""), h = E(!1), _ = E(null), g = E(!1), I = E(null), d = D(() => {
|
|
199
|
+
if (!i.suggestions || !a.value || y.value) return [];
|
|
200
|
+
const x = a.value.toLowerCase();
|
|
201
|
+
return i.suggestions.filter((N) => N.toLowerCase().includes(x));
|
|
202
|
+
}), L = D(() => {
|
|
205
203
|
let x = -1;
|
|
206
|
-
return
|
|
207
|
-
}),
|
|
208
|
-
if (
|
|
209
|
-
|
|
204
|
+
return I.value === "mouse" && p.value !== -1 ? x = p.value : I.value === "keyboard" && n.value !== -1 && (x = n.value), d.value[x] || null;
|
|
205
|
+
}), U = (x) => x === n.value || x === p.value, $ = (x) => {
|
|
206
|
+
if (I.value === null) {
|
|
207
|
+
C.value = "", h.value = !1;
|
|
210
208
|
return;
|
|
211
209
|
}
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
|
|
210
|
+
const N = x || L.value;
|
|
211
|
+
N && a.value && N.toLowerCase().startsWith(a.value.toLowerCase()) ? (C.value = N.substring(a.value.length), h.value = !0) : (C.value = "", h.value = !1);
|
|
212
|
+
}, z = () => {
|
|
213
|
+
w.value = !1, n.value = -1, p.value = -1, I.value = null, C.value = "", h.value = !1;
|
|
214
|
+
}, te = () => {
|
|
215
|
+
w.value = !0, n.value = -1, p.value = -1, I.value = null, $();
|
|
216
|
+
}, v = () => {
|
|
217
|
+
c.value || g.value || q(() => {
|
|
218
|
+
a.value && i.suggestions && i.suggestions.length > 0 && !y.value && d.value.length > 0 ? te() : z();
|
|
221
219
|
});
|
|
222
220
|
};
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
Z(a, v), Z(() => i.suggestions, v);
|
|
222
|
+
const F = (x) => {
|
|
223
|
+
g.value = !0, a.value = x, r("update:modelValue", x), r("suggestion-select", x), W(), q(() => {
|
|
224
|
+
g.value = !1;
|
|
227
225
|
});
|
|
228
226
|
}, V = () => {
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
|
|
227
|
+
L.value && F(L.value);
|
|
228
|
+
}, W = () => {
|
|
229
|
+
z();
|
|
232
230
|
};
|
|
233
231
|
return {
|
|
234
|
-
showSuggestionsPopup:
|
|
235
|
-
completionPlaceholder:
|
|
236
|
-
showTabHint:
|
|
237
|
-
suggestionsListRef:
|
|
238
|
-
filteredSuggestions:
|
|
239
|
-
activeSuggestion:
|
|
240
|
-
isItemHighlighted:
|
|
232
|
+
showSuggestionsPopup: w,
|
|
233
|
+
completionPlaceholder: C,
|
|
234
|
+
showTabHint: h,
|
|
235
|
+
suggestionsListRef: _,
|
|
236
|
+
filteredSuggestions: d,
|
|
237
|
+
activeSuggestion: L,
|
|
238
|
+
isItemHighlighted: U,
|
|
241
239
|
updateCompletionPlaceholder: $,
|
|
242
|
-
updateSuggestionsState:
|
|
243
|
-
selectSuggestion:
|
|
240
|
+
updateSuggestionsState: v,
|
|
241
|
+
selectSuggestion: F,
|
|
244
242
|
acceptCurrentSuggestion: V,
|
|
245
|
-
closeSuggestionsPopup:
|
|
243
|
+
closeSuggestionsPopup: W,
|
|
246
244
|
navigateSuggestions: (x) => {
|
|
247
|
-
if (!
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
|
|
245
|
+
if (!w.value || d.value.length === 0) return;
|
|
246
|
+
I.value = "keyboard", n.value === -1 ? n.value = x === "down" ? 0 : d.value.length - 1 : x === "down" ? n.value = (n.value + 1) % d.value.length : n.value = (n.value - 1 + d.value.length) % d.value.length;
|
|
247
|
+
const N = d.value[n.value];
|
|
248
|
+
N && $(N);
|
|
249
|
+
const M = _.value;
|
|
250
|
+
if (M) {
|
|
251
|
+
const ne = M.children[n.value];
|
|
252
|
+
ne && ne.scrollIntoView({ block: "nearest" });
|
|
255
253
|
}
|
|
256
254
|
},
|
|
257
255
|
handleSuggestionItemHover: (x) => {
|
|
258
|
-
|
|
256
|
+
I.value = "mouse", p.value = x, $(d.value[x]);
|
|
259
257
|
},
|
|
260
258
|
handleSuggestionItemLeave: () => {
|
|
261
|
-
if (
|
|
262
|
-
|
|
263
|
-
const x =
|
|
259
|
+
if (p.value = -1, n.value !== -1) {
|
|
260
|
+
I.value = "keyboard";
|
|
261
|
+
const x = d.value[n.value];
|
|
264
262
|
x && $(x);
|
|
265
263
|
} else
|
|
266
|
-
|
|
264
|
+
I.value = null, $();
|
|
267
265
|
},
|
|
268
266
|
handleClickOutside: () => {
|
|
269
|
-
|
|
267
|
+
W();
|
|
270
268
|
},
|
|
271
|
-
highlightSuggestionText:
|
|
269
|
+
highlightSuggestionText: St
|
|
272
270
|
};
|
|
273
271
|
}
|
|
274
|
-
const
|
|
275
|
-
key: 0,
|
|
276
|
-
class: "action-buttons__utility"
|
|
277
|
-
}, Ot = { class: "action-buttons__submit-content" }, Tt = {
|
|
272
|
+
const bt = { class: "action-buttons" }, Ct = { class: "action-buttons__button" }, kt = { class: "action-buttons__submit-content" }, xt = {
|
|
278
273
|
key: 0,
|
|
279
274
|
class: "action-buttons__cancel-text"
|
|
280
|
-
},
|
|
275
|
+
}, It = /* @__PURE__ */ ge({
|
|
281
276
|
__name: "ActionButtons",
|
|
282
277
|
props: {
|
|
283
278
|
loading: { type: Boolean, default: !1 },
|
|
@@ -296,114 +291,96 @@ const It = { class: "action-buttons" }, Rt = {
|
|
|
296
291
|
stopText: { default: void 0 }
|
|
297
292
|
},
|
|
298
293
|
emits: ["clear", "toggle-speech", "submit", "cancel"],
|
|
299
|
-
setup(
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
},
|
|
303
|
-
if (!
|
|
304
|
-
const
|
|
305
|
-
|
|
294
|
+
setup(i, { emit: r }) {
|
|
295
|
+
const a = i, c = r, y = D(() => a.allowSpeech), w = D(() => a.speechStatus.isRecording), n = D(() => a.disabled), p = D(() => n.value || a.isOverLimit), C = D(() => a.allowFiles || a.allowSpeech || a.showClear), h = () => {
|
|
296
|
+
n.value || c("clear");
|
|
297
|
+
}, _ = () => {
|
|
298
|
+
if (!n.value) {
|
|
299
|
+
const d = !a.speechStatus.isRecording;
|
|
300
|
+
c("toggle-speech", d);
|
|
306
301
|
}
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
},
|
|
310
|
-
|
|
302
|
+
}, g = () => {
|
|
303
|
+
p.value || c("submit");
|
|
304
|
+
}, I = () => {
|
|
305
|
+
n.value || c("cancel");
|
|
311
306
|
};
|
|
312
|
-
return (
|
|
313
|
-
|
|
314
|
-
|
|
307
|
+
return (d, L) => (m(), R("div", bt, [
|
|
308
|
+
C.value ? (m(), R("div", {
|
|
309
|
+
key: 0,
|
|
310
|
+
class: "action-buttons__utility",
|
|
311
|
+
style: De({ "padding-right": d.hasContent || d.loading ? "0" : "6px" })
|
|
312
|
+
}, [
|
|
313
|
+
d.allowFiles && !d.loading ? (m(), X(k(Me), {
|
|
315
314
|
key: 0,
|
|
316
315
|
content: "上传文件",
|
|
317
316
|
placement: "top"
|
|
318
317
|
}, {
|
|
319
|
-
default:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
j(_(ht), {
|
|
327
|
-
class: "action-buttons__icon",
|
|
328
|
-
alt: "上传文件"
|
|
329
|
-
})
|
|
330
|
-
]),
|
|
331
|
-
_: 1
|
|
332
|
-
}, 8, ["disabled"])
|
|
318
|
+
default: pe(() => [
|
|
319
|
+
A("div", Ct, [
|
|
320
|
+
j(k(ut), {
|
|
321
|
+
class: "action-buttons__icon",
|
|
322
|
+
alt: "上传文件"
|
|
323
|
+
})
|
|
324
|
+
])
|
|
333
325
|
]),
|
|
334
326
|
_: 1
|
|
335
327
|
})) : K("", !0),
|
|
336
|
-
|
|
328
|
+
y.value && !d.loading ? (m(), R("div", {
|
|
337
329
|
key: 1,
|
|
338
|
-
class:
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}))
|
|
353
|
-
]),
|
|
354
|
-
_: 1
|
|
355
|
-
}, 8, ["disabled", "class"])) : K("", !0),
|
|
356
|
-
w.showClear ? (g(), U(_(Ue), {
|
|
330
|
+
class: ee(["action-buttons__button", { "is-recording": w.value }]),
|
|
331
|
+
onClick: _
|
|
332
|
+
}, [
|
|
333
|
+
w.value ? (m(), X(k(dt), {
|
|
334
|
+
key: 1,
|
|
335
|
+
class: "action-buttons__icon action-buttons__icon--recording",
|
|
336
|
+
alt: "语音中"
|
|
337
|
+
})) : (m(), X(k(ct), {
|
|
338
|
+
key: 0,
|
|
339
|
+
class: "action-buttons__icon",
|
|
340
|
+
alt: "录音"
|
|
341
|
+
}))
|
|
342
|
+
], 2)) : K("", !0),
|
|
343
|
+
d.showClear ? (m(), X(k(Me), {
|
|
357
344
|
key: 2,
|
|
358
345
|
content: "清空内容",
|
|
359
346
|
placement: "top"
|
|
360
347
|
}, {
|
|
361
|
-
default:
|
|
362
|
-
|
|
363
|
-
class: "action-buttons__button
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
default: Q(() => [
|
|
369
|
-
(g(), U(ot(_(c)), { class: "action-buttons__icon action-buttons__icon--close" }))
|
|
370
|
-
]),
|
|
371
|
-
_: 1
|
|
372
|
-
}, 8, ["disabled"])
|
|
348
|
+
default: pe(() => [
|
|
349
|
+
A("div", {
|
|
350
|
+
class: "action-buttons__button",
|
|
351
|
+
onClick: h
|
|
352
|
+
}, [
|
|
353
|
+
j(k(ft), { class: "action-buttons__icon action-buttons__icon--clear" })
|
|
354
|
+
])
|
|
373
355
|
]),
|
|
374
356
|
_: 1
|
|
375
357
|
})) : K("", !0)
|
|
376
|
-
])) : K("", !0),
|
|
377
|
-
|
|
358
|
+
], 4)) : K("", !0),
|
|
359
|
+
d.hasContent || d.loading ? (m(), R("div", {
|
|
378
360
|
key: 1,
|
|
379
|
-
type: "text",
|
|
380
361
|
class: "action-buttons__button action-buttons__submit",
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
])
|
|
401
|
-
]),
|
|
402
|
-
_: 1
|
|
403
|
-
}, 8, ["disabled"])) : K("", !0)
|
|
362
|
+
onClick: L[0] || (L[0] = (U) => d.loading ? I() : g())
|
|
363
|
+
}, [
|
|
364
|
+
A("div", kt, [
|
|
365
|
+
d.loading ? (m(), R("div", {
|
|
366
|
+
key: 1,
|
|
367
|
+
class: ee(["action-buttons__cancel", { "action-buttons__cancel--icon-only": !d.stopText }])
|
|
368
|
+
}, [
|
|
369
|
+
j(k(ht), {
|
|
370
|
+
class: "action-buttons__icon action-buttons__icon--cancel",
|
|
371
|
+
alt: "停止"
|
|
372
|
+
}),
|
|
373
|
+
d.stopText ? (m(), R("span", xt, le(d.stopText), 1)) : K("", !0)
|
|
374
|
+
], 2)) : (m(), X(k(pt), {
|
|
375
|
+
key: 0,
|
|
376
|
+
class: ee(["action-buttons__icon", "action-buttons__icon--send", { "is-disabled": p.value }]),
|
|
377
|
+
alt: "发送"
|
|
378
|
+
}, null, 8, ["class"]))
|
|
379
|
+
])
|
|
380
|
+
])) : K("", !0)
|
|
404
381
|
]));
|
|
405
382
|
}
|
|
406
|
-
}),
|
|
383
|
+
}), qe = /* @__PURE__ */ be(It, [["__scopeId", "data-v-f811794c"]]), Rt = ["data-id", "data-type"], Ot = ["data-id", "data-type"], Tt = /* @__PURE__ */ ge({
|
|
407
384
|
inheritAttrs: !1,
|
|
408
385
|
__name: "Block",
|
|
409
386
|
props: {
|
|
@@ -413,61 +390,61 @@ const It = { class: "action-buttons" }, Rt = {
|
|
|
413
390
|
readonly: { type: Boolean },
|
|
414
391
|
asChild: { type: Boolean }
|
|
415
392
|
},
|
|
416
|
-
setup(
|
|
417
|
-
const
|
|
418
|
-
return (
|
|
419
|
-
const
|
|
420
|
-
return
|
|
393
|
+
setup(i) {
|
|
394
|
+
const r = i, a = tt();
|
|
395
|
+
return (c, y) => {
|
|
396
|
+
const w = nt("Block", !0);
|
|
397
|
+
return r.type !== "block" ? (m(), R("span", fe({
|
|
421
398
|
key: 0,
|
|
422
|
-
"data-id":
|
|
423
|
-
"data-type":
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
key: `${
|
|
427
|
-
}, { ref_for: !0 },
|
|
399
|
+
"data-id": r.id,
|
|
400
|
+
"data-type": r.type
|
|
401
|
+
}, k(a)), le(r.content), 17, Rt)) : (m(), R(ce, { key: 1 }, [
|
|
402
|
+
r.asChild ? (m(!0), R(ce, { key: 0 }, he(r.content, (n) => (m(), X(w, fe({
|
|
403
|
+
key: `${n.id}-${n.type}`
|
|
404
|
+
}, { ref_for: !0 }, n), null, 16))), 128)) : (m(), R("span", fe({
|
|
428
405
|
key: 1,
|
|
429
|
-
"data-id":
|
|
430
|
-
"data-type":
|
|
431
|
-
},
|
|
432
|
-
(
|
|
433
|
-
key: `${
|
|
434
|
-
}, { ref_for: !0 },
|
|
435
|
-
], 16,
|
|
406
|
+
"data-id": r.id,
|
|
407
|
+
"data-type": r.type
|
|
408
|
+
}, k(a)), [
|
|
409
|
+
(m(!0), R(ce, null, he(r.content, (n) => (m(), X(w, fe({
|
|
410
|
+
key: `${n.id}-${n.type}`
|
|
411
|
+
}, { ref_for: !0 }, n), null, 16))), 128))
|
|
412
|
+
], 16, Ot))
|
|
436
413
|
], 64));
|
|
437
414
|
};
|
|
438
415
|
}
|
|
439
|
-
}),
|
|
440
|
-
function
|
|
441
|
-
let
|
|
442
|
-
return { commit: (
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
}, undo: () =>
|
|
446
|
-
var
|
|
447
|
-
|
|
448
|
-
}, get: () =>
|
|
416
|
+
}), $t = /* @__PURE__ */ be(Tt, [["__scopeId", "data-v-13862606"]]);
|
|
417
|
+
function Lt(i, r = {}) {
|
|
418
|
+
let a = [], c = [], y = i;
|
|
419
|
+
return { commit: (_) => {
|
|
420
|
+
var g;
|
|
421
|
+
a.push(y), y = _, c.length && ((g = r.onRemoveHistory) == null || g.call(r, c)), c = [];
|
|
422
|
+
}, undo: () => a.length ? (c.push(y), y = a.pop(), y) : null, redo: () => c.length ? (a.push(y), y = c.pop(), y) : null, clear: () => {
|
|
423
|
+
var _, g;
|
|
424
|
+
a.length && ((_ = r.onRemoveHistory) == null || _.call(r, a)), c.length && ((g = r.onRemoveHistory) == null || g.call(r, c)), a = [], c = [];
|
|
425
|
+
}, get: () => y };
|
|
449
426
|
}
|
|
450
|
-
const
|
|
427
|
+
const Bt = { class: "editor-container" }, Le = "", Be = "", Et = /* @__PURE__ */ ge({
|
|
451
428
|
__name: "TemplateEditor",
|
|
452
429
|
props: {
|
|
453
430
|
modelValue: { default: () => [] },
|
|
454
431
|
modelModifiers: {}
|
|
455
432
|
},
|
|
456
|
-
emits: /* @__PURE__ */
|
|
457
|
-
setup(
|
|
458
|
-
const
|
|
459
|
-
function
|
|
433
|
+
emits: /* @__PURE__ */ st(["submit"], ["update:modelValue"]),
|
|
434
|
+
setup(i, { expose: r, emit: a }) {
|
|
435
|
+
const c = typeof window.ShadowRoot.prototype.getSelection == "function", y = typeof window.Selection.prototype.getComposedRanges == "function";
|
|
436
|
+
function w() {
|
|
460
437
|
const e = navigator.userAgent;
|
|
461
438
|
return e.includes("Safari") && !e.includes("Chrome") && !e.includes("Chromium") && !e.includes("CriOS");
|
|
462
439
|
}
|
|
463
|
-
const
|
|
464
|
-
id: `id-${
|
|
465
|
-
...t.type === "template" ? { ...t, prefix:
|
|
466
|
-
})),
|
|
440
|
+
const n = w(), p = () => Math.random().toString(36).substring(2, 15), C = ot(i, "modelValue"), h = a, _ = E(0), g = (e) => e.map((t, o) => ({
|
|
441
|
+
id: `id-${o}`,
|
|
442
|
+
...t.type === "template" ? { ...t, prefix: Le, suffix: Be } : t
|
|
443
|
+
})), I = (e) => e.map((t) => ({ type: t.type, content: t.content })), d = E(g(C.value || [])), L = D(() => d.value.map((e) => e.type === "template" ? [
|
|
467
444
|
{ id: e.id, type: "prefix", content: e.prefix },
|
|
468
445
|
{ id: e.id, type: "template", content: e.content },
|
|
469
446
|
{ id: e.id, type: "suffix", content: e.suffix }
|
|
470
|
-
] : [e]).flat()),
|
|
447
|
+
] : [e]).flat()), U = D(() => d.value.map((e) => e.type === "text" ? e : n ? {
|
|
471
448
|
id: e.id,
|
|
472
449
|
type: "block",
|
|
473
450
|
asChild: !0,
|
|
@@ -497,83 +474,83 @@ const Pt = { class: "editor-container" }, De = "", Pe = "", Ft = /* @__PUR
|
|
|
497
474
|
},
|
|
498
475
|
{ id: e.id, type: "suffix", content: e.suffix }
|
|
499
476
|
]
|
|
500
|
-
})), $ =
|
|
501
|
-
const t = Date.now(),
|
|
502
|
-
return `${t}:${
|
|
503
|
-
},
|
|
504
|
-
const t = parseInt(e.slice(0, 13)),
|
|
477
|
+
})), $ = E(null), z = (e) => {
|
|
478
|
+
const t = Date.now(), o = JSON.stringify(e);
|
|
479
|
+
return `${t}:${o}`;
|
|
480
|
+
}, te = (e) => {
|
|
481
|
+
const t = parseInt(e.slice(0, 13)), o = JSON.parse(e.slice(14));
|
|
505
482
|
return {
|
|
506
483
|
timestamp: t,
|
|
507
|
-
data:
|
|
484
|
+
data: o
|
|
508
485
|
};
|
|
509
|
-
},
|
|
486
|
+
}, v = /* @__PURE__ */ new Map(), F = Lt(z(d.value), {
|
|
510
487
|
onRemoveHistory: (e) => {
|
|
511
488
|
for (const t of e)
|
|
512
|
-
|
|
489
|
+
v.delete(t);
|
|
513
490
|
}
|
|
514
491
|
});
|
|
515
|
-
|
|
516
|
-
() =>
|
|
492
|
+
Z(
|
|
493
|
+
() => C.value,
|
|
517
494
|
(e) => {
|
|
518
|
-
|
|
495
|
+
d.value = g(e || []), F.commit(z(d.value));
|
|
519
496
|
},
|
|
520
497
|
{ deep: !0 }
|
|
521
498
|
);
|
|
522
|
-
const V = (e, t = document.body) => t.contains(e) ? e instanceof HTMLElement && e.dataset.id ? e : e.parentElement ? V(e.parentElement, t) : null : null,
|
|
499
|
+
const V = (e, t = document.body) => t.contains(e) ? e instanceof HTMLElement && e.dataset.id ? e : e.parentElement ? V(e.parentElement, t) : null : null, W = (e) => e === $.value, G = (e) => {
|
|
523
500
|
const t = window.getSelection();
|
|
524
501
|
if (!t)
|
|
525
502
|
return null;
|
|
526
|
-
const
|
|
527
|
-
if (!(
|
|
528
|
-
return
|
|
529
|
-
if (
|
|
530
|
-
const
|
|
531
|
-
return (
|
|
503
|
+
const o = t.rangeCount > 0 ? t.getRangeAt(0) : null, u = e.getRootNode();
|
|
504
|
+
if (!(u instanceof ShadowRoot))
|
|
505
|
+
return o;
|
|
506
|
+
if (y) {
|
|
507
|
+
const l = t.getComposedRanges(n ? u : { shadowRoots: [u] });
|
|
508
|
+
return (l == null ? void 0 : l[0]) ?? null;
|
|
532
509
|
}
|
|
533
|
-
if (
|
|
534
|
-
const
|
|
535
|
-
return
|
|
510
|
+
if (c) {
|
|
511
|
+
const l = u.getSelection();
|
|
512
|
+
return l.rangeCount > 0 ? l.getRangeAt(0) : null;
|
|
536
513
|
}
|
|
537
|
-
return
|
|
538
|
-
},
|
|
539
|
-
var
|
|
514
|
+
return o;
|
|
515
|
+
}, de = (e, t) => {
|
|
516
|
+
var u;
|
|
540
517
|
if (!e.firstChild || e.firstChild.nodeType !== Node.TEXT_NODE)
|
|
541
518
|
return console.warn("el.firstChild is not a text node. set anchor and focus to the element with offset 0", e), { node: e, offset: 0 };
|
|
542
|
-
const
|
|
543
|
-
return t >
|
|
544
|
-
},
|
|
545
|
-
const
|
|
546
|
-
if (!
|
|
519
|
+
const o = ((u = e.firstChild.textContent) == null ? void 0 : u.length) ?? 0;
|
|
520
|
+
return t > o && console.warn("offset is too large", { offset: t, el: e }), { node: e.firstChild, offset: Math.min(t, o) };
|
|
521
|
+
}, Q = (e, t, o, u) => {
|
|
522
|
+
const l = window.getSelection();
|
|
523
|
+
if (!l)
|
|
547
524
|
return;
|
|
548
|
-
const { node: f, offset:
|
|
549
|
-
if (!
|
|
550
|
-
|
|
525
|
+
const { node: f, offset: b } = de(e, t);
|
|
526
|
+
if (!o) {
|
|
527
|
+
l.setBaseAndExtent(f, b, f, b);
|
|
551
528
|
return;
|
|
552
529
|
}
|
|
553
|
-
const { node:
|
|
554
|
-
|
|
555
|
-
},
|
|
556
|
-
const
|
|
530
|
+
const { node: S, offset: O } = de(o, u ?? 0);
|
|
531
|
+
l.setBaseAndExtent(f, b, S, O);
|
|
532
|
+
}, J = (e, t) => {
|
|
533
|
+
const o = p(), u = { id: o, type: "text", content: e };
|
|
557
534
|
if (t) {
|
|
558
|
-
const
|
|
559
|
-
|
|
535
|
+
const l = d.value.findIndex((f) => f.id === t);
|
|
536
|
+
l !== -1 ? d.value = d.value.slice(0, l + 1).concat(u).concat(d.value.slice(l + 1)) : console.warn(`can not find item with id: ${t}`);
|
|
560
537
|
} else
|
|
561
|
-
|
|
562
|
-
|
|
538
|
+
d.value.unshift(u);
|
|
539
|
+
q(() => {
|
|
563
540
|
var f;
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
}),
|
|
567
|
-
}, x =
|
|
541
|
+
const l = (f = $.value) == null ? void 0 : f.querySelector(`[data-id="${o}"][data-type="text"]`);
|
|
542
|
+
l && Q(l, e.length);
|
|
543
|
+
}), C.value = I(d.value);
|
|
544
|
+
}, x = E({
|
|
568
545
|
hasStarted: !1,
|
|
569
546
|
range: null
|
|
570
|
-
}),
|
|
571
|
-
var
|
|
547
|
+
}), N = (e) => {
|
|
548
|
+
var S;
|
|
572
549
|
const t = e;
|
|
573
550
|
e.preventDefault();
|
|
574
|
-
const { inputType:
|
|
575
|
-
if (!
|
|
576
|
-
console.warn("range is null",
|
|
551
|
+
const { inputType: o } = t, u = (t.data || ((S = t.dataTransfer) == null ? void 0 : S.getData("text/plain")) || "").replace(Le, "").replace(Be, ""), l = t.getTargetRanges()[0];
|
|
552
|
+
if (!l) {
|
|
553
|
+
console.warn("range is null", l);
|
|
577
554
|
return;
|
|
578
555
|
}
|
|
579
556
|
const f = [
|
|
@@ -587,269 +564,317 @@ const Pt = { class: "editor-container" }, De = "", Pe = "", Ft = /* @__PUR
|
|
|
587
564
|
"deleteSoftLineBackward",
|
|
588
565
|
"deleteSoftLineForward",
|
|
589
566
|
"deleteByCut"
|
|
590
|
-
],
|
|
591
|
-
if (f.includes(
|
|
592
|
-
if (
|
|
593
|
-
|
|
567
|
+
], b = G($.value);
|
|
568
|
+
if (f.includes(o)) {
|
|
569
|
+
if (u && W(l.startContainer) && W(l.endContainer)) {
|
|
570
|
+
J(u), b && v.set(F.get(), M(b));
|
|
594
571
|
return;
|
|
595
572
|
}
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
} else
|
|
599
|
-
},
|
|
600
|
-
const t = V(e.startContainer, $.value),
|
|
573
|
+
const O = M(l);
|
|
574
|
+
O.startId && O.endId ? (P(O, o, u), b && v.set(F.get(), M(b))) : console.warn("range is not valid, range:", O);
|
|
575
|
+
} else o === "insertCompositionText" && x.value.hasStarted && (x.value = { hasStarted: !1, range: M(l) });
|
|
576
|
+
}, M = (e) => {
|
|
577
|
+
const t = V(e.startContainer, $.value), o = V(e.endContainer, $.value);
|
|
601
578
|
return {
|
|
602
579
|
collapsed: e.collapsed,
|
|
603
580
|
endContainer: e.endContainer,
|
|
604
|
-
endId:
|
|
581
|
+
endId: o == null ? void 0 : o.dataset.id,
|
|
605
582
|
endOffset: e.endOffset,
|
|
606
|
-
endType:
|
|
583
|
+
endType: o == null ? void 0 : o.dataset.type,
|
|
607
584
|
startContainer: e.startContainer,
|
|
608
585
|
startId: t == null ? void 0 : t.dataset.id,
|
|
609
586
|
startOffset: e.startOffset,
|
|
610
587
|
startType: t == null ? void 0 : t.dataset.type
|
|
611
588
|
};
|
|
612
|
-
},
|
|
613
|
-
const
|
|
614
|
-
if (!Array.isArray(
|
|
589
|
+
}, ne = (e, t, o, u) => e.slice(0, o) + t + e.slice(u), P = (e, t, o) => {
|
|
590
|
+
const u = Ce(e);
|
|
591
|
+
if (!Array.isArray(u) || u.length === 0)
|
|
615
592
|
return;
|
|
616
|
-
const
|
|
617
|
-
if (
|
|
618
|
-
const { afterId:
|
|
619
|
-
|
|
593
|
+
const l = ke(u, e, t, o);
|
|
594
|
+
if (l.some((S) => S.tag === "new")) {
|
|
595
|
+
const { afterId: S, content: O } = l[0];
|
|
596
|
+
J(O, S);
|
|
620
597
|
return;
|
|
621
598
|
}
|
|
622
|
-
const f =
|
|
623
|
-
for (const [
|
|
624
|
-
const
|
|
625
|
-
|
|
599
|
+
const f = l, b = [];
|
|
600
|
+
for (const [S, O] of f.entries()) {
|
|
601
|
+
const H = d.value.find((Te) => Te.id === O.id), Y = S === 0 ? o : "";
|
|
602
|
+
H ? H.type === "text" ? H.content = ne(H.content, Y, O.startOffset, O.endOffset) : H.type === "template" ? O.type === "prefix" || O.type === "suffix" ? O.startOffset === 0 && O.endOffset === 1 && Y.length === 0 ? H[O.type] = "" : console.warn(`${O.type} can not be inserted text. it only can be deleted`, O) : O.startOffset < 0 || O.endOffset > H.content.length ? b.push(H.id) : H.content = ne(H.content, Y, O.startOffset, O.endOffset) : console.warn("dataItem.type is not text or template", H) : console.warn("can not find dataItem", O);
|
|
626
603
|
}
|
|
627
|
-
|
|
628
|
-
for (const
|
|
629
|
-
|
|
630
|
-
f.length > 0 &&
|
|
631
|
-
},
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
var
|
|
635
|
-
const f = (
|
|
604
|
+
d.value = d.value.filter((S) => !b.includes(S.id)), d.value = d.value.filter((S) => S.type === "text" ? S.content.length > 0 : [S.prefix, S.suffix, S.content].join("").length > 0);
|
|
605
|
+
for (const S of d.value.filter((O) => O.type === "template"))
|
|
606
|
+
S.prefix.length === 0 && (S.prefix = Le), S.suffix.length === 0 && (S.suffix = Be);
|
|
607
|
+
f.length > 0 && se(f, o), C.value = I(d.value);
|
|
608
|
+
}, se = (e, t) => {
|
|
609
|
+
const o = e[0], u = `[data-id="${o.id}"][data-type="${o.type}"]`, l = e.slice(1).map((f) => `[data-id="${f.id}"][data-type="${f.type}"]`);
|
|
610
|
+
q(() => {
|
|
611
|
+
var b, S;
|
|
612
|
+
const f = (b = $.value) == null ? void 0 : b.querySelector(u);
|
|
636
613
|
if (f)
|
|
637
|
-
|
|
614
|
+
Q(f, o.startOffset + t.length);
|
|
638
615
|
else if (t.length === 0)
|
|
639
|
-
for (const
|
|
640
|
-
const
|
|
641
|
-
if (
|
|
642
|
-
|
|
616
|
+
for (const O of l) {
|
|
617
|
+
const H = (S = $.value) == null ? void 0 : S.querySelector(O);
|
|
618
|
+
if (H) {
|
|
619
|
+
Q(H, 0);
|
|
643
620
|
break;
|
|
644
621
|
}
|
|
645
622
|
}
|
|
646
623
|
else
|
|
647
|
-
console.warn(`can not find el with selector: ${
|
|
624
|
+
console.warn(`can not find el with selector: ${u}`);
|
|
648
625
|
});
|
|
649
|
-
},
|
|
650
|
-
const t =
|
|
651
|
-
if (t === -1 ||
|
|
626
|
+
}, Ce = (e) => {
|
|
627
|
+
const t = L.value.findIndex((b) => b.id === e.startId && b.type === e.startType), o = L.value.findIndex((b) => b.id === e.endId && b.type === e.endType);
|
|
628
|
+
if (t === -1 || o === -1 || t > o)
|
|
652
629
|
return console.warn("startIndex or endIndex is -1, or startIndex > endIndex. ", { range: e }), null;
|
|
653
|
-
const
|
|
654
|
-
if (t ===
|
|
630
|
+
const u = L.value[t], l = L.value[o];
|
|
631
|
+
if (t === o)
|
|
655
632
|
return [
|
|
656
633
|
{
|
|
657
|
-
id:
|
|
658
|
-
type:
|
|
634
|
+
id: u.id,
|
|
635
|
+
type: u.type,
|
|
659
636
|
startOffset: e.startOffset,
|
|
660
637
|
endOffset: e.endOffset
|
|
661
638
|
}
|
|
662
639
|
];
|
|
663
640
|
const f = [
|
|
664
641
|
{
|
|
665
|
-
id:
|
|
666
|
-
type:
|
|
642
|
+
id: u.id,
|
|
643
|
+
type: u.type,
|
|
667
644
|
startOffset: e.startOffset,
|
|
668
|
-
endOffset:
|
|
645
|
+
endOffset: u.content.length
|
|
669
646
|
}
|
|
670
647
|
];
|
|
671
|
-
for (let
|
|
672
|
-
const
|
|
648
|
+
for (let b = t + 1; b < o; b++) {
|
|
649
|
+
const S = L.value[b];
|
|
673
650
|
f.push({
|
|
674
|
-
id:
|
|
675
|
-
type:
|
|
651
|
+
id: S.id,
|
|
652
|
+
type: S.type,
|
|
676
653
|
startOffset: 0,
|
|
677
|
-
endOffset:
|
|
654
|
+
endOffset: S.content.length
|
|
678
655
|
});
|
|
679
656
|
}
|
|
680
657
|
return f.push({
|
|
681
|
-
id:
|
|
682
|
-
type:
|
|
658
|
+
id: l.id,
|
|
659
|
+
type: l.type,
|
|
683
660
|
startOffset: 0,
|
|
684
661
|
endOffset: e.endOffset
|
|
685
662
|
}), f;
|
|
686
|
-
},
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
663
|
+
}, ke = (e, t, o, u) => {
|
|
664
|
+
const l = e[0];
|
|
665
|
+
if (l.type !== "prefix" && l.type !== "suffix")
|
|
689
666
|
return e;
|
|
690
667
|
if (e.length === 1) {
|
|
691
668
|
if (t.collapsed)
|
|
692
669
|
if (t.startOffset === 0) {
|
|
693
|
-
const f =
|
|
670
|
+
const f = ie(l, u);
|
|
694
671
|
return f ? [f] : [];
|
|
695
672
|
} else {
|
|
696
|
-
const f =
|
|
673
|
+
const f = re(l, u);
|
|
697
674
|
return f ? [f] : [];
|
|
698
675
|
}
|
|
699
|
-
if (
|
|
700
|
-
if (
|
|
701
|
-
const f =
|
|
676
|
+
if (o.startsWith("insert"))
|
|
677
|
+
if (n) {
|
|
678
|
+
const f = ie(l, u);
|
|
702
679
|
return f ? [f] : [];
|
|
703
680
|
} else {
|
|
704
|
-
const f =
|
|
681
|
+
const f = re(l, u);
|
|
705
682
|
return f ? [f] : [];
|
|
706
683
|
}
|
|
707
|
-
if (
|
|
708
|
-
if (
|
|
709
|
-
const f =
|
|
684
|
+
if (o.startsWith("delete")) {
|
|
685
|
+
if (o.includes("Backward")) {
|
|
686
|
+
const f = ie(l, u, 1);
|
|
710
687
|
return f ? [f] : [];
|
|
711
|
-
} else if (
|
|
712
|
-
const f =
|
|
688
|
+
} else if (o.includes("Forward")) {
|
|
689
|
+
const f = re(l, u, 1);
|
|
713
690
|
return f ? [f] : [];
|
|
714
691
|
}
|
|
715
692
|
}
|
|
716
693
|
}
|
|
717
|
-
return
|
|
718
|
-
},
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
721
|
-
const
|
|
722
|
-
if (
|
|
694
|
+
return u.length > 0 ? e.slice(1) : e;
|
|
695
|
+
}, ie = (e, t, o = 0) => {
|
|
696
|
+
const u = L.value.findIndex((l) => l.id === e.id && l.type === e.type);
|
|
697
|
+
if (u > 0) {
|
|
698
|
+
const l = L.value[u - 1], { id: f, type: b, content: S } = l;
|
|
699
|
+
if (b === "text" || b === "template")
|
|
723
700
|
return {
|
|
724
701
|
id: f,
|
|
725
|
-
type:
|
|
726
|
-
startOffset:
|
|
727
|
-
endOffset:
|
|
702
|
+
type: b,
|
|
703
|
+
startOffset: S.length - o,
|
|
704
|
+
endOffset: S.length
|
|
728
705
|
};
|
|
729
706
|
if (t.length > 0)
|
|
730
707
|
return { tag: "new", afterId: f, type: "text", content: t };
|
|
731
|
-
if (console.warn("the previous item is not text or template", { current: e, previous:
|
|
708
|
+
if (console.warn("the previous item is not text or template", { current: e, previous: l }), o === 1)
|
|
732
709
|
return { ...e, endOffset: e.startOffset };
|
|
733
710
|
} else return t.length > 0 ? { tag: "new", type: "text", content: t } : (console.warn("the previous item of current is not found", { current: e }), null);
|
|
734
711
|
return e;
|
|
735
|
-
},
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
const
|
|
739
|
-
if (
|
|
712
|
+
}, re = (e, t, o = 0) => {
|
|
713
|
+
const u = L.value.findIndex((l) => l.id === e.id && l.type === e.type);
|
|
714
|
+
if (u < L.value.length - 1) {
|
|
715
|
+
const l = L.value[u + 1], { id: f, type: b } = l;
|
|
716
|
+
if (b === "text" || b === "template")
|
|
740
717
|
return {
|
|
741
718
|
id: f,
|
|
742
|
-
type:
|
|
719
|
+
type: b,
|
|
743
720
|
startOffset: 0,
|
|
744
|
-
endOffset: 0 +
|
|
721
|
+
endOffset: 0 + o
|
|
745
722
|
};
|
|
746
723
|
if (t.length > 0)
|
|
747
724
|
return { tag: "new", afterId: e.id, type: "text", content: t };
|
|
748
|
-
if (console.warn("the next item is not text or template", { current: e, next:
|
|
725
|
+
if (console.warn("the next item is not text or template", { current: e, next: l }), o === 1)
|
|
749
726
|
return { ...e, startOffset: e.endOffset };
|
|
750
727
|
} else return t.length > 0 ? { tag: "new", afterId: e.id, type: "text", content: t } : (console.warn("the next item of current is not found", { current: e }), null);
|
|
751
728
|
return e;
|
|
752
|
-
},
|
|
729
|
+
}, xe = () => {
|
|
753
730
|
x.value = { hasStarted: !0, range: null };
|
|
754
|
-
},
|
|
731
|
+
}, ve = (e) => {
|
|
755
732
|
const t = x.value.range;
|
|
756
|
-
t ? (e.data &&
|
|
757
|
-
},
|
|
733
|
+
t ? (e.data && W(t.startContainer) && W(t.endContainer) ? (J(e.data), v.set(F.get(), M(t))) : t.startId && t.endId ? (P(t, "insertCompositionText", e.data), v.set(F.get(), M(t))) : console.warn("range is not valid, range:", t), _.value++) : console.warn("range is null, compositionEnd:", e), x.value = { hasStarted: !1, range: null };
|
|
734
|
+
}, ue = (() => {
|
|
758
735
|
const e = navigator.userAgent.toLowerCase();
|
|
759
736
|
return /macintosh|mac os x|iphone|ipad|ipod/.test(e);
|
|
760
|
-
})(),
|
|
761
|
-
const t =
|
|
762
|
-
!
|
|
763
|
-
!
|
|
737
|
+
})(), Ie = (e) => {
|
|
738
|
+
const t = ue && e.metaKey && !e.shiftKey && e.key.toLowerCase() === "z" || // Cmd+Z
|
|
739
|
+
!ue && e.ctrlKey && !e.shiftKey && e.key.toLowerCase() === "z", o = ue && e.metaKey && e.shiftKey && e.key.toLowerCase() === "z" || // Cmd+Shift+z
|
|
740
|
+
!ue && e.ctrlKey && (e.key.toLowerCase() === "y" || e.shiftKey && e.key.toLowerCase() === "z"), u = e.key.toLowerCase() === "enter";
|
|
764
741
|
if (t) {
|
|
765
742
|
e.preventDefault();
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
const f =
|
|
769
|
-
f &&
|
|
743
|
+
const l = G($.value);
|
|
744
|
+
l && v.set(F.get(), M(l));
|
|
745
|
+
const f = F.undo();
|
|
746
|
+
f && oe(f);
|
|
770
747
|
}
|
|
771
|
-
if (
|
|
748
|
+
if (o) {
|
|
772
749
|
e.preventDefault();
|
|
773
|
-
const
|
|
774
|
-
|
|
750
|
+
const l = F.redo();
|
|
751
|
+
l && oe(l);
|
|
775
752
|
}
|
|
776
|
-
|
|
777
|
-
},
|
|
778
|
-
const { data: t } =
|
|
779
|
-
if (
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
const
|
|
783
|
-
|
|
753
|
+
u && (e.preventDefault(), h("submit"));
|
|
754
|
+
}, oe = (e) => {
|
|
755
|
+
const { data: t } = te(e);
|
|
756
|
+
if (d.value = t, v.has(e)) {
|
|
757
|
+
const o = v.get(e);
|
|
758
|
+
q(() => {
|
|
759
|
+
const u = $.value.querySelector(`[data-id="${o.startId}"][data-type="${o.startType}"]`), l = $.value.querySelector(`[data-id="${o.endId}"][data-type="${o.endType}"]`);
|
|
760
|
+
u && Q(u, o.startOffset, l, o.endOffset);
|
|
784
761
|
});
|
|
785
762
|
}
|
|
786
763
|
};
|
|
787
|
-
return
|
|
764
|
+
return r({
|
|
788
765
|
clearHistory: () => {
|
|
789
|
-
|
|
766
|
+
F.clear(), v.clear();
|
|
790
767
|
},
|
|
791
768
|
activateFirstField: () => {
|
|
792
769
|
if (!$.value)
|
|
793
770
|
return;
|
|
794
|
-
const e =
|
|
795
|
-
e &&
|
|
796
|
-
var
|
|
797
|
-
const t = (
|
|
771
|
+
const e = d.value.find((t) => t.type === "template");
|
|
772
|
+
e && q(() => {
|
|
773
|
+
var o, u;
|
|
774
|
+
const t = (o = $.value) == null ? void 0 : o.querySelector(`[data-id="${e.id}"][data-type="template"]`);
|
|
798
775
|
if (t) {
|
|
799
|
-
const
|
|
800
|
-
|
|
776
|
+
const l = ((u = t.textContent) == null ? void 0 : u.length) || 0;
|
|
777
|
+
Q(t, l);
|
|
801
778
|
}
|
|
802
779
|
});
|
|
803
780
|
}
|
|
804
|
-
}), (e, t) => (
|
|
805
|
-
(
|
|
781
|
+
}), (e, t) => (m(), R("div", Bt, [
|
|
782
|
+
(m(), R("div", {
|
|
806
783
|
contenteditable: "true",
|
|
807
784
|
ref_key: "editorRef",
|
|
808
785
|
ref: $,
|
|
809
|
-
key:
|
|
786
|
+
key: _.value,
|
|
810
787
|
class: "editor",
|
|
811
|
-
onBeforeinput:
|
|
812
|
-
onCompositionstart:
|
|
813
|
-
onCompositionend:
|
|
814
|
-
onKeydown:
|
|
788
|
+
onBeforeinput: N,
|
|
789
|
+
onCompositionstart: xe,
|
|
790
|
+
onCompositionend: ve,
|
|
791
|
+
onKeydown: Ie
|
|
815
792
|
}, [
|
|
816
|
-
(
|
|
817
|
-
key: `${
|
|
818
|
-
}, { ref_for: !0 },
|
|
793
|
+
(m(!0), R(ce, null, he(U.value, (o) => (m(), X($t, fe({
|
|
794
|
+
key: `${o.id}-${o.type}`
|
|
795
|
+
}, { ref_for: !0 }, o), null, 16))), 128))
|
|
819
796
|
], 32))
|
|
820
797
|
]));
|
|
821
798
|
}
|
|
822
|
-
}),
|
|
799
|
+
}), Dt = /* @__PURE__ */ be(Et, [["__scopeId", "data-v-b0269a2a"]]), Ft = ["onMouseenter", "onMousedown"], Pt = { class: "suggestion-list__text" }, Ht = /* @__PURE__ */ ge({
|
|
800
|
+
__name: "SuggestionList",
|
|
801
|
+
props: {
|
|
802
|
+
show: { type: Boolean },
|
|
803
|
+
suggestions: {},
|
|
804
|
+
popupStyle: {},
|
|
805
|
+
isItemHighlighted: { type: Function },
|
|
806
|
+
highlightSuggestionText: { type: Function },
|
|
807
|
+
inputValue: {}
|
|
808
|
+
},
|
|
809
|
+
emits: ["item-hover", "item-leave", "select"],
|
|
810
|
+
setup(i, { emit: r }) {
|
|
811
|
+
const a = i, c = r, y = E(null), w = (C) => {
|
|
812
|
+
c("item-hover", C);
|
|
813
|
+
}, n = () => {
|
|
814
|
+
c("item-leave");
|
|
815
|
+
}, p = (C) => {
|
|
816
|
+
c("select", C);
|
|
817
|
+
};
|
|
818
|
+
return (C, h) => (m(), X(Ee, { name: "tiny-sender-slide-up" }, {
|
|
819
|
+
default: pe(() => [
|
|
820
|
+
a.show && a.suggestions.length ? (m(), R("div", {
|
|
821
|
+
key: 0,
|
|
822
|
+
ref_key: "suggestionsListRef",
|
|
823
|
+
ref: y,
|
|
824
|
+
class: "suggestion-list",
|
|
825
|
+
style: De(a.popupStyle)
|
|
826
|
+
}, [
|
|
827
|
+
(m(!0), R(ce, null, he(a.suggestions, (_, g) => (m(), R("div", {
|
|
828
|
+
key: g,
|
|
829
|
+
class: ee(["suggestion-list__item", { highlighted: a.isItemHighlighted(g) }]),
|
|
830
|
+
onMouseenter: (I) => w(g),
|
|
831
|
+
onMouseleave: n,
|
|
832
|
+
onMousedown: at((I) => p(_), ["prevent"])
|
|
833
|
+
}, [
|
|
834
|
+
j(k(gt), { class: "suggestion-list__icon" }),
|
|
835
|
+
A("span", Pt, [
|
|
836
|
+
(m(!0), R(ce, null, he(a.highlightSuggestionText(_, a.inputValue), (I, d) => (m(), R("span", {
|
|
837
|
+
key: d,
|
|
838
|
+
class: ee({
|
|
839
|
+
"suggestion-list__text--match": I.isMatch,
|
|
840
|
+
"suggestion-list__text--normal": !I.isMatch
|
|
841
|
+
})
|
|
842
|
+
}, le(I.text), 3))), 128))
|
|
843
|
+
])
|
|
844
|
+
], 42, Ft))), 128))
|
|
845
|
+
], 4)) : K("", !0)
|
|
846
|
+
]),
|
|
847
|
+
_: 1
|
|
848
|
+
}));
|
|
849
|
+
}
|
|
850
|
+
}), Kt = /* @__PURE__ */ be(Ht, [["__scopeId", "data-v-f801eb8b"]]), Wt = ["data-theme"], At = { class: "tiny-sender__container" }, Vt = {
|
|
823
851
|
key: 0,
|
|
824
852
|
class: "tiny-sender__header-slot"
|
|
825
853
|
}, Nt = {
|
|
826
854
|
key: 0,
|
|
827
855
|
class: "tiny-sender__prefix-slot"
|
|
828
|
-
},
|
|
856
|
+
}, Mt = { class: "tiny-sender__content-area" }, qt = {
|
|
829
857
|
key: 0,
|
|
830
858
|
class: "tiny-sender__decorative-content"
|
|
831
|
-
},
|
|
859
|
+
}, Ut = {
|
|
832
860
|
key: 2,
|
|
833
861
|
class: "tiny-sender__input-field-wrapper"
|
|
834
|
-
},
|
|
862
|
+
}, zt = {
|
|
835
863
|
key: 0,
|
|
836
864
|
class: "tiny-sender__completion-placeholder"
|
|
837
|
-
},
|
|
865
|
+
}, jt = { class: "user-input-mirror" }, Xt = {
|
|
838
866
|
key: 0,
|
|
839
867
|
class: "tiny-sender__tab-hint"
|
|
840
|
-
},
|
|
868
|
+
}, Jt = {
|
|
841
869
|
key: 1,
|
|
842
870
|
class: "tiny-sender__actions-slot"
|
|
843
|
-
},
|
|
871
|
+
}, Gt = { class: "tiny-sender__footer-left" }, Qt = { class: "tiny-sender__footer-right" }, Yt = { class: "real-word-length" }, Zt = {
|
|
844
872
|
key: 1,
|
|
845
873
|
class: "tiny-sender__toolbar"
|
|
846
|
-
},
|
|
874
|
+
}, en = { class: "tiny-sender__buttons-container" }, tn = {
|
|
847
875
|
key: 1,
|
|
848
876
|
class: "tiny-sender__footer-slot"
|
|
849
|
-
},
|
|
850
|
-
key: 0,
|
|
851
|
-
class: "tiny-sender__error"
|
|
852
|
-
}, Ce = /* @__PURE__ */ ke({
|
|
877
|
+
}, _e = /* @__PURE__ */ ge({
|
|
853
878
|
__name: "index",
|
|
854
879
|
props: {
|
|
855
880
|
autofocus: { type: Boolean, default: !1 },
|
|
@@ -874,363 +899,343 @@ const Pt = { class: "editor-container" }, De = "", Pe = "", Ft = /* @__PUR
|
|
|
874
899
|
stopText: { default: "" }
|
|
875
900
|
},
|
|
876
901
|
emits: ["update:modelValue", "update:templateData", "submit", "clear", "speech-start", "speech-end", "speech-interim", "speech-error", "suggestion-select", "focus", "blur", "escape-press", "cancel", "reset-template"],
|
|
877
|
-
setup(
|
|
878
|
-
const
|
|
902
|
+
setup(i, { expose: r, emit: a }) {
|
|
903
|
+
const c = i, y = a, w = E(null), n = E(null), p = E(null), C = E(null), h = E(null), _ = D(() => c.templateData && c.templateData.length > 0), { inputValue: g, isComposing: I, clearInput: d } = yt(c, y), L = D(() => !!g.value.trim()), U = D(() => !(c.disabled || c.loading || !L.value || t.value)), {
|
|
879
904
|
showSuggestionsPopup: $,
|
|
880
|
-
completionPlaceholder:
|
|
881
|
-
showTabHint:
|
|
882
|
-
suggestionsListRef:
|
|
883
|
-
filteredSuggestions:
|
|
905
|
+
completionPlaceholder: z,
|
|
906
|
+
showTabHint: te,
|
|
907
|
+
suggestionsListRef: v,
|
|
908
|
+
filteredSuggestions: F,
|
|
884
909
|
activeSuggestion: V,
|
|
885
|
-
isItemHighlighted:
|
|
886
|
-
updateSuggestionsState:
|
|
887
|
-
selectSuggestion:
|
|
888
|
-
acceptCurrentSuggestion:
|
|
889
|
-
closeSuggestionsPopup:
|
|
910
|
+
isItemHighlighted: W,
|
|
911
|
+
updateSuggestionsState: G,
|
|
912
|
+
selectSuggestion: de,
|
|
913
|
+
acceptCurrentSuggestion: Q,
|
|
914
|
+
closeSuggestionsPopup: J,
|
|
890
915
|
navigateSuggestions: x,
|
|
891
|
-
handleSuggestionItemHover:
|
|
892
|
-
handleSuggestionItemLeave:
|
|
893
|
-
highlightSuggestionText:
|
|
894
|
-
} =
|
|
895
|
-
|
|
916
|
+
handleSuggestionItemHover: N,
|
|
917
|
+
handleSuggestionItemLeave: M,
|
|
918
|
+
highlightSuggestionText: ne
|
|
919
|
+
} = _t(c, y, g, I, _), P = E(c.mode), se = E(!1), Ce = () => {
|
|
920
|
+
P.value === "single" && (P.value = "multiple", q(() => {
|
|
896
921
|
setTimeout(() => {
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
|
|
922
|
+
const s = document.querySelector(".tiny-textarea__inner");
|
|
923
|
+
if (s) {
|
|
924
|
+
s.style.whiteSpace = "pre-wrap";
|
|
925
|
+
const T = g.value.length;
|
|
926
|
+
s.focus(), s.setSelectionRange(T, T);
|
|
902
927
|
}
|
|
903
928
|
}, 50);
|
|
904
929
|
}));
|
|
905
|
-
},
|
|
930
|
+
}, ke = (s, T) => {
|
|
906
931
|
const B = document.createElement("span");
|
|
907
|
-
B.style.visibility = "hidden", B.style.position = "absolute", B.style.whiteSpace = "nowrap", B.style.font =
|
|
908
|
-
const
|
|
909
|
-
return document.body.removeChild(B),
|
|
910
|
-
},
|
|
911
|
-
var
|
|
912
|
-
if (
|
|
913
|
-
const
|
|
914
|
-
if (!
|
|
915
|
-
const
|
|
916
|
-
if (!
|
|
932
|
+
B.style.visibility = "hidden", B.style.position = "absolute", B.style.whiteSpace = "nowrap", B.style.font = T, B.textContent = s, document.body.appendChild(B);
|
|
933
|
+
const me = B.offsetWidth;
|
|
934
|
+
return document.body.removeChild(B), me;
|
|
935
|
+
}, ie = () => {
|
|
936
|
+
var we, Ke, We;
|
|
937
|
+
if (c.mode !== "single" || !w.value || se.value || !n.value || !C.value) return;
|
|
938
|
+
const s = n.value.querySelector(".tiny-sender__content-area");
|
|
939
|
+
if (!s) return;
|
|
940
|
+
const T = ((Ke = (we = w.value) == null ? void 0 : we.querySelector) == null ? void 0 : Ke.call(we, ".tiny-input__inner")) || s.querySelector(".tiny-input__inner"), B = h.value || n.value.querySelector(".tiny-sender__buttons-container");
|
|
941
|
+
if (!T) {
|
|
917
942
|
console.warn("Cannot find input element for overflow check");
|
|
918
943
|
return;
|
|
919
944
|
}
|
|
920
|
-
const
|
|
921
|
-
if (
|
|
922
|
-
setTimeout(() =>
|
|
945
|
+
const me = T.getBoundingClientRect(), $e = B == null ? void 0 : B.getBoundingClientRect();
|
|
946
|
+
if (me.width === 0) {
|
|
947
|
+
setTimeout(() => ie(), 50);
|
|
923
948
|
return;
|
|
924
949
|
}
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
var
|
|
929
|
-
const Se = (
|
|
950
|
+
const Xe = window.getComputedStyle(T).font, Je = ke(g.value, Xe), Pe = (We = n.value) == null ? void 0 : We.classList.contains("tr-sender-compact"), Ge = Pe ? 12 : 20, Qe = me.width, Ye = ($e == null ? void 0 : $e.width) || 0, He = Qe - Ye - Ge, Ze = Pe ? 50 : 80;
|
|
951
|
+
Je > He && He > Ze && P.value === "single" && (se.value = !0, P.value = "multiple", q(() => {
|
|
952
|
+
w.value ? setTimeout(() => {
|
|
953
|
+
var Ae;
|
|
954
|
+
const Se = (Ae = n.value) == null ? void 0 : Ae.querySelector(".tiny-textarea__inner");
|
|
930
955
|
if (Se) {
|
|
931
956
|
Se.style.whiteSpace = "pre-wrap";
|
|
932
|
-
const Ve =
|
|
957
|
+
const Ve = g.value.length;
|
|
933
958
|
Se.focus(), Se.setSelectionRange(Ve, Ve);
|
|
934
959
|
}
|
|
935
|
-
|
|
936
|
-
}, 300) :
|
|
960
|
+
se.value = !1;
|
|
961
|
+
}, 300) : se.value = !1;
|
|
937
962
|
}));
|
|
938
|
-
},
|
|
939
|
-
if (
|
|
963
|
+
}, re = () => {
|
|
964
|
+
if (_.value && p.value)
|
|
940
965
|
Fe();
|
|
941
|
-
else if (
|
|
942
|
-
|
|
966
|
+
else if (w.value)
|
|
967
|
+
w.value.focus();
|
|
943
968
|
else {
|
|
944
|
-
const
|
|
945
|
-
|
|
969
|
+
const s = document.querySelector(".tiny-input__inner");
|
|
970
|
+
s == null || s.focus();
|
|
946
971
|
}
|
|
947
|
-
},
|
|
948
|
-
if (
|
|
949
|
-
|
|
972
|
+
}, xe = () => {
|
|
973
|
+
if (w.value)
|
|
974
|
+
w.value.blur();
|
|
950
975
|
else {
|
|
951
|
-
const
|
|
952
|
-
|
|
976
|
+
const s = document.querySelector(".tiny-input__inner");
|
|
977
|
+
s == null || s.blur();
|
|
953
978
|
}
|
|
954
|
-
},
|
|
955
|
-
var
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
979
|
+
}, ve = () => {
|
|
980
|
+
var s;
|
|
981
|
+
y("update:templateData", []), (s = p.value) == null || s.clearHistory(), q(() => {
|
|
982
|
+
g.value === "" && (P.value = c.mode || "single"), setTimeout(() => {
|
|
983
|
+
re();
|
|
959
984
|
}, 50);
|
|
960
|
-
}),
|
|
961
|
-
},
|
|
962
|
-
var
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
}),
|
|
966
|
-
},
|
|
967
|
-
|
|
985
|
+
}), J();
|
|
986
|
+
}, ye = () => {
|
|
987
|
+
var s;
|
|
988
|
+
d(), _.value ? ve() : (s = n.value) == null || s.focus(), q(() => {
|
|
989
|
+
g.value === "" && (P.value = c.mode || "single");
|
|
990
|
+
}), J();
|
|
991
|
+
}, ue = (s) => {
|
|
992
|
+
y("update:templateData", s);
|
|
968
993
|
};
|
|
969
|
-
|
|
970
|
-
() =>
|
|
994
|
+
Z(
|
|
995
|
+
() => c.templateData,
|
|
971
996
|
() => {
|
|
972
|
-
|
|
997
|
+
g.value = c.templateData.map((s) => s.content).join("");
|
|
973
998
|
},
|
|
974
999
|
{ deep: !0 }
|
|
975
1000
|
);
|
|
976
|
-
const
|
|
977
|
-
const
|
|
1001
|
+
const Ie = D(() => {
|
|
1002
|
+
const s = typeof c.speech == "object" ? c.speech : {};
|
|
978
1003
|
return {
|
|
979
|
-
...
|
|
980
|
-
onStart: () =>
|
|
981
|
-
onEnd: (
|
|
982
|
-
onInterim: (
|
|
983
|
-
onFinal: (
|
|
984
|
-
if (
|
|
985
|
-
|
|
1004
|
+
...s,
|
|
1005
|
+
onStart: () => y("speech-start"),
|
|
1006
|
+
onEnd: (T) => y("speech-end", T),
|
|
1007
|
+
onInterim: (T) => y("speech-interim", T),
|
|
1008
|
+
onFinal: (T) => {
|
|
1009
|
+
if (s.autoReplace)
|
|
1010
|
+
g.value = T;
|
|
986
1011
|
else {
|
|
987
|
-
const B =
|
|
988
|
-
B &&
|
|
1012
|
+
const B = g.value;
|
|
1013
|
+
B && T && !B.endsWith(" ") && !T.startsWith(" ") && B.length > 0 ? g.value = B + " " + T : g.value = B + T;
|
|
989
1014
|
}
|
|
990
|
-
|
|
1015
|
+
y("speech-end", T);
|
|
991
1016
|
},
|
|
992
|
-
onError: (
|
|
993
|
-
|
|
1017
|
+
onError: (T) => {
|
|
1018
|
+
y("speech-error", T);
|
|
994
1019
|
}
|
|
995
1020
|
};
|
|
996
|
-
}), { speechState:
|
|
997
|
-
|
|
998
|
-
}, t = D(() =>
|
|
999
|
-
|
|
1000
|
-
v,
|
|
1021
|
+
}), { speechState: oe, start: Re, stop: Oe } = wt(Ie.value), e = () => {
|
|
1022
|
+
oe.isRecording ? Oe() : Re();
|
|
1023
|
+
}, t = D(() => c.maxLength !== 1 / 0 && g.value.length > c.maxLength), { handleKeyPress: o, triggerSubmit: u } = mt(
|
|
1024
|
+
c,
|
|
1001
1025
|
y,
|
|
1002
|
-
|
|
1003
|
-
|
|
1026
|
+
g,
|
|
1027
|
+
I,
|
|
1028
|
+
oe,
|
|
1004
1029
|
$,
|
|
1005
1030
|
V,
|
|
1006
|
-
|
|
1007
|
-
|
|
1031
|
+
Q,
|
|
1032
|
+
J,
|
|
1008
1033
|
x,
|
|
1009
1034
|
e,
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
),
|
|
1016
|
-
|
|
1017
|
-
}, f = (
|
|
1018
|
-
|
|
1019
|
-
},
|
|
1035
|
+
U,
|
|
1036
|
+
P,
|
|
1037
|
+
Ce,
|
|
1038
|
+
_,
|
|
1039
|
+
ve
|
|
1040
|
+
), l = (s) => {
|
|
1041
|
+
y("focus", s), g.value && F.value.length > 0 && !_.value && ($.value = !0, te.value = !0);
|
|
1042
|
+
}, f = (s) => {
|
|
1043
|
+
y("blur", s), J();
|
|
1044
|
+
}, b = D(() => P.value === "multiple" ? "textarea" : "text"), S = D(
|
|
1020
1045
|
() => ({
|
|
1021
1046
|
display: "flex",
|
|
1022
|
-
justifyContent:
|
|
1047
|
+
justifyContent: c.showWordLimit && c.maxLength !== 1 / 0 ? "space-between" : "flex-end",
|
|
1023
1048
|
alignItems: "center"
|
|
1024
1049
|
})
|
|
1025
|
-
),
|
|
1026
|
-
"is-disabled":
|
|
1027
|
-
"is-loading":
|
|
1028
|
-
"
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
width: _t(u.suggestionPopupWidth),
|
|
1050
|
+
), O = lt(), H = D(() => !!O.decorativeContent), Y = D(() => c.disabled || H.value), Te = D(() => c.loading), Ue = D(() => ({
|
|
1051
|
+
"is-disabled": Y.value,
|
|
1052
|
+
"is-loading": Te.value,
|
|
1053
|
+
"is-auto-switching": se.value
|
|
1054
|
+
})), ze = D(() => ({
|
|
1055
|
+
width: vt(c.suggestionPopupWidth),
|
|
1032
1056
|
maxWidth: "100%"
|
|
1033
1057
|
// 确保不超出父容器宽度
|
|
1034
|
-
})),
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
E.value = !1, setTimeout(() => {
|
|
1038
|
-
E.value = !1, Y();
|
|
1058
|
+
})), je = () => {
|
|
1059
|
+
I.value = !1, setTimeout(() => {
|
|
1060
|
+
I.value = !1, G();
|
|
1039
1061
|
}, 50);
|
|
1040
1062
|
};
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
}),
|
|
1044
|
-
() =>
|
|
1045
|
-
(
|
|
1046
|
-
|
|
1063
|
+
Z(g, () => {
|
|
1064
|
+
q(ie), g.value === "" && c.mode === "single" && (P.value = "single");
|
|
1065
|
+
}), Z(
|
|
1066
|
+
() => _.value,
|
|
1067
|
+
(s) => {
|
|
1068
|
+
s && (P.value = "multiple");
|
|
1047
1069
|
}
|
|
1048
1070
|
);
|
|
1049
1071
|
const Fe = () => {
|
|
1050
|
-
|
|
1072
|
+
p.value && p.value.activateFirstField();
|
|
1051
1073
|
};
|
|
1052
|
-
return
|
|
1053
|
-
focus:
|
|
1054
|
-
blur:
|
|
1055
|
-
clear:
|
|
1056
|
-
submit:
|
|
1057
|
-
startSpeech:
|
|
1058
|
-
stopSpeech:
|
|
1074
|
+
return r({
|
|
1075
|
+
focus: re,
|
|
1076
|
+
blur: xe,
|
|
1077
|
+
clear: ye,
|
|
1078
|
+
submit: u,
|
|
1079
|
+
startSpeech: Re,
|
|
1080
|
+
stopSpeech: Oe,
|
|
1059
1081
|
activateTemplateFirstField: Fe
|
|
1060
|
-
}), (
|
|
1082
|
+
}), (s, T) => (m(), R("div", {
|
|
1061
1083
|
ref_key: "senderRef",
|
|
1062
|
-
ref:
|
|
1063
|
-
class:
|
|
1064
|
-
"data-theme":
|
|
1084
|
+
ref: n,
|
|
1085
|
+
class: ee(["tiny-sender", [Ue.value, `theme-${s.theme}`, `mode-${P.value}`]]),
|
|
1086
|
+
"data-theme": s.theme
|
|
1065
1087
|
}, [
|
|
1066
|
-
|
|
1067
|
-
|
|
1088
|
+
A("div", At, [
|
|
1089
|
+
A("div", {
|
|
1068
1090
|
class: "tiny-sender__input-wrapper",
|
|
1069
1091
|
ref_key: "inputWrapperRef",
|
|
1070
|
-
ref:
|
|
1092
|
+
ref: C
|
|
1071
1093
|
}, [
|
|
1072
|
-
j(
|
|
1073
|
-
default:
|
|
1074
|
-
|
|
1075
|
-
|
|
1094
|
+
j(Ee, { name: "tiny-sender-slide-down" }, {
|
|
1095
|
+
default: pe(() => [
|
|
1096
|
+
s.$slots.header ? (m(), R("div", Vt, [
|
|
1097
|
+
ae(s.$slots, "header")
|
|
1076
1098
|
])) : K("", !0)
|
|
1077
1099
|
]),
|
|
1078
1100
|
_: 3
|
|
1079
1101
|
}),
|
|
1080
|
-
|
|
1081
|
-
class:
|
|
1102
|
+
A("div", {
|
|
1103
|
+
class: ee(["tiny-sender__input-row", { "has-prefix": s.$slots.prefix, "has-header": s.$slots.header }])
|
|
1082
1104
|
}, [
|
|
1083
|
-
|
|
1084
|
-
|
|
1105
|
+
s.$slots.prefix ? (m(), R("div", Nt, [
|
|
1106
|
+
ae(s.$slots, "prefix")
|
|
1085
1107
|
])) : K("", !0),
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1108
|
+
A("div", Mt, [
|
|
1109
|
+
s.$slots.decorativeContent ? (m(), R("div", qt, [
|
|
1110
|
+
ae(s.$slots, "decorativeContent")
|
|
1089
1111
|
])) : K("", !0),
|
|
1090
|
-
|
|
1112
|
+
_.value ? (m(), X(Dt, {
|
|
1091
1113
|
key: 1,
|
|
1092
1114
|
ref_key: "templateEditorRef",
|
|
1093
|
-
ref:
|
|
1094
|
-
"model-value":
|
|
1095
|
-
"onUpdate:modelValue":
|
|
1096
|
-
onSubmit:
|
|
1097
|
-
}, null, 8, ["model-value", "onSubmit"])) : (
|
|
1098
|
-
j(
|
|
1115
|
+
ref: p,
|
|
1116
|
+
"model-value": c.templateData,
|
|
1117
|
+
"onUpdate:modelValue": ue,
|
|
1118
|
+
onSubmit: k(u)
|
|
1119
|
+
}, null, 8, ["model-value", "onSubmit"])) : (m(), R("div", Ut, [
|
|
1120
|
+
j(k(rt), {
|
|
1099
1121
|
ref_key: "inputRef",
|
|
1100
|
-
ref:
|
|
1101
|
-
autosize:
|
|
1102
|
-
type:
|
|
1122
|
+
ref: w,
|
|
1123
|
+
autosize: s.autoSize,
|
|
1124
|
+
type: b.value,
|
|
1103
1125
|
resize: "none",
|
|
1104
|
-
modelValue:
|
|
1105
|
-
"onUpdate:modelValue":
|
|
1106
|
-
disabled:
|
|
1107
|
-
placeholder:
|
|
1108
|
-
autofocus:
|
|
1109
|
-
onKeydown:
|
|
1110
|
-
onCompositionstart:
|
|
1111
|
-
onCompositionend:
|
|
1112
|
-
onFocus:
|
|
1126
|
+
modelValue: k(g),
|
|
1127
|
+
"onUpdate:modelValue": T[0] || (T[0] = (B) => it(g) ? g.value = B : null),
|
|
1128
|
+
disabled: Y.value,
|
|
1129
|
+
placeholder: s.placeholder,
|
|
1130
|
+
autofocus: s.autofocus,
|
|
1131
|
+
onKeydown: k(o),
|
|
1132
|
+
onCompositionstart: T[1] || (T[1] = (B) => I.value = !0),
|
|
1133
|
+
onCompositionend: je,
|
|
1134
|
+
onFocus: l,
|
|
1113
1135
|
onBlur: f
|
|
1114
1136
|
}, null, 8, ["autosize", "type", "modelValue", "disabled", "placeholder", "autofocus", "onKeydown"]),
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1137
|
+
k(z) && !k(I) ? (m(), R("div", zt, [
|
|
1138
|
+
A("span", jt, le(k(g)), 1),
|
|
1139
|
+
Ne(le(k(z)) + " ", 1),
|
|
1140
|
+
k(te) ? (m(), R("div", Xt, "TAB")) : K("", !0)
|
|
1119
1141
|
])) : K("", !0)
|
|
1120
1142
|
]))
|
|
1121
1143
|
]),
|
|
1122
|
-
|
|
1123
|
-
|
|
1144
|
+
P.value === "single" ? (m(), R("div", Jt, [
|
|
1145
|
+
A("div", {
|
|
1124
1146
|
class: "tiny-sender__buttons-container",
|
|
1125
1147
|
ref_key: "buttonsContainerRef",
|
|
1126
|
-
ref:
|
|
1148
|
+
ref: h
|
|
1127
1149
|
}, [
|
|
1128
|
-
|
|
1129
|
-
j(
|
|
1130
|
-
"allow-speech":
|
|
1131
|
-
"allow-files":
|
|
1132
|
-
loading:
|
|
1133
|
-
disabled:
|
|
1134
|
-
"show-clear":
|
|
1135
|
-
"has-content":
|
|
1136
|
-
"speech-status":
|
|
1137
|
-
"submit-type":
|
|
1150
|
+
ae(s.$slots, "actions"),
|
|
1151
|
+
j(qe, {
|
|
1152
|
+
"allow-speech": s.allowSpeech,
|
|
1153
|
+
"allow-files": s.allowFiles,
|
|
1154
|
+
loading: s.loading,
|
|
1155
|
+
disabled: Y.value,
|
|
1156
|
+
"show-clear": s.clearable,
|
|
1157
|
+
"has-content": L.value,
|
|
1158
|
+
"speech-status": k(oe),
|
|
1159
|
+
"submit-type": s.submitType,
|
|
1138
1160
|
"is-over-limit": t.value,
|
|
1139
|
-
"stop-text":
|
|
1140
|
-
onClear:
|
|
1161
|
+
"stop-text": s.stopText,
|
|
1162
|
+
onClear: ye,
|
|
1141
1163
|
onToggleSpeech: e,
|
|
1142
|
-
onSubmit:
|
|
1143
|
-
onCancel:
|
|
1164
|
+
onSubmit: k(u),
|
|
1165
|
+
onCancel: T[2] || (T[2] = (B) => s.$emit("cancel"))
|
|
1144
1166
|
}, null, 8, ["allow-speech", "allow-files", "loading", "disabled", "show-clear", "has-content", "speech-status", "submit-type", "is-over-limit", "stop-text", "onSubmit"])
|
|
1145
1167
|
], 512)
|
|
1146
1168
|
])) : K("", !0)
|
|
1147
1169
|
], 2),
|
|
1148
|
-
j(
|
|
1149
|
-
default:
|
|
1150
|
-
|
|
1170
|
+
j(Ee, { name: "tiny-sender-slide-up" }, {
|
|
1171
|
+
default: pe(() => [
|
|
1172
|
+
P.value === "multiple" ? (m(), R("div", {
|
|
1151
1173
|
key: 0,
|
|
1152
|
-
style:
|
|
1174
|
+
style: De(S.value),
|
|
1153
1175
|
class: "tiny-sender__footer-slot tiny-sender__bottom-row"
|
|
1154
1176
|
}, [
|
|
1155
|
-
|
|
1156
|
-
|
|
1177
|
+
A("div", Gt, [
|
|
1178
|
+
ae(s.$slots, "footer-left")
|
|
1157
1179
|
]),
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1180
|
+
A("div", Qt, [
|
|
1181
|
+
ae(s.$slots, "footer-right"),
|
|
1182
|
+
s.showWordLimit && s.maxLength !== 1 / 0 ? (m(), R("div", {
|
|
1161
1183
|
key: 0,
|
|
1162
|
-
class:
|
|
1184
|
+
class: ee(["tiny-sender__word-limit", { "is-over-limit": t.value }])
|
|
1163
1185
|
}, [
|
|
1164
|
-
|
|
1165
|
-
|
|
1186
|
+
A("span", Yt, le(k(g).length), 1),
|
|
1187
|
+
Ne("/" + le(s.maxLength), 1)
|
|
1166
1188
|
], 2)) : K("", !0),
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
j(
|
|
1170
|
-
"allow-speech":
|
|
1171
|
-
"allow-files":
|
|
1172
|
-
loading:
|
|
1173
|
-
disabled:
|
|
1174
|
-
"show-clear":
|
|
1175
|
-
"has-content":
|
|
1176
|
-
"speech-status":
|
|
1177
|
-
"submit-type":
|
|
1189
|
+
P.value === "multiple" ? (m(), R("div", Zt, [
|
|
1190
|
+
A("div", en, [
|
|
1191
|
+
j(qe, {
|
|
1192
|
+
"allow-speech": s.allowSpeech,
|
|
1193
|
+
"allow-files": s.allowFiles,
|
|
1194
|
+
loading: s.loading,
|
|
1195
|
+
disabled: Y.value,
|
|
1196
|
+
"show-clear": s.clearable,
|
|
1197
|
+
"has-content": L.value,
|
|
1198
|
+
"speech-status": k(oe),
|
|
1199
|
+
"submit-type": s.submitType,
|
|
1178
1200
|
"is-over-limit": t.value,
|
|
1179
|
-
"stop-text":
|
|
1180
|
-
onClear:
|
|
1201
|
+
"stop-text": s.stopText,
|
|
1202
|
+
onClear: ye,
|
|
1181
1203
|
onToggleSpeech: e,
|
|
1182
|
-
onSubmit:
|
|
1183
|
-
onCancel:
|
|
1204
|
+
onSubmit: k(u),
|
|
1205
|
+
onCancel: T[3] || (T[3] = (B) => s.$emit("cancel"))
|
|
1184
1206
|
}, null, 8, ["allow-speech", "allow-files", "loading", "disabled", "show-clear", "has-content", "speech-status", "submit-type", "is-over-limit", "stop-text", "onSubmit"])
|
|
1185
1207
|
])
|
|
1186
1208
|
])) : K("", !0)
|
|
1187
1209
|
])
|
|
1188
|
-
], 4)) :
|
|
1189
|
-
|
|
1210
|
+
], 4)) : s.$slots.footer ? (m(), R("div", tn, [
|
|
1211
|
+
ae(s.$slots, "footer")
|
|
1190
1212
|
])) : K("", !0)
|
|
1191
1213
|
]),
|
|
1192
1214
|
_: 3
|
|
1193
1215
|
})
|
|
1194
1216
|
], 512)
|
|
1195
1217
|
]),
|
|
1196
|
-
j(
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
onMouseleave: k[4] || (k[4] = //@ts-ignore
|
|
1210
|
-
(...z) => _(H) && _(H)(...z)),
|
|
1211
|
-
onMousedown: dt((z) => _(he)(B), ["prevent"])
|
|
1212
|
-
}, [
|
|
1213
|
-
j(_(wt), { class: "suggestion-item__icon" }),
|
|
1214
|
-
q("span", nn, [
|
|
1215
|
-
(g(!0), O(pe, null, ye(_(ae)(B, _(y)), (z, Ee) => (g(), O("span", {
|
|
1216
|
-
key: Ee,
|
|
1217
|
-
class: ue({ "suggestion-item__text--match": z.isMatch, "suggestion-item__text--normal": !z.isMatch })
|
|
1218
|
-
}, ne(z.text), 3))), 128))
|
|
1219
|
-
])
|
|
1220
|
-
], 42, tn))), 128))
|
|
1221
|
-
], 4)) : K("", !0)
|
|
1222
|
-
]),
|
|
1223
|
-
_: 1
|
|
1224
|
-
}),
|
|
1225
|
-
ve.value ? (g(), O("div", sn, ne(ve.value), 1)) : K("", !0)
|
|
1218
|
+
j(Kt, {
|
|
1219
|
+
ref_key: "suggestionsListRef",
|
|
1220
|
+
ref: v,
|
|
1221
|
+
show: k($),
|
|
1222
|
+
suggestions: k(F),
|
|
1223
|
+
"popup-style": ze.value,
|
|
1224
|
+
"is-item-highlighted": k(W),
|
|
1225
|
+
"highlight-suggestion-text": k(ne),
|
|
1226
|
+
"input-value": k(g),
|
|
1227
|
+
onItemHover: k(N),
|
|
1228
|
+
onItemLeave: k(M),
|
|
1229
|
+
onSelect: k(de)
|
|
1230
|
+
}, null, 8, ["show", "suggestions", "popup-style", "is-item-highlighted", "highlight-suggestion-text", "input-value", "onItemHover", "onItemLeave", "onSelect"])
|
|
1226
1231
|
], 10, Wt));
|
|
1227
1232
|
}
|
|
1228
1233
|
});
|
|
1229
|
-
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1234
|
+
_e.name = "TrSender";
|
|
1235
|
+
const nn = function(i) {
|
|
1236
|
+
i.component(_e.name, _e);
|
|
1232
1237
|
};
|
|
1233
|
-
|
|
1238
|
+
_e.install = nn;
|
|
1234
1239
|
export {
|
|
1235
|
-
|
|
1240
|
+
_e as default
|
|
1236
1241
|
};
|