fumadocs-core 13.0.7 → 13.2.0

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.
@@ -65,6 +65,7 @@ var separator = /^---(?<name>.*?)---$/;
65
65
  var rest = "...";
66
66
  function buildAll(nodes, ctx, skipIndex) {
67
67
  const output = [];
68
+ const folders = [];
68
69
  for (const node of [...nodes].sort(
69
70
  (a, b) => a.file.name.localeCompare(b.file.name)
70
71
  )) {
@@ -77,9 +78,10 @@ function buildAll(nodes, ctx, skipIndex) {
77
78
  output.push(treeNode);
78
79
  }
79
80
  if ("children" in node) {
80
- output.push(buildFolderNode(node, false, ctx));
81
+ folders.push(buildFolderNode(node, false, ctx));
81
82
  }
82
83
  }
84
+ output.push(...folders);
83
85
  return output;
84
86
  }
85
87
  function resolveFolderItem(folder, item, ctx, addedNodePaths) {
@@ -350,11 +352,13 @@ function createGetUrl(baseUrl) {
350
352
  };
351
353
  }
352
354
  function getSlugs(info) {
353
- const result = [...info.dirname.split("/"), info.name].filter(
355
+ return [...info.dirname.split("/"), info.name].filter(
354
356
  // filter empty folder names and file groups like (group_name)
355
- (v) => v.length > 0 && !/^\(.+\)$/.test(v)
357
+ (v, i, arr) => {
358
+ if (v.length === 0) return false;
359
+ return i === arr.length - 1 ? v !== "index" : !/^\(.+\)$/.test(v);
360
+ }
356
361
  );
357
- return result[result.length - 1] === "index" ? result.slice(0, -1) : result;
358
362
  }
359
363
  function loader(options) {
360
364
  return createOutput(options);
package/dist/toc.js CHANGED
@@ -36,7 +36,7 @@ function useAnchorObserver(watch) {
36
36
  return f ?? watch[0];
37
37
  });
38
38
  },
39
- { rootMargin: `-60px 0% -70% 0%`, threshold: 1 }
39
+ { rootMargin: `-100px 0% -75% 0%`, threshold: 1 }
40
40
  );
41
41
  const scroll = () => {
42
42
  const element = document.scrollingElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "13.0.7",
3
+ "version": "13.2.0",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",