@elevasis/ui 2.9.1 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/index.css +137 -0
- package/dist/app/index.d.ts +223 -0
- package/dist/app/index.js +95 -0
- package/dist/charts/index.js +3 -2
- package/dist/{chunk-NYMKWGKN.js → chunk-4BF74JVD.js} +110 -7
- package/dist/{chunk-47YILFON.js → chunk-6PNHW4X2.js} +159 -144
- package/dist/chunk-ADSSLKKP.js +10 -0
- package/dist/chunk-AEBKE4IX.js +13 -0
- package/dist/{chunk-C2OFFC7J.js → chunk-AL23U6C3.js} +3 -2
- package/dist/{chunk-27COZ5AH.js → chunk-CEWTOKE7.js} +3 -50
- package/dist/{chunk-AQQYVAFK.js → chunk-CLXMNMIS.js} +8 -7
- package/dist/{chunk-4PHPENKX.js → chunk-E3IFHX6A.js} +27 -377
- package/dist/{chunk-CYXZHBP4.js → chunk-F4TPY6YL.js} +14 -3
- package/dist/chunk-G2TDX3W6.js +5 -0
- package/dist/{chunk-CTWYIRKW.js → chunk-GJVGV7QZ.js} +24 -34
- package/dist/chunk-IIMU5YAJ.js +53 -0
- package/dist/{chunk-VNUOQQNY.js → chunk-KYOF6NYW.js} +2 -2
- package/dist/{chunk-W4VYXIN7.js → chunk-L4XXM55J.js} +3 -142
- package/dist/{chunk-YCHZ4U5V.js → chunk-LPSBID5V.js} +5 -13
- package/dist/{chunk-F5QSLYUB.js → chunk-LW5NKRI7.js} +1189 -1300
- package/dist/{chunk-KGEYEUR5.js → chunk-M6ZZ2FW5.js} +7 -6
- package/dist/{chunk-OPT74SGF.js → chunk-N5CLIRBS.js} +31 -176
- package/dist/chunk-R7WLWGPO.js +126 -0
- package/dist/{chunk-Y3D3WFJG.js → chunk-SQQGLGHW.js} +2 -11
- package/dist/{chunk-KFICYU6S.js → chunk-STZJ7SY5.js} +1 -1
- package/dist/chunk-SZHARWKU.js +15 -0
- package/dist/{chunk-7PDDPNQS.js → chunk-TSX4I3NW.js} +3 -3
- package/dist/chunk-V7XHGJQZ.js +145 -0
- package/dist/{chunk-UE5QQDCR.js → chunk-WHQXDETX.js} +5 -5
- package/dist/{chunk-4JPW5U5I.js → chunk-XB4NWSI3.js} +53 -54
- package/dist/{chunk-ZZ35VSNF.js → chunk-YQLE5HR5.js} +4 -4
- package/dist/components/index.d.ts +6 -253
- package/dist/components/index.js +31 -25
- package/dist/features/auth/index.d.ts +0 -107
- package/dist/features/auth/index.js +0 -1
- package/dist/features/crm/index.d.ts +3 -136
- package/dist/features/crm/index.js +14 -9
- package/dist/features/dashboard/index.js +13 -9
- package/dist/features/delivery/index.d.ts +3 -137
- package/dist/features/delivery/index.js +15 -9
- package/dist/features/lead-gen/index.d.ts +3 -29
- package/dist/features/lead-gen/index.js +20 -14
- package/dist/features/monitoring/index.d.ts +3 -30
- package/dist/features/monitoring/index.js +14 -10
- package/dist/features/operations/index.d.ts +18 -1324
- package/dist/features/operations/index.js +18 -13
- package/dist/features/seo/index.d.ts +3 -30
- package/dist/features/seo/index.js +3 -2
- package/dist/features/settings/index.d.ts +6 -146
- package/dist/features/settings/index.js +13 -9
- package/dist/hooks/index.d.ts +10 -1403
- package/dist/hooks/index.js +11 -7
- package/dist/hooks/published.d.ts +10 -1403
- package/dist/hooks/published.js +11 -7
- package/dist/index.d.ts +97 -1510
- package/dist/index.js +12 -8
- package/dist/initialization/index.d.ts +3 -117
- package/dist/layout/index.d.ts +12 -2
- package/dist/layout/index.js +5 -4
- package/dist/organization/index.d.ts +3 -10
- package/dist/organization/index.js +2 -1
- package/dist/profile/index.d.ts +0 -107
- package/dist/provider/index.d.ts +45 -65
- package/dist/provider/index.js +10 -6
- package/dist/provider/published.d.ts +45 -65
- package/dist/provider/published.js +6 -3
- package/dist/supabase/index.d.ts +0 -209
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +3 -3
- package/dist/typeform/index.js +10 -10
- package/dist/types/index.d.ts +68 -1738
- package/package.json +20 -4
- package/src/app/README.md +24 -0
- package/dist/chunk-IDACMRGQ.js +0 -115
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
2
2
|
import { CustomModal } from './chunk-GBMNCNHX.js';
|
|
3
3
|
import { AppShellLoader } from './chunk-YEX4MQSY.js';
|
|
4
|
-
import { useAvailablePresets } from './chunk-
|
|
5
|
-
import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas, showErrorNotification } from './chunk-
|
|
6
|
-
import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-
|
|
4
|
+
import { useAvailablePresets } from './chunk-KYOF6NYW.js';
|
|
5
|
+
import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas, showErrorNotification } from './chunk-E3IFHX6A.js';
|
|
6
|
+
import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-SQQGLGHW.js';
|
|
7
7
|
import { formatDateTime, OAUTH_POPUP_CHECK_INTERVAL, OAUTH_FLOW_TIMEOUT } from './chunk-IOKL7BKE.js';
|
|
8
8
|
import { useInitialization } from './chunk-TUXTSEAF.js';
|
|
9
9
|
import { useElevasisServices } from './chunk-QEPXAWE2.js';
|
|
@@ -491,8 +491,9 @@ function OAuthConnectModal({ opened, onClose, provider, onConnect, error, isLoad
|
|
|
491
491
|
] }) });
|
|
492
492
|
}
|
|
493
493
|
var FEATURES = [
|
|
494
|
-
{ key: "
|
|
495
|
-
{ key: "
|
|
494
|
+
{ key: "crm", label: "CRM" },
|
|
495
|
+
{ key: "lead-gen", label: "Lead Gen" },
|
|
496
|
+
{ key: "projects", label: "Projects" },
|
|
496
497
|
{ key: "seo", label: "SEO" }
|
|
497
498
|
];
|
|
498
499
|
function MembershipFeaturePanel({
|
|
@@ -2003,7 +2004,7 @@ function OAuthIntegrationsCard({ apiUrl }) {
|
|
|
2003
2004
|
}
|
|
2004
2005
|
var settingsManifest = {
|
|
2005
2006
|
key: "settings",
|
|
2006
|
-
|
|
2007
|
+
featureId: "settings",
|
|
2007
2008
|
navEntry: {
|
|
2008
2009
|
label: "Settings",
|
|
2009
2010
|
icon: IconSettings,
|
|
@@ -1,137 +1,11 @@
|
|
|
1
1
|
import { SubshellContainer, SubshellSidebar, SubshellRightSideContainer } from './chunk-RX4UWZZR.js';
|
|
2
|
-
import { FeatureUnavailableState } from './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import { OrganizationProvider } from './chunk-W4VYXIN7.js';
|
|
5
|
-
import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-IOKL7BKE.js';
|
|
6
|
-
import { useInitialization, InitializationProvider } from './chunk-TUXTSEAF.js';
|
|
2
|
+
import { FeatureUnavailableState } from './chunk-SQQGLGHW.js';
|
|
3
|
+
import { useInitialization } from './chunk-TUXTSEAF.js';
|
|
7
4
|
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
8
|
-
import { ProfileProvider, ElevasisServiceProvider } from './chunk-QEPXAWE2.js';
|
|
9
|
-
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
10
5
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
11
|
-
import { createContext,
|
|
6
|
+
import { createContext, useMemo, useCallback, useContext } from 'react';
|
|
12
7
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
13
|
-
import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
|
|
14
8
|
|
|
15
|
-
var consoleAdapter = {
|
|
16
|
-
success(title, message) {
|
|
17
|
-
console.log(`[Notification][Success] ${title}: ${message}`);
|
|
18
|
-
},
|
|
19
|
-
error(title, message) {
|
|
20
|
-
console.warn(`[Notification][Error] ${title}: ${message}`);
|
|
21
|
-
},
|
|
22
|
-
info(title, message) {
|
|
23
|
-
console.log(`[Notification][Info] ${title}: ${message}`);
|
|
24
|
-
},
|
|
25
|
-
warning(title, message) {
|
|
26
|
-
console.warn(`[Notification][Warning] ${title}: ${message}`);
|
|
27
|
-
},
|
|
28
|
-
apiError(error) {
|
|
29
|
-
const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
|
|
30
|
-
const title = getErrorTitle(code);
|
|
31
|
-
const formatted = formatErrorMessage(message, requestId, fields, retryAfter);
|
|
32
|
-
console.warn(`[Notification][API Error] ${title}: ${formatted}`);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var NotificationContext = createContext(consoleAdapter);
|
|
36
|
-
function NotificationProvider({ adapter, children }) {
|
|
37
|
-
return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: adapter, children });
|
|
38
|
-
}
|
|
39
|
-
function useNotificationAdapter() {
|
|
40
|
-
return useContext(NotificationContext);
|
|
41
|
-
}
|
|
42
|
-
var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-I32JCNE7.js').then((m) => ({ default: m.CoreAuthKitInner })));
|
|
43
|
-
var defaultQueryClient = null;
|
|
44
|
-
function getDefaultQueryClient() {
|
|
45
|
-
if (!defaultQueryClient) {
|
|
46
|
-
defaultQueryClient = new QueryClient({
|
|
47
|
-
defaultOptions: { queries: { retry: 1 } }
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return defaultQueryClient;
|
|
51
|
-
}
|
|
52
|
-
var consoleNotificationAdapter = {
|
|
53
|
-
success(title, message) {
|
|
54
|
-
console.log(`[Notification][Success] ${title}: ${message}`);
|
|
55
|
-
},
|
|
56
|
-
error(title, message) {
|
|
57
|
-
console.warn(`[Notification][Error] ${title}: ${message}`);
|
|
58
|
-
},
|
|
59
|
-
info(title, message) {
|
|
60
|
-
console.log(`[Notification][Info] ${title}: ${message}`);
|
|
61
|
-
},
|
|
62
|
-
warning(title, message) {
|
|
63
|
-
console.warn(`[Notification][Warning] ${title}: ${message}`);
|
|
64
|
-
},
|
|
65
|
-
apiError(error) {
|
|
66
|
-
console.warn(`[Notification][API Error]`, error);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
function ElevasisCoreProvider({
|
|
70
|
-
auth,
|
|
71
|
-
queryClient,
|
|
72
|
-
apiUrl,
|
|
73
|
-
onError,
|
|
74
|
-
notifications,
|
|
75
|
-
children
|
|
76
|
-
}) {
|
|
77
|
-
if (auth.mode === "apiKey") {
|
|
78
|
-
throw new Error(
|
|
79
|
-
`ElevasisCoreProvider: auth mode 'apiKey' is not yet implemented. Only 'authkit' mode is supported.`
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
const resolvedQueryClient = queryClient ?? getDefaultQueryClient();
|
|
83
|
-
const content = apiUrl ? /* @__PURE__ */ jsx(ServiceStack, { apiUrl, onError, notifications, children }) : children;
|
|
84
|
-
const AuthInner = /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCoreAuthKitInner, { auth, children: content }) });
|
|
85
|
-
return /* @__PURE__ */ jsx(QueryClientProvider, { client: resolvedQueryClient, children: AuthInner });
|
|
86
|
-
}
|
|
87
|
-
function ServiceStack({
|
|
88
|
-
apiUrl,
|
|
89
|
-
onError,
|
|
90
|
-
notifications,
|
|
91
|
-
children
|
|
92
|
-
}) {
|
|
93
|
-
const { getAccessToken } = useAuthContext();
|
|
94
|
-
const orgIdRef = useRef(null);
|
|
95
|
-
const getOrganizationId = useRef(() => orgIdRef.current).current;
|
|
96
|
-
return /* @__PURE__ */ jsx(
|
|
97
|
-
ApiClientProvider,
|
|
98
|
-
{
|
|
99
|
-
getAccessToken,
|
|
100
|
-
getOrganizationId,
|
|
101
|
-
isOrganizationReady: false,
|
|
102
|
-
onError,
|
|
103
|
-
children: /* @__PURE__ */ jsx(ServiceStackInner, { apiUrl, orgIdRef, notifications, children })
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
function ServiceStackInner({
|
|
108
|
-
apiUrl,
|
|
109
|
-
orgIdRef,
|
|
110
|
-
notifications,
|
|
111
|
-
children
|
|
112
|
-
}) {
|
|
113
|
-
const { apiRequest } = useApiClient(apiUrl);
|
|
114
|
-
const resolvedNotifications = notifications ?? consoleNotificationAdapter;
|
|
115
|
-
return /* @__PURE__ */ jsx(ProfileProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrganizationProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrgServiceBridge, { orgIdRef, apiRequest, notifications: resolvedNotifications, children }) }) });
|
|
116
|
-
}
|
|
117
|
-
function OrgServiceBridge({
|
|
118
|
-
orgIdRef,
|
|
119
|
-
apiRequest,
|
|
120
|
-
notifications,
|
|
121
|
-
children
|
|
122
|
-
}) {
|
|
123
|
-
const { currentWorkOSOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
|
|
124
|
-
orgIdRef.current = currentWorkOSOrganizationId;
|
|
125
|
-
const isReady = !!currentWorkOSOrganizationId && !isInitializing && !isOrgRefreshing;
|
|
126
|
-
return /* @__PURE__ */ jsx(ElevasisServiceProvider, { apiRequest, organizationId: currentWorkOSOrganizationId, isReady, children: /* @__PURE__ */ jsx(NotificationProvider, { adapter: notifications, children: /* @__PURE__ */ jsx(InitializationProvider, { children }) }) });
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// src/hooks/feature-access/aliases.ts
|
|
130
|
-
var FEATURE_KEY_ALIASES = {
|
|
131
|
-
crm: "acquisition",
|
|
132
|
-
"lead-gen": "acquisition",
|
|
133
|
-
projects: "delivery"
|
|
134
|
-
};
|
|
135
9
|
function createFeatureAccessHook({
|
|
136
10
|
useInitialization: useInitialization2,
|
|
137
11
|
useOrganization: useOrganization2
|
|
@@ -147,12 +21,10 @@ function createFeatureAccessHook({
|
|
|
147
21
|
const userConfig = profile?.config;
|
|
148
22
|
const checkFeature = useCallback(
|
|
149
23
|
(featureKey) => {
|
|
150
|
-
const normalizedFeatureKey = FEATURE_KEY_ALIASES[featureKey] ?? featureKey;
|
|
151
|
-
const key = normalizedFeatureKey;
|
|
152
24
|
if (profile?.is_platform_admin) {
|
|
153
25
|
return { allowed: true, restrictedBy: null };
|
|
154
26
|
}
|
|
155
|
-
const membershipValue = membershipConfig?.features?.[
|
|
27
|
+
const membershipValue = membershipConfig?.features?.[featureKey];
|
|
156
28
|
if (membershipValue === false) return { allowed: false, restrictedBy: "membership" };
|
|
157
29
|
return { allowed: true, restrictedBy: null };
|
|
158
30
|
},
|
|
@@ -201,31 +73,20 @@ function validateManifests(manifests, organizationModel) {
|
|
|
201
73
|
if (!organizationModel) {
|
|
202
74
|
return;
|
|
203
75
|
}
|
|
204
|
-
const
|
|
205
|
-
const validDomainIds = new Set(organizationModel.domains.map((d) => d.id));
|
|
76
|
+
const validFeatureIds = new Set(organizationModel.features.map((f) => f.id));
|
|
206
77
|
const validCapabilityIds = /* @__PURE__ */ new Set([
|
|
207
|
-
...organizationModel.
|
|
78
|
+
...organizationModel.features.flatMap((f) => f.capabilityIds),
|
|
208
79
|
...organizationModel.navigation.surfaces.flatMap((s) => s.capabilityIds),
|
|
209
80
|
...organizationModel.resourceMappings.flatMap((r) => r.capabilityIds)
|
|
210
81
|
]);
|
|
211
82
|
const errors = [];
|
|
212
83
|
for (const manifest of manifests) {
|
|
213
84
|
const key = manifest.key;
|
|
214
|
-
if (!
|
|
85
|
+
if (!validFeatureIds.has(manifest.featureId)) {
|
|
215
86
|
errors.push(
|
|
216
|
-
`Manifest "${key}":
|
|
87
|
+
`Manifest "${key}": featureId "${manifest.featureId}" is not a known feature id. Valid values: ${[...validFeatureIds].sort().join(", ")}`
|
|
217
88
|
);
|
|
218
89
|
}
|
|
219
|
-
if (manifest.domainIds) {
|
|
220
|
-
for (let i = 0; i < manifest.domainIds.length; i++) {
|
|
221
|
-
const domainId = manifest.domainIds[i];
|
|
222
|
-
if (!validDomainIds.has(domainId)) {
|
|
223
|
-
errors.push(
|
|
224
|
-
`Manifest "${key}": domainIds[${i}] references unknown domain "${domainId}". Valid domains: ${[...validDomainIds].sort().join(", ")}`
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
90
|
if (manifest.capabilityIds) {
|
|
230
91
|
for (let i = 0; i < manifest.capabilityIds.length; i++) {
|
|
231
92
|
const capabilityId = manifest.capabilityIds[i];
|
|
@@ -261,11 +122,11 @@ function useElevasisFeatures() {
|
|
|
261
122
|
function useOptionalElevasisFeatures() {
|
|
262
123
|
return useContext(ElevasisFeaturesContext);
|
|
263
124
|
}
|
|
264
|
-
function
|
|
125
|
+
function findOrganizationModelFeature(organizationModel, featureId) {
|
|
265
126
|
if (!organizationModel) {
|
|
266
|
-
return
|
|
127
|
+
return void 0;
|
|
267
128
|
}
|
|
268
|
-
return
|
|
129
|
+
return organizationModel.features.find((f) => f.id === featureId);
|
|
269
130
|
}
|
|
270
131
|
function findSurfaceByPath(organizationModel, path) {
|
|
271
132
|
if (!organizationModel) {
|
|
@@ -289,23 +150,21 @@ function findSurfacesByPaths(organizationModel, paths) {
|
|
|
289
150
|
(surface) => normalizedPaths.has(normalizeRoutePath(surface.path))
|
|
290
151
|
);
|
|
291
152
|
}
|
|
292
|
-
function getOrganizationModelFeatureLabel(organizationModel,
|
|
293
|
-
if (!organizationModel || !
|
|
153
|
+
function getOrganizationModelFeatureLabel(organizationModel, featureId) {
|
|
154
|
+
if (!organizationModel || !featureId) {
|
|
294
155
|
return void 0;
|
|
295
156
|
}
|
|
296
|
-
|
|
297
|
-
return void 0;
|
|
298
|
-
}
|
|
299
|
-
return organizationModel.features.labels[key];
|
|
157
|
+
return findOrganizationModelFeature(organizationModel, featureId)?.label;
|
|
300
158
|
}
|
|
301
|
-
function isOrganizationModelFeatureEnabled(organizationModel,
|
|
159
|
+
function isOrganizationModelFeatureEnabled(organizationModel, featureId) {
|
|
302
160
|
if (!organizationModel) {
|
|
303
161
|
return void 0;
|
|
304
162
|
}
|
|
305
|
-
|
|
163
|
+
const feature = findOrganizationModelFeature(organizationModel, featureId);
|
|
164
|
+
if (!feature) {
|
|
306
165
|
return void 0;
|
|
307
166
|
}
|
|
308
|
-
return
|
|
167
|
+
return feature.enabled;
|
|
309
168
|
}
|
|
310
169
|
function resolveOrganizationGraphSurface(features, organizationModel) {
|
|
311
170
|
for (const feature of features) {
|
|
@@ -319,7 +178,7 @@ function resolveOrganizationGraphSurface(features, organizationModel) {
|
|
|
319
178
|
surfaceId: graphBridge.surfaceId,
|
|
320
179
|
surfacePath: surface?.path,
|
|
321
180
|
surfaceType: surface?.surfaceType,
|
|
322
|
-
|
|
181
|
+
featureId: surface?.featureId
|
|
323
182
|
};
|
|
324
183
|
}
|
|
325
184
|
return {
|
|
@@ -365,10 +224,6 @@ function resolveFeatureSemantics(feature, resolvedFeature, organizationModel) {
|
|
|
365
224
|
(surface, index, items) => Boolean(surface) && items.findIndex((candidate) => candidate.id === surface.id) === index
|
|
366
225
|
);
|
|
367
226
|
return {
|
|
368
|
-
domainIds: uniqueIds([
|
|
369
|
-
...feature.domainIds ?? [],
|
|
370
|
-
...surfaces.flatMap((surface) => surface.domainIds)
|
|
371
|
-
]),
|
|
372
227
|
capabilityIds: uniqueIds([
|
|
373
228
|
...feature.capabilityIds ?? [],
|
|
374
229
|
...surfaces.flatMap((surface) => surface.capabilityIds)
|
|
@@ -380,13 +235,12 @@ function resolveFeatureSemantics(feature, resolvedFeature, organizationModel) {
|
|
|
380
235
|
function resolveFeatureModules(features, organizationModel, isFeatureEnabled) {
|
|
381
236
|
return features.map((feature) => {
|
|
382
237
|
const resolvedFeature = resolveFeatureModule(feature, organizationModel);
|
|
383
|
-
const
|
|
238
|
+
const featureId = feature.featureId;
|
|
384
239
|
return {
|
|
385
240
|
...resolvedFeature,
|
|
386
241
|
access: {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
enabled: isFeatureEnabled(accessFeatureKey)
|
|
242
|
+
featureId,
|
|
243
|
+
enabled: isFeatureEnabled(featureId)
|
|
390
244
|
},
|
|
391
245
|
semantics: resolveFeatureSemantics(feature, resolvedFeature, organizationModel)
|
|
392
246
|
};
|
|
@@ -409,20 +263,20 @@ function filterNavLinks(links, disabledSubsectionPaths, isFeatureEnabled) {
|
|
|
409
263
|
];
|
|
410
264
|
});
|
|
411
265
|
}
|
|
412
|
-
function createShellNavItem(navEntry, placement, source,
|
|
266
|
+
function createShellNavItem(navEntry, placement, source, featureId, links = navEntry.links) {
|
|
413
267
|
return {
|
|
414
268
|
...navEntry,
|
|
415
269
|
links,
|
|
416
270
|
placement,
|
|
417
271
|
source,
|
|
418
|
-
|
|
272
|
+
featureId
|
|
419
273
|
};
|
|
420
274
|
}
|
|
421
275
|
function createFeatureShellNavItem(feature, links = feature.navEntry?.links) {
|
|
422
276
|
if (!feature.navEntry) {
|
|
423
277
|
return void 0;
|
|
424
278
|
}
|
|
425
|
-
return createShellNavItem(feature.navEntry, "primary", "feature", feature.access.
|
|
279
|
+
return createShellNavItem(feature.navEntry, "primary", "feature", feature.access.featureId, links);
|
|
426
280
|
}
|
|
427
281
|
function getFeatureNavItems(features, disabledSubsectionPaths, isFeatureEnabled) {
|
|
428
282
|
return features.flatMap((feature) => {
|
|
@@ -534,10 +388,11 @@ function ElevasisFeaturesProvider({
|
|
|
534
388
|
},
|
|
535
389
|
[hasFeature, organizationModel]
|
|
536
390
|
);
|
|
537
|
-
const normalizedDisabledSubsectionPaths = useMemo(
|
|
538
|
-
|
|
539
|
-
[
|
|
540
|
-
|
|
391
|
+
const normalizedDisabledSubsectionPaths = useMemo(() => {
|
|
392
|
+
const explicit = disabledSubsectionPaths.map((path) => normalizeRoutePath(path));
|
|
393
|
+
const fromModel = organizationModel?.navigation.surfaces.filter((s) => s.enabled === false).map((s) => normalizeRoutePath(s.path)) ?? [];
|
|
394
|
+
return [.../* @__PURE__ */ new Set([...explicit, ...fromModel])];
|
|
395
|
+
}, [disabledSubsectionPaths, organizationModel]);
|
|
541
396
|
const resolvedFeatures = useMemo(
|
|
542
397
|
() => resolveFeatureModules(features, organizationModel, hasResolvedFeature),
|
|
543
398
|
[features, organizationModel, hasResolvedFeature]
|
|
@@ -650,4 +505,4 @@ function FeatureShell({ children }) {
|
|
|
650
505
|
] });
|
|
651
506
|
}
|
|
652
507
|
|
|
653
|
-
export {
|
|
508
|
+
export { ElevasisFeaturesProvider, FeatureShell, createFeatureAccessHook, createUseFeatureAccess, useElevasisFeatures, useOptionalElevasisFeatures };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ApiClientProvider, useApiClient } from './chunk-NVOCKXUQ.js';
|
|
2
|
+
import { OrganizationProvider } from './chunk-V7XHGJQZ.js';
|
|
3
|
+
import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-IOKL7BKE.js';
|
|
4
|
+
import { InitializationProvider } from './chunk-TUXTSEAF.js';
|
|
5
|
+
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
6
|
+
import { ProfileProvider, ElevasisServiceProvider } from './chunk-QEPXAWE2.js';
|
|
7
|
+
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
8
|
+
import { createContext, lazy, useContext, Suspense, useRef } from 'react';
|
|
9
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
|
+
import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
|
|
11
|
+
|
|
12
|
+
var consoleAdapter = {
|
|
13
|
+
success(title, message) {
|
|
14
|
+
console.log(`[Notification][Success] ${title}: ${message}`);
|
|
15
|
+
},
|
|
16
|
+
error(title, message) {
|
|
17
|
+
console.warn(`[Notification][Error] ${title}: ${message}`);
|
|
18
|
+
},
|
|
19
|
+
info(title, message) {
|
|
20
|
+
console.log(`[Notification][Info] ${title}: ${message}`);
|
|
21
|
+
},
|
|
22
|
+
warning(title, message) {
|
|
23
|
+
console.warn(`[Notification][Warning] ${title}: ${message}`);
|
|
24
|
+
},
|
|
25
|
+
apiError(error) {
|
|
26
|
+
const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
|
|
27
|
+
const title = getErrorTitle(code);
|
|
28
|
+
const formatted = formatErrorMessage(message, requestId, fields, retryAfter);
|
|
29
|
+
console.warn(`[Notification][API Error] ${title}: ${formatted}`);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var NotificationContext = createContext(consoleAdapter);
|
|
33
|
+
function NotificationProvider({ adapter, children }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: adapter, children });
|
|
35
|
+
}
|
|
36
|
+
function useNotificationAdapter() {
|
|
37
|
+
return useContext(NotificationContext);
|
|
38
|
+
}
|
|
39
|
+
var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-I32JCNE7.js').then((m) => ({ default: m.CoreAuthKitInner })));
|
|
40
|
+
var defaultQueryClient = null;
|
|
41
|
+
function getDefaultQueryClient() {
|
|
42
|
+
if (!defaultQueryClient) {
|
|
43
|
+
defaultQueryClient = new QueryClient({
|
|
44
|
+
defaultOptions: { queries: { retry: 1 } }
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return defaultQueryClient;
|
|
48
|
+
}
|
|
49
|
+
var consoleNotificationAdapter = {
|
|
50
|
+
success(title, message) {
|
|
51
|
+
console.log(`[Notification][Success] ${title}: ${message}`);
|
|
52
|
+
},
|
|
53
|
+
error(title, message) {
|
|
54
|
+
console.warn(`[Notification][Error] ${title}: ${message}`);
|
|
55
|
+
},
|
|
56
|
+
info(title, message) {
|
|
57
|
+
console.log(`[Notification][Info] ${title}: ${message}`);
|
|
58
|
+
},
|
|
59
|
+
warning(title, message) {
|
|
60
|
+
console.warn(`[Notification][Warning] ${title}: ${message}`);
|
|
61
|
+
},
|
|
62
|
+
apiError(error) {
|
|
63
|
+
console.warn(`[Notification][API Error]`, error);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
function ElevasisCoreProvider({
|
|
67
|
+
auth,
|
|
68
|
+
queryClient,
|
|
69
|
+
apiUrl,
|
|
70
|
+
onError,
|
|
71
|
+
notifications,
|
|
72
|
+
children
|
|
73
|
+
}) {
|
|
74
|
+
if (auth.mode === "apiKey") {
|
|
75
|
+
throw new Error(
|
|
76
|
+
`ElevasisCoreProvider: auth mode 'apiKey' is not yet implemented. Only 'authkit' mode is supported.`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
const resolvedQueryClient = queryClient ?? getDefaultQueryClient();
|
|
80
|
+
const content = apiUrl ? /* @__PURE__ */ jsx(ServiceStack, { apiUrl, onError, notifications, children }) : children;
|
|
81
|
+
const AuthInner = /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCoreAuthKitInner, { auth, children: content }) });
|
|
82
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, { client: resolvedQueryClient, children: AuthInner });
|
|
83
|
+
}
|
|
84
|
+
function ServiceStack({
|
|
85
|
+
apiUrl,
|
|
86
|
+
onError,
|
|
87
|
+
notifications,
|
|
88
|
+
children
|
|
89
|
+
}) {
|
|
90
|
+
const { getAccessToken } = useAuthContext();
|
|
91
|
+
const orgIdRef = useRef(null);
|
|
92
|
+
const getOrganizationId = useRef(() => orgIdRef.current).current;
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
ApiClientProvider,
|
|
95
|
+
{
|
|
96
|
+
getAccessToken,
|
|
97
|
+
getOrganizationId,
|
|
98
|
+
isOrganizationReady: false,
|
|
99
|
+
onError,
|
|
100
|
+
children: /* @__PURE__ */ jsx(ServiceStackInner, { apiUrl, orgIdRef, notifications, children })
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function ServiceStackInner({
|
|
105
|
+
apiUrl,
|
|
106
|
+
orgIdRef,
|
|
107
|
+
notifications,
|
|
108
|
+
children
|
|
109
|
+
}) {
|
|
110
|
+
const { apiRequest } = useApiClient(apiUrl);
|
|
111
|
+
const resolvedNotifications = notifications ?? consoleNotificationAdapter;
|
|
112
|
+
return /* @__PURE__ */ jsx(ProfileProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrganizationProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrgServiceBridge, { orgIdRef, apiRequest, notifications: resolvedNotifications, children }) }) });
|
|
113
|
+
}
|
|
114
|
+
function OrgServiceBridge({
|
|
115
|
+
orgIdRef,
|
|
116
|
+
apiRequest,
|
|
117
|
+
notifications,
|
|
118
|
+
children
|
|
119
|
+
}) {
|
|
120
|
+
const { currentWorkOSOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
|
|
121
|
+
orgIdRef.current = currentWorkOSOrganizationId;
|
|
122
|
+
const isReady = !!currentWorkOSOrganizationId && !isInitializing && !isOrgRefreshing;
|
|
123
|
+
return /* @__PURE__ */ jsx(ElevasisServiceProvider, { apiRequest, organizationId: currentWorkOSOrganizationId, isReady, children: /* @__PURE__ */ jsx(NotificationProvider, { adapter: notifications, children: /* @__PURE__ */ jsx(InitializationProvider, { children }) }) });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { ElevasisCoreProvider, NotificationProvider, useNotificationAdapter };
|
|
@@ -6,7 +6,7 @@ import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
|
6
6
|
import { Center, Stack, Title, Text, Button, Box, Loader, Badge, Group, Collapse, ScrollArea, Card, Select, Alert, Code, ThemeIcon, Paper, Grid, Timeline, Space } from '@mantine/core';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { IconMinus, IconTrendingUp, IconTrendingDown, IconChevronUp, IconChevronDown, IconAlertCircle, IconClock, IconInfoCircle, IconBan, IconChevronRight, IconInbox, IconHeartHandshake, IconUserOff, IconMailForward, IconBell, IconCalendarEvent, IconCalendarCancel, IconMessageReply, IconCircleCheck, IconCreditCard, IconX, IconEye, IconSend, IconFileText, IconArrowRight, IconPlus, IconActivity } from '@tabler/icons-react';
|
|
9
|
-
import {
|
|
9
|
+
import { useState } from 'react';
|
|
10
10
|
import { Prism } from 'react-syntax-highlighter';
|
|
11
11
|
import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
12
12
|
|
|
@@ -660,15 +660,6 @@ function CardHeader({ icon, title, subtitle, rightSection }) {
|
|
|
660
660
|
rightSection
|
|
661
661
|
] });
|
|
662
662
|
}
|
|
663
|
-
|
|
664
|
-
// src/components/display/ElevasisLoader.module.css.js
|
|
665
|
-
var ElevasisLoader_module_css_default = { "wrapper": "wrapper", "loader": "loader", "chevron": "chevron", "c1": "c1", "c2": "c2", "c3": "c3" };
|
|
666
|
-
var ElevasisLoader = forwardRef(({ style, className, ...others }, ref) => /* @__PURE__ */ jsx("div", { ref, style, className: `${ElevasisLoader_module_css_default.wrapper} ${className ?? ""}`, ...others, children: /* @__PURE__ */ jsxs("svg", { className: ElevasisLoader_module_css_default.loader, viewBox: "-10 -5 60 50", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
667
|
-
/* @__PURE__ */ jsx("polyline", { className: `${ElevasisLoader_module_css_default.chevron} ${ElevasisLoader_module_css_default.c1}`, points: "5,36 20,25 35,36" }),
|
|
668
|
-
/* @__PURE__ */ jsx("polyline", { className: `${ElevasisLoader_module_css_default.chevron} ${ElevasisLoader_module_css_default.c2}`, points: "9,23 20,14 31,23" }),
|
|
669
|
-
/* @__PURE__ */ jsx("polyline", { className: `${ElevasisLoader_module_css_default.chevron} ${ElevasisLoader_module_css_default.c3}`, points: "13,11 20,5 27,11" })
|
|
670
|
-
] }) }));
|
|
671
|
-
ElevasisLoader.displayName = "ElevasisLoader";
|
|
672
663
|
var SIZE_MAP = {
|
|
673
664
|
sm: { dot: 7, inner: 6, outer: 12 },
|
|
674
665
|
md: { dot: 10, inner: 8, outer: 16 },
|
|
@@ -764,4 +755,4 @@ function ActivityTimeline({ activities }) {
|
|
|
764
755
|
}) }) });
|
|
765
756
|
}
|
|
766
757
|
|
|
767
|
-
export { APIErrorAlert, ActivityTimeline, CardHeader, CenteredErrorState, CollapsibleSection, ContextViewer, CustomSelector, DetailCardSkeleton,
|
|
758
|
+
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getTimeRangeLabel, getTimeRangeDates, useErrorTrends, formatBucketTime } from './chunk-LXHZYSMQ.js';
|
|
2
|
-
import { CardHeader, CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-
|
|
2
|
+
import { CardHeader, CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-SQQGLGHW.js';
|
|
3
3
|
import { useRef, useState, useLayoutEffect, useEffect, useMemo, useCallback } from 'react';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import { useComputedColorScheme, Group, Text, Box, Stack, Center, Loader, Paper, Button, NumberFormatter, Badge, Space, Tooltip as Tooltip$1, SimpleGrid, Alert, SegmentedControl } from '@mantine/core';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/components/display/ElevasisLoader.tsx
|
|
5
|
+
|
|
6
|
+
// src/components/display/ElevasisLoader.module.css.js
|
|
7
|
+
var ElevasisLoader_module_css_default = { "wrapper": "wrapper", "loader": "loader", "chevron": "chevron", "c1": "c1", "c2": "c2", "c3": "c3" };
|
|
8
|
+
var ElevasisLoader = forwardRef(({ style, className, ...others }, ref) => /* @__PURE__ */ jsx("div", { ref, style, className: `${ElevasisLoader_module_css_default.wrapper} ${className ?? ""}`, ...others, children: /* @__PURE__ */ jsxs("svg", { className: ElevasisLoader_module_css_default.loader, viewBox: "-10 -5 60 50", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
9
|
+
/* @__PURE__ */ jsx("polyline", { className: `${ElevasisLoader_module_css_default.chevron} ${ElevasisLoader_module_css_default.c1}`, points: "5,36 20,25 35,36" }),
|
|
10
|
+
/* @__PURE__ */ jsx("polyline", { className: `${ElevasisLoader_module_css_default.chevron} ${ElevasisLoader_module_css_default.c2}`, points: "9,23 20,14 31,23" }),
|
|
11
|
+
/* @__PURE__ */ jsx("polyline", { className: `${ElevasisLoader_module_css_default.chevron} ${ElevasisLoader_module_css_default.c3}`, points: "13,11 20,5 27,11" })
|
|
12
|
+
] }) }));
|
|
13
|
+
ElevasisLoader.displayName = "ElevasisLoader";
|
|
14
|
+
|
|
15
|
+
export { ElevasisLoader };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-
|
|
2
|
-
import { useResourcesHealth } from './chunk-
|
|
1
|
+
import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-STZJ7SY5.js';
|
|
2
|
+
import { useResourcesHealth } from './chunk-E3IFHX6A.js';
|
|
3
3
|
import { getTimeRangeDates, formatBucketTime } from './chunk-LXHZYSMQ.js';
|
|
4
|
-
import { CardHeader, EmptyState } from './chunk-
|
|
4
|
+
import { CardHeader, EmptyState } from './chunk-SQQGLGHW.js';
|
|
5
5
|
import { Paper, Center, Loader, Group } from '@mantine/core';
|
|
6
6
|
import { IconActivity, IconChartBar } from '@tabler/icons-react';
|
|
7
7
|
import { useMemo } from 'react';
|