mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(site): feature and preset reference UI + docs integration (#1258)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
5301202a18
commit
d4b805ea69
@@ -32,7 +32,7 @@ const hasDetail = Boolean(attributeName || detailedType || description);
|
||||
|
||||
<Tr
|
||||
id={id}
|
||||
data-detail-row
|
||||
data-apiref-row
|
||||
class={clsx(
|
||||
hasDetail &&
|
||||
"group cursor-pointer data-expanded:border-transparent dark:data-expanded:border-transparent intent:bg-manila-75 dark:intent:bg-soot",
|
||||
@@ -46,7 +46,7 @@ const hasDetail = Boolean(attributeName || detailedType || description);
|
||||
aria-expanded="false"
|
||||
aria-controls={`${id}-detail`}
|
||||
aria-label={`Details for ${name}`}
|
||||
data-detail-toggle
|
||||
data-apiref-toggle
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
@@ -66,8 +66,8 @@ const hasDetail = Boolean(attributeName || detailedType || description);
|
||||
<Td colspan={String(colspan)} class="p-0">
|
||||
<div class="px-6 py-4">
|
||||
<dl
|
||||
class="grid grid-cols-(--cols) gap-x-6 gap-y-3"
|
||||
style="--cols: auto 1fr"
|
||||
class="grid grid-cols-(--grid-cols) gap-x-6 gap-y-3"
|
||||
style="--grid-cols: auto 1fr"
|
||||
>
|
||||
{attributeName && (
|
||||
<>
|
||||
@@ -104,13 +104,13 @@ const hasDetail = Boolean(attributeName || detailedType || description);
|
||||
|
||||
<script>
|
||||
document
|
||||
.querySelectorAll<HTMLButtonElement>("[data-detail-toggle]")
|
||||
.querySelectorAll<HTMLButtonElement>("[data-apiref-toggle]")
|
||||
.forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
const expanded = button.getAttribute("aria-expanded") === "true";
|
||||
button.setAttribute("aria-expanded", String(!expanded));
|
||||
|
||||
const row = button.closest<HTMLTableRowElement>("[data-detail-row]");
|
||||
const row = button.closest<HTMLTableRowElement>("[data-apiref-row]");
|
||||
if (row) row.toggleAttribute("data-expanded", !expanded);
|
||||
|
||||
const detail = document.getElementById(
|
||||
@@ -121,11 +121,11 @@ const hasDetail = Boolean(attributeName || detailedType || description);
|
||||
});
|
||||
|
||||
document
|
||||
.querySelectorAll<HTMLTableRowElement>("[data-detail-row]")
|
||||
.querySelectorAll<HTMLTableRowElement>("[data-apiref-row]")
|
||||
.forEach((row) => {
|
||||
row.addEventListener("click", (e) => {
|
||||
if ((e.target as Element).closest("a, button")) return;
|
||||
row.querySelector<HTMLButtonElement>("[data-detail-toggle]")?.click();
|
||||
row.querySelector<HTMLButtonElement>("[data-apiref-toggle]")?.click();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user