rapidoc 9.3.3 → 9.3.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.
Files changed (43) hide show
  1. package/.github/workflow/words.yaml +22 -0
  2. package/dist/rapidoc-min.js +815 -709
  3. package/dist/rapidoc-min.js.LICENSE.txt +8 -7
  4. package/dist/rapidoc-min.js.LICENSE.txt.gz +0 -0
  5. package/dist/rapidoc-min.js.gz +0 -0
  6. package/dist/rapidoc-min.js.map +1 -1
  7. package/dist/rapidoc-min.js.map.gz +0 -0
  8. package/dist/rapidoc.js +17680 -31489
  9. package/dist/report.html +5 -4
  10. package/package.json +18 -18
  11. package/src/components/api-request.js +218 -112
  12. package/src/components/api-response.js +11 -10
  13. package/src/components/json-tree.js +17 -12
  14. package/src/components/schema-table.js +47 -39
  15. package/src/components/schema-tree.js +55 -52
  16. package/src/components/tag-input.js +7 -4
  17. package/src/json-schema-viewer.js +1 -1
  18. package/src/rapidoc-mini.js +1 -1
  19. package/src/rapidoc.js +98 -30
  20. package/src/styles/endpoint-styles.js +1 -1
  21. package/src/styles/info-styles.js +2 -1
  22. package/src/styles/input-styles.js +2 -16
  23. package/src/styles/nav-styles.js +57 -10
  24. package/src/styles/schema-styles.js +27 -15
  25. package/src/styles/tab-styles.js +1 -0
  26. package/src/templates/callback-template.js +3 -3
  27. package/src/templates/code-samples-template.js +1 -0
  28. package/src/templates/components-template.js +3 -5
  29. package/src/templates/endpoint-template.js +38 -25
  30. package/src/templates/expanded-endpoint-template.js +57 -8
  31. package/src/templates/focused-endpoint-template.js +4 -1
  32. package/src/templates/header-template.js +2 -2
  33. package/src/templates/json-schema-viewer-template.js +2 -1
  34. package/src/templates/main-body-template.js +19 -18
  35. package/src/templates/navbar-template.js +98 -81
  36. package/src/templates/overview-template.js +1 -1
  37. package/src/templates/security-scheme-template.js +48 -25
  38. package/src/templates/server-template.js +1 -1
  39. package/src/utils/common-utils.js +1 -1
  40. package/src/utils/schema-utils.js +161 -63
  41. package/src/utils/spec-parser.js +1 -0
  42. package/src/utils/theme.js +9 -3
  43. package/webpack.config.js +2 -1
package/src/rapidoc.js CHANGED
@@ -38,7 +38,9 @@ export default class RapiDoc extends LitElement {
38
38
  threshold: 0,
39
39
  };
40
40
  this.showSummaryWhenCollapsed = true;
41
- this.isIntersectionObserverActive = true;
41
+ // Will activate intersection observer only after spec load and hash analyze
42
+ // to scroll to the proper element without being reverted by observer behavior
43
+ this.isIntersectionObserverActive = false;
42
44
  this.intersectionObserver = new IntersectionObserver((entries) => { this.onIntersect(entries); }, intersectionObserverOptions);
43
45
  }
44
46
 
@@ -87,6 +89,7 @@ export default class RapiDoc extends LitElement {
87
89
  showInfo: { type: String, attribute: 'show-info' },
88
90
  allowAuthentication: { type: String, attribute: 'allow-authentication' },
89
91
  allowTry: { type: String, attribute: 'allow-try' },
92
+ showCurlBeforeTry: { type: String, attribute: 'show-curl-before-try' },
90
93
  allowSpecUrlLoad: { type: String, attribute: 'allow-spec-url-load' },
91
94
  allowSpecFileLoad: { type: String, attribute: 'allow-spec-file-load' },
92
95
  allowSpecFileDownload: { type: String, attribute: 'allow-spec-file-download' },
@@ -116,6 +119,8 @@ export default class RapiDoc extends LitElement {
116
119
  navHoverBgColor: { type: String, attribute: 'nav-hover-bg-color' },
117
120
  navHoverTextColor: { type: String, attribute: 'nav-hover-text-color' },
118
121
  navAccentColor: { type: String, attribute: 'nav-accent-color' },
122
+ navAccentTextColor: { type: String, attribute: 'nav-accent-text-color' },
123
+ navActiveItemMarker: { type: String, attribute: 'nav-active-item-marker' },
119
124
  navItemSpacing: { type: String, attribute: 'nav-item-spacing' },
120
125
  showMethodInNavBar: { type: String, attribute: 'show-method-in-nav-bar' },
121
126
  usePathInNavBar: { type: String, attribute: 'use-path-in-nav-bar' },
@@ -162,13 +167,14 @@ export default class RapiDoc extends LitElement {
162
167
  background-color:var(--bg);
163
168
  font-family:var(--font-regular);
164
169
  }
165
- .body {
170
+ :where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); }
171
+ :where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); }
172
+ .body {
166
173
  display:flex;
167
174
  height:100%;
168
175
  width:100%;
169
176
  overflow:hidden;
170
177
  }
171
-
172
178
  .main-content {
173
179
  margin:0;
174
180
  padding: 0;
@@ -282,11 +288,21 @@ export default class RapiDoc extends LitElement {
282
288
  height: 36px;
283
289
  animation: spin 2s linear infinite;
284
290
  }
285
- .expanded-endpoint-body{
291
+ .expanded-endpoint-body {
286
292
  position: relative;
287
293
  padding: 6px 0px;
288
294
  }
289
- .expanded-endpoint-body.deprecated{ filter:opacity(0.6); }
295
+ .expanded-endpoint-body .tag-description {
296
+ background: var(--code-bg);
297
+ border-radius: var(--border-radius);
298
+ transition: max-height .2s ease-out;
299
+ }
300
+ .expanded-endpoint-body .tag-icon {
301
+ transition: transform .2s ease-out;
302
+ }
303
+ .expanded-endpoint-body .tag-icon.expanded {
304
+ transform: rotate(180deg);
305
+ }
290
306
  .divider {
291
307
  border-top: 2px solid var(--border-color);
292
308
  margin: 24px 0;
@@ -345,6 +361,9 @@ export default class RapiDoc extends LitElement {
345
361
  border-radius: 4px 0 0 4px;
346
362
  color: #000;
347
363
  }
364
+ .colored-block .nav-method.as-colored-block {
365
+ outline: 1px solid;
366
+ }
348
367
 
349
368
  .nav-method.as-colored-block.get { background-color: var(--blue); }
350
369
  .nav-method.as-colored-block.put { background-color: var(--orange); }
@@ -438,7 +457,7 @@ export default class RapiDoc extends LitElement {
438
457
  }
439
458
 
440
459
  if (!this.layout || !'row, column,'.includes(`${this.layout},`)) { this.layout = 'row'; }
441
- if (!this.renderStyle || !'read, view, focused,'.includes(`${this.renderStyle},`)) { this.renderStyle = 'read'; }
460
+ if (!this.renderStyle || !'read, view, focused,'.includes(`${this.renderStyle},`)) { this.renderStyle = 'focused'; }
442
461
  if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) { this.schemaStyle = 'tree'; }
443
462
  if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {
444
463
  this.theme = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';
@@ -456,7 +475,6 @@ export default class RapiDoc extends LitElement {
456
475
 
457
476
  if (!this.fillRequestFieldsWithExample || !'true, false,'.includes(`${this.fillRequestFieldsWithExample},`)) { this.fillRequestFieldsWithExample = 'true'; }
458
477
  if (!this.persistAuth || !'true, false,'.includes(`${this.persistAuth},`)) { this.persistAuth = 'false'; }
459
- if (!this.onNavTagClick || !'expand-collapse, show-description,'.includes(`${this.onNavTagClick},`)) { this.onNavTagClick = 'expand-collapse'; }
460
478
  if (!this.responseAreaHeight) {
461
479
  this.responseAreaHeight = '400px';
462
480
  }
@@ -475,11 +493,14 @@ export default class RapiDoc extends LitElement {
475
493
  if (!this.sortTags || !'true, false,'.includes(`${this.sortTags},`)) { this.sortTags = 'false'; }
476
494
  if (!this.generateMissingTags || !'true, false,'.includes(`${this.generateMissingTags},`)) { this.generateMissingTags = 'false'; }
477
495
  if (!this.sortEndpointsBy || !'method, path, summary, none,'.includes(`${this.sortEndpointsBy},`)) { this.sortEndpointsBy = 'path'; }
496
+
497
+ if (!this.onNavTagClick || !'expand-collapse, show-description,'.includes(`${this.onNavTagClick},`)) { this.onNavTagClick = 'expand-collapse'; }
478
498
  if (!this.navItemSpacing || !'compact, relaxed, default,'.includes(`${this.navItemSpacing},`)) { this.navItemSpacing = 'default'; }
479
499
  if (!this.showMethodInNavBar || !'false, as-plain-text, as-colored-text, as-colored-block,'.includes(`${this.showMethodInNavBar},`)) { this.showMethodInNavBar = 'false'; }
480
500
  if (!this.usePathInNavBar || !'true, false,'.includes(`${this.usePathInNavBar},`)) { this.usePathInNavBar = 'false'; }
481
- if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) { this.fontSize = 'default'; }
501
+ if (!this.navActiveItemMarker || !'left-bar, colored-block'.includes(`${this.navActiveItemMarker},`)) { this.navActiveItemMarker = 'left-bar'; }
482
502
 
503
+ if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) { this.fontSize = 'default'; }
483
504
  if (!this.showInfo || !'true, false,'.includes(`${this.showInfo},`)) { this.showInfo = 'true'; }
484
505
  if (!this.allowServerSelection || !'true, false,'.includes(`${this.allowServerSelection},`)) { this.allowServerSelection = 'true'; }
485
506
  if (!this.allowAuthentication || !'true, false,'.includes(`${this.allowAuthentication},`)) { this.allowAuthentication = 'true'; }
@@ -506,9 +527,7 @@ export default class RapiDoc extends LitElement {
506
527
  });
507
528
 
508
529
  window.addEventListener('hashchange', () => {
509
- const regEx = new RegExp(`^${this.routePrefix}`, 'i');
510
- const elementId = window.location.hash.replace(regEx, '');
511
- this.scrollTo(elementId);
530
+ this.scrollToPath(this.getElementIDFromURL());
512
531
  }, true);
513
532
  }
514
533
 
@@ -552,7 +571,7 @@ export default class RapiDoc extends LitElement {
552
571
  await this.loadSpec(newVal);
553
572
  // If goto-path is provided and no location-hash is present then try to scroll there
554
573
  if (this.gotoPath && !window.location.hash) {
555
- this.scrollTo(this.gotoPath);
574
+ this.scrollToPath(this.gotoPath);
556
575
  }
557
576
  }, 0);
558
577
  }
@@ -621,11 +640,11 @@ export default class RapiDoc extends LitElement {
621
640
  super.attributeChangedCallback(name, oldVal, newVal);
622
641
  }
623
642
 
624
- onSepcUrlChange() {
643
+ onSpecUrlChange() {
625
644
  this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);
626
645
  }
627
646
 
628
- onSepcFileChange(e) {
647
+ onSpecFileChange(e) {
629
648
  this.setAttribute('spec-file', this.shadowRoot.getElementById('spec-file').value);
630
649
  const specFile = e.target.files[0];
631
650
  const reader = new FileReader();
@@ -754,25 +773,62 @@ export default class RapiDoc extends LitElement {
754
773
  this.observeExpandedContent(); // This will auto-highlight the selected nav-item in read-mode
755
774
  }
756
775
 
776
+ this.isIntersectionObserverActive = true;
777
+
757
778
  // On first time Spec load, try to navigate to location hash if provided
758
- const locationHash = window.location.hash?.substring(1);
759
- if (locationHash) {
760
- const regEx = new RegExp(`^${this.routePrefix}`, 'i');
761
- const elementId = window.location.hash.replace(regEx, '');
779
+ const elementId = this.getElementIDFromURL();
780
+
781
+ if (elementId) {
762
782
  if (this.renderStyle === 'view') {
763
783
  this.expandAndGotoOperation(elementId, true, true);
764
784
  } else {
765
- this.scrollTo(elementId);
785
+ this.scrollToPath(elementId);
766
786
  }
767
787
  } else if (this.renderStyle === 'focused') {
768
788
  // If goto-path is provided and no location-hash is present then try to scroll to default element
769
789
  if (!this.gotoPath) {
770
790
  const defaultElementId = this.showInfo ? 'overview' : this.resolvedSpec.tags[0]?.paths[0];
771
- this.scrollTo(defaultElementId);
791
+ this.scrollToPath(defaultElementId);
772
792
  }
773
793
  }
774
794
  }
775
795
 
796
+ /**
797
+ * Return the URL from where is served the RapiDoc component, removing any hash and route prefix
798
+ */
799
+ getComponentBaseURL() {
800
+ const { href } = window.location;
801
+
802
+ // Remove end of string # or /
803
+ const cleanRouterPrefix = this.routePrefix.replace(/(#|\/)$/, '');
804
+
805
+ if (!cleanRouterPrefix) {
806
+ return href.split('#')[0];
807
+ }
808
+
809
+ const indexOfRoutePrefix = href.lastIndexOf(cleanRouterPrefix);
810
+
811
+ if (indexOfRoutePrefix === -1) {
812
+ return href;
813
+ }
814
+
815
+ return href.slice(0, indexOfRoutePrefix);
816
+ }
817
+
818
+ /**
819
+ * From the URL return the ID of the element whether it is in the hash or if used a router prefix without a hash
820
+ */
821
+ getElementIDFromURL() {
822
+ const baseURL = this.getComponentBaseURL();
823
+ const elementId = window.location.href.replace(baseURL + this.routePrefix, '');
824
+ return elementId;
825
+ }
826
+
827
+ replaceHistoryState(hashId) {
828
+ const baseURL = this.getComponentBaseURL();
829
+ window.history.replaceState(null, null, `${baseURL}${this.routePrefix || '#'}${hashId}`);
830
+ }
831
+
776
832
  expandAndGotoOperation(elementId, scrollToElement = true) {
777
833
  if (!this.resolvedSpec) {
778
834
  return;
@@ -806,7 +862,7 @@ export default class RapiDoc extends LitElement {
806
862
  if (gotoEl) {
807
863
  gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });
808
864
  if (this.updateRoute === 'true') {
809
- window.history.replaceState(null, null, `${this.routePrefix || '#'}${tmpElementId}`);
865
+ this.replaceHistoryState(tmpElementId);
810
866
  }
811
867
  }
812
868
  }, isExpandingNeeded ? 150 : 0);
@@ -837,6 +893,7 @@ export default class RapiDoc extends LitElement {
837
893
  if (this.isIntersectionObserverActive === false) {
838
894
  return;
839
895
  }
896
+
840
897
  entries.forEach((entry) => {
841
898
  if (entry.isIntersecting && entry.intersectionRatio > 0) {
842
899
  const oldNavEl = this.shadowRoot.querySelector('.nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active');
@@ -845,14 +902,18 @@ export default class RapiDoc extends LitElement {
845
902
  // Add active class in the new element
846
903
  if (newNavEl) {
847
904
  if (this.updateRoute === 'true') {
848
- window.history.replaceState(null, null, `${window.location.href.split('#')[0]}${this.routePrefix || '#'}${entry.target.id}`);
905
+ this.replaceHistoryState(entry.target.id);
849
906
  }
850
907
  newNavEl.scrollIntoView({ behavior: 'auto', block: 'center' });
851
908
  newNavEl.classList.add('active');
909
+ newNavEl.part.add('section-navbar-active-item');
852
910
  }
911
+
853
912
  // Remove active class from previous element
854
- if (oldNavEl) {
913
+ // if it is different from the new one (edge case on loading in read render style)
914
+ if (oldNavEl && oldNavEl !== newNavEl) {
855
915
  oldNavEl.classList.remove('active');
916
+ oldNavEl.part.remove('section-navbar-active-item');
856
917
  }
857
918
  }
858
919
  });
@@ -882,7 +943,10 @@ export default class RapiDoc extends LitElement {
882
943
  *
883
944
  */
884
945
  async scrollToEventTarget(event, scrollNavItemToView = true) {
885
- const navEl = event.currentTarget;
946
+ if (!(event.type === 'click' || (event.type === 'keyup' && event.keyCode === 13))) {
947
+ return;
948
+ }
949
+ const navEl = event.target;
886
950
  if (!navEl.dataset.contentId) {
887
951
  return;
888
952
  }
@@ -890,21 +954,22 @@ export default class RapiDoc extends LitElement {
890
954
  if (this.renderStyle === 'focused') {
891
955
  const requestEl = this.shadowRoot.querySelector('api-request');
892
956
  if (requestEl) {
893
- requestEl.beforerNavigationFocusedMode();
957
+ requestEl.beforeNavigationFocusedMode();
894
958
  }
895
959
  }
896
- this.scrollTo(navEl.dataset.contentId, true, scrollNavItemToView);
960
+ this.scrollToPath(navEl.dataset.contentId, true, scrollNavItemToView);
897
961
  setTimeout(() => {
898
962
  this.isIntersectionObserverActive = true;
899
963
  }, 300);
900
964
  }
901
965
 
902
966
  // Public Method (scrolls to a given path and highlights the left-nav selection)
903
- async scrollTo(elementId, expandPath = true, scrollNavItemToView = true) {
967
+ async scrollToPath(elementId, expandPath = true, scrollNavItemToView = true) {
904
968
  if (this.renderStyle === 'focused') {
905
969
  // for focused mode update this.focusedElementId to update the rendering, else it wont find the needed html elements
906
970
  // focusedElementId will get validated in the template
907
971
  this.focusedElementId = elementId;
972
+ await sleep(0);
908
973
  }
909
974
  if (this.renderStyle === 'view') {
910
975
  this.expandAndGotoOperation(elementId, expandPath, true);
@@ -932,7 +997,7 @@ export default class RapiDoc extends LitElement {
932
997
 
933
998
  // Update Location Hash
934
999
  if (this.updateRoute === 'true') {
935
- window.history.replaceState(null, null, `${this.routePrefix || '#'}${elementId}`);
1000
+ this.replaceHistoryState(elementId);
936
1001
  }
937
1002
 
938
1003
  // Update NavBar View and Styles
@@ -946,8 +1011,11 @@ export default class RapiDoc extends LitElement {
946
1011
  const oldNavEl = this.shadowRoot.querySelector('.nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active');
947
1012
  if (oldNavEl) {
948
1013
  oldNavEl.classList.remove('active');
1014
+ oldNavEl.part.remove('active');
1015
+ oldNavEl.part.remove('section-navbar-active-item');
949
1016
  }
950
1017
  newNavEl.classList.add('active'); // must add the class after scrolling
1018
+ newNavEl.part.add('section-navbar-active-item');
951
1019
  // this.requestUpdate();
952
1020
  }
953
1021
  }
@@ -986,8 +1054,8 @@ export default class RapiDoc extends LitElement {
986
1054
  } else {
987
1055
  searchInputEl = eventTargetEl.closest('.advanced-search-options').querySelector('input[type=text]');
988
1056
  }
989
- const searcOptions = [...eventTargetEl.closest('.advanced-search-options').querySelectorAll('input:checked')].map((v) => v.id);
990
- this.advancedSearchMatches = advancedSearch(searchInputEl.value, this.resolvedSpec.tags, searcOptions);
1057
+ const searchOptions = [...eventTargetEl.closest('.advanced-search-options').querySelectorAll('input:checked')].map((v) => v.id);
1058
+ this.advancedSearchMatches = advancedSearch(searchInputEl.value, this.resolvedSpec.tags, searchOptions);
991
1059
  }, delay);
992
1060
  }
993
1061
  }
@@ -130,7 +130,7 @@ export default css`
130
130
  border: 2px solid var(--yellow);
131
131
  }
132
132
 
133
- .req-resp-container{
133
+ .req-resp-container {
134
134
  display: flex;
135
135
  margin-top:16px;
136
136
  align-items: stretch;
@@ -2,7 +2,8 @@ import { css } from 'lit';
2
2
 
3
3
  export default css`
4
4
  #api-info {
5
- font-size:calc(var(--font-size-regular) - 1px);margin-top:8px
5
+ font-size: calc(var(--font-size-regular) - 1px);
6
+ margin-top: 8px;
6
7
  margin-left: -15px;
7
8
  }
8
9
 
@@ -105,15 +105,6 @@ input[type="password"]::placeholder {
105
105
  opacity:1;
106
106
  }
107
107
 
108
- select:focus,
109
- textarea:focus,
110
- input[type="text"]:focus,
111
- input[type="password"]:focus,
112
- textarea:active,
113
- input[type="text"]:active,
114
- input[type="password"]:active {
115
- border:1px solid var(--primary-color);
116
- }
117
108
 
118
109
  input[type="file"]{
119
110
  font-family: var(--font-regular);
@@ -167,10 +158,6 @@ textarea::-webkit-scrollbar-thumb {
167
158
  margin-bottom:2px;
168
159
  }
169
160
 
170
- input[type="checkbox"]:focus{
171
- outline:0;
172
- }
173
-
174
161
  /* Toggle Body */
175
162
  input[type="checkbox"] {
176
163
  appearance: none;
@@ -203,7 +190,7 @@ input[type="checkbox"]:after {
203
190
 
204
191
  /* Toggle Body - Checked */
205
192
  input[type="checkbox"]:checked {
206
- box-shadow: inset 0 0 0 13px var(--green);
193
+ background-color: var(--green);
207
194
  border-color: var(--green);
208
195
  }
209
196
  /* Toggle Thumb - Checked*/
@@ -212,5 +199,4 @@ input[type="checkbox"]:checked:after {
212
199
  left: 16px;
213
200
  right: 1px;
214
201
  transition: border .25s, left .15s .25s, right .25s .175s;
215
- }
216
- `;
202
+ }`;
@@ -1,6 +1,20 @@
1
1
  import { css } from 'lit';
2
2
 
3
3
  export default css`
4
+ .nav-bar-info:focus-visible,
5
+ .nav-bar-tag:focus-visible,
6
+ .nav-bar-path:focus-visible {
7
+ outline: 1px solid;
8
+ box-shadow: none;
9
+ outline-offset: -4px;
10
+ }
11
+ .nav-bar-expand-all:focus-visible,
12
+ .nav-bar-collapse-all:focus-visible,
13
+ .nav-bar-tag-icon:focus-visible {
14
+ outline: 1px solid;
15
+ box-shadow: none;
16
+ outline-offset: 2px;
17
+ }
4
18
  .nav-bar {
5
19
  width:0;
6
20
  height:100%;
@@ -35,6 +49,26 @@ export default css`
35
49
  .nav-bar.read .nav-bar-tag-icon {
36
50
  display:none;
37
51
  }
52
+ .nav-bar-paths-under-tag {
53
+ overflow:hidden;
54
+ transition: max-height .2s ease-out, visibility .3s;
55
+ }
56
+ .collapsed .nav-bar-paths-under-tag {
57
+ visibility: hidden;
58
+ }
59
+
60
+ .nav-bar-expand-all {
61
+ transform: rotate(90deg);
62
+ cursor:pointer;
63
+ margin-right:10px;
64
+ }
65
+ .nav-bar-collapse-all {
66
+ transform: rotate(270deg);
67
+ cursor:pointer;
68
+ }
69
+ .nav-bar-expand-all:hover, .nav-bar-collapse-all:hover {
70
+ color: var(--primary-color);
71
+ }
38
72
 
39
73
  .nav-bar-tag-icon {
40
74
  color: var(--nav-text-color);
@@ -43,9 +77,6 @@ export default css`
43
77
  .nav-bar-tag-icon:hover {
44
78
  color:var(--nav-hover-text-color);
45
79
  }
46
- .nav-bar.focused .nav-bar-tag-and-paths.collapsed .nav-bar-paths-under-tag {
47
- display:none;
48
- }
49
80
  .nav-bar.focused .nav-bar-tag-and-paths.collapsed .nav-bar-tag-icon::after {
50
81
  content: '⌵';
51
82
  width:16px;
@@ -89,7 +120,12 @@ export default css`
89
120
  .nav-bar-tag,
90
121
  .nav-bar-path {
91
122
  display:flex;
92
- cursor:pointer;
123
+ cursor: pointer;
124
+ width: 100%;
125
+ border: none;
126
+ border-radius:4px;
127
+ color: var(--nav-text-color);
128
+ background: transparent;
93
129
  border-left:4px solid transparent;
94
130
  }
95
131
 
@@ -130,16 +166,27 @@ export default css`
130
166
  }
131
167
  .nav-bar-h2 {margin-left:12px;}
132
168
 
133
- .nav-bar-h1.active,
134
- .nav-bar-h2.active,
135
- .nav-bar-info.active,
136
- .nav-bar-tag.active,
137
- .nav-bar-path.active,
138
- .nav-bar-section.operations.active {
169
+ .nav-bar-h1.left-bar.active,
170
+ .nav-bar-h2.left-bar.active,
171
+ .nav-bar-info.left-bar.active,
172
+ .nav-bar-tag.left-bar.active,
173
+ .nav-bar-path.left-bar.active,
174
+ .nav-bar-section.left-bar.operations.active {
139
175
  border-left:4px solid var(--nav-accent-color);
140
176
  color:var(--nav-hover-text-color);
141
177
  }
142
178
 
179
+ .nav-bar-h1.colored-block.active,
180
+ .nav-bar-h2.colored-block.active,
181
+ .nav-bar-info.colored-block.active,
182
+ .nav-bar-tag.colored-block.active,
183
+ .nav-bar-path.colored-block.active,
184
+ .nav-bar-section.colored-block.operations.active {
185
+ background-color: var(--nav-accent-color);
186
+ color: var(--nav-accent-text-color);
187
+ border-radius: 0;
188
+ }
189
+
143
190
  .nav-bar-h1:hover,
144
191
  .nav-bar-h2:hover,
145
192
  .nav-bar-info:hover,
@@ -10,6 +10,7 @@ export default css`
10
10
  width: 100%;
11
11
  box-sizing: content-box;
12
12
  border-bottom: 1px dotted transparent;
13
+ transition: max-height 0.3s ease-out;
13
14
  }
14
15
  .td {
15
16
  display: block;
@@ -21,9 +22,29 @@ export default css`
21
22
  word-break: break-all;
22
23
  }
23
24
 
24
- .collapsed-descr .key {
25
+ .collapsed-all-descr .key {
25
26
  overflow:hidden;
26
27
  }
28
+ .expanded-all-descr .key-descr .descr-expand-toggle {
29
+ display:none;
30
+ }
31
+
32
+ .key-descr .descr-expand-toggle {
33
+ display:inline-block;
34
+ user-select:none;
35
+ color: var(--fg);
36
+ cursor: pointer;
37
+ transform: rotate(45deg);
38
+ transition: transform .2s ease;
39
+ }
40
+
41
+ .expanded-descr .key-descr .descr-expand-toggle {
42
+ transform: rotate(270deg)
43
+ }
44
+
45
+ .key-descr .descr-expand-toggle:hover {
46
+ color: var(--primary-color);
47
+ }
27
48
 
28
49
  .expanded-descr .more-content { display:none; }
29
50
 
@@ -40,13 +61,6 @@ export default css`
40
61
  overflow:hidden;
41
62
  display: none;
42
63
  }
43
- .collapsed-descr .tr {
44
- max-height:20px;
45
- }
46
-
47
- .tr.xxx-of{
48
- border-top: 1px dotted var(--primary-color);
49
- }
50
64
 
51
65
  .xxx-of-key {
52
66
  font-size: calc(var(--font-size-small) - 2px);
@@ -61,10 +75,10 @@ export default css`
61
75
  }
62
76
 
63
77
  .xxx-of-descr {
64
- font-family: var(--font-regular);
65
- color: var(--primary-color);
66
- font-size: calc(var(--font-size-small) - 1px);
67
- margin-left: 2px;
78
+ font-family: var(--font-regular);
79
+ color: var(--primary-color);
80
+ font-size: calc(var(--font-size-small) - 1px);
81
+ margin-left: 2px;
68
82
  }
69
83
 
70
84
  .stri, .string, .uri, .url, .byte, .bina, .date, .pass, .ipv4, .ipv4, .uuid, .emai, .host {color:var(--green);}
@@ -72,6 +86,7 @@ export default css`
72
86
  .null {color:var(--red);}
73
87
  .bool, .boolean{color:var(--orange)}
74
88
  .enum {color:var(--purple)}
89
+ .cons {color:var(--purple)}
75
90
  .recu {color:var(--brown)}
76
91
  .toolbar {
77
92
  display:flex;
@@ -90,9 +105,6 @@ export default css`
90
105
  font-weight: bold;
91
106
  text-transform: uppercase;
92
107
  }
93
- .schema-root-type.xxx-of {
94
- display:none;
95
- }
96
108
  .toolbar-item:first-of-type { margin:0 2px 0 0;}
97
109
 
98
110
  @media only screen and (min-width: 500px) {
@@ -6,6 +6,7 @@ export default css`
6
6
  }
7
7
  .tab-buttons {
8
8
  height:30px;
9
+ padding: 4px 4px 0 4px;
9
10
  border-bottom: 1px solid var(--light-border-color) ;
10
11
  align-items: stretch;
11
12
  overflow-y: hidden;
@@ -35,14 +35,14 @@ export default function callbackTemplate(callbacks) {
35
35
  active-schema-tab = "${this.defaultSchemaTab}"
36
36
  schema-expand-level = "${this.schemaExpandLevel}"
37
37
  schema-description-expanded = "${this.schemaDescriptionExpanded}"
38
- allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}",
38
+ allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
39
39
  schema-hide-read-only = "false"
40
40
  schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : 'true'}"
41
41
  fetch-credentials = "${this.fetchCredentials}"
42
- exportparts = "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
42
+ exportparts = "wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
43
43
  file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
44
44
  anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
45
- > </api-request>
45
+ > </api-request>
46
46
 
47
47
  <api-response
48
48
  style = "width:100%;"
@@ -28,6 +28,7 @@ export default function codeSamplesTemplate(xCodeSamples) {
28
28
  <pre><code class="language">${Prism.languages[v.lang?.toLowerCase()] ? unsafeHTML(Prism.highlight(v.source, Prism.languages[v.lang?.toLowerCase()], v.lang?.toLowerCase())) : v.source}</code></pre>
29
29
  </div>`)
30
30
  }
31
+ </div>
31
32
  </section>`;
32
33
  }
33
34
  /* eslint-enable indent */
@@ -14,22 +14,20 @@ function schemaBodyTemplate(sComponent) {
14
14
  ${this.schemaStyle === 'table'
15
15
  ? html`
16
16
  <schema-table
17
- render-style = '${this.renderStyle}'
18
17
  .data = '${schemaInObjectNotation(sComponent.component, {})}'
19
18
  schema-expand-level = "${this.schemaExpandLevel}"
20
19
  schema-description-expanded = "${this.schemaDescriptionExpanded}"
21
- allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}",
20
+ allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
22
21
  schema-hide-read-only = "false"
23
22
  schema-hide-write-only = "${this.schemaHideWriteOnly}"
24
23
  exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
25
- > </schema-tree> `
24
+ > </schema-table>`
26
25
  : html`
27
26
  <schema-tree
28
- render-style = '${this.renderStyle}'
29
27
  .data = '${schemaInObjectNotation(sComponent.component, {})}'
30
28
  schema-expand-level = "${this.schemaExpandLevel}"
31
29
  schema-description-expanded = "${this.schemaDescriptionExpanded}"
32
- allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}",
30
+ allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
33
31
  schema-hide-read-only = "false"
34
32
  schema-hide-write-only = "${this.schemaHideWriteOnly}"
35
33
  exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"