docusaurus-theme-openapi-docs 4.3.1 → 4.3.3
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/index.js +1 -1
- package/lib/markdown/createDescription.js +1 -2
- package/lib/markdown/schema.js +2 -3
- package/lib/markdown/utils.d.ts +2 -2
- package/lib/markdown/utils.js +4 -5
- package/lib/theme/ApiExplorer/Accept/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +1 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +0 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +1 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +0 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +1 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +23 -11
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +1 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +23 -11
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +1 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +1 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +23 -11
- package/lib/theme/ApiExplorer/Authorization/auth-types.js +1 -2
- package/lib/theme/ApiExplorer/Authorization/slice.d.ts +3 -3
- package/lib/theme/ApiExplorer/Authorization/slice.js +2 -6
- package/lib/theme/ApiExplorer/Body/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +23 -11
- package/lib/theme/ApiExplorer/CodeSnippets/languages.js +4 -8
- package/lib/theme/ApiExplorer/CodeTabs/index.js +29 -13
- package/lib/theme/ApiExplorer/ContentType/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +22 -10
- package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/LiveEditor/index.js +27 -13
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +25 -12
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +1 -1
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +1 -1
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +1 -1
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +1 -1
- package/lib/theme/ApiExplorer/ParamOptions/index.js +22 -10
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/Request/index.js +22 -10
- package/lib/theme/ApiExplorer/Response/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/Server/index.js +22 -10
- package/lib/theme/ApiExplorer/Server/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/persistanceMiddleware.js +1 -2
- package/lib/theme/ApiExplorer/storage-utils.js +2 -3
- package/lib/theme/ApiItem/Layout/index.d.ts +1 -1
- package/lib/theme/ApiItem/Layout/index.js +1 -1
- package/lib/theme/ApiItem/hooks.d.ts +1 -1
- package/lib/theme/ApiItem/index.d.ts +0 -2
- package/lib/theme/ApiItem/index.js +1 -1
- package/lib/theme/ApiItem/store.d.ts +5 -5
- package/lib/theme/ApiLogo/index.js +1 -1
- package/lib/theme/ApiTabs/index.js +26 -12
- package/lib/theme/DiscriminatorTabs/index.js +26 -12
- package/lib/theme/MimeTabs/index.js +26 -12
- package/lib/theme/OperationTabs/index.js +26 -12
- package/lib/theme/ParamsDetails/index.js +4 -53
- package/lib/theme/RequestSchema/index.js +4 -53
- package/lib/theme/ResponseExamples/index.js +1 -2
- package/lib/theme/ResponseSchema/index.js +4 -53
- package/lib/theme/SchemaItem/index.js +4 -2
- package/lib/theme/SchemaTabs/index.js +26 -12
- package/package.json +5 -5
- package/src/theme/ApiExplorer/CodeSnippets/index.tsx +1 -1
- package/src/theme/ApiExplorer/CodeTabs/index.tsx +6 -2
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +6 -4
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +2 -1
- package/src/theme/ApiItem/Layout/index.tsx +1 -1
- package/src/theme/ApiItem/index.tsx +1 -1
- package/src/theme/ApiTabs/index.tsx +3 -1
- package/src/theme/DiscriminatorTabs/index.tsx +3 -1
- package/src/theme/MimeTabs/index.tsx +3 -1
- package/src/theme/OperationTabs/index.tsx +3 -1
- package/src/theme/ParamsDetails/index.tsx +2 -9
- package/src/theme/RequestSchema/index.tsx +2 -9
- package/src/theme/ResponseSchema/index.tsx +2 -9
- package/src/theme/SchemaItem/index.tsx +3 -1
- package/src/theme/SchemaTabs/index.tsx +3 -1
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -39,22 +39,35 @@ var __setModuleDefault =
|
|
|
39
39
|
});
|
|
40
40
|
var __importStar =
|
|
41
41
|
(this && this.__importStar) ||
|
|
42
|
-
function (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
(function () {
|
|
43
|
+
var ownKeys = function (o) {
|
|
44
|
+
ownKeys =
|
|
45
|
+
Object.getOwnPropertyNames ||
|
|
46
|
+
function (o) {
|
|
47
|
+
var ar = [];
|
|
48
|
+
for (var k in o)
|
|
49
|
+
if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
50
|
+
return ar;
|
|
51
|
+
};
|
|
52
|
+
return ownKeys(o);
|
|
53
|
+
};
|
|
54
|
+
return function (mod) {
|
|
55
|
+
if (mod && mod.__esModule) return mod;
|
|
56
|
+
var result = {};
|
|
57
|
+
if (mod != null)
|
|
58
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
59
|
+
if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
60
|
+
__setModuleDefault(result, mod);
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
})();
|
|
52
64
|
var __importDefault =
|
|
53
65
|
(this && this.__importDefault) ||
|
|
54
66
|
function (mod) {
|
|
55
67
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
56
68
|
};
|
|
57
69
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
+
exports.default = MimeTabs;
|
|
58
71
|
const react_1 = __importStar(require("react"));
|
|
59
72
|
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
60
73
|
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
@@ -192,7 +205,9 @@ function TabList({
|
|
|
192
205
|
tabIndex: selectedValue === value ? 0 : -1,
|
|
193
206
|
"aria-selected": selectedValue === value,
|
|
194
207
|
key: value,
|
|
195
|
-
ref: (tabControl) =>
|
|
208
|
+
ref: (tabControl) => {
|
|
209
|
+
tabRefs.push(tabControl);
|
|
210
|
+
},
|
|
196
211
|
onKeyDown: handleKeydown,
|
|
197
212
|
onFocus: handleTabChange,
|
|
198
213
|
onClick: (e) => handleTabChange(e),
|
|
@@ -269,4 +284,3 @@ function MimeTabs(props) {
|
|
|
269
284
|
(0, internal_1.sanitizeTabsChildren)(props.children)
|
|
270
285
|
);
|
|
271
286
|
}
|
|
272
|
-
exports.default = MimeTabs;
|
|
@@ -39,22 +39,35 @@ var __setModuleDefault =
|
|
|
39
39
|
});
|
|
40
40
|
var __importStar =
|
|
41
41
|
(this && this.__importStar) ||
|
|
42
|
-
function (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
(function () {
|
|
43
|
+
var ownKeys = function (o) {
|
|
44
|
+
ownKeys =
|
|
45
|
+
Object.getOwnPropertyNames ||
|
|
46
|
+
function (o) {
|
|
47
|
+
var ar = [];
|
|
48
|
+
for (var k in o)
|
|
49
|
+
if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
50
|
+
return ar;
|
|
51
|
+
};
|
|
52
|
+
return ownKeys(o);
|
|
53
|
+
};
|
|
54
|
+
return function (mod) {
|
|
55
|
+
if (mod && mod.__esModule) return mod;
|
|
56
|
+
var result = {};
|
|
57
|
+
if (mod != null)
|
|
58
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
59
|
+
if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
60
|
+
__setModuleDefault(result, mod);
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
})();
|
|
52
64
|
var __importDefault =
|
|
53
65
|
(this && this.__importDefault) ||
|
|
54
66
|
function (mod) {
|
|
55
67
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
56
68
|
};
|
|
57
69
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
+
exports.default = OperationTabs;
|
|
58
71
|
const react_1 = __importStar(require("react"));
|
|
59
72
|
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
60
73
|
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
@@ -154,7 +167,9 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
|
154
167
|
tabIndex: selectedValue === value ? 0 : -1,
|
|
155
168
|
"aria-selected": selectedValue === value,
|
|
156
169
|
key: value,
|
|
157
|
-
ref: (tabControl) =>
|
|
170
|
+
ref: (tabControl) => {
|
|
171
|
+
tabRefs.push(tabControl);
|
|
172
|
+
},
|
|
158
173
|
onKeyDown: handleKeydown,
|
|
159
174
|
onFocus: handleTabChange,
|
|
160
175
|
onClick: (e) => handleTabChange(e),
|
|
@@ -231,4 +246,3 @@ function OperationTabs(props) {
|
|
|
231
246
|
(0, internal_1.sanitizeTabsChildren)(props.children)
|
|
232
247
|
);
|
|
233
248
|
}
|
|
234
|
-
exports.default = OperationTabs;
|
|
@@ -5,57 +5,13 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
* ========================================================================== */
|
|
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
8
|
var __importDefault =
|
|
53
9
|
(this && this.__importDefault) ||
|
|
54
10
|
function (mod) {
|
|
55
11
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
56
12
|
};
|
|
57
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
const react_1 =
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
59
15
|
const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
60
16
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
61
17
|
const ParamsItem_1 = __importDefault(require("@theme/ParamsItem"));
|
|
@@ -120,14 +76,9 @@ const ParamsDetails = (props) => {
|
|
|
120
76
|
}),
|
|
121
77
|
},
|
|
122
78
|
() => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
);
|
|
126
|
-
return react_1.default.createElement(
|
|
127
|
-
react_1.Suspense,
|
|
128
|
-
{ fallback: null },
|
|
129
|
-
react_1.default.createElement(LazyComponent, { ...props })
|
|
130
|
-
);
|
|
79
|
+
return react_1.default.createElement(ParamsDetailsComponent, {
|
|
80
|
+
...props,
|
|
81
|
+
});
|
|
131
82
|
}
|
|
132
83
|
);
|
|
133
84
|
};
|
|
@@ -5,57 +5,13 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
* ========================================================================== */
|
|
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
8
|
var __importDefault =
|
|
53
9
|
(this && this.__importDefault) ||
|
|
54
10
|
function (mod) {
|
|
55
11
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
56
12
|
};
|
|
57
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
const react_1 =
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
59
15
|
const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
60
16
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
61
17
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
@@ -229,14 +185,9 @@ const RequestSchema = (props) => {
|
|
|
229
185
|
}),
|
|
230
186
|
},
|
|
231
187
|
() => {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
);
|
|
235
|
-
return react_1.default.createElement(
|
|
236
|
-
react_1.Suspense,
|
|
237
|
-
{ fallback: null },
|
|
238
|
-
react_1.default.createElement(LazyComponent, { ...props })
|
|
239
|
-
);
|
|
188
|
+
return react_1.default.createElement(RequestSchemaComponent, {
|
|
189
|
+
...props,
|
|
190
|
+
});
|
|
240
191
|
}
|
|
241
192
|
);
|
|
242
193
|
};
|
|
@@ -14,8 +14,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.ExampleFromSchema =
|
|
15
15
|
exports.ResponseExample =
|
|
16
16
|
exports.ResponseExamples =
|
|
17
|
-
exports.json2xml =
|
|
18
17
|
void 0;
|
|
18
|
+
exports.json2xml = json2xml;
|
|
19
19
|
const react_1 = __importDefault(require("react"));
|
|
20
20
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
21
21
|
const ResponseSamples_1 = __importDefault(require("@theme/ResponseSamples"));
|
|
@@ -58,7 +58,6 @@ function json2xml(o, tab) {
|
|
|
58
58
|
for (const m3 in o) xml += toXml(o[m3], m3, "");
|
|
59
59
|
return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
|
|
60
60
|
}
|
|
61
|
-
exports.json2xml = json2xml;
|
|
62
61
|
const ResponseExamples = ({ responseExamples, mimeType }) => {
|
|
63
62
|
let language = "shell";
|
|
64
63
|
if (mimeType.endsWith("json")) language = "json";
|
|
@@ -5,57 +5,13 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
* ========================================================================== */
|
|
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
8
|
var __importDefault =
|
|
53
9
|
(this && this.__importDefault) ||
|
|
54
10
|
function (mod) {
|
|
55
11
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
56
12
|
};
|
|
57
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
const react_1 =
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
59
15
|
const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
60
16
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
61
17
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
@@ -194,14 +150,9 @@ const ResponseSchema = (props) => {
|
|
|
194
150
|
}),
|
|
195
151
|
},
|
|
196
152
|
() => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
);
|
|
200
|
-
return react_1.default.createElement(
|
|
201
|
-
react_1.Suspense,
|
|
202
|
-
{ fallback: null },
|
|
203
|
-
react_1.default.createElement(LazyComponent, { ...props })
|
|
204
|
-
);
|
|
153
|
+
return react_1.default.createElement(ResponseSchemaComponent, {
|
|
154
|
+
...props,
|
|
155
|
+
});
|
|
205
156
|
}
|
|
206
157
|
);
|
|
207
158
|
};
|
|
@@ -11,6 +11,7 @@ var __importDefault =
|
|
|
11
11
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.default = SchemaItem;
|
|
14
15
|
const react_1 = __importDefault(require("react"));
|
|
15
16
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
16
17
|
const clsx_1 = __importDefault(require("clsx"));
|
|
@@ -56,7 +57,9 @@ function SchemaItem(props) {
|
|
|
56
57
|
enumDescriptions = transformEnumDescriptions(schema["x-enumDescriptions"]);
|
|
57
58
|
defaultValue = schema.default;
|
|
58
59
|
example = schema.example;
|
|
59
|
-
nullable =
|
|
60
|
+
nullable =
|
|
61
|
+
schema.nullable ||
|
|
62
|
+
(Array.isArray(schema.type) && schema.type.includes("null")); // support JSON Schema nullable
|
|
60
63
|
}
|
|
61
64
|
const renderRequired = (0, utils_1.guard)(
|
|
62
65
|
Array.isArray(required) ? required.includes(name) : required,
|
|
@@ -208,4 +211,3 @@ function SchemaItem(props) {
|
|
|
208
211
|
collapsible ? collapsibleSchemaContent : schemaContent
|
|
209
212
|
);
|
|
210
213
|
}
|
|
211
|
-
exports.default = SchemaItem;
|
|
@@ -39,22 +39,35 @@ var __setModuleDefault =
|
|
|
39
39
|
});
|
|
40
40
|
var __importStar =
|
|
41
41
|
(this && this.__importStar) ||
|
|
42
|
-
function (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
(function () {
|
|
43
|
+
var ownKeys = function (o) {
|
|
44
|
+
ownKeys =
|
|
45
|
+
Object.getOwnPropertyNames ||
|
|
46
|
+
function (o) {
|
|
47
|
+
var ar = [];
|
|
48
|
+
for (var k in o)
|
|
49
|
+
if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
50
|
+
return ar;
|
|
51
|
+
};
|
|
52
|
+
return ownKeys(o);
|
|
53
|
+
};
|
|
54
|
+
return function (mod) {
|
|
55
|
+
if (mod && mod.__esModule) return mod;
|
|
56
|
+
var result = {};
|
|
57
|
+
if (mod != null)
|
|
58
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
59
|
+
if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
60
|
+
__setModuleDefault(result, mod);
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
})();
|
|
52
64
|
var __importDefault =
|
|
53
65
|
(this && this.__importDefault) ||
|
|
54
66
|
function (mod) {
|
|
55
67
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
56
68
|
};
|
|
57
69
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
+
exports.default = SchemaTabs;
|
|
58
71
|
const react_1 = __importStar(require("react"));
|
|
59
72
|
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
60
73
|
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
@@ -158,7 +171,9 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
|
158
171
|
tabIndex: selectedValue === value ? 0 : -1,
|
|
159
172
|
"aria-selected": selectedValue === value,
|
|
160
173
|
key: value,
|
|
161
|
-
ref: (tabControl) =>
|
|
174
|
+
ref: (tabControl) => {
|
|
175
|
+
tabRefs.push(tabControl);
|
|
176
|
+
},
|
|
162
177
|
onKeyDown: handleKeydown,
|
|
163
178
|
onClick: handleTabChange,
|
|
164
179
|
...attributes,
|
|
@@ -238,4 +253,3 @@ function SchemaTabs(props) {
|
|
|
238
253
|
(0, internal_1.sanitizeTabsChildren)(props.children)
|
|
239
254
|
);
|
|
240
255
|
}
|
|
241
|
-
exports.default = SchemaTabs;
|
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": "4.3.
|
|
4
|
+
"version": "4.3.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@types/file-saver": "^2.0.5",
|
|
35
35
|
"@types/lodash": "^4.14.176",
|
|
36
36
|
"concurrently": "^5.2.0",
|
|
37
|
-
"docusaurus-plugin-openapi-docs": "^4.3.
|
|
37
|
+
"docusaurus-plugin-openapi-docs": "^4.3.3",
|
|
38
38
|
"docusaurus-plugin-sass": "^0.2.3",
|
|
39
39
|
"eslint-plugin-prettier": "^5.0.1"
|
|
40
40
|
},
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"@docusaurus/theme-common": "^3.5.0",
|
|
70
70
|
"docusaurus-plugin-openapi-docs": "^4.0.0",
|
|
71
71
|
"docusaurus-plugin-sass": "^0.2.3",
|
|
72
|
-
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
|
73
|
-
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0"
|
|
72
|
+
"react": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
73
|
+
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": ">=14"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "4ec42960414d640952c235afc3757fd3245fb2d2"
|
|
79
79
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
-
import React, { useState, useEffect } from "react";
|
|
8
|
+
import React, { useState, useEffect, type JSX } from "react";
|
|
9
9
|
|
|
10
10
|
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
|
11
11
|
import ApiCodeBlock from "@theme/ApiExplorer/ApiCodeBlock";
|
|
@@ -44,7 +44,7 @@ function TabList({
|
|
|
44
44
|
tabValues,
|
|
45
45
|
}: CodeTabsProps & ReturnType<typeof useTabs>) {
|
|
46
46
|
const tabRefs = useRef<(HTMLLIElement | null)[]>([]);
|
|
47
|
-
const tabsScrollContainerRef = useRef<any>();
|
|
47
|
+
const tabsScrollContainerRef = useRef<any>(null);
|
|
48
48
|
const { blockElementScrollPositionUntilNextRender } =
|
|
49
49
|
useScrollPositionBlocker();
|
|
50
50
|
|
|
@@ -163,7 +163,11 @@ function TabList({
|
|
|
163
163
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
164
164
|
aria-selected={selectedValue === value}
|
|
165
165
|
key={value}
|
|
166
|
-
ref={(tabControl) =>
|
|
166
|
+
ref={(tabControl) => {
|
|
167
|
+
if (tabControl) {
|
|
168
|
+
tabRefs.current.push(tabControl);
|
|
169
|
+
}
|
|
170
|
+
}}
|
|
167
171
|
onKeyDown={handleKeydown}
|
|
168
172
|
onClick={handleTabChange}
|
|
169
173
|
{...attributes}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
-
import React, { useEffect, useState } from "react";
|
|
8
|
+
import React, { type JSX, useEffect, useState } from "react";
|
|
9
9
|
|
|
10
10
|
import { usePrismTheme } from "@docusaurus/theme-common";
|
|
11
11
|
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
@@ -51,7 +51,7 @@ function App({
|
|
|
51
51
|
...props
|
|
52
52
|
}: any): JSX.Element {
|
|
53
53
|
const prismTheme = usePrismTheme();
|
|
54
|
-
const [code, setCode] = React.useState(children);
|
|
54
|
+
const [code, setCode] = React.useState(children.replace(/\n$/, ""));
|
|
55
55
|
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
action(setStringRawBody(code));
|
|
@@ -76,7 +76,7 @@ function App({
|
|
|
76
76
|
})}
|
|
77
77
|
>
|
|
78
78
|
<LiveProvider
|
|
79
|
-
code={
|
|
79
|
+
code={code}
|
|
80
80
|
transformCode={transformCode ?? ((code) => `${code};`)}
|
|
81
81
|
theme={prismTheme}
|
|
82
82
|
language={language}
|
|
@@ -84,7 +84,9 @@ function App({
|
|
|
84
84
|
>
|
|
85
85
|
<Controller
|
|
86
86
|
control={control}
|
|
87
|
-
rules={{
|
|
87
|
+
rules={{
|
|
88
|
+
required: isRequired && !code ? "This field is required" : false,
|
|
89
|
+
}}
|
|
88
90
|
name="requestBody"
|
|
89
91
|
render={({ field: { onChange, name } }) => (
|
|
90
92
|
<LiveComponent
|
|
@@ -56,7 +56,8 @@ export default function ParamArrayFormItem({ param }: ParamProps) {
|
|
|
56
56
|
|
|
57
57
|
const showErrorMessage = errors?.paramArray?.message;
|
|
58
58
|
|
|
59
|
-
function handleAddItem() {
|
|
59
|
+
function handleAddItem(e: any) {
|
|
60
|
+
e.preventDefault(); // prevent form from submitting
|
|
60
61
|
setItems((i) => [
|
|
61
62
|
...i,
|
|
62
63
|
{
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
-
import React from "react";
|
|
8
|
+
import React, { type JSX } from "react";
|
|
9
9
|
|
|
10
10
|
import { useDoc } from "@docusaurus/plugin-content-docs/client";
|
|
11
11
|
import { useWindowSize } from "@docusaurus/theme-common";
|
|
@@ -65,7 +65,7 @@ export default function ApiItem(props: Props): JSX.Element {
|
|
|
65
65
|
if (api) {
|
|
66
66
|
try {
|
|
67
67
|
api = JSON.parse(
|
|
68
|
-
zlib.inflateSync(Buffer.from(api as any, "base64")).toString()
|
|
68
|
+
zlib.inflateSync(Buffer.from(api as any, "base64") as any).toString()
|
|
69
69
|
);
|
|
70
70
|
} catch {}
|
|
71
71
|
}
|
|
@@ -150,7 +150,9 @@ function TabList({
|
|
|
150
150
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
151
151
|
aria-selected={selectedValue === value}
|
|
152
152
|
key={value}
|
|
153
|
-
ref={(tabControl) =>
|
|
153
|
+
ref={(tabControl) => {
|
|
154
|
+
tabRefs.push(tabControl);
|
|
155
|
+
}}
|
|
154
156
|
onKeyDown={handleKeydown}
|
|
155
157
|
onClick={handleTabChange}
|
|
156
158
|
{...attributes}
|
|
@@ -136,7 +136,9 @@ function TabList({
|
|
|
136
136
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
137
137
|
aria-selected={selectedValue === value}
|
|
138
138
|
key={value}
|
|
139
|
-
ref={(tabControl) =>
|
|
139
|
+
ref={(tabControl) => {
|
|
140
|
+
tabRefs.push(tabControl);
|
|
141
|
+
}}
|
|
140
142
|
onKeyDown={handleKeydown}
|
|
141
143
|
onClick={handleTabChange}
|
|
142
144
|
{...attributes}
|
|
@@ -173,7 +173,9 @@ function TabList({
|
|
|
173
173
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
174
174
|
aria-selected={selectedValue === value}
|
|
175
175
|
key={value}
|
|
176
|
-
ref={(tabControl) =>
|
|
176
|
+
ref={(tabControl) => {
|
|
177
|
+
tabRefs.push(tabControl);
|
|
178
|
+
}}
|
|
177
179
|
onKeyDown={handleKeydown}
|
|
178
180
|
onFocus={handleTabChange}
|
|
179
181
|
onClick={(e) => handleTabChange(e)}
|
|
@@ -136,7 +136,9 @@ function TabList({
|
|
|
136
136
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
137
137
|
aria-selected={selectedValue === value}
|
|
138
138
|
key={value}
|
|
139
|
-
ref={(tabControl) =>
|
|
139
|
+
ref={(tabControl) => {
|
|
140
|
+
tabRefs.push(tabControl);
|
|
141
|
+
}}
|
|
140
142
|
onKeyDown={handleKeydown}
|
|
141
143
|
onFocus={handleTabChange}
|
|
142
144
|
onClick={(e) => handleTabChange(e)}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
-
import React
|
|
8
|
+
import React from "react";
|
|
9
9
|
|
|
10
10
|
import BrowserOnly from "@docusaurus/BrowserOnly";
|
|
11
11
|
import Details from "@theme/Details";
|
|
@@ -72,14 +72,7 @@ const ParamsDetails: React.FC<Props> = (props) => {
|
|
|
72
72
|
return (
|
|
73
73
|
<BrowserOnly fallback={<SkeletonLoader size="sm" />}>
|
|
74
74
|
{() => {
|
|
75
|
-
|
|
76
|
-
Promise.resolve({ default: ParamsDetailsComponent })
|
|
77
|
-
);
|
|
78
|
-
return (
|
|
79
|
-
<Suspense fallback={null}>
|
|
80
|
-
<LazyComponent {...props} />
|
|
81
|
-
</Suspense>
|
|
82
|
-
);
|
|
75
|
+
return <ParamsDetailsComponent {...props} />;
|
|
83
76
|
}}
|
|
84
77
|
</BrowserOnly>
|
|
85
78
|
);
|