@grapesjs/studio-sdk-plugins 1.0.33-rc.1 → 1.0.33

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 (130) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +161 -156
  3. package/dist/accordionComponent/index.umd.js +9 -9
  4. package/dist/aiChat/chatManager.d.ts +15 -0
  5. package/dist/aiChat/clientTools.d.ts +3 -3
  6. package/dist/aiChat/clientToolsProcessors.d.ts +14 -1
  7. package/dist/aiChat/components/AiChatEmptyState.d.ts +4 -6
  8. package/dist/aiChat/components/AiChatError.d.ts +2 -1
  9. package/dist/aiChat/components/AiChatHeader.d.ts +2 -1
  10. package/dist/aiChat/components/AiChatInput/AssetsSection.d.ts +7 -0
  11. package/dist/aiChat/components/AiChatInput/AttachButton.d.ts +10 -0
  12. package/dist/aiChat/components/AiChatInput/ContextSection.d.ts +5 -0
  13. package/dist/aiChat/components/AiChatInput/DictateButton.d.ts +7 -0
  14. package/dist/aiChat/components/AiChatInput/TextAreaWithAutoResize.d.ts +6 -0
  15. package/dist/aiChat/components/AiChatInput/constants.d.ts +6 -0
  16. package/dist/aiChat/components/AiChatInput/hooks/useSpeechToText.d.ts +15 -0
  17. package/dist/aiChat/components/AiChatInput/index.d.ts +37 -0
  18. package/dist/aiChat/components/AiChatLoadingState.d.ts +2 -1
  19. package/dist/aiChat/components/AiChatMessage.d.ts +21 -9
  20. package/dist/aiChat/components/AiChatMessages.d.ts +5 -7
  21. package/dist/aiChat/components/AiChatMessagesStatus.d.ts +5 -0
  22. package/dist/aiChat/components/AiChatPanel.d.ts +2 -3
  23. package/dist/aiChat/components/AiChatProvider.d.ts +14 -0
  24. package/dist/aiChat/components/MemoizedMarkdown.d.ts +9 -0
  25. package/dist/aiChat/components/index.d.ts +24 -25
  26. package/dist/aiChat/components/utils.d.ts +12 -4
  27. package/dist/aiChat/index.cjs.d.ts +5 -0
  28. package/dist/aiChat/index.cjs.js +453 -0
  29. package/dist/aiChat/index.d.ts +4 -3
  30. package/dist/aiChat/index.es.d.ts +5 -0
  31. package/dist/aiChat/index.es.js +30930 -0
  32. package/dist/aiChat/index.js +453 -0
  33. package/dist/aiChat/index.umd.js +453 -0
  34. package/dist/aiChat/locales/en.d.ts +64 -0
  35. package/dist/aiChat/server/index.cjs.d.ts +4 -0
  36. package/dist/aiChat/server/index.cjs.js +309 -0
  37. package/dist/aiChat/server/index.d.ts +0 -50
  38. package/dist/aiChat/server/index.es.d.ts +4 -0
  39. package/dist/aiChat/server/index.es.js +876 -0
  40. package/dist/aiChat/server/index.js +309 -0
  41. package/dist/aiChat/server/index.umd.js +309 -0
  42. package/dist/aiChat/server/stream.d.ts +0 -6
  43. package/dist/aiChat/server/tools.d.ts +157 -51
  44. package/dist/aiChat/server/types.d.ts +108 -64
  45. package/dist/aiChat/types.d.ts +148 -108
  46. package/dist/aiChat/typesSchema.d.ts +238 -25
  47. package/dist/animationComponent/index.cjs.js +3 -3
  48. package/dist/animationComponent/index.es.js +174 -169
  49. package/dist/animationComponent/index.umd.js +3 -3
  50. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  51. package/dist/canvasAbsoluteMode/index.es.js +161 -156
  52. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  53. package/dist/canvasEmptyState/index.cjs.js +1 -1
  54. package/dist/canvasEmptyState/index.es.js +113 -108
  55. package/dist/canvasEmptyState/index.umd.js +1 -1
  56. package/dist/canvasFullSize/index.cjs.js +9 -9
  57. package/dist/canvasFullSize/index.es.js +137 -132
  58. package/dist/canvasFullSize/index.umd.js +9 -9
  59. package/dist/canvasGridMode/index.cjs.js +4 -4
  60. package/dist/canvasGridMode/index.es.js +168 -163
  61. package/dist/canvasGridMode/index.umd.js +8 -8
  62. package/dist/canvasScreenshot/index.cjs.js +1 -1
  63. package/dist/canvasScreenshot/index.es.js +132 -127
  64. package/dist/canvasScreenshot/index.umd.js +1 -1
  65. package/dist/dataSourceEjs/index.cjs.js +5 -5
  66. package/dist/dataSourceEjs/index.es.js +151 -146
  67. package/dist/dataSourceEjs/index.umd.js +5 -5
  68. package/dist/dataSourceHandlebars/index.cjs.js +4 -4
  69. package/dist/dataSourceHandlebars/index.es.js +91 -86
  70. package/dist/dataSourceHandlebars/index.umd.js +5 -5
  71. package/dist/dialogComponent/index.cjs.js +16 -16
  72. package/dist/dialogComponent/index.es.js +117 -112
  73. package/dist/dialogComponent/index.umd.js +16 -16
  74. package/dist/flexComponent/index.cjs.js +11 -11
  75. package/dist/flexComponent/index.es.js +416 -411
  76. package/dist/flexComponent/index.umd.js +11 -11
  77. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  78. package/dist/fsLightboxComponent/index.es.js +152 -147
  79. package/dist/fsLightboxComponent/index.umd.js +3 -3
  80. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  81. package/dist/googleFontsAssetProvider/index.es.js +127 -122
  82. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  83. package/dist/iconifyComponent/index.cjs.js +2 -2
  84. package/dist/iconifyComponent/index.es.js +170 -165
  85. package/dist/iconifyComponent/index.umd.js +2 -2
  86. package/dist/index.cjs.js +1 -1
  87. package/dist/index.es.js +27 -22
  88. package/dist/index.umd.js +1 -1
  89. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  90. package/dist/layoutSidebarButtons/index.es.js +156 -151
  91. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  92. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  93. package/dist/lightGalleryComponent/index.es.js +197 -192
  94. package/dist/lightGalleryComponent/index.umd.js +1 -1
  95. package/dist/linkImageComponent/index.cjs.js +2 -2
  96. package/dist/linkImageComponent/index.es.js +86 -81
  97. package/dist/linkImageComponent/index.umd.js +2 -2
  98. package/dist/listPagesComponent/index.cjs.js +5 -5
  99. package/dist/listPagesComponent/index.es.js +121 -116
  100. package/dist/listPagesComponent/index.umd.js +5 -5
  101. package/dist/presetPrintable/index.cjs.js +4 -4
  102. package/dist/presetPrintable/index.es.js +180 -175
  103. package/dist/presetPrintable/index.umd.js +4 -4
  104. package/dist/prosemirror/index.cjs.js +6 -6
  105. package/dist/prosemirror/index.es.js +128 -123
  106. package/dist/prosemirror/index.umd.js +8 -8
  107. package/dist/rendererReact/index.cjs.js +1 -1
  108. package/dist/rendererReact/index.es.js +127 -122
  109. package/dist/rendererReact/index.js +1 -1
  110. package/dist/rendererReact/index.umd.js +1 -1
  111. package/dist/rteTinyMce/index.cjs.js +2 -2
  112. package/dist/rteTinyMce/index.es.js +160 -155
  113. package/dist/rteTinyMce/index.umd.js +2 -2
  114. package/dist/shapeDividerComponent/index.cjs.js +25 -25
  115. package/dist/shapeDividerComponent/index.es.js +127 -122
  116. package/dist/shapeDividerComponent/index.umd.js +25 -25
  117. package/dist/swiperComponent/index.cjs.js +9 -9
  118. package/dist/swiperComponent/index.es.js +197 -192
  119. package/dist/swiperComponent/index.umd.js +9 -9
  120. package/dist/tableComponent/index.cjs.js +1 -1
  121. package/dist/tableComponent/index.es.js +227 -222
  122. package/dist/tableComponent/index.umd.js +1 -1
  123. package/dist/types.d.ts +1 -1
  124. package/dist/utils.d.ts +12 -1
  125. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  126. package/dist/youtubeAssetProvider/index.es.js +124 -119
  127. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  128. package/package.json +5 -2
  129. package/dist/aiChat/components/AiChatInput.d.ts +0 -17
  130. package/dist/aiChat/server/stream-utils.d.ts +0 -16
@@ -1,10 +1,10 @@
1
- (function(h,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("handlebars/dist/cjs/handlebars")):typeof define=="function"&&define.amd?define(["handlebars/dist/cjs/handlebars"],p):(h=typeof globalThis<"u"?globalThis:h||self,h.StudioSdkPlugins_dataSourceHandlebars=p(h.Handlebars))})(this,function(h){"use strict";const p="app.grapesjs.com",P="app-stage.grapesjs.com",S=[p,"app2.grapesjs.com",P,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],E="license:check:start",x="license:check:end",I=()=>typeof window<"u",C=({isDev:i,isStage:t})=>`${i?"":`https://${t?P:p}`}/api`,k=()=>{const i=I()&&window.location.hostname;return!!i&&(S.includes(i)||S.some(t=>i.endsWith(t)))};async function N({path:i,baseApiUrl:t,method:e="GET",headers:n={},params:s,body:a}){const o=`${t||C({isDev:!1,isStage:!1})}${i}`,c={method:e,headers:{"Content-Type":"application/json",...n}};a&&(c.body=JSON.stringify(a));const u=s?new URLSearchParams(s).toString():"",l=u?`?${u}`:"",m=await fetch(`${o}${l}`,c);if(!m.ok)throw new Error(`HTTP error! status: ${m.status}`);return m.json()}var d=(i=>(i.free="free",i.startup="startup",i.business="business",i.enterprise="enterprise",i))(d||{});const y={[d.free]:0,[d.startup]:10,[d.business]:20,[d.enterprise]:30};function _(i){const t=i;return t.init=e=>n=>i(n,e),t}const T=i=>_(i);async function v({editor:i,plan:t,pluginName:e,licenseKey:n,cleanup:s}){let a="",r=!1;const o=k(),c=l=>{console.warn("Cleanup plugin:",e,"Reason:",l),s()},u=(l={})=>{var $;const{error:m,sdkLicense:H}=l,g=($=l.plan)==null?void 0:$.category;if(!(H||l.license)||m)c(m||"Invalid license");else if(g){const U=y[t],B=y[g];U>B&&c({pluginRequiredPlan:t,licensePlan:g})}};i.on(E,l=>{a=l==null?void 0:l.baseApiUrl,r=!0}),i.on(x,l=>{u(l)}),setTimeout(async()=>{if(!r){if(o)return;if(n){const l=await O({licenseKey:n,pluginName:e,baseApiUrl:a});l&&u(l)}else c("The `licenseKey` option not provided")}},2e3)}async function O(i){const{licenseKey:t,pluginName:e,baseApiUrl:n}=i;try{return(await N({baseApiUrl:n,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:e}})).result||{}}catch(s){return console.error("Error during SDK license check:",s),!1}}const L=(i,t)=>(i.config.optsHtml={...i.config.optsHtml,exporter:t},()=>{i.config.optsHtml.exporter=void 0}),A=(i,t)=>{const e=s=>{const{input:a}=s,{contains:r}=t;(!r||a.includes(r))&&(s.input=t.importer.import(a))},n=i.Parser.events.htmlBefore;return i.on(n,e),()=>{i.off(n,e)}},b={equals:"equals",isTruthy:"isTruthy",isFalsy:"isFalsy",isDefined:"isDefined",isNull:"isNull",isUndefined:"isUndefined",isArray:"isArray",isObject:"isObject",isString:"isString",isNumber:"isNumber",isBoolean:"isBoolean",isDefaultValue:"isDefaultValue"},w={...b,...{">":"numGt","<":"numLt",">=":"numGte","<=":"numLte","=":"numEq","!=":"numNeq"},...{contains:"strContains",startsWith:"strStartsWith",endsWith:"strEndsWith",equalsIgnoreCase:"strEqualsIgnoreCase",trimEquals:"strTrimEquals"}};class j{getHelperId(t){return w[t]||t}getFullPath({collectionId:t,path:e}){let n=e;return t&&(n=[this._sanitizeVariableName(t),e].filter(Boolean).join(".")),n||""}getVariableSyntax({dataResolver:t}){const{defaultValue:e}=t,n=this.getFullPath(t);return e?`{{#if ${n}}}{{{${n}}}}{{else}}${e}{{/if}}`:`{{{${n}}}}`}getCollectionStartSyntax({dataResolver:t}){const{collectionId:e,dataSource:n}=t,s=n==null?void 0:n.path;let a="";if(t.startIndex!==void 0||t.endIndex!==void 0){const u=t.startIndex??0,l=t.endIndex!==void 0?t.endIndex:"";l!==""?a=` (slice ${s} ${u} ${l})`:a=` (slice ${s} ${u})`}const o=` as |${this._sanitizeVariableName(e)}|`;return`{{#each ${a||s}${o}}}`}getCollectionEndSyntax(){return"{{/each}}"}getConditionalStartSyntax({dataResolver:t}){const e=t.condition;if(!e)return"";const n=e,s=e;if(s.statements&&s.logicalOperator==="and"||s.logicalOperator==="or"){const{statements:a}=s,r=s.logicalOperator,o=a.map(u=>this._parseCondition(u)).join(" ");return`{{#if ${a.length>1?`(${r} ${o})`:o}}}`}else return`{{#if ${this._parseCondition(n)}}}`}_parseCondition(t){if(!t)return"";const e=t,n=t;if(n.statements&&n.logicalOperator==="and"||n.logicalOperator==="or"){const{statements:s}=n,a=n.logicalOperator,r=n.statements.map(o=>this._parseCondition(o)).join(" ");return s.length>1?`(${a} ${r})`:r}else{const s=e.operator,a=this.getHelperId(s),r=this._parseValue(e.left),o=this._parseValue(e.right);return this.getExpressionStr(a,r,o)}}getExpressionStr(t,e,n){return b[t]?t==="isTruthy"?e:t==="isFalsy"?`!${e}`:`${t} ${e}`:`(${t} ${e} ${n})`}_parseValue(t){return typeof t=="object"?this.getFullPath(t):typeof t=="string"?`'${t.replace(/'/g,"\\'")}'`:String(t)}_sanitizeVariableName(t){return t.replace(/[^a-zA-Z0-9_$]/g,"_")}getConditionElseSyntax(){return"{{else}}"}getConditionalEndSyntax(){return"{{/if}}"}}class D{constructor(){this.messages=[],this.collectionStack=[]}import(t){this.messages=[],this.collectionStack=[];const e=this.parse(t);return this.astToGrapesJS(e)}parse(t){try{return h.parse(t)}catch(e){if(e instanceof Error&&e.message.includes("Parse error")){const n=e.message.match(/line (\d+)/),s=n?parseInt(n[1]):0,a=e.message.match(/column (\d+)/),r=a?parseInt(a[1]):0;throw new Error(`Handlebars syntax error at line ${s}, column ${r}: ${e.message}`)}throw e}}astToGrapesJS(t){switch(t.type){case"Program":return this.handleProgram(t);case"ContentStatement":return this.handleContentStatement(t);case"MustacheStatement":return this.handleMustacheStatement(t);case"BlockStatement":return this.handleBlockStatement(t);case"PartialStatement":return this.handlePartialStatement(t);case"CommentStatement":return this.handleCommentStatement(t);case"ElementNode":return this.handleElementNode(t);case"TextNode":return this.handleTextNode(t);default:return this.addMessage("warning",`Unsupported node type: ${t.type}`,t.loc),""}}handleProgram(t){let e="";if(t.body)for(const n of t.body)e+=this.astToGrapesJS(n);return e}handleContentStatement(t){return t.value||""}handleMustacheStatement(t,e={}){const n=this.getExpressionString(t.path),s={...e};return this.collectionStack.length>0?this.processPathWithCollectionContext(n,s):s.path=n,`<data-variable data-gjs-data-resolver='${JSON.stringify(s)}'></data-variable>`}processPathWithCollectionContext(t,e){t.startsWith("@")?this.handleDirectCollectionReference(t,e):this.handleRelativePathReference(t,e)}handleDirectCollectionReference(t,e){if(this.isSpecialIterationVariable(t)){this.setSpecialVariableResolver(this.collectionStack[this.collectionStack.length-1],t,e);return}const[n,...s]=t.substring(1).split("/"),a=s.join(".");this.collectionStack.includes(n)?this.setCurrentItemResolver(n,a,e):this.handleParentReferenceFallback(t,e)}isSpecialIterationVariable(t){return["index","@index","key","@key"].includes(t)}setSpecialVariableResolver(t,e,n){n.collectionId=t;const s={index:"currentIndex","@index":"currentIndex",key:"currentKey","@key":"currentKey"};n.variableType=s[e]}setCurrentItemResolver(t,e,n){n.collectionId=t,n.variableType="currentItem",e&&(n.path=e)}handleRelativePathReference(t,e){const n=f(t),{parentLevel:s,remainingPathParts:a}=this.calculateParentLevel(n),r=a.join("."),o=this.collectionStack.length-1-s;o>=0&&o<this.collectionStack.length?this.resolveRelativePath(r,o,e):e.path=a.join(".")}calculateParentLevel(t){const e=this.collectionStack.findLastIndex(a=>a===t[0]);if(e!==-1)return{parentLevel:this.collectionStack.length-1-e,remainingPathParts:t.slice(1)};let n=0;const s=[...t];for(;s[0]==="..";)n++,s.shift();return{parentLevel:n,remainingPathParts:s}}resolveRelativePath(t,e,n){const s=this.collectionStack[e];n.collectionId=s,n.variableType="currentItem",t!=="this"&&(n.path=t.startsWith("this.")?t.split(".").slice(1).join("."):t)}handleParentReferenceFallback(t,e){const n=f(t),{parentLevel:s,remainingPathParts:a}=this.calculateParentLevel(n),r=a.join("."),o=this.collectionStack.length-1-s;o>=0&&o<this.collectionStack.length?this.resolveRelativePath(r,o,e):e.path=a.join(".")}handleBlockStatement(t){const e=t.path.original;switch(e){case"if":case"unless":return this.handleConditionalBlock(t,e);case"each":return this.handleEachBlock(t);default:return this.addMessage("warning",`Unsupported block helper: ${e}`,t.loc),this.handleGenericBlock(t)}}handleConditionalBlock(t,e){const a={logicalOperator:"and",statements:[{left:{type:"data-variable",path:this.getExpressionString(t.params[0])},operator:e==="unless"?"isFalsy":"isTruthy"}]},r=this.handleProgram(t.program),o=t.inverse?this.handleProgram(t.inverse):"";return`
2
- <data-condition data-gjs-data-resolver='${JSON.stringify({condition:a})}'>
1
+ (function(p,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("handlebars/dist/cjs/handlebars")):typeof define=="function"&&define.amd?define(["handlebars/dist/cjs/handlebars"],d):(p=typeof globalThis<"u"?globalThis:p||self,p.StudioSdkPlugins_dataSourceHandlebars=d(p.Handlebars))})(this,function(p){"use strict";const d="app.grapesjs.com",P="app-stage.grapesjs.com",S=[d,"app2.grapesjs.com",P,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],x="license:check:start",I="license:check:end",N=()=>typeof window<"u",_=({isDev:a,isStage:t,isPlatform:e})=>`${a?"":`https://${t?P:d}`}/${e?"platform-api":"api"}`,T=()=>{const a=N()&&window.location.hostname;return!!a&&(S.includes(a)||S.some(t=>a.endsWith(t)))};async function v({path:a,baseApiUrl:t,method:e="GET",headers:n={},params:s,body:i}){const l=`${t||_({isDev:!1,isStage:!1})}${a}`,u={method:e,headers:{"Content-Type":"application/json",...n}};i&&(u.body=JSON.stringify(i));const c=s?new URLSearchParams(s).toString():"",h=c?`?${c}`:"",o=await fetch(`${l}${h}`,u);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return o.json()}var m=(a=>(a.free="free",a.startup="startup",a.business="business",a.enterprise="enterprise",a))(m||{});const y={[m.free]:0,[m.startup]:10,[m.business]:20,[m.enterprise]:30};function C(a){const t=a;return t.init=e=>n=>a(n,e),t}const k=a=>C(a);async function O({editor:a,plan:t,pluginName:e,licenseKey:n,onLicenseCheckResponse:s,cleanup:i}){let r="",l=!1;const u=T(),c=o=>{console.warn("Cleanup plugin:",e,"Reason:",o),i()},h=(o={})=>{var E;const{error:$,sdkLicense:B}=o,g=(E=o.plan)==null?void 0:E.category;if(!(B||o.license)||$)c($||"Invalid license");else if(g){const W=y[t],G=y[g];W>G&&c({pluginRequiredPlan:t,licensePlan:g})}};a.on(x,o=>{r=o==null?void 0:o.baseApiUrl,l=!0}),a.on(I,o=>{s==null||s(o),h(o)}),setTimeout(async()=>{if(!l){if(u)return;if(n){const o=await A({licenseKey:n,pluginName:e,baseApiUrl:r});s==null||s(o),o&&h(o)}else c("The `licenseKey` option not provided")}},2e3)}async function A(a){const{licenseKey:t,pluginName:e,baseApiUrl:n}=a;try{return(await v({baseApiUrl:n,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:e}})).result||{}}catch(s){return console.error("Error during SDK license check:",s),!1}}const w=(a,t)=>(a.config.optsHtml={...a.config.optsHtml,exporter:t},()=>{a.config.optsHtml.exporter=void 0}),L=(a,t)=>{const e=s=>{const{input:i}=s,{contains:r}=t;(!r||i.includes(r))&&(s.input=t.importer.import(i))},n=a.Parser.events.htmlBefore;return a.on(n,e),()=>{a.off(n,e)}},b={equals:"equals",isTruthy:"isTruthy",isFalsy:"isFalsy",isDefined:"isDefined",isNull:"isNull",isUndefined:"isUndefined",isArray:"isArray",isObject:"isObject",isString:"isString",isNumber:"isNumber",isBoolean:"isBoolean",isDefaultValue:"isDefaultValue"},j={...b,...{">":"numGt","<":"numLt",">=":"numGte","<=":"numLte","=":"numEq","!=":"numNeq"},...{contains:"strContains",startsWith:"strStartsWith",endsWith:"strEndsWith",equalsIgnoreCase:"strEqualsIgnoreCase",trimEquals:"strTrimEquals"}};class D{getHelperId(t){return j[t]||t}getFullPath({collectionId:t,path:e}){let n=e;return t&&(n=[this._sanitizeVariableName(t),e].filter(Boolean).join(".")),n||""}getVariableSyntax({dataResolver:t}){const{defaultValue:e}=t,n=this.getFullPath(t);return e?`{{#if ${n}}}{{{${n}}}}{{else}}${e}{{/if}}`:`{{{${n}}}}`}getCollectionStartSyntax({dataResolver:t}){const{collectionId:e,dataSource:n}=t,s=n==null?void 0:n.path;let i="";if(t.startIndex!==void 0||t.endIndex!==void 0){const c=t.startIndex??0,h=t.endIndex!==void 0?t.endIndex:"";h!==""?i=` (slice ${s} ${c} ${h})`:i=` (slice ${s} ${c})`}const l=` as |${this._sanitizeVariableName(e)}|`;return`{{#each ${i||s}${l}}}`}getCollectionEndSyntax(){return"{{/each}}"}getConditionalStartSyntax({dataResolver:t}){const e=t.condition;if(!e)return"";const n=e,s=e;if(s.statements&&s.logicalOperator==="and"||s.logicalOperator==="or"){const{statements:i}=s,r=s.logicalOperator,l=i.map(c=>this._parseCondition(c)).join(" ");return`{{#if ${i.length>1?`(${r} ${l})`:l}}}`}else return`{{#if ${this._parseCondition(n)}}}`}_parseCondition(t){if(!t)return"";const e=t,n=t;if(n.statements&&n.logicalOperator==="and"||n.logicalOperator==="or"){const{statements:s}=n,i=n.logicalOperator,r=n.statements.map(l=>this._parseCondition(l)).join(" ");return s.length>1?`(${i} ${r})`:r}else{const s=e.operator,i=this.getHelperId(s),r=this._parseValue(e.left),l=this._parseValue(e.right);return this.getExpressionStr(i,r,l)}}getExpressionStr(t,e,n){return b[t]?t==="isTruthy"?e:t==="isFalsy"?`!${e}`:`${t} ${e}`:`(${t} ${e} ${n})`}_parseValue(t){return typeof t=="object"?this.getFullPath(t):typeof t=="string"?`'${t.replace(/'/g,"\\'")}'`:String(t)}_sanitizeVariableName(t){return t.replace(/[^a-zA-Z0-9_$]/g,"_")}getConditionElseSyntax(){return"{{else}}"}getConditionalEndSyntax(){return"{{/if}}"}}class M{constructor(){this.messages=[],this.collectionStack=[]}import(t){this.messages=[],this.collectionStack=[];const e=this.parse(t);return this.astToGrapesJS(e)}parse(t){try{return p.parse(t)}catch(e){if(e instanceof Error&&e.message.includes("Parse error")){const n=e.message.match(/line (\d+)/),s=n?parseInt(n[1]):0,i=e.message.match(/column (\d+)/),r=i?parseInt(i[1]):0;throw new Error(`Handlebars syntax error at line ${s}, column ${r}: ${e.message}`)}throw e}}astToGrapesJS(t){switch(t.type){case"Program":return this.handleProgram(t);case"ContentStatement":return this.handleContentStatement(t);case"MustacheStatement":return this.handleMustacheStatement(t);case"BlockStatement":return this.handleBlockStatement(t);case"PartialStatement":return this.handlePartialStatement(t);case"CommentStatement":return this.handleCommentStatement(t);case"ElementNode":return this.handleElementNode(t);case"TextNode":return this.handleTextNode(t);default:return this.addMessage("warning",`Unsupported node type: ${t.type}`,t.loc),""}}handleProgram(t){let e="";if(t.body)for(const n of t.body)e+=this.astToGrapesJS(n);return e}handleContentStatement(t){return t.value||""}handleMustacheStatement(t,e={}){const n=this.getExpressionString(t.path),s={...e};return this.collectionStack.length>0?this.processPathWithCollectionContext(n,s):s.path=n,`<data-variable data-gjs-data-resolver='${JSON.stringify(s)}'></data-variable>`}processPathWithCollectionContext(t,e){t.startsWith("@")?this.handleDirectCollectionReference(t,e):this.handleRelativePathReference(t,e)}handleDirectCollectionReference(t,e){if(this.isSpecialIterationVariable(t)){this.setSpecialVariableResolver(this.collectionStack[this.collectionStack.length-1],t,e);return}const[n,...s]=t.substring(1).split("/"),i=s.join(".");this.collectionStack.includes(n)?this.setCurrentItemResolver(n,i,e):this.handleParentReferenceFallback(t,e)}isSpecialIterationVariable(t){return["index","@index","key","@key"].includes(t)}setSpecialVariableResolver(t,e,n){n.collectionId=t;const s={index:"currentIndex","@index":"currentIndex",key:"currentKey","@key":"currentKey"};n.variableType=s[e]}setCurrentItemResolver(t,e,n){n.collectionId=t,n.variableType="currentItem",e&&(n.path=e)}handleRelativePathReference(t,e){const n=f(t),{parentLevel:s,remainingPathParts:i}=this.calculateParentLevel(n),r=i.join("."),l=this.collectionStack.length-1-s;l>=0&&l<this.collectionStack.length?this.resolveRelativePath(r,l,e):e.path=i.join(".")}calculateParentLevel(t){const e=this.collectionStack.findLastIndex(i=>i===t[0]);if(e!==-1)return{parentLevel:this.collectionStack.length-1-e,remainingPathParts:t.slice(1)};let n=0;const s=[...t];for(;s[0]==="..";)n++,s.shift();return{parentLevel:n,remainingPathParts:s}}resolveRelativePath(t,e,n){const s=this.collectionStack[e];n.collectionId=s,n.variableType="currentItem",t!=="this"&&(n.path=t.startsWith("this.")?t.split(".").slice(1).join("."):t)}handleParentReferenceFallback(t,e){const n=f(t),{parentLevel:s,remainingPathParts:i}=this.calculateParentLevel(n),r=i.join("."),l=this.collectionStack.length-1-s;l>=0&&l<this.collectionStack.length?this.resolveRelativePath(r,l,e):e.path=i.join(".")}handleBlockStatement(t){const e=t.path.original;switch(e){case"if":case"unless":return this.handleConditionalBlock(t,e);case"each":return this.handleEachBlock(t);default:return this.addMessage("warning",`Unsupported block helper: ${e}`,t.loc),this.handleGenericBlock(t)}}handleConditionalBlock(t,e){const i={logicalOperator:"and",statements:[{left:{type:"data-variable",path:this.getExpressionString(t.params[0])},operator:e==="unless"?"isFalsy":"isTruthy"}]},r=this.handleProgram(t.program),l=t.inverse?this.handleProgram(t.inverse):"";return`
2
+ <data-condition data-gjs-data-resolver='${JSON.stringify({condition:i})}'>
3
3
  <data-condition-true-content>${r}</data-condition-true-content>
4
- <data-condition-false-content>${o}</data-condition-false-content>
4
+ <data-condition-false-content>${l}</data-condition-false-content>
5
5
  </data-condition>
6
- `}handleEachBlock(t){var a,r,o;const e=this.getExpressionString(t.params[0]);let n;t.params.length>=3&&t.params[1]==="as"&&((a=t.params[2])==null?void 0:a.type)==="PathExpression"?n=t.params[2].original:(o=(r=t.program)==null?void 0:r.blockParams)!=null&&o.length?n=t.program.blockParams[0]:n=`collection-${Math.random().toString(36).substring(2,10)}`,this.collectionStack.push(n);const s=this.handleProgram(t.program);return this.collectionStack.pop(),`
6
+ `}handleEachBlock(t){var i,r,l;const e=this.getExpressionString(t.params[0]);let n;t.params.length>=3&&t.params[1]==="as"&&((i=t.params[2])==null?void 0:i.type)==="PathExpression"?n=t.params[2].original:(l=(r=t.program)==null?void 0:r.blockParams)!=null&&l.length?n=t.program.blockParams[0]:n=`collection-${Math.random().toString(36).substring(2,10)}`,this.collectionStack.push(n);const s=this.handleProgram(t.program);return this.collectionStack.pop(),`
7
7
  <data-collection data-gjs-data-resolver='${JSON.stringify({dataSource:{type:"data-variable",path:e},collectionId:n})}'>
8
8
  <data-collection-item>${s}</data-collection-item>
9
9
  </data-collection>
10
- `}handleCommentStatement(t){return`<!--${t.value}-->`}handleElementNode(t){let e="";if(t.attributes)for(const s of t.attributes)s.value.type==="TextNode"?e+=` ${s.name}="${s.value.chars}"`:(this.addMessage("warning",`Complex attribute values not fully supported: ${s.name}`,t.loc),e+=` ${s.name}="${this.getExpressionString(s.value)}"`);let n="";if(t.children)for(const s of t.children)n+=this.astToGrapesJS(s);return`<${t.tag}${e}>${n}</${t.tag}>`}handleTextNode(t){return t.chars||""}handlePartialStatement(t){return this.addMessage("warning",`Partials are not fully supported: ${t.name.original}`,t.loc),`{{> ${t.name.original}}}`}handleGenericBlock(t){const e=this.handleProgram(t.program);return`<!-- Unsupported block: ${t.path.original} -->${e}`}getExpressionString(t){return t.type==="PathExpression"?t.original:t.type==="StringLiteral"?t.value:t.type==="NumberLiteral"?t.value.toString():t.type==="BooleanLiteral"?t.value?"true":"false":t.type==="SubExpression"?this.getExpressionString(t.params[0]):t.type==="Hash"?`{${t.pairs.map(n=>`${n.key}=${this.getExpressionString(n.value)}`).join(", ")}}`:(this.addMessage("warning",`Complex expression type not fully supported: ${t.type}`,t.loc),"")}addMessage(t,e,n){this.messages.push({type:t,message:e,location:n?{line:n.start.line,column:n.start.column}:void 0})}}const f=i=>{if(i==null||i==="")return[];if(i===".")return["this"];if(i===".."||i==="../")return[".."];if(i.startsWith("../")){const r=i.substring(3);return["..",...f(r)]}const t=[];let e=0,n=i.replace(/\[(?:(['"])(.*?)\1|([^\]]*))\]/g,(r,o,c,u)=>{const l=c!==void 0?c:u||"";return t[e]=l,`__HANDLEBARS_PLACEHOLDER_${e++}__`});n=n.replace(/\//g,".");const s=n.split("."),a=[];for(const r of s){const o=/^__HANDLEBARS_PLACEHOLDER_(\d+)__$/.exec(r);if(o){const c=parseInt(o[1],10);a.push(t[c])}else r!==""&&a.push(r)}return a},M="dataSourceHandlebars",R=d.startup;return T(function(i,t={}){const e=L(i,new j),n=A(i,{contains:"{{",importer:new D});v({editor:i,licenseKey:t.licenseKey,plan:R,pluginName:M,cleanup:()=>{e(),n()}})})});
10
+ `}handleCommentStatement(t){return`<!--${t.value}-->`}handleElementNode(t){let e="";if(t.attributes)for(const s of t.attributes)s.value.type==="TextNode"?e+=` ${s.name}="${s.value.chars}"`:(this.addMessage("warning",`Complex attribute values not fully supported: ${s.name}`,t.loc),e+=` ${s.name}="${this.getExpressionString(s.value)}"`);let n="";if(t.children)for(const s of t.children)n+=this.astToGrapesJS(s);return`<${t.tag}${e}>${n}</${t.tag}>`}handleTextNode(t){return t.chars||""}handlePartialStatement(t){return this.addMessage("warning",`Partials are not fully supported: ${t.name.original}`,t.loc),`{{> ${t.name.original}}}`}handleGenericBlock(t){const e=this.handleProgram(t.program);return`<!-- Unsupported block: ${t.path.original} -->${e}`}getExpressionString(t){return t.type==="PathExpression"?t.original:t.type==="StringLiteral"?t.value:t.type==="NumberLiteral"?t.value.toString():t.type==="BooleanLiteral"?t.value?"true":"false":t.type==="SubExpression"?this.getExpressionString(t.params[0]):t.type==="Hash"?`{${t.pairs.map(n=>`${n.key}=${this.getExpressionString(n.value)}`).join(", ")}}`:(this.addMessage("warning",`Complex expression type not fully supported: ${t.type}`,t.loc),"")}addMessage(t,e,n){this.messages.push({type:t,message:e,location:n?{line:n.start.line,column:n.start.column}:void 0})}}const f=a=>{if(a==null||a==="")return[];if(a===".")return["this"];if(a===".."||a==="../")return[".."];if(a.startsWith("../")){const r=a.substring(3);return["..",...f(r)]}const t=[];let e=0,n=a.replace(/\[(?:(['"])(.*?)\1|([^\]]*))\]/g,(r,l,u,c)=>{const h=u!==void 0?u:c||"";return t[e]=h,`__HANDLEBARS_PLACEHOLDER_${e++}__`});n=n.replace(/\//g,".");const s=n.split("."),i=[];for(const r of s){const l=/^__HANDLEBARS_PLACEHOLDER_(\d+)__$/.exec(r);if(l){const u=parseInt(l[1],10);i.push(t[u])}else r!==""&&i.push(r)}return i},H="dataSourceHandlebars",U=m.startup;return k(function(a,t={}){const e=w(a,new D),n=L(a,{contains:"{{",importer:new M});O({editor:a,licenseKey:t.licenseKey,plan:U,pluginName:H,cleanup:()=>{e(),n()}})})});
@@ -1,14 +1,14 @@
1
- "use strict";const C="app.grapesjs.com",O="app-stage.grapesjs.com",k="app2.grapesjs.com",j="app-stage2.grapesjs.com",L=[C,k,O,j,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],_="license:check:start",$="license:check:end",N=()=>typeof window<"u",D=({isDev:n,isStage:s})=>`${n?"":`https://${s?O:C}`}/api`,A=()=>{const n=N()&&window.location.hostname;return!!n&&(L.includes(n)||L.some(s=>n.endsWith(s)))};async function I({path:n,baseApiUrl:s,method:i="GET",headers:t={},params:p,body:l}){const u=`${s||D({isDev:!1,isStage:!1})}${n}`,r={method:i,headers:{"Content-Type":"application/json",...t}};l&&(r.body=JSON.stringify(l));const d=p?new URLSearchParams(p).toString():"",o=d?`?${d}`:"",c=await fetch(`${u}${o}`,r);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}var W=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(W||{});const P={[W.free]:0,[W.startup]:10,[W.business]:20,[W.enterprise]:30};function q(n){const s=n;return s.init=i=>t=>n(t,i),s}const U=n=>q(n);async function X({editor:n,plan:s,pluginName:i,licenseKey:t,cleanup:p}){let l="",g=!1;const u=A(),r=o=>{console.warn("Cleanup plugin:",i,"Reason:",o),p()},d=(o={})=>{var e;const{error:c,sdkLicense:v}=o,w=(e=o.plan)==null?void 0:e.category;if(!(v||o.license)||c)r(c||"Invalid license");else if(w){const f=P[s],b=P[w];f>b&&r({pluginRequiredPlan:s,licensePlan:w})}};n.on(_,o=>{l=o==null?void 0:o.baseApiUrl,g=!0}),n.on($,o=>{d(o)}),setTimeout(async()=>{if(!g){if(u)return;if(t){const o=await M({licenseKey:t,pluginName:i,baseApiUrl:l});o&&d(o)}else r("The `licenseKey` option not provided")}},2e3)}async function M(n){const{licenseKey:s,pluginName:i,baseApiUrl:t}=n;try{return(await I({baseApiUrl:t,path:`/sdk/${s||"na"}`,method:"POST",params:{d:window.location.hostname,pn:i}})).result||{}}catch(p){return console.error("Error during SDK license check:",p),!1}}const T=(...n)=>n.map(s=>`[data-gjs-type="${s}"]`).join(","),B="dialogComponent",R=function(n,s={}){const{Blocks:i,Components:t}=n,{licenseKey:p}=s,l="gjs-plg-dialog",g="gjs-plg-dialog-overlay",u="gjs-plg-dialog-content",r="gjs-plg-dialog-close",d="gjs-plg-dialog-title",o="gjs-plg-dialog-body",c="gjs-plg-dialog-description",v="gjs-plg-dialog-placeholder";i.add(l,{label:"Dialog",media:`
1
+ "use strict";const x="app.grapesjs.com",S="app-stage.grapesjs.com",C="app2.grapesjs.com",_="app-stage2.grapesjs.com",T=[x,C,S,_,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],$="license:check:start",N="license:check:end",k=()=>typeof window<"u",D=({isDev:n,isStage:l,isPlatform:r})=>`${n?"":`https://${l?S:x}`}/${r?"platform-api":"api"}`,A=()=>{const n=k()&&window.location.hostname;return!!n&&(T.includes(n)||T.some(l=>n.endsWith(l)))};async function I({path:n,baseApiUrl:l,method:r="GET",headers:o={},params:a,body:i}){const d=`${l||D({isDev:!1,isStage:!1})}${n}`,p={method:r,headers:{"Content-Type":"application/json",...o}};i&&(p.body=JSON.stringify(i));const c=a?new URLSearchParams(a).toString():"",g=c?`?${c}`:"",t=await fetch(`${d}${g}`,p);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return t.json()}var W=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(W||{});const O={[W.free]:0,[W.startup]:10,[W.business]:20,[W.enterprise]:30};function q(n){const l=n;return l.init=r=>o=>n(o,r),l}const U=n=>q(n);async function X({editor:n,plan:l,pluginName:r,licenseKey:o,onLicenseCheckResponse:a,cleanup:i}){let u="",d=!1;const p=A(),c=t=>{console.warn("Cleanup plugin:",r,"Reason:",t),i()},g=(t={})=>{var v;const{error:m,sdkLicense:P}=t,s=(v=t.plan)==null?void 0:v.category;if(!(P||t.license)||m)c(m||"Invalid license");else if(s){const b=O[l],w=O[s];b>w&&c({pluginRequiredPlan:l,licensePlan:s})}};n.on($,t=>{u=t==null?void 0:t.baseApiUrl,d=!0}),n.on(N,t=>{a==null||a(t),g(t)}),setTimeout(async()=>{if(!d){if(p)return;if(o){const t=await M({licenseKey:o,pluginName:r,baseApiUrl:u});a==null||a(t),t&&g(t)}else c("The `licenseKey` option not provided")}},2e3)}async function M(n){const{licenseKey:l,pluginName:r,baseApiUrl:o}=n;try{return(await I({baseApiUrl:o,path:`/sdk/${l||"na"}`,method:"POST",params:{d:window.location.hostname,pn:r}})).result||{}}catch(a){return console.error("Error during SDK license check:",a),!1}}const L=(...n)=>n.map(l=>`[data-gjs-type="${l}"]`).join(","),B="dialogComponent",z=function(n,l={}){const{Blocks:r,Components:o}=n,{licenseKey:a}=l,i="gjs-plg-dialog",u="gjs-plg-dialog-overlay",d="gjs-plg-dialog-content",p="gjs-plg-dialog-close",c="gjs-plg-dialog-title",g="gjs-plg-dialog-body",t="gjs-plg-dialog-description",m="gjs-plg-dialog-placeholder";r.add(i,{label:"Dialog",media:`
2
2
  <svg viewBox="0 0 24 24">
3
3
  <path d="M4 4h16v10H8l-4 4V4z"></path>
4
4
  </svg>
5
- `,category:"Extra",content:{type:l},activate:!0,...s.block}),t.addType(l,{model:{defaults:{tagName:"div",attributes:{class:l,"data-type-role":l},components:[{type:g},{type:v}],draggable:T("wrapper"),droppable:T(l),styles:`
6
- .${l} {
5
+ `,category:"Extra",content:{type:i},activate:!0,...l.block}),o.addType(i,{model:{defaults:{tagName:"div",attributes:{class:i,"data-type-role":i},components:[{type:u},{type:m}],draggable:L("wrapper"),droppable:L(i),styles:`
6
+ .${i} {
7
7
  position: relative;
8
8
  z-index: 1;
9
9
  }
10
- `,traits:[{type:"button",label:"Open dialog",name:"onActive",changeProp:!0,command(a){var e;(e=a.getSelected())==null||e.trigger("active")}},{type:"checkbox",label:"Close when pressing X",name:"closeWhenPressingX",default:!0,changeProp:!0},{type:"checkbox",label:"Close when pressing ESC",name:"closeWhenPressingEsc",default:!0,changeProp:!0},{type:"checkbox",label:"Open when leaving the window",name:"openWhenLeavingWindow",default:!1,changeProp:!0},{type:"number",label:"Open when scrolling to level",name:"openWhenScrollingToLevel",default:0,changeProp:!0}],"script-props":["closeWhenPressingX","closeWhenPressingEsc","openWhenLeavingWindow","openWhenScrollingToLevel"],script:function(a){const e=this;function f(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'),y=e.querySelector('[data-type-role="gjs-plg-dialog-close"]');function E(){m.style.display="none"}h?(e._onCloseWhenPressingX=E,y.addEventListener("click",e._onCloseWhenPressingX)):(y.removeEventListener("click",e._onCloseWhenPressingX),e._onCloseWhenPressingX=null)}function b(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(E){E.key==="Escape"&&(m.style.display="none")}h?(e._onCloseWhenPressingEsc=y,e.addEventListener("keydown",e._onCloseWhenPressingEsc)):(e.removeEventListener("keydown",e._onCloseWhenPressingEsc),e._onCloseWhenPressingEsc=null)}function x(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){m.style.display="flex"}h?(e._onOpenWhenLeavingWindow=y,document.addEventListener("mouseleave",e._onOpenWhenLeavingWindow)):(document.removeEventListener("mouseleave",e._onOpenWhenLeavingWindow),e._onOpenWhenLeavingWindow=null)}function S(h){const m=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){const E=document.documentElement.scrollTop;h&&E>=Number(h)&&(m.style.display="flex")}h?(e._onOpenWhenScrollingToLevel=y,document.addEventListener("scroll",e._onOpenWhenScrollingToLevel)):(document.removeEventListener("scroll",e._onOpenWhenScrollingToLevel),e._onOpenWhenScrollingToLevel=null)}f(a.closeWhenPressingX),b(a.closeWhenPressingEsc),x(a.openWhenLeavingWindow),S(a.openWhenScrollingToLevel)}},init(){this.on("active",this.handleOpenWhenClickPlaceholder)},handleOpenWhenClickPlaceholder(){this.view.el.querySelector('[data-type-role="gjs-plg-dialog-placeholder"]').addEventListener("click",()=>{const e=this.view.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');e.style.display="flex"})}},view:{onActive(){const a=this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');a.style.display="flex"}}}),t.addType(g,{model:{defaults:{tagName:"div",attributes:{class:g,"data-type-role":g},components:{type:u},droppable:!1,draggable:!1,styles:`
11
- .${g} {
10
+ `,traits:[{type:"button",label:"Open dialog",name:"onActive",changeProp:!0,command(s){var e;(e=s.getSelected())==null||e.trigger("active")}},{type:"checkbox",label:"Close when pressing X",name:"closeWhenPressingX",default:!0,changeProp:!0},{type:"checkbox",label:"Close when pressing ESC",name:"closeWhenPressingEsc",default:!0,changeProp:!0},{type:"checkbox",label:"Open when leaving the window",name:"openWhenLeavingWindow",default:!1,changeProp:!0},{type:"number",label:"Open when scrolling to level",name:"openWhenScrollingToLevel",default:0,changeProp:!0}],"script-props":["closeWhenPressingX","closeWhenPressingEsc","openWhenLeavingWindow","openWhenScrollingToLevel"],script:function(s){const e=this;function v(h){const f=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'),y=e.querySelector('[data-type-role="gjs-plg-dialog-close"]');function E(){f.style.display="none"}h?(e._onCloseWhenPressingX=E,y.addEventListener("click",e._onCloseWhenPressingX)):(y.removeEventListener("click",e._onCloseWhenPressingX),e._onCloseWhenPressingX=null)}function b(h){const f=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(E){E.key==="Escape"&&(f.style.display="none")}h?(e._onCloseWhenPressingEsc=y,e.addEventListener("keydown",e._onCloseWhenPressingEsc)):(e.removeEventListener("keydown",e._onCloseWhenPressingEsc),e._onCloseWhenPressingEsc=null)}function w(h){const f=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){f.style.display="flex"}h?(e._onOpenWhenLeavingWindow=y,document.addEventListener("mouseleave",e._onOpenWhenLeavingWindow)):(document.removeEventListener("mouseleave",e._onOpenWhenLeavingWindow),e._onOpenWhenLeavingWindow=null)}function j(h){const f=e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function y(){const E=document.documentElement.scrollTop;h&&E>=Number(h)&&(f.style.display="flex")}h?(e._onOpenWhenScrollingToLevel=y,document.addEventListener("scroll",e._onOpenWhenScrollingToLevel)):(document.removeEventListener("scroll",e._onOpenWhenScrollingToLevel),e._onOpenWhenScrollingToLevel=null)}v(s.closeWhenPressingX),b(s.closeWhenPressingEsc),w(s.openWhenLeavingWindow),j(s.openWhenScrollingToLevel)}},init(){this.on("active",this.handleOpenWhenClickPlaceholder)},handleOpenWhenClickPlaceholder(){this.view.el.querySelector('[data-type-role="gjs-plg-dialog-placeholder"]').addEventListener("click",()=>{const e=this.view.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');e.style.display="flex"})}},view:{onActive(){const s=this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');s.style.display="flex"}}}),o.addType(u,{model:{defaults:{tagName:"div",attributes:{class:u,"data-type-role":u},components:{type:d},droppable:!1,draggable:!1,styles:`
11
+ .${u} {
12
12
  position: fixed;
13
13
  top: 0;
14
14
  left: 0;
@@ -19,8 +19,8 @@
19
19
  justify-content: center;
20
20
  background-color: rgba(0, 0, 0, 0.5);
21
21
  }
22
- `}}}),t.addType(u,{model:{defaults:{tagName:"div",attributes:{class:u,"data-type-role":u},components:[{type:r},{type:d},{type:o}],droppable:!1,draggable:!1,styles:`
23
- .${u} {
22
+ `}}}),o.addType(d,{model:{defaults:{tagName:"div",attributes:{class:d,"data-type-role":d},components:[{type:p},{type:c},{type:g}],droppable:!1,draggable:!1,styles:`
23
+ .${d} {
24
24
  position: relative;
25
25
  background-color: #fff;
26
26
  border-radius: 10px;
@@ -30,8 +30,8 @@
30
30
  height: 600px;
31
31
  box-sizing: border-box;
32
32
  }
33
- `}}}),t.addType(r,{model:{defaults:{tagName:"button",attributes:{class:r,"data-type-role":r},components:"&times;",droppable:!1,draggable:!1,styles:`
34
- .${r} {
33
+ `}}}),o.addType(p,{model:{defaults:{tagName:"button",attributes:{class:p,"data-type-role":p},components:"&times;",droppable:!1,draggable:!1,styles:`
34
+ .${p} {
35
35
  position: absolute;
36
36
  top: 10px;
37
37
  right: 10px;
@@ -42,18 +42,18 @@
42
42
  font-size: 20px;
43
43
  cursor: pointer;
44
44
  }
45
- `}}}),t.addType(d,{model:{defaults:{tagName:"h2",attributes:{class:d,"data-type-role":d},components:"Dialog Title",editable:!0,droppable:!1,draggable:!1,styles:`
46
- .${d} {
45
+ `}}}),o.addType(c,{model:{defaults:{tagName:"h2",attributes:{class:c,"data-type-role":c},components:"Dialog Title",editable:!0,droppable:!1,draggable:!1,styles:`
46
+ .${c} {
47
47
  margin: 0;
48
48
  padding: 0 40px 20px 0;
49
49
  }
50
- `}}}),t.addType(o,{model:{defaults:{tagName:"div",attributes:{class:o,"data-type-role":o},components:[{type:c}],styles:`
51
- .${o} {
50
+ `}}}),o.addType(g,{model:{defaults:{tagName:"div",attributes:{class:g,"data-type-role":g},components:[{type:t}],styles:`
51
+ .${g} {
52
52
  height: 90%;
53
53
  overflow: auto;
54
54
  }
55
- `}}}),t.addType(c,{model:{defaults:{tagName:"p",attributes:{class:c,"data-type-role":c},components:"This is a customizable dialog!",editable:!0,styles:`
56
- .${c} {
55
+ `}}}),o.addType(t,{model:{defaults:{tagName:"p",attributes:{class:t,"data-type-role":t},components:"This is a customizable dialog!",editable:!0,styles:`
56
+ .${t} {
57
57
  margin: 0;
58
58
  }
59
- `}}}),t.addType(v,{model:{toHTML(){return""},defaults:{tagName:"button",attributes:{class:v,"data-type-role":v},components:"Dialog (click me to open)",droppable:!1,draggable:!1}},view:{init(){const{em:a,el:e}=this,f="core:preview",b=a.Commands.events;this.listenTo(a,`${b.runCommand}${f}`,()=>{e.style.display="none"}),this.listenTo(a,`${b.stopCommand}${f}`,()=>{e.style.display=""})}}}),X({editor:n,licenseKey:p,plan:W.startup,pluginName:B,cleanup:()=>{i.remove(l),t.removeType(l)}})},z=U(R);module.exports=z;
59
+ `}}}),o.addType(m,{model:{toHTML(){return""},defaults:{tagName:"button",attributes:{class:m,"data-type-role":m},components:"Dialog (click me to open)",droppable:!1,draggable:!1}},view:{init(){const{em:s,el:e}=this,v="core:preview",b=s.Commands.events;this.listenTo(s,`${b.runCommand}${v}`,()=>{e.style.display="none"}),this.listenTo(s,`${b.stopCommand}${v}`,()=>{e.style.display=""})}}}),X({editor:n,licenseKey:a,plan:W.startup,pluginName:B,cleanup:()=>{r.remove(i),o.removeType(i)}})},H=U(z);module.exports=H;
@@ -1,8 +1,8 @@
1
- const C = "app.grapesjs.com", O = "app-stage.grapesjs.com", k = "app2.grapesjs.com", j = "app-stage2.grapesjs.com", L = [
1
+ const x = "app.grapesjs.com", S = "app-stage.grapesjs.com", C = "app2.grapesjs.com", _ = "app-stage2.grapesjs.com", T = [
2
+ x,
2
3
  C,
3
- k,
4
- O,
5
- j,
4
+ S,
5
+ _,
6
6
  "localhost",
7
7
  "127.0.0.1",
8
8
  ".local-credentialless.webcontainer.io",
@@ -11,97 +11,102 @@ const C = "app.grapesjs.com", O = "app-stage.grapesjs.com", k = "app2.grapesjs.c
11
11
  // For stackblitz.com demos
12
12
  "-sandpack.codesandbox.io"
13
13
  // For Sandpack demos
14
- ], _ = "license:check:start", $ = "license:check:end", N = () => typeof window < "u", D = ({ isDev: n, isStage: s }) => `${n ? "" : `https://${s ? O : C}`}/api`, A = () => {
15
- const n = N() && window.location.hostname;
16
- return !!n && (L.includes(n) || L.some((s) => n.endsWith(s)));
14
+ ], $ = "license:check:start", N = "license:check:end", k = () => typeof window < "u", D = ({
15
+ isDev: n,
16
+ isStage: l,
17
+ isPlatform: r
18
+ }) => `${n ? "" : `https://${l ? S : x}`}/${r ? "platform-api" : "api"}`, A = () => {
19
+ const n = k() && window.location.hostname;
20
+ return !!n && (T.includes(n) || T.some((l) => n.endsWith(l)));
17
21
  };
18
22
  async function I({
19
23
  path: n,
20
- baseApiUrl: s,
21
- method: i = "GET",
22
- headers: t = {},
23
- params: p,
24
- body: l
24
+ baseApiUrl: l,
25
+ method: r = "GET",
26
+ headers: o = {},
27
+ params: a,
28
+ body: i
25
29
  }) {
26
- const u = `${s || D({ isDev: !1, isStage: !1 })}${n}`, r = {
27
- method: i,
30
+ const d = `${l || D({ isDev: !1, isStage: !1 })}${n}`, p = {
31
+ method: r,
28
32
  headers: {
29
33
  "Content-Type": "application/json",
30
- ...t
34
+ ...o
31
35
  }
32
36
  };
33
- l && (r.body = JSON.stringify(l));
34
- const d = p ? new URLSearchParams(p).toString() : "", o = d ? `?${d}` : "", c = await fetch(`${u}${o}`, r);
35
- if (!c.ok)
36
- throw new Error(`HTTP error! status: ${c.status}`);
37
- return c.json();
37
+ i && (p.body = JSON.stringify(i));
38
+ const c = a ? new URLSearchParams(a).toString() : "", g = c ? `?${c}` : "", t = await fetch(`${d}${g}`, p);
39
+ if (!t.ok)
40
+ throw new Error(`HTTP error! status: ${t.status}`);
41
+ return t.json();
38
42
  }
39
43
  var W = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(W || {});
40
- const P = {
44
+ const O = {
41
45
  [W.free]: 0,
42
46
  [W.startup]: 10,
43
47
  [W.business]: 20,
44
48
  [W.enterprise]: 30
45
49
  };
46
50
  function q(n) {
47
- const s = n;
48
- return s.init = (i) => (t) => n(t, i), s;
51
+ const l = n;
52
+ return l.init = (r) => (o) => n(o, r), l;
49
53
  }
50
54
  const U = (n) => /* @__PURE__ */ q(n);
51
55
  async function X({
52
56
  editor: n,
53
- plan: s,
54
- pluginName: i,
55
- licenseKey: t,
56
- cleanup: p
57
+ plan: l,
58
+ pluginName: r,
59
+ licenseKey: o,
60
+ onLicenseCheckResponse: a,
61
+ cleanup: i
57
62
  }) {
58
- let l = "", g = !1;
59
- const u = A(), r = (o) => {
60
- console.warn("Cleanup plugin:", i, "Reason:", o), p();
61
- }, d = (o = {}) => {
62
- var e;
63
- const { error: c, sdkLicense: v } = o, w = (e = o.plan) == null ? void 0 : e.category;
64
- if (!(v || o.license) || c)
65
- r(c || "Invalid license");
66
- else if (w) {
67
- const f = P[s], b = P[w];
68
- f > b && r({ pluginRequiredPlan: s, licensePlan: w });
63
+ let u = "", d = !1;
64
+ const p = A(), c = (t) => {
65
+ console.warn("Cleanup plugin:", r, "Reason:", t), i();
66
+ }, g = (t = {}) => {
67
+ var v;
68
+ const { error: m, sdkLicense: P } = t, s = (v = t.plan) == null ? void 0 : v.category;
69
+ if (!(P || t.license) || m)
70
+ c(m || "Invalid license");
71
+ else if (s) {
72
+ const b = O[l], w = O[s];
73
+ b > w && c({ pluginRequiredPlan: l, licensePlan: s });
69
74
  }
70
75
  };
71
- n.on(_, (o) => {
72
- l = o == null ? void 0 : o.baseApiUrl, g = !0;
73
- }), n.on($, (o) => {
74
- d(o);
76
+ n.on($, (t) => {
77
+ u = t == null ? void 0 : t.baseApiUrl, d = !0;
78
+ }), n.on(N, (t) => {
79
+ a == null || a(t), g(t);
75
80
  }), setTimeout(async () => {
76
- if (!g) {
77
- if (u) return;
78
- if (t) {
79
- const o = await M({ licenseKey: t, pluginName: i, baseApiUrl: l });
80
- o && d(o);
81
+ if (!d) {
82
+ if (p) return;
83
+ if (o) {
84
+ const t = await M({ licenseKey: o, pluginName: r, baseApiUrl: u });
85
+ a == null || a(t), t && g(t);
81
86
  } else
82
- r("The `licenseKey` option not provided");
87
+ c("The `licenseKey` option not provided");
83
88
  }
84
89
  }, 2e3);
85
90
  }
86
91
  async function M(n) {
87
- const { licenseKey: s, pluginName: i, baseApiUrl: t } = n;
92
+ const { licenseKey: l, pluginName: r, baseApiUrl: o } = n;
88
93
  try {
89
94
  return (await I({
90
- baseApiUrl: t,
91
- path: `/sdk/${s || "na"}`,
95
+ baseApiUrl: o,
96
+ path: `/sdk/${l || "na"}`,
92
97
  method: "POST",
93
98
  params: {
94
99
  d: window.location.hostname,
95
- pn: i
100
+ pn: r
96
101
  }
97
102
  })).result || {};
98
- } catch (p) {
99
- return console.error("Error during SDK license check:", p), !1;
103
+ } catch (a) {
104
+ return console.error("Error during SDK license check:", a), !1;
100
105
  }
101
106
  }
102
- const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialogComponent", R = function(n, s = {}) {
103
- const { Blocks: i, Components: t } = n, { licenseKey: p } = s, l = "gjs-plg-dialog", g = "gjs-plg-dialog-overlay", u = "gjs-plg-dialog-content", r = "gjs-plg-dialog-close", d = "gjs-plg-dialog-title", o = "gjs-plg-dialog-body", c = "gjs-plg-dialog-description", v = "gjs-plg-dialog-placeholder";
104
- i.add(l, {
107
+ const L = (...n) => n.map((l) => `[data-gjs-type="${l}"]`).join(","), B = "dialogComponent", z = function(n, l = {}) {
108
+ const { Blocks: r, Components: o } = n, { licenseKey: a } = l, i = "gjs-plg-dialog", u = "gjs-plg-dialog-overlay", d = "gjs-plg-dialog-content", p = "gjs-plg-dialog-close", c = "gjs-plg-dialog-title", g = "gjs-plg-dialog-body", t = "gjs-plg-dialog-description", m = "gjs-plg-dialog-placeholder";
109
+ r.add(i, {
105
110
  label: "Dialog",
106
111
  media: `
107
112
  <svg viewBox="0 0 24 24">
@@ -109,19 +114,19 @@ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialo
109
114
  </svg>
110
115
  `,
111
116
  category: "Extra",
112
- content: { type: l },
117
+ content: { type: i },
113
118
  activate: !0,
114
- ...s.block
115
- }), t.addType(l, {
119
+ ...l.block
120
+ }), o.addType(i, {
116
121
  model: {
117
122
  defaults: {
118
123
  tagName: "div",
119
- attributes: { class: l, "data-type-role": l },
120
- components: [{ type: g }, { type: v }],
121
- draggable: T("wrapper"),
122
- droppable: T(l),
124
+ attributes: { class: i, "data-type-role": i },
125
+ components: [{ type: u }, { type: m }],
126
+ draggable: L("wrapper"),
127
+ droppable: L(i),
123
128
  styles: `
124
- .${l} {
129
+ .${i} {
125
130
  position: relative;
126
131
  z-index: 1;
127
132
  }
@@ -132,9 +137,9 @@ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialo
132
137
  label: "Open dialog",
133
138
  name: "onActive",
134
139
  changeProp: !0,
135
- command(a) {
140
+ command(s) {
136
141
  var e;
137
- (e = a.getSelected()) == null || e.trigger("active");
142
+ (e = s.getSelected()) == null || e.trigger("active");
138
143
  }
139
144
  },
140
145
  {
@@ -172,38 +177,38 @@ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialo
172
177
  "openWhenLeavingWindow",
173
178
  "openWhenScrollingToLevel"
174
179
  ],
175
- script: function(a) {
180
+ script: function(s) {
176
181
  const e = this;
177
- function f(h) {
178
- const m = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'), y = e.querySelector('[data-type-role="gjs-plg-dialog-close"]');
182
+ function v(h) {
183
+ const f = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'), y = e.querySelector('[data-type-role="gjs-plg-dialog-close"]');
179
184
  function E() {
180
- m.style.display = "none";
185
+ f.style.display = "none";
181
186
  }
182
187
  h ? (e._onCloseWhenPressingX = E, y.addEventListener("click", e._onCloseWhenPressingX)) : (y.removeEventListener("click", e._onCloseWhenPressingX), e._onCloseWhenPressingX = null);
183
188
  }
184
189
  function b(h) {
185
- const m = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
190
+ const f = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
186
191
  function y(E) {
187
- E.key === "Escape" && (m.style.display = "none");
192
+ E.key === "Escape" && (f.style.display = "none");
188
193
  }
189
194
  h ? (e._onCloseWhenPressingEsc = y, e.addEventListener("keydown", e._onCloseWhenPressingEsc)) : (e.removeEventListener("keydown", e._onCloseWhenPressingEsc), e._onCloseWhenPressingEsc = null);
190
195
  }
191
- function x(h) {
192
- const m = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
196
+ function w(h) {
197
+ const f = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
193
198
  function y() {
194
- m.style.display = "flex";
199
+ f.style.display = "flex";
195
200
  }
196
201
  h ? (e._onOpenWhenLeavingWindow = y, document.addEventListener("mouseleave", e._onOpenWhenLeavingWindow)) : (document.removeEventListener("mouseleave", e._onOpenWhenLeavingWindow), e._onOpenWhenLeavingWindow = null);
197
202
  }
198
- function S(h) {
199
- const m = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
203
+ function j(h) {
204
+ const f = e.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
200
205
  function y() {
201
206
  const E = document.documentElement.scrollTop;
202
- h && E >= Number(h) && (m.style.display = "flex");
207
+ h && E >= Number(h) && (f.style.display = "flex");
203
208
  }
204
209
  h ? (e._onOpenWhenScrollingToLevel = y, document.addEventListener("scroll", e._onOpenWhenScrollingToLevel)) : (document.removeEventListener("scroll", e._onOpenWhenScrollingToLevel), e._onOpenWhenScrollingToLevel = null);
205
210
  }
206
- f(a.closeWhenPressingX), b(a.closeWhenPressingEsc), x(a.openWhenLeavingWindow), S(a.openWhenScrollingToLevel);
211
+ v(s.closeWhenPressingX), b(s.closeWhenPressingEsc), w(s.openWhenLeavingWindow), j(s.openWhenScrollingToLevel);
207
212
  }
208
213
  },
209
214
  init() {
@@ -222,20 +227,20 @@ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialo
222
227
  },
223
228
  view: {
224
229
  onActive() {
225
- const a = this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
226
- a.style.display = "flex";
230
+ const s = this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');
231
+ s.style.display = "flex";
227
232
  }
228
233
  }
229
- }), t.addType(g, {
234
+ }), o.addType(u, {
230
235
  model: {
231
236
  defaults: {
232
237
  tagName: "div",
233
- attributes: { class: g, "data-type-role": g },
234
- components: { type: u },
238
+ attributes: { class: u, "data-type-role": u },
239
+ components: { type: d },
235
240
  droppable: !1,
236
241
  draggable: !1,
237
242
  styles: `
238
- .${g} {
243
+ .${u} {
239
244
  position: fixed;
240
245
  top: 0;
241
246
  left: 0;
@@ -249,16 +254,16 @@ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialo
249
254
  `
250
255
  }
251
256
  }
252
- }), t.addType(u, {
257
+ }), o.addType(d, {
253
258
  model: {
254
259
  defaults: {
255
260
  tagName: "div",
256
- attributes: { class: u, "data-type-role": u },
257
- components: [{ type: r }, { type: d }, { type: o }],
261
+ attributes: { class: d, "data-type-role": d },
262
+ components: [{ type: p }, { type: c }, { type: g }],
258
263
  droppable: !1,
259
264
  draggable: !1,
260
265
  styles: `
261
- .${u} {
266
+ .${d} {
262
267
  position: relative;
263
268
  background-color: #fff;
264
269
  border-radius: 10px;
@@ -271,16 +276,16 @@ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialo
271
276
  `
272
277
  }
273
278
  }
274
- }), t.addType(r, {
279
+ }), o.addType(p, {
275
280
  model: {
276
281
  defaults: {
277
282
  tagName: "button",
278
- attributes: { class: r, "data-type-role": r },
283
+ attributes: { class: p, "data-type-role": p },
279
284
  components: "&times;",
280
285
  droppable: !1,
281
286
  draggable: !1,
282
287
  styles: `
283
- .${r} {
288
+ .${p} {
284
289
  position: absolute;
285
290
  top: 10px;
286
291
  right: 10px;
@@ -294,59 +299,59 @@ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialo
294
299
  `
295
300
  }
296
301
  }
297
- }), t.addType(d, {
302
+ }), o.addType(c, {
298
303
  model: {
299
304
  defaults: {
300
305
  tagName: "h2",
301
- attributes: { class: d, "data-type-role": d },
306
+ attributes: { class: c, "data-type-role": c },
302
307
  components: "Dialog Title",
303
308
  editable: !0,
304
309
  droppable: !1,
305
310
  draggable: !1,
306
311
  styles: `
307
- .${d} {
312
+ .${c} {
308
313
  margin: 0;
309
314
  padding: 0 40px 20px 0;
310
315
  }
311
316
  `
312
317
  }
313
318
  }
314
- }), t.addType(o, {
319
+ }), o.addType(g, {
315
320
  model: {
316
321
  defaults: {
317
322
  tagName: "div",
318
- attributes: { class: o, "data-type-role": o },
319
- components: [{ type: c }],
323
+ attributes: { class: g, "data-type-role": g },
324
+ components: [{ type: t }],
320
325
  styles: `
321
- .${o} {
326
+ .${g} {
322
327
  height: 90%;
323
328
  overflow: auto;
324
329
  }
325
330
  `
326
331
  }
327
332
  }
328
- }), t.addType(c, {
333
+ }), o.addType(t, {
329
334
  model: {
330
335
  defaults: {
331
336
  tagName: "p",
332
- attributes: { class: c, "data-type-role": c },
337
+ attributes: { class: t, "data-type-role": t },
333
338
  components: "This is a customizable dialog!",
334
339
  editable: !0,
335
340
  styles: `
336
- .${c} {
341
+ .${t} {
337
342
  margin: 0;
338
343
  }
339
344
  `
340
345
  }
341
346
  }
342
- }), t.addType(v, {
347
+ }), o.addType(m, {
343
348
  model: {
344
349
  toHTML() {
345
350
  return "";
346
351
  },
347
352
  defaults: {
348
353
  tagName: "button",
349
- attributes: { class: v, "data-type-role": v },
354
+ attributes: { class: m, "data-type-role": m },
350
355
  components: "Dialog (click me to open)",
351
356
  droppable: !1,
352
357
  draggable: !1
@@ -354,24 +359,24 @@ const T = (...n) => n.map((s) => `[data-gjs-type="${s}"]`).join(","), B = "dialo
354
359
  },
355
360
  view: {
356
361
  init() {
357
- const { em: a, el: e } = this, f = "core:preview", b = a.Commands.events;
358
- this.listenTo(a, `${b.runCommand}${f}`, () => {
362
+ const { em: s, el: e } = this, v = "core:preview", b = s.Commands.events;
363
+ this.listenTo(s, `${b.runCommand}${v}`, () => {
359
364
  e.style.display = "none";
360
- }), this.listenTo(a, `${b.stopCommand}${f}`, () => {
365
+ }), this.listenTo(s, `${b.stopCommand}${v}`, () => {
361
366
  e.style.display = "";
362
367
  });
363
368
  }
364
369
  }
365
370
  }), X({
366
371
  editor: n,
367
- licenseKey: p,
372
+ licenseKey: a,
368
373
  plan: W.startup,
369
374
  pluginName: B,
370
375
  cleanup: () => {
371
- i.remove(l), t.removeType(l);
376
+ r.remove(i), o.removeType(i);
372
377
  }
373
378
  });
374
- }, z = U(R);
379
+ }, H = U(z);
375
380
  export {
376
- z as default
381
+ H as default
377
382
  };