@fern-api/fdr-sdk 1.2.45-932269c163 → 1.2.45-9cc0fe9249
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 +14 -6
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +14 -6
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.landingPageRedirect.test.d.ts +2 -0
- package/dist/navigation/__test__/ledger-root-builder.landingPageRedirect.test.d.ts.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.landingPageRedirect.test.js +227 -0
- package/dist/navigation/__test__/ledger-root-builder.landingPageRedirect.test.js.map +1 -0
- package/dist/navigation/__test__/ledger-root-builder.unversionedPointsTo.test.js +59 -1
- package/dist/navigation/__test__/ledger-root-builder.unversionedPointsTo.test.js.map +1 -1
- package/dist/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/navigation/ledger-root-builder.js +22 -8
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/__test__/ledger-root-builder.landingPageRedirect.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.landingPageRedirect.test.d.ts.map +1 -0
- package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1347,7 +1347,7 @@ function mergeChildrenByPosition(ctx, nav, sectionChildren) {
|
|
|
1347
1347
|
function sectionNode(ctx, scoped, sectionChildren, scopePrefix) {
|
|
1348
1348
|
const { seg, nav } = scoped;
|
|
1349
1349
|
const overview = overviewRoute(nav) ?? overviewRouteFromSegmentMeta(seg, nav);
|
|
1350
|
-
const overviewPageId =
|
|
1350
|
+
const overviewPageId = metaStr(seg.metadata, "overviewPageId");
|
|
1351
1351
|
const relSection = stripLeadingScopePrefix(seg.section, scopePrefix);
|
|
1352
1352
|
let slug = structuralNodeSlug(ctx, overview?.fullPath, relSection, scopePrefix);
|
|
1353
1353
|
if (relSection === "" && overview?.fullPath == null) {
|
|
@@ -1360,7 +1360,6 @@ function sectionNode(ctx, scoped, sectionChildren, scopePrefix) {
|
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
|
-
const metaPointsTo = metaStr(seg.metadata, "pointsTo");
|
|
1364
1363
|
const defaults = withMetadataDefaults({
|
|
1365
1364
|
id: ctx.nodeId(`section:${slug}`),
|
|
1366
1365
|
title: metaStr(seg.metadata, "title") ?? "",
|
|
@@ -1381,7 +1380,10 @@ function sectionNode(ctx, scoped, sectionChildren, scopePrefix) {
|
|
|
1381
1380
|
collapsible: metaBool(seg.metadata, "collapsible") ?? (metaCollapsed(seg.metadata) === true ? true : void 0),
|
|
1382
1381
|
collapsedByDefault: metaBool(seg.metadata, "collapsedByDefault") ?? (metaCollapsed(seg.metadata) === true ? true : void 0),
|
|
1383
1382
|
availability: metaAvailability(seg.metadata),
|
|
1384
|
-
|
|
1383
|
+
// Don't read pointsTo from metadata for sections; let
|
|
1384
|
+
// mutableUpdatePointsTo compute it via followRedirect so that
|
|
1385
|
+
// self-referencing redirects are cleared, matching v2 behavior.
|
|
1386
|
+
pointsTo: void 0,
|
|
1385
1387
|
children: mergeChildrenByPosition(ctx, nav, sectionChildren)
|
|
1386
1388
|
};
|
|
1387
1389
|
}
|
|
@@ -2022,13 +2024,19 @@ function buildFullRootFromSegments(options) {
|
|
|
2022
2024
|
}
|
|
2023
2025
|
let rootPointsTo;
|
|
2024
2026
|
if (child.type === "productgroup") {
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
+
if (child.landingPage != null && !child.landingPage.hidden) {
|
|
2028
|
+
rootPointsTo = child.landingPage.slug;
|
|
2029
|
+
} else {
|
|
2030
|
+
const defaultProduct = child.children.find((p) => p.default) ?? child.children[0];
|
|
2031
|
+
rootPointsTo = defaultProduct?.type === "product" ? defaultProduct.pointsTo : void 0;
|
|
2032
|
+
}
|
|
2027
2033
|
} else if (child.type === "versioned") {
|
|
2028
2034
|
const defaultVersion = child.children.find((v) => v.default) ?? child.children[0];
|
|
2029
2035
|
rootPointsTo = defaultVersion?.pointsTo;
|
|
2030
2036
|
} else if (child.type === "unversioned") {
|
|
2031
|
-
if (
|
|
2037
|
+
if (child.landingPage != null && !child.landingPage.hidden) {
|
|
2038
|
+
rootPointsTo = child.landingPage.slug;
|
|
2039
|
+
} else if (tabs.length > 0) {
|
|
2032
2040
|
const firstTab = tabs[0];
|
|
2033
2041
|
const pt = firstTab != null ? metaStr(firstTab.metadata, "pointsTo") : void 0;
|
|
2034
2042
|
rootPointsTo = pt != null ? pointsToSlug(pt) : void 0;
|