@elevasis/ui 2.21.0 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/app/index.js +2 -2
  2. package/dist/{chunk-DMYELNGA.js → chunk-3HEUGBOT.js} +1 -1
  3. package/dist/{chunk-EGKNRM6P.js → chunk-7PGEGSUM.js} +2 -2
  4. package/dist/{chunk-KVW56ERD.js → chunk-AXXTN44Z.js} +5 -3
  5. package/dist/{chunk-I5WRKH25.js → chunk-D3KQAABP.js} +1 -1
  6. package/dist/{chunk-S7RL77QS.js → chunk-DDZOHLHB.js} +1 -1
  7. package/dist/{chunk-EDX6WIN3.js → chunk-EPV7NU2E.js} +24 -10
  8. package/dist/{chunk-ATEHYDL3.js → chunk-FXWETLEB.js} +6 -2
  9. package/dist/{chunk-7GG6OSD7.js → chunk-GUJUK6EH.js} +2830 -2381
  10. package/dist/{chunk-GBMNCNHX.js → chunk-KVJ3LFH2.js} +3 -1
  11. package/dist/{chunk-VQESMHQV.js → chunk-LJWV4TWV.js} +1 -2
  12. package/dist/{chunk-BJWIKEQG.js → chunk-N6WLOWOD.js} +6 -14
  13. package/dist/{chunk-XLZZOFGM.js → chunk-PTUOINQ2.js} +275 -76
  14. package/dist/{chunk-CZK67OHH.js → chunk-PXGSJNBH.js} +3 -3
  15. package/dist/{chunk-TIIPYB2Z.js → chunk-QZJM3RYI.js} +1 -1
  16. package/dist/{chunk-7YQKVWSD.js → chunk-SQ5JGELM.js} +25 -5
  17. package/dist/{chunk-RX4UWZZR.js → chunk-TKAYX2SP.js} +8 -3
  18. package/dist/{chunk-Q5HC6ENG.js → chunk-XOTJNW4Q.js} +1 -1
  19. package/dist/{chunk-LQU62KHD.js → chunk-YU6MBDVO.js} +1993 -870
  20. package/dist/{chunk-ULZ2B3NC.js → chunk-ZBCTB5CA.js} +1 -1
  21. package/dist/components/index.css +85 -85
  22. package/dist/components/index.d.ts +1651 -1388
  23. package/dist/components/index.js +253 -40
  24. package/dist/components/navigation/index.css +589 -0
  25. package/dist/components/navigation/index.js +3 -3
  26. package/dist/features/auth/index.css +2 -2
  27. package/dist/features/auth/index.d.ts +188 -10
  28. package/dist/features/crm/index.css +2 -2
  29. package/dist/features/crm/index.d.ts +193 -10
  30. package/dist/features/crm/index.js +10 -10
  31. package/dist/features/dashboard/index.css +2 -2
  32. package/dist/features/dashboard/index.js +9 -9
  33. package/dist/features/delivery/index.css +85 -85
  34. package/dist/features/delivery/index.d.ts +193 -10
  35. package/dist/features/delivery/index.js +10 -10
  36. package/dist/features/lead-gen/index.css +2 -2
  37. package/dist/features/lead-gen/index.d.ts +5 -0
  38. package/dist/features/lead-gen/index.js +10 -10
  39. package/dist/features/monitoring/index.css +85 -85
  40. package/dist/features/monitoring/index.d.ts +6 -1
  41. package/dist/features/monitoring/index.js +11 -11
  42. package/dist/features/monitoring/requests/index.css +2 -2
  43. package/dist/features/monitoring/requests/index.d.ts +5 -0
  44. package/dist/features/monitoring/requests/index.js +9 -9
  45. package/dist/features/operations/index.css +2 -2
  46. package/dist/features/operations/index.d.ts +7 -4
  47. package/dist/features/operations/index.js +12 -12
  48. package/dist/features/seo/index.d.ts +5 -0
  49. package/dist/features/settings/index.css +2 -2
  50. package/dist/features/settings/index.d.ts +214 -16
  51. package/dist/features/settings/index.js +11 -11
  52. package/dist/graph/index.css +2 -2
  53. package/dist/hooks/delivery/index.css +2 -2
  54. package/dist/hooks/delivery/index.d.ts +188 -10
  55. package/dist/hooks/index.css +85 -85
  56. package/dist/hooks/index.d.ts +1843 -1538
  57. package/dist/hooks/index.js +8 -8
  58. package/dist/hooks/published.css +85 -85
  59. package/dist/hooks/published.d.ts +1843 -1538
  60. package/dist/hooks/published.js +8 -8
  61. package/dist/index.css +12 -12
  62. package/dist/index.d.ts +346 -35
  63. package/dist/index.js +9 -9
  64. package/dist/initialization/index.d.ts +188 -10
  65. package/dist/layout/index.js +2 -2
  66. package/dist/organization/index.css +589 -0
  67. package/dist/organization/index.js +1 -1
  68. package/dist/profile/index.d.ts +188 -10
  69. package/dist/provider/index.css +384 -0
  70. package/dist/provider/index.d.ts +6 -0
  71. package/dist/provider/index.js +7 -7
  72. package/dist/provider/published.css +463 -0
  73. package/dist/provider/published.d.ts +6 -0
  74. package/dist/provider/published.js +4 -4
  75. package/dist/supabase/index.d.ts +367 -20
  76. package/dist/test-utils/index.d.ts +46 -2
  77. package/dist/test-utils/index.js +102 -1
  78. package/dist/theme/index.js +2 -2
  79. package/dist/types/index.d.ts +199 -13
  80. package/package.json +4 -4
  81. /package/dist/{chunk-6GUW5GGF.js → chunk-6Z3G4U2R.js} +0 -0
@@ -1,50 +1,51 @@
1
- import { useBreadcrumbs } from '../chunk-S7RL77QS.js';
2
- import '../chunk-6GUW5GGF.js';
3
- export { AllTasksPage, HealthStatusCard, MilestoneTimeline, ProjectDetailPage, ProjectsListPage, ProjectsSidebar, ProjectsSidebarMiddle, ProjectsSidebarTop, TaskCard, UpcomingMilestonesPage, calculateProgress, deliveryManifest, formatStatusLabel, milestoneStatusColors, noteTypeColors, projectStatusColors, taskStatusColors, taskTypeColors } from '../chunk-BJWIKEQG.js';
4
- export { LEAD_GEN_ROUTE_LINKS, LIST_TEMPLATE_OPTIONS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarMiddle, LeadGenSidebarTop, buildListConfig, getEnrichmentColor, getStatusColor, leadGenManifest, useDeleteLists } from '../chunk-CZK67OHH.js';
5
- export { ActionModal, AgentDefinitionDisplay, AgentExecutionLogs, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, CheckpointGroup, CollapsibleJsonSection, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, ConfigCard, ContentSections, ContextUsageBadge, ContractDisplay, ExecutionErrorSection, LogEntry, LogGroup, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, ResourceDefinitionSection, ResourceErrorState, ResourceFilter, ResourceHeader, ResourceNotFoundState, SessionMemory, ToolsListDisplay, WorkflowDefinitionDisplay, WorkflowExecutionLogs, getExecutionStatusConfig, getIcon, getLogLevelConfig, iconMap, operationsManifest, useNewKnowledgeMapLayout } from '../chunk-LQU62KHD.js';
1
+ import { useBreadcrumbs } from '../chunk-DDZOHLHB.js';
2
+ import '../chunk-6Z3G4U2R.js';
3
+ export { AllTasksPage, HealthStatusCard, MilestoneTimeline, ProjectDetailPage, ProjectsListPage, ProjectsSidebar, ProjectsSidebarMiddle, ProjectsSidebarTop, TaskCard, UpcomingMilestonesPage, calculateProgress, deliveryManifest, formatStatusLabel, milestoneStatusColors, noteTypeColors, projectStatusColors, taskStatusColors, taskTypeColors } from '../chunk-N6WLOWOD.js';
4
+ export { LEAD_GEN_ROUTE_LINKS, LIST_TEMPLATE_OPTIONS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarMiddle, LeadGenSidebarTop, buildListConfig, getEnrichmentColor, getStatusColor, leadGenManifest, useDeleteLists } from '../chunk-PXGSJNBH.js';
5
+ export { ActionModal, AgentDefinitionDisplay, AgentExecutionLogs, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, CheckpointGroup, CollapsibleJsonSection, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, ConfigCard, ContentSections, ContextUsageBadge, ContractDisplay, ExecutionErrorSection, LogEntry, LogGroup, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, ResourceDefinitionSection, ResourceErrorState, ResourceFilter, ResourceHeader, ResourceNotFoundState, SessionMemory, ToolsListDisplay, WorkflowDefinitionDisplay, WorkflowExecutionLogs, getExecutionStatusConfig, getIcon, getLogLevelConfig, iconMap, operationsManifest, useNewKnowledgeMapLayout } from '../chunk-YU6MBDVO.js';
6
6
  import '../chunk-ROSMICXG.js';
7
7
  import '../chunk-3JCMO7SD.js';
8
8
  import '../chunk-ZTWA5H77.js';
9
- import { BaseNode, useGraphTheme, BaseEdge, GraphBackground, GraphLegend, GraphFitViewButton } from '../chunk-EGKNRM6P.js';
10
- export { AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationEdge, AgentIterationNode, BaseEdge, BaseNode, EmptyVisualizer, ExecutionStats, ExecutionStatusBadge, FormFieldRenderer, GraphBackground, GraphContainer, GraphFitViewButton, GraphFitViewHandler, GraphLegend, RunResourceButton, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, VisualizerContainer, WorkflowExecutionTimeline, ZodFormRenderer, getGraphBackgroundStyles, useGraphBackgroundStyles, useGraphTheme } from '../chunk-EGKNRM6P.js';
9
+ import { BaseNode, useGraphTheme, BaseEdge, GraphBackground, GraphLegend, GraphFitViewButton } from '../chunk-7PGEGSUM.js';
10
+ export { AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationEdge, AgentIterationNode, BaseEdge, BaseNode, EmptyVisualizer, ExecutionStats, ExecutionStatusBadge, FormFieldRenderer, GraphBackground, GraphContainer, GraphFitViewButton, GraphFitViewHandler, GraphLegend, RunResourceButton, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, VisualizerContainer, WorkflowExecutionTimeline, ZodFormRenderer, getGraphBackgroundStyles, useGraphBackgroundStyles, useGraphTheme } from '../chunk-7PGEGSUM.js';
11
11
  import '../chunk-442LZPIR.js';
12
- import { NotificationList } from '../chunk-ATEHYDL3.js';
13
- export { ActivityCard, ActivityFilters as ActivityFiltersBar, ActivityTable, BusinessImpactCard, CostBreakdownCard, CostByModelTable, CostMetricsCard, ErrorAnalysisCard, ErrorBreakdownTable, ExecutionBreakdownTable, ExecutionHealthCard, ExecutionLogsFilters as ExecutionLogsFilterBar, ExecutionLogsTable, NotificationItem, NotificationList, monitoringManifest } from '../chunk-ATEHYDL3.js';
14
- export { ResourceHealthPanel } from '../chunk-I5WRKH25.js';
12
+ import { NotificationList } from '../chunk-FXWETLEB.js';
13
+ export { ActivityCard, ActivityFilters as ActivityFiltersBar, ActivityTable, BusinessImpactCard, CostBreakdownCard, CostByModelTable, CostMetricsCard, ErrorAnalysisCard, ErrorBreakdownTable, ExecutionBreakdownTable, ExecutionHealthCard, ExecutionLogsFilters as ExecutionLogsFilterBar, ExecutionLogsTable, NotificationItem, NotificationList, monitoringManifest } from '../chunk-FXWETLEB.js';
14
+ export { ResourceHealthPanel } from '../chunk-D3KQAABP.js';
15
15
  export { ResourceHealthChart, getHealthColor } from '../chunk-LGKLC5MG.js';
16
16
  import '../chunk-TSSKOQBX.js';
17
17
  export { SEOSidebar, SEOSidebarMiddle, SEOSidebarTop, seoManifest } from '../chunk-BIWHHWCJ.js';
18
- export { CreateCredentialModal, CredentialList, CredentialSettings, MembershipFeaturePanel, MembershipStatusBadge, OAuthConnectModal, OrganizationMembershipsList, WebhookUrlDisplayModal, settingsManifest } from '../chunk-XLZZOFGM.js';
18
+ import { showAuthError } from '../chunk-PTUOINQ2.js';
19
+ export { CreateCredentialModal, CredentialList, CredentialSettings, MembershipFeaturePanel, MembershipStatusBadge, OAuthConnectModal, OrganizationMembershipsList, WebhookUrlDisplayModal, settingsManifest, showAuthError } from '../chunk-PTUOINQ2.js';
19
20
  import { AppShellLoader } from '../chunk-M25JL54Z.js';
20
- export { ActivityFeedWidget, CrmOverview, CrmSidebar, CrmSidebarMiddle, CrmSidebarTop, DealDetailPage, DealsListPage, MetricsStrip, MyTasksPanel, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, QuickCreateActions, SAVED_VIEW_PRESETS, SavedViewsPanel, TasksDueWidget, crmManifest, useCrmPipelineSummary, useCrmQuickMetrics, useRecentCrmActivity } from '../chunk-EDX6WIN3.js';
21
+ export { ActivityFeedWidget, CrmOverview, CrmSidebar, CrmSidebarMiddle, CrmSidebarTop, DealDetailPage, DealsListPage, MetricsStrip, MyTasksPanel, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, QuickCreateActions, SAVED_VIEW_PRESETS, SavedViewsPanel, TasksDueWidget, crmManifest, useCrmPipelineSummary, useCrmQuickMetrics, useRecentCrmActivity } from '../chunk-EPV7NU2E.js';
21
22
  import '../chunk-BZZCNLT6.js';
22
23
  export { SortableHeader, TableSelectionToolbar } from '../chunk-TUMSNGTX.js';
23
24
  import '../chunk-CEWTOKE7.js';
24
25
  import '../chunk-IIMU5YAJ.js';
25
26
  import { FilterBar } from '../chunk-PDHTXPSF.js';
26
27
  export { FilterBar } from '../chunk-PDHTXPSF.js';
27
- import { CustomModal } from '../chunk-GBMNCNHX.js';
28
- export { ConfirmationInputModal, ConfirmationModal, CustomModal } from '../chunk-GBMNCNHX.js';
29
- import '../chunk-TIIPYB2Z.js';
28
+ import { CustomModal } from '../chunk-KVJ3LFH2.js';
29
+ export { ConfirmationInputModal, ConfirmationModal, CustomModal } from '../chunk-KVJ3LFH2.js';
30
+ import '../chunk-QZJM3RYI.js';
30
31
  export { CONTAINER_CONSTANTS, SHARED_VIZ_CONSTANTS } from '../chunk-E4WQGJNS.js';
31
32
  import '../chunk-7M2VOCYN.js';
32
- import { useCommandViewLayout, useUpdateApiKey, useDeleteApiKey, useCreateApiKey, useListApiKeys, usePaginationState, useActivateDeployment, useDeactivateDeployment, useDeleteDeployment, useListDeployments, useResources, useCreateSchedule, useListSchedules, usePauseSchedule, useResumeSchedule, useCancelSchedule, useDeleteSchedule, useDealNotes, useCreateDealNote, useDeals, useSyncDealStage, dealKeys, useMarkAllAsRead, useNotifications } from '../chunk-7GG6OSD7.js';
33
+ import { useCommandViewLayout, useOrganizationPermissions, useCreateOrgRole, usePermissionCatalog, useUpdateApiKey, useDeleteApiKey, useCreateApiKey, useListApiKeys, usePaginationState, useActivateDeployment, useDeactivateDeployment, useDeleteDeployment, useListDeployments, useResources, useCreateSchedule, useListSchedules, usePauseSchedule, useResumeSchedule, useCancelSchedule, useDeleteSchedule, useDealNotes, useCreateDealNote, useDeals, useTransitionItem, dealKeys, useMarkAllAsRead, useNotifications } from '../chunk-GUJUK6EH.js';
33
34
  import '../chunk-BRXELOHC.js';
34
35
  import '../chunk-QSTH6T77.js';
35
- import { showErrorNotification, showSuccessNotification, showApiErrorNotification } from '../chunk-Z6FAH4XV.js';
36
+ import { showSuccessNotification, showErrorNotification, showApiErrorNotification } from '../chunk-Z6FAH4XV.js';
36
37
  export { showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification } from '../chunk-Z6FAH4XV.js';
37
38
  import { Graph_module_css_default, useDirectedChainHighlighting, useNodeSelection, GRAPH_CONSTANTS } from '../chunk-22UVE3RA.js';
38
39
  export { Graph_module_css_default as graphStyles } from '../chunk-22UVE3RA.js';
39
40
  import '../chunk-3ZMAGTWF.js';
40
- import '../chunk-ULZ2B3NC.js';
41
- import '../chunk-DMYELNGA.js';
42
- import '../chunk-Q5HC6ENG.js';
41
+ import '../chunk-ZBCTB5CA.js';
42
+ import '../chunk-3HEUGBOT.js';
43
+ import '../chunk-XOTJNW4Q.js';
43
44
  import '../chunk-WLOQ4IBG.js';
44
- import '../chunk-KVW56ERD.js';
45
+ import '../chunk-AXXTN44Z.js';
45
46
  import '../chunk-LVUCBY7X.js';
46
- import '../chunk-VQESMHQV.js';
47
- import { SubshellContentContainer } from '../chunk-RX4UWZZR.js';
47
+ import '../chunk-LJWV4TWV.js';
48
+ import { SubshellContentContainer } from '../chunk-TKAYX2SP.js';
48
49
  import { ListSkeleton, EmptyState, PageTitleCaption, StatCard, CenteredErrorState, CardHeader, ActivityTimeline } from '../chunk-XUYBOO32.js';
49
50
  export { APIErrorAlert, ActivityTimeline, CardHeader, CenteredErrorState, CollapsibleSection, ContextViewer, CustomSelector, DetailCardSkeleton, EmptyState, FeatureUnavailableState, GlowDot, JsonViewer, ListSkeleton, PageNotFound, PageTitleCaption, ResourceCard, StatCard, StatCardSkeleton, StatsCardSkeleton, StatusBadge, TabCountBadge, TimeRangeSelector, TrendIndicator, catalogItemToResourceDefinition } from '../chunk-XUYBOO32.js';
50
51
  export { ElevasisLoader } from '../chunk-SZHARWKU.js';
@@ -53,7 +54,7 @@ export { NavigationButton } from '../chunk-NYBEU5TE.js';
53
54
  import '../chunk-T6INEVX6.js';
54
55
  import '../chunk-2IFYDILW.js';
55
56
  import { useRouterContext } from '../chunk-Q7DJKLEN.js';
56
- import '../chunk-7YQKVWSD.js';
57
+ export { RoleBadge } from '../chunk-SQ5JGELM.js';
57
58
  import '../chunk-6IA2OMAE.js';
58
59
  import { useAppearance } from '../chunk-QJ2KCHKX.js';
59
60
  import '../chunk-HQ7M6PBW.js';
@@ -68,14 +69,15 @@ import '../chunk-QHSW4WHM.js';
68
69
  import { useElevasisServices } from '../chunk-IRW7JMQ4.js';
69
70
  import '../chunk-BRJ3QZ4E.js';
70
71
  import '../chunk-I2KLQ2HA.js';
71
- import { Stack, Group, ThemeIcon, Text, Badge, Box, Title, TextInput, Alert, Button, Table, Tooltip, ActionIcon, Paper, Code, CopyButton, SimpleGrid, Loader, Pagination, SegmentedControl, Switch, Select, Textarea, Divider, Card, Menu, Timeline, Tabs, ScrollArea, Breadcrumbs as Breadcrumbs$1, Drawer, Center, Popover, Indicator } from '@mantine/core';
72
- import { useDisclosure } from '@mantine/hooks';
73
- import { IconBrain, IconDatabase, IconMessage, IconAlertCircle, IconCircleX, IconCircleCheck, IconBolt, IconHandClick, IconClock, IconWebhook, IconExternalLink, IconPencil, IconKey, IconCalendar, IconTrash, IconAlertTriangle, IconExclamationMark, IconShieldLock, IconCheck, IconCopy, IconPlus, IconRocket, IconRefresh, IconPower, IconPlayerPlay, IconTag, IconCalendarRepeat, IconCalendarEvent, IconCalendarTime, IconRobot, IconGitBranch, IconSettings, IconDotsVertical, IconPlayerPause, IconPlayerStop, IconCalendarDue, IconCalendarStats, IconCalendarOff, IconListCheck, IconBell } from '@tabler/icons-react';
74
- import { useQueryClient, useQuery } from '@tanstack/react-query';
75
- import { memo, forwardRef, useMemo, useImperativeHandle, useState, useEffect, useCallback, useRef } from 'react';
76
72
  import * as runtime from 'react/jsx-runtime';
77
73
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
74
+ import { Stack, Group, ThemeIcon, Text, Badge, Box, Card, Title, Checkbox, Tooltip, Center, TextInput, Textarea, Loader, Alert, Button, Table, ActionIcon, Paper, Code, CopyButton, SimpleGrid, Pagination, SegmentedControl, Switch, Select, Divider, Menu, Timeline, Tabs, ScrollArea, Breadcrumbs as Breadcrumbs$1, Drawer, Popover, Indicator } from '@mantine/core';
75
+ import { IconBrain, IconDatabase, IconMessage, IconAlertCircle, IconCircleX, IconCircleCheck, IconBolt, IconHandClick, IconClock, IconWebhook, IconExternalLink, IconLock, IconPencil, IconKey, IconCalendar, IconTrash, IconAlertTriangle, IconExclamationMark, IconShieldLock, IconCheck, IconCopy, IconPlus, IconRocket, IconRefresh, IconPower, IconPlayerPlay, IconTag, IconCalendarRepeat, IconCalendarEvent, IconCalendarTime, IconRobot, IconGitBranch, IconSettings, IconDotsVertical, IconPlayerPause, IconPlayerStop, IconCalendarDue, IconCalendarStats, IconCalendarOff, IconListCheck, IconBell } from '@tabler/icons-react';
78
76
  import { useForm } from '@mantine/form';
77
+ import { memo, forwardRef, useMemo, useImperativeHandle, useRef, useEffect, useState, useCallback } from 'react';
78
+ import { z } from 'zod';
79
+ import { useDisclosure } from '@mantine/hooks';
80
+ import { useQueryClient, useQuery } from '@tanstack/react-query';
79
81
  import { useReactFlow, ReactFlow, ReactFlowProvider } from '@xyflow/react';
80
82
  import '@xyflow/react/dist/style.css';
81
83
  import { Link, RichTextEditor as RichTextEditor$1 } from '@mantine/tiptap';
@@ -85,6 +87,210 @@ import StarterKit from '@tiptap/starter-kit';
85
87
  import { Prism } from 'react-syntax-highlighter';
86
88
  import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
87
89
 
90
+ function Can({ permission, fallback = null, children }) {
91
+ const { hasPermission, isReady } = useOrganizationPermissions();
92
+ if (!isReady) return null;
93
+ return hasPermission(permission) ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsx(Fragment, { children: fallback });
94
+ }
95
+ function groupByDomain(catalog) {
96
+ const groups = /* @__PURE__ */ new Map();
97
+ for (const row of catalog) {
98
+ const domain = row.key.split(".")[0] ?? row.key;
99
+ const existing = groups.get(domain);
100
+ if (existing) {
101
+ existing.push(row);
102
+ } else {
103
+ groups.set(domain, [row]);
104
+ }
105
+ }
106
+ return groups;
107
+ }
108
+ var DOMAIN_LABELS = {
109
+ org: "Organization",
110
+ members: "Members",
111
+ roles: "Roles",
112
+ secrets: "Secrets",
113
+ operations: "Operations",
114
+ work: "Work"
115
+ };
116
+ function domainLabel(domain) {
117
+ return DOMAIN_LABELS[domain] ?? domain.charAt(0).toUpperCase() + domain.slice(1);
118
+ }
119
+ function PermissionMatrix({ catalog, selectedKeys, onChange, systemLocked }) {
120
+ const groups = groupByDomain(catalog);
121
+ const isDisplayOnly = !onChange || systemLocked;
122
+ function handleToggle(key, checked) {
123
+ if (!onChange || systemLocked) return;
124
+ if (checked) {
125
+ onChange([...selectedKeys, key]);
126
+ } else {
127
+ onChange(selectedKeys.filter((k) => k !== key));
128
+ }
129
+ }
130
+ return /* @__PURE__ */ jsx(Stack, { gap: "md", children: Array.from(groups.entries()).map(([domain, rows]) => /* @__PURE__ */ jsxs(Card, { withBorder: true, padding: "md", children: [
131
+ /* @__PURE__ */ jsx(Title, { order: 5, mb: "sm", style: { textTransform: "capitalize" }, children: domainLabel(domain) }),
132
+ /* @__PURE__ */ jsx(Stack, { gap: "xs", children: rows.map((row) => {
133
+ const isLocked = !row.isOrgGrantable;
134
+ const isChecked = selectedKeys.includes(row.key);
135
+ const isDisabled = isDisplayOnly || isLocked;
136
+ const checkbox = /* @__PURE__ */ jsx(
137
+ Checkbox,
138
+ {
139
+ checked: isChecked,
140
+ disabled: isDisabled,
141
+ onChange: (e) => handleToggle(row.key, e.currentTarget.checked),
142
+ label: /* @__PURE__ */ jsxs(Group, { gap: 6, wrap: "nowrap", children: [
143
+ /* @__PURE__ */ jsx(Text, { size: "sm", ff: "monospace", c: isLocked ? "var(--color-text-subtle)" : void 0, children: row.key }),
144
+ isLocked && /* @__PURE__ */ jsx(IconLock, { size: 14, style: { color: "var(--color-text-subtle)", flexShrink: 0 } }),
145
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: row.description })
146
+ ] })
147
+ },
148
+ row.key
149
+ );
150
+ if (isLocked) {
151
+ return /* @__PURE__ */ jsx(Tooltip, { label: "Reserved for built-in roles", position: "right", children: /* @__PURE__ */ jsx("div", { children: checkbox }) }, row.key);
152
+ }
153
+ return checkbox;
154
+ }) })
155
+ ] }, domain)) });
156
+ }
157
+ function NoAccessState() {
158
+ return /* @__PURE__ */ jsx(Center, { style: { flex: 1, minHeight: "100%", width: "100%", padding: 24 }, children: /* @__PURE__ */ jsxs(Stack, { align: "center", gap: "xs", style: { maxWidth: 480, textAlign: "center" }, children: [
159
+ /* @__PURE__ */ jsx(IconLock, { size: 44, stroke: 1.8, color: "var(--color-text-subtle)" }),
160
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "Access restricted" }),
161
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "You don't have permission to view this page. Contact an org admin if you need access." })
162
+ ] }) });
163
+ }
164
+ var CreateRoleFormSchema = z.object({
165
+ name: z.string().trim().min(2).max(50),
166
+ slug: z.string().regex(/^[a-z0-9-]+$/, "lowercase, numbers, dashes only").min(2).max(50),
167
+ description: z.string().max(200).optional(),
168
+ permissionKeys: z.array(z.string())
169
+ });
170
+ function toSlug(name) {
171
+ return name.toLowerCase().replace(/\s+/g, "-");
172
+ }
173
+ var nameSchema = CreateRoleFormSchema.shape.name;
174
+ var slugSchema = CreateRoleFormSchema.shape.slug;
175
+ var descriptionSchema = z.string().max(200);
176
+ function extractError(result) {
177
+ return result.error.issues[0]?.message ?? "Invalid value";
178
+ }
179
+ function CreateRoleModal({ opened, onClose, onCreated }) {
180
+ const createMutation = useCreateOrgRole();
181
+ const catalog = usePermissionCatalog();
182
+ const slugDirtyRef = useRef(false);
183
+ const form = useForm({
184
+ initialValues: {
185
+ name: "",
186
+ slug: "",
187
+ description: "",
188
+ permissionKeys: []
189
+ },
190
+ validate: {
191
+ name: (value) => {
192
+ const r = nameSchema.safeParse(value);
193
+ return r.success ? null : extractError(r);
194
+ },
195
+ slug: (value) => {
196
+ const r = slugSchema.safeParse(value);
197
+ return r.success ? null : extractError(r);
198
+ },
199
+ description: (value) => {
200
+ if (!value) return null;
201
+ const r = descriptionSchema.safeParse(value);
202
+ return r.success ? null : extractError(r);
203
+ },
204
+ permissionKeys: () => null
205
+ }
206
+ });
207
+ useEffect(() => {
208
+ if (!slugDirtyRef.current) {
209
+ form.setFieldValue("slug", toSlug(form.values.name));
210
+ }
211
+ }, [form.values.name]);
212
+ const handleSlugChange = (e) => {
213
+ slugDirtyRef.current = true;
214
+ form.setFieldValue("slug", e.currentTarget.value);
215
+ };
216
+ const handleClose = () => {
217
+ if (!createMutation.isPending) {
218
+ form.reset();
219
+ slugDirtyRef.current = false;
220
+ onClose();
221
+ }
222
+ };
223
+ const onSubmit = form.onSubmit(async (values) => {
224
+ try {
225
+ const role = await createMutation.mutateAsync({
226
+ name: values.name,
227
+ slug: values.slug,
228
+ description: values.description || void 0,
229
+ permissionKeys: values.permissionKeys
230
+ });
231
+ showSuccessNotification(`Role "${role.name}" created.`);
232
+ onCreated?.(role.id);
233
+ handleClose();
234
+ } catch (err) {
235
+ showAuthError(err);
236
+ }
237
+ });
238
+ const grantableCatalog = (catalog.data?.permissions ?? []).filter((p) => p.isOrgGrantable);
239
+ return /* @__PURE__ */ jsx(CustomModal, { opened, onClose: handleClose, size: "lg", loading: createMutation.isPending, children: /* @__PURE__ */ jsx("form", { onSubmit, children: /* @__PURE__ */ jsxs(Stack, { p: "md", gap: "md", children: [
240
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "Create custom role" }),
241
+ /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
242
+ /* @__PURE__ */ jsx(
243
+ TextInput,
244
+ {
245
+ label: "Display name",
246
+ placeholder: "e.g. Content Editor",
247
+ required: true,
248
+ disabled: createMutation.isPending,
249
+ ...form.getInputProps("name")
250
+ }
251
+ ),
252
+ /* @__PURE__ */ jsx(
253
+ TextInput,
254
+ {
255
+ label: "Slug",
256
+ placeholder: "e.g. content-editor",
257
+ description: "Lowercase letters, numbers, and dashes only",
258
+ required: true,
259
+ disabled: createMutation.isPending,
260
+ ...form.getInputProps("slug"),
261
+ onChange: handleSlugChange
262
+ }
263
+ ),
264
+ /* @__PURE__ */ jsx(
265
+ Textarea,
266
+ {
267
+ label: "Description",
268
+ placeholder: "Optional description",
269
+ minRows: 2,
270
+ disabled: createMutation.isPending,
271
+ ...form.getInputProps("description")
272
+ }
273
+ )
274
+ ] }),
275
+ /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
276
+ /* @__PURE__ */ jsx(Title, { order: 5, children: "Permissions" }),
277
+ catalog.isLoading && /* @__PURE__ */ jsx(Loader, { size: "sm" }),
278
+ catalog.isError && /* @__PURE__ */ jsx(Alert, { color: "red", children: /* @__PURE__ */ jsx(Text, { size: "sm", children: "Failed to load permission catalog. Please close and try again." }) }),
279
+ !catalog.isLoading && !catalog.isError && /* @__PURE__ */ jsx(
280
+ PermissionMatrix,
281
+ {
282
+ catalog: grantableCatalog,
283
+ selectedKeys: form.values.permissionKeys,
284
+ onChange: (keys) => form.setFieldValue("permissionKeys", keys)
285
+ }
286
+ )
287
+ ] }),
288
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
289
+ /* @__PURE__ */ jsx(Button, { variant: "default", onClick: handleClose, disabled: createMutation.isPending, children: "Cancel" }),
290
+ /* @__PURE__ */ jsx(Button, { type: "submit", loading: createMutation.isPending, children: "Create role" })
291
+ ] })
292
+ ] }) }) });
293
+ }
88
294
  function EditApiKeyModal({ apiKey, onClose }) {
89
295
  const [name, setName] = useState("");
90
296
  const [nameError, setNameError] = useState(null);
@@ -3080,7 +3286,7 @@ function DealKanbanCard({ deal, config, onClick, onDragStart, onDragEnd }) {
3080
3286
  const companyName = deal.contact?.company?.name || deal.discovery_data?.company || deal.contact_email?.split("@")[1] || null;
3081
3287
  const hasInitialFee = typeof deal.initial_fee === "number" && deal.initial_fee > 0;
3082
3288
  const hasMonthlyFee = typeof deal.monthly_fee === "number" && deal.monthly_fee > 0;
3083
- const stageColor = (deal.cached_stage ? config[deal.cached_stage]?.color : null) ?? "gray";
3289
+ const stageColor = (deal.stage_key ? config[deal.stage_key]?.color : null) ?? "gray";
3084
3290
  return /* @__PURE__ */ jsx(
3085
3291
  Paper,
3086
3292
  {
@@ -3130,7 +3336,7 @@ function DealDrawer({ deal, config, opened, onClose, renderActions }) {
3130
3336
  const displayName = contactName || deal.contact_email || "Unknown";
3131
3337
  const email = deal.contact?.email || deal.contact_email || null;
3132
3338
  const companyName = deal.contact?.company?.name || deal.discovery_data?.company || null;
3133
- const stage = deal.cached_stage;
3339
+ const stage = deal.stage_key;
3134
3340
  const badgeColor = (stage ? config?.[stage]?.color : null) ?? "gray";
3135
3341
  const activityLog = deal.activity_log || [];
3136
3342
  const hasInitialFee = typeof deal.initial_fee === "number" && deal.initial_fee > 0;
@@ -3252,7 +3458,7 @@ function groupDealsByStage(deals, columns) {
3252
3458
  const map = /* @__PURE__ */ new Map();
3253
3459
  for (const stage of columns) map.set(stage, []);
3254
3460
  for (const deal of deals) {
3255
- const key = deal.cached_stage ?? UNSTAGED_KEY;
3461
+ const key = deal.stage_key ?? UNSTAGED_KEY;
3256
3462
  const bucket = map.get(key);
3257
3463
  if (bucket) {
3258
3464
  bucket.push(deal);
@@ -3263,18 +3469,25 @@ function groupDealsByStage(deals, columns) {
3263
3469
  return map;
3264
3470
  }
3265
3471
  function KanbanBoard({ config, renderDrawerActions }) {
3266
- const { data: deals, total, isLoading, error } = useDeals({
3472
+ const {
3473
+ data: deals,
3474
+ total,
3475
+ isLoading,
3476
+ error
3477
+ } = useDeals({
3267
3478
  limit: KANBAN_FETCH_LIMIT,
3268
3479
  offset: 0
3269
3480
  });
3270
- const syncStage = useSyncDealStage();
3481
+ const transitionItem = useTransitionItem();
3271
3482
  const queryClient = useQueryClient();
3272
3483
  const [selectedDeal, setSelectedDeal] = useState(null);
3273
3484
  const [drawerOpen, setDrawerOpen] = useState(false);
3274
3485
  const [dragOverColumn, setDragOverColumn] = useState(null);
3275
3486
  const draggingDealRef = useRef(null);
3276
3487
  const resolvedConfig = config ?? {};
3277
- const configuredStages = Object.keys(resolvedConfig).filter((stage) => Boolean(resolvedConfig[stage]));
3488
+ const configuredStages = Object.keys(resolvedConfig).filter(
3489
+ (stage) => Boolean(resolvedConfig[stage])
3490
+ );
3278
3491
  const columns = [...configuredStages, UNSTAGED_KEY];
3279
3492
  const hasConfig = configuredStages.length > 0;
3280
3493
  const groupedDeals = groupDealsByStage(deals ?? [], columns);
@@ -3303,17 +3516,17 @@ function KanbanBoard({ config, renderDrawerActions }) {
3303
3516
  const deal = draggingDealRef.current;
3304
3517
  draggingDealRef.current = null;
3305
3518
  if (!deal) return;
3306
- if (deal.cached_stage === targetStage) return;
3519
+ if (deal.stage_key === targetStage) return;
3307
3520
  queryClient.setQueriesData({ queryKey: dealKeys.lists() }, (old) => {
3308
3521
  if (!old) return old;
3309
3522
  return {
3310
3523
  ...old,
3311
- data: old.data.map((d) => d.id === deal.id ? { ...d, cached_stage: targetStage } : d)
3524
+ data: old.data.map((d) => d.id === deal.id ? { ...d, stage_key: targetStage } : d)
3312
3525
  };
3313
3526
  });
3314
- syncStage.mutate({ dealId: deal.id, stage: targetStage });
3527
+ transitionItem.mutate({ dealId: deal.id, pipelineKey: "default", stageKey: targetStage });
3315
3528
  },
3316
- [queryClient, syncStage]
3529
+ [queryClient, transitionItem]
3317
3530
  );
3318
3531
  const handleDragEnd = useCallback(() => {
3319
3532
  draggingDealRef.current = null;
@@ -3489,4 +3702,4 @@ function NotificationBell({ unreadCount, onNavigate }) {
3489
3702
  ] });
3490
3703
  }
3491
3704
 
3492
- export { AbsoluteScheduleForm, ApiKeyDisplayModal, ApiKeyList, ApiKeySettings, Breadcrumbs, CommandViewEdge, CommandViewGraph, CommandViewNode, CrashErrorFallback, CreateApiKeyModal, CreateScheduleModal, DEAL_STAGES, DEFAULT_KANBAN_CONFIG, DealDrawer, DealKanbanCard, DeleteScheduleModal, DeploymentDetailModal, DeploymentList, DeploymentSettings, DeploymentStatusBadge, EditApiKeyModal, ErrorReportCard, KanbanBoard, MdxRenderer, NotificationBell, NotificationPanel, RecurringScheduleForm, RelativeScheduleForm, RichTextEditor, ScheduleCard, ScheduleDetailModal, ScheduleTypeSelector, TaskScheduler, buildErrorReport, mdxComponents };
3705
+ export { AbsoluteScheduleForm, ApiKeyDisplayModal, ApiKeyList, ApiKeySettings, Breadcrumbs, Can, CommandViewEdge, CommandViewGraph, CommandViewNode, CrashErrorFallback, CreateApiKeyModal, CreateRoleModal, CreateScheduleModal, DEAL_STAGES, DEFAULT_KANBAN_CONFIG, DealDrawer, DealKanbanCard, DeleteScheduleModal, DeploymentDetailModal, DeploymentList, DeploymentSettings, DeploymentStatusBadge, EditApiKeyModal, ErrorReportCard, KanbanBoard, MdxRenderer, NoAccessState, NotificationBell, NotificationPanel, PermissionMatrix, RecurringScheduleForm, RelativeScheduleForm, RichTextEditor, ScheduleCard, ScheduleDetailModal, ScheduleTypeSelector, TaskScheduler, buildErrorReport, mdxComponents };