@object-ui/console 3.4.0 → 4.0.1
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/{AppManagementPage-CLr3paaF.js → AppManagementPage-Da4DphqI.js} +1 -1
- package/dist/assets/{ConsoleFloatingChatbot-C_ClJ2NU.js → ConsoleFloatingChatbot-BWbRwcSc.js} +1 -1
- package/dist/assets/DashboardView-l8ACItY-.js +1 -0
- package/dist/assets/{MetadataDetailPage-C1sWJhl2.js → MetadataDetailPage-D7yDeoSe.js} +1 -1
- package/dist/assets/{MetadataFormDialog-Cje6P_Wf.js → MetadataFormDialog-CSuCo9Qt.js} +1 -1
- package/dist/assets/MetadataManagerPage-DJ2ZjoVP.js +1 -0
- package/dist/assets/{PageView-DZHuurne.js → PageView-CJFNRux1.js} +1 -1
- package/dist/assets/ProfilePage-CK0mmAvw.js +1 -0
- package/dist/assets/RecordDetailView-BfzfI4-e.js +1 -0
- package/dist/assets/{ReportView-oYVEbfYq.js → ReportView-B6tHCvDV.js} +1 -1
- package/dist/assets/{SearchResultsPage-BjAVc5rm.js → SearchResultsPage-CDUPn8G4.js} +1 -1
- package/dist/assets/{SystemHubPage-D08IDX3M.js → SystemHubPage-CVOYNpyU.js} +1 -1
- package/dist/assets/{data-adapter-CleWpyQH.js → data-adapter-DBWF2sV-.js} +1 -1
- package/dist/assets/{getIcon-vBP44wSb.js → getIcon-CWhoWdFA.js} +1 -1
- package/dist/assets/index-BimUnPgZ.js +2 -0
- package/dist/assets/index-DoG5QbE6.css +2 -0
- package/dist/assets/{plugin-calendar-DX_UWouT.js → plugin-calendar-DBrkXKZq.js} +1 -1
- package/dist/assets/{plugin-charts-BvZ1cSiZ.js → plugin-charts-BHH2XtQC.js} +1 -1
- package/dist/assets/{plugin-chatbot-DeSEtutf.js → plugin-chatbot-Cdf-WJAv.js} +15 -15
- package/dist/assets/plugin-form-CKcMp4d_.js +1 -0
- package/dist/assets/plugin-gantt-DwFZiNye.js +1 -0
- package/dist/assets/plugin-grid-CQS8zk9l.js +8 -0
- package/dist/assets/plugin-kanban-CaM_pxR_.js +1 -0
- package/dist/assets/{plugin-map-B7EfyDsf.js → plugin-map-BFlwDcr7.js} +1 -1
- package/dist/assets/{plugin-markdown-CiHluuxA.js → plugin-markdown-PR8tBwTD.js} +1 -1
- package/dist/assets/{plugin-timeline-D8_YFDQQ.js → plugin-timeline-B-vzj0Pe.js} +1 -1
- package/dist/assets/plugin-view-djqft75T.js +1 -0
- package/dist/assets/plugins-views-BDVYhbx4.js +63 -0
- package/dist/assets/src-D1MGEpQM.js +1 -0
- package/dist/assets/{ui-components-BCmPcwhR.js → ui-components-3HVEceOY.js} +4 -4
- package/dist/assets/{ui-layout-BLl7ARoe.js → ui-layout-_xO4eFwD.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +30 -30
- package/dist/assets/DashboardView-CODdYLuL.js +0 -1
- package/dist/assets/MetadataManagerPage-DobP393N.js +0 -1
- package/dist/assets/ProfilePage-6u6k00rh.js +0 -1
- package/dist/assets/RecordDetailView-cFSCvmx3.js +0 -1
- package/dist/assets/index-98Lfd5ty.js +0 -2
- package/dist/assets/index-C162ArSl.css +0 -2
- package/dist/assets/plugin-form-BhbVu8jO.js +0 -1
- package/dist/assets/plugin-gantt-BG1WaV_b.js +0 -1
- package/dist/assets/plugin-grid-DwpWK0E8.js +0 -8
- package/dist/assets/plugin-kanban-Dzjqra5U.js +0 -1
- package/dist/assets/plugin-view-CXAFUa14.js +0 -1
- package/dist/assets/plugins-views-C5gstDGy.js +0 -63
- package/dist/assets/src-iMF4J4F7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t,l as n,r,t as i}from"./vendor-react-B1k2FF9f.js";import{At as a,Dt as o,Ft as s,Jn as c,Mt as l,NL as u,Nt as d,Ot as f,PS as p,Pt as m,Sm as h,XA as g,Xn as _,Xt as v,Yn as y,Z as b,bm as x,ir as S,jt as C,kt as w,mc as T,sT as E}from"./ui-components-BCmPcwhR.js";import{a as D,f as O,g as k,h as A,l as j,m as M,n as N,o as P,s as F,t as I,u as L}from"./vendor-dndkit-BGB4qgc3.js";var R=e(t(),1),z=i();function B(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return null;let n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,i=parseInt(t[3],16)/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=0,c=0,l=(a+o)/2;if(a!==o){let e=a-o;switch(c=l>.5?e/(2-a-o):e/(a+o),a){case n:s=((r-i)/e+(r<i?6:0))/6;break;case r:s=((i-n)/e+2)/6;break;case i:s=((n-r)/e+4)/6;break}}return{h:s*360,s:c*100,l:l*100}}function V(e){let t=B(e);return t?`${Math.round(t.h)} ${Math.round(t.s)}% ${Math.round(t.l)}%`:null}function H(e){let t=B(e);if(!t)return null;let n=Math.max(t.l,65),r=t.s>80?Math.max(t.s-10,70):t.s;return`${Math.round(t.h)} ${Math.round(r)}% ${Math.round(n)}%`}function U(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return`0 0% 100%`;let n=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},r=n(parseInt(t[1],16)),i=n(parseInt(t[2],16)),a=n(parseInt(t[3],16));return .2126*r+.7152*i+.0722*a>.6?`222 47% 11%`:`0 0% 100%`}function W(e,t){(0,R.useEffect)(()=>{let n=document.documentElement,r=()=>n.classList.contains(`dark`),i=()=>{if(e?.primaryColor){let t=V(e.primaryColor),i=H(e.primaryColor),a=r()&&i||t;a&&(n.style.setProperty(`--brand-primary`,e.primaryColor),n.style.setProperty(`--brand-primary-hsl`,t||a),n.style.setProperty(`--primary`,a),n.style.setProperty(`--primary-foreground`,r()?`222 47% 11%`:U(e.primaryColor)),n.style.setProperty(`--ring`,a),n.style.setProperty(`--sidebar-primary`,a),n.style.setProperty(`--sidebar-ring`,a))}else n.style.removeProperty(`--brand-primary`),n.style.removeProperty(`--brand-primary-hsl`),n.style.removeProperty(`--primary`),n.style.removeProperty(`--primary-foreground`),n.style.removeProperty(`--ring`),n.style.removeProperty(`--sidebar-primary`),n.style.removeProperty(`--sidebar-ring`);if(e?.accentColor){let t=V(e.accentColor),i=H(e.accentColor),a=r()&&i||t;a&&(n.style.setProperty(`--brand-accent`,e.accentColor),n.style.setProperty(`--brand-accent-hsl`,t||a),n.style.setProperty(`--accent`,a),n.style.setProperty(`--accent-foreground`,r()?`222 47% 11%`:U(e.accentColor)))}else n.style.removeProperty(`--brand-accent`),n.style.removeProperty(`--brand-accent-hsl`),n.style.removeProperty(`--accent`),n.style.removeProperty(`--accent-foreground`)};i();let a=new MutationObserver(e=>{for(let t of e)if(t.type===`attributes`&&t.attributeName===`class`){i();break}});if(a.observe(n,{attributes:!0,attributeFilter:[`class`]}),e?.favicon){let t=document.querySelector(`#favicon`)||document.querySelector(`link[rel="icon"]`);t&&(t.href=e.favicon)}return t&&(document.title=t),()=>{a.disconnect(),n.style.removeProperty(`--brand-primary`),n.style.removeProperty(`--brand-primary-hsl`),n.style.removeProperty(`--brand-accent`),n.style.removeProperty(`--brand-accent-hsl`),n.style.removeProperty(`--primary`),n.style.removeProperty(`--primary-foreground`),n.style.removeProperty(`--ring`),n.style.removeProperty(`--sidebar-primary`),n.style.removeProperty(`--sidebar-ring`),n.style.removeProperty(`--accent`),n.style.removeProperty(`--accent-foreground`)}},[e?.primaryColor,e?.accentColor,e?.favicon,t])}function G({sidebar:e,navbar:t,children:n,className:r,defaultOpen:i=!0,branding:o}){return W(o,o?.title),(0,z.jsxs)(s,{defaultOpen:i,className:`!flex-col`,children:[(0,z.jsx)(`header`,{className:`sticky top-0 z-30 flex h-14 w-full shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4`,children:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 min-h-0 w-full`,children:[e,(0,z.jsx)(a,{className:`min-w-0`,children:(0,z.jsx)(`main`,{className:u(`flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6`,r),children:n})})]})]})}function K(e){return e?b(e):E}function q(e,t){if(typeof e==`string`)return e;if(t){let n=t(e.key,{defaultValue:e.defaultValue,...e.params});if(n&&n!==e.key)return n}return e.defaultValue||e.key}function J(e,t,n,r,i){let a=q(e.label,n);return typeof e.label==`string`?t&&e.type===`object`&&e.objectName?t(e.objectName,a):r&&e.type===`dashboard`&&e.dashboardName?r(e.dashboardName,a):i&&e.type===`group`&&e.id?i(e.id,a):a:a}var Y=e=>!(e===!1||e===`false`),X=()=>!0;function ee(e,t){switch(e.type){case`object`:{let n=`${t}/${e.objectName??``}`;return{href:e.viewName?`${n}/view/${e.viewName}`:n,external:!1}}case`dashboard`:return{href:e.dashboardName?`${t}/dashboard/${e.dashboardName}`:`#`,external:!1};case`page`:return{href:e.pageName?`${t}/page/${e.pageName}`:`#`,external:!1};case`report`:return{href:e.reportName?`${t}/report/${e.reportName}`:`#`,external:!1};case`url`:return{href:e.url??`#`,external:e.target===`_blank`};default:return{href:`#`,external:!1}}}function Z(e,t){if(!t.trim())return e;let n=t.toLowerCase().trim();return e.reduce((e,r)=>{if(r.type===`separator`)return e;if(r.type===`group`&&r.children?.length){let n=Z(r.children,t);return n.length>0&&e.push({...r,children:n}),e}return q(r.label).toLowerCase().includes(n)&&e.push(r),e},[])}var te=5;function ne({item:e,basePath:t,evalVis:n,checkPerm:r,onAction:i,enablePinning:a,onPinToggle:o,enableReorder:s,resolveObjectLabel:c,resolveDashboardLabel:l,resolveGroupLabel:u,t:d}){let{attributes:f,listeners:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=D({id:e.id,disabled:!s});return(0,z.jsx)(`div`,{ref:m,style:{transform:k.Transform.toString(h),transition:g,opacity:_?.5:void 0,zIndex:_?10:void 0},...f,children:(0,z.jsx)(Q,{item:e,basePath:t,evalVis:n,checkPerm:r,onAction:i,enablePinning:a,onPinToggle:o,dragListeners:s?p:void 0,resolveObjectLabel:c,resolveDashboardLabel:l,resolveGroupLabel:u,t:d})})}function Q({item:e,basePath:t,evalVis:i,checkPerm:a,onAction:s,enablePinning:u,onPinToggle:b,dragListeners:T,resolveObjectLabel:E,resolveDashboardLabel:D,resolveGroupLabel:O,t:k}){let A=n(),[j,M]=(0,R.useState)(e.defaultOpen!==!1);if(!i(e.visible)||e.requiredPermissions?.length&&!a(e.requiredPermissions))return null;if(e.type===`separator`)return(0,z.jsx)(v,{className:`my-2`});if(e.type===`group`){let n=(e.children??[]).slice().sort((e,t)=>(e.order??0)-(t.order??0));return(0,z.jsx)(c,{open:j,onOpenChange:M,children:(0,z.jsxs)(o,{children:[(0,z.jsx)(w,{asChild:!0,children:(0,z.jsxs)(_,{className:`flex w-full items-center justify-between`,children:[J(e,E,k,D,O),(0,z.jsx)(g,{className:`ml-auto h-4 w-4 transition-transform ${j?`rotate-90`:``}`})]})}),(0,z.jsx)(y,{children:(0,z.jsx)(f,{children:(0,z.jsx)(C,{children:n.map(e=>(0,z.jsx)(Q,{item:e,basePath:t,evalVis:i,checkPerm:a,onAction:s,enablePinning:u,onPinToggle:b,resolveObjectLabel:E,resolveDashboardLabel:D,resolveGroupLabel:O,t:k},e.id))})})})]})})}if(e.type===`action`){let t=K(e.icon),n=q(e.label,k);return(0,z.jsxs)(m,{children:[T&&(0,z.jsx)(`span`,{className:`absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground`,"aria-label":k?k(`console.nav.dragToReorder`,{defaultValue:`Drag to reorder`}):`Drag to reorder`,...T,children:(0,z.jsx)(p,{className:`h-3.5 w-3.5`})}),(0,z.jsxs)(d,{tooltip:n,onClick:()=>s?.(e),children:[(0,z.jsx)(t,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{children:n}),e.badge!=null&&(0,z.jsx)(S,{variant:e.badgeVariant??`default`,className:`ml-auto text-[10px] px-1.5 py-0`,children:e.badge})]}),u&&b&&(0,z.jsx)(l,{showOnHover:!0,onClick:()=>b(e.id,!e.pinned),"aria-label":k?k(e.pinned?`console.nav.unpinItem`:`console.nav.pinItem`,{defaultValue:e.pinned?`Unpin ${n}`:`Pin ${n}`,name:n}):e.pinned?`Unpin ${n}`:`Pin ${n}`,children:e.pinned?(0,z.jsx)(h,{className:`h-3.5 w-3.5`}):(0,z.jsx)(x,{className:`h-3.5 w-3.5`})})]})}let N=K(e.icon),{href:P,external:F}=ee(e,t),I=P!==`#`&&A.pathname.startsWith(P),L=J(e,E,k,D,O),B=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(N,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{children:L}),e.badge!=null&&(0,z.jsx)(S,{variant:e.badgeVariant??`default`,className:`ml-auto text-[10px] px-1.5 py-0`,children:e.badge})]});return(0,z.jsxs)(m,{children:[T&&(0,z.jsx)(`span`,{className:`absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground`,"aria-label":k?k(`console.nav.dragToReorder`,{defaultValue:`Drag to reorder`}):`Drag to reorder`,...T,children:(0,z.jsx)(p,{className:`h-3.5 w-3.5`})}),(0,z.jsx)(d,{asChild:!0,isActive:I,tooltip:L,children:F?(0,z.jsx)(`a`,{href:P,target:`_blank`,rel:`noopener noreferrer`,children:B}):(0,z.jsx)(r,{to:P,children:B})}),u&&b&&(0,z.jsx)(l,{showOnHover:!0,onClick:()=>b(e.id,!e.pinned),"aria-label":k?k(e.pinned?`console.nav.unpinItem`:`console.nav.pinItem`,{defaultValue:e.pinned?`Unpin ${L}`:`Pin ${L}`,name:L}):e.pinned?`Unpin ${L}`:`Pin ${L}`,children:e.pinned?(0,z.jsx)(h,{className:`h-3.5 w-3.5`}):(0,z.jsx)(x,{className:`h-3.5 w-3.5`})})]})}function re({items:e,basePath:t=``,evaluateVisibility:n=Y,checkPermission:r=X,onAction:i,searchQuery:a,enablePinning:s,onPinToggle:c,enableReorder:l,onReorder:u,resolveObjectLabel:d,resolveDashboardLabel:p,resolveGroupLabel:m,t:h}){let g=(0,R.useMemo)(()=>a?Z(e,a):e,[e,a]),_=(0,R.useMemo)(()=>$(g),[g]),v=g.slice().sort((e,t)=>(e.order??0)-(t.order??0)),y=A(M(L,{activationConstraint:{distance:te}}),M(j)),b=e=>{let{active:t,over:n}=e;if(!n||t.id===n.id||!u)return;let r=v.findIndex(e=>e.id===t.id),i=v.findIndex(e=>e.id===n.id);r===-1||i===-1||u(N(v,r,i).map((e,t)=>({...e,order:t})))},x={basePath:t,evalVis:n,checkPerm:r,onAction:i,enablePinning:s,onPinToggle:c,resolveObjectLabel:d,resolveDashboardLabel:p,resolveGroupLabel:m,t:h},S=v.some(e=>e.type===`group`),E=_.length>0&&s?(0,z.jsxs)(o,{children:[(0,z.jsxs)(w,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(T,{className:`h-3.5 w-3.5`}),h?h(`console.nav.favorites`,{defaultValue:`Favorites`}):`Favorites`]}),(0,z.jsx)(f,{children:(0,z.jsx)(C,{children:_.map(e=>(0,z.jsx)(Q,{item:e,...x},`fav-${e.id}`))})})]}):null;if(!S){let e=v.filter(e=>e.type!==`group`).map(e=>e.id);return(0,z.jsxs)(z.Fragment,{children:[E,(0,z.jsx)(o,{children:(0,z.jsx)(f,{children:l?(0,z.jsx)(F,{sensors:y,collisionDetection:O,onDragEnd:b,children:(0,z.jsx)(I,{items:e,strategy:P,children:(0,z.jsx)(C,{children:v.map(e=>(0,z.jsx)(ne,{item:e,enableReorder:l,...x},e.id))})})}):(0,z.jsx)(C,{children:v.map(e=>(0,z.jsx)(Q,{item:e,...x},e.id))})})})]})}let D=[],k=[],B=e=>{if(k.length===0)return;let t=k;k=[],D.push((0,z.jsx)(o,{children:(0,z.jsx)(f,{children:(0,z.jsx)(C,{children:t.map(e=>(0,z.jsx)(Q,{item:e,...x},e.id))})})},e))};return v.forEach((e,t)=>{e.type===`group`?(B(`leaf-${t}`),D.push((0,z.jsx)(Q,{item:e,...x},e.id))):k.push(e)}),B(`leaf-end`),(0,z.jsxs)(z.Fragment,{children:[E,D]})}function $(e){let t=[];for(let n of e)n.pinned&&n.type!==`group`&&n.type!==`separator`&&t.push(n),n.children?.length&&t.push(...$(n.children));return t}export{G as n,re as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t,l as n,r,t as i}from"./vendor-react-B1k2FF9f.js";import{At as a,Cm as o,FS as s,Ft as c,It as l,Mt as u,Nt as d,Ot as f,PL as p,Pt as m,Xn as h,Yn as g,Z as _,ZA as v,Zn as y,Zt as b,ar as x,cT as S,hc as C,jt as w,kt as T,xm as E}from"./ui-components-3HVEceOY.js";import{a as D,f as O,g as k,h as A,l as j,m as M,n as N,o as P,s as F,t as I,u as L}from"./vendor-dndkit-BGB4qgc3.js";var R=e(t(),1),z=i();function B(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return null;let n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,i=parseInt(t[3],16)/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=0,c=0,l=(a+o)/2;if(a!==o){let e=a-o;switch(c=l>.5?e/(2-a-o):e/(a+o),a){case n:s=((r-i)/e+(r<i?6:0))/6;break;case r:s=((i-n)/e+2)/6;break;case i:s=((n-r)/e+4)/6;break}}return{h:s*360,s:c*100,l:l*100}}function V(e){let t=B(e);return t?`${Math.round(t.h)} ${Math.round(t.s)}% ${Math.round(t.l)}%`:null}function H(e){let t=B(e);if(!t)return null;let n=Math.max(t.l,65),r=t.s>80?Math.max(t.s-10,70):t.s;return`${Math.round(t.h)} ${Math.round(r)}% ${Math.round(n)}%`}function U(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return`0 0% 100%`;let n=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},r=n(parseInt(t[1],16)),i=n(parseInt(t[2],16)),a=n(parseInt(t[3],16));return .2126*r+.7152*i+.0722*a>.6?`222 47% 11%`:`0 0% 100%`}function W(e,t){(0,R.useEffect)(()=>{let n=document.documentElement,r=()=>n.classList.contains(`dark`),i=()=>{if(e?.primaryColor){let t=V(e.primaryColor),i=H(e.primaryColor),a=r()&&i||t;a&&(n.style.setProperty(`--brand-primary`,e.primaryColor),n.style.setProperty(`--brand-primary-hsl`,t||a),n.style.setProperty(`--primary`,a),n.style.setProperty(`--primary-foreground`,r()?`222 47% 11%`:U(e.primaryColor)),n.style.setProperty(`--ring`,a),n.style.setProperty(`--sidebar-primary`,a),n.style.setProperty(`--sidebar-ring`,a))}else n.style.removeProperty(`--brand-primary`),n.style.removeProperty(`--brand-primary-hsl`),n.style.removeProperty(`--primary`),n.style.removeProperty(`--primary-foreground`),n.style.removeProperty(`--ring`),n.style.removeProperty(`--sidebar-primary`),n.style.removeProperty(`--sidebar-ring`);if(e?.accentColor){let t=V(e.accentColor),i=H(e.accentColor),a=r()&&i||t;a&&(n.style.setProperty(`--brand-accent`,e.accentColor),n.style.setProperty(`--brand-accent-hsl`,t||a),n.style.setProperty(`--accent`,a),n.style.setProperty(`--accent-foreground`,r()?`222 47% 11%`:U(e.accentColor)))}else n.style.removeProperty(`--brand-accent`),n.style.removeProperty(`--brand-accent-hsl`),n.style.removeProperty(`--accent`),n.style.removeProperty(`--accent-foreground`)};i();let a=new MutationObserver(e=>{for(let t of e)if(t.type===`attributes`&&t.attributeName===`class`){i();break}});if(a.observe(n,{attributes:!0,attributeFilter:[`class`]}),e?.favicon){let t=document.querySelector(`#favicon`)||document.querySelector(`link[rel="icon"]`);t&&(t.href=e.favicon)}return t&&(document.title=t),()=>{a.disconnect(),n.style.removeProperty(`--brand-primary`),n.style.removeProperty(`--brand-primary-hsl`),n.style.removeProperty(`--brand-accent`),n.style.removeProperty(`--brand-accent-hsl`),n.style.removeProperty(`--primary`),n.style.removeProperty(`--primary-foreground`),n.style.removeProperty(`--ring`),n.style.removeProperty(`--sidebar-primary`),n.style.removeProperty(`--sidebar-ring`),n.style.removeProperty(`--accent`),n.style.removeProperty(`--accent-foreground`)}},[e?.primaryColor,e?.accentColor,e?.favicon,t])}function G({sidebar:e,navbar:t,children:n,className:r,defaultOpen:i=!0,branding:a}){return W(a,a?.title),(0,z.jsxs)(l,{defaultOpen:i,className:`!flex-col`,children:[(0,z.jsx)(`header`,{className:`sticky top-0 z-30 flex h-14 w-full shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4`,children:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 min-h-0 w-full`,children:[e,(0,z.jsx)(w,{className:`min-w-0`,children:(0,z.jsx)(`main`,{className:p(`flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6`,r),children:n})})]})]})}function K(e){return e?_(e):S}function q(e,t){if(typeof e==`string`)return e;if(t){let n=t(e.key,{defaultValue:e.defaultValue,...e.params});if(n&&n!==e.key)return n}return e.defaultValue||e.key}function J(e,t,n,r,i){let a=q(e.label,n);return typeof e.label==`string`?t&&e.type===`object`&&e.objectName?t(e.objectName,a):r&&e.type===`dashboard`&&e.dashboardName?r(e.dashboardName,a):i&&e.type===`group`&&e.id?i(e.id,a):a:a}var Y=e=>!(e===!1||e===`false`),X=()=>!0;function ee(e,t){switch(e.type){case`object`:{let n=`${t}/${e.objectName??``}`;return{href:e.viewName?`${n}/view/${e.viewName}`:n,external:!1}}case`dashboard`:return{href:e.dashboardName?`${t}/dashboard/${e.dashboardName}`:`#`,external:!1};case`page`:return{href:e.pageName?`${t}/page/${e.pageName}`:`#`,external:!1};case`report`:return{href:e.reportName?`${t}/report/${e.reportName}`:`#`,external:!1};case`url`:return{href:e.url??`#`,external:e.target===`_blank`};default:return{href:`#`,external:!1}}}function Z(e,t){if(!t.trim())return e;let n=t.toLowerCase().trim();return e.reduce((e,r)=>{if(r.type===`separator`)return e;if(r.type===`group`&&r.children?.length){let n=Z(r.children,t);return n.length>0&&e.push({...r,children:n}),e}return q(r.label).toLowerCase().includes(n)&&e.push(r),e},[])}var te=5;function ne({item:e,basePath:t,evalVis:n,checkPerm:r,onAction:i,enablePinning:a,onPinToggle:o,enableReorder:s,resolveObjectLabel:c,resolveDashboardLabel:l,resolveGroupLabel:u,t:d}){let{attributes:f,listeners:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=D({id:e.id,disabled:!s});return(0,z.jsx)(`div`,{ref:m,style:{transform:k.Transform.toString(h),transition:g,opacity:_?.5:void 0,zIndex:_?10:void 0},...f,children:(0,z.jsx)(Q,{item:e,basePath:t,evalVis:n,checkPerm:r,onAction:i,enablePinning:a,onPinToggle:o,dragListeners:s?p:void 0,resolveObjectLabel:c,resolveDashboardLabel:l,resolveGroupLabel:u,t:d})})}function Q({item:e,basePath:t,evalVis:i,checkPerm:l,onAction:p,enablePinning:_,onPinToggle:S,dragListeners:C,resolveObjectLabel:w,resolveDashboardLabel:D,resolveGroupLabel:O,t:k}){let A=n(),[j,M]=(0,R.useState)(e.defaultOpen!==!1);if(!i(e.visible)||e.requiredPermissions?.length&&!l(e.requiredPermissions))return null;if(e.type===`separator`)return(0,z.jsx)(b,{className:`my-2`});if(e.type===`group`){let n=(e.children??[]).slice().sort((e,t)=>(e.order??0)-(t.order??0));return(0,z.jsx)(g,{open:j,onOpenChange:M,children:(0,z.jsxs)(f,{children:[(0,z.jsx)(a,{asChild:!0,children:(0,z.jsxs)(y,{className:`flex w-full items-center justify-between`,children:[J(e,w,k,D,O),(0,z.jsx)(v,{className:`ml-auto h-4 w-4 transition-transform ${j?`rotate-90`:``}`})]})}),(0,z.jsx)(h,{children:(0,z.jsx)(T,{children:(0,z.jsx)(u,{children:n.map(e=>(0,z.jsx)(Q,{item:e,basePath:t,evalVis:i,checkPerm:l,onAction:p,enablePinning:_,onPinToggle:S,resolveObjectLabel:w,resolveDashboardLabel:D,resolveGroupLabel:O,t:k},e.id))})})})]})})}if(e.type===`action`){let t=K(e.icon),n=q(e.label,k);return(0,z.jsxs)(c,{children:[C&&(0,z.jsx)(`span`,{className:`absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground`,"aria-label":k?k(`console.nav.dragToReorder`,{defaultValue:`Drag to reorder`}):`Drag to reorder`,...C,children:(0,z.jsx)(s,{className:`h-3.5 w-3.5`})}),(0,z.jsxs)(m,{tooltip:n,onClick:()=>p?.(e),children:[(0,z.jsx)(t,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{children:n}),e.badge!=null&&(0,z.jsx)(x,{variant:e.badgeVariant??`default`,className:`ml-auto text-[10px] px-1.5 py-0`,children:e.badge})]}),_&&S&&(0,z.jsx)(d,{showOnHover:!0,onClick:()=>S(e.id,!e.pinned),"aria-label":k?k(e.pinned?`console.nav.unpinItem`:`console.nav.pinItem`,{defaultValue:e.pinned?`Unpin ${n}`:`Pin ${n}`,name:n}):e.pinned?`Unpin ${n}`:`Pin ${n}`,children:e.pinned?(0,z.jsx)(o,{className:`h-3.5 w-3.5`}):(0,z.jsx)(E,{className:`h-3.5 w-3.5`})})]})}let N=K(e.icon),{href:P,external:F}=ee(e,t),I=P!==`#`&&A.pathname.startsWith(P),L=J(e,w,k,D,O),B=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(N,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{children:L}),e.badge!=null&&(0,z.jsx)(x,{variant:e.badgeVariant??`default`,className:`ml-auto text-[10px] px-1.5 py-0`,children:e.badge})]});return(0,z.jsxs)(c,{children:[C&&(0,z.jsx)(`span`,{className:`absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground`,"aria-label":k?k(`console.nav.dragToReorder`,{defaultValue:`Drag to reorder`}):`Drag to reorder`,...C,children:(0,z.jsx)(s,{className:`h-3.5 w-3.5`})}),(0,z.jsx)(m,{asChild:!0,isActive:I,tooltip:L,children:F?(0,z.jsx)(`a`,{href:P,target:`_blank`,rel:`noopener noreferrer`,children:B}):(0,z.jsx)(r,{to:P,children:B})}),_&&S&&(0,z.jsx)(d,{showOnHover:!0,onClick:()=>S(e.id,!e.pinned),"aria-label":k?k(e.pinned?`console.nav.unpinItem`:`console.nav.pinItem`,{defaultValue:e.pinned?`Unpin ${L}`:`Pin ${L}`,name:L}):e.pinned?`Unpin ${L}`:`Pin ${L}`,children:e.pinned?(0,z.jsx)(o,{className:`h-3.5 w-3.5`}):(0,z.jsx)(E,{className:`h-3.5 w-3.5`})})]})}function re({items:e,basePath:t=``,evaluateVisibility:n=Y,checkPermission:r=X,onAction:i,searchQuery:o,enablePinning:s,onPinToggle:c,enableReorder:l,onReorder:d,resolveObjectLabel:p,resolveDashboardLabel:m,resolveGroupLabel:h,t:g}){let _=(0,R.useMemo)(()=>o?Z(e,o):e,[e,o]),v=(0,R.useMemo)(()=>$(_),[_]),y=_.slice().sort((e,t)=>(e.order??0)-(t.order??0)),b=A(M(L,{activationConstraint:{distance:te}}),M(j)),x=e=>{let{active:t,over:n}=e;if(!n||t.id===n.id||!d)return;let r=y.findIndex(e=>e.id===t.id),i=y.findIndex(e=>e.id===n.id);r===-1||i===-1||d(N(y,r,i).map((e,t)=>({...e,order:t})))},S={basePath:t,evalVis:n,checkPerm:r,onAction:i,enablePinning:s,onPinToggle:c,resolveObjectLabel:p,resolveDashboardLabel:m,resolveGroupLabel:h,t:g},w=y.some(e=>e.type===`group`),E=v.length>0&&s?(0,z.jsxs)(f,{children:[(0,z.jsxs)(a,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(C,{className:`h-3.5 w-3.5`}),g?g(`console.nav.favorites`,{defaultValue:`Favorites`}):`Favorites`]}),(0,z.jsx)(T,{children:(0,z.jsx)(u,{children:v.map(e=>(0,z.jsx)(Q,{item:e,...S},`fav-${e.id}`))})})]}):null;if(!w){let e=y.filter(e=>e.type!==`group`).map(e=>e.id);return(0,z.jsxs)(z.Fragment,{children:[E,(0,z.jsx)(f,{children:(0,z.jsx)(T,{children:l?(0,z.jsx)(F,{sensors:b,collisionDetection:O,onDragEnd:x,children:(0,z.jsx)(I,{items:e,strategy:P,children:(0,z.jsx)(u,{children:y.map(e=>(0,z.jsx)(ne,{item:e,enableReorder:l,...S},e.id))})})}):(0,z.jsx)(u,{children:y.map(e=>(0,z.jsx)(Q,{item:e,...S},e.id))})})})]})}let D=[],k=[],B=e=>{if(k.length===0)return;let t=k;k=[],D.push((0,z.jsx)(f,{children:(0,z.jsx)(T,{children:(0,z.jsx)(u,{children:t.map(e=>(0,z.jsx)(Q,{item:e,...S},e.id))})})},e))};return y.forEach((e,t)=>{e.type===`group`?(B(`leaf-${t}`),D.push((0,z.jsx)(Q,{item:e,...S},e.id))):k.push(e)}),B(`leaf-end`),(0,z.jsxs)(z.Fragment,{children:[E,D]})}function $(e){let t=[];for(let n of e)n.pinned&&n.type!==`group`&&n.type!==`separator`&&t.push(n),n.children?.length&&t.push(...$(n.children));return t}export{G as n,re as t};
|
package/dist/index.html
CHANGED
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
<script>
|
|
19
19
|
window.process = window.process || { env: { NODE_ENV: 'development' }, version: '', platform: 'browser' };
|
|
20
20
|
</script>
|
|
21
|
-
<script type="module" crossorigin src="/console/assets/index-
|
|
21
|
+
<script type="module" crossorigin src="/console/assets/index-BimUnPgZ.js"></script>
|
|
22
22
|
<link rel="stylesheet" crossorigin href="/console/assets/ui-components-B5ROGaJH.css">
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/console/assets/plugins-views-DnNKJB60.css">
|
|
24
|
-
<link rel="stylesheet" crossorigin href="/console/assets/index-
|
|
24
|
+
<link rel="stylesheet" crossorigin href="/console/assets/index-DoG5QbE6.css">
|
|
25
25
|
<link rel="modulepreload" href="/console/assets/framework-CoXA0nY6.js" />
|
|
26
|
-
<link rel="modulepreload" href="/console/assets/ui-components-
|
|
26
|
+
<link rel="modulepreload" href="/console/assets/ui-components-3HVEceOY.js" />
|
|
27
27
|
<link rel="modulepreload" href="/console/assets/vendor-radix-Bj7uHNWN.js" />
|
|
28
28
|
<link rel="modulepreload" href="/console/assets/vendor-react-B1k2FF9f.js" />
|
|
29
29
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/console",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "ObjectStack Console - The standard runtime UI for ObjectStack applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./plugin.js",
|
|
@@ -45,35 +45,35 @@
|
|
|
45
45
|
"typescript": "^6.0.3",
|
|
46
46
|
"vite": "^8.0.10",
|
|
47
47
|
"vitest": "^4.1.5",
|
|
48
|
-
"@object-ui/app-shell": "4.0.
|
|
49
|
-
"@object-ui/auth": "
|
|
50
|
-
"@object-ui/collaboration": "
|
|
51
|
-
"@object-ui/components": "
|
|
52
|
-
"@object-ui/core": "
|
|
53
|
-
"@object-ui/data-objectstack": "
|
|
54
|
-
"@object-ui/fields": "
|
|
55
|
-
"@object-ui/i18n": "
|
|
56
|
-
"@object-ui/layout": "
|
|
57
|
-
"@object-ui/mobile": "
|
|
58
|
-
"@object-ui/permissions": "
|
|
59
|
-
"@object-ui/plugin-calendar": "
|
|
60
|
-
"@object-ui/plugin-charts": "
|
|
61
|
-
"@object-ui/plugin-chatbot": "
|
|
62
|
-
"@object-ui/plugin-dashboard": "
|
|
63
|
-
"@object-ui/plugin-designer": "
|
|
64
|
-
"@object-ui/plugin-detail": "
|
|
65
|
-
"@object-ui/plugin-form": "
|
|
66
|
-
"@object-ui/plugin-gantt": "
|
|
67
|
-
"@object-ui/plugin-grid": "
|
|
68
|
-
"@object-ui/plugin-kanban": "
|
|
69
|
-
"@object-ui/plugin-list": "
|
|
70
|
-
"@object-ui/plugin-map": "
|
|
71
|
-
"@object-ui/plugin-markdown": "
|
|
72
|
-
"@object-ui/plugin-report": "
|
|
73
|
-
"@object-ui/plugin-timeline": "
|
|
74
|
-
"@object-ui/plugin-view": "
|
|
75
|
-
"@object-ui/react": "
|
|
76
|
-
"@object-ui/types": "
|
|
48
|
+
"@object-ui/app-shell": "4.0.1",
|
|
49
|
+
"@object-ui/auth": "4.0.1",
|
|
50
|
+
"@object-ui/collaboration": "4.0.1",
|
|
51
|
+
"@object-ui/components": "4.0.1",
|
|
52
|
+
"@object-ui/core": "4.0.1",
|
|
53
|
+
"@object-ui/data-objectstack": "4.0.1",
|
|
54
|
+
"@object-ui/fields": "4.0.1",
|
|
55
|
+
"@object-ui/i18n": "4.0.1",
|
|
56
|
+
"@object-ui/layout": "4.0.1",
|
|
57
|
+
"@object-ui/mobile": "4.0.1",
|
|
58
|
+
"@object-ui/permissions": "4.0.1",
|
|
59
|
+
"@object-ui/plugin-calendar": "4.0.1",
|
|
60
|
+
"@object-ui/plugin-charts": "4.0.1",
|
|
61
|
+
"@object-ui/plugin-chatbot": "4.0.1",
|
|
62
|
+
"@object-ui/plugin-dashboard": "4.0.1",
|
|
63
|
+
"@object-ui/plugin-designer": "4.0.1",
|
|
64
|
+
"@object-ui/plugin-detail": "4.0.1",
|
|
65
|
+
"@object-ui/plugin-form": "4.0.1",
|
|
66
|
+
"@object-ui/plugin-gantt": "4.0.1",
|
|
67
|
+
"@object-ui/plugin-grid": "4.0.1",
|
|
68
|
+
"@object-ui/plugin-kanban": "4.0.1",
|
|
69
|
+
"@object-ui/plugin-list": "4.0.1",
|
|
70
|
+
"@object-ui/plugin-map": "4.0.1",
|
|
71
|
+
"@object-ui/plugin-markdown": "4.0.1",
|
|
72
|
+
"@object-ui/plugin-report": "4.0.1",
|
|
73
|
+
"@object-ui/plugin-timeline": "4.0.1",
|
|
74
|
+
"@object-ui/plugin-view": "4.0.1",
|
|
75
|
+
"@object-ui/react": "4.0.1",
|
|
76
|
+
"@object-ui/types": "4.0.1"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
79
79
|
"dev": "vite",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as n,f as r,t as i}from"./vendor-react-B1k2FF9f.js";import{a,f as o,p as s}from"./framework-CoXA0nY6.js";import{d as ee}from"./infrastructure-Djv3I7gr.js";import{o as c}from"./vendor-ui-utils-AywTz3cM.js";import{Aj as l,Bs as u,Dj as d,Gn as f,Hn as te,Kn as p,Un as ne,Wn as m,_j as h,at as re,bb as ie,io as g,it as _,lm as v,po as y,qm as b,qn as x,rt as S,vb as C,vr as w}from"./ui-components-BCmPcwhR.js";import{i as T,n as E,r as ae}from"./plugins-views-C5gstDGy.js";import{n as oe}from"./plugin-form-BhbVu8jO.js";import{a as se,o as ce,s as le}from"./index-98Lfd5ty.js";var D=t(n(),1);function O(e,t){if(e!=null){if(typeof e==`string`)return e;if(t){let n=t(e.key,{defaultValue:e.defaultValue,...e.params});if(n&&n!==e.key)return n}return e.defaultValue||e.key}}function k(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}var A=e({DashboardView:()=>B}),j=i(),M=[{type:`metric`,label:`KPI Metric`,Icon:g},{type:`bar`,label:`Bar Chart`,Icon:l},{type:`line`,label:`Line Chart`,Icon:d},{type:`pie`,label:`Pie Chart`,Icon:h},{type:`table`,label:`Table`,Icon:u},{type:`grid`,label:`Grid`,Icon:C}],N=0;function P(){return N+=1,`widget_${Date.now()}_${N}`}function F(e){return!e.widgets?.length||!e.widgets.some(e=>!e.id)?e:{...e,widgets:e.widgets.map(e=>e.id?e:{...e,id:P()})}}function I(e){let t=M.find(t=>t.type===e);return t?`New ${t.label}`:`New Widget`}function L(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 R(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 z(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 B({dataSource:e}){let{dashboardName:t}=r(),{showDebug:n}=le(),i=o(),{t:l}=a(),{dashboardLabel:u,dashboardDescription:d}=ee(),[h,g]=(0,D.useState)(!0),[C,k]=(0,D.useState)(!1),[A,N]=(0,D.useState)(null),[B,V]=(0,D.useState)(0),[H,U]=(0,D.useState)(null),W=(0,D.useCallback)(e=>{U(t=>(t&&t.resolve(e),null))},[]),ue=(0,D.useCallback)(e=>new Promise(t=>{let n;if(typeof e==`string`){let t=e.match(/^(create|new|add|edit|update)_(.+)$/);if(t){let e=t[1];n={objectName:t[2],mode:e===`edit`||e===`update`?`edit`:`create`}}else n={objectName:e,mode:`create`}}else n=e;U({schema:n,resolve:t})}),[]),de=(0,D.useMemo)(()=>({export_dashboard_pdf:async()=>{c.info(`Preparing PDF export…`);try{return window.print(),{success:!0}}catch(e){return c.error(`Export failed: ${e?.message||String(e)}`),{success:!1,error:e?.message||String(e)}}},forecast_dashboard:async()=>(c.info(`Forecast view coming soon`),{success:!0})}),[]);(0,D.useEffect)(()=>{g(!0),Y(null),k(!1),N(null),queueMicrotask(()=>g(!1))},[t]);let{dashboards:fe,objects:G,refresh:K}=s(),q=fe?.find(e=>e.name===t),[J,Y]=(0,D.useState)(null);(0,D.useEffect)(()=>{C||Y(null)},[q]);let X=(0,D.useCallback)(async e=>{try{i&&(await i.update(`sys_dashboard`,t,e),K().catch(()=>{}))}catch(e){console.warn(`[DashboardView] Auto-save failed:`,e)}},[i,t,K]),pe=(0,D.useCallback)(()=>{Y(F(q)),k(!0),V(e=>e+1)},[q]),Z=(0,D.useCallback)(()=>{k(!1),N(null)},[]),me=(0,D.useCallback)(e=>{if(!J)return;let t=P(),n={id:t,title:I(e),type:e,layout:{x:0,y:J.widgets?.length??0,w:J.columns??2,h:1}},r={...J,widgets:[...J.widgets||[],n]};Y(r),X(r),N(t),V(e=>e+1)},[J,X]),he=(0,D.useCallback)(e=>{if(!J)return;let t={...J,widgets:J.widgets.filter(t=>t.id!==e)};Y(t),X(t),A===e&&N(null)},[J,A,X]),ge=(0,D.useMemo)(()=>z(J||q),[B]),_e=(0,D.useCallback)(e=>{if(!J)return;let t={...J,columns:e.columns,gap:e.gap,rowHeight:e.rowHeight,refreshInterval:Number(e.refreshInterval)||0,title:e.title,showDescription:e.showDescription,theme:e.theme};Y(t),X(t),V(e=>e+1)},[J,X]),ve=(0,D.useCallback)((e,t)=>{J&&Y(n=>n&&(e===`refreshInterval`?{...n,refreshInterval:Number(t)||0}:{...n,[e]:t}))},[J]),Q=J?.widgets?.find(e=>e.id===A),ye=(0,D.useMemo)(()=>Q?L(Q):{},[A,B]),be=(0,D.useCallback)(e=>{if(!J||!A||!Q)return;let t=R(e,Q),n={...J,widgets:J.widgets.map(e=>e.id===A?{...e,...t}:e)};Y(n),X(n),V(e=>e+1)},[J,A,Q,X]),xe=(0,D.useCallback)((e,t)=>{A&&Y(n=>{if(!n)return n;let r=n.widgets?.find(e=>e.id===A);if(!r)return n;let i=L(r);i[e]=t;let a=R(i,r);return{...n,widgets:n.widgets.map(e=>e.id===A?{...e,...a}:e)}})},[A]),Se=(0,D.useMemo)(()=>{if(G?.length)return G.map(e=>({value:e.name,label:e.label||e.name}))},[G]),Ce=(0,D.useMemo)(()=>{let e=Q?.object;if(!e||!G?.length)return;let t=G.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,G]);if(h)return(0,j.jsx)(se,{});if(!q)return(0,j.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,j.jsxs)(S,{children:[(0,j.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,j.jsx)(ie,{className:`h-6 w-6 text-muted-foreground`})}),(0,j.jsx)(re,{children:`Dashboard Not Found`}),(0,j.jsxs)(_,{children:[`The dashboard "`,t,`" could not be found. It may have been removed or renamed.`]})]})});let $=J||q;return(0,j.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-background`,children:[(0,j.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,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`h1`,{className:`text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate`,children:u({name:q.name,label:O(q.label,l)})||q.name}),(()=>{let e=d({name:q.name,description:O(q.description,l)});return e?(0,j.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:e}):null})()]}),(0,j.jsxs)(`div`,{className:`shrink-0 flex items-center gap-1.5`,children:[C&&(0,j.jsx)(`div`,{className:`flex items-center gap-1 mr-2`,role:`toolbar`,"aria-label":`Add widgets`,"data-testid":`dashboard-widget-toolbar`,children:M.map(({type:e,label:t,Icon:n})=>(0,j.jsxs)(`button`,{type:`button`,"data-testid":`dashboard-add-${e}`,onClick:()=>me(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,j.jsx)(v,{className:`h-3 w-3`}),(0,j.jsx)(n,{className:`h-3 w-3`})]},e))}),(0,j.jsxs)(`button`,{type:`button`,onClick:pe,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,j.jsx)(b,{className:`h-3.5 w-3.5`}),l(`common.edit`,{defaultValue:`Edit`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col sm:flex-row relative`,children:[(0,j.jsx)(`div`,{className:`flex-1 min-w-0 overflow-auto p-2 sm:p-4 md:p-6`,children:(0,j.jsx)(T,{schema:$,dataSource:e,designMode:C,selectedWidgetId:A,onWidgetClick:N,modalHandler:ue,scriptHandlers:de})}),Q?(0,j.jsx)(E,{open:C,onClose:Z,config:ye,onSave:be,onFieldChange:xe,availableObjects:Se,availableFields:Ce,headerExtra:(0,j.jsx)(w,{size:`sm`,variant:`ghost`,onClick:()=>he(A),className:`h-7 w-7 p-0 text-destructive hover:text-destructive`,"data-testid":`widget-delete-button`,title:`Delete widget`,children:(0,j.jsx)(y,{className:`h-3.5 w-3.5`})})},A):(0,j.jsx)(ae,{open:C,onClose:Z,config:ge,onSave:_e,onFieldChange:ve}),(0,j.jsx)(ce,{open:n,sections:[{title:`Dashboard Configuration`,data:$}]})]}),H&&H.schema?.objectName?(0,j.jsx)(oe,{schema:{type:`object-form`,formType:`modal`,objectName:H.schema.objectName,mode:H.schema.mode||`create`,recordId:H.schema.recordId,title:H.schema.title,description:H.schema.description,fields:H.schema.fields,open:!0,onOpenChange:e=>{e||W({success:!1})},onSuccess:e=>{W({success:!0,reload:!0,data:e})},onCancel:()=>{W({success:!1})},showSubmit:!0,showCancel:!0},dataSource:i}):H?(0,j.jsx)(te,{open:!0,onOpenChange:e=>{e||W({success:!1})},children:(0,j.jsxs)(ne,{children:[(0,j.jsxs)(p,{children:[(0,j.jsx)(x,{children:H.schema?.title||`Action`}),H.schema?.description&&(0,j.jsx)(m,{children:H.schema.description})]}),(0,j.jsxs)(f,{children:[(0,j.jsx)(w,{variant:`outline`,onClick:()=>W({success:!1}),children:`Cancel`}),(0,j.jsx)(w,{onClick:()=>W({success:!0}),children:`OK`})]})]})}):null]})}export{k as n,O as r,A as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t,f as n,t as r,u as i}from"./vendor-react-B1k2FF9f.js";import{p as a}from"./framework-CoXA0nY6.js";import{c as o}from"./infrastructure-Djv3I7gr.js";import{o as s}from"./vendor-ui-utils-AywTz3cM.js";import{$n as c,Ld as l,Qn as u,Sy as d,ir as ee,lm as te,po as f,qm as p,sI as m,un as ne,vr as h}from"./ui-components-BCmPcwhR.js";import{r as re}from"./index-98Lfd5ty.js";import{i as g,t as ie}from"./getIcon-vBP44wSb.js";import{t as ae}from"./MetadataFormDialog-Cje6P_Wf.js";var _=e(t(),1),v=r();function y({items:e,columns:t,editable:n=!1,saving:r=!1,deletingName:i=null,typeLabel:a=`item`,rowActions:o=[],onItemClick:s,onEdit:c,onDelete:l}){return(0,v.jsx)(`div`,{className:`rounded-lg border bg-card`,"data-testid":`metadata-grid`,children:(0,v.jsx)(`div`,{className:`overflow-x-auto`,children:(0,v.jsxs)(`table`,{className:`w-full text-sm`,"aria-label":`${a} list`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{className:`border-b bg-muted/50`,children:[t.map(e=>(0,v.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,v.jsx)(`th`,{className:`px-4 py-3 text-right font-medium text-muted-foreground w-24`,children:`Actions`})]})}),(0,v.jsx)(`tbody`,{children:e.map(e=>{let u=String(e.name??``);return(0,v.jsxs)(`tr`,{className:`border-b last:border-0 hover:bg-accent/50 cursor-pointer transition-colors`,"data-testid":`metadata-item-${u}`,onClick:()=>s?.(u),children:[t.map(t=>{let n=String(e[t.key]??`—`);return(0,v.jsx)(`td`,{className:`px-4 py-3 truncate max-w-[200px]`,title:n,children:n},t.key)}),n&&(0,v.jsx)(`td`,{className:`px-4 py-3 text-right`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[o.map(t=>(0,v.jsx)(h,{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}-${u}`,children:(0,v.jsx)(`span`,{className:`text-xs`,children:t.label.charAt(0)})},t.key)),(0,v.jsx)(h,{variant:`ghost`,size:`icon`,title:`Edit ${a}`,onClick:t=>{t.stopPropagation(),c?.(e)},disabled:r,"data-testid":`edit-${u}-btn`,children:(0,v.jsx)(p,{className:`h-4 w-4`})}),(0,v.jsx)(h,{variant:`ghost`,size:`icon`,title:i===u?`Click again to confirm`:`Delete ${a}`,onClick:e=>{e.stopPropagation(),l?.(u)},disabled:r,"data-testid":`delete-${u}-btn`,children:(0,v.jsx)(f,{className:`h-4 w-4 ${i===u?`text-destructive`:``}`})})]})})]},u)})})]})})})}function b(){let e=i(),{appName:t,metadataType:r}=n(),b=t?`/apps/${t}`:``,x=re(),{refresh:S}=a(),{user:C}=o(),w=C?.role===`admin`,T=r?g(r):void 0,[E,D]=(0,_.useState)([]),[O,k]=(0,_.useState)(!0),[A,oe]=(0,_.useState)(``),[j,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)(null),[F,I]=(0,_.useState)(!1),[L,R]=(0,_.useState)(`create`),[z,B]=(0,_.useState)(null),V=(0,_.useCallback)(async()=>{if(!(!x||!r)){k(!0);try{D((await x.getItems(r)).filter(e=>!e._deleted))}catch{s.error(`Failed to load ${T?.pluralLabel??r}`)}finally{k(!1)}}},[x,r,T?.pluralLabel]);(0,_.useEffect)(()=>{V()},[V]);let H=(0,_.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,_.useCallback)(async e=>{if(!(!x||!r))if(N===e){M(!0);try{await x.deleteMetadataItem(r,e),D(t=>t.filter(t=>t.name!==e)),await S(),s.success(`${T?.label??`Item`} "${e}" deleted`)}catch{s.error(`Failed to delete "${e}"`)}finally{M(!1),P(null)}}else P(e)},[x,r,N,T?.label,S]),W=(0,_.useCallback)(()=>{B(null),R(`create`),I(!0)},[]),G=(0,_.useCallback)(e=>{B(e),R(`edit`),I(!0)},[]),K=(0,_.useCallback)(async e=>{if(!x||!r)return;let t=e.name??String(z?.name??``);if(t){M(!0);try{let n=L===`edit`?{...z,...e}:{...e};await x.saveMetadataItem(r,t,n),await S(),await V(),s.success(L===`edit`?`${T?.label??`Item`} "${t}" updated`:`${T?.label??`Item`} "${t}" created`)}catch{throw s.error(L===`edit`?`Failed to update "${t}"`:`Failed to create "${t}"`),Error(`Failed to save ${T?.label??`item`} "${t}"`)}finally{M(!1)}}},[x,r,z,L,T?.label,S,V]);if(!T)return(0,v.jsx)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:(0,v.jsxs)(`div`,{className:`text-center text-muted-foreground py-12`,children:[(0,v.jsxs)(`p`,{className:`text-lg font-medium`,children:[`Unknown metadata type: `,r]}),(0,v.jsx)(h,{variant:`outline`,className:`mt-4`,onClick:()=>e(`${b}/system`),children:`Back to System Settings`})]})});let q=ie(T.icon),J=T.editable!==!1&&w,Y=T.listComponent;if(Y)return(0,v.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:[(0,v.jsx)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:(0,v.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,v.jsx)(h,{variant:`ghost`,size:`icon`,onClick:()=>e(`${b}/system`),"data-testid":`back-to-hub-btn`,children:(0,v.jsx)(m,{className:`h-4 w-4`})}),(0,v.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,v.jsx)(q,{className:`h-5 w-5 text-primary`})}),(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:T.pluralLabel}),(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:T.description})]})]})}),(0,v.jsx)(Y,{config:T,basePath:b,metadataType:r,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,v.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,"data-testid":`metadata-manager-page`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,v.jsx)(h,{variant:`ghost`,size:`icon`,onClick:()=>e(`${b}/system`),"data-testid":`back-to-hub-btn`,children:(0,v.jsx)(m,{className:`h-4 w-4`})}),(0,v.jsx)(`div`,{className:`bg-primary/10 p-2 rounded-md shrink-0`,children:(0,v.jsx)(q,{className:`h-5 w-5 text-primary`})}),(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:T.pluralLabel}),(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:T.description})]})]}),J&&(0,v.jsxs)(h,{onClick:W,"data-testid":`create-metadata-btn`,children:[(0,v.jsx)(te,{className:`mr-2 h-4 w-4`}),`New `,T.label]}),X.length>0&&(0,v.jsx)(`div`,{className:`flex items-center gap-2`,children:X.map(e=>(0,v.jsx)(h,{variant:e.variant??`outline`,onClick:()=>e.handler?.(),"data-testid":`page-action-${e.key}`,children:e.label},e.key))})]}),(0,v.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[(0,v.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,v.jsxs)(`label`,{htmlFor:`metadata-search`,className:`sr-only`,children:[`Search `,T.pluralLabel.toLowerCase()]}),(0,v.jsx)(l,{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,v.jsx)(ne,{id:`metadata-search`,placeholder:`Search ${T.pluralLabel.toLowerCase()}...`,value:A,onChange:e=>oe(e.target.value),className:`pl-8`,"data-testid":`metadata-search-input`})]}),(0,v.jsxs)(ee,{variant:`secondary`,"data-testid":`metadata-count-badge`,children:[H.length,` `,T.pluralLabel.toLowerCase()]})]}),O&&(0,v.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`metadata-loading`,children:[(0,v.jsx)(d,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Loading `,T.pluralLabel.toLowerCase(),`...`]}),j&&(0,v.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`metadata-saving`,children:[(0,v.jsx)(d,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),`Saving...`]}),!O&&H.length===0&&(0,v.jsx)(`div`,{className:`text-center text-muted-foreground py-12`,"data-testid":`metadata-empty`,children:(0,v.jsxs)(`p`,{children:[`No `,T.pluralLabel.toLowerCase(),` found.`]})}),!O&&H.length>0&&!$&&(0,v.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:H.map(t=>{let n=String(t.name??``),i=String(t.label??t.name??``),a=String(t.description??``);return(0,v.jsx)(u,{className:`transition-colors hover:bg-accent/50 cursor-pointer`,"data-testid":`metadata-item-${n}`,onClick:()=>e(`${b}/system/metadata/${r}/${n}`),children:(0,v.jsxs)(c,{className:`flex items-center justify-between p-4`,children:[(0,v.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,v.jsx)(`p`,{className:`font-medium truncate`,children:i}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:n}),a&&(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 truncate`,children:a})]}),J&&(0,v.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 ml-2`,children:[Z.map(e=>(0,v.jsx)(h,{variant:e.variant??`ghost`,size:`icon`,title:e.label,onClick:n=>{n.stopPropagation(),e.handler?.(t)},"data-testid":`row-action-${e.key}-${n}`,children:(0,v.jsx)(`span`,{className:`text-xs`,children:e.label.charAt(0)})},e.key)),(0,v.jsx)(h,{variant:`ghost`,size:`icon`,title:`Edit ${T.label.toLowerCase()}`,onClick:e=>{e.stopPropagation(),G(t)},disabled:j,"data-testid":`edit-${n}-btn`,children:(0,v.jsx)(p,{className:`h-4 w-4`})}),(0,v.jsx)(h,{variant:`ghost`,size:`icon`,title:N===n?`Click again to confirm`:`Delete ${T.label.toLowerCase()}`,onClick:e=>{e.stopPropagation(),U(n)},disabled:j,"data-testid":`delete-${n}-btn`,children:(0,v.jsx)(f,{className:`h-4 w-4 ${N===n?`text-destructive`:``}`})})]})]})},n)})}),!O&&H.length>0&&$&&(0,v.jsx)(y,{items:H,columns:se,editable:J,saving:j,deletingName:N,typeLabel:T.label.toLowerCase(),rowActions:Z,onItemClick:t=>e(`${b}/system/metadata/${r}/${t}`),onEdit:G,onDelete:U}),J&&(0,v.jsx)(ae,{open:F,onOpenChange:I,mode:L,typeLabel:T.label,formFields:T.formFields,initialValues:z??void 0,onSubmit:K})]})}export{b as MetadataManagerPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t,t as n}from"./vendor-react-B1k2FF9f.js";import{c as r,r as i}from"./infrastructure-Djv3I7gr.js";import{$n as a,FA as o,Qn as s,ar as c,cr as l,dn as u,er as d,fy as f,ir as p,lr as m,na as h,nr as g,or as _,sr as v,tr as y,un as b,vr as x,wA as S}from"./ui-components-BCmPcwhR.js";var C=e(t(),1),w=n();function T(){let{user:e,updateUser:t,isLoading:n}=r(),[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)(s,{children:(0,w.jsx)(a,{className:`pt-6`,children:(0,w.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,w.jsxs)(c,{className:`h-16 w-16`,children:[(0,w.jsx)(v,{src:e.image??void 0,alt:e.name??`User`}),(0,w.jsx)(_,{className:`text-lg bg-primary text-primary-foreground`,children:i(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)(p,{variant:`secondary`,className:`mt-1`,children:e.role??`member`})]})]})})}),(0,w.jsxs)(s,{children:[(0,w.jsxs)(y,{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)(g,{className:`text-base sm:text-lg`,children:`Personal Information`})]}),(0,w.jsx)(d,{children:`Update your name and view account details`})]}),(0,w.jsx)(a,{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)(l,{variant:`destructive`,children:[(0,w.jsx)(o,{className:`h-4 w-4`}),(0,w.jsx)(m,{children:k})]}),D&&(0,w.jsxs)(l,{children:[(0,w.jsx)(S,{className:`h-4 w-4 text-green-600`}),(0,w.jsx)(m,{className:`text-green-800 dark:text-green-400`,children:`Profile updated successfully.`})]}),(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(u,{htmlFor:`profile-name`,children:`Name`}),(0,w.jsx)(b,{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)(u,{htmlFor:`profile-email`,children:`Email`}),(0,w.jsx)(b,{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)(u,{children:`Role`}),(0,w.jsx)(b,{type:`text`,value:e.role??`member`,disabled:!0,className:`bg-muted text-muted-foreground`})]}),(0,w.jsx)(x,{type:`submit`,disabled:n,className:`w-full sm:w-auto`,children:n?`Saving...`:`Save Changes`})]})})]}),(0,w.jsx)(s,{children:(0,w.jsxs)(y,{children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(f,{className:`h-4 w-4 text-muted-foreground`}),(0,w.jsx)(g,{className:`text-base sm:text-lg`,children:`Change Password`})]}),(0,w.jsx)(d,{children:`To change your password, use the password reset flow from the login page.`})]})})]}):null}export{T as ProfilePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as n,f as r,t as i,u as a}from"./vendor-react-B1k2FF9f.js";import{a as o,g as s}from"./framework-CoXA0nY6.js";import{c,u as l}from"./infrastructure-Djv3I7gr.js";import{o as u}from"./vendor-ui-utils-AywTz3cM.js";import{$i as d,$t as f,DD as p,Gn as m,Hn as h,Kn as g,Qt as _,Un as v,Wn as y,Zt as b,_r as x,at as S,dn as C,dr as w,en as T,fr as E,ft as D,gr as O,hr as k,it as ee,mr as A,pr as j,qn as M,rt as te,tn as N,un as P,ur as F,vr as I}from"./ui-components-BCmPcwhR.js";import{a as ne,o as re}from"./plugins-views-C5gstDGy.js";import{i as ie,o as ae,s as oe}from"./index-98Lfd5ty.js";var L=t(n(),1),R=i(),z=(0,L.createContext)(void 0);function B({children:e}){let[t,n]=(0,L.useState)(`home`),[r,i]=(0,L.useState)(),[a,o]=(0,L.useState)(),s=(0,L.useMemo)(()=>({context:t,setContext:n,currentAppName:r,setCurrentAppName:i,recordTitle:a,setRecordTitle:o}),[t,r,a]);return(0,R.jsx)(z.Provider,{value:s,children:e})}function V(){return(0,L.useContext)(z)||{context:`app`,setContext:()=>{},currentAppName:void 0,setCurrentAppName:()=>{},recordTitle:void 0,setRecordTitle:()=>{}}}function se(e){let{setRecordTitle:t}=V();(0,L.useEffect)(()=>(t(e),()=>t(void 0)),[e,t])}function H(e){let{url:t,channel:n,autoReconnect:r=!0,reconnectInterval:i=1e3,maxReconnectAttempts:a=10,authToken:o}=e,[s,c]=(0,L.useState)(`disconnected`),[l,u]=(0,L.useState)(null),[d,f]=(0,L.useState)([]),[p,m]=(0,L.useState)(null),h=(0,L.useRef)(null),g=(0,L.useRef)(0),_=(0,L.useRef)(null),v=(0,L.useRef)(new Map),y=(0,L.useRef)([]),b=(0,L.useRef)(!0),x=(0,L.useRef)(!1),S=(0,L.useCallback)(()=>{_.current!==null&&(clearTimeout(_.current),_.current=null)},[]),C=(0,L.useCallback)(e=>{for(;y.current.length>0;){let t=y.current.shift(),r={type:t.type,channel:n,data:t.data,timestamp:new Date().toISOString()};e.send(JSON.stringify(r))}},[n]),w=(0,L.useCallback)(()=>{if(typeof WebSocket>`u`){m(Error(`WebSocket is not available in this environment`)),c(`error`);return}if(!t){m(Error(`WebSocket URL is required`)),c(`error`);return}try{let e=new URL(t);if(e.protocol!==`ws:`&&e.protocol!==`wss:`){m(Error(`WebSocket URL must use ws: or wss: protocol`)),c(`error`);return}}catch{m(Error(`Invalid WebSocket URL`)),c(`error`);return}h.current&&=(x.current=!0,h.current.close(),null),x.current=!1,c(`connecting`),m(null);let e=o?`${t}?token=${encodeURIComponent(o)}&channel=${encodeURIComponent(n)}`:`${t}?channel=${encodeURIComponent(n)}`,s;try{s=new WebSocket(e)}catch(e){if(!b.current)return;m(e instanceof Error?e:Error(`Failed to create WebSocket connection`)),c(`error`);return}h.current=s,s.onopen=()=>{b.current&&(c(`connected`),m(null),g.current=0,C(s))},s.onmessage=e=>{if(b.current)try{let t=JSON.parse(String(e.data));if(t.channel!==n)return;u(t),f(e=>[...e,t]);let r=v.current.get(t.type);r&&r.forEach(e=>e(t.data))}catch{}},s.onerror=()=>{b.current&&(m(Error(`WebSocket connection error`)),c(`error`))},s.onclose=()=>{if(b.current){if(h.current=null,x.current){c(`disconnected`);return}if(r&&g.current<a){c(`reconnecting`);let e=Math.min(i*2**g.current,3e4);g.current+=1,_.current=setTimeout(()=>{b.current&&w()},e)}else c(`disconnected`)}}},[t,n,o,r,i,a,C]),T=(0,L.useCallback)(()=>{S(),x.current=!0,g.current=0,h.current&&=(h.current.close(),null),c(`disconnected`)},[S]),E=(0,L.useCallback)(()=>{S(),g.current=0,w()},[w,S]),D=(0,L.useCallback)((e,t)=>{let r=h.current;if(r&&r.readyState===WebSocket.OPEN){let i={type:e,channel:n,data:t,timestamp:new Date().toISOString()};r.send(JSON.stringify(i))}else y.current.push({type:e,data:t})},[n]),O=(0,L.useCallback)((e,t)=>(v.current.has(e)||v.current.set(e,new Set),v.current.get(e).add(t),()=>{let n=v.current.get(e);n&&(n.delete(t),n.size===0&&v.current.delete(e))}),[]);return(0,L.useEffect)(()=>(b.current=!0,t&&w(),()=>{b.current=!1,S(),x.current=!0,h.current&&=(h.current.close(),null)}),[t,n,o]),{connectionState:s,isConnected:s===`connected`,lastMessage:l,messages:d,send:D,subscribe:O,disconnect:T,reconnect:E,error:p}}var U=0;function W(){return U+=1,`conflict-${Date.now()}-${U}`}var G=0;function K(){return G+=1,`ver-${Date.now()}-${G}`}function q(e,t,n){let[r,i]=(0,L.useState)([]),[a,o]=(0,L.useState)([]);return{versions:r,currentVersion:(0,L.useMemo)(()=>r.length===0?0:r[r.length-1].version,[r]),conflicts:a,hasConflicts:a.length>0,recordVersion:(0,L.useCallback)((n,r)=>{i(i=>{let a=i.length===0?1:i[i.length-1].version+1,o={id:K(),version:a,timestamp:new Date().toISOString(),userId:e,userName:t,changes:n,message:r};return[...i,o]})},[e,t]),resolveConflict:(0,L.useCallback)((n,r,a)=>{o(o=>{let s=o.find(e=>e.id===n);if(!s)return o;let c;switch(r){case`local`:c=s.localValue;break;case`remote`:c=s.remoteValue;break;case`merge`:c=a??s.localValue;break}return i(n=>{let i=n.length===0?1:n[n.length-1].version+1,a={id:K(),version:i,timestamp:new Date().toISOString(),userId:e,userName:t,changes:{[s.field]:{before:s.baseValue,after:c}},message:`Resolved conflict on "${s.field}" using ${r} strategy`};return[...n,a]}),o.filter(e=>e.id!==n)})},[e,t]),resolveAllConflicts:(0,L.useCallback)(n=>{o(r=>{if(r.length===0)return r;let a={};for(let e of r)a[e.field]={before:e.baseValue,after:n===`local`?e.localValue:e.remoteValue};return i(r=>{let i=r.length===0?1:r[r.length-1].version+1,o={id:K(),version:i,timestamp:new Date().toISOString(),userId:e,userName:t,changes:a,message:`Resolved all conflicts using ${n} strategy`};return[...r,o]}),[]})},[e,t]),revertToVersion:(0,L.useCallback)(n=>{let a=r.findIndex(e=>e.id===n);if(a===-1)return null;let o={};for(let e=0;e<=a;e++){let t=r[e];for(let[e,n]of Object.entries(t.changes))o[e]=n.after}let s={},c={};for(let e of r)for(let[t,n]of Object.entries(e.changes))c[t]=n.after;for(let[e,t]of Object.entries(o))c[e]!==t&&(s[e]={before:c[e],after:t});return Object.keys(s).length>0&&i(n=>{let i=n.length===0?1:n[n.length-1].version+1,o={id:K(),version:i,timestamp:new Date().toISOString(),userId:e,userName:t,changes:s,message:`Reverted to version ${r[a].version}`};return[...n,o]}),o},[r,e,t]),compareVersions:(0,L.useCallback)((e,t)=>{let n=r.findIndex(t=>t.id===e),i=r.findIndex(e=>e.id===t);if(n===-1||i===-1)return null;let[a,o]=n<i?[n,i]:[i,n],s=e=>{let t={};for(let n=0;n<=e;n++)for(let[e,i]of Object.entries(r[n].changes))t[e]=i.after;return t},c=s(a),l=s(o),u=new Set([...Object.keys(c),...Object.keys(l)]),d={};for(let e of u){let t=c[e],n=l[e];t!==n&&(d[e]={before:t,after:n})}return d},[r]),addConflict:(0,L.useCallback)(e=>{let t={...e,id:W()};o(e=>[...e,t])},[]),clearHistory:(0,L.useCallback)(()=>{i([]),o([])},[])}}var J={sm:24,md:32,lg:40},Y={active:`#22c55e`,idle:`#f59e0b`,away:`#94a3b8`};function X(e){return e.split(` `).map(e=>e[0]).join(``).toUpperCase().slice(0,2)}function Z({users:e,maxVisible:t=5,size:n=`md`,showStatus:r=!0,className:i}){let a=J[n],o=Math.round(a*.3),s=Math.round(a*.35),c=Math.max(8,Math.round(a*.28)),l=(0,L.useMemo)(()=>e.slice(0,t),[e,t]),u=Math.max(0,e.length-t),d={display:`inline-flex`,alignItems:`center`,flexDirection:`row-reverse`,fontFamily:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`},f={width:`${a}px`,height:`${a}px`,borderRadius:`50%`,border:`2px solid #fff`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`${s}px`,fontWeight:600,color:`#fff`,position:`relative`,flexShrink:0,overflow:`hidden`,boxSizing:`border-box`},p={...f,backgroundColor:`#e2e8f0`,color:`#475569`,marginLeft:`-${o}px`},m={position:`absolute`,bottom:`-1px`,right:`-1px`,width:`${c}px`,height:`${c}px`,borderRadius:`50%`,border:`2px solid #fff`,boxSizing:`border-box`},h=(0,L.useMemo)(()=>[...l].reverse(),[l]);return L.createElement(`div`,{style:d,className:i,role:`group`,"aria-label":`${e.length} user${e.length===1?``:`s`} present`},u>0&&L.createElement(`div`,{key:`overflow`,style:p,title:`${u} more user${u===1?``:`s`}`},`+${u}`),h.map((e,t)=>L.createElement(`div`,{key:e.userId,style:{...f,backgroundColor:e.color,marginLeft:t>0||u>0?`-${o}px`:`0`},title:`${e.userName} (${e.status})`},e.avatar?L.createElement(`img`,{src:e.avatar,alt:e.userName,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):X(e.userName),r&&L.createElement(`span`,{style:{...m,backgroundColor:Y[e.status]}}))))}function Q({state:e,onOpenChange:t}){let n=()=>{e.resolve?.(!0),t(!1)},r=()=>{e.resolve?.(!1),t(!1)};return(0,R.jsx)(F,{open:e.open,onOpenChange:e=>{e||r()},children:(0,R.jsxs)(j,{children:[(0,R.jsxs)(O,{children:[(0,R.jsx)(x,{children:e.options?.title||`Confirm Action`}),(0,R.jsx)(A,{children:e.message})]}),(0,R.jsxs)(k,{children:[(0,R.jsx)(E,{onClick:r,children:e.options?.cancelText||`Cancel`}),(0,R.jsx)(w,{onClick:n,children:e.options?.confirmText||`Continue`})]})]})})}function ce({state:e,onOpenChange:t}){let[n,r]=(0,L.useState)({}),[i,a]=(0,L.useState)({});(0,L.useEffect)(()=>{if(e.open){let t={};for(let n of e.params)n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);r(t),a({})}},[e.open,e.params]);let o=e=>e==null?!0:typeof e==`string`?e.trim()===``:Array.isArray(e)?e.length===0:!1,s=()=>{let r={};for(let t of e.params)t.required&&o(n[t.name])&&(r[t.name]=!0);if(Object.keys(r).length>0){a(r);return}e.resolve?.(n),t(!1)},c=()=>{e.resolve?.(null),t(!1)},l=(e,t)=>{r(n=>({...n,[e]:t})),a(t=>({...t,[e]:!1}))};return(0,R.jsx)(h,{open:e.open,onOpenChange:e=>{e||c()},children:(0,R.jsxs)(v,{children:[(0,R.jsxs)(g,{children:[(0,R.jsx)(M,{children:`Action Parameters`}),(0,R.jsx)(y,{children:`Please provide the required information to continue.`})]}),(0,R.jsx)(`div`,{className:`grid gap-4 py-4`,children:e.params.map(e=>(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsxs)(C,{htmlFor:e.name,children:[e.label,e.required&&(0,R.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),e.type===`select`&&e.options?(0,R.jsxs)(b,{value:n[e.name]??``,onValueChange:t=>l(e.name,t),children:[(0,R.jsx)(T,{id:e.name,className:i[e.name]?`border-destructive`:``,children:(0,R.jsx)(N,{placeholder:e.placeholder||`Select ${e.label}`})}),(0,R.jsx)(_,{children:e.options.map(e=>(0,R.jsx)(f,{value:e.value,children:e.label},e.value))})]}):e.type===`textarea`?(0,R.jsx)(D,{id:e.name,value:n[e.name]??``,onChange:t=>l(e.name,t.target.value),placeholder:e.placeholder,className:i[e.name]?`border-destructive`:``}):e.type===`number`?(0,R.jsx)(P,{id:e.name,type:`number`,value:n[e.name]??``,onChange:t=>l(e.name,t.target.value===``?void 0:t.target.valueAsNumber),placeholder:e.placeholder,className:i[e.name]?`border-destructive`:``}):(0,R.jsx)(P,{id:e.name,type:[`email`,`url`,`date`,`datetime-local`,`time`,`password`].includes(e.type)?e.type:`text`,value:n[e.name]??``,onChange:t=>l(e.name,t.target.value),placeholder:e.placeholder,className:i[e.name]?`border-destructive`:``}),i[e.name]&&(0,R.jsxs)(`p`,{className:`text-xs text-destructive`,children:[e.label,` is required`]}),e.helpText&&(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.helpText})]},e.name))}),(0,R.jsxs)(m,{children:[(0,R.jsx)(I,{variant:`outline`,onClick:c,children:`Cancel`}),(0,R.jsx)(I,{onClick:s,children:`Confirm`})]})]})})}var le=e({RecordDetailView:()=>$}),ue={id:`current-user`,name:`Demo User`};function $({dataSource:e,objects:t,onEdit:n}){let{objectName:i,recordId:f}=r(),{showDebug:m}=oe(),{user:h}=c(),g=a(),{t:_}=o(),[v,y]=(0,L.useState)(!0),[b,x]=(0,L.useState)([]),[C,w]=(0,L.useState)([]),[T,E]=(0,L.useState)(0),[D,O]=(0,L.useState)({}),[k,A]=(0,L.useState)(),j=t.find(e=>e.name===i);se(k);let M=f,[N,P]=(0,L.useState)({open:!1,message:``}),[F,I]=(0,L.useState)({open:!1,params:[]}),z=(0,L.useCallback)((e,t)=>new Promise(n=>{P({open:!0,message:e,options:t,resolve:n})}),[]),B=(0,L.useCallback)(e=>new Promise(t=>{I({open:!0,params:e,resolve:t})}),[]),V=(0,L.useCallback)((e,t)=>{t?.type===`error`?u.error(e):u.success(e)},[]),H=(0,L.useCallback)((e,t)=>{t?.external||t?.newTab?window.open(e,`_blank`,`noopener,noreferrer`):g(e)},[g]),U=(0,L.useCallback)(async t=>{try{let n=t.target||t.name,r=t.params||{};switch(n){case`opportunity_change_stage`:await e.update(i,M,{stage:r.new_stage});break;case`opportunity_mark_won`:await e.update(i,M,{stage:`closed_won`});break;case`opportunity_mark_lost`:await e.update(i,M,{stage:`closed_lost`,loss_reason:r.loss_reason});break;default:Object.keys(r).length>0&&await e.update(i,M,r);break}let a=t.refreshAfter===!0;return a&&E(e=>e+1),{success:!0,reload:a}}catch(e){return{success:!1,error:e.message}}},[e,i,M]),W=(0,L.useMemo)(()=>l(),[]),G=(0,L.useCallback)(async e=>{let t=e.target||e.name;if(!t)return{success:!1,error:`No flow target provided for flow action`};try{let n=await W(`https://demo.objectstack.ai/api/v1/automation/${encodeURIComponent(t)}/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:M,objectName:i,params:e.params??{}})}),r=await n.json().catch(()=>null);if(!n.ok||r&&r.success===!1)return{success:!1,error:r?.error||`Flow "${t}" failed (HTTP ${n.status})`};let a=e.refreshAfter!==!1;return a&&E(e=>e+1),{success:!0,data:r?.data,reload:a}}catch(e){return{success:!1,error:e.message}}},[W,M,i]),K=(0,L.useCallback)(async e=>{let t=e.target||e.name;if(!t)return{success:!1,error:`No action target provided`};let n=e.params&&!Array.isArray(e.params)?e.params:{};try{let r=e.objectName||i||`global`,a=await W(`https://demo.objectstack.ai/api/v1/actions/${encodeURIComponent(r)}/${encodeURIComponent(t)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:M,params:n})}),o=await a.json().catch(()=>null);if(!a.ok||o&&o.success===!1)return{success:!1,error:o?.error||`Action "${t}" failed (HTTP ${a.status})`};let s=e.refreshAfter!==!1;return s&&E(e=>e+1),{success:!0,data:o?.data,reload:s}}catch(e){return{success:!1,error:e.message}}},[W,M,i]),q=(0,L.useMemo)(()=>{if(!j||!t)return[];let e=[];for(let n of t)if(n.name!==j.name)for(let[t,r]of Object.entries(n.fields||{}))r&&(r.type===`lookup`||r.type===`master_detail`)&&(r.reference_to||r.reference)===j.name&&e.push({childObject:n.name,childLabel:n.label||n.name,referenceField:t});return e},[j,t]);(0,L.useEffect)(()=>{if(!e||!M||q.length===0)return;let t=!1;return Promise.all(q.map(({childObject:t,referenceField:n})=>e.find(t,{$filter:{[n]:M}}).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;O(n)}),()=>{t=!0}},[e,M,q]);let J=h?{id:h.id,name:h.name,avatar:h.image}:ue;(0,L.useEffect)(()=>{if(!e||!i||!M)return;let t=`${i}:${M}`;e.find(`sys_presence`,{$filter:{recordId:M}}).then(e=>{e.data?.length&&w(e.data)}).catch(()=>{}),e.find(`sys_comment`,{$filter:{threadId:t},$orderby:{createdAt:`asc`}}).then(e=>{e.data?.length&&x(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(J.id)})):void 0})))}).catch(()=>{})},[e,i,M,J]);let Y=(0,L.useCallback)(async t=>{let n={id:crypto.randomUUID(),type:`comment`,actor:J.name,actorAvatarUrl:`avatar`in J?J.avatar:void 0,body:t,createdAt:new Date().toISOString()};if(x(e=>[...e,n]),e){let r=`${i}:${M}`;e.create(`sys_comment`,{id:n.id,threadId:r,author:J,content:t,mentions:[],createdAt:n.createdAt}).catch(()=>{})}},[J,e,i,M]),X=(0,L.useCallback)(async(t,n)=>{let r={id:crypto.randomUUID(),type:`comment`,actor:J.name,actorAvatarUrl:`avatar`in J?J.avatar:void 0,body:n,createdAt:new Date().toISOString(),parentId:t};if(x(e=>[...e,r].map(e=>e.id===t?{...e,replyCount:(e.replyCount??0)+1}:e)),e){let a=`${i}:${M}`;e.create(`sys_comment`,{id:r.id,threadId:a,author:J,content:n,mentions:[],createdAt:r.createdAt,parentId:t}).catch(()=>{})}},[J,e,i,M]),le=(0,L.useCallback)((t,n)=>{x(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:J.id}}).catch(()=>{}),o}))},[J.id,e]);(0,L.useEffect)(()=>{y(!0),queueMicrotask(()=>y(!1))},[i,f]);let $=(0,L.useMemo)(()=>{if(!j)return{type:`detail-view`};let e=j.primaryField||Object.keys(j.fields||{}).find(e=>e===`name`||e===`title`),n=j.views?.form?.sections,r=n&&n.length>0?n.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=j.fields[t];if(!n)return console.warn(`[RecordDetailView] Field "${t}" not found in ${j.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}}})})):[{showBorder:!1,fields:Object.keys(j.fields||{}).map(e=>{let t=j.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}}})}],i=(()=>{let e=new Set;return(j.actions||[]).filter(t=>t.locations?.includes(`record_header`)?t.name?e.has(t.name)?!1:(e.add(t.name),!0):!0:!1)})(),a=j.views?.detail?.highlightFields??[],o=j.views?.detail?.sectionGroups??j.views?.form?.sectionGroups,s=q.map(({childObject:e,childLabel:n,referenceField:r})=>{let i=t.find(t=>t.name===e);return{title:n,type:`table`,api:e,data:D[e]||[],referenceField:r,icon:i?.icon}});return{type:`detail-view`,objectName:j.name,resourceId:M,showBack:!0,onBack:`history`,showEdit:!0,title:j.label,primaryField:e,sections:r,autoTabs:!0,autoDiscoverRelated:!0,...s.length>0&&{related:s},...a.length>0&&{highlightFields:a},...o&&o.length>0&&{sectionGroups:o},...i.length>0&&{actions:[{type:`action:bar`,location:`record_header`,actions:i}]}}},[j?.name,M,D,T]);return v?(0,R.jsx)(ie,{}):j?(0,R.jsxs)(`div`,{className:`h-full bg-background overflow-hidden flex flex-col relative`,children:[(0,R.jsx)(`div`,{className:`absolute top-2 sm:top-4 right-2 sm:right-4 z-50 flex items-center gap-2`,children:C.length>0&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,title:`Users viewing this record`,children:[(0,R.jsx)(d,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,R.jsx)(Z,{users:C,size:`sm`,maxVisible:4,showStatus:!0})]})}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-row`,children:[(0,R.jsx)(`div`,{className:`flex-1 overflow-auto p-3 sm:p-4 lg:p-6 scroll-pb-48`,children:(0,R.jsx)(s,{context:{record:{},objectName:i,user:J},onConfirm:z,onToast:V,onNavigate:H,onParamCollection:B,handlers:{api:U,flow:G,script:K,modal:K},children:(0,R.jsx)(re,{schema:$,dataSource:e,objectLabel:j.label,onDataLoaded:e=>{if(!e||typeof e!=`object`)return;let t=$.primaryField,n=[t&&e[t],e.name,e.title,e.label,e.subject].find(e=>typeof e==`string`&&e.trim().length>0);n&&n!==k&&A(n)},onEdit:()=>{n({id:M})},discussionSlot:(0,R.jsx)(ne,{config:{position:`bottom`,collapsible:!1,feed:{enableReactions:!0,enableThreading:!0,showCommentInput:!0}},items:b,onAddComment:Y,onAddReply:X,onToggleReaction:le})},T)})}),(0,R.jsx)(ae,{open:m,sections:[{title:`View Schema`,data:$}]})]}),(0,R.jsx)(Q,{state:N,onOpenChange:e=>{e||P(e=>({...e,open:!1}))}}),(0,R.jsx)(ce,{state:F,onOpenChange:e=>{e||I(e=>({...e,open:!1}))}})]}):(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center p-4`,children:(0,R.jsxs)(te,{children:[(0,R.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,R.jsx)(p,{className:`h-6 w-6 text-muted-foreground`})}),(0,R.jsx)(S,{children:`Object Not Found`}),(0,R.jsxs)(ee,{children:[`Object "`,i,`" definition missing. Check your configuration or navigate back to select a valid object.`]})]})})}export{q as a,V as c,Z as i,ce as n,H as o,Q as r,B as s,le as t};
|