@grapesjs/studio-sdk-plugins 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- "use strict";require("grapesjs");const C="app.grapesjs.com",O="app-stage.grapesjs.com",L=[C,O,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],S="license:check:start",j="license:check:end",_=()=>typeof window<"u",N=({isDev:n,isStage:l})=>`${n?"":`https://${l?O:C}`}/api`,$=()=>{const n=_()&&window.location.hostname;return!!n&&(L.includes(n)||L.some(l=>n.endsWith(l)))};var f=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(f||{});async function D({path:n,baseApiUrl:l,method:a="GET",headers:t={},params:p,body:s}){const u=`${l||N({isDev:!1,isStage:!1})}${n}`,i={method:a,headers:{"Content-Type":"application/json",...t}};s&&(i.body=JSON.stringify(s));const c=p?new URLSearchParams(p).toString():"",o=c?`?${c}`:"",r=await fetch(`${u}${o}`,i);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return r.json()}const P={[f.free]:0,[f.startup]:10,[f.business]:20,[f.enterprise]:30};function q(n){const l=n;return l.init=a=>t=>n(t,a),l}const A=n=>q(n);async function U({editor:n,plan:l,pluginName:a,licenseKey:t,cleanup:p}){let s="",g=!1;const u=$(),i=o=>{console.warn("Cleanup plugin:",a,"Reason:",o),p()},c=(o={})=>{var e;const{error:r,sdkLicense:m}=o,W=(e=o.plan)==null?void 0:e.category;if(!(m||o.license)||r)i(r||"Invalid license");else if(W){const w=P[l],E=P[W];w>E&&i({pluginRequiredPlan:l,licensePlan:W})}};n.on(S,o=>{s=o==null?void 0:o.baseApiUrl,g=!0}),n.on(j,o=>{c(o)}),setTimeout(async()=>{if(!g){if(u)return;if(t){const o=await X({licenseKey:t,pluginName:a,baseApiUrl:s});o&&c(o)}else i("The `licenseKey` option not provided")}},2e3)}async function X(n){const{licenseKey:l,pluginName:a,baseApiUrl:t}=n;try{return(await D({baseApiUrl:t,path:`/sdk/${l||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(p){return console.error("Error during SDK license check:",p),!1}}const T=(...n)=>n.map(l=>`[data-gjs-type="${l}"]`).join(","),I="dialogComponent",B=function(n,l={}){const{Blocks:a,Components:t}=n,{licenseKey:p}=l,s="gjs-plg-dialog",g="gjs-plg-dialog-overlay",u="gjs-plg-dialog-content",i="gjs-plg-dialog-close",c="gjs-plg-dialog-title",o="gjs-plg-dialog-body",r="gjs-plg-dialog-description",m="gjs-plg-dialog-placeholder";a.add(s,{label:"Dialog",media:`
1
+ "use strict";require("grapesjs");const C="app.grapesjs.com",O="app-stage.grapesjs.com",L=[C,O,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],S="license:check:start",j="license:check:end",_=()=>typeof window<"u",$=({isDev:n,isStage:s})=>`${n?"":`https://${s?O:C}`}/api`,N=()=>{const n=_()&&window.location.hostname;return!!n&&(L.includes(n)||L.some(s=>n.endsWith(s)))};var W=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(W||{});async function D({path:n,baseApiUrl:s,method:i="GET",headers:t={},params:p,body:l}){const u=`${s||$({isDev:!1,isStage:!1})}${n}`,r={method:i,headers:{"Content-Type":"application/json",...t}};l&&(r.body=JSON.stringify(l));const d=p?new URLSearchParams(p).toString():"",o=d?`?${d}`:"",c=await fetch(`${u}${o}`,r);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}const P={[W.free]:0,[W.startup]:10,[W.business]:20,[W.enterprise]:30};function q(n){const s=n;return s.init=i=>t=>n(t,i),s}const A=n=>q(n);async function U({editor:n,plan:s,pluginName:i,licenseKey:t,cleanup:p}){let l="",g=!1;const u=N(),r=o=>{console.warn("Cleanup plugin:",i,"Reason:",o),p()},d=(o={})=>{var e;const{error:c,sdkLicense:v}=o,E=(e=o.plan)==null?void 0:e.category;if(!(v||o.license)||c)r(c||"Invalid license");else if(E){const f=P[s],b=P[E];f>b&&r({pluginRequiredPlan:s,licensePlan:E})}};n.on(S,o=>{l=o==null?void 0:o.baseApiUrl,g=!0}),n.on(j,o=>{d(o)}),setTimeout(async()=>{if(!g){if(u)return;if(t){const o=await X({licenseKey:t,pluginName:i,baseApiUrl:l});o&&d(o)}else r("The `licenseKey` option not provided")}},2e3)}async function X(n){const{licenseKey:s,pluginName:i,baseApiUrl:t}=n;try{return(await D({baseApiUrl:t,path:`/sdk/${s||"na"}`,method:"POST",params:{d:window.location.hostname,pn:i}})).result||{}}catch(p){return console.error("Error during SDK license check:",p),!1}}const T=(...n)=>n.map(s=>`[data-gjs-type="${s}"]`).join(","),I="dialogComponent",B=function(n,s={}){const{Blocks:i,Components:t}=n,{licenseKey:p}=s,l="gjs-plg-dialog",g="gjs-plg-dialog-overlay",u="gjs-plg-dialog-content",r="gjs-plg-dialog-close",d="gjs-plg-dialog-title",o="gjs-plg-dialog-body",c="gjs-plg-dialog-description",v="gjs-plg-dialog-placeholder";i.add(l,{label:"Dialog",media:`
2
2
  <svg viewBox="0 0 24 24">
3
3
  <path d="M4 4h16v10H8l-4 4V4z"></path>
4
4
  </svg>
5
- `,category:"Extra",content:{type:s},activate:!0,...l.block}),t.addType(s,{model:{defaults:{tagName:"div",attributes:{class:s,"data-type-role":s},components:[{type:g},{type:m}],draggable:T("wrapper"),droppable:T(s),styles:`
6
- .${s} {
5
+ `,category:"Extra",content:{type:l},activate:!0,...s.block}),t.addType(l,{model:{defaults:{tagName:"div",attributes:{class:l,"data-type-role":l},components:[{type:g},{type:v}],draggable:T("wrapper"),droppable:T(l),styles:`
6
+ .${l} {
7
7
  position: relative;
8
8
  z-index: 1;
9
9
  }
10
- `,traits:[{type:"button",label:"Open dialog",name:"onActive",changeProp:!0,command(d){var e;(e=d.getSelected())==null||e.trigger("active")}},{type:"checkbox",label:"Close when pressing X",name:"closeWhenPressingX",default:!0,changeProp:!0},{type:"checkbox",label:"Close when pressing ESC",name:"closeWhenPressingEsc",default:!0,changeProp:!0},{type:"checkbox",label:"Open when leaving the window",name:"openWhenLeavingWindow",default:!1,changeProp:!0},{type:"number",label:"Open when scrolling to level",name:"openWhenScrollingToLevel",default:0,changeProp:!0}],"script-props":["closeWhenPressingX","closeWhenPressingEsc","openWhenLeavingWindow","openWhenScrollingToLevel"],script:function(d){const e=this;function w(h){const v=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'),y=e.querySelector('[data-type-role="gjs-plg-dialog-close"]');function b(){v.style.display="none"}h?(e._onCloseWhenPressingX=b,y.addEventListener("click",e._onCloseWhenPressingX)):(y.removeEventListener("click",e._onCloseWhenPressingX),e._onCloseWhenPressingX=null)}function E(h){const v=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(b){b.key==="Escape"&&(v.style.display="none")}h?(e._onCloseWhenPressingEsc=y,e.addEventListener("keydown",e._onCloseWhenPressingEsc)):(e.removeEventListener("keydown",e._onCloseWhenPressingEsc),e._onCloseWhenPressingEsc=null)}function x(h){const v=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){v.style.display="flex"}h?(e._onOpenWhenLeavingWindow=y,document.addEventListener("mouseleave",e._onOpenWhenLeavingWindow)):(document.removeEventListener("mouseleave",e._onOpenWhenLeavingWindow),e._onOpenWhenLeavingWindow=null)}function k(h){const v=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){const b=document.documentElement.scrollTop;h&&b>=Number(h)&&(v.style.display="flex")}h?(e._onOpenWhenScrollingToLevel=y,document.addEventListener("scroll",e._onOpenWhenScrollingToLevel)):(document.removeEventListener("scroll",e._onOpenWhenScrollingToLevel),e._onOpenWhenScrollingToLevel=null)}w(d.closeWhenPressingX),E(d.closeWhenPressingEsc),x(d.openWhenLeavingWindow),k(d.openWhenScrollingToLevel)}},init(){this.on("active",this.handleOpenWhenClickPlaceholder)},handleOpenWhenClickPlaceholder(){this.view.el.querySelector('[data-type-role="gjs-plg-dialog-placeholder"]').addEventListener("click",()=>{const e=this.view.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');e.style.display="flex"})}},view:{onActive(){const d=this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');d.style.display="flex"}}}),t.addType(g,{model:{defaults:{tagName:"div",attributes:{class:g,"data-type-role":g},components:{type:u},droppable:!1,draggable:!1,styles:`
10
+ `,traits:[{type:"button",label:"Open dialog",name:"onActive",changeProp:!0,command(a){var e;(e=a.getSelected())==null||e.trigger("active")}},{type:"checkbox",label:"Close when pressing X",name:"closeWhenPressingX",default:!0,changeProp:!0},{type:"checkbox",label:"Close when pressing ESC",name:"closeWhenPressingEsc",default:!0,changeProp:!0},{type:"checkbox",label:"Open when leaving the window",name:"openWhenLeavingWindow",default:!1,changeProp:!0},{type:"number",label:"Open when scrolling to level",name:"openWhenScrollingToLevel",default:0,changeProp:!0}],"script-props":["closeWhenPressingX","closeWhenPressingEsc","openWhenLeavingWindow","openWhenScrollingToLevel"],script:function(a){const e=this;function f(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'),y=e.querySelector('[data-type-role="gjs-plg-dialog-close"]');function w(){m.style.display="none"}h?(e._onCloseWhenPressingX=w,y.addEventListener("click",e._onCloseWhenPressingX)):(y.removeEventListener("click",e._onCloseWhenPressingX),e._onCloseWhenPressingX=null)}function b(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(w){w.key==="Escape"&&(m.style.display="none")}h?(e._onCloseWhenPressingEsc=y,e.addEventListener("keydown",e._onCloseWhenPressingEsc)):(e.removeEventListener("keydown",e._onCloseWhenPressingEsc),e._onCloseWhenPressingEsc=null)}function x(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){m.style.display="flex"}h?(e._onOpenWhenLeavingWindow=y,document.addEventListener("mouseleave",e._onOpenWhenLeavingWindow)):(document.removeEventListener("mouseleave",e._onOpenWhenLeavingWindow),e._onOpenWhenLeavingWindow=null)}function k(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){const w=document.documentElement.scrollTop;h&&w>=Number(h)&&(m.style.display="flex")}h?(e._onOpenWhenScrollingToLevel=y,document.addEventListener("scroll",e._onOpenWhenScrollingToLevel)):(document.removeEventListener("scroll",e._onOpenWhenScrollingToLevel),e._onOpenWhenScrollingToLevel=null)}f(a.closeWhenPressingX),b(a.closeWhenPressingEsc),x(a.openWhenLeavingWindow),k(a.openWhenScrollingToLevel)}},init(){this.on("active",this.handleOpenWhenClickPlaceholder)},handleOpenWhenClickPlaceholder(){this.view.el.querySelector('[data-type-role="gjs-plg-dialog-placeholder"]').addEventListener("click",()=>{const e=this.view.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');e.style.display="flex"})}},view:{onActive(){const a=this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');a.style.display="flex"}}}),t.addType(g,{model:{defaults:{tagName:"div",attributes:{class:g,"data-type-role":g},components:{type:u},droppable:!1,draggable:!1,styles:`
11
11
  .${g} {
12
12
  position: fixed;
13
13
  top: 0;
@@ -19,7 +19,7 @@
19
19
  justify-content: center;
20
20
  background-color: rgba(0, 0, 0, 0.5);
21
21
  }
22
- `}}}),t.addType(u,{model:{defaults:{tagName:"div",attributes:{class:u,"data-type-role":u},components:[{type:i},{type:c},{type:o}],droppable:!1,draggable:!1,styles:`
22
+ `}}}),t.addType(u,{model:{defaults:{tagName:"div",attributes:{class:u,"data-type-role":u},components:[{type:r},{type:d},{type:o}],droppable:!1,draggable:!1,styles:`
23
23
  .${u} {
24
24
  position: relative;
25
25
  background-color: #fff;
@@ -30,8 +30,8 @@
30
30
  height: 600px;
31
31
  box-sizing: border-box;
32
32
  }
33
- `}}}),t.addType(i,{model:{defaults:{tagName:"button",attributes:{class:i,"data-type-role":i},components:"&times;",droppable:!1,draggable:!1,styles:`
34
- .${i} {
33
+ `}}}),t.addType(r,{model:{defaults:{tagName:"button",attributes:{class:r,"data-type-role":r},components:"&times;",droppable:!1,draggable:!1,styles:`
34
+ .${r} {
35
35
  position: absolute;
36
36
  top: 10px;
37
37
  right: 10px;
@@ -42,18 +42,18 @@
42
42
  font-size: 20px;
43
43
  cursor: pointer;
44
44
  }
45
- `}}}),t.addType(c,{model:{defaults:{tagName:"h2",attributes:{class:c,"data-type-role":c},components:"Dialog Title",editable:!0,droppable:!1,draggable:!1,styles:`
46
- .${c} {
45
+ `}}}),t.addType(d,{model:{defaults:{tagName:"h2",attributes:{class:d,"data-type-role":d},components:"Dialog Title",editable:!0,droppable:!1,draggable:!1,styles:`
46
+ .${d} {
47
47
  margin: 0;
48
48
  padding: 0 40px 20px 0;
49
49
  }
50
- `}}}),t.addType(o,{model:{defaults:{tagName:"div",attributes:{class:o,"data-type-role":o},components:[{type:r}],styles:`
50
+ `}}}),t.addType(o,{model:{defaults:{tagName:"div",attributes:{class:o,"data-type-role":o},components:[{type:c}],styles:`
51
51
  .${o} {
52
52
  height: 90%;
53
53
  overflow: auto;
54
54
  }
55
- `}}}),t.addType(r,{model:{defaults:{tagName:"p",attributes:{class:r,"data-type-role":r},components:"This is a customizable dialog!",editable:!0,styles:`
56
- .${r} {
55
+ `}}}),t.addType(c,{model:{defaults:{tagName:"p",attributes:{class:c,"data-type-role":c},components:"This is a customizable dialog!",editable:!0,styles:`
56
+ .${c} {
57
57
  margin: 0;
58
58
  }
59
- `}}}),t.addType(m,{model:{toHTML(){return""},defaults:{tagName:"button",attributes:{class:m,"data-type-role":m},components:"Dialog (click me to open)",droppable:!1,draggable:!1}},view:{init(){this.listenTo(this.em,"run:core:preview",()=>{this.el.style.display="none"}),this.listenTo(this.em,"stop:core:preview",()=>{this.el.style.display=""})}}}),U({editor:n,licenseKey:p,plan:f.startup,pluginName:I,cleanup:()=>{a.remove(s),t.removeType(s)}})},z=A(B);module.exports=z;
59
+ `}}}),t.addType(v,{model:{toHTML(){return""},defaults:{tagName:"button",attributes:{class:v,"data-type-role":v},components:"Dialog (click me to open)",droppable:!1,draggable:!1}},view:{init(){const{em:a,el:e}=this,f="core:preview",b=a.Commands.events;this.listenTo(a,`${b.runCommand}${f}`,()=>{e.style.display="none"}),this.listenTo(a,`${b.stopCommand}${f}`,()=>{e.style.display=""})}}}),U({editor:n,licenseKey:p,plan:W.startup,pluginName:I,cleanup:()=>{i.remove(l),t.removeType(l)}})},z=A(B);module.exports=z;
@@ -10,97 +10,97 @@ const C = "app.grapesjs.com", O = "app-stage.grapesjs.com", L = [
10
10
  // For stackblitz.com demos
11
11
  "-sandpack.codesandbox.io"
12
12
  // For Sandpack demos
13
- ], S = "license:check:start", j = "license:check:end", _ = () => typeof window < "u", N = ({ isDev: n, isStage: l }) => `${n ? "" : `https://${l ? O : C}`}/api`, $ = () => {
13
+ ], S = "license:check:start", j = "license:check:end", _ = () => typeof window < "u", $ = ({ isDev: n, isStage: s }) => `${n ? "" : `https://${s ? O : C}`}/api`, N = () => {
14
14
  const n = _() && window.location.hostname;
15
- return !!n && (L.includes(n) || L.some((l) => n.endsWith(l)));
15
+ return !!n && (L.includes(n) || L.some((s) => n.endsWith(s)));
16
16
  };
17
- var f = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(f || {});
17
+ var W = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(W || {});
18
18
  async function D({
19
19
  path: n,
20
- baseApiUrl: l,
21
- method: a = "GET",
20
+ baseApiUrl: s,
21
+ method: i = "GET",
22
22
  headers: t = {},
23
23
  params: p,
24
- body: s
24
+ body: l
25
25
  }) {
26
- const u = `${l || N({ isDev: !1, isStage: !1 })}${n}`, i = {
27
- method: a,
26
+ const u = `${s || $({ isDev: !1, isStage: !1 })}${n}`, r = {
27
+ method: i,
28
28
  headers: {
29
29
  "Content-Type": "application/json",
30
30
  ...t
31
31
  }
32
32
  };
33
- s && (i.body = JSON.stringify(s));
34
- const c = p ? new URLSearchParams(p).toString() : "", o = c ? `?${c}` : "", r = await fetch(`${u}${o}`, i);
35
- if (!r.ok)
36
- throw new Error(`HTTP error! status: ${r.status}`);
37
- return r.json();
33
+ l && (r.body = JSON.stringify(l));
34
+ const d = p ? new URLSearchParams(p).toString() : "", o = d ? `?${d}` : "", c = await fetch(`${u}${o}`, r);
35
+ if (!c.ok)
36
+ throw new Error(`HTTP error! status: ${c.status}`);
37
+ return c.json();
38
38
  }
39
39
  const P = {
40
- [f.free]: 0,
41
- [f.startup]: 10,
42
- [f.business]: 20,
43
- [f.enterprise]: 30
40
+ [W.free]: 0,
41
+ [W.startup]: 10,
42
+ [W.business]: 20,
43
+ [W.enterprise]: 30
44
44
  };
45
45
  function A(n) {
46
- const l = n;
47
- return l.init = (a) => (t) => n(t, a), l;
46
+ const s = n;
47
+ return s.init = (i) => (t) => n(t, i), s;
48
48
  }
49
49
  const q = (n) => /* @__PURE__ */ A(n);
50
50
  async function U({
51
51
  editor: n,
52
- plan: l,
53
- pluginName: a,
52
+ plan: s,
53
+ pluginName: i,
54
54
  licenseKey: t,
55
55
  cleanup: p
56
56
  }) {
57
- let s = "", g = !1;
58
- const u = $(), i = (o) => {
59
- console.warn("Cleanup plugin:", a, "Reason:", o), p();
60
- }, c = (o = {}) => {
57
+ let l = "", g = !1;
58
+ const u = N(), r = (o) => {
59
+ console.warn("Cleanup plugin:", i, "Reason:", o), p();
60
+ }, d = (o = {}) => {
61
61
  var e;
62
- const { error: r, sdkLicense: m } = o, W = (e = o.plan) == null ? void 0 : e.category;
63
- if (!(m || o.license) || r)
64
- i(r || "Invalid license");
65
- else if (W) {
66
- const w = P[l], E = P[W];
67
- w > E && i({ pluginRequiredPlan: l, licensePlan: W });
62
+ const { error: c, sdkLicense: v } = o, E = (e = o.plan) == null ? void 0 : e.category;
63
+ if (!(v || o.license) || c)
64
+ r(c || "Invalid license");
65
+ else if (E) {
66
+ const f = P[s], b = P[E];
67
+ f > b && r({ pluginRequiredPlan: s, licensePlan: E });
68
68
  }
69
69
  };
70
70
  n.on(S, (o) => {
71
- s = o == null ? void 0 : o.baseApiUrl, g = !0;
71
+ l = o == null ? void 0 : o.baseApiUrl, g = !0;
72
72
  }), n.on(j, (o) => {
73
- c(o);
73
+ d(o);
74
74
  }), setTimeout(async () => {
75
75
  if (!g) {
76
76
  if (u) return;
77
77
  if (t) {
78
- const o = await X({ licenseKey: t, pluginName: a, baseApiUrl: s });
79
- o && c(o);
78
+ const o = await X({ licenseKey: t, pluginName: i, baseApiUrl: l });
79
+ o && d(o);
80
80
  } else
81
- i("The `licenseKey` option not provided");
81
+ r("The `licenseKey` option not provided");
82
82
  }
83
83
  }, 2e3);
84
84
  }
85
85
  async function X(n) {
86
- const { licenseKey: l, pluginName: a, baseApiUrl: t } = n;
86
+ const { licenseKey: s, pluginName: i, baseApiUrl: t } = n;
87
87
  try {
88
88
  return (await D({
89
89
  baseApiUrl: t,
90
- path: `/sdk/${l || "na"}`,
90
+ path: `/sdk/${s || "na"}`,
91
91
  method: "POST",
92
92
  params: {
93
93
  d: window.location.hostname,
94
- pn: a
94
+ pn: i
95
95
  }
96
96
  })).result || {};
97
97
  } catch (p) {
98
98
  return console.error("Error during SDK license check:", p), !1;
99
99
  }
100
100
  }
101
- const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialogComponent", B = function(n, l = {}) {
102
- const { Blocks: a, Components: t } = n, { licenseKey: p } = l, s = "gjs-plg-dialog", g = "gjs-plg-dialog-overlay", u = "gjs-plg-dialog-content", i = "gjs-plg-dialog-close", c = "gjs-plg-dialog-title", o = "gjs-plg-dialog-body", r = "gjs-plg-dialog-description", m = "gjs-plg-dialog-placeholder";
103
- a.add(s, {
101
+ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), I = "dialogComponent", B = function(n, s = {}) {
102
+ const { Blocks: i, Components: t } = n, { licenseKey: p } = s, l = "gjs-plg-dialog", g = "gjs-plg-dialog-overlay", u = "gjs-plg-dialog-content", r = "gjs-plg-dialog-close", d = "gjs-plg-dialog-title", o = "gjs-plg-dialog-body", c = "gjs-plg-dialog-description", v = "gjs-plg-dialog-placeholder";
103
+ i.add(l, {
104
104
  label: "Dialog",
105
105
  media: `
106
106
  <svg viewBox="0 0 24 24">
@@ -108,19 +108,19 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
108
108
  </svg>
109
109
  `,
110
110
  category: "Extra",
111
- content: { type: s },
111
+ content: { type: l },
112
112
  activate: !0,
113
- ...l.block
114
- }), t.addType(s, {
113
+ ...s.block
114
+ }), t.addType(l, {
115
115
  model: {
116
116
  defaults: {
117
117
  tagName: "div",
118
- attributes: { class: s, "data-type-role": s },
119
- components: [{ type: g }, { type: m }],
118
+ attributes: { class: l, "data-type-role": l },
119
+ components: [{ type: g }, { type: v }],
120
120
  draggable: T("wrapper"),
121
- droppable: T(s),
121
+ droppable: T(l),
122
122
  styles: `
123
- .${s} {
123
+ .${l} {
124
124
  position: relative;
125
125
  z-index: 1;
126
126
  }
@@ -131,9 +131,9 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
131
131
  label: "Open dialog",
132
132
  name: "onActive",
133
133
  changeProp: !0,
134
- command(d) {
134
+ command(a) {
135
135
  var e;
136
- (e = d.getSelected()) == null || e.trigger("active");
136
+ (e = a.getSelected()) == null || e.trigger("active");
137
137
  }
138
138
  },
139
139
  {
@@ -171,38 +171,38 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
171
171
  "openWhenLeavingWindow",
172
172
  "openWhenScrollingToLevel"
173
173
  ],
174
- script: function(d) {
174
+ script: function(a) {
175
175
  const e = this;
176
- function w(h) {
177
- const v = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'), y = e.querySelector('[data-type-role="gjs-plg-dialog-close"]');
178
- function b() {
179
- v.style.display = "none";
176
+ function f(h) {
177
+ const m = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'), y = e.querySelector('[data-type-role="gjs-plg-dialog-close"]');
178
+ function w() {
179
+ m.style.display = "none";
180
180
  }
181
- h ? (e._onCloseWhenPressingX = b, y.addEventListener("click", e._onCloseWhenPressingX)) : (y.removeEventListener("click", e._onCloseWhenPressingX), e._onCloseWhenPressingX = null);
181
+ h ? (e._onCloseWhenPressingX = w, y.addEventListener("click", e._onCloseWhenPressingX)) : (y.removeEventListener("click", e._onCloseWhenPressingX), e._onCloseWhenPressingX = null);
182
182
  }
183
- function E(h) {
184
- const v = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
185
- function y(b) {
186
- b.key === "Escape" && (v.style.display = "none");
183
+ function b(h) {
184
+ const m = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
185
+ function y(w) {
186
+ w.key === "Escape" && (m.style.display = "none");
187
187
  }
188
188
  h ? (e._onCloseWhenPressingEsc = y, e.addEventListener("keydown", e._onCloseWhenPressingEsc)) : (e.removeEventListener("keydown", e._onCloseWhenPressingEsc), e._onCloseWhenPressingEsc = null);
189
189
  }
190
190
  function x(h) {
191
- const v = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
191
+ const m = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
192
192
  function y() {
193
- v.style.display = "flex";
193
+ m.style.display = "flex";
194
194
  }
195
195
  h ? (e._onOpenWhenLeavingWindow = y, document.addEventListener("mouseleave", e._onOpenWhenLeavingWindow)) : (document.removeEventListener("mouseleave", e._onOpenWhenLeavingWindow), e._onOpenWhenLeavingWindow = null);
196
196
  }
197
197
  function k(h) {
198
- const v = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
198
+ const m = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
199
199
  function y() {
200
- const b = document.documentElement.scrollTop;
201
- h && b >= Number(h) && (v.style.display = "flex");
200
+ const w = document.documentElement.scrollTop;
201
+ h && w >= Number(h) && (m.style.display = "flex");
202
202
  }
203
203
  h ? (e._onOpenWhenScrollingToLevel = y, document.addEventListener("scroll", e._onOpenWhenScrollingToLevel)) : (document.removeEventListener("scroll", e._onOpenWhenScrollingToLevel), e._onOpenWhenScrollingToLevel = null);
204
204
  }
205
- w(d.closeWhenPressingX), E(d.closeWhenPressingEsc), x(d.openWhenLeavingWindow), k(d.openWhenScrollingToLevel);
205
+ f(a.closeWhenPressingX), b(a.closeWhenPressingEsc), x(a.openWhenLeavingWindow), k(a.openWhenScrollingToLevel);
206
206
  }
207
207
  },
208
208
  init() {
@@ -221,8 +221,8 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
221
221
  },
222
222
  view: {
223
223
  onActive() {
224
- const d = this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
225
- d.style.display = "flex";
224
+ const a = this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
225
+ a.style.display = "flex";
226
226
  }
227
227
  }
228
228
  }), t.addType(g, {
@@ -253,7 +253,7 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
253
253
  defaults: {
254
254
  tagName: "div",
255
255
  attributes: { class: u, "data-type-role": u },
256
- components: [{ type: i }, { type: c }, { type: o }],
256
+ components: [{ type: r }, { type: d }, { type: o }],
257
257
  droppable: !1,
258
258
  draggable: !1,
259
259
  styles: `
@@ -270,16 +270,16 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
270
270
  `
271
271
  }
272
272
  }
273
- }), t.addType(i, {
273
+ }), t.addType(r, {
274
274
  model: {
275
275
  defaults: {
276
276
  tagName: "button",
277
- attributes: { class: i, "data-type-role": i },
277
+ attributes: { class: r, "data-type-role": r },
278
278
  components: "&times;",
279
279
  droppable: !1,
280
280
  draggable: !1,
281
281
  styles: `
282
- .${i} {
282
+ .${r} {
283
283
  position: absolute;
284
284
  top: 10px;
285
285
  right: 10px;
@@ -293,17 +293,17 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
293
293
  `
294
294
  }
295
295
  }
296
- }), t.addType(c, {
296
+ }), t.addType(d, {
297
297
  model: {
298
298
  defaults: {
299
299
  tagName: "h2",
300
- attributes: { class: c, "data-type-role": c },
300
+ attributes: { class: d, "data-type-role": d },
301
301
  components: "Dialog Title",
302
302
  editable: !0,
303
303
  droppable: !1,
304
304
  draggable: !1,
305
305
  styles: `
306
- .${c} {
306
+ .${d} {
307
307
  margin: 0;
308
308
  padding: 0 40px 20px 0;
309
309
  }
@@ -315,7 +315,7 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
315
315
  defaults: {
316
316
  tagName: "div",
317
317
  attributes: { class: o, "data-type-role": o },
318
- components: [{ type: r }],
318
+ components: [{ type: c }],
319
319
  styles: `
320
320
  .${o} {
321
321
  height: 90%;
@@ -324,28 +324,28 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
324
324
  `
325
325
  }
326
326
  }
327
- }), t.addType(r, {
327
+ }), t.addType(c, {
328
328
  model: {
329
329
  defaults: {
330
330
  tagName: "p",
331
- attributes: { class: r, "data-type-role": r },
331
+ attributes: { class: c, "data-type-role": c },
332
332
  components: "This is a customizable dialog!",
333
333
  editable: !0,
334
334
  styles: `
335
- .${r} {
335
+ .${c} {
336
336
  margin: 0;
337
337
  }
338
338
  `
339
339
  }
340
340
  }
341
- }), t.addType(m, {
341
+ }), t.addType(v, {
342
342
  model: {
343
343
  toHTML() {
344
344
  return "";
345
345
  },
346
346
  defaults: {
347
347
  tagName: "button",
348
- attributes: { class: m, "data-type-role": m },
348
+ attributes: { class: v, "data-type-role": v },
349
349
  components: "Dialog (click me to open)",
350
350
  droppable: !1,
351
351
  draggable: !1
@@ -353,20 +353,21 @@ const T = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), I = "dialo
353
353
  },
354
354
  view: {
355
355
  init() {
356
- this.listenTo(this.em, "run:core:preview", () => {
357
- this.el.style.display = "none";
358
- }), this.listenTo(this.em, "stop:core:preview", () => {
359
- this.el.style.display = "";
356
+ const { em: a, el: e } = this, f = "core:preview", b = a.Commands.events;
357
+ this.listenTo(a, `${b.runCommand}${f}`, () => {
358
+ e.style.display = "none";
359
+ }), this.listenTo(a, `${b.stopCommand}${f}`, () => {
360
+ e.style.display = "";
360
361
  });
361
362
  }
362
363
  }
363
364
  }), U({
364
365
  editor: n,
365
366
  licenseKey: p,
366
- plan: f.startup,
367
+ plan: W.startup,
367
368
  pluginName: I,
368
369
  cleanup: () => {
369
- a.remove(s), t.removeType(s);
370
+ i.remove(l), t.removeType(l);
370
371
  }
371
372
  });
372
373
  }, H = q(B);
@@ -1,4 +1,4 @@
1
- (function(m,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("grapesjs")):typeof define=="function"&&define.amd?define(["grapesjs"],v):(m=typeof globalThis<"u"?globalThis:m||self,m.StudioSdkPlugins_dialogComponent=v())})(this,function(){"use strict";const m="app.grapesjs.com",v="app-stage.grapesjs.com",P=[m,v,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],O="license:check:start",S="license:check:end",k=()=>typeof window<"u",j=({isDev:n,isStage:s})=>`${n?"":`https://${s?v:m}`}/api`,_=()=>{const n=k()&&window.location.hostname;return!!n&&(P.includes(n)||P.some(s=>n.endsWith(s)))};var b=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(b||{});async function N({path:n,baseApiUrl:s,method:a="GET",headers:t={},params:p,body:l}){const u=`${s||j({isDev:!1,isStage:!1})}${n}`,i={method:a,headers:{"Content-Type":"application/json",...t}};l&&(i.body=JSON.stringify(l));const c=p?new URLSearchParams(p).toString():"",o=c?`?${c}`:"",r=await fetch(`${u}${o}`,i);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return r.json()}const C={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function $(n){const s=n;return s.init=a=>t=>n(t,a),s}const D=n=>$(n);async function q({editor:n,plan:s,pluginName:a,licenseKey:t,cleanup:p}){let l="",g=!1;const u=_(),i=o=>{console.warn("Cleanup plugin:",a,"Reason:",o),p()},c=(o={})=>{var e;const{error:r,sdkLicense:W}=o,E=(e=o.plan)==null?void 0:e.category;if(!(W||o.license)||r)i(r||"Invalid license");else if(E){const L=C[s],T=C[E];L>T&&i({pluginRequiredPlan:s,licensePlan:E})}};n.on(O,o=>{l=o==null?void 0:o.baseApiUrl,g=!0}),n.on(S,o=>{c(o)}),setTimeout(async()=>{if(!g){if(u)return;if(t){const o=await A({licenseKey:t,pluginName:a,baseApiUrl:l});o&&c(o)}else i("The `licenseKey` option not provided")}},2e3)}async function A(n){const{licenseKey:s,pluginName:a,baseApiUrl:t}=n;try{return(await N({baseApiUrl:t,path:`/sdk/${s||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(p){return console.error("Error during SDK license check:",p),!1}}const x=(...n)=>n.map(s=>`[data-gjs-type="${s}"]`).join(","),U="dialogComponent";return D(function(n,s={}){const{Blocks:a,Components:t}=n,{licenseKey:p}=s,l="gjs-plg-dialog",g="gjs-plg-dialog-overlay",u="gjs-plg-dialog-content",i="gjs-plg-dialog-close",c="gjs-plg-dialog-title",o="gjs-plg-dialog-body",r="gjs-plg-dialog-description",W="gjs-plg-dialog-placeholder";a.add(l,{label:"Dialog",media:`
1
+ (function(f,v){typeof exports=="object"&&typeof module<"u"?module.exports=v(require("grapesjs")):typeof define=="function"&&define.amd?define(["grapesjs"],v):(f=typeof globalThis<"u"?globalThis:f||self,f.StudioSdkPlugins_dialogComponent=v())})(this,function(){"use strict";const f="app.grapesjs.com",v="app-stage.grapesjs.com",T=[f,v,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],O="license:check:start",S="license:check:end",k=()=>typeof window<"u",j=({isDev:n,isStage:s})=>`${n?"":`https://${s?v:f}`}/api`,_=()=>{const n=k()&&window.location.hostname;return!!n&&(T.includes(n)||T.some(s=>n.endsWith(s)))};var b=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(b||{});async function $({path:n,baseApiUrl:s,method:i="GET",headers:t={},params:p,body:l}){const u=`${s||j({isDev:!1,isStage:!1})}${n}`,r={method:i,headers:{"Content-Type":"application/json",...t}};l&&(r.body=JSON.stringify(l));const d=p?new URLSearchParams(p).toString():"",o=d?`?${d}`:"",c=await fetch(`${u}${o}`,r);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}const C={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function N(n){const s=n;return s.init=i=>t=>n(t,i),s}const D=n=>N(n);async function q({editor:n,plan:s,pluginName:i,licenseKey:t,cleanup:p}){let l="",g=!1;const u=_(),r=o=>{console.warn("Cleanup plugin:",i,"Reason:",o),p()},d=(o={})=>{var e;const{error:c,sdkLicense:W}=o,P=(e=o.plan)==null?void 0:e.category;if(!(W||o.license)||c)r(c||"Invalid license");else if(P){const w=C[s],E=C[P];w>E&&r({pluginRequiredPlan:s,licensePlan:P})}};n.on(O,o=>{l=o==null?void 0:o.baseApiUrl,g=!0}),n.on(S,o=>{d(o)}),setTimeout(async()=>{if(!g){if(u)return;if(t){const o=await A({licenseKey:t,pluginName:i,baseApiUrl:l});o&&d(o)}else r("The `licenseKey` option not provided")}},2e3)}async function A(n){const{licenseKey:s,pluginName:i,baseApiUrl:t}=n;try{return(await $({baseApiUrl:t,path:`/sdk/${s||"na"}`,method:"POST",params:{d:window.location.hostname,pn:i}})).result||{}}catch(p){return console.error("Error during SDK license check:",p),!1}}const x=(...n)=>n.map(s=>`[data-gjs-type="${s}"]`).join(","),U="dialogComponent";return D(function(n,s={}){const{Blocks:i,Components:t}=n,{licenseKey:p}=s,l="gjs-plg-dialog",g="gjs-plg-dialog-overlay",u="gjs-plg-dialog-content",r="gjs-plg-dialog-close",d="gjs-plg-dialog-title",o="gjs-plg-dialog-body",c="gjs-plg-dialog-description",W="gjs-plg-dialog-placeholder";i.add(l,{label:"Dialog",media:`
2
2
  <svg viewBox="0 0 24 24">
3
3
  <path d="M4 4h16v10H8l-4 4V4z"></path>
4
4
  </svg>
@@ -7,7 +7,7 @@
7
7
  position: relative;
8
8
  z-index: 1;
9
9
  }
10
- `,traits:[{type:"button",label:"Open dialog",name:"onActive",changeProp:!0,command(d){var e;(e=d.getSelected())==null||e.trigger("active")}},{type:"checkbox",label:"Close when pressing X",name:"closeWhenPressingX",default:!0,changeProp:!0},{type:"checkbox",label:"Close when pressing ESC",name:"closeWhenPressingEsc",default:!0,changeProp:!0},{type:"checkbox",label:"Open when leaving the window",name:"openWhenLeavingWindow",default:!1,changeProp:!0},{type:"number",label:"Open when scrolling to level",name:"openWhenScrollingToLevel",default:0,changeProp:!0}],"script-props":["closeWhenPressingX","closeWhenPressingEsc","openWhenLeavingWindow","openWhenScrollingToLevel"],script:function(d){const e=this;function L(h){const f=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'),y=e.querySelector('[data-type-role="gjs-plg-dialog-close"]');function w(){f.style.display="none"}h?(e._onCloseWhenPressingX=w,y.addEventListener("click",e._onCloseWhenPressingX)):(y.removeEventListener("click",e._onCloseWhenPressingX),e._onCloseWhenPressingX=null)}function T(h){const f=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(w){w.key==="Escape"&&(f.style.display="none")}h?(e._onCloseWhenPressingEsc=y,e.addEventListener("keydown",e._onCloseWhenPressingEsc)):(e.removeEventListener("keydown",e._onCloseWhenPressingEsc),e._onCloseWhenPressingEsc=null)}function X(h){const f=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){f.style.display="flex"}h?(e._onOpenWhenLeavingWindow=y,document.addEventListener("mouseleave",e._onOpenWhenLeavingWindow)):(document.removeEventListener("mouseleave",e._onOpenWhenLeavingWindow),e._onOpenWhenLeavingWindow=null)}function I(h){const f=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){const w=document.documentElement.scrollTop;h&&w>=Number(h)&&(f.style.display="flex")}h?(e._onOpenWhenScrollingToLevel=y,document.addEventListener("scroll",e._onOpenWhenScrollingToLevel)):(document.removeEventListener("scroll",e._onOpenWhenScrollingToLevel),e._onOpenWhenScrollingToLevel=null)}L(d.closeWhenPressingX),T(d.closeWhenPressingEsc),X(d.openWhenLeavingWindow),I(d.openWhenScrollingToLevel)}},init(){this.on("active",this.handleOpenWhenClickPlaceholder)},handleOpenWhenClickPlaceholder(){this.view.el.querySelector('[data-type-role="gjs-plg-dialog-placeholder"]').addEventListener("click",()=>{const e=this.view.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');e.style.display="flex"})}},view:{onActive(){const d=this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');d.style.display="flex"}}}),t.addType(g,{model:{defaults:{tagName:"div",attributes:{class:g,"data-type-role":g},components:{type:u},droppable:!1,draggable:!1,styles:`
10
+ `,traits:[{type:"button",label:"Open dialog",name:"onActive",changeProp:!0,command(a){var e;(e=a.getSelected())==null||e.trigger("active")}},{type:"checkbox",label:"Close when pressing X",name:"closeWhenPressingX",default:!0,changeProp:!0},{type:"checkbox",label:"Close when pressing ESC",name:"closeWhenPressingEsc",default:!0,changeProp:!0},{type:"checkbox",label:"Open when leaving the window",name:"openWhenLeavingWindow",default:!1,changeProp:!0},{type:"number",label:"Open when scrolling to level",name:"openWhenScrollingToLevel",default:0,changeProp:!0}],"script-props":["closeWhenPressingX","closeWhenPressingEsc","openWhenLeavingWindow","openWhenScrollingToLevel"],script:function(a){const e=this;function w(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'),y=e.querySelector('[data-type-role="gjs-plg-dialog-close"]');function L(){m.style.display="none"}h?(e._onCloseWhenPressingX=L,y.addEventListener("click",e._onCloseWhenPressingX)):(y.removeEventListener("click",e._onCloseWhenPressingX),e._onCloseWhenPressingX=null)}function E(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(L){L.key==="Escape"&&(m.style.display="none")}h?(e._onCloseWhenPressingEsc=y,e.addEventListener("keydown",e._onCloseWhenPressingEsc)):(e.removeEventListener("keydown",e._onCloseWhenPressingEsc),e._onCloseWhenPressingEsc=null)}function X(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){m.style.display="flex"}h?(e._onOpenWhenLeavingWindow=y,document.addEventListener("mouseleave",e._onOpenWhenLeavingWindow)):(document.removeEventListener("mouseleave",e._onOpenWhenLeavingWindow),e._onOpenWhenLeavingWindow=null)}function I(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){const L=document.documentElement.scrollTop;h&&L>=Number(h)&&(m.style.display="flex")}h?(e._onOpenWhenScrollingToLevel=y,document.addEventListener("scroll",e._onOpenWhenScrollingToLevel)):(document.removeEventListener("scroll",e._onOpenWhenScrollingToLevel),e._onOpenWhenScrollingToLevel=null)}w(a.closeWhenPressingX),E(a.closeWhenPressingEsc),X(a.openWhenLeavingWindow),I(a.openWhenScrollingToLevel)}},init(){this.on("active",this.handleOpenWhenClickPlaceholder)},handleOpenWhenClickPlaceholder(){this.view.el.querySelector('[data-type-role="gjs-plg-dialog-placeholder"]').addEventListener("click",()=>{const e=this.view.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');e.style.display="flex"})}},view:{onActive(){const a=this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');a.style.display="flex"}}}),t.addType(g,{model:{defaults:{tagName:"div",attributes:{class:g,"data-type-role":g},components:{type:u},droppable:!1,draggable:!1,styles:`
11
11
  .${g} {
12
12
  position: fixed;
13
13
  top: 0;
@@ -19,7 +19,7 @@
19
19
  justify-content: center;
20
20
  background-color: rgba(0, 0, 0, 0.5);
21
21
  }
22
- `}}}),t.addType(u,{model:{defaults:{tagName:"div",attributes:{class:u,"data-type-role":u},components:[{type:i},{type:c},{type:o}],droppable:!1,draggable:!1,styles:`
22
+ `}}}),t.addType(u,{model:{defaults:{tagName:"div",attributes:{class:u,"data-type-role":u},components:[{type:r},{type:d},{type:o}],droppable:!1,draggable:!1,styles:`
23
23
  .${u} {
24
24
  position: relative;
25
25
  background-color: #fff;
@@ -30,8 +30,8 @@
30
30
  height: 600px;
31
31
  box-sizing: border-box;
32
32
  }
33
- `}}}),t.addType(i,{model:{defaults:{tagName:"button",attributes:{class:i,"data-type-role":i},components:"&times;",droppable:!1,draggable:!1,styles:`
34
- .${i} {
33
+ `}}}),t.addType(r,{model:{defaults:{tagName:"button",attributes:{class:r,"data-type-role":r},components:"&times;",droppable:!1,draggable:!1,styles:`
34
+ .${r} {
35
35
  position: absolute;
36
36
  top: 10px;
37
37
  right: 10px;
@@ -42,18 +42,18 @@
42
42
  font-size: 20px;
43
43
  cursor: pointer;
44
44
  }
45
- `}}}),t.addType(c,{model:{defaults:{tagName:"h2",attributes:{class:c,"data-type-role":c},components:"Dialog Title",editable:!0,droppable:!1,draggable:!1,styles:`
46
- .${c} {
45
+ `}}}),t.addType(d,{model:{defaults:{tagName:"h2",attributes:{class:d,"data-type-role":d},components:"Dialog Title",editable:!0,droppable:!1,draggable:!1,styles:`
46
+ .${d} {
47
47
  margin: 0;
48
48
  padding: 0 40px 20px 0;
49
49
  }
50
- `}}}),t.addType(o,{model:{defaults:{tagName:"div",attributes:{class:o,"data-type-role":o},components:[{type:r}],styles:`
50
+ `}}}),t.addType(o,{model:{defaults:{tagName:"div",attributes:{class:o,"data-type-role":o},components:[{type:c}],styles:`
51
51
  .${o} {
52
52
  height: 90%;
53
53
  overflow: auto;
54
54
  }
55
- `}}}),t.addType(r,{model:{defaults:{tagName:"p",attributes:{class:r,"data-type-role":r},components:"This is a customizable dialog!",editable:!0,styles:`
56
- .${r} {
55
+ `}}}),t.addType(c,{model:{defaults:{tagName:"p",attributes:{class:c,"data-type-role":c},components:"This is a customizable dialog!",editable:!0,styles:`
56
+ .${c} {
57
57
  margin: 0;
58
58
  }
59
- `}}}),t.addType(W,{model:{toHTML(){return""},defaults:{tagName:"button",attributes:{class:W,"data-type-role":W},components:"Dialog (click me to open)",droppable:!1,draggable:!1}},view:{init(){this.listenTo(this.em,"run:core:preview",()=>{this.el.style.display="none"}),this.listenTo(this.em,"stop:core:preview",()=>{this.el.style.display=""})}}}),q({editor:n,licenseKey:p,plan:b.startup,pluginName:U,cleanup:()=>{a.remove(l),t.removeType(l)}})})});
59
+ `}}}),t.addType(W,{model:{toHTML(){return""},defaults:{tagName:"button",attributes:{class:W,"data-type-role":W},components:"Dialog (click me to open)",droppable:!1,draggable:!1}},view:{init(){const{em:a,el:e}=this,w="core:preview",E=a.Commands.events;this.listenTo(a,`${E.runCommand}${w}`,()=>{e.style.display="none"}),this.listenTo(a,`${E.stopCommand}${w}`,()=>{e.style.display=""})}}}),q({editor:n,licenseKey:p,plan:b.startup,pluginName:U,cleanup:()=>{i.remove(l),t.removeType(l)}})})});
@@ -4,4 +4,5 @@ export { default as listPagesComponent } from './listPagesComponent';
4
4
  export { default as fsLightboxComponent } from './fsLightboxComponent';
5
5
  export { default as lightGalleryComponent } from './lightGalleryComponent';
6
6
  export { default as swiperComponent } from './swiperComponent';
7
+ export { default as rteTinyMce } from './rteTinyMce';
7
8
  export { default as rteProseMirror } from './prosemirror';