@easy-web/core 1.5.0 → 1.6.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.
Files changed (120) hide show
  1. package/README.md +42 -1
  2. package/dist/contracts/capabilities.d.ts +38 -0
  3. package/dist/contracts/capabilities.d.ts.map +1 -1
  4. package/dist/contracts/content-composition.d.ts +144 -0
  5. package/dist/contracts/content-composition.d.ts.map +1 -0
  6. package/dist/contracts/content-composition.js +143 -0
  7. package/dist/contracts/content-composition.js.map +1 -0
  8. package/dist/contracts/index.d.ts +2 -0
  9. package/dist/contracts/index.d.ts.map +1 -1
  10. package/dist/contracts/index.js +2 -0
  11. package/dist/contracts/index.js.map +1 -1
  12. package/dist/contracts/traits.d.ts +98 -0
  13. package/dist/contracts/traits.d.ts.map +1 -0
  14. package/dist/contracts/traits.js +84 -0
  15. package/dist/contracts/traits.js.map +1 -0
  16. package/dist/demo/demo-content.d.ts +37 -0
  17. package/dist/demo/demo-content.d.ts.map +1 -0
  18. package/dist/demo/demo-content.js +171 -0
  19. package/dist/demo/demo-content.js.map +1 -0
  20. package/dist/demo/index.d.ts +3 -0
  21. package/dist/demo/index.d.ts.map +1 -0
  22. package/dist/demo/index.js +3 -0
  23. package/dist/demo/index.js.map +1 -0
  24. package/dist/demo/legal-shells.d.ts +18 -0
  25. package/dist/demo/legal-shells.d.ts.map +1 -0
  26. package/dist/demo/legal-shells.js +40 -0
  27. package/dist/demo/legal-shells.js.map +1 -0
  28. package/dist/i18n/cli-catalogs.d.ts +42 -0
  29. package/dist/i18n/cli-catalogs.d.ts.map +1 -0
  30. package/dist/i18n/cli-catalogs.js +29 -0
  31. package/dist/i18n/cli-catalogs.js.map +1 -0
  32. package/dist/i18n/create-localization.d.ts +37 -0
  33. package/dist/i18n/create-localization.d.ts.map +1 -0
  34. package/dist/i18n/create-localization.js +68 -0
  35. package/dist/i18n/create-localization.js.map +1 -0
  36. package/dist/i18n/explicit-formatters.d.ts +20 -0
  37. package/dist/i18n/explicit-formatters.d.ts.map +1 -0
  38. package/dist/i18n/explicit-formatters.js +18 -0
  39. package/dist/i18n/explicit-formatters.js.map +1 -0
  40. package/dist/i18n/index.d.ts +4 -0
  41. package/dist/i18n/index.d.ts.map +1 -1
  42. package/dist/i18n/index.js +4 -0
  43. package/dist/i18n/index.js.map +1 -1
  44. package/dist/i18n/locale-inputs.d.ts +18 -0
  45. package/dist/i18n/locale-inputs.d.ts.map +1 -0
  46. package/dist/i18n/locale-inputs.js +73 -0
  47. package/dist/i18n/locale-inputs.js.map +1 -0
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +1 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/recipes/admission.d.ts +161 -0
  53. package/dist/recipes/admission.d.ts.map +1 -0
  54. package/dist/recipes/admission.js +85 -0
  55. package/dist/recipes/admission.js.map +1 -0
  56. package/dist/recipes/graph.d.ts +101 -0
  57. package/dist/recipes/graph.d.ts.map +1 -0
  58. package/dist/recipes/graph.js +166 -0
  59. package/dist/recipes/graph.js.map +1 -0
  60. package/dist/recipes/index.d.ts +9 -0
  61. package/dist/recipes/index.d.ts.map +1 -0
  62. package/dist/recipes/index.js +9 -0
  63. package/dist/recipes/index.js.map +1 -0
  64. package/dist/recipes/mermaid.d.ts +3 -0
  65. package/dist/recipes/mermaid.d.ts.map +1 -0
  66. package/dist/recipes/mermaid.js +79 -0
  67. package/dist/recipes/mermaid.js.map +1 -0
  68. package/dist/recipes/registry.d.ts +82 -0
  69. package/dist/recipes/registry.d.ts.map +1 -0
  70. package/dist/recipes/registry.js +40 -0
  71. package/dist/recipes/registry.js.map +1 -0
  72. package/dist/recipes/schema.d.ts +129 -0
  73. package/dist/recipes/schema.d.ts.map +1 -0
  74. package/dist/recipes/schema.js +41 -0
  75. package/dist/recipes/schema.js.map +1 -0
  76. package/dist/recipes/serialize.d.ts +20 -0
  77. package/dist/recipes/serialize.d.ts.map +1 -0
  78. package/dist/recipes/serialize.js +56 -0
  79. package/dist/recipes/serialize.js.map +1 -0
  80. package/dist/recipes/shell-recipe.d.ts +59 -0
  81. package/dist/recipes/shell-recipe.d.ts.map +1 -0
  82. package/dist/recipes/shell-recipe.js +145 -0
  83. package/dist/recipes/shell-recipe.js.map +1 -0
  84. package/dist/recipes/types.d.ts +72 -0
  85. package/dist/recipes/types.d.ts.map +1 -0
  86. package/dist/recipes/types.js +13 -0
  87. package/dist/recipes/types.js.map +1 -0
  88. package/dist/schemas/galleries.d.ts +2 -2
  89. package/package.json +17 -1
  90. package/src/components/DemoLegalShell.astro +36 -0
  91. package/src/contracts/__tests__/content-composition.test.ts +170 -0
  92. package/src/contracts/capabilities.ts +49 -0
  93. package/src/contracts/content-composition.ts +176 -0
  94. package/src/contracts/index.ts +2 -0
  95. package/src/contracts/traits.ts +107 -0
  96. package/src/demo/__tests__/demo-content.test.ts +107 -0
  97. package/src/demo/demo-content.ts +210 -0
  98. package/src/demo/index.ts +2 -0
  99. package/src/demo/legal-shells.ts +52 -0
  100. package/src/i18n/__tests__/create-localization.test.ts +138 -0
  101. package/src/i18n/__tests__/explicit-formatters.test.ts +82 -0
  102. package/src/i18n/cli-catalogs.ts +44 -0
  103. package/src/i18n/create-localization.ts +67 -0
  104. package/src/i18n/explicit-formatters.ts +36 -0
  105. package/src/i18n/index.ts +4 -0
  106. package/src/i18n/locale-inputs.ts +73 -0
  107. package/src/index.ts +1 -0
  108. package/src/recipes/__tests__/graph.test.ts +139 -0
  109. package/src/recipes/__tests__/protocol.test.ts +180 -0
  110. package/src/recipes/__tests__/serialize.test.ts +128 -0
  111. package/src/recipes/__tests__/shell-recipe.test.ts +75 -0
  112. package/src/recipes/admission.ts +77 -0
  113. package/src/recipes/graph.ts +244 -0
  114. package/src/recipes/index.ts +8 -0
  115. package/src/recipes/mermaid.ts +75 -0
  116. package/src/recipes/registry.ts +48 -0
  117. package/src/recipes/schema.ts +53 -0
  118. package/src/recipes/serialize.ts +77 -0
  119. package/src/recipes/shell-recipe.ts +162 -0
  120. package/src/recipes/types.ts +63 -0
@@ -0,0 +1,37 @@
1
+ import { type ContentComposition } from '../contracts/index.js';
2
+ /** Injected time source. The generator never reads the real clock. */
3
+ export interface DemoClock {
4
+ now(): Date;
5
+ }
6
+ export declare const DEMO_FIXED_INSTANT = "2026-01-01T00:00:00.000Z";
7
+ export declare function createFixedClock(iso?: string): DemoClock;
8
+ export declare const DEMO_LICENSES: readonly ["CC0-1.0", "internal-placeholder-not-for-production"];
9
+ export type DemoLicense = (typeof DEMO_LICENSES)[number];
10
+ export interface DemoAsset {
11
+ readonly src: string;
12
+ readonly alt: string;
13
+ readonly provenance: string;
14
+ readonly license: DemoLicense;
15
+ readonly svg: string;
16
+ }
17
+ export interface DemoContentItem {
18
+ readonly contentTypeId: string;
19
+ readonly locale: string;
20
+ readonly data: Readonly<Record<string, unknown>>;
21
+ }
22
+ export interface DemoContent {
23
+ readonly generatedAt: string;
24
+ readonly items: readonly DemoContentItem[];
25
+ readonly assets: readonly DemoAsset[];
26
+ }
27
+ export interface GenerateDemoContentOptions {
28
+ readonly clock: DemoClock;
29
+ readonly itemsPerType?: number;
30
+ }
31
+ export declare function generateDemoContent(composition: ContentComposition, options: GenerateDemoContentOptions): DemoContent;
32
+ export declare function canonicalize(value: unknown): string;
33
+ /** FNV-1a 64-bit over the canonical form. Not cryptographic; a determinism fingerprint. */
34
+ export declare function canonicalHash(value: unknown): string;
35
+ export declare function findPrivateData(value: unknown): string[];
36
+ export declare function validateDemoContent(content: DemoContent): void;
37
+ //# sourceMappingURL=demo-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo-content.d.ts","sourceRoot":"","sources":["../../src/demo/demo-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EAGxB,MAAM,uBAAuB,CAAC;AAE/B,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACxB,GAAG,IAAI,IAAI,CAAC;CACb;AAED,eAAO,MAAM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,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAGxD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CA4B9D"}
@@ -0,0 +1,171 @@
1
+ import { composeContentTraitSchema, } from '../contracts/index.js';
2
+ export const DEMO_FIXED_INSTANT = '2026-01-01T00:00:00.000Z';
3
+ export function createFixedClock(iso = DEMO_FIXED_INSTANT) {
4
+ const fixed = new Date(iso);
5
+ if (Number.isNaN(fixed.getTime()))
6
+ throw new Error(`Invalid fixed clock instant: ${iso}`);
7
+ return { now: () => new Date(fixed.getTime()) };
8
+ }
9
+ export const DEMO_LICENSES = ['CC0-1.0', 'internal-placeholder-not-for-production'];
10
+ const COPY = {
11
+ de: { name: 'Beispiel', body: 'Platzhaltertext fuer Beispielinhalte. Nicht fuer den Produktivbetrieb.', location: 'Beispielort', cta: 'Mehr erfahren', tag: 'Beispiel', alt: 'Neutraler Platzhalter, graue Flaeche', provenance: 'Platzhalter, automatisch erzeugt' },
12
+ en: { name: 'Sample', body: 'Placeholder text for sample content. Not for production use.', location: 'Sample Location', cta: 'Learn more', tag: 'Sample', alt: 'Neutral placeholder, grey rectangle', provenance: 'Placeholder, generated automatically' },
13
+ };
14
+ function copyFor(locale) {
15
+ return locale.toLowerCase().startsWith('de') ? COPY.de : COPY.en;
16
+ }
17
+ function placeholderSvg(index) {
18
+ const shade = 200 + ((index * 7) % 40);
19
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="800" viewBox="0 0 1200 800"><rect width="1200" height="800" fill="rgb(${shade},${shade},${shade})"/></svg>`;
20
+ }
21
+ function makeAsset(locale, typeId, index) {
22
+ const copy = copyFor(locale);
23
+ return {
24
+ src: `/demo/${typeId}-${locale}-${index + 1}.svg`,
25
+ alt: `${copy.alt} ${index + 1}`,
26
+ provenance: `${copy.provenance}; license: CC0-1.0`,
27
+ license: 'CC0-1.0',
28
+ svg: placeholderSvg(index),
29
+ };
30
+ }
31
+ function addDays(base, days) {
32
+ return new Date(base.getTime() + days * 86_400_000);
33
+ }
34
+ function buildItem(type, locale, index, base, assets) {
35
+ const copy = copyFor(locale);
36
+ const n = index + 1;
37
+ const traits = new Set(type.traits);
38
+ const data = {};
39
+ const nextAsset = () => {
40
+ const asset = makeAsset(locale, type.id, assets.length);
41
+ assets.push(asset);
42
+ return asset;
43
+ };
44
+ if (traits.has('title'))
45
+ data.title = `${copy.name} ${n}`;
46
+ if (traits.has('slug'))
47
+ data.slug = `sample-${n}`;
48
+ if (traits.has('summary'))
49
+ data.summary = `${copy.name} ${n}`;
50
+ if (traits.has('body'))
51
+ data.body = copy.body;
52
+ if (traits.has('image')) {
53
+ const a = nextAsset();
54
+ data.image = { src: a.src, alt: a.alt };
55
+ }
56
+ if (traits.has('photos')) {
57
+ data.photos = [0, 1].map(() => {
58
+ const a = nextAsset();
59
+ return { src: a.src, alt: a.alt };
60
+ });
61
+ }
62
+ if (traits.has('order'))
63
+ data.order = n;
64
+ if (traits.has('taxonomy'))
65
+ data.taxonomy = [copy.tag];
66
+ if (traits.has('publication'))
67
+ data.publishDate = addDays(base, -n);
68
+ if (traits.has('schedule'))
69
+ data.startDate = addDays(base, n * 7);
70
+ if (traits.has('location'))
71
+ data.location = copy.location;
72
+ if (traits.has('cta'))
73
+ data.cta = { label: copy.cta, href: '/' };
74
+ if (traits.has('money') && 'currency' in type) {
75
+ data.amount = n * 10;
76
+ data.currency = type.currency ?? 'EUR';
77
+ }
78
+ if (traits.has('featured'))
79
+ data.featured = index === 0;
80
+ return data;
81
+ }
82
+ export function generateDemoContent(composition, options) {
83
+ const base = options.clock.now();
84
+ const count = options.itemsPerType ?? 3;
85
+ const items = [];
86
+ const assets = [];
87
+ for (const type of composition.contentTypes) {
88
+ const schema = composeContentTraitSchema(type.traits);
89
+ for (const locale of composition.contentLocales) {
90
+ for (let i = 0; i < count; i++) {
91
+ const data = schema.parse(buildItem(type, locale, i, base, assets));
92
+ items.push({ contentTypeId: type.id, locale, data });
93
+ }
94
+ }
95
+ }
96
+ return { generatedAt: base.toISOString(), items, assets };
97
+ }
98
+ // -- Canonical serialisation and hash --
99
+ export function canonicalize(value) {
100
+ if (value instanceof Date)
101
+ return JSON.stringify(value.toISOString());
102
+ if (Array.isArray(value))
103
+ return `[${value.map(canonicalize).join(',')}]`;
104
+ if (value !== null && typeof value === 'object') {
105
+ const entries = Object.entries(value)
106
+ .filter(([, v]) => v !== undefined)
107
+ .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
108
+ return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalize(v)}`).join(',')}}`;
109
+ }
110
+ return JSON.stringify(value);
111
+ }
112
+ /** FNV-1a 64-bit over the canonical form. Not cryptographic; a determinism fingerprint. */
113
+ export function canonicalHash(value) {
114
+ let hash = 0xcbf29ce484222325n;
115
+ for (const char of canonicalize(value)) {
116
+ hash ^= BigInt(char.codePointAt(0) ?? 0);
117
+ hash = (hash * 0x100000001b3n) & 0xffffffffffffffffn;
118
+ }
119
+ return hash.toString(16).padStart(16, '0');
120
+ }
121
+ // -- Validation --
122
+ /** Emails, URLs, bare domains, GUID-like tenant ids. */
123
+ const PRIVATE_PATTERNS = [
124
+ /[^\s@]+@[^\s@]+/,
125
+ /https?:\/\//i,
126
+ /\bwww\./i,
127
+ /\b[a-z0-9-]+\.(?:de|com|org|net|io|eu|dev|onmicrosoft)\b/i,
128
+ /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,
129
+ ];
130
+ export function findPrivateData(value) {
131
+ const text = canonicalize(value);
132
+ return PRIVATE_PATTERNS.filter((p) => p.test(text)).map((p) => p.source);
133
+ }
134
+ export function validateDemoContent(content) {
135
+ const problems = [];
136
+ const known = new Set();
137
+ for (const asset of content.assets) {
138
+ known.add(asset.src);
139
+ if (!asset.alt.trim())
140
+ problems.push(`Asset ${asset.src}: missing alt text`);
141
+ if (!asset.provenance.trim())
142
+ problems.push(`Asset ${asset.src}: missing provenance`);
143
+ if (!DEMO_LICENSES.includes(asset.license ?? '')) {
144
+ problems.push(`Asset ${asset.src}: missing or unknown license`);
145
+ }
146
+ }
147
+ const refs = [];
148
+ const collect = (v) => {
149
+ if (Array.isArray(v))
150
+ v.forEach(collect);
151
+ else if (v && typeof v === 'object' && !(v instanceof Date)) {
152
+ const rec = v;
153
+ if (typeof rec.src === 'string') {
154
+ refs.push(rec.src);
155
+ if (typeof rec.alt !== 'string' || !rec.alt.trim())
156
+ problems.push(`Image ${rec.src}: missing alt text`);
157
+ }
158
+ Object.values(rec).forEach(collect);
159
+ }
160
+ };
161
+ content.items.forEach((item) => collect(item.data));
162
+ for (const ref of refs)
163
+ if (!known.has(ref))
164
+ problems.push(`Image ${ref}: no provenance/license entry`);
165
+ const leaks = findPrivateData({ items: content.items, assets: content.assets.map(({ svg: _svg, ...rest }) => rest) });
166
+ if (leaks.length > 0)
167
+ problems.push(`Private-looking data matched: ${leaks.join(', ')}`);
168
+ if (problems.length > 0)
169
+ throw new Error(`Demo content invalid:\n- ${problems.join('\n- ')}`);
170
+ }
171
+ //# sourceMappingURL=demo-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo-content.js","sourceRoot":"","sources":["../../src/demo/demo-content.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAI1B,MAAM,uBAAuB,CAAC;AAO/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAE7D,MAAM,UAAU,gBAAgB,CAAC,MAAc,kBAAkB;IAC/D,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,EAAE,CAAC,CAAC;IAC1F,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,KA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,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,+BAA+B,CAAC,CAAC;IACxG,MAAM,KAAK,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtH,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,iCAAiC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChG,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './demo-content.js';
2
+ export * from './legal-shells.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './demo-content.js';
2
+ export * from './legal-shells.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,18 @@
1
+ export type DemoLegalKind = 'imprint' | 'privacy';
2
+ export declare const DEMO_DISCLAIMER: {
3
+ readonly en: "SAMPLE CONTENT - INCOMPLETE - REPLACE BEFORE PRODUCTION";
4
+ readonly de: "BEISPIELINHALT - UNVOLLSTAENDIG - VOR PRODUKTIVBETRIEB ERSETZEN";
5
+ };
6
+ export interface DemoLegalShell {
7
+ readonly kind: DemoLegalKind;
8
+ readonly locale: string;
9
+ readonly title: string;
10
+ readonly disclaimer: string;
11
+ readonly sections: readonly {
12
+ readonly heading: string;
13
+ readonly body: string;
14
+ }[];
15
+ }
16
+ export declare function generateDemoLegalShells(locales: readonly string[]): DemoLegalShell[];
17
+ export declare function validateDemoLegalShell(shell: DemoLegalShell): void;
18
+ //# sourceMappingURL=legal-shells.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-shells.d.ts","sourceRoot":"","sources":["../../src/demo/legal-shells.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAElD,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnF;AAeD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,EAAE,CAgBpF;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAKlE"}
@@ -0,0 +1,40 @@
1
+ export const DEMO_DISCLAIMER = {
2
+ en: 'SAMPLE CONTENT - INCOMPLETE - REPLACE BEFORE PRODUCTION',
3
+ de: 'BEISPIELINHALT - UNVOLLSTAENDIG - VOR PRODUKTIVBETRIEB ERSETZEN',
4
+ };
5
+ const SHELLS = {
6
+ en: {
7
+ imprint: { title: 'Imprint (sample)', headings: ['Provider', 'Contact', 'Responsible for content'] },
8
+ privacy: { title: 'Privacy policy (sample)', headings: ['Controller', 'Data processed', 'Your rights', 'Retention'] },
9
+ body: 'Placeholder paragraph. This section is a structural shell only and contains no legal text. Have it written and reviewed by a qualified professional.',
10
+ },
11
+ de: {
12
+ imprint: { title: 'Impressum (Beispiel)', headings: ['Anbieter', 'Kontakt', 'Inhaltlich verantwortlich'] },
13
+ privacy: { title: 'Datenschutzerklaerung (Beispiel)', headings: ['Verantwortliche Stelle', 'Verarbeitete Daten', 'Ihre Rechte', 'Speicherdauer'] },
14
+ body: 'Platzhalterabsatz. Dieser Abschnitt ist nur ein Strukturgeruest und enthaelt keinen Rechtstext. Bitte von einer fachkundigen Person verfassen und pruefen lassen.',
15
+ },
16
+ };
17
+ export function generateDemoLegalShells(locales) {
18
+ const out = [];
19
+ for (const locale of locales) {
20
+ const lang = locale.toLowerCase().startsWith('de') ? 'de' : 'en';
21
+ const catalog = SHELLS[lang];
22
+ for (const kind of ['imprint', 'privacy']) {
23
+ out.push({
24
+ kind,
25
+ locale,
26
+ title: catalog[kind].title,
27
+ disclaimer: DEMO_DISCLAIMER[lang],
28
+ sections: catalog[kind].headings.map((heading) => ({ heading, body: catalog.body })),
29
+ });
30
+ }
31
+ }
32
+ return out;
33
+ }
34
+ export function validateDemoLegalShell(shell) {
35
+ const required = Object.values(DEMO_DISCLAIMER);
36
+ if (!required.includes(shell.disclaimer)) {
37
+ throw new Error(`Legal shell ${shell.kind}/${shell.locale}: missing sample/incomplete disclaimer`);
38
+ }
39
+ }
40
+ //# sourceMappingURL=legal-shells.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-shells.js","sourceRoot":"","sources":["../../src/demo/legal-shells.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,EAAE,EAAE,yDAAyD;IAC7D,EAAE,EAAE,iEAAiE;CAC7D,CAAC;AAUX,MAAM,MAAM,GAAG;IACb,EAAE,EAAE;Q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AAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;aACrF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAqB;IAC1D,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAa,CAAC;IAC5D,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,eAAe,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,wCAAwC,CAAC,CAAC;IACrG,CAAC;AACH,CAAC"}
@@ -0,0 +1,42 @@
1
+ export type LocalizationInterviewLabels = {
2
+ readonly cliUiLocale: string;
3
+ readonly contentLocales: string;
4
+ readonly defaultContentLocale: string;
5
+ readonly localizedLabels: string;
6
+ readonly localizedPaths: string;
7
+ readonly formatMode: string;
8
+ readonly sharedFormatLocale: string;
9
+ readonly perLanguageFormatLocales: string;
10
+ readonly timeZone: string;
11
+ readonly moneyCurrency: string;
12
+ readonly invalidInput: string;
13
+ };
14
+ export declare const localizationInterviewCatalogs: {
15
+ readonly en: {
16
+ readonly cliUiLocale: "Interview language";
17
+ readonly contentLocales: "Site content languages (BCP47)";
18
+ readonly defaultContentLocale: "Default content language";
19
+ readonly localizedLabels: "Translated site labels";
20
+ readonly localizedPaths: "Translated public routes (only differing slugs)";
21
+ readonly formatMode: "Shared or per-language regional formatting";
22
+ readonly sharedFormatLocale: "Shared format locale (for example en-GB)";
23
+ readonly perLanguageFormatLocales: "Format locale for each content language";
24
+ readonly timeZone: "IANA timezone (for example Europe/London)";
25
+ readonly moneyCurrency: "Currency for money content (ISO 4217)";
26
+ readonly invalidInput: "Invalid explicit localization input";
27
+ };
28
+ readonly de: {
29
+ readonly cliUiLocale: "Sprache des Interviews";
30
+ readonly contentLocales: "Inhaltssprachen der Website (BCP47)";
31
+ readonly defaultContentLocale: "Standard-Inhaltssprache";
32
+ readonly localizedLabels: "Übersetzte Website-Beschriftungen";
33
+ readonly localizedPaths: "Übersetzte öffentliche Routen (nur unterschiedliche Slugs)";
34
+ readonly formatMode: "Gemeinsame oder sprachabhängige regionale Formatierung";
35
+ readonly sharedFormatLocale: "Gemeinsames Format-Gebietsschema (zum Beispiel de-AT)";
36
+ readonly perLanguageFormatLocales: "Format-Gebietsschema je Inhaltssprache";
37
+ readonly timeZone: "IANA-Zeitzone (zum Beispiel Europe/Vienna)";
38
+ readonly moneyCurrency: "Währung für Geldinhalte (ISO 4217)";
39
+ readonly invalidInput: "Ungültige explizite Lokalisierungseingabe";
40
+ };
41
+ };
42
+ //# sourceMappingURL=cli-catalogs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-catalogs.d.ts","sourceRoot":"","sources":["../../src/i18n/cli-catalogs.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,2BAA2B,GAAG;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;IACrC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAA;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BqC,CAAA"}
@@ -0,0 +1,29 @@
1
+ export const localizationInterviewCatalogs = {
2
+ en: {
3
+ cliUiLocale: 'Interview language',
4
+ contentLocales: 'Site content languages (BCP47)',
5
+ defaultContentLocale: 'Default content language',
6
+ localizedLabels: 'Translated site labels',
7
+ localizedPaths: 'Translated public routes (only differing slugs)',
8
+ formatMode: 'Shared or per-language regional formatting',
9
+ sharedFormatLocale: 'Shared format locale (for example en-GB)',
10
+ perLanguageFormatLocales: 'Format locale for each content language',
11
+ timeZone: 'IANA timezone (for example Europe/London)',
12
+ moneyCurrency: 'Currency for money content (ISO 4217)',
13
+ invalidInput: 'Invalid explicit localization input',
14
+ },
15
+ de: {
16
+ cliUiLocale: 'Sprache des Interviews',
17
+ contentLocales: 'Inhaltssprachen der Website (BCP47)',
18
+ defaultContentLocale: 'Standard-Inhaltssprache',
19
+ localizedLabels: 'Übersetzte Website-Beschriftungen',
20
+ localizedPaths: 'Übersetzte öffentliche Routen (nur unterschiedliche Slugs)',
21
+ formatMode: 'Gemeinsame oder sprachabhängige regionale Formatierung',
22
+ sharedFormatLocale: 'Gemeinsames Format-Gebietsschema (zum Beispiel de-AT)',
23
+ perLanguageFormatLocales: 'Format-Gebietsschema je Inhaltssprache',
24
+ timeZone: 'IANA-Zeitzone (zum Beispiel Europe/Vienna)',
25
+ moneyCurrency: 'Währung für Geldinhalte (ISO 4217)',
26
+ invalidInput: 'Ungültige explizite Lokalisierungseingabe',
27
+ },
28
+ };
29
+ //# sourceMappingURL=cli-catalogs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-catalogs.js","sourceRoot":"","sources":["../../src/i18n/cli-catalogs.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,6BAA6B,GAAG;IACzC,EAAE,EAAE;QACA,WAAW,EAAE,oBAAoB;QACjC,cAAc,EAAE,gCAAgC;QAChD,oBAAoB,EAAE,0BAA0B;QAChD,eAAe,EAAE,wBAAwB;QACzC,cAAc,EAAE,iDAAiD;QACjE,UAAU,EAAE,4CAA4C;QACxD,kBAAkB,EAAE,0CAA0C;QAC9D,wBAAwB,EAAE,yCAAyC;QACnE,QAAQ,EAAE,2CAA2C;QACrD,aAAa,EAAE,uCAAuC;QACtD,YAAY,EAAE,qCAAqC;KACtD;IACD,EAAE,EAAE;QACA,WAAW,EAAE,wBAAwB;QACrC,cAAc,EAAE,qCAAqC;QACrD,oBAAoB,EAAE,yBAAyB;QAC/C,eAAe,EAAE,mCAAmC;QACpD,cAAc,EAAE,4DAA4D;QAC5E,UAAU,EAAE,wDAAwD;QACpE,kBAAkB,EAAE,uDAAuD;QAC3E,wBAAwB,EAAE,wCAAwC;QAClE,QAAQ,EAAE,4CAA4C;QACtD,aAAa,EAAE,oCAAoC;QACnD,YAAY,EAAE,2CAA2C;KAC5D;CAC0E,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { z } from 'astro/zod';
2
+ import type { ExplicitFormatContext } from './explicit-formatters.js';
3
+ export declare const formatLocalesSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
4
+ mode: z.ZodLiteral<"shared">;
5
+ locale: z.core.$ZodBranded<z.ZodString, "FormatLocale", "out">;
6
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
7
+ mode: z.ZodLiteral<"per-language">;
8
+ locales: z.ZodReadonly<z.ZodRecord<z.ZodString, z.core.$ZodBranded<z.ZodString, "FormatLocale", "out">>>;
9
+ }, z.core.$strict>>], "mode">;
10
+ export type FormatLocales = z.infer<typeof formatLocalesSchema>;
11
+ /** Interview language is not site content; regional presentation is not route identity. */
12
+ export declare const createLocalizationSchema: z.ZodReadonly<z.ZodObject<{
13
+ cliUiLocale: z.ZodEnum<{
14
+ en: "en";
15
+ de: "de";
16
+ }>;
17
+ contentLocales: z.ZodReadonly<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ContentLocale", "out">>>;
18
+ defaultContentLocale: z.core.$ZodBranded<z.ZodString, "ContentLocale", "out">;
19
+ localizedLabels: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>>;
20
+ localizedPaths: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>>;
21
+ formatLocales: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
22
+ mode: z.ZodLiteral<"shared">;
23
+ locale: z.core.$ZodBranded<z.ZodString, "FormatLocale", "out">;
24
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
25
+ mode: z.ZodLiteral<"per-language">;
26
+ locales: z.ZodReadonly<z.ZodRecord<z.ZodString, z.core.$ZodBranded<z.ZodString, "FormatLocale", "out">>>;
27
+ }, z.core.$strict>>], "mode">;
28
+ timeZone: z.core.$ZodBranded<z.ZodString, "IanaTimeZone", "out">;
29
+ }, z.core.$strict>>;
30
+ export type CreateLocalization = z.infer<typeof createLocalizationSchema>;
31
+ export declare function parseCreateLocalization(input: unknown): CreateLocalization;
32
+ export declare class UnselectedContentLocaleError extends RangeError {
33
+ readonly locale: string;
34
+ constructor(locale: string);
35
+ }
36
+ export declare function resolveFormatContext(input: CreateLocalization, contentLocale: string): ExplicitFormatContext;
37
+ //# sourceMappingURL=create-localization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-localization.d.ts","sourceRoot":"","sources":["../../src/i18n/create-localization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAG7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAErE,eAAO,MAAM,mBAAmB;;;;;;6BAG9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,2FAA2F;AAC3F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;mBAwBxB,CAAA;AAEb,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAE1E;AAED,qBAAa,4BAA6B,SAAQ,UAAU;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAItC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,GAAG,qBAAqB,CAe5G"}
@@ -0,0 +1,68 @@
1
+ import { z } from 'astro/zod';
2
+ import { cliUiLocaleSchema, contentLocaleSchema, formatLocaleSchema, ianaTimeZoneSchema } from './locale-inputs.js';
3
+ import { validateLocalizedPaths } from './localized-paths.js';
4
+ export const formatLocalesSchema = z.discriminatedUnion('mode', [
5
+ z.object({ mode: z.literal('shared'), locale: formatLocaleSchema }).strict().readonly(),
6
+ z.object({ mode: z.literal('per-language'), locales: z.record(z.string(), formatLocaleSchema).readonly() }).strict().readonly(),
7
+ ]);
8
+ /** Interview language is not site content; regional presentation is not route identity. */
9
+ export const createLocalizationSchema = z.object({
10
+ cliUiLocale: cliUiLocaleSchema,
11
+ contentLocales: z.array(contentLocaleSchema).min(1).readonly(),
12
+ defaultContentLocale: contentLocaleSchema,
13
+ localizedLabels: z.record(z.string(), z.record(z.string(), z.string()).readonly()).readonly(),
14
+ // Same complete public paths consumed by createI18n and easyWebSeo, not slug fragments.
15
+ localizedPaths: z.array(z.record(z.string(), z.string()).readonly()).readonly(),
16
+ formatLocales: formatLocalesSchema,
17
+ timeZone: ianaTimeZoneSchema,
18
+ }).strict().superRefine((input, ctx) => {
19
+ const add = (path, message) => ctx.addIssue({ code: z.ZodIssueCode.custom, path: [path], message });
20
+ const localeKeys = input.contentLocales.map((locale) => locale.toLowerCase());
21
+ if (new Set(localeKeys).size !== localeKeys.length)
22
+ add('contentLocales', 'Content locales must be unique');
23
+ if (!input.contentLocales.includes(input.defaultContentLocale))
24
+ add('defaultContentLocale', 'Default must be a selected content locale');
25
+ const checkKeys = (path, keys) => {
26
+ if (keys.length !== input.contentLocales.length || keys.some((key) => !input.contentLocales.some((locale) => locale === key))) {
27
+ add(path, 'Declare exactly the selected content locales');
28
+ }
29
+ };
30
+ checkKeys('localizedLabels', Object.keys(input.localizedLabels));
31
+ const labelSets = Object.values(input.localizedLabels).map((labels) => Object.keys(labels).sort().join('\0'));
32
+ if (new Set(labelSets).size > 1)
33
+ add('localizedLabels', 'Translate the same label keys in every content locale');
34
+ for (const problem of validateLocalizedPaths(input.localizedPaths, input.contentLocales))
35
+ add('localizedPaths', problem);
36
+ if (input.formatLocales.mode === 'per-language')
37
+ checkKeys('formatLocales', Object.keys(input.formatLocales.locales));
38
+ }).readonly();
39
+ export function parseCreateLocalization(input) {
40
+ return createLocalizationSchema.parse(input);
41
+ }
42
+ export class UnselectedContentLocaleError extends RangeError {
43
+ locale;
44
+ constructor(locale) {
45
+ super(`Content locale was not selected: ${locale}`);
46
+ this.locale = locale;
47
+ this.name = 'UnselectedContentLocaleError';
48
+ }
49
+ }
50
+ export function resolveFormatContext(input, contentLocale) {
51
+ if (!input.contentLocales.some((locale) => locale === contentLocale))
52
+ throw new UnselectedContentLocaleError(contentLocale);
53
+ switch (input.formatLocales.mode) {
54
+ case 'shared':
55
+ return { locale: input.formatLocales.locale, timeZone: input.timeZone };
56
+ case 'per-language': {
57
+ const locale = input.formatLocales.locales[contentLocale];
58
+ if (locale === undefined)
59
+ throw new UnselectedContentLocaleError(contentLocale);
60
+ return { locale, timeZone: input.timeZone };
61
+ }
62
+ default: {
63
+ const exhaustive = input.formatLocales;
64
+ return exhaustive;
65
+ }
66
+ }
67
+ }
68
+ //# sourceMappingURL=create-localization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-localization.js","sourceRoot":"","sources":["../../src/i18n/create-localization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAC7B,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,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,KAAK,QAAQ;YACT,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAA;QAC3E,KAAK,cAAc,CAAC,CAAC,CAAC;YAClB,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;YACzD,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM,IAAI,4BAA4B,CAAC,aAAa,CAAC,CAAA;YAC/E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAA;QAC/C,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACN,MAAM,UAAU,GAAU,KAAK,CAAC,aAAa,CAAA;YAC7C,OAAO,UAAU,CAAA;QACrB,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'astro/zod';
2
+ import type { CurrencyCode, FormatLocale, IanaTimeZone } from './locale-inputs.js';
3
+ export type ExplicitFormatContext = {
4
+ readonly locale: FormatLocale;
5
+ readonly timeZone: IanaTimeZone;
6
+ };
7
+ /** A civil date is not an instant: never shift it across dates in the site's timezone. */
8
+ export declare const dateOnlySchema: z.core.$ZodBranded<z.ZodString, "DateOnly", "out">;
9
+ export type DateOnly = z.infer<typeof dateOnlySchema>;
10
+ export type DateOnlyFormatOptions = Pick<Intl.DateTimeFormatOptions, 'dateStyle' | 'year' | 'month' | 'day' | 'weekday' | 'era' | 'calendar' | 'numberingSystem'>;
11
+ export type InstantFormatOptions = Omit<Intl.DateTimeFormatOptions, 'timeZone'>;
12
+ export type DecimalFormatOptions = Omit<Intl.NumberFormatOptions, 'style' | 'currency' | 'unit'>;
13
+ export type CurrencyFormatOptions = Omit<Intl.NumberFormatOptions, 'style' | 'currency'>;
14
+ export declare function createExplicitFormatters(context: ExplicitFormatContext): {
15
+ dateOnly: (value: DateOnly, options?: DateOnlyFormatOptions) => string;
16
+ instant: (value: Date | number, options?: InstantFormatOptions) => string;
17
+ number: (value: number, options?: DecimalFormatOptions) => string;
18
+ currency: (value: number, currency: CurrencyCode, options?: CurrencyFormatOptions) => string;
19
+ };
20
+ //# sourceMappingURL=explicit-formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explicit-formatters.d.ts","sourceRoot":"","sources":["../../src/i18n/explicit-formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAElF,MAAM,MAAM,qBAAqB,GAAG;IAChC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAClC,CAAA;AAED,0FAA0F;AAC1F,eAAO,MAAM,cAAc,oDAGqB,CAAA;AAChD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAErD,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAC/D,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,iBAAiB,CAAC,CAAA;AAChG,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAA;AAC/E,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC,CAAA;AAChG,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,UAAU,CAAC,CAAA;AAExF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,qBAAqB;sBAE7C,QAAQ,YAAW,qBAAqB,KAA6B,MAAM;qBAI5E,IAAI,GAAG,MAAM,YAAW,oBAAoB,KAAiD,MAAM;oBAEpG,MAAM,YAAW,oBAAoB,KAAQ,MAAM;sBAGjD,MAAM,YAAY,YAAY,YAAW,qBAAqB,KAAQ,MAAM;EAGrG"}
@@ -0,0 +1,18 @@
1
+ import { z } from 'astro/zod';
2
+ /** A civil date is not an instant: never shift it across dates in the site's timezone. */
3
+ export const dateOnlySchema = z.string().regex(/^\d{4}-\d{2}-\d{2}$/).refine((value) => {
4
+ const date = new Date(`${value}T00:00:00.000Z`);
5
+ return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;
6
+ }, 'Invalid Gregorian date').brand();
7
+ export function createExplicitFormatters(context) {
8
+ return {
9
+ dateOnly: (value, options = { dateStyle: 'medium' }) => new Intl.DateTimeFormat(context.locale, { ...options, timeZone: 'UTC' })
10
+ .format(new Date(`${value}T00:00:00.000Z`)),
11
+ // Date/epoch inputs represent absolute instants; local datetime strings are intentionally excluded.
12
+ instant: (value, options = { dateStyle: 'medium', timeStyle: 'short' }) => new Intl.DateTimeFormat(context.locale, { ...options, timeZone: context.timeZone }).format(value),
13
+ number: (value, options = {}) => new Intl.NumberFormat(context.locale, { ...options, style: 'decimal' }).format(value),
14
+ // Currency is always a required argument, never guessed from locale or timezone.
15
+ currency: (value, currency, options = {}) => new Intl.NumberFormat(context.locale, { ...options, style: 'currency', currency }).format(value),
16
+ };
17
+ }
18
+ //# sourceMappingURL=explicit-formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explicit-formatters.js","sourceRoot":"","sources":["../../src/i18n/explicit-formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAQ7B,0FAA0F;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;IACnF,MAAM,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MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KACvG,CAAA;AACL,CAAC"}
@@ -3,4 +3,8 @@ export * from './formatters.js';
3
3
  export * from './localized-paths.js';
4
4
  export * from './routing.js';
5
5
  export * from './seo.js';
6
+ export * from './locale-inputs.js';
7
+ export * from './create-localization.js';
8
+ export * from './cli-catalogs.js';
9
+ export * from './explicit-formatters.js';
6
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAA;AAC1D,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAA;AAC1D,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA"}
@@ -3,4 +3,8 @@ export * from './formatters.js';
3
3
  export * from './localized-paths.js';
4
4
  export * from './routing.js';
5
5
  export * from './seo.js';
6
+ export * from './locale-inputs.js';
7
+ export * from './create-localization.js';
8
+ export * from './cli-catalogs.js';
9
+ export * from './explicit-formatters.js';
6
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAA;AAC1D,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAA;AAC1D,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { z } from 'astro/zod';
2
+ export declare const cliUiLocaleSchema: z.ZodEnum<{
3
+ en: "en";
4
+ de: "de";
5
+ }>;
6
+ export type CliUiLocale = z.infer<typeof cliUiLocaleSchema>;
7
+ export declare const contentLocaleSchema: z.core.$ZodBranded<z.ZodString, "ContentLocale", "out">;
8
+ export type ContentLocale = z.infer<typeof contentLocaleSchema>;
9
+ export declare const formatLocaleSchema: z.core.$ZodBranded<z.ZodString, "FormatLocale", "out">;
10
+ export type FormatLocale = z.infer<typeof formatLocaleSchema>;
11
+ export declare const ianaTimeZoneSchema: z.core.$ZodBranded<z.ZodString, "IanaTimeZone", "out">;
12
+ export type IanaTimeZone = z.infer<typeof ianaTimeZoneSchema>;
13
+ export declare const currencyCodeSchema: z.core.$ZodBranded<z.ZodString, "CurrencyCode", "out">;
14
+ export type CurrencyCode = z.infer<typeof currencyCodeSchema>;
15
+ export declare const optionalCurrencyCodeSchema: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "CurrencyCode", "out">>;
16
+ /** Only auto-detected interview languages fall back; explicit input uses cliUiLocaleSchema. */
17
+ export declare function resolveDetectedCliUiLocale(detected: string | undefined): CliUiLocale;
18
+ //# sourceMappingURL=locale-inputs.d.ts.map