diff --git a/src/components/api-request.js b/src/components/api-request.js index 97784e06..53316278 100644 --- a/src/components/api-request.js +++ b/src/components/api-request.js @@ -403,6 +403,9 @@ export default class ApiRequest extends LitElement { allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}", schema-hide-read-only = "${this.schemaHideReadOnly.includes(this.method)}" schema-hide-write-only = "${this.schemaHideWriteOnly.includes(this.method)}" + 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, + file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, + anchor:anchor, anchor-param-example:anchor-param-example" > ` } @@ -649,6 +652,7 @@ export default class ApiRequest extends LitElement { allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}", schema-hide-read-only = "${this.schemaHideReadOnly}" schema-hide-write-only = "${this.schemaHideWriteOnly}" + exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" > `; } else if (this.schemaStyle === 'tree') { @@ -663,6 +667,7 @@ export default class ApiRequest extends LitElement { allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}", schema-hide-read-only = "${this.schemaHideReadOnly}" schema-hide-write-only = "${this.schemaHideWriteOnly}" + exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" > `; } diff --git a/src/components/schema-table.js b/src/components/schema-table.js index ed1be1b8..fa984b73 100644 --- a/src/components/schema-table.js +++ b/src/components/schema-table.js @@ -92,7 +92,7 @@ export default class SchemaTable extends LitElement { ${this.allowSchemaDescriptionExpandToggle === 'true' ? html`
-
+
${this.schemaDescriptionExpanded === 'true' ? 'Single line description' : 'Multiline description'}
` @@ -100,7 +100,7 @@ export default class SchemaTable extends LitElement { }
${this.data?.['::description'] - ? html` ${unsafeHTML(marked(this.data['::description'] || ''))}` + ? html` ${unsafeHTML(marked(this.data['::description'] || ''))}` : '' }
diff --git a/src/components/schema-tree.js b/src/components/schema-tree.js index 3f32b573..8fd30c33 100644 --- a/src/components/schema-tree.js +++ b/src/components/schema-tree.js @@ -107,7 +107,7 @@ export default class SchemaTree extends LitElement { ${this.allowSchemaDescriptionExpandToggle === 'true' ? html`
-
+
${this.schemaDescriptionExpanded === 'true' ? 'Single line description' : 'Multiline description'}
` @@ -115,7 +115,7 @@ export default class SchemaTree extends LitElement { }
${this.data?.['::description'] - ? html` ${unsafeHTML(marked(this.data['::description'] || ''))}` + ? html` ${unsafeHTML(marked(this.data['::description'] || ''))}` : '' } ${this.data diff --git a/src/templates/callback-template.js b/src/templates/callback-template.js index dbd5d96f..fe3b7983 100644 --- a/src/templates/callback-template.js +++ b/src/templates/callback-template.js @@ -42,7 +42,7 @@ export default function callbackTemplate(callbacks) { fetch-credentials = "${this.fetchCredentials}" 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, file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, - anchor:anchor, anchor-param-example:anchor-param-example" + anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" >
diff --git a/src/templates/components-template.js b/src/templates/components-template.js index be3b9b2c..bd5601c3 100644 --- a/src/templates/components-template.js +++ b/src/templates/components-template.js @@ -21,6 +21,7 @@ function schemaBodyTemplate(sComponent) { allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}", schema-hide-read-only = "false" schema-hide-write-only = "${this.schemaHideWriteOnly}" + exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" > ` : html` ` } `; diff --git a/src/templates/endpoint-template.js b/src/templates/endpoint-template.js index 3eab4030..75f3ecf3 100644 --- a/src/templates/endpoint-template.js +++ b/src/templates/endpoint-template.js @@ -46,9 +46,9 @@ function onExpandCollapseAll(e, action = 'expand-all') { /* eslint-disable indent */ function endpointHeadTemplate(path, pathsExpanded = false) { return html` - -
${path.method}
-
+ +
${path.method}
+
${path.path} ${path.isWebhook ? html` Webhook` : ''}
@@ -62,7 +62,7 @@ function endpointHeadTemplate(path, pathsExpanded = false) { ${this.showSummaryWhenCollapsed ? html`
-
${path.summary || path.shortSummary}
` +
${path.summary || path.shortSummary}
` : '' }
@@ -88,19 +88,19 @@ function endpointBodyTemplate(path) { const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate(path.xCodeSamples) : ''; return html` -
+
${path.summary - ? html`
${path.summary}
` + ? html`
${path.summary}
` : path.shortSummary !== path.description - ? html`
${path.shortSummary}
` + ? html`
${path.shortSummary}
` : '' } ${path.xBadges && path.xBadges?.length > 0 ? html`
${path.xBadges.map((v) => ( - html`${v.label}` + html`${v.label}` )) }
@@ -108,7 +108,7 @@ function endpointBodyTemplate(path) { : '' } - ${path.description ? html`
${unsafeHTML(marked(path.description))}
` : ''} + ${path.description ? html`
${unsafeHTML(marked(path.description))}
` : ''} ${pathSecurityTemplate.call(this, path.security)} ${codeSampleTabPanel} @@ -141,7 +141,7 @@ function endpointBodyTemplate(path) { fetch-credentials = "${this.fetchCredentials}" 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, file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, - anchor:anchor, anchor-param-example:anchor-param-example" + anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" > ${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''} @@ -160,8 +160,9 @@ function endpointBodyTemplate(path) { schema-hide-read-only = "${path.isWebhook ? this.schemaHideWriteOnly : this.schemaHideReadOnly}" schema-hide-write-only = "${path.isWebhook ? this.schemaHideReadOnly : this.schemaHideWriteOnly}" selected-status = "${Object.keys(path.responses || {})[0] || ''}" - exportparts = - "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, file-input:file-input, 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" + exportparts = "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, file-input:file-input, + 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, + schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" >
`; @@ -202,7 +203,7 @@ export default function endpointTemplate(showExpandCollapse = true, showTags = t } return true; }).map((path) => html` -
+
${endpointHeadTemplate.call(this, path, pathsExpanded)} ${pathsExpanded || path.expanded ? endpointBodyTemplate.call(this, path) : ''}
`) diff --git a/src/templates/expanded-endpoint-template.js b/src/templates/expanded-endpoint-template.js index 08452fc3..afb5c868 100644 --- a/src/templates/expanded-endpoint-template.js +++ b/src/templates/expanded-endpoint-template.js @@ -93,7 +93,7 @@ export function expandedEndpointBodyTemplate(path, tagName = '') { fetch-credentials = "${this.fetchCredentials}" 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, file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, - anchor:anchor, anchor-param-example:anchor-param-example" + anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" > ${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''} @@ -111,7 +111,8 @@ export function expandedEndpointBodyTemplate(path, tagName = '') { schema-hide-read-only = "${path.isWebhook ? this.schemaHideReadOnly : false}" schema-hide-write-only = "${path.isWebhook ? false : this.schemaHideWriteOnly}" selected-status = "${Object.keys(path.responses || {})[0] || ''}" - exportparts = "btn:btn, btn-response-status:btn-response-status, btn-selected-response-status:btn-selected-response-status, btn-fill:btn-fill, btn-copy:btn-copy" + exportparts = "btn:btn, btn-response-status:btn-response-status, btn-selected-response-status:btn-selected-response-status, btn-fill:btn-fill, btn-copy:btn-copy, + schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle" >
diff --git a/src/templates/server-template.js b/src/templates/server-template.js index 505f79be..7c4f19a4 100644 --- a/src/templates/server-template.js +++ b/src/templates/server-template.js @@ -35,7 +35,7 @@ function serverVarsTemplate() { // const selectedServerObj = this.resolvedSpec.servers.find((v) => (v.url === this.selectedServer)); return this.selectedServer && this.selectedServer.variables ? html` -
SERVER VARIABLES
+
SERVER VARIABLES
${Object.entries(this.selectedServer.variables).map((kv) => html` @@ -86,7 +86,7 @@ export default function serverTemplate() { if (!this.resolvedSpec || this.resolvedSpec.specLoadError) { return ''; } return html`
-
API SERVER
+
API SERVER
${!this.resolvedSpec.servers || this.resolvedSpec.servers?.length === 0 ? ''