@elevasis/ui 2.38.1 → 2.39.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 (78) hide show
  1. package/dist/{CoreAuthKitInner-QC62UHTZ.js → CoreAuthKitInner-PSTKG4B3.js} +3 -1
  2. package/dist/api/index.js +4 -2
  3. package/dist/app/index.d.ts +12 -0
  4. package/dist/app/index.js +17 -14
  5. package/dist/auth/context.d.ts +7 -1
  6. package/dist/auth/index.d.ts +80 -74
  7. package/dist/auth/index.js +10 -7
  8. package/dist/charts/index.js +13 -10
  9. package/dist/{chunk-C6BDBZRO.js → chunk-23YQ2WH5.js} +2 -1
  10. package/dist/{chunk-KJ3QUBNU.js → chunk-2FTX4WO2.js} +2 -2
  11. package/dist/chunk-43ZU647H.js +612 -0
  12. package/dist/{chunk-4UCAUBOL.js → chunk-5GZVSTVH.js} +2 -2
  13. package/dist/{chunk-7ZWXTH5J.js → chunk-5JYKCULK.js} +1 -1
  14. package/dist/{chunk-533DUEQY.js → chunk-6DO4PE3O.js} +1 -1
  15. package/dist/{chunk-PGWANFNE.js → chunk-CXLDZSAQ.js} +6 -6
  16. package/dist/{chunk-Y3JQBSKQ.js → chunk-FAO7SWSL.js} +1 -1
  17. package/dist/{chunk-566XWGPP.js → chunk-GLBPGEDD.js} +53 -611
  18. package/dist/{chunk-P34FFSOX.js → chunk-HOAMD35V.js} +2 -1
  19. package/dist/{chunk-JXVNHVK7.js → chunk-K7E352VG.js} +1 -1
  20. package/dist/{chunk-H2MEFUQD.js → chunk-L2H5CIQF.js} +25 -22
  21. package/dist/chunk-MQZE7SUI.js +9 -0
  22. package/dist/{chunk-7GQFIWP4.js → chunk-O53S32QR.js} +3 -3
  23. package/dist/{chunk-LWDVD3XR.js → chunk-PVXM4O6V.js} +309 -187
  24. package/dist/{chunk-I53EX4VU.js → chunk-RG2S6NIU.js} +1 -1
  25. package/dist/{chunk-JBWJ6WHZ.js → chunk-SJHM4WDG.js} +1 -1
  26. package/dist/{chunk-M7Q4UBRY.js → chunk-SNDRAYMF.js} +1 -1
  27. package/dist/chunk-TVTSASST.js +28 -0
  28. package/dist/{chunk-2Q2JQSQO.js → chunk-W2SFTXMT.js} +1 -1
  29. package/dist/chunk-ZJ3FG7FE.js +801 -0
  30. package/dist/{chunk-YGUNUIME.js → chunk-ZRZYRDXX.js} +5 -4
  31. package/dist/components/index.d.ts +12 -0
  32. package/dist/components/index.js +20 -17
  33. package/dist/components/navigation/index.js +4 -3
  34. package/dist/features/auth/index.js +21 -18
  35. package/dist/features/clients/index.js +20 -17
  36. package/dist/features/crm/index.js +20 -17
  37. package/dist/features/dashboard/index.d.ts +12 -0
  38. package/dist/features/dashboard/index.js +20 -17
  39. package/dist/features/delivery/index.js +20 -17
  40. package/dist/features/knowledge/index.js +4 -3
  41. package/dist/features/lead-gen/index.d.ts +58 -12
  42. package/dist/features/lead-gen/index.js +20 -17
  43. package/dist/features/monitoring/index.js +20 -17
  44. package/dist/features/monitoring/requests/index.js +20 -17
  45. package/dist/features/notes/index.js +6 -4
  46. package/dist/features/operations/index.d.ts +12 -0
  47. package/dist/features/operations/index.js +20 -17
  48. package/dist/features/settings/index.js +20 -17
  49. package/dist/hooks/access/index.js +9 -6
  50. package/dist/hooks/delivery/index.js +20 -17
  51. package/dist/hooks/index.d.ts +260 -203
  52. package/dist/hooks/index.js +20 -17
  53. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +12 -0
  54. package/dist/hooks/published.d.ts +260 -203
  55. package/dist/hooks/published.js +20 -17
  56. package/dist/hooks/user-notes/index.js +4 -2
  57. package/dist/index.d.ts +147 -87
  58. package/dist/index.js +20 -17
  59. package/dist/initialization/index.js +6 -4
  60. package/dist/knowledge/index.d.ts +12 -0
  61. package/dist/knowledge/index.js +5 -4
  62. package/dist/organization/index.d.ts +50 -13
  63. package/dist/organization/index.js +20 -17
  64. package/dist/profile/index.js +4 -2
  65. package/dist/provider/ElevasisServiceContext.d.ts +13 -4
  66. package/dist/provider/ElevasisServiceContext.js +3 -1
  67. package/dist/provider/index.d.ts +25 -4
  68. package/dist/provider/index.js +16 -13
  69. package/dist/provider/published.d.ts +25 -4
  70. package/dist/provider/published.js +14 -11
  71. package/dist/test-utils/index.d.ts +13 -4
  72. package/dist/test-utils/index.js +6 -3
  73. package/dist/theme/index.js +1 -1
  74. package/dist/types/index.d.ts +12 -0
  75. package/dist/utils/index.d.ts +12 -0
  76. package/dist/utils/index.js +3 -1
  77. package/package.json +5 -5
  78. package/dist/chunk-X66MVMZT.js +0 -373
@@ -1,4 +1,5 @@
1
- import { buildOrganizationGraph, projectOrganizationSurfaces, compileOrganizationOntology, SemanticIcon, getSortedSidebarEntries, parseOntologyId, getSystem, resolveSystemConfig } from './chunk-566XWGPP.js';
1
+ import { buildOrganizationGraph, projectOrganizationSurfaces, SemanticIcon, getSortedSidebarEntries } from './chunk-GLBPGEDD.js';
2
+ import { compileOrganizationOntology, parseOntologyId, getSystem, resolveSystemConfig } from './chunk-43ZU647H.js';
2
3
  import { useMemo, useState, useRef, useEffect } from 'react';
3
4
  import { useTree, Text, Tree, UnstyledButton, Group, TextInput } from '@mantine/core';
4
5
  import { useClipboard } from '@mantine/hooks';
@@ -1,4 +1,4 @@
1
- import { useElevasisServices } from './chunk-KJ3QUBNU.js';
1
+ import { useElevasisServices } from './chunk-2FTX4WO2.js';
2
2
  import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
3
3
 
4
4
  var PRIORITY_ORDER = {
@@ -1,13 +1,14 @@
1
- import { FeatureUnavailableState } from './chunk-I53EX4VU.js';
1
+ import { FeatureUnavailableState } from './chunk-RG2S6NIU.js';
2
2
  import { SubshellContainer, SubshellSidebar, SubshellRightSideContainer } from './chunk-A7IG36LB.js';
3
- import { ApiClientProvider, useApiClient } from './chunk-Y3JQBSKQ.js';
3
+ import { ApiClientProvider, useApiClient } from './chunk-FAO7SWSL.js';
4
4
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
5
- import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-X66MVMZT.js';
6
- import { useElevasisSystems } from './chunk-C6BDBZRO.js';
7
- import { InitializationProvider } from './chunk-533DUEQY.js';
5
+ import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-ZJ3FG7FE.js';
6
+ import { useElevasisSystems } from './chunk-23YQ2WH5.js';
7
+ import { InitializationProvider } from './chunk-6DO4PE3O.js';
8
8
  import { OrganizationContext, useOrganization } from './chunk-DD3CCMCZ.js';
9
- import { useProfile, ProfileProvider } from './chunk-2Q2JQSQO.js';
10
- import { ElevasisServiceProvider } from './chunk-KJ3QUBNU.js';
9
+ import { useProfile, ProfileProvider } from './chunk-W2SFTXMT.js';
10
+ import { ElevasisServiceProvider } from './chunk-2FTX4WO2.js';
11
+ import { brandSupabaseOrgId, brandWorkOsOrgId } from './chunk-MQZE7SUI.js';
11
12
  import { useAuthContext } from './chunk-BRJ3QZ4E.js';
12
13
  import { createContext, lazy, useState, useRef, useEffect, useCallback, createElement, useContext, Suspense } from 'react';
13
14
  import { useQueryClient, QueryClientProvider, QueryClient } from '@tanstack/react-query';
@@ -51,18 +52,18 @@ function OrganizationProvider({ apiRequest, children }) {
51
52
  }, [user]);
52
53
  const applyMembership = useCallback((membership) => {
53
54
  setCurrentMembership(membership);
54
- setCurrentSupabaseOrganizationId(membership?.organization?.id ?? null);
55
- setCurrentWorkOSOrganizationId(membership?.organization?.workos_org_id ?? null);
55
+ setCurrentSupabaseOrganizationId(brandSupabaseOrgId(membership?.organization?.id));
56
+ setCurrentWorkOSOrganizationId(brandWorkOsOrgId(membership?.organization?.workos_org_id));
56
57
  }, []);
57
58
  const selectOrganization = useCallback(
58
59
  (data) => {
59
60
  let selected = null;
60
- if (profile?.last_visited_org) {
61
- selected = data.find((m) => m.organizationId === profile.last_visited_org) ?? null;
62
- }
63
- if (!selected && workosOrgId) {
61
+ if (workosOrgId) {
64
62
  selected = data.find((m) => m.organization?.workos_org_id === workosOrgId) ?? null;
65
63
  }
64
+ if (!selected && profile?.last_visited_org) {
65
+ selected = data.find((m) => m.organizationId === profile.last_visited_org) ?? null;
66
+ }
66
67
  if (!selected && data.length > 0) {
67
68
  selected = data[0];
68
69
  }
@@ -130,18 +131,20 @@ function OrganizationProvider({ apiRequest, children }) {
130
131
  void queryClient.invalidateQueries();
131
132
  }, [workosOrgId, currentWorkOSOrganizationId, memberships, applyMembership, queryClient]);
132
133
  const switchOrganization = useCallback(
133
- (workosOrgId2) => {
134
+ (workosOrgId2, options) => {
134
135
  const target = memberships.find((m) => m.organization?.workos_org_id === workosOrgId2);
135
136
  if (!target) return;
136
137
  applyMembership(target);
137
138
  void queryClient.invalidateQueries();
138
- void apiRequest("/users/me", {
139
- method: "PATCH",
140
- headers: { "Content-Type": "application/json" },
141
- body: JSON.stringify({ last_visited_org: target.organizationId })
142
- }).catch((err) => {
143
- console.warn("Failed to persist last_visited_org preference:", err);
144
- });
139
+ if (options?.persist !== false) {
140
+ void apiRequest("/users/me", {
141
+ method: "PATCH",
142
+ headers: { "Content-Type": "application/json" },
143
+ body: JSON.stringify({ lastVisitedOrg: target.organizationId })
144
+ }).catch((err) => {
145
+ console.warn("Failed to persist last_visited_org preference:", err);
146
+ });
147
+ }
145
148
  },
146
149
  [memberships, applyMembership, queryClient, apiRequest]
147
150
  );
@@ -214,7 +217,7 @@ function findListActionByAction(registry, actionKey) {
214
217
  function getListActionWorkflowId(action) {
215
218
  return action.workflowId ?? action.resourceId;
216
219
  }
217
- var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-QC62UHTZ.js').then((m) => ({ default: m.CoreAuthKitInner })));
220
+ var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-PSTKG4B3.js').then((m) => ({ default: m.CoreAuthKitInner })));
218
221
  var defaultQueryClient = null;
219
222
  function getDefaultQueryClient() {
220
223
  if (!defaultQueryClient) {
@@ -0,0 +1,9 @@
1
+ // ../core/src/auth/multi-tenancy/org-id.ts
2
+ function brandSupabaseOrgId(value) {
3
+ return value ?? null;
4
+ }
5
+ function brandWorkOsOrgId(value) {
6
+ return value ?? null;
7
+ }
8
+
9
+ export { brandSupabaseOrgId, brandWorkOsOrgId };
@@ -1,7 +1,7 @@
1
- import { CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-I53EX4VU.js';
1
+ import { CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-RG2S6NIU.js';
2
2
  import { CardHeader } from './chunk-S3XR4II4.js';
3
- import { getTimeRangeLabel, getTimeRangeDates, formatBucketTime } from './chunk-X66MVMZT.js';
4
- import { useElevasisServices } from './chunk-KJ3QUBNU.js';
3
+ import { getTimeRangeLabel, getTimeRangeDates, formatBucketTime } from './chunk-ZJ3FG7FE.js';
4
+ import { useElevasisServices } from './chunk-2FTX4WO2.js';
5
5
  import { useRef, useState, useLayoutEffect, useEffect, useMemo, useCallback } from 'react';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
7
  import { useComputedColorScheme, Group, Text, Box, Stack, Center, Loader, Paper, Button, NumberFormatter, Badge, Space, Tooltip as Tooltip$1, SimpleGrid, Alert, SegmentedControl } from '@mantine/core';