docusaurus-theme-openapi-docs 0.0.0-beta.621 → 0.0.0-beta.627
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/theme/ApiDemoPanel/CodeTabs/_CodeTabs.scss +22 -0
- package/lib/theme/ApiDemoPanel/Curl/index.js +10 -1
- package/lib/theme/ApiDemoPanel/Response/index.js +3 -29
- package/lib/theme/styles.scss +5 -0
- package/lib-next/theme/ApiDemoPanel/CodeTabs/_CodeTabs.scss +22 -0
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +11 -0
- package/lib-next/theme/ApiDemoPanel/Response/index.js +5 -45
- package/lib-next/theme/styles.scss +5 -0
- package/package.json +4 -4
- package/src/theme/ApiDemoPanel/CodeTabs/_CodeTabs.scss +22 -0
- package/src/theme/ApiDemoPanel/Curl/index.tsx +11 -0
- package/src/theme/ApiDemoPanel/Response/index.tsx +5 -42
- package/src/theme/styles.scss +5 -0
|
@@ -209,6 +209,28 @@
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
.language-powershell {
|
|
213
|
+
max-height: 500px;
|
|
214
|
+
overflow: auto;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.openapi-tabs__code-item--powershell {
|
|
218
|
+
color: var(--ifm-color-info);
|
|
219
|
+
|
|
220
|
+
&::after {
|
|
221
|
+
content: "";
|
|
222
|
+
width: 28px;
|
|
223
|
+
height: 28px;
|
|
224
|
+
background: url("https://raw.githubusercontent.com/devicons/devicon/master/icons/windows8/windows8-original.svg");
|
|
225
|
+
margin-block: auto;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&.active {
|
|
229
|
+
border-bottom-color: var(--ifm-color-success);
|
|
230
|
+
background-color: var(--ifm-color-emphasis-100);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
212
234
|
@media only screen and (min-width: 768px) and (max-width: 996px) {
|
|
213
235
|
.openapi-tabs__code-list {
|
|
214
236
|
justify-content: space-around;
|
|
@@ -96,6 +96,15 @@ const languageSet = [{
|
|
|
96
96
|
trimRequestBody: true
|
|
97
97
|
},
|
|
98
98
|
variant: "OkHttp"
|
|
99
|
+
}, {
|
|
100
|
+
highlight: "powershell",
|
|
101
|
+
language: "powershell",
|
|
102
|
+
logoClass: "powershell",
|
|
103
|
+
options: {
|
|
104
|
+
followRedirect: true,
|
|
105
|
+
trimRequestBody: true
|
|
106
|
+
},
|
|
107
|
+
variant: "RestMethod"
|
|
99
108
|
}];
|
|
100
109
|
exports.languageSet = languageSet;
|
|
101
110
|
function CodeTab({
|
|
@@ -217,7 +226,7 @@ function Curl({
|
|
|
217
226
|
return <CodeTab value={lang.language} label={""} key={lang.variant ? `${lang.language}-${lang.variant}` : lang.language} attributes={{
|
|
218
227
|
className: `openapi-tabs__code-item--${lang.logoClass}`
|
|
219
228
|
}}>
|
|
220
|
-
<_CodeBlock.default language={lang.highlight} className="openapi-demo__code-block">
|
|
229
|
+
<_CodeBlock.default language={lang.highlight} className="openapi-demo__code-block" title={`${lang.language} / ${lang.variant}`}>
|
|
221
230
|
{codeText}
|
|
222
231
|
</_CodeBlock.default>
|
|
223
232
|
</CodeTab>;
|
|
@@ -8,9 +8,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _themeCommon = require("@docusaurus/theme-common");
|
|
9
9
|
var _hooks = require("@theme/ApiItem/hooks");
|
|
10
10
|
var _CodeBlock = _interopRequireDefault(require("@theme/CodeBlock"));
|
|
11
|
-
var _SchemaTabs = _interopRequireDefault(require("@theme/SchemaTabs"));
|
|
12
|
-
var _TabItem = _interopRequireDefault(require("@theme/TabItem"));
|
|
13
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
11
|
var _slice = require("./slice");
|
|
15
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
13
|
/* ============================================================================
|
|
@@ -69,32 +66,9 @@ function Response() {
|
|
|
69
66
|
</button>
|
|
70
67
|
</div>
|
|
71
68
|
</summary>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
paddingLeft: "1rem",
|
|
76
|
-
paddingTop: "1rem",
|
|
77
|
-
...((prettyResponse === "Fetching..." || !code) && {
|
|
78
|
-
paddingBottom: "1rem"
|
|
79
|
-
})
|
|
80
|
-
}}>
|
|
81
|
-
{code && prettyResponse !== "Fetching..." ? <_SchemaTabs.default lazy>
|
|
82
|
-
{/* @ts-ignore */}
|
|
83
|
-
<_TabItem.default label={` ${code}`} value="body" attributes={{
|
|
84
|
-
className: (0, _clsx.default)("openapi-response__dot", responseStatusClass)
|
|
85
|
-
}} default>
|
|
86
|
-
<_CodeBlock.default className="openapi-response__status-code" language={response.startsWith("<") ? `xml` : `json`}>
|
|
87
|
-
{prettyResponse || "No Response"}
|
|
88
|
-
</_CodeBlock.default>
|
|
89
|
-
</_TabItem.default>
|
|
90
|
-
{/* @ts-ignore */}
|
|
91
|
-
<_TabItem.default label="Headers" value="headers">
|
|
92
|
-
<_CodeBlock.default className="openapi-response__status-headers" language={response.startsWith("<") ? `xml` : `json`}>
|
|
93
|
-
{JSON.stringify(headers, undefined, 2)}
|
|
94
|
-
</_CodeBlock.default>
|
|
95
|
-
</_TabItem.default>
|
|
96
|
-
</_SchemaTabs.default> : prettyResponse || "No Response"}
|
|
97
|
-
</div>
|
|
69
|
+
<_CodeBlock.default language={response.startsWith("<") ? `xml` : `json`} className="openapi-demo__code-block">
|
|
70
|
+
{prettyResponse || "No Response"}
|
|
71
|
+
</_CodeBlock.default>
|
|
98
72
|
</details>;
|
|
99
73
|
}
|
|
100
74
|
var _default = Response;
|
package/lib/theme/styles.scss
CHANGED
|
@@ -209,6 +209,28 @@
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
.language-powershell {
|
|
213
|
+
max-height: 500px;
|
|
214
|
+
overflow: auto;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.openapi-tabs__code-item--powershell {
|
|
218
|
+
color: var(--ifm-color-info);
|
|
219
|
+
|
|
220
|
+
&::after {
|
|
221
|
+
content: "";
|
|
222
|
+
width: 28px;
|
|
223
|
+
height: 28px;
|
|
224
|
+
background: url("https://raw.githubusercontent.com/devicons/devicon/master/icons/windows8/windows8-original.svg");
|
|
225
|
+
margin-block: auto;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&.active {
|
|
229
|
+
border-bottom-color: var(--ifm-color-success);
|
|
230
|
+
background-color: var(--ifm-color-emphasis-100);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
212
234
|
@media only screen and (min-width: 768px) and (max-width: 996px) {
|
|
213
235
|
.openapi-tabs__code-list {
|
|
214
236
|
justify-content: space-around;
|
|
@@ -96,6 +96,16 @@ export const languageSet = [
|
|
|
96
96
|
},
|
|
97
97
|
variant: "OkHttp",
|
|
98
98
|
},
|
|
99
|
+
{
|
|
100
|
+
highlight: "powershell",
|
|
101
|
+
language: "powershell",
|
|
102
|
+
logoClass: "powershell",
|
|
103
|
+
options: {
|
|
104
|
+
followRedirect: true,
|
|
105
|
+
trimRequestBody: true,
|
|
106
|
+
},
|
|
107
|
+
variant: "RestMethod",
|
|
108
|
+
},
|
|
99
109
|
];
|
|
100
110
|
function CodeTab({ children, hidden, className, onClick }) {
|
|
101
111
|
return (
|
|
@@ -257,6 +267,7 @@ function Curl({ postman, codeSamples }) {
|
|
|
257
267
|
<CodeBlock
|
|
258
268
|
language={lang.highlight}
|
|
259
269
|
className="openapi-demo__code-block"
|
|
270
|
+
title={`${lang.language} / ${lang.variant}`}
|
|
260
271
|
>
|
|
261
272
|
{codeText}
|
|
262
273
|
</CodeBlock>
|
|
@@ -9,9 +9,6 @@ import React from "react";
|
|
|
9
9
|
import { usePrismTheme } from "@docusaurus/theme-common";
|
|
10
10
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
11
11
|
import CodeBlock from "@theme/CodeBlock";
|
|
12
|
-
import SchemaTabs from "@theme/SchemaTabs";
|
|
13
|
-
import TabItem from "@theme/TabItem";
|
|
14
|
-
import clsx from "clsx";
|
|
15
12
|
import { clearResponse, clearCode, clearHeaders } from "./slice";
|
|
16
13
|
|
|
17
14
|
// TODO: We probably shouldn't attempt to format XML...
|
|
@@ -74,49 +71,12 @@ function Response() {
|
|
|
74
71
|
</button>
|
|
75
72
|
</div>
|
|
76
73
|
</summary>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
backgroundColor: prismTheme.plain.backgroundColor,
|
|
81
|
-
paddingLeft: "1rem",
|
|
82
|
-
paddingTop: "1rem",
|
|
83
|
-
...((prettyResponse === "Fetching..." || !code) && {
|
|
84
|
-
paddingBottom: "1rem",
|
|
85
|
-
}),
|
|
86
|
-
}}
|
|
74
|
+
<CodeBlock
|
|
75
|
+
language={response.startsWith("<") ? `xml` : `json`}
|
|
76
|
+
className="openapi-demo__code-block"
|
|
87
77
|
>
|
|
88
|
-
{
|
|
89
|
-
|
|
90
|
-
{/* @ts-ignore */}
|
|
91
|
-
<TabItem
|
|
92
|
-
label={` ${code}`}
|
|
93
|
-
value="body"
|
|
94
|
-
attributes={{
|
|
95
|
-
className: clsx("openapi-response__dot", responseStatusClass),
|
|
96
|
-
}}
|
|
97
|
-
default
|
|
98
|
-
>
|
|
99
|
-
<CodeBlock
|
|
100
|
-
className="openapi-response__status-code"
|
|
101
|
-
language={response.startsWith("<") ? `xml` : `json`}
|
|
102
|
-
>
|
|
103
|
-
{prettyResponse || "No Response"}
|
|
104
|
-
</CodeBlock>
|
|
105
|
-
</TabItem>
|
|
106
|
-
{/* @ts-ignore */}
|
|
107
|
-
<TabItem label="Headers" value="headers">
|
|
108
|
-
<CodeBlock
|
|
109
|
-
className="openapi-response__status-headers"
|
|
110
|
-
language={response.startsWith("<") ? `xml` : `json`}
|
|
111
|
-
>
|
|
112
|
-
{JSON.stringify(headers, undefined, 2)}
|
|
113
|
-
</CodeBlock>
|
|
114
|
-
</TabItem>
|
|
115
|
-
</SchemaTabs>
|
|
116
|
-
) : (
|
|
117
|
-
prettyResponse || "No Response"
|
|
118
|
-
)}
|
|
119
|
-
</div>
|
|
78
|
+
{prettyResponse || "No Response"}
|
|
79
|
+
</CodeBlock>
|
|
120
80
|
</details>
|
|
121
81
|
);
|
|
122
82
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-theme-openapi-docs",
|
|
3
3
|
"description": "OpenAPI theme for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-beta.
|
|
4
|
+
"version": "0.0.0-beta.627",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@docusaurus/theme-common": "^2.3.0",
|
|
47
47
|
"@mdx-js/react": "^1.6.21",
|
|
48
|
-
"@paloaltonetworks/postman-code-generators": "
|
|
48
|
+
"@paloaltonetworks/postman-code-generators": "1.1.15-patch.2",
|
|
49
49
|
"@paloaltonetworks/postman-collection": "^4.1.0",
|
|
50
50
|
"@reduxjs/toolkit": "^1.7.1",
|
|
51
51
|
"buffer": "^6.0.3",
|
|
52
52
|
"clsx": "^1.1.1",
|
|
53
53
|
"crypto-js": "^4.1.1",
|
|
54
|
-
"docusaurus-plugin-openapi-docs": "0.0.0-beta.
|
|
54
|
+
"docusaurus-plugin-openapi-docs": "0.0.0-beta.627",
|
|
55
55
|
"docusaurus-plugin-sass": "^0.2.3",
|
|
56
56
|
"file-saver": "^2.0.5",
|
|
57
57
|
"immer": "^9.0.7",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"engines": {
|
|
77
77
|
"node": ">=14"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "28b5c12af12e5327c0b8b024b565c7b707b8eb83"
|
|
80
80
|
}
|
|
@@ -209,6 +209,28 @@
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
.language-powershell {
|
|
213
|
+
max-height: 500px;
|
|
214
|
+
overflow: auto;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.openapi-tabs__code-item--powershell {
|
|
218
|
+
color: var(--ifm-color-info);
|
|
219
|
+
|
|
220
|
+
&::after {
|
|
221
|
+
content: "";
|
|
222
|
+
width: 28px;
|
|
223
|
+
height: 28px;
|
|
224
|
+
background: url("https://raw.githubusercontent.com/devicons/devicon/master/icons/windows8/windows8-original.svg");
|
|
225
|
+
margin-block: auto;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&.active {
|
|
229
|
+
border-bottom-color: var(--ifm-color-success);
|
|
230
|
+
background-color: var(--ifm-color-emphasis-100);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
212
234
|
@media only screen and (min-width: 768px) and (max-width: 996px) {
|
|
213
235
|
.openapi-tabs__code-list {
|
|
214
236
|
justify-content: space-around;
|
|
@@ -108,6 +108,16 @@ export const languageSet: Language[] = [
|
|
|
108
108
|
},
|
|
109
109
|
variant: "OkHttp",
|
|
110
110
|
},
|
|
111
|
+
{
|
|
112
|
+
highlight: "powershell",
|
|
113
|
+
language: "powershell",
|
|
114
|
+
logoClass: "powershell",
|
|
115
|
+
options: {
|
|
116
|
+
followRedirect: true,
|
|
117
|
+
trimRequestBody: true,
|
|
118
|
+
},
|
|
119
|
+
variant: "RestMethod",
|
|
120
|
+
},
|
|
111
121
|
];
|
|
112
122
|
|
|
113
123
|
export interface Props {
|
|
@@ -278,6 +288,7 @@ function Curl({ postman, codeSamples }: Props) {
|
|
|
278
288
|
<CodeBlock
|
|
279
289
|
language={lang.highlight}
|
|
280
290
|
className="openapi-demo__code-block"
|
|
291
|
+
title={`${lang.language} / ${lang.variant}`}
|
|
281
292
|
>
|
|
282
293
|
{codeText}
|
|
283
294
|
</CodeBlock>
|
|
@@ -81,49 +81,12 @@ function Response() {
|
|
|
81
81
|
</button>
|
|
82
82
|
</div>
|
|
83
83
|
</summary>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
backgroundColor: prismTheme.plain.backgroundColor,
|
|
88
|
-
paddingLeft: "1rem",
|
|
89
|
-
paddingTop: "1rem",
|
|
90
|
-
...((prettyResponse === "Fetching..." || !code) && {
|
|
91
|
-
paddingBottom: "1rem",
|
|
92
|
-
}),
|
|
93
|
-
}}
|
|
84
|
+
<CodeBlock
|
|
85
|
+
language={response.startsWith("<") ? `xml` : `json`}
|
|
86
|
+
className="openapi-demo__code-block"
|
|
94
87
|
>
|
|
95
|
-
{
|
|
96
|
-
|
|
97
|
-
{/* @ts-ignore */}
|
|
98
|
-
<TabItem
|
|
99
|
-
label={` ${code}`}
|
|
100
|
-
value="body"
|
|
101
|
-
attributes={{
|
|
102
|
-
className: clsx("openapi-response__dot", responseStatusClass),
|
|
103
|
-
}}
|
|
104
|
-
default
|
|
105
|
-
>
|
|
106
|
-
<CodeBlock
|
|
107
|
-
className="openapi-response__status-code"
|
|
108
|
-
language={response.startsWith("<") ? `xml` : `json`}
|
|
109
|
-
>
|
|
110
|
-
{prettyResponse || "No Response"}
|
|
111
|
-
</CodeBlock>
|
|
112
|
-
</TabItem>
|
|
113
|
-
{/* @ts-ignore */}
|
|
114
|
-
<TabItem label="Headers" value="headers">
|
|
115
|
-
<CodeBlock
|
|
116
|
-
className="openapi-response__status-headers"
|
|
117
|
-
language={response.startsWith("<") ? `xml` : `json`}
|
|
118
|
-
>
|
|
119
|
-
{JSON.stringify(headers, undefined, 2)}
|
|
120
|
-
</CodeBlock>
|
|
121
|
-
</TabItem>
|
|
122
|
-
</SchemaTabs>
|
|
123
|
-
) : (
|
|
124
|
-
prettyResponse || "No Response"
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
88
|
+
{prettyResponse || "No Response"}
|
|
89
|
+
</CodeBlock>
|
|
127
90
|
</details>
|
|
128
91
|
);
|
|
129
92
|
}
|