@burdenoff/microfe-newsletter 2026.510.108

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 (218) hide show
  1. package/README.md +277 -0
  2. package/dist/dev/main.d.ts +2 -0
  3. package/dist/dev/main.d.ts.map +1 -0
  4. package/dist/generated/global-operations.d.ts +2170 -0
  5. package/dist/generated/global-operations.d.ts.map +1 -0
  6. package/dist/generated/global-operations.js +672 -0
  7. package/dist/generated/global-operations.js.map +1 -0
  8. package/dist/generated/global-types.d.ts +20716 -0
  9. package/dist/generated/global-types.d.ts.map +1 -0
  10. package/dist/generated/wspace-operations.d.ts +2 -0
  11. package/dist/generated/wspace-operations.d.ts.map +1 -0
  12. package/dist/generated/wspace-types.d.ts +53363 -0
  13. package/dist/generated/wspace-types.d.ts.map +1 -0
  14. package/dist/index.d.ts +6 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +8 -0
  17. package/dist/newsletter/AdminNewsletterRoot.d.ts +49 -0
  18. package/dist/newsletter/AdminNewsletterRoot.d.ts.map +1 -0
  19. package/dist/newsletter/AdminNewsletterRoot.js +227 -0
  20. package/dist/newsletter/AdminNewsletterRoot.js.map +1 -0
  21. package/dist/newsletter/AdminNewsletterRoutes.d.ts +36 -0
  22. package/dist/newsletter/AdminNewsletterRoutes.d.ts.map +1 -0
  23. package/dist/newsletter/AdminNewsletterRoutes.js +116 -0
  24. package/dist/newsletter/AdminNewsletterRoutes.js.map +1 -0
  25. package/dist/newsletter/NewsletterRoot.d.ts +11 -0
  26. package/dist/newsletter/NewsletterRoot.d.ts.map +1 -0
  27. package/dist/newsletter/NewsletterRoot.js +7 -0
  28. package/dist/newsletter/NewsletterRoot.js.map +1 -0
  29. package/dist/newsletter/NewsletterRoutes.d.ts +8 -0
  30. package/dist/newsletter/NewsletterRoutes.d.ts.map +1 -0
  31. package/dist/newsletter/UserNewsletterRoot.d.ts +38 -0
  32. package/dist/newsletter/UserNewsletterRoot.d.ts.map +1 -0
  33. package/dist/newsletter/UserNewsletterRoot.js +91 -0
  34. package/dist/newsletter/UserNewsletterRoot.js.map +1 -0
  35. package/dist/newsletter/UserNewsletterRoutes.d.ts +25 -0
  36. package/dist/newsletter/UserNewsletterRoutes.d.ts.map +1 -0
  37. package/dist/newsletter/UserNewsletterRoutes.js +56 -0
  38. package/dist/newsletter/UserNewsletterRoutes.js.map +1 -0
  39. package/dist/newsletter/components/index.d.ts +25 -0
  40. package/dist/newsletter/components/index.d.ts.map +1 -0
  41. package/dist/newsletter/components/ui.d.ts +6 -0
  42. package/dist/newsletter/components/ui.d.ts.map +1 -0
  43. package/dist/newsletter/constants/permissions.d.ts +44 -0
  44. package/dist/newsletter/constants/permissions.d.ts.map +1 -0
  45. package/dist/newsletter/constants/permissions.js +33 -0
  46. package/dist/newsletter/constants/permissions.js.map +1 -0
  47. package/dist/newsletter/hooks/index.d.ts +9 -0
  48. package/dist/newsletter/hooks/index.d.ts.map +1 -0
  49. package/dist/newsletter/hooks/index.js +5 -0
  50. package/dist/newsletter/hooks/useAnalyticsOperations.d.ts +98 -0
  51. package/dist/newsletter/hooks/useAnalyticsOperations.d.ts.map +1 -0
  52. package/dist/newsletter/hooks/useAnalyticsOperations.js +33 -0
  53. package/dist/newsletter/hooks/useAnalyticsOperations.js.map +1 -0
  54. package/dist/newsletter/hooks/useComplianceOperations.d.ts +185 -0
  55. package/dist/newsletter/hooks/useComplianceOperations.d.ts.map +1 -0
  56. package/dist/newsletter/hooks/useComplianceOperations.js +95 -0
  57. package/dist/newsletter/hooks/useComplianceOperations.js.map +1 -0
  58. package/dist/newsletter/hooks/useNewsletterOperations.d.ts +459 -0
  59. package/dist/newsletter/hooks/useNewsletterOperations.d.ts.map +1 -0
  60. package/dist/newsletter/hooks/useNewsletterOperations.js +397 -0
  61. package/dist/newsletter/hooks/useNewsletterOperations.js.map +1 -0
  62. package/dist/newsletter/hooks/useNewsletterPermissions.d.ts +41 -0
  63. package/dist/newsletter/hooks/useNewsletterPermissions.d.ts.map +1 -0
  64. package/dist/newsletter/hooks/useNewsletterPermissions.js +35 -0
  65. package/dist/newsletter/hooks/useNewsletterPermissions.js.map +1 -0
  66. package/dist/newsletter/hooks/useWaitlistOperations.d.ts +95 -0
  67. package/dist/newsletter/hooks/useWaitlistOperations.d.ts.map +1 -0
  68. package/dist/newsletter/hooks/useWaitlistOperations.js +46 -0
  69. package/dist/newsletter/hooks/useWaitlistOperations.js.map +1 -0
  70. package/dist/newsletter/index.d.ts +55 -0
  71. package/dist/newsletter/index.d.ts.map +1 -0
  72. package/dist/newsletter/index.js +7 -0
  73. package/dist/newsletter/pages/ABTestingPage.d.ts +17 -0
  74. package/dist/newsletter/pages/ABTestingPage.d.ts.map +1 -0
  75. package/dist/newsletter/pages/ABTestingPage.js +806 -0
  76. package/dist/newsletter/pages/ABTestingPage.js.map +1 -0
  77. package/dist/newsletter/pages/AnalyticsDashboardPage.d.ts +17 -0
  78. package/dist/newsletter/pages/AnalyticsDashboardPage.d.ts.map +1 -0
  79. package/dist/newsletter/pages/AnalyticsDashboardPage.js +452 -0
  80. package/dist/newsletter/pages/AnalyticsDashboardPage.js.map +1 -0
  81. package/dist/newsletter/pages/CampaignAnalyticsPage.d.ts +17 -0
  82. package/dist/newsletter/pages/CampaignAnalyticsPage.d.ts.map +1 -0
  83. package/dist/newsletter/pages/CampaignAnalyticsPage.js +498 -0
  84. package/dist/newsletter/pages/CampaignAnalyticsPage.js.map +1 -0
  85. package/dist/newsletter/pages/CampaignEditorPage.d.ts +16 -0
  86. package/dist/newsletter/pages/CampaignEditorPage.d.ts.map +1 -0
  87. package/dist/newsletter/pages/CampaignEditorPage.js +523 -0
  88. package/dist/newsletter/pages/CampaignEditorPage.js.map +1 -0
  89. package/dist/newsletter/pages/CampaignsListPage.d.ts +15 -0
  90. package/dist/newsletter/pages/CampaignsListPage.d.ts.map +1 -0
  91. package/dist/newsletter/pages/CampaignsListPage.js +302 -0
  92. package/dist/newsletter/pages/CampaignsListPage.js.map +1 -0
  93. package/dist/newsletter/pages/CompliancePage.d.ts +17 -0
  94. package/dist/newsletter/pages/CompliancePage.d.ts.map +1 -0
  95. package/dist/newsletter/pages/CompliancePage.js +1094 -0
  96. package/dist/newsletter/pages/CompliancePage.js.map +1 -0
  97. package/dist/newsletter/pages/SchedulerPage.d.ts +17 -0
  98. package/dist/newsletter/pages/SchedulerPage.d.ts.map +1 -0
  99. package/dist/newsletter/pages/SchedulerPage.js +503 -0
  100. package/dist/newsletter/pages/SchedulerPage.js.map +1 -0
  101. package/dist/newsletter/pages/SubscriberDetailPage.d.ts +17 -0
  102. package/dist/newsletter/pages/SubscriberDetailPage.d.ts.map +1 -0
  103. package/dist/newsletter/pages/SubscriberDetailPage.js +442 -0
  104. package/dist/newsletter/pages/SubscriberDetailPage.js.map +1 -0
  105. package/dist/newsletter/pages/SubscribersListPage.d.ts +17 -0
  106. package/dist/newsletter/pages/SubscribersListPage.d.ts.map +1 -0
  107. package/dist/newsletter/pages/SubscribersListPage.js +553 -0
  108. package/dist/newsletter/pages/SubscribersListPage.js.map +1 -0
  109. package/dist/newsletter/pages/TemplateEditorPage.d.ts +17 -0
  110. package/dist/newsletter/pages/TemplateEditorPage.d.ts.map +1 -0
  111. package/dist/newsletter/pages/TemplateEditorPage.js +451 -0
  112. package/dist/newsletter/pages/TemplateEditorPage.js.map +1 -0
  113. package/dist/newsletter/pages/TemplateLibraryPage.d.ts +17 -0
  114. package/dist/newsletter/pages/TemplateLibraryPage.d.ts.map +1 -0
  115. package/dist/newsletter/pages/TemplateLibraryPage.js +360 -0
  116. package/dist/newsletter/pages/TemplateLibraryPage.js.map +1 -0
  117. package/dist/newsletter/pages/WaitlistDetailPage.d.ts +13 -0
  118. package/dist/newsletter/pages/WaitlistDetailPage.d.ts.map +1 -0
  119. package/dist/newsletter/pages/WaitlistDetailPage.js +321 -0
  120. package/dist/newsletter/pages/WaitlistDetailPage.js.map +1 -0
  121. package/dist/newsletter/pages/WaitlistListPage.d.ts +15 -0
  122. package/dist/newsletter/pages/WaitlistListPage.d.ts.map +1 -0
  123. package/dist/newsletter/pages/WaitlistListPage.js +432 -0
  124. package/dist/newsletter/pages/WaitlistListPage.js.map +1 -0
  125. package/dist/newsletter/providers/NewsletterProvider.d.ts +54 -0
  126. package/dist/newsletter/providers/NewsletterProvider.d.ts.map +1 -0
  127. package/dist/newsletter/providers/NewsletterProvider.js +119 -0
  128. package/dist/newsletter/providers/NewsletterProvider.js.map +1 -0
  129. package/dist/newsletter/shared/hooks/useTr.d.ts +14 -0
  130. package/dist/newsletter/shared/hooks/useTr.d.ts.map +1 -0
  131. package/dist/newsletter/shared/hooks/useTr.js +14 -0
  132. package/dist/newsletter/shared/hooks/useTr.js.map +1 -0
  133. package/dist/newsletter/store/newsletterStore.d.ts +49 -0
  134. package/dist/newsletter/store/newsletterStore.d.ts.map +1 -0
  135. package/dist/newsletter/store/newsletterStore.js +109 -0
  136. package/dist/newsletter/store/newsletterStore.js.map +1 -0
  137. package/dist/newsletter/types/index.d.ts +509 -0
  138. package/dist/newsletter/types/index.d.ts.map +1 -0
  139. package/dist/newsletter/utils/cn.d.ts +8 -0
  140. package/dist/newsletter/utils/cn.d.ts.map +1 -0
  141. package/dist/newsletter/utils/formatting.d.ts +29 -0
  142. package/dist/newsletter/utils/formatting.d.ts.map +1 -0
  143. package/dist/newsletter/utils/index.d.ts +6 -0
  144. package/dist/newsletter/utils/index.d.ts.map +1 -0
  145. package/dist/newsletter/utils/validation.d.ts +26 -0
  146. package/dist/newsletter/utils/validation.d.ts.map +1 -0
  147. package/dist/node_modules/@apollo/client/errors/index.js +22 -0
  148. package/dist/node_modules/@apollo/client/errors/index.js.map +1 -0
  149. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +75 -0
  150. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -0
  151. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +38 -0
  152. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -0
  153. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +20 -0
  154. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -0
  155. package/dist/node_modules/@apollo/client/link/utils/transformOperation.js +15 -0
  156. package/dist/node_modules/@apollo/client/link/utils/transformOperation.js.map +1 -0
  157. package/dist/node_modules/@apollo/client/link/utils/validateOperation.js +19 -0
  158. package/dist/node_modules/@apollo/client/link/utils/validateOperation.js.map +1 -0
  159. package/dist/node_modules/@apollo/client/node_modules/tslib/tslib.es6.js +30 -0
  160. package/dist/node_modules/@apollo/client/node_modules/tslib/tslib.es6.js.map +1 -0
  161. package/dist/node_modules/@apollo/client/utilities/caching/caches.js +19 -0
  162. package/dist/node_modules/@apollo/client/utilities/caching/caches.js.map +1 -0
  163. package/dist/node_modules/@apollo/client/utilities/caching/getMemoryInternals.js +27 -0
  164. package/dist/node_modules/@apollo/client/utilities/caching/getMemoryInternals.js.map +1 -0
  165. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +7 -0
  166. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -0
  167. package/dist/node_modules/@apollo/client/utilities/common/makeUniqueId.js +10 -0
  168. package/dist/node_modules/@apollo/client/utilities/common/makeUniqueId.js.map +1 -0
  169. package/dist/node_modules/@apollo/client/utilities/common/objects.js +8 -0
  170. package/dist/node_modules/@apollo/client/utilities/common/objects.js.map +1 -0
  171. package/dist/node_modules/@apollo/client/utilities/common/stringifyForDisplay.js +13 -0
  172. package/dist/node_modules/@apollo/client/utilities/common/stringifyForDisplay.js.map +1 -0
  173. package/dist/node_modules/@apollo/client/utilities/deprecation/index.js +15 -0
  174. package/dist/node_modules/@apollo/client/utilities/deprecation/index.js.map +1 -0
  175. package/dist/node_modules/@apollo/client/utilities/globals/global.js +17 -0
  176. package/dist/node_modules/@apollo/client/utilities/globals/global.js.map +1 -0
  177. package/dist/node_modules/@apollo/client/utilities/globals/invariantWrappers.js +51 -0
  178. package/dist/node_modules/@apollo/client/utilities/globals/invariantWrappers.js.map +1 -0
  179. package/dist/node_modules/@apollo/client/utilities/globals/maybe.js +10 -0
  180. package/dist/node_modules/@apollo/client/utilities/globals/maybe.js.map +1 -0
  181. package/dist/node_modules/@apollo/client/utilities/graphql/getFromAST.js +36 -0
  182. package/dist/node_modules/@apollo/client/utilities/graphql/getFromAST.js.map +1 -0
  183. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +18 -0
  184. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -0
  185. package/dist/node_modules/@apollo/client/version.js +6 -0
  186. package/dist/node_modules/@apollo/client/version.js.map +1 -0
  187. package/dist/node_modules/@wry/caches/lib/weak.js +67 -0
  188. package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -0
  189. package/dist/node_modules/@wry/context/lib/index.js +6 -0
  190. package/dist/node_modules/@wry/context/lib/index.js.map +1 -0
  191. package/dist/node_modules/@wry/context/lib/slot.js +79 -0
  192. package/dist/node_modules/@wry/context/lib/slot.js.map +1 -0
  193. package/dist/node_modules/@wry/trie/lib/index.js +5 -0
  194. package/dist/node_modules/@wry/trie/lib/index.js.map +1 -0
  195. package/dist/node_modules/graphql-ws/lib/client.js +320 -0
  196. package/dist/node_modules/graphql-ws/lib/client.js.map +1 -0
  197. package/dist/node_modules/graphql-ws/lib/common.js +58 -0
  198. package/dist/node_modules/graphql-ws/lib/common.js.map +1 -0
  199. package/dist/node_modules/graphql-ws/lib/utils.js +17 -0
  200. package/dist/node_modules/graphql-ws/lib/utils.js.map +1 -0
  201. package/dist/node_modules/optimism/lib/context.js +8 -0
  202. package/dist/node_modules/optimism/lib/context.js.map +1 -0
  203. package/dist/node_modules/optimism/lib/dep.js +2 -0
  204. package/dist/node_modules/optimism/lib/entry.js +124 -0
  205. package/dist/node_modules/optimism/lib/entry.js.map +1 -0
  206. package/dist/node_modules/optimism/lib/helpers.js +13 -0
  207. package/dist/node_modules/optimism/lib/helpers.js.map +1 -0
  208. package/dist/node_modules/optimism/lib/index.js +5 -0
  209. package/dist/node_modules/ts-invariant/lib/invariant.js +35 -0
  210. package/dist/node_modules/ts-invariant/lib/invariant.js.map +1 -0
  211. package/dist/node_modules/ts-invariant/node_modules/tslib/tslib.es6.js +20 -0
  212. package/dist/node_modules/ts-invariant/node_modules/tslib/tslib.es6.js.map +1 -0
  213. package/dist/node_modules/zen-observable-ts/module.js +402 -0
  214. package/dist/node_modules/zen-observable-ts/module.js.map +1 -0
  215. package/dist/utils/nativeBridge.d.ts +3 -0
  216. package/dist/utils/nativeBridge.d.ts.map +1 -0
  217. package/dist/utils/nativeBridge.js +2 -0
  218. package/package.json +106 -0
@@ -0,0 +1,91 @@
1
+ import { NewsletterProvider as e } from "./providers/NewsletterProvider.js";
2
+ import { useTr as t } from "./shared/hooks/useTr.js";
3
+ import { UserNewsletterRoutes as n } from "./UserNewsletterRoutes.js";
4
+ import { useEffect as r, useMemo as i } from "react";
5
+ import { ErrorBoundary as a } from "@burdenoff/fe-libs/shared/components";
6
+ import { FeatureFlagProvider as o } from "@burdenoff/fe-libs/shared/feature-flags";
7
+ import { useSearchParams as s } from "react-router-dom";
8
+ import { getActiveContext as c } from "@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager";
9
+ import { BarChart3 as l, Layout as u, Send as d } from "lucide-react";
10
+ import { jsx as f } from "react/jsx-runtime";
11
+ //#region src/newsletter/UserNewsletterRoot.tsx
12
+ var p = (p) => {
13
+ let { registerNavItems: m, registerFooterItems: h, basePath: g = "/" } = p, _ = t(), [v] = s(), y = p.productId, b = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
14
+ r(() => {
15
+ if (y && m) return m([
16
+ {
17
+ id: "user-newsletter-campaigns",
18
+ label: _("newsletter.nav.campaigns", "Campaigns"),
19
+ path: g === "/" ? "/campaigns" : b(g, "campaigns"),
20
+ icon: /* @__PURE__ */ f(d, { size: 20 }),
21
+ order: 10,
22
+ group: "newsletter"
23
+ },
24
+ {
25
+ id: "user-newsletter-templates",
26
+ label: _("newsletter.nav.templates", "Templates"),
27
+ path: b(g, "templates"),
28
+ icon: /* @__PURE__ */ f(u, { size: 20 }),
29
+ order: 20,
30
+ group: "newsletter"
31
+ },
32
+ {
33
+ id: "user-newsletter-analytics",
34
+ label: _("newsletter.nav.analytics", "Analytics"),
35
+ path: b(g, "analytics"),
36
+ icon: /* @__PURE__ */ f(l, { size: 20 }),
37
+ order: 30,
38
+ group: "newsletter"
39
+ }
40
+ ]);
41
+ }, [
42
+ y,
43
+ m,
44
+ g,
45
+ _
46
+ ]), r(() => {
47
+ if (y && h) return h([{
48
+ id: "user-newsletter-status",
49
+ label: _("newsletter.status.ready", "Newsletter Ready"),
50
+ type: "status",
51
+ order: 10,
52
+ section: "left"
53
+ }]);
54
+ }, [
55
+ y,
56
+ h,
57
+ _
58
+ ]);
59
+ let x = i(() => {
60
+ let e = v.get("workspace");
61
+ if (e && e.trim().length > 0) return e;
62
+ try {
63
+ return c()?.workspaceId ?? null;
64
+ } catch {
65
+ return null;
66
+ }
67
+ }, [v]);
68
+ return y ? /* @__PURE__ */ f(a, {
69
+ fallback: /* @__PURE__ */ f("div", {
70
+ className: "p-6 text-center text-text-secondary",
71
+ children: _("newsletter.errorBoundaryFallback", "Something went wrong loading this module. Please refresh the page.")
72
+ }),
73
+ children: /* @__PURE__ */ f(o, {
74
+ workspaceId: x,
75
+ gateway: "global",
76
+ defaultEnabled: !0,
77
+ children: /* @__PURE__ */ f(e, {
78
+ ...p,
79
+ productId: y,
80
+ children: /* @__PURE__ */ f(n, {})
81
+ })
82
+ })
83
+ }) : /* @__PURE__ */ f("div", {
84
+ className: "p-6 text-center text-text-secondary",
85
+ children: _("newsletter.productScopeRequired", "A product scope is required to load the newsletter module.")
86
+ });
87
+ };
88
+ //#endregion
89
+ export { p as UserNewsletterRoot };
90
+
91
+ //# sourceMappingURL=UserNewsletterRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserNewsletterRoot.js","names":[],"sources":["../../src/newsletter/UserNewsletterRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect, useMemo } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { Send, Layout, BarChart3 } from 'lucide-react';\nimport { useSearchParams } from 'react-router-dom';\nimport { NewsletterProvider } from './providers/NewsletterProvider';\nimport type { NavItem, NewsletterRootProps } from './types';\nimport { UserNewsletterRoutes } from './UserNewsletterRoutes';\nimport { useTr } from './shared/hooks/useTr';\nimport { getActiveContext as getStoredActiveContext } from '@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager';\n\n/**\n * User-facing Root component for the Newsletter microfrontend.\n *\n * This is the limited, read-oriented entry point intended for product shells\n * (e.g. vibecontrols-app). It exposes only Campaigns (list + per-campaign\n * analytics), Templates (library), and the Analytics dashboard. Admin-only\n * actions (create/edit/delete) are still hidden via the existing\n * `usePermissions` checks inside each page, so RBAC remains the source of\n * truth for what end users can perform.\n *\n * For the full admin surface (campaign editor, template editor, subscribers,\n * scheduler, A/B testing, compliance, waitlist), use `AdminNewsletterRoot`.\n *\n * @example\n * ```tsx\n * import { UserNewsletterRoot, type NewsletterRootProps } from '@burdenoff/micro-fe/newsletter';\n *\n * function App() {\n * return (\n * <UserNewsletterRoot\n * basePath=\"/newsletter\"\n * navigate={(path) => router.push(path)}\n * currentUser={user}\n * productId={productId}\n * apiGatewayUrl=\"https://api.example.com/tenant\"\n * authToken={authToken}\n * registerNavItems={(items) => { return () => {}; }}\n * registerFooterItems={(items) => { return () => {}; }}\n * />\n * );\n * }\n * ```\n */\nexport const UserNewsletterRoot: FC<NewsletterRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const tr = useTr();\n const [searchParams] = useSearchParams();\n const productId = props.productId;\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell (user-facing subset only)\n useEffect(() => {\n if (!productId) return;\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'user-newsletter-campaigns',\n label: tr('newsletter.nav.campaigns', 'Campaigns'),\n path: basePath === '/' ? '/campaigns' : joinPath(basePath, 'campaigns'),\n icon: <Send size={20} />,\n order: 10,\n group: 'newsletter',\n },\n {\n id: 'user-newsletter-templates',\n label: tr('newsletter.nav.templates', 'Templates'),\n path: joinPath(basePath, 'templates'),\n icon: <Layout size={20} />,\n order: 20,\n group: 'newsletter',\n },\n {\n id: 'user-newsletter-analytics',\n label: tr('newsletter.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={20} />,\n order: 30,\n group: 'newsletter',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [productId, registerNavItems, basePath, tr]);\n\n // Register footer items (status indicator in left section)\n useEffect(() => {\n if (!productId) return;\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'user-newsletter-status',\n label: tr('newsletter.status.ready', 'Newsletter Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [productId, registerFooterItems, tr]);\n\n const featureFlagWorkspaceId = useMemo(() => {\n const workspaceIdFromUrl = searchParams.get('workspace');\n if (workspaceIdFromUrl && workspaceIdFromUrl.trim().length > 0) {\n return workspaceIdFromUrl;\n }\n\n try {\n return getStoredActiveContext()?.workspaceId ?? null;\n } catch {\n return null;\n }\n }, [searchParams]);\n\n if (!productId) {\n return (\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'newsletter.productScopeRequired',\n 'A product scope is required to load the newsletter module.'\n )}\n </div>\n );\n }\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'newsletter.errorBoundaryFallback',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <FeatureFlagProvider\n workspaceId={featureFlagWorkspaceId}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <NewsletterProvider {...props} productId={productId}>\n <UserNewsletterRoutes />\n </NewsletterProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;;AA6CA,IAAa,KAA+C,MAAU;CACpE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,IAAK,GAAO,EACZ,CAAC,KAAgB,GAAiB,EAClC,IAAY,EAAM,WAGlB,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AA4CtD,CAvCA,QAAgB;AACT,WACA,EAiCL,QAHgB,EA5BY;GAC1B;IACE,IAAI;IACJ,OAAO,EAAG,4BAA4B,YAAY;IAClD,MAAM,MAAa,MAAM,eAAe,EAAS,GAAU,YAAY;IACvE,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;IACxB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,4BAA4B,YAAY;IAClD,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;IAC1B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,4BAA4B,YAAY;IAClD,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;IAC7B,OAAO;IACP,OAAO;IACR;GACF,CAGyC;IAIzC;EAAC;EAAW;EAAkB;EAAU;EAAG,CAAC,EAG/C,QAAgB;AACT,WACA,EAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAG,2BAA2B,mBAAmB;GACxD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C;EAAC;EAAW;EAAqB;EAAG,CAAC;CAExC,IAAM,IAAyB,QAAc;EAC3C,IAAM,IAAqB,EAAa,IAAI,YAAY;AACxD,MAAI,KAAsB,EAAmB,MAAM,CAAC,SAAS,EAC3D,QAAO;AAGT,MAAI;AACF,UAAO,GAAwB,EAAE,eAAe;UAC1C;AACN,UAAO;;IAER,CAAC,EAAa,CAAC;AAalB,QAXK,IAYH,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aACZ,EACC,oCACA,qEACD;GACG,CAAA;YAGR,kBAAC,GAAD;GACE,aAAa;GACb,SAAQ;GACR,gBAAgB;aAEhB,kBAAC,GAAD;IAAoB,GAAI;IAAkB;cACxC,kBAAC,GAAD,EAAwB,CAAA;IACL,CAAA;GACD,CAAA;EACR,CAAA,GA7Bd,kBAAC,OAAD;EAAK,WAAU;YACZ,EACC,mCACA,6DACD;EACG,CAAA"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Internal router for the User-facing Newsletter microfrontend.
3
+ *
4
+ * Exposes a limited, read-oriented surface of the newsletter module suitable
5
+ * for product shells (e.g. vibecontrols-app). Full CRUD surfaces such as the
6
+ * campaign editor, template editor, subscribers, scheduler, A/B testing,
7
+ * compliance, and waitlist are intentionally omitted here and only available
8
+ * via {@link AdminNewsletterRoutes}.
9
+ *
10
+ * **Route Structure**:
11
+ * ```
12
+ * / → Redirect to analytics
13
+ * /campaigns → List campaigns (read-only via RBAC)
14
+ * /campaigns/:campaignId/analytics → View campaign analytics
15
+ * /templates → Template library (read-only via RBAC)
16
+ * /analytics → Analytics dashboard
17
+ * ```
18
+ *
19
+ * **Protected Routes**:
20
+ * All routes still enforce RBAC via `tenantmodule-newsletter:*` scopes at the
21
+ * page level. Admin-only actions (create/edit/delete) are hidden by the
22
+ * existing `usePermissions` checks within each page.
23
+ */
24
+ export declare function UserNewsletterRoutes(): import("react/jsx-runtime").JSX.Element;
25
+ //# sourceMappingURL=UserNewsletterRoutes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserNewsletterRoutes.d.ts","sourceRoot":"","sources":["../../src/newsletter/UserNewsletterRoutes.tsx"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,4CAsBnC"}
@@ -0,0 +1,56 @@
1
+ import { CampaignsListPage as e } from "./pages/CampaignsListPage.js";
2
+ import { CampaignAnalyticsPage as t } from "./pages/CampaignAnalyticsPage.js";
3
+ import { TemplateLibraryPage as n } from "./pages/TemplateLibraryPage.js";
4
+ import { AnalyticsDashboardPage as r } from "./pages/AnalyticsDashboardPage.js";
5
+ import { Suspense as i } from "react";
6
+ import { Navigate as a, Route as o, Routes as s } from "react-router-dom";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ //#region src/newsletter/UserNewsletterRoutes.tsx
9
+ function u() {
10
+ return /* @__PURE__ */ c("div", {
11
+ className: "flex h-64 items-center justify-center",
12
+ children: /* @__PURE__ */ c("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
13
+ });
14
+ }
15
+ function d() {
16
+ return /* @__PURE__ */ c(i, {
17
+ fallback: /* @__PURE__ */ c(u, {}),
18
+ children: /* @__PURE__ */ l(s, { children: [
19
+ /* @__PURE__ */ c(o, {
20
+ index: !0,
21
+ element: /* @__PURE__ */ c(a, {
22
+ to: "analytics",
23
+ replace: !0
24
+ })
25
+ }),
26
+ /* @__PURE__ */ c(o, {
27
+ path: "campaigns",
28
+ element: /* @__PURE__ */ c(e, {})
29
+ }),
30
+ /* @__PURE__ */ c(o, {
31
+ path: "campaigns/:campaignId/analytics",
32
+ element: /* @__PURE__ */ c(t, {})
33
+ }),
34
+ /* @__PURE__ */ c(o, {
35
+ path: "templates",
36
+ element: /* @__PURE__ */ c(n, {})
37
+ }),
38
+ /* @__PURE__ */ c(o, {
39
+ path: "analytics",
40
+ element: /* @__PURE__ */ c(r, {})
41
+ }),
42
+ /* @__PURE__ */ c(o, {
43
+ path: "*",
44
+ element: /* @__PURE__ */ c(a, {
45
+ to: "..",
46
+ replace: !0,
47
+ relative: "path"
48
+ })
49
+ })
50
+ ] })
51
+ });
52
+ }
53
+ //#endregion
54
+ export { d as UserNewsletterRoutes };
55
+
56
+ //# sourceMappingURL=UserNewsletterRoutes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserNewsletterRoutes.js","names":[],"sources":["../../src/newsletter/UserNewsletterRoutes.tsx"],"sourcesContent":["import { Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router-dom';\nimport { CampaignsListPage } from './pages/CampaignsListPage';\nimport { CampaignAnalyticsPage } from './pages/CampaignAnalyticsPage';\nimport { TemplateLibraryPage } from './pages/TemplateLibraryPage';\nimport { AnalyticsDashboardPage } from './pages/AnalyticsDashboardPage';\n\n/**\n * Loading fallback component for lazy-loaded pages.\n */\nfunction PageLoadingFallback() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the User-facing Newsletter microfrontend.\n *\n * Exposes a limited, read-oriented surface of the newsletter module suitable\n * for product shells (e.g. vibecontrols-app). Full CRUD surfaces such as the\n * campaign editor, template editor, subscribers, scheduler, A/B testing,\n * compliance, and waitlist are intentionally omitted here and only available\n * via {@link AdminNewsletterRoutes}.\n *\n * **Route Structure**:\n * ```\n * / → Redirect to analytics\n * /campaigns → List campaigns (read-only via RBAC)\n * /campaigns/:campaignId/analytics → View campaign analytics\n * /templates → Template library (read-only via RBAC)\n * /analytics → Analytics dashboard\n * ```\n *\n * **Protected Routes**:\n * All routes still enforce RBAC via `tenantmodule-newsletter:*` scopes at the\n * page level. Admin-only actions (create/edit/delete) are hidden by the\n * existing `usePermissions` checks within each page.\n */\nexport function UserNewsletterRoutes() {\n return (\n <Suspense fallback={<PageLoadingFallback />}>\n <Routes>\n {/* Default redirect to analytics */}\n <Route index element={<Navigate to=\"analytics\" replace />} />\n\n {/* Campaigns - list + per-campaign analytics only */}\n <Route path=\"campaigns\" element={<CampaignsListPage />} />\n <Route path=\"campaigns/:campaignId/analytics\" element={<CampaignAnalyticsPage />} />\n\n {/* Templates - library view only */}\n <Route path=\"templates\" element={<TemplateLibraryPage />} />\n\n {/* Analytics */}\n <Route path=\"analytics\" element={<AnalyticsDashboardPage />} />\n\n {/* Catch-all route - go up to index (avoids relative path append loop) */}\n <Route path=\"*\" element={<Navigate to=\"..\" replace relative=\"path\" />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;AAUA,SAAS,IAAsB;AAC7B,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA;;AA2BV,SAAgB,IAAuB;AACrC,QACE,kBAAC,GAAD;EAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;YACzC,kBAAC,GAAD,EAAA,UAAA;GAEE,kBAAC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAY,SAAA;KAAU,CAAA;IAAI,CAAA;GAG7D,kBAAC,GAAD;IAAO,MAAK;IAAY,SAAS,kBAAC,GAAD,EAAqB,CAAA;IAAI,CAAA;GAC1D,kBAAC,GAAD;IAAO,MAAK;IAAkC,SAAS,kBAAC,GAAD,EAAyB,CAAA;IAAI,CAAA;GAGpF,kBAAC,GAAD;IAAO,MAAK;IAAY,SAAS,kBAAC,GAAD,EAAuB,CAAA;IAAI,CAAA;GAG5D,kBAAC,GAAD;IAAO,MAAK;IAAY,SAAS,kBAAC,GAAD,EAA0B,CAAA;IAAI,CAAA;GAG/D,kBAAC,GAAD;IAAO,MAAK;IAAI,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAK,SAAA;KAAQ,UAAS;KAAS,CAAA;IAAI,CAAA;GAClE,EAAA,CAAA;EACA,CAAA"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Newsletter component exports
3
+ *
4
+ * This file exports all reusable components used across the newsletter microfrontend.
5
+ * Components are organized by feature area and follow the design system patterns.
6
+ *
7
+ * **Component Categories**:
8
+ * - Campaign components (CampaignCard, CampaignActions, etc.)
9
+ * - Editor components (EmailEditor, TemplateSelector, etc.)
10
+ * - Subscriber components (SubscriberTable, SubscriberImportWizard, etc.)
11
+ * - Analytics components (AnalyticsChart, ClickHeatmap, etc.)
12
+ * - Scheduler components (SchedulePicker, RecurringConfig, etc.)
13
+ * - Testing components (ABTestSetup, VariantComparison, etc.)
14
+ * - Compliance components (UnsubscribePage, ConsentTracker, etc.)
15
+ *
16
+ * **Usage**:
17
+ * ```tsx
18
+ * import { CampaignCard, EmailEditor } from './components';
19
+ * ```
20
+ *
21
+ * @note Most components are implemented inline in page components for now.
22
+ * Extract to separate files when they become reusable across multiple pages.
23
+ */
24
+ export {};
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/newsletter/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AA8CH,OAAO,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * UI Component re-exports from @burdenoff/fe-libs
3
+ * All styled components are imported from the shared fe-libs package
4
+ */
5
+ export { Button, Badge, Card, CardContent, CardHeader, CardTitle, CardDescription, CardFooter, Input, Skeleton, Separator, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Tabs, TabsList, TabsTrigger, TabsContent, Textarea, Label, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownMenuSeparator, ScrollArea, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Switch, Checkbox, } from '@burdenoff/fe-libs/ui';
6
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/newsletter/components/ui.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAS,EACT,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ,EACR,KAAK,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EACV,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Newsletter Permission Constants
3
+ *
4
+ * All permission strings for Newsletter resources.
5
+ * Use with fe-libs usePermissions hook: hasPermission(NEWSLETTER_PERMISSIONS.NEWSLETTER_LIST)
6
+ *
7
+ * Resource types:
8
+ * - newsletter: list, read, create, update, delete, send
9
+ * - subscriber: list, read, create, delete, import, export
10
+ * - template: list, read, create, update, delete
11
+ * - campaign: list, read, create, update, delete, send
12
+ * - newsletter-analytics: read
13
+ * - newsletter-config: read, update
14
+ */
15
+ export declare const NEWSLETTER_PERMISSIONS: {
16
+ readonly NEWSLETTER_LIST: "tenantmodule-newsletter:newsletters:read";
17
+ readonly NEWSLETTER_READ: "tenantmodule-newsletter:newsletters:read";
18
+ readonly NEWSLETTER_CREATE: "tenantmodule-newsletter:newsletters:write";
19
+ readonly NEWSLETTER_UPDATE: "tenantmodule-newsletter:newsletters:write";
20
+ readonly NEWSLETTER_DELETE: "tenantmodule-newsletter:newsletters:delete";
21
+ readonly NEWSLETTER_SEND: "tenantmodule-newsletter:newsletters:send";
22
+ readonly SUBSCRIBER_LIST: "tenantmodule-newsletter:subscribers:read";
23
+ readonly SUBSCRIBER_READ: "tenantmodule-newsletter:subscribers:read";
24
+ readonly SUBSCRIBER_CREATE: "tenantmodule-newsletter:subscribers:write";
25
+ readonly SUBSCRIBER_DELETE: "tenantmodule-newsletter:subscribers:delete";
26
+ readonly SUBSCRIBER_IMPORT: "tenantmodule-newsletter:subscribers:import";
27
+ readonly SUBSCRIBER_EXPORT: "tenantmodule-newsletter:subscribers:export";
28
+ readonly TEMPLATE_LIST: "tenantmodule-newsletter:templates:read";
29
+ readonly TEMPLATE_READ: "tenantmodule-newsletter:templates:read";
30
+ readonly TEMPLATE_CREATE: "tenantmodule-newsletter:templates:write";
31
+ readonly TEMPLATE_UPDATE: "tenantmodule-newsletter:templates:write";
32
+ readonly TEMPLATE_DELETE: "tenantmodule-newsletter:templates:delete";
33
+ readonly CAMPAIGN_LIST: "tenantmodule-newsletter:campaigns:read";
34
+ readonly CAMPAIGN_READ: "tenantmodule-newsletter:campaigns:read";
35
+ readonly CAMPAIGN_CREATE: "tenantmodule-newsletter:campaigns:write";
36
+ readonly CAMPAIGN_UPDATE: "tenantmodule-newsletter:campaigns:write";
37
+ readonly CAMPAIGN_DELETE: "tenantmodule-newsletter:campaigns:delete";
38
+ readonly CAMPAIGN_SEND: "tenantmodule-newsletter:campaigns:send";
39
+ readonly ANALYTICS_VIEW: "tenantmodule-newsletter:analytics:read";
40
+ readonly CONFIG_VIEW: "tenantmodule-newsletter:config:read";
41
+ readonly CONFIG_MANAGE: "tenantmodule-newsletter:config:write";
42
+ };
43
+ export type NewsletterPermission = (typeof NEWSLETTER_PERMISSIONS)[keyof typeof NEWSLETTER_PERMISSIONS];
44
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/newsletter/constants/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCzB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAC9B,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ //#region src/newsletter/constants/permissions.ts
2
+ var e = {
3
+ NEWSLETTER_LIST: "tenantmodule-newsletter:newsletters:read",
4
+ NEWSLETTER_READ: "tenantmodule-newsletter:newsletters:read",
5
+ NEWSLETTER_CREATE: "tenantmodule-newsletter:newsletters:write",
6
+ NEWSLETTER_UPDATE: "tenantmodule-newsletter:newsletters:write",
7
+ NEWSLETTER_DELETE: "tenantmodule-newsletter:newsletters:delete",
8
+ NEWSLETTER_SEND: "tenantmodule-newsletter:newsletters:send",
9
+ SUBSCRIBER_LIST: "tenantmodule-newsletter:subscribers:read",
10
+ SUBSCRIBER_READ: "tenantmodule-newsletter:subscribers:read",
11
+ SUBSCRIBER_CREATE: "tenantmodule-newsletter:subscribers:write",
12
+ SUBSCRIBER_DELETE: "tenantmodule-newsletter:subscribers:delete",
13
+ SUBSCRIBER_IMPORT: "tenantmodule-newsletter:subscribers:import",
14
+ SUBSCRIBER_EXPORT: "tenantmodule-newsletter:subscribers:export",
15
+ TEMPLATE_LIST: "tenantmodule-newsletter:templates:read",
16
+ TEMPLATE_READ: "tenantmodule-newsletter:templates:read",
17
+ TEMPLATE_CREATE: "tenantmodule-newsletter:templates:write",
18
+ TEMPLATE_UPDATE: "tenantmodule-newsletter:templates:write",
19
+ TEMPLATE_DELETE: "tenantmodule-newsletter:templates:delete",
20
+ CAMPAIGN_LIST: "tenantmodule-newsletter:campaigns:read",
21
+ CAMPAIGN_READ: "tenantmodule-newsletter:campaigns:read",
22
+ CAMPAIGN_CREATE: "tenantmodule-newsletter:campaigns:write",
23
+ CAMPAIGN_UPDATE: "tenantmodule-newsletter:campaigns:write",
24
+ CAMPAIGN_DELETE: "tenantmodule-newsletter:campaigns:delete",
25
+ CAMPAIGN_SEND: "tenantmodule-newsletter:campaigns:send",
26
+ ANALYTICS_VIEW: "tenantmodule-newsletter:analytics:read",
27
+ CONFIG_VIEW: "tenantmodule-newsletter:config:read",
28
+ CONFIG_MANAGE: "tenantmodule-newsletter:config:write"
29
+ };
30
+ //#endregion
31
+ export { e as NEWSLETTER_PERMISSIONS };
32
+
33
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.js","names":[],"sources":["../../../src/newsletter/constants/permissions.ts"],"sourcesContent":["/**\n * Newsletter Permission Constants\n *\n * All permission strings for Newsletter resources.\n * Use with fe-libs usePermissions hook: hasPermission(NEWSLETTER_PERMISSIONS.NEWSLETTER_LIST)\n *\n * Resource types:\n * - newsletter: list, read, create, update, delete, send\n * - subscriber: list, read, create, delete, import, export\n * - template: list, read, create, update, delete\n * - campaign: list, read, create, update, delete, send\n * - newsletter-analytics: read\n * - newsletter-config: read, update\n */\n\nexport const NEWSLETTER_PERMISSIONS = {\n // Newsletter resources\n NEWSLETTER_LIST: 'tenantmodule-newsletter:newsletters:read',\n NEWSLETTER_READ: 'tenantmodule-newsletter:newsletters:read',\n NEWSLETTER_CREATE: 'tenantmodule-newsletter:newsletters:write',\n NEWSLETTER_UPDATE: 'tenantmodule-newsletter:newsletters:write',\n NEWSLETTER_DELETE: 'tenantmodule-newsletter:newsletters:delete',\n NEWSLETTER_SEND: 'tenantmodule-newsletter:newsletters:send',\n\n // Subscriber resources\n SUBSCRIBER_LIST: 'tenantmodule-newsletter:subscribers:read',\n SUBSCRIBER_READ: 'tenantmodule-newsletter:subscribers:read',\n SUBSCRIBER_CREATE: 'tenantmodule-newsletter:subscribers:write',\n SUBSCRIBER_DELETE: 'tenantmodule-newsletter:subscribers:delete',\n SUBSCRIBER_IMPORT: 'tenantmodule-newsletter:subscribers:import',\n SUBSCRIBER_EXPORT: 'tenantmodule-newsletter:subscribers:export',\n\n // Template resources\n TEMPLATE_LIST: 'tenantmodule-newsletter:templates:read',\n TEMPLATE_READ: 'tenantmodule-newsletter:templates:read',\n TEMPLATE_CREATE: 'tenantmodule-newsletter:templates:write',\n TEMPLATE_UPDATE: 'tenantmodule-newsletter:templates:write',\n TEMPLATE_DELETE: 'tenantmodule-newsletter:templates:delete',\n\n // Campaign resources\n CAMPAIGN_LIST: 'tenantmodule-newsletter:campaigns:read',\n CAMPAIGN_READ: 'tenantmodule-newsletter:campaigns:read',\n CAMPAIGN_CREATE: 'tenantmodule-newsletter:campaigns:write',\n CAMPAIGN_UPDATE: 'tenantmodule-newsletter:campaigns:write',\n CAMPAIGN_DELETE: 'tenantmodule-newsletter:campaigns:delete',\n CAMPAIGN_SEND: 'tenantmodule-newsletter:campaigns:send',\n\n // Analytics resources\n ANALYTICS_VIEW: 'tenantmodule-newsletter:analytics:read',\n\n // Configuration resources\n CONFIG_VIEW: 'tenantmodule-newsletter:config:read',\n CONFIG_MANAGE: 'tenantmodule-newsletter:config:write',\n} as const;\n\nexport type NewsletterPermission =\n (typeof NEWSLETTER_PERMISSIONS)[keyof typeof NEWSLETTER_PERMISSIONS];\n"],"mappings":";AAeA,IAAa,IAAyB;CAEpC,iBAAiB;CACjB,iBAAiB;CACjB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,iBAAiB;CAGjB,iBAAiB;CACjB,iBAAiB;CACjB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CAGnB,eAAe;CACf,eAAe;CACf,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CAGjB,eAAe;CACf,eAAe;CACf,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CACjB,eAAe;CAGf,gBAAgB;CAGhB,aAAa;CACb,eAAe;CAChB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Newsletter microfrontend hooks
3
+ */
4
+ export { useNewsletterPermissions } from './useNewsletterPermissions';
5
+ export { useNewsletters, useNewsletter, useNewsletterStats, useNewsletterMutations, type Newsletter, type NewsletterFilterInput, type CreateNewsletterInput, type UpdateNewsletterInput, useSubscribers, useSubscriber, useExportSubscribers, usePlatformProducts, useSubscriberMutations, type Subscriber, type SubscriberStatus, type SubscribeInput, type UpdateSubscriberInput, type ImportSubscriberInput, type ImportSubscribersResult, type ExportSubscriber, useTemplates, useTemplate, useTemplateMutations, type Template, type TemplateFilterInput, type CreateTemplateInput, type UpdateTemplateInput, useABTestResults, useABTestMutations, type NewsletterVariant, type VariantComparison, type CreateVariantInput, } from './useNewsletterOperations';
6
+ export { useWaitlistEntries, useWaitlistEntry, useWaitlistMutations, type WaitlistEntry, type WaitlistStatus, type WaitlistFilterInput, type JoinWaitlistInput, type ApproveWaitlistInput, type RejectWaitlistInput, } from './useWaitlistOperations';
7
+ export { useSuppressions, useSubscriberConsents, useIsEmailSuppressed, useSuppressionMutations, useConsentMutations, useComplianceSettings, useComplianceSettingsMutations, useComplianceAuditLog, type NewsletterSuppression, type NewsletterConsent, type SuppressionFilterInput, type AddSuppressionInput, type RecordConsentInput, type ComplianceSettings, type UpsertComplianceSettingsInput, type ComplianceAuditLogEntry, } from './useComplianceOperations';
8
+ export { useBounceStats, useComplaintStats, useCampaignBounces, useCampaignComplaints, type BounceStats, type ComplaintStats, type BounceType, type NewsletterBounce, type NewsletterComplaint, } from './useAnalyticsOperations';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/newsletter/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAEL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAE1B,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EAErB,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAExB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,8BAA8B,EAC9B,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,GAC7B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import "./useNewsletterPermissions.js";
2
+ import "./useNewsletterOperations.js";
3
+ import "./useWaitlistOperations.js";
4
+ import "./useComplianceOperations.js";
5
+ import "./useAnalyticsOperations.js";
@@ -0,0 +1,98 @@
1
+ import { GetBounceStatsQuery, GetComplaintStatsQuery, GetCampaignBouncesQuery, GetCampaignComplaintsQuery } from '../../generated/global-operations';
2
+
3
+ export interface BounceStats {
4
+ totalBounces: number;
5
+ hardBounces: number;
6
+ softBounces: number;
7
+ bounceRate: number;
8
+ }
9
+ export interface ComplaintStats {
10
+ totalComplaints: number;
11
+ complaintRate: number;
12
+ }
13
+ export type BounceType = 'HARD' | 'SOFT' | 'COMPLAINT';
14
+ export interface NewsletterBounce {
15
+ id: string;
16
+ campaignId: string;
17
+ subscriberId: string;
18
+ email: string;
19
+ bounceType: BounceType;
20
+ reason?: string;
21
+ diagnosticCode?: string;
22
+ bouncedAt: string;
23
+ }
24
+ export interface NewsletterComplaint {
25
+ id: string;
26
+ campaignId: string;
27
+ subscriberId: string;
28
+ email: string;
29
+ complaintType?: string;
30
+ feedbackType?: string;
31
+ complainedAt: string;
32
+ }
33
+ /**
34
+ * Hook for getting bounce statistics for a campaign
35
+ */
36
+ export declare function useBounceStats(campaignId: string): {
37
+ bounceStats: {
38
+ __typename?: "BounceStats";
39
+ totalBounces: number;
40
+ hardBounces: number;
41
+ softBounces: number;
42
+ bounceRate: number;
43
+ } | null;
44
+ loading: boolean;
45
+ error: import('@apollo/client').ApolloError | undefined;
46
+ refetch: (variables?: Partial<import('@apollo/client').OperationVariables> | undefined) => Promise<import('@apollo/client').ApolloQueryResult<GetBounceStatsQuery>>;
47
+ };
48
+ /**
49
+ * Hook for getting complaint statistics for a campaign
50
+ */
51
+ export declare function useComplaintStats(campaignId: string): {
52
+ complaintStats: {
53
+ __typename?: "ComplaintStats";
54
+ totalComplaints: number;
55
+ complaintRate: number;
56
+ } | null;
57
+ loading: boolean;
58
+ error: import('@apollo/client').ApolloError | undefined;
59
+ refetch: (variables?: Partial<import('@apollo/client').OperationVariables> | undefined) => Promise<import('@apollo/client').ApolloQueryResult<GetComplaintStatsQuery>>;
60
+ };
61
+ /**
62
+ * Hook for listing campaign bounces
63
+ */
64
+ export declare function useCampaignBounces(campaignId: string, bounceType?: BounceType, limit?: number, offset?: number): {
65
+ bounces: {
66
+ __typename?: "NewsletterBounce";
67
+ id: string;
68
+ campaignId: string;
69
+ subscriberId: string;
70
+ email: string;
71
+ bounceType: import('../../generated/global-types').BounceType;
72
+ reason?: string | null;
73
+ diagnosticCode?: string | null;
74
+ bouncedAt: string;
75
+ }[];
76
+ loading: boolean;
77
+ error: import('@apollo/client').ApolloError | undefined;
78
+ refetch: (variables?: Partial<import('@apollo/client').OperationVariables> | undefined) => Promise<import('@apollo/client').ApolloQueryResult<GetCampaignBouncesQuery>>;
79
+ };
80
+ /**
81
+ * Hook for listing campaign complaints
82
+ */
83
+ export declare function useCampaignComplaints(campaignId: string, limit?: number, offset?: number): {
84
+ complaints: {
85
+ __typename?: "NewsletterComplaint";
86
+ id: string;
87
+ campaignId: string;
88
+ subscriberId: string;
89
+ email: string;
90
+ complaintType?: string | null;
91
+ feedbackType?: string | null;
92
+ complainedAt: string;
93
+ }[];
94
+ loading: boolean;
95
+ error: import('@apollo/client').ApolloError | undefined;
96
+ refetch: (variables?: Partial<import('@apollo/client').OperationVariables> | undefined) => Promise<import('@apollo/client').ApolloQueryResult<GetCampaignComplaintsQuery>>;
97
+ };
98
+ //# sourceMappingURL=useAnalyticsOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnalyticsOperations.d.ts","sourceRoot":"","sources":["../../../src/newsletter/hooks/useAnalyticsOperations.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,mCAAmC,CAAC;AAM3C,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;EAahD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM;;;;;;;;;EAgBnD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,UAAU,EACvB,KAAK,SAAK,EACV,MAAM,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;EAiBhB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,MAAM,CAAC,EAAE,MAAM;;;;;;;;;;;;;;EAgBpF"}
@@ -0,0 +1,33 @@
1
+ import { GetBounceStatsDocument as e, GetComplaintStatsDocument as t } from "../../generated/global-operations.js";
2
+ import { useQuery as n } from "@apollo/client/react";
3
+ //#region src/newsletter/hooks/useAnalyticsOperations.ts
4
+ function r(t) {
5
+ let { data: r, loading: i, error: a, refetch: o } = n(e, {
6
+ variables: { campaignId: t },
7
+ skip: !t,
8
+ fetchPolicy: "cache-and-network"
9
+ });
10
+ return {
11
+ bounceStats: r?.bounceStats ?? null,
12
+ loading: i,
13
+ error: a,
14
+ refetch: o
15
+ };
16
+ }
17
+ function i(e) {
18
+ let { data: r, loading: i, error: a, refetch: o } = n(t, {
19
+ variables: { campaignId: e },
20
+ skip: !e,
21
+ fetchPolicy: "cache-and-network"
22
+ });
23
+ return {
24
+ complaintStats: r?.complaintStats ?? null,
25
+ loading: i,
26
+ error: a,
27
+ refetch: o
28
+ };
29
+ }
30
+ //#endregion
31
+ export { r as useBounceStats, i as useComplaintStats };
32
+
33
+ //# sourceMappingURL=useAnalyticsOperations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnalyticsOperations.js","names":[],"sources":["../../../src/newsletter/hooks/useAnalyticsOperations.ts"],"sourcesContent":["import { useQuery } from '@apollo/client/react';\n\nimport {\n GetBounceStatsDocument,\n GetComplaintStatsDocument,\n GetCampaignBouncesDocument,\n GetCampaignComplaintsDocument,\n} from '../../generated/global-operations';\n\nimport type {\n GetBounceStatsQuery,\n GetComplaintStatsQuery,\n GetCampaignBouncesQuery,\n GetCampaignComplaintsQuery,\n} from '../../generated/global-operations';\n\n// ================================\n// Types\n// ================================\n\nexport interface BounceStats {\n totalBounces: number;\n hardBounces: number;\n softBounces: number;\n bounceRate: number;\n}\n\nexport interface ComplaintStats {\n totalComplaints: number;\n complaintRate: number;\n}\n\nexport type BounceType = 'HARD' | 'SOFT' | 'COMPLAINT';\n\nexport interface NewsletterBounce {\n id: string;\n campaignId: string;\n subscriberId: string;\n email: string;\n bounceType: BounceType;\n reason?: string;\n diagnosticCode?: string;\n bouncedAt: string;\n}\n\nexport interface NewsletterComplaint {\n id: string;\n campaignId: string;\n subscriberId: string;\n email: string;\n complaintType?: string;\n feedbackType?: string;\n complainedAt: string;\n}\n\n// ================================\n// Hooks\n// ================================\n\n/**\n * Hook for getting bounce statistics for a campaign\n */\nexport function useBounceStats(campaignId: string) {\n const { data, loading, error, refetch } = useQuery<GetBounceStatsQuery>(GetBounceStatsDocument, {\n variables: { campaignId },\n skip: !campaignId,\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n bounceStats: data?.bounceStats ?? null,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Hook for getting complaint statistics for a campaign\n */\nexport function useComplaintStats(campaignId: string) {\n const { data, loading, error, refetch } = useQuery<GetComplaintStatsQuery>(\n GetComplaintStatsDocument,\n {\n variables: { campaignId },\n skip: !campaignId,\n fetchPolicy: 'cache-and-network',\n }\n );\n\n return {\n complaintStats: data?.complaintStats ?? null,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Hook for listing campaign bounces\n */\nexport function useCampaignBounces(\n campaignId: string,\n bounceType?: BounceType,\n limit = 50,\n offset?: number\n) {\n const { data, loading, error, refetch } = useQuery<GetCampaignBouncesQuery>(\n GetCampaignBouncesDocument,\n {\n variables: { campaignId, bounceType, limit, offset },\n skip: !campaignId,\n fetchPolicy: 'cache-and-network',\n }\n );\n\n return {\n bounces: data?.campaignBounces ?? [],\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Hook for listing campaign complaints\n */\nexport function useCampaignComplaints(campaignId: string, limit = 50, offset?: number) {\n const { data, loading, error, refetch } = useQuery<GetCampaignComplaintsQuery>(\n GetCampaignComplaintsDocument,\n {\n variables: { campaignId, limit, offset },\n skip: !campaignId,\n fetchPolicy: 'cache-and-network',\n }\n );\n\n return {\n complaints: data?.campaignComplaints ?? [],\n loading,\n error,\n refetch,\n };\n}\n"],"mappings":";;;AA8DA,SAAgB,EAAe,GAAoB;CACjD,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA8B,GAAwB;EAC9F,WAAW,EAAE,eAAY;EACzB,MAAM,CAAC;EACP,aAAa;EACd,CAAC;AAEF,QAAO;EACL,aAAa,GAAM,eAAe;EAClC;EACA;EACA;EACD;;AAMH,SAAgB,EAAkB,GAAoB;CACpD,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EACxC,GACA;EACE,WAAW,EAAE,eAAY;EACzB,MAAM,CAAC;EACP,aAAa;EACd,CACF;AAED,QAAO;EACL,gBAAgB,GAAM,kBAAkB;EACxC;EACA;EACA;EACD"}