@anoki/fse-ui
Version:
FSE UI components library
40 lines (39 loc) • 1.08 kB
JavaScript
import { __require as h } from "./index.es687.js";
var i, d;
function R() {
if (d) return i;
d = 1;
let n = h(), f, u;
class t extends n {
constructor(e) {
super(e), this.type = "root", this.nodes || (this.nodes = []);
}
normalize(e, r, s) {
let a = super.normalize(e);
if (r) {
if (s === "prepend")
this.nodes.length > 1 ? r.raws.before = this.nodes[1].raws.before : delete r.raws.before;
else if (this.first !== r)
for (let l of a)
l.raws.before = r.raws.before;
}
return a;
}
removeChild(e, r) {
let s = this.index(e);
return !r && s === 0 && this.nodes.length > 1 && (this.nodes[1].raws.before = this.nodes[s].raws.before), super.removeChild(e);
}
toResult(e = {}) {
return new f(new u(), this, e).stringify();
}
}
return t.registerLazyResult = (o) => {
f = o;
}, t.registerProcessor = (o) => {
u = o;
}, i = t, t.default = t, n.registerRoot(t), i;
}
export {
R as __require
};
//# sourceMappingURL=index.es699.js.map