@usecross/docs 0.10.2 → 0.12.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/dist/index.d.ts +164 -7
- package/dist/index.js +1304 -44
- package/dist/index.js.map +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/types-_anC1UJu.d.ts +320 -0
- package/package.json +1 -1
- package/src/components/DocsLayout.tsx +75 -59
- package/src/components/Sidebar.tsx +171 -28
- package/src/components/TableOfContents.tsx +6 -6
- package/src/components/api/APILayout.tsx +231 -0
- package/src/components/api/APIPage.tsx +216 -0
- package/src/components/api/Breadcrumb.tsx +98 -0
- package/src/components/api/ClassDoc.tsx +257 -0
- package/src/components/api/CodeSpan.tsx +53 -0
- package/src/components/api/Docstring.tsx +269 -0
- package/src/components/api/FunctionDoc.tsx +130 -0
- package/src/components/api/ModuleDoc.tsx +298 -0
- package/src/components/api/ParameterTable.tsx +183 -0
- package/src/components/api/Signature.tsx +317 -0
- package/src/components/api/TableOfContents.tsx +50 -0
- package/src/components/api/index.ts +17 -0
- package/src/components/index.ts +13 -1
- package/src/index.ts +32 -0
- package/src/types.ts +222 -1
- package/dist/types-DlTTA3Dc.d.ts +0 -128
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CodeBlockProps, D as DocSetMeta, a as DocsLayoutProps, b as DocContent, M as MarkdownProps, S as SidebarProps, T as TableOfContentsProps, c as DocsAppConfig } from './types-
|
|
3
|
-
export {
|
|
2
|
+
import { C as CodeBlockProps, D as DocSetMeta, a as DocsLayoutProps, b as DocContent, M as MarkdownProps, S as SidebarProps, T as TableOfContentsProps, A as APIPageProps, N as NavSection, G as GriffeModule, c as GriffeClass, d as GriffeFunction, e as GriffeDocstring, f as GriffeParameter, g as GriffeDocstringSection, h as DocsAppConfig } from './types-_anC1UJu.js';
|
|
3
|
+
export { u as ClassDocProps, w as DocstringProps, F as FunctionDocProps, r as GriffeAttribute, p as GriffeDecorator, o as GriffeDocstringElement, m as GriffeDocstringSectionKind, n as GriffeExpression, l as GriffeKind, s as GriffeMember, q as GriffeObjectBase, t as ModuleDocProps, i as NavItem, P as ParameterTableProps, j as SharedProps, v as SignatureProps, k as TOCItem } from './types-_anC1UJu.js';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { ClassValue } from 'clsx';
|
|
6
6
|
import { HighlighterCore } from 'shiki/core';
|
|
@@ -27,10 +27,14 @@ interface DocSetSelectorProps {
|
|
|
27
27
|
*/
|
|
28
28
|
declare function DocSetSelector({ docSets, currentDocSet, className }: DocSetSelectorProps): react_jsx_runtime.JSX.Element;
|
|
29
29
|
|
|
30
|
+
declare function MobileMenuButton({ onClick, isOpen }: {
|
|
31
|
+
onClick: () => void;
|
|
32
|
+
isOpen: boolean;
|
|
33
|
+
}): react_jsx_runtime.JSX.Element;
|
|
30
34
|
/**
|
|
31
35
|
* Full-featured documentation layout with sidebar, mobile menu, and header.
|
|
32
36
|
*/
|
|
33
|
-
declare function DocsLayout({ children, title, description: _description, logo, logoInverted, logoUrl: propLogoUrl, logoInvertedUrl: propLogoInvertedUrl, githubUrl: propGithubUrl, navLinks: propNavLinks, footer, toc, }: DocsLayoutProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare function DocsLayout({ children, title, description: _description, logo, logoInverted, logoUrl: propLogoUrl, logoInvertedUrl: propLogoInvertedUrl, githubUrl: propGithubUrl, navLinks: propNavLinks, header, headerHeight, footer, toc, }: DocsLayoutProps): react_jsx_runtime.JSX.Element;
|
|
34
38
|
|
|
35
39
|
interface DocsPageProps extends Omit<DocsLayoutProps, 'children' | 'title'> {
|
|
36
40
|
content: DocContent;
|
|
@@ -151,17 +155,25 @@ declare namespace HomePage {
|
|
|
151
155
|
*/
|
|
152
156
|
declare function Markdown({ content, components }: MarkdownProps): react_jsx_runtime.JSX.Element;
|
|
153
157
|
|
|
158
|
+
interface ExtendedSidebarProps extends SidebarProps {
|
|
159
|
+
/** Use compact styling (smaller text) */
|
|
160
|
+
compact?: boolean;
|
|
161
|
+
/** Make sections collapsible */
|
|
162
|
+
collapsible?: boolean;
|
|
163
|
+
/** Collapse sections with more than N items by default */
|
|
164
|
+
collapseThreshold?: number;
|
|
165
|
+
}
|
|
154
166
|
/**
|
|
155
167
|
* Documentation sidebar with section-based navigation.
|
|
156
|
-
*
|
|
168
|
+
* Supports both docs and API navigation styles.
|
|
157
169
|
*/
|
|
158
|
-
declare function Sidebar({ nav, currentPath, className, docSets, currentDocSet }:
|
|
170
|
+
declare function Sidebar({ nav, currentPath, className, docSets, currentDocSet, compact, collapsible, collapseThreshold, }: ExtendedSidebarProps): react_jsx_runtime.JSX.Element;
|
|
159
171
|
|
|
160
172
|
/**
|
|
161
173
|
* Table of contents component with scroll spy functionality.
|
|
162
174
|
* Displays "ON THIS PAGE" sidebar with heading links.
|
|
163
175
|
*/
|
|
164
|
-
declare function TableOfContents({ items, className }: TableOfContentsProps): react_jsx_runtime.JSX.Element | null;
|
|
176
|
+
declare function TableOfContents({ items, className, ...props }: TableOfContentsProps): react_jsx_runtime.JSX.Element | null;
|
|
165
177
|
|
|
166
178
|
type Theme = 'light' | 'dark' | 'system';
|
|
167
179
|
type ResolvedTheme = 'light' | 'dark';
|
|
@@ -197,6 +209,151 @@ interface ThemeToggleProps {
|
|
|
197
209
|
*/
|
|
198
210
|
declare function ThemeToggle({ className, size }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
|
|
199
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Main API documentation page component.
|
|
214
|
+
*
|
|
215
|
+
* Renders API documentation with a separate sidebar navigation.
|
|
216
|
+
* Automatically handles different item types (modules, classes, functions).
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* // In your pages configuration:
|
|
220
|
+
* createDocsApp({
|
|
221
|
+
* pages: {
|
|
222
|
+
* 'api/APIPage': APIPage,
|
|
223
|
+
* // ...
|
|
224
|
+
* }
|
|
225
|
+
* })
|
|
226
|
+
*/
|
|
227
|
+
declare function APIPage({ apiData, currentItem, currentPath, currentModule, apiNav, prefix, logoUrl, logoInvertedUrl, footerLogoUrl, footerLogoInvertedUrl, githubUrl, navLinks, header, headerHeight, footer, }: APIPageProps): react_jsx_runtime.JSX.Element;
|
|
228
|
+
|
|
229
|
+
interface APILayoutProps {
|
|
230
|
+
children: React.ReactNode;
|
|
231
|
+
title: string;
|
|
232
|
+
apiNav: NavSection[];
|
|
233
|
+
currentPath: string;
|
|
234
|
+
logoUrl?: string;
|
|
235
|
+
logoInvertedUrl?: string;
|
|
236
|
+
footerLogoUrl?: string;
|
|
237
|
+
footerLogoInvertedUrl?: string;
|
|
238
|
+
githubUrl?: string;
|
|
239
|
+
navLinks?: Array<{
|
|
240
|
+
label: string;
|
|
241
|
+
href: string;
|
|
242
|
+
}>;
|
|
243
|
+
/** Right sidebar content (e.g., table of contents) */
|
|
244
|
+
rightSidebar?: React.ReactNode;
|
|
245
|
+
/** Custom header component (replaces entire header). Can be a ReactNode or a function that receives mobile menu props. */
|
|
246
|
+
header?: React.ReactNode | ((props: {
|
|
247
|
+
mobileMenuOpen: boolean;
|
|
248
|
+
toggleMobileMenu: () => void;
|
|
249
|
+
}) => React.ReactNode);
|
|
250
|
+
/** Header height in pixels. Used to calculate content offset. Defaults to 64 (h-16). */
|
|
251
|
+
headerHeight?: number;
|
|
252
|
+
/** Custom footer component */
|
|
253
|
+
footer?: React.ReactNode;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Layout component for API documentation pages.
|
|
257
|
+
* Uses the shared Sidebar component with compact styling and collapsible sections.
|
|
258
|
+
*/
|
|
259
|
+
declare function APILayout({ children, title, apiNav, currentPath, logoUrl: propLogoUrl, logoInvertedUrl: propLogoInvertedUrl, footerLogoUrl: propFooterLogoUrl, footerLogoInvertedUrl: propFooterLogoInvertedUrl, githubUrl: propGithubUrl, navLinks: propNavLinks, rightSidebar, header, headerHeight: propHeaderHeight, footer, }: APILayoutProps): react_jsx_runtime.JSX.Element;
|
|
260
|
+
|
|
261
|
+
interface ModuleDocProps {
|
|
262
|
+
module: GriffeModule;
|
|
263
|
+
/** URL prefix for links */
|
|
264
|
+
prefix?: string;
|
|
265
|
+
/** Show full module content or just summary */
|
|
266
|
+
showFull?: boolean;
|
|
267
|
+
/** Additional CSS class */
|
|
268
|
+
className?: string;
|
|
269
|
+
/** Override display path (e.g., for aliases to show alias name instead of target path) */
|
|
270
|
+
displayPath?: string;
|
|
271
|
+
/** GitHub repository URL for "Open in GitHub" links */
|
|
272
|
+
githubUrl?: string;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Renders documentation for a module including its classes, functions, and submodules.
|
|
276
|
+
*/
|
|
277
|
+
declare function ModuleDoc({ module, prefix, showFull, className, displayPath, githubUrl }: ModuleDocProps): react_jsx_runtime.JSX.Element;
|
|
278
|
+
|
|
279
|
+
interface ClassDocProps {
|
|
280
|
+
cls: GriffeClass;
|
|
281
|
+
/** URL prefix for links */
|
|
282
|
+
prefix?: string;
|
|
283
|
+
/** Current path for breadcrumb */
|
|
284
|
+
currentPath?: string;
|
|
285
|
+
/** GitHub repo URL for source links */
|
|
286
|
+
githubUrl?: string;
|
|
287
|
+
/** Additional CSS class */
|
|
288
|
+
className?: string;
|
|
289
|
+
/** Override display path (e.g., for aliases to show alias name instead of target path) */
|
|
290
|
+
displayPath?: string;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Renders documentation for a class matching strawberry.rocks design.
|
|
294
|
+
* Includes: Title, Constructor, Methods (collapsible), Attributes, and footer.
|
|
295
|
+
*/
|
|
296
|
+
declare function ClassDoc({ cls, prefix: _prefix, currentPath: _currentPath, githubUrl, className, displayPath }: ClassDocProps): react_jsx_runtime.JSX.Element;
|
|
297
|
+
|
|
298
|
+
interface FunctionDocProps {
|
|
299
|
+
fn: GriffeFunction;
|
|
300
|
+
/** Whether this is a method (inside a class) */
|
|
301
|
+
isMethod?: boolean;
|
|
302
|
+
/** Show function name as title */
|
|
303
|
+
showName?: boolean;
|
|
304
|
+
/** GitHub repo URL for source links */
|
|
305
|
+
githubUrl?: string;
|
|
306
|
+
/** Additional CSS class */
|
|
307
|
+
className?: string;
|
|
308
|
+
/** Override display path (e.g., for aliases to show alias name instead of target path) */
|
|
309
|
+
displayPath?: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Renders documentation for a function or method matching strawberry.rocks design.
|
|
313
|
+
*/
|
|
314
|
+
declare function FunctionDoc({ fn, isMethod, showName, githubUrl, className, displayPath }: FunctionDocProps): react_jsx_runtime.JSX.Element;
|
|
315
|
+
|
|
316
|
+
interface SignatureProps {
|
|
317
|
+
fn: GriffeFunction;
|
|
318
|
+
/** Show full path or just function name */
|
|
319
|
+
showPath?: boolean;
|
|
320
|
+
/** Additional CSS class */
|
|
321
|
+
className?: string;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Renders a Python function/method signature with syntax highlighting.
|
|
325
|
+
* Uses dark background style matching strawberry.rocks.
|
|
326
|
+
*/
|
|
327
|
+
declare function Signature({ fn, showPath, className }: SignatureProps): react_jsx_runtime.JSX.Element;
|
|
328
|
+
|
|
329
|
+
interface DocstringProps {
|
|
330
|
+
docstring: GriffeDocstring | undefined;
|
|
331
|
+
/** Show raw text instead of parsed sections */
|
|
332
|
+
raw?: boolean;
|
|
333
|
+
/** Only show the text/description part, skip parameters/returns/etc */
|
|
334
|
+
showOnlyText?: boolean;
|
|
335
|
+
/** Additional CSS class */
|
|
336
|
+
className?: string;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Renders a parsed docstring with sections for parameters, returns, raises, etc.
|
|
340
|
+
*/
|
|
341
|
+
declare function Docstring({ docstring, raw, showOnlyText, className }: DocstringProps): react_jsx_runtime.JSX.Element | null;
|
|
342
|
+
|
|
343
|
+
interface ParameterTableProps {
|
|
344
|
+
parameters: GriffeParameter[];
|
|
345
|
+
/** Docstring sections for parameter descriptions */
|
|
346
|
+
docstringSections?: GriffeDocstringSection[];
|
|
347
|
+
/** Additional CSS class */
|
|
348
|
+
className?: string;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Renders a two-column parameter list matching strawberry.rocks design.
|
|
352
|
+
* Left column: parameter name badge
|
|
353
|
+
* Right column: description, type, and default value
|
|
354
|
+
*/
|
|
355
|
+
declare function ParameterTable({ parameters, docstringSections, className }: ParameterTableProps): react_jsx_runtime.JSX.Element | null;
|
|
356
|
+
|
|
200
357
|
/**
|
|
201
358
|
* Create and mount an Inertia.js documentation app.
|
|
202
359
|
*
|
|
@@ -233,4 +390,4 @@ declare function configureHighlighter(options: {
|
|
|
233
390
|
langs?: Promise<any>[];
|
|
234
391
|
}): void;
|
|
235
392
|
|
|
236
|
-
export { CodeBlock, CodeBlockProps, DocContent, DocSetMeta, DocSetSelector, DocsAppConfig, DocsLayout, DocsLayoutProps, DocsPage, EmojiConfetti, HomeCTA, type HomeFeature, HomeFeatureItem, type HomeFeatureItemProps, HomeFeatures, type HomeFeaturesProps, HomeFooter, HomeHeader, type HomeHeaderProps, HomeHero, HomePage, type HomePageContextValue, type HomePageProps, InlineCode, Markdown, MarkdownProps, type ResolvedTheme, Sidebar, SidebarProps, TableOfContents, TableOfContentsProps, type Theme, ThemeProvider, ThemeToggle, cn, configureHighlighter, createDocsApp, getHighlighter, themeInitScript, useTheme };
|
|
393
|
+
export { APILayout, APIPage, APIPageProps, ClassDoc, CodeBlock, CodeBlockProps, DocContent, DocSetMeta, DocSetSelector, DocsAppConfig, DocsLayout, DocsLayoutProps, DocsPage, Docstring, EmojiConfetti, FunctionDoc, GriffeClass, GriffeDocstring, GriffeDocstringSection, GriffeFunction, GriffeModule, GriffeParameter, HomeCTA, type HomeFeature, HomeFeatureItem, type HomeFeatureItemProps, HomeFeatures, type HomeFeaturesProps, HomeFooter, HomeHeader, type HomeHeaderProps, HomeHero, HomePage, type HomePageContextValue, type HomePageProps, InlineCode, Markdown, MarkdownProps, MobileMenuButton, ModuleDoc, NavSection, ParameterTable, type ResolvedTheme, Sidebar, SidebarProps, Signature, TableOfContents, TableOfContentsProps, type Theme, ThemeProvider, ThemeToggle, cn, configureHighlighter, createDocsApp, getHighlighter, themeInitScript, useTheme };
|