docusaurus-theme-openapi-docs 1.2.1 → 1.2.2
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/FloatingButton/styles.module.css +2 -3
- package/lib/theme/ApiDemoPanel/Request/index.js +3 -0
- package/lib/theme/ApiDemoPanel/Request/styles.module.css +1 -0
- package/lib/theme/ApiDemoPanel/Server/index.js +30 -29
- package/lib/theme/ApiDemoPanel/Server/styles.module.css +0 -1
- package/lib/theme/ApiDemoPanel/index.js +0 -3
- package/lib-next/theme/ApiDemoPanel/FloatingButton/styles.module.css +2 -3
- package/lib-next/theme/ApiDemoPanel/Request/index.js +2 -0
- package/lib-next/theme/ApiDemoPanel/Request/styles.module.css +1 -0
- package/lib-next/theme/ApiDemoPanel/Server/index.js +43 -45
- package/lib-next/theme/ApiDemoPanel/Server/styles.module.css +0 -1
- package/lib-next/theme/ApiDemoPanel/index.js +0 -2
- package/package.json +3 -3
- package/src/theme/ApiDemoPanel/FloatingButton/styles.module.css +2 -3
- package/src/theme/ApiDemoPanel/Request/index.tsx +2 -0
- package/src/theme/ApiDemoPanel/Request/styles.module.css +1 -0
- package/src/theme/ApiDemoPanel/Server/index.tsx +39 -39
- package/src/theme/ApiDemoPanel/Server/styles.module.css +0 -1
- package/src/theme/ApiDemoPanel/index.tsx +0 -2
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
.floatingButton button {
|
|
6
6
|
position: relative;
|
|
7
|
-
background:
|
|
7
|
+
background: var(--ifm-color-emphasis-900);
|
|
8
8
|
border: none;
|
|
9
9
|
border-radius: var(--ifm-global-radius);
|
|
10
|
-
color: var(--ifm-color-
|
|
10
|
+
color: var(--ifm-color-emphasis-100);
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
padding: 0.4rem 0.5rem;
|
|
13
13
|
opacity: 0;
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out,
|
|
16
16
|
bottom 0.2s ease-in-out;
|
|
17
17
|
position: absolute;
|
|
18
|
-
top: calc(var(--ifm-pre-padding) / 2);
|
|
19
18
|
right: calc(var(--ifm-pre-padding) / 2);
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -23,6 +23,8 @@ var _hooks = require("../hooks");
|
|
|
23
23
|
|
|
24
24
|
var _ParamOptions = _interopRequireDefault(require("../ParamOptions"));
|
|
25
25
|
|
|
26
|
+
var _Server = _interopRequireDefault(require("../Server"));
|
|
27
|
+
|
|
26
28
|
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
27
29
|
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -65,6 +67,7 @@ function Request({
|
|
|
65
67
|
</div>
|
|
66
68
|
</summary>
|
|
67
69
|
<div className={_stylesModule.default.optionsPanel}>
|
|
70
|
+
<_Server.default />
|
|
68
71
|
<_Authorization.default />
|
|
69
72
|
<_ParamOptions.default />
|
|
70
73
|
<_Body.default jsonRequestBodyExample={item.jsonRequestBodyExample} requestBodyMetadata={item.requestBody} />
|
|
@@ -63,46 +63,47 @@ function Server() {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
return <_FloatingButton.default onClick={() => setIsEditing(true)} label="Edit">
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
<_FormItem.default label="Base URL">
|
|
67
|
+
<pre style={{
|
|
68
|
+
background: "var(--openapi-card-background-color)",
|
|
69
|
+
paddingLeft: "0px"
|
|
70
|
+
}}>
|
|
71
|
+
<code title={url}>{url}</code>
|
|
72
|
+
</pre>
|
|
73
|
+
</_FormItem.default>
|
|
72
74
|
</_FloatingButton.default>;
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
return <div className={_stylesModule.default.optionsPanel}>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
<_FloatingButton.default onClick={() => setIsEditing(false)} label="Hide">
|
|
79
|
+
<_FormItem.default label="Base URL">
|
|
80
|
+
<_FormSelect.default options={options.map(s => s.url)} onChange={e => dispatch((0, _slice.setServer)(e.target.value))} value={value === null || value === void 0 ? void 0 : value.url} />
|
|
81
|
+
<small>{value === null || value === void 0 ? void 0 : value.description}</small>
|
|
82
|
+
</_FormItem.default>
|
|
83
|
+
{(value === null || value === void 0 ? void 0 : value.variables) && Object.keys(value.variables).map(key => {
|
|
84
|
+
var _value$variables2, _value$variables3;
|
|
85
|
+
|
|
86
|
+
if (((_value$variables2 = value.variables) === null || _value$variables2 === void 0 ? void 0 : _value$variables2[key].enum) !== undefined) {
|
|
87
|
+
return <_FormItem.default label={key}>
|
|
88
|
+
<_FormSelect.default options={value.variables[key].enum} onChange={e => {
|
|
89
|
+
dispatch((0, _slice.setServerVariable)({
|
|
90
|
+
key,
|
|
91
|
+
value: e.target.value
|
|
92
|
+
}));
|
|
93
|
+
}} />
|
|
94
|
+
</_FormItem.default>;
|
|
95
|
+
}
|
|
96
|
+
|
|
87
97
|
return <_FormItem.default label={key}>
|
|
88
|
-
<
|
|
98
|
+
<_FormTextInput.default placeholder={(_value$variables3 = value.variables) === null || _value$variables3 === void 0 ? void 0 : _value$variables3[key].default} onChange={e => {
|
|
89
99
|
dispatch((0, _slice.setServerVariable)({
|
|
90
100
|
key,
|
|
91
101
|
value: e.target.value
|
|
92
102
|
}));
|
|
93
103
|
}} />
|
|
94
104
|
</_FormItem.default>;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return <_FormItem.default label={key}>
|
|
98
|
-
<_FormTextInput.default placeholder={(_value$variables3 = value.variables) === null || _value$variables3 === void 0 ? void 0 : _value$variables3[key].default} onChange={e => {
|
|
99
|
-
dispatch((0, _slice.setServerVariable)({
|
|
100
|
-
key,
|
|
101
|
-
value: e.target.value
|
|
102
|
-
}));
|
|
103
|
-
}} />
|
|
104
|
-
</_FormItem.default>;
|
|
105
|
-
})}
|
|
105
|
+
})}
|
|
106
|
+
</_FloatingButton.default>
|
|
106
107
|
</div>;
|
|
107
108
|
}
|
|
108
109
|
|
|
@@ -27,8 +27,6 @@ var _Response = _interopRequireDefault(require("./Response"));
|
|
|
27
27
|
|
|
28
28
|
var _SecuritySchemes = _interopRequireDefault(require("./SecuritySchemes"));
|
|
29
29
|
|
|
30
|
-
var _Server = _interopRequireDefault(require("./Server"));
|
|
31
|
-
|
|
32
30
|
var _store = require("./store");
|
|
33
31
|
|
|
34
32
|
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
@@ -107,7 +105,6 @@ function ApiDemoPanel({
|
|
|
107
105
|
return <_reactRedux.Provider store={store2}>
|
|
108
106
|
<div className={_stylesModule.default.apiDemoPanelContainer}>
|
|
109
107
|
<_MethodEndpoint.default method={method} path={path} />
|
|
110
|
-
<_Server.default />
|
|
111
108
|
<_SecuritySchemes.default infoPath={infoPath} />
|
|
112
109
|
<_Request.default item={item} />
|
|
113
110
|
<_Response.default />
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
.floatingButton button {
|
|
6
6
|
position: relative;
|
|
7
|
-
background:
|
|
7
|
+
background: var(--ifm-color-emphasis-900);
|
|
8
8
|
border: none;
|
|
9
9
|
border-radius: var(--ifm-global-radius);
|
|
10
|
-
color: var(--ifm-color-
|
|
10
|
+
color: var(--ifm-color-emphasis-100);
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
padding: 0.4rem 0.5rem;
|
|
13
13
|
opacity: 0;
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out,
|
|
16
16
|
bottom 0.2s ease-in-out;
|
|
17
17
|
position: absolute;
|
|
18
|
-
top: calc(var(--ifm-pre-padding) / 2);
|
|
19
18
|
right: calc(var(--ifm-pre-padding) / 2);
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -13,6 +13,7 @@ import Body from "../Body";
|
|
|
13
13
|
import Execute from "../Execute";
|
|
14
14
|
import { useTypedSelector } from "../hooks";
|
|
15
15
|
import ParamOptions from "../ParamOptions";
|
|
16
|
+
import Server from "../Server";
|
|
16
17
|
import styles from "./styles.module.css";
|
|
17
18
|
|
|
18
19
|
function Request({ item }) {
|
|
@@ -44,6 +45,7 @@ function Request({ item }) {
|
|
|
44
45
|
</div>
|
|
45
46
|
</summary>
|
|
46
47
|
<div className={styles.optionsPanel}>
|
|
48
|
+
<Server />
|
|
47
49
|
<Authorization />
|
|
48
50
|
<ParamOptions />
|
|
49
51
|
<Body
|
|
@@ -45,41 +45,55 @@ function Server() {
|
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
47
|
<FloatingButton onClick={() => setIsEditing(true)} label="Edit">
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
<FormItem label="Base URL">
|
|
49
|
+
<pre
|
|
50
|
+
style={{
|
|
51
|
+
background: "var(--openapi-card-background-color)",
|
|
52
|
+
paddingLeft: "0px",
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<code title={url}>{url}</code>
|
|
56
|
+
</pre>
|
|
57
|
+
</FormItem>
|
|
56
58
|
</FloatingButton>
|
|
57
59
|
);
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
return (
|
|
61
63
|
<div className={styles.optionsPanel}>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
<FloatingButton onClick={() => setIsEditing(false)} label="Hide">
|
|
65
|
+
<FormItem label="Base URL">
|
|
66
|
+
<FormSelect
|
|
67
|
+
options={options.map((s) => s.url)}
|
|
68
|
+
onChange={(e) => dispatch(setServer(e.target.value))}
|
|
69
|
+
value={value?.url}
|
|
70
|
+
/>
|
|
71
|
+
<small>{value?.description}</small>
|
|
72
|
+
</FormItem>
|
|
73
|
+
{value?.variables &&
|
|
74
|
+
Object.keys(value.variables).map((key) => {
|
|
75
|
+
if (value.variables?.[key].enum !== undefined) {
|
|
76
|
+
return (
|
|
77
|
+
<FormItem label={key}>
|
|
78
|
+
<FormSelect
|
|
79
|
+
options={value.variables[key].enum}
|
|
80
|
+
onChange={(e) => {
|
|
81
|
+
dispatch(
|
|
82
|
+
setServerVariable({
|
|
83
|
+
key,
|
|
84
|
+
value: e.target.value,
|
|
85
|
+
})
|
|
86
|
+
);
|
|
87
|
+
}}
|
|
88
|
+
/>
|
|
89
|
+
</FormItem>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
79
93
|
return (
|
|
80
94
|
<FormItem label={key}>
|
|
81
|
-
<
|
|
82
|
-
|
|
95
|
+
<FormTextInput
|
|
96
|
+
placeholder={value.variables?.[key].default}
|
|
83
97
|
onChange={(e) => {
|
|
84
98
|
dispatch(
|
|
85
99
|
setServerVariable({
|
|
@@ -91,24 +105,8 @@ function Server() {
|
|
|
91
105
|
/>
|
|
92
106
|
</FormItem>
|
|
93
107
|
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<FormItem label={key}>
|
|
98
|
-
<FormTextInput
|
|
99
|
-
placeholder={value.variables?.[key].default}
|
|
100
|
-
onChange={(e) => {
|
|
101
|
-
dispatch(
|
|
102
|
-
setServerVariable({
|
|
103
|
-
key,
|
|
104
|
-
value: e.target.value,
|
|
105
|
-
})
|
|
106
|
-
);
|
|
107
|
-
}}
|
|
108
|
-
/>
|
|
109
|
-
</FormItem>
|
|
110
|
-
);
|
|
111
|
-
})}
|
|
108
|
+
})}
|
|
109
|
+
</FloatingButton>
|
|
112
110
|
</div>
|
|
113
111
|
);
|
|
114
112
|
}
|
|
@@ -15,7 +15,6 @@ import { createPersistanceMiddleware } from "./persistanceMiddleware";
|
|
|
15
15
|
import Request from "./Request";
|
|
16
16
|
import Response from "./Response";
|
|
17
17
|
import SecuritySchemes from "./SecuritySchemes";
|
|
18
|
-
import Server from "./Server";
|
|
19
18
|
import { createStoreWithState } from "./store";
|
|
20
19
|
import styles from "./styles.module.css";
|
|
21
20
|
|
|
@@ -81,7 +80,6 @@ function ApiDemoPanel({ item, infoPath }) {
|
|
|
81
80
|
<Provider store={store2}>
|
|
82
81
|
<div className={styles.apiDemoPanelContainer}>
|
|
83
82
|
<MethodEndpoint method={method} path={path} />
|
|
84
|
-
<Server />
|
|
85
83
|
<SecuritySchemes infoPath={infoPath} />
|
|
86
84
|
<Request item={item} />
|
|
87
85
|
<Response />
|
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": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"buffer": "^6.0.3",
|
|
51
51
|
"clsx": "^1.1.1",
|
|
52
52
|
"crypto-js": "^4.1.1",
|
|
53
|
-
"docusaurus-plugin-openapi-docs": "^1.2.
|
|
53
|
+
"docusaurus-plugin-openapi-docs": "^1.2.2",
|
|
54
54
|
"immer": "^9.0.7",
|
|
55
55
|
"lodash": "^4.17.20",
|
|
56
56
|
"process": "^0.11.10",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=14"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "cfeb5216f143133a1c35587fef21f75a44b75854"
|
|
74
74
|
}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
.floatingButton button {
|
|
6
6
|
position: relative;
|
|
7
|
-
background:
|
|
7
|
+
background: var(--ifm-color-emphasis-900);
|
|
8
8
|
border: none;
|
|
9
9
|
border-radius: var(--ifm-global-radius);
|
|
10
|
-
color: var(--ifm-color-
|
|
10
|
+
color: var(--ifm-color-emphasis-100);
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
padding: 0.4rem 0.5rem;
|
|
13
13
|
opacity: 0;
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out,
|
|
16
16
|
bottom 0.2s ease-in-out;
|
|
17
17
|
position: absolute;
|
|
18
|
-
top: calc(var(--ifm-pre-padding) / 2);
|
|
19
18
|
right: calc(var(--ifm-pre-padding) / 2);
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -19,6 +19,7 @@ import Body from "../Body";
|
|
|
19
19
|
import Execute from "../Execute";
|
|
20
20
|
import { useTypedSelector } from "../hooks";
|
|
21
21
|
import ParamOptions from "../ParamOptions";
|
|
22
|
+
import Server from "../Server";
|
|
22
23
|
import styles from "./styles.module.css";
|
|
23
24
|
|
|
24
25
|
function Request({ item }: { item: NonNullable<ApiItem> }) {
|
|
@@ -55,6 +56,7 @@ function Request({ item }: { item: NonNullable<ApiItem> }) {
|
|
|
55
56
|
</div>
|
|
56
57
|
</summary>
|
|
57
58
|
<div className={styles.optionsPanel}>
|
|
59
|
+
<Server />
|
|
58
60
|
<Authorization />
|
|
59
61
|
<ParamOptions />
|
|
60
62
|
<Body
|
|
@@ -45,59 +45,59 @@ function Server() {
|
|
|
45
45
|
}
|
|
46
46
|
return (
|
|
47
47
|
<FloatingButton onClick={() => setIsEditing(true)} label="Edit">
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
<FormItem label="Base URL">
|
|
49
|
+
<pre
|
|
50
|
+
style={{
|
|
51
|
+
background: "var(--openapi-card-background-color)",
|
|
52
|
+
paddingLeft: "0px",
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<code title={url}>{url}</code>
|
|
56
|
+
</pre>
|
|
57
|
+
</FormItem>
|
|
56
58
|
</FloatingButton>
|
|
57
59
|
);
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
return (
|
|
61
63
|
<div className={styles.optionsPanel}>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
<FloatingButton onClick={() => setIsEditing(false)} label="Hide">
|
|
65
|
+
<FormItem label="Base URL">
|
|
66
|
+
<FormSelect
|
|
67
|
+
options={options.map((s) => s.url)}
|
|
68
|
+
onChange={(e) => dispatch(setServer(e.target.value))}
|
|
69
|
+
value={value?.url}
|
|
70
|
+
/>
|
|
71
|
+
<small>{value?.description}</small>
|
|
72
|
+
</FormItem>
|
|
73
|
+
{value?.variables &&
|
|
74
|
+
Object.keys(value.variables).map((key) => {
|
|
75
|
+
if (value.variables?.[key].enum !== undefined) {
|
|
76
|
+
return (
|
|
77
|
+
<FormItem label={key}>
|
|
78
|
+
<FormSelect
|
|
79
|
+
options={value.variables[key].enum}
|
|
80
|
+
onChange={(e) => {
|
|
81
|
+
dispatch(
|
|
82
|
+
setServerVariable({ key, value: e.target.value })
|
|
83
|
+
);
|
|
84
|
+
}}
|
|
85
|
+
/>
|
|
86
|
+
</FormItem>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
79
89
|
return (
|
|
80
90
|
<FormItem label={key}>
|
|
81
|
-
<
|
|
82
|
-
|
|
91
|
+
<FormTextInput
|
|
92
|
+
placeholder={value.variables?.[key].default}
|
|
83
93
|
onChange={(e) => {
|
|
84
94
|
dispatch(setServerVariable({ key, value: e.target.value }));
|
|
85
95
|
}}
|
|
86
96
|
/>
|
|
87
97
|
</FormItem>
|
|
88
98
|
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
<FormItem label={key}>
|
|
92
|
-
<FormTextInput
|
|
93
|
-
placeholder={value.variables?.[key].default}
|
|
94
|
-
onChange={(e) => {
|
|
95
|
-
dispatch(setServerVariable({ key, value: e.target.value }));
|
|
96
|
-
}}
|
|
97
|
-
/>
|
|
98
|
-
</FormItem>
|
|
99
|
-
);
|
|
100
|
-
})}
|
|
99
|
+
})}
|
|
100
|
+
</FloatingButton>
|
|
101
101
|
</div>
|
|
102
102
|
);
|
|
103
103
|
}
|
|
@@ -21,7 +21,6 @@ import { createPersistanceMiddleware } from "./persistanceMiddleware";
|
|
|
21
21
|
import Request from "./Request";
|
|
22
22
|
import Response from "./Response";
|
|
23
23
|
import SecuritySchemes from "./SecuritySchemes";
|
|
24
|
-
import Server from "./Server";
|
|
25
24
|
import { createStoreWithState } from "./store";
|
|
26
25
|
import styles from "./styles.module.css";
|
|
27
26
|
|
|
@@ -93,7 +92,6 @@ function ApiDemoPanel({
|
|
|
93
92
|
<Provider store={store2}>
|
|
94
93
|
<div className={styles.apiDemoPanelContainer}>
|
|
95
94
|
<MethodEndpoint method={method} path={path} />
|
|
96
|
-
<Server />
|
|
97
95
|
<SecuritySchemes infoPath={infoPath} />
|
|
98
96
|
<Request item={item} />
|
|
99
97
|
<Response />
|