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
3 lines (2 loc) • 1.42 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 u=Object.defineProperty;var y=(t,e,s)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var g=(t,e,s)=>y(t,typeof e!="symbol"?e+"":e,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class h{constructor(){g(this,"plugins",new Map)}register(e){if(this.plugins.has(e.name))throw new Error(`Plugin ${e.name} is already registered`);this.plugins.set(e.name,e)}unregister(e){const s=this.plugins.get(e);s!=null&&s.destroy&&s.destroy(),this.plugins.delete(e)}getPlugins(){return this.plugins}getHotkeys(){const e={},s={};return this.plugins.forEach((a,r)=>{const o=r.charAt(0).toUpperCase()+r.slice(1)+" Plugin",c=a.hotkeys??[];for(const l in c){const i=c[l],n=i.keys;s[n]?console.warn(`Hotkey conflict: The key combination "${n}" is already used for the command "${s[n]}".`):s[n]=i.command,e[o]||(e[o]=[]),e[o].push({command:i.command,description:i.description,icon:i.icon,keys:i.keys})}}),e}getPlugin(e){return this.plugins.get(e)}getVersion(e){var s;return((s=this.getPlugin(e))==null?void 0:s.version)||"1.0.0"}destroy(){for(const[e,s]of this.plugins)s.destroy&&s.destroy();this.plugins.clear()}}exports.DefaultPluginManager=h;