docusaurus-theme-openapi-docs 1.7.2 → 1.7.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/theme/ApiTabs/index.js +14 -5
- package/lib/theme/DiscriminatorTabs/index.js +15 -6
- package/lib/theme/DiscriminatorTabs/styles.module.css +5 -1
- package/lib/theme/MimeTabs/index.js +18 -9
- package/lib/theme/ParamsItem/index.js +2 -2
- package/lib/theme/SchemaItem/index.js +4 -2
- package/lib/theme/SchemaTabs/index.js +4 -4
- package/lib/theme/styles.css +4 -0
- package/lib-next/theme/ApiTabs/index.js +14 -5
- package/lib-next/theme/DiscriminatorTabs/index.js +15 -6
- package/lib-next/theme/DiscriminatorTabs/styles.module.css +5 -1
- package/lib-next/theme/MimeTabs/index.js +18 -9
- package/lib-next/theme/ParamsItem/index.js +2 -2
- package/lib-next/theme/SchemaItem/index.js +4 -2
- package/lib-next/theme/SchemaTabs/index.js +4 -4
- package/lib-next/theme/styles.css +4 -0
- package/package.json +3 -3
- package/src/theme/ApiTabs/index.js +14 -5
- package/src/theme/DiscriminatorTabs/index.js +15 -6
- package/src/theme/DiscriminatorTabs/styles.module.css +5 -1
- package/src/theme/MimeTabs/index.js +18 -9
- package/src/theme/ParamsItem/index.js +2 -2
- package/src/theme/SchemaItem/index.js +4 -2
- package/src/theme/SchemaTabs/index.js +4 -4
- package/src/theme/styles.css +4 -0
|
@@ -147,12 +147,21 @@ function ApiTabsComponent(props) {
|
|
|
147
147
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
148
148
|
|
|
149
149
|
useEffect(() => {
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
151
|
+
for (let entry of entries) {
|
|
152
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
153
|
+
setShowTabArrows(true);
|
|
154
|
+
} else {
|
|
155
|
+
setShowTabArrows(false);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
161
|
+
|
|
162
|
+
return () => {
|
|
163
|
+
resizeObserver.disconnect();
|
|
164
|
+
};
|
|
156
165
|
}, []);
|
|
157
166
|
|
|
158
167
|
const handleRightClick = () => {
|
|
@@ -147,12 +147,21 @@ function DiscriminatorTabsComponent(props) {
|
|
|
147
147
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
148
148
|
|
|
149
149
|
useEffect(() => {
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
151
|
+
for (let entry of entries) {
|
|
152
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
153
|
+
setShowTabArrows(true);
|
|
154
|
+
} else {
|
|
155
|
+
setShowTabArrows(false);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
161
|
+
|
|
162
|
+
return () => {
|
|
163
|
+
resizeObserver.disconnect();
|
|
164
|
+
};
|
|
156
165
|
}, []);
|
|
157
166
|
|
|
158
167
|
const handleRightClick = () => {
|
|
@@ -164,7 +173,7 @@ function DiscriminatorTabsComponent(props) {
|
|
|
164
173
|
};
|
|
165
174
|
|
|
166
175
|
return (
|
|
167
|
-
<div className="tabs__container">
|
|
176
|
+
<div className={clsx("tabs__container", "discriminatorTabs")}>
|
|
168
177
|
<div className={styles.discriminatorTabsTopSection}>
|
|
169
178
|
<div className={clsx(styles.discriminatorTabsContainer)}>
|
|
170
179
|
{showTabArrows && (
|
|
@@ -32,9 +32,13 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/* Open API Schema Tabs */
|
|
35
|
+
.discriminatorTabs {
|
|
36
|
+
margin-left: -20px !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
.discriminatorTabsTopSection {
|
|
36
40
|
margin-top: 1rem;
|
|
37
|
-
margin-left:
|
|
41
|
+
margin-left: 1rem;
|
|
38
42
|
display: flex;
|
|
39
43
|
justify-content: space-between;
|
|
40
44
|
align-items: center;
|
|
@@ -173,12 +173,21 @@ function MimeTabsComponent(props) {
|
|
|
173
173
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
174
174
|
|
|
175
175
|
useEffect(() => {
|
|
176
|
-
const
|
|
177
|
-
|
|
176
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
177
|
+
for (let entry of entries) {
|
|
178
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
179
|
+
setShowTabArrows(true);
|
|
180
|
+
} else {
|
|
181
|
+
setShowTabArrows(false);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
178
185
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
186
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
187
|
+
|
|
188
|
+
return () => {
|
|
189
|
+
resizeObserver.disconnect();
|
|
190
|
+
};
|
|
182
191
|
}, []);
|
|
183
192
|
|
|
184
193
|
const handleRightClick = () => {
|
|
@@ -200,7 +209,7 @@ function MimeTabsComponent(props) {
|
|
|
200
209
|
onClick={handleLeftClick}
|
|
201
210
|
/>
|
|
202
211
|
)}
|
|
203
|
-
<
|
|
212
|
+
<div
|
|
204
213
|
ref={tabItemListContainerRef}
|
|
205
214
|
role="tablist"
|
|
206
215
|
aria-orientation="horizontal"
|
|
@@ -215,7 +224,7 @@ function MimeTabsComponent(props) {
|
|
|
215
224
|
>
|
|
216
225
|
{values.map(({ value, label, attributes }) => {
|
|
217
226
|
return (
|
|
218
|
-
<
|
|
227
|
+
<div
|
|
219
228
|
role="tab"
|
|
220
229
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
221
230
|
aria-selected={selectedValue === value}
|
|
@@ -238,10 +247,10 @@ function MimeTabsComponent(props) {
|
|
|
238
247
|
className={clsx(styles.mimeTabDot, mimeTabDotStyle)}
|
|
239
248
|
/> */}
|
|
240
249
|
{label ?? value}
|
|
241
|
-
</
|
|
250
|
+
</div>
|
|
242
251
|
);
|
|
243
252
|
})}
|
|
244
|
-
</
|
|
253
|
+
</div>
|
|
245
254
|
{showTabArrows && (
|
|
246
255
|
<button
|
|
247
256
|
className={clsx(styles.tabArrow, styles.tabArrowRight)}
|
|
@@ -119,7 +119,7 @@ function ParamsItem({
|
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
return (
|
|
122
|
-
<
|
|
122
|
+
<div className={styles.paramsItem}>
|
|
123
123
|
<strong>{name}</strong>
|
|
124
124
|
{renderSchemaName}
|
|
125
125
|
{renderSchemaRequired}
|
|
@@ -128,7 +128,7 @@ function ParamsItem({
|
|
|
128
128
|
{renderDescription}
|
|
129
129
|
{renderExample}
|
|
130
130
|
{renderExamples}
|
|
131
|
-
</
|
|
131
|
+
</div>
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -28,6 +28,7 @@ function SchemaItem({
|
|
|
28
28
|
required,
|
|
29
29
|
schemaName,
|
|
30
30
|
schema,
|
|
31
|
+
discriminator,
|
|
31
32
|
}) {
|
|
32
33
|
let deprecated;
|
|
33
34
|
let schemaDescription;
|
|
@@ -99,13 +100,14 @@ function SchemaItem({
|
|
|
99
100
|
{renderQualifierMessage}
|
|
100
101
|
{renderDefaultValue}
|
|
101
102
|
{renderSchemaDescription}
|
|
103
|
+
{collapsibleSchemaContent ?? collapsibleSchemaContent}
|
|
102
104
|
</div>
|
|
103
105
|
);
|
|
104
106
|
|
|
105
107
|
return (
|
|
106
|
-
<
|
|
108
|
+
<div className={styles.schemaItem}>
|
|
107
109
|
{collapsible ? collapsibleSchemaContent : schemaContent}
|
|
108
|
-
</
|
|
110
|
+
</div>
|
|
109
111
|
);
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -182,7 +182,7 @@ function SchemaTabsComponent(props) {
|
|
|
182
182
|
onClick={handleLeftClick}
|
|
183
183
|
/>
|
|
184
184
|
)}
|
|
185
|
-
<
|
|
185
|
+
<div
|
|
186
186
|
ref={tabItemListContainerRef}
|
|
187
187
|
role="tablist"
|
|
188
188
|
aria-orientation="horizontal"
|
|
@@ -197,7 +197,7 @@ function SchemaTabsComponent(props) {
|
|
|
197
197
|
>
|
|
198
198
|
{values.map(({ value, label, attributes }) => {
|
|
199
199
|
return (
|
|
200
|
-
<
|
|
200
|
+
<div
|
|
201
201
|
role="tab"
|
|
202
202
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
203
203
|
aria-selected={selectedValue === value}
|
|
@@ -219,10 +219,10 @@ function SchemaTabsComponent(props) {
|
|
|
219
219
|
<span className={styles.schemaTabLabel}>
|
|
220
220
|
{label ?? value}
|
|
221
221
|
</span>
|
|
222
|
-
</
|
|
222
|
+
</div>
|
|
223
223
|
);
|
|
224
224
|
})}
|
|
225
|
-
</
|
|
225
|
+
</div>
|
|
226
226
|
{showTabArrows && (
|
|
227
227
|
<button
|
|
228
228
|
className={clsx(styles.tabArrow, styles.tabArrowRight)}
|
package/lib/theme/styles.css
CHANGED
|
@@ -147,12 +147,21 @@ function ApiTabsComponent(props) {
|
|
|
147
147
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
148
148
|
|
|
149
149
|
useEffect(() => {
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
151
|
+
for (let entry of entries) {
|
|
152
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
153
|
+
setShowTabArrows(true);
|
|
154
|
+
} else {
|
|
155
|
+
setShowTabArrows(false);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
161
|
+
|
|
162
|
+
return () => {
|
|
163
|
+
resizeObserver.disconnect();
|
|
164
|
+
};
|
|
156
165
|
}, []);
|
|
157
166
|
|
|
158
167
|
const handleRightClick = () => {
|
|
@@ -147,12 +147,21 @@ function DiscriminatorTabsComponent(props) {
|
|
|
147
147
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
148
148
|
|
|
149
149
|
useEffect(() => {
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
151
|
+
for (let entry of entries) {
|
|
152
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
153
|
+
setShowTabArrows(true);
|
|
154
|
+
} else {
|
|
155
|
+
setShowTabArrows(false);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
161
|
+
|
|
162
|
+
return () => {
|
|
163
|
+
resizeObserver.disconnect();
|
|
164
|
+
};
|
|
156
165
|
}, []);
|
|
157
166
|
|
|
158
167
|
const handleRightClick = () => {
|
|
@@ -164,7 +173,7 @@ function DiscriminatorTabsComponent(props) {
|
|
|
164
173
|
};
|
|
165
174
|
|
|
166
175
|
return (
|
|
167
|
-
<div className="tabs__container">
|
|
176
|
+
<div className={clsx("tabs__container", "discriminatorTabs")}>
|
|
168
177
|
<div className={styles.discriminatorTabsTopSection}>
|
|
169
178
|
<div className={clsx(styles.discriminatorTabsContainer)}>
|
|
170
179
|
{showTabArrows && (
|
|
@@ -32,9 +32,13 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/* Open API Schema Tabs */
|
|
35
|
+
.discriminatorTabs {
|
|
36
|
+
margin-left: -20px !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
.discriminatorTabsTopSection {
|
|
36
40
|
margin-top: 1rem;
|
|
37
|
-
margin-left:
|
|
41
|
+
margin-left: 1rem;
|
|
38
42
|
display: flex;
|
|
39
43
|
justify-content: space-between;
|
|
40
44
|
align-items: center;
|
|
@@ -173,12 +173,21 @@ function MimeTabsComponent(props) {
|
|
|
173
173
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
174
174
|
|
|
175
175
|
useEffect(() => {
|
|
176
|
-
const
|
|
177
|
-
|
|
176
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
177
|
+
for (let entry of entries) {
|
|
178
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
179
|
+
setShowTabArrows(true);
|
|
180
|
+
} else {
|
|
181
|
+
setShowTabArrows(false);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
178
185
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
186
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
187
|
+
|
|
188
|
+
return () => {
|
|
189
|
+
resizeObserver.disconnect();
|
|
190
|
+
};
|
|
182
191
|
}, []);
|
|
183
192
|
|
|
184
193
|
const handleRightClick = () => {
|
|
@@ -200,7 +209,7 @@ function MimeTabsComponent(props) {
|
|
|
200
209
|
onClick={handleLeftClick}
|
|
201
210
|
/>
|
|
202
211
|
)}
|
|
203
|
-
<
|
|
212
|
+
<div
|
|
204
213
|
ref={tabItemListContainerRef}
|
|
205
214
|
role="tablist"
|
|
206
215
|
aria-orientation="horizontal"
|
|
@@ -215,7 +224,7 @@ function MimeTabsComponent(props) {
|
|
|
215
224
|
>
|
|
216
225
|
{values.map(({ value, label, attributes }) => {
|
|
217
226
|
return (
|
|
218
|
-
<
|
|
227
|
+
<div
|
|
219
228
|
role="tab"
|
|
220
229
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
221
230
|
aria-selected={selectedValue === value}
|
|
@@ -238,10 +247,10 @@ function MimeTabsComponent(props) {
|
|
|
238
247
|
className={clsx(styles.mimeTabDot, mimeTabDotStyle)}
|
|
239
248
|
/> */}
|
|
240
249
|
{label ?? value}
|
|
241
|
-
</
|
|
250
|
+
</div>
|
|
242
251
|
);
|
|
243
252
|
})}
|
|
244
|
-
</
|
|
253
|
+
</div>
|
|
245
254
|
{showTabArrows && (
|
|
246
255
|
<button
|
|
247
256
|
className={clsx(styles.tabArrow, styles.tabArrowRight)}
|
|
@@ -119,7 +119,7 @@ function ParamsItem({
|
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
return (
|
|
122
|
-
<
|
|
122
|
+
<div className={styles.paramsItem}>
|
|
123
123
|
<strong>{name}</strong>
|
|
124
124
|
{renderSchemaName}
|
|
125
125
|
{renderSchemaRequired}
|
|
@@ -128,7 +128,7 @@ function ParamsItem({
|
|
|
128
128
|
{renderDescription}
|
|
129
129
|
{renderExample}
|
|
130
130
|
{renderExamples}
|
|
131
|
-
</
|
|
131
|
+
</div>
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -28,6 +28,7 @@ function SchemaItem({
|
|
|
28
28
|
required,
|
|
29
29
|
schemaName,
|
|
30
30
|
schema,
|
|
31
|
+
discriminator,
|
|
31
32
|
}) {
|
|
32
33
|
let deprecated;
|
|
33
34
|
let schemaDescription;
|
|
@@ -99,13 +100,14 @@ function SchemaItem({
|
|
|
99
100
|
{renderQualifierMessage}
|
|
100
101
|
{renderDefaultValue}
|
|
101
102
|
{renderSchemaDescription}
|
|
103
|
+
{collapsibleSchemaContent ?? collapsibleSchemaContent}
|
|
102
104
|
</div>
|
|
103
105
|
);
|
|
104
106
|
|
|
105
107
|
return (
|
|
106
|
-
<
|
|
108
|
+
<div className={styles.schemaItem}>
|
|
107
109
|
{collapsible ? collapsibleSchemaContent : schemaContent}
|
|
108
|
-
</
|
|
110
|
+
</div>
|
|
109
111
|
);
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -182,7 +182,7 @@ function SchemaTabsComponent(props) {
|
|
|
182
182
|
onClick={handleLeftClick}
|
|
183
183
|
/>
|
|
184
184
|
)}
|
|
185
|
-
<
|
|
185
|
+
<div
|
|
186
186
|
ref={tabItemListContainerRef}
|
|
187
187
|
role="tablist"
|
|
188
188
|
aria-orientation="horizontal"
|
|
@@ -197,7 +197,7 @@ function SchemaTabsComponent(props) {
|
|
|
197
197
|
>
|
|
198
198
|
{values.map(({ value, label, attributes }) => {
|
|
199
199
|
return (
|
|
200
|
-
<
|
|
200
|
+
<div
|
|
201
201
|
role="tab"
|
|
202
202
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
203
203
|
aria-selected={selectedValue === value}
|
|
@@ -219,10 +219,10 @@ function SchemaTabsComponent(props) {
|
|
|
219
219
|
<span className={styles.schemaTabLabel}>
|
|
220
220
|
{label ?? value}
|
|
221
221
|
</span>
|
|
222
|
-
</
|
|
222
|
+
</div>
|
|
223
223
|
);
|
|
224
224
|
})}
|
|
225
|
-
</
|
|
225
|
+
</div>
|
|
226
226
|
{showTabArrows && (
|
|
227
227
|
<button
|
|
228
228
|
className={clsx(styles.tabArrow, styles.tabArrowRight)}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-theme-openapi-docs",
|
|
3
3
|
"description": "OpenAPI theme for Docusaurus.",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"buffer": "^6.0.3",
|
|
52
52
|
"clsx": "^1.1.1",
|
|
53
53
|
"crypto-js": "^4.1.1",
|
|
54
|
-
"docusaurus-plugin-openapi-docs": "^1.7.
|
|
54
|
+
"docusaurus-plugin-openapi-docs": "^1.7.3",
|
|
55
55
|
"file-saver": "^2.0.5",
|
|
56
56
|
"immer": "^9.0.7",
|
|
57
57
|
"lodash": "^4.17.20",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=14"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "b30ae6acf881863cb2422bce775f1d9fe6f0fcb6"
|
|
78
78
|
}
|
|
@@ -147,12 +147,21 @@ function ApiTabsComponent(props) {
|
|
|
147
147
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
148
148
|
|
|
149
149
|
useEffect(() => {
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
151
|
+
for (let entry of entries) {
|
|
152
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
153
|
+
setShowTabArrows(true);
|
|
154
|
+
} else {
|
|
155
|
+
setShowTabArrows(false);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
161
|
+
|
|
162
|
+
return () => {
|
|
163
|
+
resizeObserver.disconnect();
|
|
164
|
+
};
|
|
156
165
|
}, []);
|
|
157
166
|
|
|
158
167
|
const handleRightClick = () => {
|
|
@@ -147,12 +147,21 @@ function DiscriminatorTabsComponent(props) {
|
|
|
147
147
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
148
148
|
|
|
149
149
|
useEffect(() => {
|
|
150
|
-
const
|
|
151
|
-
|
|
150
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
151
|
+
for (let entry of entries) {
|
|
152
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
153
|
+
setShowTabArrows(true);
|
|
154
|
+
} else {
|
|
155
|
+
setShowTabArrows(false);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
161
|
+
|
|
162
|
+
return () => {
|
|
163
|
+
resizeObserver.disconnect();
|
|
164
|
+
};
|
|
156
165
|
}, []);
|
|
157
166
|
|
|
158
167
|
const handleRightClick = () => {
|
|
@@ -164,7 +173,7 @@ function DiscriminatorTabsComponent(props) {
|
|
|
164
173
|
};
|
|
165
174
|
|
|
166
175
|
return (
|
|
167
|
-
<div className="tabs__container">
|
|
176
|
+
<div className={clsx("tabs__container", "discriminatorTabs")}>
|
|
168
177
|
<div className={styles.discriminatorTabsTopSection}>
|
|
169
178
|
<div className={clsx(styles.discriminatorTabsContainer)}>
|
|
170
179
|
{showTabArrows && (
|
|
@@ -32,9 +32,13 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/* Open API Schema Tabs */
|
|
35
|
+
.discriminatorTabs {
|
|
36
|
+
margin-left: -20px !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
.discriminatorTabsTopSection {
|
|
36
40
|
margin-top: 1rem;
|
|
37
|
-
margin-left:
|
|
41
|
+
margin-left: 1rem;
|
|
38
42
|
display: flex;
|
|
39
43
|
justify-content: space-between;
|
|
40
44
|
align-items: center;
|
|
@@ -173,12 +173,21 @@ function MimeTabsComponent(props) {
|
|
|
173
173
|
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
174
174
|
|
|
175
175
|
useEffect(() => {
|
|
176
|
-
const
|
|
177
|
-
|
|
176
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
177
|
+
for (let entry of entries) {
|
|
178
|
+
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
179
|
+
setShowTabArrows(true);
|
|
180
|
+
} else {
|
|
181
|
+
setShowTabArrows(false);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
178
185
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
186
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
187
|
+
|
|
188
|
+
return () => {
|
|
189
|
+
resizeObserver.disconnect();
|
|
190
|
+
};
|
|
182
191
|
}, []);
|
|
183
192
|
|
|
184
193
|
const handleRightClick = () => {
|
|
@@ -200,7 +209,7 @@ function MimeTabsComponent(props) {
|
|
|
200
209
|
onClick={handleLeftClick}
|
|
201
210
|
/>
|
|
202
211
|
)}
|
|
203
|
-
<
|
|
212
|
+
<div
|
|
204
213
|
ref={tabItemListContainerRef}
|
|
205
214
|
role="tablist"
|
|
206
215
|
aria-orientation="horizontal"
|
|
@@ -215,7 +224,7 @@ function MimeTabsComponent(props) {
|
|
|
215
224
|
>
|
|
216
225
|
{values.map(({ value, label, attributes }) => {
|
|
217
226
|
return (
|
|
218
|
-
<
|
|
227
|
+
<div
|
|
219
228
|
role="tab"
|
|
220
229
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
221
230
|
aria-selected={selectedValue === value}
|
|
@@ -238,10 +247,10 @@ function MimeTabsComponent(props) {
|
|
|
238
247
|
className={clsx(styles.mimeTabDot, mimeTabDotStyle)}
|
|
239
248
|
/> */}
|
|
240
249
|
{label ?? value}
|
|
241
|
-
</
|
|
250
|
+
</div>
|
|
242
251
|
);
|
|
243
252
|
})}
|
|
244
|
-
</
|
|
253
|
+
</div>
|
|
245
254
|
{showTabArrows && (
|
|
246
255
|
<button
|
|
247
256
|
className={clsx(styles.tabArrow, styles.tabArrowRight)}
|
|
@@ -119,7 +119,7 @@ function ParamsItem({
|
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
return (
|
|
122
|
-
<
|
|
122
|
+
<div className={styles.paramsItem}>
|
|
123
123
|
<strong>{name}</strong>
|
|
124
124
|
{renderSchemaName}
|
|
125
125
|
{renderSchemaRequired}
|
|
@@ -128,7 +128,7 @@ function ParamsItem({
|
|
|
128
128
|
{renderDescription}
|
|
129
129
|
{renderExample}
|
|
130
130
|
{renderExamples}
|
|
131
|
-
</
|
|
131
|
+
</div>
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -28,6 +28,7 @@ function SchemaItem({
|
|
|
28
28
|
required,
|
|
29
29
|
schemaName,
|
|
30
30
|
schema,
|
|
31
|
+
discriminator,
|
|
31
32
|
}) {
|
|
32
33
|
let deprecated;
|
|
33
34
|
let schemaDescription;
|
|
@@ -99,13 +100,14 @@ function SchemaItem({
|
|
|
99
100
|
{renderQualifierMessage}
|
|
100
101
|
{renderDefaultValue}
|
|
101
102
|
{renderSchemaDescription}
|
|
103
|
+
{collapsibleSchemaContent ?? collapsibleSchemaContent}
|
|
102
104
|
</div>
|
|
103
105
|
);
|
|
104
106
|
|
|
105
107
|
return (
|
|
106
|
-
<
|
|
108
|
+
<div className={styles.schemaItem}>
|
|
107
109
|
{collapsible ? collapsibleSchemaContent : schemaContent}
|
|
108
|
-
</
|
|
110
|
+
</div>
|
|
109
111
|
);
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -182,7 +182,7 @@ function SchemaTabsComponent(props) {
|
|
|
182
182
|
onClick={handleLeftClick}
|
|
183
183
|
/>
|
|
184
184
|
)}
|
|
185
|
-
<
|
|
185
|
+
<div
|
|
186
186
|
ref={tabItemListContainerRef}
|
|
187
187
|
role="tablist"
|
|
188
188
|
aria-orientation="horizontal"
|
|
@@ -197,7 +197,7 @@ function SchemaTabsComponent(props) {
|
|
|
197
197
|
>
|
|
198
198
|
{values.map(({ value, label, attributes }) => {
|
|
199
199
|
return (
|
|
200
|
-
<
|
|
200
|
+
<div
|
|
201
201
|
role="tab"
|
|
202
202
|
tabIndex={selectedValue === value ? 0 : -1}
|
|
203
203
|
aria-selected={selectedValue === value}
|
|
@@ -219,10 +219,10 @@ function SchemaTabsComponent(props) {
|
|
|
219
219
|
<span className={styles.schemaTabLabel}>
|
|
220
220
|
{label ?? value}
|
|
221
221
|
</span>
|
|
222
|
-
</
|
|
222
|
+
</div>
|
|
223
223
|
);
|
|
224
224
|
})}
|
|
225
|
-
</
|
|
225
|
+
</div>
|
|
226
226
|
{showTabArrows && (
|
|
227
227
|
<button
|
|
228
228
|
className={clsx(styles.tabArrow, styles.tabArrowRight)}
|