@grapesjs/studio-sdk-plugins 1.0.28-rc.2 → 1.0.28

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 (77) hide show
  1. package/dist/accordionComponent/index.cjs.js +8 -8
  2. package/dist/accordionComponent/index.es.js +71 -69
  3. package/dist/accordionComponent/index.umd.js +6 -6
  4. package/dist/animationComponent/index.cjs.js +3 -3
  5. package/dist/animationComponent/index.es.js +48 -46
  6. package/dist/animationComponent/index.umd.js +3 -3
  7. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  8. package/dist/canvasAbsoluteMode/index.es.js +86 -84
  9. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  10. package/dist/canvasEmptyState/index.cjs.js +1 -1
  11. package/dist/canvasEmptyState/index.es.js +68 -66
  12. package/dist/canvasEmptyState/index.umd.js +1 -1
  13. package/dist/canvasFullSize/index.cjs.js +3 -3
  14. package/dist/canvasFullSize/index.es.js +52 -50
  15. package/dist/canvasFullSize/index.umd.js +7 -7
  16. package/dist/canvasGridMode/index.cjs.js +5 -5
  17. package/dist/canvasGridMode/index.es.js +191 -189
  18. package/dist/canvasGridMode/index.umd.js +2 -2
  19. package/dist/dataSourceEjs/index.cjs.js +3 -3
  20. package/dist/dataSourceEjs/index.es.js +32 -30
  21. package/dist/dataSourceEjs/index.umd.js +3 -3
  22. package/dist/dataSourceHandlebars/index.cjs.js +4 -4
  23. package/dist/dataSourceHandlebars/index.es.js +31 -29
  24. package/dist/dataSourceHandlebars/index.umd.js +2 -2
  25. package/dist/dialogComponent/index.cjs.js +3 -3
  26. package/dist/dialogComponent/index.es.js +32 -30
  27. package/dist/dialogComponent/index.umd.js +4 -4
  28. package/dist/flexComponent/index.cjs.js +6 -6
  29. package/dist/flexComponent/index.es.js +74 -72
  30. package/dist/flexComponent/index.umd.js +7 -7
  31. package/dist/fsLightboxComponent/index.cjs.js +2 -2
  32. package/dist/fsLightboxComponent/index.es.js +40 -38
  33. package/dist/fsLightboxComponent/index.umd.js +2 -2
  34. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  35. package/dist/googleFontsAssetProvider/index.es.js +70 -68
  36. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  37. package/dist/iconifyComponent/index.cjs.js +2 -2
  38. package/dist/iconifyComponent/index.es.js +56 -54
  39. package/dist/iconifyComponent/index.umd.js +2 -2
  40. package/dist/index.cjs.js +43 -43
  41. package/dist/index.es.js +1442 -1440
  42. package/dist/index.umd.js +43 -43
  43. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  44. package/dist/layoutSidebarButtons/index.es.js +29 -27
  45. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  46. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  47. package/dist/lightGalleryComponent/index.es.js +90 -88
  48. package/dist/lightGalleryComponent/index.umd.js +1 -1
  49. package/dist/linkImageComponent/index.cjs.js +2 -2
  50. package/dist/linkImageComponent/index.es.js +20 -18
  51. package/dist/linkImageComponent/index.umd.js +2 -2
  52. package/dist/listPagesComponent/index.cjs.js +4 -4
  53. package/dist/listPagesComponent/index.es.js +42 -40
  54. package/dist/listPagesComponent/index.umd.js +4 -4
  55. package/dist/presetPrintable/index.cjs.js +3 -3
  56. package/dist/presetPrintable/index.es.js +156 -154
  57. package/dist/presetPrintable/index.umd.js +3 -3
  58. package/dist/prosemirror/index.cjs.js +7 -7
  59. package/dist/prosemirror/index.es.js +165 -163
  60. package/dist/prosemirror/index.umd.js +7 -7
  61. package/dist/rendererReact/index.cjs.js +1 -1
  62. package/dist/rendererReact/index.es.js +101 -99
  63. package/dist/rendererReact/index.js +1 -1
  64. package/dist/rendererReact/index.umd.js +1 -1
  65. package/dist/rteTinyMce/index.cjs.js +2 -2
  66. package/dist/rteTinyMce/index.es.js +54 -52
  67. package/dist/rteTinyMce/index.umd.js +2 -2
  68. package/dist/swiperComponent/index.cjs.js +7 -7
  69. package/dist/swiperComponent/index.es.js +60 -58
  70. package/dist/swiperComponent/index.umd.js +9 -9
  71. package/dist/tableComponent/index.cjs.js +1 -1
  72. package/dist/tableComponent/index.es.js +80 -78
  73. package/dist/tableComponent/index.umd.js +1 -1
  74. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  75. package/dist/youtubeAssetProvider/index.es.js +66 -64
  76. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  77. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";var h=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(h||{}),m=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",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.projectFiles="studio:projectFiles",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.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",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))(m||{}),L=(t=>(t.dark="dark",t.light="light",t.auto="auto",t))(L||{});const A="app.grapesjs.com",I="app-stage.grapesjs.com",R=[A,I,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],G="license:check:start",M="license:check:end",B=()=>typeof window<"u",N=({isDev:t,isStage:n})=>`${t?"":`https://${n?I:A}`}/api`,S=()=>{const t=B()&&window.location.hostname;return!!t&&(R.includes(t)||R.some(n=>t.endsWith(n)))};async function U({path:t,baseApiUrl:n,method:o="GET",headers:r={},params:i,body:l}){const c=`${n||N({isDev:!1,isStage:!1})}${t}`,a={method:o,headers:{"Content-Type":"application/json",...r}};l&&(a.body=JSON.stringify(l));const u=i?new URLSearchParams(i).toString():"",e=u?`?${u}`:"",s=await fetch(`${c}${e}`,a);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}const P={[h.free]:0,[h.startup]:10,[h.business]:20,[h.enterprise]:30};function W(t){const n=t;return n.init=o=>r=>t(r,o),n}const j=t=>W(t);async function F({editor:t,plan:n,pluginName:o,licenseKey:r,cleanup:i}){let l="",g=!1;const c=S(),a=e=>{console.warn("Cleanup plugin:",o,"Reason:",e),i()},u=(e={})=>{var v;const{error:s,sdkLicense:d}=e,b=(v=e.plan)==null?void 0:v.category;if(!(d||e.license)||s)a(s||"Invalid license");else if(b){const E=P[n],x=P[b];E>x&&a({pluginRequiredPlan:n,licensePlan:b})}};t.on(G,e=>{l=e==null?void 0:e.baseApiUrl,g=!0}),t.on(M,e=>{u(e)}),setTimeout(async()=>{if(!g){if(c)return;if(r){const e=await $({licenseKey:r,pluginName:o,baseApiUrl:l});e&&u(e)}else a("The `licenseKey` option not provided")}},2e3)}async function $(t){const{licenseKey:n,pluginName:o,baseApiUrl:r}=t;try{return(await U({baseApiUrl:r,path:`/sdk/${n||"na"}`,method:"POST",params:{d:window.location.hostname,pn:o}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const C=(t,n,o)=>{const{doc:r=document}=o,i=o.target||r.head,l=i.querySelector(`style[${t}]`)||r.createElement("style");l.setAttribute(t,"true"),l.innerHTML=n,!i.contains(l)&&i.appendChild(l)},K=t=>t.dispatchEvent(new CustomEvent("input"));function q(t,n){if(!n)return()=>{};const o=t.Components.events,r=e=>t.getSelectedAll().includes(e),i=e=>e.isInstanceOf("text")&&!e.isChildOf("text"),l=e=>e.isChildOf("text"),g=e=>t.getEditing()===e,c=(e,s={})=>{e.trigger("focus",s.event)},a=(e,s)=>{r(e)&&i(e)&&!g(e)&&c(e,s)},u=(e,s)=>{if(r(e)&&!i(e)&&l(e)){const d=e.parents().find(b=>b.isInstanceOf("text"));d&&(c(d,s),setTimeout(()=>t.select(d),0))}};return t.on(o.select,a),t.on(o.selectBefore,u),()=>{t.off(o.select,a),t.off(o.selectBefore,u)}}const H="rteTinyMce",z=h.startup,V=`
1
+ "use strict";var h=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(h||{}),m=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",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.projectFiles="studio:projectFiles",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.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",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))(m||{}),A=(t=>(t.dark="dark",t.light="light",t.auto="auto",t))(A||{});const L="app.grapesjs.com",O="app-stage.grapesjs.com",M="app2.grapesjs.com",G="app-stage2.grapesjs.com",R=[L,M,O,G,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],N="license:check:start",B="license:check:end",S=()=>typeof window<"u",U=({isDev:t,isStage:n})=>`${t?"":`https://${n?O:L}`}/api`,j=()=>{const t=S()&&window.location.hostname;return!!t&&(R.includes(t)||R.some(n=>t.endsWith(n)))};async function W({path:t,baseApiUrl:n,method:o="GET",headers:r={},params:i,body:l}){const c=`${n||U({isDev:!1,isStage:!1})}${t}`,a={method:o,headers:{"Content-Type":"application/json",...r}};l&&(a.body=JSON.stringify(l));const u=i?new URLSearchParams(i).toString():"",e=u?`?${u}`:"",s=await fetch(`${c}${e}`,a);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}const _={[h.free]:0,[h.startup]:10,[h.business]:20,[h.enterprise]:30};function F(t){const n=t;return n.init=o=>r=>t(r,o),n}const $=t=>F(t);async function C({editor:t,plan:n,pluginName:o,licenseKey:r,cleanup:i}){let l="",g=!1;const c=j(),a=e=>{console.warn("Cleanup plugin:",o,"Reason:",e),i()},u=(e={})=>{var v;const{error:s,sdkLicense:d}=e,b=(v=e.plan)==null?void 0:v.category;if(!(d||e.license)||s)a(s||"Invalid license");else if(b){const E=_[n],x=_[b];E>x&&a({pluginRequiredPlan:n,licensePlan:b})}};t.on(N,e=>{l=e==null?void 0:e.baseApiUrl,g=!0}),t.on(B,e=>{u(e)}),setTimeout(async()=>{if(!g){if(c)return;if(r){const e=await K({licenseKey:r,pluginName:o,baseApiUrl:l});e&&u(e)}else a("The `licenseKey` option not provided")}},2e3)}async function K(t){const{licenseKey:n,pluginName:o,baseApiUrl:r}=t;try{return(await W({baseApiUrl:r,path:`/sdk/${n||"na"}`,method:"POST",params:{d:window.location.hostname,pn:o}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const q=(t,n,o)=>{const{doc:r=document}=o,i=o.target||r.head,l=i.querySelector(`style[${t}]`)||r.createElement("style");l.setAttribute(t,"true"),l.innerHTML=n,!i.contains(l)&&i.appendChild(l)},H=t=>t.dispatchEvent(new CustomEvent("input"));function z(t,n){if(!n)return()=>{};const o=t.Components.events,r=e=>t.getSelectedAll().includes(e),i=e=>e.isInstanceOf("text")&&!e.isChildOf("text"),l=e=>e.isChildOf("text"),g=e=>t.getEditing()===e,c=(e,s={})=>{e.trigger("focus",s.event)},a=(e,s)=>{r(e)&&i(e)&&!g(e)&&c(e,s)},u=(e,s)=>{if(r(e)&&!i(e)&&l(e)){const d=e.parents().find(b=>b.isInstanceOf("text"));d&&(c(d,s),setTimeout(()=>t.select(d),0))}};return t.on(o.select,a),t.on(o.selectBefore,u),()=>{t.off(o.select,a),t.off(o.selectBefore,u)}}const V="rteTinyMce",J=h.startup,X=`
2
2
  .tox .tox-toolbar,
3
3
  .tox .tox-toolbar__overflow,
4
4
  .tox .tox-toolbar__primary,
@@ -101,4 +101,4 @@
101
101
  background-color: var(--gs-theme-cl-prm-bg1);
102
102
  border-color: var(--gs-theme-cl-prm-bg3);
103
103
  opacity: 0.75;
104
- }`,T=new WeakMap,J=(t,n)=>{T.set(t,n)},X=t=>{T.delete(t)},w=t=>T.get(t),y=t=>{const n=t.target,o=n.closest(".tox"),r=n.matches(".ephox-snooker-resizer-bar");(o||r)&&t.stopPropagation()},_=t=>{t.stopPropagation(),t.preventDefault()},Y=(t,n)=>{const o=t.getDoc(),r=t.getWin();if(n!=null&&n.event){const{event:i}=n,{clientX:l,clientY:g}=i;let c;if(o.caretRangeFromPoint)c=o.caretRangeFromPoint(l,g);else if(o.caretPositionFromPoint){const a=o.caretPositionFromPoint(l,g);c=o.createRange(),c==null||c.setStart(a.offsetNode,a.offset)}if(c){const a=r.getSelection();a==null||a.removeAllRanges(),a==null||a.addRange(c),t.selection.setRng(c)}}else t.execCommand("SelectAll")},Q=t=>{var u,e;const{el:n,editor:o,componentView:r}=t,i=o.runCommand(m.getStateTheme),l=r.model,g={target:n,inline:!0,skin:(i==null?void 0:i.theme)===L.dark?"oxide-dark":"oxide",menubar:!1,image_advtab:!0,paste_data_images:!0,statusbar:!1,branding:!1,forced_root_block:"div",plugins:"advlist autolink lists link image media table",toolbar_mode:"sliding",toolbar:"bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify link image | fontfamily fontsize bullist numlist outdent indent table"},c=((e=(u=t.pluginOpts)==null?void 0:u.loadConfig)==null?void 0:e.call(u,{config:g,editor:o,componentView:r,component:l}))||{};return{...g,...c}},D=(t,n=document)=>new Promise((o,r)=>{const i=Array.isArray(t)?[...t]:[t],{head:l}=n,g=c=>{if(c.length){const a=n.createElement("script");a.src=c.shift(),a.onload=g.bind(null,c),a.onerror=r,l.appendChild(a)}else o()};g(i)}),Z=function(t,n={}){const o={cdnScript:"https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",...n},{cdnScript:r}=o,i=t.Canvas.events,l=!o.skipCustomTheme,g="gs-plg-tinymce-studio-theme",c=async(e,s)=>{const d=e.ownerDocument,b=d.defaultView,f=s==null?void 0:s.view;if(!b||!f){console.warn("Missing required data",{win:b,componentView:f});return}const v=Q({el:e,editor:t,componentView:f,pluginOpts:o}),x=(await b.tinymce.init(v))[0];if(!x)return;const O=(await window.tinymce.init({...v,target:document.createElement("div")}))[0];return x.ui.show(),d.body.addEventListener("mousedown",y),document.body.addEventListener("mousedown",y),x.on("Change",()=>K(e)),x.on("blur",()=>x.ui.show()),x.on("OpenWindow",function(){var k;const p=(k=d.querySelector(".tox-dialog"))==null?void 0:k.closest(".tox");p&&(p==null?void 0:p.ownerDocument)!==document&&(document.body.appendChild(p),x.once("CloseWindow",()=>{p&&p.ownerDocument===document&&d.body.appendChild(p)}))}),e.addEventListener("dragstart",_,{capture:!0}),t.runCommand(m.setStateContextMenu,{enabled:!1}),Y(x,s),{rteEditor:x,rteEditorShallow:O}},a=(e,s)=>{e.ownerDocument.body.removeEventListener("mousedown",y),document.body.removeEventListener("mousedown",y),e.removeEventListener("dragstart",_,{capture:!0}),t.runCommand(m.setStateContextMenu,{enabled:!0}),s.rteEditor.destroy(),s.rteEditorShallow.destroy()};t.on(i.frameLoad,async({window:e})=>{const s=e.document;D(r,s)}),t.onReady(()=>{D(r,document),l&&C(g,V,{target:document.body})}),t.setCustomRte({parseContent:!0,async enable(e,s,d){const b=w(e);if(b)return b.rteEditor;const f=await c(e,d);return f&&J(e,f),f==null?void 0:f.rteEditor},disable(e){const s=w(e);s&&(X(e),a(e,s))},getContent(e){var d,b;const s=w(e);return s?(b=(d=s.rteEditor).getContent)==null?void 0:b.call(d):e.innerHTML}});const u=q(t,o.enableOnClick);F({editor:t,licenseKey:o.licenseKey,plan:z,pluginName:H,cleanup:()=>{t.RichTextEditor.customRte=void 0,u()}})},tt=j(Z);module.exports=tt;
104
+ }`,T=new WeakMap,Y=(t,n)=>{T.set(t,n)},Q=t=>{T.delete(t)},w=t=>T.get(t),y=t=>{const n=t.target,o=n.closest(".tox"),r=n.matches(".ephox-snooker-resizer-bar");(o||r)&&t.stopPropagation()},P=t=>{t.stopPropagation(),t.preventDefault()},Z=(t,n)=>{const o=t.getDoc(),r=t.getWin();if(n!=null&&n.event){const{event:i}=n,{clientX:l,clientY:g}=i;let c;if(o.caretRangeFromPoint)c=o.caretRangeFromPoint(l,g);else if(o.caretPositionFromPoint){const a=o.caretPositionFromPoint(l,g);c=o.createRange(),c==null||c.setStart(a.offsetNode,a.offset)}if(c){const a=r.getSelection();a==null||a.removeAllRanges(),a==null||a.addRange(c),t.selection.setRng(c)}}else t.execCommand("SelectAll")},tt=t=>{var u,e;const{el:n,editor:o,componentView:r}=t,i=o.runCommand(m.getStateTheme),l=r.model,g={target:n,inline:!0,skin:(i==null?void 0:i.theme)===A.dark?"oxide-dark":"oxide",menubar:!1,image_advtab:!0,paste_data_images:!0,statusbar:!1,branding:!1,forced_root_block:"div",plugins:"advlist autolink lists link image media table",toolbar_mode:"sliding",toolbar:"bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify link image | fontfamily fontsize bullist numlist outdent indent table"},c=((e=(u=t.pluginOpts)==null?void 0:u.loadConfig)==null?void 0:e.call(u,{config:g,editor:o,componentView:r,component:l}))||{};return{...g,...c}},D=(t,n=document)=>new Promise((o,r)=>{const i=Array.isArray(t)?[...t]:[t],{head:l}=n,g=c=>{if(c.length){const a=n.createElement("script");a.src=c.shift(),a.onload=g.bind(null,c),a.onerror=r,l.appendChild(a)}else o()};g(i)}),et=function(t,n={}){const o={cdnScript:"https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",...n},{cdnScript:r}=o,i=t.Canvas.events,l=!o.skipCustomTheme,g="gs-plg-tinymce-studio-theme",c=async(e,s)=>{const d=e.ownerDocument,b=d.defaultView,p=s==null?void 0:s.view;if(!b||!p){console.warn("Missing required data",{win:b,componentView:p});return}const v=tt({el:e,editor:t,componentView:p,pluginOpts:o}),x=(await b.tinymce.init(v))[0];if(!x)return;const I=(await window.tinymce.init({...v,target:document.createElement("div")}))[0];return x.ui.show(),d.body.addEventListener("mousedown",y),document.body.addEventListener("mousedown",y),x.on("Change",()=>H(e)),x.on("blur",()=>x.ui.show()),x.on("OpenWindow",function(){var k;const f=(k=d.querySelector(".tox-dialog"))==null?void 0:k.closest(".tox");f&&(f==null?void 0:f.ownerDocument)!==document&&(document.body.appendChild(f),x.once("CloseWindow",()=>{f&&f.ownerDocument===document&&d.body.appendChild(f)}))}),e.addEventListener("dragstart",P,{capture:!0}),t.runCommand(m.setStateContextMenu,{enabled:!1}),Z(x,s),{rteEditor:x,rteEditorShallow:I}},a=(e,s)=>{e.ownerDocument.body.removeEventListener("mousedown",y),document.body.removeEventListener("mousedown",y),e.removeEventListener("dragstart",P,{capture:!0}),t.runCommand(m.setStateContextMenu,{enabled:!0}),s.rteEditor.destroy(),s.rteEditorShallow.destroy()};t.on(i.frameLoad,async({window:e})=>{const s=e.document;D(r,s)}),t.onReady(()=>{D(r,document),l&&q(g,X,{target:document.body})}),t.setCustomRte({parseContent:!0,async enable(e,s,d){const b=w(e);if(b)return b.rteEditor;const p=await c(e,d);return p&&Y(e,p),p==null?void 0:p.rteEditor},disable(e){const s=w(e);s&&(Q(e),a(e,s))},getContent(e){var d,b;const s=w(e);return s?(b=(d=s.rteEditor).getContent)==null?void 0:b.call(d):e.innerHTML}});const u=z(t,o.enableOnClick);C({editor:t,licenseKey:o.licenseKey,plan:J,pluginName:V,cleanup:()=>{t.RichTextEditor.customRte=void 0,u()}})},ot=$(et);module.exports=ot;
@@ -1,7 +1,9 @@
1
- var h = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(h || {}), m = /* @__PURE__ */ ((t) => (t.toastAdd = "studio:toastAdd", t.toastRemove = "studio:toastRemove", t.dialogOpen = "studio:dialogOpen", t.dialogClose = "studio:dialogClose", 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.projectFiles = "studio:projectFiles", 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.getStateTheme = "studio:getStateTheme", t.setStateTheme = "studio:setStateTheme", 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))(m || {}), L = /* @__PURE__ */ ((t) => (t.dark = "dark", t.light = "light", t.auto = "auto", t))(L || {});
2
- const A = "app.grapesjs.com", I = "app-stage.grapesjs.com", R = [
3
- A,
4
- I,
1
+ var h = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(h || {}), m = /* @__PURE__ */ ((t) => (t.toastAdd = "studio:toastAdd", t.toastRemove = "studio:toastRemove", t.dialogOpen = "studio:dialogOpen", t.dialogClose = "studio:dialogClose", 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.projectFiles = "studio:projectFiles", 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.getStateTheme = "studio:getStateTheme", t.setStateTheme = "studio:setStateTheme", 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))(m || {}), A = /* @__PURE__ */ ((t) => (t.dark = "dark", t.light = "light", t.auto = "auto", t))(A || {});
2
+ const L = "app.grapesjs.com", O = "app-stage.grapesjs.com", M = "app2.grapesjs.com", G = "app-stage2.grapesjs.com", R = [
3
+ L,
4
+ M,
5
+ O,
6
+ G,
5
7
  "localhost",
6
8
  "127.0.0.1",
7
9
  ".local-credentialless.webcontainer.io",
@@ -10,11 +12,11 @@ const A = "app.grapesjs.com", I = "app-stage.grapesjs.com", R = [
10
12
  // For stackblitz.com demos
11
13
  "-sandpack.codesandbox.io"
12
14
  // For Sandpack demos
13
- ], G = "license:check:start", M = "license:check:end", B = () => typeof window < "u", N = ({ isDev: t, isStage: n }) => `${t ? "" : `https://${n ? I : A}`}/api`, S = () => {
14
- const t = B() && window.location.hostname;
15
+ ], N = "license:check:start", B = "license:check:end", S = () => typeof window < "u", U = ({ isDev: t, isStage: n }) => `${t ? "" : `https://${n ? O : L}`}/api`, j = () => {
16
+ const t = S() && window.location.hostname;
15
17
  return !!t && (R.includes(t) || R.some((n) => t.endsWith(n)));
16
18
  };
17
- async function U({
19
+ async function W({
18
20
  path: t,
19
21
  baseApiUrl: n,
20
22
  method: o = "GET",
@@ -22,7 +24,7 @@ async function U({
22
24
  params: i,
23
25
  body: l
24
26
  }) {
25
- const c = `${n || N({ isDev: !1, isStage: !1 })}${t}`, a = {
27
+ const c = `${n || U({ isDev: !1, isStage: !1 })}${t}`, a = {
26
28
  method: o,
27
29
  headers: {
28
30
  "Content-Type": "application/json",
@@ -35,18 +37,18 @@ async function U({
35
37
  throw new Error(`HTTP error! status: ${s.status}`);
36
38
  return s.json();
37
39
  }
38
- const P = {
40
+ const _ = {
39
41
  [h.free]: 0,
40
42
  [h.startup]: 10,
41
43
  [h.business]: 20,
42
44
  [h.enterprise]: 30
43
45
  };
44
- function W(t) {
46
+ function F(t) {
45
47
  const n = t;
46
48
  return n.init = (o) => (r) => t(r, o), n;
47
49
  }
48
- const j = (t) => /* @__PURE__ */ W(t);
49
- async function F({
50
+ const $ = (t) => /* @__PURE__ */ F(t);
51
+ async function C({
50
52
  editor: t,
51
53
  plan: n,
52
54
  pluginName: o,
@@ -54,7 +56,7 @@ async function F({
54
56
  cleanup: i
55
57
  }) {
56
58
  let l = "", g = !1;
57
- const c = S(), a = (e) => {
59
+ const c = j(), a = (e) => {
58
60
  console.warn("Cleanup plugin:", o, "Reason:", e), i();
59
61
  }, u = (e = {}) => {
60
62
  var v;
@@ -62,29 +64,29 @@ async function F({
62
64
  if (!(d || e.license) || s)
63
65
  a(s || "Invalid license");
64
66
  else if (b) {
65
- const E = P[n], x = P[b];
67
+ const E = _[n], x = _[b];
66
68
  E > x && a({ pluginRequiredPlan: n, licensePlan: b });
67
69
  }
68
70
  };
69
- t.on(G, (e) => {
71
+ t.on(N, (e) => {
70
72
  l = e == null ? void 0 : e.baseApiUrl, g = !0;
71
- }), t.on(M, (e) => {
73
+ }), t.on(B, (e) => {
72
74
  u(e);
73
75
  }), setTimeout(async () => {
74
76
  if (!g) {
75
77
  if (c) return;
76
78
  if (r) {
77
- const e = await $({ licenseKey: r, pluginName: o, baseApiUrl: l });
79
+ const e = await K({ licenseKey: r, pluginName: o, baseApiUrl: l });
78
80
  e && u(e);
79
81
  } else
80
82
  a("The `licenseKey` option not provided");
81
83
  }
82
84
  }, 2e3);
83
85
  }
84
- async function $(t) {
86
+ async function K(t) {
85
87
  const { licenseKey: n, pluginName: o, baseApiUrl: r } = t;
86
88
  try {
87
- return (await U({
89
+ return (await W({
88
90
  baseApiUrl: r,
89
91
  path: `/sdk/${n || "na"}`,
90
92
  method: "POST",
@@ -97,11 +99,11 @@ async function $(t) {
97
99
  return console.error("Error during SDK license check:", i), !1;
98
100
  }
99
101
  }
100
- const C = (t, n, o) => {
102
+ const q = (t, n, o) => {
101
103
  const { doc: r = document } = o, i = o.target || r.head, l = i.querySelector(`style[${t}]`) || r.createElement("style");
102
104
  l.setAttribute(t, "true"), l.innerHTML = n, !i.contains(l) && i.appendChild(l);
103
- }, K = (t) => t.dispatchEvent(new CustomEvent("input"));
104
- function q(t, n) {
105
+ }, H = (t) => t.dispatchEvent(new CustomEvent("input"));
106
+ function z(t, n) {
105
107
  if (!n) return () => {
106
108
  };
107
109
  const o = t.Components.events, r = (e) => t.getSelectedAll().includes(e), i = (e) => e.isInstanceOf("text") && !e.isChildOf("text"), l = (e) => e.isChildOf("text"), g = (e) => t.getEditing() === e, c = (e, s = {}) => {
@@ -118,7 +120,7 @@ function q(t, n) {
118
120
  t.off(o.select, a), t.off(o.selectBefore, u);
119
121
  };
120
122
  }
121
- const H = "rteTinyMce", z = h.startup, V = `
123
+ const V = "rteTinyMce", J = h.startup, X = `
122
124
  .tox .tox-toolbar,
123
125
  .tox .tox-toolbar__overflow,
124
126
  .tox .tox-toolbar__primary,
@@ -221,16 +223,16 @@ const H = "rteTinyMce", z = h.startup, V = `
221
223
  background-color: var(--gs-theme-cl-prm-bg1);
222
224
  border-color: var(--gs-theme-cl-prm-bg3);
223
225
  opacity: 0.75;
224
- }`, T = /* @__PURE__ */ new WeakMap(), J = (t, n) => {
226
+ }`, T = /* @__PURE__ */ new WeakMap(), Y = (t, n) => {
225
227
  T.set(t, n);
226
- }, X = (t) => {
228
+ }, Q = (t) => {
227
229
  T.delete(t);
228
230
  }, w = (t) => T.get(t), y = (t) => {
229
231
  const n = t.target, o = n.closest(".tox"), r = n.matches(".ephox-snooker-resizer-bar");
230
232
  (o || r) && t.stopPropagation();
231
- }, _ = (t) => {
233
+ }, P = (t) => {
232
234
  t.stopPropagation(), t.preventDefault();
233
- }, Y = (t, n) => {
235
+ }, Z = (t, n) => {
234
236
  const o = t.getDoc(), r = t.getWin();
235
237
  if (n != null && n.event) {
236
238
  const { event: i } = n, { clientX: l, clientY: g } = i;
@@ -247,12 +249,12 @@ const H = "rteTinyMce", z = h.startup, V = `
247
249
  }
248
250
  } else
249
251
  t.execCommand("SelectAll");
250
- }, Q = (t) => {
252
+ }, tt = (t) => {
251
253
  var u, e;
252
254
  const { el: n, editor: o, componentView: r } = t, i = o.runCommand(m.getStateTheme), l = r.model, g = {
253
255
  target: n,
254
256
  inline: !0,
255
- skin: (i == null ? void 0 : i.theme) === L.dark ? "oxide-dark" : "oxide",
257
+ skin: (i == null ? void 0 : i.theme) === A.dark ? "oxide-dark" : "oxide",
256
258
  menubar: !1,
257
259
  image_advtab: !0,
258
260
  paste_data_images: !0,
@@ -280,54 +282,54 @@ const H = "rteTinyMce", z = h.startup, V = `
280
282
  o();
281
283
  };
282
284
  g(i);
283
- }), Z = function(t, n = {}) {
285
+ }), et = function(t, n = {}) {
284
286
  const o = {
285
287
  cdnScript: "https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",
286
288
  ...n
287
289
  }, { cdnScript: r } = o, i = t.Canvas.events, l = !o.skipCustomTheme, g = "gs-plg-tinymce-studio-theme", c = async (e, s) => {
288
- const d = e.ownerDocument, b = d.defaultView, f = s == null ? void 0 : s.view;
289
- if (!b || !f) {
290
- console.warn("Missing required data", { win: b, componentView: f });
290
+ const d = e.ownerDocument, b = d.defaultView, p = s == null ? void 0 : s.view;
291
+ if (!b || !p) {
292
+ console.warn("Missing required data", { win: b, componentView: p });
291
293
  return;
292
294
  }
293
- const v = Q({
295
+ const v = tt({
294
296
  el: e,
295
297
  editor: t,
296
- componentView: f,
298
+ componentView: p,
297
299
  pluginOpts: o
298
300
  }), x = (await b.tinymce.init(v))[0];
299
301
  if (!x) return;
300
- const O = (await window.tinymce.init({
302
+ const I = (await window.tinymce.init({
301
303
  ...v,
302
304
  target: document.createElement("div")
303
305
  }))[0];
304
- return x.ui.show(), d.body.addEventListener("mousedown", y), document.body.addEventListener("mousedown", y), x.on("Change", () => K(e)), x.on("blur", () => x.ui.show()), x.on("OpenWindow", function() {
306
+ return x.ui.show(), d.body.addEventListener("mousedown", y), document.body.addEventListener("mousedown", y), x.on("Change", () => H(e)), x.on("blur", () => x.ui.show()), x.on("OpenWindow", function() {
305
307
  var k;
306
- const p = (k = d.querySelector(".tox-dialog")) == null ? void 0 : k.closest(".tox");
307
- p && (p == null ? void 0 : p.ownerDocument) !== document && (document.body.appendChild(p), x.once("CloseWindow", () => {
308
- p && p.ownerDocument === document && d.body.appendChild(p);
308
+ const f = (k = d.querySelector(".tox-dialog")) == null ? void 0 : k.closest(".tox");
309
+ f && (f == null ? void 0 : f.ownerDocument) !== document && (document.body.appendChild(f), x.once("CloseWindow", () => {
310
+ f && f.ownerDocument === document && d.body.appendChild(f);
309
311
  }));
310
- }), e.addEventListener("dragstart", _, { capture: !0 }), t.runCommand(m.setStateContextMenu, { enabled: !1 }), Y(x, s), { rteEditor: x, rteEditorShallow: O };
312
+ }), e.addEventListener("dragstart", P, { capture: !0 }), t.runCommand(m.setStateContextMenu, { enabled: !1 }), Z(x, s), { rteEditor: x, rteEditorShallow: I };
311
313
  }, a = (e, s) => {
312
- e.ownerDocument.body.removeEventListener("mousedown", y), document.body.removeEventListener("mousedown", y), e.removeEventListener("dragstart", _, { capture: !0 }), t.runCommand(m.setStateContextMenu, { enabled: !0 }), s.rteEditor.destroy(), s.rteEditorShallow.destroy();
314
+ e.ownerDocument.body.removeEventListener("mousedown", y), document.body.removeEventListener("mousedown", y), e.removeEventListener("dragstart", P, { capture: !0 }), t.runCommand(m.setStateContextMenu, { enabled: !0 }), s.rteEditor.destroy(), s.rteEditorShallow.destroy();
313
315
  };
314
316
  t.on(i.frameLoad, async ({ window: e }) => {
315
317
  const s = e.document;
316
318
  D(r, s);
317
319
  }), t.onReady(() => {
318
- D(r, document), l && C(g, V, { target: document.body });
320
+ D(r, document), l && q(g, X, { target: document.body });
319
321
  }), t.setCustomRte({
320
322
  parseContent: !0,
321
323
  // @ts-expect-error - Type 'CustomRteOptions' is missing the following properties from type 'CustomRteOptions': editor, component, el
322
324
  async enable(e, s, d) {
323
325
  const b = w(e);
324
326
  if (b) return b.rteEditor;
325
- const f = await c(e, d);
326
- return f && J(e, f), f == null ? void 0 : f.rteEditor;
327
+ const p = await c(e, d);
328
+ return p && Y(e, p), p == null ? void 0 : p.rteEditor;
327
329
  },
328
330
  disable(e) {
329
331
  const s = w(e);
330
- s && (X(e), a(e, s));
332
+ s && (Q(e), a(e, s));
331
333
  },
332
334
  getContent(e) {
333
335
  var d, b;
@@ -335,17 +337,17 @@ const H = "rteTinyMce", z = h.startup, V = `
335
337
  return s ? (b = (d = s.rteEditor).getContent) == null ? void 0 : b.call(d) : e.innerHTML;
336
338
  }
337
339
  });
338
- const u = q(t, o.enableOnClick);
339
- F({
340
+ const u = z(t, o.enableOnClick);
341
+ C({
340
342
  editor: t,
341
343
  licenseKey: o.licenseKey,
342
- plan: z,
343
- pluginName: H,
344
+ plan: J,
345
+ pluginName: V,
344
346
  cleanup: () => {
345
347
  t.RichTextEditor.customRte = void 0, u();
346
348
  }
347
349
  });
348
- }, nt = j(Z);
350
+ }, rt = $(et);
349
351
  export {
350
- nt as default
352
+ rt as default
351
353
  };
@@ -1,4 +1,4 @@
1
- (function(f,h){typeof exports=="object"&&typeof module<"u"?module.exports=h():typeof define=="function"&&define.amd?define(h):(f=typeof globalThis<"u"?globalThis:f||self,f.StudioSdkPlugins_rteTinyMce=h())})(this,function(){"use strict";var f=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(f||{}),h=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",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.projectFiles="studio:projectFiles",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.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",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))(h||{}),k=(t=>(t.dark="dark",t.light="light",t.auto="auto",t))(k||{});const E="app.grapesjs.com",R="app-stage.grapesjs.com",P=[E,R,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],O="license:check:start",M="license:check:end",G=()=>typeof window<"u",B=({isDev:t,isStage:n})=>`${t?"":`https://${n?R:E}`}/api`,S=()=>{const t=G()&&window.location.hostname;return!!t&&(P.includes(t)||P.some(n=>t.endsWith(n)))};async function N({path:t,baseApiUrl:n,method:o="GET",headers:r={},params:a,body:l}){const c=`${n||B({isDev:!1,isStage:!1})}${t}`,i={method:o,headers:{"Content-Type":"application/json",...r}};l&&(i.body=JSON.stringify(l));const u=a?new URLSearchParams(a).toString():"",e=u?`?${u}`:"",s=await fetch(`${c}${e}`,i);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}const _={[f.free]:0,[f.startup]:10,[f.business]:20,[f.enterprise]:30};function U(t){const n=t;return n.init=o=>r=>t(r,o),n}const W=t=>U(t);async function j({editor:t,plan:n,pluginName:o,licenseKey:r,cleanup:a}){let l="",g=!1;const c=S(),i=e=>{console.warn("Cleanup plugin:",o,"Reason:",e),a()},u=(e={})=>{var y;const{error:s,sdkLicense:d}=e,b=(y=e.plan)==null?void 0:y.category;if(!(d||e.license)||s)i(s||"Invalid license");else if(b){const A=_[n],x=_[b];A>x&&i({pluginRequiredPlan:n,licensePlan:b})}};t.on(O,e=>{l=e==null?void 0:e.baseApiUrl,g=!0}),t.on(M,e=>{u(e)}),setTimeout(async()=>{if(!g){if(c)return;if(r){const e=await F({licenseKey:r,pluginName:o,baseApiUrl:l});e&&u(e)}else i("The `licenseKey` option not provided")}},2e3)}async function F(t){const{licenseKey:n,pluginName:o,baseApiUrl:r}=t;try{return(await N({baseApiUrl:r,path:`/sdk/${n||"na"}`,method:"POST",params:{d:window.location.hostname,pn:o}})).result||{}}catch(a){return console.error("Error during SDK license check:",a),!1}}const $=(t,n,o)=>{const{doc:r=document}=o,a=o.target||r.head,l=a.querySelector(`style[${t}]`)||r.createElement("style");l.setAttribute(t,"true"),l.innerHTML=n,!a.contains(l)&&a.appendChild(l)},C=t=>t.dispatchEvent(new CustomEvent("input"));function K(t,n){if(!n)return()=>{};const o=t.Components.events,r=e=>t.getSelectedAll().includes(e),a=e=>e.isInstanceOf("text")&&!e.isChildOf("text"),l=e=>e.isChildOf("text"),g=e=>t.getEditing()===e,c=(e,s={})=>{e.trigger("focus",s.event)},i=(e,s)=>{r(e)&&a(e)&&!g(e)&&c(e,s)},u=(e,s)=>{if(r(e)&&!a(e)&&l(e)){const d=e.parents().find(b=>b.isInstanceOf("text"));d&&(c(d,s),setTimeout(()=>t.select(d),0))}};return t.on(o.select,i),t.on(o.selectBefore,u),()=>{t.off(o.select,i),t.off(o.selectBefore,u)}}const q="rteTinyMce",H=f.startup,z=`
1
+ (function(f,h){typeof exports=="object"&&typeof module<"u"?module.exports=h():typeof define=="function"&&define.amd?define(h):(f=typeof globalThis<"u"?globalThis:f||self,f.StudioSdkPlugins_rteTinyMce=h())})(this,function(){"use strict";var f=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(f||{}),h=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",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.projectFiles="studio:projectFiles",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.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",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))(h||{}),E=(t=>(t.dark="dark",t.light="light",t.auto="auto",t))(E||{});const k="app.grapesjs.com",R="app-stage.grapesjs.com",_=[k,"app2.grapesjs.com",R,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],I="license:check:start",M="license:check:end",G=()=>typeof window<"u",N=({isDev:t,isStage:n})=>`${t?"":`https://${n?R:k}`}/api`,S=()=>{const t=G()&&window.location.hostname;return!!t&&(_.includes(t)||_.some(n=>t.endsWith(n)))};async function B({path:t,baseApiUrl:n,method:o="GET",headers:r={},params:a,body:l}){const c=`${n||N({isDev:!1,isStage:!1})}${t}`,i={method:o,headers:{"Content-Type":"application/json",...r}};l&&(i.body=JSON.stringify(l));const u=a?new URLSearchParams(a).toString():"",e=u?`?${u}`:"",s=await fetch(`${c}${e}`,i);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}const P={[f.free]:0,[f.startup]:10,[f.business]:20,[f.enterprise]:30};function j(t){const n=t;return n.init=o=>r=>t(r,o),n}const U=t=>j(t);async function W({editor:t,plan:n,pluginName:o,licenseKey:r,cleanup:a}){let l="",g=!1;const c=S(),i=e=>{console.warn("Cleanup plugin:",o,"Reason:",e),a()},u=(e={})=>{var y;const{error:s,sdkLicense:d}=e,b=(y=e.plan)==null?void 0:y.category;if(!(d||e.license)||s)i(s||"Invalid license");else if(b){const L=P[n],x=P[b];L>x&&i({pluginRequiredPlan:n,licensePlan:b})}};t.on(I,e=>{l=e==null?void 0:e.baseApiUrl,g=!0}),t.on(M,e=>{u(e)}),setTimeout(async()=>{if(!g){if(c)return;if(r){const e=await F({licenseKey:r,pluginName:o,baseApiUrl:l});e&&u(e)}else i("The `licenseKey` option not provided")}},2e3)}async function F(t){const{licenseKey:n,pluginName:o,baseApiUrl:r}=t;try{return(await B({baseApiUrl:r,path:`/sdk/${n||"na"}`,method:"POST",params:{d:window.location.hostname,pn:o}})).result||{}}catch(a){return console.error("Error during SDK license check:",a),!1}}const $=(t,n,o)=>{const{doc:r=document}=o,a=o.target||r.head,l=a.querySelector(`style[${t}]`)||r.createElement("style");l.setAttribute(t,"true"),l.innerHTML=n,!a.contains(l)&&a.appendChild(l)},C=t=>t.dispatchEvent(new CustomEvent("input"));function K(t,n){if(!n)return()=>{};const o=t.Components.events,r=e=>t.getSelectedAll().includes(e),a=e=>e.isInstanceOf("text")&&!e.isChildOf("text"),l=e=>e.isChildOf("text"),g=e=>t.getEditing()===e,c=(e,s={})=>{e.trigger("focus",s.event)},i=(e,s)=>{r(e)&&a(e)&&!g(e)&&c(e,s)},u=(e,s)=>{if(r(e)&&!a(e)&&l(e)){const d=e.parents().find(b=>b.isInstanceOf("text"));d&&(c(d,s),setTimeout(()=>t.select(d),0))}};return t.on(o.select,i),t.on(o.selectBefore,u),()=>{t.off(o.select,i),t.off(o.selectBefore,u)}}const q="rteTinyMce",H=f.startup,z=`
2
2
  .tox .tox-toolbar,
3
3
  .tox .tox-toolbar__overflow,
4
4
  .tox .tox-toolbar__primary,
@@ -101,4 +101,4 @@
101
101
  background-color: var(--gs-theme-cl-prm-bg1);
102
102
  border-color: var(--gs-theme-cl-prm-bg3);
103
103
  opacity: 0.75;
104
- }`,w=new WeakMap,V=(t,n)=>{w.set(t,n)},J=t=>{w.delete(t)},T=t=>w.get(t),m=t=>{const n=t.target,o=n.closest(".tox"),r=n.matches(".ephox-snooker-resizer-bar");(o||r)&&t.stopPropagation()},D=t=>{t.stopPropagation(),t.preventDefault()},X=(t,n)=>{const o=t.getDoc(),r=t.getWin();if(n!=null&&n.event){const{event:a}=n,{clientX:l,clientY:g}=a;let c;if(o.caretRangeFromPoint)c=o.caretRangeFromPoint(l,g);else if(o.caretPositionFromPoint){const i=o.caretPositionFromPoint(l,g);c=o.createRange(),c==null||c.setStart(i.offsetNode,i.offset)}if(c){const i=r.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(c),t.selection.setRng(c)}}else t.execCommand("SelectAll")},Y=t=>{var u,e;const{el:n,editor:o,componentView:r}=t,a=o.runCommand(h.getStateTheme),l=r.model,g={target:n,inline:!0,skin:(a==null?void 0:a.theme)===k.dark?"oxide-dark":"oxide",menubar:!1,image_advtab:!0,paste_data_images:!0,statusbar:!1,branding:!1,forced_root_block:"div",plugins:"advlist autolink lists link image media table",toolbar_mode:"sliding",toolbar:"bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify link image | fontfamily fontsize bullist numlist outdent indent table"},c=((e=(u=t.pluginOpts)==null?void 0:u.loadConfig)==null?void 0:e.call(u,{config:g,editor:o,componentView:r,component:l}))||{};return{...g,...c}},L=(t,n=document)=>new Promise((o,r)=>{const a=Array.isArray(t)?[...t]:[t],{head:l}=n,g=c=>{if(c.length){const i=n.createElement("script");i.src=c.shift(),i.onload=g.bind(null,c),i.onerror=r,l.appendChild(i)}else o()};g(a)});return W(function(t,n={}){const o={cdnScript:"https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",...n},{cdnScript:r}=o,a=t.Canvas.events,l=!o.skipCustomTheme,g="gs-plg-tinymce-studio-theme",c=async(e,s)=>{const d=e.ownerDocument,b=d.defaultView,p=s==null?void 0:s.view;if(!b||!p){console.warn("Missing required data",{win:b,componentView:p});return}const y=Y({el:e,editor:t,componentView:p,pluginOpts:o}),x=(await b.tinymce.init(y))[0];if(!x)return;const Q=(await window.tinymce.init({...y,target:document.createElement("div")}))[0];return x.ui.show(),d.body.addEventListener("mousedown",m),document.body.addEventListener("mousedown",m),x.on("Change",()=>C(e)),x.on("blur",()=>x.ui.show()),x.on("OpenWindow",function(){var I;const v=(I=d.querySelector(".tox-dialog"))==null?void 0:I.closest(".tox");v&&(v==null?void 0:v.ownerDocument)!==document&&(document.body.appendChild(v),x.once("CloseWindow",()=>{v&&v.ownerDocument===document&&d.body.appendChild(v)}))}),e.addEventListener("dragstart",D,{capture:!0}),t.runCommand(h.setStateContextMenu,{enabled:!1}),X(x,s),{rteEditor:x,rteEditorShallow:Q}},i=(e,s)=>{e.ownerDocument.body.removeEventListener("mousedown",m),document.body.removeEventListener("mousedown",m),e.removeEventListener("dragstart",D,{capture:!0}),t.runCommand(h.setStateContextMenu,{enabled:!0}),s.rteEditor.destroy(),s.rteEditorShallow.destroy()};t.on(a.frameLoad,async({window:e})=>{const s=e.document;L(r,s)}),t.onReady(()=>{L(r,document),l&&$(g,z,{target:document.body})}),t.setCustomRte({parseContent:!0,async enable(e,s,d){const b=T(e);if(b)return b.rteEditor;const p=await c(e,d);return p&&V(e,p),p==null?void 0:p.rteEditor},disable(e){const s=T(e);s&&(J(e),i(e,s))},getContent(e){var d,b;const s=T(e);return s?(b=(d=s.rteEditor).getContent)==null?void 0:b.call(d):e.innerHTML}});const u=K(t,o.enableOnClick);j({editor:t,licenseKey:o.licenseKey,plan:H,pluginName:q,cleanup:()=>{t.RichTextEditor.customRte=void 0,u()}})})});
104
+ }`,w=new WeakMap,V=(t,n)=>{w.set(t,n)},J=t=>{w.delete(t)},T=t=>w.get(t),m=t=>{const n=t.target,o=n.closest(".tox"),r=n.matches(".ephox-snooker-resizer-bar");(o||r)&&t.stopPropagation()},D=t=>{t.stopPropagation(),t.preventDefault()},X=(t,n)=>{const o=t.getDoc(),r=t.getWin();if(n!=null&&n.event){const{event:a}=n,{clientX:l,clientY:g}=a;let c;if(o.caretRangeFromPoint)c=o.caretRangeFromPoint(l,g);else if(o.caretPositionFromPoint){const i=o.caretPositionFromPoint(l,g);c=o.createRange(),c==null||c.setStart(i.offsetNode,i.offset)}if(c){const i=r.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(c),t.selection.setRng(c)}}else t.execCommand("SelectAll")},Y=t=>{var u,e;const{el:n,editor:o,componentView:r}=t,a=o.runCommand(h.getStateTheme),l=r.model,g={target:n,inline:!0,skin:(a==null?void 0:a.theme)===E.dark?"oxide-dark":"oxide",menubar:!1,image_advtab:!0,paste_data_images:!0,statusbar:!1,branding:!1,forced_root_block:"div",plugins:"advlist autolink lists link image media table",toolbar_mode:"sliding",toolbar:"bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify link image | fontfamily fontsize bullist numlist outdent indent table"},c=((e=(u=t.pluginOpts)==null?void 0:u.loadConfig)==null?void 0:e.call(u,{config:g,editor:o,componentView:r,component:l}))||{};return{...g,...c}},A=(t,n=document)=>new Promise((o,r)=>{const a=Array.isArray(t)?[...t]:[t],{head:l}=n,g=c=>{if(c.length){const i=n.createElement("script");i.src=c.shift(),i.onload=g.bind(null,c),i.onerror=r,l.appendChild(i)}else o()};g(a)});return U(function(t,n={}){const o={cdnScript:"https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",...n},{cdnScript:r}=o,a=t.Canvas.events,l=!o.skipCustomTheme,g="gs-plg-tinymce-studio-theme",c=async(e,s)=>{const d=e.ownerDocument,b=d.defaultView,p=s==null?void 0:s.view;if(!b||!p){console.warn("Missing required data",{win:b,componentView:p});return}const y=Y({el:e,editor:t,componentView:p,pluginOpts:o}),x=(await b.tinymce.init(y))[0];if(!x)return;const Q=(await window.tinymce.init({...y,target:document.createElement("div")}))[0];return x.ui.show(),d.body.addEventListener("mousedown",m),document.body.addEventListener("mousedown",m),x.on("Change",()=>C(e)),x.on("blur",()=>x.ui.show()),x.on("OpenWindow",function(){var O;const v=(O=d.querySelector(".tox-dialog"))==null?void 0:O.closest(".tox");v&&(v==null?void 0:v.ownerDocument)!==document&&(document.body.appendChild(v),x.once("CloseWindow",()=>{v&&v.ownerDocument===document&&d.body.appendChild(v)}))}),e.addEventListener("dragstart",D,{capture:!0}),t.runCommand(h.setStateContextMenu,{enabled:!1}),X(x,s),{rteEditor:x,rteEditorShallow:Q}},i=(e,s)=>{e.ownerDocument.body.removeEventListener("mousedown",m),document.body.removeEventListener("mousedown",m),e.removeEventListener("dragstart",D,{capture:!0}),t.runCommand(h.setStateContextMenu,{enabled:!0}),s.rteEditor.destroy(),s.rteEditorShallow.destroy()};t.on(a.frameLoad,async({window:e})=>{const s=e.document;A(r,s)}),t.onReady(()=>{A(r,document),l&&$(g,z,{target:document.body})}),t.setCustomRte({parseContent:!0,async enable(e,s,d){const b=T(e);if(b)return b.rteEditor;const p=await c(e,d);return p&&V(e,p),p==null?void 0:p.rteEditor},disable(e){const s=T(e);s&&(J(e),i(e,s))},getContent(e){var d,b;const s=T(e);return s?(b=(d=s.rteEditor).getContent)==null?void 0:b.call(d):e.innerHTML}});const u=K(t,o.enableOnClick);W({editor:t,licenseKey:o.licenseKey,plan:H,pluginName:q,cleanup:()=>{t.RichTextEditor.customRte=void 0,u()}})})});
@@ -1,4 +1,4 @@
1
- "use strict";const Q="app.grapesjs.com",ee="app-stage.grapesjs.com",H=[Q,ee,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],te="license:check:start",ae="license:check:end",le=()=>typeof window<"u",se=({isDev:e,isStage:l})=>`${e?"":`https://${l?ee:Q}`}/api`,ne=()=>{const e=le()&&window.location.hostname;return!!e&&(H.includes(e)||H.some(l=>e.endsWith(l)))},ie=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(l,a)=>(a?"-":"")+l.toLowerCase()),oe=e=>typeof e<"u";async function re({path:e,baseApiUrl:l,method:a="GET",headers:s={},params:i,body:b}){const f=`${l||se({isDev:!1,isStage:!1})}${e}`,d={method:a,headers:{"Content-Type":"application/json",...s}};b&&(d.body=JSON.stringify(b));const u=i?new URLSearchParams(i).toString():"",o=u?`?${u}`:"",h=await fetch(`${f}${o}`,d);if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);return h.json()}var T=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(T||{});const G={[T.free]:0,[T.startup]:10,[T.business]:20,[T.enterprise]:30};function ce(e){const l=e;return l.init=a=>s=>e(s,a),l}const de=e=>ce(e);async function pe({editor:e,plan:l,pluginName:a,licenseKey:s,cleanup:i}){let b="",c=!1;const f=ne(),d=o=>{console.warn("Cleanup plugin:",a,"Reason:",o),i()},u=(o={})=>{var S;const{error:h,sdkLicense:t}=o,n=(S=o.plan)==null?void 0:S.category;if(!(t||o.license)||h)d(h||"Invalid license");else if(n){const R=G[l],$=G[n];R>$&&d({pluginRequiredPlan:l,licensePlan:n})}};e.on(te,o=>{b=o==null?void 0:o.baseApiUrl,c=!0}),e.on(ae,o=>{u(o)}),setTimeout(async()=>{if(!c){if(f)return;if(s){const o=await ue({licenseKey:s,pluginName:a,baseApiUrl:b});o&&u(o)}else d("The `licenseKey` option not provided")}},2e3)}async function ue(e){const{licenseKey:l,pluginName:a,baseApiUrl:s}=e;try{return(await re({baseApiUrl:s,path:`/sdk/${l||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const P=(e,l)=>{var a;return!!((a=e==null?void 0:e.classList)!=null&&a.contains(l))},be=(e,l={})=>{var b;const a={},s=[],i=[];for(const c in e){const{value:f,...d}=e[c];s.push({id:c,name:c,changeProp:!0,category:l.category,...d}),a[c]=f,!oe(f)&&i.push(c);const{subTraits:u={}}=d;for(const o in d.subTraits)(b=u[o])==null||b.forEach(h=>{const t=h.id||h.name;a[t]=h.value})}return{propKeys:Object.keys(a),propsNoValues:i,props:a,traits:s}},fe=(e,l)=>{l.forEach(a=>{if(a.subTraits){const s=`${a.id||a.name}`,i=a.changeProp?`change:${s}`:`change:attributes:${s}`;e.on(i,()=>U(e,s)),U(e,s)}})},U=(e,l)=>{const a=e.getTrait(l),s=a.get("category"),i=a.get("subTraits")||{},c=(Object.values(i).flat()||[]).map(u=>u.id||u.name);e.removeTrait(c);const f=i[a.getValue()],d=e.getTraitIndex(l)+1;f&&e.addTrait(f.map(u=>({category:s,...u})),{at:d})},he=(e,l)=>{l.forEach(a=>{const s=ie(a);s!==a&&e.has(s)&&e.set({[a]:e.get(s),[s]:void 0})})},m="swiper",M=`${m}-slide`,x=`${m}-wrapper`,L=`${m}-nav-prev`,V=`${m}-nav-next`,k=`${m}-pagination`,N=`${m}-scrollbar`,p={slider:`<svg viewBox="0 0 24 24">
1
+ "use strict";const Q="app.grapesjs.com",ee="app-stage.grapesjs.com",te="app2.grapesjs.com",ae="app-stage2.grapesjs.com",H=[Q,te,ee,ae,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],le="license:check:start",se="license:check:end",ne=()=>typeof window<"u",ie=({isDev:e,isStage:l})=>`${e?"":`https://${l?ee:Q}`}/api`,oe=()=>{const e=ne()&&window.location.hostname;return!!e&&(H.includes(e)||H.some(l=>e.endsWith(l)))},re=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(l,a)=>(a?"-":"")+l.toLowerCase()),ce=e=>typeof e<"u";async function de({path:e,baseApiUrl:l,method:a="GET",headers:s={},params:i,body:b}){const f=`${l||ie({isDev:!1,isStage:!1})}${e}`,d={method:a,headers:{"Content-Type":"application/json",...s}};b&&(d.body=JSON.stringify(b));const u=i?new URLSearchParams(i).toString():"",o=u?`?${u}`:"",h=await fetch(`${f}${o}`,d);if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);return h.json()}var T=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(T||{});const G={[T.free]:0,[T.startup]:10,[T.business]:20,[T.enterprise]:30};function pe(e){const l=e;return l.init=a=>s=>e(s,a),l}const ue=e=>pe(e);async function be({editor:e,plan:l,pluginName:a,licenseKey:s,cleanup:i}){let b="",c=!1;const f=oe(),d=o=>{console.warn("Cleanup plugin:",a,"Reason:",o),i()},u=(o={})=>{var S;const{error:h,sdkLicense:t}=o,n=(S=o.plan)==null?void 0:S.category;if(!(t||o.license)||h)d(h||"Invalid license");else if(n){const O=G[l],D=G[n];O>D&&d({pluginRequiredPlan:l,licensePlan:n})}};e.on(le,o=>{b=o==null?void 0:o.baseApiUrl,c=!0}),e.on(se,o=>{u(o)}),setTimeout(async()=>{if(!c){if(f)return;if(s){const o=await fe({licenseKey:s,pluginName:a,baseApiUrl:b});o&&u(o)}else d("The `licenseKey` option not provided")}},2e3)}async function fe(e){const{licenseKey:l,pluginName:a,baseApiUrl:s}=e;try{return(await de({baseApiUrl:s,path:`/sdk/${l||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const P=(e,l)=>{var a;return!!((a=e==null?void 0:e.classList)!=null&&a.contains(l))},he=(e,l={})=>{var b;const a={},s=[],i=[];for(const c in e){const{value:f,...d}=e[c];s.push({id:c,name:c,changeProp:!0,category:l.category,...d}),a[c]=f,!ce(f)&&i.push(c);const{subTraits:u={}}=d;for(const o in d.subTraits)(b=u[o])==null||b.forEach(h=>{const t=h.id||h.name;a[t]=h.value})}return{propKeys:Object.keys(a),propsNoValues:i,props:a,traits:s}},ve=(e,l)=>{l.forEach(a=>{if(a.subTraits){const s=`${a.id||a.name}`,i=a.changeProp?`change:${s}`:`change:attributes:${s}`;e.on(i,()=>U(e,s)),U(e,s)}})},U=(e,l)=>{const a=e.getTrait(l),s=a.get("category"),i=a.get("subTraits")||{},c=(Object.values(i).flat()||[]).map(u=>u.id||u.name);e.removeTrait(c);const f=i[a.getValue()],d=e.getTraitIndex(l)+1;f&&e.addTrait(f.map(u=>({category:s,...u})),{at:d})},me=(e,l)=>{l.forEach(a=>{const s=re(a);s!==a&&e.has(s)&&e.set({[a]:e.get(s),[s]:void 0})})},m="swiper",M=`${m}-slide`,x=`${m}-wrapper`,L=`${m}-nav-prev`,V=`${m}-nav-next`,k=`${m}-pagination`,N=`${m}-scrollbar`,p={slider:`<svg viewBox="0 0 24 24">
2
2
  <path d="M22 7.6c0-1-.5-1.6-1.3-1.6H3.4C2.5 6 2 6.7 2 7.6v9.8c0 1 .5 1.6 1.3 1.6h17.4c.8 0 1.3-.6 1.3-1.6V7.6zM21 18H3V7h18v11z" fill-rule="nonzero"/>
3
3
  <path d="M4 12.5L6 14v-3zM20 12.5L18 14v-3z"/>
4
4
  </svg>`,effect:`<svg viewBox="0 0 24 24">
@@ -21,25 +21,25 @@
21
21
  <path d="M2 12c0 5 4 9 9 9 2.4 0 4.7-1 6.4-2.6l-1.5-1.5A6.7 6.7 0 0 1 11 19a7 7 0 1 1 7-7h-3l4 4h.1l3.9-4h-3a9 9 0 0 0-18 0Z"/>
22
22
  </svg>`,prev:'<svg viewBox="0 0 24 24"><path d="M15.4 16.6 10.8 12l4.6-4.6L14 6l-6 6 6 6 1.4-1.4Z"/></svg>',next:'<svg viewBox="0 0 24 24"><path d="m8.6 16.6 4.6-4.6-4.6-4.6L10 6l6 6-6 6-1.4-1.4Z"/></svg>',add:`<svg viewBox="0 0 24 24">
23
23
  <path d="M12 20a8 8 0 1 1 0-16 8 8 0 0 1 0 16m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m1 5h-2v4H7v2h4v4h2v-4h4v-2h-4V7Z"/>
24
- </svg>`},j={id:"swiper-responsive",label:"Responsive",icon:p.responsive},K={id:"swiper-extra",label:"Extra",icon:p.extra},ve={actions:{type:"radio",label:!1,labelToTitle:!0,options:[{id:"r",label:"Reload slider",icon:p.reload},{id:"p",label:"Previous slide",icon:p.prev},{id:"n",label:"Next slide",icon:p.next},{id:"a",label:"Add new slide",icon:p.add}],setValue:({component:e,value:l})=>{var s;const a=(s=e.getView())==null?void 0:s.getSwiper();switch(l){case"r":e.reloadSlider();break;case"p":a==null||a.slidePrev();break;case"n":a==null||a.slideNext();break;case"a":e.addSlide();break}}},vertical:{type:"checkbox",label:"Vertical",value:!1},loop:{type:"checkbox",label:"Loop",value:!1},freeMode:{type:"checkbox",label:"Free mode",value:!1},autoHeight:{type:"checkbox",label:"Auto height",value:!1},navigation:{type:"checkbox",label:"Navigation",getValue:({component:e})=>!!e.findFirstType(L),setValue:({component:e,value:l})=>{var a,s;l?e.append([{type:L},{type:V}]):((a=e.findFirstType(L))==null||a.remove(),(s=e.findFirstType(V))==null||s.remove()),e.set({navigation:l})}},initialSlide:{type:"number",label:"Initial slide",min:0,value:"0"},speed:{type:"number",label:"Speed",tip:"Transition duration (in ms)",step:500,min:0,value:300},effect:{category:{id:"swiper-effect",label:"Effects",icon:p.effect},type:"select",label:"Effect Type",value:"slide",options:[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"cube",label:"Cube"},{id:"coverflow",label:"Coverflow"},{id:"flip",label:"Flip"},{id:"cards",label:"Cards"}],subTraits:{slide:[{type:"number",name:"slidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"slidesPerGroup",label:"Slides per group",tip:"Numbers of slides for group sliding",changeProp:!0,min:1,value:1},{type:"number",name:"spaceBetween",label:"Space between",tip:"Distance between slides in px",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetBefore",label:"Slides offset before",tip:"Add additional slide offset in the beginning of the container (in px, before all slides)",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetAfter",label:"Slides offset after",tip:"Add additional slide offset in the end of the container (in px, after all slides)",changeProp:!0,min:0,value:0},{type:"checkbox",name:"centeredSlides",label:"Centered slides",tip:"If enabled, the active slide will be centered",changeProp:!0,value:!1}],fade:[{type:"checkbox",name:"crossFade",tip:"Enables slides cross fade",label:"Cross fade",changeProp:!0,value:!1}],cube:[{type:"checkbox",name:"cubeEffectShadow",label:"Shadow",changeProp:!0,value:!0},{type:"checkbox",name:"cubeEffectSlideShadows",label:"Slide shadows",changeProp:!0,value:!0},{type:"number",name:"cubeEffectShadowOffset",label:"Shadow offset",changeProp:!0,value:20},{type:"number",name:"cubeEffectShadowScale",label:"Shadow scale",changeProp:!0,value:.94}],coverflow:[{type:"number",name:"coverflowEffectDepth",tip:"Depth offset in px (slides translate in Z axis)",label:"Depth",changeProp:!0,min:0,value:100},{type:"number",name:"coverflowEffectModifier",tip:"Effect multiplier",label:"Modifier",changeProp:!0,step:.1,min:0,value:1},{type:"number",name:"coverflowEffectRotate",tip:"Slide rotate in degrees",label:"Rotate",changeProp:!0,min:0,value:50},{type:"number",name:"coverflowEffectScale",tip:"Slide scale effect",label:"Scale",changeProp:!0,min:0,step:.1,value:1},{type:"number",name:"coverflowEffectStretch",tip:"Stretch space between slides (in px)",label:"Stretch",changeProp:!0,min:0,value:0},{type:"checkbox",name:"coverflowEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadow",changeProp:!0,value:!0}],flip:[{type:"checkbox",name:"flipEffectLimitRotation",tip:"Limit edge slides rotation",label:"Limit rotation",changeProp:!0,value:!0},{type:"checkbox",name:"flipEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}],cards:[{type:"number",name:"cardsEffectPerSlideOffset",tip:"Offset distance per slide (in px)",label:"Slide offset",changeProp:!0,min:0,value:8},{type:"number",name:"cardsEffectPerSlideRotate",tip:"Rotate angle per slide (in degrees)",label:"Slide rotate",changeProp:!0,min:0,value:2},{type:"checkbox",name:"cardsEffectRotate",tip:"Enables cards rotation",label:"Rotate",changeProp:!0,value:!0},{type:"checkbox",name:"cardsEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}]}},autoplay:{category:{id:"swiper-autoplay",label:"Autoplay",icon:p.autoplay},type:"checkbox",label:"Enable Autoplay",value:!1,subTraits:{true:[{type:"number",name:"autoplayDelay",label:"Delay",changeProp:!0,value:3e3},{type:"checkbox",name:"autoplayDisableOnInteraction",label:"Disable on interaction",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayWaitForTransition",label:"Wait for transition",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayPauseOnMouseEnter",label:"Pause on mouse enter",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayReverseDirection",label:"Reverse direction",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayStopOnLastSlide",label:"Stop on last slide",changeProp:!0,value:!1}]}},pagination:{category:{id:"swiper-pagination",label:"Pagination",icon:p.pagination},type:"select",label:"Pagination Type",options:[{id:"none",label:"None"},{id:"bullets",label:"Bullets"},{id:"progressbar",label:"Progressbar"},{id:"fraction",label:"Fraction"}],getValue:({component:e})=>e.findFirstType(k)?e.get("pagination")||"bullets":"none",setValue:({component:e,value:l})=>{const a=e.findFirstType(k);a==null||a.remove(),l!=="none"&&e.append({type:k}),e.set({pagination:l})},subTraits:{bullets:[{type:"checkbox",name:"dynamicBullets",label:"Dynamic bullets",changeProp:!0,value:!1},{type:"checkbox",name:"clickableBullets",label:"Clickable bullets",changeProp:!0,value:!0}],progressbar:[{type:"checkbox",name:"progressbarOpposite",label:"Progress opposite",changeProp:!0,value:!1}]}},scrollbar:{category:{id:"swiper-scrollbar",label:"Scrollbar",icon:p.scrollbar},type:"checkbox",label:"Enable Scrollbar",getValue:({component:e})=>!!e.findFirstType(N),setValue:({component:e,value:l})=>{const a=e.findFirstType(N);a==null||a.remove(),l&&e.append({type:N}),e.set({scrollbar:l})},subTraits:{false:[],true:[{type:"checkbox",name:"scrollbarDraggable",label:"Draggable",changeProp:!0,value:!1},{type:"checkbox",name:"scrollbarHide",label:"Hide",tip:"Hide scrollbar automatically after user interaction",changeProp:!0,value:!0}]}},parallax:{category:{id:"swiper-parallax",label:"Parallax",icon:p.parallax},type:"checkbox",label:"Enable Parallax",value:!1},mobile:{category:j,type:"checkbox",label:"Enable mobile breakpoint",value:!1,subTraits:{true:[{type:"number",name:"mobileBreakpoint",label:"Mobile breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:460},{type:"number",name:"mobileSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},tablet:{category:j,type:"checkbox",label:"Enable tablet breakpoint",value:!1,subTraits:{true:[{type:"number",name:"tabletBreakpoint",label:"Tablet breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:991},{type:"number",name:"tabletSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},allowTouchMove:{category:K,type:"checkbox",label:"Allow touch move",tip:"Allow touch interactions",value:!0},grabCursor:{category:K,type:"checkbox",label:"Grab cursor",tip:'If enabled, the user will see the "grab" cursor when hover the slider',value:!1}},Z="Slider",q="swiper",C=`${q}-`,me=(e,l)=>{const{Components:a,Blocks:s,Commands:i}=e,{block:b}=l,c=be(ve),f="core:preview",d=i.events,u=function(t){const n=this,A=window,S=n.__onLoad,R=n.__activeSlide,$=n.__inPreview,{cdnScript:D,cdnStyle:I,slidesPerView:F}=t||{},r=v=>isNaN(v)?void 0:parseFloat(v),z=()=>{const v={loop:t.loop,speed:t.speed,initialSlide:t.initialSlide,direction:t.vertical?"vertical":"horizontal",effect:t.effect,freeMode:t.freeMode,parallax:t.parallax,autoHeight:t.autoHeight,allowTouchMove:t.allowTouchMove,grabCursor:t.grabCursor,simulateTouch:!0,breakpoints:{},slidesPerView:isNaN(F)?F:r(F),slidesPerGroup:r(t.slidesPerGroup),spaceBetween:r(t.spaceBetween),slidesOffsetBefore:r(t.slidesOffsetBefore),slidesOffsetAfter:r(t.slidesOffsetAfter),centeredSlides:t.centeredSlides,fadeEffect:{crossFade:t.crossFade},cubeEffect:{shadow:t.cubeEffectShadow,slideShadows:t.cubeEffectSlideShadows,shadowOffset:r(t.cubeEffectShadowOffset),shadowScale:r(t.cubeEffectShadowScale)},coverflowEffect:{depth:r(t.coverflowEffectDepth),modifier:r(t.coverflowEffectModifier),rotate:r(t.coverflowEffectRotate),scale:r(t.coverflowEffectScale),stretch:r(t.coverflowEffectStretch),slideShadows:t.coverflowEffectSlideShadows},flipEffect:{limitRotation:t.flipEffectLimitRotation,slideShadows:t.flipEffectSlideShadows},cardsEffect:{perSlideOffset:r(t.cardsEffectPerSlideOffset),perSlideRotate:r(t.cardsEffectPerSlideRotate),rotate:t.cardsEffectRotate,slideShadows:t.cardsEffectSlideShadows},navigation:{nextEl:n.querySelector(".swiper-button-next"),prevEl:n.querySelector(".swiper-button-prev")},pagination:{type:t.pagination||"bullets",dynamicBullets:t.dynamicBullets,clickable:t.clickableBullets,progressbarOpposite:t.progressbarOpposite,el:n.querySelector(".swiper-pagination")},scrollbar:{el:n.querySelector(".swiper-scrollbar"),draggable:t.scrollbarDraggable,hide:t.scrollbarHide},autoplay:t.autoplay&&{delay:t.autoplayDelay,disableOnInteraction:t.autoplayDisableOnInteraction,pauseOnMouseEnter:t.autoplayPauseOnMouseEnter,reverseDirection:t.autoplayReverseDirection,stopOnLastSlide:t.autoplayStopOnLastSlide,waitForTransition:t.autoplayWaitForTransition}};if(t.tablet){const{tabletBreakpoint:_,tabletSlidesPerView:g}=t,E=r(_);v.breakpoints[E]={slidesPerView:isNaN(g)?g:r(g),slidesPerGroup:r(t.tabletSlidesPerGroup),spaceBetween:r(t.tabletSpaceBetween)}}if(t.mobile){const{mobileBreakpoint:_,mobileSlidesPerView:g}=t,E=r(_);v.breakpoints[E]={slidesPerView:isNaN(g)?g:r(g),slidesPerGroup:r(t.mobileSlidesPerGroup),spaceBetween:r(t.mobileSpaceBetween)}}S&&!$&&(v.simulateTouch=!1),R&&(v.initialSlide=R);const W=new A.Swiper(n,v);S==null||S(W)};if(A.Swiper)z();else{const{head:v}=document,W=Array.isArray(D)?[...D]:[D],_=Array.isArray(I)?[...I]:[I],g=w=>{if(w.length){const y=document.createElement("link");y.href=w.shift(),y.rel="stylesheet",v.appendChild(y),g(w)}},E=w=>{if(w.length){const y=document.createElement("script");y.src=w.shift(),y.onerror=y.onload=E.bind(null,w),v.appendChild(y)}else z()};g(_),E(W)}},o=(t=0)=>({type:M,style:{padding:"50px"},components:{type:"text",components:{type:"textnode",content:`Slide ${t}`}}}),h=a.getType("default").model;return a.addType(m,{block:b&&{label:Z,media:p.slider,category:"Extra",select:!0,...l.block},isComponent:t=>P(t,q),model:{defaults:()=>({name:Z,icon:p.slider,classes:q,draggable:(t,n)=>!n.is(m),components:[{type:x,components:[o(1),o(2),o(3)]},{type:k}],script:u,cdnScript:l.cdnScript,cdnStyle:l.cdnStyle,"script-props":["cdnScript","cdnStyle",...c.propKeys],...c.props,traits:[...c.traits]}),init(){const{em:t}=this;fe(this,c.traits),he(this,c.propKeys),this.listenTo(t,`${d.runCommand}${f}`,this.onPreviewOn),this.listenTo(t,`${d.stopCommand}${f}`,this.onPreviewOff)},onPreviewOn(){this.__inPreview=!0,this.reloadSlider()},onPreviewOff(){this.__inPreview=!1,this.reloadSlider()},reloadSlider(){this.trigger("rerender")},addSlide(){const t=this.findFirstType(x);t==null||t.append(this.getNewSlideComponentDef())},getNewSlideComponentDef(){var n;const t=((n=this.findFirstType(x))==null?void 0:n.components().length)||0;return{type:M,components:{type:"text",components:{type:"textnode",content:`Slide ${t+1}`}}}},toJSON(...t){const n=h.prototype.toJSON.apply(this,t);return c.propsNoValues.forEach(A=>delete n[A]),delete n["script-props"],n}},view:{init(){this.listenTo(this.model,a.events.scriptUnmount,this.destroySwiper)},getSwiper(){return this.el.swiper},destroySwiper(){var t;(t=this.getSwiper())==null||t.destroy()},onRender(){const t=this.el;t.__onLoad=n=>n.on("slideChange",()=>this.__activeSlide=n.activeIndex),t.__activeSlide=this.__activeSlide,t.__inPreview=this.model.__inPreview}}}),()=>{a.removeType(m),s.remove(m)}},ge="Nav Prev",ye="Nav Next",O=`${C}button-prev`,B=`${C}button-next`,Se=e=>{const{Components:l}=e,a=s=>({type:"svg",selectable:!1,hoverable:!1,attributes:{viewBox:"0 0 27 44"},components:{type:"svg-in",tagName:"path",attributes:{d:s,fill:"currentColor"}}});return l.addType(L,{isComponent:s=>P(s,O),model:{defaults:{name:ge,classes:O,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,components:a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),styles:`
25
- .${O} {
24
+ </svg>`},j={id:"swiper-responsive",label:"Responsive",icon:p.responsive},K={id:"swiper-extra",label:"Extra",icon:p.extra},ge={actions:{type:"radio",label:!1,labelToTitle:!0,options:[{id:"r",label:"Reload slider",icon:p.reload},{id:"p",label:"Previous slide",icon:p.prev},{id:"n",label:"Next slide",icon:p.next},{id:"a",label:"Add new slide",icon:p.add}],setValue:({component:e,value:l})=>{var s;const a=(s=e.getView())==null?void 0:s.getSwiper();switch(l){case"r":e.reloadSlider();break;case"p":a==null||a.slidePrev();break;case"n":a==null||a.slideNext();break;case"a":e.addSlide();break}}},vertical:{type:"checkbox",label:"Vertical",value:!1},loop:{type:"checkbox",label:"Loop",value:!1},freeMode:{type:"checkbox",label:"Free mode",value:!1},autoHeight:{type:"checkbox",label:"Auto height",value:!1},navigation:{type:"checkbox",label:"Navigation",getValue:({component:e})=>!!e.findFirstType(L),setValue:({component:e,value:l})=>{var a,s;l?e.append([{type:L},{type:V}]):((a=e.findFirstType(L))==null||a.remove(),(s=e.findFirstType(V))==null||s.remove()),e.set({navigation:l})}},initialSlide:{type:"number",label:"Initial slide",min:0,value:"0"},speed:{type:"number",label:"Speed",tip:"Transition duration (in ms)",step:500,min:0,value:300},effect:{category:{id:"swiper-effect",label:"Effects",icon:p.effect},type:"select",label:"Effect Type",value:"slide",options:[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"cube",label:"Cube"},{id:"coverflow",label:"Coverflow"},{id:"flip",label:"Flip"},{id:"cards",label:"Cards"}],subTraits:{slide:[{type:"number",name:"slidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"slidesPerGroup",label:"Slides per group",tip:"Numbers of slides for group sliding",changeProp:!0,min:1,value:1},{type:"number",name:"spaceBetween",label:"Space between",tip:"Distance between slides in px",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetBefore",label:"Slides offset before",tip:"Add additional slide offset in the beginning of the container (in px, before all slides)",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetAfter",label:"Slides offset after",tip:"Add additional slide offset in the end of the container (in px, after all slides)",changeProp:!0,min:0,value:0},{type:"checkbox",name:"centeredSlides",label:"Centered slides",tip:"If enabled, the active slide will be centered",changeProp:!0,value:!1}],fade:[{type:"checkbox",name:"crossFade",tip:"Enables slides cross fade",label:"Cross fade",changeProp:!0,value:!1}],cube:[{type:"checkbox",name:"cubeEffectShadow",label:"Shadow",changeProp:!0,value:!0},{type:"checkbox",name:"cubeEffectSlideShadows",label:"Slide shadows",changeProp:!0,value:!0},{type:"number",name:"cubeEffectShadowOffset",label:"Shadow offset",changeProp:!0,value:20},{type:"number",name:"cubeEffectShadowScale",label:"Shadow scale",changeProp:!0,value:.94}],coverflow:[{type:"number",name:"coverflowEffectDepth",tip:"Depth offset in px (slides translate in Z axis)",label:"Depth",changeProp:!0,min:0,value:100},{type:"number",name:"coverflowEffectModifier",tip:"Effect multiplier",label:"Modifier",changeProp:!0,step:.1,min:0,value:1},{type:"number",name:"coverflowEffectRotate",tip:"Slide rotate in degrees",label:"Rotate",changeProp:!0,min:0,value:50},{type:"number",name:"coverflowEffectScale",tip:"Slide scale effect",label:"Scale",changeProp:!0,min:0,step:.1,value:1},{type:"number",name:"coverflowEffectStretch",tip:"Stretch space between slides (in px)",label:"Stretch",changeProp:!0,min:0,value:0},{type:"checkbox",name:"coverflowEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadow",changeProp:!0,value:!0}],flip:[{type:"checkbox",name:"flipEffectLimitRotation",tip:"Limit edge slides rotation",label:"Limit rotation",changeProp:!0,value:!0},{type:"checkbox",name:"flipEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}],cards:[{type:"number",name:"cardsEffectPerSlideOffset",tip:"Offset distance per slide (in px)",label:"Slide offset",changeProp:!0,min:0,value:8},{type:"number",name:"cardsEffectPerSlideRotate",tip:"Rotate angle per slide (in degrees)",label:"Slide rotate",changeProp:!0,min:0,value:2},{type:"checkbox",name:"cardsEffectRotate",tip:"Enables cards rotation",label:"Rotate",changeProp:!0,value:!0},{type:"checkbox",name:"cardsEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}]}},autoplay:{category:{id:"swiper-autoplay",label:"Autoplay",icon:p.autoplay},type:"checkbox",label:"Enable Autoplay",value:!1,subTraits:{true:[{type:"number",name:"autoplayDelay",label:"Delay",changeProp:!0,value:3e3},{type:"checkbox",name:"autoplayDisableOnInteraction",label:"Disable on interaction",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayWaitForTransition",label:"Wait for transition",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayPauseOnMouseEnter",label:"Pause on mouse enter",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayReverseDirection",label:"Reverse direction",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayStopOnLastSlide",label:"Stop on last slide",changeProp:!0,value:!1}]}},pagination:{category:{id:"swiper-pagination",label:"Pagination",icon:p.pagination},type:"select",label:"Pagination Type",options:[{id:"none",label:"None"},{id:"bullets",label:"Bullets"},{id:"progressbar",label:"Progressbar"},{id:"fraction",label:"Fraction"}],getValue:({component:e})=>e.findFirstType(k)?e.get("pagination")||"bullets":"none",setValue:({component:e,value:l})=>{const a=e.findFirstType(k);a==null||a.remove(),l!=="none"&&e.append({type:k}),e.set({pagination:l})},subTraits:{bullets:[{type:"checkbox",name:"dynamicBullets",label:"Dynamic bullets",changeProp:!0,value:!1},{type:"checkbox",name:"clickableBullets",label:"Clickable bullets",changeProp:!0,value:!0}],progressbar:[{type:"checkbox",name:"progressbarOpposite",label:"Progress opposite",changeProp:!0,value:!1}]}},scrollbar:{category:{id:"swiper-scrollbar",label:"Scrollbar",icon:p.scrollbar},type:"checkbox",label:"Enable Scrollbar",getValue:({component:e})=>!!e.findFirstType(N),setValue:({component:e,value:l})=>{const a=e.findFirstType(N);a==null||a.remove(),l&&e.append({type:N}),e.set({scrollbar:l})},subTraits:{false:[],true:[{type:"checkbox",name:"scrollbarDraggable",label:"Draggable",changeProp:!0,value:!1},{type:"checkbox",name:"scrollbarHide",label:"Hide",tip:"Hide scrollbar automatically after user interaction",changeProp:!0,value:!0}]}},parallax:{category:{id:"swiper-parallax",label:"Parallax",icon:p.parallax},type:"checkbox",label:"Enable Parallax",value:!1},mobile:{category:j,type:"checkbox",label:"Enable mobile breakpoint",value:!1,subTraits:{true:[{type:"number",name:"mobileBreakpoint",label:"Mobile breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:460},{type:"number",name:"mobileSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},tablet:{category:j,type:"checkbox",label:"Enable tablet breakpoint",value:!1,subTraits:{true:[{type:"number",name:"tabletBreakpoint",label:"Tablet breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:991},{type:"number",name:"tabletSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},allowTouchMove:{category:K,type:"checkbox",label:"Allow touch move",tip:"Allow touch interactions",value:!0},grabCursor:{category:K,type:"checkbox",label:"Grab cursor",tip:'If enabled, the user will see the "grab" cursor when hover the slider',value:!1}},Z="Slider",q="swiper",A=`${q}-`,ye=(e,l)=>{const{Components:a,Blocks:s,Commands:i}=e,{block:b}=l,c=he(ge),f="core:preview",d=i.events,u=function(t){const n=this,C=window,S=n.__onLoad,O=n.__activeSlide,D=n.__inPreview,{cdnScript:$,cdnStyle:I,slidesPerView:F}=t||{},r=v=>isNaN(v)?void 0:parseFloat(v),z=()=>{const v={loop:t.loop,speed:t.speed,initialSlide:t.initialSlide,direction:t.vertical?"vertical":"horizontal",effect:t.effect,freeMode:t.freeMode,parallax:t.parallax,autoHeight:t.autoHeight,allowTouchMove:t.allowTouchMove,grabCursor:t.grabCursor,simulateTouch:!0,breakpoints:{},slidesPerView:isNaN(F)?F:r(F),slidesPerGroup:r(t.slidesPerGroup),spaceBetween:r(t.spaceBetween),slidesOffsetBefore:r(t.slidesOffsetBefore),slidesOffsetAfter:r(t.slidesOffsetAfter),centeredSlides:t.centeredSlides,fadeEffect:{crossFade:t.crossFade},cubeEffect:{shadow:t.cubeEffectShadow,slideShadows:t.cubeEffectSlideShadows,shadowOffset:r(t.cubeEffectShadowOffset),shadowScale:r(t.cubeEffectShadowScale)},coverflowEffect:{depth:r(t.coverflowEffectDepth),modifier:r(t.coverflowEffectModifier),rotate:r(t.coverflowEffectRotate),scale:r(t.coverflowEffectScale),stretch:r(t.coverflowEffectStretch),slideShadows:t.coverflowEffectSlideShadows},flipEffect:{limitRotation:t.flipEffectLimitRotation,slideShadows:t.flipEffectSlideShadows},cardsEffect:{perSlideOffset:r(t.cardsEffectPerSlideOffset),perSlideRotate:r(t.cardsEffectPerSlideRotate),rotate:t.cardsEffectRotate,slideShadows:t.cardsEffectSlideShadows},navigation:{nextEl:n.querySelector(".swiper-button-next"),prevEl:n.querySelector(".swiper-button-prev")},pagination:{type:t.pagination||"bullets",dynamicBullets:t.dynamicBullets,clickable:t.clickableBullets,progressbarOpposite:t.progressbarOpposite,el:n.querySelector(".swiper-pagination")},scrollbar:{el:n.querySelector(".swiper-scrollbar"),draggable:t.scrollbarDraggable,hide:t.scrollbarHide},autoplay:t.autoplay&&{delay:t.autoplayDelay,disableOnInteraction:t.autoplayDisableOnInteraction,pauseOnMouseEnter:t.autoplayPauseOnMouseEnter,reverseDirection:t.autoplayReverseDirection,stopOnLastSlide:t.autoplayStopOnLastSlide,waitForTransition:t.autoplayWaitForTransition}};if(t.tablet){const{tabletBreakpoint:_,tabletSlidesPerView:g}=t,E=r(_);v.breakpoints[E]={slidesPerView:isNaN(g)?g:r(g),slidesPerGroup:r(t.tabletSlidesPerGroup),spaceBetween:r(t.tabletSpaceBetween)}}if(t.mobile){const{mobileBreakpoint:_,mobileSlidesPerView:g}=t,E=r(_);v.breakpoints[E]={slidesPerView:isNaN(g)?g:r(g),slidesPerGroup:r(t.mobileSlidesPerGroup),spaceBetween:r(t.mobileSpaceBetween)}}S&&!D&&(v.simulateTouch=!1),O&&(v.initialSlide=O);const W=new C.Swiper(n,v);S==null||S(W)};if(C.Swiper)z();else{const{head:v}=document,W=Array.isArray($)?[...$]:[$],_=Array.isArray(I)?[...I]:[I],g=w=>{if(w.length){const y=document.createElement("link");y.href=w.shift(),y.rel="stylesheet",v.appendChild(y),g(w)}},E=w=>{if(w.length){const y=document.createElement("script");y.src=w.shift(),y.onerror=y.onload=E.bind(null,w),v.appendChild(y)}else z()};g(_),E(W)}},o=(t=0)=>({type:M,style:{padding:"50px"},components:{type:"text",components:{type:"textnode",content:`Slide ${t}`}}}),h=a.getType("default").model;return a.addType(m,{block:b&&{label:Z,media:p.slider,category:"Extra",select:!0,...l.block},isComponent:t=>P(t,q),model:{defaults:()=>({name:Z,icon:p.slider,classes:q,draggable:(t,n)=>!n.is(m),components:[{type:x,components:[o(1),o(2),o(3)]},{type:k}],script:u,cdnScript:l.cdnScript,cdnStyle:l.cdnStyle,"script-props":["cdnScript","cdnStyle",...c.propKeys],...c.props,traits:[...c.traits]}),init(){const{em:t}=this;ve(this,c.traits),me(this,c.propKeys),this.listenTo(t,`${d.runCommand}${f}`,this.onPreviewOn),this.listenTo(t,`${d.stopCommand}${f}`,this.onPreviewOff)},onPreviewOn(){this.__inPreview=!0,this.reloadSlider()},onPreviewOff(){this.__inPreview=!1,this.reloadSlider()},reloadSlider(){this.trigger("rerender")},addSlide(){const t=this.findFirstType(x);t==null||t.append(this.getNewSlideComponentDef())},getNewSlideComponentDef(){var n;const t=((n=this.findFirstType(x))==null?void 0:n.components().length)||0;return{type:M,components:{type:"text",components:{type:"textnode",content:`Slide ${t+1}`}}}},toJSON(...t){const n=h.prototype.toJSON.apply(this,t);return c.propsNoValues.forEach(C=>delete n[C]),delete n["script-props"],n}},view:{init(){this.listenTo(this.model,a.events.scriptUnmount,this.destroySwiper)},getSwiper(){return this.el.swiper},destroySwiper(){var t;(t=this.getSwiper())==null||t.destroy()},onRender(){const t=this.el;t.__onLoad=n=>n.on("slideChange",()=>this.__activeSlide=n.activeIndex),t.__activeSlide=this.__activeSlide,t.__inPreview=this.model.__inPreview}}}),()=>{a.removeType(m),s.remove(m)}},Se="Nav Prev",we="Nav Next",R=`${A}button-prev`,B=`${A}button-next`,Pe=e=>{const{Components:l}=e,a=s=>({type:"svg",selectable:!1,hoverable:!1,attributes:{viewBox:"0 0 27 44"},components:{type:"svg-in",tagName:"path",attributes:{d:s,fill:"currentColor"}}});return l.addType(L,{isComponent:s=>P(s,R),model:{defaults:{name:Se,classes:R,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,components:a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),styles:`
25
+ .${R} {
26
26
  color: inherit;
27
27
  }
28
- .${O}:after {
28
+ .${R}:after {
29
29
  content: none;
30
30
  }
31
- `}}}),l.addType(V,{extend:L,isComponent:s=>P(s,B),model:{defaults:{name:ye,classes:B,components:a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),styles:`
31
+ `}}}),l.addType(V,{extend:L,isComponent:s=>P(s,B),model:{defaults:{name:we,classes:B,components:a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),styles:`
32
32
  .${B} {
33
33
  color: inherit;
34
34
  }
35
35
  .${B}:after {
36
36
  content: none;
37
37
  }
38
- `}}}),()=>{l.removeType(L),l.removeType(V)}},we=e=>{const{Components:l}=e,a=`${C}pagination`;return l.addType(k,{isComponent:s=>P(s,a),model:{defaults:{name:"Pagination",classes:a,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,styles:`
38
+ `}}}),()=>{l.removeType(L),l.removeType(V)}},Ee=e=>{const{Components:l}=e,a=`${A}pagination`;return l.addType(k,{isComponent:s=>P(s,a),model:{defaults:{name:"Pagination",classes:a,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,styles:`
39
39
  .${a}-bullet-active {
40
40
  background-color: currentColor;
41
41
  }
42
42
  .${a}-progressbar-fill {
43
43
  --swiper-pagination-color: currentColor;
44
44
  }
45
- `}}}),()=>{l.removeType(k)}},Pe="Scrollbar",Y=`${C}scrollbar`,Ee=e=>{const{Components:l}=e;return l.addType(N,{isComponent:a=>P(a,Y),model:{defaults:{name:Pe,classes:Y,copyable:!1,highlightable:!1,removable:!1,selectable:!1,hoverable:!1,layerable:!1,droppable:!1,draggable:!1}}}),()=>{l.removeType(N)}},Te="Slide",X=`${C}slide`,xe=e=>{const{Components:l}=e;return l.addType(M,{isComponent:a=>P(a,X),model:{defaults:{name:Te,classes:X,icon:p.slider,draggable:(a,s)=>s.is(x)}}}),()=>{l.removeType(M)}},Le="Wrapper",J=`${C}wrapper`,ke=e=>{const{Components:l}=e,{events:a}=l;return l.addType(x,{isComponent:s=>P(s,J),model:{defaults:{name:Le,icon:p.slider,classes:J,copyable:!1,removable:!1,draggable:!1,highlightable:!1,droppable:s=>s.is(M)},init(){const s=this.components();this.listenTo(s,"add remove",this.updateSlider)},updateSlider(s){const i=this.closestType(m);if(i){const b=i.getView();i.reloadSlider(),this.em.once(a.scriptMount,()=>{setTimeout(()=>{var c;return(c=b.getSwiper())==null?void 0:c.slideTo(s.index())},100)})}}}}),()=>{l.removeType(x)}},Ce="swiperComponent",Ae=T.startup,_e=function(e,l={}){const a={block:{},cdnScript:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",cdnStyle:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",...l},s=[me(e,a),Se(e),ke(e),xe(e),we(e),Ee(e)];pe({editor:e,plan:Ae,licenseKey:a.licenseKey,pluginName:Ce,cleanup:()=>{s.forEach(i=>i())}})},Ne=de(_e);module.exports=Ne;
45
+ `}}}),()=>{l.removeType(k)}},Te="Scrollbar",Y=`${A}scrollbar`,xe=e=>{const{Components:l}=e;return l.addType(N,{isComponent:a=>P(a,Y),model:{defaults:{name:Te,classes:Y,copyable:!1,highlightable:!1,removable:!1,selectable:!1,hoverable:!1,layerable:!1,droppable:!1,draggable:!1}}}),()=>{l.removeType(N)}},Le="Slide",X=`${A}slide`,ke=e=>{const{Components:l}=e;return l.addType(M,{isComponent:a=>P(a,X),model:{defaults:{name:Le,classes:X,icon:p.slider,draggable:(a,s)=>s.is(x)}}}),()=>{l.removeType(M)}},Ae="Wrapper",J=`${A}wrapper`,Ce=e=>{const{Components:l}=e,{events:a}=l;return l.addType(x,{isComponent:s=>P(s,J),model:{defaults:{name:Ae,icon:p.slider,classes:J,copyable:!1,removable:!1,draggable:!1,highlightable:!1,droppable:s=>s.is(M)},init(){const s=this.components();this.listenTo(s,"add remove",this.updateSlider)},updateSlider(s){const i=this.closestType(m);if(i){const b=i.getView();i.reloadSlider(),this.em.once(a.scriptMount,()=>{setTimeout(()=>{var c;return(c=b.getSwiper())==null?void 0:c.slideTo(s.index())},100)})}}}}),()=>{l.removeType(x)}},_e="swiperComponent",Ne=T.startup,Me=function(e,l={}){const a={block:{},cdnScript:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",cdnStyle:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",...l},s=[ye(e,a),Pe(e),Ce(e),ke(e),Ee(e),xe(e)];be({editor:e,plan:Ne,licenseKey:a.licenseKey,pluginName:_e,cleanup:()=>{s.forEach(i=>i())}})},Oe=ue(Me);module.exports=Oe;