@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.37

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 (92) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +185 -159
  3. package/dist/accordionComponent/index.umd.js +7 -7
  4. package/dist/aiChat/clientToolsProcessors.d.ts +1 -2
  5. package/dist/aiChat/components/utils.d.ts +1 -0
  6. package/dist/aiChat/components/utilsTw.d.ts +11 -0
  7. package/dist/aiChat/index.cjs.js +75 -75
  8. package/dist/aiChat/index.es.js +9122 -8628
  9. package/dist/aiChat/index.js +75 -75
  10. package/dist/aiChat/index.umd.js +75 -75
  11. package/dist/aiChat/projectGeneration.d.ts +17 -0
  12. package/dist/animationComponent/index.cjs.js +3 -3
  13. package/dist/animationComponent/index.es.js +221 -195
  14. package/dist/animationComponent/index.umd.js +3 -3
  15. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  16. package/dist/canvasAbsoluteMode/index.es.js +199 -173
  17. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  18. package/dist/canvasEmptyState/index.cjs.js +1 -1
  19. package/dist/canvasEmptyState/index.es.js +149 -123
  20. package/dist/canvasEmptyState/index.umd.js +1 -1
  21. package/dist/canvasFullSize/index.cjs.js +9 -9
  22. package/dist/canvasFullSize/index.es.js +186 -160
  23. package/dist/canvasFullSize/index.umd.js +9 -9
  24. package/dist/canvasGridMode/index.cjs.js +5 -5
  25. package/dist/canvasGridMode/index.es.js +263 -237
  26. package/dist/canvasGridMode/index.umd.js +2 -2
  27. package/dist/canvasScreenshot/index.cjs.js +1 -1
  28. package/dist/canvasScreenshot/index.es.js +168 -142
  29. package/dist/canvasScreenshot/index.umd.js +1 -1
  30. package/dist/dataSourceEjs/index.cjs.js +9 -9
  31. package/dist/dataSourceEjs/index.es.js +271 -245
  32. package/dist/dataSourceEjs/index.umd.js +9 -9
  33. package/dist/dataSourceHandlebars/index.cjs.js +8 -8
  34. package/dist/dataSourceHandlebars/index.es.js +232 -206
  35. package/dist/dataSourceHandlebars/index.umd.js +8 -8
  36. package/dist/dialogComponent/index.cjs.js +14 -14
  37. package/dist/dialogComponent/index.es.js +157 -131
  38. package/dist/dialogComponent/index.umd.js +14 -14
  39. package/dist/flexComponent/index.cjs.js +13 -13
  40. package/dist/flexComponent/index.es.js +497 -471
  41. package/dist/flexComponent/index.umd.js +13 -13
  42. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  43. package/dist/fsLightboxComponent/index.es.js +189 -163
  44. package/dist/fsLightboxComponent/index.umd.js +3 -3
  45. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  46. package/dist/googleFontsAssetProvider/index.es.js +175 -149
  47. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  48. package/dist/iconifyComponent/index.cjs.js +2 -2
  49. package/dist/iconifyComponent/index.es.js +207 -181
  50. package/dist/iconifyComponent/index.umd.js +2 -2
  51. package/dist/index.cjs.js +36 -36
  52. package/dist/index.es.js +917 -891
  53. package/dist/index.umd.js +36 -36
  54. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  55. package/dist/layoutSidebarButtons/index.es.js +192 -166
  56. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  57. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  58. package/dist/lightGalleryComponent/index.es.js +265 -239
  59. package/dist/lightGalleryComponent/index.umd.js +1 -1
  60. package/dist/linkImageComponent/index.cjs.js +2 -2
  61. package/dist/linkImageComponent/index.es.js +121 -95
  62. package/dist/linkImageComponent/index.umd.js +2 -2
  63. package/dist/listPagesComponent/index.cjs.js +5 -5
  64. package/dist/listPagesComponent/index.es.js +171 -145
  65. package/dist/listPagesComponent/index.umd.js +5 -5
  66. package/dist/presetPrintable/index.cjs.js +3 -3
  67. package/dist/presetPrintable/index.es.js +227 -201
  68. package/dist/presetPrintable/index.umd.js +3 -3
  69. package/dist/prosemirror/index.cjs.js +7 -7
  70. package/dist/prosemirror/index.es.js +457 -431
  71. package/dist/prosemirror/index.umd.js +8 -8
  72. package/dist/rendererReact/index.cjs.js +1 -1
  73. package/dist/rendererReact/index.es.js +248 -223
  74. package/dist/rendererReact/index.js +1 -1
  75. package/dist/rendererReact/index.umd.js +1 -1
  76. package/dist/rteTinyMce/index.cjs.js +2 -2
  77. package/dist/rteTinyMce/index.es.js +150 -124
  78. package/dist/rteTinyMce/index.umd.js +2 -2
  79. package/dist/shapeDividerComponent/index.cjs.js +4 -4
  80. package/dist/shapeDividerComponent/index.es.js +143 -117
  81. package/dist/shapeDividerComponent/index.umd.js +4 -4
  82. package/dist/swiperComponent/index.cjs.js +9 -9
  83. package/dist/swiperComponent/index.es.js +218 -192
  84. package/dist/swiperComponent/index.umd.js +7 -7
  85. package/dist/tableComponent/index.cjs.js +1 -1
  86. package/dist/tableComponent/index.es.js +275 -249
  87. package/dist/tableComponent/index.umd.js +1 -1
  88. package/dist/types.d.ts +1 -1
  89. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  90. package/dist/youtubeAssetProvider/index.es.js +134 -108
  91. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  92. package/package.json +2 -2
@@ -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",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],U="license:check:end",_=()=>typeof window<"u",V=({isDev:e,isStage:t,isPlatform:o})=>`${e?"":`https://${t?O:L}`}/${o?"platform-api":"api"}`,j=()=>{if(!_())return"";const{hostname:e}=window.location;if(e)return e;try{return window.parent.location.hostname||""}catch{return""}},F=()=>{const e=j();return!!e&&($.includes(e)||$.some(t=>e.endsWith(t)))};async function K({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():"",u=i?`?${i}`:"",n=await fetch(`${a}${u}`,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||{}),P=(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))(P||{});const E={[h.free]:0,[h.startup]:10,[h.business]:20,[h.enterprise]:30};function W(e){const t=e;return t.init=o=>r=>e(r,o),t}const Y=e=>W(e);async function Z({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,w=(k=n.plan)==null?void 0:k.category;if(!(A||n.license)||b)c(b||"Invalid license");else if(w){const I=E[t],H=E[w];I>H&&c({pluginRequiredPlan:t,licensePlan:w})}};e.Commands.has(P.settings)&&(a=e.runCommand(P.settings),d=(a==null?void 0:a.baseUrl)||"");const u=n=>{s==null||s(n),n&&i(n)};if(!a){e.onReady(async()=>{if(!F())if(r){const n=await Q({licenseKey:r,pluginName:o,baseApiUrl:d});u(n)}else c("The `licenseKey` option not provided")});return}if(a.licensePlan||a.licenseError){const n=J(a);u(n);return}e.on(U,n=>u(n))}const J=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function Q(e){const{licenseKey:t,pluginName:o,baseApiUrl:r}=e;try{return(await K({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 m=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)),X=(...e)=>(t,o)=>e.some(r=>o.is(r)),x="gjs-plg-",T="data-type-role",l="accordion",q=`${l}-group`,g=`${l}-header`,y=`${l}-content`,v=`${l}-marker`,G=`${x}${g}`,M=`${x}${v}`,C=`${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))},S=(e,t)=>{const{Components:o,Blocks:r}=e,{block:s={}}=t,p="Accordion",d=`${x}${l}`,a=function(c={}){const i=this,u=()=>{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",()=>{u(),i.dispatchEvent(new CustomEvent("details-toggle",{bubbles:!0}))}),u()};return o.addType(l,{block:s&&{label:p,media:f.accordion,category:"Extra",select:!0,...s},isComponent:m(l),extendFn:["initToolbar"],model:{defaults:{tagName:"details",name:p,classes:d,emptyState:!0,clsMarkerOpen:B,attributes:{[T]:l},droppable:R(g,y),components:[{type:g},{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)}},ee=e=>{const{Components:t}=e;return t.addType(y,{isComponent:m(y),model:{defaults:{name:"Accordion Content",removable:!1,copyable:!1,draggable:!1,emptyState:!0,classes:C,icon:f.accordionContent,attributes:{[T]:y},components:"<div>Accordion content</div>"}}}),()=>{t.removeType(y)}},te=(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",u=>{const n=u.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:g,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:m(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)}},oe=(e,t)=>{const{Components:o}=e;return o.addType(g,{isComponent:m(g),extendFn:["initToolbar"],model:{defaults:{tagName:"summary",name:"Accordion Header",removable:!1,copyable:!1,draggable:!1,emptyState:!0,icon:f.accordionHeader,classes:G,attributes:{[T]:g},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(g)}},ne=e=>{const{Components:t}=e;return t.addType(v,{extend:"icon",isComponent:m(v),model:{defaults:{name:"Accordion Marker",icon:f.accordionMarker,classes:M,attributes:{[T]:v},components:f.caret,droppable:!1,draggable:X(g),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)}},se="accordionComponent",re=h.startup,ae=function(e,t={}){const o=[S(e,t),te(e,t),oe(e,t),ne(e),ee(e)];Z({editor:e,licenseKey:t.licenseKey,plan:re,pluginName:se,cleanup:()=>{o.forEach(r=>r())}})},ce=Y(ae);module.exports=ce;
@@ -1,99 +1,125 @@
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",
9
9
  // For stackblitz.com demos
10
10
  ".local.webcontainer.io",
11
11
  // For stackblitz.com demos
12
- "-sandpack.codesandbox.io"
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
+ ".claudemcpcontent.com",
15
+ // For Claude mcp app
16
+ ".web-sandbox.oaiusercontent.com"
17
+ // For OpenAI mcp app
18
+ ], U = "license:check:end", _ = () => typeof window < "u", V = ({
19
+ isDev: e,
20
+ isStage: t,
17
21
  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)));
22
+ }) => `${e ? "" : `https://${t ? O : L}`}/${o ? "platform-api" : "api"}`, j = () => {
23
+ if (!_()) return "";
24
+ const { hostname: e } = window.location;
25
+ if (e) return e;
26
+ try {
27
+ return window.parent.location.hostname || "";
28
+ } catch {
29
+ return "";
30
+ }
31
+ }, F = () => {
32
+ const e = j();
33
+ return !!e && ($.includes(e) || $.some((t) => e.endsWith(t)));
21
34
  };
22
- async function j({
23
- path: t,
24
- baseApiUrl: e,
35
+ async function K({
36
+ path: e,
37
+ baseApiUrl: t,
25
38
  method: o = "GET",
26
- headers: c = {},
39
+ headers: r = {},
27
40
  params: s,
28
- body: l
41
+ body: p
29
42
  }) {
30
- const p = `${e || V({ isDev: !1, isStage: !1 })}${t}`, a = {
43
+ const a = `${t || V({ isDev: !1, isStage: !1 })}${e}`, c = {
31
44
  method: o,
32
45
  headers: {
33
46
  "Content-Type": "application/json",
34
- ...c
47
+ ...r
35
48
  }
36
49
  };
37
- l && (a.body = JSON.stringify(l));
38
- const r = s ? new URLSearchParams(s).toString() : "", m = r ? `?${r}` : "", n = await fetch(`${p}${m}`, a);
50
+ p && (c.body = JSON.stringify(p));
51
+ const i = s ? new URLSearchParams(s).toString() : "", u = i ? `?${i}` : "", n = await fetch(`${a}${u}`, c);
39
52
  if (!n.ok)
40
53
  throw new Error(`HTTP error! status: ${n.status}`);
41
54
  return n.json();
42
55
  }
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
56
+ var h = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(h || {}), P = /* @__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))(P || {});
57
+ const E = {
58
+ [h.free]: 0,
59
+ [h.startup]: 10,
60
+ [h.business]: 20,
61
+ [h.enterprise]: 30
49
62
  };
50
- function K(t) {
51
- const e = t;
52
- return e.init = (o) => (c) => t(c, o), e;
63
+ function W(e) {
64
+ const t = e;
65
+ return t.init = (o) => (r) => e(r, o), t;
53
66
  }
54
- const W = (t) => /* @__PURE__ */ K(t);
55
- async function F({
56
- editor: t,
57
- plan: e,
67
+ const Y = (e) => /* @__PURE__ */ W(e);
68
+ async function Z({
69
+ editor: e,
70
+ plan: t,
58
71
  pluginName: o,
59
- licenseKey: c,
72
+ licenseKey: r,
60
73
  onLicenseCheckResponse: s,
61
- cleanup: l
74
+ cleanup: p
62
75
  }) {
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");
76
+ let d = "", a;
77
+ const c = (n) => {
78
+ console.warn("Cleanup plugin:", o, "Reason:", n), p();
79
+ }, i = (n = {}) => {
80
+ var k;
81
+ const { error: b, sdkLicense: A } = n, w = (k = n.plan) == null ? void 0 : k.category;
82
+ if (!(A || n.license) || b)
83
+ c(b || "Invalid license");
71
84
  else if (w) {
72
- const _ = k[e], z = k[w];
73
- _ > z && r({ pluginRequiredPlan: e, licensePlan: w });
85
+ const I = E[t], H = E[w];
86
+ I > H && c({ pluginRequiredPlan: t, licensePlan: w });
74
87
  }
75
88
  };
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);
89
+ e.Commands.has(P.settings) && (a = e.runCommand(P.settings), d = (a == null ? void 0 : a.baseUrl) || "");
90
+ const u = (n) => {
91
+ s == null || s(n), n && i(n);
92
+ };
93
+ if (!a) {
94
+ e.onReady(async () => {
95
+ if (!F())
96
+ if (r) {
97
+ const n = await Q({ licenseKey: r, pluginName: o, baseApiUrl: d });
98
+ u(n);
99
+ } else
100
+ c("The `licenseKey` option not provided");
101
+ });
102
+ return;
103
+ }
104
+ if (a.licensePlan || a.licenseError) {
105
+ const n = J(a);
106
+ u(n);
107
+ return;
108
+ }
109
+ e.on(U, (n) => u(n));
90
110
  }
91
- async function Y(t) {
92
- const { licenseKey: e, pluginName: o, baseApiUrl: c } = t;
111
+ const J = (e) => ({
112
+ sdkLicense: e.license,
113
+ license: e.license,
114
+ error: e.licenseError,
115
+ plan: e.licensePlan
116
+ });
117
+ async function Q(e) {
118
+ const { licenseKey: t, pluginName: o, baseApiUrl: r } = e;
93
119
  try {
94
- return (await j({
95
- baseApiUrl: c,
96
- path: `/sdk/${e || "na"}`,
120
+ return (await K({
121
+ baseApiUrl: r,
122
+ path: `/sdk/${t || "na"}`,
97
123
  method: "POST",
98
124
  params: {
99
125
  d: window.location.hostname,
@@ -104,10 +130,10 @@ async function Y(t) {
104
130
  return console.error("Error during SDK license check:", s), !1;
105
131
  }
106
132
  }
107
- const A = (t) => (e) => {
133
+ const m = (e) => (t) => {
108
134
  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 = {
135
+ return ((o = t.getAttribute) == null ? void 0 : o.call(t, T)) === e;
136
+ }, R = (...e) => (t) => e.some((o) => t.is(o)), X = (...e) => (t, o) => e.some((r) => o.is(r)), x = "gjs-plg-", T = "data-type-role", l = "accordion", q = `${l}-group`, g = `${l}-header`, y = `${l}-content`, f = `${l}-marker`, G = `${x}${g}`, M = `${x}${f}`, C = `${x}${y}`, B = `${M}-open`, v = {
111
137
  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
138
  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
139
  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 +141,47 @@ const A = (t) => (e) => {
115
141
  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
142
  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
143
  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 = {
144
+ }, D = (e, t) => {
145
+ const { toolbarIconOpen: o = v.eye } = t, r = e.is(l) ? e : e.closestType(l);
146
+ if (!o || !r) return;
147
+ const { toolbar: s } = e, p = {
122
148
  id: "accordion-toggle-open",
123
149
  label: o,
124
- command: () => c.toggleOpen()
150
+ command: () => r.toggleOpen()
125
151
  };
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));
152
+ !s.find((a) => a.id === p.id) && (s == null || s.unshift(p));
153
+ }, S = (e, t) => {
154
+ const { Components: o, Blocks: r } = e, { block: s = {} } = t, p = "Accordion", d = `${x}${l}`, a = function(c = {}) {
155
+ const i = this, u = () => {
156
+ const { clsMarkerOpen: n } = c, b = i.querySelector('[data-type-role="accordion-marker"]');
157
+ !b || !n || (i.open ? b.classList.add(n) : b.classList.remove(n));
132
158
  };
133
- r.addEventListener("toggle", () => {
134
- m(), r.dispatchEvent(new CustomEvent("details-toggle", { bubbles: !0 }));
135
- }), m();
159
+ i.addEventListener("toggle", () => {
160
+ u(), i.dispatchEvent(new CustomEvent("details-toggle", { bubbles: !0 }));
161
+ }), u();
136
162
  };
137
- return o.addType(i, {
163
+ return o.addType(l, {
138
164
  block: s && {
139
- label: l,
165
+ label: p,
140
166
  media: v.accordion,
141
167
  category: "Extra",
142
168
  select: !0,
143
169
  ...s
144
170
  },
145
- isComponent: A(i),
171
+ isComponent: m(l),
146
172
  extendFn: ["initToolbar"],
147
173
  model: {
148
174
  defaults: {
149
175
  tagName: "details",
150
- name: l,
176
+ name: p,
151
177
  classes: d,
152
178
  emptyState: !0,
153
- clsMarkerOpen: I,
154
- attributes: { [b]: i },
155
- droppable: H(u, g),
156
- components: [{ type: u }, { type: g }],
179
+ clsMarkerOpen: B,
180
+ attributes: { [T]: l },
181
+ droppable: R(g, y),
182
+ components: [{ type: g }, { type: y }],
157
183
  "script-props": ["clsMarkerOpen"],
158
- script: p,
184
+ script: a,
159
185
  traits: [
160
186
  {
161
187
  type: "checkbox",
@@ -186,16 +212,16 @@ const A = (t) => (e) => {
186
212
  this.addAttributes({ open: !this.getAttributes().open });
187
213
  },
188
214
  initToolbar() {
189
- N(this, e);
215
+ D(this, t);
190
216
  }
191
217
  }
192
218
  }), () => {
193
- c.remove(i), o.removeType(i);
219
+ r.remove(l), o.removeType(l);
194
220
  };
195
- }, X = (t) => {
196
- const { Components: e } = t;
197
- return e.addType(g, {
198
- isComponent: A(g),
221
+ }, ee = (e) => {
222
+ const { Components: t } = e;
223
+ return t.addType(y, {
224
+ isComponent: m(y),
199
225
  model: {
200
226
  defaults: {
201
227
  name: "Accordion Content",
@@ -203,61 +229,61 @@ const A = (t) => (e) => {
203
229
  copyable: !1,
204
230
  draggable: !1,
205
231
  emptyState: !0,
206
- classes: J,
232
+ classes: C,
207
233
  icon: v.accordionContent,
208
- attributes: { [b]: g },
234
+ attributes: { [T]: y },
209
235
  components: "<div>Accordion content</div>"
210
236
  }
211
237
  }
212
238
  }), () => {
213
- e.removeType(g);
239
+ t.removeType(y);
214
240
  };
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);
241
+ }, te = (e, t) => {
242
+ const { Components: o, Blocks: r } = e, { blockGroup: s = {} } = t, p = "Accordion Group", d = function(c = {}) {
243
+ if (!c.single) return;
244
+ const i = this;
245
+ i.addEventListener("details-toggle", (u) => {
246
+ const n = u.target;
247
+ if (!c.single || !n || !n.open) return;
248
+ i.querySelectorAll('[data-type-role="accordion"]').forEach((A) => {
249
+ n !== A && A.open && (A.open = !1);
224
250
  });
225
251
  });
226
- }, p = (a = {}) => ({
227
- type: i,
228
- attributes: { open: a.open },
252
+ }, a = (c = {}) => ({
253
+ type: l,
254
+ attributes: { open: c.open },
229
255
  components: [
230
256
  {
231
- type: u,
232
- components: [`<div>${a.header}</div>`, { type: h }]
257
+ type: g,
258
+ components: [`<div>${c.header}</div>`, { type: f }]
233
259
  },
234
260
  {
235
- type: g,
236
- components: `<div>${a.content}</div>`
261
+ type: y,
262
+ components: `<div>${c.content}</div>`
237
263
  }
238
264
  ]
239
265
  });
240
266
  return o.addType(q, {
241
267
  block: s && {
242
- label: l,
268
+ label: p,
243
269
  media: v.accordionGroup,
244
270
  category: "Extra",
245
271
  select: !0,
246
272
  ...s
247
273
  },
248
- isComponent: A(q),
274
+ isComponent: m(q),
249
275
  model: {
250
276
  defaults: {
251
- name: l,
252
- attributes: { [b]: q },
253
- droppable: H(i),
277
+ name: p,
278
+ attributes: { [T]: q },
279
+ droppable: R(l),
254
280
  single: !0,
255
281
  emptyState: !0,
256
282
  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}`
283
+ (c, i) => a({
284
+ open: i === 0,
285
+ header: `Accordion header ${i + 1}`,
286
+ content: `Accordion content ${i + 1}`
261
287
  })
262
288
  ),
263
289
  traits: [
@@ -274,12 +300,12 @@ const A = (t) => (e) => {
274
300
  }
275
301
  }
276
302
  }), () => {
277
- c.remove(q), o.removeType(q);
303
+ r.remove(q), o.removeType(q);
278
304
  };
279
- }, tt = (t, e) => {
280
- const { Components: o } = t;
281
- return o.addType(u, {
282
- isComponent: A(u),
305
+ }, oe = (e, t) => {
306
+ const { Components: o } = e;
307
+ return o.addType(g, {
308
+ isComponent: m(g),
283
309
  extendFn: ["initToolbar"],
284
310
  model: {
285
311
  defaults: {
@@ -290,14 +316,14 @@ const A = (t) => (e) => {
290
316
  draggable: !1,
291
317
  emptyState: !0,
292
318
  icon: v.accordionHeader,
293
- classes: x,
294
- attributes: { [b]: u },
295
- components: ["<div>Accordion header</div>", { type: h }],
319
+ classes: G,
320
+ attributes: { [T]: g },
321
+ components: ["<div>Accordion header</div>", { type: f }],
296
322
  styles: `
297
323
  summary {
298
324
  list-style: none;
299
325
  }
300
- .${x} {
326
+ .${G} {
301
327
  cursor: pointer;
302
328
  display: flex;
303
329
  align-items: center;
@@ -307,60 +333,60 @@ const A = (t) => (e) => {
307
333
  `
308
334
  },
309
335
  initToolbar() {
310
- N(this, e);
336
+ D(this, t);
311
337
  }
312
338
  }
313
339
  }), () => {
314
- o.removeType(u);
340
+ o.removeType(g);
315
341
  };
316
- }, et = (t) => {
317
- const { Components: e } = t;
318
- return e.addType(h, {
342
+ }, ne = (e) => {
343
+ const { Components: t } = e;
344
+ return t.addType(f, {
319
345
  extend: "icon",
320
- isComponent: A(h),
346
+ isComponent: m(f),
321
347
  model: {
322
348
  defaults: {
323
349
  name: "Accordion Marker",
324
350
  icon: v.accordionMarker,
325
- classes: C,
326
- attributes: { [b]: h },
351
+ classes: M,
352
+ attributes: { [T]: f },
327
353
  components: v.caret,
328
354
  droppable: !1,
329
- draggable: Z(u),
355
+ draggable: X(g),
330
356
  styles: `
331
- .${C} {
357
+ .${M} {
332
358
  min-width: 24px;
333
359
  width: 24px;
334
360
  height: 24px;
335
361
  transition: transform 0.2s ease-in-out;
336
362
  }
337
- .${I} {
363
+ .${B} {
338
364
  transform: rotateZ(180deg);
339
365
  }
340
366
  `
341
367
  }
342
368
  }
343
369
  }), () => {
344
- e.removeType(h);
370
+ t.removeType(f);
345
371
  };
346
- }, ot = "accordionComponent", nt = f.startup, st = function(t, e = {}) {
372
+ }, se = "accordionComponent", re = h.startup, ae = function(e, t = {}) {
347
373
  const o = [
348
- Q(t, e),
349
- R(t, e),
350
- tt(t, e),
351
- et(t),
352
- X(t)
374
+ S(e, t),
375
+ te(e, t),
376
+ oe(e, t),
377
+ ne(e),
378
+ ee(e)
353
379
  ];
354
- F({
355
- editor: t,
356
- licenseKey: e.licenseKey,
357
- plan: nt,
358
- pluginName: ot,
380
+ Z({
381
+ editor: e,
382
+ licenseKey: t.licenseKey,
383
+ plan: re,
384
+ pluginName: se,
359
385
  cleanup: () => {
360
- o.forEach((c) => c());
386
+ o.forEach((r) => r());
361
387
  }
362
388
  });
363
- }, rt = W(st);
389
+ }, ie = Y(ae);
364
390
  export {
365
- rt as default
391
+ ie as default
366
392
  };