@grapesjs/studio-sdk-plugins 1.0.13-rc.1 → 1.0.13
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.
- package/dist/dialogComponent/index.cjs.js +1 -1
- package/dist/dialogComponent/index.es.js +1 -1
- package/dist/dialogComponent/index.umd.js +1 -1
- package/dist/fsLightboxComponent/index.cjs.js +1 -1
- package/dist/fsLightboxComponent/index.es.js +1 -1
- package/dist/fsLightboxComponent/index.umd.js +1 -1
- package/dist/iconifyComponent/types.d.ts +1 -1
- package/dist/iconifyComponent/typesSchema.d.ts +1 -1
- package/dist/iconifyComponent/utils.d.ts +1 -1
- package/dist/index.cjs.js +37 -269
- package/dist/index.es.js +7002 -21882
- package/dist/index.umd.js +37 -269
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +1 -1
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/listPagesComponent/index.cjs.js +1 -1
- package/dist/listPagesComponent/index.es.js +1 -1
- package/dist/listPagesComponent/index.umd.js +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +10 -12
- package/dist/prosemirror/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +1 -233
- package/dist/rteTinyMce/index.es.js +176 -15056
- package/dist/rteTinyMce/index.umd.js +1 -233
- package/dist/rteTinyMce/types.d.ts +2 -5
- package/dist/rteTinyMce/utils.d.ts +1 -1
- package/dist/swiperComponent/index.cjs.js +1 -1
- package/dist/swiperComponent/index.es.js +1 -1
- package/dist/swiperComponent/index.umd.js +1 -1
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +2 -2
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/utils.d.ts +2 -3
- package/dist/youtubeAssetProvider/assetProviders/youtube.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +2 -4
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/dist/youtubeAssetProvider/types.d.ts +41 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
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)))};
|
|
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)))};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()}var W=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(W||{});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>
|
|
@@ -14,7 +14,6 @@ const C = "app.grapesjs.com", O = "app-stage.grapesjs.com", L = [
|
|
|
14
14
|
const n = _() && window.location.hostname;
|
|
15
15
|
return !!n && (L.includes(n) || L.some((s) => n.endsWith(s)));
|
|
16
16
|
};
|
|
17
|
-
var W = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(W || {});
|
|
18
17
|
async function D({
|
|
19
18
|
path: n,
|
|
20
19
|
baseApiUrl: s,
|
|
@@ -36,6 +35,7 @@ async function D({
|
|
|
36
35
|
throw new Error(`HTTP error! status: ${c.status}`);
|
|
37
36
|
return c.json();
|
|
38
37
|
}
|
|
38
|
+
var W = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(W || {});
|
|
39
39
|
const P = {
|
|
40
40
|
[W.free]: 0,
|
|
41
41
|
[W.startup]: 10,
|
|
@@ -1,4 +1,4 @@
|
|
|
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)))};
|
|
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)))};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()}var b=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(b||{});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>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require("grapesjs");const P="app.grapesjs.com",B="app-stage.grapesjs.com",N=[P,B,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],D="license:check:start",U="license:check:end",R=()=>typeof window<"u",W=({isDev:t,isStage:a})=>`${t?"":`https://${a?B:P}`}/api`,F=()=>{const t=R()&&window.location.hostname;return!!t&&(N.includes(t)||N.some(a=>t.endsWith(a)))};
|
|
1
|
+
"use strict";require("grapesjs");const P="app.grapesjs.com",B="app-stage.grapesjs.com",N=[P,B,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],D="license:check:start",U="license:check:end",R=()=>typeof window<"u",W=({isDev:t,isStage:a})=>`${t?"":`https://${a?B:P}`}/api`,F=()=>{const t=R()&&window.location.hostname;return!!t&&(N.includes(t)||N.some(a=>t.endsWith(a)))};async function K({path:t,baseApiUrl:a,method:r="GET",headers:c={},params:p,body:h}){const w=`${a||W({isDev:!1,isStage:!1})}${t}`,d={method:r,headers:{"Content-Type":"application/json",...c}};h&&(d.body=JSON.stringify(h));const m=p?new URLSearchParams(p).toString():"",n=m?`?${m}`:"",b=await fetch(`${w}${n}`,d);if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);return b.json()}var x=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(x||{});const O={[x.free]:0,[x.startup]:10,[x.business]:20,[x.enterprise]:30};function q(t){const a=t;return a.init=r=>c=>t(c,r),a}const G=t=>q(t);async function Z({editor:t,plan:a,pluginName:r,licenseKey:c,cleanup:p}){let h="",g=!1;const w=F(),d=n=>{console.warn("Cleanup plugin:",r,"Reason:",n),p()},m=(n={})=>{var A;const{error:b,sdkLicense:l}=n,v=(A=n.plan)==null?void 0:A.category;if(!(l||n.license)||b)d(b||"Invalid license");else if(v){const E=O[a],$=O[v];E>$&&d({pluginRequiredPlan:a,licensePlan:v})}};t.on(D,n=>{h=n==null?void 0:n.baseApiUrl,g=!0}),t.on(U,n=>{m(n)}),setTimeout(async()=>{if(!g){if(w)return;if(c){const n=await z({licenseKey:c,pluginName:r,baseApiUrl:h});n&&m(n)}else d("The `licenseKey` option not provided")}},2e3)}async function z(t){const{licenseKey:a,pluginName:r,baseApiUrl:c}=t;try{return(await K({baseApiUrl:c,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:r}})).result||{}}catch(p){return console.error("Error during SDK license check:",p),!1}}const J="gjs-plg-",X="fsLightboxComponent",k="data-fslightbox",C="data-type",Y="fslightbox-open",T="fslightbox",S={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>'},Q=function(t,a={}){const{Blocks:r,Components:c}=t,p="Lightbox",h=`${J}${T}`,g={toolbarIconOpen:S.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...a},{block:w,toolbarIconOpen:d,defaultSrc:m}=g,n=function(s){const e=this,i="data-fslightbox",o=window,f=()=>{var H;const u=o.refreshFsLightbox;u==null||u();const j=e.getAttribute(i);if((H=o.fsLightboxInstances)==null||H[j],!o._isEditor)return;Array.from(document.querySelectorAll(`[${i}]`)).forEach(y=>{const L=y.onclick;y.onclick=function(I){I.preventDefault();const M=y;!M.__skipLb&&(L==null||L(I)),M.__skipLb=!0}})};if(o.refreshFsLightbox)f();else{const u=document.createElement("script");u.src=s.cdnScript,u.onload=f,document.head.appendChild(u)}},b=s=>({id:`${T}-open-lb`,label:d,command:()=>{const e=s.getView();e==null||e.toggleLightbox()}}),l="source-type",v={type:"radio",name:l,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:S.image},{id:"video",label:"Video",icon:S.video},{id:"el",label:"Custom Element",icon:S.external}],labelToTitle:!0},V={id:"href-image",name:"href",type:"file",label:"Source Image"},A={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},E={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},$={image:[V],video:[A],el:[E]};c.addType(T,{block:w&&{label:p,media:S.imageLightbox,category:"Extra",select:!0,...g.block},isComponent:s=>{var e;return(e=s.hasAttribute)==null?void 0:e.call(s,k)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:p,icon:S.imageLightbox,classes:h,draggable:(s,e)=>!e.is(T),attributes:{[k]:"lightbox",[C]:"image",href:m},components:{type:"image",src:m},script:n,cdnScript:g.cdnScript,"script-props":["attributes","cdnScript"],[l]:"image",traits:[v,{name:k,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(s,e){var o;const i=(o=e.target)==null?void 0:o.getView();i==null||i.toggleLightbox()}}],styles:`
|
|
2
2
|
.${h} {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
padding: 10px;
|
|
@@ -14,7 +14,6 @@ const P = "app.grapesjs.com", B = "app-stage.grapesjs.com", N = [
|
|
|
14
14
|
const t = R() && window.location.hostname;
|
|
15
15
|
return !!t && (N.includes(t) || N.some((a) => t.endsWith(a)));
|
|
16
16
|
};
|
|
17
|
-
var x = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(x || {});
|
|
18
17
|
async function K({
|
|
19
18
|
path: t,
|
|
20
19
|
baseApiUrl: a,
|
|
@@ -36,6 +35,7 @@ async function K({
|
|
|
36
35
|
throw new Error(`HTTP error! status: ${b.status}`);
|
|
37
36
|
return b.json();
|
|
38
37
|
}
|
|
38
|
+
var x = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(x || {});
|
|
39
39
|
const O = {
|
|
40
40
|
[x.free]: 0,
|
|
41
41
|
[x.startup]: 10,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(v,y){typeof exports=="object"&&typeof module<"u"?module.exports=y(require("grapesjs")):typeof define=="function"&&define.amd?define(["grapesjs"],y):(v=typeof globalThis<"u"?globalThis:v||self,v.StudioSdkPlugins_fsLightboxComponent=y())})(this,function(){"use strict";const v="app.grapesjs.com",y="app-stage.grapesjs.com",O=[v,y,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],D="license:check:start",U="license:check:end",R=()=>typeof window<"u",W=({isDev:t,isStage:a})=>`${t?"":`https://${a?y:v}`}/api`,F=()=>{const t=R()&&window.location.hostname;return!!t&&(O.includes(t)||O.some(a=>t.endsWith(a)))};
|
|
1
|
+
(function(v,y){typeof exports=="object"&&typeof module<"u"?module.exports=y(require("grapesjs")):typeof define=="function"&&define.amd?define(["grapesjs"],y):(v=typeof globalThis<"u"?globalThis:v||self,v.StudioSdkPlugins_fsLightboxComponent=y())})(this,function(){"use strict";const v="app.grapesjs.com",y="app-stage.grapesjs.com",O=[v,y,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],D="license:check:start",U="license:check:end",R=()=>typeof window<"u",W=({isDev:t,isStage:a})=>`${t?"":`https://${a?y:v}`}/api`,F=()=>{const t=R()&&window.location.hostname;return!!t&&(O.includes(t)||O.some(a=>t.endsWith(a)))};async function K({path:t,baseApiUrl:a,method:r="GET",headers:c={},params:p,body:h}){const E=`${a||W({isDev:!1,isStage:!1})}${t}`,d={method:r,headers:{"Content-Type":"application/json",...c}};h&&(d.body=JSON.stringify(h));const m=p?new URLSearchParams(p).toString():"",s=m?`?${m}`:"",b=await fetch(`${E}${s}`,d);if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);return b.json()}var T=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(T||{});const P={[T.free]:0,[T.startup]:10,[T.business]:20,[T.enterprise]:30};function q(t){const a=t;return a.init=r=>c=>t(c,r),a}const G=t=>q(t);async function Z({editor:t,plan:a,pluginName:r,licenseKey:c,cleanup:p}){let h="",g=!1;const E=F(),d=s=>{console.warn("Cleanup plugin:",r,"Reason:",s),p()},m=(s={})=>{var _;const{error:b,sdkLicense:l}=s,x=(_=s.plan)==null?void 0:_.category;if(!(l||s.license)||b)d(b||"Invalid license");else if(x){const C=P[a],H=P[x];C>H&&d({pluginRequiredPlan:a,licensePlan:x})}};t.on(D,s=>{h=s==null?void 0:s.baseApiUrl,g=!0}),t.on(U,s=>{m(s)}),setTimeout(async()=>{if(!g){if(E)return;if(c){const s=await z({licenseKey:c,pluginName:r,baseApiUrl:h});s&&m(s)}else d("The `licenseKey` option not provided")}},2e3)}async function z(t){const{licenseKey:a,pluginName:r,baseApiUrl:c}=t;try{return(await K({baseApiUrl:c,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:r}})).result||{}}catch(p){return console.error("Error during SDK license check:",p),!1}}const J="gjs-plg-",X="fsLightboxComponent",k="data-fslightbox",I="data-type",Y="fslightbox-open",L="fslightbox",S={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 G(function(t,a={}){const{Blocks:r,Components:c}=t,p="Lightbox",h=`${J}${L}`,g={toolbarIconOpen:S.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...a},{block:E,toolbarIconOpen:d,defaultSrc:m}=g,s=function(n){const e=this,i="data-fslightbox",o=window,f=()=>{var N;const u=o.refreshFsLightbox;u==null||u();const M=e.getAttribute(i);if((N=o.fsLightboxInstances)==null||N[M],!o._isEditor)return;Array.from(document.querySelectorAll(`[${i}]`)).forEach(w=>{const A=w.onclick;w.onclick=function(V){V.preventDefault();const B=w;!B.__skipLb&&(A==null||A(V)),B.__skipLb=!0}})};if(o.refreshFsLightbox)f();else{const u=document.createElement("script");u.src=n.cdnScript,u.onload=f,document.head.appendChild(u)}},b=n=>({id:`${L}-open-lb`,label:d,command:()=>{const e=n.getView();e==null||e.toggleLightbox()}}),l="source-type",x={type:"radio",name:l,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:S.image},{id:"video",label:"Video",icon:S.video},{id:"el",label:"Custom Element",icon:S.external}],labelToTitle:!0},$={id:"href-image",name:"href",type:"file",label:"Source Image"},_={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},C={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},H={image:[$],video:[_],el:[C]};c.addType(L,{block:E&&{label:p,media:S.imageLightbox,category:"Extra",select:!0,...g.block},isComponent:n=>{var e;return(e=n.hasAttribute)==null?void 0:e.call(n,k)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:p,icon:S.imageLightbox,classes:h,draggable:(n,e)=>!e.is(L),attributes:{[k]:"lightbox",[I]:"image",href:m},components:{type:"image",src:m},script:s,cdnScript:g.cdnScript,"script-props":["attributes","cdnScript"],[l]:"image",traits:[x,{name:k,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(n,e){var o;const i=(o=e.target)==null?void 0:o.getView();i==null||i.toggleLightbox()}}],styles:`
|
|
2
2
|
.${h} {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
padding: 10px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockProperties,
|
|
1
|
+
import { BlockProperties, Component, Editor } from '../types';
|
|
2
2
|
import { IconifyComponentOptions as IconifyComponentOptionsSchema } from './typesSchema';
|
|
3
3
|
export interface IconifyComponentOptions extends Omit<IconifyComponentOptionsSchema, 'block'> {
|
|
4
4
|
block?: Partial<BlockProperties> | false;
|
|
@@ -12,7 +12,7 @@ export interface IconifyComponentOptions extends SDKPluginOptions {
|
|
|
12
12
|
*/
|
|
13
13
|
collections?: string[];
|
|
14
14
|
/**
|
|
15
|
-
* Extend the default icon component.
|
|
15
|
+
* Extend the icon picker trait to the default icon component.
|
|
16
16
|
* @default true
|
|
17
17
|
*/
|
|
18
18
|
extendIconComponent?: boolean;
|