@pie-players/pie-tool-text-to-speech 0.3.5 → 0.3.7
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 +19 -25
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -27,13 +27,13 @@ A draggable, floating tool that reads selected text aloud with word-level highli
|
|
|
27
27
|
|
|
28
28
|
```svelte
|
|
29
29
|
<script>
|
|
30
|
-
import
|
|
31
|
-
import { toolCoordinator } from '
|
|
30
|
+
import '@pie-players/pie-tool-text-to-speech/components/tool-text-to-speech-element';
|
|
31
|
+
import { toolCoordinator } from '@pie-players/pie-assessment-toolkit';
|
|
32
32
|
|
|
33
|
-
let visible = false;
|
|
33
|
+
let visible = $state(false);
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
|
-
<
|
|
36
|
+
<pie-tool-text-to-speech
|
|
37
37
|
{visible}
|
|
38
38
|
toolId="textToSpeech"
|
|
39
39
|
coordinator={toolCoordinator}
|
|
@@ -67,10 +67,10 @@ The TTS tool is automatically included when using `<pie-tool-toolbar>`:
|
|
|
67
67
|
|
|
68
68
|
## TTS Service Integration
|
|
69
69
|
|
|
70
|
-
The tool uses the shared `TTSService` from
|
|
70
|
+
The tool uses the shared `TTSService` from `@pie-players/pie-assessment-toolkit`:
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
|
-
import { ttsService } from '
|
|
73
|
+
import { ttsService } from '@pie-players/pie-assessment-toolkit';
|
|
74
74
|
|
|
75
75
|
// Initialize
|
|
76
76
|
await ttsService.initialize();
|
|
@@ -155,22 +155,16 @@ The tool handles these error scenarios:
|
|
|
155
155
|
|
|
156
156
|
```svelte
|
|
157
157
|
<script>
|
|
158
|
-
import
|
|
159
|
-
import { toolCoordinator } from '
|
|
160
|
-
import { onMount } from 'svelte';
|
|
158
|
+
import '@pie-players/pie-tool-text-to-speech/components/tool-text-to-speech-element';
|
|
159
|
+
import { toolCoordinator } from '@pie-players/pie-assessment-toolkit';
|
|
161
160
|
|
|
162
|
-
let showTTS =
|
|
161
|
+
let showTTS = $derived(
|
|
162
|
+
toolCoordinator.getToolState('textToSpeech')?.isVisible ?? false
|
|
163
|
+
);
|
|
163
164
|
|
|
164
|
-
|
|
165
|
-
// Register tool
|
|
165
|
+
$effect(() => {
|
|
166
166
|
toolCoordinator.registerTool('textToSpeech', 'Text-to-Speech');
|
|
167
167
|
});
|
|
168
|
-
|
|
169
|
-
// Subscribe to tool visibility
|
|
170
|
-
$: {
|
|
171
|
-
const state = toolCoordinator.getToolState('textToSpeech');
|
|
172
|
-
showTTS = state?.isVisible ?? false;
|
|
173
|
-
}
|
|
174
168
|
</script>
|
|
175
169
|
|
|
176
170
|
<!-- Assessment content -->
|
|
@@ -179,12 +173,12 @@ The tool handles these error scenarios:
|
|
|
179
173
|
</div>
|
|
180
174
|
|
|
181
175
|
<!-- TTS button -->
|
|
182
|
-
<button
|
|
176
|
+
<button onclick={() => toolCoordinator.toggleTool('textToSpeech')}>
|
|
183
177
|
🔊 Text-to-Speech
|
|
184
178
|
</button>
|
|
185
179
|
|
|
186
180
|
<!-- TTS tool -->
|
|
187
|
-
<
|
|
181
|
+
<pie-tool-text-to-speech
|
|
188
182
|
visible={showTTS}
|
|
189
183
|
toolId="textToSpeech"
|
|
190
184
|
coordinator={toolCoordinator}
|
|
@@ -199,11 +193,11 @@ The tool handles these error scenarios:
|
|
|
199
193
|
- [ ] Read entire page/section
|
|
200
194
|
- [ ] Keyboard shortcuts
|
|
201
195
|
- [ ] Multiple language support
|
|
202
|
-
- [
|
|
196
|
+
- [x] AWS Polly integration (premium voices) — available via `@pie-players/tts-server-polly`
|
|
203
197
|
|
|
204
198
|
## Related
|
|
205
199
|
|
|
206
|
-
- [
|
|
207
|
-
- [
|
|
208
|
-
- [
|
|
209
|
-
- [Tool
|
|
200
|
+
- [TTS Architecture](../../../docs/accessibility/tts-architecture.md) - TTS system overview
|
|
201
|
+
- [TTS Server Polly](../../tts-server-polly/README.md) - AWS Polly server provider
|
|
202
|
+
- [TTS Client Server](../../tts-client-server/README.md) - Server-backed client provider
|
|
203
|
+
- [Tool Toolbar](../../toolbars/README.md) - Tool management
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-tool-text-to-speech",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Text-to-Speech tool for PIE assessment player with word-level highlighting",
|
|
6
6
|
"repository": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"unpkg": "./dist/tool-text-to-speech.js",
|
|
36
36
|
"jsdelivr": "./dist/tool-text-to-speech.js",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@pie-players/pie-assessment-toolkit": "0.3.
|
|
39
|
-
"@pie-players/pie-players-shared": "0.3.
|
|
38
|
+
"@pie-players/pie-assessment-toolkit": "0.3.7",
|
|
39
|
+
"@pie-players/pie-players-shared": "0.3.7"
|
|
40
40
|
},
|
|
41
41
|
"types": "./dist/index.d.ts",
|
|
42
42
|
"scripts": {
|