@object-ui/console 3.0.1 → 3.0.2
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/assets/{AuditLogPage-BQW_Xbnm.js → AuditLogPage-CyY7VZJW.js} +1 -1
- package/dist/assets/AuditLogPage-CyY7VZJW.js.br +0 -0
- package/dist/assets/AuditLogPage-CyY7VZJW.js.gz +0 -0
- package/dist/assets/{DashboardView-Dt-4VhH6.js → DashboardView-CikFb_lD.js} +1 -1
- package/dist/assets/DashboardView-CikFb_lD.js.br +0 -0
- package/dist/assets/DashboardView-CikFb_lD.js.gz +0 -0
- package/dist/assets/{ForgotPasswordPage-zr9S5vrE.js → ForgotPasswordPage-DUfjj-wh.js} +1 -1
- package/dist/assets/{KanbanEnhanced-BlGp--J7.js → KanbanEnhanced-CwlMhI0l.js} +1 -1
- package/dist/assets/KanbanEnhanced-CwlMhI0l.js.br +0 -0
- package/dist/assets/KanbanEnhanced-CwlMhI0l.js.gz +0 -0
- package/dist/assets/{KanbanImpl-B5wWMXrJ.js → KanbanImpl-BsMtStI7.js} +1 -1
- package/dist/assets/KanbanImpl-BsMtStI7.js.br +0 -0
- package/dist/assets/KanbanImpl-BsMtStI7.js.gz +0 -0
- package/dist/assets/{LoginPage-H688gsah.js → LoginPage-2CoFvwsL.js} +1 -1
- package/dist/assets/{OrgManagementPage-x3qIkxHL.js → OrgManagementPage-BJt5Iiun.js} +1 -1
- package/dist/assets/OrgManagementPage-BJt5Iiun.js.br +0 -0
- package/dist/assets/OrgManagementPage-BJt5Iiun.js.gz +0 -0
- package/dist/assets/{PageView-BRN1h8QD.js → PageView-CQP2T84v.js} +1 -1
- package/dist/assets/PageView-CQP2T84v.js.br +0 -0
- package/dist/assets/PageView-CQP2T84v.js.gz +0 -0
- package/dist/assets/{ProfilePage-DjAiGvFb.js → ProfilePage-MVUfKMrp.js} +1 -1
- package/dist/assets/ProfilePage-MVUfKMrp.js.br +0 -0
- package/dist/assets/ProfilePage-MVUfKMrp.js.gz +0 -0
- package/dist/assets/{RecordDetailView-Bfu7541n.js → RecordDetailView-IO2ShB0a.js} +1 -1
- package/dist/assets/RecordDetailView-IO2ShB0a.js.br +0 -0
- package/dist/assets/RecordDetailView-IO2ShB0a.js.gz +0 -0
- package/dist/assets/{RegisterPage-CR91Lc7x.js → RegisterPage-B9itUVYp.js} +1 -1
- package/dist/assets/{ReportView-CwWsv2yl.js → ReportView-BfR7RjL9.js} +1 -1
- package/dist/assets/ReportView-BfR7RjL9.js.br +0 -0
- package/dist/assets/ReportView-BfR7RjL9.js.gz +0 -0
- package/dist/assets/{RoleManagementPage-DnWuzxKJ.js → RoleManagementPage-BRqaeF_L.js} +1 -1
- package/dist/assets/RoleManagementPage-BRqaeF_L.js.br +0 -0
- package/dist/assets/RoleManagementPage-BRqaeF_L.js.gz +0 -0
- package/dist/assets/{SearchResultsPage-DBpjAlh2.js → SearchResultsPage-DaxRxhBY.js} +1 -1
- package/dist/assets/SearchResultsPage-DaxRxhBY.js.br +0 -0
- package/dist/assets/SearchResultsPage-DaxRxhBY.js.gz +0 -0
- package/dist/assets/{UserManagementPage-o0_K0dzR.js → UserManagementPage-DOH6ql6-.js} +1 -1
- package/dist/assets/UserManagementPage-DOH6ql6-.js.br +0 -0
- package/dist/assets/UserManagementPage-DOH6ql6-.js.gz +0 -0
- package/dist/assets/{data-adapter-Cn800k4a.js → data-adapter-CIsDmDZ2.js} +1 -1
- package/dist/assets/data-adapter-CIsDmDZ2.js.br +0 -0
- package/dist/assets/data-adapter-CIsDmDZ2.js.gz +0 -0
- package/dist/assets/{index-BjEGJcpx.js → index-5NGcxsNI.js} +7 -7
- package/dist/assets/index-5NGcxsNI.js.br +0 -0
- package/dist/assets/index-5NGcxsNI.js.gz +0 -0
- package/dist/assets/{infrastructure-aS2LF8OZ.js → infrastructure-Di0WqY4l.js} +1 -1
- package/dist/assets/infrastructure-Di0WqY4l.js.br +0 -0
- package/dist/assets/infrastructure-Di0WqY4l.js.gz +0 -0
- package/dist/assets/{plugins-core-CcBSZCjG.js → plugins-core-HuzSJDPK.js} +1 -1
- package/dist/assets/plugins-core-HuzSJDPK.js.br +0 -0
- package/dist/assets/plugins-core-HuzSJDPK.js.gz +0 -0
- package/dist/assets/{plugins-views-DQwkCaaO.js → plugins-views-JvEQp7xT.js} +1 -1
- package/dist/assets/plugins-views-JvEQp7xT.js.br +0 -0
- package/dist/assets/plugins-views-JvEQp7xT.js.gz +0 -0
- package/dist/assets/{ui-components-DVonQS7H.js → ui-components-CseD2Dpn.js} +1 -1
- package/dist/assets/ui-components-CseD2Dpn.js.br +0 -0
- package/dist/assets/ui-components-CseD2Dpn.js.gz +0 -0
- package/dist/assets/{ui-layout-BENIRxAF.js → ui-layout-CF_1bNSv.js} +1 -1
- package/dist/assets/ui-layout-CF_1bNSv.js.br +0 -0
- package/dist/assets/ui-layout-CF_1bNSv.js.gz +0 -0
- package/dist/assets/vendor-objectstack-BbgElG6O.js +37 -0
- package/dist/assets/vendor-objectstack-BbgElG6O.js.br +0 -0
- package/dist/assets/vendor-objectstack-BbgElG6O.js.gz +0 -0
- package/dist/index.html +24 -24
- package/dist/index.html.br +0 -0
- package/dist/index.html.gz +0 -0
- package/dist/stats.html +1 -1
- package/package.json +46 -41
- package/plugin.d.ts +44 -0
- package/plugin.js +62 -0
- package/plugin.ts +9 -118
- package/dist/assets/AuditLogPage-BQW_Xbnm.js.br +0 -0
- package/dist/assets/AuditLogPage-BQW_Xbnm.js.gz +0 -0
- package/dist/assets/DashboardView-Dt-4VhH6.js.br +0 -0
- package/dist/assets/DashboardView-Dt-4VhH6.js.gz +0 -0
- package/dist/assets/KanbanEnhanced-BlGp--J7.js.br +0 -0
- package/dist/assets/KanbanEnhanced-BlGp--J7.js.gz +0 -0
- package/dist/assets/KanbanImpl-B5wWMXrJ.js.br +0 -0
- package/dist/assets/KanbanImpl-B5wWMXrJ.js.gz +0 -0
- package/dist/assets/OrgManagementPage-x3qIkxHL.js.br +0 -0
- package/dist/assets/OrgManagementPage-x3qIkxHL.js.gz +0 -0
- package/dist/assets/PageView-BRN1h8QD.js.br +0 -0
- package/dist/assets/PageView-BRN1h8QD.js.gz +0 -0
- package/dist/assets/ProfilePage-DjAiGvFb.js.br +0 -0
- package/dist/assets/ProfilePage-DjAiGvFb.js.gz +0 -0
- package/dist/assets/RecordDetailView-Bfu7541n.js.br +0 -0
- package/dist/assets/RecordDetailView-Bfu7541n.js.gz +0 -0
- package/dist/assets/ReportView-CwWsv2yl.js.br +0 -0
- package/dist/assets/ReportView-CwWsv2yl.js.gz +0 -0
- package/dist/assets/RoleManagementPage-DnWuzxKJ.js.br +0 -0
- package/dist/assets/RoleManagementPage-DnWuzxKJ.js.gz +0 -0
- package/dist/assets/SearchResultsPage-DBpjAlh2.js.br +0 -0
- package/dist/assets/SearchResultsPage-DBpjAlh2.js.gz +0 -0
- package/dist/assets/UserManagementPage-o0_K0dzR.js.br +0 -0
- package/dist/assets/UserManagementPage-o0_K0dzR.js.gz +0 -0
- package/dist/assets/data-adapter-Cn800k4a.js.br +0 -0
- package/dist/assets/data-adapter-Cn800k4a.js.gz +0 -0
- package/dist/assets/index-BjEGJcpx.js.br +0 -0
- package/dist/assets/index-BjEGJcpx.js.gz +0 -0
- package/dist/assets/infrastructure-aS2LF8OZ.js.br +0 -0
- package/dist/assets/infrastructure-aS2LF8OZ.js.gz +0 -0
- package/dist/assets/plugins-core-CcBSZCjG.js.br +0 -0
- package/dist/assets/plugins-core-CcBSZCjG.js.gz +0 -0
- package/dist/assets/plugins-views-DQwkCaaO.js.br +0 -0
- package/dist/assets/plugins-views-DQwkCaaO.js.gz +0 -0
- package/dist/assets/ui-components-DVonQS7H.js.br +0 -0
- package/dist/assets/ui-components-DVonQS7H.js.gz +0 -0
- package/dist/assets/ui-layout-BENIRxAF.js.br +0 -0
- package/dist/assets/ui-layout-BENIRxAF.js.gz +0 -0
- package/dist/assets/vendor-objectstack-DqojdwYW.js +0 -37
- package/dist/assets/vendor-objectstack-DqojdwYW.js.br +0 -0
- package/dist/assets/vendor-objectstack-DqojdwYW.js.gz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-Dy_xkBQQ.js";import{Y as l,Z as m,a1 as d}from"./ui-components-
|
|
1
|
+
import{j as e}from"./vendor-react-Dy_xkBQQ.js";import{Y as l,Z as m,a1 as d}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{s as n}from"./systemObjects-DSpePIIy.js";import{bx as a}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-radix-BbeYj_o4.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-charts-CSvoW-yB.js";const t=n.find(s=>s.name==="sys_audit_log");function N(){return e.jsxs("div",{className:"flex flex-col gap-4 sm:gap-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"bg-primary/10 p-2 rounded-md shrink-0",children:e.jsx(a,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Audit Log"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"View system activity and user actions"})]})]}),e.jsx(l,{children:e.jsx(m,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b bg-muted/50",children:t.views[0].columns.map(s=>{const r=t.fields.find(i=>i.name===s);return e.jsx("th",{className:"h-10 px-3 sm:px-4 text-left font-medium text-muted-foreground whitespace-nowrap",children:r?.label??s},s)})})}),e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{className:"p-4 sm:p-6 text-center text-sm text-muted-foreground",colSpan:t.views[0].columns.length,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[e.jsx(a,{className:"h-8 w-8 text-muted-foreground/50"}),e.jsx("p",{children:"Connect to ObjectStack server to load audit logs."}),e.jsx(d,{variant:"secondary",className:"text-xs",children:"Read-only"})]})})})})]})})})})]})}export{N as AuditLogPage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,h as x,r as i}from"./vendor-react-Dy_xkBQQ.js";import{a as h}from"./plugins-views-
|
|
1
|
+
import{j as s,h as x,r as i}from"./vendor-react-Dy_xkBQQ.js";import{a as h}from"./plugins-views-JvEQp7xT.js";import{a9 as e,aH as p,aI as f,aJ as u}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{u as j,b as g,r as d,M as N,a as b}from"./index-5NGcxsNI.js";import{aD as w}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-charts-CSvoW-yB.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-radix-BbeYj_o4.js";import"./plugins-core-HuzSJDPK.js";import"./data-adapter-CIsDmDZ2.js";import"./vendor-objectstack-BbgElG6O.js";import"./vendor-zod-Dpl-cylz.js";import"./infrastructure-Di0WqY4l.js";import"./ui-layout-CF_1bNSv.js";function v({cards:t=6}){return s.jsxs("div",{className:"w-full space-y-6 p-4 sm:p-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(e,{className:"h-7 w-56"}),s.jsx(e,{className:"h-4 w-80"})]}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Array.from({length:4}).map((l,r)=>s.jsxs("div",{className:"rounded-lg border p-4 space-y-2",children:[s.jsx(e,{className:"h-4 w-20"}),s.jsx(e,{className:"h-8 w-24"}),s.jsx(e,{className:"h-3 w-16"})]},`stat-${r}`))}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:t}).map((l,r)=>s.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(e,{className:"h-5 w-32"}),s.jsx(e,{className:"h-5 w-5 rounded-full"})]}),s.jsx(e,{className:"h-40 w-full"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(e,{className:"h-3 w-16"}),s.jsx(e,{className:"h-3 w-12"})]})]},`widget-${r}`))})]})}function F({dataSource:t}){const{dashboardName:l}=x(),{showDebug:r,toggleDebug:m}=j(),[c,o]=i.useState(!0);i.useEffect(()=>{o(!0),queueMicrotask(()=>o(!1))},[l]);const a=g.dashboards?.find(n=>n.name===l);return c?s.jsx(v,{}):a?s.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-3 sm:gap-4 p-4 sm:p-6 border-b shrink-0",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h1",{className:"text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate",children:d(a.label)||a.name}),a.description&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:d(a.description)})]}),s.jsx("div",{className:"shrink-0",children:s.jsx(N,{open:r,onToggle:m})})]}),s.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col sm:flex-row relative",children:[s.jsx("div",{className:"flex-1 overflow-auto p-4 sm:p-6",children:s.jsx(h,{schema:a,dataSource:t})}),s.jsx(b,{open:r,sections:[{title:"Dashboard Configuration",data:a}]})]})]}):s.jsx("div",{className:"h-full flex items-center justify-center p-8",children:s.jsxs(p,{children:[s.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:s.jsx(w,{className:"h-6 w-6 text-muted-foreground"})}),s.jsx(f,{children:"Dashboard Not Found"}),s.jsxs(u,{children:['The dashboard "',l,'" could not be found. It may have been removed or renamed.']})]})})}export{F as DashboardView};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./vendor-react-Dy_xkBQQ.js";import{F as o}from"./infrastructure-
|
|
1
|
+
import{j as r}from"./vendor-react-Dy_xkBQQ.js";import{F as o}from"./infrastructure-Di0WqY4l.js";import"./vendor-i18n-D5KbMT7w.js";function i(){return r.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4 py-8",children:r.jsx(o,{loginUrl:"/login"})})}export{i as ForgotPasswordPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as F}from"./plugins-core-
|
|
1
|
+
import{r as c,j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as F}from"./plugins-core-HuzSJDPK.js";import{u as H,a as K,D as P,c as Y,b as M,d as U,P as Z,e as z,S as q,v as G,C as J}from"./vendor-dndkit-DRGpK6sP.js";import{B as Q,a1 as I,Y as W,$ as X,a0 as _,ab as ee,Z as se}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{a as te,C as re,T as ae}from"./vendor-icons-CQ8b-fGy.js";import"./plugins-views-JvEQp7xT.js";import"./vendor-charts-CSvoW-yB.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-radix-BbeYj_o4.js";const k=(...s)=>s.filter(Boolean).join(" ");function E({card:s}){const{attributes:x,listeners:o,setNodeRef:m,transform:r,transition:g,isDragging:v}=z({id:s.id}),f={transform:J.Transform.toString(r),transition:g,opacity:v?.5:void 0};return e.jsx("div",{ref:m,style:f,...x,...o,children:e.jsxs(W,{className:"mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group",children:[e.jsxs(X,{className:"p-4",children:[e.jsx(_,{className:"text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:s.title}),s.description&&e.jsx(ee,{className:"text-xs text-muted-foreground font-mono",children:s.description})]}),s.badges&&s.badges.length>0&&e.jsx(se,{className:"p-4 pt-0",children:e.jsx("div",{className:"flex flex-wrap gap-1",children:s.badges.map((l,a)=>e.jsx(I,{variant:l.variant||"default",className:"text-xs",children:l.label},a))})})]})})}function ie({cards:s,parentRef:x}){const o=F({count:s.length,getScrollElement:()=>x.current,estimateSize:()=>120,overscan:5});return e.jsx("div",{style:{height:`${o.getTotalSize()}px`,width:"100%",position:"relative"},children:o.getVirtualItems().map(m=>{const r=s[m.index];return e.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${m.start}px)`},children:e.jsx(E,{card:r})},r.id)})})}function ne({column:s,cards:x,onToggle:o,enableVirtual:m}){const r=x||[],g=c.useRef(null),{setNodeRef:v}=z({id:s.id,data:{type:"column"}}),f=s.limit&&r.length>=s.limit,l=s.limit&&r.length>=s.limit*.8;return e.jsxs("div",{ref:v,className:k("flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all",s.collapsed?"w-16":"w-80",s.className),children:[e.jsxs("div",{className:"p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx(Q,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(!s.collapsed),children:s.collapsed?e.jsx(te,{className:"h-4 w-4"}):e.jsx(re,{className:"h-4 w-4"})}),!s.collapsed&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate",children:s.title}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:k("font-mono text-xs",f?"text-destructive":l?"text-yellow-500":"text-muted-foreground"),children:[r.length,s.limit&&` / ${s.limit}`]}),f&&e.jsx(I,{variant:"destructive",className:"text-xs",children:"Full"}),l&&!f&&e.jsx(ae,{className:"h-3 w-3 text-yellow-500"})]})]})]}),s.collapsed&&e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("span",{className:"font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180",children:s.title}),e.jsx(I,{variant:"secondary",className:"text-xs",children:r.length})]})]}),!s.collapsed&&e.jsx("div",{ref:g,className:"flex-1 p-4 overflow-y-auto",style:{maxHeight:"600px"},children:e.jsx(q,{items:r.map(a=>a.id),strategy:G,children:m?e.jsx(ie,{cards:r,parentRef:g}):e.jsx("div",{className:"space-y-2",children:r.map(a=>e.jsx(E,{card:a},a.id))})})})]})}function ve({columns:s,onCardMove:x,onColumnToggle:o,enableVirtualScrolling:m=!1,virtualScrollThreshold:r=50,className:g}){const[v,f]=c.useState(null),l=c.useMemo(()=>(s||[]).map(t=>({...t,cards:t.cards||[]})),[s]),[a,S]=c.useState(l);c.useEffect(()=>{S(l)},[l]);const T=H(K(Z,{activationConstraint:{distance:8}})),V=t=>{const{active:i}=t,n=$(i.id);f(n)},L=t=>{const{active:i,over:n}=t;if(f(null),!n)return;const d=i.id,b=n.id;if(d===b)return;const u=B(d),j=B(b)||O(b);if(!(!u||!j))if(u.id===j.id){const h=[...u.cards],C=h.findIndex(p=>p.id===d),D=h.findIndex(p=>p.id===b),R=U(h,C,D);S(p=>p.map(N=>N.id===u.id?{...N,cards:R}:N))}else{const h=[...u.cards],C=[...j.cards],D=h.findIndex(w=>w.id===d),p=b===j.id?C.length:C.findIndex(w=>w.id===b),[N]=h.splice(D,1);C.splice(p,0,N),S(w=>w.map(y=>y.id===u.id?{...y,cards:h}:y.id===j.id?{...y,cards:C}:y)),x&&x(d,u.id,j.id,p)}},$=c.useCallback(t=>{for(const i of a){const n=i.cards.find(d=>d.id===t);if(n)return n}return null},[a]),B=c.useCallback(t=>a.find(i=>i.cards.some(n=>n.id===t))||null,[a]),O=c.useCallback(t=>a.find(i=>i.id===t)||null,[a]),A=c.useCallback((t,i)=>{S(n=>n.map(d=>d.id===t?{...d,collapsed:i}:d)),o?.(t,i)},[o]);return e.jsxs(P,{sensors:T,collisionDetection:Y,onDragStart:V,onDragEnd:L,children:[e.jsx("div",{className:k("flex gap-4 overflow-x-auto p-4",g),children:a.map(t=>{const i=m&&t.cards.length>r;return e.jsx(ne,{column:t,cards:t.cards,onToggle:n=>A(t.id,n),enableVirtual:i},t.id)})}),e.jsx(M,{children:v?e.jsx(E,{card:v}):null})]})}export{ve as KanbanEnhanced,ve as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as h}from"./vendor-react-Dy_xkBQQ.js";import{u as H,a as B,D as L,c as Y,b as Z,d as q,T as z,P as G,e as E,S as J,v as M,C as Q}from"./vendor-dndkit-DRGpK6sP.js";import{a1 as K,aP as U,Y as V,$ as W,a0 as X,ab as _,Z as ee}from"./ui-components-
|
|
1
|
+
import{j as e,r as h}from"./vendor-react-Dy_xkBQQ.js";import{u as H,a as B,D as L,c as Y,b as Z,d as q,T as z,P as G,e as E,S as J,v as M,C as Q}from"./vendor-dndkit-DRGpK6sP.js";import{a1 as K,aP as U,Y as V,$ as W,a0 as X,ab as _,Z as ee}from"./ui-components-CseD2Dpn.js";import{i as se,j as re}from"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import"./vendor-icons-CQ8b-fGy.js";import"./vendor-radix-BbeYj_o4.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-charts-CSvoW-yB.js";const P=(...s)=>s.filter(Boolean).join(" ");function T({card:s,onCardClick:i}){const{attributes:x,listeners:n,setNodeRef:a,transform:o,transition:c,isDragging:C}=E({id:s.id}),d={transform:Q.Transform.toString(o),transition:c,opacity:C?.5:void 0};return e.jsx("div",{ref:a,style:d,...x,...n,role:"listitem","aria-label":s.title,onClick:()=>i?.(s),children:e.jsxs(V,{className:"mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group touch-manipulation",children:[e.jsxs(W,{className:"p-2 sm:p-4",children:[e.jsx(X,{className:"text-xs sm:text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:s.title}),s.description&&e.jsx(_,{className:"text-xs text-muted-foreground font-mono line-clamp-2 sm:line-clamp-none",children:s.description})]}),s.badges&&s.badges.length>0&&e.jsx(ee,{className:"p-2 sm:p-4 pt-0",children:e.jsx("div",{className:"flex flex-wrap gap-1",children:s.badges.map((b,S)=>e.jsx(K,{variant:b.variant||"default",className:"text-xs",children:b.label},S))})})]})})}function ae({column:s,cards:i,onCardClick:x}){const n=i||[],{setNodeRef:a}=E({id:s.id,data:{type:"column"}}),o=s.limit&&n.length>=s.limit;return e.jsxs("div",{ref:a,role:"group","aria-label":s.title,className:P("flex flex-col w-[85vw] sm:w-80 flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl snap-start",s.className),children:[e.jsx("div",{className:"p-3 sm:p-4 border-b border-border/50 bg-muted/20",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{id:`kanban-col-${s.id}`,className:"font-mono text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase truncate",children:s.title}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"font-mono text-xs text-muted-foreground","aria-label":`${n.length} cards${s.limit?` of ${s.limit} maximum`:""}`,children:[n.length,s.limit&&` / ${s.limit}`]}),o&&e.jsx(K,{variant:"destructive",className:"text-xs",children:"Full"})]})]})}),e.jsx(U,{className:"flex-1 p-4",children:e.jsx(J,{items:n.map(c=>c.id),strategy:M,children:e.jsx("div",{className:"space-y-2",role:"list","aria-label":`${s.title} cards`,children:n.map(c=>e.jsx(T,{card:c,onCardClick:x},c.id))})})})]})}function te({children:s}){const i=re();return e.jsx(e.Fragment,{children:s(i)})}function ue({columns:s,onCardMove:i,onCardClick:x,className:n}){return se()?e.jsx(te,{children:o=>e.jsx($,{columns:s,onCardMove:i,onCardClick:x,className:n,dnd:o})}):e.jsx($,{columns:s,onCardMove:i,onCardClick:x,className:n,dnd:null})}function $({columns:s,onCardMove:i,onCardClick:x,className:n,dnd:a}){const[o,c]=h.useState(null),C=h.useMemo(()=>(s||[]).map(r=>({...r,cards:r.cards||[]})),[s]),[d,b]=h.useState(C);h.useEffect(()=>{b(C)},[C]);const S=H(B(G,{activationConstraint:{distance:5}}),B(z,{activationConstraint:{delay:200,tolerance:5}})),O=r=>{const{active:m}=r,t=A(m.id);if(c(t),a&&t){const l=w(t.id);l&&a.startDrag({id:t.id,type:"kanban-card",data:t,sourceId:l.id})}},R=r=>{const{active:m,over:t}=r;if(c(null),!t){a&&a.endDrag();return}const l=m.id,v=t.id;if(l===v){a&&a.endDrag();return}const u=w(l),p=w(v)||F(v);if(!u||!p){a&&a.endDrag();return}if(u.id===p.id){const g=[...u.cards],j=g.findIndex(f=>f.id===l),I=g.findIndex(f=>f.id===v),k=q(g,j,I);b(f=>f.map(D=>D.id===u.id?{...D,cards:k}:D))}else{const g=[...u.cards],j=[...p.cards],I=g.findIndex(N=>N.id===l),f=v===p.id?j.length:j.findIndex(N=>N.id===v),[D]=g.splice(I,1);j.splice(f,0,D),b(N=>N.map(y=>y.id===u.id?{...y,cards:g}:y.id===p.id?{...y,cards:j}:y)),i&&i(l,u.id,p.id,f)}a&&a.endDrag(p.id)},A=h.useCallback(r=>{for(const m of d){const t=m.cards.find(l=>l.id===r);if(t)return t}return null},[d]),w=h.useCallback(r=>d.find(m=>m.cards.some(t=>t.id===r))||null,[d]),F=h.useCallback(r=>d.find(m=>m.id===r)||null,[d]);return e.jsxs(L,{sensors:S,collisionDetection:Y,onDragStart:O,onDragEnd:R,children:[e.jsxs("div",{className:"flex sm:hidden items-center justify-between px-3 pb-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[d.length," columns"]}),e.jsx("span",{children:"← Swipe to navigate →"})]}),e.jsx("div",{className:P("flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory p-2 sm:p-4 [-webkit-overflow-scrolling:touch]",n),role:"region","aria-label":"Kanban board",children:d.map(r=>e.jsx(ae,{column:r,cards:r.cards,onCardClick:x},r.id))}),e.jsx(Z,{children:e.jsx("div",{"aria-live":"assertive","aria-label":o?`Dragging ${o.title}`:void 0,children:o?e.jsx(T,{card:o}):null})})]})}export{ue as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as s,j as r}from"./vendor-react-Dy_xkBQQ.js";import{L as o}from"./infrastructure-
|
|
1
|
+
import{i as s,j as r}from"./vendor-react-Dy_xkBQQ.js";import{L as o}from"./infrastructure-Di0WqY4l.js";import"./vendor-i18n-D5KbMT7w.js";function a(){const e=s();return r.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4 py-8",children:r.jsx(o,{onSuccess:()=>e("/"),registerUrl:"/register",forgotPasswordUrl:"/forgot-password"})})}export{a as LoginPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as l}from"./infrastructure-
|
|
1
|
+
import{j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as l}from"./infrastructure-Di0WqY4l.js";import{B as d,Y as c,Z as o,a1 as x}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{s as p}from"./systemObjects-DSpePIIy.js";import{bv as r,m as h}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-radix-BbeYj_o4.js";import"./vendor-charts-CSvoW-yB.js";const a=p.find(s=>s.name==="sys_org");function z(){const{user:s}=l(),n=s?.role==="admin";return e.jsxs("div",{className:"flex flex-col gap-4 sm:gap-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"bg-primary/10 p-2 rounded-md shrink-0",children:e.jsx(r,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Organization Management"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Manage organizations and their members"})]})]}),n&&e.jsxs(d,{size:"sm",className:"shrink-0 gap-2",children:[e.jsx(h,{className:"h-4 w-4"}),"Add Organization"]})]}),e.jsx(c,{children:e.jsx(o,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b bg-muted/50",children:a.views[0].columns.map(t=>{const i=a.fields.find(m=>m.name===t);return e.jsx("th",{className:"h-10 px-3 sm:px-4 text-left font-medium text-muted-foreground whitespace-nowrap",children:i?.label??t},t)})})}),e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{className:"p-4 sm:p-6 text-center text-sm text-muted-foreground",colSpan:a.views[0].columns.length,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[e.jsx(r,{className:"h-8 w-8 text-muted-foreground/50"}),e.jsx("p",{children:"Connect to ObjectStack server to load organizations."}),e.jsx(x,{variant:"secondary",className:"text-xs",children:"plugin-grid powered"})]})})})})]})})})})]})}export{z as OrgManagementPage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as n,k as p,j as e}from"./vendor-react-Dy_xkBQQ.js";import{S as l}from"./framework-mHWN965c.js";import{aH as c,aI as d,aJ as u}from"./ui-components-
|
|
1
|
+
import{h as n,k as p,j as e}from"./vendor-react-Dy_xkBQQ.js";import{S as l}from"./framework-mHWN965c.js";import{aH as c,aI as d,aJ as u}from"./ui-components-CseD2Dpn.js";import"./vendor-ui-utils-h6yAcIi9.js";import{u as f,b as h,M as x,a as g}from"./index-5NGcxsNI.js";import{a1 as j}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-radix-BbeYj_o4.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-charts-CSvoW-yB.js";import"./plugins-core-HuzSJDPK.js";import"./plugins-views-JvEQp7xT.js";import"./data-adapter-CIsDmDZ2.js";import"./vendor-objectstack-BbgElG6O.js";import"./vendor-zod-Dpl-cylz.js";import"./infrastructure-Di0WqY4l.js";import"./ui-layout-CF_1bNSv.js";function z(){const{pageName:o}=n(),[s]=p(),{showDebug:a,toggleDebug:r}=f(),t=h.pages?.find(m=>m.name===o);if(!t)return e.jsx("div",{className:"h-full flex items-center justify-center p-8",children:e.jsxs(c,{children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:e.jsx(j,{className:"h-6 w-6 text-muted-foreground"})}),e.jsx(d,{children:"Page Not Found"}),e.jsxs(u,{children:['The page "',o,'" could not be found. It may have been removed or renamed.']})]})});const i=Object.fromEntries(s.entries());return e.jsxs("div",{className:"flex flex-row h-full w-full overflow-hidden relative",children:[e.jsxs("div",{className:"flex-1 overflow-auto h-full relative group",children:[e.jsx("div",{className:`absolute top-1.5 sm:top-2 right-1.5 sm:right-2 z-50 transition-opacity ${a?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:e.jsx(x,{open:a,onToggle:r})}),e.jsx(l,{schema:{...t,type:t.type||"page",context:{...t.context,params:i}}})]}),e.jsx(g,{open:a,sections:[{title:"Page Configuration",data:t}]})]})}export{z as PageView};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as w,g as C}from"./infrastructure-
|
|
1
|
+
import{r as l,j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as w,g as C}from"./infrastructure-Di0WqY4l.js";import{Y as i,Z as u,ap as S,aq as A,ar as E,a1 as P,$ as h,a0 as p,ab as j,aN as g,aO as f,L as n,M as c,B as U}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{by as k,h as I,g as L,bz as B}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-radix-BbeYj_o4.js";import"./vendor-charts-CSvoW-yB.js";function Y(){const{user:s,updateUser:N,isLoading:a}=w(),[d,v]=l.useState(s?.name??""),[b,m]=l.useState(!1),[o,x]=l.useState(null),y=async t=>{t.preventDefault(),x(null),m(!1);try{await N({name:d}),m(!0)}catch(r){x(r instanceof Error?r.message:String(r))}};return s?e.jsxs("div",{className:"flex flex-col gap-4 sm:gap-6 p-4 sm:p-6 max-w-2xl",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Profile"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage your account settings"})]}),e.jsx(i,{children:e.jsx(u,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(S,{className:"h-16 w-16",children:[e.jsx(A,{src:s.image??void 0,alt:s.name??"User"}),e.jsx(E,{className:"text-lg bg-primary text-primary-foreground",children:C(s)})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-lg font-semibold truncate",children:s.name??"User"}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.email}),e.jsx(P,{variant:"secondary",className:"mt-1",children:s.role??"member"})]})]})})}),e.jsxs(i,{children:[e.jsxs(h,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(p,{className:"text-base sm:text-lg",children:"Personal Information"})]}),e.jsx(j,{children:"Update your name and view account details"})]}),e.jsx(u,{children:e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[o&&e.jsxs(g,{variant:"destructive",children:[e.jsx(I,{className:"h-4 w-4"}),e.jsx(f,{children:o})]}),b&&e.jsxs(g,{children:[e.jsx(L,{className:"h-4 w-4 text-green-600"}),e.jsx(f,{className:"text-green-800 dark:text-green-400",children:"Profile updated successfully."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"profile-name",children:"Name"}),e.jsx(c,{id:"profile-name",type:"text",value:d,onChange:t=>v(t.target.value),required:!0,disabled:a})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"profile-email",children:"Email"}),e.jsx(c,{id:"profile-email",type:"email",value:s.email,disabled:!0,className:"bg-muted text-muted-foreground"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Email cannot be changed."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{children:"Role"}),e.jsx(c,{type:"text",value:s.role??"member",disabled:!0,className:"bg-muted text-muted-foreground"})]}),e.jsx(U,{type:"submit",disabled:a,className:"w-full sm:w-auto",children:a?"Saving...":"Save Changes"})]})})]}),e.jsx(i,{children:e.jsxs(h,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(p,{className:"text-base sm:text-lg",children:"Change Password"})]}),e.jsx(j,{children:"To change your password, use the password reset flow from the login page."})]})})]}):null}export{Y as ProfilePage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,h as f,r as x}from"./vendor-react-Dy_xkBQQ.js";import{D as j}from"./plugins-views-
|
|
1
|
+
import{j as e,h as f,r as x}from"./vendor-react-Dy_xkBQQ.js";import{D as j}from"./plugins-views-JvEQp7xT.js";import{a9 as s,aH as u,aI as N,aJ as g}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{u as w,M as v,a as b}from"./index-5NGcxsNI.js";import{as as y}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-charts-CSvoW-yB.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-radix-BbeYj_o4.js";import"./plugins-core-HuzSJDPK.js";import"./data-adapter-CIsDmDZ2.js";import"./vendor-objectstack-BbgElG6O.js";import"./vendor-zod-Dpl-cylz.js";import"./infrastructure-Di0WqY4l.js";import"./ui-layout-CF_1bNSv.js";function D({fields:r=8,columns:c=2}){return e.jsxs("div",{className:"w-full space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(s,{className:"h-8 w-8 rounded"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(s,{className:"h-6 w-48"}),e.jsx(s,{className:"h-4 w-32"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(s,{className:"h-9 w-20"}),e.jsx(s,{className:"h-9 w-20"})]})]}),e.jsx(s,{className:"h-5 w-24"}),e.jsx("div",{className:`grid grid-cols-1 ${c===2?"md:grid-cols-2":""} gap-4`,children:Array.from({length:r}).map((o,a)=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(s,{className:"h-4 w-24"}),e.jsx(s,{className:"h-9 w-full"})]},`field-${a}`))}),e.jsxs("div",{className:"space-y-3 pt-4 border-t",children:[e.jsx(s,{className:"h-5 w-32"}),e.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((o,a)=>e.jsxs("div",{className:"flex items-center gap-3 py-2",children:[e.jsx(s,{className:"h-8 w-8 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx(s,{className:"h-4 w-40"}),e.jsx(s,{className:"h-3 w-24"})]})]},`related-${a}`))})]})]})}function z({dataSource:r,objects:c,onEdit:o}){const{objectName:a,recordId:i}=f(),{showDebug:m,toggleDebug:p}=w(),[h,d]=x.useState(!0),t=c.find(l=>l.name===a);if(x.useEffect(()=>{d(!0),queueMicrotask(()=>d(!1))},[a,i]),h)return e.jsx(D,{});if(!t)return e.jsx("div",{className:"flex h-full items-center justify-center p-4",children:e.jsxs(u,{children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:e.jsx(y,{className:"h-6 w-6 text-muted-foreground"})}),e.jsx(N,{children:"Object Not Found"}),e.jsxs(g,{children:['Object "',a,'" definition missing. Check your configuration or navigate back to select a valid object.']})]})});const n={type:"detail-view",objectName:t.name,resourceId:i,showBack:!0,onBack:"history",showEdit:!0,title:t.label,sections:[{title:"Details",fields:Object.keys(t.fields||{}).map(l=>({name:l,label:t.fields[l].label||l,type:t.fields[l].type||"text"})),columns:2}]};return e.jsxs("div",{className:"h-full bg-background overflow-hidden flex flex-col relative",children:[e.jsx("div",{className:"absolute top-2 sm:top-4 right-2 sm:right-4 z-50",children:e.jsx(v,{open:m,onToggle:p})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-row",children:[e.jsx("div",{className:"flex-1 overflow-auto p-3 sm:p-4 lg:p-6 scroll-pb-48",children:e.jsx(j,{schema:n,dataSource:r,onEdit:()=>o({_id:i,id:i})})}),e.jsx(b,{open:m,sections:[{title:"View Schema",data:n}]})]})]})}export{z as RecordDetailView};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as s,j as e}from"./vendor-react-Dy_xkBQQ.js";import{R as i}from"./infrastructure-
|
|
1
|
+
import{i as s,j as e}from"./vendor-react-Dy_xkBQQ.js";import{R as i}from"./infrastructure-Di0WqY4l.js";import"./vendor-i18n-D5KbMT7w.js";function a(){const r=s();return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4 py-8",children:e.jsx(i,{onSuccess:()=>r("/"),loginUrl:"/login"})})}export{a as RegisterPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as x,r as l,j as e}from"./vendor-react-Dy_xkBQQ.js";import{R as h,b as f}from"./plugins-views-
|
|
1
|
+
import{h as x,r as l,j as e}from"./vendor-react-Dy_xkBQQ.js";import{R as h,b as f}from"./plugins-views-JvEQp7xT.js";import{aH as g,aI as b,aJ as j,B as i}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{u as v,b as w,M as N,a as y}from"./index-5NGcxsNI.js";import{aE as R,b as E,aP as S}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-charts-CSvoW-yB.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-radix-BbeYj_o4.js";import"./plugins-core-HuzSJDPK.js";import"./data-adapter-CIsDmDZ2.js";import"./vendor-objectstack-BbgElG6O.js";import"./vendor-zod-Dpl-cylz.js";import"./infrastructure-Di0WqY4l.js";import"./ui-layout-CF_1bNSv.js";const k=[{name:"month",label:"Month",type:"string"},{name:"revenue",label:"Revenue",type:"number"},{name:"count",label:"Count",type:"number"},{name:"region",label:"Region",type:"string"},{name:"product",label:"Product",type:"string"},{name:"source",label:"Lead Source",type:"string"},{name:"stage",label:"Stage",type:"string"},{name:"amount",label:"Amount",type:"currency"}];function q({dataSource:C}){const{reportName:r}=x(),{showDebug:o,toggleDebug:m}=v(),[d,t]=l.useState(!1),n=w.reports?.find(a=>a.name===r),[s,c]=l.useState(n);if(!n)return e.jsx("div",{className:"h-full flex items-center justify-center p-8",children:e.jsxs(g,{children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:e.jsx(R,{className:"h-6 w-6 text-muted-foreground"})}),e.jsx(b,{children:"Report Not Found"}),e.jsxs(j,{children:['The report "',r,'" could not be found. It may have been removed or renamed.']})]})});const p=a=>{console.log("Saving report:",a),c(a),t(!1)};if(d)return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[e.jsxs("div",{className:"flex items-center p-3 sm:p-4 border-b bg-muted/10 gap-2",children:[e.jsxs(i,{variant:"ghost",size:"sm",onClick:()=>t(!1),className:"shrink-0",children:[e.jsx(E,{className:"h-4 w-4 mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"Back to View"}),e.jsx("span",{className:"sm:hidden",children:"Back"})]}),e.jsxs("div",{className:"font-medium truncate",children:["Edit Report: ",s.title]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx(h,{schema:{title:"Report Builder",report:s,availableFields:k,onSave:p,onCancel:()=>t(!1)}})})]});const u={type:"report-viewer",report:s,showToolbar:!0,allowExport:!0};return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-3 sm:gap-4 p-4 sm:p-6 border-b shrink-0 bg-muted/10",children:[e.jsx("div",{className:"min-w-0",children:e.jsx("h1",{className:"text-base sm:text-lg font-medium text-muted-foreground truncate",children:s.title||"Report Viewer"})}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>t(!0),className:"h-8",children:[e.jsx(S,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit Report"})]}),e.jsx(N,{open:o,onToggle:m})]})]}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-row relative",children:[e.jsx("div",{className:"flex-1 overflow-auto p-4 sm:p-6 lg:p-8 bg-muted/5",children:e.jsx("div",{className:"max-w-5xl mx-auto shadow-sm border rounded-lg sm:rounded-xl bg-background overflow-hidden min-h-150",children:e.jsx(f,{schema:u})})}),e.jsx(y,{open:o,sections:[{title:"Report Configuration",data:s}]})]})]})}export{q as ReportView};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as i}from"./infrastructure-
|
|
1
|
+
import{j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as i}from"./infrastructure-Di0WqY4l.js";import{B as d,Y as c,Z as o,a1 as x}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{s as p}from"./systemObjects-DSpePIIy.js";import{bw as a,m as h}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-radix-BbeYj_o4.js";import"./vendor-charts-CSvoW-yB.js";const r=p.find(s=>s.name==="sys_role");function C(){const{user:s}=i(),l=s?.role==="admin";return e.jsxs("div",{className:"flex flex-col gap-4 sm:gap-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"bg-primary/10 p-2 rounded-md shrink-0",children:e.jsx(a,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Role Management"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Define roles and assign permissions"})]})]}),l&&e.jsxs(d,{size:"sm",className:"shrink-0 gap-2",children:[e.jsx(h,{className:"h-4 w-4"}),"Add Role"]})]}),e.jsx(c,{children:e.jsx(o,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b bg-muted/50",children:r.views[0].columns.map(t=>{const m=r.fields.find(n=>n.name===t);return e.jsx("th",{className:"h-10 px-3 sm:px-4 text-left font-medium text-muted-foreground whitespace-nowrap",children:m?.label??t},t)})})}),e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{className:"p-4 sm:p-6 text-center text-sm text-muted-foreground",colSpan:r.views[0].columns.length,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[e.jsx(a,{className:"h-8 w-8 text-muted-foreground/50"}),e.jsx("p",{children:"Connect to ObjectStack server to load roles."}),e.jsx(x,{variant:"secondary",className:"text-xs",children:"plugin-grid powered"})]})})})})]})})})})]})}export{C as RoleManagementPage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as k,k as S,r as m,j as s,L as g}from"./vendor-react-Dy_xkBQQ.js";import{M as L,a1 as f,Y as I,Z as P}from"./ui-components-
|
|
1
|
+
import{h as k,k as S,r as m,j as s,L as g}from"./vendor-react-Dy_xkBQQ.js";import{M as L,a1 as f,Y as I,Z as P}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{b as E}from"./index-5NGcxsNI.js";import{A as T,S as b,aE as q,a1 as A,aD as M,as as x}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-radix-BbeYj_o4.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-charts-CSvoW-yB.js";import"./plugins-core-HuzSJDPK.js";import"./plugins-views-JvEQp7xT.js";import"./data-adapter-CIsDmDZ2.js";import"./vendor-objectstack-BbgElG6O.js";import"./vendor-zod-Dpl-cylz.js";import"./infrastructure-Di0WqY4l.js";import"./ui-layout-CF_1bNSv.js";function N(p){const l=[];for(const o of p)o.type==="group"&&o.children?l.push(...N(o.children)):l.push(o);return l}const j={object:x,dashboard:M,page:A,report:q},O={object:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",dashboard:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",page:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",report:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200"};function X(){const{appName:p}=k(),[l,o]=S(),y=l.get("q")||"",[n,v]=m.useState(y),h=E.apps||[],u=h.find(t=>t.name===p)||h[0],c=`/apps/${p}`,i=m.useMemo(()=>u?N(u.navigation||[]).map(e=>{let a="#";return e.type==="object"?a=`${c}/${e.objectName}`:e.type==="dashboard"?a=`${c}/dashboard/${e.dashboardName}`:e.type==="page"?a=`${c}/page/${e.pageName}`:e.type==="report"&&(a=`${c}/report/${e.reportName}`),{id:e.id,label:e.label||e.objectName||e.dashboardName||e.pageName||e.reportName||"",href:a,type:e.type,description:e.description}}).filter(e=>e.href!=="#"):[],[u,c]),d=m.useMemo(()=>{if(!n.trim())return i;const t=n.toLowerCase();return i.filter(e=>e.label.toLowerCase().includes(t)||e.type.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t))},[i,n]),w=t=>{v(t),o(t?{q:t}:{})},C=m.useMemo(()=>{const t={};for(const e of d)(t[e.type]||=[]).push(e);return t},[d]);return s.jsxs("div",{className:"flex flex-col gap-6 p-4 sm:p-6 max-w-4xl mx-auto",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(g,{to:c,className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(T,{className:"h-4 w-4"}),"Back"]}),s.jsx("h1",{className:"text-xl font-semibold",children:"Search"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(b,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(L,{value:n,onChange:t=>w(t.target.value),placeholder:"Search objects, dashboards, pages, reports...",className:"pl-10 h-11 text-base",autoFocus:!0})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:n.trim()?`${d.length} result${d.length!==1?"s":""} for "${n}"`:`${i.length} items available`}),d.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(b,{className:"h-12 w-12 text-muted-foreground/30 mb-4"}),s.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"No results found"}),s.jsx("p",{className:"text-sm text-muted-foreground/80 mt-1",children:"Try adjusting your search terms"})]}):s.jsx("div",{className:"space-y-6",children:Object.entries(C).map(([t,e])=>{const a=j[t]||x;return s.jsxs("div",{children:[s.jsxs("h2",{className:"text-sm font-medium text-muted-foreground mb-2 flex items-center gap-1.5",children:[s.jsx(a,{className:"h-4 w-4"}),t.charAt(0).toUpperCase()+t.slice(1),"s",s.jsx(f,{variant:"secondary",className:"ml-1 text-xs",children:e.length})]}),s.jsx("div",{className:"grid gap-2",children:e.map(r=>{const $=j[r.type]||x;return s.jsx(g,{to:r.href,children:s.jsx(I,{className:"hover:bg-accent/50 transition-colors cursor-pointer",children:s.jsxs(P,{className:"flex items-center gap-3 p-3",children:[s.jsx("div",{className:`flex h-8 w-8 items-center justify-center rounded ${O[r.type]||""}`,children:s.jsx($,{className:"h-4 w-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:r.label}),r.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r.description})]}),s.jsx(f,{variant:"outline",className:"text-xs shrink-0",children:r.type})]})})},r.id)})})]},t)})})]})}export{X as SearchResultsPage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as i}from"./infrastructure-
|
|
1
|
+
import{j as e}from"./vendor-react-Dy_xkBQQ.js";import{u as i}from"./infrastructure-Di0WqY4l.js";import{B as c,Y as d,Z as o,a1 as x}from"./ui-components-CseD2Dpn.js";import"./framework-mHWN965c.js";import"./vendor-ui-utils-h6yAcIi9.js";import{s as p}from"./systemObjects-DSpePIIy.js";import{bu as a,m as h}from"./vendor-icons-CQ8b-fGy.js";import"./vendor-i18n-D5KbMT7w.js";import"./vendor-radix-BbeYj_o4.js";import"./vendor-charts-CSvoW-yB.js";const r=p.find(s=>s.name==="sys_user");function k(){const{user:s}=i(),m=s?.role==="admin";return e.jsxs("div",{className:"flex flex-col gap-4 sm:gap-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"bg-primary/10 p-2 rounded-md shrink-0",children:e.jsx(a,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"User Management"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Manage system users and their roles"})]})]}),m&&e.jsxs(c,{size:"sm",className:"shrink-0 gap-2",children:[e.jsx(h,{className:"h-4 w-4"}),"Add User"]})]}),e.jsx(d,{children:e.jsx(o,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b bg-muted/50",children:r.views[0].columns.map(t=>{const n=r.fields.find(l=>l.name===t);return e.jsx("th",{className:"h-10 px-3 sm:px-4 text-left font-medium text-muted-foreground whitespace-nowrap",children:n?.label??t},t)})})}),e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{className:"p-4 sm:p-6 text-center text-sm text-muted-foreground",colSpan:r.views[0].columns.length,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[e.jsx(a,{className:"h-8 w-8 text-muted-foreground/50"}),e.jsx("p",{children:"Connect to ObjectStack server to load users."}),e.jsx(x,{variant:"secondary",className:"text-xs",children:"plugin-grid powered"})]})})})})]})})})})]})}export{k as UserManagementPage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O}from"./vendor-objectstack-DqojdwYW.js";import{h as C}from"./framework-mHWN965c.js";class ${cache;maxSize;ttl;stats;constructor(t={}){this.cache=new Map,this.maxSize=t.maxSize||100,this.ttl=t.ttl||300*1e3,this.stats={hits:0,misses:0,evictions:0}}async get(t,e){const s=Date.now(),n=this.cache.get(t);if(n){if(s-n.timestamp<this.ttl)return n.accessCount++,n.lastAccessed=s,this.stats.hits++,this.cache.delete(t),this.cache.set(t,n),n.data;this.cache.delete(t)}this.stats.misses++;const a=await e();return this.set(t,a),a}set(t,e){const s=Date.now();this.cache.size>=this.maxSize&&!this.cache.has(t)&&this.evictLRU(),this.cache.set(t,{data:e,timestamp:s,accessCount:1,lastAccessed:s})}evictLRU(){const t=this.cache.keys().next().value;t!==void 0&&(this.cache.delete(t),this.stats.evictions++)}invalidate(t){t?this.cache.delete(t):this.cache.clear()}clear(){this.cache.clear(),this.stats={hits:0,misses:0,evictions:0}}getStats(){const t=this.stats.hits+this.stats.misses,e=t>0?this.stats.hits/t:0;return{size:this.cache.size,maxSize:this.maxSize,hits:this.stats.hits,misses:this.stats.misses,evictions:this.stats.evictions,hitRate:e}}getCachedSync(t){const e=this.cache.get(t);if(e){if(this.ttl>0&&Date.now()-e.timestamp>this.ttl){this.cache.delete(t);return}return this.cache.delete(t),this.cache.set(t,e),this.stats.hits++,e.data}}has(t){const e=this.cache.get(t);return e?Date.now()-e.timestamp>=this.ttl?(this.cache.delete(t),!1):!0:!1}}class h extends Error{constructor(t,e,s,n){super(t),this.code=e,this.statusCode=s,this.details=n,this.name="ObjectStackError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,statusCode:this.statusCode,details:this.details,stack:this.stack}}}class y extends h{constructor(t,e){super(`Metadata not found for object: ${t}`,"METADATA_NOT_FOUND",404,{objectName:t,...e}),this.name="MetadataNotFoundError"}}class g extends h{constructor(t,e,s,n,a){super(`Bulk ${t} operation failed: ${e} succeeded, ${s} failed`,"BULK_OPERATION_ERROR",500,{operation:t,successCount:e,failureCount:s,errors:n,...a}),this.successCount=e,this.failureCount=s,this.errors=n,this.name="BulkOperationError"}getSummary(){const t=this.successCount+this.failureCount,e=t>0?this.failureCount/t:0;return{operation:this.details?.operation,total:t,successful:this.successCount,failed:this.failureCount,failureRate:e,errors:this.errors}}}class w extends h{constructor(t,e,s,n){super(`Connection error: ${t}`,"CONNECTION_ERROR",n||503,{url:e,...s}),this.url=e,this.name="ConnectionError"}}class p extends h{constructor(t="Authentication failed",e,s){super(t,"AUTHENTICATION_ERROR",s||401,e),this.name="AuthenticationError"}}class E extends h{constructor(t,e,s,n){super(t,"VALIDATION_ERROR",400,{field:e,validationErrors:s,...n}),this.field=e,this.validationErrors=s,this.name="ValidationError"}getValidationErrors(){return this.validationErrors||[]}}function R(i,t){const e=i?.status||i?.statusCode||500,s=i?.message||i?.statusText||"Unknown error",n={context:t,response:{status:e,data:i?.data,headers:i?.headers}};switch(e){case 401:return new p(s,n,401);case 403:return new p(s,n,403);case 404:if(t?.includes("metadata")||t?.includes("schema")||t?.includes("getObjectSchema")){const a=A(t);return new y(a,n)}return new h(s,"NOT_FOUND",404,n);case 400:return new E(s,void 0,i?.data?.errors,n);case 503:return new w(s,i?.config?.url,n,503);case 504:return new w(s,i?.config?.url,n,504);default:return new h(s,"UNKNOWN_ERROR",e,n)}}function A(i){if(!i)return"unknown";const t=i.match(/\(([^)]+)\)/);return t?t[1]:"unknown"}class N{client;connected=!1;metadataCache;connectionState="disconnected";connectionStateListeners=[];batchProgressListeners=[];autoReconnect;maxReconnectAttempts;reconnectDelay;reconnectAttempts=0;baseUrl;token;constructor(t){this.client=new O(t),this.metadataCache=new $(t.cache),this.autoReconnect=t.autoReconnect??!0,this.maxReconnectAttempts=t.maxReconnectAttempts??3,this.reconnectDelay=t.reconnectDelay??1e3,this.baseUrl=t.baseUrl,this.token=t.token}async connect(){if(!this.connected){this.setConnectionState("connecting");try{await this.client.connect(),this.connected=!0,this.reconnectAttempts=0,this.setConnectionState("connected")}catch(t){const e=t instanceof Error?t.message:"Failed to connect to ObjectStack server",s=new w(e,void 0,{originalError:t});if(this.setConnectionState("error",s),this.autoReconnect&&this.reconnectAttempts<this.maxReconnectAttempts)await this.attemptReconnect();else throw s}}}async attemptReconnect(){this.reconnectAttempts++,this.setConnectionState("reconnecting");const t=this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1);await new Promise(e=>setTimeout(e,t)),this.connected=!1,await this.connect()}getConnectionState(){return this.connectionState}isConnected(){return this.connected&&this.connectionState==="connected"}onConnectionStateChange(t){return this.connectionStateListeners.push(t),()=>{const e=this.connectionStateListeners.indexOf(t);e>-1&&this.connectionStateListeners.splice(e,1)}}onBatchProgress(t){return this.batchProgressListeners.push(t),()=>{const e=this.batchProgressListeners.indexOf(t);e>-1&&this.batchProgressListeners.splice(e,1)}}setConnectionState(t,e){this.connectionState=t;const s={state:t,timestamp:Date.now(),error:e};this.connectionStateListeners.forEach(n=>{try{n(s)}catch(a){console.error("Error in connection state listener:",a)}})}emitBatchProgress(t){this.batchProgressListeners.forEach(e=>{try{e(t)}catch(s){console.error("Error in batch progress listener:",s)}})}async find(t,e){await this.connect();const s=this.convertQueryParams(e),n=await this.client.data.find(t,s);if(Array.isArray(n))return{data:n,total:n.length,page:1,pageSize:n.length,hasMore:!1};const a=n,r=a.records||a.value||[],o=a.total??a.count??r.length;return{data:r,total:o,page:e?.$skip&&e.$top?Math.floor(e.$skip/e.$top)+1:1,pageSize:e?.$top,hasMore:e?.$top?r.length===e.$top:!1}}async findOne(t,e,s){await this.connect();try{return(await this.client.data.get(t,String(e))).record}catch(n){if(n?.status===404)return null;throw n}}async create(t,e){return await this.connect(),(await this.client.data.create(t,e)).record}async update(t,e,s){return await this.connect(),(await this.client.data.update(t,String(e),s)).record}async delete(t,e){return await this.connect(),(await this.client.data.delete(t,String(e))).deleted}async bulk(t,e,s){if(await this.connect(),!s||s.length===0)return[];const n=s.length;let a=0,r=0;const o=()=>{this.emitBatchProgress({operation:e,total:n,completed:a,failed:r,percentage:n>0?(a+r)/n*100:0})};try{switch(e){case"create":{o();const c=await this.client.data.createMany(t,s);return a=c.length,r=n-a,o(),c}case"delete":{const c=s.map(l=>l.id).filter(Boolean);if(c.length===0){const l=s.map((u,d)=>({index:d,error:`Missing ID for item at index ${d}`}));throw r=s.length,o(),new g("delete",0,s.length,l)}return o(),await this.client.data.deleteMany(t,c),a=c.length,r=n-a,o(),[]}case"update":{if(typeof this.client.data.updateMany=="function")try{o();const u=this.client.data.updateMany,d=await u(t,s);return a=d.length,r=n-a,o(),d}catch{}const c=[],l=[];for(let u=0;u<s.length;u++){const d=s[u],m=d.id;if(!m){l.push({index:u,error:"Missing ID"}),r++,o();continue}try{const f=await this.client.data.update(t,String(m),d);c.push(f.record),a++,o()}catch(f){const S=f instanceof Error?f.message:String(f);l.push({index:u,error:S}),r++,o()}}if(l.length>0)throw new g("update",c.length,l.length,l,{resource:t,totalRecords:s.length});return c}default:throw new h(`Unsupported bulk operation: ${e}`,"UNSUPPORTED_OPERATION",400)}}catch(c){if(o(),c instanceof g||c instanceof h)throw c;const l=c instanceof Error?c.message:String(c),u=s.map((d,m)=>({index:m,error:l}));throw new g(e,0,s.length,u,{resource:t,originalError:c})}}convertQueryParams(t){if(!t)return{};const e={};if(t.$select&&(e.select=t.$select),t.$filter&&(Array.isArray(t.$filter)?e.filters=t.$filter:e.filters=C(t.$filter)),t.$orderby)if(Array.isArray(t.$orderby))e.sort=t.$orderby.map(s=>{if(typeof s=="string")return s;const n=s.field;return(s.order||"asc")==="desc"?`-${n}`:n});else{const s=Object.entries(t.$orderby).map(([n,a])=>a==="desc"?`-${n}`:n);e.sort=s}return t.$skip!==void 0&&(e.skip=t.$skip),t.$top!==void 0&&(e.top=t.$top),e}async getObjectSchema(t){await this.connect();try{return await this.metadataCache.get(t,async()=>{const s=await this.client.meta.getItem("object",t);return s&&s.item?s.item:s})}catch(e){const s=e;throw s?.status===404||s?.statusCode===404?new y(t,{originalError:e}):e instanceof h?e:R(s,`getObjectSchema(${t})`)}}getClient(){return this.client}async getDiscovery(){try{return await this.connect(),this.client.discoveryInfo||null}catch{return null}}async getView(t,e){await this.connect();try{const s=`view:${t}:${e}`;return await this.metadataCache.get(s,async()=>{const n=await this.client.meta.getItem(t,`views/${e}`);return n&&n.item?n.item:n??null})}catch{return null}}async getApp(t){await this.connect();try{const e=`app:${t}`;return await this.metadataCache.get(e,async()=>{const s=await this.client.meta.getItem("apps",t);return s&&s.item?s.item:s??null})}catch{return null}}async getPage(t){await this.connect();try{const e=`page:${t}`;return await this.metadataCache.get(e,async()=>{const s=await this.client.meta.getItem("pages",t);return s&&s.item?s.item:s??null})}catch{return null}}async getItems(t,e){return await this.connect(),await Promise.all(e.map(async n=>{const a=`${t}:${n}`;return this.metadataCache.get(a,async()=>{const r=await this.client.meta.getItem(t,n);return r&&r.item?r.item:r})}))}getCached(t){return this.metadataCache.getCachedSync(t)}getCacheStats(){return this.metadataCache.getStats()}invalidateCache(t){this.metadataCache.invalidate(t)}clearCache(){this.metadataCache.clear()}async uploadFile(t,e,s){await this.connect();const n=new FormData;n.append("file",e),s?.recordId&&n.append("recordId",s.recordId),s?.fieldName&&n.append("fieldName",s.fieldName),s?.metadata&&n.append("metadata",JSON.stringify(s.metadata));const a=`${this.baseUrl}/api/data/${encodeURIComponent(t)}/upload`,r=await fetch(a,{method:"POST",body:n,headers:{...this.getAuthHeaders()}});if(!r.ok){const o=await r.json().catch(()=>({message:r.statusText}));throw new h(o.message||`Upload failed with status ${r.status}`,"UPLOAD_ERROR",r.status)}return r.json()}async uploadFiles(t,e,s){await this.connect();const n=new FormData;e.forEach((o,c)=>{n.append("files",o,o.name||`file-${c}`)}),s?.recordId&&n.append("recordId",s.recordId),s?.fieldName&&n.append("fieldName",s.fieldName),s?.metadata&&n.append("metadata",JSON.stringify(s.metadata));const a=`${this.baseUrl}/api/data/${encodeURIComponent(t)}/upload`,r=await fetch(a,{method:"POST",body:n,headers:{...this.getAuthHeaders()}});if(!r.ok){const o=await r.json().catch(()=>({message:r.statusText}));throw new h(o.message||`Upload failed with status ${r.status}`,"UPLOAD_ERROR",r.status)}return r.json()}getAuthHeaders(){const t={};return this.token&&(t.Authorization=`Bearer ${this.token}`),t}}export{N as O};
|
|
1
|
+
import{O}from"./vendor-objectstack-BbgElG6O.js";import{h as C}from"./framework-mHWN965c.js";class ${cache;maxSize;ttl;stats;constructor(t={}){this.cache=new Map,this.maxSize=t.maxSize||100,this.ttl=t.ttl||300*1e3,this.stats={hits:0,misses:0,evictions:0}}async get(t,e){const s=Date.now(),n=this.cache.get(t);if(n){if(s-n.timestamp<this.ttl)return n.accessCount++,n.lastAccessed=s,this.stats.hits++,this.cache.delete(t),this.cache.set(t,n),n.data;this.cache.delete(t)}this.stats.misses++;const a=await e();return this.set(t,a),a}set(t,e){const s=Date.now();this.cache.size>=this.maxSize&&!this.cache.has(t)&&this.evictLRU(),this.cache.set(t,{data:e,timestamp:s,accessCount:1,lastAccessed:s})}evictLRU(){const t=this.cache.keys().next().value;t!==void 0&&(this.cache.delete(t),this.stats.evictions++)}invalidate(t){t?this.cache.delete(t):this.cache.clear()}clear(){this.cache.clear(),this.stats={hits:0,misses:0,evictions:0}}getStats(){const t=this.stats.hits+this.stats.misses,e=t>0?this.stats.hits/t:0;return{size:this.cache.size,maxSize:this.maxSize,hits:this.stats.hits,misses:this.stats.misses,evictions:this.stats.evictions,hitRate:e}}getCachedSync(t){const e=this.cache.get(t);if(e){if(this.ttl>0&&Date.now()-e.timestamp>this.ttl){this.cache.delete(t);return}return this.cache.delete(t),this.cache.set(t,e),this.stats.hits++,e.data}}has(t){const e=this.cache.get(t);return e?Date.now()-e.timestamp>=this.ttl?(this.cache.delete(t),!1):!0:!1}}class h extends Error{constructor(t,e,s,n){super(t),this.code=e,this.statusCode=s,this.details=n,this.name="ObjectStackError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,statusCode:this.statusCode,details:this.details,stack:this.stack}}}class y extends h{constructor(t,e){super(`Metadata not found for object: ${t}`,"METADATA_NOT_FOUND",404,{objectName:t,...e}),this.name="MetadataNotFoundError"}}class g extends h{constructor(t,e,s,n,a){super(`Bulk ${t} operation failed: ${e} succeeded, ${s} failed`,"BULK_OPERATION_ERROR",500,{operation:t,successCount:e,failureCount:s,errors:n,...a}),this.successCount=e,this.failureCount=s,this.errors=n,this.name="BulkOperationError"}getSummary(){const t=this.successCount+this.failureCount,e=t>0?this.failureCount/t:0;return{operation:this.details?.operation,total:t,successful:this.successCount,failed:this.failureCount,failureRate:e,errors:this.errors}}}class w extends h{constructor(t,e,s,n){super(`Connection error: ${t}`,"CONNECTION_ERROR",n||503,{url:e,...s}),this.url=e,this.name="ConnectionError"}}class p extends h{constructor(t="Authentication failed",e,s){super(t,"AUTHENTICATION_ERROR",s||401,e),this.name="AuthenticationError"}}class E extends h{constructor(t,e,s,n){super(t,"VALIDATION_ERROR",400,{field:e,validationErrors:s,...n}),this.field=e,this.validationErrors=s,this.name="ValidationError"}getValidationErrors(){return this.validationErrors||[]}}function R(i,t){const e=i?.status||i?.statusCode||500,s=i?.message||i?.statusText||"Unknown error",n={context:t,response:{status:e,data:i?.data,headers:i?.headers}};switch(e){case 401:return new p(s,n,401);case 403:return new p(s,n,403);case 404:if(t?.includes("metadata")||t?.includes("schema")||t?.includes("getObjectSchema")){const a=A(t);return new y(a,n)}return new h(s,"NOT_FOUND",404,n);case 400:return new E(s,void 0,i?.data?.errors,n);case 503:return new w(s,i?.config?.url,n,503);case 504:return new w(s,i?.config?.url,n,504);default:return new h(s,"UNKNOWN_ERROR",e,n)}}function A(i){if(!i)return"unknown";const t=i.match(/\(([^)]+)\)/);return t?t[1]:"unknown"}class N{client;connected=!1;metadataCache;connectionState="disconnected";connectionStateListeners=[];batchProgressListeners=[];autoReconnect;maxReconnectAttempts;reconnectDelay;reconnectAttempts=0;baseUrl;token;constructor(t){this.client=new O(t),this.metadataCache=new $(t.cache),this.autoReconnect=t.autoReconnect??!0,this.maxReconnectAttempts=t.maxReconnectAttempts??3,this.reconnectDelay=t.reconnectDelay??1e3,this.baseUrl=t.baseUrl,this.token=t.token}async connect(){if(!this.connected){this.setConnectionState("connecting");try{await this.client.connect(),this.connected=!0,this.reconnectAttempts=0,this.setConnectionState("connected")}catch(t){const e=t instanceof Error?t.message:"Failed to connect to ObjectStack server",s=new w(e,void 0,{originalError:t});if(this.setConnectionState("error",s),this.autoReconnect&&this.reconnectAttempts<this.maxReconnectAttempts)await this.attemptReconnect();else throw s}}}async attemptReconnect(){this.reconnectAttempts++,this.setConnectionState("reconnecting");const t=this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1);await new Promise(e=>setTimeout(e,t)),this.connected=!1,await this.connect()}getConnectionState(){return this.connectionState}isConnected(){return this.connected&&this.connectionState==="connected"}onConnectionStateChange(t){return this.connectionStateListeners.push(t),()=>{const e=this.connectionStateListeners.indexOf(t);e>-1&&this.connectionStateListeners.splice(e,1)}}onBatchProgress(t){return this.batchProgressListeners.push(t),()=>{const e=this.batchProgressListeners.indexOf(t);e>-1&&this.batchProgressListeners.splice(e,1)}}setConnectionState(t,e){this.connectionState=t;const s={state:t,timestamp:Date.now(),error:e};this.connectionStateListeners.forEach(n=>{try{n(s)}catch(a){console.error("Error in connection state listener:",a)}})}emitBatchProgress(t){this.batchProgressListeners.forEach(e=>{try{e(t)}catch(s){console.error("Error in batch progress listener:",s)}})}async find(t,e){await this.connect();const s=this.convertQueryParams(e),n=await this.client.data.find(t,s);if(Array.isArray(n))return{data:n,total:n.length,page:1,pageSize:n.length,hasMore:!1};const a=n,r=a.records||a.value||[],o=a.total??a.count??r.length;return{data:r,total:o,page:e?.$skip&&e.$top?Math.floor(e.$skip/e.$top)+1:1,pageSize:e?.$top,hasMore:e?.$top?r.length===e.$top:!1}}async findOne(t,e,s){await this.connect();try{return(await this.client.data.get(t,String(e))).record}catch(n){if(n?.status===404)return null;throw n}}async create(t,e){return await this.connect(),(await this.client.data.create(t,e)).record}async update(t,e,s){return await this.connect(),(await this.client.data.update(t,String(e),s)).record}async delete(t,e){return await this.connect(),(await this.client.data.delete(t,String(e))).deleted}async bulk(t,e,s){if(await this.connect(),!s||s.length===0)return[];const n=s.length;let a=0,r=0;const o=()=>{this.emitBatchProgress({operation:e,total:n,completed:a,failed:r,percentage:n>0?(a+r)/n*100:0})};try{switch(e){case"create":{o();const c=await this.client.data.createMany(t,s);return a=c.length,r=n-a,o(),c}case"delete":{const c=s.map(l=>l.id).filter(Boolean);if(c.length===0){const l=s.map((u,d)=>({index:d,error:`Missing ID for item at index ${d}`}));throw r=s.length,o(),new g("delete",0,s.length,l)}return o(),await this.client.data.deleteMany(t,c),a=c.length,r=n-a,o(),[]}case"update":{if(typeof this.client.data.updateMany=="function")try{o();const u=this.client.data.updateMany,d=await u(t,s);return a=d.length,r=n-a,o(),d}catch{}const c=[],l=[];for(let u=0;u<s.length;u++){const d=s[u],m=d.id;if(!m){l.push({index:u,error:"Missing ID"}),r++,o();continue}try{const f=await this.client.data.update(t,String(m),d);c.push(f.record),a++,o()}catch(f){const S=f instanceof Error?f.message:String(f);l.push({index:u,error:S}),r++,o()}}if(l.length>0)throw new g("update",c.length,l.length,l,{resource:t,totalRecords:s.length});return c}default:throw new h(`Unsupported bulk operation: ${e}`,"UNSUPPORTED_OPERATION",400)}}catch(c){if(o(),c instanceof g||c instanceof h)throw c;const l=c instanceof Error?c.message:String(c),u=s.map((d,m)=>({index:m,error:l}));throw new g(e,0,s.length,u,{resource:t,originalError:c})}}convertQueryParams(t){if(!t)return{};const e={};if(t.$select&&(e.select=t.$select),t.$filter&&(Array.isArray(t.$filter)?e.filters=t.$filter:e.filters=C(t.$filter)),t.$orderby)if(Array.isArray(t.$orderby))e.sort=t.$orderby.map(s=>{if(typeof s=="string")return s;const n=s.field;return(s.order||"asc")==="desc"?`-${n}`:n});else{const s=Object.entries(t.$orderby).map(([n,a])=>a==="desc"?`-${n}`:n);e.sort=s}return t.$skip!==void 0&&(e.skip=t.$skip),t.$top!==void 0&&(e.top=t.$top),e}async getObjectSchema(t){await this.connect();try{return await this.metadataCache.get(t,async()=>{const s=await this.client.meta.getItem("object",t);return s&&s.item?s.item:s})}catch(e){const s=e;throw s?.status===404||s?.statusCode===404?new y(t,{originalError:e}):e instanceof h?e:R(s,`getObjectSchema(${t})`)}}getClient(){return this.client}async getDiscovery(){try{return await this.connect(),this.client.discoveryInfo||null}catch{return null}}async getView(t,e){await this.connect();try{const s=`view:${t}:${e}`;return await this.metadataCache.get(s,async()=>{const n=await this.client.meta.getItem(t,`views/${e}`);return n&&n.item?n.item:n??null})}catch{return null}}async getApp(t){await this.connect();try{const e=`app:${t}`;return await this.metadataCache.get(e,async()=>{const s=await this.client.meta.getItem("apps",t);return s&&s.item?s.item:s??null})}catch{return null}}async getPage(t){await this.connect();try{const e=`page:${t}`;return await this.metadataCache.get(e,async()=>{const s=await this.client.meta.getItem("pages",t);return s&&s.item?s.item:s??null})}catch{return null}}async getItems(t,e){return await this.connect(),await Promise.all(e.map(async n=>{const a=`${t}:${n}`;return this.metadataCache.get(a,async()=>{const r=await this.client.meta.getItem(t,n);return r&&r.item?r.item:r})}))}getCached(t){return this.metadataCache.getCachedSync(t)}getCacheStats(){return this.metadataCache.getStats()}invalidateCache(t){this.metadataCache.invalidate(t)}clearCache(){this.metadataCache.clear()}async uploadFile(t,e,s){await this.connect();const n=new FormData;n.append("file",e),s?.recordId&&n.append("recordId",s.recordId),s?.fieldName&&n.append("fieldName",s.fieldName),s?.metadata&&n.append("metadata",JSON.stringify(s.metadata));const a=`${this.baseUrl}/api/data/${encodeURIComponent(t)}/upload`,r=await fetch(a,{method:"POST",body:n,headers:{...this.getAuthHeaders()}});if(!r.ok){const o=await r.json().catch(()=>({message:r.statusText}));throw new h(o.message||`Upload failed with status ${r.status}`,"UPLOAD_ERROR",r.status)}return r.json()}async uploadFiles(t,e,s){await this.connect();const n=new FormData;e.forEach((o,c)=>{n.append("files",o,o.name||`file-${c}`)}),s?.recordId&&n.append("recordId",s.recordId),s?.fieldName&&n.append("fieldName",s.fieldName),s?.metadata&&n.append("metadata",JSON.stringify(s.metadata));const a=`${this.baseUrl}/api/data/${encodeURIComponent(t)}/upload`,r=await fetch(a,{method:"POST",body:n,headers:{...this.getAuthHeaders()}});if(!r.ok){const o=await r.json().catch(()=>({message:r.statusText}));throw new h(o.message||`Upload failed with status ${r.status}`,"UPLOAD_ERROR",r.status)}return r.json()}getAuthHeaders(){const t={};return this.token&&(t.Authorization=`Bearer ${this.token}`),t}}export{N as O};
|
|
Binary file
|
|
Binary file
|