@phnx-labs/artifacts-cli 0.18.5 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.19.0 — 2026-11-24
6
+
7
+ - **Posts, reels, videos, galleries, calendars and link cards.** Five new JSON fences let an agent show media and social content in an artifact without writing HTML. `post` lays a post out the way X, Threads, Bluesky, LinkedIn, Reddit or Instagram shows it: author, verified mark, text with highlighted links, @handles and #tags, up to four images or clips (an Instagram carousel takes ten) and compact engagement counts. `video` is a player with title, caption and counts; `"aspect": "9:16"` makes it a reel with the author, caption and counts over the video and tap (or Enter) to play. A YouTube link shows its thumbnail and opens YouTube. `gallery` shows images and clips as a grid, masonry columns or a carousel, and any image opens full screen, where arrow keys step through and Escape returns focus to it. `events` is a calendar agenda grouped by day with times, duration, location, attendees, a tentative or cancelled state and a join link. `link` is a rich preview card. All five use the artifact's palette in light and dark, fit a 390 px phone, and inline local images, clips and posters so the page stays one file. `artifacts components <name>` prints each contract, and `artifacts check` rejects an unknown field, a non-http link or an end time before its start.
8
+
5
9
  ## 0.18.5 — 2026-11-13
6
10
 
7
11
  - **A video with no speech unfurls under the name you gave it.** When a recording has no speech, its auto summary has nothing to say: its title is the file name and its text is "No speech was detected in this recording." The share Worker used that summary for the link card and the page title anyway, ahead of a label set with `artifacts share edit --label`. Now a silent video's card and page title use its label and its `og-description`, and fall back to the file name only when it has no label. A video with speech still uses its summary. The page still says no one spoke.
@@ -0,0 +1,195 @@
1
+ /**
2
+ * Media and social components: a post, a video or reel, a gallery, an event
3
+ * agenda and a link card. Authors supply JSON data; the renderer owns the
4
+ * markup, the palette and the lightbox. Every field is checked strictly, the
5
+ * same contract as the explorer: an unknown or misspelled field fails instead
6
+ * of silently dropping content.
7
+ */
8
+ export declare const CARD_NAMES: readonly ["post", "video", "gallery", "events", "link"];
9
+ export type CardName = typeof CARD_NAMES[number];
10
+ export declare function isCardFence(info: string): info is CardName;
11
+ export declare const POST_PLATFORMS: readonly ["x", "threads", "bluesky", "linkedin", "reddit", "instagram"];
12
+ export declare const CARD_COMPONENTS: ({
13
+ format: string;
14
+ example: string;
15
+ name: string;
16
+ purpose: string;
17
+ fields: {
18
+ platform: string;
19
+ author: string;
20
+ text: string;
21
+ 'title, community, flair': string;
22
+ media: string;
23
+ time: string;
24
+ metrics: string;
25
+ url: string;
26
+ src?: undefined;
27
+ aspect?: undefined;
28
+ 'title, caption, duration'?: undefined;
29
+ poster?: undefined;
30
+ 'author, metrics'?: undefined;
31
+ 'url, loop, muted'?: undefined;
32
+ items?: undefined;
33
+ layout?: undefined;
34
+ columns?: undefined;
35
+ 'title, caption'?: undefined;
36
+ events?: undefined;
37
+ 'start, end'?: undefined;
38
+ status?: undefined;
39
+ 'url, attendees'?: undefined;
40
+ 'title, timezone'?: undefined;
41
+ 'url, title'?: undefined;
42
+ 'description, image, site'?: undefined;
43
+ };
44
+ } | {
45
+ format: string;
46
+ example: string;
47
+ name: string;
48
+ purpose: string;
49
+ fields: {
50
+ src: string;
51
+ aspect: string;
52
+ 'title, caption, duration': string;
53
+ poster: string;
54
+ 'author, metrics': string;
55
+ 'url, loop, muted': string;
56
+ platform?: undefined;
57
+ author?: undefined;
58
+ text?: undefined;
59
+ 'title, community, flair'?: undefined;
60
+ media?: undefined;
61
+ time?: undefined;
62
+ metrics?: undefined;
63
+ url?: undefined;
64
+ items?: undefined;
65
+ layout?: undefined;
66
+ columns?: undefined;
67
+ 'title, caption'?: undefined;
68
+ events?: undefined;
69
+ 'start, end'?: undefined;
70
+ status?: undefined;
71
+ 'url, attendees'?: undefined;
72
+ 'title, timezone'?: undefined;
73
+ 'url, title'?: undefined;
74
+ 'description, image, site'?: undefined;
75
+ };
76
+ } | {
77
+ format: string;
78
+ example: string;
79
+ name: string;
80
+ purpose: string;
81
+ fields: {
82
+ items: string;
83
+ layout: string;
84
+ columns: string;
85
+ 'title, caption': string;
86
+ platform?: undefined;
87
+ author?: undefined;
88
+ text?: undefined;
89
+ 'title, community, flair'?: undefined;
90
+ media?: undefined;
91
+ time?: undefined;
92
+ metrics?: undefined;
93
+ url?: undefined;
94
+ src?: undefined;
95
+ aspect?: undefined;
96
+ 'title, caption, duration'?: undefined;
97
+ poster?: undefined;
98
+ 'author, metrics'?: undefined;
99
+ 'url, loop, muted'?: undefined;
100
+ events?: undefined;
101
+ 'start, end'?: undefined;
102
+ status?: undefined;
103
+ 'url, attendees'?: undefined;
104
+ 'title, timezone'?: undefined;
105
+ 'url, title'?: undefined;
106
+ 'description, image, site'?: undefined;
107
+ };
108
+ } | {
109
+ format: string;
110
+ example: string;
111
+ name: string;
112
+ purpose: string;
113
+ fields: {
114
+ events: string;
115
+ 'start, end': string;
116
+ status: string;
117
+ 'url, attendees': string;
118
+ 'title, timezone': string;
119
+ platform?: undefined;
120
+ author?: undefined;
121
+ text?: undefined;
122
+ 'title, community, flair'?: undefined;
123
+ media?: undefined;
124
+ time?: undefined;
125
+ metrics?: undefined;
126
+ url?: undefined;
127
+ src?: undefined;
128
+ aspect?: undefined;
129
+ 'title, caption, duration'?: undefined;
130
+ poster?: undefined;
131
+ 'author, metrics'?: undefined;
132
+ 'url, loop, muted'?: undefined;
133
+ items?: undefined;
134
+ layout?: undefined;
135
+ columns?: undefined;
136
+ 'title, caption'?: undefined;
137
+ 'url, title'?: undefined;
138
+ 'description, image, site'?: undefined;
139
+ };
140
+ } | {
141
+ format: string;
142
+ example: string;
143
+ name: string;
144
+ purpose: string;
145
+ fields: {
146
+ 'url, title': string;
147
+ 'description, image, site': string;
148
+ layout: string;
149
+ platform?: undefined;
150
+ author?: undefined;
151
+ text?: undefined;
152
+ 'title, community, flair'?: undefined;
153
+ media?: undefined;
154
+ time?: undefined;
155
+ metrics?: undefined;
156
+ url?: undefined;
157
+ src?: undefined;
158
+ aspect?: undefined;
159
+ 'title, caption, duration'?: undefined;
160
+ poster?: undefined;
161
+ 'author, metrics'?: undefined;
162
+ 'url, loop, muted'?: undefined;
163
+ items?: undefined;
164
+ columns?: undefined;
165
+ 'title, caption'?: undefined;
166
+ events?: undefined;
167
+ 'start, end'?: undefined;
168
+ status?: undefined;
169
+ 'url, attendees'?: undefined;
170
+ 'title, timezone'?: undefined;
171
+ };
172
+ })[];
173
+ export declare function parseCard(name: CardName, raw: string): {
174
+ data?: any;
175
+ error?: string;
176
+ };
177
+ /** Same lexer as validation, so fenced examples inside other fences are never treated as components. */
178
+ export declare function cardFences(markdown: string): Array<{
179
+ name: CardName;
180
+ raw: string;
181
+ text: string;
182
+ }>;
183
+ export declare function renderCard(name: CardName, raw: string): string;
184
+ export declare function compactCount(value: number): string;
185
+ /** Marks a link the renderer emits for a card. Admitted by the sanitizer but not an author class, so `artifacts check` rejects it in embedded HTML. */
186
+ export declare const CARD_LINK_CLASS = "card-link";
187
+ export declare const CARD_CLASSES: string[];
188
+ export declare const CARD_CSS = "\n.card-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}\n.card-avatar{flex:0 0 auto;border-radius:50%;object-fit:cover;background:var(--surface-alt)}\n.card-avatar-md{width:42px;height:42px}.card-avatar-sm{width:30px;height:30px}.card-avatar-xs{width:24px;height:24px;font-size:9.5px!important}\n.card-avatar-initials{display:inline-flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--accent) 16%,var(--surface));color:var(--accent);font:650 13px/1 var(--font-body);letter-spacing:.02em}\n.card-avatar-sm.card-avatar-initials{font-size:11px}\n.card-icon{width:17px;height:17px;flex:0 0 auto}\n.card-verified{display:inline-block;width:16px;height:16px;margin-left:4px;vertical-align:-3px}\n.card-platform{width:18px;height:18px;flex:0 0 auto;margin-left:auto;color:var(--text);opacity:.75}\n.card-entity{color:var(--accent)}\n.card-dot{margin:0 5px;opacity:.6}\nimg.card-zoom{cursor:zoom-in}\n.artifact-post{max-width:560px;margin:var(--figure-spacing) 0;border:1px solid var(--line);border-radius:16px;background:var(--surface);padding:16px 18px 12px;color:var(--text);font-size:15.5px;line-height:1.5}\n.post-head{display:flex;align-items:center;gap:11px;min-width:0}\n.post-ident{display:flex;flex-direction:column;min-width:0;line-height:1.3}\n.post-name{font-weight:700;overflow-wrap:anywhere}\n.post-sub,.post-meta{color:var(--muted);font-size:13.5px;overflow-wrap:anywhere}\n.post-meta strong{color:var(--text)}\n.post-text{margin:12px 0 0;white-space:normal;overflow-wrap:anywhere}\n.post-text a{color:var(--accent)}\n.post-title{margin:8px 0 0;font-size:19px;line-height:1.3}\n.post-flair{display:inline-block;margin-top:10px;padding:1px 9px;border-radius:999px;background:var(--surface-alt);border:1px solid var(--line);color:var(--muted);font-size:12px;font-weight:600}\n.post-media{display:grid;gap:2px;margin-top:12px;border:1px solid var(--line);border-radius:14px;overflow:hidden;grid-template-columns:1fr 1fr}\n.post-tile{position:relative;min-height:0;background:var(--surface-alt)}\n.post-tile img,.post-tile video{display:block;width:100%;height:100%;object-fit:cover;margin:0}\n.post-media-1{grid-template-columns:1fr}.post-media-1 .post-tile img,.post-media-1 .post-tile video{height:auto;max-height:520px}\n.post-media-2{aspect-ratio:16/9}.post-media-3{aspect-ratio:16/9;grid-template-rows:1fr 1fr}.post-media-3 .post-tile:first-child{grid-row:span 2}\n.post-media-4{aspect-ratio:16/9;grid-template-rows:1fr 1fr}\n.post-carousel{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;margin:12px -18px 0;scrollbar-width:none;aspect-ratio:1/1;background:var(--surface-alt)}\n.post-carousel::-webkit-scrollbar{display:none}\n.post-slide{flex:0 0 100%;scroll-snap-align:center}\n.post-slide img,.post-slide video{display:block;width:100%;height:100%;object-fit:cover;margin:0}\n.post-dots{display:flex;justify-content:center;gap:5px;margin-top:9px}\n.post-dots span{width:6px;height:6px;border-radius:50%;background:var(--line);transition:background .15s}\n.post-dots span.is-active{background:var(--accent)}\n.post-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-top:10px;padding-top:2px}\n.post-metrics{display:flex;flex-wrap:wrap;gap:4px 22px;list-style:none;margin:0;padding:0;color:var(--muted);font-size:13.5px;font-variant-numeric:tabular-nums}\n.post-metrics li{display:inline-flex;align-items:center;gap:6px;margin:0}\n.post-metrics-pills{gap:8px}.post-metrics-pills li{padding:4px 11px;border-radius:999px;background:var(--surface-alt)}\n.post-open{margin-left:auto;color:var(--muted);font-size:13px}\n.post-open:hover{color:var(--accent)}\n.post-instagram{padding-bottom:14px}.post-instagram .post-text{margin-top:8px;font-size:14.5px}\n.post-linkedin{border-radius:10px}\n.post-reddit{border-radius:12px}\n.artifact-video{margin:var(--figure-spacing) 0;min-width:0}\n.video-frame{position:relative;display:block;overflow:hidden;border-radius:var(--radius);border:1px solid var(--line);background:#000}\n.video-frame video,.video-frame img{display:block;width:100%;height:100%;object-fit:contain;margin:0}\n.video-link img{object-fit:cover}\n.video-16x9{aspect-ratio:16/9}.video-4x3{aspect-ratio:4/3}.video-1x1{aspect-ratio:1/1;max-width:560px}.video-9x16{aspect-ratio:9/16}\n.card-play{position:absolute;left:50%;top:50%;width:64px;height:64px;transform:translate(-50%,-50%);transition:transform .15s}\n.video-link:hover .card-play{transform:translate(-50%,-50%) scale(1.08)}\n.artifact-video figcaption{margin-top:10px;color:var(--text)}\n.artifact-video figcaption p{margin:4px 0 0;color:var(--muted);font-size:14.5px}\n.video-heading{display:flex;align-items:baseline;gap:10px}\n.video-length{color:var(--muted);font:500 12px/1 var(--font-mono)}\n.video-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-top:8px}\n.video-reel{display:flex;flex-direction:column;align-items:center}\n.reel-stage{position:relative;width:min(340px,100%)}\n.reel-stage .video-frame{border-radius:22px;border:1px solid var(--line)}\n.reel-stage video{object-fit:cover}\n.reel-play{display:none;pointer-events:none;width:72px;height:72px}\n.reel-scripted .reel-play{display:block;z-index:1}.reel-scripted.is-playing .reel-play{opacity:0}\n.reel-scripted video{cursor:pointer}\n.reel-scripted video:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}\n.reel-stage{isolation:isolate}\n.reel-overlay{position:absolute;z-index:1;left:1px;right:1px;bottom:1px;padding:72px 64px 28px 16px;border-radius:0 0 21px 21px;background:linear-gradient(transparent,rgba(0,0,0,.62));color:#fff;pointer-events:none;text-shadow:0 1px 3px rgba(0,0,0,.6);font-size:14px;line-height:1.4}\n.reel-overlay a{pointer-events:auto;color:#fff;text-decoration:underline}\n.reel-overlay p{margin:6px 0 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}\n.reel-overlay .card-entity{color:#fff;font-weight:650}\n.reel-author{display:flex;align-items:center;gap:8px;font-size:14px}\n.reel-author .card-avatar{border:1.5px solid #fff}\n.reel-title{display:block;margin-top:6px}\n.reel-rail{position:absolute;z-index:2;right:10px;bottom:64px;display:flex;flex-direction:column;gap:14px;list-style:none;margin:0;padding:0;color:#fff;font:650 12px/1 var(--font-body);text-shadow:0 1px 3px rgba(0,0,0,.6);pointer-events:none}\n.reel-rail li{display:flex;flex-direction:column;align-items:center;gap:4px;margin:0}\n.reel-rail .card-icon{width:26px;height:26px;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5))}\n.video-duration{position:absolute;top:12px;right:12px;padding:3px 7px;border-radius:6px;background:rgba(0,0,0,.6);color:#fff;font:600 11px/1 var(--font-mono)}\n.video-reel figcaption{margin-top:8px}\n.artifact-gallery{margin:var(--figure-spacing) 0;min-width:0}\n.artifact-gallery figcaption{margin-bottom:12px}\n.artifact-gallery figcaption strong{font-size:17px}\n.artifact-gallery figcaption p{margin:4px 0 0;color:var(--muted);font-size:14.5px}\n.gallery-items{list-style:none;margin:0;padding:0}\n.gallery-item{position:relative;margin:0;overflow:hidden;border-radius:var(--radius);border:1px solid var(--line);background:var(--surface-alt)}\n.gallery-item img,.gallery-item video{display:block;width:100%;margin:0;transition:transform .25s ease}\n.gallery-item:hover img{transform:scale(1.03)}\n.gallery-caption{display:block;padding:7px 10px;background:var(--surface);border-top:1px solid var(--line);color:var(--muted);font-size:13px;line-height:1.4}\n.gallery-grid .gallery-items{display:grid;gap:10px}\n.gallery-grid.gallery-cols-2 .gallery-items{grid-template-columns:repeat(2,minmax(0,1fr))}\n.gallery-grid.gallery-cols-3 .gallery-items{grid-template-columns:repeat(3,minmax(0,1fr))}\n.gallery-grid.gallery-cols-4 .gallery-items{grid-template-columns:repeat(4,minmax(0,1fr))}\n.gallery-grid .gallery-item img,.gallery-grid .gallery-item video{aspect-ratio:1/1;object-fit:cover;height:auto}\n.gallery-masonry .gallery-items{column-gap:10px}\n.gallery-masonry.gallery-cols-2 .gallery-items{columns:2}.gallery-masonry.gallery-cols-3 .gallery-items{columns:3}.gallery-masonry.gallery-cols-4 .gallery-items{columns:4}\n.gallery-masonry .gallery-item{break-inside:avoid;margin-bottom:10px}\n.gallery-masonry .gallery-item img,.gallery-masonry .gallery-item video{height:auto}\n.gallery-carousel .gallery-items{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:8px;scrollbar-width:thin}\n.gallery-carousel .gallery-item{flex:0 0 min(78%,420px);scroll-snap-align:start}\n.gallery-carousel .gallery-item img,.gallery-carousel .gallery-item video{aspect-ratio:4/3;object-fit:cover;height:auto}\n.artifact-events{margin:var(--figure-spacing) 0;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);overflow:hidden}\n.artifact-events figcaption{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:14px 18px;border-bottom:1px solid var(--line)}\n.artifact-events figcaption strong{font-size:17px}\n.events-zone{margin-left:auto;color:var(--muted);font:500 11.5px/1.4 var(--font-mono)}\n.events-days,.events-list{list-style:none;margin:0;padding:0}\n.events-day{display:grid;grid-template-columns:64px minmax(0,1fr);gap:4px;margin:0;padding:14px 18px 14px 12px}\n.events-day+.events-day{border-top:1px solid var(--line)}\n.events-date{display:flex;flex-direction:column;align-items:center;padding-top:2px;line-height:1.1}\n.events-dow,.events-mon{color:var(--muted);font:600 10.5px/1.2 var(--font-mono);text-transform:uppercase;letter-spacing:.1em}\n.events-dom{font:650 26px/1.1 var(--font-display);margin:2px 0}\n.events-list{display:grid;gap:8px}\n.events-item{display:grid;grid-template-columns:84px minmax(0,1fr) auto;align-items:start;gap:12px;margin:0;padding:9px 12px;border-radius:8px;background:color-mix(in srgb,var(--accent) 7%,var(--surface));border-left:3px solid var(--accent)}\n.events-tentative{background:var(--surface);border:1px dashed color-mix(in srgb,var(--warn) 60%,var(--line));border-left:3px dashed var(--warn)}\n.events-cancelled{background:var(--surface-alt);border-left-color:var(--line);opacity:.75}\n.events-cancelled .events-title{text-decoration:line-through;text-decoration-color:var(--muted)}\n.events-time{display:flex;flex-direction:column;color:var(--text);font:600 12.5px/1.45 var(--font-mono);font-variant-numeric:tabular-nums}\n.events-until{color:var(--muted);font-weight:500}\n.events-body{display:flex;flex-direction:column;gap:3px;min-width:0}\n.events-title{font-size:15px;line-height:1.35;overflow-wrap:anywhere}\n.events-meta{display:flex;flex-wrap:wrap;gap:2px 14px;color:var(--muted);font-size:13px}\n.events-meta>span{display:inline-flex;align-items:center;gap:4px}\n.events-meta .card-icon{width:14px;height:14px}\n.events-status{text-transform:uppercase;font:600 10.5px/1.4 var(--font-mono);letter-spacing:.08em;color:var(--warn)}\n.events-cancelled .events-status{color:var(--muted)}\n.events-desc{color:var(--muted);font-size:13.5px}\n.events-people{display:flex;align-items:center;margin-top:4px}\n.events-people .card-avatar{border:2px solid var(--surface);margin-right:-6px}\n.events-more{margin-left:12px;color:var(--muted);font:500 11.5px/1 var(--font-mono)}\n.events-join{align-self:center;padding:5px 12px;border-radius:999px;border:1px solid var(--accent);color:var(--accent);font:600 12px/1 var(--font-body);white-space:nowrap}\n.events-join:hover{background:var(--accent);color:var(--surface);text-decoration:none}\n.artifact-link-card{display:flex;max-width:640px;margin:var(--figure-spacing) 0;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--text);overflow:hidden;text-decoration:none;transition:border-color .12s ease}\n.artifact-link-card:hover{border-color:var(--accent);text-decoration:none}\n.artifact-link-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}\n.link-body{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1;padding:14px 16px}\n.link-site{color:var(--muted);font:500 11px/1.4 var(--font-mono);text-transform:uppercase;letter-spacing:.1em}\n.link-title{font-size:16px;line-height:1.35;overflow-wrap:anywhere}\n.link-desc{color:var(--muted);font-size:14px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}\n.link-url{display:inline-flex;align-items:center;gap:5px;margin-top:2px;color:var(--accent);font-size:12.5px}\n.link-url .card-icon{width:13px;height:13px}\n.link-compact .link-image{flex:0 0 31%;max-width:200px;width:31%;object-fit:cover;margin:0;border-left:1px solid var(--line)}\n.link-large{flex-direction:column}\n.link-large .link-image{width:100%;aspect-ratio:1.91/1;object-fit:cover;margin:0;border-bottom:1px solid var(--line)}\n.card-lightbox{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;padding:56px 64px;background:rgba(5,7,12,.92);color:#fff}\n.card-lightbox[hidden]{display:none}\n.card-lightbox img,.card-lightbox video{max-width:100%;max-height:calc(100vh - 140px);object-fit:contain;border-radius:6px;margin:0}\n.card-lightbox p{margin:0;max-width:72ch;text-align:center;font-size:14px;color:#d7dbe6}\n.card-lightbox button{position:absolute;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:1px solid rgba(255,255,255,.25);border-radius:50%;background:rgba(255,255,255,.08);color:#fff;font:400 22px/1 var(--font-body);cursor:pointer}\n.card-lightbox button:hover{background:rgba(255,255,255,.2)}\n.card-lightbox button:focus-visible{outline:2px solid #fff;outline-offset:2px}\n.card-lightbox .lb-close{top:14px;right:14px}.card-lightbox .lb-prev{left:12px;top:50%}.card-lightbox .lb-next{right:12px;top:50%}\n.card-lightbox .lb-count{position:absolute;top:24px;left:20px;font:500 12px/1 var(--font-mono);color:#aab1c2}\n@media(max-width:600px){\n.artifact-post{padding:14px 14px 10px;border-radius:14px}.post-carousel{margin:12px -14px 0}\n.gallery-grid.gallery-cols-3 .gallery-items,.gallery-grid.gallery-cols-4 .gallery-items{grid-template-columns:repeat(2,minmax(0,1fr))}\n.gallery-masonry.gallery-cols-3 .gallery-items,.gallery-masonry.gallery-cols-4 .gallery-items{columns:2}\n.events-day{grid-template-columns:44px minmax(0,1fr);padding:12px 12px 12px 6px}.events-dom{font-size:21px}\n.events-item{grid-template-columns:minmax(0,1fr) auto;gap:4px 10px}.events-time{flex-direction:row;gap:6px;grid-column:1/-1}.events-until::before{content:\"\u2013 \"}\n.link-compact .link-image{flex-basis:28%}\n.card-lightbox{padding:56px 8px}.card-lightbox .lb-prev,.card-lightbox .lb-next{top:auto;bottom:14px}\n}\n@media(prefers-reduced-motion:reduce){.gallery-item img,.card-play,.post-dots span{transition:none}.gallery-item:hover img{transform:none}}\n@media print{.card-lightbox{display:none!important}.post-carousel{flex-wrap:wrap;overflow:visible;aspect-ratio:auto}.post-slide{flex-basis:50%}.gallery-carousel .gallery-items{flex-wrap:wrap;overflow:visible}}\n";
189
+ /**
190
+ * One lightbox for every zoomable image or clip on the page, grouped by the
191
+ * component it sits in so arrow keys stay inside one gallery or post. The page
192
+ * builds its own controls: the body sanitizer admits none. Focus returns to the
193
+ * item that opened it.
194
+ */
195
+ export declare const CARD_SCRIPT = "<script>(()=>{\nconst groups=new Map();\ndocument.querySelectorAll('.card-zoom').forEach(el=>{\n const host=el.closest('.artifact-gallery,.artifact-post');if(!host)return;\n if(el.tagName==='VIDEO')return;\n if(!groups.has(host))groups.set(host,[]);groups.get(host).push(el);\n el.tabIndex=0;el.setAttribute('role','button');el.setAttribute('aria-label','Open '+(el.alt||'image')+' full screen');\n});\ndocument.querySelectorAll('.post-carousel').forEach(track=>{const dots=[...track.nextElementSibling?.children||[]];if(!dots.length)return;const sync=()=>{const i=Math.round(track.scrollLeft/Math.max(1,track.clientWidth));dots.forEach((d,j)=>d.classList.toggle('is-active',i===j));};track.addEventListener('scroll',sync,{passive:true});sync();});\n// A reel plays on tap like the platforms do; native controls would sit under its caption. Without scripts it keeps them.\ndocument.querySelectorAll('.reel-stage').forEach(stage=>{const v=stage.querySelector('video');if(!v)return;v.controls=false;v.tabIndex=0;v.setAttribute('role','button');stage.classList.add('reel-scripted');\n const sync=()=>{stage.classList.toggle('is-playing',!v.paused);v.setAttribute('aria-label',(v.paused?'Play ':'Pause ')+(v.dataset.label||(v.dataset.label=v.getAttribute('aria-label')||'video')));};\n const toggle=()=>{if(v.paused)v.play()?.catch(()=>{});else v.pause();};v.addEventListener('click',toggle);v.addEventListener('keydown',e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();toggle();}});v.addEventListener('play',sync);v.addEventListener('pause',sync);sync();});\nif(!groups.size)return;\nconst box=document.createElement('div');box.className='card-lightbox';box.hidden=true;box.setAttribute('role','dialog');box.setAttribute('aria-modal','true');box.setAttribute('aria-label','Media viewer');\nconst btn=(cls,label,text)=>{const b=document.createElement('button');b.type='button';b.className=cls;b.setAttribute('aria-label',label);b.textContent=text;box.append(b);return b;};\nconst count=document.createElement('span');count.className='lb-count';box.append(count);\nconst stage=document.createElement('div');const caption=document.createElement('p');box.append(stage,caption);\nconst close=btn('lb-close','Close','\\u00d7'),prev=btn('lb-prev','Previous','\\u2039'),next=btn('lb-next','Next','\\u203a');\ndocument.body.append(box);\nlet list=[],at=0,opener=null;\nconst captionOf=el=>el.closest('.gallery-item')?.querySelector('.gallery-caption')?.textContent||el.getAttribute('alt')||el.getAttribute('aria-label')||'';\nconst show=i=>{at=(i+list.length)%list.length;const src=list[at];const copy=src.tagName==='VIDEO'?Object.assign(document.createElement('video'),{src:src.currentSrc||src.src,controls:true,autoplay:true,playsInline:true,poster:src.poster||''}):Object.assign(document.createElement('img'),{src:src.currentSrc||src.src,alt:src.alt||''});stage.replaceChildren(copy);caption.textContent=captionOf(src);caption.hidden=!caption.textContent;count.textContent=list.length>1?(at+1)+' / '+list.length:'';prev.hidden=next.hidden=list.length<2;};\nconst rest=()=>[...document.body.children].filter(el=>el!==box);\nconst open=el=>{list=groups.get(el.closest('.artifact-gallery,.artifact-post'))||[el];opener=el;show(list.indexOf(el));box.hidden=false;rest().forEach(el=>el.inert=true);document.documentElement.style.overflow='hidden';close.focus();};\nconst shut=()=>{box.hidden=true;stage.replaceChildren();rest().forEach(el=>el.inert=false);document.documentElement.style.overflow='';opener?.focus();};\ndocument.addEventListener('click',e=>{const el=e.target.closest?.('.card-zoom');if(el&&el.tagName!=='VIDEO'&&groups.size){e.preventDefault();open(el);}});\ndocument.addEventListener('keydown',e=>{if(box.hidden){const el=e.target.closest?.('.card-zoom');if(el&&el.tagName!=='VIDEO'&&(e.key==='Enter'||e.key===' ')){e.preventDefault();open(el);}return;}\n if(e.key==='Escape')shut();else if(e.target.tagName==='VIDEO'&&e.key.startsWith('Arrow'))return;else if(e.key==='ArrowRight')show(at+1);else if(e.key==='ArrowLeft')show(at-1);\n else if(e.key==='Tab'){const f=[...box.querySelectorAll('button:not([hidden]),video')];const i=f.indexOf(document.activeElement);if(e.shiftKey&&i<=0){e.preventDefault();f[f.length-1].focus();}else if(!e.shiftKey&&i===f.length-1){e.preventDefault();f[0].focus();}}});\nclose.addEventListener('click',shut);prev.addEventListener('click',()=>show(at-1));next.addEventListener('click',()=>show(at+1));\nbox.addEventListener('click',e=>{if(e.target===box||e.target===stage)shut();});\n})();</script>";