@takazudo/zudo-doc 10.0.3 → 11.0.0
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/dist/asset-index-page/index.js +1 -1
- package/dist/asset-page/index.js +1 -1
- package/dist/asset-path/index.d.ts +2 -0
- package/dist/asset-path/index.js +1 -0
- package/dist/catalog.js +1 -1
- package/dist/chrome/derive.js +14 -2
- package/dist/compiled.css +178 -30
- package/dist/config-assertions/index.d.ts +54 -0
- package/dist/config-assertions/index.js +205 -0
- package/dist/config.d.ts +12 -9
- package/dist/config.js +8 -0
- package/dist/content/index.d.ts +1 -0
- package/dist/content/index.js +2 -0
- package/dist/content/wide-section-heading.d.ts +12 -0
- package/dist/content/wide-section-heading.js +8 -0
- package/dist/doc-body-end-islands/index.d.ts +0 -7
- package/dist/doc-body-end-islands/index.js +0 -6
- package/dist/doc-card-nav/index.d.ts +78 -0
- package/dist/doc-card-nav/index.js +82 -0
- package/dist/doc-card-nav/slug.d.ts +6 -0
- package/dist/doc-card-nav/slug.js +6 -0
- package/dist/doc-page-renderer/index.d.ts +1 -0
- package/dist/doc-page-renderer/index.js +2 -0
- package/dist/doc-page-shell/index.d.ts +3 -0
- package/dist/doc-page-shell/index.js +4 -1
- package/dist/docs-schema/index.d.ts +2 -0
- package/dist/docs-schema/index.js +9 -0
- package/dist/features.css +201 -0
- package/dist/frontmatter-preview-defaults/index.js +3 -1
- package/dist/head-with-defaults/index.d.ts +11 -0
- package/dist/head-with-defaults/index.js +15 -3
- package/dist/home-hero/index.d.ts +36 -0
- package/dist/home-hero/index.js +128 -0
- package/dist/home-page/index.js +149 -58
- package/dist/i18n-defaults/index.js +8 -0
- package/dist/mcp/constants.d.ts +11 -0
- package/dist/mcp/constants.js +20 -0
- package/dist/mcp/discovery.d.ts +45 -0
- package/dist/mcp/discovery.js +138 -0
- package/dist/mcp/handler.js +4 -2
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.js +37 -1
- package/dist/nav-indexing/doc-card-grid.d.ts +6 -0
- package/dist/nav-indexing/doc-card-grid.js +26 -16
- package/dist/plugins/internal/llms-txt/dev-middleware.js +5 -1
- package/dist/plugins/internal/llms-txt/emit.js +5 -1
- package/dist/plugins/internal/llms-txt/generate.d.ts +2 -0
- package/dist/plugins/internal/llms-txt/generate.js +3 -0
- package/dist/plugins/routes.js +6 -1
- package/dist/preset.d.ts +4 -1
- package/dist/preset.js +8 -0
- package/dist/robots.d.ts +14 -0
- package/dist/robots.js +22 -4
- package/dist/routes/404.js +1 -1
- package/dist/routes/ai-catalog.d.ts +5 -0
- package/dist/routes/ai-catalog.js +28 -0
- package/dist/routes/mcp-server-card.d.ts +5 -0
- package/dist/routes/mcp-server-card.js +24 -0
- package/dist/settings-defaults.js +1 -1
- package/dist/settings.d.ts +102 -6
- package/dist/sidebar/client-data.d.ts +1 -1
- package/dist/sidebar/client-data.js +2 -0
- package/dist/sidebar/types.d.ts +4 -0
- package/dist/sidebar-tree/build-tree.js +1 -0
- package/dist/sidebar-tree/types.d.ts +4 -0
- package/dist/site-schema/nav-tree.js +2 -0
- package/dist/site-schema/types.d.ts +3 -0
- package/dist/site-tree-nav/index.d.ts +18 -0
- package/dist/site-tree-nav/index.js +18 -3
- package/dist/site-tree-nav/normalize-island-props.d.ts +6 -0
- package/dist/site-tree-nav/normalize-island-props.js +15 -0
- package/dist/site-tree-nav-island/count.d.ts +3 -0
- package/dist/site-tree-nav-island/count.js +11 -0
- package/dist/site-tree-nav-island/index.d.ts +22 -2
- package/dist/site-tree-nav-island/index.js +272 -221
- package/dist/tag-pages/index.d.ts +1 -0
- package/dist/tag-pages/index.js +2 -2
- package/dist/theme-packs/bauhaus/meta.json +1 -1
- package/dist/theme-packs/bauhaus/pack.css +2 -2
- package/dist/theme-packs/beacon/meta.json +1 -1
- package/dist/theme-packs/beacon/pack.css +0 -15
- package/dist/theme-packs/eink/meta.json +1 -1
- package/dist/theme-packs/eink/pack.css +1 -14
- package/dist/theme.css +0 -16
- package/dist/versions-page/index.d.ts +1 -0
- package/dist/versions-page/index.js +1 -1
- package/dist/wind.json +4 -6
- package/eject/sidebar/client-data.ts +3 -1
- package/eject/sidebar/types.ts +4 -0
- package/eject/site-tree-nav-island/count.ts +11 -0
- package/eject/site-tree-nav-island/index.tsx +359 -256
- package/package.json +19 -7
- package/routes-src/404.tsx +1 -1
- package/routes-src/ai-catalog.tsx +26 -0
- package/routes-src/mcp-server-card.tsx +21 -0
- package/dist/find-in-page/find-bar.d.ts +0 -11
- package/dist/find-in-page/find-bar.js +0 -103
- package/dist/find-in-page/find-in-page.d.ts +0 -17
- package/dist/find-in-page/find-in-page.js +0 -131
- package/dist/find-in-page/index.d.ts +0 -5
- package/dist/find-in-page/index.js +0 -52
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { SidebarNavNode } from "../sidebar/types.js";
|
|
2
2
|
import type { ResolvedDateFormats } from "../settings.js";
|
|
3
|
+
/** Pluralized "N documents" templates for the described variant; `{count}` is replaced. */
|
|
4
|
+
export interface SiteTreeNavCountLabels {
|
|
5
|
+
one: string;
|
|
6
|
+
other: string;
|
|
7
|
+
}
|
|
8
|
+
export type SiteTreeNavVariant = "default" | "described";
|
|
3
9
|
export interface SiteTreeNavProps {
|
|
4
10
|
tree: SidebarNavNode[];
|
|
5
11
|
ariaLabel?: string;
|
|
@@ -7,7 +13,7 @@ export interface SiteTreeNavProps {
|
|
|
7
13
|
categoryIgnore?: string[];
|
|
8
14
|
/** Exact full category slugs at any depth that should start collapsed. */
|
|
9
15
|
initiallyCollapsedCategorySlugs?: string[];
|
|
10
|
-
/** Locale used by dated note-tray rows. */
|
|
16
|
+
/** Locale used by dated note-tray rows and the described document count. */
|
|
11
17
|
locale?: string;
|
|
12
18
|
/**
|
|
13
19
|
* Per-role date patterns already resolved for the page's locale, serialized
|
|
@@ -18,8 +24,22 @@ export interface SiteTreeNavProps {
|
|
|
18
24
|
dateFormats?: ResolvedDateFormats;
|
|
19
25
|
/** @deprecated — no longer rendered (created date only). */
|
|
20
26
|
updatedLabel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* `"described"` shows available category/document descriptions and each
|
|
29
|
+
* category's document count in a ~22rem-column grid; a lone category splits
|
|
30
|
+
* into summary + tree columns when its own box is wide enough. Omitted (or
|
|
31
|
+
* `"default"`) keeps the standard compact grid.
|
|
32
|
+
*/
|
|
33
|
+
variant?: SiteTreeNavVariant;
|
|
34
|
+
/** Described-variant count templates (`{count}` placeholder). English when omitted. */
|
|
35
|
+
countLabels?: SiteTreeNavCountLabels;
|
|
36
|
+
/**
|
|
37
|
+
* Prefix for the disclosure-target ids. Give distinct values when several
|
|
38
|
+
* site trees share one page. @default "zd-site-tree"
|
|
39
|
+
*/
|
|
40
|
+
idPrefix?: string;
|
|
21
41
|
}
|
|
22
|
-
export declare function SiteTreeNav({ tree, ariaLabel, categoryOrder, categoryIgnore, initiallyCollapsedCategorySlugs, locale, dateFormats, updatedLabel, }: SiteTreeNavProps): import("@takazudo/zfb").Description;
|
|
42
|
+
export declare function SiteTreeNav({ tree, ariaLabel, categoryOrder, categoryIgnore, initiallyCollapsedCategorySlugs, locale, dateFormats, updatedLabel, variant, countLabels, idPrefix, }: SiteTreeNavProps): import("@takazudo/zfb").Description;
|
|
23
43
|
export declare namespace SiteTreeNav {
|
|
24
44
|
var displayName: string;
|
|
25
45
|
}
|
|
@@ -6,13 +6,7 @@ import {
|
|
|
6
6
|
Show,
|
|
7
7
|
signal
|
|
8
8
|
} from "@takazudo/zfb/zudo-react";
|
|
9
|
-
import {
|
|
10
|
-
INDENT,
|
|
11
|
-
connectorLeft,
|
|
12
|
-
connectorLabelStart,
|
|
13
|
-
ConnectorLines,
|
|
14
|
-
CategoryLinkIcon
|
|
15
|
-
} from "../tree-nav-shared/index.js";
|
|
9
|
+
import { CategoryLinkIcon } from "../tree-nav-shared/index.js";
|
|
16
10
|
import { ChevronRight } from "../icons/index.js";
|
|
17
11
|
import {
|
|
18
12
|
formatDate,
|
|
@@ -24,13 +18,15 @@ import {
|
|
|
24
18
|
} from "../note-tray-model/index.js";
|
|
25
19
|
import { formatMonthDay } from "../format-date/index.js";
|
|
26
20
|
import { initialCategoryOpenState, toggleCategoryOpenState } from "./state.js";
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
21
|
+
import { countCategoryDocuments } from "./count.js";
|
|
22
|
+
const GRID_COLUMNS = {
|
|
23
|
+
default: "repeat(auto-fill, minmax(min(18rem, 100%), 1fr))",
|
|
24
|
+
described: "repeat(auto-fit, minmax(min(22rem, 100%), 1fr))"
|
|
25
|
+
};
|
|
26
|
+
const DEFAULT_COUNT_LABELS = {
|
|
27
|
+
one: "{count} document",
|
|
28
|
+
other: "{count} documents"
|
|
29
|
+
};
|
|
34
30
|
function reorderTree(tree, order) {
|
|
35
31
|
const map = new Map(tree.map((node) => [node.slug, node]));
|
|
36
32
|
const ordered = [];
|
|
@@ -46,6 +42,20 @@ function reorderTree(tree, order) {
|
|
|
46
42
|
}
|
|
47
43
|
return ordered;
|
|
48
44
|
}
|
|
45
|
+
function slugToId(slug) {
|
|
46
|
+
if (slug === "") return "root";
|
|
47
|
+
return slug.replace(/[^A-Za-z0-9_-]/g, (c) => `_${c.codePointAt(0).toString(16)}`);
|
|
48
|
+
}
|
|
49
|
+
function formatCount(count, locale, labels) {
|
|
50
|
+
let category = "other";
|
|
51
|
+
try {
|
|
52
|
+
category = new Intl.PluralRules(locale).select(count);
|
|
53
|
+
} catch {
|
|
54
|
+
category = count === 1 ? "one" : "other";
|
|
55
|
+
}
|
|
56
|
+
const template = category === "one" ? labels.one : labels.other;
|
|
57
|
+
return template.replaceAll("{count}", String(count));
|
|
58
|
+
}
|
|
49
59
|
function SiteTreeNav({
|
|
50
60
|
tree,
|
|
51
61
|
ariaLabel = "Site index",
|
|
@@ -54,7 +64,10 @@ function SiteTreeNav({
|
|
|
54
64
|
initiallyCollapsedCategorySlugs,
|
|
55
65
|
locale = "en",
|
|
56
66
|
dateFormats,
|
|
57
|
-
updatedLabel = "Updated"
|
|
67
|
+
updatedLabel = "Updated",
|
|
68
|
+
variant = "default",
|
|
69
|
+
countLabels = DEFAULT_COUNT_LABELS,
|
|
70
|
+
idPrefix = "zd-site-tree"
|
|
58
71
|
}) {
|
|
59
72
|
let processedTree = tree;
|
|
60
73
|
if (categoryIgnore) {
|
|
@@ -64,193 +77,276 @@ function SiteTreeNav({
|
|
|
64
77
|
if (categoryOrder) {
|
|
65
78
|
processedTree = reorderTree(processedTree, categoryOrder);
|
|
66
79
|
}
|
|
80
|
+
const described = variant === "described";
|
|
67
81
|
const roots = signal(processedTree);
|
|
68
|
-
const
|
|
82
|
+
const visibleRootCount = processedTree.filter(
|
|
83
|
+
(node) => node.shape !== "note-tray" || getNoteTrayItems(node).length > 0
|
|
84
|
+
).length;
|
|
85
|
+
const context = {
|
|
86
|
+
initiallyCollapsed: new Set(initiallyCollapsedCategorySlugs),
|
|
87
|
+
idPrefix,
|
|
88
|
+
described,
|
|
89
|
+
locale,
|
|
90
|
+
dateFormats,
|
|
91
|
+
updatedLabel
|
|
92
|
+
};
|
|
69
93
|
return /* @__PURE__ */ jsx(
|
|
70
94
|
"nav",
|
|
71
95
|
{
|
|
72
96
|
"aria-label": ariaLabel,
|
|
73
97
|
"data-site-nav": true,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
98
|
+
"data-variant": described ? "described" : "default",
|
|
99
|
+
class: "zd-site-tree grid gap-vsp-md",
|
|
100
|
+
style: { "grid-template-columns": GRID_COLUMNS[described ? "described" : "default"] },
|
|
101
|
+
children: /* @__PURE__ */ jsx(For, { each: roots, by: (node) => node.slug, children: (node) => /* @__PURE__ */ jsx(
|
|
102
|
+
Show,
|
|
103
|
+
{
|
|
104
|
+
when: computed(
|
|
105
|
+
() => node.value.shape !== "note-tray" || getNoteTrayItems(node.value).length > 0
|
|
106
|
+
),
|
|
107
|
+
children: () => /* @__PURE__ */ jsx(
|
|
108
|
+
RootCard,
|
|
109
|
+
{
|
|
110
|
+
node,
|
|
111
|
+
context,
|
|
112
|
+
single: visibleRootCount === 1,
|
|
113
|
+
countLabels
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
) })
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
SiteTreeNav.displayName = "SiteTreeNav";
|
|
122
|
+
function DisclosureButton({
|
|
123
|
+
open,
|
|
124
|
+
label,
|
|
125
|
+
controls,
|
|
126
|
+
onToggle
|
|
127
|
+
}) {
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
"on:click": onToggle,
|
|
133
|
+
class: "zd-site-tree-toggle flex shrink-0 items-center justify-center border border-muted text-muted hover:text-accent hover:underline focus:underline focus-visible:text-accent",
|
|
134
|
+
"aria-expanded": computed(() => open.value ? "true" : "false"),
|
|
135
|
+
"aria-label": computed(() => `${open.value ? "Collapse" : "Expand"} ${label.value}`),
|
|
136
|
+
"aria-controls": controls,
|
|
137
|
+
children: /* @__PURE__ */ jsx(
|
|
138
|
+
"span",
|
|
139
|
+
{
|
|
140
|
+
class: "inline-flex transition-transform duration-150",
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
style: computed(() => `transform:rotate(${open.value ? "90deg" : "0deg"})`),
|
|
143
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { class: "h-icon-xs w-icon-xs" })
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function RootCard({
|
|
150
|
+
node,
|
|
151
|
+
context,
|
|
152
|
+
single,
|
|
153
|
+
countLabels
|
|
154
|
+
}) {
|
|
155
|
+
const { described } = context;
|
|
156
|
+
const hasChildren = node.value.children.length > 0;
|
|
157
|
+
const open = signal(
|
|
158
|
+
initialCategoryOpenState(context.initiallyCollapsed.has(node.value.slug))
|
|
159
|
+
);
|
|
160
|
+
const toggle = () => {
|
|
161
|
+
open.value = toggleCategoryOpenState(open.value);
|
|
162
|
+
};
|
|
163
|
+
const label = computed(() => node.value.label);
|
|
164
|
+
const href = computed(() => node.value.href);
|
|
165
|
+
const description = computed(() => node.value.description ?? "");
|
|
166
|
+
const controls = `${context.idPrefix}-${slugToId(node.value.slug)}`;
|
|
167
|
+
const isNoteTray = node.value.shape === "note-tray";
|
|
168
|
+
const splitCandidate = described && single && hasChildren;
|
|
169
|
+
const labelClass = "zd-site-tree-label flex min-w-0 flex-1 items-start text-left font-semibold text-fg break-words hover:text-accent hover:underline focus:underline focus-visible:text-accent";
|
|
170
|
+
const labelContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
171
|
+
/* @__PURE__ */ jsx("span", { class: "zd-site-tree-marker flex shrink-0 items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx(CategoryLinkIcon, { class: "w-[18px]" }) }),
|
|
172
|
+
/* @__PURE__ */ jsx("span", { class: "min-w-0", children: label })
|
|
173
|
+
] });
|
|
174
|
+
return /* @__PURE__ */ jsxs(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
class: "zd-site-tree-card min-w-0 border border-muted bg-bg",
|
|
178
|
+
"data-site-tree-root": node.value.slug,
|
|
179
|
+
...described ? { "data-described": "" } : {},
|
|
180
|
+
children: [
|
|
181
|
+
node.value.coverHref ? /* @__PURE__ */ jsx(
|
|
182
|
+
"img",
|
|
82
183
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
184
|
+
src: node.value.coverHref,
|
|
185
|
+
alt: "",
|
|
186
|
+
width: "1200",
|
|
187
|
+
height: "630",
|
|
188
|
+
loading: "lazy",
|
|
189
|
+
decoding: "async",
|
|
190
|
+
class: "zd-site-nav-cover"
|
|
191
|
+
}
|
|
192
|
+
) : null,
|
|
193
|
+
/* @__PURE__ */ jsxs(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
class: "zd-site-tree-body",
|
|
197
|
+
...splitCandidate ? { "data-split": computed(() => open.value ? "true" : "false") } : {},
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsxs("div", { class: "min-w-0", children: [
|
|
200
|
+
/* @__PURE__ */ jsxs("div", { class: "zd-site-tree-head flex items-start justify-between gap-hsp-xs text-small", children: [
|
|
201
|
+
/* @__PURE__ */ jsx(
|
|
202
|
+
Show,
|
|
203
|
+
{
|
|
204
|
+
when: computed(() => Boolean(href.value)),
|
|
205
|
+
fallback: () => hasChildren ? /* @__PURE__ */ jsx(
|
|
206
|
+
"button",
|
|
207
|
+
{
|
|
208
|
+
type: "button",
|
|
209
|
+
"on:click": toggle,
|
|
210
|
+
class: labelClass,
|
|
211
|
+
"aria-expanded": computed(() => open.value ? "true" : "false"),
|
|
212
|
+
"aria-controls": controls,
|
|
213
|
+
children: labelContent
|
|
214
|
+
}
|
|
215
|
+
) : /* @__PURE__ */ jsx("span", { class: labelClass, children: labelContent }),
|
|
216
|
+
children: () => /* @__PURE__ */ jsx("a", { href: computed(() => href.value ?? ""), class: labelClass, children: labelContent })
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
hasChildren && /* @__PURE__ */ jsx(DisclosureButton, { open, label, controls, onToggle: toggle })
|
|
220
|
+
] }),
|
|
221
|
+
described && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
222
|
+
/* @__PURE__ */ jsx(Show, { when: computed(() => description.value.length > 0), children: () => /* @__PURE__ */ jsx("p", { class: "mt-vsp-xs text-small text-muted break-words", "data-site-tree-description": true, children: description }) }),
|
|
223
|
+
/* @__PURE__ */ jsx("p", { class: "mt-vsp-2xs text-caption text-muted", "data-site-tree-count": true, children: computed(
|
|
224
|
+
() => formatCount(countCategoryDocuments(node.value), context.locale, countLabels)
|
|
225
|
+
) })
|
|
226
|
+
] })
|
|
227
|
+
] }),
|
|
228
|
+
hasChildren && /* @__PURE__ */ jsx(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
id: controls,
|
|
232
|
+
class: "min-w-0",
|
|
233
|
+
hidden: computed(() => !open.value),
|
|
234
|
+
children: /* @__PURE__ */ jsx(Show, { when: open, children: () => isNoteTray ? /* @__PURE__ */ jsx(
|
|
235
|
+
NoteTrayNodeList,
|
|
236
|
+
{
|
|
237
|
+
node,
|
|
238
|
+
locale: context.locale,
|
|
239
|
+
dateFormats: context.dateFormats,
|
|
240
|
+
updatedLabel: context.updatedLabel
|
|
241
|
+
}
|
|
242
|
+
) : /* @__PURE__ */ jsx(
|
|
243
|
+
NodeList,
|
|
244
|
+
{
|
|
245
|
+
nodes: computed(() => node.value.children),
|
|
246
|
+
context,
|
|
247
|
+
root: true
|
|
248
|
+
}
|
|
249
|
+
) })
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
]
|
|
105
253
|
}
|
|
106
|
-
)
|
|
107
|
-
|
|
254
|
+
)
|
|
255
|
+
]
|
|
108
256
|
}
|
|
109
257
|
);
|
|
110
258
|
}
|
|
111
|
-
SiteTreeNav.displayName = "SiteTreeNav";
|
|
112
259
|
function NodeList({
|
|
113
260
|
nodes,
|
|
114
|
-
|
|
115
|
-
|
|
261
|
+
context,
|
|
262
|
+
root
|
|
116
263
|
}) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
} });
|
|
264
|
+
const visible = computed(
|
|
265
|
+
() => nodes.value.filter((node) => node.children.length > 0 || Boolean(node.href))
|
|
266
|
+
);
|
|
267
|
+
return /* @__PURE__ */ jsx("ul", { class: "zd-site-tree-list", role: "list", children: /* @__PURE__ */ jsx(For, { each: visible, by: (node) => node.slug, children: (node, index) => {
|
|
268
|
+
const isLast = computed(() => index.value === visible.value.length - 1);
|
|
269
|
+
const isFirst = computed(() => index.value === 0);
|
|
270
|
+
return /* @__PURE__ */ jsx(TreeRow, { node, isFirst, isLast, root, context });
|
|
271
|
+
} }) });
|
|
128
272
|
}
|
|
129
|
-
function
|
|
273
|
+
function TreeRow({
|
|
130
274
|
node,
|
|
131
|
-
|
|
275
|
+
isFirst,
|
|
132
276
|
isLast,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
dateFormats,
|
|
136
|
-
updatedLabel = "Updated"
|
|
277
|
+
root,
|
|
278
|
+
context
|
|
137
279
|
}) {
|
|
138
|
-
const
|
|
280
|
+
const group = node.value.children.length > 0;
|
|
281
|
+
const open = signal(
|
|
282
|
+
initialCategoryOpenState(context.initiallyCollapsed.has(node.value.slug))
|
|
283
|
+
);
|
|
139
284
|
const toggle = () => {
|
|
140
285
|
open.value = toggleCategoryOpenState(open.value);
|
|
141
286
|
};
|
|
142
287
|
const label = computed(() => node.value.label);
|
|
143
288
|
const href = computed(() => node.value.href);
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
{
|
|
171
|
-
depth,
|
|
172
|
-
isLast: false,
|
|
173
|
-
widthScale: CONNECTOR_WIDTH_SCALE,
|
|
174
|
-
topPad: "calc(0.15rem + var(--spacing-vsp-xs))"
|
|
175
|
-
}
|
|
176
|
-
) }),
|
|
177
|
-
/* @__PURE__ */ jsxs(
|
|
178
|
-
"div",
|
|
179
|
-
{
|
|
180
|
-
class: "flex w-full items-center justify-between text-small font-semibold pt-[0.15rem] text-fg",
|
|
181
|
-
style: { "padding-left": paddingLeft },
|
|
182
|
-
children: [
|
|
183
|
-
/* @__PURE__ */ jsx(
|
|
184
|
-
Show,
|
|
185
|
-
{
|
|
186
|
-
when: computed(() => Boolean(href.value)),
|
|
187
|
-
fallback: () => /* @__PURE__ */ jsx(
|
|
188
|
-
"button",
|
|
189
|
-
{
|
|
190
|
-
type: "button",
|
|
191
|
-
"on:click": toggle,
|
|
192
|
-
class: "flex-1 min-w-0 break-words py-vsp-xs text-left hover:text-accent hover:underline focus:underline",
|
|
193
|
-
children: label
|
|
194
|
-
}
|
|
195
|
-
),
|
|
196
|
-
children: () => /* @__PURE__ */ jsxs(
|
|
197
|
-
"a",
|
|
198
|
-
{
|
|
199
|
-
href: computed(() => href.value ?? ""),
|
|
200
|
-
class: "flex-1 flex items-start gap-hsp-xs py-vsp-xs text-fg hover:text-accent hover:underline focus:underline focus-visible:text-accent",
|
|
201
|
-
children: [
|
|
202
|
-
depth === 0 && /* @__PURE__ */ jsx("span", { class: "flex h-[1lh] items-center", children: /* @__PURE__ */ jsx(CategoryLinkIcon, { class: "w-[18px]" }) }),
|
|
203
|
-
label
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
}
|
|
208
|
-
),
|
|
209
|
-
/* @__PURE__ */ jsx(
|
|
210
|
-
"button",
|
|
211
|
-
{
|
|
212
|
-
type: "button",
|
|
213
|
-
"on:click": toggle,
|
|
214
|
-
class: "aspect-square flex items-center justify-center w-[1.75rem] border-y border-l border-muted hover:underline focus:underline",
|
|
215
|
-
"aria-expanded": computed(() => open.value ? "true" : "false"),
|
|
216
|
-
"aria-label": computed(
|
|
217
|
-
() => `${open.value ? "Collapse" : "Expand"} ${label.value}`
|
|
218
|
-
),
|
|
219
|
-
children: /* @__PURE__ */ jsx(
|
|
220
|
-
"span",
|
|
221
|
-
{
|
|
222
|
-
class: "inline-flex transition-transform duration-150",
|
|
223
|
-
style: computed(
|
|
224
|
-
() => `transform:rotate(${open.value ? "90deg" : "0deg"})`
|
|
225
|
-
),
|
|
226
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { class: "h-icon-xs w-icon-xs text-muted" })
|
|
227
|
-
}
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
)
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
)
|
|
234
|
-
] }),
|
|
235
|
-
/* @__PURE__ */ jsx(Show, { when: open, children: () => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
236
|
-
Show,
|
|
237
|
-
{
|
|
238
|
-
when: computed(
|
|
239
|
-
() => node.value.shape === "note-tray" && depth === 0
|
|
289
|
+
const description = computed(
|
|
290
|
+
() => context.described ? node.value.description ?? "" : ""
|
|
291
|
+
);
|
|
292
|
+
const controls = `${context.idPrefix}-${slugToId(node.value.slug)}`;
|
|
293
|
+
const labelClass = `zd-site-tree-label block min-w-0 flex-1 text-left text-fg break-words hover:text-accent hover:underline focus:underline focus-visible:text-accent${group ? " font-semibold" : ""}`;
|
|
294
|
+
const labelContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
295
|
+
/* @__PURE__ */ jsx("span", { class: "block", children: label }),
|
|
296
|
+
/* @__PURE__ */ jsx(Show, { when: computed(() => description.value.length > 0), children: () => /* @__PURE__ */ jsx("span", { class: "mt-vsp-3xs block text-caption text-muted", "data-site-tree-description": true, children: description }) })
|
|
297
|
+
] });
|
|
298
|
+
return /* @__PURE__ */ jsxs(
|
|
299
|
+
"li",
|
|
300
|
+
{
|
|
301
|
+
class: "zd-site-tree-row",
|
|
302
|
+
"data-node": node.value.slug,
|
|
303
|
+
...group ? { "data-group": "" } : {},
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ jsx(
|
|
306
|
+
"span",
|
|
307
|
+
{
|
|
308
|
+
"aria-hidden": "true",
|
|
309
|
+
class: "zd-site-tree-rail",
|
|
310
|
+
"data-tree-rail": true,
|
|
311
|
+
...root ? { "data-root": "" } : {},
|
|
312
|
+
"data-first": computed(() => isFirst.value ? "true" : "false"),
|
|
313
|
+
"data-last": computed(() => isLast.value ? "true" : "false")
|
|
314
|
+
}
|
|
240
315
|
),
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
316
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", class: "zd-site-tree-branch", "data-tree-branch": true }),
|
|
317
|
+
/* @__PURE__ */ jsxs("div", { class: "zd-site-tree-line relative flex min-w-0 items-start gap-hsp-xs", children: [
|
|
318
|
+
group && /* @__PURE__ */ jsx(DisclosureButton, { open, label, controls, onToggle: toggle }),
|
|
319
|
+
/* @__PURE__ */ jsx(
|
|
320
|
+
Show,
|
|
321
|
+
{
|
|
322
|
+
when: computed(() => Boolean(href.value)),
|
|
323
|
+
fallback: () => /* @__PURE__ */ jsx(
|
|
324
|
+
"button",
|
|
325
|
+
{
|
|
326
|
+
type: "button",
|
|
327
|
+
"on:click": toggle,
|
|
328
|
+
class: labelClass,
|
|
329
|
+
"aria-expanded": computed(() => open.value ? "true" : "false"),
|
|
330
|
+
"aria-controls": controls,
|
|
331
|
+
children: labelContent
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
children: () => /* @__PURE__ */ jsx("a", { href: computed(() => href.value ?? ""), class: labelClass, children: labelContent })
|
|
335
|
+
}
|
|
336
|
+
),
|
|
337
|
+
group && /* @__PURE__ */ jsx(Show, { when: open, children: () => /* @__PURE__ */ jsx("span", { "aria-hidden": "true", class: "zd-site-tree-stem", "data-tree-stem": true }) })
|
|
338
|
+
] }),
|
|
339
|
+
group && /* @__PURE__ */ jsx("div", { id: controls, hidden: computed(() => !open.value), children: /* @__PURE__ */ jsx(Show, { when: open, children: () => /* @__PURE__ */ jsx(
|
|
340
|
+
NodeList,
|
|
244
341
|
{
|
|
245
|
-
node,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
updatedLabel
|
|
342
|
+
nodes: computed(() => node.value.children),
|
|
343
|
+
context,
|
|
344
|
+
root: false
|
|
249
345
|
}
|
|
250
|
-
)
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
346
|
+
) }) })
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
);
|
|
254
350
|
}
|
|
255
351
|
function NoteTrayNodeList({
|
|
256
352
|
node,
|
|
@@ -357,51 +453,6 @@ function NoteTrayRow({
|
|
|
357
453
|
}
|
|
358
454
|
) });
|
|
359
455
|
}
|
|
360
|
-
function LeafNode({
|
|
361
|
-
node,
|
|
362
|
-
depth,
|
|
363
|
-
isLast
|
|
364
|
-
}) {
|
|
365
|
-
const href = computed(() => node.value.href);
|
|
366
|
-
const label = computed(() => node.value.label);
|
|
367
|
-
const isRoot = depth === 0;
|
|
368
|
-
const paddingLeft = padLeft(depth);
|
|
369
|
-
const topPad = isRoot ? "calc(var(--spacing-vsp-xs) + 0.15rem)" : "var(--spacing-vsp-2xs)";
|
|
370
|
-
return /* @__PURE__ */ jsx(Show, { when: computed(() => Boolean(href.value)), children: () => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { class: "relative", children: [
|
|
371
|
-
/* @__PURE__ */ jsx(Show, { when: isLast, children: () => /* @__PURE__ */ jsx(
|
|
372
|
-
ConnectorLines,
|
|
373
|
-
{
|
|
374
|
-
depth,
|
|
375
|
-
isLast: true,
|
|
376
|
-
widthScale: CONNECTOR_WIDTH_SCALE,
|
|
377
|
-
topPad
|
|
378
|
-
}
|
|
379
|
-
) }),
|
|
380
|
-
/* @__PURE__ */ jsx(Show, { when: computed(() => !isLast.value), children: () => /* @__PURE__ */ jsx(
|
|
381
|
-
ConnectorLines,
|
|
382
|
-
{
|
|
383
|
-
depth,
|
|
384
|
-
isLast: false,
|
|
385
|
-
widthScale: CONNECTOR_WIDTH_SCALE,
|
|
386
|
-
topPad
|
|
387
|
-
}
|
|
388
|
-
) }),
|
|
389
|
-
/* @__PURE__ */ jsxs(
|
|
390
|
-
"a",
|
|
391
|
-
{
|
|
392
|
-
href: computed(() => href.value ?? ""),
|
|
393
|
-
class: computed(
|
|
394
|
-
() => isRoot ? "flex items-start gap-hsp-xs py-[calc(var(--spacing-vsp-xs)_+_0.15rem)] pr-hsp-sm text-small font-semibold text-fg break-words hover:text-accent hover:underline focus:underline focus-visible:text-accent" : `block py-vsp-2xs pr-hsp-sm ${isLast.value ? "pb-vsp-xs" : ""} text-small text-fg break-words hover:text-accent hover:underline focus:underline focus-visible:text-accent`
|
|
395
|
-
),
|
|
396
|
-
style: { "padding-left": paddingLeft },
|
|
397
|
-
children: [
|
|
398
|
-
isRoot && /* @__PURE__ */ jsx("span", { class: "flex h-[1lh] items-center", children: /* @__PURE__ */ jsx(CategoryLinkIcon, { class: "w-[18px]" }) }),
|
|
399
|
-
isRoot ? /* @__PURE__ */ jsx("span", { class: "min-w-0", children: label }) : label
|
|
400
|
-
]
|
|
401
|
-
}
|
|
402
|
-
)
|
|
403
|
-
] }) }) });
|
|
404
|
-
}
|
|
405
456
|
export {
|
|
406
457
|
SiteTreeNav
|
|
407
458
|
};
|
package/dist/tag-pages/index.js
CHANGED
|
@@ -82,7 +82,7 @@ function createTagPages(ctx) {
|
|
|
82
82
|
DocLayoutWithDefaults,
|
|
83
83
|
{
|
|
84
84
|
title: composeMetaTitle(pageTitle),
|
|
85
|
-
head: /* @__PURE__ */ jsx(HeadWithDefaults, { title: pageTitle }),
|
|
85
|
+
head: /* @__PURE__ */ jsx(HeadWithDefaults, { title: pageTitle, locale }),
|
|
86
86
|
...isDefault ? {} : { lang: locale },
|
|
87
87
|
...dataThemePack !== void 0 ? { dataThemePack } : {},
|
|
88
88
|
...settings.noindex !== void 0 ? { noindex: settings.noindex } : {},
|
|
@@ -126,7 +126,7 @@ function createTagPages(ctx) {
|
|
|
126
126
|
DocLayoutWithDefaults,
|
|
127
127
|
{
|
|
128
128
|
title: composeMetaTitle(pageTitle),
|
|
129
|
-
head: /* @__PURE__ */ jsx(HeadWithDefaults, { title: pageTitle }),
|
|
129
|
+
head: /* @__PURE__ */ jsx(HeadWithDefaults, { title: pageTitle, locale }),
|
|
130
130
|
...isDefault ? {} : { lang: locale },
|
|
131
131
|
...dataThemePack !== void 0 ? { dataThemePack } : {},
|
|
132
132
|
...settings.noindex !== void 0 ? { noindex: settings.noindex } : {},
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "Bauhaus",
|
|
5
5
|
"description": "Primary triad as structure — gallery white, near-black ink, and red, yellow, blue doing structural work: circle, triangle, square markers, thick geometric rules, zero radius.",
|
|
6
6
|
"mode": "light",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.2",
|
|
8
8
|
"fonts": {
|
|
9
9
|
"sans": "Jost",
|
|
10
10
|
"mono": "Space Mono",
|
|
@@ -130,8 +130,8 @@ html[data-theme-pack="bauhaus"] {
|
|
|
130
130
|
--zd-warning: light-dark(#6d5500, #f5c51c);
|
|
131
131
|
--zd-info: light-dark(#1e42ad, #8fb0ff);
|
|
132
132
|
|
|
133
|
-
/*
|
|
134
|
-
|
|
133
|
+
/* search match = the yellow location band, same as selection and
|
|
134
|
+
the sidebar/TOC current markers. */
|
|
135
135
|
--zd-matched-keyword-bg: light-dark(#f2c400, #f5cb1a);
|
|
136
136
|
--zd-matched-keyword-fg: light-dark(#141414, #141414);
|
|
137
137
|
|