@elevasis/ui 2.36.0 → 2.38.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.
- package/dist/api/index.js +4 -3
- package/dist/app/index.css +0 -384
- package/dist/app/index.d.ts +75 -2
- package/dist/app/index.js +22 -21
- package/dist/auth/index.d.ts +91 -28
- package/dist/auth/index.js +5 -1
- package/dist/charts/index.js +9 -3
- package/dist/chunk-4O3VAALW.js +349 -0
- package/dist/{chunk-O2Q4VMRN.js → chunk-566XWGPP.js} +76 -109
- package/dist/chunk-5EYJ2GIN.js +122 -0
- package/dist/chunk-6D4LCJ52.js +10 -0
- package/dist/chunk-6ROXVZ3L.js +9 -0
- package/dist/{chunk-YYX7OPZQ.js → chunk-73EWE2EW.js} +1 -1
- package/dist/{chunk-SIQ3P4OR.js → chunk-7GQFIWP4.js} +8 -756
- package/dist/{chunk-VKIZUUPM.js → chunk-7YXZFS56.js} +31 -14
- package/dist/{chunk-AKW7KISS.js → chunk-7ZWXTH5J.js} +2 -44
- package/dist/chunk-A7IG36LB.js +215 -0
- package/dist/chunk-B2DZLPDL.js +39 -0
- package/dist/chunk-C6BDBZRO.js +422 -0
- package/dist/chunk-CLDCYJQT.js +1 -0
- package/dist/{chunk-LUYVRATI.js → chunk-DA6I5VEY.js} +5 -213
- package/dist/chunk-H2MEFUQD.js +337 -0
- package/dist/chunk-I53EX4VU.js +734 -0
- package/dist/chunk-IIMU5YAJ.js +53 -0
- package/dist/chunk-JXVNHVK7.js +79 -0
- package/dist/chunk-M7Q4UBRY.js +85 -0
- package/dist/{chunk-K4UZU3TU.js → chunk-P34FFSOX.js} +1 -1
- package/dist/chunk-PGWANFNE.js +112 -0
- package/dist/{chunk-F6EFC2MJ.js → chunk-Q64E2TZY.js} +440 -2075
- package/dist/chunk-S3XR4II4.js +30 -0
- package/dist/chunk-SHZT7ULK.js +425 -0
- package/dist/{chunk-GX6XBRRF.js → chunk-TYRUKGGD.js} +2 -1
- package/dist/{chunk-R3VCBZDC.js → chunk-X4WBGKJQ.js} +3 -50
- package/dist/{chunk-GEFWMU26.js → chunk-X66MVMZT.js} +1 -9
- package/dist/{chunk-57OZ3AEG.js → chunk-Y3JQBSKQ.js} +1 -1
- package/dist/components/index.d.ts +74 -42
- package/dist/components/index.js +34 -19
- package/dist/components/navigation/index.js +3 -31
- package/dist/features/auth/index.d.ts +97 -99
- package/dist/features/auth/index.js +37 -99
- package/dist/features/clients/index.js +34 -19
- package/dist/features/crm/index.d.ts +65 -0
- package/dist/features/crm/index.js +34 -19
- package/dist/features/dashboard/index.js +34 -19
- package/dist/features/delivery/index.d.ts +65 -0
- package/dist/features/delivery/index.js +34 -19
- package/dist/features/knowledge/index.js +6 -30
- package/dist/features/lead-gen/index.d.ts +1096 -1
- package/dist/features/lead-gen/index.js +34 -19
- package/dist/features/monitoring/index.js +34 -19
- package/dist/features/monitoring/requests/index.js +34 -19
- package/dist/features/notes/index.d.ts +72 -0
- package/dist/features/notes/index.js +621 -0
- package/dist/features/operations/index.d.ts +10 -2
- package/dist/features/operations/index.js +34 -19
- package/dist/features/right-panel-host/index.d.ts +214 -0
- package/dist/features/right-panel-host/index.js +639 -0
- package/dist/features/seo/index.js +3 -2
- package/dist/features/settings/index.d.ts +68 -35
- package/dist/features/settings/index.js +34 -19
- package/dist/hooks/access/index.d.ts +90 -0
- package/dist/hooks/access/index.js +10 -0
- package/dist/hooks/delivery/index.d.ts +65 -0
- package/dist/hooks/delivery/index.js +34 -19
- package/dist/hooks/index.d.ts +1644 -1651
- package/dist/hooks/index.js +34 -19
- package/dist/hooks/published.d.ts +1644 -1651
- package/dist/hooks/published.js +34 -19
- package/dist/hooks/user-notes/index.d.ts +57 -0
- package/dist/hooks/user-notes/index.js +3 -0
- package/dist/index.d.ts +294 -277
- package/dist/index.js +35 -20
- package/dist/initialization/index.d.ts +65 -19
- package/dist/knowledge/index.d.ts +10 -2
- package/dist/knowledge/index.js +173 -28
- package/dist/layout/index.js +5 -3
- package/dist/organization/index.d.ts +0 -19
- package/dist/organization/index.js +34 -19
- package/dist/profile/index.d.ts +65 -0
- package/dist/provider/index.css +0 -384
- package/dist/provider/index.d.ts +75 -2
- package/dist/provider/index.js +16 -21
- package/dist/provider/published.css +0 -523
- package/dist/provider/published.d.ts +75 -2
- package/dist/provider/published.js +11 -21
- package/dist/supabase/index.d.ts +127 -0
- package/dist/test-utils/index.d.ts +2 -21
- package/dist/test-utils/index.js +5 -18
- package/dist/theme/index.js +3 -1
- package/dist/types/index.d.ts +115 -59
- package/dist/utils/index.js +2 -1
- package/package.json +21 -5
- package/src/auth/README.md +6 -6
- package/dist/components/navigation/index.css +0 -649
- package/dist/features/knowledge/index.css +0 -649
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { devOnlyFor, requiresAdminFor, topLevel, parentOf, ancestorsOf, childrenOf, findById, findByPath, listAllSystems, defaultPathFor, getSortedSidebarEntries, getSemanticIconComponent } from './chunk-566XWGPP.js';
|
|
2
|
+
import { createContext, useContext, useMemo, useCallback } from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/provider/resolvers/RouteResolver.ts
|
|
6
|
+
function normalizeRoutePath(path) {
|
|
7
|
+
const trimmedPath = path.trim();
|
|
8
|
+
if (!trimmedPath || trimmedPath === "/") {
|
|
9
|
+
return "/";
|
|
10
|
+
}
|
|
11
|
+
return trimmedPath.replace(/\/+$/, "") || "/";
|
|
12
|
+
}
|
|
13
|
+
function isRouteMatch(currentPath, route) {
|
|
14
|
+
const normalizedCurrentPath = normalizeRoutePath(currentPath);
|
|
15
|
+
const normalizedRoute = normalizeRoutePath(route);
|
|
16
|
+
return normalizedCurrentPath === normalizedRoute || normalizedCurrentPath.startsWith(`${normalizedRoute}/`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// src/provider/resolvers/NavResolver.ts
|
|
20
|
+
function uniqueIds(ids) {
|
|
21
|
+
return ids ? [...new Set(ids)] : [];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/provider/validateManifests.ts
|
|
25
|
+
function listSystemRefs(systems) {
|
|
26
|
+
const refs = [];
|
|
27
|
+
function walk(map, prefix = "") {
|
|
28
|
+
for (const [key, system] of Object.entries(map)) {
|
|
29
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
30
|
+
refs.push(path, system.id);
|
|
31
|
+
const subsystems = system.subsystems;
|
|
32
|
+
if (subsystems) {
|
|
33
|
+
walk(subsystems, path);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
walk(systems);
|
|
38
|
+
return refs;
|
|
39
|
+
}
|
|
40
|
+
function validateManifests(manifests, organizationModel) {
|
|
41
|
+
if (!organizationModel) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const validSystemIds = /* @__PURE__ */ new Set([
|
|
45
|
+
...Object.keys(organizationModel.systems ?? {}),
|
|
46
|
+
...listSystemRefs(organizationModel.systems ?? {})
|
|
47
|
+
]);
|
|
48
|
+
const errors = [];
|
|
49
|
+
for (const manifest of manifests) {
|
|
50
|
+
const key = manifest.key;
|
|
51
|
+
const systemId = manifest.systemId;
|
|
52
|
+
if (!systemId) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (!validSystemIds.has(systemId)) {
|
|
56
|
+
errors.push(
|
|
57
|
+
`Manifest "${key}": systemId "${systemId}" is not a known system id. Valid values: ${[...validSystemIds].sort().join(", ")}`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (errors.length > 0) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
`System manifest validation failed with ${errors.length} error(s):
|
|
64
|
+
` + errors.map((e, i) => ` ${i + 1}. ${e}`).join("\n")
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var ElevasisSystemsContext = createContext(null);
|
|
69
|
+
|
|
70
|
+
// src/provider/sidebarProjection.ts
|
|
71
|
+
function isLifecycleEnabled(system) {
|
|
72
|
+
if (system.enabled === false) return false;
|
|
73
|
+
return system.lifecycle !== "deprecated" && system.lifecycle !== "archived";
|
|
74
|
+
}
|
|
75
|
+
function isSystemAccessible(systemId, context) {
|
|
76
|
+
const system = context.shellModel.findById(systemId);
|
|
77
|
+
if (!system || !isLifecycleEnabled(system)) return false;
|
|
78
|
+
if (!context.isSystemEnabled(systemId)) return false;
|
|
79
|
+
if (context.shellModel.requiresAdminFor(systemId) && !context.isPlatformAdmin) return false;
|
|
80
|
+
if (context.shellModel.devOnlyFor(systemId) && !context.isDev) return false;
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
function isSurfaceAccessible(node, context) {
|
|
84
|
+
if (node.devOnly && !context.isDev) return false;
|
|
85
|
+
if (node.requiresAdmin && !context.isPlatformAdmin) return false;
|
|
86
|
+
const systemTargets = node.targets?.systems ?? [];
|
|
87
|
+
if (systemTargets.length === 0) return true;
|
|
88
|
+
return systemTargets.some((systemId) => isSystemAccessible(systemId, context));
|
|
89
|
+
}
|
|
90
|
+
function iconForNode(node, context) {
|
|
91
|
+
if (node.type === "surface") {
|
|
92
|
+
const targetIcon = node.targets?.systems?.map((systemId) => context.shellModel.findById(systemId)?.iconComponent).find(Boolean);
|
|
93
|
+
if (targetIcon) return targetIcon;
|
|
94
|
+
}
|
|
95
|
+
return getSemanticIconComponent(node.icon);
|
|
96
|
+
}
|
|
97
|
+
function activeMatchPathsForSurface(node, context) {
|
|
98
|
+
const targets = node.targets?.systems ?? [];
|
|
99
|
+
if (targets.length !== 1) return void 0;
|
|
100
|
+
const paths = context.shellModel.childrenOf(targets[0]).map((child) => child.path).filter((path) => Boolean(path && path !== node.path));
|
|
101
|
+
return paths.length > 0 ? [...new Set(paths)] : void 0;
|
|
102
|
+
}
|
|
103
|
+
function surfaceToLinkItem(node, context, siblings) {
|
|
104
|
+
if (!isSurfaceAccessible(node, context)) return void 0;
|
|
105
|
+
const siblingShadows = siblings.some((sibling) => sibling !== node && sibling.path.startsWith(`${node.path}/`));
|
|
106
|
+
const activeMatchPaths = activeMatchPathsForSurface(node, context);
|
|
107
|
+
return {
|
|
108
|
+
label: node.label,
|
|
109
|
+
link: node.path,
|
|
110
|
+
...siblingShadows ? { exact: true } : {},
|
|
111
|
+
...activeMatchPaths ? { activeMatchPaths } : {}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function projectNode(node, context) {
|
|
115
|
+
if (node.type === "surface") {
|
|
116
|
+
if (!isSurfaceAccessible(node, context)) return void 0;
|
|
117
|
+
return {
|
|
118
|
+
label: node.label,
|
|
119
|
+
icon: iconForNode(node, context),
|
|
120
|
+
link: node.path
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const childEntries = getSortedSidebarEntries(node.children);
|
|
124
|
+
const childSurfaces = childEntries.map(([, child]) => child).filter((child) => child.type === "surface");
|
|
125
|
+
const links = childEntries.flatMap(([, child]) => {
|
|
126
|
+
if (child.type === "surface") {
|
|
127
|
+
const link = surfaceToLinkItem(child, context, childSurfaces);
|
|
128
|
+
return link ? [link] : [];
|
|
129
|
+
}
|
|
130
|
+
const nestedGroup = projectNode(child, context);
|
|
131
|
+
return nestedGroup?.link ? [
|
|
132
|
+
{
|
|
133
|
+
label: nestedGroup.label,
|
|
134
|
+
link: nestedGroup.link
|
|
135
|
+
}
|
|
136
|
+
] : nestedGroup?.links ?? [];
|
|
137
|
+
});
|
|
138
|
+
if (links.length === 0) return void 0;
|
|
139
|
+
return {
|
|
140
|
+
label: node.label,
|
|
141
|
+
icon: iconForNode(node, context),
|
|
142
|
+
links
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function projectSection(section, context) {
|
|
146
|
+
const entries = getSortedSidebarEntries(section);
|
|
147
|
+
return entries.flatMap(([, node]) => {
|
|
148
|
+
const group = projectNode(node, context);
|
|
149
|
+
return group ? [group] : [];
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function projectSidebarLinks({
|
|
153
|
+
shellModel,
|
|
154
|
+
organizationModel,
|
|
155
|
+
isSystemEnabled,
|
|
156
|
+
isPlatformAdmin = false,
|
|
157
|
+
isDev = false,
|
|
158
|
+
section
|
|
159
|
+
}) {
|
|
160
|
+
const context = {
|
|
161
|
+
shellModel,
|
|
162
|
+
isSystemEnabled,
|
|
163
|
+
isPlatformAdmin,
|
|
164
|
+
isDev
|
|
165
|
+
};
|
|
166
|
+
const sidebar = organizationModel?.navigation.sidebar;
|
|
167
|
+
if (!sidebar) return [];
|
|
168
|
+
if (section) {
|
|
169
|
+
return projectSection(sidebar[section], context);
|
|
170
|
+
}
|
|
171
|
+
return [...projectSection(sidebar.primary, context), ...projectSection(sidebar.bottom, context)];
|
|
172
|
+
}
|
|
173
|
+
function useElevasisSystems() {
|
|
174
|
+
const context = useContext(ElevasisSystemsContext);
|
|
175
|
+
if (!context) {
|
|
176
|
+
throw new Error(
|
|
177
|
+
"useElevasisSystems must be used within an ElevasisSystemsProvider. Wrap your app (or the relevant subtree) with <ElevasisSystemsProvider>."
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return context;
|
|
181
|
+
}
|
|
182
|
+
function useOptionalElevasisSystems() {
|
|
183
|
+
return useContext(ElevasisSystemsContext);
|
|
184
|
+
}
|
|
185
|
+
function defaultSystems(organizationModel) {
|
|
186
|
+
if (!organizationModel) return [];
|
|
187
|
+
return listAllSystems(organizationModel).map(({ path, system }) => ({ ...system, id: path }));
|
|
188
|
+
}
|
|
189
|
+
function systemPath(system) {
|
|
190
|
+
return system.ui?.path ?? system.path ?? defaultPathFor(system.id);
|
|
191
|
+
}
|
|
192
|
+
function systemLabel(system) {
|
|
193
|
+
return system.label ?? system.title ?? system.id;
|
|
194
|
+
}
|
|
195
|
+
function moduleSystemId(module) {
|
|
196
|
+
return module.systemId ?? module.key;
|
|
197
|
+
}
|
|
198
|
+
function isLifecycleEnabled2(system) {
|
|
199
|
+
if (system.enabled === false) return false;
|
|
200
|
+
return system.lifecycle !== "deprecated" && system.lifecycle !== "archived";
|
|
201
|
+
}
|
|
202
|
+
function isOrganizationModelSystemEnabled(organizationModel, systemId) {
|
|
203
|
+
const system = defaultSystems(organizationModel).find((candidate) => candidate.id === systemId);
|
|
204
|
+
return system ? isLifecycleEnabled2(system) : void 0;
|
|
205
|
+
}
|
|
206
|
+
function resolveSystemModules(systems, isSystemEnabled) {
|
|
207
|
+
return systems.map((system) => {
|
|
208
|
+
const systemId = system.systemId;
|
|
209
|
+
const accessKey = systemId ?? system.key;
|
|
210
|
+
return {
|
|
211
|
+
...system,
|
|
212
|
+
systemId,
|
|
213
|
+
access: {
|
|
214
|
+
systemKey: system.key,
|
|
215
|
+
systemId,
|
|
216
|
+
enabled: isSystemEnabled(accessKey)
|
|
217
|
+
},
|
|
218
|
+
semantics: {
|
|
219
|
+
capabilityIds: uniqueIds(system.capabilityIds ?? [])
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
function buildShellSystems(organizationModel, modules) {
|
|
225
|
+
const iconBySystemId = new Map(
|
|
226
|
+
modules.flatMap((module) => module.systemId ? [[moduleSystemId(module), module.icon]] : [])
|
|
227
|
+
);
|
|
228
|
+
return defaultSystems(organizationModel).map((system) => ({
|
|
229
|
+
...system,
|
|
230
|
+
label: systemLabel(system),
|
|
231
|
+
path: systemPath(system),
|
|
232
|
+
iconComponent: iconBySystemId.get(system.id)
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
function createShellModel(systems) {
|
|
236
|
+
const systemsRecord = Object.fromEntries(systems.map((s) => [s.id, s]));
|
|
237
|
+
return {
|
|
238
|
+
systems,
|
|
239
|
+
findByPath: (path) => findByPath(systemsRecord, normalizeRoutePath(path)),
|
|
240
|
+
findById: (id) => findById(systemsRecord, id),
|
|
241
|
+
childrenOf: (id) => childrenOf(systemsRecord, id),
|
|
242
|
+
ancestorsOf: (id) => ancestorsOf(systemsRecord, id),
|
|
243
|
+
parentOf: (id) => parentOf(systemsRecord, id),
|
|
244
|
+
topLevel: () => topLevel(systemsRecord),
|
|
245
|
+
requiresAdminFor: (id) => requiresAdminFor(systemsRecord, id),
|
|
246
|
+
devOnlyFor: (id) => devOnlyFor(systemsRecord, id)
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function resolveOrganizationGraphSystem(systems, shellModel) {
|
|
250
|
+
for (const system of systems) {
|
|
251
|
+
const graphBridge = system.organizationGraph;
|
|
252
|
+
if (!graphBridge) continue;
|
|
253
|
+
const systemId = graphBridge.systemId;
|
|
254
|
+
if (!systemId) continue;
|
|
255
|
+
const node = shellModel.findById(systemId);
|
|
256
|
+
return {
|
|
257
|
+
available: Boolean(node),
|
|
258
|
+
systemId,
|
|
259
|
+
systemPath: node ? systemPath(node) : void 0
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
available: false
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function findMatchingNode(shellModel, currentPath) {
|
|
267
|
+
const normalizedPath = normalizeRoutePath(currentPath);
|
|
268
|
+
const exact = shellModel.findByPath(normalizedPath);
|
|
269
|
+
if (exact) return exact;
|
|
270
|
+
return [...shellModel.systems].filter((system) => {
|
|
271
|
+
const path = normalizeRoutePath(systemPath(system));
|
|
272
|
+
return path !== "/" && isRouteMatch(normalizedPath, path);
|
|
273
|
+
}).sort((a, b) => systemPath(b).length - systemPath(a).length)[0];
|
|
274
|
+
}
|
|
275
|
+
function ownsNode(module, node) {
|
|
276
|
+
if (!node || !module.systemId) return false;
|
|
277
|
+
return node.id === module.systemId || node.id.startsWith(`${module.systemId}.`);
|
|
278
|
+
}
|
|
279
|
+
function ownsRoutePrefix(module, normalizedPath) {
|
|
280
|
+
return (module.routePrefixes ?? []).some((prefix) => isRouteMatch(normalizedPath, normalizeRoutePath(prefix)));
|
|
281
|
+
}
|
|
282
|
+
function resolveRoute(systems, shellModel, currentPath, disabledSubsectionPaths) {
|
|
283
|
+
const node = findMatchingNode(shellModel, currentPath);
|
|
284
|
+
const normalizedPath = normalizeRoutePath(currentPath);
|
|
285
|
+
if (disabledSubsectionPaths.some((disabledPath) => isRouteMatch(normalizedPath, disabledPath))) {
|
|
286
|
+
return {
|
|
287
|
+
status: "hidden",
|
|
288
|
+
path: currentPath,
|
|
289
|
+
node
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
const system = systems.find((candidate) => ownsNode(candidate, node)) ?? systems.filter((candidate) => ownsRoutePrefix(candidate, normalizedPath)).sort(
|
|
293
|
+
(a, b) => Math.max(...(b.routePrefixes ?? []).map((prefix) => prefix.length)) - Math.max(...(a.routePrefixes ?? []).map((prefix) => prefix.length))
|
|
294
|
+
)[0];
|
|
295
|
+
if (!system) {
|
|
296
|
+
return {
|
|
297
|
+
status: "unmatched",
|
|
298
|
+
path: currentPath,
|
|
299
|
+
node
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
return {
|
|
303
|
+
status: "matched",
|
|
304
|
+
path: currentPath,
|
|
305
|
+
system,
|
|
306
|
+
node
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function ElevasisSystemsProvider({
|
|
310
|
+
systems,
|
|
311
|
+
organizationModel,
|
|
312
|
+
timeRange,
|
|
313
|
+
operationsApiUrl,
|
|
314
|
+
operationsSSEManager,
|
|
315
|
+
deliveryApiUrl,
|
|
316
|
+
deliverySSEManager,
|
|
317
|
+
disabledSubsectionPaths = [],
|
|
318
|
+
children
|
|
319
|
+
}) {
|
|
320
|
+
const activeSystems = systems ?? [];
|
|
321
|
+
const resolvedOrganizationModel = useMemo(() => {
|
|
322
|
+
if (!organizationModel) {
|
|
323
|
+
return void 0;
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
...organizationModel,
|
|
327
|
+
knowledge: organizationModel.knowledge ?? {}
|
|
328
|
+
};
|
|
329
|
+
}, [organizationModel]);
|
|
330
|
+
useMemo(() => validateManifests(activeSystems, resolvedOrganizationModel), [activeSystems, resolvedOrganizationModel]);
|
|
331
|
+
const hasResolvedSystem = useCallback(
|
|
332
|
+
(key) => {
|
|
333
|
+
const organizationModelSystemEnabled = isOrganizationModelSystemEnabled(resolvedOrganizationModel, key);
|
|
334
|
+
return organizationModelSystemEnabled ?? true;
|
|
335
|
+
},
|
|
336
|
+
[resolvedOrganizationModel]
|
|
337
|
+
);
|
|
338
|
+
const shellSystems = useMemo(
|
|
339
|
+
() => buildShellSystems(resolvedOrganizationModel, activeSystems),
|
|
340
|
+
[resolvedOrganizationModel, activeSystems]
|
|
341
|
+
);
|
|
342
|
+
const shellModel = useMemo(() => createShellModel(shellSystems), [shellSystems]);
|
|
343
|
+
const normalizedDisabledSubsectionPaths = useMemo(
|
|
344
|
+
() => [...new Set(disabledSubsectionPaths.map((path) => normalizeRoutePath(path)))],
|
|
345
|
+
[disabledSubsectionPaths]
|
|
346
|
+
);
|
|
347
|
+
const resolvedSystems = useMemo(
|
|
348
|
+
() => resolveSystemModules(activeSystems, hasResolvedSystem),
|
|
349
|
+
[activeSystems, hasResolvedSystem]
|
|
350
|
+
);
|
|
351
|
+
const enabledResolvedSystems = useMemo(
|
|
352
|
+
() => resolvedSystems.filter((system) => system.access.enabled),
|
|
353
|
+
[resolvedSystems]
|
|
354
|
+
);
|
|
355
|
+
const organizationGraph = useMemo(
|
|
356
|
+
() => resolveOrganizationGraphSystem(enabledResolvedSystems, shellModel),
|
|
357
|
+
[enabledResolvedSystems, shellModel]
|
|
358
|
+
);
|
|
359
|
+
const getResolvedSystem = useCallback(
|
|
360
|
+
(key) => resolvedSystems.find((system) => system.key === key),
|
|
361
|
+
[resolvedSystems]
|
|
362
|
+
);
|
|
363
|
+
const isSystemEnabled = useCallback((key) => hasResolvedSystem(key), [hasResolvedSystem]);
|
|
364
|
+
const getSidebarLinks = useCallback(
|
|
365
|
+
(options = {}) => projectSidebarLinks({
|
|
366
|
+
shellModel,
|
|
367
|
+
organizationModel: resolvedOrganizationModel,
|
|
368
|
+
isSystemEnabled,
|
|
369
|
+
...options
|
|
370
|
+
}),
|
|
371
|
+
[shellModel, resolvedOrganizationModel, isSystemEnabled]
|
|
372
|
+
);
|
|
373
|
+
const resolveRouteByPath = useCallback(
|
|
374
|
+
(path) => resolveRoute(enabledResolvedSystems, shellModel, path, normalizedDisabledSubsectionPaths),
|
|
375
|
+
[enabledResolvedSystems, shellModel, normalizedDisabledSubsectionPaths]
|
|
376
|
+
);
|
|
377
|
+
const shellRuntime = useMemo(
|
|
378
|
+
() => ({
|
|
379
|
+
resolveRoute: resolveRouteByPath
|
|
380
|
+
}),
|
|
381
|
+
[resolveRouteByPath]
|
|
382
|
+
);
|
|
383
|
+
const value = useMemo(
|
|
384
|
+
() => ({
|
|
385
|
+
shellModel,
|
|
386
|
+
shellRuntime,
|
|
387
|
+
getSidebarLinks,
|
|
388
|
+
enabledResolvedSystems,
|
|
389
|
+
resolvedSystems,
|
|
390
|
+
organizationGraph,
|
|
391
|
+
organizationModel: resolvedOrganizationModel,
|
|
392
|
+
timeRange,
|
|
393
|
+
operationsApiUrl,
|
|
394
|
+
operationsSSEManager,
|
|
395
|
+
deliveryApiUrl,
|
|
396
|
+
deliverySSEManager,
|
|
397
|
+
disabledSubsectionPaths: normalizedDisabledSubsectionPaths,
|
|
398
|
+
isSystemEnabled,
|
|
399
|
+
getResolvedSystem
|
|
400
|
+
}),
|
|
401
|
+
[
|
|
402
|
+
shellModel,
|
|
403
|
+
shellRuntime,
|
|
404
|
+
enabledResolvedSystems,
|
|
405
|
+
resolvedSystems,
|
|
406
|
+
organizationGraph,
|
|
407
|
+
resolvedOrganizationModel,
|
|
408
|
+
timeRange,
|
|
409
|
+
operationsApiUrl,
|
|
410
|
+
operationsSSEManager,
|
|
411
|
+
deliveryApiUrl,
|
|
412
|
+
deliverySSEManager,
|
|
413
|
+
normalizedDisabledSubsectionPaths,
|
|
414
|
+
isSystemEnabled,
|
|
415
|
+
getResolvedSystem,
|
|
416
|
+
getSidebarLinks
|
|
417
|
+
]
|
|
418
|
+
);
|
|
419
|
+
return /* @__PURE__ */ jsx(ElevasisSystemsContext.Provider, { value, children });
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export { ElevasisSystemsProvider, useElevasisSystems, useOptionalElevasisSystems };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { SubshellNavItem } from './chunk-X4WBGKJQ.js';
|
|
2
|
+
import { useAppearance } from './chunk-A7IG36LB.js';
|
|
1
3
|
import { NavigationButton } from './chunk-NYBEU5TE.js';
|
|
2
|
-
import {
|
|
3
|
-
import { sidebarItemGap, sidebarSubLinkPaddingY, sidebarSubLinkPaddingX, sidebarSubLinkIndent, sidebarHoverDelay, sidebarTransitionDuration, sidebarCollapsedWidth, sidebarWidth, topbarHeight, sidebarToggleIconSize, sidebarSectionPadding, sidebarGroupChevronSize, sidebarIconInnerSize, sidebarBottomSectionHeight } from './chunk-DT3QYZVU.js';
|
|
4
|
+
import { sidebarItemGap, sidebarSubLinkPaddingY, sidebarSubLinkPaddingX, sidebarSubLinkIndent, sidebarHoverDelay, sidebarTransitionDuration, sidebarCollapsedWidth, sidebarWidth, topbarHeight, sidebarToggleIconSize, sidebarSectionPadding, sidebarGroupChevronSize, sidebarIconInnerSize } from './chunk-DT3QYZVU.js';
|
|
4
5
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
5
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
-
import { createContext, memo, useEffect, useRef, createElement, useContext, useLayoutEffect, useState } from 'react';
|
|
7
7
|
import { Collapse, HoverCard, Stack, Group, Text, UnstyledButton, Tooltip, ScrollArea, Menu, Avatar, Container, Title, Button, Box, Center, useMantineColorScheme, Switch, Code } from '@mantine/core';
|
|
8
8
|
import { IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconUser, IconLogout, IconAlertCircle, IconChevronDown, IconChevronRight, IconMoonStars, IconSun } from '@tabler/icons-react';
|
|
9
|
+
import { createContext, memo, useEffect, useRef, createElement, useContext, useLayoutEffect, useState } from 'react';
|
|
9
10
|
|
|
10
11
|
var randRange = (min, max) => min + Math.random() * (max - min);
|
|
11
12
|
var FLUX_SPARKS = Array.from({ length: 30 }, () => {
|
|
@@ -227,17 +228,6 @@ function Vignette({ strength = 0.35, className }) {
|
|
|
227
228
|
}
|
|
228
229
|
);
|
|
229
230
|
}
|
|
230
|
-
var AppearanceContext = createContext(null);
|
|
231
|
-
function AppearanceProvider({ value, children }) {
|
|
232
|
-
return /* @__PURE__ */ jsx(AppearanceContext.Provider, { value, children });
|
|
233
|
-
}
|
|
234
|
-
function useAppearance() {
|
|
235
|
-
const ctx = useContext(AppearanceContext);
|
|
236
|
-
if (!ctx) {
|
|
237
|
-
throw new Error("useAppearance must be used within an AppearanceProvider (ElevasisCoreProvider)");
|
|
238
|
-
}
|
|
239
|
-
return ctx;
|
|
240
|
-
}
|
|
241
231
|
var AppShellContainer = ({ children }) => {
|
|
242
232
|
const { background } = useAppearance();
|
|
243
233
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1123,204 +1113,6 @@ var CollapsibleSidebarGroup = ({
|
|
|
1123
1113
|
) })
|
|
1124
1114
|
] });
|
|
1125
1115
|
};
|
|
1126
|
-
var SubshellContainer = ({ children, className }) => {
|
|
1127
|
-
return /* @__PURE__ */ jsx(
|
|
1128
|
-
"div",
|
|
1129
|
-
{
|
|
1130
|
-
className,
|
|
1131
|
-
style: {
|
|
1132
|
-
display: "flex",
|
|
1133
|
-
height: "100%",
|
|
1134
|
-
width: "100%",
|
|
1135
|
-
position: "relative"
|
|
1136
|
-
},
|
|
1137
|
-
children
|
|
1138
|
-
}
|
|
1139
|
-
);
|
|
1140
|
-
};
|
|
1141
|
-
var SubshellRightSideContainer = ({ children, className }) => {
|
|
1142
|
-
return /* @__PURE__ */ jsx(
|
|
1143
|
-
"div",
|
|
1144
|
-
{
|
|
1145
|
-
className,
|
|
1146
|
-
style: {
|
|
1147
|
-
flex: 1,
|
|
1148
|
-
minWidth: 0,
|
|
1149
|
-
display: "flex",
|
|
1150
|
-
flexDirection: "column",
|
|
1151
|
-
overflow: "hidden"
|
|
1152
|
-
},
|
|
1153
|
-
children
|
|
1154
|
-
}
|
|
1155
|
-
);
|
|
1156
|
-
};
|
|
1157
|
-
var mdSpacing = 16;
|
|
1158
|
-
var SubshellContentContainer = ({ children, className }) => {
|
|
1159
|
-
return /* @__PURE__ */ jsx(
|
|
1160
|
-
"div",
|
|
1161
|
-
{
|
|
1162
|
-
className,
|
|
1163
|
-
style: {
|
|
1164
|
-
display: "flex",
|
|
1165
|
-
flexDirection: "column",
|
|
1166
|
-
flex: 1,
|
|
1167
|
-
overflowX: "clip",
|
|
1168
|
-
overflowY: "auto",
|
|
1169
|
-
minWidth: 0,
|
|
1170
|
-
minHeight: 0,
|
|
1171
|
-
padding: "var(--mantine-spacing-md)",
|
|
1172
|
-
paddingTop: `${topbarHeight + mdSpacing}px`
|
|
1173
|
-
},
|
|
1174
|
-
children
|
|
1175
|
-
}
|
|
1176
|
-
);
|
|
1177
|
-
};
|
|
1178
|
-
var SubshellSidebar = ({
|
|
1179
|
-
children,
|
|
1180
|
-
className,
|
|
1181
|
-
width,
|
|
1182
|
-
collapsible = true,
|
|
1183
|
-
defaultOpen = true
|
|
1184
|
-
}) => {
|
|
1185
|
-
const [isOpen, setIsOpen] = useState(defaultOpen);
|
|
1186
|
-
const effectiveWidth = collapsible && !isOpen ? 0 : width;
|
|
1187
|
-
if (!collapsible) {
|
|
1188
|
-
return /* @__PURE__ */ jsx(
|
|
1189
|
-
"aside",
|
|
1190
|
-
{
|
|
1191
|
-
className,
|
|
1192
|
-
style: {
|
|
1193
|
-
width: `${width}px`,
|
|
1194
|
-
flexShrink: 0,
|
|
1195
|
-
display: "flex",
|
|
1196
|
-
flexDirection: "column",
|
|
1197
|
-
backgroundColor: "color-mix(in srgb, var(--glass-background) 80%, transparent)",
|
|
1198
|
-
backdropFilter: "var(--glass-blur)",
|
|
1199
|
-
WebkitBackdropFilter: "var(--glass-blur)",
|
|
1200
|
-
borderRight: "1px solid var(--color-border)",
|
|
1201
|
-
boxShadow: "var(--card-shadow)",
|
|
1202
|
-
clipPath: "inset(-100px -100px -100px 0)",
|
|
1203
|
-
height: `calc(100vh - ${topbarHeight}px)`,
|
|
1204
|
-
minHeight: 0,
|
|
1205
|
-
marginTop: `${topbarHeight}px`,
|
|
1206
|
-
fontFamily: "var(--elevasis-font-family-subtitle)",
|
|
1207
|
-
overflow: "hidden"
|
|
1208
|
-
},
|
|
1209
|
-
children
|
|
1210
|
-
}
|
|
1211
|
-
);
|
|
1212
|
-
}
|
|
1213
|
-
return /* @__PURE__ */ jsxs(
|
|
1214
|
-
"div",
|
|
1215
|
-
{
|
|
1216
|
-
style: {
|
|
1217
|
-
position: "relative",
|
|
1218
|
-
flexShrink: 0,
|
|
1219
|
-
marginTop: `${topbarHeight}px`,
|
|
1220
|
-
height: `calc(100vh - ${topbarHeight}px)`,
|
|
1221
|
-
minHeight: 0
|
|
1222
|
-
},
|
|
1223
|
-
children: [
|
|
1224
|
-
/* @__PURE__ */ jsx(
|
|
1225
|
-
"aside",
|
|
1226
|
-
{
|
|
1227
|
-
className,
|
|
1228
|
-
style: {
|
|
1229
|
-
width: `${effectiveWidth}px`,
|
|
1230
|
-
flexShrink: 0,
|
|
1231
|
-
display: "flex",
|
|
1232
|
-
flexDirection: "column",
|
|
1233
|
-
backgroundColor: "color-mix(in srgb, var(--glass-background) 80%, transparent)",
|
|
1234
|
-
backdropFilter: "var(--glass-blur)",
|
|
1235
|
-
WebkitBackdropFilter: "var(--glass-blur)",
|
|
1236
|
-
borderRight: isOpen ? "1px solid var(--color-border)" : "none",
|
|
1237
|
-
boxShadow: isOpen ? "var(--card-shadow)" : "none",
|
|
1238
|
-
clipPath: isOpen ? "inset(-100px -100px -100px 0)" : "none",
|
|
1239
|
-
height: "100%",
|
|
1240
|
-
fontFamily: "var(--elevasis-font-family-subtitle)",
|
|
1241
|
-
overflow: "hidden",
|
|
1242
|
-
transition: `width ${sidebarTransitionDuration}ms var(--easing)`
|
|
1243
|
-
},
|
|
1244
|
-
children: /* @__PURE__ */ jsx(
|
|
1245
|
-
"div",
|
|
1246
|
-
{
|
|
1247
|
-
style: {
|
|
1248
|
-
width: `${width}px`,
|
|
1249
|
-
flexShrink: 0,
|
|
1250
|
-
height: "100%",
|
|
1251
|
-
minHeight: 0,
|
|
1252
|
-
display: "flex",
|
|
1253
|
-
flexDirection: "column",
|
|
1254
|
-
opacity: isOpen ? 1 : 0,
|
|
1255
|
-
transition: `opacity var(--duration-fast) var(--easing)`
|
|
1256
|
-
},
|
|
1257
|
-
children
|
|
1258
|
-
}
|
|
1259
|
-
)
|
|
1260
|
-
}
|
|
1261
|
-
),
|
|
1262
|
-
/* @__PURE__ */ jsx(
|
|
1263
|
-
"button",
|
|
1264
|
-
{
|
|
1265
|
-
onClick: () => setIsOpen((prev) => !prev),
|
|
1266
|
-
style: {
|
|
1267
|
-
position: "absolute",
|
|
1268
|
-
right: 0,
|
|
1269
|
-
bottom: 0,
|
|
1270
|
-
transform: "translateX(100%)",
|
|
1271
|
-
width: "20px",
|
|
1272
|
-
// Match the live height of the outer Sidebar's bottom profile section.
|
|
1273
|
-
// SidebarBottomSection publishes --elevasis-sidebar-bottom-section-height
|
|
1274
|
-
// via ResizeObserver so this follows its actual height through
|
|
1275
|
-
// collapse/expand transitions. Falls back to the expanded-state
|
|
1276
|
-
// constant when rendered outside a Sidebar layout.
|
|
1277
|
-
height: `var(--elevasis-sidebar-bottom-section-height, ${sidebarBottomSectionHeight}px)`,
|
|
1278
|
-
display: "flex",
|
|
1279
|
-
alignItems: "center",
|
|
1280
|
-
justifyContent: "center",
|
|
1281
|
-
backgroundColor: "color-mix(in srgb, var(--glass-background) 80%, transparent)",
|
|
1282
|
-
backdropFilter: "var(--glass-blur)",
|
|
1283
|
-
WebkitBackdropFilter: "var(--glass-blur)",
|
|
1284
|
-
border: "1px solid var(--color-border)",
|
|
1285
|
-
borderLeft: "none",
|
|
1286
|
-
borderBottom: "none",
|
|
1287
|
-
borderRadius: "0 4px 0 0",
|
|
1288
|
-
cursor: "pointer",
|
|
1289
|
-
color: "var(--color-text-subtle)",
|
|
1290
|
-
padding: 0,
|
|
1291
|
-
zIndex: 10,
|
|
1292
|
-
transition: `color var(--duration-fast) var(--easing)`
|
|
1293
|
-
},
|
|
1294
|
-
"aria-label": isOpen ? "Collapse sidebar" : "Expand sidebar",
|
|
1295
|
-
children: /* @__PURE__ */ jsx(
|
|
1296
|
-
"svg",
|
|
1297
|
-
{
|
|
1298
|
-
width: "6",
|
|
1299
|
-
height: "10",
|
|
1300
|
-
viewBox: "0 0 8 12",
|
|
1301
|
-
fill: "none",
|
|
1302
|
-
style: {
|
|
1303
|
-
transform: isOpen ? void 0 : "rotate(180deg)",
|
|
1304
|
-
transition: `transform var(--duration-fast) var(--easing)`
|
|
1305
|
-
},
|
|
1306
|
-
children: /* @__PURE__ */ jsx(
|
|
1307
|
-
"path",
|
|
1308
|
-
{
|
|
1309
|
-
d: "M6 1L1 6L6 11",
|
|
1310
|
-
stroke: "currentColor",
|
|
1311
|
-
strokeWidth: "1.5",
|
|
1312
|
-
strokeLinecap: "round",
|
|
1313
|
-
strokeLinejoin: "round"
|
|
1314
|
-
}
|
|
1315
|
-
)
|
|
1316
|
-
}
|
|
1317
|
-
)
|
|
1318
|
-
}
|
|
1319
|
-
)
|
|
1320
|
-
]
|
|
1321
|
-
}
|
|
1322
|
-
);
|
|
1323
|
-
};
|
|
1324
1116
|
var SubshellNavList = ({ items }) => {
|
|
1325
1117
|
const { currentPath, navigate } = useRouterContext();
|
|
1326
1118
|
return /* @__PURE__ */ jsx(Fragment, { children: items.map((item) => {
|
|
@@ -1439,4 +1231,4 @@ var Topbar = ({ version, leftContent, children }) => {
|
|
|
1439
1231
|
] });
|
|
1440
1232
|
};
|
|
1441
1233
|
|
|
1442
|
-
export { AppShellCenteredContainer, AppShellContainer, AppShellContentContainer, AppShellError, AppShellLoader, AppShellRightSideContainer, AppShellRightSideOuterContainer, AppTopbarAdjusterWrapper,
|
|
1234
|
+
export { AppShellCenteredContainer, AppShellContainer, AppShellContentContainer, AppShellError, AppShellLoader, AppShellRightSideContainer, AppShellRightSideOuterContainer, AppTopbarAdjusterWrapper, CollapsibleSidebarGroup, CyberParticles, LinksGroup, PageContainer, Sidebar, SidebarContext, SidebarProvider, SubshellLoader, SubshellNavList, SubshellSidebarLoader, Topbar, TopbarContainer, Vignette, subsidebarWidth, useSidebar, useSidebarCollapse };
|