-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrading dependencies (preview)
Signed-off-by: Pawel Psztyc <[email protected]>
- Loading branch information
Showing
9 changed files
with
2,243 additions
and
863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable lit-a11y/click-events-have-key-events */ | ||
/** | ||
@license | ||
Copyright 2018 The Advanced REST client authors <[email protected]> | ||
|
@@ -13,15 +14,14 @@ the License. | |
*/ | ||
import { html, LitElement } from 'lit-element'; | ||
import { AmfHelperMixin } from '@api-components/amf-helper-mixin/amf-helper-mixin.js'; | ||
import '@api-components/raml-aware/raml-aware.js'; | ||
import '@api-components/api-navigation/api-navigation.js'; | ||
import '@api-components/api-documentation/api-documentation.js'; | ||
import '@api-components/api-request-panel/api-request-panel.js'; | ||
import '@api-components/api-request/api-request-panel.js'; | ||
import '@anypoint-web-components/anypoint-button/anypoint-button.js'; | ||
import '@polymer/paper-toast/paper-toast.js'; | ||
import '@api-components/api-console-ext-comm/api-console-ext-comm.js'; | ||
import attributionTpl from './attribution-template.js'; | ||
import { close } from '@advanced-rest-client/arc-icons/ArcIcons.js'; | ||
import '@advanced-rest-client/arc-icons/arc-icon.js'; | ||
import styles from './ApiConsoleStyles.js'; | ||
|
||
export const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); | ||
|
@@ -111,7 +111,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
* request through Chrome extension's sandbox and eliminates CORS. | ||
* | ||
* When this is set it enables this feature and renders installation banner | ||
* when currrent browser profile does not have extension installed. | ||
* when current browser profile does not have extension installed. | ||
*/ | ||
allowExtensionBanner: { type: Boolean }, | ||
/** | ||
|
@@ -130,7 +130,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
* If set then the API console hide the "try it" button from the | ||
* method documentation view. The request and response panels still will | ||
* be available, but to enter this section you'll have to do it | ||
* programatically. | ||
* programmatically. | ||
*/ | ||
noTryIt: { type: Boolean }, | ||
/** | ||
|
@@ -145,7 +145,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
redirectUri: { type: String }, | ||
/** | ||
* Hides the URL editor from the view. | ||
* Note that the editor is still in the DOM. This property just hiddes | ||
* Note that the editor is still in the DOM. This property just hides | ||
* it. | ||
*/ | ||
noUrlEditor: { type: Boolean }, | ||
|
@@ -233,7 +233,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
* of endpoints based on the `path` value of the endpoint, keeping the order | ||
* of which endpoint was first in the list, relative to each other. | ||
* | ||
* **This is an experimental option and may dissapear without warning.** | ||
* **This is an experimental option and may disappear without warning.** | ||
*/ | ||
rearrangeEndpoints: { type: Boolean }, | ||
/** | ||
|
@@ -320,7 +320,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
return; | ||
} | ||
this._oauth2clientId = value; | ||
// No need to pass the valu via binding system because the auth method | ||
// No need to pass the value via binding system because the auth method | ||
// uses session storage to restore user values between the screens | ||
sessionStorage.setItem('auth.methods.latest.client_id', value); | ||
} | ||
|
@@ -340,7 +340,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
} | ||
|
||
/** | ||
* This can be overriten by child classes to decide whether to render the server | ||
* This can be overwritten by child classes to decide whether to render the server | ||
* selector or not. | ||
* @return {boolean} The final value of `noServerSelector`. | ||
*/ | ||
|
@@ -416,7 +416,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
} | ||
|
||
/** | ||
* On Firefix the navigation hidding animation runs when the app is first rendered, | ||
* On Firefox, the animation that is hiding the navigation runs when the app is first rendered, | ||
* even if the navigation wasn't initially rendered. This to be called | ||
* after initial render has been made (DOM is constructed) to add the `animatable` | ||
* class on the navigation to enable animation effects. | ||
|
@@ -447,10 +447,11 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
if (!amf) { | ||
return; | ||
} | ||
if (amf instanceof Array) { | ||
amf = amf[0]; | ||
if (Array.isArray(amf)) { | ||
[amf] = amf; | ||
} | ||
const webApi = this.webApi = this._computeApi(amf); | ||
const webApi = this._computeApi(amf); | ||
this.webApi = webApi; | ||
this.methodName = this._computeMethodName(this.selectedShape, webApi); | ||
if (!this._isWebAPI(amf)) { | ||
this._noTryItValue = true; | ||
|
@@ -583,23 +584,23 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
/** | ||
* Computes method name for not-wide view, where the request panel | ||
* has close button. | ||
* @param {String} selected Curerently selected AMF shape (@id). | ||
* @param {String} selected Currently selected AMF shape (@id). | ||
* @param {Object} webApi Computed AMF WebAPI model. | ||
* @return {String|undefined} Name of current method (verb) as RAML's | ||
* `displayName` property or name of the HTTP method. | ||
*/ | ||
_computeMethodName(selected, webApi) { | ||
if (!selected || !webApi) { | ||
return; | ||
return undefined; | ||
} | ||
let method; | ||
try { | ||
method = this._computeMethodModel(webApi, selected); | ||
} catch (_) { | ||
return; | ||
return undefined; | ||
} | ||
if (!method) { | ||
return; | ||
return undefined; | ||
} | ||
let name = /** @type string */ (this._getValue(method, this.ns.aml.vocabularies.core.name)); | ||
if (!name) { | ||
|
@@ -608,15 +609,6 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
return name; | ||
} | ||
|
||
/** | ||
* Handler for the `api-changed` event on the RAML aware element. | ||
* Sets `amf` property to the detail value. | ||
* @param {CustomEvent} e | ||
*/ | ||
_apiChanged(e) { | ||
this.amf = e.detail.value; | ||
} | ||
|
||
/** | ||
* A handler for the `api-console-extension-installed` event dispatched by the | ||
* component that is responsible for communication with the browser extension | ||
|
@@ -658,9 +650,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
} | ||
|
||
render() { | ||
const { aware } = this; | ||
return html` | ||
${aware ? html`<raml-aware .scope="${aware}" @api-changed="${this._apiChanged}"></raml-aware>` : ''} | ||
${this._mainContentTemplate()} | ||
${this._helpersTemplate()} | ||
`; | ||
|
@@ -699,7 +689,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
aria-label="Activate to close the message" | ||
@click="${this.dismissExtensionBanner}" | ||
> | ||
<span class="icon">${close}</span> | ||
<arc-icon icon="close"></arc-icon> | ||
</anypoint-icon-button> | ||
</div>`; | ||
} | ||
|
@@ -737,16 +727,13 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
outlined, | ||
amf, | ||
selectedShape, | ||
narrow, | ||
noUrlEditor, | ||
scrollTarget, | ||
allowCustom, | ||
allowDisableParams, | ||
allowHideOptional, | ||
redirectUri, | ||
eventsTarget, | ||
baseUri, | ||
noDocs, | ||
serverValue, | ||
serverType, | ||
noServerSelector, | ||
|
@@ -755,19 +742,16 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
return html`<api-request-panel | ||
.amf="${amf}" | ||
.selected="${selectedShape}" | ||
?narrow="${narrow}" | ||
?outlined="${outlined}" | ||
?compatibility="${compatibility}" | ||
?noServerSelector="${noServerSelector}" | ||
?allowCustomBaseUri="${allowCustomBaseUri}" | ||
.noUrlEditor="${noUrlEditor}" | ||
.redirectUri="${redirectUri}" | ||
.scrollTarget="${scrollTarget}" | ||
.allowCustom="${allowCustom}" | ||
.allowDisableParams="${allowDisableParams}" | ||
.allowHideOptional="${allowHideOptional}" | ||
.baseUri="${baseUri}" | ||
.noDocs="${noDocs}" | ||
.serverValue="${serverValue}" | ||
.serverType="${serverType}" | ||
.eventsTarget="${eventsTarget}" | ||
|
@@ -796,7 +780,6 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
serverType, | ||
_noServerSelector, | ||
allowCustomBaseUri, | ||
rearrangeEndpoints, | ||
} = this; | ||
|
||
return html`<api-documentation | ||
|
@@ -815,7 +798,6 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
.scrollTarget="${scrollTarget}" | ||
.serverValue="${serverValue}" | ||
.serverType="${serverType}" | ||
?rearrangeEndpoints="${rearrangeEndpoints}" | ||
@api-navigation-selection-changed="${this._apiNavigationOcurred}" | ||
> | ||
${this._documentationBaseSlot()} | ||
|
@@ -824,7 +806,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
|
||
/** | ||
* Renders the `<slot>` element in the `<api-documentation>` only when | ||
* ther request panel is not rendered. When it is rendered then it | ||
* the request panel is not rendered. When it is rendered then it | ||
* is the target for slots. | ||
* @return {TemplateResult|string} Template for a slot to be used in the api documentation | ||
*/ | ||
|
@@ -844,8 +826,8 @@ export class ApiConsole extends AmfHelperMixin(LitElement) { | |
<api-navigation | ||
.amf="${amf}" | ||
summary | ||
endpointsopened | ||
?rearrangeendpoints="${rearrangeEndpoints}" | ||
endpointsOpened | ||
?rearrangeEndpoints="${rearrangeEndpoints}" | ||
@api-navigation-selection-changed="${this._apiNavigationOcurred}"></api-navigation> | ||
${noAttribution ? '' : attributionTpl} | ||
</div>`; | ||
|
Oops, something went wrong.