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
37 lines (36 loc) • 1.38 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 d = Object.defineProperty;
var o = (r, i, t) => i in r ? d(r, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[i] = t;
var e = (r, i, t) => o(r, typeof i != "symbol" ? i + "" : i, t);
import "./style.scss.mjs";
import "./public.scss.mjs";
import { createToolbarButton as l } from "../ToolbarPlugin/utils.mjs";
import s from "../../icons/divider.svg.mjs";
let n = 0;
class c {
constructor() {
e(this, "name", "toolbar-divider");
e(this, "divider", null);
e(this, "editor", null);
this.name = this.name + "-" + n++;
}
initialize(i) {
this.editor = i;
const t = this.editor.getToolbar();
t && (this.divider = l({
icon: s,
title: "",
onClick: () => {
},
// Разделитель не требует действия
disabled: !0
// Делаем разделитель неинтерактивным
}), this.divider.classList.add("toolbar-divider"), t.appendChild(this.divider));
}
destroy() {
this.editor && (this.divider && (this.divider.remove(), this.divider = null), this.editor = null);
}
}
export {
c as ToolbarDividerPlugin
};