@justai/core 0.9.3 → 0.10.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justai/core",
3
- "version": "0.9.3",
4
- "description": "The framework-free heart of the persona shell — the load-bearing behaviour (auth capture, reveal, ready) as plain strings, so Astro and Next inject the SAME logic instead of each re-writing it.",
3
+ "version": "0.10.0",
4
+ "description": "The framework-free heart of the persona shell \u2014 the load-bearing behaviour (auth capture, reveal, ready) as plain strings, so Astro and Next inject the SAME logic instead of each re-writing it.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
7
7
  "type": "git",
package/src/index.d.ts CHANGED
@@ -22,6 +22,12 @@ export declare const CONSENT_COPY: Record<string, { consentText: string; consent
22
22
  /** The consent copy for a language, falling back to English. */
23
23
  export declare function consentCopy(lang: string): { consentText: string; consentAllow: string; consentDecline: string; consentChoice: string };
24
24
 
25
+ /** Cancel and Done in thirteen languages — the ecosystem's chrome words, not a persona's copy. */
26
+ export declare const CHROME_COPY: Record<string, { cancel: string; done: string }>;
27
+
28
+ /** The chrome words for a language, falling back to English. */
29
+ export declare function chromeCopy(lang: string): { cancel: string; done: string };
30
+
25
31
  /** The consent dialog's behaviour — origin-scoped, asked once, with the universal change-your-mind door. */
26
32
  export declare const CONSENT_JS: string;
27
33
 
package/src/index.js CHANGED
@@ -263,6 +263,56 @@ export function consentCopy(lang) {
263
263
  }
264
264
 
265
265
 
266
+ /**
267
+ * queries: the sheet says Cancel in English · Cancel is not translated · Done is not translated ·
268
+ * the picker's cancel stays English in Arabic · sheet chrome language · translate a cut ·
269
+ * who owns the word Cancel · CHROME_COPY · a component's own words
270
+ *
271
+ * THE CHROME WORDS — Cancel and Done, in thirteen languages, said once.
272
+ *
273
+ * The same argument as CONSENT_COPY above, and found the same way: a picker opened on an Arabic page
274
+ * with every word around it in Arabic and `Cancel` in English, sitting in the sheet's own bar.
275
+ *
276
+ * `<Sheet>` had defaulted its Done to the literal "Done" and reasoned, in a comment, that a label is
277
+ * a prop "because the fleet speaks thirteen languages, and a cut that hardcoded the English would be
278
+ * a component making its consumer's copy decisions". The reasoning was inverted. Handing the word to
279
+ * the consumer does not avoid the decision — it makes it THIRTEEN TIMES, in every repo, and the
280
+ * hardcoded English default proved it: the cut was already deciding, and deciding wrong.
281
+ *
282
+ * These are not a persona's copy. `Cancel` is not qr's word or files' word; it is the ecosystem's,
283
+ * the way the back chevron is the ecosystem's shape. Law 1 — a component brings its own ground,
284
+ * style AND text — is what says the cut must carry them.
285
+ *
286
+ * WHY HERE rather than in @justai/cuts: same reason the consent copy is here. Every face reaches
287
+ * core; only the Astro shell reaches cuts.
288
+ *
289
+ * LIFTED FROM `files`, BYTE FOR BYTE, and that is the point rather than an economy. The file kernel
290
+ * mounts INSIDE a host's sheet: the guest draws its own cancel in the body and the host draws one in
291
+ * the bar, and a person looking at one surface must not be shown two different words for the one
292
+ * way out. One word per meaning — the same rule the `nameTaken` string learned the hard way.
293
+ */
294
+ export const CHROME_COPY = {
295
+ "ar": { "cancel": "إلغاء", "done": "تم" },
296
+ "de": { "cancel": "Abbrechen", "done": "Fertig" },
297
+ "en": { "cancel": "Cancel", "done": "Done" },
298
+ "es": { "cancel": "Cancelar", "done": "Listo" },
299
+ "fr": { "cancel": "Annuler", "done": "OK" },
300
+ "hi": { "cancel": "रद्द करें", "done": "हो गया" },
301
+ "it": { "cancel": "Annulla", "done": "Fine" },
302
+ "ja": { "cancel": "キャンセル", "done": "完了" },
303
+ "nl": { "cancel": "Annuleren", "done": "Klaar" },
304
+ "pt": { "cancel": "Cancelar", "done": "Concluído" },
305
+ "ru": { "cancel": "Отмена", "done": "Готово" },
306
+ "tr": { "cancel": "Vazgeç", "done": "Bitti" },
307
+ "zh": { "cancel": "取消", "done": "完成" }
308
+ };
309
+
310
+ /** The chrome words for a language, falling back to English. Never returns undefined. */
311
+ export function chromeCopy(lang) {
312
+ return CHROME_COPY[String(lang || "en").toLowerCase().split("-")[0]] || CHROME_COPY.en;
313
+ }
314
+
315
+
266
316
  /**
267
317
  * queries: consent dialog script · why does the sheet not appear on some pages · consent is asked
268
318
  * per domain not per page · getElementById kernel · the sheet never opened on feed ·