stack-site-builder 1.25.1 → 1.25.3
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 +28 -0
- package/package.json +1 -1
- package/src/components/DeckView.astro +27 -14
- package/src/styles/global.css +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,34 @@ 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.3] - 2026-09-01
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **A slide's own content could be mistaken for the deck's chrome.** The deck
|
|
19
|
+
marks its pager, progress bar, TOC and menu with short `data-*` names
|
|
20
|
+
(`data-total`, `data-current`, `data-next` …) and looked each one up with
|
|
21
|
+
`document.querySelector`, which returns whichever comes first in the
|
|
22
|
+
document — and a slide comes before the pager. A site component sitting in a
|
|
23
|
+
slide that used any of those names was found instead, so a stepping demo
|
|
24
|
+
carrying `data-total` had its entire subtree replaced by the slide count and
|
|
25
|
+
the pager then read `1 / 1`. Chrome lookups now skip anything inside
|
|
26
|
+
`.aas-slide`: slide content is never chrome. The `sample-layouts` deck gained
|
|
27
|
+
a slide that deliberately carries four of those attributes so the collision
|
|
28
|
+
stays covered.
|
|
29
|
+
|
|
30
|
+
## [1.25.2] - 2026-08-31
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **A display formula on a slide rendered at half the size of the text beside
|
|
35
|
+
it.** Inline math inherits the paragraph it sits in and so already scaled
|
|
36
|
+
with slide prose, but a display block is a direct child of
|
|
37
|
+
`.aas-slide-inner`, whose own font-size is the 1rem root rather than the
|
|
38
|
+
`clamp()` that slide paragraphs get — so a centred equation came out around
|
|
39
|
+
17px next to 26px copy, reading as a footnote to the slide instead of the
|
|
40
|
+
point of it. It now takes the same scale as `p`.
|
|
41
|
+
|
|
14
42
|
## [1.25.1] - 2026-08-31
|
|
15
43
|
|
|
16
44
|
### Fixed
|
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.3",
|
|
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');
|
|
@@ -462,9 +475,9 @@ const priv = entry.data.private;
|
|
|
462
475
|
}
|
|
463
476
|
|
|
464
477
|
// Actions menu (top-left): print/PDF and fullscreen.
|
|
465
|
-
const menuRoot =
|
|
466
|
-
const menuPanel =
|
|
467
|
-
const menuToggle =
|
|
478
|
+
const menuRoot = chrome<HTMLElement>('[data-menu-root]');
|
|
479
|
+
const menuPanel = chrome<HTMLElement>('[data-menu-panel]');
|
|
480
|
+
const menuToggle = chrome<HTMLButtonElement>('[data-menu-toggle]');
|
|
468
481
|
if (menuRoot && menuPanel && menuToggle) {
|
|
469
482
|
const closeMenu = () => {
|
|
470
483
|
menuRoot.classList.remove('is-open');
|
|
@@ -574,8 +587,8 @@ const priv = entry.data.private;
|
|
|
574
587
|
// Zoom / lightbox: enlarge a diagram or image in an overlay. Diagrams get
|
|
575
588
|
// a button inside their (.aas-diagram) box; images are wrapped so the
|
|
576
589
|
// button can sit in the corner. Clicking the media works too.
|
|
577
|
-
const zoom =
|
|
578
|
-
const zoomStage =
|
|
590
|
+
const zoom = chrome<HTMLElement>('[data-zoom]');
|
|
591
|
+
const zoomStage = chrome<HTMLElement>('[data-zoom-stage]');
|
|
579
592
|
if (zoom && zoomStage) {
|
|
580
593
|
const zoomLabel = zoom.dataset.zoomLabel || 'Enlarge';
|
|
581
594
|
let zoomOpen = false;
|
|
@@ -744,7 +757,7 @@ const priv = entry.data.private;
|
|
|
744
757
|
|
|
745
758
|
// Overview grid (press `o`): scaled thumbnails of every slide; click one
|
|
746
759
|
// to jump there. Built lazily and rebuilt when the viewport changes.
|
|
747
|
-
const ov =
|
|
760
|
+
const ov = chrome<HTMLElement>('[data-ov]');
|
|
748
761
|
let ovOpen = false;
|
|
749
762
|
const buildOv = () => {
|
|
750
763
|
if (!ov) return;
|
package/src/styles/global.css
CHANGED
|
@@ -889,6 +889,14 @@ summary {
|
|
|
889
889
|
.aas-slide-inner .katex {
|
|
890
890
|
font-size: 1.1em;
|
|
891
891
|
}
|
|
892
|
+
/* Inline math inherits the paragraph it sits in and so scales with it, but a
|
|
893
|
+
display block is a direct child of `.aas-slide-inner`, whose own font-size is
|
|
894
|
+
the 1rem root — not the clamp() that slide prose gets. Left alone a centred
|
|
895
|
+
formula renders at ~17px beside 26px text, reading as a footnote to the
|
|
896
|
+
slide rather than the point of it. Hand it the same scale as `p`. */
|
|
897
|
+
.aas-slide-inner .katex-display {
|
|
898
|
+
font-size: clamp(1.2rem, 2vw, 1.65rem);
|
|
899
|
+
}
|
|
892
900
|
/* KaTeX's fonts carry no Hangul, kana or Han glyphs, so for `\text{처리량}` it
|
|
893
901
|
tags the run with `.hangul_fallback` (or `.cjk_fallback` / `.brahmic_fallback`)
|
|
894
902
|
and ships NO rule for them — the font is left to the site on purpose. Without
|