docusaurus-theme-openapi-docs 1.6.0 → 1.6.1

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.
@@ -26,7 +26,7 @@ function create(tag, props) {
26
26
  return `<${tag}${propString}>${render(children)}</${tag}>`;
27
27
  }
28
28
  function guard(value, cb) {
29
- if (value !== undefined) {
29
+ if (!!value) {
30
30
  const children = cb(value);
31
31
  return render(children);
32
32
  }
@@ -188,12 +188,12 @@ function ApiTabsComponent(props) {
188
188
  )}
189
189
  >
190
190
  {values.map(({ value, label, attributes }) => {
191
- const responseTabDotStyle =
191
+ const responseStatusStyle =
192
192
  parseInt(value) >= 400
193
- ? styles.responseTabDotDanger
193
+ ? styles.responseStatusDanger
194
194
  : parseInt(value) >= 200 && parseInt(value) < 300
195
- ? styles.responseTabDotSuccess
196
- : styles.responseTabDotInfo;
195
+ ? styles.responseStatusSuccess
196
+ : styles.responseStatusInfo;
197
197
 
198
198
  return (
199
199
  <li
@@ -210,14 +210,13 @@ function ApiTabsComponent(props) {
210
210
  "tabs__item",
211
211
  styles.tabItem,
212
212
  attributes?.className,
213
+ responseStatusStyle,
213
214
  {
214
- [styles.responseTabActive]: selectedValue === value,
215
+ [styles.active]: selectedValue === value,
215
216
  }
216
217
  )}
217
218
  >
218
- <div
219
- className={clsx(styles.responseTabDot, responseTabDotStyle)}
220
- />
219
+ <div className={styles.responseTabDot} />
221
220
  {label ?? value}
222
221
  </li>
223
222
  );
@@ -18,13 +18,12 @@
18
18
  font-weight: var(--ifm-font-weight-normal);
19
19
  }
20
20
 
21
- .tabItem:not(.responseTabActive) {
21
+ .tabItem:not(.active) {
22
22
  opacity: 0.65;
23
23
  }
24
24
 
25
25
  .tabItem:hover {
26
26
  opacity: 1;
27
- background-color: var(--ifm-color-emphasis-100);
28
27
  }
29
28
 
30
29
  .tabItem:last-child {
@@ -66,19 +65,19 @@
66
65
  border-radius: 50%;
67
66
  }
68
67
 
69
- .responseTabDotSuccess {
68
+ .responseStatusSuccess > .responseTabDot {
70
69
  background-color: var(--ifm-color-success);
71
70
  }
72
71
 
73
- .responseTabDotDanger {
72
+ .responseStatusDanger > .responseTabDot {
74
73
  background-color: var(--ifm-color-danger);
75
74
  }
76
75
 
77
- .responseTabDotInfo {
76
+ .responseStatusInfo > .responseTabDot {
78
77
  background-color: var(--ifm-color-info);
79
78
  }
80
79
 
81
- .responseTabActive {
80
+ .active {
82
81
  background-color: var(--ifm-color-emphasis-100);
83
82
  }
84
83
 
@@ -14,7 +14,7 @@ export function create(tag, props) {
14
14
  return `<${tag}${propString}>${render(children)}</${tag}>`;
15
15
  }
16
16
  export function guard(value, cb) {
17
- if (value !== undefined) {
17
+ if (!!value) {
18
18
  const children = cb(value);
19
19
  return render(children);
20
20
  }
@@ -188,12 +188,12 @@ function ApiTabsComponent(props) {
188
188
  )}
189
189
  >
190
190
  {values.map(({ value, label, attributes }) => {
191
- const responseTabDotStyle =
191
+ const responseStatusStyle =
192
192
  parseInt(value) >= 400
193
- ? styles.responseTabDotDanger
193
+ ? styles.responseStatusDanger
194
194
  : parseInt(value) >= 200 && parseInt(value) < 300
195
- ? styles.responseTabDotSuccess
196
- : styles.responseTabDotInfo;
195
+ ? styles.responseStatusSuccess
196
+ : styles.responseStatusInfo;
197
197
 
198
198
  return (
199
199
  <li
@@ -210,14 +210,13 @@ function ApiTabsComponent(props) {
210
210
  "tabs__item",
211
211
  styles.tabItem,
212
212
  attributes?.className,
213
+ responseStatusStyle,
213
214
  {
214
- [styles.responseTabActive]: selectedValue === value,
215
+ [styles.active]: selectedValue === value,
215
216
  }
216
217
  )}
217
218
  >
218
- <div
219
- className={clsx(styles.responseTabDot, responseTabDotStyle)}
220
- />
219
+ <div className={styles.responseTabDot} />
221
220
  {label ?? value}
222
221
  </li>
223
222
  );
@@ -18,13 +18,12 @@
18
18
  font-weight: var(--ifm-font-weight-normal);
19
19
  }
20
20
 
21
- .tabItem:not(.responseTabActive) {
21
+ .tabItem:not(.active) {
22
22
  opacity: 0.65;
23
23
  }
24
24
 
25
25
  .tabItem:hover {
26
26
  opacity: 1;
27
- background-color: var(--ifm-color-emphasis-100);
28
27
  }
29
28
 
30
29
  .tabItem:last-child {
@@ -66,19 +65,19 @@
66
65
  border-radius: 50%;
67
66
  }
68
67
 
69
- .responseTabDotSuccess {
68
+ .responseStatusSuccess > .responseTabDot {
70
69
  background-color: var(--ifm-color-success);
71
70
  }
72
71
 
73
- .responseTabDotDanger {
72
+ .responseStatusDanger > .responseTabDot {
74
73
  background-color: var(--ifm-color-danger);
75
74
  }
76
75
 
77
- .responseTabDotInfo {
76
+ .responseStatusInfo > .responseTabDot {
78
77
  background-color: var(--ifm-color-info);
79
78
  }
80
79
 
81
- .responseTabActive {
80
+ .active {
82
81
  background-color: var(--ifm-color-emphasis-100);
83
82
  }
84
83
 
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.6.0",
4
+ "version": "1.6.1",
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.6.0",
54
+ "docusaurus-plugin-openapi-docs": "^1.6.1",
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": "937e6543af8c1575877a0ebe7c5732e5cffaa37d"
77
+ "gitHead": "68f648d80d41b82a607215bac0a082f931f80b7c"
78
78
  }
@@ -24,7 +24,7 @@ export function guard<T>(
24
24
  value: T | undefined | string,
25
25
  cb: (value: T) => Children
26
26
  ): string {
27
- if (value !== undefined) {
27
+ if (!!value) {
28
28
  const children = cb(value as T);
29
29
  return render(children);
30
30
  }
@@ -188,12 +188,12 @@ function ApiTabsComponent(props) {
188
188
  )}
189
189
  >
190
190
  {values.map(({ value, label, attributes }) => {
191
- const responseTabDotStyle =
191
+ const responseStatusStyle =
192
192
  parseInt(value) >= 400
193
- ? styles.responseTabDotDanger
193
+ ? styles.responseStatusDanger
194
194
  : parseInt(value) >= 200 && parseInt(value) < 300
195
- ? styles.responseTabDotSuccess
196
- : styles.responseTabDotInfo;
195
+ ? styles.responseStatusSuccess
196
+ : styles.responseStatusInfo;
197
197
 
198
198
  return (
199
199
  <li
@@ -210,14 +210,13 @@ function ApiTabsComponent(props) {
210
210
  "tabs__item",
211
211
  styles.tabItem,
212
212
  attributes?.className,
213
+ responseStatusStyle,
213
214
  {
214
- [styles.responseTabActive]: selectedValue === value,
215
+ [styles.active]: selectedValue === value,
215
216
  }
216
217
  )}
217
218
  >
218
- <div
219
- className={clsx(styles.responseTabDot, responseTabDotStyle)}
220
- />
219
+ <div className={styles.responseTabDot} />
221
220
  {label ?? value}
222
221
  </li>
223
222
  );
@@ -18,13 +18,12 @@
18
18
  font-weight: var(--ifm-font-weight-normal);
19
19
  }
20
20
 
21
- .tabItem:not(.responseTabActive) {
21
+ .tabItem:not(.active) {
22
22
  opacity: 0.65;
23
23
  }
24
24
 
25
25
  .tabItem:hover {
26
26
  opacity: 1;
27
- background-color: var(--ifm-color-emphasis-100);
28
27
  }
29
28
 
30
29
  .tabItem:last-child {
@@ -66,19 +65,19 @@
66
65
  border-radius: 50%;
67
66
  }
68
67
 
69
- .responseTabDotSuccess {
68
+ .responseStatusSuccess > .responseTabDot {
70
69
  background-color: var(--ifm-color-success);
71
70
  }
72
71
 
73
- .responseTabDotDanger {
72
+ .responseStatusDanger > .responseTabDot {
74
73
  background-color: var(--ifm-color-danger);
75
74
  }
76
75
 
77
- .responseTabDotInfo {
76
+ .responseStatusInfo > .responseTabDot {
78
77
  background-color: var(--ifm-color-info);
79
78
  }
80
79
 
81
- .responseTabActive {
80
+ .active {
82
81
  background-color: var(--ifm-color-emphasis-100);
83
82
  }
84
83