@elevasis/ui 2.34.0 → 2.36.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 (116) hide show
  1. package/dist/api/index.js +3 -3
  2. package/dist/app/index.d.ts +37 -30
  3. package/dist/app/index.js +25 -23
  4. package/dist/charts/index.js +3 -5
  5. package/dist/{chunk-ND5TDV2J.js → chunk-57OZ3AEG.js} +1 -1
  6. package/dist/{chunk-E4WQGJNS.js → chunk-7FPLLSHN.js} +14 -1
  7. package/dist/{chunk-RQA2EVN3.js → chunk-AKW7KISS.js} +39 -3
  8. package/dist/chunk-AUDNF2Q7.js +2050 -0
  9. package/dist/chunk-F6EFC2MJ.js +41101 -0
  10. package/dist/{chunk-TYRUKGGD.js → chunk-GX6XBRRF.js} +1 -2
  11. package/dist/{chunk-RIAXZ6AH.js → chunk-K4UZU3TU.js} +2 -2
  12. package/dist/{chunk-V6SZ4ECN.js → chunk-LUYVRATI.js} +257 -6
  13. package/dist/{chunk-DTFKWZ7A.js → chunk-O2Q4VMRN.js} +589 -932
  14. package/dist/{chunk-X4WBGKJQ.js → chunk-R3VCBZDC.js} +50 -3
  15. package/dist/chunk-SIQ3P4OR.js +1764 -0
  16. package/dist/{chunk-3FV6HBXS.js → chunk-WF7CONXF.js} +23 -23
  17. package/dist/{chunk-3QXJK5IY.js → chunk-YYX7OPZQ.js} +1 -1
  18. package/dist/components/index.d.ts +74 -71
  19. package/dist/components/index.js +20 -2795
  20. package/dist/components/navigation/index.js +25 -5
  21. package/dist/execution/index.d.ts +11 -11
  22. package/dist/execution/index.js +1 -2
  23. package/dist/features/auth/index.d.ts +3 -0
  24. package/dist/features/auth/index.js +23 -2
  25. package/dist/features/clients/index.js +20 -26
  26. package/dist/features/crm/index.d.ts +3 -0
  27. package/dist/features/crm/index.js +20 -30
  28. package/dist/features/dashboard/index.d.ts +69 -69
  29. package/dist/features/dashboard/index.js +20 -28
  30. package/dist/features/delivery/index.d.ts +3 -0
  31. package/dist/features/delivery/index.js +20 -30
  32. package/dist/features/knowledge/index.js +25 -9
  33. package/dist/features/lead-gen/index.d.ts +295 -57
  34. package/dist/features/lead-gen/index.js +20 -31
  35. package/dist/features/monitoring/index.js +20 -30
  36. package/dist/features/monitoring/requests/index.js +20 -25
  37. package/dist/features/operations/index.d.ts +183 -183
  38. package/dist/features/operations/index.js +18 -37
  39. package/dist/features/seo/index.js +3 -4
  40. package/dist/features/settings/index.d.ts +3 -0
  41. package/dist/features/settings/index.js +20 -27
  42. package/dist/graph/index.js +1 -1
  43. package/dist/hooks/delivery/index.d.ts +3 -0
  44. package/dist/hooks/delivery/index.js +30 -2
  45. package/dist/hooks/index.d.ts +112 -99
  46. package/dist/hooks/index.js +20 -21
  47. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +46 -46
  48. package/dist/hooks/published.d.ts +112 -99
  49. package/dist/hooks/published.js +20 -20
  50. package/dist/index.css +532 -532
  51. package/dist/index.d.ts +9385 -5915
  52. package/dist/index.js +22 -26
  53. package/dist/initialization/index.d.ts +3 -0
  54. package/dist/knowledge/index.d.ts +42 -42
  55. package/dist/knowledge/index.js +10 -17
  56. package/dist/{knowledge-search-index-ORIJCEZX.js → knowledge-search-index-NBCTFIOH.js} +2 -2
  57. package/dist/layout/index.js +4 -10
  58. package/dist/organization/index.js +27 -1
  59. package/dist/profile/index.d.ts +3 -0
  60. package/dist/provider/index.d.ts +72 -39
  61. package/dist/provider/index.js +20 -15
  62. package/dist/provider/published.d.ts +40 -34
  63. package/dist/provider/published.js +20 -11
  64. package/dist/sse/index.js +26 -5
  65. package/dist/supabase/index.d.ts +6 -0
  66. package/dist/test-utils/index.js +3 -3
  67. package/dist/theme/index.js +2 -3
  68. package/dist/theme/presets/index.d.ts +28 -3
  69. package/dist/theme/presets/index.js +1 -1
  70. package/dist/typeform/index.js +1 -2049
  71. package/dist/types/index.d.ts +82 -79
  72. package/dist/utils/index.d.ts +47 -47
  73. package/dist/utils/index.js +1 -1
  74. package/dist/zustand/index.d.ts +6 -6
  75. package/dist/zustand/index.js +0 -3
  76. package/package.json +5 -5
  77. package/dist/chunk-3AJVNMY5.js +0 -4769
  78. package/dist/chunk-3MEXPLWT.js +0 -265
  79. package/dist/chunk-3ZMAGTWF.js +0 -18
  80. package/dist/chunk-4O4MII5S.js +0 -4716
  81. package/dist/chunk-5EYJ2GIN.js +0 -122
  82. package/dist/chunk-7M2VOCYN.js +0 -1
  83. package/dist/chunk-BPQVTIUP.js +0 -105
  84. package/dist/chunk-BZZCNLT6.js +0 -12
  85. package/dist/chunk-CLDCYJQT.js +0 -1
  86. package/dist/chunk-E565XMTQ.js +0 -17
  87. package/dist/chunk-HRWLKKWM.js +0 -758
  88. package/dist/chunk-IGDYWFNE.js +0 -5198
  89. package/dist/chunk-IIMU5YAJ.js +0 -53
  90. package/dist/chunk-IVGI4GDL.js +0 -1593
  91. package/dist/chunk-JFL3GRD4.js +0 -39
  92. package/dist/chunk-LAWLB6CT.js +0 -951
  93. package/dist/chunk-LGKLC5MG.js +0 -44
  94. package/dist/chunk-LRWTWOGP.js +0 -1778
  95. package/dist/chunk-MP3GPBPX.js +0 -1874
  96. package/dist/chunk-N55DVMAG.js +0 -14
  97. package/dist/chunk-NLBQTDOW.js +0 -12051
  98. package/dist/chunk-O6JXQ6UQ.js +0 -468
  99. package/dist/chunk-OBBQ2JCM.js +0 -68
  100. package/dist/chunk-PDHTXPSF.js +0 -12
  101. package/dist/chunk-PLP3NYPL.js +0 -356
  102. package/dist/chunk-R2XR4FCV.js +0 -48
  103. package/dist/chunk-R66W5UDG.js +0 -26
  104. package/dist/chunk-RYTEQBAO.js +0 -37
  105. package/dist/chunk-SDXSB3HN.js +0 -425
  106. package/dist/chunk-TKAYX2SP.js +0 -204
  107. package/dist/chunk-TUMSNGTX.js +0 -35
  108. package/dist/chunk-VNAZTCHA.js +0 -65
  109. package/dist/chunk-VNFR57DF.js +0 -87
  110. package/dist/chunk-VTXTZXAU.js +0 -539
  111. package/dist/chunk-W73ZABT6.js +0 -85
  112. package/dist/chunk-WU4FNWCW.js +0 -2281
  113. package/dist/chunk-XZGSCABI.js +0 -383
  114. package/dist/chunk-YNWZIWJL.js +0 -1863
  115. /package/dist/{chunk-2RJMVWFJ.js → chunk-GEFWMU26.js} +0 -0
  116. /package/dist/{chunk-22UVE3RA.js → chunk-HENXLGVD.js} +0 -0
@@ -1,468 +0,0 @@
1
- import { devOnlyFor, requiresAdminFor, topLevel, parentOf, ancestorsOf, childrenOf, findById, findByPath, listAllSystems, defaultPathFor, getSortedSidebarEntries, getSemanticIconComponent } from './chunk-DTFKWZ7A.js';
2
- import { useInitialization } from './chunk-533DUEQY.js';
3
- import { useOrganization } from './chunk-DD3CCMCZ.js';
4
- import { createContext, useMemo, useCallback, useContext } from 'react';
5
- import { jsx } from 'react/jsx-runtime';
6
-
7
- function createFeatureAccessHook({
8
- useInitialization: useInitialization2,
9
- useOrganization: useOrganization2
10
- }) {
11
- return function useFeatureAccess2() {
12
- const { profile, organizationReady } = useInitialization2();
13
- const { currentMembership } = useOrganization2();
14
- const { orgConfig, membershipConfig } = useMemo(() => {
15
- const organizationConfig = currentMembership?.organization?.config;
16
- const memberConfig = currentMembership?.config;
17
- return { orgConfig: organizationConfig, membershipConfig: memberConfig };
18
- }, [currentMembership]);
19
- const userConfig = profile?.config;
20
- const checkFeature = useCallback(
21
- (featureKey) => {
22
- if (profile?.is_platform_admin) {
23
- return { allowed: true, restrictedBy: null };
24
- }
25
- const membershipValue = membershipConfig?.features?.[featureKey];
26
- if (membershipValue === false) return { allowed: false, restrictedBy: "membership" };
27
- return { allowed: true, restrictedBy: null };
28
- },
29
- [profile?.is_platform_admin, membershipConfig]
30
- );
31
- const hasFeature = useCallback((featureKey) => checkFeature(featureKey).allowed, [checkFeature]);
32
- return {
33
- orgConfig,
34
- membershipConfig,
35
- userConfig,
36
- hasFeature,
37
- checkFeature,
38
- isReady: organizationReady
39
- };
40
- };
41
- }
42
-
43
- // src/provider/resolvers/RouteResolver.ts
44
- function normalizeRoutePath(path) {
45
- const trimmedPath = path.trim();
46
- if (!trimmedPath || trimmedPath === "/") {
47
- return "/";
48
- }
49
- return trimmedPath.replace(/\/+$/, "") || "/";
50
- }
51
- function isRouteMatch(currentPath, route) {
52
- const normalizedCurrentPath = normalizeRoutePath(currentPath);
53
- const normalizedRoute = normalizeRoutePath(route);
54
- return normalizedCurrentPath === normalizedRoute || normalizedCurrentPath.startsWith(`${normalizedRoute}/`);
55
- }
56
-
57
- // src/provider/resolvers/NavResolver.ts
58
- function uniqueIds(ids) {
59
- return ids ? [...new Set(ids)] : [];
60
- }
61
-
62
- // src/provider/validateManifests.ts
63
- function listSystemRefs(systems) {
64
- const refs = [];
65
- function walk(map, prefix = "") {
66
- for (const [key, system] of Object.entries(map)) {
67
- const path = prefix ? `${prefix}.${key}` : key;
68
- refs.push(path, system.id);
69
- const subsystems = system.subsystems;
70
- if (subsystems) {
71
- walk(subsystems, path);
72
- }
73
- }
74
- }
75
- walk(systems);
76
- return refs;
77
- }
78
- function validateManifests(manifests, organizationModel) {
79
- if (!organizationModel) {
80
- return;
81
- }
82
- const validSystemIds = /* @__PURE__ */ new Set([
83
- ...Object.keys(organizationModel.systems ?? {}),
84
- ...listSystemRefs(organizationModel.systems ?? {})
85
- ]);
86
- const errors = [];
87
- for (const manifest of manifests) {
88
- const key = manifest.key;
89
- const systemId = manifest.systemId;
90
- if (!systemId) {
91
- continue;
92
- }
93
- if (!validSystemIds.has(systemId)) {
94
- errors.push(
95
- `Manifest "${key}": systemId "${systemId}" is not a known system id. Valid values: ${[...validSystemIds].sort().join(", ")}`
96
- );
97
- }
98
- }
99
- if (errors.length > 0) {
100
- throw new Error(
101
- `System manifest validation failed with ${errors.length} error(s):
102
- ` + errors.map((e, i) => ` ${i + 1}. ${e}`).join("\n")
103
- );
104
- }
105
- }
106
- var ElevasisSystemsContext = createContext(null);
107
-
108
- // src/provider/sidebarProjection.ts
109
- function isLifecycleEnabled(system) {
110
- if (system.enabled === false) return false;
111
- return system.lifecycle !== "deprecated" && system.lifecycle !== "archived";
112
- }
113
- function isSystemAccessible(systemId, context) {
114
- const system = context.shellModel.findById(systemId);
115
- if (!system || !isLifecycleEnabled(system)) return false;
116
- if (!context.isSystemEnabled(systemId)) return false;
117
- if (context.shellModel.requiresAdminFor(systemId) && !context.isPlatformAdmin) return false;
118
- if (context.shellModel.devOnlyFor(systemId) && !context.isDev) return false;
119
- return true;
120
- }
121
- function isSurfaceAccessible(node, context) {
122
- if (node.devOnly && !context.isDev) return false;
123
- if (node.requiresAdmin && !context.isPlatformAdmin) return false;
124
- const systemTargets = node.targets?.systems ?? [];
125
- if (systemTargets.length === 0) return true;
126
- return systemTargets.some((systemId) => isSystemAccessible(systemId, context));
127
- }
128
- function iconForNode(node, context) {
129
- if (node.type === "surface") {
130
- const targetIcon = node.targets?.systems?.map((systemId) => context.shellModel.findById(systemId)?.iconComponent).find(Boolean);
131
- if (targetIcon) return targetIcon;
132
- }
133
- return getSemanticIconComponent(node.icon);
134
- }
135
- function activeMatchPathsForSurface(node, context) {
136
- const targets = node.targets?.systems ?? [];
137
- if (targets.length !== 1) return void 0;
138
- const paths = context.shellModel.childrenOf(targets[0]).map((child) => child.path).filter((path) => Boolean(path && path !== node.path));
139
- return paths.length > 0 ? [...new Set(paths)] : void 0;
140
- }
141
- function surfaceToLinkItem(node, context, siblings) {
142
- if (!isSurfaceAccessible(node, context)) return void 0;
143
- const siblingShadows = siblings.some((sibling) => sibling !== node && sibling.path.startsWith(`${node.path}/`));
144
- const activeMatchPaths = activeMatchPathsForSurface(node, context);
145
- return {
146
- label: node.label,
147
- link: node.path,
148
- ...siblingShadows ? { exact: true } : {},
149
- ...activeMatchPaths ? { activeMatchPaths } : {}
150
- };
151
- }
152
- function projectNode(node, context) {
153
- if (node.type === "surface") {
154
- if (!isSurfaceAccessible(node, context)) return void 0;
155
- return {
156
- label: node.label,
157
- icon: iconForNode(node, context),
158
- link: node.path
159
- };
160
- }
161
- const childEntries = getSortedSidebarEntries(node.children);
162
- const childSurfaces = childEntries.map(([, child]) => child).filter((child) => child.type === "surface");
163
- const links = childEntries.flatMap(([, child]) => {
164
- if (child.type === "surface") {
165
- const link = surfaceToLinkItem(child, context, childSurfaces);
166
- return link ? [link] : [];
167
- }
168
- const nestedGroup = projectNode(child, context);
169
- return nestedGroup?.link ? [
170
- {
171
- label: nestedGroup.label,
172
- link: nestedGroup.link
173
- }
174
- ] : nestedGroup?.links ?? [];
175
- });
176
- if (links.length === 0) return void 0;
177
- return {
178
- label: node.label,
179
- icon: iconForNode(node, context),
180
- links
181
- };
182
- }
183
- function projectSection(section, context) {
184
- const entries = getSortedSidebarEntries(section);
185
- return entries.flatMap(([, node]) => {
186
- const group = projectNode(node, context);
187
- return group ? [group] : [];
188
- });
189
- }
190
- function projectSidebarLinks({
191
- shellModel,
192
- organizationModel,
193
- isSystemEnabled,
194
- isPlatformAdmin = false,
195
- isDev = false,
196
- section
197
- }) {
198
- const context = {
199
- shellModel,
200
- isSystemEnabled,
201
- isPlatformAdmin,
202
- isDev
203
- };
204
- const sidebar = organizationModel?.navigation.sidebar;
205
- if (!sidebar) return [];
206
- if (section) {
207
- return projectSection(sidebar[section], context);
208
- }
209
- return [...projectSection(sidebar.primary, context), ...projectSection(sidebar.bottom, context)];
210
- }
211
- var useFeatureAccess = createFeatureAccessHook({
212
- useInitialization,
213
- useOrganization
214
- });
215
- function useElevasisSystems() {
216
- const context = useContext(ElevasisSystemsContext);
217
- if (!context) {
218
- throw new Error(
219
- "useElevasisSystems must be used within an ElevasisSystemsProvider. Wrap your app (or the relevant subtree) with <ElevasisSystemsProvider>."
220
- );
221
- }
222
- return context;
223
- }
224
- function useOptionalElevasisSystems() {
225
- return useContext(ElevasisSystemsContext);
226
- }
227
- function defaultSystems(organizationModel) {
228
- if (!organizationModel) return [];
229
- return listAllSystems(organizationModel).map(({ path, system }) => ({ ...system, id: path }));
230
- }
231
- function systemPath(system) {
232
- return system.ui?.path ?? system.path ?? defaultPathFor(system.id);
233
- }
234
- function systemLabel(system) {
235
- return system.label ?? system.title ?? system.id;
236
- }
237
- function moduleSystemId(module) {
238
- return module.systemId ?? module.key;
239
- }
240
- function isLifecycleEnabled2(system) {
241
- if (system.enabled === false) return false;
242
- return system.lifecycle !== "deprecated" && system.lifecycle !== "archived";
243
- }
244
- function isOrganizationModelSystemEnabled(organizationModel, systemId) {
245
- const system = defaultSystems(organizationModel).find((candidate) => candidate.id === systemId);
246
- return system ? isLifecycleEnabled2(system) : void 0;
247
- }
248
- function resolveSystemModules(systems, isSystemEnabled) {
249
- return systems.map((system) => {
250
- const systemId = system.systemId;
251
- const accessKey = systemId ?? system.key;
252
- return {
253
- ...system,
254
- systemId,
255
- access: {
256
- systemKey: system.key,
257
- systemId,
258
- enabled: isSystemEnabled(accessKey)
259
- },
260
- semantics: {
261
- capabilityIds: uniqueIds(system.capabilityIds ?? [])
262
- }
263
- };
264
- });
265
- }
266
- function buildShellSystems(organizationModel, modules) {
267
- const iconBySystemId = new Map(
268
- modules.flatMap((module) => module.systemId ? [[moduleSystemId(module), module.icon]] : [])
269
- );
270
- return defaultSystems(organizationModel).map((system) => ({
271
- ...system,
272
- label: systemLabel(system),
273
- path: systemPath(system),
274
- iconComponent: iconBySystemId.get(system.id)
275
- }));
276
- }
277
- function createShellModel(systems) {
278
- const systemsRecord = Object.fromEntries(systems.map((s) => [s.id, s]));
279
- return {
280
- systems,
281
- findByPath: (path) => findByPath(systemsRecord, normalizeRoutePath(path)),
282
- findById: (id) => findById(systemsRecord, id),
283
- childrenOf: (id) => childrenOf(systemsRecord, id),
284
- ancestorsOf: (id) => ancestorsOf(systemsRecord, id),
285
- parentOf: (id) => parentOf(systemsRecord, id),
286
- topLevel: () => topLevel(systemsRecord),
287
- requiresAdminFor: (id) => requiresAdminFor(systemsRecord, id),
288
- devOnlyFor: (id) => devOnlyFor(systemsRecord, id)
289
- };
290
- }
291
- function resolveOrganizationGraphSystem(systems, shellModel) {
292
- for (const system of systems) {
293
- const graphBridge = system.organizationGraph;
294
- if (!graphBridge) continue;
295
- const systemId = graphBridge.systemId;
296
- if (!systemId) continue;
297
- const node = shellModel.findById(systemId);
298
- return {
299
- available: Boolean(node),
300
- systemId,
301
- systemPath: node ? systemPath(node) : void 0
302
- };
303
- }
304
- return {
305
- available: false
306
- };
307
- }
308
- function findMatchingNode(shellModel, currentPath) {
309
- const normalizedPath = normalizeRoutePath(currentPath);
310
- const exact = shellModel.findByPath(normalizedPath);
311
- if (exact) return exact;
312
- return [...shellModel.systems].filter((system) => {
313
- const path = normalizeRoutePath(systemPath(system));
314
- return path !== "/" && isRouteMatch(normalizedPath, path);
315
- }).sort((a, b) => systemPath(b).length - systemPath(a).length)[0];
316
- }
317
- function ownsNode(module, node) {
318
- if (!node || !module.systemId) return false;
319
- return node.id === module.systemId || node.id.startsWith(`${module.systemId}.`);
320
- }
321
- function ownsRoutePrefix(module, normalizedPath) {
322
- return (module.routePrefixes ?? []).some((prefix) => isRouteMatch(normalizedPath, normalizeRoutePath(prefix)));
323
- }
324
- function resolveRoute(systems, shellModel, currentPath, disabledSubsectionPaths) {
325
- const node = findMatchingNode(shellModel, currentPath);
326
- const normalizedPath = normalizeRoutePath(currentPath);
327
- if (disabledSubsectionPaths.some((disabledPath) => isRouteMatch(normalizedPath, disabledPath))) {
328
- return {
329
- status: "hidden",
330
- path: currentPath,
331
- node
332
- };
333
- }
334
- const system = systems.find((candidate) => ownsNode(candidate, node)) ?? systems.filter((candidate) => ownsRoutePrefix(candidate, normalizedPath)).sort(
335
- (a, b) => Math.max(...(b.routePrefixes ?? []).map((prefix) => prefix.length)) - Math.max(...(a.routePrefixes ?? []).map((prefix) => prefix.length))
336
- )[0];
337
- if (!system) {
338
- return {
339
- status: "unmatched",
340
- path: currentPath,
341
- node
342
- };
343
- }
344
- return {
345
- status: "matched",
346
- path: currentPath,
347
- system,
348
- node
349
- };
350
- }
351
- function ElevasisSystemsProvider({
352
- systems,
353
- organizationModel,
354
- timeRange,
355
- operationsApiUrl,
356
- operationsSSEManager,
357
- deliveryApiUrl,
358
- deliverySSEManager,
359
- disabledSubsectionPaths = [],
360
- children
361
- }) {
362
- const activeSystems = systems ?? [];
363
- const resolvedOrganizationModel = useMemo(() => {
364
- if (!organizationModel) {
365
- return void 0;
366
- }
367
- return {
368
- ...organizationModel,
369
- knowledge: organizationModel.knowledge ?? {}
370
- };
371
- }, [organizationModel]);
372
- useMemo(() => validateManifests(activeSystems, resolvedOrganizationModel), [activeSystems, resolvedOrganizationModel]);
373
- const { hasFeature } = useFeatureAccess();
374
- const hasResolvedSystem = useCallback(
375
- (key) => {
376
- if (!hasFeature(key)) {
377
- return false;
378
- }
379
- const organizationModelSystemEnabled = isOrganizationModelSystemEnabled(resolvedOrganizationModel, key);
380
- return organizationModelSystemEnabled ?? true;
381
- },
382
- [hasFeature, resolvedOrganizationModel]
383
- );
384
- const shellSystems = useMemo(
385
- () => buildShellSystems(resolvedOrganizationModel, activeSystems),
386
- [resolvedOrganizationModel, activeSystems]
387
- );
388
- const shellModel = useMemo(() => createShellModel(shellSystems), [shellSystems]);
389
- const normalizedDisabledSubsectionPaths = useMemo(
390
- () => [...new Set(disabledSubsectionPaths.map((path) => normalizeRoutePath(path)))],
391
- [disabledSubsectionPaths]
392
- );
393
- const resolvedSystems = useMemo(
394
- () => resolveSystemModules(activeSystems, hasResolvedSystem),
395
- [activeSystems, hasResolvedSystem]
396
- );
397
- const enabledResolvedSystems = useMemo(
398
- () => resolvedSystems.filter((system) => system.access.enabled),
399
- [resolvedSystems]
400
- );
401
- const organizationGraph = useMemo(
402
- () => resolveOrganizationGraphSystem(enabledResolvedSystems, shellModel),
403
- [enabledResolvedSystems, shellModel]
404
- );
405
- const getResolvedSystem = useCallback(
406
- (key) => resolvedSystems.find((system) => system.key === key),
407
- [resolvedSystems]
408
- );
409
- const isSystemEnabled = useCallback((key) => hasResolvedSystem(key), [hasResolvedSystem]);
410
- const getSidebarLinks = useCallback(
411
- (options = {}) => projectSidebarLinks({
412
- shellModel,
413
- organizationModel: resolvedOrganizationModel,
414
- isSystemEnabled,
415
- ...options
416
- }),
417
- [shellModel, resolvedOrganizationModel, isSystemEnabled]
418
- );
419
- const resolveRouteByPath = useCallback(
420
- (path) => resolveRoute(enabledResolvedSystems, shellModel, path, normalizedDisabledSubsectionPaths),
421
- [enabledResolvedSystems, shellModel, normalizedDisabledSubsectionPaths]
422
- );
423
- const shellRuntime = useMemo(
424
- () => ({
425
- resolveRoute: resolveRouteByPath
426
- }),
427
- [resolveRouteByPath]
428
- );
429
- const value = useMemo(
430
- () => ({
431
- shellModel,
432
- shellRuntime,
433
- getSidebarLinks,
434
- enabledResolvedSystems,
435
- resolvedSystems,
436
- organizationGraph,
437
- organizationModel: resolvedOrganizationModel,
438
- timeRange,
439
- operationsApiUrl,
440
- operationsSSEManager,
441
- deliveryApiUrl,
442
- deliverySSEManager,
443
- disabledSubsectionPaths: normalizedDisabledSubsectionPaths,
444
- isSystemEnabled,
445
- getResolvedSystem
446
- }),
447
- [
448
- shellModel,
449
- shellRuntime,
450
- enabledResolvedSystems,
451
- resolvedSystems,
452
- organizationGraph,
453
- resolvedOrganizationModel,
454
- timeRange,
455
- operationsApiUrl,
456
- operationsSSEManager,
457
- deliveryApiUrl,
458
- deliverySSEManager,
459
- normalizedDisabledSubsectionPaths,
460
- isSystemEnabled,
461
- getResolvedSystem,
462
- getSidebarLinks
463
- ]
464
- );
465
- return /* @__PURE__ */ jsx(ElevasisSystemsContext.Provider, { value, children });
466
- }
467
-
468
- export { ElevasisSystemsProvider, createFeatureAccessHook, useElevasisSystems, useOptionalElevasisSystems };
@@ -1,68 +0,0 @@
1
- import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-LAWLB6CT.js';
2
- import { useResourcesHealth } from './chunk-IGDYWFNE.js';
3
- import { CardHeader, EmptyState } from './chunk-HRWLKKWM.js';
4
- import { getTimeRangeDates, formatBucketTime } from './chunk-2RJMVWFJ.js';
5
- import { Paper, Center, Loader, Group } from '@mantine/core';
6
- import { IconActivity, IconChartBar } from '@tabler/icons-react';
7
- import { useMemo } from 'react';
8
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
-
10
- function ResourceHealthPanel({ resourceId, resourceType, timeRange }) {
11
- const colors = useCyberColors();
12
- const { startDate, endDate } = useMemo(() => getTimeRangeDates(timeRange), [timeRange]);
13
- const granularity = ["1h", "24h"].includes(timeRange) ? "hour" : "day";
14
- const { data, isLoading } = useResourcesHealth({
15
- resources: [{ entityType: resourceType, entityId: resourceId }],
16
- startDate,
17
- endDate,
18
- granularity
19
- });
20
- const resourceHealth = data?.resources?.[0];
21
- const chartData = useMemo(() => {
22
- if (!resourceHealth?.trendData) return [];
23
- return resourceHealth.trendData.map((point) => ({
24
- time: point.time,
25
- Success: (point.success || 0) - (point.warning || 0),
26
- Warning: point.warning || 0,
27
- Failed: point.failure || 0
28
- }));
29
- }, [resourceHealth?.trendData]);
30
- const xTickFormatter = useMemo(() => (value) => formatBucketTime(value, granularity), [granularity]);
31
- if (isLoading) {
32
- return /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) });
33
- }
34
- const summary = resourceHealth?.summary;
35
- return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
36
- /* @__PURE__ */ jsx(
37
- CardHeader,
38
- {
39
- icon: /* @__PURE__ */ jsx(IconActivity, { size: 18 }),
40
- title: "Execution Health",
41
- subtitle: `${summary?.total || 0} executions, ${summary?.successRate?.toFixed(1) || 0}% success rate`
42
- }
43
- ),
44
- chartData.length === 0 ? /* @__PURE__ */ jsx(EmptyState, { icon: IconChartBar, title: "No execution data for this time range" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
45
- /* @__PURE__ */ jsxs(Group, { gap: "lg", justify: "center", mb: "xs", h: 24, align: "center", children: [
46
- /* @__PURE__ */ jsx(CyberLegendItem, { color: colors.green, label: "Success" }),
47
- /* @__PURE__ */ jsx(CyberLegendItem, { color: colors.yellow, label: "Warning" }),
48
- /* @__PURE__ */ jsx(CyberLegendItem, { color: colors.red, label: "Failed" })
49
- ] }),
50
- /* @__PURE__ */ jsx(
51
- CyberAreaChart,
52
- {
53
- data: chartData,
54
- series: [
55
- { dataKey: "Success", color: "green", name: "Success" },
56
- { dataKey: "Warning", color: "yellow", name: "Warning" },
57
- { dataKey: "Failed", color: "red", name: "Failed" }
58
- ],
59
- height: 200,
60
- yDomain: [0, "auto"],
61
- xTickFormatter
62
- }
63
- )
64
- ] })
65
- ] });
66
- }
67
-
68
- export { ResourceHealthPanel };
@@ -1,12 +0,0 @@
1
- import { Card, Group } from '@mantine/core';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
-
4
- // src/components/table/FilterBar.tsx
5
- function FilterBar({ children, actions }) {
6
- return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Group, { gap: "md", wrap: "wrap", justify: "space-between", children: [
7
- /* @__PURE__ */ jsx(Group, { gap: "md", wrap: "wrap", children }),
8
- /* @__PURE__ */ jsx(Group, { gap: "md", children: actions })
9
- ] }) });
10
- }
11
-
12
- export { FilterBar };