react-semaphor 0.1.295 → 0.1.297
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/chunks/{braces-DWldEFn5.js → braces-BT-cB4J_.js} +1 -1
- package/dist/chunks/{braces-BdoTYzuj.js → braces-CSunPeAg.js} +1 -1
- package/dist/chunks/dashboard-controls-C6254Ugx.js +2219 -0
- package/dist/chunks/dashboard-controls-Za3WPtTh.js +47 -0
- package/dist/chunks/{dashboard-filter-controls-button-XwenlcXw.js → dashboard-filter-controls-button-DZnR5IgP.js} +487 -513
- package/dist/chunks/dashboard-filter-controls-button-dYWccDmw.js +11 -0
- package/dist/chunks/{dashboard-json-CU55qPXj.js → dashboard-json-CuI5gkwY.js} +1 -1
- package/dist/chunks/{dashboard-json-V6m6lJ_c.js → dashboard-json-DjpkfbSZ.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-DRLPzp1P.js → dashboard-summary-settings-dialog-C6FUhXQy.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-0CIiWsKc.js → dashboard-summary-settings-dialog-vC2shhM-.js} +1 -1
- package/dist/chunks/edit-dashboard-visual-CoG-tE_T.js +188 -0
- package/dist/chunks/{edit-dashboard-visual-8ha6EM_g.js → edit-dashboard-visual-TBI9_Pyh.js} +6351 -6452
- package/dist/chunks/index--CoasbAE.js +1523 -0
- package/dist/chunks/{index-14M0TnH6.js → index-D0iNspb-.js} +102960 -87712
- package/dist/chunks/{resource-management-panel-CcDAn86l.js → resource-management-panel-Cf4FTR33.js} +2 -2
- package/dist/chunks/{resource-management-panel-BL5-5ouC.js → resource-management-panel-HOWOJUap.js} +31 -30
- package/dist/chunks/{use-create-flow-overlay-state-D3PxfjYv.js → use-create-flow-overlay-state-B7bE6z5B.js} +572 -568
- package/dist/chunks/use-create-flow-overlay-state-BqiJrgeK.js +21 -0
- package/dist/chunks/use-visual-utils-DP6ty2_T.js +1 -0
- package/dist/chunks/{use-visual-utils-CdIOq4nt.js → use-visual-utils-DyvrB6Zh.js} +70 -68
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +113 -112
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +245 -1
- package/dist/types/main.d.ts +317 -12
- package/dist/types/shared.d.ts +214 -1
- package/dist/types/surfboard.d.ts +245 -1
- package/dist/types/types.d.ts +245 -1
- package/package.json +7 -1
- package/dist/chunks/dashboard-controls-B3lrnI_r.js +0 -47
- package/dist/chunks/dashboard-controls-D7U6E1sB.js +0 -2014
- package/dist/chunks/dashboard-filter-controls-button-D0AsV28-.js +0 -11
- package/dist/chunks/edit-dashboard-visual-sSLAkmgf.js +0 -183
- package/dist/chunks/index-Ze8VskG1.js +0 -1435
- package/dist/chunks/use-create-flow-overlay-state-BbQVNDCj.js +0 -21
- package/dist/chunks/use-visual-utils-kh8p2QFm.js +0 -1
package/dist/chunks/{resource-management-panel-CcDAn86l.js → resource-management-panel-Cf4FTR33.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index--CoasbAE.js"),h=require("react"),ne=require("./use-visual-utils-DP6ty2_T.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ae=t.createLucideIcon("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);function ie(s,m={}){const{enabled:p=!0,eventType:l="mousedown"}=m,i=h.useRef(null);return h.useEffect(()=>{const x=w=>{const r=w.target;i.current&&i.current.contains(r)||r instanceof Element&&(r.closest("[data-radix-popper-content-wrapper]")||r.closest("[data-radix-select-content]")||r.closest("[data-radix-popover-content]")||r.closest("[data-radix-dropdown-menu-content]")||r.closest("[data-radix-tooltip-content]")||r.closest('[role="listbox"]')||r.closest('[role="option"]')||r.closest('[role="combobox"]'))||r instanceof Element&&r.hasAttribute("data-radix-")||s()};return p&&document.addEventListener(l,x),()=>{document.removeEventListener(l,x)}},[s,p,l]),i}function oe(){return e.jsx("div",{className:"space-y-1.5 py-1",children:[...Array(5)].map((s,m)=>e.jsxs("div",{className:"flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",children:[e.jsx("div",{className:"mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"h-4 w-3/5 rounded bg-muted/60"}),e.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40"})]})]},m))})}const le=s=>{const m=t.useDashboardStore(i=>i.isVisualEditing),p=t.useDashboardStore(i=>i.selectedFrameId),l=t.useEditorStore(i=>i.frame);return!!(m&&p&&(l==null?void 0:l.visualId)===s)};function de({visual:s,isDeleting:m,isDuplicating:p,onAddVisual:l,onOpenVisual:i,onEditDetails:x,onDeleteClick:w,onDuplicateVisual:r,onShareVisual:N,formatDate:b}){var O,T,U,P;const{selectVisual:f}=t.useManagementActions(),d=t.useIsVisualSelected(s.id),u=le(s.id),A=t.useDashboardStore(a=>a.isVisualEditing),{isConsoleMode:R}=t.useDashboardPreferences(),j=h.useRef(null),[S,v]=h.useState(!1),[E,L]=h.useState(!1);h.useEffect(()=>{p?(v(!0),L(!0)):E&&(v(!1),L(!1))},[p,E]),h.useEffect(()=>{u&&j.current&&j.current.scrollIntoView({behavior:"smooth",block:"center"})},[u]);const C=()=>{f(s),i==null||i(s)},y=a=>{a.currentTarget===a.target&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),C())};return e.jsxs("div",{ref:j,className:t.cn("group flex cursor-pointer items-start gap-1 rounded-[5px] px-2 py-1.5 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",u?"bg-muted ring-1 ring-inset ring-foreground/20":d&&"bg-muted"),onClick:C,children:[e.jsxs("div",{role:"button",tabIndex:0,className:"min-w-0 flex-1 cursor-pointer focus-visible:outline-none",onKeyDown:y,children:[e.jsx("p",{className:"truncate text-[13px] font-medium leading-5 text-foreground",title:s.title||"Untitled Visual",children:s.title||"Untitled Visual"}),e.jsx("p",{className:"truncate text-[11px] leading-4 text-muted-foreground",title:s.description||"No description",children:(O=s.description)!=null&&O.trim()?s.description:"No description"})]}),e.jsx("div",{className:t.cn("flex shrink-0 items-center transition-opacity",d||u||S?"pointer-events-auto opacity-100":"pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100"),onClick:a=>a.stopPropagation(),children:e.jsxs("div",{className:"inline-flex h-7 items-stretch overflow-hidden rounded-[5px] border border-border/60 bg-background",children:[e.jsxs(t.Button,{size:"xs",variant:"ghost",className:"h-full rounded-none border-0 shadow-none hover:bg-accent/50",disabled:A,onClick:a=>{a.stopPropagation(),l(s)},"aria-label":`Add ${s.title||"visual"}`,children:[e.jsx(t.Plus,{className:"h-3.5 w-3.5"}),"Add"]}),e.jsxs(t.DropdownMenu,{modal:!1,open:S,onOpenChange:v,children:[e.jsx(t.DropdownMenuTrigger,{asChild:!0,children:e.jsx(t.Button,{size:"xs",variant:"ghost",className:"h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent/50","aria-label":"Open visual actions",children:e.jsx(t.EllipsisVertical,{className:"h-3.5 w-3.5"})})}),e.jsxs(t.DropdownMenuContent,{align:"end",className:"z-[51] w-44 rounded-[6px] border border-border/60 p-1 shadow-sm",children:[e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),l(s)},disabled:A,children:[e.jsx(t.Plus,{className:"h-3.5 w-3.5"}),"Add"]}),e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),i==null||i(s)},children:[e.jsx(ae,{className:"h-3.5 w-3.5"}),"Open"]}),e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.preventDefault(),a.stopPropagation(),r(s.id)},disabled:p,children:[p?e.jsx(t.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(t.Copy,{className:"h-3.5 w-3.5"}),p?"Duplicating…":"Duplicate"]}),s.ownership.isOwner&&e.jsxs(e.Fragment,{children:[e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),x==null||x(s)},children:[e.jsx(t.PenLine,{className:"h-3.5 w-3.5"}),"Edit details"]}),e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),N(s)},children:[e.jsx(t.Users,{className:"h-3.5 w-3.5"}),"Share"]}),e.jsx(t.DropdownMenuSeparator,{}),e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),w(s)},className:"text-destructive focus:bg-destructive/10 focus:text-destructive",disabled:m,children:[e.jsx(t.Trash2,{className:"h-3.5 w-3.5"}),m?"Deleting…":"Delete"]})]}),e.jsx(t.DropdownMenuSeparator,{}),e.jsxs("div",{className:"space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground",children:[(((T=s.ownership.createdBy)==null?void 0:T.type)==="tenant"||((U=s.ownership.createdBy)==null?void 0:U.type)==="organization"&&R)&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(t.User,{className:"h-3 w-3"}),e.jsx("span",{children:((P=s.ownership.createdBy)==null?void 0:P.name)||"Unknown"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(t.Calendar,{className:"h-3 w-3"}),e.jsx("span",{children:b(s.lastModified)})]})]})]})]})]})})]})}function ce({searchQuery:s}){const[m,p]=h.useState(!1),[l,i]=h.useState(null),[x,w]=h.useState(!1),[r,N]=h.useState(null),[b,f]=h.useState(null),[d,u]=h.useState(null),{handleEditLibraryVisual:A,handleAddLibraryVisual:R}=ne.useVisualUtils(),{resources:j,isLoading:S,isError:v,updateResource:E,deleteResource:L,duplicateResource:C,isDeleting:y}=t.useVisualManagement(()=>{w(!1),N(null)}),O=j.filter(o=>{var M,c;return((M=o==null?void 0:o.title)==null?void 0:M.toLowerCase().includes(s.toLowerCase()))||((c=o==null?void 0:o.description)==null?void 0:c.toLowerCase().includes(s.toLowerCase()))}),T=o=>new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),U=o=>{N(o),w(!0)},P=()=>{r&&L(r.id)},{startUpdating:a,stopUpdating:_,isUpdating:F}=t.useResourceUpdateState(),V=(o,M,c)=>{var Q;const B=Object.fromEntries(Object.entries(M).filter(([,I])=>I!==void 0));if(Object.keys(B).length===0){(Q=c==null?void 0:c.onSuccess)==null||Q.call(c);return}const D=Object.keys(B),H=D.length===1?D[0]:void 0;a(o,H),E({resourceId:o,data:B},{onSuccess:()=>{var I;_(o,H),(I=c==null?void 0:c.onSuccess)==null||I.call(c)},onError:()=>{var I;_(o,H),(I=c==null?void 0:c.onError)==null||I.call(c)}})},G=o=>{f(o),C(o,{onSettled:()=>f(null)})},z=o=>{A(o)},W=o=>{R(o)},X=o=>{i(o),p(!0)},Y=o=>{u(o)},$=()=>{u(null)},J=({title:o,description:M})=>{if(!d)return;const c={};o!==d.title&&(c.title=o),(d.description||"")!==M&&(c.description=M),V(d.id,c,{onSuccess:()=>{u(null)}})};return S?e.jsx(oe,{}):v?e.jsx(t.ScrollArea,{className:"w-full flex-1 pr-2",children:e.jsxs("div",{className:"flex flex-col items-center gap-1.5 px-4 py-10 text-center",children:[e.jsx("p",{className:"text-[12px] text-destructive",children:"Failed to load visuals"}),e.jsx(t.Button,{variant:"outline",size:"xs",onClick:()=>window.location.reload(),children:"Retry"})]})}):e.jsxs("div",{className:"flex h-full flex-1 flex-col",children:[e.jsx("div",{className:"flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto",children:O.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-1.5 px-4 py-10 text-center",children:[e.jsx(t.Grid3x3,{className:"h-5 w-5 text-muted-foreground/60"}),e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:s?"No visuals found":"No visuals yet"}),e.jsx("p",{className:"text-[12px] text-muted-foreground",children:s?"Try adjusting your search.":'Click "New" above to add your first visual.'})]}):O.map(o=>e.jsx(de,{visual:o,onAddVisual:W,onOpenVisual:z,onEditDetails:Y,onDeleteClick:U,onDuplicateVisual:G,onShareVisual:X,isDeleting:y,isDuplicating:b===o.id,formatDate:T},o.id))}),m&&l&&e.jsx(t.ShareDialog,{resource:l,resourceType:t.ResourceType.VISUAL,onClose:()=>{p(!1),i(null)}}),d&&e.jsx(t.ResourceEditDialog,{open:!!d,resourceLabel:"Visual",initialTitle:d.title||"",initialDescription:d.description||"",onClose:$,onSave:J,isSaving:F(d.id)}),e.jsx(t.AlertDialog,{open:x,onOpenChange:o=>{!o&&y||(w(o),o||N(null))},children:e.jsxs(t.AlertDialogContent,{children:[e.jsxs(t.AlertDialogHeader,{children:[e.jsx(t.AlertDialogTitle,{children:"Delete Visual"}),e.jsxs(t.AlertDialogDescription,{children:['Are you sure you want to delete "',r==null?void 0:r.title,'"? This action cannot be undone.']})]}),e.jsxs(t.AlertDialogFooter,{children:[e.jsx(t.AlertDialogCancel,{disabled:y,children:"Cancel"}),e.jsxs(t.AlertDialogAction,{onClick:o=>{o.preventDefault(),o.stopPropagation(),P()},disabled:y,children:[y?e.jsx(t.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(t.Trash2,{className:"h-3.5 w-3.5"}),y?"Deleting…":"Delete"]})]})]})})]})}function ue({dashboard:s,isDeleting:m,isDuplicating:p,onLoadDashboard:l,onEditDetails:i,onDeleteClick:x,onDuplicateDashboard:w,onShareDashboard:r,formatDate:N,onDashboardItemClick:b}){var E,L;const{selectDashboard:f}=t.useManagementActions(),d=t.useIsDashboardSelected(s.id),{userContext:u,isLoading:A}=t.useCurrentUserInfo(),R=((E=u==null?void 0:u.permissions)==null?void 0:E.canEdit)??!1,j=A||!R,S=()=>{f(s),l(s.id),b==null||b(s.id)},v=C=>{C.currentTarget===C.target&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),S())};return e.jsxs("div",{className:t.cn("group flex cursor-pointer items-start gap-1 rounded-[5px] px-2 py-1.5 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",d&&"bg-muted"),onClick:S,children:[e.jsxs("div",{role:"button",tabIndex:0,className:"min-w-0 flex-1 cursor-pointer focus-visible:outline-none",onKeyDown:v,children:[e.jsx("p",{className:"truncate text-[13px] font-medium leading-5 text-foreground",title:s.title||"Untitled Dashboard",children:s.title||"Untitled Dashboard"}),e.jsx("p",{className:"truncate text-[11px] leading-4 text-muted-foreground",title:s.description||"No description",children:(L=s.description)!=null&&L.trim()?s.description:"No description"})]}),e.jsx("div",{className:t.cn("shrink-0 transition-opacity",d?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),children:e.jsx(t.DashboardActionsMenu,{dashboard:s,isDeleting:m,isDuplicating:p,shouldHideActions:j,onEditDetails:i,onDeleteClick:x,onDuplicateDashboard:w,onShareDashboard:r,formatDate:N})})]})}function he({onRetry:s}){return e.jsx(t.ScrollArea,{className:"w-full flex-1 pr-2",children:e.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 bg-muted/20 px-4 py-8 text-center text-muted-foreground",children:[e.jsx("p",{className:"text-sm text-destructive",children:"Failed to load dashboards"}),e.jsx(t.Button,{variant:"outline",size:"sm",className:"mt-2",onClick:s,children:"Retry"})]})})}function xe(s){var ee;const{searchQuery:m,onLoadDashboard:p,onEditDashboard:l,onDashboardItemClick:i}=s,[x,w]=h.useState(!1),[r,N]=h.useState(null),[b,f]=h.useState(!1),[d,u]=h.useState(null),[A,R]=h.useState(null),[j,S]=h.useState(null),v=t.useManagementStore(n=>n.lastSelectedDashboard),E=t.useManagementStore(n=>n.selectedDashboard),L=t.useManagementStore(n=>n.actions.selectDashboard),C=t.useManagementStore(n=>n.actions.clearSelectedDashboard),{tokenProps:y,id:O}=t.useSemaphorContext(),{resources:T,isLoading:U,isError:P,updateResource:a,deleteResource:_,duplicateResource:F,isDeleting:V}=t.useDashboardManagement(()=>{f(!1);const n=d==null?void 0:d.id;u(null),(E==null?void 0:E.id)===n&&(!(y!=null&&y.dashboard_id)&&!O?C():v&&v.id!==n&&L(v))}),{userContext:G}=t.useCurrentUserInfo(),z=((ee=G==null?void 0:G.permissions)==null?void 0:ee.canCreateDashboard)??!1,W=T.filter(n=>{var K,g;return((K=n==null?void 0:n.title)==null?void 0:K.toLowerCase().includes(m.toLowerCase()))||((g=n==null?void 0:n.description)==null?void 0:g.toLowerCase().includes(m.toLowerCase()))}),X=n=>new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Y=n=>{p==null||p(n)},$=n=>{u(n),f(!0)},J=()=>{d&&_(d.id)},o=n=>{R(n),F(n,{onSettled:()=>R(null)})},{startUpdating:M,stopUpdating:c,isUpdating:B}=t.useResourceUpdateState(),D=(n,K,g)=>{var se;const Z=Object.fromEntries(Object.entries(K).filter(([,q])=>q!==void 0));if(Object.keys(Z).length===0){(se=g==null?void 0:g.onSuccess)==null||se.call(g);return}const te=Object.keys(Z),k=te.length===1?te[0]:void 0;M(n,k),a({resourceId:n,data:Z},{onSuccess:()=>{var q;c(n,k),(q=g==null?void 0:g.onSuccess)==null||q.call(g)},onError:()=>{var q;c(n,k),(q=g==null?void 0:g.onError)==null||q.call(g)}})},H=n=>{N(n),w(!0)},Q=n=>{l==null||l(n.id),S(n)},I=()=>{S(null)},re=({title:n,description:K})=>{if(!j)return;const g={};n!==j.title&&(g.title=n),(j.description||"")!==K&&(g.description=K),D(j.id,g,{onSuccess:()=>{S(null)}})};return U?e.jsx(oe,{}):P?e.jsx(he,{onRetry:()=>window.location.reload()}):e.jsxs("div",{className:"flex h-full flex-1 flex-col",children:[e.jsx("div",{className:"flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto",children:W.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-1.5 px-4 py-10 text-center",children:[e.jsx(t.ChartColumn,{className:"h-5 w-5 text-muted-foreground/60"}),e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:m?"No dashboards found":"No dashboards yet"}),e.jsx("p",{className:"text-[12px] text-muted-foreground",children:m?"Try adjusting your search.":z?'Click "New" above to add your first dashboard.':"No dashboards have been shared with you yet."})]}):W.map(n=>e.jsx(ue,{dashboard:n,isDeleting:V,isDuplicating:A===n.id,onLoadDashboard:Y,onEditDetails:Q,onDeleteClick:$,onDuplicateDashboard:o,onShareDashboard:H,formatDate:X,onDashboardItemClick:i},n.id))}),x&&r&&e.jsx(t.ShareDialog,{resource:r,resourceType:t.ResourceType.DASHBOARD,onClose:()=>{w(!1),N(null)}}),e.jsx(t.AlertDialog,{open:b,onOpenChange:n=>{!n&&V||(f(n),n||u(null))},children:e.jsxs(t.AlertDialogContent,{children:[e.jsxs(t.AlertDialogHeader,{children:[e.jsx(t.AlertDialogTitle,{children:"Delete Dashboard"}),e.jsxs(t.AlertDialogDescription,{children:['Are you sure you want to delete "',d==null?void 0:d.title,'"? This action cannot be undone.']})]}),e.jsxs(t.AlertDialogFooter,{children:[e.jsx(t.AlertDialogCancel,{disabled:V,children:"Cancel"}),e.jsxs(t.AlertDialogAction,{onClick:n=>{n.preventDefault(),n.stopPropagation(),J()},disabled:V,children:[V?e.jsx(t.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(t.Trash2,{className:"h-3.5 w-3.5"}),V?"Deleting…":"Delete"]})]})]})}),j&&e.jsx(t.ResourceEditDialog,{open:!!j,resourceLabel:"Dashboard",initialTitle:j.title||"",initialDescription:j.description||"",onClose:I,onSave:re,isSaving:B(j.id)})]})}function pe({open:s,onOpenChange:m,onSubmit:p,isCreating:l}){const[i,x]=h.useState(""),[w,r]=h.useState("");h.useEffect(()=>{s||(x(""),r(""))},[s]);const N=()=>{i.trim()&&p({title:i,description:w})},b=f=>{m(f)};return e.jsx(t.Dialog,{open:s,onOpenChange:b,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:"Create New Visual"}),e.jsx(t.DialogDescription,{children:"Add a new visual to your library. You can configure it after creation."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t.Label,{htmlFor:"title",children:"Visual Title"}),e.jsx(t.Input,{id:"title",placeholder:"Enter visual title...",value:i,onChange:f=>x(f.target.value),disabled:l,onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),N())}})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t.Label,{htmlFor:"description",children:"Description (optional)"}),e.jsx(t.Input,{id:"description",placeholder:"Enter visual description...",value:w,onChange:f=>r(f.target.value),disabled:l})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(t.Button,{variant:"outline",onClick:()=>b(!1),disabled:l,children:"Cancel"}),e.jsx(t.Button,{onClick:N,disabled:!i.trim()||l,children:l?e.jsxs(e.Fragment,{children:[e.jsx(t.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Visual"})]})]})})}function me({isOpen:s,onClose:m,className:p,onDashboardItemClick:l,variant:i="inline"}){var c,B;const x=t.useDashboardStore(D=>D.isDashboardEditing),[w,r]=h.useState(!1),[N,b]=h.useState(""),[f,d]=h.useState(!1),{currentUser:u,userContext:A}=t.useCurrentUserInfo(),R=((c=A==null?void 0:A.permissions)==null?void 0:c.canCreateDashboard)??!1,{onCreateSuccess:j}=t.useDashboardCreation({onDashboardSelect:l}),{selectVisual:S}=t.useManagementActions(),{handleEditLibraryVisual:v}=ne.useVisualUtils(),{createResource:E,isCreating:L,refetch:C}=t.useDashboardManagement(),{createResource:y,isCreating:O}=t.useVisualManagement(void 0,D=>{r(!1),D&&(S(D),v(D))}),T=i==="overlay",U=x?"New Visual":"New",P=x?"New Visual":"New Dashboard",a=x?"Search visuals...":"Search dashboards...",_=x?"Collapse visuals panel":"Collapse dashboard panel",F=((u==null?void 0:u.name)??"").trim(),V=((u==null?void 0:u.email)??"").trim(),z=F&&F.toLowerCase()!=="undefined"?F:V||"Current user",W=((B=z.charAt(0))==null?void 0:B.toUpperCase())||"?",X=V&&V.toLowerCase()!=="undefined"?V:"",Y=ie(m,{enabled:s&&T}),$=t.cn("flex h-full flex-col border-r border-border/60 bg-background",T?t.cn("absolute inset-y-0 left-0 z-[51] w-60 overflow-hidden shadow-lg transition-transform duration-300 ease-in-out",s?"translate-x-0":"pointer-events-none -translate-x-full"):"w-full max-w-[17rem] min-w-[11rem] overflow-hidden",p),J=D=>{},o=D=>{console.log("Editing dashboard:",D)},M=D=>{E(D,{onSuccess:H=>{r(!1),j(H,C)}})};return e.jsx(e.Fragment,{children:(!T||s)&&e.jsxs("div",{ref:Y,className:$,children:[e.jsx("div",{className:"border-b border-border/60 bg-background",children:f?e.jsxs("div",{className:"flex h-11 items-center gap-1 px-3",children:[e.jsx(t.Search,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("input",{autoFocus:!0,value:N,onChange:D=>b(D.target.value),onKeyDown:D=>{D.key==="Escape"&&(b(""),d(!1))},placeholder:a,className:"h-7 min-w-0 flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground focus:outline-none","aria-label":a}),e.jsx(t.Button,{size:"xs",variant:"ghost",className:"w-7 shrink-0 px-0 text-muted-foreground hover:text-foreground",onClick:()=>{b(""),d(!1)},"aria-label":"Close search",children:e.jsx(t.X,{className:"h-3.5 w-3.5"})})]}):e.jsxs("div",{className:"flex h-11 items-center justify-between gap-2 px-3",children:[e.jsx("h2",{className:"whitespace-nowrap text-[13px] font-medium text-foreground",children:x?"Visuals":"Dashboards"}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(t.Button,{size:"xs",variant:"ghost",onClick:()=>d(!0),className:"w-7 px-0 text-muted-foreground hover:text-foreground","aria-label":"Search",children:e.jsx(t.Search,{className:"h-3.5 w-3.5"})}),(x||R)&&e.jsxs(t.Button,{size:"xs",variant:"outline",onClick:()=>r(!0),"aria-label":P,children:[e.jsx(t.Plus,{className:"h-3.5 w-3.5"}),U]}),e.jsx(t.Button,{size:"xs",variant:"ghost",className:"w-7 px-0 text-muted-foreground hover:text-foreground",onClick:m,"aria-label":_,children:e.jsx(t.PanelLeft,{className:"h-3.5 w-3.5"})})]})]})}),e.jsx("div",{className:"flex flex-1 flex-col overflow-auto px-1.5 py-2",children:x?e.jsx(ce,{searchQuery:N}):e.jsx(xe,{searchQuery:N,onLoadDashboard:J,onEditDashboard:o,onDashboardItemClick:l})}),u&&e.jsx(t.TooltipProvider,{children:e.jsx("div",{className:"border-t border-border/60 px-3 py-2",children:e.jsxs(t.Tooltip,{children:[e.jsx(t.TooltipTrigger,{asChild:!0,children:e.jsxs("div",{className:"flex cursor-default items-center gap-2",children:[e.jsx("div",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-medium text-muted-foreground",children:W}),e.jsx("span",{className:"truncate text-[12px] text-muted-foreground",children:z})]})}),e.jsx(t.TooltipContent,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"font-medium",children:z}),X&&e.jsx("div",{className:"text-[11px] opacity-80",children:X}),u.role&&e.jsxs("div",{className:"text-[11px] opacity-80",children:["Role: ",t.toTitleCase(u.role.replace(/_/g," "))]})]})})]})})}),x?e.jsx(pe,{open:w,onOpenChange:r,onSubmit:y,isCreating:O}):e.jsx(t.CreateDashboardDialog,{open:w,onOpenChange:r,onSubmit:M,isCreating:L})]})})}exports.ResourceManagementPanel=me;
|
|
6
|
+
*/const ae=t.createLucideIcon("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);function ie(s,m={}){const{enabled:p=!0,eventType:l="mousedown"}=m,i=h.useRef(null);return h.useEffect(()=>{const x=w=>{const r=w.target;i.current&&i.current.contains(r)||r instanceof Element&&(r.closest("[data-radix-popper-content-wrapper]")||r.closest("[data-radix-select-content]")||r.closest("[data-radix-popover-content]")||r.closest("[data-radix-dropdown-menu-content]")||r.closest("[data-radix-tooltip-content]")||r.closest('[role="listbox"]')||r.closest('[role="option"]')||r.closest('[role="combobox"]'))||r instanceof Element&&r.hasAttribute("data-radix-")||s()};return p&&document.addEventListener(l,x),()=>{document.removeEventListener(l,x)}},[s,p,l]),i}function oe(){return e.jsx("div",{className:"space-y-1.5 py-1",children:[...Array(5)].map((s,m)=>e.jsxs("div",{className:"flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",children:[e.jsx("div",{className:"mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"h-4 w-3/5 rounded bg-muted/60"}),e.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40"})]})]},m))})}const le=s=>{const m=t.useDashboardStore(i=>i.isVisualEditing),p=t.useDashboardStore(i=>i.selectedFrameId),l=t.useEditorStore(i=>i.frame);return!!(m&&p&&(l==null?void 0:l.visualId)===s)};function de({visual:s,isDeleting:m,isDuplicating:p,onAddVisual:l,onOpenVisual:i,onEditDetails:x,onDeleteClick:w,onDuplicateVisual:r,onShareVisual:N,formatDate:b}){var O,T,U,P;const{selectVisual:f}=t.useManagementActions(),d=t.useIsVisualSelected(s.id),u=le(s.id),A=t.useDashboardStore(a=>a.isVisualEditing),{isConsoleMode:R}=t.useDashboardPreferences(),j=h.useRef(null),[S,v]=h.useState(!1),[E,L]=h.useState(!1);h.useEffect(()=>{p?(v(!0),L(!0)):E&&(v(!1),L(!1))},[p,E]),h.useEffect(()=>{u&&j.current&&j.current.scrollIntoView({behavior:"smooth",block:"center"})},[u]);const C=()=>{f(s),i==null||i(s)},y=a=>{a.currentTarget===a.target&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),C())};return e.jsxs("div",{ref:j,className:t.cn("group flex cursor-pointer items-start gap-1 rounded-[5px] px-2 py-1.5 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",u?"bg-muted ring-1 ring-inset ring-foreground/20":d&&"bg-muted"),onClick:C,children:[e.jsxs("div",{role:"button",tabIndex:0,className:"min-w-0 flex-1 cursor-pointer focus-visible:outline-none",onKeyDown:y,children:[e.jsx("p",{className:"truncate text-[13px] font-medium leading-5 text-foreground",title:s.title||"Untitled Visual",children:s.title||"Untitled Visual"}),e.jsx("p",{className:"truncate text-[11px] leading-4 text-muted-foreground",title:s.description||"No description",children:(O=s.description)!=null&&O.trim()?s.description:"No description"})]}),e.jsx("div",{className:t.cn("flex shrink-0 items-center transition-opacity",d||u||S?"pointer-events-auto opacity-100":"pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100"),onClick:a=>a.stopPropagation(),children:e.jsxs("div",{className:"inline-flex h-7 items-stretch overflow-hidden rounded-[5px] border border-border/60 bg-background",children:[e.jsxs(t.Button,{size:"xs",variant:"ghost",className:"h-full rounded-none border-0 shadow-none hover:bg-accent/50",disabled:A,onClick:a=>{a.stopPropagation(),l(s)},"aria-label":`Add ${s.title||"visual"}`,children:[e.jsx(t.Plus,{className:"h-3.5 w-3.5"}),"Add"]}),e.jsxs(t.DropdownMenu,{modal:!1,open:S,onOpenChange:v,children:[e.jsx(t.DropdownMenuTrigger,{asChild:!0,children:e.jsx(t.Button,{size:"xs",variant:"ghost",className:"h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent/50","aria-label":"Open visual actions",children:e.jsx(t.EllipsisVertical,{className:"h-3.5 w-3.5"})})}),e.jsxs(t.DropdownMenuContent,{align:"end",className:"z-[51] w-44 rounded-[6px] border border-border/60 p-1 shadow-sm",children:[e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),l(s)},disabled:A,children:[e.jsx(t.Plus,{className:"h-3.5 w-3.5"}),"Add"]}),e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),i==null||i(s)},children:[e.jsx(ae,{className:"h-3.5 w-3.5"}),"Open"]}),e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.preventDefault(),a.stopPropagation(),r(s.id)},disabled:p,children:[p?e.jsx(t.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(t.Copy,{className:"h-3.5 w-3.5"}),p?"Duplicating…":"Duplicate"]}),s.ownership.isOwner&&e.jsxs(e.Fragment,{children:[e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),x==null||x(s)},children:[e.jsx(t.PenLine,{className:"h-3.5 w-3.5"}),"Edit details"]}),e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),N(s)},children:[e.jsx(t.Users,{className:"h-3.5 w-3.5"}),"Share"]}),e.jsx(t.DropdownMenuSeparator,{}),e.jsxs(t.DropdownMenuItem,{onClick:a=>{a.stopPropagation(),w(s)},className:"text-destructive focus:bg-destructive/10 focus:text-destructive",disabled:m,children:[e.jsx(t.Trash2,{className:"h-3.5 w-3.5"}),m?"Deleting…":"Delete"]})]}),e.jsx(t.DropdownMenuSeparator,{}),e.jsxs("div",{className:"space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground",children:[(((T=s.ownership.createdBy)==null?void 0:T.type)==="tenant"||((U=s.ownership.createdBy)==null?void 0:U.type)==="organization"&&R)&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(t.User,{className:"h-3 w-3"}),e.jsx("span",{children:((P=s.ownership.createdBy)==null?void 0:P.name)||"Unknown"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(t.Calendar,{className:"h-3 w-3"}),e.jsx("span",{children:b(s.lastModified)})]})]})]})]})]})})]})}function ce({searchQuery:s}){const[m,p]=h.useState(!1),[l,i]=h.useState(null),[x,w]=h.useState(!1),[r,N]=h.useState(null),[b,f]=h.useState(null),[d,u]=h.useState(null),{handleEditLibraryVisual:A,handleAddLibraryVisual:R}=ne.useVisualUtils(),{resources:j,isLoading:S,isError:v,updateResource:E,deleteResource:L,duplicateResource:C,isDeleting:y}=t.useVisualManagement(()=>{w(!1),N(null)}),O=j.filter(o=>{var M,c;return((M=o==null?void 0:o.title)==null?void 0:M.toLowerCase().includes(s.toLowerCase()))||((c=o==null?void 0:o.description)==null?void 0:c.toLowerCase().includes(s.toLowerCase()))}),T=o=>new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),U=o=>{N(o),w(!0)},P=()=>{r&&L(r.id)},{startUpdating:a,stopUpdating:_,isUpdating:F}=t.useResourceUpdateState(),V=(o,M,c)=>{var Q;const B=Object.fromEntries(Object.entries(M).filter(([,I])=>I!==void 0));if(Object.keys(B).length===0){(Q=c==null?void 0:c.onSuccess)==null||Q.call(c);return}const D=Object.keys(B),H=D.length===1?D[0]:void 0;a(o,H),E({resourceId:o,data:B},{onSuccess:()=>{var I;_(o,H),(I=c==null?void 0:c.onSuccess)==null||I.call(c)},onError:()=>{var I;_(o,H),(I=c==null?void 0:c.onError)==null||I.call(c)}})},G=o=>{f(o),C(o,{onSettled:()=>f(null)})},z=o=>{A(o)},W=o=>{R(o)},X=o=>{i(o),p(!0)},Y=o=>{u(o)},$=()=>{u(null)},J=({title:o,description:M})=>{if(!d)return;const c={};o!==d.title&&(c.title=o),(d.description||"")!==M&&(c.description=M),V(d.id,c,{onSuccess:()=>{u(null)}})};return S?e.jsx(oe,{}):v?e.jsx(t.ScrollArea,{className:"w-full flex-1 pr-2",children:e.jsxs("div",{className:"flex flex-col items-center gap-1.5 px-4 py-10 text-center",children:[e.jsx("p",{className:"text-[12px] text-destructive",children:"Failed to load visuals"}),e.jsx(t.Button,{variant:"outline",size:"xs",onClick:()=>window.location.reload(),children:"Retry"})]})}):e.jsxs("div",{className:"flex h-full flex-1 flex-col",children:[e.jsx("div",{className:"flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto",children:O.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-1.5 px-4 py-10 text-center",children:[e.jsx(t.Grid3x3,{className:"h-5 w-5 text-muted-foreground/60"}),e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:s?"No visuals found":"No visuals yet"}),e.jsx("p",{className:"text-[12px] text-muted-foreground",children:s?"Try adjusting your search.":'Click "New" above to add your first visual.'})]}):O.map(o=>e.jsx(de,{visual:o,onAddVisual:W,onOpenVisual:z,onEditDetails:Y,onDeleteClick:U,onDuplicateVisual:G,onShareVisual:X,isDeleting:y,isDuplicating:b===o.id,formatDate:T},o.id))}),m&&l&&e.jsx(t.ShareDialog,{resource:l,resourceType:t.ResourceType.VISUAL,onClose:()=>{p(!1),i(null)}}),d&&e.jsx(t.ResourceEditDialog,{open:!!d,resourceLabel:"Visual",initialTitle:d.title||"",initialDescription:d.description||"",onClose:$,onSave:J,isSaving:F(d.id)}),e.jsx(t.AlertDialog,{open:x,onOpenChange:o=>{!o&&y||(w(o),o||N(null))},children:e.jsxs(t.AlertDialogContent,{children:[e.jsxs(t.AlertDialogHeader,{children:[e.jsx(t.AlertDialogTitle,{children:"Delete Visual"}),e.jsxs(t.AlertDialogDescription,{children:['Are you sure you want to delete "',r==null?void 0:r.title,'"? This action cannot be undone.']})]}),e.jsxs(t.AlertDialogFooter,{children:[e.jsx(t.AlertDialogCancel,{disabled:y,children:"Cancel"}),e.jsxs(t.AlertDialogAction,{onClick:o=>{o.preventDefault(),o.stopPropagation(),P()},disabled:y,children:[y?e.jsx(t.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(t.Trash2,{className:"h-3.5 w-3.5"}),y?"Deleting…":"Delete"]})]})]})})]})}function ue({dashboard:s,isDeleting:m,isDuplicating:p,onLoadDashboard:l,onEditDetails:i,onDeleteClick:x,onDuplicateDashboard:w,onShareDashboard:r,formatDate:N,onDashboardItemClick:b}){var E,L;const{selectDashboard:f}=t.useManagementActions(),d=t.useIsDashboardSelected(s.id),{userContext:u,isLoading:A}=t.useCurrentUserInfo(),R=((E=u==null?void 0:u.permissions)==null?void 0:E.canEdit)??!1,j=A||!R,S=()=>{f(s),l(s.id),b==null||b(s.id)},v=C=>{C.currentTarget===C.target&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),S())};return e.jsxs("div",{className:t.cn("group flex cursor-pointer items-start gap-1 rounded-[5px] px-2 py-1.5 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",d&&"bg-muted"),onClick:S,children:[e.jsxs("div",{role:"button",tabIndex:0,className:"min-w-0 flex-1 cursor-pointer focus-visible:outline-none",onKeyDown:v,children:[e.jsx("p",{className:"truncate text-[13px] font-medium leading-5 text-foreground",title:s.title||"Untitled Dashboard",children:s.title||"Untitled Dashboard"}),e.jsx("p",{className:"truncate text-[11px] leading-4 text-muted-foreground",title:s.description||"No description",children:(L=s.description)!=null&&L.trim()?s.description:"No description"})]}),e.jsx("div",{className:t.cn("shrink-0 transition-opacity",d?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),children:e.jsx(t.DashboardActionsMenu,{dashboard:s,isDeleting:m,isDuplicating:p,shouldHideActions:j,onEditDetails:i,onDeleteClick:x,onDuplicateDashboard:w,onShareDashboard:r,formatDate:N})})]})}function he({onRetry:s}){return e.jsx(t.ScrollArea,{className:"w-full flex-1 pr-2",children:e.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 bg-muted/20 px-4 py-8 text-center text-muted-foreground",children:[e.jsx("p",{className:"text-sm text-destructive",children:"Failed to load dashboards"}),e.jsx(t.Button,{variant:"outline",size:"sm",className:"mt-2",onClick:s,children:"Retry"})]})})}function xe(s){var ee;const{searchQuery:m,onLoadDashboard:p,onEditDashboard:l,onDashboardItemClick:i}=s,[x,w]=h.useState(!1),[r,N]=h.useState(null),[b,f]=h.useState(!1),[d,u]=h.useState(null),[A,R]=h.useState(null),[j,S]=h.useState(null),v=t.useManagementStore(n=>n.lastSelectedDashboard),E=t.useManagementStore(n=>n.selectedDashboard),L=t.useManagementStore(n=>n.actions.selectDashboard),C=t.useManagementStore(n=>n.actions.clearSelectedDashboard),{tokenProps:y,id:O}=t.useSemaphorContext(),{resources:T,isLoading:U,isError:P,updateResource:a,deleteResource:_,duplicateResource:F,isDeleting:V}=t.useDashboardManagement(()=>{f(!1);const n=d==null?void 0:d.id;u(null),(E==null?void 0:E.id)===n&&(!(y!=null&&y.dashboard_id)&&!O?C():v&&v.id!==n&&L(v))}),{userContext:G}=t.useCurrentUserInfo(),z=((ee=G==null?void 0:G.permissions)==null?void 0:ee.canCreateDashboard)??!1,W=T.filter(n=>{var K,g;return((K=n==null?void 0:n.title)==null?void 0:K.toLowerCase().includes(m.toLowerCase()))||((g=n==null?void 0:n.description)==null?void 0:g.toLowerCase().includes(m.toLowerCase()))}),X=n=>new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Y=n=>{p==null||p(n)},$=n=>{u(n),f(!0)},J=()=>{d&&_(d.id)},o=n=>{R(n),F(n,{onSettled:()=>R(null)})},{startUpdating:M,stopUpdating:c,isUpdating:B}=t.useResourceUpdateState(),D=(n,K,g)=>{var se;const Z=Object.fromEntries(Object.entries(K).filter(([,q])=>q!==void 0));if(Object.keys(Z).length===0){(se=g==null?void 0:g.onSuccess)==null||se.call(g);return}const te=Object.keys(Z),k=te.length===1?te[0]:void 0;M(n,k),a({resourceId:n,data:Z},{onSuccess:()=>{var q;c(n,k),(q=g==null?void 0:g.onSuccess)==null||q.call(g)},onError:()=>{var q;c(n,k),(q=g==null?void 0:g.onError)==null||q.call(g)}})},H=n=>{N(n),w(!0)},Q=n=>{l==null||l(n.id),S(n)},I=()=>{S(null)},re=({title:n,description:K})=>{if(!j)return;const g={};n!==j.title&&(g.title=n),(j.description||"")!==K&&(g.description=K),D(j.id,g,{onSuccess:()=>{S(null)}})};return U?e.jsx(oe,{}):P?e.jsx(he,{onRetry:()=>window.location.reload()}):e.jsxs("div",{className:"flex h-full flex-1 flex-col",children:[e.jsx("div",{className:"flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto",children:W.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-1.5 px-4 py-10 text-center",children:[e.jsx(t.ChartColumn,{className:"h-5 w-5 text-muted-foreground/60"}),e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:m?"No dashboards found":"No dashboards yet"}),e.jsx("p",{className:"text-[12px] text-muted-foreground",children:m?"Try adjusting your search.":z?'Click "New" above to add your first dashboard.':"No dashboards have been shared with you yet."})]}):W.map(n=>e.jsx(ue,{dashboard:n,isDeleting:V,isDuplicating:A===n.id,onLoadDashboard:Y,onEditDetails:Q,onDeleteClick:$,onDuplicateDashboard:o,onShareDashboard:H,formatDate:X,onDashboardItemClick:i},n.id))}),x&&r&&e.jsx(t.ShareDialog,{resource:r,resourceType:t.ResourceType.DASHBOARD,onClose:()=>{w(!1),N(null)}}),e.jsx(t.AlertDialog,{open:b,onOpenChange:n=>{!n&&V||(f(n),n||u(null))},children:e.jsxs(t.AlertDialogContent,{children:[e.jsxs(t.AlertDialogHeader,{children:[e.jsx(t.AlertDialogTitle,{children:"Delete Dashboard"}),e.jsxs(t.AlertDialogDescription,{children:['Are you sure you want to delete "',d==null?void 0:d.title,'"? This action cannot be undone.']})]}),e.jsxs(t.AlertDialogFooter,{children:[e.jsx(t.AlertDialogCancel,{disabled:V,children:"Cancel"}),e.jsxs(t.AlertDialogAction,{onClick:n=>{n.preventDefault(),n.stopPropagation(),J()},disabled:V,children:[V?e.jsx(t.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(t.Trash2,{className:"h-3.5 w-3.5"}),V?"Deleting…":"Delete"]})]})]})}),j&&e.jsx(t.ResourceEditDialog,{open:!!j,resourceLabel:"Dashboard",initialTitle:j.title||"",initialDescription:j.description||"",onClose:I,onSave:re,isSaving:B(j.id)})]})}function pe({open:s,onOpenChange:m,onSubmit:p,isCreating:l}){const[i,x]=h.useState(""),[w,r]=h.useState("");h.useEffect(()=>{s||(x(""),r(""))},[s]);const N=()=>{i.trim()&&p({title:i,description:w})},b=f=>{m(f)};return e.jsx(t.Dialog,{open:s,onOpenChange:b,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:"Create New Visual"}),e.jsx(t.DialogDescription,{children:"Add a new visual to your library. You can configure it after creation."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(t.Label,{htmlFor:"title",children:"Visual Title"}),e.jsx(t.Input,{id:"title",placeholder:"Enter visual title...",value:i,onChange:f=>x(f.target.value),disabled:l,onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),N())}})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t.Label,{htmlFor:"description",children:"Description (optional)"}),e.jsx(t.Input,{id:"description",placeholder:"Enter visual description...",value:w,onChange:f=>r(f.target.value),disabled:l})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(t.Button,{variant:"outline",onClick:()=>b(!1),disabled:l,children:"Cancel"}),e.jsx(t.Button,{onClick:N,disabled:!i.trim()||l,children:l?e.jsxs(e.Fragment,{children:[e.jsx(t.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Visual"})]})]})})}function me({isOpen:s,onClose:m,className:p,onDashboardItemClick:l,variant:i="inline"}){var c,B;const x=t.useDashboardStore(D=>D.isDashboardEditing),[w,r]=h.useState(!1),[N,b]=h.useState(""),[f,d]=h.useState(!1),{currentUser:u,userContext:A}=t.useCurrentUserInfo(),R=((c=A==null?void 0:A.permissions)==null?void 0:c.canCreateDashboard)??!1,{onCreateSuccess:j}=t.useDashboardCreation({onDashboardSelect:l}),{selectVisual:S}=t.useManagementActions(),{handleEditLibraryVisual:v}=ne.useVisualUtils(),{createResource:E,isCreating:L,refetch:C}=t.useDashboardManagement(),{createResource:y,isCreating:O}=t.useVisualManagement(void 0,D=>{r(!1),D&&(S(D),v(D))}),T=i==="overlay",U=x?"New Visual":"New",P=x?"New Visual":"New Dashboard",a=x?"Search visuals...":"Search dashboards...",_=x?"Collapse visuals panel":"Collapse dashboard panel",F=((u==null?void 0:u.name)??"").trim(),V=((u==null?void 0:u.email)??"").trim(),z=F&&F.toLowerCase()!=="undefined"?F:V||"Current user",W=((B=z.charAt(0))==null?void 0:B.toUpperCase())||"?",X=V&&V.toLowerCase()!=="undefined"?V:"",Y=ie(m,{enabled:s&&T}),$=t.cn("flex h-full flex-col border-r border-border/60 bg-background",T?t.cn("absolute inset-y-0 left-0 z-[51] w-60 overflow-hidden shadow-lg transition-transform duration-300 ease-in-out",s?"translate-x-0":"pointer-events-none -translate-x-full"):"w-full max-w-[17rem] min-w-[11rem] overflow-hidden",p),J=D=>{},o=D=>{console.log("Editing dashboard:",D)},M=D=>{E(D,{onSuccess:H=>{r(!1),j(H,C)}})};return e.jsx(e.Fragment,{children:(!T||s)&&e.jsxs("div",{ref:Y,className:$,children:[e.jsx("div",{className:"border-b border-border/60 bg-background",children:f?e.jsxs("div",{className:"flex h-10 items-center gap-1 px-3",children:[e.jsx(t.Search,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("input",{autoFocus:!0,value:N,onChange:D=>b(D.target.value),onKeyDown:D=>{D.key==="Escape"&&(b(""),d(!1))},placeholder:a,className:"h-7 min-w-0 flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground focus:outline-none","aria-label":a}),e.jsx(t.Button,{size:"xs",variant:"ghost",className:"w-7 shrink-0 px-0 text-muted-foreground hover:text-foreground",onClick:()=>{b(""),d(!1)},"aria-label":"Close search",children:e.jsx(t.X,{className:"h-3.5 w-3.5"})})]}):e.jsxs("div",{className:"flex h-10 items-center justify-between gap-2 px-3",children:[e.jsx("h2",{className:"whitespace-nowrap text-[13px] font-medium text-foreground",children:x?"Visuals":"Dashboards"}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(t.Button,{size:"xs",variant:"ghost",onClick:()=>d(!0),className:"w-7 px-0 text-muted-foreground hover:text-foreground","aria-label":"Search",children:e.jsx(t.Search,{className:"h-3.5 w-3.5"})}),(x||R)&&e.jsxs(t.Button,{size:"xs",variant:"outline",onClick:()=>r(!0),"aria-label":P,children:[e.jsx(t.Plus,{className:"h-3.5 w-3.5"}),U]}),e.jsx(t.Button,{size:"xs",variant:"ghost",className:"w-7 px-0 text-muted-foreground hover:text-foreground",onClick:m,"aria-label":_,children:e.jsx(t.PanelLeft,{className:"h-3.5 w-3.5"})})]})]})}),e.jsx("div",{className:"flex flex-1 flex-col overflow-auto px-1.5 py-2",children:x?e.jsx(ce,{searchQuery:N}):e.jsx(xe,{searchQuery:N,onLoadDashboard:J,onEditDashboard:o,onDashboardItemClick:l})}),u&&e.jsx(t.TooltipProvider,{children:e.jsx("div",{className:"border-t border-border/60 px-3 py-2",children:e.jsxs(t.Tooltip,{children:[e.jsx(t.TooltipTrigger,{asChild:!0,children:e.jsxs("div",{className:"flex cursor-default items-center gap-2",children:[e.jsx("div",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-medium text-muted-foreground",children:W}),e.jsx("span",{className:"truncate text-[12px] text-muted-foreground",children:z})]})}),e.jsx(t.TooltipContent,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"font-medium",children:z}),X&&e.jsx("div",{className:"text-[11px] opacity-80",children:X}),u.role&&e.jsxs("div",{className:"text-[11px] opacity-80",children:["Role:"," ",t.toTitleCase(u.role.replace(/_/g," "))]})]})})]})})}),x?e.jsx(pe,{open:w,onOpenChange:r,onSubmit:y,isCreating:O}):e.jsx(t.CreateDashboardDialog,{open:w,onOpenChange:r,onSubmit:M,isCreating:L})]})})}exports.ResourceManagementPanel=me;
|
package/dist/chunks/{resource-management-panel-BL5-5ouC.js → resource-management-panel-HOWOJUap.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n, Fragment as le } from "react/jsx-runtime";
|
|
2
|
-
import { c as je, u as ne, W as Fe, N as de,
|
|
2
|
+
import { c as je, u as ne, W as Fe, N as de, cE as ze, cF as Be, b as Q, B as I, cx as ie, cG as He, cH as Ke, cI as _e, cJ as We, cK as J, x as se, cL as Xe, cM as Ye, cN as Ge, cO as fe, cl as ce, cP as $e, cQ as Je, cR as we, cS as Ne, cT as be, cU as Qe, ao as ye, ak as Ce, cV as ve, cW as Se, cX as Ee, cY as Ve, cZ as Le, c_ as Ae, c$ as Oe, d0 as Re, d1 as Te, d2 as Ze, d3 as ue, d4 as qe, ai as te, d as ke, d5 as Ue, d6 as et, e as tt, f as nt, g as at, h as st, i as ot, L as ge, I as xe, w as rt, d7 as it, d8 as De, X as lt, d9 as dt, bV as ct, bW as ut, bX as ht, bY as pt, da as mt, db as ft } from "./index-D0iNspb-.js";
|
|
3
3
|
import gt, { useRef as xt, useEffect as ae, useState as w } from "react";
|
|
4
|
-
import { u as Ie } from "./use-visual-utils-
|
|
4
|
+
import { u as Ie } from "./use-visual-utils-DyvrB6Zh.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|
|
7
7
|
*
|
|
@@ -208,7 +208,7 @@ function bt({
|
|
|
208
208
|
r.stopPropagation(), h == null || h(t);
|
|
209
209
|
},
|
|
210
210
|
children: [
|
|
211
|
-
/* @__PURE__ */ e(
|
|
211
|
+
/* @__PURE__ */ e(Ye, { className: "h-3.5 w-3.5" }),
|
|
212
212
|
"Edit details"
|
|
213
213
|
]
|
|
214
214
|
}
|
|
@@ -220,7 +220,7 @@ function bt({
|
|
|
220
220
|
r.stopPropagation(), b(t);
|
|
221
221
|
},
|
|
222
222
|
children: [
|
|
223
|
-
/* @__PURE__ */ e(
|
|
223
|
+
/* @__PURE__ */ e(Ge, { className: "h-3.5 w-3.5" }),
|
|
224
224
|
"Share"
|
|
225
225
|
]
|
|
226
226
|
}
|
|
@@ -323,21 +323,21 @@ function yt({ searchQuery: t }) {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
);
|
|
326
|
-
},
|
|
326
|
+
}, Y = (s) => {
|
|
327
327
|
f(s), C(s, {
|
|
328
328
|
onSettled: () => f(null)
|
|
329
329
|
});
|
|
330
330
|
}, H = (s) => {
|
|
331
331
|
A(s);
|
|
332
|
-
},
|
|
332
|
+
}, G = (s) => {
|
|
333
333
|
T(s);
|
|
334
334
|
}, $ = (s) => {
|
|
335
335
|
i(s), p(!0);
|
|
336
336
|
}, Z = (s) => {
|
|
337
337
|
u(s);
|
|
338
|
-
},
|
|
338
|
+
}, q = () => {
|
|
339
339
|
u(null);
|
|
340
|
-
},
|
|
340
|
+
}, k = ({
|
|
341
341
|
title: s,
|
|
342
342
|
description: R
|
|
343
343
|
}) => {
|
|
@@ -370,11 +370,11 @@ function yt({ searchQuery: t }) {
|
|
|
370
370
|
bt,
|
|
371
371
|
{
|
|
372
372
|
visual: s,
|
|
373
|
-
onAddVisual:
|
|
373
|
+
onAddVisual: G,
|
|
374
374
|
onOpenVisual: H,
|
|
375
375
|
onEditDetails: Z,
|
|
376
376
|
onDeleteClick: j,
|
|
377
|
-
onDuplicateVisual:
|
|
377
|
+
onDuplicateVisual: Y,
|
|
378
378
|
onShareVisual: $,
|
|
379
379
|
isDeleting: v,
|
|
380
380
|
isDuplicating: y === s.id,
|
|
@@ -399,8 +399,8 @@ function yt({ searchQuery: t }) {
|
|
|
399
399
|
resourceLabel: "Visual",
|
|
400
400
|
initialTitle: d.title || "",
|
|
401
401
|
initialDescription: d.description || "",
|
|
402
|
-
onClose:
|
|
403
|
-
onSave:
|
|
402
|
+
onClose: q,
|
|
403
|
+
onSave: k,
|
|
404
404
|
isSaving: B(d.id)
|
|
405
405
|
}
|
|
406
406
|
),
|
|
@@ -503,7 +503,7 @@ function Ct({
|
|
|
503
503
|
d ? "opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"
|
|
504
504
|
),
|
|
505
505
|
children: /* @__PURE__ */ e(
|
|
506
|
-
|
|
506
|
+
qe,
|
|
507
507
|
{
|
|
508
508
|
dashboard: t,
|
|
509
509
|
isDeleting: m,
|
|
@@ -540,7 +540,7 @@ function St(t) {
|
|
|
540
540
|
(a) => a.actions.selectDashboard
|
|
541
541
|
), C = te(
|
|
542
542
|
(a) => a.actions.clearSelectedDashboard
|
|
543
|
-
), { tokenProps: v, id: M } =
|
|
543
|
+
), { tokenProps: v, id: M } = ke(), {
|
|
544
544
|
resources: U,
|
|
545
545
|
isLoading: j,
|
|
546
546
|
isError: F,
|
|
@@ -552,7 +552,7 @@ function St(t) {
|
|
|
552
552
|
f(!1);
|
|
553
553
|
const a = d == null ? void 0 : d.id;
|
|
554
554
|
u(null), (V == null ? void 0 : V.id) === a && (!(v != null && v.dashboard_id) && !M ? C() : E && E.id !== a && O(E));
|
|
555
|
-
}), { userContext:
|
|
555
|
+
}), { userContext: Y } = ue(), H = ((he = Y == null ? void 0 : Y.permissions) == null ? void 0 : he.canCreateDashboard) ?? !1, G = U.filter(
|
|
556
556
|
(a) => {
|
|
557
557
|
var _, g;
|
|
558
558
|
return ((_ = a == null ? void 0 : a.title) == null ? void 0 : _.toLowerCase().includes(m.toLowerCase())) || ((g = a == null ? void 0 : a.description) == null ? void 0 : g.toLowerCase().includes(m.toLowerCase()));
|
|
@@ -563,9 +563,9 @@ function St(t) {
|
|
|
563
563
|
year: "numeric"
|
|
564
564
|
}), Z = (a) => {
|
|
565
565
|
p == null || p(a);
|
|
566
|
-
},
|
|
566
|
+
}, q = (a) => {
|
|
567
567
|
u(a), f(!0);
|
|
568
|
-
},
|
|
568
|
+
}, k = () => {
|
|
569
569
|
d && X(d.id);
|
|
570
570
|
}, s = (a) => {
|
|
571
571
|
T(a), B(a, {
|
|
@@ -621,11 +621,11 @@ function St(t) {
|
|
|
621
621
|
});
|
|
622
622
|
};
|
|
623
623
|
return j ? /* @__PURE__ */ e(Me, {}) : F ? /* @__PURE__ */ e(vt, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ n("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
624
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto", children:
|
|
624
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-0.5 overflow-y-auto", children: G.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-1.5 px-4 py-10 text-center", children: [
|
|
625
625
|
/* @__PURE__ */ e(et, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
626
626
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-medium text-foreground", children: m ? "No dashboards found" : "No dashboards yet" }),
|
|
627
627
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: m ? "Try adjusting your search." : H ? 'Click "New" above to add your first dashboard.' : "No dashboards have been shared with you yet." })
|
|
628
|
-
] }) :
|
|
628
|
+
] }) : G.map((a) => /* @__PURE__ */ e(
|
|
629
629
|
Ct,
|
|
630
630
|
{
|
|
631
631
|
dashboard: a,
|
|
@@ -633,7 +633,7 @@ function St(t) {
|
|
|
633
633
|
isDuplicating: A === a.id,
|
|
634
634
|
onLoadDashboard: Z,
|
|
635
635
|
onEditDetails: ee,
|
|
636
|
-
onDeleteClick:
|
|
636
|
+
onDeleteClick: q,
|
|
637
637
|
onDuplicateDashboard: s,
|
|
638
638
|
onShareDashboard: K,
|
|
639
639
|
formatDate: $,
|
|
@@ -673,7 +673,7 @@ function St(t) {
|
|
|
673
673
|
Te,
|
|
674
674
|
{
|
|
675
675
|
onClick: (a) => {
|
|
676
|
-
a.preventDefault(), a.stopPropagation(),
|
|
676
|
+
a.preventDefault(), a.stopPropagation(), k();
|
|
677
677
|
},
|
|
678
678
|
disabled: L,
|
|
679
679
|
children: [
|
|
@@ -797,16 +797,16 @@ function Rt({
|
|
|
797
797
|
(D) => {
|
|
798
798
|
o(!1), D && (S(D), E(D));
|
|
799
799
|
}
|
|
800
|
-
), U = i === "overlay", j = h ? "New Visual" : "New", F = h ? "New Visual" : "New Dashboard", r = h ? "Search visuals..." : "Search dashboards...", X = h ? "Collapse visuals panel" : "Collapse dashboard panel", B = ((u == null ? void 0 : u.name) ?? "").trim(), L = ((u == null ? void 0 : u.email) ?? "").trim(), H = B && B.toLowerCase() !== "undefined" ? B : L || "Current user",
|
|
800
|
+
), U = i === "overlay", j = h ? "New Visual" : "New", F = h ? "New Visual" : "New Dashboard", r = h ? "Search visuals..." : "Search dashboards...", X = h ? "Collapse visuals panel" : "Collapse dashboard panel", B = ((u == null ? void 0 : u.name) ?? "").trim(), L = ((u == null ? void 0 : u.email) ?? "").trim(), H = B && B.toLowerCase() !== "undefined" ? B : L || "Current user", G = ((z = H.charAt(0)) == null ? void 0 : z.toUpperCase()) || "?", $ = L && L.toLowerCase() !== "undefined" ? L : "", Z = wt(m, {
|
|
801
801
|
enabled: t && U
|
|
802
|
-
}),
|
|
802
|
+
}), q = Q(
|
|
803
803
|
"flex h-full flex-col border-r border-border/60 bg-background",
|
|
804
804
|
U ? Q(
|
|
805
805
|
"absolute inset-y-0 left-0 z-[51] w-60 overflow-hidden shadow-lg transition-transform duration-300 ease-in-out",
|
|
806
806
|
t ? "translate-x-0" : "pointer-events-none -translate-x-full"
|
|
807
807
|
) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden",
|
|
808
808
|
p
|
|
809
|
-
),
|
|
809
|
+
), k = (D) => {
|
|
810
810
|
}, s = (D) => {
|
|
811
811
|
console.log("Editing dashboard:", D);
|
|
812
812
|
}, R = (D) => {
|
|
@@ -816,8 +816,8 @@ function Rt({
|
|
|
816
816
|
}
|
|
817
817
|
});
|
|
818
818
|
};
|
|
819
|
-
return /* @__PURE__ */ e(le, { children: (!U || t) && /* @__PURE__ */ n("div", { ref: Z, className:
|
|
820
|
-
/* @__PURE__ */ e("div", { className: "border-b border-border/60 bg-background", children: f ? /* @__PURE__ */ n("div", { className: "flex h-
|
|
819
|
+
return /* @__PURE__ */ e(le, { children: (!U || t) && /* @__PURE__ */ n("div", { ref: Z, className: q, children: [
|
|
820
|
+
/* @__PURE__ */ e("div", { className: "border-b border-border/60 bg-background", children: f ? /* @__PURE__ */ n("div", { className: "flex h-10 items-center gap-1 px-3", children: [
|
|
821
821
|
/* @__PURE__ */ e(De, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
822
822
|
/* @__PURE__ */ e(
|
|
823
823
|
"input",
|
|
@@ -846,7 +846,7 @@ function Rt({
|
|
|
846
846
|
children: /* @__PURE__ */ e(lt, { className: "h-3.5 w-3.5" })
|
|
847
847
|
}
|
|
848
848
|
)
|
|
849
|
-
] }) : /* @__PURE__ */ n("div", { className: "flex h-
|
|
849
|
+
] }) : /* @__PURE__ */ n("div", { className: "flex h-10 items-center justify-between gap-2 px-3", children: [
|
|
850
850
|
/* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-[13px] font-medium text-foreground", children: h ? "Visuals" : "Dashboards" }),
|
|
851
851
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-0.5", children: [
|
|
852
852
|
/* @__PURE__ */ e(
|
|
@@ -890,21 +890,22 @@ function Rt({
|
|
|
890
890
|
St,
|
|
891
891
|
{
|
|
892
892
|
searchQuery: b,
|
|
893
|
-
onLoadDashboard:
|
|
893
|
+
onLoadDashboard: k,
|
|
894
894
|
onEditDashboard: s,
|
|
895
895
|
onDashboardItemClick: l
|
|
896
896
|
}
|
|
897
897
|
) }),
|
|
898
898
|
u && /* @__PURE__ */ e(ct, { children: /* @__PURE__ */ e("div", { className: "border-t border-border/60 px-3 py-2", children: /* @__PURE__ */ n(ut, { children: [
|
|
899
899
|
/* @__PURE__ */ e(ht, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex cursor-default items-center gap-2", children: [
|
|
900
|
-
/* @__PURE__ */ e("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-medium text-muted-foreground", children:
|
|
900
|
+
/* @__PURE__ */ e("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-medium text-muted-foreground", children: G }),
|
|
901
901
|
/* @__PURE__ */ e("span", { className: "truncate text-[12px] text-muted-foreground", children: H })
|
|
902
902
|
] }) }),
|
|
903
903
|
/* @__PURE__ */ e(pt, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
|
|
904
904
|
/* @__PURE__ */ e("div", { className: "font-medium", children: H }),
|
|
905
905
|
$ && /* @__PURE__ */ e("div", { className: "text-[11px] opacity-80", children: $ }),
|
|
906
906
|
u.role && /* @__PURE__ */ n("div", { className: "text-[11px] opacity-80", children: [
|
|
907
|
-
"Role:
|
|
907
|
+
"Role:",
|
|
908
|
+
" ",
|
|
908
909
|
mt(u.role.replace(/_/g, " "))
|
|
909
910
|
] })
|
|
910
911
|
] }) })
|