@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/config.d.ts
CHANGED
|
@@ -32,6 +32,14 @@ export interface SpeechOSClientConfig extends SpeechOSCoreConfig {
|
|
|
32
32
|
* Default: false
|
|
33
33
|
*/
|
|
34
34
|
alwaysVisible?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Use external settings page instead of built-in settings modal.
|
|
37
|
+
* When true, clicking the settings button opens /a/extension-settings
|
|
38
|
+
* at the configured host URL in a new tab.
|
|
39
|
+
*
|
|
40
|
+
* Default: false
|
|
41
|
+
*/
|
|
42
|
+
useExternalSettings?: boolean;
|
|
35
43
|
}
|
|
36
44
|
/**
|
|
37
45
|
* Resolved client config with defaults applied
|
|
@@ -40,6 +48,7 @@ export interface ResolvedClientConfig {
|
|
|
40
48
|
commands: CommandDefinition[];
|
|
41
49
|
zIndex: number;
|
|
42
50
|
alwaysVisible: boolean;
|
|
51
|
+
useExternalSettings: boolean;
|
|
43
52
|
}
|
|
44
53
|
/**
|
|
45
54
|
* Validate and resolve client-specific config
|
|
@@ -76,4 +85,8 @@ export declare function getZIndex(): number;
|
|
|
76
85
|
* Check if widget should always be visible
|
|
77
86
|
*/
|
|
78
87
|
export declare function isAlwaysVisible(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Check if external settings page should be used
|
|
90
|
+
*/
|
|
91
|
+
export declare function useExternalSettings(): boolean;
|
|
79
92
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,mGAAmG;IACnG,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAAC;IAChD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAC7C;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,mGAAmG;IACnG,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAAC;IAChD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAC7C;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAiBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAiBvF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAElE;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAEtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,iBAAiB,EAAE,CAEjD;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C"}
|
package/dist/index.cjs
CHANGED
|
@@ -15,6 +15,7 @@ const defaultClientConfig = {
|
|
|
15
15
|
commands: [],
|
|
16
16
|
zIndex: 999999,
|
|
17
17
|
alwaysVisible: false,
|
|
18
|
+
useExternalSettings: false,
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* Current client configuration singleton
|
|
@@ -30,6 +31,7 @@ function validateClientConfig(config) {
|
|
|
30
31
|
commands: config.commands ?? defaultClientConfig.commands,
|
|
31
32
|
zIndex: config.zIndex ?? defaultClientConfig.zIndex,
|
|
32
33
|
alwaysVisible: config.alwaysVisible ?? defaultClientConfig.alwaysVisible,
|
|
34
|
+
useExternalSettings: config.useExternalSettings ?? defaultClientConfig.useExternalSettings,
|
|
33
35
|
};
|
|
34
36
|
// Validate zIndex
|
|
35
37
|
if (typeof resolved.zIndex !== "number" || resolved.zIndex < 0) {
|
|
@@ -81,6 +83,12 @@ function getZIndex() {
|
|
|
81
83
|
function isAlwaysVisible() {
|
|
82
84
|
return currentClientConfig.alwaysVisible;
|
|
83
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Check if external settings page should be used
|
|
88
|
+
*/
|
|
89
|
+
function useExternalSettings() {
|
|
90
|
+
return currentClientConfig.useExternalSettings;
|
|
91
|
+
}
|
|
84
92
|
|
|
85
93
|
/**
|
|
86
94
|
* Form field focus detection for SpeechOS Client SDK
|
|
@@ -495,9 +503,12 @@ let memoryCache$3 = null;
|
|
|
495
503
|
* Sorted alphabetically by name for dropdown display
|
|
496
504
|
*/
|
|
497
505
|
const SUPPORTED_LANGUAGES = [
|
|
506
|
+
{ name: "Belarusian", code: "be", variants: ["be"] },
|
|
507
|
+
{ name: "Bengali", code: "bn", variants: ["bn"] },
|
|
508
|
+
{ name: "Bosnian", code: "bs", variants: ["bs"] },
|
|
498
509
|
{ name: "Bulgarian", code: "bg", variants: ["bg"] },
|
|
499
510
|
{ name: "Catalan", code: "ca", variants: ["ca"] },
|
|
500
|
-
{ name: "
|
|
511
|
+
{ name: "Croatian", code: "hr", variants: ["hr"] },
|
|
501
512
|
{ name: "Czech", code: "cs", variants: ["cs"] },
|
|
502
513
|
{ name: "Danish", code: "da", variants: ["da", "da-DK"] },
|
|
503
514
|
{ name: "Dutch", code: "nl", variants: ["nl"] },
|
|
@@ -518,18 +529,26 @@ const SUPPORTED_LANGUAGES = [
|
|
|
518
529
|
{ name: "Indonesian", code: "id", variants: ["id"] },
|
|
519
530
|
{ name: "Italian", code: "it", variants: ["it"] },
|
|
520
531
|
{ name: "Japanese", code: "ja", variants: ["ja"] },
|
|
532
|
+
{ name: "Kannada", code: "kn", variants: ["kn"] },
|
|
521
533
|
{ name: "Korean", code: "ko", variants: ["ko", "ko-KR"] },
|
|
522
534
|
{ name: "Latvian", code: "lv", variants: ["lv"] },
|
|
523
535
|
{ name: "Lithuanian", code: "lt", variants: ["lt"] },
|
|
536
|
+
{ name: "Macedonian", code: "mk", variants: ["mk"] },
|
|
524
537
|
{ name: "Malay", code: "ms", variants: ["ms"] },
|
|
538
|
+
{ name: "Marathi", code: "mr", variants: ["mr"] },
|
|
525
539
|
{ name: "Norwegian", code: "no", variants: ["no"] },
|
|
526
540
|
{ name: "Polish", code: "pl", variants: ["pl"] },
|
|
527
541
|
{ name: "Portuguese", code: "pt", variants: ["pt", "pt-BR", "pt-PT"] },
|
|
528
542
|
{ name: "Romanian", code: "ro", variants: ["ro"] },
|
|
529
543
|
{ name: "Russian", code: "ru", variants: ["ru"] },
|
|
544
|
+
{ name: "Serbian", code: "sr", variants: ["sr"] },
|
|
530
545
|
{ name: "Slovak", code: "sk", variants: ["sk"] },
|
|
546
|
+
{ name: "Slovenian", code: "sl", variants: ["sl"] },
|
|
531
547
|
{ name: "Spanish", code: "es", variants: ["es", "es-419"] },
|
|
532
548
|
{ name: "Swedish", code: "sv", variants: ["sv", "sv-SE"] },
|
|
549
|
+
{ name: "Tagalog", code: "tl", variants: ["tl"] },
|
|
550
|
+
{ name: "Tamil", code: "ta", variants: ["ta"] },
|
|
551
|
+
{ name: "Telugu", code: "te", variants: ["te"] },
|
|
533
552
|
{ name: "Turkish", code: "tr", variants: ["tr"] },
|
|
534
553
|
{ name: "Ukrainian", code: "uk", variants: ["uk"] },
|
|
535
554
|
{ name: "Vietnamese", code: "vi", variants: ["vi"] },
|
|
@@ -1322,25 +1341,14 @@ class SettingsSync {
|
|
|
1322
1341
|
this.syncDisabled = false;
|
|
1323
1342
|
}
|
|
1324
1343
|
/**
|
|
1325
|
-
* Make a fetch request using
|
|
1326
|
-
* This allows the Chrome extension to route fetch traffic through the service worker
|
|
1327
|
-
* to bypass page CSP restrictions.
|
|
1344
|
+
* Make a fetch request using native fetch.
|
|
1328
1345
|
*/
|
|
1329
1346
|
async doFetch(url, options) {
|
|
1330
1347
|
const config = core.getConfig();
|
|
1331
|
-
const customHandler = core.getFetchHandler();
|
|
1332
|
-
if (customHandler) {
|
|
1333
|
-
if (config.debug) {
|
|
1334
|
-
console.log("[SpeechOS] Using custom fetch handler (extension proxy)", options.method, url);
|
|
1335
|
-
}
|
|
1336
|
-
return customHandler(url, options);
|
|
1337
|
-
}
|
|
1338
1348
|
if (config.debug) {
|
|
1339
1349
|
console.log("[SpeechOS] Using native fetch", options.method, url);
|
|
1340
1350
|
}
|
|
1341
|
-
|
|
1342
|
-
const response = await fetch(url, options);
|
|
1343
|
-
return response;
|
|
1351
|
+
return fetch(url, options);
|
|
1344
1352
|
}
|
|
1345
1353
|
/**
|
|
1346
1354
|
* Initialize the settings sync manager
|
|
@@ -5216,6 +5224,16 @@ let SpeechOSSettingsTab = class SpeechOSSettingsTab extends i$1 {
|
|
|
5216
5224
|
padding: 8px;
|
|
5217
5225
|
}
|
|
5218
5226
|
|
|
5227
|
+
.settings-select:disabled {
|
|
5228
|
+
opacity: 0.4;
|
|
5229
|
+
cursor: not-allowed;
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5232
|
+
.settings-select:disabled:hover {
|
|
5233
|
+
border-color: rgba(255, 255, 255, 0.08);
|
|
5234
|
+
background: rgba(0, 0, 0, 0.3);
|
|
5235
|
+
}
|
|
5236
|
+
|
|
5219
5237
|
.settings-select-arrow {
|
|
5220
5238
|
position: absolute;
|
|
5221
5239
|
right: 14px;
|
|
@@ -5397,13 +5415,14 @@ let SpeechOSSettingsTab = class SpeechOSSettingsTab extends i$1 {
|
|
|
5397
5415
|
setSmartFormatEnabled(this.smartFormatEnabled);
|
|
5398
5416
|
this.showSaved();
|
|
5399
5417
|
}
|
|
5400
|
-
renderLanguageSelector(selectedCode, onChange) {
|
|
5418
|
+
renderLanguageSelector(selectedCode, onChange, disabled = false) {
|
|
5401
5419
|
return b `
|
|
5402
5420
|
<div class="settings-select-wrapper">
|
|
5403
5421
|
<select
|
|
5404
5422
|
class="settings-select"
|
|
5405
5423
|
.value="${selectedCode}"
|
|
5406
5424
|
@change="${onChange}"
|
|
5425
|
+
?disabled="${disabled}"
|
|
5407
5426
|
>
|
|
5408
5427
|
${SUPPORTED_LANGUAGES.map((lang) => b `
|
|
5409
5428
|
<option
|
|
@@ -5521,7 +5540,7 @@ let SpeechOSSettingsTab = class SpeechOSSettingsTab extends i$1 {
|
|
|
5521
5540
|
<div class="settings-section-description">
|
|
5522
5541
|
AI automatically removes filler words, adds punctuation, and polishes
|
|
5523
5542
|
your text. Disable for raw transcription output. Note: disabling also
|
|
5524
|
-
turns off text snippets.
|
|
5543
|
+
turns off text snippets and output language translation.
|
|
5525
5544
|
</div>
|
|
5526
5545
|
<div class="settings-toggle-row">
|
|
5527
5546
|
<span class="settings-toggle-label">Enable AI formatting</span>
|
|
@@ -5562,9 +5581,13 @@ let SpeechOSSettingsTab = class SpeechOSSettingsTab extends i$1 {
|
|
|
5562
5581
|
</div>
|
|
5563
5582
|
<div class="settings-section-description">
|
|
5564
5583
|
The language for your transcribed text. Usually the same as input, but
|
|
5565
|
-
can differ for translation.
|
|
5584
|
+
can differ for translation.${!this.smartFormatEnabled
|
|
5585
|
+
? " Requires Smart Format to be enabled."
|
|
5586
|
+
: ""}
|
|
5566
5587
|
</div>
|
|
5567
|
-
${this.renderLanguageSelector(this.
|
|
5588
|
+
${this.renderLanguageSelector(this.smartFormatEnabled
|
|
5589
|
+
? this.selectedOutputLanguageCode
|
|
5590
|
+
: this.selectedInputLanguageCode, this.handleOutputLanguageChange.bind(this), !this.smartFormatEnabled)}
|
|
5568
5591
|
</div>
|
|
5569
5592
|
`;
|
|
5570
5593
|
}
|
|
@@ -7556,7 +7579,14 @@ let SpeechOSWidget = class SpeechOSWidget extends i$1 {
|
|
|
7556
7579
|
core.state.hide();
|
|
7557
7580
|
}
|
|
7558
7581
|
handleSettingsClick() {
|
|
7559
|
-
|
|
7582
|
+
if (useExternalSettings()) {
|
|
7583
|
+
const host = core.getConfig().host;
|
|
7584
|
+
const fullUrl = `${host}/a/extension-settings`;
|
|
7585
|
+
window.open(fullUrl, '_blank', 'noopener,noreferrer');
|
|
7586
|
+
}
|
|
7587
|
+
else {
|
|
7588
|
+
this.settingsOpen = true;
|
|
7589
|
+
}
|
|
7560
7590
|
}
|
|
7561
7591
|
handleDragStart(e) {
|
|
7562
7592
|
if (e.button !== 0)
|
|
@@ -8097,10 +8127,17 @@ let SpeechOSWidget = class SpeechOSWidget extends i$1 {
|
|
|
8097
8127
|
this.editSelectionStart = null;
|
|
8098
8128
|
this.editSelectionEnd = null;
|
|
8099
8129
|
this.editSelectedText = "";
|
|
8100
|
-
// Open settings modal
|
|
8101
|
-
|
|
8130
|
+
// Open settings - either external URL or modal
|
|
8131
|
+
if (useExternalSettings()) {
|
|
8132
|
+
const host = core.getConfig().host;
|
|
8133
|
+
const fullUrl = `${host}/a/extension-settings`;
|
|
8134
|
+
window.open(fullUrl, '_blank', 'noopener,noreferrer');
|
|
8135
|
+
}
|
|
8136
|
+
else {
|
|
8137
|
+
this.settingsOpen = true;
|
|
8138
|
+
}
|
|
8102
8139
|
if (core.getConfig().debug) {
|
|
8103
|
-
console.log("[SpeechOS] Settings
|
|
8140
|
+
console.log("[SpeechOS] Settings opened from no-audio warning", { useExternalSettings: useExternalSettings() });
|
|
8104
8141
|
}
|
|
8105
8142
|
await disconnectPromise;
|
|
8106
8143
|
}
|
|
@@ -8702,5 +8739,6 @@ exports.settingsSync = settingsSync;
|
|
|
8702
8739
|
exports.snippetsStore = snippetsStore;
|
|
8703
8740
|
exports.transcriptStore = transcriptStore;
|
|
8704
8741
|
exports.updateSnippet = updateSnippet;
|
|
8742
|
+
exports.useExternalSettings = useExternalSettings;
|
|
8705
8743
|
exports.vocabularyStore = vocabularyStore;
|
|
8706
8744
|
//# sourceMappingURL=index.cjs.map
|