@firetable/project-xiaochun 0.1.17 → 0.1.19
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-CN.md +9 -5
- package/README.md +9 -5
- package/dist/avatar-element.d.ts +3 -1
- package/dist/chunks/{chunk-BJF55B44.js → chunk-RTBOYZAZ.js} +6 -3
- package/dist/chunks/chunk-RTBOYZAZ.js.map +7 -0
- package/dist/chunks/{chunk-4RT7LXB5.js → chunk-SPCT7EQA.js} +10 -4
- package/dist/chunks/chunk-SPCT7EQA.js.map +7 -0
- package/dist/chunks/{chunk-6EHOJ2CJ.js → chunk-WYS3WVG4.js} +14 -3
- package/dist/chunks/chunk-WYS3WVG4.js.map +7 -0
- package/dist/client.d.ts +11 -1
- package/dist/element.cjs +18 -1
- package/dist/element.cjs.map +2 -2
- package/dist/element.js +4 -4
- package/dist/index.cjs +22 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +4 -4
- package/dist/loader.global.js +2 -2
- package/dist/loader.global.js.map +3 -3
- package/dist/protocol.cjs +5 -2
- package/dist/protocol.cjs.map +2 -2
- package/dist/protocol.d.ts +40 -5
- package/dist/protocol.js +2 -2
- package/dist/react.cjs +14 -1
- package/dist/react.cjs.map +2 -2
- package/dist/react.d.ts +4 -0
- package/dist/react.js +5 -3
- package/dist/react.js.map +2 -2
- package/package.json +1 -1
- package/dist/chunks/chunk-4RT7LXB5.js.map +0 -7
- package/dist/chunks/chunk-6EHOJ2CJ.js.map +0 -7
- package/dist/chunks/chunk-BJF55B44.js.map +0 -7
package/dist/element.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @firetable/project-xiaochun v0.1.
|
|
1
|
+
/*! @firetable/project-xiaochun v0.1.19 | MIT | https://github.com/FireTable/project-xiaochun */
|
|
2
2
|
import {
|
|
3
3
|
XIAOCHUN_ELEMENT_TAG,
|
|
4
4
|
defineXiaochunElement
|
|
5
|
-
} from "./chunks/chunk-
|
|
6
|
-
import "./chunks/chunk-
|
|
7
|
-
import "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-SPCT7EQA.js";
|
|
6
|
+
import "./chunks/chunk-WYS3WVG4.js";
|
|
7
|
+
import "./chunks/chunk-RTBOYZAZ.js";
|
|
8
8
|
|
|
9
9
|
// src/element.ts
|
|
10
10
|
defineXiaochunElement();
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @firetable/project-xiaochun v0.1.
|
|
1
|
+
/*! @firetable/project-xiaochun v0.1.19 | MIT | https://github.com/FireTable/project-xiaochun */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -77,6 +77,7 @@ var XC_HOST_TO_FRAME = [
|
|
|
77
77
|
"xc.prefetch",
|
|
78
78
|
"xc.setConfig",
|
|
79
79
|
"xc.mic",
|
|
80
|
+
"xc.transport",
|
|
80
81
|
"xc.pause",
|
|
81
82
|
"xc.resume",
|
|
82
83
|
"xc.destroy"
|
|
@@ -111,6 +112,7 @@ var XC_IMPLEMENTED_COMMANDS = [
|
|
|
111
112
|
"xc.prefetch",
|
|
112
113
|
"xc.setConfig",
|
|
113
114
|
"xc.mic",
|
|
115
|
+
"xc.transport",
|
|
114
116
|
"xc.pause",
|
|
115
117
|
"xc.resume",
|
|
116
118
|
"xc.destroy"
|
|
@@ -121,7 +123,8 @@ var XC_PROTOCOL_MAPPING = [
|
|
|
121
123
|
{ xc: "xc.say", note: 'mode:"chat" (\u8D70 LLM)', action: null, url: null },
|
|
122
124
|
{ xc: "xc.audio", note: "source \u4E3A URL \u5B57\u7B26\u4E32", action: "speak", url: "xiaochun://speak?audioUrl=\u2026[&text=\u2026]" },
|
|
123
125
|
{ xc: "xc.audio", note: "source \u4E3A ArrayBuffer / Blob", action: "audio", url: null },
|
|
124
|
-
{ xc: "xc.audio.chunk / xc.audio.end", note: "\u6D41\u5F0F PCM", action: "audio", url: null }
|
|
126
|
+
{ xc: "xc.audio.chunk / xc.audio.end", note: "\u6D41\u5F0F PCM", action: "audio", url: null },
|
|
127
|
+
{ xc: "xc.transport", note: "\u6539\u5BBF\u4E3B\u97F3\u9891\u500D\u901F / \u97F3\u91CF, \u65E0 deep link", action: null, url: null }
|
|
125
128
|
];
|
|
126
129
|
var XC_WINDOW_CORNER_RADIUS = 20;
|
|
127
130
|
var XC_UI_PARTS = ["chat", "bubble", "outfit", "scene", "lang", "github"];
|
|
@@ -618,6 +621,9 @@ function createXiaochun(options) {
|
|
|
618
621
|
body.text = rest.text;
|
|
619
622
|
body.motion = rest.motion;
|
|
620
623
|
body.lipsync = rest.lipsync;
|
|
624
|
+
body.audible = rest.audible;
|
|
625
|
+
body.playbackRate = rest.playbackRate;
|
|
626
|
+
body.volume = rest.volume;
|
|
621
627
|
done = send("xc.audio.chunk", body, true, [buf], id);
|
|
622
628
|
bindAbort(signal, id);
|
|
623
629
|
} else {
|
|
@@ -1263,6 +1269,14 @@ function createXiaochun(options) {
|
|
|
1263
1269
|
userPaused = false;
|
|
1264
1270
|
syncPause();
|
|
1265
1271
|
},
|
|
1272
|
+
setPlaybackRate(rate) {
|
|
1273
|
+
if (destroyed || typeof rate !== "number" || !Number.isFinite(rate)) return;
|
|
1274
|
+
postToFrame("xc.transport", { playbackRate: rate });
|
|
1275
|
+
},
|
|
1276
|
+
setVolume(volume) {
|
|
1277
|
+
if (destroyed || typeof volume !== "number" || !Number.isFinite(volume)) return;
|
|
1278
|
+
postToFrame("xc.transport", { volume });
|
|
1279
|
+
},
|
|
1266
1280
|
destroy() {
|
|
1267
1281
|
if (destroyed) return;
|
|
1268
1282
|
try {
|
|
@@ -1520,6 +1534,12 @@ function createElementClass() {
|
|
|
1520
1534
|
speakAudioStream(opts) {
|
|
1521
1535
|
return this.requireClient().speakAudioStream(opts);
|
|
1522
1536
|
}
|
|
1537
|
+
setPlaybackRate(rate) {
|
|
1538
|
+
this.client?.setPlaybackRate(rate);
|
|
1539
|
+
}
|
|
1540
|
+
setVolume(volume) {
|
|
1541
|
+
this.client?.setVolume(volume);
|
|
1542
|
+
}
|
|
1523
1543
|
motion(m) {
|
|
1524
1544
|
return this.requireClient().motion(m);
|
|
1525
1545
|
}
|