UNPKG

jodit-pro

Version:

PRO Version of Jodit Editor

2 lines (1 loc) 1.04 kB
var y=Object.defineProperty;var _=(t,s)=>y(t,"name",{value:s,configurable:!0});import{applyStyle as h}from"../helpers/apply-style.js";import{classifyDefinitions as $}from"../helpers/classify-definitions.js";import{detectActiveStyle as b}from"../helpers/detect-active-style.js";const e="jodit-style-popup";function w(t,s,f){const u=$(s),m=b(t,s),o=t.c.div(e);for(const p of u){const a=t.c.div(`${e}__group-title`);a.textContent=t.i18n(p.title),o.appendChild(a);const i=t.c.div(`${e}__grid`);for(const c of p.definitions){const n=t.c.element("button");n.type="button";const v=m===c;n.className=`${e}__card`+(v?` ${e}__card_active_true`:"");const d=t.c.div(`${e}__card-preview`),l=t.c.element(c.element);for(const C of c.classes)l.classList.add(C);l.textContent=c.name,d.appendChild(l),n.appendChild(d);const r=t.c.div(`${e}__card-label`);r.textContent=c.name,n.appendChild(r),t.e.on(n,"click",()=>{t.s.focus(),h(t,c,s),t.synchronizeValues(),f()}),i.appendChild(n)}o.appendChild(i)}return o}_(w,"buildStylePopup");export{w as buildStylePopup};