@t0.labs/daxta 1.1.2 → 1.1.4

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.
@@ -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__" />
8
- <link rel="apple-touch-icon" href="__FAVICON_DATA_URI__" />
7
+ <link rel="icon" id="favicon" href="__FAVICON_LIGHT_DATA_URI__" />
8
+ <link rel="apple-touch-icon" href="__FAVICON_LIGHT_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: sticky;
86
+ position: fixed;
63
87
  top: 0;
64
- z-index: 20;
88
+ left: 0;
89
+ right: 0;
90
+ z-index: 200;
65
91
  }
66
- body.searching .topnav { z-index: 30; }
67
- .brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; justify-self: start; }
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 { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--charcoal); }
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;
@@ -76,6 +111,10 @@
76
111
  max-width: 100%;
77
112
  }
78
113
  .ep-name {
114
+ display: flex;
115
+ align-items: baseline;
116
+ gap: 8px;
117
+ min-width: 0;
79
118
  font-size: 14px;
80
119
  font-weight: 600;
81
120
  letter-spacing: -0.02em;
@@ -84,6 +123,18 @@
84
123
  text-overflow: ellipsis;
85
124
  color: var(--obsidian);
86
125
  }
126
+ .ep-status {
127
+ flex: none;
128
+ font: 600 14px/1.4 var(--mono);
129
+ letter-spacing: -0.02em;
130
+ color: var(--ok);
131
+ }
132
+ .ep-status.err { color: var(--err); }
133
+ .ep-label {
134
+ min-width: 0;
135
+ overflow: hidden;
136
+ text-overflow: ellipsis;
137
+ }
87
138
  .prefix-bar {
88
139
  display: flex;
89
140
  flex-wrap: wrap;
@@ -96,7 +147,7 @@
96
147
  height: 22px;
97
148
  padding: 0 8px;
98
149
  border: 0;
99
- border-radius: 4px;
150
+ border-radius: 2px;
100
151
  background: transparent;
101
152
  color: var(--stone);
102
153
  font: 500 11px/22px var(--mono);
@@ -119,6 +170,79 @@
119
170
  padding: 0;
120
171
  }
121
172
  .nav-tools .btn.icon svg { width: 16px; height: 16px; }
173
+ .more-wrap { position: relative; flex: none; }
174
+ .more-pop {
175
+ display: none;
176
+ position: absolute;
177
+ top: calc(100% + 6px);
178
+ right: 0;
179
+ width: 260px;
180
+ background: var(--white);
181
+ border: 1px solid var(--hairline);
182
+ border-radius: var(--radius);
183
+ padding: 6px;
184
+ z-index: 220;
185
+ }
186
+ .more-wrap.open .more-pop { display: block; }
187
+ .more-item {
188
+ width: 100%;
189
+ display: flex;
190
+ align-items: center;
191
+ gap: 10px;
192
+ height: 34px;
193
+ padding: 0 8px;
194
+ border: 0;
195
+ border-radius: 2px;
196
+ background: transparent;
197
+ color: var(--obsidian);
198
+ cursor: pointer;
199
+ font: 500 12px/1 var(--sans);
200
+ text-align: left;
201
+ }
202
+ .more-item:hover { background: var(--inset); }
203
+ .more-item-ico {
204
+ width: 16px;
205
+ height: 16px;
206
+ flex: none;
207
+ color: var(--charcoal);
208
+ }
209
+ .more-item-ico svg { width: 16px; height: 16px; display: block; }
210
+ .more-item-label { flex: 1; min-width: 0; }
211
+ .more-item-meta {
212
+ color: var(--stone);
213
+ font: 500 11px/1 var(--mono);
214
+ }
215
+ html[data-theme="light"] .theme-moon { display: none; }
216
+ html:not([data-theme="light"]) .theme-sun { display: none; }
217
+ .more-sep {
218
+ height: 1px;
219
+ background: var(--hairline);
220
+ margin: 6px 4px;
221
+ }
222
+ .more-section {
223
+ padding: 8px 8px 4px;
224
+ font-size: 10px;
225
+ font-weight: 600;
226
+ letter-spacing: 0.08em;
227
+ text-transform: uppercase;
228
+ color: var(--stone);
229
+ }
230
+ .more-shortcut {
231
+ display: flex;
232
+ align-items: center;
233
+ justify-content: space-between;
234
+ gap: 12px;
235
+ padding: 6px 8px;
236
+ font-size: 12px;
237
+ color: var(--charcoal);
238
+ }
239
+ .more-shortcut kbd {
240
+ font: 500 11px/1 var(--mono);
241
+ color: var(--stone);
242
+ border: 1px solid var(--hairline);
243
+ border-radius: 2px;
244
+ padding: 3px 5px;
245
+ }
122
246
  .btn[data-tip] { position: relative; }
123
247
  .btn[data-tip]::after {
124
248
  content: attr(data-tip);
@@ -167,7 +291,7 @@
167
291
  font: 500 10px/1 var(--mono);
168
292
  color: var(--smoke);
169
293
  border: 1px solid var(--hairline);
170
- border-radius: 4px;
294
+ border-radius: 2px;
171
295
  padding: 3px 5px;
172
296
  pointer-events: none;
173
297
  background: var(--inset);
@@ -178,15 +302,61 @@
178
302
  border-radius: var(--radius) var(--radius) 0 0;
179
303
  }
180
304
  .search-wrap.open .search-kbd { display: none; }
305
+ body.searching:not(.search-palette) .tree-scroll,
306
+ body.searching:not(.search-palette) .prefix-bar,
307
+ body.searching:not(.search-palette) .nav-foot {
308
+ filter: blur(7px);
309
+ opacity: 0.4;
310
+ pointer-events: none;
311
+ transition: filter 0.2s ease, opacity 0.2s ease;
312
+ }
181
313
  .search-backdrop {
182
314
  display: none;
183
315
  position: fixed;
184
316
  inset: 0;
185
- background: rgba(232, 232, 232, 0.72);
186
- backdrop-filter: blur(2px);
187
- z-index: 25;
317
+ z-index: 80;
318
+ align-items: flex-start;
319
+ justify-content: center;
320
+ padding: 12vh 16px 24px;
321
+ background: rgba(0, 0, 0, 0.5);
322
+ backdrop-filter: blur(14px);
323
+ -webkit-backdrop-filter: blur(14px);
324
+ }
325
+ html[data-theme="light"] .search-backdrop {
326
+ background: rgba(250, 250, 250, 0.55);
327
+ }
328
+ body.search-palette .search-backdrop { display: flex; }
329
+ .search-palette-card {
330
+ width: min(640px, 100%);
331
+ background: var(--white);
332
+ border: 1px solid var(--hairline);
333
+ border-radius: 2px;
334
+ overflow: hidden;
335
+ box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
336
+ }
337
+ .search-palette-input {
338
+ width: 100%;
339
+ height: 48px;
340
+ border: 0;
341
+ border-bottom: 1px solid var(--hairline);
342
+ background: transparent;
343
+ color: var(--obsidian);
344
+ padding: 0 16px;
345
+ font-size: 15px;
346
+ letter-spacing: -0.02em;
347
+ }
348
+ .search-palette-input:focus { outline: none; }
349
+ .search-palette-input::placeholder { color: var(--smoke); }
350
+ .search-palette-panel {
351
+ max-height: min(420px, 52vh);
352
+ overflow: auto;
353
+ padding: 6px;
354
+ }
355
+ .search-palette-hint {
356
+ padding: 8px 16px 12px;
357
+ font-size: 11px;
358
+ color: var(--smoke);
188
359
  }
189
- body.searching .search-backdrop { display: block; }
190
360
  .search-panel {
191
361
  display: none;
192
362
  position: absolute;
@@ -337,7 +507,7 @@
337
507
  border: 0;
338
508
  background: var(--inset);
339
509
  box-shadow: var(--ghost);
340
- border-radius: 9999px;
510
+ border-radius: 2px;
341
511
  padding: 5px 10px;
342
512
  cursor: pointer;
343
513
  font-size: 12px;
@@ -351,7 +521,7 @@
351
521
  .env-base-line {
352
522
  margin-top: 8px;
353
523
  padding: 8px 10px;
354
- border-radius: 8px;
524
+ border-radius: 2px;
355
525
  background: var(--inset);
356
526
  font: 11px/1.4 var(--mono);
357
527
  color: var(--charcoal);
@@ -365,8 +535,7 @@
365
535
  margin-top: 8px;
366
536
  }
367
537
  .env-kv.base-url .env-cell[data-field="key"] {
368
- opacity: 0.7;
369
- pointer-events: none;
538
+ font-weight: 600;
370
539
  }
371
540
  .env-add {
372
541
  height: 32px;
@@ -394,9 +563,12 @@
394
563
  grid-template-columns: var(--sidebar-w, 320px) 6px minmax(0, 1fr);
395
564
  grid-template-rows: minmax(0, 1fr) auto;
396
565
  height: calc(100vh - 44px);
566
+ margin-top: 44px;
567
+ transition: grid-template-columns 0.32s cubic-bezier(0.22, 1, 0.36, 1);
397
568
  }
569
+ body.sidebar-resizing .app { transition: none; }
398
570
  .app.sidebar-collapsed {
399
- grid-template-columns: 0 28px minmax(0, 1fr);
571
+ grid-template-columns: 0 0 minmax(0, 1fr);
400
572
  }
401
573
  .sidebar {
402
574
  grid-row: 1 / -1;
@@ -425,6 +597,7 @@
425
597
  background: var(--sidebar);
426
598
  border-right: 0;
427
599
  font-size: 13px;
600
+ transition: opacity 0.22s ease;
428
601
  }
429
602
  .app.sidebar-collapsed .sidebar {
430
603
  overflow: hidden;
@@ -432,6 +605,10 @@
432
605
  pointer-events: none;
433
606
  opacity: 0;
434
607
  }
608
+ .app.sidebar-collapsed .sidebar-resizer {
609
+ pointer-events: none;
610
+ opacity: 0;
611
+ }
435
612
  .nav-filter {
436
613
  width: 100%;
437
614
  height: 28px;
@@ -475,23 +652,6 @@
475
652
  body.sidebar-resizing .sidebar-resizer {
476
653
  background: var(--obsidian);
477
654
  }
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
655
  body.sidebar-resizing {
496
656
  cursor: col-resize;
497
657
  user-select: none;
@@ -576,8 +736,8 @@
576
736
  gap: 0;
577
737
  border-radius: var(--radius);
578
738
  }
579
- .nav-op:hover { background: var(--white); }
580
- .nav-op.active { background: var(--white); box-shadow: 0 0 0 1px var(--hairline); }
739
+ .nav-op:hover { background: transparent; }
740
+ .nav-op.active { background: transparent; box-shadow: none; }
581
741
  .nav-op-row {
582
742
  display: flex;
583
743
  align-items: center;
@@ -589,7 +749,7 @@
589
749
  width: 24px;
590
750
  height: 24px;
591
751
  border: 0;
592
- border-radius: 4px;
752
+ border-radius: 2px;
593
753
  background: transparent;
594
754
  color: var(--stone);
595
755
  cursor: pointer;
@@ -615,10 +775,8 @@
615
775
  .nav-examples {
616
776
  display: none;
617
777
  flex-direction: column;
618
- gap: 4px;
778
+ gap: 2px;
619
779
  margin: 0 4px 6px 18px;
620
- padding-left: 8px;
621
- border-left: 1px solid var(--hairline);
622
780
  }
623
781
  .nav-op.examples-open > .nav-examples { display: flex; }
624
782
  .nav-ex-group { display: flex; flex-direction: column; gap: 1px; }
@@ -634,7 +792,8 @@
634
792
  }
635
793
  .nav-ex-count {
636
794
  font: 600 10px/1.4 var(--mono);
637
- color: var(--stone);
795
+ color: inherit;
796
+ opacity: 0.7;
638
797
  }
639
798
  .nav-example {
640
799
  display: block;
@@ -642,8 +801,8 @@
642
801
  border: 0;
643
802
  background: transparent;
644
803
  text-align: left;
645
- padding: 4px 8px;
646
- border-radius: 4px;
804
+ padding: 4px 0 4px 8px;
805
+ border-radius: 2px;
647
806
  cursor: pointer;
648
807
  font-size: 11px;
649
808
  line-height: 1.35;
@@ -652,14 +811,14 @@
652
811
  text-overflow: ellipsis;
653
812
  white-space: nowrap;
654
813
  }
655
- .nav-example:hover { background: var(--inset); color: var(--charcoal); }
656
- .nav-example.on { color: var(--obsidian); background: var(--inset); }
814
+ .nav-example:hover { background: color-mix(in srgb, var(--obsidian) 4%, transparent); color: var(--charcoal); }
815
+ .nav-example.on { color: var(--obsidian); background: color-mix(in srgb, var(--obsidian) 8%, transparent); font-weight: 500; }
657
816
  .nav-ex-total {
658
817
  flex: none;
659
818
  min-width: 16px;
660
819
  margin-right: 2px;
661
820
  padding: 1px 5px;
662
- border-radius: 4px;
821
+ border-radius: 2px;
663
822
  background: var(--obsidian);
664
823
  color: var(--white);
665
824
  font: 600 10px/1.4 var(--mono);
@@ -682,12 +841,18 @@
682
841
  inset: 0;
683
842
  background: rgba(232, 232, 232, 0.72);
684
843
  backdrop-filter: blur(2px);
685
- z-index: 40;
844
+ z-index: 400;
686
845
  align-items: center;
687
846
  justify-content: center;
688
847
  padding: 24px;
689
848
  }
690
849
  body.exporting .export-backdrop { display: flex; }
850
+ body.exporting { overflow: hidden; }
851
+ /** The backdrop covers the viewport, but focus and scroll still reach the page behind it. */
852
+ body.exporting > *:not(.export-backdrop) {
853
+ pointer-events: none;
854
+ user-select: none;
855
+ }
691
856
  .export-modal {
692
857
  width: min(560px, 100%);
693
858
  max-height: min(720px, calc(100vh - 48px));
@@ -742,28 +907,160 @@
742
907
  .export-toolbar {
743
908
  display: flex;
744
909
  flex-wrap: wrap;
745
- gap: 8px;
910
+ align-items: center;
911
+ gap: 6px;
746
912
  padding: 10px 20px;
747
913
  border-bottom: 1px solid var(--hairline);
748
914
  }
915
+ .export-tool-label {
916
+ font: 600 10px/1.6 var(--sans);
917
+ letter-spacing: 0.08em;
918
+ text-transform: uppercase;
919
+ color: var(--stone);
920
+ margin-right: 2px;
921
+ }
922
+ .export-tool-sep {
923
+ width: 1px;
924
+ height: 16px;
925
+ margin: 0 4px;
926
+ background: var(--hairline);
927
+ }
928
+ .export-tool-sep[hidden] { display: none; }
929
+ .export-tool-chips {
930
+ display: inline-flex;
931
+ flex-wrap: wrap;
932
+ gap: 6px;
933
+ min-width: 0;
934
+ }
935
+ .section-chip {
936
+ display: inline-flex;
937
+ align-items: center;
938
+ gap: 6px;
939
+ padding: 3px 9px;
940
+ border: 1px solid var(--hairline);
941
+ border-radius: 999px;
942
+ background: var(--paper);
943
+ color: var(--charcoal);
944
+ font: 500 12px/1.5 var(--sans);
945
+ cursor: pointer;
946
+ transition: border-color 0.12s ease, background 0.12s ease;
947
+ }
948
+ .section-chip .dot {
949
+ width: 6px;
950
+ height: 6px;
951
+ border-radius: 50%;
952
+ background: currentColor;
953
+ flex: none;
954
+ }
955
+ .section-chip.ok .dot { background: var(--ok); }
956
+ .section-chip.warn .dot { background: var(--warn); }
957
+ .section-chip.omit .dot { background: var(--accent); }
958
+ .section-chip.err .dot { background: var(--err); }
959
+ .section-chip.plain { color: var(--obsidian); }
960
+ .section-chip:hover { background: var(--inset); }
961
+ .section-chip .dot { opacity: 0.35; }
962
+ .section-chip.on .dot,
963
+ .section-chip.part .dot { opacity: 1; }
964
+ .section-chip.part .dot {
965
+ background: none;
966
+ border: 1.5px solid currentColor;
967
+ }
968
+ .section-chip.on { color: var(--obsidian); }
969
+ .section-chip.ok.on { border-color: color-mix(in srgb, var(--ok) 55%, var(--hairline)); background: color-mix(in srgb, var(--ok) 10%, var(--paper)); }
970
+ .section-chip.warn.on { border-color: color-mix(in srgb, var(--warn) 55%, var(--hairline)); background: color-mix(in srgb, var(--warn) 10%, var(--paper)); }
971
+ .section-chip.omit.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--hairline)); background: color-mix(in srgb, var(--accent) 10%, var(--paper)); }
972
+ .section-chip.err.on { border-color: color-mix(in srgb, var(--err) 55%, var(--hairline)); background: color-mix(in srgb, var(--err) 10%, var(--paper)); }
973
+ .section-chip.ok.part .dot { color: var(--ok); }
974
+ .section-chip.warn.part .dot { color: var(--warn); }
975
+ .section-chip.omit.part .dot { color: var(--accent); }
976
+ .section-chip.err.part .dot { color: var(--err); }
749
977
  .export-body {
750
978
  flex: 1;
751
979
  overflow: auto;
752
980
  padding: 8px 12px 16px;
753
981
  }
982
+ .export-folder { margin: 0; }
983
+ .export-folder.collapsed > .export-folder-children { display: none; }
984
+ .export-folder-head {
985
+ display: flex;
986
+ align-items: center;
987
+ gap: 8px;
988
+ width: 100%;
989
+ padding: 6px 4px;
990
+ border: 0;
991
+ background: none;
992
+ text-align: left;
993
+ font: 500 12px/1.4 var(--sans);
994
+ color: var(--charcoal);
995
+ cursor: pointer;
996
+ }
997
+ .export-folder-head:hover { background: var(--inset); }
998
+ .export-folder-head .chev {
999
+ width: 6px;
1000
+ height: 6px;
1001
+ flex: none;
1002
+ border-right: 1.5px solid currentColor;
1003
+ border-bottom: 1.5px solid currentColor;
1004
+ transform: rotate(45deg);
1005
+ margin-top: -3px;
1006
+ opacity: 0.7;
1007
+ transition: transform 0.15s ease;
1008
+ }
1009
+ .export-folder.collapsed > .export-folder-head .chev {
1010
+ transform: rotate(-45deg);
1011
+ margin-top: -2px;
1012
+ }
1013
+ .export-folder-name {
1014
+ overflow: hidden;
1015
+ text-overflow: ellipsis;
1016
+ white-space: nowrap;
1017
+ }
1018
+ .export-folder-children {
1019
+ margin-left: 7px;
1020
+ padding-left: 8px;
1021
+ border-left: 1px solid var(--hairline);
1022
+ }
754
1023
  .export-op {
755
- padding: 10px 8px;
756
- border-bottom: 1px solid var(--hairline);
1024
+ padding: 0;
757
1025
  }
758
1026
  .export-op:last-child { border-bottom: 0; }
1027
+ .export-op.collapsed > .export-op-groups { display: none; }
759
1028
  .export-op-title {
760
1029
  display: flex;
761
1030
  align-items: center;
762
1031
  gap: 8px;
763
- margin-bottom: 8px;
1032
+ width: 100%;
1033
+ padding: 6px 4px;
1034
+ border: 0;
1035
+ background: none;
1036
+ text-align: left;
764
1037
  font-size: 12px;
765
1038
  color: var(--obsidian);
1039
+ cursor: pointer;
1040
+ }
1041
+ .export-op-title:hover { background: var(--inset); }
1042
+ .export-op-title .chev {
1043
+ width: 6px;
1044
+ height: 6px;
1045
+ flex: none;
1046
+ border-right: 1.5px solid currentColor;
1047
+ border-bottom: 1.5px solid currentColor;
1048
+ transform: rotate(45deg);
1049
+ margin-top: -3px;
1050
+ opacity: 0.7;
1051
+ transition: transform 0.15s ease;
766
1052
  }
1053
+ .export-op.collapsed > .export-op-title .chev {
1054
+ transform: rotate(-45deg);
1055
+ margin-top: -2px;
1056
+ }
1057
+ .export-op-count {
1058
+ margin-left: auto;
1059
+ flex: none;
1060
+ font: 600 10px/1.4 var(--mono);
1061
+ color: var(--stone);
1062
+ }
1063
+ .export-op-groups { padding: 2px 0 8px; }
767
1064
  .export-op-title .path {
768
1065
  font-family: var(--mono);
769
1066
  font-size: 11px;
@@ -772,6 +1069,58 @@
772
1069
  text-overflow: ellipsis;
773
1070
  white-space: nowrap;
774
1071
  }
1072
+ .export-group { margin: 0 0 6px; }
1073
+ .export-group:last-child { margin-bottom: 0; }
1074
+ .export-group-head {
1075
+ display: flex;
1076
+ align-items: center;
1077
+ gap: 8px;
1078
+ padding: 4px 4px 4px 2px;
1079
+ font: 600 10px/1.2 var(--sans);
1080
+ letter-spacing: 0.04em;
1081
+ cursor: pointer;
1082
+ color: var(--charcoal);
1083
+ }
1084
+ .export-group-head.ok { color: var(--ok); }
1085
+ .export-group-head.warn { color: var(--warn); }
1086
+ .export-group-head.omit { color: var(--accent); }
1087
+ .export-group-head.err { color: var(--err); }
1088
+ .export-group-count {
1089
+ font: 600 10px/1.4 var(--mono);
1090
+ color: var(--stone);
1091
+ }
1092
+ .export-group-items {
1093
+ margin-left: 8px;
1094
+ padding-left: 8px;
1095
+ border-left: 1px solid var(--hairline);
1096
+ }
1097
+ .export-group.collapsed > .export-group-items { display: none; }
1098
+ .export-group-toggle {
1099
+ display: inline-flex;
1100
+ align-items: center;
1101
+ justify-content: center;
1102
+ width: 14px;
1103
+ height: 14px;
1104
+ padding: 0;
1105
+ border: 0;
1106
+ background: none;
1107
+ color: inherit;
1108
+ cursor: pointer;
1109
+ }
1110
+ .export-group-toggle .chev {
1111
+ width: 6px;
1112
+ height: 6px;
1113
+ border-right: 1.5px solid currentColor;
1114
+ border-bottom: 1.5px solid currentColor;
1115
+ transform: rotate(45deg);
1116
+ margin-top: -3px;
1117
+ opacity: 0.7;
1118
+ transition: transform 0.15s ease;
1119
+ }
1120
+ .export-group.collapsed .export-group-toggle .chev {
1121
+ transform: rotate(-45deg);
1122
+ margin-top: -2px;
1123
+ }
775
1124
  .export-ex {
776
1125
  display: flex;
777
1126
  align-items: flex-start;
@@ -804,7 +1153,7 @@
804
1153
  min-width: 40px;
805
1154
  height: 18px;
806
1155
  padding: 0 5px;
807
- border-radius: 4px;
1156
+ border-radius: 2px;
808
1157
  font: 600 10px/1 var(--mono);
809
1158
  letter-spacing: 0.04em;
810
1159
  text-transform: uppercase;
@@ -825,15 +1174,31 @@
825
1174
  .schema-block .meta-label { margin-bottom: 8px; display: block; }
826
1175
 
827
1176
  .ex-block { margin: 0; position: relative; }
828
- .ex-dock {
1177
+ .foot-bar {
829
1178
  grid-column: 3;
830
1179
  grid-row: 2;
831
1180
  position: relative;
832
1181
  z-index: 100;
1182
+ display: flex;
1183
+ align-items: center;
1184
+ gap: 8px;
833
1185
  padding: 8px 16px 10px;
834
1186
  background: var(--white);
835
1187
  border-top: 1px solid var(--hairline);
836
1188
  }
1189
+ .foot-bar .sidebar-toggle {
1190
+ flex: none;
1191
+ width: 28px;
1192
+ height: 28px;
1193
+ padding: 0;
1194
+ }
1195
+ .ex-dock {
1196
+ flex: 1;
1197
+ min-width: 0;
1198
+ padding: 0;
1199
+ background: transparent;
1200
+ border: 0;
1201
+ }
837
1202
  .ex-dock:empty { display: none; }
838
1203
  .ex-dock .dd-menu {
839
1204
  top: auto;
@@ -915,7 +1280,7 @@
915
1280
  height: 32px;
916
1281
  margin: 8px 8px 4px;
917
1282
  border: 1px solid var(--hairline);
918
- border-radius: 4px;
1283
+ border-radius: 2px;
919
1284
  padding: 0 8px;
920
1285
  font-size: 12px;
921
1286
  background: var(--white);
@@ -934,6 +1299,8 @@
934
1299
  padding: 10px 12px 4px;
935
1300
  }
936
1301
  .dd-group.ok { color: var(--ok); }
1302
+ .dd-group.warn { color: var(--warn); }
1303
+ .dd-group.omit { color: var(--accent); }
937
1304
  .dd-group.err { color: var(--err); }
938
1305
  .dd-count {
939
1306
  font: 600 10px/1.4 var(--mono);
@@ -1086,7 +1453,7 @@
1086
1453
  .mode-toggle {
1087
1454
  display: flex;
1088
1455
  border: 1px solid var(--hairline);
1089
- border-radius: 4px;
1456
+ border-radius: 2px;
1090
1457
  overflow: hidden;
1091
1458
  }
1092
1459
  .mode-toggle button {
@@ -1170,20 +1537,20 @@
1170
1537
  pre {
1171
1538
  margin: 0;
1172
1539
  padding: 10px 12px;
1173
- background: #fcfcfc;
1540
+ background: var(--inset);
1174
1541
  border-radius: 0;
1175
1542
  overflow: auto;
1176
1543
  font: 12px/1.5 var(--mono);
1177
1544
  }
1178
- .k { color: #111111; }
1545
+ .k { color: var(--obsidian); }
1179
1546
  .s { color: var(--accent); }
1180
- .n { color: #111111; }
1547
+ .n { color: var(--charcoal); }
1181
1548
  .p { color: #666666; }
1182
1549
  .empty { color: var(--stone); font-size: 13px; padding: 14px 16px; }
1183
1550
  .code {
1184
1551
  font: 600 11px/1 var(--mono);
1185
1552
  padding: 3px 6px;
1186
- border-radius: 4px;
1553
+ border-radius: 2px;
1187
1554
  background: var(--inset);
1188
1555
  }
1189
1556
  .code.ok { background: var(--ok-bg); color: var(--ok); }
@@ -1206,14 +1573,23 @@
1206
1573
  margin: 0 0 8px;
1207
1574
  color: var(--stone);
1208
1575
  }
1576
+ .schema-rows {
1577
+ display: grid;
1578
+ grid-template-columns: minmax(0, 1fr) max-content max-content;
1579
+ column-gap: 16px;
1580
+ }
1209
1581
  .row {
1210
1582
  display: grid;
1211
- grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) auto;
1212
- gap: 8px;
1583
+ grid-template-columns: minmax(0, 1fr) max-content max-content;
1584
+ grid-column: 1 / -1;
1585
+ column-gap: 16px;
1213
1586
  align-items: baseline;
1214
1587
  padding: 5px 0;
1215
1588
  font-size: 12px;
1216
1589
  }
1590
+ .schema-rows > .row {
1591
+ grid-template-columns: subgrid;
1592
+ }
1217
1593
  .row .name {
1218
1594
  font-family: var(--mono);
1219
1595
  font-size: 12px;
@@ -1238,7 +1614,13 @@
1238
1614
  font-size: 11px;
1239
1615
  min-width: 0;
1240
1616
  }
1241
- .flag { font-size: 11px; color: var(--smoke); }
1617
+ .flag {
1618
+ font-size: 11px;
1619
+ color: var(--smoke);
1620
+ justify-self: end;
1621
+ text-align: right;
1622
+ min-height: 1em;
1623
+ }
1242
1624
  .flag.req { color: var(--err); }
1243
1625
 
1244
1626
  .work-foot {
@@ -1248,18 +1630,22 @@
1248
1630
  }
1249
1631
 
1250
1632
  @media (max-width: 960px) {
1633
+ html, body { overflow: auto; height: auto; }
1251
1634
  .app {
1252
1635
  grid-template-columns: 1fr;
1253
1636
  grid-template-rows: auto 1fr auto;
1254
1637
  height: auto;
1255
1638
  min-height: calc(100vh - 44px);
1256
1639
  }
1257
- .app.sidebar-collapsed {
1258
- grid-template-columns: 1fr;
1640
+ .sidebar, .workbench, .foot-bar { grid-column: 1; grid-row: auto; }
1641
+ .sidebar { max-height: 40vh; }
1642
+ .app.sidebar-collapsed .sidebar {
1643
+ max-height: 0 !important;
1644
+ padding: 0 !important;
1645
+ opacity: 0;
1646
+ pointer-events: none;
1259
1647
  }
1260
- .sidebar, .workbench, .ex-dock { grid-column: 1; grid-row: auto; }
1261
- .sidebar { max-height: 40vh; opacity: 1 !important; pointer-events: auto !important; padding: 16px 12px 24px !important; }
1262
- .ex-dock { position: sticky; bottom: 0; }
1648
+ .foot-bar { position: sticky; bottom: 0; }
1263
1649
  .sidebar-resizer { display: none; }
1264
1650
  .pair, .schemas { grid-template-columns: 1fr; }
1265
1651
  .workbench { overflow: auto; height: auto; }
@@ -1267,27 +1653,66 @@
1267
1653
  .card { height: auto; max-height: 70vh; }
1268
1654
  .search-wrap { width: min(280px, 70vw); }
1269
1655
  }
1656
+
1657
+ .method { border-radius: 2px; }
1658
+ html:not([data-theme="light"]) .btn.primary {
1659
+ background: #f3f3f3;
1660
+ color: #0a0a0a;
1661
+ }
1662
+ html:not([data-theme="light"]) .btn.primary:hover { color: #0a0a0a; }
1663
+
1270
1664
  </style>
1271
1665
  </head>
1272
1666
  <body>
1273
1667
  <header class="topnav">
1274
1668
  <div class="brand-wrap">
1275
- <div class="brand" id="brand">API</div>
1669
+ <div class="brand" id="brand">DAxTA API Document</div>
1276
1670
  </div>
1277
1671
  <div class="ep-nav" id="ep-nav">
1278
1672
  <span class="ep-name" id="ep-name"></span>
1279
1673
  </div>
1280
1674
  <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
1675
  <div class="env-wrap" id="env-wrap">
1285
1676
  <button class="env-trigger" id="env-trigger" type="button">local · —</button>
1286
1677
  <div class="env-pop" id="env-pop"></div>
1287
1678
  </div>
1679
+ <div class="more-wrap" id="more-wrap">
1680
+ <button class="btn icon" id="more-toggle" type="button" data-tip="Menu" aria-label="Menu" aria-expanded="false" aria-haspopup="true">
1681
+ <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>
1682
+ </button>
1683
+ <div class="more-pop" id="more-pop" role="menu">
1684
+ <button class="more-item" id="theme-toggle" type="button" role="menuitem">
1685
+ <span class="more-item-ico theme-sun" aria-hidden="true">
1686
+ <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>
1687
+ </span>
1688
+ <span class="more-item-ico theme-moon" aria-hidden="true">
1689
+ <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>
1690
+ </span>
1691
+ <span class="more-item-label">Theme</span>
1692
+ <span class="more-item-meta" id="theme-label">Dark</span>
1693
+ </button>
1694
+ <button class="more-item" id="export-openapi" type="button" role="menuitem">
1695
+ <span class="more-item-ico" aria-hidden="true">
1696
+ <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>
1697
+ </span>
1698
+ <span class="more-item-label">Export</span>
1699
+ </button>
1700
+ <div class="more-sep"></div>
1701
+ <div class="more-section">Shortcuts</div>
1702
+ <div class="more-shortcut"><span>Search</span><kbd id="shortcut-palette">⌘K</kbd></div>
1703
+ <div class="more-shortcut"><span>Sidebar search</span><kbd>/</kbd></div>
1704
+ <div class="more-shortcut"><span>Close</span><kbd>Esc</kbd></div>
1705
+ </div>
1706
+ </div>
1288
1707
  </div>
1289
1708
  </header>
1290
- <div class="search-backdrop" id="search-backdrop"></div>
1709
+ <div class="search-backdrop" id="search-backdrop">
1710
+ <div class="search-palette-card" id="search-palette-card">
1711
+ <input class="search-palette-input" id="search-palette-input" placeholder="Search endpoints..." autocomplete="off" spellcheck="false" />
1712
+ <div class="search-palette-panel" id="search-palette-panel" role="listbox"></div>
1713
+ <div class="search-palette-hint">↑↓ navigate · enter open · esc close</div>
1714
+ </div>
1715
+ </div>
1291
1716
  <div class="export-backdrop" id="export-backdrop" role="dialog" aria-modal="true" aria-labelledby="export-title">
1292
1717
  <div class="export-modal" id="export-modal">
1293
1718
  <div class="export-head">
@@ -1297,14 +1722,16 @@
1297
1722
  <div class="export-options">
1298
1723
  <label class="export-check">
1299
1724
  <input type="checkbox" id="export-include-tryit" checked />
1300
- <span>Include env + headers <span style="color:var(--stone)">(Collection uses <code>{{baseUrl}}</code> / <code>{{vars}}</code> + environment file)</span></span>
1725
+ <span>Include env + headers <span style="color:var(--stone)">(Collection uses <code id="export-base-var">{{baseUrl}}</code> / <code>{{vars}}</code> + environment file)</span></span>
1301
1726
  </label>
1302
1727
  <div class="export-tryit-meta" id="export-tryit-meta">—</div>
1303
1728
  </div>
1304
1729
  <div class="export-toolbar">
1305
- <button type="button" class="btn sm" id="export-all">All</button>
1306
- <button type="button" class="btn sm" id="export-none">None</button>
1307
- <button type="button" class="btn sm" id="export-success">Success only</button>
1730
+ <span class="export-tool-label">Examples</span>
1731
+ <button type="button" class="section-chip plain" id="export-all">All</button>
1732
+ <button type="button" class="section-chip plain" id="export-none">None</button>
1733
+ <span class="export-tool-sep" id="export-sections-sep" hidden></span>
1734
+ <span class="export-tool-chips" id="export-sections"></span>
1308
1735
  </div>
1309
1736
  <div class="export-body" id="export-body"></div>
1310
1737
  <div class="export-foot">
@@ -1326,7 +1753,12 @@
1326
1753
  </aside>
1327
1754
  <button type="button" class="sidebar-resizer" id="sidebar-resizer" aria-label="Resize sidebar" title="Drag to resize · double-click to collapse"></button>
1328
1755
  <main class="workbench" id="main"></main>
1329
- <div class="ex-dock" id="ex-dock"></div>
1756
+ <div class="foot-bar">
1757
+ <button class="btn icon sidebar-toggle" id="sidebar-toggle" type="button" data-tip="Sidebar" aria-label="Toggle sidebar" aria-pressed="false">
1758
+ <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>
1759
+ </button>
1760
+ <div class="ex-dock" id="ex-dock"></div>
1761
+ </div>
1330
1762
  </div>
1331
1763
  <script>
1332
1764
  window.__SPEC__ = __SPEC_JSON__;
@@ -1398,11 +1830,15 @@
1398
1830
  if (!app) return;
1399
1831
  app.style.setProperty("--sidebar-w", sidebarLayout.width + "px");
1400
1832
  app.classList.toggle("sidebar-collapsed", sidebarLayout.collapsed);
1833
+ const toggle = document.getElementById("sidebar-toggle");
1834
+ if (toggle) {
1835
+ toggle.setAttribute("aria-pressed", sidebarLayout.collapsed ? "true" : "false");
1836
+ toggle.setAttribute("data-tip", sidebarLayout.collapsed ? "Show sidebar" : "Hide sidebar");
1837
+ toggle.setAttribute("aria-label", sidebarLayout.collapsed ? "Show sidebar" : "Hide sidebar");
1838
+ }
1401
1839
  if (resizer) {
1402
- resizer.title = sidebarLayout.collapsed
1403
- ? "Click to expand sidebar"
1404
- : "Drag to resize · double-click to collapse";
1405
- resizer.setAttribute("aria-label", sidebarLayout.collapsed ? "Expand sidebar" : "Resize sidebar");
1840
+ resizer.title = "Drag to resize · double-click to collapse";
1841
+ resizer.setAttribute("aria-label", "Resize sidebar");
1406
1842
  }
1407
1843
  };
1408
1844
 
@@ -1464,20 +1900,22 @@
1464
1900
  resizer.addEventListener("touchstart", onDown, { passive: false });
1465
1901
  resizer.addEventListener("dblclick", (event) => {
1466
1902
  event.preventDefault();
1467
- sidebarLayout.collapsed = !sidebarLayout.collapsed;
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();
1903
+ toggleSidebar();
1478
1904
  });
1479
1905
  };
1480
1906
 
1907
+ const toggleSidebar = () => {
1908
+ sidebarLayout.collapsed = !sidebarLayout.collapsed;
1909
+ if (!sidebarLayout.collapsed && sidebarLayout.width < SIDEBAR_MIN) sidebarLayout.width = SIDEBAR_DEFAULT;
1910
+ applySidebarLayout();
1911
+ persistSidebarLayout();
1912
+ };
1913
+
1914
+ document.getElementById("sidebar-toggle")?.addEventListener("click", (event) => {
1915
+ event.preventDefault();
1916
+ toggleSidebar();
1917
+ });
1918
+
1481
1919
  initSidebarResize();
1482
1920
 
1483
1921
  let liveResult = null;
@@ -1524,17 +1962,72 @@
1524
1962
 
1525
1963
  const defaultHeaderValues = collectDefaultHeaderValues();
1526
1964
 
1965
+ /**
1966
+ * Env name for a base URL: loopback → local, host keyword → that keyword,
1967
+ * otherwise the first non-generic subdomain, falling back to production.
1968
+ */
1969
+ const envNameFromUrl = (url) => {
1970
+ let host = String(url || "").trim();
1971
+ try {
1972
+ host = new URL(host).hostname;
1973
+ } catch {
1974
+ host = host.replace(/^[a-z]+:\/\//i, "").split("/")[0].split(":")[0];
1975
+ }
1976
+ host = host.toLowerCase();
1977
+ if (!host) return "local";
1978
+ if (["localhost", "127.0.0.1", "0.0.0.0", "::1"].includes(host) || host.endsWith(".local")) return "local";
1979
+ const keywords = [
1980
+ [/\bstag(e|ing)\b/, "staging"],
1981
+ [/\b(dev|development)\b/, "development"],
1982
+ [/\b(test|testing)\b/, "test"],
1983
+ [/\bqa\b/, "qa"],
1984
+ [/\bsandbox\b/, "sandbox"],
1985
+ [/\b(preprod|pre-prod|uat)\b/, "uat"],
1986
+ [/\b(prod|production)\b/, "production"],
1987
+ ];
1988
+ const labels = host.split(".");
1989
+ for (const [pattern, name] of keywords) {
1990
+ if (labels.some((label) => pattern.test(label))) return name;
1991
+ }
1992
+ const generic = new Set(["api", "www", "app", "gateway", "edge"]);
1993
+ return labels.slice(0, -2).filter((label) => label && !generic.has(label))[0] || "production";
1994
+ };
1995
+
1996
+ /** Envs come from spec.servers (built per env preset); viewer.envPresets only overrides/extends. */
1527
1997
  const configuredPresets = (() => {
1528
- const raw = viewer.envPresets;
1529
- if (raw && typeof raw === "object" && Object.keys(raw).length) return raw;
1530
- return { local: { baseUrl: defaultBaseUrl } };
1998
+ const presets = {};
1999
+ for (const server of Array.isArray(spec.servers) ? spec.servers : []) {
2000
+ const url = String((server && server.url) || "").replace(/\/$/, "");
2001
+ if (!url) continue;
2002
+ const name = String((server && server.description) || "").trim() || envNameFromUrl(url);
2003
+ if (!presets[name]) presets[name] = { baseUrl: url };
2004
+ }
2005
+ const overrides = viewer.envPresets;
2006
+ if (overrides && typeof overrides === "object") {
2007
+ for (const [name, preset] of Object.entries(overrides)) {
2008
+ if (!name || !preset || typeof preset !== "object") continue;
2009
+ const baseUrl = String(preset.baseUrl || (presets[name] && presets[name].baseUrl) || defaultBaseUrl).replace(/\/$/, "");
2010
+ presets[name] = { ...preset, baseUrl: baseUrl || defaultBaseUrl };
2011
+ }
2012
+ }
2013
+ if (!Object.keys(presets).length) presets[envNameFromUrl(defaultBaseUrl)] = { baseUrl: defaultBaseUrl };
2014
+ return presets;
1531
2015
  })();
1532
2016
 
2017
+ const DEFAULT_BASE_URL_KEY = "baseUrl";
2018
+
2019
+ /** The base URL variable can be renamed per env (e.g. ONBOARDING_SERVICE) for Postman. */
2020
+ const baseUrlKeyOf = (env) => {
2021
+ const key = env && typeof env.baseUrlKey === "string" ? env.baseUrlKey.trim() : "";
2022
+ return key || DEFAULT_BASE_URL_KEY;
2023
+ };
2024
+
1533
2025
  const setEnvBaseUrl = (env, baseUrl) => {
1534
2026
  const variables = env.variables || (env.variables = []);
1535
- const row = variables.find((entry) => entry.key === "baseUrl");
2027
+ const key = baseUrlKeyOf(env);
2028
+ const row = variables.find((entry) => entry.key === key);
1536
2029
  if (row) row.value = baseUrl;
1537
- else variables.unshift({ key: "baseUrl", value: baseUrl });
2030
+ else variables.unshift({ key, value: baseUrl });
1538
2031
  };
1539
2032
 
1540
2033
  const buildHeaderTemplate = () => {
@@ -1591,11 +2084,12 @@
1591
2084
  const envFromPreset = (preset) => {
1592
2085
  const template = buildHeaderTemplate();
1593
2086
  const baseUrl = String((preset && preset.baseUrl) || defaultBaseUrl).replace(/\/$/, "") || defaultBaseUrl;
1594
- const variables = [{ key: "baseUrl", value: baseUrl }, ...template.variables.map((row) => ({ ...row }))];
2087
+ const baseUrlKey = baseUrlKeyOf(preset);
2088
+ const variables = [{ key: baseUrlKey, value: baseUrl }, ...template.variables.map((row) => ({ ...row }))];
1595
2089
  const known = new Set(variables.map((row) => row.key));
1596
2090
  if (preset && preset.variables && typeof preset.variables === "object") {
1597
2091
  for (const [key, value] of Object.entries(preset.variables)) {
1598
- if (!key || key === "baseUrl") continue;
2092
+ if (!key || key === baseUrlKey) continue;
1599
2093
  if (known.has(key)) {
1600
2094
  const row = variables.find((entry) => entry.key === key);
1601
2095
  if (row) row.value = String(value ?? "");
@@ -1609,7 +2103,7 @@
1609
2103
  for (const [group, rows] of Object.entries(template.headerGroups)) {
1610
2104
  headerGroups[group] = rows.map((row) => ({ ...row }));
1611
2105
  }
1612
- return { variables, headerGroups };
2106
+ return { variables, headerGroups, baseUrlKey };
1613
2107
  };
1614
2108
 
1615
2109
  const buildDefaultStore = () => {
@@ -1640,12 +2134,16 @@
1640
2134
  const envs = {};
1641
2135
  for (const [name, env] of Object.entries(saved.envs)) {
1642
2136
  const base = cloneDefaultEnv();
2137
+ const baseUrlKey = baseUrlKeyOf(env);
1643
2138
  const variables = Array.isArray(env.variables)
1644
2139
  ? env.variables.map((row) => ({ key: String(row.key || ""), value: String(row.value ?? "") }))
1645
2140
  : base.variables.map((row) => ({ ...row }));
1646
2141
  const known = new Set(variables.map((row) => row.key).filter(Boolean));
1647
2142
  for (const row of base.variables) {
1648
- if (row.key && !known.has(row.key)) variables.push({ ...row });
2143
+ if (!row.key || known.has(row.key)) continue;
2144
+ // A renamed base URL variable already covers the default `baseUrl` row.
2145
+ if (row.key === DEFAULT_BASE_URL_KEY && baseUrlKey !== DEFAULT_BASE_URL_KEY) continue;
2146
+ variables.push({ ...row });
1649
2147
  }
1650
2148
  const defaultsByKey = Object.fromEntries((base.variables || []).filter((row) => row.key).map((row) => [row.key, row.value ?? ""]));
1651
2149
  for (const row of variables) {
@@ -1658,7 +2156,7 @@
1658
2156
  if (!headerGroups[group]) headerGroups[group] = rows.map((row) => ({ ...row }));
1659
2157
  }
1660
2158
  if (!Object.keys(headerGroups).length) headerGroups.default = [{ key: "content-type", value: "application/json" }];
1661
- envs[name] = { variables, headerGroups };
2159
+ envs[name] = { variables, headerGroups, baseUrlKey };
1662
2160
  }
1663
2161
  // Seed any config presets that are missing from the saved store (don't wipe existing).
1664
2162
  for (const [name, preset] of Object.entries(configuredPresets)) {
@@ -1830,7 +2328,12 @@
1830
2328
  if (document.getElementById("env-wrap")?.classList.contains("open")) renderEnvPop();
1831
2329
  };
1832
2330
 
1833
- const currentBaseUrl = () => String(interpolate(varMap().baseUrl || defaultBaseUrl, varMap()) || defaultBaseUrl).replace(/\/$/, "");
2331
+ const activeBaseUrlKey = () => baseUrlKeyOf(activeEnvConfig());
2332
+
2333
+ const currentBaseUrl = () => {
2334
+ const vars = varMap();
2335
+ return String(interpolate(vars[activeBaseUrlKey()] || defaultBaseUrl, vars) || defaultBaseUrl).replace(/\/$/, "");
2336
+ };
1834
2337
 
1835
2338
  const envLabel = () => store.activeEnv + " · " + store.activeGroup;
1836
2339
 
@@ -1838,14 +2341,14 @@
1838
2341
  const trigger = document.getElementById("env-trigger");
1839
2342
  if (!trigger) return;
1840
2343
  trigger.textContent = envLabel();
1841
- const base = varMap().baseUrl || "";
2344
+ const base = varMap()[activeBaseUrlKey()] || "";
1842
2345
  trigger.title = base ? store.activeEnv + " · " + base + " · " + store.activeGroup : envLabel();
1843
2346
  };
1844
2347
 
1845
2348
  const presetBaseUrl = (name) => {
1846
2349
  const env = store.envs[name];
1847
2350
  if (!env) return "";
1848
- const row = (env.variables || []).find((entry) => entry.key === "baseUrl");
2351
+ const row = (env.variables || []).find((entry) => entry.key === baseUrlKeyOf(env));
1849
2352
  return row ? String(row.value || "") : "";
1850
2353
  };
1851
2354
 
@@ -1884,7 +2387,7 @@
1884
2387
  <button type="button" class="ghost-btn" id="dup-env" title="Duplicate preset">⧉</button>
1885
2388
  <button type="button" class="ghost-btn" id="remove-env" title="Remove preset" ${canRemoveEnv ? "" : "disabled"}>×</button>
1886
2389
  </div>
1887
- <div class="env-base-line"><span>baseUrl</span> · ${escapeAttr(activeBase)}</div>
2390
+ <div class="env-base-line"><span>${escapeAttr(baseUrlKeyOf(env))}</span> · ${escapeAttr(activeBase)}</div>
1888
2391
  ${
1889
2392
  quickPresets.length
1890
2393
  ? `<div class="env-quick">${quickPresets
@@ -1900,10 +2403,10 @@
1900
2403
  <div class="env-label">Variables</div>
1901
2404
  ${(env.variables || [])
1902
2405
  .map(
1903
- (row, index) => `<div class="env-kv ${row.key === "baseUrl" ? "base-url" : ""}" data-var="${index}">
1904
- <input class="env-cell" data-field="key" spellcheck="false" value="${escapeAttr(row.key)}" ${row.key === "baseUrl" ? "readonly" : ""} />
2406
+ (row, index) => `<div class="env-kv ${row.key === baseUrlKeyOf(env) ? "base-url" : ""}" data-var="${index}">
2407
+ <input class="env-cell" data-field="key" spellcheck="false" value="${escapeAttr(row.key)}" title="${row.key === baseUrlKeyOf(env) ? "Base URL variable — rename it to match your Postman collection" : escapeAttr(row.key)}" />
1905
2408
  <input class="env-cell" data-field="value" spellcheck="false" value="${escapeAttr(row.value)}" />
1906
- <button type="button" class="ghost-btn" data-remove-var="${index}" ${row.key === "baseUrl" ? "disabled" : ""}>×</button>
2409
+ <button type="button" class="ghost-btn" data-remove-var="${index}" ${row.key === baseUrlKeyOf(env) ? "disabled" : ""}>×</button>
1907
2410
  </div>`,
1908
2411
  )
1909
2412
  .join("")}
@@ -2034,11 +2537,19 @@
2034
2537
  input.oninput = () => {
2035
2538
  const index = Number(row.dataset.var);
2036
2539
  const field = input.dataset.field;
2037
- if (!activeEnvConfig().variables[index] || (field !== "key" && field !== "value")) return;
2038
- activeEnvConfig().variables[index][field] = input.value;
2540
+ const env = activeEnvConfig();
2541
+ if (!env.variables[index] || (field !== "key" && field !== "value")) return;
2542
+ const wasBaseUrl = env.variables[index].key === baseUrlKeyOf(env);
2543
+ env.variables[index][field] = input.value;
2544
+ // Renaming the base URL row (e.g. to ONBOARDING_SERVICE) retargets the whole env.
2545
+ if (field === "key" && wasBaseUrl) {
2546
+ env.baseUrlKey = input.value.trim() || DEFAULT_BASE_URL_KEY;
2547
+ const label = document.querySelector(".env-base-line span");
2548
+ if (label) label.textContent = env.baseUrlKey;
2549
+ }
2039
2550
  persistStore();
2040
2551
  syncEnvTrigger();
2041
- if (field === "value" && activeEnvConfig().variables[index].key === "baseUrl") renderMain();
2552
+ if (wasBaseUrl) renderMain();
2042
2553
  };
2043
2554
  input.onchange = () => renderMain();
2044
2555
  });
@@ -2092,7 +2603,36 @@
2092
2603
 
2093
2604
  document.title = title || "API Documentation";
2094
2605
  const brandEl = document.getElementById("brand");
2095
- if (brandEl) brandEl.textContent = title;
2606
+ if (brandEl) brandEl.textContent = (title || "DAxTA") + " API Document";
2607
+ const applyTheme = (mode) => {
2608
+ const next = mode === "light" ? "light" : "dark";
2609
+ document.documentElement.setAttribute("data-theme", next);
2610
+ localStorage.setItem("daxta-theme", next);
2611
+ const fav = document.getElementById("favicon");
2612
+ if (fav) fav.setAttribute("href", next === "light" ? "__FAVICON_DATA_URI__" : "__FAVICON_LIGHT_DATA_URI__");
2613
+ const themeLabel = document.getElementById("theme-label");
2614
+ if (themeLabel) themeLabel.textContent = next === "light" ? "Light" : "Dark";
2615
+ };
2616
+ applyTheme(localStorage.getItem("daxta-theme") || "dark");
2617
+ const shortcutPalette = document.getElementById("shortcut-palette");
2618
+ if (shortcutPalette) shortcutPalette.textContent = /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘K" : "Ctrl+K";
2619
+ document.getElementById("theme-toggle")?.addEventListener("click", (event) => {
2620
+ event.stopPropagation();
2621
+ applyTheme(document.documentElement.getAttribute("data-theme") === "dark" ? "light" : "dark");
2622
+ });
2623
+ const moreWrap = document.getElementById("more-wrap");
2624
+ const moreToggle = document.getElementById("more-toggle");
2625
+ const setMoreOpen = (open) => {
2626
+ moreWrap?.classList.toggle("open", open);
2627
+ moreToggle?.setAttribute("aria-expanded", open ? "true" : "false");
2628
+ };
2629
+ moreToggle?.addEventListener("click", (event) => {
2630
+ event.stopPropagation();
2631
+ const next = !moreWrap.classList.contains("open");
2632
+ envWrap.classList.remove("open");
2633
+ setMoreOpen(next);
2634
+ });
2635
+ document.getElementById("more-pop")?.addEventListener("click", (event) => event.stopPropagation());
2096
2636
  const specVersion = (spec.info && spec.info.version) || "";
2097
2637
  const navVersion = document.getElementById("nav-version");
2098
2638
  if (navVersion) navVersion.textContent = specVersion ? (specVersion.startsWith("v") ? specVersion : "v" + specVersion) : "";
@@ -2100,6 +2640,7 @@
2100
2640
  const envWrap = document.getElementById("env-wrap");
2101
2641
  document.getElementById("env-trigger").addEventListener("click", (event) => {
2102
2642
  event.stopPropagation();
2643
+ setMoreOpen(false);
2103
2644
  envWrap.classList.toggle("open");
2104
2645
  if (envWrap.classList.contains("open")) renderEnvPop();
2105
2646
  });
@@ -2324,10 +2865,11 @@
2324
2865
  }));
2325
2866
  // Ensure header template vars referenced as {{x}} appear even if missing from variables list.
2326
2867
  const known = new Set(values.map((row) => row.key));
2327
- if (!known.has("baseUrl")) {
2328
- known.add("baseUrl");
2868
+ const baseKey = baseUrlKeyOf(env);
2869
+ if (!known.has(baseKey)) {
2870
+ known.add(baseKey);
2329
2871
  values.unshift({
2330
- key: "baseUrl",
2872
+ key: baseKey,
2331
2873
  value: String(presetBaseUrl(store.activeEnv) || defaultBaseUrl || ""),
2332
2874
  type: "default",
2333
2875
  enabled: true,
@@ -2429,11 +2971,13 @@
2429
2971
 
2430
2972
  /**
2431
2973
  * Postman Collection v2.1 — nested folders + named examples.
2432
- * When includeTryIt, requests use {{baseUrl}} and the active header group; env file is downloaded separately.
2974
+ * When includeTryIt, requests use the env's base URL variable and the active header group;
2975
+ * the env file is downloaded separately.
2433
2976
  */
2434
2977
  const buildPostmanCollection = (openapi, includeTryIt) => {
2435
- const specServer = (openapi.servers && openapi.servers[0] && openapi.servers[0].url) || "{{baseUrl}}";
2436
- const serverUrl = includeTryIt ? "{{baseUrl}}" : specServer;
2978
+ const baseVar = "{{" + activeBaseUrlKey() + "}}";
2979
+ const specServer = (openapi.servers && openapi.servers[0] && openapi.servers[0].url) || baseVar;
2980
+ const serverUrl = includeTryIt ? baseVar : specServer;
2437
2981
  const root = [];
2438
2982
 
2439
2983
  for (const [urlPath, pathItem] of Object.entries(openapi.paths || {})) {
@@ -2525,41 +3069,232 @@
2525
3069
  };
2526
3070
  };
2527
3071
 
3072
+ /** Keeps tab order and screen readers inside the dialog while it is open. */
3073
+ const setBackgroundInert = (inert) => {
3074
+ for (const node of document.body.children) {
3075
+ if (node.id === "export-backdrop") continue;
3076
+ if (inert) node.setAttribute("inert", "");
3077
+ else node.removeAttribute("inert");
3078
+ }
3079
+ };
3080
+
2528
3081
  const closeExportModal = () => {
2529
3082
  document.body.classList.remove("exporting");
3083
+ setBackgroundInert(false);
2530
3084
  };
2531
3085
 
2532
3086
  const syncExportTryItUi = () => {
2533
3087
  const meta = document.getElementById("export-tryit-meta");
2534
3088
  if (meta) meta.textContent = store.activeEnv + " · " + store.activeGroup;
3089
+ const baseVar = document.getElementById("export-base-var");
3090
+ if (baseVar) baseVar.textContent = "{{" + activeBaseUrlKey() + "}}";
3091
+ };
3092
+
3093
+ /** Scenario names double as example summaries, so they carry the case section. */
3094
+ const exampleSectionLookup = (item) => {
3095
+ const byName = new Map();
3096
+ for (const scenario of item.scenarios || []) {
3097
+ if (scenario && scenario.name) byName.set(scenario.name, scenario.group || "Other");
3098
+ }
3099
+ return (example) => byName.get(example.summary) || "Other";
3100
+ };
3101
+
3102
+ const groupExamplesBySection = (item, examples) => {
3103
+ const sectionOf = exampleSectionLookup(item);
3104
+ const bySection = new Map();
3105
+ for (const example of examples) {
3106
+ const section = sectionOf(example);
3107
+ if (!bySection.has(section)) bySection.set(section, []);
3108
+ bySection.get(section).push(example);
3109
+ }
3110
+ const order = GROUP_ORDER.filter((name) => bySection.has(name)).concat(
3111
+ [...bySection.keys()].filter((name) => !GROUP_ORDER.includes(name)),
3112
+ );
3113
+ return order.map((section) => ({ section, examples: bySection.get(section) }));
3114
+ };
3115
+
3116
+ const sectionCheckboxes = (section) => [
3117
+ ...document.querySelectorAll(`#export-body .export-group-items input[data-section="${CSS.escape(section)}"]`),
3118
+ ];
3119
+
3120
+ /** Chips mirror what is checked below: filled = all of it, outlined-part = some. */
3121
+ const syncExportSectionChips = () => {
3122
+ document.querySelectorAll("[data-export-section]").forEach((chip) => {
3123
+ const boxes = sectionCheckboxes(chip.dataset.exportSection);
3124
+ const checked = boxes.filter((box) => box.checked).length;
3125
+ chip.classList.toggle("on", boxes.length > 0 && checked === boxes.length);
3126
+ chip.classList.toggle("part", checked > 0 && checked < boxes.length);
3127
+ chip.setAttribute("aria-pressed", checked === boxes.length && boxes.length > 0 ? "true" : "false");
3128
+ });
3129
+ };
3130
+
3131
+ const syncExportGroupChecks = () => {
3132
+ document.querySelectorAll("#export-body .export-group").forEach((group) => {
3133
+ const head = group.querySelector(".export-group-check");
3134
+ const boxes = [...group.querySelectorAll(".export-group-items input[type=checkbox]")];
3135
+ if (!head || !boxes.length) return;
3136
+ const checked = boxes.filter((box) => box.checked).length;
3137
+ head.checked = checked === boxes.length;
3138
+ head.indeterminate = checked > 0 && checked < boxes.length;
3139
+ });
3140
+ syncExportSectionChips();
3141
+ };
3142
+
3143
+ /** Chips sit side by side, so the repeated "cases" tail only adds noise. */
3144
+ const shortGroup = (section) => displayGroup(section).replace(/\s+cases\b/gi, "").trim();
3145
+
3146
+ const renderExportSectionButtons = (sections) => {
3147
+ const host = document.getElementById("export-sections");
3148
+ if (!host) return;
3149
+ const separator = document.getElementById("export-sections-sep");
3150
+ if (separator) separator.hidden = !sections.length;
3151
+ host.innerHTML = sections
3152
+ .map(
3153
+ (section) =>
3154
+ `<button type="button" class="section-chip ${groupTone(section)}" data-export-section="${escapeAttr(section)}" aria-pressed="true" title="${escapeAttr(displayGroup(section))} — click to toggle"><span class="dot"></span>${escapeHtml(shortGroup(section))}</button>`,
3155
+ )
3156
+ .join("");
3157
+ host.querySelectorAll("[data-export-section]").forEach((chip) => {
3158
+ chip.onclick = () => {
3159
+ const boxes = sectionCheckboxes(chip.dataset.exportSection);
3160
+ const next = !boxes.every((box) => box.checked);
3161
+ boxes.forEach((box) => {
3162
+ box.checked = next;
3163
+ });
3164
+ syncExportGroupChecks();
3165
+ };
3166
+ });
3167
+ syncExportSectionChips();
2535
3168
  };
2536
3169
 
2537
3170
  const openExportModal = () => {
2538
3171
  const body = document.getElementById("export-body");
2539
- const blocks = ops
2540
- .map((item) => {
2541
- const examples = listOperationExamples(item.op);
3172
+ const sections = new Set();
3173
+ const exportable = ops
3174
+ .map((item) => ({ item, examples: listOperationExamples(item.op) }))
3175
+ .filter((entry) => entry.examples.length);
3176
+ const examplesById = new Map(exportable.map((entry) => [entry.item.id, entry.examples]));
3177
+
3178
+ const renderOpBlock = (item) => {
3179
+ const examples = examplesById.get(item.id) || [];
2542
3180
  if (!examples.length) return "";
2543
- return `<div class="export-op" data-op="${escapeAttr(item.id)}">
2544
- <div class="export-op-title">
3181
+ const grouped = groupExamplesBySection(item, examples);
3182
+ for (const { section } of grouped) sections.add(section);
3183
+ return `<div class="export-op collapsed" data-op="${escapeAttr(item.id)}">
3184
+ <button type="button" class="export-op-title" aria-expanded="false" title="Show sections">
3185
+ <span class="chev"></span>
2545
3186
  <span class="method ${item.method}">${item.method}</span>
2546
- <span class="path" title="${escapeAttr(item.path)}">${escapeAttr(item.path)}</span>
2547
- </div>
2548
- ${examples
3187
+ <span class="path" title="${escapeAttr(item.path)}">${escapeAttr(item.title)}</span>
3188
+ <span class="export-op-count">${examples.length}</span>
3189
+ </button>
3190
+ <div class="export-op-groups">${grouped
2549
3191
  .map(
2550
- (example) => `<div class="export-ex">
2551
- <input type="checkbox" id="ex-${escapeAttr(item.id)}-${escapeAttr(example.key)}" data-op="${escapeAttr(item.id)}" data-key="${escapeAttr(example.key)}" checked />
2552
- <label for="ex-${escapeAttr(item.id)}-${escapeAttr(example.key)}">${escapeAttr(example.summary)}</label>
3192
+ ({ section, examples: rows }) => `<div class="export-group collapsed">
3193
+ <label class="export-group-head ${groupTone(section)}">
3194
+ <button type="button" class="export-group-toggle" aria-expanded="false" title="Show examples"><span class="chev"></span></button>
3195
+ <input type="checkbox" class="export-group-check" checked />
3196
+ <span>${escapeHtml(displayGroup(section))}</span>
3197
+ <span class="export-group-count">${rows.length}</span>
3198
+ </label>
3199
+ <div class="export-group-items">${rows
3200
+ .map(
3201
+ (example) => `<div class="export-ex">
3202
+ <input type="checkbox" id="ex-${escapeAttr(item.id)}-${escapeAttr(example.key)}" data-op="${escapeAttr(item.id)}" data-key="${escapeAttr(example.key)}" data-section="${escapeAttr(section)}" checked />
3203
+ <label for="ex-${escapeAttr(item.id)}-${escapeAttr(example.key)}">${escapeAttr(example.summary)}</label>
3204
+ </div>`,
3205
+ )
3206
+ .join("")}</div>
2553
3207
  </div>`,
2554
3208
  )
2555
- .join("")}
3209
+ .join("")}</div>
2556
3210
  </div>`;
2557
- })
2558
- .filter(Boolean)
2559
- .join("");
2560
- body.innerHTML = blocks || `<div class="export-empty">No recorded examples yet — export will include schemas only.</div>`;
3211
+ };
3212
+
3213
+ /** Same folder tree as the sidebar, so the export mirrors what the docs show. */
3214
+ const countExamples = (node) =>
3215
+ node.ops.reduce((total, item) => total + (examplesById.get(item.id) || []).length, 0) +
3216
+ Object.values(node.children).reduce((total, child) => total + countExamples(child), 0);
3217
+
3218
+ const renderExportNode = (node) => {
3219
+ const opsHtml = [...node.ops]
3220
+ .sort((left, right) => (METHOD_ORDER[left.method] ?? 99) - (METHOD_ORDER[right.method] ?? 99))
3221
+ .map(renderOpBlock)
3222
+ .join("");
3223
+ const foldersHtml = Object.entries(node.children)
3224
+ .map(([name, child]) => {
3225
+ const total = countExamples(child);
3226
+ if (!total) return "";
3227
+ return `<div class="export-folder collapsed">
3228
+ <button type="button" class="export-folder-head" aria-expanded="false">
3229
+ <span class="chev"></span>
3230
+ <span class="export-folder-name">${escapeHtml(name)}</span>
3231
+ <span class="export-op-count">${total}</span>
3232
+ </button>
3233
+ <div class="export-folder-children">${renderExportNode(child)}</div>
3234
+ </div>`;
3235
+ })
3236
+ .join("");
3237
+ return opsHtml + foldersHtml;
3238
+ };
3239
+
3240
+ const tree = renderExportNode(buildPathTree(exportable.map((entry) => entry.item)));
3241
+ body.innerHTML = tree || `<div class="export-empty">No recorded examples yet — export will include schemas only.</div>`;
3242
+
3243
+ body.querySelectorAll(".export-folder").forEach((folder) => {
3244
+ const toggle = folder.querySelector(".export-folder-head");
3245
+ if (!toggle) return;
3246
+ toggle.onclick = () => {
3247
+ const collapsed = folder.classList.toggle("collapsed");
3248
+ toggle.setAttribute("aria-expanded", collapsed ? "false" : "true");
3249
+ };
3250
+ });
3251
+
3252
+ const ordered = GROUP_ORDER.filter((name) => sections.has(name)).concat(
3253
+ [...sections].filter((name) => !GROUP_ORDER.includes(name)),
3254
+ );
3255
+ renderExportSectionButtons(ordered);
3256
+
3257
+ body.querySelectorAll(".export-op").forEach((block) => {
3258
+ const toggle = block.querySelector(".export-op-title");
3259
+ if (!toggle) return;
3260
+ toggle.onclick = () => {
3261
+ const collapsed = block.classList.toggle("collapsed");
3262
+ toggle.setAttribute("aria-expanded", collapsed ? "false" : "true");
3263
+ toggle.title = collapsed ? "Show sections" : "Hide sections";
3264
+ };
3265
+ });
3266
+
3267
+ body.querySelectorAll(".export-group").forEach((group) => {
3268
+ const head = group.querySelector(".export-group-check");
3269
+ const boxes = [...group.querySelectorAll(".export-group-items input[type=checkbox]")];
3270
+ if (head) {
3271
+ head.onchange = () => {
3272
+ boxes.forEach((box) => {
3273
+ box.checked = head.checked;
3274
+ });
3275
+ head.indeterminate = false;
3276
+ };
3277
+ }
3278
+ boxes.forEach((box) => {
3279
+ box.onchange = syncExportGroupChecks;
3280
+ });
3281
+ const toggle = group.querySelector(".export-group-toggle");
3282
+ if (toggle) {
3283
+ toggle.onclick = (event) => {
3284
+ // Sits inside the <label>, so stop the click from flipping the group checkbox.
3285
+ event.preventDefault();
3286
+ event.stopPropagation();
3287
+ const collapsed = group.classList.toggle("collapsed");
3288
+ toggle.setAttribute("aria-expanded", collapsed ? "false" : "true");
3289
+ toggle.title = collapsed ? "Show examples" : "Hide examples";
3290
+ };
3291
+ }
3292
+ });
3293
+
3294
+ syncExportGroupChecks();
2561
3295
  syncExportTryItUi();
2562
3296
  document.body.classList.add("exporting");
3297
+ setBackgroundInert(true);
2563
3298
  };
2564
3299
 
2565
3300
  const collectSelectedExamples = () => {
@@ -2608,6 +3343,7 @@
2608
3343
 
2609
3344
  document.getElementById("export-openapi").addEventListener("click", (event) => {
2610
3345
  event.stopPropagation();
3346
+ setMoreOpen(false);
2611
3347
  openExportModal();
2612
3348
  });
2613
3349
  document.getElementById("export-cancel").addEventListener("click", closeExportModal);
@@ -2615,22 +3351,18 @@
2615
3351
  if (event.target.id === "export-backdrop") closeExportModal();
2616
3352
  });
2617
3353
  document.getElementById("export-modal").addEventListener("click", (event) => event.stopPropagation());
3354
+ const exampleCheckboxes = () => document.querySelectorAll("#export-body .export-group-items input[type=checkbox]");
2618
3355
  document.getElementById("export-all").addEventListener("click", () => {
2619
- document.querySelectorAll("#export-body input[type=checkbox]").forEach((input) => {
3356
+ exampleCheckboxes().forEach((input) => {
2620
3357
  input.checked = true;
2621
3358
  });
3359
+ syncExportGroupChecks();
2622
3360
  });
2623
3361
  document.getElementById("export-none").addEventListener("click", () => {
2624
- document.querySelectorAll("#export-body input[type=checkbox]").forEach((input) => {
3362
+ exampleCheckboxes().forEach((input) => {
2625
3363
  input.checked = false;
2626
3364
  });
2627
- });
2628
- document.getElementById("export-success").addEventListener("click", () => {
2629
- document.querySelectorAll("#export-body input[type=checkbox]").forEach((input) => {
2630
- const label = document.querySelector(`label[for="${CSS.escape(input.id)}"]`);
2631
- const text = label ? label.textContent || "" : "";
2632
- input.checked = /^2\d\d\b/.test(text.trim());
2633
- });
3365
+ syncExportGroupChecks();
2634
3366
  });
2635
3367
  document.getElementById("export-confirm").addEventListener("click", () => {
2636
3368
  runExportDownload();
@@ -2823,7 +3555,13 @@
2823
3555
  };
2824
3556
 
2825
3557
  const displayGroup = (group) => GROUP_LABEL[group] || group || "Other";
2826
- const groupTone = (label) => (String(label).toLowerCase() === "positive cases" ? "ok" : "err");
3558
+ const groupTone = (group) => {
3559
+ const key = String(group || "").toUpperCase();
3560
+ if (key === "POSITIVE CASES") return "ok";
3561
+ if (key === "INVALID CASES") return "warn";
3562
+ if (key === "OMITTED CASES") return "omit";
3563
+ return "err";
3564
+ };
2827
3565
  const statusOk = (status) => Number(status) >= 200 && Number(status) < 300;
2828
3566
 
2829
3567
  const groupedDropdown = (scenarios, selected) => {
@@ -2849,11 +3587,11 @@
2849
3587
  });
2850
3588
  if (!rows.length) return "";
2851
3589
  const label = displayGroup(group);
2852
- return `<div class="dd-group ${groupTone(label)}"><span>${escapeHtml(label)} (${rows.length})</span></div>` +
3590
+ return `<div class="dd-group ${groupTone(group)}"><span>${escapeHtml(label)} (${rows.length})</span></div>` +
2853
3591
  rows
2854
3592
  .map(
2855
3593
  ({ scenario, index }) =>
2856
- `<button type="button" class="dd-item ${index === selected ? "on" : ""}" data-index="${index}"><span class="st ${statusOk(scenario.status) ? "ok" : "err"}">${escapeHtml(String(scenario.status))}</span><span>${escapeHtml(scenario.name)}</span></button>`,
3594
+ `<button type="button" class="dd-item ${index === selected ? "on" : ""}" data-index="${index}"><span class="st ${statusOk(scenario.status) ? "ok" : "err"}">${escapeHtml(String(scenario.status))}</span><span>${escapeHtml(scenarioClause(scenario))}</span></button>`,
2857
3595
  )
2858
3596
  .join("");
2859
3597
  })
@@ -2873,11 +3611,28 @@
2873
3611
  let activeVersion = apiVersions[0] || "";
2874
3612
  const expandedFolders = new Set(apiVersions.map((version) => "/" + version));
2875
3613
  const expandedExampleOps = new Set();
3614
+ /** `${opId}::${group}` entries the user opened; groups start collapsed. */
3615
+ const expandedExampleGroups = new Set();
3616
+ const exampleGroupKey = (opId, group) => `${opId}::${group}`;
3617
+ const isExampleGroupCollapsed = (opId, group) => !expandedExampleGroups.has(exampleGroupKey(opId, group));
2876
3618
 
2877
3619
  const scenarioNavLabel = (scenario) => {
3620
+ const name = scenario.name || "example";
2878
3621
  const status = scenario.status != null ? String(scenario.status) : "";
3622
+ if (status && !name.startsWith(`${status} `) && !name.startsWith(`${status} —`)) {
3623
+ return `${status} — ${name}`;
3624
+ }
3625
+ return name;
3626
+ };
3627
+ const scenarioClause = (scenario) => {
2879
3628
  const name = scenario.name || "example";
2880
- return status ? status + " " + name : name;
3629
+ const status = scenario.status != null ? String(scenario.status) : "";
3630
+ const dashed = `${status} — `;
3631
+ if (status && name.startsWith(dashed)) return name.slice(dashed.length);
3632
+ const spaced = `${status} `;
3633
+ if (status && name.startsWith(spaced)) return name.slice(spaced.length).trim();
3634
+ if (status && name.startsWith(`${status} `)) return name.slice(status.length).trim();
3635
+ return name;
2881
3636
  };
2882
3637
 
2883
3638
  const renderNavExamples = (item) => {
@@ -3032,6 +3787,18 @@
3032
3787
  renderNav();
3033
3788
  };
3034
3789
  });
3790
+ nav.querySelectorAll(".nav-ex-group-label").forEach((button) => {
3791
+ button.onclick = (event) => {
3792
+ event.stopPropagation();
3793
+ const key = exampleGroupKey(button.dataset.groupOp, button.dataset.groupName);
3794
+ const collapsed = expandedExampleGroups.has(key);
3795
+ if (collapsed) expandedExampleGroups.delete(key);
3796
+ else expandedExampleGroups.add(key);
3797
+ const group = button.closest(".nav-ex-group");
3798
+ if (group) group.classList.toggle("collapsed", collapsed);
3799
+ button.setAttribute("aria-expanded", collapsed ? "false" : "true");
3800
+ };
3801
+ });
3035
3802
  nav.querySelectorAll(".nav-example").forEach((button) => {
3036
3803
  button.onclick = (event) => {
3037
3804
  event.stopPropagation();
@@ -3082,14 +3849,45 @@
3082
3849
 
3083
3850
  let searchActiveIndex = 0;
3084
3851
 
3852
+ const bindSearchHits = (panel, query) => {
3853
+ panel.querySelectorAll(".search-hit").forEach((button) => {
3854
+ button.onclick = (event) => {
3855
+ event.stopPropagation();
3856
+ select(button.dataset.id);
3857
+ closeSearch({ clear: true });
3858
+ };
3859
+ });
3860
+ };
3861
+
3862
+ const searchHitsHtml = (query) => {
3863
+ const q = query.trim().toLowerCase();
3864
+ const matches = q
3865
+ ? ops.filter((item) => (item.method + " " + item.path + " " + item.title).toLowerCase().includes(q))
3866
+ : ops;
3867
+ if (!matches.length) return { html: `<div class="search-empty">No matching endpoints</div>`, count: 0 };
3868
+ if (searchActiveIndex >= matches.length) searchActiveIndex = 0;
3869
+ const html = matches
3870
+ .map(
3871
+ (item, index) => `<button type="button" class="search-hit ${index === searchActiveIndex ? "active" : ""}" data-id="${item.id}" role="option">
3872
+ <span class="method ${item.method}">${item.method}</span>
3873
+ <span class="search-hit-path">${q ? highlightMatch(item.path, q) : escapeHtml(item.path)}</span>
3874
+ </button>`,
3875
+ )
3876
+ .join("");
3877
+ return { html, count: matches.length };
3878
+ };
3879
+
3085
3880
  const closeSearch = ({ clear = false } = {}) => {
3086
3881
  const wrap = document.getElementById("search-wrap");
3087
3882
  const input = document.getElementById("search");
3088
3883
  wrap.classList.remove("open");
3089
3884
  document.body.classList.remove("searching");
3885
+ document.body.classList.remove("search-palette");
3090
3886
  searchActiveIndex = 0;
3091
3887
  if (clear) {
3092
3888
  input.value = "";
3889
+ const paletteInput = document.getElementById("search-palette-input");
3890
+ if (paletteInput) paletteInput.value = "";
3093
3891
  navQuery = "";
3094
3892
  renderNav();
3095
3893
  }
@@ -3098,6 +3896,24 @@
3098
3896
  const openSearch = () => {
3099
3897
  document.getElementById("search-wrap").classList.add("open");
3100
3898
  document.body.classList.add("searching");
3899
+ document.body.classList.remove("search-palette");
3900
+ };
3901
+
3902
+ const openPalette = () => {
3903
+ closeSearch({ clear: false });
3904
+ document.body.classList.add("search-palette");
3905
+ searchActiveIndex = 0;
3906
+ const paletteInput = document.getElementById("search-palette-input");
3907
+ renderPalettePanel(paletteInput.value);
3908
+ paletteInput.focus();
3909
+ paletteInput.select();
3910
+ };
3911
+
3912
+ const renderPalettePanel = (query = "") => {
3913
+ const panel = document.getElementById("search-palette-panel");
3914
+ const { html } = searchHitsHtml(query);
3915
+ panel.innerHTML = html;
3916
+ bindSearchHits(panel, query);
3101
3917
  };
3102
3918
 
3103
3919
  const renderSearchPanel = (query = "") => {
@@ -3111,27 +3927,9 @@
3111
3927
  return;
3112
3928
  }
3113
3929
  openSearch();
3114
- const matches = ops.filter((item) => (item.method + " " + item.path + " " + item.title).toLowerCase().includes(q));
3115
- if (!matches.length) {
3116
- panel.innerHTML = `<div class="search-empty">No matching endpoints</div>`;
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
- });
3930
+ const { html } = searchHitsHtml(query);
3931
+ panel.innerHTML = html;
3932
+ bindSearchHits(panel, query);
3135
3933
  };
3136
3934
 
3137
3935
  const jsonBlock = (value, pretty) => {
@@ -3186,18 +3984,24 @@
3186
3984
 
3187
3985
  const schemaRows = (fields, { showLoc = false } = {}) => {
3188
3986
  if (!fields.length) return `<div class="meta-empty">—</div>`;
3189
- return fields
3987
+ return `<div class="schema-rows">${fields
3190
3988
  .map((field) => {
3191
3989
  const depth = fieldDepth(field.name);
3192
3990
  const nestClass = depth ? " nested" : "";
3193
3991
  const depthAttr = depth ? ` data-depth="${Math.min(depth, 4)}"` : "";
3992
+ const flag =
3993
+ field.required === true
3994
+ ? `<div class="flag req">required</div>`
3995
+ : field.required === false
3996
+ ? `<div class="flag">optional</div>`
3997
+ : `<div class="flag"></div>`;
3194
3998
  return `<div class="row">
3195
3999
  <div class="name${nestClass}"${depthAttr}>${escapeHtml(field.name)}</div>
3196
4000
  <div class="type">${escapeHtml(field.type)}${showLoc && field.in && field.in !== "body" ? " · " + escapeHtml(field.in) : ""}</div>
3197
- ${field.required === true ? `<div class="flag req">required</div>` : field.required === false ? `<div class="flag">optional</div>` : `<div></div>`}
4001
+ ${flag}
3198
4002
  </div>`;
3199
4003
  })
3200
- .join("");
4004
+ .join("")}</div>`;
3201
4005
  };
3202
4006
 
3203
4007
  const schemasInline = (fields, resBody) => {
@@ -3262,7 +4066,13 @@
3262
4066
 
3263
4067
  const schemas = schemasInline(fields, displayEmpty ? undefined : displayBody);
3264
4068
  const epName = document.getElementById("ep-name");
3265
- if (epName) epName.textContent = item.title;
4069
+ if (epName) {
4070
+ const exampleLabel = scenario.name ? scenarioClause(scenario) : "";
4071
+ epName.innerHTML = exampleLabel
4072
+ ? `<span class="ep-status ${recordedOk ? "" : "err"}">${escapeHtml(String(scenario.status))}</span>` +
4073
+ `<span class="ep-label" title="${escapeAttr(exampleLabel)}">${escapeHtml(exampleLabel)}</span>`
4074
+ : `<span class="ep-label" title="${escapeAttr(item.title)}">${escapeHtml(item.title)}</span>`;
4075
+ }
3266
4076
  document.title = item.title + (title ? " · " + title : "");
3267
4077
 
3268
4078
  document.getElementById("main").innerHTML = `
@@ -3417,6 +4227,8 @@
3417
4227
  const version = treePathSegments(selected)[0];
3418
4228
  if (version) activeVersion = version;
3419
4229
  expandedExampleOps.add(id);
4230
+ const scenario = (selected.scenarios || [])[scenarioIndex];
4231
+ if (scenario) expandedExampleGroups.add(exampleGroupKey(id, scenario.group || "Other"));
3420
4232
  }
3421
4233
  renderPrefixBar();
3422
4234
  renderNav();
@@ -3425,29 +4237,29 @@
3425
4237
  };
3426
4238
 
3427
4239
  const searchInput = document.getElementById("search");
3428
- searchInput.addEventListener("input", (event) => {
3429
- searchActiveIndex = 0;
3430
- renderSearchPanel(event.target.value);
3431
- });
3432
- searchInput.addEventListener("keydown", (event) => {
3433
- const panel = document.getElementById("search-panel");
4240
+ const paletteInput = document.getElementById("search-palette-input");
4241
+
4242
+ const handleSearchKeys = (event, input, panelId) => {
4243
+ const panel = document.getElementById(panelId);
3434
4244
  const hits = [...panel.querySelectorAll(".search-hit")];
3435
4245
  if (event.key === "Escape") {
3436
4246
  closeSearch({ clear: true });
3437
- searchInput.blur();
4247
+ input.blur();
3438
4248
  return;
3439
4249
  }
3440
4250
  if (!hits.length) return;
3441
4251
  if (event.key === "ArrowDown") {
3442
4252
  event.preventDefault();
3443
4253
  searchActiveIndex = (searchActiveIndex + 1) % hits.length;
3444
- renderSearchPanel(searchInput.value);
3445
- document.querySelectorAll(".search-hit")[searchActiveIndex]?.scrollIntoView({ block: "nearest" });
4254
+ if (panelId === "search-palette-panel") renderPalettePanel(input.value);
4255
+ else renderSearchPanel(input.value);
4256
+ panel.querySelectorAll(".search-hit")[searchActiveIndex]?.scrollIntoView({ block: "nearest" });
3446
4257
  } else if (event.key === "ArrowUp") {
3447
4258
  event.preventDefault();
3448
4259
  searchActiveIndex = (searchActiveIndex - 1 + hits.length) % hits.length;
3449
- renderSearchPanel(searchInput.value);
3450
- document.querySelectorAll(".search-hit")[searchActiveIndex]?.scrollIntoView({ block: "nearest" });
4260
+ if (panelId === "search-palette-panel") renderPalettePanel(input.value);
4261
+ else renderSearchPanel(input.value);
4262
+ panel.querySelectorAll(".search-hit")[searchActiveIndex]?.scrollIntoView({ block: "nearest" });
3451
4263
  } else if (event.key === "Enter") {
3452
4264
  event.preventDefault();
3453
4265
  const target = hits[searchActiveIndex] || hits[0];
@@ -3456,21 +4268,45 @@
3456
4268
  closeSearch({ clear: true });
3457
4269
  }
3458
4270
  }
4271
+ };
4272
+
4273
+ searchInput.addEventListener("input", (event) => {
4274
+ searchActiveIndex = 0;
4275
+ renderSearchPanel(event.target.value);
3459
4276
  });
4277
+ searchInput.addEventListener("keydown", (event) => handleSearchKeys(event, searchInput, "search-panel"));
4278
+ paletteInput.addEventListener("input", (event) => {
4279
+ searchActiveIndex = 0;
4280
+ renderPalettePanel(event.target.value);
4281
+ });
4282
+ paletteInput.addEventListener("keydown", (event) => handleSearchKeys(event, paletteInput, "search-palette-panel"));
3460
4283
  document.getElementById("search-backdrop").addEventListener("click", () => closeSearch({ clear: true }));
4284
+ document.getElementById("search-palette-card").addEventListener("click", (event) => event.stopPropagation());
3461
4285
  document.getElementById("search-wrap").addEventListener("click", (event) => event.stopPropagation());
3462
4286
 
3463
4287
  document.addEventListener("click", () => {
3464
4288
  exampleOpen = false;
3465
4289
  document.querySelectorAll(".dd.open").forEach((el) => el.classList.remove("open"));
3466
4290
  document.getElementById("env-wrap").classList.remove("open");
4291
+ setMoreOpen(false);
3467
4292
  if (document.body.classList.contains("searching")) closeSearch({ clear: true });
3468
4293
  });
3469
4294
 
3470
4295
  document.addEventListener("keydown", (event) => {
3471
4296
  if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
3472
4297
  event.preventDefault();
3473
- document.getElementById("search")?.focus();
4298
+ if (document.body.classList.contains("search-palette")) closeSearch({ clear: true });
4299
+ else openPalette();
4300
+ return;
4301
+ }
4302
+ if (event.key === "Escape" && document.body.classList.contains("search-palette")) {
4303
+ event.preventDefault();
4304
+ closeSearch({ clear: true });
4305
+ return;
4306
+ }
4307
+ if (event.key === "Escape" && moreWrap?.classList.contains("open")) {
4308
+ event.preventDefault();
4309
+ setMoreOpen(false);
3474
4310
  return;
3475
4311
  }
3476
4312
  if (event.key === "/" && !event.metaKey && !event.ctrlKey && !event.altKey) {