@fifthbell/brokaw 0.1.68 → 0.1.69

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 (55) hide show
  1. package/README.md +1 -1
  2. package/dist/cronkite-manifest.d.ts +205 -69
  3. package/dist/cronkite-manifest.js +288 -111
  4. package/dist/cronkite-manifest.json +1024 -125
  5. package/dist/instagram-image-template.d.ts +0 -1
  6. package/dist/instagram-image-template.js +0 -4
  7. package/dist/layouts.d.ts +1 -1
  8. package/dist/live-program-page/index.html +2 -2
  9. package/dist/live-program-page/live-program-manifest.json +6 -6
  10. package/dist/live-program-page/live-program.v0.1.69.css +3 -0
  11. package/dist/manifest-validation.d.ts +2 -2
  12. package/dist/manifest-validation.js +12 -16
  13. package/dist/outlet-config.d.ts +0 -1
  14. package/dist/outlet-config.js +0 -1
  15. package/dist/renderer.browser.js +12 -0
  16. package/dist/renderer.core.js +42 -258
  17. package/dist/renderer.d.ts +1 -1
  18. package/dist/renderer.js +1 -1
  19. package/dist/schemas/canonical-document.schema.json +30 -10
  20. package/dist/schemas/cronkite-manifest.schema.json +84 -450
  21. package/dist/schemas/social-image-input.schema.json +14 -0
  22. package/dist/search-copy.d.ts +65 -0
  23. package/dist/search-copy.js +65 -0
  24. package/dist/types/canonical-document-schema.generated.d.ts +48 -4
  25. package/dist/types/canonical-document-schema.generated.js +48 -4
  26. package/dist/types/canonical-document.generated.d.ts +14 -0
  27. package/dist/types/cronkite-manifest.generated.d.ts +101 -297
  28. package/package.json +2 -2
  29. package/src/partial-deps.json +221 -50
  30. package/src/styles/compiled.css +1 -1
  31. package/src/templates/partials/blocks/tiktok.hbs +1 -1
  32. package/src/templates/partials/blocks/x.hbs +4 -4
  33. package/src/templates/partials/components/article-main.hbs +1 -1
  34. package/src/templates/partials/components/body-block.hbs +31 -0
  35. package/src/templates/partials/components/breaking-news/live-updates-column.hbs +2 -2
  36. package/src/templates/partials/components/breaking-news.hbs +2 -2
  37. package/src/templates/partials/components/editorial-hero.hbs +2 -2
  38. package/src/templates/partials/components/home/landing.hbs +1 -1
  39. package/src/templates/partials/components/home/main.hbs +4 -1
  40. package/src/templates/partials/components/live-story/main.hbs +4 -12
  41. package/src/templates/partials/components/not-found/main.hbs +4 -4
  42. package/src/templates/partials/components/search/main.hbs +25 -15
  43. package/src/templates/partials/components/snack-meta-image-row.hbs +21 -0
  44. package/src/templates/partials/components/snack-meta-inline.hbs +43 -0
  45. package/src/templates/partials/components/snack-top-story.hbs +1 -0
  46. package/src/templates/partials/components/snack.hbs +3 -61
  47. package/src/templates/partials/components/spotlight-hero-slides.hbs +1 -0
  48. package/src/templates/partials/components/spotlight-hero.hbs +2 -2
  49. package/src/templates/partials/components/standalone-main.hbs +1 -1
  50. package/src/templates/partials/shell/doc-start-404.hbs +2 -4
  51. package/src/templates/partials/shell/doc-start-standard.hbs +9 -11
  52. package/src/templates/partials/shell/rum-loader.hbs +77 -0
  53. package/src/templates/templates/instagram-image.hbs +0 -2
  54. package/dist/live-program-page/live-program.v0.1.68.css +0 -3
  55. /package/dist/live-program-page/{live-program.v0.1.68.js → live-program.v0.1.69.js} +0 -0
@@ -1,339 +1,143 @@
1
1
  /** Generated from the normative JSON Schema. Do not edit by hand. */
2
2
  /**
3
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
4
- * via the `definition` "name".
3
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
4
+ * via the `definition` "safePath".
5
5
  */
6
- export type Name = string;
7
- /**
8
- * Permissive lexical envelope including grandfathered and private-use tags; a standards-compliant BCP 47 parser is authoritative.
9
- *
10
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
11
- * via the `definition` "languageTag".
12
- */
13
- export type LanguageTag = string;
14
- /**
15
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
16
- * via the `definition` "safePrefix".
17
- */
18
- export type SafePrefix = string;
6
+ export type SafePath = string;
7
+ export interface CronkiteDeclarativeTemplateManifest {
8
+ package: string;
9
+ version: string;
10
+ templateRendering: TemplateRendering;
11
+ }
19
12
  /**
20
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
21
- * via the `definition` "systemPage".
13
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
14
+ * via the `definition` "templateRendering".
22
15
  */
23
- export type SystemPage = {
24
- /**
25
- * Required layout that must occur in the top-level layouts array. No omission default.
26
- */
27
- layout: string;
28
- /**
29
- * Required public route, optionally with one {language} token. No omission default.
30
- */
31
- route: string;
32
- /**
33
- * Required safe relative object key, optionally with one {language} token. No omission default.
34
- */
35
- key: string;
36
- /**
37
- * Required Cache-Control field value. No omission default.
38
- */
39
- cacheControl: string;
40
- /**
41
- * Required switch controlling language expansion. No omission default.
42
- */
43
- perLanguage: boolean;
44
- /**
45
- * Required language-to-copy map. No omission default.
46
- */
47
- copy: {
48
- [k: string]: Copy;
16
+ export interface TemplateRendering {
17
+ contract: "cronkite.templates";
18
+ contractVersion: 1;
19
+ partials: {
20
+ [k: string]: TemplateReference;
49
21
  };
50
- };
51
- /**
52
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
53
- * via the `definition` "renderable".
54
- */
55
- export type Renderable = ({
56
- engine?: "handlebars";
57
- outputMode?: "single";
58
- contentType: string;
59
- export: unknown;
60
- entry?: never;
61
- compositionId?: never;
62
- width?: never;
63
- height?: never;
64
- [k: string]: unknown;
65
- } | {
66
- engine?: "handlebars";
67
- outputMode: "files";
68
- export: unknown;
69
- entry?: never;
70
- compositionId?: never;
71
- contentType?: never;
72
- width?: never;
73
- height?: never;
74
- key?: never;
75
- [k: string]: unknown;
76
- } | {
77
- engine?: "html-raster";
78
- outputMode?: "single";
79
- contentType: string;
80
- export: unknown;
81
- width: unknown;
82
- height: unknown;
83
- entry?: never;
84
- compositionId?: never;
85
- [k: string]: unknown;
86
- } | {
87
- engine?: "remotion";
88
- outputMode?: "single";
89
- contentType: string;
90
- entry: unknown;
91
- compositionId: unknown;
92
- export?: never;
93
- width?: never;
94
- height?: never;
95
- [k: string]: unknown;
96
- }) & {
97
- /**
98
- * Required bounded CPS rendering engine. No omission default.
99
- */
100
- engine: "handlebars" | "html-raster" | "remotion";
101
- /**
102
- * Function export required by handlebars and html-raster. No omission default.
103
- */
104
- export?: string;
105
- /**
106
- * Packed package entry required by remotion. No omission default.
107
- */
108
- entry?: string;
109
- /**
110
- * Composition selector required by remotion. No omission default.
111
- */
112
- compositionId?: string;
113
- /**
114
- * Optional result mode; files uses the FileEntry array ABI.
115
- */
116
- outputMode?: "single" | "files";
117
- /**
118
- * Optional request-derived or CLS-version-derived lifecycle.
119
- */
120
- lifecycle?: "request" | "basement";
121
- /**
122
- * Media type required for a single output and forbidden for a file set.
123
- */
124
- contentType?: string;
125
- /**
126
- * Positive pixel width required by html-raster.
127
- */
128
- width?: number;
129
- /**
130
- * Positive pixel height required by html-raster.
131
- */
132
- height?: number;
133
- /**
134
- * Output key required only for a basement single output.
135
- */
136
- key?: string;
137
- /**
138
- * Optional packed draft-2020-12 input-schema path.
139
- */
140
- inputSchema?: string;
141
- resources?: Resources;
142
- contract?: OpaqueContract;
143
- };
144
- /**
145
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
146
- * via the `definition` "resource".
147
- */
148
- export type Resource = {
149
- /**
150
- * Required CMS-owned resource key, optionally with one {language} token.
151
- */
152
- key: string;
153
- /**
154
- * Required packed draft-2020-12 JSON Schema path.
155
- */
156
- schema: string;
157
- /**
158
- * Required resource media type.
159
- */
160
- contentType: string;
161
- /**
162
- * Optional language-expansion switch.
163
- */
164
- perLanguage?: boolean;
165
- };
166
- /**
167
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
168
- * via the `definition` "safeKey".
169
- */
170
- export type SafeKey = string;
171
- /**
172
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
173
- * via the `definition` "javascriptIdentifier".
174
- */
175
- export type JavascriptIdentifier = string;
176
- /**
177
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
178
- * via the `definition` "safeKeyWithLanguage".
179
- */
180
- export type SafeKeyWithLanguage = string;
181
- /**
182
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
183
- * via the `definition` "siteRouteWithLanguage".
184
- */
185
- export type SiteRouteWithLanguage = string;
186
- /**
187
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
188
- * via the `definition` "packageEntry".
189
- */
190
- export type PackageEntry = string;
22
+ helperConfig: HelperConfig;
23
+ embedRegistry: {
24
+ [k: string]: Embed;
25
+ };
26
+ renderables: {
27
+ [k: string]: Renderable;
28
+ };
29
+ staticAssets: {
30
+ [k: string]: StaticAsset;
31
+ };
32
+ systemPages: SystemPage[];
33
+ }
191
34
  /**
192
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
193
- * via the `definition` "mediaType".
35
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
36
+ * via the `definition` "templateReference".
37
+ *
38
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
39
+ * via the `definition` "partial".
194
40
  */
195
- export type MediaType = string;
41
+ export interface TemplateReference {
42
+ entry: SafePath;
43
+ partials: string[];
44
+ }
196
45
  /**
197
- * Machine-readable structural contract for a Cronkite-compatible Component Library System manifest. Semantic cross-field and package checks are specified in ../validation.md.
46
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
47
+ * via the `definition` "helperConfig".
198
48
  */
199
- export interface CronkiteCLSManifest {
200
- /**
201
- * Required contract discriminator. No omission default.
202
- */
203
- contract: "cronkite.cls";
49
+ export interface HelperConfig {
50
+ siteName: string;
51
+ defaultLanguage: string;
204
52
  /**
205
- * Required manifest contract version. No omission default.
206
- */
207
- contractVersion: 1;
208
- /**
209
- * Required npm package name without a version. No omission default.
210
- */
211
- package: string;
212
- /**
213
- * Required exact SemVer package version. No omission default.
214
- */
215
- version: string;
216
- /**
217
- * Required authoritative set of page layouts. No omission default.
218
- *
219
- * @minItems 1
220
- */
221
- layouts: [Name, ...Name[]];
222
- /**
223
- * Required supported BCP 47 language tags. No omission default.
224
- *
225
53
  * @minItems 1
226
54
  */
227
- languages: [LanguageTag, ...LanguageTag[]];
228
- /**
229
- * Optional layout-to-canonical-JSON-prefix map. Supplying the object replaces the whole default map.
230
- */
231
- collections?: {
232
- [k: string]: SafePrefix;
233
- };
234
- routing?: Routing;
235
- /**
236
- * Optional system-generated pages. Expanded route/key uniqueness is a semantic validation rule.
237
- */
238
- systemPages?: SystemPage[];
239
- /**
240
- * Optional explicit page or asset renderables in the same namespace as layouts.
241
- */
242
- renderables?: {
243
- [k: string]: Renderable;
244
- };
245
- /**
246
- * Optional package file capabilities recognized by contract version 1.
247
- */
248
- capabilities?: {
249
- fonts?: Capability;
250
- assets?: Capability;
55
+ supportedLanguages: [string, ...string[]];
56
+ prefixDefaultLocale: boolean;
57
+ dateLocale: string;
58
+ timeZone: string;
59
+ homepageTitles: {
60
+ [k: string]: string;
251
61
  };
252
- /**
253
- * Optional operation-local final-write declarations.
254
- */
255
- writeOrdering?: {
256
- [k: string]: WriteOrderingRule;
62
+ layoutTitleFallbacks: {
63
+ [k: string]: string;
257
64
  };
65
+ titleSeparator: string;
66
+ defaultSocialImageUrl: string | null;
258
67
  }
259
68
  /**
260
- * Optional HTML object-key derivation rules.
69
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
70
+ * via the `definition` "embed".
261
71
  */
262
- export interface Routing {
263
- /**
264
- * Optional safe relative template containing {path} exactly once.
265
- */
266
- htmlKeyTemplate?: string;
267
- /**
268
- * Optional safe relative root-route object key.
269
- */
270
- rootKey?: string;
72
+ export interface Embed {
73
+ urlTemplate: string;
74
+ parameters: {
75
+ [k: string]: EmbedParameter;
76
+ };
271
77
  }
272
78
  /**
273
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
274
- * via the `definition` "copy".
79
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
80
+ * via the `definition` "embedParameter".
275
81
  */
276
- export interface Copy {
277
- /**
278
- * Required non-empty fictional or outlet-owned page title. No omission default.
279
- */
280
- title: string;
82
+ export interface EmbedParameter {
83
+ type: "string" | "integer";
84
+ pattern?: string;
281
85
  /**
282
- * Required non-empty fictional or outlet-owned page description. No omission default.
86
+ * @minItems 1
283
87
  */
284
- description: string;
88
+ enum?: [unknown, ...unknown[]];
89
+ default?: string | number;
90
+ minimum?: number;
91
+ maximum?: number;
285
92
  }
286
93
  /**
287
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
288
- * via the `definition` "resources".
94
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
95
+ * via the `definition` "renderable".
289
96
  */
290
- export interface Resources {
291
- [k: string]: Resource;
97
+ export interface Renderable {
98
+ template: TemplateReference;
99
+ inputSchema: SafePath;
100
+ contentType: string;
101
+ raster?: Raster;
292
102
  }
293
103
  /**
294
- * Producer-owned contract metadata. The CPS validates kind/version and treats every other member as opaque.
295
- *
296
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
297
- * via the `definition` "opaqueContract".
104
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
105
+ * via the `definition` "raster".
298
106
  */
299
- export interface OpaqueContract {
300
- kind: string;
301
- version: number;
302
- [k: string]: unknown;
107
+ export interface Raster {
108
+ format: "png" | "jpeg" | "webp";
109
+ width: number;
110
+ height: number;
303
111
  }
304
112
  /**
305
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
306
- * via the `definition` "capability".
113
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
114
+ * via the `definition` "staticAsset".
307
115
  */
308
- export interface Capability {
309
- /**
310
- * Required function export. No omission default.
311
- */
312
- export: string;
116
+ export interface StaticAsset {
117
+ source: SafePath;
118
+ contentType: string;
119
+ cacheControl: string;
313
120
  }
314
121
  /**
315
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
316
- * via the `definition` "writeOrderingRule".
122
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
123
+ * via the `definition` "systemPage".
317
124
  */
318
- export interface WriteOrderingRule {
125
+ export interface SystemPage {
126
+ renderable: string;
127
+ contentType: string;
128
+ cacheControl: string;
319
129
  /**
320
- * Required ordered final-write keys. No omission default.
321
- *
322
130
  * @minItems 1
323
131
  */
324
- last: [SafeKey, ...SafeKey[]];
132
+ variants: [SystemVariant, ...SystemVariant[]];
325
133
  }
326
134
  /**
327
- * This interface was referenced by `CronkiteCLSManifest`'s JSON-Schema
328
- * via the `definition` "routing".
135
+ * This interface was referenced by `CronkiteDeclarativeTemplateManifest`'s JSON-Schema
136
+ * via the `definition` "systemVariant".
329
137
  */
330
- export interface Routing1 {
331
- /**
332
- * Optional safe relative template containing {path} exactly once.
333
- */
334
- htmlKeyTemplate?: string;
335
- /**
336
- * Optional safe relative root-route object key.
337
- */
338
- rootKey?: string;
138
+ export interface SystemVariant {
139
+ key: SafePath;
140
+ document: {
141
+ [k: string]: unknown;
142
+ };
339
143
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fifthbell/brokaw",
3
3
  "description": "Server-side Handlebars renderer and templates for fifthbell pages.",
4
- "version": "0.1.68",
4
+ "version": "0.1.69",
5
5
  "license": "MIT",
6
6
  "author": "fifthbell",
7
7
  "repository": {
@@ -61,7 +61,7 @@
61
61
  "test": "npm run test:unit",
62
62
  "pretest:unit": "npm run generate:contract-types && npm run build:css && npm run build:live-program",
63
63
  "test:unit": "vitest run --project unit",
64
- "verify:packed-remotion": "npm run build && node scripts/verify-packed-remotion.mjs"
64
+ "verify:packed-contract": "npm run build && node scripts/verify-packed-contract.mjs"
65
65
  },
66
66
  "dependencies": {
67
67
  "ajv": "^8.20.0",