rapidoc 11.0.0 → 12.0.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.
Files changed (80) hide show
  1. package/README.md +46 -31
  2. package/dist/rapidoc-min.js +1424 -213
  3. package/dist/rapidoc-static-min.js +13542 -0
  4. package/package.json +48 -34
  5. package/src/components/api-request.ts +869 -0
  6. package/src/components/api-response.ts +509 -0
  7. package/src/components/json-tree.ts +171 -0
  8. package/src/components/schema-base-element.ts +315 -0
  9. package/src/components/schema-table.ts +430 -0
  10. package/src/components/schema-tree.ts +386 -0
  11. package/src/components/tag-input.ts +184 -0
  12. package/src/index.js +6 -0
  13. package/src/oauth-receiver.ts +29 -0
  14. package/src/rapidoc-mini.ts +582 -0
  15. package/src/rapidoc.ts +1808 -0
  16. package/src/static/index.d.ts +149 -0
  17. package/src/static/index.js +62 -0
  18. package/src/static/navigation.js +497 -0
  19. package/src/static/render.js +490 -0
  20. package/src/static/serializer.js +216 -0
  21. package/src/styles/auth-styles.js +318 -0
  22. package/src/styles/border-styles.js +24 -0
  23. package/src/styles/css-bundle.js +129 -0
  24. package/src/styles/custom-styles.js +8 -0
  25. package/src/styles/dialog-box-styles.js +102 -0
  26. package/src/styles/endpoint-styles.js +559 -0
  27. package/src/styles/flex-styles.js +16 -0
  28. package/src/styles/font-styles.js +432 -0
  29. package/src/styles/info-styles.js +36 -0
  30. package/src/styles/input-styles.js +555 -0
  31. package/src/styles/layout-styles.js +396 -0
  32. package/src/styles/microlighter-styles.js +99 -0
  33. package/src/styles/nav-styles.js +609 -0
  34. package/src/styles/param-list-styles.js +261 -0
  35. package/src/styles/schema-styles.js +288 -0
  36. package/src/styles/tab-styles.js +106 -0
  37. package/src/styles/theme-tokens.js +582 -0
  38. package/src/templates/advanced-search-dialog-template.js +94 -0
  39. package/src/templates/api-response-template.js +219 -0
  40. package/src/templates/callback-template.js +86 -0
  41. package/src/templates/code-samples-template.js +52 -0
  42. package/src/templates/components-template.js +86 -0
  43. package/src/templates/downloads-template.js +85 -0
  44. package/src/templates/endpoint-template.js +386 -0
  45. package/src/templates/expanded-endpoint-template.js +266 -0
  46. package/src/templates/focused-endpoint-template.js +145 -0
  47. package/src/templates/header-template.js +92 -0
  48. package/src/templates/logo-template.js +21 -0
  49. package/src/templates/main-body-template.js +102 -0
  50. package/src/templates/navbar-template.js +489 -0
  51. package/src/templates/overview-template.js +104 -0
  52. package/src/templates/request-body-template.js +651 -0
  53. package/src/templates/request-params-template.js +474 -0
  54. package/src/templates/security-scheme-template.js +1263 -0
  55. package/src/templates/server-template.js +152 -0
  56. package/src/utils/auto-color-scheme.js +99 -0
  57. package/src/utils/bind-navbar.js +175 -0
  58. package/src/utils/color-utils.js +59 -0
  59. package/src/utils/common-utils.js +191 -0
  60. package/src/utils/curl-utils.js +123 -0
  61. package/src/utils/highlighter.js +416 -0
  62. package/src/utils/markdown-utils.js +110 -0
  63. package/src/utils/mcp/common.js +467 -0
  64. package/src/utils/mcp/generators/csharp.js +242 -0
  65. package/src/utils/mcp/generators/go.js +298 -0
  66. package/src/utils/mcp/generators/java.js +330 -0
  67. package/src/utils/mcp/generators/python.js +248 -0
  68. package/src/utils/mcp/generators/rust.js +281 -0
  69. package/src/utils/mcp/generators/typescript.js +290 -0
  70. package/src/utils/mcp-generator.js +143 -0
  71. package/src/utils/mock-interceptor.js +508 -0
  72. package/src/utils/oauth-utils.js +87 -0
  73. package/src/utils/request-utils.js +203 -0
  74. package/src/utils/response-utils.js +203 -0
  75. package/src/utils/sanitize.js +57 -0
  76. package/src/utils/schema-utils.js +1927 -0
  77. package/src/utils/slugger.js +189 -0
  78. package/src/utils/spec-parser.js +915 -0
  79. package/src/utils/url-utils.js +211 -0
  80. package/src/utils/xml-utils.js +61 -0
@@ -0,0 +1,432 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ .hover-bg:hover {
5
+ background: var(--muted);
6
+ }
7
+ ::selection {
8
+ background: var(--selection-bg);
9
+ color: var(--selection-fg);
10
+ }
11
+ .regular-font {
12
+ font-family: var(--font-sans);
13
+ }
14
+ .mono-font {
15
+ font-family: var(--font-mono);
16
+ }
17
+ .title {
18
+ font-size: calc(var(--font-size-small) + 1.125rem);
19
+ font-weight: normal;
20
+ text-wrap: balance;
21
+ }
22
+ .sub-title {
23
+ font-size: var(--h3-font-size);
24
+ text-wrap: balance;
25
+ }
26
+ .req-res-title {
27
+ font-family: var(--font-sans);
28
+ font-size: calc(var(--font-size-small) + 0.25rem);
29
+ font-weight: bold;
30
+ margin-bottom: 0.5rem;
31
+ text-align: start;
32
+ text-wrap: balance;
33
+ }
34
+ .tiny-title {
35
+ font-size: calc(var(--font-size-small) + 1px);
36
+ font-weight: bold;
37
+ }
38
+ .regular-font-size {
39
+ font-size: var(--font-size-regular);
40
+ }
41
+ .small-font-size {
42
+ font-size: var(--font-size-small);
43
+ }
44
+ .upper {
45
+ text-transform: uppercase;
46
+ }
47
+ .primary-text {
48
+ color: var(--primary);
49
+ }
50
+ .bold-text {
51
+ font-weight: bold;
52
+ }
53
+ .gray-text {
54
+ color: var(--muted-foreground);
55
+ }
56
+ .red-text {
57
+ color: var(--destructive);
58
+ }
59
+ .blue-text {
60
+ color: var(--blue);
61
+ }
62
+ .multiline {
63
+ overflow: scroll;
64
+ max-height: var(--resp-area-height);
65
+ color: var(--muted-foreground);
66
+ }
67
+ .method-fg {
68
+ color: var(--method-default);
69
+ }
70
+ .method-fg.put {
71
+ color: var(--method-put);
72
+ }
73
+ .method-fg.post {
74
+ color: var(--method-post);
75
+ }
76
+ .method-fg.get {
77
+ color: var(--method-get);
78
+ }
79
+ .method-fg.delete {
80
+ color: var(--method-delete);
81
+ }
82
+ .method-fg.head {
83
+ color: var(--method-head);
84
+ }
85
+ .method-fg.patch {
86
+ color: var(--method-patch);
87
+ }
88
+ .method-fg.options {
89
+ color: var(--method-options);
90
+ }
91
+ .method-fg.trace {
92
+ color: var(--method-trace);
93
+ }
94
+ .method-fg.query {
95
+ color: var(--method-query);
96
+ }
97
+ .method-fg.copy {
98
+ color: var(--method-default);
99
+ }
100
+ .method-fg.purge {
101
+ color: var(--method-default);
102
+ }
103
+
104
+ /*
105
+ * Headings: one scale for RapiDoc's own headings (.rapidoc-heading) and headings rendered from
106
+ * markdown descriptions, so both line up with surrounding docs content. The custom properties and
107
+ * their defaults are defined in theme-tokens.js; override them on the element, e.g.
108
+ * rapi-doc { --h2-font-size: 1.8125rem; --heading-weight: 700; }
109
+ */
110
+ h1,
111
+ h2,
112
+ h3,
113
+ h4,
114
+ h5,
115
+ h6,
116
+ .rapidoc-heading:is(h1, h2, h3, h4, h5, h6) {
117
+ font-family: var(--heading-font);
118
+ font-weight: var(--heading-weight);
119
+ line-height: var(--heading-line-height);
120
+ letter-spacing: var(--heading-letter-spacing);
121
+ color: var(--heading-color);
122
+ margin-block: var(--heading-margin-top) var(--heading-margin-bottom);
123
+ padding: 0;
124
+ text-wrap: balance;
125
+ }
126
+ h1,
127
+ h1.rapidoc-heading {
128
+ font-size: var(--h1-font-size);
129
+ }
130
+ h2,
131
+ h2.rapidoc-heading {
132
+ font-size: var(--h2-font-size);
133
+ }
134
+ h3,
135
+ h3.rapidoc-heading {
136
+ font-size: var(--h3-font-size);
137
+ }
138
+ h4,
139
+ h4.rapidoc-heading {
140
+ font-size: var(--h4-font-size);
141
+ }
142
+ h5,
143
+ h5.rapidoc-heading {
144
+ font-size: var(--h5-font-size);
145
+ }
146
+ h6,
147
+ h6.rapidoc-heading {
148
+ font-size: var(--h6-font-size);
149
+ }
150
+ :is(h1, h2, h3, h4, h5, h6):first-child,
151
+ .rapidoc-heading:is(h1, h2, h3, h4, h5, h6):first-child {
152
+ margin-block-start: 0;
153
+ }
154
+
155
+ /* Compact small-caps labels (Request, Response, Path parameters, ...) */
156
+ .rapidoc-heading.label-heading {
157
+ font-size: var(--label-heading-font-size);
158
+ font-weight: var(--heading-weight);
159
+ line-height: 1.4;
160
+ letter-spacing: 0.04em;
161
+ text-transform: uppercase;
162
+ margin-block: 16px 6px;
163
+ }
164
+ .rapidoc-heading.label-heading.req-res-title {
165
+ font-size: calc(var(--font-size-small) + 0.25rem);
166
+ margin-block: 0 0.5rem;
167
+ }
168
+ .rapidoc-heading.label-heading.tiny-title {
169
+ font-size: calc(var(--font-size-small) + 1px);
170
+ margin-block: 0 8px;
171
+ }
172
+ .table-title {
173
+ font-size: var(--font-size-small);
174
+ font-weight: 600;
175
+ vertical-align: middle;
176
+ margin: 12px 0 4px 0;
177
+ }
178
+ .table-title > .rapidoc-heading.label-heading {
179
+ margin: 0;
180
+ }
181
+ /* Keeps the heading outline complete for assistive tech without showing a duplicate title */
182
+ .visually-hidden {
183
+ position: absolute;
184
+ width: 1px;
185
+ height: 1px;
186
+ margin: -1px;
187
+ padding: 0;
188
+ overflow: hidden;
189
+ clip-path: inset(50%);
190
+ white-space: nowrap;
191
+ border: 0;
192
+ }
193
+
194
+ p {
195
+ margin-block-start: 0.5em;
196
+ }
197
+ a {
198
+ color: var(--blue);
199
+ text-decoration: none;
200
+ cursor: pointer;
201
+ }
202
+ a:hover {
203
+ text-decoration: underline;
204
+ }
205
+
206
+ code,
207
+ pre {
208
+ margin: 0px;
209
+ font-family: var(--font-mono);
210
+ font-size: calc(var(--font-size-mono) - 1px);
211
+ }
212
+
213
+ .m-markdown,
214
+ .m-markdown-small {
215
+ display: block;
216
+ color: var(--foreground);
217
+ /* Long unbroken words (URL paths, ids, inline code) wrap instead of widening the page. */
218
+ overflow-wrap: anywhere;
219
+ }
220
+
221
+ .m-markdown p,
222
+ .m-markdown span {
223
+ font-size: var(--font-size-regular);
224
+ line-height: var(--line-height);
225
+ color: inherit;
226
+ }
227
+ .m-markdown li {
228
+ font-size: var(--font-size-regular);
229
+ line-height: var(--line-height);
230
+ margin-block: 0.25em;
231
+ color: inherit;
232
+ }
233
+
234
+ .m-markdown-small p,
235
+ .m-markdown-small span {
236
+ font-size: var(--font-size-description);
237
+ line-height: calc(var(--font-size-description) + 6px);
238
+ color: inherit;
239
+ }
240
+ .m-markdown-small li {
241
+ font-size: var(--font-size-description);
242
+ line-height: calc(var(--font-size-description) + 8px);
243
+ margin-block: 3px;
244
+ color: inherit;
245
+ }
246
+
247
+ .m-markdown strong,
248
+ .m-markdown b,
249
+ .m-markdown-small strong,
250
+ .m-markdown-small b {
251
+ color: var(--foreground);
252
+ font-weight: 600;
253
+ }
254
+
255
+ .m-markdown h1,
256
+ .m-markdown h2,
257
+ .m-markdown h3,
258
+ .m-markdown h4,
259
+ .m-markdown h5,
260
+ .m-markdown h6,
261
+ .m-markdown-small h1,
262
+ .m-markdown-small h2,
263
+ .m-markdown-small h3,
264
+ .m-markdown-small h4,
265
+ .m-markdown-small h5,
266
+ .m-markdown-small h6 {
267
+ color: var(--foreground);
268
+ }
269
+
270
+ .m-markdown p:not(:first-child) {
271
+ margin-block-start: var(--paragraph-spacing);
272
+ }
273
+
274
+ .m-markdown-small p:not(:first-child) {
275
+ margin-block-start: 12px;
276
+ }
277
+ .m-markdown-small p:first-child {
278
+ margin-block-start: 0;
279
+ }
280
+
281
+ .m-markdown p,
282
+ .m-markdown-small p {
283
+ margin-block-end: 0;
284
+ }
285
+
286
+ .m-markdown code span {
287
+ font-size: var(--font-size-mono);
288
+ }
289
+
290
+ .m-markdown-small code,
291
+ .m-markdown code {
292
+ padding: 1px 6px;
293
+ border-radius: min(var(--radius), 0.5rem);
294
+ color: var(--foreground);
295
+ background-color: var(--muted);
296
+ font-size: calc(var(--font-size-mono));
297
+ line-height: 1.2;
298
+ }
299
+
300
+ .m-markdown-small code {
301
+ font-size: calc(var(--font-size-mono) - 1px);
302
+ padding: 1px 5px;
303
+ }
304
+
305
+ .m-markdown-small pre,
306
+ .m-markdown pre {
307
+ white-space: pre-wrap;
308
+ overflow-wrap: normal;
309
+ overflow-x: auto;
310
+ line-height: normal;
311
+ border-radius: min(var(--radius), 0.5rem);
312
+ border: 1px solid var(--input);
313
+ }
314
+
315
+ .m-markdown pre {
316
+ padding: 12px;
317
+ background: var(--code-bg);
318
+ color: var(--foreground);
319
+
320
+ & code {
321
+ border: none;
322
+ padding: 0;
323
+ background: transparent;
324
+ color: var(--foreground);
325
+ }
326
+ }
327
+
328
+ .m-markdown-small pre {
329
+ margin-top: 4px;
330
+ padding: 2px 4px;
331
+ background: var(--code-bg);
332
+ color: var(--card-foreground);
333
+
334
+ & code {
335
+ border: none;
336
+ padding: 0;
337
+ background: transparent;
338
+ color: var(--card-foreground);
339
+ }
340
+ }
341
+
342
+ .m-markdown ul,
343
+ .m-markdown ol {
344
+ padding-inline-start: 30px;
345
+ }
346
+
347
+ .m-markdown-small ul,
348
+ .m-markdown-small ol {
349
+ padding-inline-start: 20px;
350
+ }
351
+
352
+ .m-markdown-small a,
353
+ .m-markdown a {
354
+ color: var(--blue);
355
+ }
356
+
357
+ .m-markdown-small img,
358
+ .m-markdown img {
359
+ max-width: 100%;
360
+ }
361
+
362
+ /* Markdown table */
363
+
364
+ .m-markdown-small table,
365
+ .m-markdown table {
366
+ border-spacing: 0;
367
+ margin: 10px 0;
368
+ border-collapse: separate;
369
+ border: 1px solid var(--border);
370
+ border-radius: min(var(--radius), 0.5rem);
371
+ font-size: calc(var(--font-size-small) + 1px);
372
+ line-height: calc(var(--font-size-small) + 4px);
373
+ /* Wide tables scroll inside their own box instead of widening the page */
374
+ display: block;
375
+ width: max-content;
376
+ max-width: 100%;
377
+ overflow-x: auto;
378
+ }
379
+
380
+ .m-markdown-small table {
381
+ font-size: var(--font-size-small);
382
+ line-height: calc(var(--font-size-small) + 2px);
383
+ margin: 8px 0;
384
+ }
385
+
386
+ .m-markdown-small td,
387
+ .m-markdown-small th,
388
+ .m-markdown td,
389
+ .m-markdown th {
390
+ vertical-align: top;
391
+ border-top: 1px solid var(--border);
392
+ line-height: calc(var(--font-size-small) + 4px);
393
+ }
394
+
395
+ .m-markdown-small tr:first-child th,
396
+ .m-markdown tr:first-child th {
397
+ border-top: 0 none;
398
+ }
399
+
400
+ .m-markdown th,
401
+ .m-markdown td {
402
+ padding: 10px 12px;
403
+ }
404
+
405
+ .m-markdown-small th,
406
+ .m-markdown-small td {
407
+ padding: 8px 8px;
408
+ }
409
+
410
+ .m-markdown th,
411
+ .m-markdown-small th {
412
+ font-weight: 600;
413
+ background: var(--card);
414
+ vertical-align: middle;
415
+ }
416
+
417
+ .m-markdown-small table code,
418
+ .m-markdown table code {
419
+ font-size: calc(var(--font-size-mono) - 1px);
420
+ }
421
+
422
+ .m-markdown blockquote,
423
+ .m-markdown-small blockquote {
424
+ margin-inline-start: 0;
425
+ margin-inline-end: 0;
426
+ border-inline-start: 3px solid var(--border);
427
+ padding: 6px 0 6px 6px;
428
+ }
429
+ .m-markdown hr {
430
+ border: 1px solid var(--border);
431
+ }
432
+ `;
@@ -0,0 +1,36 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ #api-title .version {
5
+ display: inline-block;
6
+ vertical-align: middle;
7
+ margin-inline-start: 0.5em;
8
+ padding: 0.125em 0.5em;
9
+ border: 1px solid var(--border);
10
+ border-radius: var(--radius);
11
+ background: var(--muted);
12
+ color: var(--muted-foreground);
13
+ font-family: var(--font-mono);
14
+ font-size: var(--font-size-small);
15
+ font-weight: 500;
16
+ line-height: 1.5;
17
+ letter-spacing: normal;
18
+ }
19
+
20
+ #api-info {
21
+ font-size: calc(var(--font-size-regular) - 1px);
22
+ margin-top: 8px;
23
+ }
24
+
25
+ #api-info span:before {
26
+ content: '|';
27
+ display: inline-block;
28
+ opacity: 0.5;
29
+ width: 15px;
30
+ text-align: center;
31
+ }
32
+ #api-info span:first-child:before {
33
+ content: '';
34
+ width: 0px;
35
+ }
36
+ `;