Prepare 1.0.0-beta.6

This commit is contained in:
Ronan Berder
2026-06-23 18:14:19 +08:00
parent fbf3f47b75
commit a17eaa20d3
63 changed files with 2398 additions and 1502 deletions
+47
View File
@@ -8,6 +8,7 @@ import lumaUrl from "../assets/styles/style-luma.css?url";
import seraUrl from "../assets/styles/style-sera.css?url";
import rheaUrl from "../assets/styles/style-rhea.css?url";
import demoInteractionsUrl from "./demo-interactions.js?url";
import htmxUrl from "htmx.org/dist/htmx.min.js?url";
const styleUrls = {
vega: vegaUrl,
@@ -80,4 +81,50 @@ const styleUrls = {
})();
</script>
<script is:inline>
(() => {
const pageKey = (href) => {
const url = new URL(href, window.location.origin);
return `${url.pathname.replace(/\/$/, "")}${url.search}`;
};
const updateSidebarState = () => {
const sidebar = document.getElementById("sidebar");
if (!sidebar) return;
const currentKey = pageKey(window.location.href);
sidebar.querySelectorAll("a[href]").forEach((link) => {
const isCurrent = pageKey(link.href) === currentKey;
if (isCurrent) {
link.setAttribute("aria-current", "page");
link.closest("details")?.setAttribute("open", "");
} else {
link.removeAttribute("aria-current");
}
});
};
document.addEventListener("DOMContentLoaded", () => {
const content = document.getElementById("content");
if (!content) return;
document.body.setAttribute("hx-boost", "true");
document.body.setAttribute("hx-target", "#content");
document.body.setAttribute("hx-select", "#content");
document.body.setAttribute("hx-swap", "outerHTML");
document.body.setAttribute("hx-push-url", "true");
window.htmx?.process(document.body);
updateSidebarState();
});
document.addEventListener("htmx:afterSettle", () => {
window.basecoat?.initAll?.();
updateSidebarState();
});
window.addEventListener("popstate", updateSidebarState);
})();
</script>
<script src={htmxUrl} defer></script>
<script type="module" src={demoInteractionsUrl}></script>