@modoitaliano/giorgia 0.1.104 → 0.1.106
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 +129 -5
- package/dist/assets/giorgia-navigation.js +1 -1
- package/dist/components/live-program/components/slides/LiveEventSlide.js +0 -17
- package/dist/components/live-program/events.js +1 -3
- package/dist/components/live-program/i18n.js +1 -1
- package/dist/components/live-program/segments/fetchLiveEvents.d.ts +0 -1
- package/dist/components/live-program/segments/fetchLiveEvents.js +3 -51
- package/dist/cronkite-manifest.d.ts +0 -23
- package/dist/cronkite-manifest.js +0 -11
- package/dist/cronkite-manifest.json +1 -27
- package/dist/live-program-page/live-program.css +1 -1
- package/dist/live-program-page/live-program.js +5 -5
- package/dist/renderer.core.js +1 -3
- package/dist/video/ArtistBumper.d.ts +50 -0
- package/dist/video/ArtistBumper.js +211 -0
- package/dist/video/Root.js +8 -7
- package/dist/video/assets/rob/bumper-audio.webm +0 -0
- package/dist/video/assets/rob/rob-01.png +0 -0
- package/dist/video/assets/rob/rob-02.png +0 -0
- package/dist/video/assets/rob/rob-03.png +0 -0
- package/dist/video/assets/rob/rob-04.png +0 -0
- package/dist/video/index.d.ts +2 -1
- package/dist/video/index.js +1 -0
- package/dist/video/types.d.ts +11 -0
- package/package.json +12 -6
- package/src/styles/compiled.css +1 -1
- package/src/templates/partials/components/article-main.hbs +1 -1
- package/src/templates/partials/components/breaking-news.hbs +0 -21
- package/src/templates/partials/components/live-story/main.hbs +0 -27
- package/src/templates/partials/shell/doc-end.hbs +0 -52
- package/dist/utils/sofascore.d.ts +0 -3
- package/dist/utils/sofascore.js +0 -31
package/README.md
CHANGED
|
@@ -44,6 +44,23 @@ but those exports are not part of Cronkite's opt-in path. See
|
|
|
44
44
|
[docs/cronkite-compatibility.md](docs/cronkite-compatibility.md) for ownership,
|
|
45
45
|
validation, search, and asset-rendering details.
|
|
46
46
|
|
|
47
|
+
### Artist bumper
|
|
48
|
+
|
|
49
|
+
The legacy Remotion entrypoint also registers `ModoItalianoArtistBumper`, a
|
|
50
|
+
12-second, 1920x1080 artist-and-song introduction. Its contract accepts exactly
|
|
51
|
+
four unique 16:9 image URLs, optional audio, artist and song text, credits, and
|
|
52
|
+
the station URL. The first three images, the identity card, and the final
|
|
53
|
+
`In onda ora` card use hard editorial cuts; only the final card's blue, violet,
|
|
54
|
+
and magenta background light fields move.
|
|
55
|
+
|
|
56
|
+
`robArtistBumperProps` is the bundled ROB / `Cento ragazze` reference fixture.
|
|
57
|
+
The Remotion composition and the `React/ArtistBumper` Storybook stories use the
|
|
58
|
+
same component and packaged assets. The timeline is fixed at 30 fps:
|
|
59
|
+
|
|
60
|
+
- `00:00.000-00:02.066`: three image cuts
|
|
61
|
+
- `00:02.066-00:07.366`: artist, song, and credits over the fourth image
|
|
62
|
+
- `00:07.366-00:12.000`: animated `In onda ora` card
|
|
63
|
+
|
|
47
64
|
## Development
|
|
48
65
|
|
|
49
66
|
```bash
|
|
@@ -55,6 +72,74 @@ npm run verify:packed-contract
|
|
|
55
72
|
npm run storybook
|
|
56
73
|
```
|
|
57
74
|
|
|
75
|
+
Unit tests run in Node. A test that renders React components or hooks opts into a
|
|
76
|
+
DOM by starting the file with `// @vitest-environment happy-dom` and uses
|
|
77
|
+
`@testing-library/react` (pinned in `devDependencies`); other tests are unaffected.
|
|
78
|
+
|
|
79
|
+
## Storybook fixtures and built assets
|
|
80
|
+
|
|
81
|
+
`npm run storybook` and `npm run build-storybook` first run
|
|
82
|
+
`npm run storybook:assets`. It uses the existing CSS/navigation builders and
|
|
83
|
+
stages their output, template assets and local fonts in `.cache/storybook-public`.
|
|
84
|
+
Storybook serves and packages that directory at the artifact root, including
|
|
85
|
+
`/content/styles/giorgia.css`, `/content/fonts/fonts.css`, its referenced WOFF2
|
|
86
|
+
files and `/assets/giorgia-navigation.js`. Re-run the command after changing
|
|
87
|
+
staged assets. Direct `storybook build` without the preparation step is not the
|
|
88
|
+
supported build command.
|
|
89
|
+
|
|
90
|
+
Ordinary homepage/page and breaking-news/home partial examples use checked-in
|
|
91
|
+
fixtures; homepage slot calculations use `FIXTURE_NOW`. Only explicitly named
|
|
92
|
+
`Current` stories run editorial JSON loaders. The existing live-story page and
|
|
93
|
+
partial previews are named `Current` because they use those feeds. Live network
|
|
94
|
+
failures reject the loader and appear in Storybook's error display; they never
|
|
95
|
+
turn an unavailable feed into a successful fixture article. Fixture images,
|
|
96
|
+
third-party media and the existing radio shell's now-playing request remain
|
|
97
|
+
external runtime dependencies, separate from editorial preview loaders. The
|
|
98
|
+
breaking-news fixture is labelled as a layout fixture, not a current score or
|
|
99
|
+
live-match claim.
|
|
100
|
+
|
|
101
|
+
After building, run the browser/artifact regression against the exact output:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
npm run build-storybook
|
|
105
|
+
npx tsx scripts/verify-storybook-artifact.ts
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The check starts an isolated loopback static server and fresh Chromium contexts,
|
|
109
|
+
verifies packaged asset bytes/MIME and applied styles/fonts, then exercises the
|
|
110
|
+
manager, fixture pages/partials and explicit live-failure controls. All external
|
|
111
|
+
requests are deliberately blocked: fixture stories must make no editorial feed
|
|
112
|
+
requests, and Current stories must show an error rather than fixture success.
|
|
113
|
+
Eleven additional synthetic negative controls fail the events index after a
|
|
114
|
+
successful homepage fetch, fail canonical article/event JSON, or supply
|
|
115
|
+
empty/null/invalid indexes. They assert the
|
|
116
|
+
exact error and request stage without claiming live-content success.
|
|
117
|
+
Third-party diagnostics are recorded separately. The JSON report is printed to
|
|
118
|
+
stdout; screenshots default to `.cache/storybook-artifact-evidence`. Optional
|
|
119
|
+
positional arguments specify the artifact directory and screenshot directory.
|
|
120
|
+
Use the project's installed Playwright Chromium (`npx playwright install chromium`
|
|
121
|
+
if not already available). Local artifact verification does not prove public
|
|
122
|
+
hosting or close the separate deployment/browser acceptance issue #7.
|
|
123
|
+
|
|
124
|
+
Loader contracts also exercise missing optional breaking-news fields, events
|
|
125
|
+
errors, and empty or invalid article collections without outbound requests:
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
node --import tsx --test scripts/preview-loader-contract.test.mjs
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The mandatory managed-updater refresh is also covered by a local boundary check:
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
node --test scripts/agent-updater-boundary.test.mjs
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
It invokes the actual installed updater with disposable local Git remotes and
|
|
138
|
+
snapshots. Four cases assert strict missing/non-executable-sync failures,
|
|
139
|
+
preserved no-fetch failure, valid sync delegation and snapshot cleanup. Child
|
|
140
|
+
Git configuration is isolated, and downstream startup is a fixture observer;
|
|
141
|
+
this check does not claim real Clouseau installation or hosting verification.
|
|
142
|
+
|
|
58
143
|
## Persistent navigation
|
|
59
144
|
|
|
60
145
|
Standard page layouts replace only `#page-content` during same-origin, same-language navigation. The masthead, footer, and bottom radio player stay mounted, so an active stream continues without interruption. Each persistent shell surface has its own static View Transition identity, preventing the visible player bar from being redrawn with page content. Swup updates the URL, browser history, document metadata, focus announcement, and scroll position; native View Transitions animate the content where supported, with a CSS fallback and reduced-motion handling.
|
|
@@ -83,15 +168,15 @@ Page-local scripts that must run after a content swap use `data-swup-reload-scri
|
|
|
83
168
|
A push or manual run on `main` deploys that exact artifact to
|
|
84
169
|
`https://ui.modoitaliano.fm` through the `giorgia-storybook` GitHub
|
|
85
170
|
environment and short-lived AWS OIDC role
|
|
86
|
-
`giorgia-
|
|
171
|
+
`giorgia-github-deploy`. Storybook deployment never runs
|
|
87
172
|
`npm publish` or changes the package version.
|
|
88
173
|
|
|
89
174
|
### Storybook infrastructure and rollback
|
|
90
175
|
|
|
91
|
-
The Modo Italiano `Loredana` CloudFormation stack owns the
|
|
176
|
+
The existing Modo Italiano `Loredana` CloudFormation stack owns the Storybook
|
|
92
177
|
bucket and CloudFront distribution. The workflow resolves outputs
|
|
93
|
-
`
|
|
94
|
-
`
|
|
178
|
+
`LoredanaGiorgiaBucketName` and
|
|
179
|
+
`LoredanaGiorgiaDistributionId`; it must never target the Fifthbell
|
|
95
180
|
`ui.fifthbell.com` resources used by Brokaw.
|
|
96
181
|
|
|
97
182
|
Each build carries `deployment.json` with its repository, package version, run,
|
|
@@ -116,7 +201,8 @@ repository's current immutable GitHub OIDC subject:
|
|
|
116
201
|
repo:modoitaliano@327696306/giorgia@1304750193:environment:giorgia-storybook
|
|
117
202
|
```
|
|
118
203
|
|
|
119
|
-
Its permissions are limited to `cloudformation:DescribeStacks` for
|
|
204
|
+
Its permissions are limited to `cloudformation:DescribeStacks` for
|
|
205
|
+
`Loredana`;
|
|
120
206
|
`s3:ListBucket` and `s3:GetBucketLocation` on the dedicated bucket;
|
|
121
207
|
`s3:GetObject` and `s3:PutObject` on that bucket's `releases/*`; and
|
|
122
208
|
`cloudfront:GetDistribution`,
|
|
@@ -124,3 +210,41 @@ Its permissions are limited to `cloudformation:DescribeStacks` for Loredana;
|
|
|
124
210
|
`cloudfront:CreateInvalidation`, and `cloudfront:GetInvalidation` on the one
|
|
125
211
|
Storybook distribution. It has no delete permission. No long-lived AWS key
|
|
126
212
|
belongs in GitHub secrets.
|
|
213
|
+
|
|
214
|
+
## Pull request verification
|
|
215
|
+
|
|
216
|
+
Local agent review uses the shared `clouseau` skill with the developer's
|
|
217
|
+
authenticated coding harness and the `.clouseau-local.json` recipe; it needs no
|
|
218
|
+
CI provider keys. `AGENTS.md` owns the rule: run it against the final committed
|
|
219
|
+
change before opening a PR, repair findings, and publish the passing signed
|
|
220
|
+
receipt in the initial ready PR body. Never push directly to `main`.
|
|
221
|
+
|
|
222
|
+
Every PR runs:
|
|
223
|
+
|
|
224
|
+
- `npm run typecheck`,
|
|
225
|
+
- `npm run test:coverage`: the Vitest `unit` project under V8 coverage; the Clouseau gate measures changed-line coverage of `src` (see below),
|
|
226
|
+
- `npm run build` and the packed declarative contract check (`node scripts/verify-packed-contract.mjs`),
|
|
227
|
+
- the workflow-contract tests in `.github/tests`.
|
|
228
|
+
|
|
229
|
+
The Clouseau gate (`coverage.mode: changed_lines` in `.github/clouseau.json`)
|
|
230
|
+
requires every line and branch a PR adds or modifies under `src` to be covered,
|
|
231
|
+
and repository-wide line and branch coverage must not fall below the base
|
|
232
|
+
revision's, which CI measures on the PR base. New behaviour needs a test, never
|
|
233
|
+
a coverage pragma. The mode is read from the base revision's configuration, so
|
|
234
|
+
a PR that changes it is itself judged by the previous mode.
|
|
235
|
+
|
|
236
|
+
A PR carrying an authenticated local review stamp is verified by the pinned
|
|
237
|
+
Clouseau engine without AI credentials; unstamped PRs use the CI reviewer.
|
|
238
|
+
Passing reviews receive a bot approval and native auto-merge. Unresolved
|
|
239
|
+
product-direction questions go to the owner, and changes to review controls need
|
|
240
|
+
the owner's `/approve-intent <head SHA>` comment. See [the purpose
|
|
241
|
+
contract](.github/clouseau.md). The CI engine is resolved from protected
|
|
242
|
+
Clouseau `main` at the start of each run (see
|
|
243
|
+
[automatic Clouseau CI upgrades](https://github.com/gaulatti/clouseau/blob/main/docs/automatic-ci-upgrades.md)).
|
|
244
|
+
|
|
245
|
+
Package publication and the Storybook deployment stay separate, explicitly
|
|
246
|
+
authorized workflows outside this review contract.
|
|
247
|
+
|
|
248
|
+
CI needs these repository secrets: `DEEPSEEK_API_KEY` and `TYPESAFE_API_KEY` for
|
|
249
|
+
the CI reviewer, and `DEPLOYMENT_TOKEN` (a token with contents write access
|
|
250
|
+
from an identity other than `github-actions[bot]`) for automatic repairs.
|
|
@@ -1086,7 +1086,7 @@ function Q(e) {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
function de() {
|
|
1088
1088
|
let e = document.querySelector("#page-content");
|
|
1089
|
-
e && (window.__brokawHydrateRelativeTimes?.(e), window.__brokawInitCarousels?.(e), window.__brokawInitAnimatedHighlights?.()
|
|
1089
|
+
e && (window.__brokawHydrateRelativeTimes?.(e), window.__brokawInitCarousels?.(e), window.__brokawInitAnimatedHighlights?.());
|
|
1090
1090
|
}
|
|
1091
1091
|
function fe() {
|
|
1092
1092
|
let e = document.querySelector("#page-content");
|
|
@@ -3,7 +3,6 @@ import { useMemo, useRef, useState, useEffect, useCallback } from 'react';
|
|
|
3
3
|
import { FastAverageColor } from 'fast-average-color';
|
|
4
4
|
import qrcode from 'qrcode-generator';
|
|
5
5
|
import { t } from '../../i18n.js';
|
|
6
|
-
import { buildSofascoreAttackMomentumUrl } from '../../../../utils/sofascore.js';
|
|
7
6
|
const fac = new FastAverageColor();
|
|
8
7
|
function buildQrCodeUrl(value) {
|
|
9
8
|
const qr = qrcode(0, 'M');
|
|
@@ -22,13 +21,6 @@ function formatUpdateTime(update) {
|
|
|
22
21
|
}
|
|
23
22
|
return update.time || '';
|
|
24
23
|
}
|
|
25
|
-
function LatestUpdates({ updates, language }) {
|
|
26
|
-
const latest = useMemo(() => updates.slice(0, 5), [updates]);
|
|
27
|
-
if (latest.length === 0) {
|
|
28
|
-
return (_jsx("p", { className: "text-white/50 font-['Barlow'] text-xl", children: t('liveEvent.noUpdates', language) }));
|
|
29
|
-
}
|
|
30
|
-
return (_jsx("div", { className: 'flex flex-col gap-3', children: latest.map((update, i) => (_jsxs("div", { className: 'flex gap-3 items-start', children: [_jsx("div", { className: 'w-2 h-2 rounded-full bg-[#4FC3F7] flex-shrink-0 mt-2' }), _jsxs("div", { className: 'flex flex-col gap-0.5 min-w-0', children: [formatUpdateTime(update) && (_jsx("span", { className: "text-sm font-semibold text-[#0ea5e9] font-['Barlow']", children: formatUpdateTime(update) })), update.html ? (_jsx("div", { className: "text-white/90 text-lg leading-snug font-['Barlow'] [&_img]:hidden", children: update.html.replace(/<[^>]*>/g, '') })) : update.text ? (_jsx("p", { className: "text-white/90 text-lg leading-snug font-['Barlow'] truncate", children: update.text })) : null] })] }, i))) }));
|
|
31
|
-
}
|
|
32
24
|
function ScrollingTimeline({ updates, language }) {
|
|
33
25
|
const [visibleStart, setVisibleStart] = useState(0);
|
|
34
26
|
const displayCount = 4;
|
|
@@ -60,13 +52,7 @@ function ScrollingTimeline({ updates, language }) {
|
|
|
60
52
|
}
|
|
61
53
|
export function LiveEventSlide({ event, progress, language }) {
|
|
62
54
|
const [dominantColor, setDominantColor] = useState('#b21100');
|
|
63
|
-
const isSports = typeof event.sofascore_id === 'number' && event.sofascore_id > 0;
|
|
64
55
|
const qrCodeUrl = useMemo(() => buildQrCodeUrl(event.liveUrl || event.url), [event.liveUrl, event.url]);
|
|
65
|
-
const sofascoreWidgetUrl = useMemo(() => {
|
|
66
|
-
if (!isSports)
|
|
67
|
-
return '';
|
|
68
|
-
return buildSofascoreAttackMomentumUrl(event.sofascore_id, 'dark');
|
|
69
|
-
}, [isSports, event.sofascore_id]);
|
|
70
56
|
const handleImageLoad = useCallback((e) => {
|
|
71
57
|
try {
|
|
72
58
|
const color = fac.getColor(e.currentTarget);
|
|
@@ -76,9 +62,6 @@ export function LiveEventSlide({ event, progress, language }) {
|
|
|
76
62
|
setDominantColor('#b21100');
|
|
77
63
|
}
|
|
78
64
|
}, []);
|
|
79
|
-
if (isSports) {
|
|
80
|
-
return (_jsxs("div", { className: 'absolute inset-0', children: [_jsx("div", { className: 'absolute inset-0', children: _jsx("img", { src: event.image, alt: '', crossOrigin: 'anonymous', onLoad: handleImageLoad, className: 'w-full h-full object-cover blur-xl scale-105' }, event.image) }), _jsx("div", { className: 'absolute inset-0 opacity-75 mix-blend-multiply transition-all duration-1000', style: { background: `linear-gradient(to bottom right, ${dominantColor}, #000000)` } }), _jsx("div", { className: 'absolute inset-0 bg-[radial-gradient(circle_at_30%_30%,rgba(255,255,255,0.1),transparent_60%)]' }), _jsxs("div", { className: 'relative z-10 grid grid-cols-12 h-full', children: [_jsx("div", { className: 'col-span-5 flex flex-col justify-center p-16 relative bg-black/35 backdrop-blur-2xl', children: _jsxs("div", { className: 'animate-slide-up flex flex-col items-start', children: [_jsx("span", { className: "inline-flex items-center px-4 py-1.5 bg-[#cc0000] text-white text-xl font-bold tracking-[0.08em] uppercase font-['Barlow_Condensed'] mb-4", children: "LIVE" }), _jsx("span", { className: "text-white/80 text-2xl font-semibold uppercase tracking-wider mb-2 font-['Barlow_Condensed']", children: event.category }), _jsx("div", { className: 'w-16 h-1.5 bg-[#b21100] mb-6' }), _jsx("h1", { className: "text-4xl font-bold leading-tight mb-4 tracking-tight line-clamp-5 font-['Barlow_Condensed'] [text-wrap:balance] text-white", children: event.title }), event.excerpt && (_jsx("p", { className: "text-2xl font-light leading-relaxed opacity-80 line-clamp-3 font-['Barlow'] text-white mb-6", children: event.excerpt })), _jsx(LatestUpdates, { updates: event.updates, language: language })] }) }), _jsx("div", { className: 'col-span-7 relative h-full flex items-center justify-center p-12 pb-32', children: _jsxs("div", { className: 'relative w-full max-w-lg flex flex-col gap-4', children: [_jsxs("div", { className: 'relative aspect-video shadow-2xl overflow-hidden border border-white/10', children: [_jsx("div", { className: 'absolute top-0 left-0 h-1 bg-white/30 w-full z-20', children: _jsx("div", { className: 'h-full bg-white transition-all duration-100 ease-linear', style: { width: `${progress}%` } }) }), _jsx("img", { src: event.image, alt: event.alt, className: 'w-full h-full object-cover', style: { animation: 'kenburns 20s infinite alternate' }, crossOrigin: 'anonymous' }, event.image)] }), sofascoreWidgetUrl && (_jsx("div", { className: 'w-full overflow-hidden border border-white/10 bg-black/40', children: _jsx("iframe", { width: '100%', height: '180', src: sofascoreWidgetUrl, title: 'SofaScore Attack Momentum', frameBorder: '0', scrolling: 'no', loading: 'lazy', referrerPolicy: 'no-referrer-when-downgrade', style: { border: 0 } }) })), _jsx("div", { className: 'absolute bottom-4 right-4 z-30', children: _jsx("div", { className: 'p-2 rounded-sm backdrop-blur-md shadow-2xl', style: { backgroundColor: 'rgba(0,0,0,0.4)' }, children: _jsx("img", { src: qrCodeUrl, alt: 'QR code', className: 'block w-24 h-24' }) }) })] }) })] })] }));
|
|
81
|
-
}
|
|
82
65
|
return (_jsxs("div", { className: 'absolute inset-0', children: [_jsx("div", { className: 'absolute inset-0', children: _jsx("img", { src: event.image, alt: '', crossOrigin: 'anonymous', onLoad: handleImageLoad, className: 'w-full h-full object-cover blur-xl scale-105' }, event.image) }), _jsx("div", { className: 'absolute inset-0 opacity-80 mix-blend-multiply transition-all duration-1000', style: { background: `linear-gradient(to bottom right, ${dominantColor}, #000000)` } }), _jsx("div", { className: 'absolute inset-0 bg-[radial-gradient(circle_at_30%_30%,rgba(255,255,255,0.1),transparent_60%)]' }), _jsxs("div", { className: 'relative z-10 grid grid-cols-12 h-full', children: [_jsx("div", { className: 'col-span-5 flex flex-col justify-center p-16 relative bg-black/35 backdrop-blur-2xl', children: _jsxs("div", { className: 'animate-slide-up flex flex-col items-start', children: [_jsx("span", { className: "inline-flex items-center px-4 py-1.5 bg-[#cc0000] text-white text-xl font-bold tracking-[0.08em] uppercase font-['Barlow_Condensed'] mb-4", children: "EN VIVO" }), _jsx("span", { className: "text-white/80 text-2xl font-semibold uppercase tracking-wider mb-2 font-['Barlow_Condensed']", children: event.category }), _jsx("div", { className: 'w-16 h-1.5 bg-[#b21100] mb-6' }), _jsx("h1", { className: "text-4xl font-bold leading-tight mb-4 tracking-tight line-clamp-5 font-['Barlow_Condensed'] [text-wrap:balance] text-white", children: event.title }), event.excerpt && (_jsx("p", { className: "text-2xl font-light leading-relaxed opacity-80 line-clamp-3 font-['Barlow'] text-white", children: event.excerpt }))] }) }), _jsxs("div", { className: 'col-span-7 relative h-full flex flex-col justify-center p-16 pl-12', children: [_jsxs("div", { className: 'flex items-start gap-4 mb-8', children: [_jsx("div", { className: 'bg-[#b21100] text-white px-4 py-2 shadow-lg', children: _jsx(SecondBellIcon, { size: 32 }) }), _jsx("h2", { className: "text-white/60 text-2xl font-semibold uppercase tracking-[0.12em] font-['Barlow_Condensed']", children: "ACTUALIZACIONES EN VIVO" })] }), _jsx(ScrollingTimeline, { updates: event.updates, language: language }), _jsx("div", { className: 'absolute bottom-8 right-8 z-30', children: _jsx("div", { className: 'p-2 rounded-sm backdrop-blur-md shadow-2xl', style: { backgroundColor: 'rgba(0,0,0,0.4)' }, children: _jsx("img", { src: qrCodeUrl, alt: 'QR code', className: 'block w-24 h-24' }) }) })] })] })] }));
|
|
83
66
|
}
|
|
84
67
|
function SecondBellIcon({ size }) {
|
|
@@ -146,10 +146,8 @@ export function hasEventChanges(oldEvents, newEvents) {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
for (const [uuid, newEvent] of newMap.entries()) {
|
|
149
|
+
// Presence in both maps is guaranteed by the membership checks above.
|
|
149
150
|
const oldEvent = oldMap.get(uuid);
|
|
150
|
-
if (!oldEvent) {
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
151
|
if (oldEvent.title !== newEvent.title ||
|
|
154
152
|
oldEvent.status !== newEvent.status ||
|
|
155
153
|
oldEvent.posts_count !== newEvent.posts_count ||
|
|
@@ -291,7 +291,7 @@ export function t(key, language, replacements) {
|
|
|
291
291
|
console.warn(`Translation missing for key: ${key}`);
|
|
292
292
|
return key;
|
|
293
293
|
}
|
|
294
|
-
let text = translation[language] || translation.es
|
|
294
|
+
let text = translation[language] || translation.es;
|
|
295
295
|
if (replacements) {
|
|
296
296
|
Object.entries(replacements).forEach(([placeholder, value]) => {
|
|
297
297
|
text = text.replace(`{${placeholder}}`, String(value));
|
|
@@ -1,60 +1,13 @@
|
|
|
1
|
-
function extractUpdatesFromAuburnaleEvent(updates) {
|
|
2
|
-
if (!updates || updates.length === 0)
|
|
3
|
-
return [];
|
|
4
|
-
return updates.map((u) => {
|
|
5
|
-
let text = '';
|
|
6
|
-
try {
|
|
7
|
-
const parsed = typeof u.content === 'string' ? JSON.parse(u.content) : u.content;
|
|
8
|
-
text = parsed?.root?.children?.[0]?.children?.[0]?.text || '';
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
text = String(u.content || '');
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
timestamp: u.timestamp,
|
|
15
|
-
text: text || 'Actualización disponible',
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
async function fetchFromAuburnale(language) {
|
|
20
|
-
const baseUrl = typeof window !== 'undefined' ? `http://${window.location.hostname}:3000` : 'http://127.0.0.1:3000';
|
|
21
|
-
try {
|
|
22
|
-
const res = await fetch(`${baseUrl}/events?status=published&limit=1&sort=-eventDate&language=${language}`, {
|
|
23
|
-
signal: AbortSignal.timeout(3000),
|
|
24
|
-
});
|
|
25
|
-
if (!res.ok)
|
|
26
|
-
return null;
|
|
27
|
-
const body = await res.json();
|
|
28
|
-
const items = body.data || [];
|
|
29
|
-
const event = items.find((e) => typeof e.sofascore_id === 'number' && e.sofascore_id > 0);
|
|
30
|
-
if (!event)
|
|
31
|
-
return null;
|
|
32
|
-
return {
|
|
33
|
-
category: event.categories?.[0]?.name || 'EVENTO',
|
|
34
|
-
title: event.title,
|
|
35
|
-
excerpt: '',
|
|
36
|
-
image: event.featuredImage?.url || '',
|
|
37
|
-
alt: event.featuredImage?.alt || event.title,
|
|
38
|
-
url: `/${event.slug}`,
|
|
39
|
-
sofascore_id: event.sofascore_id,
|
|
40
|
-
updatedAt: event.eventDate || new Date().toISOString(),
|
|
41
|
-
updates: extractUpdatesFromAuburnaleEvent(event.updates),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
1
|
export async function fetchLiveEvent(language = 'es') {
|
|
49
2
|
try {
|
|
50
3
|
const response = await fetch(`https://cdn.modoitaliano.fm/content/homepage-current-${language}.json?_=${Date.now()}`, { cache: 'no-store' });
|
|
51
4
|
if (!response.ok) {
|
|
52
|
-
return
|
|
5
|
+
return null;
|
|
53
6
|
}
|
|
54
7
|
const data = await response.json();
|
|
55
8
|
const main = data.breakingNews?.main;
|
|
56
9
|
if (!main || !main.title) {
|
|
57
|
-
return
|
|
10
|
+
return null;
|
|
58
11
|
}
|
|
59
12
|
return {
|
|
60
13
|
category: main.category || 'EN VIVO',
|
|
@@ -64,13 +17,12 @@ export async function fetchLiveEvent(language = 'es') {
|
|
|
64
17
|
alt: main.alt || main.title,
|
|
65
18
|
url: main.url || '/',
|
|
66
19
|
liveUrl: main.liveUrl,
|
|
67
|
-
sofascore_id: main.sofascore_id,
|
|
68
20
|
updatedAt: data.updatedAt || new Date().toISOString(),
|
|
69
21
|
updates: data.breakingNews?.updates || [],
|
|
70
22
|
};
|
|
71
23
|
}
|
|
72
24
|
catch (error) {
|
|
73
25
|
console.error('Error fetching live event:', error);
|
|
74
|
-
return
|
|
26
|
+
return null;
|
|
75
27
|
}
|
|
76
28
|
}
|
|
@@ -284,29 +284,6 @@ export declare const cronkiteManifest: {
|
|
|
284
284
|
};
|
|
285
285
|
};
|
|
286
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
|
-
};
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
287
|
};
|
|
311
288
|
readonly renderables: {
|
|
312
289
|
readonly 'article-page': {
|
|
@@ -201,17 +201,6 @@ export const cronkiteManifest = {
|
|
|
201
201
|
id: { type: 'string', pattern: '^[A-Za-z0-9]+$' },
|
|
202
202
|
},
|
|
203
203
|
},
|
|
204
|
-
'sofascore-widget': {
|
|
205
|
-
urlTemplate: 'https://widgets.sofascore.com/embed/attackMomentum?id={id}&widgetTheme={widgetTheme}',
|
|
206
|
-
parameters: {
|
|
207
|
-
id: { type: 'integer', minimum: 1 },
|
|
208
|
-
widgetTheme: { type: 'string', enum: ['light', 'dark'], default: 'light' },
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
'sofascore-match': {
|
|
212
|
-
urlTemplate: 'https://www.sofascore.com/football/match#id:{id}',
|
|
213
|
-
parameters: { id: { type: 'integer', minimum: 1 } },
|
|
214
|
-
},
|
|
215
204
|
},
|
|
216
205
|
renderables: {
|
|
217
206
|
'article-page': page('article-page', [pagePartials[0], pagePartials[1], 'components/article-main', pagePartials[2], pagePartials[3]]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@modoitaliano/giorgia",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.106",
|
|
4
4
|
"templateRendering": {
|
|
5
5
|
"contract": "cronkite.templates",
|
|
6
6
|
"contractVersion": 1,
|
|
@@ -354,32 +354,6 @@
|
|
|
354
354
|
"pattern": "^[A-Za-z0-9]+$"
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
},
|
|
358
|
-
"sofascore-widget": {
|
|
359
|
-
"urlTemplate": "https://widgets.sofascore.com/embed/attackMomentum?id={id}&widgetTheme={widgetTheme}",
|
|
360
|
-
"parameters": {
|
|
361
|
-
"id": {
|
|
362
|
-
"type": "integer",
|
|
363
|
-
"minimum": 1
|
|
364
|
-
},
|
|
365
|
-
"widgetTheme": {
|
|
366
|
-
"type": "string",
|
|
367
|
-
"enum": [
|
|
368
|
-
"light",
|
|
369
|
-
"dark"
|
|
370
|
-
],
|
|
371
|
-
"default": "light"
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
"sofascore-match": {
|
|
376
|
-
"urlTemplate": "https://www.sofascore.com/football/match#id:{id}",
|
|
377
|
-
"parameters": {
|
|
378
|
-
"id": {
|
|
379
|
-
"type": "integer",
|
|
380
|
-
"minimum": 1
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
357
|
}
|
|
384
358
|
},
|
|
385
359
|
"renderables": {
|