@opentiny/tiny-robot 0.5.2-alpha.15 → 0.5.2-alpha.17
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/anchor/index.js +32 -32
- package/dist/container/index.js +16 -15
- package/dist/dropdown-menu/index.js +141 -97
- package/dist/extension-manager/index.js +814 -292
- package/dist/index.d.ts +402 -228
- package/dist/index.js +64 -61
- package/dist/index3.js +92 -95
- package/dist/index6.js +641 -622
- package/dist/index7.js +296 -186
- package/dist/model-selector/index.js +517 -522
- package/dist/sender/index.js +111 -111
- package/dist/style.css +1 -1
- package/dist/useStableId.js +15 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import S from "./attachments/index.js";
|
|
2
2
|
import { B, a as E, b as F } from "./index6.js";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as He, d as $e, u as We, e as we, f as ke, g as Ne, h as Ve, i as Ge, j as Ie, k as Ue } from "./index6.js";
|
|
4
4
|
import b from "./container/index.js";
|
|
5
5
|
import C from "./anchor/index.js";
|
|
6
6
|
import z from "./conversations/index.js";
|
|
@@ -8,7 +8,7 @@ import y from "./drag-overlay/index.js";
|
|
|
8
8
|
import L from "./dropdown-menu/index.js";
|
|
9
9
|
import P from "./feedback/index.js";
|
|
10
10
|
import { H as A } from "./index7.js";
|
|
11
|
-
import { u as
|
|
11
|
+
import { u as Xe } from "./index7.js";
|
|
12
12
|
import M from "./icon-button/index.js";
|
|
13
13
|
import { Layout as O, LayoutProxyScrollbar as R, LayoutAsideToggle as j } from "./layout/index.js";
|
|
14
14
|
import H from "./model-selector/index.js";
|
|
@@ -18,17 +18,17 @@ import k from "./sender-compat/index.js";
|
|
|
18
18
|
import N, { SuggestionPillButton as V } from "./suggestion-pills/index.js";
|
|
19
19
|
import G from "./suggestion-popover/index.js";
|
|
20
20
|
import I from "./theme-provider/index.js";
|
|
21
|
-
import { useTheme as
|
|
21
|
+
import { useTheme as qe } from "./theme-provider/index.js";
|
|
22
22
|
import U from "./welcome/index.js";
|
|
23
23
|
import K from "./mcp-server-picker/index.js";
|
|
24
24
|
import X from "./mcp-add-form/index.js";
|
|
25
|
-
import {
|
|
26
|
-
import { u as
|
|
27
|
-
import { A as
|
|
28
|
-
import { a as
|
|
29
|
-
import { _ as
|
|
25
|
+
import { ExtensionManager as Y, ExtensionCard as q, ExtensionCardGrid as J } from "./extension-manager/index.js";
|
|
26
|
+
import { u as Qe } from "./useSenderContentRegistration.js";
|
|
27
|
+
import { A as Q, S as Z, _ as ee, W as re, D as oe } from "./index2.js";
|
|
28
|
+
import { a as er, u as rr } from "./index2.js";
|
|
29
|
+
import { _ as te, V as ae } from "./index3.js";
|
|
30
30
|
var u = /* @__PURE__ */ ((e) => (e.FileTypeNotAllowed = "file-type-not-allowed", e.FileSizeExceeded = "file-size-exceeded", e.FileCountExceeded = "file-count-exceeded", e))(u || {});
|
|
31
|
-
function
|
|
31
|
+
function ne(e, r) {
|
|
32
32
|
if (!r) return !0;
|
|
33
33
|
const t = r.split(",").map((o) => o.trim());
|
|
34
34
|
return t.includes("*") ? !0 : t.some((o) => {
|
|
@@ -44,12 +44,12 @@ function ae(e, r) {
|
|
|
44
44
|
function v(e, r) {
|
|
45
45
|
return e.size <= r;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function se(e, r) {
|
|
48
48
|
return e.length <= r;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function ie(e, r) {
|
|
51
51
|
const { accept: t, multiple: o, maxSize: n, maxFiles: l } = r, a = [], s = [];
|
|
52
|
-
if (!
|
|
52
|
+
if (!se(e, l))
|
|
53
53
|
return {
|
|
54
54
|
acceptedFiles: a,
|
|
55
55
|
rejectedFiles: Array.from(e),
|
|
@@ -59,7 +59,7 @@ function se(e, r) {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
if (e.forEach((i) => {
|
|
62
|
-
|
|
62
|
+
ne(i, t) && v(i, n) ? a.push(i) : s.push(i);
|
|
63
63
|
}), !o && a.length > 1)
|
|
64
64
|
return {
|
|
65
65
|
acceptedFiles: [],
|
|
@@ -90,7 +90,7 @@ function T(e) {
|
|
|
90
90
|
disabled: e.disabled || !1
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
const
|
|
93
|
+
const Me = {
|
|
94
94
|
/**
|
|
95
95
|
* 挂载指令
|
|
96
96
|
* @param el 元素
|
|
@@ -130,13 +130,13 @@ const Ae = {
|
|
|
130
130
|
a.preventDefault(), t = 0, n(!1, null);
|
|
131
131
|
const s = (p = a.dataTransfer) == null ? void 0 : p.files, { onDrop: i, onError: d, accept: m, multiple: c, maxSize: g, maxFiles: D } = e.__vDropzoneOptions__;
|
|
132
132
|
if (s && s.length > 0) {
|
|
133
|
-
const h = Array.from(s), { acceptedFiles: f, rejectedFiles:
|
|
133
|
+
const h = Array.from(s), { acceptedFiles: f, rejectedFiles: x, rejectionReason: _ } = ie(h, {
|
|
134
134
|
accept: m,
|
|
135
135
|
multiple: c,
|
|
136
136
|
maxSize: g,
|
|
137
137
|
maxFiles: D
|
|
138
138
|
});
|
|
139
|
-
_ && d({ files:
|
|
139
|
+
_ && d({ files: x, ..._ }), f.length > 0 && i(f);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
};
|
|
@@ -152,8 +152,8 @@ const Ae = {
|
|
|
152
152
|
unmounted(e) {
|
|
153
153
|
e.__vDropzoneHandlers__ && (e.removeEventListener("dragenter", e.__vDropzoneHandlers__.handleDragEnter), e.removeEventListener("dragover", e.__vDropzoneHandlers__.handleDragOver), e.removeEventListener("dragleave", e.__vDropzoneHandlers__.handleDragLeave), e.removeEventListener("drop", e.__vDropzoneHandlers__.handleDrop), delete e.__vDropzoneHandlers__), delete e.__vDropzoneOptions__;
|
|
154
154
|
}
|
|
155
|
-
},
|
|
156
|
-
|
|
155
|
+
}, le = [
|
|
156
|
+
S,
|
|
157
157
|
B,
|
|
158
158
|
E,
|
|
159
159
|
F,
|
|
@@ -185,35 +185,37 @@ const Ae = {
|
|
|
185
185
|
J,
|
|
186
186
|
Q,
|
|
187
187
|
Z,
|
|
188
|
-
oe,
|
|
189
|
-
te,
|
|
190
188
|
ee,
|
|
191
|
-
|
|
192
|
-
|
|
189
|
+
te,
|
|
190
|
+
ae,
|
|
191
|
+
re,
|
|
192
|
+
oe
|
|
193
|
+
], Oe = {
|
|
193
194
|
install(e) {
|
|
194
|
-
|
|
195
|
+
le.forEach((r) => {
|
|
195
196
|
const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
196
197
|
e.component(`Tr${t}`, r);
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
200
|
};
|
|
200
201
|
export {
|
|
201
|
-
|
|
202
|
+
Q as ActionButton,
|
|
202
203
|
C as Anchor,
|
|
203
|
-
|
|
204
|
+
S as Attachments,
|
|
204
205
|
B as Bubble,
|
|
205
206
|
E as BubbleList,
|
|
206
207
|
F as BubbleProvider,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
He as BubbleRendererMatchPriority,
|
|
209
|
+
$e as BubbleRenderers,
|
|
210
|
+
ee as ClearButton,
|
|
210
211
|
b as Container,
|
|
211
212
|
z as Conversations,
|
|
212
|
-
|
|
213
|
+
oe as DefaultActionButtons,
|
|
213
214
|
y as DragOverlay,
|
|
214
215
|
L as DropdownMenu,
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
q as ExtensionCard,
|
|
217
|
+
J as ExtensionCardGrid,
|
|
218
|
+
Y as ExtensionManager,
|
|
217
219
|
P as Feedback,
|
|
218
220
|
A as History,
|
|
219
221
|
M as IconButton,
|
|
@@ -225,28 +227,29 @@ export {
|
|
|
225
227
|
H as ModelSelector,
|
|
226
228
|
$ as Prompt,
|
|
227
229
|
W as Prompts,
|
|
228
|
-
|
|
230
|
+
er as SENDER_CONTEXT_KEY,
|
|
229
231
|
w as Sender,
|
|
230
232
|
k as SenderCompat,
|
|
231
|
-
|
|
233
|
+
Z as SubmitButton,
|
|
232
234
|
V as SuggestionPillButton,
|
|
233
235
|
N as SuggestionPills,
|
|
234
236
|
G as SuggestionPopover,
|
|
235
237
|
I as ThemeProvider,
|
|
236
|
-
|
|
238
|
+
Q as TrActionButton,
|
|
237
239
|
C as TrAnchor,
|
|
238
|
-
|
|
240
|
+
S as TrAttachments,
|
|
239
241
|
B as TrBubble,
|
|
240
242
|
E as TrBubbleList,
|
|
241
243
|
F as TrBubbleProvider,
|
|
242
|
-
|
|
244
|
+
ee as TrClearButton,
|
|
243
245
|
b as TrContainer,
|
|
244
246
|
z as TrConversations,
|
|
245
|
-
|
|
247
|
+
oe as TrDefaultActionButtons,
|
|
246
248
|
y as TrDragOverlay,
|
|
247
249
|
L as TrDropdownMenu,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
+
q as TrExtensionCard,
|
|
251
|
+
J as TrExtensionCardGrid,
|
|
252
|
+
Y as TrExtensionManager,
|
|
250
253
|
P as TrFeedback,
|
|
251
254
|
A as TrHistory,
|
|
252
255
|
M as TrIconButton,
|
|
@@ -260,31 +263,31 @@ export {
|
|
|
260
263
|
W as TrPrompts,
|
|
261
264
|
w as TrSender,
|
|
262
265
|
k as TrSenderCompat,
|
|
263
|
-
|
|
266
|
+
Z as TrSubmitButton,
|
|
264
267
|
V as TrSuggestionPillButton,
|
|
265
268
|
N as TrSuggestionPills,
|
|
266
269
|
G as TrSuggestionPopover,
|
|
267
270
|
I as TrThemeProvider,
|
|
268
|
-
|
|
269
|
-
|
|
271
|
+
te as TrUploadButton,
|
|
272
|
+
ae as TrVoiceButton,
|
|
270
273
|
U as TrWelcome,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
+
re as TrWordCounter,
|
|
275
|
+
te as UploadButton,
|
|
276
|
+
ae as VoiceButton,
|
|
274
277
|
U as Welcome,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
278
|
+
re as WordCounter,
|
|
279
|
+
Oe as default,
|
|
280
|
+
We as useAutoScroll,
|
|
281
|
+
we as useBubbleBoxRenderer,
|
|
282
|
+
ke as useBubbleContentRenderer,
|
|
283
|
+
Ne as useBubbleEventFn,
|
|
284
|
+
Ve as useBubbleStateChangeFn,
|
|
285
|
+
Ge as useMessageContent,
|
|
286
|
+
Ie as useOmitMessageFields,
|
|
287
|
+
Qe as useSenderContentRegistration,
|
|
288
|
+
rr as useSenderContext,
|
|
289
|
+
qe as useTheme,
|
|
290
|
+
Ue as useToolCall,
|
|
291
|
+
Xe as useTouchDevice,
|
|
292
|
+
Me as vDropzone
|
|
290
293
|
};
|
package/dist/index3.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var $ = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { e as
|
|
6
|
-
import { u as
|
|
7
|
-
import { IconImageUpload as
|
|
8
|
-
import { _ as
|
|
9
|
-
const
|
|
2
|
+
var D = (i, o, e) => o in i ? $(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
|
|
3
|
+
var C = (i, o, e) => D(i, typeof o != "symbol" ? o + "" : o, e);
|
|
4
|
+
import { defineComponent as B, toRefs as H, computed as R, watch as F, openBlock as S, createBlock as x, unref as p, ref as V, reactive as A, onUnmounted as P, createElementBlock as j, Fragment as U, normalizeClass as W, createSlots as L, withCtx as y, renderSlot as z, resolveDynamicComponent as M, createCommentVNode as N } from "vue";
|
|
5
|
+
import { e as O } from "./index4.js";
|
|
6
|
+
import { u as I, A as b } from "./index2.js";
|
|
7
|
+
import { IconImageUpload as T, IconVoice as _, IconRecordingWave as q } from "@opentiny/tiny-robot-svgs";
|
|
8
|
+
import { _ as G } from "./_plugin-vue_export-helper.js";
|
|
9
|
+
const te = /* @__PURE__ */ B({
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
12
12
|
disabled: { type: Boolean },
|
|
@@ -22,51 +22,48 @@ const ne = /* @__PURE__ */ I({
|
|
|
22
22
|
},
|
|
23
23
|
emits: ["select", "error"],
|
|
24
24
|
setup(i, { expose: o, emit: e }) {
|
|
25
|
-
const n = i, l = e, { accept: c, multiple:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (n.maxCount && r.length > n.maxCount) {
|
|
37
|
-
const h = new Error(`最多只能选择 ${n.maxCount} 个文件`);
|
|
38
|
-
l("error", h);
|
|
25
|
+
const n = i, l = e, { accept: c, multiple: h, reset: m } = H(n), { disabled: a } = I(), t = R(() => n.disabled || a.value), { open: r, files: d } = O({
|
|
26
|
+
accept: c,
|
|
27
|
+
multiple: h,
|
|
28
|
+
reset: m
|
|
29
|
+
});
|
|
30
|
+
F(d, (f) => {
|
|
31
|
+
if (!f || f.length === 0) return;
|
|
32
|
+
const g = Array.from(f);
|
|
33
|
+
if (n.maxCount && g.length > n.maxCount) {
|
|
34
|
+
const s = new Error(`最多只能选择 ${n.maxCount} 个文件`);
|
|
35
|
+
l("error", s);
|
|
39
36
|
return;
|
|
40
37
|
}
|
|
41
38
|
if (n.maxSize) {
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
l("error",
|
|
39
|
+
const s = n.maxSize * 1024 * 1024, v = g.filter((E) => E.size > s);
|
|
40
|
+
if (v.length > 0) {
|
|
41
|
+
const E = new Error(`以下文件超过 ${n.maxSize}MB 限制: ${v.map((k) => k.name).join(", ")}`);
|
|
42
|
+
l("error", E, v);
|
|
46
43
|
return;
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
|
-
l("select",
|
|
46
|
+
l("select", g);
|
|
50
47
|
});
|
|
51
|
-
const
|
|
52
|
-
t.value ||
|
|
48
|
+
const u = () => {
|
|
49
|
+
t.value || r();
|
|
53
50
|
};
|
|
54
51
|
return o({
|
|
55
|
-
open:
|
|
56
|
-
}), (
|
|
57
|
-
icon: i.icon ??
|
|
52
|
+
open: r
|
|
53
|
+
}), (f, g) => (S(), x(b, {
|
|
54
|
+
icon: i.icon ?? p(T),
|
|
58
55
|
disabled: t.value,
|
|
59
56
|
size: i.size,
|
|
60
57
|
tooltip: i.tooltip,
|
|
61
58
|
"tooltip-placement": i.tooltipPlacement,
|
|
62
|
-
onClick:
|
|
59
|
+
onClick: u
|
|
63
60
|
}, null, 8, ["icon", "disabled", "size", "tooltip", "tooltip-placement"]));
|
|
64
61
|
}
|
|
65
62
|
});
|
|
66
|
-
class
|
|
63
|
+
class w {
|
|
67
64
|
constructor(o) {
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
C(this, "recognition");
|
|
66
|
+
C(this, "options");
|
|
70
67
|
this.options = o, this.initialize();
|
|
71
68
|
}
|
|
72
69
|
/**
|
|
@@ -85,7 +82,7 @@ class S {
|
|
|
85
82
|
* 检查浏览器是否支持 Web Speech API(实例方法)
|
|
86
83
|
*/
|
|
87
84
|
isSupported() {
|
|
88
|
-
return
|
|
85
|
+
return w.isSupported();
|
|
89
86
|
}
|
|
90
87
|
/**
|
|
91
88
|
* 设置语音识别事件处理器
|
|
@@ -139,8 +136,8 @@ class S {
|
|
|
139
136
|
}
|
|
140
137
|
}
|
|
141
138
|
}
|
|
142
|
-
function
|
|
143
|
-
const o =
|
|
139
|
+
function J(i) {
|
|
140
|
+
const o = V(i), e = A({
|
|
144
141
|
isRecording: !1,
|
|
145
142
|
isSupported: !1,
|
|
146
143
|
error: void 0
|
|
@@ -150,25 +147,25 @@ function K(i) {
|
|
|
150
147
|
e.isRecording = !0, e.error = void 0, (t = (a = o.value).onStart) == null || t.call(a);
|
|
151
148
|
},
|
|
152
149
|
onInterim: (a) => {
|
|
153
|
-
var t,
|
|
154
|
-
(
|
|
150
|
+
var t, r;
|
|
151
|
+
(r = (t = o.value).onInterim) == null || r.call(t, a);
|
|
155
152
|
},
|
|
156
153
|
onFinal: (a) => {
|
|
157
|
-
var t,
|
|
158
|
-
(
|
|
154
|
+
var t, r;
|
|
155
|
+
(r = (t = o.value).onFinal) == null || r.call(t, a);
|
|
159
156
|
},
|
|
160
157
|
onEnd: (a) => {
|
|
161
|
-
var t,
|
|
162
|
-
e.isRecording && (e.isRecording = !1, (
|
|
158
|
+
var t, r;
|
|
159
|
+
e.isRecording && (e.isRecording = !1, (r = (t = o.value).onEnd) == null || r.call(t, a));
|
|
163
160
|
},
|
|
164
161
|
onError: (a) => {
|
|
165
|
-
var t,
|
|
166
|
-
e.error = a, e.isRecording = !1, (
|
|
162
|
+
var t, r;
|
|
163
|
+
e.error = a, e.isRecording = !1, (r = (t = o.value).onError) == null || r.call(t, a);
|
|
167
164
|
}
|
|
168
|
-
}, l =
|
|
165
|
+
}, l = w.isSupported();
|
|
169
166
|
e.isSupported = i.customHandler ? i.customHandler.isSupported() : l;
|
|
170
|
-
const c = i.customHandler ?? (l ? new
|
|
171
|
-
var a, t,
|
|
167
|
+
const c = i.customHandler ?? (l ? new w(i) : null), h = () => {
|
|
168
|
+
var a, t, r, d;
|
|
172
169
|
if (!e.isSupported || !c) {
|
|
173
170
|
const u = new Error("语音识别不受支持");
|
|
174
171
|
e.error = u, (t = (a = o.value).onError) == null || t.call(a, u);
|
|
@@ -183,20 +180,20 @@ function K(i) {
|
|
|
183
180
|
try {
|
|
184
181
|
c.start(n);
|
|
185
182
|
} catch (u) {
|
|
186
|
-
e.error = u instanceof Error ? u : new Error("启动失败"), (d = (
|
|
183
|
+
e.error = u instanceof Error ? u : new Error("启动失败"), (d = (r = o.value).onError) == null || d.call(r, e.error);
|
|
187
184
|
}
|
|
188
|
-
},
|
|
185
|
+
}, m = () => {
|
|
189
186
|
!e.isRecording || !c || (c.stop(), n.onEnd());
|
|
190
187
|
};
|
|
191
|
-
return
|
|
188
|
+
return P(() => {
|
|
192
189
|
e.isRecording && c && (c.stop(), e.isRecording = !1);
|
|
193
190
|
}), {
|
|
194
191
|
speechState: e,
|
|
195
|
-
start:
|
|
196
|
-
stop:
|
|
192
|
+
start: h,
|
|
193
|
+
stop: m
|
|
197
194
|
};
|
|
198
195
|
}
|
|
199
|
-
const
|
|
196
|
+
const K = /* @__PURE__ */ B({
|
|
200
197
|
__name: "index",
|
|
201
198
|
props: {
|
|
202
199
|
icon: {},
|
|
@@ -211,75 +208,75 @@ const Q = /* @__PURE__ */ I({
|
|
|
211
208
|
},
|
|
212
209
|
emits: ["speech-start", "speech-interim", "speech-final", "speech-end", "speech-error"],
|
|
213
210
|
setup(i, { expose: o, emit: e }) {
|
|
214
|
-
const n = i, l = e, { editor: c, disabled:
|
|
211
|
+
const n = i, l = e, { editor: c, disabled: h } = I(), m = R(() => n.disabled || h.value), a = {
|
|
215
212
|
...n.speechConfig,
|
|
216
213
|
onStart: () => {
|
|
217
214
|
l("speech-start");
|
|
218
215
|
},
|
|
219
|
-
onInterim: (
|
|
220
|
-
l("speech-interim",
|
|
216
|
+
onInterim: (s) => {
|
|
217
|
+
l("speech-interim", s);
|
|
221
218
|
},
|
|
222
|
-
onFinal: (
|
|
223
|
-
n.autoInsert && c.value && (c.value.commands.insertContent(
|
|
219
|
+
onFinal: (s) => {
|
|
220
|
+
n.autoInsert && c.value && (c.value.commands.insertContent(s + " "), c.value.commands.focus("end")), l("speech-final", s);
|
|
224
221
|
},
|
|
225
|
-
onEnd: (
|
|
226
|
-
c.value && c.value.commands.focus("end"), l("speech-end",
|
|
222
|
+
onEnd: (s) => {
|
|
223
|
+
c.value && c.value.commands.focus("end"), l("speech-end", s);
|
|
227
224
|
},
|
|
228
|
-
onError: (
|
|
229
|
-
l("speech-error",
|
|
225
|
+
onError: (s) => {
|
|
226
|
+
l("speech-error", s);
|
|
230
227
|
}
|
|
231
|
-
}, { speechState: t, start:
|
|
232
|
-
if (!
|
|
228
|
+
}, { speechState: t, start: r, stop: d } = J(a), u = async () => {
|
|
229
|
+
if (!m.value) {
|
|
233
230
|
if (n.onButtonClick) {
|
|
234
|
-
let
|
|
231
|
+
let s = !1;
|
|
235
232
|
if (await n.onButtonClick(t.isRecording, () => {
|
|
236
|
-
|
|
237
|
-
}),
|
|
233
|
+
s = !0;
|
|
234
|
+
}), s) return;
|
|
238
235
|
}
|
|
239
|
-
t.isRecording ? d() :
|
|
236
|
+
t.isRecording ? d() : r();
|
|
240
237
|
}
|
|
241
|
-
},
|
|
238
|
+
}, f = R(() => n.icon ?? _), g = R(() => n.recordingIcon ?? q);
|
|
242
239
|
return o({
|
|
243
|
-
start:
|
|
240
|
+
start: r,
|
|
244
241
|
stop: d,
|
|
245
242
|
speechState: t
|
|
246
|
-
}), (
|
|
247
|
-
|
|
243
|
+
}), (s, v) => (S(), j(U, null, [
|
|
244
|
+
p(t).isSupported ? (S(), x(b, {
|
|
248
245
|
key: 0,
|
|
249
|
-
icon:
|
|
250
|
-
disabled:
|
|
246
|
+
icon: f.value,
|
|
247
|
+
disabled: m.value,
|
|
251
248
|
size: i.size,
|
|
252
249
|
tooltip: i.tooltip,
|
|
253
250
|
"tooltip-placement": i.tooltipPlacement,
|
|
254
|
-
class:
|
|
251
|
+
class: W({ "is-recording": p(t).isRecording }),
|
|
255
252
|
onClick: u
|
|
256
|
-
},
|
|
257
|
-
|
|
253
|
+
}, L({ _: 2 }, [
|
|
254
|
+
s.$slots.icon ? {
|
|
258
255
|
name: "icon",
|
|
259
|
-
fn:
|
|
260
|
-
|
|
261
|
-
isRecording:
|
|
256
|
+
fn: y(() => [
|
|
257
|
+
z(s.$slots, "icon", {
|
|
258
|
+
isRecording: p(t).isRecording
|
|
262
259
|
}, void 0, !0)
|
|
263
260
|
]),
|
|
264
261
|
key: "0"
|
|
265
|
-
} :
|
|
262
|
+
} : p(t).isRecording ? {
|
|
266
263
|
name: "icon",
|
|
267
|
-
fn:
|
|
268
|
-
(
|
|
264
|
+
fn: y(() => [
|
|
265
|
+
(S(), x(M(g.value)))
|
|
269
266
|
]),
|
|
270
267
|
key: "1"
|
|
271
268
|
} : void 0
|
|
272
|
-
]), 1032, ["icon", "disabled", "size", "tooltip", "tooltip-placement", "class"])) :
|
|
273
|
-
|
|
274
|
-
isRecording:
|
|
275
|
-
stop:
|
|
269
|
+
]), 1032, ["icon", "disabled", "size", "tooltip", "tooltip-placement", "class"])) : N("", !0),
|
|
270
|
+
z(s.$slots, "recording-overlay", {
|
|
271
|
+
isRecording: p(t).isRecording,
|
|
272
|
+
stop: p(d)
|
|
276
273
|
}, void 0, !0)
|
|
277
274
|
], 64));
|
|
278
275
|
}
|
|
279
|
-
}),
|
|
276
|
+
}), ne = /* @__PURE__ */ G(K, [["__scopeId", "data-v-2a013fc9"]]);
|
|
280
277
|
export {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
278
|
+
ne as V,
|
|
279
|
+
w as W,
|
|
280
|
+
te as _,
|
|
281
|
+
J as u
|
|
285
282
|
};
|