mirror of
https://github.com/hydra-synth/hydra.git
synced 2025-12-19 13:19:58 +01:00
added editor
This commit is contained in:
25
frontend/web-editor/src/views/EditorComponent.js
Normal file
25
frontend/web-editor/src/views/EditorComponent.js
Normal 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>`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user