rapidoc 11.0.1 → 12.1.0
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/README.md +171 -54
- package/dist/rapidoc-flow-min.js +580 -0
- package/dist/rapidoc-flow-min.js.LICENSE.txt +171 -0
- package/dist/rapidoc-min.js +645 -202
- package/dist/rapidoc-min.js.LICENSE.txt +381 -0
- package/package.json +57 -42
- package/src/README.md +150 -0
- package/src/components/README.md +91 -0
- package/src/components/api-request.ts +912 -0
- package/src/components/api-response.ts +514 -0
- package/src/components/json-tree.ts +171 -0
- package/src/components/schema-base-element.ts +329 -0
- package/src/components/schema-table.ts +475 -0
- package/src/components/schema-tree.ts +393 -0
- package/src/components/tag-input.ts +180 -0
- package/src/flow.js +3 -0
- package/src/index.js +6 -0
- package/src/oauth-receiver.ts +29 -0
- package/src/rapi-flow.ts +1178 -0
- package/src/rapidoc-mini.ts +603 -0
- package/src/rapidoc.ts +1854 -0
- package/src/styles/README.md +96 -0
- package/src/styles/auth-styles.js +318 -0
- package/src/styles/border-styles.js +24 -0
- package/src/styles/css-bundle.js +129 -0
- package/src/styles/custom-styles.js +8 -0
- package/src/styles/dialog-box-styles.js +102 -0
- package/src/styles/endpoint-styles.js +564 -0
- package/src/styles/flex-styles.js +16 -0
- package/src/styles/flow-styles.js +248 -0
- package/src/styles/font-styles.js +432 -0
- package/src/styles/info-styles.js +36 -0
- package/src/styles/input-styles.js +555 -0
- package/src/styles/layout-styles.js +396 -0
- package/src/styles/microlighter-styles.js +99 -0
- package/src/styles/nav-styles.js +633 -0
- package/src/styles/param-list-styles.js +261 -0
- package/src/styles/schema-styles.js +296 -0
- package/src/styles/tab-styles.js +106 -0
- package/src/styles/theme-tokens.js +582 -0
- package/src/templates/README.md +89 -0
- package/src/templates/advanced-search-dialog-template.js +94 -0
- package/src/templates/api-response-template.js +223 -0
- package/src/templates/callback-template.js +86 -0
- package/src/templates/code-samples-template.js +52 -0
- package/src/templates/components-template.js +86 -0
- package/src/templates/downloads-template.js +70 -0
- package/src/templates/endpoint-template.js +377 -0
- package/src/templates/expanded-endpoint-template.js +270 -0
- package/src/templates/focused-endpoint-template.js +146 -0
- package/src/templates/header-template.js +92 -0
- package/src/templates/logo-template.js +21 -0
- package/src/templates/main-body-template.js +102 -0
- package/src/templates/navbar-template.js +498 -0
- package/src/templates/overview-template.js +104 -0
- package/src/templates/request-body-template.js +673 -0
- package/src/templates/request-params-template.js +485 -0
- package/src/templates/security-scheme-template.js +1272 -0
- package/src/templates/server-template.js +153 -0
- package/src/utils/README.md +146 -0
- package/src/utils/arazzo/README.md +119 -0
- package/src/utils/arazzo/components.js +15 -0
- package/src/utils/arazzo/graph.js +269 -0
- package/src/utils/arazzo/index.js +52 -0
- package/src/utils/arazzo/operations.js +106 -0
- package/src/utils/arazzo/parse.js +196 -0
- package/src/utils/arazzo/refs.js +40 -0
- package/src/utils/arazzo/svg.js +707 -0
- package/src/utils/auto-color-scheme.js +99 -0
- package/src/utils/bind-navbar.js +175 -0
- package/src/utils/color-utils.js +59 -0
- package/src/utils/common-utils.js +191 -0
- package/src/utils/curl-utils.js +126 -0
- package/src/utils/highlighter.js +419 -0
- package/src/utils/markdown-utils.js +110 -0
- package/src/utils/mcp/README.md +155 -0
- package/src/utils/mcp/common.js +166 -0
- package/src/utils/mcp/manifest.js +382 -0
- package/src/utils/mcp/project/server.ts +53 -0
- package/src/utils/mcp/project.js +88 -0
- package/src/utils/mcp/runtime.js +289 -0
- package/src/utils/mcp/schema.js +98 -0
- package/src/utils/mcp/workflow-runtime.js +374 -0
- package/src/utils/mcp/workflows.js +240 -0
- package/src/utils/mcp/zip.js +102 -0
- package/src/utils/mcp-generator.js +47 -0
- package/src/utils/mock-interceptor.js +557 -0
- package/src/utils/oauth-utils.js +87 -0
- package/src/utils/request-utils.js +264 -0
- package/src/utils/response-utils.js +203 -0
- package/src/utils/sanitize.js +57 -0
- package/src/utils/schema-utils.js +1954 -0
- package/src/utils/slugger.js +187 -0
- package/src/utils/spec-parser.js +941 -0
- package/src/utils/url-utils.js +246 -0
- package/src/utils/xml-utils.js +61 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parameter lists: one `<li class="param">` per parameter on a shared three-column grid
|
|
5
|
+
* (label | input | constraint). Each row is a subgrid, so columns line up across rows and
|
|
6
|
+
* every row draws its own full-width border. Stacks to one column on narrow containers.
|
|
7
|
+
*/
|
|
8
|
+
export default css`
|
|
9
|
+
.param-list-container {
|
|
10
|
+
container-type: inline-size;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.param-list {
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: var(--param-label-width) minmax(10rem, 1fr) minmax(0, 1.5fr);
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
list-style: none;
|
|
19
|
+
border: 1px solid var(--border);
|
|
20
|
+
border-radius: min(var(--radius), 0.5rem);
|
|
21
|
+
/* Card surface: --card, partly transparent so a background gradient shows through */
|
|
22
|
+
background: color-mix(in srgb, var(--card) 80%, transparent);
|
|
23
|
+
font-size: var(--font-size-small);
|
|
24
|
+
line-height: calc(var(--font-size-small) + 4px);
|
|
25
|
+
word-break: break-word;
|
|
26
|
+
direction: ltr;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.param {
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-column: 1 / -1;
|
|
32
|
+
grid-template-columns: subgrid;
|
|
33
|
+
column-gap: var(--param-gap);
|
|
34
|
+
row-gap: var(--param-row-gap);
|
|
35
|
+
padding: var(--param-padding);
|
|
36
|
+
margin: 0;
|
|
37
|
+
|
|
38
|
+
& + .param {
|
|
39
|
+
border-top: 1px solid var(--border);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.param-label {
|
|
44
|
+
grid-column: 1;
|
|
45
|
+
grid-row: 1 / span 2;
|
|
46
|
+
min-width: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.param-input {
|
|
50
|
+
grid-column: 2;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/*
|
|
55
|
+
* Single-line controls match the two-line label (name over type: 2 x 1.35em + 3px). A fixed line-height
|
|
56
|
+
* keeps mono and sans controls the same height: 1.25em + 2 x 0.75em + 2px border = 2.75em + 2px.
|
|
57
|
+
* <tag-input> and file inputs reach the same height in tag-input.ts and input-styles.js.
|
|
58
|
+
*/
|
|
59
|
+
.param-input :is(input[type='text'], input[type='password'], select) {
|
|
60
|
+
line-height: 1.25;
|
|
61
|
+
padding: 0.75em;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Room for the background-image arrow where the native select is still drawn */
|
|
65
|
+
@supports not (appearance: base-select) {
|
|
66
|
+
.param-input select {
|
|
67
|
+
padding-right: 2.25em;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Constraints: label/value pairs; the labels share one column, so all values start at the same place */
|
|
72
|
+
.param-constraint {
|
|
73
|
+
grid-column: 3;
|
|
74
|
+
display: grid;
|
|
75
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
76
|
+
align-content: start;
|
|
77
|
+
column-gap: var(--value-list-label-gap);
|
|
78
|
+
row-gap: var(--param-row-gap);
|
|
79
|
+
min-width: 0;
|
|
80
|
+
margin: 0;
|
|
81
|
+
|
|
82
|
+
& > dd {
|
|
83
|
+
min-width: 0;
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.param-details {
|
|
89
|
+
grid-column: 2 / -1;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
|
|
92
|
+
&:not(:has(*)) {
|
|
93
|
+
display: none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Without a constraint, the input takes both right-hand columns; without an input, the constraint does. */
|
|
98
|
+
.param:not(:has(.param-constraint)) .param-input,
|
|
99
|
+
.param:not(:has(.param-input)) .param-constraint {
|
|
100
|
+
grid-column: 2 / -1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.param-name,
|
|
104
|
+
.param-type {
|
|
105
|
+
margin: 1px 0;
|
|
106
|
+
text-align: right;
|
|
107
|
+
line-height: 1.35;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.param-name {
|
|
111
|
+
color: var(--foreground);
|
|
112
|
+
font-family: var(--font-mono);
|
|
113
|
+
|
|
114
|
+
&.deprecated {
|
|
115
|
+
color: var(--destructive);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.param-required {
|
|
120
|
+
color: var(--destructive);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.param-deprecated-icon {
|
|
124
|
+
stroke: var(--destructive);
|
|
125
|
+
margin-right: -6px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.param-type {
|
|
129
|
+
color: var(--muted-foreground);
|
|
130
|
+
font-family: var(--font-sans);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.param-constraint-label {
|
|
134
|
+
font-weight: 600;
|
|
135
|
+
color: var(--muted-foreground);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/*
|
|
139
|
+
* Label + values (Allowed values, Examples): wrapped lines hang under the first value,
|
|
140
|
+
* and each separator stays at the end of its line.
|
|
141
|
+
*/
|
|
142
|
+
.value-list {
|
|
143
|
+
display: grid;
|
|
144
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
145
|
+
column-gap: var(--value-list-label-gap);
|
|
146
|
+
align-items: baseline;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.value-list-items {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-wrap: wrap;
|
|
152
|
+
row-gap: var(--value-list-row-gap);
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
list-style: none;
|
|
156
|
+
|
|
157
|
+
& > li {
|
|
158
|
+
margin: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
& > li:not(:last-child)::after {
|
|
162
|
+
content: '┃';
|
|
163
|
+
margin-inline: var(--value-list-gap);
|
|
164
|
+
color: var(--muted-foreground);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/*
|
|
169
|
+
* Clickable values (allowed values, examples): small mono chips that fill the parameter's input.
|
|
170
|
+
* Buttons, not links: a tinted hover instead of an underline. Read-only (disabled) when try-it is off.
|
|
171
|
+
*/
|
|
172
|
+
.value-chip {
|
|
173
|
+
display: inline-block;
|
|
174
|
+
max-width: 100%;
|
|
175
|
+
margin: 0;
|
|
176
|
+
padding: 0 0.4em;
|
|
177
|
+
font: inherit;
|
|
178
|
+
font-family: var(--font-mono);
|
|
179
|
+
line-height: inherit;
|
|
180
|
+
text-align: start;
|
|
181
|
+
overflow-wrap: anywhere;
|
|
182
|
+
color: var(--foreground);
|
|
183
|
+
background: color-mix(in srgb, var(--foreground) 6%, transparent);
|
|
184
|
+
border: none;
|
|
185
|
+
border-radius: var(--radius);
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
transition:
|
|
188
|
+
background-color 0.15s ease,
|
|
189
|
+
color 0.15s ease;
|
|
190
|
+
|
|
191
|
+
&:hover {
|
|
192
|
+
color: var(--primary);
|
|
193
|
+
background: color-mix(in srgb, var(--primary) 14%, transparent);
|
|
194
|
+
}
|
|
195
|
+
&:focus-visible {
|
|
196
|
+
outline: none;
|
|
197
|
+
box-shadow: var(--focus-shadow);
|
|
198
|
+
}
|
|
199
|
+
&:disabled {
|
|
200
|
+
color: var(--foreground);
|
|
201
|
+
background: color-mix(in srgb, var(--foreground) 6%, transparent);
|
|
202
|
+
cursor: text;
|
|
203
|
+
user-select: text;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* A list of chips is spaced apart instead of using the ┃ separators */
|
|
208
|
+
.value-list-items:has(> li > .value-chip) {
|
|
209
|
+
column-gap: 0.375em;
|
|
210
|
+
|
|
211
|
+
& > li::after {
|
|
212
|
+
content: none;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* Long-format examples: no marker (a triangle reads as a toggle), each entry set off by a thin rule */
|
|
217
|
+
.param-example-list {
|
|
218
|
+
margin: var(--param-row-gap) 0 0;
|
|
219
|
+
padding: 0;
|
|
220
|
+
list-style: none;
|
|
221
|
+
|
|
222
|
+
& > li {
|
|
223
|
+
margin: 0 0 var(--param-row-gap);
|
|
224
|
+
padding-inline-start: var(--param-padding);
|
|
225
|
+
border-inline-start: 2px solid var(--border);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* The accent appears only when the example can be applied (hover or keyboard focus on its link) */
|
|
229
|
+
& > li:is(:hover, :focus-within) {
|
|
230
|
+
border-inline-start-color: var(--primary);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@container (max-width: 36rem) {
|
|
235
|
+
.param-list {
|
|
236
|
+
grid-template-columns: minmax(0, 1fr);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.param-label,
|
|
240
|
+
.param-input,
|
|
241
|
+
.param-constraint,
|
|
242
|
+
.param-details,
|
|
243
|
+
.param:not(:has(.param-constraint)) .param-input,
|
|
244
|
+
.param:not(:has(.param-input)) .param-constraint {
|
|
245
|
+
grid-column: 1;
|
|
246
|
+
grid-row: auto;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.param-label {
|
|
250
|
+
display: flex;
|
|
251
|
+
flex-wrap: wrap;
|
|
252
|
+
align-items: baseline;
|
|
253
|
+
gap: var(--param-gap);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.param-name,
|
|
257
|
+
.param-type {
|
|
258
|
+
text-align: start;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
`;
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
*,
|
|
5
|
+
*:before,
|
|
6
|
+
*:after {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
:host {
|
|
10
|
+
container-type: inline-size;
|
|
11
|
+
interpolate-size: allow-keywords;
|
|
12
|
+
}
|
|
13
|
+
.tr {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex: none;
|
|
16
|
+
width: 100%;
|
|
17
|
+
box-sizing: content-box;
|
|
18
|
+
border-bottom: 1px dotted transparent;
|
|
19
|
+
transition: max-height 0.3s ease-out;
|
|
20
|
+
|
|
21
|
+
&.expanded-descr {
|
|
22
|
+
max-height: 3000px;
|
|
23
|
+
|
|
24
|
+
@supports (interpolate-size: allow-keywords) {
|
|
25
|
+
max-height: max-content;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
.td {
|
|
30
|
+
display: block;
|
|
31
|
+
flex: 0 0 auto;
|
|
32
|
+
}
|
|
33
|
+
.key {
|
|
34
|
+
font-family: var(--font-mono);
|
|
35
|
+
white-space: normal;
|
|
36
|
+
word-break: break-all;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.collapsed-all-descr .key {
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
}
|
|
42
|
+
.key-descr {
|
|
43
|
+
font-family: var(--font-sans);
|
|
44
|
+
color: var(--muted-foreground);
|
|
45
|
+
flex-shrink: 1;
|
|
46
|
+
min-width: 0;
|
|
47
|
+
gap: 4px;
|
|
48
|
+
align-items: flex-start;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
display: flex;
|
|
51
|
+
|
|
52
|
+
/* in the description box's start padding, so descriptions line up whether or not a row shows its arrow */
|
|
53
|
+
& .descr-expand-toggle {
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: 0;
|
|
56
|
+
inset-inline-start: 0;
|
|
57
|
+
width: 1em;
|
|
58
|
+
text-align: center;
|
|
59
|
+
user-select: none;
|
|
60
|
+
color: var(--foreground);
|
|
61
|
+
font-weight: 400;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
transform: rotate(45deg);
|
|
64
|
+
transition: transform 0.2s ease;
|
|
65
|
+
border-radius: 2px;
|
|
66
|
+
visibility: hidden;
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
color: var(--primary);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:focus-visible {
|
|
73
|
+
outline: 2px solid var(--primary);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
& .descr-body {
|
|
78
|
+
flex: 1;
|
|
79
|
+
min-width: 0;
|
|
80
|
+
position: relative;
|
|
81
|
+
padding-inline-start: calc(1em + 4px);
|
|
82
|
+
|
|
83
|
+
/* the arrow comes first, so the first block is no longer :first-child for the markdown margins */
|
|
84
|
+
& > .descr-expand-toggle + * {
|
|
85
|
+
margin-top: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
& .item-details {
|
|
89
|
+
margin-top: 2px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
& .descr-chip {
|
|
93
|
+
display: inline-block;
|
|
94
|
+
line-break: anywhere;
|
|
95
|
+
margin-right: 8px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* one-line stand-in for a table, code block, HTML block or blockquote; shown only in collapsed rows */
|
|
99
|
+
& .descr-summary {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
& .descr-placeholder {
|
|
103
|
+
color: var(--muted-foreground);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* constraint chips and array limits: "Allowed:", "Min Items:" … then the value in mono */
|
|
108
|
+
& .descr-label,
|
|
109
|
+
& b {
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
font-size: var(--font-size-xs);
|
|
112
|
+
color: var(--primary);
|
|
113
|
+
}
|
|
114
|
+
& .descr-value {
|
|
115
|
+
font-family: var(--font-mono);
|
|
116
|
+
font-size: var(--font-size-small);
|
|
117
|
+
line-height: 1; /* the mono font's metrics would otherwise make the line 1px taller */
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* -90deg rather than 270deg: same direction, but it turns anticlockwise to expand and clockwise to collapse */
|
|
122
|
+
.expanded-descr .key-descr .descr-expand-toggle {
|
|
123
|
+
transform: rotate(-90deg);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/*
|
|
127
|
+
* The arrow shows when the row has hidden content, and on an expanded row so it can be collapsed again.
|
|
128
|
+
* Rows cut off for length get it from the scroll-state query below.
|
|
129
|
+
*/
|
|
130
|
+
.key-descr .descr-body.has-more > .descr-expand-toggle,
|
|
131
|
+
.tr.expanded-descr .key-descr .descr-expand-toggle {
|
|
132
|
+
visibility: visible;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* hidden, not removed, so switching to multiline doesn't shift the descriptions sideways */
|
|
136
|
+
.expanded-all-descr .tr .key-descr .descr-body > .descr-expand-toggle {
|
|
137
|
+
visibility: hidden;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* a row expanded by clicking collapses again on click */
|
|
141
|
+
.collapsed-all-descr .tr.expanded-descr .descr-body {
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Collapsed rows: only the first block (or the chips), on one line, with a plain ellipsis (in the text color) when it is cut off */
|
|
146
|
+
.collapsed-all-descr .tr:not(.expanded-descr) .descr-body {
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
text-overflow: ellipsis;
|
|
150
|
+
color: var(--foreground);
|
|
151
|
+
|
|
152
|
+
/* only rows that expand on click look clickable; cut-off rows get the pointer from the scroll-state query below */
|
|
153
|
+
&.has-more {
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* the first block after the arrow */
|
|
158
|
+
& > .descr-expand-toggle + * {
|
|
159
|
+
display: inline;
|
|
160
|
+
margin: 0;
|
|
161
|
+
padding: 0;
|
|
162
|
+
white-space: inherit;
|
|
163
|
+
}
|
|
164
|
+
& > .descr-expand-toggle + :is(ul, ol) > li {
|
|
165
|
+
display: inline;
|
|
166
|
+
}
|
|
167
|
+
/* a heading on the one line reads as the description, not as a section title */
|
|
168
|
+
& > .descr-expand-toggle + :is(h1, h2, h3, h4, h5, h6) {
|
|
169
|
+
font-size: var(--font-size-description);
|
|
170
|
+
line-height: inherit;
|
|
171
|
+
font-weight: 600;
|
|
172
|
+
}
|
|
173
|
+
/* inline so a long chip is cut mid-text: an inline-block chip is dropped whole, leaving the ellipsis far from the edge */
|
|
174
|
+
& .descr-chip {
|
|
175
|
+
display: inline;
|
|
176
|
+
}
|
|
177
|
+
& > .descr-expand-toggle + :is(ul, ol) > li:not(:first-child),
|
|
178
|
+
& > .descr-expand-toggle + * ~ * {
|
|
179
|
+
display: none;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* Where scroll-state queries work (Chromium), a row whose line is cut off shows the arrow too */
|
|
184
|
+
@supports (container-type: scroll-state) {
|
|
185
|
+
.collapsed-all-descr .tr:not(.expanded-descr) .descr-body {
|
|
186
|
+
container-type: scroll-state;
|
|
187
|
+
}
|
|
188
|
+
@container scroll-state(scrollable: inline-end) {
|
|
189
|
+
.descr-body > * {
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
}
|
|
192
|
+
.descr-body > .descr-expand-toggle {
|
|
193
|
+
visibility: visible;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.xxx-of-key {
|
|
199
|
+
font-size: var(--font-size-xs);
|
|
200
|
+
line-height: calc(var(--font-size-small) + 1px);
|
|
201
|
+
padding: 1px 6px;
|
|
202
|
+
border-radius: var(--radius);
|
|
203
|
+
corner-shape: squircle;
|
|
204
|
+
border: 1px solid var(--primary);
|
|
205
|
+
background: color-mix(in srgb, var(--primary) 12%, transparent);
|
|
206
|
+
color: var(--primary);
|
|
207
|
+
margin-bottom: 1px;
|
|
208
|
+
display: inline-block;
|
|
209
|
+
vertical-align: middle;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.xxx-of-descr {
|
|
213
|
+
font-family: var(--font-sans);
|
|
214
|
+
color: var(--primary);
|
|
215
|
+
font-size: var(--font-size-xs);
|
|
216
|
+
margin-inline-start: 4px;
|
|
217
|
+
vertical-align: middle;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.stri,
|
|
221
|
+
.string,
|
|
222
|
+
.uri,
|
|
223
|
+
.url,
|
|
224
|
+
.byte,
|
|
225
|
+
.bina,
|
|
226
|
+
.date,
|
|
227
|
+
.pass,
|
|
228
|
+
.ipv4,
|
|
229
|
+
.ipv4,
|
|
230
|
+
.uuid,
|
|
231
|
+
.emai,
|
|
232
|
+
.host {
|
|
233
|
+
color: var(--green);
|
|
234
|
+
}
|
|
235
|
+
.inte,
|
|
236
|
+
.numb,
|
|
237
|
+
.number,
|
|
238
|
+
.int6,
|
|
239
|
+
.int3,
|
|
240
|
+
.floa,
|
|
241
|
+
.doub,
|
|
242
|
+
.deci {
|
|
243
|
+
color: var(--blue);
|
|
244
|
+
}
|
|
245
|
+
.null {
|
|
246
|
+
color: var(--destructive);
|
|
247
|
+
}
|
|
248
|
+
.bool,
|
|
249
|
+
.boolean {
|
|
250
|
+
color: var(--orange);
|
|
251
|
+
}
|
|
252
|
+
.enum {
|
|
253
|
+
color: var(--purple);
|
|
254
|
+
}
|
|
255
|
+
.cons {
|
|
256
|
+
color: var(--purple);
|
|
257
|
+
}
|
|
258
|
+
.recu {
|
|
259
|
+
color: var(--brown);
|
|
260
|
+
}
|
|
261
|
+
.toolbar {
|
|
262
|
+
display: flex;
|
|
263
|
+
width: 100%;
|
|
264
|
+
padding: 2px 0;
|
|
265
|
+
color: var(--primary);
|
|
266
|
+
}
|
|
267
|
+
.toolbar-item {
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
padding: 5px 0;
|
|
270
|
+
margin: 0 2px;
|
|
271
|
+
|
|
272
|
+
&:first-of-type {
|
|
273
|
+
margin: 0 2px 0 0;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
.schema-root-type {
|
|
277
|
+
cursor: auto;
|
|
278
|
+
color: var(--muted-foreground);
|
|
279
|
+
font-weight: 600;
|
|
280
|
+
text-transform: uppercase;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Narrow schemas (phones): a description gets a line of its own under its field instead of a column (#1074) */
|
|
284
|
+
@container (width < 500px) {
|
|
285
|
+
.tr {
|
|
286
|
+
flex-wrap: wrap;
|
|
287
|
+
}
|
|
288
|
+
.tr > .key-descr {
|
|
289
|
+
flex-basis: 100%;
|
|
290
|
+
|
|
291
|
+
&:empty {
|
|
292
|
+
display: none;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
`;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tabs: a row of text tabs over a 1px rule. The active tab's 2px underline sits on that rule.
|
|
5
|
+
* Controls that belong to the whole tab set (e.g. the media-type select) go at the end of the
|
|
6
|
+
* row with .tab-bar-end, flush with the right edge of the content below.
|
|
7
|
+
*/
|
|
8
|
+
export default css`
|
|
9
|
+
.tab-panel {
|
|
10
|
+
min-width: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.tabs,
|
|
14
|
+
.tab-buttons {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 1.25em;
|
|
18
|
+
min-height: 2.5em;
|
|
19
|
+
/* The rule is an inset shadow so the active tab's underline paints over it */
|
|
20
|
+
box-shadow: inset 0 -1px 0 var(--border);
|
|
21
|
+
font-size: var(--font-size-small);
|
|
22
|
+
overflow-x: auto;
|
|
23
|
+
scrollbar-width: none;
|
|
24
|
+
|
|
25
|
+
&::-webkit-scrollbar {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.tab,
|
|
31
|
+
.tab-btn {
|
|
32
|
+
align-self: stretch;
|
|
33
|
+
flex: none;
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 0 0.125em;
|
|
36
|
+
font-family: var(--font-sans);
|
|
37
|
+
font-size: inherit;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
letter-spacing: 0.04em;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
color: var(--muted-foreground);
|
|
42
|
+
background: none;
|
|
43
|
+
border: none;
|
|
44
|
+
border-bottom: 2px solid transparent;
|
|
45
|
+
border-radius: 0;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
transition:
|
|
48
|
+
color 0.15s ease,
|
|
49
|
+
border-color 0.15s ease;
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
color: var(--foreground);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.tab-active,
|
|
56
|
+
&.active {
|
|
57
|
+
color: var(--primary);
|
|
58
|
+
border-bottom-color: var(--primary);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:focus-visible {
|
|
62
|
+
outline: 2px solid var(--ring);
|
|
63
|
+
outline-offset: -2px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Pushed to the end of the tab row */
|
|
68
|
+
.tab-bar-end {
|
|
69
|
+
flex: none;
|
|
70
|
+
margin-inline-start: auto;
|
|
71
|
+
color: var(--muted-foreground);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Compact select in a tab row or example header: same height as .btn-sm, quieter than a form field */
|
|
75
|
+
select.select-sm {
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
padding: 0.3em 0.75em;
|
|
78
|
+
font-size: var(--font-size-small);
|
|
79
|
+
background-color: transparent;
|
|
80
|
+
}
|
|
81
|
+
@supports not (appearance: base-select) {
|
|
82
|
+
select.select-sm {
|
|
83
|
+
padding-right: 2em;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Example picker: its own line above the example, aligned with the content's left edge */
|
|
88
|
+
.example-select {
|
|
89
|
+
display: flex;
|
|
90
|
+
width: fit-content;
|
|
91
|
+
margin-bottom: 0.75em;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.tab-content {
|
|
95
|
+
position: relative;
|
|
96
|
+
min-width: 0;
|
|
97
|
+
min-height: 50px;
|
|
98
|
+
padding-top: 0.75em;
|
|
99
|
+
|
|
100
|
+
& .toolbar-btn {
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: 12px;
|
|
103
|
+
right: 8px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`;
|