UNPKG

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) 1.06 kB
/*! 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 c = Object.defineProperty; var a = (m, t, e) => t in m ? c(m, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[t] = e; var s = (m, t, e) => a(m, typeof t != "symbol" ? t + "" : t, e); class d { constructor() { s(this, "comments", /* @__PURE__ */ new Map()); } createComment(t) { const e = crypto.randomUUID(), n = Date.now(), o = { id: e, content: t, createdAt: n, updatedAt: n }; return this.comments.set(e, o), o; } getComment(t) { return this.comments.get(t); } updateComment(t, e) { const n = this.comments.get(t); n && (n.content = e, n.updatedAt = Date.now()); } deleteComment(t) { this.comments.delete(t); } getAllComments() { return Array.from(this.comments.values()); } } export { d as CommentManager };