UNPKG

jodit-pro

Version:

PRO Version of Jodit Editor

2 lines (1 loc) 1.65 kB
var b=Object.defineProperty;var c=(o,e)=>b(o,"name",{value:e,configurable:!0});var h=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);import{dataBindCurrentKey as p,dataBindStoredKey as w}from"./config.js";import{component as M,watch as V}from"jodit/esm/core/decorators/index.js";import{css as s,dataBind as _}from"jodit/esm/core/helpers/utils/index.js";import{Plugin as g}from"jodit/esm/core/plugin/index.js";import{JoditPro as P}from"../../jodit-pro.js";var S=h(d=>{var n,m=d&&d.__decorate||function(o,e,i,l){var t=arguments.length,r=t<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,i):l,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(o,e,i,l);else for(var a=o.length-1;a>=0;a--)(u=o[a])&&(r=(t<3?u(r):t>3?u(e,i,r):u(e,i))||r);return t>3&&r&&Object.defineProperty(e,i,r),r};let f=(n=class extends g{constructor(){super(...arguments),this.buttons=[{name:"mobileView",group:"state"}],this.__currentMode="default"}className(){return"MobileView"}afterInit(e){e.registerCommand("mobileView",{exec:c((i,l,t)=>{this.__currentMode===t&&(t="default"),this.__currentMode=t,_(e,p,t),this.__currentMode!=="default"&&_(e,w,t),t==="default"?s(this.jodit.currentPlace.slots.center,{width:null,margin:null}):s(this.j.currentPlace.slots.center,{width:t,margin:"0 auto"})},"exec")}),e.events.on("beforeSetMode",()=>{})}__beforeSetMode(){this.__currentMode!=="default"&&this.j.execCommand("mobileView",!1,"default")}beforeDestruct(e){}},c(n,"MobileView"),n);f.requires=["license"],m([V(":beforeSetMode.mobileView")],f.prototype,"__beforeSetMode",null),f=m([M],f),P.plugins.add("mobileView",f)});export default S();