stack-site-builder 1.25.2 → 1.25.4
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 +44 -0
- package/package.json +1 -1
- package/src/components/DeckView.astro +49 -15
- package/src/styles/global.css +17 -6
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,46 @@ 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.4] - 2026-09-02
|
|
15
|
+
|
|
16
|
+
Print/PDF export of a deck now reproduces what the screen shows: images load
|
|
17
|
+
before the dialog opens, and nothing that fit on screen gets clipped.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **Lazy images printed as empty boxes.** Slides never scrolled into view had
|
|
22
|
+
not fetched their `loading="lazy"` images, so the PDF showed blank
|
|
23
|
+
placeholders — and the unsized box could inflate and push the rest of the
|
|
24
|
+
slide off the page. The print button now flips every deck image to eager,
|
|
25
|
+
waits (capped at 5s) for them to decode, then opens the dialog. A
|
|
26
|
+
`beforeprint` fallback covers Cmd/Ctrl+P: it reveals all steps and starts
|
|
27
|
+
the image loads, though only the button can await them.
|
|
28
|
+
- **Code blocks clipped at the PDF's right edge.** The print page was the
|
|
29
|
+
PowerPoint 13.333in × 7.5in; rem-based type (code, `clamp()` caps) does not
|
|
30
|
+
shrink with the page, so it ate proportionally more width than on the
|
|
31
|
+
desktop windows slides are authored against, and `overflow: auto` boxes
|
|
32
|
+
cannot scroll on paper. The page is now 18in × 10.125in (1728 × 972 CSS
|
|
33
|
+
px) — same 16:9, but big enough that every `clamp()` saturates at its rem
|
|
34
|
+
cap and the content column hits its 96rem cap (now applied in print too),
|
|
35
|
+
the same saturated state as a full-size desktop monitor. The PDF reproduces
|
|
36
|
+
what the author saw; paper printing shrinks to fit.
|
|
37
|
+
|
|
38
|
+
## [1.25.3] - 2026-09-01
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- **A slide's own content could be mistaken for the deck's chrome.** The deck
|
|
43
|
+
marks its pager, progress bar, TOC and menu with short `data-*` names
|
|
44
|
+
(`data-total`, `data-current`, `data-next` …) and looked each one up with
|
|
45
|
+
`document.querySelector`, which returns whichever comes first in the
|
|
46
|
+
document — and a slide comes before the pager. A site component sitting in a
|
|
47
|
+
slide that used any of those names was found instead, so a stepping demo
|
|
48
|
+
carrying `data-total` had its entire subtree replaced by the slide count and
|
|
49
|
+
the pager then read `1 / 1`. Chrome lookups now skip anything inside
|
|
50
|
+
`.aas-slide`: slide content is never chrome. The `sample-layouts` deck gained
|
|
51
|
+
a slide that deliberately carries four of those attributes so the collision
|
|
52
|
+
stays covered.
|
|
53
|
+
|
|
14
54
|
## [1.25.2] - 2026-08-31
|
|
15
55
|
|
|
16
56
|
### Fixed
|
|
@@ -598,6 +638,10 @@ catalog sites from a thin content-only repository.
|
|
|
598
638
|
- **Standalone development setup** — a devcontainer and a minimal `playground/`
|
|
599
639
|
consuming site for developing and previewing the theme on its own.
|
|
600
640
|
|
|
641
|
+
[1.25.4]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.3...v1.25.4
|
|
642
|
+
[1.25.3]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.2...v1.25.3
|
|
643
|
+
[1.25.2]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.1...v1.25.2
|
|
644
|
+
[1.25.1]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.25.0...v1.25.1
|
|
601
645
|
[1.25.0]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.24.0...v1.25.0
|
|
602
646
|
[1.24.0]: https://github.com/CodeComposeStudio/stack-site-builder/compare/v1.23.2...v1.24.0
|
|
603
647
|
[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.4",
|
|
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": {
|
|
@@ -164,6 +164,19 @@ const priv = entry.data.private;
|
|
|
164
164
|
// encrypted payload, so this no-ops at load and runs after decryption.
|
|
165
165
|
initOnReady(() => {
|
|
166
166
|
const deck = document.querySelector<HTMLElement>('[data-deck]');
|
|
167
|
+
// The chrome marks itself with short data-* names (data-total, data-next,
|
|
168
|
+
// data-progress …), and a site's own component sitting inside a slide may
|
|
169
|
+
// reasonably use the same one — a stepping demo carrying `data-total` had
|
|
170
|
+
// its entire subtree replaced by the slide count, because
|
|
171
|
+
// document.querySelector returns whichever comes first in the document
|
|
172
|
+
// and the slide comes before the pager. Chrome lookups therefore skip
|
|
173
|
+
// anything inside a slide: slide content is never chrome.
|
|
174
|
+
const chrome = <T extends Element>(sel: string): T | null => {
|
|
175
|
+
for (const el of Array.from(document.querySelectorAll<T>(sel))) {
|
|
176
|
+
if (!el.closest('.aas-slide')) return el;
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
};
|
|
167
180
|
if (deck && !deck.dataset.aasInit) {
|
|
168
181
|
deck.dataset.aasInit = '1';
|
|
169
182
|
// Animate slide changes unless the deck opts out (data-transition="none")
|
|
@@ -172,11 +185,11 @@ const priv = entry.data.private;
|
|
|
172
185
|
const animate = deck.dataset.transition !== 'none' && !reduceMotion;
|
|
173
186
|
const slides = Array.from(deck.querySelectorAll<HTMLElement>('.aas-slide'));
|
|
174
187
|
const total = slides.length;
|
|
175
|
-
const elCur =
|
|
176
|
-
const elTot =
|
|
177
|
-
const elFill =
|
|
178
|
-
const btnPrev =
|
|
179
|
-
const btnNext =
|
|
188
|
+
const elCur = chrome<HTMLElement>('[data-current]');
|
|
189
|
+
const elTot = chrome<HTMLElement>('[data-total]');
|
|
190
|
+
const elFill = chrome<HTMLElement>('[data-progress]');
|
|
191
|
+
const btnPrev = chrome<HTMLButtonElement>('[data-prev]');
|
|
192
|
+
const btnNext = chrome<HTMLButtonElement>('[data-next]');
|
|
180
193
|
if (elTot) elTot.textContent = String(total);
|
|
181
194
|
|
|
182
195
|
// Heavy embeds (interactive demo iframes) jank slide transitions the
|
|
@@ -416,9 +429,9 @@ const priv = entry.data.private;
|
|
|
416
429
|
// Collect headings h2..h{toc_level} from slides not marked data-no-toc,
|
|
417
430
|
// each linking to the slide it lives on. Reveal the top-right control
|
|
418
431
|
// only if there's at least one entry.
|
|
419
|
-
const tocRoot =
|
|
420
|
-
const tocPanel =
|
|
421
|
-
const tocToggle =
|
|
432
|
+
const tocRoot = chrome<HTMLElement>('[data-toc-root]');
|
|
433
|
+
const tocPanel = chrome<HTMLElement>('[data-toc-panel]');
|
|
434
|
+
const tocToggle = chrome<HTMLButtonElement>('[data-toc-toggle]');
|
|
422
435
|
const closeToc = () => {
|
|
423
436
|
if (tocPanel) tocPanel.hidden = true;
|
|
424
437
|
tocToggle?.setAttribute('aria-expanded', 'false');
|
|
@@ -461,10 +474,21 @@ const priv = entry.data.private;
|
|
|
461
474
|
}
|
|
462
475
|
}
|
|
463
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
|
+
|
|
464
488
|
// Actions menu (top-left): print/PDF and fullscreen.
|
|
465
|
-
const menuRoot =
|
|
466
|
-
const menuPanel =
|
|
467
|
-
const menuToggle =
|
|
489
|
+
const menuRoot = chrome<HTMLElement>('[data-menu-root]');
|
|
490
|
+
const menuPanel = chrome<HTMLElement>('[data-menu-panel]');
|
|
491
|
+
const menuToggle = chrome<HTMLButtonElement>('[data-menu-toggle]');
|
|
468
492
|
if (menuRoot && menuPanel && menuToggle) {
|
|
469
493
|
const closeMenu = () => {
|
|
470
494
|
menuRoot.classList.remove('is-open');
|
|
@@ -478,10 +502,20 @@ const priv = entry.data.private;
|
|
|
478
502
|
});
|
|
479
503
|
// The drawer stays open until the tab is toggled again — an outside
|
|
480
504
|
// click must not close it (same as the TOC panel).
|
|
481
|
-
menuPanel.querySelector('[data-action="print"]')?.addEventListener('click', () => {
|
|
505
|
+
menuPanel.querySelector('[data-action="print"]')?.addEventListener('click', async () => {
|
|
482
506
|
closeMenu();
|
|
483
507
|
// Reveal every step so nothing is hidden in the PDF.
|
|
484
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
|
+
]);
|
|
485
519
|
window.print();
|
|
486
520
|
});
|
|
487
521
|
menuPanel.querySelector('[data-action="fullscreen"]')?.addEventListener('click', () => {
|
|
@@ -574,8 +608,8 @@ const priv = entry.data.private;
|
|
|
574
608
|
// Zoom / lightbox: enlarge a diagram or image in an overlay. Diagrams get
|
|
575
609
|
// a button inside their (.aas-diagram) box; images are wrapped so the
|
|
576
610
|
// button can sit in the corner. Clicking the media works too.
|
|
577
|
-
const zoom =
|
|
578
|
-
const zoomStage =
|
|
611
|
+
const zoom = chrome<HTMLElement>('[data-zoom]');
|
|
612
|
+
const zoomStage = chrome<HTMLElement>('[data-zoom-stage]');
|
|
579
613
|
if (zoom && zoomStage) {
|
|
580
614
|
const zoomLabel = zoom.dataset.zoomLabel || 'Enlarge';
|
|
581
615
|
let zoomOpen = false;
|
|
@@ -744,7 +778,7 @@ const priv = entry.data.private;
|
|
|
744
778
|
|
|
745
779
|
// Overview grid (press `o`): scaled thumbnails of every slide; click one
|
|
746
780
|
// to jump there. Built lazily and rebuilt when the viewport changes.
|
|
747
|
-
const ov =
|
|
781
|
+
const ov = chrome<HTMLElement>('[data-ov]');
|
|
748
782
|
let ovOpen = false;
|
|
749
783
|
const buildOv = () => {
|
|
750
784
|
if (!ov) return;
|
package/src/styles/global.css
CHANGED
|
@@ -2350,9 +2350,18 @@ 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 18in × 10.125in (1728 × 972 CSS px) rather than the
|
|
2354
|
+
PowerPoint 13.333in: rem-based type (code blocks, clamp() caps) does not
|
|
2355
|
+
shrink with the page, so on a smaller page it eats proportionally more
|
|
2356
|
+
width than on the desktop windows slides are authored against — and code
|
|
2357
|
+
that fit on screen came out clipped at the right edge of the PDF. This
|
|
2358
|
+
page is big enough that every clamp() saturates at its rem cap and the
|
|
2359
|
+
content column below hits its 96rem cap — the same saturated state as a
|
|
2360
|
+
full-size desktop monitor, so the PDF reproduces what the author saw.
|
|
2361
|
+
PDF pages are vector; the physical inches are irrelevant on screen and
|
|
2362
|
+
shrink-to-fit when printed on paper. */
|
|
2354
2363
|
@page {
|
|
2355
|
-
size:
|
|
2364
|
+
size: 18in 10.125in;
|
|
2356
2365
|
margin: 0;
|
|
2357
2366
|
}
|
|
2358
2367
|
.aas-deck-body {
|
|
@@ -2379,8 +2388,8 @@ summary {
|
|
|
2379
2388
|
scroll-snap-type: none;
|
|
2380
2389
|
}
|
|
2381
2390
|
.aas-slide {
|
|
2382
|
-
width:
|
|
2383
|
-
height:
|
|
2391
|
+
width: 18in;
|
|
2392
|
+
height: 10.125in;
|
|
2384
2393
|
overflow: hidden;
|
|
2385
2394
|
scroll-snap-align: none;
|
|
2386
2395
|
break-inside: avoid;
|
|
@@ -2388,9 +2397,11 @@ summary {
|
|
|
2388
2397
|
.aas-slide:not(:last-child) {
|
|
2389
2398
|
break-after: page;
|
|
2390
2399
|
}
|
|
2391
|
-
/* Fixed page size, so don't derive the content width from viewport units
|
|
2400
|
+
/* Fixed page size, so don't derive the content width from viewport units —
|
|
2401
|
+
but keep the same 96rem cap the screen layout has, so the column is
|
|
2402
|
+
exactly as wide as on a large desktop window, no wider. */
|
|
2392
2403
|
.aas-slide-inner {
|
|
2393
|
-
max-width: 92
|
|
2404
|
+
max-width: min(96rem, 92%);
|
|
2394
2405
|
}
|
|
2395
2406
|
}
|
|
2396
2407
|
|