Use codemirror in dialog-import-blueprint (#25034)

* use codemirror

* hass not needed for codemirror

* fix uom for css var
This commit is contained in:
ildar170975 2025-04-14 10:28:28 +03:00 committed by GitHub
parent b3a5ea2893
commit cd91e8c07c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,6 +10,7 @@ import "../../../components/ha-alert";
import "../../../components/ha-textfield";
import "../../../components/ha-dialog";
import "../../../components/ha-dialog-header";
import "../../../components/ha-code-editor";
import type { HaTextField } from "../../../components/ha-textfield";
import type { BlueprintImportResult } from "../../../data/blueprint";
import { importBlueprint, saveBlueprint } from "../../../data/blueprint";
@ -109,7 +110,12 @@ class DialogImportBlueprint extends LitElement {
"ui.panel.config.blueprint.add.raw_blueprint"
)}
>
<pre>${this._result.raw_data}</pre>
<ha-code-editor
mode="yaml"
.value=${this._result.raw_data}
read-only
dir="ltr"
></ha-code-editor>
</ha-expansion-panel>
${this._result?.exists
? html`
@ -274,6 +280,9 @@ class DialogImportBlueprint extends LitElement {
--mdc-dialog-min-width: 90vw;
--mdc-dialog-max-width: 90vw;
}
ha-expansion-panel {
--expansion-panel-content-padding: 0px;
}
`,
];
}