fumadocs-core 15.0.6 → 15.0.7
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.d.ts +1 -1
- package/dist/{page-tree-r8qjoUla.d.ts → page-tree-B1oLifVu.d.ts} +1 -0
- package/dist/search/server.d.ts +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/source/index.d.ts +1 -1
- package/dist/source/index.js +4 -4
- package/dist/utils/use-effect-event.d.ts +8 -0
- package/dist/utils/use-effect-event.js +13 -0
- package/package.json +5 -1
package/dist/breadcrumb.d.ts
CHANGED
package/dist/search/server.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import 'mdast';
|
|
|
8
8
|
import 'unified';
|
|
9
9
|
import 'unist-util-visit';
|
|
10
10
|
import 'react';
|
|
11
|
-
import '../page-tree-
|
|
11
|
+
import '../page-tree-B1oLifVu.js';
|
|
12
12
|
|
|
13
13
|
type AdvancedDocument = TypedDocument<Orama<typeof advancedSchema>>;
|
|
14
14
|
declare const advancedSchema: {
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { a as TOCItemType, T as TableOfContents, g as getTableOfContents } from '../get-toc-Cr2URuiP.js';
|
|
2
|
-
import { N as Node, I as Item, R as Root } from '../page-tree-
|
|
3
|
-
export { p as PageTree } from '../page-tree-
|
|
2
|
+
import { N as Node, I as Item, R as Root } from '../page-tree-B1oLifVu.js';
|
|
3
|
+
export { p as PageTree } from '../page-tree-B1oLifVu.js';
|
|
4
4
|
export { S as SortedResult } from '../types-Ch8gnVgO.js';
|
|
5
5
|
import { Metadata } from 'next';
|
|
6
6
|
import { NextRequest } from 'next/server';
|
package/dist/source/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { I as I18nConfig } from '../config-inq6kP6y.js';
|
|
3
|
-
import { R as Root, I as Item, F as Folder$1, S as Separator } from '../page-tree-
|
|
3
|
+
import { R as Root, I as Item, F as Folder$1, S as Separator } from '../page-tree-B1oLifVu.js';
|
|
4
4
|
|
|
5
5
|
interface FileInfo {
|
|
6
6
|
/**
|
package/dist/source/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
// src/source/page-tree-builder.ts
|
|
14
14
|
var group = /^\((?<name>.+)\)$/;
|
|
15
15
|
var link = /^(?:\[(?<icon>[^\]]+)])?\[(?<name>[^\]]+)]\((?<url>[^)]+)\)$/;
|
|
16
|
-
var separator = /^---(?<name
|
|
16
|
+
var separator = /^---(?:\[(?<icon>[^\]]+)])?(?<name>.+)---$/;
|
|
17
17
|
var rest = "...";
|
|
18
18
|
var restReversed = "z...a";
|
|
19
19
|
var extractPrefix = "...";
|
|
@@ -52,9 +52,10 @@ function resolveFolderItem(folder, item, ctx, addedNodePaths) {
|
|
|
52
52
|
if (match?.groups) {
|
|
53
53
|
const node = {
|
|
54
54
|
type: "separator",
|
|
55
|
+
icon: ctx.options.resolveIcon?.(match.groups.icon),
|
|
55
56
|
name: match.groups.name
|
|
56
57
|
};
|
|
57
|
-
return [ctx.options.attachSeparator?.(node) ?? node];
|
|
58
|
+
return [removeUndefined(ctx.options.attachSeparator?.(node) ?? node)];
|
|
58
59
|
}
|
|
59
60
|
match = link.exec(item);
|
|
60
61
|
if (match?.groups) {
|
|
@@ -89,8 +90,7 @@ function resolveFolderItem(folder, item, ctx, addedNodePaths) {
|
|
|
89
90
|
}
|
|
90
91
|
function buildFolderNode(folder, isGlobalRoot, ctx) {
|
|
91
92
|
const metaPath = resolvePath(folder.file.path, "meta");
|
|
92
|
-
|
|
93
|
-
meta = findLocalizedFile(metaPath, "meta", ctx) ?? meta;
|
|
93
|
+
const meta = findLocalizedFile(metaPath, "meta", ctx) ?? ctx.storage.read(metaPath, "meta");
|
|
94
94
|
const indexFile = ctx.storage.read(
|
|
95
95
|
resolvePath(folder.file.flattenedPath, "index"),
|
|
96
96
|
"page"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-MLKGABMK.js";
|
|
3
|
+
|
|
4
|
+
// src/utils/use-effect-event.ts
|
|
5
|
+
import { useCallback, useRef } from "react";
|
|
6
|
+
function useEffectEvent(callback) {
|
|
7
|
+
const ref = useRef(callback);
|
|
8
|
+
ref.current = callback;
|
|
9
|
+
return useCallback((...params) => ref.current(...params), []);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
useEffectEvent
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-core",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.7",
|
|
4
4
|
"description": "The library for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -56,6 +56,10 @@
|
|
|
56
56
|
"import": "./dist/utils/use-shiki.js",
|
|
57
57
|
"types": "./dist/utils/use-shiki.d.ts"
|
|
58
58
|
},
|
|
59
|
+
"./utils/use-effect-event": {
|
|
60
|
+
"import": "./dist/utils/use-effect-event.js",
|
|
61
|
+
"types": "./dist/utils/use-effect-event.d.ts"
|
|
62
|
+
},
|
|
59
63
|
"./link": {
|
|
60
64
|
"import": "./dist/link.js",
|
|
61
65
|
"types": "./dist/link.d.ts"
|