added html and css editors

This commit is contained in:
David Meincke
2022-03-26 20:44:52 +01:00
parent cda1b5c972
commit 6ed4b80c64
23 changed files with 548 additions and 144 deletions
+8 -2
View File
@@ -2,7 +2,7 @@ import './app.less';
import bootHtml from './app.html';
import { watchConsole } from './injects/watch-console';
import { setOnErrorListener } from './injects/on-error';
import { createScript } from '../shared/create-script';
import { createCss, createHtml, createScript } from '../shared/create-script';
import { messageListener } from '../shared/message-listener';
import { postMessage, postResponseMessage } from '../shared/post-message';
import { RenderCanvas } from './elements/render-canvas/render-canvas';
@@ -17,10 +17,16 @@ watchConsole((type, value) => {
postMessage(parent, type, value);
});
messageListener((type, value, id) => {
if (type == "script") {
if (type == "javascript") {
createScript(value);
postResponseMessage(parent, id, value);
}
else if (type == "html") {
createHtml(value);
}
else if (type == "css") {
createCss(value);
}
});
setOnErrorListener((type, value) => {
postMessage(parent, type, value);