openapi-explorer 0.9.310 → 0.9.314

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 (121) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/dist/{openapi-explorer.min.js → browser/openapi-explorer.min.js} +3 -3
  3. package/dist/{openapi-explorer.min.js.map → browser/openapi-explorer.min.js.map} +0 -0
  4. package/dist/es/components/api-request.js +936 -0
  5. package/dist/es/components/api-response.js +184 -0
  6. package/dist/es/components/json-tree.js +67 -0
  7. package/{src → dist/es}/components/mime-types.js +11 -17
  8. package/dist/es/components/schema-table.js +156 -0
  9. package/dist/es/components/schema-tree.js +191 -0
  10. package/dist/es/components/tag-input.js +67 -0
  11. package/{src → dist/es}/openapi-explorer-oauth-handler.js +2 -2
  12. package/{src → dist/es}/openapi-explorer.js +364 -371
  13. package/dist/es/styles/advanced-search-styles.js +2 -0
  14. package/dist/es/styles/api-request-styles.js +2 -0
  15. package/dist/es/styles/border-styles.js +2 -0
  16. package/dist/es/styles/endpoint-styles.js +2 -0
  17. package/dist/es/styles/flex-styles.js +2 -0
  18. package/dist/es/styles/font-styles.js +2 -0
  19. package/dist/es/styles/info-styles.js +2 -0
  20. package/dist/es/styles/input-styles.js +4 -0
  21. package/dist/es/styles/nav-styles.js +2 -0
  22. package/dist/es/styles/prism-styles.js +2 -0
  23. package/dist/es/styles/schema-styles.js +2 -0
  24. package/dist/es/styles/tab-styles.js +2 -0
  25. package/dist/es/styles/table-styles.js +2 -0
  26. package/dist/es/templates/advance-search-template.js +37 -0
  27. package/dist/es/templates/callback-template.js +7 -0
  28. package/dist/es/templates/code-samples-template.js +26 -0
  29. package/dist/es/templates/components-template.js +17 -0
  30. package/dist/es/templates/endpoint-template.js +94 -0
  31. package/dist/es/templates/expanded-endpoint-template.js +32 -0
  32. package/{src → dist/es}/templates/focused-endpoint-template.js +15 -15
  33. package/dist/es/templates/navbar-template.js +46 -0
  34. package/dist/es/templates/overview-template.js +9 -0
  35. package/dist/es/templates/responsiveViewMainBodyTemplate.js +30 -0
  36. package/dist/es/templates/security-scheme-template.js +330 -0
  37. package/dist/es/templates/server-template.js +42 -0
  38. package/{src → dist/es}/utils/color-utils.js +53 -16
  39. package/{src → dist/es}/utils/common-utils.js +18 -18
  40. package/{src → dist/es}/utils/schema-utils.js +248 -124
  41. package/{src → dist/es}/utils/spec-parser.js +112 -71
  42. package/dist/es/utils/theme.js +75 -0
  43. package/{src → dist/es}/utils/xml/xml.js +41 -38
  44. package/dist/lib/components/api-request.js +957 -0
  45. package/dist/lib/components/api-response.js +206 -0
  46. package/dist/lib/components/json-tree.js +82 -0
  47. package/dist/lib/components/mime-types.js +70 -0
  48. package/dist/lib/components/schema-table.js +170 -0
  49. package/dist/lib/components/schema-tree.js +206 -0
  50. package/dist/lib/components/tag-input.js +76 -0
  51. package/dist/lib/openapi-explorer-oauth-handler.js +19 -0
  52. package/dist/lib/openapi-explorer.js +817 -0
  53. package/dist/lib/styles/advanced-search-styles.js +10 -0
  54. package/dist/lib/styles/api-request-styles.js +10 -0
  55. package/dist/lib/styles/border-styles.js +10 -0
  56. package/dist/lib/styles/endpoint-styles.js +10 -0
  57. package/dist/lib/styles/flex-styles.js +10 -0
  58. package/dist/lib/styles/font-styles.js +10 -0
  59. package/dist/lib/styles/info-styles.js +10 -0
  60. package/dist/lib/styles/input-styles.js +11 -0
  61. package/dist/lib/styles/nav-styles.js +10 -0
  62. package/dist/lib/styles/prism-styles.js +10 -0
  63. package/dist/lib/styles/schema-styles.js +10 -0
  64. package/dist/lib/styles/tab-styles.js +10 -0
  65. package/dist/lib/styles/table-styles.js +10 -0
  66. package/dist/lib/templates/advance-search-template.js +42 -0
  67. package/dist/lib/templates/callback-template.js +12 -0
  68. package/dist/lib/templates/code-samples-template.js +36 -0
  69. package/dist/lib/templates/components-template.js +27 -0
  70. package/dist/lib/templates/endpoint-template.js +111 -0
  71. package/dist/lib/templates/expanded-endpoint-template.js +48 -0
  72. package/dist/lib/templates/focused-endpoint-template.js +95 -0
  73. package/dist/lib/templates/navbar-template.js +54 -0
  74. package/dist/lib/templates/overview-template.js +16 -0
  75. package/dist/lib/templates/responsiveViewMainBodyTemplate.js +47 -0
  76. package/dist/lib/templates/security-scheme-template.js +342 -0
  77. package/dist/lib/templates/server-template.js +49 -0
  78. package/dist/lib/utils/color-utils.js +112 -0
  79. package/dist/lib/utils/common-utils.js +156 -0
  80. package/dist/lib/utils/schema-utils.js +743 -0
  81. package/dist/lib/utils/spec-parser.js +361 -0
  82. package/dist/lib/utils/theme.js +84 -0
  83. package/dist/lib/utils/xml/xml.js +239 -0
  84. package/package.json +19 -6
  85. package/dist/openapi-explorer.min.js.LICENSE.txt +0 -71
  86. package/dist/openapi-explorer.min.js.LICENSE.txt.gz +0 -0
  87. package/dist/openapi-explorer.min.js.gz +0 -0
  88. package/dist/openapi-explorer.min.js.map.gz +0 -0
  89. package/dist/report.html +0 -38
  90. package/src/components/api-request.js +0 -1244
  91. package/src/components/api-response.js +0 -340
  92. package/src/components/json-tree.js +0 -129
  93. package/src/components/schema-table.js +0 -250
  94. package/src/components/schema-tree.js +0 -280
  95. package/src/components/tag-input.js +0 -109
  96. package/src/styles/advanced-search-styles.js +0 -84
  97. package/src/styles/api-request-styles.js +0 -111
  98. package/src/styles/border-styles.js +0 -24
  99. package/src/styles/css/main.css +0 -24
  100. package/src/styles/endpoint-styles.js +0 -222
  101. package/src/styles/flex-styles.js +0 -15
  102. package/src/styles/font-styles.js +0 -266
  103. package/src/styles/info-styles.js +0 -20
  104. package/src/styles/input-styles.js +0 -236
  105. package/src/styles/nav-styles.js +0 -141
  106. package/src/styles/prism-styles.js +0 -107
  107. package/src/styles/schema-styles.js +0 -121
  108. package/src/styles/tab-styles.js +0 -44
  109. package/src/styles/table-styles.js +0 -48
  110. package/src/templates/advance-search-template.js +0 -81
  111. package/src/templates/callback-template.js +0 -63
  112. package/src/templates/code-samples-template.js +0 -35
  113. package/src/templates/components-template.js +0 -43
  114. package/src/templates/endpoint-template.js +0 -175
  115. package/src/templates/expanded-endpoint-template.js +0 -104
  116. package/src/templates/navbar-template.js +0 -175
  117. package/src/templates/overview-template.js +0 -58
  118. package/src/templates/responsiveViewMainBodyTemplate.js +0 -72
  119. package/src/templates/security-scheme-template.js +0 -487
  120. package/src/templates/server-template.js +0 -106
  121. package/src/utils/theme.js +0 -163
@@ -1,107 +0,0 @@
1
- import { css } from 'lit-element';
2
-
3
- export default css`
4
- code[class*="language-"],
5
- pre[class*="language-"] {
6
- text-align: left;
7
- white-space: pre;
8
- word-spacing: normal;
9
- word-break: normal;
10
- word-wrap: normal;
11
- line-height: 1.5;
12
- tab-size: 2;
13
-
14
- -webkit-hyphens: none;
15
- -moz-hyphens: none;
16
- -ms-hyphens: none;
17
- hyphens: none;
18
- }
19
-
20
- /* Code blocks */
21
- pre[class*="language-"] {
22
- padding: 1em;
23
- margin: .5em 0;
24
- overflow: auto;
25
- }
26
-
27
- /* Inline code */
28
- :not(pre) > code[class*="language-"] {
29
- white-space: normal;
30
- }
31
-
32
- .token.comment,
33
- .token.block-comment,
34
- .token.prolog,
35
- .token.doctype,
36
- .token.cdata {
37
- color: var(--light-fg)
38
- }
39
-
40
- .token.punctuation {
41
- color: var(--fg);
42
- }
43
-
44
- .token.tag,
45
- .token.attr-name,
46
- .token.namespace,
47
- .token.deleted {
48
- color:var(--pink);
49
- }
50
-
51
- .token.function-name {
52
- color: var(--blue);
53
- }
54
-
55
- .token.boolean,
56
- .token.number,
57
- .token.function {
58
- color: var(--red);
59
- }
60
-
61
- .token.property,
62
- .token.class-name,
63
- .token.constant,
64
- .token.symbol {
65
- color: var(--code-property-color);
66
- }
67
-
68
- .token.selector,
69
- .token.important,
70
- .token.atrule,
71
- .token.keyword,
72
- .token.builtin {
73
- color: var(--code-keyword-color);
74
- }
75
-
76
- .token.string,
77
- .token.char,
78
- .token.attr-value,
79
- .token.regex,
80
- .token.variable {
81
- color: var(--green);
82
- white-space: pre-wrap;
83
- line-break: anywhere;
84
- }
85
-
86
- .token.operator,
87
- .token.entity,
88
- .token.url {
89
- color: var(--code-operator-color);
90
- }
91
-
92
- .token.important,
93
- .token.bold {
94
- font-weight: bold;
95
- }
96
- .token.italic {
97
- font-style: italic;
98
- }
99
-
100
- .token.entity {
101
- cursor: help;
102
- }
103
-
104
- .token.inserted {
105
- color: green;
106
- }
107
- `;
@@ -1,121 +0,0 @@
1
- import { css } from 'lit-element';
2
-
3
- export default css`
4
-
5
- *, *:before, *:after { box-sizing: border-box; }
6
-
7
- .tr {
8
- display: flex;
9
- flex: none;
10
- width: 100%;
11
- box-sizing: content-box;
12
- border-bottom: 1px dotted transparent;
13
- }
14
- .td {
15
- display: block;
16
- flex: 0 0 auto;
17
- }
18
- .key {
19
- font-family: var(--font-mono);
20
- white-space: normal;
21
- word-break: break-all;
22
- }
23
-
24
- .collapsed-descr .key{
25
- overflow:hidden;
26
- }
27
-
28
- .key-descr {
29
- font-family:var(--font-regular);
30
- flex-shrink: 1;
31
- text-overflow: ellipsis;
32
- overflow: hidden;
33
- display: none;
34
- }
35
- .toolbar {
36
- display: none;
37
- }
38
- .expanded-descr .key-descr{
39
- max-height:auto;
40
- overflow:hidden;
41
- display: none;
42
- }
43
- .collapsed-descr .tr {
44
- max-height:20px;
45
- }
46
-
47
- .tr.xxx-of{
48
- border-top: 1px dotted var(--primary-color);
49
- }
50
-
51
- .xxx-of-key {
52
- font-size: calc(var(--font-size-small) - 2px);
53
- font-weight:bold;
54
- background-color:var(--primary-color);
55
- color: var(--primary-btn-text-color);
56
- border-radius:2px;
57
- line-height:calc(var(--font-size-small) + 6px);
58
- padding:0px 5px;
59
- margin-bottom:1px;
60
- display:inline-block;
61
- }
62
-
63
- .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;
68
- }
69
-
70
- .stri, .string, .uri, .url, .byte, .bina, .date, .pass, .ipv4, .ipv4, .uuid, .emai, .host {color:var(--green);}
71
- .inte, .numb, .number, .int6, .int3, .floa, .doub, .deci .blue {color:var(--blue);}
72
- .null {color:var(--red);}
73
- .bool, .boolean{color:var(--orange)}
74
- .enum {color:var(--yellow)}
75
-
76
- .tree .toolbar {
77
- display: flex;
78
- justify-content: space-between;
79
- }
80
-
81
- .toolbar {
82
- width:100%;
83
- }
84
- .toolbar-item {
85
- cursor: pointer;
86
- padding: 5px 0 5px 1rem;
87
- margin: 0 1rem !important;
88
- /* TODO: add: The import highlight color variable */
89
- color: #38b3f9;
90
- flex-shrink: 0;
91
- }
92
- .tree .toolbar .toolbar-item {
93
- display: none;
94
- }
95
- .schema-root-type {
96
- cursor:auto;
97
- color:var(--fg2);
98
- font-weight: bold;
99
- text-transform: uppercase;
100
- }
101
- .schema-root-type.xxx-of {
102
- display:none;
103
- }
104
- .toolbar-item:first-of-type { margin:0 2px 0 0;}
105
-
106
-
107
- @media only screen and (min-width: 576px) {
108
- .key-descr {
109
- display: block;
110
- }
111
- .tree .toolbar .toolbar-item {
112
- display: block;
113
- }
114
- .toolbar {
115
- display: flex;
116
- }
117
- .expanded-descr .key-descr{
118
- display: block;
119
- }
120
- }
121
- `;
@@ -1,44 +0,0 @@
1
- import { css } from 'lit-element';
2
-
3
- export default css`
4
- .tab-panel {
5
- border: none;
6
- }
7
- .tab-buttons {
8
- height:30px;
9
- border-bottom: 1px solid var(--light-border-color) ;
10
- align-items: stretch;
11
- overflow-y: hidden;
12
- overflow-x: auto;
13
- scrollbar-width: thin;
14
- }
15
- .tab-buttons::-webkit-scrollbar {
16
- height: 1px;
17
- background-color: var(--border-color);
18
- }
19
- .tab-btn {
20
- border: none;
21
- border-bottom: 3px solid transparent;
22
- color: var(--light-fg);
23
- background-color: transparent;
24
- white-space: nowrap;
25
- cursor: pointer;
26
- outline:none;
27
- font-family:var(--font-regular);
28
- font-size:var(--font-size-small);
29
- margin-right:16px;
30
- padding:1px;
31
- }
32
- .tab-btn.active {
33
- border-bottom: 3px solid var(--primary-color);
34
- font-weight:bold;
35
- color:var(--primary-color);
36
- }
37
-
38
- .tab-btn:hover {
39
- color:var(--primary-color);
40
- }
41
- .tab-content {
42
- position:relative;
43
- }
44
- `;
@@ -1,48 +0,0 @@
1
- import { css } from 'lit-element';
2
-
3
- export default css`
4
- .m-table {
5
- border-spacing: 0;
6
- border-collapse: separate;
7
- border: 1px solid var(--light-border-color);
8
- border-radius: var(--border-radius);
9
- margin: 0;
10
- max-width: 100%;
11
- }
12
- .m-table tr:first-child td,
13
- .m-table tr:first-child th {
14
- border-top: 0 none;
15
- }
16
- .m-table td,
17
- .m-table th {
18
- font-size: var(--font-size-small);
19
- padding: 4px 5px 4px;
20
- }
21
-
22
- .m-table td:not([align]),
23
- .m-table th:not([align]) {
24
- text-align: left;
25
- }
26
-
27
- .m-table th {
28
- color: var(--fg2);
29
- font-size: var(--font-size-small);
30
- line-height: calc(var(--font-size-small) + 18px);
31
- font-weight: 600;
32
- letter-spacing: normal;
33
- background-color: var(--bg2);
34
- vertical-align: bottom;
35
- border-bottom: 1px solid var(--light-border-color);
36
- }
37
-
38
- .m-table > tbody > tr > td,
39
- .m-table > tr > td {
40
- border-top: 1px solid var(--light-border-color);
41
- }
42
- .table-title {
43
- font-size:var(--font-size-small);
44
- font-weight:bold;
45
- vertical-align: middle;
46
- margin: 12px 0 4px 0;
47
- }
48
- `;
@@ -1,81 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- /* eslint-disable indent */
4
- export default function searchByPropertiesModalTemplate() {
5
- const keyDownEventListenerAdvancedSearch = (e) => {
6
- if ((e.detail && e.detail.code || e.code) === 'Escape') {
7
- this.showAdvancedSearchDialog = false;
8
- }
9
- };
10
-
11
- const closeAdvancedSearchDialog = () => {
12
- // Trigger the event to force it to be removed from the DOM
13
- document.dispatchEvent(new CustomEvent('keydown', { detail: { code: 'Escape' } }));
14
- document.removeEventListener('keydown', keyDownEventListenerAdvancedSearch, { once: true });
15
- };
16
-
17
- document.addEventListener('keydown', keyDownEventListenerAdvancedSearch, { once: true });
18
-
19
- return html`
20
- ${this.showAdvancedSearchDialog
21
- ? html`
22
- <div class="dialog-box-overlay">
23
- <div class="dialog-box">
24
- <header class="dialog-box-header">
25
- <span class="dialog-box-title">Advanced Search</span>
26
- <button class="m-btn thin-border" @click="${() => { closeAdvancedSearchDialog(); }}" part="btn btn-outline">&times;</button>
27
- </header>
28
- <div id="advanced-search-modal" class="dialog-box-content">
29
- <span class="advanced-search-options">
30
- <div class="advanced-search-dialog-input">
31
- <input id="advanced-search-dialog-input" type="text" part="textbox textbox-search-dialog" placeholder="search text..." spellcheck="false"
32
- @keyup = "${(e) => this.onAdvancedSearch(e, 400)}">
33
- </div>
34
- <div class="advanced-search-locations">
35
- <div>
36
- <input style="cursor: pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-path" checked @change = "${(e) => this.onAdvancedSearch(e, 0)}">
37
- <label style="cursor: pointer;" for="search-api-path"> API Path </label>
38
- </div>
39
- <div>
40
- <input style="cursor: pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-descr" checked @change = "${(e) => this.onAdvancedSearch(e, 0)}">
41
- <label style="cursor: pointer;" for="search-api-descr"> API Description </label>
42
- </div>
43
- <div>
44
- <input style="cursor: pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-params" @change = "${(e) => this.onAdvancedSearch(e, 0)}">
45
- <label style="cursor: pointer;" for="search-api-params"> Request Parameters </label>
46
- </div>
47
- <div>
48
- <input style="cursor: pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-request-body" @change = "${(e) => this.onAdvancedSearch(e, 0)}">
49
- <label style="cursor: pointer;" for="search-api-request-body"> Request Body </label>
50
- </div>
51
- <div>
52
- <input style="cursor: pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-resp-descr" @change = "${(e) => this.onAdvancedSearch(e, 0)}">
53
- <label style="cursor: pointer;" for="search-api-resp-descr"> Response Description </label>
54
- </div>
55
- </div>
56
- </span>
57
-
58
- <div class="advanced-search-results">
59
- ${this.advancedSearchMatches && this.advancedSearchMatches.map((path) => html`
60
- <div
61
- class="mono-font small-font-size hover-bg" tabindex = '0'
62
- style='padding: 5px; cursor: pointer; border-bottom: 1px solid var(--light-border-color); ${path.deprecated ? 'filter:opacity(0.5);' : ''}'
63
- data-content-id='${path.elementId}'
64
- @click="${(e) => {
65
- this.matchPaths = ''; // clear quick filter if applied
66
- closeAdvancedSearchDialog(); // Hide Search Dialog
67
- this.requestUpdate();
68
- this.scrollToEventTarget(e, true);
69
- }}">
70
- <span class="upper bold-text method-fg ${path.method}">${path.method}</span>
71
- <span>${path.path}</span> - <span class="regular-font gray-text">${path.summary}</span>
72
- </div>
73
- `)}
74
- </div>
75
- </div>
76
- </div>
77
- </div>`
78
- : ''
79
- }`;
80
- }
81
- /* eslint-enable indent */
@@ -1,63 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- /* eslint-disable indent */
4
- export default function callbackTemplate(callbacks) {
5
- return html`
6
- <div class="api-request col regular-font request-panel ${this.renderStyle}-mode">
7
- ${Object.entries(callbacks).map((kv) => html`
8
- <div class="${this.renderStyle}-request">
9
- <div class="req-res-title">CALLBACKS</div>
10
- <div class="table-title">${kv[0]}</div>
11
- ${Object.entries(kv[1]).map((pathObj) => html`
12
- <div class="mono-font small-font-size" style="display:flex;">
13
- <div style="width:100%">
14
- ${Object.entries(pathObj[1]).map((method) => html`
15
- <div>
16
- <div style="margin-top:12px;">
17
- <div class="method method-fg ${method[0]}" style="width:70px; border:none; margin:0; padding:0; line-height:20px; vertical-align: baseline;text-align:left">
18
- <span style="font-size:20px;"> &#x2944; </span>
19
- ${method[0]}
20
- </div>
21
- <span style="line-height:20px; vertical-align: baseline;">${pathObj[0]} </span>
22
- </div>
23
- <div class='expanded-req-resp-container'>
24
- <api-request class="request-panel"
25
- callback = "true"
26
- method = "${method[0] || ''}",
27
- path = "${pathObj[0] || ''}"
28
- .parameters = "${method[1] && method[1].parameters || ''}"
29
- .request_body = "${method[1] && method[1].requestBody || ''}"
30
- fill-defaults = "${this.fillRequestWithDefault}"
31
- enable-console = "false"
32
- render-style="${this.renderStyle}"
33
- schema-style = "${this.schemaStyle}"
34
- active-schema-tab = "${this.defaultSchemaTab}"
35
- schema-expand-level = "${this.schemaExpandLevel}"
36
- schema-description-expanded = "${this.schemaDescriptionExpanded}"
37
- schema-hide-read-only = "${this.schemaHideReadOnly}"
38
- fetch-credentials = "${this.fetchCredentials}"
39
- exportparts="btn btn-fill btn-outline btn-try">
40
- </api-request>
41
-
42
- <api-response
43
- callback = "true"
44
- .responses="${method[1] && method[1].responses}"
45
- render-style="${this.renderStyle}"
46
- schema-style="${this.schemaStyle}"
47
- active-schema-tab = "${this.defaultSchemaTab}"
48
- schema-expand-level = "${this.schemaExpandLevel}"
49
- schema-description-expanded = "${this.schemaDescriptionExpanded}"
50
- exportparts = "btn--resp btn-fill--resp btn-outline--resp"
51
- > </api-response>
52
- </div>
53
- </div>
54
- `)}
55
- </div>
56
- </div>
57
- `)}
58
- </div>
59
- `)}
60
- </div>
61
- `;
62
- }
63
- /* eslint-enable indent */
@@ -1,35 +0,0 @@
1
- import { html } from 'lit-element';
2
- import { unsafeHTML } from 'lit-html/directives/unsafe-html';
3
- import Prism from 'prismjs';
4
- import { copyToClipboard } from '../utils/common-utils';
5
-
6
- /* eslint-disable indent */
7
- export default function codeSamplesTemplate(xCodeSamples) {
8
- return html`
9
- <section class="table-title top-gap"> CODE SAMPLES </div>
10
- <div class="tab-panel col"
11
- @click="${
12
- (e) => {
13
- if (!e.target.classList.contains('tab-btn')) { return; }
14
- const clickedTab = e.target.dataset.tab;
15
-
16
- const tabButtons = [...e.currentTarget.querySelectorAll('.tab-btn')];
17
- const tabContents = [...e.currentTarget.querySelectorAll('.tab-content')];
18
- tabButtons.forEach((tabBtnEl) => tabBtnEl.classList[tabBtnEl.dataset.tab === clickedTab ? 'add' : 'remove']('active'));
19
- tabContents.forEach((tabBodyEl) => { tabBodyEl.style.display = (tabBodyEl.dataset.tab === clickedTab ? 'block' : 'none'); });
20
- }
21
- }">
22
- <div class="tab-buttons row" style="width:100; overflow">
23
- ${xCodeSamples.map((v, i) => html`<button class="tab-btn ${i === 0 ? 'active' : ''}" data-tab = '${v.lang}${i}'> ${v.label || v.lang} </button>`)}
24
- </div>
25
- ${xCodeSamples.map((v, i) => html`
26
- <div class="tab-content m-markdown code-sample-wrapper" style= "display:${i === 0 ? 'block' : 'none'}" data-tab = '${v.lang}${i}'>
27
- <button class="toolbar-copy-btn" @click='${(e) => { copyToClipboard(v.source, e); }}'>Copy</button>
28
- <pre>
29
- <code>${Prism.languages[v.lang && v.lang.toLowerCase()] ? unsafeHTML(Prism.highlight(v.source, Prism.languages[v.lang && v.lang.toLowerCase()], v.lang && v.lang.toLowerCase())) : v.source}</code>
30
- </pre>
31
- </div>`)
32
- }
33
- </section>`;
34
- }
35
- /* eslint-enable indent */
@@ -1,43 +0,0 @@
1
- /* eslint-disable no-console */
2
- import { schemaInObjectNotation } from '../utils/schema-utils';
3
- import { html } from 'lit-element';
4
- import { unsafeHTML } from 'lit-html/directives/unsafe-html';
5
- import { marked } from 'marked';
6
- import '../components/json-tree';
7
- import '../components/schema-tree';
8
-
9
- function componentBodyTemplate(sComponent) {
10
- const formdataPartSchema = schemaInObjectNotation(sComponent.component, {});
11
-
12
- return html`
13
- <div class='expanded-endpoint-body observe-me ${sComponent.name}' id='cmp--${sComponent.id}' >
14
- <h2>${sComponent.name}</h2>
15
- <div class='mono-font regular-font-size' style='padding: 8px 0; color:var(--fg2)'>
16
- <schema-tree
17
- .data = '${formdataPartSchema}'
18
- schema-expand-level = "${this.schemaExpandLevel}"
19
- schema-description-expanded = "${this.schemaDescriptionExpanded}"
20
- schema-hide-read-only=false
21
- schema-hide-write-only=false> </schema-tree>
22
- </div>
23
- </div>
24
- `;
25
- }
26
-
27
- export default function componentsTemplate() {
28
- return html`
29
- ${this.resolvedSpec.components.map((component) => html`
30
- <div id="cmp--${component.name.toLowerCase()}" class='regular-font section-gap--read-mode observe-me' style="border-top:1px solid var(--primary-color);">
31
- <div class="title tag">${component.name}</div>
32
- <div class="regular-font-size">
33
- ${unsafeHTML(`<div class='m-markdown regular-font'>${marked(component.description ? component.description : '')}</div>`)}
34
- </div>
35
- </div>
36
- <div class='regular-font section-gap--read-mode'>
37
- ${component.subComponents.filter(c => c.expanded).map((sComponent) => componentBodyTemplate.call(this, sComponent))}
38
- </div>
39
- `)
40
- }
41
- `;
42
- }
43
- /* eslint-enable indent */