@grapesjs/studio-sdk-plugins 1.0.36 → 1.0.38-rc.0
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.
- package/dist/accordionComponent/index.cjs.js +4 -4
- package/dist/accordionComponent/index.es.js +83 -70
- package/dist/accordionComponent/index.umd.js +5 -5
- package/dist/aiChat/clientToolsProcessors.d.ts +1 -2
- package/dist/aiChat/components/utils.d.ts +1 -0
- package/dist/aiChat/components/utilsTw.d.ts +11 -0
- package/dist/aiChat/index.cjs.js +85 -85
- package/dist/aiChat/index.es.js +11151 -10258
- package/dist/aiChat/index.js +85 -85
- package/dist/aiChat/index.umd.js +86 -86
- package/dist/aiChat/locales/en.d.ts +11 -0
- package/dist/aiChat/projectGeneration.d.ts +17 -0
- package/dist/aiChat/server/index.cjs.js +1 -1
- package/dist/aiChat/server/index.es.js +1 -1
- package/dist/aiChat/server/index.js +1 -1
- package/dist/aiChat/server/index.umd.js +1 -1
- package/dist/aiChat/types.d.ts +1 -1
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +57 -44
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +63 -50
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +60 -47
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +3 -3
- package/dist/canvasFullSize/index.es.js +49 -36
- package/dist/canvasFullSize/index.umd.js +5 -5
- package/dist/canvasGridMode/index.cjs.js +2 -2
- package/dist/canvasGridMode/index.es.js +251 -233
- package/dist/canvasGridMode/index.umd.js +4 -4
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +42 -29
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +3 -3
- package/dist/dataSourceEjs/index.es.js +51 -38
- package/dist/dataSourceEjs/index.umd.js +3 -3
- package/dist/dataSourceHandlebars/index.cjs.js +2 -2
- package/dist/dataSourceHandlebars/index.es.js +152 -139
- package/dist/dataSourceHandlebars/index.umd.js +4 -4
- package/dist/dialogComponent/index.cjs.js +9 -9
- package/dist/dialogComponent/index.es.js +73 -60
- package/dist/dialogComponent/index.umd.js +3 -3
- package/dist/flexComponent/index.cjs.js +6 -6
- package/dist/flexComponent/index.es.js +83 -70
- package/dist/flexComponent/index.umd.js +6 -6
- package/dist/fsLightboxComponent/index.cjs.js +2 -2
- package/dist/fsLightboxComponent/index.es.js +67 -54
- package/dist/fsLightboxComponent/index.umd.js +2 -2
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +92 -79
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +52 -39
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +42 -42
- package/dist/index.es.js +1167 -1149
- package/dist/index.umd.js +42 -42
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +82 -69
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +98 -85
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +71 -58
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +3 -3
- package/dist/listPagesComponent/index.es.js +49 -36
- package/dist/listPagesComponent/index.umd.js +3 -3
- package/dist/presetPrintable/index.cjs.js +5 -5
- package/dist/presetPrintable/index.es.js +126 -113
- package/dist/presetPrintable/index.umd.js +4 -4
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +97 -84
- package/dist/prosemirror/index.umd.js +1 -1
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +149 -137
- package/dist/rendererReact/index.js +1 -1
- package/dist/rendererReact/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +92 -79
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +3 -3
- package/dist/shapeDividerComponent/index.es.js +38 -25
- package/dist/shapeDividerComponent/index.umd.js +3 -3
- package/dist/swiperComponent/index.cjs.js +5 -5
- package/dist/swiperComponent/index.es.js +106 -93
- package/dist/swiperComponent/index.umd.js +5 -5
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +167 -154
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +35 -22
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const y=require("react/jsx-runtime"),h=require("react"),M=require("react-dom/client"),C="app.grapesjs.com",G="app-stage.grapesjs.com",_="app2.grapesjs.com",F="app-stage2.grapesjs.com",D=[C,_,G,F,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],W="license:check:end",$=()=>typeof window<"u",S=({isDev:e,isStage:t,isPlatform:o})=>`${e?"":`https://${t?G:C}`}/${o?"platform-api":"api"}`,K=()=>{const e=$()&&window.location.hostname;return!!e&&(D.includes(e)||D.some(t=>e.endsWith(t)))},V=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,o)=>(o?"-":"")+t.toLowerCase()),N=e=>typeof e=="string";function z(e){return typeof e=="function"}async function q({path:e,baseApiUrl:t,method:o="GET",headers:s={},params:r,body:n}){const a=`${t||S({isDev:!1,isStage:!1})}${e}`,c={method:o,headers:{"Content-Type":"application/json",...s}};n&&(c.body=JSON.stringify(n));const u=r?new URLSearchParams(r).toString():"",d=u?`?${u}`:"",p=await fetch(`${a}${d}`,c);if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return p.json()}var b=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(b||{}),x=(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))(x||{});const L={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function J(e){const t=e;return t.init=o=>s=>e(s,o),t}const H=e=>J(e);async function Z({editor:e,plan:t,pluginName:o,licenseKey:s,onLicenseCheckResponse:r,cleanup:n}){let i="",a;const c=p=>{console.warn("Cleanup plugin:",o,"Reason:",p),n()},u=(p={})=>{var w;const{error:g,sdkLicense:f}=p,l=(w=p.plan)==null?void 0:w.category;if(!(f||p.license)||g)c(g||"Invalid license");else if(l){const R=L[t],A=L[l];R>A&&c({pluginRequiredPlan:t,licensePlan:l})}};e.Commands.has(x.settings)&&(a=e.runCommand(x.settings),i=(a==null?void 0:a.baseUrl)||"");const d=p=>{r==null||r(p),p&&u(p)};if(!a){e.onReady(async()=>{if(!K())if(s){const p=await X({licenseKey:s,pluginName:o,baseApiUrl:i});d(p)}else c("The `licenseKey` option not provided")});return}if(a.licensePlan||a.licenseError){const p=Q(a);d(p);return}e.on(W,p=>d(p))}const Q=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function X(e){const{licenseKey:t,pluginName:o,baseApiUrl:s}=e;try{return(await q({baseApiUrl:s,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:o}})).result||{}}catch(r){return console.error("Error during SDK license check:",r),!1}}function Y(e){const t={};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const s=V(o);t[s]=e[o]}return t}const ee=(e,t)=>{const o=e.components||{};for(const s in o){const r=o[s];if(r.component===t)return{cmpConfig:r,type:s}}};function j(e){const t={};let o=!1;for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const r=e[s];if(typeof r=="string"||typeof r=="number"){const n=s.includes("-")?s.replace(/-([a-z])/g,i=>i[1].toUpperCase()):s;t[n]=r,o=!0}}return o?t:void 0}function te(e){const t={};return e.split(";").forEach(o=>{if(!o.trim())return;const s=o.indexOf(":");if(s>0){const r=o.substring(0,s).trim(),n=o.substring(s+1).trim();if(r&&n){const i=r.replace(/-([a-z])/g,a=>a[1].toUpperCase());t[i]=n}}}),Object.keys(t).length>0?t:void 0}function oe(e){if(e){if(typeof e=="object"&&!Array.isArray(e))return j(e);if(typeof e=="string"){let t=te(e);if(!t)try{const o=JSON.parse(e);typeof o=="object"&&o!==null&&!Array.isArray(o)&&(t=j(o))}catch(o){console.error("Failed to parse style string as JSON",o)}return t}if(Array.isArray(e)){const t={};return e.forEach(o=>{if(typeof o=="object"&&o!==null){const s=o.name||o.property,r=o.value;if(typeof s=="string"&&s&&r!==void 0&&r!==""){const n=s.replace(/-([a-z])/g,i=>i[1].toUpperCase());t[n]=r}}}),Object.keys(t).length>0?t:void 0}}}function ne(e){return B[e]?B[e]:e.includes("-")?e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()):e}function se(e){var o;const t={};for(const[s,r]of Object.entries(e))if(s==="style")t.style=oe(r);else if(s.startsWith("data-"))t[s]=r;else{const n=ne(s);((o=e.xmlns)==null?void 0:o.includes("svg"))||e.viewBox!==void 0||e.d!==void 0||ae.has(n)||n.startsWith("svg")?t[n]=r:!re.has(n)&&!n.startsWith("on")&&!n.startsWith("aria-")&&!n.startsWith("data-")?t[s]=r:t[n]=r}return t}const re=new Set(["className","id","style","href","src","alt","title","target","rel","type","name","value","placeholder","onClick","onChange","onSubmit","onBlur","onFocus","disabled","readOnly","checked","selected","multiple","width","height","maxLength","min","max","step","rows","cols","autoComplete","autoFocus","required","spellCheck","tabIndex","aria-label","aria-labelledby","aria-describedby","role"]),ae=new Set(["x","y","d","cx","cy","r","rx","ry","x1","x2","y1","y2","points","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","strokeDasharray","strokeOpacity","fillOpacity","fillRule","clipRule","transform","viewBox","preserveAspectRatio","pathLength","vectorEffect","dominantBaseline","alignmentBaseline","textAnchor","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","baselineShift","opacity","mask","clipPath","overflow","pointerEvents"]),B={class:"className",for:"htmlFor","http-equiv":"httpEquiv","accept-charset":"acceptCharset","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","fill-rule":"fillRule","clip-rule":"clipRule","stroke-miterlimit":"strokeMiterlimit","stroke-dasharray":"strokeDasharray","stroke-opacity":"strokeOpacity","fill-opacity":"fillOpacity","font-family":"fontFamily","font-size":"fontSize","text-anchor":"textAnchor"},T=e=>(e==null?void 0:e.$$typeof)&&typeof e.props=="object";function ie(e){return t=>{const o=t.getContent();T(o)&&t.set({content:P({...e,model:o}),reactContent:o})}}const ce=e=>t=>{const o=t.component;T(o)&&(t.component={components:P({...e,model:o})})};function P(e){const{model:t,editor:o,config:s}=e;if(T(t)){const r=t,n={},{type:i,props:a={}}=r,{children:c,className:u,style:d,...p}=a,g=l=>({type:"textnode",content:l}),f=typeof i=="symbol";if(z(i)){const l=ee(s,i);n.type=l==null?void 0:l.type}else o.Components.getType(i)?n.type=i:f||(n.tagName=i);if(u&&(n.classes=u),d&&(n.style=Y(d)),Array.isArray(c)?n.components=c.map(l=>N(l)?g(l):P({...e,model:l})).filter(Boolean):N(c)&&(n.components=g(c)),Object.keys(p).length){const l=o.Parser.parserHtml.splitPropsFromAttr(p);n.attributes=l.attrs,Object.assign(n,l.props)}return n}}function le(e){const{component:t}=e,[o,s]=h.useState(0),[r,n]=h.useState();return h.useEffect(()=>{if(!t)return()=>{};const a=()=>s(l=>l+1),c=()=>{[...t.views].forEach(m=>m.remove()),n(void 0)},{em:u}=t,d=u.Components.events,g=[...["components","attributes","classes"].map(l=>`${d.update}:${l}`),"rerender"].join(" "),f=[d.removed,"rerender"].join(" ");return t.on(g,a),t.on(f,c),()=>{t.off(g,a),t.off(f,c),c()}},[t]),{key:o,view:r,connectDom:a=>{if(!a)return;const c=pe({...e,el:a});n(c)}}}function pe(e){var c;const{editor:t,component:o,el:s,frameView:r}=e,{em:n,Components:i}=t;let a=o.getView(r.model);if((a==null?void 0:a.el)===s)return a;if(!a){const{ComponentView:u}=i,d=o.attributes.type||"default",p=((c=i.getType(d))==null?void 0:c.view)||u,g={...i.config,frameView:r,em:n},f=p.extend({initComponents(){},_createElement(){return s},_removeElement(){},__clearAttributes(){},render(){var l;return this._ensureElement(),this._setData(),this.renderAttributes(),(l=this.updateSrc)==null||l.call(this),this}});a=new f({el:s,config:g,model:o})}return a.el=s,a.render(),a}function ue(e,t){const{Components:o}=e,s=r=>{const{id:n,model:i}=r;o.addType(n,{model:{toJSON(...a){const c=i.prototype.toJSON.apply(this,a);return c.tagName=this.tagName,c}}})};o.getTypes().forEach(s),e.on("component:type:add",s),Object.entries(t.components||{}).forEach(([r,n])=>{var g,f;const{allowPropClassName:i,allowPropId:a,allowChildren:c}=n,u=!a&&!i,d=()=>({disabled:u}),p=()=>({disableClasses:!i,disableComponent:!a});o.addType(r,{isComponent:l=>(l==null?void 0:l.tagName)===r,model:{defaults:{type:r,traits:((g=n.props)==null?void 0:g.call(n))||[],droppable:!!c,stylable:!u,styleManager:d,selectorManager:p,...((f=n.model)==null?void 0:f.defaults)||{}}}})})}function I(e){var O;const{component:t,config:o,editor:s,frameView:r,onMount:n,tagName:i,children:a}=e,{key:c,view:u,connectDom:d}=le(e);h.useEffect(()=>{if(!u&&!n)return;const v=setTimeout(()=>{u&&(n==null||n(u),setTimeout(()=>u.postRender()))});return()=>clearTimeout(v)},[u]);const p=t.get("type")||"default",g=t.content,f=(O=o.components)==null?void 0:O[p],l=(f==null?void 0:f.component)||i||t.tagName||"div",m=t.components(),w=m.length?m.map(v=>y.jsx(I,{component:v,config:o,editor:s,frameView:r},v.cid)):[g||void 0],R=se(t.getAttributes()),A=f==null?void 0:f.editorRender,E=[...w,a].filter(v=>v??!1),k=E.length?E:null;if(A)return y.jsx(A,{props:R,editor:s,component:t,connectDom:d,children:k});if(f!=null&&f.component)return y.jsx("gjs-wrapper",{ref:d,style:f.wrapperStyle,children:y.jsx(l,{...R,children:k})});if(t.isInstanceOf("textnode"))return g;const U=t.isInstanceOf("text")?c:void 0;return h.createElement(l,{...R,ref:d,key:U},t.get("void")?null:k)}const fe=e=>{const{frame:t,window:o,onMount:s,editor:r}=e,n=r.Canvas.events,{root:i}=t;try{const a=M.createRoot(o.document.body);a.render(y.jsx(de,{...e,component:i,onMount:s}));const c=()=>a.unmount();t.once(n.frameUnload,c),o.addEventListener("unload",c)}catch(a){console.warn(a)}return i.getView()};function de(e){const{editor:t,component:o,window:s,frameView:r,config:n,onMount:i}=e,a=s.document,c=n.rootComponent||h.Fragment,u=n.rootComponent?{editorProps:{doc:a,editor:t,frameView:r}}:{},d=(n==null?void 0:n.bodyAfter)||h.Fragment;return y.jsx(c,{...u,children:y.jsx(I,{tagName:"div",component:o,config:n,editor:t,frameView:r,onMount:i,children:y.jsx(d,{...u})})})}const ge="rendererReact",ye=b.startup,he=function(e,t={}){const{Blocks:o,Pages:s}=e,r=o.events,n=s.events;e.Canvas.config.customRenderer=a=>fe({...a,config:t}),e.Components.config.processor=a=>P({model:a,editor:e,config:t}),ue(e,t);const i=[[r.add,ie({editor:e,config:t})],[n.addBefore,ce({editor:e,config:t})]];i.forEach(([a,c])=>e.on(a,c)),Z({editor:e,licenseKey:t.licenseKey,plan:ye,pluginName:ge,cleanup:()=>{e.Canvas.config.customRenderer=void 0,e.Components.config.processor=void 0,i.forEach(([a,c])=>e.off(a,c))}})},ve=H(he);module.exports=ve;
|
|
1
|
+
"use strict";const y=require("react/jsx-runtime"),h=require("react"),_=require("react-dom/client"),G="app.grapesjs.com",I="app-stage.grapesjs.com",F="app2.grapesjs.com",M="app-stage2.grapesjs.com",D=[G,F,I,M,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],W="license:check:end",$=()=>typeof window<"u",K=({isDev:e,isStage:t,isPlatform:o})=>`${e?"":`https://${t?I:G}`}/${o?"platform-api":"api"}`,S=()=>{if(!$())return"";const{hostname:e}=window.location;if(e)return e;try{return window.parent.location.hostname||""}catch{return""}},V=()=>{const e=S();return!!e&&(D.includes(e)||D.some(t=>e.endsWith(t)))},z=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,o)=>(o?"-":"")+t.toLowerCase()),N=e=>typeof e=="string";function q(e){return typeof e=="function"}async function J({path:e,baseApiUrl:t,method:o="GET",headers:s={},params:a,body:n}){const r=`${t||K({isDev:!1,isStage:!1})}${e}`,c={method:o,headers:{"Content-Type":"application/json",...s}};n&&(c.body=JSON.stringify(n));const u=a?new URLSearchParams(a).toString():"",d=u?`?${u}`:"",p=await fetch(`${r}${d}`,c);if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return p.json()}var b=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(b||{}),x=(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.openEditCode="studio:openEditCode",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))(x||{});const L={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function H(e){const t=e;return t.init=o=>s=>e(s,o),t}const Z=e=>H(e);async function Q({editor:e,plan:t,pluginName:o,licenseKey:s,onLicenseCheckResponse:a,cleanup:n}){let i="",r;const c=p=>{console.warn("Cleanup plugin:",o,"Reason:",p),n()},u=(p={})=>{var R;const{error:g,sdkLicense:f}=p,l=(R=p.plan)==null?void 0:R.category;if(!(f||p.license)||g)c(g||"Invalid license");else if(l){const w=L[t],A=L[l];w>A&&c({pluginRequiredPlan:t,licensePlan:l})}};e.Commands.has(x.settings)&&(r=e.runCommand(x.settings),i=(r==null?void 0:r.baseUrl)||"");const d=p=>{a==null||a(p),p&&u(p)};if(!r){e.onReady(async()=>{if(!V())if(s){const p=await Y({licenseKey:s,pluginName:o,baseApiUrl:i});d(p)}else c("The `licenseKey` option not provided")});return}if(r.licensePlan||r.licenseError){const p=X(r);d(p);return}e.on(W,p=>d(p))}const X=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function Y(e){const{licenseKey:t,pluginName:o,baseApiUrl:s}=e;try{return(await J({baseApiUrl:s,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:o}})).result||{}}catch(a){return console.error("Error during SDK license check:",a),!1}}function ee(e){const t={};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const s=z(o);t[s]=e[o]}return t}const te=(e,t)=>{const o=e.components||{};for(const s in o){const a=o[s];if(a.component===t)return{cmpConfig:a,type:s}}};function j(e){const t={};let o=!1;for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const a=e[s];if(typeof a=="string"||typeof a=="number"){const n=s.includes("-")?s.replace(/-([a-z])/g,i=>i[1].toUpperCase()):s;t[n]=a,o=!0}}return o?t:void 0}function oe(e){const t={};return e.split(";").forEach(o=>{if(!o.trim())return;const s=o.indexOf(":");if(s>0){const a=o.substring(0,s).trim(),n=o.substring(s+1).trim();if(a&&n){const i=a.replace(/-([a-z])/g,r=>r[1].toUpperCase());t[i]=n}}}),Object.keys(t).length>0?t:void 0}function ne(e){if(e){if(typeof e=="object"&&!Array.isArray(e))return j(e);if(typeof e=="string"){let t=oe(e);if(!t)try{const o=JSON.parse(e);typeof o=="object"&&o!==null&&!Array.isArray(o)&&(t=j(o))}catch(o){console.error("Failed to parse style string as JSON",o)}return t}if(Array.isArray(e)){const t={};return e.forEach(o=>{if(typeof o=="object"&&o!==null){const s=o.name||o.property,a=o.value;if(typeof s=="string"&&s&&a!==void 0&&a!==""){const n=s.replace(/-([a-z])/g,i=>i[1].toUpperCase());t[n]=a}}}),Object.keys(t).length>0?t:void 0}}}function se(e){return B[e]?B[e]:e.includes("-")?e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()):e}function re(e){var o;const t={};for(const[s,a]of Object.entries(e))if(s==="style")t.style=ne(a);else if(s.startsWith("data-"))t[s]=a;else{const n=se(s);((o=e.xmlns)==null?void 0:o.includes("svg"))||e.viewBox!==void 0||e.d!==void 0||ie.has(n)||n.startsWith("svg")?t[n]=a:!ae.has(n)&&!n.startsWith("on")&&!n.startsWith("aria-")&&!n.startsWith("data-")?t[s]=a:t[n]=a}return t}const ae=new Set(["className","id","style","href","src","alt","title","target","rel","type","name","value","placeholder","onClick","onChange","onSubmit","onBlur","onFocus","disabled","readOnly","checked","selected","multiple","width","height","maxLength","min","max","step","rows","cols","autoComplete","autoFocus","required","spellCheck","tabIndex","aria-label","aria-labelledby","aria-describedby","role"]),ie=new Set(["x","y","d","cx","cy","r","rx","ry","x1","x2","y1","y2","points","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","strokeDasharray","strokeOpacity","fillOpacity","fillRule","clipRule","transform","viewBox","preserveAspectRatio","pathLength","vectorEffect","dominantBaseline","alignmentBaseline","textAnchor","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","baselineShift","opacity","mask","clipPath","overflow","pointerEvents"]),B={class:"className",for:"htmlFor","http-equiv":"httpEquiv","accept-charset":"acceptCharset","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","fill-rule":"fillRule","clip-rule":"clipRule","stroke-miterlimit":"strokeMiterlimit","stroke-dasharray":"strokeDasharray","stroke-opacity":"strokeOpacity","fill-opacity":"fillOpacity","font-family":"fontFamily","font-size":"fontSize","text-anchor":"textAnchor"},E=e=>(e==null?void 0:e.$$typeof)&&typeof e.props=="object";function ce(e){return t=>{const o=t.getContent();E(o)&&t.set({content:P({...e,model:o}),reactContent:o})}}const le=e=>t=>{const o=t.component;E(o)&&(t.component={components:P({...e,model:o})})};function P(e){const{model:t,editor:o,config:s}=e;if(E(t)){const a=t,n={},{type:i,props:r={}}=a,{children:c,className:u,style:d,...p}=r,g=l=>({type:"textnode",content:l}),f=typeof i=="symbol";if(q(i)){const l=te(s,i);n.type=l==null?void 0:l.type}else o.Components.getType(i)?n.type=i:f||(n.tagName=i);if(u&&(n.classes=u),d&&(n.style=ee(d)),Array.isArray(c)?n.components=c.map(l=>N(l)?g(l):P({...e,model:l})).filter(Boolean):N(c)&&(n.components=g(c)),Object.keys(p).length){const l=o.Parser.parserHtml.splitPropsFromAttr(p);n.attributes=l.attrs,Object.assign(n,l.props)}return n}}function pe(e){const{component:t}=e,[o,s]=h.useState(0),[a,n]=h.useState();return h.useEffect(()=>{if(!t)return()=>{};const r=()=>s(l=>l+1),c=()=>{[...t.views].forEach(m=>m.remove()),n(void 0)},{em:u}=t,d=u.Components.events,g=[...["components","attributes","classes"].map(l=>`${d.update}:${l}`),"rerender"].join(" "),f=[d.removed,"rerender"].join(" ");return t.on(g,r),t.on(f,c),()=>{t.off(g,r),t.off(f,c),c()}},[t]),{key:o,view:a,connectDom:r=>{if(!r)return;const c=ue({...e,el:r});n(c)}}}function ue(e){var c;const{editor:t,component:o,el:s,frameView:a}=e,{em:n,Components:i}=t;let r=o.getView(a.model);if((r==null?void 0:r.el)===s)return r;if(!r){const{ComponentView:u}=i,d=o.attributes.type||"default",p=((c=i.getType(d))==null?void 0:c.view)||u,g={...i.config,frameView:a,em:n},f=p.extend({initComponents(){},_createElement(){return s},_removeElement(){},__clearAttributes(){},render(){var l;return this._ensureElement(),this._setData(),this.renderAttributes(),(l=this.updateSrc)==null||l.call(this),this}});r=new f({el:s,config:g,model:o})}return r.el=s,r.render(),r}function fe(e,t){const{Components:o}=e,s=({id:a,model:n})=>{n&&o.addType(a,{model:{toJSON(...i){const r=n.prototype.toJSON.apply(this,i);return r.tagName=this.tagName,r}}})};o.getTypes().forEach(s),e.on("component:type:add",s),Object.entries(t.components||{}).forEach(([a,n])=>{var g,f;const{allowPropClassName:i,allowPropId:r,allowChildren:c}=n,u=!r&&!i,d=()=>({disabled:u}),p=()=>({disableClasses:!i,disableComponent:!r});o.addType(a,{isComponent:l=>(l==null?void 0:l.tagName)===a,model:{defaults:{type:a,traits:((g=n.props)==null?void 0:g.call(n))||[],droppable:!!c,stylable:!u,styleManager:d,selectorManager:p,...((f=n.model)==null?void 0:f.defaults)||{}}}})})}function C(e){var O;const{component:t,config:o,editor:s,frameView:a,onMount:n,tagName:i,children:r}=e,{key:c,view:u,connectDom:d}=pe(e);h.useEffect(()=>{if(!u&&!n)return;const v=setTimeout(()=>{u&&(n==null||n(u),setTimeout(()=>u.postRender()))});return()=>clearTimeout(v)},[u]);const p=t.get("type")||"default",g=t.content,f=(O=o.components)==null?void 0:O[p],l=(f==null?void 0:f.component)||i||t.tagName||"div",m=t.components(),R=m.length?m.map(v=>y.jsx(C,{component:v,config:o,editor:s,frameView:a},v.cid)):[g||void 0],w=re(t.getAttributes()),A=f==null?void 0:f.editorRender,T=[...R,r].filter(v=>v??!1),k=T.length?T:null;if(A)return y.jsx(A,{props:w,editor:s,component:t,connectDom:d,children:k});if(f!=null&&f.component)return y.jsx("gjs-wrapper",{ref:d,style:f.wrapperStyle,children:y.jsx(l,{...w,children:k})});if(t.isInstanceOf("textnode"))return g;const U=t.isInstanceOf("text")?c:void 0;return h.createElement(l,{...w,ref:d,key:U},t.get("void")?null:k)}const de=e=>{const{frame:t,window:o,onMount:s,editor:a}=e,n=a.Canvas.events,{root:i}=t;try{const r=_.createRoot(o.document.body);r.render(y.jsx(ge,{...e,component:i,onMount:s}));const c=()=>r.unmount();t.once(n.frameUnload,c),o.addEventListener("unload",c)}catch(r){console.warn(r)}return i.getView()};function ge(e){const{editor:t,component:o,window:s,frameView:a,config:n,onMount:i}=e,r=s.document,c=n.rootComponent||h.Fragment,u=n.rootComponent?{editorProps:{doc:r,editor:t,frameView:a}}:{},d=(n==null?void 0:n.bodyAfter)||h.Fragment;return y.jsx(c,{...u,children:y.jsx(C,{tagName:"div",component:o,config:n,editor:t,frameView:a,onMount:i,children:y.jsx(d,{...u})})})}const ye="rendererReact",he=b.startup,ve=function(e,t={}){const{Blocks:o,Pages:s}=e,a=o.events,n=s.events;e.Canvas.config.customRenderer=r=>de({...r,config:t}),e.Components.config.processor=r=>P({model:r,editor:e,config:t}),fe(e,t);const i=[[a.add,ce({editor:e,config:t})],[n.addBefore,le({editor:e,config:t})]];i.forEach(([r,c])=>e.on(r,c)),Q({editor:e,licenseKey:t.licenseKey,plan:he,pluginName:ye,cleanup:()=>{e.Canvas.config.customRenderer=void 0,e.Components.config.processor=void 0,i.forEach(([r,c])=>e.off(r,c))}})},be=Z(ve);module.exports=be;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
-
import { useState as O, useEffect as
|
|
2
|
+
import { useState as O, useEffect as C, createElement as F, Fragment as D } from "react";
|
|
3
3
|
import { createRoot as W } from "react-dom/client";
|
|
4
|
-
const U = "app.grapesjs.com",
|
|
4
|
+
const U = "app.grapesjs.com", _ = "app-stage.grapesjs.com", $ = "app2.grapesjs.com", K = "app-stage2.grapesjs.com", N = [
|
|
5
5
|
U,
|
|
6
6
|
$,
|
|
7
|
-
|
|
7
|
+
_,
|
|
8
8
|
K,
|
|
9
9
|
"localhost",
|
|
10
10
|
"127.0.0.1",
|
|
@@ -12,28 +12,41 @@ const U = "app.grapesjs.com", M = "app-stage.grapesjs.com", $ = "app2.grapesjs.c
|
|
|
12
12
|
// For stackblitz.com demos
|
|
13
13
|
".local.webcontainer.io",
|
|
14
14
|
// For stackblitz.com demos
|
|
15
|
-
"-sandpack.codesandbox.io"
|
|
15
|
+
"-sandpack.codesandbox.io",
|
|
16
16
|
// For Sandpack demos
|
|
17
|
-
|
|
17
|
+
".claudemcpcontent.com",
|
|
18
|
+
// For Claude mcp app
|
|
19
|
+
".web-sandbox.oaiusercontent.com"
|
|
20
|
+
// For OpenAI mcp app
|
|
21
|
+
], V = "license:check:end", z = () => typeof window < "u", S = ({
|
|
18
22
|
isDev: e,
|
|
19
23
|
isStage: t,
|
|
20
24
|
isPlatform: o
|
|
21
|
-
}) => `${e ? "" : `https://${t ?
|
|
22
|
-
|
|
25
|
+
}) => `${e ? "" : `https://${t ? _ : U}`}/${o ? "platform-api" : "api"}`, J = () => {
|
|
26
|
+
if (!z()) return "";
|
|
27
|
+
const { hostname: e } = window.location;
|
|
28
|
+
if (e) return e;
|
|
29
|
+
try {
|
|
30
|
+
return window.parent.location.hostname || "";
|
|
31
|
+
} catch {
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
}, q = () => {
|
|
35
|
+
const e = J();
|
|
23
36
|
return !!e && (N.includes(e) || N.some((t) => e.endsWith(t)));
|
|
24
|
-
},
|
|
25
|
-
function
|
|
37
|
+
}, H = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, o) => (o ? "-" : "") + t.toLowerCase()), L = (e) => typeof e == "string";
|
|
38
|
+
function Z(e) {
|
|
26
39
|
return typeof e == "function";
|
|
27
40
|
}
|
|
28
|
-
async function
|
|
41
|
+
async function Q({
|
|
29
42
|
path: e,
|
|
30
43
|
baseApiUrl: t,
|
|
31
44
|
method: o = "GET",
|
|
32
45
|
headers: s = {},
|
|
33
|
-
params:
|
|
46
|
+
params: a,
|
|
34
47
|
body: n
|
|
35
48
|
}) {
|
|
36
|
-
const
|
|
49
|
+
const r = `${t || S({ isDev: !1, isStage: !1 })}${e}`, c = {
|
|
37
50
|
method: o,
|
|
38
51
|
headers: {
|
|
39
52
|
"Content-Type": "application/json",
|
|
@@ -41,76 +54,76 @@ async function Z({
|
|
|
41
54
|
}
|
|
42
55
|
};
|
|
43
56
|
n && (c.body = JSON.stringify(n));
|
|
44
|
-
const u =
|
|
57
|
+
const u = a ? new URLSearchParams(a).toString() : "", d = u ? `?${u}` : "", p = await fetch(`${r}${d}`, c);
|
|
45
58
|
if (!p.ok)
|
|
46
59
|
throw new Error(`HTTP error! status: ${p.status}`);
|
|
47
60
|
return p.json();
|
|
48
61
|
}
|
|
49
|
-
var v = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(v || {}), k = /* @__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))(k || {});
|
|
62
|
+
var v = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(v || {}), k = /* @__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.openEditCode = "studio:openEditCode", 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))(k || {});
|
|
50
63
|
const B = {
|
|
51
64
|
[v.free]: 0,
|
|
52
65
|
[v.startup]: 10,
|
|
53
66
|
[v.business]: 20,
|
|
54
67
|
[v.enterprise]: 30
|
|
55
68
|
};
|
|
56
|
-
function
|
|
69
|
+
function X(e) {
|
|
57
70
|
const t = e;
|
|
58
71
|
return t.init = (o) => (s) => e(s, o), t;
|
|
59
72
|
}
|
|
60
|
-
const
|
|
61
|
-
async function
|
|
73
|
+
const Y = (e) => /* @__PURE__ */ X(e);
|
|
74
|
+
async function ee({
|
|
62
75
|
editor: e,
|
|
63
76
|
plan: t,
|
|
64
77
|
pluginName: o,
|
|
65
78
|
licenseKey: s,
|
|
66
|
-
onLicenseCheckResponse:
|
|
79
|
+
onLicenseCheckResponse: a,
|
|
67
80
|
cleanup: n
|
|
68
81
|
}) {
|
|
69
|
-
let i = "",
|
|
82
|
+
let i = "", r;
|
|
70
83
|
const c = (p) => {
|
|
71
84
|
console.warn("Cleanup plugin:", o, "Reason:", p), n();
|
|
72
85
|
}, u = (p = {}) => {
|
|
73
|
-
var
|
|
74
|
-
const { error: g, sdkLicense: f } = p, l = (
|
|
86
|
+
var w;
|
|
87
|
+
const { error: g, sdkLicense: f } = p, l = (w = p.plan) == null ? void 0 : w.category;
|
|
75
88
|
if (!(f || p.license) || g)
|
|
76
89
|
c(g || "Invalid license");
|
|
77
90
|
else if (l) {
|
|
78
|
-
const m = B[t],
|
|
79
|
-
m >
|
|
91
|
+
const m = B[t], R = B[l];
|
|
92
|
+
m > R && c({ pluginRequiredPlan: t, licensePlan: l });
|
|
80
93
|
}
|
|
81
94
|
};
|
|
82
|
-
e.Commands.has(k.settings) && (
|
|
95
|
+
e.Commands.has(k.settings) && (r = e.runCommand(k.settings), i = (r == null ? void 0 : r.baseUrl) || "");
|
|
83
96
|
const d = (p) => {
|
|
84
|
-
|
|
97
|
+
a == null || a(p), p && u(p);
|
|
85
98
|
};
|
|
86
|
-
if (!
|
|
99
|
+
if (!r) {
|
|
87
100
|
e.onReady(async () => {
|
|
88
|
-
if (!
|
|
101
|
+
if (!q())
|
|
89
102
|
if (s) {
|
|
90
|
-
const p = await
|
|
103
|
+
const p = await oe({ licenseKey: s, pluginName: o, baseApiUrl: i });
|
|
91
104
|
d(p);
|
|
92
105
|
} else
|
|
93
106
|
c("The `licenseKey` option not provided");
|
|
94
107
|
});
|
|
95
108
|
return;
|
|
96
109
|
}
|
|
97
|
-
if (
|
|
98
|
-
const p =
|
|
110
|
+
if (r.licensePlan || r.licenseError) {
|
|
111
|
+
const p = te(r);
|
|
99
112
|
d(p);
|
|
100
113
|
return;
|
|
101
114
|
}
|
|
102
|
-
e.on(
|
|
115
|
+
e.on(V, (p) => d(p));
|
|
103
116
|
}
|
|
104
|
-
const
|
|
117
|
+
const te = (e) => ({
|
|
105
118
|
sdkLicense: e.license,
|
|
106
119
|
license: e.license,
|
|
107
120
|
error: e.licenseError,
|
|
108
121
|
plan: e.licensePlan
|
|
109
122
|
});
|
|
110
|
-
async function
|
|
123
|
+
async function oe(e) {
|
|
111
124
|
const { licenseKey: t, pluginName: o, baseApiUrl: s } = e;
|
|
112
125
|
try {
|
|
113
|
-
return (await
|
|
126
|
+
return (await Q({
|
|
114
127
|
baseApiUrl: s,
|
|
115
128
|
path: `/sdk/${t || "na"}`,
|
|
116
129
|
method: "POST",
|
|
@@ -119,64 +132,64 @@ async function te(e) {
|
|
|
119
132
|
pn: o
|
|
120
133
|
}
|
|
121
134
|
})).result || {};
|
|
122
|
-
} catch (
|
|
123
|
-
return console.error("Error during SDK license check:",
|
|
135
|
+
} catch (a) {
|
|
136
|
+
return console.error("Error during SDK license check:", a), !1;
|
|
124
137
|
}
|
|
125
138
|
}
|
|
126
|
-
function
|
|
139
|
+
function ne(e) {
|
|
127
140
|
const t = {};
|
|
128
141
|
for (const o in e)
|
|
129
142
|
if (Object.prototype.hasOwnProperty.call(e, o)) {
|
|
130
|
-
const s =
|
|
143
|
+
const s = H(o);
|
|
131
144
|
t[s] = e[o];
|
|
132
145
|
}
|
|
133
146
|
return t;
|
|
134
147
|
}
|
|
135
|
-
const
|
|
148
|
+
const se = (e, t) => {
|
|
136
149
|
const o = e.components || {};
|
|
137
150
|
for (const s in o) {
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
return { cmpConfig:
|
|
151
|
+
const a = o[s];
|
|
152
|
+
if (a.component === t)
|
|
153
|
+
return { cmpConfig: a, type: s };
|
|
141
154
|
}
|
|
142
155
|
};
|
|
143
|
-
function
|
|
156
|
+
function G(e) {
|
|
144
157
|
const t = {};
|
|
145
158
|
let o = !1;
|
|
146
159
|
for (const s in e)
|
|
147
160
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
148
|
-
const
|
|
149
|
-
if (typeof
|
|
161
|
+
const a = e[s];
|
|
162
|
+
if (typeof a == "string" || typeof a == "number") {
|
|
150
163
|
const n = s.includes("-") ? s.replace(/-([a-z])/g, (i) => i[1].toUpperCase()) : s;
|
|
151
|
-
t[n] =
|
|
164
|
+
t[n] = a, o = !0;
|
|
152
165
|
}
|
|
153
166
|
}
|
|
154
167
|
return o ? t : void 0;
|
|
155
168
|
}
|
|
156
|
-
function
|
|
169
|
+
function re(e) {
|
|
157
170
|
const t = {};
|
|
158
171
|
return e.split(";").forEach((o) => {
|
|
159
172
|
if (!o.trim()) return;
|
|
160
173
|
const s = o.indexOf(":");
|
|
161
174
|
if (s > 0) {
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
164
|
-
const i =
|
|
175
|
+
const a = o.substring(0, s).trim(), n = o.substring(s + 1).trim();
|
|
176
|
+
if (a && n) {
|
|
177
|
+
const i = a.replace(/-([a-z])/g, (r) => r[1].toUpperCase());
|
|
165
178
|
t[i] = n;
|
|
166
179
|
}
|
|
167
180
|
}
|
|
168
181
|
}), Object.keys(t).length > 0 ? t : void 0;
|
|
169
182
|
}
|
|
170
|
-
function
|
|
183
|
+
function ae(e) {
|
|
171
184
|
if (e) {
|
|
172
185
|
if (typeof e == "object" && !Array.isArray(e))
|
|
173
|
-
return
|
|
186
|
+
return G(e);
|
|
174
187
|
if (typeof e == "string") {
|
|
175
|
-
let t =
|
|
188
|
+
let t = re(e);
|
|
176
189
|
if (!t)
|
|
177
190
|
try {
|
|
178
191
|
const o = JSON.parse(e);
|
|
179
|
-
typeof o == "object" && o !== null && !Array.isArray(o) && (t =
|
|
192
|
+
typeof o == "object" && o !== null && !Array.isArray(o) && (t = G(o));
|
|
180
193
|
} catch (o) {
|
|
181
194
|
console.error("Failed to parse style string as JSON", o);
|
|
182
195
|
}
|
|
@@ -186,34 +199,34 @@ function re(e) {
|
|
|
186
199
|
const t = {};
|
|
187
200
|
return e.forEach((o) => {
|
|
188
201
|
if (typeof o == "object" && o !== null) {
|
|
189
|
-
const s = o.name || o.property,
|
|
190
|
-
if (typeof s == "string" && s &&
|
|
202
|
+
const s = o.name || o.property, a = o.value;
|
|
203
|
+
if (typeof s == "string" && s && a !== void 0 && a !== "") {
|
|
191
204
|
const n = s.replace(/-([a-z])/g, (i) => i[1].toUpperCase());
|
|
192
|
-
t[n] =
|
|
205
|
+
t[n] = a;
|
|
193
206
|
}
|
|
194
207
|
}
|
|
195
208
|
}), Object.keys(t).length > 0 ? t : void 0;
|
|
196
209
|
}
|
|
197
210
|
}
|
|
198
211
|
}
|
|
199
|
-
function ae(e) {
|
|
200
|
-
return G[e] ? G[e] : e.includes("-") ? e.replace(/-([a-z])/g, (t, o) => o.toUpperCase()) : e;
|
|
201
|
-
}
|
|
202
212
|
function ie(e) {
|
|
213
|
+
return I[e] ? I[e] : e.includes("-") ? e.replace(/-([a-z])/g, (t, o) => o.toUpperCase()) : e;
|
|
214
|
+
}
|
|
215
|
+
function ce(e) {
|
|
203
216
|
var o;
|
|
204
217
|
const t = {};
|
|
205
|
-
for (const [s,
|
|
218
|
+
for (const [s, a] of Object.entries(e))
|
|
206
219
|
if (s === "style")
|
|
207
|
-
t.style =
|
|
220
|
+
t.style = ae(a);
|
|
208
221
|
else if (s.startsWith("data-"))
|
|
209
|
-
t[s] =
|
|
222
|
+
t[s] = a;
|
|
210
223
|
else {
|
|
211
|
-
const n =
|
|
212
|
-
((o = e.xmlns) == null ? void 0 : o.includes("svg")) || e.viewBox !== void 0 || e.d !== void 0 ||
|
|
224
|
+
const n = ie(s);
|
|
225
|
+
((o = e.xmlns) == null ? void 0 : o.includes("svg")) || e.viewBox !== void 0 || e.d !== void 0 || pe.has(n) || n.startsWith("svg") ? t[n] = a : !le.has(n) && !n.startsWith("on") && !n.startsWith("aria-") && !n.startsWith("data-") ? t[s] = a : t[n] = a;
|
|
213
226
|
}
|
|
214
227
|
return t;
|
|
215
228
|
}
|
|
216
|
-
const
|
|
229
|
+
const le = /* @__PURE__ */ new Set([
|
|
217
230
|
"className",
|
|
218
231
|
"id",
|
|
219
232
|
"style",
|
|
@@ -254,7 +267,7 @@ const ce = /* @__PURE__ */ new Set([
|
|
|
254
267
|
"aria-labelledby",
|
|
255
268
|
"aria-describedby",
|
|
256
269
|
"role"
|
|
257
|
-
]),
|
|
270
|
+
]), pe = /* @__PURE__ */ new Set([
|
|
258
271
|
"x",
|
|
259
272
|
"y",
|
|
260
273
|
"d",
|
|
@@ -297,7 +310,7 @@ const ce = /* @__PURE__ */ new Set([
|
|
|
297
310
|
"clipPath",
|
|
298
311
|
"overflow",
|
|
299
312
|
"pointerEvents"
|
|
300
|
-
]),
|
|
313
|
+
]), I = {
|
|
301
314
|
class: "className",
|
|
302
315
|
for: "htmlFor",
|
|
303
316
|
"http-equiv": "httpEquiv",
|
|
@@ -314,60 +327,60 @@ const ce = /* @__PURE__ */ new Set([
|
|
|
314
327
|
"font-family": "fontFamily",
|
|
315
328
|
"font-size": "fontSize",
|
|
316
329
|
"text-anchor": "textAnchor"
|
|
317
|
-
},
|
|
318
|
-
function
|
|
330
|
+
}, E = (e) => (e == null ? void 0 : e.$$typeof) && typeof e.props == "object";
|
|
331
|
+
function ue(e) {
|
|
319
332
|
return (t) => {
|
|
320
333
|
const o = t.getContent();
|
|
321
|
-
|
|
334
|
+
E(o) && t.set({
|
|
322
335
|
content: A({ ...e, model: o }),
|
|
323
336
|
reactContent: o
|
|
324
337
|
});
|
|
325
338
|
};
|
|
326
339
|
}
|
|
327
|
-
const
|
|
340
|
+
const fe = (e) => (t) => {
|
|
328
341
|
const o = t.component;
|
|
329
|
-
|
|
342
|
+
E(o) && (t.component = { components: A({ ...e, model: o }) });
|
|
330
343
|
};
|
|
331
344
|
function A(e) {
|
|
332
345
|
const { model: t, editor: o, config: s } = e;
|
|
333
|
-
if (
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
336
|
-
const l =
|
|
346
|
+
if (E(t)) {
|
|
347
|
+
const a = t, n = {}, { type: i, props: r = {} } = a, { children: c, className: u, style: d, ...p } = r, g = (l) => ({ type: "textnode", content: l }), f = typeof i == "symbol";
|
|
348
|
+
if (Z(i)) {
|
|
349
|
+
const l = se(s, i);
|
|
337
350
|
n.type = l == null ? void 0 : l.type;
|
|
338
351
|
} else o.Components.getType(i) ? n.type = i : f || (n.tagName = i);
|
|
339
|
-
if (u && (n.classes = u), d && (n.style =
|
|
352
|
+
if (u && (n.classes = u), d && (n.style = ne(d)), Array.isArray(c) ? n.components = c.map((l) => L(l) ? g(l) : A({ ...e, model: l })).filter(Boolean) : L(c) && (n.components = g(c)), Object.keys(p).length) {
|
|
340
353
|
const l = o.Parser.parserHtml.splitPropsFromAttr(p);
|
|
341
354
|
n.attributes = l.attrs, Object.assign(n, l.props);
|
|
342
355
|
}
|
|
343
356
|
return n;
|
|
344
357
|
}
|
|
345
358
|
}
|
|
346
|
-
function
|
|
347
|
-
const { component: t } = e, [o, s] = O(0), [
|
|
348
|
-
return
|
|
359
|
+
function de(e) {
|
|
360
|
+
const { component: t } = e, [o, s] = O(0), [a, n] = O();
|
|
361
|
+
return C(() => {
|
|
349
362
|
if (!t) return () => {
|
|
350
363
|
};
|
|
351
|
-
const
|
|
364
|
+
const r = () => s((l) => l + 1), c = () => {
|
|
352
365
|
[...t.views].forEach((b) => b.remove()), n(void 0);
|
|
353
366
|
}, { em: u } = t, d = u.Components.events, g = [...["components", "attributes", "classes"].map((l) => `${d.update}:${l}`), "rerender"].join(" "), f = [d.removed, "rerender"].join(" ");
|
|
354
|
-
return t.on(g,
|
|
355
|
-
t.off(g,
|
|
367
|
+
return t.on(g, r), t.on(f, c), () => {
|
|
368
|
+
t.off(g, r), t.off(f, c), c();
|
|
356
369
|
};
|
|
357
|
-
}, [t]), { key: o, view:
|
|
358
|
-
if (!
|
|
359
|
-
const c =
|
|
370
|
+
}, [t]), { key: o, view: a, connectDom: (r) => {
|
|
371
|
+
if (!r) return;
|
|
372
|
+
const c = ge({ ...e, el: r });
|
|
360
373
|
n(c);
|
|
361
374
|
} };
|
|
362
375
|
}
|
|
363
|
-
function
|
|
376
|
+
function ge(e) {
|
|
364
377
|
var c;
|
|
365
|
-
const { editor: t, component: o, el: s, frameView:
|
|
366
|
-
let
|
|
367
|
-
if ((
|
|
368
|
-
return
|
|
369
|
-
if (!
|
|
370
|
-
const { ComponentView: u } = i, d = o.attributes.type || "default", p = ((c = i.getType(d)) == null ? void 0 : c.view) || u, g = { ...i.config, frameView:
|
|
378
|
+
const { editor: t, component: o, el: s, frameView: a } = e, { em: n, Components: i } = t;
|
|
379
|
+
let r = o.getView(a.model);
|
|
380
|
+
if ((r == null ? void 0 : r.el) === s)
|
|
381
|
+
return r;
|
|
382
|
+
if (!r) {
|
|
383
|
+
const { ComponentView: u } = i, d = o.attributes.type || "default", p = ((c = i.getType(d)) == null ? void 0 : c.view) || u, g = { ...i.config, frameView: a, em: n }, f = p.extend({
|
|
371
384
|
initComponents() {
|
|
372
385
|
},
|
|
373
386
|
_createElement() {
|
|
@@ -382,35 +395,34 @@ function de(e) {
|
|
|
382
395
|
return this._ensureElement(), this._setData(), this.renderAttributes(), (l = this.updateSrc) == null || l.call(this), this;
|
|
383
396
|
}
|
|
384
397
|
});
|
|
385
|
-
|
|
398
|
+
r = new f({ el: s, config: g, model: o });
|
|
386
399
|
}
|
|
387
|
-
return
|
|
400
|
+
return r.el = s, r.render(), r;
|
|
388
401
|
}
|
|
389
|
-
function
|
|
390
|
-
const { Components: o } = e, s = (
|
|
391
|
-
|
|
392
|
-
o.addType(n, {
|
|
402
|
+
function ye(e, t) {
|
|
403
|
+
const { Components: o } = e, s = ({ id: a, model: n }) => {
|
|
404
|
+
n && o.addType(a, {
|
|
393
405
|
model: {
|
|
394
|
-
toJSON(...
|
|
395
|
-
const
|
|
396
|
-
return
|
|
406
|
+
toJSON(...i) {
|
|
407
|
+
const r = n.prototype.toJSON.apply(this, i);
|
|
408
|
+
return r.tagName = this.tagName, r;
|
|
397
409
|
}
|
|
398
410
|
}
|
|
399
411
|
});
|
|
400
412
|
};
|
|
401
|
-
o.getTypes().forEach(s), e.on("component:type:add", s), Object.entries(t.components || {}).forEach(([
|
|
413
|
+
o.getTypes().forEach(s), e.on("component:type:add", s), Object.entries(t.components || {}).forEach(([a, n]) => {
|
|
402
414
|
var g, f;
|
|
403
|
-
const { allowPropClassName: i, allowPropId:
|
|
415
|
+
const { allowPropClassName: i, allowPropId: r, allowChildren: c } = n, u = !r && !i, d = () => ({
|
|
404
416
|
disabled: u
|
|
405
417
|
}), p = () => ({
|
|
406
418
|
disableClasses: !i,
|
|
407
|
-
disableComponent: !
|
|
419
|
+
disableComponent: !r
|
|
408
420
|
});
|
|
409
|
-
o.addType(
|
|
410
|
-
isComponent: (l) => (l == null ? void 0 : l.tagName) ===
|
|
421
|
+
o.addType(a, {
|
|
422
|
+
isComponent: (l) => (l == null ? void 0 : l.tagName) === a,
|
|
411
423
|
model: {
|
|
412
424
|
defaults: {
|
|
413
|
-
type:
|
|
425
|
+
type: a,
|
|
414
426
|
traits: ((g = n.props) == null ? void 0 : g.call(n)) || [],
|
|
415
427
|
droppable: !!c,
|
|
416
428
|
stylable: !u,
|
|
@@ -422,19 +434,19 @@ function ge(e, t) {
|
|
|
422
434
|
});
|
|
423
435
|
});
|
|
424
436
|
}
|
|
425
|
-
function
|
|
437
|
+
function M(e) {
|
|
426
438
|
var x;
|
|
427
|
-
const { component: t, config: o, editor: s, frameView:
|
|
428
|
-
|
|
439
|
+
const { component: t, config: o, editor: s, frameView: a, onMount: n, tagName: i, children: r } = e, { key: c, view: u, connectDom: d } = de(e);
|
|
440
|
+
C(() => {
|
|
429
441
|
if (!u && !n) return;
|
|
430
442
|
const h = setTimeout(() => {
|
|
431
443
|
u && (n == null || n(u), setTimeout(() => u.postRender()));
|
|
432
444
|
});
|
|
433
445
|
return () => clearTimeout(h);
|
|
434
446
|
}, [u]);
|
|
435
|
-
const p = t.get("type") || "default", g = t.content, f = (x = o.components) == null ? void 0 : x[p], l = (f == null ? void 0 : f.component) || i || t.tagName || "div", b = t.components(),
|
|
436
|
-
if (
|
|
437
|
-
return /* @__PURE__ */ y(
|
|
447
|
+
const p = t.get("type") || "default", g = t.content, f = (x = o.components) == null ? void 0 : x[p], l = (f == null ? void 0 : f.component) || i || t.tagName || "div", b = t.components(), w = b.length ? b.map((h) => /* @__PURE__ */ y(M, { component: h, config: o, editor: s, frameView: a }, h.cid)) : [g || void 0], m = ce(t.getAttributes()), R = f == null ? void 0 : f.editorRender, T = [...w, r].filter((h) => h ?? !1), P = T.length ? T : null;
|
|
448
|
+
if (R)
|
|
449
|
+
return /* @__PURE__ */ y(R, { props: m, editor: s, component: t, connectDom: d, children: P });
|
|
438
450
|
if (f != null && f.component)
|
|
439
451
|
return /* @__PURE__ */ y("gjs-wrapper", { ref: d, style: f.wrapperStyle, children: /* @__PURE__ */ y(l, { ...m, children: P }) });
|
|
440
452
|
if (t.isInstanceOf("textnode"))
|
|
@@ -442,50 +454,50 @@ function _(e) {
|
|
|
442
454
|
const j = t.isInstanceOf("text") ? c : void 0;
|
|
443
455
|
return /* @__PURE__ */ F(l, { ...m, ref: d, key: j }, t.get("void") ? null : P);
|
|
444
456
|
}
|
|
445
|
-
const
|
|
446
|
-
const { frame: t, window: o, onMount: s, editor:
|
|
457
|
+
const he = (e) => {
|
|
458
|
+
const { frame: t, window: o, onMount: s, editor: a } = e, n = a.Canvas.events, { root: i } = t;
|
|
447
459
|
try {
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
const c = () =>
|
|
460
|
+
const r = W(o.document.body);
|
|
461
|
+
r.render(/* @__PURE__ */ y(ve, { ...e, component: i, onMount: s }));
|
|
462
|
+
const c = () => r.unmount();
|
|
451
463
|
t.once(n.frameUnload, c), o.addEventListener("unload", c);
|
|
452
|
-
} catch (
|
|
453
|
-
console.warn(
|
|
464
|
+
} catch (r) {
|
|
465
|
+
console.warn(r);
|
|
454
466
|
}
|
|
455
467
|
return i.getView();
|
|
456
468
|
};
|
|
457
|
-
function
|
|
458
|
-
const { editor: t, component: o, window: s, frameView:
|
|
469
|
+
function ve(e) {
|
|
470
|
+
const { editor: t, component: o, window: s, frameView: a, config: n, onMount: i } = e, r = s.document, c = n.rootComponent || D, u = n.rootComponent ? { editorProps: { doc: r, editor: t, frameView: a } } : {}, d = (n == null ? void 0 : n.bodyAfter) || D;
|
|
459
471
|
return /* @__PURE__ */ y(c, { ...u, children: /* @__PURE__ */ y(
|
|
460
|
-
|
|
472
|
+
M,
|
|
461
473
|
{
|
|
462
474
|
tagName: "div",
|
|
463
475
|
component: o,
|
|
464
476
|
config: n,
|
|
465
477
|
editor: t,
|
|
466
|
-
frameView:
|
|
478
|
+
frameView: a,
|
|
467
479
|
onMount: i,
|
|
468
480
|
children: /* @__PURE__ */ y(d, { ...u })
|
|
469
481
|
}
|
|
470
482
|
) });
|
|
471
483
|
}
|
|
472
|
-
const
|
|
473
|
-
const { Blocks: o, Pages: s } = e,
|
|
474
|
-
e.Canvas.config.customRenderer = (
|
|
484
|
+
const be = "rendererReact", me = v.startup, we = function(e, t = {}) {
|
|
485
|
+
const { Blocks: o, Pages: s } = e, a = o.events, n = s.events;
|
|
486
|
+
e.Canvas.config.customRenderer = (r) => he({ ...r, config: t }), e.Components.config.processor = (r) => A({ model: r, editor: e, config: t }), ye(e, t);
|
|
475
487
|
const i = [
|
|
476
|
-
[
|
|
477
|
-
[n.addBefore,
|
|
488
|
+
[a.add, ue({ editor: e, config: t })],
|
|
489
|
+
[n.addBefore, fe({ editor: e, config: t })]
|
|
478
490
|
];
|
|
479
|
-
i.forEach(([
|
|
491
|
+
i.forEach(([r, c]) => e.on(r, c)), ee({
|
|
480
492
|
editor: e,
|
|
481
493
|
licenseKey: t.licenseKey,
|
|
482
|
-
plan:
|
|
483
|
-
pluginName:
|
|
494
|
+
plan: me,
|
|
495
|
+
pluginName: be,
|
|
484
496
|
cleanup: () => {
|
|
485
|
-
e.Canvas.config.customRenderer = void 0, e.Components.config.processor = void 0, i.forEach(([
|
|
497
|
+
e.Canvas.config.customRenderer = void 0, e.Components.config.processor = void 0, i.forEach(([r, c]) => e.off(r, c));
|
|
486
498
|
}
|
|
487
499
|
});
|
|
488
|
-
},
|
|
500
|
+
}, ke = Y(we);
|
|
489
501
|
export {
|
|
490
|
-
|
|
502
|
+
ke as default
|
|
491
503
|
};
|