dsh-xiaomi-tts 3.0.2 → 3.0.3
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.en.md +13 -5
- package/README.md +16 -11
- package/assets/ui/sound-effects-toggle-characters.webp +0 -0
- package/lib/client/conversation/read-aloud.d.ts.map +1 -1
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/localization.d.ts +15 -3
- package/lib/client/localization.d.ts.map +1 -1
- package/lib/client/playback/live-speech-controller.d.ts +2 -0
- package/lib/client/playback/live-speech-controller.d.ts.map +1 -1
- package/lib/client/playback/local-speech-controller.d.ts +3 -0
- package/lib/client/playback/local-speech-controller.d.ts.map +1 -1
- package/lib/client/playback/pcm-audio-queue.d.ts +2 -0
- package/lib/client/playback/pcm-audio-queue.d.ts.map +1 -1
- package/lib/client/playback/pcm-play-service.d.ts.map +1 -1
- package/lib/client/playback/playback-controller.d.ts +3 -1
- package/lib/client/playback/playback-controller.d.ts.map +1 -1
- package/lib/client/playback/preview-player.d.ts +3 -3
- package/lib/client/playback/preview-player.d.ts.map +1 -1
- package/lib/client/playback/voice-rate.d.ts +5 -0
- package/lib/client/playback/voice-rate.d.ts.map +1 -0
- package/lib/client/settings/card.d.ts.map +1 -1
- package/lib/client/settings/controls/energy-volume-slider.d.ts +6 -2
- package/lib/client/settings/controls/energy-volume-slider.d.ts.map +1 -1
- package/lib/client/settings/details-module.d.ts +7 -6
- package/lib/client/settings/details-module.d.ts.map +1 -1
- package/lib/client/settings/scope.d.ts.map +1 -1
- package/lib/client/settings/sound-effects-module.d.ts.map +1 -1
- package/lib/client/settings/switch-module.d.ts +3 -1
- package/lib/client/settings/switch-module.d.ts.map +1 -1
- package/lib/client/settings/types.d.ts +1 -1
- package/lib/client/settings/types.d.ts.map +1 -1
- package/lib/client/sound-effects/click-classifier.d.ts.map +1 -1
- package/lib/client/sound-effects/types.d.ts +4 -1
- package/lib/client/sound-effects/types.d.ts.map +1 -1
- package/lib/client.js +455 -244
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +27 -2
- package/lib/pcm-stream.js +1 -1
- package/lib/{shared-DDS4h0Vc.js → shared-DJtQ85KH.js} +41 -5
- package/lib/shared.d.ts +26 -4
- package/lib/shared.d.ts.map +1 -1
- package/lib/shared.js +2 -2
- package/package.json +18 -1
package/lib/client.js
CHANGED
|
@@ -79,6 +79,8 @@ const TTS_VOICE_DESIGN_ASSET_ROUTE = "/plugins/xiaomi-mimo-tts/voice-presets";
|
|
|
79
79
|
const TTS_VOICE_ASSET_ROUTE = "/plugins/xiaomi-mimo-tts/voice-avatars";
|
|
80
80
|
/** Same-origin route used by the Web client to load the four-state character toggle sheet. */
|
|
81
81
|
const TTS_TOGGLE_CHARACTER_ASSET_ROUTE = "/plugins/xiaomi-mimo-tts/toggle-characters.webp";
|
|
82
|
+
/** Same-origin route used by the Web client to load the two-state sound-effects character sheet. */
|
|
83
|
+
const TTS_SOUND_EFFECTS_CHARACTER_ASSET_ROUTE = "/plugins/xiaomi-mimo-tts/sound-effects-toggle-characters.webp";
|
|
82
84
|
/** Same-origin route used by the Web client to load the API-key whale mascot sheet. */
|
|
83
85
|
const TTS_API_KEY_WHALE_ASSET_ROUTE = "/plugins/xiaomi-mimo-tts/api-key-whale.webp";
|
|
84
86
|
/** Same-origin route used by the Web client to load the mixing-console whale mascot sheet. */
|
|
@@ -250,9 +252,15 @@ const TTS_VOICE_DESIGN_PLAYBACK_MODES = [
|
|
|
250
252
|
"segmented",
|
|
251
253
|
"first-segment"
|
|
252
254
|
];
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
|
|
255
|
+
/** User-facing read range, independent from the audio transport selected by the client. */
|
|
256
|
+
const TTS_READ_SCOPES = [
|
|
257
|
+
"smart",
|
|
258
|
+
"full",
|
|
259
|
+
"first-segment"
|
|
260
|
+
];
|
|
261
|
+
const DEFAULT_TTS_SEGMENT_CHARACTERS = 160;
|
|
262
|
+
const MAX_TTS_SEGMENT_CHARACTERS = 240;
|
|
263
|
+
const MIN_TTS_SEGMENT_CHARACTERS = 50;
|
|
256
264
|
/** Minimum spoken characters to accumulate before starting one PCM stream request. */
|
|
257
265
|
const MIN_TTS_STREAM_CHARACTERS = 20;
|
|
258
266
|
/** Maximum decoded complete MP3 payload accepted from Xiaomi MiMo. */
|
|
@@ -431,6 +439,25 @@ function splitTtsSegments(value, target = DEFAULT_TTS_SEGMENT_CHARACTERS, maximu
|
|
|
431
439
|
function firstTtsSegment(value) {
|
|
432
440
|
return splitTtsSegments(value)[0] ?? "";
|
|
433
441
|
}
|
|
442
|
+
/** Resolve Smart into a concrete range for this playback invocation. */
|
|
443
|
+
function resolveTtsReadScope(scope, automatic) {
|
|
444
|
+
return scope === "first-segment" || scope === "smart" && automatic ? "first-segment" : "full";
|
|
445
|
+
}
|
|
446
|
+
/** Apply a concrete read range to already-filtered speech text. */
|
|
447
|
+
function applyTtsReadScope(value, scope) {
|
|
448
|
+
return scope === "first-segment" ? firstTtsSegment(value) : value;
|
|
449
|
+
}
|
|
450
|
+
/** Keep the first semantic segment monotonic while an assistant reply is growing. */
|
|
451
|
+
var TtsFirstSegmentLimiter = class {
|
|
452
|
+
locked = null;
|
|
453
|
+
limit(value, final = false) {
|
|
454
|
+
if (this.locked !== null) return this.locked;
|
|
455
|
+
const candidate = firstTtsSegment(value);
|
|
456
|
+
if (candidate.length === 0) return "";
|
|
457
|
+
if (final || countTtsSpeechCharacters(candidate) >= DEFAULT_TTS_SEGMENT_CHARACTERS) this.locked = candidate;
|
|
458
|
+
return candidate;
|
|
459
|
+
}
|
|
460
|
+
};
|
|
434
461
|
/** Accumulate short sentences so a PCM stream has enough text to sound natural. */
|
|
435
462
|
function batchTtsStreamText(pending, next, flush) {
|
|
436
463
|
const combined = `${pending}${next}`;
|
|
@@ -523,6 +550,7 @@ const DEFAULT_TTS_SETTINGS = {
|
|
|
523
550
|
presetStylePrompt: "使用清晰、自然、准确的声音朗读,语速适中,停顿自然,语气平和克制,避免夸张表达。",
|
|
524
551
|
format: "pcm",
|
|
525
552
|
voiceDesignPlaybackMode: "complete",
|
|
553
|
+
readScope: "smart",
|
|
526
554
|
autoPlay: true,
|
|
527
555
|
instruction: "请忠实朗读原文,根据文本语气自然表达,不添加或改写内容。",
|
|
528
556
|
maxTextLength: 12e3,
|
|
@@ -531,6 +559,7 @@ const DEFAULT_TTS_SETTINGS = {
|
|
|
531
559
|
maxWavAudioBytes: DEFAULT_MAX_WAV_AUDIO_BYTES,
|
|
532
560
|
maxPausedPcmBytes: DEFAULT_MAX_PAUSED_PCM_BYTES,
|
|
533
561
|
voiceVolume: 1,
|
|
562
|
+
voiceRate: 1,
|
|
534
563
|
...DEFAULT_SOUND_SETTINGS
|
|
535
564
|
};
|
|
536
565
|
/** Whether an API key selects one of the Xiaomi endpoints supported by this plugin. */
|
|
@@ -539,6 +568,9 @@ function isSupportedTtsApiKey(apiKey) {
|
|
|
539
568
|
return normalized.startsWith("sk-") || normalized.startsWith("tp-");
|
|
540
569
|
}
|
|
541
570
|
/** Resolve an optional settings snapshot into the values used by the form. */
|
|
571
|
+
function normalizeVoiceRate(value) {
|
|
572
|
+
return Number.isFinite(value) ? Math.round(Math.max(.5, Math.min(2, value)) * 10) / 10 : 1;
|
|
573
|
+
}
|
|
542
574
|
function resolveTtsSettings(value) {
|
|
543
575
|
const resolved = {
|
|
544
576
|
...DEFAULT_TTS_SETTINGS,
|
|
@@ -546,6 +578,8 @@ function resolveTtsSettings(value) {
|
|
|
546
578
|
};
|
|
547
579
|
const soundVolume = Number.isFinite(resolved.soundVolume) ? Math.max(0, Math.min(1, resolved.soundVolume)) : DEFAULT_SOUND_SETTINGS.soundVolume;
|
|
548
580
|
const voiceVolume = Number.isFinite(resolved.voiceVolume) ? Math.max(0, Math.min(1, resolved.voiceVolume)) : DEFAULT_TTS_SETTINGS.voiceVolume;
|
|
581
|
+
const voiceRate = normalizeVoiceRate(resolved.voiceRate);
|
|
582
|
+
const readScope = value?.readScope !== void 0 && TTS_READ_SCOPES.includes(value.readScope) ? value.readScope : value?.voiceDesignPlaybackMode === "first-segment" ? "first-segment" : DEFAULT_TTS_SETTINGS.readScope;
|
|
549
583
|
const model = resolved.model === "browser-local-fallback" ? "mimo-v2.5-tts" : resolved.model;
|
|
550
584
|
const voiceDesignCustomPrompt = typeof value?.voiceDesignCustomPrompt === "string" ? value.voiceDesignCustomPrompt : TTS_VOICE_DESIGN_PRESETS.some((item) => item.prompt === resolved.voiceDesignPrompt) ? DEFAULT_TTS_SETTINGS.voiceDesignCustomPrompt : resolved.voiceDesignPrompt;
|
|
551
585
|
return {
|
|
@@ -555,6 +589,8 @@ function resolveTtsSettings(value) {
|
|
|
555
589
|
autoPlay: resolved.enabled ? resolved.autoPlay : false,
|
|
556
590
|
soundVolume,
|
|
557
591
|
voiceVolume,
|
|
592
|
+
voiceRate,
|
|
593
|
+
readScope,
|
|
558
594
|
soundPack: SOUND_PACKS.includes(resolved.soundPack) ? resolved.soundPack : DEFAULT_SOUND_SETTINGS.soundPack
|
|
559
595
|
};
|
|
560
596
|
}
|
|
@@ -651,6 +687,22 @@ async function streamPcmAudio(text, signal, consume) {
|
|
|
651
687
|
});
|
|
652
688
|
}
|
|
653
689
|
|
|
690
|
+
//#endregion
|
|
691
|
+
//#region src/client/playback/voice-rate.ts
|
|
692
|
+
function applyMediaVoiceRate(media, voiceRate) {
|
|
693
|
+
media.playbackRate = voiceRate;
|
|
694
|
+
media.preservesPitch = true;
|
|
695
|
+
}
|
|
696
|
+
function applyPcmVoiceRate(source, voiceRate) {
|
|
697
|
+
source.playbackRate.value = voiceRate;
|
|
698
|
+
}
|
|
699
|
+
function applySpeechVoiceRate(utterance, voiceRate) {
|
|
700
|
+
utterance.rate = voiceRate;
|
|
701
|
+
}
|
|
702
|
+
function pcmPlaybackDuration(duration, voiceRate) {
|
|
703
|
+
return duration / voiceRate;
|
|
704
|
+
}
|
|
705
|
+
|
|
654
706
|
//#endregion
|
|
655
707
|
//#region src/client/playback/pcm-audio-queue.ts
|
|
656
708
|
var PcmAudioQueue = class {
|
|
@@ -658,6 +710,7 @@ var PcmAudioQueue = class {
|
|
|
658
710
|
context = null;
|
|
659
711
|
gain = null;
|
|
660
712
|
volume = 1;
|
|
713
|
+
playbackRate = 1;
|
|
661
714
|
scheduledAt = 0;
|
|
662
715
|
sources = /* @__PURE__ */ new Set();
|
|
663
716
|
sourceBytes = /* @__PURE__ */ new Map();
|
|
@@ -683,6 +736,9 @@ var PcmAudioQueue = class {
|
|
|
683
736
|
gain.gain.setValueAtTime(gain.gain.value, now);
|
|
684
737
|
gain.gain.linearRampToValueAtTime(this.volume, now + .02);
|
|
685
738
|
}
|
|
739
|
+
setPlaybackRate(value) {
|
|
740
|
+
this.playbackRate = normalizeVoiceRate(value);
|
|
741
|
+
}
|
|
686
742
|
async pause() {
|
|
687
743
|
this.userPaused = true;
|
|
688
744
|
if (this.context !== null && this.context.state === "running") await this.context.suspend();
|
|
@@ -757,13 +813,15 @@ var PcmAudioQueue = class {
|
|
|
757
813
|
for (let index = 0; index < sampleCount; index += 1) channel[index] = pcm.getInt16(index * 2, true) / 32768;
|
|
758
814
|
const source = context.createBufferSource();
|
|
759
815
|
source.buffer = buffer;
|
|
816
|
+
applyPcmVoiceRate(source, this.playbackRate);
|
|
760
817
|
source.connect(this.getGain(context));
|
|
761
818
|
const startAt = Math.max(context.currentTime + .03, this.scheduledAt);
|
|
762
|
-
this.scheduledAt = startAt + buffer.duration;
|
|
819
|
+
this.scheduledAt = startAt + pcmPlaybackDuration(buffer.duration, this.playbackRate);
|
|
763
820
|
debugConsole?.info(this.logPrefix, "[调度] 准备播放 PCM", {
|
|
764
821
|
bytes: bytes.byteLength,
|
|
765
822
|
samples: sampleCount,
|
|
766
823
|
duration: buffer.duration,
|
|
824
|
+
playbackRate: this.playbackRate,
|
|
767
825
|
currentTime: context.currentTime,
|
|
768
826
|
startAt,
|
|
769
827
|
scheduledUntil: this.scheduledAt
|
|
@@ -848,6 +906,7 @@ var LiveSpeechController = class {
|
|
|
848
906
|
fallbackHandler = null;
|
|
849
907
|
onStateChange = null;
|
|
850
908
|
beforePlayback = null;
|
|
909
|
+
voiceRate = 1;
|
|
851
910
|
setStateChangeListener(listener) {
|
|
852
911
|
this.onStateChange = listener;
|
|
853
912
|
}
|
|
@@ -863,6 +922,9 @@ var LiveSpeechController = class {
|
|
|
863
922
|
setVolume(value) {
|
|
864
923
|
this.audio.setVolume(value);
|
|
865
924
|
}
|
|
925
|
+
setVoiceRate(value) {
|
|
926
|
+
this.voiceRate = normalizeVoiceRate(value);
|
|
927
|
+
}
|
|
866
928
|
async pause(sessionId) {
|
|
867
929
|
if (this.sessionId !== sessionId || this.status !== "playing") return false;
|
|
868
930
|
await this.audio.pause();
|
|
@@ -914,6 +976,7 @@ var LiveSpeechController = class {
|
|
|
914
976
|
if (this.sessionId !== sessionId || text.length === 0) return;
|
|
915
977
|
this.beforePlayback?.();
|
|
916
978
|
this.resetState();
|
|
979
|
+
this.audio.setPlaybackRate(this.voiceRate);
|
|
917
980
|
this.completed = {
|
|
918
981
|
sessionId,
|
|
919
982
|
messageId,
|
|
@@ -971,6 +1034,7 @@ var LiveSpeechController = class {
|
|
|
971
1034
|
reset(next) {
|
|
972
1035
|
this.replaceQueue();
|
|
973
1036
|
this.audio.stop();
|
|
1037
|
+
this.audio.setPlaybackRate(this.voiceRate);
|
|
974
1038
|
this.beginSegment(next, false);
|
|
975
1039
|
this.setStatus("idle");
|
|
976
1040
|
}
|
|
@@ -1122,6 +1186,8 @@ var LocalSpeechController = class {
|
|
|
1122
1186
|
fallbackHandler = null;
|
|
1123
1187
|
beforePlayback = null;
|
|
1124
1188
|
volume = 1;
|
|
1189
|
+
voiceRate = 1;
|
|
1190
|
+
activeVoiceRate = 1;
|
|
1125
1191
|
setStateChangeListener(listener) {
|
|
1126
1192
|
this.onStateChange = listener;
|
|
1127
1193
|
}
|
|
@@ -1141,6 +1207,9 @@ var LocalSpeechController = class {
|
|
|
1141
1207
|
this.volume = Number.isFinite(value) ? Math.max(0, Math.min(1, value)) : 1;
|
|
1142
1208
|
if (this.current !== null) this.current.volume = this.volume;
|
|
1143
1209
|
}
|
|
1210
|
+
setVoiceRate(value) {
|
|
1211
|
+
this.voiceRate = normalizeVoiceRate(value);
|
|
1212
|
+
}
|
|
1144
1213
|
activateSession(sessionId) {
|
|
1145
1214
|
if (this.sessionId === sessionId) return;
|
|
1146
1215
|
this.cancel();
|
|
@@ -1188,6 +1257,7 @@ var LocalSpeechController = class {
|
|
|
1188
1257
|
if (this.sessionId !== sessionId || text.length === 0) return;
|
|
1189
1258
|
this.beforePlayback?.();
|
|
1190
1259
|
this.resetState();
|
|
1260
|
+
this.activeVoiceRate = this.voiceRate;
|
|
1191
1261
|
this.messageId = messageId;
|
|
1192
1262
|
this.completedFallback = fallback ?? null;
|
|
1193
1263
|
const segments = this.segments(text);
|
|
@@ -1238,6 +1308,7 @@ var LocalSpeechController = class {
|
|
|
1238
1308
|
}
|
|
1239
1309
|
reset(next) {
|
|
1240
1310
|
this.resetState();
|
|
1311
|
+
this.activeVoiceRate = this.voiceRate;
|
|
1241
1312
|
this.active = next;
|
|
1242
1313
|
this.setStatus("idle");
|
|
1243
1314
|
}
|
|
@@ -1323,6 +1394,7 @@ var LocalSpeechController = class {
|
|
|
1323
1394
|
utterance.voice = voice;
|
|
1324
1395
|
utterance.lang = voice.lang;
|
|
1325
1396
|
utterance.volume = this.volume;
|
|
1397
|
+
applySpeechVoiceRate(utterance, this.activeVoiceRate);
|
|
1326
1398
|
this.current = utterance;
|
|
1327
1399
|
let settled = false;
|
|
1328
1400
|
let timeout = null;
|
|
@@ -1398,6 +1470,7 @@ var PlaybackController = class {
|
|
|
1398
1470
|
activeSessionId = null;
|
|
1399
1471
|
beforePlayback = null;
|
|
1400
1472
|
volume = 1;
|
|
1473
|
+
voiceRate = 1;
|
|
1401
1474
|
getSnapshot = () => this.view;
|
|
1402
1475
|
subscribe = (listener) => {
|
|
1403
1476
|
this.listeners.add(listener);
|
|
@@ -1411,6 +1484,9 @@ var PlaybackController = class {
|
|
|
1411
1484
|
if (this.current !== null) this.current.audio.volume = this.volume;
|
|
1412
1485
|
for (const audio of this.segmentQueue) audio.volume = this.volume;
|
|
1413
1486
|
}
|
|
1487
|
+
setVoiceRate(value) {
|
|
1488
|
+
this.voiceRate = normalizeVoiceRate(value);
|
|
1489
|
+
}
|
|
1414
1490
|
interrupt() {
|
|
1415
1491
|
this.generation += 1;
|
|
1416
1492
|
this.stopCurrent();
|
|
@@ -1501,6 +1577,7 @@ var PlaybackController = class {
|
|
|
1501
1577
|
this.stopCurrent();
|
|
1502
1578
|
const segments = resume ? previous.segments : splitTtsSegments(text);
|
|
1503
1579
|
const startIndex = resume ? previous.index : 0;
|
|
1580
|
+
const voiceRate = resume ? previous.voiceRate : this.voiceRate;
|
|
1504
1581
|
if (segments.length === 0) {
|
|
1505
1582
|
this.publish({
|
|
1506
1583
|
sessionId,
|
|
@@ -1515,7 +1592,8 @@ var PlaybackController = class {
|
|
|
1515
1592
|
sessionId,
|
|
1516
1593
|
messageId,
|
|
1517
1594
|
segments,
|
|
1518
|
-
index: startIndex
|
|
1595
|
+
index: startIndex,
|
|
1596
|
+
voiceRate
|
|
1519
1597
|
};
|
|
1520
1598
|
const generation = ++this.generation;
|
|
1521
1599
|
const controller = new AbortController();
|
|
@@ -1556,6 +1634,7 @@ var PlaybackController = class {
|
|
|
1556
1634
|
if (index + 1 < segments.length) nextAudio = synthesize(segments[index + 1]);
|
|
1557
1635
|
const audio = new Audio(URL.createObjectURL(blob));
|
|
1558
1636
|
audio.volume = this.volume;
|
|
1637
|
+
applyMediaVoiceRate(audio, voiceRate);
|
|
1559
1638
|
this.segmentQueue.push(audio);
|
|
1560
1639
|
await new Promise((resolve, reject) => {
|
|
1561
1640
|
const cleanup = () => {
|
|
@@ -1613,7 +1692,7 @@ var PlaybackController = class {
|
|
|
1613
1692
|
if (generation === this.generation) this.request = null;
|
|
1614
1693
|
}
|
|
1615
1694
|
}
|
|
1616
|
-
async toggle(sessionId, messageId, text, automatic, fallback) {
|
|
1695
|
+
async toggle(sessionId, messageId, text, automatic, fallback, format = "mp3") {
|
|
1617
1696
|
if (this.activeSessionId !== sessionId) return;
|
|
1618
1697
|
this.beforePlayback?.();
|
|
1619
1698
|
if (this.view.source === "complete" && this.view.sessionId === sessionId && this.view.messageId === messageId && this.current !== null) {
|
|
@@ -1662,6 +1741,7 @@ var PlaybackController = class {
|
|
|
1662
1741
|
return;
|
|
1663
1742
|
}
|
|
1664
1743
|
this.stopCurrent();
|
|
1744
|
+
const voiceRate = this.voiceRate;
|
|
1665
1745
|
const generation = ++this.generation;
|
|
1666
1746
|
const controller = new AbortController();
|
|
1667
1747
|
this.request = controller;
|
|
@@ -1677,7 +1757,10 @@ var PlaybackController = class {
|
|
|
1677
1757
|
const response = await fetch(TTS_ROUTE, {
|
|
1678
1758
|
method: "POST",
|
|
1679
1759
|
headers: { "content-type": "application/json" },
|
|
1680
|
-
body: JSON.stringify({
|
|
1760
|
+
body: JSON.stringify({
|
|
1761
|
+
text,
|
|
1762
|
+
format
|
|
1763
|
+
}),
|
|
1681
1764
|
signal: controller.signal
|
|
1682
1765
|
});
|
|
1683
1766
|
if (!response.ok) {
|
|
@@ -1694,6 +1777,7 @@ var PlaybackController = class {
|
|
|
1694
1777
|
const url = URL.createObjectURL(blob);
|
|
1695
1778
|
const audio = new Audio(url);
|
|
1696
1779
|
audio.volume = this.volume;
|
|
1780
|
+
applyMediaVoiceRate(audio, voiceRate);
|
|
1697
1781
|
audioCreated = true;
|
|
1698
1782
|
const current = {
|
|
1699
1783
|
url,
|
|
@@ -1823,10 +1907,12 @@ function decodeSettings(value) {
|
|
|
1823
1907
|
if (typeof value.voiceDesignCustomPrompt === "string") decoded.voiceDesignCustomPrompt = value.voiceDesignCustomPrompt;
|
|
1824
1908
|
if (TTS_FORMATS.includes(value.format)) decoded.format = value.format;
|
|
1825
1909
|
if (TTS_VOICE_DESIGN_PLAYBACK_MODES.includes(value.voiceDesignPlaybackMode)) decoded.voiceDesignPlaybackMode = value.voiceDesignPlaybackMode;
|
|
1910
|
+
if (TTS_READ_SCOPES.includes(value.readScope)) decoded.readScope = value.readScope;
|
|
1826
1911
|
if (typeof value.autoPlay === "boolean") decoded.autoPlay = value.autoPlay;
|
|
1827
1912
|
if (typeof value.maxTextLength === "number") decoded.maxTextLength = value.maxTextLength;
|
|
1828
1913
|
if (typeof value.requestTimeoutMs === "number") decoded.requestTimeoutMs = value.requestTimeoutMs;
|
|
1829
1914
|
if (typeof value.maxPausedPcmBytes === "number") decoded.maxPausedPcmBytes = value.maxPausedPcmBytes;
|
|
1915
|
+
if (typeof value.voiceRate === "number") decoded.voiceRate = value.voiceRate;
|
|
1830
1916
|
if (typeof value.soundEnabled === "boolean") decoded.soundEnabled = value.soundEnabled;
|
|
1831
1917
|
if (typeof value.soundVolume === "number") decoded.soundVolume = value.soundVolume;
|
|
1832
1918
|
if (SOUND_PACKS.includes(value.soundPack)) decoded.soundPack = value.soundPack;
|
|
@@ -1909,6 +1995,11 @@ function useApiKeySupported(active) {
|
|
|
1909
1995
|
}, [active]);
|
|
1910
1996
|
return supported;
|
|
1911
1997
|
}
|
|
1998
|
+
function scopedLiveText(value, scope, limiter, final = false) {
|
|
1999
|
+
if (scope === "full") return value;
|
|
2000
|
+
const plain = (0, __deepseek_ai_dsh_client_ui_primitives.extractMarkdownPlainText)(prepareTtsText(value)).trim();
|
|
2001
|
+
return limiter.limit(plain, final);
|
|
2002
|
+
}
|
|
1912
2003
|
/** Own the active-session boundary and feed its partial assistant output into realtime speech. */
|
|
1913
2004
|
function SessionPlaybackObserver({ sessionId, useSession, useChat, playback, live, local, settings }) {
|
|
1914
2005
|
const resolvedSettings = resolveTtsSettings(useSettingsSnapshot(settings).value);
|
|
@@ -1974,7 +2065,7 @@ function SessionPlaybackObserver({ sessionId, useSession, useChat, playback, liv
|
|
|
1974
2065
|
}
|
|
1975
2066
|
playback.observeSession(sessionId, runningSnapshot && runArmed.current, latestMessageId);
|
|
1976
2067
|
const localModel = resolvedSettings.model === "mimo-v2.5-tts";
|
|
1977
|
-
const realtimeSpeechEnabled = localModel
|
|
2068
|
+
const realtimeSpeechEnabled = localModel;
|
|
1978
2069
|
if (!resolvedSettings.enabled || !resolvedSettings.autoPlay || !realtimeSpeechEnabled) {
|
|
1979
2070
|
live.cancelSession(sessionId);
|
|
1980
2071
|
local.cancel();
|
|
@@ -1986,22 +2077,37 @@ function SessionPlaybackObserver({ sessionId, useSession, useChat, playback, liv
|
|
|
1986
2077
|
if (partial !== null) {
|
|
1987
2078
|
if (active.current !== null && (active.current.turn !== partial.turn || active.current.step !== partial.step)) {
|
|
1988
2079
|
const previous = finalLiveMessage(legacy, active.current.turn, active.current.step);
|
|
1989
|
-
if (previous !== null)
|
|
1990
|
-
|
|
2080
|
+
if (previous !== null) {
|
|
2081
|
+
const previousText = scopedLiveText(previous.text, resolveTtsReadScope(resolvedSettings.readScope, true), active.current.limiter, true);
|
|
2082
|
+
const previousFinal = {
|
|
2083
|
+
...previous,
|
|
2084
|
+
text: previousText
|
|
2085
|
+
};
|
|
2086
|
+
if (localModel && resolvedSettings.localSpeechMode !== "disabled" && (resolvedSettings.localSpeechMode === "local-first" || resolvedSettings.localSpeechMode === "auto" && apiKeySupported === false)) local.finish(sessionId, previousFinal);
|
|
2087
|
+
else live.finish(sessionId, previousFinal);
|
|
2088
|
+
}
|
|
1991
2089
|
}
|
|
1992
|
-
active.current = {
|
|
2090
|
+
if (active.current === null || active.current.turn !== partial.turn || active.current.step !== partial.step) active.current = {
|
|
1993
2091
|
turn: partial.turn,
|
|
1994
|
-
step: partial.step
|
|
2092
|
+
step: partial.step,
|
|
2093
|
+
limiter: new TtsFirstSegmentLimiter()
|
|
1995
2094
|
};
|
|
1996
|
-
|
|
1997
|
-
|
|
2095
|
+
const observedText = scopedLiveText(partialText, resolveTtsReadScope(resolvedSettings.readScope, true), active.current.limiter);
|
|
2096
|
+
if (localModel && resolvedSettings.localSpeechMode !== "disabled" && (resolvedSettings.localSpeechMode === "local-first" || resolvedSettings.localSpeechMode === "auto" && apiKeySupported === false)) local.observe(sessionId, partial.turn, partial.step, observedText);
|
|
2097
|
+
else live.observe(sessionId, partial.turn, partial.step, observedText);
|
|
1998
2098
|
return;
|
|
1999
2099
|
}
|
|
2000
2100
|
if (active.current !== null) {
|
|
2001
2101
|
const final = finalLiveMessage(legacy, active.current.turn, active.current.step);
|
|
2002
|
-
if (final !== null)
|
|
2003
|
-
|
|
2004
|
-
|
|
2102
|
+
if (final !== null) {
|
|
2103
|
+
const finalText = scopedLiveText(final.text, resolveTtsReadScope(resolvedSettings.readScope, true), active.current.limiter, true);
|
|
2104
|
+
const finalMessage = {
|
|
2105
|
+
...final,
|
|
2106
|
+
text: finalText
|
|
2107
|
+
};
|
|
2108
|
+
if (localModel && resolvedSettings.localSpeechMode !== "disabled" && (resolvedSettings.localSpeechMode === "local-first" || resolvedSettings.localSpeechMode === "auto" && apiKeySupported === false)) local.finish(sessionId, finalMessage);
|
|
2109
|
+
else live.finish(sessionId, finalMessage);
|
|
2110
|
+
} else if (!runningSnapshot) {
|
|
2005
2111
|
live.cancelSession(sessionId);
|
|
2006
2112
|
local.cancelSession(sessionId);
|
|
2007
2113
|
}
|
|
@@ -2018,9 +2124,9 @@ function SessionPlaybackObserver({ sessionId, useSession, useChat, playback, liv
|
|
|
2018
2124
|
playback,
|
|
2019
2125
|
resolvedSettings.autoPlay,
|
|
2020
2126
|
resolvedSettings.enabled,
|
|
2021
|
-
resolvedSettings.format,
|
|
2022
2127
|
resolvedSettings.localSpeechMode,
|
|
2023
2128
|
resolvedSettings.model,
|
|
2129
|
+
resolvedSettings.readScope,
|
|
2024
2130
|
runningSnapshot,
|
|
2025
2131
|
sessionId
|
|
2026
2132
|
]);
|
|
@@ -2039,33 +2145,42 @@ function ReadAloudAction({ sessionId, messageId, useSession, useChat, playback,
|
|
|
2039
2145
|
const text = message.text;
|
|
2040
2146
|
const settingsSnapshot = useSettingsSnapshot(settings);
|
|
2041
2147
|
const resolvedSettings = resolveTtsSettings(settingsSnapshot.value);
|
|
2042
|
-
const
|
|
2148
|
+
const playbackText = (automatic) => applyTtsReadScope(text, resolveTtsReadScope(resolvedSettings.readScope, automatic));
|
|
2043
2149
|
const apiKeySupported = useApiKeySupported(resolvedSettings.localSpeechMode !== "disabled");
|
|
2044
2150
|
local.setVoiceURI(resolvedSettings.localVoiceURI);
|
|
2045
2151
|
local.setTimeoutMs(resolvedSettings.requestTimeoutMs);
|
|
2046
2152
|
const view = (0, react.useSyncExternalStore)(playback.subscribe, playback.getSnapshot, playback.getSnapshot);
|
|
2047
2153
|
const playMimoCompletedReply = (automatic) => {
|
|
2048
|
-
|
|
2154
|
+
const scopedText = playbackText(automatic);
|
|
2155
|
+
if (resolvedSettings.model === "mimo-v2.5-tts-voicedesign" && scopedText.length > 0) {
|
|
2049
2156
|
live.cancelSession(sessionId);
|
|
2050
|
-
|
|
2157
|
+
const segments = scopedText;
|
|
2158
|
+
if (splitTtsSegments(segments).length > 1) playback.segmented(sessionId, messageId, segments, automatic, resolvedSettings.localSpeechMode === "auto" ? () => local.playCompleted(sessionId, messageId, segments) : void 0);
|
|
2159
|
+
else playback.toggle(sessionId, messageId, segments, automatic, resolvedSettings.localSpeechMode === "auto" ? () => local.playCompleted(sessionId, messageId, segments) : void 0, "mp3");
|
|
2051
2160
|
return;
|
|
2052
2161
|
}
|
|
2053
|
-
if (resolvedSettings.model === "mimo-v2.5-tts"
|
|
2162
|
+
if (resolvedSettings.model === "mimo-v2.5-tts") {
|
|
2163
|
+
if (!automatic && resolvedSettings.readScope === "smart") {
|
|
2164
|
+
live.cancelSession(sessionId);
|
|
2165
|
+
playback.cancelPlayback(sessionId);
|
|
2166
|
+
playback.toggle(sessionId, messageId, scopedText, false, resolvedSettings.localSpeechMode === "auto" ? () => local.playCompleted(sessionId, messageId, scopedText) : void 0, "mp3");
|
|
2167
|
+
return;
|
|
2168
|
+
}
|
|
2054
2169
|
playback.cancelPlayback(sessionId);
|
|
2055
|
-
live.playCompleted(sessionId, messageId,
|
|
2056
|
-
if (resolvedSettings.localSpeechMode === "auto") local.playCompleted(sessionId, messageId,
|
|
2057
|
-
else playback.toggle(sessionId, messageId,
|
|
2170
|
+
live.playCompleted(sessionId, messageId, scopedText, () => {
|
|
2171
|
+
if (resolvedSettings.localSpeechMode === "auto") local.playCompleted(sessionId, messageId, scopedText);
|
|
2172
|
+
else playback.toggle(sessionId, messageId, scopedText, automatic, void 0, "mp3");
|
|
2058
2173
|
});
|
|
2059
2174
|
return;
|
|
2060
2175
|
}
|
|
2061
2176
|
live.cancelSession(sessionId);
|
|
2062
|
-
playback.toggle(sessionId, messageId,
|
|
2177
|
+
playback.toggle(sessionId, messageId, scopedText, automatic, resolvedSettings.localSpeechMode === "auto" ? () => local.playCompleted(sessionId, messageId, scopedText) : void 0);
|
|
2063
2178
|
};
|
|
2064
2179
|
const playCompletedReply = (automatic) => {
|
|
2065
2180
|
if (resolvedSettings.localSpeechMode === "local-first" || resolvedSettings.localSpeechMode === "auto" && apiKeySupported === false) {
|
|
2066
2181
|
live.cancelSession(sessionId);
|
|
2067
2182
|
playback.cancelPlayback(sessionId);
|
|
2068
|
-
local.playCompleted(sessionId, messageId,
|
|
2183
|
+
local.playCompleted(sessionId, messageId, playbackText(automatic), resolvedSettings.localSpeechMode === "local-first" ? () => playMimoCompletedReply(automatic) : void 0);
|
|
2069
2184
|
return;
|
|
2070
2185
|
}
|
|
2071
2186
|
playMimoCompletedReply(automatic);
|
|
@@ -2085,16 +2200,14 @@ function ReadAloudAction({ sessionId, messageId, useSession, useChat, playback,
|
|
|
2085
2200
|
message.time,
|
|
2086
2201
|
messageId,
|
|
2087
2202
|
playback,
|
|
2088
|
-
resolvedSettings.format,
|
|
2089
2203
|
resolvedSettings.localSpeechMode,
|
|
2090
2204
|
resolvedSettings.model,
|
|
2091
|
-
resolvedSettings.
|
|
2205
|
+
resolvedSettings.readScope,
|
|
2092
2206
|
running,
|
|
2093
2207
|
sessionId,
|
|
2094
2208
|
settingsSnapshot.value?.autoPlay,
|
|
2095
2209
|
settingsSnapshot.value?.enabled,
|
|
2096
|
-
text
|
|
2097
|
-
voiceDesignPlaybackText
|
|
2210
|
+
text
|
|
2098
2211
|
]);
|
|
2099
2212
|
if (settingsSnapshot.value?.enabled !== true || text.length === 0) return null;
|
|
2100
2213
|
const mine = view.sessionId === sessionId && view.messageId === messageId;
|
|
@@ -2130,7 +2243,7 @@ function ReadAloudAction({ sessionId, messageId, useSession, useChat, playback,
|
|
|
2130
2243
|
}
|
|
2131
2244
|
if (mine && source === "segmented") {
|
|
2132
2245
|
if (status === "playing" || status === "loading") playback.pauseSegmented(sessionId, messageId);
|
|
2133
|
-
else if (status === "paused") playback.segmented(sessionId, messageId,
|
|
2246
|
+
else if (status === "paused") playback.segmented(sessionId, messageId, playbackText(false), false, resolvedSettings.localSpeechMode === "auto" ? () => local.playCompleted(sessionId, messageId, playbackText(false)) : void 0);
|
|
2134
2247
|
return;
|
|
2135
2248
|
}
|
|
2136
2249
|
playCompletedReply(false);
|
|
@@ -2197,6 +2310,15 @@ const zh = {
|
|
|
2197
2310
|
"settings.autoPlayHint": "浏览器可能会拒绝自动播放。",
|
|
2198
2311
|
"settings.detailedVoiceConfig": "调音台",
|
|
2199
2312
|
"settings.voiceVolume": "语音音量",
|
|
2313
|
+
"settings.voiceRate": "播放语速",
|
|
2314
|
+
"settings.voiceRatePcmHint": "适用于全部语音;流式 PCM 倍速会同时改变音调。",
|
|
2315
|
+
"settings.readScope": "朗读范围",
|
|
2316
|
+
"settings.readScopeSmart": "智能选择",
|
|
2317
|
+
"settings.readScopeFull": "全文模式",
|
|
2318
|
+
"settings.readScopeFirstSegment": "首段模式",
|
|
2319
|
+
"settings.readScopeSmartHint": "自动播报短回复全部朗读、长回复智能截取首段,手动点击朗读全文。",
|
|
2320
|
+
"settings.readScopeFullHint": "自动播报和手动朗读都播放全文。",
|
|
2321
|
+
"settings.readScopeFirstSegmentHint": "保守朗读,自动播报和手动朗读都只播放首段。",
|
|
2200
2322
|
"settings.summaryPresetModel": "预置音色",
|
|
2201
2323
|
"settings.summaryVoiceDesignModel": "自定义音色",
|
|
2202
2324
|
"settings.localSpeechAutoSummary": "MiMo 优先",
|
|
@@ -2219,7 +2341,7 @@ const zh = {
|
|
|
2219
2341
|
"settings.localVoiceUnavailable": "没有可用的浏览器音色",
|
|
2220
2342
|
"settings.localVoiceOffline": "离线",
|
|
2221
2343
|
"settings.localVoiceOnline": "在线",
|
|
2222
|
-
"settings.modelAutoPlayHintPreset": "
|
|
2344
|
+
"settings.modelAutoPlayHintPreset": "预置音色自动使用低延迟流式播放。",
|
|
2223
2345
|
"settings.modelAutoPlayHintVoiceDesign": "自定义音色仅支持在回复完成后自动播放。",
|
|
2224
2346
|
"settings.voice": "内置音色",
|
|
2225
2347
|
"settings.format": "音频格式",
|
|
@@ -2281,23 +2403,26 @@ const zh = {
|
|
|
2281
2403
|
"settings.collapse": "收起设置",
|
|
2282
2404
|
"settings.soundEffectsTitle": "音效库",
|
|
2283
2405
|
"settings.soundEffectsEnabled": "启用音效",
|
|
2284
|
-
"settings.soundEffectsVolume": "
|
|
2406
|
+
"settings.soundEffectsVolume": "音效音量",
|
|
2285
2407
|
"settings.soundEffectsPack": "音效包",
|
|
2286
2408
|
"settings.soundEffectsTask": "任务音效",
|
|
2287
2409
|
"settings.soundEffectsClick": "点击音效",
|
|
2288
2410
|
"settings.soundEffectsOn": "已开启",
|
|
2289
2411
|
"settings.soundEffectsOff": "已关闭",
|
|
2412
|
+
"settings.soundEffectsOnLabel": "音效开启",
|
|
2413
|
+
"settings.soundEffectsOffLabel": "音效关闭",
|
|
2290
2414
|
"settings.soundEffectsBubbleOn": "uisfx 已开启",
|
|
2291
2415
|
"settings.soundEffectsBubbleOff": "uisfx 已关闭",
|
|
2292
2416
|
"settings.soundEffectsTurnOn": "开启音效",
|
|
2293
2417
|
"settings.soundEffectsTurnOff": "关闭音效",
|
|
2294
2418
|
"settings.soundEffectsSynced": "任务 / 点击同步",
|
|
2295
|
-
"settings.soundEffectsPreviewLabel": "
|
|
2419
|
+
"settings.soundEffectsPreviewLabel": "音效试听",
|
|
2296
2420
|
"settings.soundEffectsPreview.start": "开始",
|
|
2297
2421
|
"settings.soundEffectsPreview.complete": "完成",
|
|
2298
2422
|
"settings.soundEffectsPreview.error": "失败",
|
|
2299
2423
|
"settings.soundEffectsPreview.notification": "提醒",
|
|
2300
2424
|
"settings.soundEffectsPreview.press": "点击",
|
|
2425
|
+
"settings.soundEffectsDescription": "为DSH接入uisfx语义化UI音效。在DSH中探索更多音效...",
|
|
2301
2426
|
"settings.soundEffectsSupported": "🔔 开始 完成 成功 失败 提醒 点击 选择 开启 关闭 发送 打开 关闭面板 删除 停止 排队"
|
|
2302
2427
|
};
|
|
2303
2428
|
const en = {
|
|
@@ -2343,6 +2468,15 @@ const en = {
|
|
|
2343
2468
|
"settings.autoPlayHint": "The browser may reject automatic playback.",
|
|
2344
2469
|
"settings.detailedVoiceConfig": "Mixing Console",
|
|
2345
2470
|
"settings.voiceVolume": "Voice volume",
|
|
2471
|
+
"settings.voiceRate": "Playback speed",
|
|
2472
|
+
"settings.voiceRatePcmHint": "Applies to all speech; streamed PCM changes pitch with playback speed.",
|
|
2473
|
+
"settings.readScope": "Read-aloud range",
|
|
2474
|
+
"settings.readScopeSmart": "Smart selection",
|
|
2475
|
+
"settings.readScopeFull": "Full mode",
|
|
2476
|
+
"settings.readScopeFirstSegment": "First-segment mode",
|
|
2477
|
+
"settings.readScopeSmartHint": "Automatic playback reads the opening segment; manual playback reads the full reply.",
|
|
2478
|
+
"settings.readScopeFullHint": "Both automatic and manual playback read the full reply.",
|
|
2479
|
+
"settings.readScopeFirstSegmentHint": "Both automatic and manual playback read only the opening segment.",
|
|
2346
2480
|
"settings.summaryPresetModel": "Preset model",
|
|
2347
2481
|
"settings.summaryVoiceDesignModel": "Custom voicedesign",
|
|
2348
2482
|
"settings.localSpeechAutoSummary": "MiMo first",
|
|
@@ -2365,7 +2499,7 @@ const en = {
|
|
|
2365
2499
|
"settings.localVoiceUnavailable": "No browser voices available",
|
|
2366
2500
|
"settings.localVoiceOffline": "Offline",
|
|
2367
2501
|
"settings.localVoiceOnline": "Online",
|
|
2368
|
-
"settings.modelAutoPlayHintPreset": "
|
|
2502
|
+
"settings.modelAutoPlayHintPreset": "Preset voices use low-latency streaming automatically.",
|
|
2369
2503
|
"settings.modelAutoPlayHintVoiceDesign": "Custom voice design supports automatic playback only after the reply is complete.",
|
|
2370
2504
|
"settings.voice": "Built-in voice",
|
|
2371
2505
|
"settings.format": "Audio format",
|
|
@@ -2433,17 +2567,20 @@ const en = {
|
|
|
2433
2567
|
"settings.soundEffectsClick": "Click sounds",
|
|
2434
2568
|
"settings.soundEffectsOn": "On",
|
|
2435
2569
|
"settings.soundEffectsOff": "Off",
|
|
2570
|
+
"settings.soundEffectsOnLabel": "Magic sounds on",
|
|
2571
|
+
"settings.soundEffectsOffLabel": "Magic sounds off",
|
|
2436
2572
|
"settings.soundEffectsBubbleOn": "UISFX enabled",
|
|
2437
2573
|
"settings.soundEffectsBubbleOff": "UISFX disabled",
|
|
2438
2574
|
"settings.soundEffectsTurnOn": "Turn sounds on",
|
|
2439
2575
|
"settings.soundEffectsTurnOff": "Turn sounds off",
|
|
2440
2576
|
"settings.soundEffectsSynced": "Task / click synced",
|
|
2441
|
-
"settings.soundEffectsPreviewLabel": "
|
|
2577
|
+
"settings.soundEffectsPreviewLabel": "Sound previews",
|
|
2442
2578
|
"settings.soundEffectsPreview.start": "Preview start",
|
|
2443
2579
|
"settings.soundEffectsPreview.complete": "Preview complete",
|
|
2444
2580
|
"settings.soundEffectsPreview.error": "Preview error",
|
|
2445
2581
|
"settings.soundEffectsPreview.notification": "Preview notification",
|
|
2446
2582
|
"settings.soundEffectsPreview.press": "Preview click",
|
|
2583
|
+
"settings.soundEffectsDescription": "Bringing semantic UISFX interface sounds to DSH. Explore more sounds in DSH...",
|
|
2447
2584
|
"settings.soundEffectsSupported": "Supported sounds: Start, Complete, Success, Error, Notification, Press, Select, Toggle On, Toggle Off, Send, Open, Close, Delete, Stop, Queued"
|
|
2448
2585
|
};
|
|
2449
2586
|
|
|
@@ -2505,6 +2642,7 @@ var XiaomiMimoTtsPcmService = class extends __deepseek_ai_cordis.Service {
|
|
|
2505
2642
|
debugConsole?.info(this.logPrefix, "[准备] 已请求中断会话朗读");
|
|
2506
2643
|
this.audio.setMaxPausedPcmBytes(settings.maxPausedPcmBytes);
|
|
2507
2644
|
this.audio.setVolume(settings.voiceVolume);
|
|
2645
|
+
this.audio.setPlaybackRate(settings.voiceRate);
|
|
2508
2646
|
const generation = this.generation;
|
|
2509
2647
|
const controller = new AbortController();
|
|
2510
2648
|
this.request = controller;
|
|
@@ -2612,6 +2750,7 @@ var PreviewPlayer = class {
|
|
|
2612
2750
|
pcmBusy = false;
|
|
2613
2751
|
status = "idle";
|
|
2614
2752
|
volume = 1;
|
|
2753
|
+
voiceRate = 1;
|
|
2615
2754
|
constructor(onStatusChange) {
|
|
2616
2755
|
this.onStatusChange = onStatusChange;
|
|
2617
2756
|
}
|
|
@@ -2627,6 +2766,8 @@ var PreviewPlayer = class {
|
|
|
2627
2766
|
async play(text, settings) {
|
|
2628
2767
|
this.stop();
|
|
2629
2768
|
this.setVolume(settings.voiceVolume);
|
|
2769
|
+
this.voiceRate = normalizeVoiceRate(settings.voiceRate);
|
|
2770
|
+
this.pcm.setPlaybackRate(this.voiceRate);
|
|
2630
2771
|
const normalized = text.trim();
|
|
2631
2772
|
if (normalized.length === 0) {
|
|
2632
2773
|
this.publish("error");
|
|
@@ -2703,21 +2844,12 @@ var PreviewPlayer = class {
|
|
|
2703
2844
|
};
|
|
2704
2845
|
}
|
|
2705
2846
|
async playRemote(text, settings, generation) {
|
|
2706
|
-
if (settings.model === "mimo-v2.5-tts-voicedesign"
|
|
2707
|
-
await this.playSegmented(text, settings, generation);
|
|
2847
|
+
if (settings.model === "mimo-v2.5-tts-voicedesign") {
|
|
2848
|
+
if (splitTtsSegments(text).length > 1) await this.playSegmented(text, settings, generation);
|
|
2849
|
+
else await this.playComplete(text, settings, generation, "mp3");
|
|
2708
2850
|
return;
|
|
2709
2851
|
}
|
|
2710
|
-
|
|
2711
|
-
const segment = firstTtsSegment(text);
|
|
2712
|
-
if (segment.length === 0) throw new Error("no-text");
|
|
2713
|
-
await this.playComplete(segment, settings, generation, "wav");
|
|
2714
|
-
return;
|
|
2715
|
-
}
|
|
2716
|
-
if (settings.model !== "mimo-v2.5-tts-voicedesign" && settings.format === "pcm") {
|
|
2717
|
-
await this.playPcm(text, settings, generation);
|
|
2718
|
-
return;
|
|
2719
|
-
}
|
|
2720
|
-
await this.playComplete(text, settings, generation, settings.format === "wav" ? "wav" : "mp3");
|
|
2852
|
+
await this.playPcm(text, settings, generation);
|
|
2721
2853
|
}
|
|
2722
2854
|
async playComplete(text, settings, generation, format) {
|
|
2723
2855
|
this.publish("loading");
|
|
@@ -2736,6 +2868,7 @@ var PreviewPlayer = class {
|
|
|
2736
2868
|
const url = URL.createObjectURL(blob);
|
|
2737
2869
|
const audio = new Audio(url);
|
|
2738
2870
|
audio.volume = this.volume;
|
|
2871
|
+
applyMediaVoiceRate(audio, this.voiceRate);
|
|
2739
2872
|
this.audioUrl = url;
|
|
2740
2873
|
this.audio = audio;
|
|
2741
2874
|
await new Promise((resolve, reject) => {
|
|
@@ -2823,6 +2956,7 @@ var PreviewPlayer = class {
|
|
|
2823
2956
|
utterance.voice = voice;
|
|
2824
2957
|
utterance.lang = voice.lang;
|
|
2825
2958
|
utterance.volume = this.volume;
|
|
2959
|
+
applySpeechVoiceRate(utterance, this.voiceRate);
|
|
2826
2960
|
this.utterance = utterance;
|
|
2827
2961
|
let settled = false;
|
|
2828
2962
|
const finish = (error) => {
|
|
@@ -3239,21 +3373,42 @@ function BuiltInVoicePicker({ value, disabled, label, onChange }) {
|
|
|
3239
3373
|
|
|
3240
3374
|
//#endregion
|
|
3241
3375
|
//#region src/client/settings/controls/energy-volume-slider.tsx
|
|
3242
|
-
function
|
|
3243
|
-
return Number.isFinite(value) ? Math.max(
|
|
3376
|
+
function clamp(value, min, max) {
|
|
3377
|
+
return Number.isFinite(value) ? Math.max(min, Math.min(max, value)) : max;
|
|
3244
3378
|
}
|
|
3245
|
-
|
|
3246
|
-
|
|
3379
|
+
const DOT_COUNT = 48;
|
|
3380
|
+
const DOT_POSITIONS = Array.from({ length: DOT_COUNT }, (_, index) => {
|
|
3381
|
+
const randomAt = (offset) => {
|
|
3382
|
+
const seed = Math.sin(index * (12.9898 + offset) + 78.233 + offset * 31.7) * 43758.5453;
|
|
3383
|
+
return seed - Math.floor(seed);
|
|
3384
|
+
};
|
|
3385
|
+
const random = randomAt(0);
|
|
3386
|
+
return {
|
|
3387
|
+
x: 2 + index / (DOT_COUNT - 1) * 96 + (random - .5) * 2,
|
|
3388
|
+
y: 28 + random * 44,
|
|
3389
|
+
size: 2 + randomAt(1) * 2,
|
|
3390
|
+
driftX: `${(randomAt(2) - .5) * 8}px`,
|
|
3391
|
+
driftY: `${(randomAt(3) - .5) * 10}px`,
|
|
3392
|
+
duration: `${2.4 + randomAt(4) * 2.8}s`,
|
|
3393
|
+
delay: `${-randomAt(5) * 3.5}s`
|
|
3394
|
+
};
|
|
3395
|
+
});
|
|
3396
|
+
/** A controlled, accessible energy slider with transient pointer feedback. */
|
|
3397
|
+
function EnergyVolumeSlider({ value, label, disabled = false, min = 0, max = 1, step = .01, formatValue, onChange, onInteractionEnd }) {
|
|
3398
|
+
const lower = Number.isFinite(min) ? min : 0;
|
|
3399
|
+
const upper = Number.isFinite(max) && max > lower ? max : lower + 1;
|
|
3400
|
+
const increment = Number.isFinite(step) && step > 0 ? step : (upper - lower) / 100;
|
|
3247
3401
|
const [dragging, setDragging] = (0, react.useState)(false);
|
|
3248
3402
|
const [pulse, setPulse] = (0, react.useState)(0);
|
|
3249
3403
|
const draggingRef = (0, react.useRef)(false);
|
|
3250
3404
|
const keyboardInteractingRef = (0, react.useRef)(false);
|
|
3251
|
-
const
|
|
3252
|
-
const
|
|
3405
|
+
const current = clamp(value, lower, upper);
|
|
3406
|
+
const latestValueRef = (0, react.useRef)(current);
|
|
3407
|
+
const normalized = (current - lower) / (upper - lower);
|
|
3253
3408
|
const percent = Math.round(normalized * 100);
|
|
3254
3409
|
(0, react.useEffect)(() => {
|
|
3255
|
-
if (!draggingRef.current) latestValueRef.current =
|
|
3256
|
-
}, [
|
|
3410
|
+
if (!draggingRef.current) latestValueRef.current = current;
|
|
3411
|
+
}, [current]);
|
|
3257
3412
|
const begin = (event) => {
|
|
3258
3413
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
3259
3414
|
draggingRef.current = true;
|
|
@@ -3263,7 +3418,7 @@ function EnergyVolumeSlider({ value, label, disabled = false, onChange, onIntera
|
|
|
3263
3418
|
if (!draggingRef.current) return;
|
|
3264
3419
|
draggingRef.current = false;
|
|
3265
3420
|
setDragging(false);
|
|
3266
|
-
setPulse((current) => current + 1);
|
|
3421
|
+
setPulse((current$1) => current$1 + 1);
|
|
3267
3422
|
onInteractionEnd?.(latestValueRef.current);
|
|
3268
3423
|
};
|
|
3269
3424
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -3280,19 +3435,26 @@ function EnergyVolumeSlider({ value, label, disabled = false, onChange, onIntera
|
|
|
3280
3435
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3281
3436
|
className: pulse ? "xmimo-tts-energy-dots xmimo-tts-energy-pulse" : "xmimo-tts-energy-dots",
|
|
3282
3437
|
"aria-hidden": "true",
|
|
3283
|
-
children:
|
|
3438
|
+
children: DOT_POSITIONS.map(({ x, y, size, driftX, driftY, duration, delay }, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("i", { style: {
|
|
3284
3439
|
"--dot": index,
|
|
3285
|
-
|
|
3440
|
+
"--dot-x": `${x}%`,
|
|
3441
|
+
"--dot-y": `${y}%`,
|
|
3442
|
+
"--dot-size": `${size}px`,
|
|
3443
|
+
"--drift-x": driftX,
|
|
3444
|
+
"--drift-y": driftY,
|
|
3445
|
+
"--drift-duration": duration,
|
|
3446
|
+
"--drift-delay": delay,
|
|
3447
|
+
opacity: index / DOT_COUNT < normalized ? .7 : .15
|
|
3286
3448
|
} }, index))
|
|
3287
3449
|
}, pulse),
|
|
3288
3450
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3289
3451
|
type: "range",
|
|
3290
|
-
min:
|
|
3291
|
-
max:
|
|
3292
|
-
step:
|
|
3293
|
-
value:
|
|
3452
|
+
min: lower,
|
|
3453
|
+
max: upper,
|
|
3454
|
+
step: increment,
|
|
3455
|
+
value: current,
|
|
3294
3456
|
"aria-label": label,
|
|
3295
|
-
"aria-valuetext": `${percent}%`,
|
|
3457
|
+
"aria-valuetext": formatValue?.(current) ?? `${percent}%`,
|
|
3296
3458
|
disabled,
|
|
3297
3459
|
onPointerDown: begin,
|
|
3298
3460
|
onPointerUp: finish,
|
|
@@ -3328,14 +3490,14 @@ function EnergyVolumeSlider({ value, label, disabled = false, onChange, onIntera
|
|
|
3328
3490
|
"PageUp",
|
|
3329
3491
|
"PageDown"
|
|
3330
3492
|
].includes(event.key)) return;
|
|
3331
|
-
setPulse((current) => current + 1);
|
|
3493
|
+
setPulse((current$1) => current$1 + 1);
|
|
3332
3494
|
if (keyboardInteractingRef.current) {
|
|
3333
3495
|
keyboardInteractingRef.current = false;
|
|
3334
3496
|
onInteractionEnd?.(latestValueRef.current);
|
|
3335
3497
|
}
|
|
3336
3498
|
},
|
|
3337
3499
|
onChange: (event) => {
|
|
3338
|
-
const next = Number(event.target.value)
|
|
3500
|
+
const next = Number(event.target.value);
|
|
3339
3501
|
latestValueRef.current = next;
|
|
3340
3502
|
onChange(next);
|
|
3341
3503
|
}
|
|
@@ -3743,11 +3905,11 @@ const VOICE_DESIGN_AI_COPY_KEYS = [
|
|
|
3743
3905
|
"settings.voiceDesignAiCopy3",
|
|
3744
3906
|
"settings.voiceDesignAiCopy4"
|
|
3745
3907
|
];
|
|
3746
|
-
function
|
|
3747
|
-
return
|
|
3908
|
+
function readScopeLabel(scope) {
|
|
3909
|
+
return scope === "smart" ? "settings.readScopeSmart" : scope === "full" ? "settings.readScopeFull" : "settings.readScopeFirstSegment";
|
|
3748
3910
|
}
|
|
3749
|
-
function
|
|
3750
|
-
return
|
|
3911
|
+
function readScopeHint(scope) {
|
|
3912
|
+
return scope === "smart" ? "settings.readScopeSmartHint" : scope === "full" ? "settings.readScopeFullHint" : "settings.readScopeFirstSegmentHint";
|
|
3751
3913
|
}
|
|
3752
3914
|
function ModelPicker({ value, disabled, label, presetLabel, voiceDesignLabel, onChange }) {
|
|
3753
3915
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -3766,13 +3928,14 @@ function ModelPicker({ value, disabled, label, presetLabel, voiceDesignLabel, on
|
|
|
3766
3928
|
}, option.value))
|
|
3767
3929
|
});
|
|
3768
3930
|
}
|
|
3769
|
-
function DetailsModule({ t, connection, open, writable, autoPlay, voiceVolume, model, localSpeechMode, localVoiceURI, voice,
|
|
3931
|
+
function DetailsModule({ t, connection, open, writable, autoPlay, voiceVolume, voiceRate, readScope, model, localSpeechMode, localVoiceURI, voice, voiceDesignPrompt, voiceDesignCustomPrompt, voiceDesignAiState, voiceDesignAiCopy, fieldOverridden, resetField, onToggle, onVoiceVolumeChange, onVoiceVolumeInteractionEnd, onVoiceRateChange, onVoiceRateInteractionEnd, onReadScopeChange, onModelChange, onVoiceDesignPromptChange, onVoiceChange, onLocalVoiceURIChange, onLocalSpeechModeChange, onVoiceDesignAiCopyChange, onGenerateVoiceDesign }) {
|
|
3770
3932
|
const summaryModel = t(model === "mimo-v2.5-tts-voicedesign" ? "settings.summaryVoiceDesignModel" : "settings.summaryPresetModel");
|
|
3771
3933
|
const voiceDesignPreset = TTS_VOICE_DESIGN_PRESETS.find((item) => item.prompt === voiceDesignPrompt);
|
|
3772
3934
|
const summaryVoice = model === "mimo-v2.5-tts-voicedesign" ? voiceDesignPreset?.label ?? t("settings.customVoiceOption") : voice;
|
|
3773
|
-
const
|
|
3935
|
+
const summaryReadScope = t(readScopeLabel(readScope));
|
|
3774
3936
|
const summaryStrategy = t(localSpeechMode === "auto" ? "settings.localSpeechAutoSummary" : localSpeechMode === "local-first" ? "settings.localSpeechFirst" : "settings.localSpeechDisabled");
|
|
3775
|
-
const summaryVoiceVolume = `${
|
|
3937
|
+
const summaryVoiceVolume = `${Math.round(voiceVolume * 100)}%`;
|
|
3938
|
+
const summaryVoiceRate = `${voiceRate.toFixed(1)}×`;
|
|
3776
3939
|
const mixerAction = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3777
3940
|
type: "button",
|
|
3778
3941
|
className: model === "mimo-v2.5-tts-voicedesign" ? "xmimo-tts-mixer-whale-button" : "xmimo-tts-mixer-whale-button xmimo-tts-mixer-whale-button-static",
|
|
@@ -3808,9 +3971,10 @@ function DetailsModule({ t, connection, open, writable, autoPlay, voiceVolume, m
|
|
|
3808
3971
|
className: "xmimo-tts-details-summary xmimo-ui-summary",
|
|
3809
3972
|
children: [
|
|
3810
3973
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: summaryVoiceVolume }),
|
|
3974
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: summaryVoiceRate }),
|
|
3975
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: summaryReadScope }),
|
|
3811
3976
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: summaryModel }),
|
|
3812
3977
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: summaryVoice }),
|
|
3813
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: summaryPlayback }),
|
|
3814
3978
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: summaryStrategy })
|
|
3815
3979
|
]
|
|
3816
3980
|
}),
|
|
@@ -3823,7 +3987,7 @@ function DetailsModule({ t, connection, open, writable, autoPlay, voiceVolume, m
|
|
|
3823
3987
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3824
3988
|
className: "xmimo-tts-volume",
|
|
3825
3989
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingFieldHeading, {
|
|
3826
|
-
label: t("settings.voiceVolume")
|
|
3990
|
+
label: `${t("settings.voiceVolume")} ${summaryVoiceVolume}`,
|
|
3827
3991
|
overriddenLabel: t("settings.overridden"),
|
|
3828
3992
|
resetLabel: t("settings.reset"),
|
|
3829
3993
|
overridden: fieldOverridden("voiceVolume"),
|
|
@@ -3840,6 +4004,34 @@ function DetailsModule({ t, connection, open, writable, autoPlay, voiceVolume, m
|
|
|
3840
4004
|
onInteractionEnd: onVoiceVolumeInteractionEnd
|
|
3841
4005
|
})]
|
|
3842
4006
|
}),
|
|
4007
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4008
|
+
className: "xmimo-tts-volume",
|
|
4009
|
+
children: [
|
|
4010
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingFieldHeading, {
|
|
4011
|
+
label: `${t("settings.voiceRate")} ${voiceRate.toFixed(1)}×`,
|
|
4012
|
+
overriddenLabel: t("settings.overridden"),
|
|
4013
|
+
resetLabel: t("settings.reset"),
|
|
4014
|
+
overridden: fieldOverridden("voiceRate"),
|
|
4015
|
+
resettable: true,
|
|
4016
|
+
disabled: !writable,
|
|
4017
|
+
onReset: () => {
|
|
4018
|
+
resetField("voiceRate");
|
|
4019
|
+
}
|
|
4020
|
+
}),
|
|
4021
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EnergyVolumeSlider, {
|
|
4022
|
+
value: voiceRate,
|
|
4023
|
+
min: .5,
|
|
4024
|
+
max: 2,
|
|
4025
|
+
step: .1,
|
|
4026
|
+
formatValue: (value) => `${value.toFixed(1)}×`,
|
|
4027
|
+
label: t("settings.voiceRate"),
|
|
4028
|
+
disabled: !writable,
|
|
4029
|
+
onChange: onVoiceRateChange,
|
|
4030
|
+
onInteractionEnd: onVoiceRateInteractionEnd
|
|
4031
|
+
}),
|
|
4032
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("settings.voiceRatePcmHint") })
|
|
4033
|
+
]
|
|
4034
|
+
}),
|
|
3843
4035
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3844
4036
|
className: "xmimo-tts-model",
|
|
3845
4037
|
children: [
|
|
@@ -3903,46 +4095,10 @@ function DetailsModule({ t, connection, open, writable, autoPlay, voiceVolume, m
|
|
|
3903
4095
|
role: "status",
|
|
3904
4096
|
children: t("settings.voiceDesignGenerateFailed")
|
|
3905
4097
|
}) : null,
|
|
3906
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("settings.voiceDesignPromptHint") })
|
|
3907
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3908
|
-
className: "xmimo-tts-format",
|
|
3909
|
-
children: [
|
|
3910
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingFieldHeading, {
|
|
3911
|
-
label: t("settings.voiceDesignPlaybackMode"),
|
|
3912
|
-
overriddenLabel: t("settings.overridden"),
|
|
3913
|
-
resetLabel: t("settings.reset"),
|
|
3914
|
-
overridden: fieldOverridden("voiceDesignPlaybackMode"),
|
|
3915
|
-
resettable: true,
|
|
3916
|
-
disabled: !writable,
|
|
3917
|
-
onReset: () => {
|
|
3918
|
-
resetField("voiceDesignPlaybackMode");
|
|
3919
|
-
}
|
|
3920
|
-
}),
|
|
3921
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3922
|
-
className: "xmimo-tts-format-options",
|
|
3923
|
-
role: "radiogroup",
|
|
3924
|
-
"aria-label": t("settings.voiceDesignPlaybackMode"),
|
|
3925
|
-
children: TTS_VOICE_DESIGN_PLAYBACK_MODES.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3926
|
-
"data-xmimo-select-option": "true",
|
|
3927
|
-
className: voiceDesignPlaybackMode === item ? "xmimo-tts-format-option xmimo-tts-format-option-selected" : "xmimo-tts-format-option",
|
|
3928
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3929
|
-
type: "radio",
|
|
3930
|
-
name: "xmimo-tts-voice-design-playback",
|
|
3931
|
-
value: item,
|
|
3932
|
-
checked: voiceDesignPlaybackMode === item,
|
|
3933
|
-
disabled: !writable,
|
|
3934
|
-
onChange: () => {
|
|
3935
|
-
onVoiceDesignPlaybackModeChange(item);
|
|
3936
|
-
}
|
|
3937
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(voiceDesignPlaybackLabel(item)) })]
|
|
3938
|
-
}, item))
|
|
3939
|
-
}),
|
|
3940
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t(voiceDesignPlaybackHint(voiceDesignPlaybackMode)) })
|
|
3941
|
-
]
|
|
3942
|
-
})
|
|
4098
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("settings.voiceDesignPromptHint") })
|
|
3943
4099
|
]
|
|
3944
4100
|
}) : null,
|
|
3945
|
-
model === "mimo-v2.5-tts" ? /* @__PURE__ */ (0, react_jsx_runtime.
|
|
4101
|
+
model === "mimo-v2.5-tts" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3946
4102
|
className: "xmimo-tts-voice",
|
|
3947
4103
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingFieldHeading, {
|
|
3948
4104
|
label: t("settings.voice"),
|
|
@@ -3960,64 +4116,70 @@ function DetailsModule({ t, connection, open, writable, autoPlay, voiceVolume, m
|
|
|
3960
4116
|
label: t("settings.voice"),
|
|
3961
4117
|
onChange: onVoiceChange
|
|
3962
4118
|
})]
|
|
3963
|
-
})
|
|
4119
|
+
}) }) : null,
|
|
4120
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4121
|
+
className: "xmimo-tts-voice",
|
|
4122
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingFieldHeading, {
|
|
4123
|
+
label: t("settings.localVoice"),
|
|
4124
|
+
overriddenLabel: t("settings.overridden"),
|
|
4125
|
+
resetLabel: t("settings.reset"),
|
|
4126
|
+
overridden: fieldOverridden("localVoiceURI"),
|
|
4127
|
+
resettable: true,
|
|
4128
|
+
disabled: !writable,
|
|
4129
|
+
onReset: () => {
|
|
4130
|
+
resetField("localVoiceURI");
|
|
4131
|
+
},
|
|
4132
|
+
suffix: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
|
|
4133
|
+
className: "xmimo-tts-hint",
|
|
4134
|
+
style: { fontSize: "11px" },
|
|
4135
|
+
children: "Microsoft Edge – Better"
|
|
4136
|
+
})
|
|
4137
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LocalVoicePicker, {
|
|
4138
|
+
value: localVoiceURI,
|
|
4139
|
+
disabled: !writable || localSpeechMode === "disabled",
|
|
4140
|
+
label: t("settings.localVoice"),
|
|
4141
|
+
loadingLabel: t("settings.localVoiceLoading"),
|
|
4142
|
+
unavailableLabel: t("settings.localVoiceUnavailable"),
|
|
4143
|
+
offlineLabel: t("settings.localVoiceOffline"),
|
|
4144
|
+
onlineLabel: t("settings.localVoiceOnline"),
|
|
4145
|
+
onChange: onLocalVoiceURIChange
|
|
4146
|
+
})]
|
|
4147
|
+
}),
|
|
4148
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3964
4149
|
className: "xmimo-tts-format",
|
|
3965
4150
|
children: [
|
|
3966
4151
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingFieldHeading, {
|
|
3967
|
-
label: t("settings.
|
|
4152
|
+
label: t("settings.readScope"),
|
|
3968
4153
|
overriddenLabel: t("settings.overridden"),
|
|
3969
4154
|
resetLabel: t("settings.reset"),
|
|
3970
|
-
overridden: fieldOverridden("
|
|
4155
|
+
overridden: fieldOverridden("readScope"),
|
|
3971
4156
|
resettable: true,
|
|
3972
4157
|
disabled: !writable,
|
|
3973
4158
|
onReset: () => {
|
|
3974
|
-
resetField("
|
|
4159
|
+
resetField("readScope");
|
|
3975
4160
|
}
|
|
3976
4161
|
}),
|
|
3977
4162
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3978
4163
|
className: "xmimo-tts-format-options",
|
|
3979
4164
|
role: "radiogroup",
|
|
3980
|
-
"aria-label": t("settings.
|
|
3981
|
-
children:
|
|
4165
|
+
"aria-label": t("settings.readScope"),
|
|
4166
|
+
children: TTS_READ_SCOPES.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3982
4167
|
"data-xmimo-select-option": "true",
|
|
3983
|
-
className:
|
|
4168
|
+
className: readScope === item ? "xmimo-tts-format-option xmimo-tts-format-option-selected" : "xmimo-tts-format-option",
|
|
3984
4169
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3985
4170
|
type: "radio",
|
|
3986
|
-
name: "xmimo-tts-
|
|
4171
|
+
name: "xmimo-tts-read-scope",
|
|
3987
4172
|
value: item,
|
|
3988
|
-
checked:
|
|
4173
|
+
checked: readScope === item,
|
|
3989
4174
|
disabled: !writable,
|
|
3990
4175
|
onChange: () => {
|
|
3991
|
-
|
|
4176
|
+
onReadScopeChange(item);
|
|
3992
4177
|
}
|
|
3993
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: item
|
|
4178
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(readScopeLabel(item)) })]
|
|
3994
4179
|
}, item))
|
|
3995
4180
|
}),
|
|
3996
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t(
|
|
4181
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t(readScopeHint(readScope)) })
|
|
3997
4182
|
]
|
|
3998
|
-
})] }) : null,
|
|
3999
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4000
|
-
className: "xmimo-tts-voice",
|
|
4001
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingFieldHeading, {
|
|
4002
|
-
label: t("settings.localVoice"),
|
|
4003
|
-
overriddenLabel: t("settings.overridden"),
|
|
4004
|
-
resetLabel: t("settings.reset"),
|
|
4005
|
-
overridden: fieldOverridden("localVoiceURI"),
|
|
4006
|
-
resettable: true,
|
|
4007
|
-
disabled: !writable,
|
|
4008
|
-
onReset: () => {
|
|
4009
|
-
resetField("localVoiceURI");
|
|
4010
|
-
}
|
|
4011
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LocalVoicePicker, {
|
|
4012
|
-
value: localVoiceURI,
|
|
4013
|
-
disabled: !writable || localSpeechMode === "disabled",
|
|
4014
|
-
label: t("settings.localVoice"),
|
|
4015
|
-
loadingLabel: t("settings.localVoiceLoading"),
|
|
4016
|
-
unavailableLabel: t("settings.localVoiceUnavailable"),
|
|
4017
|
-
offlineLabel: t("settings.localVoiceOffline"),
|
|
4018
|
-
onlineLabel: t("settings.localVoiceOnline"),
|
|
4019
|
-
onChange: onLocalVoiceURIChange
|
|
4020
|
-
})]
|
|
4021
4183
|
}),
|
|
4022
4184
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4023
4185
|
className: "xmimo-tts-format",
|
|
@@ -4160,13 +4322,6 @@ function SoundEffectsPanel({ t, controller, enabled, volume, pack, taskSounds, c
|
|
|
4160
4322
|
volume
|
|
4161
4323
|
]);
|
|
4162
4324
|
const setEnabled = (next) => {
|
|
4163
|
-
controller.update({
|
|
4164
|
-
enabled: next,
|
|
4165
|
-
volume,
|
|
4166
|
-
pack,
|
|
4167
|
-
taskSounds: next,
|
|
4168
|
-
clickSounds: next
|
|
4169
|
-
});
|
|
4170
4325
|
onEnabledChange(next);
|
|
4171
4326
|
};
|
|
4172
4327
|
const selectPack = (nextPack) => {
|
|
@@ -4215,6 +4370,7 @@ function SoundEffectsPanel({ t, controller, enabled, volume, pack, taskSounds, c
|
|
|
4215
4370
|
const whaleAction = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4216
4371
|
type: "button",
|
|
4217
4372
|
className: "xmimo-tts-sound-whale-button",
|
|
4373
|
+
"data-xmimo-sound-toggle": "true",
|
|
4218
4374
|
"aria-pressed": enabled,
|
|
4219
4375
|
"aria-label": t(enabled ? "settings.soundEffectsTurnOff" : "settings.soundEffectsTurnOn"),
|
|
4220
4376
|
disabled: !writable,
|
|
@@ -4321,30 +4477,40 @@ function SoundEffectsPanel({ t, controller, enabled, volume, pack, taskSounds, c
|
|
|
4321
4477
|
}, option))
|
|
4322
4478
|
})]
|
|
4323
4479
|
}),
|
|
4324
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
4325
|
-
className: "xmimo-tts-sound-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
"
|
|
4331
|
-
|
|
4332
|
-
"aria-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
backgroundPosition: `${position} center`
|
|
4341
|
-
},
|
|
4342
|
-
onAnimationEnd: () => {
|
|
4343
|
-
setPreviewingCue((current) => current === cue ? null : current);
|
|
4480
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4481
|
+
className: "xmimo-tts-sound-preview-section",
|
|
4482
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4483
|
+
id: "xmimo-tts-sound-preview-label",
|
|
4484
|
+
children: t("settings.soundEffectsPreviewLabel")
|
|
4485
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4486
|
+
className: "xmimo-tts-sound-previews",
|
|
4487
|
+
role: "group",
|
|
4488
|
+
"aria-labelledby": "xmimo-tts-sound-preview-label",
|
|
4489
|
+
children: PREVIEW_CUES.map(({ cue, position }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4490
|
+
type: "button",
|
|
4491
|
+
"data-xmimo-sound-preview": "true",
|
|
4492
|
+
disabled: !enabled,
|
|
4493
|
+
"aria-label": previewLabel(cue),
|
|
4494
|
+
onClick: () => {
|
|
4495
|
+
previewCue(cue);
|
|
4344
4496
|
},
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4497
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4498
|
+
className: previewingCue === cue ? "xmimo-tts-sound-preview-character xmimo-tts-sound-preview-character-bounce" : "xmimo-tts-sound-preview-character",
|
|
4499
|
+
style: {
|
|
4500
|
+
backgroundImage: `url(${hostRoute(TTS_SOUND_EFFECT_CUES_ASSET_ROUTE)})`,
|
|
4501
|
+
backgroundPosition: `${position} center`
|
|
4502
|
+
},
|
|
4503
|
+
onAnimationEnd: () => {
|
|
4504
|
+
setPreviewingCue((current) => current === cue ? null : current);
|
|
4505
|
+
},
|
|
4506
|
+
"aria-hidden": "true"
|
|
4507
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: previewLabel(cue) })]
|
|
4508
|
+
}, cue))
|
|
4509
|
+
})]
|
|
4510
|
+
}),
|
|
4511
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
|
|
4512
|
+
className: "xmimo-tts-sound-description",
|
|
4513
|
+
children: t("settings.soundEffectsDescription")
|
|
4348
4514
|
}),
|
|
4349
4515
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
|
|
4350
4516
|
className: "xmimo-tts-sound-supported",
|
|
@@ -4362,6 +4528,7 @@ function CharacterToggle({ kind, checked, disabled, label, stateLabel, onChange
|
|
|
4362
4528
|
const state = checked ? "on" : "off";
|
|
4363
4529
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4364
4530
|
className: `xmimo-tts-character-toggle xmimo-tts-character-toggle-${state}`,
|
|
4531
|
+
"data-xmimo-sound-toggle": kind === "sound" ? "true" : void 0,
|
|
4365
4532
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4366
4533
|
type: "checkbox",
|
|
4367
4534
|
checked,
|
|
@@ -4374,7 +4541,7 @@ function CharacterToggle({ kind, checked, disabled, label, stateLabel, onChange
|
|
|
4374
4541
|
children: [
|
|
4375
4542
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4376
4543
|
className: `xmimo-tts-character-portrait xmimo-tts-character-${kind}-${state}`,
|
|
4377
|
-
style: { backgroundImage: `url(${hostRoute(TTS_TOGGLE_CHARACTER_ASSET_ROUTE)})` },
|
|
4544
|
+
style: { backgroundImage: `url(${hostRoute(kind === "sound" ? TTS_SOUND_EFFECTS_CHARACTER_ASSET_ROUTE : TTS_TOGGLE_CHARACTER_ASSET_ROUTE)})` },
|
|
4378
4545
|
"aria-hidden": "true"
|
|
4379
4546
|
}),
|
|
4380
4547
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -4389,26 +4556,37 @@ function CharacterToggle({ kind, checked, disabled, label, stateLabel, onChange
|
|
|
4389
4556
|
})]
|
|
4390
4557
|
});
|
|
4391
4558
|
}
|
|
4392
|
-
function SwitchModule({ t, enabled, autoPlay, writable, onEnabledChange, onAutoPlayChange }) {
|
|
4559
|
+
function SwitchModule({ t, enabled, autoPlay, soundEnabled, writable, onEnabledChange, onAutoPlayChange, onSoundEnabledChange }) {
|
|
4393
4560
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
4394
4561
|
className: "xmimo-tts-switch-module",
|
|
4395
4562
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4396
4563
|
className: "xmimo-tts-switch-row xmimo-ui-row",
|
|
4397
|
-
children: [
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4564
|
+
children: [
|
|
4565
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CharacterToggle, {
|
|
4566
|
+
kind: "voice",
|
|
4567
|
+
checked: enabled,
|
|
4568
|
+
disabled: !writable,
|
|
4569
|
+
label: t(enabled ? "settings.enabledOnLabel" : "settings.enabledOffLabel"),
|
|
4570
|
+
stateLabel: t(enabled ? "settings.stateOn" : "settings.stateOff"),
|
|
4571
|
+
onChange: onEnabledChange
|
|
4572
|
+
}),
|
|
4573
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CharacterToggle, {
|
|
4574
|
+
kind: "autoplay",
|
|
4575
|
+
checked: enabled && autoPlay,
|
|
4576
|
+
disabled: !writable,
|
|
4577
|
+
label: t(enabled && autoPlay ? "settings.autoPlayOnLabel" : "settings.autoPlayOffLabel"),
|
|
4578
|
+
stateLabel: t(enabled && autoPlay ? "settings.stateOn" : "settings.stateOff"),
|
|
4579
|
+
onChange: onAutoPlayChange
|
|
4580
|
+
}),
|
|
4581
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CharacterToggle, {
|
|
4582
|
+
kind: "sound",
|
|
4583
|
+
checked: soundEnabled,
|
|
4584
|
+
disabled: !writable,
|
|
4585
|
+
label: t(soundEnabled ? "settings.soundEffectsOnLabel" : "settings.soundEffectsOffLabel"),
|
|
4586
|
+
stateLabel: t(soundEnabled ? "settings.stateOn" : "settings.stateOff"),
|
|
4587
|
+
onChange: onSoundEnabledChange
|
|
4588
|
+
})
|
|
4589
|
+
]
|
|
4412
4590
|
})
|
|
4413
4591
|
});
|
|
4414
4592
|
}
|
|
@@ -4419,14 +4597,14 @@ const EDITABLE_SETTING_FIELDS = [
|
|
|
4419
4597
|
"enabled",
|
|
4420
4598
|
"autoPlay",
|
|
4421
4599
|
"voiceVolume",
|
|
4600
|
+
"voiceRate",
|
|
4601
|
+
"readScope",
|
|
4422
4602
|
"model",
|
|
4423
4603
|
"localSpeechMode",
|
|
4424
4604
|
"localVoiceURI",
|
|
4425
4605
|
"voice",
|
|
4426
4606
|
"voiceDesignPrompt",
|
|
4427
4607
|
"voiceDesignCustomPrompt",
|
|
4428
|
-
"format",
|
|
4429
|
-
"voiceDesignPlaybackMode",
|
|
4430
4608
|
"soundEnabled",
|
|
4431
4609
|
"soundVolume",
|
|
4432
4610
|
"soundPack",
|
|
@@ -4448,12 +4626,12 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4448
4626
|
const [enabled, setEnabled] = (0, react.useState)(initial.enabled);
|
|
4449
4627
|
const [autoPlay, setAutoPlay] = (0, react.useState)(initial.autoPlay);
|
|
4450
4628
|
const [voiceVolume, setVoiceVolume] = (0, react.useState)(initial.voiceVolume);
|
|
4629
|
+
const [voiceRate, setVoiceRate] = (0, react.useState)(initial.voiceRate);
|
|
4630
|
+
const [readScope, setReadScope] = (0, react.useState)(initial.readScope);
|
|
4451
4631
|
const [model, setModel] = (0, react.useState)(initial.model);
|
|
4452
4632
|
const [localSpeechMode, setLocalSpeechMode] = (0, react.useState)(initial.localSpeechMode);
|
|
4453
4633
|
const [localVoiceURI, setLocalVoiceURI] = (0, react.useState)(initial.localVoiceURI);
|
|
4454
4634
|
const [voice, setVoice] = (0, react.useState)(initial.voice);
|
|
4455
|
-
const [format, setFormat] = (0, react.useState)(initial.format);
|
|
4456
|
-
const [voiceDesignPlaybackMode, setVoiceDesignPlaybackMode] = (0, react.useState)(initial.voiceDesignPlaybackMode);
|
|
4457
4635
|
const [voiceDesignPrompt, setVoiceDesignPrompt] = (0, react.useState)(initial.voiceDesignPrompt);
|
|
4458
4636
|
const [voiceDesignCustomPrompt, setVoiceDesignCustomPrompt] = (0, react.useState)(initial.voiceDesignCustomPrompt);
|
|
4459
4637
|
const [soundEnabled, setSoundEnabled] = (0, react.useState)(initial.soundEnabled);
|
|
@@ -4481,14 +4659,14 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4481
4659
|
enabled,
|
|
4482
4660
|
autoPlay: enabled && autoPlay,
|
|
4483
4661
|
voiceVolume,
|
|
4662
|
+
voiceRate,
|
|
4663
|
+
readScope,
|
|
4484
4664
|
model,
|
|
4485
4665
|
localSpeechMode,
|
|
4486
4666
|
localVoiceURI,
|
|
4487
4667
|
voice,
|
|
4488
4668
|
voiceDesignPrompt,
|
|
4489
4669
|
voiceDesignCustomPrompt,
|
|
4490
|
-
format,
|
|
4491
|
-
voiceDesignPlaybackMode,
|
|
4492
4670
|
soundEnabled,
|
|
4493
4671
|
soundVolume,
|
|
4494
4672
|
soundPack,
|
|
@@ -4559,12 +4737,12 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4559
4737
|
setEnabled(next.enabled);
|
|
4560
4738
|
setAutoPlay(next.autoPlay);
|
|
4561
4739
|
setVoiceVolume(next.voiceVolume);
|
|
4740
|
+
setVoiceRate(next.voiceRate);
|
|
4741
|
+
setReadScope(next.readScope);
|
|
4562
4742
|
setModel(next.model);
|
|
4563
4743
|
setLocalSpeechMode(next.localSpeechMode);
|
|
4564
4744
|
setLocalVoiceURI(next.localVoiceURI);
|
|
4565
4745
|
setVoice(next.voice);
|
|
4566
|
-
setFormat(next.format);
|
|
4567
|
-
setVoiceDesignPlaybackMode(next.voiceDesignPlaybackMode);
|
|
4568
4746
|
setVoiceDesignPrompt(next.voiceDesignPrompt);
|
|
4569
4747
|
setVoiceDesignCustomPrompt(next.voiceDesignCustomPrompt);
|
|
4570
4748
|
setSoundEnabled(next.soundEnabled);
|
|
@@ -4625,12 +4803,12 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4625
4803
|
if (field === "enabled") setEnabled(base.enabled);
|
|
4626
4804
|
if (field === "autoPlay") setAutoPlay(base.autoPlay);
|
|
4627
4805
|
if (field === "voiceVolume") setVoiceVolume(base.voiceVolume);
|
|
4806
|
+
if (field === "voiceRate") setVoiceRate(base.voiceRate);
|
|
4807
|
+
if (field === "readScope") setReadScope(base.readScope);
|
|
4628
4808
|
if (field === "model") setModel(base.model);
|
|
4629
4809
|
if (field === "localSpeechMode") setLocalSpeechMode(base.localSpeechMode);
|
|
4630
4810
|
if (field === "localVoiceURI") setLocalVoiceURI(base.localVoiceURI);
|
|
4631
4811
|
if (field === "voice") setVoice(base.voice);
|
|
4632
|
-
if (field === "format") setFormat(base.format);
|
|
4633
|
-
if (field === "voiceDesignPlaybackMode") setVoiceDesignPlaybackMode(base.voiceDesignPlaybackMode);
|
|
4634
4812
|
if (field === "voiceDesignPrompt") {
|
|
4635
4813
|
setVoiceDesignPrompt(base.voiceDesignPrompt);
|
|
4636
4814
|
setVoiceDesignAiState("idle");
|
|
@@ -4650,12 +4828,12 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4650
4828
|
setEnabled(next.enabled);
|
|
4651
4829
|
setAutoPlay(next.autoPlay);
|
|
4652
4830
|
setVoiceVolume(next.voiceVolume);
|
|
4831
|
+
setVoiceRate(next.voiceRate);
|
|
4832
|
+
setReadScope(next.readScope);
|
|
4653
4833
|
setModel(next.model);
|
|
4654
4834
|
setLocalSpeechMode(next.localSpeechMode);
|
|
4655
4835
|
setLocalVoiceURI(next.localVoiceURI);
|
|
4656
4836
|
setVoice(next.voice);
|
|
4657
|
-
setFormat(next.format);
|
|
4658
|
-
setVoiceDesignPlaybackMode(next.voiceDesignPlaybackMode);
|
|
4659
4837
|
setVoiceDesignPrompt(next.voiceDesignPrompt);
|
|
4660
4838
|
setVoiceDesignCustomPrompt(next.voiceDesignCustomPrompt);
|
|
4661
4839
|
setSoundEnabled(next.soundEnabled);
|
|
@@ -4718,9 +4896,8 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4718
4896
|
localVoiceURI,
|
|
4719
4897
|
voice,
|
|
4720
4898
|
voiceDesignPrompt,
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
voiceVolume
|
|
4899
|
+
voiceVolume,
|
|
4900
|
+
voiceRate
|
|
4724
4901
|
});
|
|
4725
4902
|
};
|
|
4726
4903
|
const changeEnabled = (next) => {
|
|
@@ -4750,6 +4927,37 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4750
4927
|
} else markChange("autoPlay");
|
|
4751
4928
|
setState("idle");
|
|
4752
4929
|
};
|
|
4930
|
+
const changeSoundEnabled = (next) => {
|
|
4931
|
+
if (next) {
|
|
4932
|
+
controller.update({
|
|
4933
|
+
enabled: true,
|
|
4934
|
+
volume: soundVolume,
|
|
4935
|
+
pack: soundPack,
|
|
4936
|
+
taskSounds: true,
|
|
4937
|
+
clickSounds: true
|
|
4938
|
+
});
|
|
4939
|
+
controller.play("toggle-on");
|
|
4940
|
+
} else {
|
|
4941
|
+
controller.play("toggle-off");
|
|
4942
|
+
controller.update({
|
|
4943
|
+
enabled: false,
|
|
4944
|
+
volume: soundVolume,
|
|
4945
|
+
pack: soundPack,
|
|
4946
|
+
taskSounds: false,
|
|
4947
|
+
clickSounds: false
|
|
4948
|
+
});
|
|
4949
|
+
}
|
|
4950
|
+
setSoundEnabled(next);
|
|
4951
|
+
setTaskSounds(next);
|
|
4952
|
+
setClickSounds(next);
|
|
4953
|
+
setChanges((current) => ({
|
|
4954
|
+
...current,
|
|
4955
|
+
soundEnabled: { kind: "set" },
|
|
4956
|
+
taskSounds: { kind: "set" },
|
|
4957
|
+
clickSounds: { kind: "set" }
|
|
4958
|
+
}));
|
|
4959
|
+
setState("idle");
|
|
4960
|
+
};
|
|
4753
4961
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
4754
4962
|
className: open ? "xmimo-tts-card xmimo-tts-card-open xmimo-ui-scope" : "xmimo-tts-card xmimo-ui-scope",
|
|
4755
4963
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -4785,9 +4993,11 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4785
4993
|
t,
|
|
4786
4994
|
enabled,
|
|
4787
4995
|
autoPlay,
|
|
4996
|
+
soundEnabled,
|
|
4788
4997
|
writable: snapshot.writable,
|
|
4789
4998
|
onEnabledChange: changeEnabled,
|
|
4790
|
-
onAutoPlayChange: changeAutoPlay
|
|
4999
|
+
onAutoPlayChange: changeAutoPlay,
|
|
5000
|
+
onSoundEnabledChange: changeSoundEnabled
|
|
4791
5001
|
}),
|
|
4792
5002
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ApiKeyModule, {
|
|
4793
5003
|
t,
|
|
@@ -4808,12 +5018,12 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4808
5018
|
writable: snapshot.writable,
|
|
4809
5019
|
autoPlay,
|
|
4810
5020
|
voiceVolume,
|
|
5021
|
+
voiceRate,
|
|
5022
|
+
readScope,
|
|
4811
5023
|
model,
|
|
4812
5024
|
localSpeechMode,
|
|
4813
5025
|
localVoiceURI,
|
|
4814
5026
|
voice,
|
|
4815
|
-
format,
|
|
4816
|
-
voiceDesignPlaybackMode,
|
|
4817
5027
|
voiceDesignPrompt,
|
|
4818
5028
|
voiceDesignCustomPrompt,
|
|
4819
5029
|
voiceDesignAiState,
|
|
@@ -4832,6 +5042,17 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4832
5042
|
onVoiceVolumeInteractionEnd: (next) => {
|
|
4833
5043
|
toggleSoundPlayer.previewVolume(next);
|
|
4834
5044
|
},
|
|
5045
|
+
onVoiceRateChange: (next) => {
|
|
5046
|
+
setVoiceRate(next);
|
|
5047
|
+
markChange("voiceRate");
|
|
5048
|
+
},
|
|
5049
|
+
onVoiceRateInteractionEnd: (next) => {
|
|
5050
|
+
controller.play("success", { playbackRate: next });
|
|
5051
|
+
},
|
|
5052
|
+
onReadScopeChange: (next) => {
|
|
5053
|
+
setReadScope(next);
|
|
5054
|
+
markChange("readScope");
|
|
5055
|
+
},
|
|
4835
5056
|
onModelChange: (nextModel) => {
|
|
4836
5057
|
setModel(nextModel);
|
|
4837
5058
|
setVoiceDesignAiState("idle");
|
|
@@ -4849,18 +5070,10 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4849
5070
|
setState("idle");
|
|
4850
5071
|
setVoiceDesignAiState("idle");
|
|
4851
5072
|
},
|
|
4852
|
-
onVoiceDesignPlaybackModeChange: (next) => {
|
|
4853
|
-
setVoiceDesignPlaybackMode(next);
|
|
4854
|
-
markChange("voiceDesignPlaybackMode");
|
|
4855
|
-
},
|
|
4856
5073
|
onVoiceChange: (next) => {
|
|
4857
5074
|
setVoice(next);
|
|
4858
5075
|
markChange("voice");
|
|
4859
5076
|
},
|
|
4860
|
-
onFormatChange: (next) => {
|
|
4861
|
-
setFormat(next);
|
|
4862
|
-
markChange("format");
|
|
4863
|
-
},
|
|
4864
5077
|
onLocalVoiceURIChange: (next) => {
|
|
4865
5078
|
setLocalVoiceURI(next);
|
|
4866
5079
|
markChange("localVoiceURI");
|
|
@@ -4895,18 +5108,7 @@ function SettingsCard({ scope, t, connection, controller }) {
|
|
|
4895
5108
|
onToggle: () => {
|
|
4896
5109
|
setSoundEffectsOpen((current) => !current);
|
|
4897
5110
|
},
|
|
4898
|
-
onEnabledChange:
|
|
4899
|
-
setSoundEnabled(next);
|
|
4900
|
-
setTaskSounds(next);
|
|
4901
|
-
setClickSounds(next);
|
|
4902
|
-
setChanges((current) => ({
|
|
4903
|
-
...current,
|
|
4904
|
-
soundEnabled: { kind: "set" },
|
|
4905
|
-
taskSounds: { kind: "set" },
|
|
4906
|
-
clickSounds: { kind: "set" }
|
|
4907
|
-
}));
|
|
4908
|
-
setState("idle");
|
|
4909
|
-
},
|
|
5111
|
+
onEnabledChange: changeSoundEnabled,
|
|
4910
5112
|
onVolumeChange: (next) => {
|
|
4911
5113
|
setSoundVolume(next);
|
|
4912
5114
|
markChange("soundVolume");
|
|
@@ -6261,6 +6463,7 @@ function ie(e = {}) {
|
|
|
6261
6463
|
//#region src/client/sound-effects/click-classifier.ts
|
|
6262
6464
|
function classifyClick(target) {
|
|
6263
6465
|
if (!(target instanceof Element)) return null;
|
|
6466
|
+
if (target.closest("[data-xmimo-sound-toggle]") !== null) return null;
|
|
6264
6467
|
if (target.closest("[data-xmimo-sound-preview]") !== null) return null;
|
|
6265
6468
|
if (target.closest("[data-xmimo-sound-pack-option]") !== null) return null;
|
|
6266
6469
|
const selectOption = target.closest("[data-xmimo-select-option]");
|
|
@@ -6326,10 +6529,10 @@ function createSoundEffectsController() {
|
|
|
6326
6529
|
return player;
|
|
6327
6530
|
};
|
|
6328
6531
|
return {
|
|
6329
|
-
play(cue) {
|
|
6532
|
+
play(cue, options) {
|
|
6330
6533
|
if (!settings.enabled || !VALID_CUES.has(cue)) return;
|
|
6331
6534
|
try {
|
|
6332
|
-
getPlayer().play(cue);
|
|
6535
|
+
getPlayer().play(cue, options);
|
|
6333
6536
|
} catch {}
|
|
6334
6537
|
},
|
|
6335
6538
|
preview(cue) {
|
|
@@ -6466,7 +6669,7 @@ var card_default = "/*\r\n * Settings card shell: collapsible header, title, des
|
|
|
6466
6669
|
|
|
6467
6670
|
//#endregion
|
|
6468
6671
|
//#region src/client/style/fields.css?raw
|
|
6469
|
-
var fields_default = "/*\r\n * Form fields: grid layout, inputs/selects/textareas, field headings and badges, reset link, model switch, audio format options.\r\n */\r\n\r\n.xmimo-tts-grid {\r\n display: grid;\r\n grid-template-columns: minmax(0, 1fr);\r\n gap: 0;\r\n align-items: start\r\n}\r\n\r\n.xmimo-tts-grid>* {\r\n box-sizing: border-box;\r\n padding: 8px 0;\r\n border-top: 1px solid var(--xmimo-ui-border-soft)\r\n}\r\n\r\n.xmimo-tts-grid>:first-child {\r\n border-top: 0\r\n}\r\n\r\n.xmimo-tts-grid label,\r\n.xmimo-tts-api-key,\r\n.xmimo-tts-model,\r\n.xmimo-tts-format,\r\n.xmimo-tts-voice-design-prompt,\r\n.xmimo-tts-voice {\r\n display: flex;\r\n min-width: 0;\r\n flex-direction: column;\r\n gap: 6px;\r\n font-size: 13px\r\n}\r\n\r\n.xmimo-tts-grid input,\r\n.xmimo-tts-grid select,\r\n.xmimo-tts-grid textarea {\r\n box-sizing: border-box;\r\n width: 100%;\r\n border: 1px solid var(--xmimo-ui-border-soft);\r\n border-radius: var(--xmimo-ui-control-radius);\r\n padding: 8px 10px;\r\n color: var(--xmimo-ui-text);\r\n background: var(--xmimo-ui-control-surface);\r\n font: inherit\r\n}\r\n\r\n.xmimo-tts-grid select {\r\n color-scheme: light dark\r\n}\r\n\r\n.xmimo-tts-grid select option {\r\n color: var(--xmimo-ui-text);\r\n background: var(--xmimo-ui-surface)\r\n}\r\n\r\n.xmimo-tts-grid select:focus-visible {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 1px\r\n}\r\n\r\n.xmimo-tts-grid small {\r\n color: var(--dsw-alias-label-tertiary, #8b93a1);\r\n line-height: 17px\r\n}\r\n\r\n.xmimo-tts-field-heading {\r\n display: flex;\r\n min-width: 0;\r\n min-height: 20px;\r\n flex-direction: row !important;\r\n align-items: center;\r\n justify-content: space-between;\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-field-label {\r\n display: inline-flex;\r\n min-width: 0;\r\n align-items: center;\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-api-key-link {\r\n color: var(--dsw-alias-brand-primary, #4f6ef7);\r\n font-size: 12px;\r\n text-decoration: none\r\n}\r\n\r\n.xmimo-tts-api-key-link:hover {\r\n text-decoration: underline\r\n}\r\n\r\n.xmimo-tts-field-badges {\r\n display: flex !important;\r\n flex: none;\r\n flex-direction: row !important;\r\n align-items: center;\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-overridden {\r\n border-radius: 999px;\r\n padding: 1px 7px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: var(--dsw-alias-bg-module-platform, #eef0f3);\r\n font-size: 11px;\r\n line-height: 17px\r\n}\r\n\r\n.xmimo-tts-reset {\r\n padding: 0;\r\n border: 0;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: transparent;\r\n font: inherit;\r\n font-size: 12px;\r\n cursor: pointer\r\n}\r\n\r\n.xmimo-tts-reset:hover:not(:disabled) {\r\n color: var(--dsw-alias-label-primary, #1f2328)\r\n}\r\n\r\n.xmimo-tts-reset:disabled {\r\n cursor: not-allowed;\r\n opacity: .45\r\n}\r\n\r\n.xmimo-tts-switch-row {\
|
|
6672
|
+
var fields_default = "/*\r\n * Form fields: grid layout, inputs/selects/textareas, field headings and badges, reset link, model switch, audio format options.\r\n */\r\n\r\n.xmimo-tts-grid {\r\n display: grid;\r\n grid-template-columns: minmax(0, 1fr);\r\n gap: 0;\r\n align-items: start\r\n}\r\n\r\n.xmimo-tts-grid>* {\r\n box-sizing: border-box;\r\n padding: 8px 0;\r\n border-top: 1px solid var(--xmimo-ui-border-soft)\r\n}\r\n\r\n.xmimo-tts-grid>:first-child {\r\n border-top: 0\r\n}\r\n\r\n.xmimo-tts-grid label,\r\n.xmimo-tts-api-key,\r\n.xmimo-tts-model,\r\n.xmimo-tts-format,\r\n.xmimo-tts-voice-design-prompt,\r\n.xmimo-tts-voice {\r\n display: flex;\r\n min-width: 0;\r\n flex-direction: column;\r\n gap: 6px;\r\n font-size: 13px\r\n}\r\n\r\n.xmimo-tts-grid input,\r\n.xmimo-tts-grid select,\r\n.xmimo-tts-grid textarea {\r\n box-sizing: border-box;\r\n width: 100%;\r\n border: 1px solid var(--xmimo-ui-border-soft);\r\n border-radius: var(--xmimo-ui-control-radius);\r\n padding: 8px 10px;\r\n color: var(--xmimo-ui-text);\r\n background: var(--xmimo-ui-control-surface);\r\n font: inherit\r\n}\r\n\r\n.xmimo-tts-grid select {\r\n color-scheme: light dark\r\n}\r\n\r\n.xmimo-tts-grid select option {\r\n color: var(--xmimo-ui-text);\r\n background: var(--xmimo-ui-surface)\r\n}\r\n\r\n.xmimo-tts-grid select:focus-visible {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 1px\r\n}\r\n\r\n.xmimo-tts-grid small {\r\n color: var(--dsw-alias-label-tertiary, #8b93a1);\r\n line-height: 17px\r\n}\r\n\r\n.xmimo-tts-field-heading {\r\n display: flex;\r\n min-width: 0;\r\n min-height: 20px;\r\n flex-direction: row !important;\r\n align-items: center;\r\n justify-content: space-between;\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-field-label {\r\n display: inline-flex;\r\n min-width: 0;\r\n align-items: center;\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-api-key-link {\r\n color: var(--dsw-alias-brand-primary, #4f6ef7);\r\n font-size: 12px;\r\n text-decoration: none\r\n}\r\n\r\n.xmimo-tts-api-key-link:hover {\r\n text-decoration: underline\r\n}\r\n\r\n.xmimo-tts-field-badges {\r\n display: flex !important;\r\n flex: none;\r\n flex-direction: row !important;\r\n align-items: center;\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-overridden {\r\n border-radius: 999px;\r\n padding: 1px 7px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: var(--dsw-alias-bg-module-platform, #eef0f3);\r\n font-size: 11px;\r\n line-height: 17px\r\n}\r\n\r\n.xmimo-tts-reset {\r\n padding: 0;\r\n border: 0;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: transparent;\r\n font: inherit;\r\n font-size: 12px;\r\n cursor: pointer\r\n}\r\n\r\n.xmimo-tts-reset:hover:not(:disabled) {\r\n color: var(--dsw-alias-label-primary, #1f2328)\r\n}\r\n\r\n.xmimo-tts-reset:disabled {\r\n cursor: not-allowed;\r\n opacity: .45\r\n}\r\n\r\n.xmimo-tts-switch-row {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 12px\n}\n\r\n.xmimo-tts-format-options {\r\n display: grid;\r\n width: 100%;\r\n grid-template-columns: repeat(3, minmax(0, 1fr));\r\n gap: 6px\r\n}\r\n\r\n.xmimo-tts-format-option {\r\n position: relative;\r\n display: flex;\r\n min-width: 0;\r\n align-items: center;\r\n justify-content: center;\r\n border: 1px solid var(--xmimo-ui-border-soft);\r\n border-radius: 10px;\r\n padding: 8px 10px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: linear-gradient(180deg, var(--dsw-alias-bg-layer-1, #fff), var(--dsw-alias-bg-layer-2, #f3f4f6));\r\n font-size: 12px;\r\n font-weight: 500;\r\n text-align: center;\r\n cursor: pointer;\r\n transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease\r\n}\r\n\r\n.xmimo-tts-format-option input {\r\n position: absolute;\r\n width: 1px;\r\n height: 1px;\r\n opacity: 0\r\n}\r\n\r\n.xmimo-tts-format-option-selected {\r\n z-index: 1;\r\n border-color: color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 68%, var(--dsw-alias-border-l2, #d7dbe2));\r\n color: var(--dsw-alias-brand-primary, #4f6ef7);\r\n background: linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 16%, var(--dsw-alias-bg-layer-1, #fff)), color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 7%, var(--dsw-alias-bg-layer-2, #f3f4f6)));\r\n font-weight: 650;\r\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 13%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 24%, transparent)\r\n}\r\n\r\n.xmimo-tts-format-option::after {\r\n position: absolute;\r\n top: 6px;\r\n right: 6px;\r\n width: 6px;\r\n height: 6px;\r\n border-radius: 999px;\r\n background: var(--dsw-alias-brand-primary, #4f6ef7);\r\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 12%, transparent);\r\n content: \"\";\r\n opacity: 0;\r\n transform: scale(.65);\r\n transition: opacity 140ms ease, transform 140ms ease\r\n}\r\n\r\n.xmimo-tts-format-option-selected::after {\r\n opacity: 1;\r\n transform: scale(1)\r\n}\r\n\r\n.xmimo-tts-format-option:hover:not(:has(input:disabled)) {\r\n border-color: var(--dsw-alias-brand-primary, #4f6ef7);\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n transform: translateY(-1px);\r\n box-shadow: 0 4px 12px rgba(15, 23, 42, .08)\r\n}\r\n\r\n.xmimo-tts-format-option:has(input:disabled) {\r\n cursor: not-allowed;\r\n opacity: .5\r\n}\r\n\r\n.xmimo-tts-format-option:focus-within {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 1px\r\n}\r\n\r\n.xmimo-tts-model-switch {\r\n display: grid;\r\n grid-template-columns: repeat(2, minmax(0, 1fr));\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-model-switch-option {\r\n display: flex;\r\n min-width: 0;\r\n min-height: 44px;\r\n align-items: center;\r\n justify-content: center;\r\n border: 1px solid var(--dsw-alias-border-l2, #d7dbe2);\r\n border-radius: 9px;\r\n padding: 8px 10px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: var(--dsw-alias-bg-layer-1, #fff);\r\n font: inherit;\r\n font-size: 13px;\r\n text-align: center;\r\n cursor: pointer\r\n}\r\n\r\n.xmimo-tts-model-switch-option>span {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap\r\n}\r\n\r\n.xmimo-tts-model-switch-option:hover:not(:disabled) {\r\n border-color: var(--dsw-alias-label-dimmed, #9ca3af);\r\n color: var(--dsw-alias-label-primary, #1f2328)\r\n}\r\n\r\n.xmimo-tts-model-switch-option-selected {\r\n border-color: var(--dsw-alias-brand-primary, #4f6ef7);\r\n color: var(--dsw-alias-brand-primary, #4f6ef7);\r\n background: color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 10%, var(--dsw-alias-bg-layer-1, #fff));\r\n font-weight: 600\r\n}\r\n\r\n.xmimo-tts-model-switch-option:focus-visible {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 1px\r\n}\r\n\r\n.xmimo-tts-model-switch-option:disabled {\r\n cursor: not-allowed;\r\n opacity: .5\r\n}\r\n";
|
|
6470
6673
|
|
|
6471
6674
|
//#endregion
|
|
6472
6675
|
//#region src/client/style/voice.css?raw
|
|
@@ -6478,7 +6681,7 @@ var card_actions_default = "/*\r\n * Settings card action bar: install/update, s
|
|
|
6478
6681
|
|
|
6479
6682
|
//#endregion
|
|
6480
6683
|
//#region src/client/style/character.css?raw
|
|
6481
|
-
var character_default = "/*\r\n * Character toggle: the portrait mascot switch (voice / autoplay on-off states).\r\n */\r\n\r\n.xmimo-tts-character-toggle {\r\n position: relative;\r\n display: flex !important;\r\n min-width: 0;\r\n flex: 1;\r\n align-items: stretch;\r\n gap: 0 !important;\r\n cursor: pointer\r\n}\r\n\r\n.xmimo-tts-character-toggle>input {\r\n position: absolute;\r\n width: 1px !important;\r\n height: 1px;\r\n margin: 0 !important;\r\n padding: 0 !important;\r\n overflow: hidden;\r\n border: 0 !important;\r\n opacity: 0;\r\n clip-path: inset(50%)\r\n}\r\n\r\n.xmimo-tts-character-control {\r\n box-sizing: border-box;\r\n position: relative;\r\n display: flex !important;\r\n width: 100%;\r\n min-width: 0;\r\n overflow: hidden;\r\n align-items: center;\r\n justify-content: flex-end;\r\n flex-direction: column;\r\n border: 1px solid var(--dsw-alias-border-l2, #d7dbe2);\r\n border-radius: 18px;\r\n padding: 8px 10px 10px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 8%, var(--dsw-alias-bg-layer-1, #fff)), var(--dsw-alias-bg-layer-1, #fff));\r\n box-shadow: 0 3px 12px rgba(47, 74, 145, .08);\r\n text-align: center;\r\n transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease\r\n}\r\n\r\n.xmimo-tts-character-portrait {\r\n display: block !important;\r\n width: 153px;\r\n height: 140px;\r\n max-width: 100%;\r\n flex: none;\r\n background-repeat: no-repeat;\r\n background-size: 200% 200%;\r\n filter: saturate(.72);\r\n opacity: .78;\r\n transition: filter 180ms ease, opacity 180ms ease, transform 180ms ease\r\n}\r\n\r\n.xmimo-tts-character-voice-on {\r\n background-position: left top\r\n}\r\n\r\n.xmimo-tts-character-voice-off {\r\n background-position: right top\r\n}\r\n\r\n.xmimo-tts-character-autoplay-on {\r\n background-position: left bottom\r\n}\r\n\r\n.xmimo-tts-character-autoplay-off {\
|
|
6684
|
+
var character_default = "/*\r\n * Character toggle: the portrait mascot switch (voice / autoplay on-off states).\r\n */\r\n\r\n.xmimo-tts-character-toggle {\r\n position: relative;\r\n display: flex !important;\r\n min-width: 0;\r\n flex: 1;\r\n align-items: stretch;\r\n gap: 0 !important;\r\n cursor: pointer\r\n}\r\n\r\n.xmimo-tts-character-toggle>input {\r\n position: absolute;\r\n width: 1px !important;\r\n height: 1px;\r\n margin: 0 !important;\r\n padding: 0 !important;\r\n overflow: hidden;\r\n border: 0 !important;\r\n opacity: 0;\r\n clip-path: inset(50%)\r\n}\r\n\r\n.xmimo-tts-character-control {\r\n box-sizing: border-box;\r\n position: relative;\r\n display: flex !important;\r\n width: 100%;\r\n min-width: 0;\r\n overflow: hidden;\r\n align-items: center;\r\n justify-content: flex-end;\r\n flex-direction: column;\r\n border: 1px solid var(--dsw-alias-border-l2, #d7dbe2);\r\n border-radius: 18px;\r\n padding: 8px 10px 10px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 8%, var(--dsw-alias-bg-layer-1, #fff)), var(--dsw-alias-bg-layer-1, #fff));\r\n box-shadow: 0 3px 12px rgba(47, 74, 145, .08);\r\n text-align: center;\r\n transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease\r\n}\r\n\r\n.xmimo-tts-character-portrait {\r\n display: block !important;\r\n width: 153px;\r\n height: 140px;\r\n max-width: 100%;\r\n flex: none;\r\n background-repeat: no-repeat;\r\n background-size: 200% 200%;\r\n filter: saturate(.72);\r\n opacity: .78;\r\n transition: filter 180ms ease, opacity 180ms ease, transform 180ms ease\r\n}\r\n\r\n.xmimo-tts-character-voice-on {\r\n background-position: left top\r\n}\r\n\r\n.xmimo-tts-character-voice-off {\r\n background-position: right top\r\n}\r\n\r\n.xmimo-tts-character-autoplay-on {\r\n background-position: left bottom\r\n}\r\n\r\n.xmimo-tts-character-autoplay-off {\n background-position: right bottom\n}\n\n.xmimo-tts-character-sound-on {\n background-size: 200% 100%;\n background-position: left center\n}\n\n.xmimo-tts-character-sound-off {\n background-size: 200% 100%;\n background-position: right center\n}\n\r\n.xmimo-tts-character-copy {\r\n display: flex !important;\r\n min-width: 0;\r\n flex-direction: column;\r\n align-items: center;\r\n gap: 2px\r\n}\r\n\r\n.xmimo-tts-character-copy strong {\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n font-size: 14px;\r\n font-weight: 650;\r\n line-height: 20px\r\n}\r\n\r\n.xmimo-tts-character-copy small {\r\n min-height: 17px;\r\n color: var(--dsw-alias-label-tertiary, #8b93a1);\r\n font-size: 11px;\r\n line-height: 17px\r\n}\r\n\r\n.xmimo-tts-character-state {\r\n position: absolute;\r\n top: 9px;\r\n right: 9px;\r\n display: inline-flex !important;\r\n align-items: center;\r\n gap: 4px;\r\n border: 1px solid var(--dsw-alias-border-l2, #d7dbe2);\r\n border-radius: 999px;\r\n padding: 2px 7px;\r\n color: var(--dsw-alias-label-tertiary, #8b93a1);\r\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-1, #fff) 88%, transparent);\r\n font-size: 10px;\r\n font-weight: 600;\r\n line-height: 15px;\r\n box-shadow: 0 2px 7px rgba(15, 23, 42, .08)\r\n}\r\n\r\n.xmimo-tts-character-state>span {\r\n width: 6px;\r\n height: 6px;\r\n border-radius: 50%;\r\n background: var(--dsw-alias-label-dimmed, #aeb4bf)\r\n}\r\n\r\n.xmimo-tts-character-toggle-on .xmimo-tts-character-control {\r\n border-color: color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 55%, var(--dsw-alias-border-l2, #d7dbe2));\r\n background: linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 15%, var(--dsw-alias-bg-layer-1, #fff)), var(--dsw-alias-bg-layer-1, #fff));\r\n box-shadow: 0 5px 18px color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 16%, transparent)\r\n}\r\n\r\n.xmimo-tts-character-toggle-on .xmimo-tts-character-portrait {\r\n filter: saturate(1);\r\n opacity: 1\r\n}\r\n\r\n.xmimo-tts-character-toggle-on .xmimo-tts-character-state {\r\n border-color: color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 32%, var(--dsw-alias-border-l2, #d7dbe2));\r\n color: var(--dsw-alias-brand-primary, #4f6ef7)\r\n}\r\n\r\n.xmimo-tts-character-toggle-on .xmimo-tts-character-state>span {\r\n background: var(--dsw-alias-brand-primary, #4f6ef7);\r\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-brand-primary, #4f6ef7) 14%, transparent)\r\n}\r\n\r\n.xmimo-tts-character-toggle:hover>input:not(:disabled)+.xmimo-tts-character-control {\r\n transform: translateY(-2px);\r\n border-color: var(--dsw-alias-brand-primary, #4f6ef7);\r\n box-shadow: 0 8px 22px rgba(47, 74, 145, .16)\r\n}\r\n\r\n.xmimo-tts-character-toggle:hover>input:not(:disabled)+.xmimo-tts-character-control .xmimo-tts-character-portrait {\r\n transform: scale(1.025)\r\n}\r\n\r\n.xmimo-tts-character-toggle>input:focus-visible+.xmimo-tts-character-control {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 2px\r\n}\r\n\r\n.xmimo-tts-character-toggle>input:active:not(:disabled)+.xmimo-tts-character-control {\r\n transform: translateY(0) scale(.985)\r\n}\r\n\r\n.xmimo-tts-character-toggle>input:disabled+.xmimo-tts-character-control {\r\n cursor: not-allowed;\r\n filter: grayscale(.35);\r\n opacity: .48\r\n}\r\n";
|
|
6482
6685
|
|
|
6483
6686
|
//#endregion
|
|
6484
6687
|
//#region src/client/style/details.css?raw
|
|
@@ -6494,19 +6697,19 @@ var preview_default = "/*\r\n * TTS preview: text input, whale play button, stat
|
|
|
6494
6697
|
|
|
6495
6698
|
//#endregion
|
|
6496
6699
|
//#region src/client/style/sections.css?raw
|
|
6497
|
-
var sections_default = "/*\r\n * Settings modules: shared module surface plus the switch and API-key variants.\r\n */\r\n\r\n.xmimo-tts-switch-module {\r\n padding: 0;\r\n border: 0;\r\n background: transparent\r\n}\r\n\r\n.xmimo-tts-switch-module .xmimo-tts-character-control {\r\n border-color: transparent;\r\n border-radius: 12px;\r\n box-shadow: none\r\n}\r\n\r\n.xmimo-tts-switch-module .xmimo-tts-character-toggle-on .xmimo-tts-character-control {\r\n border-color: transparent;\r\n box-shadow: none\r\n}\r\n\r\n.xmimo-tts-switch-module .xmimo-tts-character-portrait {\
|
|
6700
|
+
var sections_default = "/*\r\n * Settings modules: shared module surface plus the switch and API-key variants.\r\n */\r\n\r\n.xmimo-tts-switch-module {\r\n padding: 0;\r\n border: 0;\r\n background: transparent\r\n}\r\n\r\n.xmimo-tts-switch-module .xmimo-tts-character-control {\r\n border-color: transparent;\r\n border-radius: 12px;\r\n box-shadow: none\r\n}\r\n\r\n.xmimo-tts-switch-module .xmimo-tts-character-toggle-on .xmimo-tts-character-control {\r\n border-color: transparent;\r\n box-shadow: none\r\n}\r\n\r\n.xmimo-tts-switch-module .xmimo-tts-character-portrait {\n width: 118px;\n height: 108px\n}\n\r\n.xmimo-tts-api-key>.xmimo-tts-field-heading {\r\n padding-right: 70px;\r\n align-items: flex-start\r\n}\r\n";
|
|
6498
6701
|
|
|
6499
6702
|
//#endregion
|
|
6500
6703
|
//#region src/client/style/sound.css?raw
|
|
6501
|
-
var sound_default = "/*\r\n * Sound effects module: toggle header, pack grid, cue previews, collapse.\r\n */\r\n.xmimo-tts-sound-effects {\r\n overflow: visible;\r\n padding: 0 !important\r\n}\r\n\r\n.xmimo-tts-sound-toggle {\r\n min-height: 92px;\r\n}\r\n\r\n.xmimo-tts-sound-heading {\r\n display: flex;\r\n min-width: 0;\r\n width: 100%;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n gap: 4px\r\n}\r\n\r\n.xmimo-tts-sound-heading>strong {\r\n font-size: 14px;\r\n font-weight: 650;\r\n line-height: 20px\r\n}\r\n\r\n.xmimo-tts-sound-heading>small {\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n width: 100%;\r\n padding-right: 68px;\r\n color: var(--dsw-alias-label-tertiary, #8b93a1);\r\n font-size: 12px;\r\n line-height: 17px;\r\n text-overflow: ellipsis;\r\n white-space: nowrap\r\n}\r\n\r\n.xmimo-tts-sound-summary {\r\n height: 30px;\r\n}\r\n\r\n.xmimo-tts-sound-whale-button {\r\n position: absolute;\r\n z-index: 3;\r\n top: 3px;\r\n right: 18px;\r\n width: 56px;\r\n height: 56px;\r\n margin: 0;\r\n border: 0;\r\n padding: 0;\r\n background: transparent;\r\n cursor: pointer\r\n}\r\n\r\n.xmimo-tts-sound-bubble {\r\n position: absolute;\r\n right: 58px;\r\n top: 18px;\r\n white-space: nowrap;\r\n border: 1px solid var(--dsw-alias-border-l2, #d7dbe2);\r\n border-radius: 8px;\r\n padding: 4px 8px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: var(--dsw-alias-bg-layer-1, #fff);\r\n font-size: 11px;\r\n box-shadow: 0 3px 10px rgba(15, 23, 42, .12)\r\n}\r\n\r\n.xmimo-tts-sound-whale-button:focus-visible {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 1px;\r\n border-radius: 45%\r\n}\r\n\r\n.xmimo-tts-sound-whale-button:disabled {\r\n cursor: not-allowed;\r\n opacity: .5\r\n}\r\n\r\n.xmimo-tts-sound-whale {\r\n display: block;\r\n width: 56px;\r\n height: 56px;\r\n pointer-events: none;\r\n background-repeat: no-repeat;\r\n background-size: 200% 100%;\r\n filter: drop-shadow(0 3px 5px rgba(15, 23, 42, .14));\r\n transform-origin: bottom center;\r\n transition: filter 180ms ease, transform 180ms ease\r\n}\r\n\r\n.xmimo-tts-sound-whale-on {\r\n background-position: left center\r\n}\r\n\r\n.xmimo-tts-sound-whale-off {\r\n background-position: right center\r\n}\r\n\r\n.xmimo-tts-sound-whale-button:hover:not(:disabled) .xmimo-tts-sound-whale {\r\n filter: drop-shadow(0 5px 8px rgba(15, 23, 42, .18)) saturate(1.06);\r\n transform: translateY(-2px)\r\n}\r\n\r\n.xmimo-tts-sound-whale-button:active:not(:disabled) .xmimo-tts-sound-whale {\r\n transform: translateY(1px) scale(.97)\r\n}\r\n\r\n.xmimo-tts-sound-collapse {\r\n display: grid;\r\n grid-template-rows: 0fr;\r\n opacity: 0;\r\n transition: grid-template-rows 220ms ease, opacity 160ms ease\r\n}\r\n\r\n.xmimo-tts-sound-collapse-open {\r\n grid-template-rows: 1fr;\r\n opacity: 1\r\n}\r\n\r\n.xmimo-tts-sound-body {\r\n box-sizing: border-box;\r\n display: flex;\r\n min-height: 0;\r\n overflow: hidden;\r\n flex-direction: column;\r\n gap: 12px;\r\n padding: 0 16px 16px\r\n}\r\n\r\n.xmimo-tts-sound-pack {\r\n display: flex;\r\n min-width: 0;\r\n flex-direction: column;\r\n gap: 7px;\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n font-size: 13px\r\n}\r\n\r\n.xmimo-tts-sound-pack-grid {\r\n display: grid;\r\n grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-sound-pack-option {\r\n --xmimo-sound-pack-accent: var(--dsw-alias-brand-primary, #4f6ef7);\r\n position: relative;\r\n display: flex;\r\n box-sizing: border-box;\r\n align-items: center;\r\n justify-content: space-between;\r\n min-width: 0;\r\n min-height: 48px;\r\n overflow: hidden;\r\n border: 1px solid var(--dsw-alias-border-l2, #d7dbe2);\r\n border-radius: 12px;\r\n padding: 8px 30px 8px 14px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: linear-gradient(\r\n 135deg,\r\n color-mix(in srgb, var(--xmimo-sound-pack-accent) 8%, var(--dsw-alias-bg-layer-1, #fff)),\r\n var(--dsw-alias-bg-layer-1, #fff)\r\n );\r\n font: inherit;\r\n font-size: 11px;\r\n text-align: left;\r\n cursor: pointer;\r\n transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease\r\n}\r\n\r\n.xmimo-tts-sound-pack-option[data-tone=\"neutral\"] {\r\n --xmimo-sound-pack-accent: var(--dsw-alias-label-dimmed, #768094)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option[data-tone=\"calm\"] {\r\n --xmimo-sound-pack-accent: #2f9c8d\r\n}\r\n\r\n.xmimo-tts-sound-pack-option[data-tone=\"cool\"] {\r\n --xmimo-sound-pack-accent: #6879e8\r\n}\r\n\r\n.xmimo-tts-sound-pack-option[data-tone=\"bright\"] {\r\n --xmimo-sound-pack-accent: #e18a3d\r\n}\r\n\r\n.xmimo-tts-sound-pack-option::before {\r\n position: absolute;\r\n inset: 8px auto 8px 0;\r\n width: 3px;\r\n border-radius: 999px;\r\n background: var(--xmimo-sound-pack-accent);\r\n content: \"\";\r\n pointer-events: none\r\n}\r\n\r\n.xmimo-tts-sound-pack-option::after {\r\n position: absolute;\r\n top: 50%;\r\n right: 8px;\r\n display: grid;\r\n width: 16px;\r\n height: 16px;\r\n place-items: center;\r\n border-radius: 999px;\r\n color: var(--xmimo-sound-pack-accent);\r\n background: color-mix(in srgb, var(--xmimo-sound-pack-accent) 14%, transparent);\r\n content: \"\";\r\n font-size: 10px;\r\n font-weight: 700;\r\n opacity: 0;\r\n transform: translateY(-50%) scale(.72);\r\n transition: opacity 140ms ease, transform 140ms ease\r\n}\r\n\r\n.xmimo-tts-sound-pack-name {\r\n min-width: 0;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap\r\n}\r\n\r\n.xmimo-tts-sound-pack-wave {\r\n display: inline-flex;\r\n flex: none;\r\n align-items: center;\r\n gap: 2px;\r\n margin-left: 7px;\r\n opacity: .6;\r\n transition: opacity 140ms ease, transform 140ms ease\r\n}\r\n\r\n.xmimo-tts-sound-pack-wave i {\r\n display: block;\r\n width: 2px;\r\n height: 8px;\r\n border-radius: 999px;\r\n background: var(--xmimo-sound-pack-accent);\r\n transition: height 140ms ease, background 140ms ease\r\n}\r\n\r\n.xmimo-tts-sound-pack-wave i:nth-child(2) {\r\n height: 13px\r\n}\r\n\r\n.xmimo-tts-sound-pack-wave i:nth-child(3) {\r\n height: 10px\r\n}\r\n\r\n.xmimo-tts-sound-pack-option:hover:not(:disabled) {\r\n border-color: var(--xmimo-sound-pack-accent);\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n transform: translateY(-1px);\r\n box-shadow: 0 4px 12px rgba(15, 23, 42, .10)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option:active:not(:disabled) {\r\n transform: scale(.97)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-selected {\r\n border-color: var(--xmimo-sound-pack-accent);\r\n color: var(--xmimo-sound-pack-accent);\r\n background: linear-gradient(\r\n 135deg,\r\n color-mix(in srgb, var(--xmimo-sound-pack-accent) 15%, var(--dsw-alias-bg-layer-1, #fff)),\r\n var(--dsw-alias-bg-layer-1, #fff)\r\n );\r\n font-weight: 650;\r\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--xmimo-sound-pack-accent) 16%, transparent)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-selected::after {\r\n content: \"✓\";\r\n opacity: 1;\r\n transform: translateY(-50%) scale(1)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-selected .xmimo-tts-sound-pack-wave {\r\n opacity: .3;\r\n transform: scale(.82)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-pending {\r\n cursor: progress\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-pending::after {\r\n border: 2px solid color-mix(in srgb, var(--xmimo-sound-pack-accent) 35%, transparent);\r\n border-top-color: var(--xmimo-sound-pack-accent);\r\n background: transparent;\r\n content: \"\";\r\n opacity: 1;\r\n transform: translateY(-50%);\r\n animation: xmimo-tts-sound-pack-spin 700ms linear infinite\r\n}\r\n\r\n@keyframes xmimo-tts-sound-pack-spin {\r\n to { transform: translateY(-50%) rotate(360deg) }\r\n}\r\n\r\n.xmimo-tts-sound-pack-option:focus-visible,\r\n.xmimo-tts-sound-previews button:focus-visible {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 1px\r\n}\r\n\r\n.xmimo-tts-sound-pack-option:disabled {\r\n cursor: not-allowed;\r\n opacity: .5\r\n}\r\n\r\n.xmimo-tts-sound-previews {\r\n display: grid;\r\n min-width: 0;\r\n grid-template-columns: repeat(5, minmax(72px, 1fr));\r\n gap: 7px;\r\n overflow-x: auto;\r\n overscroll-behavior-x: contain;\r\n padding: 2px 1px 4px\r\n}\r\n\r\n.xmimo-tts-sound-previews button {\r\n box-sizing: border-box;\r\n display: flex;\r\n min-width: 0;\r\n align-items: center;\r\n flex-direction: column;\r\n gap: 2px;\r\n border: 1px solid transparent;\r\n border-radius: 10px;\r\n padding: 4px 5px 6px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: transparent;\r\n font: inherit;\r\n font-size: 10px;\r\n cursor: pointer;\r\n transition: border-color 160ms ease, background 160ms ease, transform 160ms ease\r\n}\r\n\r\n.xmimo-tts-sound-previews button:hover:not(:disabled) {\r\n border-color: var(--dsw-alias-border-l2, #d7dbe2);\r\n background: var(--dsw-alias-interactive-bg-hover, #f3f4f6);\r\n transform: translateY(-2px)\r\n}\r\n\r\n.xmimo-tts-sound-previews button:disabled {\r\n cursor: not-allowed;\r\n filter: grayscale(.55);\r\n opacity: .42\r\n}\r\n\r\n.xmimo-tts-sound-previews button>span:last-child {\r\n overflow: hidden;\r\n width: 100%;\r\n text-align: center;\r\n text-overflow: ellipsis;\r\n white-space: nowrap\r\n}\r\n\r\n.xmimo-tts-sound-preview-character {\r\n display: block;\r\n width: 48px;\r\n height: 80px;\r\n flex: none;\r\n background-repeat: no-repeat;\r\n background-size: 500% 100%;\r\n filter: drop-shadow(0 2px 3px rgba(15, 23, 42, .12))\r\n}\r\n\r\n@keyframes xmimo-tts-sound-preview-bounce {\r\n 0%, 100% { transform: translateY(0) rotate(0deg) }\r\n 35% { transform: translateY(-8px) rotate(-4deg) }\r\n 65% { transform: translateY(1px) rotate(2deg) }\r\n}\r\n\r\n.xmimo-tts-sound-preview-character-bounce {\r\n animation: xmimo-tts-sound-preview-bounce 420ms ease-out\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n .xmimo-tts-sound-preview-character-bounce {\r\n animation: none\r\n }\r\n}\r\n\r\n.xmimo-tts-sound-supported {\r\n text-align: center;\r\n display: inline-block;\r\n max-width: 100%;\r\n box-sizing: border-box;\r\n margin-top: 3px;\r\n padding: 5px;\r\n border: 1px solid color-mix(in srgb, var(--dsw-alias-border-l2, #d7dbe2) 70%, transparent);\r\n border-radius: 999px;\r\n color: var(--dsw-alias-label-tertiary, #8b93a1);\r\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-2, #f7f8fa) 72%, transparent);\r\n font-size: 12px;\r\n line-height: 14px;\r\n overflow-wrap: anywhere\r\n}\r\n\r\n.xmimo-tts-sound-collapse:not(.xmimo-tts-sound-collapse-open) .xmimo-tts-sound-body {\r\n padding-bottom: 0\r\n}\r\n";
|
|
6704
|
+
var sound_default = "/*\r\n * Sound effects module: toggle header, pack grid, cue previews, collapse.\r\n */\r\n.xmimo-tts-sound-effects {\r\n overflow: visible;\r\n padding: 0 !important\r\n}\r\n\r\n.xmimo-tts-sound-toggle {\r\n min-height: 92px;\r\n}\r\n\r\n.xmimo-tts-sound-heading {\r\n display: flex;\r\n min-width: 0;\r\n width: 100%;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n gap: 4px\r\n}\r\n\r\n.xmimo-tts-sound-heading>strong {\r\n font-size: 14px;\r\n font-weight: 650;\r\n line-height: 20px\r\n}\r\n\r\n.xmimo-tts-sound-heading>small {\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n width: 100%;\r\n padding-right: 68px;\r\n color: var(--dsw-alias-label-tertiary, #8b93a1);\r\n font-size: 12px;\r\n line-height: 17px;\r\n text-overflow: ellipsis;\r\n white-space: nowrap\r\n}\r\n\r\n.xmimo-tts-sound-summary {\r\n height: 30px;\r\n}\r\n\r\n.xmimo-tts-sound-whale-button {\r\n position: absolute;\r\n z-index: 3;\r\n top: 3px;\r\n right: 18px;\r\n width: 56px;\r\n height: 56px;\r\n margin: 0;\r\n border: 0;\r\n padding: 0;\r\n background: transparent;\r\n cursor: pointer\r\n}\r\n\r\n.xmimo-tts-sound-bubble {\r\n position: absolute;\r\n right: 58px;\r\n top: 18px;\r\n white-space: nowrap;\r\n border: 1px solid var(--dsw-alias-border-l2, #d7dbe2);\r\n border-radius: 8px;\r\n padding: 4px 8px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: var(--dsw-alias-bg-layer-1, #fff);\r\n font-size: 11px;\r\n box-shadow: 0 3px 10px rgba(15, 23, 42, .12)\r\n}\r\n\r\n.xmimo-tts-sound-whale-button:focus-visible {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 1px;\r\n border-radius: 45%\r\n}\r\n\r\n.xmimo-tts-sound-whale-button:disabled {\r\n cursor: not-allowed;\r\n opacity: .5\r\n}\r\n\r\n.xmimo-tts-sound-whale {\r\n display: block;\r\n width: 56px;\r\n height: 56px;\r\n pointer-events: none;\r\n background-repeat: no-repeat;\r\n background-size: 200% 100%;\r\n filter: drop-shadow(0 3px 5px rgba(15, 23, 42, .14));\r\n transform-origin: bottom center;\r\n transition: filter 180ms ease, transform 180ms ease\r\n}\r\n\r\n.xmimo-tts-sound-whale-on {\r\n background-position: left center\r\n}\r\n\r\n.xmimo-tts-sound-whale-off {\r\n background-position: right center\r\n}\r\n\r\n.xmimo-tts-sound-whale-button:hover:not(:disabled) .xmimo-tts-sound-whale {\r\n filter: drop-shadow(0 5px 8px rgba(15, 23, 42, .18)) saturate(1.06);\r\n transform: translateY(-2px)\r\n}\r\n\r\n.xmimo-tts-sound-whale-button:active:not(:disabled) .xmimo-tts-sound-whale {\r\n transform: translateY(1px) scale(.97)\r\n}\r\n\r\n.xmimo-tts-sound-collapse {\r\n display: grid;\r\n grid-template-rows: 0fr;\r\n opacity: 0;\r\n transition: grid-template-rows 220ms ease, opacity 160ms ease\r\n}\r\n\r\n.xmimo-tts-sound-collapse-open {\r\n grid-template-rows: 1fr;\r\n opacity: 1\r\n}\r\n\r\n.xmimo-tts-sound-body {\r\n box-sizing: border-box;\r\n display: flex;\r\n min-height: 0;\r\n overflow: hidden;\r\n flex-direction: column;\r\n gap: 12px;\r\n padding: 0 16px 16px\r\n}\r\n\r\n.xmimo-tts-sound-pack {\r\n display: flex;\r\n min-width: 0;\r\n flex-direction: column;\r\n gap: 7px;\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n font-size: 13px\r\n}\r\n\r\n.xmimo-tts-sound-pack-grid {\r\n display: grid;\r\n grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));\r\n gap: 8px\r\n}\r\n\r\n.xmimo-tts-sound-pack-option {\r\n --xmimo-sound-pack-accent: var(--dsw-alias-brand-primary, #4f6ef7);\r\n position: relative;\r\n display: flex;\r\n box-sizing: border-box;\r\n align-items: center;\r\n justify-content: space-between;\r\n min-width: 0;\r\n min-height: 48px;\r\n overflow: hidden;\r\n border: 1px solid var(--dsw-alias-border-l2, #d7dbe2);\r\n border-radius: 12px;\r\n padding: 8px 30px 8px 14px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: linear-gradient(\r\n 135deg,\r\n color-mix(in srgb, var(--xmimo-sound-pack-accent) 8%, var(--dsw-alias-bg-layer-1, #fff)),\r\n var(--dsw-alias-bg-layer-1, #fff)\r\n );\r\n font: inherit;\r\n font-size: 11px;\r\n text-align: left;\r\n cursor: pointer;\r\n transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease\r\n}\r\n\r\n.xmimo-tts-sound-pack-option[data-tone=\"neutral\"] {\r\n --xmimo-sound-pack-accent: var(--dsw-alias-label-dimmed, #768094)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option[data-tone=\"calm\"] {\r\n --xmimo-sound-pack-accent: #2f9c8d\r\n}\r\n\r\n.xmimo-tts-sound-pack-option[data-tone=\"cool\"] {\r\n --xmimo-sound-pack-accent: #6879e8\r\n}\r\n\r\n.xmimo-tts-sound-pack-option[data-tone=\"bright\"] {\r\n --xmimo-sound-pack-accent: #e18a3d\r\n}\r\n\r\n.xmimo-tts-sound-pack-option::before {\r\n position: absolute;\r\n inset: 8px auto 8px 0;\r\n width: 3px;\r\n border-radius: 999px;\r\n background: var(--xmimo-sound-pack-accent);\r\n content: \"\";\r\n pointer-events: none\r\n}\r\n\r\n.xmimo-tts-sound-pack-option::after {\r\n position: absolute;\r\n top: 50%;\r\n right: 8px;\r\n display: grid;\r\n width: 16px;\r\n height: 16px;\r\n place-items: center;\r\n border-radius: 999px;\r\n color: var(--xmimo-sound-pack-accent);\r\n background: color-mix(in srgb, var(--xmimo-sound-pack-accent) 14%, transparent);\r\n content: \"\";\r\n font-size: 10px;\r\n font-weight: 700;\r\n opacity: 0;\r\n transform: translateY(-50%) scale(.72);\r\n transition: opacity 140ms ease, transform 140ms ease\r\n}\r\n\r\n.xmimo-tts-sound-pack-name {\r\n min-width: 0;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap\r\n}\r\n\r\n.xmimo-tts-sound-pack-wave {\r\n display: inline-flex;\r\n flex: none;\r\n align-items: center;\r\n gap: 2px;\r\n margin-left: 7px;\r\n opacity: .6;\r\n transition: opacity 140ms ease, transform 140ms ease\r\n}\r\n\r\n.xmimo-tts-sound-pack-wave i {\r\n display: block;\r\n width: 2px;\r\n height: 8px;\r\n border-radius: 999px;\r\n background: var(--xmimo-sound-pack-accent);\r\n transition: height 140ms ease, background 140ms ease\r\n}\r\n\r\n.xmimo-tts-sound-pack-wave i:nth-child(2) {\r\n height: 13px\r\n}\r\n\r\n.xmimo-tts-sound-pack-wave i:nth-child(3) {\r\n height: 10px\r\n}\r\n\r\n.xmimo-tts-sound-pack-option:hover:not(:disabled) {\r\n border-color: var(--xmimo-sound-pack-accent);\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n transform: translateY(-1px);\r\n box-shadow: 0 4px 12px rgba(15, 23, 42, .10)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option:active:not(:disabled) {\r\n transform: scale(.97)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-selected {\r\n border-color: var(--xmimo-sound-pack-accent);\r\n color: var(--xmimo-sound-pack-accent);\r\n background: linear-gradient(\r\n 135deg,\r\n color-mix(in srgb, var(--xmimo-sound-pack-accent) 15%, var(--dsw-alias-bg-layer-1, #fff)),\r\n var(--dsw-alias-bg-layer-1, #fff)\r\n );\r\n font-weight: 650;\r\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--xmimo-sound-pack-accent) 16%, transparent)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-selected::after {\r\n content: \"✓\";\r\n opacity: 1;\r\n transform: translateY(-50%) scale(1)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-selected .xmimo-tts-sound-pack-wave {\r\n opacity: .3;\r\n transform: scale(.82)\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-pending {\r\n cursor: progress\r\n}\r\n\r\n.xmimo-tts-sound-pack-option-pending::after {\r\n border: 2px solid color-mix(in srgb, var(--xmimo-sound-pack-accent) 35%, transparent);\r\n border-top-color: var(--xmimo-sound-pack-accent);\r\n background: transparent;\r\n content: \"\";\r\n opacity: 1;\r\n transform: translateY(-50%);\r\n animation: xmimo-tts-sound-pack-spin 700ms linear infinite\r\n}\r\n\r\n@keyframes xmimo-tts-sound-pack-spin {\r\n to { transform: translateY(-50%) rotate(360deg) }\r\n}\r\n\r\n.xmimo-tts-sound-pack-option:focus-visible,\r\n.xmimo-tts-sound-previews button:focus-visible {\r\n outline: 2px solid var(--dsw-alias-brand-primary, #4f6ef7);\r\n outline-offset: 1px\r\n}\r\n\r\n.xmimo-tts-sound-pack-option:disabled {\r\n cursor: not-allowed;\r\n opacity: .5\r\n}\r\n\r\n.xmimo-tts-sound-preview-section {\n display: flex;\n min-width: 0;\n flex-direction: column;\n gap: 7px;\n color: var(--dsw-alias-label-primary, #1f2328);\n font-size: 13px\n}\n\n.xmimo-tts-sound-previews {\n display: grid;\r\n min-width: 0;\r\n grid-template-columns: repeat(5, minmax(72px, 1fr));\r\n gap: 7px;\r\n overflow-x: auto;\r\n overscroll-behavior-x: contain;\r\n padding: 2px 1px 4px\r\n}\r\n\r\n.xmimo-tts-sound-previews button {\r\n box-sizing: border-box;\r\n display: flex;\r\n min-width: 0;\r\n align-items: center;\r\n flex-direction: column;\r\n gap: 2px;\r\n border: 1px solid transparent;\r\n border-radius: 10px;\r\n padding: 4px 5px 6px;\r\n color: var(--dsw-alias-label-secondary, #5f6875);\r\n background: transparent;\r\n font: inherit;\r\n font-size: 10px;\r\n cursor: pointer;\r\n transition: border-color 160ms ease, background 160ms ease, transform 160ms ease\r\n}\r\n\r\n.xmimo-tts-sound-previews button:hover:not(:disabled) {\r\n border-color: var(--dsw-alias-border-l2, #d7dbe2);\r\n background: var(--dsw-alias-interactive-bg-hover, #f3f4f6);\r\n transform: translateY(-2px)\r\n}\r\n\r\n.xmimo-tts-sound-previews button:disabled {\r\n cursor: not-allowed;\r\n filter: grayscale(.55);\r\n opacity: .42\r\n}\r\n\r\n.xmimo-tts-sound-previews button>span:last-child {\r\n overflow: hidden;\r\n width: 100%;\r\n text-align: center;\r\n text-overflow: ellipsis;\r\n white-space: nowrap\r\n}\r\n\r\n.xmimo-tts-sound-preview-character {\r\n display: block;\r\n width: 48px;\r\n height: 80px;\r\n flex: none;\r\n background-repeat: no-repeat;\r\n background-size: 500% 100%;\r\n filter: drop-shadow(0 2px 3px rgba(15, 23, 42, .12))\r\n}\r\n\r\n@keyframes xmimo-tts-sound-preview-bounce {\r\n 0%, 100% { transform: translateY(0) rotate(0deg) }\r\n 35% { transform: translateY(-8px) rotate(-4deg) }\r\n 65% { transform: translateY(1px) rotate(2deg) }\r\n}\r\n\r\n.xmimo-tts-sound-preview-character-bounce {\r\n animation: xmimo-tts-sound-preview-bounce 420ms ease-out\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n .xmimo-tts-sound-preview-character-bounce {\r\n animation: none\r\n }\r\n}\n\n.xmimo-tts-sound-description {\n color: var(--dsw-alias-label-tertiary, #8b93a1);\n font-size: 12px;\n line-height: 18px\n}\n\n.xmimo-tts-sound-supported {\n text-align: center;\r\n display: inline-block;\r\n max-width: 100%;\r\n box-sizing: border-box;\r\n margin-top: 3px;\r\n padding: 5px;\r\n border: 1px solid color-mix(in srgb, var(--dsw-alias-border-l2, #d7dbe2) 70%, transparent);\r\n border-radius: 999px;\r\n color: var(--dsw-alias-label-tertiary, #8b93a1);\r\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-2, #f7f8fa) 72%, transparent);\r\n font-size: 12px;\r\n line-height: 14px;\r\n overflow-wrap: anywhere\r\n}\r\n\r\n.xmimo-tts-sound-collapse:not(.xmimo-tts-sound-collapse-open) .xmimo-tts-sound-body {\r\n padding-bottom: 0\r\n}\r\n";
|
|
6502
6705
|
|
|
6503
6706
|
//#endregion
|
|
6504
6707
|
//#region src/client/style/volume.css?raw
|
|
6505
|
-
var volume_default = "/*\r\n * Volume controls: sound volume rows and the energy slider.\r\n */\r\n\r\n.xmimo-tts-sound-volume {\r\n display: flex;\r\n flex-direction: column;\r\n padding-top: 8px;\r\n gap: 9px;\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n font-size: 13px\r\n}\r\n\r\n.xmimo-tts-sound-volume>span:first-child {\r\n font-variant-numeric: tabular-nums\r\n}\r\n\r\n.xmimo-tts-energy {\r\n position: relative;\r\n display: block;\r\n height: 32px;\r\n border-radius: 999px;\r\n background: var(--dsw-alias-bg-layer-2, #e9eaf0);\r\n isolation: isolate;\r\n --energy-color: var(--dsw-alias-brand-primary, #7563f7)\r\n}\r\n\r\n.xmimo-tts-energy-fill {\r\n position: absolute;\r\n inset: 0;\r\n border-radius: inherit;\r\n background: linear-gradient(90deg, rgba(171, 177, 198, .18), var(--energy-color) 85%);\r\n clip-path: inset(0 calc(100% - var(--volume)) 0 0 round 999px)\r\n}\r\n\r\n.xmimo-tts-energy[data-high=true] {\r\n --energy-color: #f36b45\r\n}\r\n\r\n.xmimo-tts-energy[data-high=true] .xmimo-tts-energy-fill {\r\n background: linear-gradient(90deg, rgba(171, 177, 198, .18), var(--dsw-alias-brand-primary, #7563f7) 70%, #f36b45 90%, #ef503c)\r\n}\r\n\r\n.xmimo-tts-energy-dots {\
|
|
6708
|
+
var volume_default = "/*\r\n * Volume controls: sound volume rows and the energy slider.\r\n */\r\n\r\n.xmimo-tts-sound-volume {\r\n display: flex;\r\n flex-direction: column;\r\n padding-top: 8px;\r\n gap: 9px;\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n font-size: 13px\r\n}\r\n\r\n.xmimo-tts-sound-volume>span:first-child {\r\n font-variant-numeric: tabular-nums\r\n}\r\n\r\n.xmimo-tts-energy {\r\n position: relative;\r\n display: block;\r\n height: 32px;\r\n border-radius: 999px;\r\n background: var(--dsw-alias-bg-layer-2, #e9eaf0);\r\n isolation: isolate;\r\n --energy-color: var(--dsw-alias-brand-primary, #7563f7)\r\n}\r\n\r\n.xmimo-tts-energy-fill {\r\n position: absolute;\r\n inset: 0;\r\n border-radius: inherit;\r\n background: linear-gradient(90deg, rgba(171, 177, 198, .18), var(--energy-color) 85%);\r\n clip-path: inset(0 calc(100% - var(--volume)) 0 0 round 999px)\r\n}\r\n\r\n.xmimo-tts-energy[data-high=true] {\r\n --energy-color: #f36b45\r\n}\r\n\r\n.xmimo-tts-energy[data-high=true] .xmimo-tts-energy-fill {\r\n background: linear-gradient(90deg, rgba(171, 177, 198, .18), var(--dsw-alias-brand-primary, #7563f7) 70%, #f36b45 90%, #ef503c)\r\n}\r\n\r\n.xmimo-tts-energy-dots {\n position: absolute;\n inset: 0;\n pointer-events: none\n}\n\n.xmimo-tts-energy-dots i {\n position: absolute;\n left: var(--dot-x);\n top: var(--dot-y);\n display: block;\n width: var(--dot-size);\n height: var(--dot-size);\n border-radius: 50%;\n background: #fff;\n transform: translate(-50%, -50%);\n animation: xmimo-energy-drift var(--drift-duration) ease-in-out var(--drift-delay) infinite alternate\n}\n\r\n.xmimo-tts-energy input[type=range] {\r\n appearance: none;\r\n -webkit-appearance: none;\r\n position: relative;\r\n display: block;\r\n box-sizing: border-box;\r\n width: 100%;\r\n height: 44px;\r\n top: -6px;\r\n margin: 0;\r\n border: 0;\r\n padding: 0 3px;\r\n border-radius: 999px;\r\n background: transparent;\r\n cursor: ew-resize;\r\n touch-action: pan-y\r\n}\r\n\r\n.xmimo-tts-energy input::-webkit-slider-runnable-track {\r\n height: 26px;\r\n background: transparent\r\n}\r\n\r\n.xmimo-tts-energy input::-moz-range-track {\r\n height: 26px;\r\n background: transparent\r\n}\r\n\r\n.xmimo-tts-energy input::-webkit-slider-thumb {\r\n appearance: none;\r\n -webkit-appearance: none;\r\n width: 26px;\r\n height: 26px;\r\n border: 0;\r\n border-radius: 50%;\r\n background: #fff;\r\n box-shadow: 0 1px 5px #17204030\r\n}\r\n\r\n.xmimo-tts-energy input::-moz-range-thumb {\r\n width: 26px;\r\n height: 26px;\r\n border: 0;\r\n border-radius: 50%;\r\n background: #fff;\r\n box-shadow: 0 1px 5px #17204030\r\n}\r\n\r\n.xmimo-tts-energy input:focus-visible {\r\n outline: 2px solid var(--energy-color);\r\n outline-offset: 2px\r\n}\r\n\r\n.xmimo-tts-energy[data-dragging=true] input::-webkit-slider-thumb {\r\n animation: xmimo-energy-breathe 900ms ease-in-out infinite\r\n}\r\n\r\n.xmimo-tts-energy[data-dragging=true] input::-moz-range-thumb {\r\n animation: xmimo-energy-breathe 900ms ease-in-out infinite\r\n}\r\n\r\n.xmimo-tts-energy-pulse i {\n animation: xmimo-energy-drift var(--drift-duration) ease-in-out var(--drift-delay) infinite alternate, xmimo-energy-flash 480ms ease-out both;\n animation-delay: var(--drift-delay), calc(var(--dot) * 16ms)\n}\n\r\n.xmimo-tts-energy[data-disabled=true] {\r\n opacity: .4;\r\n filter: grayscale(.7)\r\n}\r\n\r\n.xmimo-tts-energy input:disabled {\r\n cursor: not-allowed\r\n}\r\n\r\n@keyframes xmimo-energy-breathe {\r\n 0%,\r\n 100% {\r\n box-shadow: 0 0 0 4px color-mix(in srgb, var(--energy-color) 20%, transparent)\r\n }\r\n 50% {\r\n box-shadow: 0 0 0 9px color-mix(in srgb, var(--energy-color) 8%, transparent), 0 0 18px var(--energy-color)\r\n }\r\n}\r\n\r\n@keyframes xmimo-energy-flash {\n 0%,\r\n 100% {\r\n filter: brightness(1)\r\n }\r\n 35% {\r\n filter: brightness(2);\r\n box-shadow: 0 0 5px 2px #fff9\r\n }\r\n}\n\n@keyframes xmimo-energy-drift {\n from {\n transform: translate(-50%, -50%) translate(0, 0)\n }\n to {\n transform: translate(-50%, -50%) translate(var(--drift-x), var(--drift-y))\n }\n}\n\r\n.xmimo-tts-volume {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 9px;\r\n color: var(--dsw-alias-label-primary, #1f2328);\r\n font-size: 13px\r\n}\r\n\r\n.xmimo-tts-volume>.xmimo-tts-field-heading {\r\n min-height: 20px\r\n}\r\n";
|
|
6506
6709
|
|
|
6507
6710
|
//#endregion
|
|
6508
6711
|
//#region src/client/style/responsive.css?raw
|
|
6509
|
-
var responsive_default = "/*\r\n * Responsive overrides (@media max-width). Intentionally kept last: these rules override the base modules.\r\n */\r\n\r\n@media (max-width: 480px) {\r\n .xmimo-tts-builtin-voice-menu {\r\n grid-template-columns: 1fr\r\n }\r\n\r\n .xmimo-tts-switch-row {\r\n gap: 8px\r\n }\r\n .xmimo-tts-character-control {\r\n border-radius: 14px;\r\n padding-right: 6px;\r\n padding-left: 6px\r\n }\r\n .xmimo-tts-character-portrait {\r\n width: 120px;\r\n height: 110px\r\n }\r\n .xmimo-tts-character-copy small {\r\n max-width: 120px\r\n }\r\n .xmimo-tts-character-state {\r\n top: 6px;\r\n right: 6px;\r\n padding: 1px 5px\r\n }\r\n\r\n .xmimo-tts-card-body {\r\n margin-right: 12px;\r\n margin-left: 12px\r\n }\r\n .xmimo-tts-switch-module .xmimo-tts-character-portrait {\
|
|
6712
|
+
var responsive_default = "/*\r\n * Responsive overrides (@media max-width). Intentionally kept last: these rules override the base modules.\r\n */\r\n\r\n@media (max-width: 480px) {\r\n .xmimo-tts-builtin-voice-menu {\r\n grid-template-columns: 1fr\r\n }\r\n\r\n .xmimo-tts-switch-row {\r\n gap: 8px\r\n }\r\n .xmimo-tts-character-control {\r\n border-radius: 14px;\r\n padding-right: 6px;\r\n padding-left: 6px\r\n }\r\n .xmimo-tts-character-portrait {\r\n width: 120px;\r\n height: 110px\r\n }\r\n .xmimo-tts-character-copy small {\r\n max-width: 120px\r\n }\r\n .xmimo-tts-character-state {\r\n top: 6px;\r\n right: 6px;\r\n padding: 1px 5px\r\n }\r\n\r\n .xmimo-tts-card-body {\r\n margin-right: 12px;\r\n margin-left: 12px\r\n }\r\n .xmimo-tts-switch-module .xmimo-tts-character-portrait {\n width: 88px;\n height: 80px\n }\n .xmimo-tts-api-key {\r\n padding: 12px !important\r\n }\r\n .xmimo-tts-api-key>.xmimo-tts-field-heading {\r\n min-height: 20px;\r\n padding-right: 0\r\n }\r\n .xmimo-tts-details-toggle {\r\n min-height: 66px\r\n }\r\n .xmimo-tts-details-summary>span {\r\n max-width: 100px;\r\n padding-right: 6px;\r\n padding-left: 6px\r\n }\r\n .xmimo-tts-preview {\r\n padding: 12px\r\n }\r\n .xmimo-tts-preview-title {\r\n padding-right: 54px\r\n }\r\n .xmimo-tts-api-key-input>.xmimo-tts-api-key-whale,\r\n .xmimo-tts-preview-input>.xmimo-tts-preview-whale-button {\r\n right: 6px;\r\n width: 52px;\r\n height: 52px\r\n }\r\n .xmimo-tts-character-bubble {\r\n right: 58px;\r\n max-width: calc(100% - 72px);\r\n padding: 3px 6px;\r\n font-size: 10px\r\n }\r\n\r\n .xmimo-tts-mixer-whale-button {\r\n top: -9px;\r\n right: 6px\r\n }\r\n .xmimo-tts-mixer-whale-button>.xmimo-tts-mixer-whale {\r\n width: 52px;\r\n height: 52px\r\n }\r\n .xmimo-tts-ai-copy {\r\n right: 48px;\r\n bottom: 28px;\r\n font-size: 10px;\r\n padding: 3px 6px\r\n }\r\n\r\n .xmimo-tts-sound-toggle {\r\n min-height: 88px\r\n }\r\n .xmimo-tts-sound-heading>small {\r\n padding-right: 64px\r\n }\r\n .xmimo-tts-sound-summary {\r\n padding-right: 64px\r\n }\r\n .xmimo-tts-sound-whale-button,\r\n .xmimo-tts-sound-whale {\r\n width: 52px;\r\n height: 52px\r\n }\r\n .xmimo-tts-sound-whale-button {\r\n top: 7px;\r\n right: 14px\r\n }\r\n .xmimo-tts-sound-summary>span {\r\n max-width: 94px;\r\n padding-right: 5px;\r\n padding-left: 5px\r\n }\r\n .xmimo-tts-sound-body {\r\n padding-right: 12px;\r\n padding-left: 12px\r\n }\r\n .xmimo-tts-sound-pack-grid {\r\n grid-template-columns: repeat(3, minmax(0, 1fr));\r\n gap: 6px\r\n }\r\n .xmimo-tts-sound-pack-option {\r\n min-height: 46px;\r\n padding-right: 28px;\r\n padding-left: 12px;\r\n font-size: 10px\r\n }\r\n .xmimo-tts-format-options {\r\n gap: 4px\r\n }\r\n .xmimo-tts-format-option {\r\n padding-right: 6px;\r\n padding-left: 6px;\r\n font-size: 11px\r\n }\r\n .xmimo-tts-sound-previews {\r\n grid-template-columns: repeat(5, minmax(0, 1fr));\r\n gap: 2px;\r\n overflow: visible\r\n }\r\n .xmimo-tts-sound-previews button {\r\n padding-right: 1px;\r\n padding-left: 1px;\r\n font-size: 9px\r\n }\r\n .xmimo-tts-sound-preview-character {\r\n width: 36px;\r\n height: 60px\r\n }\r\n}\r\n";
|
|
6510
6713
|
|
|
6511
6714
|
//#endregion
|
|
6512
6715
|
//#region src/client/style/motion.css?raw
|
|
@@ -6514,7 +6717,7 @@ var motion_default = "/*\r\n * Reduced-motion overrides (@media prefers-reduced-
|
|
|
6514
6717
|
|
|
6515
6718
|
//#endregion
|
|
6516
6719
|
//#region src/client/style/global.css?raw
|
|
6517
|
-
var global_default = "/*\r\n * Project-wide UI system for the Xiaomi MiMo settings card.\r\n * Start here when adjusting layout or visual rhythm. Component-specific artwork,\r\n * animations, and picker styles live in the sibling *.css modules; shared dimensions\r\n * and module structure belong here so every settings module stays visually consistent.\r\n */\r\n\r\n/* ---------- Design tokens ---------- */\r\n.xmimo-ui-scope {\r\n --xmimo-ui-space-1: 4px;\r\n --xmimo-ui-space-2: 8px;\r\n --xmimo-ui-space-3: 12px;\r\n --xmimo-ui-space-4: 14px;\r\n --xmimo-ui-space-5: 16px;\r\n\r\n --xmimo-ui-module-gap: var(--xmimo-ui-space-3);\r\n --xmimo-ui-module-padding: var(--xmimo-ui-space-4);\r\n --xmimo-ui-module-radius: 12px;\r\n --xmimo-ui-control-radius: 9px;\r\n --xmimo-ui-control-height: 34px;\r\n --xmimo-ui-summary-height: 34px;\r\n --xmimo-ui-mascot-size: 56px;\r\n\r\n --xmimo-ui-text: var(--dsw-alias-label-primary, #1f2328);\r\n --xmimo-ui-text-muted: var(--dsw-alias-label-secondary, #5f6875);\r\n --xmimo-ui-text-subtle: var(--dsw-alias-label-tertiary, #8b93a1);\r\n --xmimo-ui-brand: var(--dsw-alias-brand-primary, #4f6ef7);\r\n --xmimo-ui-border: var(--dsw-alias-border-l2, #d7dbe2);\r\n --xmimo-ui-border-soft: var(--dsw-alias-border-l2, #e5e7eb);\r\n --xmimo-ui-surface: var(--dsw-alias-bg-layer-1, #fff);\r\n --xmimo-ui-control-surface: var(--dsw-alias-bg-layer-2, #f3f4f6);\r\n --xmimo-ui-chip-surface: var(--dsw-alias-bg-module-platform, #eef0f3);\r\n --xmimo-ui-hover: var(--dsw-alias-interactive-bg-hover, #f3f4f6);\r\n --xmimo-ui-focus: 2px solid var(--xmimo-ui-brand);\r\n}\r\n\r\n/* ---------- Layout primitives ---------- */\r\n.xmimo-ui-stack {\r\n display: flex;\r\n min-width: 0;\r\n flex-direction: column;\r\n gap: var(--xmimo-ui-module-gap);\r\n}\r\n\r\n.xmimo-ui-grid {\r\n display: grid;\r\n min-width: 0;\r\n}\r\n\r\n.xmimo-ui-row {\r\n display: flex;\r\n min-width: 0;\r\n gap: var(--xmimo-ui-module-gap);\r\n}\r\n\r\n/* The stack owns vertical rhythm; modules no longer negotiate margins. */\r\n.xmimo-ui-stack > * {\r\n margin-top: 0;\r\n margin-bottom: 0;\r\n}\r\n\r\n/* ---------- Shared settings module ---------- */\r\n.xmimo-ui-module {\r\n box-sizing: border-box;\r\n position: relative;\r\n min-width: 0;\r\n overflow: visible;\r\n border: 1px solid var(--xmimo-ui-border);\r\n border-radius: var(--xmimo-ui-module-radius);\r\n color: var(--xmimo-ui-text);\r\n background: var(--xmimo-ui-surface);\r\n}\r\n\r\n.xmimo-ui-module-padded {\r\n padding: var(--xmimo-ui-module-padding) !important;\r\n}\r\n\r\n.xmimo-ui-module-heading,\r\n.xmimo-ui-module-heading > strong,\r\n.xmimo-ui-module > .xmimo-tts-field-heading .xmimo-tts-field-label > span:first-child {\r\n color: var(--xmimo-ui-text);\r\n font-size: 14px;\r\n font-weight: 650;\r\n line-height: 20px;\r\n}\r\n\r\n/* ---------- Collapsible module header ---------- */\r\n.xmimo-ui-module-toggle {\r\n box-sizing: border-box;\r\n display: flex;\r\n width: 100%;\r\n min-height: 0;\r\n align-items: flex-start;\r\n border: 0;\r\n border-radius: calc(var(--xmimo-ui-module-radius) - 1px);\r\n padding: var(--xmimo-ui-space-3) var(--xmimo-ui-module-padding);\r\n color: var(--xmimo-ui-text);\r\n background: transparent;\r\n font: inherit;\r\n text-align: left;\r\n cursor: pointer;\r\n}\r\n\r\n.xmimo-ui-module-toggle:hover {\r\n background: var(--xmimo-ui-hover);\r\n}\r\n\r\n.xmimo-ui-module-toggle:focus-visible {\r\n outline: var(--xmimo-ui-focus);\r\n outline-offset: -2px;\r\n}\r\n\r\n.xmimo-ui-module-head {\r\n box-sizing: border-box;\r\n display: flex;\r\n min-width: 0;\r\n width: 100%;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n gap: var(--xmimo-ui-space-1);\r\n}\r\n\r\n.xmimo-ui-summary {\r\n box-sizing: border-box;\r\n display: flex;\r\n width: 100%;\r\n min-width: 0;\r\n min-height: var(--xmimo-ui-summary-height);\r\n align-items: center;\r\n gap: 6px;\r\n overflow: hidden;\r\n border: 1px solid var(--xmimo-ui-border);\r\n border-radius: var(--xmimo-ui-control-radius);\r\n padding: 6px
|
|
6720
|
+
var global_default = "/*\r\n * Project-wide UI system for the Xiaomi MiMo settings card.\r\n * Start here when adjusting layout or visual rhythm. Component-specific artwork,\r\n * animations, and picker styles live in the sibling *.css modules; shared dimensions\r\n * and module structure belong here so every settings module stays visually consistent.\r\n */\r\n\r\n/* ---------- Design tokens ---------- */\r\n.xmimo-ui-scope {\r\n --xmimo-ui-space-1: 4px;\r\n --xmimo-ui-space-2: 8px;\r\n --xmimo-ui-space-3: 12px;\r\n --xmimo-ui-space-4: 14px;\r\n --xmimo-ui-space-5: 16px;\r\n\r\n --xmimo-ui-module-gap: var(--xmimo-ui-space-3);\r\n --xmimo-ui-module-padding: var(--xmimo-ui-space-4);\r\n --xmimo-ui-module-radius: 12px;\r\n --xmimo-ui-control-radius: 9px;\r\n --xmimo-ui-control-height: 34px;\r\n --xmimo-ui-summary-height: 34px;\r\n --xmimo-ui-mascot-size: 56px;\r\n\r\n --xmimo-ui-text: var(--dsw-alias-label-primary, #1f2328);\r\n --xmimo-ui-text-muted: var(--dsw-alias-label-secondary, #5f6875);\r\n --xmimo-ui-text-subtle: var(--dsw-alias-label-tertiary, #8b93a1);\r\n --xmimo-ui-brand: var(--dsw-alias-brand-primary, #4f6ef7);\r\n --xmimo-ui-border: var(--dsw-alias-border-l2, #d7dbe2);\r\n --xmimo-ui-border-soft: var(--dsw-alias-border-l2, #e5e7eb);\r\n --xmimo-ui-surface: var(--dsw-alias-bg-layer-1, #fff);\r\n --xmimo-ui-control-surface: var(--dsw-alias-bg-layer-2, #f3f4f6);\r\n --xmimo-ui-chip-surface: var(--dsw-alias-bg-module-platform, #eef0f3);\r\n --xmimo-ui-hover: var(--dsw-alias-interactive-bg-hover, #f3f4f6);\r\n --xmimo-ui-focus: 2px solid var(--xmimo-ui-brand);\r\n}\r\n\r\n/* ---------- Layout primitives ---------- */\r\n.xmimo-ui-stack {\r\n display: flex;\r\n min-width: 0;\r\n flex-direction: column;\r\n gap: var(--xmimo-ui-module-gap);\r\n}\r\n\r\n.xmimo-ui-grid {\r\n display: grid;\r\n min-width: 0;\r\n}\r\n\r\n.xmimo-ui-row {\r\n display: flex;\r\n min-width: 0;\r\n gap: var(--xmimo-ui-module-gap);\r\n}\r\n\r\n/* The stack owns vertical rhythm; modules no longer negotiate margins. */\r\n.xmimo-ui-stack > * {\r\n margin-top: 0;\r\n margin-bottom: 0;\r\n}\r\n\r\n/* ---------- Shared settings module ---------- */\r\n.xmimo-ui-module {\r\n box-sizing: border-box;\r\n position: relative;\r\n min-width: 0;\r\n overflow: visible;\r\n border: 1px solid var(--xmimo-ui-border);\r\n border-radius: var(--xmimo-ui-module-radius);\r\n color: var(--xmimo-ui-text);\r\n background: var(--xmimo-ui-surface);\r\n}\r\n\r\n.xmimo-ui-module-padded {\r\n padding: var(--xmimo-ui-module-padding) !important;\r\n}\r\n\r\n.xmimo-ui-module-heading,\r\n.xmimo-ui-module-heading > strong,\r\n.xmimo-ui-module > .xmimo-tts-field-heading .xmimo-tts-field-label > span:first-child {\r\n color: var(--xmimo-ui-text);\r\n font-size: 14px;\r\n font-weight: 650;\r\n line-height: 20px;\r\n}\r\n\r\n/* ---------- Collapsible module header ---------- */\r\n.xmimo-ui-module-toggle {\r\n box-sizing: border-box;\r\n display: flex;\r\n width: 100%;\r\n min-height: 0;\r\n align-items: flex-start;\r\n border: 0;\r\n border-radius: calc(var(--xmimo-ui-module-radius) - 1px);\r\n padding: var(--xmimo-ui-space-3) var(--xmimo-ui-module-padding);\r\n color: var(--xmimo-ui-text);\r\n background: transparent;\r\n font: inherit;\r\n text-align: left;\r\n cursor: pointer;\r\n}\r\n\r\n.xmimo-ui-module-toggle:hover {\r\n background: var(--xmimo-ui-hover);\r\n}\r\n\r\n.xmimo-ui-module-toggle:focus-visible {\r\n outline: var(--xmimo-ui-focus);\r\n outline-offset: -2px;\r\n}\r\n\r\n.xmimo-ui-module-head {\r\n box-sizing: border-box;\r\n display: flex;\r\n min-width: 0;\r\n width: 100%;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n gap: var(--xmimo-ui-space-1);\r\n}\r\n\r\n.xmimo-ui-summary {\r\n box-sizing: border-box;\r\n display: flex;\r\n width: 100%;\r\n min-width: 0;\r\n min-height: var(--xmimo-ui-summary-height);\r\n align-items: center;\r\n gap: 6px;\r\n overflow: hidden;\r\n border: 1px solid var(--xmimo-ui-border);\r\n border-radius: var(--xmimo-ui-control-radius);\r\n padding: 6px 6px 6px var(--xmimo-ui-space-2);\r\n background: var(--xmimo-ui-control-surface);\r\n}\r\n\r\n.xmimo-ui-summary > span {\r\n overflow: hidden;\r\n min-width: 0;\r\n max-width: 150px;\r\n flex: 0 1 auto;\r\n border-radius: 999px;\r\n padding: 1px 7px;\r\n color: var(--xmimo-ui-text-muted);\r\n background: var(--xmimo-ui-chip-surface);\r\n font-size: 11px;\r\n font-weight: 500;\r\n line-height: 16px;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n}\r\n\r\n.xmimo-ui-module-body {\r\n box-sizing: border-box;\r\n min-width: 0;\r\n}\r\n\r\n/* ---------- Shared fields and controls ---------- */\r\n.xmimo-ui-module input:not([type='checkbox']):not([type='radio']):not([type='range']),\r\n.xmimo-ui-module select,\r\n.xmimo-ui-module textarea {\r\n border-color: var(--xmimo-ui-border);\r\n border-radius: var(--xmimo-ui-control-radius);\r\n color: var(--xmimo-ui-text);\r\n background: var(--xmimo-ui-control-surface);\r\n}\r\n\r\n.xmimo-ui-module input:not([type='checkbox']):not([type='radio']):not([type='range']),\r\n.xmimo-ui-module select {\r\n min-height: var(--xmimo-ui-control-height);\r\n}\r\n\r\n.xmimo-ui-module input:focus-visible,\r\n.xmimo-ui-module select:focus-visible,\r\n.xmimo-ui-module textarea:focus-visible {\r\n outline: var(--xmimo-ui-focus);\r\n outline-offset: 1px;\r\n}\r\n\r\n/* ---------- Module-specific placement using shared dimensions ---------- */\r\n.xmimo-ui-module .xmimo-tts-api-key-whale,\r\n.xmimo-ui-module .xmimo-tts-preview-whale-button,\r\n.xmimo-ui-module .xmimo-tts-mixer-whale,\r\n.xmimo-ui-module .xmimo-tts-sound-whale {\r\n width: var(--xmimo-ui-mascot-size);\r\n height: var(--xmimo-ui-mascot-size);\r\n}\r\n\r\n.xmimo-ui-module > .xmimo-tts-mixer-whale-button,\r\n.xmimo-ui-module > .xmimo-tts-sound-whale-button {\r\n top: -12px;\r\n right: 20px;\r\n}\r\n\r\n.xmimo-ui-module .xmimo-tts-details-heading,\r\n.xmimo-ui-module .xmimo-tts-sound-heading {\r\n gap: var(--xmimo-ui-space-1);\r\n}\r\n\r\n.xmimo-ui-module .xmimo-tts-sound-heading > small {\r\n padding-right: calc(var(--xmimo-ui-mascot-size) + var(--xmimo-ui-space-3));\r\n}\r\n\r\n.xmimo-ui-module .xmimo-tts-details-body > * {\r\n padding-right: var(--xmimo-ui-module-padding);\r\n padding-left: var(--xmimo-ui-module-padding);\r\n}\r\n\r\n.xmimo-ui-module .xmimo-tts-sound-body {\r\n gap: var(--xmimo-ui-space-3);\r\n padding: 0 var(--xmimo-ui-module-padding) var(--xmimo-ui-module-padding);\r\n}\r\n\r\n@media (max-width: 480px) {\r\n .xmimo-ui-scope {\r\n --xmimo-ui-module-padding: 12px;\r\n --xmimo-ui-mascot-size: 52px;\r\n }\r\n\r\n .xmimo-ui-summary > span {\r\n max-width: 100px;\r\n padding-right: 6px;\r\n padding-left: 6px;\r\n }\r\n}\r\n";
|
|
6518
6721
|
|
|
6519
6722
|
//#endregion
|
|
6520
6723
|
//#region src/client/style/index.ts
|
|
@@ -6629,6 +6832,14 @@ function apply(ctx) {
|
|
|
6629
6832
|
};
|
|
6630
6833
|
updateVoiceVolume();
|
|
6631
6834
|
ctx.effect(() => scope.subscribe(updateVoiceVolume), "xiaomi-mimo-tts: voice volume");
|
|
6835
|
+
const updateVoiceRate = () => {
|
|
6836
|
+
const rate = resolveTtsSettings(scope.getSnapshot().value).voiceRate;
|
|
6837
|
+
live.setVoiceRate(rate);
|
|
6838
|
+
local.setVoiceRate(rate);
|
|
6839
|
+
playback.setVoiceRate(rate);
|
|
6840
|
+
};
|
|
6841
|
+
updateVoiceRate();
|
|
6842
|
+
ctx.effect(() => scope.subscribe(updateVoiceRate), "xiaomi-mimo-tts: voice rate");
|
|
6632
6843
|
ctx.effect(() => async () => {
|
|
6633
6844
|
live.setBeforePlayback(null);
|
|
6634
6845
|
local.setBeforePlayback(null);
|