docusaurus-theme-openapi-docs 0.0.0-736 → 0.0.0-738
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/ApiExplorer/CodeTabs/_CodeTabs.scss +2 -4
- package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +1 -3
- package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +1 -2
- package/lib/theme/ApiExplorer/Request/_Request.scss +2 -4
- package/lib/theme/ApiExplorer/Response/_Response.scss +2 -4
- package/lib/theme/styles.scss +15 -15
- package/package.json +3 -3
- package/src/index.ts +1 -1
- package/src/markdown/schema.ts +3 -3
- package/src/markdown/utils.ts +1 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.js +1 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +1 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.js +4 -4
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +1 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +1 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +4 -4
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.js +1 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +1 -1
- package/src/theme/ApiExplorer/Authorization/index.tsx +5 -5
- package/src/theme/ApiExplorer/Authorization/slice.ts +1 -1
- package/src/theme/ApiExplorer/Body/index.tsx +4 -4
- package/src/theme/ApiExplorer/Body/slice.ts +2 -2
- package/src/theme/ApiExplorer/CodeSnippets/index.tsx +7 -7
- package/src/theme/ApiExplorer/CodeSnippets/languages.ts +4 -4
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +2 -4
- package/src/theme/ApiExplorer/CodeTabs/index.js +7 -7
- package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +1 -3
- package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +1 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +1 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +1 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +5 -5
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +1 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +1 -1
- package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +1 -2
- package/src/theme/ApiExplorer/Request/_Request.scss +2 -4
- package/src/theme/ApiExplorer/Request/index.tsx +1 -1
- package/src/theme/ApiExplorer/Request/makeRequest.ts +3 -3
- package/src/theme/ApiExplorer/Response/_Response.scss +2 -4
- package/src/theme/ApiExplorer/Response/index.tsx +2 -2
- package/src/theme/ApiExplorer/Server/index.tsx +8 -8
- package/src/theme/ApiExplorer/Server/slice.ts +1 -1
- package/src/theme/ApiExplorer/buildPostmanRequest.ts +3 -3
- package/src/theme/ApiExplorer/persistanceMiddleware.ts +1 -1
- package/src/theme/ApiItem/index.tsx +3 -3
- package/src/theme/ApiItem/store.ts +2 -2
- package/src/theme/ApiTabs/index.js +6 -6
- package/src/theme/DiscriminatorTabs/index.js +4 -4
- package/src/theme/MimeTabs/index.js +4 -4
- package/src/theme/OperationTabs/index.js +4 -4
- package/src/theme/ParamsItem/index.js +3 -3
- package/src/theme/SchemaItem/index.js +1 -1
- package/src/theme/SchemaTabs/index.js +4 -4
- package/src/theme/styles.scss +15 -15
- package/src/theme-openapi.d.ts +5 -5
|
@@ -18,14 +18,12 @@
|
|
|
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:
|
|
22
|
-
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
21
|
+
box-shadow: 0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
23
22
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
24
23
|
transition: 300ms;
|
|
25
24
|
|
|
26
25
|
&:hover {
|
|
27
|
-
box-shadow:
|
|
28
|
-
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
26
|
+
box-shadow: 0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
29
27
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
30
28
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
31
29
|
}
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
padding: 0.4rem 0.5rem;
|
|
12
12
|
opacity: 0;
|
|
13
13
|
visibility: hidden;
|
|
14
|
-
transition:
|
|
15
|
-
opacity 0.2s ease-in-out,
|
|
16
|
-
visibility 0.2s ease-in-out,
|
|
14
|
+
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out,
|
|
17
15
|
bottom 0.2s ease-in-out;
|
|
18
16
|
position: absolute;
|
|
19
17
|
right: calc(var(--ifm-pre-padding) / 2);
|
|
@@ -2,8 +2,7 @@
|
|
|
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:
|
|
6
|
-
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
5
|
+
box-shadow: 0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
7
6
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
8
7
|
color: var(--ifm-pre-color);
|
|
9
8
|
line-height: var(--ifm-pre-line-height);
|
|
@@ -20,8 +19,7 @@
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
&:hover {
|
|
23
|
-
box-shadow:
|
|
24
|
-
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
22
|
+
box-shadow: 0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
25
23
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
26
24
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
27
25
|
}
|
|
@@ -2,8 +2,7 @@
|
|
|
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:
|
|
6
|
-
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
5
|
+
box-shadow: 0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
7
6
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
8
7
|
color: var(--ifm-pre-color);
|
|
9
8
|
line-height: var(--ifm-pre-line-height);
|
|
@@ -13,8 +12,7 @@
|
|
|
13
12
|
transition: 300ms;
|
|
14
13
|
|
|
15
14
|
&:hover {
|
|
16
|
-
box-shadow:
|
|
17
|
-
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
15
|
+
box-shadow: 0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
18
16
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
19
17
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
20
18
|
}
|
package/lib/theme/styles.scss
CHANGED
|
@@ -130,22 +130,22 @@
|
|
|
130
130
|
|
|
131
131
|
/* Version button */
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
.version-button div {
|
|
134
|
+
display: block;
|
|
135
|
+
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
137
|
+
.version-button div > button > span::after {
|
|
138
|
+
border-color: currentcolor transparent;
|
|
139
|
+
border-style: solid;
|
|
140
|
+
border-width: 0.4em 0.4em 0;
|
|
141
|
+
content: "";
|
|
142
|
+
margin-left: 0.3em;
|
|
143
|
+
position: relative;
|
|
144
|
+
transform: translateY(-50%);
|
|
145
|
+
display: inline-block;
|
|
146
|
+
font-size: 0.8rem;
|
|
147
|
+
top: 1px;
|
|
148
|
+
}
|
|
149
149
|
|
|
150
150
|
.openapi__logo {
|
|
151
151
|
width: 250px;
|
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-
|
|
4
|
+
"version": "0.0.0-738",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"clsx": "^1.1.1",
|
|
42
42
|
"copy-text-to-clipboard": "^3.1.0",
|
|
43
43
|
"crypto-js": "^4.1.1",
|
|
44
|
-
"docusaurus-plugin-openapi-docs": "0.0.0-
|
|
44
|
+
"docusaurus-plugin-openapi-docs": "0.0.0-738",
|
|
45
45
|
"docusaurus-plugin-sass": "^0.2.3",
|
|
46
46
|
"file-saver": "^2.0.5",
|
|
47
47
|
"lodash": "^4.17.20",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "4c48921ed3b574960f207d9f5ce8f9de6feab169"
|
|
72
72
|
}
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ export default function docusaurusThemeOpenAPI(): Plugin<void> {
|
|
|
18
18
|
getClientModules() {
|
|
19
19
|
const modules = [
|
|
20
20
|
require.resolve(
|
|
21
|
-
path.join(__dirname, "..", "lib", "theme", "styles.scss")
|
|
21
|
+
path.join(__dirname, "..", "lib", "theme", "styles.scss")
|
|
22
22
|
),
|
|
23
23
|
];
|
|
24
24
|
return modules;
|
package/src/markdown/schema.ts
CHANGED
|
@@ -45,7 +45,7 @@ function prettyName(schema: SchemaObject, circular?: boolean) {
|
|
|
45
45
|
|
|
46
46
|
export function getSchemaName(
|
|
47
47
|
schema: SchemaObject,
|
|
48
|
-
circular?: boolean
|
|
48
|
+
circular?: boolean
|
|
49
49
|
): string {
|
|
50
50
|
if (schema.items) {
|
|
51
51
|
return prettyName(schema.items, circular) + "[]";
|
|
@@ -79,7 +79,7 @@ export function getQualifierMessage(schema?: SchemaObject): string | undefined {
|
|
|
79
79
|
if (schema.items && schema.items.enum) {
|
|
80
80
|
if (schema.items.enum) {
|
|
81
81
|
qualifierGroups.push(
|
|
82
|
-
`[${schema.items.enum.map((e) => `\`${e}\``).join(", ")}]
|
|
82
|
+
`[${schema.items.enum.map((e) => `\`${e}\``).join(", ")}]`
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -150,7 +150,7 @@ export function getQualifierMessage(schema?: SchemaObject): string | undefined {
|
|
|
150
150
|
|
|
151
151
|
if (schema.pattern) {
|
|
152
152
|
qualifierGroups.push(
|
|
153
|
-
`Value must match regular expression \`${schema.pattern}
|
|
153
|
+
`Value must match regular expression \`${schema.pattern}\``
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
156
|
|
package/src/markdown/utils.ts
CHANGED
|
@@ -22,7 +22,7 @@ export function create(tag: string, props: Props): string {
|
|
|
22
22
|
|
|
23
23
|
export function guard<T>(
|
|
24
24
|
value: T | undefined | string,
|
|
25
|
-
cb: (value: T) => Children
|
|
25
|
+
cb: (value: T) => Children
|
|
26
26
|
): string {
|
|
27
27
|
if (!!value || value === 0) {
|
|
28
28
|
const children = cb(value as T);
|
|
@@ -21,7 +21,7 @@ export default function CodeBlockJSX({ children, className }) {
|
|
|
21
21
|
className={clsx(
|
|
22
22
|
"openapi-explorer__code-block-standalone",
|
|
23
23
|
"thin-scrollbar",
|
|
24
|
-
className
|
|
24
|
+
className
|
|
25
25
|
)}
|
|
26
26
|
>
|
|
27
27
|
<code className="openapi-explorer__code-block-lines">{children}</code>
|
|
@@ -57,7 +57,7 @@ export default function CodeBlockString({
|
|
|
57
57
|
blockClassName,
|
|
58
58
|
language &&
|
|
59
59
|
!blockClassName.includes(`language-${language}`) &&
|
|
60
|
-
`language-${language}
|
|
60
|
+
`language-${language}`
|
|
61
61
|
)}
|
|
62
62
|
>
|
|
63
63
|
{title && (
|
|
@@ -78,14 +78,14 @@ export default function CodeBlockString({
|
|
|
78
78
|
className={clsx(
|
|
79
79
|
className,
|
|
80
80
|
"openapi-explorer__code-block",
|
|
81
|
-
"thin-scrollbar"
|
|
81
|
+
"thin-scrollbar"
|
|
82
82
|
)}
|
|
83
83
|
>
|
|
84
84
|
<code
|
|
85
85
|
className={clsx(
|
|
86
86
|
"openapi-explorer__code-block-lines",
|
|
87
87
|
showLineNumbers &&
|
|
88
|
-
"openapi-explorer__code-block-lines-numbering"
|
|
88
|
+
"openapi-explorer__code-block-lines-numbering"
|
|
89
89
|
)}
|
|
90
90
|
>
|
|
91
91
|
{tokens.map((line, i) => (
|
|
@@ -117,7 +117,7 @@ export default function CodeBlockString({
|
|
|
117
117
|
<ExpandButton
|
|
118
118
|
className={clsx(
|
|
119
119
|
"openapi-explorer__code-block-code-btn",
|
|
120
|
-
"openapi-explorer__expand-btn"
|
|
120
|
+
"openapi-explorer__expand-btn"
|
|
121
121
|
)}
|
|
122
122
|
code={code}
|
|
123
123
|
language={language}
|
|
@@ -48,7 +48,7 @@ export default function CopyButton({ code, className }) {
|
|
|
48
48
|
"clean-btn",
|
|
49
49
|
className,
|
|
50
50
|
"openapi-explorer__code-block-copy-btn",
|
|
51
|
-
isCopied && "openapi-explorer__code-block-copy-btn--copied"
|
|
51
|
+
isCopied && "openapi-explorer__code-block-copy-btn--copied"
|
|
52
52
|
)}
|
|
53
53
|
onClick={handleCopyCode}
|
|
54
54
|
>
|
|
@@ -59,7 +59,7 @@ export default function ExpandButton({
|
|
|
59
59
|
"clean-btn",
|
|
60
60
|
className,
|
|
61
61
|
"openapi-explorer__code-block-expand-btn",
|
|
62
|
-
isModalOpen && "openapi-explorer__code-block-expand-btn--copied"
|
|
62
|
+
isModalOpen && "openapi-explorer__code-block-expand-btn--copied"
|
|
63
63
|
)}
|
|
64
64
|
onClick={() => setIsModalOpen(true)}
|
|
65
65
|
>
|
|
@@ -94,7 +94,7 @@ export default function ExpandButton({
|
|
|
94
94
|
"openapi-explorer__code-block-container",
|
|
95
95
|
language &&
|
|
96
96
|
!blockClassName.includes(`language-${language}`) &&
|
|
97
|
-
`language-${language}
|
|
97
|
+
`language-${language}`
|
|
98
98
|
)}
|
|
99
99
|
>
|
|
100
100
|
{title && (
|
|
@@ -114,14 +114,14 @@ export default function ExpandButton({
|
|
|
114
114
|
className={clsx(
|
|
115
115
|
className,
|
|
116
116
|
"openapi-explorer__code-block",
|
|
117
|
-
"thin-scrollbar"
|
|
117
|
+
"thin-scrollbar"
|
|
118
118
|
)}
|
|
119
119
|
>
|
|
120
120
|
<code
|
|
121
121
|
className={clsx(
|
|
122
122
|
"openapi-explorer__code-block-lines",
|
|
123
123
|
showLineNumbers &&
|
|
124
|
-
"openapi-explorer__code-block-lines-numbers"
|
|
124
|
+
"openapi-explorer__code-block-lines-numbers"
|
|
125
125
|
)}
|
|
126
126
|
>
|
|
127
127
|
{tokens.map((line, i) => (
|
|
@@ -23,7 +23,7 @@ export default function CodeBlockLine({
|
|
|
23
23
|
line,
|
|
24
24
|
className: clsx(
|
|
25
25
|
classNames,
|
|
26
|
-
showLineNumbers && "openapi-explorer__code-block-code-line"
|
|
26
|
+
showLineNumbers && "openapi-explorer__code-block-code-line"
|
|
27
27
|
),
|
|
28
28
|
});
|
|
29
29
|
const lineTokens = line.map((token, key) => (
|
|
@@ -24,7 +24,7 @@ export default function WordWrapButton({ className, onClick, isEnabled }) {
|
|
|
24
24
|
className={clsx(
|
|
25
25
|
"clean-btn",
|
|
26
26
|
className,
|
|
27
|
-
isEnabled && "openapi-explorer__code-block-word-wrap-btn--enabled"
|
|
27
|
+
isEnabled && "openapi-explorer__code-block-word-wrap-btn--enabled"
|
|
28
28
|
)}
|
|
29
29
|
aria-label={title}
|
|
30
30
|
title={title}
|
|
@@ -56,7 +56,7 @@ function Authorization() {
|
|
|
56
56
|
scheme: a.key,
|
|
57
57
|
key: "token",
|
|
58
58
|
value: value ? value : undefined,
|
|
59
|
-
})
|
|
59
|
+
})
|
|
60
60
|
);
|
|
61
61
|
}}
|
|
62
62
|
/>
|
|
@@ -77,7 +77,7 @@ function Authorization() {
|
|
|
77
77
|
scheme: a.key,
|
|
78
78
|
key: "token",
|
|
79
79
|
value: value ? value : undefined,
|
|
80
|
-
})
|
|
80
|
+
})
|
|
81
81
|
);
|
|
82
82
|
}}
|
|
83
83
|
/>
|
|
@@ -99,7 +99,7 @@ function Authorization() {
|
|
|
99
99
|
scheme: a.key,
|
|
100
100
|
key: "username",
|
|
101
101
|
value: value ? value : undefined,
|
|
102
|
-
})
|
|
102
|
+
})
|
|
103
103
|
);
|
|
104
104
|
}}
|
|
105
105
|
/>
|
|
@@ -116,7 +116,7 @@ function Authorization() {
|
|
|
116
116
|
scheme: a.key,
|
|
117
117
|
key: "password",
|
|
118
118
|
value: value ? value : undefined,
|
|
119
|
-
})
|
|
119
|
+
})
|
|
120
120
|
);
|
|
121
121
|
}}
|
|
122
122
|
/>
|
|
@@ -138,7 +138,7 @@ function Authorization() {
|
|
|
138
138
|
scheme: a.key,
|
|
139
139
|
key: "apiKey",
|
|
140
140
|
value: value ? value : undefined,
|
|
141
|
-
})
|
|
141
|
+
})
|
|
142
142
|
);
|
|
143
143
|
}}
|
|
144
144
|
/>
|
|
@@ -130,7 +130,7 @@ export const slice = createSlice({
|
|
|
130
130
|
reducers: {
|
|
131
131
|
setAuthData: (
|
|
132
132
|
state,
|
|
133
|
-
action: PayloadAction<{ scheme: string; key: string; value?: string }
|
|
133
|
+
action: PayloadAction<{ scheme: string; key: string; value?: string }>
|
|
134
134
|
) => {
|
|
135
135
|
const { scheme, key, value } = action.payload;
|
|
136
136
|
state.data[scheme][key] = value;
|
|
@@ -108,7 +108,7 @@ function Body({
|
|
|
108
108
|
setFileRawBody({
|
|
109
109
|
src: `/path/to/${file.name}`,
|
|
110
110
|
content: file,
|
|
111
|
-
})
|
|
111
|
+
})
|
|
112
112
|
);
|
|
113
113
|
}}
|
|
114
114
|
/>
|
|
@@ -148,7 +148,7 @@ function Body({
|
|
|
148
148
|
src: `/path/to/${file.name}`,
|
|
149
149
|
content: file,
|
|
150
150
|
},
|
|
151
|
-
})
|
|
151
|
+
})
|
|
152
152
|
);
|
|
153
153
|
}}
|
|
154
154
|
/>
|
|
@@ -177,7 +177,7 @@ function Body({
|
|
|
177
177
|
setStringFormBody({
|
|
178
178
|
key: key,
|
|
179
179
|
value: val,
|
|
180
|
-
})
|
|
180
|
+
})
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
183
|
}}
|
|
@@ -204,7 +204,7 @@ function Body({
|
|
|
204
204
|
placeholder={val.description || key}
|
|
205
205
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
206
206
|
dispatch(
|
|
207
|
-
setStringFormBody({ key: key, value: e.target.value })
|
|
207
|
+
setStringFormBody({ key: key, value: e.target.value })
|
|
208
208
|
);
|
|
209
209
|
}}
|
|
210
210
|
/>
|
|
@@ -78,7 +78,7 @@ export const slice = createSlice({
|
|
|
78
78
|
},
|
|
79
79
|
setStringFormBody: (
|
|
80
80
|
state,
|
|
81
|
-
action: PayloadAction<{ key: string; value: string }
|
|
81
|
+
action: PayloadAction<{ key: string; value: string }>
|
|
82
82
|
) => {
|
|
83
83
|
if (state?.type !== "form") {
|
|
84
84
|
return {
|
|
@@ -99,7 +99,7 @@ export const slice = createSlice({
|
|
|
99
99
|
},
|
|
100
100
|
setFileFormBody: (
|
|
101
101
|
state,
|
|
102
|
-
action: PayloadAction<{ key: string; value: FileContent["value"] }
|
|
102
|
+
action: PayloadAction<{ key: string; value: FileContent["value"] }>
|
|
103
103
|
) => {
|
|
104
104
|
if (state?.type !== "form") {
|
|
105
105
|
return {
|
|
@@ -186,7 +186,7 @@ function CodeSnippets({ postman, codeSamples }: Props) {
|
|
|
186
186
|
// Merge user-defined langs into languageSet
|
|
187
187
|
const mergedLangs = mergeCodeSampleLanguage(
|
|
188
188
|
mergeArraysbyLanguage(userDefinedLanguageSet, filteredLanguageSet),
|
|
189
|
-
codeSamples
|
|
189
|
+
codeSamples
|
|
190
190
|
);
|
|
191
191
|
|
|
192
192
|
console.log("merged", mergedLangs);
|
|
@@ -194,7 +194,7 @@ function CodeSnippets({ postman, codeSamples }: Props) {
|
|
|
194
194
|
// Read defaultLang from localStorage
|
|
195
195
|
const defaultLang: Language[] = mergedLangs.filter(
|
|
196
196
|
(lang) =>
|
|
197
|
-
lang.language === localStorage.getItem("docusaurus.tab.code-samples")
|
|
197
|
+
lang.language === localStorage.getItem("docusaurus.tab.code-samples")
|
|
198
198
|
);
|
|
199
199
|
const [selectedVariant, setSelectedVariant] = useState<string | undefined>();
|
|
200
200
|
const [selectedSample, setSelectedSample] = useState<string | undefined>();
|
|
@@ -238,11 +238,11 @@ function CodeSnippets({ postman, codeSamples }: Props) {
|
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
240
|
setCodeText(snippet);
|
|
241
|
-
}
|
|
241
|
+
}
|
|
242
242
|
);
|
|
243
243
|
} else if (language && !language.options) {
|
|
244
244
|
const langSource = mergedLangs.filter(
|
|
245
|
-
(lang) => lang.language === language.language
|
|
245
|
+
(lang) => lang.language === language.language
|
|
246
246
|
);
|
|
247
247
|
|
|
248
248
|
// Merges user-defined language with default languageSet
|
|
@@ -271,7 +271,7 @@ function CodeSnippets({ postman, codeSamples }: Props) {
|
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
273
|
setCodeText(snippet);
|
|
274
|
-
}
|
|
274
|
+
}
|
|
275
275
|
);
|
|
276
276
|
} else {
|
|
277
277
|
setCodeText("");
|
|
@@ -314,7 +314,7 @@ function CodeSnippets({ postman, codeSamples }: Props) {
|
|
|
314
314
|
return;
|
|
315
315
|
}
|
|
316
316
|
setCodeText(snippet);
|
|
317
|
-
}
|
|
317
|
+
}
|
|
318
318
|
);
|
|
319
319
|
}
|
|
320
320
|
});
|
|
@@ -329,7 +329,7 @@ function CodeSnippets({ postman, codeSamples }: Props) {
|
|
|
329
329
|
selectedSample !== language.sample
|
|
330
330
|
) {
|
|
331
331
|
const sampleIndex = language.samples.findIndex(
|
|
332
|
-
(smp) => smp === selectedSample
|
|
332
|
+
(smp) => smp === selectedSample
|
|
333
333
|
);
|
|
334
334
|
setCodeSampleCodeText(language.samplesSources[sampleIndex]);
|
|
335
335
|
}
|
|
@@ -14,17 +14,17 @@ import { CodeSample, Language } from "./code-snippets-types";
|
|
|
14
14
|
|
|
15
15
|
export function mergeCodeSampleLanguage(
|
|
16
16
|
languages: Language[],
|
|
17
|
-
codeSamples: CodeSample[]
|
|
17
|
+
codeSamples: CodeSample[]
|
|
18
18
|
): Language[] {
|
|
19
19
|
return languages.map((language) => {
|
|
20
20
|
const languageCodeSamples = codeSamples.filter(
|
|
21
|
-
({ lang }) => lang === language.codeSampleLanguage
|
|
21
|
+
({ lang }) => lang === language.codeSampleLanguage
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
if (languageCodeSamples.length) {
|
|
25
25
|
const samples = languageCodeSamples.map(({ lang }) => lang);
|
|
26
26
|
const samplesLabels = languageCodeSamples.map(
|
|
27
|
-
({ label, lang }) => label || lang
|
|
27
|
+
({ label, lang }) => label || lang
|
|
28
28
|
);
|
|
29
29
|
const samplesSources = languageCodeSamples.map(({ source }) => source);
|
|
30
30
|
|
|
@@ -66,7 +66,7 @@ export function getCodeSampleSourceFromLanguage(language: Language) {
|
|
|
66
66
|
language.samplesSources
|
|
67
67
|
) {
|
|
68
68
|
const sampleIndex = language.samples.findIndex(
|
|
69
|
-
(smp) => smp === language.sample
|
|
69
|
+
(smp) => smp === language.sample
|
|
70
70
|
);
|
|
71
71
|
return language.samplesSources[sampleIndex];
|
|
72
72
|
}
|
|
@@ -18,14 +18,12 @@
|
|
|
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:
|
|
22
|
-
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
21
|
+
box-shadow: 0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
23
22
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
24
23
|
transition: 300ms;
|
|
25
24
|
|
|
26
25
|
&:hover {
|
|
27
|
-
box-shadow:
|
|
28
|
-
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
26
|
+
box-shadow: 0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
29
27
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
30
28
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
31
29
|
}
|
|
@@ -44,19 +44,19 @@ function TabList({
|
|
|
44
44
|
let newLanguage;
|
|
45
45
|
if (currentLanguage && includeVariant) {
|
|
46
46
|
newLanguage = languageSet.filter(
|
|
47
|
-
(lang) => lang.language === currentLanguage
|
|
47
|
+
(lang) => lang.language === currentLanguage
|
|
48
48
|
)[0];
|
|
49
49
|
newLanguage.variant = newTabValue;
|
|
50
50
|
action.setSelectedVariant(newTabValue.toLowerCase());
|
|
51
51
|
} else if (currentLanguage && includeSample) {
|
|
52
52
|
newLanguage = languageSet.filter(
|
|
53
|
-
(lang) => lang.language === currentLanguage
|
|
53
|
+
(lang) => lang.language === currentLanguage
|
|
54
54
|
)[0];
|
|
55
55
|
newLanguage.sample = newTabValue;
|
|
56
56
|
action.setSelectedSample(newTabValue);
|
|
57
57
|
} else {
|
|
58
58
|
newLanguage = languageSet.filter(
|
|
59
|
-
(lang) => lang.language === newTabValue
|
|
59
|
+
(lang) => lang.language === newTabValue
|
|
60
60
|
)[0];
|
|
61
61
|
action.setSelectedVariant(newLanguage.variant.toLowerCase());
|
|
62
62
|
action.setSelectedSample(newLanguage.sample);
|
|
@@ -99,7 +99,7 @@ function TabList({
|
|
|
99
99
|
{
|
|
100
100
|
"tabs--block": block,
|
|
101
101
|
},
|
|
102
|
-
className
|
|
102
|
+
className
|
|
103
103
|
)}
|
|
104
104
|
>
|
|
105
105
|
{tabValues.map(({ value, label, attributes }) => (
|
|
@@ -119,7 +119,7 @@ function TabList({
|
|
|
119
119
|
attributes?.className,
|
|
120
120
|
{
|
|
121
121
|
active: selectedValue === value,
|
|
122
|
-
}
|
|
122
|
+
}
|
|
123
123
|
)}
|
|
124
124
|
>
|
|
125
125
|
<span>{label ?? value}</span>
|
|
@@ -134,7 +134,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
134
134
|
children = Array.isArray(children) ? children : [children];
|
|
135
135
|
if (lazy) {
|
|
136
136
|
const selectedTabItem = children.find(
|
|
137
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
137
|
+
(tabItem) => tabItem.props.value === selectedValue
|
|
138
138
|
);
|
|
139
139
|
if (!selectedTabItem) {
|
|
140
140
|
// fail-safe or fail-fast? not sure what's best here
|
|
@@ -148,7 +148,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
148
148
|
cloneElement(tabItem, {
|
|
149
149
|
key: i,
|
|
150
150
|
hidden: tabItem.props.value !== selectedValue,
|
|
151
|
-
})
|
|
151
|
+
})
|
|
152
152
|
)}
|
|
153
153
|
</div>
|
|
154
154
|
);
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
padding: 0.4rem 0.5rem;
|
|
12
12
|
opacity: 0;
|
|
13
13
|
visibility: hidden;
|
|
14
|
-
transition:
|
|
15
|
-
opacity 0.2s ease-in-out,
|
|
16
|
-
visibility 0.2s ease-in-out,
|
|
14
|
+
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out,
|
|
17
15
|
bottom 0.2s ease-in-out;
|
|
18
16
|
position: absolute;
|
|
19
17
|
right: calc(var(--ifm-pre-padding) / 2);
|
|
@@ -48,7 +48,7 @@ function MethodEndpoint({ method, path }: Props) {
|
|
|
48
48
|
Object.keys(serverValue.variables).forEach((variable) => {
|
|
49
49
|
serverUrlWithVariables = serverUrlWithVariables.replace(
|
|
50
50
|
`{${variable}}`,
|
|
51
|
-
serverValue.variables?.[variable].default ?? ""
|
|
51
|
+
serverValue.variables?.[variable].default ?? ""
|
|
52
52
|
);
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -37,10 +37,10 @@ export default function ParamMultiSelectFormItem({ param }: ParamProps) {
|
|
|
37
37
|
const paramTypeToWatch = pathParams.length
|
|
38
38
|
? pathParams
|
|
39
39
|
: queryParams.length
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
? queryParams
|
|
41
|
+
: cookieParams.length
|
|
42
|
+
? cookieParams
|
|
43
|
+
: headerParams;
|
|
44
44
|
|
|
45
45
|
const handleChange = (e: any, onChange: any) => {
|
|
46
46
|
const values = Array.prototype.filter
|
|
@@ -51,7 +51,7 @@ export default function ParamMultiSelectFormItem({ param }: ParamProps) {
|
|
|
51
51
|
setParam({
|
|
52
52
|
...param,
|
|
53
53
|
value: values.length > 0 ? values : undefined,
|
|
54
|
-
})
|
|
54
|
+
})
|
|
55
55
|
);
|
|
56
56
|
|
|
57
57
|
onChange(paramTypeToWatch);
|
|
@@ -2,8 +2,7 @@
|
|
|
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:
|
|
6
|
-
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
5
|
+
box-shadow: 0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
7
6
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
8
7
|
color: var(--ifm-pre-color);
|
|
9
8
|
line-height: var(--ifm-pre-line-height);
|
|
@@ -20,8 +19,7 @@
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
&:hover {
|
|
23
|
-
box-shadow:
|
|
24
|
-
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
22
|
+
box-shadow: 0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
25
23
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
26
24
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
27
25
|
}
|
|
@@ -90,7 +90,7 @@ function Request({ item }: { item: NonNullable<ApiItem> }) {
|
|
|
90
90
|
const paramType = param.in;
|
|
91
91
|
const paramsArray: ParameterObject[] = paramsObject[paramType];
|
|
92
92
|
paramsArray.push(param as ParameterObject);
|
|
93
|
-
}
|
|
93
|
+
}
|
|
94
94
|
);
|
|
95
95
|
|
|
96
96
|
const methods = useForm({ shouldFocusError: false });
|
|
@@ -11,12 +11,12 @@ import sdk from "postman-collection";
|
|
|
11
11
|
function fetchWithtimeout(
|
|
12
12
|
url: string,
|
|
13
13
|
options: RequestInit,
|
|
14
|
-
timeout = 5000
|
|
14
|
+
timeout = 5000
|
|
15
15
|
): any {
|
|
16
16
|
return Promise.race([
|
|
17
17
|
fetch(url, options),
|
|
18
18
|
new Promise((_, reject) =>
|
|
19
|
-
setTimeout(() => reject(new Error("Request timed out")), timeout)
|
|
19
|
+
setTimeout(() => reject(new Error("Request timed out")), timeout)
|
|
20
20
|
),
|
|
21
21
|
]);
|
|
22
22
|
}
|
|
@@ -47,7 +47,7 @@ async function loadImage(content: Blob): Promise<string | ArrayBuffer | null> {
|
|
|
47
47
|
async function makeRequest(
|
|
48
48
|
request: sdk.Request,
|
|
49
49
|
proxy: string | undefined,
|
|
50
|
-
_body: Body
|
|
50
|
+
_body: Body
|
|
51
51
|
) {
|
|
52
52
|
const headers = request.toJSON().header;
|
|
53
53
|
|
|
@@ -2,8 +2,7 @@
|
|
|
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:
|
|
6
|
-
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
5
|
+
box-shadow: 0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
7
6
|
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
8
7
|
color: var(--ifm-pre-color);
|
|
9
8
|
line-height: var(--ifm-pre-line-height);
|
|
@@ -13,8 +12,7 @@
|
|
|
13
12
|
transition: 300ms;
|
|
14
13
|
|
|
15
14
|
&:hover {
|
|
16
|
-
box-shadow:
|
|
17
|
-
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
15
|
+
box-shadow: 0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
18
16
|
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
19
17
|
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
20
18
|
}
|
|
@@ -52,8 +52,8 @@ function Response({ item }: { item: NonNullable<ApiItem> }) {
|
|
|
52
52
|
(parseInt(code) >= 400
|
|
53
53
|
? "openapi-response__dot--danger"
|
|
54
54
|
: parseInt(code) >= 200 && parseInt(code) < 300
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
? "openapi-response__dot--success"
|
|
56
|
+
: "openapi-response__dot--info");
|
|
57
57
|
|
|
58
58
|
if (!item.servers || hideSendButton) {
|
|
59
59
|
return null;
|
|
@@ -51,7 +51,7 @@ function Server() {
|
|
|
51
51
|
Object.keys(value.variables).forEach((variable) => {
|
|
52
52
|
url = url.replace(
|
|
53
53
|
`{${variable}}`,
|
|
54
|
-
value.variables?.[variable].default ?? ""
|
|
54
|
+
value.variables?.[variable].default ?? ""
|
|
55
55
|
);
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -76,9 +76,9 @@ function Server() {
|
|
|
76
76
|
dispatch(
|
|
77
77
|
setServer(
|
|
78
78
|
JSON.stringify(
|
|
79
|
-
options.filter((s: any) => s.url === e.target.value)[0]
|
|
80
|
-
)
|
|
81
|
-
)
|
|
79
|
+
options.filter((s: any) => s.url === e.target.value)[0]
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
82
|
);
|
|
83
83
|
}}
|
|
84
84
|
value={value?.url}
|
|
@@ -97,8 +97,8 @@ function Server() {
|
|
|
97
97
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
98
98
|
dispatch(
|
|
99
99
|
setServerVariable(
|
|
100
|
-
JSON.stringify({ key, value: e.target.value })
|
|
101
|
-
)
|
|
100
|
+
JSON.stringify({ key, value: e.target.value })
|
|
101
|
+
)
|
|
102
102
|
);
|
|
103
103
|
}}
|
|
104
104
|
value={value?.variables[key].default}
|
|
@@ -113,8 +113,8 @@ function Server() {
|
|
|
113
113
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
114
114
|
dispatch(
|
|
115
115
|
setServerVariable(
|
|
116
|
-
JSON.stringify({ key, value: e.target.value })
|
|
117
|
-
)
|
|
116
|
+
JSON.stringify({ key, value: e.target.value })
|
|
117
|
+
)
|
|
118
118
|
);
|
|
119
119
|
}}
|
|
120
120
|
value={value?.variables?.[key].default}
|
|
@@ -22,7 +22,7 @@ export const slice = createSlice({
|
|
|
22
22
|
reducers: {
|
|
23
23
|
setServer: (state, action: PayloadAction<string>) => {
|
|
24
24
|
state.value = state.options.find(
|
|
25
|
-
(s) => s.url === JSON.parse(action.payload).url
|
|
25
|
+
(s) => s.url === JSON.parse(action.payload).url
|
|
26
26
|
);
|
|
27
27
|
},
|
|
28
28
|
setServerVariable: (state, action: PayloadAction<string>) => {
|
|
@@ -92,7 +92,7 @@ function setHeaders(
|
|
|
92
92
|
accept: string,
|
|
93
93
|
cookie: string,
|
|
94
94
|
headerParams: Param[],
|
|
95
|
-
other: { key: string; value: string }[]
|
|
95
|
+
other: { key: string; value: string }[]
|
|
96
96
|
) {
|
|
97
97
|
postman.headers.clear();
|
|
98
98
|
if (contentType) {
|
|
@@ -213,7 +213,7 @@ function buildPostmanRequest(
|
|
|
213
213
|
body,
|
|
214
214
|
server,
|
|
215
215
|
auth,
|
|
216
|
-
}: Options
|
|
216
|
+
}: Options
|
|
217
217
|
) {
|
|
218
218
|
const clonedPostman = cloneDeep(postman);
|
|
219
219
|
|
|
@@ -316,7 +316,7 @@ function buildPostmanRequest(
|
|
|
316
316
|
accept,
|
|
317
317
|
cookie,
|
|
318
318
|
headerParams,
|
|
319
|
-
otherHeaders
|
|
319
|
+
otherHeaders
|
|
320
320
|
);
|
|
321
321
|
|
|
322
322
|
setBody(clonedPostman, body);
|
|
@@ -59,7 +59,7 @@ export default function ApiItem(props: Props): JSX.Element {
|
|
|
59
59
|
if (api) {
|
|
60
60
|
try {
|
|
61
61
|
api = JSON.parse(
|
|
62
|
-
zlib.inflateSync(Buffer.from(api as any, "base64")).toString()
|
|
62
|
+
zlib.inflateSync(Buffer.from(api as any, "base64")).toString()
|
|
63
63
|
);
|
|
64
64
|
} catch {}
|
|
65
65
|
}
|
|
@@ -105,7 +105,7 @@ export default function ApiItem(props: Props): JSX.Element {
|
|
|
105
105
|
const paramType = param.in;
|
|
106
106
|
const paramsArray: ParameterObject[] = params[paramType];
|
|
107
107
|
paramsArray.push(param as ParameterObject);
|
|
108
|
-
}
|
|
108
|
+
}
|
|
109
109
|
);
|
|
110
110
|
const auth = createAuth({
|
|
111
111
|
security: api?.security,
|
|
@@ -137,7 +137,7 @@ export default function ApiItem(props: Props): JSX.Element {
|
|
|
137
137
|
params,
|
|
138
138
|
auth,
|
|
139
139
|
},
|
|
140
|
-
[persistanceMiddleware]
|
|
140
|
+
[persistanceMiddleware]
|
|
141
141
|
);
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -28,7 +28,7 @@ export type RootState = ReturnType<typeof rootReducer>;
|
|
|
28
28
|
|
|
29
29
|
export const createStoreWithState = (
|
|
30
30
|
preloadedState: RootState,
|
|
31
|
-
middlewares: any[]
|
|
31
|
+
middlewares: any[]
|
|
32
32
|
) =>
|
|
33
33
|
configureStore({
|
|
34
34
|
reducer: rootReducer,
|
|
@@ -39,7 +39,7 @@ export const createStoreWithState = (
|
|
|
39
39
|
|
|
40
40
|
export const createStoreWithoutState = (
|
|
41
41
|
preloadedState: {},
|
|
42
|
-
middlewares: any[]
|
|
42
|
+
middlewares: any[]
|
|
43
43
|
) =>
|
|
44
44
|
configureStore({
|
|
45
45
|
reducer: rootReducer,
|
|
@@ -114,7 +114,7 @@ function TabList({
|
|
|
114
114
|
{
|
|
115
115
|
"tabs--block": block,
|
|
116
116
|
},
|
|
117
|
-
className
|
|
117
|
+
className
|
|
118
118
|
)}
|
|
119
119
|
>
|
|
120
120
|
{tabValues.map(({ value, label, attributes }) => (
|
|
@@ -135,11 +135,11 @@ function TabList({
|
|
|
135
135
|
parseInt(value) >= 400
|
|
136
136
|
? "danger"
|
|
137
137
|
: parseInt(value) >= 200 && parseInt(value) < 300
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
? "success"
|
|
139
|
+
: "info",
|
|
140
140
|
{
|
|
141
141
|
active: selectedValue === value,
|
|
142
|
-
}
|
|
142
|
+
}
|
|
143
143
|
)}
|
|
144
144
|
>
|
|
145
145
|
{label ?? value}
|
|
@@ -161,7 +161,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
161
161
|
children = Array.isArray(children) ? children : [children];
|
|
162
162
|
if (lazy) {
|
|
163
163
|
const selectedTabItem = children.find(
|
|
164
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
164
|
+
(tabItem) => tabItem.props.value === selectedValue
|
|
165
165
|
);
|
|
166
166
|
if (!selectedTabItem) {
|
|
167
167
|
// fail-safe or fail-fast? not sure what's best here
|
|
@@ -175,7 +175,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
175
175
|
cloneElement(tabItem, {
|
|
176
176
|
key: i,
|
|
177
177
|
hidden: tabItem.props.value !== selectedValue,
|
|
178
|
-
})
|
|
178
|
+
})
|
|
179
179
|
)}
|
|
180
180
|
</div>
|
|
181
181
|
);
|
|
@@ -101,7 +101,7 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
|
101
101
|
{
|
|
102
102
|
"tabs--block": block,
|
|
103
103
|
},
|
|
104
|
-
className
|
|
104
|
+
className
|
|
105
105
|
)}
|
|
106
106
|
>
|
|
107
107
|
{tabValues.map(({ value, label, attributes }) => (
|
|
@@ -121,7 +121,7 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
|
121
121
|
attributes?.className,
|
|
122
122
|
{
|
|
123
123
|
active: selectedValue === value,
|
|
124
|
-
}
|
|
124
|
+
}
|
|
125
125
|
)}
|
|
126
126
|
>
|
|
127
127
|
<span className="openapi-tabs__discriminator-tab-label">
|
|
@@ -146,7 +146,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
146
146
|
const flattenedChildren = flatten(children);
|
|
147
147
|
if (lazy) {
|
|
148
148
|
const selectedTabItem = flattenedChildren.find(
|
|
149
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
149
|
+
(tabItem) => tabItem.props.value === selectedValue
|
|
150
150
|
);
|
|
151
151
|
if (!selectedTabItem) {
|
|
152
152
|
// fail-safe or fail-fast? not sure what's best here
|
|
@@ -160,7 +160,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
160
160
|
cloneElement(tabItem, {
|
|
161
161
|
key: i,
|
|
162
162
|
hidden: tabItem.props.value !== selectedValue,
|
|
163
|
-
})
|
|
163
|
+
})
|
|
164
164
|
)}
|
|
165
165
|
</div>
|
|
166
166
|
);
|
|
@@ -138,7 +138,7 @@ function TabList({
|
|
|
138
138
|
{
|
|
139
139
|
"tabs--block": block,
|
|
140
140
|
},
|
|
141
|
-
className
|
|
141
|
+
className
|
|
142
142
|
)}
|
|
143
143
|
>
|
|
144
144
|
{tabValues.map(({ value, label, attributes }) => {
|
|
@@ -159,7 +159,7 @@ function TabList({
|
|
|
159
159
|
attributes?.className,
|
|
160
160
|
{
|
|
161
161
|
active: selectedValue === value,
|
|
162
|
-
}
|
|
162
|
+
}
|
|
163
163
|
)}
|
|
164
164
|
>
|
|
165
165
|
{label ?? value}
|
|
@@ -182,7 +182,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
182
182
|
children = Array.isArray(children) ? children : [children];
|
|
183
183
|
if (lazy) {
|
|
184
184
|
const selectedTabItem = children.find(
|
|
185
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
185
|
+
(tabItem) => tabItem.props.value === selectedValue
|
|
186
186
|
);
|
|
187
187
|
if (!selectedTabItem) {
|
|
188
188
|
// fail-safe or fail-fast? not sure what's best here
|
|
@@ -196,7 +196,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
196
196
|
cloneElement(tabItem, {
|
|
197
197
|
key: i,
|
|
198
198
|
hidden: tabItem.props.value !== selectedValue,
|
|
199
|
-
})
|
|
199
|
+
})
|
|
200
200
|
)}
|
|
201
201
|
</div>
|
|
202
202
|
);
|
|
@@ -104,7 +104,7 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
|
104
104
|
{
|
|
105
105
|
"tabs--block": block,
|
|
106
106
|
},
|
|
107
|
-
className
|
|
107
|
+
className
|
|
108
108
|
)}
|
|
109
109
|
>
|
|
110
110
|
{tabValues.map(({ value, label, attributes }) => {
|
|
@@ -125,7 +125,7 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
|
125
125
|
attributes?.className,
|
|
126
126
|
{
|
|
127
127
|
active: selectedValue === value,
|
|
128
|
-
}
|
|
128
|
+
}
|
|
129
129
|
)}
|
|
130
130
|
>
|
|
131
131
|
{label ?? value}
|
|
@@ -148,7 +148,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
148
148
|
children = Array.isArray(children) ? children : [children];
|
|
149
149
|
if (lazy) {
|
|
150
150
|
const selectedTabItem = children.find(
|
|
151
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
151
|
+
(tabItem) => tabItem.props.value === selectedValue
|
|
152
152
|
);
|
|
153
153
|
if (!selectedTabItem) {
|
|
154
154
|
// fail-safe or fail-fast? not sure what's best here
|
|
@@ -162,7 +162,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
162
162
|
cloneElement(tabItem, {
|
|
163
163
|
key: i,
|
|
164
164
|
hidden: tabItem.props.value !== selectedValue,
|
|
165
|
-
})
|
|
165
|
+
})
|
|
166
166
|
)}
|
|
167
167
|
</div>
|
|
168
168
|
);
|
|
@@ -79,13 +79,13 @@ function ParamsItem({
|
|
|
79
79
|
schema && schema.items
|
|
80
80
|
? schema.items.default
|
|
81
81
|
: schema
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
? schema.default
|
|
83
|
+
: undefined,
|
|
84
84
|
(value) => (
|
|
85
85
|
<div>
|
|
86
86
|
<ReactMarkdown children={`**Default value:** \`${value}\``} />
|
|
87
87
|
</div>
|
|
88
|
-
)
|
|
88
|
+
)
|
|
89
89
|
);
|
|
90
90
|
|
|
91
91
|
const renderExample = guard(toString(example), (example) => (
|
|
@@ -38,7 +38,7 @@ function SchemaItem({
|
|
|
38
38
|
|
|
39
39
|
const renderRequired = guard(
|
|
40
40
|
Array.isArray(required) ? required.includes(name) : required,
|
|
41
|
-
() => <span className="openapi-schema__required">required</span
|
|
41
|
+
() => <span className="openapi-schema__required">required</span>
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
const renderDeprecated = guard(deprecated, () => (
|
|
@@ -102,7 +102,7 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
|
102
102
|
{
|
|
103
103
|
"tabs--block": block,
|
|
104
104
|
},
|
|
105
|
-
className
|
|
105
|
+
className
|
|
106
106
|
)}
|
|
107
107
|
>
|
|
108
108
|
{tabValues.map(({ value, label, attributes }) => (
|
|
@@ -122,7 +122,7 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
|
122
122
|
attributes?.className,
|
|
123
123
|
{
|
|
124
124
|
active: selectedValue === value,
|
|
125
|
-
}
|
|
125
|
+
}
|
|
126
126
|
)}
|
|
127
127
|
>
|
|
128
128
|
<span className="openapi-tabs__schema-label">{label ?? value}</span>
|
|
@@ -145,7 +145,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
145
145
|
|
|
146
146
|
if (lazy) {
|
|
147
147
|
const selectedTabItem = flattenedChildren.find(
|
|
148
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
148
|
+
(tabItem) => tabItem.props.value === selectedValue
|
|
149
149
|
);
|
|
150
150
|
if (!selectedTabItem) {
|
|
151
151
|
// fail-safe or fail-fast? not sure what's best here
|
|
@@ -159,7 +159,7 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
159
159
|
cloneElement(tabItem, {
|
|
160
160
|
key: i,
|
|
161
161
|
hidden: tabItem.props.value !== selectedValue,
|
|
162
|
-
})
|
|
162
|
+
})
|
|
163
163
|
)}
|
|
164
164
|
</div>
|
|
165
165
|
);
|
package/src/theme/styles.scss
CHANGED
|
@@ -130,22 +130,22 @@
|
|
|
130
130
|
|
|
131
131
|
/* Version button */
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
.version-button div {
|
|
134
|
+
display: block;
|
|
135
|
+
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
137
|
+
.version-button div > button > span::after {
|
|
138
|
+
border-color: currentcolor transparent;
|
|
139
|
+
border-style: solid;
|
|
140
|
+
border-width: 0.4em 0.4em 0;
|
|
141
|
+
content: "";
|
|
142
|
+
margin-left: 0.3em;
|
|
143
|
+
position: relative;
|
|
144
|
+
transform: translateY(-50%);
|
|
145
|
+
display: inline-block;
|
|
146
|
+
font-size: 0.8rem;
|
|
147
|
+
top: 1px;
|
|
148
|
+
}
|
|
149
149
|
|
|
150
150
|
.openapi__logo {
|
|
151
151
|
width: 250px;
|
package/src/theme-openapi.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ declare module "@theme/ApiExplorer/FloatingButton" {
|
|
|
132
132
|
import { Props as FloatingButtonProps } from "@theme/ApiExplorer/FloatingButton";
|
|
133
133
|
|
|
134
134
|
export default function FloatingButton(
|
|
135
|
-
props: FloatingButtonProps
|
|
135
|
+
props: FloatingButtonProps
|
|
136
136
|
): JSX.Element;
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -158,7 +158,7 @@ declare module "@theme/ApiExplorer/FormFileUpload" {
|
|
|
158
158
|
import { Props as FormFileUploadProps } from "@theme/ApiExplorer/FormFileUpload";
|
|
159
159
|
|
|
160
160
|
export default function FormFileUpload(
|
|
161
|
-
props: FormFileUploadProps
|
|
161
|
+
props: FormFileUploadProps
|
|
162
162
|
): JSX.Element;
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -166,7 +166,7 @@ declare module "@theme/ApiExplorer/FormMultiSelect" {
|
|
|
166
166
|
import { Props as FormMultiSelectProps } from "@theme/ApiExplorer/FormMultiSelect";
|
|
167
167
|
|
|
168
168
|
export default function FormMultiSelect(
|
|
169
|
-
props: FormMultiSelectProps
|
|
169
|
+
props: FormMultiSelectProps
|
|
170
170
|
): JSX.Element;
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -184,7 +184,7 @@ declare module "@theme/ApiExplorer/MethodEndpoint" {
|
|
|
184
184
|
import { Props as MethodEndpointProps } from "@theme/ApiExplorer/MethodEndpoint";
|
|
185
185
|
|
|
186
186
|
export default function MethodEndpoint(
|
|
187
|
-
props: MethodEndpointProps
|
|
187
|
+
props: MethodEndpointProps
|
|
188
188
|
): JSX.Element;
|
|
189
189
|
}
|
|
190
190
|
|
|
@@ -198,7 +198,7 @@ declare module "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectF
|
|
|
198
198
|
import { ParamProps } from "@theme/ApiExplorer/ParamOptions";
|
|
199
199
|
|
|
200
200
|
export default function ParamMultiSelectFormItem(
|
|
201
|
-
props: ParamProps
|
|
201
|
+
props: ParamProps
|
|
202
202
|
): JSX.Element;
|
|
203
203
|
}
|
|
204
204
|
|