imprensa 0.1.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 +15 -0
- package/README.md +51 -0
- package/default.css +239 -0
- package/dist/client-runtime-D7MhMWCo.d.mts +45 -0
- package/dist/components/doc.d.mts +2 -0
- package/dist/components/doc.mjs +2 -0
- package/dist/components/icons.d.mts +23 -0
- package/dist/components/icons.mjs +40 -0
- package/dist/components/index.d.mts +33 -0
- package/dist/components/index.mjs +253 -0
- package/dist/core/client-runtime.d.mts +2 -0
- package/dist/core/client-runtime.mjs +121 -0
- package/dist/core/prerender-core.d.mts +2 -0
- package/dist/core/prerender-core.mjs +2 -0
- package/dist/core/runtime.d.mts +3 -0
- package/dist/core/runtime.mjs +3 -0
- package/dist/core/shiki-build.d.mts +9 -0
- package/dist/core/shiki-build.mjs +34 -0
- package/dist/doc-pager-D-YhwEQN.d.mts +27 -0
- package/dist/doc-toolbar-DUQS2gnK.mjs +460 -0
- package/dist/docs/config.d.mts +13 -0
- package/dist/docs/config.mjs +10 -0
- package/dist/docs/landing-shiki.d.mts +7 -0
- package/dist/docs/landing-shiki.mjs +7 -0
- package/dist/docs/mdx.d.mts +79 -0
- package/dist/docs/mdx.mjs +293 -0
- package/dist/docs/rehype.d.mts +25 -0
- package/dist/docs/rehype.mjs +2 -0
- package/dist/frontmatter-DVneGjCO.mjs +16 -0
- package/dist/global-search-Dfv8DYN3.mjs +310 -0
- package/dist/index.d.mts +41 -0
- package/dist/index.mjs +668 -0
- package/dist/prerender-core-D4Li--RS.mjs +172 -0
- package/dist/prerender-core-DBi9ntWW.d.mts +48 -0
- package/dist/rehype-BWpGaBql.mjs +182 -0
- package/dist/search-store-DDGHRAKl.mjs +64 -0
- package/dist/shiki-gFey7C-z.d.mts +3289 -0
- package/dist/sidebar-layout-DsEhSkJS.mjs +43 -0
- package/dist/socials-BIszPk-A.d.mts +8 -0
- package/docs/architecture.md +26 -0
- package/docs/integration-notes.md +6 -0
- package/index.d.ts +49 -0
- package/package.json +128 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import "./search-store-DDGHRAKl.mjs";
|
|
2
|
+
import { Icon as Icon$1 } from "./components/icons.mjs";
|
|
3
|
+
import { useRoute } from "@ilha/router";
|
|
4
|
+
import ilha from "ilha";
|
|
5
|
+
import { Button, Dropdown, Icon, LayerCard, LinkButton, Popover } from "areia";
|
|
6
|
+
import { ChevronDown, ChevronLeft, ChevronRight, Command, Copy, ExternalLink, FileText, GitBranch, MessageSquare, Monitor, Moon, Search, Sun } from "lucide";
|
|
7
|
+
import { applyThemeToHtml, getStoredTheme, setStoredTheme } from "imprensa/runtime";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "ilha/jsx-runtime";
|
|
9
|
+
import { articleClass, contentMeta, contentTree, getDocLinks, searchDocuments } from "imprensa/mdx";
|
|
10
|
+
import { socials } from "imprensa/config";
|
|
11
|
+
import { toast } from "sonner";
|
|
12
|
+
//#region src/components/search.tsx
|
|
13
|
+
/** @jsxImportSource ilha */
|
|
14
|
+
function LogoButton() {
|
|
15
|
+
return /* @__PURE__ */ jsx(LinkButton, {
|
|
16
|
+
href: "/",
|
|
17
|
+
class: "font-semibold",
|
|
18
|
+
icon: /* @__PURE__ */ jsx("img", {
|
|
19
|
+
src: "/logo.svg",
|
|
20
|
+
class: "size-6"
|
|
21
|
+
}),
|
|
22
|
+
children: "Imprensa"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const ThemeToggle = ilha.state("mode", "system").onMount(({ state }) => {
|
|
26
|
+
const mode = getStoredTheme();
|
|
27
|
+
state.mode(mode);
|
|
28
|
+
const applySystem = () => applyThemeToHtml(window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
29
|
+
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
30
|
+
const handler = () => {
|
|
31
|
+
if (state.mode() === "system") applySystem();
|
|
32
|
+
};
|
|
33
|
+
mq.addEventListener("change", handler);
|
|
34
|
+
if (mode === "system") applySystem();
|
|
35
|
+
else applyThemeToHtml(mode === "dark");
|
|
36
|
+
return () => mq.removeEventListener("change", handler);
|
|
37
|
+
}).on("button@click", ({ state }) => {
|
|
38
|
+
const next = state.mode() === "light" ? "dark" : state.mode() === "dark" ? "system" : "light";
|
|
39
|
+
state.mode(next);
|
|
40
|
+
setStoredTheme(next);
|
|
41
|
+
if (next === "system") applyThemeToHtml(window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
42
|
+
else applyThemeToHtml(next === "dark");
|
|
43
|
+
}).render(({ state }) => /* @__PURE__ */ jsx(Button, {
|
|
44
|
+
shape: "square",
|
|
45
|
+
"aria-label": state.mode() === "light" ? "Switch to dark theme" : state.mode() === "dark" ? "Switch to system theme" : "Switch to light theme",
|
|
46
|
+
icon: /* @__PURE__ */ jsx(Icon, { icon: state.mode() === "light" ? Sun : state.mode() === "dark" ? Moon : Monitor })
|
|
47
|
+
}));
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Replaced by `GlobalSearch` (body-mounted in `createImprensa().init()`).
|
|
50
|
+
* Kept so the vite plugin island registry stays stable.
|
|
51
|
+
*/
|
|
52
|
+
const SearchOverlay = ilha.render(() => /* @__PURE__ */ jsx(Fragment, {}));
|
|
53
|
+
function SearchSidebarTrigger() {
|
|
54
|
+
return /* @__PURE__ */ jsx("div", {
|
|
55
|
+
class: "relative inline-flex w-full min-w-0",
|
|
56
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
57
|
+
type: "button",
|
|
58
|
+
"data-search-trigger": true,
|
|
59
|
+
"aria-label": "Search documentation",
|
|
60
|
+
icon: /* @__PURE__ */ jsx(Icon, { icon: Search }),
|
|
61
|
+
class: "w-10 justify-center sm:w-full sm:justify-start",
|
|
62
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
63
|
+
class: "hidden sm:inline",
|
|
64
|
+
children: "Search"
|
|
65
|
+
}), /* @__PURE__ */ jsxs("kbd", {
|
|
66
|
+
class: "ml-auto hidden items-center border border-areia-border py-px px-1 rounded-full md:flex",
|
|
67
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
68
|
+
icon: Command,
|
|
69
|
+
class: "size-3"
|
|
70
|
+
}), /* @__PURE__ */ jsx("span", { children: "K" })]
|
|
71
|
+
})]
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function SearchMobileTriggerButton() {
|
|
76
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
77
|
+
type: "button",
|
|
78
|
+
shape: "square",
|
|
79
|
+
"data-search-trigger": true,
|
|
80
|
+
"aria-label": "Search documentation",
|
|
81
|
+
icon: /* @__PURE__ */ jsx(Icon, { icon: Search }),
|
|
82
|
+
class: "shrink-0"
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function SearchNavbarTrigger() {
|
|
86
|
+
return /* @__PURE__ */ jsx("div", {
|
|
87
|
+
class: "relative inline-flex min-w-0",
|
|
88
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
89
|
+
type: "button",
|
|
90
|
+
"data-search-trigger": true,
|
|
91
|
+
"aria-label": "Search documentation",
|
|
92
|
+
icon: /* @__PURE__ */ jsx(Icon, { icon: Search }),
|
|
93
|
+
class: "w-10 shrink-0 justify-center sm:w-auto sm:min-w-[7.5rem] sm:justify-start sm:gap-2 sm:px-3",
|
|
94
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
95
|
+
class: "hidden sm:inline",
|
|
96
|
+
children: "Search"
|
|
97
|
+
}), /* @__PURE__ */ jsxs("kbd", {
|
|
98
|
+
class: "ml-auto hidden items-center border border-areia-border py-px px-1 rounded-full md:inline-flex",
|
|
99
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
100
|
+
icon: Command,
|
|
101
|
+
class: "size-3"
|
|
102
|
+
}), /* @__PURE__ */ jsx("span", { children: "K" })]
|
|
103
|
+
})]
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/components/classes.ts
|
|
109
|
+
function cx(...classes) {
|
|
110
|
+
return classes.filter(Boolean).join(" ");
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/components/nav-footer-bar.tsx
|
|
114
|
+
/** @jsxImportSource ilha */
|
|
115
|
+
function NavFooterBar(props) {
|
|
116
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
117
|
+
class: cx("flex shrink-0 items-center justify-between rounded-lg border border-areia-border bg-areia-surface-muted/60 p-1", props.class),
|
|
118
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
119
|
+
class: "flex items-center gap-0",
|
|
120
|
+
children: socials.map((s) => /* @__PURE__ */ jsx(LinkButton, {
|
|
121
|
+
href: s.url,
|
|
122
|
+
shape: "square",
|
|
123
|
+
variant: "ghost",
|
|
124
|
+
icon: /* @__PURE__ */ jsx(Icon$1, {
|
|
125
|
+
icon: s.service,
|
|
126
|
+
class: "size-4"
|
|
127
|
+
}),
|
|
128
|
+
external: true,
|
|
129
|
+
"aria-label": s.service,
|
|
130
|
+
class: "shrink-0"
|
|
131
|
+
}))
|
|
132
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
133
|
+
class: "ml-auto",
|
|
134
|
+
children: /* @__PURE__ */ jsx(ThemeToggle, {})
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/components/tree-indent.ts
|
|
140
|
+
/** Sidebar / mobile nav tree depth → Tailwind class from `imprensa/default.css`. */
|
|
141
|
+
const TREE_INDENT = [
|
|
142
|
+
"imprensa-tree-indent-0",
|
|
143
|
+
"imprensa-tree-indent-1",
|
|
144
|
+
"imprensa-tree-indent-2",
|
|
145
|
+
"imprensa-tree-indent-3",
|
|
146
|
+
"imprensa-tree-indent-4",
|
|
147
|
+
"imprensa-tree-indent-5",
|
|
148
|
+
"imprensa-tree-indent-6"
|
|
149
|
+
];
|
|
150
|
+
function treeIndentClass(depth) {
|
|
151
|
+
return TREE_INDENT[Math.min(Math.max(depth, 0), TREE_INDENT.length - 1)] ?? TREE_INDENT[6];
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/components/mobile-nav.tsx
|
|
155
|
+
/** @jsxImportSource ilha */
|
|
156
|
+
const ACTIVE_LINK_CLASS = "border-areia-primary text-areia-primary ring-1 ring-areia-primary/30";
|
|
157
|
+
function normalizePath$1(path) {
|
|
158
|
+
return path.replace(/\/$/, "") || "/";
|
|
159
|
+
}
|
|
160
|
+
function renderMobileTree(nodes, currentPath, depth = 0) {
|
|
161
|
+
return nodes.flatMap((node) => {
|
|
162
|
+
const href = node.type === "link" ? node.link : node.path;
|
|
163
|
+
const active = node.path && node.type !== "link" ? normalizePath$1(node.path) === currentPath : false;
|
|
164
|
+
const items = [];
|
|
165
|
+
if (href) items.push(/* @__PURE__ */ jsx(Popover.Close, { children: /* @__PURE__ */ jsx("div", {
|
|
166
|
+
class: treeIndentClass(depth),
|
|
167
|
+
children: /* @__PURE__ */ jsxs(LinkButton, {
|
|
168
|
+
href,
|
|
169
|
+
external: node.external,
|
|
170
|
+
variant: active ? "outline" : "ghost",
|
|
171
|
+
class: cx("w-full justify-start", node.type === "link" && node.external && "justify-between", active && ACTIVE_LINK_CLASS),
|
|
172
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
173
|
+
class: "min-w-0 truncate",
|
|
174
|
+
children: node.title
|
|
175
|
+
}), node.type === "link" && node.external ? /* @__PURE__ */ jsx(Icon, {
|
|
176
|
+
icon: ExternalLink,
|
|
177
|
+
class: "size-3.5 shrink-0"
|
|
178
|
+
}) : null]
|
|
179
|
+
})
|
|
180
|
+
}) }));
|
|
181
|
+
else items.push(/* @__PURE__ */ jsx("span", {
|
|
182
|
+
class: cx("mt-2 block text-sm font-medium text-areia-subtle", treeIndentClass(depth)),
|
|
183
|
+
children: node.title
|
|
184
|
+
}));
|
|
185
|
+
if (node.children.length > 0) items.push(...renderMobileTree(node.children, currentPath, depth + 1));
|
|
186
|
+
return items;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function MobileNavigationPopover(props) {
|
|
190
|
+
const currentPath = normalizePath$1(props.currentPath);
|
|
191
|
+
return /* @__PURE__ */ jsx(Popover, {
|
|
192
|
+
side: "bottom",
|
|
193
|
+
align: "start",
|
|
194
|
+
contentClass: "z-50",
|
|
195
|
+
trigger: /* @__PURE__ */ jsx(Button, {
|
|
196
|
+
shape: "square",
|
|
197
|
+
"aria-label": "Open navigation",
|
|
198
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
199
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
200
|
+
class: "size-5",
|
|
201
|
+
viewBox: "0 0 24 24",
|
|
202
|
+
fill: "none",
|
|
203
|
+
stroke: "currentColor",
|
|
204
|
+
"stroke-width": "2",
|
|
205
|
+
"stroke-linecap": "round",
|
|
206
|
+
"stroke-linejoin": "round",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsx("line", {
|
|
209
|
+
x1: "3",
|
|
210
|
+
y1: "6",
|
|
211
|
+
x2: "21",
|
|
212
|
+
y2: "6"
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ jsx("line", {
|
|
215
|
+
x1: "3",
|
|
216
|
+
y1: "12",
|
|
217
|
+
x2: "21",
|
|
218
|
+
y2: "12"
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ jsx("line", {
|
|
221
|
+
x1: "3",
|
|
222
|
+
y1: "18",
|
|
223
|
+
x2: "21",
|
|
224
|
+
y2: "18"
|
|
225
|
+
})
|
|
226
|
+
]
|
|
227
|
+
})
|
|
228
|
+
}),
|
|
229
|
+
content: /* @__PURE__ */ jsxs("div", {
|
|
230
|
+
class: "flex w-64 max-h-[70dvh] flex-col gap-2 p-1",
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ jsx("div", {
|
|
233
|
+
class: "flex shrink-0 items-center px-1 pb-1",
|
|
234
|
+
children: /* @__PURE__ */ jsx(LogoButton, {})
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ jsx("nav", {
|
|
237
|
+
class: "min-h-0 flex-1 overflow-y-auto flex flex-col gap-1",
|
|
238
|
+
children: renderMobileTree(contentTree, currentPath)
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ jsx(NavFooterBar, {})
|
|
241
|
+
]
|
|
242
|
+
})
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/components/doc-pager.tsx
|
|
247
|
+
/** @jsxImportSource ilha */
|
|
248
|
+
const EXCERPT_MAX = 160;
|
|
249
|
+
function excerptForPath(path) {
|
|
250
|
+
const normalized = normalizePath(path);
|
|
251
|
+
const meta = contentMeta[normalized];
|
|
252
|
+
if (meta?.description?.trim()) return meta.description.trim();
|
|
253
|
+
const text = searchDocuments.find((d) => normalizePath(d.path) === normalized)?.text?.trim();
|
|
254
|
+
if (!text) return "";
|
|
255
|
+
if (text.length <= EXCERPT_MAX) return text;
|
|
256
|
+
const slice = text.slice(0, EXCERPT_MAX);
|
|
257
|
+
const lastSpace = slice.lastIndexOf(" ");
|
|
258
|
+
return `${(lastSpace > 80 ? slice.slice(0, lastSpace) : slice).trim()}…`;
|
|
259
|
+
}
|
|
260
|
+
function normalizePath(path) {
|
|
261
|
+
return path.replace(/\/$/, "") || "/";
|
|
262
|
+
}
|
|
263
|
+
function flattenContentTree(nodes) {
|
|
264
|
+
const pages = [];
|
|
265
|
+
for (const node of nodes) {
|
|
266
|
+
if (node.path && node.type !== "link") pages.push({
|
|
267
|
+
title: node.title,
|
|
268
|
+
path: node.path
|
|
269
|
+
});
|
|
270
|
+
if (node.children.length > 0) pages.push(...flattenContentTree(node.children));
|
|
271
|
+
}
|
|
272
|
+
return pages;
|
|
273
|
+
}
|
|
274
|
+
function getAdjacentDocs(path) {
|
|
275
|
+
const pages = flattenContentTree(contentTree);
|
|
276
|
+
const index = pages.findIndex((page) => normalizePath(page.path) === normalizePath(path));
|
|
277
|
+
if (index === -1) return {};
|
|
278
|
+
const toNavItem = (page) => ({
|
|
279
|
+
...page,
|
|
280
|
+
excerpt: excerptForPath(page.path)
|
|
281
|
+
});
|
|
282
|
+
return {
|
|
283
|
+
prev: index > 0 ? toNavItem(pages[index - 1]) : void 0,
|
|
284
|
+
next: index < pages.length - 1 ? toNavItem(pages[index + 1]) : void 0
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function DocNavCard(props) {
|
|
288
|
+
const isPrev = props.direction === "prev";
|
|
289
|
+
return /* @__PURE__ */ jsx("a", {
|
|
290
|
+
href: props.item.path,
|
|
291
|
+
class: "group block h-full no-underline",
|
|
292
|
+
children: /* @__PURE__ */ jsx(LayerCard, {
|
|
293
|
+
class: "h-full transition-colors group-hover:bg-areia-control-hover",
|
|
294
|
+
children: /* @__PURE__ */ jsxs(LayerCard.Content, {
|
|
295
|
+
class: "flex flex-col gap-2 p-4",
|
|
296
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
297
|
+
class: cx("flex items-center gap-1.5 text-sm font-medium text-areia-strong", !isPrev && "justify-end text-right"),
|
|
298
|
+
children: [
|
|
299
|
+
isPrev ? /* @__PURE__ */ jsx(Icon, {
|
|
300
|
+
icon: ChevronLeft,
|
|
301
|
+
class: "size-4 shrink-0"
|
|
302
|
+
}) : null,
|
|
303
|
+
/* @__PURE__ */ jsx("span", { children: props.item.title }),
|
|
304
|
+
!isPrev ? /* @__PURE__ */ jsx(Icon, {
|
|
305
|
+
icon: ChevronRight,
|
|
306
|
+
class: "size-4 shrink-0"
|
|
307
|
+
}) : null
|
|
308
|
+
]
|
|
309
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
310
|
+
class: cx("line-clamp-2 text-sm text-areia-subtle", !isPrev && "text-right"),
|
|
311
|
+
children: props.item.excerpt
|
|
312
|
+
})]
|
|
313
|
+
})
|
|
314
|
+
})
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
function DocPager(props) {
|
|
318
|
+
const { prev, next } = getAdjacentDocs(props.path);
|
|
319
|
+
if (!prev && !next) return null;
|
|
320
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
321
|
+
class: "not-prose grid gap-4 py-12 sm:grid-cols-2",
|
|
322
|
+
"aria-label": "Documentation pagination",
|
|
323
|
+
children: [prev ? /* @__PURE__ */ jsx(DocNavCard, {
|
|
324
|
+
item: prev,
|
|
325
|
+
direction: "prev"
|
|
326
|
+
}) : /* @__PURE__ */ jsx("div", { "aria-hidden": "true" }), next ? /* @__PURE__ */ jsx(DocNavCard, {
|
|
327
|
+
item: next,
|
|
328
|
+
direction: "next"
|
|
329
|
+
}) : /* @__PURE__ */ jsx("div", { "aria-hidden": "true" })]
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/components/doc-toolbar.tsx
|
|
334
|
+
function absoluteUrl(path) {
|
|
335
|
+
if (typeof window === "undefined") return path;
|
|
336
|
+
return new URL(path, window.location.origin).href;
|
|
337
|
+
}
|
|
338
|
+
function aiPromptUrl(service, markdownUrl) {
|
|
339
|
+
const prompt = `Read ${markdownUrl}`;
|
|
340
|
+
const encoded = encodeURIComponent(prompt);
|
|
341
|
+
if (service === "chatgpt") return `https://chatgpt.com/?q=${encoded}`;
|
|
342
|
+
return `https://claude.ai/new?q=${encoded}`;
|
|
343
|
+
}
|
|
344
|
+
async function copyMarkdownForRoute(route) {
|
|
345
|
+
const links = getDocLinks(route);
|
|
346
|
+
if (!links) return;
|
|
347
|
+
try {
|
|
348
|
+
const text = links.rawMarkdown ?? await fetch(links.markdownUrl).then((response) => {
|
|
349
|
+
if (!response.ok) throw new Error("Failed to fetch markdown");
|
|
350
|
+
return response.text();
|
|
351
|
+
});
|
|
352
|
+
await navigator.clipboard.writeText(text);
|
|
353
|
+
toast.success("Markdown copied to clipboard");
|
|
354
|
+
} catch {
|
|
355
|
+
toast.error("Failed to copy markdown");
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
const DocToolbar = ilha.input().render(({ input }) => {
|
|
359
|
+
const links = getDocLinks(input.path);
|
|
360
|
+
if (!links) return /* @__PURE__ */ jsx(Fragment, {});
|
|
361
|
+
const markdownUrl = absoluteUrl(links.markdownUrl);
|
|
362
|
+
const items = [
|
|
363
|
+
{
|
|
364
|
+
label: "Copy Markdown",
|
|
365
|
+
value: "copy-markdown",
|
|
366
|
+
icon: /* @__PURE__ */ jsx(Icon, {
|
|
367
|
+
icon: Copy,
|
|
368
|
+
class: "size-4"
|
|
369
|
+
})
|
|
370
|
+
},
|
|
371
|
+
...links.githubUrl ? [{
|
|
372
|
+
label: "Open in GitHub",
|
|
373
|
+
href: links.githubUrl,
|
|
374
|
+
external: true,
|
|
375
|
+
icon: /* @__PURE__ */ jsx(Icon, {
|
|
376
|
+
icon: GitBranch,
|
|
377
|
+
class: "size-4"
|
|
378
|
+
})
|
|
379
|
+
}] : [],
|
|
380
|
+
{
|
|
381
|
+
label: "View as Markdown",
|
|
382
|
+
href: links.markdownUrl,
|
|
383
|
+
external: true,
|
|
384
|
+
icon: /* @__PURE__ */ jsx(Icon, {
|
|
385
|
+
icon: FileText,
|
|
386
|
+
class: "size-4"
|
|
387
|
+
}),
|
|
388
|
+
"data-no-intercept": true
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
label: "Open in ChatGPT",
|
|
392
|
+
href: aiPromptUrl("chatgpt", markdownUrl),
|
|
393
|
+
external: true,
|
|
394
|
+
icon: /* @__PURE__ */ jsx(Icon, {
|
|
395
|
+
icon: MessageSquare,
|
|
396
|
+
class: "size-4"
|
|
397
|
+
})
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
label: "Open in Claude",
|
|
401
|
+
href: aiPromptUrl("claude", markdownUrl),
|
|
402
|
+
external: true,
|
|
403
|
+
icon: /* @__PURE__ */ jsx(Icon, {
|
|
404
|
+
icon: ExternalLink,
|
|
405
|
+
class: "size-4"
|
|
406
|
+
})
|
|
407
|
+
}
|
|
408
|
+
];
|
|
409
|
+
const { path: routePath } = useRoute();
|
|
410
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
411
|
+
class: "not-prose fixed inset-x-0 top-0 z-30 mb-6 flex w-auto flex-wrap items-center justify-between gap-2 border-b border-areia-border bg-areia-background/90 px-4 py-2 backdrop-blur md:static md:inset-auto md:w-full md:border-b-0 md:bg-transparent md:p-0 md:backdrop-blur-none",
|
|
412
|
+
"data-doc-route": input.path,
|
|
413
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
414
|
+
class: "flex shrink-0 items-center gap-2 md:hidden",
|
|
415
|
+
children: [/* @__PURE__ */ jsx(MobileNavigationPopover, { currentPath: routePath() }), /* @__PURE__ */ jsx(SearchMobileTriggerButton, {})]
|
|
416
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
417
|
+
class: "flex flex-wrap items-center justify-end gap-2 md:ml-auto",
|
|
418
|
+
children: /* @__PURE__ */ jsx(Dropdown, {
|
|
419
|
+
align: "end",
|
|
420
|
+
side: "bottom",
|
|
421
|
+
onSelect: (value) => {
|
|
422
|
+
if (value === "copy-markdown") copyMarkdownForRoute(input.path);
|
|
423
|
+
},
|
|
424
|
+
trigger: /* @__PURE__ */ jsx(Button, {
|
|
425
|
+
variant: "outline",
|
|
426
|
+
shape: "square",
|
|
427
|
+
"aria-label": "Open",
|
|
428
|
+
class: "shrink-0 md:!size-auto md:!h-9 md:min-w-[4.5rem] md:gap-1.5 md:rounded-lg md:px-3",
|
|
429
|
+
icon: /* @__PURE__ */ jsx(Icon, {
|
|
430
|
+
icon: ChevronDown,
|
|
431
|
+
class: "size-4"
|
|
432
|
+
}),
|
|
433
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
434
|
+
class: "hidden md:inline",
|
|
435
|
+
children: "Open In"
|
|
436
|
+
})
|
|
437
|
+
}),
|
|
438
|
+
items
|
|
439
|
+
})
|
|
440
|
+
})]
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
function DocArticle(props) {
|
|
444
|
+
const meta = contentMeta[props.path.replace(/\/$/, "") || "/"];
|
|
445
|
+
const articleClasses = props.class ?? (meta?.type === "custom" ? "w-full max-w-none" : articleClass);
|
|
446
|
+
const isCustom = meta?.type === "custom";
|
|
447
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
448
|
+
class: cx("flex min-h-0 w-full flex-1 flex-col", !isCustom && "mx-auto max-w-4xl pt-14 md:pt-0"),
|
|
449
|
+
children: [
|
|
450
|
+
isCustom ? null : /* @__PURE__ */ jsx(DocToolbar, { path: props.path }),
|
|
451
|
+
/* @__PURE__ */ jsx("article", {
|
|
452
|
+
class: cx(articleClasses, "flex-1"),
|
|
453
|
+
children: props.children
|
|
454
|
+
}),
|
|
455
|
+
isCustom ? null : /* @__PURE__ */ jsx(DocPager, { path: props.path })
|
|
456
|
+
]
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
//#endregion
|
|
460
|
+
export { treeIndentClass as a, LogoButton as c, SearchSidebarTrigger as d, ThemeToggle as f, getAdjacentDocs as i, SearchNavbarTrigger as l, DocToolbar as n, NavFooterBar as o, DocPager as r, cx as s, DocArticle as t, SearchOverlay as u };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { n as ImprensaSocialService, t as ImprensaSocialLink } from "../socials-BIszPk-A.mjs";
|
|
2
|
+
import { t as ImprensaShikiOptions } from "../shiki-gFey7C-z.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/docs/config.d.ts
|
|
5
|
+
declare const socials: ImprensaSocialLink[];
|
|
6
|
+
declare const shiki: ImprensaShikiOptions;
|
|
7
|
+
declare const hostname = "";
|
|
8
|
+
declare const shikiThemes: {
|
|
9
|
+
light: string;
|
|
10
|
+
dark: string;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { type ImprensaSocialLink, type ImprensaSocialService, hostname, shiki, shikiThemes, socials };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/docs/landing-shiki.d.ts
|
|
2
|
+
/** Build-time stub; Vite replaces this via `imprensa:config` when `src/lib/landing-snippets.ts` exists. */
|
|
3
|
+
declare const fileTreeHtml = "";
|
|
4
|
+
declare const mdxHtml = "";
|
|
5
|
+
declare const buildHtml = "";
|
|
6
|
+
//#endregion
|
|
7
|
+
export { buildHtml, fileTreeHtml, mdxHtml };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/docs/landing-shiki.ts
|
|
2
|
+
/** Build-time stub; Vite replaces this via `imprensa:config` when `src/lib/landing-snippets.ts` exists. */
|
|
3
|
+
const fileTreeHtml = "";
|
|
4
|
+
const mdxHtml = "";
|
|
5
|
+
const buildHtml = "";
|
|
6
|
+
//#endregion
|
|
7
|
+
export { buildHtml, fileTreeHtml, mdxHtml };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { RawHtml } from "ilha";
|
|
2
|
+
import { ResolvableHead } from "unhead/types";
|
|
3
|
+
|
|
4
|
+
//#region src/docs/mdx/runtime-config.d.ts
|
|
5
|
+
declare const headDefaults: ResolvableHead | null;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/docs/mdx/types.d.ts
|
|
8
|
+
type MdxContent = string | RawHtml;
|
|
9
|
+
type ContentPageType = "doc" | "custom" | "link";
|
|
10
|
+
type ContentMeta = {
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
order?: number;
|
|
14
|
+
priority: number;
|
|
15
|
+
type: ContentPageType;
|
|
16
|
+
link?: string;
|
|
17
|
+
external?: boolean;
|
|
18
|
+
section?: string;
|
|
19
|
+
badge?: string;
|
|
20
|
+
draft?: boolean;
|
|
21
|
+
hidden?: boolean;
|
|
22
|
+
tags: string[];
|
|
23
|
+
};
|
|
24
|
+
type ContentTreeNode = {
|
|
25
|
+
title: string;
|
|
26
|
+
path?: string;
|
|
27
|
+
type: ContentPageType;
|
|
28
|
+
link?: string;
|
|
29
|
+
external?: boolean;
|
|
30
|
+
priority: number;
|
|
31
|
+
order?: number;
|
|
32
|
+
description?: string;
|
|
33
|
+
badge?: string;
|
|
34
|
+
children: ContentTreeNode[];
|
|
35
|
+
};
|
|
36
|
+
type SearchDocument = {
|
|
37
|
+
id: string;
|
|
38
|
+
title: string;
|
|
39
|
+
path: string;
|
|
40
|
+
text: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
tags: string[];
|
|
43
|
+
};
|
|
44
|
+
declare const articleClass: string;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/docs/mdx/routes.d.ts
|
|
47
|
+
declare const contentMeta: Record<string, ContentMeta>;
|
|
48
|
+
declare const contentTree: ContentTreeNode[];
|
|
49
|
+
declare const searchDocuments: SearchDocument[];
|
|
50
|
+
declare const mdxRoutes: string[];
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/docs/mdx/render.d.ts
|
|
53
|
+
declare function setPrerenderedMdxHtml(html: string | undefined): void;
|
|
54
|
+
declare function getPrerenderedMdxHtml(): string | undefined;
|
|
55
|
+
declare function getClientPrerenderedMdxHtml(path: string): string | undefined;
|
|
56
|
+
declare function renderMdxContent(url: string): Promise<MdxContent | undefined>;
|
|
57
|
+
declare function getMdxHead(url: string): Promise<ResolvableHead | undefined>;
|
|
58
|
+
declare function renderMdx(url: string): Promise<{
|
|
59
|
+
html: string;
|
|
60
|
+
path: string;
|
|
61
|
+
} | undefined>;
|
|
62
|
+
declare function loadMdxHtml(path: string): Promise<import("ilha").RawHtml | null>;
|
|
63
|
+
declare function getMdxContent(path: string): import("ilha").RawHtml | undefined;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/docs/mdx/source-links.d.ts
|
|
66
|
+
declare function getMdxSourceForRoute(routePath: string): {
|
|
67
|
+
routePath: string;
|
|
68
|
+
sourceFile: string;
|
|
69
|
+
markdownUrl: string;
|
|
70
|
+
ext: string;
|
|
71
|
+
} | undefined;
|
|
72
|
+
declare function getDocLinks(routePath: string): {
|
|
73
|
+
routePath: string;
|
|
74
|
+
markdownUrl: string;
|
|
75
|
+
githubUrl: string | undefined;
|
|
76
|
+
rawMarkdown: string;
|
|
77
|
+
} | undefined;
|
|
78
|
+
//#endregion
|
|
79
|
+
export { type ContentMeta, type ContentPageType, type ContentTreeNode, type SearchDocument, articleClass, contentMeta, contentTree, getClientPrerenderedMdxHtml, getDocLinks, getMdxContent, getMdxHead, getMdxSourceForRoute, getPrerenderedMdxHtml, headDefaults, loadMdxHtml, mdxRoutes, renderMdx, renderMdxContent, searchDocuments, setPrerenderedMdxHtml };
|