@objectstack/console 7.4.0 → 7.5.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.
Files changed (47) hide show
  1. package/dist/assets/{AiPendingActionsPage-C2C3Ja_n.js → AiPendingActionsPage-lmvGLNua.js} +1 -1
  2. package/dist/assets/{ApiConsolePage-ePJcxhf9.js → ApiConsolePage-2Hfplikq.js} +1 -1
  3. package/dist/assets/{AppManagementPage-CFHAXcEw.js → AppManagementPage-CvdaGmZp.js} +1 -1
  4. package/dist/assets/{ApprovalsInboxPage-DuHpUtLO.js → ApprovalsInboxPage-DDI1tDfy.js} +1 -1
  5. package/dist/assets/{AuditLogPage-Dw6wpFTf.js → AuditLogPage-B_XhBMoJ.js} +1 -1
  6. package/dist/assets/{ComponentNavView-DyNUAEnY.js → ComponentNavView-DscbHf4h.js} +1 -1
  7. package/dist/assets/{ConsoleFloatingChatbot-vOXH4hva.js → ConsoleFloatingChatbot-CIW0GtvK.js} +1 -1
  8. package/dist/assets/{DeveloperHubPage-Di9VELMr.js → DeveloperHubPage-CJ7NZxLQ.js} +1 -1
  9. package/dist/assets/{FlowRunsPage-C2ElJEUw.js → FlowRunsPage-0KW8LdCn.js} +1 -1
  10. package/dist/assets/{ProfilePage-DbEzcgM3.js → ProfilePage-wEhY3kyx.js} +1 -1
  11. package/dist/assets/{PublicFormsPage-CFO_htk4.js → PublicFormsPage-BkfIcEml.js} +1 -1
  12. package/dist/assets/{SettingsHub-RgZdAo3g.js → SettingsHub-BLGHmF-y.js} +1 -1
  13. package/dist/assets/{SettingsView-C4bpsbjP.js → SettingsView-tuRcbYy6.js} +1 -1
  14. package/dist/assets/{SystemHubPage-DCtNkrqu.js → SystemHubPage-B-apkIco.js} +1 -1
  15. package/dist/assets/{highlighted-body-OFNGDK62-DolMghKp.js → highlighted-body-OFNGDK62-DzZ5rNlx.js} +1 -1
  16. package/dist/assets/{index-D8443YMB.js → index-CiY4zPLP.js} +7 -7
  17. package/dist/assets/index-ljRQeZRW.css +2 -0
  18. package/dist/assets/mermaid-GHXKKRXX-CwDRCmSe.js +1 -0
  19. package/dist/assets/{plugin-calendar-CQDuOrA8.js → plugin-calendar-CHvFKG6D.js} +1 -1
  20. package/dist/assets/plugin-charts-BvH5iWMS.js +7 -0
  21. package/dist/assets/{plugin-chatbot-MXXPNrIm.js → plugin-chatbot-CeHz9iQm.js} +3 -3
  22. package/dist/assets/plugin-dashboard-CXLv53tc.js +3 -0
  23. package/dist/assets/{plugin-form-DGz9Ldoi.js → plugin-form-CoZn3nk3.js} +1 -1
  24. package/dist/assets/{plugin-gantt-Bv3kYo78.js → plugin-gantt-DY4QgxI_.js} +1 -1
  25. package/dist/assets/{plugin-grid-X6RP2gd8.js → plugin-grid-CNT3y-BZ.js} +1 -1
  26. package/dist/assets/{plugin-kanban-BhsP-1E9.js → plugin-kanban-DSD6E3zx.js} +1 -1
  27. package/dist/assets/{plugin-map-Bl9-aL25.js → plugin-map-dgG_mKQS.js} +1 -1
  28. package/dist/assets/{plugin-markdown-DSLEFWrT.js → plugin-markdown-CWpRZuHu.js} +1 -1
  29. package/dist/assets/{plugin-report-DcNaFUN2.js → plugin-report-BFZ-T3Th.js} +1 -1
  30. package/dist/assets/{plugin-timeline-Bb7f-Qd7.js → plugin-timeline-Dk3Nk3zI.js} +1 -1
  31. package/dist/assets/plugin-view-B8Wznem_.js +1 -0
  32. package/dist/assets/plugins-views-CBhDf8Cj.js +4 -0
  33. package/dist/assets/{src-AD-6EnzK.js → src-CwB7sUUJ.js} +1 -1
  34. package/dist/assets/{types-BYLUnF0C.js → types-B9HyZbLK.js} +1 -1
  35. package/dist/assets/ui-components-Dv0hQu4t.js +41 -0
  36. package/dist/assets/{ui-layout-C9W0Gcnt.js → ui-layout-fny5eaNl.js} +1 -1
  37. package/dist/assets/vendor-charts-BWpBMKWq.js +39 -0
  38. package/dist/index.html +3 -3
  39. package/package.json +1 -1
  40. package/dist/assets/index-C2SC5SiS.css +0 -2
  41. package/dist/assets/mermaid-GHXKKRXX-qaGVEVOV.js +0 -1
  42. package/dist/assets/plugin-charts-BDWqi8DX.js +0 -7
  43. package/dist/assets/plugin-dashboard-Do4xOja1.js +0 -3
  44. package/dist/assets/plugin-view-DoIbSHeI.js +0 -1
  45. package/dist/assets/plugins-views-BNDN6gD4.js +0 -4
  46. package/dist/assets/ui-components-D0tUqjB3.js +0 -41
  47. package/dist/assets/vendor-charts-Ba_-W-di.js +0 -36
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{f as t,m as n,r,y as i}from"./vendor-react-CyVA1SE-.js";import{r as a}from"./framework-Bsl5NTfe.js";import{At as o,Bt as s,Ea as c,Gn as l,Ha as u,Ht as d,Jt as f,Kn as p,Ls as m,Lt as h,Q as g,Qn as _,Rt as v,Ta as y,Ti as b,Vt as x,Yt as S,en as C,in as w,ir as T,lt as E,mr as D,nr as O,ns as k,qn as A,rr as j,ut as M,zt as N}from"./ui-components-D0tUqjB3.js";import{o as P}from"./vendor-ui-utils-BbOuugky.js";import{a as F,i as I,n as L,o as R,t as z}from"./types-BYLUnF0C.js";var B=e(i(),1),V=r();function H({reason:e,className:t}){return(0,V.jsxs)(_,{variant:`outline`,className:`gap-1 border-amber-300 bg-amber-50 text-amber-900 ${t??``}`,title:e??`Pinned by environment variable — cannot be edited from the UI.`,children:[(0,V.jsx)(y,{className:`h-3 w-3`}),`Locked by env`]})}function U({resolved:e,labels:t}){let n=e.cascadeChain;if(!n||n.length===0)return null;let r=n.find(e=>e.effective)??n[n.length-1],i=n.find(e=>e!==r&&e.value!==null&&e.value!==void 0),a=e=>t?.sourceLabel?.(e)??e;return r.scope!==`default`&&r.scope!==`user`&&r.scope!==`tenant`?(0,V.jsxs)(_,{variant:`outline`,className:`text-blue-700 border-blue-300 text-[10px]`,children:[`Inherited from `,a(r.scope)]}):i?(0,V.jsxs)(_,{variant:`outline`,className:`text-amber-700 border-amber-300 text-[10px]`,children:[`Overrides `,a(i.scope)]}):null}function W({spec:e,resolved:t,labelText:n,labels:r}){return(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(w,{className:`text-sm font-medium`,children:[n,e.required?(0,V.jsx)(`span`,{className:`ml-0.5 text-destructive`,children:`*`}):null]}),e.deprecated?(0,V.jsxs)(_,{variant:`outline`,className:`text-amber-700 border-amber-300`,children:[`Deprecated`,e.replacedBy?` → ${e.replacedBy}`:``]}):null,t?.locked?(0,V.jsx)(H,{reason:t.lockedReason}):null,t&&!t.locked?(0,V.jsx)(U,{resolved:t,labels:r}):null,t?.source&&t.source!==`default`&&!t.locked?(0,V.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:r?.sourceLabel?.(t.source)??t.source}):null]})}function G({description:e}){return e?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e}):null}function K(e){let{spec:t,resolved:n,value:r,onChange:i,onAction:a,locked:o,saving:c,labels:p}=e,m=(0,B.useId)(),_=!!(o||c),y=z(t.label),b=t.key&&p?p.fieldLabel(t.key,y):y,A=t.key&&p?p.fieldHelp(t.key,t.description):t.description;if(t.type===`group`){let e=t.id&&p?p.groupTitle(t.id,y):y,n=t.id&&p?p.groupDescription(t.id,t.description):t.description;return(0,V.jsxs)(`div`,{className:`pt-6 pb-2`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight text-foreground/90`,children:e}),n?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n}):null,(0,V.jsx)(h,{className:`mt-3`})]})}if(t.type===`info_banner`)return(0,V.jsxs)(O,{variant:t.bannerSeverity===`error`?`destructive`:`default`,className:`my-2`,children:[(0,V.jsx)(u,{className:`h-4 w-4`}),(0,V.jsx)(T,{children:y}),t.bannerText?(0,V.jsx)(j,{children:t.bannerText}):null]});if(t.type===`child_pane`)return(0,V.jsxs)(`a`,{href:`#/settings/${t.childNamespace}`,className:`flex items-center justify-between rounded-md border border-border bg-card px-4 py-3 hover:bg-accent transition-colors`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-medium`,children:y}),t.description?(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.description}):null]}),(0,V.jsx)(k,{className:`h-4 w-4 text-muted-foreground`})]});if(t.type===`title_value`)return(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-2`,children:[(0,V.jsx)(W,{spec:t,resolved:n,labelText:b,labels:p}),(0,V.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:String(r??`—`)})]});if(t.type===`action_button`){let e=t.icon?R(t.icon):null,n=t.id??t.key??`test`,r=p?p.actionLabel(n,y):y;return(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-medium`,children:r}),t.description?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:t.description}):null]}),(0,V.jsxs)(D,{size:`sm`,variant:`secondary`,onClick:a,disabled:c,children:[e?(0,V.jsx)(e,{className:`h-4 w-4 mr-1.5`}):null,r]})]})}let P=e=>(0,V.jsxs)(`div`,{className:`space-y-1.5 py-2`,children:[(0,V.jsx)(W,{spec:t,resolved:n,labelText:b,labels:p}),e,(0,V.jsx)(G,{description:A})]}),F=e=>{let n=typeof e.label==`string`?e.label:e.label?.defaultValue??String(e.value);return!t.key||!p?n:p.optionLabel(t.key,String(e.value),n)};switch(t.type){case`text`:case`email`:case`url`:case`phone`:return P((0,V.jsx)(C,{id:m,type:t.type===`email`?`email`:t.type===`url`?`url`:`text`,value:r??``,minLength:t.minLength,maxLength:t.maxLength,pattern:t.pattern,disabled:_,onChange:e=>i(e.target.value)}));case`password`:return P((0,V.jsx)(C,{id:m,type:`password`,autoComplete:`new-password`,placeholder:r?`••••••••`:``,disabled:_,onChange:e=>i(e.target.value)}));case`textarea`:return P((0,V.jsx)(g,{id:m,rows:t.rows??4,value:r??``,minLength:t.minLength,maxLength:t.maxLength,disabled:_,onChange:e=>i(e.target.value)}));case`number`:return P((0,V.jsx)(C,{id:m,type:`number`,value:r,min:t.min,max:t.max,step:t.step,disabled:_,onChange:e=>i(e.target.value===``?null:Number(e.target.value))}));case`toggle`:return(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(W,{spec:t,resolved:n,labelText:b,labels:p}),(0,V.jsx)(G,{description:A})]}),(0,V.jsx)(E,{id:m,checked:!!r,disabled:_,onCheckedChange:e=>i(e)})]});case`select`:return P((0,V.jsxs)(v,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:_,children:[(0,V.jsx)(x,{id:m,children:(0,V.jsx)(d,{placeholder:`Select…`})}),(0,V.jsx)(N,{children:t.options?.map(e=>(0,V.jsx)(s,{value:String(e.value),children:F(e)},String(e.value)))})]}));case`radio`:return P((0,V.jsx)(f,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:_,children:t.options?.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,V.jsx)(S,{value:String(e.value),id:`${m}-${e.value}`}),(0,V.jsx)(w,{htmlFor:`${m}-${e.value}`,className:`text-sm font-normal`,children:F(e)})]},String(e.value)))}));case`multiselect`:{let e=Array.isArray(r)?r:[];return P((0,V.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.options?.map(t=>{let n=String(t.value);return(0,V.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(l,{checked:e.map(String).includes(n),disabled:_,onCheckedChange:t=>{let r=new Set(e.map(String));t?r.add(n):r.delete(n),i(Array.from(r))}}),F(t)]},n)})}))}case`slider`:return P((0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(M,{value:[Number(r??t.min??0)],min:t.min??0,max:t.max??100,step:t.step??1,disabled:_,onValueChange:e=>i(e[0]),className:`flex-1`}),(0,V.jsx)(`span`,{className:`text-sm tabular-nums w-12 text-right`,children:String(r??t.min??0)})]}));case`color`:return P((0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(C,{id:m,type:`color`,value:r??`#000000`,disabled:_,onChange:e=>i(e.target.value),className:`w-16 h-9 p-1`}),(0,V.jsx)(C,{value:r??``,disabled:_,onChange:e=>i(e.target.value),className:`flex-1 font-mono text-sm`})]}));case`json`:return P((0,V.jsx)(g,{id:m,rows:t.rows??6,className:`font-mono text-xs`,value:typeof r==`string`?r:JSON.stringify(r??null,null,2),disabled:_,onChange:e=>i(e.target.value)}));default:return P((0,V.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[`Unsupported specifier type: `,t.type]}))}}var q=new Set([`common`,`validation`,`errors`,`system`,`auth`]);function J(e){let{t,i18n:n}=a();return(0,B.useMemo)(()=>{let r=()=>{if(!n||typeof n.getResourceBundle!=`function`)return[];let e=n.language||`en`,t=n.getResourceBundle(e,`translation`);return t?Object.keys(t).filter(e=>!q.has(e)&&t[e]&&typeof t[e]==`object`&&t[e].settings):[]},i=(n,i)=>{if(!e)return i;try{let i=r();for(let r of i){let i=`${r}.settings.${e}.${n}`,a=t(i,{defaultValue:``});if(a&&a!==i&&a!==``)return a}}catch{}return i},a=(e,r)=>{try{if(!n||typeof n.getResourceBundle!=`function`)return r;let i=n.language||`en`,a=n.getResourceBundle(i,`translation`);if(!a)return r;for(let n of Object.keys(a)){if(q.has(n))continue;let r=a[n];if(!r||typeof r!=`object`||!(`settingsCommon`in r))continue;let i=`${n}.settingsCommon.${e}`,o=t(i,{defaultValue:``});if(o&&o!==i&&o!==``)return o}}catch{}return r},o={env:`Env`,global:`Global`,tenant:`Tenant`,user:`User`,default:`Default`};return{title:e=>i(`title`,e)??e,description:e=>i(`description`,e),groupTitle:(e,t)=>i(`groups.${e}.title`,t)??t,groupDescription:(e,t)=>i(`groups.${e}.description`,t),fieldLabel:(e,t)=>i(`keys.${e}.label`,t)??t,fieldHelp:(e,t)=>i(`keys.${e}.help`,t),fieldPlaceholder:(e,t)=>i(`keys.${e}.placeholder`,t),optionLabel:(e,t,n)=>i(`keys.${e}.options.${t}`,n)??n,actionLabel:(e,t)=>i(`actions.${e}.label`,t)??t,actionConfirm:(e,t)=>i(`actions.${e}.confirmText`,t),actionSuccess:(e,t)=>i(`actions.${e}.successMessage`,t),sourceLabel:e=>a(`sourceLabels.${e}`,o[e]??e)}},[e,t,n,n?.language])}function Y(e,t){if(!e)return!0;let n=e.trim().match(/^\$\{(.+)\}$/);if(!n)return!0;try{return!!Function(`data`,`with (data) { return (${n[1]}); }`)(t)}catch{return!0}}function X(){let e=n(),r=t(),i=e.namespace??``,[a,s]=(0,B.useState)(null),[l,u]=(0,B.useState)(!0),[d,f]=(0,B.useState)(!1),[h,g]=(0,B.useState)(null),[v,y]=(0,B.useState)({}),x=(0,B.useCallback)(async()=>{u(!0),g(null);try{s(await L(i)),y({})}catch(e){g(e?.message??`Failed to load settings`)}finally{u(!1)}},[i]);(0,B.useEffect)(()=>{i&&x()},[i,x]);let S=(0,B.useMemo)(()=>{let e={};if(!a)return e;for(let[t,n]of Object.entries(a.values))e[t]=n.value;return{...e,...v}},[a,v]),C=(0,B.useMemo)(()=>Object.keys(v),[v]),w=J(i);if(!i)return(0,V.jsx)(`div`,{className:`p-6 text-muted-foreground`,children:`No namespace selected.`});if(l)return(0,V.jsxs)(`div`,{className:`p-6 space-y-3 max-w-3xl`,children:[(0,V.jsx)(o,{className:`h-8 w-1/3`}),(0,V.jsx)(o,{className:`h-4 w-2/3`}),(0,V.jsx)(o,{className:`h-32 w-full`}),(0,V.jsx)(o,{className:`h-32 w-full`})]});if(h)return(0,V.jsxs)(`div`,{className:`p-6 max-w-3xl`,children:[(0,V.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:()=>r(-1),children:[(0,V.jsx)(m,{className:`h-4 w-4 mr-1`}),` Back`]}),(0,V.jsx)(p,{className:`mt-3`,children:(0,V.jsx)(A,{className:`py-8 text-center text-sm text-destructive`,children:h})})]});if(!a)return null;let{manifest:T,values:E}=a,O=T.icon?R(T.icon):null,k=w.title(z(T.label)),j=w.description(T.description),M=async()=>{if(C.length!==0){f(!0);try{let e=await F(i,v);s({...a,values:{...E,...e.values}}),y({}),P.success(`Settings saved`)}catch(e){e?.payload?.error?.code===`SETTINGS_LOCKED`?P.error(`Locked by environment: ${e.payload.error.key}`):P.error(e?.message??`Save failed`)}finally{f(!1)}}},N=async e=>{f(!0);try{let t=await I(i,e,v);t.ok?P.success(t.message??`Action succeeded`):P.error(t.message??`Action failed`)}catch(e){P.error(e?.message??`Action failed`)}finally{f(!1)}};return(0,V.jsxs)(`div`,{className:`p-6 max-w-3xl mx-auto pb-32`,children:[(0,V.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:()=>r(`/system/settings`),children:[(0,V.jsx)(m,{className:`h-4 w-4 mr-1`}),` All settings`]}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-start gap-3`,children:[O?(0,V.jsx)(O,{className:`h-7 w-7 mt-0.5 text-muted-foreground`}):null,(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:k}),T.beta?(0,V.jsx)(_,{variant:`secondary`,children:`Beta`}):null]}),j?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:j}):null]})]}),T.helpText?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-4 whitespace-pre-wrap`,children:T.helpText}):null,(0,V.jsx)(`div`,{className:`mt-6 divide-y`,children:T.specifiers.filter(e=>Y(e.visible,S)).map((e,t)=>{let n=e.key,r=n?E[n]:void 0;return(0,V.jsx)(K,{spec:e,resolved:r,value:n?n in v?v[n]:r?.value:void 0,onChange:e=>n&&y(t=>({...t,[n]:e})),onAction:e.type===`action_button`?()=>N(e.id??n??`test`):void 0,locked:r?.locked,saving:d,labels:w},(n??`_layout_${t}`)+t)})}),C.length>0?(0,V.jsx)(`div`,{className:`fixed bottom-0 inset-x-0 bg-background/95 backdrop-blur border-t shadow-lg z-40`,children:(0,V.jsxs)(`div`,{className:`max-w-3xl mx-auto px-6 py-3 flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[C.length,` unsaved change`,C.length>1?`s`:``]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:()=>y({}),disabled:d,children:[(0,V.jsx)(b,{className:`h-4 w-4 mr-1`}),` Discard`]}),(0,V.jsxs)(D,{onClick:M,disabled:d,children:[d?(0,V.jsx)(c,{className:`h-4 w-4 mr-1 animate-spin`}):null,`Save changes`]})]})]})}):null]})}export{X as SettingsView};
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{f as t,m as n,r,y as i}from"./vendor-react-CyVA1SE-.js";import{r as a}from"./framework-Bsl5NTfe.js";import{At as o,Bt as s,Ea as c,Gn as l,Ha as u,Ht as d,Jt as f,Kn as p,Ls as m,Lt as h,Q as g,Qn as _,Rt as v,Ta as y,Ti as b,Vt as x,Yt as S,en as C,in as w,ir as T,lt as E,mr as D,nr as O,ns as k,qn as A,rr as j,ut as M,zt as N}from"./ui-components-Dv0hQu4t.js";import{o as P}from"./vendor-ui-utils-BbOuugky.js";import{a as F,i as I,n as L,o as R,t as z}from"./types-B9HyZbLK.js";var B=e(i(),1),V=r();function H({reason:e,className:t}){return(0,V.jsxs)(_,{variant:`outline`,className:`gap-1 border-amber-300 bg-amber-50 text-amber-900 ${t??``}`,title:e??`Pinned by environment variable — cannot be edited from the UI.`,children:[(0,V.jsx)(y,{className:`h-3 w-3`}),`Locked by env`]})}function U({resolved:e,labels:t}){let n=e.cascadeChain;if(!n||n.length===0)return null;let r=n.find(e=>e.effective)??n[n.length-1],i=n.find(e=>e!==r&&e.value!==null&&e.value!==void 0),a=e=>t?.sourceLabel?.(e)??e;return r.scope!==`default`&&r.scope!==`user`&&r.scope!==`tenant`?(0,V.jsxs)(_,{variant:`outline`,className:`text-blue-700 border-blue-300 text-[10px]`,children:[`Inherited from `,a(r.scope)]}):i?(0,V.jsxs)(_,{variant:`outline`,className:`text-amber-700 border-amber-300 text-[10px]`,children:[`Overrides `,a(i.scope)]}):null}function W({spec:e,resolved:t,labelText:n,labels:r}){return(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(w,{className:`text-sm font-medium`,children:[n,e.required?(0,V.jsx)(`span`,{className:`ml-0.5 text-destructive`,children:`*`}):null]}),e.deprecated?(0,V.jsxs)(_,{variant:`outline`,className:`text-amber-700 border-amber-300`,children:[`Deprecated`,e.replacedBy?` → ${e.replacedBy}`:``]}):null,t?.locked?(0,V.jsx)(H,{reason:t.lockedReason}):null,t&&!t.locked?(0,V.jsx)(U,{resolved:t,labels:r}):null,t?.source&&t.source!==`default`&&!t.locked?(0,V.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:r?.sourceLabel?.(t.source)??t.source}):null]})}function G({description:e}){return e?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e}):null}function K(e){let{spec:t,resolved:n,value:r,onChange:i,onAction:a,locked:o,saving:c,labels:p}=e,m=(0,B.useId)(),_=!!(o||c),y=z(t.label),b=t.key&&p?p.fieldLabel(t.key,y):y,A=t.key&&p?p.fieldHelp(t.key,t.description):t.description;if(t.type===`group`){let e=t.id&&p?p.groupTitle(t.id,y):y,n=t.id&&p?p.groupDescription(t.id,t.description):t.description;return(0,V.jsxs)(`div`,{className:`pt-6 pb-2`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight text-foreground/90`,children:e}),n?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n}):null,(0,V.jsx)(h,{className:`mt-3`})]})}if(t.type===`info_banner`)return(0,V.jsxs)(O,{variant:t.bannerSeverity===`error`?`destructive`:`default`,className:`my-2`,children:[(0,V.jsx)(u,{className:`h-4 w-4`}),(0,V.jsx)(T,{children:y}),t.bannerText?(0,V.jsx)(j,{children:t.bannerText}):null]});if(t.type===`child_pane`)return(0,V.jsxs)(`a`,{href:`#/settings/${t.childNamespace}`,className:`flex items-center justify-between rounded-md border border-border bg-card px-4 py-3 hover:bg-accent transition-colors`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-medium`,children:y}),t.description?(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.description}):null]}),(0,V.jsx)(k,{className:`h-4 w-4 text-muted-foreground`})]});if(t.type===`title_value`)return(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-2`,children:[(0,V.jsx)(W,{spec:t,resolved:n,labelText:b,labels:p}),(0,V.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:String(r??`—`)})]});if(t.type===`action_button`){let e=t.icon?R(t.icon):null,n=t.id??t.key??`test`,r=p?p.actionLabel(n,y):y;return(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-medium`,children:r}),t.description?(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:t.description}):null]}),(0,V.jsxs)(D,{size:`sm`,variant:`secondary`,onClick:a,disabled:c,children:[e?(0,V.jsx)(e,{className:`h-4 w-4 mr-1.5`}):null,r]})]})}let P=e=>(0,V.jsxs)(`div`,{className:`space-y-1.5 py-2`,children:[(0,V.jsx)(W,{spec:t,resolved:n,labelText:b,labels:p}),e,(0,V.jsx)(G,{description:A})]}),F=e=>{let n=typeof e.label==`string`?e.label:e.label?.defaultValue??String(e.value);return!t.key||!p?n:p.optionLabel(t.key,String(e.value),n)};switch(t.type){case`text`:case`email`:case`url`:case`phone`:return P((0,V.jsx)(C,{id:m,type:t.type===`email`?`email`:t.type===`url`?`url`:`text`,value:r??``,minLength:t.minLength,maxLength:t.maxLength,pattern:t.pattern,disabled:_,onChange:e=>i(e.target.value)}));case`password`:return P((0,V.jsx)(C,{id:m,type:`password`,autoComplete:`new-password`,placeholder:r?`••••••••`:``,disabled:_,onChange:e=>i(e.target.value)}));case`textarea`:return P((0,V.jsx)(g,{id:m,rows:t.rows??4,value:r??``,minLength:t.minLength,maxLength:t.maxLength,disabled:_,onChange:e=>i(e.target.value)}));case`number`:return P((0,V.jsx)(C,{id:m,type:`number`,value:r,min:t.min,max:t.max,step:t.step,disabled:_,onChange:e=>i(e.target.value===``?null:Number(e.target.value))}));case`toggle`:return(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(W,{spec:t,resolved:n,labelText:b,labels:p}),(0,V.jsx)(G,{description:A})]}),(0,V.jsx)(E,{id:m,checked:!!r,disabled:_,onCheckedChange:e=>i(e)})]});case`select`:return P((0,V.jsxs)(v,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:_,children:[(0,V.jsx)(x,{id:m,children:(0,V.jsx)(d,{placeholder:`Select…`})}),(0,V.jsx)(N,{children:t.options?.map(e=>(0,V.jsx)(s,{value:String(e.value),children:F(e)},String(e.value)))})]}));case`radio`:return P((0,V.jsx)(f,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:_,children:t.options?.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,V.jsx)(S,{value:String(e.value),id:`${m}-${e.value}`}),(0,V.jsx)(w,{htmlFor:`${m}-${e.value}`,className:`text-sm font-normal`,children:F(e)})]},String(e.value)))}));case`multiselect`:{let e=Array.isArray(r)?r:[];return P((0,V.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.options?.map(t=>{let n=String(t.value);return(0,V.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,V.jsx)(l,{checked:e.map(String).includes(n),disabled:_,onCheckedChange:t=>{let r=new Set(e.map(String));t?r.add(n):r.delete(n),i(Array.from(r))}}),F(t)]},n)})}))}case`slider`:return P((0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(M,{value:[Number(r??t.min??0)],min:t.min??0,max:t.max??100,step:t.step??1,disabled:_,onValueChange:e=>i(e[0]),className:`flex-1`}),(0,V.jsx)(`span`,{className:`text-sm tabular-nums w-12 text-right`,children:String(r??t.min??0)})]}));case`color`:return P((0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(C,{id:m,type:`color`,value:r??`#000000`,disabled:_,onChange:e=>i(e.target.value),className:`w-16 h-9 p-1`}),(0,V.jsx)(C,{value:r??``,disabled:_,onChange:e=>i(e.target.value),className:`flex-1 font-mono text-sm`})]}));case`json`:return P((0,V.jsx)(g,{id:m,rows:t.rows??6,className:`font-mono text-xs`,value:typeof r==`string`?r:JSON.stringify(r??null,null,2),disabled:_,onChange:e=>i(e.target.value)}));default:return P((0,V.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[`Unsupported specifier type: `,t.type]}))}}var q=new Set([`common`,`validation`,`errors`,`system`,`auth`]);function J(e){let{t,i18n:n}=a();return(0,B.useMemo)(()=>{let r=()=>{if(!n||typeof n.getResourceBundle!=`function`)return[];let e=n.language||`en`,t=n.getResourceBundle(e,`translation`);return t?Object.keys(t).filter(e=>!q.has(e)&&t[e]&&typeof t[e]==`object`&&t[e].settings):[]},i=(n,i)=>{if(!e)return i;try{let i=r();for(let r of i){let i=`${r}.settings.${e}.${n}`,a=t(i,{defaultValue:``});if(a&&a!==i&&a!==``)return a}}catch{}return i},a=(e,r)=>{try{if(!n||typeof n.getResourceBundle!=`function`)return r;let i=n.language||`en`,a=n.getResourceBundle(i,`translation`);if(!a)return r;for(let n of Object.keys(a)){if(q.has(n))continue;let r=a[n];if(!r||typeof r!=`object`||!(`settingsCommon`in r))continue;let i=`${n}.settingsCommon.${e}`,o=t(i,{defaultValue:``});if(o&&o!==i&&o!==``)return o}}catch{}return r},o={env:`Env`,global:`Global`,tenant:`Tenant`,user:`User`,default:`Default`};return{title:e=>i(`title`,e)??e,description:e=>i(`description`,e),groupTitle:(e,t)=>i(`groups.${e}.title`,t)??t,groupDescription:(e,t)=>i(`groups.${e}.description`,t),fieldLabel:(e,t)=>i(`keys.${e}.label`,t)??t,fieldHelp:(e,t)=>i(`keys.${e}.help`,t),fieldPlaceholder:(e,t)=>i(`keys.${e}.placeholder`,t),optionLabel:(e,t,n)=>i(`keys.${e}.options.${t}`,n)??n,actionLabel:(e,t)=>i(`actions.${e}.label`,t)??t,actionConfirm:(e,t)=>i(`actions.${e}.confirmText`,t),actionSuccess:(e,t)=>i(`actions.${e}.successMessage`,t),sourceLabel:e=>a(`sourceLabels.${e}`,o[e]??e)}},[e,t,n,n?.language])}function Y(e,t){if(!e)return!0;let n=e.trim().match(/^\$\{(.+)\}$/);if(!n)return!0;try{return!!Function(`data`,`with (data) { return (${n[1]}); }`)(t)}catch{return!0}}function X(){let e=n(),r=t(),i=e.namespace??``,[a,s]=(0,B.useState)(null),[l,u]=(0,B.useState)(!0),[d,f]=(0,B.useState)(!1),[h,g]=(0,B.useState)(null),[v,y]=(0,B.useState)({}),x=(0,B.useCallback)(async()=>{u(!0),g(null);try{s(await L(i)),y({})}catch(e){g(e?.message??`Failed to load settings`)}finally{u(!1)}},[i]);(0,B.useEffect)(()=>{i&&x()},[i,x]);let S=(0,B.useMemo)(()=>{let e={};if(!a)return e;for(let[t,n]of Object.entries(a.values))e[t]=n.value;return{...e,...v}},[a,v]),C=(0,B.useMemo)(()=>Object.keys(v),[v]),w=J(i);if(!i)return(0,V.jsx)(`div`,{className:`p-6 text-muted-foreground`,children:`No namespace selected.`});if(l)return(0,V.jsxs)(`div`,{className:`p-6 space-y-3 max-w-3xl`,children:[(0,V.jsx)(o,{className:`h-8 w-1/3`}),(0,V.jsx)(o,{className:`h-4 w-2/3`}),(0,V.jsx)(o,{className:`h-32 w-full`}),(0,V.jsx)(o,{className:`h-32 w-full`})]});if(h)return(0,V.jsxs)(`div`,{className:`p-6 max-w-3xl`,children:[(0,V.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:()=>r(-1),children:[(0,V.jsx)(m,{className:`h-4 w-4 mr-1`}),` Back`]}),(0,V.jsx)(p,{className:`mt-3`,children:(0,V.jsx)(A,{className:`py-8 text-center text-sm text-destructive`,children:h})})]});if(!a)return null;let{manifest:T,values:E}=a,O=T.icon?R(T.icon):null,k=w.title(z(T.label)),j=w.description(T.description),M=async()=>{if(C.length!==0){f(!0);try{let e=await F(i,v);s({...a,values:{...E,...e.values}}),y({}),P.success(`Settings saved`)}catch(e){e?.payload?.error?.code===`SETTINGS_LOCKED`?P.error(`Locked by environment: ${e.payload.error.key}`):P.error(e?.message??`Save failed`)}finally{f(!1)}}},N=async e=>{f(!0);try{let t=await I(i,e,v);t.ok?P.success(t.message??`Action succeeded`):P.error(t.message??`Action failed`)}catch(e){P.error(e?.message??`Action failed`)}finally{f(!1)}};return(0,V.jsxs)(`div`,{className:`p-6 max-w-3xl mx-auto pb-32`,children:[(0,V.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:()=>r(`/system/settings`),children:[(0,V.jsx)(m,{className:`h-4 w-4 mr-1`}),` All settings`]}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-start gap-3`,children:[O?(0,V.jsx)(O,{className:`h-7 w-7 mt-0.5 text-muted-foreground`}):null,(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:k}),T.beta?(0,V.jsx)(_,{variant:`secondary`,children:`Beta`}):null]}),j?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:j}):null]})]}),T.helpText?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-4 whitespace-pre-wrap`,children:T.helpText}):null,(0,V.jsx)(`div`,{className:`mt-6 divide-y`,children:T.specifiers.filter(e=>Y(e.visible,S)).map((e,t)=>{let n=e.key,r=n?E[n]:void 0;return(0,V.jsx)(K,{spec:e,resolved:r,value:n?n in v?v[n]:r?.value:void 0,onChange:e=>n&&y(t=>({...t,[n]:e})),onAction:e.type===`action_button`?()=>N(e.id??n??`test`):void 0,locked:r?.locked,saving:d,labels:w},(n??`_layout_${t}`)+t)})}),C.length>0?(0,V.jsx)(`div`,{className:`fixed bottom-0 inset-x-0 bg-background/95 backdrop-blur border-t shadow-lg z-40`,children:(0,V.jsxs)(`div`,{className:`max-w-3xl mx-auto px-6 py-3 flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[C.length,` unsaved change`,C.length>1?`s`:``]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:()=>y({}),disabled:d,children:[(0,V.jsx)(b,{className:`h-4 w-4 mr-1`}),` Discard`]}),(0,V.jsxs)(D,{onClick:M,disabled:d,children:[d?(0,V.jsx)(c,{className:`h-4 w-4 mr-1 animate-spin`}):null,`Save changes`]})]})]})}):null]})}export{X as SettingsView};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{f as t,m as n,r,y as i}from"./vendor-react-CyVA1SE-.js";import{d as a}from"./infrastructure-CFhpdDcd.js";import{S as o}from"./framework-Bsl5NTfe.js";import{Cs as s,Dr as c,Ea as l,Jn as u,Kn as d,Or as f,Pa as p,Qn as m,Wr as h,Xn as g,Yn as _,Zr as v,_s as y,di as b,hi as x,jo as S,qn as C,yi as w,za as T}from"./ui-components-D0tUqjB3.js";import"./index-D8443YMB.js";var E=e(i(),1),D=r();function O(){let e=t(),{appName:r}=n(),i=r?`/apps/${r}`:``,O=o(),k=a(),[A,j]=(0,E.useState)({users:null,orgs:null,roles:null,permissions:null,auditLogs:null}),[M,N]=(0,E.useState)(!0),P=(0,E.useCallback)(async()=>{if(O){N(!0);try{let[e,t,n,r,i]=await Promise.all([O.find(`sys_user`).catch(()=>({data:[]})),O.find(`sys_org`).catch(()=>({data:[]})),O.find(`sys_role`).catch(()=>({data:[]})),O.find(`sys_permission`).catch(()=>({data:[]})),O.find(`sys_audit_log`).catch(()=>({data:[]}))]);j({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})}catch{}finally{N(!1)}}},[O]);(0,E.useEffect)(()=>{P()},[P]);let F=[{title:`Applications`,description:`Manage all configured applications`,icon:p,href:`${i}/system/apps`,countLabel:``,count:null},{title:`Metadata`,description:`Browse and edit every metadata type the platform exposes`,icon:S,href:`${i}/component/metadata/directory`,countLabel:``,count:null}],I=[{title:`Users`,description:`Manage system users and accounts`,icon:c,href:`${i}/system/users`,countLabel:`users`,count:A.users},{title:`Organizations`,description:`Manage organizations and teams`,icon:y,href:`${i}/system/organizations`,countLabel:`organizations`,count:A.orgs},{title:`Roles`,description:`Configure roles and access levels`,icon:b,href:`${i}/system/roles`,countLabel:`roles`,count:A.roles},{title:`Permissions`,description:`Manage permission rules and assignments`,icon:T,href:`${i}/system/permissions`,countLabel:`permissions`,count:A.permissions},{title:`Audit Log`,description:`View system activity and changes`,icon:w,href:`${i}/system/audit-log`,countLabel:`entries`,count:A.auditLogs},{title:`AI Approvals`,description:`Review actions AI agents propose before they execute`,icon:s,href:`${i}/system/ai-approvals`,countLabel:``,count:null},{title:`App Marketplace`,description:`Browse and install approved apps from the ObjectStack catalog`,icon:v,href:`${i}/system/marketplace`,countLabel:``,count:null,adminOnly:!0},{title:`Settings`,description:`Configure mail, branding, feature flags, and more`,icon:x,href:`${i}/system/settings`,countLabel:``,count:null},{title:`Developer`,description:`API console, flow runs, and public form management`,icon:h,href:`${i}/developer`,countLabel:``,count:null},{title:`Profile`,description:`View and edit your account settings`,icon:f,href:`${i}/system/profile`,countLabel:``,count:null}],L=[...F,...I].filter(e=>!e.adminOnly||k);return(0,D.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`System Settings`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage applications, users, roles, permissions, and system configuration`})]}),M&&(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,D.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading statistics...`]}),(0,D.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:L.map(t=>{let n=t.icon;return(0,D.jsxs)(d,{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,D.jsxs)(_,{className:`flex flex-row items-center gap-3 pb-2`,children:[(0,D.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,D.jsx)(n,{className:`h-5 w-5`})}),(0,D.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,D.jsx)(g,{className:`text-base`,children:t.title}),(0,D.jsx)(u,{className:`text-xs`,children:t.description})]})]}),(0,D.jsx)(C,{className:`pt-0`,children:t.count!==null&&(0,D.jsxs)(m,{variant:`secondary`,children:[t.count,` `,t.countLabel]})})]},t.title)})})]})}export{O as SystemHubPage};
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{f as t,m as n,r,y as i}from"./vendor-react-CyVA1SE-.js";import{d as a}from"./infrastructure-CFhpdDcd.js";import{S as o}from"./framework-Bsl5NTfe.js";import{Cs as s,Dr as c,Ea as l,Jn as u,Kn as d,Or as f,Pa as p,Qn as m,Wr as h,Xn as g,Yn as _,Zr as v,_s as y,di as b,hi as x,jo as S,qn as C,yi as w,za as T}from"./ui-components-Dv0hQu4t.js";import"./index-CiY4zPLP.js";var E=e(i(),1),D=r();function O(){let e=t(),{appName:r}=n(),i=r?`/apps/${r}`:``,O=o(),k=a(),[A,j]=(0,E.useState)({users:null,orgs:null,roles:null,permissions:null,auditLogs:null}),[M,N]=(0,E.useState)(!0),P=(0,E.useCallback)(async()=>{if(O){N(!0);try{let[e,t,n,r,i]=await Promise.all([O.find(`sys_user`).catch(()=>({data:[]})),O.find(`sys_org`).catch(()=>({data:[]})),O.find(`sys_role`).catch(()=>({data:[]})),O.find(`sys_permission`).catch(()=>({data:[]})),O.find(`sys_audit_log`).catch(()=>({data:[]}))]);j({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})}catch{}finally{N(!1)}}},[O]);(0,E.useEffect)(()=>{P()},[P]);let F=[{title:`Applications`,description:`Manage all configured applications`,icon:p,href:`${i}/system/apps`,countLabel:``,count:null},{title:`Metadata`,description:`Browse and edit every metadata type the platform exposes`,icon:S,href:`${i}/component/metadata/directory`,countLabel:``,count:null}],I=[{title:`Users`,description:`Manage system users and accounts`,icon:c,href:`${i}/system/users`,countLabel:`users`,count:A.users},{title:`Organizations`,description:`Manage organizations and teams`,icon:y,href:`${i}/system/organizations`,countLabel:`organizations`,count:A.orgs},{title:`Roles`,description:`Configure roles and access levels`,icon:b,href:`${i}/system/roles`,countLabel:`roles`,count:A.roles},{title:`Permissions`,description:`Manage permission rules and assignments`,icon:T,href:`${i}/system/permissions`,countLabel:`permissions`,count:A.permissions},{title:`Audit Log`,description:`View system activity and changes`,icon:w,href:`${i}/system/audit-log`,countLabel:`entries`,count:A.auditLogs},{title:`AI Approvals`,description:`Review actions AI agents propose before they execute`,icon:s,href:`${i}/system/ai-approvals`,countLabel:``,count:null},{title:`App Marketplace`,description:`Browse and install approved apps from the ObjectStack catalog`,icon:v,href:`${i}/system/marketplace`,countLabel:``,count:null,adminOnly:!0},{title:`Settings`,description:`Configure mail, branding, feature flags, and more`,icon:x,href:`${i}/system/settings`,countLabel:``,count:null},{title:`Developer`,description:`API console, flow runs, and public form management`,icon:h,href:`${i}/developer`,countLabel:``,count:null},{title:`Profile`,description:`View and edit your account settings`,icon:f,href:`${i}/system/profile`,countLabel:``,count:null}],L=[...F,...I].filter(e=>!e.adminOnly||k);return(0,D.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`System Settings`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage applications, users, roles, permissions, and system configuration`})]}),M&&(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,D.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading statistics...`]}),(0,D.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:L.map(t=>{let n=t.icon;return(0,D.jsxs)(d,{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,D.jsxs)(_,{className:`flex flex-row items-center gap-3 pb-2`,children:[(0,D.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,D.jsx)(n,{className:`h-5 w-5`})}),(0,D.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,D.jsx)(g,{className:`text-base`,children:t.title}),(0,D.jsx)(u,{className:`text-xs`,children:t.description})]})]}),(0,D.jsx)(C,{className:`pt-0`,children:t.count!==null&&(0,D.jsxs)(m,{variant:`secondary`,children:[t.count,` `,t.countLabel]})})]},t.title)})})]})}export{O as SystemHubPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{r as t,y as n}from"./vendor-react-CyVA1SE-.js";import{a as r,o as i,s as a}from"./plugin-chatbot-MXXPNrIm.js";var o=e(n(),1),s=t(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(a),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(r,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{r as t,y as n}from"./vendor-react-CyVA1SE-.js";import{a as r,o as i,s as a}from"./plugin-chatbot-CeHz9iQm.js";var o=e(n(),1),s=t(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(a),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(r,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};