@geenius/docs 0.1.0 → 0.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/CHANGELOG.md +7 -0
- package/README.md +53 -1
- package/package.json +96 -13
- package/packages/convex/dist/index.d.ts +503 -0
- package/packages/convex/dist/index.js +482 -0
- package/packages/convex/dist/index.js.map +1 -0
- package/packages/react/dist/index.d.ts +439 -0
- package/packages/react/dist/index.js +4954 -0
- package/packages/react/dist/index.js.map +1 -0
- package/packages/react-css/{src/styles.css → dist/index.css} +183 -223
- package/packages/react-css/dist/index.css.map +1 -0
- package/packages/react-css/dist/index.d.ts +443 -0
- package/packages/react-css/dist/index.js +5058 -0
- package/packages/react-css/dist/index.js.map +1 -0
- package/packages/shared/dist/index.d.ts +684 -0
- package/packages/shared/dist/index.js +788 -0
- package/packages/shared/dist/index.js.map +1 -0
- package/packages/solidjs/dist/index.d.ts +435 -0
- package/packages/solidjs/dist/index.js +4584 -0
- package/packages/solidjs/dist/index.js.map +1 -0
- package/packages/solidjs-css/{src/styles.css → dist/index.css} +183 -223
- package/packages/solidjs-css/dist/index.css.map +1 -0
- package/packages/solidjs-css/dist/index.d.ts +432 -0
- package/packages/solidjs-css/dist/index.js +4934 -0
- package/packages/solidjs-css/dist/index.js.map +1 -0
- package/.changeset/config.json +0 -11
- package/.github/CODEOWNERS +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -11
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -10
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/ci.yml +0 -23
- package/.github/workflows/release.yml +0 -29
- package/.nvmrc +0 -1
- package/.project/ACCOUNT.yaml +0 -4
- package/.project/IDEAS.yaml +0 -7
- package/.project/PROJECT.yaml +0 -11
- package/.project/ROADMAP.yaml +0 -15
- package/CODE_OF_CONDUCT.md +0 -16
- package/CONTRIBUTING.md +0 -26
- package/SECURITY.md +0 -15
- package/SUPPORT.md +0 -8
- package/packages/convex/README.md +0 -1
- package/packages/convex/package.json +0 -12
- package/packages/convex/src/convex.config.ts +0 -3
- package/packages/convex/src/index.ts +0 -3
- package/packages/convex/src/mutations.ts +0 -270
- package/packages/convex/src/queries.ts +0 -175
- package/packages/convex/src/schema.ts +0 -55
- package/packages/react/README.md +0 -1
- package/packages/react/package.json +0 -36
- package/packages/react/src/DocsLayout.tsx +0 -116
- package/packages/react/src/DocsProvider.tsx +0 -93
- package/packages/react/src/RouterDocsContent.tsx +0 -148
- package/packages/react/src/RouterDocsLayout.tsx +0 -161
- package/packages/react/src/components/Breadcrumbs.tsx +0 -34
- package/packages/react/src/components/DocPage.tsx +0 -191
- package/packages/react/src/components/DocSearch.tsx +0 -140
- package/packages/react/src/components/DocSidebar.tsx +0 -86
- package/packages/react/src/components/DocsLayout.tsx +0 -62
- package/packages/react/src/components/EditButton.tsx +0 -26
- package/packages/react/src/components/PageNavigation.tsx +0 -45
- package/packages/react/src/components/TableOfContents.tsx +0 -46
- package/packages/react/src/components/VersionSelector.tsx +0 -60
- package/packages/react/src/components/index.ts +0 -9
- package/packages/react/src/hooks/index.ts +0 -8
- package/packages/react/src/hooks/useDocSearch.ts +0 -55
- package/packages/react/src/hooks/useDocs.ts +0 -57
- package/packages/react/src/hooks/useDocsAdmin.ts +0 -151
- package/packages/react/src/hooks/useTableOfContents.ts +0 -66
- package/packages/react/src/index.ts +0 -38
- package/packages/react/src/pages/DocSearchPage.tsx +0 -129
- package/packages/react/src/pages/DocViewPage.tsx +0 -158
- package/packages/react/src/pages/DocsAdminPage.tsx +0 -330
- package/packages/react/src/pages/DocsIndexPage.tsx +0 -172
- package/packages/react/src/pages/index.ts +0 -4
- package/packages/react/src/useDocs.ts +0 -58
- package/packages/react/tsup.config.ts +0 -12
- package/packages/react-css/README.md +0 -1
- package/packages/react-css/package.json +0 -37
- package/packages/react-css/src/DocsLayout.tsx +0 -117
- package/packages/react-css/src/DocsProvider.tsx +0 -93
- package/packages/react-css/src/RouterDocsContent.tsx +0 -60
- package/packages/react-css/src/RouterDocsLayout.tsx +0 -101
- package/packages/react-css/src/components/DocPage.tsx +0 -21
- package/packages/react-css/src/components/DocSearch.tsx +0 -55
- package/packages/react-css/src/components/DocSidebar.tsx +0 -56
- package/packages/react-css/src/components/DocsLayout.tsx +0 -28
- package/packages/react-css/src/components/common.tsx +0 -93
- package/packages/react-css/src/components/index.ts +0 -5
- package/packages/react-css/src/hooks/index.ts +0 -2
- package/packages/react-css/src/index.ts +0 -6
- package/packages/react-css/src/index.tsx +0 -3
- package/packages/react-css/src/pages/DocViewPage.tsx +0 -78
- package/packages/react-css/src/pages/DocsAdminPage.tsx +0 -101
- package/packages/react-css/src/pages/DocsIndexPage.tsx +0 -68
- package/packages/react-css/src/pages/index.ts +0 -3
- package/packages/react-css/src/useDocs.ts +0 -58
- package/packages/react-css/tsconfig.json +0 -19
- package/packages/react-css/tsup.config.ts +0 -10
- package/packages/shared/README.md +0 -1
- package/packages/shared/package.json +0 -31
- package/packages/shared/src/__tests__/docs.test.ts +0 -69
- package/packages/shared/src/config.ts +0 -80
- package/packages/shared/src/index.ts +0 -179
- package/packages/shared/src/providers/astro.ts +0 -94
- package/packages/shared/src/providers/fumadocs.ts +0 -116
- package/packages/shared/src/providers/internal.ts +0 -80
- package/packages/shared/src/types.ts +0 -73
- package/packages/shared/tsconfig.json +0 -18
- package/packages/shared/tsup.config.ts +0 -12
- package/packages/shared/vitest.config.ts +0 -4
- package/packages/solidjs/README.md +0 -1
- package/packages/solidjs/package.json +0 -33
- package/packages/solidjs/src/DocsLayout.tsx +0 -87
- package/packages/solidjs/src/DocsProvider.tsx +0 -95
- package/packages/solidjs/src/RouterDocsContent.tsx +0 -147
- package/packages/solidjs/src/RouterDocsLayout.tsx +0 -161
- package/packages/solidjs/src/components/Breadcrumbs.tsx +0 -27
- package/packages/solidjs/src/components/DocPage.tsx +0 -110
- package/packages/solidjs/src/components/DocSearch.tsx +0 -81
- package/packages/solidjs/src/components/DocSidebar.tsx +0 -92
- package/packages/solidjs/src/components/DocsLayout.tsx +0 -38
- package/packages/solidjs/src/components/EditButton.tsx +0 -15
- package/packages/solidjs/src/components/PageNavigation.tsx +0 -31
- package/packages/solidjs/src/components/TableOfContents.tsx +0 -41
- package/packages/solidjs/src/components/VersionSelector.tsx +0 -30
- package/packages/solidjs/src/components/index.ts +0 -9
- package/packages/solidjs/src/createDocs.ts +0 -62
- package/packages/solidjs/src/index.ts +0 -28
- package/packages/solidjs/src/pages/DocSearchPage.tsx +0 -72
- package/packages/solidjs/src/pages/DocViewPage.tsx +0 -80
- package/packages/solidjs/src/pages/DocsAdminPage.tsx +0 -123
- package/packages/solidjs/src/pages/DocsIndexPage.tsx +0 -85
- package/packages/solidjs/src/pages/index.ts +0 -4
- package/packages/solidjs/src/primitives/createDocSearch.ts +0 -42
- package/packages/solidjs/src/primitives/createDocs.ts +0 -35
- package/packages/solidjs/src/primitives/createDocsAdmin.ts +0 -63
- package/packages/solidjs/src/primitives/createTableOfContents.ts +0 -51
- package/packages/solidjs/src/primitives/index.ts +0 -4
- package/packages/solidjs/tsup.config.ts +0 -12
- package/packages/solidjs-css/README.md +0 -1
- package/packages/solidjs-css/package.json +0 -36
- package/packages/solidjs-css/src/DocsLayout.tsx +0 -106
- package/packages/solidjs-css/src/DocsProvider.tsx +0 -95
- package/packages/solidjs-css/src/RouterDocsContent.tsx +0 -54
- package/packages/solidjs-css/src/RouterDocsLayout.tsx +0 -104
- package/packages/solidjs-css/src/createDocs.ts +0 -62
- package/packages/solidjs-css/src/index.ts +0 -7
- package/packages/solidjs-css/src/index.tsx +0 -17
- package/packages/solidjs-css/src/pages/DocViewPage.tsx +0 -111
- package/packages/solidjs-css/src/pages/DocsAdminPage.tsx +0 -332
- package/packages/solidjs-css/src/pages/DocsIndexPage.tsx +0 -116
- package/packages/solidjs-css/src/pages/index.ts +0 -3
- package/packages/solidjs-css/src/primitives/index.ts +0 -1
- package/packages/solidjs-css/tsconfig.json +0 -20
- package/packages/solidjs-css/tsup.config.ts +0 -10
- package/pnpm-workspace.yaml +0 -2
|
@@ -0,0 +1,439 @@
|
|
|
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
|
+
import React$1 from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @module reactBreadcrumbs
|
|
7
|
+
* @package @geenius/docs-react
|
|
8
|
+
* @description Renders breadcrumb navigation for the React docs variant using
|
|
9
|
+
* the shared docs route metadata and Tailwind styling contract.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
interface BreadcrumbsProps {
|
|
13
|
+
items: BreadcrumbItem[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Renders the current docs breadcrumb trail.
|
|
17
|
+
*
|
|
18
|
+
* @param props - Breadcrumb items describing the current page ancestry.
|
|
19
|
+
* @returns Breadcrumb navigation or `null` when there are no items to show.
|
|
20
|
+
*/
|
|
21
|
+
declare function Breadcrumbs({ items, }: BreadcrumbsProps): React$1.JSX.Element | null;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @module reactDocPage
|
|
25
|
+
* @package @geenius/docs-react
|
|
26
|
+
* @description Renders a docs page body with safe Markdown semantics, heading
|
|
27
|
+
* anchors, and package-consistent typography. The component deliberately avoids
|
|
28
|
+
* raw HTML injection so authored docs content stays within the Markdown runtime.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
interface DocPageProps {
|
|
32
|
+
page: DocPage$1;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Renders a docs page body using safe Markdown rendering.
|
|
36
|
+
*
|
|
37
|
+
* @param props - Docs page record containing the Markdown body to render.
|
|
38
|
+
* @returns The rendered page article.
|
|
39
|
+
*/
|
|
40
|
+
declare function DocPage(props: DocPageProps): React$1.JSX.Element;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @module reactDocSearch
|
|
44
|
+
* @package @geenius/docs-react
|
|
45
|
+
* @description Provides the React command-palette style docs search modal with
|
|
46
|
+
* animated presentation, keyboard navigation, and result highlighting.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
interface DocSearchProps {
|
|
50
|
+
results: SearchResult[];
|
|
51
|
+
query: string;
|
|
52
|
+
onQuery: (q: string) => void;
|
|
53
|
+
onSelect: (result: SearchResult) => void;
|
|
54
|
+
isOpen: boolean;
|
|
55
|
+
onClose: () => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Renders the modal search surface for the React docs variant.
|
|
59
|
+
*
|
|
60
|
+
* @param props - Search results, query state, and modal interaction handlers.
|
|
61
|
+
* @returns Search dialog markup when open, otherwise `null`.
|
|
62
|
+
*/
|
|
63
|
+
declare function DocSearch({ results, query, onQuery, onSelect, isOpen, onClose, }: DocSearchProps): React$1.JSX.Element | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @module reactDocSidebar
|
|
67
|
+
* @package @geenius/docs-react
|
|
68
|
+
* @description Renders the hierarchical sidebar navigation used by the React
|
|
69
|
+
* docs variant, including animated section expansion and active page states.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
interface DocSidebarProps {
|
|
73
|
+
sections: (DocSection & {
|
|
74
|
+
pages?: DocPage$1[];
|
|
75
|
+
pageCount?: number;
|
|
76
|
+
})[];
|
|
77
|
+
currentPageId?: string;
|
|
78
|
+
onNavigate: (page: DocPage$1, section: DocSection) => void;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Sidebar navigation for docs sections and pages.
|
|
82
|
+
*
|
|
83
|
+
* @param props - Section tree, active page id, and page navigation callback.
|
|
84
|
+
* @returns Sidebar markup for the React docs experience.
|
|
85
|
+
*/
|
|
86
|
+
declare function DocSidebar({ sections, currentPageId, onNavigate, }: DocSidebarProps): React.JSX.Element;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @module reactDocsLayout
|
|
90
|
+
* @package @geenius/docs-react
|
|
91
|
+
* @description Composes the React docs page shell with sidebar navigation,
|
|
92
|
+
* breadcrumb chrome, animated content transitions, and the right-rail TOC.
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
interface DocsLayoutProps {
|
|
96
|
+
sections: (DocSection & {
|
|
97
|
+
pages?: DocPage$1[];
|
|
98
|
+
})[];
|
|
99
|
+
currentPage?: DocPage$1;
|
|
100
|
+
toc?: TocItem[];
|
|
101
|
+
activeHeadingId?: string;
|
|
102
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
103
|
+
currentPageId?: string;
|
|
104
|
+
onNavigate: (page: DocPage$1, section: DocSection) => void;
|
|
105
|
+
children: React$1.ReactNode;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Layout shell shared by React docs pages.
|
|
109
|
+
*
|
|
110
|
+
* @param props - Navigation state, table-of-contents state, and page content.
|
|
111
|
+
* @returns Full page layout for React docs screens.
|
|
112
|
+
*/
|
|
113
|
+
declare function DocsLayout({ sections, toc, activeHeadingId, breadcrumbs, currentPageId, onNavigate, children, }: DocsLayoutProps): React$1.JSX.Element;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @module reactEditButton
|
|
117
|
+
* @package @geenius/docs-react
|
|
118
|
+
* @description Exposes the React docs "Edit this page" affordance so hosts can
|
|
119
|
+
* route readers to the source repository for the active document.
|
|
120
|
+
*/
|
|
121
|
+
interface EditButtonProps {
|
|
122
|
+
pageSlug: string;
|
|
123
|
+
editUrl?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Renders the source-edit link for the current docs page.
|
|
127
|
+
*
|
|
128
|
+
* @param props - Page slug and optional edit URL base.
|
|
129
|
+
* @returns Edit link markup or `null` when editing is disabled.
|
|
130
|
+
*/
|
|
131
|
+
declare function EditButton({ pageSlug, editUrl, }: EditButtonProps): React.JSX.Element | null;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @module reactPageNavigation
|
|
135
|
+
* @package @geenius/docs-react
|
|
136
|
+
* @description Renders previous and next article affordances for the React
|
|
137
|
+
* docs variant using the shared page navigation contract.
|
|
138
|
+
*/
|
|
139
|
+
interface PageNavigationProps {
|
|
140
|
+
prev?: {
|
|
141
|
+
title: string;
|
|
142
|
+
href: string;
|
|
143
|
+
};
|
|
144
|
+
next?: {
|
|
145
|
+
title: string;
|
|
146
|
+
href: string;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Renders previous and next page links for the active article.
|
|
151
|
+
*
|
|
152
|
+
* @param props - Optional previous and next navigation links.
|
|
153
|
+
* @returns Navigation markup or `null` when no links are available.
|
|
154
|
+
*/
|
|
155
|
+
declare function PageNavigation({ prev, next, }: PageNavigationProps): React.JSX.Element | null;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @module reactTableOfContents
|
|
159
|
+
* @package @geenius/docs-react
|
|
160
|
+
* @description Renders the React docs table of contents with animated active
|
|
161
|
+
* heading states and nested anchor links derived from the shared TOC model.
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
interface TableOfContentsProps {
|
|
165
|
+
toc: TocItem[];
|
|
166
|
+
activeId?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Renders the page table of contents.
|
|
170
|
+
*
|
|
171
|
+
* @param props - TOC entries and the currently active heading id.
|
|
172
|
+
* @returns TOC navigation or `null` when the page has no headings.
|
|
173
|
+
*/
|
|
174
|
+
declare function TableOfContents({ toc, activeId, }: TableOfContentsProps): React.JSX.Element | null;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @module reactVersionSelector
|
|
178
|
+
* @package @geenius/docs-react
|
|
179
|
+
* @description Provides the React docs version switcher with a disclosure menu
|
|
180
|
+
* for choosing among published documentation versions.
|
|
181
|
+
*/
|
|
182
|
+
interface VersionSelectorProps {
|
|
183
|
+
versions: string[];
|
|
184
|
+
current: string;
|
|
185
|
+
onSelect: (version: string) => void;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Renders a version switcher when multiple docs versions exist.
|
|
189
|
+
*
|
|
190
|
+
* @param props - Supported versions, the current version, and selection callback.
|
|
191
|
+
* @returns Version selector markup or `null` when only one version exists.
|
|
192
|
+
*/
|
|
193
|
+
declare function VersionSelector({ versions, current, onSelect, }: VersionSelectorProps): React.JSX.Element | null;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @module reactUseDocSearch
|
|
197
|
+
* @package @geenius/docs-react
|
|
198
|
+
* @description Implements debounced search state for the React docs variant so
|
|
199
|
+
* modal and page-level search flows share a common query lifecycle.
|
|
200
|
+
*/
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Search state returned by the React docs search hook.
|
|
204
|
+
*/
|
|
205
|
+
interface DocSearchState {
|
|
206
|
+
results: SearchResult[];
|
|
207
|
+
isSearching: boolean;
|
|
208
|
+
query: string;
|
|
209
|
+
setQuery: (q: string) => void;
|
|
210
|
+
clearSearch: () => void;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Debounces docs search calls for the React variant.
|
|
214
|
+
*
|
|
215
|
+
* @param searchFn - Search function that returns ranked docs results.
|
|
216
|
+
* @param debounceMs - Delay before the search function is executed.
|
|
217
|
+
* @returns Search state and control helpers.
|
|
218
|
+
*/
|
|
219
|
+
declare function useDocSearch(searchFn: (query: string) => SearchResult[] | Promise<SearchResult[]>, debounceMs?: number): DocSearchState;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @module reactUseDocs
|
|
223
|
+
* @package @geenius/docs-react
|
|
224
|
+
* @description Provides the core React docs state container that normalizes
|
|
225
|
+
* section trees, current page selection, search state, and merged config.
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Aggregate docs state exposed to React pages and components.
|
|
230
|
+
*/
|
|
231
|
+
interface DocsState {
|
|
232
|
+
sections: (DocSection & {
|
|
233
|
+
pages: DocPage$1[];
|
|
234
|
+
pageCount: number;
|
|
235
|
+
})[];
|
|
236
|
+
currentSection: DocSection | null;
|
|
237
|
+
setSection: (section: DocSection | null) => void;
|
|
238
|
+
currentPage: DocPage$1 | null;
|
|
239
|
+
setPage: (page: DocPage$1 | null) => void;
|
|
240
|
+
searchQuery: string;
|
|
241
|
+
setSearchQuery: (query: string) => void;
|
|
242
|
+
isLoading: boolean;
|
|
243
|
+
config: DocsConfig;
|
|
244
|
+
flatPages: DocPage$1[];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Creates normalized docs state for React pages and components.
|
|
248
|
+
*
|
|
249
|
+
* @param tree - Docs section tree with eagerly attached pages.
|
|
250
|
+
* @param config - Optional config overrides merged onto the shared defaults.
|
|
251
|
+
* @returns Normalized docs state for the React docs surface.
|
|
252
|
+
*/
|
|
253
|
+
declare function useDocs(tree: (DocSection & {
|
|
254
|
+
pages: DocPage$1[];
|
|
255
|
+
pageCount: number;
|
|
256
|
+
})[] | undefined, config?: Partial<DocsConfig>): DocsState;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @module reactUseDocsAdmin
|
|
260
|
+
* @package @geenius/docs-react
|
|
261
|
+
* @description Wraps docs admin mutations in stable React callbacks so the
|
|
262
|
+
* admin pages can manage sections and pages without coupling to one backend.
|
|
263
|
+
*/
|
|
264
|
+
/**
|
|
265
|
+
* Stable admin actions exposed to React docs management surfaces.
|
|
266
|
+
*/
|
|
267
|
+
interface DocsAdminActions {
|
|
268
|
+
createSection: (data: {
|
|
269
|
+
title: string;
|
|
270
|
+
slug: string;
|
|
271
|
+
parentId?: string;
|
|
272
|
+
order: number;
|
|
273
|
+
icon?: string;
|
|
274
|
+
description?: string;
|
|
275
|
+
access: 'public' | 'team' | 'admin';
|
|
276
|
+
}) => Promise<void>;
|
|
277
|
+
updateSection: (sectionId: string, data: Record<string, unknown>) => Promise<void>;
|
|
278
|
+
deleteSection: (sectionId: string) => Promise<void>;
|
|
279
|
+
reorderSections: (sectionIds: string[]) => Promise<void>;
|
|
280
|
+
createPage: (data: {
|
|
281
|
+
title: string;
|
|
282
|
+
slug: string;
|
|
283
|
+
content: string;
|
|
284
|
+
sectionId: string;
|
|
285
|
+
access: 'public' | 'team' | 'admin';
|
|
286
|
+
tags?: string[];
|
|
287
|
+
version?: string;
|
|
288
|
+
status?: 'draft' | 'published' | 'archived';
|
|
289
|
+
author?: {
|
|
290
|
+
name: string;
|
|
291
|
+
avatar?: string;
|
|
292
|
+
};
|
|
293
|
+
excerpt?: string;
|
|
294
|
+
order?: number;
|
|
295
|
+
}) => Promise<void>;
|
|
296
|
+
updatePage: (pageId: string, data: Record<string, unknown>) => Promise<void>;
|
|
297
|
+
publishPage: (pageId: string) => Promise<void>;
|
|
298
|
+
archivePage: (pageId: string) => Promise<void>;
|
|
299
|
+
deletePage: (pageId: string) => Promise<void>;
|
|
300
|
+
reorderPages: (pageIds: string[]) => Promise<void>;
|
|
301
|
+
movePage: (pageId: string, newSectionId: string, newOrder: number) => Promise<void>;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Admin hook factory — accepts mutation functions (from Convex useMutation or similar)
|
|
305
|
+
* and returns a stable set of admin action callbacks.
|
|
306
|
+
*
|
|
307
|
+
* @param mutations - Backend mutation functions for docs admin operations.
|
|
308
|
+
* @returns Stable admin action callbacks for the React docs variant.
|
|
309
|
+
*/
|
|
310
|
+
declare function useDocsAdmin(mutations: {
|
|
311
|
+
createSection: (args: Record<string, unknown>) => Promise<unknown>;
|
|
312
|
+
updateSection: (args: Record<string, unknown>) => Promise<unknown>;
|
|
313
|
+
deleteSection: (args: Record<string, unknown>) => Promise<unknown>;
|
|
314
|
+
reorderSections: (args: Record<string, unknown>) => Promise<unknown>;
|
|
315
|
+
createPage: (args: Record<string, unknown>) => Promise<unknown>;
|
|
316
|
+
updatePage: (args: Record<string, unknown>) => Promise<unknown>;
|
|
317
|
+
publishPage: (args: Record<string, unknown>) => Promise<unknown>;
|
|
318
|
+
archivePage: (args: Record<string, unknown>) => Promise<unknown>;
|
|
319
|
+
deletePage: (args: Record<string, unknown>) => Promise<unknown>;
|
|
320
|
+
reorderPages: (args: Record<string, unknown>) => Promise<unknown>;
|
|
321
|
+
movePage: (args: Record<string, unknown>) => Promise<unknown>;
|
|
322
|
+
}): DocsAdminActions;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @module reactUseTableOfContents
|
|
326
|
+
* @package @geenius/docs-react
|
|
327
|
+
* @description Tracks the extracted table of contents and active heading state
|
|
328
|
+
* for rendered React docs pages.
|
|
329
|
+
*/
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Table-of-contents state returned by the React docs hook.
|
|
333
|
+
*/
|
|
334
|
+
interface TableOfContentsState {
|
|
335
|
+
toc: TocItem[];
|
|
336
|
+
activeId: string;
|
|
337
|
+
setActiveId: (id: string) => void;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Extracts and tracks a page table of contents for React article screens.
|
|
341
|
+
*
|
|
342
|
+
* @param mdxContent - Markdown or MDX source for the active page.
|
|
343
|
+
* @returns Extracted TOC entries plus the active heading id.
|
|
344
|
+
*/
|
|
345
|
+
declare function useTableOfContents(mdxContent: string | undefined): TableOfContentsState;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @module reactDocSearchPage
|
|
349
|
+
* @package @geenius/docs-react
|
|
350
|
+
* @description Renders the dedicated React docs search page with a full-page
|
|
351
|
+
* query input, ranked search results, and empty-state messaging.
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
interface DocSearchPageProps {
|
|
355
|
+
tree: (DocSection & {
|
|
356
|
+
pages: DocPage$1[];
|
|
357
|
+
pageCount: number;
|
|
358
|
+
})[] | undefined;
|
|
359
|
+
onSelectPage?: (page: DocPage$1, section: DocSection) => void;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Dedicated search page for the React docs variant.
|
|
363
|
+
*
|
|
364
|
+
* @param props - Docs tree and optional page selection handler.
|
|
365
|
+
* @returns Search page UI or a loading state when the tree is unresolved.
|
|
366
|
+
*/
|
|
367
|
+
declare function DocSearchPage({ tree, onSelectPage, }: DocSearchPageProps): React.JSX.Element;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* @module reactDocsAdminPage
|
|
371
|
+
* @package @geenius/docs-react
|
|
372
|
+
* @description Renders the React docs admin surface for creating, updating,
|
|
373
|
+
* publishing, and deleting docs sections and pages.
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
interface DocsAdminPageProps {
|
|
377
|
+
tree: (DocSection & {
|
|
378
|
+
pages: DocPage$1[];
|
|
379
|
+
pageCount: number;
|
|
380
|
+
})[] | undefined;
|
|
381
|
+
allPages?: DocPage$1[];
|
|
382
|
+
admin: DocsAdminActions;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Admin page for section and page management in the React docs variant.
|
|
386
|
+
*
|
|
387
|
+
* @param props - Tree data, optional page list, and admin actions.
|
|
388
|
+
* @returns Admin UI for managing docs content.
|
|
389
|
+
*/
|
|
390
|
+
declare function DocsAdminPage({ tree, allPages, admin, }: DocsAdminPageProps): React.JSX.Element;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* @module reactDocsIndexPage
|
|
394
|
+
* @package @geenius/docs-react
|
|
395
|
+
* @description Renders the React docs landing page with section discovery,
|
|
396
|
+
* recent updates, and command-palette search entry points.
|
|
397
|
+
*/
|
|
398
|
+
|
|
399
|
+
interface DocsIndexPageProps {
|
|
400
|
+
tree: (DocSection & {
|
|
401
|
+
pages: DocPage$1[];
|
|
402
|
+
pageCount: number;
|
|
403
|
+
})[] | undefined;
|
|
404
|
+
onSelectPage?: (page: DocPage$1, section: DocSection) => void;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Landing page for the React docs experience.
|
|
408
|
+
*
|
|
409
|
+
* @param props - Docs tree plus optional page selection handler.
|
|
410
|
+
* @returns Landing page UI for the React docs variant.
|
|
411
|
+
*/
|
|
412
|
+
declare function DocsIndexPage({ tree, onSelectPage, }: DocsIndexPageProps): React.JSX.Element;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* @module reactDocViewPage
|
|
416
|
+
* @package @geenius/docs-react
|
|
417
|
+
* @description Renders the primary React docs article page with layout chrome,
|
|
418
|
+
* metadata, TOC tracking, edit actions, and previous or next navigation.
|
|
419
|
+
*/
|
|
420
|
+
|
|
421
|
+
interface DocViewPageProps {
|
|
422
|
+
tree: (DocSection & {
|
|
423
|
+
pages: DocPage$1[];
|
|
424
|
+
pageCount: number;
|
|
425
|
+
})[] | undefined;
|
|
426
|
+
page: DocPage$1 | null | undefined;
|
|
427
|
+
editPageUrl?: string;
|
|
428
|
+
onNavigate: (page: DocPage$1, section: DocSection) => void;
|
|
429
|
+
onIncrementView?: (pageId: string) => void;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Detailed article page for the React docs variant.
|
|
433
|
+
*
|
|
434
|
+
* @param props - Docs tree, active page, and page-level interaction handlers.
|
|
435
|
+
* @returns Detailed page view or an appropriate loading or empty state.
|
|
436
|
+
*/
|
|
437
|
+
declare function DocViewPage({ tree, page, editPageUrl, onNavigate, onIncrementView, }: DocViewPageProps): React.JSX.Element;
|
|
438
|
+
|
|
439
|
+
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 };
|