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
36 lines (35 loc) • 1.11 kB
JavaScript
/*! on-codemerge v1.3.1 @author Pavel Kuzmin @license MIT @homepage https://s00d.github.io/on-codemerge/ @repository git+https://github.com/s00d/on-codemerge.git Copyright (c) 2026 Pavel Kuzmin - Built on 2026-07-02T13:39:17.947Z */
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
};