Compare commits
8 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
c31205e4da | 3 years ago |
|
|
2a71c59e5f | 3 years ago |
|
|
31473e3876 | 3 years ago |
|
|
a7c0ea4d20 | 3 years ago |
|
|
e59d6dc6be | 3 years ago |
|
|
af3f7ff45d | 3 years ago |
|
|
5c91f5aa7e | 3 years ago |
|
|
202abdbf3e | 3 years ago |
3 changed files with 155 additions and 39 deletions
@ -1,3 +1,3 @@ |
|||
# loader |
|||
|
|||
loader: loads content in a frame and sets up sandbox and CSP |
|||
loader: builds content to load in a frame and set up sandbox and CSP |
|||
@ -0,0 +1,38 @@ |
|||
import { Builder } from "/loader/builder.js" |
|||
|
|||
export class EditorBuild { |
|||
deps = [ |
|||
'forms/button-group.js', |
|||
'dialog/dialog.js', |
|||
'menu/dropdown.js', |
|||
'editor/file-group.js', |
|||
'editor/file-view.js', |
|||
'editor/text-edit.js', |
|||
'loader/builder.js', |
|||
'editor/app.js', |
|||
] |
|||
|
|||
constructor() { |
|||
this.files = undefined |
|||
} |
|||
|
|||
async loadFiles() { |
|||
const files = [] |
|||
for (const name of this.deps) { |
|||
const resp = await fetch(name) |
|||
files.push({ |
|||
name, |
|||
data: await resp.text(), |
|||
}) |
|||
} |
|||
this.files = files |
|||
} |
|||
|
|||
async build() { |
|||
if (this.files === undefined) { |
|||
await this.loadFiles() |
|||
} |
|||
const builder = new Builder(this.files) |
|||
return builder.build() |
|||
} |
|||
} |
|||
Loading…
Reference in new issue