docusaurus-theme-openapi-docs 0.0.0-beta.643 → 0.0.0-beta.644

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.
@@ -78,6 +78,10 @@
78
78
  border-left: thin solid var(--openapi-tree-line-color) !important;
79
79
  }
80
80
 
81
+ .openapi-discriminator__name {
82
+ padding-left: 1rem;
83
+ }
84
+
81
85
  @media screen and (max-width: 500px) {
82
86
  .openapi-tabs__discriminator-top-section {
83
87
  flex-direction: column;
@@ -31,9 +31,22 @@
31
31
 
32
32
  .openapi-schema__type {
33
33
  opacity: 0.6;
34
+ padding-left: 0.3rem;
34
35
  }
35
36
 
36
37
  .openapi-schema__required {
37
- font-size: var(--ifm-code-font-size);
38
38
  color: var(--openapi-required);
39
+ margin-left: 1%;
40
+ background-color: transparent;
41
+ font-size: 10.5px;
42
+ }
43
+
44
+ .openapi-schema__divider {
45
+ flex-grow: 1;
46
+ border-bottom: thin solid var(--ifm-toc-border-color);
47
+ margin: 10px;
48
+ }
49
+
50
+ .openapi-schema__container {
51
+ display: flex;
39
52
  }
@@ -37,7 +37,9 @@ function ParamsItem({
37
37
  ));
38
38
 
39
39
  const renderSchemaRequired = guard(required, () => (
40
- <strong className="openapi-schema__required"> required</strong>
40
+ <span className="badge badge--danger openapi-schema__required">
41
+ required
42
+ </span>
41
43
  ));
42
44
 
43
45
  const renderSchema = guard(getQualifierMessage(schema), (message) => (
@@ -118,9 +120,12 @@ function ParamsItem({
118
120
 
119
121
  return (
120
122
  <li className="openapi-params__list-item">
121
- <strong>{name}</strong>
122
- {renderSchemaName}
123
- {renderSchemaRequired}
123
+ <span className="openapi-schema__container">
124
+ <strong>{name}</strong>
125
+ {renderSchemaName}
126
+ {required && <span class="openapi-schema__divider"></span>}
127
+ {renderSchemaRequired}
128
+ </span>
124
129
  {renderSchema}
125
130
  {renderDefaultValue}
126
131
  {renderDescription}
@@ -31,23 +31,40 @@
31
31
 
32
32
  .openapi-schema__name {
33
33
  opacity: 0.6;
34
+ padding-left: 0.3rem;
34
35
  }
35
36
 
36
37
  .openapi-schema__required {
37
- font-size: var(--ifm-code-font-size);
38
38
  color: var(--openapi-required);
39
+ margin-left: 1%;
40
+ background-color: transparent;
41
+ font-size: 10.5px;
39
42
  }
40
43
 
41
44
  .openapi-schema__deprecated {
42
- font-size: var(--ifm-code-font-size);
43
45
  color: var(--openapi-deprecated);
46
+ margin-left: 1%;
47
+ background-color: transparent;
48
+ font-size: 10.5px;
44
49
  }
45
50
 
46
51
  .openapi-schema__nullable {
47
- font-size: var(--ifm-code-font-size);
48
52
  color: var(--openapi-nullable);
53
+ margin-left: 1%;
54
+ background-color: transparent;
55
+ font-size: 10.5px;
49
56
  }
50
57
 
51
58
  .openapi-schema__strikethrough {
52
59
  text-decoration: line-through;
53
60
  }
61
+
62
+ .openapi-schema__divider {
63
+ flex-grow: 1;
64
+ border-bottom: thin solid var(--ifm-toc-border-color);
65
+ margin: 10px;
66
+ }
67
+
68
+ .openapi-schema__container {
69
+ display: flex;
70
+ }
@@ -37,15 +37,21 @@ function SchemaItem({
37
37
 
38
38
  const renderRequired = guard(
39
39
  Array.isArray(required) ? required.includes(name) : required,
40
- () => <strong className="openapi-schema__required"> required</strong>
40
+ () => (
41
+ <span className="badge badge--danger openapi-schema__required">
42
+ required
43
+ </span>
44
+ )
41
45
  );
42
46
 
43
47
  const renderDeprecated = guard(deprecated, () => (
44
- <strong className="openapi-schema__deprecated"> deprecated</strong>
48
+ <span className="badge badge--warning openapi-schema__deprecated">
49
+ deprecated
50
+ </span>
45
51
  ));
46
52
 
47
53
  const renderNullable = guard(nullable, () => (
48
- <strong className="openapi-schema__nullable"> nullable</strong>
54
+ <span className="badge badge--info openapi-schema__nullable">nullable</span>
49
55
  ));
50
56
 
51
57
  const renderSchemaDescription = guard(schemaDescription, (description) => (
@@ -89,13 +95,18 @@ function SchemaItem({
89
95
 
90
96
  const schemaContent = (
91
97
  <div>
92
- <strong className={deprecated && "openapi-schema__strikethrough"}>
93
- {name}
94
- </strong>
95
- <span className="openapi-schema__name"> {schemaName}</span>
96
- {renderNullable}
97
- {!deprecated && renderRequired}
98
- {renderDeprecated}
98
+ <span className="openapi-schema__container">
99
+ <strong className={deprecated && "openapi-schema__strikethrough"}>
100
+ {name}
101
+ </strong>
102
+ <span className="openapi-schema__name"> {schemaName}</span>
103
+ {(nullable || required || deprecated) && (
104
+ <span class="openapi-schema__divider"></span>
105
+ )}
106
+ {renderNullable}
107
+ {!deprecated && renderRequired}
108
+ {renderDeprecated}
109
+ </span>
99
110
  {renderQualifierMessage}
100
111
  {renderDefaultValue}
101
112
  {renderSchemaDescription}
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-beta.643",
4
+ "version": "0.0.0-beta.644",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -48,7 +48,7 @@
48
48
  "buffer": "^6.0.3",
49
49
  "clsx": "^1.1.1",
50
50
  "crypto-js": "^4.1.1",
51
- "docusaurus-plugin-openapi-docs": "0.0.0-beta.643",
51
+ "docusaurus-plugin-openapi-docs": "0.0.0-beta.644",
52
52
  "docusaurus-plugin-sass": "^0.2.3",
53
53
  "file-saver": "^2.0.5",
54
54
  "immer": "^9.0.7",
@@ -73,5 +73,5 @@
73
73
  "engines": {
74
74
  "node": ">=14"
75
75
  },
76
- "gitHead": "a39283387e2ef0c1af3a76f4f69aed4ceb0cf33e"
76
+ "gitHead": "82e67409b8afa0f1d4deaeb77b87b0b5b67e6a9c"
77
77
  }
@@ -78,6 +78,10 @@
78
78
  border-left: thin solid var(--openapi-tree-line-color) !important;
79
79
  }
80
80
 
81
+ .openapi-discriminator__name {
82
+ padding-left: 1rem;
83
+ }
84
+
81
85
  @media screen and (max-width: 500px) {
82
86
  .openapi-tabs__discriminator-top-section {
83
87
  flex-direction: column;
@@ -31,9 +31,22 @@
31
31
 
32
32
  .openapi-schema__type {
33
33
  opacity: 0.6;
34
+ padding-left: 0.3rem;
34
35
  }
35
36
 
36
37
  .openapi-schema__required {
37
- font-size: var(--ifm-code-font-size);
38
38
  color: var(--openapi-required);
39
+ margin-left: 1%;
40
+ background-color: transparent;
41
+ font-size: 10.5px;
42
+ }
43
+
44
+ .openapi-schema__divider {
45
+ flex-grow: 1;
46
+ border-bottom: thin solid var(--ifm-toc-border-color);
47
+ margin: 10px;
48
+ }
49
+
50
+ .openapi-schema__container {
51
+ display: flex;
39
52
  }
@@ -37,7 +37,9 @@ function ParamsItem({
37
37
  ));
38
38
 
39
39
  const renderSchemaRequired = guard(required, () => (
40
- <strong className="openapi-schema__required"> required</strong>
40
+ <span className="badge badge--danger openapi-schema__required">
41
+ required
42
+ </span>
41
43
  ));
42
44
 
43
45
  const renderSchema = guard(getQualifierMessage(schema), (message) => (
@@ -118,9 +120,12 @@ function ParamsItem({
118
120
 
119
121
  return (
120
122
  <li className="openapi-params__list-item">
121
- <strong>{name}</strong>
122
- {renderSchemaName}
123
- {renderSchemaRequired}
123
+ <span className="openapi-schema__container">
124
+ <strong>{name}</strong>
125
+ {renderSchemaName}
126
+ {required && <span class="openapi-schema__divider"></span>}
127
+ {renderSchemaRequired}
128
+ </span>
124
129
  {renderSchema}
125
130
  {renderDefaultValue}
126
131
  {renderDescription}
@@ -31,23 +31,40 @@
31
31
 
32
32
  .openapi-schema__name {
33
33
  opacity: 0.6;
34
+ padding-left: 0.3rem;
34
35
  }
35
36
 
36
37
  .openapi-schema__required {
37
- font-size: var(--ifm-code-font-size);
38
38
  color: var(--openapi-required);
39
+ margin-left: 1%;
40
+ background-color: transparent;
41
+ font-size: 10.5px;
39
42
  }
40
43
 
41
44
  .openapi-schema__deprecated {
42
- font-size: var(--ifm-code-font-size);
43
45
  color: var(--openapi-deprecated);
46
+ margin-left: 1%;
47
+ background-color: transparent;
48
+ font-size: 10.5px;
44
49
  }
45
50
 
46
51
  .openapi-schema__nullable {
47
- font-size: var(--ifm-code-font-size);
48
52
  color: var(--openapi-nullable);
53
+ margin-left: 1%;
54
+ background-color: transparent;
55
+ font-size: 10.5px;
49
56
  }
50
57
 
51
58
  .openapi-schema__strikethrough {
52
59
  text-decoration: line-through;
53
60
  }
61
+
62
+ .openapi-schema__divider {
63
+ flex-grow: 1;
64
+ border-bottom: thin solid var(--ifm-toc-border-color);
65
+ margin: 10px;
66
+ }
67
+
68
+ .openapi-schema__container {
69
+ display: flex;
70
+ }
@@ -37,15 +37,21 @@ function SchemaItem({
37
37
 
38
38
  const renderRequired = guard(
39
39
  Array.isArray(required) ? required.includes(name) : required,
40
- () => <strong className="openapi-schema__required"> required</strong>
40
+ () => (
41
+ <span className="badge badge--danger openapi-schema__required">
42
+ required
43
+ </span>
44
+ )
41
45
  );
42
46
 
43
47
  const renderDeprecated = guard(deprecated, () => (
44
- <strong className="openapi-schema__deprecated"> deprecated</strong>
48
+ <span className="badge badge--warning openapi-schema__deprecated">
49
+ deprecated
50
+ </span>
45
51
  ));
46
52
 
47
53
  const renderNullable = guard(nullable, () => (
48
- <strong className="openapi-schema__nullable"> nullable</strong>
54
+ <span className="badge badge--info openapi-schema__nullable">nullable</span>
49
55
  ));
50
56
 
51
57
  const renderSchemaDescription = guard(schemaDescription, (description) => (
@@ -89,13 +95,18 @@ function SchemaItem({
89
95
 
90
96
  const schemaContent = (
91
97
  <div>
92
- <strong className={deprecated && "openapi-schema__strikethrough"}>
93
- {name}
94
- </strong>
95
- <span className="openapi-schema__name"> {schemaName}</span>
96
- {renderNullable}
97
- {!deprecated && renderRequired}
98
- {renderDeprecated}
98
+ <span className="openapi-schema__container">
99
+ <strong className={deprecated && "openapi-schema__strikethrough"}>
100
+ {name}
101
+ </strong>
102
+ <span className="openapi-schema__name"> {schemaName}</span>
103
+ {(nullable || required || deprecated) && (
104
+ <span class="openapi-schema__divider"></span>
105
+ )}
106
+ {renderNullable}
107
+ {!deprecated && renderRequired}
108
+ {renderDeprecated}
109
+ </span>
99
110
  {renderQualifierMessage}
100
111
  {renderDefaultValue}
101
112
  {renderSchemaDescription}