@objectstack/console 14.7.0 → 15.0.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 (110) hide show
  1. package/dist/.objectui-sha +1 -1
  2. package/dist/assets/{AdapterProvider-CmeZULrO.js → AdapterProvider-CSP_T07G.js} +1 -1
  3. package/dist/assets/{AiPendingActionsPage-C4Iq12It.js → AiPendingActionsPage-BNh8Cf9P.js} +1 -1
  4. package/dist/assets/{ApiConsolePage-CVxWz2Fc.js → ApiConsolePage-Btr9hRka.js} +1 -1
  5. package/dist/assets/{AppDocsIndex-_Nk6Vrm0.js → AppDocsIndex-DFB1tmTx.js} +1 -1
  6. package/dist/assets/{AppManagementPage-Ds4z81em.js → AppManagementPage-D2jMv3L-.js} +1 -1
  7. package/dist/assets/{ApprovalsInboxPage-BYmqtmb8.js → ApprovalsInboxPage-CT4IXwpE.js} +1 -1
  8. package/dist/assets/{AuditLogPage-BY42e7b1.js → AuditLogPage-BdYvwcAH.js} +1 -1
  9. package/dist/assets/{ComponentNavView-CPizP2rl.js → ComponentNavView-C8ngAwyN.js} +1 -1
  10. package/dist/assets/{CreateViewDialog-C6DeiGi1.js → CreateViewDialog-DcjN_AhY.js} +1 -1
  11. package/dist/assets/{DashboardView-CZ3rnuQw.js → DashboardView-CLJM8Cfl.js} +1 -1
  12. package/dist/assets/{DeveloperHubPage-cynqEJzi.js → DeveloperHubPage-VBsID8Fk.js} +1 -1
  13. package/dist/assets/{DocShell-DowMXJqg.js → DocShell-ChTlUxMm.js} +1 -1
  14. package/dist/assets/{ExpressionProvider-jYh8yBEi.js → ExpressionProvider-CHaGm5wf.js} +1 -1
  15. package/dist/assets/{FlowRunsPage-BsxDtVro.js → FlowRunsPage-DdOav-6T.js} +1 -1
  16. package/dist/assets/{IntegrationsPage-Dt3JjnPR.js → IntegrationsPage-BR2TkAoB.js} +2 -2
  17. package/dist/assets/{InterfaceListPage-8ZC2DL6l.js → InterfaceListPage-Ca4VNsGg.js} +1 -1
  18. package/dist/assets/ManagedByBadge-Cdy82I7A.js +1 -0
  19. package/dist/assets/MarketplaceAccessDenied-B6Tg5g6l.js +1 -0
  20. package/dist/assets/MarketplaceInstalledPage-DBmVXCVz.js +1 -0
  21. package/dist/assets/MarketplacePackagePage-Mt1pHE8U.js +4 -0
  22. package/dist/assets/MarketplacePage-D9CLlhnk.js +1 -0
  23. package/dist/assets/{MetadataInspector-mHEFcIlV.js → MetadataInspector-Bqe7rY0S.js} +1 -1
  24. package/dist/assets/{MetadataProvider-DRMpRtkE.js → MetadataProvider-DqPZ6rV2.js} +1 -1
  25. package/dist/assets/ObjectDataPage-Cz_pMsIv.js +1 -0
  26. package/dist/assets/{PageView-Bvw39DGp.js → PageView-CLvQYEdi.js} +1 -1
  27. package/dist/assets/ProfilePage-BDJLPRAf.js +1 -0
  28. package/dist/assets/PublicFormsPage-BRflG64R.js +1 -0
  29. package/dist/assets/RecordDetailView-w6IBQ1cm.js +2 -0
  30. package/dist/assets/{RecordFormPage-B8hs2UT_.js → RecordFormPage-inJKFR63.js} +1 -1
  31. package/dist/assets/ReportDefaultInspector-BZaG6IPJ.js +3 -0
  32. package/dist/assets/{ReportView-C5EokVMt.js → ReportView-CSAIx2AR.js} +1 -1
  33. package/dist/assets/{SearchResultsPage-zgmMi_LJ.js → SearchResultsPage-DsnzRV3B.js} +1 -1
  34. package/dist/assets/{SettingsHub-D73rzMbT.js → SettingsHub-Begm6jy7.js} +1 -1
  35. package/dist/assets/{SettingsView-BHmgUtG_.js → SettingsView-C4UULiJk.js} +1 -1
  36. package/dist/assets/{SystemHubPage-HiWUvHtN.js → SystemHubPage-C4J7Le-p.js} +1 -1
  37. package/dist/assets/{assistantBus-cGcVZa3R.js → assistantBus-CbDb2Mju.js} +1 -1
  38. package/dist/assets/data-adapter-Mo_lVy1U.js +7 -0
  39. package/dist/assets/framework-BL3BtpKU.js +36 -0
  40. package/dist/assets/{getIcon-DGciRPQd.js → getIcon-BZsP3YSU.js} +1 -1
  41. package/dist/assets/highlighted-body-OFNGDK62-BPN_aS-T.js +1 -0
  42. package/dist/assets/i18n-BsjEVcp4.js +9 -0
  43. package/dist/assets/index-CRgNx-tU.js +2 -0
  44. package/dist/assets/index-D1n9Ue1P.css +2 -0
  45. package/dist/assets/mermaid-GHXKKRXX-BBQimMyN.js +1 -0
  46. package/dist/assets/metadata-admin-DHwo5kSi.js +23 -0
  47. package/dist/assets/plugin-calendar-BTCkHFNk.js +1 -0
  48. package/dist/assets/plugin-charts-DugftiGR.js +7 -0
  49. package/dist/assets/plugin-chatbot-Cq19aZcF.js +120 -0
  50. package/dist/assets/plugin-dashboard-CaQs1s4M.js +6 -0
  51. package/dist/assets/plugin-form-6ug8Woph.js +1 -0
  52. package/dist/assets/plugin-gantt-SwenNrGL.js +102 -0
  53. package/dist/assets/plugin-grid-a0e-qAUn.js +8 -0
  54. package/dist/assets/plugin-kanban-B9xzSYs9.js +1 -0
  55. package/dist/assets/plugin-map-DnfptTJp.js +1 -0
  56. package/dist/assets/{plugin-markdown-hWqBbKBQ.js → plugin-markdown-DgBcCCgO.js} +1 -1
  57. package/dist/assets/{plugin-report-Fk8OwuMv.js → plugin-report-Dny_M7U-.js} +4 -4
  58. package/dist/assets/plugin-timeline-8zgO0jxJ.js +1 -0
  59. package/dist/assets/plugin-tree-Bzgro7b4.js +1 -0
  60. package/dist/assets/plugin-view-DfJ5SCdu.js +1 -0
  61. package/dist/assets/plugins-views-CoobEMX4.js +4 -0
  62. package/dist/assets/{skeletons-Dc-JqV4x.js → skeletons-Bf9TL3pG.js} +1 -1
  63. package/dist/assets/src-BMWmj9Zz.js +1 -0
  64. package/dist/assets/{src-Ep8btdv1.js → src-C6-lrmoQ.js} +1 -1
  65. package/dist/assets/src-CQwyy7m_.js +18 -0
  66. package/dist/assets/{types-bxB_p8fZ.js → types-033eBMjb.js} +1 -1
  67. package/dist/assets/ui-components-Y3D5-fgK.js +42 -0
  68. package/dist/assets/{ui-layout-elT9p0KY.js → ui-layout-FqyUicdD.js} +1 -1
  69. package/dist/assets/{use-book-data-BNn214nk.js → use-book-data-BThfYUpK.js} +1 -1
  70. package/dist/assets/{useMetadata-B84fbReE.js → useMetadata-D5f_5ULL.js} +1 -1
  71. package/dist/index.html +4 -4
  72. package/package.json +1 -1
  73. package/dist/assets/ConsoleFloatingChatbot-vRAPnn56.js +0 -1
  74. package/dist/assets/ManagedByBadge-DySgRsRf.js +0 -1
  75. package/dist/assets/MarketplaceAccessDenied-CQo3oKUv.js +0 -1
  76. package/dist/assets/MarketplaceInstalledPage-COPjvdZD.js +0 -1
  77. package/dist/assets/MarketplacePackagePage-BL5_Fzlm.js +0 -4
  78. package/dist/assets/MarketplacePage-BnHkiwG_.js +0 -1
  79. package/dist/assets/ObjectDataPage-D9wwntH8.js +0 -1
  80. package/dist/assets/ProfilePage-CkS1AQDC.js +0 -1
  81. package/dist/assets/PublicFormsPage-onVYVDnz.js +0 -1
  82. package/dist/assets/RecordDetailView-DsaGwX7Z.js +0 -2
  83. package/dist/assets/ReportDefaultInspector-DacLe5p0.js +0 -3
  84. package/dist/assets/data-adapter-BaIWVzG-.js +0 -7
  85. package/dist/assets/framework-DNWcCoBP.js +0 -36
  86. package/dist/assets/highlighted-body-OFNGDK62-obGa3VW9.js +0 -1
  87. package/dist/assets/i18n-DzI3zFKr.js +0 -9
  88. package/dist/assets/index-CETzvR9k.js +0 -2
  89. package/dist/assets/index-DZuzAri6.css +0 -2
  90. package/dist/assets/marketplaceApi-BZG2zqqI.js +0 -1
  91. package/dist/assets/mermaid-GHXKKRXX-zDa01SPQ.js +0 -1
  92. package/dist/assets/metadata-admin-B3pnFq3D.js +0 -23
  93. package/dist/assets/plugin-calendar-DI8_y72D.js +0 -1
  94. package/dist/assets/plugin-charts-8kHRsJ26.js +0 -7
  95. package/dist/assets/plugin-chatbot-5rciOKdr.js +0 -120
  96. package/dist/assets/plugin-dashboard-g6z_zZXP.js +0 -6
  97. package/dist/assets/plugin-form-DWcrPPUr.js +0 -1
  98. package/dist/assets/plugin-gantt-BmusZEIw.js +0 -100
  99. package/dist/assets/plugin-grid-DdzrFURM.js +0 -8
  100. package/dist/assets/plugin-kanban-DtXDjkdV.js +0 -1
  101. package/dist/assets/plugin-map-B7RVCjPN.js +0 -1
  102. package/dist/assets/plugin-timeline-BLradJ31.js +0 -1
  103. package/dist/assets/plugin-tree-Dd-qjC-G.js +0 -1
  104. package/dist/assets/plugin-view-Beo3HWpE.js +0 -1
  105. package/dist/assets/plugins-views-D0GqJrx_.js +0 -4
  106. package/dist/assets/src-DZVwE2OF.js +0 -18
  107. package/dist/assets/src-DxI3szM2.js +0 -1
  108. package/dist/assets/surfaceAgent-DPt23-K5.js +0 -1
  109. package/dist/assets/ui-components-CmbUYw-E.js +0 -42
  110. package/dist/assets/useRecordApprovals-CwD1sHs0.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{f as t,m as n,r,y as i}from"./vendor-react-BKSb6vFP.js";import{l as a}from"./framework-DNWcCoBP.js";import{Bs as o,Bt as s,Cc as c,Cr as l,Ha as u,Jt as d,Qt as f,Va as p,Xt as m,Yt as h,Zt as g,bt as _,dr as v,er as y,fr as b,in as x,ln as S,lt as C,nr as w,pn as T,pr as E,qt as D,rn as O,so as k,sr as A,tr as j,xt as M,zi as N}from"./ui-components-CmbUYw-E.js";import{r as P}from"./vendor-ui-utils-D-WJ115h.js";import{a as F,i as I,n as L,o as R,t as z}from"./types-bxB_p8fZ.js";var B=e(i(),1),V=r();function H({reason:e,className:t}){return(0,V.jsxs)(A,{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)(p,{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)(A,{variant:`outline`,className:`text-blue-700 border-blue-300 text-[10px]`,children:[`Inherited from `,a(r.scope)]}):i?(0,V.jsxs)(A,{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)(T,{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)(A,{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:s,saving:c,labels:u}=e,p=(0,B.useId)(),w=!!(s||c),A=z(t.label),j=t.key&&u?u.fieldLabel(t.key,A):A,N=t.key&&u?u.fieldHelp(t.key,t.description):t.description;if(t.type===`group`){let e=t.id&&u?u.groupTitle(t.id,A):A,n=t.id&&u?u.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)(D,{className:`mt-3`})]})}if(t.type===`info_banner`)return(0,V.jsxs)(v,{variant:t.bannerSeverity===`error`?`destructive`:`default`,className:`my-2`,children:[(0,V.jsx)(k,{className:`h-4 w-4`}),(0,V.jsx)(E,{children:A}),t.bannerText?(0,V.jsx)(b,{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:A}),t.description?(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.description}):null]}),(0,V.jsx)(o,{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:j,labels:u}),(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=u?u.actionLabel(n,A):A;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)(l,{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:j,labels:u}),e,(0,V.jsx)(G,{description:N})]}),F=e=>{let n=typeof e.label==`string`?e.label:e.label?.defaultValue??String(e.value);return!t.key||!u?n:u.optionLabel(t.key,String(e.value),n)};switch(t.type){case`text`:case`email`:case`url`:case`phone`:return P((0,V.jsx)(S,{id:p,type:t.type===`email`?`email`:t.type===`url`?`url`:`text`,value:r??``,minLength:t.minLength,maxLength:t.maxLength,pattern:t.pattern,disabled:w,onChange:e=>i(e.target.value)}));case`password`:return P((0,V.jsx)(S,{id:p,type:`password`,autoComplete:`new-password`,placeholder:r?`••••••••`:``,disabled:w,onChange:e=>i(e.target.value)}));case`textarea`:return P((0,V.jsx)(C,{id:p,rows:t.rows??4,value:r??``,minLength:t.minLength,maxLength:t.maxLength,disabled:w,onChange:e=>i(e.target.value)}));case`number`:return P((0,V.jsx)(S,{id:p,type:`number`,value:r,min:t.min,max:t.max,step:t.step,disabled:w,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:j,labels:u}),(0,V.jsx)(G,{description:N})]}),(0,V.jsx)(_,{id:p,checked:!!r,disabled:w,onCheckedChange:e=>i(e)})]});case`select`:return P((0,V.jsxs)(d,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:w,children:[(0,V.jsx)(g,{id:p,children:(0,V.jsx)(f,{placeholder:`Select…`})}),(0,V.jsx)(h,{children:t.options?.map(e=>(0,V.jsx)(m,{value:String(e.value),children:F(e)},String(e.value)))})]}));case`radio`:return P((0,V.jsx)(O,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:w,children:t.options?.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,V.jsx)(x,{value:String(e.value),id:`${p}-${e.value}`}),(0,V.jsx)(T,{htmlFor:`${p}-${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)(y,{checked:e.map(String).includes(n),disabled:w,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:w,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)(S,{id:p,type:`color`,value:r??`#000000`,disabled:w,onChange:e=>i(e.target.value),className:`w-16 h-9 p-1`}),(0,V.jsx)(S,{value:r??``,disabled:w,onChange:e=>i(e.target.value),className:`flex-1 font-mono text-sm`})]}));case`json`:return P((0,V.jsx)(C,{id:p,rows:t.rows??6,className:`font-mono text-xs`,value:typeof r==`string`?r:JSON.stringify(r??null,null,2),disabled:w,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,o]=(0,B.useState)(null),[d,f]=(0,B.useState)(!0),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(null),[_,v]=(0,B.useState)({}),y=(0,B.useCallback)(async()=>{f(!0),g(null);try{let e=await L(i);o(e),v({})}catch(e){g(e?.message??`Failed to load settings`)}finally{f(!1)}},[i]);(0,B.useEffect)(()=>{i&&y()},[i,y]);let b=(0,B.useMemo)(()=>{let e={};if(!a)return e;for(let[t,n]of Object.entries(a.values))e[t]=n.value;return{...e,..._}},[a,_]),x=(0,B.useMemo)(()=>Object.keys(_),[_]),S=J(i);if(!i)return(0,V.jsx)(`div`,{className:`p-6 text-muted-foreground`,children:`No namespace selected.`});if(d)return(0,V.jsxs)(`div`,{className:`p-6 space-y-3 max-w-3xl`,children:[(0,V.jsx)(s,{className:`h-8 w-1/3`}),(0,V.jsx)(s,{className:`h-4 w-2/3`}),(0,V.jsx)(s,{className:`h-32 w-full`}),(0,V.jsx)(s,{className:`h-32 w-full`})]});if(h)return(0,V.jsxs)(`div`,{className:`p-6 max-w-3xl`,children:[(0,V.jsxs)(l,{variant:`ghost`,size:`sm`,onClick:()=>r(-1),children:[(0,V.jsx)(c,{className:`h-4 w-4 mr-1`}),` Back`]}),(0,V.jsx)(j,{className:`mt-3`,children:(0,V.jsx)(w,{className:`py-8 text-center text-sm text-destructive`,children:h})})]});if(!a)return null;let{manifest:C,values:T}=a,E=C.icon?R(C.icon):null,D=S.title(z(C.label)),O=S.description(C.description),k=async()=>{if(x.length!==0){m(!0);try{let e=await F(i,_);o({...a,values:{...T,...e.values}}),v({}),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{m(!1)}}},M=async e=>{m(!0);try{let t=await I(i,e,_);t.ok?P.success(t.message??`Action succeeded`):P.error(t.message??`Action failed`)}catch(e){P.error(e?.message??`Action failed`)}finally{m(!1)}};return(0,V.jsxs)(`div`,{className:`p-6 max-w-3xl mx-auto pb-32`,children:[(0,V.jsxs)(l,{variant:`ghost`,size:`sm`,onClick:()=>r(`/system/settings`),children:[(0,V.jsx)(c,{className:`h-4 w-4 mr-1`}),` All settings`]}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-start gap-3`,children:[E?(0,V.jsx)(E,{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:D}),C.beta?(0,V.jsx)(A,{variant:`secondary`,children:`Beta`}):null]}),O?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:O}):null]})]}),C.helpText?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-4 whitespace-pre-wrap`,children:C.helpText}):null,(0,V.jsx)(`div`,{className:`mt-6 divide-y`,children:C.specifiers.filter(e=>Y(e.visible,b)).map((e,t)=>{let n=e.key,r=n?T[n]:void 0;return(0,V.jsx)(K,{spec:e,resolved:r,value:n?n in _?_[n]:r?.value:void 0,onChange:e=>n&&v(t=>({...t,[n]:e})),onAction:e.type===`action_button`?()=>M(e.id??n??`test`):void 0,locked:r?.locked,saving:p,labels:S},(n??`_layout_${t}`)+t)})}),x.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:[x.length,` unsaved change`,x.length>1?`s`:``]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsxs)(l,{variant:`ghost`,size:`sm`,onClick:()=>v({}),disabled:p,children:[(0,V.jsx)(N,{className:`h-4 w-4 mr-1`}),` Discard`]}),(0,V.jsxs)(l,{onClick:k,disabled:p,children:[p?(0,V.jsx)(u,{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-DAXXjFlN.js";import{f as t,m as n,r,y as i}from"./vendor-react-BKSb6vFP.js";import{l as a}from"./framework-BL3BtpKU.js";import{Bt as o,Cr as s,Ha as c,Jt as l,Qt as u,Sc as d,Va as f,Xt as p,Yt as m,Zt as h,bt as g,dr as _,er as v,fr as y,in as b,ln as x,lt as S,nr as C,pn as w,pr as T,qt as E,rn as D,so as O,sr as k,tr as A,xt as j,zi as M,zs as N}from"./ui-components-Y3D5-fgK.js";import{r as P}from"./vendor-ui-utils-D-WJ115h.js";import{a as F,i as I,n as L,o as R,t as z}from"./types-033eBMjb.js";var B=e(i(),1),V=r();function H({reason:e,className:t}){return(0,V.jsxs)(k,{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)(f,{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)(k,{variant:`outline`,className:`text-blue-700 border-blue-300 text-[10px]`,children:[`Inherited from `,a(r.scope)]}):i?(0,V.jsxs)(k,{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)(k,{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:d}=e,f=(0,B.useId)(),C=!!(o||c),k=z(t.label),A=t.key&&d?d.fieldLabel(t.key,k):k,M=t.key&&d?d.fieldHelp(t.key,t.description):t.description;if(t.type===`group`){let e=t.id&&d?d.groupTitle(t.id,k):k,n=t.id&&d?d.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)(E,{className:`mt-3`})]})}if(t.type===`info_banner`)return(0,V.jsxs)(_,{variant:t.bannerSeverity===`error`?`destructive`:`default`,className:`my-2`,children:[(0,V.jsx)(O,{className:`h-4 w-4`}),(0,V.jsx)(T,{children:k}),t.bannerText?(0,V.jsx)(y,{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:k}),t.description?(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.description}):null]}),(0,V.jsx)(N,{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:A,labels:d}),(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=d?d.actionLabel(n,k):k;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)(s,{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:A,labels:d}),e,(0,V.jsx)(G,{description:M})]}),F=e=>{let n=typeof e.label==`string`?e.label:e.label?.defaultValue??String(e.value);return!t.key||!d?n:d.optionLabel(t.key,String(e.value),n)};switch(t.type){case`text`:case`email`:case`url`:case`phone`:return P((0,V.jsx)(x,{id:f,type:t.type===`email`?`email`:t.type===`url`?`url`:`text`,value:r??``,minLength:t.minLength,maxLength:t.maxLength,pattern:t.pattern,disabled:C,onChange:e=>i(e.target.value)}));case`password`:return P((0,V.jsx)(x,{id:f,type:`password`,autoComplete:`new-password`,placeholder:r?`••••••••`:``,disabled:C,onChange:e=>i(e.target.value)}));case`textarea`:return P((0,V.jsx)(S,{id:f,rows:t.rows??4,value:r??``,minLength:t.minLength,maxLength:t.maxLength,disabled:C,onChange:e=>i(e.target.value)}));case`number`:return P((0,V.jsx)(x,{id:f,type:`number`,value:r,min:t.min,max:t.max,step:t.step,disabled:C,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:A,labels:d}),(0,V.jsx)(G,{description:M})]}),(0,V.jsx)(g,{id:f,checked:!!r,disabled:C,onCheckedChange:e=>i(e)})]});case`select`:return P((0,V.jsxs)(l,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:C,children:[(0,V.jsx)(h,{id:f,children:(0,V.jsx)(u,{placeholder:`Select…`})}),(0,V.jsx)(m,{children:t.options?.map(e=>(0,V.jsx)(p,{value:String(e.value),children:F(e)},String(e.value)))})]}));case`radio`:return P((0,V.jsx)(D,{value:r==null?void 0:String(r),onValueChange:e=>i(e),disabled:C,children:t.options?.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,V.jsx)(b,{value:String(e.value),id:`${f}-${e.value}`}),(0,V.jsx)(w,{htmlFor:`${f}-${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)(v,{checked:e.map(String).includes(n),disabled:C,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)(j,{value:[Number(r??t.min??0)],min:t.min??0,max:t.max??100,step:t.step??1,disabled:C,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)(x,{id:f,type:`color`,value:r??`#000000`,disabled:C,onChange:e=>i(e.target.value),className:`w-16 h-9 p-1`}),(0,V.jsx)(x,{value:r??``,disabled:C,onChange:e=>i(e.target.value),className:`flex-1 font-mono text-sm`})]}));case`json`:return P((0,V.jsx)(S,{id:f,rows:t.rows??6,className:`font-mono text-xs`,value:typeof r==`string`?r:JSON.stringify(r??null,null,2),disabled:C,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,l]=(0,B.useState)(null),[u,f]=(0,B.useState)(!0),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(null),[_,v]=(0,B.useState)({}),y=(0,B.useCallback)(async()=>{f(!0),g(null);try{let e=await L(i);l(e),v({})}catch(e){g(e?.message??`Failed to load settings`)}finally{f(!1)}},[i]);(0,B.useEffect)(()=>{i&&y()},[i,y]);let b=(0,B.useMemo)(()=>{let e={};if(!a)return e;for(let[t,n]of Object.entries(a.values))e[t]=n.value;return{...e,..._}},[a,_]),x=(0,B.useMemo)(()=>Object.keys(_),[_]),S=J(i);if(!i)return(0,V.jsx)(`div`,{className:`p-6 text-muted-foreground`,children:`No namespace selected.`});if(u)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)(s,{variant:`ghost`,size:`sm`,onClick:()=>r(-1),children:[(0,V.jsx)(d,{className:`h-4 w-4 mr-1`}),` Back`]}),(0,V.jsx)(A,{className:`mt-3`,children:(0,V.jsx)(C,{className:`py-8 text-center text-sm text-destructive`,children:h})})]});if(!a)return null;let{manifest:w,values:T}=a,E=w.icon?R(w.icon):null,D=S.title(z(w.label)),O=S.description(w.description),j=async()=>{if(x.length!==0){m(!0);try{let e=await F(i,_);l({...a,values:{...T,...e.values}}),v({}),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{m(!1)}}},N=async e=>{m(!0);try{let t=await I(i,e,_);t.ok?P.success(t.message??`Action succeeded`):P.error(t.message??`Action failed`)}catch(e){P.error(e?.message??`Action failed`)}finally{m(!1)}};return(0,V.jsxs)(`div`,{className:`p-6 max-w-3xl mx-auto pb-32`,children:[(0,V.jsxs)(s,{variant:`ghost`,size:`sm`,onClick:()=>r(`/system/settings`),children:[(0,V.jsx)(d,{className:`h-4 w-4 mr-1`}),` All settings`]}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-start gap-3`,children:[E?(0,V.jsx)(E,{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:D}),w.beta?(0,V.jsx)(k,{variant:`secondary`,children:`Beta`}):null]}),O?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:O}):null]})]}),w.helpText?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-4 whitespace-pre-wrap`,children:w.helpText}):null,(0,V.jsx)(`div`,{className:`mt-6 divide-y`,children:w.specifiers.filter(e=>Y(e.visible,b)).map((e,t)=>{let n=e.key,r=n?T[n]:void 0;return(0,V.jsx)(K,{spec:e,resolved:r,value:n?n in _?_[n]:r?.value:void 0,onChange:e=>n&&v(t=>({...t,[n]:e})),onAction:e.type===`action_button`?()=>N(e.id??n??`test`):void 0,locked:r?.locked,saving:p,labels:S},(n??`_layout_${t}`)+t)})}),x.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:[x.length,` unsaved change`,x.length>1?`s`:``]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsxs)(s,{variant:`ghost`,size:`sm`,onClick:()=>v({}),disabled:p,children:[(0,V.jsx)(M,{className:`h-4 w-4 mr-1`}),` Discard`]}),(0,V.jsxs)(s,{onClick:j,disabled:p,children:[p?(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-DAXXjFlN.js";import{f as t,m as n,r,y as i}from"./vendor-react-BKSb6vFP.js";import{f as a}from"./infrastructure-Bc4DRENl.js";import{L as o}from"./framework-DNWcCoBP.js";import{Ha as s,Mi as c,Oi as l,Qa as u,Rr as d,Si as f,ar as p,cc as m,ci as h,ir as g,ni as _,nr as v,oc as y,ro as b,rr as x,rs as S,sr as C,tc as w,tr as T,zr as E}from"./ui-components-CmbUYw-E.js";import"./src-DZVwE2OF.js";var D=e(i(),1),O=r();function k(){let e=t(),{appName:r}=n(),i=r?`/apps/${r}`:``,k=o(),A=a(),[j,M]=(0,D.useState)({users:null,orgs:null,positions:null,permissions:null,auditLogs:null}),[N,P]=(0,D.useState)(!0),F=(0,D.useCallback)(async()=>{if(k){P(!0);try{let[e,t,n,r,i]=await Promise.all([k.find(`sys_user`).catch(()=>({data:[]})),k.find(`sys_org`).catch(()=>({data:[]})),k.find(`sys_position`).catch(()=>({data:[]})),k.find(`sys_permission`).catch(()=>({data:[]})),k.find(`sys_audit_log`).catch(()=>({data:[]}))]);M({users:e.data?.length??0,orgs:t.data?.length??0,positions:n.data?.length??0,permissions:r.data?.length??0,auditLogs:i.data?.length??0})}catch{}finally{P(!1)}}},[k]);(0,D.useEffect)(()=>{F()},[F]);let I=[{title:`Applications`,description:`Manage all configured applications`,icon:u,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},{title:`Datasources`,description:`Connect external databases and sync their tables in as objects`,icon:y,href:`${i}/component/metadata/resource?type=datasource`,countLabel:``,count:null}],L=[{title:`Users`,description:`Manage system users and accounts`,icon:d,href:`${i}/system/users`,countLabel:`users`,count:j.users},{title:`Organizations`,description:`Manage organizations and teams`,icon:w,href:`${i}/system/organizations`,countLabel:`organizations`,count:j.orgs},{title:`Positions`,description:`Configure positions and access levels`,icon:f,href:`${i}/system/positions`,countLabel:`positions`,count:j.positions},{title:`Permissions`,description:`Manage permission rules and assignments`,icon:b,href:`${i}/system/permissions`,countLabel:`permissions`,count:j.permissions},{title:`Audit Log`,description:`View system activity and changes`,icon:c,href:`${i}/system/audit-log`,countLabel:`entries`,count:j.auditLogs},{title:`AI Approvals`,description:`Review actions AI agents propose before they execute`,icon:m,href:`${i}/system/ai-approvals`,countLabel:``,count:null},{title:`App Marketplace`,description:`Browse and install approved apps from the ObjectStack catalog`,icon:h,href:`${i}/system/marketplace`,countLabel:``,count:null,adminOnly:!0},{title:`Settings`,description:`Configure mail, branding, feature flags, and more`,icon:l,href:`${i}/system/settings`,countLabel:``,count:null},{title:`Developer`,description:`API console, flow runs, and public form management`,icon:_,href:`${i}/developer`,countLabel:``,count:null},{title:`Profile`,description:`View and edit your account settings`,icon:E,href:`${i}/system/profile`,countLabel:``,count:null}],R=[...I,...L].filter(e=>!e.adminOnly||A);return(0,O.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`System Settings`}),(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage applications, users, positions, permissions, and system configuration`})]}),N&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,O.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading statistics...`]}),(0,O.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:R.map(t=>{let n=t.icon;return(0,O.jsxs)(T,{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,O.jsxs)(g,{className:`flex flex-row items-center gap-3 pb-2`,children:[(0,O.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,O.jsx)(n,{className:`h-5 w-5`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsx)(p,{className:`text-base`,children:t.title}),(0,O.jsx)(x,{className:`text-xs`,children:t.description})]})]}),(0,O.jsx)(v,{className:`pt-0`,children:t.count!==null&&(0,O.jsxs)(C,{variant:`secondary`,children:[t.count,` `,t.countLabel]})})]},t.title)})})]})}export{k as SystemHubPage};
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{f as t,m as n,r,y as i}from"./vendor-react-BKSb6vFP.js";import{f as a}from"./infrastructure-Bc4DRENl.js";import{L as o}from"./framework-BL3BtpKU.js";import{Ha as s,Mi as c,Oi as l,Qa as u,Rr as d,Si as f,ac as p,ar as m,ci as h,ec as g,ir as _,ni as v,nr as y,ro as b,rr as x,rs as S,sc as C,sr as w,tr as T,zr as E}from"./ui-components-Y3D5-fgK.js";import"./src-CQwyy7m_.js";var D=e(i(),1),O=r();function k(){let e=t(),{appName:r}=n(),i=r?`/apps/${r}`:``,k=o(),A=a(),[j,M]=(0,D.useState)({users:null,orgs:null,positions:null,permissions:null,auditLogs:null}),[N,P]=(0,D.useState)(!0),F=(0,D.useCallback)(async()=>{if(k){P(!0);try{let[e,t,n,r,i]=await Promise.all([k.find(`sys_user`).catch(()=>({data:[]})),k.find(`sys_org`).catch(()=>({data:[]})),k.find(`sys_position`).catch(()=>({data:[]})),k.find(`sys_permission`).catch(()=>({data:[]})),k.find(`sys_audit_log`).catch(()=>({data:[]}))]);M({users:e.data?.length??0,orgs:t.data?.length??0,positions:n.data?.length??0,permissions:r.data?.length??0,auditLogs:i.data?.length??0})}catch{}finally{P(!1)}}},[k]);(0,D.useEffect)(()=>{F()},[F]);let I=[{title:`Applications`,description:`Manage all configured applications`,icon:u,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},{title:`Datasources`,description:`Connect external databases and sync their tables in as objects`,icon:p,href:`${i}/component/metadata/resource?type=datasource`,countLabel:``,count:null}],L=[{title:`Users`,description:`Manage system users and accounts`,icon:d,href:`${i}/system/users`,countLabel:`users`,count:j.users},{title:`Organizations`,description:`Manage organizations and teams`,icon:g,href:`${i}/system/organizations`,countLabel:`organizations`,count:j.orgs},{title:`Positions`,description:`Configure positions and access levels`,icon:f,href:`${i}/system/positions`,countLabel:`positions`,count:j.positions},{title:`Permissions`,description:`Manage permission rules and assignments`,icon:b,href:`${i}/system/permissions`,countLabel:`permissions`,count:j.permissions},{title:`Audit Log`,description:`View system activity and changes`,icon:c,href:`${i}/system/audit-log`,countLabel:`entries`,count:j.auditLogs},{title:`AI Approvals`,description:`Review actions AI agents propose before they execute`,icon:C,href:`${i}/system/ai-approvals`,countLabel:``,count:null},{title:`App Marketplace`,description:`Browse and install approved apps from the ObjectStack catalog`,icon:h,href:`${i}/system/marketplace`,countLabel:``,count:null,adminOnly:!0},{title:`Settings`,description:`Configure mail, branding, feature flags, and more`,icon:l,href:`${i}/system/settings`,countLabel:``,count:null},{title:`Developer`,description:`API console, flow runs, and public form management`,icon:v,href:`${i}/developer`,countLabel:``,count:null},{title:`Profile`,description:`View and edit your account settings`,icon:E,href:`${i}/system/profile`,countLabel:``,count:null}],R=[...I,...L].filter(e=>!e.adminOnly||A);return(0,O.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`System Settings`}),(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage applications, users, positions, permissions, and system configuration`})]}),N&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,O.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading statistics...`]}),(0,O.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:R.map(t=>{let n=t.icon;return(0,O.jsxs)(T,{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,O.jsxs)(_,{className:`flex flex-row items-center gap-3 pb-2`,children:[(0,O.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,O.jsx)(n,{className:`h-5 w-5`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsx)(m,{className:`text-base`,children:t.title}),(0,O.jsx)(x,{className:`text-xs`,children:t.description})]})]}),(0,O.jsx)(y,{className:`pt-0`,children:t.count!==null&&(0,O.jsxs)(w,{variant:`secondary`,children:[t.count,` `,t.countLabel]})})]},t.title)})})]})}export{k as SystemHubPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{y as t}from"./vendor-react-BKSb6vFP.js";var n=e(t(),1),r=null,i=0,a=0,o=null,s={editor:r,openSeq:i,reviewSeq:a,reviewTarget:o},c=new Set;function l(){s={editor:r,openSeq:i,reviewSeq:a,reviewTarget:o};for(let e of c)e()}function u(e,t){return e===t||JSON.stringify(e)===JSON.stringify(t)}var d={subscribe(e){return c.add(e),()=>{c.delete(e)}},getSnapshot(){return s},setEditor(e){u(r,e)||(r=e,l())},requestOpen(){i+=1,l()},requestReview(e){a+=1,o=e,l()}},f=new Set;function p(e){for(let t of f)t(e)}function m(e){return f.add(e),()=>{f.delete(e)}}var h=new Set;function g(){for(let e of h)e()}function _(e){return h.add(e),()=>{h.delete(e)}}function v(){return(0,n.useSyncExternalStore)(d.subscribe,d.getSnapshot,d.getSnapshot)}function y(e){(0,n.useEffect)(()=>(d.setEditor(e),()=>d.setEditor(null)),[e?JSON.stringify(e):``])}function b(){d.requestOpen()}function x(e){d.requestReview(e)}export{m as a,y as c,x as i,g as n,_ as o,b as r,v as s,p as t};
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{y as t}from"./vendor-react-BKSb6vFP.js";var n=e(t(),1),r=null,i=0,a=0,o=null,s={editor:r,openSeq:i,reviewSeq:a,reviewTarget:o},c=new Set;function l(){s={editor:r,openSeq:i,reviewSeq:a,reviewTarget:o};for(let e of c)e()}function u(e,t){return e===t||JSON.stringify(e)===JSON.stringify(t)}var d={subscribe(e){return c.add(e),()=>{c.delete(e)}},getSnapshot(){return s},setEditor(e){u(r,e)||(r=e,l())},requestOpen(){i+=1,l()},requestReview(e){a+=1,o=e,l()}},f=new Set;function p(e){return f.add(e),()=>{f.delete(e)}}var m=new Set;function h(){for(let e of m)e()}function g(e){return m.add(e),()=>{m.delete(e)}}function _(){return(0,n.useSyncExternalStore)(d.subscribe,d.getSnapshot,d.getSnapshot)}function v(e){(0,n.useEffect)(()=>(d.setEditor(e),()=>d.setEditor(null)),[e?JSON.stringify(e):``])}function y(){d.requestOpen()}export{_ as a,g as i,y as n,v as o,p as r,h as t};