@t0.labs/daxta 1.1.2 → 1.1.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/assets/example.html +74 -28
- package/assets/viewer.html +478 -133
- package/dist/build/build-spec.js +8 -6
- package/dist/cli/titles.js +34 -4
- package/dist/fields/dto-fields.js +12 -2
- package/dist/serve/paths.d.ts +1 -0
- package/dist/serve/paths.js +7 -0
- package/package.json +1 -1
package/assets/viewer.html
CHANGED
|
@@ -1,16 +1,42 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
2
|
+
<html lang="en" data-theme="dark">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>API Documentation</title>
|
|
7
|
-
<link rel="icon" href="__FAVICON_DATA_URI__" />
|
|
7
|
+
<link rel="icon" id="favicon" href="__FAVICON_DATA_URI__" />
|
|
8
8
|
<link rel="apple-touch-icon" href="__FAVICON_DATA_URI__" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
10
10
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
11
11
|
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Geist:wght@400;500;600&display=swap" rel="stylesheet" />
|
|
12
12
|
<style>
|
|
13
13
|
:root {
|
|
14
|
+
--canvas: #050505;
|
|
15
|
+
--sidebar: #090909;
|
|
16
|
+
--nav: #090909;
|
|
17
|
+
--paper: #050505;
|
|
18
|
+
--white: #101010;
|
|
19
|
+
--inset: #131313;
|
|
20
|
+
--hairline: #262626;
|
|
21
|
+
--line: #1c1c1c;
|
|
22
|
+
--smoke: #6a6a6a;
|
|
23
|
+
--stone: #8a8a8a;
|
|
24
|
+
--charcoal: #c8c8c8;
|
|
25
|
+
--obsidian: #f4f4f4;
|
|
26
|
+
--accent: #8fa35a;
|
|
27
|
+
--ok: #3dcc70;
|
|
28
|
+
--ok-bg: #16301f;
|
|
29
|
+
--get: #3dcc70;
|
|
30
|
+
--warn: #d4a017;
|
|
31
|
+
--err: #f07171;
|
|
32
|
+
--err-bg: #3a1818;
|
|
33
|
+
--sans: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
|
|
34
|
+
--mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
35
|
+
--radius: 2px;
|
|
36
|
+
--ring: 0 0 0 1px #262626;
|
|
37
|
+
--ghost: none;
|
|
38
|
+
}
|
|
39
|
+
html[data-theme="light"] {
|
|
14
40
|
--canvas: #fafafa;
|
|
15
41
|
--sidebar: #fafafa;
|
|
16
42
|
--nav: #ffffff;
|
|
@@ -27,16 +53,14 @@
|
|
|
27
53
|
--ok: #15803d;
|
|
28
54
|
--ok-bg: #e8f8ee;
|
|
29
55
|
--get: #16a34a;
|
|
56
|
+
--warn: #b45309;
|
|
30
57
|
--err: #b42318;
|
|
31
58
|
--err-bg: #fbeaea;
|
|
32
|
-
--sans: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
|
|
33
|
-
--mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
34
|
-
--radius: 5px;
|
|
35
59
|
--ring: 0 0 0 1px #e6e6e6;
|
|
36
60
|
--ghost: 0 0 0 1px #e6e6e6;
|
|
37
61
|
}
|
|
38
62
|
* { box-sizing: border-box; }
|
|
39
|
-
html, body { height: 100%; }
|
|
63
|
+
html, body { height: 100%; overflow: hidden; }
|
|
40
64
|
:focus { outline: none; }
|
|
41
65
|
:focus-visible {
|
|
42
66
|
outline: 2px solid #c6c6c6;
|
|
@@ -59,14 +83,25 @@
|
|
|
59
83
|
padding: 0 14px;
|
|
60
84
|
background: var(--nav);
|
|
61
85
|
border-bottom: 1px solid var(--hairline);
|
|
62
|
-
position:
|
|
86
|
+
position: fixed;
|
|
63
87
|
top: 0;
|
|
64
|
-
|
|
88
|
+
left: 0;
|
|
89
|
+
right: 0;
|
|
90
|
+
z-index: 200;
|
|
65
91
|
}
|
|
66
|
-
body.searching .topnav { z-index:
|
|
67
|
-
.
|
|
92
|
+
body.searching .topnav { z-index: 210; }
|
|
93
|
+
body.search-palette .topnav { z-index: 40; }
|
|
94
|
+
.brand-wrap { display: flex; align-items: center; min-width: 0; justify-self: start; }
|
|
68
95
|
.workspace { display: none; }
|
|
69
|
-
.brand {
|
|
96
|
+
.brand {
|
|
97
|
+
font-size: 13px;
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
letter-spacing: -0.04em;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
text-overflow: ellipsis;
|
|
103
|
+
color: var(--obsidian);
|
|
104
|
+
}
|
|
70
105
|
.ep-nav {
|
|
71
106
|
justify-self: center;
|
|
72
107
|
display: flex;
|
|
@@ -96,7 +131,7 @@
|
|
|
96
131
|
height: 22px;
|
|
97
132
|
padding: 0 8px;
|
|
98
133
|
border: 0;
|
|
99
|
-
border-radius:
|
|
134
|
+
border-radius: 2px;
|
|
100
135
|
background: transparent;
|
|
101
136
|
color: var(--stone);
|
|
102
137
|
font: 500 11px/22px var(--mono);
|
|
@@ -119,6 +154,79 @@
|
|
|
119
154
|
padding: 0;
|
|
120
155
|
}
|
|
121
156
|
.nav-tools .btn.icon svg { width: 16px; height: 16px; }
|
|
157
|
+
.more-wrap { position: relative; flex: none; }
|
|
158
|
+
.more-pop {
|
|
159
|
+
display: none;
|
|
160
|
+
position: absolute;
|
|
161
|
+
top: calc(100% + 6px);
|
|
162
|
+
right: 0;
|
|
163
|
+
width: 260px;
|
|
164
|
+
background: var(--white);
|
|
165
|
+
border: 1px solid var(--hairline);
|
|
166
|
+
border-radius: var(--radius);
|
|
167
|
+
padding: 6px;
|
|
168
|
+
z-index: 220;
|
|
169
|
+
}
|
|
170
|
+
.more-wrap.open .more-pop { display: block; }
|
|
171
|
+
.more-item {
|
|
172
|
+
width: 100%;
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
gap: 10px;
|
|
176
|
+
height: 34px;
|
|
177
|
+
padding: 0 8px;
|
|
178
|
+
border: 0;
|
|
179
|
+
border-radius: 2px;
|
|
180
|
+
background: transparent;
|
|
181
|
+
color: var(--obsidian);
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
font: 500 12px/1 var(--sans);
|
|
184
|
+
text-align: left;
|
|
185
|
+
}
|
|
186
|
+
.more-item:hover { background: var(--inset); }
|
|
187
|
+
.more-item-ico {
|
|
188
|
+
width: 16px;
|
|
189
|
+
height: 16px;
|
|
190
|
+
flex: none;
|
|
191
|
+
color: var(--charcoal);
|
|
192
|
+
}
|
|
193
|
+
.more-item-ico svg { width: 16px; height: 16px; display: block; }
|
|
194
|
+
.more-item-label { flex: 1; min-width: 0; }
|
|
195
|
+
.more-item-meta {
|
|
196
|
+
color: var(--stone);
|
|
197
|
+
font: 500 11px/1 var(--mono);
|
|
198
|
+
}
|
|
199
|
+
html[data-theme="light"] .theme-moon { display: none; }
|
|
200
|
+
html:not([data-theme="light"]) .theme-sun { display: none; }
|
|
201
|
+
.more-sep {
|
|
202
|
+
height: 1px;
|
|
203
|
+
background: var(--hairline);
|
|
204
|
+
margin: 6px 4px;
|
|
205
|
+
}
|
|
206
|
+
.more-section {
|
|
207
|
+
padding: 8px 8px 4px;
|
|
208
|
+
font-size: 10px;
|
|
209
|
+
font-weight: 600;
|
|
210
|
+
letter-spacing: 0.08em;
|
|
211
|
+
text-transform: uppercase;
|
|
212
|
+
color: var(--stone);
|
|
213
|
+
}
|
|
214
|
+
.more-shortcut {
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
justify-content: space-between;
|
|
218
|
+
gap: 12px;
|
|
219
|
+
padding: 6px 8px;
|
|
220
|
+
font-size: 12px;
|
|
221
|
+
color: var(--charcoal);
|
|
222
|
+
}
|
|
223
|
+
.more-shortcut kbd {
|
|
224
|
+
font: 500 11px/1 var(--mono);
|
|
225
|
+
color: var(--stone);
|
|
226
|
+
border: 1px solid var(--hairline);
|
|
227
|
+
border-radius: 2px;
|
|
228
|
+
padding: 3px 5px;
|
|
229
|
+
}
|
|
122
230
|
.btn[data-tip] { position: relative; }
|
|
123
231
|
.btn[data-tip]::after {
|
|
124
232
|
content: attr(data-tip);
|
|
@@ -167,7 +275,7 @@
|
|
|
167
275
|
font: 500 10px/1 var(--mono);
|
|
168
276
|
color: var(--smoke);
|
|
169
277
|
border: 1px solid var(--hairline);
|
|
170
|
-
border-radius:
|
|
278
|
+
border-radius: 2px;
|
|
171
279
|
padding: 3px 5px;
|
|
172
280
|
pointer-events: none;
|
|
173
281
|
background: var(--inset);
|
|
@@ -178,15 +286,61 @@
|
|
|
178
286
|
border-radius: var(--radius) var(--radius) 0 0;
|
|
179
287
|
}
|
|
180
288
|
.search-wrap.open .search-kbd { display: none; }
|
|
289
|
+
body.searching:not(.search-palette) .tree-scroll,
|
|
290
|
+
body.searching:not(.search-palette) .prefix-bar,
|
|
291
|
+
body.searching:not(.search-palette) .nav-foot {
|
|
292
|
+
filter: blur(7px);
|
|
293
|
+
opacity: 0.4;
|
|
294
|
+
pointer-events: none;
|
|
295
|
+
transition: filter 0.2s ease, opacity 0.2s ease;
|
|
296
|
+
}
|
|
181
297
|
.search-backdrop {
|
|
182
298
|
display: none;
|
|
183
299
|
position: fixed;
|
|
184
300
|
inset: 0;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
301
|
+
z-index: 80;
|
|
302
|
+
align-items: flex-start;
|
|
303
|
+
justify-content: center;
|
|
304
|
+
padding: 12vh 16px 24px;
|
|
305
|
+
background: rgba(0, 0, 0, 0.5);
|
|
306
|
+
backdrop-filter: blur(14px);
|
|
307
|
+
-webkit-backdrop-filter: blur(14px);
|
|
308
|
+
}
|
|
309
|
+
html[data-theme="light"] .search-backdrop {
|
|
310
|
+
background: rgba(250, 250, 250, 0.55);
|
|
311
|
+
}
|
|
312
|
+
body.search-palette .search-backdrop { display: flex; }
|
|
313
|
+
.search-palette-card {
|
|
314
|
+
width: min(640px, 100%);
|
|
315
|
+
background: var(--white);
|
|
316
|
+
border: 1px solid var(--hairline);
|
|
317
|
+
border-radius: 2px;
|
|
318
|
+
overflow: hidden;
|
|
319
|
+
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
|
|
320
|
+
}
|
|
321
|
+
.search-palette-input {
|
|
322
|
+
width: 100%;
|
|
323
|
+
height: 48px;
|
|
324
|
+
border: 0;
|
|
325
|
+
border-bottom: 1px solid var(--hairline);
|
|
326
|
+
background: transparent;
|
|
327
|
+
color: var(--obsidian);
|
|
328
|
+
padding: 0 16px;
|
|
329
|
+
font-size: 15px;
|
|
330
|
+
letter-spacing: -0.02em;
|
|
331
|
+
}
|
|
332
|
+
.search-palette-input:focus { outline: none; }
|
|
333
|
+
.search-palette-input::placeholder { color: var(--smoke); }
|
|
334
|
+
.search-palette-panel {
|
|
335
|
+
max-height: min(420px, 52vh);
|
|
336
|
+
overflow: auto;
|
|
337
|
+
padding: 6px;
|
|
338
|
+
}
|
|
339
|
+
.search-palette-hint {
|
|
340
|
+
padding: 8px 16px 12px;
|
|
341
|
+
font-size: 11px;
|
|
342
|
+
color: var(--smoke);
|
|
188
343
|
}
|
|
189
|
-
body.searching .search-backdrop { display: block; }
|
|
190
344
|
.search-panel {
|
|
191
345
|
display: none;
|
|
192
346
|
position: absolute;
|
|
@@ -337,7 +491,7 @@
|
|
|
337
491
|
border: 0;
|
|
338
492
|
background: var(--inset);
|
|
339
493
|
box-shadow: var(--ghost);
|
|
340
|
-
border-radius:
|
|
494
|
+
border-radius: 2px;
|
|
341
495
|
padding: 5px 10px;
|
|
342
496
|
cursor: pointer;
|
|
343
497
|
font-size: 12px;
|
|
@@ -351,7 +505,7 @@
|
|
|
351
505
|
.env-base-line {
|
|
352
506
|
margin-top: 8px;
|
|
353
507
|
padding: 8px 10px;
|
|
354
|
-
border-radius:
|
|
508
|
+
border-radius: 2px;
|
|
355
509
|
background: var(--inset);
|
|
356
510
|
font: 11px/1.4 var(--mono);
|
|
357
511
|
color: var(--charcoal);
|
|
@@ -394,9 +548,12 @@
|
|
|
394
548
|
grid-template-columns: var(--sidebar-w, 320px) 6px minmax(0, 1fr);
|
|
395
549
|
grid-template-rows: minmax(0, 1fr) auto;
|
|
396
550
|
height: calc(100vh - 44px);
|
|
551
|
+
margin-top: 44px;
|
|
552
|
+
transition: grid-template-columns 0.32s cubic-bezier(0.22, 1, 0.36, 1);
|
|
397
553
|
}
|
|
554
|
+
body.sidebar-resizing .app { transition: none; }
|
|
398
555
|
.app.sidebar-collapsed {
|
|
399
|
-
grid-template-columns: 0
|
|
556
|
+
grid-template-columns: 0 0 minmax(0, 1fr);
|
|
400
557
|
}
|
|
401
558
|
.sidebar {
|
|
402
559
|
grid-row: 1 / -1;
|
|
@@ -425,6 +582,7 @@
|
|
|
425
582
|
background: var(--sidebar);
|
|
426
583
|
border-right: 0;
|
|
427
584
|
font-size: 13px;
|
|
585
|
+
transition: opacity 0.22s ease;
|
|
428
586
|
}
|
|
429
587
|
.app.sidebar-collapsed .sidebar {
|
|
430
588
|
overflow: hidden;
|
|
@@ -432,6 +590,10 @@
|
|
|
432
590
|
pointer-events: none;
|
|
433
591
|
opacity: 0;
|
|
434
592
|
}
|
|
593
|
+
.app.sidebar-collapsed .sidebar-resizer {
|
|
594
|
+
pointer-events: none;
|
|
595
|
+
opacity: 0;
|
|
596
|
+
}
|
|
435
597
|
.nav-filter {
|
|
436
598
|
width: 100%;
|
|
437
599
|
height: 28px;
|
|
@@ -475,23 +637,6 @@
|
|
|
475
637
|
body.sidebar-resizing .sidebar-resizer {
|
|
476
638
|
background: var(--obsidian);
|
|
477
639
|
}
|
|
478
|
-
.app.sidebar-collapsed .sidebar-resizer {
|
|
479
|
-
width: 28px;
|
|
480
|
-
cursor: pointer;
|
|
481
|
-
background: var(--sidebar);
|
|
482
|
-
border-right: 1px solid var(--line);
|
|
483
|
-
}
|
|
484
|
-
.app.sidebar-collapsed .sidebar-resizer::before {
|
|
485
|
-
content: "";
|
|
486
|
-
position: absolute;
|
|
487
|
-
top: 50%;
|
|
488
|
-
left: 50%;
|
|
489
|
-
width: 6px;
|
|
490
|
-
height: 6px;
|
|
491
|
-
border-right: 1.5px solid var(--charcoal);
|
|
492
|
-
border-bottom: 1.5px solid var(--charcoal);
|
|
493
|
-
transform: translate(-70%, -50%) rotate(-45deg);
|
|
494
|
-
}
|
|
495
640
|
body.sidebar-resizing {
|
|
496
641
|
cursor: col-resize;
|
|
497
642
|
user-select: none;
|
|
@@ -576,8 +721,8 @@
|
|
|
576
721
|
gap: 0;
|
|
577
722
|
border-radius: var(--radius);
|
|
578
723
|
}
|
|
579
|
-
.nav-op:hover { background:
|
|
580
|
-
.nav-op.active { background:
|
|
724
|
+
.nav-op:hover { background: transparent; }
|
|
725
|
+
.nav-op.active { background: transparent; box-shadow: none; }
|
|
581
726
|
.nav-op-row {
|
|
582
727
|
display: flex;
|
|
583
728
|
align-items: center;
|
|
@@ -589,7 +734,7 @@
|
|
|
589
734
|
width: 24px;
|
|
590
735
|
height: 24px;
|
|
591
736
|
border: 0;
|
|
592
|
-
border-radius:
|
|
737
|
+
border-radius: 2px;
|
|
593
738
|
background: transparent;
|
|
594
739
|
color: var(--stone);
|
|
595
740
|
cursor: pointer;
|
|
@@ -615,26 +760,41 @@
|
|
|
615
760
|
.nav-examples {
|
|
616
761
|
display: none;
|
|
617
762
|
flex-direction: column;
|
|
618
|
-
gap:
|
|
763
|
+
gap: 2px;
|
|
619
764
|
margin: 0 4px 6px 18px;
|
|
620
|
-
padding-left: 8px;
|
|
621
|
-
border-left: 1px solid var(--hairline);
|
|
622
765
|
}
|
|
623
766
|
.nav-op.examples-open > .nav-examples { display: flex; }
|
|
624
|
-
.nav-ex-group { display: flex; flex-direction: column; gap:
|
|
767
|
+
.nav-ex-group { display: flex; flex-direction: column; gap: 0; }
|
|
768
|
+
.nav-ex-items {
|
|
769
|
+
display: flex;
|
|
770
|
+
flex-direction: column;
|
|
771
|
+
gap: 1px;
|
|
772
|
+
margin-left: 4px;
|
|
773
|
+
padding-left: 0;
|
|
774
|
+
border-left: 1px solid var(--hairline);
|
|
775
|
+
}
|
|
776
|
+
.nav-ex-group.ok > .nav-ex-items { border-left-color: color-mix(in srgb, var(--ok) 40%, var(--hairline)); }
|
|
777
|
+
.nav-ex-group.warn > .nav-ex-items { border-left-color: color-mix(in srgb, var(--warn) 40%, var(--hairline)); }
|
|
778
|
+
.nav-ex-group.omit > .nav-ex-items { border-left-color: color-mix(in srgb, var(--accent) 40%, var(--hairline)); }
|
|
779
|
+
.nav-ex-group.err > .nav-ex-items { border-left-color: color-mix(in srgb, var(--err) 40%, var(--hairline)); }
|
|
625
780
|
.nav-ex-group-label {
|
|
626
781
|
display: flex;
|
|
627
782
|
align-items: center;
|
|
628
783
|
justify-content: space-between;
|
|
629
784
|
gap: 8px;
|
|
630
|
-
padding: 6px
|
|
785
|
+
padding: 6px 0 2px 4px;
|
|
631
786
|
font: 600 10px/1.2 var(--sans);
|
|
632
|
-
letter-spacing: 0.
|
|
633
|
-
color: var(--
|
|
787
|
+
letter-spacing: 0.04em;
|
|
788
|
+
color: var(--charcoal);
|
|
634
789
|
}
|
|
790
|
+
.nav-ex-group-label.ok { color: var(--ok); }
|
|
791
|
+
.nav-ex-group-label.warn { color: var(--warn); }
|
|
792
|
+
.nav-ex-group-label.omit { color: var(--accent); }
|
|
793
|
+
.nav-ex-group-label.err { color: var(--err); }
|
|
635
794
|
.nav-ex-count {
|
|
636
795
|
font: 600 10px/1.4 var(--mono);
|
|
637
|
-
color:
|
|
796
|
+
color: inherit;
|
|
797
|
+
opacity: 0.7;
|
|
638
798
|
}
|
|
639
799
|
.nav-example {
|
|
640
800
|
display: block;
|
|
@@ -642,8 +802,8 @@
|
|
|
642
802
|
border: 0;
|
|
643
803
|
background: transparent;
|
|
644
804
|
text-align: left;
|
|
645
|
-
padding: 4px 8px;
|
|
646
|
-
border-radius:
|
|
805
|
+
padding: 4px 0 4px 8px;
|
|
806
|
+
border-radius: 2px;
|
|
647
807
|
cursor: pointer;
|
|
648
808
|
font-size: 11px;
|
|
649
809
|
line-height: 1.35;
|
|
@@ -652,14 +812,14 @@
|
|
|
652
812
|
text-overflow: ellipsis;
|
|
653
813
|
white-space: nowrap;
|
|
654
814
|
}
|
|
655
|
-
.nav-example:hover { background: var(--
|
|
656
|
-
.nav-example.on { color: var(--obsidian); background: var(--
|
|
815
|
+
.nav-example:hover { background: color-mix(in srgb, var(--obsidian) 4%, transparent); color: var(--charcoal); }
|
|
816
|
+
.nav-example.on { color: var(--obsidian); background: color-mix(in srgb, var(--obsidian) 8%, transparent); font-weight: 500; }
|
|
657
817
|
.nav-ex-total {
|
|
658
818
|
flex: none;
|
|
659
819
|
min-width: 16px;
|
|
660
820
|
margin-right: 2px;
|
|
661
821
|
padding: 1px 5px;
|
|
662
|
-
border-radius:
|
|
822
|
+
border-radius: 2px;
|
|
663
823
|
background: var(--obsidian);
|
|
664
824
|
color: var(--white);
|
|
665
825
|
font: 600 10px/1.4 var(--mono);
|
|
@@ -804,7 +964,7 @@
|
|
|
804
964
|
min-width: 40px;
|
|
805
965
|
height: 18px;
|
|
806
966
|
padding: 0 5px;
|
|
807
|
-
border-radius:
|
|
967
|
+
border-radius: 2px;
|
|
808
968
|
font: 600 10px/1 var(--mono);
|
|
809
969
|
letter-spacing: 0.04em;
|
|
810
970
|
text-transform: uppercase;
|
|
@@ -825,15 +985,31 @@
|
|
|
825
985
|
.schema-block .meta-label { margin-bottom: 8px; display: block; }
|
|
826
986
|
|
|
827
987
|
.ex-block { margin: 0; position: relative; }
|
|
828
|
-
.
|
|
988
|
+
.foot-bar {
|
|
829
989
|
grid-column: 3;
|
|
830
990
|
grid-row: 2;
|
|
831
991
|
position: relative;
|
|
832
992
|
z-index: 100;
|
|
993
|
+
display: flex;
|
|
994
|
+
align-items: center;
|
|
995
|
+
gap: 8px;
|
|
833
996
|
padding: 8px 16px 10px;
|
|
834
997
|
background: var(--white);
|
|
835
998
|
border-top: 1px solid var(--hairline);
|
|
836
999
|
}
|
|
1000
|
+
.foot-bar .sidebar-toggle {
|
|
1001
|
+
flex: none;
|
|
1002
|
+
width: 28px;
|
|
1003
|
+
height: 28px;
|
|
1004
|
+
padding: 0;
|
|
1005
|
+
}
|
|
1006
|
+
.ex-dock {
|
|
1007
|
+
flex: 1;
|
|
1008
|
+
min-width: 0;
|
|
1009
|
+
padding: 0;
|
|
1010
|
+
background: transparent;
|
|
1011
|
+
border: 0;
|
|
1012
|
+
}
|
|
837
1013
|
.ex-dock:empty { display: none; }
|
|
838
1014
|
.ex-dock .dd-menu {
|
|
839
1015
|
top: auto;
|
|
@@ -915,7 +1091,7 @@
|
|
|
915
1091
|
height: 32px;
|
|
916
1092
|
margin: 8px 8px 4px;
|
|
917
1093
|
border: 1px solid var(--hairline);
|
|
918
|
-
border-radius:
|
|
1094
|
+
border-radius: 2px;
|
|
919
1095
|
padding: 0 8px;
|
|
920
1096
|
font-size: 12px;
|
|
921
1097
|
background: var(--white);
|
|
@@ -934,6 +1110,8 @@
|
|
|
934
1110
|
padding: 10px 12px 4px;
|
|
935
1111
|
}
|
|
936
1112
|
.dd-group.ok { color: var(--ok); }
|
|
1113
|
+
.dd-group.warn { color: var(--warn); }
|
|
1114
|
+
.dd-group.omit { color: var(--accent); }
|
|
937
1115
|
.dd-group.err { color: var(--err); }
|
|
938
1116
|
.dd-count {
|
|
939
1117
|
font: 600 10px/1.4 var(--mono);
|
|
@@ -1086,7 +1264,7 @@
|
|
|
1086
1264
|
.mode-toggle {
|
|
1087
1265
|
display: flex;
|
|
1088
1266
|
border: 1px solid var(--hairline);
|
|
1089
|
-
border-radius:
|
|
1267
|
+
border-radius: 2px;
|
|
1090
1268
|
overflow: hidden;
|
|
1091
1269
|
}
|
|
1092
1270
|
.mode-toggle button {
|
|
@@ -1170,20 +1348,20 @@
|
|
|
1170
1348
|
pre {
|
|
1171
1349
|
margin: 0;
|
|
1172
1350
|
padding: 10px 12px;
|
|
1173
|
-
background:
|
|
1351
|
+
background: var(--inset);
|
|
1174
1352
|
border-radius: 0;
|
|
1175
1353
|
overflow: auto;
|
|
1176
1354
|
font: 12px/1.5 var(--mono);
|
|
1177
1355
|
}
|
|
1178
|
-
.k { color:
|
|
1356
|
+
.k { color: var(--obsidian); }
|
|
1179
1357
|
.s { color: var(--accent); }
|
|
1180
|
-
.n { color:
|
|
1358
|
+
.n { color: var(--charcoal); }
|
|
1181
1359
|
.p { color: #666666; }
|
|
1182
1360
|
.empty { color: var(--stone); font-size: 13px; padding: 14px 16px; }
|
|
1183
1361
|
.code {
|
|
1184
1362
|
font: 600 11px/1 var(--mono);
|
|
1185
1363
|
padding: 3px 6px;
|
|
1186
|
-
border-radius:
|
|
1364
|
+
border-radius: 2px;
|
|
1187
1365
|
background: var(--inset);
|
|
1188
1366
|
}
|
|
1189
1367
|
.code.ok { background: var(--ok-bg); color: var(--ok); }
|
|
@@ -1206,14 +1384,23 @@
|
|
|
1206
1384
|
margin: 0 0 8px;
|
|
1207
1385
|
color: var(--stone);
|
|
1208
1386
|
}
|
|
1387
|
+
.schema-rows {
|
|
1388
|
+
display: grid;
|
|
1389
|
+
grid-template-columns: minmax(0, 1fr) max-content max-content;
|
|
1390
|
+
column-gap: 16px;
|
|
1391
|
+
}
|
|
1209
1392
|
.row {
|
|
1210
1393
|
display: grid;
|
|
1211
|
-
grid-template-columns: minmax(0,
|
|
1212
|
-
|
|
1394
|
+
grid-template-columns: minmax(0, 1fr) max-content max-content;
|
|
1395
|
+
grid-column: 1 / -1;
|
|
1396
|
+
column-gap: 16px;
|
|
1213
1397
|
align-items: baseline;
|
|
1214
1398
|
padding: 5px 0;
|
|
1215
1399
|
font-size: 12px;
|
|
1216
1400
|
}
|
|
1401
|
+
.schema-rows > .row {
|
|
1402
|
+
grid-template-columns: subgrid;
|
|
1403
|
+
}
|
|
1217
1404
|
.row .name {
|
|
1218
1405
|
font-family: var(--mono);
|
|
1219
1406
|
font-size: 12px;
|
|
@@ -1238,7 +1425,13 @@
|
|
|
1238
1425
|
font-size: 11px;
|
|
1239
1426
|
min-width: 0;
|
|
1240
1427
|
}
|
|
1241
|
-
.flag {
|
|
1428
|
+
.flag {
|
|
1429
|
+
font-size: 11px;
|
|
1430
|
+
color: var(--smoke);
|
|
1431
|
+
justify-self: end;
|
|
1432
|
+
text-align: right;
|
|
1433
|
+
min-height: 1em;
|
|
1434
|
+
}
|
|
1242
1435
|
.flag.req { color: var(--err); }
|
|
1243
1436
|
|
|
1244
1437
|
.work-foot {
|
|
@@ -1248,18 +1441,22 @@
|
|
|
1248
1441
|
}
|
|
1249
1442
|
|
|
1250
1443
|
@media (max-width: 960px) {
|
|
1444
|
+
html, body { overflow: auto; height: auto; }
|
|
1251
1445
|
.app {
|
|
1252
1446
|
grid-template-columns: 1fr;
|
|
1253
1447
|
grid-template-rows: auto 1fr auto;
|
|
1254
1448
|
height: auto;
|
|
1255
1449
|
min-height: calc(100vh - 44px);
|
|
1256
1450
|
}
|
|
1257
|
-
.
|
|
1258
|
-
|
|
1451
|
+
.sidebar, .workbench, .foot-bar { grid-column: 1; grid-row: auto; }
|
|
1452
|
+
.sidebar { max-height: 40vh; }
|
|
1453
|
+
.app.sidebar-collapsed .sidebar {
|
|
1454
|
+
max-height: 0 !important;
|
|
1455
|
+
padding: 0 !important;
|
|
1456
|
+
opacity: 0;
|
|
1457
|
+
pointer-events: none;
|
|
1259
1458
|
}
|
|
1260
|
-
.
|
|
1261
|
-
.sidebar { max-height: 40vh; opacity: 1 !important; pointer-events: auto !important; padding: 16px 12px 24px !important; }
|
|
1262
|
-
.ex-dock { position: sticky; bottom: 0; }
|
|
1459
|
+
.foot-bar { position: sticky; bottom: 0; }
|
|
1263
1460
|
.sidebar-resizer { display: none; }
|
|
1264
1461
|
.pair, .schemas { grid-template-columns: 1fr; }
|
|
1265
1462
|
.workbench { overflow: auto; height: auto; }
|
|
@@ -1267,27 +1464,66 @@
|
|
|
1267
1464
|
.card { height: auto; max-height: 70vh; }
|
|
1268
1465
|
.search-wrap { width: min(280px, 70vw); }
|
|
1269
1466
|
}
|
|
1467
|
+
|
|
1468
|
+
.method { border-radius: 2px; }
|
|
1469
|
+
html:not([data-theme="light"]) .btn.primary {
|
|
1470
|
+
background: #f3f3f3;
|
|
1471
|
+
color: #0a0a0a;
|
|
1472
|
+
}
|
|
1473
|
+
html:not([data-theme="light"]) .btn.primary:hover { color: #0a0a0a; }
|
|
1474
|
+
|
|
1270
1475
|
</style>
|
|
1271
1476
|
</head>
|
|
1272
1477
|
<body>
|
|
1273
1478
|
<header class="topnav">
|
|
1274
1479
|
<div class="brand-wrap">
|
|
1275
|
-
<div class="brand" id="brand">API</div>
|
|
1480
|
+
<div class="brand" id="brand">DAxTA API Document</div>
|
|
1276
1481
|
</div>
|
|
1277
1482
|
<div class="ep-nav" id="ep-nav">
|
|
1278
1483
|
<span class="ep-name" id="ep-name"></span>
|
|
1279
1484
|
</div>
|
|
1280
1485
|
<div class="nav-tools">
|
|
1281
|
-
<button class="btn icon" id="export-openapi" type="button" data-tip="Export" aria-label="Export">
|
|
1282
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
|
|
1283
|
-
</button>
|
|
1284
1486
|
<div class="env-wrap" id="env-wrap">
|
|
1285
1487
|
<button class="env-trigger" id="env-trigger" type="button">local · —</button>
|
|
1286
1488
|
<div class="env-pop" id="env-pop"></div>
|
|
1287
1489
|
</div>
|
|
1490
|
+
<div class="more-wrap" id="more-wrap">
|
|
1491
|
+
<button class="btn icon" id="more-toggle" type="button" data-tip="Menu" aria-label="Menu" aria-expanded="false" aria-haspopup="true">
|
|
1492
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="5" cy="12" r="1.4"/><circle cx="12" cy="12" r="1.4"/><circle cx="19" cy="12" r="1.4"/></svg>
|
|
1493
|
+
</button>
|
|
1494
|
+
<div class="more-pop" id="more-pop" role="menu">
|
|
1495
|
+
<button class="more-item" id="theme-toggle" type="button" role="menuitem">
|
|
1496
|
+
<span class="more-item-ico theme-sun" aria-hidden="true">
|
|
1497
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
|
|
1498
|
+
</span>
|
|
1499
|
+
<span class="more-item-ico theme-moon" aria-hidden="true">
|
|
1500
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 14.5A8.5 8.5 0 1 1 9.5 3 7 7 0 0 0 21 14.5z"/></svg>
|
|
1501
|
+
</span>
|
|
1502
|
+
<span class="more-item-label">Theme</span>
|
|
1503
|
+
<span class="more-item-meta" id="theme-label">Dark</span>
|
|
1504
|
+
</button>
|
|
1505
|
+
<button class="more-item" id="export-openapi" type="button" role="menuitem">
|
|
1506
|
+
<span class="more-item-ico" aria-hidden="true">
|
|
1507
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
|
|
1508
|
+
</span>
|
|
1509
|
+
<span class="more-item-label">Export</span>
|
|
1510
|
+
</button>
|
|
1511
|
+
<div class="more-sep"></div>
|
|
1512
|
+
<div class="more-section">Shortcuts</div>
|
|
1513
|
+
<div class="more-shortcut"><span>Search</span><kbd id="shortcut-palette">⌘K</kbd></div>
|
|
1514
|
+
<div class="more-shortcut"><span>Sidebar search</span><kbd>/</kbd></div>
|
|
1515
|
+
<div class="more-shortcut"><span>Close</span><kbd>Esc</kbd></div>
|
|
1516
|
+
</div>
|
|
1517
|
+
</div>
|
|
1288
1518
|
</div>
|
|
1289
1519
|
</header>
|
|
1290
|
-
<div class="search-backdrop" id="search-backdrop"
|
|
1520
|
+
<div class="search-backdrop" id="search-backdrop">
|
|
1521
|
+
<div class="search-palette-card" id="search-palette-card">
|
|
1522
|
+
<input class="search-palette-input" id="search-palette-input" placeholder="Search endpoints..." autocomplete="off" spellcheck="false" />
|
|
1523
|
+
<div class="search-palette-panel" id="search-palette-panel" role="listbox"></div>
|
|
1524
|
+
<div class="search-palette-hint">↑↓ navigate · enter open · esc close</div>
|
|
1525
|
+
</div>
|
|
1526
|
+
</div>
|
|
1291
1527
|
<div class="export-backdrop" id="export-backdrop" role="dialog" aria-modal="true" aria-labelledby="export-title">
|
|
1292
1528
|
<div class="export-modal" id="export-modal">
|
|
1293
1529
|
<div class="export-head">
|
|
@@ -1326,7 +1562,12 @@
|
|
|
1326
1562
|
</aside>
|
|
1327
1563
|
<button type="button" class="sidebar-resizer" id="sidebar-resizer" aria-label="Resize sidebar" title="Drag to resize · double-click to collapse"></button>
|
|
1328
1564
|
<main class="workbench" id="main"></main>
|
|
1329
|
-
<div class="
|
|
1565
|
+
<div class="foot-bar">
|
|
1566
|
+
<button class="btn icon sidebar-toggle" id="sidebar-toggle" type="button" data-tip="Sidebar" aria-label="Toggle sidebar" aria-pressed="false">
|
|
1567
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="1"/><path d="M9 4v16"/></svg>
|
|
1568
|
+
</button>
|
|
1569
|
+
<div class="ex-dock" id="ex-dock"></div>
|
|
1570
|
+
</div>
|
|
1330
1571
|
</div>
|
|
1331
1572
|
<script>
|
|
1332
1573
|
window.__SPEC__ = __SPEC_JSON__;
|
|
@@ -1398,11 +1639,15 @@
|
|
|
1398
1639
|
if (!app) return;
|
|
1399
1640
|
app.style.setProperty("--sidebar-w", sidebarLayout.width + "px");
|
|
1400
1641
|
app.classList.toggle("sidebar-collapsed", sidebarLayout.collapsed);
|
|
1642
|
+
const toggle = document.getElementById("sidebar-toggle");
|
|
1643
|
+
if (toggle) {
|
|
1644
|
+
toggle.setAttribute("aria-pressed", sidebarLayout.collapsed ? "true" : "false");
|
|
1645
|
+
toggle.setAttribute("data-tip", sidebarLayout.collapsed ? "Show sidebar" : "Hide sidebar");
|
|
1646
|
+
toggle.setAttribute("aria-label", sidebarLayout.collapsed ? "Show sidebar" : "Hide sidebar");
|
|
1647
|
+
}
|
|
1401
1648
|
if (resizer) {
|
|
1402
|
-
resizer.title =
|
|
1403
|
-
|
|
1404
|
-
: "Drag to resize · double-click to collapse";
|
|
1405
|
-
resizer.setAttribute("aria-label", sidebarLayout.collapsed ? "Expand sidebar" : "Resize sidebar");
|
|
1649
|
+
resizer.title = "Drag to resize · double-click to collapse";
|
|
1650
|
+
resizer.setAttribute("aria-label", "Resize sidebar");
|
|
1406
1651
|
}
|
|
1407
1652
|
};
|
|
1408
1653
|
|
|
@@ -1464,20 +1709,22 @@
|
|
|
1464
1709
|
resizer.addEventListener("touchstart", onDown, { passive: false });
|
|
1465
1710
|
resizer.addEventListener("dblclick", (event) => {
|
|
1466
1711
|
event.preventDefault();
|
|
1467
|
-
|
|
1468
|
-
if (!sidebarLayout.collapsed && sidebarLayout.width < SIDEBAR_MIN) sidebarLayout.width = SIDEBAR_DEFAULT;
|
|
1469
|
-
applySidebarLayout();
|
|
1470
|
-
persistSidebarLayout();
|
|
1471
|
-
});
|
|
1472
|
-
resizer.addEventListener("click", (event) => {
|
|
1473
|
-
if (!sidebarLayout.collapsed || moved) return;
|
|
1474
|
-
event.preventDefault();
|
|
1475
|
-
sidebarLayout.collapsed = false;
|
|
1476
|
-
applySidebarLayout();
|
|
1477
|
-
persistSidebarLayout();
|
|
1712
|
+
toggleSidebar();
|
|
1478
1713
|
});
|
|
1479
1714
|
};
|
|
1480
1715
|
|
|
1716
|
+
const toggleSidebar = () => {
|
|
1717
|
+
sidebarLayout.collapsed = !sidebarLayout.collapsed;
|
|
1718
|
+
if (!sidebarLayout.collapsed && sidebarLayout.width < SIDEBAR_MIN) sidebarLayout.width = SIDEBAR_DEFAULT;
|
|
1719
|
+
applySidebarLayout();
|
|
1720
|
+
persistSidebarLayout();
|
|
1721
|
+
};
|
|
1722
|
+
|
|
1723
|
+
document.getElementById("sidebar-toggle")?.addEventListener("click", (event) => {
|
|
1724
|
+
event.preventDefault();
|
|
1725
|
+
toggleSidebar();
|
|
1726
|
+
});
|
|
1727
|
+
|
|
1481
1728
|
initSidebarResize();
|
|
1482
1729
|
|
|
1483
1730
|
let liveResult = null;
|
|
@@ -2092,7 +2339,36 @@
|
|
|
2092
2339
|
|
|
2093
2340
|
document.title = title || "API Documentation";
|
|
2094
2341
|
const brandEl = document.getElementById("brand");
|
|
2095
|
-
if (brandEl) brandEl.textContent = title;
|
|
2342
|
+
if (brandEl) brandEl.textContent = (title || "DAxTA") + " API Document";
|
|
2343
|
+
const applyTheme = (mode) => {
|
|
2344
|
+
const next = mode === "light" ? "light" : "dark";
|
|
2345
|
+
document.documentElement.setAttribute("data-theme", next);
|
|
2346
|
+
localStorage.setItem("daxta-theme", next);
|
|
2347
|
+
const fav = document.getElementById("favicon");
|
|
2348
|
+
if (fav) fav.setAttribute("href", next === "light" ? "__FAVICON_LIGHT_DATA_URI__" : "__FAVICON_DATA_URI__");
|
|
2349
|
+
const themeLabel = document.getElementById("theme-label");
|
|
2350
|
+
if (themeLabel) themeLabel.textContent = next === "light" ? "Light" : "Dark";
|
|
2351
|
+
};
|
|
2352
|
+
applyTheme(localStorage.getItem("daxta-theme") || "dark");
|
|
2353
|
+
const shortcutPalette = document.getElementById("shortcut-palette");
|
|
2354
|
+
if (shortcutPalette) shortcutPalette.textContent = /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘K" : "Ctrl+K";
|
|
2355
|
+
document.getElementById("theme-toggle")?.addEventListener("click", (event) => {
|
|
2356
|
+
event.stopPropagation();
|
|
2357
|
+
applyTheme(document.documentElement.getAttribute("data-theme") === "dark" ? "light" : "dark");
|
|
2358
|
+
});
|
|
2359
|
+
const moreWrap = document.getElementById("more-wrap");
|
|
2360
|
+
const moreToggle = document.getElementById("more-toggle");
|
|
2361
|
+
const setMoreOpen = (open) => {
|
|
2362
|
+
moreWrap?.classList.toggle("open", open);
|
|
2363
|
+
moreToggle?.setAttribute("aria-expanded", open ? "true" : "false");
|
|
2364
|
+
};
|
|
2365
|
+
moreToggle?.addEventListener("click", (event) => {
|
|
2366
|
+
event.stopPropagation();
|
|
2367
|
+
const next = !moreWrap.classList.contains("open");
|
|
2368
|
+
envWrap.classList.remove("open");
|
|
2369
|
+
setMoreOpen(next);
|
|
2370
|
+
});
|
|
2371
|
+
document.getElementById("more-pop")?.addEventListener("click", (event) => event.stopPropagation());
|
|
2096
2372
|
const specVersion = (spec.info && spec.info.version) || "";
|
|
2097
2373
|
const navVersion = document.getElementById("nav-version");
|
|
2098
2374
|
if (navVersion) navVersion.textContent = specVersion ? (specVersion.startsWith("v") ? specVersion : "v" + specVersion) : "";
|
|
@@ -2100,6 +2376,7 @@
|
|
|
2100
2376
|
const envWrap = document.getElementById("env-wrap");
|
|
2101
2377
|
document.getElementById("env-trigger").addEventListener("click", (event) => {
|
|
2102
2378
|
event.stopPropagation();
|
|
2379
|
+
setMoreOpen(false);
|
|
2103
2380
|
envWrap.classList.toggle("open");
|
|
2104
2381
|
if (envWrap.classList.contains("open")) renderEnvPop();
|
|
2105
2382
|
});
|
|
@@ -2608,6 +2885,7 @@
|
|
|
2608
2885
|
|
|
2609
2886
|
document.getElementById("export-openapi").addEventListener("click", (event) => {
|
|
2610
2887
|
event.stopPropagation();
|
|
2888
|
+
setMoreOpen(false);
|
|
2611
2889
|
openExportModal();
|
|
2612
2890
|
});
|
|
2613
2891
|
document.getElementById("export-cancel").addEventListener("click", closeExportModal);
|
|
@@ -2823,7 +3101,13 @@
|
|
|
2823
3101
|
};
|
|
2824
3102
|
|
|
2825
3103
|
const displayGroup = (group) => GROUP_LABEL[group] || group || "Other";
|
|
2826
|
-
const groupTone = (
|
|
3104
|
+
const groupTone = (group) => {
|
|
3105
|
+
const key = String(group || "").toUpperCase();
|
|
3106
|
+
if (key === "POSITIVE CASES") return "ok";
|
|
3107
|
+
if (key === "INVALID CASES") return "warn";
|
|
3108
|
+
if (key === "OMITTED CASES") return "omit";
|
|
3109
|
+
return "err";
|
|
3110
|
+
};
|
|
2827
3111
|
const statusOk = (status) => Number(status) >= 200 && Number(status) < 300;
|
|
2828
3112
|
|
|
2829
3113
|
const groupedDropdown = (scenarios, selected) => {
|
|
@@ -2849,7 +3133,7 @@
|
|
|
2849
3133
|
});
|
|
2850
3134
|
if (!rows.length) return "";
|
|
2851
3135
|
const label = displayGroup(group);
|
|
2852
|
-
return `<div class="dd-group ${groupTone(
|
|
3136
|
+
return `<div class="dd-group ${groupTone(group)}"><span>${escapeHtml(label)} (${rows.length})</span></div>` +
|
|
2853
3137
|
rows
|
|
2854
3138
|
.map(
|
|
2855
3139
|
({ scenario, index }) =>
|
|
@@ -2884,14 +3168,14 @@
|
|
|
2884
3168
|
const { groups, order } = groupScenarios(item.scenarios);
|
|
2885
3169
|
return `<div class="nav-examples">${order
|
|
2886
3170
|
.map(
|
|
2887
|
-
(group) => `<div class="nav-ex-group">
|
|
2888
|
-
<div class="nav-ex-group-label"><span>${escapeHtml(displayGroup(group))}</span><span class="nav-ex-count">${groups[group].length}</span></div>
|
|
2889
|
-
|
|
3171
|
+
(group) => `<div class="nav-ex-group ${groupTone(group)}">
|
|
3172
|
+
<div class="nav-ex-group-label ${groupTone(group)}"><span>${escapeHtml(displayGroup(group))}</span><span class="nav-ex-count">${groups[group].length}</span></div>
|
|
3173
|
+
<div class="nav-ex-items">${groups[group]
|
|
2890
3174
|
.map(
|
|
2891
3175
|
({ scenario, index }) =>
|
|
2892
3176
|
`<button type="button" class="nav-example ${item.id === currentId && index === scenarioIndex ? "on" : ""}" data-id="${escapeAttr(item.id)}" data-scenario="${index}" title="${escapeAttr(scenarioNavLabel(scenario))}">${escapeHtml(scenarioNavLabel(scenario))}</button>`,
|
|
2893
3177
|
)
|
|
2894
|
-
.join("")}
|
|
3178
|
+
.join("")}</div>
|
|
2895
3179
|
</div>`,
|
|
2896
3180
|
)
|
|
2897
3181
|
.join("")}</div>`;
|
|
@@ -3082,14 +3366,45 @@
|
|
|
3082
3366
|
|
|
3083
3367
|
let searchActiveIndex = 0;
|
|
3084
3368
|
|
|
3369
|
+
const bindSearchHits = (panel, query) => {
|
|
3370
|
+
panel.querySelectorAll(".search-hit").forEach((button) => {
|
|
3371
|
+
button.onclick = (event) => {
|
|
3372
|
+
event.stopPropagation();
|
|
3373
|
+
select(button.dataset.id);
|
|
3374
|
+
closeSearch({ clear: true });
|
|
3375
|
+
};
|
|
3376
|
+
});
|
|
3377
|
+
};
|
|
3378
|
+
|
|
3379
|
+
const searchHitsHtml = (query) => {
|
|
3380
|
+
const q = query.trim().toLowerCase();
|
|
3381
|
+
const matches = q
|
|
3382
|
+
? ops.filter((item) => (item.method + " " + item.path + " " + item.title).toLowerCase().includes(q))
|
|
3383
|
+
: ops;
|
|
3384
|
+
if (!matches.length) return { html: `<div class="search-empty">No matching endpoints</div>`, count: 0 };
|
|
3385
|
+
if (searchActiveIndex >= matches.length) searchActiveIndex = 0;
|
|
3386
|
+
const html = matches
|
|
3387
|
+
.map(
|
|
3388
|
+
(item, index) => `<button type="button" class="search-hit ${index === searchActiveIndex ? "active" : ""}" data-id="${item.id}" role="option">
|
|
3389
|
+
<span class="method ${item.method}">${item.method}</span>
|
|
3390
|
+
<span class="search-hit-path">${q ? highlightMatch(item.path, q) : escapeHtml(item.path)}</span>
|
|
3391
|
+
</button>`,
|
|
3392
|
+
)
|
|
3393
|
+
.join("");
|
|
3394
|
+
return { html, count: matches.length };
|
|
3395
|
+
};
|
|
3396
|
+
|
|
3085
3397
|
const closeSearch = ({ clear = false } = {}) => {
|
|
3086
3398
|
const wrap = document.getElementById("search-wrap");
|
|
3087
3399
|
const input = document.getElementById("search");
|
|
3088
3400
|
wrap.classList.remove("open");
|
|
3089
3401
|
document.body.classList.remove("searching");
|
|
3402
|
+
document.body.classList.remove("search-palette");
|
|
3090
3403
|
searchActiveIndex = 0;
|
|
3091
3404
|
if (clear) {
|
|
3092
3405
|
input.value = "";
|
|
3406
|
+
const paletteInput = document.getElementById("search-palette-input");
|
|
3407
|
+
if (paletteInput) paletteInput.value = "";
|
|
3093
3408
|
navQuery = "";
|
|
3094
3409
|
renderNav();
|
|
3095
3410
|
}
|
|
@@ -3098,6 +3413,24 @@
|
|
|
3098
3413
|
const openSearch = () => {
|
|
3099
3414
|
document.getElementById("search-wrap").classList.add("open");
|
|
3100
3415
|
document.body.classList.add("searching");
|
|
3416
|
+
document.body.classList.remove("search-palette");
|
|
3417
|
+
};
|
|
3418
|
+
|
|
3419
|
+
const openPalette = () => {
|
|
3420
|
+
closeSearch({ clear: false });
|
|
3421
|
+
document.body.classList.add("search-palette");
|
|
3422
|
+
searchActiveIndex = 0;
|
|
3423
|
+
const paletteInput = document.getElementById("search-palette-input");
|
|
3424
|
+
renderPalettePanel(paletteInput.value);
|
|
3425
|
+
paletteInput.focus();
|
|
3426
|
+
paletteInput.select();
|
|
3427
|
+
};
|
|
3428
|
+
|
|
3429
|
+
const renderPalettePanel = (query = "") => {
|
|
3430
|
+
const panel = document.getElementById("search-palette-panel");
|
|
3431
|
+
const { html } = searchHitsHtml(query);
|
|
3432
|
+
panel.innerHTML = html;
|
|
3433
|
+
bindSearchHits(panel, query);
|
|
3101
3434
|
};
|
|
3102
3435
|
|
|
3103
3436
|
const renderSearchPanel = (query = "") => {
|
|
@@ -3111,27 +3444,9 @@
|
|
|
3111
3444
|
return;
|
|
3112
3445
|
}
|
|
3113
3446
|
openSearch();
|
|
3114
|
-
const
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
return;
|
|
3118
|
-
}
|
|
3119
|
-
if (searchActiveIndex >= matches.length) searchActiveIndex = 0;
|
|
3120
|
-
panel.innerHTML = matches
|
|
3121
|
-
.map(
|
|
3122
|
-
(item, index) => `<button type="button" class="search-hit ${index === searchActiveIndex ? "active" : ""}" data-id="${item.id}" role="option">
|
|
3123
|
-
<span class="method ${item.method}">${item.method}</span>
|
|
3124
|
-
<span class="search-hit-path">${highlightMatch(item.path, q)}</span>
|
|
3125
|
-
</button>`,
|
|
3126
|
-
)
|
|
3127
|
-
.join("");
|
|
3128
|
-
panel.querySelectorAll(".search-hit").forEach((button) => {
|
|
3129
|
-
button.onclick = (event) => {
|
|
3130
|
-
event.stopPropagation();
|
|
3131
|
-
select(button.dataset.id);
|
|
3132
|
-
closeSearch({ clear: true });
|
|
3133
|
-
};
|
|
3134
|
-
});
|
|
3447
|
+
const { html } = searchHitsHtml(query);
|
|
3448
|
+
panel.innerHTML = html;
|
|
3449
|
+
bindSearchHits(panel, query);
|
|
3135
3450
|
};
|
|
3136
3451
|
|
|
3137
3452
|
const jsonBlock = (value, pretty) => {
|
|
@@ -3186,18 +3501,24 @@
|
|
|
3186
3501
|
|
|
3187
3502
|
const schemaRows = (fields, { showLoc = false } = {}) => {
|
|
3188
3503
|
if (!fields.length) return `<div class="meta-empty">—</div>`;
|
|
3189
|
-
return fields
|
|
3504
|
+
return `<div class="schema-rows">${fields
|
|
3190
3505
|
.map((field) => {
|
|
3191
3506
|
const depth = fieldDepth(field.name);
|
|
3192
3507
|
const nestClass = depth ? " nested" : "";
|
|
3193
3508
|
const depthAttr = depth ? ` data-depth="${Math.min(depth, 4)}"` : "";
|
|
3509
|
+
const flag =
|
|
3510
|
+
field.required === true
|
|
3511
|
+
? `<div class="flag req">required</div>`
|
|
3512
|
+
: field.required === false
|
|
3513
|
+
? `<div class="flag">optional</div>`
|
|
3514
|
+
: `<div class="flag"></div>`;
|
|
3194
3515
|
return `<div class="row">
|
|
3195
3516
|
<div class="name${nestClass}"${depthAttr}>${escapeHtml(field.name)}</div>
|
|
3196
3517
|
<div class="type">${escapeHtml(field.type)}${showLoc && field.in && field.in !== "body" ? " · " + escapeHtml(field.in) : ""}</div>
|
|
3197
|
-
${
|
|
3518
|
+
${flag}
|
|
3198
3519
|
</div>`;
|
|
3199
3520
|
})
|
|
3200
|
-
.join("")
|
|
3521
|
+
.join("")}</div>`;
|
|
3201
3522
|
};
|
|
3202
3523
|
|
|
3203
3524
|
const schemasInline = (fields, resBody) => {
|
|
@@ -3425,29 +3746,29 @@
|
|
|
3425
3746
|
};
|
|
3426
3747
|
|
|
3427
3748
|
const searchInput = document.getElementById("search");
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
searchInput.addEventListener("keydown", (event) => {
|
|
3433
|
-
const panel = document.getElementById("search-panel");
|
|
3749
|
+
const paletteInput = document.getElementById("search-palette-input");
|
|
3750
|
+
|
|
3751
|
+
const handleSearchKeys = (event, input, panelId) => {
|
|
3752
|
+
const panel = document.getElementById(panelId);
|
|
3434
3753
|
const hits = [...panel.querySelectorAll(".search-hit")];
|
|
3435
3754
|
if (event.key === "Escape") {
|
|
3436
3755
|
closeSearch({ clear: true });
|
|
3437
|
-
|
|
3756
|
+
input.blur();
|
|
3438
3757
|
return;
|
|
3439
3758
|
}
|
|
3440
3759
|
if (!hits.length) return;
|
|
3441
3760
|
if (event.key === "ArrowDown") {
|
|
3442
3761
|
event.preventDefault();
|
|
3443
3762
|
searchActiveIndex = (searchActiveIndex + 1) % hits.length;
|
|
3444
|
-
|
|
3445
|
-
|
|
3763
|
+
if (panelId === "search-palette-panel") renderPalettePanel(input.value);
|
|
3764
|
+
else renderSearchPanel(input.value);
|
|
3765
|
+
panel.querySelectorAll(".search-hit")[searchActiveIndex]?.scrollIntoView({ block: "nearest" });
|
|
3446
3766
|
} else if (event.key === "ArrowUp") {
|
|
3447
3767
|
event.preventDefault();
|
|
3448
3768
|
searchActiveIndex = (searchActiveIndex - 1 + hits.length) % hits.length;
|
|
3449
|
-
|
|
3450
|
-
|
|
3769
|
+
if (panelId === "search-palette-panel") renderPalettePanel(input.value);
|
|
3770
|
+
else renderSearchPanel(input.value);
|
|
3771
|
+
panel.querySelectorAll(".search-hit")[searchActiveIndex]?.scrollIntoView({ block: "nearest" });
|
|
3451
3772
|
} else if (event.key === "Enter") {
|
|
3452
3773
|
event.preventDefault();
|
|
3453
3774
|
const target = hits[searchActiveIndex] || hits[0];
|
|
@@ -3456,21 +3777,45 @@
|
|
|
3456
3777
|
closeSearch({ clear: true });
|
|
3457
3778
|
}
|
|
3458
3779
|
}
|
|
3780
|
+
};
|
|
3781
|
+
|
|
3782
|
+
searchInput.addEventListener("input", (event) => {
|
|
3783
|
+
searchActiveIndex = 0;
|
|
3784
|
+
renderSearchPanel(event.target.value);
|
|
3459
3785
|
});
|
|
3786
|
+
searchInput.addEventListener("keydown", (event) => handleSearchKeys(event, searchInput, "search-panel"));
|
|
3787
|
+
paletteInput.addEventListener("input", (event) => {
|
|
3788
|
+
searchActiveIndex = 0;
|
|
3789
|
+
renderPalettePanel(event.target.value);
|
|
3790
|
+
});
|
|
3791
|
+
paletteInput.addEventListener("keydown", (event) => handleSearchKeys(event, paletteInput, "search-palette-panel"));
|
|
3460
3792
|
document.getElementById("search-backdrop").addEventListener("click", () => closeSearch({ clear: true }));
|
|
3793
|
+
document.getElementById("search-palette-card").addEventListener("click", (event) => event.stopPropagation());
|
|
3461
3794
|
document.getElementById("search-wrap").addEventListener("click", (event) => event.stopPropagation());
|
|
3462
3795
|
|
|
3463
3796
|
document.addEventListener("click", () => {
|
|
3464
3797
|
exampleOpen = false;
|
|
3465
3798
|
document.querySelectorAll(".dd.open").forEach((el) => el.classList.remove("open"));
|
|
3466
3799
|
document.getElementById("env-wrap").classList.remove("open");
|
|
3800
|
+
setMoreOpen(false);
|
|
3467
3801
|
if (document.body.classList.contains("searching")) closeSearch({ clear: true });
|
|
3468
3802
|
});
|
|
3469
3803
|
|
|
3470
3804
|
document.addEventListener("keydown", (event) => {
|
|
3471
3805
|
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
|
3472
3806
|
event.preventDefault();
|
|
3473
|
-
document.
|
|
3807
|
+
if (document.body.classList.contains("search-palette")) closeSearch({ clear: true });
|
|
3808
|
+
else openPalette();
|
|
3809
|
+
return;
|
|
3810
|
+
}
|
|
3811
|
+
if (event.key === "Escape" && document.body.classList.contains("search-palette")) {
|
|
3812
|
+
event.preventDefault();
|
|
3813
|
+
closeSearch({ clear: true });
|
|
3814
|
+
return;
|
|
3815
|
+
}
|
|
3816
|
+
if (event.key === "Escape" && moreWrap?.classList.contains("open")) {
|
|
3817
|
+
event.preventDefault();
|
|
3818
|
+
setMoreOpen(false);
|
|
3474
3819
|
return;
|
|
3475
3820
|
}
|
|
3476
3821
|
if (event.key === "/" && !event.metaKey && !event.ctrlKey && !event.altKey) {
|