@fern-api/fdr-sdk 1.2.42-b174eece86 → 1.2.42-d3871329d3

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.
@@ -1726,7 +1726,11 @@ function computeSiblingSortBoundaries(ordered) {
1726
1726
  for (const s of ordered) {
1727
1727
  const type = metaStr(s.seg.metadata, "type");
1728
1728
  const sec = s.seg.section;
1729
- if (type !== "section" || sec === "") {
1729
+ if (type !== "section") {
1730
+ continue;
1731
+ }
1732
+ if (sec === "") {
1733
+ rootSections.push(s);
1730
1734
  continue;
1731
1735
  }
1732
1736
  const parent = parentSectionPath(sec);
@@ -1778,7 +1782,9 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
1778
1782
  continue;
1779
1783
  }
1780
1784
  if (type === "section" && sec === "") {
1781
- const sectionChildren = buildSectionTree(ctx, scopeSegs, "", scopePrefix);
1785
+ const bounds = siblingBoundaries.get(s);
1786
+ const ownedSegs = bounds != null ? scopeSegs.filter((seg) => seg.seg.sortOrder >= bounds.lo && seg.seg.sortOrder < bounds.hi) : scopeSegs;
1787
+ const sectionChildren = buildSectionTree(ctx, ownedSegs, "", scopePrefix, changelogScopePrefix);
1782
1788
  const node = sectionNode(ctx, s, sectionChildren, scopePrefix);
1783
1789
  annotated.push({ node, pos: metaNum(s.seg.metadata, "childIndex"), isLeaf: false });
1784
1790
  continue;