@inupedia/spotlight-vue 0.9.0 → 0.9.2
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/assets/spotlight-vue.css +1 -1
- package/dist/avatar/speech/spotlightSpeech.d.ts.map +1 -1
- package/dist/avatar/speech/spotlightSpeech.js +20 -31
- package/dist/avatar/voice/micAccess.d.ts +4 -0
- package/dist/avatar/voice/micAccess.d.ts.map +1 -0
- package/dist/avatar/voice/micAccess.js +26 -0
- package/dist/avatar/voice/phonePairing.d.ts +14 -0
- package/dist/avatar/voice/phonePairing.d.ts.map +1 -0
- package/dist/avatar/voice/phonePairing.js +30 -0
- package/dist/avatar/voice/usePhoneVoicePairing.d.ts +17 -0
- package/dist/avatar/voice/usePhoneVoicePairing.d.ts.map +1 -0
- package/dist/avatar/voice/usePhoneVoicePairing.js +88 -0
- package/dist/components/Live2dPanel.vue.d.ts +20 -0
- package/dist/components/Live2dPanel.vue.d.ts.map +1 -1
- package/dist/components/Live2dPanel.vue.js +1 -1
- package/dist/components/Live2dPanel2.vue.js +167 -62
- package/dist/components/SpotlightCommandPanel.vue.d.ts.map +1 -1
- package/dist/components/SpotlightCommandPanel.vue.js +1 -1
- package/dist/components/SpotlightCommandPanel2.vue.js +337 -191
- package/dist/components/SpotlightShell.vue.d.ts.map +1 -1
- package/dist/components/SpotlightShell.vue.js +2 -2
- package/dist/components/SpotlightShell2.vue.js +268 -255
- package/dist/node_modules/.pnpm/uqr@0.1.3/node_modules/uqr/dist/index.js +504 -0
- package/dist/remote/runPipeline.d.ts.map +1 -1
- package/dist/remote/runPipeline.js +103 -97
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +15 -13
- package/dist/store/modelStore.d.ts +16 -0
- package/dist/store/modelStore.d.ts.map +1 -0
- package/dist/store/modelStore.js +63 -0
- package/package.json +5 -3
|
@@ -1,57 +1,87 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { storeToRefs as
|
|
3
|
-
import { startLive2dApp as
|
|
4
|
-
import { configureSpineAvatar as
|
|
5
|
-
import { useSpotlightAvatarConfig as
|
|
6
|
-
import { useLive2dSpeechStore as
|
|
7
|
-
import { useLive2dVoiceChannelStore as
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { defineComponent as Q, ref as U, computed as g, watch as z, onMounted as H, onUnmounted as O, openBlock as a, createElementBlock as r, createElementVNode as e, unref as p, normalizeClass as k, toDisplayString as d, createCommentVNode as u, createBlock as x, Teleport as B, withModifiers as D, createVNode as q, Transition as R, withCtx as j } from "vue";
|
|
2
|
+
import { storeToRefs as F } from "pinia";
|
|
3
|
+
import { startLive2dApp as G, stopLive2dApp as J } from "../avatar/spine/live2dApp.js";
|
|
4
|
+
import { configureSpineAvatar as K } from "../avatar/spine/spineAvatar.js";
|
|
5
|
+
import { useSpotlightAvatarConfig as W } from "../avatar/config.js";
|
|
6
|
+
import { useLive2dSpeechStore as X } from "../store/live2dSpeechStore.js";
|
|
7
|
+
import { useLive2dVoiceChannelStore as Y } from "../store/live2dVoiceChannelStore.js";
|
|
8
|
+
const Z = { class: "live2d-panel-shell" }, _ = { class: "live2d-voice-controls" }, ee = ["disabled", "aria-label"], ie = { class: "live2d-voice-label" }, te = {
|
|
9
|
+
class: "live2d-phone-panel",
|
|
10
|
+
role: "dialog",
|
|
11
|
+
"aria-modal": "true",
|
|
12
|
+
"aria-label": "手机语音遥控器"
|
|
13
|
+
}, oe = { class: "live2d-phone-header" }, le = { class: "live2d-phone-actions" }, ne = ["disabled"], ae = ["disabled"], se = ["innerHTML"], re = { class: "live2d-phone-status" }, de = {
|
|
14
|
+
class: "live2d-notice",
|
|
15
|
+
role: "alertdialog",
|
|
16
|
+
"aria-modal": "true",
|
|
17
|
+
"aria-labelledby": "live2d-notice-title"
|
|
18
|
+
}, ce = { class: "live2d-notice-body" }, ve = { class: "live2d-speech-head" }, pe = { class: "live2d-speech-text" }, ke = /* @__PURE__ */ Q({
|
|
13
19
|
__name: "Live2dPanel",
|
|
14
20
|
props: {
|
|
15
21
|
voiceDisabled: { type: Boolean, default: !1 },
|
|
16
|
-
voiceError: { default: "" }
|
|
22
|
+
voiceError: { default: "" },
|
|
23
|
+
phonePairAvailable: { type: Boolean, default: !1 },
|
|
24
|
+
phonePairOpen: { type: Boolean, default: !1 },
|
|
25
|
+
phonePairQr: { default: "" },
|
|
26
|
+
phonePairUrl: { default: "" },
|
|
27
|
+
phonePairError: { default: "" },
|
|
28
|
+
phoneConnected: { type: Boolean, default: !1 }
|
|
17
29
|
},
|
|
18
|
-
emits: ["voiceStart", "voiceStop", "close"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
emits: ["voiceStart", "voiceStop", "close", "phonePair", "phonePairClose", "dismissError", "dismissPairError"],
|
|
31
|
+
setup(t, { emit: A }) {
|
|
32
|
+
const o = t, l = A, P = X(), s = Y(), C = W(), { message: w, speaking: T, revealInstant: V } = F(P), c = U(""), m = U(!1);
|
|
33
|
+
let h = null, v = null;
|
|
34
|
+
const S = g(
|
|
35
|
+
() => o.voiceError.trim() || o.phonePairError.trim()
|
|
36
|
+
), M = g(() => T.value || w.value.trim().length > 0), E = g(() => s.recording ? "点击发送" : s.transcribing ? "正在识别…" : o.voiceDisabled ? "Spotlight 忙碌中" : "点击说话");
|
|
37
|
+
function N(b) {
|
|
38
|
+
o.voiceDisabled || s.transcribing || (b.preventDefault(), s.recording ? l("voiceStop") : l("voiceStart"));
|
|
25
39
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
40
|
+
function L() {
|
|
41
|
+
o.voiceError.trim() ? l("dismissError") : l("dismissPairError");
|
|
28
42
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
function $() {
|
|
44
|
+
o.phonePairUrl && window.open(o.phonePairUrl, "spotlight-voice-remote");
|
|
45
|
+
}
|
|
46
|
+
async function I() {
|
|
47
|
+
if (o.phonePairUrl)
|
|
48
|
+
try {
|
|
49
|
+
await navigator.clipboard.writeText(o.phonePairUrl), m.value = !0, v != null && window.clearTimeout(v), v = window.setTimeout(() => {
|
|
50
|
+
m.value = !1;
|
|
51
|
+
}, 1600);
|
|
52
|
+
} catch {
|
|
53
|
+
window.prompt("复制遥控器链接", o.phonePairUrl);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function f() {
|
|
57
|
+
h != null && (window.clearInterval(h), h = null);
|
|
58
|
+
}
|
|
59
|
+
return z(
|
|
60
|
+
() => [w.value, V.value],
|
|
61
|
+
([b, i]) => {
|
|
62
|
+
f();
|
|
63
|
+
const n = b.trim();
|
|
64
|
+
if (!n) {
|
|
65
|
+
c.value = "";
|
|
36
66
|
return;
|
|
37
67
|
}
|
|
38
68
|
if (i) {
|
|
39
|
-
|
|
69
|
+
c.value = n;
|
|
40
70
|
return;
|
|
41
71
|
}
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
72
|
+
c.value = "";
|
|
73
|
+
let y = 0;
|
|
74
|
+
h = window.setInterval(() => {
|
|
75
|
+
y += 1, c.value = n.slice(0, y), y >= n.length && f();
|
|
46
76
|
}, 24);
|
|
47
77
|
},
|
|
48
78
|
{ immediate: !0 }
|
|
49
|
-
),
|
|
50
|
-
|
|
51
|
-
}),
|
|
52
|
-
v(),
|
|
53
|
-
}), (
|
|
54
|
-
i[
|
|
79
|
+
), H(async () => {
|
|
80
|
+
K(C), await G();
|
|
81
|
+
}), O(() => {
|
|
82
|
+
f(), v != null && window.clearTimeout(v), P.reset(), J();
|
|
83
|
+
}), (b, i) => (a(), r("div", Z, [
|
|
84
|
+
i[9] || (i[9] = e("div", {
|
|
55
85
|
id: "live2d-container",
|
|
56
86
|
class: "live2d-panel",
|
|
57
87
|
"aria-label": "Live2D"
|
|
@@ -61,19 +91,19 @@ const F = { class: "live2d-panel-shell" }, G = { class: "live2d-voice-controls"
|
|
|
61
91
|
class: "live2d-close",
|
|
62
92
|
"aria-label": "关闭数字人",
|
|
63
93
|
title: "关闭数字人(Ctrl/Command + L 可再次打开)",
|
|
64
|
-
onClick: i[0] || (i[0] = (
|
|
94
|
+
onClick: i[0] || (i[0] = (n) => l("close"))
|
|
65
95
|
}, " × "),
|
|
66
|
-
e("div",
|
|
96
|
+
e("div", _, [
|
|
67
97
|
e("button", {
|
|
68
98
|
type: "button",
|
|
69
|
-
class:
|
|
70
|
-
"is-recording":
|
|
71
|
-
"is-transcribing":
|
|
99
|
+
class: k(["live2d-voice-button", {
|
|
100
|
+
"is-recording": p(s).recording,
|
|
101
|
+
"is-transcribing": p(s).transcribing
|
|
72
102
|
}]),
|
|
73
|
-
disabled:
|
|
74
|
-
"aria-label":
|
|
75
|
-
onClick:
|
|
76
|
-
}, [...i[
|
|
103
|
+
disabled: t.voiceDisabled || p(s).transcribing,
|
|
104
|
+
"aria-label": E.value,
|
|
105
|
+
onClick: N
|
|
106
|
+
}, [...i[4] || (i[4] = [
|
|
77
107
|
e("span", {
|
|
78
108
|
class: "live2d-voice-ring",
|
|
79
109
|
"aria-hidden": "true"
|
|
@@ -82,22 +112,97 @@ const F = { class: "live2d-panel-shell" }, G = { class: "live2d-voice-controls"
|
|
|
82
112
|
class: "live2d-mic-icon",
|
|
83
113
|
"aria-hidden": "true"
|
|
84
114
|
}, null, -1)
|
|
85
|
-
])], 10,
|
|
86
|
-
e("span",
|
|
87
|
-
|
|
115
|
+
])], 10, ee),
|
|
116
|
+
e("span", ie, d(E.value), 1),
|
|
117
|
+
t.phonePairAvailable ? (a(), r("button", {
|
|
118
|
+
key: 0,
|
|
119
|
+
type: "button",
|
|
120
|
+
class: k(["live2d-phone-button", { "is-connected": t.phoneConnected }]),
|
|
121
|
+
"aria-label": "用手机说话",
|
|
122
|
+
onClick: i[1] || (i[1] = (n) => l("phonePair"))
|
|
123
|
+
}, " 用手机说话 ", 2)) : u("", !0)
|
|
88
124
|
]),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
125
|
+
(a(), x(B, { to: "body" }, [
|
|
126
|
+
t.phonePairOpen ? (a(), r("div", {
|
|
127
|
+
key: 0,
|
|
128
|
+
class: "live2d-phone-overlay",
|
|
129
|
+
onClick: i[3] || (i[3] = D((n) => l("phonePairClose"), ["self"]))
|
|
130
|
+
}, [
|
|
131
|
+
e("div", te, [
|
|
132
|
+
e("header", oe, [
|
|
133
|
+
i[5] || (i[5] = e("div", { class: "live2d-phone-title-stack" }, [
|
|
134
|
+
e("span", { class: "live2d-phone-kicker" }, "Spotlight"),
|
|
135
|
+
e("span", { class: "live2d-phone-title" }, "手机遥控器")
|
|
136
|
+
], -1)),
|
|
137
|
+
e("button", {
|
|
138
|
+
type: "button",
|
|
139
|
+
class: "live2d-phone-close",
|
|
140
|
+
"aria-label": "关闭手机二维码",
|
|
141
|
+
onClick: i[2] || (i[2] = (n) => l("phonePairClose"))
|
|
142
|
+
}, " × ")
|
|
143
|
+
]),
|
|
144
|
+
i[6] || (i[6] = e("p", { class: "live2d-phone-hint" }, " 用手机扫码打开遥控器,即可对着手机说话控制大屏。微信扫完后请选「用浏览器打开」。 ", -1)),
|
|
145
|
+
e("div", le, [
|
|
146
|
+
e("button", {
|
|
147
|
+
type: "button",
|
|
148
|
+
class: "live2d-phone-primary",
|
|
149
|
+
disabled: !t.phonePairUrl,
|
|
150
|
+
onClick: $
|
|
151
|
+
}, " 本机打开遥控器 ", 8, ne),
|
|
152
|
+
e("button", {
|
|
153
|
+
type: "button",
|
|
154
|
+
class: "live2d-phone-secondary",
|
|
155
|
+
disabled: !t.phonePairUrl,
|
|
156
|
+
onClick: I
|
|
157
|
+
}, d(m.value ? "已复制" : "复制链接"), 9, ae)
|
|
158
|
+
]),
|
|
159
|
+
t.phonePairQr ? (a(), r("div", {
|
|
160
|
+
key: 0,
|
|
161
|
+
class: "live2d-phone-qr",
|
|
162
|
+
innerHTML: t.phonePairQr
|
|
163
|
+
}, null, 8, se)) : u("", !0),
|
|
164
|
+
e("p", re, d(t.phoneConnected ? "手机已连接,对着遥控器说话即可" : "等待遥控器连接"), 1)
|
|
165
|
+
])
|
|
166
|
+
])) : u("", !0)
|
|
167
|
+
])),
|
|
168
|
+
(a(), x(B, { to: "body" }, [
|
|
169
|
+
S.value ? (a(), r("div", {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: "live2d-notice-overlay",
|
|
172
|
+
onClick: D(L, ["self"])
|
|
173
|
+
}, [
|
|
174
|
+
e("div", de, [
|
|
175
|
+
i[7] || (i[7] = e("header", { class: "live2d-notice-header" }, [
|
|
176
|
+
e("div", { class: "live2d-phone-title-stack" }, [
|
|
177
|
+
e("span", { class: "live2d-phone-kicker" }, "Spotlight"),
|
|
178
|
+
e("span", {
|
|
179
|
+
id: "live2d-notice-title",
|
|
180
|
+
class: "live2d-phone-title"
|
|
181
|
+
}, "提示")
|
|
182
|
+
])
|
|
183
|
+
], -1)),
|
|
184
|
+
e("p", ce, d(S.value), 1),
|
|
185
|
+
e("button", {
|
|
186
|
+
type: "button",
|
|
187
|
+
class: "live2d-notice-ok",
|
|
188
|
+
autofocus: "",
|
|
189
|
+
onClick: L
|
|
190
|
+
}, " 知道了 ")
|
|
191
|
+
])
|
|
192
|
+
])) : u("", !0)
|
|
193
|
+
])),
|
|
194
|
+
q(R, { name: "speech-bubble" }, {
|
|
195
|
+
default: j(() => [
|
|
196
|
+
M.value ? (a(), r("div", {
|
|
92
197
|
key: 0,
|
|
93
|
-
class:
|
|
198
|
+
class: k(["live2d-speech-bubble", { "is-speaking": p(T) }])
|
|
94
199
|
}, [
|
|
95
|
-
e("div",
|
|
96
|
-
i[
|
|
97
|
-
e("span", null,
|
|
200
|
+
e("div", ve, [
|
|
201
|
+
i[8] || (i[8] = e("span", { class: "live2d-speech-dot" }, null, -1)),
|
|
202
|
+
e("span", null, d(p(C).bubbleTitle ?? "数字人"), 1)
|
|
98
203
|
]),
|
|
99
|
-
e("p",
|
|
100
|
-
], 2)) :
|
|
204
|
+
e("p", pe, d(c.value), 1)
|
|
205
|
+
], 2)) : u("", !0)
|
|
101
206
|
]),
|
|
102
207
|
_: 1
|
|
103
208
|
})
|
|
@@ -105,5 +210,5 @@ const F = { class: "live2d-panel-shell" }, G = { class: "live2d-voice-controls"
|
|
|
105
210
|
}
|
|
106
211
|
});
|
|
107
212
|
export {
|
|
108
|
-
|
|
213
|
+
ke as default
|
|
109
214
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotlightCommandPanel.vue.d.ts","sourceRoot":"","sources":["../../src/components/SpotlightCommandPanel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpotlightCommandPanel.vue.d.ts","sourceRoot":"","sources":["../../src/components/SpotlightCommandPanel.vue"],"names":[],"mappings":"AAqbA,KAAK,WAAW,GAAG;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAsEJ,iBAAS,UAAU,SAElB;AA8mBD,QAAA,MAAM,YAAY;;;gBA1rBD,MAAM;qBACD,OAAO;mBACT,OAAO;mBACP,MAAM;6EA2rBxB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SpotlightCommandPanel2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ec5c37ab"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|