@farming-labs/docs 0.0.2-beta.23 → 0.0.2-beta.26
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.mts +113 -10
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -297,6 +297,54 @@ interface BreadcrumbConfig {
|
|
|
297
297
|
*/
|
|
298
298
|
component?: unknown;
|
|
299
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* A leaf page in the sidebar tree.
|
|
302
|
+
*/
|
|
303
|
+
interface SidebarPageNode {
|
|
304
|
+
type: "page";
|
|
305
|
+
name: string;
|
|
306
|
+
url: string;
|
|
307
|
+
icon?: unknown;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* A folder (group) in the sidebar tree. May contain child pages
|
|
311
|
+
* and nested folders, forming a recursive hierarchy.
|
|
312
|
+
*/
|
|
313
|
+
interface SidebarFolderNode {
|
|
314
|
+
type: "folder";
|
|
315
|
+
name: string;
|
|
316
|
+
icon?: unknown;
|
|
317
|
+
/** Index page for this folder (the folder's own landing page). */
|
|
318
|
+
index?: SidebarPageNode;
|
|
319
|
+
/** Child pages and sub-folders. */
|
|
320
|
+
children: SidebarNode[];
|
|
321
|
+
/** Whether this folder section is collapsible. */
|
|
322
|
+
collapsible?: boolean;
|
|
323
|
+
/** Whether this folder starts open. */
|
|
324
|
+
defaultOpen?: boolean;
|
|
325
|
+
}
|
|
326
|
+
/** A node in the sidebar tree — either a page or a folder. */
|
|
327
|
+
type SidebarNode = SidebarPageNode | SidebarFolderNode;
|
|
328
|
+
/** The full sidebar tree passed to custom sidebar components. */
|
|
329
|
+
interface SidebarTree {
|
|
330
|
+
name: string;
|
|
331
|
+
children: SidebarNode[];
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Props passed to a custom sidebar component.
|
|
335
|
+
*
|
|
336
|
+
* Contains all the information needed to build a fully custom sidebar:
|
|
337
|
+
* the complete page tree with parent-child relationships, and the
|
|
338
|
+
* current sidebar configuration.
|
|
339
|
+
*/
|
|
340
|
+
interface SidebarComponentProps {
|
|
341
|
+
/** Full page tree with all parent-child-folder relationships. */
|
|
342
|
+
tree: SidebarTree;
|
|
343
|
+
/** Whether folders are collapsible. */
|
|
344
|
+
collapsible: boolean;
|
|
345
|
+
/** Whether folders are rendered flat (Mintlify-style). */
|
|
346
|
+
flat: boolean;
|
|
347
|
+
}
|
|
300
348
|
interface SidebarConfig {
|
|
301
349
|
/**
|
|
302
350
|
* Whether to show the sidebar.
|
|
@@ -304,17 +352,46 @@ interface SidebarConfig {
|
|
|
304
352
|
*/
|
|
305
353
|
enabled?: boolean;
|
|
306
354
|
/**
|
|
307
|
-
* Custom sidebar component to
|
|
308
|
-
* Receives the page tree and config as context.
|
|
355
|
+
* Custom sidebar component to replace the default navigation.
|
|
309
356
|
*
|
|
310
|
-
*
|
|
357
|
+
* **Next.js** — Pass a render function that receives `SidebarComponentProps`:
|
|
311
358
|
* ```tsx
|
|
312
359
|
* sidebar: {
|
|
313
|
-
* component:
|
|
360
|
+
* component: ({ tree, collapsible, flat }) => (
|
|
361
|
+
* <MySidebar tree={tree} />
|
|
362
|
+
* ),
|
|
314
363
|
* }
|
|
315
364
|
* ```
|
|
365
|
+
*
|
|
366
|
+
* **Astro** — Use the `sidebar` named slot on `<DocsLayout>`:
|
|
367
|
+
* ```astro
|
|
368
|
+
* <DocsLayout tree={tree} config={config}>
|
|
369
|
+
* <MySidebar slot="sidebar" tree={tree} />
|
|
370
|
+
* <slot />
|
|
371
|
+
* </DocsLayout>
|
|
372
|
+
* ```
|
|
373
|
+
*
|
|
374
|
+
* **SvelteKit** — Use the `sidebar` snippet on `<DocsLayout>`:
|
|
375
|
+
* ```svelte
|
|
376
|
+
* <DocsLayout {tree} {config}>
|
|
377
|
+
* {#snippet sidebar({ tree, isActive })}
|
|
378
|
+
* <MySidebarNav {tree} {isActive} />
|
|
379
|
+
* {/snippet}
|
|
380
|
+
* {@render children()}
|
|
381
|
+
* </DocsLayout>
|
|
382
|
+
* ```
|
|
383
|
+
*
|
|
384
|
+
* **Nuxt / Vue** — Use the `#sidebar` scoped slot on `<DocsLayout>`:
|
|
385
|
+
* ```vue
|
|
386
|
+
* <DocsLayout :tree="tree" :config="config">
|
|
387
|
+
* <template #sidebar="{ tree, isActive }">
|
|
388
|
+
* <MySidebarNav :tree="tree" :is-active="isActive" />
|
|
389
|
+
* </template>
|
|
390
|
+
* <DocsContent />
|
|
391
|
+
* </DocsLayout>
|
|
392
|
+
* ```
|
|
316
393
|
*/
|
|
317
|
-
component?: unknown;
|
|
394
|
+
component?: (props: SidebarComponentProps) => unknown;
|
|
318
395
|
/**
|
|
319
396
|
* Sidebar footer content (rendered below navigation items).
|
|
320
397
|
*/
|
|
@@ -757,11 +834,37 @@ interface AIConfig {
|
|
|
757
834
|
*/
|
|
758
835
|
docsUrl?: string;
|
|
759
836
|
/**
|
|
760
|
-
*
|
|
761
|
-
*
|
|
837
|
+
* Loading indicator variant shown while the AI generates a response.
|
|
838
|
+
*
|
|
839
|
+
* - `"shimmer-dots"` — shimmer text + typing dots (default)
|
|
840
|
+
* - `"circular"` — spinning ring
|
|
841
|
+
* - `"dots"` — bouncing dots
|
|
842
|
+
* - `"typing"` — typing dots
|
|
843
|
+
* - `"wave"` — wave bars
|
|
844
|
+
* - `"bars"` — thick wave bars
|
|
845
|
+
* - `"pulse"` — pulsing ring
|
|
846
|
+
* - `"pulse-dot"` — pulsing dot
|
|
847
|
+
* - `"terminal"` — blinking terminal cursor
|
|
848
|
+
* - `"text-blink"` — blinking text
|
|
849
|
+
* - `"text-shimmer"` — shimmer text only
|
|
850
|
+
* - `"loading-dots"` — "Thinking..." with animated dots
|
|
851
|
+
*
|
|
852
|
+
* @default "shimmer-dots"
|
|
853
|
+
*
|
|
854
|
+
* @example
|
|
855
|
+
* ```ts
|
|
856
|
+
* ai: {
|
|
857
|
+
* enabled: true,
|
|
858
|
+
* loader: "wave",
|
|
859
|
+
* }
|
|
860
|
+
* ```
|
|
861
|
+
*/
|
|
862
|
+
loader?: "shimmer-dots" | "circular" | "dots" | "typing" | "wave" | "bars" | "pulse" | "pulse-dot" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
|
|
863
|
+
/**
|
|
864
|
+
* Custom loading indicator that overrides the built-in `loader` variant.
|
|
865
|
+
* Receives `{ name }` (the `aiLabel` value) and returns a React element.
|
|
762
866
|
*
|
|
763
|
-
*
|
|
764
|
-
* returns a React element. This way you don't need to duplicate the label.
|
|
867
|
+
* Only works in Next.js. For other frameworks, use the `loader` option.
|
|
765
868
|
*
|
|
766
869
|
* @example
|
|
767
870
|
* ```tsx
|
|
@@ -1119,4 +1222,4 @@ declare function resolveTitle(pageTitle: string, metadata?: DocsMetadata): strin
|
|
|
1119
1222
|
*/
|
|
1120
1223
|
declare function resolveOGImage(page: PageFrontmatter, ogConfig?: OGConfig, baseUrl?: string): string | undefined;
|
|
1121
1224
|
//#endregion
|
|
1122
|
-
export { type AIConfig, type BreadcrumbConfig, type CopyMarkdownConfig, type DocsConfig, type DocsMetadata, type DocsNav, type DocsTheme, type FontStyle, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type SidebarConfig, type ThemeToggleConfig, type TypographyConfig, type UIConfig, createTheme, deepMerge, defineDocs, extendTheme, resolveOGImage, resolveTitle };
|
|
1225
|
+
export { type AIConfig, type BreadcrumbConfig, type CopyMarkdownConfig, type DocsConfig, type DocsMetadata, type DocsNav, type DocsTheme, type FontStyle, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type SidebarComponentProps, type SidebarConfig, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type ThemeToggleConfig, type TypographyConfig, type UIConfig, createTheme, deepMerge, defineDocs, extendTheme, resolveOGImage, resolveTitle };
|