@geenius/docs 0.8.10 → 0.9.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 +6 -0
- package/package.json +33 -21
- package/packages/convex/dist/index.d.ts +4 -4
- package/packages/convex/dist/index.js.map +1 -1
- package/packages/react/dist/index.css +2 -0
- package/packages/react/dist/index.css.map +1 -0
- package/packages/react/dist/index.d.ts +67 -49
- package/packages/react/dist/index.js +83 -41
- package/packages/react/dist/index.js.map +1 -1
- package/packages/react-css/dist/index.d.ts +68 -33
- package/packages/react-css/dist/index.js +61 -38
- package/packages/react-css/dist/index.js.map +1 -1
- package/packages/shared/dist/{chunk-BR2XBF64.js → chunk-QKKVTCRJ.js} +2 -2
- package/packages/shared/dist/{chunk-BR2XBF64.js.map → chunk-QKKVTCRJ.js.map} +1 -1
- package/packages/shared/dist/index.d.ts +6 -6
- package/packages/shared/dist/index.js +1 -1
- package/packages/shared/dist/index.js.map +1 -1
- package/packages/shared/dist/providers.d.ts +4 -4
- package/packages/shared/dist/providers.js +1 -1
- package/packages/shared/dist/providers.js.map +1 -1
- package/packages/shared/dist/{types-n-Ryn258.d.ts → types-D8ITXVwj.d.ts} +1 -1
- package/packages/solidjs/dist/index.css +2 -0
- package/packages/solidjs/dist/index.css.map +1 -0
- package/packages/solidjs/dist/index.d.ts +57 -27
- package/packages/solidjs/dist/index.js +58 -28
- package/packages/solidjs/dist/index.js.map +1 -1
- package/packages/solidjs-css/dist/index.d.ts +55 -20
- package/packages/solidjs-css/dist/index.js +34 -25
- package/packages/solidjs-css/dist/index.js.map +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { BreadcrumbItem, DocPage as DocPage$1, SearchResult, DocSection, TocItem, DocsConfig } from '@geenius/docs
|
|
2
|
-
export { BreadcrumbItem, DocAccess, DocPage as DocPageType, DocSection, DocStatus, DocsConfig, SearchResult, TocItem } from '@geenius/docs
|
|
1
|
+
import { BreadcrumbItem, DocPage as DocPage$1, SearchResult, DocSection, TocItem, DocsConfig } from '@geenius/docs/shared';
|
|
2
|
+
export { BreadcrumbItem, DocAccess, DocPage as DocPageType, DocSection, DocStatus, DocsConfig, SearchResult, TocItem } from '@geenius/docs/shared';
|
|
3
3
|
import React$1 from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @module docsReactCssBreadcrumbs
|
|
7
|
-
* @package @geenius/docs
|
|
7
|
+
* @package @geenius/docs/react-css
|
|
8
8
|
* @description Renders breadcrumb navigation for the React CSS variant using
|
|
9
9
|
* the shared vanilla CSS class contract.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
interface BreadcrumbsProps {
|
|
13
13
|
items: BreadcrumbItem[];
|
|
14
|
+
className?: string;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Renders a breadcrumb trail for docs pages.
|
|
@@ -18,17 +19,18 @@ interface BreadcrumbsProps {
|
|
|
18
19
|
* @param props - Breadcrumb items describing the current page path.
|
|
19
20
|
* @returns The breadcrumb navigation or `null` when there are no items.
|
|
20
21
|
*/
|
|
21
|
-
declare function Breadcrumbs({ items }: BreadcrumbsProps): React$1.JSX.Element | null;
|
|
22
|
+
declare function Breadcrumbs({ items, className, }: BreadcrumbsProps): React$1.JSX.Element | null;
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* @module docsReactCssDocPage
|
|
25
|
-
* @package @geenius/docs
|
|
26
|
+
* @package @geenius/docs/react-css
|
|
26
27
|
* @description Renders markdown content for the standalone React CSS docs
|
|
27
28
|
* variant using the package-local vanilla CSS class contract.
|
|
28
29
|
*/
|
|
29
30
|
|
|
30
31
|
interface DocPageProps {
|
|
31
32
|
page: DocPage$1;
|
|
33
|
+
className?: string;
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* Markdown page renderer for the React CSS docs variant.
|
|
@@ -36,11 +38,11 @@ interface DocPageProps {
|
|
|
36
38
|
* @param props - Page record containing the markdown body to render.
|
|
37
39
|
* @returns Rendered docs article markup.
|
|
38
40
|
*/
|
|
39
|
-
declare function DocPage({ page }: DocPageProps): React.JSX.Element;
|
|
41
|
+
declare function DocPage({ page, className }: DocPageProps): React.JSX.Element;
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
* @module docsReactCssDocSearch
|
|
43
|
-
* @package @geenius/docs
|
|
45
|
+
* @package @geenius/docs/react-css
|
|
44
46
|
* @description Provides the standalone React CSS command-palette style docs
|
|
45
47
|
* search modal with keyboard navigation and vanilla CSS styling.
|
|
46
48
|
*/
|
|
@@ -52,6 +54,7 @@ interface DocSearchProps {
|
|
|
52
54
|
onSelect: (result: SearchResult) => void;
|
|
53
55
|
isOpen: boolean;
|
|
54
56
|
onClose: () => void;
|
|
57
|
+
className?: string;
|
|
55
58
|
}
|
|
56
59
|
/**
|
|
57
60
|
* Search modal for the standalone React CSS docs variant.
|
|
@@ -59,11 +62,11 @@ interface DocSearchProps {
|
|
|
59
62
|
* @param props - Search state, result list, and modal event handlers.
|
|
60
63
|
* @returns Search dialog markup when open, otherwise `null`.
|
|
61
64
|
*/
|
|
62
|
-
declare function DocSearch({ results, query, onQuery, onSelect, isOpen, onClose, }: DocSearchProps): React.JSX.Element | null;
|
|
65
|
+
declare function DocSearch({ results, query, onQuery, onSelect, isOpen, onClose, className, }: DocSearchProps): React.JSX.Element | null;
|
|
63
66
|
|
|
64
67
|
/**
|
|
65
68
|
* @module docsReactCssDocSidebar
|
|
66
|
-
* @package @geenius/docs
|
|
69
|
+
* @package @geenius/docs/react-css
|
|
67
70
|
* @description Renders the standalone React CSS sidebar navigation for docs
|
|
68
71
|
* trees using the shared vanilla CSS layout and BEM-style class contract.
|
|
69
72
|
*/
|
|
@@ -75,6 +78,7 @@ interface DocSidebarProps {
|
|
|
75
78
|
})[];
|
|
76
79
|
currentPageId?: string;
|
|
77
80
|
onNavigate: (page: DocPage$1, section: DocSection) => void;
|
|
81
|
+
className?: string;
|
|
78
82
|
}
|
|
79
83
|
/**
|
|
80
84
|
* Sidebar navigation for section and page browsing in the React CSS variant.
|
|
@@ -82,11 +86,11 @@ interface DocSidebarProps {
|
|
|
82
86
|
* @param props - Sections, active page id, and page navigation handler.
|
|
83
87
|
* @returns Sidebar navigation markup for the docs tree.
|
|
84
88
|
*/
|
|
85
|
-
declare function DocSidebar({ sections, currentPageId, onNavigate, }: DocSidebarProps): React.JSX.Element;
|
|
89
|
+
declare function DocSidebar({ sections, currentPageId, onNavigate, className, }: DocSidebarProps): React.JSX.Element;
|
|
86
90
|
|
|
87
91
|
/**
|
|
88
92
|
* @module docsReactCssDocsLayout
|
|
89
|
-
* @package @geenius/docs
|
|
93
|
+
* @package @geenius/docs/react-css
|
|
90
94
|
* @description Composes the standalone React CSS layout shell for docs pages,
|
|
91
95
|
* including sidebar navigation, content chrome, and the right-rail TOC.
|
|
92
96
|
*/
|
|
@@ -94,6 +98,7 @@ declare function DocSidebar({ sections, currentPageId, onNavigate, }: DocSidebar
|
|
|
94
98
|
interface DocsLayoutProps {
|
|
95
99
|
sections: (DocSection & {
|
|
96
100
|
pages?: DocPage$1[];
|
|
101
|
+
pageCount?: number;
|
|
97
102
|
})[];
|
|
98
103
|
currentPage?: DocPage$1;
|
|
99
104
|
toc?: TocItem[];
|
|
@@ -102,6 +107,7 @@ interface DocsLayoutProps {
|
|
|
102
107
|
currentPageId?: string;
|
|
103
108
|
onNavigate: (page: DocPage$1, section: DocSection) => void;
|
|
104
109
|
children: React.ReactNode;
|
|
110
|
+
className?: string;
|
|
105
111
|
}
|
|
106
112
|
/**
|
|
107
113
|
* Layout shell used by standalone React CSS docs pages.
|
|
@@ -109,11 +115,11 @@ interface DocsLayoutProps {
|
|
|
109
115
|
* @param props - Docs navigation state, TOC state, and page content.
|
|
110
116
|
* @returns Full page layout for docs screens.
|
|
111
117
|
*/
|
|
112
|
-
declare function DocsLayout({ sections, toc, activeHeadingId, breadcrumbs, currentPageId, onNavigate, children, }: DocsLayoutProps): React.JSX.Element;
|
|
118
|
+
declare function DocsLayout({ sections, toc, activeHeadingId, breadcrumbs, currentPageId, onNavigate, children, className, }: DocsLayoutProps): React.JSX.Element;
|
|
113
119
|
|
|
114
120
|
/**
|
|
115
121
|
* @module docsReactCssEditButton
|
|
116
|
-
* @package @geenius/docs
|
|
122
|
+
* @package @geenius/docs/react-css
|
|
117
123
|
* @description Exposes the CSS-backed edit-link affordance for docs pages so
|
|
118
124
|
* hosts can route users to the source repository without Tailwind classes.
|
|
119
125
|
*/
|
|
@@ -121,6 +127,7 @@ declare function DocsLayout({ sections, toc, activeHeadingId, breadcrumbs, curre
|
|
|
121
127
|
interface EditButtonProps {
|
|
122
128
|
pageSlug: string;
|
|
123
129
|
editUrl?: string;
|
|
130
|
+
className?: string;
|
|
124
131
|
}
|
|
125
132
|
/**
|
|
126
133
|
* Renders the "Edit this page" link when source editing is configured.
|
|
@@ -128,11 +135,11 @@ interface EditButtonProps {
|
|
|
128
135
|
* @param props - Page slug and optional base edit URL.
|
|
129
136
|
* @returns The edit link or `null` when editing is disabled.
|
|
130
137
|
*/
|
|
131
|
-
declare function EditButton({ pageSlug, editUrl, }: EditButtonProps): React$1.JSX.Element | null;
|
|
138
|
+
declare function EditButton({ pageSlug, editUrl, className, }: EditButtonProps): React$1.JSX.Element | null;
|
|
132
139
|
|
|
133
140
|
/**
|
|
134
141
|
* @module docsReactCssPageNavigation
|
|
135
|
-
* @package @geenius/docs
|
|
142
|
+
* @package @geenius/docs/react-css
|
|
136
143
|
* @description Renders previous and next page affordances for the React CSS
|
|
137
144
|
* docs variant using the shared vanilla CSS navigation classes.
|
|
138
145
|
*/
|
|
@@ -146,6 +153,7 @@ interface PageNavigationProps {
|
|
|
146
153
|
title: string;
|
|
147
154
|
href: string;
|
|
148
155
|
};
|
|
156
|
+
className?: string;
|
|
149
157
|
}
|
|
150
158
|
/**
|
|
151
159
|
* Renders previous and next page links for the current article.
|
|
@@ -153,11 +161,11 @@ interface PageNavigationProps {
|
|
|
153
161
|
* @param props - Optional previous and next navigation links.
|
|
154
162
|
* @returns Page navigation markup or `null` when neither link exists.
|
|
155
163
|
*/
|
|
156
|
-
declare function PageNavigation({ prev, next, }: PageNavigationProps): React$1.JSX.Element | null;
|
|
164
|
+
declare function PageNavigation({ prev, next, className, }: PageNavigationProps): React$1.JSX.Element | null;
|
|
157
165
|
|
|
158
166
|
/**
|
|
159
167
|
* @module docsReactCssTableOfContents
|
|
160
|
-
* @package @geenius/docs
|
|
168
|
+
* @package @geenius/docs/react-css
|
|
161
169
|
* @description Renders the CSS-backed table of contents tree for docs pages so
|
|
162
170
|
* heading navigation remains consistent with the shared vanilla CSS contract.
|
|
163
171
|
*/
|
|
@@ -165,6 +173,7 @@ declare function PageNavigation({ prev, next, }: PageNavigationProps): React$1.J
|
|
|
165
173
|
interface TableOfContentsProps {
|
|
166
174
|
toc: TocItem[];
|
|
167
175
|
activeId?: string;
|
|
176
|
+
className?: string;
|
|
168
177
|
}
|
|
169
178
|
/**
|
|
170
179
|
* Renders the page table of contents.
|
|
@@ -172,11 +181,11 @@ interface TableOfContentsProps {
|
|
|
172
181
|
* @param props - TOC entries and the currently active heading id.
|
|
173
182
|
* @returns The TOC nav or `null` when the page has no headings.
|
|
174
183
|
*/
|
|
175
|
-
declare function TableOfContents({ toc, activeId, }: TableOfContentsProps): React$1.JSX.Element | null;
|
|
184
|
+
declare function TableOfContents({ toc, activeId, className, }: TableOfContentsProps): React$1.JSX.Element | null;
|
|
176
185
|
|
|
177
186
|
/**
|
|
178
187
|
* @module docsReactCssVersionSelector
|
|
179
|
-
* @package @geenius/docs
|
|
188
|
+
* @package @geenius/docs/react-css
|
|
180
189
|
* @description Provides the CSS-backed version selector for versioned docs
|
|
181
190
|
* surfaces using a native select for accessibility and low runtime overhead.
|
|
182
191
|
*/
|
|
@@ -185,6 +194,7 @@ interface VersionSelectorProps {
|
|
|
185
194
|
versions: string[];
|
|
186
195
|
current: string;
|
|
187
196
|
onSelect: (version: string) => void;
|
|
197
|
+
className?: string;
|
|
188
198
|
}
|
|
189
199
|
/**
|
|
190
200
|
* Renders a version switcher when multiple docs versions exist.
|
|
@@ -192,11 +202,11 @@ interface VersionSelectorProps {
|
|
|
192
202
|
* @param props - Supported versions, current version, and selection callback.
|
|
193
203
|
* @returns The version selector or `null` when only one version exists.
|
|
194
204
|
*/
|
|
195
|
-
declare function VersionSelector({ versions, current, onSelect, }: VersionSelectorProps): React$1.JSX.Element | null;
|
|
205
|
+
declare function VersionSelector({ versions, current, onSelect, className, }: VersionSelectorProps): React$1.JSX.Element | null;
|
|
196
206
|
|
|
197
207
|
/**
|
|
198
208
|
* @module docsReactCssUseDocSearch
|
|
199
|
-
* @package @geenius/docs
|
|
209
|
+
* @package @geenius/docs/react-css
|
|
200
210
|
* @description Implements debounced search state for the React CSS docs
|
|
201
211
|
* variant so modal and page-level search experiences share the same query and
|
|
202
212
|
* loading lifecycle.
|
|
@@ -223,7 +233,7 @@ declare function useDocSearch(searchFn: (query: string) => SearchResult[] | Prom
|
|
|
223
233
|
|
|
224
234
|
/**
|
|
225
235
|
* @module docsReactCssUseDocs
|
|
226
|
-
* @package @geenius/docs
|
|
236
|
+
* @package @geenius/docs/react-css
|
|
227
237
|
* @description Provides the React CSS variant state bridge for docs trees. The
|
|
228
238
|
* hook mirrors the Tailwind React surface while staying local to the CSS
|
|
229
239
|
* package so the published CSS entry does not depend on the React variant.
|
|
@@ -261,7 +271,7 @@ declare function useDocs(tree: (DocSection & {
|
|
|
261
271
|
|
|
262
272
|
/**
|
|
263
273
|
* @module docsReactCssUseDocsAdmin
|
|
264
|
-
* @package @geenius/docs
|
|
274
|
+
* @package @geenius/docs/react-css
|
|
265
275
|
* @description Adapts the docs admin mutation contract to stable React CSS
|
|
266
276
|
* callbacks so admin surfaces can stay framework-native while the backend
|
|
267
277
|
* remains transport-agnostic.
|
|
@@ -327,7 +337,7 @@ declare function useDocsAdmin(mutations: {
|
|
|
327
337
|
|
|
328
338
|
/**
|
|
329
339
|
* @module docsReactCssUseTableOfContents
|
|
330
|
-
* @package @geenius/docs
|
|
340
|
+
* @package @geenius/docs/react-css
|
|
331
341
|
* @description Tracks the extracted table of contents and active heading for
|
|
332
342
|
* the React CSS docs variant so CSS-backed page chrome can stay in sync with
|
|
333
343
|
* the rendered article structure.
|
|
@@ -351,7 +361,7 @@ declare function useTableOfContents(mdxContent: string | undefined): TableOfCont
|
|
|
351
361
|
|
|
352
362
|
/**
|
|
353
363
|
* @module docsReactCssDocSearchPage
|
|
354
|
-
* @package @geenius/docs
|
|
364
|
+
* @package @geenius/docs/react-css
|
|
355
365
|
* @description Renders the standalone React CSS full-page docs search
|
|
356
366
|
* experience using local search results and vanilla CSS layouts.
|
|
357
367
|
*/
|
|
@@ -362,6 +372,7 @@ interface DocSearchPageProps {
|
|
|
362
372
|
pageCount: number;
|
|
363
373
|
})[] | undefined;
|
|
364
374
|
onSelectPage?: (page: DocPage$1, section: DocSection) => void;
|
|
375
|
+
className?: string;
|
|
365
376
|
}
|
|
366
377
|
/**
|
|
367
378
|
* Full-page search experience for the standalone React CSS docs variant.
|
|
@@ -369,11 +380,11 @@ interface DocSearchPageProps {
|
|
|
369
380
|
* @param props - Docs tree and optional page selection callback.
|
|
370
381
|
* @returns Full-page search UI for docs results.
|
|
371
382
|
*/
|
|
372
|
-
declare function DocSearchPage({ tree, onSelectPage, }: DocSearchPageProps): React.JSX.Element;
|
|
383
|
+
declare function DocSearchPage({ tree, onSelectPage, className, }: DocSearchPageProps): React.JSX.Element;
|
|
373
384
|
|
|
374
385
|
/**
|
|
375
386
|
* @module docsReactCssDocsAdminPage
|
|
376
|
-
* @package @geenius/docs
|
|
387
|
+
* @package @geenius/docs/react-css
|
|
377
388
|
* @description Renders the standalone React CSS admin surface for managing doc
|
|
378
389
|
* sections and pages using the package-local vanilla CSS panel styles.
|
|
379
390
|
*/
|
|
@@ -385,6 +396,7 @@ interface DocsAdminPageProps {
|
|
|
385
396
|
})[] | undefined;
|
|
386
397
|
allPages?: DocPage$1[];
|
|
387
398
|
admin: DocsAdminActions;
|
|
399
|
+
className?: string;
|
|
388
400
|
}
|
|
389
401
|
/**
|
|
390
402
|
* Admin page for section and page management in the React CSS variant.
|
|
@@ -392,11 +404,11 @@ interface DocsAdminPageProps {
|
|
|
392
404
|
* @param props - Tree data, optional page list, and admin actions.
|
|
393
405
|
* @returns Admin UI for managing docs content.
|
|
394
406
|
*/
|
|
395
|
-
declare function DocsAdminPage({ tree, allPages, admin, }: DocsAdminPageProps): React.JSX.Element;
|
|
407
|
+
declare function DocsAdminPage({ tree, allPages, admin, className, }: DocsAdminPageProps): React.JSX.Element;
|
|
396
408
|
|
|
397
409
|
/**
|
|
398
410
|
* @module docsReactCssDocsIndexPage
|
|
399
|
-
* @package @geenius/docs
|
|
411
|
+
* @package @geenius/docs/react-css
|
|
400
412
|
* @description Renders the standalone React CSS docs landing page with
|
|
401
413
|
* section cards, recent pages, and a package-local search trigger.
|
|
402
414
|
*/
|
|
@@ -407,6 +419,7 @@ interface DocsIndexPageProps {
|
|
|
407
419
|
pageCount: number;
|
|
408
420
|
})[] | undefined;
|
|
409
421
|
onSelectPage?: (page: DocPage$1, section: DocSection) => void;
|
|
422
|
+
className?: string;
|
|
410
423
|
}
|
|
411
424
|
/**
|
|
412
425
|
* Landing page for the standalone React CSS docs experience.
|
|
@@ -414,11 +427,11 @@ interface DocsIndexPageProps {
|
|
|
414
427
|
* @param props - Docs tree plus optional page selection handler.
|
|
415
428
|
* @returns Landing page UI for the React CSS docs variant.
|
|
416
429
|
*/
|
|
417
|
-
declare function DocsIndexPage({ tree, onSelectPage, }: DocsIndexPageProps): React.JSX.Element;
|
|
430
|
+
declare function DocsIndexPage({ tree, onSelectPage, className, }: DocsIndexPageProps): React.JSX.Element;
|
|
418
431
|
|
|
419
432
|
/**
|
|
420
433
|
* @module docsReactCssDocViewPage
|
|
421
|
-
* @package @geenius/docs
|
|
434
|
+
* @package @geenius/docs/react-css
|
|
422
435
|
* @description Renders the standalone React CSS docs detail page with local
|
|
423
436
|
* layout, TOC tracking, navigation footer, and metadata presentation.
|
|
424
437
|
*/
|
|
@@ -432,6 +445,7 @@ interface DocViewPageProps {
|
|
|
432
445
|
editPageUrl?: string;
|
|
433
446
|
onNavigate: (page: DocPage$1, section: DocSection) => void;
|
|
434
447
|
onIncrementView?: (pageId: string) => void;
|
|
448
|
+
className?: string;
|
|
435
449
|
}
|
|
436
450
|
/**
|
|
437
451
|
* Page view for the standalone React CSS docs variant.
|
|
@@ -439,6 +453,27 @@ interface DocViewPageProps {
|
|
|
439
453
|
* @param props - Docs tree, selected page, and page-level event handlers.
|
|
440
454
|
* @returns Detailed page view or an appropriate empty/loading state.
|
|
441
455
|
*/
|
|
442
|
-
declare function DocViewPage({ tree, page, editPageUrl, onNavigate, onIncrementView, }: DocViewPageProps): React.JSX.Element;
|
|
456
|
+
declare function DocViewPage({ tree, page, editPageUrl, onNavigate, onIncrementView, className, }: DocViewPageProps): React.JSX.Element;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* @module docsReactCssTypes
|
|
460
|
+
* @package @geenius/docs/react-css
|
|
461
|
+
* @description Declares the supporting React CSS types shared across the
|
|
462
|
+
* standalone vanilla CSS docs components and pages.
|
|
463
|
+
*/
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Optional `className` contract shared by React CSS docs exports.
|
|
467
|
+
*/
|
|
468
|
+
interface WithClassName {
|
|
469
|
+
className?: string;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Shared docs section shape used by layout, navigation, and page components.
|
|
473
|
+
*/
|
|
474
|
+
type DocsSectionWithPages = DocSection & {
|
|
475
|
+
pages?: DocPage$1[];
|
|
476
|
+
pageCount?: number;
|
|
477
|
+
};
|
|
443
478
|
|
|
444
|
-
export { Breadcrumbs, DocPage, DocSearch, DocSearchPage, type DocSearchState, DocSidebar, DocViewPage, type DocsAdminActions, DocsAdminPage, DocsIndexPage, DocsLayout, type DocsState, EditButton, PageNavigation, TableOfContents, type TableOfContentsState, VersionSelector, useDocSearch, useDocs, useDocsAdmin, useTableOfContents };
|
|
479
|
+
export { Breadcrumbs, DocPage, DocSearch, DocSearchPage, type DocSearchState, DocSidebar, DocViewPage, type DocsAdminActions, DocsAdminPage, DocsIndexPage, DocsLayout, type DocsSectionWithPages, type DocsState, EditButton, PageNavigation, TableOfContents, type TableOfContentsState, VersionSelector, type WithClassName, useDocSearch, useDocs, useDocsAdmin, useTableOfContents };
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import React, { useState, useId, useRef, useMemo, useEffect, useCallback, Children, isValidElement } from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
3
|
import ReactMarkdown from 'react-markdown';
|
|
5
4
|
import remarkGfm from 'remark-gfm';
|
|
6
5
|
|
|
7
6
|
// src/components/Breadcrumbs.tsx
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
// src/lib/cx.ts
|
|
9
|
+
function cx(...classes) {
|
|
10
|
+
return classes.filter(Boolean).join(" ");
|
|
10
11
|
}
|
|
11
|
-
function Breadcrumbs({
|
|
12
|
+
function Breadcrumbs({
|
|
13
|
+
items,
|
|
14
|
+
className
|
|
15
|
+
}) {
|
|
12
16
|
if (items.length === 0) {
|
|
13
17
|
return null;
|
|
14
18
|
}
|
|
15
|
-
return /* @__PURE__ */ jsx("nav", { className: "docs__breadcrumbs", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
19
|
+
return /* @__PURE__ */ jsx("nav", { className: cx("docs__breadcrumbs", className), "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
16
20
|
index > 0 ? /* @__PURE__ */ jsx(
|
|
17
21
|
"svg",
|
|
18
22
|
{
|
|
@@ -37,7 +41,7 @@ function Breadcrumbs({ items }) {
|
|
|
37
41
|
] }, `${item.href}-${item.title}`)) });
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
// ../shared/dist/chunk-
|
|
44
|
+
// ../shared/dist/chunk-QKKVTCRJ.js
|
|
41
45
|
function toTocLevel(level) {
|
|
42
46
|
if (level === 2 || level === 3 || level === 4) {
|
|
43
47
|
return level;
|
|
@@ -203,8 +207,8 @@ function createHeading(Tag, className) {
|
|
|
203
207
|
] });
|
|
204
208
|
};
|
|
205
209
|
}
|
|
206
|
-
function DocPage({ page }) {
|
|
207
|
-
return /* @__PURE__ */ jsx("article", { className: "docs__article", children: /* @__PURE__ */ jsx("div", { className: "docs__article-body docs__content-main", children: /* @__PURE__ */ jsx(
|
|
210
|
+
function DocPage({ page, className }) {
|
|
211
|
+
return /* @__PURE__ */ jsx("article", { className: cx("docs__article", className), children: /* @__PURE__ */ jsx("div", { className: "docs__article-body docs__content-main", children: /* @__PURE__ */ jsx(
|
|
208
212
|
ReactMarkdown,
|
|
209
213
|
{
|
|
210
214
|
remarkPlugins: [remarkGfm],
|
|
@@ -239,7 +243,8 @@ function DocSearch({
|
|
|
239
243
|
onQuery,
|
|
240
244
|
onSelect,
|
|
241
245
|
isOpen,
|
|
242
|
-
onClose
|
|
246
|
+
onClose,
|
|
247
|
+
className
|
|
243
248
|
}) {
|
|
244
249
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
245
250
|
const dialogId = useId();
|
|
@@ -312,7 +317,7 @@ function DocSearch({
|
|
|
312
317
|
firstElement.focus();
|
|
313
318
|
}
|
|
314
319
|
};
|
|
315
|
-
return /* @__PURE__ */ jsxs("div", { className: "docs__search-modal", children: [
|
|
320
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("docs__search-modal", className), children: [
|
|
316
321
|
/* @__PURE__ */ jsx("button", { type: "button", className: "docs__search-backdrop", "aria-label": "Close search", onClick: onClose }),
|
|
317
322
|
/* @__PURE__ */ jsxs(
|
|
318
323
|
"div",
|
|
@@ -393,7 +398,8 @@ function collectAncestorIds(section, sectionMap) {
|
|
|
393
398
|
function DocSidebar({
|
|
394
399
|
sections,
|
|
395
400
|
currentPageId,
|
|
396
|
-
onNavigate
|
|
401
|
+
onNavigate,
|
|
402
|
+
className
|
|
397
403
|
}) {
|
|
398
404
|
const [expandedIds, setExpandedIds] = useState(/* @__PURE__ */ new Set());
|
|
399
405
|
const sectionMap = useMemo(
|
|
@@ -509,10 +515,17 @@ function DocSidebar({
|
|
|
509
515
|
section.id
|
|
510
516
|
);
|
|
511
517
|
};
|
|
512
|
-
return /* @__PURE__ */ jsxs(
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
518
|
+
return /* @__PURE__ */ jsxs(
|
|
519
|
+
"nav",
|
|
520
|
+
{
|
|
521
|
+
className: cx("docs__sidebar-nav", className),
|
|
522
|
+
"aria-label": "Documentation navigation",
|
|
523
|
+
children: [
|
|
524
|
+
/* @__PURE__ */ jsx("div", { className: "docs__sidebar-header", children: "Documentation" }),
|
|
525
|
+
topLevelSections.map((section) => renderSection(section))
|
|
526
|
+
]
|
|
527
|
+
}
|
|
528
|
+
);
|
|
516
529
|
}
|
|
517
530
|
function TocEntry({
|
|
518
531
|
item,
|
|
@@ -538,12 +551,13 @@ function TocEntry({
|
|
|
538
551
|
}
|
|
539
552
|
function TableOfContents({
|
|
540
553
|
toc,
|
|
541
|
-
activeId
|
|
554
|
+
activeId,
|
|
555
|
+
className
|
|
542
556
|
}) {
|
|
543
557
|
if (toc.length === 0) {
|
|
544
558
|
return null;
|
|
545
559
|
}
|
|
546
|
-
return /* @__PURE__ */ jsxs("nav", { className: "docs__toc", "aria-label": "On this page", children: [
|
|
560
|
+
return /* @__PURE__ */ jsxs("nav", { className: cx("docs__toc", className), "aria-label": "On this page", children: [
|
|
547
561
|
/* @__PURE__ */ jsx("h2", { className: "docs__toc-title", children: "On this page" }),
|
|
548
562
|
/* @__PURE__ */ jsx("div", { className: "docs__toc-list", children: toc.map((item) => /* @__PURE__ */ jsx(TocEntry, { item, activeId }, item.id)) })
|
|
549
563
|
] });
|
|
@@ -555,9 +569,10 @@ function DocsLayout({
|
|
|
555
569
|
breadcrumbs,
|
|
556
570
|
currentPageId,
|
|
557
571
|
onNavigate,
|
|
558
|
-
children
|
|
572
|
+
children,
|
|
573
|
+
className
|
|
559
574
|
}) {
|
|
560
|
-
return /* @__PURE__ */ jsxs("div", { className: "docs__layout", children: [
|
|
575
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("docs__layout", className), children: [
|
|
561
576
|
/* @__PURE__ */ jsx("aside", { className: "docs__sidebar", children: /* @__PURE__ */ jsx(
|
|
562
577
|
DocSidebar,
|
|
563
578
|
{
|
|
@@ -577,7 +592,8 @@ function DocsLayout({
|
|
|
577
592
|
}
|
|
578
593
|
function EditButton({
|
|
579
594
|
pageSlug,
|
|
580
|
-
editUrl
|
|
595
|
+
editUrl,
|
|
596
|
+
className
|
|
581
597
|
}) {
|
|
582
598
|
if (!editUrl) {
|
|
583
599
|
return null;
|
|
@@ -589,7 +605,7 @@ function EditButton({
|
|
|
589
605
|
href,
|
|
590
606
|
target: "_blank",
|
|
591
607
|
rel: "noreferrer noopener",
|
|
592
|
-
className: "docs__edit-link",
|
|
608
|
+
className: cx("docs__edit-link", className),
|
|
593
609
|
children: [
|
|
594
610
|
/* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", width: "14", height: "14", children: /* @__PURE__ */ jsx(
|
|
595
611
|
"path",
|
|
@@ -606,12 +622,13 @@ function EditButton({
|
|
|
606
622
|
}
|
|
607
623
|
function PageNavigation({
|
|
608
624
|
prev,
|
|
609
|
-
next
|
|
625
|
+
next,
|
|
626
|
+
className
|
|
610
627
|
}) {
|
|
611
628
|
if (!prev && !next) {
|
|
612
629
|
return null;
|
|
613
630
|
}
|
|
614
|
-
return /* @__PURE__ */ jsxs("nav", { className: "docs__page-nav", "aria-label": "Page navigation", children: [
|
|
631
|
+
return /* @__PURE__ */ jsxs("nav", { className: cx("docs__page-nav", className), "aria-label": "Page navigation", children: [
|
|
615
632
|
prev ? /* @__PURE__ */ jsxs("a", { href: prev.href, className: "docs__page-nav-prev", children: [
|
|
616
633
|
/* @__PURE__ */ jsx("span", { className: "docs__page-nav-label", children: "Previous" }),
|
|
617
634
|
/* @__PURE__ */ jsx("span", { className: "docs__page-nav-title", children: prev.title })
|
|
@@ -625,12 +642,13 @@ function PageNavigation({
|
|
|
625
642
|
function VersionSelector({
|
|
626
643
|
versions,
|
|
627
644
|
current,
|
|
628
|
-
onSelect
|
|
645
|
+
onSelect,
|
|
646
|
+
className
|
|
629
647
|
}) {
|
|
630
648
|
if (versions.length <= 1) {
|
|
631
649
|
return null;
|
|
632
650
|
}
|
|
633
|
-
return /* @__PURE__ */ jsx("div", { className: "docs__version-selector", children: /* @__PURE__ */ jsx(
|
|
651
|
+
return /* @__PURE__ */ jsx("div", { className: cx("docs__version-selector", className), children: /* @__PURE__ */ jsx(
|
|
634
652
|
"select",
|
|
635
653
|
{
|
|
636
654
|
className: "docs__version-select docs__version-select--active",
|
|
@@ -850,7 +868,8 @@ function useTableOfContents(mdxContent) {
|
|
|
850
868
|
}
|
|
851
869
|
function DocSearchPage({
|
|
852
870
|
tree,
|
|
853
|
-
onSelectPage
|
|
871
|
+
onSelectPage,
|
|
872
|
+
className
|
|
854
873
|
}) {
|
|
855
874
|
const sections = tree ?? [];
|
|
856
875
|
const flatPages = sections.flatMap((section) => section.pages ?? []);
|
|
@@ -863,9 +882,9 @@ function DocSearchPage({
|
|
|
863
882
|
);
|
|
864
883
|
const { query, results, isSearching, setQuery } = useDocSearch(searchFn);
|
|
865
884
|
if (tree === void 0) {
|
|
866
|
-
return /* @__PURE__ */ jsx("div", { className: "docs__empty", style: { minHeight: "100vh" }, children: /* @__PURE__ */ jsx("div", { className: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
|
|
885
|
+
return /* @__PURE__ */ jsx("div", { className: cx("docs__empty", className), style: { minHeight: "100vh" }, children: /* @__PURE__ */ jsx("div", { className: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
|
|
867
886
|
}
|
|
868
|
-
return /* @__PURE__ */ jsx("div", { className: "docs__main", children: /* @__PURE__ */ jsx("div", { className: "docs__content", children: /* @__PURE__ */ jsxs("div", { className: "docs__content-inner", style: { display: "block" }, children: [
|
|
887
|
+
return /* @__PURE__ */ jsx("div", { className: cx("docs__main", className), children: /* @__PURE__ */ jsx("div", { className: "docs__content", children: /* @__PURE__ */ jsxs("div", { className: "docs__content-inner", style: { display: "block" }, children: [
|
|
869
888
|
/* @__PURE__ */ jsx("header", { className: "docs__header", children: /* @__PURE__ */ jsx("h1", { className: "docs__title", children: "Search documentation" }) }),
|
|
870
889
|
/* @__PURE__ */ jsxs("div", { className: "docs__search-page", children: [
|
|
871
890
|
/* @__PURE__ */ jsx(
|
|
@@ -925,7 +944,8 @@ function parseDocAccess(value) {
|
|
|
925
944
|
function DocsAdminPage({
|
|
926
945
|
tree,
|
|
927
946
|
allPages,
|
|
928
|
-
admin
|
|
947
|
+
admin,
|
|
948
|
+
className
|
|
929
949
|
}) {
|
|
930
950
|
const sections = useMemo(() => tree ?? [], [tree]);
|
|
931
951
|
const [selectedSectionId, setSelectedSectionId] = useState(null);
|
|
@@ -958,9 +978,9 @@ function DocsAdminPage({
|
|
|
958
978
|
const canCreateSection = sectionForm.title.trim().length > 0 && sectionForm.slug.trim().length > 0;
|
|
959
979
|
const canCreatePage = pageForm.title.trim().length > 0 && pageForm.slug.trim().length > 0 && pageForm.content.trim().length > 0;
|
|
960
980
|
if (tree === void 0) {
|
|
961
|
-
return /* @__PURE__ */ jsx("div", { className: "docs__empty", style: { minHeight: "100vh" }, children: /* @__PURE__ */ jsx("div", { className: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
|
|
981
|
+
return /* @__PURE__ */ jsx("div", { className: cx("docs__empty", className), style: { minHeight: "100vh" }, children: /* @__PURE__ */ jsx("div", { className: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
|
|
962
982
|
}
|
|
963
|
-
return /* @__PURE__ */ jsx("div", { className: "docs__main", children: /* @__PURE__ */ jsx("div", { className: "docs__content", children: /* @__PURE__ */ jsxs("div", { className: "docs__content-inner", style: { display: "block" }, children: [
|
|
983
|
+
return /* @__PURE__ */ jsx("div", { className: cx("docs__main", className), children: /* @__PURE__ */ jsx("div", { className: "docs__content", children: /* @__PURE__ */ jsxs("div", { className: "docs__content-inner", style: { display: "block" }, children: [
|
|
964
984
|
/* @__PURE__ */ jsx("header", { className: "docs__header", children: /* @__PURE__ */ jsx("h1", { className: "docs__title", children: "Docs admin" }) }),
|
|
965
985
|
/* @__PURE__ */ jsxs("div", { className: "docs__admin-grid", children: [
|
|
966
986
|
/* @__PURE__ */ jsxs("section", { className: "docs__admin-panel", children: [
|
|
@@ -1316,7 +1336,8 @@ function DocsAdminPage({
|
|
|
1316
1336
|
}
|
|
1317
1337
|
function DocsIndexPage({
|
|
1318
1338
|
tree,
|
|
1319
|
-
onSelectPage
|
|
1339
|
+
onSelectPage,
|
|
1340
|
+
className
|
|
1320
1341
|
}) {
|
|
1321
1342
|
const docs = useDocs(tree);
|
|
1322
1343
|
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
@@ -1339,10 +1360,10 @@ function DocsIndexPage({
|
|
|
1339
1360
|
return () => document.removeEventListener("keydown", handleKeydown);
|
|
1340
1361
|
}, [docs.config.cmdKEnabled]);
|
|
1341
1362
|
if (docs.isLoading) {
|
|
1342
|
-
return /* @__PURE__ */ jsx("div", { className: "docs__empty", style: { minHeight: "100vh" }, children: /* @__PURE__ */ jsx("div", { className: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
|
|
1363
|
+
return /* @__PURE__ */ jsx("div", { className: cx("docs__empty", className), style: { minHeight: "100vh" }, children: /* @__PURE__ */ jsx("div", { className: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
|
|
1343
1364
|
}
|
|
1344
1365
|
if (docs.sections.length === 0) {
|
|
1345
|
-
return /* @__PURE__ */ jsxs("div", { className: "docs__empty", style: { minHeight: "100vh" }, children: [
|
|
1366
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("docs__empty", className), style: { minHeight: "100vh" }, children: [
|
|
1346
1367
|
/* @__PURE__ */ jsx("div", { className: "docs__empty-icon", "aria-hidden": "true", children: "\u{1F4DA}" }),
|
|
1347
1368
|
/* @__PURE__ */ jsx("div", { className: "docs__empty-title", children: "No documentation yet" }),
|
|
1348
1369
|
/* @__PURE__ */ jsx("div", { className: "docs__empty-desc", children: "Create a section and at least one page to populate the docs index." })
|
|
@@ -1351,7 +1372,7 @@ function DocsIndexPage({
|
|
|
1351
1372
|
const recentPages = docs.flatPages.slice().sort(
|
|
1352
1373
|
(left, right) => new Date(right.updatedAt).getTime() - new Date(left.updatedAt).getTime()
|
|
1353
1374
|
).slice(0, 6);
|
|
1354
|
-
return /* @__PURE__ */ jsxs("div", { className: "docs__main", children: [
|
|
1375
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("docs__main", className), children: [
|
|
1355
1376
|
/* @__PURE__ */ jsx("div", { className: "docs__content", children: /* @__PURE__ */ jsxs("div", { className: "docs__content-inner", style: { display: "block" }, children: [
|
|
1356
1377
|
/* @__PURE__ */ jsxs("header", { className: "docs__header", children: [
|
|
1357
1378
|
/* @__PURE__ */ jsx("h1", { className: "docs__title", children: "Documentation" }),
|
|
@@ -1473,7 +1494,8 @@ function DocViewPage({
|
|
|
1473
1494
|
page,
|
|
1474
1495
|
editPageUrl,
|
|
1475
1496
|
onNavigate,
|
|
1476
|
-
onIncrementView
|
|
1497
|
+
onIncrementView,
|
|
1498
|
+
className
|
|
1477
1499
|
}) {
|
|
1478
1500
|
const docs = useDocs(tree);
|
|
1479
1501
|
const { toc, activeId } = useTableOfContents(page?.content);
|
|
@@ -1512,10 +1534,10 @@ function DocViewPage({
|
|
|
1512
1534
|
};
|
|
1513
1535
|
}, [docs.flatPages, docs.sections, page]);
|
|
1514
1536
|
if (docs.isLoading || page === void 0) {
|
|
1515
|
-
return /* @__PURE__ */ jsx("div", { className: "docs__empty", style: { minHeight: "100vh" }, children: /* @__PURE__ */ jsx("div", { className: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
|
|
1537
|
+
return /* @__PURE__ */ jsx("div", { className: cx("docs__empty", className), style: { minHeight: "100vh" }, children: /* @__PURE__ */ jsx("div", { className: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
|
|
1516
1538
|
}
|
|
1517
1539
|
if (!page) {
|
|
1518
|
-
return /* @__PURE__ */ jsxs("div", { className: "docs__empty", style: { minHeight: "100vh" }, children: [
|
|
1540
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("docs__empty", className), style: { minHeight: "100vh" }, children: [
|
|
1519
1541
|
/* @__PURE__ */ jsx("div", { className: "docs__empty-icon", "aria-hidden": "true", children: "\u{1F50D}" }),
|
|
1520
1542
|
/* @__PURE__ */ jsx("div", { className: "docs__empty-title", children: "Page not found" }),
|
|
1521
1543
|
/* @__PURE__ */ jsx("div", { className: "docs__empty-desc", children: "The requested documentation page could not be resolved." })
|
|
@@ -1530,6 +1552,7 @@ function DocViewPage({
|
|
|
1530
1552
|
breadcrumbs,
|
|
1531
1553
|
currentPageId: page.id,
|
|
1532
1554
|
onNavigate,
|
|
1555
|
+
className,
|
|
1533
1556
|
children: [
|
|
1534
1557
|
/* @__PURE__ */ jsxs("header", { className: "docs__page-header", children: [
|
|
1535
1558
|
/* @__PURE__ */ jsx("h1", { className: "docs__page-title", children: page.title }),
|