@gui-chat-plugin/avatar 0.0.1
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/README.md +98 -0
- package/dist/core/definition.d.ts +9 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/plugin.d.ts +10 -0
- package/dist/core/samples.d.ts +5 -0
- package/dist/core/types.d.ts +24 -0
- package/dist/core.cjs +1 -0
- package/dist/core.js +72 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +9 -0
- package/dist/react/Preview.d.ts +9 -0
- package/dist/react/View.d.ts +9 -0
- package/dist/react/index.d.ts +24 -0
- package/dist/react.cjs +6 -0
- package/dist/react.js +387 -0
- package/dist/style.css +1 -0
- package/dist/three-vrm.module-DJ7DURJm.js +27282 -0
- package/dist/three-vrm.module-FTOSkzpf.cjs +4752 -0
- package/dist/vue/Preview.vue.d.ts +7 -0
- package/dist/vue/View.vue.d.ts +9 -0
- package/dist/vue/index.d.ts +24 -0
- package/dist/vue.cjs +1 -0
- package/dist/vue.js +207 -0
- package/package.json +98 -0
package/dist/react.js
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { S as ae, P as ie, W as se, a as le, A as ce, D as ue, C as de, b as J, G as fe, V as me } from "./three-vrm.module-DJ7DURJm.js";
|
|
2
|
+
import { TOOL_NAME as he, pluginCore as pe } from "./core.js";
|
|
3
|
+
import { SAMPLES as ye, TOOL_DEFINITION as je, executeAvatar as Oe } from "./core.js";
|
|
4
|
+
import ge, { useRef as y, useState as ee, useEffect as Q, useCallback as I } from "react";
|
|
5
|
+
var X = { exports: {} }, V = {};
|
|
6
|
+
var re;
|
|
7
|
+
function ve() {
|
|
8
|
+
if (re) return V;
|
|
9
|
+
re = 1;
|
|
10
|
+
var u = /* @__PURE__ */ Symbol.for("react.transitional.element"), x = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
11
|
+
function s(P, c, p) {
|
|
12
|
+
var j = null;
|
|
13
|
+
if (p !== void 0 && (j = "" + p), c.key !== void 0 && (j = "" + c.key), "key" in c) {
|
|
14
|
+
p = {};
|
|
15
|
+
for (var g in c)
|
|
16
|
+
g !== "key" && (p[g] = c[g]);
|
|
17
|
+
} else p = c;
|
|
18
|
+
return c = p.ref, {
|
|
19
|
+
$$typeof: u,
|
|
20
|
+
type: P,
|
|
21
|
+
key: j,
|
|
22
|
+
ref: c !== void 0 ? c : null,
|
|
23
|
+
props: p
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return V.Fragment = x, V.jsx = s, V.jsxs = s, V;
|
|
27
|
+
}
|
|
28
|
+
var Y = {};
|
|
29
|
+
var te;
|
|
30
|
+
function xe() {
|
|
31
|
+
return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
32
|
+
function u(e) {
|
|
33
|
+
if (e == null) return null;
|
|
34
|
+
if (typeof e == "function")
|
|
35
|
+
return e.$$typeof === K ? null : e.displayName || e.name || null;
|
|
36
|
+
if (typeof e == "string") return e;
|
|
37
|
+
switch (e) {
|
|
38
|
+
case O:
|
|
39
|
+
return "Fragment";
|
|
40
|
+
case W:
|
|
41
|
+
return "Profiler";
|
|
42
|
+
case U:
|
|
43
|
+
return "StrictMode";
|
|
44
|
+
case m:
|
|
45
|
+
return "Suspense";
|
|
46
|
+
case C:
|
|
47
|
+
return "SuspenseList";
|
|
48
|
+
case n:
|
|
49
|
+
return "Activity";
|
|
50
|
+
}
|
|
51
|
+
if (typeof e == "object")
|
|
52
|
+
switch (typeof e.tag == "number" && console.error(
|
|
53
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
54
|
+
), e.$$typeof) {
|
|
55
|
+
case $:
|
|
56
|
+
return "Portal";
|
|
57
|
+
case l:
|
|
58
|
+
return e.displayName || "Context";
|
|
59
|
+
case G:
|
|
60
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
61
|
+
case f:
|
|
62
|
+
var r = e.render;
|
|
63
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
64
|
+
case t:
|
|
65
|
+
return r = e.displayName || null, r !== null ? r : u(e.type) || "Memo";
|
|
66
|
+
case T:
|
|
67
|
+
r = e._payload, e = e._init;
|
|
68
|
+
try {
|
|
69
|
+
return u(e(r));
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
function x(e) {
|
|
76
|
+
return "" + e;
|
|
77
|
+
}
|
|
78
|
+
function s(e) {
|
|
79
|
+
try {
|
|
80
|
+
x(e);
|
|
81
|
+
var r = !1;
|
|
82
|
+
} catch {
|
|
83
|
+
r = !0;
|
|
84
|
+
}
|
|
85
|
+
if (r) {
|
|
86
|
+
r = console;
|
|
87
|
+
var o = r.error, a = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
88
|
+
return o.call(
|
|
89
|
+
r,
|
|
90
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
91
|
+
a
|
|
92
|
+
), x(e);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function P(e) {
|
|
96
|
+
if (e === O) return "<>";
|
|
97
|
+
if (typeof e == "object" && e !== null && e.$$typeof === T)
|
|
98
|
+
return "<...>";
|
|
99
|
+
try {
|
|
100
|
+
var r = u(e);
|
|
101
|
+
return r ? "<" + r + ">" : "<...>";
|
|
102
|
+
} catch {
|
|
103
|
+
return "<...>";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function c() {
|
|
107
|
+
var e = S.A;
|
|
108
|
+
return e === null ? null : e.getOwner();
|
|
109
|
+
}
|
|
110
|
+
function p() {
|
|
111
|
+
return Error("react-stack-top-frame");
|
|
112
|
+
}
|
|
113
|
+
function j(e) {
|
|
114
|
+
if (v.call(e, "key")) {
|
|
115
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
116
|
+
if (r && r.isReactWarning) return !1;
|
|
117
|
+
}
|
|
118
|
+
return e.key !== void 0;
|
|
119
|
+
}
|
|
120
|
+
function g(e, r) {
|
|
121
|
+
function o() {
|
|
122
|
+
R || (R = !0, console.error(
|
|
123
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
124
|
+
r
|
|
125
|
+
));
|
|
126
|
+
}
|
|
127
|
+
o.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
128
|
+
get: o,
|
|
129
|
+
configurable: !0
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function E() {
|
|
133
|
+
var e = u(this.type);
|
|
134
|
+
return N[e] || (N[e] = !0, console.error(
|
|
135
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
136
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
137
|
+
}
|
|
138
|
+
function d(e, r, o, a, q, H) {
|
|
139
|
+
var i = o.ref;
|
|
140
|
+
return e = {
|
|
141
|
+
$$typeof: F,
|
|
142
|
+
type: e,
|
|
143
|
+
key: r,
|
|
144
|
+
props: o,
|
|
145
|
+
_owner: a
|
|
146
|
+
}, (i !== void 0 ? i : null) !== null ? Object.defineProperty(e, "ref", {
|
|
147
|
+
enumerable: !1,
|
|
148
|
+
get: E
|
|
149
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
150
|
+
configurable: !1,
|
|
151
|
+
enumerable: !1,
|
|
152
|
+
writable: !0,
|
|
153
|
+
value: 0
|
|
154
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
155
|
+
configurable: !1,
|
|
156
|
+
enumerable: !1,
|
|
157
|
+
writable: !0,
|
|
158
|
+
value: null
|
|
159
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
160
|
+
configurable: !1,
|
|
161
|
+
enumerable: !1,
|
|
162
|
+
writable: !0,
|
|
163
|
+
value: q
|
|
164
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
165
|
+
configurable: !1,
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: H
|
|
169
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
170
|
+
}
|
|
171
|
+
function A(e, r, o, a, q, H) {
|
|
172
|
+
var i = r.children;
|
|
173
|
+
if (i !== void 0)
|
|
174
|
+
if (a)
|
|
175
|
+
if (M(i)) {
|
|
176
|
+
for (a = 0; a < i.length; a++)
|
|
177
|
+
L(i[a]);
|
|
178
|
+
Object.freeze && Object.freeze(i);
|
|
179
|
+
} else
|
|
180
|
+
console.error(
|
|
181
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
182
|
+
);
|
|
183
|
+
else L(i);
|
|
184
|
+
if (v.call(r, "key")) {
|
|
185
|
+
i = u(e);
|
|
186
|
+
var D = Object.keys(r).filter(function(oe) {
|
|
187
|
+
return oe !== "key";
|
|
188
|
+
});
|
|
189
|
+
a = 0 < D.length ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}", B[i + a] || (D = 0 < D.length ? "{" + D.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
190
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
191
|
+
let props = %s;
|
|
192
|
+
<%s {...props} />
|
|
193
|
+
React keys must be passed directly to JSX without using spread:
|
|
194
|
+
let props = %s;
|
|
195
|
+
<%s key={someKey} {...props} />`,
|
|
196
|
+
a,
|
|
197
|
+
i,
|
|
198
|
+
D,
|
|
199
|
+
i
|
|
200
|
+
), B[i + a] = !0);
|
|
201
|
+
}
|
|
202
|
+
if (i = null, o !== void 0 && (s(o), i = "" + o), j(r) && (s(r.key), i = "" + r.key), "key" in r) {
|
|
203
|
+
o = {};
|
|
204
|
+
for (var Z in r)
|
|
205
|
+
Z !== "key" && (o[Z] = r[Z]);
|
|
206
|
+
} else o = r;
|
|
207
|
+
return i && g(
|
|
208
|
+
o,
|
|
209
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
210
|
+
), d(
|
|
211
|
+
e,
|
|
212
|
+
i,
|
|
213
|
+
o,
|
|
214
|
+
c(),
|
|
215
|
+
q,
|
|
216
|
+
H
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
function L(e) {
|
|
220
|
+
z(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? z(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
221
|
+
}
|
|
222
|
+
function z(e) {
|
|
223
|
+
return typeof e == "object" && e !== null && e.$$typeof === F;
|
|
224
|
+
}
|
|
225
|
+
var k = ge, F = /* @__PURE__ */ Symbol.for("react.transitional.element"), $ = /* @__PURE__ */ Symbol.for("react.portal"), O = /* @__PURE__ */ Symbol.for("react.fragment"), U = /* @__PURE__ */ Symbol.for("react.strict_mode"), W = /* @__PURE__ */ Symbol.for("react.profiler"), G = /* @__PURE__ */ Symbol.for("react.consumer"), l = /* @__PURE__ */ Symbol.for("react.context"), f = /* @__PURE__ */ Symbol.for("react.forward_ref"), m = /* @__PURE__ */ Symbol.for("react.suspense"), C = /* @__PURE__ */ Symbol.for("react.suspense_list"), t = /* @__PURE__ */ Symbol.for("react.memo"), T = /* @__PURE__ */ Symbol.for("react.lazy"), n = /* @__PURE__ */ Symbol.for("react.activity"), K = /* @__PURE__ */ Symbol.for("react.client.reference"), S = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, M = Array.isArray, b = console.createTask ? console.createTask : function() {
|
|
226
|
+
return null;
|
|
227
|
+
};
|
|
228
|
+
k = {
|
|
229
|
+
react_stack_bottom_frame: function(e) {
|
|
230
|
+
return e();
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
var R, N = {}, _ = k.react_stack_bottom_frame.bind(
|
|
234
|
+
k,
|
|
235
|
+
p
|
|
236
|
+
)(), w = b(P(p)), B = {};
|
|
237
|
+
Y.Fragment = O, Y.jsx = function(e, r, o) {
|
|
238
|
+
var a = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
239
|
+
return A(
|
|
240
|
+
e,
|
|
241
|
+
r,
|
|
242
|
+
o,
|
|
243
|
+
!1,
|
|
244
|
+
a ? Error("react-stack-top-frame") : _,
|
|
245
|
+
a ? b(P(e)) : w
|
|
246
|
+
);
|
|
247
|
+
}, Y.jsxs = function(e, r, o) {
|
|
248
|
+
var a = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
249
|
+
return A(
|
|
250
|
+
e,
|
|
251
|
+
r,
|
|
252
|
+
o,
|
|
253
|
+
!0,
|
|
254
|
+
a ? Error("react-stack-top-frame") : _,
|
|
255
|
+
a ? b(P(e)) : w
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
})()), Y;
|
|
259
|
+
}
|
|
260
|
+
var ne;
|
|
261
|
+
function Ee() {
|
|
262
|
+
return ne || (ne = 1, process.env.NODE_ENV === "production" ? X.exports = ve() : X.exports = xe()), X.exports;
|
|
263
|
+
}
|
|
264
|
+
var h = Ee();
|
|
265
|
+
function be({ selectedResult: u, isAudioPlaying: x }) {
|
|
266
|
+
const s = y(null), [P, c] = ee(!1), [p, j] = ee(null), g = y(null), E = y(null), d = y(null), A = y(null), L = y(null), z = y(null), k = y(0), F = y(x);
|
|
267
|
+
Q(() => {
|
|
268
|
+
F.current = x;
|
|
269
|
+
}, [x]);
|
|
270
|
+
const $ = I(() => {
|
|
271
|
+
if (!s.current) return;
|
|
272
|
+
const l = s.current, f = l.clientWidth, m = l.clientHeight;
|
|
273
|
+
g.current = new ae(), E.current = new ie(30, f / m, 0.1, 100), E.current.position.set(0, 1.3, 1.5), E.current.lookAt(0, 1.2, 0), d.current = new se({ antialias: !0, alpha: !0 }), d.current.setSize(f, m), d.current.setPixelRatio(window.devicePixelRatio), d.current.outputColorSpace = le, l.appendChild(d.current.domElement);
|
|
274
|
+
const C = new ce(16777215, 0.6);
|
|
275
|
+
g.current.add(C);
|
|
276
|
+
const t = new ue(16777215, 0.8);
|
|
277
|
+
t.position.set(1, 1, 1), g.current.add(t), L.current = new de();
|
|
278
|
+
}, []), O = I(() => {
|
|
279
|
+
if (!s.current || !E.current || !d.current) return;
|
|
280
|
+
const l = s.current.clientWidth, f = s.current.clientHeight;
|
|
281
|
+
E.current.aspect = l / f, E.current.updateProjectionMatrix(), d.current.setSize(l, f);
|
|
282
|
+
}, []), U = I(() => {
|
|
283
|
+
z.current = requestAnimationFrame(U);
|
|
284
|
+
const l = L.current, f = d.current, m = g.current, C = E.current, t = A.current;
|
|
285
|
+
if (!l || !f || !m || !C) return;
|
|
286
|
+
const T = l.getDelta(), n = l.getElapsedTime();
|
|
287
|
+
if (t) {
|
|
288
|
+
if (t.update(T), F.current) {
|
|
289
|
+
k.current += T * 10;
|
|
290
|
+
const S = (Math.sin(k.current) + 1) * 0.3;
|
|
291
|
+
t.expressionManager?.setValue(J.Aa, S);
|
|
292
|
+
const v = t.humanoid?.getNormalizedBoneNode("head"), M = t.humanoid?.getNormalizedBoneNode("neck"), b = t.humanoid?.getNormalizedBoneNode("spine");
|
|
293
|
+
k.current < 0.2 && console.log("[Avatar Debug] Body animation - Bones found:", {
|
|
294
|
+
head: !!v,
|
|
295
|
+
neck: !!M,
|
|
296
|
+
spine: !!b,
|
|
297
|
+
humanoid: !!t.humanoid
|
|
298
|
+
}), v && (v.rotation.x = Math.sin(n * 2) * 0.08, v.rotation.z = Math.sin(n * 1.5) * 0.05), M && (M.rotation.y = Math.sin(n * 0.8) * 0.05), b && (b.rotation.z = Math.sin(n * 0.5) * 0.03);
|
|
299
|
+
const R = t.humanoid?.getNormalizedBoneNode("leftShoulder"), N = t.humanoid?.getNormalizedBoneNode("rightShoulder"), _ = t.humanoid?.getNormalizedBoneNode("leftUpperArm"), w = t.humanoid?.getNormalizedBoneNode("rightUpperArm"), B = t.humanoid?.getNormalizedBoneNode("leftLowerArm"), e = t.humanoid?.getNormalizedBoneNode("rightLowerArm");
|
|
300
|
+
R && (R.rotation.z = 0.1), N && (N.rotation.z = -0.1), _ && (_.rotation.z = -0.8 + Math.sin(n * 1.2) * 0.1, _.rotation.x = 0.4 + Math.sin(n * 0.9) * 0.15, _.rotation.y = Math.sin(n * 0.7) * 0.1), w && (w.rotation.z = 0.8 + Math.sin(n * 1.3) * 0.1, w.rotation.x = 0.4 + Math.sin(n * 1) * 0.15, w.rotation.y = Math.sin(n * 0.8) * 0.1), B && (B.rotation.y = -1 - Math.sin(n * 1.5) * 0.2, B.rotation.z = Math.sin(n * 1.1) * 0.1), e && (e.rotation.y = 1 + Math.sin(n * 1.4) * 0.2, e.rotation.z = Math.sin(n * 1.2) * 0.1);
|
|
301
|
+
} else {
|
|
302
|
+
k.current = 0, t.expressionManager?.setValue(J.Aa, 0);
|
|
303
|
+
const S = t.humanoid?.getNormalizedBoneNode("spine"), v = t.humanoid?.getNormalizedBoneNode("head");
|
|
304
|
+
Math.floor(n) % 5 === 0 && n - Math.floor(n) < T && console.log("[Avatar Debug] Idle animation - Bones found:", {
|
|
305
|
+
head: !!v,
|
|
306
|
+
neck: !!t.humanoid?.getNormalizedBoneNode("neck"),
|
|
307
|
+
spine: !!S
|
|
308
|
+
}), S && (S.rotation.x = Math.sin(n * 0.8) * 0.02), v && (v.rotation.x = Math.sin(n * 0.3) * 0.03, v.rotation.z = Math.sin(n * 0.2) * 0.02);
|
|
309
|
+
const M = t.humanoid?.getNormalizedBoneNode("leftShoulder"), b = t.humanoid?.getNormalizedBoneNode("rightShoulder"), R = t.humanoid?.getNormalizedBoneNode("leftUpperArm"), N = t.humanoid?.getNormalizedBoneNode("rightUpperArm"), _ = t.humanoid?.getNormalizedBoneNode("leftLowerArm"), w = t.humanoid?.getNormalizedBoneNode("rightLowerArm");
|
|
310
|
+
M && (M.rotation.z = 0.1), b && (b.rotation.z = -0.1), R && (R.rotation.z = -0.9, R.rotation.x = 0.2, R.rotation.y = 0), N && (N.rotation.z = 0.9, N.rotation.x = 0.2, N.rotation.y = 0), _ && (_.rotation.y = -0.8), w && (w.rotation.y = 0.8);
|
|
311
|
+
}
|
|
312
|
+
n % 4 < 0.1 ? t.expressionManager?.setValue(J.Blink, 1) : t.expressionManager?.setValue(J.Blink, 0);
|
|
313
|
+
}
|
|
314
|
+
f.render(m, C);
|
|
315
|
+
}, []), W = I(async (l) => {
|
|
316
|
+
const f = g.current;
|
|
317
|
+
if (f) {
|
|
318
|
+
c(!0), j(null), A.current && (f.remove(A.current.scene), A.current = null);
|
|
319
|
+
try {
|
|
320
|
+
const m = new fe();
|
|
321
|
+
m.register((T) => new me(T));
|
|
322
|
+
const t = (await m.loadAsync(l)).userData.vrm;
|
|
323
|
+
if (!t)
|
|
324
|
+
throw new Error("Failed to load VRM data");
|
|
325
|
+
f.add(t.scene), A.current = t, c(!1);
|
|
326
|
+
} catch (m) {
|
|
327
|
+
console.error("Failed to load VRM:", m), j(`Failed to load avatar: ${m instanceof Error ? m.message : "Unknown error"}`), c(!1);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}, []), G = I(() => {
|
|
331
|
+
z.current !== null && (cancelAnimationFrame(z.current), z.current = null), window.removeEventListener("resize", O), d.current && s.current && (s.current.removeChild(d.current.domElement), d.current.dispose(), d.current = null), A.current = null, g.current = null, E.current = null, L.current = null;
|
|
332
|
+
}, [O]);
|
|
333
|
+
return Q(() => ($(), window.addEventListener("resize", O), U(), () => {
|
|
334
|
+
G();
|
|
335
|
+
}), [$, O, U, G]), Q(() => {
|
|
336
|
+
if (u?.toolName === he && u.data) {
|
|
337
|
+
const l = u.data;
|
|
338
|
+
l.avatarUrl && W(l.avatarUrl);
|
|
339
|
+
}
|
|
340
|
+
}, [u, W]), /* @__PURE__ */ h.jsxs("div", { className: "w-full h-full bg-gradient-to-b from-slate-800 to-slate-900 relative", children: [
|
|
341
|
+
/* @__PURE__ */ h.jsx("div", { ref: s, className: "w-full h-full" }),
|
|
342
|
+
P && /* @__PURE__ */ h.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-slate-900/80", children: /* @__PURE__ */ h.jsx("div", { className: "text-white text-lg", children: "Loading Avatar..." }) }),
|
|
343
|
+
p && /* @__PURE__ */ h.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-slate-900/80", children: /* @__PURE__ */ h.jsx("div", { className: "text-red-400 text-lg text-center p-4", children: p }) }),
|
|
344
|
+
x && /* @__PURE__ */ h.jsx("div", { className: "absolute top-4 right-4 px-3 py-1 bg-green-600 text-white text-sm rounded-full", children: "Speaking..." })
|
|
345
|
+
] });
|
|
346
|
+
}
|
|
347
|
+
function Re({ result: u }) {
|
|
348
|
+
const s = u.data?.emotion || "neutral";
|
|
349
|
+
return /* @__PURE__ */ h.jsx("div", { className: "p-3 bg-gradient-to-br from-slate-700 to-slate-800 rounded-md", children: /* @__PURE__ */ h.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
350
|
+
/* @__PURE__ */ h.jsx("div", { className: "w-12 h-12 bg-slate-600 rounded-full flex items-center justify-center", children: /* @__PURE__ */ h.jsx(
|
|
351
|
+
"svg",
|
|
352
|
+
{
|
|
353
|
+
className: "w-8 h-8 text-slate-300",
|
|
354
|
+
fill: "none",
|
|
355
|
+
stroke: "currentColor",
|
|
356
|
+
viewBox: "0 0 24 24",
|
|
357
|
+
children: /* @__PURE__ */ h.jsx(
|
|
358
|
+
"path",
|
|
359
|
+
{
|
|
360
|
+
strokeLinecap: "round",
|
|
361
|
+
strokeLinejoin: "round",
|
|
362
|
+
strokeWidth: 2,
|
|
363
|
+
d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
}
|
|
367
|
+
) }),
|
|
368
|
+
/* @__PURE__ */ h.jsx("div", { className: "text-sm font-semibold text-white text-center", children: "3D Avatar" }),
|
|
369
|
+
s !== "neutral" && /* @__PURE__ */ h.jsx("div", { className: "text-xs px-2 py-0.5 bg-blue-500 text-white rounded-full", children: s })
|
|
370
|
+
] }) });
|
|
371
|
+
}
|
|
372
|
+
const Ne = {
|
|
373
|
+
...pe,
|
|
374
|
+
ViewComponent: be,
|
|
375
|
+
PreviewComponent: Re
|
|
376
|
+
}, ke = { plugin: Ne };
|
|
377
|
+
export {
|
|
378
|
+
Re as Preview,
|
|
379
|
+
ye as SAMPLES,
|
|
380
|
+
je as TOOL_DEFINITION,
|
|
381
|
+
he as TOOL_NAME,
|
|
382
|
+
be as View,
|
|
383
|
+
ke as default,
|
|
384
|
+
Oe as executeAvatar,
|
|
385
|
+
Ne as plugin,
|
|
386
|
+
pe as pluginCore
|
|
387
|
+
};
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-400:oklch(70.4% .191 22.216);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-600:oklch(66.6% .179 58.318);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-blue-50:oklch(97% .014 254.604);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.contents{display:contents}.flex{display:flex}.grid{display:grid}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-12{width:calc(var(--spacing)*12);height:calc(var(--spacing)*12)}.size-full{width:100%;height:100%}.h-4{height:calc(var(--spacing)*4)}.h-8{height:calc(var(--spacing)*8)}.h-12{height:calc(var(--spacing)*12)}.h-\[400px\]{height:400px}.h-\[600px\]{height:600px}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing)*4)}.w-8{width:calc(var(--spacing)*8)}.w-12{width:calc(var(--spacing)*12)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[85\%\]{max-width:85%}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[\#3d3d5c\]{border-color:#3d3d5c}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-\[\#1a1a2e\]{background-color:#1a1a2e}.bg-\[\#2d2d44\]{background-color:#2d2d44}.bg-amber-50{background-color:var(--color-amber-50)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-600{background-color:var(--color-green-600)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-red-100{background-color:var(--color-red-100)}.bg-slate-600{background-color:var(--color-slate-600)}.bg-slate-900\/80{background-color:#0f172bcc}@supports (color:color-mix(in lab,red,red)){.bg-slate-900\/80{background-color:color-mix(in oklab,var(--color-slate-900)80%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-slate-700{--tw-gradient-from:var(--color-slate-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-slate-800{--tw-gradient-from:var(--color-slate-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-slate-800{--tw-gradient-to:var(--color-slate-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-slate-900{--tw-gradient-to:var(--color-slate-900);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#f0f0f0\]{color:#f0f0f0}.text-amber-600{color:var(--color-amber-600)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-400{color:var(--color-red-400)}.text-red-700{color:var(--color-red-700)}.text-slate-300{color:var(--color-slate-300)}.text-white{color:var(--color-white)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-green-500:focus{--tw-ring-color:var(--color-green-500)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-100:disabled{background-color:var(--color-gray-100)}.disabled\:bg-gray-400:disabled{background-color:var(--color-gray-400)}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}}body{margin:calc(var(--spacing)*0);background-color:var(--color-gray-100);padding:calc(var(--spacing)*5);font-family:var(--font-sans)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes pulse{50%{opacity:.5}}
|