@salesforcedevs/dx-components 1.40.0-integration-alpha1 → 1.40.0-integration-alpha2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.40.0-integration-alpha1",
3
+ "version": "1.40.0-integration-alpha2",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -21,6 +21,10 @@ export type VersionedNode = {
21
21
  };
22
22
  children?: VersionedNode[];
23
23
  versions?: TopicVersionOption[];
24
+ /** Set on Redoc spec tiles after the docs layout decorates the TOC. */
25
+ showForwardArrow?: boolean;
26
+ /** Docs TOC topic type (`markdown` | `spec`). May be stripped after decoration. */
27
+ topicType?: string;
24
28
  };
25
29
 
26
30
  type VersionPathDelta = {
@@ -113,14 +117,19 @@ export function isParentOnlyTopic(node: VersionedNode | undefined): boolean {
113
117
  return !ownHref && !!node.children?.length;
114
118
  }
115
119
 
120
+ function isSpecNode(node: VersionedNode): boolean {
121
+ return node.showForwardArrow === true || node.topicType === "spec";
122
+ }
123
+
116
124
  /**
117
- * First descendant that has a page (own href/name). Used so parent-only
118
- * sections select and navigate to content instead of an empty header.
125
+ * First descendant that has a markdown page (own href/name). Specs (Redoc)
126
+ * and external links are skipped so parent-only sections land on the first
127
+ * markdown topic even when a spec is authored first in the TOC.
119
128
  */
120
129
  export function firstContentNode(
121
130
  node: VersionedNode | undefined
122
131
  ): VersionedNode | undefined {
123
- if (!node || node.link?.target === "_blank") {
132
+ if (!node || node.link?.target === "_blank" || isSpecNode(node)) {
124
133
  return undefined;
125
134
  }
126
135
  if (node.link?.href || node.name) {