@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,5 +1,5 @@
1
- "use strict";const P="app.grapesjs.com",z="app-stage.grapesjs.com",O="app2.grapesjs.com",V="app-stage2.grapesjs.com",A=[P,O,z,V,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],B="license:check:start",F="license:check:end",X=()=>typeof window<"u",M=({isDev:t,isStage:n,isPlatform:a})=>`${t?"":`https://${n?z:P}`}/${a?"platform-api":"api"}`,j=()=>{const t=X()&&window.location.hostname;return!!t&&(A.includes(t)||A.some(n=>t.endsWith(n)))};async function _({path:t,baseApiUrl:n,method:a="GET",headers:s={},params:o,body:i}){const m=`${n||M({isDev:!1,isStage:!1})}${t}`,l={method:a,headers:{"Content-Type":"application/json",...s}};i&&(l.body=JSON.stringify(i));const p=o?new URLSearchParams(o).toString():"",u=p?`?${p}`:"",e=await fetch(`${m}${u}`,l);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return e.json()}var b=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(b||{});const C={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function $(t){const n=t;return n.init=a=>s=>t(s,a),n}const W=t=>$(t);async function Y({editor:t,plan:n,pluginName:a,licenseKey:s,onLicenseCheckResponse:o,cleanup:i}){let r="",m=!1;const l=j(),p=e=>{console.warn("Cleanup plugin:",a,"Reason:",e),i()},u=(e={})=>{var k;const{error:c,sdkLicense:d}=e,h=(k=e.plan)==null?void 0:k.category;if(!(d||e.license)||c)p(c||"Invalid license");else if(h){const U=C[n],G=C[h];U>G&&p({pluginRequiredPlan:n,licensePlan:h})}};t.on(B,e=>{r=e==null?void 0:e.baseApiUrl,m=!0}),t.on(F,e=>{o==null||o(e),u(e)}),setTimeout(async()=>{if(!m){if(l)return;if(s){const e=await H({licenseKey:s,pluginName:a,baseApiUrl:r});o==null||o(e),e&&u(e)}else p("The `licenseKey` option not provided")}},2e3)}async function H(t){const{licenseKey:n,pluginName:a,baseApiUrl:s}=t;try{return(await _({baseApiUrl:s,path:`/sdk/${n||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(o){return console.error("Error during SDK license check:",o),!1}}const K=(...t)=>n=>t.some(a=>n.is(a));var f=(t=>(t.name="animation-name",t.duration="animation-duration",t.delay="animation-delay",t.iterationCount="animation-iteration-count",t.timingFunction="animation-timing-function",t.fillMode="animation-fill-mode",t))(f||{}),v=(t=>(t.onScroll="--animation-on-scroll",t.threshold="--animation-threshold",t.repeat="--animation-repeat",t))(v||{});const g="animation",I="animation-group",D="animation:update",E="animation-group:update",Z={category:{id:"animations",label:"Animations"},select:!0},w=t=>(t==null?void 0:t.getType())===g,x=t=>(t==null?void 0:t.getType())===I,R=t=>w(t)||x(t),S={isVisible:({component:t})=>w(t)},q={isVisible:({component:t})=>x(t)},J={isVisible:({component:t})=>w(t)&&x(t==null?void 0:t.parent())?!1:R(t)},L={isVisible:({component:t,sector:n})=>{var a;return w(t)&&x(t==null?void 0:t.parent())?!1:R(t)&&((a=n.getProperty(v.onScroll))==null?void 0:a.getValue())==="true"}},N={animation:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 14a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13"/><path fill="currentColor" d="M17.14 15.98a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/><path fill="currentColor" d="M12.64 20.48a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/></svg>',animationGroup:'<svg viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v10h2V4h10V2H4m4 4a2 2 0 0 0-2 2v10h2V8h10V6H8m4 4a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8Z"/></svg>'},Q=function(t){const n=this;let a=null;const s=()=>{a==null||a.disconnect(),a=null},o=()=>{s();const i=n.style;i.animationName="",requestAnimationFrame(()=>{const r=getComputedStyle(n),m=r.getPropertyValue("animation-name").trim(),l=r.getPropertyValue("--animation-on-scroll").trim()!=="false",p=parseFloat(r.getPropertyValue("--animation-threshold").trim())||.2,u=r.getPropertyValue("--animation-repeat").trim()==="true",e=()=>{i.animationName="none",n.offsetWidth,i.animationName=m,i.animationPlayState="running"};if(!m||m==="none"){i.animationName="none",i.animationPlayState="paused";return}if(!l){e();return}i.animationPlayState="paused",a=new IntersectionObserver(c=>{c.forEach(d=>{d.isIntersecting&&(e(),!u&&s())})},{threshold:p}),a.observe(n)})};n.addEventListener(t.animationUpdateEvent,o),o()},tt=(t,n)=>{const{Components:a,Blocks:s,Canvas:o}=t,{block:i={},animationList:r=[]}=n,m=t.Components.events,l="Animation",p=Object.values(v),u=Object.values(f);return a.addType(g,{block:i?{label:l,media:N.animation,content:{type:g},...Z,...i}:void 0,model:{defaults:{emptyState:!0,name:l,traits:[],script:Q,animationUpdateEvent:D,"script-props":["animationUpdateEvent"],styles:r.map(e=>e.css).join(`
2
- `)},init(){const{em:e}=this;this.addStyle({[f.name]:"fadeIn",[f.duration]:"1s",[f.fillMode]:"both",...n.animationStyle,...this.getStyle()}),this.listenTo(e,m.mount,c=>{var h;if(c!==this)return;((h=this.parent())==null?void 0:h.get("type"))!==I||p.forEach(y=>this.removeStyle(y))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:e}=this;this.listenTo(e,m.styleUpdate,this.handleStyleChange)},onAnimationStart(){var c;if((c=this.cmpSpots)!=null&&c.length)return;const e=o.getSpots({component:this.model});this.cmpSpots=e,o.removeSpots(e),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const e=this.cmpSpots||[];o.spots.add(e),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(D))},handleStyleChange(e,c){Object.keys((c==null?void 0:c.style)||{}).some(y=>u.includes(y)||p.includes(y))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{s.remove(g),a.removeType(g)}},nt=function(t){const n=this,a="--animation-on-scroll",s="--animation-threshold",o="--animation-repeat";let i=null;const r=()=>{i==null||i.disconnect(),i=null},m=()=>{r();const l=getComputedStyle(n),p=l.getPropertyValue(a).trim()!=="false",u=parseFloat(l.getPropertyValue(s).trim())||.2,e=l.getPropertyValue(o).trim()==="true",c=()=>{Array.from(n.children).forEach(d=>{d instanceof HTMLElement&&typeof d.dispatchEvent=="function"&&d.dispatchEvent(new CustomEvent(E,{bubbles:!1}))})};if(!p){c();return}i=new IntersectionObserver(d=>{d.forEach(h=>{h.isIntersecting?(c(),!e&&r()):e&&Array.from(n.children).forEach(y=>{y instanceof HTMLElement&&getComputedStyle(y).getPropertyValue(a).trim()!=="false"&&(y.style.opacity="0",y.style.animationPlayState="paused")})})},{threshold:u}),i.observe(n)};n.addEventListener(t.animationGroupUpdateEvent,m),m()},et=(t,n)=>{const{Components:a,Blocks:s}=t,{blockGroup:o={}}=n,i="Animation Group";return a.addType(I,{block:o?{label:i,media:N.animationGroup,content:{type:I,components:[{type:g},{type:g},{type:g}]},...Z,...o}:void 0,model:{defaults:{name:i,emptyState:!0,traits:[],script:nt,animationGroupUpdateEvent:E,"script-props":["animationGroupUpdateEvent"],droppable:K(g)},init(){this.addStyle({...n.animationGroupStyle,...this.getStyle()});const r=this.components();this.listenTo(r,"add remove",this.updateChildrenStaggerStyles),this.updateChildrenStaggerStyles()},updateChildrenStaggerStyles(){this.components().forEach((r,m)=>{r.is(g)&&r.addStyle({"--stagger-index":m.toString(),[f.delay]:"calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"},{partial:!0})})}},view:{init(){const{model:r}=this;this.listenTo(r,"component:styleUpdate",this.handleStyleChange)},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(E))},handleStyleChange(){this.triggerAnimation(),this.model.updateChildrenStaggerStyles()},onRender(){this.triggerAnimation()}}}),()=>{s.remove(I),a.removeType(I)}},at="animationComponent",ot=b.startup,T=[{id:"flash",name:"Flash",css:`@keyframes flash {
1
+ "use strict";const G="app.grapesjs.com",z="app-stage.grapesjs.com",F="app2.grapesjs.com",N="app-stage2.grapesjs.com",D=[G,F,z,N,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],V="license:check:end",X=()=>typeof window<"u",j=({isDev:t,isStage:e,isPlatform:a})=>`${t?"":`https://${e?z:G}`}/${a?"platform-api":"api"}`,$=()=>{const t=X()&&window.location.hostname;return!!t&&(D.includes(t)||D.some(e=>t.endsWith(e)))};async function Y({path:t,baseApiUrl:e,method:a="GET",headers:r={},params:i,body:o}){const s=`${e||j({isDev:!1,isStage:!1})}${t}`,p={method:a,headers:{"Content-Type":"application/json",...r}};o&&(p.body=JSON.stringify(o));const m=i?new URLSearchParams(i).toString():"",d=m?`?${m}`:"",n=await fetch(`${s}${d}`,p);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var b=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(b||{}),P=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",t.dialogExportCode="studio:dialogExportCode",t.dialogImportCode="studio:dialogImportCode",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.clearPage="studio:clearPage",t.projectFiles="studio:projectFiles",t.validateCode="studio:validateCode",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.layoutUpdate="studio:layoutUpdate",t.layoutGet="studio:layoutGet",t.layoutConfigGet="studio:layoutConfigGet",t.layoutConfigSet="studio:layoutConfigSet",t.layoutComponentAdd="studio:layoutComponentAdd",t.layoutComponentGet="studio:layoutComponentGet",t.layoutComponentRemove="studio:layoutComponentRemove",t.layoutComponentRender="studio:layoutComponentRender",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.settings="studio:settings",t.assetProviderGet="studio:assetProviderGet",t.assetProviderAdd="studio:assetProviderAdd",t.assetProviderRemove="studio:assetProviderRemove",t.fontGet="studio:fontGet",t.fontAdd="studio:fontAdd",t.fontRemove="studio:fontRemove",t.fontManagerOpen="studio:fontManagerOpen",t.menuFontLoad="studio:menuFontLoad",t.toggleStateDataSource="studio:toggleStateDataSource",t.getStateDataSource="studio:getStateDataSource",t.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",t.dataSourceSetImporter="studio:dataSourceSetImporter",t.dataSourceSetExporter="studio:dataSourceSetExporter",t.setDragAbsolute="studio:setDragAbsolute",t))(P||{});const L={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function C(t){const e=t;return e.init=a=>r=>t(r,a),e}const W=t=>C(t);async function _({editor:t,plan:e,pluginName:a,licenseKey:r,onLicenseCheckResponse:i,cleanup:o}){let l="",s;const p=n=>{console.warn("Cleanup plugin:",a,"Reason:",n),o()},m=(n={})=>{var R;const{error:c,sdkLicense:f}=n,h=(R=n.plan)==null?void 0:R.category;if(!(f||n.license)||c)p(c||"Invalid license");else if(h){const E=L[e],M=L[h];E>M&&p({pluginRequiredPlan:e,licensePlan:h})}};t.Commands.has(P.settings)&&(s=t.runCommand(P.settings),l=(s==null?void 0:s.baseUrl)||"");const d=n=>{i==null||i(n),n&&m(n)};if(!s){t.onReady(async()=>{if(!$())if(r){const n=await K({licenseKey:r,pluginName:a,baseApiUrl:l});d(n)}else p("The `licenseKey` option not provided")});return}if(s.licensePlan||s.licenseError){const n=H(s);d(n);return}t.on(V,n=>d(n))}const H=t=>({sdkLicense:t.license,license:t.license,error:t.licenseError,plan:t.licensePlan});async function K(t){const{licenseKey:e,pluginName:a,baseApiUrl:r}=t;try{return(await Y({baseApiUrl:r,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const q=(...t)=>e=>t.some(a=>e.is(a));var u=(t=>(t.name="animation-name",t.duration="animation-duration",t.delay="animation-delay",t.iterationCount="animation-iteration-count",t.timingFunction="animation-timing-function",t.fillMode="animation-fill-mode",t))(u||{}),v=(t=>(t.onScroll="--animation-on-scroll",t.threshold="--animation-threshold",t.repeat="--animation-repeat",t))(v||{});const y="animation",I="animation-group",T="animation:update",w="animation-group:update",B={category:{id:"animations",label:"Animations"},select:!0},k=t=>(t==null?void 0:t.getType())===y,A=t=>(t==null?void 0:t.getType())===I,O=t=>k(t)||A(t),x={isVisible:({component:t})=>k(t)},J={isVisible:({component:t})=>A(t)},Q={isVisible:({component:t})=>k(t)&&A(t==null?void 0:t.parent())?!1:O(t)},S={isVisible:({component:t,sector:e})=>{var a;return k(t)&&A(t==null?void 0:t.parent())?!1:O(t)&&((a=e.getProperty(v.onScroll))==null?void 0:a.getValue())==="true"}},Z={animation:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 14a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13"/><path fill="currentColor" d="M17.14 15.98a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/><path fill="currentColor" d="M12.64 20.48a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/></svg>',animationGroup:'<svg viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v10h2V4h10V2H4m4 4a2 2 0 0 0-2 2v10h2V8h10V6H8m4 4a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8Z"/></svg>'},tt=function(t){const e=this;let a=null;const r=()=>{a==null||a.disconnect(),a=null},i=()=>{r();const o=e.style;o.animationName="",requestAnimationFrame(()=>{const l=getComputedStyle(e),s=l.getPropertyValue("animation-name").trim(),p=l.getPropertyValue("--animation-on-scroll").trim()!=="false",m=parseFloat(l.getPropertyValue("--animation-threshold").trim())||.2,d=l.getPropertyValue("--animation-repeat").trim()==="true",n=()=>{o.animationName="none",e.offsetWidth,o.animationName=s,o.animationPlayState="running"};if(!s||s==="none"){o.animationName="none",o.animationPlayState="paused";return}if(!p){n();return}o.animationPlayState="paused",a=new IntersectionObserver(c=>{c.forEach(f=>{f.isIntersecting&&(n(),!d&&r())})},{threshold:m}),a.observe(e)})};e.addEventListener(t.animationUpdateEvent,i),i()},et=(t,e)=>{const{Components:a,Blocks:r,Canvas:i}=t,{block:o={},animationList:l=[]}=e,s=t.Components.events,p="Animation",m=Object.values(v),d=Object.values(u);return a.addType(y,{block:o?{label:p,media:Z.animation,content:{type:y},...B,...o}:void 0,model:{defaults:{emptyState:!0,name:p,traits:[],script:tt,animationUpdateEvent:T,"script-props":["animationUpdateEvent"],styles:l.map(n=>n.css).join(`
2
+ `)},init(){const{em:n}=this;this.addStyle({[u.name]:"fadeIn",[u.duration]:"1s",[u.fillMode]:"both",...e.animationStyle,...this.getStyle()}),this.listenTo(n,s.mount,c=>{var h;if(c!==this)return;((h=this.parent())==null?void 0:h.get("type"))!==I||m.forEach(g=>this.removeStyle(g))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:n}=this;this.listenTo(n,s.styleUpdate,this.handleStyleChange)},onAnimationStart(){var c;if((c=this.cmpSpots)!=null&&c.length)return;const n=i.getSpots({component:this.model});this.cmpSpots=n,i.removeSpots(n),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const n=this.cmpSpots||[];i.spots.add(n),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(T))},handleStyleChange(n,c){Object.keys((c==null?void 0:c.style)||{}).some(g=>d.includes(g)||m.includes(g))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(y),a.removeType(y)}},nt=function(t){const e=this,a="--animation-on-scroll",r="--animation-threshold",i="--animation-repeat";let o=null;const l=()=>{o==null||o.disconnect(),o=null},s=()=>{l();const p=getComputedStyle(e),m=p.getPropertyValue(a).trim()!=="false",d=parseFloat(p.getPropertyValue(r).trim())||.2,n=p.getPropertyValue(i).trim()==="true",c=()=>{Array.from(e.children).forEach(f=>{f instanceof HTMLElement&&typeof f.dispatchEvent=="function"&&f.dispatchEvent(new CustomEvent(w,{bubbles:!1}))})};if(!m){c();return}o=new IntersectionObserver(f=>{f.forEach(h=>{h.isIntersecting?(c(),!n&&l()):n&&Array.from(e.children).forEach(g=>{g instanceof HTMLElement&&getComputedStyle(g).getPropertyValue(a).trim()!=="false"&&(g.style.opacity="0",g.style.animationPlayState="paused")})})},{threshold:d}),o.observe(e)};e.addEventListener(t.animationGroupUpdateEvent,s),s()},at=(t,e)=>{const{Components:a,Blocks:r}=t,{blockGroup:i={}}=e,o="Animation Group";return a.addType(I,{block:i?{label:o,media:Z.animationGroup,content:{type:I,components:[{type:y},{type:y},{type:y}]},...B,...i}:void 0,model:{defaults:{name:o,emptyState:!0,traits:[],script:nt,animationGroupUpdateEvent:w,"script-props":["animationGroupUpdateEvent"],droppable:q(y)},init(){this.addStyle({...e.animationGroupStyle,...this.getStyle()});const l=this.components();this.listenTo(l,"add remove",this.updateChildrenStaggerStyles),this.updateChildrenStaggerStyles()},updateChildrenStaggerStyles(){this.components().forEach((l,s)=>{l.is(y)&&l.addStyle({"--stagger-index":s.toString(),[u.delay]:"calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"},{partial:!0})})}},view:{init(){const{model:l}=this;this.listenTo(l,"component:styleUpdate",this.handleStyleChange)},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(w))},handleStyleChange(){this.triggerAnimation(),this.model.updateChildrenStaggerStyles()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(I),a.removeType(I)}},ot="animationComponent",it=b.startup,U=[{id:"flash",name:"Flash",css:`@keyframes flash {
3
3
  0%, 50%, to {
4
4
  opacity:1
5
5
  }
@@ -516,4 +516,4 @@
516
516
  transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0);
517
517
  animation-timing-function:cubic-bezier(.175, .885, .32, 1)
518
518
  }
519
- }`}],it=function(t,n={}){var o;const a=((o=n.animations)==null?void 0:o.call(n,{items:T}))||T,s=[tt(t,{...n,animationList:a}),et(t,n)];t.Styles.addSector("animation",{name:"Animation",properties:[{...S,name:"Type",property:f.name,type:"select",full:!0,default:"fadeIn",options:a},{...S,name:"Duration",property:f.duration,type:"number",units:["s"],min:.1,max:10,step:.1,default:"1s"},{...S,name:"Delay",property:f.delay,type:"number",units:["s"],min:0,max:10,step:.1,default:"1s"},{...S,name:"Iteration Count",property:f.iterationCount,type:"select",default:"1",options:[{id:"1",name:"One time"},{id:"infinite",name:"Infinite"}]},{...S,name:"Timing",property:f.timingFunction,type:"select",default:"ease",options:[{id:"ease",name:"Ease"},{id:"ease-in",name:"Ease in"},{id:"ease-out",name:"Ease out"},{id:"ease-in-out",name:"Ease in out"},{id:"linear",name:"Linear"}]},{...q,name:"Stagger Delay",property:"--stagger-delay",type:"slider",units:["s"],min:.1,max:5,step:.1,default:"0.3s"},{...J,name:"Animate on Scroll",property:v.onScroll,type:"radio",default:"true",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]},{...L,name:"Scroll Threshold",property:v.threshold,type:"number",full:!0,min:.1,max:1,step:.01,default:"0.2"},{...L,name:"Repeat on Scroll",property:v.repeat,type:"radio",default:"false",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]}]}),Y({editor:t,licenseKey:n.licenseKey,plan:ot,pluginName:at,cleanup:()=>{s.forEach(i=>i())}})},st=W(it);module.exports=st;
519
+ }`}],st=function(t,e={}){var i;const a=((i=e.animations)==null?void 0:i.call(e,{items:U}))||U,r=[et(t,{...e,animationList:a}),at(t,e)];t.Styles.addSector("animation",{name:"Animation",properties:[{...x,name:"Type",property:u.name,type:"select",full:!0,default:"fadeIn",options:a},{...x,name:"Duration",property:u.duration,type:"number",units:["s"],min:.1,max:10,step:.1,default:"1s"},{...x,name:"Delay",property:u.delay,type:"number",units:["s"],min:0,max:10,step:.1,default:"1s"},{...x,name:"Iteration Count",property:u.iterationCount,type:"select",default:"1",options:[{id:"1",name:"One time"},{id:"infinite",name:"Infinite"}]},{...x,name:"Timing",property:u.timingFunction,type:"select",default:"ease",options:[{id:"ease",name:"Ease"},{id:"ease-in",name:"Ease in"},{id:"ease-out",name:"Ease out"},{id:"ease-in-out",name:"Ease in out"},{id:"linear",name:"Linear"}]},{...J,name:"Stagger Delay",property:"--stagger-delay",type:"slider",units:["s"],min:.1,max:5,step:.1,default:"0.3s"},{...Q,name:"Animate on Scroll",property:v.onScroll,type:"radio",default:"true",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]},{...S,name:"Scroll Threshold",property:v.threshold,type:"number",full:!0,min:.1,max:1,step:.01,default:"0.2"},{...S,name:"Repeat on Scroll",property:v.repeat,type:"radio",default:"false",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]}]}),_({editor:t,licenseKey:e.licenseKey,plan:it,pluginName:ot,cleanup:()=>{r.forEach(o=>o())}})},rt=W(st);module.exports=rt;