blume 0.6.4 → 0.6.6

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/cli/index.js CHANGED
@@ -9734,12 +9734,25 @@ var sortNodes = (nodes) => {
9734
9734
  }
9735
9735
  }
9736
9736
  };
9737
- var hoistPages = (nodes) => {
9737
+ var hoistPages = (nodes, recurse) => {
9738
9738
  const pages = nodes.filter((node) => node.kind === "page");
9739
9739
  const groups = nodes.filter((node) => node.kind === "group");
9740
9740
  nodes.splice(0, nodes.length, ...pages, ...groups);
9741
- for (const group of groups) {
9742
- hoistPages(group.children);
9741
+ if (recurse) {
9742
+ for (const group of groups) {
9743
+ hoistPages(group.children, recurse);
9744
+ }
9745
+ }
9746
+ };
9747
+ var hoistTabSections = (nodes, tabPaths, recurse) => {
9748
+ for (const node of nodes) {
9749
+ if (node.kind !== "group") {
9750
+ continue;
9751
+ }
9752
+ if (node.routePath !== undefined && tabPaths.has(node.routePath)) {
9753
+ hoistPages(node.children, recurse);
9754
+ }
9755
+ hoistTabSections(node.children, tabPaths, recurse);
9743
9756
  }
9744
9757
  };
9745
9758
  var toNavNode = (node, display) => {
@@ -9765,7 +9778,7 @@ var toNavNode = (node, display) => {
9765
9778
  path: node.routePath
9766
9779
  };
9767
9780
  };
9768
- var buildFileSystemSidebar = (pages, folderMeta, sharedMeta, metaPrefix, display) => {
9781
+ var buildFileSystemSidebar = (pages, folderMeta, sharedMeta, metaPrefix, display, tabPaths) => {
9769
9782
  const root = createGroup("", "", "", 0);
9770
9783
  for (const page of pages) {
9771
9784
  if (page.meta.sidebar.hidden) {
@@ -9803,9 +9816,8 @@ var buildFileSystemSidebar = (pages, folderMeta, sharedMeta, metaPrefix, display
9803
9816
  }
9804
9817
  applyFolderMeta(root, folderMeta, sharedMeta, metaPrefix);
9805
9818
  sortNodes(root.children);
9806
- if (display === "flat") {
9807
- hoistPages(root.children);
9808
- }
9819
+ hoistPages(root.children, display === "flat");
9820
+ hoistTabSections(root.children, tabPaths, display === "flat");
9809
9821
  return root.children.map((child) => toNavNode(child, display));
9810
9822
  };
9811
9823
  var normalizeRef = (ref) => {
@@ -9904,7 +9916,7 @@ var buildNavigation = (pages, options) => {
9904
9916
  return {
9905
9917
  featured,
9906
9918
  selectors,
9907
- sidebar: buildFileSystemSidebar(pages, options.folderMeta, sharedFolderMeta, metaPrefix, display),
9919
+ sidebar: buildFileSystemSidebar(pages, options.folderMeta, sharedFolderMeta, metaPrefix, display, new Set(tabs.map((tab) => tab.path).filter((path) => path !== "/"))),
9908
9920
  tabs
9909
9921
  };
9910
9922
  };
@@ -11911,5 +11923,5 @@ process.on("unhandledRejection", (error) => {
11911
11923
  });
11912
11924
  runMain(main);
11913
11925
 
11914
- //# debugId=E4B96AC474347DAD64756E2164756E21
11926
+ //# debugId=356EB2263169E1CA64756E2164756E21
11915
11927
  //# sourceMappingURL=index.js.map