@fifthbell/brokaw 0.1.71 → 0.1.74
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/README.md +106 -1
- package/dist/captured-catalog-browser.d.ts +26 -0
- package/dist/captured-catalog-browser.js +42 -0
- package/dist/captured-catalog-reader.d.ts +16 -0
- package/dist/captured-catalog-reader.js +113 -0
- package/dist/captured-catalog.d.ts +28 -0
- package/dist/captured-catalog.js +138 -0
- package/dist/components/live-program/LiveProgram.js +119 -311
- package/dist/components/live-program/components/WorldClocks.js +2 -1
- package/dist/components/live-program/components/slides/LiveEventSlide.js +2 -4
- package/dist/components/live-program/events.d.ts +7 -0
- package/dist/components/live-program/events.js +28 -5
- package/dist/components/live-program/hooks/useSSE.js +1 -2
- package/dist/components/live-program/i18n.js +1 -1
- package/dist/components/live-program/live-program-config.d.ts +70 -0
- package/dist/components/live-program/live-program-config.js +228 -0
- package/dist/components/live-program/program-data.d.ts +22 -0
- package/dist/components/live-program/program-data.js +23 -0
- package/dist/components/live-program/program-reload.d.ts +11 -0
- package/dist/components/live-program/program-reload.js +21 -0
- package/dist/components/live-program/segments/ArticlesSegment.d.ts +5 -0
- package/dist/components/live-program/segments/ArticlesSegment.js +15 -11
- package/dist/components/live-program/segments/EarthquakeSegment.d.ts +4 -0
- package/dist/components/live-program/segments/EarthquakeSegment.js +13 -10
- package/dist/components/live-program/segments/MarketsSegment.js +7 -2
- package/dist/components/live-program/segments/WeatherSegment.d.ts +5 -0
- package/dist/components/live-program/segments/WeatherSegment.js +7 -2
- package/dist/components/live-program/segments/fetchLiveEvents.d.ts +6 -0
- package/dist/components/live-program/segments/fetchLiveEvents.js +42 -27
- package/dist/components/live-program/source-retention.d.ts +14 -0
- package/dist/components/live-program/source-retention.js +26 -0
- package/dist/cronkite-manifest.d.ts +35 -0
- package/dist/cronkite-manifest.js +5 -26
- package/dist/cronkite-manifest.json +48 -1
- package/dist/ignored-input.d.ts +14 -0
- package/dist/ignored-input.js +48 -0
- package/dist/layouts.d.ts +1 -1
- package/dist/live-program-page/index.html +2 -2
- package/dist/live-program-page/live-program-manifest.json +8 -8
- package/dist/live-program-page/live-program.v0.1.74.css +3 -0
- package/dist/live-program-page/live-program.v0.1.74.js +76 -0
- package/dist/live-program-release.js +6 -3
- package/dist/manifest-validation.js +3 -1
- package/dist/renderer.browser.js +2 -0
- package/dist/renderer.core.js +56 -21
- package/dist/renderer.d.ts +1 -0
- package/dist/renderer.js +1 -0
- package/dist/rum.d.ts +1 -1
- package/dist/rum.js +3 -1
- package/dist/schemas/canonical-document.schema.json +103 -15
- package/dist/schemas/feed-renderable-input.schema.json +0 -1
- package/dist/schemas/live-program-release-input.schema.json +0 -1
- package/dist/schemas/social-image-input.schema.json +0 -1
- package/dist/system-pages.d.ts +66 -0
- package/dist/system-pages.js +35 -0
- package/dist/types/canonical-article.js +3 -2
- package/dist/types/canonical-document-schema.generated.d.ts +168 -24
- package/dist/types/canonical-document-schema.generated.js +218 -32
- package/dist/types/canonical-document.generated.d.ts +74 -6
- package/dist/types/live-program-release-input.generated.d.ts +1 -0
- package/package.json +10 -4
- package/src/partial-deps.json +9 -0
- package/src/styles/compiled.css +1 -1
- package/src/templates/partials/blocks/tiktok.hbs +10 -8
- package/src/templates/partials/components/article-main.hbs +6 -5
- package/src/templates/partials/components/breaking-news.hbs +18 -14
- package/src/templates/partials/components/live-story/main.hbs +18 -14
- package/src/templates/partials/components/media/main.hbs +3 -2
- package/src/templates/partials/components/search/main.hbs +3 -3
- package/src/templates/partials/headers/header-main.hbs +11 -19
- package/src/templates/partials/shell/captured-catalog.hbs +1 -0
- package/dist/live-program-page/live-program.v0.1.71.css +0 -3
- package/dist/live-program-page/live-program.v0.1.71.js +0 -76
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import { SOURCE_RETENTION_MS } from '../source-retention.js';
|
|
3
4
|
import { TrendingDown, TrendingUp } from 'lucide-react';
|
|
4
5
|
import { FastAverageColor } from 'fast-average-color';
|
|
5
6
|
import { FIFTHBELL_ASSETS } from '../assets.js';
|
|
6
7
|
import { t } from '../i18n.js';
|
|
7
8
|
let marketCache = null;
|
|
8
9
|
const CACHE_DURATION_MS = 15 * 60 * 1000;
|
|
10
|
+
/** The last good data while it is at most SOURCE_RETENTION_MS old (fifthbell/brokaw#35). */
|
|
11
|
+
function lastGoodMarkets(now) {
|
|
12
|
+
return marketCache && now - marketCache.timestamp <= SOURCE_RETENTION_MS ? marketCache.data : [];
|
|
13
|
+
}
|
|
9
14
|
export async function fetchMarketData() {
|
|
10
15
|
const now = Date.now();
|
|
11
16
|
if (marketCache && now - marketCache.timestamp < CACHE_DURATION_MS) {
|
|
@@ -14,7 +19,7 @@ export async function fetchMarketData() {
|
|
|
14
19
|
try {
|
|
15
20
|
const response = await fetch(`https://api.monitor.gaulatti.com/broadcast/markets?_=${Date.now()}`);
|
|
16
21
|
if (!response.ok) {
|
|
17
|
-
return
|
|
22
|
+
return lastGoodMarkets(now);
|
|
18
23
|
}
|
|
19
24
|
const data = await response.json();
|
|
20
25
|
marketCache = {
|
|
@@ -26,7 +31,7 @@ export async function fetchMarketData() {
|
|
|
26
31
|
}
|
|
27
32
|
catch (error) {
|
|
28
33
|
console.error('[MarketsSegment] Failed to fetch market data:', error);
|
|
29
|
-
return
|
|
34
|
+
return lastGoodMarkets(now);
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
37
|
export function getLastUpdateTime() {
|
|
@@ -11,5 +11,10 @@ export interface WeatherRegionData {
|
|
|
11
11
|
region: string;
|
|
12
12
|
cities: WeatherCityData[];
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Weather is refetched only once its one-hour cache has expired, so when a
|
|
16
|
+
* refetch fails the last good data is already past the 30-minute retention
|
|
17
|
+
* (fifthbell/brokaw#35) and the weather drops.
|
|
18
|
+
*/
|
|
14
19
|
export declare function fetchWeatherData(): Promise<WeatherRegionData[]>;
|
|
15
20
|
export declare function createWeatherSegment(weatherData: WeatherRegionData[], onDataUpdate?: (data: WeatherRegionData[]) => void, language?: SupportedLanguage): Segment;
|
|
@@ -6,6 +6,11 @@ import { FIFTHBELL_ASSETS } from '../assets.js';
|
|
|
6
6
|
import { t } from '../i18n.js';
|
|
7
7
|
let weatherCache = null;
|
|
8
8
|
const CACHE_DURATION_MS = 60 * 60 * 1000;
|
|
9
|
+
/**
|
|
10
|
+
* Weather is refetched only once its one-hour cache has expired, so when a
|
|
11
|
+
* refetch fails the last good data is already past the 30-minute retention
|
|
12
|
+
* (fifthbell/brokaw#35) and the weather drops.
|
|
13
|
+
*/
|
|
9
14
|
export async function fetchWeatherData() {
|
|
10
15
|
const now = Date.now();
|
|
11
16
|
if (weatherCache && now - weatherCache.timestamp < CACHE_DURATION_MS) {
|
|
@@ -14,7 +19,7 @@ export async function fetchWeatherData() {
|
|
|
14
19
|
try {
|
|
15
20
|
const response = await fetch('https://api.monitor.gaulatti.com/broadcast/weather');
|
|
16
21
|
if (!response.ok) {
|
|
17
|
-
return
|
|
22
|
+
return [];
|
|
18
23
|
}
|
|
19
24
|
const data = await response.json();
|
|
20
25
|
weatherCache = { data, timestamp: now };
|
|
@@ -22,7 +27,7 @@ export async function fetchWeatherData() {
|
|
|
22
27
|
}
|
|
23
28
|
catch (error) {
|
|
24
29
|
console.error('Failed to fetch weather data:', error);
|
|
25
|
-
return
|
|
30
|
+
return [];
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
33
|
function getWeatherIcon(condition, size = 48) {
|
|
@@ -17,4 +17,10 @@ export interface LiveEventData {
|
|
|
17
17
|
updatedAt: string;
|
|
18
18
|
updates: LiveEventUpdate[];
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The live event from the homepage feed, or from Auburnale when the feed has
|
|
22
|
+
* none. An answer of "no live event" is shown at once; when both sources
|
|
23
|
+
* fail, the last answer for the language stays for up to 30 minutes
|
|
24
|
+
* (fifthbell/brokaw#35), then the live event drops.
|
|
25
|
+
*/
|
|
20
26
|
export declare function fetchLiveEvent(language?: SupportedLanguage): Promise<LiveEventData | null>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createLastGood } from '../source-retention.js';
|
|
1
2
|
function extractUpdatesFromAuburnaleEvent(updates) {
|
|
2
3
|
if (!updates || updates.length === 0)
|
|
3
4
|
return [];
|
|
@@ -23,29 +24,29 @@ async function fetchFromAuburnale(language) {
|
|
|
23
24
|
signal: AbortSignal.timeout(3000),
|
|
24
25
|
});
|
|
25
26
|
if (!res.ok)
|
|
26
|
-
return
|
|
27
|
+
return { answered: false };
|
|
27
28
|
const body = await res.json();
|
|
28
29
|
const items = body.data || [];
|
|
29
30
|
const event = items.find((e) => typeof e.sofascore_id === 'number' && e.sofascore_id > 0);
|
|
30
31
|
if (!event)
|
|
31
|
-
return null;
|
|
32
|
-
return {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
return { answered: true, event: null };
|
|
33
|
+
return { answered: true, event: {
|
|
34
|
+
category: event.categories?.[0]?.name || 'EVENT',
|
|
35
|
+
title: event.title,
|
|
36
|
+
excerpt: '',
|
|
37
|
+
image: event.featuredImage?.url || '',
|
|
38
|
+
alt: event.featuredImage?.alt || event.title,
|
|
39
|
+
url: `/${event.slug}`,
|
|
40
|
+
sofascore_id: event.sofascore_id,
|
|
41
|
+
updatedAt: event.eventDate || new Date().toISOString(),
|
|
42
|
+
updates: extractUpdatesFromAuburnaleEvent(event.updates),
|
|
43
|
+
} };
|
|
43
44
|
}
|
|
44
45
|
catch {
|
|
45
|
-
return
|
|
46
|
+
return { answered: false };
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
async function fetchLiveEventAnswer(language) {
|
|
49
50
|
try {
|
|
50
51
|
const response = await fetch(`https://cdn.fifthbell.com/content/homepage-current-${language}.json?_=${Date.now()}`, { cache: 'no-store' });
|
|
51
52
|
if (!response.ok) {
|
|
@@ -56,21 +57,35 @@ export async function fetchLiveEvent(language = 'en') {
|
|
|
56
57
|
if (!main || !main.title) {
|
|
57
58
|
return fetchFromAuburnale(language);
|
|
58
59
|
}
|
|
59
|
-
return {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
return { answered: true, event: {
|
|
61
|
+
category: main.category || 'LIVE',
|
|
62
|
+
title: main.title,
|
|
63
|
+
excerpt: main.excerpt,
|
|
64
|
+
image: main.image || '',
|
|
65
|
+
alt: main.alt || main.title,
|
|
66
|
+
url: main.url || '/',
|
|
67
|
+
liveUrl: main.liveUrl,
|
|
68
|
+
sofascore_id: main.sofascore_id,
|
|
69
|
+
updatedAt: data.updatedAt || new Date().toISOString(),
|
|
70
|
+
updates: data.breakingNews?.updates || [],
|
|
71
|
+
} };
|
|
71
72
|
}
|
|
72
73
|
catch (error) {
|
|
73
74
|
console.error('Error fetching live event:', error);
|
|
74
75
|
return fetchFromAuburnale(language);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
78
|
+
const lastGoodLiveEvents = createLastGood();
|
|
79
|
+
/**
|
|
80
|
+
* The live event from the homepage feed, or from Auburnale when the feed has
|
|
81
|
+
* none. An answer of "no live event" is shown at once; when both sources
|
|
82
|
+
* fail, the last answer for the language stays for up to 30 minutes
|
|
83
|
+
* (fifthbell/brokaw#35), then the live event drops.
|
|
84
|
+
*/
|
|
85
|
+
export async function fetchLiveEvent(language = 'en') {
|
|
86
|
+
const answer = await fetchLiveEventAnswer(language);
|
|
87
|
+
if (answer.answered)
|
|
88
|
+
return lastGoodLiveEvents.keep(language, answer.event);
|
|
89
|
+
console.warn('[live-program] live event unavailable');
|
|
90
|
+
return lastGoodLiveEvents.recall(language) ?? null;
|
|
91
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long a live-program source's last good data stays on air after the
|
|
3
|
+
* source starts failing (fifthbell/brokaw#35). After that it drops out.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SOURCE_RETENTION_MS: number;
|
|
6
|
+
/**
|
|
7
|
+
* Last good answers of one source, by key (usually the language). recall
|
|
8
|
+
* returns an answer only while it is at most SOURCE_RETENTION_MS old and
|
|
9
|
+
* forgets older ones.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createLastGood<T>(): {
|
|
12
|
+
keep(key: string, value: T): T;
|
|
13
|
+
recall(key: string): T | undefined;
|
|
14
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long a live-program source's last good data stays on air after the
|
|
3
|
+
* source starts failing (fifthbell/brokaw#35). After that it drops out.
|
|
4
|
+
*/
|
|
5
|
+
export const SOURCE_RETENTION_MS = 30 * 60 * 1000;
|
|
6
|
+
/**
|
|
7
|
+
* Last good answers of one source, by key (usually the language). recall
|
|
8
|
+
* returns an answer only while it is at most SOURCE_RETENTION_MS old and
|
|
9
|
+
* forgets older ones.
|
|
10
|
+
*/
|
|
11
|
+
export function createLastGood() {
|
|
12
|
+
const answers = new Map();
|
|
13
|
+
return {
|
|
14
|
+
keep(key, value) {
|
|
15
|
+
answers.set(key, { value, at: Date.now() });
|
|
16
|
+
return value;
|
|
17
|
+
},
|
|
18
|
+
recall(key) {
|
|
19
|
+
const answer = answers.get(key);
|
|
20
|
+
if (answer && Date.now() - answer.at <= SOURCE_RETENTION_MS)
|
|
21
|
+
return answer.value;
|
|
22
|
+
answers.delete(key);
|
|
23
|
+
return undefined;
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -211,6 +211,41 @@ export declare const cronkiteManifest: {
|
|
|
211
211
|
readonly contentType: "text/html; charset=utf-8";
|
|
212
212
|
readonly cacheControl: "public, max-age=0, must-revalidate";
|
|
213
213
|
readonly variants: [SystemVariant, ...SystemVariant[]];
|
|
214
|
+
}, {
|
|
215
|
+
readonly renderable: "media-page";
|
|
216
|
+
readonly contentType: "text/html; charset=utf-8";
|
|
217
|
+
readonly cacheControl: "public, max-age=0, must-revalidate";
|
|
218
|
+
readonly variants: [{
|
|
219
|
+
readonly key: "html/mediathek/index.html";
|
|
220
|
+
readonly document: {
|
|
221
|
+
id: string;
|
|
222
|
+
slug: string;
|
|
223
|
+
canonicalUrl: string;
|
|
224
|
+
contentVersion: string;
|
|
225
|
+
publishedAt: string;
|
|
226
|
+
updatedAt: string;
|
|
227
|
+
status: string;
|
|
228
|
+
title: string;
|
|
229
|
+
excerpt: string;
|
|
230
|
+
language: "en" | "es" | "it";
|
|
231
|
+
featured: boolean;
|
|
232
|
+
body: never[];
|
|
233
|
+
layout: "404" | "search-page" | "media-page";
|
|
234
|
+
authors: {
|
|
235
|
+
name: string;
|
|
236
|
+
slug: string;
|
|
237
|
+
}[];
|
|
238
|
+
categories: never[];
|
|
239
|
+
navigation: {
|
|
240
|
+
categories: never[];
|
|
241
|
+
};
|
|
242
|
+
logoLink: string;
|
|
243
|
+
seo: {
|
|
244
|
+
metaTitle: string;
|
|
245
|
+
metaDescription: string;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
}];
|
|
214
249
|
}];
|
|
215
250
|
};
|
|
216
251
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { searchCopyByLanguage } from './search-copy.js';
|
|
2
2
|
import { version } from './version.js';
|
|
3
|
+
import { mediathekSystemPage, systemDocument } from './system-pages.js';
|
|
3
4
|
const pagePartials = [
|
|
4
5
|
'shell/doc-start-standard',
|
|
5
6
|
'headers/header-main',
|
|
@@ -10,7 +11,8 @@ const partialDependencies = {
|
|
|
10
11
|
'shell/doc-start-standard': ['shell/rum-loader'],
|
|
11
12
|
'shell/doc-start-404': ['shell/rum-loader'],
|
|
12
13
|
'shell/rum-loader': [],
|
|
13
|
-
'headers/header-main': [],
|
|
14
|
+
'headers/header-main': ['shell/captured-catalog'],
|
|
15
|
+
'shell/captured-catalog': [],
|
|
14
16
|
'headers/header-minimal': [],
|
|
15
17
|
'footers/footer-full': [],
|
|
16
18
|
'shell/doc-end': [],
|
|
@@ -95,31 +97,7 @@ const localizedSystemCopy = {
|
|
|
95
97
|
search: ['Cerca', 'Cerca notizie Fifthbell.'],
|
|
96
98
|
},
|
|
97
99
|
};
|
|
98
|
-
const
|
|
99
|
-
id: `system-${layout}-${language}`,
|
|
100
|
-
slug,
|
|
101
|
-
canonicalUrl: `https://fifthbell.com${slug}`,
|
|
102
|
-
contentVersion: '2026-09-21T00:00:00.000Z',
|
|
103
|
-
publishedAt: '2026-09-21T00:00:00.000Z',
|
|
104
|
-
updatedAt: '2026-09-21T00:00:00.000Z',
|
|
105
|
-
status: 'published',
|
|
106
|
-
title,
|
|
107
|
-
excerpt,
|
|
108
|
-
language,
|
|
109
|
-
featured: false,
|
|
110
|
-
body: [],
|
|
111
|
-
layout,
|
|
112
|
-
authors: [{ name: 'Fifthbell Newsroom', slug: 'fifthbell-newsroom' }],
|
|
113
|
-
categories: [],
|
|
114
|
-
navigation: { categories: [] },
|
|
115
|
-
logoLink: language === 'en' ? '/' : `/${language}`,
|
|
116
|
-
seo: {
|
|
117
|
-
metaTitle: `${title} | fifthbell`,
|
|
118
|
-
metaDescription: excerpt,
|
|
119
|
-
},
|
|
120
|
-
...extra,
|
|
121
|
-
});
|
|
122
|
-
const systemVariants = (layout, segment, createExtra = () => ({})) => {
|
|
100
|
+
const systemVariants = (layout, segment, createExtra) => {
|
|
123
101
|
const variants = ['en', 'es', 'it'].map((language) => {
|
|
124
102
|
const localizedSegment = language === 'en' ? `/${segment}` : `/${language}/${segment}`;
|
|
125
103
|
const copy = localizedSystemCopy[language][layout === '404' ? 'notFound' : 'search'];
|
|
@@ -296,6 +274,7 @@ export const cronkiteManifest = {
|
|
|
296
274
|
cacheControl: 'public, max-age=0, must-revalidate',
|
|
297
275
|
variants: systemVariants('search-page', 'search', (language) => ({ searchCopy: searchCopyByLanguage[language] })),
|
|
298
276
|
},
|
|
277
|
+
mediathekSystemPage,
|
|
299
278
|
],
|
|
300
279
|
},
|
|
301
280
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@fifthbell/brokaw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.74",
|
|
4
4
|
"templateRendering": {
|
|
5
5
|
"contract": "cronkite.templates",
|
|
6
6
|
"contractVersion": 1,
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
},
|
|
24
24
|
"headers/header-main": {
|
|
25
25
|
"entry": "src/templates/partials/headers/header-main.hbs",
|
|
26
|
+
"partials": [
|
|
27
|
+
"shell/captured-catalog"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"shell/captured-catalog": {
|
|
31
|
+
"entry": "src/templates/partials/shell/captured-catalog.hbs",
|
|
26
32
|
"partials": []
|
|
27
33
|
},
|
|
28
34
|
"headers/header-minimal": {
|
|
@@ -1032,6 +1038,47 @@
|
|
|
1032
1038
|
}
|
|
1033
1039
|
}
|
|
1034
1040
|
]
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
"renderable": "media-page",
|
|
1044
|
+
"contentType": "text/html; charset=utf-8",
|
|
1045
|
+
"cacheControl": "public, max-age=0, must-revalidate",
|
|
1046
|
+
"variants": [
|
|
1047
|
+
{
|
|
1048
|
+
"key": "html/mediathek/index.html",
|
|
1049
|
+
"document": {
|
|
1050
|
+
"id": "system-media-page-en",
|
|
1051
|
+
"slug": "/mediathek",
|
|
1052
|
+
"canonicalUrl": "https://fifthbell.com/mediathek",
|
|
1053
|
+
"contentVersion": "2026-09-21T00:00:00.000Z",
|
|
1054
|
+
"publishedAt": "2026-09-21T00:00:00.000Z",
|
|
1055
|
+
"updatedAt": "2026-09-21T00:00:00.000Z",
|
|
1056
|
+
"status": "published",
|
|
1057
|
+
"title": "Mediathek",
|
|
1058
|
+
"excerpt": "Browse photos from Fifthbell assignments.",
|
|
1059
|
+
"language": "en",
|
|
1060
|
+
"featured": false,
|
|
1061
|
+
"body": [],
|
|
1062
|
+
"layout": "media-page",
|
|
1063
|
+
"authors": [
|
|
1064
|
+
{
|
|
1065
|
+
"name": "Fifthbell Newsroom",
|
|
1066
|
+
"slug": "fifthbell-newsroom"
|
|
1067
|
+
}
|
|
1068
|
+
],
|
|
1069
|
+
"categories": [],
|
|
1070
|
+
"navigation": {
|
|
1071
|
+
"categories": []
|
|
1072
|
+
},
|
|
1073
|
+
"logoLink": "/",
|
|
1074
|
+
"seo": {
|
|
1075
|
+
"metaTitle": "Mediathek | fifthbell",
|
|
1076
|
+
"metaDescription": "Browse photos from Fifthbell assignments."
|
|
1077
|
+
},
|
|
1078
|
+
"assignmentMediaBaseUrl": "https://cdn.fifthbell.com/contents/assignments/"
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
]
|
|
1035
1082
|
}
|
|
1036
1083
|
]
|
|
1037
1084
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Brokaw does not recognize is ignored, not rejected (gaulatti/ariston#217:
|
|
3
|
+
* "If we don't recognize it, we ignore it"). Each ignored item is counted
|
|
4
|
+
* under a fixed reason, and the first one of each reason writes one log line
|
|
5
|
+
* naming only that reason, so neither the counters nor the log grow with
|
|
6
|
+
* the input. Nothing from the input itself (names, values) is logged.
|
|
7
|
+
*/
|
|
8
|
+
export declare const IGNORED_INPUT_REASONS: readonly ["document_body_block_type", "document_heading_level", "document_info_box_tone", "document_hero_layout", "captured_selection_field", "captured_catalog_field", "captured_catalog_state", "captured_resource_kind", "rum_config_field", "embed_provider", "live_program_release_field"];
|
|
9
|
+
export type IgnoredInputReason = (typeof IGNORED_INPUT_REASONS)[number];
|
|
10
|
+
export declare function recordIgnoredInput(reason: IgnoredInputReason, amount?: number): void;
|
|
11
|
+
/** Counts of ignored input since this module loaded, one entry per reason. */
|
|
12
|
+
export declare function ignoredInputCounts(): Readonly<Record<IgnoredInputReason, number>>;
|
|
13
|
+
/** Counts the members of `value` that are not in `known` under `reason`. */
|
|
14
|
+
export declare function recordUnknownMembers(value: object, known: readonly string[], reason: IgnoredInputReason): void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Brokaw does not recognize is ignored, not rejected (gaulatti/ariston#217:
|
|
3
|
+
* "If we don't recognize it, we ignore it"). Each ignored item is counted
|
|
4
|
+
* under a fixed reason, and the first one of each reason writes one log line
|
|
5
|
+
* naming only that reason, so neither the counters nor the log grow with
|
|
6
|
+
* the input. Nothing from the input itself (names, values) is logged.
|
|
7
|
+
*/
|
|
8
|
+
export const IGNORED_INPUT_REASONS = [
|
|
9
|
+
/** A body block whose `type` this release does not render: the block is dropped. */
|
|
10
|
+
'document_body_block_type',
|
|
11
|
+
/** A heading `level` other than 2, 3 or 4: rendered as level 2. */
|
|
12
|
+
'document_heading_level',
|
|
13
|
+
/** An `infoBox` `tone` outside neutral/info/warning/success: rendered as `neutral`. */
|
|
14
|
+
'document_info_box_tone',
|
|
15
|
+
/** A `heroLayout` outside spotlight/editorial: treated as absent. */
|
|
16
|
+
'document_hero_layout',
|
|
17
|
+
/** An unknown member of `capturedSelection` or its `context`. */
|
|
18
|
+
'captured_selection_field',
|
|
19
|
+
/** An unknown member of the captured catalog, its context or a resource descriptor. */
|
|
20
|
+
'captured_catalog_field',
|
|
21
|
+
/** A captured catalog `state` other than selected/withdrawn: not readable, like withdrawn. */
|
|
22
|
+
'captured_catalog_state',
|
|
23
|
+
/** A captured resource `kind` this release does not read: the resource is skipped. */
|
|
24
|
+
'captured_resource_kind',
|
|
25
|
+
/** An unknown member of `rumConfig`. */
|
|
26
|
+
'rum_config_field',
|
|
27
|
+
/** An embed provider the helper does not declare: the helper yields '' and the embed is omitted. */
|
|
28
|
+
'embed_provider',
|
|
29
|
+
/** An unknown member of the live-program release input. */
|
|
30
|
+
'live_program_release_field',
|
|
31
|
+
];
|
|
32
|
+
const counts = new Map();
|
|
33
|
+
export function recordIgnoredInput(reason, amount = 1) {
|
|
34
|
+
if (amount <= 0)
|
|
35
|
+
return;
|
|
36
|
+
const previous = counts.get(reason) ?? 0;
|
|
37
|
+
counts.set(reason, previous + amount);
|
|
38
|
+
if (previous === 0)
|
|
39
|
+
console.warn(`[brokaw] ignored unrecognized input: ${reason}`);
|
|
40
|
+
}
|
|
41
|
+
/** Counts of ignored input since this module loaded, one entry per reason. */
|
|
42
|
+
export function ignoredInputCounts() {
|
|
43
|
+
return Object.freeze(Object.fromEntries(IGNORED_INPUT_REASONS.map((reason) => [reason, counts.get(reason) ?? 0])));
|
|
44
|
+
}
|
|
45
|
+
/** Counts the members of `value` that are not in `known` under `reason`. */
|
|
46
|
+
export function recordUnknownMembers(value, known, reason) {
|
|
47
|
+
recordIgnoredInput(reason, Object.keys(value).filter((key) => !known.includes(key)).length);
|
|
48
|
+
}
|
package/dist/layouts.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export declare const layoutFiles: {
|
|
|
10
10
|
readonly "standalone-page": "standalone-page.hbs";
|
|
11
11
|
};
|
|
12
12
|
export type LayoutName = keyof typeof layoutFiles;
|
|
13
|
-
export declare const layoutNames: readonly ["404" | "search-page" | "
|
|
13
|
+
export declare const layoutNames: readonly ["homepage" | "404" | "search-page" | "media-page" | "article-page" | "category-page" | "live-story" | "link-in-bio" | "standalone-page", ...("homepage" | "404" | "search-page" | "media-page" | "article-page" | "category-page" | "live-story" | "link-in-bio" | "standalone-page")[]];
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
6
6
|
<title>Live Program | fifthbell</title>
|
|
7
|
-
<script type="module" crossorigin src="./live-program.v0.1.
|
|
8
|
-
<link rel="stylesheet" crossorigin href="./live-program.v0.1.
|
|
7
|
+
<script type="module" crossorigin src="./live-program.v0.1.74.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="./live-program.v0.1.74.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"package": "@fifthbell/brokaw",
|
|
48
|
-
"bundleVersion": "0.1.
|
|
48
|
+
"bundleVersion": "0.1.74",
|
|
49
49
|
"schemaVersion": 1,
|
|
50
50
|
"statePath": "state",
|
|
51
51
|
"eventsPath": "events",
|
|
@@ -390,19 +390,19 @@
|
|
|
390
390
|
"key": "index.html",
|
|
391
391
|
"contentType": "text/html; charset=utf-8",
|
|
392
392
|
"bytes": 446,
|
|
393
|
-
"sha256": "
|
|
393
|
+
"sha256": "cea422bd308d52fbcc0d86f061505ce7f7f475d009ef5fa0367f617e0a0995e3"
|
|
394
394
|
},
|
|
395
395
|
{
|
|
396
|
-
"key": "live-program.v0.1.
|
|
396
|
+
"key": "live-program.v0.1.74.css",
|
|
397
397
|
"contentType": "text/css; charset=utf-8",
|
|
398
|
-
"bytes":
|
|
399
|
-
"sha256": "
|
|
398
|
+
"bytes": 77876,
|
|
399
|
+
"sha256": "1a2d8bafa07010ec5017874261af1a2c87191e5e93599051227beb904901a3d6"
|
|
400
400
|
},
|
|
401
401
|
{
|
|
402
|
-
"key": "live-program.v0.1.
|
|
402
|
+
"key": "live-program.v0.1.74.js",
|
|
403
403
|
"contentType": "application/javascript; charset=utf-8",
|
|
404
|
-
"bytes":
|
|
405
|
-
"sha256": "
|
|
404
|
+
"bytes": 296100,
|
|
405
|
+
"sha256": "da30127b17e88c759d42aaffae75f438a6cfc880461e6625943c8728c0ca3f6b"
|
|
406
406
|
}
|
|
407
407
|
]
|
|
408
408
|
}
|