fumadocs-core 12.5.1 → 12.5.2
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 +5 -2
- package/dist/breadcrumb.js +2 -2
- package/package.json +1 -1
package/dist/breadcrumb.d.ts
CHANGED
|
@@ -7,11 +7,14 @@ interface BreadcrumbItem {
|
|
|
7
7
|
}
|
|
8
8
|
interface BreadcrumbOptions extends SearchOptions {
|
|
9
9
|
/**
|
|
10
|
-
* Include the root itself in the breadcrumb items array
|
|
10
|
+
* Include the root itself in the breadcrumb items array.
|
|
11
|
+
* Specify the url by passing an object instead
|
|
11
12
|
*
|
|
12
13
|
* @defaultValue false
|
|
13
14
|
*/
|
|
14
|
-
includeRoot?: boolean
|
|
15
|
+
includeRoot?: boolean | {
|
|
16
|
+
url: string;
|
|
17
|
+
};
|
|
15
18
|
}
|
|
16
19
|
declare function useBreadcrumb(url: string, tree: Root, options?: BreadcrumbOptions): BreadcrumbItem[];
|
|
17
20
|
declare function getBreadcrumbItems(url: string, tree: Root, options?: BreadcrumbOptions): BreadcrumbItem[];
|
package/dist/breadcrumb.js
CHANGED
|
@@ -11,13 +11,13 @@ function useBreadcrumb(url, tree, options) {
|
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
13
|
function getBreadcrumbItems(url, tree, options = {}) {
|
|
14
|
-
var _b
|
|
14
|
+
var _b;
|
|
15
15
|
const _a = options, { includeRoot } = _a, rest = __objRest(_a, ["includeRoot"]);
|
|
16
16
|
const path = (_b = searchPath(tree.children, url, rest)) != null ? _b : [];
|
|
17
17
|
if (includeRoot) {
|
|
18
18
|
path.unshift({
|
|
19
19
|
name: tree.name,
|
|
20
|
-
url:
|
|
20
|
+
url: typeof includeRoot === "object" ? includeRoot.url : void 0
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
return path;
|