docusaurus-theme-openapi-docs 2.1.3 → 3.0.0-beta.10
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/markdown/utils.d.ts +2 -1
- package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.d.ts +13 -0
- package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +199 -124
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +25 -19
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +27 -16
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +116 -97
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +115 -54
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +41 -30
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +201 -121
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +36 -24
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +35 -28
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +72 -14
- package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +4 -2
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +122 -76
- package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +3 -1
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +4 -4
- package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +2 -1
- package/lib/theme/ApiExplorer/Request/_Request.scss +4 -6
- package/lib/theme/ApiExplorer/Response/_Response.scss +4 -2
- package/lib/theme/ApiExplorer/Response/index.js +19 -19
- package/lib/theme/ApiExplorer/index.js +0 -4
- package/lib/theme/ApiItem/Layout/index.js +3 -0
- package/lib/theme/ApiItem/index.js +6 -5
- package/lib/theme/ApiLogo/index.d.ts +2 -2
- package/lib/theme/ApiTabs/_ApiTabs.scss +3 -1
- package/lib/theme/ApiTabs/index.d.ts +7 -0
- package/lib/theme/ApiTabs/index.js +152 -98
- package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
- package/lib/theme/DiscriminatorTabs/index.js +146 -94
- package/lib/theme/MimeTabs/index.d.ts +6 -0
- package/lib/theme/MimeTabs/index.js +163 -114
- package/lib/theme/OperationTabs/_OperationTabs.scss +4 -1
- package/lib/theme/OperationTabs/index.d.ts +3 -0
- package/lib/theme/OperationTabs/index.js +148 -103
- package/lib/theme/ParamsItem/index.d.ts +23 -0
- package/lib/theme/ParamsItem/index.js +168 -123
- package/lib/theme/ResponseSamples/index.d.ts +8 -0
- package/lib/theme/ResponseSamples/index.js +18 -13
- package/lib/theme/SchemaItem/index.d.ts +12 -0
- package/lib/theme/SchemaItem/index.js +123 -88
- package/lib/theme/SchemaTabs/_SchemaTabs.scss +0 -4
- package/lib/theme/SchemaTabs/index.d.ts +3 -0
- package/lib/theme/SchemaTabs/index.js +142 -91
- package/lib/theme/styles.scss +4 -0
- package/package.json +8 -7
- package/src/markdown/utils.ts +4 -2
- package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/{index.js → index.tsx} +21 -8
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/{index.js → index.tsx} +6 -3
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/{Element.js → Element.tsx} +5 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/{String.js → String.tsx} +5 -5
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/{index.js → index.tsx} +8 -3
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/{index.js → index.tsx} +9 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/{index.js → index.tsx} +13 -3
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/{index.js → index.tsx} +2 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/{index.js → index.tsx} +11 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/{index.js → index.tsx} +10 -5
- package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +4 -2
- package/src/theme/ApiExplorer/CodeTabs/{index.js → index.tsx} +56 -26
- package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +3 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +4 -4
- package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +2 -1
- package/src/theme/ApiExplorer/Request/_Request.scss +4 -6
- package/src/theme/ApiExplorer/Response/_Response.scss +4 -2
- package/src/theme/ApiExplorer/Response/index.tsx +2 -2
- package/src/theme/ApiExplorer/index.tsx +0 -3
- package/src/theme/ApiItem/Layout/index.tsx +3 -0
- package/src/theme/ApiItem/index.tsx +3 -4
- package/src/theme/ApiLogo/index.tsx +1 -1
- package/src/theme/ApiTabs/_ApiTabs.scss +3 -1
- package/src/theme/ApiTabs/{index.js → index.tsx} +60 -26
- package/src/theme/DiscriminatorTabs/{index.js → index.tsx} +57 -24
- package/src/theme/MimeTabs/{index.js → index.tsx} +58 -26
- package/src/theme/OperationTabs/_OperationTabs.scss +4 -1
- package/src/theme/OperationTabs/{index.js → index.tsx} +54 -25
- package/src/theme/ParamsItem/{index.js → index.tsx} +31 -14
- package/src/theme/ResponseSamples/{index.js → index.tsx} +10 -1
- package/src/theme/SchemaItem/{index.js → index.tsx} +18 -9
- package/src/theme/SchemaTabs/_SchemaTabs.scss +0 -4
- package/src/theme/SchemaTabs/{index.js → index.tsx} +56 -25
- package/src/theme/styles.scss +4 -0
- package/src/theme-classic.d.ts +69 -2
- package/src/theme-openapi.d.ts +2 -0
- package/tsconfig.json +4 -1
package/lib/markdown/utils.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type Language } from "prism-react-renderer";
|
|
3
|
+
interface Props {
|
|
4
|
+
code: string;
|
|
5
|
+
className: string;
|
|
6
|
+
language: Language;
|
|
7
|
+
showLineNumbers: boolean;
|
|
8
|
+
blockClassName: string;
|
|
9
|
+
title: string;
|
|
10
|
+
lineClassNames: string[];
|
|
11
|
+
}
|
|
12
|
+
export default function ExpandButton({ code, className, language, showLineNumbers, blockClassName, title, lineClassNames, }: Props): React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1,23 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* ============================================================================
|
|
2
3
|
* Copyright (c) Palo Alto Networks
|
|
3
4
|
*
|
|
4
5
|
* This source code is licensed under the MIT license found in the
|
|
5
6
|
* LICENSE file in the root directory of this source tree.
|
|
6
7
|
* ========================================================================== */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
var __createBinding =
|
|
9
|
+
(this && this.__createBinding) ||
|
|
10
|
+
(Object.create
|
|
11
|
+
? function (o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (
|
|
15
|
+
!desc ||
|
|
16
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
17
|
+
) {
|
|
18
|
+
desc = {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return m[k];
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(o, k2, desc);
|
|
26
|
+
}
|
|
27
|
+
: function (o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
});
|
|
31
|
+
var __setModuleDefault =
|
|
32
|
+
(this && this.__setModuleDefault) ||
|
|
33
|
+
(Object.create
|
|
34
|
+
? function (o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}
|
|
37
|
+
: function (o, v) {
|
|
38
|
+
o["default"] = v;
|
|
39
|
+
});
|
|
40
|
+
var __importStar =
|
|
41
|
+
(this && this.__importStar) ||
|
|
42
|
+
function (mod) {
|
|
43
|
+
if (mod && mod.__esModule) return mod;
|
|
44
|
+
var result = {};
|
|
45
|
+
if (mod != null)
|
|
46
|
+
for (var k in mod)
|
|
47
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
48
|
+
__createBinding(result, mod, k);
|
|
49
|
+
__setModuleDefault(result, mod);
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
52
|
+
var __importDefault =
|
|
53
|
+
(this && this.__importDefault) ||
|
|
54
|
+
function (mod) {
|
|
55
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
const react_1 = __importStar(require("react"));
|
|
59
|
+
const theme_common_1 = require("@docusaurus/theme-common");
|
|
60
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
const Container_1 = __importDefault(
|
|
63
|
+
require("@theme/ApiExplorer/ApiCodeBlock/Container")
|
|
64
|
+
);
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
const CopyButton_1 = __importDefault(
|
|
67
|
+
require("@theme/ApiExplorer/ApiCodeBlock/CopyButton")
|
|
68
|
+
);
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
const ExitButton_1 = __importDefault(
|
|
71
|
+
require("@theme/ApiExplorer/ApiCodeBlock/ExitButton")
|
|
72
|
+
);
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
const Line_1 = __importDefault(require("@theme/ApiExplorer/ApiCodeBlock/Line"));
|
|
75
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
76
|
+
const prism_react_renderer_1 = require("prism-react-renderer");
|
|
77
|
+
const react_modal_1 = __importDefault(require("react-modal"));
|
|
78
|
+
function ExpandButton({
|
|
21
79
|
code,
|
|
22
80
|
className,
|
|
23
81
|
language,
|
|
@@ -26,140 +84,157 @@ export default function ExpandButton({
|
|
|
26
84
|
title,
|
|
27
85
|
lineClassNames,
|
|
28
86
|
}) {
|
|
29
|
-
const prismTheme = usePrismTheme();
|
|
30
|
-
|
|
87
|
+
const prismTheme = (0, theme_common_1.usePrismTheme)();
|
|
31
88
|
function openModal() {
|
|
32
89
|
setIsOpen(true);
|
|
33
90
|
}
|
|
34
|
-
|
|
35
91
|
function closeModal() {
|
|
36
92
|
setIsOpen(false);
|
|
37
93
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
Modal.setAppElement("body");
|
|
94
|
+
const [modalIsOpen, setIsOpen] = react_1.default.useState(false);
|
|
95
|
+
(0, react_1.useEffect)(() => {
|
|
96
|
+
react_modal_1.default.setAppElement("body");
|
|
43
97
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
title
|
|
98
|
+
return react_1.default.createElement(
|
|
99
|
+
react_1.default.Fragment,
|
|
100
|
+
null,
|
|
101
|
+
react_1.default.createElement(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
type: "button",
|
|
105
|
+
"aria-label": modalIsOpen
|
|
106
|
+
? (0, Translate_1.translate)({
|
|
107
|
+
id: "theme.CodeBlock.expanded",
|
|
108
|
+
message: "Expanded",
|
|
109
|
+
description: "The expanded button label on code blocks",
|
|
110
|
+
})
|
|
111
|
+
: (0, Translate_1.translate)({
|
|
112
|
+
id: "theme.CodeBlock.expandButtonAriaLabel",
|
|
113
|
+
message: "Expand code to fullscreen",
|
|
114
|
+
description: "The ARIA label for expand code blocks button",
|
|
115
|
+
}),
|
|
116
|
+
title: (0, Translate_1.translate)({
|
|
63
117
|
id: "theme.CodeBlock.expand",
|
|
64
118
|
message: "Expand",
|
|
65
119
|
description: "The expand button label on code blocks",
|
|
66
|
-
})
|
|
67
|
-
className
|
|
120
|
+
}),
|
|
121
|
+
className: (0, clsx_1.default)(
|
|
68
122
|
"clean-btn",
|
|
69
123
|
className,
|
|
70
124
|
"openapi-explorer__code-block-expand-btn",
|
|
71
125
|
modalIsOpen && "openapi-explorer__code-block-expand-btn--copied"
|
|
72
|
-
)
|
|
73
|
-
onClick
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
),
|
|
127
|
+
onClick: openModal,
|
|
128
|
+
},
|
|
129
|
+
react_1.default.createElement(
|
|
130
|
+
"span",
|
|
131
|
+
{
|
|
132
|
+
className: "openapi-explorer__code-block-expand-btn-icons",
|
|
133
|
+
"aria-hidden": "true",
|
|
134
|
+
},
|
|
135
|
+
react_1.default.createElement(
|
|
136
|
+
"svg",
|
|
137
|
+
{
|
|
138
|
+
className: "openapi-explorer__code-block-expand-btn-icon",
|
|
139
|
+
viewBox: "0 0 448 512",
|
|
140
|
+
},
|
|
141
|
+
react_1.default.createElement("path", {
|
|
142
|
+
d: "M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z",
|
|
143
|
+
})
|
|
144
|
+
),
|
|
145
|
+
react_1.default.createElement(
|
|
146
|
+
"svg",
|
|
147
|
+
{
|
|
148
|
+
className: "openapi-explorer__code-block-expand-btn-icon--success",
|
|
149
|
+
viewBox: "0 0 24 24",
|
|
150
|
+
},
|
|
151
|
+
react_1.default.createElement("path", {
|
|
152
|
+
d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",
|
|
153
|
+
})
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
),
|
|
157
|
+
react_1.default.createElement(
|
|
158
|
+
react_modal_1.default,
|
|
159
|
+
{
|
|
160
|
+
className: "openapi-explorer__expand-modal-content",
|
|
161
|
+
overlayClassName: "openapi-explorer__expand-modal-overlay",
|
|
162
|
+
isOpen: modalIsOpen,
|
|
163
|
+
onRequestClose: closeModal,
|
|
164
|
+
contentLabel: "Code Snippet",
|
|
165
|
+
},
|
|
166
|
+
react_1.default.createElement(
|
|
167
|
+
Container_1.default,
|
|
168
|
+
{
|
|
169
|
+
as: "div",
|
|
170
|
+
className: (0, clsx_1.default)(
|
|
103
171
|
"openapi-explorer__code-block-container",
|
|
104
172
|
language &&
|
|
105
173
|
!blockClassName.includes(`language-${language}`) &&
|
|
106
174
|
`language-${language}`
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
175
|
+
),
|
|
176
|
+
},
|
|
177
|
+
title &&
|
|
178
|
+
react_1.default.createElement(
|
|
179
|
+
"div",
|
|
180
|
+
{ className: "openapi-explorer__code-block-title" },
|
|
181
|
+
title
|
|
182
|
+
),
|
|
183
|
+
react_1.default.createElement(
|
|
184
|
+
"div",
|
|
185
|
+
{ className: "openapi-explorer__code-block-content" },
|
|
186
|
+
react_1.default.createElement(
|
|
187
|
+
prism_react_renderer_1.Highlight,
|
|
188
|
+
{ theme: prismTheme, code: code, language: language ?? "text" },
|
|
189
|
+
({ className, tokens, getLineProps, getTokenProps }) =>
|
|
190
|
+
react_1.default.createElement(
|
|
191
|
+
"pre",
|
|
192
|
+
{
|
|
121
193
|
/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */
|
|
122
|
-
tabIndex
|
|
123
|
-
className
|
|
194
|
+
tabIndex: 0,
|
|
195
|
+
className: (0, clsx_1.default)(
|
|
124
196
|
className,
|
|
125
197
|
"openapi-explorer__code-block",
|
|
126
198
|
"thin-scrollbar"
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
199
|
+
),
|
|
200
|
+
},
|
|
201
|
+
react_1.default.createElement(
|
|
202
|
+
"code",
|
|
203
|
+
{
|
|
204
|
+
className: (0, clsx_1.default)(
|
|
131
205
|
"openapi-explorer__code-block-lines",
|
|
132
206
|
showLineNumbers &&
|
|
133
207
|
"openapi-explorer__code-block-lines-numbers"
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
208
|
+
),
|
|
209
|
+
},
|
|
210
|
+
tokens.map((line, i) =>
|
|
211
|
+
react_1.default.createElement(Line_1.default, {
|
|
212
|
+
key: i,
|
|
213
|
+
line: line,
|
|
214
|
+
getLineProps: getLineProps,
|
|
215
|
+
getTokenProps: getTokenProps,
|
|
216
|
+
classNames: lineClassNames,
|
|
217
|
+
showLineNumbers: showLineNumbers,
|
|
218
|
+
})
|
|
219
|
+
)
|
|
220
|
+
)
|
|
221
|
+
)
|
|
222
|
+
),
|
|
223
|
+
react_1.default.createElement(
|
|
224
|
+
"div",
|
|
225
|
+
{ className: "openapi-explorer__code-block-btn-group" },
|
|
226
|
+
react_1.default.createElement(CopyButton_1.default, {
|
|
227
|
+
className: "openapi-explorer__code-block-code-btn",
|
|
228
|
+
code: code,
|
|
229
|
+
}),
|
|
230
|
+
react_1.default.createElement(ExitButton_1.default, {
|
|
231
|
+
className: "openapi-dmeo__code-block-code-btn",
|
|
232
|
+
handler: closeModal,
|
|
233
|
+
})
|
|
234
|
+
)
|
|
235
|
+
)
|
|
236
|
+
)
|
|
237
|
+
)
|
|
164
238
|
);
|
|
165
239
|
}
|
|
240
|
+
exports.default = ExpandButton;
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* ============================================================================
|
|
2
3
|
* Copyright (c) Palo Alto Networks
|
|
3
4
|
*
|
|
4
5
|
* This source code is licensed under the MIT license found in the
|
|
5
6
|
* LICENSE file in the root directory of this source tree.
|
|
6
7
|
* ========================================================================== */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
var __importDefault =
|
|
9
|
+
(this && this.__importDefault) ||
|
|
10
|
+
function (mod) {
|
|
11
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
15
|
+
const theme_common_1 = require("@docusaurus/theme-common");
|
|
16
|
+
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
17
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
18
|
+
function CodeBlockContainer({ as: As, ...props }) {
|
|
19
|
+
const prismTheme = (0, theme_common_1.usePrismTheme)();
|
|
20
|
+
const prismCssVariables = (0, internal_1.getPrismCssVariables)(prismTheme);
|
|
21
|
+
return react_1.default.createElement(
|
|
22
|
+
As,
|
|
23
|
+
// Polymorphic components are hard to type, without `oneOf` generics
|
|
24
|
+
{
|
|
25
|
+
...props,
|
|
26
|
+
style: prismCssVariables,
|
|
27
|
+
className: (0, clsx_1.default)(
|
|
23
28
|
"openapi-explorer__code-block-container",
|
|
24
29
|
props.className,
|
|
25
|
-
ThemeClassNames.common.codeBlock
|
|
26
|
-
)
|
|
27
|
-
|
|
30
|
+
theme_common_1.ThemeClassNames.common.codeBlock
|
|
31
|
+
),
|
|
32
|
+
}
|
|
28
33
|
);
|
|
29
34
|
}
|
|
35
|
+
exports.default = CodeBlockContainer;
|
|
@@ -1,30 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* ============================================================================
|
|
2
3
|
* Copyright (c) Palo Alto Networks
|
|
3
4
|
*
|
|
4
5
|
* This source code is licensed under the MIT license found in the
|
|
5
6
|
* LICENSE file in the root directory of this source tree.
|
|
6
7
|
* ========================================================================== */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
var __importDefault =
|
|
9
|
+
(this && this.__importDefault) ||
|
|
10
|
+
function (mod) {
|
|
11
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
15
|
+
const Container_1 = __importDefault(
|
|
16
|
+
require("@theme/ApiExplorer/ApiCodeBlock/Container")
|
|
17
|
+
);
|
|
18
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
13
19
|
// <pre> tags in markdown map to CodeBlocks. They may contain JSX children. When
|
|
14
20
|
// the children is not a simple string, we just return a styled block without
|
|
15
21
|
// actually highlighting.
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
function CodeBlockJSX({ children, className }) {
|
|
23
|
+
return react_1.default.createElement(
|
|
24
|
+
Container_1.default,
|
|
25
|
+
{
|
|
26
|
+
as: "pre",
|
|
27
|
+
tabIndex: 0,
|
|
28
|
+
className: (0, clsx_1.default)(
|
|
22
29
|
"openapi-explorer__code-block-standalone",
|
|
23
30
|
"thin-scrollbar",
|
|
24
31
|
className
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
),
|
|
33
|
+
},
|
|
34
|
+
react_1.default.createElement(
|
|
35
|
+
"code",
|
|
36
|
+
{ className: "openapi-explorer__code-block-lines" },
|
|
37
|
+
children
|
|
38
|
+
)
|
|
29
39
|
);
|
|
30
40
|
}
|
|
41
|
+
exports.default = CodeBlockJSX;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="@docusaurus/theme-classic" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { Props } from "@theme/CodeBlock/Content/String";
|
|
4
|
+
export default function CodeBlockString({ children, className: blockClassName, metastring, title: titleProp, showLineNumbers: showLineNumbersProp, language: languageProp, }: Props): React.JSX.Element;
|