@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
@@ -63,6 +63,20 @@ interface OrganizationMembership {
63
63
  type MembershipProvisioningState = 'linked' | 'pre_provisioned' | 'workos_only';
64
64
  /**
65
65
  * Extended membership with user and organization details for UI
66
+ *
67
+ * **ID convention (step 17 of the auth/invitations architecture refactor):**
68
+ * `id`, `userId`, and `organizationId` are the canonical Supabase UUIDs
69
+ * (`org_memberships.id` / `users.id` / `organizations.id`) on every producer
70
+ * of this type. `workosMembershipId` / `workosUserId` /
71
+ * `organization.workos_org_id` carry the WorkOS-side forms explicitly instead
72
+ * -- the contract does not overload the canonical fields with either form.
73
+ *
74
+ * The one exception: a `workos_only` row (a WorkOS membership with no
75
+ * `org_memberships` row -- a sync gap) has no canonical membership UUID to
76
+ * report, because no such row exists. `id` stays the WorkOS `om_...` form for
77
+ * that `provisioningState` alone; `userId` / `organizationId` are still
78
+ * resolved to their Supabase forms where the user/organization themselves
79
+ * exist.
66
80
  */
67
81
  interface MembershipWithDetails extends OrganizationMembership {
68
82
  /**
@@ -70,6 +84,18 @@ interface MembershipWithDetails extends OrganizationMembership {
70
84
  * treat `undefined` as "not reported by this endpoint".
71
85
  */
72
86
  provisioningState?: MembershipProvisioningState;
87
+ /**
88
+ * WorkOS `om_...` form of `id`. `null` when the membership is
89
+ * pre-provisioned (invited, signup not completed -- no WorkOS record yet).
90
+ * Explicit companion to the canonical `id`; see the type-level doc comment.
91
+ */
92
+ workosMembershipId?: string | null;
93
+ /**
94
+ * WorkOS `user_...` form of `userId`. `null` when the member has not
95
+ * completed WorkOS signup yet. Explicit companion to the canonical
96
+ * `userId`; see the type-level doc comment.
97
+ */
98
+ workosUserId?: string | null;
73
99
  user?: {
74
100
  id: string;
75
101
  email: string;
@@ -162,15 +188,34 @@ interface OrganizationSwitcherProps {
162
188
  }
163
189
  declare function OrganizationSwitcher({ currentOrganization, memberships, isLoading, onSwitch }: OrganizationSwitcherProps): react_jsx_runtime.JSX.Element;
164
190
 
191
+ interface OrganizationSwitcherConnectedProps {
192
+ /**
193
+ * Extra loading condition, OR'd with this component's own internal
194
+ * loading state (org context initializing/refreshing). Use this instead of
195
+ * forking the component when a consuming app tracks an additional
196
+ * org-readiness signal (e.g. an app-specific initialization hook).
197
+ */
198
+ isLoading?: boolean;
199
+ /**
200
+ * Called after `switchToOrganization` (WorkOS JWT refresh) and
201
+ * `switchOrganization` (provider state sync) have both resolved
202
+ * successfully. Use this for app-specific post-switch side effects (e.g.
203
+ * resetting route-local search params) instead of forking this component.
204
+ */
205
+ onSwitched?: (workosOrgId: string) => void;
206
+ }
165
207
  /**
166
208
  * Self-wired OrganizationSwitcher that internally handles both the WorkOS JWT update
167
209
  * (via AuthKit switchToOrganization) and the provider state update (via switchOrganization).
168
210
  *
169
- * Drop-in replacement for a custom onSwitch handler in most apps. If the app needs
170
- * post-switch side effects (e.g. navigating away from an org-scoped route), keep that
171
- * logic app-local and call useOrganization().switchOrganization directly.
211
+ * Drop-in replacement for a custom onSwitch handler in most apps. If an app needs
212
+ * post-switch side effects (e.g. navigating away from an org-scoped route), pass
213
+ * `onSwitched` rather than reimplementing this component -- a prior fork
214
+ * (Command Center's `AppOrgSwitcher`) existed solely to add one such side effect
215
+ * and silently dropped this component's own extra-loading-state handling in the
216
+ * process.
172
217
  */
173
- declare function OrganizationSwitcherConnected(): react_jsx_runtime.JSX.Element;
218
+ declare function OrganizationSwitcherConnected({ isLoading: extraLoading, onSwitched }?: OrganizationSwitcherConnectedProps): react_jsx_runtime.JSX.Element;
174
219
 
175
220
  interface OrganizationsState {
176
221
  currentWorkOSOrganizationId: WorkOsOrgId | null;
@@ -1,15 +1,15 @@
1
- export { OrganizationProvider, OrganizationSwitcher, OrganizationSwitcherConnected, createOrganizationsSlice, createUseOrgInitialization, createUseOrganizations } from '../chunk-3WVZRN37.js';
1
+ export { OrganizationProvider, OrganizationSwitcher, OrganizationSwitcherConnected, createOrganizationsSlice, createUseOrgInitialization, createUseOrganizations } 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
  export { OrganizationContext, useOrganization } from '../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,5 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
+ import { QueryKey } from '@tanstack/react-query';
3
4
 
4
5
  type Json = string | number | boolean | null | {
5
6
  [key: string]: Json | undefined;
@@ -3323,15 +3324,35 @@ interface UseUserProfileReturn {
3323
3324
  error: Error | null;
3324
3325
  refetch: () => Promise<void>;
3325
3326
  }
3327
+ /**
3328
+ * Canonical TanStack Query key for the current user's profile.
3329
+ *
3330
+ * Every consumer (ProfileProvider, Command Center's root layout, the
3331
+ * onboarding gate, the welcome flow, account settings, ...) reads and writes
3332
+ * this exact key, so they share one cache entry instead of each issuing an
3333
+ * independent `/users/me/sync` call. Not user-scoped: a full sign-out /
3334
+ * sign-in cycle in this app navigates through WorkOS (a real page load),
3335
+ * which tears down the QueryClient, so no explicit user id is needed to
3336
+ * avoid stale cross-user reads within a single session.
3337
+ */
3338
+ declare const USER_PROFILE_QUERY_KEY: QueryKey;
3326
3339
  /**
3327
3340
  * Hook for managing user profile data with automatic WorkOS -> Supabase sync
3328
3341
  *
3329
- * This hook:
3342
+ * Backed by a single shared TanStack Query cache entry keyed on
3343
+ * {@link USER_PROFILE_QUERY_KEY}. This hook:
3330
3344
  * 1. Automatically syncs WorkOS user data to Supabase on authentication
3331
3345
  * 2. Provides access to the user's Supabase profile data
3332
3346
  * 3. Handles loading states and errors
3333
3347
  * 4. Includes a refetch function for manual updates
3334
3348
  *
3349
+ * Because every consumer queries the same key, calling this hook from
3350
+ * multiple places in the tree (directly or via `useProfile()`) triggers at
3351
+ * most one `/users/me/sync` request per session — later mounts simply read
3352
+ * the cached result. Call `refetch()` (or invalidate {@link USER_PROFILE_QUERY_KEY}
3353
+ * via `useQueryClient()`) to force a fresh sync after a mutation that changes
3354
+ * the profile, e.g. completing onboarding.
3355
+ *
3335
3356
  * @param options - Optional configuration including error handler and apiRequest
3336
3357
  */
3337
3358
  declare const useUserProfile: (options?: UseUserProfileOptions) => UseUserProfileReturn;
@@ -3364,5 +3385,5 @@ declare class UserProfileService {
3364
3385
  }>): Promise<SupabaseUserProfile | null>;
3365
3386
  }
3366
3387
 
3367
- export { ProfileProvider, UserProfileService, useProfile, useUserProfile };
3388
+ export { ProfileProvider, USER_PROFILE_QUERY_KEY, UserProfileService, useProfile, useUserProfile };
3368
3389
  export type { ProfileContextValue, SupabaseUserProfile, UseUserProfileReturn };
@@ -1,5 +1,5 @@
1
1
  import '../chunk-RNP5R5I3.js';
2
- export { ProfileProvider, UserProfileService, useProfile, useUserProfile } from '../chunk-EIXSQONC.js';
2
+ export { ProfileProvider, USER_PROFILE_QUERY_KEY, UserProfileService, useProfile, useUserProfile } from '../chunk-RT4KRGZT.js';
3
3
  import '../chunk-BI5VDO2K.js';
4
4
  import '../chunk-MQZE7SUI.js';
5
5
  import '../chunk-TVTSASST.js';
@@ -1,15 +1,15 @@
1
- export { AppearanceProvider, CrmActionsProvider, ElevasisCoreProvider, ElevasisSystemsProvider, ElevasisUIProvider, ListActionsProvider, NotificationProvider, SystemShell, createTestSystemsProvider, useAppearance, useCrmActions, useElevasisSystems, useListActions, useNotificationAdapter, useOptionalElevasisSystems, useResolvedOrganizationModel } from '../chunk-3WVZRN37.js';
1
+ export { AppearanceProvider, CrmActionsProvider, ElevasisCoreProvider, ElevasisSystemsProvider, ElevasisUIProvider, ListActionsProvider, NotificationProvider, SystemShell, createTestSystemsProvider, useAppearance, useCrmActions, useElevasisSystems, useListActions, useNotificationAdapter, useOptionalElevasisSystems, useResolvedOrganizationModel } 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 { AppearanceProvider, ElevasisCoreProvider, ElevasisSystemsProvider, NotificationProvider, SystemShell, useAppearance, useElevasisSystems, useNotificationAdapter, useOptionalElevasisSystems } from '../chunk-3WVZRN37.js';
1
+ export { AppearanceProvider, ElevasisCoreProvider, ElevasisSystemsProvider, NotificationProvider, SystemShell, useAppearance, useElevasisSystems, useNotificationAdapter, useOptionalElevasisSystems } 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';