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