@elevasis/ui 2.9.0 → 2.10.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 (75) hide show
  1. package/dist/app/index.css +137 -0
  2. package/dist/app/index.d.ts +223 -0
  3. package/dist/app/index.js +95 -0
  4. package/dist/charts/index.js +3 -2
  5. package/dist/{chunk-NYMKWGKN.js → chunk-4BF74JVD.js} +110 -7
  6. package/dist/{chunk-YCHZ4U5V.js → chunk-5VBR74ZS.js} +5 -13
  7. package/dist/chunk-ADSSLKKP.js +10 -0
  8. package/dist/{chunk-C2OFFC7J.js → chunk-AL23U6C3.js} +3 -2
  9. package/dist/{chunk-27COZ5AH.js → chunk-CEWTOKE7.js} +3 -50
  10. package/dist/{chunk-AQQYVAFK.js → chunk-CLXMNMIS.js} +8 -7
  11. package/dist/{chunk-4PHPENKX.js → chunk-E3IFHX6A.js} +27 -377
  12. package/dist/{chunk-4JPW5U5I.js → chunk-E4W7LB37.js} +53 -54
  13. package/dist/{chunk-CYXZHBP4.js → chunk-F4TPY6YL.js} +14 -3
  14. package/dist/chunk-G2TDX3W6.js +5 -0
  15. package/dist/chunk-IIMU5YAJ.js +53 -0
  16. package/dist/{chunk-W4VYXIN7.js → chunk-L4XXM55J.js} +3 -142
  17. package/dist/{chunk-KGEYEUR5.js → chunk-MOHVG62K.js} +7 -6
  18. package/dist/{chunk-F5QSLYUB.js → chunk-N47Z6LD4.js} +317 -1060
  19. package/dist/{chunk-47YILFON.js → chunk-OS5GFW2O.js} +156 -141
  20. package/dist/chunk-P5VHGY5P.js +13 -0
  21. package/dist/chunk-R7WLWGPO.js +126 -0
  22. package/dist/{chunk-Y3D3WFJG.js → chunk-SQQGLGHW.js} +2 -11
  23. package/dist/{chunk-KFICYU6S.js → chunk-STZJ7SY5.js} +1 -1
  24. package/dist/chunk-SZHARWKU.js +15 -0
  25. package/dist/{chunk-7PDDPNQS.js → chunk-TSX4I3NW.js} +3 -3
  26. package/dist/{chunk-CTWYIRKW.js → chunk-U23TW6NP.js} +24 -34
  27. package/dist/{chunk-OPT74SGF.js → chunk-USVBMGMP.js} +26 -172
  28. package/dist/chunk-V7XHGJQZ.js +145 -0
  29. package/dist/{chunk-UE5QQDCR.js → chunk-WHQXDETX.js} +5 -5
  30. package/dist/{chunk-ZZ35VSNF.js → chunk-YQLE5HR5.js} +4 -4
  31. package/dist/{chunk-VNUOQQNY.js → chunk-Z3OWD3A4.js} +2 -2
  32. package/dist/components/index.d.ts +6 -253
  33. package/dist/components/index.js +31 -25
  34. package/dist/features/auth/index.d.ts +0 -107
  35. package/dist/features/auth/index.js +0 -1
  36. package/dist/features/crm/index.d.ts +3 -136
  37. package/dist/features/crm/index.js +14 -9
  38. package/dist/features/dashboard/index.js +13 -9
  39. package/dist/features/delivery/index.d.ts +3 -137
  40. package/dist/features/delivery/index.js +15 -9
  41. package/dist/features/lead-gen/index.d.ts +3 -29
  42. package/dist/features/lead-gen/index.js +20 -14
  43. package/dist/features/monitoring/index.d.ts +3 -30
  44. package/dist/features/monitoring/index.js +14 -10
  45. package/dist/features/operations/index.d.ts +18 -1323
  46. package/dist/features/operations/index.js +18 -13
  47. package/dist/features/seo/index.d.ts +3 -30
  48. package/dist/features/seo/index.js +3 -2
  49. package/dist/features/settings/index.d.ts +6 -146
  50. package/dist/features/settings/index.js +13 -9
  51. package/dist/hooks/index.d.ts +10 -1403
  52. package/dist/hooks/index.js +11 -7
  53. package/dist/hooks/published.d.ts +10 -1403
  54. package/dist/hooks/published.js +11 -7
  55. package/dist/index.d.ts +96 -1510
  56. package/dist/index.js +12 -8
  57. package/dist/initialization/index.d.ts +3 -117
  58. package/dist/layout/index.d.ts +12 -2
  59. package/dist/layout/index.js +5 -4
  60. package/dist/organization/index.d.ts +3 -10
  61. package/dist/organization/index.js +2 -1
  62. package/dist/profile/index.d.ts +0 -107
  63. package/dist/provider/index.d.ts +44 -65
  64. package/dist/provider/index.js +10 -6
  65. package/dist/provider/published.d.ts +44 -65
  66. package/dist/provider/published.js +6 -3
  67. package/dist/supabase/index.d.ts +0 -209
  68. package/dist/theme/index.d.ts +1 -1
  69. package/dist/theme/index.js +3 -3
  70. package/dist/typeform/index.js +10 -10
  71. package/dist/types/index.d.ts +68 -1738
  72. package/package.json +20 -4
  73. package/src/app/README.md +24 -0
  74. package/src/provider/README.md +8 -7
  75. package/dist/chunk-IDACMRGQ.js +0 -115
@@ -1,12 +1,13 @@
1
- import { ResourceExecuteDialog } from './chunk-F5QSLYUB.js';
1
+ import { ResourceExecuteDialog } from './chunk-N47Z6LD4.js';
2
2
  import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
3
3
  import { PageContainer } from './chunk-BZZCNLT6.js';
4
- import { SubshellSidebarSection, SubshellNavItem } from './chunk-27COZ5AH.js';
4
+ import { SubshellNavItem } from './chunk-CEWTOKE7.js';
5
+ import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
5
6
  import { FilterBar } from './chunk-PDHTXPSF.js';
6
7
  import { CustomModal } from './chunk-GBMNCNHX.js';
7
- import { showApiErrorNotification, acquisitionListKeys, showSuccessNotification, useListsTelemetry, useLists, useCreateList, useTableSort, sortData, usePaginationState, useTableSelection, useList, useListProgress, useListExecutions, useResourceDefinition, useCompanies, useDeleteCompanies, useContacts, useDeleteContacts } from './chunk-4PHPENKX.js';
8
+ import { showApiErrorNotification, acquisitionListKeys, showSuccessNotification, useListsTelemetry, useLists, useCreateList, useTableSort, sortData, usePaginationState, useTableSelection, useList, useListProgress, useListExecutions, useResourceDefinition, useCompanies, useDeleteCompanies, useContacts, useDeleteContacts } from './chunk-E3IFHX6A.js';
8
9
  import { SubshellContentContainer } from './chunk-RX4UWZZR.js';
9
- import { PageTitleCaption, CenteredErrorState, StatCard, EmptyState } from './chunk-Y3D3WFJG.js';
10
+ import { PageTitleCaption, CenteredErrorState, StatCard, EmptyState } from './chunk-SQQGLGHW.js';
10
11
  import { useElevasisServices } from './chunk-QEPXAWE2.js';
11
12
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
12
13
  import { Stack, Paper, Text, Anchor, Group, Title, ActionIcon, Divider, Box, SimpleGrid, Badge, Card, Button, Center, Loader, Alert, Table, Progress, TextInput, Checkbox, Pagination, Textarea, Select, Code, Modal } from '@mantine/core';
@@ -50,8 +51,7 @@ var LeadGenSidebar = ({ children } = {}) => {
50
51
  };
51
52
  var leadGenManifest = {
52
53
  key: "lead-gen",
53
- accessFeatureKey: "acquisition",
54
- domainIds: ["lead-gen"],
54
+ featureId: "lead-gen",
55
55
  capabilityIds: ["leadgen.lists.manage"],
56
56
  sidebar: LeadGenSidebar,
57
57
  subshellRoutes: ["/lead-gen"],
@@ -575,12 +575,8 @@ function getPrimaryAction({
575
575
  tone: "gray"
576
576
  };
577
577
  }
578
- function CompactPipelineStage({
579
- label,
580
- value,
581
- ratio
582
- }) {
583
- return /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: 6, children: [
578
+ function CompactPipelineStage({ label, value, ratio }) {
579
+ return /* @__PURE__ */ jsx(Card, { withBorder: true, p: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: 6, children: [
584
580
  /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "xs", wrap: "nowrap", children: [
585
581
  /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: label }),
586
582
  /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "blue", children: formatPercentage(ratio) })
@@ -590,6 +586,7 @@ function CompactPipelineStage({
590
586
  ] }) });
591
587
  }
592
588
  function LeadGenOverviewPage() {
589
+ const navigate = useNavigate();
593
590
  const telemetryQuery = useListsTelemetry();
594
591
  const listsQuery = useLists();
595
592
  const data = telemetryQuery.data;
@@ -712,21 +709,21 @@ function LeadGenOverviewPage() {
712
709
  /* @__PURE__ */ jsx(Button, { component: Link, to: primaryAction.buttonTo, size: "sm", variant: "light", children: primaryAction.buttonLabel })
713
710
  ] }),
714
711
  /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, md: 3 }, children: [
715
- /* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "sm", children: [
712
+ /* @__PURE__ */ jsxs(Card, { withBorder: true, p: "sm", children: [
716
713
  /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Verification" }),
717
714
  /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-end", mt: 6, children: [
718
715
  /* @__PURE__ */ jsx(Title, { order: 4, children: verificationBacklog }),
719
716
  /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "waiting" })
720
717
  ] })
721
718
  ] }),
722
- /* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "sm", children: [
719
+ /* @__PURE__ */ jsxs(Card, { withBorder: true, p: "sm", children: [
723
720
  /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Personalization" }),
724
721
  /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-end", mt: 6, children: [
725
722
  /* @__PURE__ */ jsx(Title, { order: 4, children: personalizationBacklog }),
726
723
  /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "ready" })
727
724
  ] })
728
725
  ] }),
729
- /* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "sm", children: [
726
+ /* @__PURE__ */ jsxs(Card, { withBorder: true, p: "sm", children: [
730
727
  /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Completion" }),
731
728
  /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-end", mt: 6, children: [
732
729
  /* @__PURE__ */ jsx(Title, { order: 4, children: computeCompletionPercentage(stageTotals.populated, stageTotals.personalized) }),
@@ -775,38 +772,46 @@ function LeadGenOverviewPage() {
775
772
  /* @__PURE__ */ jsx(Table.Th, { children: "Progress" }),
776
773
  /* @__PURE__ */ jsx(Table.Th, { children: "Status" })
777
774
  ] }) }),
778
- /* @__PURE__ */ jsx(Table.Tbody, { children: overviewRows.map((list) => /* @__PURE__ */ jsxs(Table.Tr, { children: [
779
- /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
780
- /* @__PURE__ */ jsx(Link, { to: "/lead-gen/lists/$listId", params: { listId: list.listId }, children: /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, component: "span", c: "blue.4", children: list.name }) }),
781
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: list.listId })
782
- ] }) }),
783
- /* @__PURE__ */ jsx(Table.Td, { children: list.totalCompanies }),
784
- /* @__PURE__ */ jsx(Table.Td, { children: list.totalContacts }),
785
- /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
786
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: list.nextFocus.label }),
787
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: list.nextFocus.count == null ? "No outstanding count" : `${list.nextFocus.count} item${list.nextFocus.count === 1 ? "" : "s"} queued` })
788
- ] }) }),
789
- /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", miw: 150, children: [
790
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "xs", children: [
791
- /* @__PURE__ */ jsx(Text, { size: "sm", children: formatPercentage(list.completionRatio) }),
792
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
793
- list.stageCounts.personalized,
794
- "/",
795
- list.stageCounts.populated || 0
796
- ] })
797
- ] }),
798
- /* @__PURE__ */ jsx(
799
- Progress,
800
- {
801
- value: list.completionRatio == null ? 0 : list.completionRatio * 100,
802
- size: "sm",
803
- radius: "xl",
804
- color: "blue"
805
- }
806
- )
807
- ] }) }),
808
- /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { size: "sm", variant: "light", color: list.status.color, children: list.status.label }) })
809
- ] }, list.listId)) })
775
+ /* @__PURE__ */ jsx(Table.Tbody, { children: overviewRows.map((list) => /* @__PURE__ */ jsxs(
776
+ Table.Tr,
777
+ {
778
+ style: { cursor: "pointer" },
779
+ onClick: () => navigate({ to: "/lead-gen/lists/$listId", params: { listId: list.listId } }),
780
+ children: [
781
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
782
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, children: list.name }),
783
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: list.listId })
784
+ ] }) }),
785
+ /* @__PURE__ */ jsx(Table.Td, { children: list.totalCompanies }),
786
+ /* @__PURE__ */ jsx(Table.Td, { children: list.totalContacts }),
787
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
788
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: list.nextFocus.label }),
789
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: list.nextFocus.count == null ? "No outstanding count" : `${list.nextFocus.count} item${list.nextFocus.count === 1 ? "" : "s"} queued` })
790
+ ] }) }),
791
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", miw: 150, children: [
792
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "xs", children: [
793
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: formatPercentage(list.completionRatio) }),
794
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
795
+ list.stageCounts.personalized,
796
+ "/",
797
+ list.stageCounts.populated || 0
798
+ ] })
799
+ ] }),
800
+ /* @__PURE__ */ jsx(
801
+ Progress,
802
+ {
803
+ value: list.completionRatio == null ? 0 : list.completionRatio * 100,
804
+ size: "sm",
805
+ radius: "xl",
806
+ color: "blue"
807
+ }
808
+ )
809
+ ] }) }),
810
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { size: "sm", variant: "light", color: list.status.color, children: list.status.label }) })
811
+ ]
812
+ },
813
+ list.listId
814
+ )) })
810
815
  ] })
811
816
  ] }) })
812
817
  ] })
@@ -870,13 +875,7 @@ function LeadGenDeliverabilityPage() {
870
875
  { label: "Bounce Rate", value: computeBounceRate(totals), icon: IconChecklist }
871
876
  ];
872
877
  return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
873
- /* @__PURE__ */ jsx(
874
- PageTitleCaption,
875
- {
876
- title: "Deliverability",
877
- caption: "Email validity breakdown and bounce health across lists"
878
- }
879
- ),
878
+ /* @__PURE__ */ jsx(PageTitleCaption, { title: "Deliverability", caption: "Email validity breakdown and bounce health across lists" }),
880
879
  /* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 2, sm: 3, lg: 6 }, children: summaryTiles.map((tile) => /* @__PURE__ */ jsx(StatCard, { variant: "hero", icon: tile.icon, value: tile.value, label: tile.label }, tile.label)) }),
881
880
  /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Table, { children: [
882
881
  /* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
@@ -119,9 +119,11 @@ function PerspectiveGrid({
119
119
  glowColor: glowColorProp,
120
120
  lineColor: lineColorProp,
121
121
  prominentGlow = false,
122
+ lineIntensity = 100,
122
123
  className
123
124
  }) {
124
- const lineColor = lineColorProp ?? "color-mix(in srgb, var(--color-text-subtle) 7%, transparent)";
125
+ const rawLineColor = lineColorProp ?? "color-mix(in srgb, var(--color-text-subtle) 7%, transparent)";
126
+ const lineColor = lineIntensity < 100 ? `color-mix(in srgb, ${rawLineColor} ${lineIntensity}%, transparent)` : rawLineColor;
125
127
  const glowColor = glowColorProp ?? (prominentGlow ? PROMINENT_DEFAULT_GLOW : SUBTLE_DEFAULT_GLOW);
126
128
  const glowHeight = prominentGlow ? "70%" : "60%";
127
129
  const glowGradient = prominentGlow ? `radial-gradient(ellipse 100% 80% at 50% 110%, ${glowColor} -10%, transparent 50%)` : `radial-gradient(ellipse 90% 75% at 50% 112%, ${glowColor} -15%, transparent 45%)`;
@@ -487,13 +489,22 @@ function FloatingMotes({
487
489
  }
488
490
  function CyberBackground({
489
491
  variant,
490
- perspectiveGridRadialGlowIntensity
492
+ perspectiveGridRadialGlowIntensity,
493
+ perspectiveGridLineIntensity
491
494
  }) {
492
495
  const defaultIntensity = variant === "chrome" ? 22 : variant === "void" ? 24 : variant === "volt" ? 25 : 28;
493
496
  const intensity = perspectiveGridRadialGlowIntensity ?? defaultIntensity;
494
497
  const glowColor = `color-mix(in srgb, var(--color-primary) ${intensity}%, transparent)`;
495
498
  return /* @__PURE__ */ jsxs(Fragment, { children: [
496
- /* @__PURE__ */ jsx(PerspectiveGrid, { lineColor: "var(--color-border)", prominentGlow: true, glowColor }),
499
+ /* @__PURE__ */ jsx(
500
+ PerspectiveGrid,
501
+ {
502
+ lineColor: "var(--color-border)",
503
+ prominentGlow: true,
504
+ glowColor,
505
+ lineIntensity: perspectiveGridLineIntensity
506
+ }
507
+ ),
497
508
  /* @__PURE__ */ jsx(RadiantGlow, {}),
498
509
  /* @__PURE__ */ jsx(FloatingOrbs, {}),
499
510
  /* @__PURE__ */ jsx(FloatingMotes, {}),
@@ -0,0 +1,5 @@
1
+ // ../core/src/organization-model/contracts.ts
2
+ var PROJECTS_FEATURE_ID = "projects";
3
+ var DELIVERY_PROJECTS_VIEW_CAPABILITY_ID = "delivery.projects.view";
4
+
5
+ export { DELIVERY_PROJECTS_VIEW_CAPABILITY_ID, PROJECTS_FEATURE_ID };
@@ -0,0 +1,53 @@
1
+ import { sidebarIconSize, sidebarIconStroke, sidebarIconInnerSize } from './chunk-DT3QYZVU.js';
2
+ import { Box, Group, ThemeIcon } from '@mantine/core';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+
5
+ var SubshellSidebarSection = ({
6
+ icon: Icon,
7
+ label,
8
+ rightSection,
9
+ withTopBorder = false
10
+ }) => {
11
+ return /* @__PURE__ */ jsx(
12
+ Box,
13
+ {
14
+ p: "sm",
15
+ style: {
16
+ borderTop: withTopBorder ? "1px solid var(--color-border)" : void 0,
17
+ borderBottom: "1px solid var(--color-border)"
18
+ },
19
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
20
+ /* @__PURE__ */ jsx(
21
+ ThemeIcon,
22
+ {
23
+ variant: "light",
24
+ size: sidebarIconSize,
25
+ style: {
26
+ backgroundColor: "var(--color-surface)",
27
+ color: "var(--color-primary)",
28
+ flexShrink: 0
29
+ },
30
+ children: /* @__PURE__ */ jsx(Icon, { size: sidebarIconInnerSize, stroke: sidebarIconStroke })
31
+ }
32
+ ),
33
+ /* @__PURE__ */ jsx(
34
+ Box,
35
+ {
36
+ c: "var(--color-text)",
37
+ style: {
38
+ fontFamily: "var(--elevasis-font-family-subtitle)",
39
+ flex: 1,
40
+ fontSize: "var(--mantine-font-size-md)",
41
+ fontWeight: 500,
42
+ lineHeight: 1.2
43
+ },
44
+ children: label
45
+ }
46
+ ),
47
+ rightSection
48
+ ] })
49
+ }
50
+ );
51
+ };
52
+
53
+ export { SubshellSidebarSection };
@@ -1,149 +1,10 @@
1
- import { OrganizationContext } from './chunk-DD3CCMCZ.js';
2
- import { useProfile, useUserProfile } from './chunk-QEPXAWE2.js';
1
+ import { useUserProfile } from './chunk-QEPXAWE2.js';
3
2
  import { useAuthContext } from './chunk-BRJ3QZ4E.js';
4
- import { useState, useRef, useEffect, useCallback, createElement } from 'react';
5
- import { useQueryClient } from '@tanstack/react-query';
3
+ import { useState, useRef, useEffect, useCallback } from 'react';
6
4
  import { Button, Loader, Menu, Text, Badge } from '@mantine/core';
7
5
  import { IconChevronDown, IconBuilding, IconCheck } from '@tabler/icons-react';
8
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
7
 
10
- function OrganizationProvider({ apiRequest, children }) {
11
- const { user, organizationId: workosOrgId } = useAuthContext();
12
- const { profile } = useProfile();
13
- const queryClient = useQueryClient();
14
- const [memberships, setMemberships] = useState([]);
15
- const [currentWorkOSOrganizationId, setCurrentWorkOSOrganizationId] = useState(null);
16
- const [currentSupabaseOrganizationId, setCurrentSupabaseOrganizationId] = useState(null);
17
- const [currentMembership, setCurrentMembership] = useState(null);
18
- const [isInitializing, setIsInitializing] = useState(true);
19
- const [isOrgRefreshing, setIsOrgRefreshing] = useState(false);
20
- const [error, setError] = useState(null);
21
- const hasInitializedRef = useRef(false);
22
- const [profileLoaded, setProfileLoaded] = useState(false);
23
- useEffect(() => {
24
- if (profile !== void 0 && profile !== null) {
25
- setProfileLoaded(true);
26
- }
27
- }, [profile]);
28
- useEffect(() => {
29
- if (!user) {
30
- setMemberships([]);
31
- setCurrentWorkOSOrganizationId(null);
32
- setCurrentSupabaseOrganizationId(null);
33
- setCurrentMembership(null);
34
- setIsInitializing(false);
35
- setIsOrgRefreshing(false);
36
- setError(null);
37
- hasInitializedRef.current = false;
38
- setProfileLoaded(false);
39
- }
40
- }, [user]);
41
- const applyMembership = useCallback((membership) => {
42
- setCurrentMembership(membership);
43
- setCurrentSupabaseOrganizationId(membership?.organization?.id ?? null);
44
- setCurrentWorkOSOrganizationId(membership?.organization?.workos_org_id ?? null);
45
- }, []);
46
- const selectOrganization = useCallback(
47
- (data) => {
48
- let selected = null;
49
- if (profile?.last_visited_org) {
50
- selected = data.find((m) => m.organizationId === profile.last_visited_org) ?? null;
51
- }
52
- if (!selected && workosOrgId) {
53
- selected = data.find((m) => m.organization?.workos_org_id === workosOrgId) ?? null;
54
- }
55
- if (!selected && data.length > 0) {
56
- selected = data[0];
57
- }
58
- if (selected) {
59
- applyMembership(selected);
60
- }
61
- },
62
- [profile?.last_visited_org, workosOrgId, applyMembership]
63
- );
64
- const fetchAndInitialize = useCallback(async () => {
65
- if (!user?.id || !profileLoaded) return;
66
- setError(null);
67
- if (memberships.length === 0) {
68
- setIsInitializing(true);
69
- } else {
70
- setIsOrgRefreshing(true);
71
- }
72
- try {
73
- const data = await apiRequest("/memberships/my-memberships");
74
- if (!Array.isArray(data)) {
75
- throw new Error("Invalid memberships response");
76
- }
77
- setMemberships(data);
78
- if (data.length === 0) {
79
- hasInitializedRef.current = true;
80
- return;
81
- }
82
- if (!currentWorkOSOrganizationId) {
83
- selectOrganization(data);
84
- } else {
85
- const stillPresent = data.find((m) => m.organization?.workos_org_id === currentWorkOSOrganizationId);
86
- if (!stillPresent) {
87
- applyMembership(data[0] ?? null);
88
- } else if (stillPresent.id !== currentMembership?.id) {
89
- applyMembership(stillPresent);
90
- }
91
- }
92
- hasInitializedRef.current = true;
93
- } catch (err) {
94
- setError(err instanceof Error ? err.message : "Failed to load organizations");
95
- } finally {
96
- setIsInitializing(false);
97
- setIsOrgRefreshing(false);
98
- }
99
- }, [
100
- user?.id,
101
- profileLoaded,
102
- memberships.length,
103
- apiRequest,
104
- currentWorkOSOrganizationId,
105
- currentMembership?.id,
106
- selectOrganization,
107
- applyMembership
108
- ]);
109
- useEffect(() => {
110
- if (!user?.id || !profileLoaded || hasInitializedRef.current) return;
111
- fetchAndInitialize();
112
- }, [user?.id, profileLoaded, fetchAndInitialize]);
113
- const switchOrganization = useCallback(
114
- (workosOrgId2) => {
115
- const target = memberships.find((m) => m.organization?.workos_org_id === workosOrgId2);
116
- if (!target) return;
117
- applyMembership(target);
118
- void queryClient.invalidateQueries();
119
- void apiRequest("/users/me", {
120
- method: "PATCH",
121
- headers: { "Content-Type": "application/json" },
122
- body: JSON.stringify({ last_visited_org: target.organizationId })
123
- }).catch((err) => {
124
- console.warn("Failed to persist last_visited_org preference:", err);
125
- });
126
- },
127
- [memberships, applyMembership, queryClient, apiRequest]
128
- );
129
- const retry = useCallback(async () => {
130
- hasInitializedRef.current = false;
131
- setError(null);
132
- await fetchAndInitialize();
133
- }, [fetchAndInitialize]);
134
- const value = {
135
- currentWorkOSOrganizationId,
136
- currentSupabaseOrganizationId,
137
- currentMembership,
138
- memberships,
139
- isInitializing,
140
- isOrgRefreshing,
141
- error,
142
- switchOrganization,
143
- retry
144
- };
145
- return createElement(OrganizationContext.Provider, { value }, children);
146
- }
147
8
  function OrganizationSwitcher({
148
9
  currentOrganization,
149
10
  memberships,
@@ -485,4 +346,4 @@ function createUseOrgInitialization(useOrganizations, useApiClient) {
485
346
  };
486
347
  }
487
348
 
488
- export { OrganizationProvider, OrganizationSwitcher, createOrganizationsSlice, createUseOrgInitialization, createUseOrganizations };
349
+ export { OrganizationSwitcher, createOrganizationsSlice, createUseOrgInitialization, createUseOrganizations };
@@ -1,9 +1,9 @@
1
1
  import { FilterBar } from './chunk-PDHTXPSF.js';
2
2
  import { CustomModal } from './chunk-GBMNCNHX.js';
3
3
  import { AppShellLoader } from './chunk-YEX4MQSY.js';
4
- import { useAvailablePresets } from './chunk-VNUOQQNY.js';
5
- import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas, showErrorNotification } from './chunk-4PHPENKX.js';
6
- import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-Y3D3WFJG.js';
4
+ import { useAvailablePresets } from './chunk-Z3OWD3A4.js';
5
+ import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas, showErrorNotification } from './chunk-E3IFHX6A.js';
6
+ import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-SQQGLGHW.js';
7
7
  import { formatDateTime, OAUTH_POPUP_CHECK_INTERVAL, OAUTH_FLOW_TIMEOUT } from './chunk-IOKL7BKE.js';
8
8
  import { useInitialization } from './chunk-TUXTSEAF.js';
9
9
  import { useElevasisServices } from './chunk-QEPXAWE2.js';
@@ -491,8 +491,9 @@ function OAuthConnectModal({ opened, onClose, provider, onConnect, error, isLoad
491
491
  ] }) });
492
492
  }
493
493
  var FEATURES = [
494
- { key: "acquisition", label: "Acquisition" },
495
- { key: "calibration", label: "Calibration" },
494
+ { key: "crm", label: "CRM" },
495
+ { key: "lead-gen", label: "Lead Gen" },
496
+ { key: "projects", label: "Projects" },
496
497
  { key: "seo", label: "SEO" }
497
498
  ];
498
499
  function MembershipFeaturePanel({
@@ -2003,7 +2004,7 @@ function OAuthIntegrationsCard({ apiUrl }) {
2003
2004
  }
2004
2005
  var settingsManifest = {
2005
2006
  key: "settings",
2006
- accessFeatureKey: "settings",
2007
+ featureId: "settings",
2007
2008
  navEntry: {
2008
2009
  label: "Settings",
2009
2010
  icon: IconSettings,