fumadocs-core 16.12.0 → 16.12.1
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/breadcrumb.js +1 -1
- package/dist/framework/waku.js +1 -1
- package/dist/{loader-CoSFINvo.js → loader-BxANMvuQ.js} +6 -2
- package/dist/search/client/fetch.js +2 -2
- package/dist/search/client/flexsearch-static.js +2 -2
- package/dist/search/client/orama-static.js +2 -2
- package/dist/source/dynamic.js +1 -1
- package/dist/source/index.js +1 -1
- package/dist/url-BVHvi3_K.js +29 -0
- package/package.json +1 -1
- package/dist/url-CWbf4MFh.js +0 -19
package/dist/breadcrumb.js
CHANGED
package/dist/framework/waku.js
CHANGED
|
@@ -28,7 +28,7 @@ const framework = {
|
|
|
28
28
|
Link({ href, prefetch = true, ...props }) {
|
|
29
29
|
return /* @__PURE__ */ jsx(Link, {
|
|
30
30
|
to: href,
|
|
31
|
-
unstable_prefetchOnEnter: prefetch,
|
|
31
|
+
unstable_prefetchOnEnter: prefetch ? { mode: "once" } : void 0,
|
|
32
32
|
...props,
|
|
33
33
|
children: props.children
|
|
34
34
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as normalizeUrl } from "./url-BVHvi3_K.js";
|
|
2
2
|
import { c as visit } from "./utils-Dn9VIXRN.js";
|
|
3
3
|
import { a as normalize, i as joinPath, n as dirname, r as extname, t as basename } from "./path-B9zu5SjE.js";
|
|
4
4
|
import { slugsPlugin } from "./source/plugins/slugs.js";
|
|
@@ -695,7 +695,11 @@ function loader(...args) {
|
|
|
695
695
|
const [value, hash] = href.split("#", 2);
|
|
696
696
|
let target;
|
|
697
697
|
if (value.startsWith("./") || value.startsWith("../")) {
|
|
698
|
-
|
|
698
|
+
let decoded = value;
|
|
699
|
+
try {
|
|
700
|
+
decoded = decodeURI(value);
|
|
701
|
+
} catch {}
|
|
702
|
+
const path = joinPath(dir, decoded);
|
|
699
703
|
target = indexer.getPage(path, language);
|
|
700
704
|
} else target = this.getPages(language).find((item) => item.url === value);
|
|
701
705
|
if (target) return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as BASE_PATH } from "../../url-
|
|
1
|
+
import { n as join, t as BASE_PATH } from "../../url-BVHvi3_K.js";
|
|
2
2
|
//#region src/search/client/fetch.ts
|
|
3
3
|
const globalCache = /* @__PURE__ */ new Map();
|
|
4
|
-
function fetchClient({ api =
|
|
4
|
+
function fetchClient({ api = join(BASE_PATH, "/api/search"), locale, tag, cache = globalCache } = {}) {
|
|
5
5
|
return {
|
|
6
6
|
deps: [
|
|
7
7
|
api,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BASE_PATH } from "../../url-
|
|
1
|
+
import { n as join, t as BASE_PATH } from "../../url-BVHvi3_K.js";
|
|
2
2
|
import { n as search, t as createDocument } from "../../utils-Bvy3V-fv.js";
|
|
3
3
|
//#region src/search/client/flexsearch-static.ts
|
|
4
4
|
function initDocument(data) {
|
|
@@ -8,7 +8,7 @@ function initDocument(data) {
|
|
|
8
8
|
}
|
|
9
9
|
const cacheMap = /* @__PURE__ */ new Map();
|
|
10
10
|
function flexsearchStaticClient(options = {}) {
|
|
11
|
-
const { from =
|
|
11
|
+
const { from = join(BASE_PATH, "/api/search"), locale = "", tag } = options;
|
|
12
12
|
let dbs = cacheMap.get(from);
|
|
13
13
|
if (!dbs && typeof window !== "undefined") {
|
|
14
14
|
dbs = init(from);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BASE_PATH } from "../../url-
|
|
1
|
+
import { n as join, t as BASE_PATH } from "../../url-BVHvi3_K.js";
|
|
2
2
|
import { n as searchSimple, t as searchAdvanced } from "../../advanced-BnqbPavQ.js";
|
|
3
3
|
import { create, load } from "@orama/orama";
|
|
4
4
|
//#region src/search/client/orama-static.ts
|
|
@@ -29,7 +29,7 @@ async function loadDB(from, initOrama = (locale) => create({
|
|
|
29
29
|
}
|
|
30
30
|
return dbs;
|
|
31
31
|
}
|
|
32
|
-
function getDBCached({ from =
|
|
32
|
+
function getDBCached({ from = join(BASE_PATH, "/api/search"), initOrama }) {
|
|
33
33
|
const cacheKey = from;
|
|
34
34
|
const cached = cache.get(cacheKey);
|
|
35
35
|
if (cached) return cached;
|
package/dist/source/dynamic.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-
|
|
1
|
+
import { i as isStaticSource, n as loader, r as isDynamicSource } from "../loader-BxANMvuQ.js";
|
|
2
2
|
import { cache } from "react";
|
|
3
3
|
//#region src/source/dynamic.ts
|
|
4
4
|
function dynamicLoader(input, options) {
|
package/dist/source/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as path_exports } from "../path-B9zu5SjE.js";
|
|
2
|
-
import { a as multiple, c as FileSystem, n as loader, o as source, s as update, t as createGetUrl } from "../loader-
|
|
2
|
+
import { a as multiple, c as FileSystem, n as loader, o as source, s as update, t as createGetUrl } from "../loader-BxANMvuQ.js";
|
|
3
3
|
import { getSlugs } from "./plugins/slugs.js";
|
|
4
4
|
import { llms } from "./llms.js";
|
|
5
5
|
export { FileSystem, path_exports as PathUtils, createGetUrl, getSlugs, llms, loader, multiple, source, update };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/utils/url.tsx
|
|
2
|
+
/**
|
|
3
|
+
* The base path (Vite)
|
|
4
|
+
*/
|
|
5
|
+
const BASE_PATH = typeof import.meta.env !== "undefined" && typeof import.meta.env.BASE_URL === "string" ? import.meta.env.BASE_URL : "/";
|
|
6
|
+
function join(...paths) {
|
|
7
|
+
let out = "";
|
|
8
|
+
for (let p of paths) {
|
|
9
|
+
if (out.length > 0) {
|
|
10
|
+
if (p.startsWith("/")) p = p.slice(1);
|
|
11
|
+
if (!out.endsWith("/")) out += "/";
|
|
12
|
+
}
|
|
13
|
+
out += p;
|
|
14
|
+
}
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* normalize URL into the Fumadocs standard form (`/slug-1/slug-2`).
|
|
19
|
+
*
|
|
20
|
+
* This includes URLs with trailing slashes.
|
|
21
|
+
*/
|
|
22
|
+
function normalizeUrl(url) {
|
|
23
|
+
if (url.startsWith("http://") || url.startsWith("https://")) return url;
|
|
24
|
+
if (!url.startsWith("/")) url = "/" + url;
|
|
25
|
+
if (url.length > 1 && url.endsWith("/")) url = url.slice(0, -1);
|
|
26
|
+
return url;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { join as n, normalizeUrl as r, BASE_PATH as t };
|
package/package.json
CHANGED
package/dist/url-CWbf4MFh.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//#region src/utils/url.tsx
|
|
2
|
-
/**
|
|
3
|
-
* The base path (Vite), always ends with `/`.
|
|
4
|
-
*/
|
|
5
|
-
let BASE_PATH = typeof import.meta.env !== "undefined" && typeof import.meta.env.BASE_URL === "string" ? import.meta.env.BASE_URL : "/";
|
|
6
|
-
if (!BASE_PATH.endsWith("/")) BASE_PATH += "/";
|
|
7
|
-
/**
|
|
8
|
-
* normalize URL into the Fumadocs standard form (`/slug-1/slug-2`).
|
|
9
|
-
*
|
|
10
|
-
* This includes URLs with trailing slashes.
|
|
11
|
-
*/
|
|
12
|
-
function normalizeUrl(url) {
|
|
13
|
-
if (url.startsWith("http://") || url.startsWith("https://")) return url;
|
|
14
|
-
if (!url.startsWith("/")) url = "/" + url;
|
|
15
|
-
if (url.length > 1 && url.endsWith("/")) url = url.slice(0, -1);
|
|
16
|
-
return url;
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { normalizeUrl as n, BASE_PATH as t };
|