@elevasis/ui 2.65.0 → 2.67.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 (54) hide show
  1. package/dist/app/index.d.ts +21 -9
  2. package/dist/app/index.js +21 -14
  3. package/dist/auth/index.d.ts +12 -5
  4. package/dist/auth/index.js +5 -5
  5. package/dist/charts/index.js +5 -5
  6. package/dist/{chunk-3WVZRN37.js → chunk-5TERYXOO.js} +235 -379
  7. package/dist/{chunk-ZTWA5H77.js → chunk-6ZAP3FOA.js} +0 -1
  8. package/dist/chunk-L7BZZ4SI.js +56 -0
  9. package/dist/chunk-P45GQ3ZW.js +104 -0
  10. package/dist/{chunk-EIXSQONC.js → chunk-RT4KRGZT.js} +37 -59
  11. package/dist/components/index.d.ts +240 -209
  12. package/dist/components/index.js +5 -5
  13. package/dist/components/navigation/index.js +5 -5
  14. package/dist/execution/index.d.ts +115 -104
  15. package/dist/features/auth/index.d.ts +39 -8
  16. package/dist/features/auth/index.js +14 -9
  17. package/dist/features/clients/index.js +5 -5
  18. package/dist/features/crm/index.js +5 -5
  19. package/dist/features/dashboard/index.js +5 -5
  20. package/dist/features/delivery/index.js +5 -5
  21. package/dist/features/knowledge/index.js +5 -5
  22. package/dist/features/lead-gen/index.js +5 -5
  23. package/dist/features/monitoring/index.js +5 -5
  24. package/dist/features/monitoring/requests/index.js +6 -6
  25. package/dist/features/notes/index.js +2 -2
  26. package/dist/features/operations/index.d.ts +141 -105
  27. package/dist/features/operations/index.js +5 -5
  28. package/dist/features/settings/index.d.ts +1 -0
  29. package/dist/features/settings/index.js +5 -5
  30. package/dist/hooks/access/index.js +5 -5
  31. package/dist/hooks/delivery/index.js +5 -5
  32. package/dist/hooks/index.d.ts +284 -162
  33. package/dist/hooks/index.js +5 -5
  34. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +0 -2
  35. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -1
  36. package/dist/hooks/published.d.ts +284 -162
  37. package/dist/hooks/published.js +5 -5
  38. package/dist/index.d.ts +374 -236
  39. package/dist/index.js +5 -5
  40. package/dist/initialization/index.d.ts +61 -28
  41. package/dist/initialization/index.js +3 -3
  42. package/dist/knowledge/index.js +9 -9
  43. package/dist/{knowledge-search-index-JOPRYZN6.js → knowledge-search-index-6EZNBNSR.js} +4 -4
  44. package/dist/layout/index.js +5 -5
  45. package/dist/organization/index.d.ts +49 -4
  46. package/dist/organization/index.js +5 -5
  47. package/dist/profile/index.d.ts +23 -2
  48. package/dist/profile/index.js +1 -1
  49. package/dist/provider/index.js +5 -5
  50. package/dist/provider/published.js +5 -5
  51. package/dist/types/index.d.ts +330 -271
  52. package/package.json +3 -3
  53. package/dist/chunk-LO7GWG24.js +0 -75
  54. package/dist/chunk-T4LA4RY2.js +0 -56
@@ -4905,7 +4905,14 @@ interface ElevasisAppConfig {
4905
4905
  apiUrl: string;
4906
4906
  /** WorkOS AuthKit configuration */
4907
4907
  auth: {
4908
- clientId: string;
4908
+ /**
4909
+ * WorkOS client ID. Defaults to the shared platform application
4910
+ * (`WORKOS_CLIENT_ID` in `../config/workos`) resolved through
4911
+ * `VITE_WORKOS_CLIENT_ID` when omitted. Only set this to target a
4912
+ * different WorkOS environment -- e.g. Command Center's local `.env`
4913
+ * uses a staging client ID this way.
4914
+ */
4915
+ clientId?: string;
4909
4916
  redirectUri?: string;
4910
4917
  apiHostname?: string;
4911
4918
  devMode?: boolean;
@@ -4929,11 +4936,6 @@ interface ElevasisAppConfig {
4929
4936
  listActions?: ListBuilderRegistry;
4930
4937
  /** Callback for API errors (status >= 500) */
4931
4938
  onApiError?: (endpoint: string, error: Error, details?: ApiErrorDetails) => void;
4932
- /**
4933
- * Component to render when VITE_WORKOS_CLIENT_ID (or auth.clientId) is missing.
4934
- * When omitted and clientId is falsy, renders null.
4935
- */
4936
- MissingEnvNotice?: ComponentType;
4937
4939
  /**
4938
4940
  * Called with the current access token whenever the auth user changes.
4939
4941
  * Use this to sync the token to a debug logger or external service.
@@ -4945,24 +4947,27 @@ interface ElevasisAppConfig {
4945
4947
  *
4946
4948
  * Absorbs the boilerplate common to every template's main.tsx:
4947
4949
  * - Theme preset/colorScheme reading from a Zustand store
4948
- * - Missing env var guard
4950
+ * - WorkOS client ID resolution (config -> env -> shared platform default)
4949
4951
  * - ElevasisUIProvider assembly
4950
4952
  * - Auth token sync
4951
4953
  * - Profile theme sync
4952
4954
  * - Notifications + RouterProvider rendering
4953
4955
  *
4956
+ * A malformed or unresolvable WorkOS client ID throws during render, which
4957
+ * this factory catches with `AppErrorBoundary` so the failure surfaces via
4958
+ * `CrashErrorFallback` instead of a blank page.
4959
+ *
4954
4960
  * @example
4955
4961
  * ```tsx
4956
4962
  * const App = createElevasisApp({
4957
4963
  * router,
4958
4964
  * apiUrl: import.meta.env.VITE_API_URL,
4959
- * auth: { clientId: import.meta.env.VITE_WORKOS_CLIENT_ID, devMode: true },
4965
+ * auth: { devMode: true },
4960
4966
  * store: {
4961
4967
  * useThemePreset: () => useAppStore(s => s.theme.preset),
4962
4968
  * useThemeColorScheme: () => useAppStore(s => s.theme.colorScheme),
4963
4969
  * useSetTheme: () => useAppStore(s => s.setTheme),
4964
4970
  * },
4965
- * MissingEnvNotice,
4966
4971
  * onAuthTokenChange: (token) => uiLogger.setAuthToken(token),
4967
4972
  * onApiError: (endpoint, error, details) => bslogAPIError(endpoint, error, details),
4968
4973
  * })
@@ -5090,6 +5095,12 @@ interface ElevasisSystemsProviderProps {
5090
5095
  children: ReactNode;
5091
5096
  }
5092
5097
 
5098
+ /**
5099
+ * Canonical initialization types, owned here next to {@link InitializationProvider}
5100
+ * (the live, wired implementation). The legacy `createUseAppInitialization`
5101
+ * factory in `./hooks/useAppInitialization.ts` imports these rather than
5102
+ * declaring its own copy, so the two implementations can never drift on shape.
5103
+ */
5093
5104
  interface InitializationError {
5094
5105
  layer: 'auth' | 'profile' | 'organization';
5095
5106
  message: string;
@@ -5124,6 +5135,7 @@ interface ElevasisAuthenticatedShellProps {
5124
5135
  fullScreenPathPrefixes?: readonly string[];
5125
5136
  readyMode?: 'user' | 'organization';
5126
5137
  accountPath?: string;
5138
+ /** Where WorkOS redirects after sign-out. Defaults to `${window.location.origin}/login`. */
5127
5139
  signOutReturnTo?: string;
5128
5140
  appVersion?: string;
5129
5141
  timeRange?: ElevasisSystemsProviderProps['timeRange'];
package/dist/app/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { useSessionCheck, AppErrorBoundary, SidebarProvider, ElevasisSystemsProvider, useElevasisSystems, AppShellContainer, Sidebar, AppShellRightSideContainer, AppShellRightSideOuterContainer, SystemShell, ElevasisUIProvider } from '../chunk-3WVZRN37.js';
1
+ import { useSessionCheck, AppErrorBoundary, SidebarProvider, ElevasisSystemsProvider, useElevasisSystems, AppShellContainer, Sidebar, AppShellRightSideContainer, AppShellRightSideOuterContainer, SystemShell, ElevasisUIProvider } from '../chunk-5TERYXOO.js';
2
2
  import '../chunk-4OEVLV66.js';
3
3
  import '../chunk-RBGVNPA6.js';
4
- import '../chunk-ZTWA5H77.js';
4
+ import '../chunk-6ZAP3FOA.js';
5
5
  import '../chunk-AUDNF2Q7.js';
6
6
  import '../chunk-6M6OLGQY.js';
7
7
  import '../chunk-MKH2KOAO.js';
8
8
  import '../chunk-XNW3O6QW.js';
9
- import '../chunk-T4LA4RY2.js';
9
+ import '../chunk-L7BZZ4SI.js';
10
10
  import '../chunk-GMXGDO3I.js';
11
11
  import '../chunk-62GVNH5U.js';
12
- import { useInitialization } from '../chunk-LO7GWG24.js';
12
+ import { useInitialization } from '../chunk-P45GQ3ZW.js';
13
13
  import '../chunk-DD3CCMCZ.js';
14
14
  import '../chunk-M7WWRZ5Z.js';
15
15
  import '../chunk-JFBZ6XDW.js';
@@ -18,7 +18,7 @@ import '../chunk-Q7DJKLEN.js';
18
18
  import '../chunk-HENXLGVD.js';
19
19
  import '../chunk-BLXJEIQS.js';
20
20
  import '../chunk-RNP5R5I3.js';
21
- import '../chunk-EIXSQONC.js';
21
+ import '../chunk-RT4KRGZT.js';
22
22
  import { listAllSystems } from '../chunk-I7BZVVVU.js';
23
23
  import '../chunk-Y6I3IC45.js';
24
24
  import '../chunk-6SSQGWK7.js';
@@ -34,6 +34,18 @@ import { useAuth } from '@workos-inc/authkit-react';
34
34
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
35
35
  import { useComputedColorScheme } from '@mantine/core';
36
36
 
37
+ // src/config/workos.ts
38
+ var WORKOS_CLIENT_ID = "client_01K41FQ781Z3F787FBCYGDH00J";
39
+ var WORKOS_CLIENT_ID_PATTERN = /^client_[A-Za-z0-9]+$/;
40
+ function resolveWorkosClientId(explicit) {
41
+ const resolved = explicit || import.meta.env?.VITE_WORKOS_CLIENT_ID || WORKOS_CLIENT_ID;
42
+ if (!WORKOS_CLIENT_ID_PATTERN.test(resolved)) {
43
+ throw new Error(
44
+ `Invalid WorkOS client ID "${resolved}". Expected a value matching ${WORKOS_CLIENT_ID_PATTERN}. This is most likely caused by a malformed VITE_WORKOS_CLIENT_ID environment variable (e.g. an extra "=" producing "=client_...").`
45
+ );
46
+ }
47
+ return resolved;
48
+ }
37
49
  var DEFAULT_PRESET = "default";
38
50
  var DEFAULT_COLOR_SCHEME = "dark";
39
51
  function AppWithStore({ config }) {
@@ -45,12 +57,7 @@ function AppWithStore({ config }) {
45
57
  },
46
58
  [config.onApiError]
47
59
  );
48
- if (!config.auth.clientId) {
49
- if (config.MissingEnvNotice) {
50
- return /* @__PURE__ */ jsx(config.MissingEnvNotice, {});
51
- }
52
- return null;
53
- }
60
+ const resolvedClientId = resolveWorkosClientId(config.auth.clientId);
54
61
  const assembledTheme = {
55
62
  preset: themePreset,
56
63
  colorScheme: themeColorScheme,
@@ -64,7 +71,7 @@ function AppWithStore({ config }) {
64
71
  theme: assembledTheme,
65
72
  auth: {
66
73
  mode: "authkit",
67
- clientId: config.auth.clientId,
74
+ clientId: resolvedClientId,
68
75
  redirectUri: config.auth.redirectUri,
69
76
  apiHostname: config.auth.apiHostname,
70
77
  devMode: config.auth.devMode
@@ -105,7 +112,7 @@ function AuthenticatedApp({ config }) {
105
112
  }
106
113
  function createElevasisApp(config) {
107
114
  function ElevasisApp() {
108
- return /* @__PURE__ */ jsx(AppWithStore, { config });
115
+ return /* @__PURE__ */ jsx(AppErrorBoundary, { children: /* @__PURE__ */ jsx(AppWithStore, { config }) });
109
116
  }
110
117
  ElevasisApp.displayName = "ElevasisApp";
111
118
  return ElevasisApp;
@@ -129,7 +136,7 @@ function ElevasisAuthenticatedShell({
129
136
  fullScreenPathPrefixes = ["/public/", "/chat/"],
130
137
  readyMode = "organization",
131
138
  accountPath = "/settings/account",
132
- signOutReturnTo,
139
+ signOutReturnTo = typeof window !== "undefined" ? `${window.location.origin}/login` : void 0,
133
140
  appVersion,
134
141
  timeRange,
135
142
  operationsApiUrl,
@@ -169,6 +169,12 @@ declare function useStableAccessToken(): () => Promise<string>;
169
169
  */
170
170
  declare function useSessionCheck(): void;
171
171
 
172
+ /**
173
+ * Canonical initialization types, owned here next to {@link InitializationProvider}
174
+ * (the live, wired implementation). The legacy `createUseAppInitialization`
175
+ * factory in `./hooks/useAppInitialization.ts` imports these rather than
176
+ * declaring its own copy, so the two implementations can never drift on shape.
177
+ */
172
178
  interface InitializationError {
173
179
  layer: 'auth' | 'profile' | 'organization';
174
180
  message: string;
@@ -197,7 +203,7 @@ interface ProtectedRouteProps {
197
203
  /**
198
204
  * When true (default), waits for both user AND organization to be ready
199
205
  * before rendering children. When false, only waits for user readiness.
200
- * @default true
206
+ * @default true -- see {@link DEFAULT_WAIT_FOR_ORGANIZATION}
201
207
  */
202
208
  waitForOrganization?: boolean;
203
209
  }
@@ -216,8 +222,9 @@ interface ProtectedRouteProps {
216
222
  * When `canRecover()` returns false, falls back to navigating to `redirectTo`
217
223
  * (default: '/login') with a `returnTo` search param.
218
224
  *
219
- * Organization-layer errors are allowed through -- routes like /invitations
220
- * must be accessible even when the user has no org membership.
225
+ * Organization-layer errors are allowed through so a route can render its own
226
+ * no-org UI (e.g. "you have no organization membership yet") instead of being
227
+ * stuck behind this guard's fallback indefinitely.
221
228
  *
222
229
  * @example
223
230
  * // With custom fallback (your Mantine loader):
@@ -226,9 +233,9 @@ interface ProtectedRouteProps {
226
233
  * </ProtectedRoute>
227
234
  *
228
235
  * @example
229
- * // Wait only for user, not org (e.g. /invitations route):
236
+ * // Wait only for user, not org (e.g. a page reachable before onboarding):
230
237
  * <ProtectedRoute waitForOrganization={false}>
231
- * <InvitationsPage />
238
+ * <WelcomePage />
232
239
  * </ProtectedRoute>
233
240
  */
234
241
  declare function ProtectedRoute({ children, redirectTo, fallback, errorFallback, waitForOrganization }: ProtectedRouteProps): react_jsx_runtime.JSX.Element | null;
@@ -1,15 +1,15 @@
1
- export { AccessGuard, AccessKeys, ProtectedRoute, useSessionCheck as useRefocusSessionCheck, useSessionCheck, useStableAccessToken } from '../chunk-3WVZRN37.js';
1
+ export { AccessGuard, AccessKeys, ProtectedRoute, useSessionCheck as useRefocusSessionCheck, useSessionCheck, useStableAccessToken } from '../chunk-5TERYXOO.js';
2
2
  import '../chunk-4OEVLV66.js';
3
3
  import '../chunk-RBGVNPA6.js';
4
- import '../chunk-ZTWA5H77.js';
4
+ import '../chunk-6ZAP3FOA.js';
5
5
  import '../chunk-AUDNF2Q7.js';
6
6
  import '../chunk-6M6OLGQY.js';
7
7
  import '../chunk-MKH2KOAO.js';
8
8
  import '../chunk-XNW3O6QW.js';
9
- import '../chunk-T4LA4RY2.js';
9
+ import '../chunk-L7BZZ4SI.js';
10
10
  import '../chunk-GMXGDO3I.js';
11
11
  import '../chunk-62GVNH5U.js';
12
- import '../chunk-LO7GWG24.js';
12
+ import '../chunk-P45GQ3ZW.js';
13
13
  import '../chunk-DD3CCMCZ.js';
14
14
  import '../chunk-M7WWRZ5Z.js';
15
15
  import '../chunk-JFBZ6XDW.js';
@@ -18,7 +18,7 @@ import '../chunk-Q7DJKLEN.js';
18
18
  import '../chunk-HENXLGVD.js';
19
19
  import '../chunk-BLXJEIQS.js';
20
20
  import '../chunk-RNP5R5I3.js';
21
- import '../chunk-EIXSQONC.js';
21
+ import '../chunk-RT4KRGZT.js';
22
22
  import '../chunk-I7BZVVVU.js';
23
23
  import '../chunk-Y6I3IC45.js';
24
24
  import '../chunk-6SSQGWK7.js';
@@ -1,15 +1,15 @@
1
- export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-3WVZRN37.js';
1
+ export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-5TERYXOO.js';
2
2
  import '../chunk-4OEVLV66.js';
3
3
  import '../chunk-RBGVNPA6.js';
4
- import '../chunk-ZTWA5H77.js';
4
+ import '../chunk-6ZAP3FOA.js';
5
5
  import '../chunk-AUDNF2Q7.js';
6
6
  import '../chunk-6M6OLGQY.js';
7
7
  import '../chunk-MKH2KOAO.js';
8
8
  import '../chunk-XNW3O6QW.js';
9
- import '../chunk-T4LA4RY2.js';
9
+ import '../chunk-L7BZZ4SI.js';
10
10
  import '../chunk-GMXGDO3I.js';
11
11
  import '../chunk-62GVNH5U.js';
12
- import '../chunk-LO7GWG24.js';
12
+ import '../chunk-P45GQ3ZW.js';
13
13
  import '../chunk-DD3CCMCZ.js';
14
14
  import '../chunk-M7WWRZ5Z.js';
15
15
  import '../chunk-JFBZ6XDW.js';
@@ -18,7 +18,7 @@ import '../chunk-Q7DJKLEN.js';
18
18
  import '../chunk-HENXLGVD.js';
19
19
  import '../chunk-BLXJEIQS.js';
20
20
  import '../chunk-RNP5R5I3.js';
21
- import '../chunk-EIXSQONC.js';
21
+ import '../chunk-RT4KRGZT.js';
22
22
  import '../chunk-I7BZVVVU.js';
23
23
  import '../chunk-Y6I3IC45.js';
24
24
  import '../chunk-6SSQGWK7.js';