stack-site-builder 1.25.3 → 1.25.5
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 +43 -0
- package/package.json +1 -1
- package/src/components/DeckView.astro +22 -1
- package/src/styles/global.css +22 -6
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,44 @@ content schema, while a consuming site supplies only content, taxonomy data and
|
|
|
11
11
|
config. Sites track the theme with `pnpm up stack-site-builder`, so each release
|
|
12
12
|
here is a plain version bump they pull in.
|
|
13
13
|
|
|
14
|
+
## [1.25.5] - 2026-09-02
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **A slide's last line could be sliced off at the bottom of the PDF page.**
|
|
19
|
+
1.25.4 sized the print page so *width*-relative proportions match a large
|
|
20
|
+
desktop window, but the vertical axis has the same failure mode: rem-capped
|
|
21
|
+
text keeps its screen size while viewport-height media (a screenshot capped
|
|
22
|
+
at `58vh`, say) shrinks with the page, so on a 972px-tall page their sum
|
|
23
|
+
could exceed the slide and the caption under an image lost its last line.
|
|
24
|
+
The page is now 24in × 13.5in (2304 × 1296 CSS px) — still 16:9, but taller
|
|
25
|
+
than the viewports decks are authored in, so every slide gets at least the
|
|
26
|
+
vertical room it had on screen.
|
|
27
|
+
|
|
28
|
+
## [1.25.4] - 2026-09-02
|
|
29
|
+
|
|
30
|
+
Print/PDF export of a deck now reproduces what the screen shows: images load
|
|
31
|
+
before the dialog opens, and nothing that fit on screen gets clipped.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **Lazy images printed as empty boxes.** Slides never scrolled into view had
|
|
36
|
+
not fetched their `loading="lazy"` images, so the PDF showed blank
|
|
37
|
+
placeholders — and the unsized box could inflate and push the rest of the
|
|
38
|
+
slide off the page. The print button now flips every deck image to eager,
|
|
39
|
+
waits (capped at 5s) for them to decode, then opens the dialog. A
|
|
40
|
+
`beforeprint` fallback covers Cmd/Ctrl+P: it reveals all steps and starts
|
|
41
|
+
the image loads, though only the button can await them.
|
|
42
|
+
- **Code blocks clipped at the PDF's right edge.** The print page was the
|
|
43
|
+
PowerPoint 13.333in × 7.5in; rem-based type (code, `clamp()` caps) does not
|
|
44
|
+
shrink with the page, so it ate proportionally more width than on the
|
|
45
|
+
desktop windows slides are authored against, and `overflow: auto` boxes
|
|
46
|
+
cannot scroll on paper. The page is now 18in × 10.125in (1728 × 972 CSS
|
|
47
|
+
px) — same 16:9, but big enough that every `clamp()` saturates at its rem
|
|
48
|
+
cap and the content column hits its 96rem cap (now applied in print too),
|
|
49
|
+
the same saturated state as a full-size desktop monitor. The PDF reproduces
|
|
50
|
+
what the author saw; paper printing shrinks to fit.
|
|
51
|
+
|
|
14
52
|
## [1.25.3] - 2026-09-01
|
|
15
53
|
|
|
16
54
|
### Fixed
|
|
@@ -614,6 +652,11 @@ catalog sites from a thin content-only repository.
|
|
|
614
652
|
- **Standalone development setup** — a devcontainer and a minimal `playground/`
|
|
615
653
|
consuming site for developing and previewing the theme on its own.
|
|
616
654
|
|
|
655
|
+
[1.25.5]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.4...v1.25.5
|
|
656
|
+
[1.25.4]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.3...v1.25.4
|
|
657
|
+
[1.25.3]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.2...v1.25.3
|
|
658
|
+
[1.25.2]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.1...v1.25.2
|
|
659
|
+
[1.25.1]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.0...v1.25.1
|
|
617
660
|
[1.25.0]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.24.0...v1.25.0
|
|
618
661
|
[1.24.0]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.23.2...v1.24.0
|
|
619
662
|
[1.23.2]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.23.1...v1.23.2
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stack-site-builder",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.25.
|
|
4
|
+
"version": "1.25.5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The engine behind the awesome-*-stack catalog sites: an Astro theme with the catalog/concepts/articles/slides/samples routes, components, styles and markdown pipeline. Sites provide content, taxonomy data and config.",
|
|
7
7
|
"repository": {
|
|
@@ -474,6 +474,17 @@ const priv = entry.data.private;
|
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
+
// Cmd/Ctrl+P bypasses the print button: reveal every step and kick off
|
|
478
|
+
// the lazy-image loads here too. This handler cannot await, so a very
|
|
479
|
+
// first Cmd+P may still catch an image mid-flight — the button is the
|
|
480
|
+
// reliable path — but the loads it starts survive for a reprint.
|
|
481
|
+
window.addEventListener('beforeprint', () => {
|
|
482
|
+
slides.forEach((_, i) => revealAllSteps(i));
|
|
483
|
+
deck
|
|
484
|
+
.querySelectorAll<HTMLImageElement>('img[loading="lazy"]')
|
|
485
|
+
.forEach((img) => (img.loading = 'eager'));
|
|
486
|
+
});
|
|
487
|
+
|
|
477
488
|
// Actions menu (top-left): print/PDF and fullscreen.
|
|
478
489
|
const menuRoot = chrome<HTMLElement>('[data-menu-root]');
|
|
479
490
|
const menuPanel = chrome<HTMLElement>('[data-menu-panel]');
|
|
@@ -491,10 +502,20 @@ const priv = entry.data.private;
|
|
|
491
502
|
});
|
|
492
503
|
// The drawer stays open until the tab is toggled again — an outside
|
|
493
504
|
// click must not close it (same as the TOC panel).
|
|
494
|
-
menuPanel.querySelector('[data-action="print"]')?.addEventListener('click', () => {
|
|
505
|
+
menuPanel.querySelector('[data-action="print"]')?.addEventListener('click', async () => {
|
|
495
506
|
closeMenu();
|
|
496
507
|
// Reveal every step so nothing is hidden in the PDF.
|
|
497
508
|
slides.forEach((_, i) => revealAllSteps(i));
|
|
509
|
+
// Images on slides never scrolled into view are still lazy-unloaded
|
|
510
|
+
// and would print as empty placeholder boxes — worse, the unsized
|
|
511
|
+
// box can inflate and push the rest of the slide off the page. Load
|
|
512
|
+
// them first, with a time cap so a dead image can't block printing.
|
|
513
|
+
const lazy = Array.from(deck.querySelectorAll<HTMLImageElement>('img[loading="lazy"]'));
|
|
514
|
+
lazy.forEach((img) => (img.loading = 'eager'));
|
|
515
|
+
await Promise.race([
|
|
516
|
+
Promise.all(lazy.map((img) => img.decode().catch(() => undefined))),
|
|
517
|
+
new Promise((resolve) => setTimeout(resolve, 5000)),
|
|
518
|
+
]);
|
|
498
519
|
window.print();
|
|
499
520
|
});
|
|
500
521
|
menuPanel.querySelector('[data-action="fullscreen"]')?.addEventListener('click', () => {
|
package/src/styles/global.css
CHANGED
|
@@ -2350,9 +2350,23 @@ summary {
|
|
|
2350
2350
|
a stray extra page, and wide enough that image splits never stack. Enable
|
|
2351
2351
|
"Background graphics" in the print dialog for themed/image backgrounds. */
|
|
2352
2352
|
@media print {
|
|
2353
|
-
/*
|
|
2353
|
+
/* A 16:9 page, sized 24in × 13.5in (2304 × 1296 CSS px) rather than the
|
|
2354
|
+
PowerPoint 13.333in: rem-based type (titles, captions, code — every
|
|
2355
|
+
clamp() cap) does not shrink with the page, so on a smaller page it eats
|
|
2356
|
+
proportionally more room than on the desktop windows slides are authored
|
|
2357
|
+
against. Both axes matter. Width: code that fit on screen came out
|
|
2358
|
+
clipped at the PDF's right edge until the content column could reach the
|
|
2359
|
+
same 96rem cap it has on screen. Height: viewport-height media (a
|
|
2360
|
+
screenshot capped at 58vh, say) shrinks with the page while the fixed
|
|
2361
|
+
text around it does not, so their sum overflowed a shorter page and the
|
|
2362
|
+
caption's last line was sliced off. At 1296px the page is taller than
|
|
2363
|
+
the ~1200px viewports decks are authored in, giving every slide at least
|
|
2364
|
+
the vertical room it had on screen. Everything saturates at its rem cap —
|
|
2365
|
+
the same state as a large 16:9 monitor — so the PDF reproduces what the
|
|
2366
|
+
author saw. PDF pages are vector; the physical inches are irrelevant on
|
|
2367
|
+
screen and shrink-to-fit when printed on paper. */
|
|
2354
2368
|
@page {
|
|
2355
|
-
size: 13.
|
|
2369
|
+
size: 24in 13.5in;
|
|
2356
2370
|
margin: 0;
|
|
2357
2371
|
}
|
|
2358
2372
|
.aas-deck-body {
|
|
@@ -2379,8 +2393,8 @@ summary {
|
|
|
2379
2393
|
scroll-snap-type: none;
|
|
2380
2394
|
}
|
|
2381
2395
|
.aas-slide {
|
|
2382
|
-
width:
|
|
2383
|
-
height:
|
|
2396
|
+
width: 24in;
|
|
2397
|
+
height: 13.5in;
|
|
2384
2398
|
overflow: hidden;
|
|
2385
2399
|
scroll-snap-align: none;
|
|
2386
2400
|
break-inside: avoid;
|
|
@@ -2388,9 +2402,11 @@ summary {
|
|
|
2388
2402
|
.aas-slide:not(:last-child) {
|
|
2389
2403
|
break-after: page;
|
|
2390
2404
|
}
|
|
2391
|
-
/* Fixed page size, so don't derive the content width from viewport units
|
|
2405
|
+
/* Fixed page size, so don't derive the content width from viewport units —
|
|
2406
|
+
but keep the same 96rem cap the screen layout has, so the column is
|
|
2407
|
+
exactly as wide as on a large desktop window, no wider. */
|
|
2392
2408
|
.aas-slide-inner {
|
|
2393
|
-
max-width: 92
|
|
2409
|
+
max-width: min(96rem, 92%);
|
|
2394
2410
|
}
|
|
2395
2411
|
}
|
|
2396
2412
|
|