@fern-api/fdr-sdk 1.2.44-345d4ef0ea → 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.
- package/dist/js/navigation/ledger-root-builder.js +20 -2
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +20 -2
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js +5 -5
- package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js +194 -0
- package/dist/navigation/__test__/ledger-root-builder.sidebarDepth.test.js.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.skipSlugSiblingSection.test.js +86 -0
- package/dist/navigation/__test__/ledger-root-builder.skipSlugSiblingSection.test.js.map +1 -1
- package/dist/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/navigation/ledger-root-builder.js +38 -4
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1759,6 +1759,13 @@ function buildSectionTree(ctx, scopeSegs, parentPath, scopePrefix, changelogScop
|
|
|
1759
1759
|
if (!sectionPaths.has(parent)) {
|
|
1760
1760
|
return nearestExistingAncestor(sec, sectionPaths) === parentPath;
|
|
1761
1761
|
}
|
|
1762
|
+
if (depth != null) {
|
|
1763
|
+
const pSeg = scopeSegs.find((c) => c.seg.section === parent);
|
|
1764
|
+
const pDepth = pSeg != null ? metaNum(pSeg.seg.metadata, "sidebarDepth") : void 0;
|
|
1765
|
+
if (pDepth != null && depth <= pDepth) {
|
|
1766
|
+
return nearestExistingAncestor(parent, sectionPaths) === parentPath;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1762
1769
|
return false;
|
|
1763
1770
|
}).sort((a, b) => a.seg.sortOrder - b.seg.sortOrder);
|
|
1764
1771
|
const siblingBoundaries = computeDuplicateSiblingSortBoundaries(direct);
|
|
@@ -1847,6 +1854,9 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1847
1854
|
const hasRootSection = ordered.some(
|
|
1848
1855
|
(s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "" && (metaNum(s.seg.metadata, "childIndex") == null || siblingBoundaries.has(s))
|
|
1849
1856
|
);
|
|
1857
|
+
const hasTrueRootWrapper = ordered.some(
|
|
1858
|
+
(s) => metaStr(s.seg.metadata, "type") === "section" && s.seg.section === "" && metaNum(s.seg.metadata, "childIndex") == null
|
|
1859
|
+
);
|
|
1850
1860
|
const depth0SectionPaths = /* @__PURE__ */ new Set();
|
|
1851
1861
|
for (const s of ordered) {
|
|
1852
1862
|
if (metaStr(s.seg.metadata, "type") === "section" && metaNum(s.seg.metadata, "sidebarDepth") === 0) {
|
|
@@ -1881,7 +1891,15 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1881
1891
|
}
|
|
1882
1892
|
if (type === "section" && sec === "" && hasRootSection) {
|
|
1883
1893
|
const bounds = siblingBoundaries.get(s);
|
|
1884
|
-
|
|
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
|
+
}
|
|
1885
1903
|
const sectionChildren = buildSectionTree(ctx, ownedSegs, "", scopePrefix, changelogScopePrefix);
|
|
1886
1904
|
const node = sectionNode(ctx, s, sectionChildren, scopePrefix);
|
|
1887
1905
|
annotated.push({ node, pos: metaNum(s.seg.metadata, "childIndex"), isLeaf: false });
|
|
@@ -1890,7 +1908,7 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1890
1908
|
const depth = metaNum(s.seg.metadata, "sidebarDepth");
|
|
1891
1909
|
const parent = parentSectionPath(sec);
|
|
1892
1910
|
const isRootLevel = depth === 0 || parent === "" || !sectionPaths.has(parent) && nearestExistingAncestor(sec, sectionPaths) === "";
|
|
1893
|
-
if (isRootLevel && hasRootSection && sec !== "" && depth !== 0) {
|
|
1911
|
+
if (isRootLevel && hasRootSection && sec !== "" && (depth != null ? depth !== 0 : hasTrueRootWrapper)) {
|
|
1894
1912
|
continue;
|
|
1895
1913
|
}
|
|
1896
1914
|
if (isRootLevel && depth != null && depth > 0 && depth0SectionPaths.has(sec)) {
|