kempo-ui 0.4.4 → 0.4.5
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/dist/components/TextToSpeech.js +4 -4
- package/dist/components/VoiceSelector.js +49 -0
- package/dist/utils/voice.js +1 -0
- package/docs/components/accordion.html +7 -0
- package/docs/components/aside.html +7 -0
- package/docs/components/calendar.html +7 -0
- package/docs/components/card.html +7 -0
- package/docs/components/code-editor.html +7 -0
- package/docs/components/color-picker.html +7 -0
- package/docs/components/combobox.html +7 -0
- package/docs/components/content-slider.html +7 -0
- package/docs/components/context.html +7 -0
- package/docs/components/dialog.html +7 -0
- package/docs/components/dropdown.html +7 -0
- package/docs/components/filter-list.html +7 -0
- package/docs/components/focus-capture.html +7 -0
- package/docs/components/html-editor.html +7 -0
- package/docs/components/hybrid-component.html +7 -0
- package/docs/components/icon.html +7 -0
- package/docs/components/import.html +7 -0
- package/docs/components/light-component.html +7 -0
- package/docs/components/nav-spacer.html +7 -0
- package/docs/components/nav.html +7 -0
- package/docs/components/photo-viewer.html +7 -0
- package/docs/components/progress.html +7 -0
- package/docs/components/resize.html +7 -0
- package/docs/components/shadow-component.html +7 -0
- package/docs/components/show-more.html +7 -0
- package/docs/components/slider.html +7 -0
- package/docs/components/sortable.html +7 -0
- package/docs/components/speech-to-text.html +7 -0
- package/docs/components/spinner.html +7 -0
- package/docs/components/split.html +7 -0
- package/docs/components/table.html +7 -0
- package/docs/components/tableControls.html +7 -0
- package/docs/components/tableCustomFields.html +7 -0
- package/docs/components/tableFetchRecords.html +7 -0
- package/docs/components/tableFieldSortHide.html +7 -0
- package/docs/components/tablePagination.html +7 -0
- package/docs/components/tablePlaceholder.html +7 -0
- package/docs/components/tableRecordEditing.html +7 -0
- package/docs/components/tableRecordFiltering.html +7 -0
- package/docs/components/tableRecordHiding.html +7 -0
- package/docs/components/tableRecordSearching.html +7 -0
- package/docs/components/tableRecordSelection.html +7 -0
- package/docs/components/tableRowControls.html +7 -0
- package/docs/components/tableServerSync.html +7 -0
- package/docs/components/tableSorting.html +7 -0
- package/docs/components/tabs.html +7 -0
- package/docs/components/tags.html +7 -0
- package/docs/components/text-to-speech.html +51 -1
- package/docs/components/theme-select.html +7 -0
- package/docs/components/theme-switcher.html +7 -0
- package/docs/components/time.html +7 -0
- package/docs/components/timestamp.html +7 -0
- package/docs/components/toast.html +7 -0
- package/docs/components/toggle.html +7 -0
- package/docs/components/tree.html +7 -0
- package/docs/components/voice-selector.html +598 -0
- package/docs/index.html +19 -0
- package/docs/src/components/TextToSpeech.js +4 -4
- package/docs/src/components/VoiceSelector.js +49 -0
- package/docs/src/utils/voice.js +1 -0
- package/docs/utils/context.html +7 -0
- package/docs/utils/cookie.html +7 -0
- package/docs/utils/debounce.html +7 -0
- package/docs/utils/drag.html +7 -0
- package/docs/utils/elevation.html +7 -0
- package/docs/utils/formatTimestamp.html +7 -0
- package/docs/utils/object.html +7 -0
- package/docs/utils/propConverters.html +7 -0
- package/docs/utils/string.html +7 -0
- package/docs/utils/theme.html +7 -0
- package/docs/utils/toTitleCase.html +7 -0
- package/docs/utils/type.html +7 -0
- package/docs/utils/voice.html +536 -0
- package/docs/utils/wait.html +7 -0
- package/docs-src/components/text-to-speech.page.html +44 -1
- package/docs-src/components/voice-selector.page.html +125 -0
- package/docs-src/index.page.html +12 -0
- package/docs-src/nav.fragment.html +7 -0
- package/docs-src/utils/voice.page.html +66 -0
- package/llms.txt +2 -0
- package/package.json +1 -1
- package/src/components/TextToSpeech.js +13 -2
- package/src/components/VoiceSelector.js +271 -0
- package/src/utils/voice.js +103 -0
- package/tests/components/TextToSpeech.browser-test.js +150 -1
- package/tests/components/VoiceSelector.browser-test.js +374 -0
- package/tests/utils/voice.browser-test.js +128 -0
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Voice Selector - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
+
<link rel="icon" type="image/png" sizes="48x48" href="../media/icon48.png">
|
|
8
|
+
<link rel="manifest" href="../manifest.json" />
|
|
9
|
+
<link rel="stylesheet" href="../kempo-vars.css" />
|
|
10
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css" />
|
|
11
|
+
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
12
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
13
|
+
<script>window.litDisableBundleWarning = true;</script>
|
|
14
|
+
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
|
|
18
|
+
<k-nav
|
|
19
|
+
fixed
|
|
20
|
+
class="bg-primary"
|
|
21
|
+
>
|
|
22
|
+
<button
|
|
23
|
+
id="toggleNavSideMenu"
|
|
24
|
+
class="link"
|
|
25
|
+
>
|
|
26
|
+
<k-icon name="menu"></k-icon>
|
|
27
|
+
</button>
|
|
28
|
+
<a
|
|
29
|
+
href="../"
|
|
30
|
+
class="d-if ph"
|
|
31
|
+
style="align-items: center"
|
|
32
|
+
>
|
|
33
|
+
<img
|
|
34
|
+
src="../media/icon32.png"
|
|
35
|
+
alt="Kempo UI Icon"
|
|
36
|
+
class="pr"
|
|
37
|
+
/>
|
|
38
|
+
Kempo UI
|
|
39
|
+
</a>
|
|
40
|
+
<div
|
|
41
|
+
style="position:relative;margin:0 .25rem;align-self:center;"
|
|
42
|
+
theme="light"
|
|
43
|
+
>
|
|
44
|
+
<input
|
|
45
|
+
id="navSearchInput"
|
|
46
|
+
type="search"
|
|
47
|
+
placeholder="Search docs..."
|
|
48
|
+
autocomplete="off"
|
|
49
|
+
style="width:11rem;"
|
|
50
|
+
/>
|
|
51
|
+
<div
|
|
52
|
+
id="navSearchDropdown"
|
|
53
|
+
hidden
|
|
54
|
+
theme="light"
|
|
55
|
+
style="position:absolute;top:calc(100% + 4px);left:0;width:min(480px,90vw);max-height:70vh;background:var(--c_bg);border:1px solid var(--c_border);border-radius:var(--radius);overflow:auto;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,.3);"
|
|
56
|
+
>
|
|
57
|
+
<k-filter-list
|
|
58
|
+
id="navSearchList"
|
|
59
|
+
style="display:block;padding:.25rem 0;"
|
|
60
|
+
>
|
|
61
|
+
<k-filter-item filter-keywords="accordion components"><a
|
|
62
|
+
href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
63
|
+
<k-filter-item filter-keywords="aside sidebar components"><a
|
|
64
|
+
href="../components/aside.html">Aside<br><small>Component</small></a></k-filter-item>
|
|
65
|
+
<k-filter-item filter-keywords="calendar date picker range month day components"><a
|
|
66
|
+
href="../components/calendar.html"
|
|
67
|
+
>Calendar<br><small>Component</small></a></k-filter-item>
|
|
68
|
+
<k-filter-item filter-keywords="card components"><a
|
|
69
|
+
href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
70
|
+
<k-filter-item filter-keywords="code editor codeeditor monaco components"><a
|
|
71
|
+
href="../components/code-editor.html"
|
|
72
|
+
>Code Editor<br><small>Component</small></a></k-filter-item>
|
|
73
|
+
<k-filter-item filter-keywords="combobox combo box search autocomplete components"><a
|
|
74
|
+
href="../components/combobox.html"
|
|
75
|
+
>Combobox<br><small>Component</small></a></k-filter-item>
|
|
76
|
+
<k-filter-item filter-keywords="color picker colorpicker components"><a
|
|
77
|
+
href="../components/color-picker.html"
|
|
78
|
+
>Color Picker<br><small>Component</small></a></k-filter-item>
|
|
79
|
+
<k-filter-item filter-keywords="content slider components"><a
|
|
80
|
+
href="../components/content-slider.html"
|
|
81
|
+
>Content Slider<br><small>Component</small></a></k-filter-item>
|
|
82
|
+
<k-filter-item filter-keywords="context state global components"><a
|
|
83
|
+
href="../components/context.html"
|
|
84
|
+
>Context<br><small>Component</small></a></k-filter-item>
|
|
85
|
+
<k-filter-item filter-keywords="dialog modal popup components"><a
|
|
86
|
+
href="../components/dialog.html">Dialog<br><small>Component</small></a></k-filter-item>
|
|
87
|
+
<k-filter-item filter-keywords="dropdown select components"><a
|
|
88
|
+
href="../components/dropdown.html">Dropdown<br><small>Component</small></a></k-filter-item>
|
|
89
|
+
<k-filter-item filter-keywords="filter list filterlist components"><a
|
|
90
|
+
href="../components/filter-list.html"
|
|
91
|
+
>Filter List<br><small>Component</small></a></k-filter-item>
|
|
92
|
+
<k-filter-item filter-keywords="focus capture focuscapture components"><a
|
|
93
|
+
href="../components/focus-capture.html"
|
|
94
|
+
>Focus Capture<br><small>Component</small></a></k-filter-item>
|
|
95
|
+
<k-filter-item filter-keywords="html editor components"><a
|
|
96
|
+
href="../components/html-editor.html">HTML
|
|
97
|
+
Editor<br><small>Component</small></a></k-filter-item>
|
|
98
|
+
<k-filter-item filter-keywords="icon components"><a
|
|
99
|
+
href="../components/icon.html">Icon<br><small>Component</small></a></k-filter-item>
|
|
100
|
+
<k-filter-item filter-keywords="import components"><a
|
|
101
|
+
href="../components/import.html">Import<br><small>Component</small></a></k-filter-item>
|
|
102
|
+
<k-filter-item filter-keywords="nav navbar navigation components"><a
|
|
103
|
+
href="../components/nav.html">Nav<br><small>Component</small></a></k-filter-item>
|
|
104
|
+
<k-filter-item filter-keywords="nav spacer navbar spacer navspacer components"><a
|
|
105
|
+
href="../components/nav-spacer.html"
|
|
106
|
+
>Nav Spacer<br><small>Component</small></a></k-filter-item>
|
|
107
|
+
<k-filter-item filter-keywords="photo viewer photoviewer components"><a
|
|
108
|
+
href="../components/photo-viewer.html"
|
|
109
|
+
>Photo Viewer<br><small>Component</small></a></k-filter-item>
|
|
110
|
+
<k-filter-item filter-keywords="progress loading components"><a
|
|
111
|
+
href="../components/progress.html">Progress<br><small>Component</small></a></k-filter-item>
|
|
112
|
+
<k-filter-item filter-keywords="resize components"><a
|
|
113
|
+
href="../components/resize.html">Resize<br><small>Component</small></a></k-filter-item>
|
|
114
|
+
<k-filter-item filter-keywords="show more showmore components"><a
|
|
115
|
+
href="../components/show-more.html"
|
|
116
|
+
>Show More<br><small>Component</small></a></k-filter-item>
|
|
117
|
+
<k-filter-item filter-keywords="slider range input step components"><a
|
|
118
|
+
href="../components/slider.html"
|
|
119
|
+
>Slider<br><small>Component</small></a></k-filter-item>
|
|
120
|
+
<k-filter-item filter-keywords="sortable drag drop sort components"><a
|
|
121
|
+
href="../components/sortable.html"
|
|
122
|
+
>Sortable<br><small>Component</small></a></k-filter-item>
|
|
123
|
+
<k-filter-item filter-keywords="speech to text speechtotext microphone voice recognition transcription components"><a
|
|
124
|
+
href="../components/speech-to-text.html"
|
|
125
|
+
>Speech To Text<br><small>Component</small></a></k-filter-item>
|
|
126
|
+
<k-filter-item filter-keywords="spinner loading components"><a
|
|
127
|
+
href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
128
|
+
<k-filter-item filter-keywords="split pane components"><a
|
|
129
|
+
href="../components/split.html">Split<br><small>Component</small></a></k-filter-item>
|
|
130
|
+
<k-filter-item filter-keywords="table data grid components"><a
|
|
131
|
+
href="../components/table.html">Table<br><small>Component</small></a></k-filter-item>
|
|
132
|
+
<k-filter-item filter-keywords="table controls advanced example"><a
|
|
133
|
+
href="../components/tableControls.html"
|
|
134
|
+
>Table — Controls<br><small>Advanced Example</small></a></k-filter-item>
|
|
135
|
+
<k-filter-item filter-keywords="table custom fields advanced example"><a
|
|
136
|
+
href="../components/tableCustomFields.html"
|
|
137
|
+
>Table — Custom Fields<br><small>Advanced Example</small></a></k-filter-item>
|
|
138
|
+
<k-filter-item filter-keywords="table fetch records advanced example"><a
|
|
139
|
+
href="../components/tableFetchRecords.html"
|
|
140
|
+
>Table — Fetch Records<br><small>Advanced Example</small></a></k-filter-item>
|
|
141
|
+
<k-filter-item filter-keywords="table field sort hide advanced example"><a
|
|
142
|
+
href="../components/tableFieldSortHide.html"
|
|
143
|
+
>Table — Field Sort & Hide<br><small>Advanced Example</small></a></k-filter-item>
|
|
144
|
+
<k-filter-item filter-keywords="table pagination advanced example"><a
|
|
145
|
+
href="../components/tablePagination.html"
|
|
146
|
+
>Table — Pagination<br><small>Advanced Example</small></a></k-filter-item>
|
|
147
|
+
<k-filter-item filter-keywords="table record editing advanced example"><a
|
|
148
|
+
href="../components/tableRecordEditing.html"
|
|
149
|
+
>Table — Record Editing<br><small>Advanced Example</small></a></k-filter-item>
|
|
150
|
+
<k-filter-item filter-keywords="table record filtering advanced example"><a
|
|
151
|
+
href="../components/tableRecordFiltering.html"
|
|
152
|
+
>Table — Record Filtering<br><small>Advanced Example</small></a></k-filter-item>
|
|
153
|
+
<k-filter-item filter-keywords="table record hiding advanced example"><a
|
|
154
|
+
href="../components/tableRecordHiding.html"
|
|
155
|
+
>Table — Record Hiding<br><small>Advanced Example</small></a></k-filter-item>
|
|
156
|
+
<k-filter-item filter-keywords="table record searching advanced example"><a
|
|
157
|
+
href="../components/tableRecordSearching.html"
|
|
158
|
+
>Table — Record Searching<br><small>Advanced Example</small></a></k-filter-item>
|
|
159
|
+
<k-filter-item filter-keywords="table record selection advanced example"><a
|
|
160
|
+
href="../components/tableRecordSelection.html"
|
|
161
|
+
>Table — Record Selection<br><small>Advanced Example</small></a></k-filter-item>
|
|
162
|
+
<k-filter-item filter-keywords="table row controls advanced example"><a
|
|
163
|
+
href="../components/tableRowControls.html"
|
|
164
|
+
>Table — Row Controls<br><small>Advanced Example</small></a></k-filter-item>
|
|
165
|
+
<k-filter-item filter-keywords="table server sync advanced example"><a
|
|
166
|
+
href="../components/tableServerSync.html"
|
|
167
|
+
>Table — Server Sync<br><small>Advanced Example</small></a></k-filter-item>
|
|
168
|
+
<k-filter-item filter-keywords="table sorting advanced example"><a
|
|
169
|
+
href="../components/tableSorting.html"
|
|
170
|
+
>Table — Sorting<br><small>Advanced Example</small></a></k-filter-item>
|
|
171
|
+
<k-filter-item filter-keywords="table placeholder advanced example"><a
|
|
172
|
+
href="../components/tablePlaceholder.html"
|
|
173
|
+
>Table — Placeholder<br><small>Advanced Example</small></a></k-filter-item>
|
|
174
|
+
<k-filter-item filter-keywords="tabs tab panel components"><a
|
|
175
|
+
href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
176
|
+
<k-filter-item filter-keywords="tags tag input components"><a
|
|
177
|
+
href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
178
|
+
<k-filter-item filter-keywords="text to speech texttospeech tts speak voice synthesis components"><a
|
|
179
|
+
href="../components/text-to-speech.html"
|
|
180
|
+
>Text To Speech<br><small>Component</small></a></k-filter-item>
|
|
181
|
+
<k-filter-item filter-keywords="theme select dropdown dark light components"><a
|
|
182
|
+
href="../components/theme-select.html"
|
|
183
|
+
>Theme Select<br><small>Component</small></a></k-filter-item>
|
|
184
|
+
<k-filter-item filter-keywords="theme switcher dark light components"><a
|
|
185
|
+
href="../components/theme-switcher.html"
|
|
186
|
+
>Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
187
|
+
<k-filter-item filter-keywords="time picker clock hour minute form components"><a
|
|
188
|
+
href="../components/time.html"
|
|
189
|
+
>Time<br><small>Component</small></a></k-filter-item>
|
|
190
|
+
<k-filter-item filter-keywords="timestamp date time components"><a
|
|
191
|
+
href="../components/timestamp.html"
|
|
192
|
+
>Timestamp<br><small>Component</small></a></k-filter-item>
|
|
193
|
+
<k-filter-item filter-keywords="toast notification alert components"><a
|
|
194
|
+
href="../components/toast.html"
|
|
195
|
+
>Toast<br><small>Component</small></a></k-filter-item>
|
|
196
|
+
<k-filter-item filter-keywords="toggle switch checkbox components"><a
|
|
197
|
+
href="../components/toggle.html"
|
|
198
|
+
>Toggle<br><small>Component</small></a></k-filter-item>
|
|
199
|
+
<k-filter-item filter-keywords="tree treeview components"><a
|
|
200
|
+
href="../components/tree.html">Tree<br><small>Component</small></a></k-filter-item>
|
|
201
|
+
<k-filter-item filter-keywords="voice selector dropdown speech synthesis preference components"><a
|
|
202
|
+
href="../components/voice-selector.html"
|
|
203
|
+
>Voice Selector<br><small>Component</small></a></k-filter-item>
|
|
204
|
+
<k-filter-item filter-keywords="shadow component base"><a
|
|
205
|
+
href="../components/shadow-component.html"
|
|
206
|
+
>Shadow Component<br><small>Base Component</small></a></k-filter-item>
|
|
207
|
+
<k-filter-item filter-keywords="light component base"><a
|
|
208
|
+
href="../components/light-component.html">Light Component<br><small>Base
|
|
209
|
+
Component</small></a></k-filter-item>
|
|
210
|
+
<k-filter-item filter-keywords="hybrid component base"><a
|
|
211
|
+
href="../components/hybrid-component.html"
|
|
212
|
+
>Hybrid Component<br><small>Base Component</small></a></k-filter-item>
|
|
213
|
+
<k-filter-item filter-keywords="cookie utils utility"><a
|
|
214
|
+
href="../utils/cookie.html">cookie<br><small>Utility</small></a></k-filter-item>
|
|
215
|
+
<k-filter-item filter-keywords="context utils utility"><a
|
|
216
|
+
href="../utils/context.html">context<br><small>Utility</small></a></k-filter-item>
|
|
217
|
+
<k-filter-item filter-keywords="debounce utils utility"><a
|
|
218
|
+
href="../utils/debounce.html">debounce<br><small>Utility</small></a></k-filter-item>
|
|
219
|
+
<k-filter-item filter-keywords="drag utils utility"><a
|
|
220
|
+
href="../utils/drag.html">drag<br><small>Utility</small></a></k-filter-item>
|
|
221
|
+
<k-filter-item filter-keywords="elevation z-index stacking utils"><a
|
|
222
|
+
href="../utils/elevation.html">elevation<br><small>Utility</small></a></k-filter-item>
|
|
223
|
+
<k-filter-item filter-keywords="formattimestamp timestamp format date time utils utility"><a
|
|
224
|
+
href="../utils/formatTimestamp.html"
|
|
225
|
+
>formatTimestamp<br><small>Utility</small></a></k-filter-item>
|
|
226
|
+
<k-filter-item filter-keywords="object utils utility"><a
|
|
227
|
+
href="../utils/object.html">object<br><small>Utility</small></a></k-filter-item>
|
|
228
|
+
<k-filter-item filter-keywords="propconverters prop converters utils utility"><a
|
|
229
|
+
href="../utils/propConverters.html"
|
|
230
|
+
>propConverters<br><small>Utility</small></a></k-filter-item>
|
|
231
|
+
<k-filter-item filter-keywords="string utils utility"><a
|
|
232
|
+
href="../utils/string.html">string<br><small>Utility</small></a></k-filter-item>
|
|
233
|
+
<k-filter-item filter-keywords="theme utils utility"><a
|
|
234
|
+
href="../utils/theme.html">theme<br><small>Utility</small></a></k-filter-item>
|
|
235
|
+
<k-filter-item filter-keywords="type utils utility"><a
|
|
236
|
+
href="../utils/type.html">type<br><small>Utility</small></a></k-filter-item>
|
|
237
|
+
<k-filter-item filter-keywords="voice speech synthesis preference utils utility"><a
|
|
238
|
+
href="../utils/voice.html">voice<br><small>Utility</small></a></k-filter-item>
|
|
239
|
+
<k-filter-item filter-keywords="wait async utils utility"><a
|
|
240
|
+
href="../utils/wait.html">wait<br><small>Utility</small></a></k-filter-item>
|
|
241
|
+
</k-filter-list>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
<div class="flex"></div>
|
|
245
|
+
<a
|
|
246
|
+
href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20"
|
|
247
|
+
target="_blank"
|
|
248
|
+
><k-icon name="license"></k-icon></a>
|
|
249
|
+
<a
|
|
250
|
+
href="https://www.npmjs.com/package/kempo-ui"
|
|
251
|
+
target="_blank"
|
|
252
|
+
><k-icon name="npm"></k-icon></a>
|
|
253
|
+
<a
|
|
254
|
+
href="https://github.com/dustinpoissant/kempo-ui"
|
|
255
|
+
target="_blank"
|
|
256
|
+
><k-icon name="github-mark"></k-icon></a>
|
|
257
|
+
<k-theme-switcher
|
|
258
|
+
class="mr"
|
|
259
|
+
style="
|
|
260
|
+
--padding: 0.5rem;
|
|
261
|
+
--c_active: var(--tc_on_primary);
|
|
262
|
+
--tc_active: var(--c_primary);
|
|
263
|
+
--c_inactive__hover: rgba(255, 255, 255, 0.1);
|
|
264
|
+
"
|
|
265
|
+
></k-theme-switcher>
|
|
266
|
+
</k-nav>
|
|
267
|
+
<div style="width: 100%; height: 4rem;"></div>
|
|
268
|
+
<k-aside
|
|
269
|
+
id="navSideMenu"
|
|
270
|
+
main="overlay"
|
|
271
|
+
state="offscreen"
|
|
272
|
+
>
|
|
273
|
+
<menu>
|
|
274
|
+
<a
|
|
275
|
+
href="../"
|
|
276
|
+
class="ta-center bb mb r0"
|
|
277
|
+
>
|
|
278
|
+
<h1 class="tc-primary">Kempo UI</h1>
|
|
279
|
+
<img
|
|
280
|
+
src="../media/icon128.png"
|
|
281
|
+
alt="Kempo UI Icon"
|
|
282
|
+
/>
|
|
283
|
+
</a>
|
|
284
|
+
|
|
285
|
+
<div class="pl mb">
|
|
286
|
+
<h3>Components</h3>
|
|
287
|
+
<a href="../components/accordion.html">Accordion</a>
|
|
288
|
+
<a href="../components/aside.html">Aside</a>
|
|
289
|
+
<a href="../components/calendar.html">Calendar</a>
|
|
290
|
+
<a href="../components/card.html">Card</a>
|
|
291
|
+
<a href="../components/code-editor.html">Code Editor</a>
|
|
292
|
+
<a href="../components/combobox.html">Combobox</a>
|
|
293
|
+
<a href="../components/color-picker.html">ColorPicker</a>
|
|
294
|
+
<a href="../components/content-slider.html">Content Slider</a>
|
|
295
|
+
<a href="../components/context.html">Context</a>
|
|
296
|
+
<a href="../components/dialog.html">Dialog</a>
|
|
297
|
+
<a href="../components/dropdown.html">Dropdown</a>
|
|
298
|
+
<a href="../components/filter-list.html">Filter List</a>
|
|
299
|
+
<a href="../components/focus-capture.html">FocusCapture</a>
|
|
300
|
+
<a href="../components/html-editor.html">HTML Editor</a>
|
|
301
|
+
<a href="../components/icon.html">Icon</a>
|
|
302
|
+
<a href="../components/import.html">Import</a>
|
|
303
|
+
<a href="../components/nav.html">Nav</a>
|
|
304
|
+
<a href="../components/nav-spacer.html">Nav Spacer</a>
|
|
305
|
+
<a href="../components/photo-viewer.html">Photo Viewer</a>
|
|
306
|
+
<a href="../components/progress.html">Progress</a>
|
|
307
|
+
<a href="../components/resize.html">Resize</a>
|
|
308
|
+
<a href="../components/show-more.html">Show More</a>
|
|
309
|
+
<a href="../components/slider.html">Slider</a>
|
|
310
|
+
<a href="../components/sortable.html">Sortable</a>
|
|
311
|
+
<a href="../components/speech-to-text.html">Speech To Text</a>
|
|
312
|
+
<a href="../components/spinner.html">Spinner</a>
|
|
313
|
+
<a href="../components/split.html">Split</a>
|
|
314
|
+
<a href="../components/table.html">Table</a>
|
|
315
|
+
<a href="../components/tabs.html">Tabs</a>
|
|
316
|
+
<a href="../components/tags.html">Tags</a>
|
|
317
|
+
<a href="../components/text-to-speech.html">Text To Speech</a>
|
|
318
|
+
<a href="../components/theme-select.html">Theme Select</a>
|
|
319
|
+
<a href="../components/theme-switcher.html">Theme Switcher</a>
|
|
320
|
+
<a href="../components/time.html">Time</a>
|
|
321
|
+
<a href="../components/timestamp.html">Timestamp</a>
|
|
322
|
+
<a href="../components/toast.html">Toast</a>
|
|
323
|
+
<a href="../components/toggle.html">Toggle</a>
|
|
324
|
+
<a href="../components/tree.html">Tree</a>
|
|
325
|
+
<a href="../components/voice-selector.html">Voice Selector</a>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
<h5 class="mb0">Base Components</h5>
|
|
329
|
+
<div class="pl mb">
|
|
330
|
+
<a href="../components/shadow-component.html">Shadow Component</a>
|
|
331
|
+
<a href="../components/light-component.html">Light Component</a>
|
|
332
|
+
<a href="../components/hybrid-component.html">Hybrid Component</a>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<h5 class="mb0">Utils</h5>
|
|
336
|
+
<div class="pl mb">
|
|
337
|
+
<a href="../utils/cookie.html">cookie</a>
|
|
338
|
+
<a href="../utils/context.html">context</a>
|
|
339
|
+
<a href="../utils/debounce.html">debounce</a>
|
|
340
|
+
<a href="../utils/drag.html">drag</a>
|
|
341
|
+
<a href="../utils/elevation.html">elevation</a>
|
|
342
|
+
<a href="../utils/formatTimestamp.html">formatTimestamp</a>
|
|
343
|
+
<a href="../utils/object.html">object</a>
|
|
344
|
+
<a href="../utils/propConverters.html">propConverters</a>
|
|
345
|
+
<a href="../utils/string.html">string</a>
|
|
346
|
+
<a href="../utils/theme.html">theme</a>
|
|
347
|
+
<a href="../utils/type.html">type</a>
|
|
348
|
+
<a href="../utils/voice.html">voice</a>
|
|
349
|
+
<a href="../utils/wait.html">wait</a>
|
|
350
|
+
</div>
|
|
351
|
+
</menu>
|
|
352
|
+
</k-aside>
|
|
353
|
+
<style>
|
|
354
|
+
#navSearchList a {
|
|
355
|
+
display: block;
|
|
356
|
+
padding: .25rem .5rem;
|
|
357
|
+
border-radius: var(--radius);
|
|
358
|
+
text-decoration: none;
|
|
359
|
+
color: var(--tc);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
#navSearchList a:hover {
|
|
363
|
+
background: rgba(128, 128, 128, .15);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
#navSearchList a small {
|
|
367
|
+
display: block;
|
|
368
|
+
color: var(--tc_muted);
|
|
369
|
+
}
|
|
370
|
+
</style>
|
|
371
|
+
<script
|
|
372
|
+
src="../src/components/Nav.js"
|
|
373
|
+
type="module"
|
|
374
|
+
></script>
|
|
375
|
+
<script
|
|
376
|
+
src="../src/components/FilterList.js"
|
|
377
|
+
type="module"
|
|
378
|
+
></script>
|
|
379
|
+
<script
|
|
380
|
+
src="../src/components/FilterItem.js"
|
|
381
|
+
type="module"
|
|
382
|
+
></script>
|
|
383
|
+
<script
|
|
384
|
+
src="../src/components/Aside.js"
|
|
385
|
+
type="module"
|
|
386
|
+
></script>
|
|
387
|
+
<script
|
|
388
|
+
src="../src/components/Icon.js"
|
|
389
|
+
type="module"
|
|
390
|
+
></script>
|
|
391
|
+
<script
|
|
392
|
+
src="../src/components/ThemeSwitcher.js"
|
|
393
|
+
type="module"
|
|
394
|
+
></script>
|
|
395
|
+
<script type="module">
|
|
396
|
+
import debounce from '../src/utils/debounce.js';
|
|
397
|
+
|
|
398
|
+
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
399
|
+
await window.customElements.whenDefined('k-aside');
|
|
400
|
+
document.getElementById('navSideMenu').toggle();
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
document.addEventListener('click', function (e) {
|
|
404
|
+
if (e.target.matches('a[href^="#"]')) {
|
|
405
|
+
e.preventDefault();
|
|
406
|
+
const targetId = e.target.getAttribute('href').replace('#', '');
|
|
407
|
+
const target = document.getElementById(targetId);
|
|
408
|
+
if (target) {
|
|
409
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
410
|
+
const url = window.location.pathname + window.location.search + '#' + targetId;
|
|
411
|
+
history.replaceState(null, '', url);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
/*
|
|
417
|
+
Nav Search
|
|
418
|
+
*/
|
|
419
|
+
const searchInput = document.getElementById('navSearchInput');
|
|
420
|
+
const searchDropdown = document.getElementById('navSearchDropdown');
|
|
421
|
+
let navSearchList = null;
|
|
422
|
+
|
|
423
|
+
const openSearch = async () => {
|
|
424
|
+
await customElements.whenDefined('k-filter-list');
|
|
425
|
+
if (!navSearchList) navSearchList = document.getElementById('navSearchList');
|
|
426
|
+
navSearchList.filter(searchInput.value);
|
|
427
|
+
searchDropdown.hidden = false;
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
const closeSearch = () => {
|
|
431
|
+
searchDropdown.hidden = true;
|
|
432
|
+
navSearchList?.clearFocus();
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
searchInput.addEventListener('focus', openSearch);
|
|
436
|
+
|
|
437
|
+
searchInput.addEventListener('input', debounce(e => {
|
|
438
|
+
navSearchList?.filter(e.target.value);
|
|
439
|
+
}, 150));
|
|
440
|
+
|
|
441
|
+
searchInput.addEventListener('keydown', e => {
|
|
442
|
+
if (e.key === 'Escape') {
|
|
443
|
+
searchInput.value = '';
|
|
444
|
+
searchInput.blur();
|
|
445
|
+
closeSearch();
|
|
446
|
+
} else if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter') {
|
|
447
|
+
navSearchList?.handleKeydown(e);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
searchInput.addEventListener('blur', () => {
|
|
452
|
+
setTimeout(closeSearch, 150);
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
document.addEventListener('keydown', e => {
|
|
456
|
+
let active = document.activeElement;
|
|
457
|
+
while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
|
|
458
|
+
const tag = active?.tagName;
|
|
459
|
+
if (tag === 'INPUT' || tag === 'TEXTAREA' || active?.isContentEditable) return;
|
|
460
|
+
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
461
|
+
if (e.key.length === 1) {
|
|
462
|
+
searchInput.focus();
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
</script>
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
<h1 class="ta-center">Voice Selector</h1>
|
|
469
|
+
|
|
470
|
+
<k-main>
|
|
471
|
+
|
|
472
|
+
<k-accordion persistent-id="toc" class="b r mb">
|
|
473
|
+
<k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
|
|
474
|
+
<k-accordion-panel name="toc-panel">
|
|
475
|
+
<div class="m pl">
|
|
476
|
+
<h6>Examples</h6>
|
|
477
|
+
<a href="#basicUsage">Basic Usage</a><br />
|
|
478
|
+
<a href="#languageFilter">Language Filter</a><br />
|
|
479
|
+
<a href="#withTextToSpeech">With TextToSpeech</a><br />
|
|
480
|
+
<a href="#disabled">Disabled</a><br />
|
|
481
|
+
|
|
482
|
+
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
483
|
+
<a href="#constructor">Constructor</a><br />
|
|
484
|
+
<a href="#requirements">Requirements</a><br />
|
|
485
|
+
<a href="#properties">Properties</a><br />
|
|
486
|
+
<a href="#methods">Methods</a><br />
|
|
487
|
+
<a href="#events">Events</a><br />
|
|
488
|
+
</div>
|
|
489
|
+
</k-accordion-panel>
|
|
490
|
+
</k-accordion>
|
|
491
|
+
|
|
492
|
+
<p>Two cascading <code><select></code>s — the first picks a language, the second lists voices for that language. The chosen voice is persisted via the <a href="../utils/voice.html">voice utility</a>, so every <a href="./text-to-speech.html"><code><k-text-to-speech></code></a> on the page (and across reloads) uses it as a default when no <code>voice</code> attribute is set.</p>
|
|
493
|
+
<p>The language dropdown defaults to the browser's primary language (<code>navigator.language</code>) so a user almost always sees a relevant voice list immediately.</p>
|
|
494
|
+
|
|
495
|
+
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
496
|
+
<p>Just drop the element into a settings page or somewhere visible. Voices load asynchronously, so the dropdowns may briefly be empty before the rest populate.</p>
|
|
497
|
+
<div class="row -mx">
|
|
498
|
+
<div class="col m-span-12 px">
|
|
499
|
+
<k-card label="HTML">
|
|
500
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-voice-selector</span>></span><span class="hljs-tag"></<span class="hljs-name">k-voice-selector</span>></span></code></pre>
|
|
501
|
+
</k-card>
|
|
502
|
+
</div>
|
|
503
|
+
<div class="col m-span-12 px">
|
|
504
|
+
<k-card label="Output">
|
|
505
|
+
<k-voice-selector></k-voice-selector>
|
|
506
|
+
</k-card>
|
|
507
|
+
</div>
|
|
508
|
+
</div>
|
|
509
|
+
|
|
510
|
+
<h3 id="languageFilter"><a href="#languageFilter" class="no-link">Initial Language</a></h3>
|
|
511
|
+
<p>Set <code>language</code> to override the default browser language. Accepts a primary language code (e.g. <code>"fr"</code>, <code>"es"</code>) or a full BCP‑47 tag (the primary part is used). The user can still switch via the dropdown afterward.</p>
|
|
512
|
+
<div class="row -mx">
|
|
513
|
+
<div class="col m-span-12 px">
|
|
514
|
+
<k-card label="HTML">
|
|
515
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-voice-selector</span> <span class="hljs-attr">language</span>=<span class="hljs-string">"fr"</span>></span><span class="hljs-tag"></<span class="hljs-name">k-voice-selector</span>></span></code></pre>
|
|
516
|
+
</k-card>
|
|
517
|
+
</div>
|
|
518
|
+
<div class="col m-span-12 px">
|
|
519
|
+
<k-card label="Output">
|
|
520
|
+
<k-voice-selector language="fr"></k-voice-selector>
|
|
521
|
+
</k-card>
|
|
522
|
+
</div>
|
|
523
|
+
</div>
|
|
524
|
+
|
|
525
|
+
<h3 id="withTextToSpeech"><a href="#withTextToSpeech" class="no-link">With TextToSpeech</a></h3>
|
|
526
|
+
<p>Pick a voice in the dropdown, then click any <code><k-text-to-speech></code> on the page that doesn't have its own <code>voice</code> attribute — it'll use your saved preference. The choice persists across page reloads.</p>
|
|
527
|
+
<div class="row -mx">
|
|
528
|
+
<div class="col m-span-12 px">
|
|
529
|
+
<k-card label="HTML">
|
|
530
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-voice-selector</span>></span><span class="hljs-tag"></<span class="hljs-name">k-voice-selector</span>></span><br><span class="hljs-tag"><<span class="hljs-name">k-text-to-speech</span> <span class="hljs-attr">text</span>=<span class="hljs-string">"This will use the voice you picked above"</span>></span><span class="hljs-tag"></<span class="hljs-name">k-text-to-speech</span>></span></code></pre>
|
|
531
|
+
</k-card>
|
|
532
|
+
</div>
|
|
533
|
+
<div class="col m-span-12 px">
|
|
534
|
+
<k-card label="Output">
|
|
535
|
+
<k-voice-selector class="mr"></k-voice-selector>
|
|
536
|
+
<k-text-to-speech text="This will use the voice you picked above"></k-text-to-speech>
|
|
537
|
+
</k-card>
|
|
538
|
+
</div>
|
|
539
|
+
</div>
|
|
540
|
+
|
|
541
|
+
<h3 id="disabled"><a href="#disabled" class="no-link">Disabled</a></h3>
|
|
542
|
+
<p>The <code>disabled</code> attribute prevents user interaction. The dropdown also auto-disables when the browser doesn't support the SpeechSynthesis API.</p>
|
|
543
|
+
<div class="row -mx">
|
|
544
|
+
<div class="col m-span-12 px">
|
|
545
|
+
<k-card label="HTML">
|
|
546
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-voice-selector</span> <span class="hljs-attr">disabled</span>></span><span class="hljs-tag"></<span class="hljs-name">k-voice-selector</span>></span></code></pre>
|
|
547
|
+
</k-card>
|
|
548
|
+
</div>
|
|
549
|
+
<div class="col m-span-12 px">
|
|
550
|
+
<k-card label="Output">
|
|
551
|
+
<k-voice-selector disabled></k-voice-selector>
|
|
552
|
+
</k-card>
|
|
553
|
+
</div>
|
|
554
|
+
</div>
|
|
555
|
+
|
|
556
|
+
<h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
|
|
557
|
+
|
|
558
|
+
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
559
|
+
<h6>Extends <a href="./shadow-component.html">ShadowComponent</a></h6>
|
|
560
|
+
<h5><code>new VoiceSelector()</code></h5>
|
|
561
|
+
|
|
562
|
+
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
563
|
+
<ul>
|
|
564
|
+
<li><a href="./shadow-component.html">ShadowComponent</a></li>
|
|
565
|
+
<li>The <a href="../utils/voice.html">voice utility</a></li>
|
|
566
|
+
<li>A browser with <code>window.speechSynthesis</code></li>
|
|
567
|
+
</ul>
|
|
568
|
+
|
|
569
|
+
<h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
|
|
570
|
+
<h5><code>language<i>: String</i></code></h5>
|
|
571
|
+
<p>Optional initial language. If set, overrides the default <code>navigator.language</code> on first render. Accepts a primary language code (<code>"en"</code>, <code>"es"</code>) or a full BCP‑47 tag (the primary part is used). The user can change the language via the first dropdown afterward. Syncs to <code>language</code> attribute.</p>
|
|
572
|
+
|
|
573
|
+
<h5><code>placeholder<i>: String</i></code></h5>
|
|
574
|
+
<p>Label for the empty-selection option. Default is <code>"Browser default"</code>. Syncs to <code>placeholder</code> attribute.</p>
|
|
575
|
+
|
|
576
|
+
<h5><code>disabled<i>: Boolean</i></code></h5>
|
|
577
|
+
<p>When <code>true</code>, the dropdown cannot be changed. Syncs to <code>disabled</code> attribute.</p>
|
|
578
|
+
|
|
579
|
+
<h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
|
|
580
|
+
<h5><code>refresh()<i>: void</i></code></h5>
|
|
581
|
+
<p>Force a re-read of <code>speechSynthesis.getVoices()</code>. Rarely needed since the component subscribes to the <code>voiceschanged</code> event, but useful if you populate voices dynamically.</p>
|
|
582
|
+
|
|
583
|
+
<h3 id="events"><a href="#events" class="no-link">Events</a></h3>
|
|
584
|
+
<h5><code>change</code></h5>
|
|
585
|
+
<p>Fires when the user picks a new voice. <code>detail</code> contains <code>{ voice: String }</code> — the voice name, or empty string for "browser default". The voice utility is updated automatically; this event is for callers that want to react in addition.</p>
|
|
586
|
+
|
|
587
|
+
</k-main>
|
|
588
|
+
<div style="height:33vh"></div>
|
|
589
|
+
<script type="module" src="../src/components/Main.js"></script>
|
|
590
|
+
|
|
591
|
+
<script type="module" src="../src/components/VoiceSelector.js"></script>
|
|
592
|
+
<script type="module" src="../src/components/TextToSpeech.js"></script>
|
|
593
|
+
<script type="module" src="../src/components/Icon.js"></script>
|
|
594
|
+
<script type="module" src="../src/components/Accordion.js"></script>
|
|
595
|
+
<script type="module" src="../src/components/Card.js"></script>
|
|
596
|
+
|
|
597
|
+
</body>
|
|
598
|
+
</html>
|