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

33 lines (32 loc) 1.18 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 i = Object.defineProperty; var l = (r, o, t) => o in r ? i(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t; var e = (r, o, t) => l(r, typeof o != "symbol" ? o + "" : o, t); /* empty css */ /* empty css */ import { createContainer as a } from "../../utils/helpers.mjs"; class d { constructor() { e(this, "name", "toolbar"); e(this, "toolbar", null); e(this, "editor", null); } initialize(o) { this.editor = o, this.createToolbar(); } createToolbar() { var t; this.toolbar = a("editor-toolbar"); const o = (t = this.editor) == null ? void 0 : t.getDOMContext().querySelector(".html-editor"); o != null && o.parentNode && this.toolbar && o.parentNode.insertBefore(this.toolbar, o); } destroy() { this.toolbar && (this.toolbar.remove(), this.toolbar = null); } getToolbar() { return this.toolbar; } } export { d as ToolbarPlugin };