@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +175 -162
  3. package/dist/accordionComponent/index.umd.js +7 -7
  4. package/dist/aiChat/index.cjs.js +64 -64
  5. package/dist/aiChat/index.es.js +5785 -5757
  6. package/dist/aiChat/index.js +64 -64
  7. package/dist/aiChat/index.umd.js +63 -63
  8. package/dist/animationComponent/index.cjs.js +3 -3
  9. package/dist/animationComponent/index.es.js +204 -191
  10. package/dist/animationComponent/index.umd.js +3 -3
  11. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  12. package/dist/canvasAbsoluteMode/index.es.js +183 -170
  13. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  14. package/dist/canvasEmptyState/index.cjs.js +1 -1
  15. package/dist/canvasEmptyState/index.es.js +134 -121
  16. package/dist/canvasEmptyState/index.umd.js +1 -1
  17. package/dist/canvasFullSize/index.cjs.js +9 -9
  18. package/dist/canvasFullSize/index.es.js +165 -152
  19. package/dist/canvasFullSize/index.umd.js +9 -9
  20. package/dist/canvasGridMode/index.cjs.js +5 -5
  21. package/dist/canvasGridMode/index.es.js +245 -232
  22. package/dist/canvasGridMode/index.umd.js +4 -4
  23. package/dist/canvasScreenshot/index.cjs.js +1 -1
  24. package/dist/canvasScreenshot/index.es.js +155 -142
  25. package/dist/canvasScreenshot/index.umd.js +1 -1
  26. package/dist/dataSourceEjs/index.cjs.js +9 -9
  27. package/dist/dataSourceEjs/index.es.js +257 -244
  28. package/dist/dataSourceEjs/index.umd.js +9 -9
  29. package/dist/dataSourceHandlebars/index.cjs.js +8 -8
  30. package/dist/dataSourceHandlebars/index.es.js +216 -203
  31. package/dist/dataSourceHandlebars/index.umd.js +7 -7
  32. package/dist/dialogComponent/index.cjs.js +14 -14
  33. package/dist/dialogComponent/index.es.js +141 -128
  34. package/dist/dialogComponent/index.umd.js +14 -14
  35. package/dist/flexComponent/index.cjs.js +13 -13
  36. package/dist/flexComponent/index.es.js +484 -471
  37. package/dist/flexComponent/index.umd.js +13 -13
  38. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  39. package/dist/fsLightboxComponent/index.es.js +173 -160
  40. package/dist/fsLightboxComponent/index.umd.js +3 -3
  41. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  42. package/dist/googleFontsAssetProvider/index.es.js +160 -147
  43. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  44. package/dist/iconifyComponent/index.cjs.js +2 -2
  45. package/dist/iconifyComponent/index.es.js +196 -183
  46. package/dist/iconifyComponent/index.umd.js +2 -2
  47. package/dist/index.cjs.js +25 -25
  48. package/dist/index.es.js +121 -108
  49. package/dist/index.umd.js +18 -18
  50. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  51. package/dist/layoutSidebarButtons/index.es.js +157 -144
  52. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  53. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  54. package/dist/lightGalleryComponent/index.es.js +245 -232
  55. package/dist/lightGalleryComponent/index.umd.js +1 -1
  56. package/dist/linkImageComponent/index.cjs.js +2 -2
  57. package/dist/linkImageComponent/index.es.js +106 -93
  58. package/dist/linkImageComponent/index.umd.js +2 -2
  59. package/dist/listPagesComponent/index.cjs.js +5 -5
  60. package/dist/listPagesComponent/index.es.js +157 -144
  61. package/dist/listPagesComponent/index.umd.js +5 -5
  62. package/dist/presetPrintable/index.cjs.js +3 -3
  63. package/dist/presetPrintable/index.es.js +181 -168
  64. package/dist/presetPrintable/index.umd.js +3 -3
  65. package/dist/prosemirror/index.cjs.js +7 -7
  66. package/dist/prosemirror/index.es.js +385 -372
  67. package/dist/prosemirror/index.umd.js +8 -8
  68. package/dist/rendererReact/index.cjs.js +1 -1
  69. package/dist/rendererReact/index.es.js +200 -187
  70. package/dist/rendererReact/index.js +1 -1
  71. package/dist/rendererReact/index.umd.js +1 -1
  72. package/dist/rteTinyMce/index.cjs.js +2 -2
  73. package/dist/rteTinyMce/index.es.js +118 -105
  74. package/dist/rteTinyMce/index.umd.js +2 -2
  75. package/dist/shapeDividerComponent/index.cjs.js +4 -4
  76. package/dist/shapeDividerComponent/index.es.js +129 -116
  77. package/dist/shapeDividerComponent/index.umd.js +4 -4
  78. package/dist/swiperComponent/index.cjs.js +9 -9
  79. package/dist/swiperComponent/index.es.js +203 -190
  80. package/dist/swiperComponent/index.umd.js +7 -7
  81. package/dist/tableComponent/index.cjs.js +1 -1
  82. package/dist/tableComponent/index.es.js +257 -244
  83. package/dist/tableComponent/index.umd.js +1 -1
  84. package/dist/types.d.ts +1 -1
  85. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  86. package/dist/youtubeAssetProvider/index.es.js +121 -108
  87. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  88. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- (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.dialogExportCode="studio:dialogExportCode",t.dialogImportCode="studio:dialogImportCode",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.clearPage="studio:clearPage",t.projectFiles="studio:projectFiles",t.validateCode="studio:validateCode",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.layoutUpdate="studio:layoutUpdate",t.layoutGet="studio:layoutGet",t.layoutConfigGet="studio:layoutConfigGet",t.layoutConfigSet="studio:layoutConfigSet",t.layoutComponentAdd="studio:layoutComponentAdd",t.layoutComponentGet="studio:layoutComponentGet",t.layoutComponentRemove="studio:layoutComponentRemove",t.layoutComponentRender="studio:layoutComponentRender",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.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||{}),P=(t=>(t.dark="dark",t.light="light",t.auto="auto",t))(P||{});const _="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"],G="license:check:start",L="license:check:end",N=()=>typeof window<"u",B=({isDev:t,isStage:s,isPlatform:n})=>`${t?"":`https://${s?R:_}`}/${n?"platform-api":"api"}`,j=()=>{const t=N()&&window.location.hostname;return!!t&&(k.includes(t)||k.some(s=>t.endsWith(s)))};async function U({path:t,baseApiUrl:s,method:n="GET",headers:a={},params:r,body:c}){const l=`${s||B({isDev:!1,isStage:!1})}${t}`,i={method:n,headers:{"Content-Type":"application/json",...a}};c&&(i.body=JSON.stringify(c));const u=r?new URLSearchParams(r).toString():"",e=u?`?${u}`:"",o=await fetch(`${l}${e}`,i);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return o.json()}const D={[f.free]:0,[f.startup]:10,[f.business]:20,[f.enterprise]:30};function W(t){const s=t;return s.init=n=>a=>t(a,n),s}const $=t=>W(t);async function F({editor:t,plan:s,pluginName:n,licenseKey:a,onLicenseCheckResponse:r,cleanup:c}){let d="",l=!1;const i=j(),u=o=>{console.warn("Cleanup plugin:",n,"Reason:",o),c()},e=(o={})=>{var E;const{error:b,sdkLicense:x}=o,g=(E=o.plan)==null?void 0:E.category;if(!(x||o.license)||b)u(b||"Invalid license");else if(g){const p=D[s],O=D[g];p>O&&u({pluginRequiredPlan:s,licensePlan:g})}};t.on(G,o=>{d=o==null?void 0:o.baseApiUrl,l=!0}),t.on(L,o=>{r==null||r(o),e(o)}),setTimeout(async()=>{if(!l){if(i)return;if(a){const o=await S({licenseKey:a,pluginName:n,baseApiUrl:d});r==null||r(o),o&&e(o)}else u("The `licenseKey` option not provided")}},2e3)}async function S(t){const{licenseKey:s,pluginName:n,baseApiUrl:a}=t;try{return(await U({baseApiUrl:a,path:`/sdk/${s||"na"}`,method:"POST",params:{d:window.location.hostname,pn:n}})).result||{}}catch(r){return console.error("Error during SDK license check:",r),!1}}const K=(t,s,n)=>{const{doc:a=document}=n,r=n.target||a.head,c=r.querySelector(`style[${t}]`)||a.createElement("style");c.setAttribute(t,"true"),c.innerHTML=s,!r.contains(c)&&r.appendChild(c)},q=t=>t.dispatchEvent(new CustomEvent("input"));function H(t,s){if(!s)return()=>{};const n=t.Components.events,a=e=>t.getSelectedAll().includes(e),r=e=>e.isInstanceOf("text")&&!e.isChildOf("text"),c=e=>e.isChildOf("text"),d=e=>t.getEditing()===e,l=(e,o={})=>{e.trigger("focus",o.event)},i=(e,o)=>{a(e)&&r(e)&&!d(e)&&l(e,o)},u=(e,o)=>{if(a(e)&&!r(e)&&c(e)){const b=e.parents().find(x=>x.isInstanceOf("text"));b&&(l(b,o),setTimeout(()=>t.select(b),0))}};return t.on(n.select,i),t.on(n.selectBefore,u),()=>{t.off(n.select,i),t.off(n.selectBefore,u)}}const C="rteTinyMce",z=f.startup,V=`
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.dialogExportCode="studio:dialogExportCode",t.dialogImportCode="studio:dialogImportCode",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.clearPage="studio:clearPage",t.projectFiles="studio:projectFiles",t.validateCode="studio:validateCode",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.layoutUpdate="studio:layoutUpdate",t.layoutGet="studio:layoutGet",t.layoutConfigGet="studio:layoutConfigGet",t.layoutConfigSet="studio:layoutConfigSet",t.layoutComponentAdd="studio:layoutComponentAdd",t.layoutComponentGet="studio:layoutComponentGet",t.layoutComponentRemove="studio:layoutComponentRemove",t.layoutComponentRender="studio:layoutComponentRender",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.settings="studio:settings",t.assetProviderGet="studio:assetProviderGet",t.assetProviderAdd="studio:assetProviderAdd",t.assetProviderRemove="studio:assetProviderRemove",t.fontGet="studio:fontGet",t.fontAdd="studio:fontAdd",t.fontRemove="studio:fontRemove",t.fontManagerOpen="studio:fontManagerOpen",t.menuFontLoad="studio:menuFontLoad",t.toggleStateDataSource="studio:toggleStateDataSource",t.getStateDataSource="studio:getStateDataSource",t.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",t.dataSourceSetImporter="studio:dataSourceSetImporter",t.dataSourceSetExporter="studio:dataSourceSetExporter",t.setDragAbsolute="studio:setDragAbsolute",t))(h||{}),R=(t=>(t.dark="dark",t.light="light",t.auto="auto",t))(R||{});const P="app.grapesjs.com",_="app-stage.grapesjs.com",k=[P,"app2.grapesjs.com",_,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],M="license:check:end",G=()=>typeof window<"u",N=({isDev:t,isStage:s,isPlatform:n})=>`${t?"":`https://${s?_:P}`}/${n?"platform-api":"api"}`,B=()=>{const t=G()&&window.location.hostname;return!!t&&(k.includes(t)||k.some(s=>t.endsWith(s)))};async function j({path:t,baseApiUrl:s,method:n="GET",headers:a={},params:i,body:c}){const r=`${s||N({isDev:!1,isStage:!1})}${t}`,l={method:n,headers:{"Content-Type":"application/json",...a}};c&&(l.body=JSON.stringify(c));const b=i?new URLSearchParams(i).toString():"",e=b?`?${b}`:"",o=await fetch(`${r}${e}`,l);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return o.json()}const D={[f.free]:0,[f.startup]:10,[f.business]:20,[f.enterprise]:30};function U(t){const s=t;return s.init=n=>a=>t(a,n),s}const F=t=>U(t);async function W({editor:t,plan:s,pluginName:n,licenseKey:a,onLicenseCheckResponse:i,cleanup:c}){let d="",r;const l=o=>{console.warn("Cleanup plugin:",n,"Reason:",o),c()},b=(o={})=>{var E;const{error:u,sdkLicense:p}=o,g=(E=o.plan)==null?void 0:E.category;if(!(p||o.license)||u)l(u||"Invalid license");else if(g){const x=D[s],I=D[g];x>I&&l({pluginRequiredPlan:s,licensePlan:g})}};t.Commands.has(h.settings)&&(r=t.runCommand(h.settings),d=(r==null?void 0:r.baseUrl)||"");const e=o=>{i==null||i(o),o&&b(o)};if(!r){t.onReady(async()=>{if(!B())if(a){const o=await C({licenseKey:a,pluginName:n,baseApiUrl:d});e(o)}else l("The `licenseKey` option not provided")});return}if(r.licensePlan||r.licenseError){const o=$(r);e(o);return}t.on(M,o=>e(o))}const $=t=>({sdkLicense:t.license,license:t.license,error:t.licenseError,plan:t.licensePlan});async function C(t){const{licenseKey:s,pluginName:n,baseApiUrl:a}=t;try{return(await j({baseApiUrl:a,path:`/sdk/${s||"na"}`,method:"POST",params:{d:window.location.hostname,pn:n}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const q=(t,s,n)=>{const{doc:a=document}=n,i=n.target||a.head,c=i.querySelector(`style[${t}]`)||a.createElement("style");c.setAttribute(t,"true"),c.innerHTML=s,!i.contains(c)&&i.appendChild(c)},K=t=>t.dispatchEvent(new CustomEvent("input"));function S(t,s){if(!s)return()=>{};const n=t.Components.events,a=e=>t.getSelectedAll().includes(e),i=e=>e.isInstanceOf("text")&&!e.isChildOf("text"),c=e=>e.isChildOf("text"),d=e=>t.getEditing()===e,r=(e,o={})=>{e.trigger("focus",o.event)},l=(e,o)=>{a(e)&&i(e)&&!d(e)&&r(e,o)},b=(e,o)=>{if(a(e)&&!i(e)&&c(e)){const u=e.parents().find(p=>p.isInstanceOf("text"));u&&(r(u,o),setTimeout(()=>t.select(u),0))}};return t.on(n.select,l),t.on(n.selectBefore,b),()=>{t.off(n.select,l),t.off(n.selectBefore,b)}}const H="rteTinyMce",z=f.startup,V=`
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,J=(t,s)=>{w.set(t,s)},X=t=>{w.delete(t)},T=t=>w.get(t),m=t=>{const s=t.target,n=s.closest(".tox"),a=s.matches(".ephox-snooker-resizer-bar");(n||a)&&t.stopPropagation()},A=t=>{t.stopPropagation(),t.preventDefault()},Y=(t,s)=>{const n=t.getDoc(),a=t.getWin();if(s!=null&&s.event){const{event:r}=s,{clientX:c,clientY:d}=r;let l;if(n.caretRangeFromPoint)l=n.caretRangeFromPoint(c,d);else if(n.caretPositionFromPoint){const i=n.caretPositionFromPoint(c,d);l=n.createRange(),l==null||l.setStart(i.offsetNode,i.offset)}if(l){const i=a.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(l),t.selection.setRng(l)}}else t.execCommand("SelectAll")},Q=t=>{var u,e;const{el:s,editor:n,componentView:a}=t,r=n.runCommand(h.getStateTheme),c=a.model,d={target:s,inline:!0,skin:(r==null?void 0:r.theme)===P.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"},l=((e=(u=t.pluginOpts)==null?void 0:u.loadConfig)==null?void 0:e.call(u,{config:d,editor:n,componentView:a,component:c}))||{};return{...d,...l}},I=(t,s=document)=>new Promise((n,a)=>{const r=Array.isArray(t)?[...t]:[t],{head:c}=s,d=l=>{if(l.length){const i=s.createElement("script");i.src=l.shift(),i.onload=d.bind(null,l),i.onerror=a,c.appendChild(i)}else n()};d(r)});return $(function(t,s={}){const n={cdnScript:"https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",...s},{cdnScript:a}=n,r=t.Canvas.events,c=!n.skipCustomTheme,d="gs-plg-tinymce-studio-theme",l=async(e,o)=>{const b=e.ownerDocument,x=b.defaultView,g=o==null?void 0:o.view;if(!x||!g){console.warn("Missing required data",{win:x,componentView:g});return}const y=Q({el:e,editor:t,componentView:g,pluginOpts:n}),p=(await x.tinymce.init(y))[0];if(!p)return;const Z=(await window.tinymce.init({...y,target:document.createElement("div")}))[0];return p.ui.show(),b.body.addEventListener("mousedown",m),document.body.addEventListener("mousedown",m),p.on("Change",()=>q(e)),p.on("blur",()=>p.ui.show()),p.on("OpenWindow",function(){var M;const v=(M=b.querySelector(".tox-dialog"))==null?void 0:M.closest(".tox");v&&(v==null?void 0:v.ownerDocument)!==document&&(document.body.appendChild(v),p.once("CloseWindow",()=>{v&&v.ownerDocument===document&&b.body.appendChild(v)}))}),e.addEventListener("dragstart",A,{capture:!0}),t.runCommand(h.setStateContextMenu,{enabled:!1}),Y(p,o),{rteEditor:p,rteEditorShallow:Z}},i=(e,o)=>{e.ownerDocument.body.removeEventListener("mousedown",m),document.body.removeEventListener("mousedown",m),e.removeEventListener("dragstart",A,{capture:!0}),t.runCommand(h.setStateContextMenu,{enabled:!0}),o.rteEditor.destroy(),o.rteEditorShallow.destroy()};t.on(r.frameLoad,async({window:e})=>{const o=e.document;I(a,o)}),t.onReady(()=>{I(a,document),c&&K(d,V,{target:document.body})}),t.setCustomRte({parseContent:!0,async enable(e,o,b){const x=T(e);if(x)return x.rteEditor;const g=await l(e,b);return g&&J(e,g),g==null?void 0:g.rteEditor},disable(e){const o=T(e);o&&(X(e),i(e,o))},getContent(e,o,b){var y;const x=T(e),g=x==null?void 0:x.rteEditor;return g&&!g.isDirty()?b.view.lastContent:g?(y=g.getContent)==null?void 0:y.call(g):e.innerHTML}});const u=H(t,n.enableOnClick);F({editor:t,licenseKey:n.licenseKey,plan:z,pluginName:C,cleanup:()=>{t.RichTextEditor.customRte=void 0,u()}})})});
104
+ }`,w=new WeakMap,J=(t,s)=>{w.set(t,s)},X=t=>{w.delete(t)},T=t=>w.get(t),m=t=>{const s=t.target,n=s.closest(".tox"),a=s.matches(".ephox-snooker-resizer-bar");(n||a)&&t.stopPropagation()},A=t=>{t.stopPropagation(),t.preventDefault()},Y=(t,s)=>{const n=t.getDoc(),a=t.getWin();if(s!=null&&s.event){const{event:i}=s,{clientX:c,clientY:d}=i;let r;if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(c,d);else if(n.caretPositionFromPoint){const l=n.caretPositionFromPoint(c,d);r=n.createRange(),r==null||r.setStart(l.offsetNode,l.offset)}if(r){const l=a.getSelection();l==null||l.removeAllRanges(),l==null||l.addRange(r),t.selection.setRng(r)}}else t.execCommand("SelectAll")},Q=t=>{var b,e;const{el:s,editor:n,componentView:a}=t,i=n.runCommand(h.getStateTheme),c=a.model,d={target:s,inline:!0,skin:(i==null?void 0:i.theme)===R.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"},r=((e=(b=t.pluginOpts)==null?void 0:b.loadConfig)==null?void 0:e.call(b,{config:d,editor:n,componentView:a,component:c}))||{};return{...d,...r}},O=(t,s=document)=>new Promise((n,a)=>{const i=Array.isArray(t)?[...t]:[t],{head:c}=s,d=r=>{if(r.length){const l=s.createElement("script");l.src=r.shift(),l.onload=d.bind(null,r),l.onerror=a,c.appendChild(l)}else n()};d(i)});return F(function(t,s={}){const n={cdnScript:"https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",...s},{cdnScript:a}=n,i=t.Canvas.events,c=!n.skipCustomTheme,d="gs-plg-tinymce-studio-theme",r=async(e,o)=>{const u=e.ownerDocument,p=u.defaultView,g=o==null?void 0:o.view;if(!p||!g){console.warn("Missing required data",{win:p,componentView:g});return}const y=Q({el:e,editor:t,componentView:g,pluginOpts:n}),x=(await p.tinymce.init(y))[0];if(!x)return;const Z=(await window.tinymce.init({...y,target:document.createElement("div")}))[0];return x.ui.show(),u.body.addEventListener("mousedown",m),document.body.addEventListener("mousedown",m),x.on("Change",()=>K(e)),x.on("blur",()=>x.ui.show()),x.on("OpenWindow",function(){var L;const v=(L=u.querySelector(".tox-dialog"))==null?void 0:L.closest(".tox");v&&(v==null?void 0:v.ownerDocument)!==document&&(document.body.appendChild(v),x.once("CloseWindow",()=>{v&&v.ownerDocument===document&&u.body.appendChild(v)}))}),e.addEventListener("dragstart",A,{capture:!0}),t.runCommand(h.setStateContextMenu,{enabled:!1}),Y(x,o),{rteEditor:x,rteEditorShallow:Z}},l=(e,o)=>{e.ownerDocument.body.removeEventListener("mousedown",m),document.body.removeEventListener("mousedown",m),e.removeEventListener("dragstart",A,{capture:!0}),t.runCommand(h.setStateContextMenu,{enabled:!0}),o.rteEditor.destroy(),o.rteEditorShallow.destroy()};t.on(i.frameLoad,async({window:e})=>{const o=e.document;O(a,o)}),t.onReady(()=>{O(a,document),c&&q(d,V,{target:document.body})}),t.setCustomRte({parseContent:!0,async enable(e,o,u){const p=T(e);if(p)return p.rteEditor;const g=await r(e,u);return g&&J(e,g),g==null?void 0:g.rteEditor},disable(e){const o=T(e);o&&(X(e),l(e,o))},getContent(e,o,u){var y;const p=T(e),g=p==null?void 0:p.rteEditor;return g&&!g.isDirty()?u.view.lastContent:g?(y=g.getContent)==null?void 0:y.call(g):e.innerHTML}});const b=S(t,n.enableOnClick);W({editor:t,licenseKey:n.licenseKey,plan:z,pluginName:H,cleanup:()=>{t.RichTextEditor.customRte=void 0,b()}})})});
@@ -1,4 +1,4 @@
1
- "use strict";const H="app.grapesjs.com",T="app-stage.grapesjs.com",R="app2.grapesjs.com",L="app-stage2.grapesjs.com",z=[H,R,T,L,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],E="license:check:start",I="license:check:end",P=()=>typeof window<"u",N=({isDev:e,isStage:i,isPlatform:l})=>`${e?"":`https://${i?T:H}`}/${l?"platform-api":"api"}`,k=()=>{const e=P()&&window.location.hostname;return!!e&&(z.includes(e)||z.some(i=>e.endsWith(i)))};async function D({path:e,baseApiUrl:i,method:l="GET",headers:c={},params:n,body:o}){const v=`${i||N({isDev:!1,isStage:!1})}${e}`,t={method:l,headers:{"Content-Type":"application/json",...c}};o&&(t.body=JSON.stringify(o));const r=n?new URLSearchParams(n).toString():"",g=r?`?${r}`:"",s=await fetch(`${v}${g}`,t);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var w=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(w||{});const C={[w.free]:0,[w.startup]:10,[w.business]:20,[w.enterprise]:30};function W(e){const i=e;return i.init=l=>c=>e(c,l),i}const _=e=>W(e);async function U({editor:e,plan:i,pluginName:l,licenseKey:c,onLicenseCheckResponse:n,cleanup:o}){let p="",v=!1;const t=k(),r=s=>{console.warn("Cleanup plugin:",l,"Reason:",s),o()},g=(s={})=>{var y;const{error:m,sdkLicense:b}=s,u=(y=s.plan)==null?void 0:y.category;if(!(b||s.license)||m)r(m||"Invalid license");else if(u){const M=C[i],V=C[u];M>V&&r({pluginRequiredPlan:i,licensePlan:u})}};e.on(E,s=>{p=s==null?void 0:s.baseApiUrl,v=!0}),e.on(I,s=>{n==null||n(s),g(s)}),setTimeout(async()=>{if(!v){if(t)return;if(c){const s=await F({licenseKey:c,pluginName:l,baseApiUrl:p});n==null||n(s),s&&g(s)}else r("The `licenseKey` option not provided")}},2e3)}async function F(e){const{licenseKey:i,pluginName:l,baseApiUrl:c}=e;try{return(await D({baseApiUrl:c,path:`/sdk/${i||"na"}`,method:"POST",params:{d:window.location.hostname,pn:l}})).result||{}}catch(n){return console.error("Error during SDK license check:",n),!1}}const O=(e,i)=>{var l;return!!((l=e==null?void 0:e.classList)!=null&&l.contains(i))},x=e=>i=>{var l;return((l=i.getAttribute)==null?void 0:l.call(i,$))===e},B="gjs-plg-",$="data-type-role",Y="shapeDividerComponent",K=w.startup,j=function(e,i={}){const{Components:l,Blocks:c,Selectors:n}=e,o="shape-divider",p=`${o}-cnt`,v=`${B}${o}`,t=`${B}${p}`,r=[{id:"tilt",label:"Tilt",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
1
+ "use strict";const L="app.grapesjs.com",H="app-stage.grapesjs.com",k="app2.grapesjs.com",G="app-stage2.grapesjs.com",z=[L,k,H,G,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],E="license:check:end",I=()=>typeof window<"u",O=({isDev:e,isStage:a,isPlatform:i})=>`${e?"":`https://${a?H:L}`}/${i?"platform-api":"api"}`,F=()=>{const e=I()&&window.location.hostname;return!!e&&(z.includes(e)||z.some(a=>e.endsWith(a)))};async function N({path:e,baseApiUrl:a,method:i="GET",headers:c={},params:n,body:r}){const o=`${a||O({isDev:!1,isStage:!1})}${e}`,t={method:i,headers:{"Content-Type":"application/json",...c}};r&&(t.body=JSON.stringify(r));const g=n?new URLSearchParams(n).toString():"",h=g?`?${g}`:"",l=await fetch(`${o}${h}`,t);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return l.json()}var y=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(y||{}),V=(e=>(e.toastAdd="studio:toastAdd",e.toastRemove="studio:toastRemove",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.dialogExportCode="studio:dialogExportCode",e.dialogImportCode="studio:dialogImportCode",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.clearPage="studio:clearPage",e.projectFiles="studio:projectFiles",e.validateCode="studio:validateCode",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.layoutComponentAdd="studio:layoutComponentAdd",e.layoutComponentGet="studio:layoutComponentGet",e.layoutComponentRemove="studio:layoutComponentRemove",e.layoutComponentRender="studio:layoutComponentRender",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.settings="studio:settings",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",e.dataSourceSetImporter="studio:dataSourceSetImporter",e.dataSourceSetExporter="studio:dataSourceSetExporter",e.setDragAbsolute="studio:setDragAbsolute",e))(V||{});const T={[y.free]:0,[y.startup]:10,[y.business]:20,[y.enterprise]:30};function U(e){const a=e;return a.init=i=>c=>e(c,i),a}const C=e=>U(e);async function W({editor:e,plan:a,pluginName:i,licenseKey:c,onLicenseCheckResponse:n,cleanup:r}){let p="",o;const t=l=>{console.warn("Cleanup plugin:",i,"Reason:",l),r()},g=(l={})=>{var w;const{error:A,sdkLicense:b}=l,u=(w=l.plan)==null?void 0:w.category;if(!(b||l.license)||A)t(A||"Invalid license");else if(u){const R=T[a],x=T[u];R>x&&t({pluginRequiredPlan:a,licensePlan:u})}};e.Commands.has(V.settings)&&(o=e.runCommand(V.settings),p=(o==null?void 0:o.baseUrl)||"");const h=l=>{n==null||n(l),l&&g(l)};if(!o){e.onReady(async()=>{if(!F())if(c){const l=await j({licenseKey:c,pluginName:i,baseApiUrl:p});h(l)}else t("The `licenseKey` option not provided")});return}if(o.licensePlan||o.licenseError){const l=_(o);h(l);return}e.on(E,l=>h(l))}const _=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function j(e){const{licenseKey:a,pluginName:i,baseApiUrl:c}=e;try{return(await N({baseApiUrl:c,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:i}})).result||{}}catch(n){return console.error("Error during SDK license check:",n),!1}}const Y=(e,a)=>{var i;return!!((i=e==null?void 0:e.classList)!=null&&i.contains(a))},P=e=>a=>{var i;return((i=a.getAttribute)==null?void 0:i.call(a,$))===e},B="gjs-plg-",$="data-type-role",K="shapeDividerComponent",X=y.startup,Z=function(e,a={}){const{Components:i,Blocks:c,Selectors:n}=e,r="shape-divider",p=`${r}-cnt`,o=`${B}${r}`,t=`${B}${p}`,g=[{id:"tilt",label:"Tilt",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
2
2
  <path d="M240 24V0L0 24h240z"/>
3
3
  </svg>`},{id:"tilt-split",label:"Tilt split",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
4
4
  <path fill-opacity=".3" d="M240 24V0L0 24h240z"/>
@@ -58,9 +58,9 @@
58
58
  <path fill-opacity=".3" d="M0 0v18C21.5 7 49.6 2.2 64.8 6.4 82 11.2 75.4 25.2 91.7 23.9c14.2-1.1 25.8-12.3 40-12.3 10.4 0 7.8 6 18.8 6.9 11.5.8 21.6-5 37.2-9 19.9-5 42.1-5.3 52.3 0V0H0z"/>
59
59
  </svg>`},{id:"zigzag",label:"Zigzag",value:`<svg class="${t}-inv" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1000 38">
60
60
  <path d="M75 38l25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25V.0H0V13l25 25 25-25z"/>
61
- </svg>`}],g={tl:!1,tc:!1,tr:!1,cl:!1,cr:!1,bl:!1,bc:!1,br:!1},s={...g,bc:!0},m={...g,tc:!0},b="shape",u="flip-y",A="flip-x",y="Shape Divider",M=`<svg viewBox="0 0 22 22">
61
+ </svg>`}],h={tl:!1,tc:!1,tr:!1,cl:!1,cr:!1,bl:!1,bc:!1,br:!1},l={...h,bc:!0},A={...h,tc:!0},b="shape",u="flip-y",M="flip-x",w="Shape Divider",R=`<svg viewBox="0 0 22 22">
62
62
  <path fill="currentColor" d="M2 2v18h18V2H2zm0-2h18a2 2 0 012 2v18a2 2 0 01-2 2H2a2 2 0 01-2-2V2C0 .9.9 0 2 0zM1 13L2 0h18l1 9-20 4z"/>
63
- </svg>`,{block:V={}}=i;e.on(n.events.add,a=>{a.getFullName().startsWith(`.${v}`)&&a.set({private:!0})}),l.addType(o,{isComponent:a=>x(o)(a)||O(a,v),block:V&&{label:y,media:M,category:"Extra",select:!0,...V},model:{defaults:{droppable:!1,highlightable:!1,classes:v,attributes:{[$]:o},components:{type:p},styles:`.${v} { position: relative; }`,delegate:{select:a=>a.findFirstType(p),layer:a=>a.findFirstType(p)}}},view:{onRender(){this.el.style.height="1px"}}}),l.addType(p,{isComponent:x(p),model:{defaults:{droppable:!1,highlightable:!1,classes:t,emptyState:!0,icon:M,name:y,delegate:{remove:a=>a.parent(),move:a=>a.parent(),copy:a=>a.parent()},attributes:{[$]:p},[b]:r[0].id,resizable:s,stylable:["height","width","color"],styles:`
63
+ </svg>`,{block:x={}}=a;e.on(n.events.add,s=>{s.getFullName().startsWith(`.${o}`)&&s.set({private:!0})}),i.addType(r,{isComponent:s=>P(r)(s)||Y(s,o),block:x&&{label:w,media:R,category:"Extra",select:!0,...x},model:{defaults:{droppable:!1,highlightable:!1,classes:o,attributes:{[$]:r},components:{type:p},styles:`.${o} { position: relative; }`,delegate:{select:s=>s.findFirstType(p),layer:s=>s.findFirstType(p)}}},view:{onRender(){this.el.style.height="1px"}}}),i.addType(p,{isComponent:P(p),model:{defaults:{droppable:!1,highlightable:!1,classes:t,emptyState:!0,icon:R,name:w,delegate:{remove:s=>s.parent(),move:s=>s.parent(),copy:s=>s.parent()},attributes:{[$]:p},[b]:g[0].id,resizable:l,stylable:["height","width","color"],styles:`
64
64
  .${t} {
65
65
  position: absolute;
66
66
  width: 100%;
@@ -94,4 +94,4 @@
94
94
  .${t}-inv > path {
95
95
  transform: scale(-1, -1) translate(-100%, -100%);
96
96
  }
97
- `,traits:[{type:"select",name:b,label:"Shape",changeProp:!0,options:r.map(({id:a,label:d,value:h})=>({id:a,label:d,icon:{icon:h.replace("<svg ",'<svg style="width: 35px; height: 7px; fill: currentColor;"')}}))},{type:"checkbox",name:u,label:"Flip vertically",changeProp:!0},{type:"checkbox",name:A,label:"flip horizontally",changeProp:!0}]},init(){this.on(`change:${b}`,this.onShapeChange),this.on(`change:${A} change:${u}`,this.onFlip),this.onShapeChange()},onShapeChange(){const a=this.get(b),d=r.find(f=>f.id===a),h=(d==null?void 0:d.value)||this.getInnerHTML().trim();this.components(""),h&&this.set("content",h)},onFlip(){const a=this.get(u),d=this.get(A),h=["fl-v","fl-h","fl-v-h"].map(S=>`${t}--${S}`);let f;a&&d?f=h[2]:d?f=h[1]:a&&(f=h[0]),this.removeClass(h),f&&this.addClass(f),this.set("resizable",a?m:s)}}}),U({editor:e,licenseKey:i.licenseKey,plan:K,pluginName:Y,cleanup:()=>{l.removeType(o),c.remove(o)}})},G=_(j);module.exports=G;
97
+ `,traits:[{type:"select",name:b,label:"Shape",changeProp:!0,options:g.map(({id:s,label:d,value:v})=>({id:s,label:d,icon:{icon:v.replace("<svg ",'<svg style="width: 35px; height: 7px; fill: currentColor;"')}}))},{type:"checkbox",name:u,label:"Flip vertically",changeProp:!0},{type:"checkbox",name:M,label:"flip horizontally",changeProp:!0}]},init(){this.on(`change:${b}`,this.onShapeChange),this.on(`change:${M} change:${u}`,this.onFlip),this.onShapeChange()},onShapeChange(){const s=this.get(b),d=g.find(f=>f.id===s),v=(d==null?void 0:d.value)||this.getInnerHTML().trim();this.components(""),v&&this.set("content",v)},onFlip(){const s=this.get(u),d=this.get(M),v=["fl-v","fl-h","fl-v-h"].map(D=>`${t}--${D}`);let f;s&&d?f=v[2]:d?f=v[1]:s&&(f=v[0]),this.removeClass(v),f&&this.addClass(f),this.set("resizable",s?A:l)}}}),W({editor:e,licenseKey:a.licenseKey,plan:X,pluginName:K,cleanup:()=>{i.removeType(r),c.remove(r)}})},q=C(Z);module.exports=q;
@@ -1,8 +1,8 @@
1
- const H = "app.grapesjs.com", T = "app-stage.grapesjs.com", R = "app2.grapesjs.com", L = "app-stage2.grapesjs.com", z = [
2
- H,
3
- R,
4
- T,
1
+ const L = "app.grapesjs.com", H = "app-stage.grapesjs.com", k = "app2.grapesjs.com", G = "app-stage2.grapesjs.com", z = [
5
2
  L,
3
+ k,
4
+ H,
5
+ G,
6
6
  "localhost",
7
7
  "127.0.0.1",
8
8
  ".local-credentialless.webcontainer.io",
@@ -11,107 +11,120 @@ const H = "app.grapesjs.com", T = "app-stage.grapesjs.com", R = "app2.grapesjs.c
11
11
  // For stackblitz.com demos
12
12
  "-sandpack.codesandbox.io"
13
13
  // For Sandpack demos
14
- ], E = "license:check:start", I = "license:check:end", P = () => typeof window < "u", N = ({
14
+ ], E = "license:check:end", I = () => typeof window < "u", O = ({
15
15
  isDev: e,
16
- isStage: i,
17
- isPlatform: l
18
- }) => `${e ? "" : `https://${i ? T : H}`}/${l ? "platform-api" : "api"}`, k = () => {
19
- const e = P() && window.location.hostname;
20
- return !!e && (z.includes(e) || z.some((i) => e.endsWith(i)));
16
+ isStage: a,
17
+ isPlatform: i
18
+ }) => `${e ? "" : `https://${a ? H : L}`}/${i ? "platform-api" : "api"}`, F = () => {
19
+ const e = I() && window.location.hostname;
20
+ return !!e && (z.includes(e) || z.some((a) => e.endsWith(a)));
21
21
  };
22
- async function D({
22
+ async function N({
23
23
  path: e,
24
- baseApiUrl: i,
25
- method: l = "GET",
24
+ baseApiUrl: a,
25
+ method: i = "GET",
26
26
  headers: c = {},
27
27
  params: n,
28
- body: o
28
+ body: r
29
29
  }) {
30
- const v = `${i || N({ isDev: !1, isStage: !1 })}${e}`, t = {
31
- method: l,
30
+ const o = `${a || O({ isDev: !1, isStage: !1 })}${e}`, t = {
31
+ method: i,
32
32
  headers: {
33
33
  "Content-Type": "application/json",
34
34
  ...c
35
35
  }
36
36
  };
37
- o && (t.body = JSON.stringify(o));
38
- const r = n ? new URLSearchParams(n).toString() : "", g = r ? `?${r}` : "", s = await fetch(`${v}${g}`, t);
39
- if (!s.ok)
40
- throw new Error(`HTTP error! status: ${s.status}`);
41
- return s.json();
37
+ r && (t.body = JSON.stringify(r));
38
+ const g = n ? new URLSearchParams(n).toString() : "", h = g ? `?${g}` : "", l = await fetch(`${o}${h}`, t);
39
+ if (!l.ok)
40
+ throw new Error(`HTTP error! status: ${l.status}`);
41
+ return l.json();
42
42
  }
43
- var w = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(w || {});
44
- const C = {
45
- [w.free]: 0,
46
- [w.startup]: 10,
47
- [w.business]: 20,
48
- [w.enterprise]: 30
43
+ var y = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(y || {}), V = /* @__PURE__ */ ((e) => (e.toastAdd = "studio:toastAdd", e.toastRemove = "studio:toastRemove", e.dialogOpen = "studio:dialogOpen", e.dialogClose = "studio:dialogClose", e.dialogExportCode = "studio:dialogExportCode", e.dialogImportCode = "studio:dialogImportCode", e.sidebarLeftSet = "studio:sidebarLeft:set", e.sidebarLeftGet = "studio:sidebarLeft:get", e.sidebarLeftToggle = "studio:sidebarLeft:toggle", e.sidebarRightSet = "studio:sidebarRight:set", e.sidebarRightGet = "studio:sidebarRight:get", e.sidebarRightToggle = "studio:sidebarRight:toggle", e.sidebarTopSet = "studio:sidebarTop:set", e.sidebarTopGet = "studio:sidebarTop:get", e.sidebarTopToggle = "studio:sidebarTop:toggle", e.sidebarBottomSet = "studio:sidebarBottom:set", e.sidebarBottomGet = "studio:sidebarBottom:get", e.sidebarBottomToggle = "studio:sidebarBottom:toggle", e.symbolAdd = "studio:symbolAdd", e.symbolDetach = "studio:symbolDetach", e.symbolOverride = "studio:symbolOverride", e.symbolPropagateStyles = "studio:propagateStyles", e.getPagesConfig = "studio:getPagesConfig", e.setPagesConfig = "studio:setPagesConfig", e.getPageSettings = "studio:getPageSettings", e.setPageSettings = "studio:setPageSettings", e.clearPage = "studio:clearPage", e.projectFiles = "studio:projectFiles", e.validateCode = "studio:validateCode", e.canvasReload = "studio:canvasReload", e.getBlocksPanel = "studio:getBlocksPanel", e.setBlocksPanel = "studio:setBlocksPanel", e.getStateContextMenu = "studio:getStateContextMenu", e.setStateContextMenu = "studio:setStateContextMenu", e.contextMenuComponent = "studio:contextMenuComponent", e.layoutAdd = "studio:layoutAdd", e.layoutRemove = "studio:layoutRemove", e.layoutToggle = "studio:layoutToggle", e.layoutUpdate = "studio:layoutUpdate", e.layoutGet = "studio:layoutGet", e.layoutConfigGet = "studio:layoutConfigGet", e.layoutConfigSet = "studio:layoutConfigSet", e.layoutComponentAdd = "studio:layoutComponentAdd", e.layoutComponentGet = "studio:layoutComponentGet", e.layoutComponentRemove = "studio:layoutComponentRemove", e.layoutComponentRender = "studio:layoutComponentRender", e.getStateTheme = "studio:getStateTheme", e.setStateTheme = "studio:setStateTheme", e.settings = "studio:settings", e.assetProviderGet = "studio:assetProviderGet", e.assetProviderAdd = "studio:assetProviderAdd", e.assetProviderRemove = "studio:assetProviderRemove", e.fontGet = "studio:fontGet", e.fontAdd = "studio:fontAdd", e.fontRemove = "studio:fontRemove", e.fontManagerOpen = "studio:fontManagerOpen", e.menuFontLoad = "studio:menuFontLoad", e.toggleStateDataSource = "studio:toggleStateDataSource", e.getStateDataSource = "studio:getStateDataSource", e.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", e.dataSourceSetImporter = "studio:dataSourceSetImporter", e.dataSourceSetExporter = "studio:dataSourceSetExporter", e.setDragAbsolute = "studio:setDragAbsolute", e))(V || {});
44
+ const T = {
45
+ [y.free]: 0,
46
+ [y.startup]: 10,
47
+ [y.business]: 20,
48
+ [y.enterprise]: 30
49
49
  };
50
- function W(e) {
51
- const i = e;
52
- return i.init = (l) => (c) => e(c, l), i;
50
+ function U(e) {
51
+ const a = e;
52
+ return a.init = (i) => (c) => e(c, i), a;
53
53
  }
54
- const _ = (e) => /* @__PURE__ */ W(e);
55
- async function U({
54
+ const C = (e) => /* @__PURE__ */ U(e);
55
+ async function W({
56
56
  editor: e,
57
- plan: i,
58
- pluginName: l,
57
+ plan: a,
58
+ pluginName: i,
59
59
  licenseKey: c,
60
60
  onLicenseCheckResponse: n,
61
- cleanup: o
61
+ cleanup: r
62
62
  }) {
63
- let p = "", v = !1;
64
- const t = k(), r = (s) => {
65
- console.warn("Cleanup plugin:", l, "Reason:", s), o();
66
- }, g = (s = {}) => {
67
- var y;
68
- const { error: m, sdkLicense: b } = s, f = (y = s.plan) == null ? void 0 : y.category;
69
- if (!(b || s.license) || m)
70
- r(m || "Invalid license");
71
- else if (f) {
72
- const M = C[i], V = C[f];
73
- M > V && r({ pluginRequiredPlan: i, licensePlan: f });
63
+ let p = "", o;
64
+ const t = (l) => {
65
+ console.warn("Cleanup plugin:", i, "Reason:", l), r();
66
+ }, g = (l = {}) => {
67
+ var w;
68
+ const { error: A, sdkLicense: b } = l, u = (w = l.plan) == null ? void 0 : w.category;
69
+ if (!(b || l.license) || A)
70
+ t(A || "Invalid license");
71
+ else if (u) {
72
+ const R = T[a], x = T[u];
73
+ R > x && t({ pluginRequiredPlan: a, licensePlan: u });
74
74
  }
75
75
  };
76
- e.on(E, (s) => {
77
- p = s == null ? void 0 : s.baseApiUrl, v = !0;
78
- }), e.on(I, (s) => {
79
- n == null || n(s), g(s);
80
- }), setTimeout(async () => {
81
- if (!v) {
82
- if (t) return;
83
- if (c) {
84
- const s = await F({ licenseKey: c, pluginName: l, baseApiUrl: p });
85
- n == null || n(s), s && g(s);
86
- } else
87
- r("The `licenseKey` option not provided");
88
- }
89
- }, 2e3);
76
+ e.Commands.has(V.settings) && (o = e.runCommand(V.settings), p = (o == null ? void 0 : o.baseUrl) || "");
77
+ const h = (l) => {
78
+ n == null || n(l), l && g(l);
79
+ };
80
+ if (!o) {
81
+ e.onReady(async () => {
82
+ if (!F())
83
+ if (c) {
84
+ const l = await j({ licenseKey: c, pluginName: i, baseApiUrl: p });
85
+ h(l);
86
+ } else
87
+ t("The `licenseKey` option not provided");
88
+ });
89
+ return;
90
+ }
91
+ if (o.licensePlan || o.licenseError) {
92
+ const l = _(o);
93
+ h(l);
94
+ return;
95
+ }
96
+ e.on(E, (l) => h(l));
90
97
  }
91
- async function F(e) {
92
- const { licenseKey: i, pluginName: l, baseApiUrl: c } = e;
98
+ const _ = (e) => ({
99
+ sdkLicense: e.license,
100
+ license: e.license,
101
+ error: e.licenseError,
102
+ plan: e.licensePlan
103
+ });
104
+ async function j(e) {
105
+ const { licenseKey: a, pluginName: i, baseApiUrl: c } = e;
93
106
  try {
94
- return (await D({
107
+ return (await N({
95
108
  baseApiUrl: c,
96
- path: `/sdk/${i || "na"}`,
109
+ path: `/sdk/${a || "na"}`,
97
110
  method: "POST",
98
111
  params: {
99
112
  d: window.location.hostname,
100
- pn: l
113
+ pn: i
101
114
  }
102
115
  })).result || {};
103
116
  } catch (n) {
104
117
  return console.error("Error during SDK license check:", n), !1;
105
118
  }
106
119
  }
107
- const O = (e, i) => {
108
- var l;
109
- return !!((l = e == null ? void 0 : e.classList) != null && l.contains(i));
110
- }, x = (e) => (i) => {
111
- var l;
112
- return ((l = i.getAttribute) == null ? void 0 : l.call(i, $)) === e;
113
- }, B = "gjs-plg-", $ = "data-type-role", Y = "shapeDividerComponent", K = w.startup, j = function(e, i = {}) {
114
- const { Components: l, Blocks: c, Selectors: n } = e, o = "shape-divider", p = `${o}-cnt`, v = `${B}${o}`, t = `${B}${p}`, r = [
120
+ const Y = (e, a) => {
121
+ var i;
122
+ return !!((i = e == null ? void 0 : e.classList) != null && i.contains(a));
123
+ }, P = (e) => (a) => {
124
+ var i;
125
+ return ((i = a.getAttribute) == null ? void 0 : i.call(a, $)) === e;
126
+ }, B = "gjs-plg-", $ = "data-type-role", K = "shapeDividerComponent", X = y.startup, Z = function(e, a = {}) {
127
+ const { Components: i, Blocks: c, Selectors: n } = e, r = "shape-divider", p = `${r}-cnt`, o = `${B}${r}`, t = `${B}${p}`, g = [
115
128
  {
116
129
  id: "tilt",
117
130
  label: "Tilt",
@@ -282,7 +295,7 @@ const O = (e, i) => {
282
295
  <path d="M75 38l25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25V.0H0V13l25 25 25-25z"/>
283
296
  </svg>`
284
297
  }
285
- ], g = {
298
+ ], h = {
286
299
  tl: !1,
287
300
  tc: !1,
288
301
  tr: !1,
@@ -291,31 +304,31 @@ const O = (e, i) => {
291
304
  bl: !1,
292
305
  bc: !1,
293
306
  br: !1
294
- }, s = { ...g, bc: !0 }, m = { ...g, tc: !0 }, b = "shape", f = "flip-y", A = "flip-x", y = "Shape Divider", M = `<svg viewBox="0 0 22 22">
307
+ }, l = { ...h, bc: !0 }, A = { ...h, tc: !0 }, b = "shape", u = "flip-y", M = "flip-x", w = "Shape Divider", R = `<svg viewBox="0 0 22 22">
295
308
  <path fill="currentColor" d="M2 2v18h18V2H2zm0-2h18a2 2 0 012 2v18a2 2 0 01-2 2H2a2 2 0 01-2-2V2C0 .9.9 0 2 0zM1 13L2 0h18l1 9-20 4z"/>
296
- </svg>`, { block: V = {} } = i;
297
- e.on(n.events.add, (a) => {
298
- a.getFullName().startsWith(`.${v}`) && a.set({ private: !0 });
299
- }), l.addType(o, {
300
- isComponent: (a) => x(o)(a) || O(a, v),
301
- block: V && {
302
- label: y,
303
- media: M,
309
+ </svg>`, { block: x = {} } = a;
310
+ e.on(n.events.add, (s) => {
311
+ s.getFullName().startsWith(`.${o}`) && s.set({ private: !0 });
312
+ }), i.addType(r, {
313
+ isComponent: (s) => P(r)(s) || Y(s, o),
314
+ block: x && {
315
+ label: w,
316
+ media: R,
304
317
  category: "Extra",
305
318
  select: !0,
306
- ...V
319
+ ...x
307
320
  },
308
321
  model: {
309
322
  defaults: {
310
323
  droppable: !1,
311
324
  highlightable: !1,
312
- classes: v,
313
- attributes: { [$]: o },
325
+ classes: o,
326
+ attributes: { [$]: r },
314
327
  components: { type: p },
315
- styles: `.${v} { position: relative; }`,
328
+ styles: `.${o} { position: relative; }`,
316
329
  delegate: {
317
- select: (a) => a.findFirstType(p),
318
- layer: (a) => a.findFirstType(p)
330
+ select: (s) => s.findFirstType(p),
331
+ layer: (s) => s.findFirstType(p)
319
332
  }
320
333
  }
321
334
  },
@@ -324,24 +337,24 @@ const O = (e, i) => {
324
337
  this.el.style.height = "1px";
325
338
  }
326
339
  }
327
- }), l.addType(p, {
328
- isComponent: x(p),
340
+ }), i.addType(p, {
341
+ isComponent: P(p),
329
342
  model: {
330
343
  defaults: {
331
344
  droppable: !1,
332
345
  highlightable: !1,
333
346
  classes: t,
334
347
  emptyState: !0,
335
- icon: M,
336
- name: y,
348
+ icon: R,
349
+ name: w,
337
350
  delegate: {
338
- remove: (a) => a.parent(),
339
- move: (a) => a.parent(),
340
- copy: (a) => a.parent()
351
+ remove: (s) => s.parent(),
352
+ move: (s) => s.parent(),
353
+ copy: (s) => s.parent()
341
354
  },
342
355
  attributes: { [$]: p },
343
- [b]: r[0].id,
344
- resizable: s,
356
+ [b]: g[0].id,
357
+ resizable: l,
345
358
  stylable: ["height", "width", "color"],
346
359
  styles: `
347
360
  .${t} {
@@ -384,49 +397,49 @@ const O = (e, i) => {
384
397
  name: b,
385
398
  label: "Shape",
386
399
  changeProp: !0,
387
- options: r.map(({ id: a, label: d, value: h }) => ({
388
- id: a,
400
+ options: g.map(({ id: s, label: d, value: v }) => ({
401
+ id: s,
389
402
  label: d,
390
- icon: { icon: h.replace("<svg ", '<svg style="width: 35px; height: 7px; fill: currentColor;"') }
403
+ icon: { icon: v.replace("<svg ", '<svg style="width: 35px; height: 7px; fill: currentColor;"') }
391
404
  }))
392
405
  },
393
406
  {
394
407
  type: "checkbox",
395
- name: f,
408
+ name: u,
396
409
  label: "Flip vertically",
397
410
  changeProp: !0
398
411
  },
399
412
  {
400
413
  type: "checkbox",
401
- name: A,
414
+ name: M,
402
415
  label: "flip horizontally",
403
416
  changeProp: !0
404
417
  }
405
418
  ]
406
419
  },
407
420
  init() {
408
- this.on(`change:${b}`, this.onShapeChange), this.on(`change:${A} change:${f}`, this.onFlip), this.onShapeChange();
421
+ this.on(`change:${b}`, this.onShapeChange), this.on(`change:${M} change:${u}`, this.onFlip), this.onShapeChange();
409
422
  },
410
423
  onShapeChange() {
411
- const a = this.get(b), d = r.find((u) => u.id === a), h = (d == null ? void 0 : d.value) || this.getInnerHTML().trim();
412
- this.components(""), h && this.set("content", h);
424
+ const s = this.get(b), d = g.find((f) => f.id === s), v = (d == null ? void 0 : d.value) || this.getInnerHTML().trim();
425
+ this.components(""), v && this.set("content", v);
413
426
  },
414
427
  onFlip() {
415
- const a = this.get(f), d = this.get(A), h = ["fl-v", "fl-h", "fl-v-h"].map((S) => `${t}--${S}`);
416
- let u;
417
- a && d ? u = h[2] : d ? u = h[1] : a && (u = h[0]), this.removeClass(h), u && this.addClass(u), this.set("resizable", a ? m : s);
428
+ const s = this.get(u), d = this.get(M), v = ["fl-v", "fl-h", "fl-v-h"].map((D) => `${t}--${D}`);
429
+ let f;
430
+ s && d ? f = v[2] : d ? f = v[1] : s && (f = v[0]), this.removeClass(v), f && this.addClass(f), this.set("resizable", s ? A : l);
418
431
  }
419
432
  }
420
- }), U({
433
+ }), W({
421
434
  editor: e,
422
- licenseKey: i.licenseKey,
423
- plan: K,
424
- pluginName: Y,
435
+ licenseKey: a.licenseKey,
436
+ plan: X,
437
+ pluginName: K,
425
438
  cleanup: () => {
426
- l.removeType(o), c.remove(o);
439
+ i.removeType(r), c.remove(r);
427
440
  }
428
441
  });
429
- }, G = _(j);
442
+ }, q = C(Z);
430
443
  export {
431
- G as default
444
+ q as default
432
445
  };
@@ -1,4 +1,4 @@
1
- (function(b,m){typeof exports=="object"&&typeof module<"u"?module.exports=m():typeof define=="function"&&define.amd?define(m):(b=typeof globalThis<"u"?globalThis:b||self,b.StudioSdkPlugins_shapeDividerComponent=m())})(this,function(){"use strict";const b="app.grapesjs.com",m="app-stage.grapesjs.com",x=[b,"app2.grapesjs.com",m,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],S="license:check:start",R="license:check:end",I=()=>typeof window<"u",P=({isDev:e,isStage:a,isPlatform:l})=>`${e?"":`https://${a?m:b}`}/${l?"platform-api":"api"}`,E=()=>{const e=I()&&window.location.hostname;return!!e&&(x.includes(e)||x.some(a=>e.endsWith(a)))};async function L({path:e,baseApiUrl:a,method:l="GET",headers:c={},params:n,body:o}){const v=`${a||P({isDev:!1,isStage:!1})}${e}`,t={method:l,headers:{"Content-Type":"application/json",...c}};o&&(t.body=JSON.stringify(o));const r=n?new URLSearchParams(n).toString():"",g=r?`?${r}`:"",s=await fetch(`${v}${g}`,t);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var y=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(y||{});const T={[y.free]:0,[y.startup]:10,[y.business]:20,[y.enterprise]:30};function D(e){const a=e;return a.init=l=>c=>e(c,l),a}const N=e=>D(e);async function _({editor:e,plan:a,pluginName:l,licenseKey:c,onLicenseCheckResponse:n,cleanup:o}){let p="",v=!1;const t=E(),r=s=>{console.warn("Cleanup plugin:",l,"Reason:",s),o()},g=(s={})=>{var A;const{error:M,sdkLicense:w}=s,u=(A=s.plan)==null?void 0:A.category;if(!(w||s.license)||M)r(M||"Invalid license");else if(u){const $=T[a],z=T[u];$>z&&r({pluginRequiredPlan:a,licensePlan:u})}};e.on(S,s=>{p=s==null?void 0:s.baseApiUrl,v=!0}),e.on(R,s=>{n==null||n(s),g(s)}),setTimeout(async()=>{if(!v){if(t)return;if(c){const s=await k({licenseKey:c,pluginName:l,baseApiUrl:p});n==null||n(s),s&&g(s)}else r("The `licenseKey` option not provided")}},2e3)}async function k(e){const{licenseKey:a,pluginName:l,baseApiUrl:c}=e;try{return(await L({baseApiUrl:c,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:l}})).result||{}}catch(n){return console.error("Error during SDK license check:",n),!1}}const O=(e,a)=>{var l;return!!((l=e==null?void 0:e.classList)!=null&&l.contains(a))},B=e=>a=>{var l;return((l=a.getAttribute)==null?void 0:l.call(a,C))===e},H="gjs-plg-",C="data-type-role",W="shapeDividerComponent",U=y.startup;return N(function(e,a={}){const{Components:l,Blocks:c,Selectors:n}=e,o="shape-divider",p=`${o}-cnt`,v=`${H}${o}`,t=`${H}${p}`,r=[{id:"tilt",label:"Tilt",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
1
+ (function(b,y){typeof exports=="object"&&typeof module<"u"?module.exports=y():typeof define=="function"&&define.amd?define(y):(b=typeof globalThis<"u"?globalThis:b||self,b.StudioSdkPlugins_shapeDividerComponent=y())})(this,function(){"use strict";const b="app.grapesjs.com",y="app-stage.grapesjs.com",z=[b,"app2.grapesjs.com",y,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],H="license:check:end",k=()=>typeof window<"u",G=({isDev:e,isStage:a,isPlatform:l})=>`${e?"":`https://${a?y:b}`}/${l?"platform-api":"api"}`,I=()=>{const e=k()&&window.location.hostname;return!!e&&(z.includes(e)||z.some(a=>e.endsWith(a)))};async function E({path:e,baseApiUrl:a,method:l="GET",headers:p={},params:n,body:r}){const o=`${a||G({isDev:!1,isStage:!1})}${e}`,t={method:l,headers:{"Content-Type":"application/json",...p}};r&&(t.body=JSON.stringify(r));const g=n?new URLSearchParams(n).toString():"",h=g?`?${g}`:"",i=await fetch(`${o}${h}`,t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return i.json()}var w=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(w||{}),$=(e=>(e.toastAdd="studio:toastAdd",e.toastRemove="studio:toastRemove",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.dialogExportCode="studio:dialogExportCode",e.dialogImportCode="studio:dialogImportCode",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.clearPage="studio:clearPage",e.projectFiles="studio:projectFiles",e.validateCode="studio:validateCode",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.layoutComponentAdd="studio:layoutComponentAdd",e.layoutComponentGet="studio:layoutComponentGet",e.layoutComponentRemove="studio:layoutComponentRemove",e.layoutComponentRender="studio:layoutComponentRender",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.settings="studio:settings",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",e.dataSourceSetImporter="studio:dataSourceSetImporter",e.dataSourceSetExporter="studio:dataSourceSetExporter",e.setDragAbsolute="studio:setDragAbsolute",e))($||{});const B={[w.free]:0,[w.startup]:10,[w.business]:20,[w.enterprise]:30};function O(e){const a=e;return a.init=l=>p=>e(p,l),a}const N=e=>O(e);async function F({editor:e,plan:a,pluginName:l,licenseKey:p,onLicenseCheckResponse:n,cleanup:r}){let c="",o;const t=i=>{console.warn("Cleanup plugin:",l,"Reason:",i),r()},g=(i={})=>{var M;const{error:R,sdkLicense:A}=i,u=(M=i.plan)==null?void 0:M.category;if(!(A||i.license)||R)t(R||"Invalid license");else if(u){const T=B[a],V=B[u];T>V&&t({pluginRequiredPlan:a,licensePlan:u})}};e.Commands.has($.settings)&&(o=e.runCommand($.settings),c=(o==null?void 0:o.baseUrl)||"");const h=i=>{n==null||n(i),i&&g(i)};if(!o){e.onReady(async()=>{if(!I())if(p){const i=await C({licenseKey:p,pluginName:l,baseApiUrl:c});h(i)}else t("The `licenseKey` option not provided")});return}if(o.licensePlan||o.licenseError){const i=_(o);h(i);return}e.on(H,i=>h(i))}const _=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function C(e){const{licenseKey:a,pluginName:l,baseApiUrl:p}=e;try{return(await E({baseApiUrl:p,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:l}})).result||{}}catch(n){return console.error("Error during SDK license check:",n),!1}}const U=(e,a)=>{var l;return!!((l=e==null?void 0:e.classList)!=null&&l.contains(a))},L=e=>a=>{var l;return((l=a.getAttribute)==null?void 0:l.call(a,P))===e},D="gjs-plg-",P="data-type-role",W="shapeDividerComponent",j=w.startup;return N(function(e,a={}){const{Components:l,Blocks:p,Selectors:n}=e,r="shape-divider",c=`${r}-cnt`,o=`${D}${r}`,t=`${D}${c}`,g=[{id:"tilt",label:"Tilt",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
2
2
  <path d="M240 24V0L0 24h240z"/>
3
3
  </svg>`},{id:"tilt-split",label:"Tilt split",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
4
4
  <path fill-opacity=".3" d="M240 24V0L0 24h240z"/>
@@ -58,9 +58,9 @@
58
58
  <path fill-opacity=".3" d="M0 0v18C21.5 7 49.6 2.2 64.8 6.4 82 11.2 75.4 25.2 91.7 23.9c14.2-1.1 25.8-12.3 40-12.3 10.4 0 7.8 6 18.8 6.9 11.5.8 21.6-5 37.2-9 19.9-5 42.1-5.3 52.3 0V0H0z"/>
59
59
  </svg>`},{id:"zigzag",label:"Zigzag",value:`<svg class="${t}-inv" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1000 38">
60
60
  <path d="M75 38l25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25V.0H0V13l25 25 25-25z"/>
61
- </svg>`}],g={tl:!1,tc:!1,tr:!1,cl:!1,cr:!1,bl:!1,bc:!1,br:!1},s={...g,bc:!0},M={...g,tc:!0},w="shape",u="flip-y",V="flip-x",A="Shape Divider",$=`<svg viewBox="0 0 22 22">
61
+ </svg>`}],h={tl:!1,tc:!1,tr:!1,cl:!1,cr:!1,bl:!1,bc:!1,br:!1},i={...h,bc:!0},R={...h,tc:!0},A="shape",u="flip-y",x="flip-x",M="Shape Divider",T=`<svg viewBox="0 0 22 22">
62
62
  <path fill="currentColor" d="M2 2v18h18V2H2zm0-2h18a2 2 0 012 2v18a2 2 0 01-2 2H2a2 2 0 01-2-2V2C0 .9.9 0 2 0zM1 13L2 0h18l1 9-20 4z"/>
63
- </svg>`,{block:z={}}=a;e.on(n.events.add,i=>{i.getFullName().startsWith(`.${v}`)&&i.set({private:!0})}),l.addType(o,{isComponent:i=>B(o)(i)||O(i,v),block:z&&{label:A,media:$,category:"Extra",select:!0,...z},model:{defaults:{droppable:!1,highlightable:!1,classes:v,attributes:{[C]:o},components:{type:p},styles:`.${v} { position: relative; }`,delegate:{select:i=>i.findFirstType(p),layer:i=>i.findFirstType(p)}}},view:{onRender(){this.el.style.height="1px"}}}),l.addType(p,{isComponent:B(p),model:{defaults:{droppable:!1,highlightable:!1,classes:t,emptyState:!0,icon:$,name:A,delegate:{remove:i=>i.parent(),move:i=>i.parent(),copy:i=>i.parent()},attributes:{[C]:p},[w]:r[0].id,resizable:s,stylable:["height","width","color"],styles:`
63
+ </svg>`,{block:V={}}=a;e.on(n.events.add,s=>{s.getFullName().startsWith(`.${o}`)&&s.set({private:!0})}),l.addType(r,{isComponent:s=>L(r)(s)||U(s,o),block:V&&{label:M,media:T,category:"Extra",select:!0,...V},model:{defaults:{droppable:!1,highlightable:!1,classes:o,attributes:{[P]:r},components:{type:c},styles:`.${o} { position: relative; }`,delegate:{select:s=>s.findFirstType(c),layer:s=>s.findFirstType(c)}}},view:{onRender(){this.el.style.height="1px"}}}),l.addType(c,{isComponent:L(c),model:{defaults:{droppable:!1,highlightable:!1,classes:t,emptyState:!0,icon:T,name:M,delegate:{remove:s=>s.parent(),move:s=>s.parent(),copy:s=>s.parent()},attributes:{[P]:c},[A]:g[0].id,resizable:i,stylable:["height","width","color"],styles:`
64
64
  .${t} {
65
65
  position: absolute;
66
66
  width: 100%;
@@ -94,4 +94,4 @@
94
94
  .${t}-inv > path {
95
95
  transform: scale(-1, -1) translate(-100%, -100%);
96
96
  }
97
- `,traits:[{type:"select",name:w,label:"Shape",changeProp:!0,options:r.map(({id:i,label:d,value:h})=>({id:i,label:d,icon:{icon:h.replace("<svg ",'<svg style="width: 35px; height: 7px; fill: currentColor;"')}}))},{type:"checkbox",name:u,label:"Flip vertically",changeProp:!0},{type:"checkbox",name:V,label:"flip horizontally",changeProp:!0}]},init(){this.on(`change:${w}`,this.onShapeChange),this.on(`change:${V} change:${u}`,this.onFlip),this.onShapeChange()},onShapeChange(){const i=this.get(w),d=r.find(f=>f.id===i),h=(d==null?void 0:d.value)||this.getInnerHTML().trim();this.components(""),h&&this.set("content",h)},onFlip(){const i=this.get(u),d=this.get(V),h=["fl-v","fl-h","fl-v-h"].map(F=>`${t}--${F}`);let f;i&&d?f=h[2]:d?f=h[1]:i&&(f=h[0]),this.removeClass(h),f&&this.addClass(f),this.set("resizable",i?M:s)}}}),_({editor:e,licenseKey:a.licenseKey,plan:U,pluginName:W,cleanup:()=>{l.removeType(o),c.remove(o)}})})});
97
+ `,traits:[{type:"select",name:A,label:"Shape",changeProp:!0,options:g.map(({id:s,label:d,value:v})=>({id:s,label:d,icon:{icon:v.replace("<svg ",'<svg style="width: 35px; height: 7px; fill: currentColor;"')}}))},{type:"checkbox",name:u,label:"Flip vertically",changeProp:!0},{type:"checkbox",name:x,label:"flip horizontally",changeProp:!0}]},init(){this.on(`change:${A}`,this.onShapeChange),this.on(`change:${x} change:${u}`,this.onFlip),this.onShapeChange()},onShapeChange(){const s=this.get(A),d=g.find(f=>f.id===s),v=(d==null?void 0:d.value)||this.getInnerHTML().trim();this.components(""),v&&this.set("content",v)},onFlip(){const s=this.get(u),d=this.get(x),v=["fl-v","fl-h","fl-v-h"].map(Y=>`${t}--${Y}`);let f;s&&d?f=v[2]:d?f=v[1]:s&&(f=v[0]),this.removeClass(v),f&&this.addClass(f),this.set("resizable",s?R:i)}}}),F({editor:e,licenseKey:a.licenseKey,plan:j,pluginName:W,cleanup:()=>{l.removeType(r),p.remove(r)}})})});