@redocly/theme 0.33.3 → 0.35.0
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/lib/components/Sidebar/types.d.ts +1 -3
- package/lib/components/Sidebar/types.js +0 -5
- package/lib/components/SidebarActions/SidebarActions.d.ts +2 -5
- package/lib/components/SidebarActions/SidebarActions.js +2 -5
- package/lib/config.d.ts +2 -2441
- package/lib/config.js +0 -611
- package/lib/hooks/useThemeConfig.js +3 -1
- package/lib/types/portal/src/shared/constants.d.ts +1 -1
- package/lib/types/portal/src/shared/constants.js +3 -2
- package/lib/types/portal/src/shared/types/nav.d.ts +2 -173
- package/lib/types/portal/src/shared/types/nav.js +0 -5
- package/package.json +8 -7
- package/src/components/Sidebar/types.ts +1 -3
- package/src/components/SidebarActions/SidebarActions.tsx +2 -4
- package/src/config.ts +31 -750
- package/src/hooks/useThemeConfig.ts +2 -0
- package/src/types/portal/src/shared/constants.ts +2 -1
- package/src/types/portal/src/shared/types/nav.ts +22 -190
|
@@ -1,173 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type
|
|
3
|
-
export type ResolvedNavLinkItem = {
|
|
4
|
-
type: 'link';
|
|
5
|
-
metadata?: Record<string, unknown>;
|
|
6
|
-
link: string;
|
|
7
|
-
label: string;
|
|
8
|
-
labelTranslationKey?: string;
|
|
9
|
-
items?: ResolvedNavItem[];
|
|
10
|
-
sidebar?: ResolvedNavItem[];
|
|
11
|
-
external?: boolean;
|
|
12
|
-
target?: '_self' | '_blank';
|
|
13
|
-
languageInsensitive?: boolean;
|
|
14
|
-
version?: string;
|
|
15
|
-
isDefault?: boolean;
|
|
16
|
-
versionFolderId?: string;
|
|
17
|
-
httpVerb?: string;
|
|
18
|
-
separatorLine?: boolean;
|
|
19
|
-
routeSlug?: string;
|
|
20
|
-
fsPath?: string;
|
|
21
|
-
active?: boolean;
|
|
22
|
-
icon?: string;
|
|
23
|
-
srcSet?: string;
|
|
24
|
-
[REDOCLY_TEAMS_RBAC]?: Rbac;
|
|
25
|
-
};
|
|
26
|
-
export type ResolvedNavGroupItem = {
|
|
27
|
-
type: 'group';
|
|
28
|
-
metadata?: Record<string, unknown>;
|
|
29
|
-
link?: string;
|
|
30
|
-
label?: string;
|
|
31
|
-
labelTranslationKey?: string;
|
|
32
|
-
items?: ResolvedNavItem[];
|
|
33
|
-
sidebar?: ResolvedNavItem[];
|
|
34
|
-
external?: boolean;
|
|
35
|
-
target?: '_self' | '_blank';
|
|
36
|
-
expanded?: string;
|
|
37
|
-
selectFirstItemOnExpand?: boolean;
|
|
38
|
-
languageInsensitive?: boolean;
|
|
39
|
-
version?: string;
|
|
40
|
-
isDefault?: boolean;
|
|
41
|
-
versionFolderId?: string;
|
|
42
|
-
menuStyle?: MenuStyle;
|
|
43
|
-
separatorLine?: boolean;
|
|
44
|
-
routeSlug?: string;
|
|
45
|
-
fsPath?: string;
|
|
46
|
-
active?: boolean;
|
|
47
|
-
icon?: string;
|
|
48
|
-
srcSet?: string;
|
|
49
|
-
[REDOCLY_TEAMS_RBAC]?: Rbac;
|
|
50
|
-
};
|
|
51
|
-
export type ResolvedNavItem = ResolvedNavLinkItem | ResolvedNavGroupItem | {
|
|
52
|
-
type: 'separator';
|
|
53
|
-
metadata?: Record<string, unknown>;
|
|
54
|
-
label?: string;
|
|
55
|
-
labelTranslationKey?: string;
|
|
56
|
-
routeSlug?: never;
|
|
57
|
-
fsPath?: never;
|
|
58
|
-
version?: string;
|
|
59
|
-
isDefault?: boolean;
|
|
60
|
-
versionFolderId?: string;
|
|
61
|
-
separatorLine?: boolean;
|
|
62
|
-
link?: undefined;
|
|
63
|
-
items?: ResolvedNavItem[];
|
|
64
|
-
sidebar?: ResolvedNavItem[];
|
|
65
|
-
icon?: string;
|
|
66
|
-
srcSet?: string;
|
|
67
|
-
languageInsensitive?: boolean;
|
|
68
|
-
[REDOCLY_TEAMS_RBAC]?: Rbac;
|
|
69
|
-
} | {
|
|
70
|
-
type: 'error';
|
|
71
|
-
version?: string;
|
|
72
|
-
isDefault?: boolean;
|
|
73
|
-
versionFolderId?: string;
|
|
74
|
-
metadata?: Record<string, unknown>;
|
|
75
|
-
routeSlug?: never;
|
|
76
|
-
fsPath?: never;
|
|
77
|
-
label: string;
|
|
78
|
-
labelTranslationKey?: string;
|
|
79
|
-
link?: undefined;
|
|
80
|
-
items?: ResolvedNavItem[];
|
|
81
|
-
sidebar?: ResolvedNavItem[];
|
|
82
|
-
icon?: string;
|
|
83
|
-
srcSet?: string;
|
|
84
|
-
languageInsensitive?: boolean;
|
|
85
|
-
[REDOCLY_TEAMS_RBAC]?: Rbac;
|
|
86
|
-
};
|
|
87
|
-
export type ResolvedNavItemWithLink = (ResolvedNavLinkItem | ResolvedNavGroupItem) & {
|
|
88
|
-
link: string;
|
|
89
|
-
};
|
|
90
|
-
export interface PageProps {
|
|
91
|
-
seo?: {
|
|
92
|
-
title?: string;
|
|
93
|
-
};
|
|
94
|
-
frontmatter?: Omit<PageProps, 'frontmatter'> & {
|
|
95
|
-
settings?: any;
|
|
96
|
-
};
|
|
97
|
-
disableAutoScroll?: boolean;
|
|
98
|
-
lastModified?: string | null;
|
|
99
|
-
[k: string]: any;
|
|
100
|
-
}
|
|
101
|
-
export interface PageStaticData {
|
|
102
|
-
props?: PageProps;
|
|
103
|
-
[k: string]: unknown;
|
|
104
|
-
}
|
|
105
|
-
export type UserData = {
|
|
106
|
-
isAuthenticated: boolean;
|
|
107
|
-
name: string;
|
|
108
|
-
picture: string;
|
|
109
|
-
};
|
|
110
|
-
export interface PageData {
|
|
111
|
-
templateId: string;
|
|
112
|
-
sharedDataIds: Record<string, string>;
|
|
113
|
-
props: PageProps;
|
|
114
|
-
versions?: Version[];
|
|
115
|
-
userData: UserData;
|
|
116
|
-
}
|
|
117
|
-
export declare enum MenuStyle {
|
|
118
|
-
Drilldown = "drilldown"
|
|
119
|
-
}
|
|
120
|
-
export type NavItem = {
|
|
121
|
-
page?: string;
|
|
122
|
-
directory?: string;
|
|
123
|
-
group?: string;
|
|
124
|
-
groupTranslationKey?: string;
|
|
125
|
-
label?: string;
|
|
126
|
-
labelTranslationKey?: string;
|
|
127
|
-
href?: never;
|
|
128
|
-
items?: NavItem[];
|
|
129
|
-
separator?: string;
|
|
130
|
-
separatorTranslationKey?: string;
|
|
131
|
-
separatorLine?: boolean;
|
|
132
|
-
version?: string;
|
|
133
|
-
menuStyle?: MenuStyle;
|
|
134
|
-
external?: boolean;
|
|
135
|
-
target?: '_self' | '_blank';
|
|
136
|
-
expanded?: boolean | 'always';
|
|
137
|
-
selectFirstItemOnExpand?: boolean;
|
|
138
|
-
flatten?: boolean;
|
|
139
|
-
};
|
|
140
|
-
export interface LogoConfig {
|
|
141
|
-
image?: string;
|
|
142
|
-
srcSet?: string;
|
|
143
|
-
altText?: string;
|
|
144
|
-
link?: string;
|
|
145
|
-
favicon?: string;
|
|
146
|
-
}
|
|
147
|
-
export type Version = {
|
|
148
|
-
version: string;
|
|
149
|
-
label: string;
|
|
150
|
-
link: string;
|
|
151
|
-
default: boolean;
|
|
152
|
-
active: boolean;
|
|
153
|
-
notExists?: boolean;
|
|
154
|
-
folderId: string;
|
|
155
|
-
};
|
|
156
|
-
export type VersionConfigItem = {
|
|
157
|
-
version: string;
|
|
158
|
-
name?: string;
|
|
159
|
-
};
|
|
160
|
-
export type VersionsConfigType = {
|
|
161
|
-
versions: VersionConfigItem[];
|
|
162
|
-
default?: string;
|
|
163
|
-
};
|
|
164
|
-
export type VersionedFolderConfig = {
|
|
165
|
-
versionedFiles: Map<string, Set<string>>;
|
|
166
|
-
defaultVersion?: string;
|
|
167
|
-
versions: VersionConfigItem[];
|
|
168
|
-
hasVersionsConfig?: boolean;
|
|
169
|
-
};
|
|
170
|
-
export type NavGroup = ResolvedNavItem[] | undefined | string | boolean | number;
|
|
171
|
-
export type NavGroupRecord = Record<string, NavGroup>;
|
|
172
|
-
export type ResolvedConfigLinks = NavGroup | NavGroupRecord;
|
|
173
|
-
export {};
|
|
1
|
+
import type { ResolvedNavItem, ResolvedNavItemWithLink, ResolvedNavLinkItem, ResolvedNavGroupItem, ResolvedConfigLinks, NavGroupRecord, LogoConfig, Version, PageStaticData } from '@redocly/config';
|
|
2
|
+
export type { ResolvedNavItem, ResolvedNavItemWithLink, ResolvedNavLinkItem, ResolvedNavGroupItem, ResolvedConfigLinks, NavGroupRecord, LogoConfig, Version, PageStaticData };
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuStyle = void 0;
|
|
4
|
-
var MenuStyle;
|
|
5
|
-
(function (MenuStyle) {
|
|
6
|
-
MenuStyle["Drilldown"] = "drilldown";
|
|
7
|
-
})(MenuStyle || (exports.MenuStyle = MenuStyle = {}));
|
|
8
3
|
//# sourceMappingURL=nav.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"prismjs": "^1.28.0",
|
|
24
24
|
"react": "^17.0.0 || ^18.0.0",
|
|
25
25
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
26
|
-
"react-router-dom": "^6.
|
|
26
|
+
"react-router-dom": "^6.21.1",
|
|
27
27
|
"styled-components": "^4.1.1 || ^5.3.11",
|
|
28
28
|
"styled-system": "^5.1.5"
|
|
29
29
|
},
|
|
@@ -65,13 +65,14 @@
|
|
|
65
65
|
"lodash.throttle": "4.1.1",
|
|
66
66
|
"npm-run-all": "4.1.5",
|
|
67
67
|
"react-refresh": "0.14.0",
|
|
68
|
-
"react-router-dom": "6.
|
|
68
|
+
"react-router-dom": "6.21.1",
|
|
69
|
+
"rimraf": "5.0.5",
|
|
69
70
|
"storybook": "7.6.4",
|
|
70
71
|
"storybook-addon-pseudo-states": "2.1.2",
|
|
71
72
|
"storybook-design-token": "3.0.0-beta.6",
|
|
72
73
|
"styled-components": "5.3.11",
|
|
73
74
|
"styled-system": "5.1.5",
|
|
74
|
-
"ts-jest": "29.1.
|
|
75
|
+
"ts-jest": "29.1.2",
|
|
75
76
|
"ts-node": "10.9.1",
|
|
76
77
|
"ts-node-dev": "2.0.0",
|
|
77
78
|
"tsc-alias": "1.8.3",
|
|
@@ -82,19 +83,19 @@
|
|
|
82
83
|
"@redocly/portal-types": "1.2.1"
|
|
83
84
|
},
|
|
84
85
|
"dependencies": {
|
|
85
|
-
"@redocly/ajv": "^8.11.0",
|
|
86
86
|
"copy-to-clipboard": "^3.3.3",
|
|
87
87
|
"highlight-words-core": "^1.2.2",
|
|
88
88
|
"hotkeys-js": "^3.10.1",
|
|
89
89
|
"react-calendar": "4.2.1",
|
|
90
90
|
"react-date-picker": "10.0.3",
|
|
91
|
-
"timeago.js": "^4.0.2"
|
|
91
|
+
"timeago.js": "^4.0.2",
|
|
92
|
+
"@redocly/config": "0.1.0"
|
|
92
93
|
},
|
|
93
94
|
"scripts": {
|
|
94
95
|
"start": "npm-run-all --parallel storybook storybook:tokens:watch",
|
|
95
96
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
96
97
|
"ts:check": "tsc --noEmit --skipLibCheck",
|
|
97
|
-
"clean": "
|
|
98
|
+
"clean": "rimraf lib",
|
|
98
99
|
"compile": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
99
100
|
"build": "npm run clean && npm run compile",
|
|
100
101
|
"test": "jest",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { LayoutVariant } from '@redocly/config';
|
|
2
3
|
|
|
3
4
|
import { ChangeViewButton } from '@theme/components/SidebarActions/ChangeViewButton';
|
|
4
5
|
import { ToggleRightPanelButton } from '@theme/components/SidebarActions/ToggleRightPanelButton';
|
|
@@ -9,10 +10,7 @@ import {
|
|
|
9
10
|
} from '@theme/components/SidebarActions/styled';
|
|
10
11
|
import { telemetry } from '@portal/telemetry';
|
|
11
12
|
|
|
12
|
-
export
|
|
13
|
-
STACKED = 'stacked',
|
|
14
|
-
THREE_PANEL = 'three-panel',
|
|
15
|
-
}
|
|
13
|
+
export { LayoutVariant };
|
|
16
14
|
|
|
17
15
|
interface SidebarActionsProps {
|
|
18
16
|
showChangeLayoutButton: boolean;
|