@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.36

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.
Files changed (88) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +175 -162
  3. package/dist/accordionComponent/index.umd.js +7 -7
  4. package/dist/aiChat/index.cjs.js +64 -64
  5. package/dist/aiChat/index.es.js +5785 -5757
  6. package/dist/aiChat/index.js +64 -64
  7. package/dist/aiChat/index.umd.js +63 -63
  8. package/dist/animationComponent/index.cjs.js +3 -3
  9. package/dist/animationComponent/index.es.js +204 -191
  10. package/dist/animationComponent/index.umd.js +3 -3
  11. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  12. package/dist/canvasAbsoluteMode/index.es.js +183 -170
  13. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  14. package/dist/canvasEmptyState/index.cjs.js +1 -1
  15. package/dist/canvasEmptyState/index.es.js +134 -121
  16. package/dist/canvasEmptyState/index.umd.js +1 -1
  17. package/dist/canvasFullSize/index.cjs.js +9 -9
  18. package/dist/canvasFullSize/index.es.js +165 -152
  19. package/dist/canvasFullSize/index.umd.js +9 -9
  20. package/dist/canvasGridMode/index.cjs.js +5 -5
  21. package/dist/canvasGridMode/index.es.js +245 -232
  22. package/dist/canvasGridMode/index.umd.js +4 -4
  23. package/dist/canvasScreenshot/index.cjs.js +1 -1
  24. package/dist/canvasScreenshot/index.es.js +155 -142
  25. package/dist/canvasScreenshot/index.umd.js +1 -1
  26. package/dist/dataSourceEjs/index.cjs.js +9 -9
  27. package/dist/dataSourceEjs/index.es.js +257 -244
  28. package/dist/dataSourceEjs/index.umd.js +9 -9
  29. package/dist/dataSourceHandlebars/index.cjs.js +8 -8
  30. package/dist/dataSourceHandlebars/index.es.js +216 -203
  31. package/dist/dataSourceHandlebars/index.umd.js +7 -7
  32. package/dist/dialogComponent/index.cjs.js +14 -14
  33. package/dist/dialogComponent/index.es.js +141 -128
  34. package/dist/dialogComponent/index.umd.js +14 -14
  35. package/dist/flexComponent/index.cjs.js +13 -13
  36. package/dist/flexComponent/index.es.js +484 -471
  37. package/dist/flexComponent/index.umd.js +13 -13
  38. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  39. package/dist/fsLightboxComponent/index.es.js +173 -160
  40. package/dist/fsLightboxComponent/index.umd.js +3 -3
  41. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  42. package/dist/googleFontsAssetProvider/index.es.js +160 -147
  43. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  44. package/dist/iconifyComponent/index.cjs.js +2 -2
  45. package/dist/iconifyComponent/index.es.js +196 -183
  46. package/dist/iconifyComponent/index.umd.js +2 -2
  47. package/dist/index.cjs.js +25 -25
  48. package/dist/index.es.js +121 -108
  49. package/dist/index.umd.js +18 -18
  50. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  51. package/dist/layoutSidebarButtons/index.es.js +157 -144
  52. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  53. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  54. package/dist/lightGalleryComponent/index.es.js +245 -232
  55. package/dist/lightGalleryComponent/index.umd.js +1 -1
  56. package/dist/linkImageComponent/index.cjs.js +2 -2
  57. package/dist/linkImageComponent/index.es.js +106 -93
  58. package/dist/linkImageComponent/index.umd.js +2 -2
  59. package/dist/listPagesComponent/index.cjs.js +5 -5
  60. package/dist/listPagesComponent/index.es.js +157 -144
  61. package/dist/listPagesComponent/index.umd.js +5 -5
  62. package/dist/presetPrintable/index.cjs.js +3 -3
  63. package/dist/presetPrintable/index.es.js +181 -168
  64. package/dist/presetPrintable/index.umd.js +3 -3
  65. package/dist/prosemirror/index.cjs.js +7 -7
  66. package/dist/prosemirror/index.es.js +385 -372
  67. package/dist/prosemirror/index.umd.js +8 -8
  68. package/dist/rendererReact/index.cjs.js +1 -1
  69. package/dist/rendererReact/index.es.js +200 -187
  70. package/dist/rendererReact/index.js +1 -1
  71. package/dist/rendererReact/index.umd.js +1 -1
  72. package/dist/rteTinyMce/index.cjs.js +2 -2
  73. package/dist/rteTinyMce/index.es.js +118 -105
  74. package/dist/rteTinyMce/index.umd.js +2 -2
  75. package/dist/shapeDividerComponent/index.cjs.js +4 -4
  76. package/dist/shapeDividerComponent/index.es.js +129 -116
  77. package/dist/shapeDividerComponent/index.umd.js +4 -4
  78. package/dist/swiperComponent/index.cjs.js +9 -9
  79. package/dist/swiperComponent/index.es.js +203 -190
  80. package/dist/swiperComponent/index.umd.js +7 -7
  81. package/dist/tableComponent/index.cjs.js +1 -1
  82. package/dist/tableComponent/index.es.js +257 -244
  83. package/dist/tableComponent/index.umd.js +1 -1
  84. package/dist/types.d.ts +1 -1
  85. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  86. package/dist/youtubeAssetProvider/index.es.js +121 -108
  87. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  88. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";const O="app.grapesjs.com",S="app-stage.grapesjs.com",L="app2.grapesjs.com",P="app-stage2.grapesjs.com",M=[O,L,S,P,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],B="license:check:start",D="license:check:end",G=()=>typeof window<"u",V=({isDev:t,isStage:e,isPlatform:o})=>`${t?"":`https://${e?S:O}`}/${o?"platform-api":"api"}`,U=()=>{const t=G()&&window.location.hostname;return!!t&&(M.includes(t)||M.some(e=>t.endsWith(e)))};async function j({path:t,baseApiUrl:e,method:o="GET",headers:c={},params:s,body:l}){const p=`${e||V({isDev:!1,isStage:!1})}${t}`,a={method:o,headers:{"Content-Type":"application/json",...c}};l&&(a.body=JSON.stringify(l));const r=s?new URLSearchParams(s).toString():"",m=r?`?${r}`:"",n=await fetch(`${p}${m}`,a);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var f=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(f||{});const k={[f.free]:0,[f.startup]:10,[f.business]:20,[f.enterprise]:30};function K(t){const e=t;return e.init=o=>c=>t(c,o),e}const W=t=>K(t);async function F({editor:t,plan:e,pluginName:o,licenseKey:c,onLicenseCheckResponse:s,cleanup:l}){let d="",p=!1;const a=U(),r=n=>{console.warn("Cleanup plugin:",o,"Reason:",n),l()},m=(n={})=>{var E;const{error:y,sdkLicense:T}=n,w=(E=n.plan)==null?void 0:E.category;if(!(T||n.license)||y)r(y||"Invalid license");else if(w){const _=k[e],z=k[w];_>z&&r({pluginRequiredPlan:e,licensePlan:w})}};t.on(B,n=>{d=n==null?void 0:n.baseApiUrl,p=!0}),t.on(D,n=>{s==null||s(n),m(n)}),setTimeout(async()=>{if(!p){if(a)return;if(c){const n=await Y({licenseKey:c,pluginName:o,baseApiUrl:d});s==null||s(n),n&&m(n)}else r("The `licenseKey` option not provided")}},2e3)}async function Y(t){const{licenseKey:e,pluginName:o,baseApiUrl:c}=t;try{return(await j({baseApiUrl:c,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:o}})).result||{}}catch(s){return console.error("Error during SDK license check:",s),!1}}const A=t=>e=>{var o;return((o=e.getAttribute)==null?void 0:o.call(e,b))===t},H=(...t)=>e=>t.some(o=>e.is(o)),Z=(...t)=>(e,o)=>t.some(c=>o.is(c)),$="gjs-plg-",b="data-type-role",i="accordion",q=`${i}-group`,u=`${i}-header`,g=`${i}-content`,h=`${i}-marker`,x=`${$}${u}`,C=`${$}${h}`,J=`${$}${g}`,I=`${C}-open`,v={accordion:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M5.616 20q-.691 0-1.153-.462T4 18.384V5.616q0-.691.463-1.153T5.616 4h12.769q.69 0 1.153.463T20 5.616v12.769q0 .69-.462 1.153T18.384 20zm0-1h12.769q.23 0 .423-.192t.192-.424V8.154H5v10.23q0 .232.192.424t.423.192"/></svg>',accordionGroup:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M8.116 16h10.769q.23 0 .423-.192t.192-.423V6h-12v9.385q0 .23.192.423t.423.192m0 1q-.69 0-1.153-.462T6.5 15.385V4.615q0-.69.463-1.153T8.116 3h10.769q.69 0 1.153.462t.462 1.153v10.77q0 .69-.462 1.152T18.884 17zm-3 3q-.69 0-1.153-.462T3.5 18.385V6.615h1v11.77q0 .23.192.423t.423.192h11.77v1zM7.5 4v12z"/></svg>',accordionHeader:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M5.616 20q-.691 0-1.153-.462T4 18.384V5.616q0-.691.463-1.153T5.616 4h12.769q.69 0 1.153.463T20 5.616v12.769q0 .69-.462 1.153T18.384 20zm0-1h12.769q.23 0 .423-.192t.192-.424V5.616q0-.231-.192-.424T18.384 5H5.616q-.231 0-.424.192T5 5.616v12.769q0 .23.192.423t.423.192M5 5v14zm2.616 4.192h6q.413 0 .706-.293q.294-.293.294-.707t-.294-.706q-.293-.294-.706-.294h-6q-.414 0-.707.294t-.293.706t.293.707t.707.293"/></svg>',accordionContent:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M4.616 19q-.691 0-1.153-.462T3 17.384V6.616q0-.691.463-1.153T4.615 5h14.77q.69 0 1.152.463T21 6.616v10.769q0 .69-.463 1.153T19.385 19zm0-1h14.769q.23 0 .423-.192t.192-.424V6.616q0-.231-.192-.424T19.385 6H4.615q-.23 0-.423.192T4 6.616v10.769q0 .23.192.423t.423.192M4 18V6zm2.23-2.116h11.54q.213 0 .356-.143t.143-.357t-.143-.356t-.357-.144H6.231q-.214 0-.357.144q-.143.143-.143.357q0 .213.143.356t.357.144m0-3.385h11.538q.214 0 .357-.143t.143-.357t-.143-.357t-.357-.143H6.231q-.214 0-.357.143T5.731 12t.143.357t.357.143m0-3.384H14q.214 0 .357-.144q.143-.143.143-.356q0-.214-.143-.357T14 8.116H6.23q-.213 0-.356.143t-.143.357t.143.356t.357.144"/></svg>',accordionMarker:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="m12 15.596l3.173-3.192H8.827zM5.616 20q-.672 0-1.144-.472T4 18.385V5.615q0-.67.472-1.143Q4.944 4 5.616 4h12.769q.67 0 1.143.472q.472.472.472 1.144v12.769q0 .67-.472 1.143q-.472.472-1.143.472zM5 9v9.385q0 .23.192.423t.423.192h12.77q.23 0 .423-.192t.192-.423V9z"/></svg>',caret:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m7.4 8.6 4.6 4.6 4.6-4.6L18 10l-6 6-6-6 1.4-1.4Z"/></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>'},N=(t,e)=>{const{toolbarIconOpen:o=v.eye}=e,c=t.is(i)?t:t.closestType(i);if(!o||!c)return;const{toolbar:s}=t,l={id:"accordion-toggle-open",label:o,command:()=>c.toggleOpen()};!s.find(p=>p.id===l.id)&&(s==null||s.unshift(l))},Q=(t,e)=>{const{Components:o,Blocks:c}=t,{block:s={}}=e,l="Accordion",d=`${$}${i}`,p=function(a={}){const r=this,m=()=>{const{clsMarkerOpen:n}=a,y=r.querySelector('[data-type-role="accordion-marker"]');!y||!n||(r.open?y.classList.add(n):y.classList.remove(n))};r.addEventListener("toggle",()=>{m(),r.dispatchEvent(new CustomEvent("details-toggle",{bubbles:!0}))}),m()};return o.addType(i,{block:s&&{label:l,media:v.accordion,category:"Extra",select:!0,...s},isComponent:A(i),extendFn:["initToolbar"],model:{defaults:{tagName:"details",name:l,classes:d,emptyState:!0,clsMarkerOpen:I,attributes:{[b]:i},droppable:H(u,g),components:[{type:u},{type:g}],"script-props":["clsMarkerOpen"],script:p,traits:[{type:"checkbox",name:"open",label:"Open"}],styles:`
1
+ "use strict";const L="app.grapesjs.com",O="app-stage.grapesjs.com",z="app2.grapesjs.com",N="app-stage2.grapesjs.com",$=[L,z,O,N,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],U="license:check:end",_=()=>typeof window<"u",V=({isDev:e,isStage:t,isPlatform:o})=>`${e?"":`https://${t?O:L}`}/${o?"platform-api":"api"}`,j=()=>{const e=_()&&window.location.hostname;return!!e&&($.includes(e)||$.some(t=>e.endsWith(t)))};async function F({path:e,baseApiUrl:t,method:o="GET",headers:r={},params:s,body:p}){const a=`${t||V({isDev:!1,isStage:!1})}${e}`,c={method:o,headers:{"Content-Type":"application/json",...r}};p&&(c.body=JSON.stringify(p));const i=s?new URLSearchParams(s).toString():"",g=i?`?${i}`:"",n=await fetch(`${a}${g}`,c);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var h=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(h||{}),w=(e=>(e.toastAdd="studio:toastAdd",e.toastRemove="studio:toastRemove",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.dialogExportCode="studio:dialogExportCode",e.dialogImportCode="studio:dialogImportCode",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.clearPage="studio:clearPage",e.projectFiles="studio:projectFiles",e.validateCode="studio:validateCode",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.layoutComponentAdd="studio:layoutComponentAdd",e.layoutComponentGet="studio:layoutComponentGet",e.layoutComponentRemove="studio:layoutComponentRemove",e.layoutComponentRender="studio:layoutComponentRender",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.settings="studio:settings",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",e.dataSourceSetImporter="studio:dataSourceSetImporter",e.dataSourceSetExporter="studio:dataSourceSetExporter",e.setDragAbsolute="studio:setDragAbsolute",e))(w||{});const E={[h.free]:0,[h.startup]:10,[h.business]:20,[h.enterprise]:30};function K(e){const t=e;return t.init=o=>r=>e(r,o),t}const W=e=>K(e);async function Y({editor:e,plan:t,pluginName:o,licenseKey:r,onLicenseCheckResponse:s,cleanup:p}){let d="",a;const c=n=>{console.warn("Cleanup plugin:",o,"Reason:",n),p()},i=(n={})=>{var k;const{error:b,sdkLicense:A}=n,m=(k=n.plan)==null?void 0:k.category;if(!(A||n.license)||b)c(b||"Invalid license");else if(m){const I=E[t],H=E[m];I>H&&c({pluginRequiredPlan:t,licensePlan:m})}};e.Commands.has(w.settings)&&(a=e.runCommand(w.settings),d=(a==null?void 0:a.baseUrl)||"");const g=n=>{s==null||s(n),n&&i(n)};if(!a){e.onReady(async()=>{if(!j())if(r){const n=await J({licenseKey:r,pluginName:o,baseApiUrl:d});g(n)}else c("The `licenseKey` option not provided")});return}if(a.licensePlan||a.licenseError){const n=Z(a);g(n);return}e.on(U,n=>g(n))}const Z=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function J(e){const{licenseKey:t,pluginName:o,baseApiUrl:r}=e;try{return(await F({baseApiUrl:r,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:o}})).result||{}}catch(s){return console.error("Error during SDK license check:",s),!1}}const P=e=>t=>{var o;return((o=t.getAttribute)==null?void 0:o.call(t,T))===e},R=(...e)=>t=>e.some(o=>t.is(o)),Q=(...e)=>(t,o)=>e.some(r=>o.is(r)),x="gjs-plg-",T="data-type-role",l="accordion",q=`${l}-group`,u=`${l}-header`,y=`${l}-content`,v=`${l}-marker`,G=`${x}${u}`,M=`${x}${v}`,X=`${x}${y}`,B=`${M}-open`,f={accordion:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M5.616 20q-.691 0-1.153-.462T4 18.384V5.616q0-.691.463-1.153T5.616 4h12.769q.69 0 1.153.463T20 5.616v12.769q0 .69-.462 1.153T18.384 20zm0-1h12.769q.23 0 .423-.192t.192-.424V8.154H5v10.23q0 .232.192.424t.423.192"/></svg>',accordionGroup:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M8.116 16h10.769q.23 0 .423-.192t.192-.423V6h-12v9.385q0 .23.192.423t.423.192m0 1q-.69 0-1.153-.462T6.5 15.385V4.615q0-.69.463-1.153T8.116 3h10.769q.69 0 1.153.462t.462 1.153v10.77q0 .69-.462 1.152T18.884 17zm-3 3q-.69 0-1.153-.462T3.5 18.385V6.615h1v11.77q0 .23.192.423t.423.192h11.77v1zM7.5 4v12z"/></svg>',accordionHeader:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M5.616 20q-.691 0-1.153-.462T4 18.384V5.616q0-.691.463-1.153T5.616 4h12.769q.69 0 1.153.463T20 5.616v12.769q0 .69-.462 1.153T18.384 20zm0-1h12.769q.23 0 .423-.192t.192-.424V5.616q0-.231-.192-.424T18.384 5H5.616q-.231 0-.424.192T5 5.616v12.769q0 .23.192.423t.423.192M5 5v14zm2.616 4.192h6q.413 0 .706-.293q.294-.293.294-.707t-.294-.706q-.293-.294-.706-.294h-6q-.414 0-.707.294t-.293.706t.293.707t.707.293"/></svg>',accordionContent:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M4.616 19q-.691 0-1.153-.462T3 17.384V6.616q0-.691.463-1.153T4.615 5h14.77q.69 0 1.152.463T21 6.616v10.769q0 .69-.463 1.153T19.385 19zm0-1h14.769q.23 0 .423-.192t.192-.424V6.616q0-.231-.192-.424T19.385 6H4.615q-.23 0-.423.192T4 6.616v10.769q0 .23.192.423t.423.192M4 18V6zm2.23-2.116h11.54q.213 0 .356-.143t.143-.357t-.143-.356t-.357-.144H6.231q-.214 0-.357.144q-.143.143-.143.357q0 .213.143.356t.357.144m0-3.385h11.538q.214 0 .357-.143t.143-.357t-.143-.357t-.357-.143H6.231q-.214 0-.357.143T5.731 12t.143.357t.357.143m0-3.384H14q.214 0 .357-.144q.143-.143.143-.356q0-.214-.143-.357T14 8.116H6.23q-.213 0-.356.143t-.143.357t.143.356t.357.144"/></svg>',accordionMarker:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="m12 15.596l3.173-3.192H8.827zM5.616 20q-.672 0-1.144-.472T4 18.385V5.615q0-.67.472-1.143Q4.944 4 5.616 4h12.769q.67 0 1.143.472q.472.472.472 1.144v12.769q0 .67-.472 1.143q-.472.472-1.143.472zM5 9v9.385q0 .23.192.423t.423.192h12.77q.23 0 .423-.192t.192-.423V9z"/></svg>',caret:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m7.4 8.6 4.6 4.6 4.6-4.6L18 10l-6 6-6-6 1.4-1.4Z"/></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>'},D=(e,t)=>{const{toolbarIconOpen:o=f.eye}=t,r=e.is(l)?e:e.closestType(l);if(!o||!r)return;const{toolbar:s}=e,p={id:"accordion-toggle-open",label:o,command:()=>r.toggleOpen()};!s.find(a=>a.id===p.id)&&(s==null||s.unshift(p))},C=(e,t)=>{const{Components:o,Blocks:r}=e,{block:s={}}=t,p="Accordion",d=`${x}${l}`,a=function(c={}){const i=this,g=()=>{const{clsMarkerOpen:n}=c,b=i.querySelector('[data-type-role="accordion-marker"]');!b||!n||(i.open?b.classList.add(n):b.classList.remove(n))};i.addEventListener("toggle",()=>{g(),i.dispatchEvent(new CustomEvent("details-toggle",{bubbles:!0}))}),g()};return o.addType(l,{block:s&&{label:p,media:f.accordion,category:"Extra",select:!0,...s},isComponent:P(l),extendFn:["initToolbar"],model:{defaults:{tagName:"details",name:p,classes:d,emptyState:!0,clsMarkerOpen:B,attributes:{[T]:l},droppable:R(u,y),components:[{type:u},{type:y}],"script-props":["clsMarkerOpen"],script:a,traits:[{type:"checkbox",name:"open",label:"Open"}],styles:`
2
2
  .${d}::details-content {
3
3
  opacity: 0;
4
4
  block-size: 0;
@@ -15,25 +15,25 @@
15
15
  transform: translateY(0);
16
16
  block-size: auto;
17
17
  }
18
- `},toggleOpen(){this.addAttributes({open:!this.getAttributes().open})},initToolbar(){N(this,e)}}}),()=>{c.remove(i),o.removeType(i)}},X=t=>{const{Components:e}=t;return e.addType(g,{isComponent:A(g),model:{defaults:{name:"Accordion Content",removable:!1,copyable:!1,draggable:!1,emptyState:!0,classes:J,icon:v.accordionContent,attributes:{[b]:g},components:"<div>Accordion content</div>"}}}),()=>{e.removeType(g)}},R=(t,e)=>{const{Components:o,Blocks:c}=t,{blockGroup:s={}}=e,l="Accordion Group",d=function(a={}){if(!a.single)return;const r=this;r.addEventListener("details-toggle",m=>{const n=m.target;if(!a.single||!n||!n.open)return;r.querySelectorAll('[data-type-role="accordion"]').forEach(T=>{n!==T&&T.open&&(T.open=!1)})})},p=(a={})=>({type:i,attributes:{open:a.open},components:[{type:u,components:[`<div>${a.header}</div>`,{type:h}]},{type:g,components:`<div>${a.content}</div>`}]});return o.addType(q,{block:s&&{label:l,media:v.accordionGroup,category:"Extra",select:!0,...s},isComponent:A(q),model:{defaults:{name:l,attributes:{[b]:q},droppable:H(i),single:!0,emptyState:!0,components:Array(3).fill(0).map((a,r)=>p({open:r===0,header:`Accordion header ${r+1}`,content:`Accordion content ${r+1}`})),traits:[{type:"checkbox",name:"single",changeProp:!0,tip:"Only one accordion can be open at a time",label:"Single open"}],"script-props":["single"],script:d}}}),()=>{c.remove(q),o.removeType(q)}},tt=(t,e)=>{const{Components:o}=t;return o.addType(u,{isComponent:A(u),extendFn:["initToolbar"],model:{defaults:{tagName:"summary",name:"Accordion Header",removable:!1,copyable:!1,draggable:!1,emptyState:!0,icon:v.accordionHeader,classes:x,attributes:{[b]:u},components:["<div>Accordion header</div>",{type:h}],styles:`
18
+ `},toggleOpen(){this.addAttributes({open:!this.getAttributes().open})},initToolbar(){D(this,t)}}}),()=>{r.remove(l),o.removeType(l)}},S=e=>{const{Components:t}=e;return t.addType(y,{isComponent:P(y),model:{defaults:{name:"Accordion Content",removable:!1,copyable:!1,draggable:!1,emptyState:!0,classes:X,icon:f.accordionContent,attributes:{[T]:y},components:"<div>Accordion content</div>"}}}),()=>{t.removeType(y)}},ee=(e,t)=>{const{Components:o,Blocks:r}=e,{blockGroup:s={}}=t,p="Accordion Group",d=function(c={}){if(!c.single)return;const i=this;i.addEventListener("details-toggle",g=>{const n=g.target;if(!c.single||!n||!n.open)return;i.querySelectorAll('[data-type-role="accordion"]').forEach(A=>{n!==A&&A.open&&(A.open=!1)})})},a=(c={})=>({type:l,attributes:{open:c.open},components:[{type:u,components:[`<div>${c.header}</div>`,{type:v}]},{type:y,components:`<div>${c.content}</div>`}]});return o.addType(q,{block:s&&{label:p,media:f.accordionGroup,category:"Extra",select:!0,...s},isComponent:P(q),model:{defaults:{name:p,attributes:{[T]:q},droppable:R(l),single:!0,emptyState:!0,components:Array(3).fill(0).map((c,i)=>a({open:i===0,header:`Accordion header ${i+1}`,content:`Accordion content ${i+1}`})),traits:[{type:"checkbox",name:"single",changeProp:!0,tip:"Only one accordion can be open at a time",label:"Single open"}],"script-props":["single"],script:d}}}),()=>{r.remove(q),o.removeType(q)}},te=(e,t)=>{const{Components:o}=e;return o.addType(u,{isComponent:P(u),extendFn:["initToolbar"],model:{defaults:{tagName:"summary",name:"Accordion Header",removable:!1,copyable:!1,draggable:!1,emptyState:!0,icon:f.accordionHeader,classes:G,attributes:{[T]:u},components:["<div>Accordion header</div>",{type:v}],styles:`
19
19
  summary {
20
20
  list-style: none;
21
21
  }
22
- .${x} {
22
+ .${G} {
23
23
  cursor: pointer;
24
24
  display: flex;
25
25
  align-items: center;
26
26
  justify-content: space-between;
27
27
  gap: 1rem;
28
28
  }
29
- `},initToolbar(){N(this,e)}}}),()=>{o.removeType(u)}},et=t=>{const{Components:e}=t;return e.addType(h,{extend:"icon",isComponent:A(h),model:{defaults:{name:"Accordion Marker",icon:v.accordionMarker,classes:C,attributes:{[b]:h},components:v.caret,droppable:!1,draggable:Z(u),styles:`
30
- .${C} {
29
+ `},initToolbar(){D(this,t)}}}),()=>{o.removeType(u)}},oe=e=>{const{Components:t}=e;return t.addType(v,{extend:"icon",isComponent:P(v),model:{defaults:{name:"Accordion Marker",icon:f.accordionMarker,classes:M,attributes:{[T]:v},components:f.caret,droppable:!1,draggable:Q(u),styles:`
30
+ .${M} {
31
31
  min-width: 24px;
32
32
  width: 24px;
33
33
  height: 24px;
34
34
  transition: transform 0.2s ease-in-out;
35
35
  }
36
- .${I} {
36
+ .${B} {
37
37
  transform: rotateZ(180deg);
38
38
  }
39
- `}}}),()=>{e.removeType(h)}},ot="accordionComponent",nt=f.startup,st=function(t,e={}){const o=[Q(t,e),R(t,e),tt(t,e),et(t),X(t)];F({editor:t,licenseKey:e.licenseKey,plan:nt,pluginName:ot,cleanup:()=>{o.forEach(c=>c())}})},ct=W(st);module.exports=ct;
39
+ `}}}),()=>{t.removeType(v)}},ne="accordionComponent",se=h.startup,re=function(e,t={}){const o=[C(e,t),ee(e,t),te(e,t),oe(e),S(e)];Y({editor:e,licenseKey:t.licenseKey,plan:se,pluginName:ne,cleanup:()=>{o.forEach(r=>r())}})},ae=W(re);module.exports=ae;
@@ -1,8 +1,8 @@
1
- const O = "app.grapesjs.com", S = "app-stage.grapesjs.com", L = "app2.grapesjs.com", P = "app-stage2.grapesjs.com", M = [
2
- O,
1
+ const L = "app.grapesjs.com", O = "app-stage.grapesjs.com", z = "app2.grapesjs.com", N = "app-stage2.grapesjs.com", $ = [
3
2
  L,
4
- S,
5
- P,
3
+ z,
4
+ O,
5
+ N,
6
6
  "localhost",
7
7
  "127.0.0.1",
8
8
  ".local-credentialless.webcontainer.io",
@@ -11,89 +11,102 @@ const O = "app.grapesjs.com", S = "app-stage.grapesjs.com", L = "app2.grapesjs.c
11
11
  // For stackblitz.com demos
12
12
  "-sandpack.codesandbox.io"
13
13
  // For Sandpack demos
14
- ], B = "license:check:start", D = "license:check:end", G = () => typeof window < "u", V = ({
15
- isDev: t,
16
- isStage: e,
14
+ ], U = "license:check:end", _ = () => typeof window < "u", V = ({
15
+ isDev: e,
16
+ isStage: t,
17
17
  isPlatform: o
18
- }) => `${t ? "" : `https://${e ? S : O}`}/${o ? "platform-api" : "api"}`, U = () => {
19
- const t = G() && window.location.hostname;
20
- return !!t && (M.includes(t) || M.some((e) => t.endsWith(e)));
18
+ }) => `${e ? "" : `https://${t ? O : L}`}/${o ? "platform-api" : "api"}`, j = () => {
19
+ const e = _() && window.location.hostname;
20
+ return !!e && ($.includes(e) || $.some((t) => e.endsWith(t)));
21
21
  };
22
- async function j({
23
- path: t,
24
- baseApiUrl: e,
22
+ async function F({
23
+ path: e,
24
+ baseApiUrl: t,
25
25
  method: o = "GET",
26
- headers: c = {},
26
+ headers: r = {},
27
27
  params: s,
28
- body: l
28
+ body: p
29
29
  }) {
30
- const p = `${e || V({ isDev: !1, isStage: !1 })}${t}`, a = {
30
+ const a = `${t || V({ isDev: !1, isStage: !1 })}${e}`, c = {
31
31
  method: o,
32
32
  headers: {
33
33
  "Content-Type": "application/json",
34
- ...c
34
+ ...r
35
35
  }
36
36
  };
37
- l && (a.body = JSON.stringify(l));
38
- const r = s ? new URLSearchParams(s).toString() : "", m = r ? `?${r}` : "", n = await fetch(`${p}${m}`, a);
37
+ p && (c.body = JSON.stringify(p));
38
+ const i = s ? new URLSearchParams(s).toString() : "", g = i ? `?${i}` : "", n = await fetch(`${a}${g}`, c);
39
39
  if (!n.ok)
40
40
  throw new Error(`HTTP error! status: ${n.status}`);
41
41
  return n.json();
42
42
  }
43
- var f = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(f || {});
44
- const k = {
45
- [f.free]: 0,
46
- [f.startup]: 10,
47
- [f.business]: 20,
48
- [f.enterprise]: 30
43
+ var h = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(h || {}), w = /* @__PURE__ */ ((e) => (e.toastAdd = "studio:toastAdd", e.toastRemove = "studio:toastRemove", e.dialogOpen = "studio:dialogOpen", e.dialogClose = "studio:dialogClose", e.dialogExportCode = "studio:dialogExportCode", e.dialogImportCode = "studio:dialogImportCode", e.sidebarLeftSet = "studio:sidebarLeft:set", e.sidebarLeftGet = "studio:sidebarLeft:get", e.sidebarLeftToggle = "studio:sidebarLeft:toggle", e.sidebarRightSet = "studio:sidebarRight:set", e.sidebarRightGet = "studio:sidebarRight:get", e.sidebarRightToggle = "studio:sidebarRight:toggle", e.sidebarTopSet = "studio:sidebarTop:set", e.sidebarTopGet = "studio:sidebarTop:get", e.sidebarTopToggle = "studio:sidebarTop:toggle", e.sidebarBottomSet = "studio:sidebarBottom:set", e.sidebarBottomGet = "studio:sidebarBottom:get", e.sidebarBottomToggle = "studio:sidebarBottom:toggle", e.symbolAdd = "studio:symbolAdd", e.symbolDetach = "studio:symbolDetach", e.symbolOverride = "studio:symbolOverride", e.symbolPropagateStyles = "studio:propagateStyles", e.getPagesConfig = "studio:getPagesConfig", e.setPagesConfig = "studio:setPagesConfig", e.getPageSettings = "studio:getPageSettings", e.setPageSettings = "studio:setPageSettings", e.clearPage = "studio:clearPage", e.projectFiles = "studio:projectFiles", e.validateCode = "studio:validateCode", e.canvasReload = "studio:canvasReload", e.getBlocksPanel = "studio:getBlocksPanel", e.setBlocksPanel = "studio:setBlocksPanel", e.getStateContextMenu = "studio:getStateContextMenu", e.setStateContextMenu = "studio:setStateContextMenu", e.contextMenuComponent = "studio:contextMenuComponent", e.layoutAdd = "studio:layoutAdd", e.layoutRemove = "studio:layoutRemove", e.layoutToggle = "studio:layoutToggle", e.layoutUpdate = "studio:layoutUpdate", e.layoutGet = "studio:layoutGet", e.layoutConfigGet = "studio:layoutConfigGet", e.layoutConfigSet = "studio:layoutConfigSet", e.layoutComponentAdd = "studio:layoutComponentAdd", e.layoutComponentGet = "studio:layoutComponentGet", e.layoutComponentRemove = "studio:layoutComponentRemove", e.layoutComponentRender = "studio:layoutComponentRender", e.getStateTheme = "studio:getStateTheme", e.setStateTheme = "studio:setStateTheme", e.settings = "studio:settings", e.assetProviderGet = "studio:assetProviderGet", e.assetProviderAdd = "studio:assetProviderAdd", e.assetProviderRemove = "studio:assetProviderRemove", e.fontGet = "studio:fontGet", e.fontAdd = "studio:fontAdd", e.fontRemove = "studio:fontRemove", e.fontManagerOpen = "studio:fontManagerOpen", e.menuFontLoad = "studio:menuFontLoad", e.toggleStateDataSource = "studio:toggleStateDataSource", e.getStateDataSource = "studio:getStateDataSource", e.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", e.dataSourceSetImporter = "studio:dataSourceSetImporter", e.dataSourceSetExporter = "studio:dataSourceSetExporter", e.setDragAbsolute = "studio:setDragAbsolute", e))(w || {});
44
+ const E = {
45
+ [h.free]: 0,
46
+ [h.startup]: 10,
47
+ [h.business]: 20,
48
+ [h.enterprise]: 30
49
49
  };
50
- function K(t) {
51
- const e = t;
52
- return e.init = (o) => (c) => t(c, o), e;
50
+ function K(e) {
51
+ const t = e;
52
+ return t.init = (o) => (r) => e(r, o), t;
53
53
  }
54
- const W = (t) => /* @__PURE__ */ K(t);
55
- async function F({
56
- editor: t,
57
- plan: e,
54
+ const W = (e) => /* @__PURE__ */ K(e);
55
+ async function Y({
56
+ editor: e,
57
+ plan: t,
58
58
  pluginName: o,
59
- licenseKey: c,
59
+ licenseKey: r,
60
60
  onLicenseCheckResponse: s,
61
- cleanup: l
61
+ cleanup: p
62
62
  }) {
63
- let d = "", p = !1;
64
- const a = U(), r = (n) => {
65
- console.warn("Cleanup plugin:", o, "Reason:", n), l();
66
- }, m = (n = {}) => {
67
- var E;
68
- const { error: y, sdkLicense: T } = n, w = (E = n.plan) == null ? void 0 : E.category;
69
- if (!(T || n.license) || y)
70
- r(y || "Invalid license");
71
- else if (w) {
72
- const _ = k[e], z = k[w];
73
- _ > z && r({ pluginRequiredPlan: e, licensePlan: w });
63
+ let d = "", a;
64
+ const c = (n) => {
65
+ console.warn("Cleanup plugin:", o, "Reason:", n), p();
66
+ }, i = (n = {}) => {
67
+ var k;
68
+ const { error: b, sdkLicense: A } = n, m = (k = n.plan) == null ? void 0 : k.category;
69
+ if (!(A || n.license) || b)
70
+ c(b || "Invalid license");
71
+ else if (m) {
72
+ const I = E[t], H = E[m];
73
+ I > H && c({ pluginRequiredPlan: t, licensePlan: m });
74
74
  }
75
75
  };
76
- t.on(B, (n) => {
77
- d = n == null ? void 0 : n.baseApiUrl, p = !0;
78
- }), t.on(D, (n) => {
79
- s == null || s(n), m(n);
80
- }), setTimeout(async () => {
81
- if (!p) {
82
- if (a) return;
83
- if (c) {
84
- const n = await Y({ licenseKey: c, pluginName: o, baseApiUrl: d });
85
- s == null || s(n), n && m(n);
86
- } else
87
- r("The `licenseKey` option not provided");
88
- }
89
- }, 2e3);
76
+ e.Commands.has(w.settings) && (a = e.runCommand(w.settings), d = (a == null ? void 0 : a.baseUrl) || "");
77
+ const g = (n) => {
78
+ s == null || s(n), n && i(n);
79
+ };
80
+ if (!a) {
81
+ e.onReady(async () => {
82
+ if (!j())
83
+ if (r) {
84
+ const n = await J({ licenseKey: r, pluginName: o, baseApiUrl: d });
85
+ g(n);
86
+ } else
87
+ c("The `licenseKey` option not provided");
88
+ });
89
+ return;
90
+ }
91
+ if (a.licensePlan || a.licenseError) {
92
+ const n = Z(a);
93
+ g(n);
94
+ return;
95
+ }
96
+ e.on(U, (n) => g(n));
90
97
  }
91
- async function Y(t) {
92
- const { licenseKey: e, pluginName: o, baseApiUrl: c } = t;
98
+ const Z = (e) => ({
99
+ sdkLicense: e.license,
100
+ license: e.license,
101
+ error: e.licenseError,
102
+ plan: e.licensePlan
103
+ });
104
+ async function J(e) {
105
+ const { licenseKey: t, pluginName: o, baseApiUrl: r } = e;
93
106
  try {
94
- return (await j({
95
- baseApiUrl: c,
96
- path: `/sdk/${e || "na"}`,
107
+ return (await F({
108
+ baseApiUrl: r,
109
+ path: `/sdk/${t || "na"}`,
97
110
  method: "POST",
98
111
  params: {
99
112
  d: window.location.hostname,
@@ -104,10 +117,10 @@ async function Y(t) {
104
117
  return console.error("Error during SDK license check:", s), !1;
105
118
  }
106
119
  }
107
- const A = (t) => (e) => {
120
+ const P = (e) => (t) => {
108
121
  var o;
109
- return ((o = e.getAttribute) == null ? void 0 : o.call(e, b)) === t;
110
- }, H = (...t) => (e) => t.some((o) => e.is(o)), Z = (...t) => (e, o) => t.some((c) => o.is(c)), $ = "gjs-plg-", b = "data-type-role", i = "accordion", q = `${i}-group`, u = `${i}-header`, g = `${i}-content`, h = `${i}-marker`, x = `${$}${u}`, C = `${$}${h}`, J = `${$}${g}`, I = `${C}-open`, v = {
122
+ return ((o = t.getAttribute) == null ? void 0 : o.call(t, T)) === e;
123
+ }, R = (...e) => (t) => e.some((o) => t.is(o)), Q = (...e) => (t, o) => e.some((r) => o.is(r)), x = "gjs-plg-", T = "data-type-role", l = "accordion", q = `${l}-group`, u = `${l}-header`, y = `${l}-content`, v = `${l}-marker`, G = `${x}${u}`, M = `${x}${v}`, X = `${x}${y}`, B = `${M}-open`, f = {
111
124
  accordion: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M5.616 20q-.691 0-1.153-.462T4 18.384V5.616q0-.691.463-1.153T5.616 4h12.769q.69 0 1.153.463T20 5.616v12.769q0 .69-.462 1.153T18.384 20zm0-1h12.769q.23 0 .423-.192t.192-.424V8.154H5v10.23q0 .232.192.424t.423.192"/></svg>',
112
125
  accordionGroup: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M8.116 16h10.769q.23 0 .423-.192t.192-.423V6h-12v9.385q0 .23.192.423t.423.192m0 1q-.69 0-1.153-.462T6.5 15.385V4.615q0-.69.463-1.153T8.116 3h10.769q.69 0 1.153.462t.462 1.153v10.77q0 .69-.462 1.152T18.884 17zm-3 3q-.69 0-1.153-.462T3.5 18.385V6.615h1v11.77q0 .23.192.423t.423.192h11.77v1zM7.5 4v12z"/></svg>',
113
126
  accordionHeader: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M5.616 20q-.691 0-1.153-.462T4 18.384V5.616q0-.691.463-1.153T5.616 4h12.769q.69 0 1.153.463T20 5.616v12.769q0 .69-.462 1.153T18.384 20zm0-1h12.769q.23 0 .423-.192t.192-.424V5.616q0-.231-.192-.424T18.384 5H5.616q-.231 0-.424.192T5 5.616v12.769q0 .23.192.423t.423.192M5 5v14zm2.616 4.192h6q.413 0 .706-.293q.294-.293.294-.707t-.294-.706q-.293-.294-.706-.294h-6q-.414 0-.707.294t-.293.706t.293.707t.707.293"/></svg>',
@@ -115,47 +128,47 @@ const A = (t) => (e) => {
115
128
  accordionMarker: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="m12 15.596l3.173-3.192H8.827zM5.616 20q-.672 0-1.144-.472T4 18.385V5.615q0-.67.472-1.143Q4.944 4 5.616 4h12.769q.67 0 1.143.472q.472.472.472 1.144v12.769q0 .67-.472 1.143q-.472.472-1.143.472zM5 9v9.385q0 .23.192.423t.423.192h12.77q.23 0 .423-.192t.192-.423V9z"/></svg>',
116
129
  caret: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m7.4 8.6 4.6 4.6 4.6-4.6L18 10l-6 6-6-6 1.4-1.4Z"/></svg>',
117
130
  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>'
118
- }, N = (t, e) => {
119
- const { toolbarIconOpen: o = v.eye } = e, c = t.is(i) ? t : t.closestType(i);
120
- if (!o || !c) return;
121
- const { toolbar: s } = t, l = {
131
+ }, D = (e, t) => {
132
+ const { toolbarIconOpen: o = f.eye } = t, r = e.is(l) ? e : e.closestType(l);
133
+ if (!o || !r) return;
134
+ const { toolbar: s } = e, p = {
122
135
  id: "accordion-toggle-open",
123
136
  label: o,
124
- command: () => c.toggleOpen()
137
+ command: () => r.toggleOpen()
125
138
  };
126
- !s.find((p) => p.id === l.id) && (s == null || s.unshift(l));
127
- }, Q = (t, e) => {
128
- const { Components: o, Blocks: c } = t, { block: s = {} } = e, l = "Accordion", d = `${$}${i}`, p = function(a = {}) {
129
- const r = this, m = () => {
130
- const { clsMarkerOpen: n } = a, y = r.querySelector('[data-type-role="accordion-marker"]');
131
- !y || !n || (r.open ? y.classList.add(n) : y.classList.remove(n));
139
+ !s.find((a) => a.id === p.id) && (s == null || s.unshift(p));
140
+ }, C = (e, t) => {
141
+ const { Components: o, Blocks: r } = e, { block: s = {} } = t, p = "Accordion", d = `${x}${l}`, a = function(c = {}) {
142
+ const i = this, g = () => {
143
+ const { clsMarkerOpen: n } = c, b = i.querySelector('[data-type-role="accordion-marker"]');
144
+ !b || !n || (i.open ? b.classList.add(n) : b.classList.remove(n));
132
145
  };
133
- r.addEventListener("toggle", () => {
134
- m(), r.dispatchEvent(new CustomEvent("details-toggle", { bubbles: !0 }));
135
- }), m();
146
+ i.addEventListener("toggle", () => {
147
+ g(), i.dispatchEvent(new CustomEvent("details-toggle", { bubbles: !0 }));
148
+ }), g();
136
149
  };
137
- return o.addType(i, {
150
+ return o.addType(l, {
138
151
  block: s && {
139
- label: l,
140
- media: v.accordion,
152
+ label: p,
153
+ media: f.accordion,
141
154
  category: "Extra",
142
155
  select: !0,
143
156
  ...s
144
157
  },
145
- isComponent: A(i),
158
+ isComponent: P(l),
146
159
  extendFn: ["initToolbar"],
147
160
  model: {
148
161
  defaults: {
149
162
  tagName: "details",
150
- name: l,
163
+ name: p,
151
164
  classes: d,
152
165
  emptyState: !0,
153
- clsMarkerOpen: I,
154
- attributes: { [b]: i },
155
- droppable: H(u, g),
156
- components: [{ type: u }, { type: g }],
166
+ clsMarkerOpen: B,
167
+ attributes: { [T]: l },
168
+ droppable: R(u, y),
169
+ components: [{ type: u }, { type: y }],
157
170
  "script-props": ["clsMarkerOpen"],
158
- script: p,
171
+ script: a,
159
172
  traits: [
160
173
  {
161
174
  type: "checkbox",
@@ -186,16 +199,16 @@ const A = (t) => (e) => {
186
199
  this.addAttributes({ open: !this.getAttributes().open });
187
200
  },
188
201
  initToolbar() {
189
- N(this, e);
202
+ D(this, t);
190
203
  }
191
204
  }
192
205
  }), () => {
193
- c.remove(i), o.removeType(i);
206
+ r.remove(l), o.removeType(l);
194
207
  };
195
- }, X = (t) => {
196
- const { Components: e } = t;
197
- return e.addType(g, {
198
- isComponent: A(g),
208
+ }, S = (e) => {
209
+ const { Components: t } = e;
210
+ return t.addType(y, {
211
+ isComponent: P(y),
199
212
  model: {
200
213
  defaults: {
201
214
  name: "Accordion Content",
@@ -203,61 +216,61 @@ const A = (t) => (e) => {
203
216
  copyable: !1,
204
217
  draggable: !1,
205
218
  emptyState: !0,
206
- classes: J,
207
- icon: v.accordionContent,
208
- attributes: { [b]: g },
219
+ classes: X,
220
+ icon: f.accordionContent,
221
+ attributes: { [T]: y },
209
222
  components: "<div>Accordion content</div>"
210
223
  }
211
224
  }
212
225
  }), () => {
213
- e.removeType(g);
226
+ t.removeType(y);
214
227
  };
215
- }, R = (t, e) => {
216
- const { Components: o, Blocks: c } = t, { blockGroup: s = {} } = e, l = "Accordion Group", d = function(a = {}) {
217
- if (!a.single) return;
218
- const r = this;
219
- r.addEventListener("details-toggle", (m) => {
220
- const n = m.target;
221
- if (!a.single || !n || !n.open) return;
222
- r.querySelectorAll('[data-type-role="accordion"]').forEach((T) => {
223
- n !== T && T.open && (T.open = !1);
228
+ }, ee = (e, t) => {
229
+ const { Components: o, Blocks: r } = e, { blockGroup: s = {} } = t, p = "Accordion Group", d = function(c = {}) {
230
+ if (!c.single) return;
231
+ const i = this;
232
+ i.addEventListener("details-toggle", (g) => {
233
+ const n = g.target;
234
+ if (!c.single || !n || !n.open) return;
235
+ i.querySelectorAll('[data-type-role="accordion"]').forEach((A) => {
236
+ n !== A && A.open && (A.open = !1);
224
237
  });
225
238
  });
226
- }, p = (a = {}) => ({
227
- type: i,
228
- attributes: { open: a.open },
239
+ }, a = (c = {}) => ({
240
+ type: l,
241
+ attributes: { open: c.open },
229
242
  components: [
230
243
  {
231
244
  type: u,
232
- components: [`<div>${a.header}</div>`, { type: h }]
245
+ components: [`<div>${c.header}</div>`, { type: v }]
233
246
  },
234
247
  {
235
- type: g,
236
- components: `<div>${a.content}</div>`
248
+ type: y,
249
+ components: `<div>${c.content}</div>`
237
250
  }
238
251
  ]
239
252
  });
240
253
  return o.addType(q, {
241
254
  block: s && {
242
- label: l,
243
- media: v.accordionGroup,
255
+ label: p,
256
+ media: f.accordionGroup,
244
257
  category: "Extra",
245
258
  select: !0,
246
259
  ...s
247
260
  },
248
- isComponent: A(q),
261
+ isComponent: P(q),
249
262
  model: {
250
263
  defaults: {
251
- name: l,
252
- attributes: { [b]: q },
253
- droppable: H(i),
264
+ name: p,
265
+ attributes: { [T]: q },
266
+ droppable: R(l),
254
267
  single: !0,
255
268
  emptyState: !0,
256
269
  components: Array(3).fill(0).map(
257
- (a, r) => p({
258
- open: r === 0,
259
- header: `Accordion header ${r + 1}`,
260
- content: `Accordion content ${r + 1}`
270
+ (c, i) => a({
271
+ open: i === 0,
272
+ header: `Accordion header ${i + 1}`,
273
+ content: `Accordion content ${i + 1}`
261
274
  })
262
275
  ),
263
276
  traits: [
@@ -274,12 +287,12 @@ const A = (t) => (e) => {
274
287
  }
275
288
  }
276
289
  }), () => {
277
- c.remove(q), o.removeType(q);
290
+ r.remove(q), o.removeType(q);
278
291
  };
279
- }, tt = (t, e) => {
280
- const { Components: o } = t;
292
+ }, te = (e, t) => {
293
+ const { Components: o } = e;
281
294
  return o.addType(u, {
282
- isComponent: A(u),
295
+ isComponent: P(u),
283
296
  extendFn: ["initToolbar"],
284
297
  model: {
285
298
  defaults: {
@@ -289,15 +302,15 @@ const A = (t) => (e) => {
289
302
  copyable: !1,
290
303
  draggable: !1,
291
304
  emptyState: !0,
292
- icon: v.accordionHeader,
293
- classes: x,
294
- attributes: { [b]: u },
295
- components: ["<div>Accordion header</div>", { type: h }],
305
+ icon: f.accordionHeader,
306
+ classes: G,
307
+ attributes: { [T]: u },
308
+ components: ["<div>Accordion header</div>", { type: v }],
296
309
  styles: `
297
310
  summary {
298
311
  list-style: none;
299
312
  }
300
- .${x} {
313
+ .${G} {
301
314
  cursor: pointer;
302
315
  display: flex;
303
316
  align-items: center;
@@ -307,60 +320,60 @@ const A = (t) => (e) => {
307
320
  `
308
321
  },
309
322
  initToolbar() {
310
- N(this, e);
323
+ D(this, t);
311
324
  }
312
325
  }
313
326
  }), () => {
314
327
  o.removeType(u);
315
328
  };
316
- }, et = (t) => {
317
- const { Components: e } = t;
318
- return e.addType(h, {
329
+ }, oe = (e) => {
330
+ const { Components: t } = e;
331
+ return t.addType(v, {
319
332
  extend: "icon",
320
- isComponent: A(h),
333
+ isComponent: P(v),
321
334
  model: {
322
335
  defaults: {
323
336
  name: "Accordion Marker",
324
- icon: v.accordionMarker,
325
- classes: C,
326
- attributes: { [b]: h },
327
- components: v.caret,
337
+ icon: f.accordionMarker,
338
+ classes: M,
339
+ attributes: { [T]: v },
340
+ components: f.caret,
328
341
  droppable: !1,
329
- draggable: Z(u),
342
+ draggable: Q(u),
330
343
  styles: `
331
- .${C} {
344
+ .${M} {
332
345
  min-width: 24px;
333
346
  width: 24px;
334
347
  height: 24px;
335
348
  transition: transform 0.2s ease-in-out;
336
349
  }
337
- .${I} {
350
+ .${B} {
338
351
  transform: rotateZ(180deg);
339
352
  }
340
353
  `
341
354
  }
342
355
  }
343
356
  }), () => {
344
- e.removeType(h);
357
+ t.removeType(v);
345
358
  };
346
- }, ot = "accordionComponent", nt = f.startup, st = function(t, e = {}) {
359
+ }, ne = "accordionComponent", se = h.startup, re = function(e, t = {}) {
347
360
  const o = [
348
- Q(t, e),
349
- R(t, e),
350
- tt(t, e),
351
- et(t),
352
- X(t)
361
+ C(e, t),
362
+ ee(e, t),
363
+ te(e, t),
364
+ oe(e),
365
+ S(e)
353
366
  ];
354
- F({
355
- editor: t,
356
- licenseKey: e.licenseKey,
357
- plan: nt,
358
- pluginName: ot,
367
+ Y({
368
+ editor: e,
369
+ licenseKey: t.licenseKey,
370
+ plan: se,
371
+ pluginName: ne,
359
372
  cleanup: () => {
360
- o.forEach((c) => c());
373
+ o.forEach((r) => r());
361
374
  }
362
375
  });
363
- }, rt = W(st);
376
+ }, ce = W(re);
364
377
  export {
365
- rt as default
378
+ ce as default
366
379
  };