@fern-api/fdr-sdk 1.2.44-2a040afc4c → 1.2.44-ef8582fd87

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.
@@ -1854,6 +1854,9 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1854
1854
  const hasRootSection = ordered.some(
1855
1855
  (s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "" && (metaNum(s.seg.metadata, "childIndex") == null || siblingBoundaries.has(s))
1856
1856
  );
1857
+ const hasTrueRootWrapper = ordered.some(
1858
+ (s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "" && metaNum(s.seg.metadata, "childIndex") == null
1859
+ );
1857
1860
  const depth0SectionPaths = /* @__PURE__ */ new Set();
1858
1861
  for (const s of ordered) {
1859
1862
  if (metaStr(s.seg.metadata, "type") === "section" && metaNum(s.seg.metadata, "sidebarDepth") === 0) {
@@ -1888,7 +1891,15 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1888
1891
  }
1889
1892
  if (type === "section" && sec === "" && hasRootSection) {
1890
1893
  const bounds = siblingBoundaries.get(s);
1891
- const ownedSegs = bounds != null ? scopeSegs.filter((seg) => seg.seg.sortOrder >= bounds.lo && seg.seg.sortOrder < bounds.hi) : scopeSegs;
1894
+ let ownedSegs = bounds != null ? scopeSegs.filter((seg) => seg.seg.sortOrder >= bounds.lo && seg.seg.sortOrder < bounds.hi) : scopeSegs;
1895
+ if (!hasTrueRootWrapper) {
1896
+ ownedSegs = ownedSegs.filter((o) => {
1897
+ if (o.seg.section === "") {
1898
+ return true;
1899
+ }
1900
+ return metaNum(o.seg.metadata, "sidebarDepth") != null;
1901
+ });
1902
+ }
1892
1903
  const sectionChildren = buildSectionTree(ctx, ownedSegs, "", scopePrefix, changelogScopePrefix);
1893
1904
  const node = sectionNode(ctx, s, sectionChildren, scopePrefix);
1894
1905
  annotated.push({ node, pos: metaNum(s.seg.metadata, "childIndex"), isLeaf: false });
@@ -1897,7 +1908,7 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1897
1908
  const depth = metaNum(s.seg.metadata, "sidebarDepth");
1898
1909
  const parent = parentSectionPath(sec);
1899
1910
  const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
1900
- if (isRootLevel && hasRootSection && sec !== "" && depth !== 0) {
1911
+ if (isRootLevel && hasRootSection && sec !== "" && (depth != null ? depth !== 0 : hasTrueRootWrapper)) {
1901
1912
  continue;
1902
1913
  }
1903
1914
  if (isRootLevel && depth != null && depth > 0 && depth0SectionPaths.has(sec)) {