This commit is contained in:
Rizky 2024-07-12 22:40:21 +07:00
parent daafef962e
commit 363ec20ac5
2 changed files with 7 additions and 2 deletions

View File

@ -132,7 +132,7 @@ ${p}
}
`:"inset-0 overflow-auto",css`
contain: content;
`),children:(0,un.jsx)(Vy,{api_url:C.site.api_url,entry:Object.values(C.page.root.childs).filter(a=>a).map(a=>a.id),meta:C.page.meta,mode:C.mode,page_id:C.page.id,site_id:C.site.id,db:C.site.db,api:C.site.api,preloaded:a=>!!C.route.router?.lookup(a),comp_load:async a=>{let p=C.comp;if(p.list[a])return p.list[a];try{let f=await(await fetch(C.url`_prasi/comp`,{method:"POST",body:JSON.stringify({ids:[a]})})).json();for(let[d,g]of Object.entries(f))delete p.pending[d],p.list[d]=g,await zl(`comp-${d}`,g)}catch{}return p.list[a]},layout:C.layout.id&&C.layout.root&&C.layout.meta?{id:C.layout.id,meta:C.layout.meta,entry:Object.values(C.layout.root.childs).filter(a=>a).map(a=>a.id)}:void 0,script:{init_local_effect:C.init_local_effect},on_preload:async({urls:a,opt:p})=>{let f=[];if(C.cache.urls)for(let d of a)C.cache.urls.has(d)||(f.push(d),C.cache.urls.add(d));if(f.length>0){let d=await Zy(f);if(p?.on_load&&p.on_load(d,a3),Array.isArray(d))for(let g of d){let w={id:g.id,url:g.url,root:g.root,meta:{}};await ui(g.root.childs),Aa(w.meta,g.root),C.page.cache[w.id]=w}}}})})})})},a3=(e,t)=>{for(let n of e)for(let r of n.root.childs)Qd(r,t)},Qd=(e,t)=>{if(t(e),e.type!=="text"){if(e.type==="item"&&e.component?.props)for(let n of Object.values(e.component.props))n.content&&Qd(n.content,t);for(let n of e.childs)Qd(n,t)}};var F1=P(G());(async()=>{Wy();let e=document.getElementById("root");if(e){await ng(!1);let t={root:(0,j1.createRoot)(e)};X0(),le.navigateOverride=n=>(n&&n.startsWith("/")&&qd()&&location.pathname.startsWith("/prod")&&!n.startsWith("/prod")&&(n=`/prod/${location.pathname.split("/")[2]}${n}`),n),t.root.render((0,F1.jsx)(z1,{})),document.body.classList.contains("opacity-0")&&document.body.classList.remove("opacity-0")}})();
`),children:(0,un.jsx)(Vy,{api_url:C.site.api_url,entry:Object.values(C.page.root.childs).filter(a=>a).map(a=>a.id),meta:C.page.meta,mode:C.mode,page_id:C.page.id,site_id:C.site.id,db:C.site.db,api:C.site.api,preloaded:a=>{let p=C.route.router?.lookup(a);return!!(p&&C.page.cache[p.id])},comp_load:async a=>{let p=C.comp;if(p.list[a])return p.list[a];try{let f=await(await fetch(C.url`_prasi/comp`,{method:"POST",body:JSON.stringify({ids:[a]})})).json();for(let[d,g]of Object.entries(f))delete p.pending[d],p.list[d]=g,await zl(`comp-${d}`,g)}catch{}return p.list[a]},layout:C.layout.id&&C.layout.root&&C.layout.meta?{id:C.layout.id,meta:C.layout.meta,entry:Object.values(C.layout.root.childs).filter(a=>a).map(a=>a.id)}:void 0,script:{init_local_effect:C.init_local_effect},on_preload:async({urls:a,opt:p})=>{let f=[];if(C.cache.urls)for(let d of a)C.cache.urls.has(d)||(f.push(d),C.cache.urls.add(d));if(f.length>0){let d=await Zy(f);if(p?.on_load&&p.on_load(d,a3),Array.isArray(d))for(let g of d){let w={id:g.id,url:g.url,root:g.root,meta:{}};await ui(g.root.childs),Aa(w.meta,g.root),C.page.cache[w.id]=w}}}})})})})},a3=(e,t)=>{for(let n of e)for(let r of n.root.childs)Qd(r,t)},Qd=(e,t)=>{if(t(e),e.type!=="text"){if(e.type==="item"&&e.component?.props)for(let n of Object.values(e.component.props))n.content&&Qd(n.content,t);for(let n of e.childs)Qd(n,t)}};var F1=P(G());(async()=>{Wy();let e=document.getElementById("root");if(e){await ng(!1);let t={root:(0,j1.createRoot)(e)};X0(),le.navigateOverride=n=>(n&&n.startsWith("/")&&qd()&&location.pathname.startsWith("/prod")&&!n.startsWith("/prod")&&(n=`/prod/${location.pathname.split("/")[2]}${n}`),n),t.root.render((0,F1.jsx)(z1,{})),document.body.classList.contains("opacity-0")&&document.body.classList.remove("opacity-0")}})();
/*! Bundled license information:
react/cjs/react.production.min.js:

View File

@ -207,7 +207,12 @@ export const Root = () => {
db={base.site.db}
api={base.site.api}
preloaded={(url) => {
if (base.route.router?.lookup(url)) return true;
const found = base.route.router?.lookup(url);
if (found) {
if (base.page.cache[found.id]) {
return true;
}
}
return false;
}}
comp_load={async (comp_id) => {