@pie-players/pie-tool-tts-inline 0.3.5 → 0.3.8

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
@@ -4,16 +4,19 @@ Inline TTS (Text-to-Speech) tool component for PIE Players Assessment Toolkit.
4
4
 
5
5
  ## Overview
6
6
 
7
- `pie-tool-tts-inline` is a web component that renders a Material Design speaker icon button for triggering TTS playback. Unlike floating modal tools, this component renders inline at its natural position in the DOM (typically in headers).
7
+ `pie-tool-tts-inline` is a web component that renders an inline speaker trigger with an expanded floating control panel for reading controls. Unlike floating modal tools, this component renders at its natural position in the DOM (typically in passage/item headers).
8
8
 
9
9
  ## Features
10
10
 
11
- - Material Design speaker icon (🔊)
11
+ - Speaker trigger that toggles an expanded panel
12
+ - Expanded controls: Play/Pause, Stop, Fast-forward, Rewind, configurable Speed options
13
+ - Play button switches to Pause while reading
14
+ - Panel remains open while reading and closes on Stop
15
+ - Arrow-key navigation within the controls toolbar
12
16
  - Registers with `ToolCoordinator` for lifecycle management
13
17
  - Integrates with `TTSService` for QTI 3.0 catalog-based TTS
14
18
  - Size variants: `sm`, `md`, `lg`
15
- - Visual feedback during speaking (pulse animation)
16
- - Full accessibility support (ARIA labels, keyboard navigation)
19
+ - Full accessibility support (ARIA labels, `role="toolbar"`, live status updates)
17
20
  - Coordinator-controlled visibility via CSS `display` property
18
21
 
19
22
  ## Installation
@@ -87,6 +90,7 @@ toolCoordinator.showTool('tts-passage-1');
87
90
  - `catalog-id` - QTI 3.0 accessibility catalog ID for SSML lookup (default: `''`)
88
91
  - `language` - Language code for TTS (default: `'en-US'`)
89
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]`)
90
94
 
91
95
  ### JavaScript Properties
92
96
 
@@ -103,8 +107,16 @@ toolCoordinator.showTool('tts-passage-1');
103
107
  - **Item-level catalogs** (manually authored)
104
108
  - **Assessment-level catalogs** (manually authored)
105
109
  - **Plain text fallback** (browser TTS)
106
- 5. **Visual Feedback**: Pulse animation while speaking, disabled state
107
- 6. **Cleanup**: Unregisters from coordinator on unmount
110
+ 5. **Expanded Controls**:
111
+ - Trigger button opens/closes the panel
112
+ - Play/Pause toggles based on playback state
113
+ - Stop halts playback and closes the panel
114
+ - Fast-forward/Rewind invoke sentence-jump seek on `ITTSService`
115
+ - Speed buttons call `ttsService.updateSettings({ rate })`
116
+ - Selecting another speed switches active state to that option
117
+ - Clicking the currently active speed resets back to `1x`
118
+ 6. **Keyboard Interaction**: Arrow keys move between controls; Tab enters/leaves the toolbar
119
+ 7. **Cleanup**: Unregisters from coordinator on unmount
108
120
 
109
121
  ## SSML Extraction Integration
110
122
 
@@ -133,11 +145,11 @@ When used with the section player, this tool automatically benefits from SSML ex
133
145
 
134
146
  ## Styling
135
147
 
136
- The component uses inline styles and doesn't require external CSS. The button is transparent by default with hover effects:
148
+ The component uses scoped styles and doesn't require external CSS. Styling uses `--pie-*` token variables:
137
149
 
138
- - **Normal**: Gray icon, transparent background
139
- - **Hover**: Purple icon, light gray background
140
- - **Speaking**: Purple icon, blue tinted background with pulse animation
150
+ - **Trigger**: Circular speaker button that indicates panel open state
151
+ - **Panel**: Floating card with vertically stacked controls
152
+ - **Speed state**: Active speed button receives distinct token-driven styling
141
153
  - **Disabled**: Reduced opacity, no pointer
142
154
 
143
155
  ## Architecture