fumadocs-core 16.6.9 → 16.6.11
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/{advanced-D8-Cn2tE.js → advanced-DoRLtKVF.js} +4 -7
- package/dist/algolia-CwyuBbIb.d.ts +67 -0
- package/dist/breadcrumb.d.ts +1 -1
- package/dist/breadcrumb.js +3 -5
- package/dist/build-doc-BotvE-sS.js +81 -0
- package/dist/{chunk-CaR5F9JI.js → chunk-BoAXSpZd.js} +12 -21
- package/dist/client-8RQ-FiG2.d.ts +218 -0
- package/dist/codeblock-utils-BWp9N5oU.d.ts +36 -0
- package/dist/config-CsHj5oV8.d.ts +16 -0
- package/dist/content/github.js +1 -2
- package/dist/content/md.js +1 -3
- package/dist/content/mdx/preset-bundler.d.ts +7 -9
- package/dist/content/mdx/preset-bundler.js +2 -4
- package/dist/content/mdx/preset-runtime.d.ts +7 -9
- package/dist/content/mdx/preset-runtime.js +2 -4
- package/dist/content/toc.d.ts +1 -1
- package/dist/content/toc.js +2 -4
- package/dist/dynamic-link.js +2 -5
- package/dist/endpoint-Bz07NwEH.js +24 -0
- package/dist/framework/index.js +2 -5
- package/dist/framework/next.js +2 -5
- package/dist/framework/react-router.js +1 -3
- package/dist/framework/tanstack.js +1 -3
- package/dist/framework/waku.js +2 -5
- package/dist/highlight/client.js +2 -5
- package/dist/highlight/config.d.ts +1 -15
- package/dist/highlight/config.js +1 -2
- package/dist/highlight/core/client.d.ts +3 -3
- package/dist/highlight/core/client.js +2 -5
- package/dist/highlight/core/index.d.ts +1 -26
- package/dist/highlight/core/index.js +1 -3
- package/dist/highlight/index.d.ts +3 -3
- package/dist/highlight/index.js +1 -3
- package/dist/i18n/index.d.ts +1 -39
- package/dist/i18n/index.js +1 -2
- package/dist/i18n/middleware.d.ts +1 -1
- package/dist/i18n/middleware.js +1 -3
- package/dist/{icon-DzOeXioY.js → icon-DphlWQaF.js} +1 -2
- package/dist/index-CNf0Q1pt.d.ts +40 -0
- package/dist/index-CTt-rhJo.d.ts +37 -0
- package/dist/index-D1s9JoIZ.d.ts +27 -0
- package/dist/{utils-DWLhAKwM.d.ts → index-DZ_vpLwy.d.ts} +1 -1
- package/dist/index-Dq8ULFjO.d.ts +18 -0
- package/dist/{path-B8CdvN3q.d.ts → index-_S7CzA5M.d.ts} +41 -15
- package/dist/link.js +2 -5
- package/dist/{mdast-utils-hhRcKfZf.js → mdast-utils-9tJwoVTq.js} +1 -3
- package/dist/mdx-plugins/codeblock-utils.d.ts +1 -35
- package/dist/mdx-plugins/codeblock-utils.js +1 -2
- package/dist/mdx-plugins/index.d.ts +16 -17
- package/dist/mdx-plugins/index.js +3 -5
- package/dist/mdx-plugins/rehype-code.core.d.ts +2 -38
- package/dist/mdx-plugins/rehype-code.core.js +2 -104
- package/dist/mdx-plugins/rehype-code.d.ts +3 -18
- package/dist/mdx-plugins/rehype-code.js +2 -5
- package/dist/mdx-plugins/rehype-toc.d.ts +1 -44
- package/dist/mdx-plugins/rehype-toc.js +2 -4
- package/dist/mdx-plugins/remark-admonition.d.ts +1 -20
- package/dist/mdx-plugins/remark-admonition.js +2 -4
- package/dist/mdx-plugins/remark-code-tab.d.ts +1 -30
- package/dist/mdx-plugins/remark-code-tab.js +1 -3
- package/dist/mdx-plugins/remark-directive-admonition.d.ts +1 -34
- package/dist/mdx-plugins/remark-directive-admonition.js +1 -3
- package/dist/mdx-plugins/remark-feedback-block.d.ts +1 -50
- package/dist/mdx-plugins/remark-feedback-block.js +2 -4
- package/dist/mdx-plugins/remark-gfm.d.ts +2 -2
- package/dist/mdx-plugins/remark-gfm.js +1 -2
- package/dist/mdx-plugins/remark-heading.d.ts +1 -44
- package/dist/mdx-plugins/remark-heading.js +2 -4
- package/dist/mdx-plugins/remark-image.d.ts +1 -63
- package/dist/mdx-plugins/remark-image.js +1 -3
- package/dist/mdx-plugins/remark-mdx-files.d.ts +1 -54
- package/dist/mdx-plugins/remark-mdx-files.js +1 -3
- package/dist/mdx-plugins/remark-mdx-mermaid.d.ts +1 -15
- package/dist/mdx-plugins/remark-mdx-mermaid.js +1 -3
- package/dist/mdx-plugins/remark-npm.d.ts +1 -34
- package/dist/mdx-plugins/remark-npm.js +1 -3
- package/dist/mdx-plugins/remark-steps.d.ts +1 -26
- package/dist/mdx-plugins/remark-steps.js +1 -3
- package/dist/mdx-plugins/remark-structure.d.ts +1 -131
- package/dist/mdx-plugins/remark-structure.js +2 -4
- package/dist/negotiation/index.js +1 -3
- package/dist/{normalize-url-DKBxIxO0.js → normalize-url-J3kqKlu4.js} +1 -2
- package/dist/page-tree/index.d.ts +2 -2
- package/dist/page-tree/index.js +2 -3
- package/dist/{path-CX1URXrl.js → path-CYZclEPY.js} +2 -4
- package/dist/rehype-code-B-bxz1EN.d.ts +17 -0
- package/dist/{transformer-icon-BYedaeE8.js → rehype-code.core-AzcK6-sL.js} +101 -2
- package/dist/rehype-code.core-Ck9MowQQ.d.ts +52 -0
- package/dist/rehype-toc-DkpBLGXj.d.ts +45 -0
- package/dist/remark-admonition-tbZwgvRc.d.ts +21 -0
- package/dist/remark-code-tab-Bmp3b54I.d.ts +31 -0
- package/dist/remark-directive-admonition-Cm-X9mJI.d.ts +35 -0
- package/dist/remark-feedback-block-T3jAXI9K.d.ts +51 -0
- package/dist/remark-gfm-C2GLsTxH.d.ts +2 -0
- package/dist/remark-heading-2666MLQD.d.ts +45 -0
- package/dist/remark-image-BqwuBND1.d.ts +64 -0
- package/dist/remark-mdx-files-CCvCHI3_.d.ts +55 -0
- package/dist/remark-mdx-mermaid-jSvwEQqX.d.ts +16 -0
- package/dist/remark-npm-C8phdFJT.d.ts +35 -0
- package/dist/remark-steps-BuqnOJKp.d.ts +27 -0
- package/dist/remark-structure-w0J2HdSr.d.ts +132 -0
- package/dist/{remove-markdown-CpjkP9z4.js → remove-markdown-C5S415Dz.js} +2 -4
- package/dist/{remove-undefined-CM-o9RdZ.js → remove-undefined-Bfj4SlGF.js} +1 -2
- package/dist/search/algolia.d.ts +1 -66
- package/dist/search/algolia.js +1 -2
- package/dist/search/client/algolia.d.ts +2 -0
- package/dist/search/client/algolia.js +57 -0
- package/dist/search/client/fetch.d.ts +2 -0
- package/dist/search/client/fetch.js +27 -0
- package/dist/search/client/flexsearch-static.d.ts +2 -0
- package/dist/search/client/flexsearch-static.js +41 -0
- package/dist/search/client/mixedbread.d.ts +2 -0
- package/dist/search/client/mixedbread.js +65 -0
- package/dist/search/client/orama-cloud-legacy.d.ts +2 -0
- package/dist/search/client/orama-cloud-legacy.js +84 -0
- package/dist/search/client/orama-cloud.d.ts +2 -0
- package/dist/search/client/orama-cloud.js +86 -0
- package/dist/search/client/orama-static.d.ts +2 -0
- package/dist/{static-dXiDJ_Bs.js → search/client/orama-static.js} +13 -10
- package/dist/search/client.d.ts +2 -174
- package/dist/search/client.js +48 -46
- package/dist/search/flexsearch.d.ts +52 -0
- package/dist/search/flexsearch.js +104 -0
- package/dist/search/index.d.ts +1 -33
- package/dist/search/index.js +20 -23
- package/dist/search/mixedbread.d.ts +2 -6
- package/dist/search/mixedbread.js +4 -6
- package/dist/search/orama-cloud-legacy.d.ts +1 -3
- package/dist/search/orama-cloud-legacy.js +1 -2
- package/dist/search/orama-cloud.d.ts +1 -3
- package/dist/search/orama-cloud.js +1 -2
- package/dist/search/server.d.ts +2 -89
- package/dist/search/server.js +138 -220
- package/dist/server-DR-HoW2v.d.ts +137 -0
- package/dist/source/client/index.d.ts +1 -19
- package/dist/source/client/index.js +2 -4
- package/dist/source/index.d.ts +2 -5
- package/dist/source/index.js +78 -23
- package/dist/source/plugins/lucide-icons.d.ts +1 -4
- package/dist/source/plugins/lucide-icons.js +2 -4
- package/dist/source/plugins/slugs.d.ts +1 -24
- package/dist/source/plugins/slugs.js +2 -4
- package/dist/source/plugins/status-badges.d.ts +2 -3
- package/dist/source/plugins/status-badges.js +1 -3
- package/dist/source/schema.js +1 -3
- package/dist/toc-CwccnCch.d.ts +55 -0
- package/dist/toc.d.ts +1 -54
- package/dist/toc.js +2 -6
- package/dist/{util-DLLyljU4.js → util-CT8y1EgJ.js} +1 -2
- package/dist/utils/use-media-query.js +1 -3
- package/dist/utils/use-on-change.js +1 -3
- package/dist/{utils-Bc53B3CJ.js → utils-6GexS7iX.js} +1 -2
- package/dist/utils-CbdTrQE7.js +59 -0
- package/package.json +15 -9
- package/dist/algolia-y2iOKbWu.js +0 -48
- package/dist/create-endpoint-ErPy6bli.js +0 -23
- package/dist/create-i18n-7AVERQc8.d.ts +0 -51
- package/dist/fetch-CqH9lOHV.js +0 -19
- package/dist/mixedbread-BewwCSYr.js +0 -58
- package/dist/orama-cloud-EXSXD2UK.js +0 -79
- package/dist/orama-cloud-legacy-BD43H--x.js +0 -77
- package/dist/transformer-icon-BtBormWx.d.ts +0 -18
- /package/dist/{definitions-VpSOvVeD.d.ts → definitions-AAtMxt2w.d.ts} +0 -0
- /package/dist/{types-BKxquRYN.d.ts → types-3ccArm6T.d.ts} +0 -0
- /package/dist/{util-DJ5AvEKK.d.ts → util-DgsRYeQC.d.ts} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createContentHighlighter } from "./search/index.js";
|
|
2
|
-
import { t as removeUndefined } from "./remove-undefined-
|
|
2
|
+
import { t as removeUndefined } from "./remove-undefined-Bfj4SlGF.js";
|
|
3
3
|
import { getByID, search } from "@orama/orama";
|
|
4
|
-
|
|
5
4
|
//#region src/search/orama/search/simple.ts
|
|
6
5
|
async function searchSimple(db, query, params = {}) {
|
|
7
6
|
const highlighter = createContentHighlighter(query);
|
|
@@ -21,19 +20,18 @@ async function searchSimple(db, query, params = {}) {
|
|
|
21
20
|
url: hit.document.url
|
|
22
21
|
}));
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
//#endregion
|
|
26
24
|
//#region src/search/orama/search/advanced.ts
|
|
27
25
|
async function searchAdvanced(db, query, tag = [], { mode = "fulltext", ...override } = {}) {
|
|
28
26
|
if (typeof tag === "string") tag = [tag];
|
|
29
27
|
const params = {
|
|
30
|
-
|
|
28
|
+
limit: 60,
|
|
31
29
|
mode,
|
|
30
|
+
...override,
|
|
32
31
|
where: removeUndefined({
|
|
33
32
|
tags: tag.length > 0 ? { containsAll: tag } : void 0,
|
|
34
33
|
...override.where
|
|
35
34
|
}),
|
|
36
|
-
limit: 10,
|
|
37
35
|
groupBy: {
|
|
38
36
|
properties: ["page_id"],
|
|
39
37
|
maxResult: 8,
|
|
@@ -71,6 +69,5 @@ async function searchAdvanced(db, query, tag = [], { mode = "fulltext", ...overr
|
|
|
71
69
|
}
|
|
72
70
|
return list.length > 80 ? list.slice(0, 80) : list;
|
|
73
71
|
}
|
|
74
|
-
|
|
75
72
|
//#endregion
|
|
76
|
-
export { searchSimple as n, searchAdvanced as t };
|
|
73
|
+
export { searchSimple as n, searchAdvanced as t };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { r as StructuredData } from "./remark-structure-w0J2HdSr.js";
|
|
2
|
+
import { Algoliasearch } from "algoliasearch";
|
|
3
|
+
|
|
4
|
+
//#region src/search/algolia.d.ts
|
|
5
|
+
interface DocumentRecord {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of document, must be unique
|
|
8
|
+
*/
|
|
9
|
+
_id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
breadcrumbs?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* URL to the page
|
|
15
|
+
*/
|
|
16
|
+
url: string;
|
|
17
|
+
structured: StructuredData;
|
|
18
|
+
/**
|
|
19
|
+
* Tag to filter results
|
|
20
|
+
*/
|
|
21
|
+
tag?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Data to be added to each section index
|
|
24
|
+
*/
|
|
25
|
+
extra_data?: object;
|
|
26
|
+
}
|
|
27
|
+
interface SyncOptions {
|
|
28
|
+
/**
|
|
29
|
+
* Index Name for documents.
|
|
30
|
+
*/
|
|
31
|
+
indexName?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Search indexes
|
|
34
|
+
*/
|
|
35
|
+
documents: DocumentRecord[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Update index settings and replace all objects
|
|
39
|
+
*
|
|
40
|
+
* @param client - Algolia Admin Client
|
|
41
|
+
* @param options - Index Options
|
|
42
|
+
*/
|
|
43
|
+
declare function sync(client: Algoliasearch, options: SyncOptions): Promise<void>;
|
|
44
|
+
declare function setIndexSettings(client: Algoliasearch, indexName: string): Promise<void>;
|
|
45
|
+
declare function updateDocuments(client: Algoliasearch, indexName: string, documents: DocumentRecord[]): Promise<void>;
|
|
46
|
+
interface BaseIndex {
|
|
47
|
+
objectID: string;
|
|
48
|
+
title: string;
|
|
49
|
+
url: string;
|
|
50
|
+
tag?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The id of page, used for distinct
|
|
53
|
+
*/
|
|
54
|
+
page_id: string;
|
|
55
|
+
/**
|
|
56
|
+
* Heading content
|
|
57
|
+
*/
|
|
58
|
+
section?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Heading (anchor) id
|
|
61
|
+
*/
|
|
62
|
+
section_id?: string;
|
|
63
|
+
breadcrumbs?: string[];
|
|
64
|
+
content: string;
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { sync as a, setIndexSettings as i, DocumentRecord as n, updateDocuments as o, SyncOptions as r, BaseIndex as t };
|
package/dist/breadcrumb.d.ts
CHANGED
package/dist/breadcrumb.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as normalizeUrl } from "./normalize-url-
|
|
2
|
-
import { r as findPath } from "./utils-
|
|
1
|
+
import { t as normalizeUrl } from "./normalize-url-J3kqKlu4.js";
|
|
2
|
+
import { r as findPath } from "./utils-6GexS7iX.js";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
|
-
|
|
5
4
|
//#region src/breadcrumb.tsx
|
|
6
5
|
function useBreadcrumb(url, tree, options) {
|
|
7
6
|
return useMemo(() => getBreadcrumbItems(url, tree, options), [
|
|
@@ -58,6 +57,5 @@ function searchPath(nodes, url) {
|
|
|
58
57
|
const normalizedUrl = normalizeUrl(url);
|
|
59
58
|
return findPath(nodes, (node) => node.type === "page" && node.url === normalizedUrl);
|
|
60
59
|
}
|
|
61
|
-
|
|
62
60
|
//#endregion
|
|
63
|
-
export { getBreadcrumbItems, getBreadcrumbItemsFromPath, searchPath, useBreadcrumb };
|
|
61
|
+
export { getBreadcrumbItems, getBreadcrumbItemsFromPath, searchPath, useBreadcrumb };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { r as findPath } from "./utils-6GexS7iX.js";
|
|
2
|
+
import { r as extname, t as basename } from "./path-CYZclEPY.js";
|
|
3
|
+
//#region src/search/server/build-index.ts
|
|
4
|
+
async function buildIndexDefault(page) {
|
|
5
|
+
let structuredData;
|
|
6
|
+
if ("structuredData" in page.data) structuredData = typeof page.data.structuredData === "function" ? await page.data.structuredData() : page.data.structuredData;
|
|
7
|
+
else if ("load" in page.data && typeof page.data.load === "function") structuredData = (await page.data.load()).structuredData;
|
|
8
|
+
if (!structuredData) throw new Error("Cannot find structured data from page, please define the page to index function.");
|
|
9
|
+
return {
|
|
10
|
+
title: page.data.title ?? basename(page.path, extname(page.path)),
|
|
11
|
+
description: page.data.description,
|
|
12
|
+
url: page.url,
|
|
13
|
+
id: page.url,
|
|
14
|
+
structuredData
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function isBreadcrumbItem(item) {
|
|
18
|
+
return typeof item === "string" && item.length > 0;
|
|
19
|
+
}
|
|
20
|
+
function buildBreadcrumbs(source, page) {
|
|
21
|
+
const pageTree = source.getPageTree(page.locale);
|
|
22
|
+
const path = findPath(pageTree.children, (node) => node.type === "page" && node.url === page.url);
|
|
23
|
+
if (path) {
|
|
24
|
+
const breadcrumbs = [];
|
|
25
|
+
path.pop();
|
|
26
|
+
if (isBreadcrumbItem(pageTree.name)) breadcrumbs.push(pageTree.name);
|
|
27
|
+
for (const segment of path) {
|
|
28
|
+
if (!isBreadcrumbItem(segment.name)) continue;
|
|
29
|
+
breadcrumbs.push(segment.name);
|
|
30
|
+
}
|
|
31
|
+
return breadcrumbs;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/search/server/build-doc.ts
|
|
36
|
+
function buildDocuments(indexes) {
|
|
37
|
+
const docs = [];
|
|
38
|
+
for (const page of indexes) {
|
|
39
|
+
const pageTag = page.tag ?? [];
|
|
40
|
+
const tags = Array.isArray(pageTag) ? pageTag : [pageTag];
|
|
41
|
+
const data = page.structuredData;
|
|
42
|
+
let id = 0;
|
|
43
|
+
docs.push({
|
|
44
|
+
id: page.id,
|
|
45
|
+
page_id: page.id,
|
|
46
|
+
type: "page",
|
|
47
|
+
content: page.title,
|
|
48
|
+
breadcrumbs: page.breadcrumbs,
|
|
49
|
+
tags,
|
|
50
|
+
url: page.url
|
|
51
|
+
});
|
|
52
|
+
const nextId = () => `${page.id}-${id++}`;
|
|
53
|
+
if (page.description) docs.push({
|
|
54
|
+
id: nextId(),
|
|
55
|
+
page_id: page.id,
|
|
56
|
+
tags,
|
|
57
|
+
type: "text",
|
|
58
|
+
url: page.url,
|
|
59
|
+
content: page.description
|
|
60
|
+
});
|
|
61
|
+
for (const heading of data.headings) docs.push({
|
|
62
|
+
id: nextId(),
|
|
63
|
+
page_id: page.id,
|
|
64
|
+
type: "heading",
|
|
65
|
+
tags,
|
|
66
|
+
url: `${page.url}#${heading.id}`,
|
|
67
|
+
content: heading.content
|
|
68
|
+
});
|
|
69
|
+
for (const content of data.contents) docs.push({
|
|
70
|
+
id: nextId(),
|
|
71
|
+
page_id: page.id,
|
|
72
|
+
tags,
|
|
73
|
+
type: "text",
|
|
74
|
+
url: content.heading ? `${page.url}#${content.heading}` : page.url,
|
|
75
|
+
content: content.content
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return docs;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { buildBreadcrumbs as n, buildIndexDefault as r, buildDocuments as t };
|
|
@@ -8,28 +8,20 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
8
|
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
9
|
var __exportAll = (all, no_symbols) => {
|
|
10
10
|
let target = {};
|
|
11
|
-
for (var name in all) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
if (!no_symbols) {
|
|
18
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
19
|
-
}
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
20
16
|
return target;
|
|
21
17
|
};
|
|
22
18
|
var __copyProps = (to, from, except, desc) => {
|
|
23
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
20
|
+
key = keys[i];
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
22
|
+
get: ((k) => from[k]).bind(null, key),
|
|
23
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
24
|
+
});
|
|
33
25
|
}
|
|
34
26
|
return to;
|
|
35
27
|
};
|
|
@@ -37,6 +29,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
29
|
value: mod,
|
|
38
30
|
enumerable: true
|
|
39
31
|
}) : target, mod));
|
|
40
|
-
|
|
41
32
|
//#endregion
|
|
42
|
-
export { __exportAll as n, __toESM as r, __commonJSMin as t };
|
|
33
|
+
export { __exportAll as n, __toESM as r, __commonJSMin as t };
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { t as Awaitable } from "./types-3ccArm6T.js";
|
|
2
|
+
import { t as BaseIndex } from "./algolia-CwyuBbIb.js";
|
|
3
|
+
import { r as SortedResult } from "./index-CTt-rhJo.js";
|
|
4
|
+
import { DependencyList } from "react";
|
|
5
|
+
import { AnyOrama } from "@orama/orama";
|
|
6
|
+
import { LiteClient, SearchResponse } from "algoliasearch/lite";
|
|
7
|
+
import { OramaCloud, OramaCloudSearchParams } from "@orama/core";
|
|
8
|
+
import { ClientSearchParams, OramaClient } from "@oramacloud/client";
|
|
9
|
+
import Mixedbread from "@mixedbread/sdk";
|
|
10
|
+
|
|
11
|
+
//#region src/search/client/fetch.d.ts
|
|
12
|
+
interface FetchOptions {
|
|
13
|
+
/**
|
|
14
|
+
* API route for search endpoint, support absolute URLs.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue '/api/search'
|
|
17
|
+
*/
|
|
18
|
+
api?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Filter results with specific tag(s).
|
|
21
|
+
*/
|
|
22
|
+
tag?: string | string[];
|
|
23
|
+
/**
|
|
24
|
+
* Filter by locale
|
|
25
|
+
*/
|
|
26
|
+
locale?: string;
|
|
27
|
+
cache?: Map<string, SortedResult[]>;
|
|
28
|
+
}
|
|
29
|
+
declare function fetchClient({
|
|
30
|
+
api,
|
|
31
|
+
locale,
|
|
32
|
+
tag,
|
|
33
|
+
cache
|
|
34
|
+
}: FetchOptions): SearchClient;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/search/client/orama-static.d.ts
|
|
37
|
+
interface StaticOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Where to download exported search indexes (URL)
|
|
40
|
+
*
|
|
41
|
+
* @defaultValue '/api/search'
|
|
42
|
+
*/
|
|
43
|
+
from?: string;
|
|
44
|
+
initOrama?: (locale?: string) => AnyOrama | Promise<AnyOrama>;
|
|
45
|
+
/**
|
|
46
|
+
* Filter results with specific tag(s).
|
|
47
|
+
*/
|
|
48
|
+
tag?: string | string[];
|
|
49
|
+
/**
|
|
50
|
+
* Filter by locale (unsupported at the moment)
|
|
51
|
+
*/
|
|
52
|
+
locale?: string;
|
|
53
|
+
}
|
|
54
|
+
declare function oramaStaticClient(options: StaticOptions): SearchClient;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/search/client/algolia.d.ts
|
|
57
|
+
interface AlgoliaOptions {
|
|
58
|
+
indexName: string;
|
|
59
|
+
client: LiteClient;
|
|
60
|
+
/**
|
|
61
|
+
* Filter results with specific tag.
|
|
62
|
+
*/
|
|
63
|
+
tag?: string;
|
|
64
|
+
locale?: string;
|
|
65
|
+
onSearch?: (query: string, tag?: string, locale?: string) => Promise<{
|
|
66
|
+
results: SearchResponse<BaseIndex>[];
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
declare function algoliaClient(options: AlgoliaOptions): SearchClient;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/search/client/orama-cloud.d.ts
|
|
72
|
+
interface OramaCloudOptions {
|
|
73
|
+
client: OramaCloud;
|
|
74
|
+
/**
|
|
75
|
+
* The type of your index.
|
|
76
|
+
*
|
|
77
|
+
* You can set it to `crawler` if you use crawler instead of the JSON index with schema provided by Fumadocs
|
|
78
|
+
*/
|
|
79
|
+
index?: 'default' | 'crawler';
|
|
80
|
+
/**
|
|
81
|
+
* Note: not included in dependency list.
|
|
82
|
+
*/
|
|
83
|
+
params?: Partial<OramaCloudSearchParams>;
|
|
84
|
+
/**
|
|
85
|
+
* Filter results with specific tag.
|
|
86
|
+
*/
|
|
87
|
+
tag?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Filter by locale (unsupported at the moment)
|
|
90
|
+
*/
|
|
91
|
+
locale?: string;
|
|
92
|
+
}
|
|
93
|
+
declare function oramaCloudClient(options: OramaCloudOptions): SearchClient;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/search/client/orama-cloud-legacy.d.ts
|
|
96
|
+
interface OramaCloudLegacyOptions {
|
|
97
|
+
client: OramaClient;
|
|
98
|
+
/**
|
|
99
|
+
* The type of your index.
|
|
100
|
+
*
|
|
101
|
+
* You can set it to `crawler` if you use crawler instead of the JSON index with schema provided by Fumadocs.
|
|
102
|
+
*/
|
|
103
|
+
index?: 'default' | 'crawler';
|
|
104
|
+
/**
|
|
105
|
+
* Note: not included into dependency list.
|
|
106
|
+
*/
|
|
107
|
+
params?: ClientSearchParams;
|
|
108
|
+
/**
|
|
109
|
+
* Filter results with specific tag.
|
|
110
|
+
*/
|
|
111
|
+
tag?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Filter by locale (unsupported at the moment)
|
|
114
|
+
*/
|
|
115
|
+
locale?: string;
|
|
116
|
+
}
|
|
117
|
+
declare function oramaCloudLegacyClient(options: OramaCloudLegacyOptions): SearchClient;
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/search/client/mixedbread.d.ts
|
|
120
|
+
interface MixedbreadOptions {
|
|
121
|
+
/**
|
|
122
|
+
* The identifier of the store to search in
|
|
123
|
+
*/
|
|
124
|
+
storeIdentifier: string;
|
|
125
|
+
/**
|
|
126
|
+
* The Mixedbread SDK client instance
|
|
127
|
+
*/
|
|
128
|
+
client: Mixedbread;
|
|
129
|
+
/**
|
|
130
|
+
* Filter results with specific tag.
|
|
131
|
+
*/
|
|
132
|
+
tag?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Filter by locale (unsupported at the moment)
|
|
135
|
+
*/
|
|
136
|
+
locale?: string;
|
|
137
|
+
}
|
|
138
|
+
interface SearchMetadata {
|
|
139
|
+
title?: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
url?: string;
|
|
142
|
+
tag?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @deprecated Use `createMixedbreadSearchAPI` from `fumadocs-core/search/mixedbread` instead.
|
|
146
|
+
* This client-side approach exposes your API key in the browser.
|
|
147
|
+
* The server-side approach keeps the key secure and uses `type: 'fetch'` on the client.
|
|
148
|
+
*/
|
|
149
|
+
declare function mixedbreadClient(options: MixedbreadOptions): SearchClient;
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/search/client/flexsearch-static.d.ts
|
|
152
|
+
interface FlexsearchStaticOptions {
|
|
153
|
+
/**
|
|
154
|
+
* @defaultValue `/api/search`
|
|
155
|
+
*/
|
|
156
|
+
from?: string;
|
|
157
|
+
locale?: string;
|
|
158
|
+
tag?: string | string[];
|
|
159
|
+
}
|
|
160
|
+
declare function flexsearchStaticClient(options: FlexsearchStaticOptions): SearchClient;
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/search/client.d.ts
|
|
163
|
+
interface UseDocsSearch {
|
|
164
|
+
search: string;
|
|
165
|
+
setSearch: (v: string) => void;
|
|
166
|
+
query: {
|
|
167
|
+
isLoading: boolean;
|
|
168
|
+
data?: SortedResult[] | 'empty';
|
|
169
|
+
error?: Error;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
type ClientPreset = ({
|
|
173
|
+
type: 'fetch';
|
|
174
|
+
} & FetchOptions) | ({
|
|
175
|
+
type: 'static';
|
|
176
|
+
} & StaticOptions) | ({
|
|
177
|
+
type: 'algolia';
|
|
178
|
+
} & AlgoliaOptions) | ({
|
|
179
|
+
type: 'orama-cloud';
|
|
180
|
+
} & OramaCloudOptions) | ({
|
|
181
|
+
type: 'orama-cloud-legacy';
|
|
182
|
+
} & OramaCloudLegacyOptions) | ({
|
|
183
|
+
type: 'flexsearch-static';
|
|
184
|
+
} & FlexsearchStaticOptions) | ({
|
|
185
|
+
/**
|
|
186
|
+
* @deprecated Use `createMixedbreadSearchAPI` from `fumadocs-core/search/mixedbread` instead.
|
|
187
|
+
* This client-side approach exposes your API key in the browser.
|
|
188
|
+
* The server-side approach keeps the key secure and uses `type: 'fetch'` on the client.
|
|
189
|
+
*/
|
|
190
|
+
type: 'mixedbread';
|
|
191
|
+
} & MixedbreadOptions) | {
|
|
192
|
+
client: SearchClient;
|
|
193
|
+
};
|
|
194
|
+
interface SearchClient {
|
|
195
|
+
search: (query: string) => Awaitable<SortedResult[]>;
|
|
196
|
+
deps?: DependencyList;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Provide a hook to query different official search clients.
|
|
200
|
+
*
|
|
201
|
+
* Note: it will re-query when its parameters changed, make sure to define `deps` array if you encounter rendering issues.
|
|
202
|
+
*/
|
|
203
|
+
declare function useDocsSearch(clientOptions: ClientPreset & {
|
|
204
|
+
/**
|
|
205
|
+
* The debounced delay for performing a search (in ms).
|
|
206
|
+
* .
|
|
207
|
+
* @defaultValue 100
|
|
208
|
+
*/
|
|
209
|
+
delayMs?: number;
|
|
210
|
+
/**
|
|
211
|
+
* still perform search even if query is empty.
|
|
212
|
+
*
|
|
213
|
+
* @defaultValue false
|
|
214
|
+
*/
|
|
215
|
+
allowEmpty?: boolean;
|
|
216
|
+
}, deps?: DependencyList): UseDocsSearch;
|
|
217
|
+
//#endregion
|
|
218
|
+
export { FetchOptions as _, flexsearchStaticClient as a, mixedbreadClient as c, OramaCloudOptions as d, oramaCloudClient as f, oramaStaticClient as g, StaticOptions as h, FlexsearchStaticOptions as i, OramaCloudLegacyOptions as l, algoliaClient as m, SearchClient as n, MixedbreadOptions as o, AlgoliaOptions as p, useDocsSearch as r, SearchMetadata as s, ClientPreset as t, oramaCloudLegacyClient as u, fetchClient as v };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MdxJsxAttribute, MdxJsxFlowElement } from "mdast-util-mdx";
|
|
2
|
+
import { BlockContent, Text } from "mdast";
|
|
3
|
+
|
|
4
|
+
//#region src/mdx-plugins/codeblock-utils.d.ts
|
|
5
|
+
interface CodeBlockTabsOptions {
|
|
6
|
+
attributes?: MdxJsxAttribute[];
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
persist?: {
|
|
9
|
+
id: string;
|
|
10
|
+
} | false;
|
|
11
|
+
triggers: {
|
|
12
|
+
value: string;
|
|
13
|
+
children: (BlockContent | Text)[];
|
|
14
|
+
}[];
|
|
15
|
+
tabs: {
|
|
16
|
+
value: string;
|
|
17
|
+
children: BlockContent[];
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
20
|
+
declare function generateCodeBlockTabs({
|
|
21
|
+
persist,
|
|
22
|
+
defaultValue,
|
|
23
|
+
triggers,
|
|
24
|
+
tabs,
|
|
25
|
+
...options
|
|
26
|
+
}: CodeBlockTabsOptions): MdxJsxFlowElement;
|
|
27
|
+
interface CodeBlockAttributes<Name extends string = string> {
|
|
28
|
+
attributes: Partial<Record<Name, string | null>>;
|
|
29
|
+
rest: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parse Fumadocs-style code block attributes from meta string, like `title="hello world"`
|
|
33
|
+
*/
|
|
34
|
+
declare function parseCodeBlockAttributes<Name extends string = string>(meta: string, allowedNames?: Name[]): CodeBlockAttributes<Name>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { parseCodeBlockAttributes as i, CodeBlockTabsOptions as n, generateCodeBlockTabs as r, CodeBlockAttributes as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as Awaitable } from "./types-3ccArm6T.js";
|
|
2
|
+
import { BundledTheme, CodeOptionsThemes, HighlighterCore } from "shiki";
|
|
3
|
+
|
|
4
|
+
//#region src/highlight/config.d.ts
|
|
5
|
+
interface ShikiConfig {
|
|
6
|
+
createHighlighter: () => Awaitable<HighlighterCore>;
|
|
7
|
+
defaultThemes: CodeOptionsThemes<BundledTheme>;
|
|
8
|
+
}
|
|
9
|
+
interface ResolvedShikiConfig extends ShikiConfig {
|
|
10
|
+
id: symbol;
|
|
11
|
+
resolveThemes: (options?: CodeOptionsThemes<BundledTheme> | Record<never, never>) => CodeOptionsThemes<BundledTheme>;
|
|
12
|
+
}
|
|
13
|
+
/** define shared configurations for Shiki */
|
|
14
|
+
declare function defineShikiConfig(config: ShikiConfig): ResolvedShikiConfig;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ShikiConfig as n, defineShikiConfig as r, ResolvedShikiConfig as t };
|
package/dist/content/github.js
CHANGED
package/dist/content/md.js
CHANGED
|
@@ -4,7 +4,6 @@ import { remark } from "remark";
|
|
|
4
4
|
import remarkRehype from "remark-rehype";
|
|
5
5
|
import { VFile } from "vfile";
|
|
6
6
|
import { toJsxRuntime } from "hast-util-to-jsx-runtime";
|
|
7
|
-
|
|
8
7
|
//#region src/content/md.ts
|
|
9
8
|
function createMarkdownRenderer({ rehypePlugins = [], remarkPlugins = [], remarkRehypeOptions } = {}) {
|
|
10
9
|
const processor = remark().use(remarkPlugins).use(remarkRehype, remarkRehypeOptions).use(rehypePlugins);
|
|
@@ -42,6 +41,5 @@ function createMarkdownRenderer({ rehypePlugins = [], remarkPlugins = [], remark
|
|
|
42
41
|
function Markdown(props) {
|
|
43
42
|
return createMarkdownRenderer(props).MarkdownServer(props);
|
|
44
43
|
}
|
|
45
|
-
|
|
46
44
|
//#endregion
|
|
47
|
-
export { Markdown, createMarkdownRenderer };
|
|
45
|
+
export { Markdown, createMarkdownRenderer };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "../../mdx-plugins/index.js";
|
|
9
|
-
import { t as ResolvePlugins } from "../../util-DJ5AvEKK.js";
|
|
1
|
+
import { t as RehypeCodeOptions } from "../../rehype-code-B-bxz1EN.js";
|
|
2
|
+
import { t as RemarkImageOptions } from "../../remark-image-BqwuBND1.js";
|
|
3
|
+
import { n as StructureOptions } from "../../remark-structure-w0J2HdSr.js";
|
|
4
|
+
import { t as RemarkHeadingOptions } from "../../remark-heading-2666MLQD.js";
|
|
5
|
+
import { t as RemarkCodeTabOptions } from "../../remark-code-tab-Bmp3b54I.js";
|
|
6
|
+
import { t as RemarkNpmOptions } from "../../remark-npm-C8phdFJT.js";
|
|
7
|
+
import { t as ResolvePlugins } from "../../util-DgsRYeQC.js";
|
|
10
8
|
import { ProcessorOptions } from "@mdx-js/mdx";
|
|
11
9
|
|
|
12
10
|
//#region src/content/mdx/preset-bundler.d.ts
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as resolvePlugins } from "../../util-
|
|
2
|
-
|
|
1
|
+
import { t as resolvePlugins } from "../../util-CT8y1EgJ.js";
|
|
3
2
|
//#region src/content/mdx/preset-bundler.ts
|
|
4
3
|
/**
|
|
5
4
|
* apply MDX processor presets
|
|
@@ -35,6 +34,5 @@ async function mdxPreset(options = {}) {
|
|
|
35
34
|
rehypePlugins
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
|
-
|
|
39
37
|
//#endregion
|
|
40
|
-
export { mdxPreset };
|
|
38
|
+
export { mdxPreset };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "../../mdx-plugins/index.js";
|
|
9
|
-
import { t as ResolvePlugins } from "../../util-DJ5AvEKK.js";
|
|
1
|
+
import { t as RehypeCodeOptions } from "../../rehype-code-B-bxz1EN.js";
|
|
2
|
+
import { t as RemarkImageOptions } from "../../remark-image-BqwuBND1.js";
|
|
3
|
+
import { n as StructureOptions } from "../../remark-structure-w0J2HdSr.js";
|
|
4
|
+
import { t as RemarkHeadingOptions } from "../../remark-heading-2666MLQD.js";
|
|
5
|
+
import { t as RemarkCodeTabOptions } from "../../remark-code-tab-Bmp3b54I.js";
|
|
6
|
+
import { t as RemarkNpmOptions } from "../../remark-npm-C8phdFJT.js";
|
|
7
|
+
import { t as ResolvePlugins } from "../../util-DgsRYeQC.js";
|
|
10
8
|
import { ProcessorOptions } from "@mdx-js/mdx";
|
|
11
9
|
|
|
12
10
|
//#region src/content/mdx/preset-runtime.d.ts
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as resolvePlugins } from "../../util-
|
|
2
|
-
|
|
1
|
+
import { t as resolvePlugins } from "../../util-CT8y1EgJ.js";
|
|
3
2
|
//#region src/content/mdx/preset-runtime.ts
|
|
4
3
|
/**
|
|
5
4
|
* apply MDX processor presets
|
|
@@ -33,6 +32,5 @@ async function mdxPreset(options = {}) {
|
|
|
33
32
|
rehypePlugins
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
|
-
|
|
37
35
|
//#endregion
|
|
38
|
-
export { mdxPreset };
|
|
36
|
+
export { mdxPreset };
|
package/dist/content/toc.d.ts
CHANGED
package/dist/content/toc.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import "../mdast-utils-
|
|
1
|
+
import "../mdast-utils-9tJwoVTq.js";
|
|
2
2
|
import { remarkHeading } from "../mdx-plugins/remark-heading.js";
|
|
3
3
|
import { remark } from "remark";
|
|
4
|
-
|
|
5
4
|
//#region src/content/toc.ts
|
|
6
5
|
function getTableOfContents(content, remarkPlugins) {
|
|
7
6
|
if (remarkPlugins) return remark().use(remarkPlugins).use(remarkHeading).process(content).then((result) => {
|
|
@@ -12,6 +11,5 @@ function getTableOfContents(content, remarkPlugins) {
|
|
|
12
11
|
if ("toc" in result.data) return result.data.toc;
|
|
13
12
|
return [];
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
//#endregion
|
|
17
|
-
export { getTableOfContents };
|
|
15
|
+
export { getTableOfContents };
|
package/dist/dynamic-link.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
3
2
|
import { useParams } from "./framework/index.js";
|
|
4
3
|
import Link from "./link.js";
|
|
5
4
|
import { forwardRef, useMemo } from "react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
6
|
//#region src/dynamic-link.tsx
|
|
9
7
|
/**
|
|
10
8
|
* Extends the default `Link` component
|
|
@@ -29,6 +27,5 @@ function updateHref(href, params) {
|
|
|
29
27
|
return hasEndingSlash ? `${replacement}/` : replacement;
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
|
-
|
|
33
30
|
//#endregion
|
|
34
|
-
export { DynamicLink, DynamicLink as default, updateHref };
|
|
31
|
+
export { DynamicLink, DynamicLink as default, updateHref };
|