UNPKG

@underpostnet/underpost

Version:

Underpost Platform — end-to-end CI/CD and application-delivery toolchain CLI. Covers bare metal, Kubernetes, K3s, kubeadm, LXD, container/image orchestration, secrets, databases, cron jobs, monitoring, SSH, runners, PWA + Workbox delivery, and release orc

34 lines (33 loc) 1.02 kB
import { getId, newInstance } from './CommonJs.js'; import { Modal } from './Modal.js'; import { s } from './VanillaJs.js'; class RichText { static Tokens = {}; static async instance(options = { id: '', parentIdModal: '' }) { const id = options?.id ? options.id : getId(RichText.Tokens, 'rich-text-'); RichText.Tokens[id] = {}; setTimeout(() => { const easyMDE = new EasyMDE({ element: s(`.${id}`), hideIcons: ['fullscreen', 'side-by-side'], onToggleFullScreen: (onFs) => { if (onFs) { if (options.parentIdModal) { } // Modal.cleanUI(); } else { if (options.parentIdModal) { } // Modal.restoreUI(); } }, }); RichText.Tokens[id].easyMDE = easyMDE; // easyMDE.value(); // easyMDE.value(val); }); return html` <style></style> <div class="in md-container"><textarea class="${id}"></textarea></div>`; } } export { RichText };