@corti/dictation-web 0.0.0-test.571.2 → 0.0.0-test.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.
Files changed (50) hide show
  1. package/README.md +25 -39
  2. package/dist/bundle.js +1120 -535
  3. package/dist/components/corti-dictation.d.ts +23 -9
  4. package/dist/components/corti-dictation.js +36 -17
  5. package/dist/components/corti-dictation.js.map +1 -1
  6. package/dist/components/keybinding-input.d.ts +16 -0
  7. package/dist/components/keybinding-input.js +94 -0
  8. package/dist/components/keybinding-input.js.map +1 -0
  9. package/dist/components/keybinding-selector.d.ts +3 -3
  10. package/dist/components/keybinding-selector.js +21 -49
  11. package/dist/components/keybinding-selector.js.map +1 -1
  12. package/dist/components/recording-button.d.ts +5 -3
  13. package/dist/components/recording-button.js +100 -45
  14. package/dist/components/recording-button.js.map +1 -1
  15. package/dist/components/settings-menu.d.ts +0 -1
  16. package/dist/components/settings-menu.js +4 -17
  17. package/dist/components/settings-menu.js.map +1 -1
  18. package/dist/contexts/dictation-context.d.ts +6 -6
  19. package/dist/contexts/dictation-context.js +24 -23
  20. package/dist/contexts/dictation-context.js.map +1 -1
  21. package/dist/controllers/dictation-controller.d.ts +8 -2
  22. package/dist/controllers/dictation-controller.js +151 -45
  23. package/dist/controllers/dictation-controller.js.map +1 -1
  24. package/dist/controllers/keybinding-controller.d.ts +2 -3
  25. package/dist/controllers/keybinding-controller.js +20 -17
  26. package/dist/controllers/keybinding-controller.js.map +1 -1
  27. package/dist/controllers/media-controller.d.ts +2 -1
  28. package/dist/controllers/media-controller.js +14 -3
  29. package/dist/controllers/media-controller.js.map +1 -1
  30. package/dist/index.d.ts +2 -3
  31. package/dist/index.js +0 -5
  32. package/dist/index.js.map +1 -1
  33. package/dist/styles/keybinding-selector.js +10 -4
  34. package/dist/styles/keybinding-selector.js.map +1 -1
  35. package/dist/styles/settings-menu.js +0 -8
  36. package/dist/styles/settings-menu.js.map +1 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/dist/types.d.ts +1 -2
  39. package/dist/types.js.map +1 -1
  40. package/dist/utils/events.d.ts +13 -7
  41. package/dist/utils/events.js +26 -12
  42. package/dist/utils/events.js.map +1 -1
  43. package/package.json +2 -4
  44. package/dist/components/mode-selector.d.ts +0 -14
  45. package/dist/components/mode-selector.js +0 -73
  46. package/dist/components/mode-selector.js.map +0 -1
  47. package/dist/package.json +0 -94
  48. package/dist/styles/mode-selector.d.ts +0 -2
  49. package/dist/styles/mode-selector.js +0 -56
  50. package/dist/styles/mode-selector.js.map +0 -1
package/README.md CHANGED
@@ -21,10 +21,10 @@ This library offers two approaches:
21
21
 
22
22
  **`<corti-dictation>`** - A complete, ready-to-use component that includes:
23
23
  - Recording button with visual feedback
24
- - Settings menu for device, language, mode, and keybinding selection
24
+ - Settings menu for device, language, and keybinding selection
25
25
  - Automatic state management
26
26
  - Built-in styling and theming
27
- - Support for toggle-to-talk and push-to-talk modes
27
+ - Support for both push-to-talk and toggle-to-talk keybindings simultaneously
28
28
  - Keyboard shortcut (keybinding) support
29
29
 
30
30
  This is the easiest way to get started and works out of the box.
@@ -35,11 +35,10 @@ For more control and flexibility, you can use individual components:
35
35
 
36
36
  - **`<dictation-root>`** - Context provider that manages authentication, configuration, and shared state
37
37
  - **`<dictation-recording-button>`** - Standalone recording button with audio visualization
38
- - **`<dictation-settings-menu>`** - Settings menu with device, language, mode, and keybinding selectors
38
+ - **`<dictation-settings-menu>`** - Settings menu with device, language, and keybinding selectors
39
39
  - **`<dictation-device-selector>`** - Device selection dropdown
40
40
  - **`<dictation-language-selector>`** - Language selection dropdown
41
- - **`<dictation-mode-selector>`** - Mode selection component (toggle-to-talk or push-to-talk)
42
- - **`<dictation-keybinding-selector>`** - Keybinding configuration component for keyboard shortcuts
41
+ - **`<dictation-keybinding-selector>`** - Keybinding configuration component for keyboard shortcuts (supports both push-to-talk and toggle-to-talk)
43
42
 
44
43
  These components share state through a context system, allowing you to build custom UIs while leveraging the same underlying functionality.
45
44
 
@@ -132,7 +131,7 @@ For more control, use individual components to build a custom UI:
132
131
  <body>
133
132
  <dictation-root id="dictationRoot">
134
133
  <dictation-recording-button></dictation-recording-button>
135
- <dictation-settings-menu settingsEnabled="device,language,mode,keybinding"></dictation-settings-menu>
134
+ <dictation-settings-menu settingsEnabled="device,language,keybinding"></dictation-settings-menu>
136
135
  </dictation-root>
137
136
 
138
137
  <textarea
@@ -160,51 +159,38 @@ For more control, use individual components to build a custom UI:
160
159
  </html>
161
160
  ```
162
161
 
163
- ### Dictation Modes
164
-
165
- The component supports two dictation modes:
166
-
167
- **Toggle-to-Talk (default):**
168
- - Click or tap the recording button to start recording
169
- - Click or tap again to stop recording
170
- - Press the keybinding to toggle recording state
171
-
172
- ```html
173
- <corti-dictation mode="toggle-to-talk"></corti-dictation>
174
- ```
162
+ ### Keyboard Shortcuts (Keybindings)
175
163
 
176
- **Push-to-Talk:**
177
- - Press and hold the recording button to record
178
- - Release to stop recording
179
- - Press and hold the keybinding to record (keydown starts, keyup stops)
164
+ The component supports both push-to-talk and toggle-to-talk keybindings simultaneously. You can configure separate keybindings for each behavior:
180
165
 
181
- ```html
182
- <corti-dictation mode="push-to-talk"></corti-dictation>
183
- ```
166
+ **Toggle-to-Talk Keybinding (default: `Enter`):**
167
+ - Pressing the key toggles recording on/off
168
+ - Works like clicking the button
184
169
 
185
- ### Keyboard Shortcuts (Keybindings)
170
+ **Push-to-Talk Keybinding (default: `Space`):**
171
+ - Keydown starts recording
172
+ - Keyup stops recording
173
+ - Works like press-and-hold
186
174
 
187
- Configure keyboard shortcuts to start/stop recording. You can use either key names (from `event.key`) or key codes (from `event.code`):
175
+ You can use either key names (from `event.key`) or key codes (from `event.code`):
188
176
 
189
177
  ```html
190
- <!-- Use backtick key (default) - key name -->
191
- <corti-dictation keybinding="`"></corti-dictation>
192
-
193
- <!-- Use 'k' key - key name -->
194
- <corti-dictation keybinding="k"></corti-dictation>
178
+ <!-- Configure toggle-to-talk keybinding (default: Enter) -->
179
+ <corti-dictation toggleToTalkKeybinding="`"></corti-dictation>
195
180
 
196
- <!-- Use Meta key (Cmd on Mac, Meta elsewhere) - key name -->
197
- <corti-dictation keybinding="meta"></corti-dictation>
181
+ <!-- Configure push-to-talk keybinding (default: Space) -->
182
+ <corti-dictation pushToTalkKeybinding="Space"></corti-dictation>
198
183
 
199
184
  <!-- Use key codes instead of key names -->
200
- <corti-dictation keybinding="Backquote"></corti-dictation> <!-- backtick -->
201
- <corti-dictation keybinding="KeyK"></corti-dictation> <!-- 'k' key -->
202
- <corti-dictation keybinding="MetaLeft"></corti-dictation> <!-- Meta key -->
185
+ <corti-dictation toggleToTalkKeybinding="Backquote"></corti-dictation> <!-- backtick -->
186
+ <corti-dictation pushToTalkKeybinding="Space"></corti-dictation> <!-- Space key -->
203
187
  ```
204
188
 
205
189
  Keybindings are platform-aware:
206
190
  - Keybindings are automatically ignored when typing in input fields, textareas, or contenteditable elements
207
- - Both key names (e.g., `"k"`, `"Meta"`) and key codes (e.g., `"KeyK"`, `"MetaLeft"`) are supported
191
+ - Both key names (e.g., `"k"`, `"Meta"`, `"Space"`) and key codes (e.g., `"KeyK"`, `"MetaLeft"`, `"Space"`) are supported
192
+ - Both keybindings can be active at the same time
193
+ - **Note:** If both keybindings are set to the same key, toggle-to-talk takes priority
208
194
 
209
195
  ## Documentation
210
196
 
@@ -213,5 +199,5 @@ For more detailed information, see:
213
199
  - **[API Reference](docs/API_REFERENCE.md)** - Complete API documentation for properties, methods, and events
214
200
  - **[Authentication Guide](docs/AUTHENTICATION.md)** - How to set up authentication with tokens and refresh mechanisms
215
201
  - **[Styling Guide](docs/styling.md)** - Customize the component's appearance with CSS variables and themes
216
- - **[Examples](demo/README.md)** - Practical usage examples and demos
202
+ - **[Examples](https://github.com/corticph/corti-examples/tree/main/dictation/typescript/web-component)** - Practical usage examples and demos
217
203
  - **[Development Guide](docs/DEV_README.md)** - Information for contributors and developers