@t0.labs/daxta 0.4.20 → 0.4.22

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.
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>DAxTA</title>
6
+ <title>Notary</title>
7
7
  <link rel="icon" type="image/png" 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" />
@@ -11,23 +11,28 @@
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: #e8e8e8;
15
- --sidebar: #f2f2f2;
16
- --nav: #f7f7f7;
17
- --paper: #f4f4f4;
14
+ --canvas: #fafafa;
15
+ --sidebar: #fafafa;
16
+ --nav: #ffffff;
17
+ --paper: #fafafa;
18
18
  --white: #ffffff;
19
- --inset: #f0f0f0;
20
- --hairline: #d6d6d6;
21
- --line: #c3c3c3;
22
- --smoke: #7a7a7a;
23
- --stone: #5c5c5c;
19
+ --inset: #f5f5f5;
20
+ --hairline: #e6e6e6;
21
+ --line: #e6e6e6;
22
+ --smoke: #888888;
23
+ --stone: #666666;
24
24
  --charcoal: #333333;
25
- --obsidian: #171717;
25
+ --obsidian: #111111;
26
+ --accent: #2563eb;
27
+ --ok: #16794c;
28
+ --ok-bg: #e8f6ee;
29
+ --err: #b42318;
30
+ --err-bg: #fbeaea;
26
31
  --sans: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
27
32
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
28
- --radius: 6px;
29
- --ring: 0 0 0 1px #cfcfcf;
30
- --ghost: 0 0 0 1px #cfcfcf;
33
+ --radius: 5px;
34
+ --ring: 0 0 0 1px #e6e6e6;
35
+ --ghost: 0 0 0 1px #e6e6e6;
31
36
  }
32
37
  * { box-sizing: border-box; }
33
38
  html, body { height: 100%; }
@@ -35,17 +40,17 @@
35
40
  margin: 0;
36
41
  background: var(--canvas);
37
42
  color: var(--obsidian);
38
- font: 15px/1.55 var(--sans);
43
+ font: 13px/1.45 var(--sans);
39
44
  }
40
45
  button, input { font: inherit; color: inherit; }
41
46
 
42
47
  .topnav {
43
- height: 56px;
48
+ height: 44px;
44
49
  display: grid;
45
- grid-template-columns: 1fr auto 1fr;
50
+ grid-template-columns: 1fr minmax(240px, 420px) 1fr;
46
51
  align-items: center;
47
52
  gap: 16px;
48
- padding: 0 20px;
53
+ padding: 0 16px;
49
54
  background: var(--nav);
50
55
  border-bottom: 1px solid var(--hairline);
51
56
  position: sticky;
@@ -54,26 +59,48 @@
54
59
  }
55
60
  body.searching .topnav { z-index: 30; }
56
61
  .brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; justify-self: start; }
57
- .workspace {
58
- flex: none;
59
- font: 500 11px/1 var(--mono);
60
- letter-spacing: 0.06em;
61
- text-transform: uppercase;
62
- padding: 5px 8px;
63
- border-radius: 9999px;
62
+ .logo-mark {
63
+ width: 20px;
64
+ height: 20px;
65
+ border-radius: 4px;
64
66
  background: var(--obsidian);
65
67
  color: var(--white);
68
+ font: 600 11px/20px var(--sans);
69
+ text-align: center;
70
+ flex: none;
71
+ }
72
+ .logo-name {
73
+ font-size: 13px;
74
+ font-weight: 600;
75
+ letter-spacing: -0.02em;
76
+ }
77
+ .nav-divider {
78
+ width: 1px;
79
+ height: 16px;
80
+ background: var(--hairline);
81
+ flex: none;
82
+ }
83
+ .workspace { display: none; }
84
+ .brand { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--charcoal); }
85
+ .ver-select {
86
+ height: 24px;
87
+ border: 1px solid var(--hairline);
88
+ border-radius: 4px;
89
+ background: var(--white);
90
+ font: 500 11px/1 var(--mono);
91
+ color: var(--obsidian);
92
+ padding: 0 6px;
93
+ cursor: pointer;
66
94
  }
67
- .brand { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
68
95
  .nav-tools { display: flex; align-items: center; gap: 8px; justify-self: end; }
69
96
  .nav-tools .btn {
70
- height: 36px;
71
- padding: 0 12px;
97
+ height: 28px;
98
+ padding: 0 10px;
72
99
  font-size: 12px;
73
100
  }
74
101
  .nav-tools .btn.icon {
75
- width: 36px;
76
- height: 36px;
102
+ width: 28px;
103
+ height: 28px;
77
104
  padding: 0;
78
105
  }
79
106
  .nav-tools .btn.icon svg { width: 16px; height: 16px; }
@@ -103,23 +130,38 @@
103
130
  .search-wrap {
104
131
  justify-self: center;
105
132
  position: relative;
106
- width: min(420px, 46vw);
133
+ width: 100%;
107
134
  z-index: 30;
108
135
  }
109
136
  .search {
110
137
  width: 100%;
111
- height: 36px;
112
- border: 0;
138
+ height: 30px;
139
+ border: 1px solid var(--hairline);
113
140
  border-radius: var(--radius);
114
- box-shadow: var(--ghost);
141
+ box-shadow: none;
115
142
  background: var(--white);
116
- padding: 0 12px;
143
+ padding: 0 56px 0 12px;
144
+ font-size: 13px;
145
+ }
146
+ .search-kbd {
147
+ position: absolute;
148
+ right: 8px;
149
+ top: 50%;
150
+ transform: translateY(-50%);
151
+ font: 500 10px/1 var(--mono);
152
+ color: var(--smoke);
153
+ border: 1px solid var(--hairline);
154
+ border-radius: 4px;
155
+ padding: 3px 5px;
156
+ pointer-events: none;
157
+ background: var(--inset);
117
158
  }
118
159
  .search::placeholder { color: var(--smoke); }
119
160
  .search-wrap.open .search {
120
- box-shadow: 0 0 0 1px var(--obsidian);
161
+ border-color: var(--obsidian);
121
162
  border-radius: var(--radius) var(--radius) 0 0;
122
163
  }
164
+ .search-wrap.open .search-kbd { display: none; }
123
165
  .search-backdrop {
124
166
  display: none;
125
167
  position: fixed;
@@ -139,7 +181,9 @@
139
181
  overflow: auto;
140
182
  background: var(--white);
141
183
  border-radius: 0 0 var(--radius) var(--radius);
142
- box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14), var(--ring);
184
+ box-shadow: none;
185
+ border: 1px solid var(--hairline);
186
+ border-top: 0;
143
187
  z-index: 31;
144
188
  padding: 6px;
145
189
  }
@@ -185,8 +229,8 @@
185
229
  .env-wrap.open .env-pop { display: block; }
186
230
  .env-trigger {
187
231
  flex: none;
188
- width: 220px;
189
- height: 36px;
232
+ width: 180px;
233
+ height: 28px;
190
234
  border: 0;
191
235
  border-radius: var(--radius);
192
236
  box-shadow: var(--ghost);
@@ -223,7 +267,8 @@
223
267
  overflow: auto;
224
268
  background: var(--white);
225
269
  border-radius: var(--radius);
226
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), var(--ring);
270
+ box-shadow: none;
271
+ border: 1px solid var(--hairline);
227
272
  padding: 16px;
228
273
  z-index: 40;
229
274
  }
@@ -331,16 +376,20 @@
331
376
  .app {
332
377
  display: grid;
333
378
  grid-template-columns: var(--sidebar-w, 320px) 6px minmax(0, 1fr);
334
- height: calc(100vh - 56px);
379
+ height: calc(100vh - 44px);
335
380
  }
336
381
  .app.sidebar-collapsed {
337
382
  grid-template-columns: 0 28px minmax(0, 1fr);
338
383
  }
339
- .sidebar, .workbench { height: 100%; overflow: auto; }
384
+ .sidebar, .workbench { height: 100%; }
385
+ .workbench { overflow: auto; }
340
386
  .sidebar {
341
387
  position: relative;
342
388
  min-width: 0;
343
- padding: 16px 12px 48px;
389
+ overflow: hidden;
390
+ padding: 10px 10px 12px;
391
+ display: flex;
392
+ flex-direction: column;
344
393
  background: var(--sidebar);
345
394
  border-right: 0;
346
395
  font-size: 13px;
@@ -351,6 +400,30 @@
351
400
  pointer-events: none;
352
401
  opacity: 0;
353
402
  }
403
+ .nav-filter {
404
+ width: 100%;
405
+ height: 28px;
406
+ border: 1px solid var(--hairline);
407
+ border-radius: var(--radius);
408
+ background: var(--white);
409
+ padding: 0 8px;
410
+ font-size: 12px;
411
+ margin-bottom: 8px;
412
+ flex: none;
413
+ }
414
+ .nav-filter::placeholder { color: var(--smoke); }
415
+ .tree-scroll { flex: 1; min-height: 0; overflow: auto; }
416
+ .nav-foot {
417
+ flex: none;
418
+ margin-top: 10px;
419
+ padding: 8px;
420
+ border: 1px solid var(--hairline);
421
+ border-radius: var(--radius);
422
+ background: var(--white);
423
+ font-size: 11px;
424
+ color: var(--stone);
425
+ line-height: 1.35;
426
+ }
354
427
  .sidebar-resizer {
355
428
  position: relative;
356
429
  z-index: 5;
@@ -358,7 +431,7 @@
358
431
  margin: 0;
359
432
  padding: 0;
360
433
  border: 0;
361
- background: var(--line);
434
+ background: var(--hairline);
362
435
  cursor: col-resize;
363
436
  touch-action: none;
364
437
  }
@@ -461,7 +534,7 @@
461
534
  border: 0;
462
535
  background: transparent;
463
536
  text-align: left;
464
- padding: 7px 8px;
537
+ padding: 5px 8px;
465
538
  border-radius: var(--radius);
466
539
  cursor: pointer;
467
540
  }
@@ -473,103 +546,24 @@
473
546
  border-radius: var(--radius);
474
547
  }
475
548
  .nav-op:hover { background: var(--white); }
476
- .nav-op.active { background: var(--white); box-shadow: var(--ring); }
549
+ .nav-op.active { background: var(--white); box-shadow: 0 0 0 1px var(--hairline); }
477
550
  .nav-op-row {
478
551
  display: flex;
479
552
  align-items: center;
480
553
  gap: 2px;
481
554
  min-width: 0;
482
555
  }
483
- .nav-expand {
484
- flex: none;
485
- width: 28px;
486
- height: 28px;
487
- border: 0;
488
- border-radius: 6px;
489
- background: transparent;
490
- color: var(--stone);
491
- cursor: pointer;
492
- display: inline-flex;
493
- align-items: center;
494
- justify-content: center;
495
- padding: 0;
496
- }
497
- .nav-expand:hover { color: var(--obsidian); background: var(--inset); }
498
- .nav-expand .chev {
499
- width: 6px;
500
- height: 6px;
501
- border-right: 1.5px solid currentColor;
502
- border-bottom: 1.5px solid currentColor;
503
- transform: rotate(-45deg);
504
- transition: transform 0.15s ease;
505
- margin-top: -2px;
506
- }
507
- .nav-op.examples-open > .nav-op-row .nav-expand .chev {
508
- transform: rotate(45deg);
509
- margin-top: 0;
510
- }
511
- .nav-expand:disabled {
512
- opacity: 0.25;
513
- cursor: default;
514
- }
515
- .nav-examples {
516
- display: none;
517
- flex-direction: column;
518
- gap: 6px;
519
- margin: 0 4px 6px 18px;
520
- padding-left: 10px;
521
- border-left: 1px solid var(--hairline);
522
- }
523
- .nav-op.examples-open > .nav-examples { display: flex; }
524
- .nav-ex-group { display: flex; flex-direction: column; gap: 1px; }
525
- .nav-ex-group-label {
526
- display: flex;
527
- align-items: center;
528
- justify-content: space-between;
529
- gap: 8px;
530
- padding: 6px 8px 2px;
531
- font: 600 10px/1.2 var(--mono);
532
- letter-spacing: 0.06em;
533
- text-transform: uppercase;
534
- color: var(--stone);
535
- }
536
- .nav-ex-count,
537
- .nav-ex-total,
538
- .dd-count {
556
+ .nav-ex-total {
539
557
  flex: none;
540
558
  min-width: 16px;
541
- padding: 1px 6px;
542
- border-radius: 9999px;
543
- background: var(--inset);
544
- color: var(--charcoal);
559
+ margin-right: 6px;
560
+ padding: 1px 5px;
561
+ border-radius: 4px;
562
+ background: var(--obsidian);
563
+ color: var(--white);
545
564
  font: 600 10px/1.4 var(--mono);
546
- letter-spacing: 0;
547
- text-transform: none;
548
565
  text-align: center;
549
566
  }
550
- .nav-ex-total {
551
- margin-right: 2px;
552
- background: var(--white);
553
- box-shadow: var(--ghost);
554
- }
555
- .nav-example {
556
- display: block;
557
- width: 100%;
558
- border: 0;
559
- background: transparent;
560
- text-align: left;
561
- padding: 5px 8px;
562
- border-radius: 6px;
563
- cursor: pointer;
564
- font-size: 11px;
565
- line-height: 1.35;
566
- color: var(--stone);
567
- overflow: hidden;
568
- text-overflow: ellipsis;
569
- white-space: nowrap;
570
- }
571
- .nav-example:hover { background: var(--inset); color: var(--charcoal); }
572
- .nav-example.on { color: var(--obsidian); background: var(--inset); }
573
567
  .nav-title {
574
568
  font-size: 12px;
575
569
  color: var(--charcoal);
@@ -578,7 +572,7 @@
578
572
  text-overflow: ellipsis;
579
573
  white-space: nowrap;
580
574
  }
581
- .nav-op.active .nav-title { color: var(--obsidian); }
575
+ .nav-op.active .nav-title { color: var(--obsidian); font-weight: 500; }
582
576
 
583
577
  .export-backdrop {
584
578
  display: none;
@@ -598,8 +592,9 @@
598
592
  display: flex;
599
593
  flex-direction: column;
600
594
  background: var(--white);
601
- border-radius: 12px;
602
- box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16), var(--ring);
595
+ border-radius: var(--radius);
596
+ box-shadow: none;
597
+ border: 1px solid var(--hairline);
603
598
  overflow: hidden;
604
599
  }
605
600
  .export-head {
@@ -704,64 +699,89 @@
704
699
  display: inline-flex;
705
700
  align-items: center;
706
701
  justify-content: center;
707
- min-width: 48px;
708
- height: 22px;
709
- padding: 0 6px;
710
- border-radius: 9999px;
711
- font: 500 11px/1 var(--mono);
712
- letter-spacing: 0.06em;
702
+ min-width: 40px;
703
+ height: 18px;
704
+ padding: 0 5px;
705
+ border-radius: 4px;
706
+ font: 600 10px/1 var(--mono);
707
+ letter-spacing: 0.04em;
713
708
  text-transform: uppercase;
714
- box-shadow: var(--ghost);
715
- background: var(--white);
716
- }
717
- .method.post, .method.put, .method.patch {
709
+ box-shadow: none;
718
710
  background: var(--obsidian);
719
711
  color: var(--white);
720
- box-shadow: none;
721
712
  }
722
- .method.get { background: var(--inset); color: var(--obsidian); }
723
- .method.delete { background: var(--white); color: var(--charcoal); }
713
+ .method.get { background: var(--inset); color: var(--obsidian); border: 1px solid var(--hairline); }
714
+ .method.delete { background: var(--white); color: var(--charcoal); border: 1px solid var(--hairline); }
724
715
 
725
- .workbench { padding: 28px 36px 96px; background: var(--paper); }
726
- .head-row {
716
+ .workbench { padding: 16px 20px 48px; background: var(--paper); }
717
+ .ep-head { margin-bottom: 12px; }
718
+ .ep-head-top {
727
719
  display: flex;
728
720
  align-items: flex-start;
729
721
  justify-content: space-between;
730
- gap: 16px;
731
- margin-bottom: 16px;
722
+ gap: 12px;
723
+ }
724
+ .title { font-size: 24px; letter-spacing: -0.04em; line-height: 1.2; margin: 0; font-weight: 600; min-width: 0; }
725
+ .meta-line {
726
+ display: flex;
727
+ align-items: center;
728
+ gap: 8px;
729
+ color: var(--stone);
730
+ font: 12px/1.4 var(--mono);
731
+ margin: 8px 0 0;
732
+ }
733
+ .open-editor {
734
+ height: 28px;
735
+ font-size: 12px;
732
736
  }
733
- .title { font-size: 28px; letter-spacing: -1px; line-height: 1.15; margin: 0; font-weight: 400; min-width: 0; }
734
- .meta-line { color: var(--stone); font: 12px/1.4 var(--mono); margin: 8px 0 0; }
735
737
 
736
- .dd { position: relative; min-width: min(100%, 420px); }
738
+ .ex-block { margin-bottom: 10px; position: relative; }
739
+ .ex-kicker {
740
+ font: 600 10px/1 var(--mono);
741
+ letter-spacing: 0.08em;
742
+ text-transform: uppercase;
743
+ color: var(--stone);
744
+ margin-bottom: 6px;
745
+ }
746
+ .dd { position: relative; width: 100%; }
737
747
  .dd-toggle {
738
748
  width: 100%;
739
- min-height: 40px;
740
- border: 0;
749
+ min-height: 36px;
750
+ border: 1px solid var(--hairline);
741
751
  border-radius: var(--radius);
742
- box-shadow: var(--ghost);
752
+ box-shadow: none;
743
753
  background: var(--white);
744
- padding: 8px 36px 8px 12px;
754
+ padding: 8px 32px 8px 10px;
745
755
  text-align: left;
746
756
  cursor: pointer;
747
- font-size: 14px;
748
- line-height: 1.4;
757
+ font-size: 13px;
758
+ line-height: 1.35;
749
759
  position: relative;
750
760
  display: flex;
751
761
  align-items: center;
752
- gap: 8px;
762
+ gap: 10px;
763
+ }
764
+ .dd-status {
765
+ font: 600 11px/1 var(--mono);
766
+ min-width: 28px;
767
+ }
768
+ .dd-status.ok { color: var(--ok); }
769
+ .dd-status.err { color: var(--err); }
770
+ .dd-kind {
771
+ color: var(--stone);
772
+ font-size: 12px;
753
773
  }
754
774
  .dd-toggle .dd-toggle-label {
755
775
  min-width: 0;
756
776
  overflow: hidden;
757
777
  text-overflow: ellipsis;
758
778
  white-space: nowrap;
779
+ flex: 1;
759
780
  }
760
- .dd-toggle .dd-count { margin-left: auto; margin-right: 4px; }
761
781
  .dd-toggle::after {
762
782
  content: "";
763
783
  position: absolute;
764
- right: 14px;
784
+ right: 12px;
765
785
  top: 50%;
766
786
  width: 6px;
767
787
  height: 6px;
@@ -777,72 +797,105 @@
777
797
  top: calc(100% + 4px);
778
798
  left: 0;
779
799
  right: 0;
780
- max-height: 320px;
781
- overflow: auto;
800
+ max-height: 420px;
801
+ overflow: hidden;
782
802
  background: var(--white);
783
803
  border-radius: var(--radius);
784
- box-shadow: var(--ring);
785
- padding: 6px 0;
804
+ border: 1px solid var(--hairline);
805
+ box-shadow: none;
806
+ padding: 0;
807
+ }
808
+ .dd.open .dd-menu { display: flex; flex-direction: column; }
809
+ .dd-search {
810
+ height: 32px;
811
+ margin: 8px 8px 4px;
812
+ border: 1px solid var(--hairline);
813
+ border-radius: 4px;
814
+ padding: 0 8px;
815
+ font-size: 12px;
816
+ background: var(--white);
786
817
  }
787
- .dd.open .dd-menu { display: block; }
818
+ .dd-list { overflow: auto; padding: 4px 0 8px; }
788
819
  .dd-group {
789
820
  display: flex;
790
821
  align-items: center;
791
822
  justify-content: space-between;
792
823
  gap: 8px;
793
824
  font-family: var(--mono);
794
- font-size: 11px;
825
+ font-size: 10px;
795
826
  letter-spacing: 0.08em;
796
827
  text-transform: uppercase;
797
828
  color: var(--stone);
798
- padding: 10px 12px 6px;
829
+ padding: 10px 12px 4px;
799
830
  }
800
- .dd-group .dd-count {
801
- background: var(--paper, var(--inset));
831
+ .dd-group.ok { color: var(--ok); }
832
+ .dd-group.err { color: var(--err); }
833
+ .dd-count {
834
+ font: 600 10px/1.4 var(--mono);
835
+ color: var(--stone);
836
+ letter-spacing: 0;
837
+ text-transform: none;
802
838
  }
803
839
  .dd-item {
804
- display: block;
840
+ display: flex;
841
+ align-items: center;
842
+ gap: 10px;
805
843
  width: 100%;
806
844
  border: 0;
807
845
  background: transparent;
808
846
  text-align: left;
809
- padding: 8px 12px;
810
- font-size: 14px;
847
+ padding: 6px 12px;
848
+ font-size: 13px;
811
849
  cursor: pointer;
812
850
  }
813
851
  .dd-item:hover, .dd-item.on { background: var(--inset); }
852
+ .dd-item .st {
853
+ font: 600 11px/1 var(--mono);
854
+ width: 28px;
855
+ flex: none;
856
+ }
857
+ .dd-item .st.ok { color: var(--ok); }
858
+ .dd-item .st.err { color: var(--err); }
814
859
 
815
860
  .urlbar {
816
861
  display: flex;
817
862
  gap: 8px;
818
863
  align-items: stretch;
819
- margin-bottom: 16px;
864
+ margin-bottom: 12px;
820
865
  }
821
866
  .url {
822
867
  flex: 1;
823
868
  min-width: 0;
824
869
  display: flex;
825
870
  align-items: center;
826
- gap: 12px;
871
+ gap: 10px;
827
872
  background: var(--white);
828
873
  border-radius: var(--radius);
829
- box-shadow: var(--ring);
830
- padding: 10px 14px;
874
+ border: 1px solid var(--hairline);
875
+ box-shadow: none;
876
+ padding: 0 10px;
877
+ height: 36px;
831
878
  font-family: var(--mono);
832
- font-size: 13px;
833
- word-break: break-all;
879
+ font-size: 12px;
880
+ overflow: hidden;
881
+ }
882
+ .url span:last-child {
883
+ overflow: hidden;
884
+ text-overflow: ellipsis;
885
+ white-space: nowrap;
834
886
  }
835
887
  .url .method { flex: none; }
836
888
  .btn {
837
- border: 0;
889
+ border: 1px solid var(--hairline);
838
890
  background: var(--white);
839
- box-shadow: var(--ghost);
891
+ box-shadow: none;
840
892
  border-radius: var(--radius);
841
- padding: 0 14px;
842
- height: 44px;
893
+ padding: 0 12px;
894
+ height: 36px;
843
895
  cursor: pointer;
844
896
  color: var(--charcoal);
845
897
  white-space: nowrap;
898
+ font-size: 12px;
846
899
  }
847
900
  .btn:hover { color: var(--obsidian); }
848
901
  .btn.sm { height: 32px; padding: 0 10px; font-size: 12px; }
@@ -883,14 +936,15 @@
883
936
  .pair {
884
937
  display: grid;
885
938
  grid-template-columns: 1fr 1fr;
886
- gap: 16px;
887
- margin-bottom: 24px;
939
+ gap: 12px;
940
+ margin-bottom: 20px;
888
941
  align-items: start;
889
942
  }
890
943
  .card {
891
944
  background: var(--white);
892
945
  border-radius: var(--radius);
893
- box-shadow: var(--ring);
946
+ border: 1px solid var(--hairline);
947
+ box-shadow: none;
894
948
  min-width: 0;
895
949
  display: flex;
896
950
  flex-direction: column;
@@ -904,12 +958,34 @@
904
958
  align-items: center;
905
959
  justify-content: space-between;
906
960
  gap: 12px;
907
- padding: 14px 16px;
961
+ padding: 10px 12px;
908
962
  border-bottom: 1px solid var(--hairline);
909
963
  flex: none;
910
964
  }
911
- .card-head h2 { margin: 0; font-size: 14px; font-weight: 500; }
965
+ .card-head h2 {
966
+ margin: 0;
967
+ font-size: 11px;
968
+ font-weight: 600;
969
+ letter-spacing: 0.08em;
970
+ text-transform: uppercase;
971
+ }
912
972
  .card-head-actions { display: flex; align-items: center; gap: 8px; }
973
+ .mode-toggle {
974
+ display: flex;
975
+ border: 1px solid var(--hairline);
976
+ border-radius: 4px;
977
+ overflow: hidden;
978
+ }
979
+ .mode-toggle button {
980
+ height: 24px;
981
+ padding: 0 8px;
982
+ border: 0;
983
+ background: var(--white);
984
+ font-size: 11px;
985
+ cursor: pointer;
986
+ color: var(--stone);
987
+ }
988
+ .mode-toggle button.on { background: var(--obsidian); color: var(--white); }
913
989
  .card-body {
914
990
  padding: 0;
915
991
  display: flex;
@@ -923,7 +999,7 @@
923
999
  max-height: none;
924
1000
  }
925
1001
  .meta-block {
926
- padding: 14px 16px;
1002
+ padding: 10px 12px;
927
1003
  border-top: 1px solid var(--hairline);
928
1004
  }
929
1005
  .meta-block:first-child { border-top: 0; }
@@ -932,10 +1008,10 @@
932
1008
  align-items: center;
933
1009
  justify-content: space-between;
934
1010
  gap: 8px;
935
- margin-bottom: 10px;
1011
+ margin-bottom: 8px;
936
1012
  }
937
1013
  .meta-label {
938
- font: 600 11px/1 var(--mono);
1014
+ font: 600 10px/1 var(--mono);
939
1015
  letter-spacing: 0.08em;
940
1016
  text-transform: uppercase;
941
1017
  color: var(--obsidian);
@@ -946,18 +1022,18 @@
946
1022
  display: flex;
947
1023
  align-items: center;
948
1024
  gap: 12px;
949
- margin-bottom: 8px;
950
- font-size: 13px;
1025
+ margin-bottom: 6px;
1026
+ font-size: 12px;
951
1027
  min-width: 0;
952
1028
  }
953
1029
  .kv:last-child { margin-bottom: 0; }
954
1030
  .kname {
955
1031
  flex: none;
956
- width: 120px;
1032
+ width: 110px;
957
1033
  color: var(--stone);
958
1034
  font-family: var(--mono);
959
1035
  font-size: 11px;
960
- letter-spacing: 0.04em;
1036
+ letter-spacing: 0.02em;
961
1037
  white-space: nowrap;
962
1038
  overflow: hidden;
963
1039
  text-overflow: ellipsis;
@@ -968,59 +1044,59 @@
968
1044
  font-family: var(--mono);
969
1045
  font-size: 12px;
970
1046
  color: var(--obsidian);
971
- padding: 8px 10px;
972
- background: var(--inset);
973
- border-radius: var(--radius);
1047
+ padding: 4px 0;
1048
+ background: transparent;
1049
+ border-radius: 0;
974
1050
  white-space: nowrap;
975
1051
  overflow: hidden;
976
1052
  text-overflow: ellipsis;
977
1053
  }
978
1054
  pre {
979
1055
  margin: 0;
980
- padding: 12px;
981
- background: var(--inset);
982
- border-radius: var(--radius);
1056
+ padding: 10px 12px;
1057
+ background: #fcfcfc;
1058
+ border-radius: 0;
983
1059
  overflow: auto;
984
1060
  font: 12px/1.5 var(--mono);
985
1061
  }
986
- .k { color: #1f4e79; }
987
- .s { color: #2e6b2e; }
988
- .n { color: #8a4b12; }
989
- .p { color: #6b3fa0; }
1062
+ .k { color: #111111; }
1063
+ .s { color: #2563eb; }
1064
+ .n { color: #111111; }
1065
+ .p { color: #666666; }
990
1066
  .empty { color: var(--stone); font-size: 13px; padding: 14px 16px; }
991
1067
  .code {
992
- font: 500 12px/1 var(--mono);
993
- padding: 4px 8px;
994
- border-radius: 9999px;
1068
+ font: 600 11px/1 var(--mono);
1069
+ padding: 3px 6px;
1070
+ border-radius: 4px;
995
1071
  background: var(--inset);
996
1072
  }
997
- .code.ok { background: #e5f2e8; color: #297a3a; }
1073
+ .code.ok { background: var(--ok-bg); color: var(--ok); }
1074
+ .code.err { background: var(--err-bg); color: var(--err); }
998
1075
  .code-text { color: var(--stone); font-size: 12px; }
1076
+ .res-meta { display: flex; align-items: center; gap: 10px; color: var(--stone); font: 11px/1 var(--mono); }
999
1077
 
1000
- .fields { margin-top: 16px; }
1001
- .fields > h2 {
1002
- font-size: 14px;
1003
- font-weight: 500;
1004
- margin: 0 0 4px;
1005
- color: var(--obsidian);
1078
+ .schemas {
1079
+ display: grid;
1080
+ grid-template-columns: 1fr 1fr;
1081
+ gap: 24px;
1082
+ padding-top: 8px;
1083
+ border-top: 1px solid var(--hairline);
1006
1084
  }
1007
- .fields-section { padding: 14px 0 2px; }
1008
- .fields-section-title {
1009
- font: 500 11px/1 var(--mono);
1085
+ .schemas h2 {
1086
+ font-size: 11px;
1087
+ font-weight: 600;
1010
1088
  letter-spacing: 0.08em;
1011
1089
  text-transform: uppercase;
1090
+ margin: 0 0 8px;
1012
1091
  color: var(--stone);
1013
- margin-bottom: 8px;
1014
- padding-bottom: 8px;
1015
- border-bottom: 1px solid var(--hairline);
1016
1092
  }
1017
1093
  .row {
1018
1094
  display: grid;
1019
- grid-template-columns: minmax(0, 1.5fr) minmax(72px, 0.55fr) minmax(0, 0.95fr);
1020
- gap: 12px;
1021
- align-items: start;
1022
- padding: 8px 0;
1023
- font-size: 13px;
1095
+ grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) auto;
1096
+ gap: 8px;
1097
+ align-items: baseline;
1098
+ padding: 5px 0;
1099
+ font-size: 12px;
1024
1100
  }
1025
1101
  .row .name {
1026
1102
  font-family: var(--mono);
@@ -1032,8 +1108,8 @@
1032
1108
  }
1033
1109
  .row .name.nested {
1034
1110
  color: var(--charcoal);
1035
- border-left: 2px solid var(--hairline);
1036
- padding-left: 10px;
1111
+ border-left: 1px solid var(--hairline);
1112
+ padding-left: 8px;
1037
1113
  margin-left: 2px;
1038
1114
  }
1039
1115
  .row .name.nested[data-depth="2"] { margin-left: 14px; }
@@ -1043,11 +1119,17 @@
1043
1119
  .row .type {
1044
1120
  color: var(--stone);
1045
1121
  font-family: var(--mono);
1046
- font-size: 12px;
1122
+ font-size: 11px;
1047
1123
  min-width: 0;
1048
1124
  }
1049
- .flag { margin-top: 4px; font-size: 11px; color: var(--smoke); }
1050
- .flag.req { color: #8a2e2e; }
1125
+ .flag { font-size: 11px; color: var(--smoke); }
1126
+ .flag.req { color: var(--err); }
1127
+
1128
+ .work-foot {
1129
+ margin-top: 24px;
1130
+ font-size: 11px;
1131
+ color: var(--smoke);
1132
+ }
1051
1133
 
1052
1134
  @media (max-width: 960px) {
1053
1135
  .app {
@@ -1059,7 +1141,7 @@
1059
1141
  }
1060
1142
  .sidebar { max-height: 40vh; opacity: 1 !important; pointer-events: auto !important; padding: 16px 12px 24px !important; }
1061
1143
  .sidebar-resizer { display: none; }
1062
- .pair { grid-template-columns: 1fr; }
1144
+ .pair, .schemas { grid-template-columns: 1fr; }
1063
1145
  .search-wrap { width: min(280px, 70vw); }
1064
1146
  }
1065
1147
  </style>
@@ -1067,15 +1149,19 @@
1067
1149
  <body>
1068
1150
  <header class="topnav">
1069
1151
  <div class="brand-wrap">
1070
- <span class="workspace" id="workspace">workspace</span>
1071
- <div class="brand" id="brand">API Docs</div>
1152
+ <span class="logo-mark">N</span>
1153
+ <span class="logo-name">Notary</span>
1154
+ <span class="nav-divider"></span>
1155
+ <div class="brand" id="brand">API</div>
1156
+ <select class="ver-select" id="ver-select" aria-label="API version"></select>
1072
1157
  </div>
1073
1158
  <div class="search-wrap" id="search-wrap">
1074
- <input class="search" id="search" placeholder="Search endpoints" autocomplete="off" spellcheck="false" />
1159
+ <input class="search" id="search" placeholder="Search endpoints..." autocomplete="off" spellcheck="false" />
1160
+ <span class="search-kbd">⌘K</span>
1075
1161
  <div class="search-panel" id="search-panel" role="listbox"></div>
1076
1162
  </div>
1077
1163
  <div class="nav-tools">
1078
- <button class="btn icon" id="export-openapi" type="button" data-tip="Export Postman" aria-label="Export Postman">
1164
+ <button class="btn icon" id="export-openapi" type="button" data-tip="Export" aria-label="Export">
1079
1165
  <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>
1080
1166
  </button>
1081
1167
  <div class="env-wrap" id="env-wrap">
@@ -1877,14 +1963,7 @@
1877
1963
  };
1878
1964
  };
1879
1965
 
1880
- document.title = "DAxTA";
1881
- const workspaceEl = document.getElementById("workspace");
1882
- if (workspace) {
1883
- workspaceEl.textContent = workspace;
1884
- workspaceEl.hidden = false;
1885
- } else {
1886
- workspaceEl.hidden = true;
1887
- }
1966
+ document.title = "Notary · " + title;
1888
1967
  document.getElementById("brand").textContent = title;
1889
1968
 
1890
1969
  const envWrap = document.getElementById("env-wrap");
@@ -2429,7 +2508,19 @@
2429
2508
 
2430
2509
  const HTTP = ["get", "post", "put", "patch", "delete"];
2431
2510
  const STATUS = { 200: "OK", 201: "Created", 204: "No Content", 400: "Bad Request", 401: "Unauthorized", 404: "Not Found", 409: "Conflict", 422: "Unprocessable Entity" };
2432
- const GROUP_ORDER = ["Success", "Business errors", "Invalid input", "Missing fields", "Auth", "Other"];
2511
+ const GROUP_ORDER = [
2512
+ "POSITIVE CASES",
2513
+ "SEMANTIC ERROR CASES",
2514
+ "INVALID CASES",
2515
+ "OMITTED CASES",
2516
+ "SEMANTIC ERROR CASES - AUTH",
2517
+ "Success",
2518
+ "Business errors",
2519
+ "Invalid input",
2520
+ "Missing fields",
2521
+ "Auth",
2522
+ "Other",
2523
+ ];
2433
2524
  const METHOD_ORDER = { get: 0, post: 1, put: 2, patch: 3, delete: 4 };
2434
2525
 
2435
2526
  const ops = [];
@@ -2571,15 +2662,17 @@
2571
2662
  if (body !== undefined && item.method !== "get" && item.method !== "head") {
2572
2663
  init.body = typeof body === "string" ? body : JSON.stringify(body);
2573
2664
  }
2665
+ const started = performance.now();
2574
2666
  const response = await fetch(proxyUrl(target), init);
2575
2667
  const text = await response.text();
2668
+ const ms = Math.max(1, Math.round(performance.now() - started));
2576
2669
  let parsed = text;
2577
2670
  try {
2578
2671
  parsed = text ? JSON.parse(text) : undefined;
2579
2672
  } catch {
2580
2673
  parsed = text;
2581
2674
  }
2582
- return { status: response.status, body: parsed, ok: response.ok };
2675
+ return { status: response.status, body: parsed, ok: response.ok, ms, bytes: text.length };
2583
2676
  };
2584
2677
 
2585
2678
  const groupScenarios = (scenarios) => {
@@ -2594,60 +2687,80 @@
2594
2687
  return { groups, order };
2595
2688
  };
2596
2689
 
2690
+ const GROUP_LABEL = {
2691
+ "POSITIVE CASES": "Success",
2692
+ Success: "Success",
2693
+ SUCCESS: "Success",
2694
+ "SEMANTIC ERROR CASES": "Business errors",
2695
+ "Business errors": "Business errors",
2696
+ "INVALID CASES": "Invalid input",
2697
+ "Invalid input": "Invalid input",
2698
+ "OMITTED CASES": "Invalid input",
2699
+ "Missing fields": "Invalid input",
2700
+ "SEMANTIC ERROR CASES - AUTH": "Auth",
2701
+ Auth: "Auth",
2702
+ AUTH: "Auth",
2703
+ Other: "Other",
2704
+ };
2705
+
2706
+ const displayGroup = (group) => (GROUP_LABEL[group] || group || "Other").toUpperCase();
2707
+ const groupTone = (label) => {
2708
+ const upper = String(label).toUpperCase();
2709
+ if (upper.includes("SUCCESS") || upper.includes("POSITIVE")) return "ok";
2710
+ if (upper.includes("ERROR") || upper.includes("INVALID") || upper.includes("AUTH") || upper.includes("BUSINESS")) return "err";
2711
+ return "";
2712
+ };
2713
+ const statusOk = (status) => Number(status) >= 200 && Number(status) < 300;
2714
+
2597
2715
  const groupedDropdown = (scenarios, selected) => {
2598
2716
  const { groups, order } = groupScenarios(scenarios);
2599
2717
  const current = scenarios[selected];
2600
- const total = scenarios.length;
2601
- const label = current
2602
- ? current.group + " · " + current.name
2603
- : "Recorded call";
2604
- return `<div class="dd" id="scenario-dd">
2605
- <button type="button" class="dd-toggle" id="scenario-toggle"><span class="dd-toggle-label">${escapeHtml(label)}</span><span class="dd-count" title="Total examples">${total}</span></button>
2606
- <div class="dd-menu">${order
2607
- .map(
2608
- (group) =>
2609
- `<div class="dd-group"><span>${escapeHtml(group)}</span><span class="dd-count">${groups[group].length}</span></div>` +
2610
- groups[group]
2611
- .map(
2612
- ({ scenario, index }) =>
2613
- `<button type="button" class="dd-item ${index === selected ? "on" : ""}" data-index="${index}">${escapeHtml(String(scenario.status))} — ${escapeHtml(scenario.name)}</button>`,
2614
- )
2615
- .join(""),
2616
- )
2617
- .join("")}</div>
2718
+ const q = exampleQuery.trim().toLowerCase();
2719
+ const kind = current
2720
+ ? displayGroup(current.group)
2721
+ .toLowerCase()
2722
+ .replace(/\b\w/g, (ch) => ch.toUpperCase())
2723
+ : "";
2724
+ const ok = current ? statusOk(current.status) : false;
2725
+ return `<div class="dd ${exampleOpen ? "open" : ""}" id="scenario-dd">
2726
+ <button type="button" class="dd-toggle" id="scenario-toggle">
2727
+ <span class="dd-status ${ok ? "ok" : "err"}">${escapeHtml(String(current?.status ?? ""))}</span>
2728
+ <span class="dd-kind">${escapeHtml(kind)}</span>
2729
+ <span class="dd-toggle-label">${escapeHtml(current?.name || "Example")}</span>
2730
+ </button>
2731
+ <div class="dd-menu">
2732
+ <input class="dd-search" id="example-search" placeholder="Search examples..." value="${escapeAttr(exampleQuery)}" autocomplete="off" spellcheck="false" />
2733
+ <div class="dd-list">${order
2734
+ .map((group) => {
2735
+ const rows = groups[group].filter(({ scenario }) => {
2736
+ if (!q) return true;
2737
+ return (String(scenario.status) + " " + (scenario.name || "") + " " + (scenario.group || "")).toLowerCase().includes(q);
2738
+ });
2739
+ if (!rows.length) return "";
2740
+ const label = displayGroup(group);
2741
+ return `<div class="dd-group ${groupTone(label)}"><span>${escapeHtml(label)} (${rows.length})</span></div>` +
2742
+ rows
2743
+ .map(
2744
+ ({ scenario, index }) =>
2745
+ `<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>`,
2746
+ )
2747
+ .join("");
2748
+ })
2749
+ .join("")}</div>
2750
+ </div>
2618
2751
  </div>`;
2619
2752
  };
2620
2753
 
2621
2754
  let currentId = ops[0]?.id;
2622
2755
  let scenarioIndex = 0;
2756
+ let navQuery = "";
2757
+ let exampleQuery = "";
2758
+ let exampleOpen = false;
2759
+ let jsonMode = { req: "pretty", res: "pretty" };
2623
2760
  const treePathSegments = (item) => item.treeSegments || item.path.split("/").filter(Boolean);
2624
- const expandedFolders = new Set(
2625
- [...new Set(ops.map((item) => treePathSegments(item)[0]).filter(Boolean))].map((version) => "/" + version),
2626
- );
2627
- const expandedExampleOps = new Set();
2628
-
2629
- const scenarioNavLabel = (scenario) => {
2630
- const status = scenario.status != null ? String(scenario.status) : "";
2631
- const name = scenario.name || "example";
2632
- return status ? status + " — " + name : name;
2633
- };
2634
-
2635
- const renderNavExamples = (item) => {
2636
- const { groups, order } = groupScenarios(item.scenarios);
2637
- return `<div class="nav-examples">${order
2638
- .map(
2639
- (group) => `<div class="nav-ex-group">
2640
- <div class="nav-ex-group-label"><span>${escapeHtml(group)}</span><span class="nav-ex-count">${groups[group].length}</span></div>
2641
- ${groups[group]
2642
- .map(
2643
- ({ scenario, index }) =>
2644
- `<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>`,
2645
- )
2646
- .join("")}
2647
- </div>`,
2648
- )
2649
- .join("")}</div>`;
2650
- };
2761
+ const apiVersions = [...new Set(ops.map((item) => treePathSegments(item)[0]).filter(Boolean))];
2762
+ let activeVersion = apiVersions[0] || "";
2763
+ const expandedFolders = new Set(apiVersions.map((version) => "/" + version));
2651
2764
 
2652
2765
  const kv = (label, value) => {
2653
2766
  if (value === undefined || value === "") return "";
@@ -2700,22 +2813,15 @@
2700
2813
  const opsHtml = [...node.ops]
2701
2814
  .sort((left, right) => (METHOD_ORDER[left.method] ?? 99) - (METHOD_ORDER[right.method] ?? 99))
2702
2815
  .map((item) => {
2703
- const hasExamples = Array.isArray(item.scenarios) && item.scenarios.length > 0;
2704
- const examplesOpen = expandedExampleOps.has(item.id);
2705
- const examplesHtml = hasExamples ? renderNavExamples(item) : "";
2706
- const exampleCount = hasExamples ? item.scenarios.length : 0;
2707
- return `<div class="nav-op ${item.id === currentId ? "active" : ""} ${examplesOpen ? "examples-open" : ""}" data-op-id="${escapeAttr(item.id)}">
2816
+ const exampleCount = Array.isArray(item.scenarios) ? item.scenarios.length : 0;
2817
+ return `<div class="nav-op ${item.id === currentId ? "active" : ""}" data-op-id="${escapeAttr(item.id)}">
2708
2818
  <div class="nav-op-row">
2709
2819
  <button type="button" class="nav-item" data-id="${escapeAttr(item.id)}" title="${escapeAttr(item.path)}">
2710
2820
  <span class="method ${item.method}">${item.method}</span>
2711
2821
  <span class="nav-title">${escapeAttr(item.title)}</span>
2712
2822
  </button>
2713
- ${hasExamples ? `<span class="nav-ex-total" title="${exampleCount} examples">${exampleCount}</span>` : ""}
2714
- <button type="button" class="nav-expand" data-expand-id="${escapeAttr(item.id)}" title="Examples" aria-label="Toggle examples" aria-expanded="${examplesOpen ? "true" : "false"}" ${hasExamples ? "" : "disabled"}>
2715
- <span class="chev"></span>
2716
- </button>
2823
+ ${exampleCount ? `<span class="nav-ex-total" title="${exampleCount} examples">${exampleCount}</span>` : ""}
2717
2824
  </div>
2718
- ${examplesHtml}
2719
2825
  </div>`;
2720
2826
  })
2721
2827
  .join("");
@@ -2740,6 +2846,11 @@
2740
2846
  return opsHtml + foldersHtml;
2741
2847
  };
2742
2848
 
2849
+ const visibleOps = () => {
2850
+ if (!activeVersion) return ops;
2851
+ return ops.filter((item) => treePathSegments(item)[0] === activeVersion);
2852
+ };
2853
+
2743
2854
  const renderNav = () => {
2744
2855
  const nav = document.getElementById("nav");
2745
2856
  if (!ops.length) {
@@ -2750,33 +2861,25 @@
2750
2861
  const active = ops.find((item) => item.id === currentId);
2751
2862
  if (active) expandPathToItem(active);
2752
2863
  }
2753
- nav.innerHTML = `<div class="tree-root">${renderTreeNode(buildPathTree(ops), "", "")}</div>`;
2864
+ const q = navQuery.trim().toLowerCase();
2865
+ nav.innerHTML = `
2866
+ <input class="nav-filter" id="nav-filter" placeholder="Search endpoints..." value="${escapeAttr(navQuery)}" autocomplete="off" spellcheck="false" />
2867
+ <div class="tree-scroll"><div class="tree-root">${renderTreeNode(buildPathTree(visibleOps()), "", q)}</div></div>
2868
+ <div class="nav-foot">Generated by Notary</div>
2869
+ `;
2870
+ const filter = document.getElementById("nav-filter");
2871
+ if (filter) {
2872
+ filter.oninput = (event) => {
2873
+ navQuery = event.target.value;
2874
+ renderNav();
2875
+ document.getElementById("nav-filter")?.focus();
2876
+ const el = document.getElementById("nav-filter");
2877
+ if (el) el.selectionStart = el.selectionEnd = el.value.length;
2878
+ };
2879
+ }
2754
2880
  nav.querySelectorAll(".nav-item").forEach((button) => {
2755
2881
  button.onclick = () => select(button.dataset.id);
2756
2882
  });
2757
- nav.querySelectorAll(".nav-expand").forEach((button) => {
2758
- button.onclick = (event) => {
2759
- event.stopPropagation();
2760
- if (button.disabled) return;
2761
- const opId = button.dataset.expandId;
2762
- if (expandedExampleOps.has(opId)) expandedExampleOps.delete(opId);
2763
- else expandedExampleOps.add(opId);
2764
- const wrap = button.closest(".nav-op");
2765
- if (wrap) {
2766
- wrap.classList.toggle("examples-open", expandedExampleOps.has(opId));
2767
- button.setAttribute("aria-expanded", expandedExampleOps.has(opId) ? "true" : "false");
2768
- }
2769
- };
2770
- });
2771
- nav.querySelectorAll(".nav-example").forEach((button) => {
2772
- button.onclick = (event) => {
2773
- event.stopPropagation();
2774
- const opId = button.dataset.id;
2775
- const index = Number(button.dataset.scenario);
2776
- expandedExampleOps.add(opId);
2777
- select(opId, Number.isFinite(index) ? index : 0);
2778
- };
2779
- });
2780
2883
  nav.querySelectorAll(".tree-folder-toggle").forEach((button) => {
2781
2884
  button.onclick = (event) => {
2782
2885
  event.stopPropagation();
@@ -2864,12 +2967,14 @@
2864
2967
  });
2865
2968
  };
2866
2969
 
2867
- const FIELD_SECTIONS = [
2868
- { key: "header", title: "Headers" },
2869
- { key: "path", title: "Path" },
2870
- { key: "query", title: "Query" },
2871
- { key: "body", title: "Body" },
2872
- ];
2970
+ const jsonBlock = (value, pretty) => {
2971
+ if (value === undefined) return `<div class="meta-empty">No JSON body</div>`;
2972
+ if (!pretty) {
2973
+ const raw = typeof value === "string" ? value : JSON.stringify(value);
2974
+ return `<pre>${escapeHtml(raw)}</pre>`;
2975
+ }
2976
+ return `<pre>${highlight(value)}</pre>`;
2977
+ };
2873
2978
 
2874
2979
  const fieldDepth = (name) => {
2875
2980
  const parts = String(name || "")
@@ -2879,43 +2984,74 @@
2879
2984
  return Math.max(0, parts.length - 1);
2880
2985
  };
2881
2986
 
2882
- const rows = (fields) => {
2883
- if (!fields.length) return "";
2987
+ const byteLabel = (bytes) => {
2988
+ if (!bytes) return "";
2989
+ if (bytes < 1024) return bytes + " B";
2990
+ return (bytes / 1024).toFixed(1).replace(/\.0$/, "") + " KB";
2991
+ };
2992
+
2993
+ const schemaFromValue = (value, prefix = "") => {
2994
+ const out = [];
2995
+ const walk = (node, path) => {
2996
+ if (node === null || node === undefined) {
2997
+ if (path) out.push({ name: path, type: "null" });
2998
+ return;
2999
+ }
3000
+ if (Array.isArray(node)) {
3001
+ const inner = node[0];
3002
+ const innerType = inner == null ? "unknown" : Array.isArray(inner) ? "array" : typeof inner === "object" ? "object" : typeof inner;
3003
+ out.push({ name: path, type: "array<" + innerType + ">" });
3004
+ if (inner && typeof inner === "object" && !Array.isArray(inner)) {
3005
+ for (const [key, nested] of Object.entries(inner)) walk(nested, path + "[]." + key);
3006
+ }
3007
+ return;
3008
+ }
3009
+ if (typeof node === "object") {
3010
+ if (path) out.push({ name: path, type: "object" });
3011
+ for (const [key, nested] of Object.entries(node)) walk(nested, path ? path + "." + key : key);
3012
+ return;
3013
+ }
3014
+ out.push({ name: path, type: typeof node === "number" && Number.isInteger(node) ? "integer" : typeof node });
3015
+ };
3016
+ walk(value, prefix);
3017
+ return out;
3018
+ };
3019
+
3020
+ const schemaRows = (fields, { showLoc = false } = {}) => {
3021
+ if (!fields.length) return `<div class="meta-empty">—</div>`;
2884
3022
  return fields
2885
3023
  .map((field) => {
2886
- const depth = field.in === "body" ? fieldDepth(field.name) : 0;
3024
+ const depth = fieldDepth(field.name);
2887
3025
  const nestClass = depth ? " nested" : "";
2888
3026
  const depthAttr = depth ? ` data-depth="${Math.min(depth, 4)}"` : "";
2889
3027
  return `<div class="row">
2890
3028
  <div class="name${nestClass}"${depthAttr}>${escapeHtml(field.name)}</div>
2891
- <div class="loc">${escapeHtml(field.in)}</div>
2892
- <div>
2893
- <div class="type">${escapeHtml(field.type)}</div>
2894
- ${field.required === true ? `<div class="flag req">Required</div>` : field.required === false ? `<div class="flag">Optional</div>` : ""}
2895
- </div>
3029
+ <div class="type">${escapeHtml(field.type)}${showLoc && field.in && field.in !== "body" ? " · " + escapeHtml(field.in) : ""}</div>
3030
+ ${field.required === true ? `<div class="flag req">required</div>` : field.required === false ? `<div class="flag">optional</div>` : `<div></div>`}
2896
3031
  </div>`;
2897
3032
  })
2898
3033
  .join("");
2899
3034
  };
2900
3035
 
2901
- const fieldsPanel = (fields) => {
2902
- if (!fields.length) return "";
2903
- const sections = FIELD_SECTIONS.map(({ key, title }) => {
2904
- const group = fields.filter((field) => field.in === key);
2905
- if (!group.length) return "";
2906
- return `<div class="fields-section">
2907
- <div class="fields-section-title">${title}</div>
2908
- ${rows(group)}
2909
- </div>`;
2910
- }).join("");
2911
- if (!sections) return "";
2912
- return `<section class="fields"><h2>Fields</h2>${sections}</section>`;
3036
+ const schemasPanel = (fields, resBody) => {
3037
+ const requestFields = fields.filter((field) => field.in === "body" || field.in === "path" || field.in === "query" || field.in === "header");
3038
+ const responseFields = schemaFromValue(resBody);
3039
+ return `<div class="schemas">
3040
+ <section>
3041
+ <h2>Request schema</h2>
3042
+ ${schemaRows(requestFields, { showLoc: true })}
3043
+ </section>
3044
+ <section>
3045
+ <h2>Response schema</h2>
3046
+ ${schemaRows(responseFields)}
3047
+ </section>
3048
+ </div>`;
2913
3049
  };
2914
3050
 
2915
3051
  const renderMain = () => {
2916
3052
  const item = ops.find((entry) => entry.id === currentId);
2917
3053
  if (!item) {
2918
- document.getElementById("main").innerHTML = `<div class="empty">No operations in this workspace yet. Run integration tests to generate docs.</div>`;
3054
+ document.getElementById("main").innerHTML = `<div class="empty">No operations in this workspace yet.</div>`;
2919
3055
  return;
2920
3056
  }
2921
3057
  if (scenarioIndex >= item.scenarios.length) scenarioIndex = 0;
@@ -2934,7 +3070,11 @@
2934
3070
  const displayStatusText = STATUS[displayStatus] || (showingLive ? "" : statusText);
2935
3071
  const displayEmpty = showingLive ? displayBody === undefined || displayBody === "" : emptyResponse;
2936
3072
  const resCopyText = displayEmpty ? null : copyBodyText(displayBody);
2937
- const responseTitle = showingLive ? "Live response" : "Recorded response";
3073
+ const reqPretty = jsonMode.req !== "raw";
3074
+ const resPretty = jsonMode.res !== "raw";
3075
+ const recordedBytes = displayEmpty ? 0 : new Blob([typeof displayBody === "string" ? displayBody : JSON.stringify(displayBody)]).size;
3076
+ const bytes = showingLive && liveResult.bytes != null ? liveResult.bytes : recordedBytes;
3077
+ const ms = showingLive && liveResult.ms != null ? liveResult.ms : null;
2938
3078
  const headersHtml = Object.keys(displayHeaders).length
2939
3079
  ? Object.entries(displayHeaders).map(([name, value]) => kv(name, value)).join("")
2940
3080
  : `<div class="meta-empty">No headers in this header group</div>`;
@@ -2946,17 +3086,23 @@
2946
3086
  .join("");
2947
3087
  const bodyHtml =
2948
3088
  scenario.reqBody !== undefined
2949
- ? `<pre>${highlight(scenario.reqBody)}</pre>`
3089
+ ? jsonBlock(scenario.reqBody, reqPretty)
2950
3090
  : `<div class="meta-empty">No JSON body</div>`;
3091
+ const resHtml =
3092
+ showingLive && liveResult.error
3093
+ ? `<div class="live-err">${String(liveResult.error).replace(/&/g, "&amp;").replace(/</g, "&lt;")}</div>`
3094
+ : displayEmpty
3095
+ ? `<div class="empty">Empty body</div>`
3096
+ : jsonBlock(displayBody, resPretty);
2951
3097
 
2952
3098
  document.getElementById("main").innerHTML = `
2953
- <div class="head-row">
2954
- <div>
3099
+ <div class="ep-head">
3100
+ <div class="ep-head-top">
2955
3101
  <h1 class="title">${item.title}</h1>
2956
- <p class="meta-line">${item.method.toUpperCase()} ${item.path}</p>
2957
3102
  </div>
2958
- ${item.scenarios.length ? groupedDropdown(item.scenarios, scenarioIndex) : ""}
3103
+ <p class="meta-line"><span class="method ${item.method}">${item.method}</span><span>${item.path}</span></p>
2959
3104
  </div>
3105
+ ${item.scenarios.length ? `<div class="ex-block"><div class="ex-kicker">Example</div>${groupedDropdown(item.scenarios, scenarioIndex)}</div>` : ""}
2960
3106
  <div class="urlbar">
2961
3107
  <div class="url"><span class="method ${item.method}">${item.method}</span><span>${resolvedUrl(item, scenario)}</span></div>
2962
3108
  <button class="btn" id="copy-curl" type="button">Copy cURL</button>
@@ -2967,6 +3113,10 @@
2967
3113
  <div class="card-head">
2968
3114
  <h2>Request</h2>
2969
3115
  <div class="card-head-actions">
3116
+ <div class="mode-toggle">
3117
+ <button type="button" data-json="req" data-mode="pretty" class="${reqPretty ? "on" : ""}">Pretty</button>
3118
+ <button type="button" data-json="req" data-mode="raw" class="${reqPretty ? "" : "on"}">Raw</button>
3119
+ </div>
2970
3120
  <button class="btn sm icon" id="copy-req" type="button" title="Copy body" aria-label="Copy body" ${reqCopyText ? "" : "disabled"}>${copyIcon}</button>
2971
3121
  </div>
2972
3122
  </div>
@@ -2979,18 +3129,25 @@
2979
3129
  </section>
2980
3130
  <section class="card response-card" id="response-card">
2981
3131
  <div class="card-head">
2982
- <h2>${responseTitle}</h2>
3132
+ <h2>Response</h2>
2983
3133
  <div class="card-head-actions">
3134
+ <div class="res-meta">
3135
+ <span class="code ${displayOk ? "ok" : "err"}">${displayStatus || ""} ${escapeHtml(displayStatusText)}</span>
3136
+ ${ms != null ? `<span>${ms} ms</span>` : ""}
3137
+ ${bytes ? `<span>${byteLabel(bytes)}</span>` : ""}
3138
+ </div>
3139
+ <div class="mode-toggle">
3140
+ <button type="button" data-json="res" data-mode="pretty" class="${resPretty ? "on" : ""}">Pretty</button>
3141
+ <button type="button" data-json="res" data-mode="raw" class="${resPretty ? "" : "on"}">Raw</button>
3142
+ </div>
2984
3143
  <button class="btn sm icon" id="copy-res" type="button" title="Copy body" aria-label="Copy body" ${resCopyText ? "" : "disabled"}>${copyIcon}</button>
2985
- <span><span class="code ${displayOk ? "ok" : ""}">${displayStatus || ""}</span> <span class="code-text">${displayStatusText}</span></span>
2986
3144
  </div>
2987
3145
  </div>
2988
- <div class="card-body" id="response-body">
2989
- ${showingLive && liveResult.error ? `<div class="live-err">${String(liveResult.error).replace(/&/g, "&amp;").replace(/</g, "&lt;")}</div>` : displayEmpty ? `<div class="empty">Empty body</div>` : `<pre>${highlight(displayBody)}</pre>`}
2990
- </div>
3146
+ <div class="card-body" id="response-body">${resHtml}</div>
2991
3147
  </section>
2992
3148
  </div>
2993
- ${fieldsPanel(fields)}
3149
+ ${schemasPanel(fields, displayEmpty ? undefined : displayBody)}
3150
+ <div class="work-foot">Generated by Notary</div>
2994
3151
  `;
2995
3152
 
2996
3153
  const scenarioToggle = document.getElementById("scenario-toggle");
@@ -2998,24 +3155,50 @@
2998
3155
  const root = document.getElementById("scenario-dd");
2999
3156
  scenarioToggle.onclick = (event) => {
3000
3157
  event.stopPropagation();
3158
+ exampleOpen = !root.classList.contains("open");
3001
3159
  document.querySelectorAll(".dd.open").forEach((el) => {
3002
3160
  if (el !== root) el.classList.remove("open");
3003
3161
  });
3004
- root.classList.toggle("open");
3162
+ root.classList.toggle("open", exampleOpen);
3163
+ if (exampleOpen) document.getElementById("example-search")?.focus();
3005
3164
  };
3165
+ const exSearch = document.getElementById("example-search");
3166
+ if (exSearch) {
3167
+ exSearch.onclick = (event) => event.stopPropagation();
3168
+ exSearch.oninput = (event) => {
3169
+ exampleQuery = event.target.value;
3170
+ exampleOpen = true;
3171
+ const pos = event.target.selectionStart;
3172
+ renderMain();
3173
+ const next = document.getElementById("example-search");
3174
+ if (next) {
3175
+ next.focus();
3176
+ next.selectionStart = next.selectionEnd = pos;
3177
+ }
3178
+ };
3179
+ }
3006
3180
  root.querySelectorAll(".dd-item").forEach((button) => {
3007
3181
  button.onclick = (event) => {
3008
3182
  event.stopPropagation();
3009
3183
  scenarioIndex = Number(button.dataset.index);
3010
3184
  liveResult = null;
3011
- root.classList.remove("open");
3012
- expandedExampleOps.add(item.id);
3185
+ exampleOpen = false;
3186
+ exampleQuery = "";
3013
3187
  renderNav();
3014
3188
  renderMain();
3015
3189
  };
3016
3190
  });
3191
+ root.onclick = (event) => event.stopPropagation();
3017
3192
  }
3018
3193
 
3194
+ document.querySelectorAll("[data-json]").forEach((button) => {
3195
+ button.onclick = (event) => {
3196
+ event.stopPropagation();
3197
+ jsonMode[button.dataset.json] = button.dataset.mode;
3198
+ renderMain();
3199
+ };
3200
+ });
3201
+
3019
3202
  const syncResponseHeight = () => {
3020
3203
  const requestCard = document.getElementById("request-card");
3021
3204
  const responseCard = document.getElementById("response-card");
@@ -3046,7 +3229,14 @@
3046
3229
  sendBtn.textContent = "Sending…";
3047
3230
  try {
3048
3231
  const result = await sendRequest(item, scenario);
3049
- liveResult = { id: item.id, scenarioIndex, status: result.status, body: result.body };
3232
+ liveResult = {
3233
+ id: item.id,
3234
+ scenarioIndex,
3235
+ status: result.status,
3236
+ body: result.body,
3237
+ ms: result.ms,
3238
+ bytes: result.bytes,
3239
+ };
3050
3240
  } catch (error) {
3051
3241
  const message = error instanceof Error ? error.message : String(error);
3052
3242
  liveResult = {
@@ -3068,8 +3258,14 @@
3068
3258
  currentId = id;
3069
3259
  scenarioIndex = typeof nextScenarioIndex === "number" ? nextScenarioIndex : 0;
3070
3260
  liveResult = null;
3261
+ exampleOpen = false;
3262
+ exampleQuery = "";
3071
3263
  const selected = ops.find((entry) => entry.id === id);
3072
- if (selected) syncHeaderGroupForOp(selected.op);
3264
+ if (selected) {
3265
+ syncHeaderGroupForOp(selected.op);
3266
+ const version = treePathSegments(selected)[0];
3267
+ if (version) activeVersion = version;
3268
+ }
3073
3269
  renderNav();
3074
3270
  renderMain();
3075
3271
  history.replaceState(null, "", "#" + encodeURIComponent(id));
@@ -3112,11 +3308,37 @@
3112
3308
  document.getElementById("search-wrap").addEventListener("click", (event) => event.stopPropagation());
3113
3309
 
3114
3310
  document.addEventListener("click", () => {
3311
+ exampleOpen = false;
3115
3312
  document.querySelectorAll(".dd.open").forEach((el) => el.classList.remove("open"));
3116
3313
  document.getElementById("env-wrap").classList.remove("open");
3117
3314
  if (document.body.classList.contains("searching")) closeSearch({ clear: true });
3118
3315
  });
3119
3316
 
3317
+ document.addEventListener("keydown", (event) => {
3318
+ if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
3319
+ event.preventDefault();
3320
+ document.getElementById("search")?.focus();
3321
+ }
3322
+ });
3323
+
3324
+ const verSelect = document.getElementById("ver-select");
3325
+ if (verSelect) {
3326
+ if (!apiVersions.length) verSelect.hidden = true;
3327
+ else {
3328
+ verSelect.innerHTML = apiVersions.map((name) => `<option value="${escapeAttr(name)}">${escapeHtml(name)}</option>`).join("");
3329
+ verSelect.value = activeVersion;
3330
+ verSelect.onchange = () => {
3331
+ activeVersion = verSelect.value;
3332
+ const first = visibleOps()[0];
3333
+ if (first) select(first.id);
3334
+ else {
3335
+ renderNav();
3336
+ renderMain();
3337
+ }
3338
+ };
3339
+ }
3340
+ }
3341
+
3120
3342
  const initial = decodeURIComponent(location.hash.replace(/^#/, "")) || ops[0]?.id;
3121
3343
  select(ops.some((item) => item.id === initial) ? initial : ops[0]?.id);
3122
3344