@fumadocs/base-ui 16.17.7 → 16.17.9
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/flux.css +1 -1
- package/css/generated/glass.css +1 -1
- package/css/generated/shared.css +1 -1
- package/css/generated/spacious.css +1 -1
- package/dist/.translations/index.d.ts +1 -3
- package/dist/.translations/keys.js +1 -2
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/components/accordion.d.ts +1 -3
- package/dist/components/accordion.js +1 -2
- package/dist/components/banner.d.ts +1 -2
- package/dist/components/banner.js +1 -2
- package/dist/components/callout.d.ts +1 -3
- package/dist/components/callout.js +1 -2
- package/dist/components/card.d.ts +1 -3
- package/dist/components/card.js +1 -2
- package/dist/components/codeblock.d.ts +1 -3
- package/dist/components/codeblock.js +1 -2
- package/dist/components/codeblock.rsc.d.ts +7 -3
- package/dist/components/codeblock.rsc.js +21 -9
- package/dist/components/dialog/search-algolia.d.ts +1 -3
- package/dist/components/dialog/search-algolia.js +1 -2
- package/dist/components/dialog/search-default.d.ts +1 -3
- package/dist/components/dialog/search-default.js +1 -2
- package/dist/components/dialog/search-orama.d.ts +1 -3
- package/dist/components/dialog/search-orama.js +1 -2
- package/dist/components/dialog/search.d.ts +13 -16
- package/dist/components/dialog/search.js +19 -31
- package/dist/components/dynamic-codeblock.core.d.ts +9 -6
- package/dist/components/dynamic-codeblock.core.js +55 -18
- package/dist/components/dynamic-codeblock.d.ts +2 -4
- package/dist/components/dynamic-codeblock.js +1 -2
- package/dist/components/files.d.ts +1 -3
- package/dist/components/files.js +1 -2
- package/dist/components/github-info.d.ts +1 -3
- package/dist/components/github-info.js +1 -2
- package/dist/components/heading.d.ts +1 -2
- package/dist/components/heading.js +1 -2
- package/dist/components/image-zoom.d.ts +3 -5
- package/dist/components/image-zoom.js +2 -3
- package/dist/components/inline-toc.d.ts +1 -3
- package/dist/components/inline-toc.js +1 -2
- package/dist/components/sidebar/base.d.ts +0 -1
- package/dist/components/sidebar/base.js +1 -2
- package/dist/components/sidebar/link-item.d.ts +1 -2
- package/dist/components/sidebar/link-item.js +1 -2
- package/dist/components/sidebar/page-tree.d.ts +1 -2
- package/dist/components/sidebar/page-tree.js +1 -2
- package/dist/components/sidebar/tabs/dropdown.d.ts +1 -3
- package/dist/components/sidebar/tabs/dropdown.js +1 -2
- package/dist/components/sidebar/tabs/index.d.ts +1 -3
- package/dist/components/sidebar/tabs/index.js +1 -2
- package/dist/components/steps.d.ts +1 -3
- package/dist/components/steps.js +1 -2
- package/dist/components/tabs.d.ts +2 -4
- package/dist/components/tabs.js +1 -2
- package/dist/components/toc/block.d.ts +2 -6
- package/dist/components/toc/block.js +6 -13
- package/dist/components/toc/clerk.d.ts +2 -7
- package/dist/components/toc/clerk.js +85 -120
- package/dist/components/toc/default.d.ts +2 -7
- package/dist/components/toc/default.js +112 -149
- package/dist/components/toc/index.d.ts +1 -6
- package/dist/components/toc/index.js +1 -2
- package/dist/components/type-table.d.ts +1 -3
- package/dist/components/type-table.js +1 -2
- package/dist/components/ui/accordion.d.ts +1 -3
- package/dist/components/ui/accordion.js +1 -2
- package/dist/components/ui/button.d.ts +1 -3
- package/dist/components/ui/button.js +1 -2
- package/dist/components/ui/collapsible.d.ts +1 -3
- package/dist/components/ui/collapsible.js +1 -2
- package/dist/components/ui/popover.d.ts +1 -3
- package/dist/components/ui/popover.js +1 -2
- package/dist/components/ui/tabs.d.ts +1 -6
- package/dist/components/ui/tabs.js +1 -2
- package/dist/contexts/i18n.d.ts +1 -2
- package/dist/contexts/i18n.js +1 -2
- package/dist/contexts/search.d.ts +1 -2
- package/dist/contexts/search.js +1 -2
- package/dist/contexts/tree.d.ts +1 -2
- package/dist/contexts/tree.js +1 -2
- package/dist/i18n.d.ts +0 -2
- package/dist/i18n.js +1 -2
- package/dist/layouts/docs/client.d.ts +1 -2
- package/dist/layouts/docs/client.js +1 -2
- package/dist/layouts/docs/index.d.ts +0 -2
- package/dist/layouts/docs/index.js +1 -2
- package/dist/layouts/docs/page/index.d.ts +0 -2
- package/dist/layouts/docs/page/index.js +1 -2
- package/dist/layouts/docs/page/slots/breadcrumb.d.ts +1 -3
- package/dist/layouts/docs/page/slots/breadcrumb.js +1 -2
- package/dist/layouts/docs/page/slots/container.d.ts +1 -3
- package/dist/layouts/docs/page/slots/container.js +1 -2
- package/dist/layouts/docs/page/slots/footer.d.ts +1 -2
- package/dist/layouts/docs/page/slots/footer.js +1 -2
- package/dist/layouts/docs/page/slots/toc.d.ts +5 -7
- package/dist/layouts/docs/page/slots/toc.js +1 -2
- package/dist/layouts/docs/slots/container.d.ts +1 -3
- package/dist/layouts/docs/slots/container.js +1 -2
- package/dist/layouts/docs/slots/header.d.ts +1 -3
- package/dist/layouts/docs/slots/header.js +1 -2
- package/dist/layouts/docs/slots/sidebar.d.ts +2 -4
- package/dist/layouts/docs/slots/sidebar.js +1 -2
- package/dist/layouts/flux/index.d.ts +1 -2
- package/dist/layouts/flux/index.js +1 -2
- package/dist/layouts/flux/page/index.d.ts +0 -2
- package/dist/layouts/flux/page/index.js +1 -2
- package/dist/layouts/flux/page/slots/breadcrumb.d.ts +1 -3
- package/dist/layouts/flux/page/slots/breadcrumb.js +1 -2
- package/dist/layouts/flux/page/slots/container.d.ts +1 -3
- package/dist/layouts/flux/page/slots/container.js +1 -2
- package/dist/layouts/flux/page/slots/footer.d.ts +1 -2
- package/dist/layouts/flux/page/slots/footer.js +1 -2
- package/dist/layouts/flux/page/slots/toc.d.ts +5 -7
- package/dist/layouts/flux/page/slots/toc.js +1 -2
- package/dist/layouts/flux/slots/container.d.ts +1 -3
- package/dist/layouts/flux/slots/container.js +1 -2
- package/dist/layouts/flux/slots/sidebar.d.ts +2 -4
- package/dist/layouts/flux/slots/sidebar.js +1 -2
- package/dist/layouts/flux/slots/tab-dropdown.d.ts +1 -3
- package/dist/layouts/flux/slots/tab-dropdown.js +1 -2
- package/dist/layouts/glass/index.d.ts +0 -2
- package/dist/layouts/glass/index.js +1 -2
- package/dist/layouts/glass/layout-tabs.js +1 -2
- package/dist/layouts/glass/page/index.d.ts +0 -2
- package/dist/layouts/glass/page/index.js +1 -2
- package/dist/layouts/glass/page/slots/breadcrumb.d.ts +1 -3
- package/dist/layouts/glass/page/slots/breadcrumb.js +1 -2
- package/dist/layouts/glass/page/slots/footer.d.ts +1 -2
- package/dist/layouts/glass/page/slots/footer.js +1 -2
- package/dist/layouts/glass/page/slots/toc.d.ts +2 -4
- package/dist/layouts/glass/page/slots/toc.js +1 -2
- package/dist/layouts/glass/slots/header.d.ts +1 -3
- package/dist/layouts/glass/slots/header.js +1 -2
- package/dist/layouts/glass/slots/sidebar.d.ts +1 -3
- package/dist/layouts/glass/slots/sidebar.js +1 -2
- package/dist/layouts/home/index.d.ts +1 -2
- package/dist/layouts/home/index.js +1 -2
- package/dist/layouts/home/navbar.d.ts +1 -3
- package/dist/layouts/home/navbar.js +1 -2
- package/dist/layouts/home/not-found.d.ts +1 -3
- package/dist/layouts/home/not-found.js +1 -2
- package/dist/layouts/home/slots/container.d.ts +1 -3
- package/dist/layouts/home/slots/container.js +1 -2
- package/dist/layouts/home/slots/header.d.ts +1 -3
- package/dist/layouts/home/slots/header.js +1 -2
- package/dist/layouts/notebook/client.d.ts +1 -2
- package/dist/layouts/notebook/client.js +1 -2
- package/dist/layouts/notebook/index.d.ts +0 -2
- package/dist/layouts/notebook/index.js +1 -2
- package/dist/layouts/notebook/page/index.d.ts +0 -2
- package/dist/layouts/notebook/page/index.js +1 -2
- package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +1 -3
- package/dist/layouts/notebook/page/slots/breadcrumb.js +1 -2
- package/dist/layouts/notebook/page/slots/container.d.ts +1 -3
- package/dist/layouts/notebook/page/slots/container.js +1 -2
- package/dist/layouts/notebook/page/slots/footer.d.ts +1 -2
- package/dist/layouts/notebook/page/slots/footer.js +1 -2
- package/dist/layouts/notebook/page/slots/toc.d.ts +5 -7
- package/dist/layouts/notebook/page/slots/toc.js +1 -2
- package/dist/layouts/notebook/slots/container.d.ts +1 -3
- package/dist/layouts/notebook/slots/container.js +1 -2
- package/dist/layouts/notebook/slots/header.d.ts +1 -3
- package/dist/layouts/notebook/slots/header.js +1 -2
- package/dist/layouts/notebook/slots/sidebar.d.ts +1 -3
- package/dist/layouts/notebook/slots/sidebar.js +1 -2
- package/dist/layouts/shared/client.d.ts +1 -3
- package/dist/layouts/shared/client.js +1 -2
- package/dist/layouts/shared/index.d.ts +0 -2
- package/dist/layouts/shared/index.js +1 -2
- package/dist/layouts/shared/page-actions.d.ts +1 -3
- package/dist/layouts/shared/page-actions.js +1 -2
- package/dist/layouts/shared/slots/language-select.d.ts +1 -3
- package/dist/layouts/shared/slots/language-select.js +1 -2
- package/dist/layouts/shared/slots/search-trigger.d.ts +1 -3
- package/dist/layouts/shared/slots/search-trigger.js +1 -2
- package/dist/layouts/shared/slots/theme-switch.d.ts +1 -3
- package/dist/layouts/shared/slots/theme-switch.js +1 -2
- package/dist/layouts/spacious/index.d.ts +1 -2
- package/dist/layouts/spacious/index.js +1 -2
- package/dist/layouts/spacious/page/index.d.ts +0 -2
- package/dist/layouts/spacious/page/index.js +1 -2
- package/dist/layouts/spacious/page/slots/breadcrumb.d.ts +1 -3
- package/dist/layouts/spacious/page/slots/breadcrumb.js +1 -2
- package/dist/layouts/spacious/page/slots/footer.d.ts +1 -2
- package/dist/layouts/spacious/page/slots/footer.js +1 -2
- package/dist/layouts/spacious/page/slots/toc.d.ts +5 -6
- package/dist/layouts/spacious/page/slots/toc.js +1 -2
- package/dist/layouts/spacious/slots/actions.d.ts +1 -3
- package/dist/layouts/spacious/slots/actions.js +1 -2
- package/dist/layouts/spacious/slots/header.d.ts +1 -3
- package/dist/layouts/spacious/slots/header.js +1 -2
- package/dist/layouts/spacious/slots/sidebar.d.ts +2 -4
- package/dist/layouts/spacious/slots/sidebar.js +1 -2
- package/dist/mdx.d.ts +0 -2
- package/dist/mdx.js +1 -2
- package/dist/mdx.server.d.ts +0 -2
- package/dist/mdx.server.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/controlled.d.ts +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/controlled.js +1 -2
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +3 -0
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/uncontrolled.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/adjust-svg-ids.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/compute-positioned-style.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/element-tests.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-div-img-style.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-img-alt.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-img-object-fit-style.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-img-regular-style.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-img-src.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-modal-img-transform.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-scale.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-style-ghost.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/get-style-modal-img.js +1 -2
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-medium-image-zoom/dist/utils/get-target-dimension.js +3 -0
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/parse-position.js +1 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/utils/test-has-scalable-src.js +1 -2
- package/dist/og/takumi.d.ts +1 -3
- package/dist/og/takumi.js +1 -2
- package/dist/og.d.ts +1 -2
- package/dist/og.js +1 -2
- package/dist/page.d.ts +0 -2
- package/dist/page.js +1 -2
- package/dist/provider/astro.d.ts +1 -3
- package/dist/provider/astro.js +17 -2
- package/dist/provider/base.d.ts +0 -2
- package/dist/provider/base.js +1 -2
- package/dist/provider/next.d.ts +1 -3
- package/dist/provider/next.js +1 -2
- package/dist/provider/react-router.d.ts +1 -3
- package/dist/provider/react-router.js +1 -2
- package/dist/provider/tanstack.d.ts +1 -3
- package/dist/provider/tanstack.js +1 -2
- package/dist/provider/waku.d.ts +1 -3
- package/dist/provider/waku.js +1 -2
- package/dist/style.css +3 -6
- package/dist/tailwind/typography.js +1 -2
- package/dist/utils/cn.js +1 -2
- package/dist/utils/hotkey.js +1 -2
- package/dist/utils/merge-refs.js +1 -2
- package/dist/utils/urls.js +1 -2
- package/dist/utils/use-copy-button.d.ts +1 -3
- package/dist/utils/use-copy-button.js +1 -2
- package/dist/utils/use-footer-items.d.ts +1 -3
- package/dist/utils/use-footer-items.js +1 -2
- package/dist/utils/use-is-scroll-top.d.ts +1 -3
- package/dist/utils/use-is-scroll-top.js +1 -2
- package/package.json +11 -12
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +0 -5
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/react-medium-image-zoom/dist/utils/get-target-dimension.js +0 -4
- /package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.9_react-dom@19.3.0_react@19.3.0__react@19.3.0 → react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1}/node_modules/react-medium-image-zoom/dist/index.d.ts +0 -0
|
@@ -3,7 +3,6 @@ import { cn } from "../../utils/cn.js";
|
|
|
3
3
|
import { buttonVariants } from "../ui/button.js";
|
|
4
4
|
import { mergeRefs } from "../../utils/merge-refs.js";
|
|
5
5
|
import { useRouter } from "fumadocs-core/framework";
|
|
6
|
-
import * as JsxRuntime from "react/jsx-runtime";
|
|
7
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { ChevronRight, CircleAlert, Hash, SearchIcon } from "lucide-react";
|
|
9
8
|
import { cva } from "class-variance-authority";
|
|
@@ -11,9 +10,9 @@ import { Fragment as Fragment$1, createContext, use, useCallback, useEffect, use
|
|
|
11
10
|
import { T, useTranslations } from "@fuma-translate/react";
|
|
12
11
|
import { Dialog } from "@base-ui/react/dialog";
|
|
13
12
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
13
|
+
import { toJsx } from "fumadocs-core/utils/hast-to-jsx";
|
|
14
14
|
import { useHighlightQuery } from "fumadocs-core/search/client";
|
|
15
|
-
|
|
16
|
-
//#region src/components/dialog/search.tsx
|
|
15
|
+
// src/components/dialog/search.tsx
|
|
17
16
|
const RootContext = createContext(null);
|
|
18
17
|
const TagsListContext = createContext(null);
|
|
19
18
|
const mdComponents = {
|
|
@@ -64,11 +63,7 @@ const mdComponents = {
|
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
65
|
};
|
|
67
|
-
const renderOptions = {
|
|
68
|
-
development: false,
|
|
69
|
-
components: mdComponents,
|
|
70
|
-
...JsxRuntime
|
|
71
|
-
};
|
|
66
|
+
const renderOptions = { components: mdComponents };
|
|
72
67
|
function Children({ children }) {
|
|
73
68
|
return children;
|
|
74
69
|
}
|
|
@@ -78,25 +73,19 @@ function TableCell(props) {
|
|
|
78
73
|
className: "min-w-0 not-last:truncate last:line-clamp-2"
|
|
79
74
|
});
|
|
80
75
|
}
|
|
81
|
-
const tableRenderOptions = {
|
|
82
|
-
...
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
...tableRenderOptions,
|
|
95
|
-
components: {
|
|
96
|
-
...tableRenderOptions.components,
|
|
97
|
-
thead: () => null
|
|
98
|
-
}
|
|
99
|
-
};
|
|
76
|
+
const tableRenderOptions = { components: {
|
|
77
|
+
...mdComponents,
|
|
78
|
+
table: Children,
|
|
79
|
+
thead: Children,
|
|
80
|
+
tbody: Children,
|
|
81
|
+
tr: Children,
|
|
82
|
+
th: TableCell,
|
|
83
|
+
td: TableCell
|
|
84
|
+
} };
|
|
85
|
+
const rowRenderOptions = { components: {
|
|
86
|
+
...tableRenderOptions.components,
|
|
87
|
+
thead: () => null
|
|
88
|
+
} };
|
|
100
89
|
function SearchDialog({ open, onOpenChange, search, onSearchChange, isLoading = false, data, error, onSelect: onSelectProp, children, dialogHandle }) {
|
|
101
90
|
const router = useRouter();
|
|
102
91
|
const onOpenChangeCallback = useRef(onOpenChange);
|
|
@@ -326,7 +315,7 @@ function SearchDialogListTable({ table, Item, onSelect }) {
|
|
|
326
315
|
const { query } = useSearch();
|
|
327
316
|
const highlightRef = useHighlightQuery(query);
|
|
328
317
|
const headerId = `fd-search-table-${table.id}`;
|
|
329
|
-
const header = useMemo(() => table.header &&
|
|
318
|
+
const header = useMemo(() => table.header && toJsx(table.header, tableRenderOptions), [table.header]);
|
|
330
319
|
return /* @__PURE__ */ jsx("div", {
|
|
331
320
|
role: table.header ? "group" : void 0,
|
|
332
321
|
"aria-labelledby": table.header ? headerId : void 0,
|
|
@@ -357,8 +346,8 @@ function SearchDialogListItem({ item, table, className, children, renderMarkdown
|
|
|
357
346
|
if (item.type === "action") return item.node;
|
|
358
347
|
if (renderMarkdown && typeof item.content === "string") return renderMarkdown(item.content);
|
|
359
348
|
if (!("hastContent" in item)) return item.content;
|
|
360
|
-
if (!table) return
|
|
361
|
-
return
|
|
349
|
+
if (!table) return toJsx(item.hastContent, renderOptions);
|
|
350
|
+
return toJsx(item.hastContent, table.header ? rowRenderOptions : tableRenderOptions);
|
|
362
351
|
}, [
|
|
363
352
|
item,
|
|
364
353
|
renderMarkdown,
|
|
@@ -453,5 +442,4 @@ function useTagsList() {
|
|
|
453
442
|
if (!ctx) throw new Error("Missing <TagsList />");
|
|
454
443
|
return ctx;
|
|
455
444
|
}
|
|
456
|
-
//#endregion
|
|
457
445
|
export { SearchDialog, SearchDialogClose, SearchDialogContent, SearchDialogFooter, SearchDialogHeader, SearchDialogIcon, SearchDialogInput, SearchDialogList, SearchDialogListItem, SearchDialogListTable, SearchDialogOverlay, TagsList, TagsListItem, useSearch, useTagsList };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { CodeBlockProps } from "./codeblock.js";
|
|
2
|
+
import { Highlighter } from "fumadocs-core/highlight";
|
|
2
3
|
import { UseShikiOptions } from "fumadocs-core/highlight/shiki/react";
|
|
3
4
|
import { HighlighterCore } from "shiki";
|
|
4
|
-
declare namespace dynamic_codeblock_core_d_exports {
|
|
5
|
-
export { DynamicCodeBlock, DynamicCodeblockProps };
|
|
6
|
-
}
|
|
7
5
|
export interface DynamicCodeblockProps {
|
|
8
6
|
highlighter: HighlighterCore | (() => HighlighterCore | PromiseLike<HighlighterCore>);
|
|
9
7
|
lang: string;
|
|
@@ -23,6 +21,11 @@ export interface DynamicCodeblockProps {
|
|
|
23
21
|
options: DistributiveOmit<UseShikiOptions, 'lang'>;
|
|
24
22
|
}
|
|
25
23
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Create a code block that highlights with your own highlighter.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createDynamicCodeBlock({ highlighter }: {
|
|
28
|
+
highlighter: Highlighter;
|
|
29
|
+
}): (props: Omit<DynamicCodeblockProps, 'highlighter' | 'options'>) => import("react").JSX.Element;
|
|
30
|
+
export declare function DynamicCodeBlock({ highlighter, options, wrapInSuspense, ...props }: DynamicCodeblockProps): import("react").JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { cn } from "../utils/cn.js";
|
|
3
3
|
import { CodeBlock, Pre } from "./codeblock.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { createContext, use,
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { Suspense, createContext, use, useMemo, useRef } from "react";
|
|
6
|
+
import { toJsx } from "fumadocs-core/utils/hast-to-jsx";
|
|
7
|
+
import { createShikiHighlighter } from "fumadocs-core/highlight/shiki";
|
|
8
|
+
// src/components/dynamic-codeblock.core.tsx
|
|
8
9
|
const PropsContext = createContext(void 0);
|
|
9
10
|
function DefaultPre(props) {
|
|
10
11
|
const extraProps = use(PropsContext);
|
|
@@ -15,31 +16,68 @@ function DefaultPre(props) {
|
|
|
15
16
|
children: /* @__PURE__ */ jsx(Pre, { children: props.children })
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Create a code block that highlights with your own highlighter.
|
|
21
|
+
*/
|
|
22
|
+
function createDynamicCodeBlock({ highlighter }) {
|
|
23
|
+
return function DynamicCodeBlock(props) {
|
|
24
|
+
return /* @__PURE__ */ jsx(Base, {
|
|
25
|
+
highlighter,
|
|
26
|
+
components: { pre: DefaultPre },
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function DynamicCodeBlock({ highlighter, options, wrapInSuspense = true, ...props }) {
|
|
32
|
+
const initial = useRef({
|
|
33
|
+
highlighter,
|
|
34
|
+
options
|
|
35
|
+
});
|
|
36
|
+
const instance = useMemo(() => createShikiHighlighter(initial.current.highlighter, {
|
|
22
37
|
defaultColor: false,
|
|
23
|
-
...options
|
|
38
|
+
...initial.current.options
|
|
39
|
+
}), []);
|
|
40
|
+
const node = /* @__PURE__ */ jsx(Base, {
|
|
41
|
+
highlighter: instance,
|
|
24
42
|
components: {
|
|
25
43
|
pre: DefaultPre,
|
|
26
44
|
...options?.components
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
45
|
+
},
|
|
46
|
+
wrapInSuspense,
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
return wrapInSuspense ? node : /* @__PURE__ */ jsx(Suspense, { children: node });
|
|
50
|
+
}
|
|
51
|
+
function Base({ highlighter, lang, code, codeblock, wrapInSuspense = true, components }) {
|
|
52
|
+
let node = /* @__PURE__ */ jsx(Highlighted, {
|
|
53
|
+
highlighter,
|
|
31
54
|
lang,
|
|
32
|
-
code
|
|
33
|
-
]);
|
|
34
|
-
if (wrapInSuspense) node ??= /* @__PURE__ */ jsx(Placeholder, {
|
|
35
55
|
code,
|
|
36
|
-
components
|
|
56
|
+
components
|
|
57
|
+
});
|
|
58
|
+
if (wrapInSuspense && highlighter.loadLanguage) node = /* @__PURE__ */ jsx(Suspense, {
|
|
59
|
+
fallback: /* @__PURE__ */ jsx(Placeholder, {
|
|
60
|
+
code,
|
|
61
|
+
components
|
|
62
|
+
}),
|
|
63
|
+
children: node
|
|
37
64
|
});
|
|
38
65
|
return /* @__PURE__ */ jsx(PropsContext, {
|
|
39
66
|
value: codeblock,
|
|
40
67
|
children: node
|
|
41
68
|
});
|
|
42
69
|
}
|
|
70
|
+
const languages = /* @__PURE__ */ new WeakMap();
|
|
71
|
+
function Highlighted({ highlighter, lang, code, components }) {
|
|
72
|
+
if (highlighter.loadLanguage) {
|
|
73
|
+
let loading = languages.get(highlighter);
|
|
74
|
+
if (!loading) languages.set(highlighter, loading = /* @__PURE__ */ new Map());
|
|
75
|
+
let promise = loading.get(lang);
|
|
76
|
+
if (!promise) loading.set(lang, promise = highlighter.loadLanguage(lang));
|
|
77
|
+
use(promise);
|
|
78
|
+
}
|
|
79
|
+
return toJsx(highlighter.codeToHast(code, { lang }), { components });
|
|
80
|
+
}
|
|
43
81
|
function Placeholder({ code, components = {} }) {
|
|
44
82
|
const { pre: Pre = "pre", code: Code = "code" } = components;
|
|
45
83
|
return /* @__PURE__ */ jsx(Pre, { children: /* @__PURE__ */ jsx(Code, { children: code.split("\n").map((line, i) => /* @__PURE__ */ jsx("span", {
|
|
@@ -47,5 +85,4 @@ function Placeholder({ code, components = {} }) {
|
|
|
47
85
|
children: line
|
|
48
86
|
}, i)) }) });
|
|
49
87
|
}
|
|
50
|
-
|
|
51
|
-
export { DynamicCodeBlock };
|
|
88
|
+
export { DynamicCodeBlock, createDynamicCodeBlock };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { DynamicCodeblockProps as DynamicCodeblockProps$1
|
|
2
|
-
//#region src/components/dynamic-codeblock.d.ts
|
|
1
|
+
import { DynamicCodeblockProps as DynamicCodeblockProps$1 } from "./dynamic-codeblock.core.js";
|
|
3
2
|
export type DynamicCodeblockProps = Omit<DynamicCodeblockProps$1, 'highlighter' | 'options'> & {
|
|
4
3
|
options?: DynamicCodeblockProps$1['options'];
|
|
5
4
|
};
|
|
6
|
-
export declare function DynamicCodeBlock(props: DynamicCodeblockProps): import("react").JSX.Element;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function DynamicCodeBlock(props: DynamicCodeblockProps): import("react").JSX.Element;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DynamicCodeBlock as DynamicCodeBlock$1 } from "./dynamic-codeblock.core.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { defaultShikiFactory } from "fumadocs-core/highlight/shiki/full";
|
|
5
|
-
|
|
5
|
+
// src/components/dynamic-codeblock.tsx
|
|
6
6
|
function DynamicCodeBlock(props) {
|
|
7
7
|
return /* @__PURE__ */ jsx(DynamicCodeBlock$1, {
|
|
8
8
|
highlighter: () => defaultShikiFactory.getOrInit(),
|
|
@@ -13,5 +13,4 @@ function DynamicCodeBlock(props) {
|
|
|
13
13
|
...props
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { DynamicCodeBlock };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
//#region src/components/files.d.ts
|
|
3
2
|
export declare function Files({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.ReactElement;
|
|
4
3
|
export interface FileProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
4
|
name: string;
|
|
@@ -16,5 +15,4 @@ export interface FolderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
16
15
|
defaultOpen?: boolean;
|
|
17
16
|
}
|
|
18
17
|
export declare function File({ name, icon, className, ...rest }: FileProps): React.ReactElement;
|
|
19
|
-
export declare function Folder({ name, defaultOpen, ...props }: FolderProps): React.ReactElement;
|
|
20
|
-
//#endregion
|
|
18
|
+
export declare function Folder({ name, defaultOpen, ...props }: FolderProps): React.ReactElement;
|
package/dist/components/files.js
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { FileIcon, FolderIcon, FolderOpen } from "lucide-react";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
import { useState } from "react";
|
|
8
|
-
|
|
8
|
+
// src/components/files.tsx
|
|
9
9
|
const itemVariants = cva("flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4");
|
|
10
10
|
function Files({ className, ...props }) {
|
|
11
11
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -36,5 +36,4 @@ function Folder({ name, defaultOpen = false, ...props }) {
|
|
|
36
36
|
}) })]
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { File, Files, Folder };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
//#region src/components/github-info.d.ts
|
|
3
2
|
export interface FetchRepositoryInfoOptions {
|
|
4
3
|
owner: string;
|
|
5
4
|
repo: string;
|
|
@@ -15,5 +14,4 @@ export interface GithubInfoProps extends ComponentProps<'a'>, FetchRepositoryInf
|
|
|
15
14
|
locale?: Intl.LocalesArgument;
|
|
16
15
|
}
|
|
17
16
|
export declare function fetchRepositoryInfo({ owner, repo, token, baseUrl, fetchOptions }: FetchRepositoryInfoOptions): Promise<RepositoryInfo>;
|
|
18
|
-
export declare function GithubInfo({ repo, owner, token, baseUrl, fetchOptions, locale, ...props }: GithubInfoProps): import("react").JSX.Element;
|
|
19
|
-
//#endregion
|
|
17
|
+
export declare function GithubInfo({ repo, owner, token, baseUrl, fetchOptions, locale, ...props }: GithubInfoProps): import("react").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { cn } from "../utils/cn.js";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { GitFork, Star } from "lucide-react";
|
|
4
4
|
import { use } from "react";
|
|
5
|
-
|
|
5
|
+
// src/components/github-info.tsx
|
|
6
6
|
async function fetchRepositoryInfo({ owner, repo, token, baseUrl = "https://api.github.com", fetchOptions = { next: { revalidate: 60 } } }) {
|
|
7
7
|
const endpoint = `${baseUrl}/repos/${owner}/${repo}`;
|
|
8
8
|
const headers = new Headers(fetchOptions.headers);
|
|
@@ -71,5 +71,4 @@ function GithubInfo({ repo, owner, token, baseUrl, fetchOptions, locale, ...prop
|
|
|
71
71
|
})]
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
//#endregion
|
|
75
74
|
export { GithubInfo, fetchRepositoryInfo };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
-
//#region src/components/heading.d.ts
|
|
3
2
|
type Types = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
4
3
|
type HeadingProps<T extends Types> = Omit<ComponentPropsWithoutRef<T>, 'as'> & {
|
|
5
4
|
as?: T;
|
|
6
5
|
};
|
|
7
6
|
export declare function Heading<T extends Types = 'h1'>({ as, ...props }: HeadingProps<T>): import("react").JSX.Element;
|
|
8
|
-
|
|
7
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import { useCopyButton } from "../utils/use-copy-button.js";
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { CopyCheckIcon, LinkIcon } from "lucide-react";
|
|
7
7
|
import { useTranslations } from "@fuma-translate/react";
|
|
8
|
-
|
|
8
|
+
// src/components/heading.tsx
|
|
9
9
|
function Heading({ as, ...props }) {
|
|
10
10
|
const As = as ?? "h1";
|
|
11
11
|
const t = useTranslations({ note: "heading anchor" });
|
|
@@ -37,5 +37,4 @@ function Heading({ as, ...props }) {
|
|
|
37
37
|
})]
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
//#endregion
|
|
41
40
|
export { Heading };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { UncontrolledProps } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.
|
|
2
|
-
import "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.
|
|
1
|
+
import { UncontrolledProps } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-medium-image-zoom/dist/uncontrolled.js";
|
|
2
|
+
import "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-medium-image-zoom/dist/index.js";
|
|
3
3
|
import { ImageProps } from "fumadocs-core/framework";
|
|
4
4
|
import { ComponentProps, ReactNode } from "react";
|
|
5
|
-
//#region src/components/image-zoom.d.ts
|
|
6
5
|
export type ImageZoomProps = ImageProps & {
|
|
7
6
|
/**
|
|
8
7
|
* Image props when zoom in
|
|
@@ -25,5 +24,4 @@ export declare function ImageZoom({ zoomInProps, children, rmiz, caption, ...pro
|
|
|
25
24
|
*/
|
|
26
25
|
export declare function Lightbox({ children }: {
|
|
27
26
|
children: ReactNode;
|
|
28
|
-
}): import("react").JSX.Element;
|
|
29
|
-
//#endregion
|
|
27
|
+
}): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../utils/cn.js";
|
|
3
3
|
import { buttonVariants } from "./ui/button.js";
|
|
4
|
-
import { Uncontrolled } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.
|
|
4
|
+
import { Uncontrolled } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-medium-image-zoom/dist/uncontrolled.js";
|
|
5
5
|
import "./image-zoom2.css";
|
|
6
6
|
import { Image } from "fumadocs-core/framework";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -9,7 +9,7 @@ import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
|
9
9
|
import { createContext, use, useRef, useState } from "react";
|
|
10
10
|
import { useTranslations } from "@fuma-translate/react";
|
|
11
11
|
import { createPortal, flushSync } from "react-dom";
|
|
12
|
-
|
|
12
|
+
// src/components/image-zoom.tsx
|
|
13
13
|
const LightboxContext = createContext(null);
|
|
14
14
|
function getImageSrc(src) {
|
|
15
15
|
if (typeof src === "string") return src;
|
|
@@ -253,5 +253,4 @@ function transition(from, update) {
|
|
|
253
253
|
if (to) to.style.viewTransitionName = "";
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
//#endregion
|
|
257
256
|
export { ImageZoom, Lightbox };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Collapsible } from "./ui/collapsible.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
import { TOCItemType } from "fumadocs-core/toc";
|
|
4
|
-
//#region src/components/inline-toc.d.ts
|
|
5
4
|
export interface InlineTocProps extends ComponentProps<typeof Collapsible> {
|
|
6
5
|
items: TOCItemType[];
|
|
7
6
|
}
|
|
8
|
-
export declare function InlineTOC({ items, className, ...props }: InlineTocProps): import("react").JSX.Element;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare function InlineTOC({ items, className, ...props }: InlineTocProps): import("react").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collap
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { ChevronDown } from "lucide-react";
|
|
6
6
|
import { useTranslations } from "@fuma-translate/react";
|
|
7
|
-
|
|
7
|
+
// src/components/inline-toc.tsx
|
|
8
8
|
function InlineTOC({ items, className, ...props }) {
|
|
9
9
|
const t = useTranslations({ note: "inline table of contents" });
|
|
10
10
|
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
@@ -24,5 +24,4 @@ function InlineTOC({ items, className, ...props }) {
|
|
|
24
24
|
}) })]
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { InlineTOC };
|
|
@@ -82,5 +82,4 @@ export declare function SidebarCollapseTrigger(props: ComponentProps<'button'>):
|
|
|
82
82
|
* scroll to the element if `active` is true
|
|
83
83
|
*/
|
|
84
84
|
export declare function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>): void;
|
|
85
|
-
//#endregion
|
|
86
85
|
export { base_d_exports };
|
|
@@ -14,7 +14,7 @@ import { useOnChange } from "fumadocs-core/utils/use-on-change";
|
|
|
14
14
|
import { ScrollArea } from "@base-ui/react/scroll-area";
|
|
15
15
|
import { useMediaQuery } from "fumadocs-core/utils/use-media-query";
|
|
16
16
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
17
|
-
|
|
17
|
+
// src/components/sidebar/base.tsx
|
|
18
18
|
var base_exports = /* @__PURE__ */ __exportAll({
|
|
19
19
|
SidebarCollapseTrigger: () => SidebarCollapseTrigger,
|
|
20
20
|
SidebarContent: () => SidebarContent,
|
|
@@ -300,5 +300,4 @@ function useAutoScroll(active, ref) {
|
|
|
300
300
|
ref
|
|
301
301
|
]);
|
|
302
302
|
}
|
|
303
|
-
//#endregion
|
|
304
303
|
export { SidebarCollapseTrigger, SidebarContent, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarProvider, SidebarSeparator, SidebarTrigger, SidebarViewport, base_exports, useAutoScroll, useFolder, useFolderDepth, useSidebar };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { base_d_exports } from "./base.js";
|
|
2
2
|
import { LinkItemType } from "../../layouts/shared/index.js";
|
|
3
3
|
import { HTMLAttributes } from "react";
|
|
4
|
-
//#region src/components/sidebar/link-item.d.ts
|
|
5
4
|
type InternalComponents = Pick<typeof base_d_exports, 'SidebarFolder' | 'SidebarFolderLink' | 'SidebarFolderContent' | 'SidebarFolderTrigger' | 'SidebarItem'>;
|
|
6
5
|
export declare function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem }: InternalComponents): ({ item, ...props }: HTMLAttributes<HTMLElement> & {
|
|
7
6
|
item: Exclude<LinkItemType, {
|
|
8
7
|
type: 'icon';
|
|
9
8
|
}>;
|
|
10
9
|
}) => import("react").JSX.Element;
|
|
11
|
-
|
|
10
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { isLinkItemActive } from "../../layouts/shared/index.js";
|
|
3
3
|
import { usePathname } from "fumadocs-core/framework";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/sidebar/link-item.tsx
|
|
6
6
|
function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem }) {
|
|
7
7
|
/**
|
|
8
8
|
* Render sidebar items from page tree
|
|
@@ -33,5 +33,4 @@ function createLinkItemRenderer({ SidebarFolder, SidebarFolderContent, SidebarFo
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
//#endregion
|
|
37
36
|
export { createLinkItemRenderer };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { base_d_exports } from "./base.js";
|
|
2
2
|
import { FC, ReactNode } from "react";
|
|
3
3
|
import * as PageTree from "fumadocs-core/page-tree";
|
|
4
|
-
//#region src/components/sidebar/page-tree.d.ts
|
|
5
4
|
export interface SidebarPageTreeComponents {
|
|
6
5
|
Item: FC<{
|
|
7
6
|
item: PageTree.Item;
|
|
@@ -16,4 +15,4 @@ export interface SidebarPageTreeComponents {
|
|
|
16
15
|
}
|
|
17
16
|
type InternalComponents = Pick<typeof base_d_exports, 'SidebarSeparator' | 'SidebarFolder' | 'SidebarFolderLink' | 'SidebarFolderContent' | 'SidebarFolderTrigger' | 'SidebarItem'>;
|
|
18
17
|
export declare function createPageTreeRenderer({ SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarSeparator, SidebarItem }: InternalComponents): (components: Partial<SidebarPageTreeComponents>) => import("react").JSX.Element;
|
|
19
|
-
|
|
18
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import { isActive } from "../../utils/urls.js";
|
|
|
3
3
|
import { usePathname } from "fumadocs-core/framework";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Fragment as Fragment$1, createContext, use, useMemo } from "react";
|
|
6
|
-
|
|
6
|
+
// src/components/sidebar/page-tree.tsx
|
|
7
7
|
const RendererContext = createContext(null);
|
|
8
8
|
function createPageTreeRenderer({ SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarSeparator, SidebarItem }) {
|
|
9
9
|
function renderList(nodes) {
|
|
@@ -65,5 +65,4 @@ function createPageTreeRenderer({ SidebarFolder, SidebarFolderContent, SidebarFo
|
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
//#endregion
|
|
69
68
|
export { createPageTreeRenderer };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LayoutTab } from "../../../layouts/shared/index.js";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
|
-
//#region src/components/sidebar/tabs/dropdown.d.ts
|
|
4
3
|
export type SidebarTabWithProps = LayoutTab;
|
|
5
4
|
/**
|
|
6
5
|
* Renders the given tabs as a dropdown per tabs group, one for each root folder on the
|
|
@@ -9,5 +8,4 @@ export type SidebarTabWithProps = LayoutTab;
|
|
|
9
8
|
export declare function SidebarTabsDropdown({ options, placeholder, ...props }: {
|
|
10
9
|
placeholder?: ReactNode;
|
|
11
10
|
options: LayoutTab[];
|
|
12
|
-
} & ComponentProps<'button'>): import("react").JSX.Element[];
|
|
13
|
-
//#endregion
|
|
11
|
+
} & ComponentProps<'button'>): import("react").JSX.Element[];
|
|
@@ -9,7 +9,7 @@ import { usePathname } from "fumadocs-core/framework";
|
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { Check, ChevronsUpDown } from "lucide-react";
|
|
11
11
|
import { useMemo, useState } from "react";
|
|
12
|
-
|
|
12
|
+
// src/components/sidebar/tabs/dropdown.tsx
|
|
13
13
|
/**
|
|
14
14
|
* Renders the given tabs as a dropdown per tabs group, one for each root folder on the
|
|
15
15
|
* current page's path, letting users switch between root folders of the same type.
|
|
@@ -83,5 +83,4 @@ function Dropdown({ options, placeholder, ...props }) {
|
|
|
83
83
|
})]
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
//#endregion
|
|
87
86
|
export { SidebarTabsDropdown };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { LayoutTab } from "../../../layouts/shared/index.js";
|
|
2
2
|
import * as PageTree from "fumadocs-core/page-tree";
|
|
3
|
-
//#region src/components/sidebar/tabs/index.d.ts
|
|
4
3
|
export type SidebarTab = LayoutTab;
|
|
5
4
|
export interface GetSidebarTabsOptions {
|
|
6
5
|
transform?: (option: SidebarTab, node: PageTree.Folder) => SidebarTab | null;
|
|
7
6
|
}
|
|
8
|
-
export declare function getSidebarTabs(tree: PageTree.Root, { transform }?: GetSidebarTabsOptions): SidebarTab[];
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare function getSidebarTabs(tree: PageTree.Root, { transform }?: GetSidebarTabsOptions): SidebarTab[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// src/components/sidebar/tabs/index.tsx
|
|
3
3
|
const defaultTransform = (option, node) => {
|
|
4
4
|
if (!node.icon) return option;
|
|
5
5
|
return {
|
|
@@ -42,5 +42,4 @@ function getFolderUrls(folder, output = /* @__PURE__ */ new Set()) {
|
|
|
42
42
|
}
|
|
43
43
|
return output;
|
|
44
44
|
}
|
|
45
|
-
//#endregion
|
|
46
45
|
export { getSidebarTabs };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
//#region src/components/steps.d.ts
|
|
3
2
|
export declare function Steps({ children }: {
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
}): import("react").JSX.Element;
|
|
6
5
|
export declare function Step({ children }: {
|
|
7
6
|
children: ReactNode;
|
|
8
|
-
}): import("react").JSX.Element;
|
|
9
|
-
//#endregion
|
|
7
|
+
}): import("react").JSX.Element;
|
package/dist/components/steps.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// src/components/steps.tsx
|
|
3
3
|
function Steps({ children }) {
|
|
4
4
|
return /* @__PURE__ */ jsx("div", {
|
|
5
5
|
className: "fd-steps",
|
|
@@ -12,5 +12,4 @@ function Step({ children }) {
|
|
|
12
12
|
children
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { Step, Steps };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Tabs as Tabs$1, TabsContent as TabsContent$1, TabsList as TabsList$1, TabsTrigger as TabsTrigger$1
|
|
1
|
+
import { Tabs as Tabs$1, TabsContent as TabsContent$1, TabsList as TabsList$1, TabsTrigger as TabsTrigger$1 } from "./ui/tabs.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
|
-
//#region src/components/tabs.d.ts
|
|
5
4
|
export interface TabsProps extends Omit<ComponentProps<typeof Tabs$1>, 'value' | 'onValueChange'> {
|
|
6
5
|
/**
|
|
7
6
|
* Use simple mode instead of advanced usage as documented in https://radix-ui.com/primitives/docs/components/tabs.
|
|
@@ -28,5 +27,4 @@ export interface TabProps extends Omit<ComponentProps<typeof TabsContent$1>, 'va
|
|
|
28
27
|
value?: string;
|
|
29
28
|
}
|
|
30
29
|
export declare function Tab({ value, ...props }: TabProps): React$1.JSX.Element;
|
|
31
|
-
export declare function TabsContent({ value, className, ...props }: ComponentProps<typeof TabsContent$1>): React$1.JSX.Element;
|
|
32
|
-
//#endregion
|
|
30
|
+
export declare function TabsContent({ value, className, ...props }: ComponentProps<typeof TabsContent$1>): React$1.JSX.Element;
|
package/dist/components/tabs.js
CHANGED
|
@@ -3,7 +3,7 @@ import { cn } from "../utils/cn.js";
|
|
|
3
3
|
import { Tabs as Tabs$1, TabsContent as TabsContent$1, TabsList as TabsList$1, TabsTrigger as TabsTrigger$1 } from "./ui/tabs.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { createContext, useContext, useEffect, useId, useMemo } from "react";
|
|
6
|
-
|
|
6
|
+
// src/components/tabs.tsx
|
|
7
7
|
const TabsContext = createContext(null);
|
|
8
8
|
function useTabContext() {
|
|
9
9
|
const ctx = useContext(TabsContext);
|
|
@@ -86,5 +86,4 @@ function useCollectionIndex() {
|
|
|
86
86
|
function escapeValue(v) {
|
|
87
87
|
return v.toLowerCase().replace(/\s/, "-");
|
|
88
88
|
}
|
|
89
|
-
//#endregion
|
|
90
89
|
export { Tab, Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { TOCEmpty } from "./default.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
import * as Primitive from "fumadocs-core/toc";
|
|
4
|
-
declare namespace block_d_exports {
|
|
5
|
-
export { TOCEmpty, TOCItem, TOCItems, TOCItemsProps };
|
|
6
|
-
}
|
|
7
4
|
export type TOCItemsProps = ComponentProps<'div'>;
|
|
8
|
-
export declare function TOCItems({
|
|
5
|
+
export declare function TOCItems({ className, children, ...props }: TOCItemsProps): import("react").JSX.Element;
|
|
9
6
|
export declare function TOCItem({ item, ...props }: Primitive.TOCItemProps & {
|
|
10
7
|
item: Primitive.TOCItemType;
|
|
11
8
|
}): import("react").JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { TOCEmpty, block_d_exports };
|
|
9
|
+
export { TOCEmpty };
|