rapidoc 9.3.3 → 9.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflow/words.yaml +22 -0
- package/README.md +2 -7
- package/dist/index.html +1 -1
- package/dist/index.html.gz +0 -0
- package/dist/rapidoc-min.js +858 -748
- package/dist/rapidoc-min.js.LICENSE.txt +14 -9
- package/dist/rapidoc-min.js.LICENSE.txt.gz +0 -0
- package/dist/rapidoc-min.js.gz +0 -0
- package/dist/rapidoc-min.js.map +1 -1
- package/dist/rapidoc-min.js.map.gz +0 -0
- package/dist/rapidoc.js +11948 -32008
- package/dist/report.html +6 -5
- package/index.html +2 -1
- package/package.json +25 -24
- package/src/components/api-request.js +266 -122
- package/src/components/api-response.js +11 -10
- package/src/components/json-tree.js +17 -12
- package/src/components/schema-table.js +58 -49
- package/src/components/schema-tree.js +60 -56
- package/src/components/tag-input.js +7 -4
- package/src/json-schema-viewer.js +2 -1
- package/src/rapidoc-mini.js +1 -1
- package/src/rapidoc.js +108 -35
- package/src/styles/endpoint-styles.js +1 -1
- package/src/styles/info-styles.js +2 -1
- package/src/styles/input-styles.js +2 -16
- package/src/styles/nav-styles.js +57 -10
- package/src/styles/schema-styles.js +27 -15
- package/src/styles/tab-styles.js +1 -0
- package/src/templates/advance-search-template.js +3 -3
- package/src/templates/callback-template.js +3 -3
- package/src/templates/code-samples-template.js +1 -0
- package/src/templates/components-template.js +3 -5
- package/src/templates/endpoint-template.js +39 -26
- package/src/templates/expanded-endpoint-template.js +58 -9
- package/src/templates/focused-endpoint-template.js +5 -2
- package/src/templates/header-template.js +2 -2
- package/src/templates/json-schema-viewer-template.js +2 -1
- package/src/templates/main-body-template.js +19 -18
- package/src/templates/navbar-template.js +99 -82
- package/src/templates/overview-template.js +1 -1
- package/src/templates/security-scheme-template.js +51 -27
- package/src/templates/server-template.js +1 -1
- package/src/utils/common-utils.js +2 -2
- package/src/utils/schema-utils.js +192 -67
- package/src/utils/spec-parser.js +9 -3
- package/src/utils/theme.js +9 -3
- package/webpack.config.js +2 -1
|
@@ -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-
|
|
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"
|
|
@@ -12,14 +12,14 @@ function toggleExpand(path) {
|
|
|
12
12
|
if (path.expanded) {
|
|
13
13
|
path.expanded = false; // collapse
|
|
14
14
|
if (this.updateRoute === 'true') {
|
|
15
|
-
|
|
15
|
+
this.replaceHistoryState('');
|
|
16
16
|
}
|
|
17
17
|
} else {
|
|
18
18
|
path.expanded = true; // Expand
|
|
19
19
|
if (this.updateRoute === 'true') {
|
|
20
20
|
const newHash = `${this.routePrefix || '#'}${path.elementId}`;
|
|
21
21
|
if (window.location.hash !== newHash) {
|
|
22
|
-
|
|
22
|
+
this.replaceHistoryState(path.elementId);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -109,6 +109,18 @@ function endpointBodyTemplate(path) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
${path.description ? html`<div part="section-endpoint-body-description" class="m-markdown"> ${unsafeHTML(marked(path.description))}</div>` : ''}
|
|
112
|
+
${path.externalDocs?.url || path.externalDocs?.description
|
|
113
|
+
? html`<div style="background-color:var(--bg3); padding:2px 8px 8px 8px; margin:8px 0; border-radius:var(--border-radius)">
|
|
114
|
+
<div class="m-markdown"> ${unsafeHTML(marked(path.externalDocs?.description || ''))} </div>
|
|
115
|
+
${path.externalDocs?.url
|
|
116
|
+
? html`<a style="font-family:var(--font-mono); font-size:var(--font-size-small)" href="${path.externalDocs?.url}" target="_blank">
|
|
117
|
+
${path.externalDocs?.url} <div style="transform: rotate(270deg) scale(1.5); display: inline-block; margin-left:5px">⇲</div>
|
|
118
|
+
</a>`
|
|
119
|
+
: ''
|
|
120
|
+
}
|
|
121
|
+
</div>`
|
|
122
|
+
: ''
|
|
123
|
+
}
|
|
112
124
|
<slot name="${path.elementId}"></slot>
|
|
113
125
|
${pathSecurityTemplate.call(this, path.security)}
|
|
114
126
|
${codeSampleTabPanel}
|
|
@@ -119,7 +131,7 @@ function endpointBodyTemplate(path) {
|
|
|
119
131
|
class = "${this.renderStyle}-mode ${this.layout}-layout"
|
|
120
132
|
style = "width:100%;"
|
|
121
133
|
webhook = "${path.isWebhook}"
|
|
122
|
-
method = "${path.method}"
|
|
134
|
+
method = "${path.method}"
|
|
123
135
|
path = "${path.path}"
|
|
124
136
|
.security = "${path.security}"
|
|
125
137
|
.parameters = "${path.parameters}"
|
|
@@ -130,6 +142,7 @@ function endpointBodyTemplate(path) {
|
|
|
130
142
|
active-schema-tab = "${this.defaultSchemaTab}"
|
|
131
143
|
fill-request-fields-with-example = "${this.fillRequestFieldsWithExample}"
|
|
132
144
|
allow-try = "${this.allowTry}"
|
|
145
|
+
show-curl-before-try = "${this.showCurlBeforeTry}"
|
|
133
146
|
accept = "${accept}"
|
|
134
147
|
render-style="${this.renderStyle}"
|
|
135
148
|
schema-style = "${this.schemaStyle}"
|
|
@@ -139,33 +152,33 @@ function endpointBodyTemplate(path) {
|
|
|
139
152
|
schema-hide-read-only = "${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}"
|
|
140
153
|
schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}"
|
|
141
154
|
fetch-credentials = "${this.fetchCredentials}"
|
|
142
|
-
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,
|
|
155
|
+
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,
|
|
143
156
|
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
144
157
|
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
145
|
-
|
|
158
|
+
> </api-request>
|
|
146
159
|
|
|
147
160
|
${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}
|
|
148
|
-
|
|
161
|
+
</div>
|
|
149
162
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
<api-response
|
|
164
|
+
class = "${this.renderStyle}-mode"
|
|
165
|
+
style = "width:100%;"
|
|
166
|
+
webhook = "${path.isWebhook}"
|
|
167
|
+
.responses="${path.responses}"
|
|
168
|
+
active-schema-tab = "${this.defaultSchemaTab}"
|
|
169
|
+
render-style="${this.renderStyle}"
|
|
170
|
+
schema-style="${this.schemaStyle}"
|
|
171
|
+
schema-expand-level = "${this.schemaExpandLevel}"
|
|
172
|
+
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
173
|
+
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
174
|
+
schema-hide-read-only = "${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}"
|
|
175
|
+
schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}"
|
|
176
|
+
selected-status = "${Object.keys(path.responses || {})[0] || ''}"
|
|
177
|
+
exportparts = "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, file-input:file-input,
|
|
178
|
+
textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, anchor:anchor, anchor-param-example:anchor-param-example, btn-clear-resp:btn-clear-resp,
|
|
179
|
+
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
180
|
+
> </api-response>
|
|
181
|
+
</div>
|
|
169
182
|
</div>`;
|
|
170
183
|
}
|
|
171
184
|
|
|
@@ -191,7 +204,7 @@ export default function endpointTemplate(showExpandCollapse = true, showTags = t
|
|
|
191
204
|
? html`
|
|
192
205
|
<div class='regular-font section-gap section-tag ${tag.expanded ? 'expanded' : 'collapsed'}'>
|
|
193
206
|
<div class='section-tag-header' @click="${() => { tag.expanded = !tag.expanded; this.requestUpdate(); }}">
|
|
194
|
-
<div id='${tag.elementId}' class="sub-title tag" style="color:var(--primary-color)">${tag.
|
|
207
|
+
<div id='${tag.elementId}' class="sub-title tag" style="color:var(--primary-color)">${tag.displayName}</div>
|
|
195
208
|
</div>
|
|
196
209
|
<div class='section-tag-body'>
|
|
197
210
|
<slot name="${tag.elementId}"></slot>
|
|
@@ -15,7 +15,24 @@ function headingRenderer(tagElementId) {
|
|
|
15
15
|
return renderer;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
function expandCollapseTagDescription(e) {
|
|
19
|
+
const tagDescriptionEl = e.target.closest('.tag-container').querySelector('.tag-description');
|
|
20
|
+
const tagIconEl = e.target.closest('.tag-container').querySelector('.tag-icon');
|
|
21
|
+
if (tagDescriptionEl && tagIconEl) {
|
|
22
|
+
const isExpanded = tagDescriptionEl.classList.contains('expanded');
|
|
23
|
+
if (isExpanded) {
|
|
24
|
+
tagDescriptionEl.style.maxHeight = 0;
|
|
25
|
+
tagDescriptionEl.classList.replace('expanded', 'collapsed');
|
|
26
|
+
tagIconEl.classList.replace('expanded', 'collapsed');
|
|
27
|
+
} else {
|
|
28
|
+
tagDescriptionEl.style.maxHeight = `${tagDescriptionEl.scrollHeight}px`;
|
|
29
|
+
tagDescriptionEl.classList.replace('collapsed', 'expanded');
|
|
30
|
+
tagIconEl.classList.replace('collapsed', 'expanded');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') {
|
|
19
36
|
const acceptContentTypes = new Set();
|
|
20
37
|
for (const respStatus in path.responses) {
|
|
21
38
|
for (const acceptContentType in (path.responses[respStatus]?.content)) {
|
|
@@ -37,7 +54,26 @@ export function expandedEndpointBodyTemplate(path, tagName = '') {
|
|
|
37
54
|
return html`
|
|
38
55
|
${this.renderStyle === 'read' ? html`<div class='divider' part="operation-divider"></div>` : ''}
|
|
39
56
|
<div class='expanded-endpoint-body observe-me ${path.method} ${path.deprecated ? 'deprecated' : ''} ' part="section-operation ${path.elementId}" id='${path.elementId}'>
|
|
40
|
-
${(this.renderStyle === 'focused' && tagName !== 'General ⦂')
|
|
57
|
+
${(this.renderStyle === 'focused' && tagName !== 'General ⦂')
|
|
58
|
+
? html`
|
|
59
|
+
<div class="tag-container" part="section-operation-tag">
|
|
60
|
+
<span class="upper" style="font-weight:bold; font-size:18px;"> ${tagName} </span>
|
|
61
|
+
${tagDescription
|
|
62
|
+
? html`
|
|
63
|
+
<svg class="tag-icon collapsed" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" fill="none" style="stroke:var(--primary-color); vertical-align:top; cursor:pointer"
|
|
64
|
+
@click="${(e) => { expandCollapseTagDescription.call(this, e); }}"
|
|
65
|
+
>
|
|
66
|
+
<path d="M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h8"></path><path d="M18 4v17"></path><path d="M15 18l3 3l3 -3"></path>
|
|
67
|
+
</svg>
|
|
68
|
+
<div class="tag-description collapsed" style="max-height:0px; overflow:hidden; margin-top:16px; border:1px solid var(--border-color)">
|
|
69
|
+
<div class="m-markdown" style="padding:8px"> ${unsafeHTML(marked(tagDescription))}</div>
|
|
70
|
+
</div>`
|
|
71
|
+
: ''
|
|
72
|
+
}
|
|
73
|
+
</div>
|
|
74
|
+
`
|
|
75
|
+
: ''
|
|
76
|
+
}
|
|
41
77
|
${path.deprecated ? html`<div class="bold-text red-text"> DEPRECATED </div>` : ''}
|
|
42
78
|
${html`
|
|
43
79
|
${path.xBadges && path.xBadges?.length > 0
|
|
@@ -53,10 +89,10 @@ export function expandedEndpointBodyTemplate(path, tagName = '') {
|
|
|
53
89
|
}
|
|
54
90
|
<h2 part="section-operation-summary"> ${path.shortSummary || `${path.method.toUpperCase()} ${path.path}`}</h2>
|
|
55
91
|
${path.isWebhook
|
|
56
|
-
? html`<span part="section-operation-webhook style="color:var(--primary-color); font-weight:bold; font-size: var(--font-size-regular);"> WEBHOOK </span>`
|
|
92
|
+
? html`<span part="section-operation-webhook" style="color:var(--primary-color); font-weight:bold; font-size: var(--font-size-regular);"> WEBHOOK </span>`
|
|
57
93
|
: html`
|
|
58
|
-
<div
|
|
59
|
-
<span part="label-operation-method" class=
|
|
94
|
+
<div part="section-operation-webhook-method" class="mono-font regular-font-size" style="text-align:left; direction:ltr; padding: 8px 0; color:var(--fg3)">
|
|
95
|
+
<span part="label-operation-method" class="regular-font upper method-fg bold-text ${path.method}">${path.method}</span>
|
|
60
96
|
<span part="label-operation-path">${path.path}</span>
|
|
61
97
|
</div>
|
|
62
98
|
`
|
|
@@ -65,6 +101,18 @@ export function expandedEndpointBodyTemplate(path, tagName = '') {
|
|
|
65
101
|
}
|
|
66
102
|
${path.description ? html`<div class="m-markdown"> ${unsafeHTML(marked(path.description))}</div>` : ''}
|
|
67
103
|
${pathSecurityTemplate.call(this, path.security)}
|
|
104
|
+
${path.externalDocs?.url || path.externalDocs?.description
|
|
105
|
+
? html`<div style="background-color:var(--bg3); padding:2px 8px 8px 8px; margin:8px 0; border-radius:var(--border-radius)">
|
|
106
|
+
<div class="m-markdown"> ${unsafeHTML(marked(path.externalDocs?.description || ''))} </div>
|
|
107
|
+
${path.externalDocs?.url
|
|
108
|
+
? html`<a style="font-family:var(--font-mono); font-size:var(--font-size-small)" href="${path.externalDocs?.url}" target="_blank">
|
|
109
|
+
${path.externalDocs?.url} <div style="transform: rotate(270deg) scale(1.5); display: inline-block; margin-left:5px">⇲</div>
|
|
110
|
+
</a>`
|
|
111
|
+
: ''
|
|
112
|
+
}
|
|
113
|
+
</div>`
|
|
114
|
+
: ''
|
|
115
|
+
}
|
|
68
116
|
${codeSampleTabPanel}
|
|
69
117
|
<div class='expanded-req-resp-container'>
|
|
70
118
|
<api-request
|
|
@@ -81,6 +129,7 @@ export function expandedEndpointBodyTemplate(path, tagName = '') {
|
|
|
81
129
|
server-url = "${path.servers?.[0]?.url || this.selectedServer.computedUrl}"
|
|
82
130
|
fill-request-fields-with-example = "${this.fillRequestFieldsWithExample}"
|
|
83
131
|
allow-try = "${this.allowTry}"
|
|
132
|
+
show-curl-before-try = "${this.showCurlBeforeTry}"
|
|
84
133
|
accept = "${accept}"
|
|
85
134
|
render-style="${this.renderStyle}"
|
|
86
135
|
schema-style = "${this.schemaStyle}"
|
|
@@ -91,7 +140,7 @@ export function expandedEndpointBodyTemplate(path, tagName = '') {
|
|
|
91
140
|
schema-hide-read-only = "${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}"
|
|
92
141
|
schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}"
|
|
93
142
|
fetch-credentials = "${this.fetchCredentials}"
|
|
94
|
-
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,
|
|
143
|
+
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,
|
|
95
144
|
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
96
145
|
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
|
|
97
146
|
> </api-request>
|
|
@@ -125,7 +174,7 @@ export default function expandedEndpointTemplate() {
|
|
|
125
174
|
return html`
|
|
126
175
|
${this.resolvedSpec.tags.map((tag) => html`
|
|
127
176
|
<section id="${tag.elementId}" part="section-tag" class="regular-font section-gap--read-mode observe-me" style="border-top:1px solid var(--primary-color);">
|
|
128
|
-
<div class="title tag" part="section-tag-title label-tag-title">${tag.
|
|
177
|
+
<div class="title tag" part="section-tag-title label-tag-title">${tag.displayName}</div>
|
|
129
178
|
<slot name="${tag.elementId}"></slot>
|
|
130
179
|
<div class="regular-font-size">
|
|
131
180
|
${
|
|
@@ -136,8 +185,8 @@ export default function expandedEndpointTemplate() {
|
|
|
136
185
|
}
|
|
137
186
|
</div>
|
|
138
187
|
</section>
|
|
139
|
-
<section class=
|
|
140
|
-
${tag.paths.map((path) => expandedEndpointBodyTemplate.call(this, path
|
|
188
|
+
<section class="regular-font section-gap--read-mode" part="section-operations-in-tag">
|
|
189
|
+
${tag.paths.map((path) => expandedEndpointBodyTemplate.call(this, path))}
|
|
141
190
|
</section>
|
|
142
191
|
`)
|
|
143
192
|
}
|
|
@@ -38,7 +38,7 @@ function defaultContentTemplate() {
|
|
|
38
38
|
/* eslint-disable indent */
|
|
39
39
|
function focusedTagBodyTemplate(tag) {
|
|
40
40
|
return html`
|
|
41
|
-
<h1 id="${tag.elementId}">${tag.
|
|
41
|
+
<h1 id="${tag.elementId}">${tag.displayName}</h1>
|
|
42
42
|
${this.onNavTagClick === 'show-description' && tag.description
|
|
43
43
|
? html`
|
|
44
44
|
<div class="m-markdown">
|
|
@@ -96,7 +96,10 @@ export default function focusedEndpointTemplate() {
|
|
|
96
96
|
// In focused mode we must expand the nav-bar tag element if it is collapsed
|
|
97
97
|
const newNavEl = this.shadowRoot.getElementById(`link-${focusElId}`);
|
|
98
98
|
expandCollapseNavBarTag(newNavEl, 'expand');
|
|
99
|
-
focusedTemplate = wrapFocusedTemplate.call(
|
|
99
|
+
focusedTemplate = wrapFocusedTemplate.call(
|
|
100
|
+
this,
|
|
101
|
+
expandedEndpointBodyTemplate.call(this, selectedPathObj, (selectedTagObj.name || ''), (selectedTagObj.description || '')),
|
|
102
|
+
);
|
|
100
103
|
} else {
|
|
101
104
|
// if focusedElementId is not found then show the default content (overview or first-path)
|
|
102
105
|
focusedTemplate = defaultContentTemplate.call(this);
|
|
@@ -23,7 +23,7 @@ export default function headerTemplate() {
|
|
|
23
23
|
part="textbox textbox-spec-url"
|
|
24
24
|
placeholder="Spec URL"
|
|
25
25
|
value="${this.specUrl || ''}"
|
|
26
|
-
@change="${this.
|
|
26
|
+
@change="${this.onSpecUrlChange}"
|
|
27
27
|
spellcheck="false"
|
|
28
28
|
>
|
|
29
29
|
<div style="margin: 6px 5px 0 -24px; font-size:var(--font-size-regular); cursor:pointer;">↩</div>
|
|
@@ -37,7 +37,7 @@ export default function headerTemplate() {
|
|
|
37
37
|
type="file"
|
|
38
38
|
style="display:none"
|
|
39
39
|
value="${this.specFile || ''}"
|
|
40
|
-
@change="${this.
|
|
40
|
+
@change="${this.onSpecFileChange}"
|
|
41
41
|
spellcheck="false"
|
|
42
42
|
>
|
|
43
43
|
<button class="m-btn primary only-large-screen" style="margin-left:10px;" part="btn btn-fill" @click="${this.onFileLoadClick}"> LOCAL JSON FILE </button>
|
|
@@ -63,7 +63,7 @@ function jsonSchemaBodyTemplate() {
|
|
|
63
63
|
.data = "${schemaInObjectNotation(jSchemaBody.schema, {})}"
|
|
64
64
|
schema-expand-level = "${this.schemaExpandLevel}"
|
|
65
65
|
schema-description-expanded = "${this.schemaDescriptionExpanded}"
|
|
66
|
-
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
66
|
+
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
|
|
67
67
|
schema-hide-read-only = "false"
|
|
68
68
|
schema-hide-write-only = "false"
|
|
69
69
|
> </schema-tree>
|
|
@@ -113,6 +113,7 @@ export default function jsonSchemaViewerTemplate(isMini = false) {
|
|
|
113
113
|
navHoverBgColor: isValidHexColor(this.navHoverBgColor) ? this.navHoverBgColor : '',
|
|
114
114
|
navHoverTextColor: isValidHexColor(this.navHoverTextColor) ? this.navHoverTextColor : '',
|
|
115
115
|
navAccentColor: isValidHexColor(this.navAccentColor) ? this.navAccentColor : '',
|
|
116
|
+
navAccenttextColor: isValidHexColor(this.navAccentTextColor) ? this.navAccentTextColor : '',
|
|
116
117
|
};
|
|
117
118
|
/* eslint-disable indent */
|
|
118
119
|
if (this.resolvedSpec.specLoadError) {
|
|
@@ -30,24 +30,25 @@ export default function mainBodyTemplate(isMini = false, showExpandCollapse = tr
|
|
|
30
30
|
navHoverBgColor: isValidHexColor(this.navHoverBgColor) ? this.navHoverBgColor : '',
|
|
31
31
|
navHoverTextColor: isValidHexColor(this.navHoverTextColor) ? this.navHoverTextColor : '',
|
|
32
32
|
navAccentColor: isValidHexColor(this.navAccentColor) ? this.navAccentColor : '',
|
|
33
|
+
navAccentTextColor: isValidHexColor(this.navAccentTextColor) ? this.navAccentTextColor : '',
|
|
33
34
|
};
|
|
34
35
|
/* eslint-disable indent */
|
|
35
36
|
if (this.resolvedSpec.specLoadError) {
|
|
36
37
|
if (isMini) {
|
|
37
38
|
return html`
|
|
38
39
|
${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}
|
|
39
|
-
<div style=
|
|
40
|
+
<div style='display:flex; align-items:center; border:1px dashed var(--border-color); height:42px; padding:5px; font-size:var(--font-size-small); color:var(--red); font-family:var(--font-mono)'> ${this.resolvedSpec.info.description} </div>
|
|
40
41
|
`;
|
|
41
42
|
}
|
|
42
43
|
return html`
|
|
43
44
|
${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}
|
|
44
45
|
<!-- Header -->
|
|
45
46
|
${headerTemplate.call(this)}
|
|
46
|
-
<main class=
|
|
47
|
+
<main class='main-content regular-font' part='section-main-content'>
|
|
47
48
|
<slot></slot>
|
|
48
|
-
<div style=
|
|
49
|
-
<h1 style=
|
|
50
|
-
<div style=
|
|
49
|
+
<div style='margin:24px; text-align: center;'>
|
|
50
|
+
<h1 style='color: var(--red)'> ${this.resolvedSpec.info.title} </h1>
|
|
51
|
+
<div style='font-family:var(--font-mono)'> ${this.resolvedSpec.info.description} </div>
|
|
51
52
|
</div>
|
|
52
53
|
</main>
|
|
53
54
|
`;
|
|
@@ -55,12 +56,12 @@ export default function mainBodyTemplate(isMini = false, showExpandCollapse = tr
|
|
|
55
56
|
if (this.resolvedSpec.isSpecLoading) {
|
|
56
57
|
return html`
|
|
57
58
|
${this.theme === 'dark' ? SetTheme.call(this, 'dark', newTheme) : SetTheme.call(this, 'light', newTheme)}
|
|
58
|
-
<main class=
|
|
59
|
+
<main class='main-content regular-font' part='section-main-content'>
|
|
59
60
|
<slot></slot>
|
|
60
|
-
<div class=
|
|
61
|
-
<div class=
|
|
61
|
+
<div class='main-content-inner--${this.renderStyle}-mode'>
|
|
62
|
+
<div class='loader'></div>
|
|
62
63
|
</div>
|
|
63
|
-
</main>
|
|
64
|
+
</main>
|
|
64
65
|
`;
|
|
65
66
|
}
|
|
66
67
|
|
|
@@ -73,7 +74,7 @@ export default function mainBodyTemplate(isMini = false, showExpandCollapse = tr
|
|
|
73
74
|
<!-- Advanced Search -->
|
|
74
75
|
${this.allowAdvancedSearch === 'false' ? '' : advancedSearchTemplate.call(this)}
|
|
75
76
|
|
|
76
|
-
<div id='the-main-body' class=
|
|
77
|
+
<div id='the-main-body' class='body ${this.cssClasses}' dir='${this.pageDirection}' >
|
|
77
78
|
<!-- Side Nav -->
|
|
78
79
|
${((this.renderStyle === 'read' || this.renderStyle === 'focused')
|
|
79
80
|
&& this.showSideNav === 'true'
|
|
@@ -82,24 +83,24 @@ export default function mainBodyTemplate(isMini = false, showExpandCollapse = tr
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
<!-- Main Content -->
|
|
85
|
-
<main class=
|
|
86
|
+
<main class='main-content regular-font' tabindex='-1' part='section-main-content'>
|
|
86
87
|
<slot></slot>
|
|
87
|
-
<div class=
|
|
88
|
+
<div class='main-content-inner--${this.renderStyle}-mode'>
|
|
88
89
|
${this.loading === true
|
|
89
|
-
? html`<div class=
|
|
90
|
+
? html`<div class='loader'></div>`
|
|
90
91
|
: html`
|
|
91
92
|
${this.loadFailed === true
|
|
92
|
-
? html`<div style=
|
|
93
|
+
? html`<div style='text-align: center;margin: 16px;'> Unable to load the Spec</div>`
|
|
93
94
|
: html`
|
|
94
|
-
<div class=
|
|
95
|
+
<div class='operations-root' @click='${(e) => { this.handleHref(e); }}'>
|
|
95
96
|
${this.renderStyle === 'focused'
|
|
96
97
|
? html`${focusedEndpointTemplate.call(this)}`
|
|
97
98
|
: html`
|
|
98
99
|
${this.showInfo === 'true' ? overviewTemplate.call(this) : ''}
|
|
99
100
|
${this.allowServerSelection === 'true' ? serverTemplate.call(this) : ''}
|
|
100
101
|
${this.allowAuthentication === 'true' ? securitySchemeTemplate.call(this) : ''}
|
|
101
|
-
<div id=
|
|
102
|
-
<slot name=
|
|
102
|
+
<div id='operations-top' class='observe-me'>
|
|
103
|
+
<slot name='operations-top'></slot>
|
|
103
104
|
</div>
|
|
104
105
|
${this.renderStyle === 'read'
|
|
105
106
|
? expandedEndpointTemplate.call(this)
|
|
@@ -112,7 +113,7 @@ export default function mainBodyTemplate(isMini = false, showExpandCollapse = tr
|
|
|
112
113
|
}`
|
|
113
114
|
}
|
|
114
115
|
</div>
|
|
115
|
-
<slot name=
|
|
116
|
+
<slot name='footer'></slot>
|
|
116
117
|
</main>
|
|
117
118
|
</div>
|
|
118
119
|
`;
|