diff --git a/app/srv/core/main.js b/app/srv/core/main.js index 40e52252..c65066dd 100644 --- a/app/srv/core/main.js +++ b/app/srv/core/main.js @@ -94,7 +94,7 @@ Error generating stack: `+o.message+` ${mg(e,t.mode)} ${Pg(e,t.mode)} `,(t?.hover||t?.active)&&Ng({item:e,hover:t?.hover,active:t?.active}),pg(e,t.mode)])}catch(n){console.log(n)}return cx([])};var Dg=P(G()),bo=(e,t,n,r,i)=>{let o=t.item,s;o.component?.style&&(s={style:o.component.style,className:Rf(o.component.style,{mode:e.mode})});let l={className:Rf(o,{mode:e.mode}),inherit:s},c={},a=t.item.childs,u;return t.item.type==="text"?(u=null,l.dangerouslySetInnerHTML={__html:t.item.html||""}):u=Array.isArray(a)&&a?.map(p=>{if(!p)return null;let{id:f}=p,d=n?e.layout?.meta[f]:e.meta[f];return d?(0,Dg.jsx)(en,{meta:d,is_layout:n,passprop:{...r},depth:i+1},f):null}),l.children=u,t.item.adv?.html?(delete l.children,l.dangerouslySetInnerHTML={__html:t.item.adv?.html}):t.item.adv?.js&&!t.item.adv.js.includes("children")&&(delete l.children,delete l.dangerouslySetInnerHTML),{props:l,text_props:c}};var Uy=P(_e());var zy=P(Vl());var ti={NORMAL:0,WILDCARD:1,PLACEHOLDER:2};function Wl(e={}){let t={options:e,rootNode:Oy(),staticRoutesMap:{}},n=r=>e.strictTrailingSlash?r:r.replace(/\/$/,"")||"/";if(e.routes)for(let r in e.routes)Iy(t,n(r),e.routes[r]);return{ctx:t,lookup:r=>uE(t,n(r)),insert:(r,i)=>Iy(t,n(r),i),remove:r=>cE(t,n(r))}}function uE(e,t){let n=e.staticRoutesMap[t];if(n)return n.data;let r=t.split("/"),i={},o=!1,s=null,l=e.rootNode,c=null;for(let a=0;a1){let f=r.length-a;l=l.placeholderChildren.find(d=>d.maxDepth===f)||null}else l=l.placeholderChildren[0]||null;if(!l)break;l.paramName&&(i[l.paramName]=u),o=!0}else l=p}return(l===null||l.data===null)&&s!==null&&(l=s,i[l.paramName||"_"]=c,o=!0),l?o?{...l.data,params:o?i:void 0}:l.data:null}function Iy(e,t,n){let r=!0,i=t.split("/"),o=e.rootNode,s=0,l=[o];for(let c of i){let a;if(a=o.children.get(c))o=a;else{let u=fE(c);a=Oy({type:u,parent:o}),o.children.set(c,a),u===ti.PLACEHOLDER?(a.paramName=c==="*"?`_${s++}`:c.slice(1),o.placeholderChildren.push(a),r=!1):u===ti.WILDCARD&&(o.wildcardChildNode=a,a.paramName=c.slice(3)||"_",r=!1),l.push(a),o=a}}for(let[c,a]of l.entries())a.maxDepth=Math.max(l.length-c,a.maxDepth||0);return o.data=n,r===!0&&(e.staticRoutesMap[t]=o),o}function cE(e,t){let n=!1,r=t.split("/"),i=e.rootNode;for(let o of r)if(i=i.children.get(o),!i)return n;if(i.data){let o=r.at(-1)||"";i.data=null,Object.keys(i.children).length===0&&i.parent&&(i.parent.children.delete(o),i.parent.wildcardChildNode=null,i.parent.placeholderChildren=[]),n=!0}return n}function Oy(e={}){return{type:e.type||ti.NORMAL,maxDepth:0,parent:e.parent||null,children:new Map,data:e.data||null,paramName:e.paramName||null,wildcardChildNode:null,placeholderChildren:[]}}function fE(e){return e.startsWith("**")?ti.WILDCARD:e[0]===":"||e==="*"?ti.PLACEHOLDER:ti.NORMAL}var dE={id:"",name:"",domain:"",config:{api_url:""},js:"",js_compiled:"",responsive:"",layout:{id:"--",meta:void 0,entry:[]}},pE={id:"",name:"",url:"",snapshot:null,comps:{}};var Ne={active_id:!1,comp_id:!1,instance_comp_id:!1,instance_item_id:!1},ni={should_render_main:!0,hover:{id:""},scope:{},script_nav:{list:[],idx:-1},text:{id:"",content:"",timeout:null,el:null},get item_id(){return Ne.active_id===!1&&(Ne.active_id=localStorage.getItem("prasi-active-id")||""),Ne.active_id||""},set item_id(e){localStorage.setItem("prasi-active-id",e||""),Ne.active_id=e||""},get comp_id(){return Ne.comp_id===!1&&(Ne.comp_id=localStorage.getItem("prasi-comp-id")||""),Ne.comp_id||""},set comp_id(e){localStorage.setItem("prasi-comp-id",e||""),Ne.comp_id=e||""},instance:{get comp_id(){return Ne.instance_comp_id===!1&&(Ne.instance_comp_id=localStorage.getItem("prasi-instance-comp-id")||""),Ne.instance_comp_id||""},set comp_id(e){localStorage.setItem("prasi-instance-comp-id",e||""),Ne.instance_comp_id=e||""},get item_id(){return Ne.instance_item_id===!1&&(Ne.instance_item_id=localStorage.getItem("prasi-instance-item-id")||""),Ne.instance_item_id||""},set item_id(e){localStorage.setItem("prasi-instance-item-id",e||""),Ne.instance_item_id=e||""}}},JT={mode:"",user:{id:"",username:"",client_id:""},clients:{},status:"init",preview:{url_cache:new Set,route_cache:Wl(),page_cache:{},meta_cache:{}},sync:null,sync_assigned:!1,site:Xr(dE),site_tstamp:Date.now(),site_exports:{},site_dts:"",site_dts_entry:{},prisma_ext:"",script:{site_types:{},loaded:!1,do_edit:async(e,t)=>{},db:null,api:null,init_local_effect:{}},page:{history:{id:"",show:!1},root_id:"root",cur:pE,doc:null,list:{},building:!1,meta:{},entry:[],tree:[],render:()=>{}},comp:{doc:null,item:null,loaded:{},list:{},group:{}},code:{},global_prop:[],ui:{monaco:null,comp_editable:localStorage.getItem("prasi-comp-editable")==="yes",zoom:localStorage.zoom||"100%",side:{prop:!0},layout:{left:parseInt(localStorage.getItem("prasi-layout-left")||"250"),right:parseInt(localStorage.getItem("prasi-layout-right")||"250")},prevent_indent_hook:!1,syncing:!1,tree:{item_loading:[],search:"",search_ref:null,search_mode:{Name:!0,JS:!1,HTML:!1,CSS:!1},rename_id:"",open:{}},popup:{file:{enabled:!1,open:!1,picker:{value:"",on_pick:!1,multi:!1},path:"/",expanded:JSON.parse(localStorage.getItem("panel-file-expanded")||"{}"),entry:{},selected:new Set,action:null,file_renaming:"",file_ctx_menu_event:null,tree:[],tree_renaming:"",tree_ctx_path:"",tree_ctx_menu_event:null,preview:!0,upload:{started:!1,progress:{}}},code:{init:!1,open:!1,name:"site",log:"",loading:!1,rebuilding:!1,startup_status:"init",error:!1,show_log:!1,list:{}},page:{open:null,form:null},script:{open:!1,mode:"js",lastMode:"js",type:"item",prop_kind:"",prop_name:"",on_close:()=>{},typings:{status:"ok",err_msg:""},wb_render:()=>{}},site:null,site_form:null,comp:{preview_id:"",open:null,import:!1},comp_group:null,api:{open:!1}}}};var Gl=e=>({isMobile:e.mode==="mobile",isDesktop:e.mode==="desktop",isEditor:location.pathname.startsWith("/ed/")});var ur=P(_e());var ut=window;var mE=hf("prasi-cache","prasi-cache-store"),Ny={timeout:null,store:mE},Zl=(e,t)=>{let n=[...Py(t,"navigate(",")"),...Py(t,"href = ",";")],r=e.page.cur.id;e.page.navs[r]||(e.page.navs[r]=new Set);for(let i of n)e.page.navs[r].add(i);clearTimeout(Ny.timeout),Ny.timeout=setTimeout(()=>{e.on_nav_loaded&&e.on_nav_loaded({urls:Array.from(e.page.navs[r])})},100)},Py=(e,t,n)=>{let r=0,i=0,o=[];for(;;){let s=e.indexOf(t,r);if(i=r,s>=0){let l=e[s+t.length];if(l==='"'||l==="'"||l==="`"){let c=e.indexOf(`${l}${n}`,s+t.length+1),a=e.substring(s+t.length+1,c);r=c+2+n.length,o.push(a)}}if(i===r)break}return o};var ar=P(_e());var Ay=P(bf()),lr=P(_e());var Mf=P(G()),Ly=(e,t,n,r,i)=>o=>{let[s,l]=(0,lr.useState)({}),c=o.internal_key;n.item.script||(n.item.script={});let a=n.item.script;c&&(n.item.script_keyed||(n.item.script_keyed={}),n.item.script_keyed[c]||(n.item.script_keyed[c]={}),a=n.item.script_keyed[c]),a.passprop||(a.passprop={});let u={};if(a.passprop){let d=!1;for(let[g,_]of Object.entries(o))["children","key"].includes(g)||(d=!0,u[g]=_)}let p={...r,...u};if(n.editor_props=p,!Array.isArray(o.children)&&(0,lr.isValidElement)(o.children)&&typeof o.children=="object"){let d=(0,Ay.default)(o.children,"props.meta.item.component.props.child.content.childs");if(Array.isArray(d)){let g=!0;for(let _ of d)!(0,lr.isValidElement)(_)&&typeof _=="object"||(g=!1);if(g)return d.map(_=>{let w=e.meta[_.id];if(w||(e.meta[_.id]={item:_},w=e.meta[_.id]),w){if(Object.keys(w.item).length<=3&&w.mitem){let h={...w.item},m=w.mitem.toJSON();w.item={...m,...h}}return(0,Mf.jsx)(en,{is_layout:t,meta:w,passprop:p,parent_key:o.internal_key,depth:i},_.id)}return null})}}if(!Array.isArray(o.children)&&!(0,lr.isValidElement)(o.children)&&typeof o.children=="object"){let d=o.children.id;if(d){let g=e.meta[d];if(!g){e.meta[d]={item:o.children},g=e.meta[d];let _=g.item.component?.id;_&&e.comp.load(_).then(w=>{if(w){for(let[m,y]of Object.entries(w)){let v=g.item;v[m]||(v[m]=y)}let h=g.item.component?.props;for(let[m,y]of Object.entries(w.component?.props||{}))h[m]||(h[m]=y);l({})}})}return(0,Mf.jsx)(en,{is_layout:t,meta:g,passprop:p,parent_key:o.internal_key,depth:i})}}return zf(o,p,c?{parent_key:c}:void 0)},zf=(e,t,n)=>{let r={};if(Array.isArray(e)?r.children=e:r=e,Array.isArray(r.children)){if(r.children.length===1)return Df(r.children[0],r,t,n);let i=[];for(let o of r.children)i.push(Df(o,r,t,n));return i}return Df(r.children,r,t,n)},Df=(e,t,n,r)=>{if((0,lr.isValidElement)(e)){let i={...t};return delete i.children,{...e,props:{...e.props,...r,passprop:{...n,...i}}}}return e};var ri={},Dy=(e,t,n)=>r=>{let i=["localhost","prasi.avolut.com"].includes(location.hostname)&&location.pathname.startsWith("/ed/"),o=n.item.id,{children:s,parent_key:l}=r,c=e.script?.init_local_effect,a=t?e.layout?.meta:e.meta,u=(0,ar.useRef)(ri[o]?ri[o]:r.value),[p,f]=(0,ar.useState)({}),d=u.current;return d.render=()=>{window.prasiContext.render?window.prasiContext.render():f({})},Kl(e,n,n.script?.scope,l),r.hook&&r.hook(d),(0,ar.useEffect)(()=>{if(n.parent?.instance_id&&a){let _=a[n.parent?.instance_id];if(_&&_.instances){for(let[w,h]of Object.entries(_.instances[n.parent.instance_id]))if(h===n.item.id){o=w;break}}}return!c[o]&&(typeof c=="object"&&(c[o]=!0),(async()=>r.effect&&(await r.effect(d),i&&(ri[o]=d)))()),()=>{}},[...r.deps||[],location.pathname]),(0,ar.useEffect)(()=>{i&&ri[o]===null&&(async()=>r.effect&&(await r.effect(d),i&&(ri[o]=d)))()},[ri[o]]),zf(s,{...n.script?.scope,[r.name]:d})};var jf=P(Vl()),No=window,ii=(e,t,n)=>{No.prasiEdit||(No.prasiEdit={});let r=No.prasiEdit[n];r||(No.prasiEdit[n]={},r=No.prasiEdit[n]);let i=()=>{let s=t.get("id")||"",l=r[s];return l||(r[s]=[],l=r[s]),l},o=t.toJSON();return{...o,edit:{get props(){if(o.component?.props){let s={};for(let[l,c]of Object.entries(o.component.props))if(c.content){let a=t.get("component")?.get("props")?.get(l)?.get("content");a?s[l]={mode:"jsx",value:ii(e,a,n)}:s[l]={mode:"jsx",value:null}}else{let a=typeof c.valueBuilt=="string"?c.valueBuilt.trim():"";if(a.endsWith(`; -`)&&(a=a.substring(0,a.length-2)),a&&a===c.value.trim()){let u=new Function(`return ${c.value}`);s[l]={mode:"string",value:u()}}else s[l]={mode:"raw",value:c.value,valueBuilt:c.valueBuilt}}return s}},get pending(){return[]},async commit(){let s={},l={};if(console.log("committing",r),t){for(let[c,a]of Object.entries(r)){let u=e[c];if(!u||!u.mitem)continue;let f=u.mitem.toJSON();if(f&&f.component){let d=f?.component?.props;if(!d){console.log(f,d);return}let g={};for(let w of a)if(w.type==="prop"&&d)d[w.name]&&(w.mode==="string"?(d[w.name].value=JSON.stringify(w.value),d[w.name].valueBuilt=JSON.stringify(w.value)):w.mode==="raw"?(d[w.name].value=w.value,w.valueBuilt?d[w.name].valueBuilt=w.valueBuilt:g[w.name]=w.value):w.mode==="jsx"&&(d[w.name]||(d[w.name]={meta:{type:"content-element"}}),w.value&&(d[w.name].content=oi([w.value],l)[0])));else if(w.type==="set"&&typeof w.value=="object")for(let[h,m]of Object.entries(w.value))f[h]=m;else if(w.type==="child"&&Array.isArray(w.childs))if(f.component?.id)f.component.props||(f.component.props={}),f.component.props.child={meta:{type:"content-element"},content:{type:"item",id:(0,jf.createId)(),name:"child",childs:oi(w.childs.filter(h=>h),l)}};else{let h=oi(w.childs.filter(m=>m),l);f.childs=h}for(let[w,h]of Object.entries(l))g[w]=h.value;let _=await _api.code_build(g);if(d)for(let[w,h]of Object.entries(_))d[w]?d[w].valueBuilt=h:l[w]&&(l[w].valueBuilt=h);s[c]=f}}t.doc?.transact(()=>{for(let[c,a]of Object.entries(s)){let u=e[c];u.mitem&&syncronize(u.mitem,a)}})}},setValue(s,l){let c=i(),a=l;if(s==="childs")throw new Error("Please modify childs via .child");c.push({type:"set",name:s,value:a})},setProp(s,l){let c=i();typeof l=="string"?c.push({type:"prop",mode:"string",name:s,value:l}):l.mode==="string"?c.push({type:"prop",mode:"string",name:s,value:l.value}):l.mode==="raw"?c.push({type:"prop",mode:"raw",name:s,value:l.value,valueBuilt:l.valueBuilt}):l.mode==="jsx"&&c.push({type:"prop",mode:"jsx",name:s,value:l.value})},setChilds(s){i().push({type:"child",childs:s})},get childs(){let s=t?.toJSON();if(s.component?.id){if((s.component?.props.child).content){let c=t.get("component")?.get("props")?.get("child")?.get("content");if(c)return[ii(e,c,n)]}return[]}return s.childs?s.childs.map(l=>{if(l){let c=e[l.id];if(c&&c.mitem)return ii(e,c.mitem,n)}}).filter(l=>l):[]},get parent(){if(t){let s=t.parent.toJSON();if(Array.isArray(s)){let l=(t.parent?.parent).get("id"),c=e[l].mitem;if(c)return{item:ii(e,c,n),child_type:"child",child_idx:s.findIndex(a=>a.id===o.id)}}}return null}}}},hE=(e,t)=>{let n={};for(let[r,i]of Object.entries(e))i.mode?i.mode==="string"?n[r]={value:JSON.stringify(i.value),valueBuilt:JSON.stringify(i.value),meta:{type:"text"}}:i.mode==="jsx"&&i.value?n[r]={value:"",valueBuilt:"",content:oi([i.value],t)[0],meta:{type:"content-element"}}:i.mode==="raw"&&(n[r]={value:i.value,valueBuilt:i.valueBuilt,meta:{type:"text"}}):n[r]=i;return n},oi=(e,t)=>{let n=t||{};return e.map(i=>{let o={...i};if(delete o.edit,o.id||(o.id=(0,jf.createId)()),o.component&&(o.component.instances||(o.component.instances={}),o.component.ref_ids||(o.component.ref_ids={}),o.component?.props)){o.component.props=hE(o.component.props,n);for(let[s,l]of Object.entries(o.component.props))!l.valueBuilt&&l.value&&(n[o.id+"|||"+s]=l),l.content&&(l.content=oi([l.content],n)[0])}return o.childs?o.childs=oi(o.childs,n):o.childs=[],o})};var si=(e,t,n)=>({...t,edit:{setChilds(r){},get childs(){if(t.component?.id){let r=t.component?.props.child;return r.content?[si(e,r.content,n)]:[]}return t.childs?t.childs.map(r=>{if(r){let i=e[r.id];if(i&&i.item)return si(e,i.item,n)}}).filter(r=>r):[]},get props(){if(t.component?.props){let r={};for(let[i,o]of Object.entries(t.component.props))if(o.content){let s=t.component?.props?.[i]?.content;s?r[i]={mode:"jsx",value:si(e,s,n)}:r[i]={mode:"jsx",value:null}}else{let s=typeof o.valueBuilt=="string"?o.valueBuilt.trim():"";if(s.endsWith(`; +`)&&(a=a.substring(0,a.length-2)),a&&a===c.value.trim()){let u=new Function(`return ${c.value}`);s[l]={mode:"string",value:u()}}else s[l]={mode:"raw",value:c.value,valueBuilt:c.valueBuilt}}return s}},get pending(){return[]},async commit(){let s={},l={};if(t){for(let[c,a]of Object.entries(r)){let u=e[c];if(!u||!u.mitem)continue;let f=u.mitem.toJSON();if(f&&f.component){let d=f?.component?.props;if(!d){console.log(f,d);return}let g={};for(let w of a)if(w.type==="prop"&&d)d[w.name]&&(w.mode==="string"?(d[w.name].value=JSON.stringify(w.value),d[w.name].valueBuilt=JSON.stringify(w.value)):w.mode==="raw"?(d[w.name].value=w.value,w.valueBuilt?d[w.name].valueBuilt=w.valueBuilt:g[w.name]=w.value):w.mode==="jsx"&&(d[w.name]||(d[w.name]={meta:{type:"content-element"}}),w.value&&(d[w.name].content=oi([w.value],l)[0])));else if(w.type==="set"&&typeof w.value=="object")for(let[h,m]of Object.entries(w.value))f[h]=m;else if(w.type==="child"&&Array.isArray(w.childs))if(f.component?.id)f.component.props||(f.component.props={}),f.component.props.child={meta:{type:"content-element"},content:{type:"item",id:(0,jf.createId)(),name:"child",childs:oi(w.childs.filter(h=>h),l)}};else{let h=oi(w.childs.filter(m=>m),l);f.childs=h}for(let[w,h]of Object.entries(l))g[w]=h.value;let _=await _api.code_build(g);if(d)for(let[w,h]of Object.entries(_))d[w]?d[w].valueBuilt=h:l[w]&&(l[w].valueBuilt=h);s[c]=f}}t.doc?.transact(()=>{for(let[c,a]of Object.entries(s)){let u=e[c];u.mitem&&syncronize(u.mitem,a)}})}},setValue(s,l){let c=i(),a=l;if(s==="childs")throw new Error("Please modify childs via .child");c.push({type:"set",name:s,value:a})},setProp(s,l){let c=i();typeof l=="string"?c.push({type:"prop",mode:"string",name:s,value:l}):l.mode==="string"?c.push({type:"prop",mode:"string",name:s,value:l.value}):l.mode==="raw"?c.push({type:"prop",mode:"raw",name:s,value:l.value,valueBuilt:l.valueBuilt}):l.mode==="jsx"&&c.push({type:"prop",mode:"jsx",name:s,value:l.value})},setChilds(s){i().push({type:"child",childs:s})},get childs(){let s=t?.toJSON();if(s.component?.id){if((s.component?.props.child).content){let c=t.get("component")?.get("props")?.get("child")?.get("content");if(c)return[ii(e,c,n)]}return[]}return s.childs?s.childs.map(l=>{if(l){let c=e[l.id];if(c&&c.mitem)return ii(e,c.mitem,n)}}).filter(l=>l):[]},get parent(){if(t){let s=t.parent.toJSON();if(Array.isArray(s)){let l=(t.parent?.parent).get("id"),c=e[l].mitem;if(c)return{item:ii(e,c,n),child_type:"child",child_idx:s.findIndex(a=>a.id===o.id)}}}return null}}}},hE=(e,t)=>{let n={};for(let[r,i]of Object.entries(e))i.mode?i.mode==="string"?n[r]={value:JSON.stringify(i.value),valueBuilt:JSON.stringify(i.value),meta:{type:"text"}}:i.mode==="jsx"&&i.value?n[r]={value:"",valueBuilt:"",content:oi([i.value],t)[0],meta:{type:"content-element"}}:i.mode==="raw"&&(n[r]={value:i.value,valueBuilt:i.valueBuilt,meta:{type:"text"}}):n[r]=i;return n},oi=(e,t)=>{let n=t||{};return e.map(i=>{let o={...i};if(delete o.edit,o.id||(o.id=(0,jf.createId)()),o.component&&(o.component.instances||(o.component.instances={}),o.component.ref_ids||(o.component.ref_ids={}),o.component?.props)){o.component.props=hE(o.component.props,n);for(let[s,l]of Object.entries(o.component.props))!l.valueBuilt&&l.value&&(n[o.id+"|||"+s]=l),l.content&&(l.content=oi([l.content],n)[0])}return o.childs?o.childs=oi(o.childs,n):o.childs=[],o})};var si=(e,t,n)=>({...t,edit:{setChilds(r){},get childs(){if(t.component?.id){let r=t.component?.props.child;return r.content?[si(e,r.content,n)]:[]}return t.childs?t.childs.map(r=>{if(r){let i=e[r.id];if(i&&i.item)return si(e,i.item,n)}}).filter(r=>r):[]},get props(){if(t.component?.props){let r={};for(let[i,o]of Object.entries(t.component.props))if(o.content){let s=t.component?.props?.[i]?.content;s?r[i]={mode:"jsx",value:si(e,s,n)}:r[i]={mode:"jsx",value:null}}else{let s=typeof o.valueBuilt=="string"?o.valueBuilt.trim():"";if(s.endsWith(`; `)&&(s=s.substring(0,s.length-2)),s&&s===o.value.trim()){let l=new Function(`return ${o.value}`);r[i]={mode:"string",value:l()}}else r[i]={mode:"raw",value:o.value,valueBuilt:o.valueBuilt}}return r}},async commit(){},get parent(){let r=e[t.id];if(r&&r.parent?.id){let i=e[r.parent.id];return si(e,i.item,n)}return null},pending:[],setProp(r,i){},setValue(r,i){}}});var Ff=P(G()),My=(e,t,n,r,i,o)=>{let s=bo(e,t,n,r,i);e.visit&&e.visit(t,s),t.script?t.script.scope=r:t.script={scope:r,result:null,Local:Dy(e,n,t),PassProp:Ly(e,n,t,r,i)};let l=t.script,c=window.exports,a={useEffect:ur.useEffect,children:s.props.children,props:s.props,Local:l?.Local,db:e.site.db,api:e.site.api,PassProp:l?.PassProp,ErrorBox:Pt,newElement:()=>{},__props:r,_item:t.mitem?ii(e.meta,t.mitem,e.page.cur.id):si(e.meta,t.item,e.page.cur.id),_meta:e.meta,render:f=>{let d=f;if((0,ur.isValidElement)(f)&&f.props.children){let g=w=>{let h=!1,m=[];if((0,ur.isValidElement)(w)){if(w.type===t.script?.PassProp)return{should_replace:!0,el:{...w,props:{...w.props,internal_key:w.key}}};if(Array.isArray(w.props?.children))for(let y of w.props?.children)if(Array.isArray(y)){let v=[],S=!1;for(let E of y){let k=g(E);k.should_replace?(v.push(k.el),S=!0):v.push(E)}S?(h=!0,m.push(v)):m.push(y)}else typeof y=="object"&&y?y.type===t.script?.PassProp&&(h=!0,m.push({...y,props:{...y.props,internal_key:y.props.key}})):m.push(y)}return{should_replace:h,el:{...w,props:{...w.props,children:m}}}},_=g(f);_.should_replace&&(d=_.el)}l&&(l.result=(0,Ff.jsx)(ur.Suspense,{children:d}))},params,...Gl(e),...c,...r};if(typeof r=="object"){for(let[f,d]of Object.entries(r))if(typeof d=="object"&&d&&d._jsx){let g=d;a[f]=(0,Ff.jsx)(gE,{fn:g.fn,passprop:{...r},meta:t})}}!ut.isEditor&&t.item.adv?.js&&Zl(e,t.item.adv.js);let u=t.item.adv?.jsBuilt||"",p=Bf(u,Uf)||"";try{new Function(...Object.keys(a),"___js",`// ${t.item.name}: ${t.item.id} try { ${p} diff --git a/app/web/src/nova/vi/render/script/item-dev.ts b/app/web/src/nova/vi/render/script/item-dev.ts index aa0672b3..3e2a62f9 100644 --- a/app/web/src/nova/vi/render/script/item-dev.ts +++ b/app/web/src/nova/vi/render/script/item-dev.ts @@ -125,7 +125,6 @@ export const devItem = ( { value: string; valueBuilt?: string } >; - console.log("committing", pedit); if (mitem) { for (const [item_id, changes] of Object.entries(pedit)) { const meta = metas[item_id];