on-codemerge
Version:
A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product
35 lines (34 loc) • 873 B
JavaScript
var r = Object.defineProperty;
var f = (e, o, t) => o in e ? r(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
var s = (e, o, t) => f(e, typeof o != "symbol" ? o + "" : o, t);
class i {
constructor() {
s(this, "footnotes", /* @__PURE__ */ new Map());
}
createFootnote(o) {
const t = crypto.randomUUID(), n = { id: t, content: o };
return this.footnotes.set(t, n), n;
}
updateFootnote(o, t) {
const n = this.footnotes.get(o);
n && (n.content = t);
}
getFootnote(o) {
return this.footnotes.get(o);
}
getAllFootnotes() {
return Array.from(this.footnotes.values());
}
getFootnoteNumber(o) {
return Array.from(this.footnotes.keys()).indexOf(o) + 1;
}
deleteFootnote(o) {
this.footnotes.delete(o);
}
destroy() {
this.footnotes.clear();
}
}
export {
i as FootnoteManager
};