@pie-players/pie-tool-tts-inline 0.3.21 → 0.3.22
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 +21 -1
- package/dist/tool-tts-inline.js +647 -641
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -90,12 +90,31 @@ toolCoordinator.showTool('tts-passage-1');
|
|
|
90
90
|
- `catalog-id` - QTI 3.0 accessibility catalog ID for SSML lookup (default: `''`)
|
|
91
91
|
- `language` - Language code for TTS (default: `'en-US'`)
|
|
92
92
|
- `size` - Icon size: `'sm'` (1.5rem), `'md'` (2rem), or `'lg'` (2.5rem) (default: `'md'`)
|
|
93
|
-
- `speed-options` - Optional speed options array for inline speed buttons (default: `[1.5, 2]`)
|
|
94
93
|
|
|
95
94
|
### JavaScript Properties
|
|
96
95
|
|
|
97
96
|
- `ttsService` - ITTSService instance (required)
|
|
98
97
|
- `coordinator` - IToolCoordinator instance (optional, for visibility management)
|
|
98
|
+
- `speedOptions` - Optional number array controlling inline speed button rendering
|
|
99
|
+
|
|
100
|
+
### `speedOptions` Configuration
|
|
101
|
+
|
|
102
|
+
`speedOptions` is intended to be set as a JavaScript property (not as a
|
|
103
|
+
serialized HTML attribute), either directly on the element or via toolkit
|
|
104
|
+
provider settings.
|
|
105
|
+
|
|
106
|
+
```javascript
|
|
107
|
+
const ttsButton = document.createElement("pie-tool-tts-inline");
|
|
108
|
+
ttsButton.speedOptions = [2, 1.25, 1.5]; // rendered in this order
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Semantics:
|
|
112
|
+
|
|
113
|
+
- Omitted or non-array: defaults to `[1.5, 2]`.
|
|
114
|
+
- Explicit `[]`: no speed buttons rendered.
|
|
115
|
+
- Invalid-only values: fall back to `[1.5, 2]`.
|
|
116
|
+
- Values are deduplicated while preserving first-seen order.
|
|
117
|
+
- `1` is excluded from rendered options.
|
|
99
118
|
|
|
100
119
|
## Behavior
|
|
101
120
|
|
|
@@ -115,6 +134,7 @@ toolCoordinator.showTool('tts-passage-1');
|
|
|
115
134
|
- Speed buttons call `ttsService.updateSettings({ rate })`
|
|
116
135
|
- Selecting another speed switches active state to that option
|
|
117
136
|
- Clicking the currently active speed resets back to `1x`
|
|
137
|
+
- If `speedOptions` is `[]`, speed controls are omitted while rewind/forward/stop still render
|
|
118
138
|
6. **Keyboard Interaction**: Arrow keys move between controls; Tab enters/leaves the toolbar
|
|
119
139
|
7. **Cleanup**: Unregisters from coordinator on unmount
|
|
120
140
|
|