This commit is contained in:
Rizky 2024-11-19 09:48:29 +07:00
parent 0dc8fd6275
commit f0736c5291
5 changed files with 16 additions and 8 deletions

View File

@ -16,7 +16,9 @@ model component {
type String @default("item")
id_component_group String? @db.Uuid
props Json @default("[]")
deleted_at DateTime? @db.Timestamp(6)
component_group component_group? @relation(fields: [id_component_group], references: [id], onDelete: Cascade)
component_ext component_ext[]
}
model component_group {
@ -175,3 +177,12 @@ model deploy_target {
id_site String @db.Uuid
site site @relation(fields: [id_site], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
model component_ext {
id Int @id @default(autoincrement())
created_at DateTime @default(now()) @db.Timestamp(6)
id_component String @db.Uuid
img Bytes?
desc String?
component component @relation(fields: [id_component], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "component_ext_relation_1")
}

View File

@ -155,6 +155,7 @@ return ${h.trim()}
overflow-x: hidden;
overflow-y: auto;
bottom: 0px;
contain: content;
}
@media (max-width: 1279px) {
left: 0px;
@ -163,9 +164,7 @@ return ${h.trim()}
bottom: 0px;
overflow-y: auto;
}
`):z.page.root.responsive==="desktop"&&(z.mode="desktop"),z.mode||(z.mode="mobile"),(0,Zn.jsx)(i,{value:Ae.prasiContext,children:(0,Zn.jsx)("div",{className:cx("relative flex flex-1 items-center justify-center"),onPointerLeave:()=>{Ae.pointerActive=!1},onPointerEnter:()=>{Ae.pointerActive=!0},children:(0,Zn.jsx)("div",{className:cx("absolute flex flex-col items-stretch flex-1 bg-white main-content",z.mode==="mobile"?p:"inset-0 overflow-auto",css`
contain: content;
`),children:(0,Zn.jsx)(fw,{api_url:z.site.api_url,entry:Object.values(z.page.root.childs).filter(d=>d).map(d=>d.id),meta:z.page.meta,mode:z.mode,page_id:z.page.id,site_id:z.site.id,db:z.site.db,api:z.site.api,preloaded:d=>{let f=z.route.router?.lookup(d);return!!(f&&z.page.cache[f.id])},comp_load:async d=>{let f=z.comp;if(f.list[d])return f.list[d];try{let h=await(await fetch(z.url`_prasi/comp`,{method:"POST",body:JSON.stringify({ids:[d]})})).json();for(let[b,S]of Object.entries(h))delete f.pending[b],f.list[b]=S,await Jr(`comp-${b}`,S)}catch{}return f.list[d]},layout:z.layout.id&&z.layout.root&&z.layout.meta?{id:z.layout.id,meta:z.layout.meta,entry:Object.values(z.layout.root.childs).filter(d=>d).map(d=>d.id)}:void 0,script:{init_local_effect:z.init_local_effect},on_preload:async({urls:d,opt:f})=>{let h=[];if(z.cache.urls)for(let b of d)z.cache.urls.has(b)||(h.push(b),z.cache.urls.add(b));if(h.length>0){let b=await Ix(h);if(f?.on_load&&f.on_load(b,TT),Array.isArray(b))for(let S of b){let m={id:S.id,url:S.url,root:S.root,meta:{}};await mi(S.root.childs),nl(m.meta,S.root),z.page.cache[m.id]=m}}}})})})})},TT=(e,t)=>{for(let n of e)for(let r of n.root.childs)ym(r,t)},ym=(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&&ym(n.content,t);for(let n of e.childs)ym(n,t)}};var Mx=Z(he());(async()=>{import("./font-WINJX3PY.js"),xy();let e=document.getElementById("root");if(e){await vy(!1);let t={root:(0,jx.createRoot)(e)};hy();let n="/_prasi/code/internal.js";location.pathname.startsWith("/prod")&&(n=`/prod/${location.pathname.split("/")[2]}${n}`);let r=await import(n);if(typeof r=="object"){let i=window;r.Loading&&(i.ContentLoading=r.Loading),r.NotFound&&(i.ContentNotFound=r.NotFound)}Ae.navigateOverride=i=>(i&&i.startsWith("/")&&_m()&&location.pathname.startsWith("/prod")&&!i.startsWith("/prod")&&(i=`/prod/${location.pathname.split("/")[2]}${i}`),i),t.root.render((0,Mx.jsx)(Dx,{})),document.body.classList.contains("opacity-0")&&document.body.classList.remove("opacity-0")}})();
`):z.page.root.responsive==="desktop"&&(z.mode="desktop"),z.mode||(z.mode="mobile"),(0,Zn.jsx)(i,{value:Ae.prasiContext,children:(0,Zn.jsx)("div",{className:cx("relative flex flex-1 items-center justify-center"),onPointerLeave:()=>{Ae.pointerActive=!1},onPointerEnter:()=>{Ae.pointerActive=!0},children:(0,Zn.jsx)("div",{className:cx("absolute flex flex-col items-stretch flex-1 bg-white main-content",z.mode==="mobile"?p:"inset-0 overflow-auto"),children:(0,Zn.jsx)(fw,{api_url:z.site.api_url,entry:Object.values(z.page.root.childs).filter(d=>d).map(d=>d.id),meta:z.page.meta,mode:z.mode,page_id:z.page.id,site_id:z.site.id,db:z.site.db,api:z.site.api,preloaded:d=>{let f=z.route.router?.lookup(d);return!!(f&&z.page.cache[f.id])},comp_load:async d=>{let f=z.comp;if(f.list[d])return f.list[d];try{let h=await(await fetch(z.url`_prasi/comp`,{method:"POST",body:JSON.stringify({ids:[d]})})).json();for(let[b,S]of Object.entries(h))delete f.pending[b],f.list[b]=S,await Jr(`comp-${b}`,S)}catch{}return f.list[d]},layout:z.layout.id&&z.layout.root&&z.layout.meta?{id:z.layout.id,meta:z.layout.meta,entry:Object.values(z.layout.root.childs).filter(d=>d).map(d=>d.id)}:void 0,script:{init_local_effect:z.init_local_effect},on_preload:async({urls:d,opt:f})=>{let h=[];if(z.cache.urls)for(let b of d)z.cache.urls.has(b)||(h.push(b),z.cache.urls.add(b));if(h.length>0){let b=await Ix(h);if(f?.on_load&&f.on_load(b,TT),Array.isArray(b))for(let S of b){let m={id:S.id,url:S.url,root:S.root,meta:{}};await mi(S.root.childs),nl(m.meta,S.root),z.page.cache[m.id]=m}}}})})})})},TT=(e,t)=>{for(let n of e)for(let r of n.root.childs)ym(r,t)},ym=(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&&ym(n.content,t);for(let n of e.childs)ym(n,t)}};var Mx=Z(he());(async()=>{import("./font-WINJX3PY.js"),xy();let e=document.getElementById("root");if(e){await vy(!1);let t={root:(0,jx.createRoot)(e)};hy();let n="/_prasi/code/internal.js";location.pathname.startsWith("/prod")&&(n=`/prod/${location.pathname.split("/")[2]}${n}`);let r=await import(n);if(typeof r=="object"){let i=window;r.Loading&&(i.ContentLoading=r.Loading),r.NotFound&&(i.ContentNotFound=r.NotFound)}Ae.navigateOverride=i=>(i&&i.startsWith("/")&&_m()&&location.pathname.startsWith("/prod")&&!i.startsWith("/prod")&&(i=`/prod/${location.pathname.split("/")[2]}${i}`),i),t.root.render((0,Mx.jsx)(Dx,{})),document.body.classList.contains("opacity-0")&&document.body.classList.remove("opacity-0")}})();
/*! Bundled license information:
react/cjs/react.production.min.js:

View File

@ -188,6 +188,7 @@ export const Root = () => {
overflow-x: hidden;
overflow-y: auto;
bottom: 0px;
contain: content;
}
@media (max-width: 1279px) {
left: 0px;
@ -219,10 +220,7 @@ export const Root = () => {
<div
className={cx(
"absolute flex flex-col items-stretch flex-1 bg-white main-content",
base.mode === "mobile" ? mobileCSS : "inset-0 overflow-auto",
css`
contain: content;
`
base.mode === "mobile" ? mobileCSS : "inset-0 overflow-auto"
)}
>
<Vi

Binary file not shown.

File diff suppressed because one or more lines are too long