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.
- package/CHANGELOG.md +1 -0
- package/dist/{openapi-explorer.min.js → browser/openapi-explorer.min.js} +3 -3
- package/dist/{openapi-explorer.min.js.map → browser/openapi-explorer.min.js.map} +0 -0
- package/dist/es/components/api-request.js +936 -0
- package/dist/es/components/api-response.js +184 -0
- package/dist/es/components/json-tree.js +67 -0
- package/{src → dist/es}/components/mime-types.js +11 -17
- package/dist/es/components/schema-table.js +156 -0
- package/dist/es/components/schema-tree.js +191 -0
- package/dist/es/components/tag-input.js +67 -0
- package/{src → dist/es}/openapi-explorer-oauth-handler.js +2 -2
- package/{src → dist/es}/openapi-explorer.js +364 -371
- package/dist/es/styles/advanced-search-styles.js +2 -0
- package/dist/es/styles/api-request-styles.js +2 -0
- package/dist/es/styles/border-styles.js +2 -0
- package/dist/es/styles/endpoint-styles.js +2 -0
- package/dist/es/styles/flex-styles.js +2 -0
- package/dist/es/styles/font-styles.js +2 -0
- package/dist/es/styles/info-styles.js +2 -0
- package/dist/es/styles/input-styles.js +4 -0
- package/dist/es/styles/nav-styles.js +2 -0
- package/dist/es/styles/prism-styles.js +2 -0
- package/dist/es/styles/schema-styles.js +2 -0
- package/dist/es/styles/tab-styles.js +2 -0
- package/dist/es/styles/table-styles.js +2 -0
- package/dist/es/templates/advance-search-template.js +37 -0
- package/dist/es/templates/callback-template.js +7 -0
- package/dist/es/templates/code-samples-template.js +26 -0
- package/dist/es/templates/components-template.js +17 -0
- package/dist/es/templates/endpoint-template.js +94 -0
- package/dist/es/templates/expanded-endpoint-template.js +32 -0
- package/{src → dist/es}/templates/focused-endpoint-template.js +15 -15
- package/dist/es/templates/navbar-template.js +46 -0
- package/dist/es/templates/overview-template.js +9 -0
- package/dist/es/templates/responsiveViewMainBodyTemplate.js +30 -0
- package/dist/es/templates/security-scheme-template.js +330 -0
- package/dist/es/templates/server-template.js +42 -0
- package/{src → dist/es}/utils/color-utils.js +53 -16
- package/{src → dist/es}/utils/common-utils.js +18 -18
- package/{src → dist/es}/utils/schema-utils.js +248 -124
- package/{src → dist/es}/utils/spec-parser.js +112 -71
- package/dist/es/utils/theme.js +75 -0
- package/{src → dist/es}/utils/xml/xml.js +41 -38
- package/dist/lib/components/api-request.js +957 -0
- package/dist/lib/components/api-response.js +206 -0
- package/dist/lib/components/json-tree.js +82 -0
- package/dist/lib/components/mime-types.js +70 -0
- package/dist/lib/components/schema-table.js +170 -0
- package/dist/lib/components/schema-tree.js +206 -0
- package/dist/lib/components/tag-input.js +76 -0
- package/dist/lib/openapi-explorer-oauth-handler.js +19 -0
- package/dist/lib/openapi-explorer.js +817 -0
- package/dist/lib/styles/advanced-search-styles.js +10 -0
- package/dist/lib/styles/api-request-styles.js +10 -0
- package/dist/lib/styles/border-styles.js +10 -0
- package/dist/lib/styles/endpoint-styles.js +10 -0
- package/dist/lib/styles/flex-styles.js +10 -0
- package/dist/lib/styles/font-styles.js +10 -0
- package/dist/lib/styles/info-styles.js +10 -0
- package/dist/lib/styles/input-styles.js +11 -0
- package/dist/lib/styles/nav-styles.js +10 -0
- package/dist/lib/styles/prism-styles.js +10 -0
- package/dist/lib/styles/schema-styles.js +10 -0
- package/dist/lib/styles/tab-styles.js +10 -0
- package/dist/lib/styles/table-styles.js +10 -0
- package/dist/lib/templates/advance-search-template.js +42 -0
- package/dist/lib/templates/callback-template.js +12 -0
- package/dist/lib/templates/code-samples-template.js +36 -0
- package/dist/lib/templates/components-template.js +27 -0
- package/dist/lib/templates/endpoint-template.js +111 -0
- package/dist/lib/templates/expanded-endpoint-template.js +48 -0
- package/dist/lib/templates/focused-endpoint-template.js +95 -0
- package/dist/lib/templates/navbar-template.js +54 -0
- package/dist/lib/templates/overview-template.js +16 -0
- package/dist/lib/templates/responsiveViewMainBodyTemplate.js +47 -0
- package/dist/lib/templates/security-scheme-template.js +342 -0
- package/dist/lib/templates/server-template.js +49 -0
- package/dist/lib/utils/color-utils.js +112 -0
- package/dist/lib/utils/common-utils.js +156 -0
- package/dist/lib/utils/schema-utils.js +743 -0
- package/dist/lib/utils/spec-parser.js +361 -0
- package/dist/lib/utils/theme.js +84 -0
- package/dist/lib/utils/xml/xml.js +239 -0
- package/package.json +19 -6
- package/dist/openapi-explorer.min.js.LICENSE.txt +0 -71
- package/dist/openapi-explorer.min.js.LICENSE.txt.gz +0 -0
- package/dist/openapi-explorer.min.js.gz +0 -0
- package/dist/openapi-explorer.min.js.map.gz +0 -0
- package/dist/report.html +0 -38
- package/src/components/api-request.js +0 -1244
- package/src/components/api-response.js +0 -340
- package/src/components/json-tree.js +0 -129
- package/src/components/schema-table.js +0 -250
- package/src/components/schema-tree.js +0 -280
- package/src/components/tag-input.js +0 -109
- package/src/styles/advanced-search-styles.js +0 -84
- package/src/styles/api-request-styles.js +0 -111
- package/src/styles/border-styles.js +0 -24
- package/src/styles/css/main.css +0 -24
- package/src/styles/endpoint-styles.js +0 -222
- package/src/styles/flex-styles.js +0 -15
- package/src/styles/font-styles.js +0 -266
- package/src/styles/info-styles.js +0 -20
- package/src/styles/input-styles.js +0 -236
- package/src/styles/nav-styles.js +0 -141
- package/src/styles/prism-styles.js +0 -107
- package/src/styles/schema-styles.js +0 -121
- package/src/styles/tab-styles.js +0 -44
- package/src/styles/table-styles.js +0 -48
- package/src/templates/advance-search-template.js +0 -81
- package/src/templates/callback-template.js +0 -63
- package/src/templates/code-samples-template.js +0 -35
- package/src/templates/components-template.js +0 -43
- package/src/templates/endpoint-template.js +0 -175
- package/src/templates/expanded-endpoint-template.js +0 -104
- package/src/templates/navbar-template.js +0 -175
- package/src/templates/overview-template.js +0 -58
- package/src/templates/responsiveViewMainBodyTemplate.js +0 -72
- package/src/templates/security-scheme-template.js +0 -487
- package/src/templates/server-template.js +0 -106
- package/src/utils/theme.js +0 -163
package/src/utils/theme.js
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit-element';
|
|
2
|
-
import color from 'color';
|
|
3
|
-
import ColorUtils from './color-utils';
|
|
4
|
-
|
|
5
|
-
/* Generates an schema object containing type and constraint info */
|
|
6
|
-
|
|
7
|
-
// TODO: possible drive theme from:
|
|
8
|
-
/*
|
|
9
|
-
if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {
|
|
10
|
-
this.theme = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';
|
|
11
|
-
}
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export default function setTheme(theme = {}) {
|
|
15
|
-
const bg1 = (theme.bg1 ? theme.bg1 : '#ffffff');
|
|
16
|
-
const fg1 = (theme.fg1 ? theme.fg1 : '#444444');
|
|
17
|
-
const bg2 = theme.bg2 ? theme.bg2 : ColorUtils.color.brightness(bg1, -5); // or '#fafafa'
|
|
18
|
-
const bg3 = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, -15); // or '#f6f6f6'
|
|
19
|
-
const lightBg = theme.bg3 ? theme.bg3 : ColorUtils.color.brightness(bg1, -45);
|
|
20
|
-
const fg2 = theme.fg2 ? theme.fg2 : ColorUtils.color.brightness(fg1, 17); // or '#555'
|
|
21
|
-
const fg3 = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, 30); // or #666
|
|
22
|
-
const lightFg = theme.fg3 ? theme.fg3 : ColorUtils.color.brightness(fg1, 70); // or #999
|
|
23
|
-
const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : 'brown';
|
|
24
|
-
|
|
25
|
-
const selectionBg = '#444';
|
|
26
|
-
const selectionFg = '#eee';
|
|
27
|
-
|
|
28
|
-
const headerColor = theme.headerColor ? theme.headerColor : ColorUtils.color.brightness(bg1, -180);
|
|
29
|
-
const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, -180);
|
|
30
|
-
const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.opacity(ColorUtils.color.invert(navBgColor), '0.65');
|
|
31
|
-
const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : ColorUtils.color.brightness(navBgColor, -15);
|
|
32
|
-
const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : ColorUtils.color.invert(navBgColor);
|
|
33
|
-
const overlayBg = 'rgba(0, 0, 0, 0.4)';
|
|
34
|
-
|
|
35
|
-
const defaultColors = [
|
|
36
|
-
`--purple: ${getComputedStyle(this).getPropertyValue('--purple').trim() || '#6f42c1'}`,
|
|
37
|
-
`--red: ${getComputedStyle(this).getPropertyValue('--red').trim() || '#dc3545'}`,
|
|
38
|
-
`--orange: ${getComputedStyle(this).getPropertyValue('--orange').trim() || '#fd7e14'}`,
|
|
39
|
-
`--yellow: ${getComputedStyle(this).getPropertyValue('--yellow').trim() || '#ffc107'}`,
|
|
40
|
-
`--green: ${getComputedStyle(this).getPropertyValue('--green').trim() || '#28a745'}`,
|
|
41
|
-
`--blue: ${getComputedStyle(this).getPropertyValue('--blue').trim() || '#38b3f9'}`,
|
|
42
|
-
|
|
43
|
-
'--pink: #e83e8c',
|
|
44
|
-
'--white: #fff',
|
|
45
|
-
'',
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
const lightColors = [
|
|
49
|
-
`--light-purple: ${color(getComputedStyle(this).getPropertyValue('--purple').trim() || '#6f42c1').lightness(96).hex()}`,
|
|
50
|
-
`--light-red: ${color(getComputedStyle(this).getPropertyValue('--red').trim() || '#dc3545').lightness(96).hex()}`,
|
|
51
|
-
`--light-orange: ${color(getComputedStyle(this).getPropertyValue('--orange').trim() || '#fd7e14').lightness(96).hex()}`,
|
|
52
|
-
`--light-yellow: ${color(getComputedStyle(this).getPropertyValue('--yellow').trim() || '#ffc107').lightness(96).hex()}`,
|
|
53
|
-
`--light-green: ${color(getComputedStyle(this).getPropertyValue('--green').trim() || '#28a745').lightness(96).hex()}`,
|
|
54
|
-
`--light-blue: ${color(getComputedStyle(this).getPropertyValue('--blue').trim() || '#38b3f9').lightness(96).hex()}`,
|
|
55
|
-
'',
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
const newTheme = {
|
|
59
|
-
bg1,
|
|
60
|
-
bg2,
|
|
61
|
-
bg3,
|
|
62
|
-
lightBg,
|
|
63
|
-
fg1,
|
|
64
|
-
fg2,
|
|
65
|
-
fg3,
|
|
66
|
-
lightFg,
|
|
67
|
-
inlineCodeFg,
|
|
68
|
-
selectionBg,
|
|
69
|
-
selectionFg,
|
|
70
|
-
overlayBg,
|
|
71
|
-
navBgColor,
|
|
72
|
-
navTextColor,
|
|
73
|
-
navHoverBgColor,
|
|
74
|
-
navHoverTextColor,
|
|
75
|
-
|
|
76
|
-
headerColor,
|
|
77
|
-
headerColorInvert: ColorUtils.color.invert(headerColor),
|
|
78
|
-
headerColorDarker: ColorUtils.color.brightness(headerColor, -20),
|
|
79
|
-
headerColorBorder: ColorUtils.color.brightness(headerColor, 10),
|
|
80
|
-
|
|
81
|
-
borderColor: theme.borderColor || ColorUtils.color.brightness(bg1, -38),
|
|
82
|
-
lightBorderColor: theme.lightBorderColor || ColorUtils.color.brightness(bg1, -23),
|
|
83
|
-
codeBorderColor: theme.codeBorderColor || 'transparent',
|
|
84
|
-
|
|
85
|
-
inputBg: theme.inputBg || ColorUtils.color.brightness(bg1, 10), // #fff
|
|
86
|
-
placeHolder: theme.placeHolder || ColorUtils.color.brightness(lightFg, 20), // #dedede
|
|
87
|
-
hoverColor: theme.hoverColor || ColorUtils.color.brightness(bg1, -5), // # f1f1f1
|
|
88
|
-
|
|
89
|
-
codeBg: theme.codeBg || ColorUtils.color.opacity(ColorUtils.color.brightness(bg1, -15), 0.7),
|
|
90
|
-
codeFg: theme.codeFg || '#666',
|
|
91
|
-
codePropertyColor: theme.codePropertyColor || '#905',
|
|
92
|
-
codeKeywordColor: theme.codeKeywordColor || '#07a',
|
|
93
|
-
codeOperatorColor: theme.codeOperatorColor || '#9a6e3a',
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
return html`
|
|
97
|
-
<style>
|
|
98
|
-
*, *:before, *:after { box-sizing: border-box; }
|
|
99
|
-
|
|
100
|
-
:host {
|
|
101
|
-
/* Common Styles - irrespective of themes */
|
|
102
|
-
--border-radius: 2px;
|
|
103
|
-
--layout: ${this.layout || 'column'};
|
|
104
|
-
--nav-item-padding: ${this.navItemSpacing === 'relaxed' ? '10px' : (this.navItemSpacing === 'compact' ? '5px 10px' : '7px 10px')};
|
|
105
|
-
--resp-area-height: ${this.responseAreaHeight};
|
|
106
|
-
--font-size-small: ${this.fontSize === 'default' ? '12px' : (this.fontSize === 'large' ? '13px' : '14px')};
|
|
107
|
-
--font-size-mono: ${this.fontSize === 'default' ? '13px' : (this.fontSize === 'large' ? '14px' : '15px')};
|
|
108
|
-
--font-size-regular: ${this.fontSize === 'default' ? '14px' : (this.fontSize === 'large' ? '15px' : '16px')};
|
|
109
|
-
--dialog-z-index: 1000;
|
|
110
|
-
|
|
111
|
-
/* Theme specific styles */
|
|
112
|
-
--bg:${newTheme.bg1};
|
|
113
|
-
--bg2:${newTheme.bg2};
|
|
114
|
-
--bg3:${newTheme.bg3};
|
|
115
|
-
--light-bg:${newTheme.lightBg};
|
|
116
|
-
--fg:${newTheme.fg1};
|
|
117
|
-
--fg2:${newTheme.fg2};
|
|
118
|
-
--fg3:${newTheme.fg3};
|
|
119
|
-
--light-fg:${newTheme.lightFg};
|
|
120
|
-
--selection-bg:${newTheme.selectionBg};
|
|
121
|
-
--selection-fg:${newTheme.selectionFg};
|
|
122
|
-
--overlay-bg:${newTheme.overlayBg};
|
|
123
|
-
|
|
124
|
-
/* Border Colors */
|
|
125
|
-
--border-color:${newTheme.borderColor};
|
|
126
|
-
--light-border-color:${newTheme.lightBorderColor};
|
|
127
|
-
--code-border-color:${newTheme.codeBorderColor};
|
|
128
|
-
|
|
129
|
-
--input-bg:${newTheme.inputBg};
|
|
130
|
-
--placeholder-color:${newTheme.placeHolder};
|
|
131
|
-
--hover-color:${newTheme.hoverColor};
|
|
132
|
-
|
|
133
|
-
${defaultColors.join(';\n')}
|
|
134
|
-
|
|
135
|
-
${lightColors.join(';\n')}
|
|
136
|
-
|
|
137
|
-
/* Header Color */
|
|
138
|
-
--header-bg:${newTheme.headerColor};
|
|
139
|
-
--header-fg:${newTheme.headerColorInvert};
|
|
140
|
-
--header-color-darker:${newTheme.headerColorDarker};
|
|
141
|
-
--header-color-border:${newTheme.headerColorBorder};
|
|
142
|
-
|
|
143
|
-
/* Nav Colors */
|
|
144
|
-
--nav-bg-color:${newTheme.navBgColor};
|
|
145
|
-
--nav-text-color:${newTheme.navTextColor};
|
|
146
|
-
--nav-hover-bg-color:${newTheme.navHoverBgColor};
|
|
147
|
-
--nav-hover-text-color:${newTheme.navHoverTextColor};
|
|
148
|
-
|
|
149
|
-
/*Code Syntax Color*/
|
|
150
|
-
--code-bg:${newTheme.codeBg};
|
|
151
|
-
--code-fg:${newTheme.codeFg};
|
|
152
|
-
--inline-code-fg:${newTheme.inlineCodeFg};
|
|
153
|
-
--code-property-color:${newTheme.codePropertyColor};
|
|
154
|
-
--code-keyword-color:${newTheme.codeKeywordColor};
|
|
155
|
-
--code-operator-color:${newTheme.codeOperatorColor};
|
|
156
|
-
|
|
157
|
-
/* Computed Color properties */
|
|
158
|
-
--primary-color: ${theme.primaryColor};
|
|
159
|
-
--secondary-color:${theme.secondaryColor};
|
|
160
|
-
--primary-btn-text-color: ${ColorUtils.color.selectTextColorFromBackground(theme.primaryColor)};
|
|
161
|
-
}
|
|
162
|
-
</style>`;
|
|
163
|
-
}
|