ardo 3.2.1 → 3.4.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/README.md +49 -41
- package/dist/{DocPage-CIBiCAxZ.js → DocPage-Dy7OrCP2.js} +160 -31
- package/dist/DocPage-Dy7OrCP2.js.map +1 -0
- package/dist/assets/src/ui/DocPage.css.ts.vanilla-CWL92vUE.css +117 -0
- package/dist/assets/src/ui/ErrorBoundary.css.ts.vanilla-C4usIU4z.css +112 -0
- package/dist/assets/src/ui/Footer.css.ts.vanilla-DGTyff5Y.css +171 -0
- package/dist/assets/src/ui/{Header.css.ts.vanilla-8QL0Jzgk.css → Header.css.ts.vanilla-DEcLj8r0.css} +53 -27
- package/dist/assets/src/ui/{Layout.css.ts.vanilla-Bpx_-gJt.css → Layout.css.ts.vanilla-ClOa1YZm.css} +6 -10
- package/dist/assets/src/ui/Sidebar.css.ts.vanilla-IxNEQEBv.css +199 -0
- package/dist/assets/src/ui/{Toc.css.ts.vanilla-CYqcWgvD.css → Toc.css.ts.vanilla-CQbpEdTg.css} +9 -21
- package/dist/assets/src/ui/components/{CodeBlock.css.ts.vanilla-lNKqskjQ.css → CodeBlock.css.ts.vanilla-BxDJ2gKc.css} +38 -20
- package/dist/assets/src/ui/components/{CopyButton.css.ts.vanilla-DZZ5jgTM.css → CopyButton.css.ts.vanilla-CO2awD6S.css} +6 -7
- package/dist/assets/src/ui/components/{Features.css.ts.vanilla-D-pNXM9Q.css → Features.css.ts.vanilla-ggYasCFy.css} +7 -3
- package/dist/assets/src/ui/components/HeaderSearch.css.ts.vanilla-KAo_Mlc-.css +68 -0
- package/dist/assets/src/ui/components/{Hero.css.ts.vanilla-DHJVZ6GX.css → Hero.css.ts.vanilla-DY_BH0W6.css} +9 -6
- package/dist/assets/src/ui/components/{Search.css.ts.vanilla-BYpWHzky.css → Search.css.ts.vanilla-NQZH1eLo.css} +19 -7
- package/dist/assets/src/ui/{content.css.ts.vanilla-O_RaSPXm.css → content.css.ts.vanilla-CJnrOQNh.css} +43 -17
- package/dist/assets/src/ui/theme/{dark.css.ts.vanilla-2iJgcpbU.css → dark.css.ts.vanilla-CQef5pk2.css} +32 -28
- package/dist/assets/src/ui/theme/{light.css.ts.vanilla-CwinfWSf.css → light.css.ts.vanilla-D8gxaS1c.css} +32 -28
- package/dist/assets/src/ui/theme/{reset.css.ts.vanilla-0Q3pLjfC.css → reset.css.ts.vanilla-e2dF1d0f.css} +4 -0
- package/dist/{brand-icons-DLJKqTun.js → brand-icons-Di8w0Nu9.js} +1 -1
- package/dist/{brand-icons-DLJKqTun.js.map → brand-icons-Di8w0Nu9.js.map} +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/{contract.css-DYvFVCFE.d.ts → contract.css-qPyk_asd.d.ts} +5 -1
- package/dist/contract.css-qPyk_asd.d.ts.map +1 -0
- package/dist/favicon-Cx-inut3.js +7 -0
- package/dist/favicon-Cx-inut3.js.map +1 -0
- package/dist/{generator-DPtRXxM_.js → generator-CYSyo4Vz.js} +7 -6
- package/dist/generator-CYSyo4Vz.js.map +1 -0
- package/dist/icons/index.js +1 -1
- package/dist/{index-BTeHvysI.d.ts → index-BcekgOfA.d.ts} +82 -12
- package/dist/index-BcekgOfA.d.ts.map +1 -0
- package/dist/{index-DySzkJlC.d.ts → index-CuMTHUxX.d.ts} +8 -2
- package/dist/index-CuMTHUxX.d.ts.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/mdx/provider.js +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/{sidebar-utils-1Skqle1Q.js → sidebar-utils-C06DJsx4.js} +15 -4
- package/dist/sidebar-utils-C06DJsx4.js.map +1 -0
- package/dist/theme/index.d.ts +16 -4
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +84 -59
- package/dist/theme/index.js.map +1 -1
- package/dist/typedoc/components/index.d.ts +1 -1
- package/dist/typedoc/index.d.ts +1 -1
- package/dist/typedoc/index.d.ts.map +1 -1
- package/dist/typedoc/index.js +1 -1
- package/dist/{types-CTd_mkrv.d.ts → types-B75OhnGa.d.ts} +21 -3
- package/dist/types-B75OhnGa.d.ts.map +1 -0
- package/dist/{types-BCuJBsJu.d.ts → types-Ck2Vm7NB.d.ts} +2 -2
- package/dist/{types-BCuJBsJu.d.ts.map → types-Ck2Vm7NB.d.ts.map} +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +3 -3
- package/dist/ui/styles.css +704 -382
- package/dist/ui/styles.js +15 -15
- package/dist/{ui-3grzJSsq.js → ui-AGPGBunC.js} +729 -280
- package/dist/ui-AGPGBunC.js.map +1 -0
- package/dist/vite/index.d.ts +18 -2
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +446 -121
- package/dist/vite/index.js.map +1 -1
- package/package.json +14 -13
- package/dist/DocPage-CIBiCAxZ.js.map +0 -1
- package/dist/assets/src/ui/DocPage.css.ts.vanilla-CXKuz4U-.css +0 -34
- package/dist/assets/src/ui/Footer.css.ts.vanilla-BSzPIPt4.css +0 -100
- package/dist/assets/src/ui/Sidebar.css.ts.vanilla-D70qXTEr.css +0 -115
- package/dist/contract.css-DYvFVCFE.d.ts.map +0 -1
- package/dist/generator-DPtRXxM_.js.map +0 -1
- package/dist/index-BTeHvysI.d.ts.map +0 -1
- package/dist/index-DySzkJlC.d.ts.map +0 -1
- package/dist/sidebar-utils-1Skqle1Q.js.map +0 -1
- package/dist/types-CTd_mkrv.d.ts.map +0 -1
- package/dist/ui-3grzJSsq.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
# ardo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Modern, open documentation for React teams.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ardo is a React-first static documentation framework built on React 19, React Router 7, Vite 8, MDX, TypeScript, and Vanilla Extract. It is for teams that want VitePress-style simplicity without leaving React or moving their docs into a hosted platform.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Why use it?
|
|
8
|
+
|
|
9
|
+
- **Use real React components in docs** - import your app components, design system, providers, and examples directly in MDX.
|
|
10
|
+
- **Ship static docs anywhere** - Ardo prerenders HTML and assets that work on GitHub Pages, Vercel, Netlify, Cloudflare Pages, or any file server.
|
|
11
|
+
- **Generate API docs from TypeScript** - TypeDoc integration creates linked API reference pages during build.
|
|
12
|
+
- **Start with a complete theme** - responsive layout, sidebar, TOC, search, dark mode, code highlighting, callouts, tabs, Tailwind v4, and typed design tokens.
|
|
13
|
+
- **Keep control** - configuration is code, UI is React, output is static, and the package is open source.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
8
16
|
|
|
9
17
|
```bash
|
|
10
18
|
pnpm create ardo@latest my-docs
|
|
@@ -13,80 +21,80 @@ pnpm install
|
|
|
13
21
|
pnpm dev
|
|
14
22
|
```
|
|
15
23
|
|
|
16
|
-
## Manual
|
|
24
|
+
## Manual installation
|
|
17
25
|
|
|
18
26
|
```bash
|
|
19
|
-
pnpm add ardo react react-dom react-router
|
|
20
|
-
pnpm add -D typescript vite
|
|
27
|
+
pnpm add ardo react react-dom react-router isbot
|
|
28
|
+
pnpm add -D @react-router/dev @tailwindcss/vite tailwindcss typescript vite @types/react @types/react-dom
|
|
21
29
|
```
|
|
22
30
|
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
### Vite Configuration
|
|
26
|
-
|
|
27
|
-
Create a `vite.config.ts` with your Ardo configuration:
|
|
31
|
+
## Vite configuration
|
|
28
32
|
|
|
29
|
-
```
|
|
33
|
+
```ts
|
|
30
34
|
import { defineConfig } from "vite"
|
|
35
|
+
import tailwindcss from "@tailwindcss/vite"
|
|
31
36
|
import { ardo } from "ardo/vite"
|
|
32
37
|
|
|
33
38
|
export default defineConfig({
|
|
34
39
|
plugins: [
|
|
40
|
+
tailwindcss(),
|
|
35
41
|
ardo({
|
|
36
42
|
title: "My Documentation",
|
|
37
|
-
description: "
|
|
43
|
+
description: "Docs for my React library",
|
|
38
44
|
}),
|
|
39
45
|
],
|
|
40
46
|
})
|
|
41
47
|
```
|
|
42
48
|
|
|
43
|
-
The `ardo()` plugin
|
|
49
|
+
The `ardo()` plugin handles build-time behavior: route generation, MDX processing, TypeDoc generation, search data, and static build metadata. UI configuration stays in React through `ArdoRoot` and component props.
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
Ardo also generates the modern lean favicon set (`favicon.ico`, `icon.svg`, and `apple-touch-icon.png`) from the default Ardo mark. Use `icons: { source: "./app/assets/logo.svg" }` to generate those files from your own SVG, or `icons: false` to manage them from `public/`.
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
## Root layout
|
|
48
54
|
|
|
49
55
|
```tsx
|
|
50
|
-
import {
|
|
56
|
+
import { ArdoRoot, ArdoRootLayout } from "ardo/ui"
|
|
57
|
+
import config from "virtual:ardo/config"
|
|
58
|
+
import sidebar from "virtual:ardo/sidebar"
|
|
59
|
+
import "ardo/ui/styles.css"
|
|
51
60
|
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const page = useArdoPageData()
|
|
56
|
-
const toc = useArdoTOC()
|
|
61
|
+
export function Layout({ children }: { children: React.ReactNode }) {
|
|
62
|
+
return <ArdoRootLayout>{children}</ArdoRootLayout>
|
|
63
|
+
}
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
export default function Root() {
|
|
66
|
+
return <ArdoRoot config={config} sidebar={sidebar} />
|
|
59
67
|
}
|
|
60
68
|
```
|
|
61
69
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Use pre-built components for your documentation:
|
|
70
|
+
## Runtime hooks
|
|
65
71
|
|
|
66
72
|
```tsx
|
|
67
|
-
import {
|
|
68
|
-
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
import { useArdoConfig, useArdoPageData, useArdoSidebar, useArdoTOC } from "ardo/runtime"
|
|
74
|
+
|
|
75
|
+
function PageTitle() {
|
|
76
|
+
const config = useArdoConfig()
|
|
77
|
+
const page = useArdoPageData()
|
|
78
|
+
const sidebar = useArdoSidebar()
|
|
79
|
+
const toc = useArdoTOC()
|
|
80
|
+
|
|
81
|
+
return <h1>{page?.title ?? config.title}</h1>
|
|
75
82
|
}
|
|
76
83
|
```
|
|
77
84
|
|
|
78
85
|
## Exports
|
|
79
86
|
|
|
80
|
-
| Export | Description
|
|
81
|
-
| -------------------- |
|
|
82
|
-
| `ardo/vite` | Vite plugin
|
|
83
|
-
| `ardo/runtime` | React hooks and providers
|
|
84
|
-
| `ardo/ui` |
|
|
85
|
-
| `ardo/
|
|
87
|
+
| Export | Description |
|
|
88
|
+
| -------------------- | ---------------------------------- |
|
|
89
|
+
| `ardo/vite` | Vite plugin |
|
|
90
|
+
| `ardo/runtime` | React hooks and providers |
|
|
91
|
+
| `ardo/ui` | Default UI components |
|
|
92
|
+
| `ardo/theme` | Vanilla Extract tokens and theming |
|
|
93
|
+
| `ardo/ui/styles.css` | Default theme styles |
|
|
86
94
|
|
|
87
95
|
## Documentation
|
|
88
96
|
|
|
89
|
-
Full documentation
|
|
97
|
+
Full documentation: [ardo-docs.dev](https://ardo-docs.dev)
|
|
90
98
|
|
|
91
99
|
LLM-optimized documentation: [llms-full.txt](https://ardo-docs.dev/llms-full.txt)
|
|
92
100
|
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { d as
|
|
1
|
+
import { d as useArdoSidebar, f as useArdoSiteConfig, n as getPrevNextLinks, p as useArdoTOC, r as ArdoContext, s as useArdoConfig, u as useArdoPageData } from "./sidebar-utils-C06DJsx4.js";
|
|
2
|
+
import { t as ARDO_FAVICON_DATA_URL } from "./favicon-Cx-inut3.js";
|
|
2
3
|
import { Children, createContext, isValidElement, use, useEffect, useMemo, useRef, useState } from "react";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { Link, Links, Meta, Scripts, ScrollRestoration, useLocation } from "react-router";
|
|
5
|
-
import
|
|
6
|
-
import "./assets/src/ui/Footer.css.ts.vanilla-
|
|
7
|
-
import "
|
|
8
|
-
import "./assets/src/ui/components/
|
|
9
|
-
import "./assets/src/ui/components/
|
|
6
|
+
import "./assets/src/ui/Layout.css.ts.vanilla-ClOa1YZm.css";
|
|
7
|
+
import "./assets/src/ui/Footer.css.ts.vanilla-DGTyff5Y.css";
|
|
8
|
+
import { BookOpen as BookOpenIcon, Box as BoxIcon, Check as CheckIcon, ChevronDown as ChevronDownIcon, CircleX as XCircleIcon, Code2 as CodeIcon, Copy as CopyIcon, FileCode2 as FileCodeIcon, FileText as FileTextIcon, Info as InfoIcon, Lightbulb as LightbulbIcon, MessageCircle as MessageCircleIcon, Monitor as MonitorIcon, Moon as MoonIcon, Package as PackageIcon, Search as SearchIcon, Settings as SettingsIcon, Sun as SunIcon, TriangleAlert as AlertTriangleIcon, Wrench as WrenchIcon, X as XIcon } from "lucide-react";
|
|
9
|
+
import "./assets/src/ui/components/CopyButton.css.ts.vanilla-CO2awD6S.css";
|
|
10
|
+
import "./assets/src/ui/components/CodeBlock.css.ts.vanilla-BxDJ2gKc.css";
|
|
10
11
|
import "./assets/src/ui/components/Container.css.ts.vanilla-CUhRUA9t.css";
|
|
11
12
|
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
12
13
|
import "./assets/src/ui/components/Steps.css.ts.vanilla-CisaxeNj.css";
|
|
13
14
|
import "./assets/src/ui/components/Tabs.css.ts.vanilla-C4-vJSnf.css";
|
|
14
15
|
import "./assets/src/ui/Breadcrumb.css.ts.vanilla-Dpgq-C_p.css";
|
|
15
|
-
import "./assets/src/ui/content.css.ts.vanilla-
|
|
16
|
-
import "./assets/src/ui/DocPage.css.ts.vanilla-
|
|
17
|
-
import "./assets/src/ui/Toc.css.ts.vanilla-
|
|
16
|
+
import "./assets/src/ui/content.css.ts.vanilla-CJnrOQNh.css";
|
|
17
|
+
import "./assets/src/ui/DocPage.css.ts.vanilla-CWL92vUE.css";
|
|
18
|
+
import "./assets/src/ui/Toc.css.ts.vanilla-CQbpEdTg.css";
|
|
18
19
|
//#region src/ui/Footer.css.ts
|
|
19
|
-
var contentMeta = "
|
|
20
|
+
var contentMeta = "_169q00bb";
|
|
20
21
|
var footer = "_169q00b0";
|
|
21
|
-
var
|
|
22
|
+
var footerArdoLink = "_169q00b5";
|
|
23
|
+
var footerBuildTime = "_169q00b9";
|
|
22
24
|
var footerContainer = "_169q00b1";
|
|
23
|
-
var footerCopyright = "
|
|
25
|
+
var footerCopyright = "_169q00b8";
|
|
24
26
|
var footerLink = "_169q00b4";
|
|
25
|
-
var footerMessage = "
|
|
27
|
+
var footerMessage = "_169q00b7";
|
|
28
|
+
var footerOwl = "_169q00b6";
|
|
26
29
|
var footerPrimary = "_169q00b2";
|
|
27
30
|
var footerSeparator = "_169q00b3";
|
|
28
|
-
var nextLink = "_169q00be
|
|
29
|
-
var prevLink = "
|
|
30
|
-
var prevNext = "
|
|
31
|
-
var prevNextLabel = "
|
|
32
|
-
var prevNextTitle = "
|
|
31
|
+
var nextLink = "_169q00bg _169q00be";
|
|
32
|
+
var prevLink = "_169q00be";
|
|
33
|
+
var prevNext = "_169q00bd";
|
|
34
|
+
var prevNextLabel = "_169q00bh";
|
|
35
|
+
var prevNextTitle = "_169q00bi";
|
|
33
36
|
//#endregion
|
|
34
37
|
//#region src/ui/Layout.css.ts
|
|
35
38
|
var home = "_8autjm3";
|
|
@@ -40,7 +43,6 @@ var main = "_8autjm2";
|
|
|
40
43
|
var skipLink = "_8autjm5";
|
|
41
44
|
//#endregion
|
|
42
45
|
//#region src/ui/Layout.tsx
|
|
43
|
-
const ARDO_FAVICON = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22stroke-linecap%3Around%3Bstroke-linejoin%3Around%22%20viewBox%3D%220%200%20600%20600%22%3E%3Cdefs%3E%3Csymbol%20id%3D%22a%22%20overflow%3D%22visible%22%3E%3Cpath%20d%3D%22M300%20300%20151%20128l2%20178-41%2094h93c-35%2032-55%2068-63%20107m63-106%2095%2081m-32-96%2028%2088%22%2F%3E%3Cellipse%20cx%3D%22222%22%20cy%3D%22327%22%20fill%3D%22%2300655a%22%20rx%3D%2220%22%20ry%3D%2233%22%2F%3E%3Ccircle%20cx%3D%22227%22%20cy%3D%22324%22%20r%3D%2271%22%2F%3E%3C%2Fsymbol%3E%3C%2Fdefs%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%2300655a%22%20stroke-width%3D%2216%22%3E%3Cpath%20d%3D%22M155%20318c2-70%2066-126%20145-126s143%2056%20145%20126%22%2F%3E%3Ccircle%20cx%3D%22300%22%20cy%3D%22290%22%20r%3D%22270%22%2F%3E%3Cuse%20href%3D%22%23a%22%2F%3E%3Cuse%20href%3D%22%23a%22%20transform%3D%22matrix%28-1%200%200%201%20600%200%29%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E";
|
|
44
46
|
/**
|
|
45
47
|
* Default HTML shell for Ardo sites. Replaces the boilerplate `Layout` export
|
|
46
48
|
* that every root.tsx must define for React Router.
|
|
@@ -57,10 +59,12 @@ const ARDO_FAVICON = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3
|
|
|
57
59
|
* export const Layout = (props) => <RootLayout favicon={logo} {...props} />
|
|
58
60
|
* ```
|
|
59
61
|
*/
|
|
60
|
-
function ArdoRootLayout({ children, favicon, lang }) {
|
|
62
|
+
function ArdoRootLayout({ children, favicon, iconBasePath = "/", lang }) {
|
|
61
63
|
const context = use(ArdoContext);
|
|
64
|
+
const resolvedLang = lang ?? context?.config.lang ?? "en";
|
|
65
|
+
const iconBaseUrl = iconBasePath === false ? void 0 : normalizeIconBasePath(iconBasePath);
|
|
62
66
|
return /* @__PURE__ */ jsxs("html", {
|
|
63
|
-
lang:
|
|
67
|
+
lang: resolvedLang,
|
|
64
68
|
suppressHydrationWarning: true,
|
|
65
69
|
children: [/* @__PURE__ */ jsxs("head", { children: [
|
|
66
70
|
/* @__PURE__ */ jsx("meta", { charSet: "utf-8" }),
|
|
@@ -68,11 +72,26 @@ function ArdoRootLayout({ children, favicon, lang }) {
|
|
|
68
72
|
name: "viewport",
|
|
69
73
|
content: "width=device-width, initial-scale=1"
|
|
70
74
|
}),
|
|
71
|
-
/* @__PURE__ */ jsx("link", {
|
|
75
|
+
iconBaseUrl == null ? /* @__PURE__ */ jsx("link", {
|
|
72
76
|
rel: "icon",
|
|
73
77
|
type: "image/svg+xml",
|
|
74
|
-
href: favicon ??
|
|
75
|
-
}),
|
|
78
|
+
href: favicon ?? ARDO_FAVICON_DATA_URL
|
|
79
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
+
/* @__PURE__ */ jsx("link", {
|
|
81
|
+
rel: "icon",
|
|
82
|
+
href: `${iconBaseUrl}favicon.ico`,
|
|
83
|
+
sizes: "32x32"
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ jsx("link", {
|
|
86
|
+
rel: "icon",
|
|
87
|
+
href: favicon ?? `${iconBaseUrl}icon.svg`,
|
|
88
|
+
type: "image/svg+xml"
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ jsx("link", {
|
|
91
|
+
rel: "apple-touch-icon",
|
|
92
|
+
href: `${iconBaseUrl}apple-touch-icon.png`
|
|
93
|
+
})
|
|
94
|
+
] }),
|
|
76
95
|
/* @__PURE__ */ jsx(Meta, {}),
|
|
77
96
|
/* @__PURE__ */ jsx(Links, {})
|
|
78
97
|
] }), /* @__PURE__ */ jsxs("body", {
|
|
@@ -85,6 +104,10 @@ function ArdoRootLayout({ children, favicon, lang }) {
|
|
|
85
104
|
})]
|
|
86
105
|
});
|
|
87
106
|
}
|
|
107
|
+
function normalizeIconBasePath(basePath) {
|
|
108
|
+
if (basePath === "") return "/";
|
|
109
|
+
return `${basePath.endsWith("/") ? basePath.slice(0, -1) : basePath}/`;
|
|
110
|
+
}
|
|
88
111
|
/**
|
|
89
112
|
* Layout component with explicit slot props.
|
|
90
113
|
*
|
|
@@ -691,6 +714,7 @@ var contentContainer = "_1f1m4jr1";
|
|
|
691
714
|
var contentHeader = "_1f1m4jr2";
|
|
692
715
|
var contentTitle = "_1f1m4jr3";
|
|
693
716
|
var docPage = "_1f1m4jr0";
|
|
717
|
+
var pageRail = "_1f1m4jr6";
|
|
694
718
|
//#endregion
|
|
695
719
|
//#region src/ui/Content.tsx
|
|
696
720
|
function resolveEditLink(input) {
|
|
@@ -719,7 +743,7 @@ function resolveLastUpdated(input) {
|
|
|
719
743
|
show
|
|
720
744
|
};
|
|
721
745
|
}
|
|
722
|
-
function ArdoContent({ children, editLink, lastUpdated }) {
|
|
746
|
+
function ArdoContent({ children, editLink, lastUpdated, metaPlacement = "footer" }) {
|
|
723
747
|
const isBare = useBareContent();
|
|
724
748
|
const pageData = useArdoPageData();
|
|
725
749
|
const siteConfig = useArdoSiteConfig();
|
|
@@ -750,7 +774,7 @@ function ArdoContent({ children, editLink, lastUpdated }) {
|
|
|
750
774
|
className: `${contentBody} ${ardoContent}`,
|
|
751
775
|
children
|
|
752
776
|
}),
|
|
753
|
-
/* @__PURE__ */ jsx(ContentMeta, {
|
|
777
|
+
metaPlacement === "footer" && /* @__PURE__ */ jsx(ContentMeta, {
|
|
754
778
|
edit,
|
|
755
779
|
updated
|
|
756
780
|
}),
|
|
@@ -782,7 +806,7 @@ function ContentMeta({ edit, updated }) {
|
|
|
782
806
|
href: edit.href,
|
|
783
807
|
target: "_blank",
|
|
784
808
|
rel: "noopener noreferrer",
|
|
785
|
-
className: "
|
|
809
|
+
className: "_169q00bc",
|
|
786
810
|
children: edit.text
|
|
787
811
|
}), updated.show && /* @__PURE__ */ jsxs("span", { children: [
|
|
788
812
|
updated.label,
|
|
@@ -963,8 +987,14 @@ function ArdoDocPage({ children, editLink, lastUpdated, tocLabel }) {
|
|
|
963
987
|
children: [/* @__PURE__ */ jsx(ArdoContent, {
|
|
964
988
|
editLink,
|
|
965
989
|
lastUpdated,
|
|
990
|
+
metaPlacement: "none",
|
|
966
991
|
children
|
|
967
|
-
}),
|
|
992
|
+
}), /* @__PURE__ */ jsx(ArdoPageRail, {
|
|
993
|
+
editLink,
|
|
994
|
+
lastUpdated,
|
|
995
|
+
tocLabel,
|
|
996
|
+
hideToc
|
|
997
|
+
})]
|
|
968
998
|
}) });
|
|
969
999
|
}
|
|
970
1000
|
/**
|
|
@@ -994,10 +1024,109 @@ function ArdoDocContent({ children, editLink, lastUpdated, tocLabel }) {
|
|
|
994
1024
|
children: [/* @__PURE__ */ jsx(ArdoContent, {
|
|
995
1025
|
editLink,
|
|
996
1026
|
lastUpdated,
|
|
1027
|
+
metaPlacement: "none",
|
|
997
1028
|
children
|
|
998
|
-
}),
|
|
1029
|
+
}), /* @__PURE__ */ jsx(ArdoPageRail, {
|
|
1030
|
+
editLink,
|
|
1031
|
+
lastUpdated,
|
|
1032
|
+
tocLabel,
|
|
1033
|
+
hideToc
|
|
1034
|
+
})]
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
function ArdoPageRail({ editLink, lastUpdated, tocLabel, hideToc = false }) {
|
|
1038
|
+
const config = useArdoConfig();
|
|
1039
|
+
const siteConfig = useArdoSiteConfig();
|
|
1040
|
+
const pageData = useArdoPageData();
|
|
1041
|
+
const version = config.project?.version ?? "";
|
|
1042
|
+
const edit = resolveRailEditLink({
|
|
1043
|
+
pageData,
|
|
1044
|
+
editLink,
|
|
1045
|
+
siteConfig
|
|
1046
|
+
});
|
|
1047
|
+
const updated = resolveRailLastUpdated({
|
|
1048
|
+
pageData,
|
|
1049
|
+
lastUpdated,
|
|
1050
|
+
siteConfig
|
|
1051
|
+
});
|
|
1052
|
+
const hasMeta = edit.show || updated.show;
|
|
1053
|
+
const hasVersion = version !== "";
|
|
1054
|
+
if (!hasVersion && !hasMeta && hideToc) return null;
|
|
1055
|
+
return /* @__PURE__ */ jsxs("aside", {
|
|
1056
|
+
className: pageRail,
|
|
1057
|
+
children: [
|
|
1058
|
+
hasVersion && /* @__PURE__ */ jsxs("section", {
|
|
1059
|
+
className: "_1f1m4jr7",
|
|
1060
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
1061
|
+
className: "_1f1m4jr8",
|
|
1062
|
+
children: "Version"
|
|
1063
|
+
}), /* @__PURE__ */ jsx("select", {
|
|
1064
|
+
className: "_1f1m4jrb",
|
|
1065
|
+
defaultValue: version,
|
|
1066
|
+
"aria-label": "Version",
|
|
1067
|
+
children: /* @__PURE__ */ jsx("option", {
|
|
1068
|
+
value: version,
|
|
1069
|
+
children: version
|
|
1070
|
+
})
|
|
1071
|
+
})]
|
|
1072
|
+
}),
|
|
1073
|
+
hasMeta && /* @__PURE__ */ jsxs("section", {
|
|
1074
|
+
className: "_1f1m4jr7",
|
|
1075
|
+
children: [
|
|
1076
|
+
/* @__PURE__ */ jsx("h2", {
|
|
1077
|
+
className: "_1f1m4jr8",
|
|
1078
|
+
children: "Page"
|
|
1079
|
+
}),
|
|
1080
|
+
edit.show && /* @__PURE__ */ jsx("a", {
|
|
1081
|
+
href: edit.href,
|
|
1082
|
+
target: "_blank",
|
|
1083
|
+
rel: "noopener noreferrer",
|
|
1084
|
+
className: "_1f1m4jra",
|
|
1085
|
+
children: edit.text
|
|
1086
|
+
}),
|
|
1087
|
+
updated.show && /* @__PURE__ */ jsxs("p", {
|
|
1088
|
+
className: "_1f1m4jr9",
|
|
1089
|
+
children: [
|
|
1090
|
+
updated.label,
|
|
1091
|
+
": ",
|
|
1092
|
+
updated.text
|
|
1093
|
+
]
|
|
1094
|
+
})
|
|
1095
|
+
]
|
|
1096
|
+
}),
|
|
1097
|
+
!hideToc && /* @__PURE__ */ jsx("section", {
|
|
1098
|
+
className: "_1f1m4jr7",
|
|
1099
|
+
children: /* @__PURE__ */ jsx(ArdoTOC, { label: tocLabel })
|
|
1100
|
+
})
|
|
1101
|
+
]
|
|
999
1102
|
});
|
|
1000
1103
|
}
|
|
1104
|
+
function resolveRailEditLink({ pageData, editLink, siteConfig }) {
|
|
1105
|
+
const resolved = editLink ?? siteConfig.editLink;
|
|
1106
|
+
const pattern = resolved?.pattern ?? "";
|
|
1107
|
+
const relativePath = pageData?.relativePath ?? "";
|
|
1108
|
+
const show = pageData?.frontmatter.editLink !== false && pattern !== "" && pageData !== void 0;
|
|
1109
|
+
return {
|
|
1110
|
+
href: show ? pattern.replace(":path", relativePath) : void 0,
|
|
1111
|
+
text: resolved?.text ?? "Edit this page",
|
|
1112
|
+
show
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
function resolveRailLastUpdated({ pageData, lastUpdated, siteConfig }) {
|
|
1116
|
+
const resolved = lastUpdated ?? siteConfig.lastUpdated;
|
|
1117
|
+
const value = pageData?.lastUpdated;
|
|
1118
|
+
const show = pageData?.frontmatter.lastUpdated !== false && resolved?.enabled === true && typeof value === "number";
|
|
1119
|
+
const formatOptions = resolved?.formatOptions ?? {
|
|
1120
|
+
year: "numeric",
|
|
1121
|
+
month: "long",
|
|
1122
|
+
day: "numeric"
|
|
1123
|
+
};
|
|
1124
|
+
return {
|
|
1125
|
+
label: resolved?.text ?? "Last updated",
|
|
1126
|
+
text: show ? new Date(value).toLocaleDateString(void 0, formatOptions) : void 0,
|
|
1127
|
+
show
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1001
1130
|
/**
|
|
1002
1131
|
* @deprecated Use DocPage or DocContent instead
|
|
1003
1132
|
*/
|
|
@@ -1005,6 +1134,6 @@ function ArdoDocLayout({ content }) {
|
|
|
1005
1134
|
return /* @__PURE__ */ jsx(ArdoDocPage, { children: content });
|
|
1006
1135
|
}
|
|
1007
1136
|
//#endregion
|
|
1008
|
-
export { home as A,
|
|
1137
|
+
export { footerLink as $, home as A, MonitorIcon as B, ArdoCopyButton as C, ArdoBareContent as D, codeWrapper as E, ChevronDownIcon as F, SunIcon as G, PackageIcon as H, CodeIcon as I, footer as J, WrenchIcon as K, FileCodeIcon as L, layout as M, BookOpenIcon as N, ArdoLayout as O, BoxIcon as P, footerCopyright as Q, FileTextIcon as R, ArdoCodeGroup as S, codeTitle as T, SearchIcon as U, MoonIcon as V, SettingsIcon as W, footerBuildTime as X, footerArdoLink as Y, footerContainer as Z, ArdoInfo as _, ArdoContent as a, ArdoWarning as b, ArdoTabPanel as c, ArdoSteps as d, footerMessage as et, ArdoIcon as f, ArdoDanger as g, ArdoContainer as h, ArdoTOC as i, homeMain as j, ArdoRootLayout as k, ArdoTabPanels as l, registerIcons as m, ArdoDocLayout as n, footerPrimary as nt, ArdoTab as o, getRegisteredIconNames as p, XIcon as q, ArdoDocPage as r, footerSeparator as rt, ArdoTabList as s, ArdoDocContent as t, footerOwl as tt, ArdoTabs as u, ArdoNote as v, codeBlock as w, ArdoCodeBlock as x, ArdoTip as y, MessageCircleIcon as z };
|
|
1009
1138
|
|
|
1010
|
-
//# sourceMappingURL=DocPage-
|
|
1139
|
+
//# sourceMappingURL=DocPage-Dy7OrCP2.js.map
|