openapi-explorer 0.10.423 → 0.10.425
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/CHANGELOG.md +1 -0
- package/dist/browser/openapi-explorer.min.js +4 -4
- package/dist/es/components/schema-table.js +5 -3
- package/dist/es/openapi-explorer.js +4 -0
- package/dist/es/styles/font-styles.js +1 -1
- package/dist/es/templates/responsiveViewMainBodyTemplate.js +1 -0
- package/dist/es/utils/schema-utils.js +12 -6
- package/dist/es/utils/theme.js +1 -2
- package/dist/lib/components/schema-table.js +5 -3
- package/dist/lib/openapi-explorer.js +4 -0
- package/dist/lib/styles/font-styles.js +1 -1
- package/dist/lib/templates/responsiveViewMainBodyTemplate.js +1 -0
- package/dist/lib/utils/schema-utils.js +12 -6
- package/dist/lib/utils/theme.js +1 -2
- package/package.json +1 -1
|
@@ -86,11 +86,13 @@ export default class SchemaTable extends LitElement {
|
|
|
86
86
|
|
|
87
87
|
let detailObjType = '';
|
|
88
88
|
|
|
89
|
-
if (data['::type']
|
|
89
|
+
if ((data['::type'] || '').includes('xxx-of')) {
|
|
90
|
+
detailObjType = '';
|
|
91
|
+
} else if (data['::type'] === 'object') {
|
|
90
92
|
if (dataType === 'array') {
|
|
91
|
-
detailObjType = '
|
|
93
|
+
detailObjType = `[${keyLabel.replace(/(s|Collection|List)[*]?$/i, '')}]`; // Array of Object
|
|
92
94
|
} else {
|
|
93
|
-
detailObjType = 'object';
|
|
95
|
+
detailObjType = 'object'; // Object
|
|
94
96
|
}
|
|
95
97
|
} else if (data['::type'] === 'array') {
|
|
96
98
|
if (dataType === 'array') {
|
|
@@ -158,6 +158,10 @@ export default class OpenApiExplorer extends LitElement {
|
|
|
158
158
|
type: String,
|
|
159
159
|
attribute: 'bg-color'
|
|
160
160
|
},
|
|
161
|
+
bgHeaderColor: {
|
|
162
|
+
type: String,
|
|
163
|
+
attribute: 'header-bg-color'
|
|
164
|
+
},
|
|
161
165
|
textColor: {
|
|
162
166
|
type: String,
|
|
163
167
|
attribute: 'text-color'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export default css`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);font-weight:400}.sub-title{font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{overflow:scroll;max-height:var(--resp-area-height,300px);color:var(--fg3)}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get,.method-fg.head{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.query{color:var(--purple)}.method-fg.options{color:var(--gray)}.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);font-size:28px;padding-top:10px;letter-spacing:normal;font-weight:400}h2{font-family:var(--font-regular);font-size:24px;padding-top:10px;letter-spacing:normal;font-weight:400}h3{font-family:var(--font-regular);font-size:18px;padding-top:10px;letter-spacing:normal;font-weight:400}h4{font-family:var(--font-regular);font-size:16px;padding-top:10px;letter-spacing:normal;font-weight:400}h5{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h6{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h1,h2,h3,h4,h5{margin-block-end:.2em}h3{margin-top:0}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);text-decoration:none;cursor:text}code,pre{margin:0;font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px)}.m-markdown,.m-markdown-small{display:block}.m-markdown li,.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 6px)}.m-markdown-small li,.m-markdown-small p,.m-markdown-small span{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown p:not(:first-child){margin-block-start:12px}.m-markdown-small p:not(:first-child){margin-block-start:12px}.m-markdown :first-child,.m-markdown-small :first-child{margin-block-start:0}.m-markdown p,.m-markdown-small p{margin-block-end:0}.toolbar .m-markdown p,.toolbar .m-markdown-small p{margin-block-start:0}.m-markdown code span{font-size:var(--font-size-mono)}.m-markdown code,.m-markdown-small code{padding:1px 6px;border-radius:2px;color:var(--inline-code-fg);background-color:var(--bg3);font-size:calc(var(--font-size-mono));line-height:1.2}.m-markdown-small code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown pre,.m-markdown-small pre{white-space:pre-wrap;overflow-x:auto;line-height:normal;border-radius:2px;border:1px solid var(--code-border-color)}.m-markdown pre{padding:8px;background-color:var(--
|
|
2
|
+
export default css`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);font-weight:400}.sub-title{font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{overflow:scroll;max-height:var(--resp-area-height,300px);color:var(--fg3)}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get,.method-fg.head{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.query{color:var(--purple)}.method-fg.options{color:var(--gray)}.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);font-size:28px;padding-top:10px;letter-spacing:normal;font-weight:400}h2{font-family:var(--font-regular);font-size:24px;padding-top:10px;letter-spacing:normal;font-weight:400}h3{font-family:var(--font-regular);font-size:18px;padding-top:10px;letter-spacing:normal;font-weight:400}h4{font-family:var(--font-regular);font-size:16px;padding-top:10px;letter-spacing:normal;font-weight:400}h5{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h6{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h1,h2,h3,h4,h5{margin-block-end:.2em}h3{margin-top:0}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);text-decoration:none;cursor:text}code,pre{margin:0;font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px)}.m-markdown,.m-markdown-small{display:block}.m-markdown li,.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 6px)}.m-markdown-small li,.m-markdown-small p,.m-markdown-small span{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown p:not(:first-child){margin-block-start:12px}.m-markdown-small p:not(:first-child){margin-block-start:12px}.m-markdown :first-child,.m-markdown-small :first-child{margin-block-start:0}.m-markdown p,.m-markdown-small p{margin-block-end:0}.toolbar .m-markdown p,.toolbar .m-markdown-small p{margin-block-start:0}.m-markdown code span{font-size:var(--font-size-mono)}.m-markdown code,.m-markdown-small code{padding:1px 6px;border-radius:2px;color:var(--inline-code-fg);background-color:var(--bg3);font-size:calc(var(--font-size-mono));line-height:1.2}.m-markdown-small code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown pre,.m-markdown-small pre{white-space:pre-wrap;overflow-x:auto;line-height:normal;border-radius:2px;border:1px solid var(--code-border-color)}.m-markdown pre{padding:8px;background-color:var(--bg2);color:var(--code-fg)}.m-markdown-small pre{margin-top:4px;padding:2px 4px;background-color:var(--bg3);color:var(--fg2)}.m-markdown pre code,.m-markdown-small pre code{border:none;padding:0}.m-markdown pre code{color:var(--code-fg);background-color:var(--bg2);background-color:transparent}.m-markdown-small pre code{color:var(--fg2);background-color:var(--bg3)}.m-markdown ol,.m-markdown ul{padding-inline-start:30px}.m-markdown-small ol,.m-markdown-small ul{padding-inline-start:20px}.m-markdown a,.m-markdown-small a{color:var(--blue)}.m-markdown img,.m-markdown-small img{max-width:100%}.m-markdown table,.m-markdown-small table{border-spacing:0;margin:10px 0;border-collapse:separate;border:1px solid var(--border-color);border-radius:var(--border-radius);font-size:calc(var(--font-size-small) + 1px);line-height:calc(var(--font-size-small) + 4px);max-width:100%}.m-markdown-small table{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 2px);margin:8px 0}.m-markdown td,.m-markdown th,.m-markdown-small td,.m-markdown-small th{vertical-align:top;border-top:1px solid var(--border-color);line-height:calc(var(--font-size-small) + 4px)}.m-markdown tr:first-child th,.m-markdown-small tr:first-child th{border-top:0 none}.m-markdown td,.m-markdown th{padding:10px 12px}.m-markdown-small td,.m-markdown-small th{padding:8px 8px}.m-markdown th,.m-markdown-small th{font-weight:600;background-color:var(--bg2);vertical-align:middle}.m-markdown-small table code{font-size:calc(var(--font-size-mono) - 2px)}.m-markdown table code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown blockquote,.m-markdown-small blockquote{margin-inline-start:0;margin-inline-end:0;border-left:3px solid var(--border-color);padding:6px 0 6px 6px}`;
|
|
@@ -12,6 +12,7 @@ import ColorUtils from '../utils/color-utils';
|
|
|
12
12
|
export default function responsiveViewMainBodyTemplate() {
|
|
13
13
|
const newTheme = {
|
|
14
14
|
bg1: ColorUtils.isValidHexColor(this.bgColor) ? this.bgColor : '',
|
|
15
|
+
bg2: ColorUtils.isValidHexColor(this.bgHeaderColor) ? this.bgHeaderColor : '',
|
|
15
16
|
fg1: ColorUtils.isValidHexColor(this.textColor) ? this.textColor : '',
|
|
16
17
|
primaryColor: ColorUtils.isValidHexColor(this.primaryColor) ? this.primaryColor : '#3E6077',
|
|
17
18
|
secondaryColor: ColorUtils.isValidHexColor(this.secondaryColor) ? this.secondaryColor : '#FBAF0B',
|
|
@@ -461,7 +461,9 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
|
|
|
461
461
|
};
|
|
462
462
|
return resultObj;
|
|
463
463
|
} else if (Array.isArray(schema.type)) {
|
|
464
|
-
const obj = {
|
|
464
|
+
const obj = {
|
|
465
|
+
'::type': ''
|
|
466
|
+
}; // When a property has multiple types, then check further if any of the types are array or object, if yes then modify the schema using one-of
|
|
465
467
|
// Clone the schema - as it will be modified to replace multi-data-types with one-of;
|
|
466
468
|
|
|
467
469
|
const subSchema = JSON.parse(JSON.stringify(schema));
|
|
@@ -549,7 +551,9 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
|
|
|
549
551
|
|
|
550
552
|
return obj;
|
|
551
553
|
} else if (schema.type === 'object' || schema.properties) {
|
|
552
|
-
const obj = {
|
|
554
|
+
const obj = {
|
|
555
|
+
'::type': ''
|
|
556
|
+
};
|
|
553
557
|
obj['::title'] = schema.title || '';
|
|
554
558
|
obj['::description'] = schema.description || '';
|
|
555
559
|
obj['::flags'] = {
|
|
@@ -573,12 +577,14 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
|
|
|
573
577
|
|
|
574
578
|
return obj;
|
|
575
579
|
} else if (schema.type === 'array' || schema.items) {
|
|
576
|
-
var _schema$items2;
|
|
580
|
+
var _schema$items2, _schema$items3;
|
|
577
581
|
|
|
578
582
|
// If Array
|
|
579
|
-
const obj = {
|
|
583
|
+
const obj = {
|
|
584
|
+
'::type': ''
|
|
585
|
+
};
|
|
580
586
|
obj['::title'] = schema.title || '';
|
|
581
|
-
obj['::description'] = schema.description ? schema.description : schema.items &&
|
|
587
|
+
obj['::description'] = schema.description ? schema.description : (_schema$items2 = schema.items) !== null && _schema$items2 !== void 0 && _schema$items2.description ? `array<${schema.items.description}>` : '';
|
|
582
588
|
obj['::flags'] = {
|
|
583
589
|
'🆁': schema.readOnly && '🆁',
|
|
584
590
|
'🆆': schema.writeOnly && '🆆'
|
|
@@ -591,7 +597,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
|
|
|
591
597
|
writeOnly: schema.writeOnly
|
|
592
598
|
}, schema.items), options, level + 1);
|
|
593
599
|
|
|
594
|
-
if ((_schema$
|
|
600
|
+
if ((_schema$items3 = schema.items) !== null && _schema$items3 !== void 0 && _schema$items3.items) {
|
|
595
601
|
obj['::array-type'] = schema.items.items.type;
|
|
596
602
|
}
|
|
597
603
|
|
package/dist/es/utils/theme.js
CHANGED
|
@@ -65,11 +65,10 @@ export default function setTheme(theme = {}) {
|
|
|
65
65
|
// #dedede
|
|
66
66
|
hoverColor: theme.hoverColor || ColorUtils.color.brightness(bg1, -5),
|
|
67
67
|
// # f1f1f1
|
|
68
|
-
codeBg: theme.codeBg || ColorUtils.color.opacity(ColorUtils.color.brightness(bg1, -15), 0.7),
|
|
69
68
|
codeFg: theme.codeFg || '#666',
|
|
70
69
|
codePropertyColor: theme.codePropertyColor || '#905',
|
|
71
70
|
codeKeywordColor: theme.codeKeywordColor || '#07a',
|
|
72
71
|
codeOperatorColor: theme.codeOperatorColor || '#9a6e3a'
|
|
73
72
|
};
|
|
74
|
-
return html` <style>*,:after,:before{box-sizing:border-box}:host{--border-radius:2px;--layout:${this.layout || 'column'};--nav-item-padding:${this.navItemSpacing === 'relaxed' ? '10px' : this.navItemSpacing === 'compact' ? '5px 10px' : '7px 10px'};--resp-area-height:${this.responseAreaHeight};--font-size-small:${this.fontSize === 'default' ? '12px' : this.fontSize === 'large' ? '13px' : '14px'};--font-size-mono:${this.fontSize === 'default' ? '13px' : this.fontSize === 'large' ? '14px' : '15px'};--font-size-regular:${this.fontSize === 'default' ? '14px' : this.fontSize === 'large' ? '15px' : '16px'};--dialog-z-index:1000;--bg:${newTheme.bg1};--bg2:${newTheme.bg2};--bg3:${newTheme.bg3};--light-bg:${newTheme.lightBg};--fg:${newTheme.fg1};--fg2:${newTheme.fg2};--fg3:${newTheme.fg3};--light-fg:${newTheme.lightFg};--selection-bg:${newTheme.selectionBg};--selection-fg:${newTheme.selectionFg};--overlay-bg:${newTheme.overlayBg};--border-color:${newTheme.borderColor};--light-border-color:${newTheme.lightBorderColor};--code-border-color:${newTheme.codeBorderColor};--input-bg:${newTheme.inputBg};--placeholder-color:${newTheme.placeHolder};--hover-color:${newTheme.hoverColor};${defaultColors.join(';\n')} ${lightColors.join(';\n')} --header-bg:${newTheme.headerColor};--header-fg:${newTheme.headerColorInvert};--header-color-darker:${newTheme.headerColorDarker};--header-color-border:${newTheme.headerColorBorder};--nav-bg-color:${newTheme.navBgColor};--nav-text-color:${newTheme.navTextColor};--nav-hover-bg-color:${newTheme.navHoverBgColor};--nav-hover-text-color:${newTheme.navHoverTextColor};--code-
|
|
73
|
+
return html` <style>*,:after,:before{box-sizing:border-box}:host{--border-radius:2px;--layout:${this.layout || 'column'};--nav-item-padding:${this.navItemSpacing === 'relaxed' ? '10px' : this.navItemSpacing === 'compact' ? '5px 10px' : '7px 10px'};--resp-area-height:${this.responseAreaHeight};--font-size-small:${this.fontSize === 'default' ? '12px' : this.fontSize === 'large' ? '13px' : '14px'};--font-size-mono:${this.fontSize === 'default' ? '13px' : this.fontSize === 'large' ? '14px' : '15px'};--font-size-regular:${this.fontSize === 'default' ? '14px' : this.fontSize === 'large' ? '15px' : '16px'};--dialog-z-index:1000;--bg:${newTheme.bg1};--bg2:${newTheme.bg2};--bg3:${newTheme.bg3};--light-bg:${newTheme.lightBg};--fg:${newTheme.fg1};--fg2:${newTheme.fg2};--fg3:${newTheme.fg3};--light-fg:${newTheme.lightFg};--selection-bg:${newTheme.selectionBg};--selection-fg:${newTheme.selectionFg};--overlay-bg:${newTheme.overlayBg};--border-color:${newTheme.borderColor};--light-border-color:${newTheme.lightBorderColor};--code-border-color:${newTheme.codeBorderColor};--input-bg:${newTheme.inputBg};--placeholder-color:${newTheme.placeHolder};--hover-color:${newTheme.hoverColor};${defaultColors.join(';\n')} ${lightColors.join(';\n')} --header-bg:${newTheme.headerColor};--header-fg:${newTheme.headerColorInvert};--header-color-darker:${newTheme.headerColorDarker};--header-color-border:${newTheme.headerColorBorder};--nav-bg-color:${newTheme.navBgColor};--nav-text-color:${newTheme.navTextColor};--nav-hover-bg-color:${newTheme.navHoverBgColor};--nav-hover-text-color:${newTheme.navHoverTextColor};--code-fg:${newTheme.codeFg};--inline-code-fg:${newTheme.inlineCodeFg};--primary-color:${theme.primaryColor};--secondary-color:${theme.secondaryColor};--primary-btn-text-color:${ColorUtils.color.selectTextColorFromBackground(theme.primaryColor)}}</style>`;
|
|
75
74
|
}
|
|
@@ -99,11 +99,13 @@ class SchemaTable extends _lit.LitElement {
|
|
|
99
99
|
|
|
100
100
|
let detailObjType = '';
|
|
101
101
|
|
|
102
|
-
if (data['::type']
|
|
102
|
+
if ((data['::type'] || '').includes('xxx-of')) {
|
|
103
|
+
detailObjType = '';
|
|
104
|
+
} else if (data['::type'] === 'object') {
|
|
103
105
|
if (dataType === 'array') {
|
|
104
|
-
detailObjType = '
|
|
106
|
+
detailObjType = `[${keyLabel.replace(/(s|Collection|List)[*]?$/i, '')}]`; // Array of Object
|
|
105
107
|
} else {
|
|
106
|
-
detailObjType = 'object';
|
|
108
|
+
detailObjType = 'object'; // Object
|
|
107
109
|
}
|
|
108
110
|
} else if (data['::type'] === 'array') {
|
|
109
111
|
if (dataType === 'array') {
|
|
@@ -5,6 +5,6 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _lit = require("lit");
|
|
7
7
|
|
|
8
|
-
var _default = (0, _lit.css)`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);font-weight:400}.sub-title{font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{overflow:scroll;max-height:var(--resp-area-height,300px);color:var(--fg3)}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get,.method-fg.head{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.query{color:var(--purple)}.method-fg.options{color:var(--gray)}.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);font-size:28px;padding-top:10px;letter-spacing:normal;font-weight:400}h2{font-family:var(--font-regular);font-size:24px;padding-top:10px;letter-spacing:normal;font-weight:400}h3{font-family:var(--font-regular);font-size:18px;padding-top:10px;letter-spacing:normal;font-weight:400}h4{font-family:var(--font-regular);font-size:16px;padding-top:10px;letter-spacing:normal;font-weight:400}h5{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h6{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h1,h2,h3,h4,h5{margin-block-end:.2em}h3{margin-top:0}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);text-decoration:none;cursor:text}code,pre{margin:0;font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px)}.m-markdown,.m-markdown-small{display:block}.m-markdown li,.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 6px)}.m-markdown-small li,.m-markdown-small p,.m-markdown-small span{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown p:not(:first-child){margin-block-start:12px}.m-markdown-small p:not(:first-child){margin-block-start:12px}.m-markdown :first-child,.m-markdown-small :first-child{margin-block-start:0}.m-markdown p,.m-markdown-small p{margin-block-end:0}.toolbar .m-markdown p,.toolbar .m-markdown-small p{margin-block-start:0}.m-markdown code span{font-size:var(--font-size-mono)}.m-markdown code,.m-markdown-small code{padding:1px 6px;border-radius:2px;color:var(--inline-code-fg);background-color:var(--bg3);font-size:calc(var(--font-size-mono));line-height:1.2}.m-markdown-small code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown pre,.m-markdown-small pre{white-space:pre-wrap;overflow-x:auto;line-height:normal;border-radius:2px;border:1px solid var(--code-border-color)}.m-markdown pre{padding:8px;background-color:var(--
|
|
8
|
+
var _default = (0, _lit.css)`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);font-weight:400}.sub-title{font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{overflow:scroll;max-height:var(--resp-area-height,300px);color:var(--fg3)}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get,.method-fg.head{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.query{color:var(--purple)}.method-fg.options{color:var(--gray)}.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);font-size:28px;padding-top:10px;letter-spacing:normal;font-weight:400}h2{font-family:var(--font-regular);font-size:24px;padding-top:10px;letter-spacing:normal;font-weight:400}h3{font-family:var(--font-regular);font-size:18px;padding-top:10px;letter-spacing:normal;font-weight:400}h4{font-family:var(--font-regular);font-size:16px;padding-top:10px;letter-spacing:normal;font-weight:400}h5{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h6{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h1,h2,h3,h4,h5{margin-block-end:.2em}h3{margin-top:0}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);text-decoration:none;cursor:text}code,pre{margin:0;font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px)}.m-markdown,.m-markdown-small{display:block}.m-markdown li,.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 6px)}.m-markdown-small li,.m-markdown-small p,.m-markdown-small span{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown p:not(:first-child){margin-block-start:12px}.m-markdown-small p:not(:first-child){margin-block-start:12px}.m-markdown :first-child,.m-markdown-small :first-child{margin-block-start:0}.m-markdown p,.m-markdown-small p{margin-block-end:0}.toolbar .m-markdown p,.toolbar .m-markdown-small p{margin-block-start:0}.m-markdown code span{font-size:var(--font-size-mono)}.m-markdown code,.m-markdown-small code{padding:1px 6px;border-radius:2px;color:var(--inline-code-fg);background-color:var(--bg3);font-size:calc(var(--font-size-mono));line-height:1.2}.m-markdown-small code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown pre,.m-markdown-small pre{white-space:pre-wrap;overflow-x:auto;line-height:normal;border-radius:2px;border:1px solid var(--code-border-color)}.m-markdown pre{padding:8px;background-color:var(--bg2);color:var(--code-fg)}.m-markdown-small pre{margin-top:4px;padding:2px 4px;background-color:var(--bg3);color:var(--fg2)}.m-markdown pre code,.m-markdown-small pre code{border:none;padding:0}.m-markdown pre code{color:var(--code-fg);background-color:var(--bg2);background-color:transparent}.m-markdown-small pre code{color:var(--fg2);background-color:var(--bg3)}.m-markdown ol,.m-markdown ul{padding-inline-start:30px}.m-markdown-small ol,.m-markdown-small ul{padding-inline-start:20px}.m-markdown a,.m-markdown-small a{color:var(--blue)}.m-markdown img,.m-markdown-small img{max-width:100%}.m-markdown table,.m-markdown-small table{border-spacing:0;margin:10px 0;border-collapse:separate;border:1px solid var(--border-color);border-radius:var(--border-radius);font-size:calc(var(--font-size-small) + 1px);line-height:calc(var(--font-size-small) + 4px);max-width:100%}.m-markdown-small table{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 2px);margin:8px 0}.m-markdown td,.m-markdown th,.m-markdown-small td,.m-markdown-small th{vertical-align:top;border-top:1px solid var(--border-color);line-height:calc(var(--font-size-small) + 4px)}.m-markdown tr:first-child th,.m-markdown-small tr:first-child th{border-top:0 none}.m-markdown td,.m-markdown th{padding:10px 12px}.m-markdown-small td,.m-markdown-small th{padding:8px 8px}.m-markdown th,.m-markdown-small th{font-weight:600;background-color:var(--bg2);vertical-align:middle}.m-markdown-small table code{font-size:calc(var(--font-size-mono) - 2px)}.m-markdown table code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown blockquote,.m-markdown-small blockquote{margin-inline-start:0;margin-inline-end:0;border-left:3px solid var(--border-color);padding:6px 0 6px 6px}`;
|
|
9
9
|
|
|
10
10
|
exports.default = _default;
|
|
@@ -29,6 +29,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
29
29
|
function responsiveViewMainBodyTemplate() {
|
|
30
30
|
const newTheme = {
|
|
31
31
|
bg1: _colorUtils.default.isValidHexColor(this.bgColor) ? this.bgColor : '',
|
|
32
|
+
bg2: _colorUtils.default.isValidHexColor(this.bgHeaderColor) ? this.bgHeaderColor : '',
|
|
32
33
|
fg1: _colorUtils.default.isValidHexColor(this.textColor) ? this.textColor : '',
|
|
33
34
|
primaryColor: _colorUtils.default.isValidHexColor(this.primaryColor) ? this.primaryColor : '#3E6077',
|
|
34
35
|
secondaryColor: _colorUtils.default.isValidHexColor(this.secondaryColor) ? this.secondaryColor : '#FBAF0B',
|
|
@@ -478,7 +478,9 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
|
|
|
478
478
|
};
|
|
479
479
|
return resultObj;
|
|
480
480
|
} else if (Array.isArray(schema.type)) {
|
|
481
|
-
const obj = {
|
|
481
|
+
const obj = {
|
|
482
|
+
'::type': ''
|
|
483
|
+
}; // When a property has multiple types, then check further if any of the types are array or object, if yes then modify the schema using one-of
|
|
482
484
|
// Clone the schema - as it will be modified to replace multi-data-types with one-of;
|
|
483
485
|
|
|
484
486
|
const subSchema = JSON.parse(JSON.stringify(schema));
|
|
@@ -566,7 +568,9 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
|
|
|
566
568
|
|
|
567
569
|
return obj;
|
|
568
570
|
} else if (schema.type === 'object' || schema.properties) {
|
|
569
|
-
const obj = {
|
|
571
|
+
const obj = {
|
|
572
|
+
'::type': ''
|
|
573
|
+
};
|
|
570
574
|
obj['::title'] = schema.title || '';
|
|
571
575
|
obj['::description'] = schema.description || '';
|
|
572
576
|
obj['::flags'] = {
|
|
@@ -590,12 +594,14 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
|
|
|
590
594
|
|
|
591
595
|
return obj;
|
|
592
596
|
} else if (schema.type === 'array' || schema.items) {
|
|
593
|
-
var _schema$items2;
|
|
597
|
+
var _schema$items2, _schema$items3;
|
|
594
598
|
|
|
595
599
|
// If Array
|
|
596
|
-
const obj = {
|
|
600
|
+
const obj = {
|
|
601
|
+
'::type': ''
|
|
602
|
+
};
|
|
597
603
|
obj['::title'] = schema.title || '';
|
|
598
|
-
obj['::description'] = schema.description ? schema.description : schema.items &&
|
|
604
|
+
obj['::description'] = schema.description ? schema.description : (_schema$items2 = schema.items) !== null && _schema$items2 !== void 0 && _schema$items2.description ? `array<${schema.items.description}>` : '';
|
|
599
605
|
obj['::flags'] = {
|
|
600
606
|
'🆁': schema.readOnly && '🆁',
|
|
601
607
|
'🆆': schema.writeOnly && '🆆'
|
|
@@ -608,7 +614,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
|
|
|
608
614
|
writeOnly: schema.writeOnly
|
|
609
615
|
}, schema.items), options, level + 1);
|
|
610
616
|
|
|
611
|
-
if ((_schema$
|
|
617
|
+
if ((_schema$items3 = schema.items) !== null && _schema$items3 !== void 0 && _schema$items3.items) {
|
|
612
618
|
obj['::array-type'] = schema.items.items.type;
|
|
613
619
|
}
|
|
614
620
|
|
package/dist/lib/utils/theme.js
CHANGED
|
@@ -74,11 +74,10 @@ function setTheme(theme = {}) {
|
|
|
74
74
|
// #dedede
|
|
75
75
|
hoverColor: theme.hoverColor || _colorUtils.default.color.brightness(bg1, -5),
|
|
76
76
|
// # f1f1f1
|
|
77
|
-
codeBg: theme.codeBg || _colorUtils.default.color.opacity(_colorUtils.default.color.brightness(bg1, -15), 0.7),
|
|
78
77
|
codeFg: theme.codeFg || '#666',
|
|
79
78
|
codePropertyColor: theme.codePropertyColor || '#905',
|
|
80
79
|
codeKeywordColor: theme.codeKeywordColor || '#07a',
|
|
81
80
|
codeOperatorColor: theme.codeOperatorColor || '#9a6e3a'
|
|
82
81
|
};
|
|
83
|
-
return (0, _lit.html)` <style>*,:after,:before{box-sizing:border-box}:host{--border-radius:2px;--layout:${this.layout || 'column'};--nav-item-padding:${this.navItemSpacing === 'relaxed' ? '10px' : this.navItemSpacing === 'compact' ? '5px 10px' : '7px 10px'};--resp-area-height:${this.responseAreaHeight};--font-size-small:${this.fontSize === 'default' ? '12px' : this.fontSize === 'large' ? '13px' : '14px'};--font-size-mono:${this.fontSize === 'default' ? '13px' : this.fontSize === 'large' ? '14px' : '15px'};--font-size-regular:${this.fontSize === 'default' ? '14px' : this.fontSize === 'large' ? '15px' : '16px'};--dialog-z-index:1000;--bg:${newTheme.bg1};--bg2:${newTheme.bg2};--bg3:${newTheme.bg3};--light-bg:${newTheme.lightBg};--fg:${newTheme.fg1};--fg2:${newTheme.fg2};--fg3:${newTheme.fg3};--light-fg:${newTheme.lightFg};--selection-bg:${newTheme.selectionBg};--selection-fg:${newTheme.selectionFg};--overlay-bg:${newTheme.overlayBg};--border-color:${newTheme.borderColor};--light-border-color:${newTheme.lightBorderColor};--code-border-color:${newTheme.codeBorderColor};--input-bg:${newTheme.inputBg};--placeholder-color:${newTheme.placeHolder};--hover-color:${newTheme.hoverColor};${defaultColors.join(';\n')} ${lightColors.join(';\n')} --header-bg:${newTheme.headerColor};--header-fg:${newTheme.headerColorInvert};--header-color-darker:${newTheme.headerColorDarker};--header-color-border:${newTheme.headerColorBorder};--nav-bg-color:${newTheme.navBgColor};--nav-text-color:${newTheme.navTextColor};--nav-hover-bg-color:${newTheme.navHoverBgColor};--nav-hover-text-color:${newTheme.navHoverTextColor};--code-
|
|
82
|
+
return (0, _lit.html)` <style>*,:after,:before{box-sizing:border-box}:host{--border-radius:2px;--layout:${this.layout || 'column'};--nav-item-padding:${this.navItemSpacing === 'relaxed' ? '10px' : this.navItemSpacing === 'compact' ? '5px 10px' : '7px 10px'};--resp-area-height:${this.responseAreaHeight};--font-size-small:${this.fontSize === 'default' ? '12px' : this.fontSize === 'large' ? '13px' : '14px'};--font-size-mono:${this.fontSize === 'default' ? '13px' : this.fontSize === 'large' ? '14px' : '15px'};--font-size-regular:${this.fontSize === 'default' ? '14px' : this.fontSize === 'large' ? '15px' : '16px'};--dialog-z-index:1000;--bg:${newTheme.bg1};--bg2:${newTheme.bg2};--bg3:${newTheme.bg3};--light-bg:${newTheme.lightBg};--fg:${newTheme.fg1};--fg2:${newTheme.fg2};--fg3:${newTheme.fg3};--light-fg:${newTheme.lightFg};--selection-bg:${newTheme.selectionBg};--selection-fg:${newTheme.selectionFg};--overlay-bg:${newTheme.overlayBg};--border-color:${newTheme.borderColor};--light-border-color:${newTheme.lightBorderColor};--code-border-color:${newTheme.codeBorderColor};--input-bg:${newTheme.inputBg};--placeholder-color:${newTheme.placeHolder};--hover-color:${newTheme.hoverColor};${defaultColors.join(';\n')} ${lightColors.join(';\n')} --header-bg:${newTheme.headerColor};--header-fg:${newTheme.headerColorInvert};--header-color-darker:${newTheme.headerColorDarker};--header-color-border:${newTheme.headerColorBorder};--nav-bg-color:${newTheme.navBgColor};--nav-text-color:${newTheme.navTextColor};--nav-hover-bg-color:${newTheme.navHoverBgColor};--nav-hover-text-color:${newTheme.navHoverTextColor};--code-fg:${newTheme.codeFg};--inline-code-fg:${newTheme.inlineCodeFg};--primary-color:${theme.primaryColor};--secondary-color:${theme.secondaryColor};--primary-btn-text-color:${_colorUtils.default.color.selectTextColorFromBackground(theme.primaryColor)}}</style>`;
|
|
84
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-explorer",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.425",
|
|
4
4
|
"description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
|
|
5
5
|
"author": "Rhosys Developers <developers@rhosys.ch>",
|
|
6
6
|
"type": "module",
|