@grapesjs/studio-sdk-plugins 1.0.8-rc.0 → 1.0.8

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,4 +1,4 @@
1
- "use strict";require("react");const b="app.grapesjs.com",w="app-stage.grapesjs.com",E=[b,w,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],S="license:check:start",_="license:check:end",P=()=>typeof window<"u",k=({isDev:n,isStage:t})=>`${n?"":`https://${t?w:b}`}/api`,x=()=>{const n=P()&&window.location.hostname;return!!n&&(E.includes(n)||E.some(t=>n.endsWith(t)))},N=()=>(P()&&window.location.hostname)===b;var j={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8-rc.0",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const D=j.NODE_ENV!=="production";async function $({path:n,method:t="GET",headers:l={},body:o}){const s=`${k({isDev:D,isStage:!N()})}${n}`,a={method:t,headers:{"Content-Type":"application/json",...l}};o&&(a.body=JSON.stringify(o));const i=await fetch(s,a);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return i.json()}function A(n){const t=n;return t.init=l=>o=>n(o,l),t}const I=n=>A(n);async function X({editor:n,pluginName:t,licenseKey:l,cleanup:o}){let g=!1;const s=x();n.on(S,()=>{g=!0}),n.on(_,({sdkLicense:a})=>{a||o()}),setTimeout(async()=>{if(!g){if(s)return;l&&await q({licenseKey:l,pluginName:t})||o()}},2e3)}async function q({licenseKey:n,pluginName:t}){try{const l=await $({path:`/sdk/${n}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:t})}),{license:o}=l.result||{};return!!o}catch(l){return console.error("Error during SDK license check:",l),!1}}const W=(...n)=>n.map(t=>`[data-gjs-type="${t}"]`).join(","),M="dialogComponent",U=function(n,t={}){const{Blocks:l,Components:o}=n,{licenseKey:g}=t,s="gjs-plg-dialog",a="gjs-plg-dialog-overlay",i="gjs-plg-dialog-content",h="gjs-plg-dialog-close",u="gjs-plg-dialog-title",y="gjs-plg-dialog-body",m="gjs-plg-dialog-description",f="gjs-plg-dialog-placeholder";l.add(s,{label:"Dialog",media:`
1
+ "use strict";require("react");const b="app.grapesjs.com",w="app-stage.grapesjs.com",E=[b,w,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],S="license:check:start",_="license:check:end",P=()=>typeof window<"u",k=({isDev:n,isStage:t})=>`${n?"":`https://${t?w:b}`}/api`,x=()=>{const n=P()&&window.location.hostname;return!!n&&(E.includes(n)||E.some(t=>n.endsWith(t)))},N=()=>(P()&&window.location.hostname)===b;var j={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const D=j.NODE_ENV!=="production";async function $({path:n,method:t="GET",headers:l={},body:o}){const s=`${k({isDev:D,isStage:!N()})}${n}`,a={method:t,headers:{"Content-Type":"application/json",...l}};o&&(a.body=JSON.stringify(o));const i=await fetch(s,a);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return i.json()}function A(n){const t=n;return t.init=l=>o=>n(o,l),t}const I=n=>A(n);async function X({editor:n,pluginName:t,licenseKey:l,cleanup:o}){let g=!1;const s=x();n.on(S,()=>{g=!0}),n.on(_,({sdkLicense:a})=>{a||o()}),setTimeout(async()=>{if(!g){if(s)return;l&&await q({licenseKey:l,pluginName:t})||o()}},2e3)}async function q({licenseKey:n,pluginName:t}){try{const l=await $({path:`/sdk/${n}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:t})}),{license:o}=l.result||{};return!!o}catch(l){return console.error("Error during SDK license check:",l),!1}}const W=(...n)=>n.map(t=>`[data-gjs-type="${t}"]`).join(","),M="dialogComponent",U=function(n,t={}){const{Blocks:l,Components:o}=n,{licenseKey:g}=t,s="gjs-plg-dialog",a="gjs-plg-dialog-overlay",i="gjs-plg-dialog-content",h="gjs-plg-dialog-close",u="gjs-plg-dialog-title",y="gjs-plg-dialog-body",m="gjs-plg-dialog-description",f="gjs-plg-dialog-placeholder";l.add(s,{label:"Dialog",media:`
2
2
  <svg viewBox="0 0 24 24">
3
3
  <path d="M4 4h16v10H8l-4 4V4z"></path>
4
4
  </svg>
@@ -14,7 +14,7 @@ const b = "app.grapesjs.com", w = "app-stage.grapesjs.com", E = [
14
14
  const n = P() && window.location.hostname;
15
15
  return !!n && (E.includes(n) || E.some((t) => n.endsWith(t)));
16
16
  }, N = () => (P() && window.location.hostname) === b;
17
- var j = { NODE_ENV: "production", NPM_PACKAGE_VERSION: "1.0.8-rc.0", STUDIO_NPM_PACKAGE_VERSION: "1.0.25" };
17
+ var j = { NODE_ENV: "production", NPM_PACKAGE_VERSION: "1.0.8", STUDIO_NPM_PACKAGE_VERSION: "1.0.25" };
18
18
  const D = j.NODE_ENV !== "production";
19
19
  async function $({
20
20
  path: n,
@@ -1,4 +1,4 @@
1
- (function(p,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("react")):typeof define=="function"&&define.amd?define(["react"],u):(p=typeof globalThis<"u"?globalThis:p||self,p.StudioSdkPlugins_dialogComponent=u())})(this,function(){"use strict";const p="app.grapesjs.com",u="app-stage.grapesjs.com",W=[p,u,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],T="license:check:start",C="license:check:end",w=()=>typeof window<"u",O=({isDev:n,isStage:t})=>`${n?"":`https://${t?u:p}`}/api`,S=()=>{const n=w()&&window.location.hostname;return!!n&&(W.includes(n)||W.some(t=>n.endsWith(t)))},L=()=>(w()&&window.location.hostname)===p;var _={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8-rc.0",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const k=_.NODE_ENV!=="production";async function x({path:n,method:t="GET",headers:l={},body:o}){const s=`${O({isDev:k,isStage:!L()})}${n}`,i={method:t,headers:{"Content-Type":"application/json",...l}};o&&(i.body=JSON.stringify(o));const a=await fetch(s,i);if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return a.json()}function N(n){const t=n;return t.init=l=>o=>n(o,l),t}const j=n=>N(n);async function D({editor:n,pluginName:t,licenseKey:l,cleanup:o}){let h=!1;const s=S();n.on(T,()=>{h=!0}),n.on(C,({sdkLicense:i})=>{i||o()}),setTimeout(async()=>{if(!h){if(s)return;l&&await $({licenseKey:l,pluginName:t})||o()}},2e3)}async function $({licenseKey:n,pluginName:t}){try{const l=await x({path:`/sdk/${n}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:t})}),{license:o}=l.result||{};return!!o}catch(l){return console.error("Error during SDK license check:",l),!1}}const P=(...n)=>n.map(t=>`[data-gjs-type="${t}"]`).join(","),A="dialogComponent";return j(function(n,t={}){const{Blocks:l,Components:o}=n,{licenseKey:h}=t,s="gjs-plg-dialog",i="gjs-plg-dialog-overlay",a="gjs-plg-dialog-content",y="gjs-plg-dialog-close",f="gjs-plg-dialog-title",m="gjs-plg-dialog-body",v="gjs-plg-dialog-description",E="gjs-plg-dialog-placeholder";l.add(s,{label:"Dialog",media:`
1
+ (function(p,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("react")):typeof define=="function"&&define.amd?define(["react"],u):(p=typeof globalThis<"u"?globalThis:p||self,p.StudioSdkPlugins_dialogComponent=u())})(this,function(){"use strict";const p="app.grapesjs.com",u="app-stage.grapesjs.com",W=[p,u,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],T="license:check:start",C="license:check:end",w=()=>typeof window<"u",O=({isDev:n,isStage:t})=>`${n?"":`https://${t?u:p}`}/api`,S=()=>{const n=w()&&window.location.hostname;return!!n&&(W.includes(n)||W.some(t=>n.endsWith(t)))},L=()=>(w()&&window.location.hostname)===p;var _={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const k=_.NODE_ENV!=="production";async function x({path:n,method:t="GET",headers:l={},body:o}){const s=`${O({isDev:k,isStage:!L()})}${n}`,i={method:t,headers:{"Content-Type":"application/json",...l}};o&&(i.body=JSON.stringify(o));const a=await fetch(s,i);if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return a.json()}function N(n){const t=n;return t.init=l=>o=>n(o,l),t}const j=n=>N(n);async function D({editor:n,pluginName:t,licenseKey:l,cleanup:o}){let h=!1;const s=S();n.on(T,()=>{h=!0}),n.on(C,({sdkLicense:i})=>{i||o()}),setTimeout(async()=>{if(!h){if(s)return;l&&await $({licenseKey:l,pluginName:t})||o()}},2e3)}async function $({licenseKey:n,pluginName:t}){try{const l=await x({path:`/sdk/${n}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:t})}),{license:o}=l.result||{};return!!o}catch(l){return console.error("Error during SDK license check:",l),!1}}const P=(...n)=>n.map(t=>`[data-gjs-type="${t}"]`).join(","),A="dialogComponent";return j(function(n,t={}){const{Blocks:l,Components:o}=n,{licenseKey:h}=t,s="gjs-plg-dialog",i="gjs-plg-dialog-overlay",a="gjs-plg-dialog-content",y="gjs-plg-dialog-close",f="gjs-plg-dialog-title",m="gjs-plg-dialog-body",v="gjs-plg-dialog-description",E="gjs-plg-dialog-placeholder";l.add(s,{label:"Dialog",media:`
2
2
  <svg viewBox="0 0 24 24">
3
3
  <path d="M4 4h16v10H8l-4 4V4z"></path>
4
4
  </svg>
@@ -1,4 +1,4 @@
1
- "use strict";require("react");const _="app.grapesjs.com",D="app-stage.grapesjs.com",O=[_,D,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],$="license:check:start",B="license:check:end",M=()=>typeof window<"u",W=({isDev:o,isStage:i})=>`${o?"":`https://${i?D:_}`}/api`,R=()=>{const o=M()&&window.location.hostname;return!!o&&(O.includes(o)||O.some(i=>o.endsWith(i)))},U=()=>(M()&&window.location.hostname)===_;var G={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8-rc.0",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const K=G.NODE_ENV!=="production";async function F({path:o,method:i="GET",headers:c={},body:a}){const u=`${W({isDev:K,isStage:!U()})}${o}`,r={method:i,headers:{"Content-Type":"application/json",...c}};a&&(r.body=JSON.stringify(a));const v=await fetch(u,r);if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);return v.json()}function Z(o){const i=o;return i.init=c=>a=>o(a,c),i}const q=o=>Z(o);async function J({editor:o,pluginName:i,licenseKey:c,cleanup:a}){let h=!1;const u=R();o.on($,()=>{h=!0}),o.on(B,({sdkLicense:r})=>{r||a()}),setTimeout(async()=>{if(!h){if(u)return;c&&await z({licenseKey:c,pluginName:i})||a()}},2e3)}async function z({licenseKey:o,pluginName:i}){try{const c=await F({path:`/sdk/${o}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:i})}),{license:a}=c.result||{};return!!a}catch(c){return console.error("Error during SDK license check:",c),!1}}const X="gjs-plg-",Y="fsLightboxComponent",T="data-fslightbox",L="data-type",Q="fslightbox-open",b="fslightbox",f={image:'<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',video:'<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',imageLightbox:'<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',external:'<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',eye:'<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'},tt=function(o,i={}){const{Blocks:c,Components:a}=o,h="Lightbox",u=`${X}${b}`,r={toolbarIconOpen:f.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...i},{block:v,toolbarIconOpen:w,defaultSrc:A}=r,j=function(e){const t=this,n="data-fslightbox",s=window,p=()=>{var E;const d=s.refreshFsLightbox;d==null||d();const x=t.getAttribute(n);if((E=s.fsLightboxInstances)==null||E[x],!s._isEditor)return;Array.from(document.querySelectorAll(`[${n}]`)).forEach(g=>{const m=g.onclick;g.onclick=function(S){S.preventDefault();const N=g;!N.__skipLb&&(m==null||m(S)),N.__skipLb=!0}})};if(s.refreshFsLightbox)p();else{const d=document.createElement("script");d.src=e.cdnScript,d.onload=p,document.head.appendChild(d)}},H=e=>({id:`${b}-open-lb`,label:w,command:()=>{const t=e.getView();t==null||t.toggleLightbox()}}),l="source-type",k={type:"radio",name:l,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:f.image},{id:"video",label:"Video",icon:f.video},{id:"el",label:"Custom Element",icon:f.external}],labelToTitle:!0},I={id:"href-image",name:"href",type:"file",label:"Source Image"},C={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},V={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},P={image:[I],video:[C],el:[V]};a.addType(b,{block:v&&{label:h,media:f.imageLightbox,category:"Extra",select:!0,...r.block},isComponent:e=>{var t;return(t=e.hasAttribute)==null?void 0:t.call(e,T)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:h,icon:f.imageLightbox,classes:u,draggable:(e,t)=>!t.is(b),attributes:{[T]:"lightbox",[L]:"image",href:A},components:{type:"image",src:A},script:j,cdnScript:r.cdnScript,"script-props":["attributes","cdnScript"],[l]:"image",traits:[k,{name:T,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(e,t){var s;const n=(s=t.target)==null?void 0:s.getView();n==null||n.toggleLightbox()}}],styles:`
1
+ "use strict";require("react");const _="app.grapesjs.com",D="app-stage.grapesjs.com",O=[_,D,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],$="license:check:start",B="license:check:end",M=()=>typeof window<"u",W=({isDev:o,isStage:i})=>`${o?"":`https://${i?D:_}`}/api`,R=()=>{const o=M()&&window.location.hostname;return!!o&&(O.includes(o)||O.some(i=>o.endsWith(i)))},U=()=>(M()&&window.location.hostname)===_;var G={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const K=G.NODE_ENV!=="production";async function F({path:o,method:i="GET",headers:c={},body:a}){const u=`${W({isDev:K,isStage:!U()})}${o}`,r={method:i,headers:{"Content-Type":"application/json",...c}};a&&(r.body=JSON.stringify(a));const v=await fetch(u,r);if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);return v.json()}function Z(o){const i=o;return i.init=c=>a=>o(a,c),i}const q=o=>Z(o);async function J({editor:o,pluginName:i,licenseKey:c,cleanup:a}){let h=!1;const u=R();o.on($,()=>{h=!0}),o.on(B,({sdkLicense:r})=>{r||a()}),setTimeout(async()=>{if(!h){if(u)return;c&&await z({licenseKey:c,pluginName:i})||a()}},2e3)}async function z({licenseKey:o,pluginName:i}){try{const c=await F({path:`/sdk/${o}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:i})}),{license:a}=c.result||{};return!!a}catch(c){return console.error("Error during SDK license check:",c),!1}}const X="gjs-plg-",Y="fsLightboxComponent",T="data-fslightbox",L="data-type",Q="fslightbox-open",b="fslightbox",f={image:'<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',video:'<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',imageLightbox:'<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',external:'<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',eye:'<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'},tt=function(o,i={}){const{Blocks:c,Components:a}=o,h="Lightbox",u=`${X}${b}`,r={toolbarIconOpen:f.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...i},{block:v,toolbarIconOpen:w,defaultSrc:A}=r,j=function(e){const t=this,n="data-fslightbox",s=window,p=()=>{var E;const d=s.refreshFsLightbox;d==null||d();const x=t.getAttribute(n);if((E=s.fsLightboxInstances)==null||E[x],!s._isEditor)return;Array.from(document.querySelectorAll(`[${n}]`)).forEach(g=>{const m=g.onclick;g.onclick=function(S){S.preventDefault();const N=g;!N.__skipLb&&(m==null||m(S)),N.__skipLb=!0}})};if(s.refreshFsLightbox)p();else{const d=document.createElement("script");d.src=e.cdnScript,d.onload=p,document.head.appendChild(d)}},H=e=>({id:`${b}-open-lb`,label:w,command:()=>{const t=e.getView();t==null||t.toggleLightbox()}}),l="source-type",k={type:"radio",name:l,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:f.image},{id:"video",label:"Video",icon:f.video},{id:"el",label:"Custom Element",icon:f.external}],labelToTitle:!0},I={id:"href-image",name:"href",type:"file",label:"Source Image"},C={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},V={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},P={image:[I],video:[C],el:[V]};a.addType(b,{block:v&&{label:h,media:f.imageLightbox,category:"Extra",select:!0,...r.block},isComponent:e=>{var t;return(t=e.hasAttribute)==null?void 0:t.call(e,T)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:h,icon:f.imageLightbox,classes:u,draggable:(e,t)=>!t.is(b),attributes:{[T]:"lightbox",[L]:"image",href:A},components:{type:"image",src:A},script:j,cdnScript:r.cdnScript,"script-props":["attributes","cdnScript"],[l]:"image",traits:[k,{name:T,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(e,t){var s;const n=(s=t.target)==null?void 0:s.getView();n==null||n.toggleLightbox()}}],styles:`
2
2
  .${u} {
3
3
  display: inline-block;
4
4
  padding: 10px;
@@ -14,7 +14,7 @@ const _ = "app.grapesjs.com", D = "app-stage.grapesjs.com", O = [
14
14
  const o = M() && window.location.hostname;
15
15
  return !!o && (O.includes(o) || O.some((i) => o.endsWith(i)));
16
16
  }, U = () => (M() && window.location.hostname) === _;
17
- var G = { NODE_ENV: "production", NPM_PACKAGE_VERSION: "1.0.8-rc.0", STUDIO_NPM_PACKAGE_VERSION: "1.0.25" };
17
+ var G = { NODE_ENV: "production", NPM_PACKAGE_VERSION: "1.0.8", STUDIO_NPM_PACKAGE_VERSION: "1.0.25" };
18
18
  const K = G.NODE_ENV !== "production";
19
19
  async function F({
20
20
  path: o,
@@ -1,4 +1,4 @@
1
- (function(u,h){typeof exports=="object"&&typeof module<"u"?module.exports=h(require("react")):typeof define=="function"&&define.amd?define(["react"],h):(u=typeof globalThis<"u"?globalThis:u||self,u.StudioSdkPlugins_fsLightboxComponent=h())})(this,function(){"use strict";const u="app.grapesjs.com",h="app-stage.grapesjs.com",A=[u,h,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],M="license:check:start",P="license:check:end",k=()=>typeof window<"u",H=({isDev:o,isStage:i})=>`${o?"":`https://${i?h:u}`}/api`,$=()=>{const o=k()&&window.location.hostname;return!!o&&(A.includes(o)||A.some(i=>o.endsWith(i)))},B=()=>(k()&&window.location.hostname)===u;var W={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8-rc.0",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const R=W.NODE_ENV!=="production";async function U({path:o,method:i="GET",headers:c={},body:a}){const f=`${H({isDev:R,isStage:!B()})}${o}`,r={method:i,headers:{"Content-Type":"application/json",...c}};a&&(r.body=JSON.stringify(a));const T=await fetch(f,r);if(!T.ok)throw new Error(`HTTP error! status: ${T.status}`);return T.json()}function G(o){const i=o;return i.init=c=>a=>o(a,c),i}const K=o=>G(o);async function F({editor:o,pluginName:i,licenseKey:c,cleanup:a}){let b=!1;const f=$();o.on(M,()=>{b=!0}),o.on(P,({sdkLicense:r})=>{r||a()}),setTimeout(async()=>{if(!b){if(f)return;c&&await Z({licenseKey:c,pluginName:i})||a()}},2e3)}async function Z({licenseKey:o,pluginName:i}){try{const c=await U({path:`/sdk/${o}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:i})}),{license:a}=c.result||{};return!!a}catch(c){return console.error("Error during SDK license check:",c),!1}}const q="gjs-plg-",J="fsLightboxComponent",v="data-fslightbox",L="data-type",z="fslightbox-open",g="fslightbox",m={image:'<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',video:'<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',imageLightbox:'<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',external:'<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',eye:'<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'};return K(function(o,i={}){const{Blocks:c,Components:a}=o,b="Lightbox",f=`${q}${g}`,r={toolbarIconOpen:m.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...i},{block:T,toolbarIconOpen:C,defaultSrc:I}=r,X=function(t){const e=this,s="data-fslightbox",n=window,p=()=>{var w;const d=n.refreshFsLightbox;d==null||d();const E=e.getAttribute(s);if((w=n.fsLightboxInstances)==null||w[E],!n._isEditor)return;Array.from(document.querySelectorAll(`[${s}]`)).forEach(y=>{const S=y.onclick;y.onclick=function(_){_.preventDefault();const D=y;!D.__skipLb&&(S==null||S(_)),D.__skipLb=!0}})};if(n.refreshFsLightbox)p();else{const d=document.createElement("script");d.src=t.cdnScript,d.onload=p,document.head.appendChild(d)}},Y=t=>({id:`${g}-open-lb`,label:C,command:()=>{const e=t.getView();e==null||e.toggleLightbox()}}),l="source-type",V={type:"radio",name:l,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:m.image},{id:"video",label:"Video",icon:m.video},{id:"el",label:"Custom Element",icon:m.external}],labelToTitle:!0},N={id:"href-image",name:"href",type:"file",label:"Source Image"},O={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},j={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},Q={image:[N],video:[O],el:[j]};a.addType(g,{block:T&&{label:b,media:m.imageLightbox,category:"Extra",select:!0,...r.block},isComponent:t=>{var e;return(e=t.hasAttribute)==null?void 0:e.call(t,v)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:b,icon:m.imageLightbox,classes:f,draggable:(t,e)=>!e.is(g),attributes:{[v]:"lightbox",[L]:"image",href:I},components:{type:"image",src:I},script:X,cdnScript:r.cdnScript,"script-props":["attributes","cdnScript"],[l]:"image",traits:[V,{name:v,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(t,e){var n;const s=(n=e.target)==null?void 0:n.getView();s==null||s.toggleLightbox()}}],styles:`
1
+ (function(u,h){typeof exports=="object"&&typeof module<"u"?module.exports=h(require("react")):typeof define=="function"&&define.amd?define(["react"],h):(u=typeof globalThis<"u"?globalThis:u||self,u.StudioSdkPlugins_fsLightboxComponent=h())})(this,function(){"use strict";const u="app.grapesjs.com",h="app-stage.grapesjs.com",A=[u,h,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],M="license:check:start",P="license:check:end",k=()=>typeof window<"u",H=({isDev:o,isStage:i})=>`${o?"":`https://${i?h:u}`}/api`,$=()=>{const o=k()&&window.location.hostname;return!!o&&(A.includes(o)||A.some(i=>o.endsWith(i)))},B=()=>(k()&&window.location.hostname)===u;var W={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const R=W.NODE_ENV!=="production";async function U({path:o,method:i="GET",headers:c={},body:a}){const f=`${H({isDev:R,isStage:!B()})}${o}`,r={method:i,headers:{"Content-Type":"application/json",...c}};a&&(r.body=JSON.stringify(a));const T=await fetch(f,r);if(!T.ok)throw new Error(`HTTP error! status: ${T.status}`);return T.json()}function G(o){const i=o;return i.init=c=>a=>o(a,c),i}const K=o=>G(o);async function F({editor:o,pluginName:i,licenseKey:c,cleanup:a}){let b=!1;const f=$();o.on(M,()=>{b=!0}),o.on(P,({sdkLicense:r})=>{r||a()}),setTimeout(async()=>{if(!b){if(f)return;c&&await Z({licenseKey:c,pluginName:i})||a()}},2e3)}async function Z({licenseKey:o,pluginName:i}){try{const c=await U({path:`/sdk/${o}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:i})}),{license:a}=c.result||{};return!!a}catch(c){return console.error("Error during SDK license check:",c),!1}}const q="gjs-plg-",J="fsLightboxComponent",v="data-fslightbox",L="data-type",z="fslightbox-open",g="fslightbox",m={image:'<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',video:'<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',imageLightbox:'<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',external:'<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',eye:'<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'};return K(function(o,i={}){const{Blocks:c,Components:a}=o,b="Lightbox",f=`${q}${g}`,r={toolbarIconOpen:m.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...i},{block:T,toolbarIconOpen:C,defaultSrc:I}=r,X=function(t){const e=this,s="data-fslightbox",n=window,p=()=>{var w;const d=n.refreshFsLightbox;d==null||d();const E=e.getAttribute(s);if((w=n.fsLightboxInstances)==null||w[E],!n._isEditor)return;Array.from(document.querySelectorAll(`[${s}]`)).forEach(y=>{const S=y.onclick;y.onclick=function(_){_.preventDefault();const D=y;!D.__skipLb&&(S==null||S(_)),D.__skipLb=!0}})};if(n.refreshFsLightbox)p();else{const d=document.createElement("script");d.src=t.cdnScript,d.onload=p,document.head.appendChild(d)}},Y=t=>({id:`${g}-open-lb`,label:C,command:()=>{const e=t.getView();e==null||e.toggleLightbox()}}),l="source-type",V={type:"radio",name:l,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:m.image},{id:"video",label:"Video",icon:m.video},{id:"el",label:"Custom Element",icon:m.external}],labelToTitle:!0},N={id:"href-image",name:"href",type:"file",label:"Source Image"},O={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},j={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},Q={image:[N],video:[O],el:[j]};a.addType(g,{block:T&&{label:b,media:m.imageLightbox,category:"Extra",select:!0,...r.block},isComponent:t=>{var e;return(e=t.hasAttribute)==null?void 0:e.call(t,v)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:b,icon:m.imageLightbox,classes:f,draggable:(t,e)=>!e.is(g),attributes:{[v]:"lightbox",[L]:"image",href:I},components:{type:"image",src:I},script:X,cdnScript:r.cdnScript,"script-props":["attributes","cdnScript"],[l]:"image",traits:[V,{name:v,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(t,e){var n;const s=(n=e.target)==null?void 0:n.getView();s==null||s.toggleLightbox()}}],styles:`
2
2
  .${f} {
3
3
  display: inline-block;
4
4
  padding: 10px;
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const zr="app.grapesjs.com",Rs="app-stage.grapesjs.com",ii=[zr,Rs,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],Wl="license:check:start",$l="license:check:end",Is=()=>typeof window<"u",Jl=({isDev:n,isStage:e})=>`${n?"":`https://${e?Rs:zr}`}/api`,ql=()=>{const n=Is()&&window.location.hostname;return!!n&&(ii.includes(n)||ii.some(e=>n.endsWith(e)))},Kl=()=>(Is()&&window.location.hostname)===zr;function Vs(n){return typeof n=="function"}var jl={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8-rc.0",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const _l=jl.NODE_ENV!=="production";async function Ul({path:n,method:e="GET",headers:t={},body:r}){const s=`${Jl({isDev:_l,isStage:!Kl()})}${n}`,o={method:e,headers:{"Content-Type":"application/json",...t}};r&&(o.body=JSON.stringify(r));const l=await fetch(s,o);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return l.json()}function Gl(n){const e=n;return e.init=t=>r=>n(r,t),e}const _t=n=>Gl(n);async function Ut({editor:n,pluginName:e,licenseKey:t,cleanup:r}){let i=!1;const s=ql();n.on(Wl,()=>{i=!0}),n.on($l,({sdkLicense:o})=>{o||r()}),setTimeout(async()=>{if(!i){if(s)return;t&&await Zl({licenseKey:t,pluginName:e})||r()}},2e3)}async function Zl({licenseKey:n,pluginName:e}){try{const t=await Ul({path:`/sdk/${n}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:e})}),{license:r}=t.result||{};return!!r}catch(t){return console.error("Error during SDK license check:",t),!1}}const hr="gjs-plg-",si=(...n)=>n.map(e=>`[data-gjs-type="${e}"]`).join(","),Xl="dialogComponent",Yl=function(n,e={}){const{Blocks:t,Components:r}=n,{licenseKey:i}=e,s="gjs-plg-dialog",o="gjs-plg-dialog-overlay",l="gjs-plg-dialog-content",a="gjs-plg-dialog-close",c="gjs-plg-dialog-title",h="gjs-plg-dialog-body",f="gjs-plg-dialog-description",d="gjs-plg-dialog-placeholder";t.add(s,{label:"Dialog",media:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const zr="app.grapesjs.com",Rs="app-stage.grapesjs.com",ii=[zr,Rs,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],Wl="license:check:start",$l="license:check:end",Is=()=>typeof window<"u",Jl=({isDev:n,isStage:e})=>`${n?"":`https://${e?Rs:zr}`}/api`,ql=()=>{const n=Is()&&window.location.hostname;return!!n&&(ii.includes(n)||ii.some(e=>n.endsWith(e)))},Kl=()=>(Is()&&window.location.hostname)===zr;function Vs(n){return typeof n=="function"}var jl={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const _l=jl.NODE_ENV!=="production";async function Ul({path:n,method:e="GET",headers:t={},body:r}){const s=`${Jl({isDev:_l,isStage:!Kl()})}${n}`,o={method:e,headers:{"Content-Type":"application/json",...t}};r&&(o.body=JSON.stringify(r));const l=await fetch(s,o);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return l.json()}function Gl(n){const e=n;return e.init=t=>r=>n(r,t),e}const _t=n=>Gl(n);async function Ut({editor:n,pluginName:e,licenseKey:t,cleanup:r}){let i=!1;const s=ql();n.on(Wl,()=>{i=!0}),n.on($l,({sdkLicense:o})=>{o||r()}),setTimeout(async()=>{if(!i){if(s)return;t&&await Zl({licenseKey:t,pluginName:e})||r()}},2e3)}async function Zl({licenseKey:n,pluginName:e}){try{const t=await Ul({path:`/sdk/${n}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:e})}),{license:r}=t.result||{};return!!r}catch(t){return console.error("Error during SDK license check:",t),!1}}const hr="gjs-plg-",si=(...n)=>n.map(e=>`[data-gjs-type="${e}"]`).join(","),Xl="dialogComponent",Yl=function(n,e={}){const{Blocks:t,Components:r}=n,{licenseKey:i}=e,s="gjs-plg-dialog",o="gjs-plg-dialog-overlay",l="gjs-plg-dialog-content",a="gjs-plg-dialog-close",c="gjs-plg-dialog-title",h="gjs-plg-dialog-body",f="gjs-plg-dialog-description",d="gjs-plg-dialog-placeholder";t.add(s,{label:"Dialog",media:`
2
2
  <svg viewBox="0 0 24 24">
3
3
  <path d="M4 4h16v10H8l-4 4V4z"></path>
4
4
  </svg>
package/dist/index.es.js CHANGED
@@ -17,7 +17,7 @@ const zr = "app.grapesjs.com", Rs = "app-stage.grapesjs.com", ii = [
17
17
  function Vs(n) {
18
18
  return typeof n == "function";
19
19
  }
20
- var jl = { NODE_ENV: "production", NPM_PACKAGE_VERSION: "1.0.8-rc.0", STUDIO_NPM_PACKAGE_VERSION: "1.0.25" };
20
+ var jl = { NODE_ENV: "production", NPM_PACKAGE_VERSION: "1.0.8", STUDIO_NPM_PACKAGE_VERSION: "1.0.25" };
21
21
  const _l = jl.NODE_ENV !== "production";
22
22
  async function Ul({
23
23
  path: n,
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(ue,qe){typeof exports=="object"&&typeof module<"u"?qe(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],qe):(ue=typeof globalThis<"u"?globalThis:ue||self,qe(ue.StudioSdkPlugins={}))})(this,function(ue){"use strict";const qe="app.grapesjs.com",ii="app-stage.grapesjs.com",si=[qe,ii,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],Wl="license:check:start",Jl="license:check:end",oi=()=>typeof window<"u",ql=({isDev:n,isStage:e})=>`${n?"":`https://${e?ii:qe}`}/api`,Kl=()=>{const n=oi()&&window.location.hostname;return!!n&&(si.includes(n)||si.some(e=>n.endsWith(e)))},jl=()=>(oi()&&window.location.hostname)===qe;function li(n){return typeof n=="function"}var _l={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8-rc.0",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const Ul=_l.NODE_ENV!=="production";async function Gl({path:n,method:e="GET",headers:t={},body:r}){const s=`${ql({isDev:Ul,isStage:!jl()})}${n}`,o={method:e,headers:{"Content-Type":"application/json",...t}};r&&(o.body=JSON.stringify(r));const l=await fetch(s,o);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return l.json()}function Zl(n){const e=n;return e.init=t=>r=>n(r,t),e}const At=n=>Zl(n);async function Et({editor:n,pluginName:e,licenseKey:t,cleanup:r}){let i=!1;const s=Kl();n.on(Wl,()=>{i=!0}),n.on(Jl,({sdkLicense:o})=>{o||r()}),setTimeout(async()=>{if(!i){if(s)return;t&&await Xl({licenseKey:t,pluginName:e})||r()}},2e3)}async function Xl({licenseKey:n,pluginName:e}){try{const t=await Gl({path:`/sdk/${n}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:e})}),{license:r}=t.result||{};return!!r}catch(t){return console.error("Error during SDK license check:",t),!1}}const Kn="gjs-plg-",ai=(...n)=>n.map(e=>`[data-gjs-type="${e}"]`).join(","),Yl="dialogComponent",Ql=At(function(n,e={}){const{Blocks:t,Components:r}=n,{licenseKey:i}=e,s="gjs-plg-dialog",o="gjs-plg-dialog-overlay",l="gjs-plg-dialog-content",a="gjs-plg-dialog-close",c="gjs-plg-dialog-title",h="gjs-plg-dialog-body",f="gjs-plg-dialog-description",d="gjs-plg-dialog-placeholder";t.add(s,{label:"Dialog",media:`
1
+ (function(ue,qe){typeof exports=="object"&&typeof module<"u"?qe(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],qe):(ue=typeof globalThis<"u"?globalThis:ue||self,qe(ue.StudioSdkPlugins={}))})(this,function(ue){"use strict";const qe="app.grapesjs.com",ii="app-stage.grapesjs.com",si=[qe,ii,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],Wl="license:check:start",Jl="license:check:end",oi=()=>typeof window<"u",ql=({isDev:n,isStage:e})=>`${n?"":`https://${e?ii:qe}`}/api`,Kl=()=>{const n=oi()&&window.location.hostname;return!!n&&(si.includes(n)||si.some(e=>n.endsWith(e)))},jl=()=>(oi()&&window.location.hostname)===qe;function li(n){return typeof n=="function"}var _l={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const Ul=_l.NODE_ENV!=="production";async function Gl({path:n,method:e="GET",headers:t={},body:r}){const s=`${ql({isDev:Ul,isStage:!jl()})}${n}`,o={method:e,headers:{"Content-Type":"application/json",...t}};r&&(o.body=JSON.stringify(r));const l=await fetch(s,o);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return l.json()}function Zl(n){const e=n;return e.init=t=>r=>n(r,t),e}const At=n=>Zl(n);async function Et({editor:n,pluginName:e,licenseKey:t,cleanup:r}){let i=!1;const s=Kl();n.on(Wl,()=>{i=!0}),n.on(Jl,({sdkLicense:o})=>{o||r()}),setTimeout(async()=>{if(!i){if(s)return;t&&await Xl({licenseKey:t,pluginName:e})||r()}},2e3)}async function Xl({licenseKey:n,pluginName:e}){try{const t=await Gl({path:`/sdk/${n}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:e})}),{license:r}=t.result||{};return!!r}catch(t){return console.error("Error during SDK license check:",t),!1}}const Kn="gjs-plg-",ai=(...n)=>n.map(e=>`[data-gjs-type="${e}"]`).join(","),Yl="dialogComponent",Ql=At(function(n,e={}){const{Blocks:t,Components:r}=n,{licenseKey:i}=e,s="gjs-plg-dialog",o="gjs-plg-dialog-overlay",l="gjs-plg-dialog-content",a="gjs-plg-dialog-close",c="gjs-plg-dialog-title",h="gjs-plg-dialog-body",f="gjs-plg-dialog-description",d="gjs-plg-dialog-placeholder";t.add(s,{label:"Dialog",media:`
2
2
  <svg viewBox="0 0 24 24">
3
3
  <path d="M4 4h16v10H8l-4 4V4z"></path>
4
4
  </svg>
@@ -1,4 +1,4 @@
1
- "use strict";require("react");function v(e,s,n){let t,o,i,a,c;const d=s;function g(){const m=Date.now()-a;m<d&&m>=0?t=setTimeout(g,d-m):(t=null,c=e.apply(i,o),i=o=null)}const p=function(){return i=this,o=arguments,a=Date.now(),t||(t=setTimeout(g,d)),c};return p.clear=function(){t&&(clearTimeout(t),t=null)},p.flush=function(){t&&(c=e.apply(i,o),i=o=null,clearTimeout(t),t=null)},p}const V="page://",r="list-pages",u="list-pages-item",l="list-pages-link",D=e=>e.components().reduce((s,n)=>{var a;const t=n.findFirstType(l),o=(a=t==null?void 0:t.attributes.attributes)==null?void 0:a.href,i=o!=null&&o.startsWith(V)?o.replace(V,""):"";if(i&&t){const c=s[i];c?c.push(t):s[i]=[t]}return s},{}),b="app.grapesjs.com",C="app-stage.grapesjs.com",A=[b,C,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],O="license:check:start",$="license:check:end",_=()=>typeof window<"u",x=({isDev:e,isStage:s})=>`${e?"":`https://${s?C:b}`}/api`,R=()=>{const e=_()&&window.location.hostname;return!!e&&(A.includes(e)||A.some(s=>e.endsWith(s)))},W=()=>(_()&&window.location.hostname)===b;var B={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8-rc.0",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const K=B.NODE_ENV!=="production";async function U({path:e,method:s="GET",headers:n={},body:t}){const i=`${x({isDev:K,isStage:!W()})}${e}`,a={method:s,headers:{"Content-Type":"application/json",...n}};t&&(a.body=JSON.stringify(t));const c=await fetch(i,a);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}function G(e){const s=e;return s.init=n=>t=>e(t,n),s}const j=e=>G(e);async function F({editor:e,pluginName:s,licenseKey:n,cleanup:t}){let o=!1;const i=R();e.on(O,()=>{o=!0}),e.on($,({sdkLicense:a})=>{a||t()}),setTimeout(async()=>{if(!o){if(i)return;n&&await J({licenseKey:n,pluginName:s})||t()}},2e3)}async function J({licenseKey:e,pluginName:s}){try{const n=await U({path:`/sdk/${e}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:s})}),{license:t}=n.result||{};return!!t}catch(n){return console.error("Error during SDK license check:",n),!1}}const H="gjs-plg-",X="listPagesComponent",f="data-type-role",Y="page_root",Z=e=>s=>s.is(e),q=e=>(s,n)=>n.is(e),T=e=>s=>{var n;return((n=s.getAttribute)==null?void 0:n.call(s,f))===e},z=function(e,s={}){const{Blocks:n,Components:t,Pages:o}=e,{licenseKey:i,block:a={}}=s,c="List Pages",d="List Pages Item",g="Link",p=`${H}${r}`,m=`${H}${l}`,w='<svg viewBox="0 0 24 24"><path d="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"/></svg>',N='<svg viewBox="0 0 24 24"><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>';t.addType(r,{block:a&&{label:c,media:w,category:"Extra",select:!0,...s.block},isComponent:T(r),model:{defaults:{tagName:"ul",name:c,[Y]:"",classes:p,attributes:{[f]:r},droppable:Z(u),styles:`
1
+ "use strict";require("react");function v(e,s,n){let t,o,i,a,c;const d=s;function g(){const m=Date.now()-a;m<d&&m>=0?t=setTimeout(g,d-m):(t=null,c=e.apply(i,o),i=o=null)}const p=function(){return i=this,o=arguments,a=Date.now(),t||(t=setTimeout(g,d)),c};return p.clear=function(){t&&(clearTimeout(t),t=null)},p.flush=function(){t&&(c=e.apply(i,o),i=o=null,clearTimeout(t),t=null)},p}const V="page://",r="list-pages",u="list-pages-item",l="list-pages-link",D=e=>e.components().reduce((s,n)=>{var a;const t=n.findFirstType(l),o=(a=t==null?void 0:t.attributes.attributes)==null?void 0:a.href,i=o!=null&&o.startsWith(V)?o.replace(V,""):"";if(i&&t){const c=s[i];c?c.push(t):s[i]=[t]}return s},{}),b="app.grapesjs.com",C="app-stage.grapesjs.com",A=[b,C,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],O="license:check:start",$="license:check:end",_=()=>typeof window<"u",x=({isDev:e,isStage:s})=>`${e?"":`https://${s?C:b}`}/api`,R=()=>{const e=_()&&window.location.hostname;return!!e&&(A.includes(e)||A.some(s=>e.endsWith(s)))},W=()=>(_()&&window.location.hostname)===b;var B={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const K=B.NODE_ENV!=="production";async function U({path:e,method:s="GET",headers:n={},body:t}){const i=`${x({isDev:K,isStage:!W()})}${e}`,a={method:s,headers:{"Content-Type":"application/json",...n}};t&&(a.body=JSON.stringify(t));const c=await fetch(i,a);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}function G(e){const s=e;return s.init=n=>t=>e(t,n),s}const j=e=>G(e);async function F({editor:e,pluginName:s,licenseKey:n,cleanup:t}){let o=!1;const i=R();e.on(O,()=>{o=!0}),e.on($,({sdkLicense:a})=>{a||t()}),setTimeout(async()=>{if(!o){if(i)return;n&&await J({licenseKey:n,pluginName:s})||t()}},2e3)}async function J({licenseKey:e,pluginName:s}){try{const n=await U({path:`/sdk/${e}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:s})}),{license:t}=n.result||{};return!!t}catch(n){return console.error("Error during SDK license check:",n),!1}}const H="gjs-plg-",X="listPagesComponent",f="data-type-role",Y="page_root",Z=e=>s=>s.is(e),q=e=>(s,n)=>n.is(e),T=e=>s=>{var n;return((n=s.getAttribute)==null?void 0:n.call(s,f))===e},z=function(e,s={}){const{Blocks:n,Components:t,Pages:o}=e,{licenseKey:i,block:a={}}=s,c="List Pages",d="List Pages Item",g="Link",p=`${H}${r}`,m=`${H}${l}`,w='<svg viewBox="0 0 24 24"><path d="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"/></svg>',N='<svg viewBox="0 0 24 24"><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>';t.addType(r,{block:a&&{label:c,media:w,category:"Extra",select:!0,...s.block},isComponent:T(r),model:{defaults:{tagName:"ul",name:c,[Y]:"",classes:p,attributes:{[f]:r},droppable:Z(u),styles:`
2
2
  .${p} {
3
3
  list-style: none;
4
4
  margin: 0;
@@ -41,7 +41,7 @@ const V = "page://", r = "list-pages", u = "list-pages-item", l = "list-pages-li
41
41
  const e = _() && window.location.hostname;
42
42
  return !!e && (A.includes(e) || A.some((s) => e.endsWith(s)));
43
43
  }, W = () => (_() && window.location.hostname) === b;
44
- var B = { NODE_ENV: "production", NPM_PACKAGE_VERSION: "1.0.8-rc.0", STUDIO_NPM_PACKAGE_VERSION: "1.0.25" };
44
+ var B = { NODE_ENV: "production", NPM_PACKAGE_VERSION: "1.0.8", STUDIO_NPM_PACKAGE_VERSION: "1.0.25" };
45
45
  const K = B.NODE_ENV !== "production";
46
46
  async function U({
47
47
  path: e,
@@ -1,4 +1,4 @@
1
- (function(g,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("react")):typeof define=="function"&&define.amd?define(["react"],p):(g=typeof globalThis<"u"?globalThis:g||self,g.StudioSdkPlugins_listPagesComponent=p())})(this,function(){"use strict";function g(t,s,n){let e,o,i,a,c;const f=s;function y(){const m=Date.now()-a;m<f&&m>=0?e=setTimeout(y,f-m):(e=null,c=t.apply(i,o),i=o=null)}const d=function(){return i=this,o=arguments,a=Date.now(),e||(e=setTimeout(y,f)),c};return d.clear=function(){e&&(clearTimeout(e),e=null)},d.flush=function(){e&&(c=t.apply(i,o),i=o=null,clearTimeout(e),e=null)},d}const p="page://",r="list-pages",u="list-pages-item",l="list-pages-link",w=t=>t.components().reduce((s,n)=>{var a;const e=n.findFirstType(l),o=(a=e==null?void 0:e.attributes.attributes)==null?void 0:a.href,i=o!=null&&o.startsWith(p)?o.replace(p,""):"";if(i&&e){const c=s[i];c?c.push(e):s[i]=[e]}return s},{}),T="app.grapesjs.com",L="app-stage.grapesjs.com",V=[T,L,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],N="license:check:start",M="license:check:end",A=()=>typeof window<"u",S=({isDev:t,isStage:s})=>`${t?"":`https://${s?L:T}`}/api`,v=()=>{const t=A()&&window.location.hostname;return!!t&&(V.includes(t)||V.some(s=>t.endsWith(s)))},D=()=>(A()&&window.location.hostname)===T;var O={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8-rc.0",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const x=O.NODE_ENV!=="production";async function $({path:t,method:s="GET",headers:n={},body:e}){const i=`${S({isDev:x,isStage:!D()})}${t}`,a={method:s,headers:{"Content-Type":"application/json",...n}};e&&(a.body=JSON.stringify(e));const c=await fetch(i,a);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}function R(t){const s=t;return s.init=n=>e=>t(e,n),s}const W=t=>R(t);async function B({editor:t,pluginName:s,licenseKey:n,cleanup:e}){let o=!1;const i=v();t.on(N,()=>{o=!0}),t.on(M,({sdkLicense:a})=>{a||e()}),setTimeout(async()=>{if(!o){if(i)return;n&&await K({licenseKey:n,pluginName:s})||e()}},2e3)}async function K({licenseKey:t,pluginName:s}){try{const n=await $({path:`/sdk/${t}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:s})}),{license:e}=n.result||{};return!!e}catch(n){return console.error("Error during SDK license check:",n),!1}}const C="gjs-plg-",U="listPagesComponent",h="data-type-role",j="page_root",G=t=>s=>s.is(t),F=t=>(s,n)=>n.is(t),b=t=>s=>{var n;return((n=s.getAttribute)==null?void 0:n.call(s,h))===t};return W(function(t,s={}){const{Blocks:n,Components:e,Pages:o}=t,{licenseKey:i,block:a={}}=s,c="List Pages",f="List Pages Item",y="Link",d=`${C}${r}`,m=`${C}${l}`,J='<svg viewBox="0 0 24 24"><path d="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"/></svg>',X='<svg viewBox="0 0 24 24"><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>';e.addType(r,{block:a&&{label:c,media:J,category:"Extra",select:!0,...s.block},isComponent:b(r),model:{defaults:{tagName:"ul",name:c,[j]:"",classes:d,attributes:{[h]:r},droppable:G(u),styles:`
1
+ (function(g,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("react")):typeof define=="function"&&define.amd?define(["react"],p):(g=typeof globalThis<"u"?globalThis:g||self,g.StudioSdkPlugins_listPagesComponent=p())})(this,function(){"use strict";function g(t,s,n){let e,o,i,a,c;const f=s;function y(){const m=Date.now()-a;m<f&&m>=0?e=setTimeout(y,f-m):(e=null,c=t.apply(i,o),i=o=null)}const d=function(){return i=this,o=arguments,a=Date.now(),e||(e=setTimeout(y,f)),c};return d.clear=function(){e&&(clearTimeout(e),e=null)},d.flush=function(){e&&(c=t.apply(i,o),i=o=null,clearTimeout(e),e=null)},d}const p="page://",r="list-pages",u="list-pages-item",l="list-pages-link",w=t=>t.components().reduce((s,n)=>{var a;const e=n.findFirstType(l),o=(a=e==null?void 0:e.attributes.attributes)==null?void 0:a.href,i=o!=null&&o.startsWith(p)?o.replace(p,""):"";if(i&&e){const c=s[i];c?c.push(e):s[i]=[e]}return s},{}),T="app.grapesjs.com",L="app-stage.grapesjs.com",V=[T,L,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],N="license:check:start",M="license:check:end",A=()=>typeof window<"u",S=({isDev:t,isStage:s})=>`${t?"":`https://${s?L:T}`}/api`,v=()=>{const t=A()&&window.location.hostname;return!!t&&(V.includes(t)||V.some(s=>t.endsWith(s)))},D=()=>(A()&&window.location.hostname)===T;var O={NODE_ENV:"production",NPM_PACKAGE_VERSION:"1.0.8",STUDIO_NPM_PACKAGE_VERSION:"1.0.25"};const x=O.NODE_ENV!=="production";async function $({path:t,method:s="GET",headers:n={},body:e}){const i=`${S({isDev:x,isStage:!D()})}${t}`,a={method:s,headers:{"Content-Type":"application/json",...n}};e&&(a.body=JSON.stringify(e));const c=await fetch(i,a);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}function R(t){const s=t;return s.init=n=>e=>t(e,n),s}const W=t=>R(t);async function B({editor:t,pluginName:s,licenseKey:n,cleanup:e}){let o=!1;const i=v();t.on(N,()=>{o=!0}),t.on(M,({sdkLicense:a})=>{a||e()}),setTimeout(async()=>{if(!o){if(i)return;n&&await K({licenseKey:n,pluginName:s})||e()}},2e3)}async function K({licenseKey:t,pluginName:s}){try{const n=await $({path:`/sdk/${t}`,method:"POST",body:JSON.stringify({d:window.location.hostname,pn:s})}),{license:e}=n.result||{};return!!e}catch(n){return console.error("Error during SDK license check:",n),!1}}const C="gjs-plg-",U="listPagesComponent",h="data-type-role",j="page_root",G=t=>s=>s.is(t),F=t=>(s,n)=>n.is(t),b=t=>s=>{var n;return((n=s.getAttribute)==null?void 0:n.call(s,h))===t};return W(function(t,s={}){const{Blocks:n,Components:e,Pages:o}=t,{licenseKey:i,block:a={}}=s,c="List Pages",f="List Pages Item",y="Link",d=`${C}${r}`,m=`${C}${l}`,J='<svg viewBox="0 0 24 24"><path d="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"/></svg>',X='<svg viewBox="0 0 24 24"><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>';e.addType(r,{block:a&&{label:c,media:J,category:"Extra",select:!0,...s.block},isComponent:b(r),model:{defaults:{tagName:"ul",name:c,[j]:"",classes:d,attributes:{[h]:r},droppable:G(u),styles:`
2
2
  .${d} {
3
3
  list-style: none;
4
4
  margin: 0;