@atscript/moost-wf 0.1.167 → 0.1.168

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.
Files changed (2) hide show
  1. package/dist/index.mjs +12 -10
  2. 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 locale — each with the
376
- * translation key it was made under. The key changes with every
377
- * `setTranslator` / `registerMessages` generation: the locale's entry is then
378
- * replaced, so a schema keeps one output per served locale.
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, locale) for the translator's locales; computed per call otherwise.
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, locale } = translation;
390
+ const { key, partition } = translation;
389
391
  if (key === void 0) return build(schema, translation);
390
- let byLocale = memo.get(schema);
391
- const hit = byLocale?.get(locale);
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 (!byLocale) memo.set(schema, byLocale = /* @__PURE__ */ new Map());
395
- byLocale.set(locale, {
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.167",
3
+ "version": "0.1.168",
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.8",
60
- "@atscript/db": "^0.1.171",
61
- "@atscript/db-sql-tools": "^0.1.171",
62
- "@atscript/db-sqlite": "^0.1.171",
63
- "@atscript/typescript": "^0.2.8",
64
- "@moostjs/event-wf": "^0.7.3",
59
+ "@atscript/core": "^0.2.9",
60
+ "@atscript/db": "^0.1.173",
61
+ "@atscript/db-sql-tools": "^0.1.173",
62
+ "@atscript/db-sqlite": "^0.1.173",
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.3",
72
- "unplugin-atscript": "^0.2.8",
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.167",
75
- "@atscript/ui-fns": "^0.1.167"
74
+ "@atscript/ui": "^0.1.168",
75
+ "@atscript/ui-fns": "^0.1.168"
76
76
  },
77
77
  "peerDependencies": {
78
- "@atscript/core": "^0.2.8",
79
- "@atscript/db": "^0.1.171",
80
- "@atscript/typescript": "^0.2.8",
81
- "@moostjs/event-wf": "^0.7.3",
78
+ "@atscript/core": "^0.2.9",
79
+ "@atscript/db": "^0.1.173",
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.3"
84
+ "moost": "^0.7.4"
85
85
  },
86
86
  "peerDependenciesMeta": {
87
87
  "@atscript/db": {