@elevasis/ui 2.24.0 → 2.25.1

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 (103) hide show
  1. package/dist/app/index.css +11 -0
  2. package/dist/app/index.d.ts +457 -357
  3. package/dist/app/index.js +8 -7
  4. package/dist/auth/index.js +4 -4
  5. package/dist/charts/index.js +7 -7
  6. package/dist/{chunk-DDZOHLHB.js → chunk-26HQMR7S.js} +1 -1
  7. package/dist/{chunk-4NWNS7TX.js → chunk-3AHEHVJ6.js} +3 -3
  8. package/dist/{chunk-LJWV4TWV.js → chunk-4ZFBVND2.js} +2 -2
  9. package/dist/{chunk-FUEXGRFR.js → chunk-7LJUTTXU.js} +5 -5
  10. package/dist/{chunk-KCJ6VATY.js → chunk-AZQY7AJR.js} +13 -24
  11. package/dist/{chunk-BIWHHWCJ.js → chunk-DWK2QIAK.js} +2 -1
  12. package/dist/{chunk-ZDKQNQ4X.js → chunk-GESXCQWY.js} +1 -1
  13. package/dist/{chunk-Z6FAH4XV.js → chunk-HKBEURCV.js} +1 -1
  14. package/dist/{chunk-HC2KV6BU.js → chunk-HOIT677G.js} +1 -1
  15. package/dist/chunk-IS53MXE4.js +230 -0
  16. package/dist/{chunk-MTR6AN2C.js → chunk-IX7LWINC.js} +6 -5
  17. package/dist/{chunk-AXXTN44Z.js → chunk-IYIZYMIE.js} +2 -2
  18. package/dist/{chunk-VGNAV3TH.js → chunk-JDQSCEEF.js} +1237 -642
  19. package/dist/chunk-JMI7L7Y7.js +524 -0
  20. package/dist/{chunk-TSSKOQBX.js → chunk-KMAXFJPH.js} +2 -2
  21. package/dist/{chunk-HQ7M6PBW.js → chunk-KU7ZDWQ7.js} +1 -1
  22. package/dist/{chunk-YBZT7MJR.js → chunk-L4RT57WU.js} +7 -7
  23. package/dist/{chunk-2WZ635SS.js → chunk-MU4VPAMR.js} +2 -2
  24. package/dist/{chunk-3JCMO7SD.js → chunk-N55DVMAG.js} +1 -1
  25. package/dist/{chunk-EIOJNUPL.js → chunk-PNLJIPV5.js} +1 -1
  26. package/dist/{chunk-6Z3G4U2R.js → chunk-Q5BEODAT.js} +3 -2
  27. package/dist/{chunk-M2HWJY6O.js → chunk-QB2CC4VH.js} +2045 -243
  28. package/dist/{chunk-QULLZ5PE.js → chunk-RSG2O3HF.js} +893 -642
  29. package/dist/{chunk-M25JL54Z.js → chunk-RYTEQBAO.js} +1 -1
  30. package/dist/{chunk-XUYBOO32.js → chunk-U36X6NZM.js} +15 -7
  31. package/dist/{chunk-QSTH6T77.js → chunk-VKMNWHTL.js} +1 -1
  32. package/dist/{chunk-KLFIJDTD.js → chunk-VOVZLL23.js} +4 -4
  33. package/dist/{chunk-SLH2QLKV.js → chunk-WFTNY755.js} +1 -1
  34. package/dist/{chunk-DK2HVHCY.js → chunk-WKJ47GIW.js} +1 -1
  35. package/dist/chunk-X4WBGKJQ.js +138 -0
  36. package/dist/{chunk-QHSW4WHM.js → chunk-XTVZFT7U.js} +1 -1
  37. package/dist/components/index.css +11 -0
  38. package/dist/components/index.d.ts +478 -386
  39. package/dist/components/index.js +138 -267
  40. package/dist/components/navigation/index.css +11 -0
  41. package/dist/components/navigation/index.js +8 -8
  42. package/dist/features/auth/index.css +11 -0
  43. package/dist/features/auth/index.d.ts +369 -363
  44. package/dist/features/auth/index.js +7 -7
  45. package/dist/features/crm/index.css +11 -0
  46. package/dist/features/crm/index.d.ts +551 -360
  47. package/dist/features/crm/index.js +19 -19
  48. package/dist/features/dashboard/index.css +11 -0
  49. package/dist/features/dashboard/index.js +20 -20
  50. package/dist/features/delivery/index.css +11 -0
  51. package/dist/features/delivery/index.d.ts +363 -357
  52. package/dist/features/delivery/index.js +19 -19
  53. package/dist/features/lead-gen/index.css +11 -0
  54. package/dist/features/lead-gen/index.d.ts +174 -4
  55. package/dist/features/lead-gen/index.js +20 -20
  56. package/dist/features/monitoring/index.css +11 -0
  57. package/dist/features/monitoring/index.js +21 -21
  58. package/dist/features/monitoring/requests/index.css +11 -0
  59. package/dist/features/monitoring/requests/index.js +17 -17
  60. package/dist/features/operations/index.css +11 -0
  61. package/dist/features/operations/index.js +24 -24
  62. package/dist/features/seo/index.js +2 -2
  63. package/dist/features/settings/index.css +11 -0
  64. package/dist/features/settings/index.d.ts +369 -363
  65. package/dist/features/settings/index.js +19 -19
  66. package/dist/hooks/delivery/index.css +11 -0
  67. package/dist/hooks/delivery/index.d.ts +363 -357
  68. package/dist/hooks/delivery/index.js +2 -2
  69. package/dist/hooks/index.css +11 -0
  70. package/dist/hooks/index.d.ts +769 -401
  71. package/dist/hooks/index.js +17 -17
  72. package/dist/hooks/published.css +11 -0
  73. package/dist/hooks/published.d.ts +769 -401
  74. package/dist/hooks/published.js +17 -17
  75. package/dist/index.css +11 -0
  76. package/dist/index.d.ts +885 -383
  77. package/dist/index.js +17 -17
  78. package/dist/initialization/index.d.ts +369 -363
  79. package/dist/initialization/index.js +4 -4
  80. package/dist/layout/index.d.ts +6 -0
  81. package/dist/layout/index.js +5 -5
  82. package/dist/organization/index.css +11 -0
  83. package/dist/organization/index.js +4 -4
  84. package/dist/profile/index.d.ts +369 -363
  85. package/dist/profile/index.js +2 -2
  86. package/dist/provider/ElevasisServiceContext.d.ts +1 -0
  87. package/dist/provider/ElevasisServiceContext.js +1 -1
  88. package/dist/provider/index.css +11 -0
  89. package/dist/provider/index.d.ts +503 -362
  90. package/dist/provider/index.js +14 -14
  91. package/dist/provider/published.css +11 -0
  92. package/dist/provider/published.d.ts +494 -359
  93. package/dist/provider/published.js +12 -12
  94. package/dist/supabase/index.d.ts +369 -357
  95. package/dist/test-utils/index.js +1 -1
  96. package/dist/typeform/index.js +49 -20
  97. package/dist/types/index.d.ts +382 -363
  98. package/package.json +2 -2
  99. package/dist/chunk-CEWTOKE7.js +0 -109
  100. package/dist/chunk-OWHQ65EQ.js +0 -211
  101. package/dist/chunk-UDJE54WN.js +0 -209
  102. /package/dist/{chunk-IRW7JMQ4.js → chunk-5WWZXCS5.js} +0 -0
  103. /package/dist/{chunk-QJ2KCHKX.js → chunk-E565XMTQ.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/ui",
3
- "version": "2.24.0",
3
+ "version": "2.25.1",
4
4
  "description": "UI components and platform-aware hooks for building custom frontends on the Elevasis platform",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -225,7 +225,7 @@
225
225
  "@testing-library/jest-dom": "^6.9.1",
226
226
  "msw": "^2.11.0",
227
227
  "vitest": "^3.2.4",
228
- "@repo/core": "0.14.0",
228
+ "@repo/core": "0.15.1",
229
229
  "@repo/eslint-config": "0.0.0",
230
230
  "@repo/typescript-config": "0.0.0"
231
231
  },
@@ -1,109 +0,0 @@
1
- import { subshellNavItemIconSize } from './chunk-DT3QYZVU.js';
2
- import { UnstyledButton, Stack, Group, Text } from '@mantine/core';
3
- import { jsx, jsxs } from 'react/jsx-runtime';
4
-
5
- var activeColor = "var(--color-primary)";
6
- var defaultColor = "var(--color-text-subtle)";
7
- var hoverColor = "var(--color-text)";
8
- var activeBg = `color-mix(in srgb, ${activeColor} 10%, transparent)`;
9
- var SubshellNavItem = ({
10
- icon: Icon,
11
- label,
12
- isActive = false,
13
- onClick,
14
- description,
15
- badge,
16
- disabled = false
17
- }) => {
18
- return /* @__PURE__ */ jsx(
19
- UnstyledButton,
20
- {
21
- onClick: disabled ? void 0 : onClick,
22
- disabled,
23
- style: {
24
- width: "100%",
25
- padding: "var(--mantine-spacing-xs)",
26
- backgroundColor: isActive ? activeBg : "transparent",
27
- borderRadius: "var(--mantine-radius-default)",
28
- transition: `all var(--duration-fast) var(--easing)`,
29
- cursor: disabled ? "not-allowed" : "pointer",
30
- opacity: disabled ? 0.5 : 1
31
- },
32
- onMouseEnter: (e) => {
33
- if (!isActive && !disabled) {
34
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
35
- const textElements = e.currentTarget.querySelectorAll("[data-text-element]");
36
- textElements.forEach((el) => {
37
- el.style.color = hoverColor;
38
- });
39
- }
40
- },
41
- onMouseLeave: (e) => {
42
- if (!isActive && !disabled) {
43
- e.currentTarget.style.backgroundColor = "transparent";
44
- const textElements = e.currentTarget.querySelectorAll("[data-text-element]");
45
- textElements.forEach((el) => {
46
- el.style.color = defaultColor;
47
- });
48
- }
49
- },
50
- children: /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
51
- /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
52
- /* @__PURE__ */ jsx(
53
- Icon,
54
- {
55
- size: subshellNavItemIconSize,
56
- style: {
57
- flexShrink: 0,
58
- opacity: isActive ? 1 : 0.6,
59
- color: isActive ? activeColor : defaultColor
60
- }
61
- }
62
- ),
63
- /* @__PURE__ */ jsx(
64
- Text,
65
- {
66
- size: "sm",
67
- fw: isActive ? 600 : 400,
68
- style: {
69
- overflow: "hidden",
70
- textOverflow: "ellipsis",
71
- whiteSpace: "nowrap",
72
- flex: 1,
73
- fontFamily: "var(--elevasis-font-family-subtitle)",
74
- color: isActive ? activeColor : defaultColor,
75
- transition: `color var(--duration-fast) var(--easing)`
76
- },
77
- "data-text-element": true,
78
- children: label
79
- }
80
- ),
81
- badge && /* @__PURE__ */ jsx("div", { style: { flexShrink: 0 }, children: badge })
82
- ] }),
83
- description && /* @__PURE__ */ jsx(
84
- Text,
85
- {
86
- size: "xs",
87
- c: "dimmed",
88
- style: {
89
- paddingLeft: "22px",
90
- lineHeight: 1.2,
91
- color: isActive ? activeColor : defaultColor,
92
- opacity: isActive ? 0.8 : 0.6,
93
- transition: `all var(--duration-fast) var(--easing)`,
94
- display: "-webkit-box",
95
- WebkitLineClamp: 2,
96
- WebkitBoxOrient: "vertical",
97
- overflow: "hidden",
98
- textOverflow: "ellipsis"
99
- },
100
- "data-text-element": true,
101
- children: description
102
- }
103
- )
104
- ] })
105
- }
106
- );
107
- };
108
-
109
- export { SubshellNavItem };
@@ -1,211 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- // ../core/src/organization-model/domains/sales.ts
4
- var ModelIdSchema = z.string().trim().min(1).max(100).regex(/^[a-z0-9]+(?:[-._][a-z0-9]+)*$/, "IDs must be lowercase and use -, _, or . separators");
5
- var LabelSchema = z.string().trim().min(1).max(120);
6
- var DescriptionSchema = z.string().trim().min(1).max(2e3);
7
- var ColorTokenSchema = z.string().trim().min(1).max(50);
8
- var IconNameSchema = z.string().trim().min(1).max(80);
9
- var PathSchema = z.string().trim().startsWith("/").max(300);
10
- var ReferenceIdsSchema = z.array(ModelIdSchema).default([]);
11
- var DisplayMetadataSchema = z.object({
12
- label: LabelSchema,
13
- description: DescriptionSchema.optional(),
14
- color: ColorTokenSchema.optional(),
15
- icon: IconNameSchema.optional()
16
- });
17
- var TechStackEntrySchema = z.object({
18
- /** Name of the external platform (e.g. "HubSpot", "Stripe", "Notion"). */
19
- platform: z.string().trim().min(1).max(200),
20
- /** Free-form description of what this integration is used for. */
21
- purpose: z.string().trim().min(1).max(500),
22
- /**
23
- * Health of the credential backing this integration.
24
- * - configured: credential present and valid
25
- * - pending: not yet set up
26
- * - expired: credential existed but has lapsed
27
- * - missing: expected but not present
28
- */
29
- credentialStatus: z.enum(["configured", "pending", "expired", "missing"]),
30
- /**
31
- * Whether this integration is the primary system of record for its domain
32
- * (e.g. HubSpot is SoR for contacts). Defaults to false.
33
- */
34
- isSystemOfRecord: z.boolean().default(false)
35
- });
36
- DisplayMetadataSchema.extend({
37
- id: ModelIdSchema,
38
- resourceId: z.string().trim().min(1).max(255),
39
- resourceType: z.enum(["workflow", "agent", "trigger", "integration", "external", "human_checkpoint"]),
40
- featureIds: ReferenceIdsSchema,
41
- entityIds: ReferenceIdsSchema,
42
- surfaceIds: ReferenceIdsSchema,
43
- capabilityIds: ReferenceIdsSchema,
44
- /** Optional tech-stack metadata for external-SaaS integrations. */
45
- techStack: TechStackEntrySchema.optional()
46
- });
47
-
48
- // ../core/src/organization-model/domains/sales.ts
49
- var SalesStageSemanticClassSchema = z.enum(["open", "active", "nurturing", "closed_won", "closed_lost"]);
50
- var SalesStageSchema = DisplayMetadataSchema.extend({
51
- id: ModelIdSchema,
52
- order: z.number().int().min(0),
53
- semanticClass: SalesStageSemanticClassSchema,
54
- surfaceIds: ReferenceIdsSchema,
55
- resourceIds: ReferenceIdsSchema
56
- });
57
- var SalesPipelineSchema = z.object({
58
- id: ModelIdSchema,
59
- label: z.string().trim().min(1).max(120),
60
- description: DescriptionSchema.optional(),
61
- entityId: ModelIdSchema,
62
- stages: z.array(SalesStageSchema).min(1)
63
- });
64
- var OrganizationModelSalesSchema = z.object({
65
- entityId: ModelIdSchema,
66
- defaultPipelineId: ModelIdSchema,
67
- pipelines: z.array(SalesPipelineSchema).min(1)
68
- });
69
- function findPipeline(definitions, pipelineKey) {
70
- return definitions.find((def) => def.pipelineKey === pipelineKey);
71
- }
72
- var PENDING_STATE = { stateKey: "pending", label: "Pending" };
73
- var ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE = {
74
- pipelineKey: "lead-gen",
75
- label: "Lead Generation",
76
- entityKey: "acq.list-member",
77
- stages: [
78
- {
79
- stageKey: "outreach",
80
- label: "Outreach",
81
- states: [
82
- PENDING_STATE,
83
- { stateKey: "personalized", label: "Personalized" },
84
- { stateKey: "uploaded", label: "Uploaded" },
85
- { stateKey: "interested", label: "Interested" }
86
- ]
87
- },
88
- {
89
- stageKey: "prospecting",
90
- label: "Prospecting",
91
- states: [
92
- PENDING_STATE,
93
- { stateKey: "discovered", label: "Discovered" },
94
- { stateKey: "verified", label: "Verified" }
95
- ]
96
- },
97
- {
98
- stageKey: "qualification",
99
- label: "Qualification",
100
- states: [PENDING_STATE]
101
- }
102
- ]
103
- };
104
- var ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE = {
105
- pipelineKey: "lead-gen",
106
- label: "Lead Generation",
107
- entityKey: "acq.list-company",
108
- stages: [
109
- {
110
- stageKey: "outreach",
111
- label: "Outreach",
112
- states: [PENDING_STATE]
113
- },
114
- {
115
- stageKey: "prospecting",
116
- label: "Prospecting",
117
- states: [
118
- PENDING_STATE,
119
- { stateKey: "populated", label: "Populated" },
120
- { stateKey: "extracted", label: "Extracted" }
121
- ]
122
- },
123
- {
124
- stageKey: "qualification",
125
- label: "Qualification",
126
- states: [PENDING_STATE, { stateKey: "qualified", label: "Qualified" }]
127
- }
128
- ]
129
- };
130
- var LEAD_GEN_PIPELINE_DEFINITIONS = {
131
- "acq.list-member": [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
132
- "acq.list-company": [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
133
- };
134
- var LEAD_GEN_STAGE_CATALOG = {
135
- // Prospecting — company population
136
- scraped: {
137
- key: "scraped",
138
- label: "Scraped",
139
- description: "Company was scraped from a source directory (Apify actor run).",
140
- order: 1,
141
- entity: "company"
142
- },
143
- populated: {
144
- key: "populated",
145
- label: "Populated",
146
- description: "Company record populated with structured data from scrape results.",
147
- order: 2,
148
- entity: "company"
149
- },
150
- extracted: {
151
- key: "extracted",
152
- label: "Extracted",
153
- description: "Website content extracted and parsed for company intelligence.",
154
- order: 3,
155
- entity: "company"
156
- },
157
- enriched: {
158
- key: "enriched",
159
- label: "Enriched",
160
- description: "Company or contact enriched with third-party data (e.g. Tomba, Anymailfinder).",
161
- order: 4,
162
- entity: "company"
163
- },
164
- // Prospecting — contact discovery
165
- discovered: {
166
- key: "discovered",
167
- label: "Discovered",
168
- description: "Contact email address discovered via an email-discovery workflow.",
169
- order: 5,
170
- entity: "contact"
171
- },
172
- verified: {
173
- key: "verified",
174
- label: "Verified",
175
- description: "Contact email address verified as deliverable (email verification workflow).",
176
- order: 6,
177
- entity: "contact"
178
- },
179
- // Qualification
180
- qualified: {
181
- key: "qualified",
182
- label: "Qualified",
183
- description: "Company passed the ICP qualification rubric (company-qualification workflow).",
184
- order: 7,
185
- entity: "company"
186
- },
187
- // Outreach
188
- personalized: {
189
- key: "personalized",
190
- label: "Personalized",
191
- description: "Outreach message personalized for the contact (Instantly personalization workflow).",
192
- order: 8,
193
- entity: "contact"
194
- },
195
- uploaded: {
196
- key: "uploaded",
197
- label: "Uploaded",
198
- description: "Contact uploaded to an Instantly campaign for outreach.",
199
- order: 9,
200
- entity: "contact"
201
- },
202
- interested: {
203
- key: "interested",
204
- label: "Interested",
205
- description: "Contact replied with a positive signal (Instantly reply-handler transition).",
206
- order: 10,
207
- entity: "contact"
208
- }
209
- };
210
-
211
- export { ColorTokenSchema, DescriptionSchema, DisplayMetadataSchema, IconNameSchema, LEAD_GEN_PIPELINE_DEFINITIONS, LEAD_GEN_STAGE_CATALOG, LabelSchema, ModelIdSchema, OrganizationModelSalesSchema, PathSchema, ReferenceIdsSchema, findPipeline };
@@ -1,209 +0,0 @@
1
- import { ApiClientProvider, useApiClient } from './chunk-T6INEVX6.js';
2
- import { OrganizationProvider } from './chunk-HC2KV6BU.js';
3
- import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-SGXXJE52.js';
4
- import { InitializationProvider } from './chunk-DK2HVHCY.js';
5
- import { useOrganization } from './chunk-DD3CCMCZ.js';
6
- import { ProfileProvider } from './chunk-QHSW4WHM.js';
7
- import { ElevasisServiceProvider } from './chunk-IRW7JMQ4.js';
8
- import { useAuthContext } from './chunk-BRJ3QZ4E.js';
9
- import { createContext, lazy, useContext, Suspense, useRef } from 'react';
10
- import { jsx } from 'react/jsx-runtime';
11
- import { z } from 'zod';
12
- import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
13
-
14
- var consoleAdapter = {
15
- success(title, message) {
16
- console.log(`[Notification][Success] ${title}: ${message}`);
17
- },
18
- error(title, message) {
19
- console.warn(`[Notification][Error] ${title}: ${message}`);
20
- },
21
- info(title, message) {
22
- console.log(`[Notification][Info] ${title}: ${message}`);
23
- },
24
- warning(title, message) {
25
- console.warn(`[Notification][Warning] ${title}: ${message}`);
26
- },
27
- apiError(error) {
28
- const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
29
- const title = getErrorTitle(code);
30
- const formatted = formatErrorMessage(message, requestId, fields, retryAfter);
31
- console.warn(`[Notification][API Error] ${title}: ${formatted}`);
32
- }
33
- };
34
- var NotificationContext = createContext(consoleAdapter);
35
- function NotificationProvider({ adapter, children }) {
36
- return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: adapter, children });
37
- }
38
- function useNotificationAdapter() {
39
- return useContext(NotificationContext);
40
- }
41
- var SendReplyActionPayloadSchema = z.object({
42
- replyBody: z.string().trim().min(1).max(1e4)
43
- }).strict();
44
- var DEFAULT_CRM_ACTIONS = [
45
- {
46
- key: "move_to_proposal",
47
- label: "Move to Proposal",
48
- isAvailableFor: (deal) => deal.stage_key === "interested",
49
- workflowId: "move_to_proposal-workflow"
50
- },
51
- {
52
- key: "move_to_closing",
53
- label: "Move to Closing",
54
- isAvailableFor: (deal) => deal.stage_key === "proposal",
55
- workflowId: "move_to_closing-workflow"
56
- },
57
- {
58
- key: "move_to_closed_won",
59
- label: "Close Won",
60
- isAvailableFor: (deal) => deal.stage_key === "closing",
61
- workflowId: "move_to_closed_won-workflow"
62
- },
63
- {
64
- key: "move_to_closed_lost",
65
- label: "Close Lost",
66
- isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
67
- workflowId: "move_to_closed_lost-workflow"
68
- },
69
- {
70
- key: "move_to_nurturing",
71
- label: "Move to Nurturing",
72
- isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
73
- workflowId: "move_to_nurturing-workflow"
74
- },
75
- {
76
- key: "send_reply",
77
- label: "Send Reply",
78
- isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === "discovery_replied" || deal.state_key === "discovery_link_sent" || deal.state_key === "discovery_nudging"),
79
- workflowId: "crm-send-reply-workflow",
80
- payloadSchema: SendReplyActionPayloadSchema
81
- },
82
- {
83
- key: "send_link",
84
- label: "Send Booking Link",
85
- isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_replied",
86
- workflowId: "crm-send-booking-link-workflow"
87
- },
88
- {
89
- key: "send_nudge",
90
- label: "Send Nudge",
91
- isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === "discovery_link_sent" || deal.state_key === "discovery_nudging"),
92
- workflowId: "crm-send-nudge-workflow"
93
- },
94
- {
95
- key: "mark_no_show",
96
- label: "Mark No-Show",
97
- isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_nudging",
98
- // Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
99
- // both manual-click and timeout move the deal to closed_lost. The action_taken activity
100
- // event captures operator intent and distinguishes the manual variant from the timed one.
101
- workflowId: "mark_no_show-workflow"
102
- },
103
- {
104
- key: "rebook",
105
- label: "Rebook",
106
- isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_booking_cancelled",
107
- workflowId: "crm-rebook-workflow"
108
- }
109
- ];
110
- function deriveActions(deal, actions = DEFAULT_CRM_ACTIONS) {
111
- return actions.filter((a) => a.isAvailableFor(deal)).map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }));
112
- }
113
- var CrmActionsContext = createContext(DEFAULT_CRM_ACTIONS);
114
- function CrmActionsProvider({ actions, children }) {
115
- return /* @__PURE__ */ jsx(CrmActionsContext.Provider, { value: actions, children });
116
- }
117
- function useCrmActions() {
118
- return useContext(CrmActionsContext);
119
- }
120
- var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-QC62UHTZ.js').then((m) => ({ default: m.CoreAuthKitInner })));
121
- var defaultQueryClient = null;
122
- function getDefaultQueryClient() {
123
- if (!defaultQueryClient) {
124
- defaultQueryClient = new QueryClient({
125
- defaultOptions: { queries: { retry: 1 } }
126
- });
127
- }
128
- return defaultQueryClient;
129
- }
130
- var consoleNotificationAdapter = {
131
- success(title, message) {
132
- console.log(`[Notification][Success] ${title}: ${message}`);
133
- },
134
- error(title, message) {
135
- console.warn(`[Notification][Error] ${title}: ${message}`);
136
- },
137
- info(title, message) {
138
- console.log(`[Notification][Info] ${title}: ${message}`);
139
- },
140
- warning(title, message) {
141
- console.warn(`[Notification][Warning] ${title}: ${message}`);
142
- },
143
- apiError(error) {
144
- console.warn(`[Notification][API Error]`, error);
145
- }
146
- };
147
- function ElevasisCoreProvider({
148
- auth,
149
- queryClient,
150
- apiUrl,
151
- onError,
152
- notifications,
153
- crmActions,
154
- children
155
- }) {
156
- if (auth.mode === "apiKey") {
157
- throw new Error(
158
- `ElevasisCoreProvider: auth mode 'apiKey' is not yet implemented. Only 'authkit' mode is supported.`
159
- );
160
- }
161
- const resolvedQueryClient = queryClient ?? getDefaultQueryClient();
162
- const resolvedCrmActions = crmActions ?? DEFAULT_CRM_ACTIONS;
163
- const content = apiUrl ? /* @__PURE__ */ jsx(ServiceStack, { apiUrl, onError, notifications, children }) : children;
164
- const AuthInner = /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCoreAuthKitInner, { auth, children: content }) });
165
- return /* @__PURE__ */ jsx(QueryClientProvider, { client: resolvedQueryClient, children: /* @__PURE__ */ jsx(CrmActionsProvider, { actions: resolvedCrmActions, children: AuthInner }) });
166
- }
167
- function ServiceStack({
168
- apiUrl,
169
- onError,
170
- notifications,
171
- children
172
- }) {
173
- const { getAccessToken } = useAuthContext();
174
- const orgIdRef = useRef(null);
175
- const getOrganizationId = useRef(() => orgIdRef.current).current;
176
- return /* @__PURE__ */ jsx(
177
- ApiClientProvider,
178
- {
179
- getAccessToken,
180
- getOrganizationId,
181
- isOrganizationReady: false,
182
- onError,
183
- children: /* @__PURE__ */ jsx(ServiceStackInner, { apiUrl, orgIdRef, notifications, children })
184
- }
185
- );
186
- }
187
- function ServiceStackInner({
188
- apiUrl,
189
- orgIdRef,
190
- notifications,
191
- children
192
- }) {
193
- const { apiRequest } = useApiClient(apiUrl);
194
- const resolvedNotifications = notifications ?? consoleNotificationAdapter;
195
- return /* @__PURE__ */ jsx(ProfileProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrganizationProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrgServiceBridge, { orgIdRef, apiRequest, notifications: resolvedNotifications, children }) }) });
196
- }
197
- function OrgServiceBridge({
198
- orgIdRef,
199
- apiRequest,
200
- notifications,
201
- children
202
- }) {
203
- const { currentWorkOSOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
204
- orgIdRef.current = currentWorkOSOrganizationId;
205
- const isReady = !!currentWorkOSOrganizationId && !isInitializing && !isOrgRefreshing;
206
- return /* @__PURE__ */ jsx(ElevasisServiceProvider, { apiRequest, organizationId: currentWorkOSOrganizationId, isReady, children: /* @__PURE__ */ jsx(NotificationProvider, { adapter: notifications, children: /* @__PURE__ */ jsx(InitializationProvider, { children }) }) });
207
- }
208
-
209
- export { CrmActionsProvider, ElevasisCoreProvider, NotificationProvider, deriveActions, useCrmActions, useNotificationAdapter };
File without changes
File without changes