@mintlify/common 1.0.670 → 1.0.672

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.
@@ -22,8 +22,8 @@ function generatePathToHiddenDictRecursive(pathToHiddenDict, nav, parentHidden)
22
22
  if (isPage(nav)) {
23
23
  const key = optionallyRemoveLeadingSlash(nav.href);
24
24
  // A page is hidden if parent has hidden: true OR page has noindex: true in frontmatter
25
- const pageNoindex = 'noindex' in nav && nav.noindex === true;
26
- const isHidden = effectiveHidden || pageNoindex;
25
+ const pageNoindex = nav.noindex;
26
+ const isHidden = pageNoindex !== null && pageNoindex !== void 0 ? pageNoindex : effectiveHidden;
27
27
  // Only add hidden pages to the dictionary (more efficient)
28
28
  // We keep the first value encountered to handle duplicate paths
29
29
  if (isHidden && !pathToHiddenDict.has(key)) {
@@ -55,7 +55,7 @@ export const remarkExtractTableOfContents = (mdxExtracts, pageMetadata) => {
55
55
  }
56
56
  });
57
57
  visit(tree, (node) => {
58
- var _a, _b, _c, _d, _e;
58
+ var _a, _b, _c;
59
59
  if (excludedNodes.has(node))
60
60
  return;
61
61
  const currentTabId = tabContentMap.get(node);
@@ -145,7 +145,10 @@ export const remarkExtractTableOfContents = (mdxExtracts, pageMetadata) => {
145
145
  // Account if there is no first layer
146
146
  let arrToPushInto = contents;
147
147
  if (hasTopLayer) {
148
- arrToPushInto = (_e = (_d = contents.at(-1)) === null || _d === void 0 ? void 0 : _d.children) !== null && _e !== void 0 ? _e : [];
148
+ const lastTopLevel = contents.at(-1);
149
+ if (lastTopLevel && lastTopLevel.tabId === currentTabId) {
150
+ arrToPushInto = lastTopLevel.children;
151
+ }
149
152
  }
150
153
  arrToPushInto.push({
151
154
  title,