@object-ui/console 3.1.5 → 3.3.0
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/ActionParamDialog-FoHiwOv1.js +1 -0
- package/dist/assets/AdapterProvider-BMMNYOio.js +1 -0
- package/dist/assets/AddressField-cixYGlNB.js +1 -0
- package/dist/assets/AdvancedChartImpl-BWWiRBQV.js +7 -0
- package/dist/assets/AppManagementPage-bOyAnjhU.js +1 -0
- package/dist/assets/AuditLogPage-CYbk9eg-.js +1 -0
- package/dist/assets/AuthPageLayout-BxIX5ebE.js +1 -0
- package/dist/assets/AutoNumberField-ZhMKpjBg.js +1 -0
- package/dist/assets/AvatarField-CyFyTMU0.js +1 -0
- package/dist/assets/BooleanField-BfvYM6AV.js +1 -0
- package/dist/assets/ChartImpl-DC6hwSlw.js +1 -0
- package/dist/assets/CodeField-E_gkep6y.js +1 -0
- package/dist/assets/ColorField-Cx-A5Lt0.js +1 -0
- package/dist/assets/CreateAppPage-BWPsgJjt.js +1 -0
- package/dist/assets/CurrencyField-De8eUBZn.js +1 -0
- package/dist/assets/DashboardDesignPage-D5PK-DCt.js +1 -0
- package/dist/assets/DashboardView-DHicI3QF.js +1 -0
- package/dist/assets/DateField-DEX8P85a.js +1 -0
- package/dist/assets/DateTimeField-7-OLEv75.js +1 -0
- package/dist/assets/EditAppPage-D5zTwJlk.js +1 -0
- package/dist/assets/EmailField-PxbTAuYC.js +1 -0
- package/dist/assets/FileField-BgYkkxBp.js +1 -0
- package/dist/assets/ForgotPasswordPage-B-SC0EDQ.js +1 -0
- package/dist/assets/FormulaField-DtcAppqd.js +1 -0
- package/dist/assets/GeolocationField-C8Vv3Q9T.js +1 -0
- package/dist/assets/GridField-HGVRXmPw.js +1 -0
- package/dist/assets/HomeLayout-DiAhEUcQ.js +1 -0
- package/dist/assets/HomePage-D0mu1KhN.js +1 -0
- package/dist/assets/ImageField-DonGxYyR.js +1 -0
- package/dist/assets/KanbanEnhanced-dVJHM0Vq.js +1 -0
- package/dist/assets/KanbanImpl-Du7bmAIp.js +1 -0
- package/dist/assets/LocationField-y31Q9OYm.js +1 -0
- package/dist/assets/LoginPage-CK-e0NKb.js +1 -0
- package/dist/assets/LookupField-cs9NaWXw.js +1 -0
- package/dist/assets/MarkdownImpl-DLQW-V1y.js +1 -0
- package/dist/assets/MasterDetailField-BI3uiZgR.js +1 -0
- package/dist/assets/MetadataDetailPage-C7MBEpTZ.js +1 -0
- package/dist/assets/MetadataFormDialog-C6kZu-tl.js +1 -0
- package/dist/assets/MetadataInspector-DAb5pYOH.js +1 -0
- package/dist/assets/MetadataManagerPage-KqCTlrFw.js +1 -0
- package/dist/assets/MetadataProvider-B6Zo_H9g.js +1 -0
- package/dist/assets/NumberField-CAPsyF5_.js +1 -0
- package/dist/assets/ObjectField-BXs-P94B.js +1 -0
- package/dist/assets/OrgManagementPage-Bd5hFjFA.js +1 -0
- package/dist/assets/PageDesignPage-CQKuBMSG.js +1 -0
- package/dist/assets/PageView-DzAF-4xC.js +2 -0
- package/dist/assets/PasswordField-66M8i1cP.js +1 -0
- package/dist/assets/PercentField-B4-Z2cl-.js +1 -0
- package/dist/assets/PermissionManagementPage-BohlfBZM.js +1 -0
- package/dist/assets/PhoneField-CbEqbBrO.js +1 -0
- package/dist/assets/ProfilePage-B2B5Vwiv.js +1 -0
- package/dist/assets/QRCodeField-BMVgCKPB.js +1 -0
- package/dist/assets/RatingField-DT67gTVp.js +1 -0
- package/dist/assets/RecordDetailView-KuRefR4o.js +1 -0
- package/dist/assets/RegisterPage-BR28zo3Z.js +1 -0
- package/dist/assets/ReportView-Dud74EeY.js +1 -0
- package/dist/assets/RichTextField-BJ3qOJu3.js +1 -0
- package/dist/assets/RoleManagementPage-CSrM1CTg.js +1 -0
- package/dist/assets/SearchResultsPage-CziEvfRB.js +1 -0
- package/dist/assets/SelectField-BIh8RBU2.js +1 -0
- package/dist/assets/SignatureField-DeTRlABT.js +1 -0
- package/dist/assets/SliderField-DZ4Q6eTl.js +1 -0
- package/dist/assets/SummaryField-DIOlQfN3.js +1 -0
- package/dist/assets/SystemHubPage-CT0edisJ.js +1 -0
- package/dist/assets/SystemObjectViewPage-D2qKWQRW.js +1 -0
- package/dist/assets/TextAreaField-C4XjBoOs.js +1 -0
- package/dist/assets/TextField-BcXMv3xe.js +1 -0
- package/dist/assets/TimeField-CHh1ZLFD.js +1 -0
- package/dist/assets/UrlField-DiTncT6s.js +1 -0
- package/dist/assets/UserField-mFk7qkDu.js +1 -0
- package/dist/assets/UserManagementPage-CicLMv53.js +1 -0
- package/dist/assets/VectorField-BsaAAFSl.js +1 -0
- package/dist/assets/data-adapter-DPqgzJ64.js +39 -0
- package/dist/assets/framework-B0ex8RpF.js +2 -0
- package/dist/assets/getIcon-DUhh_MlU.js +1 -0
- package/dist/assets/index-KDzKK6UM.js +26 -0
- package/dist/assets/index-jP1vuxyn.css +2 -0
- package/dist/assets/infrastructure-88EEJ8ZY.js +3 -0
- package/dist/assets/lib-CQxQAzx9.js +29 -0
- package/dist/assets/maplibre-gl-tCaFQWyX.js +748 -0
- package/dist/assets/metadataTypeRegistry-D4RkPQA-.js +1 -0
- package/dist/assets/plugins-core-B8C8BUw8.js +135 -0
- package/dist/assets/plugins-core-Dpq2d-QS.css +2 -0
- package/dist/assets/plugins-views-Csz847hc.js +62 -0
- package/dist/assets/{skeletons-DcGqw3b1.js → skeletons-Dxs6Di3L.js} +1 -1
- package/dist/assets/src-BY3UmUTR.js +1 -0
- package/dist/assets/src-CZnjIqJM.js +1 -0
- package/dist/assets/src-ZtN-VRcF.js +1 -0
- package/dist/assets/ui-layout-CvxBdH1V.js +3 -0
- package/dist/assets/useFavorites--Hq-4pMF.js +1 -0
- package/dist/assets/useMetadataService-CC_uGGZw.js +1 -0
- package/dist/assets/useResponsiveSidebar-DB8TNfQv.js +1 -0
- package/dist/assets/utils-auqIw3t-.js +1 -0
- package/dist/assets/vendor-charts-7pRhwWOA.js +3 -0
- package/dist/assets/vendor-objectstack-C8-rZ_sh.js +1 -0
- package/dist/assets/{vendor-react-BwtAzZZ3.js → vendor-react-DmY3YWtk.js} +2 -2
- package/dist/assets/vendor-zod-Cu1XCR5v.js +1 -0
- package/dist/index.html +25 -13
- package/dist/mockServiceWorker.js +1 -1
- package/package.json +50 -47
- package/plugin.js +2 -2
- package/plugin.ts +2 -2
- package/dist/assets/AddressField-BLYuFwUv.js +0 -1
- package/dist/assets/AdvancedChartImpl-Dvg6YIfN.js +0 -7
- package/dist/assets/AppManagementPage-C5q5QBar.js +0 -1
- package/dist/assets/AuditLogPage-BpLFTD-b.js +0 -1
- package/dist/assets/AuthPageLayout-DDjJTsQ6.js +0 -1
- package/dist/assets/AutoNumberField-DLmi_0fk.js +0 -1
- package/dist/assets/AvatarField-BfoEDA_D.js +0 -1
- package/dist/assets/BooleanField-W3_x7RAZ.js +0 -1
- package/dist/assets/ChartImpl-Cwo6IWnY.js +0 -1
- package/dist/assets/CodeField-BWFqblAU.js +0 -1
- package/dist/assets/ColorField-Y8WM1wXE.js +0 -1
- package/dist/assets/CreateAppPage-A-VfItcx.js +0 -1
- package/dist/assets/CurrencyField-BeuE1bRa.js +0 -1
- package/dist/assets/DashboardDesignPage-N8NL-jkM.js +0 -1
- package/dist/assets/DashboardView-Dy0d2kFj.js +0 -1
- package/dist/assets/DateField-2Lf9jstN.js +0 -1
- package/dist/assets/DateTimeField-BkMuhOZJ.js +0 -1
- package/dist/assets/EditAppPage-B6HL4COW.js +0 -1
- package/dist/assets/EmailField-CP_O7tmo.js +0 -1
- package/dist/assets/FileField-CcczwlRk.js +0 -1
- package/dist/assets/ForgotPasswordPage-Slo6CHvD.js +0 -1
- package/dist/assets/FormulaField-DLdg1ImO.js +0 -1
- package/dist/assets/GeolocationField-DqeMjnyo.js +0 -1
- package/dist/assets/GridField-DaWMYyuc.js +0 -1
- package/dist/assets/ImageField-DAn05d1y.js +0 -1
- package/dist/assets/KanbanEnhanced-Dj7Qccu2.js +0 -1
- package/dist/assets/KanbanImpl-D9BbG_RT.js +0 -1
- package/dist/assets/LocationField-DYHVF_gq.js +0 -1
- package/dist/assets/LoginPage-D2CqpSi0.js +0 -1
- package/dist/assets/LookupField-BF9vCmht.js +0 -1
- package/dist/assets/MarkdownImpl-B0Iew7iJ.js +0 -29
- package/dist/assets/MasterDetailField-Dw4RRQ5W.js +0 -1
- package/dist/assets/NumberField-BKuVHBrN.js +0 -1
- package/dist/assets/ObjectField-z00gmFEc.js +0 -1
- package/dist/assets/OrgManagementPage-BqtqRi_6.js +0 -1
- package/dist/assets/PageDesignPage-BzIL8o0u.js +0 -1
- package/dist/assets/PageView-eCi7zkJr.js +0 -2
- package/dist/assets/PasswordField-B_rXL4g9.js +0 -1
- package/dist/assets/PercentField-Bn_SIbNe.js +0 -1
- package/dist/assets/PermissionManagementPage-BmI-0QXt.js +0 -1
- package/dist/assets/PhoneField-DuheMaUR.js +0 -1
- package/dist/assets/ProfilePage-CUo-xIgl.js +0 -1
- package/dist/assets/QRCodeField-IPS2Rpmi.js +0 -1
- package/dist/assets/RatingField-M6qZlpA4.js +0 -1
- package/dist/assets/RecordDetailView-CFVPmfrM.js +0 -1
- package/dist/assets/RegisterPage-D7PJIabW.js +0 -1
- package/dist/assets/ReportView-DNOPIpWM.js +0 -1
- package/dist/assets/RichTextField-CDGy9V9x.js +0 -1
- package/dist/assets/RoleManagementPage-DwtqyfDW.js +0 -1
- package/dist/assets/SearchResultsPage-BxzOkRnL.js +0 -1
- package/dist/assets/SelectField-F6UDlyvf.js +0 -1
- package/dist/assets/SignatureField-CHN7xBII.js +0 -1
- package/dist/assets/SliderField-BOfEMQyU.js +0 -1
- package/dist/assets/SummaryField-CZ8KzmBZ.js +0 -1
- package/dist/assets/SystemHubPage-RFiJSMgW.js +0 -1
- package/dist/assets/TextAreaField-1E39zZ_x.js +0 -1
- package/dist/assets/TextField-CwuU0Crc.js +0 -1
- package/dist/assets/TimeField-CEWXxhLE.js +0 -1
- package/dist/assets/UrlField-BtUImn9B.js +0 -1
- package/dist/assets/UserField-DSSEoy5L.js +0 -1
- package/dist/assets/UserManagementPage-BBS1vYGa.js +0 -1
- package/dist/assets/VectorField-BjfQeTZT.js +0 -1
- package/dist/assets/data-adapter-wZ81OFjZ.js +0 -39
- package/dist/assets/framework-DJlDX9E6.js +0 -1
- package/dist/assets/index-D9-L0QBO.css +0 -2
- package/dist/assets/index-DDpLaQOV.js +0 -8
- package/dist/assets/infrastructure-C6Ph6Ug0.js +0 -3
- package/dist/assets/maplibre-gl-DsUGuDud.js +0 -756
- package/dist/assets/plugins-core-Cfhp_BXE.css +0 -2
- package/dist/assets/plugins-core-PiAAytWV.js +0 -136
- package/dist/assets/plugins-views-CE0VP3vl.js +0 -62
- package/dist/assets/src-oeWLmiqa.js +0 -1
- package/dist/assets/systemObjects-5--4zaiX.js +0 -1
- package/dist/assets/ui-layout-DdDX0gzI.js +0 -3
- package/dist/assets/vendor-charts-Bl5l0H2K.js +0 -3
- package/dist/assets/vendor-objectstack-BtztJIHv.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{$t as r,Cn as i,Dn as a,En as o,Go as s,Ho as c,Jo as l,Ko as u,On as d,Qt as f,Tn as p,Uo as m,Wo as h,Xo as g,Yo as _,cn as v,en as y,gt as b,nn as x,qo as S,sn as C,tn as w,wn as T}from"./plugins-core-B8C8BUw8.js";var E=t();function D({state:e,onOpenChange:t}){let n=()=>{e.resolve?.(!0),t(!1)},r=()=>{e.resolve?.(!1),t(!1)};return(0,E.jsx)(c,{open:e.open,onOpenChange:e=>{e||r()},children:(0,E.jsxs)(s,{children:[(0,E.jsxs)(l,{children:[(0,E.jsx)(_,{children:e.options?.title||`Confirm Action`}),(0,E.jsx)(u,{children:e.message})]}),(0,E.jsxs)(S,{children:[(0,E.jsx)(h,{onClick:r,children:e.options?.cancelText||`Cancel`}),(0,E.jsx)(m,{onClick:n,children:e.options?.confirmText||`Continue`})]})]})})}var O=e(n(),1);function k({state:e,onOpenChange:t}){let[n,s]=(0,O.useState)({}),[c,l]=(0,O.useState)({});(0,O.useEffect)(()=>{if(e.open){let t={};for(let n of e.params)n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);s(t),l({})}},[e.open,e.params]);let u=e=>e==null?!0:typeof e==`string`?e.trim()===``:Array.isArray(e)?e.length===0:!1,m=()=>{let r={};for(let t of e.params)t.required&&u(n[t.name])&&(r[t.name]=!0);if(Object.keys(r).length>0){l(r);return}e.resolve?.(n),t(!1)},h=()=>{e.resolve?.(null),t(!1)},_=(e,t)=>{s(n=>({...n,[e]:t})),l(t=>({...t,[e]:!1}))};return(0,E.jsx)(i,{open:e.open,onOpenChange:e=>{e||h()},children:(0,E.jsxs)(T,{children:[(0,E.jsxs)(a,{children:[(0,E.jsx)(d,{children:`Action Parameters`}),(0,E.jsx)(p,{children:`Please provide the required information to continue.`})]}),(0,E.jsx)(`div`,{className:`grid gap-4 py-4`,children:e.params.map(e=>(0,E.jsxs)(`div`,{className:`grid gap-2`,children:[(0,E.jsxs)(v,{htmlFor:e.name,children:[e.label,e.required&&(0,E.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),e.type===`select`&&e.options?(0,E.jsxs)(f,{value:n[e.name]??``,onValueChange:t=>_(e.name,t),children:[(0,E.jsx)(w,{id:e.name,className:c[e.name]?`border-destructive`:``,children:(0,E.jsx)(x,{placeholder:e.placeholder||`Select ${e.label}`})}),(0,E.jsx)(r,{children:e.options.map(e=>(0,E.jsx)(y,{value:e.value,children:e.label},e.value))})]}):e.type===`textarea`?(0,E.jsx)(b,{id:e.name,value:n[e.name]??``,onChange:t=>_(e.name,t.target.value),placeholder:e.placeholder,className:c[e.name]?`border-destructive`:``}):e.type===`number`?(0,E.jsx)(C,{id:e.name,type:`number`,value:n[e.name]??``,onChange:t=>_(e.name,t.target.value===``?void 0:t.target.valueAsNumber),placeholder:e.placeholder,className:c[e.name]?`border-destructive`:``}):(0,E.jsx)(C,{id:e.name,type:[`email`,`url`,`date`,`datetime-local`,`time`,`password`].includes(e.type)?e.type:`text`,value:n[e.name]??``,onChange:t=>_(e.name,t.target.value),placeholder:e.placeholder,className:c[e.name]?`border-destructive`:``}),c[e.name]&&(0,E.jsxs)(`p`,{className:`text-xs text-destructive`,children:[e.label,` is required`]}),e.helpText&&(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.helpText})]},e.name))}),(0,E.jsxs)(o,{children:[(0,E.jsx)(g,{variant:`outline`,onClick:h,children:`Cancel`}),(0,E.jsx)(g,{onClick:m,children:`Confirm`})]})]})})}export{D as n,k as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{t as r}from"./data-adapter-DPqgzJ64.js";var i=e(n(),1),a=t(),o=(0,i.createContext)(null);function s(){return(0,i.useContext)(o)}function c({children:e,adapter:t}){let[n,s]=(0,i.useState)(t??null);return(0,i.useEffect)(()=>{if(t){s(t);return}let e=!1;async function n(){try{let t=new r({baseUrl:``,autoReconnect:!0,maxReconnectAttempts:5,reconnectDelay:1e3,cache:{maxSize:50,ttl:3e5}});await t.connect(),e||s(t)}catch(t){e||console.error(`[Console] Failed to initialize:`,t)}}return n(),()=>{e=!0}},[t]),(0,a.jsx)(o.Provider,{value:n,children:e})}export{s as n,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e}from"./plugins-core-B8C8BUw8.js";export{e as AddressField};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Ki as r,Nn as i,ua as a}from"./plugins-core-B8C8BUw8.js";import{_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C,v as w,y as T}from"./vendor-charts-7pRhwWOA.js";var E=e(n(),1),D=t(),O=(...e)=>e.filter(Boolean).join(` `),k={light:``,dark:`.dark`},A=E.createContext(null);function j(){let e=E.useContext(A);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function M({id:e,className:t,children:n,config:r,...i}){let o=E.useId(),s=`chart-${e||o.replace(/:/g,``)}`;return(0,D.jsx)(A.Provider,{value:{config:r},children:(0,D.jsxs)(`div`,{"data-slot":`chart`,"data-chart":s,className:O(`flex w-full h-[350px] justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground`,t),...i,children:[(0,D.jsx)(N,{id:s,config:r}),(0,D.jsx)(a,{width:`100%`,height:`100%`,children:n})]})})}var N=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme||e.color);return n.length?(0,D.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(k).map(([t,r])=>`
|
|
2
|
+
${r} [data-chart=${e}] {
|
|
3
|
+
${n.map(([e,n])=>{let r=n.theme?.[t]||n.color;return r?` --color-${e}: ${r};`:null}).join(`
|
|
4
|
+
`)}
|
|
5
|
+
}
|
|
6
|
+
`).join(`
|
|
7
|
+
`)}}):null},P=i;function F({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:c,formatter:l,color:u,nameKey:d,labelKey:f}){let{config:p}=j(),m=E.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=R(p,e,`${f||e?.dataKey||e?.name||`value`}`),r=!f&&typeof o==`string`?p[o]?.label||o:n?.label;return s?(0,D.jsx)(`div`,{className:O(`font-medium`,c),children:s(r,t)}):r?(0,D.jsx)(`div`,{className:O(`font-medium`,c),children:r}):null},[o,s,t,i,c,p,f]);if(!e||!t?.length)return null;let h=t.length===1&&r!==`dot`;return(0,D.jsxs)(`div`,{className:O(`border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl`,n),children:[h?null:m,(0,D.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=R(p,e,`${d||e.name||e.dataKey||`value`}`),i=u||e.payload.fill||e.color;return(0,D.jsx)(`div`,{className:O(`[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5`,r===`dot`?`items-center`:``),children:l&&e?.value!==void 0&&e.name?l(e.value,e.name,e,t,e.payload):(0,D.jsxs)(D.Fragment,{children:[n?.icon?(0,D.jsx)(n.icon,{}):!a&&(0,D.jsx)(`div`,{className:O(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,r===`dot`?`h-2.5 w-2.5`:``,r===`line`?`w-1`:``,r===`dashed`?`w-0 border-[1.5px] border-dashed bg-transparent`:``,h&&r===`dashed`?`my-0.5`:``),style:{"--color-bg":i,"--color-border":i}}),(0,D.jsxs)(`div`,{className:O(`flex flex-1 justify-between leading-none`,h?`items-end`:`items-center`),children:[(0,D.jsxs)(`div`,{className:`grid gap-1.5`,children:[h?m:null,(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:n?.label||e.name})]}),e.value&&(0,D.jsx)(`span`,{className:`text-foreground font-mono font-medium tabular-nums`,children:e.value.toLocaleString()})]})]})},e.dataKey)})})]})}var I=r;function L({className:e,hideIcon:t=!1,payload:n,verticalAlign:r=`bottom`,nameKey:i}){let{config:a}=j();return n?.length?(0,D.jsx)(`div`,{className:O(`flex items-center justify-center gap-4`,r===`top`?`pb-3`:`pt-3`,e),children:n.filter(e=>e.type!==`none`).map(e=>{let n=R(a,e,`${i||e.dataKey||`value`}`);return(0,D.jsxs)(`div`,{className:O(`[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3`),children:[n?.icon&&!t?(0,D.jsx)(n.icon,{}):(0,D.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),n?.label]},e.value)})}):null}function R(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}var z=`hsl(var(--primary))`,B={slate:`#64748b`,gray:`#6b7280`,zinc:`#71717a`,neutral:`#737373`,stone:`#78716c`,red:`#ef4444`,orange:`#f97316`,amber:`#f59e0b`,yellow:`#eab308`,lime:`#84cc16`,green:`#22c55e`,emerald:`#10b981`,teal:`#14b8a6`,cyan:`#06b6d4`,sky:`#0ea5e9`,blue:`#3b82f6`,indigo:`#6366f1`,violet:`#8b5cf6`,purple:`#a855f7`,fuchsia:`#d946ef`,pink:`#ec4899`,rose:`#f43f5e`},V=e=>B[e]||e;function H({chartType:e=`bar`,data:t=[],config:n={},xAxisKey:r=`name`,series:i=[],className:a=``}){let O=Array.isArray(t)?t:[],[k,A]=E.useState(!1);E.useEffect(()=>{let e=()=>A(window.innerWidth<640);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let j={bar:s,line:v,area:S,pie:m,donut:m,radar:b,scatter:_,combo:s}[e]||s,N=E.useMemo(()=>O.some(e=>String(e[r]||``).length>5),[O,r]),R=()=>[`hsl(var(--chart-1))`,`hsl(var(--chart-2))`,`hsl(var(--chart-3))`,`hsl(var(--chart-4))`,`hsl(var(--chart-5))`];if(e===`pie`||e===`donut`){let t=e===`donut`?60:0;return(0,D.jsx)(M,{config:n,className:a,children:(0,D.jsxs)(m,{children:[(0,D.jsx)(P,{cursor:!1,content:(0,D.jsx)(F,{hideLabel:!0})}),(0,D.jsx)(f,{data:O,dataKey:i[0]?.dataKey||`value`,nameKey:r||`name`,innerRadius:t,strokeWidth:5,paddingAngle:2,outerRadius:80,children:O.map((e,t)=>{let i=n[e[r]]?.color;if(!i){let e=R();i=e[t%e.length]}return(0,D.jsx)(c,{fill:V(i)},`cell-${t}`)})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{nameKey:r}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}})]})})}return e===`radar`?(0,D.jsx)(M,{config:n,className:a,children:(0,D.jsxs)(b,{data:O,children:[(0,D.jsx)(T,{}),(0,D.jsx)(o,{dataKey:r}),(0,D.jsx)(w,{}),(0,D.jsx)(P,{content:(0,D.jsx)(F,{})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map(e=>{let t=V(n[e.dataKey]?.color||z);return(0,D.jsx)(p,{dataKey:e.dataKey,stroke:t,fill:t,fillOpacity:.6},e.dataKey)})]})}):e===`scatter`?(0,D.jsx)(M,{config:n,className:a,children:(0,D.jsxs)(_,{children:[(0,D.jsx)(g,{vertical:!1}),(0,D.jsx)(h,{type:`number`,dataKey:r,name:String(n[r]?.label||r),tickLine:!1,axisLine:!1,interval:k?Math.ceil(O.length/5):0}),(0,D.jsx)(l,{type:`number`,dataKey:i[0]?.dataKey||`value`,name:String(n[i[0]?.dataKey]?.label||i[0]?.dataKey),tickLine:!1,axisLine:!1}),(0,D.jsx)(x,{type:`number`,range:[60,400]}),(0,D.jsx)(P,{content:(0,D.jsx)(F,{})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((e,t)=>{let r=R(),i=V(n[e.dataKey]?.color||r[t%r.length]);return(0,D.jsx)(C,{name:n[e.dataKey]?.label||e.dataKey,data:O,fill:i},e.dataKey)})]})}):e===`combo`?(0,D.jsx)(M,{config:n,className:a,children:(0,D.jsxs)(s,{data:O,children:[(0,D.jsx)(g,{vertical:!1}),(0,D.jsx)(h,{dataKey:r,tickLine:!1,tickMargin:10,axisLine:!1,interval:k?Math.ceil(O.length/5):0,tickFormatter:e=>!e||typeof e!=`string`?e:k&&e.length>8?e.slice(0,8)+`…`:e,...!k&&N&&{angle:-35,textAnchor:`end`,height:60}}),(0,D.jsx)(l,{yAxisId:`left`,tickLine:!1,axisLine:!1}),(0,D.jsx)(l,{yAxisId:`right`,orientation:`right`,tickLine:!1,axisLine:!1}),(0,D.jsx)(P,{content:(0,D.jsx)(F,{})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map((e,t)=>{let r=V(n[e.dataKey]?.color||z),i=e.chartType||(t===0?`bar`:`line`),a=i===`bar`?`left`:`right`;return i===`line`?(0,D.jsx)(y,{yAxisId:a,type:`monotone`,dataKey:e.dataKey,stroke:r,strokeWidth:2,dot:!1},e.dataKey):i===`area`?(0,D.jsx)(d,{yAxisId:a,type:`monotone`,dataKey:e.dataKey,fill:r,stroke:r,fillOpacity:.4},e.dataKey):(0,D.jsx)(u,{yAxisId:a,dataKey:e.dataKey,fill:r,radius:4},e.dataKey)})]})}):(0,D.jsx)(M,{config:n,className:a,children:(0,D.jsxs)(j,{data:O,children:[(0,D.jsx)(g,{vertical:!1}),(0,D.jsx)(h,{dataKey:r,tickLine:!1,tickMargin:10,axisLine:!1,interval:k?Math.ceil(O.length/5):0,tickFormatter:e=>!e||typeof e!=`string`?e:k&&e.length>8?e.slice(0,8)+`…`:e,...!k&&N&&{angle:-35,textAnchor:`end`,height:60}}),(0,D.jsx)(P,{content:(0,D.jsx)(F,{})}),(0,D.jsx)(I,{content:(0,D.jsx)(L,{}),...k&&{verticalAlign:`bottom`,wrapperStyle:{fontSize:`11px`,paddingTop:`8px`}}}),i.map(t=>{let r=V(n[t.dataKey]?.color||z);return e===`bar`?(0,D.jsx)(u,{dataKey:t.dataKey,fill:r,radius:4},t.dataKey):e===`line`?(0,D.jsx)(y,{type:`monotone`,dataKey:t.dataKey,stroke:r,strokeWidth:2,dot:!1},t.dataKey):e===`area`?(0,D.jsx)(d,{type:`monotone`,dataKey:t.dataKey,fill:r,stroke:r,fillOpacity:.4},t.dataKey):null})]})})}export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Cc as r,Ct as i,Hs as a,Io as o,Mn as s,Ps as c,To as l,Xo as u,bs as d,hs as f,ms as p,ps as m,qc as h,qs as g,sn as _,wo as v}from"./plugins-core-B8C8BUw8.js";import{l as y,u as b}from"./ui-layout-CvxBdH1V.js";import{n as x}from"./MetadataProvider-B6Zo_H9g.js";import{n as S}from"./utils-auqIw3t-.js";var C=e(n(),1),w=t();function T(){let e=y(),{appName:t}=b(),n=t?`/apps/${t}`:``,{apps:T,refresh:E}=x(),[D,O]=(0,C.useState)(``),[k,A]=(0,C.useState)(new Set),[j,M]=(0,C.useState)(null),[N,P]=(0,C.useState)(!1),F=(T||[]).filter(e=>{if(!D)return!0;let t=D.toLowerCase();return(e.name||``).toLowerCase().includes(t)||(e.label||``).toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)}),I=(0,C.useCallback)(e=>{A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),L=(0,C.useCallback)(()=>{k.size===F.length?A(new Set):A(new Set(F.map(e=>e.name)))},[k.size,F]),R=(0,C.useCallback)(async e=>{P(!0);try{let t=e.active===!1;i.success(`${e.label||e.name} ${t?`enabled`:`disabled`}`),await E()}catch{i.error(`Failed to toggle app status`)}finally{P(!1)}},[E]),z=(0,C.useCallback)(async e=>{P(!0);try{i.success(`${e.label||e.name} set as default`),await E()}catch{i.error(`Failed to set default app`)}finally{P(!1)}},[E]),B=(0,C.useCallback)(async e=>{if(j!==e.name){M(e.name);return}P(!0);try{i.success(`${e.label||e.name} deleted`),M(null),await E()}catch{i.error(`Failed to delete app`)}finally{P(!1)}},[j,E]),V=(0,C.useCallback)(async e=>{P(!0);try{i.success(`${k.size} apps ${e?`enabled`:`disabled`}`),A(new Set),await E()}catch{i.error(`Bulk operation failed`)}finally{P(!1)}},[k,E]);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`Applications`}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage all configured applications`})]}),(0,w.jsxs)(u,{onClick:()=>e(`${n}/create-app`),"data-testid":`create-app-btn`,children:[(0,w.jsx)(a,{className:`h-4 w-4 mr-2`}),`New App`]})]}),(0,w.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,w.jsx)(`label`,{htmlFor:`app-search`,className:`sr-only`,children:`Search apps`}),(0,w.jsx)(c,{className:`pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),(0,w.jsx)(_,{id:`app-search`,placeholder:`Search apps...`,value:D,onChange:e=>O(e.target.value),className:`pl-8`,"data-testid":`app-search-input`})]}),k.size>0&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(o,{variant:`secondary`,children:[k.size,` selected`]}),(0,w.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>V(!0),disabled:N,children:`Enable`}),(0,w.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>V(!1),disabled:N,children:`Disable`})]})]}),F.length>0&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,w.jsx)(s,{id:`select-all-apps`,checked:k.size===F.length&&F.length>0,onCheckedChange:()=>L()}),(0,w.jsxs)(`label`,{htmlFor:`select-all-apps`,className:`cursor-pointer`,children:[`Select all (`,F.length,`)`]})]}),F.length===0?(0,w.jsxs)(`div`,{className:`text-center py-12 text-muted-foreground`,"data-testid":`no-apps-message`,children:[(0,w.jsx)(r,{className:`h-12 w-12 mx-auto mb-3 opacity-30`}),(0,w.jsx)(`p`,{children:`No apps found.`})]}):(0,w.jsx)(`div`,{className:`grid gap-3`,children:F.map(t=>{let i=t.active!==!1,a=t.isDefault===!0,c=j===t.name;return(0,w.jsx)(v,{className:i?``:`opacity-60`,"data-testid":`app-card-${t.name}`,children:(0,w.jsxs)(l,{className:`flex items-center gap-3 py-3 px-4`,children:[(0,w.jsx)(s,{id:`select-app-${t.name}`,checked:k.has(t.name),onCheckedChange:()=>I(t.name),"aria-label":`Select ${t.label||t.name}`,className:`shrink-0`}),(0,w.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,w.jsx)(r,{className:`h-4 w-4`})}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`font-medium truncate`,children:S(t.label)||t.name}),a&&(0,w.jsx)(o,{variant:`default`,className:`text-xs`,children:`Default`}),(0,w.jsx)(o,{variant:i?`secondary`:`outline`,className:`text-xs`,children:i?`Active`:`Inactive`})]}),t.description&&(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:S(t.description)})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,w.jsx)(u,{variant:`ghost`,size:`icon`,title:`Open app`,"aria-label":`Open ${t.label||t.name}`,onClick:()=>e(`/apps/${t.name}`),children:(0,w.jsx)(h,{className:`h-4 w-4`})}),(0,w.jsx)(u,{variant:`ghost`,size:`icon`,title:`Edit app`,"aria-label":`Edit ${t.label||t.name}`,onClick:()=>e(`${n}/edit-app/${t.name}`),children:(0,w.jsx)(g,{className:`h-4 w-4`})}),(0,w.jsx)(u,{variant:`ghost`,size:`icon`,title:i?`Disable app`:`Enable app`,"aria-label":i?`Disable ${t.label||t.name}`:`Enable ${t.label||t.name}`,onClick:()=>R(t),disabled:N,children:i?(0,w.jsx)(p,{className:`h-4 w-4`}):(0,w.jsx)(f,{className:`h-4 w-4`})}),(0,w.jsx)(u,{variant:`ghost`,size:`icon`,title:`Set as default`,"aria-label":`Set ${t.label||t.name} as default`,onClick:()=>z(t),disabled:N||a,children:(0,w.jsx)(d,{className:`h-4 w-4 ${a?`fill-current text-yellow-500`:``}`})}),(0,w.jsx)(u,{variant:`ghost`,size:`icon`,title:c?`Click again to confirm delete`:`Delete app`,"aria-label":c?`Confirm delete ${t.label||t.name}`:`Delete ${t.label||t.name}`,onClick:()=>B(t),disabled:N,className:c?`text-destructive`:``,children:(0,w.jsx)(m,{className:`h-4 w-4`})})]})]})},t.name)})})]})}export{T as AppManagementPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./framework-B0ex8RpF.js";import{Fs as t}from"./plugins-core-B8C8BUw8.js";import{t as n}from"./SystemObjectViewPage-D2qKWQRW.js";var r=e();function i(){return(0,r.jsx)(n,{objectName:`sys_audit_log`,title:`Audit Log`,description:`View system activity and user actions`,icon:t,readOnly:!0})}export{i as AuditLogPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./framework-B0ex8RpF.js";var t=e();function n({children:e}){return(0,t.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,t.jsx)(`div`,{className:`hidden lg:flex lg:w-1/2 items-center justify-center bg-primary p-12`,children:(0,t.jsxs)(`div`,{className:`max-w-md space-y-6 text-primary-foreground`,children:[(0,t.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,t.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`h-10 w-10`,role:`img`,"aria-label":`ObjectStack logo`,children:[(0,t.jsx)(`title`,{children:`ObjectStack`}),(0,t.jsx)(`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`})]}),(0,t.jsx)(`span`,{className:`text-2xl font-bold`,children:`ObjectStack`})]}),(0,t.jsx)(`h2`,{className:`text-3xl font-bold leading-tight`,children:`Build powerful business applications, faster.`}),(0,t.jsx)(`p`,{className:`text-lg opacity-90`,children:`The universal platform for enterprise data management, workflows, and analytics.`})]})}),(0,t.jsx)(`div`,{className:`flex w-full lg:w-1/2 items-center justify-center bg-background px-6 py-12`,children:e})]})}export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{L as e}from"./plugins-core-B8C8BUw8.js";export{e as AutoNumberField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e}from"./plugins-core-B8C8BUw8.js";export{e as AvatarField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{nt as e}from"./plugins-core-B8C8BUw8.js";export{e as BooleanField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./framework-B0ex8RpF.js";import{Ki as t,Nn as n,ua as r}from"./plugins-core-B8C8BUw8.js";import{a as i,c as a,d as o,l as s,m as c}from"./vendor-charts-7pRhwWOA.js";var l=e();function u({data:e=[],dataKey:u=`value`,xAxisKey:d=`name`,height:f=400,className:p=``,color:m=`hsl(var(--primary))`}){return(0,l.jsx)(`div`,{className:`p-2 sm:p-3 md:p-4 rounded-xl border border-border bg-card/40 backdrop-blur-sm shadow-lg shadow-background/5 ${p}`,children:(0,l.jsx)(r,{width:`100%`,height:f,children:(0,l.jsxs)(i,{data:e,margin:{top:10,right:10,left:10,bottom:5},children:[(0,l.jsxs)(`defs`,{children:[(0,l.jsxs)(`linearGradient`,{id:`barGradient`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,l.jsx)(`stop`,{offset:`0%`,stopColor:m,stopOpacity:1}),(0,l.jsx)(`stop`,{offset:`90%`,stopColor:m,stopOpacity:.6}),(0,l.jsx)(`stop`,{offset:`100%`,stopColor:m,stopOpacity:.3})]}),(0,l.jsxs)(`filter`,{id:`glow`,height:`130%`,children:[(0,l.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`3`,result:`blur`}),(0,l.jsx)(`feOffset`,{in:`blur`,dx:`0`,dy:`0`,result:`offsetBlur`}),(0,l.jsx)(`feFlood`,{floodColor:m,floodOpacity:`0.5`,result:`offsetColor`}),(0,l.jsx)(`feComposite`,{in:`offsetColor`,in2:`offsetBlur`,operator:`in`,result:`offsetBlur`}),(0,l.jsxs)(`feMerge`,{children:[(0,l.jsx)(`feMergeNode`,{in:`offsetBlur`}),(0,l.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),(0,l.jsx)(c,{strokeDasharray:`3 3`,stroke:`hsl(var(--border))`,vertical:!1}),(0,l.jsx)(s,{dataKey:d,tick:{fill:`hsl(var(--muted-foreground))`,fontSize:12,fontFamily:`monospace`},tickLine:!1,axisLine:{stroke:`hsl(var(--border))`},dy:10}),(0,l.jsx)(a,{tick:{fill:`hsl(var(--muted-foreground))`,fontSize:12,fontFamily:`monospace`},tickLine:!1,axisLine:!1}),(0,l.jsx)(n,{cursor:{fill:`hsl(var(--muted))`,opacity:.2},contentStyle:{backgroundColor:`hsl(var(--popover))`,borderColor:`hsl(var(--border))`,color:`hsl(var(--popover-foreground))`,borderRadius:`8px`,fontFamily:`monospace`,boxShadow:`0 4px 6px -1px rgb(0 0 0 / 0.1)`},itemStyle:{color:`hsl(var(--primary))`}}),(0,l.jsx)(t,{wrapperStyle:{paddingTop:`20px`,fontFamily:`monospace`}}),(0,l.jsx)(o,{dataKey:u,fill:`url(#barGradient)`,radius:[4,4,0,0],filter:`url(#glow)`,animationDuration:1500})]})})})}export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./plugins-core-B8C8BUw8.js";export{e as CodeField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as e}from"./plugins-core-B8C8BUw8.js";export{e as ColorField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,n,z as r}from"./framework-B0ex8RpF.js";import{Ct as i}from"./plugins-core-B8C8BUw8.js";import{l as a,u as o}from"./ui-layout-CvxBdH1V.js";import{n as s}from"./MetadataProvider-B6Zo_H9g.js";import{n as c}from"./AdapterProvider-BMMNYOio.js";import{c as l}from"./src-CZnjIqJM.js";var u=e(r(),1),d=t(),f=`objectui-app-wizard-draft`;function p(){let e=a(),{appName:t}=o(),{objects:r,refresh:p}=s(),m=c(),h=(r||[]).map(e=>({name:e.name,label:e.label||e.name,icon:e.icon,selected:!1})),g=(0,u.useCallback)(()=>{try{let e=localStorage.getItem(f);if(e)return JSON.parse(e)}catch{}},[]),_=(0,u.useCallback)(async t=>{try{let r=n(t),a=m?.getClient();a&&await a.meta.saveItem(`app`,t.name,r),localStorage.removeItem(f),i.success(`Application "${t.title}" created successfully`),await p?.(),e(`/apps/${t.name}`)}catch(e){i.error(e?.message||`Failed to create application`)}},[e,p,m]),v=(0,u.useCallback)(()=>{e(t?`/apps/${t}`:`/`)},[e,t]),y=(0,u.useCallback)(e=>{try{localStorage.setItem(f,JSON.stringify(e)),i.info(`Draft saved`)}catch{}},[]);return(0,d.jsx)(`div`,{className:`mx-auto max-w-4xl py-8 px-4`,"data-testid":`create-app-page`,children:(0,d.jsx)(l,{availableObjects:h,initialDraft:g(),onComplete:_,onCancel:v,onSaveDraft:y})})}export{p as CreateAppPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as e}from"./plugins-core-B8C8BUw8.js";export{e as CurrencyField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Ct as r,kl as i}from"./plugins-core-B8C8BUw8.js";import{l as a,u as o}from"./ui-layout-CvxBdH1V.js";import{n as s}from"./MetadataProvider-B6Zo_H9g.js";import{n as c}from"./AdapterProvider-BMMNYOio.js";import{o as l}from"./src-CZnjIqJM.js";var u=e(n(),1),d=t();function f(){let e=a(),{dashboardName:t}=o(),n=c(),{dashboards:f,refresh:p}=s(),m=f?.find(e=>e.name===t),[h,g]=(0,u.useState)(()=>m||{type:`dashboard`,name:t??``,title:t??``,columns:2,widgets:[]}),_=(0,u.useRef)(h);_.current=h;let v=(0,u.useCallback)(async e=>{try{if(n)return await n.update(`sys_dashboard`,t,e),p().catch(()=>{}),!0}catch{}return!1},[n,t,p]),y=(0,u.useCallback)(async e=>{g(e),await v(e)},[v]);(0,u.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key===`s`&&(e.preventDefault(),v(_.current).then(e=>{e&&r.success(`Dashboard saved`)}))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v]);let b=(0,u.useCallback)(e=>{let n=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=`${t||`dashboard`}.json`,a.click(),URL.revokeObjectURL(i),r.success(`Dashboard schema exported`)},[t]),x=(0,u.useCallback)(e=>{r.success(`Dashboard schema imported`),y(e)},[y]);return m?(0,d.jsxs)(`div`,{className:`h-full flex flex-col`,"data-testid":`dashboard-design-page`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 sm:px-6`,children:[(0,d.jsx)(`button`,{type:`button`,onClick:()=>e(-1),className:`rounded p-1.5 text-muted-foreground hover:text-foreground`,"aria-label":`Go back`,"data-testid":`dashboard-design-back`,children:(0,d.jsx)(i,{className:`h-4 w-4`})}),(0,d.jsxs)(`h1`,{className:`text-lg font-semibold tracking-tight truncate`,children:[`Edit Dashboard: `,m.label||m.title||t]})]}),(0,d.jsx)(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6`,children:(0,d.jsx)(l,{schema:h,onChange:y,onExport:b,onImport:x})})]}):(0,d.jsxs)(`div`,{className:`h-full flex items-center justify-center text-muted-foreground`,children:[`Dashboard "`,t,`" not found`]})}export{f as DashboardDesignPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{a as t,k as n,z as r}from"./framework-B0ex8RpF.js";import{Cc as i,Hs as a,Xo as o,_l as s,ct as ee,fs as c,hl as l,lt as te,ps as u,qs as d,ut as f,vl as p,vs as m,wc as h}from"./plugins-core-B8C8BUw8.js";import{u as g}from"./ui-layout-CvxBdH1V.js";import{n as _}from"./MetadataProvider-B6Zo_H9g.js";import{n as v}from"./AdapterProvider-BMMNYOio.js";import{n as y}from"./utils-auqIw3t-.js";import{a as b,i as x,r as S}from"./plugins-views-Csz847hc.js";import{r as C,t as w}from"./MetadataInspector-DAb5pYOH.js";import{n as T}from"./skeletons-Dxs6Di3L.js";var E=e(r(),1),D=n(),O=[{type:`metric`,label:`KPI Metric`,Icon:c},{type:`bar`,label:`Bar Chart`,Icon:p},{type:`line`,label:`Line Chart`,Icon:s},{type:`pie`,label:`Pie Chart`,Icon:l},{type:`table`,label:`Table`,Icon:m},{type:`grid`,label:`Grid`,Icon:i}],k=0;function A(){return k+=1,`widget_${Date.now()}_${k}`}function j(e){return!e.widgets?.length||!e.widgets.some(e=>!e.id)?e:{...e,widgets:e.widgets.map(e=>e.id?e:{...e,id:A()})}}function M(e){let t=O.find(t=>t.type===e);return t?`New ${t.label}`:`New Widget`}function N(e){return{title:e.title??``,description:e.description??``,type:e.type??`metric`,object:e.object??``,categoryField:e.categoryField??``,valueField:e.valueField??``,aggregate:e.aggregate??`count`,layoutW:e.layout?.w??1,layoutH:e.layout?.h??1,colorVariant:e.colorVariant??`default`,actionUrl:e.actionUrl??``}}function P(e,t){return{title:e.title,description:e.description,type:e.type,object:e.object,categoryField:e.categoryField,valueField:e.valueField,aggregate:e.aggregate,layout:{...t.layout||{},w:e.layoutW,h:e.layoutH},colorVariant:e.colorVariant,actionUrl:e.actionUrl}}function F(e){return{columns:e.columns??3,gap:e.gap??4,rowHeight:String(e.rowHeight??`120`),refreshInterval:String(e.refreshInterval??`0`),title:e.title??``,showDescription:e.showDescription??!0,theme:e.theme??`auto`}}function I({dataSource:e}){let{dashboardName:n}=g(),{showDebug:r}=C(),i=v(),{t:s}=t(),[c,l]=(0,E.useState)(!0),[p,m]=(0,E.useState)(!1),[k,I]=(0,E.useState)(null),[L,R]=(0,E.useState)(0);(0,E.useEffect)(()=>{l(!0),W(null),m(!1),I(null),queueMicrotask(()=>l(!1))},[n]);let{dashboards:z,objects:B,refresh:V}=_(),H=z?.find(e=>e.name===n),[U,W]=(0,E.useState)(null);(0,E.useEffect)(()=>{p||W(null)},[H]);let G=(0,E.useCallback)(async e=>{try{i&&(await i.update(`sys_dashboard`,n,e),V().catch(()=>{}))}catch(e){console.warn(`[DashboardView] Auto-save failed:`,e)}},[i,n,V]),K=(0,E.useCallback)(()=>{W(j(H)),m(!0),R(e=>e+1)},[H]),q=(0,E.useCallback)(()=>{m(!1),I(null)},[]),J=(0,E.useCallback)(e=>{if(!U)return;let t=A(),n={id:t,title:M(e),type:e,layout:{x:0,y:U.widgets?.length??0,w:U.columns??2,h:1}},r={...U,widgets:[...U.widgets||[],n]};W(r),G(r),I(t),R(e=>e+1)},[U,G]),Y=(0,E.useCallback)(e=>{if(!U)return;let t={...U,widgets:U.widgets.filter(t=>t.id!==e)};W(t),G(t),k===e&&I(null)},[U,k,G]),X=(0,E.useMemo)(()=>F(U||H),[L]),Z=(0,E.useCallback)(e=>{if(!U)return;let t={...U,columns:e.columns,gap:e.gap,rowHeight:e.rowHeight,refreshInterval:Number(e.refreshInterval)||0,title:e.title,showDescription:e.showDescription,theme:e.theme};W(t),G(t),R(e=>e+1)},[U,G]),ne=(0,E.useCallback)((e,t)=>{U&&W(n=>n&&(e===`refreshInterval`?{...n,refreshInterval:Number(t)||0}:{...n,[e]:t}))},[U]),Q=U?.widgets?.find(e=>e.id===k),re=(0,E.useMemo)(()=>Q?N(Q):{},[k,L]),ie=(0,E.useCallback)(e=>{if(!U||!k||!Q)return;let t=P(e,Q),n={...U,widgets:U.widgets.map(e=>e.id===k?{...e,...t}:e)};W(n),G(n),R(e=>e+1)},[U,k,Q,G]),ae=(0,E.useCallback)((e,t)=>{k&&W(n=>{if(!n)return n;let r=n.widgets?.find(e=>e.id===k);if(!r)return n;let i=N(r);i[e]=t;let a=P(i,r);return{...n,widgets:n.widgets.map(e=>e.id===k?{...e,...a}:e)}})},[k]),oe=(0,E.useMemo)(()=>{if(B?.length)return B.map(e=>({value:e.name,label:e.label||e.name}))},[B]),se=(0,E.useMemo)(()=>{let e=Q?.object;if(!e||!B?.length)return;let t=B.find(t=>t.name===e);if(!t?.fields)return;let n=t.fields;return Array.isArray(n)?n.filter(e=>e.name).map(e=>({value:e.name,label:e.label||e.name})):Object.entries(n).map(([e,t])=>({value:e,label:t.label||e}))},[Q?.object,B]);if(c)return(0,D.jsx)(T,{});if(!H)return(0,D.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,D.jsxs)(ee,{children:[(0,D.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,D.jsx)(h,{className:`h-6 w-6 text-muted-foreground`})}),(0,D.jsx)(f,{children:`Dashboard Not Found`}),(0,D.jsxs)(te,{children:[`The dashboard "`,n,`" could not be found. It may have been removed or renamed.`]})]})});let $=U||H;return(0,D.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-background`,children:[(0,D.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:[(0,D.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,D.jsx)(`h1`,{className:`text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate`,children:y(H.label,s)||H.name}),H.description&&(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:y(H.description,s)})]}),(0,D.jsxs)(`div`,{className:`shrink-0 flex items-center gap-1.5`,children:[p&&(0,D.jsx)(`div`,{className:`flex items-center gap-1 mr-2`,role:`toolbar`,"aria-label":`Add widgets`,"data-testid":`dashboard-widget-toolbar`,children:O.map(({type:e,label:t,Icon:n})=>(0,D.jsxs)(`button`,{type:`button`,"data-testid":`dashboard-add-${e}`,onClick:()=>J(e),className:`inline-flex items-center gap-1 rounded-md border border-input bg-background px-2 py-1.5 text-[11px] font-medium text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,title:`Add ${t}`,"aria-label":`Add ${t} widget`,children:[(0,D.jsx)(a,{className:`h-3 w-3`}),(0,D.jsx)(n,{className:`h-3 w-3`})]},e))}),(0,D.jsxs)(`button`,{type:`button`,onClick:K,className:`inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-2.5 py-1.5 text-xs font-medium text-muted-foreground shadow-sm hover:bg-accent hover:text-accent-foreground`,"data-testid":`dashboard-edit-button`,children:[(0,D.jsx)(d,{className:`h-3.5 w-3.5`}),`Edit`]})]})]}),(0,D.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col sm:flex-row relative`,children:[(0,D.jsx)(`div`,{className:`flex-1 min-w-0 overflow-auto p-2 sm:p-4 md:p-6`,children:(0,D.jsx)(b,{schema:$,dataSource:e,designMode:p,selectedWidgetId:k,onWidgetClick:I})}),Q?(0,D.jsx)(S,{open:p,onClose:q,config:re,onSave:ie,onFieldChange:ae,availableObjects:oe,availableFields:se,headerExtra:(0,D.jsx)(o,{size:`sm`,variant:`ghost`,onClick:()=>Y(k),className:`h-7 w-7 p-0 text-destructive hover:text-destructive`,"data-testid":`widget-delete-button`,title:`Delete widget`,children:(0,D.jsx)(u,{className:`h-3.5 w-3.5`})})},k):(0,D.jsx)(x,{open:p,onClose:q,config:X,onSave:Z,onFieldChange:ne}),(0,D.jsx)(w,{open:r,sections:[{title:`Dashboard Configuration`,data:$}]})]})]})}export{I as DashboardView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{et as e}from"./plugins-core-B8C8BUw8.js";export{e as DateField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as e}from"./plugins-core-B8C8BUw8.js";export{e as DateTimeField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,n,z as r}from"./framework-B0ex8RpF.js";import{Ct as i}from"./plugins-core-B8C8BUw8.js";import{l as a,u as o}from"./ui-layout-CvxBdH1V.js";import{n as s}from"./MetadataProvider-B6Zo_H9g.js";import{n as c}from"./AdapterProvider-BMMNYOio.js";import{c as l}from"./src-CZnjIqJM.js";var u=e(r(),1),d=t();function f(){let e=a(),{appName:t,editAppName:r}=o(),{apps:f,objects:p,refresh:m}=s(),h=c(),g=r||t,_=f.find(e=>e.name===g),v=(p||[]).map(e=>({name:e.name,label:e.label||e.name,icon:e.icon,selected:_?.navigation?.some(t=>t.type===`object`&&t.objectName===e.name)??!1})),y=(0,u.useMemo)(()=>{if(_)return{name:_.name,title:_.title||_.label||``,description:_.description||``,icon:_.icon||``,layout:_.layout||`sidebar`,navigation:_.navigation||[],branding:{logo:_.branding?.logo||_.logo||``,primaryColor:_.branding?.primaryColor||`#3b82f6`,favicon:_.branding?.favicon||_.favicon||``}}},[_]),b=(0,u.useCallback)(async t=>{try{let r=n(t),a={..._,...r},o=h?.getClient();o&&await o.meta.saveItem(`app`,t.name,a),i.success(`Application "${t.title}" updated successfully`),await m?.(),e(`/apps/${t.name}`)}catch(e){i.error(e?.message||`Failed to update application`)}},[e,m,h,_]),x=(0,u.useCallback)(()=>{e(t?`/apps/${t}`:`/`)},[e,t]),S=(0,u.useCallback)(e=>{try{localStorage.setItem(`objectui-edit-draft-${g}`,JSON.stringify(e)),i.info(`Draft saved`)}catch{}},[g]);return _?(0,d.jsx)(`div`,{className:`mx-auto max-w-4xl py-8 px-4`,"data-testid":`edit-app-page`,children:(0,d.jsx)(l,{availableObjects:v,initialDraft:y,onComplete:b,onCancel:x,onSaveDraft:S})}):(0,d.jsx)(`div`,{className:`mx-auto max-w-4xl py-8 px-4 text-center`,"data-testid":`edit-app-not-found`,children:(0,d.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Application "`,g,`" not found.`]})})}export{f as EditAppPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e}from"./plugins-core-B8C8BUw8.js";export{e as EmailField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as e}from"./plugins-core-B8C8BUw8.js";export{e as FileField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,k as t}from"./framework-B0ex8RpF.js";import{i as n}from"./ui-layout-CvxBdH1V.js";import{i as r}from"./infrastructure-88EEJ8ZY.js";import{t as i}from"./AuthPageLayout-BxIX5ebE.js";var a=t(),o=({href:e,className:t,children:r})=>(0,a.jsx)(n,{to:e,className:t,children:r});function s(){let{t}=e();return(0,a.jsx)(i,{children:(0,a.jsx)(r,{loginUrl:`/login`,title:t(`auth.forgotPassword.title`),description:t(`auth.forgotPassword.description`),linkComponent:o,labels:{emailLabel:t(`auth.forgotPassword.emailLabel`),emailPlaceholder:t(`auth.forgotPassword.emailPlaceholder`),submitButton:t(`auth.forgotPassword.submitButton`),submittingButton:t(`auth.forgotPassword.submittingButton`),successTitle:t(`auth.forgotPassword.successTitle`),successDescription:t(`auth.forgotPassword.successDescription`),backToSignInText:t(`auth.forgotPassword.backToSignInText`),rememberPasswordText:t(`auth.forgotPassword.rememberPasswordText`),signInText:t(`auth.forgotPassword.signInText`)}})})}export{s as ForgotPasswordPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"./plugins-core-B8C8BUw8.js";export{e as FormulaField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e}from"./plugins-core-B8C8BUw8.js";export{e as GeolocationField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as e}from"./plugins-core-B8C8BUw8.js";export{e as GridField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{n as r}from"./ui-layout-CvxBdH1V.js";import{a as i,n as a,s as o,t as s}from"./useResponsiveSidebar-DB8TNfQv.js";var c=e(n(),1),l=t();function u({children:e}){return s(),(0,l.jsx)(l.Fragment,{children:e})}function d({children:e}){let{setContext:t}=o();return(0,c.useEffect)(()=>{t(`home`)},[t]),(0,l.jsx)(r,{sidebar:(0,l.jsx)(i,{}),navbar:(0,l.jsx)(a,{appName:`Home`,objects:[],connectionState:`connected`}),className:`p-0 overflow-hidden bg-muted/5`,children:(0,l.jsx)(u,{children:e})})}export{d as HomeLayout};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,k as t}from"./framework-B0ex8RpF.js";import{Hs as n,Io as r,Ml as i,To as a,Xo as o,Zc as s,bs as c,ct as l,js as u,lt as d,rl as f,ut as p,wo as m,xs as h}from"./plugins-core-B8C8BUw8.js";import{l as g}from"./ui-layout-CvxBdH1V.js";import{n as _}from"./MetadataProvider-B6Zo_H9g.js";import{n as v,r as y}from"./useFavorites--Hq-4pMF.js";import{n as b,t as x}from"./utils-auqIw3t-.js";import{t as S}from"./getIcon-DUhh_MlU.js";var C=t();function w(){let t=g(),{t:r}=e(),o=[{id:`create-app`,label:r(`home.quickActions.createApp`,{defaultValue:`Create App`}),description:r(`home.quickActions.createAppDesc`,{defaultValue:`Start with a new application`}),icon:n,href:`/create-app`,color:`text-blue-600 dark:text-blue-400`},{id:`manage-objects`,label:r(`home.quickActions.manageObjects`,{defaultValue:`Manage Objects`}),description:r(`home.quickActions.manageObjectsDesc`,{defaultValue:`Configure data models`}),icon:s,href:`/system/metadata/object`,color:`text-purple-600 dark:text-purple-400`},{id:`system-settings`,label:r(`home.quickActions.systemSettings`,{defaultValue:`System Settings`}),description:r(`home.quickActions.systemSettingsDesc`,{defaultValue:`Configure your workspace`}),icon:u,href:`/system`,color:`text-gray-600 dark:text-gray-400`}];return(0,C.jsxs)(`section`,{children:[(0,C.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight mb-4`,children:r(`home.quickActions.title`,{defaultValue:`Quick Actions`})}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:o.map(e=>{let n=e.icon;return(0,C.jsx)(m,{className:`cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>t(e.href),"data-testid":`quick-action-${e.id}`,role:`link`,tabIndex:0,onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e.href))},"aria-label":e.label,children:(0,C.jsx)(a,{className:`p-6`,children:(0,C.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,C.jsx)(`div`,{className:i(`p-3 rounded-lg bg-muted`,e.color),children:(0,C.jsx)(n,{className:`h-6 w-6`})}),(0,C.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,C.jsx)(`h3`,{className:`font-semibold text-base mb-1`,children:e.label}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description})]})]})})},e.id)})})]})}function T({app:t,onClick:n,isFavorite:s}){let{t:l}=e(),{toggleFavorite:u}=v(),d=S(t.icon),f=b(t.label,l)||t.name,p=b(t.description,l),g=t.branding?.primaryColor;return(0,C.jsx)(m,{className:`cursor-pointer hover:shadow-lg transition-all group relative`,onClick:n,"data-testid":`app-card-${t.name}`,children:(0,C.jsxs)(a,{className:`p-6`,children:[(0,C.jsx)(o,{variant:`ghost`,size:`sm`,className:`absolute top-2 right-2 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-opacity`,onClick:e=>{e.stopPropagation(),u({id:`app:${t.name}`,label:f,href:`/apps/${t.name}`,type:`object`})},"aria-label":s?`Remove ${f} from favorites`:`Add ${f} to favorites`,"aria-pressed":s,"data-testid":`favorite-btn-${t.name}`,children:s?(0,C.jsx)(c,{className:`h-4 w-4 fill-yellow-400 text-yellow-400`}):(0,C.jsx)(h,{className:`h-4 w-4`})}),(0,C.jsx)(`div`,{className:i(`inline-flex p-3 rounded-lg mb-4`,g?``:`bg-primary/10`),style:g?{backgroundColor:`${g}20`}:{},children:(0,C.jsx)(d,{className:`h-8 w-8`,style:g?{color:g}:{}})}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h3`,{className:`font-semibold text-lg mb-1`,children:f}),p&&(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:p}),!p&&(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l(`home.appCard.noDescription`,{defaultValue:`No description`})})]}),t.isDefault&&(0,C.jsx)(`div`,{className:`mt-3`,children:(0,C.jsx)(r,{variant:`secondary`,children:l(`home.appCard.default`,{defaultValue:`Default`})})})]})})}function E({items:t}){let n=g(),{t:r}=e();return t.length===0?null:(0,C.jsxs)(`section`,{children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,C.jsx)(f,{className:`h-5 w-5 text-muted-foreground`}),(0,C.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:r(`home.recentApps.title`,{defaultValue:`Recently Accessed`})})]}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4`,children:t.map(e=>{let t=S(e.type);return(0,C.jsx)(m,{className:`cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>n(e.href),"data-testid":`recent-item-${e.id}`,role:`link`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.href))},children:(0,C.jsx)(a,{className:`p-4`,children:(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(`div`,{className:`p-2 rounded-lg bg-muted shrink-0`,children:(0,C.jsx)(t,{className:`h-5 w-5`})}),(0,C.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,C.jsx)(`h3`,{className:`font-medium text-sm truncate`,children:e.label}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x(e.type)})]})]})})},e.id)})})]})}function D({items:t}){let n=g(),{t:r}=e();return t.length===0?null:(0,C.jsxs)(`section`,{children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,C.jsx)(c,{className:`h-5 w-5 text-yellow-500 fill-yellow-500`}),(0,C.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:r(`home.starredApps.title`,{defaultValue:`Starred`})})]}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4`,children:t.map(e=>{let t=S(e.type);return(0,C.jsx)(m,{className:`cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>n(e.href),"data-testid":`starred-item-${e.id}`,role:`link`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.href))},children:(0,C.jsx)(a,{className:`p-4`,children:(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(`div`,{className:`p-2 rounded-lg bg-muted shrink-0`,children:(0,C.jsx)(t,{className:`h-5 w-5`})}),(0,C.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,C.jsx)(`h3`,{className:`font-medium text-sm truncate`,children:e.label}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x(e.type)})]})]})})},e.id)})})]})}function O(){let t=g(),{t:r}=e(),{apps:i,loading:a}=_(),{recentItems:s}=y(),{favorites:c}=v(),f=i.filter(e=>e.active!==!1),m=s.filter(e=>e.type===`object`||e.type===`dashboard`||e.type===`page`).slice(0,6),h=c.filter(e=>e.type===`object`||e.type===`dashboard`||e.type===`page`).slice(0,8);return a?(0,C.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-20`,children:(0,C.jsx)(`div`,{className:`text-muted-foreground`,children:`Loading workspace...`})}):f.length===0?(0,C.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6`,children:(0,C.jsxs)(l,{children:[(0,C.jsx)(p,{children:`Welcome to ObjectUI`}),(0,C.jsx)(d,{children:`Get started by creating your first application or configure your system settings.`}),(0,C.jsxs)(`div`,{className:`mt-6 flex flex-col sm:flex-row items-center gap-3`,children:[(0,C.jsxs)(o,{onClick:()=>t(`/create-app`),"data-testid":`create-first-app-btn`,children:[(0,C.jsx)(n,{className:`mr-2 h-4 w-4`}),`Create Your First App`]}),(0,C.jsxs)(o,{variant:`outline`,onClick:()=>t(`/system`),"data-testid":`go-to-settings-btn`,children:[(0,C.jsx)(u,{className:`mr-2 h-4 w-4`}),`System Settings`]})]})]})}):(0,C.jsxs)(`div`,{className:`bg-background`,children:[(0,C.jsxs)(`div`,{className:`px-4 sm:px-6 pt-6 pb-4`,children:[(0,C.jsx)(`h1`,{className:`text-2xl sm:text-3xl font-bold tracking-tight`,children:r(`home.title`,{defaultValue:`Home`})}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:r(`home.subtitle`,{defaultValue:`Your workspace dashboard`})})]}),(0,C.jsxs)(`div`,{className:`px-4 sm:px-6 py-4 space-y-8`,children:[(0,C.jsx)(w,{}),h.length>0&&(0,C.jsx)(D,{items:h}),m.length>0&&(0,C.jsx)(E,{items:m}),(0,C.jsxs)(`section`,{children:[(0,C.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight mb-4`,children:r(`home.allApps`,{defaultValue:`All Applications`})}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4`,children:f.map(e=>(0,C.jsx)(T,{app:e,onClick:()=>t(`/apps/${e.name}`),isFavorite:c.some(t=>t.id===`app:${e.name}`)},e.name))})]})]})]})}export{O as HomePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as e}from"./plugins-core-B8C8BUw8.js";export{e as ImageField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Do as r,Eo as i,Hs as a,Io as o,Oo as s,To as c,Xo as l,_ as u,b as d,c as f,d as p,dl as m,ds as h,f as g,l as _,m as v,pl as y,r as b,s as x,sn as S,u as C,v as w,wo as T,y as E}from"./plugins-core-B8C8BUw8.js";var D=e(n(),1),O=t(),k=(...e)=>e.filter(Boolean).join(` `);function A(e,t){if(!t||t.length===0)return{};for(let n of t){let t=e[n.field];if(t==null)continue;let r=!1,i=String(t);switch(n.operator){case`equals`:r=i===String(n.value);break;case`not_equals`:r=i!==String(n.value);break;case`contains`:r=i.toLowerCase().includes(String(n.value).toLowerCase());break;case`in`:r=Array.isArray(n.value)&&n.value.includes(i);break}if(r)return{...n.backgroundColor?{backgroundColor:n.backgroundColor}:{},...n.borderColor?{borderColor:n.borderColor}:{}}}return{}}function j({card:e,conditionalFormatting:t}){let{attributes:n,listeners:a,setNodeRef:l,transform:u,transition:f,isDragging:p}=_({id:e.id}),m={transform:d.Transform.toString(u),transition:f,opacity:p?.5:void 0},h=A(e,t);return(0,O.jsx)(`div`,{ref:l,style:m,...n,...a,children:(0,O.jsxs)(T,{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`,style:h,children:[e.coverImage&&(0,O.jsx)(`div`,{className:`w-full h-32 overflow-hidden rounded-t-lg`,children:(0,O.jsx)(`img`,{src:e.coverImage,alt:``,className:`w-full h-full object-cover`,loading:`lazy`})}),(0,O.jsxs)(r,{className:`p-4`,children:[(0,O.jsx)(s,{className:`text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors`,children:e.title}),e.description&&(0,O.jsx)(i,{className:`text-xs text-muted-foreground font-mono`,children:e.description})]}),e.badges&&e.badges.length>0&&(0,O.jsx)(c,{className:`p-4 pt-0`,children:(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.badges.map((e,t)=>(0,O.jsx)(o,{variant:e.variant||`default`,className:`text-xs`,children:e.label},t))})})]})})}function M({cards:e,parentRef:t,conditionalFormatting:n}){let r=b({count:e.length,getScrollElement:()=>t.current,estimateSize:()=>120,overscan:5});return(0,O.jsx)(`div`,{style:{height:`${r.getTotalSize()}px`,width:`100%`,position:`relative`},children:r.getVirtualItems().map(t=>{let r=e[t.index];return(0,O.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${t.start}px)`},children:(0,O.jsx)(j,{card:r,conditionalFormatting:n})},r.id)})})}function N({columnId:e,onAdd:t}){let[n,r]=D.useState(!1),[i,o]=D.useState(``),s=D.useRef(null),c=()=>{let n=i.trim();n&&(t(e,n),o(``)),r(!1)};return n?(0,O.jsx)(`div`,{className:`mt-2 space-y-2`,children:(0,O.jsx)(S,{ref:s,value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),c()):e.key===`Escape`&&(o(``),r(!1))},onBlur:c,placeholder:`Enter card title...`,className:`text-sm`,autoFocus:!0})}):(0,O.jsxs)(l,{variant:`ghost`,size:`sm`,className:`w-full mt-2 text-muted-foreground hover:text-foreground`,onClick:()=>{r(!0),setTimeout(()=>s.current?.focus(),0)},children:[(0,O.jsx)(a,{className:`h-4 w-4 mr-1`}),`Add Card`]})}function P({column:e,cards:t,onToggle:n,enableVirtual:r,quickAdd:i,onQuickAdd:a,conditionalFormatting:s}){let c=t||[],u=D.useRef(null),{setNodeRef:d}=_({id:e.id,data:{type:`column`}}),f=e.limit&&c.length>=e.limit,p=e.limit&&c.length>=e.limit*.8;return(0,O.jsxs)(`div`,{ref:d,className:k(`flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all`,e.collapsed?`w-16`:`w-80`,e.className),children:[(0,O.jsxs)(`div`,{className:`p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:[(0,O.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0`,onClick:()=>n(!e.collapsed),children:e.collapsed?(0,O.jsx)(m,{className:`h-4 w-4`}):(0,O.jsx)(y,{className:`h-4 w-4`})}),!e.collapsed&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{className:`font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate`,children:e.title}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:k(`font-mono text-xs`,f?`text-destructive`:p?`text-yellow-500`:`text-muted-foreground`),children:[c.length,e.limit&&` / ${e.limit}`]}),f&&(0,O.jsx)(o,{variant:`destructive`,className:`text-xs`,children:`Full`}),p&&!f&&(0,O.jsx)(h,{className:`h-3 w-3 text-yellow-500`})]})]})]}),e.collapsed&&(0,O.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,O.jsx)(`span`,{className:`font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180`,children:e.title}),(0,O.jsx)(o,{variant:`secondary`,className:`text-xs`,children:c.length})]})]}),!e.collapsed&&(0,O.jsxs)(`div`,{ref:u,className:`flex-1 p-4 overflow-y-auto`,style:{maxHeight:`600px`},children:[(0,O.jsx)(x,{items:c.map(e=>e.id),strategy:C,children:r?(0,O.jsx)(M,{cards:c,parentRef:u,conditionalFormatting:s}):(0,O.jsx)(`div`,{className:`space-y-2`,children:c.map(e=>(0,O.jsx)(j,{card:e,conditionalFormatting:s},e.id))})}),i&&a&&(0,O.jsx)(N,{columnId:e.id,onAdd:a})]})]})}function F({columns:e,onCardMove:t,onColumnToggle:n,enableVirtualScrolling:r=!1,virtualScrollThreshold:i=50,className:a,quickAdd:o,onQuickAdd:s,conditionalFormatting:c}){let[l,d]=D.useState(null),m=D.useMemo(()=>(e||[]).map(e=>({...e,cards:e.cards||[]})),[e]),[h,_]=D.useState(m);D.useEffect(()=>{_(m)},[m]);let y=E(w(v,{activationConstraint:{distance:8}})),b=e=>{let{active:t}=e;d(S(t.id))},x=e=>{let{active:n,over:r}=e;if(d(null),!r)return;let i=n.id,a=r.id;if(i===a)return;let o=C(i),s=C(a)||T(a);if(!(!o||!s))if(o.id===s.id){let e=[...o.cards],t=f(e,e.findIndex(e=>e.id===i),e.findIndex(e=>e.id===a));_(e=>e.map(e=>e.id===o.id?{...e,cards:t}:e))}else{let e=[...o.cards],n=[...s.cards],r=e.findIndex(e=>e.id===i),c=a===s.id?n.length:n.findIndex(e=>e.id===a),[l]=e.splice(r,1);n.splice(c,0,l),_(t=>t.map(t=>t.id===o.id?{...t,cards:e}:t.id===s.id?{...t,cards:n}:t)),t&&t(i,o.id,s.id,c)}},S=D.useCallback(e=>{for(let t of h){let n=t.cards.find(t=>t.id===e);if(n)return n}return null},[h]),C=D.useCallback(e=>h.find(t=>t.cards.some(t=>t.id===e))||null,[h]),T=D.useCallback(e=>h.find(t=>t.id===e)||null,[h]),A=D.useCallback((e,t)=>{_(n=>n.map(n=>n.id===e?{...n,collapsed:t}:n)),n?.(e,t)},[n]);return(0,O.jsxs)(p,{sensors:y,collisionDetection:u,onDragStart:b,onDragEnd:x,children:[(0,O.jsx)(`div`,{className:k(`flex gap-4 overflow-x-auto p-4`,a),children:h.map(e=>{let t=r&&e.cards.length>i;return(0,O.jsx)(P,{column:e,cards:e.cards,onToggle:t=>A(e.id,t),enableVirtual:t,quickAdd:o,onQuickAdd:s,conditionalFormatting:c},e.id)})}),(0,O.jsx)(g,{children:l?(0,O.jsx)(j,{card:l,conditionalFormatting:c}):null})]})}export{F as KanbanEnhanced,F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{d as t,f as n,k as r,z as i}from"./framework-B0ex8RpF.js";import{Do as a,Eo as o,Hs as s,Io as c,Oo as l,To as u,Xo as d,_ as f,b as p,c as m,d as h,f as g,h as _,l as v,m as y,rn as b,s as x,sn as S,u as C,v as w,wo as T,y as E}from"./plugins-core-B8C8BUw8.js";var D=e(i(),1),O=r(),k=(...e)=>e.filter(Boolean).join(` `),A=`Uncategorized`;function j(e,t){if(!t||t.length===0)return{};for(let n of t){let t=e[n.field];if(t==null)continue;let r=!1,i=String(t);switch(n.operator){case`equals`:r=i===String(n.value);break;case`not_equals`:r=i!==String(n.value);break;case`contains`:r=i.toLowerCase().includes(String(n.value).toLowerCase());break;case`in`:r=Array.isArray(n.value)&&n.value.includes(i);break}if(r)return{...n.backgroundColor?{backgroundColor:n.backgroundColor}:{},...n.borderColor?{borderColor:n.borderColor}:{}}}return{}}function M({card:e,onCardClick:t,conditionalFormatting:n}){let{attributes:r,listeners:i,setNodeRef:s,transform:d,transition:f,isDragging:m}=v({id:e.id}),h={transform:p.Transform.toString(d),transition:f,opacity:m?.5:void 0},g=j(e,n);return(0,O.jsx)(`div`,{ref:s,style:h,...r,...i,role:`listitem`,"aria-label":e.title,onClick:()=>t?.(e),children:(0,O.jsxs)(T,{className:`mb-2 cursor-grab active:cursor-grabbing border-border border-l-4 border-l-primary/40 bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group touch-manipulation`,style:g,children:[e.coverImage&&(0,O.jsx)(`div`,{className:`w-full h-32 overflow-hidden rounded-t-lg`,children:(0,O.jsx)(`img`,{src:e.coverImage,alt:``,className:`w-full h-full object-cover`,loading:`lazy`})}),(0,O.jsxs)(a,{className:`p-2 sm:p-4`,children:[(0,O.jsx)(l,{className:`text-xs sm:text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors`,children:e.title}),e.description&&(0,O.jsx)(o,{className:`text-xs text-muted-foreground font-mono line-clamp-2 sm:line-clamp-none`,children:e.description})]}),e.badges&&e.badges.length>0&&(0,O.jsx)(u,{className:`p-2 sm:p-4 pt-0`,children:(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.badges.map((e,t)=>(0,O.jsx)(c,{variant:e.variant||`default`,className:`text-xs`,children:e.label},t))})})]})})}function N({columnId:e,onAdd:t}){let[n,r]=D.useState(!1),[i,a]=D.useState(``),o=D.useRef(null),c=()=>{let n=i.trim();n&&(t(e,n),a(``)),r(!1)};return n?(0,O.jsx)(`div`,{className:`mt-2 space-y-2`,children:(0,O.jsx)(S,{ref:o,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),c()):e.key===`Escape`&&(a(``),r(!1))},onBlur:c,placeholder:`Enter card title...`,className:`text-sm`,autoFocus:!0})}):(0,O.jsxs)(d,{variant:`ghost`,size:`sm`,className:`w-full mt-2 text-muted-foreground hover:text-foreground`,onClick:()=>{r(!0),setTimeout(()=>o.current?.focus(),0)},children:[(0,O.jsx)(s,{className:`h-4 w-4 mr-1`}),`Add Card`]})}function P({column:e,cards:t,onCardClick:n,quickAdd:r,onQuickAdd:i,conditionalFormatting:a}){let o=t||[],{setNodeRef:s}=v({id:e.id,data:{type:`column`}}),l=e.limit&&o.length>=e.limit;return(0,O.jsxs)(`div`,{ref:s,role:`group`,"aria-label":e.title,className:k(`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`,e.className),children:[(0,O.jsx)(`div`,{className:`p-3 sm:p-4 border-b border-border/50 bg-muted/30 rounded-t-lg`,children:(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsx)(`h3`,{id:`kanban-col-${e.id}`,className:`font-mono text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase truncate`,children:e.title}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(c,{variant:`secondary`,className:`text-xs font-mono tabular-nums`,children:[o.length,e.limit&&` / ${e.limit}`]}),l&&(0,O.jsx)(c,{variant:`destructive`,className:`text-xs`,children:`Full`})]})]})}),(0,O.jsxs)(b,{className:`flex-1 p-4`,children:[(0,O.jsx)(x,{items:o.map(e=>e.id),strategy:C,children:(0,O.jsxs)(`div`,{className:`space-y-2`,role:`list`,"aria-label":`${e.title} cards`,children:[o.length===0&&(0,O.jsx)(`div`,{className:`flex flex-col items-center justify-center py-8 text-muted-foreground/50`,children:(0,O.jsx)(`span`,{className:`text-xs font-mono`,children:`No cards`})}),o.map(e=>(0,O.jsx)(M,{card:e,onCardClick:n,conditionalFormatting:a},e.id))]})}),r&&i&&(0,O.jsx)(N,{columnId:e.id,onAdd:i})]})]})}function F({children:e}){return(0,O.jsx)(O.Fragment,{children:e(t())})}function I({columns:e,onCardMove:t,onCardClick:r,className:i,quickAdd:a,onQuickAdd:o,coverImageField:s,conditionalFormatting:c,swimlaneField:l}){return n()?(0,O.jsx)(F,{children:n=>(0,O.jsx)(L,{columns:e,onCardMove:t,onCardClick:r,className:i,dnd:n,quickAdd:a,onQuickAdd:o,coverImageField:s,conditionalFormatting:c,swimlaneField:l})}):(0,O.jsx)(L,{columns:e,onCardMove:t,onCardClick:r,className:i,dnd:null,quickAdd:a,onQuickAdd:o,coverImageField:s,conditionalFormatting:c,swimlaneField:l})}function L({columns:e,onCardMove:t,onCardClick:n,className:r,dnd:i,quickAdd:a,onQuickAdd:o,coverImageField:s,conditionalFormatting:c,swimlaneField:l}){let[u,d]=D.useState(null),p=l?`objectui:kanban-collapsed:${l}`:null,[v,b]=D.useState(()=>{if(!p)return new Set;try{let e=localStorage.getItem(p);if(e){let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}}catch{}return new Set}),S=D.useMemo(()=>(e||[]).map(e=>({...e,cards:e.cards||[]})),[e]),[T,j]=D.useState(S);D.useEffect(()=>{j(S)},[S]);let N=D.useMemo(()=>{if(!l)return null;let e=T.flatMap(e=>e.cards),t=new Set;return e.forEach(e=>{let n=e[l];t.add(n==null?A:String(n))}),Array.from(t).sort()},[T,l]),F=D.useCallback(e=>{b(t=>{let n=new Set(t);if(n.has(e)?n.delete(e):n.add(e),p)try{localStorage.setItem(p,JSON.stringify([...n]))}catch{}return n})},[p]),I=E(w(y,{activationConstraint:{distance:5}}),w(_,{activationConstraint:{delay:200,tolerance:5}})),L=e=>{let{active:t}=e,n=z(t.id);if(d(n),i&&n){let e=B(n.id);e&&i.startDrag({id:n.id,type:`kanban-card`,data:n,sourceId:e.id})}},R=e=>{let{active:n,over:r}=e;if(d(null),!r){i&&i.endDrag();return}let a=n.id,o=r.id;if(a===o){i&&i.endDrag();return}let s=B(a),c=B(o)||V(o);if(!s||!c){i&&i.endDrag();return}if(s.id===c.id){let e=[...s.cards],t=m(e,e.findIndex(e=>e.id===a),e.findIndex(e=>e.id===o));j(e=>e.map(e=>e.id===s.id?{...e,cards:t}:e))}else{let e=[...s.cards],n=[...c.cards],r=e.findIndex(e=>e.id===a),i=o===c.id?n.length:n.findIndex(e=>e.id===o),[l]=e.splice(r,1);n.splice(i,0,l),j(t=>t.map(t=>t.id===s.id?{...t,cards:e}:t.id===c.id?{...t,cards:n}:t)),t&&t(a,s.id,c.id,i)}i&&i.endDrag(c.id)},z=D.useCallback(e=>{for(let t of T){let n=t.cards.find(t=>t.id===e);if(n)return n}return null},[T]),B=D.useCallback(e=>T.find(t=>t.cards.some(t=>t.id===e))||null,[T]),V=D.useCallback(e=>T.find(t=>t.id===e)||null,[T]);return(0,O.jsxs)(h,{sensors:I,collisionDetection:f,onDragStart:L,onDragEnd:R,children:[(0,O.jsxs)(`div`,{className:`flex sm:hidden items-center justify-between px-3 pb-2 text-xs text-muted-foreground`,children:[(0,O.jsxs)(`span`,{children:[T.length,` columns`]}),(0,O.jsx)(`span`,{children:`← Swipe to navigate →`})]}),N?(0,O.jsxs)(`div`,{className:k(`flex flex-col gap-1 p-2 sm:p-4 min-w-0 overflow-hidden`,r),role:`region`,"aria-label":`Kanban board with swimlanes`,children:[(0,O.jsx)(`div`,{className:`flex gap-3 sm:gap-4 pl-36 sm:pl-44 overflow-x-auto`,children:T.map(e=>(0,O.jsxs)(`div`,{className:`w-[85vw] sm:w-80 flex-shrink-0 text-center`,children:[(0,O.jsx)(`span`,{className:`font-mono text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase`,children:e.title}),(0,O.jsxs)(`span`,{className:`ml-2 font-mono text-xs text-muted-foreground`,children:[`(`,e.cards.length,`)`]})]},e.id))}),N.map(e=>{let t=v.has(e),r=T.reduce((t,n)=>t+n.cards.filter(t=>(t[l]==null?A:String(t[l]))===e).length,0);return(0,O.jsxs)(`div`,{className:`border rounded-lg bg-muted/10`,children:[(0,O.jsxs)(`button`,{className:`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-muted/30 transition-colors`,onClick:()=>F(e),"aria-expanded":!t,children:[(0,O.jsx)(`span`,{className:k(`transition-transform text-xs`,t?``:`rotate-90`),children:`▶`}),(0,O.jsx)(`span`,{className:`font-mono text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e}),(0,O.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`(`,r,`)`]})]}),!t&&(0,O.jsx)(`div`,{className:`flex gap-3 sm:gap-4 overflow-x-auto px-2 pb-3 pl-36 sm:pl-44`,children:T.map(t=>{let r=t.cards.filter(t=>(t[l]==null?A:String(t[l]))===e);return(0,O.jsx)(`div`,{className:`w-[85vw] sm:w-80 flex-shrink-0 min-h-[60px] rounded-md bg-card/20 p-2`,children:(0,O.jsx)(x,{items:r.map(e=>e.id),strategy:C,children:(0,O.jsx)(`div`,{className:`space-y-2`,role:`list`,"aria-label":`${t.title} - ${e} cards`,children:r.map(e=>(0,O.jsx)(M,{card:e,onCardClick:n,conditionalFormatting:c},e.id))})})},t.id)})})]},e)})]}):(0,O.jsx)(`div`,{className:k(`flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory p-2 sm:p-4 bg-muted/10 rounded-lg [-webkit-overflow-scrolling:touch] min-w-0`,r),role:`region`,"aria-label":`Kanban board`,children:T.map(e=>(0,O.jsx)(P,{column:e,cards:e.cards,onCardClick:n,quickAdd:a,onQuickAdd:o,conditionalFormatting:c},e.id))}),(0,O.jsx)(g,{children:(0,O.jsx)(`div`,{"aria-live":`assertive`,"aria-label":u?`Dragging ${u.title}`:void 0,children:u?(0,O.jsx)(M,{card:u,conditionalFormatting:c}):null})})]})}export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e}from"./plugins-core-B8C8BUw8.js";export{e as LocationField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,k as t}from"./framework-B0ex8RpF.js";import{i as n,l as r}from"./ui-layout-CvxBdH1V.js";import{o as i}from"./infrastructure-88EEJ8ZY.js";import{t as a}from"./AuthPageLayout-BxIX5ebE.js";var o=t(),s=({href:e,className:t,children:r})=>(0,o.jsx)(n,{to:e,className:t,children:r});function c(){let t=r(),{t:n}=e();return(0,o.jsx)(a,{children:(0,o.jsx)(i,{onSuccess:()=>t(`/`),registerUrl:`/register`,forgotPasswordUrl:`/forgot-password`,title:n(`auth.login.title`),description:n(`auth.login.description`),linkComponent:s,labels:{emailLabel:n(`auth.login.emailLabel`),emailPlaceholder:n(`auth.login.emailPlaceholder`),passwordLabel:n(`auth.login.passwordLabel`),passwordPlaceholder:n(`auth.login.passwordPlaceholder`),forgotPasswordText:n(`auth.login.forgotPasswordText`),submitButton:n(`auth.login.submitButton`),submittingButton:n(`auth.login.submittingButton`),noAccountText:n(`auth.login.noAccountText`),signUpText:n(`auth.login.signUpText`)}})})}export{c as LoginPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as e}from"./plugins-core-B8C8BUw8.js";export{e as LookupField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-Dw2cE7zH.js";import{k as e,z as t}from"./framework-B0ex8RpF.js";import{a as n,n as r,r as i,t as a}from"./lib-CQxQAzx9.js";var o=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],s={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...o,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...o],h2:[[`className`,`sr-only`]],img:[...o,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...o,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...o],table:[...o],ul:[...o,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},c={}.hasOwnProperty;function l(e,t){let n={type:`root`,children:[]},r=u({schema:t?{...s,...t}:s,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function u(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return d(e,n);case`doctype`:return f(e,n);case`element`:return p(e,n);case`root`:return m(e,n);case`text`:return h(e,n);default:}}}function d(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return S(r,t),r}}function f(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return S(e,t),e}}function p(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=g(e,t.children),i=_(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&c.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return S(o,t),o}function m(e,t){let n={type:`root`,children:g(e,t.children)};return S(n,t),n}function h(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return S(n,t),n}function g(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=u(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function _(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&c.call(r,n)?r[n]:void 0,o=r&&c.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},l={},u;for(u in s)if(c.call(s,u)){let t=s[u],n=v(e,C(a,u),u,t);n??=v(e,C(o,u),u,t),n!=null&&(l[u]=n)}if(i&&c.call(i,n)){let e=i[n];for(u in e)c.call(e,u)&&!c.call(l,u)&&(l[u]=e[u])}return l}function v(e,t,n,r){return t?Array.isArray(r)?y(e,t,n,r):b(e,t,n,r):void 0}function y(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=b(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function b(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&x(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function x(e,t,n){let r=e.schema.protocols&&c.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),l=i.indexOf(`/`);if(a<0||l>-1&&a>l||o>-1&&a>o||s>-1&&a>s)return!0;let u=-1;for(;++u<r.length;){let e=r[u];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function S(e,t){let r=n(t);t.data&&(e.data=i(t.data)),r&&(e.position=r)}function C(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function w(e){return function(t){return l(t,e)}}t();var T=e();function E({content:e,className:t}){return(0,T.jsx)(`div`,{"data-slot":`markdown`,className:((...e)=>e.filter(Boolean).join(` `))(`prose prose-sm dark:prose-invert max-w-none`,`prose-headings:font-semibold prose-headings:tracking-tight`,`prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl`,`prose-p:leading-relaxed prose-p:text-foreground`,`prose-a:text-primary prose-a:no-underline hover:prose-a:underline`,`prose-code:text-foreground prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none`,`prose-pre:bg-muted prose-pre:text-foreground prose-pre:border`,`prose-blockquote:border-l-primary prose-blockquote:text-muted-foreground`,`prose-strong:text-foreground prose-strong:font-semibold`,`prose-ul:list-disc prose-ol:list-decimal`,`prose-li:text-foreground prose-li:marker:text-muted-foreground`,`prose-table:border prose-th:border prose-th:bg-muted prose-td:border`,`prose-img:rounded-md prose-img:border`,t),children:(0,T.jsx)(r,{remarkPlugins:[a],rehypePlugins:[w],disallowedElements:[`script`,`style`,`iframe`,`object`,`embed`],unwrapDisallowed:!0,children:e})})}export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e}from"./plugins-core-B8C8BUw8.js";export{e as MasterDetailField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{C as t,k as n,z as r}from"./framework-B0ex8RpF.js";import{Ct as i,Do as a,Io as o,Oo as s,To as c,Xo as l,_c as u,ds as d,kl as f,qs as p,wo as m}from"./plugins-core-B8C8BUw8.js";import{l as h,u as g}from"./ui-layout-CvxBdH1V.js";import{c as _}from"./infrastructure-88EEJ8ZY.js";import{n as v}from"./MetadataProvider-B6Zo_H9g.js";import{t as y}from"./useMetadataService-CC_uGGZw.js";import{t as b}from"./getIcon-DUhh_MlU.js";import{r as x,t as S}from"./metadataTypeRegistry-D4RkPQA-.js";import{t as C}from"./MetadataFormDialog-C6kZu-tl.js";var w=e(r(),1),T=n(),E=class extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`[MetadataDetailPage] Schema rendering error:`,e,t.componentStack)}render(){return this.state.hasError?(0,T.jsxs)(`div`,{className:`rounded-lg border border-destructive/50 bg-destructive/5 p-6 text-center`,"data-testid":`schema-render-error`,children:[(0,T.jsx)(d,{className:`h-8 w-8 mx-auto mb-3 text-destructive`}),(0,T.jsxs)(`p`,{className:`text-sm font-medium text-destructive`,children:[`Failed to render `,this.props.fallbackLabel||`detail`,` page`]}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:this.state.error?.message||`An unexpected error occurred.`})]}):this.props.children}};function D({schema:e}){let n=e.body||[];return n.length===0?null:(0,T.jsx)(`div`,{className:`flex flex-col gap-6`,"data-testid":`schema-detail-content`,children:n.map((e,n)=>(0,T.jsx)(t,{schema:e},e?.id||n))})}function O(){let e=h(),{appName:t,metadataType:n,itemName:r}=g(),d=t?`/apps/${t}`:``,O=y(),{refresh:k}=v(),{user:A}=_(),j=A?.role===`admin`,M=n?x(n):void 0,[N,P]=(0,w.useState)(null),[F,I]=(0,w.useState)(!0),[L,R]=(0,w.useState)(!1),[z,B]=(0,w.useState)(!1),V=(0,w.useCallback)(async()=>{if(!(!O||!n||!r)){I(!0);try{P((await O.getItems(n)).find(e=>String(e.name)===r&&!e._deleted)??null)}catch{i.error(`Failed to load ${M?.label??n}`)}finally{I(!1)}}},[O,n,r,M?.label]);(0,w.useEffect)(()=>{V()},[V]);let H=(0,w.useCallback)(async e=>{if(!(!O||!n||!r)){B(!0);try{let t={...N,...e};await O.saveMetadataItem(n,r,t),await k(),await V(),i.success(`${M?.label??`Item`} "${r}" updated`)}catch{throw i.error(`Failed to update "${r}"`),Error(`Failed to save ${M?.label??`item`} "${r}"`)}finally{B(!1)}}},[O,n,r,N,M?.label,k,V]),U=M?.customRoute?`${d}${M.customRoute}`:`${d}/system/metadata/${n??``}`;if(!M)return(0,T.jsx)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-detail-page`,children:(0,T.jsxs)(`div`,{className:`text-center text-muted-foreground py-12`,children:[(0,T.jsxs)(`p`,{className:`text-lg font-medium`,children:[`Unknown metadata type: `,n]}),(0,T.jsx)(l,{variant:`outline`,className:`mt-4`,onClick:()=>e(`${d}/system`),children:`Back to System Settings`})]})});if(M.pageSchemaFactory){let t=M.pageSchemaFactory(r,N),n=b(M.icon);return(0,T.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-detail-page`,children:[(0,T.jsx)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:(0,T.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,T.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>e(U),"data-testid":`back-to-list-btn`,children:(0,T.jsx)(f,{className:`h-4 w-4`})}),(0,T.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,T.jsx)(n,{className:`h-5 w-5 text-primary`})}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:t.title||r}),(0,T.jsxs)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:[M.label,` Details`]})]})]})}),(0,T.jsx)(E,{fallbackLabel:M.label,children:(0,T.jsx)(D,{schema:t})})]})}let W=b(M.icon),G=M.editable!==!1&&j,K=M.formFields??S,q=M.detailComponent;return(0,T.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-detail-page`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,T.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>e(U),"data-testid":`back-to-list-btn`,children:(0,T.jsx)(f,{className:`h-4 w-4`})}),(0,T.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,T.jsx)(W,{className:`h-5 w-5 text-primary`})}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:F?`Loading...`:String(N?.label??N?.name??r)}),(0,T.jsxs)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:[M.label,` Details`]})]})]}),G&&!F&&N&&(0,T.jsxs)(l,{variant:`outline`,onClick:()=>R(!0),disabled:z,"data-testid":`detail-edit-btn`,children:[(0,T.jsx)(p,{className:`mr-2 h-4 w-4`}),`Edit`]})]}),F&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`detail-loading`,children:[(0,T.jsx)(u,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading...`]}),!F&&!N&&(0,T.jsxs)(`div`,{className:`text-center text-muted-foreground py-12`,"data-testid":`detail-not-found`,children:[(0,T.jsxs)(`p`,{className:`text-lg font-medium`,children:[M.label,` "`,r,`" not found.`]}),(0,T.jsxs)(l,{variant:`outline`,className:`mt-4`,onClick:()=>e(U),children:[`Back to `,M.pluralLabel]})]}),!F&&N&&(0,T.jsx)(T.Fragment,{children:q?(0,T.jsx)(q,{item:N}):(0,T.jsxs)(m,{"data-testid":`detail-card`,children:[(0,T.jsx)(a,{children:(0,T.jsxs)(s,{className:`flex items-center gap-2`,children:[(0,T.jsx)(o,{variant:`secondary`,children:M.label}),String(N.name??``)]})}),(0,T.jsx)(c,{children:(0,T.jsx)(`dl`,{className:`grid gap-3 sm:grid-cols-2`,children:K.map(e=>(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),(0,T.jsx)(`dd`,{className:`mt-1 text-sm`,children:String(N[e.key]??`—`)})]},e.key))})})]})}),G&&N&&(0,T.jsx)(C,{open:L,onOpenChange:R,mode:`edit`,typeLabel:M.label,formFields:M.formFields,initialValues:N,onSubmit:H})]})}export{O as MetadataDetailPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Cn as r,Dn as i,En as a,On as o,Tn as s,Xo as c,_c as l,cn as u,gt as d,sn as f,wn as p,xt as m}from"./plugins-core-B8C8BUw8.js";import{t as h}from"./metadataTypeRegistry-D4RkPQA-.js";var g=e(n(),1),_=t();function v({open:e,onOpenChange:t,mode:n,typeLabel:v,formFields:y,initialValues:b,onSubmit:x}){let S=y??h,C=n===`edit`,[w,T]=(0,g.useState)({}),[E,D]=(0,g.useState)(!1);(0,g.useEffect)(()=>{if(e){let e={};for(let t of S)e[t.key]=String(b?.[t.key]??``);T(e)}},[e,b,S]);let O=(0,g.useCallback)((e,t)=>{T(n=>({...n,[e]:t}))},[]),k=(0,g.useCallback)(async()=>{D(!0);try{await x(w),t(!1)}catch{}finally{D(!1)}},[w,x,t]),A=S.filter(e=>e.required).every(e=>(w[e.key]??``).trim().length>0);return(0,_.jsx)(r,{open:e,onOpenChange:t,children:(0,_.jsxs)(p,{className:`sm:max-w-[480px]`,"data-testid":`metadata-form-dialog`,children:[(0,_.jsxs)(i,{children:[(0,_.jsx)(o,{children:C?`Edit ${v}`:`New ${v}`}),(0,_.jsx)(s,{children:C?`Update the ${v.toLowerCase()} details below.`:`Fill in the details to create a new ${v.toLowerCase()}.`})]}),(0,_.jsx)(`div`,{className:`space-y-4 py-4`,children:S.map(e=>{let t=E||C&&e.disabledOnEdit===!0,n=w[e.key]??``,r=`metadata-field-${e.key}`;return(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsxs)(u,{htmlFor:r,children:[e.label,e.required&&(0,_.jsx)(`span`,{className:`text-destructive ml-1`,"aria-hidden":`true`,children:`*`})]}),e.type===`textarea`?(0,_.jsx)(d,{id:r,value:n,onChange:t=>O(e.key,t.target.value),placeholder:e.placeholder,disabled:t,"data-testid":`metadata-field-${e.key}`}):e.type===`select`&&e.options?(0,_.jsxs)(`select`,{id:r,value:n,onChange:t=>O(e.key,t.target.value),disabled:t,"aria-required":e.required?!0:void 0,className:`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":`metadata-field-${e.key}`,children:[(0,_.jsx)(`option`,{value:``,children:`Select...`}),e.options.map(e=>(0,_.jsx)(`option`,{value:e.value,children:e.label},e.value))]}):e.type===`number`?(0,_.jsx)(f,{id:r,type:`number`,value:n,onChange:t=>O(e.key,t.target.value),placeholder:e.placeholder,disabled:t,"data-testid":`metadata-field-${e.key}`}):e.type===`boolean`?(0,_.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,_.jsx)(m,{id:r,checked:n===`true`,onCheckedChange:t=>O(e.key,String(t)),disabled:t,"data-testid":`metadata-field-${e.key}`}),(0,_.jsx)(u,{htmlFor:r,className:`text-sm text-muted-foreground cursor-pointer`,children:n===`true`?`Yes`:`No`})]}):(0,_.jsx)(f,{id:r,value:n,onChange:t=>O(e.key,t.target.value),placeholder:e.placeholder,disabled:t,"data-testid":`metadata-field-${e.key}`})]},e.key)})}),(0,_.jsxs)(a,{children:[(0,_.jsx)(c,{variant:`outline`,onClick:()=>t(!1),disabled:E,"data-testid":`metadata-form-cancel-btn`,children:`Cancel`}),(0,_.jsxs)(c,{onClick:k,disabled:E||!A,"data-testid":`metadata-form-submit-btn`,children:[E&&(0,_.jsx)(l,{className:`mr-2 h-4 w-4 animate-spin`}),C?`Save`:`Create`]})]})]})})}export{v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,k as n,z as r}from"./framework-B0ex8RpF.js";import{Qc as i,Xo as a,dl as o,ml as s,nl as c,pl as l}from"./plugins-core-B8C8BUw8.js";var u=e(r(),1),d=n();function f({open:e,onToggle:t,className:n}){return(0,d.jsxs)(a,{size:`sm`,variant:e?`secondary`:`outline`,onClick:t,className:`shadow-none gap-2 ${n||``}`,title:`Toggle Metadata Inspector`,children:[(0,d.jsx)(c,{className:`h-4 w-4`}),(0,d.jsx)(`span`,{className:`hidden lg:inline`,children:`Metadata`})]})}function p({sections:e,open:t}){if(!t)return null;let[n,r]=(0,u.useState)([`0`]),[a,c]=(0,u.useState)(null),f=async(e,t)=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),c(t),setTimeout(()=>c(null),2e3)}catch(e){console.error(`Failed to copy:`,e)}},p=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,d.jsxs)(`div`,{className:`w-80 border-l bg-background p-0 overflow-hidden flex flex-col shrink-0 z-20 transition-all`,children:[(0,d.jsxs)(`div`,{className:`px-4 py-3 border-b bg-muted/5 flex items-center justify-between`,children:[(0,d.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Metadata Inspector`}),(0,d.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:`JSON`})]}),(0,d.jsx)(`div`,{className:`flex-1 overflow-auto`,children:e.map((e,t)=>{let r=String(t),c=n.includes(r),u=a===t;return(0,d.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 hover:bg-muted/5 transition-colors`,children:[(0,d.jsxs)(`button`,{onClick:()=>p(r),className:`flex-1 flex items-center justify-between text-left`,children:[(0,d.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:e.title}),c?(0,d.jsx)(l,{className:`h-3 w-3 text-muted-foreground ml-2`}):(0,d.jsx)(o,{className:`h-3 w-3 text-muted-foreground ml-2`})]}),(0,d.jsx)(`button`,{onClick:()=>f(e.data,t),className:`p-1 hover:bg-muted rounded transition-colors ml-2`,title:`Copy JSON`,children:u?(0,d.jsx)(s,{className:`h-3 w-3 text-green-600`}):(0,d.jsx)(i,{className:`h-3 w-3 text-muted-foreground`})})]}),c&&(0,d.jsx)(`div`,{className:`px-4 pb-4`,children:(0,d.jsx)(`div`,{className:`relative rounded-md border border-border/50 bg-muted/5 overflow-hidden`,children:(0,d.jsx)(`pre`,{className:`text-[11px] leading-relaxed p-3 overflow-auto max-h-96 font-mono text-foreground/90`,children:JSON.stringify(e.data,null,2)})})})]},t)})})]})}function m(){let[e,n]=(0,u.useState)((0,u.useMemo)(()=>{try{return typeof window<`u`?t(window.location.search).enabled:!1}catch{return!1}},[]));return{showDebug:e,toggleDebug:()=>n(e=>!e)}}export{f as n,m as r,p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Ct as r,Hs as i,Io as a,Ps as o,To as s,Xo as c,_c as l,kl as u,ps as d,qs as f,sn as p,wo as m}from"./plugins-core-B8C8BUw8.js";import{l as h,u as ee}from"./ui-layout-CvxBdH1V.js";import{c as te}from"./infrastructure-88EEJ8ZY.js";import{n as ne}from"./MetadataProvider-B6Zo_H9g.js";import{t as re}from"./useMetadataService-CC_uGGZw.js";import{t as g}from"./getIcon-DUhh_MlU.js";import{r as _}from"./metadataTypeRegistry-D4RkPQA-.js";import{t as v}from"./MetadataFormDialog-C6kZu-tl.js";var y=e(n(),1),b=t();function ie({items:e,columns:t,editable:n=!1,saving:r=!1,deletingName:i=null,typeLabel:a=`item`,rowActions:o=[],onItemClick:s,onEdit:l,onDelete:u}){return(0,b.jsx)(`div`,{className:`rounded-lg border bg-card`,"data-testid":`metadata-grid`,children:(0,b.jsx)(`div`,{className:`overflow-x-auto`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,"aria-label":`${a} list`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b bg-muted/50`,children:[t.map(e=>(0,b.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-muted-foreground`,style:e.width?{width:e.width}:void 0,children:e.label},e.key)),n&&(0,b.jsx)(`th`,{className:`px-4 py-3 text-right font-medium text-muted-foreground w-24`,children:`Actions`})]})}),(0,b.jsx)(`tbody`,{children:e.map(e=>{let p=String(e.name??``);return(0,b.jsxs)(`tr`,{className:`border-b last:border-0 hover:bg-accent/50 cursor-pointer transition-colors`,"data-testid":`metadata-item-${p}`,onClick:()=>s?.(p),children:[t.map(t=>{let n=String(e[t.key]??`—`);return(0,b.jsx)(`td`,{className:`px-4 py-3 truncate max-w-[200px]`,title:n,children:n},t.key)}),n&&(0,b.jsx)(`td`,{className:`px-4 py-3 text-right`,children:(0,b.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[o.map(t=>(0,b.jsx)(c,{variant:t.variant??`ghost`,size:`icon`,title:t.label,"aria-label":t.label,onClick:n=>{n.stopPropagation(),t.handler?.(e)},"data-testid":`row-action-${t.key}-${p}`,children:(0,b.jsx)(`span`,{className:`text-xs`,children:t.label.charAt(0)})},t.key)),(0,b.jsx)(c,{variant:`ghost`,size:`icon`,title:`Edit ${a}`,onClick:t=>{t.stopPropagation(),l?.(e)},disabled:r,"data-testid":`edit-${p}-btn`,children:(0,b.jsx)(f,{className:`h-4 w-4`})}),(0,b.jsx)(c,{variant:`ghost`,size:`icon`,title:i===p?`Click again to confirm`:`Delete ${a}`,onClick:e=>{e.stopPropagation(),u?.(p)},disabled:r,"data-testid":`delete-${p}-btn`,children:(0,b.jsx)(d,{className:`h-4 w-4 ${i===p?`text-destructive`:``}`})})]})})]},p)})})]})})})}function x(){let e=h(),{appName:t,metadataType:n}=ee(),x=t?`/apps/${t}`:``,S=re(),{refresh:C}=ne(),{user:ae}=te(),w=ae?.role===`admin`,T=n?_(n):void 0,[E,D]=(0,y.useState)([]),[O,k]=(0,y.useState)(!0),[A,j]=(0,y.useState)(``),[M,N]=(0,y.useState)(!1),[P,F]=(0,y.useState)(null),[oe,I]=(0,y.useState)(!1),[L,R]=(0,y.useState)(`create`),[z,B]=(0,y.useState)(null),V=(0,y.useCallback)(async()=>{if(!(!S||!n)){k(!0);try{D((await S.getItems(n)).filter(e=>!e._deleted))}catch{r.error(`Failed to load ${T?.pluralLabel??n}`)}finally{k(!1)}}},[S,n,T?.pluralLabel]);(0,y.useEffect)(()=>{V()},[V]);let H=(0,y.useMemo)(()=>{if(!A.trim())return E;let e=A.toLowerCase();return E.filter(t=>{let n=String(t.name??``).toLowerCase(),r=String(t.label??``).toLowerCase();return n.includes(e)||r.includes(e)})},[E,A]),U=(0,y.useCallback)(async e=>{if(!(!S||!n))if(P===e){N(!0);try{await S.deleteMetadataItem(n,e),D(t=>t.filter(t=>t.name!==e)),await C(),r.success(`${T?.label??`Item`} "${e}" deleted`)}catch{r.error(`Failed to delete "${e}"`)}finally{N(!1),F(null)}}else F(e)},[S,n,P,T?.label,C]),W=(0,y.useCallback)(()=>{B(null),R(`create`),I(!0)},[]),G=(0,y.useCallback)(e=>{B(e),R(`edit`),I(!0)},[]),K=(0,y.useCallback)(async e=>{if(!S||!n)return;let t=e.name??String(z?.name??``);if(t){N(!0);try{let i=L===`edit`?{...z,...e}:{...e};await S.saveMetadataItem(n,t,i),await C(),await V(),r.success(L===`edit`?`${T?.label??`Item`} "${t}" updated`:`${T?.label??`Item`} "${t}" created`)}catch{throw r.error(L===`edit`?`Failed to update "${t}"`:`Failed to create "${t}"`),Error(`Failed to save ${T?.label??`item`} "${t}"`)}finally{N(!1)}}},[S,n,z,L,T?.label,C,V]);if(!T)return(0,b.jsx)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:(0,b.jsxs)(`div`,{className:`text-center text-muted-foreground py-12`,children:[(0,b.jsxs)(`p`,{className:`text-lg font-medium`,children:[`Unknown metadata type: `,n]}),(0,b.jsx)(c,{variant:`outline`,className:`mt-4`,onClick:()=>e(`${x}/system`),children:`Back to System Settings`})]})});let q=g(T.icon),J=T.editable!==!1&&w,Y=T.listComponent;if(Y)return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:[(0,b.jsx)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,b.jsx)(c,{variant:`ghost`,size:`icon`,onClick:()=>e(`${x}/system`),"data-testid":`back-to-hub-btn`,children:(0,b.jsx)(u,{className:`h-4 w-4`})}),(0,b.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,b.jsx)(q,{className:`h-5 w-5 text-primary`})}),(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:T.pluralLabel}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:T.description})]})]})}),(0,b.jsx)(Y,{config:T,basePath:x,metadataType:n,isAdmin:w})]});let X=(T.actions??[]).filter(e=>e.scope===`page`),Z=(T.actions??[]).filter(e=>e.scope===`row`),Q=T.listMode??`card`,$=Q===`grid`||Q===`table`,se=T.columns??[{key:`name`,label:`Name`},{key:`label`,label:`Label`}];return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,b.jsx)(c,{variant:`ghost`,size:`icon`,onClick:()=>e(`${x}/system`),"data-testid":`back-to-hub-btn`,children:(0,b.jsx)(u,{className:`h-4 w-4`})}),(0,b.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,b.jsx)(q,{className:`h-5 w-5 text-primary`})}),(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:T.pluralLabel}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:T.description})]})]}),J&&(0,b.jsxs)(c,{onClick:W,"data-testid":`create-metadata-btn`,children:[(0,b.jsx)(i,{className:`mr-2 h-4 w-4`}),`New `,T.label]}),X.length>0&&(0,b.jsx)(`div`,{className:`flex items-center gap-2`,children:X.map(e=>(0,b.jsx)(c,{variant:e.variant??`outline`,onClick:()=>e.handler?.(),"data-testid":`page-action-${e.key}`,children:e.label},e.key))})]}),(0,b.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[(0,b.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,b.jsxs)(`label`,{htmlFor:`metadata-search`,className:`sr-only`,children:[`Search `,T.pluralLabel.toLowerCase()]}),(0,b.jsx)(o,{className:`pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),(0,b.jsx)(p,{id:`metadata-search`,placeholder:`Search ${T.pluralLabel.toLowerCase()}...`,value:A,onChange:e=>j(e.target.value),className:`pl-8`,"data-testid":`metadata-search-input`})]}),(0,b.jsxs)(a,{variant:`secondary`,"data-testid":`metadata-count-badge`,children:[H.length,` `,T.pluralLabel.toLowerCase()]})]}),O&&(0,b.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`metadata-loading`,children:[(0,b.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading `,T.pluralLabel.toLowerCase(),`...`]}),M&&(0,b.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`metadata-saving`,children:[(0,b.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Saving...`]}),!O&&H.length===0&&(0,b.jsx)(`div`,{className:`text-center text-muted-foreground py-12`,"data-testid":`metadata-empty`,children:(0,b.jsxs)(`p`,{children:[`No `,T.pluralLabel.toLowerCase(),` found.`]})}),!O&&H.length>0&&!$&&(0,b.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:H.map(t=>{let r=String(t.name??``),i=String(t.label??t.name??``),a=String(t.description??``);return(0,b.jsx)(m,{className:`transition-colors hover:bg-accent/50 cursor-pointer`,"data-testid":`metadata-item-${r}`,onClick:()=>e(`${x}/system/metadata/${n}/${r}`),children:(0,b.jsxs)(s,{className:`flex items-center justify-between p-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsx)(`p`,{className:`font-medium truncate`,children:i}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:r}),a&&(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 truncate`,children:a})]}),J&&(0,b.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 ml-2`,children:[Z.map(e=>(0,b.jsx)(c,{variant:e.variant??`ghost`,size:`icon`,title:e.label,onClick:n=>{n.stopPropagation(),e.handler?.(t)},"data-testid":`row-action-${e.key}-${r}`,children:(0,b.jsx)(`span`,{className:`text-xs`,children:e.label.charAt(0)})},e.key)),(0,b.jsx)(c,{variant:`ghost`,size:`icon`,title:`Edit ${T.label.toLowerCase()}`,onClick:e=>{e.stopPropagation(),G(t)},disabled:M,"data-testid":`edit-${r}-btn`,children:(0,b.jsx)(f,{className:`h-4 w-4`})}),(0,b.jsx)(c,{variant:`ghost`,size:`icon`,title:P===r?`Click again to confirm`:`Delete ${T.label.toLowerCase()}`,onClick:e=>{e.stopPropagation(),U(r)},disabled:M,"data-testid":`delete-${r}-btn`,children:(0,b.jsx)(d,{className:`h-4 w-4 ${P===r?`text-destructive`:``}`})})]})]})},r)})}),!O&&H.length>0&&$&&(0,b.jsx)(ie,{items:H,columns:se,editable:J,saving:M,deletingName:P,typeLabel:T.label.toLowerCase(),rowActions:Z,onItemClick:t=>e(`${x}/system/metadata/${n}/${t}`),onEdit:G,onDelete:U}),J&&(0,b.jsx)(v,{open:oe,onOpenChange:I,mode:L,typeLabel:T.label,formFields:T.formFields,initialValues:z??void 0,onSubmit:K})]})}export{x as MetadataManagerPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";var r=e(n(),1),i=t(),a=(0,r.createContext)(null);function o(e){return e&&typeof e==`object`&&`items`in e&&Array.isArray(e.items)?e.items:[]}async function s(e){let t=e.getClient(),[n,r,i,a,s]=await Promise.all([t.meta.getItems(`app`).catch(()=>({items:[]})),t.meta.getItems(`object`).catch(()=>({items:[]})),t.meta.getItems(`dashboard`).catch(()=>({items:[]})),t.meta.getItems(`report`).catch(()=>({items:[]})),t.meta.getItems(`page`).catch(()=>({items:[]}))]);return{apps:o(n),objects:o(r),dashboards:o(i),reports:o(a),pages:o(s)}}function c({children:e,adapter:t}){let[n,o]=(0,r.useState)({apps:[],objects:[],dashboards:[],reports:[],pages:[],loading:!0,error:null}),c=(0,r.useRef)(t);c.current=t;let l=(0,r.useCallback)(async()=>{o(e=>({...e,loading:!0,error:null}));try{o({...await s(c.current),loading:!1,error:null})}catch(e){o(t=>({...t,loading:!1,error:e instanceof Error?e:Error(String(e))}))}},[]);(0,r.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await s(t);e||o({...n,loading:!1,error:null})}catch(t){e||o(e=>({...e,loading:!1,error:t instanceof Error?t:Error(String(t))}))}})(),()=>{e=!0}},[t]);let u=(0,r.useCallback)(e=>({app:n.apps,object:n.objects,dashboard:n.dashboards,report:n.reports,page:n.pages})[e]??[],[n.apps,n.objects,n.dashboards,n.reports,n.pages]),d={...n,refresh:l,getItemsByType:u};return(0,i.jsx)(a.Provider,{value:d,children:e})}function l(){let e=(0,r.useContext)(a);if(!e)throw Error(`useMetadata must be used within a <MetadataProvider>`);return e}export{l as n,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{rt as e}from"./plugins-core-B8C8BUw8.js";export{e as NumberField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./plugins-core-B8C8BUw8.js";export{e as ObjectField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./framework-B0ex8RpF.js";import{xl as t}from"./plugins-core-B8C8BUw8.js";import{c as n}from"./infrastructure-88EEJ8ZY.js";import{t as r}from"./SystemObjectViewPage-D2qKWQRW.js";var i=e();function a(){let{user:e}=n();return(0,i.jsx)(r,{objectName:`sys_org`,title:`Organization Management`,description:`Manage organizations and their members`,icon:t,isAdmin:e?.role===`admin`})}export{a as OrgManagementPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Ct as r,kl as i}from"./plugins-core-B8C8BUw8.js";import{l as a,u as o}from"./ui-layout-CvxBdH1V.js";import{n as s}from"./MetadataProvider-B6Zo_H9g.js";import{n as c}from"./AdapterProvider-BMMNYOio.js";import{a as l}from"./src-CZnjIqJM.js";var u=e(n(),1),d=t();function f(){let e=a(),{pageName:t}=o(),n=c(),{pages:f}=s(),p=f?.find(e=>e.name===t),[m,h]=(0,u.useState)(()=>p||{type:`page`,name:t??``,title:t??``,children:[]}),g=(0,u.useRef)(m);g.current=m;let _=(0,u.useCallback)(async e=>{try{if(n)return await n.update(`sys_page`,t,e),!0}catch{}return!1},[n,t]),v=(0,u.useCallback)(async e=>{h(e),await _(e)},[_]);(0,u.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key===`s`&&(e.preventDefault(),_(g.current).then(e=>{e&&r.success(`Page saved`)}))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let y=(0,u.useCallback)(e=>{let n=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=`${t||`page`}.json`,a.click(),URL.revokeObjectURL(i),r.success(`Page schema exported`)},[t]),b=(0,u.useCallback)(e=>{r.success(`Page schema imported`),v(e)},[v]);return p?(0,d.jsxs)(`div`,{className:`h-full flex flex-col`,"data-testid":`page-design-page`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 sm:px-6`,children:[(0,d.jsx)(`button`,{type:`button`,onClick:()=>e(-1),className:`rounded p-1.5 text-muted-foreground hover:text-foreground`,"aria-label":`Go back`,"data-testid":`page-design-back`,children:(0,d.jsx)(i,{className:`h-4 w-4`})}),(0,d.jsxs)(`h1`,{className:`text-lg font-semibold tracking-tight truncate`,children:[`Edit Page: `,p.label||p.title||t]})]}),(0,d.jsx)(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6`,children:(0,d.jsx)(l,{schema:m,onChange:v,onExport:y,onImport:b})})]}):(0,d.jsxs)(`div`,{className:`h-full flex items-center justify-center text-muted-foreground`,children:[`Page "`,t,`" not found`]})}export{f as PageDesignPage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/src-ZtN-VRcF.js","assets/src-CZnjIqJM.js","assets/rolldown-runtime-Dw2cE7zH.js","assets/plugins-core-B8C8BUw8.js","assets/data-adapter-DPqgzJ64.js","assets/infrastructure-88EEJ8ZY.js","assets/framework-B0ex8RpF.js","assets/plugins-core-Dpq2d-QS.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{C as t,k as n,z as r}from"./framework-B0ex8RpF.js";import{Ct as i,Gt as a,Jt as o,Kt as s,Wc as c,Yt as l,ct as u,lt as d,qs as f,qt as p,ut as m}from"./plugins-core-B8C8BUw8.js";import{O as h}from"./data-adapter-DPqgzJ64.js";import{d as g,u as _}from"./ui-layout-CvxBdH1V.js";import{n as v}from"./MetadataProvider-B6Zo_H9g.js";import{n as y}from"./AdapterProvider-BMMNYOio.js";import{r as b,t as x}from"./MetadataInspector-DAb5pYOH.js";var S=e(r(),1),C=n();function w({open:e,onOpenChange:t,title:n,description:r,schema:c,onSchemaChange:u,collection:d,recordName:f,children:m}){let h=y(),g=(0,S.useRef)(c);g.current=c;let _=(0,S.useCallback)(async e=>{try{if(h)return await h.update(d,f,e),!0}catch(e){console.warn(`[DesignDrawer] Auto-save failed:`,e)}return!1},[h,d,f]),v=(0,S.useCallback)(async e=>{u(e),await _(e)},[u,_]);return(0,S.useEffect)(()=>{if(!e)return;let t=e=>{(e.ctrlKey||e.metaKey)&&e.key===`s`&&(e.preventDefault(),_(g.current).then(e=>{e&&i.success(`${n} saved`)}))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,_,n]),(0,C.jsx)(a,{open:e,onOpenChange:t,modal:!1,children:(0,C.jsxs)(s,{side:`right`,hideOverlay:!0,className:`w-full sm:w-[540px] sm:max-w-[540px] lg:w-[640px] lg:max-w-[640px] p-0 flex flex-col`,"data-testid":`design-drawer`,children:[(0,C.jsxs)(o,{className:`px-4 py-3 border-b shrink-0`,children:[(0,C.jsx)(l,{children:n}),(0,C.jsx)(p,{className:r?``:`sr-only`,children:r||`Visual editor — configure and preview ${n}`})]}),(0,C.jsx)(`div`,{className:`flex-1 overflow-auto p-4`,children:m(c,v)})]})})}var T=(0,S.lazy)(()=>h(()=>import(`./src-ZtN-VRcF.js`).then(e=>({default:e.PageCanvasEditor})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function E(){let{pageName:e}=_(),[n]=g(),{showDebug:r}=b(),[i,a]=(0,S.useState)(!1),{pages:o}=v(),s=o?.find(t=>t.name===e),[l,p]=(0,S.useState)(null),h=(0,S.useCallback)(()=>{p(s),a(!0)},[s]),y=(0,S.useCallback)(e=>{a(e)},[]);if(!s)return(0,C.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,C.jsxs)(u,{children:[(0,C.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,C.jsx)(c,{className:`h-6 w-6 text-muted-foreground`})}),(0,C.jsx)(m,{children:`Page Not Found`}),(0,C.jsxs)(d,{children:[`The page "`,e,`" could not be found. It may have been removed or renamed.`]})]})});let E=Object.fromEntries(n.entries()),D=i&&l?l:s;return(0,C.jsxs)(`div`,{className:`flex flex-row h-full w-full overflow-hidden relative`,children:[(0,C.jsxs)(`div`,{className:`flex-1 overflow-auto h-full relative group`,children:[(0,C.jsx)(`div`,{className:`absolute top-1.5 sm:top-2 right-1.5 sm:right-2 z-50 flex items-center gap-1.5 transition-opacity ${r?`opacity-100`:`opacity-0 group-hover:opacity-100`}`,children:(0,C.jsxs)(`button`,{type:`button`,onClick:h,className:`inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-2.5 py-1.5 text-xs font-medium text-muted-foreground shadow-sm hover:bg-accent hover:text-accent-foreground`,"data-testid":`page-edit-button`,children:[(0,C.jsx)(f,{className:`h-3.5 w-3.5`}),`Edit`]})}),(0,C.jsx)(t,{schema:{...D,type:D.type||`page`,context:{...D.context,params:E}}})]}),(0,C.jsx)(x,{open:r,sections:[{title:`Page Configuration`,data:D}]}),(0,C.jsx)(w,{open:i,onOpenChange:y,title:`Edit Page: ${s.label||s.title||e}`,schema:l||s,onSchemaChange:p,collection:`sys_page`,recordName:e,children:(e,t)=>(0,C.jsx)(S.Suspense,{fallback:(0,C.jsx)(`div`,{className:`p-4 text-muted-foreground`,children:`Loading editor…`}),children:(0,C.jsx)(T,{schema:e,onChange:t})})})]})}export{E as PageView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as e}from"./plugins-core-B8C8BUw8.js";export{e as PasswordField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{W as e}from"./plugins-core-B8C8BUw8.js";export{e as PercentField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./framework-B0ex8RpF.js";import{Ec as t}from"./plugins-core-B8C8BUw8.js";import{c as n}from"./infrastructure-88EEJ8ZY.js";import{t as r}from"./SystemObjectViewPage-D2qKWQRW.js";var i=e();function a(){let{user:e}=n();return(0,i.jsx)(r,{objectName:`sys_permission`,title:`Permissions`,description:`Manage permission rules and assignments`,icon:t,isAdmin:e?.role===`admin`})}export{a as PermissionManagementPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as e}from"./plugins-core-B8C8BUw8.js";export{e as PhoneField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Bo as r,Do as i,Eo as a,Io as o,Lo as s,Oo as c,Ro as l,To as u,Vo as d,Xo as f,cl as p,cn as m,gc as h,sl as g,sn as _,ss as v,wo as y,zo as b}from"./plugins-core-B8C8BUw8.js";import{c as x,r as S}from"./infrastructure-88EEJ8ZY.js";var C=e(n(),1),w=t();function T(){let{user:e,updateUser:t,isLoading:n}=x(),[T,E]=(0,C.useState)(e?.name??``),[D,O]=(0,C.useState)(!1),[k,A]=(0,C.useState)(null);return e?(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6 max-w-2xl`,children:[(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`Profile`}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage your account settings`})]}),(0,w.jsx)(y,{children:(0,w.jsx)(u,{className:`pt-6`,children:(0,w.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,w.jsxs)(s,{className:`h-16 w-16`,children:[(0,w.jsx)(b,{src:e.image??void 0,alt:e.name??`User`}),(0,w.jsx)(l,{className:`text-lg bg-primary text-primary-foreground`,children:S(e)})]}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`p`,{className:`text-lg font-semibold truncate`,children:e.name??`User`}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:e.email}),(0,w.jsx)(o,{variant:`secondary`,className:`mt-1`,children:e.role??`member`})]})]})})}),(0,w.jsxs)(y,{children:[(0,w.jsxs)(i,{children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(v,{className:`h-4 w-4 text-muted-foreground`}),(0,w.jsx)(c,{className:`text-base sm:text-lg`,children:`Personal Information`})]}),(0,w.jsx)(a,{children:`Update your name and view account details`})]}),(0,w.jsx)(u,{children:(0,w.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),A(null),O(!1);try{await t({name:T}),O(!0)}catch(e){A(e instanceof Error?e.message:String(e))}},className:`space-y-4`,children:[k&&(0,w.jsxs)(r,{variant:`destructive`,children:[(0,w.jsx)(p,{className:`h-4 w-4`}),(0,w.jsx)(d,{children:k})]}),D&&(0,w.jsxs)(r,{children:[(0,w.jsx)(g,{className:`h-4 w-4 text-green-600`}),(0,w.jsx)(d,{className:`text-green-800 dark:text-green-400`,children:`Profile updated successfully.`})]}),(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(m,{htmlFor:`profile-name`,children:`Name`}),(0,w.jsx)(_,{id:`profile-name`,type:`text`,value:T,onChange:e=>E(e.target.value),required:!0,"aria-required":`true`,disabled:n})]}),(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(m,{htmlFor:`profile-email`,children:`Email`}),(0,w.jsx)(_,{id:`profile-email`,type:`email`,value:e.email,disabled:!0,className:`bg-muted text-muted-foreground`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Email cannot be changed.`})]}),(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(m,{children:`Role`}),(0,w.jsx)(_,{type:`text`,value:e.role??`member`,disabled:!0,className:`bg-muted text-muted-foreground`})]}),(0,w.jsx)(f,{type:`submit`,disabled:n,className:`w-full sm:w-auto`,children:n?`Saving...`:`Save Changes`})]})})]}),(0,w.jsx)(y,{children:(0,w.jsxs)(i,{children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(h,{className:`h-4 w-4 text-muted-foreground`}),(0,w.jsx)(c,{className:`text-base sm:text-lg`,children:`Change Password`})]}),(0,w.jsx)(a,{children:`To change your password, use the password reset flow from the login page.`})]})})]}):null}export{T as ProfilePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./plugins-core-B8C8BUw8.js";export{e as QRCodeField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e}from"./plugins-core-B8C8BUw8.js";export{e as RatingField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{a as t,k as n,p as r,z as i}from"./framework-B0ex8RpF.js";import{Ct as a,Zc as o,ct as s,lt as c,os as l,ut as u}from"./plugins-core-B8C8BUw8.js";import{l as d,u as f}from"./ui-layout-CvxBdH1V.js";import{c as p}from"./infrastructure-88EEJ8ZY.js";import{t as m}from"./src-BY3UmUTR.js";import{o as h,s as ee}from"./plugins-views-Csz847hc.js";import{r as g,t as _}from"./MetadataInspector-DAb5pYOH.js";import{n as v,t as y}from"./ActionParamDialog-FoHiwOv1.js";import{t as b}from"./skeletons-Dxs6Di3L.js";var x=e(i(),1),S=n(),C={id:`current-user`,name:`Demo User`};function w({dataSource:e,objects:n,onEdit:i}){let{objectName:w,recordId:T}=f(),{showDebug:E}=g(),{user:D}=p(),O=d(),{t:k}=t(),[A,j]=(0,x.useState)(!0),[M,N]=(0,x.useState)([]),[P,F]=(0,x.useState)([]),[I,L]=(0,x.useState)(0),[R,z]=(0,x.useState)({}),B=n.find(e=>e.name===w),V=T,[H,U]=(0,x.useState)({open:!1,message:``}),[W,G]=(0,x.useState)({open:!1,params:[]}),K=(0,x.useCallback)((e,t)=>new Promise(n=>{U({open:!0,message:e,options:t,resolve:n})}),[]),q=(0,x.useCallback)(e=>new Promise(t=>{G({open:!0,params:e,resolve:t})}),[]),J=(0,x.useCallback)((e,t)=>{t?.type===`error`?a.error(e):a.success(e)},[]),Y=(0,x.useCallback)((e,t)=>{t?.external||t?.newTab?window.open(e,`_blank`,`noopener,noreferrer`):O(e)},[O]),X=(0,x.useCallback)(async t=>{try{let n=t.target||t.name,r=t.params||{};switch(n){case`opportunity_change_stage`:await e.update(w,V,{stage:r.new_stage});break;case`opportunity_mark_won`:await e.update(w,V,{stage:`closed_won`});break;case`opportunity_mark_lost`:await e.update(w,V,{stage:`closed_lost`,loss_reason:r.loss_reason});break;default:Object.keys(r).length>0&&await e.update(w,V,r);break}let i=t.refreshAfter===!0;return i&&L(e=>e+1),{success:!0,reload:i}}catch(e){return{success:!1,error:e.message}}},[e,w,V]),Z=(0,x.useMemo)(()=>{if(!B||!n)return[];let e=[];for(let t of n)if(t.name!==B.name)for(let[n,r]of Object.entries(t.fields||{}))r&&(r.type===`lookup`||r.type===`master_detail`)&&(r.reference_to||r.reference)===B.name&&e.push({childObject:t.name,childLabel:t.label||t.name,referenceField:n});return e},[B,n]);(0,x.useEffect)(()=>{if(!e||!V||Z.length===0)return;let t=!1;return Promise.all(Z.map(({childObject:t,referenceField:n})=>e.find(t,{$filter:{[n]:V}}).then(e=>({childObject:t,items:Array.isArray(e)?e:e?.data||[]})).catch(e=>(console.warn(`[RecordDetailView] Failed to fetch related ${t}:`,e),{childObject:t,items:[]})))).then(e=>{if(t)return;let n={};for(let{childObject:t,items:r}of e)n[t]=r;z(n)}),()=>{t=!0}},[e,V,Z]);let Q=D?{id:D.id,name:D.name,avatar:D.image}:C;(0,x.useEffect)(()=>{if(!e||!w||!V)return;let t=`${w}:${V}`;e.find(`sys_presence`,{$filter:{recordId:V}}).then(e=>{e.data?.length&&F(e.data)}).catch(()=>{}),e.find(`sys_comment`,{$filter:{threadId:t},$orderby:{createdAt:`asc`}}).then(e=>{e.data?.length&&N(e.data.map(e=>({id:e.id,type:`comment`,actor:e.author?.name??`Unknown`,actorAvatarUrl:e.author?.avatar,body:e.content,createdAt:e.createdAt,updatedAt:e.updatedAt,parentId:e.parentId,reactions:e.reactions?Object.entries(e.reactions).map(([e,t])=>({emoji:e,count:t.length,reacted:t.includes(Q.id)})):void 0})))}).catch(()=>{})},[e,w,V,Q]);let te=(0,x.useCallback)(async t=>{let n={id:crypto.randomUUID(),type:`comment`,actor:Q.name,actorAvatarUrl:`avatar`in Q?Q.avatar:void 0,body:t,createdAt:new Date().toISOString()};if(N(e=>[...e,n]),e){let r=`${w}:${V}`;e.create(`sys_comment`,{id:n.id,threadId:r,author:Q,content:t,mentions:[],createdAt:n.createdAt}).catch(()=>{})}},[Q,e,w,V]),ne=(0,x.useCallback)(async(t,n)=>{let r={id:crypto.randomUUID(),type:`comment`,actor:Q.name,actorAvatarUrl:`avatar`in Q?Q.avatar:void 0,body:n,createdAt:new Date().toISOString(),parentId:t};if(N(e=>[...e,r].map(e=>e.id===t?{...e,replyCount:(e.replyCount??0)+1}:e)),e){let i=`${w}:${V}`;e.create(`sys_comment`,{id:r.id,threadId:i,author:Q,content:n,mentions:[],createdAt:r.createdAt,parentId:t}).catch(()=>{})}},[Q,e,w,V]),re=(0,x.useCallback)((t,n)=>{N(r=>r.map(r=>{if(r.id!==t)return r;let i=[...r.reactions??[]],a=i.findIndex(e=>e.emoji===n);if(a>=0){let e=i[a];e.reacted?e.count<=1?i.splice(a,1):i[a]={...e,count:e.count-1,reacted:!1}:i[a]={...e,count:e.count+1,reacted:!0}}else i.push({emoji:n,count:1,reacted:!0});let o={...r,reactions:i};return e&&e.update(`sys_comment`,String(t),{$toggleReaction:{emoji:n,userId:Q.id}}).catch(()=>{}),o}))},[Q.id,e]);(0,x.useEffect)(()=>{j(!0),queueMicrotask(()=>j(!1))},[w,T]);let $=(0,x.useMemo)(()=>{if(!B)return{type:`detail-view`};let e=B.primaryField||Object.keys(B.fields||{}).find(e=>e===`name`||e===`title`),t=B.views?.form?.sections,n=t&&t.length>0?t.map(e=>({title:e.title,collapsible:e.collapsible,defaultCollapsed:e.defaultCollapsed,fields:(e.fields||[]).map(e=>{let t=typeof e==`string`?e:e.name,n=B.fields[t];if(!n)return console.warn(`[RecordDetailView] Field "${t}" not found in ${B.name} definition`),{name:t,label:t};let r=n.reference_to||n.reference;return{name:t,label:n.label||t,type:n.type||`text`,...n.options&&{options:n.options},...r&&{reference_to:r},...n.reference_field&&{reference_field:n.reference_field},...n.currency&&{currency:n.currency}}})})):[{title:k(`detail.details`,{defaultValue:`Details`}),fields:Object.keys(B.fields||{}).map(e=>{let t=B.fields[e],n=t.reference_to||t.reference;return{name:e,label:t.label||e,type:t.type||`text`,...t.options&&{options:t.options},...n&&{reference_to:n},...t.reference_field&&{reference_field:t.reference_field},...t.currency&&{currency:t.currency}}})}],r=(()=>{let e=new Set;return(B.actions||[]).filter(t=>t.locations?.includes(`record_header`)?t.name?e.has(t.name)?!1:(e.add(t.name),!0):!0:!1)})(),i=B.views?.detail?.highlightFields??[],a=B.views?.detail?.sectionGroups??B.views?.form?.sectionGroups,o=Z.map(({childObject:e,childLabel:t})=>({title:t,type:`table`,api:e,data:R[e]||[]}));return{type:`detail-view`,objectName:B.name,resourceId:V,showBack:!0,onBack:`history`,showEdit:!0,title:B.label,primaryField:e,sections:n,autoTabs:!0,autoDiscoverRelated:!0,...o.length>0&&{related:o},...i.length>0&&{highlightFields:i},...a&&a.length>0&&{sectionGroups:a},...r.length>0&&{actions:[{type:`action:bar`,location:`record_header`,actions:r}]}}},[B?.name,V,R,I]);return A?(0,S.jsx)(b,{}):B?(0,S.jsxs)(`div`,{className:`h-full bg-background overflow-hidden flex flex-col relative`,children:[(0,S.jsx)(`div`,{className:`absolute top-2 sm:top-4 right-2 sm:right-4 z-50 flex items-center gap-2`,children:P.length>0&&(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,title:`Users viewing this record`,children:[(0,S.jsx)(l,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,S.jsx)(m,{users:P,size:`sm`,maxVisible:4,showStatus:!0})]})}),(0,S.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-row`,children:[(0,S.jsxs)(`div`,{className:`flex-1 overflow-auto p-3 sm:p-4 lg:p-6 scroll-pb-48`,children:[(0,S.jsx)(r,{context:{record:{},objectName:w,user:Q},onConfirm:K,onToast:J,onNavigate:Y,onParamCollection:q,handlers:{api:X},children:(0,S.jsx)(ee,{schema:$,dataSource:e,onEdit:()=>{i({id:V})}},I)}),(0,S.jsx)(`div`,{className:`mt-6 border-t pt-6`,children:(0,S.jsx)(h,{config:{position:`bottom`,collapsible:!0,feed:{enableReactions:!0,enableThreading:!0,showCommentInput:!0}},collapseWhenEmpty:!0,items:M,onAddComment:te,onAddReply:ne,onToggleReaction:re})})]}),(0,S.jsx)(_,{open:E,sections:[{title:`View Schema`,data:$}]})]}),(0,S.jsx)(v,{state:H,onOpenChange:e=>{e||U(e=>({...e,open:!1}))}}),(0,S.jsx)(y,{state:W,onOpenChange:e=>{e||G(e=>({...e,open:!1}))}})]}):(0,S.jsx)(`div`,{className:`flex h-full items-center justify-center p-4`,children:(0,S.jsxs)(s,{children:[(0,S.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,S.jsx)(o,{className:`h-6 w-6 text-muted-foreground`})}),(0,S.jsx)(u,{children:`Object Not Found`}),(0,S.jsxs)(c,{children:[`Object "`,w,`" definition missing. Check your configuration or navigate back to select a valid object.`]})]})})}export{w as RecordDetailView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,k as t}from"./framework-B0ex8RpF.js";import{i as n,l as r}from"./ui-layout-CvxBdH1V.js";import{a as i}from"./infrastructure-88EEJ8ZY.js";import{t as a}from"./AuthPageLayout-BxIX5ebE.js";var o=t(),s=({href:e,className:t,children:r})=>(0,o.jsx)(n,{to:e,className:t,children:r});function c(){let t=r(),{t:n}=e();return(0,o.jsx)(a,{children:(0,o.jsx)(i,{onSuccess:()=>t(`/`),loginUrl:`/login`,title:n(`auth.register.title`),description:n(`auth.register.description`),linkComponent:s,labels:{nameLabel:n(`auth.register.nameLabel`),namePlaceholder:n(`auth.register.namePlaceholder`),emailLabel:n(`auth.register.emailLabel`),emailPlaceholder:n(`auth.register.emailPlaceholder`),passwordLabel:n(`auth.register.passwordLabel`),passwordPlaceholder:n(`auth.register.passwordPlaceholder`),confirmPasswordLabel:n(`auth.register.confirmPasswordLabel`),confirmPasswordPlaceholder:n(`auth.register.confirmPasswordPlaceholder`),passwordMismatchError:n(`auth.register.passwordMismatchError`),passwordTooShortError:n(`auth.register.passwordTooShortError`),submitButton:n(`auth.register.submitButton`),submittingButton:n(`auth.register.submittingButton`),hasAccountText:n(`auth.register.hasAccountText`),signInText:n(`auth.register.signInText`)}})})}export{c as RegisterPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{_c as r,ct as i,lt as a,qs as o,ut as s,vl as c}from"./plugins-core-B8C8BUw8.js";import{u as l}from"./ui-layout-CvxBdH1V.js";import{n as u}from"./MetadataProvider-B6Zo_H9g.js";import{n as d}from"./AdapterProvider-BMMNYOio.js";import{n as f,t as p}from"./plugins-views-Csz847hc.js";import{r as m,t as h}from"./MetadataInspector-DAb5pYOH.js";var g=e(n(),1),_=t(),v=[{value:`month`,label:`Month`,type:`text`},{value:`revenue`,label:`Revenue`,type:`number`},{value:`count`,label:`Count`,type:`number`},{value:`region`,label:`Region`,type:`text`},{value:`product`,label:`Product`,type:`text`},{value:`source`,label:`Lead Source`,type:`text`},{value:`stage`,label:`Stage`,type:`text`},{value:`amount`,label:`Amount`,type:`number`}];function y({dataSource:e}){let{reportName:t}=l(),{showDebug:n}=m(),y=d(),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(0),{reports:w,objects:T,loading:E,refresh:D}=u(),O=w?.find(e=>e.name===t),[k,A]=(0,g.useState)(O),[j,M]=(0,g.useState)(null),[N,P]=(0,g.useState)([]),[F,I]=(0,g.useState)(!1),L=(0,g.useMemo)(()=>{let e=j||k,t=e?.objectName||e?.dataSource?.object||e?.dataSource?.resource;if(t&&T?.length){let e=T.find(e=>e.name===t);if(e?.fields){let t=e.fields;return Array.isArray(t)?t.map(e=>typeof e==`string`?{value:e,label:e,type:`text`}:{value:e.name,label:e.label||e.name,type:e.type||`text`}):Object.entries(t).map(([e,t])=>({value:e,label:t.label||e,type:t.type||`text`}))}}return v},[j,k,T]),R=(0,g.useCallback)(async e=>{try{y&&(await y.update(`sys_report`,t,e),D().catch(()=>{}))}catch(e){console.warn(`[ReportView] Auto-save failed:`,e)}},[y,t,D]),z=(0,g.useCallback)(()=>{M(k),x(!0),C(e=>e+1)},[k]),B=(0,g.useCallback)(()=>{x(!1)},[]),V=(0,g.useMemo)(()=>j||k,[S]),H=(0,g.useCallback)(e=>{M(e),R(e),C(e=>e+1)},[R]),U=(0,g.useCallback)((e,t)=>{M(n=>({...n,[e]:t}))},[]);(0,g.useEffect)(()=>{A(O)},[O]),(0,g.useEffect)(()=>{b||M(null)},[O]);let W=j||k,G=(0,g.useMemo)(()=>JSON.stringify(W?.filters),[W?.filters]),K=(0,g.useMemo)(()=>JSON.stringify(W?.dataSource),[W?.dataSource]),q=(0,g.useMemo)(()=>JSON.stringify(W?.data),[W?.data]);if((0,g.useEffect)(()=>{if(!W||!e){P([]);return}if(W.data&&Array.isArray(W.data)){P(W.data);return}if(W.dataSource){(async()=>{I(!0);try{let t=W.dataSource.object||W.dataSource.resource;if(!t){console.warn(`ReportView: dataSource missing object/resource property`),P([]);return}P((await e.find(t,{$filter:W.dataSource.filter,$orderby:W.dataSource.sort,$top:W.dataSource.limit})).data||[])}catch(e){console.error(`ReportView: Failed to load data from dataSource`,e),P([])}finally{I(!1)}})();return}if(W.objectName){(async()=>{I(!0);try{P((await e.find(W.objectName,{$filter:W.filters,$orderby:W.sort,$top:W.limit||100})).data||[])}catch(e){console.error(`ReportView: Failed to load data from objectName`,e),P([])}finally{I(!1)}})();return}P([])},[W?.objectName,W?.limit,G,K,q,e]),E)return(0,_.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,_.jsx)(r,{className:`h-8 w-8 animate-spin text-muted-foreground`})});if(!O||!k)return!E&&!O?(0,_.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,_.jsxs)(i,{children:[(0,_.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,_.jsx)(c,{className:`h-6 w-6 text-muted-foreground`})}),(0,_.jsx)(s,{children:`Report Not Found`}),(0,_.jsxs)(a,{children:[`The report "`,t,`" could not be found. It may have been removed or renamed.`]})]})}):(0,_.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,_.jsx)(r,{className:`h-8 w-8 animate-spin text-muted-foreground`})});let J=e=>{let t={...e};if(!t.title&&t.label&&(t.title=t.label),!t.fields&&Array.isArray(t.columns)&&(t.fields=t.columns.map(e=>({name:e.field||e.name,label:e.label,type:e.type,format:e.format,renderAs:e.renderAs,colorMap:e.colorMap,...e.aggregate?{aggregation:e.aggregate,showInSummary:!0}:{}}))),t.fields&&Array.isArray(t.fields)&&t.fields.length>0){let n=t.fields.some(e=>e.showInSummary||e.aggregation),r=t.reportType||`tabular`,i=[];if((r===`summary`||n)&&i.push({type:`summary`,title:`Key Metrics`}),i.push({type:`table`,title:`Details`,columns:t.fields.map(e=>({name:e.name,label:e.label,type:e.type,format:e.format,renderAs:e.renderAs,colorMap:e.colorMap}))}),t.chartConfig?.chartType&&i.push({type:`chart`,title:`Chart`,chart:{type:`chart`,chartType:t.chartConfig.chartType,xAxisField:t.chartConfig.xAxisField,yAxisFields:t.chartConfig.yAxisFields}}),Array.isArray(e.sections)){let n=e.sections.filter(e=>e.type===`chart`&&!t.chartConfig?.chartType);i.push(...n)}t.sections=i}else t.sections||=[];return t},Y=j||k,X={type:`report-viewer`,report:J(Y),data:N,showToolbar:!0,allowExport:!0,loading:F};return(0,_.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-background`,children:[(0,_.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:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`h1`,{className:`text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate`,children:Y.title||Y.label||`Report Viewer`}),Y.description&&(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:Y.description})]}),(0,_.jsx)(`div`,{className:`shrink-0 flex items-center gap-1.5`,children:(0,_.jsxs)(`button`,{type:`button`,onClick:z,className:`inline-flex items-center gap-1.5 rounded-md border border-input bg-background px-2.5 py-1.5 text-xs font-medium text-muted-foreground shadow-sm hover:bg-accent hover:text-accent-foreground`,"data-testid":`report-edit-button`,children:[(0,_.jsx)(o,{className:`h-3.5 w-3.5`}),`Edit`]})})]}),(0,_.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col sm:flex-row relative`,children:[(0,_.jsx)(`div`,{className:`flex-1 min-w-0 overflow-auto p-4 sm:p-6 lg:p-8 bg-muted/5`,children:(0,_.jsx)(`div`,{className:`max-w-5xl mx-auto shadow-sm border rounded-lg sm:rounded-xl bg-background overflow-hidden min-h-150`,children:(0,_.jsx)(f,{schema:X})})}),(0,_.jsx)(p,{open:b,onClose:B,config:V,onSave:H,onFieldChange:U,availableFields:L}),(0,_.jsx)(h,{open:n,sections:[{title:`Report Configuration`,data:Y}]})]})]})}export{y as ReportView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./plugins-core-B8C8BUw8.js";export{e as RichTextField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./framework-B0ex8RpF.js";import{ks as t}from"./plugins-core-B8C8BUw8.js";import{c as n}from"./infrastructure-88EEJ8ZY.js";import{t as r}from"./SystemObjectViewPage-D2qKWQRW.js";var i=e();function a(){let{user:e}=n();return(0,i.jsx)(r,{objectName:`sys_role`,title:`Role Management`,description:`Define roles and assign permissions`,icon:t,isAdmin:e?.role===`admin`})}export{a as RoleManagementPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Io as r,Ps as i,To as a,Wc as o,Zc as s,kl as c,sn as l,vl as u,wc as d,wo as f}from"./plugins-core-B8C8BUw8.js";import{d as p,i as m,u as h}from"./ui-layout-CvxBdH1V.js";import{n as g}from"./MetadataProvider-B6Zo_H9g.js";var _=e(n(),1),v=t();function y(e){let t=[];for(let n of e)n.type===`group`&&n.children?t.push(...y(n.children)):t.push(n);return t}var b={object:s,dashboard:d,page:o,report:u},x={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 S(){let{appName:e}=h(),[t,n]=p(),[o,u]=(0,_.useState)(t.get(`q`)||``),{apps:d}=g(),S=d||[],C=S.find(t=>t.name===e)||S[0],w=`/apps/${e}`,T=(0,_.useMemo)(()=>C?y(C.navigation||[]).map(e=>{let t=`#`;return e.type===`object`?(t=`${w}/${e.objectName}`,e.viewName&&(t+=`/view/${e.viewName}`)):e.type===`dashboard`?t=`${w}/dashboard/${e.dashboardName}`:e.type===`page`?t=`${w}/page/${e.pageName}`:e.type===`report`&&(t=`${w}/report/${e.reportName}`),{id:e.id,label:e.label||e.objectName||e.dashboardName||e.pageName||e.reportName||``,href:t,type:e.type,description:e.description}}).filter(e=>e.href!==`#`):[],[C,w]),E=(0,_.useMemo)(()=>{if(!o.trim())return T;let e=o.toLowerCase();return T.filter(t=>t.label.toLowerCase().includes(e)||t.type.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))},[T,o]),D=e=>{u(e),n(e?{q:e}:{})},O=(0,_.useMemo)(()=>{let e={};for(let t of E)(e[t.type]||=[]).push(t);return e},[E]);return(0,v.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6 max-w-4xl mx-auto`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,v.jsxs)(m,{to:w,className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors`,children:[(0,v.jsx)(c,{className:`h-4 w-4`}),`Back`]}),(0,v.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Search`})]}),(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(`label`,{htmlFor:`search-results-input`,className:`sr-only`,children:`Search objects, dashboards, pages, reports`}),(0,v.jsx)(i,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),(0,v.jsx)(l,{id:`search-results-input`,value:o,onChange:e=>D(e.target.value),placeholder:`Search objects, dashboards, pages, reports...`,className:`pl-10 h-11 text-base`,autoFocus:!0})]}),(0,v.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:o.trim()?`${E.length} result${E.length===1?``:`s`} for "${o}"`:`${T.length} items available`}),E.length===0?(0,v.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center`,children:[(0,v.jsx)(i,{className:`h-12 w-12 text-muted-foreground/30 mb-4`}),(0,v.jsx)(`p`,{className:`text-lg font-medium text-muted-foreground`,children:`No results found`}),(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground/80 mt-1`,children:`Try adjusting your search terms`})]}):(0,v.jsx)(`div`,{className:`space-y-6`,children:Object.entries(O).map(([e,t])=>(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`h2`,{className:`text-sm font-medium text-muted-foreground mb-2 flex items-center gap-1.5`,children:[(0,v.jsx)(b[e]||s,{className:`h-4 w-4`}),e.charAt(0).toUpperCase()+e.slice(1),`s`,(0,v.jsx)(r,{variant:`secondary`,className:`ml-1 text-xs`,children:t.length})]}),(0,v.jsx)(`div`,{className:`grid gap-2`,children:t.map(e=>{let t=b[e.type]||s;return(0,v.jsx)(m,{to:e.href,className:`rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,children:(0,v.jsx)(f,{className:`hover:bg-accent/50 transition-colors cursor-pointer`,children:(0,v.jsxs)(a,{className:`flex items-center gap-3 p-3`,children:[(0,v.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded ${x[e.type]||``}`,children:(0,v.jsx)(t,{className:`h-4 w-4`})}),(0,v.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,v.jsx)(`p`,{className:`text-sm font-medium truncate`,children:e.label}),e.description&&(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:e.description})]}),(0,v.jsx)(r,{variant:`outline`,className:`text-xs shrink-0`,children:e.type})]})})},e.id)})})]},e))})]})}export{S as SearchResultsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{tt as e}from"./plugins-core-B8C8BUw8.js";export{e as SelectField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as e}from"./plugins-core-B8C8BUw8.js";export{e as SignatureField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./plugins-core-B8C8BUw8.js";export{e as SliderField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as e}from"./plugins-core-B8C8BUw8.js";export{e as SummaryField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{k as t,z as n}from"./framework-B0ex8RpF.js";import{Do as r,Ec as i,Eo as a,Fs as o,Io as s,Oo as c,To as l,_c as u,ks as d,os as f,ss as p,wo as m,xl as h}from"./plugins-core-B8C8BUw8.js";import{l as g,u as _}from"./ui-layout-CvxBdH1V.js";import{n as v}from"./MetadataProvider-B6Zo_H9g.js";import{n as y}from"./AdapterProvider-BMMNYOio.js";import{t as b}from"./getIcon-DUhh_MlU.js";import{n as x}from"./metadataTypeRegistry-D4RkPQA-.js";var S=e(n(),1),C=t();function w(){let e=g(),{appName:t}=_(),n=t?`/apps/${t}`:``,w=y(),{apps:T,objects:E,dashboards:D,reports:O,pages:k}=v(),[A,j]=(0,S.useState)({apps:null,objects:null,users:null,orgs:null,roles:null,permissions:null,auditLogs:null,dashboard:null,page:null,report:null}),[M,N]=(0,S.useState)(!0),P=(0,S.useCallback)(async()=>{if(w){N(!0);try{let[e,t,n,r,i]=await Promise.all([w.find(`sys_user`).catch(()=>({data:[]})),w.find(`sys_org`).catch(()=>({data:[]})),w.find(`sys_role`).catch(()=>({data:[]})),w.find(`sys_permission`).catch(()=>({data:[]})),w.find(`sys_audit_log`).catch(()=>({data:[]}))]);j({apps:T?.length??0,objects:E?.length??0,users:e.data?.length??0,orgs:t.data?.length??0,roles:n.data?.length??0,permissions:r.data?.length??0,auditLogs:i.data?.length??0,dashboard:D?.length??0,page:k?.length??0,report:O?.length??0})}catch{}finally{N(!1)}}},[w,T,E,D,O,k]);(0,S.useEffect)(()=>{P()},[P]);let F=x().map(e=>{let t=e.customRoute?`${n}${e.customRoute}`:`${n}/system/metadata/${e.type}`,r=b(e.icon),i=null;return i=e.type===`app`?A.apps:e.type===`object`?A.objects:A[e.type]??null,{title:e.pluralLabel,description:e.description,icon:r,href:t,countLabel:e.pluralLabel.toLowerCase(),count:i}}),I=[{title:`Users`,description:`Manage system users and accounts`,icon:f,href:`${n}/system/users`,countLabel:`users`,count:A.users},{title:`Organizations`,description:`Manage organizations and teams`,icon:h,href:`${n}/system/organizations`,countLabel:`organizations`,count:A.orgs},{title:`Roles`,description:`Configure roles and access levels`,icon:d,href:`${n}/system/roles`,countLabel:`roles`,count:A.roles},{title:`Permissions`,description:`Manage permission rules and assignments`,icon:i,href:`${n}/system/permissions`,countLabel:`permissions`,count:A.permissions},{title:`Audit Log`,description:`View system activity and changes`,icon:o,href:`${n}/system/audit-log`,countLabel:`entries`,count:A.auditLogs},{title:`Profile`,description:`View and edit your account settings`,icon:p,href:`${n}/system/profile`,countLabel:``,count:null}],L=[...F,...I];return(0,C.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`System Settings`}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage applications, users, roles, permissions, and system configuration`})]}),M&&(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,C.jsx)(u,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading statistics...`]}),(0,C.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:L.map(t=>{let n=t.icon;return(0,C.jsxs)(m,{className:`cursor-pointer transition-colors hover:bg-accent/50`,onClick:()=>e(t.href),"data-testid":`hub-card-${t.title.toLowerCase().replace(/\s+/g,`-`)}`,role:`link`,tabIndex:0,"aria-label":`${t.title}: ${t.description}`,onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),e(t.href))},children:[(0,C.jsxs)(r,{className:`flex flex-row items-center gap-3 pb-2`,children:[(0,C.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,C.jsx)(n,{className:`h-5 w-5`})}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(c,{className:`text-base`,children:t.title}),(0,C.jsx)(a,{className:`text-xs`,children:t.description})]})]}),(0,C.jsx)(l,{className:`pt-0`,children:t.count!==null&&(0,C.jsxs)(s,{variant:`secondary`,children:[t.count,` `,t.countLabel]})})]},t.title)})})]})}export{w as SystemHubPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./framework-B0ex8RpF.js";import{n as t}from"./plugins-core-B8C8BUw8.js";import{n}from"./AdapterProvider-BMMNYOio.js";var r=[{name:`sys_user`,label:`Users`,icon:`Users`,fields:[{name:`id`,type:`text`,label:`ID`,readonly:!0},{name:`name`,type:`text`,label:`Name`,required:!0},{name:`email`,type:`email`,label:`Email`,required:!0},{name:`role`,type:`select`,label:`Role`,options:[`admin`,`member`,`viewer`]},{name:`status`,type:`select`,label:`Status`,options:[`active`,`inactive`,`suspended`]},{name:`emailVerified`,type:`boolean`,label:`Email Verified`},{name:`image`,type:`url`,label:`Avatar URL`},{name:`lastLoginAt`,type:`datetime`,label:`Last Login`,readonly:!0},{name:`createdAt`,type:`datetime`,label:`Created At`,readonly:!0},{name:`updatedAt`,type:`datetime`,label:`Updated At`,readonly:!0}],titleFormat:`{name}`,views:[{name:`all`,label:`All Users`,type:`grid`,columns:[`name`,`email`,`role`,`status`,`lastLoginAt`]}]},{name:`sys_org`,label:`Organizations`,icon:`Building2`,fields:[{name:`id`,type:`text`,label:`ID`,readonly:!0},{name:`name`,type:`text`,label:`Organization Name`,required:!0},{name:`slug`,type:`text`,label:`Slug`,required:!0},{name:`description`,type:`textarea`,label:`Description`},{name:`plan`,type:`select`,label:`Plan`,options:[`free`,`pro`,`enterprise`]},{name:`status`,type:`select`,label:`Status`,options:[`active`,`inactive`,`suspended`]},{name:`memberCount`,type:`number`,label:`Members`,readonly:!0},{name:`createdAt`,type:`datetime`,label:`Created At`,readonly:!0}],titleFormat:`{name}`,views:[{name:`all`,label:`All Organizations`,type:`grid`,columns:[`name`,`slug`,`plan`,`status`,`memberCount`]}]},{name:`sys_role`,label:`Roles`,icon:`Shield`,fields:[{name:`id`,type:`text`,label:`ID`,readonly:!0},{name:`name`,type:`text`,label:`Role Name`,required:!0},{name:`description`,type:`textarea`,label:`Description`},{name:`permissions`,type:`text`,label:`Permissions`},{name:`isSystem`,type:`boolean`,label:`System Role`,readonly:!0},{name:`userCount`,type:`number`,label:`Users`,readonly:!0},{name:`createdAt`,type:`datetime`,label:`Created At`,readonly:!0}],titleFormat:`{name}`,views:[{name:`all`,label:`All Roles`,type:`grid`,columns:[`name`,`description`,`isSystem`,`userCount`]}]},{name:`sys_permission`,label:`Permissions`,icon:`Key`,fields:[{name:`id`,type:`text`,label:`ID`,readonly:!0},{name:`name`,type:`text`,label:`Permission Name`,required:!0},{name:`description`,type:`textarea`,label:`Description`},{name:`resource`,type:`text`,label:`Resource`},{name:`action`,type:`select`,label:`Action`,options:[`create`,`read`,`update`,`delete`,`manage`]},{name:`createdAt`,type:`datetime`,label:`Created At`,readonly:!0}],titleFormat:`{name}`,views:[{name:`all`,label:`All Permissions`,type:`grid`,columns:[`name`,`resource`,`action`,`description`]}]},{name:`sys_audit_log`,label:`Audit Log`,icon:`ScrollText`,fields:[{name:`id`,type:`text`,label:`ID`,readonly:!0},{name:`action`,type:`text`,label:`Action`,readonly:!0},{name:`resource`,type:`text`,label:`Resource`,readonly:!0},{name:`resourceId`,type:`text`,label:`Resource ID`,readonly:!0},{name:`userId`,type:`text`,label:`User ID`,readonly:!0},{name:`userName`,type:`text`,label:`User Name`,readonly:!0},{name:`ipAddress`,type:`text`,label:`IP Address`,readonly:!0},{name:`details`,type:`textarea`,label:`Details`,readonly:!0},{name:`createdAt`,type:`datetime`,label:`Timestamp`,readonly:!0}],titleFormat:`{action} on {resource}`,views:[{name:`all`,label:`All Logs`,type:`grid`,columns:[`action`,`resource`,`userName`,`ipAddress`,`createdAt`]}]}],i=e();function a({objectName:e,title:a,description:o,icon:s,readOnly:c=!1,isAdmin:l=!1}){let u=n(),d=r.find(t=>t.name===e);if(!d)return(0,i.jsx)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6`,"data-testid":`system-page-${e}`,children:(0,i.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`System object "`,e,`" not found in metadata definitions.`]})});let f=d.views?.[0],p=!c&&l,m={type:`object-view`,objectName:e,showSearch:!0,showFilters:!0,showSort:!0,showCreate:p,table:{columns:f?.columns},operations:{create:p,update:p,delete:p}};return(0,i.jsxs)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6`,"data-testid":`system-page-${e}`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,i.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,i.jsx)(s,{className:`h-5 w-5 text-primary`})}),(0,i.jsxs)(`div`,{className:`min-w-0`,children:[(0,i.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:a}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:o})]})]}),u&&(0,i.jsx)(t,{schema:m,dataSource:u})]})}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Y as e}from"./plugins-core-B8C8BUw8.js";export{e as TextAreaField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{it as e}from"./plugins-core-B8C8BUw8.js";export{e as TextField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as e}from"./plugins-core-B8C8BUw8.js";export{e as TimeField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Z as e}from"./plugins-core-B8C8BUw8.js";export{e as UrlField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./plugins-core-B8C8BUw8.js";export{e as UserField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e}from"./framework-B0ex8RpF.js";import{os as t}from"./plugins-core-B8C8BUw8.js";import{c as n}from"./infrastructure-88EEJ8ZY.js";import{t as r}from"./SystemObjectViewPage-D2qKWQRW.js";var i=e();function a(){let{user:e}=n();return(0,i.jsx)(r,{objectName:`sys_user`,title:`User Management`,description:`Manage system users and their roles`,icon:t,isAdmin:e?.role===`admin`})}export{a as UserManagementPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as e}from"./plugins-core-B8C8BUw8.js";export{e as VectorField};
|