@mintlify/common 1.0.713 → 1.0.715
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/divisions/generatePathToHiddenDict.js +1 -1
- package/dist/divisions/generatePathToPublicDict.js +1 -1
- package/dist/divisions/generatePathToVersionDict.js +2 -2
- package/dist/editor/types.d.ts +2 -0
- package/dist/navigation/checkNavAccess.d.ts +2 -2
- package/dist/navigation/generatePathToBreadcrumbsMap.js +1 -1
- package/dist/navigation/generatePathToBreadcrumbsMapForDocsConfig.js +5 -5
- package/dist/navigation/getAllPathsInDocsNav.js +2 -2
- package/dist/navigation/getFirstPageFromNavigation.d.ts +2 -2
- package/dist/navigation/isPage.d.ts +3 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -31,7 +31,7 @@ function generatePathToHiddenDictRecursive(pathToHiddenDict, nav, parentHidden)
|
|
|
31
31
|
pathToHiddenDict.set(key, true);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
if ('pages' in nav) {
|
|
34
|
+
if ('pages' in nav && Array.isArray(nav.pages)) {
|
|
35
35
|
if ('root' in nav && typeof nav.root === 'object') {
|
|
36
36
|
generatePathToHiddenDictRecursive(pathToHiddenDict, nav.root, effectiveHidden);
|
|
37
37
|
}
|
|
@@ -26,7 +26,7 @@ function generatePathToPublicDictRecursive(pathToPublicDict, nav, parentPublic)
|
|
|
26
26
|
pathToPublicDict.set(key, effectivePublic);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
if ('pages' in nav) {
|
|
29
|
+
if ('pages' in nav && Array.isArray(nav.pages)) {
|
|
30
30
|
if ('root' in nav && typeof nav.root === 'object') {
|
|
31
31
|
generatePathToPublicDictRecursive(pathToPublicDict, nav.root, effectivePublic);
|
|
32
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { divisions } from '@mintlify/validation';
|
|
1
|
+
import { divisions, } from '@mintlify/validation';
|
|
2
2
|
import { isPage } from '../navigation/isPage.js';
|
|
3
3
|
import { optionallyRemoveLeadingSlash } from '../optionallyRemoveLeadingSlash.js';
|
|
4
4
|
/**
|
|
@@ -23,7 +23,7 @@ function generatePathToVersionDictRecursive(pathToVersionDict, nav, nearestVersi
|
|
|
23
23
|
pathToVersionDict.set(key, undefined);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
if ('pages' in nav) {
|
|
26
|
+
if ('pages' in nav && Array.isArray(nav.pages)) {
|
|
27
27
|
if ('root' in nav && typeof nav.root === 'object') {
|
|
28
28
|
generatePathToVersionDictRecursive(pathToVersionDict, nav.root, nearestVersion);
|
|
29
29
|
}
|
package/dist/editor/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function checkNavAccess(page:
|
|
1
|
+
import { DecoratedPageConfig } from '@mintlify/validation';
|
|
2
|
+
export declare function checkNavAccess(page: DecoratedPageConfig, userGroups: Set<string>, isPreview?: boolean, checkHidden?: boolean): boolean;
|
|
@@ -10,7 +10,7 @@ export function generatePathToBreadcrumbsMapRecursive(navGroup, currentBreadcrum
|
|
|
10
10
|
if (depth >= MAX_RECURSION_DEPTH)
|
|
11
11
|
return;
|
|
12
12
|
currentBreadcrumbs.push(navGroup.group);
|
|
13
|
-
if ('pages' in navGroup) {
|
|
13
|
+
if ('pages' in navGroup && Array.isArray(navGroup.pages)) {
|
|
14
14
|
for (const entry of navGroup.pages) {
|
|
15
15
|
if (typeof entry !== 'string') {
|
|
16
16
|
generatePathToBreadcrumbsMapRecursive(entry, currentBreadcrumbs, map, depth + 1);
|
|
@@ -43,16 +43,16 @@ export function generatePathToBreadcrumbsMapForPagesRecursive(pages, currentBrea
|
|
|
43
43
|
if (depth >= MAX_RECURSION_DEPTH)
|
|
44
44
|
return;
|
|
45
45
|
for (const entry of pages) {
|
|
46
|
-
if (typeof entry === '
|
|
46
|
+
if (typeof entry === 'string') {
|
|
47
|
+
const nonEmptyBreadcrumbs = currentBreadcrumbs.filter((crumb) => !!crumb.trim());
|
|
48
|
+
map.set(entry, [...nonEmptyBreadcrumbs]);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
47
51
|
currentBreadcrumbs.push(entry.group);
|
|
48
52
|
if ('pages' in entry && Array.isArray(entry.pages)) {
|
|
49
53
|
generatePathToBreadcrumbsMapForPagesRecursive(entry.pages, currentBreadcrumbs, map, depth + 1);
|
|
50
54
|
}
|
|
51
55
|
currentBreadcrumbs.pop();
|
|
52
56
|
}
|
|
53
|
-
else {
|
|
54
|
-
const nonEmptyBreadcrumbs = currentBreadcrumbs.filter((crumb) => !!crumb.trim());
|
|
55
|
-
map.set(entry, [...nonEmptyBreadcrumbs]);
|
|
56
|
-
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { divisions } from '@mintlify/validation';
|
|
2
2
|
export function getAllPathsInDocsNav(nav, paths = []) {
|
|
3
3
|
if ('pages' in nav) {
|
|
4
|
-
if ('root' in nav) {
|
|
4
|
+
if ('root' in nav && typeof nav.root === 'string') {
|
|
5
5
|
getPaths(nav.root, paths);
|
|
6
6
|
}
|
|
7
7
|
nav.pages.forEach((page) => getPaths(page, paths));
|
|
@@ -20,7 +20,7 @@ function getPaths(entry, paths) {
|
|
|
20
20
|
paths.push(entry);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
if ('pages' in entry) {
|
|
23
|
+
if ('pages' in entry && Array.isArray(entry.pages)) {
|
|
24
24
|
if ('root' in entry && typeof entry.root === 'object') {
|
|
25
25
|
getPaths(entry.root, paths);
|
|
26
26
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DecoratedNavigationPage } from '@mintlify/models';
|
|
2
|
-
import {
|
|
3
|
-
export declare function getFirstPageFromNavigation(node: DecoratedNavigationConfig |
|
|
2
|
+
import { DecoratedNavigationConfig, DecoratedPageOrGroupConfig } from '@mintlify/validation';
|
|
3
|
+
export declare function getFirstPageFromNavigation(node: DecoratedNavigationConfig | DecoratedPageOrGroupConfig | undefined, userGroups?: Set<string>, shouldCheckNavAccess?: boolean, isPreview?: boolean): DecoratedNavigationPage | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DecoratedNavigationEntry
|
|
2
|
-
import { DecoratedPageOrGroupConfig } from '@mintlify/validation';
|
|
3
|
-
export declare const isPage: (entry: DecoratedNavigationEntry | DecoratedPageOrGroupConfig) => entry is
|
|
1
|
+
import { DecoratedNavigationEntry } from '@mintlify/models';
|
|
2
|
+
import { DecoratedPageOrGroupConfig, DecoratedPageConfig, DecoratedNavigationConfig, DecoratedDivisionConfig } from '@mintlify/validation';
|
|
3
|
+
export declare const isPage: (entry: DecoratedNavigationEntry | DecoratedPageOrGroupConfig | DecoratedNavigationConfig | DecoratedDivisionConfig) => entry is DecoratedPageConfig;
|