@redocly/theme 0.17.0 → 0.17.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/components/CodeBlock/CodeBlock.d.ts +29 -1
- package/lib/components/CodeBlock/CodeBlock.js +56 -94
- package/lib/components/CodeBlock/CodeBlockContainer.d.ts +3 -0
- package/lib/components/CodeBlock/CodeBlockContainer.js +120 -0
- package/lib/components/CodeBlock/CodeBlockControlButton.d.ts +5 -0
- package/lib/components/CodeBlock/CodeBlockControlButton.js +63 -0
- package/lib/components/CodeBlock/CodeBlockControls.d.ts +33 -0
- package/lib/components/CodeBlock/CodeBlockControls.js +56 -0
- package/lib/components/CodeBlock/index.d.ts +3 -0
- package/lib/components/CodeBlock/index.js +3 -0
- package/lib/components/CopyButton/CopyButton.d.ts +12 -3
- package/lib/components/CopyButton/CopyButton.js +30 -26
- package/lib/components/CopyButton/index.d.ts +0 -1
- package/lib/components/CopyButton/index.js +0 -1
- package/lib/components/Feedback/useReportDialog.d.ts +12 -6
- package/lib/components/Feedback/useReportDialog.js +13 -5
- package/lib/components/JsonViewer/JsonViewer.d.ts +0 -1
- package/lib/components/JsonViewer/JsonViewer.js +100 -119
- package/lib/components/Markdown/MarkdownWrapper.d.ts +5 -1
- package/lib/components/Markdown/MarkdownWrapper.js +59 -53
- package/lib/components/Menu/MobileMenu.js +2 -2
- package/lib/components/Menu/MobileMenuGroup.js +1 -1
- package/lib/components/Panel/PanelHeader.js +0 -1
- package/lib/components/Tooltip/Tooltip.js +2 -0
- package/lib/components/index.d.ts +0 -3
- package/lib/components/index.js +0 -3
- package/lib/config.d.ts +30 -23
- package/lib/config.js +16 -3
- package/lib/globalStyle.js +50 -7
- package/lib/icons/ArrowIcon/ArrowIcon.d.ts +3 -3
- package/lib/icons/ArrowIcon/ArrowIcon.js +33 -6
- package/lib/icons/CollapseIcon/CollapseIcon.d.ts +7 -0
- package/lib/icons/CollapseIcon/CollapseIcon.js +22 -0
- package/lib/icons/CollapseIcon/index.d.ts +1 -0
- package/lib/{components/SourceCode → icons/CollapseIcon}/index.js +1 -1
- package/lib/icons/CopyIcon/CopyIcon.d.ts +7 -0
- package/lib/icons/CopyIcon/CopyIcon.js +17 -0
- package/lib/icons/CopyIcon/index.d.ts +1 -0
- package/lib/{components/CodeSample → icons/CopyIcon}/index.js +1 -1
- package/lib/icons/DeselectIcon/DeselectIcon.d.ts +7 -0
- package/lib/icons/DeselectIcon/DeselectIcon.js +19 -0
- package/lib/icons/DeselectIcon/index.d.ts +1 -0
- package/lib/{components/SamplesPanelControls → icons/DeselectIcon}/index.js +1 -1
- package/lib/icons/ExpandIcon/ExpandIcon.d.ts +5 -6
- package/lib/icons/ExpandIcon/ExpandIcon.js +10 -19
- package/lib/icons/FileIcon/FileIcon.d.ts +7 -0
- package/lib/icons/FileIcon/FileIcon.js +17 -0
- package/lib/icons/FileIcon/index.d.ts +1 -0
- package/lib/icons/FileIcon/index.js +18 -0
- package/lib/icons/ReportIcon/ReportIcon.d.ts +7 -0
- package/lib/icons/ReportIcon/ReportIcon.js +19 -0
- package/lib/icons/ReportIcon/index.d.ts +1 -0
- package/lib/icons/ReportIcon/index.js +18 -0
- package/lib/icons/SelectIcon/SelectIcon.d.ts +7 -0
- package/lib/icons/SelectIcon/SelectIcon.js +19 -0
- package/lib/icons/SelectIcon/index.d.ts +1 -0
- package/lib/icons/SelectIcon/index.js +18 -0
- package/lib/icons/index.d.ts +7 -1
- package/lib/icons/index.js +7 -1
- package/lib/layouts/Forbidden.js +2 -2
- package/lib/utils/highlight.d.ts +1 -0
- package/lib/utils/highlight.js +1 -0
- package/package.json +1 -1
- package/src/components/CodeBlock/CodeBlock.tsx +100 -0
- package/src/components/CodeBlock/{CodeBlock.ts → CodeBlockContainer.tsx} +23 -6
- package/src/components/CodeBlock/CodeBlockControlButton.tsx +38 -0
- package/src/components/CodeBlock/CodeBlockControls.tsx +182 -0
- package/src/components/CodeBlock/index.ts +3 -0
- package/src/components/CopyButton/CopyButton.tsx +71 -19
- package/src/components/CopyButton/index.ts +0 -1
- package/src/components/Feedback/useReportDialog.ts +24 -14
- package/src/components/JsonViewer/JsonViewer.tsx +112 -142
- package/src/components/Markdown/MarkdownWrapper.tsx +65 -54
- package/src/components/Menu/MobileMenu.tsx +3 -3
- package/src/components/Menu/MobileMenuGroup.tsx +4 -2
- package/src/components/Panel/PanelHeader.ts +0 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -0
- package/src/components/index.ts +0 -3
- package/src/config.ts +18 -7
- package/src/globalStyle.ts +50 -7
- package/src/icons/ArrowIcon/ArrowIcon.tsx +37 -14
- package/src/icons/CollapseIcon/CollapseIcon.tsx +40 -0
- package/src/icons/CollapseIcon/index.tsx +1 -0
- package/src/icons/CopyIcon/CopyIcon.tsx +26 -0
- package/src/icons/CopyIcon/index.ts +1 -0
- package/src/icons/DeselectIcon/DeselectIcon.tsx +28 -0
- package/src/icons/DeselectIcon/index.ts +1 -0
- package/src/icons/ExpandIcon/ExpandIcon.tsx +28 -34
- package/src/icons/FileIcon/FileIcon.tsx +29 -0
- package/src/icons/FileIcon/index.ts +1 -0
- package/src/icons/ReportIcon/ReportIcon.tsx +36 -0
- package/src/icons/ReportIcon/index.ts +1 -0
- package/src/icons/SelectIcon/SelectIcon.tsx +31 -0
- package/src/icons/SelectIcon/index.ts +1 -0
- package/src/icons/index.ts +7 -1
- package/src/layouts/Forbidden.tsx +1 -1
- package/src/utils/highlight.ts +1 -0
- package/lib/components/CodeSample/CodeSample.d.ts +0 -10
- package/lib/components/CodeSample/CodeSample.js +0 -226
- package/lib/components/CodeSample/index.d.ts +0 -1
- package/lib/components/CopyButton/CopyButtonWrapper.d.ts +0 -11
- package/lib/components/CopyButton/CopyButtonWrapper.js +0 -53
- package/lib/components/SamplesPanelControls/SamplesPanelControls.d.ts +0 -4
- package/lib/components/SamplesPanelControls/SamplesPanelControls.js +0 -76
- package/lib/components/SamplesPanelControls/index.d.ts +0 -1
- package/lib/components/SourceCode/SourceCode.d.ts +0 -33
- package/lib/components/SourceCode/SourceCode.js +0 -60
- package/lib/components/SourceCode/index.d.ts +0 -1
- package/src/components/CodeSample/CodeSample.tsx +0 -257
- package/src/components/CodeSample/index.ts +0 -1
- package/src/components/CopyButton/CopyButtonWrapper.tsx +0 -55
- package/src/components/SamplesPanelControls/SamplesPanelControls.ts +0 -76
- package/src/components/SamplesPanelControls/index.ts +0 -1
- package/src/components/SourceCode/SourceCode.tsx +0 -128
- package/src/components/SourceCode/index.ts +0 -1
|
@@ -12,4 +12,3 @@ export declare const JsonViewer: import("styled-components").StyledComponent<Rea
|
|
|
12
12
|
'data-component-name': string;
|
|
13
13
|
} & JsonProps, "data-component-name">;
|
|
14
14
|
export declare const JsonViewerWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
-
export declare const StyledCodeBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -26,11 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.JsonViewerWrap = exports.JsonViewer = exports.Json = void 0;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
-
const CopyButton_1 = require("../../components/CopyButton");
|
|
33
|
-
const SamplesPanelControls_1 = require("../../components/SamplesPanelControls");
|
|
34
32
|
const utils_1 = require("../../utils");
|
|
35
33
|
const hooks_1 = require("../../hooks");
|
|
36
34
|
const CodeBlock_1 = require("../../components/CodeBlock");
|
|
@@ -44,6 +42,11 @@ function JsonComponent({ data, jsonSampleExpandLevel, className, withLineNumbers
|
|
|
44
42
|
var _a;
|
|
45
43
|
(_a = node === null || node === void 0 ? void 0 : node.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', clickListener);
|
|
46
44
|
});
|
|
45
|
+
const setRef = (instance) => {
|
|
46
|
+
if (instance)
|
|
47
|
+
node.current = instance;
|
|
48
|
+
};
|
|
49
|
+
const showFoldingButtons = data && Object.values(data).some((value) => typeof value === 'object' && value !== null);
|
|
47
50
|
const expandAll = () => {
|
|
48
51
|
var _a, _b;
|
|
49
52
|
const elements = (_a = node === null || node === void 0 ? void 0 : node.current) === null || _a === void 0 ? void 0 : _a.getElementsByClassName('collapsible');
|
|
@@ -85,19 +88,14 @@ function JsonComponent({ data, jsonSampleExpandLevel, className, withLineNumbers
|
|
|
85
88
|
const clickListener = (event) => {
|
|
86
89
|
collapseElement(event.target);
|
|
87
90
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
react_1.default.createElement(exports.StyledCodeBlock, { className: withLineNumbers ? `${className} line-numbers` : className, ref: node, dangerouslySetInnerHTML: {
|
|
97
|
-
__html: (0, utils_1.jsonToHTML)(data, jsonSampleExpandLevel, startLineNumber),
|
|
98
|
-
} })));
|
|
99
|
-
};
|
|
100
|
-
return (react_1.default.createElement(CopyButton_1.CopyButtonWrapper, { "data-cy": "copy-button", data: data, onCopyClick: onCopyClick }, renderInner));
|
|
91
|
+
return (react_1.default.createElement(exports.JsonViewerWrap, { "data-cy": "json-viewer", "data-component-name": "JsonViewer/JsonViewer", className: className },
|
|
92
|
+
react_1.default.createElement(CodeBlock_1.CodeBlock, { header: {
|
|
93
|
+
controls: {
|
|
94
|
+
copy: { data, onClick: onCopyClick, handleOutside: true },
|
|
95
|
+
expand: showFoldingButtons ? { onClick: expandAll } : undefined,
|
|
96
|
+
collapse: showFoldingButtons ? { onClick: collapseAll } : undefined,
|
|
97
|
+
},
|
|
98
|
+
}, codeBlockRef: setRef, withLineNumbers: withLineNumbers, highlightedHtml: (0, utils_1.jsonToHTML)(data, jsonSampleExpandLevel, startLineNumber) })));
|
|
101
99
|
}
|
|
102
100
|
exports.Json = (0, react_1.memo)(JsonComponent);
|
|
103
101
|
exports.JsonViewer = (0, styled_components_1.default)(exports.Json).attrs(() => ({
|
|
@@ -110,131 +108,114 @@ exports.JsonViewer = (0, styled_components_1.default)(exports.Json).attrs(() =>
|
|
|
110
108
|
border: none;
|
|
111
109
|
}
|
|
112
110
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
pointer-events: none;
|
|
135
|
-
user-select: none;
|
|
136
|
-
padding: 0 0.5em;
|
|
137
|
-
font-size: 13px;
|
|
111
|
+
pre {
|
|
112
|
+
contain: content;
|
|
113
|
+
overflow-x: auto;
|
|
114
|
+
position: relative;
|
|
115
|
+
border-radius: 0 0 var(--border-radius) var(--border-radius);
|
|
116
|
+
|
|
117
|
+
&.line-numbers {
|
|
118
|
+
padding: 20px 20px 20px 3em;
|
|
119
|
+
|
|
120
|
+
*[data-line]:not(.collapsed *[data-line]) {
|
|
121
|
+
&:before {
|
|
122
|
+
content: attr(data-line);
|
|
123
|
+
position: absolute;
|
|
124
|
+
left: 0;
|
|
125
|
+
min-width: 2em;
|
|
126
|
+
text-align: right;
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
user-select: none;
|
|
129
|
+
padding: 0 0.5em;
|
|
130
|
+
font-size: 13px;
|
|
131
|
+
}
|
|
138
132
|
}
|
|
139
133
|
}
|
|
140
|
-
}
|
|
141
134
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
.callback-function {
|
|
136
|
+
color: gray;
|
|
137
|
+
}
|
|
145
138
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
139
|
+
.ellipsis:after {
|
|
140
|
+
content: ' … ';
|
|
141
|
+
}
|
|
149
142
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
143
|
+
.collapsible {
|
|
144
|
+
padding-left: 2ch;
|
|
145
|
+
display: inline-block;
|
|
146
|
+
}
|
|
154
147
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
148
|
+
.hoverable {
|
|
149
|
+
padding: 1px 2px;
|
|
150
|
+
display: inline-block;
|
|
151
|
+
}
|
|
159
152
|
|
|
160
|
-
|
|
161
|
-
|
|
153
|
+
.collapsed {
|
|
154
|
+
white-space: nowrap;
|
|
162
155
|
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
& > .collapser:after {
|
|
157
|
+
content: '+';
|
|
158
|
+
}
|
|
165
159
|
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.hovered {
|
|
169
|
-
background-color: rgba(235, 238, 249, 1);
|
|
170
|
-
}
|
|
171
160
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
--margin-right: 3px;
|
|
175
|
-
|
|
176
|
-
display: inline-block;
|
|
177
|
-
background-color: transparent;
|
|
178
|
-
border: 0;
|
|
179
|
-
padding: 1px;
|
|
180
|
-
color: #fff;
|
|
181
|
-
width: var(--size);
|
|
182
|
-
height: var(--size);
|
|
183
|
-
margin-left: calc((var(--size) + var(--margin-right)) * -1);
|
|
184
|
-
margin-right: var(--margin-right);
|
|
185
|
-
cursor: pointer;
|
|
186
|
-
user-select: none;
|
|
187
|
-
-webkit-user-select: none;
|
|
188
|
-
font-family: var(--code-font-family);
|
|
189
|
-
font-size: var(--code-font-size);
|
|
190
|
-
|
|
191
|
-
&:after {
|
|
192
|
-
content: '-';
|
|
193
|
-
display: flex;
|
|
194
|
-
align-items: center;
|
|
195
|
-
justify-content: center;
|
|
196
|
-
height: 100%;
|
|
197
|
-
width: 100%;
|
|
161
|
+
.hovered {
|
|
162
|
+
background-color: rgba(235, 238, 249, 1);
|
|
198
163
|
}
|
|
199
164
|
|
|
200
|
-
|
|
201
|
-
|
|
165
|
+
.collapser {
|
|
166
|
+
--size: 15px;
|
|
167
|
+
--margin-right: 3px;
|
|
168
|
+
|
|
169
|
+
display: inline-block;
|
|
170
|
+
background-color: transparent;
|
|
171
|
+
border: 0;
|
|
172
|
+
padding: 1px;
|
|
173
|
+
color: #fff;
|
|
174
|
+
width: var(--size);
|
|
175
|
+
height: var(--size);
|
|
176
|
+
margin-left: calc((var(--size) + var(--margin-right)) * -1);
|
|
177
|
+
margin-right: var(--margin-right);
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
user-select: none;
|
|
180
|
+
-webkit-user-select: none;
|
|
181
|
+
font-family: var(--code-font-family);
|
|
182
|
+
font-size: var(--code-font-size);
|
|
183
|
+
|
|
184
|
+
&:after {
|
|
185
|
+
content: '-';
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
height: 100%;
|
|
190
|
+
width: 100%;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&:focus {
|
|
194
|
+
outline: #fff dotted 1px;
|
|
195
|
+
}
|
|
202
196
|
}
|
|
203
|
-
}
|
|
204
197
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
198
|
+
.selected {
|
|
199
|
+
outline-width: 1px;
|
|
200
|
+
outline-style: dotted;
|
|
201
|
+
}
|
|
209
202
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
203
|
+
.collapsed > .collapsible {
|
|
204
|
+
display: none;
|
|
205
|
+
}
|
|
213
206
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
207
|
+
.ellipsis {
|
|
208
|
+
display: none;
|
|
209
|
+
}
|
|
217
210
|
|
|
218
|
-
|
|
219
|
-
|
|
211
|
+
.collapsed > .ellipsis {
|
|
212
|
+
display: inline;
|
|
213
|
+
}
|
|
220
214
|
}
|
|
221
215
|
`;
|
|
222
216
|
exports.JsonViewerWrap = styled_components_1.default.div `
|
|
223
217
|
display: flex;
|
|
224
218
|
flex-direction: column;
|
|
225
219
|
flex: 1;
|
|
226
|
-
|
|
227
|
-
&:hover > ${SamplesPanelControls_1.SampleControls} {
|
|
228
|
-
opacity: 1;
|
|
229
|
-
}
|
|
230
|
-
`;
|
|
231
|
-
exports.StyledCodeBlock = (0, styled_components_1.default)(CodeBlock_1.CodeBlock) `
|
|
232
|
-
flex: 1;
|
|
233
|
-
|
|
234
|
-
code {
|
|
235
|
-
font-family: var(--code-font-family);
|
|
236
|
-
font-size: 14px;
|
|
237
|
-
line-height: 18px;
|
|
238
|
-
}
|
|
239
220
|
`;
|
|
240
221
|
//# sourceMappingURL=JsonViewer.js.map
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
2
2
|
export declare const baseTable: FlattenSimpleInterpolation;
|
|
3
|
+
export declare const linksCss: FlattenSimpleInterpolation;
|
|
3
4
|
export declare function headingAnchor(className?: string): FlattenSimpleInterpolation;
|
|
4
|
-
export declare const MarkdownWrapper: import("styled-components").StyledComponent<"main", any, {
|
|
5
|
+
export declare const MarkdownWrapper: import("styled-components").StyledComponent<"main", any, {
|
|
6
|
+
compact?: boolean | undefined;
|
|
7
|
+
inline?: boolean | undefined;
|
|
8
|
+
}, never>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.MarkdownWrapper = exports.headingAnchor = exports.baseTable = void 0;
|
|
26
|
+
exports.MarkdownWrapper = exports.headingAnchor = exports.linksCss = exports.baseTable = void 0;
|
|
27
27
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
28
28
|
const theme_helpers_1 = require("../../utils/theme-helpers");
|
|
29
29
|
exports.baseTable = (0, styled_components_1.css) `
|
|
@@ -105,6 +105,28 @@ exports.baseTable = (0, styled_components_1.css) `
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
`;
|
|
108
|
+
exports.linksCss = (0, styled_components_1.css) `
|
|
109
|
+
a:not([role='button']) {
|
|
110
|
+
text-decoration: var(--link-decoration);
|
|
111
|
+
color: var(--link-text-color);
|
|
112
|
+
font-weight: var(--link-font-weight);
|
|
113
|
+
|
|
114
|
+
&:visited {
|
|
115
|
+
color: var(--link-visited-text-color);
|
|
116
|
+
text-decoration: var(--link-visited-decoration);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&:hover {
|
|
120
|
+
text-decoration: var(--link-hover-decoration);
|
|
121
|
+
color: var(--link-hover-text-color);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:focus {
|
|
125
|
+
color: var(--link-active-text-color);
|
|
126
|
+
text-decoration: var(--link-active-decoration);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
`;
|
|
108
130
|
// TODO: Can users specify another className or we should hardcode it?
|
|
109
131
|
function headingAnchor(className = 'anchor') {
|
|
110
132
|
return (0, styled_components_1.css) `
|
|
@@ -150,26 +172,24 @@ exports.MarkdownWrapper = styled_components_1.default.main.attrs(({ className })
|
|
|
150
172
|
font-family: var(--font-family-base);
|
|
151
173
|
line-height: var(--line-height-base);
|
|
152
174
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
175
|
+
${({ compact }) => compact &&
|
|
176
|
+
(0, styled_components_1.css) `
|
|
177
|
+
p:first-child {
|
|
178
|
+
margin-top: 0;
|
|
179
|
+
}
|
|
180
|
+
p:last-child {
|
|
181
|
+
margin-bottom: 0;
|
|
182
|
+
}
|
|
183
|
+
`}
|
|
162
184
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
185
|
+
${({ inline }) => inline &&
|
|
186
|
+
(0, styled_components_1.css) `
|
|
187
|
+
p {
|
|
188
|
+
display: inline-block;
|
|
189
|
+
}
|
|
190
|
+
`}
|
|
167
191
|
|
|
168
|
-
|
|
169
|
-
color: var(--link-active-text-color);
|
|
170
|
-
text-decoration: var(--link-active-decoration);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
192
|
+
${exports.linksCss}
|
|
173
193
|
|
|
174
194
|
img {
|
|
175
195
|
max-width: 100%;
|
|
@@ -221,40 +241,6 @@ exports.MarkdownWrapper = styled_components_1.default.main.attrs(({ className })
|
|
|
221
241
|
|
|
222
242
|
${exports.baseTable};
|
|
223
243
|
|
|
224
|
-
.code-snippets-tabs {
|
|
225
|
-
.snippets-tabs-headers {
|
|
226
|
-
font-size: 0.9em;
|
|
227
|
-
|
|
228
|
-
font-family: var(--heading-font-family);
|
|
229
|
-
|
|
230
|
-
.tab-header {
|
|
231
|
-
text-align: center;
|
|
232
|
-
padding: 0.2em 0.5em;
|
|
233
|
-
display: inline-block;
|
|
234
|
-
cursor: pointer;
|
|
235
|
-
color: var(--text-color-secondary);
|
|
236
|
-
|
|
237
|
-
&.active {
|
|
238
|
-
color: var(--heading-text-color);
|
|
239
|
-
font-weight: var(--font-weight-bold);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.tab-content {
|
|
245
|
-
margin-top: 4px;
|
|
246
|
-
display: none;
|
|
247
|
-
|
|
248
|
-
pre {
|
|
249
|
-
margin-top: 0;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
&.active {
|
|
253
|
-
display: block;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
244
|
p {
|
|
259
245
|
margin: var(--md-paragraph-margin-vertical) var(--md-paragraph-margin-horizontal);
|
|
260
246
|
|
|
@@ -339,6 +325,26 @@ exports.MarkdownWrapper = styled_components_1.default.main.attrs(({ className })
|
|
|
339
325
|
font-family: var(--code-font-family);
|
|
340
326
|
}
|
|
341
327
|
|
|
328
|
+
pre {
|
|
329
|
+
white-space: var(--code-wrap, pre);
|
|
330
|
+
background-color: var(--code-block-background-color);
|
|
331
|
+
font-family: var(--code-block-font-family);
|
|
332
|
+
color: var(--code-block-text-color);
|
|
333
|
+
padding: calc(var(--spacing-unit) * 2);
|
|
334
|
+
overflow-x: auto;
|
|
335
|
+
line-height: normal;
|
|
336
|
+
border-radius: var(--code-block-border-radius);
|
|
337
|
+
border: 1px solid var(--code-block-border-color);
|
|
338
|
+
|
|
339
|
+
code {
|
|
340
|
+
background-color: transparent;
|
|
341
|
+
color: inherit;
|
|
342
|
+
font-size: inherit;
|
|
343
|
+
font-family: inherit;
|
|
344
|
+
border: none;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
342
348
|
blockquote {
|
|
343
349
|
margin: var(--md-blockquote-margin-vertical) var(--md-blockquote-margin-horizontal);
|
|
344
350
|
padding: var(--md-blockquote-padding-vertical) var(--md-blockquote-padding-horizontal);
|
|
@@ -80,11 +80,11 @@ function MobileMenu({ navItems, sidebarItems, className, }) {
|
|
|
80
80
|
react_1.default.createElement(ScrollableArea, null,
|
|
81
81
|
isButtonsSectionVisible && (react_1.default.createElement(ButtonsSection, { alignRight: isPreviousButtonVisible },
|
|
82
82
|
isMenuButtonVisible && (react_1.default.createElement(exports.ControlButton, { "data-component-name": "Menu/ControlButton", onClick: () => setMenuLevel(MenuLevel.NAVBAR) },
|
|
83
|
-
react_1.default.createElement(icons_1.
|
|
83
|
+
react_1.default.createElement(icons_1.ArrowIcon, { direction: "left", weight: "thin" }),
|
|
84
84
|
react_1.default.createElement(ControlButtonLabel, { paddingDirection: "left" }, translate(translationKeys.mainMenu, 'Main Menu')))),
|
|
85
85
|
isPreviousButtonVisible && (react_1.default.createElement(exports.ControlButton, { "data-component-name": "Menu/ControlButton", onClick: () => setMenuLevel(MenuLevel.SIDEBAR) },
|
|
86
86
|
react_1.default.createElement(ControlButtonLabel, { paddingDirection: "right" }, translate(translationKeys.previous, 'Previous')),
|
|
87
|
-
react_1.default.createElement(icons_1.
|
|
87
|
+
react_1.default.createElement(icons_1.ArrowIcon, { direction: "right", weight: "thin" }))))),
|
|
88
88
|
react_1.default.createElement(MenuWrapper, null,
|
|
89
89
|
react_1.default.createElement(index_1.Menu, { items: menuItems, isMobile: true }))),
|
|
90
90
|
react_1.default.createElement(MobileUserProfile_1.MobileUserProfile, null)));
|
|
@@ -18,7 +18,7 @@ function MobileMenuGroup({ item, isExpanded, toggleExpanded, children, }) {
|
|
|
18
18
|
react_1.default.createElement(MenuGroupLabel, { onClick: toggleExpanded, active: item.active, expanded: isExpanded },
|
|
19
19
|
react_1.default.createElement(LabelContainer, null,
|
|
20
20
|
react_1.default.createElement(Label, null, translate(item.labelTranslationKey, item.label))),
|
|
21
|
-
!!item.items.length && react_1.default.createElement(icons_1.
|
|
21
|
+
!!item.items.length && (react_1.default.createElement(icons_1.ArrowIcon, { direction: isExpanded ? 'down' : 'right', weight: "thin" })))),
|
|
22
22
|
react_1.default.createElement(MenuWrapper, { isExpanded: isExpanded }, children),
|
|
23
23
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
24
24
|
}
|
|
@@ -13,9 +13,7 @@ export * from './CodeBlock';
|
|
|
13
13
|
export * from './OpenApiDocs/hooks/OpenApiFooter';
|
|
14
14
|
export * from './OpenApiDocs/hooks/OpenApiHeader';
|
|
15
15
|
export * from './OpenApiDocs/hooks/OpenApiTryItSecurityPanel';
|
|
16
|
-
export * from './SamplesPanelControls';
|
|
17
16
|
export * from './Tooltip';
|
|
18
|
-
export * from './SourceCode';
|
|
19
17
|
export * from './Panel';
|
|
20
18
|
export * from './Feedback';
|
|
21
19
|
export * from './OperationBadge';
|
|
@@ -28,7 +26,6 @@ export * from './OpenApiDocs';
|
|
|
28
26
|
export * from './SidebarActions';
|
|
29
27
|
export * from './Filter';
|
|
30
28
|
export * from './Tags';
|
|
31
|
-
export * from './CodeSample';
|
|
32
29
|
export * from './Tabs';
|
|
33
30
|
export * from './Menu';
|
|
34
31
|
export * from './Separator';
|
package/lib/components/index.js
CHANGED
|
@@ -29,9 +29,7 @@ __exportStar(require("./CodeBlock"), exports);
|
|
|
29
29
|
__exportStar(require("./OpenApiDocs/hooks/OpenApiFooter"), exports);
|
|
30
30
|
__exportStar(require("./OpenApiDocs/hooks/OpenApiHeader"), exports);
|
|
31
31
|
__exportStar(require("./OpenApiDocs/hooks/OpenApiTryItSecurityPanel"), exports);
|
|
32
|
-
__exportStar(require("./SamplesPanelControls"), exports);
|
|
33
32
|
__exportStar(require("./Tooltip"), exports);
|
|
34
|
-
__exportStar(require("./SourceCode"), exports);
|
|
35
33
|
__exportStar(require("./Panel"), exports);
|
|
36
34
|
__exportStar(require("./Feedback"), exports);
|
|
37
35
|
__exportStar(require("./OperationBadge"), exports);
|
|
@@ -44,7 +42,6 @@ __exportStar(require("./OpenApiDocs"), exports);
|
|
|
44
42
|
__exportStar(require("./SidebarActions"), exports);
|
|
45
43
|
__exportStar(require("./Filter"), exports);
|
|
46
44
|
__exportStar(require("./Tags"), exports);
|
|
47
|
-
__exportStar(require("./CodeSample"), exports);
|
|
48
45
|
__exportStar(require("./Tabs"), exports);
|
|
49
46
|
__exportStar(require("./Menu"), exports);
|
|
50
47
|
__exportStar(require("./Separator"), exports);
|
package/lib/config.d.ts
CHANGED
|
@@ -881,31 +881,21 @@ export declare const themeConfigSchema: {
|
|
|
881
881
|
readonly codeSnippet: {
|
|
882
882
|
readonly type: "object";
|
|
883
883
|
readonly properties: {
|
|
884
|
+
readonly controlsStyle: {
|
|
885
|
+
readonly type: "string";
|
|
886
|
+
readonly default: "icon";
|
|
887
|
+
};
|
|
884
888
|
readonly copy: {
|
|
885
889
|
readonly type: "object";
|
|
886
890
|
readonly properties: {
|
|
887
891
|
readonly hide: {
|
|
888
892
|
readonly type: "boolean";
|
|
889
893
|
};
|
|
890
|
-
readonly buttonText: {
|
|
891
|
-
readonly type: "string";
|
|
892
|
-
readonly default: "Copy";
|
|
893
|
-
};
|
|
894
|
-
readonly tooltipText: {
|
|
895
|
-
readonly type: "string";
|
|
896
|
-
readonly default: "Copy to clipboard";
|
|
897
|
-
};
|
|
898
|
-
readonly toasterText: {
|
|
899
|
-
readonly type: "string";
|
|
900
|
-
readonly default: "Copied!";
|
|
901
|
-
};
|
|
902
|
-
readonly toasterDuration: {
|
|
903
|
-
readonly type: "number";
|
|
904
|
-
readonly default: 1500;
|
|
905
|
-
};
|
|
906
894
|
};
|
|
907
895
|
readonly additionalProperties: false;
|
|
908
|
-
readonly default: {
|
|
896
|
+
readonly default: {
|
|
897
|
+
readonly hide: false;
|
|
898
|
+
};
|
|
909
899
|
};
|
|
910
900
|
readonly report: {
|
|
911
901
|
readonly type: "object";
|
|
@@ -913,17 +903,34 @@ export declare const themeConfigSchema: {
|
|
|
913
903
|
readonly hide: {
|
|
914
904
|
readonly type: "boolean";
|
|
915
905
|
};
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
906
|
+
};
|
|
907
|
+
readonly additionalProperties: false;
|
|
908
|
+
readonly default: {
|
|
909
|
+
readonly hide: true;
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
readonly expand: {
|
|
913
|
+
readonly type: "object";
|
|
914
|
+
readonly properties: {
|
|
915
|
+
readonly hide: {
|
|
916
|
+
readonly type: "boolean";
|
|
919
917
|
};
|
|
920
|
-
|
|
921
|
-
|
|
918
|
+
};
|
|
919
|
+
readonly additionalProperties: false;
|
|
920
|
+
readonly default: {
|
|
921
|
+
readonly hide: false;
|
|
922
|
+
};
|
|
923
|
+
};
|
|
924
|
+
readonly collapse: {
|
|
925
|
+
readonly type: "object";
|
|
926
|
+
readonly properties: {
|
|
927
|
+
readonly hide: {
|
|
928
|
+
readonly type: "boolean";
|
|
922
929
|
};
|
|
923
930
|
};
|
|
924
931
|
readonly additionalProperties: false;
|
|
925
932
|
readonly default: {
|
|
926
|
-
readonly hide:
|
|
933
|
+
readonly hide: false;
|
|
927
934
|
};
|
|
928
935
|
};
|
|
929
936
|
};
|
package/lib/config.js
CHANGED
|
@@ -369,18 +369,31 @@ exports.themeConfigSchema = {
|
|
|
369
369
|
codeSnippet: {
|
|
370
370
|
type: 'object',
|
|
371
371
|
properties: {
|
|
372
|
+
controlsStyle: { type: 'string', default: 'icon' },
|
|
372
373
|
copy: {
|
|
373
374
|
type: 'object',
|
|
374
|
-
properties: Object.assign({
|
|
375
|
+
properties: Object.assign({}, hideConfigSchema.properties),
|
|
375
376
|
additionalProperties: false,
|
|
376
|
-
default: {},
|
|
377
|
+
default: { hide: false },
|
|
377
378
|
},
|
|
378
379
|
report: {
|
|
379
380
|
type: 'object',
|
|
380
|
-
properties: Object.assign({
|
|
381
|
+
properties: Object.assign({}, hideConfigSchema.properties),
|
|
381
382
|
additionalProperties: false,
|
|
382
383
|
default: { hide: true },
|
|
383
384
|
},
|
|
385
|
+
expand: {
|
|
386
|
+
type: 'object',
|
|
387
|
+
properties: Object.assign({}, hideConfigSchema.properties),
|
|
388
|
+
additionalProperties: false,
|
|
389
|
+
default: { hide: false },
|
|
390
|
+
},
|
|
391
|
+
collapse: {
|
|
392
|
+
type: 'object',
|
|
393
|
+
properties: Object.assign({}, hideConfigSchema.properties),
|
|
394
|
+
additionalProperties: false,
|
|
395
|
+
default: { hide: false },
|
|
396
|
+
},
|
|
384
397
|
},
|
|
385
398
|
additionalProperties: false,
|
|
386
399
|
default: {},
|