@elevasis/ui 2.65.0 → 2.66.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/app/index.d.ts +6 -0
- package/dist/app/index.js +5 -5
- package/dist/auth/index.d.ts +12 -5
- package/dist/auth/index.js +5 -5
- package/dist/charts/index.js +5 -5
- package/dist/{chunk-ZTWA5H77.js → chunk-6ZAP3FOA.js} +0 -1
- package/dist/{chunk-3WVZRN37.js → chunk-ANNM5R7S.js} +235 -365
- package/dist/chunk-L7BZZ4SI.js +56 -0
- package/dist/chunk-P45GQ3ZW.js +104 -0
- package/dist/{chunk-EIXSQONC.js → chunk-RT4KRGZT.js} +37 -59
- package/dist/components/index.d.ts +240 -209
- package/dist/components/index.js +5 -5
- package/dist/components/navigation/index.js +5 -5
- package/dist/execution/index.d.ts +115 -104
- package/dist/features/auth/index.d.ts +39 -8
- package/dist/features/auth/index.js +14 -9
- package/dist/features/clients/index.js +5 -5
- package/dist/features/crm/index.js +5 -5
- package/dist/features/dashboard/index.js +5 -5
- package/dist/features/delivery/index.js +5 -5
- package/dist/features/knowledge/index.js +5 -5
- package/dist/features/lead-gen/index.js +5 -5
- package/dist/features/monitoring/index.js +5 -5
- package/dist/features/monitoring/requests/index.js +6 -6
- package/dist/features/notes/index.js +2 -2
- package/dist/features/operations/index.d.ts +141 -105
- package/dist/features/operations/index.js +5 -5
- package/dist/features/settings/index.d.ts +1 -0
- package/dist/features/settings/index.js +5 -5
- package/dist/hooks/access/index.js +5 -5
- package/dist/hooks/delivery/index.js +5 -5
- package/dist/hooks/index.d.ts +284 -162
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +0 -2
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -1
- package/dist/hooks/published.d.ts +284 -162
- package/dist/hooks/published.js +5 -5
- package/dist/index.d.ts +374 -236
- package/dist/index.js +5 -5
- package/dist/initialization/index.d.ts +61 -28
- package/dist/initialization/index.js +3 -3
- package/dist/knowledge/index.js +9 -9
- package/dist/{knowledge-search-index-JOPRYZN6.js → knowledge-search-index-6EZNBNSR.js} +4 -4
- package/dist/layout/index.js +5 -5
- package/dist/organization/index.d.ts +49 -4
- package/dist/organization/index.js +5 -5
- package/dist/profile/index.d.ts +23 -2
- package/dist/profile/index.js +1 -1
- package/dist/provider/index.js +5 -5
- package/dist/provider/published.js +5 -5
- package/dist/types/index.d.ts +330 -271
- package/package.json +3 -3
- package/dist/chunk-LO7GWG24.js +0 -75
- package/dist/chunk-T4LA4RY2.js +0 -56
package/dist/chunk-LO7GWG24.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
2
|
-
import { useProfile } from './chunk-EIXSQONC.js';
|
|
3
|
-
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
4
|
-
import { createContext, useContext, useMemo, useCallback, createElement } from 'react';
|
|
5
|
-
|
|
6
|
-
var InitializationContext = createContext(null);
|
|
7
|
-
function useInitialization() {
|
|
8
|
-
const ctx = useContext(InitializationContext);
|
|
9
|
-
if (!ctx) {
|
|
10
|
-
throw new Error(
|
|
11
|
-
"useInitialization must be used within an InitializationProvider. Wrap your app (or the relevant subtree) with <InitializationProvider>."
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
return ctx;
|
|
15
|
-
}
|
|
16
|
-
function InitializationProvider({ children }) {
|
|
17
|
-
const { user, isLoading: authLoading } = useAuthContext();
|
|
18
|
-
const { profile, loading: profileLoading, error: profileError, refetch } = useProfile();
|
|
19
|
-
const {
|
|
20
|
-
isInitializing: orgInitializing,
|
|
21
|
-
isOrgRefreshing: orgLoading,
|
|
22
|
-
error: orgErrorMsg,
|
|
23
|
-
currentWorkOSOrganizationId,
|
|
24
|
-
memberships,
|
|
25
|
-
retry: orgRetry
|
|
26
|
-
} = useOrganization();
|
|
27
|
-
const isInitializing = authLoading || profileLoading || orgInitializing || orgLoading;
|
|
28
|
-
const userReady = !authLoading && !profileLoading && !!user && !!profile && !profileError;
|
|
29
|
-
const organizationReady = userReady && !orgInitializing && !orgLoading && !!currentWorkOSOrganizationId && !orgErrorMsg;
|
|
30
|
-
const allReady = organizationReady;
|
|
31
|
-
const error = useMemo(() => {
|
|
32
|
-
if (profileError) {
|
|
33
|
-
return {
|
|
34
|
-
layer: "profile",
|
|
35
|
-
message: "Failed to load user profile",
|
|
36
|
-
originalError: profileError
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (orgErrorMsg) {
|
|
40
|
-
return {
|
|
41
|
-
layer: "organization",
|
|
42
|
-
message: orgErrorMsg,
|
|
43
|
-
originalError: new Error(orgErrorMsg)
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
if (userReady && !orgInitializing && !orgLoading && !currentWorkOSOrganizationId && memberships.length > 0) {
|
|
47
|
-
return {
|
|
48
|
-
layer: "organization",
|
|
49
|
-
message: "No organization membership found. Please contact your administrator for an invitation."
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}, [profileError, orgErrorMsg, userReady, orgInitializing, orgLoading, currentWorkOSOrganizationId, memberships]);
|
|
54
|
-
const retry = useCallback(async () => {
|
|
55
|
-
if (profileError && refetch) {
|
|
56
|
-
await refetch();
|
|
57
|
-
}
|
|
58
|
-
await orgRetry();
|
|
59
|
-
}, [profileError, refetch, orgRetry]);
|
|
60
|
-
const value = useMemo(
|
|
61
|
-
() => ({
|
|
62
|
-
userReady,
|
|
63
|
-
organizationReady,
|
|
64
|
-
allReady,
|
|
65
|
-
isInitializing,
|
|
66
|
-
error,
|
|
67
|
-
retry,
|
|
68
|
-
profile
|
|
69
|
-
}),
|
|
70
|
-
[userReady, organizationReady, allReady, isInitializing, error, retry, profile]
|
|
71
|
-
);
|
|
72
|
-
return createElement(InitializationContext.Provider, { value }, children);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export { InitializationContext, InitializationProvider, useInitialization };
|
package/dist/chunk-T4LA4RY2.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { useUserProfile } from './chunk-EIXSQONC.js';
|
|
2
|
-
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
3
|
-
import { useMemo, useCallback } from 'react';
|
|
4
|
-
|
|
5
|
-
function createUseAppInitialization(useOrgInitialization) {
|
|
6
|
-
return function useAppInitialization() {
|
|
7
|
-
const { user, isLoading: authLoading } = useAuthContext();
|
|
8
|
-
const { profile, loading: profileLoading, error: profileError, refetch } = useUserProfile();
|
|
9
|
-
const {
|
|
10
|
-
isInitializing: orgInitializing,
|
|
11
|
-
isLoading: orgLoading,
|
|
12
|
-
error: orgErrorMsg,
|
|
13
|
-
currentOrganization,
|
|
14
|
-
memberships,
|
|
15
|
-
retry: orgRetry
|
|
16
|
-
} = useOrgInitialization();
|
|
17
|
-
const isInitializing = authLoading || profileLoading || orgInitializing || orgLoading;
|
|
18
|
-
const userReady = !authLoading && !profileLoading && !!user && !!profile && !profileError;
|
|
19
|
-
const organizationReady = userReady && !orgInitializing && !orgLoading && !!currentOrganization && !orgErrorMsg;
|
|
20
|
-
const allReady = organizationReady;
|
|
21
|
-
const error = useMemo(() => {
|
|
22
|
-
if (profileError) {
|
|
23
|
-
return {
|
|
24
|
-
layer: "profile",
|
|
25
|
-
message: "Failed to load user profile",
|
|
26
|
-
originalError: profileError
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
if (orgErrorMsg) {
|
|
30
|
-
return {
|
|
31
|
-
layer: "organization",
|
|
32
|
-
message: orgErrorMsg,
|
|
33
|
-
originalError: new Error(orgErrorMsg)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
if (userReady && !orgInitializing && !orgLoading && !currentOrganization && memberships.length > 0) {
|
|
37
|
-
return {
|
|
38
|
-
layer: "organization",
|
|
39
|
-
message: "No organization membership found. Please contact your administrator for an invitation."
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
}, [profileError, orgErrorMsg, userReady, orgInitializing, orgLoading, currentOrganization, memberships]);
|
|
44
|
-
const retry = useCallback(() => {
|
|
45
|
-
if (profileError && refetch) {
|
|
46
|
-
refetch();
|
|
47
|
-
}
|
|
48
|
-
if (orgErrorMsg && orgRetry) {
|
|
49
|
-
orgRetry();
|
|
50
|
-
}
|
|
51
|
-
}, [profileError, refetch, orgErrorMsg, orgRetry]);
|
|
52
|
-
return { userReady, organizationReady, allReady, isInitializing, error, retry, profile };
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { createUseAppInitialization };
|