@redocly/theme 0.14.2 → 0.15.1
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/I18n/LanguagePicker.js +1 -1
- package/lib/components/Breadcrumbs/Breadcrumb.d.ts +6 -0
- package/lib/components/Breadcrumbs/Breadcrumb.js +45 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.js +34 -0
- package/lib/components/Breadcrumbs/index.d.ts +2 -0
- package/lib/components/Breadcrumbs/index.js +19 -0
- package/lib/components/Markdown/ContainerWrapper.js +3 -3
- package/lib/components/Markdown/Details.d.ts +2 -1
- package/lib/components/Markdown/Details.js +2 -2
- package/lib/components/Markdown/MarkdownLayout.js +5 -0
- package/lib/components/Markdown/MarkdownWrapper.js +9 -4
- package/lib/components/Navbar/Navbar.js +2 -2
- package/lib/components/Navbar/NavbarItem.js +1 -1
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiOperation.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiOperation.js +11 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiOperationSummary.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiOperationSummary.js +11 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiTitle.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiTitle.js +11 -0
- package/lib/components/OpenApiDocs/hooks/BeforeOpenApiOperation.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/BeforeOpenApiOperation.js +11 -0
- package/lib/components/OpenApiDocs/hooks/BeforeOpenApiOperationSummary.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/BeforeOpenApiOperationSummary.js +11 -0
- package/lib/components/OpenApiDocs/hooks/OpenApiFooter.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/OpenApiFooter.js +8 -0
- package/lib/components/OpenApiDocs/hooks/OpenApiHeader.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/OpenApiHeader.js +8 -0
- package/lib/components/OpenApiDocs/hooks/OpenApiTryItSecurityPanel.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/OpenApiTryItSecurityPanel.js +14 -0
- package/lib/components/index.d.ts +10 -1
- package/lib/components/index.js +10 -1
- package/lib/config.d.ts +61 -2
- package/lib/config.js +25 -0
- package/lib/globalStyle.js +15 -1
- package/lib/mocks/Sidebar/useBreadcrumbs.d.ts +4 -0
- package/lib/mocks/Sidebar/useBreadcrumbs.js +8 -0
- package/package.json +5 -2
- package/src/I18n/LanguagePicker.tsx +1 -1
- package/src/components/Breadcrumbs/Breadcrumb.tsx +57 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +39 -0
- package/src/components/Breadcrumbs/index.ts +2 -0
- package/src/components/Markdown/ContainerWrapper.tsx +3 -3
- package/src/components/Markdown/Details.tsx +7 -2
- package/src/components/Markdown/MarkdownLayout.tsx +6 -0
- package/src/components/Markdown/MarkdownWrapper.tsx +9 -4
- package/src/components/Navbar/Navbar.tsx +2 -2
- package/src/components/Navbar/NavbarItem.tsx +1 -1
- package/src/components/OpenApiDocs/hooks/AfterOpenApiOperation.tsx +9 -0
- package/src/components/OpenApiDocs/hooks/AfterOpenApiOperationSummary.tsx +9 -0
- package/src/components/OpenApiDocs/hooks/AfterOpenApiTitle.tsx +9 -0
- package/src/components/OpenApiDocs/hooks/BeforeOpenApiOperation.tsx +9 -0
- package/src/components/OpenApiDocs/hooks/BeforeOpenApiOperationSummary.tsx +9 -0
- package/src/components/OpenApiDocs/hooks/OpenApiFooter.tsx +5 -0
- package/src/components/OpenApiDocs/hooks/OpenApiHeader.tsx +5 -0
- package/src/components/OpenApiDocs/hooks/OpenApiTryItSecurityPanel.tsx +12 -0
- package/src/components/index.ts +10 -1
- package/src/config.ts +35 -2
- package/src/globalStyle.ts +16 -1
- package/src/mocks/Sidebar/useBreadcrumbs.ts +3 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/ClearButton.d.ts +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/ClearButton.js +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/DevOnboardingTryItSecurity.d.ts +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/DevOnboardingTryItSecurity.js +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/Dropdown.d.ts +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/Dropdown.js +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/TryItSecurityApps.d.ts +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/TryItSecurityApps.js +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/index.d.ts +0 -0
- /package/lib/components/{OpenAPIDocs → OpenApiDocs}/index.js +0 -0
- /package/src/components/{OpenAPIDocs → OpenApiDocs}/ClearButton.tsx +0 -0
- /package/src/components/{OpenAPIDocs → OpenApiDocs}/DevOnboardingTryItSecurity.tsx +0 -0
- /package/src/components/{OpenAPIDocs → OpenApiDocs}/Dropdown.tsx +0 -0
- /package/src/components/{OpenAPIDocs → OpenApiDocs}/TryItSecurityApps.tsx +0 -0
- /package/src/components/{OpenAPIDocs → OpenApiDocs}/index.ts +0 -0
|
@@ -77,7 +77,7 @@ const DropdownValue = styled_components_1.default.div `
|
|
|
77
77
|
display: block;
|
|
78
78
|
|
|
79
79
|
color: var(--navbar-text-color);
|
|
80
|
-
padding: var(--navbar-item-
|
|
80
|
+
padding: var(--navbar-item-padding-vertical) var(--navbar-item-padding-horizontal);
|
|
81
81
|
border-radius: var(--navbar-item-border-radius);
|
|
82
82
|
|
|
83
83
|
&:hover {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Breadcrumb = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Link_1 = require("../../mocks/Link");
|
|
10
|
+
const Breadcrumb = (props) => {
|
|
11
|
+
const { label, link, isActive } = props;
|
|
12
|
+
return (react_1.default.createElement(BreadcrumbWrapper, { "data-component-name": "Breadcrumbs/Breadcrumb", isLink: link != null, isActive: isActive }, link ? (react_1.default.createElement(BreadcrumbLink, { to: link }, label)) : (react_1.default.createElement(BreadcrumbText, null, label))));
|
|
13
|
+
};
|
|
14
|
+
exports.Breadcrumb = Breadcrumb;
|
|
15
|
+
const BreadcrumbText = styled_components_1.default.div `
|
|
16
|
+
cursor: default;
|
|
17
|
+
`;
|
|
18
|
+
const BreadcrumbWrapper = styled_components_1.default.div `
|
|
19
|
+
border-radius: var(--border-radius);
|
|
20
|
+
padding: 0 var(--breadcrumbs-padding-horizontal);
|
|
21
|
+
|
|
22
|
+
&:first-child {
|
|
23
|
+
padding-left: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${(props) => props.isLink &&
|
|
27
|
+
`
|
|
28
|
+
&:hover {
|
|
29
|
+
text-decoration: var(--breadcrumbs-hover-text-decoration);
|
|
30
|
+
}
|
|
31
|
+
`}
|
|
32
|
+
|
|
33
|
+
${(props) => props.isActive &&
|
|
34
|
+
`
|
|
35
|
+
color: var(--breadcrumbs-active-text-color);
|
|
36
|
+
`}
|
|
37
|
+
`;
|
|
38
|
+
const BreadcrumbLink = (0, styled_components_1.default)(Link_1.Link) `
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
|
|
41
|
+
&:visited {
|
|
42
|
+
color: inherit;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Breadcrumbs = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const useBreadcrumbs_1 = require("../../mocks/Sidebar/useBreadcrumbs");
|
|
10
|
+
const Breadcrumb_1 = require("./Breadcrumb");
|
|
11
|
+
const Breadcrumbs = (props) => {
|
|
12
|
+
const breadcrumbs = (0, useBreadcrumbs_1.useBreadcrumbs)();
|
|
13
|
+
if (breadcrumbs.length === 0) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (react_1.default.createElement(Container, { "data-component-name": "Breadcrumbs/Breadcrumbs", className: props.className }, breadcrumbs.map((breadcrumb, idx) => {
|
|
17
|
+
const isLast = idx === breadcrumbs.length - 1;
|
|
18
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: idx },
|
|
19
|
+
react_1.default.createElement(Breadcrumb_1.Breadcrumb, { link: breadcrumb.link, label: breadcrumb.label, isActive: isLast }),
|
|
20
|
+
isLast ? null : react_1.default.createElement("div", null, "/")));
|
|
21
|
+
})));
|
|
22
|
+
};
|
|
23
|
+
exports.Breadcrumbs = Breadcrumbs;
|
|
24
|
+
const Container = styled_components_1.default.div `
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
align-items: center;
|
|
28
|
+
color: var(--breadcrumbs-text-color);
|
|
29
|
+
|
|
30
|
+
@media print {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("../../components/Breadcrumbs/Breadcrumbs"), exports);
|
|
18
|
+
__exportStar(require("../../components/Breadcrumbs/Breadcrumb"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -14,9 +14,9 @@ exports.ContainerWrapper = styled_components_1.default.section.attrs(() => ({
|
|
|
14
14
|
|
|
15
15
|
padding: var(--md-container-padding-vertical) var(--md-container-padding-horizontal);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
// disable margin top for h1 on the title heading
|
|
19
|
-
|
|
17
|
+
article:first-child > h1:first-child {
|
|
18
|
+
// disable margin top for h1 on the title heading
|
|
19
|
+
margin-top: 0;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
${({ theme }) => theme.mediaQueries.medium} {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type DetailsProps = {
|
|
3
3
|
summary: string;
|
|
4
|
+
className?: string;
|
|
4
5
|
};
|
|
5
|
-
export declare function Details({ summary, children }: React.PropsWithChildren<DetailsProps>): JSX.Element;
|
|
6
|
+
export declare function Details({ summary, children, className, }: React.PropsWithChildren<DetailsProps>): JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Details = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
function Details({ summary, children }) {
|
|
10
|
-
return (react_1.default.createElement(StyledDetails,
|
|
9
|
+
function Details({ summary, children, className, }) {
|
|
10
|
+
return (react_1.default.createElement(StyledDetails, { className: className },
|
|
11
11
|
react_1.default.createElement("summary", null, summary),
|
|
12
12
|
react_1.default.createElement(StyledDetailsContent, null, children)));
|
|
13
13
|
}
|
|
@@ -13,6 +13,7 @@ const EditPageButton_1 = require("../../components/EditPageButton");
|
|
|
13
13
|
const LastUpdated_1 = require("../../components/LastUpdated/LastUpdated");
|
|
14
14
|
const hooks_1 = require("../../hooks");
|
|
15
15
|
const hooks_2 = require("../../mocks/hooks");
|
|
16
|
+
const Breadcrumbs_1 = require("../../components/Breadcrumbs");
|
|
16
17
|
function MarkdownLayout({ tableOfContent, markdownWrapper, feedback, editPage, lastModified, nextPage, prevPage, }) {
|
|
17
18
|
const { markdown } = (0, hooks_1.useThemeConfig)();
|
|
18
19
|
const { translate } = (0, hooks_2.useTranslate)();
|
|
@@ -23,6 +24,7 @@ function MarkdownLayout({ tableOfContent, markdownWrapper, feedback, editPage, l
|
|
|
23
24
|
const mergedConf = editPage ? Object.assign(Object.assign({}, themeEditPage), editPage) : undefined;
|
|
24
25
|
return (react_1.default.createElement(PageWrapper_1.PageWrapper, { "data-component-name": "Markdown/MarkdownLayout" },
|
|
25
26
|
react_1.default.createElement(ContainerWrapper_1.ContainerWrapper, { withToc: true },
|
|
27
|
+
react_1.default.createElement(Breadcrumbs, null),
|
|
26
28
|
react_1.default.createElement(LayoutTop, null,
|
|
27
29
|
lastModified && react_1.default.createElement(LastUpdated_1.LastUpdated, { lastModified: new Date(lastModified) }),
|
|
28
30
|
mergedConf && (react_1.default.createElement(EditPageButton_1.EditPageButton, { text: translate(translationKeys.text, mergedConf.text), to: mergedConf.to, icon: mergedConf.icon, "data-translation-key": translationKeys.text }))),
|
|
@@ -37,6 +39,9 @@ const LayoutTop = styled_components_1.default.div `
|
|
|
37
39
|
justify-content: space-between;
|
|
38
40
|
flex-flow: row nowrap;
|
|
39
41
|
`;
|
|
42
|
+
const Breadcrumbs = (0, styled_components_1.default)(Breadcrumbs_1.Breadcrumbs) `
|
|
43
|
+
margin-bottom: var(--breadcrumbs-margin-bottom);
|
|
44
|
+
`;
|
|
40
45
|
const LayoutBottom = (0, styled_components_1.default)(LayoutTop) `
|
|
41
46
|
> * {
|
|
42
47
|
margin: 25px 5px;
|
|
@@ -50,12 +50,21 @@ exports.baseTable = (0, styled_components_1.css) `
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
th {
|
|
53
|
+
/** th has text-align: center by default */
|
|
53
54
|
text-align: left;
|
|
54
55
|
font-weight: var(--md-table-head-font-weight);
|
|
55
56
|
color: var(--md-table-head-text-color);
|
|
56
57
|
background-color: var(--md-table-head-background-color);
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
/* need to overwrite the text-align: left from above */
|
|
61
|
+
th[align='center'] {
|
|
62
|
+
text-align: center;
|
|
63
|
+
}
|
|
64
|
+
th[align='right'] {
|
|
65
|
+
text-align: right;
|
|
66
|
+
}
|
|
67
|
+
|
|
59
68
|
tr th:first-child,
|
|
60
69
|
tr td:first-child {
|
|
61
70
|
border-left: 1px solid var(--md-table-border-color);
|
|
@@ -260,10 +269,6 @@ exports.MarkdownWrapper = styled_components_1.default.main.attrs(() => ({
|
|
|
260
269
|
${(0, theme_helpers_1.typography)('h1', 'h')};
|
|
261
270
|
margin: var(--h1-margin-top) 0 var(--h1-margin-bottom) 0;
|
|
262
271
|
${headingAnchor()};
|
|
263
|
-
|
|
264
|
-
&:first-child {
|
|
265
|
-
margin-top: 0;
|
|
266
|
-
}
|
|
267
272
|
}
|
|
268
273
|
|
|
269
274
|
h2.md {
|
|
@@ -42,7 +42,7 @@ const AuthUserProfile_1 = require("../../components/Profile/AuthUserProfile");
|
|
|
42
42
|
const hooks_1 = require("../../mocks/hooks");
|
|
43
43
|
const LanguagePicker_1 = require("../../I18n/LanguagePicker");
|
|
44
44
|
const EmptyNavbarHack = (0, styled_components_1.createGlobalStyle) `
|
|
45
|
-
|
|
45
|
+
:root {
|
|
46
46
|
--navbar-height: 0px !important;
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
@@ -105,7 +105,7 @@ exports.NavbarContainer = styled_components_1.default.nav `
|
|
|
105
105
|
position: sticky;
|
|
106
106
|
top: 0;
|
|
107
107
|
z-index: 200;
|
|
108
|
-
padding: var(--navbar-item-
|
|
108
|
+
padding: var(--navbar-item-padding-vertical) var(--navbar-item-padding-horizontal);
|
|
109
109
|
background: var(--navbar-background-color);
|
|
110
110
|
font-family: var(--navbar-item-font-family);
|
|
111
111
|
|
|
@@ -76,7 +76,7 @@ exports.NavbarLink = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
76
76
|
`;
|
|
77
77
|
exports.NavbarMenuItem = styled_components_1.default.li `
|
|
78
78
|
display: inline-block;
|
|
79
|
-
padding: var(--navbar-item-
|
|
79
|
+
padding: var(--navbar-item-padding-vertical) var(--navbar-item-padding-horizontal);
|
|
80
80
|
margin-left: var(--navbar-item-margin-horizontal);
|
|
81
81
|
text-align: center;
|
|
82
82
|
line-height: 1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AfterOpenApiOperation: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// interface AfterOpenApiOperationProps {
|
|
3
|
+
// operation: any;
|
|
4
|
+
// }
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AfterOpenApiOperation = void 0;
|
|
7
|
+
// export function AfterOpenApiOperation(_props: AfterOpenAPIOperationProps) {
|
|
8
|
+
// return null;
|
|
9
|
+
// }
|
|
10
|
+
exports.AfterOpenApiOperation = null;
|
|
11
|
+
//# sourceMappingURL=AfterOpenApiOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AfterOpenApiOperationSummary: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// interface AfterOpenApiOperationSummaryProps {
|
|
3
|
+
// operation: any;
|
|
4
|
+
// }
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AfterOpenApiOperationSummary = void 0;
|
|
7
|
+
// export function AfterOpenApiOperationSummary(_props: AfterOpenAPIOperationSummaryProps) {
|
|
8
|
+
// return null;
|
|
9
|
+
// }
|
|
10
|
+
exports.AfterOpenApiOperationSummary = null;
|
|
11
|
+
//# sourceMappingURL=AfterOpenApiOperationSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AfterOpenApiTitle: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// interface AfterOpenApiTitleProps {
|
|
3
|
+
// info: any;
|
|
4
|
+
// }
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AfterOpenApiTitle = void 0;
|
|
7
|
+
// export function AfterOpenApiTitle(_props: AfterOpenAPIApiTitleProps) {
|
|
8
|
+
// return null;
|
|
9
|
+
// }
|
|
10
|
+
exports.AfterOpenApiTitle = null;
|
|
11
|
+
//# sourceMappingURL=AfterOpenApiTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BeforeOpenApiOperation: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// interface BeforeOpenApiOperationProps {
|
|
3
|
+
// operation: any;
|
|
4
|
+
// }
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BeforeOpenApiOperation = void 0;
|
|
7
|
+
// export function BeforeOpenApiOperation(_props: BeforeOpenAPIOperationProps) {
|
|
8
|
+
// return null;
|
|
9
|
+
// }
|
|
10
|
+
exports.BeforeOpenApiOperation = null;
|
|
11
|
+
//# sourceMappingURL=BeforeOpenApiOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BeforeOpenApiOperationSummary: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// interface BeforeOpenApiOperationSummaryProps {
|
|
3
|
+
// operation: any;
|
|
4
|
+
// }
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BeforeOpenApiOperationSummary = void 0;
|
|
7
|
+
// export function BeforeOpenApiOperationSummary(_props: BeforeOpenAPIOperationSummaryProps) {
|
|
8
|
+
// return null;
|
|
9
|
+
// }
|
|
10
|
+
exports.BeforeOpenApiOperationSummary = null;
|
|
11
|
+
//# sourceMappingURL=BeforeOpenApiOperationSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OpenApiFooter: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OpenApiHeader: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OpenApiTryItSecurityPanel: any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// interface OpenApiTryItSecurityPanelProps {
|
|
3
|
+
// server: any;
|
|
4
|
+
// operation: any;
|
|
5
|
+
// onChange?: any;
|
|
6
|
+
// OAuth2: any;
|
|
7
|
+
// }
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.OpenApiTryItSecurityPanel = void 0;
|
|
10
|
+
// export function OpenApiTryItSecurityPanel(_props: OpenAPITryItSecurityPanelProps) {
|
|
11
|
+
// return null;
|
|
12
|
+
// }
|
|
13
|
+
exports.OpenApiTryItSecurityPanel = null;
|
|
14
|
+
//# sourceMappingURL=OpenApiTryItSecurityPanel.js.map
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export * from './OpenApiDocs/hooks/AfterOpenApiTitle';
|
|
2
|
+
export * from './OpenApiDocs/hooks/AfterOpenApiOperation';
|
|
3
|
+
export * from './OpenApiDocs/hooks/AfterOpenApiOperationSummary';
|
|
4
|
+
export * from './OpenApiDocs/hooks/BeforeOpenApiOperation';
|
|
5
|
+
export * from './OpenApiDocs/hooks/BeforeOpenApiOperationSummary';
|
|
1
6
|
export * from './Button';
|
|
2
7
|
export * from './CopyButton';
|
|
3
8
|
export * from './EditPageButton';
|
|
@@ -5,6 +10,9 @@ export * from './JsonViewer';
|
|
|
5
10
|
export * from './Typography';
|
|
6
11
|
export * from './SidebarLogo';
|
|
7
12
|
export * from './CodeBlock';
|
|
13
|
+
export * from './OpenApiDocs/hooks/OpenApiFooter';
|
|
14
|
+
export * from './OpenApiDocs/hooks/OpenApiHeader';
|
|
15
|
+
export * from './OpenApiDocs/hooks/OpenApiTryItSecurityPanel';
|
|
8
16
|
export * from './SamplesPanelControls';
|
|
9
17
|
export * from './Tooltip';
|
|
10
18
|
export * from './SourceCode';
|
|
@@ -16,7 +24,7 @@ export * from './Profile';
|
|
|
16
24
|
export * from './ColorModeSwitcher';
|
|
17
25
|
export * from './Sidebar';
|
|
18
26
|
export * from './Markdown';
|
|
19
|
-
export * from './
|
|
27
|
+
export * from './OpenApiDocs';
|
|
20
28
|
export * from './SidebarActions';
|
|
21
29
|
export * from './Filter';
|
|
22
30
|
export * from './Tags';
|
|
@@ -26,4 +34,5 @@ export * from './Menu';
|
|
|
26
34
|
export * from './Separator';
|
|
27
35
|
export * from './Cards';
|
|
28
36
|
export * from './Tiles';
|
|
37
|
+
export * from './Breadcrumbs';
|
|
29
38
|
export * from './Catalog';
|
package/lib/components/index.js
CHANGED
|
@@ -14,6 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./OpenApiDocs/hooks/AfterOpenApiTitle"), exports);
|
|
18
|
+
__exportStar(require("./OpenApiDocs/hooks/AfterOpenApiOperation"), exports);
|
|
19
|
+
__exportStar(require("./OpenApiDocs/hooks/AfterOpenApiOperationSummary"), exports);
|
|
20
|
+
__exportStar(require("./OpenApiDocs/hooks/BeforeOpenApiOperation"), exports);
|
|
21
|
+
__exportStar(require("./OpenApiDocs/hooks/BeforeOpenApiOperationSummary"), exports);
|
|
17
22
|
__exportStar(require("./Button"), exports);
|
|
18
23
|
__exportStar(require("./CopyButton"), exports);
|
|
19
24
|
__exportStar(require("./EditPageButton"), exports);
|
|
@@ -21,6 +26,9 @@ __exportStar(require("./JsonViewer"), exports);
|
|
|
21
26
|
__exportStar(require("./Typography"), exports);
|
|
22
27
|
__exportStar(require("./SidebarLogo"), exports);
|
|
23
28
|
__exportStar(require("./CodeBlock"), exports);
|
|
29
|
+
__exportStar(require("./OpenApiDocs/hooks/OpenApiFooter"), exports);
|
|
30
|
+
__exportStar(require("./OpenApiDocs/hooks/OpenApiHeader"), exports);
|
|
31
|
+
__exportStar(require("./OpenApiDocs/hooks/OpenApiTryItSecurityPanel"), exports);
|
|
24
32
|
__exportStar(require("./SamplesPanelControls"), exports);
|
|
25
33
|
__exportStar(require("./Tooltip"), exports);
|
|
26
34
|
__exportStar(require("./SourceCode"), exports);
|
|
@@ -32,7 +40,7 @@ __exportStar(require("./Profile"), exports);
|
|
|
32
40
|
__exportStar(require("./ColorModeSwitcher"), exports);
|
|
33
41
|
__exportStar(require("./Sidebar"), exports);
|
|
34
42
|
__exportStar(require("./Markdown"), exports);
|
|
35
|
-
__exportStar(require("./
|
|
43
|
+
__exportStar(require("./OpenApiDocs"), exports);
|
|
36
44
|
__exportStar(require("./SidebarActions"), exports);
|
|
37
45
|
__exportStar(require("./Filter"), exports);
|
|
38
46
|
__exportStar(require("./Tags"), exports);
|
|
@@ -42,5 +50,6 @@ __exportStar(require("./Menu"), exports);
|
|
|
42
50
|
__exportStar(require("./Separator"), exports);
|
|
43
51
|
__exportStar(require("./Cards"), exports);
|
|
44
52
|
__exportStar(require("./Tiles"), exports);
|
|
53
|
+
__exportStar(require("./Breadcrumbs"), exports);
|
|
45
54
|
__exportStar(require("./Catalog"), exports);
|
|
46
55
|
//# sourceMappingURL=index.js.map
|
package/lib/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
-
import type { MenuStyle } from './types/portal';
|
|
2
|
+
import type { MenuStyle, ResolvedNavLinkItem } from './types/portal';
|
|
3
|
+
import type { CatalogConfig } from './types/portal/src/shared/types/catalog';
|
|
3
4
|
declare const markdownConfigSchema: {
|
|
4
5
|
readonly type: "object";
|
|
5
6
|
readonly properties: {
|
|
@@ -149,6 +150,12 @@ export declare const themeConfigSchema: {
|
|
|
149
150
|
readonly flatten: {
|
|
150
151
|
readonly type: "boolean";
|
|
151
152
|
};
|
|
153
|
+
readonly linkedSidebars: {
|
|
154
|
+
readonly type: "array";
|
|
155
|
+
readonly items: {
|
|
156
|
+
readonly type: "string";
|
|
157
|
+
};
|
|
158
|
+
};
|
|
152
159
|
};
|
|
153
160
|
};
|
|
154
161
|
};
|
|
@@ -187,6 +194,12 @@ export declare const themeConfigSchema: {
|
|
|
187
194
|
readonly flatten: {
|
|
188
195
|
readonly type: "boolean";
|
|
189
196
|
};
|
|
197
|
+
readonly linkedSidebars: {
|
|
198
|
+
readonly type: "array";
|
|
199
|
+
readonly items: {
|
|
200
|
+
readonly type: "string";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
190
203
|
};
|
|
191
204
|
readonly type: "object";
|
|
192
205
|
};
|
|
@@ -244,6 +257,12 @@ export declare const themeConfigSchema: {
|
|
|
244
257
|
readonly flatten: {
|
|
245
258
|
readonly type: "boolean";
|
|
246
259
|
};
|
|
260
|
+
readonly linkedSidebars: {
|
|
261
|
+
readonly type: "array";
|
|
262
|
+
readonly items: {
|
|
263
|
+
readonly type: "string";
|
|
264
|
+
};
|
|
265
|
+
};
|
|
247
266
|
};
|
|
248
267
|
};
|
|
249
268
|
};
|
|
@@ -282,6 +301,12 @@ export declare const themeConfigSchema: {
|
|
|
282
301
|
readonly flatten: {
|
|
283
302
|
readonly type: "boolean";
|
|
284
303
|
};
|
|
304
|
+
readonly linkedSidebars: {
|
|
305
|
+
readonly type: "array";
|
|
306
|
+
readonly items: {
|
|
307
|
+
readonly type: "string";
|
|
308
|
+
};
|
|
309
|
+
};
|
|
285
310
|
};
|
|
286
311
|
readonly type: "object";
|
|
287
312
|
};
|
|
@@ -804,11 +829,42 @@ export declare const themeConfigSchema: {
|
|
|
804
829
|
readonly additionalProperties: false;
|
|
805
830
|
readonly default: {};
|
|
806
831
|
};
|
|
832
|
+
readonly breadcrumbs: {
|
|
833
|
+
readonly type: "object";
|
|
834
|
+
readonly properties: {
|
|
835
|
+
readonly hide: {
|
|
836
|
+
readonly type: "boolean";
|
|
837
|
+
};
|
|
838
|
+
readonly prefixItems: {
|
|
839
|
+
readonly type: "array";
|
|
840
|
+
readonly items: {
|
|
841
|
+
readonly type: "object";
|
|
842
|
+
readonly properties: {
|
|
843
|
+
readonly label: {
|
|
844
|
+
readonly type: "string";
|
|
845
|
+
};
|
|
846
|
+
readonly labelTranslationKey: {
|
|
847
|
+
readonly type: "string";
|
|
848
|
+
};
|
|
849
|
+
readonly page: {
|
|
850
|
+
readonly type: "string";
|
|
851
|
+
};
|
|
852
|
+
};
|
|
853
|
+
readonly additionalProperties: false;
|
|
854
|
+
readonly default: {};
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
readonly additionalProperties: false;
|
|
859
|
+
readonly default: {};
|
|
860
|
+
};
|
|
807
861
|
};
|
|
808
862
|
readonly additionalProperties: true;
|
|
809
863
|
readonly default: {};
|
|
810
864
|
};
|
|
811
|
-
export type ThemeConfig = FromSchema<typeof themeConfigSchema
|
|
865
|
+
export type ThemeConfig = FromSchema<typeof themeConfigSchema> & {
|
|
866
|
+
catalog?: Record<string, CatalogConfig>;
|
|
867
|
+
};
|
|
812
868
|
export type ThemeUIConfig = ThemeConfig & {
|
|
813
869
|
auth?: {
|
|
814
870
|
idpsInfo?: {
|
|
@@ -822,6 +878,9 @@ export type ThemeUIConfig = ThemeConfig & {
|
|
|
822
878
|
shortcuts?: string[];
|
|
823
879
|
suggestedPages?: any[];
|
|
824
880
|
};
|
|
881
|
+
breadcrumbs?: {
|
|
882
|
+
prefixItems?: ResolvedNavLinkItem[];
|
|
883
|
+
};
|
|
825
884
|
};
|
|
826
885
|
export type MarkdownConfig = FromSchema<typeof markdownConfigSchema>;
|
|
827
886
|
export {};
|
package/lib/config.js
CHANGED
|
@@ -106,6 +106,10 @@ const navItemSchema = {
|
|
|
106
106
|
expanded: { type: 'string', const: 'always' },
|
|
107
107
|
selectFirstItemOnExpand: { type: 'boolean' },
|
|
108
108
|
flatten: { type: 'boolean' },
|
|
109
|
+
linkedSidebars: {
|
|
110
|
+
type: 'array',
|
|
111
|
+
items: { type: 'string' },
|
|
112
|
+
},
|
|
109
113
|
},
|
|
110
114
|
};
|
|
111
115
|
const navItemsSchema = {
|
|
@@ -283,6 +287,27 @@ exports.themeConfigSchema = {
|
|
|
283
287
|
additionalProperties: false,
|
|
284
288
|
default: {},
|
|
285
289
|
},
|
|
290
|
+
breadcrumbs: {
|
|
291
|
+
type: 'object',
|
|
292
|
+
properties: {
|
|
293
|
+
hide: { type: 'boolean' },
|
|
294
|
+
prefixItems: {
|
|
295
|
+
type: 'array',
|
|
296
|
+
items: {
|
|
297
|
+
type: 'object',
|
|
298
|
+
properties: {
|
|
299
|
+
label: { type: 'string' },
|
|
300
|
+
labelTranslationKey: { type: 'string' },
|
|
301
|
+
page: { type: 'string' },
|
|
302
|
+
},
|
|
303
|
+
additionalProperties: false,
|
|
304
|
+
default: {},
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
additionalProperties: false,
|
|
309
|
+
default: {},
|
|
310
|
+
},
|
|
286
311
|
},
|
|
287
312
|
additionalProperties: true,
|
|
288
313
|
default: {},
|
package/lib/globalStyle.js
CHANGED
|
@@ -1570,7 +1570,7 @@ const navbar = (0, styled_components_1.css) `
|
|
|
1570
1570
|
--navbar-item-font-family: var(--font-family-base); // @presenter FontFamily
|
|
1571
1571
|
--navbar-item-font-size: 16px; // @presenter FontSize
|
|
1572
1572
|
--navbar-item-padding-horizontal: 16px; // @presenter Spacing
|
|
1573
|
-
--navbar-item-
|
|
1573
|
+
--navbar-item-padding-vertical: 8px; // @presenter Spacing
|
|
1574
1574
|
--navbar-item-margin-horizontal: 7px;
|
|
1575
1575
|
--navbar-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
1576
1576
|
--navbar-item-font-weight: var(--font-weight-bold); // @presenter FontWeight
|
|
@@ -1595,6 +1595,19 @@ const navbar = (0, styled_components_1.css) `
|
|
|
1595
1595
|
|
|
1596
1596
|
// @tokens End
|
|
1597
1597
|
`;
|
|
1598
|
+
const breadcrumbs = (0, styled_components_1.css) `
|
|
1599
|
+
/**
|
|
1600
|
+
* @tokens Breadcrumbs
|
|
1601
|
+
*/
|
|
1602
|
+
|
|
1603
|
+
--breadcrumbs-text-color: var(--text-color-secondary); // @presenter Color
|
|
1604
|
+
--breadcrumbs-active-text-color: var(--text-color); // @presenter Color
|
|
1605
|
+
--breadcrumbs-hover-text-decoration: underline;
|
|
1606
|
+
--breadcrumbs-padding-horizontal: 8px; // @presenter Spacing
|
|
1607
|
+
--breadcrumbs-margin-bottom: 24px; // @presenter Spacing
|
|
1608
|
+
|
|
1609
|
+
// @tokens End
|
|
1610
|
+
`;
|
|
1598
1611
|
const toc = (0, styled_components_1.css) `
|
|
1599
1612
|
/**
|
|
1600
1613
|
* @tokens TOC
|
|
@@ -2048,6 +2061,7 @@ exports.styles = (0, styled_components_1.css) `
|
|
|
2048
2061
|
${footer}
|
|
2049
2062
|
${logo}
|
|
2050
2063
|
${badges}
|
|
2064
|
+
${breadcrumbs}
|
|
2051
2065
|
${toc}
|
|
2052
2066
|
${inputs}
|
|
2053
2067
|
${tooltip}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Shared UI components library",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"theme",
|
|
7
|
+
"redocly"
|
|
8
|
+
],
|
|
6
9
|
"author": "team@redocly.com",
|
|
7
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
11
|
"main": "lib/index.js",
|
|
@@ -80,7 +80,7 @@ const DropdownValue = styled.div`
|
|
|
80
80
|
display: block;
|
|
81
81
|
|
|
82
82
|
color: var(--navbar-text-color);
|
|
83
|
-
padding: var(--navbar-item-
|
|
83
|
+
padding: var(--navbar-item-padding-vertical) var(--navbar-item-padding-horizontal);
|
|
84
84
|
border-radius: var(--navbar-item-border-radius);
|
|
85
85
|
|
|
86
86
|
&:hover {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { Link } from '@portal/Link';
|
|
5
|
+
|
|
6
|
+
export const Breadcrumb = (props: { label: string; link?: string; isActive: boolean }) => {
|
|
7
|
+
const { label, link, isActive } = props;
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<BreadcrumbWrapper
|
|
11
|
+
data-component-name="Breadcrumbs/Breadcrumb"
|
|
12
|
+
isLink={link != null}
|
|
13
|
+
isActive={isActive}
|
|
14
|
+
>
|
|
15
|
+
{link ? (
|
|
16
|
+
<BreadcrumbLink to={link}>{label}</BreadcrumbLink>
|
|
17
|
+
) : (
|
|
18
|
+
<BreadcrumbText>{label}</BreadcrumbText>
|
|
19
|
+
)}
|
|
20
|
+
</BreadcrumbWrapper>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const BreadcrumbText = styled.div`
|
|
25
|
+
cursor: default;
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const BreadcrumbWrapper = styled.div<{ isActive: boolean; isLink: boolean }>`
|
|
29
|
+
border-radius: var(--border-radius);
|
|
30
|
+
padding: 0 var(--breadcrumbs-padding-horizontal);
|
|
31
|
+
|
|
32
|
+
&:first-child {
|
|
33
|
+
padding-left: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${(props) =>
|
|
37
|
+
props.isLink &&
|
|
38
|
+
`
|
|
39
|
+
&:hover {
|
|
40
|
+
text-decoration: var(--breadcrumbs-hover-text-decoration);
|
|
41
|
+
}
|
|
42
|
+
`}
|
|
43
|
+
|
|
44
|
+
${(props) =>
|
|
45
|
+
props.isActive &&
|
|
46
|
+
`
|
|
47
|
+
color: var(--breadcrumbs-active-text-color);
|
|
48
|
+
`}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const BreadcrumbLink = styled(Link)`
|
|
52
|
+
text-decoration: none;
|
|
53
|
+
|
|
54
|
+
&:visited {
|
|
55
|
+
color: inherit;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { useBreadcrumbs } from '@portal/Sidebar/useBreadcrumbs';
|
|
5
|
+
|
|
6
|
+
import { Breadcrumb } from './Breadcrumb';
|
|
7
|
+
|
|
8
|
+
export const Breadcrumbs = (props: { className?: string }) => {
|
|
9
|
+
const breadcrumbs = useBreadcrumbs();
|
|
10
|
+
|
|
11
|
+
if (breadcrumbs.length === 0) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Container data-component-name="Breadcrumbs/Breadcrumbs" className={props.className}>
|
|
17
|
+
{breadcrumbs.map((breadcrumb, idx) => {
|
|
18
|
+
const isLast = idx === breadcrumbs.length - 1;
|
|
19
|
+
return (
|
|
20
|
+
<React.Fragment key={idx}>
|
|
21
|
+
<Breadcrumb link={breadcrumb.link} label={breadcrumb.label} isActive={isLast} />
|
|
22
|
+
{isLast ? null : <div>/</div>}
|
|
23
|
+
</React.Fragment>
|
|
24
|
+
);
|
|
25
|
+
})}
|
|
26
|
+
</Container>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const Container = styled.div`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
align-items: center;
|
|
34
|
+
color: var(--breadcrumbs-text-color);
|
|
35
|
+
|
|
36
|
+
@media print {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
@@ -9,9 +9,9 @@ export const ContainerWrapper = styled.section.attrs(() => ({
|
|
|
9
9
|
|
|
10
10
|
padding: var(--md-container-padding-vertical) var(--md-container-padding-horizontal);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
// disable margin top for h1 on the title heading
|
|
14
|
-
|
|
12
|
+
article:first-child > h1:first-child {
|
|
13
|
+
// disable margin top for h1 on the title heading
|
|
14
|
+
margin-top: 0;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
${({ theme }) => theme.mediaQueries.medium} {
|
|
@@ -3,11 +3,16 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
type DetailsProps = {
|
|
5
5
|
summary: string;
|
|
6
|
+
className?: string;
|
|
6
7
|
};
|
|
7
8
|
|
|
8
|
-
export function Details({
|
|
9
|
+
export function Details({
|
|
10
|
+
summary,
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
}: React.PropsWithChildren<DetailsProps>): JSX.Element {
|
|
9
14
|
return (
|
|
10
|
-
<StyledDetails>
|
|
15
|
+
<StyledDetails className={className}>
|
|
11
16
|
<summary>{summary}</summary>
|
|
12
17
|
<StyledDetailsContent>{children}</StyledDetailsContent>
|
|
13
18
|
</StyledDetails>
|
|
@@ -9,6 +9,7 @@ import { LastUpdated } from '@theme/components/LastUpdated/LastUpdated';
|
|
|
9
9
|
import { useThemeConfig } from '@theme/hooks';
|
|
10
10
|
import type { ResolvedNavItemWithLink } from '@theme/types/portal';
|
|
11
11
|
import { useTranslate } from '@portal/hooks';
|
|
12
|
+
import { Breadcrumbs as ThemeBreadcrumbs } from '@theme/components/Breadcrumbs';
|
|
12
13
|
|
|
13
14
|
type MarkdownLayoutProps = {
|
|
14
15
|
tableOfContent: React.ReactNode;
|
|
@@ -46,6 +47,7 @@ export function MarkdownLayout({
|
|
|
46
47
|
return (
|
|
47
48
|
<PageWrapper data-component-name="Markdown/MarkdownLayout">
|
|
48
49
|
<ContainerWrapper withToc={true}>
|
|
50
|
+
<Breadcrumbs />
|
|
49
51
|
<LayoutTop>
|
|
50
52
|
{lastModified && <LastUpdated lastModified={new Date(lastModified)} />}
|
|
51
53
|
{mergedConf && (
|
|
@@ -72,6 +74,10 @@ const LayoutTop = styled.div`
|
|
|
72
74
|
flex-flow: row nowrap;
|
|
73
75
|
`;
|
|
74
76
|
|
|
77
|
+
const Breadcrumbs = styled(ThemeBreadcrumbs)`
|
|
78
|
+
margin-bottom: var(--breadcrumbs-margin-bottom);
|
|
79
|
+
`;
|
|
80
|
+
|
|
75
81
|
const LayoutBottom = styled(LayoutTop)`
|
|
76
82
|
> * {
|
|
77
83
|
margin: 25px 5px;
|
|
@@ -28,12 +28,21 @@ export const baseTable = css`
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
th {
|
|
31
|
+
/** th has text-align: center by default */
|
|
31
32
|
text-align: left;
|
|
32
33
|
font-weight: var(--md-table-head-font-weight);
|
|
33
34
|
color: var(--md-table-head-text-color);
|
|
34
35
|
background-color: var(--md-table-head-background-color);
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
/* need to overwrite the text-align: left from above */
|
|
39
|
+
th[align='center'] {
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
th[align='right'] {
|
|
43
|
+
text-align: right;
|
|
44
|
+
}
|
|
45
|
+
|
|
37
46
|
tr th:first-child,
|
|
38
47
|
tr td:first-child {
|
|
39
48
|
border-left: 1px solid var(--md-table-border-color);
|
|
@@ -239,10 +248,6 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
239
248
|
${typography('h1', 'h')};
|
|
240
249
|
margin: var(--h1-margin-top) 0 var(--h1-margin-bottom) 0;
|
|
241
250
|
${headingAnchor()};
|
|
242
|
-
|
|
243
|
-
&:first-child {
|
|
244
|
-
margin-top: 0;
|
|
245
|
-
}
|
|
246
251
|
}
|
|
247
252
|
|
|
248
253
|
h2.md {
|
|
@@ -17,7 +17,7 @@ import { useI18n } from '@portal/hooks';
|
|
|
17
17
|
import { LanguagePicker } from '@theme/I18n/LanguagePicker';
|
|
18
18
|
|
|
19
19
|
const EmptyNavbarHack = createGlobalStyle`
|
|
20
|
-
|
|
20
|
+
:root {
|
|
21
21
|
--navbar-height: 0px !important;
|
|
22
22
|
}
|
|
23
23
|
`;
|
|
@@ -120,7 +120,7 @@ export const NavbarContainer = styled.nav`
|
|
|
120
120
|
position: sticky;
|
|
121
121
|
top: 0;
|
|
122
122
|
z-index: 200;
|
|
123
|
-
padding: var(--navbar-item-
|
|
123
|
+
padding: var(--navbar-item-padding-vertical) var(--navbar-item-padding-horizontal);
|
|
124
124
|
background: var(--navbar-background-color);
|
|
125
125
|
font-family: var(--navbar-item-font-family);
|
|
126
126
|
|
|
@@ -84,7 +84,7 @@ export const NavbarLink = styled(Link)`
|
|
|
84
84
|
|
|
85
85
|
export const NavbarMenuItem = styled.li<{ active?: boolean }>`
|
|
86
86
|
display: inline-block;
|
|
87
|
-
padding: var(--navbar-item-
|
|
87
|
+
padding: var(--navbar-item-padding-vertical) var(--navbar-item-padding-horizontal);
|
|
88
88
|
margin-left: var(--navbar-item-margin-horizontal);
|
|
89
89
|
text-align: center;
|
|
90
90
|
line-height: 1;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// interface OpenApiTryItSecurityPanelProps {
|
|
2
|
+
// server: any;
|
|
3
|
+
// operation: any;
|
|
4
|
+
// onChange?: any;
|
|
5
|
+
// OAuth2: any;
|
|
6
|
+
// }
|
|
7
|
+
|
|
8
|
+
// export function OpenApiTryItSecurityPanel(_props: OpenAPITryItSecurityPanelProps) {
|
|
9
|
+
// return null;
|
|
10
|
+
// }
|
|
11
|
+
|
|
12
|
+
export const OpenApiTryItSecurityPanel: any = null;
|
package/src/components/index.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export * from './OpenApiDocs/hooks/AfterOpenApiTitle';
|
|
2
|
+
export * from './OpenApiDocs/hooks/AfterOpenApiOperation';
|
|
3
|
+
export * from './OpenApiDocs/hooks/AfterOpenApiOperationSummary';
|
|
4
|
+
export * from './OpenApiDocs/hooks/BeforeOpenApiOperation';
|
|
5
|
+
export * from './OpenApiDocs/hooks/BeforeOpenApiOperationSummary';
|
|
1
6
|
export * from './Button';
|
|
2
7
|
export * from './CopyButton';
|
|
3
8
|
export * from './EditPageButton';
|
|
@@ -5,6 +10,9 @@ export * from './JsonViewer';
|
|
|
5
10
|
export * from './Typography';
|
|
6
11
|
export * from './SidebarLogo';
|
|
7
12
|
export * from './CodeBlock';
|
|
13
|
+
export * from './OpenApiDocs/hooks/OpenApiFooter';
|
|
14
|
+
export * from './OpenApiDocs/hooks/OpenApiHeader';
|
|
15
|
+
export * from './OpenApiDocs/hooks/OpenApiTryItSecurityPanel';
|
|
8
16
|
export * from './SamplesPanelControls';
|
|
9
17
|
export * from './Tooltip';
|
|
10
18
|
export * from './SourceCode';
|
|
@@ -16,7 +24,7 @@ export * from './Profile';
|
|
|
16
24
|
export * from './ColorModeSwitcher';
|
|
17
25
|
export * from './Sidebar';
|
|
18
26
|
export * from './Markdown';
|
|
19
|
-
export * from './
|
|
27
|
+
export * from './OpenApiDocs';
|
|
20
28
|
export * from './SidebarActions';
|
|
21
29
|
export * from './Filter';
|
|
22
30
|
export * from './Tags';
|
|
@@ -26,4 +34,5 @@ export * from './Menu';
|
|
|
26
34
|
export * from './Separator';
|
|
27
35
|
export * from './Cards';
|
|
28
36
|
export * from './Tiles';
|
|
37
|
+
export * from './Breadcrumbs';
|
|
29
38
|
export * from './Catalog';
|
package/src/config.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
-
import type { MenuStyle } from './types/portal';
|
|
2
|
+
import type { MenuStyle, ResolvedNavLinkItem } from './types/portal';
|
|
3
|
+
import type { CatalogConfig } from './types/portal/src/shared/types/catalog';
|
|
3
4
|
|
|
4
5
|
const logoConfigSchema = {
|
|
5
6
|
type: 'object',
|
|
@@ -124,6 +125,10 @@ const navItemSchema = {
|
|
|
124
125
|
expanded: { type: 'string', const: 'always' },
|
|
125
126
|
selectFirstItemOnExpand: { type: 'boolean' },
|
|
126
127
|
flatten: { type: 'boolean' },
|
|
128
|
+
linkedSidebars: {
|
|
129
|
+
type: 'array',
|
|
130
|
+
items: { type: 'string' },
|
|
131
|
+
},
|
|
127
132
|
},
|
|
128
133
|
} as const;
|
|
129
134
|
|
|
@@ -352,12 +357,37 @@ export const themeConfigSchema = {
|
|
|
352
357
|
additionalProperties: false,
|
|
353
358
|
default: {},
|
|
354
359
|
},
|
|
360
|
+
breadcrumbs: {
|
|
361
|
+
type: 'object',
|
|
362
|
+
properties: {
|
|
363
|
+
hide: { type: 'boolean' },
|
|
364
|
+
prefixItems: {
|
|
365
|
+
type: 'array',
|
|
366
|
+
items: {
|
|
367
|
+
type: 'object',
|
|
368
|
+
properties: {
|
|
369
|
+
label: { type: 'string' },
|
|
370
|
+
labelTranslationKey: { type: 'string' },
|
|
371
|
+
page: { type: 'string' },
|
|
372
|
+
},
|
|
373
|
+
additionalProperties: false,
|
|
374
|
+
default: {},
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
additionalProperties: false,
|
|
379
|
+
default: {},
|
|
380
|
+
},
|
|
355
381
|
},
|
|
356
382
|
additionalProperties: true,
|
|
357
383
|
default: {},
|
|
358
384
|
} as const;
|
|
359
385
|
|
|
360
|
-
|
|
386
|
+
// FIXME: add catalog to schema
|
|
387
|
+
export type ThemeConfig = FromSchema<typeof themeConfigSchema> & {
|
|
388
|
+
catalog?: Record<string, CatalogConfig>;
|
|
389
|
+
};
|
|
390
|
+
|
|
361
391
|
export type ThemeUIConfig = ThemeConfig & {
|
|
362
392
|
auth?: {
|
|
363
393
|
// used by portal dev login emulator
|
|
@@ -372,6 +402,9 @@ export type ThemeUIConfig = ThemeConfig & {
|
|
|
372
402
|
shortcuts?: string[];
|
|
373
403
|
suggestedPages?: any[];
|
|
374
404
|
};
|
|
405
|
+
breadcrumbs?: {
|
|
406
|
+
prefixItems?: ResolvedNavLinkItem[];
|
|
407
|
+
};
|
|
375
408
|
};
|
|
376
409
|
|
|
377
410
|
export type MarkdownConfig = FromSchema<typeof markdownConfigSchema>;
|
package/src/globalStyle.ts
CHANGED
|
@@ -1586,7 +1586,7 @@ const navbar = css`
|
|
|
1586
1586
|
--navbar-item-font-family: var(--font-family-base); // @presenter FontFamily
|
|
1587
1587
|
--navbar-item-font-size: 16px; // @presenter FontSize
|
|
1588
1588
|
--navbar-item-padding-horizontal: 16px; // @presenter Spacing
|
|
1589
|
-
--navbar-item-
|
|
1589
|
+
--navbar-item-padding-vertical: 8px; // @presenter Spacing
|
|
1590
1590
|
--navbar-item-margin-horizontal: 7px;
|
|
1591
1591
|
--navbar-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
1592
1592
|
--navbar-item-font-weight: var(--font-weight-bold); // @presenter FontWeight
|
|
@@ -1612,6 +1612,20 @@ const navbar = css`
|
|
|
1612
1612
|
// @tokens End
|
|
1613
1613
|
`;
|
|
1614
1614
|
|
|
1615
|
+
const breadcrumbs = css`
|
|
1616
|
+
/**
|
|
1617
|
+
* @tokens Breadcrumbs
|
|
1618
|
+
*/
|
|
1619
|
+
|
|
1620
|
+
--breadcrumbs-text-color: var(--text-color-secondary); // @presenter Color
|
|
1621
|
+
--breadcrumbs-active-text-color: var(--text-color); // @presenter Color
|
|
1622
|
+
--breadcrumbs-hover-text-decoration: underline;
|
|
1623
|
+
--breadcrumbs-padding-horizontal: 8px; // @presenter Spacing
|
|
1624
|
+
--breadcrumbs-margin-bottom: 24px; // @presenter Spacing
|
|
1625
|
+
|
|
1626
|
+
// @tokens End
|
|
1627
|
+
`
|
|
1628
|
+
|
|
1615
1629
|
const toc = css`
|
|
1616
1630
|
/**
|
|
1617
1631
|
* @tokens TOC
|
|
@@ -2076,6 +2090,7 @@ export const styles = css`
|
|
|
2076
2090
|
${footer}
|
|
2077
2091
|
${logo}
|
|
2078
2092
|
${badges}
|
|
2093
|
+
${breadcrumbs}
|
|
2079
2094
|
${toc}
|
|
2080
2095
|
${inputs}
|
|
2081
2096
|
${tooltip}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|