@fumadocs/base-ui 16.6.16 → 16.7.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/css/generated/docs.css +64 -32
- package/css/generated/flux.css +36 -32
- package/css/generated/home.css +39 -55
- package/css/generated/notebook.css +58 -31
- package/css/generated/shared.css +41 -24
- package/dist/components/accordion.d.ts +1 -2
- package/dist/components/accordion.js +0 -2
- package/dist/components/banner.d.ts +1 -2
- package/dist/components/banner.js +0 -2
- package/dist/components/callout.d.ts +1 -2
- package/dist/components/callout.js +0 -2
- package/dist/components/card.d.ts +1 -2
- package/dist/components/card.js +0 -2
- package/dist/components/codeblock.d.ts +1 -2
- package/dist/components/codeblock.js +0 -2
- package/dist/components/codeblock.rsc.d.ts +1 -2
- package/dist/components/codeblock.rsc.js +9 -10
- package/dist/components/dialog/search-algolia.d.ts +1 -2
- package/dist/components/dialog/search-algolia.js +0 -2
- package/dist/components/dialog/search-default.d.ts +1 -2
- package/dist/components/dialog/search-default.js +0 -2
- package/dist/components/dialog/search-orama.d.ts +1 -2
- package/dist/components/dialog/search-orama.js +0 -2
- package/dist/components/dialog/search.d.ts +1 -2
- package/dist/components/dialog/search.js +0 -2
- package/dist/components/dynamic-codeblock.core.d.ts +7 -5
- package/dist/components/dynamic-codeblock.core.js +16 -29
- package/dist/components/dynamic-codeblock.d.ts +5 -3
- package/dist/components/dynamic-codeblock.js +7 -10
- package/dist/components/files.d.ts +1 -2
- package/dist/components/files.js +0 -2
- package/dist/components/github-info.d.ts +22 -9
- package/dist/components/github-info.js +33 -27
- package/dist/components/heading.d.ts +1 -2
- package/dist/components/heading.js +0 -2
- package/dist/components/image-zoom.d.ts +1 -2
- package/dist/components/image-zoom.js +0 -2
- package/dist/components/inline-toc.d.ts +1 -2
- package/dist/components/inline-toc.js +0 -2
- package/dist/components/sidebar/base.d.ts +1 -2
- package/dist/components/sidebar/base.js +0 -2
- package/dist/components/sidebar/link-item.d.ts +2 -3
- package/dist/components/sidebar/link-item.js +3 -4
- package/dist/components/sidebar/page-tree.d.ts +1 -2
- package/dist/components/sidebar/page-tree.js +0 -2
- package/dist/components/sidebar/tabs/dropdown.d.ts +4 -7
- package/dist/components/sidebar/tabs/dropdown.js +2 -7
- package/dist/components/sidebar/tabs/index.d.ts +3 -17
- package/dist/components/sidebar/tabs/index.js +0 -2
- package/dist/components/steps.d.ts +1 -2
- package/dist/components/steps.js +0 -2
- package/dist/components/tabs.d.ts +1 -2
- package/dist/components/tabs.js +0 -2
- package/dist/components/toc/clerk.d.ts +1 -2
- package/dist/components/toc/clerk.js +0 -2
- package/dist/components/toc/default.d.ts +1 -2
- package/dist/components/toc/default.js +0 -2
- package/dist/components/toc/index.d.ts +3 -3
- package/dist/components/toc/index.js +0 -2
- package/dist/components/type-table.d.ts +1 -2
- package/dist/components/type-table.js +0 -2
- package/dist/components/ui/accordion.d.ts +1 -2
- package/dist/components/ui/accordion.js +0 -2
- package/dist/components/ui/button.d.ts +1 -2
- package/dist/components/ui/button.js +0 -2
- package/dist/components/ui/collapsible.d.ts +1 -2
- package/dist/components/ui/collapsible.js +0 -2
- package/dist/components/ui/navigation-menu.d.ts +5 -3
- package/dist/components/ui/navigation-menu.js +13 -4
- package/dist/components/ui/popover.d.ts +1 -2
- package/dist/components/ui/popover.js +0 -2
- package/dist/components/ui/scroll-area.d.ts +1 -2
- package/dist/components/ui/scroll-area.js +0 -2
- package/dist/components/ui/tabs.d.ts +1 -2
- package/dist/components/ui/tabs.js +0 -2
- package/dist/contexts/i18n.d.ts +7 -5
- package/dist/contexts/i18n.js +2 -5
- package/dist/contexts/search.d.ts +1 -2
- package/dist/contexts/search.js +0 -2
- package/dist/contexts/tree.d.ts +1 -2
- package/dist/contexts/tree.js +0 -2
- package/dist/i18n.d.ts +11 -8
- package/dist/i18n.js +2 -4
- package/dist/layouts/docs/client.d.ts +28 -30
- package/dist/layouts/docs/client.js +66 -42
- package/dist/layouts/docs/index.d.ts +19 -33
- package/dist/layouts/docs/index.js +16 -171
- package/dist/layouts/docs/page/client.d.ts +87 -37
- package/dist/layouts/docs/page/client.js +76 -191
- package/dist/layouts/docs/page/index.d.ts +5 -82
- package/dist/layouts/docs/page/index.js +9 -51
- package/dist/layouts/docs/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/docs/page/slots/breadcrumb.js +42 -0
- package/dist/layouts/docs/page/slots/container.d.ts +7 -0
- package/dist/layouts/docs/page/slots/container.js +16 -0
- package/dist/layouts/docs/page/slots/footer.d.ts +23 -0
- package/dist/layouts/docs/page/slots/footer.js +55 -0
- package/dist/layouts/docs/page/slots/toc-popover.d.ts +31 -0
- package/dist/layouts/docs/page/slots/toc-popover.js +141 -0
- package/dist/layouts/docs/page/slots/toc.d.ts +27 -0
- package/dist/layouts/docs/page/slots/toc.js +28 -0
- package/dist/layouts/docs/slots/container.d.ts +7 -0
- package/dist/layouts/docs/slots/container.js +28 -0
- package/dist/layouts/docs/slots/header.d.ts +8 -0
- package/dist/layouts/docs/slots/header.js +37 -0
- package/dist/layouts/docs/slots/sidebar.d.ts +30 -0
- package/dist/layouts/docs/slots/sidebar.js +329 -0
- package/dist/layouts/flux/index.d.ts +34 -38
- package/dist/layouts/flux/index.js +71 -95
- package/dist/layouts/flux/page/client.d.ts +72 -35
- package/dist/layouts/flux/page/client.js +60 -219
- package/dist/layouts/flux/page/index.d.ts +6 -75
- package/dist/layouts/flux/page/index.js +5 -30
- package/dist/layouts/flux/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/flux/page/slots/breadcrumb.js +43 -0
- package/dist/layouts/flux/page/slots/container.d.ts +7 -0
- package/dist/layouts/flux/page/slots/container.js +16 -0
- package/dist/layouts/flux/page/slots/footer.d.ts +23 -0
- package/dist/layouts/flux/page/slots/footer.js +55 -0
- package/dist/layouts/flux/page/slots/toc.d.ts +31 -0
- package/dist/layouts/flux/page/slots/toc.js +169 -0
- package/dist/layouts/flux/slots/container.d.ts +7 -0
- package/dist/layouts/flux/slots/container.js +12 -0
- package/dist/layouts/flux/slots/sidebar.d.ts +23 -0
- package/dist/layouts/flux/{sidebar.js → slots/sidebar.js} +68 -25
- package/dist/layouts/flux/slots/tab-dropdown.d.ts +17 -0
- package/dist/layouts/flux/{tab-dropdown.js → slots/tab-dropdown.js} +11 -20
- package/dist/layouts/home/index.d.ts +24 -7
- package/dist/layouts/home/index.js +36 -18
- package/dist/layouts/home/navbar.d.ts +3 -10
- package/dist/layouts/home/navbar.js +17 -14
- package/dist/layouts/home/not-found.d.ts +1 -2
- package/dist/layouts/home/not-found.js +0 -2
- package/dist/layouts/home/slots/container.d.ts +7 -0
- package/dist/layouts/home/slots/container.js +12 -0
- package/dist/layouts/home/slots/header.d.ts +12 -0
- package/dist/layouts/home/slots/header.js +232 -0
- package/dist/layouts/notebook/client.d.ts +31 -43
- package/dist/layouts/notebook/client.js +54 -144
- package/dist/layouts/notebook/index.d.ts +25 -24
- package/dist/layouts/notebook/index.js +16 -211
- package/dist/layouts/notebook/page/client.d.ts +87 -37
- package/dist/layouts/notebook/page/client.js +76 -191
- package/dist/layouts/notebook/page/index.d.ts +6 -82
- package/dist/layouts/notebook/page/index.js +12 -51
- package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/notebook/page/slots/breadcrumb.js +43 -0
- package/dist/layouts/notebook/page/slots/container.d.ts +7 -0
- package/dist/layouts/notebook/page/slots/container.js +16 -0
- package/dist/layouts/notebook/page/slots/footer.d.ts +23 -0
- package/dist/layouts/notebook/page/slots/footer.js +55 -0
- package/dist/layouts/notebook/page/slots/toc-popover.d.ts +31 -0
- package/dist/layouts/notebook/page/slots/toc-popover.js +141 -0
- package/dist/layouts/notebook/page/slots/toc.d.ts +27 -0
- package/dist/layouts/notebook/page/slots/toc.js +28 -0
- package/dist/layouts/notebook/slots/container.d.ts +7 -0
- package/dist/layouts/notebook/slots/container.js +30 -0
- package/dist/layouts/notebook/slots/header.d.ts +8 -0
- package/dist/layouts/notebook/slots/header.js +194 -0
- package/dist/layouts/notebook/slots/sidebar.d.ts +40 -0
- package/dist/layouts/notebook/slots/sidebar.js +307 -0
- package/dist/layouts/shared/client.d.ts +45 -0
- package/dist/layouts/shared/client.js +84 -0
- package/dist/layouts/shared/index.d.ts +134 -32
- package/dist/layouts/shared/index.js +49 -16
- package/dist/layouts/shared/page-actions.d.ts +1 -2
- package/dist/layouts/shared/page-actions.js +10 -6
- package/dist/layouts/shared/slots/language-select.d.ts +10 -0
- package/dist/layouts/shared/{language-toggle.js → slots/language-select.js} +10 -12
- package/dist/layouts/shared/slots/search-trigger.d.ts +23 -0
- package/dist/layouts/shared/{search-toggle.js → slots/search-trigger.js} +9 -11
- package/dist/layouts/shared/slots/theme-switch.d.ts +14 -0
- package/dist/layouts/shared/{theme-toggle.js → slots/theme-switch.js} +4 -6
- package/dist/mdx.d.ts +1 -2
- package/dist/mdx.js +0 -2
- package/dist/mdx.server.d.ts +1 -2
- package/dist/mdx.server.js +0 -2
- package/dist/og/takumi.d.ts +1 -2
- package/dist/og/takumi.js +0 -2
- package/dist/og.d.ts +1 -2
- package/dist/og.js +0 -2
- package/dist/page.d.ts +4 -4
- package/dist/page.js +5 -7
- package/dist/provider/base.d.ts +1 -2
- package/dist/provider/base.js +1 -3
- package/dist/provider/next.d.ts +1 -2
- package/dist/provider/next.js +0 -2
- package/dist/provider/react-router.d.ts +1 -2
- package/dist/provider/react-router.js +0 -2
- package/dist/provider/tanstack.d.ts +1 -2
- package/dist/provider/tanstack.js +0 -2
- package/dist/provider/waku.d.ts +1 -2
- package/dist/provider/waku.js +0 -2
- package/dist/style.css +83 -89
- package/dist/utils/merge-refs.js +0 -2
- package/dist/utils/urls.js +0 -2
- package/dist/utils/use-copy-button.d.ts +1 -2
- package/dist/utils/use-copy-button.js +0 -2
- package/dist/utils/use-footer-items.d.ts +1 -2
- package/dist/utils/use-footer-items.js +0 -2
- package/dist/utils/use-is-scroll-top.d.ts +1 -2
- package/dist/utils/use-is-scroll-top.js +0 -2
- package/package.json +107 -86
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js.map +0 -1
- package/dist/components/banner.d.ts.map +0 -1
- package/dist/components/banner.js.map +0 -1
- package/dist/components/callout.d.ts.map +0 -1
- package/dist/components/callout.js.map +0 -1
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js.map +0 -1
- package/dist/components/codeblock.d.ts.map +0 -1
- package/dist/components/codeblock.js.map +0 -1
- package/dist/components/codeblock.rsc.d.ts.map +0 -1
- package/dist/components/codeblock.rsc.js.map +0 -1
- package/dist/components/dialog/search-algolia.d.ts.map +0 -1
- package/dist/components/dialog/search-algolia.js.map +0 -1
- package/dist/components/dialog/search-default.d.ts.map +0 -1
- package/dist/components/dialog/search-default.js.map +0 -1
- package/dist/components/dialog/search-orama.d.ts.map +0 -1
- package/dist/components/dialog/search-orama.js.map +0 -1
- package/dist/components/dialog/search.d.ts.map +0 -1
- package/dist/components/dialog/search.js.map +0 -1
- package/dist/components/dynamic-codeblock.core.d.ts.map +0 -1
- package/dist/components/dynamic-codeblock.core.js.map +0 -1
- package/dist/components/dynamic-codeblock.d.ts.map +0 -1
- package/dist/components/dynamic-codeblock.js.map +0 -1
- package/dist/components/files.d.ts.map +0 -1
- package/dist/components/files.js.map +0 -1
- package/dist/components/github-info.d.ts.map +0 -1
- package/dist/components/github-info.js.map +0 -1
- package/dist/components/heading.d.ts.map +0 -1
- package/dist/components/heading.js.map +0 -1
- package/dist/components/image-zoom.d.ts.map +0 -1
- package/dist/components/image-zoom.js.map +0 -1
- package/dist/components/inline-toc.d.ts.map +0 -1
- package/dist/components/inline-toc.js.map +0 -1
- package/dist/components/sidebar/base.d.ts.map +0 -1
- package/dist/components/sidebar/base.js.map +0 -1
- package/dist/components/sidebar/link-item.d.ts.map +0 -1
- package/dist/components/sidebar/link-item.js.map +0 -1
- package/dist/components/sidebar/page-tree.d.ts.map +0 -1
- package/dist/components/sidebar/page-tree.js.map +0 -1
- package/dist/components/sidebar/tabs/dropdown.d.ts.map +0 -1
- package/dist/components/sidebar/tabs/dropdown.js.map +0 -1
- package/dist/components/sidebar/tabs/index.d.ts.map +0 -1
- package/dist/components/sidebar/tabs/index.js.map +0 -1
- package/dist/components/steps.d.ts.map +0 -1
- package/dist/components/steps.js.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js.map +0 -1
- package/dist/components/toc/clerk.d.ts.map +0 -1
- package/dist/components/toc/clerk.js.map +0 -1
- package/dist/components/toc/default.d.ts.map +0 -1
- package/dist/components/toc/default.js.map +0 -1
- package/dist/components/toc/index.d.ts.map +0 -1
- package/dist/components/toc/index.js.map +0 -1
- package/dist/components/type-table.d.ts.map +0 -1
- package/dist/components/type-table.js.map +0 -1
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/popover.d.ts.map +0 -1
- package/dist/components/ui/popover.js.map +0 -1
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js.map +0 -1
- package/dist/contexts/i18n.d.ts.map +0 -1
- package/dist/contexts/i18n.js.map +0 -1
- package/dist/contexts/search.d.ts.map +0 -1
- package/dist/contexts/search.js.map +0 -1
- package/dist/contexts/tree.d.ts.map +0 -1
- package/dist/contexts/tree.js.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.js.map +0 -1
- package/dist/layouts/docs/client.d.ts.map +0 -1
- package/dist/layouts/docs/client.js.map +0 -1
- package/dist/layouts/docs/index.d.ts.map +0 -1
- package/dist/layouts/docs/index.js.map +0 -1
- package/dist/layouts/docs/page/client.d.ts.map +0 -1
- package/dist/layouts/docs/page/client.js.map +0 -1
- package/dist/layouts/docs/page/index.d.ts.map +0 -1
- package/dist/layouts/docs/page/index.js.map +0 -1
- package/dist/layouts/docs/sidebar.d.ts +0 -63
- package/dist/layouts/docs/sidebar.d.ts.map +0 -1
- package/dist/layouts/docs/sidebar.js +0 -160
- package/dist/layouts/docs/sidebar.js.map +0 -1
- package/dist/layouts/flux/index.d.ts.map +0 -1
- package/dist/layouts/flux/index.js.map +0 -1
- package/dist/layouts/flux/page/client.d.ts.map +0 -1
- package/dist/layouts/flux/page/client.js.map +0 -1
- package/dist/layouts/flux/page/index.d.ts.map +0 -1
- package/dist/layouts/flux/page/index.js.map +0 -1
- package/dist/layouts/flux/sidebar.d.ts +0 -58
- package/dist/layouts/flux/sidebar.d.ts.map +0 -1
- package/dist/layouts/flux/sidebar.js.map +0 -1
- package/dist/layouts/flux/tab-dropdown.d.ts +0 -21
- package/dist/layouts/flux/tab-dropdown.d.ts.map +0 -1
- package/dist/layouts/flux/tab-dropdown.js.map +0 -1
- package/dist/layouts/home/client.d.ts +0 -19
- package/dist/layouts/home/client.d.ts.map +0 -1
- package/dist/layouts/home/client.js +0 -262
- package/dist/layouts/home/client.js.map +0 -1
- package/dist/layouts/home/index.d.ts.map +0 -1
- package/dist/layouts/home/index.js.map +0 -1
- package/dist/layouts/home/navbar.d.ts.map +0 -1
- package/dist/layouts/home/navbar.js.map +0 -1
- package/dist/layouts/home/not-found.d.ts.map +0 -1
- package/dist/layouts/home/not-found.js.map +0 -1
- package/dist/layouts/notebook/client.d.ts.map +0 -1
- package/dist/layouts/notebook/client.js.map +0 -1
- package/dist/layouts/notebook/index.d.ts.map +0 -1
- package/dist/layouts/notebook/index.js.map +0 -1
- package/dist/layouts/notebook/page/client.d.ts.map +0 -1
- package/dist/layouts/notebook/page/client.js.map +0 -1
- package/dist/layouts/notebook/page/index.d.ts.map +0 -1
- package/dist/layouts/notebook/page/index.js.map +0 -1
- package/dist/layouts/notebook/sidebar.d.ts +0 -59
- package/dist/layouts/notebook/sidebar.d.ts.map +0 -1
- package/dist/layouts/notebook/sidebar.js +0 -131
- package/dist/layouts/notebook/sidebar.js.map +0 -1
- package/dist/layouts/shared/index.d.ts.map +0 -1
- package/dist/layouts/shared/index.js.map +0 -1
- package/dist/layouts/shared/language-toggle.d.ts +0 -10
- package/dist/layouts/shared/language-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/language-toggle.js.map +0 -1
- package/dist/layouts/shared/page-actions.d.ts.map +0 -1
- package/dist/layouts/shared/page-actions.js.map +0 -1
- package/dist/layouts/shared/search-toggle.d.ts +0 -23
- package/dist/layouts/shared/search-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/search-toggle.js.map +0 -1
- package/dist/layouts/shared/theme-toggle.d.ts +0 -14
- package/dist/layouts/shared/theme-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/theme-toggle.js.map +0 -1
- package/dist/mdx.d.ts.map +0 -1
- package/dist/mdx.js.map +0 -1
- package/dist/mdx.server.d.ts.map +0 -1
- package/dist/mdx.server.js.map +0 -1
- package/dist/og/takumi.d.ts.map +0 -1
- package/dist/og/takumi.js.map +0 -1
- package/dist/og.d.ts.map +0 -1
- package/dist/og.js.map +0 -1
- package/dist/page.d.ts.map +0 -1
- package/dist/page.js.map +0 -1
- package/dist/provider/base.d.ts.map +0 -1
- package/dist/provider/base.js.map +0 -1
- package/dist/provider/next.d.ts.map +0 -1
- package/dist/provider/next.js.map +0 -1
- package/dist/provider/react-router.d.ts.map +0 -1
- package/dist/provider/react-router.js.map +0 -1
- package/dist/provider/tanstack.d.ts.map +0 -1
- package/dist/provider/tanstack.js.map +0 -1
- package/dist/provider/waku.d.ts.map +0 -1
- package/dist/provider/waku.js.map +0 -1
- package/dist/utils/link-item.d.ts +0 -87
- package/dist/utils/link-item.d.ts.map +0 -1
- package/dist/utils/link-item.js +0 -27
- package/dist/utils/link-item.js.map +0 -1
- package/dist/utils/merge-refs.js.map +0 -1
- package/dist/utils/urls.js.map +0 -1
- package/dist/utils/use-copy-button.d.ts.map +0 -1
- package/dist/utils/use-copy-button.js.map +0 -1
- package/dist/utils/use-footer-items.d.ts.map +0 -1
- package/dist/utils/use-footer-items.js.map +0 -1
- package/dist/utils/use-is-scroll-top.d.ts.map +0 -1
- package/dist/utils/use-is-scroll-top.js.map +0 -1
|
@@ -1,48 +1,98 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TOCProviderProps } from "../../../components/toc/index.js";
|
|
2
|
+
import { TOCProps } from "./slots/toc.js";
|
|
3
|
+
import { TOCPopoverProps } from "./slots/toc-popover.js";
|
|
4
|
+
import { FooterProps } from "./slots/footer.js";
|
|
5
|
+
import { BreadcrumbProps } from "./slots/breadcrumb.js";
|
|
6
|
+
import { ComponentProps, FC, ReactNode } from "react";
|
|
2
7
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import * as PageTree from "fumadocs-core/page-tree";
|
|
8
|
+
import { TOCItemType } from "fumadocs-core/toc";
|
|
5
9
|
|
|
6
10
|
//#region src/layouts/docs/page/client.d.ts
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
interface DocsPageProps extends ComponentProps<'article'> {
|
|
12
|
+
toc?: TOCItemType[];
|
|
13
|
+
/**
|
|
14
|
+
* Extend the page to fill all available space
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue false
|
|
17
|
+
*/
|
|
18
|
+
full?: boolean;
|
|
19
|
+
slots?: DocsPageSlots;
|
|
20
|
+
footer?: FooterOptions;
|
|
21
|
+
breadcrumb?: BreadcrumbOptions;
|
|
22
|
+
tableOfContent?: TableOfContentOptions;
|
|
23
|
+
tableOfContentPopover?: TableOfContentPopoverOptions;
|
|
24
|
+
}
|
|
25
|
+
interface BreadcrumbOptions extends BreadcrumbProps {
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated use `slots.breadcrumb` instead.
|
|
29
|
+
*/
|
|
30
|
+
component?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
interface FooterOptions extends FooterProps {
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated use `slots.footer` instead.
|
|
36
|
+
*/
|
|
37
|
+
component?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
interface TableOfContentOptions extends Pick<TOCProviderProps, 'single'>, TOCProps {
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated use `slots.toc` instead.
|
|
43
|
+
*/
|
|
44
|
+
component?: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
interface TableOfContentPopoverOptions extends TOCPopoverProps {
|
|
47
|
+
enabled?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated use `slots.tocPopover` instead.
|
|
50
|
+
*/
|
|
51
|
+
component?: ReactNode;
|
|
52
|
+
}
|
|
53
|
+
interface DocsPageSlots {
|
|
54
|
+
toc?: FC<TOCProps>;
|
|
55
|
+
container?: FC<ComponentProps<'article'>>;
|
|
56
|
+
tocPopover?: FC<TOCPopoverProps>;
|
|
57
|
+
tocProvider?: FC<TOCProviderProps>;
|
|
58
|
+
footer?: FC<FooterProps>;
|
|
59
|
+
breadcrumb?: FC<BreadcrumbProps>;
|
|
60
|
+
}
|
|
61
|
+
interface PageSlotsProps extends Pick<DocsPageProps, 'full' | 'breadcrumb' | 'footer'> {
|
|
62
|
+
tableOfContent: TOCProps & {
|
|
63
|
+
component?: ReactNode;
|
|
64
|
+
};
|
|
65
|
+
tableOfContentPopover: TOCPopoverProps & {
|
|
66
|
+
component?: ReactNode;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
declare function useDocsPage(): {
|
|
70
|
+
props: PageSlotsProps;
|
|
71
|
+
slots: DocsPageSlots;
|
|
72
|
+
};
|
|
73
|
+
declare function DocsPage({
|
|
74
|
+
tableOfContent: {
|
|
75
|
+
enabled: tocEnabled,
|
|
76
|
+
single,
|
|
77
|
+
...tocProps
|
|
78
|
+
},
|
|
79
|
+
tableOfContentPopover: {
|
|
80
|
+
enabled: tocPopoverEnabled,
|
|
81
|
+
...tocPopoverProps
|
|
82
|
+
},
|
|
83
|
+
footer,
|
|
84
|
+
breadcrumb,
|
|
85
|
+
full,
|
|
86
|
+
toc,
|
|
87
|
+
slots: defaultSlots,
|
|
9
88
|
children,
|
|
10
|
-
...
|
|
11
|
-
}:
|
|
12
|
-
declare function PageTOCPopoverTrigger({
|
|
13
|
-
className,
|
|
14
|
-
...props
|
|
15
|
-
}: ComponentProps<'button'>): react_jsx_runtime0.JSX.Element;
|
|
16
|
-
declare function PageTOCPopoverContent(props: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
89
|
+
...containerProps
|
|
90
|
+
}: DocsPageProps): react_jsx_runtime0.JSX.Element;
|
|
17
91
|
declare function PageLastUpdate({
|
|
18
92
|
date: value,
|
|
19
93
|
...props
|
|
20
94
|
}: Omit<ComponentProps<'p'>, 'children'> & {
|
|
21
95
|
date: Date;
|
|
22
96
|
}): react_jsx_runtime0.JSX.Element;
|
|
23
|
-
type Item = Pick<PageTree.Item, 'name' | 'description' | 'url'>;
|
|
24
|
-
interface FooterProps extends ComponentProps<'div'> {
|
|
25
|
-
/**
|
|
26
|
-
* Items including information for the next and previous page
|
|
27
|
-
*/
|
|
28
|
-
items?: {
|
|
29
|
-
previous?: Item;
|
|
30
|
-
next?: Item;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
declare function PageFooter({
|
|
34
|
-
items,
|
|
35
|
-
children,
|
|
36
|
-
className,
|
|
37
|
-
...props
|
|
38
|
-
}: FooterProps): react_jsx_runtime0.JSX.Element;
|
|
39
|
-
type BreadcrumbProps = BreadcrumbOptions & ComponentProps<'div'>;
|
|
40
|
-
declare function PageBreadcrumb({
|
|
41
|
-
includeRoot,
|
|
42
|
-
includeSeparator,
|
|
43
|
-
includePage,
|
|
44
|
-
...props
|
|
45
|
-
}: BreadcrumbProps): react_jsx_runtime0.JSX.Element | null;
|
|
46
97
|
//#endregion
|
|
47
|
-
export {
|
|
48
|
-
//# sourceMappingURL=client.d.ts.map
|
|
98
|
+
export { DocsPage, DocsPageProps, DocsPageSlots, PageLastUpdate, useDocsPage };
|
|
@@ -1,130 +1,93 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useI18n } from "../../../contexts/i18n.js";
|
|
3
3
|
import { cn } from "../../../utils/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { usePathname } from "fumadocs-core/framework";
|
|
4
|
+
import { TOCProvider } from "../../../components/toc/index.js";
|
|
5
|
+
import { TOC } from "./slots/toc.js";
|
|
6
|
+
import { TOCPopover } from "./slots/toc-popover.js";
|
|
7
|
+
import { Footer } from "./slots/footer.js";
|
|
8
|
+
import { Breadcrumb } from "./slots/breadcrumb.js";
|
|
9
|
+
import { Container } from "./slots/container.js";
|
|
10
|
+
import { createContext, use, useEffect, useState } from "react";
|
|
12
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import Link from "fumadocs-core/link";
|
|
14
|
-
import { ChevronDown, ChevronLeft, ChevronRight } from "lucide-react";
|
|
15
|
-
import { getBreadcrumbItemsFromPath } from "fumadocs-core/breadcrumb";
|
|
16
|
-
import { useActiveAnchor } from "fumadocs-core/toc";
|
|
17
12
|
//#region src/layouts/docs/page/client.tsx
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
const PageContext = createContext(null);
|
|
14
|
+
function useDocsPage() {
|
|
15
|
+
const context = use(PageContext);
|
|
16
|
+
if (!context) throw new Error("Please use page components under <DocsPage /> (`fumadocs-ui/layouts/docs/page`).");
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
function DocsPage({ tableOfContent: { enabled: tocEnabled, single = false, ...tocProps } = {}, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps } = {}, footer = {}, breadcrumb = {}, full = false, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
|
|
20
|
+
tocEnabled ??= Boolean(!full && (toc.length > 0 || tocProps.footer || tocProps.header));
|
|
21
|
+
tocPopoverEnabled ??= Boolean(toc.length > 0 || tocPopoverProps.header || tocPopoverProps.footer);
|
|
22
|
+
const slots = {
|
|
23
|
+
breadcrumb: breadcrumb.enabled !== false ? defaultSlots.breadcrumb ?? InlineBreadcrumb : void 0,
|
|
24
|
+
footer: footer.enabled !== false ? defaultSlots.footer ?? InlineFooter : void 0,
|
|
25
|
+
toc: tocEnabled ? defaultSlots.toc ?? InlineTOC : void 0,
|
|
26
|
+
tocPopover: tocPopoverEnabled ? defaultSlots.tocPopover ?? InlineTOCPopover : void 0,
|
|
27
|
+
tocProvider: defaultSlots.tocProvider ?? TOCProvider,
|
|
28
|
+
container: defaultSlots.container ?? Container
|
|
29
|
+
};
|
|
30
|
+
let content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
31
|
+
slots.tocPopover && /* @__PURE__ */ jsx(slots.tocPopover, {}),
|
|
32
|
+
slots.container && /* @__PURE__ */ jsxs(slots.container, {
|
|
33
|
+
...containerProps,
|
|
34
|
+
children: [
|
|
35
|
+
slots.breadcrumb && /* @__PURE__ */ jsx(slots.breadcrumb, {}),
|
|
36
|
+
children,
|
|
37
|
+
slots.footer && /* @__PURE__ */ jsx(slots.footer, {})
|
|
38
|
+
]
|
|
39
|
+
}),
|
|
40
|
+
slots.toc && /* @__PURE__ */ jsx(slots.toc, {})
|
|
41
|
+
] });
|
|
42
|
+
if (slots.tocProvider) content = /* @__PURE__ */ jsx(slots.tocProvider, {
|
|
43
|
+
single,
|
|
44
|
+
toc: tocEnabled || tocPopoverEnabled ? toc : [],
|
|
45
|
+
children: content
|
|
26
46
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
children:
|
|
39
|
-
open,
|
|
40
|
-
onOpenChange: setOpen,
|
|
41
|
-
"data-toc-popover": "",
|
|
42
|
-
className: cn("sticky top-(--fd-docs-row-2) z-10 [grid-area:toc-popover] h-(--fd-toc-popover-height) xl:hidden max-xl:layout:[--fd-toc-popover-height:--spacing(10)]", className),
|
|
43
|
-
...rest,
|
|
44
|
-
children: /* @__PURE__ */ jsx("header", {
|
|
45
|
-
ref,
|
|
46
|
-
className: cn("border-b backdrop-blur-sm transition-colors", (!isNavTransparent || open) && "bg-fd-background/80", open && "shadow-lg"),
|
|
47
|
-
children
|
|
48
|
-
})
|
|
49
|
-
})
|
|
47
|
+
return /* @__PURE__ */ jsx(PageContext, {
|
|
48
|
+
value: {
|
|
49
|
+
props: {
|
|
50
|
+
full,
|
|
51
|
+
tableOfContent: tocProps,
|
|
52
|
+
tableOfContentPopover: tocPopoverProps,
|
|
53
|
+
footer,
|
|
54
|
+
breadcrumb
|
|
55
|
+
},
|
|
56
|
+
slots
|
|
57
|
+
},
|
|
58
|
+
children: content
|
|
50
59
|
});
|
|
51
60
|
}
|
|
52
|
-
function
|
|
53
|
-
const {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const active = useActiveAnchor();
|
|
57
|
-
const selected = useMemo(() => items.findIndex((item) => active === item.url.slice(1)), [items, active]);
|
|
58
|
-
const path = useTreePath().at(-1);
|
|
59
|
-
const showItem = selected !== -1 && !open;
|
|
60
|
-
return /* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
61
|
-
className: cn("flex w-full h-10 items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6", className),
|
|
62
|
-
"data-toc-popover-trigger": "",
|
|
61
|
+
function InlineBreadcrumb(props) {
|
|
62
|
+
const { component, enabled: _, ...rest } = useDocsPage().props.breadcrumb ?? {};
|
|
63
|
+
if (component) return component;
|
|
64
|
+
return /* @__PURE__ */ jsx(Breadcrumb, {
|
|
63
65
|
...props,
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */ jsx(ProgressCircle, {
|
|
66
|
-
value: (selected + 1) / Math.max(1, items.length),
|
|
67
|
-
max: 1,
|
|
68
|
-
className: cn("shrink-0", open && "text-fd-primary")
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ jsxs("span", {
|
|
71
|
-
className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1",
|
|
72
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
73
|
-
className: cn("truncate transition-all", open && "text-fd-foreground", showItem && "opacity-0 -translate-y-full pointer-events-none"),
|
|
74
|
-
children: path?.name ?? text.toc
|
|
75
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
76
|
-
className: cn("truncate transition-all", !showItem && "opacity-0 translate-y-full pointer-events-none"),
|
|
77
|
-
children: items[selected]?.title
|
|
78
|
-
})]
|
|
79
|
-
}),
|
|
80
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: cn("shrink-0 transition-transform mx-0.5", open && "rotate-180") })
|
|
81
|
-
]
|
|
66
|
+
...rest
|
|
82
67
|
});
|
|
83
68
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
69
|
+
function InlineFooter(props) {
|
|
70
|
+
const { component, enabled: _, ...rest } = useDocsPage().props.footer ?? {};
|
|
71
|
+
if (component) return component;
|
|
72
|
+
return /* @__PURE__ */ jsx(Footer, {
|
|
73
|
+
...props,
|
|
74
|
+
...rest
|
|
75
|
+
});
|
|
88
76
|
}
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
cx: size / 2,
|
|
96
|
-
cy: size / 2,
|
|
97
|
-
r: radius,
|
|
98
|
-
fill: "none",
|
|
99
|
-
strokeWidth
|
|
100
|
-
};
|
|
101
|
-
return /* @__PURE__ */ jsxs("svg", {
|
|
102
|
-
role: "progressbar",
|
|
103
|
-
viewBox: `0 0 ${size} ${size}`,
|
|
104
|
-
"aria-valuenow": normalizedValue,
|
|
105
|
-
"aria-valuemin": min,
|
|
106
|
-
"aria-valuemax": max,
|
|
107
|
-
...restSvgProps,
|
|
108
|
-
children: [/* @__PURE__ */ jsx("circle", {
|
|
109
|
-
...circleProps,
|
|
110
|
-
className: "stroke-current/25"
|
|
111
|
-
}), /* @__PURE__ */ jsx("circle", {
|
|
112
|
-
...circleProps,
|
|
113
|
-
stroke: "currentColor",
|
|
114
|
-
strokeDasharray: circumference,
|
|
115
|
-
strokeDashoffset: circumference - progress,
|
|
116
|
-
strokeLinecap: "round",
|
|
117
|
-
transform: `rotate(-90 ${size / 2} ${size / 2})`,
|
|
118
|
-
className: "transition-all"
|
|
119
|
-
})]
|
|
77
|
+
function InlineTOCPopover(props) {
|
|
78
|
+
const { tableOfContentPopover } = useDocsPage().props;
|
|
79
|
+
if (tableOfContentPopover.component) return tableOfContentPopover.component;
|
|
80
|
+
return /* @__PURE__ */ jsx(TOCPopover, {
|
|
81
|
+
...props,
|
|
82
|
+
...tableOfContentPopover
|
|
120
83
|
});
|
|
121
84
|
}
|
|
122
|
-
function
|
|
123
|
-
|
|
124
|
-
|
|
85
|
+
function InlineTOC(props) {
|
|
86
|
+
const { tableOfContent } = useDocsPage().props;
|
|
87
|
+
if (tableOfContent.component) return tableOfContent.component;
|
|
88
|
+
return /* @__PURE__ */ jsx(TOC, {
|
|
125
89
|
...props,
|
|
126
|
-
|
|
127
|
-
children: /* @__PURE__ */ jsx("div", { children: props.children })
|
|
90
|
+
...tableOfContent
|
|
128
91
|
});
|
|
129
92
|
}
|
|
130
93
|
function PageLastUpdate({ date: value, ...props }) {
|
|
@@ -143,83 +106,5 @@ function PageLastUpdate({ date: value, ...props }) {
|
|
|
143
106
|
]
|
|
144
107
|
});
|
|
145
108
|
}
|
|
146
|
-
function PageFooter({ items, children, className, ...props }) {
|
|
147
|
-
const footerList = useFooterItems();
|
|
148
|
-
const pathname = usePathname();
|
|
149
|
-
const { previous, next } = useMemo(() => {
|
|
150
|
-
if (items) return items;
|
|
151
|
-
const idx = footerList.findIndex((item) => isActive(item.url, pathname));
|
|
152
|
-
if (idx === -1) return {};
|
|
153
|
-
return {
|
|
154
|
-
previous: footerList[idx - 1],
|
|
155
|
-
next: footerList[idx + 1]
|
|
156
|
-
};
|
|
157
|
-
}, [
|
|
158
|
-
footerList,
|
|
159
|
-
items,
|
|
160
|
-
pathname
|
|
161
|
-
]);
|
|
162
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
|
|
163
|
-
className: cn("@container grid gap-4", previous && next ? "grid-cols-2" : "grid-cols-1", className),
|
|
164
|
-
...props,
|
|
165
|
-
children: [previous && /* @__PURE__ */ jsx(FooterItem, {
|
|
166
|
-
item: previous,
|
|
167
|
-
index: 0
|
|
168
|
-
}), next && /* @__PURE__ */ jsx(FooterItem, {
|
|
169
|
-
item: next,
|
|
170
|
-
index: 1
|
|
171
|
-
})]
|
|
172
|
-
}), children] });
|
|
173
|
-
}
|
|
174
|
-
function FooterItem({ item, index }) {
|
|
175
|
-
const { text } = useI18n();
|
|
176
|
-
const Icon = index === 0 ? ChevronLeft : ChevronRight;
|
|
177
|
-
return /* @__PURE__ */ jsxs(Link, {
|
|
178
|
-
href: item.url,
|
|
179
|
-
className: cn("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full", index === 1 && "text-end"),
|
|
180
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
181
|
-
className: cn("inline-flex items-center gap-1.5 font-medium", index === 1 && "flex-row-reverse"),
|
|
182
|
-
children: [/* @__PURE__ */ jsx(Icon, { className: "-mx-1 size-4 shrink-0 rtl:rotate-180" }), /* @__PURE__ */ jsx("p", { children: item.name })]
|
|
183
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
184
|
-
className: "text-fd-muted-foreground truncate",
|
|
185
|
-
children: item.description ?? (index === 0 ? text.previousPage : text.nextPage)
|
|
186
|
-
})]
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
function PageBreadcrumb({ includeRoot, includeSeparator, includePage, ...props }) {
|
|
190
|
-
const path = useTreePath();
|
|
191
|
-
const { root } = useTreeContext();
|
|
192
|
-
const items = useMemo(() => {
|
|
193
|
-
return getBreadcrumbItemsFromPath(root, path, {
|
|
194
|
-
includePage,
|
|
195
|
-
includeSeparator,
|
|
196
|
-
includeRoot
|
|
197
|
-
});
|
|
198
|
-
}, [
|
|
199
|
-
includePage,
|
|
200
|
-
includeRoot,
|
|
201
|
-
includeSeparator,
|
|
202
|
-
path,
|
|
203
|
-
root
|
|
204
|
-
]);
|
|
205
|
-
if (items.length === 0) return null;
|
|
206
|
-
return /* @__PURE__ */ jsx("div", {
|
|
207
|
-
...props,
|
|
208
|
-
className: cn("flex items-center gap-1.5 text-sm text-fd-muted-foreground", props.className),
|
|
209
|
-
children: items.map((item, i) => {
|
|
210
|
-
const className = cn("truncate", i === items.length - 1 && "text-fd-primary font-medium");
|
|
211
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [i !== 0 && /* @__PURE__ */ jsx(ChevronRight, { className: "size-3.5 shrink-0" }), item.url ? /* @__PURE__ */ jsx(Link, {
|
|
212
|
-
href: item.url,
|
|
213
|
-
className: cn(className, "transition-opacity hover:opacity-80"),
|
|
214
|
-
children: item.name
|
|
215
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
216
|
-
className,
|
|
217
|
-
children: item.name
|
|
218
|
-
})] }, i);
|
|
219
|
-
})
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
109
|
//#endregion
|
|
223
|
-
export {
|
|
224
|
-
|
|
225
|
-
//# sourceMappingURL=client.js.map
|
|
110
|
+
export { DocsPage, PageLastUpdate, useDocsPage };
|
|
@@ -1,87 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Footer, FooterProps } from "./slots/footer.js";
|
|
2
|
+
import { Breadcrumb, BreadcrumbProps } from "./slots/breadcrumb.js";
|
|
3
|
+
import { DocsPage, DocsPageProps, DocsPageSlots, PageLastUpdate, useDocsPage } from "./client.js";
|
|
2
4
|
import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
|
|
3
|
-
import { ComponentProps
|
|
5
|
+
import { ComponentProps } from "react";
|
|
4
6
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
-
import { AnchorProviderProps, TOCItemType } from "fumadocs-core/toc";
|
|
6
7
|
|
|
7
8
|
//#region src/layouts/docs/page/index.d.ts
|
|
8
|
-
interface BreadcrumbOptions extends BreadcrumbProps {
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
component: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
interface FooterOptions extends FooterProps {
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
component: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
interface DocsPageProps {
|
|
17
|
-
toc?: TOCItemType[];
|
|
18
|
-
tableOfContent?: Partial<TableOfContentOptions>;
|
|
19
|
-
tableOfContentPopover?: Partial<TableOfContentPopoverOptions>;
|
|
20
|
-
/**
|
|
21
|
-
* Extend the page to fill all available space
|
|
22
|
-
*
|
|
23
|
-
* @defaultValue false
|
|
24
|
-
*/
|
|
25
|
-
full?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Replace or disable breadcrumb
|
|
28
|
-
*/
|
|
29
|
-
breadcrumb?: Partial<BreadcrumbOptions>;
|
|
30
|
-
/**
|
|
31
|
-
* Footer navigation, located under the page body.
|
|
32
|
-
*
|
|
33
|
-
* You can specify `footer.children` to add extra components under the footer.
|
|
34
|
-
*/
|
|
35
|
-
footer?: Partial<FooterOptions>;
|
|
36
|
-
children?: ReactNode;
|
|
37
|
-
/**
|
|
38
|
-
* Apply class names to the `#nd-page` container.
|
|
39
|
-
*/
|
|
40
|
-
className?: string;
|
|
41
|
-
}
|
|
42
|
-
type TableOfContentOptions = Pick<AnchorProviderProps, 'single'> & {
|
|
43
|
-
/**
|
|
44
|
-
* Custom content in TOC container, before the main TOC
|
|
45
|
-
*/
|
|
46
|
-
header?: ReactNode;
|
|
47
|
-
/**
|
|
48
|
-
* Custom content in TOC container, after the main TOC
|
|
49
|
-
*/
|
|
50
|
-
footer?: ReactNode;
|
|
51
|
-
enabled: boolean;
|
|
52
|
-
component: ReactNode;
|
|
53
|
-
/**
|
|
54
|
-
* @defaultValue 'normal'
|
|
55
|
-
*/
|
|
56
|
-
style?: 'normal' | 'clerk';
|
|
57
|
-
};
|
|
58
|
-
type TableOfContentPopoverOptions = Omit<TableOfContentOptions, 'single'>;
|
|
59
|
-
declare function DocsPage({
|
|
60
|
-
breadcrumb: {
|
|
61
|
-
enabled: breadcrumbEnabled,
|
|
62
|
-
component: breadcrumb,
|
|
63
|
-
...breadcrumbProps
|
|
64
|
-
},
|
|
65
|
-
footer: {
|
|
66
|
-
enabled: footerEnabled,
|
|
67
|
-
component: footerReplace,
|
|
68
|
-
...footerProps
|
|
69
|
-
},
|
|
70
|
-
full,
|
|
71
|
-
tableOfContentPopover: {
|
|
72
|
-
enabled: tocPopoverEnabled,
|
|
73
|
-
component: tocPopover,
|
|
74
|
-
...tocPopoverOptions
|
|
75
|
-
},
|
|
76
|
-
tableOfContent: {
|
|
77
|
-
enabled: tocEnabled,
|
|
78
|
-
component: tocReplace,
|
|
79
|
-
...tocOptions
|
|
80
|
-
},
|
|
81
|
-
toc,
|
|
82
|
-
children,
|
|
83
|
-
className
|
|
84
|
-
}: DocsPageProps): ReactNode;
|
|
85
9
|
declare function EditOnGitHub(props: ComponentProps<'a'>): react_jsx_runtime0.JSX.Element;
|
|
86
10
|
/**
|
|
87
11
|
* Add typography styles
|
|
@@ -102,5 +26,4 @@ declare function DocsTitle({
|
|
|
102
26
|
...props
|
|
103
27
|
}: ComponentProps<'h1'>): react_jsx_runtime0.JSX.Element;
|
|
104
28
|
//#endregion
|
|
105
|
-
export { DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, MarkdownCopyButton, PageBreadcrumb, PageLastUpdate, ViewOptionsPopover };
|
|
106
|
-
//# sourceMappingURL=index.d.ts.map
|
|
29
|
+
export { type BreadcrumbProps, DocsBody, DocsDescription, DocsPage, type DocsPageProps, type DocsPageSlots, DocsTitle, EditOnGitHub, type FooterProps, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, useDocsPage };
|
|
@@ -2,13 +2,12 @@ import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { I18nLabel } from "../../../contexts/i18n.js";
|
|
3
3
|
import { cn } from "../../../utils/cn.js";
|
|
4
4
|
import { buttonVariants } from "../../../components/ui/button.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { TOCItems as TOCItems$1 } from "../../../components/toc/clerk.js";
|
|
5
|
+
import { Footer } from "./slots/footer.js";
|
|
6
|
+
import { Breadcrumb } from "./slots/breadcrumb.js";
|
|
7
|
+
import { DocsPage, PageLastUpdate, useDocsPage } from "./client.js";
|
|
9
8
|
import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
|
|
10
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { Edit
|
|
10
|
+
import { Edit } from "lucide-react";
|
|
12
11
|
//#region src/layouts/docs/page/index.tsx
|
|
13
12
|
var page_exports = /* @__PURE__ */ __exportAll({
|
|
14
13
|
DocsBody: () => DocsBody,
|
|
@@ -17,51 +16,12 @@ var page_exports = /* @__PURE__ */ __exportAll({
|
|
|
17
16
|
DocsTitle: () => DocsTitle,
|
|
18
17
|
EditOnGitHub: () => EditOnGitHub,
|
|
19
18
|
MarkdownCopyButton: () => MarkdownCopyButton,
|
|
20
|
-
PageBreadcrumb: () =>
|
|
19
|
+
PageBreadcrumb: () => Breadcrumb,
|
|
20
|
+
PageFooter: () => Footer,
|
|
21
21
|
PageLastUpdate: () => PageLastUpdate,
|
|
22
|
-
ViewOptionsPopover: () => ViewOptionsPopover
|
|
22
|
+
ViewOptionsPopover: () => ViewOptionsPopover,
|
|
23
|
+
useDocsPage: () => useDocsPage
|
|
23
24
|
});
|
|
24
|
-
function DocsPage({ breadcrumb: { enabled: breadcrumbEnabled = true, component: breadcrumb, ...breadcrumbProps } = {}, footer: { enabled: footerEnabled, component: footerReplace, ...footerProps } = {}, full = false, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopover, ...tocPopoverOptions } = {}, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {}, toc = [], children, className }) {
|
|
25
|
-
tocEnabled ??= !full && (toc.length > 0 || tocOptions.footer !== void 0 || tocOptions.header !== void 0);
|
|
26
|
-
tocPopoverEnabled ??= toc.length > 0 || tocPopoverOptions.header !== void 0 || tocPopoverOptions.footer !== void 0;
|
|
27
|
-
let wrapper = (children) => children;
|
|
28
|
-
if (tocEnabled || tocPopoverEnabled) wrapper = (children) => /* @__PURE__ */ jsx(TOCProvider, {
|
|
29
|
-
single: tocOptions.single,
|
|
30
|
-
toc,
|
|
31
|
-
children
|
|
32
|
-
});
|
|
33
|
-
return wrapper(/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
-
tocPopoverEnabled && (tocPopover ?? /* @__PURE__ */ jsxs(PageTOCPopover, { children: [/* @__PURE__ */ jsx(PageTOCPopoverTrigger, {}), /* @__PURE__ */ jsxs(PageTOCPopoverContent, { children: [
|
|
35
|
-
tocPopoverOptions.header,
|
|
36
|
-
/* @__PURE__ */ jsx(TOCScrollArea, { children: tocPopoverOptions.style === "clerk" ? /* @__PURE__ */ jsx(TOCItems$1, {}) : /* @__PURE__ */ jsx(TOCItems, {}) }),
|
|
37
|
-
tocPopoverOptions.footer
|
|
38
|
-
] })] })),
|
|
39
|
-
/* @__PURE__ */ jsxs("article", {
|
|
40
|
-
id: "nd-page",
|
|
41
|
-
"data-full": full,
|
|
42
|
-
className: cn("flex flex-col w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14", full ? "max-w-[1168px]" : "xl:layout:[--fd-toc-width:268px]", className),
|
|
43
|
-
children: [
|
|
44
|
-
breadcrumbEnabled && (breadcrumb ?? /* @__PURE__ */ jsx(PageBreadcrumb, { ...breadcrumbProps })),
|
|
45
|
-
children,
|
|
46
|
-
footerEnabled !== false && (footerReplace ?? /* @__PURE__ */ jsx(PageFooter, { ...footerProps }))
|
|
47
|
-
]
|
|
48
|
-
}),
|
|
49
|
-
tocEnabled && (tocReplace ?? /* @__PURE__ */ jsxs("div", {
|
|
50
|
-
id: "nd-toc",
|
|
51
|
-
className: "sticky top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 max-xl:hidden",
|
|
52
|
-
children: [
|
|
53
|
-
tocOptions.header,
|
|
54
|
-
/* @__PURE__ */ jsxs("h3", {
|
|
55
|
-
id: "toc-title",
|
|
56
|
-
className: "inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",
|
|
57
|
-
children: [/* @__PURE__ */ jsx(Text, { className: "size-4" }), /* @__PURE__ */ jsx(I18nLabel, { label: "toc" })]
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ jsx(TOCScrollArea, { children: tocOptions.style === "clerk" ? /* @__PURE__ */ jsx(TOCItems$1, {}) : /* @__PURE__ */ jsx(TOCItems, {}) }),
|
|
60
|
-
tocOptions.footer
|
|
61
|
-
]
|
|
62
|
-
}))
|
|
63
|
-
] }));
|
|
64
|
-
}
|
|
65
25
|
function EditOnGitHub(props) {
|
|
66
26
|
return /* @__PURE__ */ jsx("a", {
|
|
67
27
|
target: "_blank",
|
|
@@ -101,6 +61,4 @@ function DocsTitle({ children, className, ...props }) {
|
|
|
101
61
|
});
|
|
102
62
|
}
|
|
103
63
|
//#endregion
|
|
104
|
-
export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, MarkdownCopyButton, PageBreadcrumb, PageLastUpdate, ViewOptionsPopover, page_exports };
|
|
105
|
-
|
|
106
|
-
//# sourceMappingURL=index.js.map
|
|
64
|
+
export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, page_exports, useDocsPage };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { BreadcrumbOptions } from "fumadocs-core/breadcrumb";
|
|
4
|
+
|
|
5
|
+
//#region src/layouts/docs/page/slots/breadcrumb.d.ts
|
|
6
|
+
type BreadcrumbProps = BreadcrumbOptions & ComponentProps<'div'>;
|
|
7
|
+
declare function Breadcrumb({
|
|
8
|
+
includeRoot,
|
|
9
|
+
includeSeparator,
|
|
10
|
+
includePage,
|
|
11
|
+
...props
|
|
12
|
+
}: BreadcrumbProps): react_jsx_runtime0.JSX.Element | null;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Breadcrumb, BreadcrumbProps };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cn } from "../../../../utils/cn.js";
|
|
2
|
+
import { useTreeContext, useTreePath } from "../../../../contexts/tree.js";
|
|
3
|
+
import { Fragment, useMemo } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronRight, Link } from "lucide-react";
|
|
6
|
+
import { getBreadcrumbItemsFromPath } from "fumadocs-core/breadcrumb";
|
|
7
|
+
//#region src/layouts/docs/page/slots/breadcrumb.tsx
|
|
8
|
+
function Breadcrumb({ includeRoot, includeSeparator, includePage, ...props }) {
|
|
9
|
+
const path = useTreePath();
|
|
10
|
+
const { root } = useTreeContext();
|
|
11
|
+
const items = useMemo(() => {
|
|
12
|
+
return getBreadcrumbItemsFromPath(root, path, {
|
|
13
|
+
includePage,
|
|
14
|
+
includeSeparator,
|
|
15
|
+
includeRoot
|
|
16
|
+
});
|
|
17
|
+
}, [
|
|
18
|
+
includePage,
|
|
19
|
+
includeRoot,
|
|
20
|
+
includeSeparator,
|
|
21
|
+
path,
|
|
22
|
+
root
|
|
23
|
+
]);
|
|
24
|
+
if (items.length === 0) return null;
|
|
25
|
+
return /* @__PURE__ */ jsx("div", {
|
|
26
|
+
...props,
|
|
27
|
+
className: cn("flex items-center gap-1.5 text-sm text-fd-muted-foreground", props.className),
|
|
28
|
+
children: items.map((item, i) => {
|
|
29
|
+
const className = cn("truncate", i === items.length - 1 && "text-fd-primary font-medium");
|
|
30
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [i !== 0 && /* @__PURE__ */ jsx(ChevronRight, { className: "size-3.5 shrink-0" }), item.url ? /* @__PURE__ */ jsx(Link, {
|
|
31
|
+
href: item.url,
|
|
32
|
+
className: cn(className, "transition-opacity hover:opacity-80"),
|
|
33
|
+
children: item.name
|
|
34
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className,
|
|
36
|
+
children: item.name
|
|
37
|
+
})] }, i);
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Breadcrumb };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/layouts/docs/page/slots/container.d.ts
|
|
5
|
+
declare function Container(props: ComponentProps<'article'>): react_jsx_runtime0.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Container };
|