@yadsh/dsh-l10n-overrides 0.1.1 → 0.1.2
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 +6 -6
- package/compatibility.json +13 -0
- package/lib/client.js +14 -10
- package/lib/index.js +10 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/runtime/protected-surfaces.d.ts +8 -0
- package/lib/types/runtime/scope-selector.d.ts +4 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -10,21 +10,21 @@ Runtime localization overrides for [DeepSeek Harness](https://github.com/deepsee
|
|
|
10
10
|
|
|
11
11
|
`dsh-l10n-overrides` overlays missing or incorrect locale entries without replacing the host locale service. Translation packs can also provide narrowly scoped DOM fallbacks for text and selected accessibility attributes.
|
|
12
12
|
|
|
13
|
-
[Specification](
|
|
13
|
+
[Specification](SPEC.md) · [Roadmap](ROADMAP.md)
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Install it by package name:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
dsh plugin --profile web add ./plugins/dsh-l10n-overrides
|
|
20
|
+
dsh plugin --profile web add @yadsh/dsh-l10n-overrides
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
To build and install from a local monorepo checkout instead:
|
|
25
24
|
|
|
26
25
|
```bash
|
|
27
|
-
|
|
26
|
+
pnpm --filter @yadsh/dsh-l10n-overrides build
|
|
27
|
+
dsh plugin --profile web add ./plugins/dsh-l10n-overrides
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
To remove the plugin:
|
package/lib/client.js
CHANGED
|
@@ -372,16 +372,7 @@ window.__ModuleLoader__.load({
|
|
|
372
372
|
}
|
|
373
373
|
};
|
|
374
374
|
//#endregion
|
|
375
|
-
//#region src/runtime/
|
|
376
|
-
const DOM_TRANSLATION_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
377
|
-
"placeholder",
|
|
378
|
-
"title",
|
|
379
|
-
"aria-label",
|
|
380
|
-
"alt"
|
|
381
|
-
]);
|
|
382
|
-
const ELEMENT_NODE = 1;
|
|
383
|
-
const TEXT_NODE = 3;
|
|
384
|
-
const SHOW_ELEMENT_AND_TEXT = 5;
|
|
375
|
+
//#region src/runtime/protected-surfaces.ts
|
|
385
376
|
const KNOWN_PROTECTION_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
386
377
|
"class",
|
|
387
378
|
"contenteditable",
|
|
@@ -429,6 +420,8 @@ window.__ModuleLoader__.load({
|
|
|
429
420
|
...SHARED_PROTECTED_SURFACES
|
|
430
421
|
].join(",");
|
|
431
422
|
const ATTRIBUTE_PROTECTED_SURFACE_SELECTOR = [...CODE_LIKE_PROTECTED_SURFACES, ...SHARED_PROTECTED_SURFACES].join(",");
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region src/runtime/scope-selector.ts
|
|
432
425
|
function isScopeIdentifierStart(character) {
|
|
433
426
|
return character !== void 0 && /[A-Z_a-z\u0080-\uFFFF]/.test(character);
|
|
434
427
|
}
|
|
@@ -521,6 +514,17 @@ window.__ModuleLoader__.load({
|
|
|
521
514
|
}
|
|
522
515
|
return components > 0 ? { dependencies } : void 0;
|
|
523
516
|
}
|
|
517
|
+
//#endregion
|
|
518
|
+
//#region src/runtime/dom-translator.ts
|
|
519
|
+
const DOM_TRANSLATION_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
520
|
+
"placeholder",
|
|
521
|
+
"title",
|
|
522
|
+
"aria-label",
|
|
523
|
+
"alt"
|
|
524
|
+
]);
|
|
525
|
+
const ELEMENT_NODE = 1;
|
|
526
|
+
const TEXT_NODE = 3;
|
|
527
|
+
const SHOW_ELEMENT_AND_TEXT = 5;
|
|
524
528
|
var DomTranslator = class {
|
|
525
529
|
document;
|
|
526
530
|
diagnostics;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
import { createHostLoggerSink, getPluginLogger } from "@yadsh/dsh-plugin-log";
|
|
1
2
|
//#region src/index.ts
|
|
2
|
-
|
|
3
|
+
/** Host lifecycle companion; translation diagnostics remain browser-local. */
|
|
4
|
+
function apply(ctx) {
|
|
5
|
+
const logger = getPluginLogger({
|
|
6
|
+
pluginId: "dsh-l10n-overrides",
|
|
7
|
+
consoleSink: createHostLoggerSink(ctx.logger)
|
|
8
|
+
});
|
|
9
|
+
logger.info("plugin.ready");
|
|
10
|
+
return async () => logger.close();
|
|
11
|
+
}
|
|
3
12
|
//#endregion
|
|
4
13
|
export { apply };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const KNOWN_PROTECTION_ATTRIBUTES: Set<string>;
|
|
2
|
+
export declare const CLASS_PROTECTION_PATTERN: RegExp;
|
|
3
|
+
export declare const TEST_ID_PROTECTION_PATTERN: RegExp;
|
|
4
|
+
export declare const SCOPE_AND_PROTECTION_ATTRIBUTES: string[];
|
|
5
|
+
export declare const SHARED_PROTECTED_SURFACES: string[];
|
|
6
|
+
export declare const CODE_LIKE_PROTECTED_SURFACES: string[];
|
|
7
|
+
export declare const TEXT_PROTECTED_SURFACE_SELECTOR: string;
|
|
8
|
+
export declare const ATTRIBUTE_PROTECTED_SURFACE_SELECTOR: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yadsh/dsh-l10n-overrides",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "English localization overrides for DeepSeek Harness plugins",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"lib/**/*.js",
|
|
44
44
|
"lib/types/**/*.d.ts",
|
|
45
45
|
"cordis.patch.yml",
|
|
46
|
+
"compatibility.json",
|
|
46
47
|
"README.md",
|
|
47
48
|
"ROADMAP.md",
|
|
48
49
|
"LICENSE"
|
|
@@ -63,6 +64,9 @@
|
|
|
63
64
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
64
65
|
"@deepseek-ai/dsh-client-locale": ">=0.1.1-rc.2 <0.2.0"
|
|
65
66
|
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@yadsh/dsh-plugin-log": "^0.2.1"
|
|
69
|
+
},
|
|
66
70
|
"devDependencies": {
|
|
67
71
|
"@deepseek-ai/cordis": "4.0.1",
|
|
68
72
|
"@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
|
|
@@ -72,7 +76,8 @@
|
|
|
72
76
|
"prettier": "^3.6.2",
|
|
73
77
|
"tsdown": "^0.22.14",
|
|
74
78
|
"typescript": "^7.0.2",
|
|
75
|
-
"vitest": "^4.1.11"
|
|
79
|
+
"vitest": "^4.1.11",
|
|
80
|
+
"@yadsh/dsh-config": "^0.0.0"
|
|
76
81
|
},
|
|
77
82
|
"publishConfig": {
|
|
78
83
|
"access": "public",
|