Compare commits

..

No commits in common. 'pages' and 'integrate-editor' have entirely different histories.

@ -1,3 +1,3 @@
# loader # loader
loader: builds content to load in a frame and set up sandbox and CSP loader: loads content in a frame and sets up sandbox and CSP

@ -61,7 +61,7 @@ export class Builder {
return `// append: ${s}\n${match}` return `// append: ${s}\n${match}`
} }
).replaceAll( ).replaceAll(
/^\s*import\s+(\{[^}]+\})\s+from\s+("[^"]+")/gms, /^\s*import\s+(\{[^}]+\})\s+from\s+("[^"]+"|')/gms,
(match, p1, p2) => { (match, p1, p2) => {
const vars = p1.replaceAll(' as ', ': ') const vars = p1.replaceAll(' as ', ': ')
const importPath = p2.slice(1, -1) const importPath = p2.slice(1, -1)
@ -91,7 +91,7 @@ export class Builder {
) )
) )
} else { } else {
return ({data}) => data return s => s
} }
} }
@ -101,29 +101,22 @@ export class Builder {
({name, data}) => ([name, data]) ({name, data}) => ([name, data])
) )
) )
const replace = this.buildReplace(filesMap)
const intro = this.buildModule({ const intro = this.buildModule({
name: '_intro.js', name: '_intro.js',
data: replace({ data: (
name: '_intro.js', '_intro.js' in filesMap ?
data: ( filesMap['_intro.js'] :
'_intro.js' in filesMap ? defaultIntro
filesMap['_intro.js'] : ),
defaultIntro
),
files: this.files,
})
}) })
const replace = this.buildReplace(filesMap)
const modules = this.files.filter(({name}) => ( const modules = this.files.filter(({name}) => (
name.endsWith('.js') && name.endsWith('.js') &&
!name.startsWith('_') !name.startsWith('_')
)).map(file => ( )).map(file => (
this.buildModule({ this.buildModule({
...file, ...file,
data: replace({ data: replace(file.data),
...file,
files: this.files,
}),
}) })
)) ))
const styles = this.files.filter(({name}) => ( const styles = this.files.filter(({name}) => (

@ -5,11 +5,9 @@ export class EditorBuild {
'forms/button-group.js', 'forms/button-group.js',
'dialog/dialog.js', 'dialog/dialog.js',
'menu/dropdown.js', 'menu/dropdown.js',
'editor/header.js',
'editor/file-group.js', 'editor/file-group.js',
'editor/file-view.js', 'editor/file-view.js',
'editor/text-edit.js', 'editor/text-edit.js',
'editor/code-edit.js',
'loader/builder.js', 'loader/builder.js',
'editor/app.js', 'editor/app.js',
] ]

Loading…
Cancel
Save