stack-site-builder 1.19.3 → 1.19.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 +11 -0
- package/package.json +1 -1
- package/src/layouts/BaseLayout.astro +20 -7
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,17 @@ 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.19.4] - 2026-07-24
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **Header no longer flickers on navigation** — the member login control used
|
|
19
|
+
to render `hidden` and only appear after a runtime `/aas-auth.json` fetch,
|
|
20
|
+
shifting the whole right-side icon row on every page load. Whether login
|
|
21
|
+
users are configured is a build-time fact (`AAS_PRIVATE_*` env), so the
|
|
22
|
+
control now renders in its final state; the fetch only wires the login form,
|
|
23
|
+
and is skipped entirely on sites without private users.
|
|
24
|
+
|
|
14
25
|
## [1.19.3] - 2026-07-23
|
|
15
26
|
|
|
16
27
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stack-site-builder",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.19.
|
|
4
|
+
"version": "1.19.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": {
|
|
@@ -11,6 +11,19 @@ import { getNavProducts, getTopProducts, productSlugOf } from '../lib/products';
|
|
|
11
11
|
import { homeTemplate } from '../lib/home';
|
|
12
12
|
import { sectionEnabled, type SectionKey } from '../lib/sections';
|
|
13
13
|
import { siteIcons } from '../lib/icons';
|
|
14
|
+
import { privateClientData } from '../lib/private';
|
|
15
|
+
|
|
16
|
+
// Whether the site has login users configured is a build-time fact (AAS_PRIVATE_*
|
|
17
|
+
// env), so the header login control renders in its final state instead of being
|
|
18
|
+
// revealed after a runtime fetch — a late reveal shifted the whole icon row on
|
|
19
|
+
// every navigation.
|
|
20
|
+
let authEnabled = false;
|
|
21
|
+
try {
|
|
22
|
+
privateClientData();
|
|
23
|
+
authEnabled = true;
|
|
24
|
+
} catch {
|
|
25
|
+
/* no private env — control stays hidden */
|
|
26
|
+
}
|
|
14
27
|
|
|
15
28
|
interface Props {
|
|
16
29
|
title: string;
|
|
@@ -272,9 +285,9 @@ const navItems = allNavItems.filter((item) => !item.section || sectionEnabled(it
|
|
|
272
285
|
))
|
|
273
286
|
}
|
|
274
287
|
</div>
|
|
275
|
-
{/* Member login/logout for private content —
|
|
276
|
-
|
|
277
|
-
<details class="aas-menu relative" data-auth hidden>
|
|
288
|
+
{/* Member login/logout for private content — rendered only when the
|
|
289
|
+
build has login users configured, so the header never reflows. */}
|
|
290
|
+
<details class="aas-menu relative" data-auth hidden={!authEnabled}>
|
|
278
291
|
<summary
|
|
279
292
|
class="flex cursor-pointer list-none items-center rounded-lg border border-[var(--aas-border)] px-2.5 py-1 text-[var(--aas-text)] select-none"
|
|
280
293
|
aria-label={t('private.login')}
|
|
@@ -391,17 +404,17 @@ const navItems = allNavItems.filter((item) => !item.section || sectionEnabled(it
|
|
|
391
404
|
type AuthData,
|
|
392
405
|
} from '../lib/private-client';
|
|
393
406
|
|
|
394
|
-
// Header member login/logout:
|
|
395
|
-
//
|
|
407
|
+
// Header member login/logout: visibility is decided at build time (the
|
|
408
|
+
// control renders hidden on sites without login users) — the fetch only
|
|
409
|
+
// wires the login form with the user table from /aas-auth.json.
|
|
396
410
|
const authCtrl = document.querySelector<HTMLDetailsElement>('[data-auth]');
|
|
397
|
-
if (authCtrl) {
|
|
411
|
+
if (authCtrl && !authCtrl.hidden) {
|
|
398
412
|
(async () => {
|
|
399
413
|
try {
|
|
400
414
|
const base = import.meta.env.BASE_URL.replace(/\/$/, '');
|
|
401
415
|
const res = await fetch(`${base}/aas-auth.json`);
|
|
402
416
|
const data = (await res.json()) as { enabled: boolean } & AuthData;
|
|
403
417
|
if (!data.enabled) return;
|
|
404
|
-
authCtrl.hidden = false;
|
|
405
418
|
const form = authCtrl.querySelector<HTMLFormElement>('[data-auth-form]')!;
|
|
406
419
|
const logoutBtn = authCtrl.querySelector<HTMLButtonElement>('[data-auth-logout]')!;
|
|
407
420
|
const errorEl = authCtrl.querySelector<HTMLElement>('[data-auth-error]')!;
|