Allow pasting YAML in automation/script editor directly (#24838)

* Allow pasting YAML in automation/script editor directly

* Highlight pasted items

* Change highlighting

* Also reset in script editor

* Show dialog when pasting to changed automation/script

* Add shortcuts to shortcuts dialog

* Use translated shortcut

* Change timeout and clear on save

* Fix imports

* Process code review

* Move paste logic to manual-*-editor
This commit is contained in:
Jan-Philipp Benecke
2025-04-29 18:28:07 +02:00
committed by GitHub
parent 29c11978b3
commit ab415188ba
19 changed files with 658 additions and 71 deletions

View File

@@ -20,6 +20,8 @@ export default class HaScriptFields extends LitElement {
@property({ attribute: false }) public fields!: Fields;
@property({ attribute: false }) public highlightedFields?: Fields;
private _focusLastActionOnChange = false;
protected render() {
@@ -37,6 +39,7 @@ export default class HaScriptFields extends LitElement {
.disabled=${this.disabled}
@value-changed=${this._fieldChanged}
.hass=${this.hass}
?highlight=${this.highlightedFields?.[key] !== undefined}
>
</ha-script-field-row>
`