added editor

This commit is contained in:
ojack
2022-02-11 15:04:58 +01:00
parent 42d018e941
commit a743109f7a
11 changed files with 8831 additions and 106 deletions

View File

@@ -0,0 +1,25 @@
const html = require('choo/html')
const Component = require('choo/component')
const HydraEditor = require('./editor/editor.js')
module.exports = class Editor extends Component {
constructor (id, state, emit) {
super(id)
this.local = state.components[id] = {}
}
load (element) {
this.editor = new HydraEditor(this.textEl)
}
update (center) {
return false
}
createElement ({ width = window.innerWidth, height = window.innerHeight} = {}) {
this.textEl = html` <textarea></textarea>`
return html`<div id="editor-container">
${this.textEl}
</div>`
}
}