@modoitaliano/giorgia 0.1.102 → 0.1.103

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 (48) hide show
  1. package/README.md +13 -16
  2. package/dist/cronkite-manifest.d.ts +443 -58
  3. package/dist/cronkite-manifest.js +251 -118
  4. package/dist/cronkite-manifest.json +1047 -133
  5. package/dist/layouts.d.ts +1 -1
  6. package/dist/live-program-page/live-program.css +1 -1
  7. package/dist/manifest-validation.d.ts +2 -2
  8. package/dist/manifest-validation.js +12 -16
  9. package/dist/outlet-config.d.ts +0 -1
  10. package/dist/outlet-config.js +2 -2
  11. package/dist/renderer.browser.js +10 -0
  12. package/dist/renderer.core.js +40 -253
  13. package/dist/schemas/canonical-document.schema.json +38 -14
  14. package/dist/schemas/cronkite-manifest.schema.json +84 -450
  15. package/dist/schemas/social-image-input.schema.json +14 -0
  16. package/dist/search-copy.d.ts +65 -0
  17. package/dist/search-copy.js +65 -0
  18. package/dist/types/canonical-document-schema.generated.d.ts +66 -6
  19. package/dist/types/canonical-document-schema.generated.js +66 -6
  20. package/dist/types/canonical-document.generated.d.ts +18 -0
  21. package/dist/types/cronkite-manifest.generated.d.ts +101 -297
  22. package/package.json +2 -2
  23. package/src/partial-deps.json +40 -42
  24. package/src/styles/compiled.css +1 -1
  25. package/src/templates/partials/blocks/spotify.hbs +1 -1
  26. package/src/templates/partials/blocks/tiktok.hbs +1 -1
  27. package/src/templates/partials/blocks/x.hbs +4 -4
  28. package/src/templates/partials/components/article-main.hbs +1 -1
  29. package/src/templates/partials/components/body-block.hbs +33 -0
  30. package/src/templates/partials/components/breaking-news/live-updates-column.hbs +2 -2
  31. package/src/templates/partials/components/breaking-news.hbs +2 -2
  32. package/src/templates/partials/components/editorial-hero.hbs +2 -2
  33. package/src/templates/partials/components/home/landing.hbs +1 -1
  34. package/src/templates/partials/components/home/main.hbs +4 -1
  35. package/src/templates/partials/components/live-story/main.hbs +4 -12
  36. package/src/templates/partials/components/not-found/main.hbs +6 -6
  37. package/src/templates/partials/components/search/main.hbs +25 -15
  38. package/src/templates/partials/components/snack-meta-image-row.hbs +21 -0
  39. package/src/templates/partials/components/snack-meta-inline.hbs +43 -0
  40. package/src/templates/partials/components/snack-top-story.hbs +1 -0
  41. package/src/templates/partials/components/snack.hbs +3 -61
  42. package/src/templates/partials/components/spotlight-hero-slides.hbs +1 -0
  43. package/src/templates/partials/components/spotlight-hero.hbs +2 -2
  44. package/src/templates/partials/components/standalone-main.hbs +1 -1
  45. package/src/templates/partials/headers/header-main.hbs +2 -2
  46. package/src/templates/partials/shell/doc-start-404.hbs +1 -1
  47. package/src/templates/partials/shell/doc-start-standard.hbs +6 -6
  48. package/src/templates/templates/instagram-image.hbs +0 -2
package/README.md CHANGED
@@ -8,8 +8,8 @@ Server-side renderer and Handlebars template bundle for ModoItaliano pages.
8
8
  - Supports the layouts declared by the packaged Cronkite manifest, including
9
9
  article, homepage, category, search, 404, coming-soon, live-story,
10
10
  link-in-bio, media, and standalone pages
11
- - Ships reusable Handlebars templates, partial dependency metadata, and compiled CSS
12
- - Ships provider-neutral social-image and Remotion short-video renderables
11
+ - Ships declarative Handlebars templates, explicit partial dependencies, and static assets
12
+ - Ships a provider-neutral social-card template for Cronkite rasterization
13
13
  - Preserves the masthead, footer, and radio player across same-language internal navigation
14
14
 
15
15
  ## Installation
@@ -18,32 +18,29 @@ Server-side renderer and Handlebars template bundle for ModoItaliano pages.
18
18
  npm install @modoitaliano/giorgia
19
19
  ```
20
20
 
21
- ## Basic usage
21
+ ## Cronkite usage
22
22
 
23
- ```ts
24
- import { render } from "@modoitaliano/giorgia";
23
+ Cronkite reads `dist/cronkite-manifest.json`, validates the nested
24
+ `templateRendering` contract, and compiles the declared package templates. Page
25
+ publication does not import or execute Giorgia JavaScript.
25
26
 
26
- const html = render(doc);
27
- ```
28
-
29
- `doc` must match the normative canonical schema in
27
+ Each supplied document must match the normative canonical schema in
30
28
  [src/schemas/canonical-document.schema.json](src/schemas/canonical-document.schema.json).
31
- TypeScript declarations are generated from that schema; runtime rendering validates
32
- against the same artifact.
29
+ TypeScript declarations and declarative runtime validation use that same artifact.
33
30
 
34
31
  ## Exports
35
32
 
36
33
  - `@modoitaliano/giorgia` -> renderer entrypoint
37
- - `@modoitaliano/giorgia/cronkite-manifest.json` -> data-only CLS capability manifest
38
- - `@modoitaliano/giorgia/video` -> bundleable Remotion short-video entrypoint
34
+ - `@modoitaliano/giorgia/cronkite-manifest.json` -> data-only declarative template manifest
35
+ - `@modoitaliano/giorgia/video` -> legacy non-CPS Remotion entrypoint
39
36
  - `@modoitaliano/giorgia/schemas/canonical-document.schema.json` -> canonical input contract
40
37
  - `@modoitaliano/giorgia/schemas/feed-renderable-input.schema.json` -> feed publication envelope
41
38
  - `@modoitaliano/giorgia/schemas/search-manifest.schema.json` and
42
39
  `@modoitaliano/giorgia/schemas/search-index.schema.json` -> static-search resource contract
43
40
  - `@modoitaliano/giorgia/partial-deps.json` -> partial-to-layout dependency map
44
41
 
45
- The root module also exports `cronkiteManifest`, `outletConfig`, `version`,
46
- `render`, `fontFiles`, `assetFiles`, and `buildInstagramImageHtml`. See
42
+ The root module retains local renderer exports for Storybook and compatibility,
43
+ but those exports are not part of Cronkite's opt-in path. See
47
44
  [docs/cronkite-compatibility.md](docs/cronkite-compatibility.md) for ownership,
48
45
  validation, search, and asset-rendering details.
49
46
 
@@ -54,7 +51,7 @@ npm install
54
51
  npm run typecheck
55
52
  npm run test:unit
56
53
  npm run build
57
- npm run verify:packed-remotion
54
+ npm run verify:packed-contract
58
55
  npm run storybook
59
56
  ```
60
57
 
@@ -1,70 +1,455 @@
1
+ import type { SystemVariant } from './types/cronkite-manifest.generated.js';
1
2
  export declare const cronkiteManifest: {
2
- readonly contract: "cronkite.cls";
3
- readonly contractVersion: 1;
4
3
  readonly package: "@modoitaliano/giorgia";
5
4
  readonly version: string;
6
- readonly layouts: ["article-page" | "homepage" | "category-page" | "search-page" | "404" | "coming-soon" | "live-story" | "link-in-bio" | "media-page" | "standalone-page", ...("article-page" | "homepage" | "category-page" | "search-page" | "404" | "coming-soon" | "live-story" | "link-in-bio" | "media-page" | "standalone-page")[]];
7
- readonly languages: ["es", "en", "it"];
8
- readonly collections: {
9
- readonly "article-page": "json/articles";
10
- readonly "standalone-page": "json/pages";
11
- };
12
- readonly systemPages: import("./types/cronkite-manifest.generated.js").SystemPage[];
13
- readonly renderables: {
14
- readonly homepage: {
15
- readonly engine: "handlebars";
16
- readonly export: "render";
17
- readonly contentType: "text/html; charset=utf-8";
18
- readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
5
+ readonly templateRendering: {
6
+ readonly contract: "cronkite.templates";
7
+ readonly contractVersion: 1;
8
+ readonly partials: {
9
+ readonly 'shell/doc-start-standard': {
10
+ entry: string;
11
+ partials: string[];
12
+ };
13
+ readonly 'shell/doc-start-404': {
14
+ entry: string;
15
+ partials: string[];
16
+ };
17
+ readonly 'headers/header-main': {
18
+ entry: string;
19
+ partials: string[];
20
+ };
21
+ readonly 'footers/footer-full': {
22
+ entry: string;
23
+ partials: string[];
24
+ };
25
+ readonly 'shell/doc-end': {
26
+ entry: string;
27
+ partials: string[];
28
+ };
29
+ readonly 'components/stream-player': {
30
+ entry: string;
31
+ partials: string[];
32
+ };
33
+ readonly 'components/article-main': {
34
+ entry: string;
35
+ partials: string[];
36
+ };
37
+ readonly 'components/body-block': {
38
+ entry: string;
39
+ partials: string[];
40
+ };
41
+ readonly 'blocks/audio': {
42
+ entry: string;
43
+ partials: string[];
44
+ };
45
+ readonly 'blocks/data-table': {
46
+ entry: string;
47
+ partials: string[];
48
+ };
49
+ readonly 'blocks/divider': {
50
+ entry: string;
51
+ partials: string[];
52
+ };
53
+ readonly 'blocks/heading': {
54
+ entry: string;
55
+ partials: string[];
56
+ };
57
+ readonly 'blocks/image': {
58
+ entry: string;
59
+ partials: string[];
60
+ };
61
+ readonly 'blocks/info-box': {
62
+ entry: string;
63
+ partials: string[];
64
+ };
65
+ readonly 'blocks/instagram': {
66
+ entry: string;
67
+ partials: string[];
68
+ };
69
+ readonly 'blocks/key-points': {
70
+ entry: string;
71
+ partials: string[];
72
+ };
73
+ readonly 'blocks/list': {
74
+ entry: string;
75
+ partials: string[];
76
+ };
77
+ readonly 'blocks/live-update': {
78
+ entry: string;
79
+ partials: string[];
80
+ };
81
+ readonly 'blocks/pull-quote': {
82
+ entry: string;
83
+ partials: string[];
84
+ };
85
+ readonly 'blocks/rich-text': {
86
+ entry: string;
87
+ partials: string[];
88
+ };
89
+ readonly 'blocks/spotify': {
90
+ entry: string;
91
+ partials: string[];
92
+ };
93
+ readonly 'blocks/tiktok': {
94
+ entry: string;
95
+ partials: string[];
96
+ };
97
+ readonly 'blocks/x': {
98
+ entry: string;
99
+ partials: string[];
100
+ };
101
+ readonly 'blocks/youtube': {
102
+ entry: string;
103
+ partials: string[];
104
+ };
105
+ readonly 'components/snack': {
106
+ entry: string;
107
+ partials: string[];
108
+ };
109
+ readonly 'components/snack-top-story': {
110
+ entry: string;
111
+ partials: string[];
112
+ };
113
+ readonly 'components/snack-meta-image-row': {
114
+ entry: string;
115
+ partials: string[];
116
+ };
117
+ readonly 'components/snack-meta-inline': {
118
+ entry: string;
119
+ partials: string[];
120
+ };
121
+ readonly 'components/category/main': {
122
+ entry: string;
123
+ partials: string[];
124
+ };
125
+ readonly 'components/category/header': {
126
+ entry: string;
127
+ partials: string[];
128
+ };
129
+ readonly 'components/category/main-grid': {
130
+ entry: string;
131
+ partials: string[];
132
+ };
133
+ readonly 'components/category/more-grid': {
134
+ entry: string;
135
+ partials: string[];
136
+ };
137
+ readonly 'components/search/main': {
138
+ entry: string;
139
+ partials: string[];
140
+ };
141
+ readonly 'components/not-found/main': {
142
+ entry: string;
143
+ partials: string[];
144
+ };
145
+ readonly 'components/coming-soon/main': {
146
+ entry: string;
147
+ partials: string[];
148
+ };
149
+ readonly 'components/home/main': {
150
+ entry: string;
151
+ partials: string[];
152
+ };
153
+ readonly 'components/spotlight-hero': {
154
+ entry: string;
155
+ partials: string[];
156
+ };
157
+ readonly 'components/spotlight-hero-slides': {
158
+ entry: string;
159
+ partials: string[];
160
+ };
161
+ readonly 'components/headline': {
162
+ entry: string;
163
+ partials: string[];
164
+ };
165
+ readonly 'components/editorial-hero': {
166
+ entry: string;
167
+ partials: string[];
168
+ };
169
+ readonly 'components/breaking-news': {
170
+ entry: string;
171
+ partials: string[];
172
+ };
173
+ readonly 'components/breaking-news/live-updates-column': {
174
+ entry: string;
175
+ partials: string[];
176
+ };
177
+ readonly 'components/home/landing': {
178
+ entry: string;
179
+ partials: string[];
180
+ };
181
+ readonly 'components/home/must-read': {
182
+ entry: string;
183
+ partials: string[];
184
+ };
185
+ readonly 'components/home/more-stories': {
186
+ entry: string;
187
+ partials: string[];
188
+ };
189
+ readonly 'components/live-story/main': {
190
+ entry: string;
191
+ partials: string[];
192
+ };
193
+ readonly 'components/ui/status-badge': {
194
+ entry: string;
195
+ partials: string[];
196
+ };
197
+ readonly 'components/media/main': {
198
+ entry: string;
199
+ partials: string[];
200
+ };
201
+ readonly 'components/standalone-main': {
202
+ entry: string;
203
+ partials: string[];
204
+ };
19
205
  };
20
- readonly "category-page": {
21
- readonly engine: "handlebars";
22
- readonly export: "render";
23
- readonly contentType: "text/html; charset=utf-8";
24
- readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
206
+ readonly helperConfig: {
207
+ readonly siteName: "ModoItaliano";
208
+ readonly defaultLanguage: "es";
209
+ readonly supportedLanguages: ["es", "en", "it"];
210
+ readonly prefixDefaultLocale: false;
211
+ readonly dateLocale: "es-ES";
212
+ readonly timeZone: "America/New_York";
213
+ readonly homepageTitles: {
214
+ readonly es: "ModoItaliano";
215
+ readonly en: "ModoItaliano";
216
+ readonly it: "ModoItaliano";
217
+ };
218
+ readonly layoutTitleFallbacks: {
219
+ readonly 'article-page': "Artículo";
220
+ readonly homepage: "ModoItaliano";
221
+ readonly 'category-page': "Categoría";
222
+ readonly 'search-page': "Buscar";
223
+ readonly '404': "Página no encontrada";
224
+ readonly 'coming-soon': "Próximamente";
225
+ readonly 'live-story': "Cobertura en vivo";
226
+ readonly 'link-in-bio': "Noticias destacadas";
227
+ readonly 'media-page': "Medios";
228
+ readonly 'standalone-page': "ModoItaliano";
229
+ };
230
+ readonly titleSeparator: " | ";
231
+ readonly defaultSocialImageUrl: "https://cdn.modoitaliano.fm/assets/default-og.jpg";
25
232
  };
26
- readonly "search-page": {
27
- readonly engine: "handlebars";
28
- readonly export: "render";
29
- readonly outputMode: "single";
30
- readonly lifecycle: "request";
31
- readonly contentType: "text/html; charset=utf-8";
32
- readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
33
- readonly resources: {
34
- readonly "search-manifest": {
35
- readonly key: "search-manifest-{language}.json";
36
- readonly schema: "dist/schemas/search-manifest.schema.json";
37
- readonly contentType: "application/json";
38
- readonly perLanguage: true;
233
+ readonly embedRegistry: {
234
+ readonly 'x-status': {
235
+ readonly urlTemplate: "https://twitter.com/{username}/status/{id}";
236
+ readonly parameters: {
237
+ readonly username: {
238
+ readonly type: "string";
239
+ readonly pattern: "^[A-Za-z0-9_]{1,15}$";
240
+ };
241
+ readonly id: {
242
+ readonly type: "string";
243
+ readonly pattern: "^[0-9]+$";
244
+ };
245
+ };
246
+ };
247
+ readonly 'x-embed': {
248
+ readonly urlTemplate: "https://platform.twitter.com/embed/Tweet.html?id={id}&dnt=true";
249
+ readonly parameters: {
250
+ readonly id: {
251
+ readonly type: "string";
252
+ readonly pattern: "^[0-9]+$";
253
+ };
254
+ };
255
+ };
256
+ readonly instagram: {
257
+ readonly urlTemplate: "https://www.instagram.com/p/{shortcode}/embed/";
258
+ readonly parameters: {
259
+ readonly shortcode: {
260
+ readonly type: "string";
261
+ readonly pattern: "^[A-Za-z0-9_-]+$";
262
+ };
263
+ };
264
+ };
265
+ readonly tiktok: {
266
+ readonly urlTemplate: "https://www.tiktok.com/embed/v2/{id}";
267
+ readonly parameters: {
268
+ readonly id: {
269
+ readonly type: "string";
270
+ readonly pattern: "^[0-9]+$";
271
+ };
272
+ };
273
+ };
274
+ readonly spotify: {
275
+ readonly urlTemplate: "https://open.spotify.com/embed/{kind}/{id}";
276
+ readonly parameters: {
277
+ readonly kind: {
278
+ readonly type: "string";
279
+ readonly enum: ["track", "album", "playlist", "episode", "show"];
280
+ };
281
+ readonly id: {
282
+ readonly type: "string";
283
+ readonly pattern: "^[A-Za-z0-9]+$";
284
+ };
285
+ };
286
+ };
287
+ readonly 'sofascore-widget': {
288
+ readonly urlTemplate: "https://widgets.sofascore.com/embed/attackMomentum?id={id}&widgetTheme={widgetTheme}";
289
+ readonly parameters: {
290
+ readonly id: {
291
+ readonly type: "integer";
292
+ readonly minimum: 1;
293
+ };
294
+ readonly widgetTheme: {
295
+ readonly type: "string";
296
+ readonly enum: ["light", "dark"];
297
+ readonly default: "light";
298
+ };
299
+ };
300
+ };
301
+ readonly 'sofascore-match': {
302
+ readonly urlTemplate: "https://www.sofascore.com/football/match#id:{id}";
303
+ readonly parameters: {
304
+ readonly id: {
305
+ readonly type: "integer";
306
+ readonly minimum: 1;
307
+ };
39
308
  };
40
309
  };
41
310
  };
42
- readonly "link-in-bio": {
43
- readonly engine: "handlebars";
44
- readonly export: "render";
45
- readonly contentType: "text/html; charset=utf-8";
46
- readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
47
- };
48
- readonly "social-image": {
49
- readonly engine: "html-raster";
50
- readonly export: "buildInstagramImageHtml";
51
- readonly contentType: "image/jpeg";
52
- readonly width: 1080;
53
- readonly height: 1350;
54
- };
55
- readonly "short-video": {
56
- readonly engine: "remotion";
57
- readonly entry: "dist/video/index.js";
58
- readonly compositionId: "ModoItalianoShort";
59
- readonly contentType: "video/mp4";
60
- };
61
- };
62
- readonly capabilities: {
63
- readonly fonts: {
64
- readonly export: "fontFiles";
311
+ readonly renderables: {
312
+ readonly 'article-page': {
313
+ template: {
314
+ entry: string;
315
+ partials: string[];
316
+ };
317
+ inputSchema: string;
318
+ contentType: string;
319
+ };
320
+ readonly homepage: {
321
+ template: {
322
+ entry: string;
323
+ partials: string[];
324
+ };
325
+ inputSchema: string;
326
+ contentType: string;
327
+ };
328
+ readonly 'category-page': {
329
+ template: {
330
+ entry: string;
331
+ partials: string[];
332
+ };
333
+ inputSchema: string;
334
+ contentType: string;
335
+ };
336
+ readonly 'search-page': {
337
+ template: {
338
+ entry: string;
339
+ partials: string[];
340
+ };
341
+ inputSchema: string;
342
+ contentType: string;
343
+ };
344
+ readonly '404': {
345
+ template: {
346
+ entry: string;
347
+ partials: string[];
348
+ };
349
+ inputSchema: string;
350
+ contentType: string;
351
+ };
352
+ readonly 'coming-soon': {
353
+ template: {
354
+ entry: string;
355
+ partials: string[];
356
+ };
357
+ inputSchema: string;
358
+ contentType: string;
359
+ };
360
+ readonly 'live-story': {
361
+ template: {
362
+ entry: string;
363
+ partials: string[];
364
+ };
365
+ inputSchema: string;
366
+ contentType: string;
367
+ };
368
+ readonly 'link-in-bio': {
369
+ template: {
370
+ entry: string;
371
+ partials: string[];
372
+ };
373
+ inputSchema: string;
374
+ contentType: string;
375
+ };
376
+ readonly 'media-page': {
377
+ template: {
378
+ entry: string;
379
+ partials: string[];
380
+ };
381
+ inputSchema: string;
382
+ contentType: string;
383
+ };
384
+ readonly 'standalone-page': {
385
+ template: {
386
+ entry: string;
387
+ partials: string[];
388
+ };
389
+ inputSchema: string;
390
+ contentType: string;
391
+ };
392
+ readonly 'social-image': {
393
+ readonly template: {
394
+ readonly entry: "src/templates/templates/instagram-image.hbs";
395
+ readonly partials: [];
396
+ };
397
+ readonly inputSchema: "dist/schemas/social-image-input.schema.json";
398
+ readonly contentType: "image/jpeg";
399
+ readonly raster: {
400
+ readonly format: "jpeg";
401
+ readonly width: 1080;
402
+ readonly height: 1350;
403
+ };
404
+ };
65
405
  };
66
- readonly assets: {
67
- readonly export: "assetFiles";
406
+ readonly staticAssets: {
407
+ readonly 'content/fonts/fonts.css': {
408
+ readonly source: "dist/fonts/fonts.css";
409
+ readonly contentType: "text/css; charset=utf-8";
410
+ readonly cacheControl: "public, max-age=31536000, immutable";
411
+ };
412
+ readonly 'content/styles/giorgia.css': {
413
+ readonly source: "src/styles/compiled.css";
414
+ readonly contentType: "text/css; charset=utf-8";
415
+ readonly cacheControl: "public, max-age=31536000, immutable";
416
+ };
417
+ readonly 'assets/default-og.jpg': {
418
+ readonly source: "dist/assets/default-og.jpg";
419
+ readonly contentType: "image/jpeg";
420
+ readonly cacheControl: "public, max-age=31536000, immutable";
421
+ };
422
+ readonly 'assets/default-og.png': {
423
+ readonly source: "dist/assets/default-og.png";
424
+ readonly contentType: "image/png";
425
+ readonly cacheControl: "public, max-age=31536000, immutable";
426
+ };
427
+ readonly 'assets/giorgia-navigation.js': {
428
+ readonly source: "dist/assets/giorgia-navigation.js";
429
+ readonly contentType: "text/javascript; charset=utf-8";
430
+ readonly cacheControl: "public, max-age=31536000, immutable";
431
+ };
432
+ readonly 'assets/mi.svg': {
433
+ readonly source: "dist/assets/mi.svg";
434
+ readonly contentType: "image/svg+xml";
435
+ readonly cacheControl: "public, max-age=31536000, immutable";
436
+ };
68
437
  };
438
+ readonly systemPages: [{
439
+ readonly renderable: "404";
440
+ readonly contentType: "text/html; charset=utf-8";
441
+ readonly cacheControl: "public, max-age=0, must-revalidate";
442
+ readonly variants: [SystemVariant, ...SystemVariant[]];
443
+ }, {
444
+ readonly renderable: "search-page";
445
+ readonly contentType: "text/html; charset=utf-8";
446
+ readonly cacheControl: "public, max-age=0, must-revalidate";
447
+ readonly variants: [SystemVariant, ...SystemVariant[]];
448
+ }, {
449
+ readonly renderable: "coming-soon";
450
+ readonly contentType: "text/html; charset=utf-8";
451
+ readonly cacheControl: "public, max-age=0, must-revalidate";
452
+ readonly variants: [SystemVariant, ...SystemVariant[]];
453
+ }];
69
454
  };
70
455
  };