@elevasis/ui 2.33.1 → 2.34.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.d.ts +9 -2
- package/dist/api/index.js +1 -1
- package/dist/app/index.css +452 -0
- package/dist/app/index.d.ts +1250 -3
- package/dist/app/index.js +144 -8
- package/dist/charts/index.js +2 -3
- package/dist/{chunk-3YZRKADM.js → chunk-3AJVNMY5.js} +45 -28
- package/dist/chunk-3QXJK5IY.js +25 -0
- package/dist/chunk-4O4MII5S.js +4716 -0
- package/dist/{chunk-KW7ZNQD7.js → chunk-5EYJ2GIN.js} +4 -8
- package/dist/{chunk-53436UTQ.js → chunk-BPQVTIUP.js} +12 -3
- package/dist/{chunk-DYIDXUJS.js → chunk-DTFKWZ7A.js} +1098 -2280
- package/dist/{chunk-EPTHX4VZ.js → chunk-HRWLKKWM.js} +11 -2
- package/dist/{chunk-SWMQTF2H.js → chunk-IGDYWFNE.js} +2 -2
- package/dist/{chunk-QVTIOT73.js → chunk-IVGI4GDL.js} +3 -3
- package/dist/{chunk-4DYOXEH6.js → chunk-LAWLB6CT.js} +1 -1
- package/dist/{chunk-UYRT7SPM.js → chunk-LRWTWOGP.js} +3 -3
- package/dist/{chunk-2VYMDNJ3.js → chunk-MP3GPBPX.js} +3 -3
- package/dist/{chunk-YENKDBUU.js → chunk-NLBQTDOW.js} +12 -17
- package/dist/{chunk-WJOE76FI.js → chunk-O6JXQ6UQ.js} +5 -4
- package/dist/{chunk-F3MXFE72.js → chunk-OBBQ2JCM.js} +3 -3
- package/dist/{chunk-WGUEIGPC.js → chunk-PLP3NYPL.js} +80 -171
- package/dist/{chunk-AV2TKVVV.js → chunk-RIAXZ6AH.js} +5 -6
- package/dist/chunk-SDXSB3HN.js +425 -0
- package/dist/{chunk-JA5ECJJB.js → chunk-VTXTZXAU.js} +156 -4
- package/dist/{chunk-H6EFQP2P.js → chunk-W73ZABT6.js} +1 -1
- package/dist/{chunk-UNVRVCXZ.js → chunk-WU4FNWCW.js} +3 -3
- package/dist/{chunk-NCEQGEW5.js → chunk-YNWZIWJL.js} +4 -5
- package/dist/components/index.d.ts +0 -23
- package/dist/components/index.js +27 -448
- package/dist/components/navigation/index.js +4 -6
- package/dist/features/clients/index.js +7 -12
- package/dist/features/crm/index.js +9 -14
- package/dist/features/dashboard/index.d.ts +0 -23
- package/dist/features/dashboard/index.js +9 -14
- package/dist/features/delivery/index.js +8 -13
- package/dist/features/knowledge/index.js +5 -7
- package/dist/features/lead-gen/index.js +9 -14
- package/dist/features/monitoring/index.js +10 -15
- package/dist/features/monitoring/requests/index.js +7 -12
- package/dist/features/operations/index.d.ts +44 -35
- package/dist/features/operations/index.js +12 -17
- package/dist/features/settings/index.js +8 -13
- package/dist/hooks/index.d.ts +20 -27
- package/dist/hooks/index.js +7 -12
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +20 -27
- package/dist/hooks/published.d.ts +20 -27
- package/dist/hooks/published.js +7 -12
- package/dist/index.d.ts +54 -39
- package/dist/index.js +8 -13
- package/dist/knowledge/index.d.ts +30 -38
- package/dist/knowledge/index.js +37 -201
- package/dist/{knowledge-search-index-P7PR626V.js → knowledge-search-index-ORIJCEZX.js} +142 -150
- package/dist/organization/index.js +1 -2
- package/dist/provider/index.d.ts +25 -32
- package/dist/provider/index.js +6 -11
- package/dist/provider/published.d.ts +25 -32
- package/dist/provider/published.js +5 -9
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.js +14 -2
- package/dist/test-utils/setup.js +38 -0
- package/dist/types/index.d.ts +20 -27
- package/dist/utils/index.d.ts +0 -23
- package/dist/zustand/index.d.ts +15 -2
- package/dist/zustand/index.js +35 -1
- package/package.json +5 -5
- package/dist/chunk-4AAZXKLL.js +0 -347
- package/dist/chunk-DWXDNT7P.js +0 -145
- package/dist/chunk-FOUYP4JX.js +0 -13
- package/dist/chunk-HUJCU55S.js +0 -159
- package/dist/chunk-PIS24NIV.js +0 -29
- package/dist/chunk-SZHARWKU.js +0 -15
- package/dist/chunk-XCYKC6OZ.js +0 -1
package/dist/chunk-HUJCU55S.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { OrganizationContext } from './chunk-DD3CCMCZ.js';
|
|
2
|
-
import { useProfile } from './chunk-2Q2JQSQO.js';
|
|
3
|
-
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
4
|
-
import { useState, useRef, useEffect, useCallback, createElement } from 'react';
|
|
5
|
-
import { useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
|
|
7
|
-
function OrganizationProvider({ apiRequest, children }) {
|
|
8
|
-
const { user, organizationId: workosOrgId } = useAuthContext();
|
|
9
|
-
const { profile, error: profileError } = useProfile();
|
|
10
|
-
const queryClient = useQueryClient();
|
|
11
|
-
const [memberships, setMemberships] = useState([]);
|
|
12
|
-
const [currentWorkOSOrganizationId, setCurrentWorkOSOrganizationId] = useState(null);
|
|
13
|
-
const [currentSupabaseOrganizationId, setCurrentSupabaseOrganizationId] = useState(null);
|
|
14
|
-
const [currentMembership, setCurrentMembership] = useState(null);
|
|
15
|
-
const [isInitializing, setIsInitializing] = useState(true);
|
|
16
|
-
const [isOrgRefreshing, setIsOrgRefreshing] = useState(false);
|
|
17
|
-
const [error, setError] = useState(null);
|
|
18
|
-
const hasInitializedRef = useRef(false);
|
|
19
|
-
const [profileLoaded, setProfileLoaded] = useState(false);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (profile !== void 0 && profile !== null) {
|
|
22
|
-
setProfileLoaded(true);
|
|
23
|
-
}
|
|
24
|
-
}, [profile]);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (profileError && isInitializing && !hasInitializedRef.current) {
|
|
27
|
-
setIsInitializing(false);
|
|
28
|
-
}
|
|
29
|
-
}, [profileError, isInitializing]);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (!user) {
|
|
32
|
-
setMemberships([]);
|
|
33
|
-
setCurrentWorkOSOrganizationId(null);
|
|
34
|
-
setCurrentSupabaseOrganizationId(null);
|
|
35
|
-
setCurrentMembership(null);
|
|
36
|
-
setIsInitializing(false);
|
|
37
|
-
setIsOrgRefreshing(false);
|
|
38
|
-
setError(null);
|
|
39
|
-
hasInitializedRef.current = false;
|
|
40
|
-
setProfileLoaded(false);
|
|
41
|
-
}
|
|
42
|
-
}, [user]);
|
|
43
|
-
const applyMembership = useCallback((membership) => {
|
|
44
|
-
setCurrentMembership(membership);
|
|
45
|
-
setCurrentSupabaseOrganizationId(membership?.organization?.id ?? null);
|
|
46
|
-
setCurrentWorkOSOrganizationId(membership?.organization?.workos_org_id ?? null);
|
|
47
|
-
}, []);
|
|
48
|
-
const selectOrganization = useCallback(
|
|
49
|
-
(data) => {
|
|
50
|
-
let selected = null;
|
|
51
|
-
if (profile?.last_visited_org) {
|
|
52
|
-
selected = data.find((m) => m.organizationId === profile.last_visited_org) ?? null;
|
|
53
|
-
}
|
|
54
|
-
if (!selected && workosOrgId) {
|
|
55
|
-
selected = data.find((m) => m.organization?.workos_org_id === workosOrgId) ?? null;
|
|
56
|
-
}
|
|
57
|
-
if (!selected && data.length > 0) {
|
|
58
|
-
selected = data[0];
|
|
59
|
-
}
|
|
60
|
-
if (selected) {
|
|
61
|
-
applyMembership(selected);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
[profile?.last_visited_org, workosOrgId, applyMembership]
|
|
65
|
-
);
|
|
66
|
-
const fetchAndInitialize = useCallback(async () => {
|
|
67
|
-
if (!user?.id || !profileLoaded) return;
|
|
68
|
-
setError(null);
|
|
69
|
-
if (memberships.length === 0) {
|
|
70
|
-
setIsInitializing(true);
|
|
71
|
-
} else {
|
|
72
|
-
setIsOrgRefreshing(true);
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
const data = await apiRequest("/memberships/my-memberships");
|
|
76
|
-
if (!Array.isArray(data)) {
|
|
77
|
-
throw new Error("Invalid memberships response");
|
|
78
|
-
}
|
|
79
|
-
setMemberships(data);
|
|
80
|
-
if (data.length === 0) {
|
|
81
|
-
hasInitializedRef.current = true;
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
if (!currentWorkOSOrganizationId) {
|
|
85
|
-
selectOrganization(data);
|
|
86
|
-
} else {
|
|
87
|
-
const stillPresent = data.find((m) => m.organization?.workos_org_id === currentWorkOSOrganizationId);
|
|
88
|
-
if (!stillPresent) {
|
|
89
|
-
applyMembership(data[0] ?? null);
|
|
90
|
-
} else if (stillPresent.id !== currentMembership?.id) {
|
|
91
|
-
applyMembership(stillPresent);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
hasInitializedRef.current = true;
|
|
95
|
-
} catch (err) {
|
|
96
|
-
setError(err instanceof Error ? err.message : "Failed to load organizations");
|
|
97
|
-
} finally {
|
|
98
|
-
setIsInitializing(false);
|
|
99
|
-
setIsOrgRefreshing(false);
|
|
100
|
-
}
|
|
101
|
-
}, [
|
|
102
|
-
user?.id,
|
|
103
|
-
profileLoaded,
|
|
104
|
-
memberships.length,
|
|
105
|
-
apiRequest,
|
|
106
|
-
currentWorkOSOrganizationId,
|
|
107
|
-
currentMembership?.id,
|
|
108
|
-
selectOrganization,
|
|
109
|
-
applyMembership
|
|
110
|
-
]);
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
if (!user?.id || !profileLoaded || hasInitializedRef.current) return;
|
|
113
|
-
fetchAndInitialize();
|
|
114
|
-
}, [user?.id, profileLoaded, fetchAndInitialize]);
|
|
115
|
-
useEffect(() => {
|
|
116
|
-
if (!hasInitializedRef.current) return;
|
|
117
|
-
if (!workosOrgId) return;
|
|
118
|
-
if (workosOrgId === currentWorkOSOrganizationId) return;
|
|
119
|
-
const target = memberships.find((m) => m.organization?.workos_org_id === workosOrgId);
|
|
120
|
-
if (!target) return;
|
|
121
|
-
applyMembership(target);
|
|
122
|
-
void queryClient.invalidateQueries();
|
|
123
|
-
}, [workosOrgId, currentWorkOSOrganizationId, memberships, applyMembership, queryClient]);
|
|
124
|
-
const switchOrganization = useCallback(
|
|
125
|
-
(workosOrgId2) => {
|
|
126
|
-
const target = memberships.find((m) => m.organization?.workos_org_id === workosOrgId2);
|
|
127
|
-
if (!target) return;
|
|
128
|
-
applyMembership(target);
|
|
129
|
-
void queryClient.invalidateQueries();
|
|
130
|
-
void apiRequest("/users/me", {
|
|
131
|
-
method: "PATCH",
|
|
132
|
-
headers: { "Content-Type": "application/json" },
|
|
133
|
-
body: JSON.stringify({ last_visited_org: target.organizationId })
|
|
134
|
-
}).catch((err) => {
|
|
135
|
-
console.warn("Failed to persist last_visited_org preference:", err);
|
|
136
|
-
});
|
|
137
|
-
},
|
|
138
|
-
[memberships, applyMembership, queryClient, apiRequest]
|
|
139
|
-
);
|
|
140
|
-
const retry = useCallback(async () => {
|
|
141
|
-
hasInitializedRef.current = false;
|
|
142
|
-
setError(null);
|
|
143
|
-
await fetchAndInitialize();
|
|
144
|
-
}, [fetchAndInitialize]);
|
|
145
|
-
const value = {
|
|
146
|
-
currentWorkOSOrganizationId,
|
|
147
|
-
currentSupabaseOrganizationId,
|
|
148
|
-
currentMembership,
|
|
149
|
-
memberships,
|
|
150
|
-
isInitializing,
|
|
151
|
-
isOrgRefreshing,
|
|
152
|
-
error,
|
|
153
|
-
switchOrganization,
|
|
154
|
-
retry
|
|
155
|
-
};
|
|
156
|
-
return createElement(OrganizationContext.Provider, { value }, children);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export { OrganizationProvider };
|
package/dist/chunk-PIS24NIV.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FeatureUnavailableState } from './chunk-EPTHX4VZ.js';
|
|
2
|
-
import { useElevasisSystems } from './chunk-WJOE76FI.js';
|
|
3
|
-
import { SubshellContainer, SubshellSidebar, SubshellRightSideContainer } from './chunk-TKAYX2SP.js';
|
|
4
|
-
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
5
|
-
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
var defaultSystemSidebarWidth = 250;
|
|
8
|
-
function SystemShell({ children }) {
|
|
9
|
-
const { shellRuntime } = useElevasisSystems();
|
|
10
|
-
const { currentPath } = useRouterContext();
|
|
11
|
-
const routeMatch = shellRuntime.resolveRoute(currentPath);
|
|
12
|
-
if (routeMatch.status === "hidden") {
|
|
13
|
-
return /* @__PURE__ */ jsx(FeatureUnavailableState, { path: currentPath });
|
|
14
|
-
}
|
|
15
|
-
if (routeMatch.status !== "matched" || !routeMatch.system?.sidebar) {
|
|
16
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
17
|
-
}
|
|
18
|
-
const SidebarComponent = routeMatch.system.sidebar;
|
|
19
|
-
const sidebarWidth = typeof routeMatch.system.sidebarWidth === "function" ? routeMatch.system.sidebarWidth({ currentPath }) : routeMatch.system.sidebarWidth ?? defaultSystemSidebarWidth;
|
|
20
|
-
if (sidebarWidth === 0) {
|
|
21
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
22
|
-
}
|
|
23
|
-
return /* @__PURE__ */ jsxs(SubshellContainer, { children: [
|
|
24
|
-
/* @__PURE__ */ jsx(SubshellSidebar, { width: sidebarWidth, children: /* @__PURE__ */ jsx(SidebarComponent, {}) }),
|
|
25
|
-
/* @__PURE__ */ jsx(SubshellRightSideContainer, { children })
|
|
26
|
-
] });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { SystemShell };
|
package/dist/chunk-SZHARWKU.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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 };
|
package/dist/chunk-XCYKC6OZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|