fumadocs-core 12.5.2 → 12.5.4
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 +5 -9
- package/dist/chunk-DVOZJZGH.js +42 -0
- package/dist/chunk-KGMG4N3Y.js +13 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/{chunk-EP2HYVJS.js → chunk-V6DBK6TW.js} +1 -1
- package/dist/{chunk-QRNTLL6S.js → chunk-YKIM647L.js} +5 -6
- package/dist/dynamic-link.d.ts +2 -3
- package/dist/dynamic-link.js +5 -9
- package/dist/link.d.ts +5 -11
- package/dist/link.js +2 -2
- package/dist/mdx-plugins/index.js +24 -20
- package/dist/middleware.js +1 -1
- package/dist/search/client.js +10 -14
- package/dist/search/server.js +113 -124
- package/dist/search-algolia/client.js +18 -23
- package/dist/search-algolia/server.js +29 -36
- package/dist/server/index.js +39 -48
- package/dist/sidebar.js +22 -31
- package/dist/source/index.js +51 -52
- package/dist/toc-internal.js +12 -26
- package/dist/toc.js +6 -12
- package/dist/utils/use-on-change.d.ts +3 -0
- package/dist/utils/use-on-change.js +7 -0
- package/package.json +9 -2
- package/dist/chunk-CWMXXUWU.js +0 -63
- package/dist/chunk-XB7CNOKH.js +0 -40
package/dist/source/index.js
CHANGED
|
@@ -2,10 +2,8 @@ import {
|
|
|
2
2
|
slash
|
|
3
3
|
} from "../chunk-UWEEHUJV.js";
|
|
4
4
|
import {
|
|
5
|
-
__export
|
|
6
|
-
|
|
7
|
-
__spreadValues
|
|
8
|
-
} from "../chunk-CWMXXUWU.js";
|
|
5
|
+
__export
|
|
6
|
+
} from "../chunk-MLKGABMK.js";
|
|
9
7
|
|
|
10
8
|
// src/source/path.ts
|
|
11
9
|
import { parse } from "path";
|
|
@@ -61,8 +59,9 @@ function resolvePath(from, join) {
|
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
// src/source/page-tree-builder.ts
|
|
64
|
-
var
|
|
65
|
-
var
|
|
62
|
+
var group = /^\((?<name>.+)\)$/;
|
|
63
|
+
var link = /^\[(?<text>.+)]\((?<url>.+)\)$/;
|
|
64
|
+
var separator = /^---(?<name>.*?)---$/;
|
|
66
65
|
var rest = "...";
|
|
67
66
|
function buildAll(nodes, ctx, skipIndex) {
|
|
68
67
|
const output = [];
|
|
@@ -84,18 +83,17 @@ function buildAll(nodes, ctx, skipIndex) {
|
|
|
84
83
|
return output;
|
|
85
84
|
}
|
|
86
85
|
function resolveFolderItem(folder, item, ctx, addedNodePaths) {
|
|
87
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
88
86
|
if (item === rest) return "...";
|
|
89
87
|
const separateResult = separator.exec(item);
|
|
90
|
-
if (separateResult
|
|
88
|
+
if (separateResult?.groups) {
|
|
91
89
|
const node = {
|
|
92
90
|
type: "separator",
|
|
93
91
|
name: separateResult.groups.name
|
|
94
92
|
};
|
|
95
|
-
return [
|
|
93
|
+
return [ctx.options.attachSeparator?.(node) ?? node];
|
|
96
94
|
}
|
|
97
95
|
const linkResult = link.exec(item);
|
|
98
|
-
if (linkResult
|
|
96
|
+
if (linkResult?.groups) {
|
|
99
97
|
const { url, text } = linkResult.groups;
|
|
100
98
|
const isRelative = url.startsWith("/") || url.startsWith("#") || url.startsWith(".");
|
|
101
99
|
const node = {
|
|
@@ -104,7 +102,7 @@ function resolveFolderItem(folder, item, ctx, addedNodePaths) {
|
|
|
104
102
|
url,
|
|
105
103
|
external: !isRelative
|
|
106
104
|
};
|
|
107
|
-
return [
|
|
105
|
+
return [ctx.options.attachFile?.(node) ?? node];
|
|
108
106
|
}
|
|
109
107
|
let filename = item;
|
|
110
108
|
const isExcept = item.startsWith("!");
|
|
@@ -116,7 +114,7 @@ function resolveFolderItem(folder, item, ctx, addedNodePaths) {
|
|
|
116
114
|
filename = item.slice(3);
|
|
117
115
|
}
|
|
118
116
|
const path = resolvePath(folder.file.path, filename);
|
|
119
|
-
const itemNode =
|
|
117
|
+
const itemNode = ctx.storage.readDir(path) ?? ctx.storage.read(path, "page");
|
|
120
118
|
if (!itemNode) return [];
|
|
121
119
|
addedNodePaths.add(itemNode.file.path);
|
|
122
120
|
if (isExcept) return [];
|
|
@@ -127,23 +125,22 @@ function resolveFolderItem(folder, item, ctx, addedNodePaths) {
|
|
|
127
125
|
return [buildFileNode(itemNode, ctx)];
|
|
128
126
|
}
|
|
129
127
|
function buildFolderNode(folder, defaultIsRoot, ctx) {
|
|
130
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
131
128
|
const metaPath = resolvePath(folder.file.path, "meta");
|
|
132
129
|
let meta = ctx.storage.read(metaPath, "meta");
|
|
133
|
-
meta =
|
|
130
|
+
meta = findLocalizedFile(metaPath, "meta", ctx) ?? meta;
|
|
134
131
|
const indexFile = ctx.storage.read(
|
|
135
132
|
resolvePath(folder.file.flattenedPath, "index"),
|
|
136
133
|
"page"
|
|
137
134
|
);
|
|
138
|
-
const metadata = meta
|
|
135
|
+
const metadata = meta?.data.data;
|
|
139
136
|
const index = indexFile ? buildFileNode(indexFile, ctx) : void 0;
|
|
140
137
|
let children;
|
|
141
138
|
if (!meta) {
|
|
142
139
|
children = buildAll(folder.children, ctx, !defaultIsRoot);
|
|
143
140
|
} else {
|
|
144
|
-
const isRoot =
|
|
141
|
+
const isRoot = metadata?.root ?? defaultIsRoot;
|
|
145
142
|
const addedNodePaths = /* @__PURE__ */ new Set();
|
|
146
|
-
const resolved =
|
|
143
|
+
const resolved = metadata?.pages?.flatMap((item) => {
|
|
147
144
|
return resolveFolderItem(folder, item, ctx, addedNodePaths);
|
|
148
145
|
});
|
|
149
146
|
const restNodes = buildAll(
|
|
@@ -151,20 +148,20 @@ function buildFolderNode(folder, defaultIsRoot, ctx) {
|
|
|
151
148
|
ctx,
|
|
152
149
|
!isRoot
|
|
153
150
|
);
|
|
154
|
-
const nodes = resolved
|
|
151
|
+
const nodes = resolved?.flatMap((item) => {
|
|
155
152
|
if (item === "...") {
|
|
156
153
|
return restNodes;
|
|
157
154
|
}
|
|
158
155
|
return item;
|
|
159
156
|
});
|
|
160
|
-
children = nodes
|
|
157
|
+
children = nodes ?? restNodes;
|
|
161
158
|
}
|
|
162
159
|
const node = {
|
|
163
160
|
type: "folder",
|
|
164
|
-
name:
|
|
165
|
-
icon:
|
|
166
|
-
root: metadata
|
|
167
|
-
defaultOpen: metadata
|
|
161
|
+
name: metadata?.title ?? index?.name ?? pathToName(folder.file.name, true),
|
|
162
|
+
icon: ctx.options.resolveIcon?.(metadata?.icon),
|
|
163
|
+
root: metadata?.root,
|
|
164
|
+
defaultOpen: metadata?.defaultOpen,
|
|
168
165
|
index,
|
|
169
166
|
children
|
|
170
167
|
};
|
|
@@ -172,20 +169,19 @@ function buildFolderNode(folder, defaultIsRoot, ctx) {
|
|
|
172
169
|
node.id = folder.file.flattenedPath;
|
|
173
170
|
}
|
|
174
171
|
return removeUndefined(
|
|
175
|
-
|
|
172
|
+
ctx.options.attachFolder?.(node, folder, meta) ?? node
|
|
176
173
|
);
|
|
177
174
|
}
|
|
178
175
|
function buildFileNode(file, ctx) {
|
|
179
|
-
|
|
180
|
-
const localized = (_a = findLocalizedFile(file.file.flattenedPath, "page", ctx)) != null ? _a : file;
|
|
176
|
+
const localized = findLocalizedFile(file.file.flattenedPath, "page", ctx) ?? file;
|
|
181
177
|
const data = localized.data;
|
|
182
178
|
const item = {
|
|
183
179
|
type: "page",
|
|
184
180
|
name: data.data.title,
|
|
185
|
-
icon:
|
|
181
|
+
icon: ctx.options.resolveIcon?.(data.data.icon),
|
|
186
182
|
url: ctx.options.getUrl(data.slugs, ctx.lang)
|
|
187
183
|
};
|
|
188
|
-
return removeUndefined(
|
|
184
|
+
return removeUndefined(ctx.options.attachFile?.(item, file) ?? item);
|
|
189
185
|
}
|
|
190
186
|
function build(ctx) {
|
|
191
187
|
const root = ctx.storage.root();
|
|
@@ -204,8 +200,7 @@ function createPageTreeBuilder() {
|
|
|
204
200
|
storage: options.storage
|
|
205
201
|
});
|
|
206
202
|
},
|
|
207
|
-
buildI18n(
|
|
208
|
-
var _b = _a, { languages = [], defaultLanguage } = _b, options = __objRest(_b, ["languages", "defaultLanguage"]);
|
|
203
|
+
buildI18n({ languages = [], defaultLanguage, ...options }) {
|
|
209
204
|
const entries = languages.map((lang) => {
|
|
210
205
|
const tree = build({
|
|
211
206
|
lang: lang === defaultLanguage ? void 0 : lang,
|
|
@@ -223,8 +218,15 @@ function findLocalizedFile(path, format, ctx) {
|
|
|
223
218
|
if (!ctx.lang) return;
|
|
224
219
|
return ctx.storage.read(`${path}.${ctx.lang}`, format);
|
|
225
220
|
}
|
|
226
|
-
function pathToName(
|
|
227
|
-
|
|
221
|
+
function pathToName(name, resolveGroup = false) {
|
|
222
|
+
const resolved = resolveGroup ? group.exec(name)?.[1] ?? name : name;
|
|
223
|
+
const result = [];
|
|
224
|
+
for (const c of resolved) {
|
|
225
|
+
if (result.length === 0) result.push(c.toLocaleUpperCase());
|
|
226
|
+
else if (c === "-") result.push(" ");
|
|
227
|
+
else result.push(c);
|
|
228
|
+
}
|
|
229
|
+
return result.join("");
|
|
228
230
|
}
|
|
229
231
|
function removeUndefined(value) {
|
|
230
232
|
const obj = value;
|
|
@@ -263,21 +265,19 @@ var Storage = class {
|
|
|
263
265
|
return this.rootFolder;
|
|
264
266
|
}
|
|
265
267
|
write(path, format, data) {
|
|
266
|
-
var _a;
|
|
267
268
|
const node = {
|
|
268
269
|
format,
|
|
269
270
|
file: parseFilePath(path),
|
|
270
271
|
data
|
|
271
272
|
};
|
|
272
273
|
this.makeDir(node.file.dirname);
|
|
273
|
-
|
|
274
|
+
this.readDir(node.file.dirname)?.children.push(node);
|
|
274
275
|
this.files.set(`${node.file.flattenedPath}.${node.format}`, node);
|
|
275
276
|
}
|
|
276
277
|
list() {
|
|
277
278
|
return [...this.files.values()];
|
|
278
279
|
}
|
|
279
280
|
makeDir(path) {
|
|
280
|
-
var _a;
|
|
281
281
|
const segments = splitPath(path);
|
|
282
282
|
for (let i = 0; i < segments.length; i++) {
|
|
283
283
|
const segment = segments.slice(0, i + 1).join("/");
|
|
@@ -287,17 +287,16 @@ var Storage = class {
|
|
|
287
287
|
children: []
|
|
288
288
|
};
|
|
289
289
|
this.folders.set(folder.file.path, folder);
|
|
290
|
-
|
|
290
|
+
this.readDir(folder.file.dirname)?.children.push(folder);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
294
|
|
|
295
295
|
// src/source/load-files.ts
|
|
296
296
|
function loadFiles(files, options) {
|
|
297
|
-
var _a;
|
|
298
297
|
const { transformers = [] } = options;
|
|
299
298
|
const storage = new Storage();
|
|
300
|
-
const rootDir = normalizePath(
|
|
299
|
+
const rootDir = normalizePath(options.rootDir ?? "");
|
|
301
300
|
for (const file of files) {
|
|
302
301
|
const normalizedPath = normalizePath(file.path);
|
|
303
302
|
if (!normalizedPath.startsWith(rootDir)) continue;
|
|
@@ -327,7 +326,6 @@ function loadFiles(files, options) {
|
|
|
327
326
|
|
|
328
327
|
// src/source/loader.ts
|
|
329
328
|
function buildPageMap(storage, languages, getUrl) {
|
|
330
|
-
var _a;
|
|
331
329
|
const map = /* @__PURE__ */ new Map();
|
|
332
330
|
const defaultMap = /* @__PURE__ */ new Map();
|
|
333
331
|
map.set("", defaultMap);
|
|
@@ -336,12 +334,12 @@ function buildPageMap(storage, languages, getUrl) {
|
|
|
336
334
|
const page = fileToPage(file, getUrl);
|
|
337
335
|
defaultMap.set(page.slugs.join("/"), page);
|
|
338
336
|
for (const lang of languages) {
|
|
339
|
-
const langMap =
|
|
337
|
+
const langMap = map.get(lang) ?? /* @__PURE__ */ new Map();
|
|
340
338
|
const localized = storage.read(
|
|
341
339
|
`${file.file.flattenedPath}.${lang}`,
|
|
342
340
|
"page"
|
|
343
341
|
);
|
|
344
|
-
const localizedPage = fileToPage(localized
|
|
342
|
+
const localizedPage = fileToPage(localized ?? file, getUrl, lang);
|
|
345
343
|
langMap.set(localizedPage.slugs.join("/"), localizedPage);
|
|
346
344
|
map.set(lang, langMap);
|
|
347
345
|
}
|
|
@@ -356,7 +354,8 @@ function createGetUrl(baseUrl) {
|
|
|
356
354
|
}
|
|
357
355
|
function getSlugs(info) {
|
|
358
356
|
const result = [...info.dirname.split("/"), info.name].filter(
|
|
359
|
-
|
|
357
|
+
// filter empty folder names and file groups like (group_name)
|
|
358
|
+
(v) => v.length > 0 && !/^\(.+\)$/.test(v)
|
|
360
359
|
);
|
|
361
360
|
return result[result.length - 1] === "index" ? result.slice(0, -1) : result;
|
|
362
361
|
}
|
|
@@ -383,25 +382,26 @@ function createOutput({
|
|
|
383
382
|
getSlugs: slugsFn
|
|
384
383
|
}
|
|
385
384
|
);
|
|
386
|
-
const i18nMap = buildPageMap(storage, languages
|
|
385
|
+
const i18nMap = buildPageMap(storage, languages ?? [], getUrl);
|
|
387
386
|
const builder = createPageTreeBuilder();
|
|
388
|
-
const pageTree = languages === void 0 ? builder.build(
|
|
387
|
+
const pageTree = languages === void 0 ? builder.build({
|
|
389
388
|
storage,
|
|
390
389
|
resolveIcon,
|
|
391
|
-
getUrl
|
|
392
|
-
|
|
390
|
+
getUrl,
|
|
391
|
+
...pageTreeOptions
|
|
392
|
+
}) : builder.buildI18n({
|
|
393
393
|
languages,
|
|
394
394
|
storage,
|
|
395
395
|
resolveIcon,
|
|
396
396
|
getUrl,
|
|
397
|
-
defaultLanguage
|
|
398
|
-
|
|
397
|
+
defaultLanguage,
|
|
398
|
+
...pageTreeOptions
|
|
399
|
+
});
|
|
399
400
|
return {
|
|
400
401
|
pageTree,
|
|
401
402
|
files: storage.list(),
|
|
402
403
|
getPages(language = "") {
|
|
403
|
-
|
|
404
|
-
return Array.from((_b = (_a = i18nMap.get(language)) == null ? void 0 : _a.values()) != null ? _b : []);
|
|
404
|
+
return Array.from(i18nMap.get(language)?.values() ?? []);
|
|
405
405
|
},
|
|
406
406
|
getLanguages() {
|
|
407
407
|
const list = [];
|
|
@@ -415,8 +415,7 @@ function createOutput({
|
|
|
415
415
|
return list;
|
|
416
416
|
},
|
|
417
417
|
getPage(slugs = [], language = "") {
|
|
418
|
-
|
|
419
|
-
return (_a = i18nMap.get(language)) == null ? void 0 : _a.get(slugs.join("/"));
|
|
418
|
+
return i18nMap.get(language)?.get(slugs.join("/"));
|
|
420
419
|
}
|
|
421
420
|
};
|
|
422
421
|
}
|
package/dist/toc-internal.js
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useOnChange
|
|
3
|
+
} from "./chunk-KGMG4N3Y.js";
|
|
1
4
|
import {
|
|
2
5
|
mergeRefs,
|
|
3
6
|
useAnchorObserver
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import
|
|
6
|
-
__objRest,
|
|
7
|
-
__spreadProps,
|
|
8
|
-
__spreadValues
|
|
9
|
-
} from "./chunk-CWMXXUWU.js";
|
|
7
|
+
} from "./chunk-V6DBK6TW.js";
|
|
8
|
+
import "./chunk-MLKGABMK.js";
|
|
10
9
|
|
|
11
10
|
// src/toc-internal.tsx
|
|
12
|
-
import {
|
|
13
|
-
createContext,
|
|
14
|
-
forwardRef,
|
|
15
|
-
useContext,
|
|
16
|
-
useEffect,
|
|
17
|
-
useMemo,
|
|
18
|
-
useRef
|
|
19
|
-
} from "react";
|
|
11
|
+
import { createContext, forwardRef, useContext, useMemo, useRef } from "react";
|
|
20
12
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
21
13
|
import { jsx } from "react/jsx-runtime";
|
|
22
14
|
var ActiveAnchorContext = createContext(void 0);
|
|
@@ -41,18 +33,16 @@ function AnchorProvider({
|
|
|
41
33
|
return /* @__PURE__ */ jsx(ActiveAnchorContext.Provider, { value: activeAnchor, children });
|
|
42
34
|
}
|
|
43
35
|
var TOCItem = forwardRef(
|
|
44
|
-
(
|
|
45
|
-
var _b = _a, { onActiveChange } = _b, props = __objRest(_b, ["onActiveChange"]);
|
|
36
|
+
({ onActiveChange, ...props }, ref) => {
|
|
46
37
|
const containerRef = useContext(ScrollContext);
|
|
47
38
|
const activeAnchor = useActiveAnchor();
|
|
48
39
|
const anchorRef = useRef(null);
|
|
49
40
|
const mergedRef = mergeRefs(anchorRef, ref);
|
|
50
41
|
const isActive = activeAnchor === props.href.split("#")[1];
|
|
51
|
-
|
|
52
|
-
onActiveRef.current = (active) => {
|
|
42
|
+
useOnChange(isActive, (v) => {
|
|
53
43
|
const element = anchorRef.current;
|
|
54
44
|
if (!element) return;
|
|
55
|
-
if (
|
|
45
|
+
if (v && containerRef.current) {
|
|
56
46
|
scrollIntoView(element, {
|
|
57
47
|
behavior: "smooth",
|
|
58
48
|
block: "center",
|
|
@@ -61,13 +51,9 @@ var TOCItem = forwardRef(
|
|
|
61
51
|
boundary: containerRef.current
|
|
62
52
|
});
|
|
63
53
|
}
|
|
64
|
-
onActiveChange
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var _a2;
|
|
68
|
-
(_a2 = onActiveRef.current) == null ? void 0 : _a2.call(onActiveRef, isActive);
|
|
69
|
-
}, [isActive]);
|
|
70
|
-
return /* @__PURE__ */ jsx("a", __spreadProps(__spreadValues({ ref: mergedRef, "data-active": isActive }, props), { children: props.children }));
|
|
54
|
+
onActiveChange?.(v);
|
|
55
|
+
});
|
|
56
|
+
return /* @__PURE__ */ jsx("a", { ref: mergedRef, "data-active": isActive, ...props, children: props.children });
|
|
71
57
|
}
|
|
72
58
|
);
|
|
73
59
|
TOCItem.displayName = "TOCItem";
|
package/dist/toc.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mergeRefs,
|
|
3
3
|
useAnchorObserver
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import
|
|
6
|
-
__objRest,
|
|
7
|
-
__spreadProps,
|
|
8
|
-
__spreadValues
|
|
9
|
-
} from "./chunk-CWMXXUWU.js";
|
|
4
|
+
} from "./chunk-V6DBK6TW.js";
|
|
5
|
+
import "./chunk-MLKGABMK.js";
|
|
10
6
|
|
|
11
7
|
// src/toc.tsx
|
|
12
8
|
import {
|
|
@@ -25,11 +21,10 @@ var useActiveAnchor = (url) => {
|
|
|
25
21
|
return activeAnchor === url.split("#")[1];
|
|
26
22
|
};
|
|
27
23
|
var TOCProvider = forwardRef(
|
|
28
|
-
(
|
|
29
|
-
var _b = _a, { toc } = _b, props = __objRest(_b, ["toc"]);
|
|
24
|
+
({ toc, ...props }, ref) => {
|
|
30
25
|
const containerRef = useRef(null);
|
|
31
26
|
const mergedRef = mergeRefs(containerRef, ref);
|
|
32
|
-
return /* @__PURE__ */ jsx("div",
|
|
27
|
+
return /* @__PURE__ */ jsx("div", { ref: mergedRef, ...props, children: /* @__PURE__ */ jsx(TOCScrollProvider, { toc, containerRef, children: props.children }) });
|
|
33
28
|
}
|
|
34
29
|
);
|
|
35
30
|
TOCProvider.displayName = "TOCProvider";
|
|
@@ -45,8 +40,7 @@ function TOCScrollProvider({
|
|
|
45
40
|
return /* @__PURE__ */ jsx(ActiveAnchorContext.Provider, { value: { containerRef, activeAnchor }, children });
|
|
46
41
|
}
|
|
47
42
|
var TOCItem = forwardRef(
|
|
48
|
-
(
|
|
49
|
-
var _b = _a, { containerRef: container } = _b, props = __objRest(_b, ["containerRef"]);
|
|
43
|
+
({ containerRef: container, ...props }, ref) => {
|
|
50
44
|
const { containerRef = container } = useContext(ActiveAnchorContext);
|
|
51
45
|
const active = useActiveAnchor(props.href);
|
|
52
46
|
const anchorRef = useRef(null);
|
|
@@ -63,7 +57,7 @@ var TOCItem = forwardRef(
|
|
|
63
57
|
});
|
|
64
58
|
}
|
|
65
59
|
}, [active, containerRef]);
|
|
66
|
-
return /* @__PURE__ */ jsx("a",
|
|
60
|
+
return /* @__PURE__ */ jsx("a", { ref: mergedRef, "data-active": active, ...props, children: props.children });
|
|
67
61
|
}
|
|
68
62
|
);
|
|
69
63
|
TOCItem.displayName = "TOCItem";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "12.5.
|
|
3
|
+
"version": "12.5.4",
|
|
4
4
|
"description": "The library for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
"import": "./dist/source/index.js",
|
|
49
49
|
"types": "./dist/source/index.d.ts"
|
|
50
50
|
},
|
|
51
|
+
"./utils/use-on-change": {
|
|
52
|
+
"import": "./dist/utils/use-on-change.js",
|
|
53
|
+
"types": "./dist/utils/use-on-change.d.ts"
|
|
54
|
+
},
|
|
51
55
|
"./link": {
|
|
52
56
|
"import": "./dist/link.js",
|
|
53
57
|
"types": "./dist/link.d.ts"
|
|
@@ -104,6 +108,9 @@
|
|
|
104
108
|
"middleware": [
|
|
105
109
|
"./dist/middleware.d.ts"
|
|
106
110
|
],
|
|
111
|
+
"utils/use-on-change": [
|
|
112
|
+
"./dist/utils/use-on-change.d.ts"
|
|
113
|
+
],
|
|
107
114
|
"mdx-plugins": [
|
|
108
115
|
"./dist/mdx-plugins/index.d.ts"
|
|
109
116
|
],
|
|
@@ -143,7 +150,7 @@
|
|
|
143
150
|
"@types/hast": "^3.0.4",
|
|
144
151
|
"@types/mdast": "^4.0.3",
|
|
145
152
|
"@types/negotiator": "^0.6.3",
|
|
146
|
-
"@types/node": "20.14.
|
|
153
|
+
"@types/node": "20.14.11",
|
|
147
154
|
"@types/react": "^18.3.3",
|
|
148
155
|
"@types/react-dom": "^18.3.0",
|
|
149
156
|
"algoliasearch": "^4.24.0",
|
package/dist/chunk-CWMXXUWU.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __export = (target, all) => {
|
|
33
|
-
for (var name in all)
|
|
34
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
35
|
-
};
|
|
36
|
-
var __async = (__this, __arguments, generator) => {
|
|
37
|
-
return new Promise((resolve, reject) => {
|
|
38
|
-
var fulfilled = (value) => {
|
|
39
|
-
try {
|
|
40
|
-
step(generator.next(value));
|
|
41
|
-
} catch (e) {
|
|
42
|
-
reject(e);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var rejected = (value) => {
|
|
46
|
-
try {
|
|
47
|
-
step(generator.throw(value));
|
|
48
|
-
} catch (e) {
|
|
49
|
-
reject(e);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
53
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export {
|
|
58
|
-
__spreadValues,
|
|
59
|
-
__spreadProps,
|
|
60
|
-
__objRest,
|
|
61
|
-
__export,
|
|
62
|
-
__async
|
|
63
|
-
};
|
package/dist/chunk-XB7CNOKH.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__objRest,
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
} from "./chunk-CWMXXUWU.js";
|
|
6
|
-
|
|
7
|
-
// src/link.tsx
|
|
8
|
-
import Original from "next/link";
|
|
9
|
-
import { forwardRef } from "react";
|
|
10
|
-
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
var Link = forwardRef(
|
|
12
|
-
(_a, ref) => {
|
|
13
|
-
var _b = _a, {
|
|
14
|
-
href = "#",
|
|
15
|
-
external = !(href.startsWith("/") || href.startsWith("#") || href.startsWith("."))
|
|
16
|
-
} = _b, props = __objRest(_b, [
|
|
17
|
-
"href",
|
|
18
|
-
"external"
|
|
19
|
-
]);
|
|
20
|
-
if (external) {
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
-
"a",
|
|
23
|
-
__spreadProps(__spreadValues({
|
|
24
|
-
ref,
|
|
25
|
-
href,
|
|
26
|
-
rel: "noreferrer noopener",
|
|
27
|
-
target: "_blank"
|
|
28
|
-
}, props), {
|
|
29
|
-
children: props.children
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
return /* @__PURE__ */ jsx(Original, __spreadValues({ ref, href }, props));
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
Link.displayName = "Link";
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
Link
|
|
40
|
-
};
|