@mintlify/common 1.0.690 → 1.0.692

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.
@@ -15,6 +15,7 @@ export function generatePathToHiddenDict(decoratedNav) {
15
15
  return pathToHiddenDict;
16
16
  }
17
17
  function generatePathToHiddenDictRecursive(pathToHiddenDict, nav, parentHidden) {
18
+ var _a;
18
19
  if (typeof nav !== 'object')
19
20
  return;
20
21
  // Determine the effective hidden status for this level (from group/tab hidden property)
@@ -22,7 +23,7 @@ function generatePathToHiddenDictRecursive(pathToHiddenDict, nav, parentHidden)
22
23
  if (isPage(nav)) {
23
24
  const key = optionallyRemoveLeadingSlash(nav.href);
24
25
  // A page is hidden if parent has hidden: true OR page has noindex: true in frontmatter
25
- const pageNoindex = nav.noindex;
26
+ const pageNoindex = (_a = nav.noindex) !== null && _a !== void 0 ? _a : nav.hidden;
26
27
  const isHidden = pageNoindex !== null && pageNoindex !== void 0 ? pageNoindex : effectiveHidden;
27
28
  // Only add hidden pages to the dictionary (more efficient)
28
29
  // We keep the first value encountered to handle duplicate paths
@@ -1,2 +1,2 @@
1
1
  import type { DecoratedNavigationPage } from '@mintlify/models';
2
- export declare function checkNavAccess(page: DecoratedNavigationPage, userGroups: Set<string>, isPreview?: boolean): boolean;
2
+ export declare function checkNavAccess(page: DecoratedNavigationPage, userGroups: Set<string>, isPreview?: boolean, checkHidden?: boolean): boolean;
@@ -1,6 +1,8 @@
1
- export function checkNavAccess(page, userGroups, isPreview = false) {
1
+ export function checkNavAccess(page, userGroups, isPreview = false, checkHidden = true) {
2
2
  if (isPreview)
3
3
  return true;
4
+ if (checkHidden && page.hidden)
5
+ return false;
4
6
  const pageGroups = Array.isArray(page.groups) && page.groups.every((pageGroup) => typeof pageGroup === 'string')
5
7
  ? page.groups
6
8
  : undefined;