fumadocs-core 16.0.13 → 16.0.15
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/dist/{builder-DEvYXjy8.d.ts → builder-W853MYyx.d.ts} +7 -7
- package/dist/framework/next.d.ts +5 -1
- package/dist/framework/next.js +7 -3
- package/dist/framework/react-router.d.ts +5 -1
- package/dist/framework/react-router.js +14 -2
- package/dist/framework/tanstack.d.ts +5 -1
- package/dist/framework/tanstack.js +36 -6
- package/dist/framework/waku.d.ts +5 -1
- package/dist/framework/waku.js +16 -4
- package/dist/search/server.d.ts +1 -1
- package/dist/source/index.d.ts +1 -1
- package/dist/source/plugins/lucide-icons.d.ts +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { R as Root, I as Item, F as Folder, S as Separator } from './definitions
|
|
|
2
2
|
import { I18nConfig } from './i18n/index.js';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
|
|
5
|
-
interface LoaderPlugin<
|
|
5
|
+
interface LoaderPlugin<Config extends SourceConfig = SourceConfig> {
|
|
6
6
|
name?: string;
|
|
7
7
|
/**
|
|
8
8
|
* Change the order of plugin:
|
|
@@ -18,12 +18,12 @@ interface LoaderPlugin<Page extends PageData = PageData, Meta extends MetaData =
|
|
|
18
18
|
* transform the storage after loading
|
|
19
19
|
*/
|
|
20
20
|
transformStorage?: (context: {
|
|
21
|
-
storage: ContentStorage<
|
|
21
|
+
storage: ContentStorage<Config['pageData'], Config['metaData']>;
|
|
22
22
|
}) => void;
|
|
23
23
|
/**
|
|
24
24
|
* transform the generated page tree
|
|
25
25
|
*/
|
|
26
|
-
transformPageTree?: PageTreeTransformer<
|
|
26
|
+
transformPageTree?: PageTreeTransformer<Config['pageData'], Config['metaData']>;
|
|
27
27
|
}
|
|
28
28
|
declare function buildPlugins(plugins: (LoaderPlugin | LoaderPlugin[] | undefined)[]): LoaderPlugin[];
|
|
29
29
|
|
|
@@ -44,8 +44,8 @@ interface LoaderOptions<S extends SourceConfig = SourceConfig, I18n extends I18n
|
|
|
44
44
|
/**
|
|
45
45
|
* Additional options for page tree builder
|
|
46
46
|
*/
|
|
47
|
-
pageTree?: PageTreeOptions<S
|
|
48
|
-
plugins?: (LoaderPlugin<S
|
|
47
|
+
pageTree?: PageTreeOptions<S>;
|
|
48
|
+
plugins?: (LoaderPlugin<S> | LoaderPlugin<S>[] | undefined)[];
|
|
49
49
|
icon?: IconResolver;
|
|
50
50
|
slugs?: (info: {
|
|
51
51
|
path: string;
|
|
@@ -265,7 +265,7 @@ interface PageTreeTransformer<Page extends PageData = PageData, Meta extends Met
|
|
|
265
265
|
separator?: (this: PageTreeBuilderContext<Page, Meta>, node: Separator) => Separator;
|
|
266
266
|
root?: (this: PageTreeBuilderContext<Page, Meta>, node: Root) => Root;
|
|
267
267
|
}
|
|
268
|
-
interface PageTreeOptions<
|
|
268
|
+
interface PageTreeOptions<Config extends SourceConfig = SourceConfig> {
|
|
269
269
|
id?: string;
|
|
270
270
|
/**
|
|
271
271
|
* Remove references to the file path of original nodes (`$ref`)
|
|
@@ -282,7 +282,7 @@ interface PageTreeOptions<Page extends PageData = PageData, Meta extends MetaDat
|
|
|
282
282
|
/**
|
|
283
283
|
* Additional page tree transformers to apply
|
|
284
284
|
*/
|
|
285
|
-
transformers?: PageTreeTransformer<
|
|
285
|
+
transformers?: PageTreeTransformer<Config['pageData'], Config['metaData']>[];
|
|
286
286
|
}
|
|
287
287
|
interface PageTreeBuilder {
|
|
288
288
|
build: (storage: ContentStorage, options?: PageTreeOptions) => Root;
|
package/dist/framework/next.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Framework } from './index.js';
|
|
2
3
|
import { ReactNode } from 'react';
|
|
4
|
+
import 'next/dist/shared/lib/get-img-props';
|
|
3
5
|
|
|
4
|
-
declare function NextProvider({ children }: {
|
|
6
|
+
declare function NextProvider({ children, Link: CustomLink, Image: CustomImage, }: {
|
|
5
7
|
children: ReactNode;
|
|
8
|
+
Link?: Framework['Link'];
|
|
9
|
+
Image?: Framework['Image'];
|
|
6
10
|
}): react_jsx_runtime.JSX.Element;
|
|
7
11
|
|
|
8
12
|
export { NextProvider };
|
package/dist/framework/next.js
CHANGED
|
@@ -9,15 +9,19 @@ import { useParams, usePathname, useRouter } from "next/navigation";
|
|
|
9
9
|
import Link from "next/link";
|
|
10
10
|
import Image from "next/image";
|
|
11
11
|
import { jsx } from "react/jsx-runtime";
|
|
12
|
-
function NextProvider({
|
|
12
|
+
function NextProvider({
|
|
13
|
+
children,
|
|
14
|
+
Link: CustomLink,
|
|
15
|
+
Image: CustomImage
|
|
16
|
+
}) {
|
|
13
17
|
return /* @__PURE__ */ jsx(
|
|
14
18
|
FrameworkProvider,
|
|
15
19
|
{
|
|
16
20
|
usePathname,
|
|
17
21
|
useRouter,
|
|
18
22
|
useParams,
|
|
19
|
-
Link,
|
|
20
|
-
Image,
|
|
23
|
+
Link: CustomLink ?? Link,
|
|
24
|
+
Image: CustomImage ?? Image,
|
|
21
25
|
children
|
|
22
26
|
}
|
|
23
27
|
);
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { Framework } from './index.js';
|
|
4
|
+
import 'next/dist/shared/lib/get-img-props';
|
|
3
5
|
|
|
4
|
-
declare function ReactRouterProvider({ children }: {
|
|
6
|
+
declare function ReactRouterProvider({ children, Link: CustomLink, Image: CustomImage, }: {
|
|
5
7
|
children: ReactNode;
|
|
8
|
+
Link?: Framework['Link'];
|
|
9
|
+
Image?: Framework['Image'];
|
|
6
10
|
}): react_jsx_runtime.JSX.Element;
|
|
7
11
|
|
|
8
12
|
export { ReactRouterProvider };
|
|
@@ -39,8 +39,20 @@ var framework = {
|
|
|
39
39
|
return /* @__PURE__ */ jsx(Link, { to: href, prefetch: prefetch ? "intent" : "none", ...props, children: props.children });
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
function ReactRouterProvider({
|
|
43
|
-
|
|
42
|
+
function ReactRouterProvider({
|
|
43
|
+
children,
|
|
44
|
+
Link: CustomLink,
|
|
45
|
+
Image: CustomImage
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
FrameworkProvider,
|
|
49
|
+
{
|
|
50
|
+
...framework,
|
|
51
|
+
Link: CustomLink ?? framework.Link,
|
|
52
|
+
Image: CustomImage ?? framework.Image,
|
|
53
|
+
children
|
|
54
|
+
}
|
|
55
|
+
);
|
|
44
56
|
}
|
|
45
57
|
export {
|
|
46
58
|
ReactRouterProvider
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { Framework } from './index.js';
|
|
4
|
+
import 'next/dist/shared/lib/get-img-props';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Fumadocs adapter for Tanstack Router/Start
|
|
6
8
|
*/
|
|
7
|
-
declare function TanstackProvider({ children }: {
|
|
9
|
+
declare function TanstackProvider({ children, Link: CustomLink, Image: CustomImage, }: {
|
|
8
10
|
children: ReactNode;
|
|
11
|
+
Link?: Framework['Link'];
|
|
12
|
+
Image?: Framework['Image'];
|
|
9
13
|
}): react_jsx_runtime.JSX.Element;
|
|
10
14
|
|
|
11
15
|
export { TanstackProvider };
|
|
@@ -4,15 +4,33 @@ import {
|
|
|
4
4
|
import "../chunk-U67V476Y.js";
|
|
5
5
|
|
|
6
6
|
// src/framework/tanstack.tsx
|
|
7
|
-
import { useMemo } from "react";
|
|
8
|
-
import {
|
|
7
|
+
import { useRef, useMemo } from "react";
|
|
8
|
+
import {
|
|
9
|
+
useParams,
|
|
10
|
+
Link,
|
|
11
|
+
useRouter,
|
|
12
|
+
useRouterState
|
|
13
|
+
} from "@tanstack/react-router";
|
|
9
14
|
import { jsx } from "react/jsx-runtime";
|
|
10
15
|
var framework = {
|
|
11
|
-
Link({ href, prefetch, ...props }) {
|
|
16
|
+
Link({ href, prefetch = true, ...props }) {
|
|
12
17
|
return /* @__PURE__ */ jsx(Link, { to: href, preload: prefetch ? "intent" : false, ...props, children: props.children });
|
|
13
18
|
},
|
|
14
19
|
usePathname() {
|
|
15
|
-
|
|
20
|
+
const { isLoading, pathname } = useRouterState({
|
|
21
|
+
select: (state) => ({
|
|
22
|
+
isLoading: state.isLoading,
|
|
23
|
+
pathname: state.location.pathname
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
const activePathname = useRef(pathname);
|
|
27
|
+
return useMemo(() => {
|
|
28
|
+
if (isLoading) {
|
|
29
|
+
return activePathname.current;
|
|
30
|
+
}
|
|
31
|
+
activePathname.current = pathname;
|
|
32
|
+
return pathname;
|
|
33
|
+
}, [isLoading, pathname]);
|
|
16
34
|
},
|
|
17
35
|
useRouter() {
|
|
18
36
|
const router = useRouter();
|
|
@@ -34,8 +52,20 @@ var framework = {
|
|
|
34
52
|
return useParams({ strict: false });
|
|
35
53
|
}
|
|
36
54
|
};
|
|
37
|
-
function TanstackProvider({
|
|
38
|
-
|
|
55
|
+
function TanstackProvider({
|
|
56
|
+
children,
|
|
57
|
+
Link: CustomLink,
|
|
58
|
+
Image: CustomImage
|
|
59
|
+
}) {
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
FrameworkProvider,
|
|
62
|
+
{
|
|
63
|
+
...framework,
|
|
64
|
+
Link: CustomLink ?? framework.Link,
|
|
65
|
+
Image: CustomImage ?? framework.Image,
|
|
66
|
+
children
|
|
67
|
+
}
|
|
68
|
+
);
|
|
39
69
|
}
|
|
40
70
|
export {
|
|
41
71
|
TanstackProvider
|
package/dist/framework/waku.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { Framework } from './index.js';
|
|
4
|
+
import 'next/dist/shared/lib/get-img-props';
|
|
3
5
|
|
|
4
|
-
declare function WakuProvider({ children }: {
|
|
6
|
+
declare function WakuProvider({ children, Link: CustomLink, Image: CustomImage, }: {
|
|
5
7
|
children: ReactNode;
|
|
8
|
+
Link?: Framework['Link'];
|
|
9
|
+
Image?: Framework['Image'];
|
|
6
10
|
}): react_jsx_runtime.JSX.Element;
|
|
7
11
|
|
|
8
12
|
export { WakuProvider };
|
package/dist/framework/waku.js
CHANGED
|
@@ -39,12 +39,24 @@ var framework = {
|
|
|
39
39
|
[router]
|
|
40
40
|
);
|
|
41
41
|
},
|
|
42
|
-
Link({ href, prefetch
|
|
43
|
-
return /* @__PURE__ */ jsx(WakuLink, { to: href, ...props, children: props.children });
|
|
42
|
+
Link({ href, prefetch = true, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx(WakuLink, { to: href, unstable_prefetchOnEnter: prefetch, ...props, children: props.children });
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
function WakuProvider({
|
|
47
|
-
|
|
46
|
+
function WakuProvider({
|
|
47
|
+
children,
|
|
48
|
+
Link: CustomLink,
|
|
49
|
+
Image: CustomImage
|
|
50
|
+
}) {
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
FrameworkProvider,
|
|
53
|
+
{
|
|
54
|
+
...framework,
|
|
55
|
+
Link: CustomLink ?? framework.Link,
|
|
56
|
+
Image: CustomImage ?? framework.Image,
|
|
57
|
+
children
|
|
58
|
+
}
|
|
59
|
+
);
|
|
48
60
|
}
|
|
49
61
|
export {
|
|
50
62
|
WakuProvider
|
package/dist/search/server.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { StructuredData } from '../mdx-plugins/remark-structure.js';
|
|
|
3
3
|
import { SortedResult } from './index.js';
|
|
4
4
|
export { HighlightedText, ReactSortedResult, createContentHighlighter } from './index.js';
|
|
5
5
|
import { I18nConfig } from '../i18n/index.js';
|
|
6
|
-
import { k as LoaderOutput, f as LoaderConfig, I as InferPageType } from '../builder-
|
|
6
|
+
import { k as LoaderOutput, f as LoaderConfig, I as InferPageType } from '../builder-W853MYyx.js';
|
|
7
7
|
import 'mdast';
|
|
8
8
|
import 'unified';
|
|
9
9
|
import 'mdast-util-mdx-jsx';
|
package/dist/source/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as ContentStorage, F as FileSystem, t as InferMetaType, I as InferPageType, f as LoaderConfig, g as LoaderOptions, k as LoaderOutput, L as LoaderPlugin, j as Meta, p as MetaData, M as MetaFile, i as Page, q as PageData, e as PageFile, a as PageTreeBuilder, b as PageTreeBuilderContext, d as PageTreeOptions, P as PageTreeTransformer, R as ResolvedLoaderConfig, h as Source, S as SourceConfig, U as UrlFn, s as VirtualFile, r as VirtualMeta, V as VirtualPage, _ as _ConfigUnion_, u as buildPlugins, l as createGetUrl, c as createPageTreeBuilder, m as loader, o as map, n as multiple } from '../builder-
|
|
1
|
+
export { C as ContentStorage, F as FileSystem, t as InferMetaType, I as InferPageType, f as LoaderConfig, g as LoaderOptions, k as LoaderOutput, L as LoaderPlugin, j as Meta, p as MetaData, M as MetaFile, i as Page, q as PageData, e as PageFile, a as PageTreeBuilder, b as PageTreeBuilderContext, d as PageTreeOptions, P as PageTreeTransformer, R as ResolvedLoaderConfig, h as Source, S as SourceConfig, U as UrlFn, s as VirtualFile, r as VirtualMeta, V as VirtualPage, _ as _ConfigUnion_, u as buildPlugins, l as createGetUrl, c as createPageTreeBuilder, m as loader, o as map, n as multiple } from '../builder-W853MYyx.js';
|
|
2
2
|
import '../definitions-DbCug1P3.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '../i18n/index.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "16.0.
|
|
4
|
-
"description": "The library for building a documentation website
|
|
3
|
+
"version": "16.0.15",
|
|
4
|
+
"description": "The React.js library for building a documentation website",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Fumadocs",
|
|
7
7
|
"Docs"
|