@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,7 +1,48 @@
|
|
|
1
|
+
import { isActive, normalize } from "../../utils/urls.js";
|
|
2
|
+
import { LinkItem, baseSlots } from "./client.js";
|
|
1
3
|
import { useMemo } from "react";
|
|
2
4
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
5
|
+
import * as PageTree from "fumadocs-core/page-tree";
|
|
4
6
|
//#region src/layouts/shared/index.tsx
|
|
7
|
+
const defaultTransform = (option, node) => {
|
|
8
|
+
if (!node.icon) return option;
|
|
9
|
+
return {
|
|
10
|
+
...option,
|
|
11
|
+
icon: /* @__PURE__ */ jsx("div", {
|
|
12
|
+
className: "size-full [&_svg]:size-full max-md:p-1.5 max-md:rounded-md max-md:border max-md:bg-fd-secondary",
|
|
13
|
+
children: node.icon
|
|
14
|
+
})
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
function getLayoutTabs(tree, { transform = defaultTransform } = {}) {
|
|
18
|
+
const results = [];
|
|
19
|
+
function next(node, unlisted) {
|
|
20
|
+
if ("root" in node && node.root) {
|
|
21
|
+
const url = node.index?.url ?? node.children.find((node) => node.type === "page")?.url;
|
|
22
|
+
if (url) {
|
|
23
|
+
const option = {
|
|
24
|
+
title: node.name,
|
|
25
|
+
icon: node.icon,
|
|
26
|
+
description: node.description,
|
|
27
|
+
url,
|
|
28
|
+
unlisted,
|
|
29
|
+
$folder: node
|
|
30
|
+
};
|
|
31
|
+
const mapped = transform ? transform(option, node) : option;
|
|
32
|
+
if (mapped) results.push(mapped);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
for (const child of node.children) if (child.type === "folder") next(child, unlisted);
|
|
36
|
+
}
|
|
37
|
+
next(tree);
|
|
38
|
+
if (tree.fallback) next(tree.fallback, true);
|
|
39
|
+
return results;
|
|
40
|
+
}
|
|
41
|
+
function isLayoutTabActive(tab, pathname) {
|
|
42
|
+
if (tab.$folder) return PageTree.findPath(tab.$folder.children, (node) => node.type === "page" && isActive(node.url, pathname)) !== null;
|
|
43
|
+
if (tab.urls) return tab.urls.has(normalize(pathname));
|
|
44
|
+
return isActive(tab.url, pathname, true);
|
|
45
|
+
}
|
|
5
46
|
/**
|
|
6
47
|
* Get link items with shortcuts
|
|
7
48
|
*/
|
|
@@ -22,17 +63,6 @@ function resolveLinkItems({ links = [], githubUrl }) {
|
|
|
22
63
|
});
|
|
23
64
|
return result;
|
|
24
65
|
}
|
|
25
|
-
function renderTitleNav({ title, url = "/" }, props) {
|
|
26
|
-
if (typeof title === "function") return title({
|
|
27
|
-
href: url,
|
|
28
|
-
...props
|
|
29
|
-
});
|
|
30
|
-
return /* @__PURE__ */ jsx(Link, {
|
|
31
|
-
href: url,
|
|
32
|
-
...props,
|
|
33
|
-
children: title
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
66
|
function useLinkItems({ githubUrl, links }) {
|
|
37
67
|
return useMemo(() => {
|
|
38
68
|
const all = resolveLinkItems({
|
|
@@ -41,7 +71,7 @@ function useLinkItems({ githubUrl, links }) {
|
|
|
41
71
|
});
|
|
42
72
|
const navItems = [];
|
|
43
73
|
const menuItems = [];
|
|
44
|
-
for (const item of all) switch (item.on
|
|
74
|
+
for (const item of all) switch (item.on) {
|
|
45
75
|
case "menu":
|
|
46
76
|
menuItems.push(item);
|
|
47
77
|
break;
|
|
@@ -59,7 +89,10 @@ function useLinkItems({ githubUrl, links }) {
|
|
|
59
89
|
};
|
|
60
90
|
}, [links, githubUrl]);
|
|
61
91
|
}
|
|
92
|
+
function isLinkItemActive(link, pathname) {
|
|
93
|
+
if (link.type === "custom" || !link.url) return false;
|
|
94
|
+
if (link.active === "none") return false;
|
|
95
|
+
return isActive(link.url, pathname, link.active === "nested-url");
|
|
96
|
+
}
|
|
62
97
|
//#endregion
|
|
63
|
-
export {
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=index.js.map
|
|
98
|
+
export { LinkItem, baseSlots, getLayoutTabs, isLayoutTabActive, isLinkItemActive, resolveLinkItems, useLinkItems };
|
|
@@ -33,5 +33,4 @@ declare function ViewOptionsPopover({
|
|
|
33
33
|
githubUrl: string;
|
|
34
34
|
}): react_jsx_runtime0.JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
|
-
export { MarkdownCopyButton, ViewOptionsPopover };
|
|
37
|
-
//# sourceMappingURL=page-actions.d.ts.map
|
|
36
|
+
export { MarkdownCopyButton, ViewOptionsPopover };
|
|
@@ -4,6 +4,7 @@ import { useCopyButton } from "../../utils/use-copy-button.js";
|
|
|
4
4
|
import { buttonVariants } from "../../components/ui/button.js";
|
|
5
5
|
import { Popover, PopoverContent, PopoverTrigger } from "../../components/ui/popover.js";
|
|
6
6
|
import { useMemo, useState } from "react";
|
|
7
|
+
import { usePathname } from "fumadocs-core/framework";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { Check, ChevronDown, Copy, ExternalLinkIcon, TextIcon } from "lucide-react";
|
|
9
10
|
//#region src/layouts/shared/page-actions.tsx
|
|
@@ -41,8 +42,9 @@ function MarkdownCopyButton({ markdownUrl, ...props }) {
|
|
|
41
42
|
* see https://fumadocs.dev/docs/integrations/llms#page-actions to customise.
|
|
42
43
|
*/
|
|
43
44
|
function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
45
|
+
const pathname = usePathname();
|
|
44
46
|
const items = useMemo(() => {
|
|
45
|
-
const q = `Read ${typeof window
|
|
47
|
+
const q = `Read ${typeof window === "undefined" ? pathname : new URL(pathname, window.location.origin)}, I want to ask questions about it.`;
|
|
46
48
|
return [
|
|
47
49
|
{
|
|
48
50
|
title: "Open in GitHub",
|
|
@@ -157,13 +159,17 @@ function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
|
157
159
|
href: `https://cursor.com/link/prompt?${new URLSearchParams({ text: q })}`
|
|
158
160
|
}
|
|
159
161
|
];
|
|
160
|
-
}, [
|
|
162
|
+
}, [
|
|
163
|
+
githubUrl,
|
|
164
|
+
markdownUrl,
|
|
165
|
+
pathname
|
|
166
|
+
]);
|
|
161
167
|
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
162
168
|
...props,
|
|
163
|
-
className: (
|
|
169
|
+
className: (state) => cn(buttonVariants({
|
|
164
170
|
color: "secondary",
|
|
165
171
|
size: "sm"
|
|
166
|
-
}), "gap-2
|
|
172
|
+
}), "gap-2 data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground", typeof props.className === "function" ? props.className(state) : props.className),
|
|
167
173
|
children: [props.children ?? "Open", /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 text-fd-muted-foreground" })]
|
|
168
174
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
169
175
|
className: "flex flex-col",
|
|
@@ -182,5 +188,3 @@ function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
|
182
188
|
}
|
|
183
189
|
//#endregion
|
|
184
190
|
export { MarkdownCopyButton, ViewOptionsPopover };
|
|
185
|
-
|
|
186
|
-
//# sourceMappingURL=page-actions.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/layouts/shared/slots/language-select.d.ts
|
|
5
|
+
type LanguageSelectProps = ComponentProps<'button'>;
|
|
6
|
+
declare function LanguageSelect(props: LanguageSelectProps): React.ReactElement;
|
|
7
|
+
type LanguageSelectTextProps = ComponentProps<'span'>;
|
|
8
|
+
declare function LanguageSelectText(props: LanguageSelectTextProps): react_jsx_runtime0.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { LanguageSelect, LanguageSelectProps, LanguageSelectText, LanguageSelectTextProps };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useI18n } from "
|
|
3
|
-
import { cn } from "
|
|
4
|
-
import { buttonVariants } from "
|
|
5
|
-
import { Popover, PopoverContent, PopoverTrigger } from "
|
|
2
|
+
import { useI18n } from "../../../contexts/i18n.js";
|
|
3
|
+
import { cn } from "../../../utils/cn.js";
|
|
4
|
+
import { buttonVariants } from "../../../components/ui/button.js";
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
//#region src/layouts/shared/language-
|
|
8
|
-
function
|
|
7
|
+
//#region src/layouts/shared/slots/language-select.tsx
|
|
8
|
+
function LanguageSelect(props) {
|
|
9
9
|
const context = useI18n();
|
|
10
10
|
if (!context.locales) throw new Error("Missing `<I18nProvider />`");
|
|
11
11
|
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
@@ -31,15 +31,13 @@ function LanguageToggle(props) {
|
|
|
31
31
|
}, item.locale))]
|
|
32
32
|
})] });
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
const text =
|
|
34
|
+
function LanguageSelectText(props) {
|
|
35
|
+
const { locales, locale } = useI18n();
|
|
36
|
+
const text = locales?.find((item) => item.locale === locale)?.name;
|
|
37
37
|
return /* @__PURE__ */ jsx("span", {
|
|
38
38
|
...props,
|
|
39
39
|
children: text
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
|
-
export {
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=language-toggle.js.map
|
|
43
|
+
export { LanguageSelect, LanguageSelectText };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ButtonProps } from "../../../components/ui/button.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/layouts/shared/slots/search-trigger.d.ts
|
|
6
|
+
interface SearchTriggerProps extends Omit<ComponentProps<'button'>, 'color'>, ButtonProps {
|
|
7
|
+
hideIfDisabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function SearchTrigger({
|
|
10
|
+
hideIfDisabled,
|
|
11
|
+
size,
|
|
12
|
+
color,
|
|
13
|
+
...props
|
|
14
|
+
}: SearchTriggerProps): react_jsx_runtime0.JSX.Element | null;
|
|
15
|
+
interface FullSearchTriggeProps extends ComponentProps<'button'> {
|
|
16
|
+
hideIfDisabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare function FullSearchTrigger({
|
|
19
|
+
hideIfDisabled,
|
|
20
|
+
...props
|
|
21
|
+
}: FullSearchTriggeProps): react_jsx_runtime0.JSX.Element | null;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { FullSearchTriggeProps, FullSearchTrigger, SearchTrigger, SearchTriggerProps };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useI18n } from "
|
|
3
|
-
import { cn } from "
|
|
4
|
-
import { buttonVariants } from "
|
|
5
|
-
import { useSearchContext } from "
|
|
2
|
+
import { useI18n } from "../../../contexts/i18n.js";
|
|
3
|
+
import { cn } from "../../../utils/cn.js";
|
|
4
|
+
import { buttonVariants } from "../../../components/ui/button.js";
|
|
5
|
+
import { useSearchContext } from "../../../contexts/search.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { Search } from "lucide-react";
|
|
8
|
-
//#region src/layouts/shared/search-
|
|
9
|
-
function
|
|
8
|
+
//#region src/layouts/shared/slots/search-trigger.tsx
|
|
9
|
+
function SearchTrigger({ hideIfDisabled, size = "icon-sm", color = "ghost", ...props }) {
|
|
10
10
|
const { setOpenSearch, enabled } = useSearchContext();
|
|
11
11
|
if (hideIfDisabled && !enabled) return null;
|
|
12
12
|
return /* @__PURE__ */ jsx("button", {
|
|
@@ -23,7 +23,7 @@ function SearchToggle({ hideIfDisabled, size = "icon-sm", color = "ghost", ...pr
|
|
|
23
23
|
children: /* @__PURE__ */ jsx(Search, {})
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function FullSearchTrigger({ hideIfDisabled, ...props }) {
|
|
27
27
|
const { enabled, hotKey, setOpenSearch } = useSearchContext();
|
|
28
28
|
const { text } = useI18n();
|
|
29
29
|
if (hideIfDisabled && !enabled) return null;
|
|
@@ -31,7 +31,7 @@ function LargeSearchToggle({ hideIfDisabled, ...props }) {
|
|
|
31
31
|
type: "button",
|
|
32
32
|
"data-search-full": "",
|
|
33
33
|
...props,
|
|
34
|
-
className: cn("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground
|
|
34
|
+
className: cn("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground", props.className),
|
|
35
35
|
onClick: () => {
|
|
36
36
|
setOpenSearch(true);
|
|
37
37
|
},
|
|
@@ -49,6 +49,4 @@ function LargeSearchToggle({ hideIfDisabled, ...props }) {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
|
-
export {
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=search-toggle.js.map
|
|
52
|
+
export { FullSearchTrigger, SearchTrigger };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/layouts/shared/slots/theme-switch.d.ts
|
|
5
|
+
interface ThemeSwitchProps extends ComponentProps<'div'> {
|
|
6
|
+
mode?: 'light-dark' | 'light-dark-system';
|
|
7
|
+
}
|
|
8
|
+
declare function ThemeSwitch({
|
|
9
|
+
className,
|
|
10
|
+
mode,
|
|
11
|
+
...props
|
|
12
|
+
}: ThemeSwitchProps): react_jsx_runtime0.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ThemeSwitch, ThemeSwitchProps };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "
|
|
2
|
+
import { cn } from "../../../utils/cn.js";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Airplay, Moon, Sun } from "lucide-react";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
import { useTheme } from "next-themes";
|
|
8
|
-
//#region src/layouts/shared/theme-
|
|
8
|
+
//#region src/layouts/shared/slots/theme-switch.tsx
|
|
9
9
|
const itemVariants = cva("size-6.5 p-1.5 text-fd-muted-foreground", { variants: { active: {
|
|
10
10
|
true: "bg-fd-accent text-fd-accent-foreground",
|
|
11
11
|
false: "text-fd-muted-foreground"
|
|
@@ -15,7 +15,7 @@ const full = [
|
|
|
15
15
|
["dark", Moon],
|
|
16
16
|
["system", Airplay]
|
|
17
17
|
];
|
|
18
|
-
function
|
|
18
|
+
function ThemeSwitch({ className, mode = "light-dark", ...props }) {
|
|
19
19
|
const { setTheme, theme, resolvedTheme } = useTheme();
|
|
20
20
|
const [mounted, setMounted] = useState(false);
|
|
21
21
|
useEffect(() => {
|
|
@@ -55,6 +55,4 @@ function ThemeToggle({ className, mode = "light-dark", ...props }) {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
|
-
export {
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=theme-toggle.js.map
|
|
58
|
+
export { ThemeSwitch };
|
package/dist/mdx.d.ts
CHANGED
|
@@ -45,5 +45,4 @@ declare const defaultMdxComponents: {
|
|
|
45
45
|
};
|
|
46
46
|
declare const createRelativeLink: typeof createRelativeLink$1;
|
|
47
47
|
//#endregion
|
|
48
|
-
export { createRelativeLink, defaultMdxComponents as default };
|
|
49
|
-
//# sourceMappingURL=mdx.d.ts.map
|
|
48
|
+
export { createRelativeLink, defaultMdxComponents as default };
|
package/dist/mdx.js
CHANGED
package/dist/mdx.server.d.ts
CHANGED
|
@@ -12,5 +12,4 @@ import { LoaderConfig, LoaderOutput, Page } from "fumadocs-core/source";
|
|
|
12
12
|
*/
|
|
13
13
|
declare function createRelativeLink<C extends LoaderConfig>(source: LoaderOutput<C>, page: Page, OverrideLink?: FC<ComponentProps<'a'>>): FC<ComponentProps<'a'>>;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { createRelativeLink, defaultMdxComponents as default };
|
|
16
|
-
//# sourceMappingURL=mdx.server.d.ts.map
|
|
15
|
+
export { createRelativeLink, defaultMdxComponents as default };
|
package/dist/mdx.server.js
CHANGED
package/dist/og/takumi.d.ts
CHANGED
package/dist/og/takumi.js
CHANGED
package/dist/og.d.ts
CHANGED
package/dist/og.js
CHANGED
package/dist/page.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Breadcrumb } from "./layouts/docs/page/slots/breadcrumb.js";
|
|
2
|
+
import { DocsPageProps as DocsPageProps$1, PageLastUpdate } from "./layouts/docs/page/client.js";
|
|
3
|
+
import { DocsBody, DocsDescription, DocsTitle, EditOnGitHub } from "./layouts/docs/page/index.js";
|
|
3
4
|
import { ComponentProps } from "react";
|
|
4
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
6
|
|
|
@@ -33,5 +34,4 @@ declare function DocsPage({
|
|
|
33
34
|
...props
|
|
34
35
|
}: DocsPageProps): react_jsx_runtime0.JSX.Element;
|
|
35
36
|
//#endregion
|
|
36
|
-
export { DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, PageBreadcrumb, PageLastUpdate, withArticle };
|
|
37
|
-
//# sourceMappingURL=page.d.ts.map
|
|
37
|
+
export { DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, Breadcrumb as PageBreadcrumb, PageLastUpdate, withArticle };
|
package/dist/page.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./utils/cn.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIsDocsLayout } from "./layouts/docs/client.js";
|
|
4
|
+
import { Breadcrumb } from "./layouts/docs/page/slots/breadcrumb.js";
|
|
5
|
+
import { PageLastUpdate } from "./layouts/docs/page/client.js";
|
|
5
6
|
import { DocsBody, DocsDescription, DocsTitle, EditOnGitHub, page_exports } from "./layouts/docs/page/index.js";
|
|
6
7
|
import { page_exports as page_exports$1 } from "./layouts/notebook/page/index.js";
|
|
7
|
-
import { use } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/page.tsx
|
|
10
10
|
/**
|
|
@@ -21,7 +21,7 @@ function withArticle(props) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
function DocsPage({ lastUpdate, editOnGithub, children, ...props }) {
|
|
24
|
-
const { DocsPage, EditOnGitHub, PageLastUpdate } =
|
|
24
|
+
const { DocsPage, EditOnGitHub, PageLastUpdate } = useIsDocsLayout() ? page_exports : page_exports$1;
|
|
25
25
|
return /* @__PURE__ */ jsxs(DocsPage, {
|
|
26
26
|
...props,
|
|
27
27
|
children: [children, /* @__PURE__ */ jsxs("div", {
|
|
@@ -31,6 +31,4 @@ function DocsPage({ lastUpdate, editOnGithub, children, ...props }) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, PageBreadcrumb, PageLastUpdate, withArticle };
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=page.js.map
|
|
34
|
+
export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, Breadcrumb as PageBreadcrumb, PageLastUpdate, withArticle };
|
package/dist/provider/base.d.ts
CHANGED
package/dist/provider/base.js
CHANGED
|
@@ -3,8 +3,8 @@ import { I18nProvider } from "../contexts/i18n.js";
|
|
|
3
3
|
import { SearchProvider } from "../contexts/search.js";
|
|
4
4
|
import { lazy } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { DirectionProvider } from "@base-ui/react/direction-provider";
|
|
7
6
|
import { ThemeProvider } from "next-themes";
|
|
7
|
+
import { DirectionProvider } from "@base-ui/react/direction-provider";
|
|
8
8
|
//#region src/provider/base.tsx
|
|
9
9
|
const DefaultSearchDialog = lazy(() => import("../components/dialog/search-default.js"));
|
|
10
10
|
function RootProvider({ children, dir = "ltr", theme = {}, search, i18n }) {
|
|
@@ -33,5 +33,3 @@ function RootProvider({ children, dir = "ltr", theme = {}, search, i18n }) {
|
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
35
35
|
export { RootProvider };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=base.js.map
|
package/dist/provider/next.d.ts
CHANGED
package/dist/provider/next.js
CHANGED
package/dist/provider/waku.d.ts
CHANGED