@atscript/moost-wf 0.1.167 → 0.1.169
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/index.mjs +12 -10
- package/package.json +16 -16
package/dist/index.mjs
CHANGED
|
@@ -372,27 +372,29 @@ function currentTranslation() {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
/**
|
|
375
|
-
* Localized schemas per serialized schema, then per
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
375
|
+
* Localized schemas per serialized schema, then per translation partition
|
|
376
|
+
* (the locale, plus the translator's scope — a tenant, a brand — when it has
|
|
377
|
+
* one), each with the translation key it was made under. The key changes with
|
|
378
|
+
* every `setTranslator` / `registerMessages` generation: the partition's entry
|
|
379
|
+
* is then replaced, so a schema keeps one output per served locale and scope.
|
|
379
380
|
*/
|
|
380
381
|
const memo = /* @__PURE__ */ new WeakMap();
|
|
381
382
|
/**
|
|
382
383
|
* `schema` in the translation's language: its texts translated, `$i18n`
|
|
383
384
|
* holding the translated message templates and the translated literals of
|
|
384
385
|
* its expressions. The schema itself when nothing changes. Memoized per
|
|
385
|
-
* (schema,
|
|
386
|
+
* (schema, partition) for the translator's locales and scopes; computed per
|
|
387
|
+
* call otherwise.
|
|
386
388
|
*/
|
|
387
389
|
function localizeSchema(schema, translation) {
|
|
388
|
-
const { key,
|
|
390
|
+
const { key, partition } = translation;
|
|
389
391
|
if (key === void 0) return build(schema, translation);
|
|
390
|
-
let
|
|
391
|
-
const hit =
|
|
392
|
+
let byPartition = memo.get(schema);
|
|
393
|
+
const hit = byPartition?.get(partition);
|
|
392
394
|
if (hit?.key === key) return hit.out;
|
|
393
395
|
const out = build(schema, translation);
|
|
394
|
-
if (!
|
|
395
|
-
|
|
396
|
+
if (!byPartition) memo.set(schema, byPartition = /* @__PURE__ */ new Map());
|
|
397
|
+
byPartition.set(partition, {
|
|
396
398
|
key,
|
|
397
399
|
out
|
|
398
400
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/moost-wf",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.169",
|
|
4
4
|
"description": "Workflow form integration for moost — decorators, interceptors, and serialization driven by atscript type metadata",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -56,32 +56,32 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@atscript/core": "^0.2.
|
|
60
|
-
"@atscript/db": "^0.1.
|
|
61
|
-
"@atscript/db-sql-tools": "^0.1.
|
|
62
|
-
"@atscript/db-sqlite": "^0.1.
|
|
63
|
-
"@atscript/typescript": "^0.2.
|
|
64
|
-
"@moostjs/event-wf": "^0.7.
|
|
59
|
+
"@atscript/core": "^0.2.9",
|
|
60
|
+
"@atscript/db": "^0.1.174",
|
|
61
|
+
"@atscript/db-sql-tools": "^0.1.174",
|
|
62
|
+
"@atscript/db-sqlite": "^0.1.174",
|
|
63
|
+
"@atscript/typescript": "^0.2.9",
|
|
64
|
+
"@moostjs/event-wf": "^0.7.4",
|
|
65
65
|
"@prostojs/wf": "^0.3.0",
|
|
66
66
|
"@uniqu/core": "^0.2.1",
|
|
67
67
|
"@wooksjs/event-core": "^0.8.1",
|
|
68
68
|
"@wooksjs/event-http": "^0.8.1",
|
|
69
69
|
"@wooksjs/event-wf": "^0.8.1",
|
|
70
70
|
"@wooksjs/http-body": "^0.8.1",
|
|
71
|
-
"moost": "^0.7.
|
|
72
|
-
"unplugin-atscript": "^0.2.
|
|
71
|
+
"moost": "^0.7.4",
|
|
72
|
+
"unplugin-atscript": "^0.2.9",
|
|
73
73
|
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.14",
|
|
74
|
-
"@atscript/ui": "^0.1.
|
|
75
|
-
"@atscript/ui
|
|
74
|
+
"@atscript/ui-fns": "^0.1.169",
|
|
75
|
+
"@atscript/ui": "^0.1.169"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@atscript/core": "^0.2.
|
|
79
|
-
"@atscript/db": "^0.1.
|
|
80
|
-
"@atscript/typescript": "^0.2.
|
|
81
|
-
"@moostjs/event-wf": "^0.7.
|
|
78
|
+
"@atscript/core": "^0.2.9",
|
|
79
|
+
"@atscript/db": "^0.1.174",
|
|
80
|
+
"@atscript/typescript": "^0.2.9",
|
|
81
|
+
"@moostjs/event-wf": "^0.7.4",
|
|
82
82
|
"@wooksjs/event-core": "^0.8.1",
|
|
83
83
|
"@wooksjs/event-wf": "^0.8.1",
|
|
84
|
-
"moost": "^0.7.
|
|
84
|
+
"moost": "^0.7.4"
|
|
85
85
|
},
|
|
86
86
|
"peerDependenciesMeta": {
|
|
87
87
|
"@atscript/db": {
|