fumadocs-core 12.5.0 → 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.
@@ -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[];
@@ -11,13 +11,13 @@ function useBreadcrumb(url, tree, options) {
11
11
  );
12
12
  }
13
13
  function getBreadcrumbItems(url, tree, options = {}) {
14
- var _b, _c;
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: (_c = tree.children.find((p) => p.type === "page")) == null ? void 0 : _c.url
20
+ url: typeof includeRoot === "object" ? includeRoot.url : void 0
21
21
  });
22
22
  }
23
23
  return path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "12.5.0",
3
+ "version": "12.5.2",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",