@carlonicora/nextjs-jsonapi 5.2.0 → 5.4.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 (237) hide show
  1. package/dist/{BlockNoteEditor-EGY4ZAAM.js → BlockNoteEditor-4YCAIEPT.js} +23 -22
  2. package/dist/BlockNoteEditor-4YCAIEPT.js.map +1 -0
  3. package/dist/{BlockNoteEditor-2QJVK2HH.mjs → BlockNoteEditor-YQL2SGFR.mjs} +8 -7
  4. package/dist/BlockNoteEditor-YQL2SGFR.mjs.map +1 -0
  5. package/dist/{BlockNoteViewer-6BQXJ4TB.mjs → BlockNoteViewer-AEJKJ27Q.mjs} +2 -2
  6. package/dist/{BlockNoteViewer-I2MMFH3S.js → BlockNoteViewer-YL3J7J2Y.js} +3 -3
  7. package/dist/{BlockNoteViewer-I2MMFH3S.js.map → BlockNoteViewer-YL3J7J2Y.js.map} +1 -1
  8. package/dist/BlogCategoryFields-DO48vOTE.d.mts +14 -0
  9. package/dist/BlogCategoryFields-DO48vOTE.d.ts +14 -0
  10. package/dist/BlogPostInterface-BB_4wcDR.d.mts +124 -0
  11. package/dist/BlogPostInterface-bWAT1rfR.d.ts +124 -0
  12. package/dist/billing/index.js +441 -441
  13. package/dist/billing/index.mjs +3 -3
  14. package/dist/blog-public.types-BbrzsC1c.d.mts +30 -0
  15. package/dist/blog-public.types-BbrzsC1c.d.ts +30 -0
  16. package/dist/{chunk-3VEQ5JZJ.js → chunk-3NLAXVIN.js} +860 -849
  17. package/dist/{chunk-3VEQ5JZJ.js.map → chunk-3NLAXVIN.js.map} +1 -1
  18. package/dist/{chunk-YMUPTXOT.mjs → chunk-3YW35YHQ.mjs} +1 -101
  19. package/dist/chunk-3YW35YHQ.mjs.map +1 -0
  20. package/dist/{chunk-EXICQC4A.js → chunk-5PPG6PL7.js} +3 -3
  21. package/dist/{chunk-EXICQC4A.js.map → chunk-5PPG6PL7.js.map} +1 -1
  22. package/dist/{chunk-NPKFMRH5.mjs → chunk-6DC2WVVB.mjs} +2 -2
  23. package/dist/{chunk-2Z3ZCYXX.mjs → chunk-EUKTBOI2.mjs} +19 -8
  24. package/dist/chunk-EUKTBOI2.mjs.map +1 -0
  25. package/dist/{chunk-THKYH65N.js → chunk-KSYQEKJX.js} +11 -111
  26. package/dist/chunk-KSYQEKJX.js.map +1 -0
  27. package/dist/{chunk-S5MQDWWC.js → chunk-NFBOSPNJ.js} +1451 -176
  28. package/dist/chunk-NFBOSPNJ.js.map +1 -0
  29. package/dist/{chunk-JEZQTZQ4.mjs → chunk-QMYQRPQC.mjs} +2 -2
  30. package/dist/{chunk-HNOWSFM5.mjs → chunk-WC63PJSC.mjs} +1278 -3
  31. package/dist/chunk-WC63PJSC.mjs.map +1 -0
  32. package/dist/chunk-XCHSX3VC.mjs +107 -0
  33. package/dist/chunk-XCHSX3VC.mjs.map +1 -0
  34. package/dist/{chunk-75MLT74B.js → chunk-YNCQSWQW.js} +8 -8
  35. package/dist/{chunk-75MLT74B.js.map → chunk-YNCQSWQW.js.map} +1 -1
  36. package/dist/chunk-YW4ZCEWB.js +107 -0
  37. package/dist/chunk-YW4ZCEWB.js.map +1 -0
  38. package/dist/client/index.d.mts +6 -39
  39. package/dist/client/index.d.ts +6 -39
  40. package/dist/client/index.js +4 -4
  41. package/dist/client/index.mjs +3 -3
  42. package/dist/components/index.d.mts +15 -4
  43. package/dist/components/index.d.ts +15 -4
  44. package/dist/components/index.js +4 -4
  45. package/dist/components/index.mjs +3 -3
  46. package/dist/contexts/index.js +4 -4
  47. package/dist/contexts/index.mjs +3 -3
  48. package/dist/core/index.d.mts +400 -3
  49. package/dist/core/index.d.ts +400 -3
  50. package/dist/core/index.js +64 -2
  51. package/dist/core/index.js.map +1 -1
  52. package/dist/core/index.mjs +63 -1
  53. package/dist/email-automation-enrollment.fields-BZvF14qx.d.mts +82 -0
  54. package/dist/email-automation-enrollment.fields-Cp3VMzFq.d.ts +82 -0
  55. package/dist/email-automations/index.css +30 -0
  56. package/dist/email-automations/index.css.map +1 -0
  57. package/dist/email-automations/index.d.mts +303 -0
  58. package/dist/email-automations/index.d.ts +303 -0
  59. package/dist/email-automations/index.js +1705 -0
  60. package/dist/email-automations/index.js.map +1 -0
  61. package/dist/email-automations/index.mjs +1705 -0
  62. package/dist/email-automations/index.mjs.map +1 -0
  63. package/dist/features/analytics/index.js +122 -122
  64. package/dist/features/analytics/index.mjs +4 -4
  65. package/dist/features/analytics/server.js +6 -5
  66. package/dist/features/analytics/server.js.map +1 -1
  67. package/dist/features/analytics/server.mjs +4 -3
  68. package/dist/features/analytics/server.mjs.map +1 -1
  69. package/dist/features/blog/index.css +30 -0
  70. package/dist/features/blog/index.css.map +1 -0
  71. package/dist/features/blog/index.d.mts +266 -0
  72. package/dist/features/blog/index.d.ts +266 -0
  73. package/dist/features/blog/index.js +1799 -0
  74. package/dist/features/blog/index.js.map +1 -0
  75. package/dist/features/blog/index.mjs +1799 -0
  76. package/dist/features/blog/index.mjs.map +1 -0
  77. package/dist/features/blog/server.d.mts +33 -0
  78. package/dist/features/blog/server.d.ts +33 -0
  79. package/dist/features/blog/server.js +139 -0
  80. package/dist/features/blog/server.js.map +1 -0
  81. package/dist/features/blog/server.mjs +139 -0
  82. package/dist/features/blog/server.mjs.map +1 -0
  83. package/dist/features/help/index.js +37 -37
  84. package/dist/features/help/index.mjs +3 -3
  85. package/dist/features/tokenusage/index.js +125 -125
  86. package/dist/features/tokenusage/index.mjs +4 -4
  87. package/dist/index.d.mts +5 -2
  88. package/dist/index.d.ts +5 -2
  89. package/dist/index.js +65 -3
  90. package/dist/index.js.map +1 -1
  91. package/dist/index.mjs +64 -2
  92. package/dist/{s3.service-CY-jgOAM.d.ts → s3.service-Bz_K-tjz.d.ts} +11 -0
  93. package/dist/{s3.service-Sri0QP7Z.d.mts → s3.service-D5zNCEW3.d.mts} +11 -0
  94. package/dist/server/index.d.mts +1 -1
  95. package/dist/server/index.d.ts +1 -1
  96. package/dist/server/index.js +8 -6
  97. package/dist/server/index.js.map +1 -1
  98. package/dist/server/index.mjs +12 -10
  99. package/dist/types-70acd-8C.d.mts +39 -0
  100. package/dist/types-l8SFleXi.d.ts +39 -0
  101. package/messages/en.json +210 -0
  102. package/messages/it.json +210 -0
  103. package/package.json +21 -1
  104. package/src/components/editors/BlockNoteEditor.tsx +13 -3
  105. package/src/components/forms/FormBlockNote.tsx +4 -0
  106. package/src/components/forms/FormFieldWrapper.tsx +1 -1
  107. package/src/components/forms/FormTextarea.tsx +2 -1
  108. package/src/components/navigations/ContentTitle.tsx +14 -3
  109. package/src/core/index.ts +12 -0
  110. package/src/core/registry/ModuleRegistry.ts +11 -0
  111. package/src/email-automations/index.ts +5 -0
  112. package/src/features/blog/BlogModules.ts +49 -0
  113. package/src/features/blog/components/admin/BlogAdminContainer.tsx +32 -0
  114. package/src/features/blog/components/admin/BlogCategoriesList.tsx +56 -0
  115. package/src/features/blog/components/admin/BlogCategoryEditor.tsx +230 -0
  116. package/src/features/blog/components/admin/BlogCoverImageField.tsx +123 -0
  117. package/src/features/blog/components/admin/BlogLayoutSetting.tsx +86 -0
  118. package/src/features/blog/components/admin/BlogPostComparison.tsx +54 -0
  119. package/src/features/blog/components/admin/BlogPostContainer.tsx +102 -0
  120. package/src/features/blog/components/admin/BlogPostDeleter.tsx +35 -0
  121. package/src/features/blog/components/admin/BlogPostEditor.tsx +207 -0
  122. package/src/features/blog/components/admin/BlogPostPublishButton.tsx +50 -0
  123. package/src/features/blog/components/admin/BlogPostTranslationEditor.tsx +110 -0
  124. package/src/features/blog/components/admin/BlogPostTranslationPanel.tsx +136 -0
  125. package/src/features/blog/components/admin/BlogPostsList.tsx +58 -0
  126. package/src/features/blog/components/admin/BlogTranslationStatus.tsx +104 -0
  127. package/src/features/blog/components/admin/__tests__/BlogPostTranslationPanel.spec.tsx +100 -0
  128. package/src/features/blog/components/admin/__tests__/BlogPostsList.spec.tsx +30 -0
  129. package/src/features/blog/components/admin/index.ts +14 -0
  130. package/src/features/blog/components/public/BlogCategoryChips.tsx +59 -0
  131. package/src/features/blog/components/public/BlogList.tsx +21 -0
  132. package/src/features/blog/components/public/BlogListColumn.tsx +53 -0
  133. package/src/features/blog/components/public/BlogListFeatured.tsx +57 -0
  134. package/src/features/blog/components/public/BlogListParts.tsx +74 -0
  135. package/src/features/blog/components/public/BlogListRail.tsx +62 -0
  136. package/src/features/blog/components/public/BlogPostCard.tsx +132 -0
  137. package/src/features/blog/components/public/BlogPostMeta.tsx +49 -0
  138. package/src/features/blog/components/public/BlogPostView.tsx +74 -0
  139. package/src/features/blog/components/public/BlogSearchBox.tsx +52 -0
  140. package/src/features/blog/components/public/__tests__/BlogList.spec.tsx +173 -0
  141. package/src/features/blog/components/public/__tests__/BlogPostView.spec.tsx +128 -0
  142. package/src/features/blog/components/public/blogPublicHelpers.ts +30 -0
  143. package/src/features/blog/components/public/index.ts +3 -0
  144. package/src/features/blog/contexts/BlogPostContext.tsx +66 -0
  145. package/src/features/blog/contexts/index.ts +1 -0
  146. package/src/features/blog/data/BlogCategory.ts +93 -0
  147. package/src/features/blog/data/BlogCategoryFields.ts +4 -0
  148. package/src/features/blog/data/BlogCategoryInterface.ts +24 -0
  149. package/src/features/blog/data/BlogCategoryService.ts +54 -0
  150. package/src/features/blog/data/BlogCategoryTranslation.ts +90 -0
  151. package/src/features/blog/data/BlogCategoryTranslationInterface.ts +22 -0
  152. package/src/features/blog/data/BlogCategoryTranslationService.ts +30 -0
  153. package/src/features/blog/data/BlogPost.spec.ts +123 -0
  154. package/src/features/blog/data/BlogPost.ts +159 -0
  155. package/src/features/blog/data/BlogPostFields.ts +7 -0
  156. package/src/features/blog/data/BlogPostInterface.ts +39 -0
  157. package/src/features/blog/data/BlogPostService.ts +82 -0
  158. package/src/features/blog/data/BlogPostTranslation.spec.ts +73 -0
  159. package/src/features/blog/data/BlogPostTranslation.ts +110 -0
  160. package/src/features/blog/data/BlogPostTranslationInterface.ts +27 -0
  161. package/src/features/blog/data/BlogPostTranslationService.ts +30 -0
  162. package/src/features/blog/data/BlogSettings.ts +37 -0
  163. package/src/features/blog/data/BlogSettingsInterface.ts +11 -0
  164. package/src/features/blog/data/BlogSettingsService.ts +24 -0
  165. package/src/features/blog/data/index.ts +17 -0
  166. package/src/features/blog/hooks/index.ts +3 -0
  167. package/src/features/blog/hooks/useBlogCategoryNames.ts +34 -0
  168. package/src/features/blog/hooks/useBlogCategoryTableStructure.tsx +84 -0
  169. package/src/features/blog/hooks/useBlogPostTableStructure.tsx +126 -0
  170. package/src/features/blog/index.ts +15 -0
  171. package/src/features/blog/server/fetchers.ts +120 -0
  172. package/src/features/blog/server/toPublic.spec.ts +91 -0
  173. package/src/features/blog/server/toPublic.ts +36 -0
  174. package/src/features/blog/server-entry.ts +17 -0
  175. package/src/features/blog/types/blog-public.types.ts +34 -0
  176. package/src/features/blog/types/blog.constants.ts +40 -0
  177. package/src/features/email-automation/EmailAutomationEnrollmentModule.ts +11 -0
  178. package/src/features/email-automation/EmailAutomationModule.ts +30 -0
  179. package/src/features/email-automation/EmailAutomationStepModule.ts +11 -0
  180. package/src/features/email-automation/EmailAutomationTriggerModule.ts +11 -0
  181. package/src/features/email-automation/components/__tests__/EmailAutomationEditor.spec.tsx +104 -0
  182. package/src/features/email-automation/components/canvas/EmailAutomationActiveSwitch.tsx +49 -0
  183. package/src/features/email-automation/components/canvas/EmailAutomationCanvas.tsx +474 -0
  184. package/src/features/email-automation/components/canvas/EmailAutomationCanvasInspector.tsx +89 -0
  185. package/src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx +32 -0
  186. package/src/features/email-automation/components/canvas/__tests__/buildCanvasGraph.spec.ts +67 -0
  187. package/src/features/email-automation/components/canvas/buildCanvasGraph.ts +141 -0
  188. package/src/features/email-automation/components/canvas/edges/DelayEdge.tsx +68 -0
  189. package/src/features/email-automation/components/canvas/nodes/EmailStepNode.tsx +43 -0
  190. package/src/features/email-automation/components/canvas/nodes/TriggerNode.tsx +23 -0
  191. package/src/features/email-automation/components/canvas/shared/CanvasToolbar.tsx +53 -0
  192. package/src/features/email-automation/components/canvas/shared/EmptyCanvas.tsx +11 -0
  193. package/src/features/email-automation/components/canvas/shared/__tests__/autoLayout.spec.ts +42 -0
  194. package/src/features/email-automation/components/canvas/shared/__tests__/longPress.spec.ts +51 -0
  195. package/src/features/email-automation/components/canvas/shared/autoLayout.ts +55 -0
  196. package/src/features/email-automation/components/canvas/shared/index.ts +4 -0
  197. package/src/features/email-automation/components/canvas/shared/longPress.ts +57 -0
  198. package/src/features/email-automation/components/containers/EmailAutomationContainer.tsx +80 -0
  199. package/src/features/email-automation/components/containers/EmailAutomationsListContainer.tsx +27 -0
  200. package/src/features/email-automation/components/forms/EmailAutomationEditor.tsx +153 -0
  201. package/src/features/email-automation/components/forms/EmailStepEditor.tsx +151 -0
  202. package/src/features/email-automation/components/index.ts +15 -0
  203. package/src/features/email-automation/components/lists/EmailAutomationRecipientsList.tsx +90 -0
  204. package/src/features/email-automation/components/lists/EmailAutomationsList.tsx +76 -0
  205. package/src/features/email-automation/components/unsubscribe/EmailUnsubscribe.tsx +99 -0
  206. package/src/features/email-automation/components/unsubscribe/__tests__/EmailUnsubscribe.spec.tsx +55 -0
  207. package/src/features/email-automation/contexts/EmailAutomationContext.tsx +175 -0
  208. package/src/features/email-automation/data/EmailAutomation.ts +87 -0
  209. package/src/features/email-automation/data/EmailAutomationEnrollment.ts +105 -0
  210. package/src/features/email-automation/data/EmailAutomationEnrollmentInterface.ts +18 -0
  211. package/src/features/email-automation/data/EmailAutomationEnrollmentService.ts +31 -0
  212. package/src/features/email-automation/data/EmailAutomationInterface.ts +22 -0
  213. package/src/features/email-automation/data/EmailAutomationService.ts +106 -0
  214. package/src/features/email-automation/data/EmailAutomationStep.ts +104 -0
  215. package/src/features/email-automation/data/EmailAutomationStepInterface.ts +23 -0
  216. package/src/features/email-automation/data/EmailAutomationStepService.ts +80 -0
  217. package/src/features/email-automation/data/EmailAutomationTrigger.ts +28 -0
  218. package/src/features/email-automation/data/EmailAutomationTriggerInterface.ts +6 -0
  219. package/src/features/email-automation/data/__tests__/email-automation-models.spec.ts +103 -0
  220. package/src/features/email-automation/data/email-automation-enrollment.fields.ts +8 -0
  221. package/src/features/email-automation/data/email-automation.fields.ts +9 -0
  222. package/src/features/email-automation/data/index.ts +13 -0
  223. package/src/features/email-automation/hooks/index.ts +2 -0
  224. package/src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx +126 -0
  225. package/src/features/email-automation/hooks/useEmailAutomationTableStructure.tsx +119 -0
  226. package/src/features/email-automation/index.ts +5 -0
  227. package/src/features/s3/data/s3.service.ts +17 -0
  228. package/dist/BlockNoteEditor-2QJVK2HH.mjs.map +0 -1
  229. package/dist/BlockNoteEditor-EGY4ZAAM.js.map +0 -1
  230. package/dist/chunk-2Z3ZCYXX.mjs.map +0 -1
  231. package/dist/chunk-HNOWSFM5.mjs.map +0 -1
  232. package/dist/chunk-S5MQDWWC.js.map +0 -1
  233. package/dist/chunk-THKYH65N.js.map +0 -1
  234. package/dist/chunk-YMUPTXOT.mjs.map +0 -1
  235. /package/dist/{BlockNoteViewer-6BQXJ4TB.mjs.map → BlockNoteViewer-AEJKJ27Q.mjs.map} +0 -0
  236. /package/dist/{chunk-NPKFMRH5.mjs.map → chunk-6DC2WVVB.mjs.map} +0 -0
  237. /package/dist/{chunk-JEZQTZQ4.mjs.map → chunk-QMYQRPQC.mjs.map} +0 -0
@@ -31,6 +31,23 @@ import {
31
31
  BillingService,
32
32
  BlockNoteDiffUtil,
33
33
  BlockNoteWordDiffRendererUtil,
34
+ BlogCategory,
35
+ BlogCategoryFields,
36
+ BlogCategoryModule,
37
+ BlogCategoryService,
38
+ BlogCategoryTranslation,
39
+ BlogCategoryTranslationModule,
40
+ BlogCategoryTranslationService,
41
+ BlogPost,
42
+ BlogPostFields,
43
+ BlogPostModule,
44
+ BlogPostService,
45
+ BlogPostTranslation,
46
+ BlogPostTranslationModule,
47
+ BlogPostTranslationService,
48
+ BlogSettings,
49
+ BlogSettingsModule,
50
+ BlogSettingsService,
34
51
  CURRENT_USER_STORAGE_KEY,
35
52
  Chunk,
36
53
  ChunkModule,
@@ -45,6 +62,20 @@ import {
45
62
  ContentModule,
46
63
  ContentService,
47
64
  DEFAULT_GRANT_TYPES,
65
+ EMAIL_AUTOMATION_UNSUBSCRIBE_TYPE,
66
+ EmailAutomation,
67
+ EmailAutomationEnrollment,
68
+ EmailAutomationEnrollmentFields,
69
+ EmailAutomationEnrollmentModule,
70
+ EmailAutomationEnrollmentService,
71
+ EmailAutomationFields,
72
+ EmailAutomationModule,
73
+ EmailAutomationService,
74
+ EmailAutomationStep,
75
+ EmailAutomationStepModule,
76
+ EmailAutomationStepService,
77
+ EmailAutomationTrigger,
78
+ EmailAutomationTriggerModule,
48
79
  EndpointCreator,
49
80
  EntityAiStatus,
50
81
  Feature,
@@ -222,7 +253,7 @@ import {
222
253
  validateCodiceFiscale,
223
254
  validateItalianTaxCode,
224
255
  validatePartitaIva
225
- } from "../chunk-HNOWSFM5.mjs";
256
+ } from "../chunk-WC63PJSC.mjs";
226
257
  import "../chunk-AUXK7QSA.mjs";
227
258
  import "../chunk-PI56A4DG.mjs";
228
259
  import {
@@ -271,6 +302,23 @@ export {
271
302
  BillingService,
272
303
  BlockNoteDiffUtil,
273
304
  BlockNoteWordDiffRendererUtil,
305
+ BlogCategory,
306
+ BlogCategoryFields,
307
+ BlogCategoryModule,
308
+ BlogCategoryService,
309
+ BlogCategoryTranslation,
310
+ BlogCategoryTranslationModule,
311
+ BlogCategoryTranslationService,
312
+ BlogPost,
313
+ BlogPostFields,
314
+ BlogPostModule,
315
+ BlogPostService,
316
+ BlogPostTranslation,
317
+ BlogPostTranslationModule,
318
+ BlogPostTranslationService,
319
+ BlogSettings,
320
+ BlogSettingsModule,
321
+ BlogSettingsService,
274
322
  CURRENT_USER_STORAGE_KEY,
275
323
  Chunk,
276
324
  ChunkModule,
@@ -287,7 +335,21 @@ export {
287
335
  DEFAULT_GRANT_TYPES,
288
336
  DataClassRegistry as DataClass,
289
337
  DataClassRegistry,
338
+ EMAIL_AUTOMATION_UNSUBSCRIBE_TYPE,
290
339
  ENV,
340
+ EmailAutomation,
341
+ EmailAutomationEnrollment,
342
+ EmailAutomationEnrollmentFields,
343
+ EmailAutomationEnrollmentModule,
344
+ EmailAutomationEnrollmentService,
345
+ EmailAutomationFields,
346
+ EmailAutomationModule,
347
+ EmailAutomationService,
348
+ EmailAutomationStep,
349
+ EmailAutomationStepModule,
350
+ EmailAutomationStepService,
351
+ EmailAutomationTrigger,
352
+ EmailAutomationTriggerModule,
291
353
  EndpointCreator,
292
354
  EntityAiStatus,
293
355
  Feature,
@@ -0,0 +1,82 @@
1
+ import { A as ApiDataInterface } from './ApiDataInterface-BcZeXy5X.mjs';
2
+
3
+ type EmailAutomationInput = {
4
+ id: string;
5
+ name: string;
6
+ trigger?: string;
7
+ exitTrigger?: string;
8
+ replyTo?: string;
9
+ isActive?: boolean;
10
+ };
11
+ interface EmailAutomationInterface extends ApiDataInterface {
12
+ get name(): string;
13
+ get trigger(): string | undefined;
14
+ get exitTrigger(): string | undefined;
15
+ get replyTo(): string | undefined;
16
+ get isActive(): boolean;
17
+ get stepCount(): number;
18
+ get activeCount(): number;
19
+ get completedCount(): number;
20
+ get unsubscribedCount(): number;
21
+ }
22
+
23
+ type EmailAutomationEnrollmentStatus = "active" | "completed" | "unsubscribed" | "exited" | "failed";
24
+ interface EmailAutomationEnrollmentInterface extends ApiDataInterface {
25
+ get email(): string;
26
+ get name(): string | undefined;
27
+ get status(): EmailAutomationEnrollmentStatus;
28
+ get enrolledAt(): Date;
29
+ get nextSendAt(): Date | undefined;
30
+ get finishedAt(): Date | undefined;
31
+ get attempts(): number;
32
+ get lastError(): string | undefined;
33
+ get currentStepSubject(): string | undefined;
34
+ get sentCount(): number;
35
+ get automation(): EmailAutomationInterface | undefined;
36
+ }
37
+
38
+ interface EmailAutomationTriggerInterface extends ApiDataInterface {
39
+ get key(): string;
40
+ get label(): string;
41
+ }
42
+
43
+ type EmailAutomationStepInput = {
44
+ id: string;
45
+ automationId: string;
46
+ subject: string;
47
+ body: string;
48
+ delayHours?: number;
49
+ positionX?: number;
50
+ positionY?: number;
51
+ };
52
+ interface EmailAutomationStepInterface extends ApiDataInterface {
53
+ get subject(): string;
54
+ get body(): string;
55
+ get delayHours(): number;
56
+ get positionX(): number | undefined;
57
+ get positionY(): number | undefined;
58
+ get sentCount(): number;
59
+ get automation(): EmailAutomationInterface | undefined;
60
+ get next(): EmailAutomationStepInterface | undefined;
61
+ }
62
+
63
+ declare enum EmailAutomationFields {
64
+ name = "name",
65
+ trigger = "trigger",
66
+ status = "status",
67
+ steps = "steps",
68
+ active = "active",
69
+ completed = "completed",
70
+ unsubscribed = "unsubscribed"
71
+ }
72
+
73
+ declare enum EmailAutomationEnrollmentFields {
74
+ email = "email",
75
+ name = "name",
76
+ status = "status",
77
+ currentStep = "currentStep",
78
+ nextSendAt = "nextSendAt",
79
+ sentCount = "sentCount"
80
+ }
81
+
82
+ export { type EmailAutomationInput as E, type EmailAutomationInterface as a, type EmailAutomationStepInput as b, type EmailAutomationStepInterface as c, type EmailAutomationEnrollmentStatus as d, type EmailAutomationEnrollmentInterface as e, type EmailAutomationTriggerInterface as f, EmailAutomationFields as g, EmailAutomationEnrollmentFields as h };
@@ -0,0 +1,82 @@
1
+ import { A as ApiDataInterface } from './ApiDataInterface-BcZeXy5X.js';
2
+
3
+ type EmailAutomationInput = {
4
+ id: string;
5
+ name: string;
6
+ trigger?: string;
7
+ exitTrigger?: string;
8
+ replyTo?: string;
9
+ isActive?: boolean;
10
+ };
11
+ interface EmailAutomationInterface extends ApiDataInterface {
12
+ get name(): string;
13
+ get trigger(): string | undefined;
14
+ get exitTrigger(): string | undefined;
15
+ get replyTo(): string | undefined;
16
+ get isActive(): boolean;
17
+ get stepCount(): number;
18
+ get activeCount(): number;
19
+ get completedCount(): number;
20
+ get unsubscribedCount(): number;
21
+ }
22
+
23
+ type EmailAutomationEnrollmentStatus = "active" | "completed" | "unsubscribed" | "exited" | "failed";
24
+ interface EmailAutomationEnrollmentInterface extends ApiDataInterface {
25
+ get email(): string;
26
+ get name(): string | undefined;
27
+ get status(): EmailAutomationEnrollmentStatus;
28
+ get enrolledAt(): Date;
29
+ get nextSendAt(): Date | undefined;
30
+ get finishedAt(): Date | undefined;
31
+ get attempts(): number;
32
+ get lastError(): string | undefined;
33
+ get currentStepSubject(): string | undefined;
34
+ get sentCount(): number;
35
+ get automation(): EmailAutomationInterface | undefined;
36
+ }
37
+
38
+ interface EmailAutomationTriggerInterface extends ApiDataInterface {
39
+ get key(): string;
40
+ get label(): string;
41
+ }
42
+
43
+ type EmailAutomationStepInput = {
44
+ id: string;
45
+ automationId: string;
46
+ subject: string;
47
+ body: string;
48
+ delayHours?: number;
49
+ positionX?: number;
50
+ positionY?: number;
51
+ };
52
+ interface EmailAutomationStepInterface extends ApiDataInterface {
53
+ get subject(): string;
54
+ get body(): string;
55
+ get delayHours(): number;
56
+ get positionX(): number | undefined;
57
+ get positionY(): number | undefined;
58
+ get sentCount(): number;
59
+ get automation(): EmailAutomationInterface | undefined;
60
+ get next(): EmailAutomationStepInterface | undefined;
61
+ }
62
+
63
+ declare enum EmailAutomationFields {
64
+ name = "name",
65
+ trigger = "trigger",
66
+ status = "status",
67
+ steps = "steps",
68
+ active = "active",
69
+ completed = "completed",
70
+ unsubscribed = "unsubscribed"
71
+ }
72
+
73
+ declare enum EmailAutomationEnrollmentFields {
74
+ email = "email",
75
+ name = "name",
76
+ status = "status",
77
+ currentStep = "currentStep",
78
+ nextSendAt = "nextSendAt",
79
+ sentCount = "sentCount"
80
+ }
81
+
82
+ export { type EmailAutomationInput as E, type EmailAutomationInterface as a, type EmailAutomationStepInput as b, type EmailAutomationStepInterface as c, type EmailAutomationEnrollmentStatus as d, type EmailAutomationEnrollmentInterface as e, type EmailAutomationTriggerInterface as f, EmailAutomationFields as g, EmailAutomationEnrollmentFields as h };
@@ -0,0 +1,30 @@
1
+ /* src/features/onboarding/styles/onboarding.css */
2
+ .driver-popover.onboarding-popover {
3
+ background: transparent;
4
+ box-shadow: none;
5
+ padding: 0;
6
+ border-radius: 0;
7
+ max-width: none;
8
+ width: auto;
9
+ overflow: visible;
10
+ color: inherit;
11
+ }
12
+ .driver-popover.onboarding-popover .driver-popover-title,
13
+ .driver-popover.onboarding-popover .driver-popover-description,
14
+ .driver-popover.onboarding-popover .driver-popover-footer,
15
+ .driver-popover.onboarding-popover .driver-popover-close-btn {
16
+ display: none;
17
+ }
18
+ .driver-popover.onboarding-popover .driver-popover-arrow-side-top {
19
+ border-top-color: var(--card);
20
+ }
21
+ .driver-popover.onboarding-popover .driver-popover-arrow-side-bottom {
22
+ border-bottom-color: var(--card);
23
+ }
24
+ .driver-popover.onboarding-popover .driver-popover-arrow-side-left {
25
+ border-left-color: var(--card);
26
+ }
27
+ .driver-popover.onboarding-popover .driver-popover-arrow-side-right {
28
+ border-right-color: var(--card);
29
+ }
30
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/features/onboarding/styles/onboarding.css"],"sourcesContent":["/* driver.js chrome is hidden: the React card mounted by OnboardingContext is the whole popover. */\n.driver-popover.onboarding-popover {\n background: transparent;\n box-shadow: none;\n padding: 0;\n border-radius: 0;\n max-width: none;\n width: auto;\n /* The card is the popover; driver.js's own clipping would cut it off. */\n overflow: visible;\n color: inherit;\n}\n\n.driver-popover.onboarding-popover .driver-popover-title,\n.driver-popover.onboarding-popover .driver-popover-description,\n.driver-popover.onboarding-popover .driver-popover-footer,\n.driver-popover.onboarding-popover .driver-popover-close-btn {\n display: none;\n}\n\n/* Arrow colour follows the card surface so it reads as part of it. */\n.driver-popover.onboarding-popover .driver-popover-arrow-side-top {\n border-top-color: var(--card);\n}\n.driver-popover.onboarding-popover .driver-popover-arrow-side-bottom {\n border-bottom-color: var(--card);\n}\n.driver-popover.onboarding-popover .driver-popover-arrow-side-left {\n border-left-color: var(--card);\n}\n.driver-popover.onboarding-popover .driver-popover-arrow-side-right {\n border-right-color: var(--card);\n}\n"],"mappings":";AACA,CAAC,cAAc,CAAC;AACd,cAAY;AACZ,cAAY;AACZ,WAAS;AACT,iBAAe;AACf,aAAW;AACX,SAAO;AAEP,YAAU;AACV,SAAO;AACT;AAEA,CAZC,cAYc,CAZC,mBAYmB,CAAC;AACpC,CAbC,cAac,CAbC,mBAamB,CAAC;AACpC,CAdC,cAcc,CAdC,mBAcmB,CAAC;AACpC,CAfC,cAec,CAfC,mBAemB,CAAC;AAClC,WAAS;AACX;AAGA,CApBC,cAoBc,CApBC,mBAoBmB,CAAC;AAClC,oBAAkB,IAAI;AACxB;AACA,CAvBC,cAuBc,CAvBC,mBAuBmB,CAAC;AAClC,uBAAqB,IAAI;AAC3B;AACA,CA1BC,cA0Bc,CA1BC,mBA0BmB,CAAC;AAClC,qBAAmB,IAAI;AACzB;AACA,CA7BC,cA6Bc,CA7BC,mBA6BmB,CAAC;AAClC,sBAAoB,IAAI;AAC1B;","names":[]}
@@ -0,0 +1,303 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { a as EmailAutomationInterface, c as EmailAutomationStepInterface, b as EmailAutomationStepInput, f as EmailAutomationTriggerInterface, g as EmailAutomationFields, e as EmailAutomationEnrollmentInterface, h as EmailAutomationEnrollmentFields } from '../email-automation-enrollment.fields-BZvF14qx.mjs';
4
+ import { Node, Edge, NodeProps, EdgeProps } from '@xyflow/react';
5
+ import { U as UseTableStructureHook } from '../types-70acd-8C.mjs';
6
+ import '../ApiDataInterface-BcZeXy5X.mjs';
7
+ import '@tanstack/react-table';
8
+ import '../types-Bq_UA8Lg.mjs';
9
+ import 'lucide-react';
10
+ import '../ApiRequestDataTypeInterface-CYEcRUrh.mjs';
11
+ import '../useDataListRetriever-WEXL4bqB.mjs';
12
+
13
+ /**
14
+ * Page container for the administrative email-automation list.
15
+ *
16
+ * Client component by necessity: `module={Modules.EmailAutomation}` is a
17
+ * registry entry carrying an icon component and methods, which a Server
18
+ * Component cannot pass across the boundary. Routes mount this container
19
+ * instead — the same shape as every other list page.
20
+ *
21
+ * No `forceHeader`: ContentListTable draws its own header row with the title
22
+ * and the create action, exactly as the company and user list pages do.
23
+ */
24
+ declare function EmailAutomationsListContainer(): React.JSX.Element;
25
+
26
+ type EmailAutomationContainerProps = {
27
+ automationId: string;
28
+ };
29
+ declare function EmailAutomationContainer({ automationId }: EmailAutomationContainerProps): React.JSX.Element;
30
+
31
+ type EmailAutomationsListProps = {
32
+ /**
33
+ * Pass this whenever the list is the page's own content inside a
34
+ * `RoundPageContainer fullWidth`. Without it ContentListTable wraps itself in
35
+ * `rounded-md border`, drawing a second bordered card inside the page's
36
+ * rounded shell.
37
+ */
38
+ fullWidth?: boolean;
39
+ };
40
+ declare function EmailAutomationsList({ fullWidth }?: EmailAutomationsListProps): React.JSX.Element;
41
+
42
+ /**
43
+ * Read-only list of the people in this automation (owner decision 6: no row
44
+ * actions). Rendered inside a tab, so it keeps its own bordered card (no
45
+ * `fullWidth`), as PricesList does inside ProductContainer.
46
+ */
47
+ declare function EmailAutomationRecipientsList(): React.JSX.Element;
48
+
49
+ type EmailAutomationEditorProps = {
50
+ automation?: EmailAutomationInterface;
51
+ propagateChanges?: (automation: EmailAutomationInterface) => void;
52
+ onSuccess?: () => void | Promise<void>;
53
+ trigger?: ReactNode;
54
+ forceShow?: boolean;
55
+ onClose?: () => void;
56
+ dialogOpen?: boolean;
57
+ onDialogOpenChange?: (open: boolean) => void;
58
+ };
59
+ declare function EmailAutomationEditor(props: EmailAutomationEditorProps): React.JSX.Element;
60
+
61
+ type EmailStepEditorProps = {
62
+ step?: EmailAutomationStepInterface;
63
+ automationId: string;
64
+ /** Canvas position for a step created from the editor. */
65
+ initialPosition?: {
66
+ x: number;
67
+ y: number;
68
+ };
69
+ /** The head step's delay counts from entering the automation, not from a previous email. */
70
+ isHead?: boolean;
71
+ trigger?: ReactNode;
72
+ forceShow?: boolean;
73
+ onClose?: () => void;
74
+ dialogOpen?: boolean;
75
+ onDialogOpenChange?: (open: boolean) => void;
76
+ onSuccess?: () => void | Promise<void>;
77
+ };
78
+ declare function EmailStepEditor(props: EmailStepEditorProps): React.JSX.Element;
79
+
80
+ /**
81
+ * Inline on/off for the automation page header, so pausing never needs the
82
+ * editor sheet. Off holds every enrolment in place (spec § "Sending" 3).
83
+ */
84
+ declare function EmailAutomationActiveSwitch(): React.JSX.Element | null;
85
+
86
+ declare function EmailAutomationCanvasTab(): React.JSX.Element;
87
+
88
+ declare function EmailAutomationCanvas(): React.JSX.Element;
89
+
90
+ /**
91
+ * Mounts EmailStepEditor (the EditorSheet the step uses everywhere) on top of
92
+ * the canvas, driven by `selectedStepId` from EmailAutomationContext. Copy of
93
+ * the app's ScenarioCanvasInspector with one branch.
94
+ *
95
+ * - We control open state via `forceShow + dialogOpen + onDialogOpenChange`.
96
+ * - On `onSuccess` we reload the canvas.
97
+ * - The step comes from the context's `steps` (already loaded for the
98
+ * canvas), so there is no per-step fetch.
99
+ */
100
+ declare function EmailAutomationCanvasInspector(): React.JSX.Element | null;
101
+ /**
102
+ * Build an `onDialogOpenChange` callback that ignores the editor's
103
+ * initial `open=false` notification. `useEditorDialog` (the hook
104
+ * inside every EditorSheet) initialises `open` to `false`, then in
105
+ * an effect sets it to `dialogOpen` (true). The "open=false" effect
106
+ * fires synchronously on mount and would otherwise wipe our canvas
107
+ * selection before the editor ever paints.
108
+ */
109
+ declare function useUserClosedGuard(onClose: () => void): (open: boolean) => void;
110
+
111
+ declare const TRIGGER_NODE_ID = "trigger";
112
+ declare const TRIGGER_SOURCE_HANDLE = "trigger-source";
113
+ declare const STEP_NODE_PREFIX = "step:";
114
+ declare const STEP_SOURCE_HANDLE_PREFIX = "step-source-";
115
+ declare const STEP_TARGET_HANDLE_PREFIX = "step-target-";
116
+ declare const TRIGGER_NODE_WIDTH = 200;
117
+ declare const TRIGGER_NODE_HEIGHT = 56;
118
+ declare const STEP_NODE_WIDTH = 200;
119
+ declare const STEP_NODE_HEIGHT = 72;
120
+ /**
121
+ * The fields the canvas reads from a step. `EmailAutomationStepInterface`
122
+ * satisfies it structurally; the narrow shape keeps this function pure and
123
+ * testable with plain objects.
124
+ */
125
+ type CanvasStep = {
126
+ id: string;
127
+ subject: string;
128
+ delayHours: number;
129
+ positionX?: number;
130
+ positionY?: number;
131
+ sentCount: number;
132
+ next?: {
133
+ id: string;
134
+ };
135
+ };
136
+ type TriggerNodeData = {
137
+ label: string;
138
+ };
139
+ type EmailStepNodeData = {
140
+ stepId: string;
141
+ subject: string;
142
+ sentCount: number;
143
+ orphan: boolean;
144
+ manuallyPositioned: boolean;
145
+ };
146
+ type DelayEdgeData = {
147
+ targetStepId: string;
148
+ delayHours: number;
149
+ };
150
+ type CanvasGraph = {
151
+ nodes: Node[];
152
+ edges: Edge[];
153
+ orphanIds: string[];
154
+ };
155
+ /**
156
+ * The head is the oldest step with no incoming NEXT, exactly as the API picks
157
+ * it (`findHead`). `steps` arrive ordered by createdAt ASC from
158
+ * `findByAutomation`, so the first step nobody points at is the head.
159
+ */
160
+ declare function findHeadStepId(steps: CanvasStep[]): string | null;
161
+ /**
162
+ * Turns the automation's steps into React Flow nodes and edges: the trigger
163
+ * node, one node per step, a trigger→head edge, and one edge per NEXT link.
164
+ * Steps not reachable from the head (walking next→next) are orphans: they
165
+ * never send and render dashed.
166
+ */
167
+ declare function buildCanvasGraph(steps: CanvasStep[], triggerLabel: string): CanvasGraph;
168
+
169
+ type TriggerNodeType = Node<{
170
+ data: TriggerNodeData;
171
+ }>;
172
+ /**
173
+ * The fixed head of the chain (SecretTargetNode recipe). Source handle only:
174
+ * people enter here. Plain element, no Base UI inside the node; the click that
175
+ * opens EmailAutomationEditor is handled by the canvas (`onNodeClick`).
176
+ */
177
+ declare function TriggerNode({ data }: NodeProps<TriggerNodeType>): React.JSX.Element;
178
+
179
+ type EmailStepNodeType = Node<{
180
+ data: EmailStepNodeData;
181
+ }>;
182
+ /**
183
+ * 200px card (SceneNode recipe): subject bold, "sent N" muted. An orphan (not
184
+ * reachable from the trigger, so it never sends) is the dashed, faded variant
185
+ * with a caption. Plain elements only: Base UI menus/popovers do not work
186
+ * inside React Flow nodes; clicks and context menus are handled by the canvas.
187
+ */
188
+ declare function EmailStepNode({ data }: NodeProps<EmailStepNodeType>): React.JSX.Element;
189
+
190
+ type DelayEdgeType = Edge<DelayEdgeData>;
191
+ /**
192
+ * ClueEdge recipe: a bezier with a label chip at its midpoint. The chip shows
193
+ * the target step's delay and opens that step's editor. It is a plain
194
+ * <button>: Base UI popovers do not work inside the React Flow canvas.
195
+ */
196
+ declare function DelayEdge({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, data, }: EdgeProps<DelayEdgeType>): React.JSX.Element;
197
+
198
+ type UnsubscribeScope = "automation" | "all";
199
+ interface Props {
200
+ token: string;
201
+ scope: UnsubscribeScope;
202
+ }
203
+ declare function EmailUnsubscribe({ token, scope }: Props): React.JSX.Element;
204
+
205
+ /** A new step: the provider always sets `automationId` and, when absent, a fresh `id`. */
206
+ type EmailAutomationStepCreateInput = Omit<EmailAutomationStepInput, "id" | "automationId"> & {
207
+ id?: string;
208
+ automationId?: string;
209
+ };
210
+ /** A step update: the provider always sets `automationId`. */
211
+ type EmailAutomationStepUpdateInput = Omit<EmailAutomationStepInput, "automationId"> & {
212
+ automationId?: string;
213
+ };
214
+ interface EmailAutomationContextType {
215
+ automation: EmailAutomationInterface | undefined;
216
+ steps: EmailAutomationStepInterface[];
217
+ reload: () => Promise<void>;
218
+ selectedStepId: string | null;
219
+ select: (id: string | null) => void;
220
+ createStep: (input: EmailAutomationStepCreateInput) => Promise<EmailAutomationStepInterface>;
221
+ updateStep: (input: EmailAutomationStepUpdateInput) => Promise<EmailAutomationStepInterface>;
222
+ deleteStep: (id: string) => Promise<void>;
223
+ setNext: (stepId: string, nextStepId: string | null) => Promise<void>;
224
+ updatePosition: (stepId: string, x: number, y: number) => Promise<void>;
225
+ tidy: () => Promise<void>;
226
+ triggers: EmailAutomationTriggerInterface[];
227
+ }
228
+ type EmailAutomationProviderProps = {
229
+ automationId: string;
230
+ children: ReactNode;
231
+ };
232
+ declare const EmailAutomationProvider: ({ automationId, children }: EmailAutomationProviderProps) => React.JSX.Element;
233
+ declare const useEmailAutomation: () => EmailAutomationContextType;
234
+
235
+ declare function CanvasToolbar({ onTidy }: {
236
+ onTidy: () => void | Promise<void>;
237
+ }): React.JSX.Element;
238
+
239
+ declare function EmptyCanvas({ children }: {
240
+ children: ReactNode;
241
+ }): React.JSX.Element;
242
+
243
+ type LayoutNode = {
244
+ id: string;
245
+ /** node body dimensions in canvas px — used by dagre to allocate space */
246
+ width: number;
247
+ height: number;
248
+ /** if true, dagre leaves position alone and uses these (x, y) verbatim */
249
+ manuallyPositioned: boolean;
250
+ x?: number;
251
+ y?: number;
252
+ };
253
+ type LayoutEdge = {
254
+ source: string;
255
+ target: string;
256
+ };
257
+ type LayoutResult = Record<string, {
258
+ x: number;
259
+ y: number;
260
+ }>;
261
+ /**
262
+ * Deterministic LR layout. Pinned nodes keep their (x, y). Unpinned nodes
263
+ * are laid out by dagre and returned in the result map.
264
+ */
265
+ declare function autoLayout(nodes: LayoutNode[], edges: LayoutEdge[]): LayoutResult;
266
+
267
+ declare const LONG_PRESS_MS = 500;
268
+ declare const LONG_PRESS_MOVE_TOLERANCE_PX = 10;
269
+ /**
270
+ * Touch long-press detector for canvas nodes. A finger held still for
271
+ * LONG_PRESS_MS on a node fires `onLongPress` with the press point; any move
272
+ * beyond the tolerance (a pan or a node drag), a lift or a cancel aborts it.
273
+ * After a fired press, `consumeClick()` returns true once, so the caller can
274
+ * swallow the click that the finger lift produces.
275
+ */
276
+ declare function createLongPressTracker(params: {
277
+ onLongPress: (press: {
278
+ target: string;
279
+ clientX: number;
280
+ clientY: number;
281
+ }) => void;
282
+ delayMs?: number;
283
+ moveTolerancePx?: number;
284
+ setTimer?: (fn: () => void, ms: number) => unknown;
285
+ clearTimer?: (handle: unknown) => void;
286
+ }): {
287
+ down(target: string, clientX: number, clientY: number): void;
288
+ move(clientX: number, clientY: number): void;
289
+ up: () => void;
290
+ cancel: () => void;
291
+ consumeClick(): boolean;
292
+ };
293
+
294
+ /**
295
+ * `context.triggerLabels` maps a trigger key to the label the API declares for
296
+ * it (EmailAutomationsList loads them). A key the app no longer declares falls
297
+ * back to the raw key, so a stale automation stays readable.
298
+ */
299
+ declare const useEmailAutomationTableStructure: UseTableStructureHook<EmailAutomationInterface, EmailAutomationFields>;
300
+
301
+ declare const useEmailAutomationEnrollmentTableStructure: UseTableStructureHook<EmailAutomationEnrollmentInterface, EmailAutomationEnrollmentFields>;
302
+
303
+ export { type CanvasGraph, type CanvasStep, CanvasToolbar, DelayEdge, type DelayEdgeData, EmailAutomationActiveSwitch, EmailAutomationCanvas, EmailAutomationCanvasInspector, EmailAutomationCanvasTab, EmailAutomationContainer, type EmailAutomationContainerProps, type EmailAutomationContextType, EmailAutomationEditor, type EmailAutomationEditorProps, EmailAutomationProvider, type EmailAutomationProviderProps, EmailAutomationRecipientsList, type EmailAutomationStepCreateInput, type EmailAutomationStepUpdateInput, EmailAutomationsList, EmailAutomationsListContainer, EmailStepEditor, type EmailStepEditorProps, EmailStepNode, type EmailStepNodeData, EmailUnsubscribe, EmptyCanvas, LONG_PRESS_MOVE_TOLERANCE_PX, LONG_PRESS_MS, type LayoutEdge, type LayoutNode, type LayoutResult, STEP_NODE_HEIGHT, STEP_NODE_PREFIX, STEP_NODE_WIDTH, STEP_SOURCE_HANDLE_PREFIX, STEP_TARGET_HANDLE_PREFIX, TRIGGER_NODE_HEIGHT, TRIGGER_NODE_ID, TRIGGER_NODE_WIDTH, TRIGGER_SOURCE_HANDLE, TriggerNode, type TriggerNodeData, autoLayout, buildCanvasGraph, createLongPressTracker, findHeadStepId, useEmailAutomation, useEmailAutomationEnrollmentTableStructure, useEmailAutomationTableStructure, useUserClosedGuard };