@pie-players/pie-section-player-tools-tts-settings 0.3.25 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -35,8 +35,8 @@ Without adapters, the panel uses the existing route contract:
|
|
|
35
35
|
|
|
36
36
|
and applies settings via toolkit coordinator:
|
|
37
37
|
|
|
38
|
-
- `getToolConfig("
|
|
39
|
-
- `updateToolConfig("
|
|
38
|
+
- `getToolConfig("textToSpeech")`
|
|
39
|
+
- `updateToolConfig("textToSpeech", ...)`
|
|
40
40
|
- optional `ensureTTSReady(...)`
|
|
41
41
|
|
|
42
42
|
## Custom element API
|
|
@@ -73,7 +73,7 @@ Use adapters when your host app cannot or should not expose the default route co
|
|
|
73
73
|
You can add provider tabs beyond Browser/Polly/Google through `customProviders`.
|
|
74
74
|
|
|
75
75
|
- Keep provider `id` unique and avoid reserved ids: `browser`, `polly`, `google`.
|
|
76
|
-
- The panel still owns persistence and `updateToolConfig("
|
|
76
|
+
- The panel still owns persistence and `updateToolConfig("textToSpeech", ...)`.
|
|
77
77
|
- Provider apply returns normalized output: `{ config, message? }`.
|
|
78
78
|
|
|
79
79
|
### JS adapter mode
|
package/TtsSettingsPanel.svelte
CHANGED
|
@@ -479,7 +479,7 @@ function debugPreview(event: string, payload?: Record<string, unknown>): void {
|
|
|
479
479
|
}
|
|
480
480
|
|
|
481
481
|
function initializeFromCoordinator() {
|
|
482
|
-
const existing = toolkitCoordinator?.getToolConfig?.("
|
|
482
|
+
const existing = toolkitCoordinator?.getToolConfig?.("textToSpeech") || {};
|
|
483
483
|
const stored = readStoredSettings();
|
|
484
484
|
const source = stored ? { ...existing, ...stored } : existing;
|
|
485
485
|
const resolvedDefaultApiEndpoint = getDefaultApiEndpoint();
|
|
@@ -1436,7 +1436,7 @@ function normalizePreviewSpeechMarkOffsets(
|
|
|
1436
1436
|
`Custom provider '${provider.id}' did not return apply config.`
|
|
1437
1437
|
);
|
|
1438
1438
|
}
|
|
1439
|
-
toolkitCoordinator.updateToolConfig("
|
|
1439
|
+
toolkitCoordinator.updateToolConfig("textToSpeech", {
|
|
1440
1440
|
enabled: true,
|
|
1441
1441
|
...next.config
|
|
1442
1442
|
});
|
|
@@ -1455,7 +1455,7 @@ function normalizePreviewSpeechMarkOffsets(
|
|
|
1455
1455
|
pitch: normalizePitch(browserPitch),
|
|
1456
1456
|
transportMode: "pie" as const
|
|
1457
1457
|
};
|
|
1458
|
-
toolkitCoordinator.updateToolConfig("
|
|
1458
|
+
toolkitCoordinator.updateToolConfig("textToSpeech", {
|
|
1459
1459
|
enabled: true,
|
|
1460
1460
|
...next
|
|
1461
1461
|
});
|
|
@@ -1464,7 +1464,6 @@ function normalizePreviewSpeechMarkOffsets(
|
|
|
1464
1464
|
const next = {
|
|
1465
1465
|
backend: "polly" as const,
|
|
1466
1466
|
serverProvider: "polly" as const,
|
|
1467
|
-
provider: "polly" as const,
|
|
1468
1467
|
apiEndpoint: normalizeApiEndpoint(pollyApiEndpoint, getDefaultApiEndpoint()),
|
|
1469
1468
|
transportMode: "pie" as const,
|
|
1470
1469
|
endpointMode: "synthesizePath" as const,
|
|
@@ -1483,7 +1482,7 @@ function normalizePreviewSpeechMarkOffsets(
|
|
|
1483
1482
|
speechMarkTypes: getPollySpeechMarkTypes()
|
|
1484
1483
|
}
|
|
1485
1484
|
};
|
|
1486
|
-
toolkitCoordinator.updateToolConfig("
|
|
1485
|
+
toolkitCoordinator.updateToolConfig("textToSpeech", {
|
|
1487
1486
|
enabled: true,
|
|
1488
1487
|
...next
|
|
1489
1488
|
});
|
|
@@ -1492,7 +1491,6 @@ function normalizePreviewSpeechMarkOffsets(
|
|
|
1492
1491
|
const next = {
|
|
1493
1492
|
backend: "google" as const,
|
|
1494
1493
|
serverProvider: "google" as const,
|
|
1495
|
-
provider: "google" as const,
|
|
1496
1494
|
apiEndpoint: normalizeApiEndpoint(googleApiEndpoint, getDefaultApiEndpoint()),
|
|
1497
1495
|
transportMode: "pie" as const,
|
|
1498
1496
|
endpointMode: "synthesizePath" as const,
|
|
@@ -1503,13 +1501,15 @@ function normalizePreviewSpeechMarkOffsets(
|
|
|
1503
1501
|
googleVoiceType,
|
|
1504
1502
|
googleGender
|
|
1505
1503
|
};
|
|
1506
|
-
toolkitCoordinator.updateToolConfig("
|
|
1504
|
+
toolkitCoordinator.updateToolConfig("textToSpeech", {
|
|
1507
1505
|
enabled: true,
|
|
1508
1506
|
...next
|
|
1509
1507
|
});
|
|
1510
1508
|
persistSettings(next);
|
|
1511
1509
|
}
|
|
1512
|
-
await toolkitCoordinator?.ensureTTSReady?.(
|
|
1510
|
+
await toolkitCoordinator?.ensureTTSReady?.(
|
|
1511
|
+
toolkitCoordinator?.getToolConfig?.("textToSpeech"),
|
|
1512
|
+
);
|
|
1513
1513
|
if (isBuiltInTab(activeTab)) {
|
|
1514
1514
|
applyMessage = `Applied ${activeTab} TTS settings.`;
|
|
1515
1515
|
}
|
|
@@ -3017,7 +3017,7 @@ function Of(e, t) {
|
|
|
3017
3017
|
return String(u() || "").trim() || i;
|
|
3018
3018
|
}
|
|
3019
3019
|
function xl() {
|
|
3020
|
-
const l = a()?.getToolConfig?.("
|
|
3020
|
+
const l = a()?.getToolConfig?.("textToSpeech") || {}, o = El(), c = o ? {
|
|
3021
3021
|
...l,
|
|
3022
3022
|
...o
|
|
3023
3023
|
} : l, p = ze(), k = c?.backend;
|
|
@@ -3541,7 +3541,7 @@ function Of(e, t) {
|
|
|
3541
3541
|
pitch: Bn(s(vr)),
|
|
3542
3542
|
transportMode: "pie"
|
|
3543
3543
|
};
|
|
3544
|
-
a().updateToolConfig("
|
|
3544
|
+
a().updateToolConfig("textToSpeech", {
|
|
3545
3545
|
enabled: !0,
|
|
3546
3546
|
...l
|
|
3547
3547
|
}), Qr(l);
|
|
@@ -3549,7 +3549,6 @@ function Of(e, t) {
|
|
|
3549
3549
|
const l = {
|
|
3550
3550
|
backend: "polly",
|
|
3551
3551
|
serverProvider: "polly",
|
|
3552
|
-
provider: "polly",
|
|
3553
3552
|
apiEndpoint: _t(s(Qe), ze()),
|
|
3554
3553
|
transportMode: "pie",
|
|
3555
3554
|
endpointMode: "synthesizePath",
|
|
@@ -3568,7 +3567,7 @@ function Of(e, t) {
|
|
|
3568
3567
|
speechMarkTypes: Zi()
|
|
3569
3568
|
}
|
|
3570
3569
|
};
|
|
3571
|
-
a().updateToolConfig("
|
|
3570
|
+
a().updateToolConfig("textToSpeech", {
|
|
3572
3571
|
enabled: !0,
|
|
3573
3572
|
...l
|
|
3574
3573
|
}), Qr(l);
|
|
@@ -3576,7 +3575,6 @@ function Of(e, t) {
|
|
|
3576
3575
|
const l = {
|
|
3577
3576
|
backend: "google",
|
|
3578
3577
|
serverProvider: "google",
|
|
3579
|
-
provider: "google",
|
|
3580
3578
|
apiEndpoint: _t(s($t), ze()),
|
|
3581
3579
|
transportMode: "pie",
|
|
3582
3580
|
endpointMode: "synthesizePath",
|
|
@@ -3587,7 +3585,7 @@ function Of(e, t) {
|
|
|
3587
3585
|
googleVoiceType: s(Et),
|
|
3588
3586
|
googleGender: s(xt)
|
|
3589
3587
|
};
|
|
3590
|
-
a().updateToolConfig("
|
|
3588
|
+
a().updateToolConfig("textToSpeech", {
|
|
3591
3589
|
enabled: !0,
|
|
3592
3590
|
...l
|
|
3593
3591
|
}), Qr(l);
|
|
@@ -3596,7 +3594,7 @@ function Of(e, t) {
|
|
|
3596
3594
|
const l = zn(s(_));
|
|
3597
3595
|
let o;
|
|
3598
3596
|
if (l.buildApplyConfig && (o = await l.buildApplyConfig(Un(l.id))), o?.config || (o = s(ee)[l.id]), !o?.config) throw new Error(`Custom provider '${l.id}' did not return apply config.`);
|
|
3599
|
-
a().updateToolConfig("
|
|
3597
|
+
a().updateToolConfig("textToSpeech", {
|
|
3600
3598
|
enabled: !0,
|
|
3601
3599
|
...o.config
|
|
3602
3600
|
}), Qr({
|
|
@@ -3604,7 +3602,7 @@ function Of(e, t) {
|
|
|
3604
3602
|
...o.config || {}
|
|
3605
3603
|
}), g(y, o.message || `Applied ${l.label} TTS settings.`, !0);
|
|
3606
3604
|
}
|
|
3607
|
-
await a()?.ensureTTSReady?.(a()?.getToolConfig?.("
|
|
3605
|
+
await a()?.ensureTTSReady?.(a()?.getToolConfig?.("textToSpeech")), nt(s(_)) && g(y, `Applied ${s(_)} TTS settings.`), Xr();
|
|
3608
3606
|
} catch (l) {
|
|
3609
3607
|
g(h, l instanceof Error ? l.message : String(l), !0);
|
|
3610
3608
|
} finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-section-player-tools-tts-settings",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Reusable TTS settings panel for PIE section-player development tools",
|
|
6
6
|
"repository": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
],
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@pie-players/pie-theme": "0.3.
|
|
42
|
+
"@pie-players/pie-theme": "0.3.26"
|
|
43
43
|
},
|
|
44
44
|
"types": "./dist/index.d.ts",
|
|
45
45
|
"scripts": {
|