fix
This commit is contained in:
parent
665d143718
commit
a651e053c6
|
|
@ -78,7 +78,7 @@ export const _ = {
|
||||||
"content-encoding": "gzip",
|
"content-encoding": "gzip",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (e) { }
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
return new Response("{}", {
|
return new Response("{}", {
|
||||||
headers: { "content-type": "application/json" },
|
headers: { "content-type": "application/json" },
|
||||||
|
|
@ -120,7 +120,7 @@ export const _ = {
|
||||||
await new Promise<void>((resolve) => {
|
await new Promise<void>((resolve) => {
|
||||||
const ival = setInterval(async () => {
|
const ival = setInterval(async () => {
|
||||||
file = Bun.file(build_path);
|
file = Bun.file(build_path);
|
||||||
const exists = await file.exists()
|
const exists = await file.exists();
|
||||||
if (exists) {
|
if (exists) {
|
||||||
clearInterval(ival);
|
clearInterval(ival);
|
||||||
resolve();
|
resolve();
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ ${d}
|
||||||
}
|
}
|
||||||
`:"inset-0 overflow-auto",css`
|
`:"inset-0 overflow-auto",css`
|
||||||
contain: content;
|
contain: content;
|
||||||
`),children:(0,on.jsx)(Ay,{api_url:I.site.api_url,entry:Object.values(I.page.root.childs).filter(c=>c).map(c=>c.id),meta:I.page.meta,mode:I.mode,page_id:I.page.id,site_id:I.site.id,db:I.site.db,api:I.site.api,comp_load:async c=>{let d=I.comp;if(d.list[c])return d.list[c];try{let f=await(await fetch(I.url`_prasi/comp`,{method:"POST",body:JSON.stringify({ids:[c]})})).json();for(let[p,g]of Object.entries(f))delete d.pending[p],d.list[p]=g,await Ls(`comp-${p}`,g)}catch{}return d.list[c]},layout:I.layout.id&&I.layout.root&&I.layout.meta?{id:I.layout.id,meta:I.layout.meta,entry:Object.values(I.layout.root.childs).filter(c=>c).map(c=>c.id)}:void 0,script:{init_local_effect:I.init_local_effect},on_preload:async({urls:c,opt:d})=>{let f=[],p={};if(I.cache.urls)for(let g of c)I.cache.urls.has(g)||(f.push(g),I.cache.urls.add(g));if(f.length>0){let g=await zy(f);if(d?.on_load&&d.on_load(g,AC),Array.isArray(g))for(let _ of g){let w={id:_.id,url:_.url,root:_.root,meta:{}};await li(_.root.childs),Ca(w.meta,_.root),I.page.cache[w.id]=w}}}})})})})},AC=(e,t)=>{for(let n of e)for(let r of n.root.childs)Fd(r,t)},Fd=(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&&Fd(n.content,t);for(let n of e.childs)Fd(n,t)}};var E1=P(G());(async()=>{Ly();let e=document.getElementById("root");if(e){let t=(0,S1.createRoot)(e);await G0(!1),B0(),se.navigateOverride=n=>(n&&n.startsWith("/")&&Ud()&&location.pathname.startsWith("/prod")&&!n.startsWith("/prod")&&(n=`/prod/${location.pathname.split("/")[2]}${n}`),n),t.render((0,E1.jsx)(k1,{})),document.body.classList.contains("opacity-0")&&document.body.classList.remove("opacity-0")}})();
|
`),children:(0,on.jsx)(Ay,{api_url:I.site.api_url,entry:Object.values(I.page.root.childs).filter(c=>c).map(c=>c.id),meta:I.page.meta,mode:I.mode,page_id:I.page.id,site_id:I.site.id,db:I.site.db,api:I.site.api,comp_load:async c=>{let d=I.comp;if(d.list[c])return d.list[c];try{let f=await(await fetch(I.url`_prasi/comp`,{method:"POST",body:JSON.stringify({ids:[c]})})).json();for(let[p,g]of Object.entries(f))delete d.pending[p],d.list[p]=g,await Ls(`comp-${p}`,g)}catch{}return d.list[c]},layout:I.layout.id&&I.layout.root&&I.layout.meta?{id:I.layout.id,meta:I.layout.meta,entry:Object.values(I.layout.root.childs).filter(c=>c).map(c=>c.id)}:void 0,script:{init_local_effect:I.init_local_effect},on_preload:async({urls:c,opt:d})=>{let f=[],p={};if(I.cache.urls)for(let g of c)I.cache.urls.has(g)||(f.push(g),I.cache.urls.add(g));if(f.length>0){let g=await zy(f);if(d?.on_load&&d.on_load(g,AC),Array.isArray(g))for(let _ of g){let w={id:_.id,url:_.url,root:_.root,meta:{}};await li(_.root.childs),Ca(w.meta,_.root),I.page.cache[w.id]=w}}}})})})})},AC=(e,t)=>{for(let n of e)for(let r of n.root.childs)Fd(r,t)},Fd=(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&&Fd(n.content,t);for(let n of e.childs)Fd(n,t)}};var E1=P(G());(async()=>{Ly();let e=document.getElementById("root");if(e){await G0(!1);let t={root:(0,S1.createRoot)(e)};B0(),se.navigateOverride=n=>(n&&n.startsWith("/")&&Ud()&&location.pathname.startsWith("/prod")&&!n.startsWith("/prod")&&(n=`/prod/${location.pathname.split("/")[2]}${n}`),n),t.root.render((0,E1.jsx)(k1,{})),document.body.classList.contains("opacity-0")&&document.body.classList.remove("opacity-0")}})();
|
||||||
/*! Bundled license information:
|
/*! Bundled license information:
|
||||||
|
|
||||||
react/cjs/react.production.min.js:
|
react/cjs/react.production.min.js:
|
||||||
|
|
|
||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -1,15 +1,19 @@
|
||||||
import { createRoot } from "react-dom/client";
|
import { Root as ReactRoot, createRoot } from "react-dom/client";
|
||||||
import { defineReact, defineWindow } from "web-utils";
|
import { defineReact, defineWindow } from "web-utils";
|
||||||
import { Root, isPreview } from "./root";
|
import { Root, isPreview } from "./root";
|
||||||
import { initBaseConfig } from "./base/base";
|
import { initBaseConfig } from "./base/base";
|
||||||
import { w } from "./w";
|
import { w } from "./w";
|
||||||
|
import { sworkerRegister } from "../../sworker-boot";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
initBaseConfig();
|
initBaseConfig();
|
||||||
const div = document.getElementById("root");
|
const div = document.getElementById("root");
|
||||||
if (div) {
|
if (div) {
|
||||||
const root = createRoot(div);
|
|
||||||
await defineWindow(false);
|
await defineWindow(false);
|
||||||
|
|
||||||
|
let react = {
|
||||||
|
root: createRoot(div),
|
||||||
|
};
|
||||||
defineReact();
|
defineReact();
|
||||||
|
|
||||||
w.navigateOverride = (_href: string) => {
|
w.navigateOverride = (_href: string) => {
|
||||||
|
|
@ -27,7 +31,7 @@ import { w } from "./w";
|
||||||
return _href;
|
return _href;
|
||||||
};
|
};
|
||||||
|
|
||||||
root.render(<Root />);
|
react.root.render(<Root />);
|
||||||
if (document.body.classList.contains("opacity-0")) {
|
if (document.body.classList.contains("opacity-0")) {
|
||||||
document.body.classList.remove("opacity-0");
|
document.body.classList.remove("opacity-0");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue