diff --git a/src/editor/editor.js b/src/editor/editor.js index 32d1200..0af5762 100644 --- a/src/editor/editor.js +++ b/src/editor/editor.js @@ -96,6 +96,21 @@ class Editor extends Component { observer(v) { this.#updateStat() } + }, + toolbar: { + type: String, + default: null, + attribute: false, + observer(v) { + if (v === null) { + this.#toolbar = [...TOOLBAR] + } else { + this.#toolbar = v + .split(',') + .filter(it => it) + .map(it => it.trim()) + } + } } } @@ -373,6 +388,8 @@ class Editor extends Component { #gridx = 0 #gridy = 0 + #toolbar = [...TOOLBAR] + #select = null get value() { @@ -653,7 +670,7 @@ class Editor extends Component { return html`
- ${TOOLBAR.map( + ${this.#toolbar.map( it => html`