From aa3b6343ed980a650b6840cf6b951658d3fdfd44 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Tue, 5 Mar 2019 13:36:17 -0600 Subject: [PATCH 01/31] Cleanup Editors and some common elements (#2882) This is what I do while watching TV :smile: --- .../lovelace/components/hui-action-editor.ts | 19 ++- .../lovelace/components/hui-card-options.ts | 119 ++++++++++-------- .../components/hui-entities-toggle.ts | 51 ++++---- .../lovelace/components/hui-entity-editor.ts | 31 ++--- .../components/hui-generic-entity-row.ts | 7 +- src/panels/lovelace/components/hui-image.ts | 33 +++-- .../components/hui-theme-select-editor.ts | 31 ++--- .../components/hui-timestamp-display.ts | 57 ++++----- .../lovelace/components/hui-yaml-editor.ts | 8 +- .../editor/card-editor/hui-card-picker.ts | 13 +- .../card-editor/hui-dialog-edit-card.ts | 24 ++-- .../card-editor/hui-dialog-move-card-view.ts | 65 +++++----- .../card-editor/hui-dialog-pick-card.ts | 11 +- .../editor/card-editor/hui-edit-card.ts | 68 +++++----- .../card-editor/show-edit-card-dialog.ts | 4 +- .../card-editor/show-move-card-view-dialog.ts | 4 +- .../hui-alarm-panel-card-editor.ts | 51 ++++---- .../hui-entities-card-editor.ts | 28 ++--- .../hui-entity-button-card-editor.ts | 18 +-- .../config-elements/hui-gauge-card-editor.ts | 56 ++++----- .../config-elements/hui-glance-card-editor.ts | 18 ++- .../config-elements/hui-iframe-card-editor.ts | 15 +-- .../config-elements/hui-light-card-editor.ts | 15 +-- .../config-elements/hui-map-card-editor.ts | 18 ++- .../hui-markdown-card-editor.ts | 15 +-- .../hui-media-control-card-editor.ts | 18 +-- .../hui-picture-card-editor.ts | 15 +-- .../hui-plant-status-card-editor.ts | 15 +-- .../config-elements/hui-sensor-card-editor.ts | 15 +-- .../hui-shopping-list-editor.ts | 15 +-- .../hui-thermostat-card-editor.ts | 15 +-- .../hui-weather-forecast-card-editor.ts | 18 +-- .../lovelace/editor/hui-dialog-save-config.ts | 25 ++-- .../hui-dialog-edit-lovelace.ts | 22 ++-- .../lovelace-editor/hui-lovelace-editor.ts | 13 +- .../show-edit-lovelace-dialog.ts | 4 +- .../view-editor/hui-dialog-edit-view.ts | 16 +-- .../editor/view-editor/hui-edit-view.ts | 47 ++++--- .../editor/view-editor/hui-view-editor.ts | 15 +-- .../view-editor/show-edit-view-dialog.ts | 4 +- 40 files changed, 473 insertions(+), 563 deletions(-) diff --git a/src/panels/lovelace/components/hui-action-editor.ts b/src/panels/lovelace/components/hui-action-editor.ts index 20c6248a45..472de0d87d 100644 --- a/src/panels/lovelace/components/hui-action-editor.ts +++ b/src/panels/lovelace/components/hui-action-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-textarea"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; @@ -31,15 +32,15 @@ declare global { } } +@customElement("hui-action-editor") export class HuiActionEditor extends LitElement { - public config?: ActionConfig; - public label?: string; - public actions?: string[]; - protected hass?: HomeAssistant; + @property() public config?: ActionConfig; - static get properties(): PropertyDeclarations { - return { hass: {}, config: {}, label: {}, actions: {} }; - } + @property() public label?: string; + + @property() public actions?: string[]; + + @property() protected hass?: HomeAssistant; get _action(): string { return this.config!.action || ""; @@ -126,5 +127,3 @@ declare global { "hui-action-editor": HuiActionEditor; } } - -customElements.define("hui-action-editor", HuiActionEditor); diff --git a/src/panels/lovelace/components/hui-card-options.ts b/src/panels/lovelace/components/hui-card-options.ts index 374506ccd1..5eac60e0ff 100644 --- a/src/panels/lovelace/components/hui-card-options.ts +++ b/src/panels/lovelace/components/hui-card-options.ts @@ -1,4 +1,12 @@ -import { html, LitElement, PropertyDeclarations } from "lit-element"; +import { + html, + LitElement, + customElement, + property, + css, + CSSResult, + TemplateResult, +} from "lit-element"; import "@material/mwc-button"; import "@polymer/paper-menu-button/paper-menu-button"; import "@polymer/paper-icon-button/paper-icon-button"; @@ -12,63 +20,18 @@ import { Lovelace } from "../types"; import { swapCard } from "../editor/config-util"; import { showMoveCardViewDialog } from "../editor/card-editor/show-move-card-view-dialog"; +@customElement("hui-card-options") export class HuiCardOptions extends LitElement { public cardConfig?: LovelaceCardConfig; - public hass?: HomeAssistant; - public lovelace?: Lovelace; - public path?: [number, number]; - static get properties(): PropertyDeclarations { - return { hass: {}, lovelace: {}, path: {} }; - } + @property() public hass?: HomeAssistant; - protected render() { + @property() public lovelace?: Lovelace; + + @property() public path?: [number, number]; + + protected render(): TemplateResult | void { return html` -
@@ -122,6 +85,54 @@ export class HuiCardOptions extends LitElement { `; } + static get styles(): CSSResult { + return css` + div.options { + border-top: 1px solid #e8e8e8; + padding: 5px 8px; + background: var(--paper-card-background-color, white); + box-shadow: rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, + rgba(0, 0, 0, 0.12) 0px 1px 5px -4px, + rgba(0, 0, 0, 0.2) 0px 3px 1px -2px; + display: flex; + } + + div.options .primary-actions { + flex: 1; + margin: auto; + } + + div.options .secondary-actions { + flex: 4; + text-align: right; + } + + paper-icon-button { + color: var(--primary-text-color); + } + + paper-icon-button.move-arrow[disabled] { + color: var(--disabled-text-color); + } + + paper-menu-button { + color: var(--secondary-text-color); + padding: 0; + } + + paper-item.header { + color: var(--primary-text-color); + text-transform: uppercase; + font-weight: 500; + font-size: 14px; + } + + paper-item { + cursor: pointer; + } + `; + } + private _editCard(): void { showEditCardDialog(this, { lovelace: this.lovelace!, @@ -162,5 +173,3 @@ declare global { "hui-card-options": HuiCardOptions; } } - -customElements.define("hui-card-options", HuiCardOptions); diff --git a/src/panels/lovelace/components/hui-entities-toggle.ts b/src/panels/lovelace/components/hui-entities-toggle.ts index e65bf1546d..0c64f794ab 100644 --- a/src/panels/lovelace/components/hui-entities-toggle.ts +++ b/src/panels/lovelace/components/hui-entities-toggle.ts @@ -1,9 +1,12 @@ import { html, LitElement, - PropertyDeclarations, PropertyValues, TemplateResult, + customElement, + property, + css, + CSSResult, } from "lit-element"; import { PaperToggleButtonElement } from "@polymer/paper-toggle-button/paper-toggle-button"; @@ -11,20 +14,15 @@ import { DOMAINS_TOGGLE } from "../../../common/const"; import { turnOnOffEntities } from "../common/entity/turn-on-off-entities"; import { HomeAssistant } from "../../../types"; +@customElement("hui-entities-toggle") class HuiEntitiesToggle extends LitElement { - public entities?: string[]; - protected hass?: HomeAssistant; - private _toggleEntities?: string[]; + @property() public entities?: string[]; - static get properties(): PropertyDeclarations { - return { - hass: {}, - entities: {}, - _toggleEntities: {}, - }; - } + @property() protected hass?: HomeAssistant; - public updated(changedProperties: PropertyValues) { + @property() private _toggleEntities?: string[]; + + public updated(changedProperties: PropertyValues): void { super.updated(changedProperties); if (changedProperties.has("entities")) { this._toggleEntities = this.entities!.filter( @@ -41,7 +39,6 @@ class HuiEntitiesToggle extends LitElement { } return html` - ${this.renderStyle()} Entities
${this.entities.map((entityConf, index) => { @@ -79,13 +76,11 @@ export class HuiEntityEditor extends LitElement { fireEvent(this, "entities-changed", { entities: newConfigEntities }); } - private renderStyle(): TemplateResult { - return html` - + static get styles(): CSSResult { + return css` + .entities { + padding-left: 20px; + } `; } } @@ -95,5 +90,3 @@ declare global { "hui-entity-editor": HuiEntityEditor; } } - -customElements.define("hui-entity-editor", HuiEntityEditor); diff --git a/src/panels/lovelace/components/hui-generic-entity-row.ts b/src/panels/lovelace/components/hui-generic-entity-row.ts index 03ecc5ef08..d38b413dfc 100644 --- a/src/panels/lovelace/components/hui-generic-entity-row.ts +++ b/src/panels/lovelace/components/hui-generic-entity-row.ts @@ -6,6 +6,7 @@ import { CSSResult, PropertyValues, property, + TemplateResult, } from "lit-element"; import { HomeAssistant } from "../../../types"; @@ -19,10 +20,12 @@ import "../components/hui-warning"; class HuiGenericEntityRow extends LitElement { @property() public hass?: HomeAssistant; + @property() public config?: EntitiesCardEntityConfig; + @property() public showSecondary: boolean = true; - protected render() { + protected render(): TemplateResult | void { if (!this.hass || !this.config) { return html``; } @@ -73,7 +76,7 @@ class HuiGenericEntityRow extends LitElement { `; } - protected updated(changedProps: PropertyValues) { + protected updated(changedProps: PropertyValues): void { super.updated(changedProps); if (changedProps.has("hass")) { this.toggleAttribute("rtl", computeRTL(this.hass!)); diff --git a/src/panels/lovelace/components/hui-image.ts b/src/panels/lovelace/components/hui-image.ts index 04a12f34d8..213220772d 100644 --- a/src/panels/lovelace/components/hui-image.ts +++ b/src/panels/lovelace/components/hui-image.ts @@ -12,6 +12,7 @@ import { css, PropertyValues, query, + customElement, } from "lit-element"; import { HomeAssistant } from "../../../types"; import { styleMap } from "lit-html/directives/style-map"; @@ -26,33 +27,43 @@ export interface StateSpecificConfig { [state: string]: string; } -/* - * @appliesMixin LocalizeMixin - */ +@customElement("hui-image") class HuiImage extends LitElement { @property() public hass?: HomeAssistant; + @property() public entity?: string; + @property() public image?: string; + @property() public stateImage?: StateSpecificConfig; + @property() public cameraImage?: string; + @property() public aspectRatio?: string; + @property() public filter?: string; + @property() public stateFilter?: StateSpecificConfig; @property() private _loadError?: boolean; + @property() private _cameraImageSrc?: string; + @query("img") private _image!: HTMLImageElement; + private _lastImageHeight?: number; + private _cameraUpdater?: number; + private _attached?: boolean; - public connectedCallback() { + public connectedCallback(): void { super.connectedCallback(); this._attached = true; this._startUpdateCameraInterval(); } - public disconnectedCallback() { + public disconnectedCallback(): void { super.disconnectedCallback(); this._attached = false; this._stopUpdateCameraInterval(); @@ -137,7 +148,7 @@ class HuiImage extends LitElement { } } - private _startUpdateCameraInterval() { + private _startUpdateCameraInterval(): void { this._stopUpdateCameraInterval(); if (this.cameraImage && this._attached) { this._cameraUpdater = window.setInterval( @@ -147,23 +158,23 @@ class HuiImage extends LitElement { } } - private _stopUpdateCameraInterval() { + private _stopUpdateCameraInterval(): void { if (this._cameraUpdater) { clearInterval(this._cameraUpdater); } } - private _onImageError() { + private _onImageError(): void { this._loadError = true; } - private async _onImageLoad() { + private async _onImageLoad(): Promise { this._loadError = false; await this.updateComplete; this._lastImageHeight = this._image.offsetHeight; } - private async _updateCameraImageSrc() { + private async _updateCameraImageSrc(): Promise { if (!this.hass || !this.cameraImage) { return; } @@ -221,5 +232,3 @@ declare global { "hui-image": HuiImage; } } - -customElements.define("hui-image", HuiImage); diff --git a/src/panels/lovelace/components/hui-theme-select-editor.ts b/src/panels/lovelace/components/hui-theme-select-editor.ts index 318e42add8..2dbc863293 100644 --- a/src/panels/lovelace/components/hui-theme-select-editor.ts +++ b/src/panels/lovelace/components/hui-theme-select-editor.ts @@ -1,8 +1,11 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, + css, + CSSResult, } from "lit-element"; import "@material/mwc-button"; @@ -20,16 +23,11 @@ declare global { } } +@customElement("hui-theme-selection-editor") export class HuiThemeSelectionEditor extends LitElement { - public value?: string; - public hass?: HomeAssistant; + @property() public value?: string; - static get properties(): PropertyDeclarations { - return { - hass: {}, - value: {}, - }; - } + @property() public hass?: HomeAssistant; protected render(): TemplateResult | void { const themes = ["Backend-selected", "default"].concat( @@ -37,7 +35,6 @@ export class HuiThemeSelectionEditor extends LitElement { ); return html` - ${this.renderStyle()} - paper-dropdown-menu { - width: 100%; - } - + static get styles(): CSSResult { + return css` + paper-dropdown-menu { + width: 100%; + } `; } @@ -82,5 +77,3 @@ declare global { "hui-theme-select-editor": HuiThemeSelectionEditor; } } - -customElements.define("hui-theme-select-editor", HuiThemeSelectionEditor); diff --git a/src/panels/lovelace/components/hui-timestamp-display.ts b/src/panels/lovelace/components/hui-timestamp-display.ts index 1c03a8807f..9d3ca782c0 100644 --- a/src/panels/lovelace/components/hui-timestamp-display.ts +++ b/src/panels/lovelace/components/hui-timestamp-display.ts @@ -1,9 +1,10 @@ import { html, LitElement, - PropertyDeclarations, PropertyValues, TemplateResult, + customElement, + property, } from "lit-element"; import { HomeAssistant } from "../../../types"; @@ -19,30 +20,32 @@ const FORMATS: { [key: string]: (ts: Date, lang: string) => string } = { }; const INTERVAL_FORMAT = ["relative", "total"]; +@customElement("hui-timestamp-display") class HuiTimestampDisplay extends LitElement { - public hass?: HomeAssistant; - public ts?: Date; - public format?: "relative" | "total" | "date" | "datetime" | "time"; - private _relative?: string; + @property() public hass?: HomeAssistant; + + @property() public ts?: Date; + + @property() public format?: + | "relative" + | "total" + | "date" + | "datetime" + | "time"; + + @property() private _relative?: string; + private _connected?: boolean; + private _interval?: number; - static get properties(): PropertyDeclarations { - return { - ts: {}, - hass: {}, - format: {}, - _relative: {}, - }; - } - - public connectedCallback() { + public connectedCallback(): void { super.connectedCallback(); this._connected = true; this._startInterval(); } - public disconnectedCallback() { + public disconnectedCallback(): void { super.disconnectedCallback(); this._connected = false; this._clearInterval(); @@ -65,18 +68,18 @@ class HuiTimestampDisplay extends LitElement { return html` ${this._relative} `; - } else if (format in FORMATS) { + } + if (format in FORMATS) { return html` ${FORMATS[format](this.ts, this.hass.language)} `; - } else { - return html` - Invalid format - `; } + return html` + Invalid format + `; } - protected updated(changedProperties: PropertyValues) { + protected updated(changedProperties: PropertyValues): void { super.updated(changedProperties); if (!changedProperties.has("format") || !this._connected) { return; @@ -89,11 +92,11 @@ class HuiTimestampDisplay extends LitElement { } } - private get _format() { + private get _format(): string { return this.format || "relative"; } - private _startInterval() { + private _startInterval(): void { this._clearInterval(); if (this._connected && INTERVAL_FORMAT.includes(this._format)) { this._updateRelative(); @@ -101,14 +104,14 @@ class HuiTimestampDisplay extends LitElement { } } - private _clearInterval() { + private _clearInterval(): void { if (this._interval) { clearInterval(this._interval); this._interval = undefined; } } - private _updateRelative() { + private _updateRelative(): void { if (this.ts && this.hass!.localize) { this._relative = this._format === "relative" @@ -126,5 +129,3 @@ declare global { "hui-timestamp-display": HuiTimestampDisplay; } } - -customElements.define("hui-timestamp-display", HuiTimestampDisplay); diff --git a/src/panels/lovelace/components/hui-yaml-editor.ts b/src/panels/lovelace/components/hui-yaml-editor.ts index c0709b837c..d0efdf1eed 100644 --- a/src/panels/lovelace/components/hui-yaml-editor.ts +++ b/src/panels/lovelace/components/hui-yaml-editor.ts @@ -6,6 +6,7 @@ import codeMirrorCSS from "codemirror/lib/codemirror.css"; import { HomeAssistant } from "../../../types"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeRTL } from "../../../common/util/compute_rtl"; +import { customElement } from "lit-element"; declare global { interface HASSDomEvents { @@ -16,9 +17,12 @@ declare global { } } +@customElement("hui-yaml-editor") export class HuiYamlEditor extends HTMLElement { public _hass?: HomeAssistant; + public codemirror: CodeMirror; + private _value: string; public constructor() { @@ -108,7 +112,7 @@ export class HuiYamlEditor extends HTMLElement { fireEvent(this, "yaml-changed", { value: this.codemirror.getValue() }); } - private setScrollBarDirection() { + private setScrollBarDirection(): void { if (!this.codemirror) { return; } @@ -124,5 +128,3 @@ declare global { "hui-yaml-editor": HuiYamlEditor; } } - -window.customElements.define("hui-yaml-editor", HuiYamlEditor); diff --git a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts index 869a376f54..6caebb4255 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts @@ -1,4 +1,11 @@ -import { html, css, LitElement, TemplateResult, CSSResult } from "lit-element"; +import { + html, + css, + LitElement, + TemplateResult, + CSSResult, + customElement, +} from "lit-element"; import "@material/mwc-button"; import { HomeAssistant } from "../../../../types"; @@ -33,8 +40,10 @@ const cards = [ { name: "Weather Forecast", type: "weather-forecast" }, ]; +@customElement("hui-card-picker") export class HuiCardPicker extends LitElement { public hass?: HomeAssistant; + public cardPicked?: (cardConf: LovelaceCardConfig) => void; protected render(): TemplateResult | void { @@ -97,5 +106,3 @@ declare global { "hui-card-picker": HuiCardPicker; } } - -customElements.define("hui-card-picker", HuiCardPicker); diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index 0170f16984..28651529ce 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import { HomeAssistant } from "../../../../types"; @@ -23,18 +24,13 @@ declare global { } } +@customElement("hui-dialog-edit-card") export class HuiDialogEditCard extends LitElement { - protected hass?: HomeAssistant; - private _params?: EditCardDialogParams; - private _cardConfig?: LovelaceCardConfig; + @property() protected hass?: HomeAssistant; - static get properties(): PropertyDeclarations { - return { - hass: {}, - _params: {}, - _cardConfig: {}, - }; - } + @property() private _params?: EditCardDialogParams; + + @property() private _cardConfig?: LovelaceCardConfig; constructor() { super(); @@ -78,11 +74,11 @@ export class HuiDialogEditCard extends LitElement { `; } - private _cardPicked(cardConf: LovelaceCardConfig) { + private _cardPicked(cardConf: LovelaceCardConfig): void { this._cardConfig = cardConf; } - private _cancel() { + private _cancel(): void { this._params = undefined; this._cardConfig = undefined; } @@ -93,5 +89,3 @@ declare global { "hui-dialog-edit-card": HuiDialogEditCard; } } - -customElements.define("hui-dialog-edit-card", HuiDialogEditCard); diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-move-card-view.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-move-card-view.ts index 58ac1051c6..1cd86ebee7 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-move-card-view.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-move-card-view.ts @@ -1,8 +1,11 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, + css, + CSSResult, } from "lit-element"; import "@polymer/paper-dialog/paper-dialog"; import "@polymer/paper-item/paper-item"; @@ -13,14 +16,9 @@ import { moveCard } from "../config-util"; import { MoveCardViewDialogParams } from "./show-move-card-view-dialog"; import { PolymerChangedEvent } from "../../../../polymer-types"; +@customElement("hui-dialog-move-card-view") export class HuiDialogMoveCardView extends LitElement { - private _params?: MoveCardViewDialogParams; - - static get properties(): PropertyDeclarations { - return { - _params: {}, - }; - } + @property() private _params?: MoveCardViewDialogParams; public async showDialog(params: MoveCardViewDialogParams): Promise { this._params = params; @@ -32,29 +30,6 @@ export class HuiDialogMoveCardView extends LitElement { return html``; } return html` - void; public closeDialog?: () => void; - static get properties(): PropertyDeclarations { - return {}; - } - protected render(): TemplateResult | void { return html` void; - private _configElement?: LovelaceCardEditor | null; - private _uiEditor?: boolean; - private _configValue?: ConfigValue; - private _configState?: string; - private _loading?: boolean; - private _saving: boolean; - private _errorMsg?: TemplateResult; - private _cardType?: string; + @property() public hass?: HomeAssistant; - static get properties(): PropertyDeclarations { - return { - hass: {}, - cardConfig: {}, - viewIndex: {}, - _cardIndex: {}, - _configElement: {}, - _configValue: {}, - _configState: {}, - _errorMsg: {}, - _uiEditor: {}, - _saving: {}, - _loading: {}, - }; - } + @property() public cardConfig?: LovelaceCardConfig; + + public lovelace?: Lovelace; + + public path?: [number] | [number, number]; + + public closeDialog?: () => void; + + @property() private _configElement?: LovelaceCardEditor | null; + + @property() private _uiEditor?: boolean; + + @property() private _configValue?: ConfigValue; + + @property() private _configState?: string; + + @property() private _loading?: boolean; + + @property() private _saving: boolean; + + @property() private _errorMsg?: TemplateResult; + + private _cardType?: string; private get _dialog(): PaperDialogElement { return this.shadowRoot!.querySelector("paper-dialog")!; @@ -88,7 +86,7 @@ export class HuiEditCard extends LitElement { return this.shadowRoot!.querySelector("hui-card-preview")!; } - protected constructor() { + public constructor() { super(); this._saving = false; } @@ -270,7 +268,7 @@ export class HuiEditCard extends LitElement { this._updatePreview(value); } - private async _updatePreview(config: LovelaceCardConfig) { + private async _updatePreview(config: LovelaceCardConfig): Promise { await this.updateComplete; if (!this._previewEl) { @@ -286,7 +284,7 @@ export class HuiEditCard extends LitElement { } } - private _setPreviewError(error: ConfigError) { + private _setPreviewError(error: ConfigError): void { if (!this._previewEl) { return; } @@ -323,7 +321,7 @@ export class HuiEditCard extends LitElement { this._resizeDialog(); } - private _isConfigValid() { + private _isConfigValid(): boolean { if (!this._configValue || !this._configValue.value) { return false; } @@ -401,7 +399,7 @@ export class HuiEditCard extends LitElement { return this.path!.length === 1; } - private _openedChanged(ev) { + private _openedChanged(ev): void { if (!ev.detail.value) { this.closeDialog!(); } @@ -518,5 +516,3 @@ declare global { "hui-edit-card": HuiEditCard; } } - -customElements.define("hui-edit-card", HuiEditCard); diff --git a/src/panels/lovelace/editor/card-editor/show-edit-card-dialog.ts b/src/panels/lovelace/editor/card-editor/show-edit-card-dialog.ts index 0eb932f758..b2cb6d2501 100644 --- a/src/panels/lovelace/editor/card-editor/show-edit-card-dialog.ts +++ b/src/panels/lovelace/editor/card-editor/show-edit-card-dialog.ts @@ -17,7 +17,7 @@ export interface EditCardDialogParams { path: [number] | [number, number]; } -const registerEditCardDialog = (element: HTMLElement) => +const registerEditCardDialog = (element: HTMLElement): Event => fireEvent(element, "register-dialog", { dialogShowEvent, dialogTag, @@ -28,7 +28,7 @@ const registerEditCardDialog = (element: HTMLElement) => export const showEditCardDialog = ( element: HTMLElement, editCardDialogParams: EditCardDialogParams -) => { +): void => { if (!registeredDialog) { registeredDialog = true; registerEditCardDialog(element); diff --git a/src/panels/lovelace/editor/card-editor/show-move-card-view-dialog.ts b/src/panels/lovelace/editor/card-editor/show-move-card-view-dialog.ts index 5ffccaaa44..c68e3cc635 100644 --- a/src/panels/lovelace/editor/card-editor/show-move-card-view-dialog.ts +++ b/src/panels/lovelace/editor/card-editor/show-move-card-view-dialog.ts @@ -15,7 +15,7 @@ export interface MoveCardViewDialogParams { lovelace: Lovelace; } -const registerEditCardDialog = (element: HTMLElement) => +const registerEditCardDialog = (element: HTMLElement): Event => fireEvent(element, "register-dialog", { dialogShowEvent: "show-move-card-view", dialogTag: "hui-dialog-move-card-view", @@ -26,7 +26,7 @@ const registerEditCardDialog = (element: HTMLElement) => export const showMoveCardViewDialog = ( element: HTMLElement, moveCardViewDialogParams: MoveCardViewDialogParams -) => { +): void => { if (!registeredDialog) { registeredDialog = true; registerEditCardDialog(element); diff --git a/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts index 969a48f2e6..8daa8ead02 100644 --- a/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts @@ -1,8 +1,11 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, + CSSResult, + css, } from "lit-element"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; import "@polymer/paper-item/paper-item"; @@ -26,20 +29,18 @@ const cardConfigStruct = struct({ states: "array?", }); +@customElement("hui-alarm-panel-card-editor") export class HuiAlarmPanelCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _entity(): string { return this._config!.entity || ""; } @@ -60,7 +61,7 @@ export class HuiAlarmPanelCardEditor extends LitElement const states = ["arm_home", "arm_away", "arm_night", "arm_custom_bypass"]; return html` - ${configElementStyle} ${this.renderStyle()} + ${configElementStyle}
- .states { - display: flex; - flex-direction: row; - } - .deleteState { - visibility: hidden; - } - .states:hover > .deleteState { - visibility: visible; - } - ha-icon { - padding-top: 12px; - } - + static get styles(): CSSResult { + return css` + .states { + display: flex; + flex-direction: row; + } + .deleteState { + visibility: hidden; + } + .states:hover > .deleteState { + visibility: visible; + } + ha-icon { + padding-top: 12px; + } `; } @@ -190,5 +189,3 @@ declare global { "hui-alarm-panel-card-editor": HuiAlarmPanelCardEditor; } } - -customElements.define("hui-alarm-panel-card-editor", HuiAlarmPanelCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts index 8aa763b492..7e61259e97 100644 --- a/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; import "@polymer/paper-item/paper-item"; @@ -44,10 +45,19 @@ const cardConfigStruct = struct({ entities: [entitiesConfigStruct], }); +@customElement("hui-entities-card-editor") export class HuiEntitiesCardEditor extends LitElement implements LovelaceCardEditor { - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {}, _configEntities: {} }; + @property() public hass?: HomeAssistant; + + @property() private _config?: EntitiesCardConfig; + + @property() private _configEntities?: EntitiesCardEntityConfig[]; + + public setConfig(config: EntitiesCardConfig): void { + config = cardConfigStruct(config); + this._config = config; + this._configEntities = processEditorEntities(config.entities); } get _title(): string { @@ -58,16 +68,6 @@ export class HuiEntitiesCardEditor extends LitElement return this._config!.theme || "Backend-selected"; } - public hass?: HomeAssistant; - private _config?: EntitiesCardConfig; - private _configEntities?: EntitiesCardEntityConfig[]; - - public setConfig(config: EntitiesCardConfig): void { - config = cardConfigStruct(config); - this._config = config; - this._configEntities = processEditorEntities(config.entities); - } - protected render(): TemplateResult | void { if (!this.hass) { return html``; @@ -141,5 +141,3 @@ declare global { "hui-entities-card-editor": HuiEntitiesCardEditor; } } - -customElements.define("hui-entities-card-editor", HuiEntitiesCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-entity-button-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-entity-button-card-editor.ts index 8fd9fb8961..7318a1f270 100644 --- a/src/panels/lovelace/editor/config-elements/hui-entity-button-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-entity-button-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -33,20 +34,18 @@ const cardConfigStruct = struct({ theme: "string?", }); +@customElement("hui-entity-button-card-editor") export class HuiEntityButtonCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _entity(): string { return this._config!.entity || ""; } @@ -161,8 +160,3 @@ declare global { "hui-entity-button-card-editor": HuiEntityButtonCardEditor; } } - -customElements.define( - "hui-entity-button-card-editor", - HuiEntityButtonCardEditor -); diff --git a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts index 328077be8f..a9f5af2dec 100644 --- a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts @@ -1,8 +1,11 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, + css, + CSSResult, } from "lit-element"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-toggle-button/paper-toggle-button"; @@ -29,22 +32,21 @@ const cardConfigStruct = struct({ theme: "string?", }); +@customElement("hui-gauge-card-editor") export class HuiGaugeCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; + private _useSeverity?: boolean; public setConfig(config: Config): void { config = cardConfigStruct(config); - this._useSeverity = config.severity ? true : false; + this._useSeverity = !!config.severity; this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _name(): string { return this._config!.name || ""; } @@ -79,7 +81,7 @@ export class HuiGaugeCardEditor extends LitElement } return html` - ${configElementStyle} ${this.renderStyle()} + ${configElementStyle}
- .severity { - display: none; - width: 100%; - padding-left: 16px; - flex-direction: row; - flex-wrap: wrap; - } - .severity > * { - flex: 1 0 30%; - padding-right: 4px; - } - paper-toggle-button[checked] ~ .severity { - display: flex; - } - + static get styles(): CSSResult { + return css` + .severity { + display: none; + width: 100%; + padding-left: 16px; + flex-direction: row; + flex-wrap: wrap; + } + .severity > * { + flex: 1 0 30%; + padding-right: 4px; + } + paper-toggle-button[checked] ~ .severity { + display: flex; + } `; } @@ -243,5 +243,3 @@ declare global { "hui-gauge-card-editor": HuiGaugeCardEditor; } } - -customElements.define("hui-gauge-card-editor", HuiGaugeCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-glance-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-glance-card-editor.ts index a3270c3cb2..a879dda2bd 100644 --- a/src/panels/lovelace/editor/config-elements/hui-glance-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-glance-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; import "@polymer/paper-item/paper-item"; @@ -43,11 +44,14 @@ const cardConfigStruct = struct({ entities: [entitiesConfigStruct], }); +@customElement("hui-glance-card-editor") export class HuiGlanceCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; - private _configEntities?: ConfigEntity[]; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; + + @property() private _configEntities?: ConfigEntity[]; public setConfig(config: Config): void { config = cardConfigStruct(config); @@ -55,10 +59,6 @@ export class HuiGlanceCardEditor extends LitElement this._configEntities = processEditorEntities(config.entities); } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {}, _configEntities: {} }; - } - get _title(): string { return this._config!.title || ""; } @@ -162,5 +162,3 @@ declare global { "hui-glance-card-editor": HuiGlanceCardEditor; } } - -customElements.define("hui-glance-card-editor", HuiGlanceCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-iframe-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-iframe-card-editor.ts index 347365f698..6d01f24ee5 100644 --- a/src/panels/lovelace/editor/config-elements/hui-iframe-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-iframe-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -21,20 +22,18 @@ const cardConfigStruct = struct({ aspect_ratio: "string?", }); +@customElement("hui-iframe-card-editor") export class HuiIframeCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _title(): string { return this._config!.title || ""; } @@ -110,5 +109,3 @@ declare global { "hui-iframe-card-editor": HuiIframeCardEditor; } } - -customElements.define("hui-iframe-card-editor", HuiIframeCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts index a2f748bb2f..742fe7ee4c 100644 --- a/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -24,20 +25,18 @@ const cardConfigStruct = struct({ theme: "string?", }); +@customElement("hui-light-card-editor") export class HuiLightCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {}, _configEntities: {} }; - } - get _name(): string { return this._config!.name || ""; } @@ -112,5 +111,3 @@ declare global { "hui-light-card-editor": HuiLightCardEditor; } } - -customElements.define("hui-light-card-editor", HuiLightCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts index b2161e4bb3..045c7f94dc 100644 --- a/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -35,10 +36,13 @@ const cardConfigStruct = struct({ entities: [entitiesConfigStruct], }); +@customElement("hui-map-card-editor") export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: MapCardConfig; - private _configEntities?: EntityConfig[]; + @property() public hass?: HomeAssistant; + + @property() private _config?: MapCardConfig; + + @property() private _configEntities?: EntityConfig[]; public setConfig(config: MapCardConfig): void { config = cardConfigStruct(config); @@ -46,10 +50,6 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor { this._configEntities = processEditorEntities(config.entities); } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {}, _configEntities: {} }; - } - get _title(): string { return this._config!.title || ""; } @@ -137,5 +137,3 @@ declare global { "hui-map-card-editor": HuiMapCardEditor; } } - -customElements.define("hui-map-card-editor", HuiMapCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts index 8c06bea724..d9af9cf701 100644 --- a/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-input/paper-textarea"; @@ -21,20 +22,18 @@ const cardConfigStruct = struct({ content: "string", }); +@customElement("hui-markdown-card-editor") export class HuiMarkdownCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _title(): string { return this._config!.title || ""; } @@ -98,5 +97,3 @@ declare global { "hui-markdown-card-editor": HuiMarkdownCardEditor; } } - -customElements.define("hui-markdown-card-editor", HuiMarkdownCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts index baaa846515..6a3b6a835d 100644 --- a/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import { struct } from "../../common/structs/struct"; @@ -19,20 +20,18 @@ const cardConfigStruct = struct({ entity: "string?", }); +@customElement("hui-media-control-card-editor") export class HuiMediaControlCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _entity(): string { return this._config!.entity || ""; } @@ -83,8 +82,3 @@ declare global { "hui-media-control-card-editor": HuiMediaControlCardEditor; } } - -customElements.define( - "hui-media-control-card-editor", - HuiMediaControlCardEditor -); diff --git a/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts index f53d4af3da..b6cfc6125a 100644 --- a/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -28,20 +29,18 @@ const cardConfigStruct = struct({ hold_action: struct.optional(actionConfigStruct), }); +@customElement("hui-picture-card-editor") export class HuiPictureCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _image(): string { return this._config!.image || ""; } @@ -123,5 +122,3 @@ declare global { "hui-picture-card-editor": HuiPictureCardEditor; } } - -customElements.define("hui-picture-card-editor", HuiPictureCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts index 63fe65eea5..942da40302 100644 --- a/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -23,20 +24,18 @@ const cardConfigStruct = struct({ name: "string?", }); +@customElement("hui-plant-status-card-editor") export class HuiPlantStatusCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _entity(): string { return this._config!.entity || ""; } @@ -100,5 +99,3 @@ declare global { "hui-plant-status-card-editor": HuiPlantStatusCardEditor; } } - -customElements.define("hui-plant-status-card-editor", HuiPlantStatusCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts index acf2f74f06..062a9baeed 100644 --- a/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; @@ -32,20 +33,18 @@ const cardConfigStruct = struct({ hours_to_show: "number?", }); +@customElement("hui-sensor-card-editor") export class HuiSensorCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _entity(): string { return this._config!.entity || ""; } @@ -194,5 +193,3 @@ declare global { "hui-sensor-card-editor": HuiSensorCardEditor; } } - -customElements.define("hui-sensor-card-editor", HuiSensorCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts b/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts index 91b960b905..b2c0090299 100644 --- a/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -18,20 +19,18 @@ const cardConfigStruct = struct({ title: "string?", }); +@customElement("hui-shopping-list-card-editor") export class HuiShoppingListEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _title(): string { return this._config!.title || ""; } @@ -81,5 +80,3 @@ declare global { "hui-shopping-list-card-editor": HuiShoppingListEditor; } } - -customElements.define("hui-shopping-list-card-editor", HuiShoppingListEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts index 4c3d16aa18..bc6e27edae 100644 --- a/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -24,20 +25,18 @@ const cardConfigStruct = struct({ theme: "string?", }); +@customElement("hui-thermostat-card-editor") export class HuiThermostatCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _entity(): string { return this._config!.entity || ""; } @@ -109,5 +108,3 @@ declare global { "hui-thermostat-card-editor": HuiThermostatCardEditor; } } - -customElements.define("hui-thermostat-card-editor", HuiThermostatCardEditor); diff --git a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts index 607baeadaa..cf394c5450 100644 --- a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import { struct } from "../../common/structs/struct"; @@ -21,20 +22,18 @@ const cardConfigStruct = struct({ name: "string?", }); +@customElement("hui-weather-forecast-card-editor") export class HuiWeatherForecastCardEditor extends LitElement implements LovelaceCardEditor { - public hass?: HomeAssistant; - private _config?: Config; + @property() public hass?: HomeAssistant; + + @property() private _config?: Config; public setConfig(config: Config): void { config = cardConfigStruct(config); this._config = config; } - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } - get _entity(): string { return this._config!.entity || ""; } @@ -98,8 +97,3 @@ declare global { "hui-weather-forecast-card-editor": HuiWeatherForecastCardEditor; } } - -customElements.define( - "hui-weather-forecast-card-editor", - HuiWeatherForecastCardEditor -); diff --git a/src/panels/lovelace/editor/hui-dialog-save-config.ts b/src/panels/lovelace/editor/hui-dialog-save-config.ts index d8575d77d5..b6d94943c1 100644 --- a/src/panels/lovelace/editor/hui-dialog-save-config.ts +++ b/src/panels/lovelace/editor/hui-dialog-save-config.ts @@ -2,11 +2,11 @@ import { html, css, LitElement, - PropertyDeclarations, TemplateResult, CSSResult, + customElement, + property, } from "lit-element"; - import "@polymer/paper-spinner/paper-spinner"; import "@polymer/paper-dialog/paper-dialog"; // This is not a duplicate import, one is for types, one is for element. @@ -15,25 +15,18 @@ import { PaperDialogElement } from "@polymer/paper-dialog/paper-dialog"; import "@material/mwc-button"; import { haStyleDialog } from "../../../resources/styles"; - import { HomeAssistant } from "../../../types"; - import { SaveDialogParams } from "./show-save-config-dialog"; +@customElement("hui-save-config") export class HuiSaveConfig extends LitElement { - public hass?: HomeAssistant; - private _params?: SaveDialogParams; - private _saving: boolean; + @property() public hass?: HomeAssistant; - static get properties(): PropertyDeclarations { - return { - hass: {}, - _params: {}, - _saving: {}, - }; - } + @property() private _params?: SaveDialogParams; - protected constructor() { + @property() private _saving: boolean; + + public constructor() { super(); this._saving = false; } @@ -145,5 +138,3 @@ declare global { "hui-dialog-save-config": HuiSaveConfig; } } - -customElements.define("hui-dialog-save-config", HuiSaveConfig); diff --git a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts index 72e121e563..2b62748c09 100644 --- a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts +++ b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts @@ -2,9 +2,10 @@ import { html, css, LitElement, - PropertyDeclarations, TemplateResult, CSSResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-spinner/paper-spinner"; import "@polymer/paper-dialog/paper-dialog"; @@ -21,20 +22,17 @@ import { HomeAssistant } from "../../../../types"; import { LovelaceConfig } from "../../../../data/lovelace"; import { Lovelace } from "../../types"; +@customElement("hui-dialog-edit-lovelace") export class HuiDialogEditLovelace extends LitElement { - public hass?: HomeAssistant; - private _lovelace?: Lovelace; + @property() public hass?: HomeAssistant; + + @property() private _lovelace?: Lovelace; + private _config?: LovelaceConfig; + private _saving: boolean; - static get properties(): PropertyDeclarations { - return { - hass: {}, - _lovelace: {}, - }; - } - - protected constructor() { + public constructor() { super(); this._saving = false; } @@ -168,5 +166,3 @@ declare global { "hui-dialog-edit-lovelace": HuiDialogEditLovelace; } } - -customElements.define("hui-dialog-edit-lovelace", HuiDialogEditLovelace); diff --git a/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts b/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts index 1944a38982..2cbea06bdc 100644 --- a/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts +++ b/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; @@ -21,13 +22,11 @@ declare global { } } +@customElement("hui-lovelace-editor") export class HuiLovelaceEditor extends LitElement { - static get properties(): PropertyDeclarations { - return { hass: {}, config: {} }; - } + @property() public hass?: HomeAssistant; - public hass?: HomeAssistant; - public config?: LovelaceConfig; + @property() public config?: LovelaceConfig; get _title(): string { if (!this.config) { @@ -79,5 +78,3 @@ declare global { "hui-lovelace-editor": HuiLovelaceEditor; } } - -customElements.define("hui-lovelace-editor", HuiLovelaceEditor); diff --git a/src/panels/lovelace/editor/lovelace-editor/show-edit-lovelace-dialog.ts b/src/panels/lovelace/editor/lovelace-editor/show-edit-lovelace-dialog.ts index bc042dfa15..fe95b27853 100644 --- a/src/panels/lovelace/editor/lovelace-editor/show-edit-lovelace-dialog.ts +++ b/src/panels/lovelace/editor/lovelace-editor/show-edit-lovelace-dialog.ts @@ -12,7 +12,7 @@ let registeredDialog = false; const dialogShowEvent = "show-edit-lovelace"; const dialogTag = "hui-dialog-edit-lovelace"; -const registerEditLovelaceDialog = (element: HTMLElement) => +const registerEditLovelaceDialog = (element: HTMLElement): Event => fireEvent(element, "register-dialog", { dialogShowEvent, dialogTag, @@ -23,7 +23,7 @@ const registerEditLovelaceDialog = (element: HTMLElement) => export const showEditLovelaceDialog = ( element: HTMLElement, lovelace: Lovelace -) => { +): void => { if (!registeredDialog) { registeredDialog = true; registerEditLovelaceDialog(element); diff --git a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts index 163127b073..30f5532830 100644 --- a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import { HomeAssistant } from "../../../../types"; @@ -21,16 +22,11 @@ declare global { } } +@customElement("hui-dialog-edit-view") export class HuiDialogEditView extends LitElement { - protected hass?: HomeAssistant; - private _params?: EditViewDialogParams; + @property() protected hass?: HomeAssistant; - static get properties(): PropertyDeclarations { - return { - hass: {}, - _params: {}, - }; - } + @property() private _params?: EditViewDialogParams; public async showDialog(params: EditViewDialogParams): Promise { this._params = params; @@ -58,5 +54,3 @@ declare global { "hui-dialog-edit-view": HuiDialogEditView; } } - -customElements.define("hui-dialog-edit-view", HuiDialogEditView); diff --git a/src/panels/lovelace/editor/view-editor/hui-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-edit-view.ts index 721aab61e4..ff115e7cf5 100644 --- a/src/panels/lovelace/editor/view-editor/hui-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-edit-view.ts @@ -2,9 +2,10 @@ import { html, css, LitElement, - PropertyDeclarations, TemplateResult, CSSResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-spinner/paper-spinner"; @@ -35,31 +36,27 @@ import { navigate } from "../../../../common/navigate"; import { Lovelace } from "../../types"; import { deleteView, addView, replaceView } from "../config-util"; +@customElement("hui-edit-view") export class HuiEditView extends LitElement { - public lovelace?: Lovelace; - public viewIndex?: number; - public hass?: HomeAssistant; - private _config?: LovelaceViewConfig; - private _badges?: EntityConfig[]; - private _cards?: LovelaceCardConfig[]; - private _saving: boolean; + @property() public lovelace?: Lovelace; + + @property() public viewIndex?: number; + + @property() public hass?: HomeAssistant; + + @property() private _config?: LovelaceViewConfig; + + @property() private _badges?: EntityConfig[]; + + @property() private _cards?: LovelaceCardConfig[]; + + @property() private _saving: boolean; + + @property() private _curTab?: string; + private _curTabIndex: number; - private _curTab?: string; - static get properties(): PropertyDeclarations { - return { - hass: {}, - lovelace: {}, - viewIndex: {}, - _config: {}, - _badges: {}, - _cards: {}, - _saving: {}, - _curTab: {}, - }; - } - - protected constructor() { + public constructor() { super(); this._saving = false; this._curTabIndex = 0; @@ -162,7 +159,7 @@ export class HuiEditView extends LitElement { `; } - private async _delete() { + private async _delete(): Promise { if (this._cards && this._cards.length > 0) { alert( "You can't delete a view that has cards in it. Remove the cards first." @@ -321,5 +318,3 @@ declare global { "hui-edit-view": HuiEditView; } } - -customElements.define("hui-edit-view", HuiEditView); diff --git a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts index 5e845aacc5..cea486b521 100644 --- a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts +++ b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts @@ -1,8 +1,9 @@ import { html, LitElement, - PropertyDeclarations, TemplateResult, + customElement, + property, } from "lit-element"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-toggle-button/paper-toggle-button"; @@ -23,10 +24,11 @@ declare global { } } +@customElement("hui-view-editor") export class HuiViewEditor extends LitElement { - static get properties(): PropertyDeclarations { - return { hass: {}, _config: {} }; - } + @property() public hass?: HomeAssistant; + + @property() private _config?: LovelaceViewConfig; get _path(): string { if (!this._config) { @@ -63,9 +65,6 @@ export class HuiViewEditor extends LitElement { return this._config.panel || false; } - public hass?: HomeAssistant; - private _config?: LovelaceViewConfig; - set config(config: LovelaceViewConfig) { this._config = config; } @@ -142,5 +141,3 @@ declare global { "hui-view-editor": HuiViewEditor; } } - -customElements.define("hui-view-editor", HuiViewEditor); diff --git a/src/panels/lovelace/editor/view-editor/show-edit-view-dialog.ts b/src/panels/lovelace/editor/view-editor/show-edit-view-dialog.ts index a3f7748de7..135630644a 100644 --- a/src/panels/lovelace/editor/view-editor/show-edit-view-dialog.ts +++ b/src/panels/lovelace/editor/view-editor/show-edit-view-dialog.ts @@ -22,7 +22,7 @@ export interface EditViewDialogParams { viewIndex?: number; } -const registerEditViewDialog = (element: HTMLElement) => +const registerEditViewDialog = (element: HTMLElement): Event => fireEvent(element, "register-dialog", { dialogShowEvent, dialogTag, @@ -33,7 +33,7 @@ const registerEditViewDialog = (element: HTMLElement) => export const showEditViewDialog = ( element: HTMLElement, editViewDialogParams: EditViewDialogParams -) => { +): void => { if (!registeredDialog) { registeredDialog = true; registerEditViewDialog(element); From daaaef96b010be4125c9b8d36bc5f12c993802f2 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 5 Mar 2019 12:42:42 -0800 Subject: [PATCH 02/31] Limit service worker (#2886) --- demo/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/demo/webpack.config.js b/demo/webpack.config.js index 3ba0f389df..c20cb63558 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -74,6 +74,7 @@ module.exports = { new WorkboxPlugin.GenerateSW({ swDest: "service_worker_es5.js", importWorkboxFrom: "local", + include: [], }), ].filter(Boolean), resolve: webpackBase.resolve, From 1c6235546a3c2c2c9b445c81976ab260b714481b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 5 Mar 2019 13:10:35 -0800 Subject: [PATCH 03/31] Swap out babel-minify for terser (#2885) --- config/webpack.js | 37 ++--- demo/webpack.config.js | 2 +- gallery/webpack.config.js | 14 +- hassio/webpack.config.js | 9 +- package.json | 2 +- webpack.config.js | 2 +- yarn.lock | 315 ++++---------------------------------- 7 files changed, 49 insertions(+), 332 deletions(-) diff --git a/config/webpack.js b/config/webpack.js index 118fb0e23f..452b8c913b 100644 --- a/config/webpack.js +++ b/config/webpack.js @@ -1,6 +1,6 @@ const webpack = require("webpack"); const path = require("path"); -const BabelMinifyPlugin = require("babel-minify-webpack-plugin"); +const TerserPlugin = require("terser-webpack-plugin"); module.exports.resolve = { extensions: [".ts", ".js", ".json", ".tsx"], @@ -29,32 +29,15 @@ module.exports.plugins = [ ), ]; -module.exports.optimization = { +module.exports.optimization = (latestBuild) => ({ minimizer: [ - // Took options from Polymer build tool - // https://github.com/Polymer/tools/blob/master/packages/build/src/js-transform.ts - new BabelMinifyPlugin( - { - // Disable the minify-constant-folding plugin because it has a bug relating - // to invalid substitution of constant values into export specifiers: - // https://github.com/babel/minify/issues/820 - evaluate: false, - - // TODO(aomarks) Find out why we disabled this plugin. - simplifyComparisons: false, - - // Prevent removal of things that babel thinks are unreachable, but sometimes - // gets wrong: https://github.com/Polymer/tools/issues/724 - deadcode: false, - - // Disable the simplify plugin because it can eat some statements preceeding - // loops. https://github.com/babel/minify/issues/824 - simplify: false, - - // This is breaking ES6 output. https://github.com/Polymer/tools/issues/261 - mangle: false, + new TerserPlugin({ + cache: true, + parallel: true, + extractComments: true, + terserOptions: { + ecma: latestBuild ? undefined : 5, }, - {} - ), + }), ], -}; +}); diff --git a/demo/webpack.config.js b/demo/webpack.config.js index c20cb63558..63ac853147 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -39,7 +39,7 @@ module.exports = { }, ], }, - optimization: webpackBase.optimization, + optimization: webpackBase.optimization(latestBuild), plugins: [ new webpack.DefinePlugin({ __DEV__: false, diff --git a/gallery/webpack.config.js b/gallery/webpack.config.js index 82a7008709..0db9c2f935 100644 --- a/gallery/webpack.config.js +++ b/gallery/webpack.config.js @@ -7,6 +7,7 @@ const isProd = process.env.NODE_ENV === "production"; const chunkFilename = isProd ? "chunk.[chunkhash].js" : "[name].chunk.js"; const buildPath = path.resolve(__dirname, "dist"); const publicPath = isProd ? "./" : "http://localhost:8080/"; +const latestBuild = true; module.exports = { mode: isProd ? "production" : "development", @@ -16,7 +17,7 @@ module.exports = { entry: "./src/entrypoint.js", module: { rules: [ - babelLoaderConfig({ latestBuild: true }), + babelLoaderConfig({ latestBuild }), { test: /\.css$/, use: "raw-loader", @@ -32,7 +33,7 @@ module.exports = { }, ], }, - optimization: webpackBase.optimization, + optimization: webpackBase.optimization(latestBuild), plugins: [ new CopyWebpackPlugin([ "public", @@ -51,15 +52,6 @@ module.exports = { to: "static/images/leaflet/", }, ]), - isProd && - new UglifyJsPlugin({ - extractComments: true, - sourceMap: true, - uglifyOptions: { - // Disabling because it broke output - mangle: false, - }, - }), ].filter(Boolean), resolve: webpackBase.resolve, output: { diff --git a/hassio/webpack.config.js b/hassio/webpack.config.js index f4acec7d3a..48f9809307 100644 --- a/hassio/webpack.config.js +++ b/hassio/webpack.config.js @@ -1,11 +1,12 @@ const CompressionPlugin = require("compression-webpack-plugin"); const config = require("./config.js"); const { babelLoaderConfig } = require("../config/babel.js"); -const { minimizer } = require("../config/babel.js"); +const webpackBase = require("../config/webpack.js"); const isProdBuild = process.env.NODE_ENV === "production"; const isCI = process.env.CI === "true"; const chunkFilename = isProdBuild ? "chunk.[chunkhash].js" : "[name].chunk.js"; +const latestBuild = false; module.exports = { mode: isProdBuild ? "production" : "development", @@ -15,7 +16,7 @@ module.exports = { }, module: { rules: [ - babelLoaderConfig({ latestBuild: false }), + babelLoaderConfig({ latestBuild }), { test: /\.(html)$/, use: { @@ -27,9 +28,7 @@ module.exports = { }, ], }, - optimization: { - minimizer, - }, + optimization: webpackBase.optimization(latestBuild), plugins: [ isProdBuild && !isCI && diff --git a/package.json b/package.json index 1d604cb278..b0e05eada9 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,6 @@ "@types/mocha": "^5.2.5", "babel-eslint": "^10", "babel-loader": "^8.0.4", - "babel-minify-webpack-plugin": "^0.3.1", "chai": "^4.2.0", "compression-webpack-plugin": "^2.0.0", "copy-webpack-plugin": "^4.5.2", @@ -146,6 +145,7 @@ "reify": "^0.18.1", "require-dir": "^1.0.0", "sinon": "^7.1.1", + "terser-webpack-plugin": "^1.2.3", "ts-mocha": "^2.0.0", "tslint": "^5.11.0", "tslint-config-prettier": "^1.15.0", diff --git a/webpack.config.js b/webpack.config.js index ec6d52dc1a..1a13b77e3d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -76,7 +76,7 @@ function createConfig(isProdBuild, latestBuild) { }, ], }, - optimization: webpackBase.optimization, + optimization: webpackBase.optimization(latestBuild), plugins: [ new webpack.DefinePlugin({ __DEV__: JSON.stringify(!isProdBuild), diff --git a/yarn.lock b/yarn.lock index 52134e3a39..56606ad990 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2923,31 +2923,6 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-core@^6.26.0: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - babel-eslint@^10: version "10.0.1" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" @@ -2967,7 +2942,7 @@ babel-extract-comments@^1.0.0: dependencies: babylon "^6.18.0" -babel-generator@^6.26.0, babel-generator@^6.26.1: +babel-generator@^6.26.1: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== @@ -2981,21 +2956,11 @@ babel-generator@^6.26.0, babel-generator@^6.26.1: source-map "^0.5.7" trim-right "^1.0.1" -babel-helper-evaluate-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.3.0.tgz#2439545e0b6eae5b7f49b790acbebd6b9a73df20" - integrity sha512-dRFlMTqUJRGzx5a2smKxmptDdNCXKSkPcXWzKLwAV72hvIZumrd/0z9RcewHkr7PmAEq+ETtpD1GK6wZ6ZUXzw== - babel-helper-evaluate-path@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.4.3.tgz#0a89af702c06b217027fa371908dd4989d3e633f" integrity sha1-ComvcCwGshcCf6NxkI3UmJ0+Yz8= -babel-helper-flip-expressions@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.3.0.tgz#f5b6394bd5219b43cf8f7b201535ed540c6e7fa2" - integrity sha512-kNGohWmtAG3b7tN1xocRQ5rsKkH/hpvZsMiGOJ1VwGJKhnwzR5KlB3rvKBaBPl5/IGHcopB2JN+r1SUEX1iMAw== - babel-helper-flip-expressions@^0.4.1, babel-helper-flip-expressions@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd" @@ -3006,54 +2971,26 @@ babel-helper-is-nodes-equiv@^0.0.1: resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" integrity sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ= -babel-helper-is-void-0@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.3.0.tgz#95570d20bd27b2206f68083ae9980ee7003d8fe7" - integrity sha512-JVqdX8y7Rf/x4NwbqtUI7mdQjL9HWoDnoAEQ8Gv8oxzjvbJv+n75f7l36m9Y8C7sCUltX3V5edndrp7Hp1oSXQ== - babel-helper-is-void-0@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz#7d9c01b4561e7b95dbda0f6eee48f5b60e67313e" integrity sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4= -babel-helper-mark-eval-scopes@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.3.0.tgz#b4731314fdd7a89091271a5213b4e12d236e29e8" - integrity sha512-nrho5Dg4vl0VUgURVpGpEGiwbst5JX7efIyDHFxmkCx/ocQFnrPt8ze9Kxl6TKjR29bJ7D/XKY1NMlSxOQJRbQ== - babel-helper-mark-eval-scopes@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" integrity sha1-0kSjvvmESHJgP/tG4izorN9VFWI= -babel-helper-remove-or-void@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.3.0.tgz#f43c86147c8fcc395a9528cbb31e7ff49d7e16e3" - integrity sha512-D68W1M3ibCcbg0ysh3ww4/O0g10X1CXK720oOuR8kpfY7w0yP4tVcpK7zDmI1JecynycTQYAZ1rhLJo9aVtIKQ== - babel-helper-remove-or-void@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" integrity sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA= -babel-helper-to-multiple-sequence-expressions@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.3.0.tgz#8da2275ccc26995566118f7213abfd9af7214427" - integrity sha512-1uCrBD+EAaMnAYh7hc944n8Ga19y3daEnoXWPYDvFVsxMCc1l8aDjksApaCEaNSSuewq8BEcff47Cy1PbLg2Gw== - babel-helper-to-multiple-sequence-expressions@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.4.3.tgz#5b518b1127f47b3038773386a1561a2b48e632b6" integrity sha1-W1GLESf0ezA4dzOGoVYaK0jmMrY= -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-loader@^8.0.4: version "8.0.5" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33" @@ -3071,22 +3008,6 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-minify-webpack-plugin@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/babel-minify-webpack-plugin/-/babel-minify-webpack-plugin-0.3.1.tgz#292aa240af190e2dcadf4f684d6d84d179b6d5a4" - integrity sha512-Johg6Ju0Gxevk2R55eutMqnyXwlyUzCtwunBpiyNzoxGnKum+x5nfNuYZYHGd5Bmc1gmhjwzb7GkxHWOtYWmtQ== - dependencies: - babel-core "^6.26.0" - babel-preset-minify "^0.3.0" - webpack-sources "^1.0.1" - -babel-plugin-minify-builtins@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.3.0.tgz#4740117a6a784063aaf8f092989cf9e4bd484860" - integrity sha512-MqhSHlxkmgURqj3144qPksbZ/qof1JWdumcbucc4tysFcf3P3V3z3munTevQgKEFNMd8F5/ECGnwb63xogLjAg== - dependencies: - babel-helper-evaluate-path "^0.3.0" - babel-plugin-minify-builtins@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.4.3.tgz#9ea3d59f4ac4a7bb958d712d29556a1f86f7f81e" @@ -3094,13 +3015,6 @@ babel-plugin-minify-builtins@^0.4.0-alpha.caaefb4c: dependencies: babel-helper-evaluate-path "^0.4.3" -babel-plugin-minify-constant-folding@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.3.0.tgz#687e40336bd4ddd921e0e197f0006235ac184bb9" - integrity sha512-1XeRpx+aY1BuNY6QU/cm6P+FtEi3ar3XceYbmC+4q4W+2Ewq5pL7V68oHg1hKXkBIE0Z4/FjSoHz6vosZLOe/A== - dependencies: - babel-helper-evaluate-path "^0.3.0" - babel-plugin-minify-constant-folding@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.4.3.tgz#300f9de8dda0844a176b193653960e24ad33e191" @@ -3108,16 +3022,6 @@ babel-plugin-minify-constant-folding@^0.4.0-alpha.caaefb4c: dependencies: babel-helper-evaluate-path "^0.4.3" -babel-plugin-minify-dead-code-elimination@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.3.0.tgz#a323f686c404b824186ba5583cf7996cac81719e" - integrity sha512-SjM2Fzg85YZz+q/PNJ/HU4O3W98FKFOiP9K5z3sfonlamGOzvZw3Eup2OTiEBsbbqTeY8yzNCAv3qpJRYCgGmw== - dependencies: - babel-helper-evaluate-path "^0.3.0" - babel-helper-mark-eval-scopes "^0.3.0" - babel-helper-remove-or-void "^0.3.0" - lodash.some "^4.6.0" - babel-plugin-minify-dead-code-elimination@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.4.3.tgz#73628265864f9008d0027506f58abeb3c1d02d98" @@ -3128,13 +3032,6 @@ babel-plugin-minify-dead-code-elimination@^0.4.0-alpha.caaefb4c: babel-helper-remove-or-void "^0.4.3" lodash.some "^4.6.0" -babel-plugin-minify-flip-comparisons@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.3.0.tgz#6627893a409c9f30ef7f2c89e0c6eea7ee97ddc4" - integrity sha512-B8lK+ekcpSNVH7PZpWDe5nC5zxjRiiT4nTsa6h3QkF3Kk6y9qooIFLemdGlqBq6j0zALEnebvCpw8v7gAdpgnw== - dependencies: - babel-helper-is-void-0 "^0.3.0" - babel-plugin-minify-flip-comparisons@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz#00ca870cb8f13b45c038b3c1ebc0f227293c965a" @@ -3149,13 +3046,6 @@ babel-plugin-minify-guarded-expressions@=0.4.1: dependencies: babel-helper-flip-expressions "^0.4.1" -babel-plugin-minify-guarded-expressions@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.3.0.tgz#2552d96189ef45d9a463f1a6b5e4fa110703ac8d" - integrity sha512-O+6CvF5/Ttsth3LMg4/BhyvVZ82GImeKMXGdVRQGK/8jFiP15EjRpdgFlxv3cnqRjqdYxLCS6r28VfLpb9C/kA== - dependencies: - babel-helper-flip-expressions "^0.3.0" - babel-plugin-minify-guarded-expressions@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.3.tgz#cc709b4453fd21b1f302877444c89f88427ce397" @@ -3163,23 +3053,11 @@ babel-plugin-minify-guarded-expressions@^0.4.0-alpha.caaefb4c: dependencies: babel-helper-flip-expressions "^0.4.3" -babel-plugin-minify-infinity@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.3.0.tgz#c5ec0edd433517cf31b3af17077c202beb48bbe7" - integrity sha512-Sj8ia3/w9158DWieUxU6/VvnYVy59geeFEkVgLZYBE8EBP+sN48tHtBM/jSgz0ejEdBlcfqJ6TnvPmVXTzR2BQ== - babel-plugin-minify-infinity@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz#dfb876a1b08a06576384ef3f92e653ba607b39ca" integrity sha1-37h2obCKBldjhO8/kuZTumB7Oco= -babel-plugin-minify-mangle-names@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.3.0.tgz#f28561bad0dd2f0380816816bb946e219b3b6135" - integrity sha512-PYTonhFWURsfAN8achDwvR5Xgy6EeTClLz+fSgGRqjAIXb0OyFm3/xfccbQviVi1qDXmlSnt6oJhBg8KE4Fn7Q== - dependencies: - babel-helper-mark-eval-scopes "^0.3.0" - babel-plugin-minify-mangle-names@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.4.3.tgz#16f1bff74b7a7c93dfc241e7831dd5fb4b023ef7" @@ -3187,35 +3065,16 @@ babel-plugin-minify-mangle-names@^0.4.0-alpha.caaefb4c: dependencies: babel-helper-mark-eval-scopes "^0.4.3" -babel-plugin-minify-numeric-literals@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.3.0.tgz#b57734a612e8a592005407323c321119f27d4b40" - integrity sha512-TgZj6ay8zDw74AS3yiIfoQ8vRSNJisYO/Du60S8nPV7EW7JM6fDMx5Sar6yVHlVuuwNgvDUBh191K33bVrAhpg== - babel-plugin-minify-numeric-literals@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz#8e4fd561c79f7801286ff60e8c5fd9deee93c0bc" integrity sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw= -babel-plugin-minify-replace@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.3.0.tgz#980125bbf7cbb5a637439de9d0b1b030a4693893" - integrity sha512-VR6tTg2Lt0TicHIOw04fsUtpPw7RaRP8PC8YzSFwEixnzvguZjZJoL7TgG7ZyEWQD1cJ96UezswECmFNa815bg== - babel-plugin-minify-replace@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.4.3.tgz#9d289f4ba15d4e6011e8799fa5f1ba77ec81219d" integrity sha1-nSifS6FdTmAR6HmfpfG6d+yBIZ0= -babel-plugin-minify-simplify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.3.0.tgz#14574cc74d21c81d3060fafa041010028189f11b" - integrity sha512-2M16ytQOCqBi7bYMu4DCWn8e6KyFCA108F6+tVrBJxOmm5u2sOmTFEa8s94tR9RHRRNYmcUf+rgidfnzL3ik9Q== - dependencies: - babel-helper-flip-expressions "^0.3.0" - babel-helper-is-nodes-equiv "^0.0.1" - babel-helper-to-multiple-sequence-expressions "^0.3.0" - babel-plugin-minify-simplify@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.4.3.tgz#37756d85c614464b4b0927f2b4e417191d55738a" @@ -3225,13 +3084,6 @@ babel-plugin-minify-simplify@^0.4.0-alpha.caaefb4c: babel-helper-is-nodes-equiv "^0.0.1" babel-helper-to-multiple-sequence-expressions "^0.4.3" -babel-plugin-minify-type-constructors@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.3.0.tgz#7f5a86ef322c4746364e3c591b8514eeafea6ad4" - integrity sha512-XRXpvsUCPeVw9YEUw+9vSiugcSZfow81oIJT0yR9s8H4W7yJ6FHbImi5DJHoL8KcDUjYnL9wYASXk/fOkbyR6Q== - dependencies: - babel-helper-is-void-0 "^0.3.0" - babel-plugin-minify-type-constructors@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz#1bc6f15b87f7ab1085d42b330b717657a2156500" @@ -3244,11 +3096,6 @@ babel-plugin-syntax-object-rest-spread@^6.8.0: resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= -babel-plugin-transform-inline-consecutive-adds@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.3.0.tgz#f07d93689c0002ed2b2b62969bdd99f734e03f57" - integrity sha512-iZsYAIjYLLfLK0yN5WVT7Xf7Y3wQ9Z75j9A8q/0IglQSpUt2ppTdHlwl/GeaXnxdaSmsxBu861klbTBbv2n+RA== - babel-plugin-transform-inline-consecutive-adds@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1" @@ -3259,31 +3106,16 @@ babel-plugin-transform-member-expression-literals@^6.10.0-alpha.caaefb4c: resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.10.0-alpha.f95869d4.tgz#272ebd2a2d4341b86c24dcd84374ae5aa3702874" integrity sha1-Jy69Ki1DQbhsJNzYQ3SuWqNwKHQ= -babel-plugin-transform-member-expression-literals@^6.9.0: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf" - integrity sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8= - babel-plugin-transform-merge-sibling-variables@^6.10.0-alpha.caaefb4c: version "6.10.0-alpha.f95869d4" resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.10.0-alpha.f95869d4.tgz#48a330d28293e318d07175c260c74859e7398b43" integrity sha1-SKMw0oKT4xjQcXXCYMdIWec5i0M= -babel-plugin-transform-merge-sibling-variables@^6.9.0: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz#85b422fc3377b449c9d1cde44087203532401dae" - integrity sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4= - babel-plugin-transform-minify-booleans@^6.10.0-alpha.caaefb4c: version "6.10.0-alpha.f95869d4" resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.10.0-alpha.f95869d4.tgz#1deef69c22135038a91de1f5d13d759e3464c43c" integrity sha1-He72nCITUDipHeH10T11njRkxDw= -babel-plugin-transform-minify-booleans@^6.9.0: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" - integrity sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg= - babel-plugin-transform-object-rest-spread@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" @@ -3299,18 +3131,6 @@ babel-plugin-transform-property-literals@^6.10.0-alpha.caaefb4c: dependencies: esutils "^2.0.2" -babel-plugin-transform-property-literals@^6.9.0: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" - integrity sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk= - dependencies: - esutils "^2.0.2" - -babel-plugin-transform-regexp-constructors@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.3.0.tgz#9bb2c8dd082271a5cb1b3a441a7c52e8fd07e0f5" - integrity sha512-h92YHzyl042rb0naKO8frTHntpRFwRgKkfWD8602kFHoQingjJNtbvZzvxqHncJ6XmKVyYvfrBpDOSkCTDIIxw== - babel-plugin-transform-regexp-constructors@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz#58b7775b63afcf33328fae9a5f88fbd4fb0b4965" @@ -3321,28 +3141,11 @@ babel-plugin-transform-remove-console@^6.10.0-alpha.caaefb4c: resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.10.0-alpha.f95869d4.tgz#c5717af9f76918b2821cfaef44d8245d4ea9422c" integrity sha1-xXF6+fdpGLKCHPrvRNgkXU6pQiw= -babel-plugin-transform-remove-console@^6.9.0: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" - integrity sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A= - babel-plugin-transform-remove-debugger@^6.10.0-alpha.caaefb4c: version "6.10.0-alpha.f95869d4" resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.10.0-alpha.f95869d4.tgz#1fc35c29c7c0878cf30e558a733651906e888e44" integrity sha1-H8NcKcfAh4zzDlWKczZRkG6IjkQ= -babel-plugin-transform-remove-debugger@^6.9.0: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2" - integrity sha1-QrcnYxyXl44estGZp67IShgznvI= - -babel-plugin-transform-remove-undefined@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.3.0.tgz#03f5f0071867781e9beabbc7b77bf8095fd3f3ec" - integrity sha512-TYGQucc8iP3LJwN3kDZLEz5aa/2KuFrqpT+s8f8NnHsBU1sAgR3y8Opns0xhC+smyDYWscqFCKM1gbkWQOhhnw== - dependencies: - babel-helper-evaluate-path "^0.3.0" - babel-plugin-transform-remove-undefined@^0.4.0-alpha.caaefb4c: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.4.3.tgz#d40b0da7f91c08c06cc72b767474c01c4894de02" @@ -3355,21 +3158,11 @@ babel-plugin-transform-simplify-comparison-operators@^6.10.0-alpha.caaefb4c: resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.10.0-alpha.f95869d4.tgz#f5499a6dc3ed686bda53363866b67dda774c5bed" integrity sha1-9UmabcPtaGvaUzY4ZrZ92ndMW+0= -babel-plugin-transform-simplify-comparison-operators@^6.9.0: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" - integrity sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk= - babel-plugin-transform-undefined-to-void@^6.10.0-alpha.caaefb4c: version "6.10.0-alpha.f95869d4" resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.10.0-alpha.f95869d4.tgz#175a1a3090e616403f8c819cdcea1aecb66523b2" integrity sha1-F1oaMJDmFkA/jIGc3Ooa7LZlI7I= -babel-plugin-transform-undefined-to-void@^6.9.0: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" - integrity sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA= - babel-preset-minify@=0.4.0-alpha.caaefb4c: version "0.4.0-alpha.caaefb4c" resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.4.0-alpha.caaefb4c.tgz#a5052c5955dd97d24699b281fda9a302ea8c1871" @@ -3399,48 +3192,6 @@ babel-preset-minify@=0.4.0-alpha.caaefb4c: babel-plugin-transform-undefined-to-void "^6.10.0-alpha.caaefb4c" lodash.isplainobject "^4.0.6" -babel-preset-minify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.3.0.tgz#7db64afa75f16f6e06c0aa5f25195f6f36784d77" - integrity sha512-+VV2GWEyak3eDOmzT1DDMuqHrw3VbE9nBNkx2LLVs4pH/Me32ND8DRpVDd8IRvk1xX5p75nygyRPtkMh6GIAbQ== - dependencies: - babel-plugin-minify-builtins "^0.3.0" - babel-plugin-minify-constant-folding "^0.3.0" - babel-plugin-minify-dead-code-elimination "^0.3.0" - babel-plugin-minify-flip-comparisons "^0.3.0" - babel-plugin-minify-guarded-expressions "^0.3.0" - babel-plugin-minify-infinity "^0.3.0" - babel-plugin-minify-mangle-names "^0.3.0" - babel-plugin-minify-numeric-literals "^0.3.0" - babel-plugin-minify-replace "^0.3.0" - babel-plugin-minify-simplify "^0.3.0" - babel-plugin-minify-type-constructors "^0.3.0" - babel-plugin-transform-inline-consecutive-adds "^0.3.0" - babel-plugin-transform-member-expression-literals "^6.9.0" - babel-plugin-transform-merge-sibling-variables "^6.9.0" - babel-plugin-transform-minify-booleans "^6.9.0" - babel-plugin-transform-property-literals "^6.9.0" - babel-plugin-transform-regexp-constructors "^0.3.0" - babel-plugin-transform-remove-console "^6.9.0" - babel-plugin-transform-remove-debugger "^6.9.0" - babel-plugin-transform-remove-undefined "^0.3.0" - babel-plugin-transform-simplify-comparison-operators "^6.9.0" - babel-plugin-transform-undefined-to-void "^6.9.0" - lodash.isplainobject "^4.0.6" - -babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" @@ -3449,17 +3200,6 @@ babel-runtime@^6.22.0, babel-runtime@^6.26.0: core-js "^2.4.0" regenerator-runtime "^0.11.0" -babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" @@ -4712,7 +4452,7 @@ content-type@^1.0.2, content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== -convert-source-map@^1.1.0, convert-source-map@^1.1.1, convert-source-map@^1.5.1: +convert-source-map@^1.1.0, convert-source-map@^1.1.1: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== @@ -4770,11 +4510,6 @@ core-js@^2.4.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== -core-js@^2.5.0: - version "2.5.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" - integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== - core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -7487,14 +7222,6 @@ home-assistant-js-websocket@^3.2.4: resolved "https://registry.yarnpkg.com/home-assistant-js-websocket/-/home-assistant-js-websocket-3.2.5.tgz#ac4fa6a7cb5cb48efe2a49390cf24acb5439f51f" integrity sha512-CRlq9WA1WGw9lVzouK4BxEGEP5JqWV2MBBZyiUPVgBLHPR9p3bJL/y+jNhnjqEyb8QNPVboGuAJ+Rylrl7o2dg== -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" @@ -8516,7 +8243,7 @@ json3@3.3.2, json3@^3.3.2: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" integrity sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE= -json5@^0.5.0, json5@^0.5.1: +json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= @@ -10755,7 +10482,7 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: +path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= @@ -11338,7 +11065,7 @@ pretty-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= -private@^0.1.6, private@^0.1.8, private@~0.1.5: +private@^0.1.6, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== @@ -12620,13 +12347,6 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" - source-map-support@^0.5.6: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" @@ -12635,7 +12355,7 @@ source-map-support@^0.5.6: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@~0.5.6: +source-map-support@~0.5.6, source-map-support@~0.5.9: version "0.5.10" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ== @@ -13216,6 +12936,29 @@ terser-webpack-plugin@^1.1.0: webpack-sources "^1.1.0" worker-farm "^1.5.2" +terser-webpack-plugin@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.2.3.tgz#3f98bc902fac3e5d0de730869f50668561262ec8" + integrity sha512-GOK7q85oAb/5kE12fMuLdn2btOS9OBZn4VsecpHDywoUC/jLhSAKOiYo0ezx7ss2EXPMzyEWFoE0s1WLE+4+oA== + dependencies: + cacache "^11.0.2" + find-cache-dir "^2.0.0" + schema-utils "^1.0.0" + serialize-javascript "^1.4.0" + source-map "^0.6.1" + terser "^3.16.1" + webpack-sources "^1.1.0" + worker-farm "^1.5.2" + +terser@^3.16.1: + version "3.16.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-3.16.1.tgz#5b0dd4fa1ffd0b0b43c2493b2c364fd179160493" + integrity sha512-JDJjgleBROeek2iBcSNzOHLKsB/MdDf+E/BOAJ0Tk9r7p9/fVobfv7LMJ/g/k3v9SXdmjZnIlFd5nfn/Rt0Xow== + dependencies: + commander "~2.17.1" + source-map "~0.6.1" + source-map-support "~0.5.9" + terser@^3.8.1: version "3.14.1" resolved "https://registry.yarnpkg.com/terser/-/terser-3.14.1.tgz#cc4764014af570bc79c79742358bd46926018a32" From 1c6bf8b94a8e4987187ebc097fafd2f3ae3502a9 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 6 Mar 2019 09:52:28 -0800 Subject: [PATCH 04/31] Upgrade home-assistant-js-websocket to 3.3.0 (#2887) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b0e05eada9..78b08336b1 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "deep-clone-simple": "^1.1.1", "es6-object-assign": "^1.1.0", "fecha": "^3.0.0", - "home-assistant-js-websocket": "^3.2.4", + "home-assistant-js-websocket": "^3.3.0", "intl-messageformat": "^2.2.0", "jquery": "^3.3.1", "js-yaml": "^3.12.0", diff --git a/yarn.lock b/yarn.lock index 56606ad990..a7955d8337 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7217,10 +7217,10 @@ hoek@4.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" integrity sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA== -home-assistant-js-websocket@^3.2.4: - version "3.2.5" - resolved "https://registry.yarnpkg.com/home-assistant-js-websocket/-/home-assistant-js-websocket-3.2.5.tgz#ac4fa6a7cb5cb48efe2a49390cf24acb5439f51f" - integrity sha512-CRlq9WA1WGw9lVzouK4BxEGEP5JqWV2MBBZyiUPVgBLHPR9p3bJL/y+jNhnjqEyb8QNPVboGuAJ+Rylrl7o2dg== +home-assistant-js-websocket@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/home-assistant-js-websocket/-/home-assistant-js-websocket-3.3.0.tgz#c8bb211c06ff7f8f9ca8391482b0a5e6c7f78711" + integrity sha512-3ObNSMwv9EG+7emcGVOg/QWSTdZ8tCaLTrKCM6LEelefybQPbeZWcW37PzZ5wZxXuTOxSSQhGrvTFS8vubpYfw== homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: version "1.0.1" From a9cecb55ac3ec1878bbce3064f392275c60c0bbc Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Thu, 7 Mar 2019 12:51:57 -0600 Subject: [PATCH 05/31] Update ISSUE_TEMPLATE.md (#2892) --- .github/ISSUE_TEMPLATE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f83a0abcd1..6721eb46bd 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -13,6 +13,10 @@ **Last working Home Assistant release (if known):** +**UI (States or Lovelace UI?):** + **Browser and Operating System:**