@nikala-ui/folio 0.14.0 → 0.15.1

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.
Files changed (160) hide show
  1. package/README.md +16 -0
  2. package/dist/cli/commands/init.js +105 -51
  3. package/dist/client/app.jsx +6 -3
  4. package/dist/client/components/docs-layout-shell.d.ts +1 -0
  5. package/dist/client/components/docs-layout-shell.jsx +1 -1
  6. package/dist/client/components/docs-page-content.jsx +9 -5
  7. package/dist/client/navigation/page-navigation.js +10 -27
  8. package/dist/client/public/algolia-logo.svg +15 -0
  9. package/dist/client/public/favicon.ico +0 -0
  10. package/dist/client/public/logo.svg +11 -0
  11. package/dist/client/routing/use-docs-router.d.ts +1 -0
  12. package/dist/client/routing/use-docs-router.js +12 -3
  13. package/dist/client/style.css +139 -55
  14. package/dist/components/ui/api-table.jsx +6 -4
  15. package/dist/components/ui/code-block.jsx +6 -4
  16. package/dist/components/ui/command.jsx +9 -5
  17. package/dist/components/ui/list.jsx +3 -1
  18. package/dist/components/ui/logo.d.ts +4 -1
  19. package/dist/components/ui/logo.jsx +8 -22
  20. package/dist/components/ui/package-manager-tabs.jsx +4 -2
  21. package/dist/components/ui/pager.jsx +4 -2
  22. package/dist/components/ui/section-heading.jsx +1 -1
  23. package/dist/components/ui/sidebar.jsx +6 -3
  24. package/dist/components/ui/spinner.jsx +3 -1
  25. package/dist/components/ui/theme-toggle.jsx +14 -12
  26. package/dist/config.d.ts +1 -0
  27. package/dist/config.js +84 -29
  28. package/dist/core/content-scanner.d.ts +2 -1
  29. package/dist/core/content-scanner.js +2 -9
  30. package/dist/core/plugin/index.d.ts +2 -0
  31. package/dist/core/plugin/index.js +1 -0
  32. package/dist/core/plugin/lifecycle-error.d.ts +19 -0
  33. package/dist/core/plugin/lifecycle-error.js +28 -0
  34. package/dist/core/plugin/lifecycle-snapshot.d.ts +1 -0
  35. package/dist/core/plugin/lifecycle-snapshot.js +156 -0
  36. package/dist/core/plugin/lifecycle.d.ts +34 -0
  37. package/dist/core/plugin/lifecycle.js +170 -0
  38. package/dist/core/route-tree.d.ts +3 -2
  39. package/dist/core/route-tree.js +40 -10
  40. package/dist/index.d.ts +7 -4
  41. package/dist/index.js +4 -3
  42. package/dist/plugin.d.ts +60 -0
  43. package/dist/plugin.js +51 -0
  44. package/dist/plugins/i18n/components/site-language-switcher.d.ts +10 -0
  45. package/dist/plugins/i18n/components/site-language-switcher.jsx +39 -0
  46. package/dist/plugins/i18n/constants.d.ts +1 -0
  47. package/dist/plugins/i18n/constants.js +1 -0
  48. package/dist/plugins/i18n/index.d.ts +11 -0
  49. package/dist/plugins/i18n/index.js +89 -0
  50. package/dist/plugins/i18n/navigation.d.ts +5 -0
  51. package/dist/plugins/i18n/navigation.js +33 -0
  52. package/dist/plugins/i18n/runtime.d.ts +19 -0
  53. package/dist/plugins/i18n/runtime.jsx +65 -0
  54. package/dist/plugins/i18n/site-locale.d.ts +12 -0
  55. package/dist/plugins/i18n/site-locale.js +119 -0
  56. package/dist/search/provider.d.ts +9 -0
  57. package/dist/search/provider.js +4 -2
  58. package/dist/server/index.d.ts +4 -1
  59. package/dist/server/index.js +69 -33
  60. package/dist/server/module-serialization.d.ts +6 -0
  61. package/dist/server/module-serialization.js +26 -0
  62. package/dist/server/plugin/components.d.ts +7 -0
  63. package/dist/server/plugin/components.js +82 -0
  64. package/dist/server/plugin/constants.d.ts +17 -0
  65. package/dist/server/plugin/constants.js +21 -0
  66. package/dist/server/{plugin.d.ts → plugin/index.d.ts} +3 -1
  67. package/dist/server/plugin/index.js +166 -0
  68. package/dist/server/plugin/lifecycle.d.ts +32 -0
  69. package/dist/server/plugin/lifecycle.js +110 -0
  70. package/dist/server/plugin/styles.d.ts +3 -0
  71. package/dist/server/plugin/styles.js +22 -0
  72. package/dist/server/plugin/virtual-modules.d.ts +11 -0
  73. package/dist/server/plugin/virtual-modules.js +121 -0
  74. package/dist/server/seo.d.ts +4 -0
  75. package/dist/server/seo.js +87 -0
  76. package/dist/templates/env.d.ts +26 -0
  77. package/dist/templates/locales/en.json +77 -0
  78. package/dist/themes/default/components/docs-landing-body.d.ts +17 -0
  79. package/dist/themes/default/components/docs-landing-body.jsx +17 -0
  80. package/dist/themes/default/components/docs-page-body.d.ts +21 -0
  81. package/dist/themes/default/components/docs-page-body.jsx +36 -0
  82. package/dist/themes/default/components/page-actions.d.ts +15 -0
  83. package/dist/themes/default/components/page-actions.jsx +60 -0
  84. package/dist/themes/default/components/page-header.d.ts +7 -0
  85. package/dist/themes/default/components/page-header.jsx +3 -0
  86. package/dist/themes/default/components/sidebar-footer.d.ts +6 -0
  87. package/dist/themes/default/components/sidebar-footer.jsx +12 -0
  88. package/dist/themes/default/components/sidebar-header.d.ts +8 -0
  89. package/dist/themes/default/components/sidebar-header.jsx +17 -0
  90. package/dist/themes/default/components/sidebar-mobile-nav.d.ts +7 -0
  91. package/dist/themes/default/components/sidebar-mobile-nav.jsx +17 -0
  92. package/dist/themes/default/components/sidebar-promo.d.ts +8 -0
  93. package/dist/themes/default/components/sidebar-promo.jsx +20 -0
  94. package/dist/themes/default/content/breadcrumbs.jsx +5 -2
  95. package/dist/themes/default/content/table-of-contents.jsx +3 -1
  96. package/dist/themes/default/hooks/use-page-copy.d.ts +6 -0
  97. package/dist/themes/default/hooks/use-page-copy.js +26 -0
  98. package/dist/themes/default/layout.jsx +30 -127
  99. package/dist/themes/default/lib/layout-visibility.d.ts +8 -0
  100. package/dist/themes/default/lib/layout-visibility.js +24 -0
  101. package/dist/themes/default/navbar.jsx +14 -7
  102. package/dist/themes/default/navigation/mobile-table-of-contents.jsx +5 -3
  103. package/dist/themes/default/navigation/sidebar-tree.d.ts +2 -0
  104. package/dist/themes/default/navigation/sidebar-tree.jsx +11 -2
  105. package/dist/themes/default/overlays/search-dialog.jsx +14 -3
  106. package/dist/themes/default/sidebar.jsx +21 -49
  107. package/dist/themes/types.d.ts +5 -0
  108. package/dist/types.d.ts +36 -0
  109. package/dist/utils/format-title.d.ts +1 -0
  110. package/dist/utils/format-title.js +11 -0
  111. package/dist/vendor/docs-src/client/page-actions.ts +69 -0
  112. package/dist/vendor/docs-src/components/ui/api-table.tsx +6 -4
  113. package/dist/vendor/docs-src/components/ui/code-block.tsx +6 -4
  114. package/dist/vendor/docs-src/components/ui/command.tsx +9 -5
  115. package/dist/vendor/docs-src/components/ui/list.tsx +4 -2
  116. package/dist/vendor/docs-src/components/ui/logo.tsx +19 -48
  117. package/dist/vendor/docs-src/components/ui/package-manager-tabs.tsx +4 -2
  118. package/dist/vendor/docs-src/components/ui/pager.tsx +4 -2
  119. package/dist/vendor/docs-src/components/ui/section-heading.tsx +5 -1
  120. package/dist/vendor/docs-src/components/ui/sidebar.tsx +7 -4
  121. package/dist/vendor/docs-src/components/ui/spinner.tsx +3 -1
  122. package/dist/vendor/docs-src/components/ui/theme-toggle.tsx +15 -13
  123. package/dist/vendor/docs-src/navigation/index.ts +2 -0
  124. package/dist/vendor/docs-src/navigation/repository-links.ts +43 -0
  125. package/dist/vendor/docs-src/navigation/sidebar-state.ts +22 -0
  126. package/dist/vendor/docs-src/navigation/sidebar-tree.ts +15 -0
  127. package/dist/vendor/docs-src/plugins/i18n/components/site-language-switcher.tsx +56 -0
  128. package/dist/vendor/docs-src/plugins/i18n/constants.ts +1 -0
  129. package/dist/vendor/docs-src/plugins/i18n/index.ts +110 -0
  130. package/dist/vendor/docs-src/plugins/i18n/navigation.ts +49 -0
  131. package/dist/vendor/docs-src/plugins/i18n/runtime.tsx +91 -0
  132. package/dist/vendor/docs-src/plugins/i18n/site-locale.ts +140 -0
  133. package/dist/vendor/docs-src/search/provider.ts +83 -0
  134. package/dist/vendor/docs-src/themes/default/components/docs-landing-body.tsx +30 -0
  135. package/dist/vendor/docs-src/themes/default/components/docs-page-body.tsx +53 -0
  136. package/dist/vendor/docs-src/themes/default/components/page-actions.tsx +105 -0
  137. package/dist/vendor/docs-src/themes/default/components/page-header.tsx +31 -0
  138. package/dist/vendor/docs-src/themes/default/components/sidebar-footer.tsx +21 -0
  139. package/dist/vendor/docs-src/themes/default/components/sidebar-header.tsx +30 -0
  140. package/dist/vendor/docs-src/themes/default/components/sidebar-mobile-nav.tsx +33 -0
  141. package/dist/vendor/docs-src/themes/default/components/sidebar-promo.tsx +37 -0
  142. package/dist/vendor/docs-src/themes/default/content/breadcrumbs.tsx +43 -0
  143. package/dist/vendor/docs-src/themes/default/content/pager.tsx +19 -0
  144. package/dist/vendor/docs-src/themes/default/content/table-of-contents.tsx +32 -0
  145. package/dist/vendor/docs-src/themes/default/hooks/use-page-copy.ts +29 -0
  146. package/dist/vendor/docs-src/themes/default/icons.ts +16 -0
  147. package/dist/vendor/docs-src/themes/default/index.ts +46 -0
  148. package/dist/vendor/docs-src/themes/default/layout.tsx +176 -0
  149. package/dist/vendor/docs-src/themes/default/lib/layout-visibility.ts +39 -0
  150. package/dist/vendor/docs-src/themes/default/navbar.tsx +130 -0
  151. package/dist/vendor/docs-src/themes/default/navigation/mobile-table-of-contents.tsx +61 -0
  152. package/dist/vendor/docs-src/themes/default/navigation/sidebar-tree.tsx +202 -0
  153. package/dist/vendor/docs-src/themes/default/overlays/search-dialog.tsx +106 -0
  154. package/dist/vendor/docs-src/themes/default/sidebar.tsx +86 -0
  155. package/dist/vendor/docs-src/themes/index.ts +4 -0
  156. package/dist/vendor/docs-src/themes/types.ts +87 -0
  157. package/dist/version.d.ts +1 -1
  158. package/dist/version.js +1 -1
  159. package/package.json +11 -4
  160. package/dist/server/plugin.js +0 -521
@@ -0,0 +1,77 @@
1
+ {
2
+ "navigation.search": "Search docs...",
3
+ "navigation.searchLabel": "Search documentation",
4
+ "navigation.toggleSidebar": "Toggle documentation sidebar",
5
+ "navigation.closeSidebar": "Close documentation sidebar",
6
+ "navigation.documentation": "Documentation",
7
+ "navigation.primary": "Primary navigation",
8
+ "navigation.github": "GitHub",
9
+ "navigation.chooseLanguage": "Choose language",
10
+ "navigation.toggleNavigation": "Toggle navigation",
11
+ "navigation.toggleSidebarRail": "Toggle sidebar rail",
12
+ "navigation.sidebar": "Sidebar",
13
+ "navigation.collapse": "Collapse",
14
+ "navigation.expand": "Expand",
15
+ "navigation.breadcrumb": "Breadcrumb",
16
+ "actions.viewSource": "View source",
17
+ "actions.copyPage": "Copy page",
18
+ "actions.copyAsMarkdown": "Copy as Markdown",
19
+ "actions.learnMore": "Learn more",
20
+ "actions.copyDocumentationPage": "Copy documentation page",
21
+ "actions.openInProvider": "Open in {provider}",
22
+ "actions.copied": "Copied",
23
+ "actions.prompt": "Prompt",
24
+ "actions.copyContext": "Copy context",
25
+ "actions.copyCliCommand": "Copy CLI command",
26
+ "actions.copyCode": "Copy code",
27
+ "actions.exitFullscreen": "Exit fullscreen",
28
+ "actions.expandFullscreen": "Expand fullscreen",
29
+ "tableOfContents.title": "On this page",
30
+ "search.placeholder": "Search documentation...",
31
+ "search.empty": "No matching documents found.",
32
+ "search.pages": "Pages",
33
+ "search.by": "Search by",
34
+ "search.commandPlaceholder": "Search commands...",
35
+ "search.noResults": "No results found for {query}.",
36
+ "pagination.previous": "Previous",
37
+ "pagination.next": "Next",
38
+ "theme.toggle": "Toggle theme",
39
+ "theme.light": "Light",
40
+ "theme.dark": "Dark",
41
+ "theme.system": "System",
42
+ "theme.mode": "Theme mode",
43
+ "theme.brandAccentColor": "Brand accent color",
44
+ "theme.borderRadius": "Border radius",
45
+ "viewer.preview": "Preview",
46
+ "viewer.code": "Code",
47
+ "viewer.desktopViewport": "Desktop viewport",
48
+ "viewer.tabletViewport": "Tablet viewport",
49
+ "viewer.mobileViewport": "Mobile viewport",
50
+ "viewer.desktopSize": "Desktop size",
51
+ "viewer.tabletSize": "Tablet size",
52
+ "viewer.mobileSize": "Mobile size",
53
+ "viewer.toggleBackgroundGrid": "Toggle background grid",
54
+ "viewer.canvasGrid": "Canvas grid",
55
+ "viewer.resetPreviewCanvas": "Reset preview canvas",
56
+ "viewer.resetCanvas": "Reset canvas",
57
+ "viewer.copyAiContext": "Copy AI context",
58
+ "viewer.copyCodeForAi": "Copy code for AI",
59
+ "viewer.copyCliInstallation": "Copy CLI installation",
60
+ "viewer.fullscreenPreview": "Fullscreen preview",
61
+ "viewer.exitFullscreen": "Exit fullscreen",
62
+ "code.copied": "Code copied",
63
+ "code.copy": "Copy code",
64
+ "command.navigate": "Navigate",
65
+ "command.select": "Select",
66
+ "command.close": "Close",
67
+ "image.avatar": "Avatar",
68
+ "status.loading": "Loading...",
69
+ "status.loadingLabel": "Loading",
70
+ "accessibility.callout": "Callout",
71
+ "errors.pageNotFound": "Page not found",
72
+ "errors.pageNotFoundDescription": "The requested documentation page could not be found.",
73
+ "apiTable.property": "Property",
74
+ "apiTable.type": "Type",
75
+ "apiTable.default": "Default",
76
+ "apiTable.description": "Description"
77
+ }
@@ -0,0 +1,17 @@
1
+ import { type Component, type JSX } from "solid-js";
2
+ import type { BreadcrumbItemData } from "../../types.js";
3
+ export interface DocsLandingBodyProps {
4
+ breadcrumbs?: BreadcrumbItemData[];
5
+ showBreadcrumbs: boolean;
6
+ showPager: boolean;
7
+ prev?: {
8
+ title: string;
9
+ href: string;
10
+ };
11
+ next?: {
12
+ title: string;
13
+ href: string;
14
+ };
15
+ children?: JSX.Element;
16
+ }
17
+ export declare const DocsLandingBody: Component<DocsLandingBodyProps>;
@@ -0,0 +1,17 @@
1
+ import { Show } from "solid-js";
2
+ import { Container } from "@/components/ui/container";
3
+ import { DocsBreadcrumbs } from "../content/breadcrumbs.jsx";
4
+ import { DocsPager } from "../content/pager.jsx";
5
+ export const DocsLandingBody = (props) => (<Container as="main" size="2xl" class="min-w-0 max-w-full flex-1 py-8 sm:py-12 lg:py-16">
6
+ <Container as="article" size="xl" class="mx-auto min-w-0 px-0 sm:px-4">
7
+ <Show when={props.showBreadcrumbs && props.breadcrumbs && props.breadcrumbs.length > 0}>
8
+ <DocsBreadcrumbs items={props.breadcrumbs} class="mb-6"/>
9
+ </Show>
10
+ <Container as="div" size="full" class="prose prose-zinc dark:prose-invert max-w-none px-0" data-docs-page-content>
11
+ {props.children}
12
+ </Container>
13
+ <Show when={props.showPager && (props.prev || props.next)}>
14
+ <DocsPager prev={props.prev} next={props.next}/>
15
+ </Show>
16
+ </Container>
17
+ </Container>);
@@ -0,0 +1,21 @@
1
+ import { type Component, type JSX } from "solid-js";
2
+ import type { BreadcrumbItemData } from "../../types.js";
3
+ import type { PageData, TocItem } from "../../../types.js";
4
+ export interface DocsPageBodyProps {
5
+ breadcrumbs?: BreadcrumbItemData[];
6
+ currentPage?: PageData;
7
+ toc?: TocItem[];
8
+ prev?: {
9
+ title: string;
10
+ href: string;
11
+ };
12
+ next?: {
13
+ title: string;
14
+ href: string;
15
+ };
16
+ showToc: boolean;
17
+ pageActions: JSX.Element;
18
+ sidebarPromo?: NonNullable<NonNullable<import("../../../types.js").DocsNavigationConfig["sidebar"]>["promo"]>;
19
+ children?: JSX.Element;
20
+ }
21
+ export declare const DocsPageBody: Component<DocsPageBodyProps>;
@@ -0,0 +1,36 @@
1
+ import { Show } from "solid-js";
2
+ import { Container } from "@/components/ui/container";
3
+ import { DocsBreadcrumbs } from "../content/breadcrumbs.jsx";
4
+ import { DocsPager } from "../content/pager.jsx";
5
+ import { DocsTableOfContents } from "../content/table-of-contents.jsx";
6
+ import { DocsMobileTableOfContents } from "../navigation/mobile-table-of-contents.jsx";
7
+ import { SidebarPromo } from "./sidebar-promo.jsx";
8
+ export const DocsPageBody = (props) => (<Container as="main" size="2xl" class="min-w-0 w-full max-w-[96rem] flex-1 grid grid-cols-1 xl:grid-cols-[minmax(0,1fr)_16rem] items-start gap-4 sm:gap-8 py-6 sm:py-8">
9
+ <Container as="article" size="full" class="min-w-0 max-w-none mx-0 px-0 sm:px-4 w-full">
10
+ <Show when={props.breadcrumbs && props.breadcrumbs.length > 0}>
11
+ <DocsBreadcrumbs items={props.breadcrumbs} class="mb-6"/>
12
+ </Show>
13
+ <Show when={props.currentPage?.title}>
14
+ {props.pageActions}
15
+ </Show>
16
+ <Show when={props.showToc}>
17
+ <DocsMobileTableOfContents items={props.toc} class="mb-6"/>
18
+ </Show>
19
+ <Container as="div" size="full" class="prose prose-zinc dark:prose-invert max-w-none px-0 sm:px-0 lg:px-0" data-docs-page-content>
20
+ {props.children}
21
+ </Container>
22
+ <Show when={props.prev || props.next}>
23
+ <DocsPager prev={props.prev} next={props.next}/>
24
+ </Show>
25
+ </Container>
26
+ <Show when={props.showToc && props.currentPage?.url} keyed>
27
+ <Container as="aside" size="sm" class="hidden xl:block w-64 shrink-0 self-start px-0 sticky top-14 z-10 h-fit max-h-[calc(100vh-3.5rem)] overflow-y-auto bg-background">
28
+ <div class="flex flex-col gap-5">
29
+ <DocsTableOfContents items={props.toc} class="max-h-none"/>
30
+ <Show when={props.sidebarPromo}>
31
+ {(promo) => <SidebarPromo promo={promo()}/>}
32
+ </Show>
33
+ </div>
34
+ </Container>
35
+ </Show>
36
+ </Container>);
@@ -0,0 +1,15 @@
1
+ import { type Accessor, type Component } from "solid-js";
2
+ import type { DocsAiProvider, DocsPageAction } from "../../../types.js";
3
+ export interface PageActionsProps {
4
+ sourceUrl?: string;
5
+ pageActions: readonly DocsPageAction[];
6
+ aiProviders: readonly DocsAiProvider[];
7
+ copyPageEnabled: boolean;
8
+ copyMarkdownEnabled: boolean;
9
+ pageUrl?: string;
10
+ pageTitle?: string;
11
+ markdown: Accessor<string>;
12
+ onCopyPage: () => void;
13
+ onCopyMarkdown: () => void;
14
+ }
15
+ export declare const PageActions: Component<PageActionsProps>;
@@ -0,0 +1,60 @@
1
+ import { For, Show } from "solid-js";
2
+ import { ChevronDown, Copy, ExternalLink, FileText } from "lucide-solid";
3
+ import { Button, buttonVariants } from "@/components/ui/button";
4
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu";
5
+ import { cn } from "@/lib/cn";
6
+ import { resolvePageActionUrl } from "../../../client/page-actions.js";
7
+ import { useSiteLocale } from "../../../plugins/i18n/runtime.jsx";
8
+ export const PageActions = (props) => {
9
+ const siteLocale = useSiteLocale();
10
+ const hasCopyActions = () => props.copyPageEnabled || props.copyMarkdownEnabled || props.aiProviders.length > 0;
11
+ const providerUrl = (provider) => resolvePageActionUrl(provider.url, {
12
+ url: typeof window !== "undefined" ? window.location.href : props.pageUrl || "",
13
+ content: props.markdown(),
14
+ title: props.pageTitle,
15
+ prompt: provider.prompt,
16
+ });
17
+ return (<div class="flex items-center gap-2">
18
+ <Show when={props.sourceUrl}>
19
+ {(url) => (<a href={url()} target="_blank" rel="noreferrer" class={cn(buttonVariants({ variant: "secondary", size: "sm" }), "shrink-0")}>
20
+ {siteLocale.t("actions.viewSource")}
21
+ </a>)}
22
+ </Show>
23
+ <For each={props.pageActions}>
24
+ {(action) => (<a href={action.href} target={action.external ? "_blank" : undefined} rel={action.external ? "noreferrer" : undefined} class={cn(buttonVariants({ variant: "secondary", size: "sm" }), "shrink-0")}>
25
+ {action.label}
26
+ </a>)}
27
+ </For>
28
+ <Show when={hasCopyActions()}>
29
+ <DropdownMenu placement="bottom-end">
30
+ <DropdownMenuTrigger as={Button} variant="secondary" size="sm" class="shrink-0 gap-1" aria-label={siteLocale.t("actions.copyDocumentationPage")}>
31
+ <Copy class="size-3.5"/>
32
+ <span class="hidden sm:inline">{siteLocale.t("actions.copyPage")}</span>
33
+ <ChevronDown class="size-3.5"/>
34
+ </DropdownMenuTrigger>
35
+ <DropdownMenuContent>
36
+ <Show when={props.copyPageEnabled}>
37
+ <DropdownMenuItem onClick={props.onCopyPage}>
38
+ <FileText class="mr-2 size-4"/>
39
+ {siteLocale.t("actions.copyPage")}
40
+ </DropdownMenuItem>
41
+ </Show>
42
+ <Show when={props.copyMarkdownEnabled}>
43
+ <DropdownMenuItem onClick={props.onCopyMarkdown}>
44
+ <Copy class="mr-2 size-4"/>
45
+ {siteLocale.t("actions.copyAsMarkdown")}
46
+ </DropdownMenuItem>
47
+ </Show>
48
+ <Show when={props.aiProviders.length > 0}>
49
+ <For each={props.aiProviders}>
50
+ {(provider) => (<DropdownMenuItem as="a" href={providerUrl(provider)} target="_blank" rel="noreferrer">
51
+ <ExternalLink class="mr-2 size-4"/>
52
+ {siteLocale.t("actions.openInProvider", { provider: provider.name })}
53
+ </DropdownMenuItem>)}
54
+ </For>
55
+ </Show>
56
+ </DropdownMenuContent>
57
+ </DropdownMenu>
58
+ </Show>
59
+ </div>);
60
+ };
@@ -0,0 +1,7 @@
1
+ import type { Component } from "solid-js";
2
+ import { type PageActionsProps } from "./page-actions.jsx";
3
+ export interface PageHeaderProps extends PageActionsProps {
4
+ title: string;
5
+ description?: string;
6
+ }
7
+ export declare const PageHeader: Component<PageHeaderProps>;
@@ -0,0 +1,3 @@
1
+ import { SectionHeading } from "@/components/ui/section-heading";
2
+ import { PageActions } from "./page-actions.jsx";
3
+ export const PageHeader = (props) => (<SectionHeading variant="page" title={props.title} description={props.description} class="mb-8" actions={<PageActions sourceUrl={props.sourceUrl} pageActions={props.pageActions} aiProviders={props.aiProviders} copyPageEnabled={props.copyPageEnabled} copyMarkdownEnabled={props.copyMarkdownEnabled} pageUrl={props.pageUrl} pageTitle={props.pageTitle} markdown={props.markdown} onCopyPage={props.onCopyPage} onCopyMarkdown={props.onCopyMarkdown}/>}/>);
@@ -0,0 +1,6 @@
1
+ import type { Component } from "solid-js";
2
+ export interface SidebarFooterProps {
3
+ brandText: string;
4
+ footerText?: string;
5
+ }
6
+ export declare const SidebarFooter: Component<SidebarFooterProps>;
@@ -0,0 +1,12 @@
1
+ import { SidebarFooter as UiSidebarFooter, SidebarMenuButton } from "@/components/ui/sidebar";
2
+ export const SidebarFooter = (props) => (<UiSidebarFooter class="p-2">
3
+ <SidebarMenuButton size="lg" class="w-full justify-start">
4
+ <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-primary/15 text-xs font-bold text-primary">
5
+ N
6
+ </div>
7
+ <div class="flex min-w-0 flex-col gap-0.5 leading-none group-data-[collapsible=icon]:hidden">
8
+ <span class="truncate text-xs font-semibold">{props.brandText}</span>
9
+ <span class="truncate text-[10px] text-muted-foreground">{props.footerText}</span>
10
+ </div>
11
+ </SidebarMenuButton>
12
+ </UiSidebarFooter>);
@@ -0,0 +1,8 @@
1
+ import { type Component } from "solid-js";
2
+ import type { DocsConfig } from "../../../types.js";
3
+ export interface SidebarHeaderProps {
4
+ logo?: DocsConfig["logo"];
5
+ brandText: string;
6
+ subtitle?: string;
7
+ }
8
+ export declare const SidebarHeader: Component<SidebarHeaderProps>;
@@ -0,0 +1,17 @@
1
+ import { Show } from "solid-js";
2
+ import { Logo } from "@/components/ui/logo";
3
+ import { cn } from "@/lib/cn";
4
+ import { SidebarHeader as UiSidebarHeader, SidebarMenuButton } from "@/components/ui/sidebar";
5
+ export const SidebarHeader = (props) => (<UiSidebarHeader class="h-14 box-border p-3 group-data-[collapsible=icon]:p-2">
6
+ <SidebarMenuButton href={props.logo?.href || "/"} class={cn("h-8 w-full justify-between group-data-[collapsible=icon]:h-10")}>
7
+ <div class="flex items-center gap-2.5 overflow-hidden">
8
+ <Show when={props.logo?.image} fallback={<Logo class="h-7 w-auto"/>}>
9
+ {(image) => <img src={image()} alt={props.brandText} class="size-7 shrink-0 rounded-md object-contain"/>}
10
+ </Show>
11
+ <div class="flex min-w-0 flex-col gap-0.5 leading-none group-data-[collapsible=icon]:hidden">
12
+ <span class="truncate text-xs font-bold">{props.brandText}</span>
13
+ <span class="truncate text-[10px] text-muted-foreground">{props.subtitle}</span>
14
+ </div>
15
+ </div>
16
+ </SidebarMenuButton>
17
+ </UiSidebarHeader>);
@@ -0,0 +1,7 @@
1
+ import { type Component } from "solid-js";
2
+ import type { NavItem } from "../../../types.js";
3
+ export interface SidebarMobileNavProps {
4
+ items?: NavItem[];
5
+ onNavigate: () => void;
6
+ }
7
+ export declare const SidebarMobileNav: Component<SidebarMobileNavProps>;
@@ -0,0 +1,17 @@
1
+ import { For } from "solid-js";
2
+ import { SidebarMenu, SidebarMenuButton, SidebarMenuItem } from "@/components/ui/sidebar";
3
+ import { useSiteLocale } from "../../../plugins/i18n/runtime.jsx";
4
+ export const SidebarMobileNav = (props) => {
5
+ const siteLocale = useSiteLocale();
6
+ return (<nav aria-label={siteLocale.t("navigation.primary")} class="border-b border-border/60 px-2 py-2 md:hidden">
7
+ <SidebarMenu>
8
+ <For each={props.items}>
9
+ {(item) => (<SidebarMenuItem>
10
+ <SidebarMenuButton href={item.href} onClick={props.onNavigate} class="w-full justify-start text-sm font-normal">
11
+ {item.title}
12
+ </SidebarMenuButton>
13
+ </SidebarMenuItem>)}
14
+ </For>
15
+ </SidebarMenu>
16
+ </nav>);
17
+ };
@@ -0,0 +1,8 @@
1
+ import type { DocsNavigationConfig } from "../../../types.js";
2
+ import type { Component } from "solid-js";
3
+ type SidebarPromoData = NonNullable<NonNullable<DocsNavigationConfig["sidebar"]>["promo"]>;
4
+ export interface SidebarPromoProps {
5
+ promo: SidebarPromoData;
6
+ }
7
+ export declare const SidebarPromo: Component<SidebarPromoProps>;
8
+ export {};
@@ -0,0 +1,20 @@
1
+ import { ExternalLink } from "lucide-solid";
2
+ import { Card, CardContent, CardDescription, CardTitle } from "@/components/ui/card";
3
+ import { buttonVariants } from "@/components/ui/button";
4
+ import { cn } from "@/lib/cn";
5
+ import { useSiteLocale } from "../../../plugins/i18n/runtime.jsx";
6
+ export const SidebarPromo = (props) => {
7
+ const siteLocale = useSiteLocale();
8
+ return (<Card class="border-primary/30 bg-primary/5 shadow-none">
9
+ <CardContent class="p-4">
10
+ <CardTitle class="text-sm">{props.promo.title}</CardTitle>
11
+ <CardDescription class="mt-2 text-xs leading-relaxed">
12
+ {props.promo.description}
13
+ </CardDescription>
14
+ <a href={props.promo.href} target="_blank" rel="noreferrer" class={cn(buttonVariants({ variant: "outline", size: "sm" }), "mt-4 h-8 w-full gap-1.5 text-xs")}>
15
+ {props.promo.cta || siteLocale.t("actions.learnMore")}
16
+ <ExternalLink class="size-3" aria-hidden="true"/>
17
+ </a>
18
+ </CardContent>
19
+ </Card>);
20
+ };
@@ -6,17 +6,20 @@ import { BreadcrumbItem } from "@/components/ui/breadcrumb";
6
6
  import { BreadcrumbLink } from "@/components/ui/breadcrumb";
7
7
  import { BreadcrumbSeparator } from "@/components/ui/breadcrumb";
8
8
  import { BreadcrumbPage } from "@/components/ui/breadcrumb";
9
+ import { useSiteLocale } from "../../../plugins/i18n/runtime.jsx";
9
10
  export const DocsBreadcrumbs = (props) => {
10
11
  const [local, rest] = splitProps(props, ["items", "class"]);
12
+ const siteLocale = useSiteLocale();
11
13
  return (<Breadcrumb class={local.class} {...rest}>
12
14
  <BreadcrumbList>
13
15
  <For each={local.items}>
14
16
  {(item, index) => {
15
17
  const isLast = () => index() === local.items.length - 1;
18
+ const title = () => item.href === "/" ? siteLocale.t("navigation.documentation") : item.title;
16
19
  return (<>
17
20
  <BreadcrumbItem>
18
- <Show when={!isLast() && item.href} fallback={<BreadcrumbPage>{item.title}</BreadcrumbPage>}>
19
- <BreadcrumbLink href={item.href}>{item.title}</BreadcrumbLink>
21
+ <Show when={!isLast() && item.href} fallback={<BreadcrumbPage>{title()}</BreadcrumbPage>}>
22
+ <BreadcrumbLink href={item.href}>{title()}</BreadcrumbLink>
20
23
  </Show>
21
24
  </BreadcrumbItem>
22
25
  <Show when={!isLast()}>
@@ -1,9 +1,11 @@
1
1
  // packages/docs/src/themes/default/content/table-of-contents.tsx
2
2
  import { createSignal, onMount, Show, splitProps } from "solid-js";
3
3
  import { TableOfContents as CoreTableOfContents } from "@/components/ui/table-of-contents";
4
+ import { useSiteLocale } from "../../../plugins/i18n/runtime.jsx";
4
5
  export const DocsTableOfContents = (props) => {
5
6
  const [local, rest] = splitProps(props, ["items", "title", "class"]);
6
7
  const [ready, setReady] = createSignal(false);
8
+ const siteLocale = useSiteLocale();
7
9
  onMount(() => {
8
10
  if (typeof window === "undefined") {
9
11
  setReady(true);
@@ -13,6 +15,6 @@ export const DocsTableOfContents = (props) => {
13
15
  return () => window.cancelAnimationFrame(frame);
14
16
  });
15
17
  return (<Show when={ready()}>
16
- <CoreTableOfContents items={local.items} title={local.title ?? "On this page"} class={local.class} {...rest}/>
18
+ <CoreTableOfContents items={local.items} title={local.title ?? siteLocale.t("tableOfContents.title")} class={local.class} {...rest}/>
17
19
  </Show>);
18
20
  };
@@ -0,0 +1,6 @@
1
+ import type { Accessor } from "solid-js";
2
+ export declare function createPageCopy(sourceContent: Accessor<string | undefined>): {
3
+ markdown: () => string;
4
+ copyPage: () => Promise<void>;
5
+ copyMarkdown: () => Promise<void>;
6
+ };
@@ -0,0 +1,26 @@
1
+ import { createClipboard } from "@/hooks/create-clipboard";
2
+ import { pageToMarkdown, pageToText, sourceToMarkdown } from "../../../client/page-actions.js";
3
+ function pageElement() {
4
+ if (typeof document === "undefined")
5
+ return null;
6
+ return document.querySelector("main article [data-docs-page-content]");
7
+ }
8
+ export function createPageCopy(sourceContent) {
9
+ const clipboard = createClipboard();
10
+ const markdown = () => {
11
+ const source = sourceContent();
12
+ const page = pageElement();
13
+ return source ? sourceToMarkdown(source) : page ? pageToMarkdown(page) : "";
14
+ };
15
+ const copyPage = async () => {
16
+ const page = pageElement();
17
+ if (page)
18
+ await clipboard.copy(pageToText(page));
19
+ };
20
+ const copyMarkdown = async () => {
21
+ const content = markdown();
22
+ if (content)
23
+ await clipboard.copy(content);
24
+ };
25
+ return { markdown, copyPage, copyMarkdown };
26
+ }