@speechos/client 0.2.9 → 0.2.10
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/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.cjs +60 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.iife.js +61 -32
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +116 -105
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.js +61 -24
- package/dist/index.js.map +1 -1
- package/dist/settings-sync.d.ts +1 -3
- package/dist/settings-sync.d.ts.map +1 -1
- package/dist/stores/language-settings.d.ts.map +1 -1
- package/dist/ui/tabs/settings-tab.d.ts.map +1 -1
- package/dist/ui/widget.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { state, events, getConfig,
|
|
1
|
+
import { state, events, getConfig, getSettingsToken, clearSettingsToken, getBackend, setConfig, updateUserId } from '@speechos/core';
|
|
2
2
|
export { DEFAULT_HOST, events, getConfig, livekit, resetConfig, setConfig, state } from '@speechos/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -12,6 +12,7 @@ const defaultClientConfig = {
|
|
|
12
12
|
commands: [],
|
|
13
13
|
zIndex: 999999,
|
|
14
14
|
alwaysVisible: false,
|
|
15
|
+
useExternalSettings: false,
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
* Current client configuration singleton
|
|
@@ -27,6 +28,7 @@ function validateClientConfig(config) {
|
|
|
27
28
|
commands: config.commands ?? defaultClientConfig.commands,
|
|
28
29
|
zIndex: config.zIndex ?? defaultClientConfig.zIndex,
|
|
29
30
|
alwaysVisible: config.alwaysVisible ?? defaultClientConfig.alwaysVisible,
|
|
31
|
+
useExternalSettings: config.useExternalSettings ?? defaultClientConfig.useExternalSettings,
|
|
30
32
|
};
|
|
31
33
|
// Validate zIndex
|
|
32
34
|
if (typeof resolved.zIndex !== "number" || resolved.zIndex < 0) {
|
|
@@ -78,6 +80,12 @@ function getZIndex() {
|
|
|
78
80
|
function isAlwaysVisible() {
|
|
79
81
|
return currentClientConfig.alwaysVisible;
|
|
80
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Check if external settings page should be used
|
|
85
|
+
*/
|
|
86
|
+
function useExternalSettings() {
|
|
87
|
+
return currentClientConfig.useExternalSettings;
|
|
88
|
+
}
|
|
81
89
|
|
|
82
90
|
/**
|
|
83
91
|
* Form field focus detection for SpeechOS Client SDK
|
|
@@ -492,9 +500,12 @@ let memoryCache$3 = null;
|
|
|
492
500
|
* Sorted alphabetically by name for dropdown display
|
|
493
501
|
*/
|
|
494
502
|
const SUPPORTED_LANGUAGES = [
|
|
503
|
+
{ name: "Belarusian", code: "be", variants: ["be"] },
|
|
504
|
+
{ name: "Bengali", code: "bn", variants: ["bn"] },
|
|
505
|
+
{ name: "Bosnian", code: "bs", variants: ["bs"] },
|
|
495
506
|
{ name: "Bulgarian", code: "bg", variants: ["bg"] },
|
|
496
507
|
{ name: "Catalan", code: "ca", variants: ["ca"] },
|
|
497
|
-
{ name: "
|
|
508
|
+
{ name: "Croatian", code: "hr", variants: ["hr"] },
|
|
498
509
|
{ name: "Czech", code: "cs", variants: ["cs"] },
|
|
499
510
|
{ name: "Danish", code: "da", variants: ["da", "da-DK"] },
|
|
500
511
|
{ name: "Dutch", code: "nl", variants: ["nl"] },
|
|
@@ -515,18 +526,26 @@ const SUPPORTED_LANGUAGES = [
|
|
|
515
526
|
{ name: "Indonesian", code: "id", variants: ["id"] },
|
|
516
527
|
{ name: "Italian", code: "it", variants: ["it"] },
|
|
517
528
|
{ name: "Japanese", code: "ja", variants: ["ja"] },
|
|
529
|
+
{ name: "Kannada", code: "kn", variants: ["kn"] },
|
|
518
530
|
{ name: "Korean", code: "ko", variants: ["ko", "ko-KR"] },
|
|
519
531
|
{ name: "Latvian", code: "lv", variants: ["lv"] },
|
|
520
532
|
{ name: "Lithuanian", code: "lt", variants: ["lt"] },
|
|
533
|
+
{ name: "Macedonian", code: "mk", variants: ["mk"] },
|
|
521
534
|
{ name: "Malay", code: "ms", variants: ["ms"] },
|
|
535
|
+
{ name: "Marathi", code: "mr", variants: ["mr"] },
|
|
522
536
|
{ name: "Norwegian", code: "no", variants: ["no"] },
|
|
523
537
|
{ name: "Polish", code: "pl", variants: ["pl"] },
|
|
524
538
|
{ name: "Portuguese", code: "pt", variants: ["pt", "pt-BR", "pt-PT"] },
|
|
525
539
|
{ name: "Romanian", code: "ro", variants: ["ro"] },
|
|
526
540
|
{ name: "Russian", code: "ru", variants: ["ru"] },
|
|
541
|
+
{ name: "Serbian", code: "sr", variants: ["sr"] },
|
|
527
542
|
{ name: "Slovak", code: "sk", variants: ["sk"] },
|
|
543
|
+
{ name: "Slovenian", code: "sl", variants: ["sl"] },
|
|
528
544
|
{ name: "Spanish", code: "es", variants: ["es", "es-419"] },
|
|
529
545
|
{ name: "Swedish", code: "sv", variants: ["sv", "sv-SE"] },
|
|
546
|
+
{ name: "Tagalog", code: "tl", variants: ["tl"] },
|
|
547
|
+
{ name: "Tamil", code: "ta", variants: ["ta"] },
|
|
548
|
+
{ name: "Telugu", code: "te", variants: ["te"] },
|
|
530
549
|
{ name: "Turkish", code: "tr", variants: ["tr"] },
|
|
531
550
|
{ name: "Ukrainian", code: "uk", variants: ["uk"] },
|
|
532
551
|
{ name: "Vietnamese", code: "vi", variants: ["vi"] },
|
|
@@ -1319,25 +1338,14 @@ class SettingsSync {
|
|
|
1319
1338
|
this.syncDisabled = false;
|
|
1320
1339
|
}
|
|
1321
1340
|
/**
|
|
1322
|
-
* Make a fetch request using
|
|
1323
|
-
* This allows the Chrome extension to route fetch traffic through the service worker
|
|
1324
|
-
* to bypass page CSP restrictions.
|
|
1341
|
+
* Make a fetch request using native fetch.
|
|
1325
1342
|
*/
|
|
1326
1343
|
async doFetch(url, options) {
|
|
1327
1344
|
const config = getConfig();
|
|
1328
|
-
const customHandler = getFetchHandler();
|
|
1329
|
-
if (customHandler) {
|
|
1330
|
-
if (config.debug) {
|
|
1331
|
-
console.log("[SpeechOS] Using custom fetch handler (extension proxy)", options.method, url);
|
|
1332
|
-
}
|
|
1333
|
-
return customHandler(url, options);
|
|
1334
|
-
}
|
|
1335
1345
|
if (config.debug) {
|
|
1336
1346
|
console.log("[SpeechOS] Using native fetch", options.method, url);
|
|
1337
1347
|
}
|
|
1338
|
-
|
|
1339
|
-
const response = await fetch(url, options);
|
|
1340
|
-
return response;
|
|
1348
|
+
return fetch(url, options);
|
|
1341
1349
|
}
|
|
1342
1350
|
/**
|
|
1343
1351
|
* Initialize the settings sync manager
|
|
@@ -5213,6 +5221,16 @@ let SpeechOSSettingsTab = class SpeechOSSettingsTab extends i$1 {
|
|
|
5213
5221
|
padding: 8px;
|
|
5214
5222
|
}
|
|
5215
5223
|
|
|
5224
|
+
.settings-select:disabled {
|
|
5225
|
+
opacity: 0.4;
|
|
5226
|
+
cursor: not-allowed;
|
|
5227
|
+
}
|
|
5228
|
+
|
|
5229
|
+
.settings-select:disabled:hover {
|
|
5230
|
+
border-color: rgba(255, 255, 255, 0.08);
|
|
5231
|
+
background: rgba(0, 0, 0, 0.3);
|
|
5232
|
+
}
|
|
5233
|
+
|
|
5216
5234
|
.settings-select-arrow {
|
|
5217
5235
|
position: absolute;
|
|
5218
5236
|
right: 14px;
|
|
@@ -5394,13 +5412,14 @@ let SpeechOSSettingsTab = class SpeechOSSettingsTab extends i$1 {
|
|
|
5394
5412
|
setSmartFormatEnabled(this.smartFormatEnabled);
|
|
5395
5413
|
this.showSaved();
|
|
5396
5414
|
}
|
|
5397
|
-
renderLanguageSelector(selectedCode, onChange) {
|
|
5415
|
+
renderLanguageSelector(selectedCode, onChange, disabled = false) {
|
|
5398
5416
|
return b `
|
|
5399
5417
|
<div class="settings-select-wrapper">
|
|
5400
5418
|
<select
|
|
5401
5419
|
class="settings-select"
|
|
5402
5420
|
.value="${selectedCode}"
|
|
5403
5421
|
@change="${onChange}"
|
|
5422
|
+
?disabled="${disabled}"
|
|
5404
5423
|
>
|
|
5405
5424
|
${SUPPORTED_LANGUAGES.map((lang) => b `
|
|
5406
5425
|
<option
|
|
@@ -5518,7 +5537,7 @@ let SpeechOSSettingsTab = class SpeechOSSettingsTab extends i$1 {
|
|
|
5518
5537
|
<div class="settings-section-description">
|
|
5519
5538
|
AI automatically removes filler words, adds punctuation, and polishes
|
|
5520
5539
|
your text. Disable for raw transcription output. Note: disabling also
|
|
5521
|
-
turns off text snippets.
|
|
5540
|
+
turns off text snippets and output language translation.
|
|
5522
5541
|
</div>
|
|
5523
5542
|
<div class="settings-toggle-row">
|
|
5524
5543
|
<span class="settings-toggle-label">Enable AI formatting</span>
|
|
@@ -5559,9 +5578,13 @@ let SpeechOSSettingsTab = class SpeechOSSettingsTab extends i$1 {
|
|
|
5559
5578
|
</div>
|
|
5560
5579
|
<div class="settings-section-description">
|
|
5561
5580
|
The language for your transcribed text. Usually the same as input, but
|
|
5562
|
-
can differ for translation.
|
|
5581
|
+
can differ for translation.${!this.smartFormatEnabled
|
|
5582
|
+
? " Requires Smart Format to be enabled."
|
|
5583
|
+
: ""}
|
|
5563
5584
|
</div>
|
|
5564
|
-
${this.renderLanguageSelector(this.
|
|
5585
|
+
${this.renderLanguageSelector(this.smartFormatEnabled
|
|
5586
|
+
? this.selectedOutputLanguageCode
|
|
5587
|
+
: this.selectedInputLanguageCode, this.handleOutputLanguageChange.bind(this), !this.smartFormatEnabled)}
|
|
5565
5588
|
</div>
|
|
5566
5589
|
`;
|
|
5567
5590
|
}
|
|
@@ -7553,7 +7576,14 @@ let SpeechOSWidget = class SpeechOSWidget extends i$1 {
|
|
|
7553
7576
|
state.hide();
|
|
7554
7577
|
}
|
|
7555
7578
|
handleSettingsClick() {
|
|
7556
|
-
|
|
7579
|
+
if (useExternalSettings()) {
|
|
7580
|
+
const host = getConfig().host;
|
|
7581
|
+
const fullUrl = `${host}/a/extension-settings`;
|
|
7582
|
+
window.open(fullUrl, '_blank', 'noopener,noreferrer');
|
|
7583
|
+
}
|
|
7584
|
+
else {
|
|
7585
|
+
this.settingsOpen = true;
|
|
7586
|
+
}
|
|
7557
7587
|
}
|
|
7558
7588
|
handleDragStart(e) {
|
|
7559
7589
|
if (e.button !== 0)
|
|
@@ -8094,10 +8124,17 @@ let SpeechOSWidget = class SpeechOSWidget extends i$1 {
|
|
|
8094
8124
|
this.editSelectionStart = null;
|
|
8095
8125
|
this.editSelectionEnd = null;
|
|
8096
8126
|
this.editSelectedText = "";
|
|
8097
|
-
// Open settings modal
|
|
8098
|
-
|
|
8127
|
+
// Open settings - either external URL or modal
|
|
8128
|
+
if (useExternalSettings()) {
|
|
8129
|
+
const host = getConfig().host;
|
|
8130
|
+
const fullUrl = `${host}/a/extension-settings`;
|
|
8131
|
+
window.open(fullUrl, '_blank', 'noopener,noreferrer');
|
|
8132
|
+
}
|
|
8133
|
+
else {
|
|
8134
|
+
this.settingsOpen = true;
|
|
8135
|
+
}
|
|
8099
8136
|
if (getConfig().debug) {
|
|
8100
|
-
console.log("[SpeechOS] Settings
|
|
8137
|
+
console.log("[SpeechOS] Settings opened from no-audio warning", { useExternalSettings: useExternalSettings() });
|
|
8101
8138
|
}
|
|
8102
8139
|
await disconnectPromise;
|
|
8103
8140
|
}
|
|
@@ -8611,5 +8648,5 @@ class SpeechOS {
|
|
|
8611
8648
|
// Version
|
|
8612
8649
|
const VERSION = "0.1.0";
|
|
8613
8650
|
|
|
8614
|
-
export { DefaultTextInputHandler, FormDetector, SUPPORTED_LANGUAGES, SpeechOS, VERSION, addSnippet, addTerm, audioSettings, clearSnippets, clearTranscripts, clearVocabulary, SpeechOS as default, defaultTextInputHandler, deleteSnippet, deleteTerm, deleteTranscript, formDetector, getAudioDeviceId, getAudioInputDevices, getAudioSettings, getClientConfig, getCommands, getInputLanguageCode, getInputLanguageName, getLanguageByCode, getLanguageCode, getLanguageName, getLanguageSettings, getOutputLanguageCode, getOutputLanguageName, getSessionSettings, getSmartFormatEnabled, getSnippetCount, getSnippets, getTextInputHandler, getTranscripts, getVocabulary, getVocabularyCount, getZIndex, hasCommands, isAtSnippetLimit, isAtVocabularyLimit, isSelectedDeviceAvailable, languageSettings, resetAudioSettings, resetClientConfig, resetLanguageSettings, resetTextInputHandler, saveTranscript, setAudioDeviceId, setClientConfig, setInputLanguageCode, setLanguageCode, setOutputLanguageCode, setSmartFormatEnabled, setTextInputHandler, settingsSync, snippetsStore, transcriptStore, updateSnippet, vocabularyStore };
|
|
8651
|
+
export { DefaultTextInputHandler, FormDetector, SUPPORTED_LANGUAGES, SpeechOS, VERSION, addSnippet, addTerm, audioSettings, clearSnippets, clearTranscripts, clearVocabulary, SpeechOS as default, defaultTextInputHandler, deleteSnippet, deleteTerm, deleteTranscript, formDetector, getAudioDeviceId, getAudioInputDevices, getAudioSettings, getClientConfig, getCommands, getInputLanguageCode, getInputLanguageName, getLanguageByCode, getLanguageCode, getLanguageName, getLanguageSettings, getOutputLanguageCode, getOutputLanguageName, getSessionSettings, getSmartFormatEnabled, getSnippetCount, getSnippets, getTextInputHandler, getTranscripts, getVocabulary, getVocabularyCount, getZIndex, hasCommands, isAtSnippetLimit, isAtVocabularyLimit, isSelectedDeviceAvailable, languageSettings, resetAudioSettings, resetClientConfig, resetLanguageSettings, resetTextInputHandler, saveTranscript, setAudioDeviceId, setClientConfig, setInputLanguageCode, setLanguageCode, setOutputLanguageCode, setSmartFormatEnabled, setTextInputHandler, settingsSync, snippetsStore, transcriptStore, updateSnippet, useExternalSettings, vocabularyStore };
|
|
8615
8652
|
//# sourceMappingURL=index.js.map
|