docusaurus-theme-openapi-docs 0.0.0-740 → 0.0.0-750
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/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/Body/slice.d.ts +8 -8
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +2 -2
- 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 +23 -20
- package/lib/theme/ApiExplorer/index.js +0 -4
- package/lib/theme/ApiExplorer/persistanceMiddleware.js +6 -6
- 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 +148 -93
- package/lib/theme/styles.scss +4 -0
- package/package.json +8 -7
- package/src/markdown/utils.ts +4 -2
- 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/index.tsx +3 -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 +6 -3
- package/src/theme/ApiExplorer/index.tsx +0 -3
- package/src/theme/ApiExplorer/persistanceMiddleware.ts +6 -6
- 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} +57 -25
- 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} +64 -28
- package/src/theme/styles.scss +4 -0
- package/src/theme-classic.d.ts +69 -2
- package/src/theme-openapi.d.ts +3 -0
- package/tsconfig.json +4 -1
|
@@ -18,12 +18,14 @@
|
|
|
18
18
|
background-color: var(--ifm-pre-background);
|
|
19
19
|
border-radius: var(--ifm-global-radius);
|
|
20
20
|
border: 1px solid var(--openapi-explorer-border-color);
|
|
21
|
-
box-shadow:
|
|
21
|
+
box-shadow:
|
|
22
|
+
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
22
23
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
23
24
|
transition: 300ms;
|
|
24
25
|
|
|
25
26
|
&:hover {
|
|
26
|
-
box-shadow:
|
|
27
|
+
box-shadow:
|
|
28
|
+
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
27
29
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
28
30
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
29
31
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type TabProps } from "@docusaurus/theme-common/internal";
|
|
3
|
+
import { Language } from "@theme/ApiExplorer/CodeSnippets";
|
|
4
|
+
export interface Props {
|
|
5
|
+
action: {
|
|
6
|
+
[key: string]: React.Dispatch<any>;
|
|
7
|
+
};
|
|
8
|
+
currentLanguage: Language;
|
|
9
|
+
languageSet: Language[];
|
|
10
|
+
includeVariant: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CodeTabsProps extends Props, TabProps {
|
|
13
|
+
includeSample?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export default function CodeTabs(props: CodeTabsProps & Props): React.JSX.Element;
|
|
@@ -1,19 +1,64 @@
|
|
|
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
|
-
|
|
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 internal_1 = require("@docusaurus/theme-common/internal");
|
|
60
|
+
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
61
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
17
62
|
function TabList({
|
|
18
63
|
action,
|
|
19
64
|
currentLanguage,
|
|
@@ -27,19 +72,16 @@ function TabList({
|
|
|
27
72
|
tabValues,
|
|
28
73
|
}) {
|
|
29
74
|
const tabRefs = [];
|
|
30
|
-
const { blockElementScrollPositionUntilNextRender } =
|
|
31
|
-
|
|
32
|
-
|
|
75
|
+
const { blockElementScrollPositionUntilNextRender } = (0,
|
|
76
|
+
internal_1.useScrollPositionBlocker)();
|
|
33
77
|
const handleTabChange = (event) => {
|
|
34
78
|
const newTab = event.currentTarget;
|
|
35
79
|
const newTabIndex = tabRefs.indexOf(newTab);
|
|
36
80
|
const newTabValue = tabValues[newTabIndex].value;
|
|
37
|
-
|
|
38
81
|
if (newTabValue !== selectedValue) {
|
|
39
82
|
blockElementScrollPositionUntilNextRender(newTab);
|
|
40
83
|
selectValue(newTabValue);
|
|
41
84
|
}
|
|
42
|
-
|
|
43
85
|
if (action) {
|
|
44
86
|
let newLanguage;
|
|
45
87
|
if (currentLanguage && includeVariant) {
|
|
@@ -61,11 +103,9 @@ function TabList({
|
|
|
61
103
|
action.setSelectedVariant(newLanguage.variant.toLowerCase());
|
|
62
104
|
action.setSelectedSample(newLanguage.sample);
|
|
63
105
|
}
|
|
64
|
-
|
|
65
106
|
action.setLanguage(newLanguage);
|
|
66
107
|
}
|
|
67
108
|
};
|
|
68
|
-
|
|
69
109
|
const handleKeydown = (event) => {
|
|
70
110
|
let focusElement = null;
|
|
71
111
|
switch (event.key) {
|
|
@@ -88,96 +128,102 @@ function TabList({
|
|
|
88
128
|
}
|
|
89
129
|
focusElement?.focus();
|
|
90
130
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
role
|
|
95
|
-
aria-orientation
|
|
96
|
-
className
|
|
131
|
+
return react_1.default.createElement(
|
|
132
|
+
"ul",
|
|
133
|
+
{
|
|
134
|
+
role: "tablist",
|
|
135
|
+
"aria-orientation": "horizontal",
|
|
136
|
+
className: (0, clsx_1.default)(
|
|
97
137
|
"tabs",
|
|
98
138
|
"openapi-tabs__code-list-container",
|
|
99
139
|
{
|
|
100
140
|
"tabs--block": block,
|
|
101
141
|
},
|
|
102
142
|
className
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
143
|
+
),
|
|
144
|
+
},
|
|
145
|
+
tabValues.map(({ value, label, attributes }) =>
|
|
146
|
+
react_1.default.createElement(
|
|
147
|
+
"li",
|
|
148
|
+
{
|
|
107
149
|
// TODO extract TabListItem
|
|
108
|
-
role
|
|
109
|
-
tabIndex
|
|
110
|
-
aria-selected
|
|
111
|
-
key
|
|
112
|
-
ref
|
|
113
|
-
onKeyDown
|
|
114
|
-
onClick
|
|
115
|
-
|
|
116
|
-
className
|
|
150
|
+
role: "tab",
|
|
151
|
+
tabIndex: selectedValue === value ? 0 : -1,
|
|
152
|
+
"aria-selected": selectedValue === value,
|
|
153
|
+
key: value,
|
|
154
|
+
ref: (tabControl) => tabRefs.push(tabControl),
|
|
155
|
+
onKeyDown: handleKeydown,
|
|
156
|
+
onClick: handleTabChange,
|
|
157
|
+
...attributes,
|
|
158
|
+
className: (0, clsx_1.default)(
|
|
117
159
|
"tabs__item",
|
|
118
160
|
"openapi-tabs__code-item",
|
|
119
161
|
attributes?.className,
|
|
120
162
|
{
|
|
121
163
|
active: selectedValue === value,
|
|
122
164
|
}
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</ul>
|
|
165
|
+
),
|
|
166
|
+
},
|
|
167
|
+
react_1.default.createElement("span", null, label ?? value)
|
|
168
|
+
)
|
|
169
|
+
)
|
|
129
170
|
);
|
|
130
171
|
}
|
|
131
|
-
|
|
132
172
|
function TabContent({ lazy, children, selectedValue }) {
|
|
133
|
-
|
|
134
|
-
|
|
173
|
+
const childTabs = (Array.isArray(children) ? children : [children]).filter(
|
|
174
|
+
Boolean
|
|
175
|
+
);
|
|
135
176
|
if (lazy) {
|
|
136
|
-
const selectedTabItem =
|
|
177
|
+
const selectedTabItem = childTabs.find(
|
|
137
178
|
(tabItem) => tabItem.props.value === selectedValue
|
|
138
179
|
);
|
|
139
180
|
if (!selectedTabItem) {
|
|
140
181
|
// fail-safe or fail-fast? not sure what's best here
|
|
141
182
|
return null;
|
|
142
183
|
}
|
|
143
|
-
return cloneElement(selectedTabItem, {
|
|
184
|
+
return (0, react_1.cloneElement)(selectedTabItem, {
|
|
185
|
+
className: "margin-top--md",
|
|
186
|
+
});
|
|
144
187
|
}
|
|
145
|
-
return (
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
)
|
|
153
|
-
|
|
188
|
+
return react_1.default.createElement(
|
|
189
|
+
"div",
|
|
190
|
+
{ className: "margin-top--md openapi-tabs__code-content" },
|
|
191
|
+
childTabs.map((tabItem, i) =>
|
|
192
|
+
(0, react_1.cloneElement)(tabItem, {
|
|
193
|
+
key: i,
|
|
194
|
+
hidden: tabItem.props.value !== selectedValue,
|
|
195
|
+
})
|
|
196
|
+
)
|
|
154
197
|
);
|
|
155
198
|
}
|
|
156
|
-
|
|
157
199
|
function TabsComponent(props) {
|
|
158
|
-
const tabs = useTabs(props);
|
|
200
|
+
const tabs = (0, internal_1.useTabs)(props);
|
|
159
201
|
const { className } = props;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
className
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
202
|
+
return react_1.default.createElement(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
className: (0, clsx_1.default)(
|
|
206
|
+
"tabs-container openapi-tabs__code-container",
|
|
207
|
+
className
|
|
208
|
+
),
|
|
209
|
+
},
|
|
210
|
+
react_1.default.createElement(TabList, { ...props, ...tabs }),
|
|
211
|
+
react_1.default.createElement(TabContent, { ...props, ...tabs })
|
|
170
212
|
);
|
|
171
213
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
214
|
+
function CodeTabs(props) {
|
|
215
|
+
const isBrowser = (0, useIsBrowser_1.default)();
|
|
216
|
+
return react_1.default.createElement(
|
|
217
|
+
TabsComponent,
|
|
218
|
+
// Remount tabs after hydration
|
|
219
|
+
// Temporary fix for https://github.com/facebook/docusaurus/issues/5653
|
|
220
|
+
{
|
|
177
221
|
// Remount tabs after hydration
|
|
178
222
|
// Temporary fix for https://github.com/facebook/docusaurus/issues/5653
|
|
179
|
-
key
|
|
180
|
-
|
|
181
|
-
|
|
223
|
+
key: String(isBrowser),
|
|
224
|
+
...props,
|
|
225
|
+
},
|
|
226
|
+
(0, internal_1.sanitizeTabsChildren)(props.children)
|
|
182
227
|
);
|
|
183
228
|
}
|
|
229
|
+
exports.default = CodeTabs;
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
padding: 0.4rem 0.5rem;
|
|
12
12
|
opacity: 0;
|
|
13
13
|
visibility: hidden;
|
|
14
|
-
transition:
|
|
14
|
+
transition:
|
|
15
|
+
opacity 0.2s ease-in-out,
|
|
16
|
+
visibility 0.2s ease-in-out,
|
|
15
17
|
bottom 0.2s ease-in-out;
|
|
16
18
|
position: absolute;
|
|
17
19
|
right: calc(var(--ifm-pre-padding) / 2);
|
|
@@ -42,10 +42,10 @@ function ParamMultiSelectFormItem({ param }) {
|
|
|
42
42
|
const paramTypeToWatch = pathParams.length
|
|
43
43
|
? pathParams
|
|
44
44
|
: queryParams.length
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
? queryParams
|
|
46
|
+
: cookieParams.length
|
|
47
|
+
? cookieParams
|
|
48
|
+
: headerParams;
|
|
49
49
|
const handleChange = (e, onChange) => {
|
|
50
50
|
const values = Array.prototype.filter
|
|
51
51
|
.call(e.target.options, (o) => o.selected)
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
background-color: var(--ifm-pre-background);
|
|
3
3
|
border-radius: var(--openapi-card-border-radius);
|
|
4
4
|
border: 1px solid var(--openapi-explorer-border-color);
|
|
5
|
-
box-shadow:
|
|
5
|
+
box-shadow:
|
|
6
|
+
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
6
7
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
7
8
|
color: var(--ifm-pre-color);
|
|
8
9
|
line-height: var(--ifm-pre-line-height);
|
|
@@ -19,7 +20,8 @@
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
&:hover {
|
|
22
|
-
box-shadow:
|
|
23
|
+
box-shadow:
|
|
24
|
+
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
23
25
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
24
26
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
25
27
|
}
|
|
@@ -112,10 +114,6 @@
|
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
|
|
115
|
-
.openapi-security__summary-container {
|
|
116
|
-
background: var(--ifm-pre-background);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
117
|
// Prevent auto zoom on mobile iOS devices when focusing on input elmenents
|
|
120
118
|
@media screen and (-webkit-min-device-pixel-ratio: 0) and (max-device-width: 1024px) {
|
|
121
119
|
.prism-code,
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
background-color: var(--ifm-pre-background);
|
|
3
3
|
border-radius: var(--openapi-card-border-radius);
|
|
4
4
|
border: 1px solid var(--openapi-explorer-border-color);
|
|
5
|
-
box-shadow:
|
|
5
|
+
box-shadow:
|
|
6
|
+
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
6
7
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
7
8
|
color: var(--ifm-pre-color);
|
|
8
9
|
line-height: var(--ifm-pre-line-height);
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
transition: 300ms;
|
|
13
14
|
|
|
14
15
|
&:hover {
|
|
15
|
-
box-shadow:
|
|
16
|
+
box-shadow:
|
|
17
|
+
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
16
18
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
17
19
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
18
20
|
}
|
|
@@ -58,8 +58,8 @@ function Response({ item }) {
|
|
|
58
58
|
(parseInt(code) >= 400
|
|
59
59
|
? "openapi-response__dot--danger"
|
|
60
60
|
: parseInt(code) >= 200 && parseInt(code) < 300
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
? "openapi-response__dot--success"
|
|
62
|
+
: "openapi-response__dot--info");
|
|
63
63
|
if (!item.servers || hideSendButton) {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
@@ -101,7 +101,10 @@ function Response({ item }) {
|
|
|
101
101
|
"div",
|
|
102
102
|
{
|
|
103
103
|
style: {
|
|
104
|
-
backgroundColor:
|
|
104
|
+
backgroundColor:
|
|
105
|
+
code && prettyResponse !== "Fetching..."
|
|
106
|
+
? prismTheme.plain.backgroundColor
|
|
107
|
+
: "transparent",
|
|
105
108
|
paddingLeft: "1rem",
|
|
106
109
|
paddingTop: "1rem",
|
|
107
110
|
...((prettyResponse === "Fetching..." || !code) && {
|
|
@@ -165,25 +168,25 @@ function Response({ item }) {
|
|
|
165
168
|
)
|
|
166
169
|
)
|
|
167
170
|
: prettyResponse === "Fetching..."
|
|
168
|
-
|
|
169
|
-
"div",
|
|
170
|
-
{ className: "openapi-explorer__loading-container" },
|
|
171
|
-
react_1.default.createElement(
|
|
171
|
+
? react_1.default.createElement(
|
|
172
172
|
"div",
|
|
173
|
-
{ className: "openapi-
|
|
174
|
-
react_1.default.createElement(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
{ className: "openapi-explorer__loading-container" },
|
|
174
|
+
react_1.default.createElement(
|
|
175
|
+
"div",
|
|
176
|
+
{ className: "openapi-response__lds-ring" },
|
|
177
|
+
react_1.default.createElement("div", null),
|
|
178
|
+
react_1.default.createElement("div", null),
|
|
179
|
+
react_1.default.createElement("div", null),
|
|
180
|
+
react_1.default.createElement("div", null)
|
|
181
|
+
)
|
|
182
|
+
)
|
|
183
|
+
: react_1.default.createElement(
|
|
184
|
+
"p",
|
|
185
|
+
{ className: "openapi-explorer__response-placeholder-message" },
|
|
186
|
+
"Click the ",
|
|
187
|
+
react_1.default.createElement("code", null, "Send API Request"),
|
|
188
|
+
" button above and see the response here!"
|
|
178
189
|
)
|
|
179
|
-
)
|
|
180
|
-
: react_1.default.createElement(
|
|
181
|
-
"p",
|
|
182
|
-
{ className: "openapi-explorer__response-placeholder-message" },
|
|
183
|
-
"Click the ",
|
|
184
|
-
react_1.default.createElement("code", null, "Send API Request"),
|
|
185
|
-
" button above and see the response here!"
|
|
186
|
-
)
|
|
187
190
|
)
|
|
188
191
|
);
|
|
189
192
|
}
|
|
@@ -18,15 +18,11 @@ const CodeSnippets_1 = __importDefault(
|
|
|
18
18
|
const Request_1 = __importDefault(require("@theme/ApiExplorer/Request"));
|
|
19
19
|
const Response_1 = __importDefault(require("@theme/ApiExplorer/Response"));
|
|
20
20
|
const postman_collection_1 = __importDefault(require("postman-collection"));
|
|
21
|
-
const SecuritySchemes_1 = __importDefault(require("./SecuritySchemes"));
|
|
22
21
|
function ApiExplorer({ item, infoPath }) {
|
|
23
22
|
const postman = new postman_collection_1.default.Request(item.postman);
|
|
24
23
|
return react_1.default.createElement(
|
|
25
24
|
react_1.default.Fragment,
|
|
26
25
|
null,
|
|
27
|
-
react_1.default.createElement(SecuritySchemes_1.default, {
|
|
28
|
-
infoPath: infoPath,
|
|
29
|
-
}),
|
|
30
26
|
item.method !== "event" &&
|
|
31
27
|
react_1.default.createElement(CodeSnippets_1.default, {
|
|
32
28
|
postman: postman,
|
|
@@ -32,12 +32,12 @@ function createPersistanceMiddleware(options) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
// TODO: determine way to rehydrate without flashing
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
if (action.type === "contentType/setContentType") {
|
|
36
|
+
storage.setItem("contentType", action.payload);
|
|
37
|
+
}
|
|
38
|
+
if (action.type === "accept/setAccept") {
|
|
39
|
+
storage.setItem("accept", action.payload);
|
|
40
|
+
}
|
|
41
41
|
if (action.type === "server/setServer") {
|
|
42
42
|
storage.setItem("server", action.payload);
|
|
43
43
|
}
|
|
@@ -22,6 +22,7 @@ const Desktop_1 = __importDefault(require("@theme/DocItem/TOC/Desktop"));
|
|
|
22
22
|
const Mobile_1 = __importDefault(require("@theme/DocItem/TOC/Mobile"));
|
|
23
23
|
const DocVersionBadge_1 = __importDefault(require("@theme/DocVersionBadge"));
|
|
24
24
|
const DocVersionBanner_1 = __importDefault(require("@theme/DocVersionBanner"));
|
|
25
|
+
const Unlisted_1 = __importDefault(require("@theme/Unlisted"));
|
|
25
26
|
const clsx_1 = __importDefault(require("clsx"));
|
|
26
27
|
const styles_module_css_1 = __importDefault(require("./styles.module.css"));
|
|
27
28
|
/**
|
|
@@ -48,6 +49,7 @@ function useDocTOC() {
|
|
|
48
49
|
function DocItemLayout({ children }) {
|
|
49
50
|
const docTOC = useDocTOC();
|
|
50
51
|
const {
|
|
52
|
+
metadata: { unlisted },
|
|
51
53
|
frontMatter: { api },
|
|
52
54
|
} = (0, internal_1.useDoc)();
|
|
53
55
|
return react_1.default.createElement(
|
|
@@ -61,6 +63,7 @@ function DocItemLayout({ children }) {
|
|
|
61
63
|
!docTOC.hidden && styles_module_css_1.default.docItemCol
|
|
62
64
|
),
|
|
63
65
|
},
|
|
66
|
+
unlisted && react_1.default.createElement(Unlisted_1.default, null),
|
|
64
67
|
react_1.default.createElement(DocVersionBanner_1.default, null),
|
|
65
68
|
react_1.default.createElement(
|
|
66
69
|
"div",
|
|
@@ -18,6 +18,7 @@ const ExecutionEnvironment_1 = __importDefault(
|
|
|
18
18
|
require("@docusaurus/ExecutionEnvironment")
|
|
19
19
|
);
|
|
20
20
|
const theme_common_1 = require("@docusaurus/theme-common");
|
|
21
|
+
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
21
22
|
const useDocusaurusContext_1 = __importDefault(
|
|
22
23
|
require("@docusaurus/useDocusaurusContext")
|
|
23
24
|
);
|
|
@@ -29,13 +30,13 @@ const Metadata_1 = __importDefault(require("@theme/DocItem/Metadata"));
|
|
|
29
30
|
const clsx_1 = __importDefault(require("clsx"));
|
|
30
31
|
const react_redux_1 = require("react-redux");
|
|
31
32
|
const store_1 = require("./store");
|
|
32
|
-
const { DocProvider } = require("@docusaurus/theme-common/internal");
|
|
33
33
|
let ApiExplorer = (_) => react_1.default.createElement("div", null);
|
|
34
34
|
if (ExecutionEnvironment_1.default.canUseDOM) {
|
|
35
35
|
ApiExplorer = require("@theme/ApiExplorer").default;
|
|
36
36
|
}
|
|
37
|
+
// @ts-ignore
|
|
37
38
|
function ApiItem(props) {
|
|
38
|
-
const docHtmlClassName = `docs-doc-id-${props.content.metadata.
|
|
39
|
+
const docHtmlClassName = `docs-doc-id-${props.content.metadata.id}`;
|
|
39
40
|
const MDXComponent = props.content;
|
|
40
41
|
const { frontMatter } = MDXComponent;
|
|
41
42
|
const { info_path: infoPath } = frontMatter;
|
|
@@ -121,7 +122,7 @@ function ApiItem(props) {
|
|
|
121
122
|
}
|
|
122
123
|
if (api) {
|
|
123
124
|
return react_1.default.createElement(
|
|
124
|
-
DocProvider,
|
|
125
|
+
internal_1.DocProvider,
|
|
125
126
|
{ content: props.content },
|
|
126
127
|
react_1.default.createElement(
|
|
127
128
|
theme_common_1.HtmlClassNameProvider,
|
|
@@ -168,7 +169,7 @@ function ApiItem(props) {
|
|
|
168
169
|
);
|
|
169
170
|
} else if (schema) {
|
|
170
171
|
return react_1.default.createElement(
|
|
171
|
-
DocProvider,
|
|
172
|
+
internal_1.DocProvider,
|
|
172
173
|
{ content: props.content },
|
|
173
174
|
react_1.default.createElement(
|
|
174
175
|
theme_common_1.HtmlClassNameProvider,
|
|
@@ -192,7 +193,7 @@ function ApiItem(props) {
|
|
|
192
193
|
}
|
|
193
194
|
// Non-API docs
|
|
194
195
|
return react_1.default.createElement(
|
|
195
|
-
DocProvider,
|
|
196
|
+
internal_1.DocProvider,
|
|
196
197
|
{ content: props.content },
|
|
197
198
|
react_1.default.createElement(
|
|
198
199
|
theme_common_1.HtmlClassNameProvider,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export default function ApiLogo(props: any): JSX.Element | undefined;
|
|
1
|
+
import React from "react";
|
|
2
|
+
export default function ApiLogo(props: any): React.JSX.Element | undefined;
|