31d0464a60
- Scaffold: package.json, tsconfig.json, vite.config.ts, index.html - src/lib/imageProcessor.ts: full pipeline (normalize, offset, seam repair, export, validation) - src/components/UploadPanel.tsx: drag-and-drop, file picker, clipboard paste - src/components/SettingsPanel.tsx: all controls per spec - src/components/PreviewPanel.tsx: Original / Tileable / Repeated tabs - src/components/ErrorBanner.tsx: dismissible error/warning banners - src/App.tsx: root component wiring everything together - src/index.css: dark premium glassmorphism theme w/ Inter font
34 lines
654 B
JavaScript
34 lines
654 B
JavaScript
'use strict'
|
|
|
|
let Container = require('./container')
|
|
|
|
let LazyResult, Processor
|
|
|
|
class Document extends Container {
|
|
constructor(defaults) {
|
|
// type needs to be passed to super, otherwise child roots won't be normalized correctly
|
|
super({ type: 'document', ...defaults })
|
|
|
|
if (!this.nodes) {
|
|
this.nodes = []
|
|
}
|
|
}
|
|
|
|
toResult(opts = {}) {
|
|
let lazy = new LazyResult(new Processor(), this, opts)
|
|
|
|
return lazy.stringify()
|
|
}
|
|
}
|
|
|
|
Document.registerLazyResult = dependant => {
|
|
LazyResult = dependant
|
|
}
|
|
|
|
Document.registerProcessor = dependant => {
|
|
Processor = dependant
|
|
}
|
|
|
|
module.exports = Document
|
|
Document.default = Document
|