@fern-api/fdr-sdk 1.2.56-a6947428a1 → 1.2.57-4cf0b0d54d
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 +18 -4
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +18 -4
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js +7 -5
- package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js.map +1 -1
- package/dist/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/navigation/ledger-root-builder.js +44 -14
- 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 +1 -1
|
@@ -1949,17 +1949,31 @@ function buildSidebarRootChildren(ctx, scopeSegs, scopePrefix, changelogScopePre
|
|
|
1949
1949
|
const sectionChildren = isUnboundedSkipSlugSibling && !hasDepthMarkedChildren ? [] : buildSectionTree(ctx, ownedSegs, sec, scopePrefix, changelogScopePrefix);
|
|
1950
1950
|
node = sectionNode(ctx, s, sectionChildren, scopePrefix);
|
|
1951
1951
|
}
|
|
1952
|
-
const isSharedSection = siblingBoundaries.size > 0 && scopePrefix !== "" && sec !== "" && !sec.startsWith(scopePrefix);
|
|
1953
1952
|
annotated.push({
|
|
1954
1953
|
node,
|
|
1955
|
-
pos:
|
|
1954
|
+
pos: metaNum(s.seg.metadata, "childIndex"),
|
|
1956
1955
|
isLeaf: false
|
|
1957
1956
|
});
|
|
1958
1957
|
}
|
|
1959
1958
|
}
|
|
1960
1959
|
const hasLeafPos = annotated.some((a) => a.isLeaf && a.pos != null);
|
|
1961
1960
|
const hasSegmentPos = annotated.some((a) => !a.isLeaf && a.pos != null);
|
|
1962
|
-
const
|
|
1961
|
+
const inferredPos = annotated.map((a) => a.pos);
|
|
1962
|
+
if (hasLeafPos && hasSegmentPos) {
|
|
1963
|
+
let nextSegPos;
|
|
1964
|
+
for (let i = annotated.length - 1; i >= 0; i--) {
|
|
1965
|
+
const a = annotated[i];
|
|
1966
|
+
if (a == null || a.isLeaf) {
|
|
1967
|
+
continue;
|
|
1968
|
+
}
|
|
1969
|
+
if (a.pos != null) {
|
|
1970
|
+
nextSegPos = a.pos;
|
|
1971
|
+
} else if (nextSegPos != null) {
|
|
1972
|
+
inferredPos[i] = nextSegPos - 0.5;
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
const flat = hasLeafPos && hasSegmentPos ? annotated.map((a, seq) => ({ ...a, pos: inferredPos[seq], seq })).sort(
|
|
1963
1977
|
(x, y) => (x.pos ?? Number.MAX_SAFE_INTEGER) - (y.pos ?? Number.MAX_SAFE_INTEGER) || // When positions tie, prefer structural nodes (sections) over
|
|
1964
1978
|
// leaves (pages). This handles stale tabRoot nav entries whose
|
|
1965
1979
|
// displaySortOrder wasn't updated due to content-addressing
|
|
@@ -1986,7 +2000,7 @@ function groupSidebarRootChildren(ctx, children) {
|
|
|
1986
2000
|
if (child.type === "apiReference" || child.type === "varianted") {
|
|
1987
2001
|
flushRun();
|
|
1988
2002
|
out.push(child);
|
|
1989
|
-
} else if (child.type === "section" && !child.collapsible) {
|
|
2003
|
+
} else if (child.type === "section" && child.collapsed == null && !child.collapsible) {
|
|
1990
2004
|
flushRun();
|
|
1991
2005
|
out.push(child);
|
|
1992
2006
|
} else {
|