fumadocs-ui 16.4.1 → 16.4.2
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/preset.css +2 -4
- package/dist/_virtual/rolldown_runtime.js +36 -0
- package/dist/components/accordion.d.ts +24 -7
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +65 -38
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/banner.d.ts +33 -22
- package/dist/components/banner.d.ts.map +1 -1
- package/dist/components/banner.js +63 -47
- package/dist/components/banner.js.map +1 -0
- package/dist/components/callout.d.ts +41 -17
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +57 -28
- package/dist/components/callout.js.map +1 -0
- package/dist/components/card.d.ts +19 -9
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +39 -8
- package/dist/components/card.js.map +1 -0
- package/dist/components/codeblock.d.ts +61 -40
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/codeblock.js +116 -58
- package/dist/components/codeblock.js.map +1 -0
- package/dist/components/dialog/search-algolia.d.ts +37 -23
- package/dist/components/dialog/search-algolia.d.ts.map +1 -1
- package/dist/components/dialog/search-algolia.js +64 -31
- package/dist/components/dialog/search-algolia.js.map +1 -0
- package/dist/components/dialog/search-default.d.ts +42 -27
- package/dist/components/dialog/search-default.d.ts.map +1 -1
- package/dist/components/dialog/search-default.js +64 -38
- package/dist/components/dialog/search-default.js.map +1 -0
- package/dist/components/dialog/search-orama.d.ts +41 -25
- package/dist/components/dialog/search-orama.d.ts.map +1 -1
- package/dist/components/dialog/search-orama.js +68 -35
- package/dist/components/dialog/search-orama.js.map +1 -0
- package/dist/components/dialog/search.d.ts +103 -64
- package/dist/components/dialog/search.d.ts.map +1 -1
- package/dist/components/dialog/search.js +264 -185
- package/dist/components/dialog/search.js.map +1 -0
- package/dist/components/dynamic-codeblock.d.ts +30 -19
- package/dist/components/dynamic-codeblock.d.ts.map +1 -1
- package/dist/components/dynamic-codeblock.js +60 -27
- package/dist/components/dynamic-codeblock.js.map +1 -0
- package/dist/components/files.d.ts +32 -16
- package/dist/components/files.d.ts.map +1 -1
- package/dist/components/files.js +40 -14
- package/dist/components/files.js.map +1 -0
- package/dist/components/github-info.d.ts +18 -7
- package/dist/components/github-info.d.ts.map +1 -1
- package/dist/components/github-info.js +63 -48
- package/dist/components/github-info.js.map +1 -0
- package/dist/components/heading.d.ts +11 -4
- package/dist/components/heading.d.ts.map +1 -1
- package/dist/components/heading.js +28 -8
- package/dist/components/heading.js.map +1 -0
- package/dist/components/image-zoom-CtfZieBH.css +80 -0
- package/dist/components/image-zoom-CtfZieBH.css.map +1 -0
- package/dist/components/image-zoom.d.ts +23 -14
- package/dist/components/image-zoom.d.ts.map +1 -1
- package/dist/components/image-zoom.js +32 -19
- package/dist/components/image-zoom.js.map +1 -0
- package/dist/components/image-zoom2.js +1 -0
- package/dist/components/inline-toc.d.ts +14 -6
- package/dist/components/inline-toc.d.ts.map +1 -1
- package/dist/components/inline-toc.js +28 -8
- package/dist/components/inline-toc.js.map +1 -0
- package/dist/components/sidebar/base.d.ts +102 -65
- package/dist/components/sidebar/base.d.ts.map +1 -1
- package/dist/components/sidebar/base.js +256 -180
- package/dist/components/sidebar/base.js.map +1 -0
- package/dist/components/sidebar/link-item.d.ts +23 -10
- package/dist/components/sidebar/link-item.d.ts.map +1 -1
- package/dist/components/sidebar/link-item.js +32 -12
- package/dist/components/sidebar/link-item.js.map +1 -0
- package/dist/components/sidebar/page-tree.d.ts +28 -17
- package/dist/components/sidebar/page-tree.d.ts.map +1 -1
- package/dist/components/sidebar/page-tree.js +57 -33
- package/dist/components/sidebar/page-tree.js.map +1 -0
- package/dist/components/sidebar/tabs/dropdown.d.ts +18 -9
- package/dist/components/sidebar/tabs/dropdown.d.ts.map +1 -1
- package/dist/components/sidebar/tabs/dropdown.js +75 -31
- package/dist/components/sidebar/tabs/dropdown.js.map +1 -0
- package/dist/components/sidebar/tabs/index.d.ts +24 -18
- package/dist/components/sidebar/tabs/index.d.ts.map +1 -1
- package/dist/components/sidebar/tabs/index.js +45 -45
- package/dist/components/sidebar/tabs/index.js.map +1 -0
- package/dist/components/steps.d.ts +16 -7
- package/dist/components/steps.d.ts.map +1 -1
- package/dist/components/steps.js +17 -5
- package/dist/components/steps.js.map +1 -0
- package/dist/components/tabs.d.ts +49 -28
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +88 -51
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/toc/clerk.d.ts +1 -2
- package/dist/components/toc/clerk.js +12 -1
- package/dist/components/toc/clerk.js.map +1 -0
- package/dist/components/toc/default.d.ts +1 -2
- package/dist/components/toc/default.js +12 -1
- package/dist/components/toc/default.js.map +1 -0
- package/dist/components/toc/index.d.ts +1 -2
- package/dist/components/toc/index.js +12 -1
- package/dist/components/toc/index.js.map +1 -0
- package/dist/components/type-table.d.ts +36 -29
- package/dist/components/type-table.d.ts.map +1 -1
- package/dist/components/type-table.js +106 -25
- package/dist/components/type-table.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +31 -7
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +40 -14
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/button.d.ts +12 -7
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +21 -18
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +12 -8
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +21 -11
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +8 -5
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +36 -9
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/popover.d.ts +6 -3
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +19 -6
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +7 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +33 -7
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +37 -19
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +75 -73
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/contexts/i18n.d.ts +1 -2
- package/dist/contexts/i18n.js +12 -1
- package/dist/contexts/i18n.js.map +1 -0
- package/dist/contexts/search.d.ts +7 -1
- package/dist/contexts/search.d.ts.map +1 -1
- package/dist/contexts/search.js +12 -1
- package/dist/contexts/search.js.map +1 -0
- package/dist/contexts/tree.d.ts +1 -2
- package/dist/contexts/tree.js +12 -1
- package/dist/contexts/tree.js.map +1 -0
- package/dist/i18n.d.ts +1 -2
- package/dist/i18n.js +3 -1
- package/dist/layouts/docs/client.d.ts +30 -13
- package/dist/layouts/docs/client.d.ts.map +1 -1
- package/dist/layouts/docs/client.js +61 -34
- package/dist/layouts/docs/client.js.map +1 -0
- package/dist/layouts/docs/index.d.ts +57 -33
- package/dist/layouts/docs/index.d.ts.map +1 -1
- package/dist/layouts/docs/index.js +178 -68
- package/dist/layouts/docs/index.js.map +1 -0
- package/dist/layouts/docs/page/client.d.ts +43 -21
- package/dist/layouts/docs/page/client.d.ts.map +1 -1
- package/dist/layouts/docs/page/client.js +213 -105
- package/dist/layouts/docs/page/client.js.map +1 -0
- package/dist/layouts/docs/page/index.d.ts +82 -46
- package/dist/layouts/docs/page/index.d.ts.map +1 -1
- package/dist/layouts/docs/page/index.js +98 -45
- package/dist/layouts/docs/page/index.js.map +1 -0
- package/dist/layouts/docs/sidebar.d.ts +57 -16
- package/dist/layouts/docs/sidebar.d.ts.map +1 -1
- package/dist/layouts/docs/sidebar.js +135 -82
- package/dist/layouts/docs/sidebar.js.map +1 -0
- package/dist/layouts/home/client.d.ts +18 -5
- package/dist/layouts/home/client.d.ts.map +1 -1
- package/dist/layouts/home/client.js +252 -103
- package/dist/layouts/home/client.js.map +1 -0
- package/dist/layouts/home/index.d.ts +15 -10
- package/dist/layouts/home/index.d.ts.map +1 -1
- package/dist/layouts/home/index.js +24 -7
- package/dist/layouts/home/index.js.map +1 -0
- package/dist/layouts/home/navbar.d.ts +13 -6
- package/dist/layouts/home/navbar.d.ts.map +1 -1
- package/dist/layouts/home/navbar.js +34 -12
- package/dist/layouts/home/navbar.js.map +1 -0
- package/dist/layouts/notebook/client.d.ts +44 -20
- package/dist/layouts/notebook/client.d.ts.map +1 -1
- package/dist/layouts/notebook/client.js +148 -93
- package/dist/layouts/notebook/client.js.map +1 -0
- package/dist/layouts/notebook/index.d.ts +34 -30
- package/dist/layouts/notebook/index.d.ts.map +1 -1
- package/dist/layouts/notebook/index.js +216 -90
- package/dist/layouts/notebook/index.js.map +1 -0
- package/dist/layouts/notebook/page/client.d.ts +43 -21
- package/dist/layouts/notebook/page/client.d.ts.map +1 -1
- package/dist/layouts/notebook/page/client.js +213 -105
- package/dist/layouts/notebook/page/client.js.map +1 -0
- package/dist/layouts/notebook/page/index.d.ts +82 -46
- package/dist/layouts/notebook/page/index.d.ts.map +1 -1
- package/dist/layouts/notebook/page/index.js +98 -45
- package/dist/layouts/notebook/page/index.js.map +1 -0
- package/dist/layouts/notebook/sidebar.d.ts +62 -20
- package/dist/layouts/notebook/sidebar.d.ts.map +1 -1
- package/dist/layouts/notebook/sidebar.js +130 -88
- package/dist/layouts/notebook/sidebar.js.map +1 -0
- package/dist/layouts/shared/index.d.ts +62 -50
- package/dist/layouts/shared/index.d.ts.map +1 -1
- package/dist/layouts/shared/index.js +36 -20
- package/dist/layouts/shared/index.js.map +1 -0
- package/dist/layouts/shared/language-toggle.d.ts +9 -4
- package/dist/layouts/shared/language-toggle.d.ts.map +1 -1
- package/dist/layouts/shared/language-toggle.js +44 -21
- package/dist/layouts/shared/language-toggle.js.map +1 -0
- package/dist/layouts/shared/search-toggle.d.ts +20 -8
- package/dist/layouts/shared/search-toggle.d.ts.map +1 -1
- package/dist/layouts/shared/search-toggle.js +53 -24
- package/dist/layouts/shared/search-toggle.js.map +1 -0
- package/dist/layouts/shared/theme-toggle.d.ts +13 -4
- package/dist/layouts/shared/theme-toggle.d.ts.map +1 -1
- package/dist/layouts/shared/theme-toggle.js +58 -34
- package/dist/layouts/shared/theme-toggle.js.map +1 -0
- package/dist/mdx.d.ts +34 -29
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +68 -34
- package/dist/mdx.js.map +1 -0
- package/dist/mdx.server.d.ts +9 -5
- package/dist/mdx.server.d.ts.map +1 -1
- package/dist/mdx.server.js +21 -13
- package/dist/mdx.server.js.map +1 -0
- package/dist/og.d.ts +1 -2
- package/dist/og.js +3 -1
- package/dist/page.d.ts +30 -20
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +34 -18
- package/dist/page.js.map +1 -0
- package/dist/provider/base.d.ts +43 -33
- package/dist/provider/base.d.ts.map +1 -1
- package/dist/provider/base.js +37 -17
- package/dist/provider/base.js.map +1 -0
- package/dist/provider/next.d.ts +20 -12
- package/dist/provider/next.d.ts.map +1 -1
- package/dist/provider/next.js +19 -5
- package/dist/provider/next.js.map +1 -0
- package/dist/provider/react-router.d.ts +20 -12
- package/dist/provider/react-router.d.ts.map +1 -1
- package/dist/provider/react-router.js +19 -5
- package/dist/provider/react-router.js.map +1 -0
- package/dist/provider/tanstack.d.ts +20 -12
- package/dist/provider/tanstack.d.ts.map +1 -1
- package/dist/provider/tanstack.js +19 -5
- package/dist/provider/tanstack.js.map +1 -0
- package/dist/provider/waku.d.ts +20 -12
- package/dist/provider/waku.d.ts.map +1 -1
- package/dist/provider/waku.js +19 -5
- package/dist/provider/waku.js.map +1 -0
- package/dist/style.css +11 -13
- package/dist/utils/use-copy-button.d.ts +1 -2
- package/dist/utils/use-copy-button.js +3 -1
- package/dist/utils/use-footer-items.d.ts +1 -2
- package/dist/utils/use-footer-items.js +3 -1
- package/dist/utils/use-is-scroll-top.d.ts +1 -2
- package/dist/utils/use-is-scroll-top.js +3 -1
- package/package.json +51 -52
- package/dist/components/toc/clerk.d.ts.map +0 -1
- package/dist/components/toc/default.d.ts.map +0 -1
- package/dist/components/toc/index.d.ts.map +0 -1
- package/dist/contexts/i18n.d.ts.map +0 -1
- package/dist/contexts/tree.d.ts.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/og.d.ts.map +0 -1
- package/dist/utils/use-copy-button.d.ts.map +0 -1
- package/dist/utils/use-footer-items.d.ts.map +0 -1
- package/dist/utils/use-is-scroll-top.d.ts.map +0 -1
package/dist/mdx.d.ts
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Card, Cards } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Callout, CalloutContainer, CalloutDescription, CalloutTitle } from "./components/callout.js";
|
|
2
|
+
import { Card, Cards } from "./components/card.js";
|
|
3
|
+
import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from "./components/codeblock.js";
|
|
4
|
+
import { createRelativeLink as createRelativeLink$1 } from "./mdx.server.js";
|
|
5
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
6
|
+
import { AnchorHTMLAttributes, FC, HTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from "react";
|
|
7
|
+
|
|
8
|
+
//#region src/mdx.d.ts
|
|
5
9
|
declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
|
|
6
|
-
|
|
7
|
-
}):
|
|
8
|
-
declare function Table(props: TableHTMLAttributes<HTMLTableElement>):
|
|
10
|
+
sizes?: string;
|
|
11
|
+
}): react_jsx_runtime4.JSX.Element;
|
|
12
|
+
declare function Table(props: TableHTMLAttributes<HTMLTableElement>): react_jsx_runtime4.JSX.Element;
|
|
9
13
|
declare const defaultMdxComponents: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
CodeBlockTab: typeof CodeBlockTab;
|
|
15
|
+
CodeBlockTabs: typeof CodeBlockTabs;
|
|
16
|
+
CodeBlockTabsList: typeof CodeBlockTabsList;
|
|
17
|
+
CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
|
|
18
|
+
pre: (props: HTMLAttributes<HTMLPreElement>) => react_jsx_runtime4.JSX.Element;
|
|
19
|
+
Card: typeof Card;
|
|
20
|
+
Cards: typeof Cards;
|
|
21
|
+
a: FC<AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
22
|
+
img: typeof Image;
|
|
23
|
+
h1: (props: HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime4.JSX.Element;
|
|
24
|
+
h2: (props: HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime4.JSX.Element;
|
|
25
|
+
h3: (props: HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime4.JSX.Element;
|
|
26
|
+
h4: (props: HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime4.JSX.Element;
|
|
27
|
+
h5: (props: HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime4.JSX.Element;
|
|
28
|
+
h6: (props: HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime4.JSX.Element;
|
|
29
|
+
table: typeof Table;
|
|
30
|
+
Callout: typeof Callout;
|
|
31
|
+
CalloutContainer: typeof CalloutContainer;
|
|
32
|
+
CalloutTitle: typeof CalloutTitle;
|
|
33
|
+
CalloutDescription: typeof CalloutDescription;
|
|
30
34
|
};
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
declare const createRelativeLink: typeof createRelativeLink$1;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { createRelativeLink, defaultMdxComponents as default };
|
|
33
38
|
//# sourceMappingURL=mdx.d.ts.map
|
package/dist/mdx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","names":[],"sources":["../src/mdx.tsx"],"sourcesContent":[],"mappings":";;;;;;;;iBAsBS,KAAA,QACA,kBAAkB;;IAExB,kBAAA,CAAA,GAAA,CAAA;iBAYM,KAAA,QAAa,oBAAoB,oBAAiB,kBAAA,CAAA,GAAA,CAAA;AAjB3B,cAyB1B,oBAvBQ,EAAA;EACa,YAAA,EAAA,mBAAA;EAAlB,aAAA,EAAA,oBAAA;EAEN,iBAAA,EAAA,wBAAA;EAAA,oBAAA,EAAA,2BAAA;EAYM,GAAA,EAAA,CAAA,KAAK,EAaC,cAbD,CAagB,cAbhB,CAAA,EAAA,GAa+B,kBAAA,CAAA,GAAA,CAAA,OAb/B;EAA4B,IAAA,EAAA,WAAA;EAApB,KAAA,EAAA,YAAA;EAAqC,CAAA,EAoB9C,EApB8C,CAoB3C,oBApB2C,CAoBtB,iBApBsB,CAAA,CAAA;EAAA,GAAA,EAAA,YAAA;EAQrD,EAAA,EAAA,CAAA,KAAA,EAcQ,cAWb,CAX4B,kBAW5B,CAAA,EAAA,GAX+C,kBAAA,CAAA,GAAA,CAAA,OAW/C;cAVa,eAAe,wBAAmB,kBAAA,CAAA,GAAA,CAAA;cAClC,eAAe,wBAAmB,kBAAA,CAAA,GAAA,CAAA;cAClC,eAAe,wBAAmB,kBAAA,CAAA,GAAA,CAAA;cAClC,eAAe,wBAAmB,kBAAA,CAAA,GAAA,CAAA;EAblB,EAAA,EAAA,CAAA,KAAA,EAchB,cAdgB,CAcD,kBAdC,CAAA,EAAA,GAckB,kBAAA,CAAA,GAAA,CAAA,OAdlB;EAAf,KAAA,EAAA,YAAA;EAA8B,OAAA,EAAA,cAAA;;;EAOR,kBAAA,EAAA,yBAAA;CAArB;AAAH,cAeA,kBAfA,EAAA,OAiBZ,oBAjBY"}
|
package/dist/mdx.js
CHANGED
|
@@ -1,40 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { cn } from
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { Card, Cards } from "./components/card.js";
|
|
2
|
+
import { Callout, CalloutContainer, CalloutDescription, CalloutTitle } from "./components/callout.js";
|
|
3
|
+
import { Heading } from "./components/heading.js";
|
|
4
|
+
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre } from "./components/codeblock.js";
|
|
5
|
+
import Link from "fumadocs-core/link";
|
|
6
|
+
import { Image } from "fumadocs-core/framework";
|
|
7
|
+
import { cn } from "@fumadocs/ui/cn";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region src/mdx.tsx
|
|
11
|
+
function Image$1(props) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Image, {
|
|
13
|
+
sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",
|
|
14
|
+
...props,
|
|
15
|
+
src: props.src,
|
|
16
|
+
className: cn("rounded-lg", props.className)
|
|
17
|
+
});
|
|
11
18
|
}
|
|
12
19
|
function Table(props) {
|
|
13
|
-
|
|
20
|
+
return /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "relative overflow-auto prose-no-margin my-6",
|
|
22
|
+
children: /* @__PURE__ */ jsx("table", { ...props })
|
|
23
|
+
});
|
|
14
24
|
}
|
|
15
25
|
const defaultMdxComponents = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
CodeBlockTab,
|
|
27
|
+
CodeBlockTabs,
|
|
28
|
+
CodeBlockTabsList,
|
|
29
|
+
CodeBlockTabsTrigger,
|
|
30
|
+
pre: (props) => /* @__PURE__ */ jsx(CodeBlock, {
|
|
31
|
+
...props,
|
|
32
|
+
children: /* @__PURE__ */ jsx(Pre, { children: props.children })
|
|
33
|
+
}),
|
|
34
|
+
Card,
|
|
35
|
+
Cards,
|
|
36
|
+
a: Link,
|
|
37
|
+
img: Image$1,
|
|
38
|
+
h1: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
39
|
+
as: "h1",
|
|
40
|
+
...props
|
|
41
|
+
}),
|
|
42
|
+
h2: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
43
|
+
as: "h2",
|
|
44
|
+
...props
|
|
45
|
+
}),
|
|
46
|
+
h3: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
47
|
+
as: "h3",
|
|
48
|
+
...props
|
|
49
|
+
}),
|
|
50
|
+
h4: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
51
|
+
as: "h4",
|
|
52
|
+
...props
|
|
53
|
+
}),
|
|
54
|
+
h5: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
55
|
+
as: "h5",
|
|
56
|
+
...props
|
|
57
|
+
}),
|
|
58
|
+
h6: (props) => /* @__PURE__ */ jsx(Heading, {
|
|
59
|
+
as: "h6",
|
|
60
|
+
...props
|
|
61
|
+
}),
|
|
62
|
+
table: Table,
|
|
63
|
+
Callout,
|
|
64
|
+
CalloutContainer,
|
|
65
|
+
CalloutTitle,
|
|
66
|
+
CalloutDescription
|
|
36
67
|
};
|
|
37
|
-
|
|
38
|
-
|
|
68
|
+
const createRelativeLink = () => {
|
|
69
|
+
throw new Error("`createRelativeLink` is only supported in Node.js environment");
|
|
39
70
|
};
|
|
40
|
-
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { createRelativeLink, defaultMdxComponents as default };
|
|
74
|
+
//# sourceMappingURL=mdx.js.map
|
package/dist/mdx.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx.js","names":["Image","FrameworkImage","createRelativeLink: typeof import('./mdx.server').createRelativeLink"],"sources":["../src/mdx.tsx"],"sourcesContent":["import Link from 'fumadocs-core/link';\nimport type {\n AnchorHTMLAttributes,\n FC,\n HTMLAttributes,\n ImgHTMLAttributes,\n TableHTMLAttributes,\n} from 'react';\nimport { Image as FrameworkImage } from 'fumadocs-core/framework';\nimport { Card, Cards } from '@/components/card';\nimport { Callout, CalloutContainer, CalloutDescription, CalloutTitle } from '@/components/callout';\nimport { Heading } from '@/components/heading';\nimport { cn } from '@fumadocs/ui/cn';\nimport {\n CodeBlock,\n CodeBlockTab,\n CodeBlockTabs,\n CodeBlockTabsList,\n CodeBlockTabsTrigger,\n Pre,\n} from '@/components/codeblock';\n\nfunction Image(\n props: ImgHTMLAttributes<HTMLImageElement> & {\n sizes?: string;\n },\n) {\n return (\n <FrameworkImage\n sizes=\"(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px\"\n {...props}\n src={props.src as unknown as string}\n className={cn('rounded-lg', props.className)}\n />\n );\n}\n\nfunction Table(props: TableHTMLAttributes<HTMLTableElement>) {\n return (\n <div className=\"relative overflow-auto prose-no-margin my-6\">\n <table {...props} />\n </div>\n );\n}\n\nconst defaultMdxComponents = {\n CodeBlockTab,\n CodeBlockTabs,\n CodeBlockTabsList,\n CodeBlockTabsTrigger,\n pre: (props: HTMLAttributes<HTMLPreElement>) => (\n <CodeBlock {...props}>\n <Pre>{props.children}</Pre>\n </CodeBlock>\n ),\n Card,\n Cards,\n a: Link as FC<AnchorHTMLAttributes<HTMLAnchorElement>>,\n img: Image,\n h1: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h1\" {...props} />,\n h2: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h2\" {...props} />,\n h3: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h3\" {...props} />,\n h4: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h4\" {...props} />,\n h5: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h5\" {...props} />,\n h6: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h6\" {...props} />,\n table: Table,\n Callout,\n CalloutContainer,\n CalloutTitle,\n CalloutDescription,\n};\n\nexport const createRelativeLink: typeof import('./mdx.server').createRelativeLink = () => {\n throw new Error('`createRelativeLink` is only supported in Node.js environment');\n};\n\nexport { defaultMdxComponents as default };\n"],"mappings":";;;;;;;;;;AAsBA,SAASA,QACP,OAGA;AACA,QACE,oBAACC;EACC,OAAM;EACN,GAAI;EACJ,KAAK,MAAM;EACX,WAAW,GAAG,cAAc,MAAM,UAAU;GAC5C;;AAIN,SAAS,MAAM,OAA8C;AAC3D,QACE,oBAAC;EAAI,WAAU;YACb,oBAAC,WAAM,GAAI,QAAS;GAChB;;AAIV,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA,MAAM,UACJ,oBAAC;EAAU,GAAI;YACb,oBAAC,iBAAK,MAAM,WAAe;GACjB;CAEd;CACA;CACA,GAAG;CACH,KAAKD;CACL,KAAK,UAA8C,oBAAC;EAAQ,IAAG;EAAK,GAAI;GAAS;CACjF,KAAK,UAA8C,oBAAC;EAAQ,IAAG;EAAK,GAAI;GAAS;CACjF,KAAK,UAA8C,oBAAC;EAAQ,IAAG;EAAK,GAAI;GAAS;CACjF,KAAK,UAA8C,oBAAC;EAAQ,IAAG;EAAK,GAAI;GAAS;CACjF,KAAK,UAA8C,oBAAC;EAAQ,IAAG;EAAK,GAAI;GAAS;CACjF,KAAK,UAA8C,oBAAC;EAAQ,IAAG;EAAK,GAAI;GAAS;CACjF,OAAO;CACP;CACA;CACA;CACA;CACD;AAED,MAAaE,2BAA6E;AACxF,OAAM,IAAI,MAAM,gEAAgE"}
|
package/dist/mdx.server.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import defaultMdxComponents from "./mdx.js";
|
|
2
|
+
import { ComponentProps, FC } from "react";
|
|
3
|
+
import { LoaderConfig, LoaderOutput, Page } from "fumadocs-core/source";
|
|
4
|
+
|
|
5
|
+
//#region src/mdx.server.d.ts
|
|
6
|
+
|
|
4
7
|
/**
|
|
5
8
|
* Extend the default Link component to resolve relative file paths in `href`.
|
|
6
9
|
*
|
|
@@ -8,6 +11,7 @@ import defaultMdxComponents from './mdx.js';
|
|
|
8
11
|
* @param source the source object
|
|
9
12
|
* @param OverrideLink The component to override from
|
|
10
13
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
declare function createRelativeLink<C extends LoaderConfig>(source: LoaderOutput<C>, page: Page, OverrideLink?: FC<ComponentProps<'a'>>): FC<ComponentProps<'a'>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { createRelativeLink, defaultMdxComponents as default };
|
|
13
17
|
//# sourceMappingURL=mdx.server.d.ts.map
|
package/dist/mdx.server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.server.d.ts","
|
|
1
|
+
{"version":3,"file":"mdx.server.d.ts","names":[],"sources":["../src/mdx.server.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAWA;;;;;AAGmB,iBAHH,kBAGG,CAAA,UAH0B,YAG1B,CAAA,CAAA,MAAA,EAFT,YAES,CAFI,CAEJ,CAAA,EAAA,IAAA,EADX,IACW,EAAA,YAAA,CAAA,EAAH,EAAG,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAChB,EADgB,CACb,cADa,CAAA,GAAA,CAAA,CAAA"}
|
package/dist/mdx.server.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import defaultMdxComponents from "./mdx.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/mdx.server.tsx
|
|
3
5
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
* Extend the default Link component to resolve relative file paths in `href`.
|
|
7
|
+
*
|
|
8
|
+
* @param page the current page
|
|
9
|
+
* @param source the source object
|
|
10
|
+
* @param OverrideLink The component to override from
|
|
11
|
+
*/
|
|
12
|
+
function createRelativeLink(source, page, OverrideLink = defaultMdxComponents.a) {
|
|
13
|
+
return async function RelativeLink({ href, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(OverrideLink, {
|
|
15
|
+
href: href ? source.resolveHref(href, page) : href,
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
};
|
|
14
19
|
}
|
|
15
|
-
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { createRelativeLink, defaultMdxComponents as default };
|
|
23
|
+
//# sourceMappingURL=mdx.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx.server.js","names":[],"sources":["../src/mdx.server.tsx"],"sourcesContent":["import type { LoaderConfig, LoaderOutput, Page } from 'fumadocs-core/source';\nimport type { ComponentProps, FC } from 'react';\nimport defaultMdxComponents from '@/mdx';\n\n/**\n * Extend the default Link component to resolve relative file paths in `href`.\n *\n * @param page the current page\n * @param source the source object\n * @param OverrideLink The component to override from\n */\nexport function createRelativeLink<C extends LoaderConfig>(\n source: LoaderOutput<C>,\n page: Page,\n OverrideLink: FC<ComponentProps<'a'>> = defaultMdxComponents.a,\n): FC<ComponentProps<'a'>> {\n return async function RelativeLink({ href, ...props }) {\n return <OverrideLink href={href ? source.resolveHref(href, page) : href} {...props} />;\n };\n}\n\nexport { defaultMdxComponents as default };\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,mBACd,QACA,MACA,eAAwC,qBAAqB,GACpC;AACzB,QAAO,eAAe,aAAa,EAAE,MAAM,GAAG,SAAS;AACrD,SAAO,oBAAC;GAAa,MAAM,OAAO,OAAO,YAAY,MAAM,KAAK,GAAG;GAAM,GAAI;IAAS"}
|
package/dist/og.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
//# sourceMappingURL=og.d.ts.map
|
|
1
|
+
export * from "@fumadocs/ui/og/next";
|
package/dist/og.js
CHANGED
package/dist/page.d.ts
CHANGED
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { PageBreadcrumb, PageLastUpdate } from "./layouts/docs/page/client.js";
|
|
2
|
+
import { DocsBody, DocsDescription, DocsPageProps as DocsPageProps$1, DocsTitle, EditOnGitHub } from "./layouts/docs/page/index.js";
|
|
3
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
4
|
+
import { ComponentProps } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/page.d.ts
|
|
4
7
|
interface EditOnGitHubOptions extends Omit<ComponentProps<'a'>, 'href' | 'children'> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
owner: string;
|
|
9
|
+
repo: string;
|
|
10
|
+
/**
|
|
11
|
+
* SHA or ref (branch or tag) name.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue main
|
|
14
|
+
*/
|
|
15
|
+
sha?: string;
|
|
16
|
+
/**
|
|
17
|
+
* File path in the repo
|
|
18
|
+
*/
|
|
19
|
+
path: string;
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
interface DocsPageProps extends DocsPageProps$1 {
|
|
22
|
+
editOnGithub?: EditOnGitHubOptions;
|
|
23
|
+
lastUpdate?: Date | string | number;
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
* For separate MDX page
|
|
24
27
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
declare function withArticle(props: ComponentProps<'main'>): react_jsx_runtime15.JSX.Element;
|
|
29
|
+
declare function DocsPage({
|
|
30
|
+
lastUpdate,
|
|
31
|
+
editOnGithub,
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}: DocsPageProps): react_jsx_runtime15.JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, PageBreadcrumb, PageLastUpdate, withArticle };
|
|
27
37
|
//# sourceMappingURL=page.d.ts.map
|
package/dist/page.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","
|
|
1
|
+
{"version":3,"file":"page.d.ts","names":[],"sources":["../src/page.tsx"],"sourcesContent":[],"mappings":";;;;;;UAkBU,mBAAA,SAA4B,KAAK;;;EAAjC;AAiBV;;;;EAAyD,GAAA,CAAA,EAAA,MAAA;EAQzC;AAQhB;;EAAuC,IAAA,EAAA,MAAA;;AAAoC,UAhB1D,aAAA,SAAsB,eAgBoC,CAAA;EAAa,YAAA,CAAA,EAfvE,mBAeuE;EAAA,UAAA,CAAA,EAdzE,IAcyE,GAAA,MAAA,GAAA,MAAA;;;;;iBARxE,WAAA,QAAmB,yBAAsB,mBAAA,CAAA,GAAA,CAAA;iBAQzC,QAAA;;;;;GAA2D,gBAAa,mBAAA,CAAA,GAAA,CAAA"}
|
package/dist/page.js
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
|
|
3
|
+
import { LayoutContext } from "./layouts/docs/client.js";
|
|
4
|
+
import { PageBreadcrumb, PageLastUpdate } from "./layouts/docs/page/client.js";
|
|
5
|
+
import { DocsBody, DocsDescription, DocsTitle, EditOnGitHub, page_exports } from "./layouts/docs/page/index.js";
|
|
6
|
+
import { page_exports as page_exports$1 } from "./layouts/notebook/page/index.js";
|
|
7
|
+
import { cn } from "@fumadocs/ui/cn";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { use } from "react";
|
|
10
|
+
|
|
11
|
+
//#region src/page.tsx
|
|
10
12
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
* For separate MDX page
|
|
14
|
+
*/
|
|
15
|
+
function withArticle(props) {
|
|
16
|
+
return /* @__PURE__ */ jsx("main", {
|
|
17
|
+
...props,
|
|
18
|
+
className: cn("w-full max-w-[1400px] mx-auto px-4 py-12", props.className),
|
|
19
|
+
children: /* @__PURE__ */ jsx("article", {
|
|
20
|
+
className: "prose",
|
|
21
|
+
children: props.children
|
|
22
|
+
})
|
|
23
|
+
});
|
|
15
24
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
function DocsPage({ lastUpdate, editOnGithub, children, ...props }) {
|
|
26
|
+
const { DocsPage: DocsPage$1, EditOnGitHub: EditOnGitHub$1, PageLastUpdate: PageLastUpdate$1 } = use(LayoutContext) ? page_exports : page_exports$1;
|
|
27
|
+
return /* @__PURE__ */ jsxs(DocsPage$1, {
|
|
28
|
+
...props,
|
|
29
|
+
children: [children, /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: "flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden",
|
|
31
|
+
children: [editOnGithub && /* @__PURE__ */ jsx(EditOnGitHub$1, { href: `https://github.com/${editOnGithub.owner}/${editOnGithub.repo}/blob/${editOnGithub.sha}/${editOnGithub.path.startsWith("/") ? editOnGithub.path.slice(1) : editOnGithub.path}` }), lastUpdate && /* @__PURE__ */ jsx(PageLastUpdate$1, { date: new Date(lastUpdate) })]
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
22
34
|
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, PageBreadcrumb, PageLastUpdate, withArticle };
|
|
38
|
+
//# sourceMappingURL=page.js.map
|
package/dist/page.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","names":["Docs","Notebook","DocsPage","EditOnGitHub","PageLastUpdate"],"sources":["../src/page.tsx"],"sourcesContent":["'use client';\nimport { type ComponentProps, use } from 'react';\nimport { cn } from '@fumadocs/ui/cn';\nimport * as Docs from './layouts/docs/page';\nimport * as Notebook from './layouts/notebook/page';\nimport { LayoutContext } from './layouts/docs/client';\n\n// TODO: remove this compat layer on v17\n\nexport {\n DocsDescription,\n DocsTitle,\n EditOnGitHub,\n DocsBody,\n PageBreadcrumb,\n PageLastUpdate,\n} from './layouts/docs/page';\n\ninterface EditOnGitHubOptions extends Omit<ComponentProps<'a'>, 'href' | 'children'> {\n owner: string;\n repo: string;\n\n /**\n * SHA or ref (branch or tag) name.\n *\n * @defaultValue main\n */\n sha?: string;\n\n /**\n * File path in the repo\n */\n path: string;\n}\n\nexport interface DocsPageProps extends Docs.DocsPageProps {\n editOnGithub?: EditOnGitHubOptions;\n lastUpdate?: Date | string | number;\n}\n\n/**\n * For separate MDX page\n */\nexport function withArticle(props: ComponentProps<'main'>) {\n return (\n <main {...props} className={cn('w-full max-w-[1400px] mx-auto px-4 py-12', props.className)}>\n <article className=\"prose\">{props.children}</article>\n </main>\n );\n}\n\nexport function DocsPage({ lastUpdate, editOnGithub, children, ...props }: DocsPageProps) {\n const docsLayoutCtx = use(LayoutContext);\n const { DocsPage, EditOnGitHub, PageLastUpdate } = docsLayoutCtx ? Docs : Notebook;\n\n return (\n <DocsPage {...props}>\n {children}\n <div className=\"flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden\">\n {editOnGithub && (\n <EditOnGitHub\n href={`https://github.com/${editOnGithub.owner}/${editOnGithub.repo}/blob/${editOnGithub.sha}/${editOnGithub.path.startsWith('/') ? editOnGithub.path.slice(1) : editOnGithub.path}`}\n />\n )}\n {lastUpdate && <PageLastUpdate date={new Date(lastUpdate)} />}\n </div>\n </DocsPage>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA2CA,SAAgB,YAAY,OAA+B;AACzD,QACE,oBAAC;EAAK,GAAI;EAAO,WAAW,GAAG,4CAA4C,MAAM,UAAU;YACzF,oBAAC;GAAQ,WAAU;aAAS,MAAM;IAAmB;GAChD;;AAIX,SAAgB,SAAS,EAAE,YAAY,cAAc,UAAU,GAAG,SAAwB;CAExF,MAAM,EAAE,sBAAU,8BAAc,qCADV,IAAI,cAAc,GAC2BA,eAAOC;AAE1E,QACE,qBAACC;EAAS,GAAI;aACX,UACD,qBAAC;GAAI,WAAU;cACZ,gBACC,oBAACC,kBACC,MAAM,sBAAsB,aAAa,MAAM,GAAG,aAAa,KAAK,QAAQ,aAAa,IAAI,GAAG,aAAa,KAAK,WAAW,IAAI,GAAG,aAAa,KAAK,MAAM,EAAE,GAAG,aAAa,SAC9K,EAEH,cAAc,oBAACC,oBAAe,MAAM,IAAI,KAAK,WAAW,GAAI;IACzD;GACG"}
|
package/dist/provider/base.d.ts
CHANGED
|
@@ -1,40 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { DefaultSearchDialogProps } from "../components/dialog/search-default.js";
|
|
2
|
+
import * as react_jsx_runtime47 from "react/jsx-runtime";
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
4
|
+
import { I18nProviderProps } from "@fumadocs/ui/contexts/i18n";
|
|
5
|
+
import { SearchProviderProps } from "@fumadocs/ui/contexts/search";
|
|
6
|
+
import { ThemeProvider } from "next-themes";
|
|
7
|
+
|
|
8
|
+
//#region src/provider/base.d.ts
|
|
6
9
|
interface SearchOptions extends Omit<SearchProviderProps, 'options' | 'children'> {
|
|
7
|
-
|
|
10
|
+
options?: Partial<DefaultSearchDialogProps>;
|
|
11
|
+
/**
|
|
12
|
+
* Enable search functionality
|
|
13
|
+
*
|
|
14
|
+
* @defaultValue `true`
|
|
15
|
+
*/
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface RootProviderProps {
|
|
19
|
+
/**
|
|
20
|
+
* `dir` option for Radix UI
|
|
21
|
+
*/
|
|
22
|
+
dir?: 'rtl' | 'ltr';
|
|
23
|
+
/**
|
|
24
|
+
* @remarks `SearchProviderProps`
|
|
25
|
+
*/
|
|
26
|
+
search?: Partial<SearchOptions>;
|
|
27
|
+
/**
|
|
28
|
+
* Customise options of `next-themes`
|
|
29
|
+
*/
|
|
30
|
+
theme?: Partial<ComponentPropsWithoutRef<typeof ThemeProvider>> & {
|
|
8
31
|
/**
|
|
9
|
-
* Enable
|
|
32
|
+
* Enable `next-themes`
|
|
10
33
|
*
|
|
11
|
-
* @defaultValue
|
|
34
|
+
* @defaultValue true
|
|
12
35
|
*/
|
|
13
36
|
enabled?: boolean;
|
|
37
|
+
};
|
|
38
|
+
i18n?: Omit<I18nProviderProps, 'children'>;
|
|
39
|
+
children?: ReactNode;
|
|
14
40
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Customise options of `next-themes`
|
|
26
|
-
*/
|
|
27
|
-
theme?: Partial<ComponentPropsWithoutRef<typeof ThemeProvider>> & {
|
|
28
|
-
/**
|
|
29
|
-
* Enable `next-themes`
|
|
30
|
-
*
|
|
31
|
-
* @defaultValue true
|
|
32
|
-
*/
|
|
33
|
-
enabled?: boolean;
|
|
34
|
-
};
|
|
35
|
-
i18n?: Omit<I18nProviderProps, 'children'>;
|
|
36
|
-
children?: ReactNode;
|
|
37
|
-
}
|
|
38
|
-
export declare function RootProvider({ children, dir, theme, search, i18n, }: RootProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
export {};
|
|
41
|
+
declare function RootProvider({
|
|
42
|
+
children,
|
|
43
|
+
dir,
|
|
44
|
+
theme,
|
|
45
|
+
search,
|
|
46
|
+
i18n
|
|
47
|
+
}: RootProviderProps): react_jsx_runtime47.JSX.Element;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { RootProvider, RootProviderProps };
|
|
40
50
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","
|
|
1
|
+
{"version":3,"file":"base.d.ts","names":[],"sources":["../../src/provider/base.tsx"],"sourcesContent":[],"mappings":";;;;;;;;UASU,aAAA,SAAsB,KAAK;YACzB,QAAQ;;AAHoE;;;;EAExD,OAAA,CAAA,EAAA,OAAA;;AAWf,UAAA,iBAAA,CAAiB;EASf;;;EAKD,GAAA,CAAA,EAAA,KAAA,GAAA,KAAA;EAAR;;;EAWG,MAAA,CAAA,EAhBF,OAgBE,CAhBM,aAgBN,CAAA;EAAS;AAKtB;;EAEE,KAAA,CAAA,EAlBQ,OAkBR,CAlBgB,wBAkBhB,CAAA,OAlBgD,aAkBhD,CAAA,CAAA,GAAA;IACA;;;;;IAGkB,OAAA,CAAA,EAAA,OAAA;;SAbX,KAAK;aAED;;iBAKG,YAAA;;;;;;GAMb,oBAAiB,mBAAA,CAAA,GAAA,CAAA"}
|
package/dist/provider/base.js
CHANGED
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { lazy } from "react";
|
|
5
|
+
import { I18nProvider } from "@fumadocs/ui/contexts/i18n";
|
|
6
|
+
import { SearchProvider } from "@fumadocs/ui/contexts/search";
|
|
7
|
+
import { DirectionProvider } from "@radix-ui/react-direction";
|
|
8
|
+
import { ThemeProvider } from "next-themes";
|
|
9
|
+
|
|
10
|
+
//#region src/provider/base.tsx
|
|
11
|
+
const DefaultSearchDialog = lazy(() => import("../components/dialog/search-default.js"));
|
|
12
|
+
function RootProvider({ children, dir = "ltr", theme = {}, search, i18n }) {
|
|
13
|
+
let body = children;
|
|
14
|
+
if (search?.enabled !== false) body = /* @__PURE__ */ jsx(SearchProvider, {
|
|
15
|
+
SearchDialog: DefaultSearchDialog,
|
|
16
|
+
...search,
|
|
17
|
+
children: body
|
|
18
|
+
});
|
|
19
|
+
if (theme?.enabled !== false) body = /* @__PURE__ */ jsx(ThemeProvider, {
|
|
20
|
+
attribute: "class",
|
|
21
|
+
defaultTheme: "system",
|
|
22
|
+
enableSystem: true,
|
|
23
|
+
disableTransitionOnChange: true,
|
|
24
|
+
...theme,
|
|
25
|
+
children: body
|
|
26
|
+
});
|
|
27
|
+
if (i18n) body = /* @__PURE__ */ jsx(I18nProvider, {
|
|
28
|
+
...i18n,
|
|
29
|
+
children: body
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ jsx(DirectionProvider, {
|
|
32
|
+
dir,
|
|
33
|
+
children: body
|
|
34
|
+
});
|
|
19
35
|
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { RootProvider };
|
|
39
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","names":[],"sources":["../../src/provider/base.tsx"],"sourcesContent":["'use client';\n\nimport { type ComponentPropsWithoutRef, lazy, type ReactNode } from 'react';\nimport { DirectionProvider } from '@radix-ui/react-direction';\nimport type { DefaultSearchDialogProps } from '@/components/dialog/search-default';\nimport { ThemeProvider } from 'next-themes';\nimport { I18nProvider, type I18nProviderProps } from '@fumadocs/ui/contexts/i18n';\nimport { SearchProvider, type SearchProviderProps } from '@fumadocs/ui/contexts/search';\n\ninterface SearchOptions extends Omit<SearchProviderProps, 'options' | 'children'> {\n options?: Partial<DefaultSearchDialogProps>;\n\n /**\n * Enable search functionality\n *\n * @defaultValue `true`\n */\n enabled?: boolean;\n}\n\nexport interface RootProviderProps {\n /**\n * `dir` option for Radix UI\n */\n dir?: 'rtl' | 'ltr';\n\n /**\n * @remarks `SearchProviderProps`\n */\n search?: Partial<SearchOptions>;\n\n /**\n * Customise options of `next-themes`\n */\n theme?: Partial<ComponentPropsWithoutRef<typeof ThemeProvider>> & {\n /**\n * Enable `next-themes`\n *\n * @defaultValue true\n */\n enabled?: boolean;\n };\n\n i18n?: Omit<I18nProviderProps, 'children'>;\n\n children?: ReactNode;\n}\n\nconst DefaultSearchDialog = lazy(() => import('@/components/dialog/search-default'));\n\nexport function RootProvider({\n children,\n dir = 'ltr',\n theme = {},\n search,\n i18n,\n}: RootProviderProps) {\n let body = children;\n\n if (search?.enabled !== false)\n body = (\n <SearchProvider SearchDialog={DefaultSearchDialog} {...search}>\n {body}\n </SearchProvider>\n );\n\n if (theme?.enabled !== false)\n body = (\n <ThemeProvider\n attribute=\"class\"\n defaultTheme=\"system\"\n enableSystem\n disableTransitionOnChange\n {...theme}\n >\n {body}\n </ThemeProvider>\n );\n\n if (i18n) {\n body = <I18nProvider {...i18n}>{body}</I18nProvider>;\n }\n\n return <DirectionProvider dir={dir}>{body}</DirectionProvider>;\n}\n"],"mappings":";;;;;;;;;;AAgDA,MAAM,sBAAsB,WAAW,OAAO,0CAAsC;AAEpF,SAAgB,aAAa,EAC3B,UACA,MAAM,OACN,QAAQ,EAAE,EACV,QACA,QACoB;CACpB,IAAI,OAAO;AAEX,KAAI,QAAQ,YAAY,MACtB,QACE,oBAAC;EAAe,cAAc;EAAqB,GAAI;YACpD;GACc;AAGrB,KAAI,OAAO,YAAY,MACrB,QACE,oBAAC;EACC,WAAU;EACV,cAAa;EACb;EACA;EACA,GAAI;YAEH;GACa;AAGpB,KAAI,KACF,QAAO,oBAAC;EAAa,GAAI;YAAO;GAAoB;AAGtD,QAAO,oBAAC;EAAuB;YAAM;GAAyB"}
|