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