@dextinity/brevo-admin 2.0.0-canary-20260729062014

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/LICENSE +24 -0
  2. package/lib/blocks/NewsletterImageBlock.d.ts +8 -0
  3. package/lib/blocks/NewsletterImageBlock.d.ts.map +1 -0
  4. package/lib/blocks/NewsletterImageBlock.js +20 -0
  5. package/lib/blocks.generated.d.ts +206 -0
  6. package/lib/blocks.generated.d.ts.map +1 -0
  7. package/lib/blocks.generated.js +1 -0
  8. package/lib/brevoConfiguration/BrevoConfigForm.d.ts +8 -0
  9. package/lib/brevoConfiguration/BrevoConfigForm.d.ts.map +1 -0
  10. package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts +12 -0
  11. package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts.map +1 -0
  12. package/lib/brevoConfiguration/BrevoConfigForm.generated.js +1 -0
  13. package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts +6 -0
  14. package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts.map +1 -0
  15. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts +102 -0
  16. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts.map +1 -0
  17. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.js +14 -0
  18. package/lib/brevoConfiguration/BrevoConfigForm.gql.js +9 -0
  19. package/lib/brevoConfiguration/BrevoConfigForm.js +351 -0
  20. package/lib/brevoConfiguration/BrevoConfigPage.d.ts +3 -0
  21. package/lib/brevoConfiguration/BrevoConfigPage.d.ts.map +1 -0
  22. package/lib/brevoConfiguration/BrevoConfigPage.js +17 -0
  23. package/lib/brevoContacts/BrevoContactsGrid.d.ts +13 -0
  24. package/lib/brevoContacts/BrevoContactsGrid.d.ts.map +1 -0
  25. package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts +65 -0
  26. package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts.map +1 -0
  27. package/lib/brevoContacts/BrevoContactsGrid.generated.js +12 -0
  28. package/lib/brevoContacts/BrevoContactsGrid.js +238 -0
  29. package/lib/brevoContacts/BrevoContactsPage.d.ts +16 -0
  30. package/lib/brevoContacts/BrevoContactsPage.d.ts.map +1 -0
  31. package/lib/brevoContacts/BrevoContactsPage.js +77 -0
  32. package/lib/brevoContacts/form/BrevoContactForm.d.ts +19 -0
  33. package/lib/brevoContacts/form/BrevoContactForm.d.ts.map +1 -0
  34. package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts +10 -0
  35. package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts.map +1 -0
  36. package/lib/brevoContacts/form/BrevoContactForm.generated.js +5 -0
  37. package/lib/brevoContacts/form/BrevoContactForm.gql.d.ts +6 -0
  38. package/lib/brevoContacts/form/BrevoContactForm.gql.d.ts.map +1 -0
  39. package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts +58 -0
  40. package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts.map +1 -0
  41. package/lib/brevoContacts/form/BrevoContactForm.gql.generated.js +10 -0
  42. package/lib/brevoContacts/form/BrevoContactForm.gql.js +11 -0
  43. package/lib/brevoContacts/form/BrevoContactForm.js +346 -0
  44. package/lib/brevoTestContacts/BrevoTestContactsGrid.d.ts +13 -0
  45. package/lib/brevoTestContacts/BrevoTestContactsGrid.d.ts.map +1 -0
  46. package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.d.ts +52 -0
  47. package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.d.ts.map +1 -0
  48. package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.js +11 -0
  49. package/lib/brevoTestContacts/BrevoTestContactsGrid.js +205 -0
  50. package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts +18 -0
  51. package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts.map +1 -0
  52. package/lib/brevoTestContacts/BrevoTestContactsPage.js +78 -0
  53. package/lib/brevoTestContacts/form/BrevoTestContactForm.d.ts +19 -0
  54. package/lib/brevoTestContacts/form/BrevoTestContactForm.d.ts.map +1 -0
  55. package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.d.ts +13 -0
  56. package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.d.ts.map +1 -0
  57. package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.js +5 -0
  58. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.d.ts +6 -0
  59. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.d.ts.map +1 -0
  60. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.d.ts +64 -0
  61. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.d.ts.map +1 -0
  62. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.js +10 -0
  63. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.js +11 -0
  64. package/lib/brevoTestContacts/form/BrevoTestContactForm.js +266 -0
  65. package/lib/common/BrevoConfigProvider.d.ts +21 -0
  66. package/lib/common/BrevoConfigProvider.d.ts.map +1 -0
  67. package/lib/common/BrevoConfigProvider.js +33 -0
  68. package/lib/common/contactImport/useContactImportFromCsv.d.ts +18 -0
  69. package/lib/common/contactImport/useContactImportFromCsv.d.ts.map +1 -0
  70. package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts +2 -0
  71. package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts.map +1 -0
  72. package/lib/common/contactImport/useContactImportFromCsv.gql.generated.d.ts +26 -0
  73. package/lib/common/contactImport/useContactImportFromCsv.gql.generated.d.ts.map +1 -0
  74. package/lib/common/contactImport/useContactImportFromCsv.gql.generated.js +5 -0
  75. package/lib/common/contactImport/useContactImportFromCsv.gql.js +4 -0
  76. package/lib/common/contactImport/useContactImportFromCsv.js +462 -0
  77. package/lib/configVerification/ConfigVerification.d.ts +8 -0
  78. package/lib/configVerification/ConfigVerification.d.ts.map +1 -0
  79. package/lib/configVerification/ConfigVerification.gql.d.ts +2 -0
  80. package/lib/configVerification/ConfigVerification.gql.d.ts.map +1 -0
  81. package/lib/configVerification/ConfigVerification.gql.generated.d.ts +17 -0
  82. package/lib/configVerification/ConfigVerification.gql.generated.d.ts.map +1 -0
  83. package/lib/configVerification/ConfigVerification.gql.generated.js +5 -0
  84. package/lib/configVerification/ConfigVerification.gql.js +4 -0
  85. package/lib/configVerification/ConfigVerification.js +41 -0
  86. package/lib/dataGrid/DataGrid.d.ts +3 -0
  87. package/lib/dataGrid/DataGrid.d.ts.map +1 -0
  88. package/lib/dataGrid/DataGrid.js +19 -0
  89. package/lib/emailCampaigns/EmailCampaignsGrid.d.ts +7 -0
  90. package/lib/emailCampaigns/EmailCampaignsGrid.d.ts.map +1 -0
  91. package/lib/emailCampaigns/EmailCampaignsGrid.generated.d.ts +81 -0
  92. package/lib/emailCampaigns/EmailCampaignsGrid.generated.d.ts.map +1 -0
  93. package/lib/emailCampaigns/EmailCampaignsGrid.generated.js +12 -0
  94. package/lib/emailCampaigns/EmailCampaignsGrid.js +281 -0
  95. package/lib/emailCampaigns/EmailCampaignsPage.d.ts +8 -0
  96. package/lib/emailCampaigns/EmailCampaignsPage.d.ts.map +1 -0
  97. package/lib/emailCampaigns/EmailCampaignsPage.js +85 -0
  98. package/lib/emailCampaigns/SendingStateColumn.d.ts +7 -0
  99. package/lib/emailCampaigns/SendingStateColumn.d.ts.map +1 -0
  100. package/lib/emailCampaigns/SendingStateColumn.js +104 -0
  101. package/lib/emailCampaigns/form/ConfigFields.d.ts +2 -0
  102. package/lib/emailCampaigns/form/ConfigFields.d.ts.map +1 -0
  103. package/lib/emailCampaigns/form/ConfigFields.js +26 -0
  104. package/lib/emailCampaigns/form/EmailCampaignForm.d.ts +9 -0
  105. package/lib/emailCampaigns/form/EmailCampaignForm.d.ts.map +1 -0
  106. package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts +4 -0
  107. package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts.map +1 -0
  108. package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.d.ts +93 -0
  109. package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.d.ts.map +1 -0
  110. package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.js +12 -0
  111. package/lib/emailCampaigns/form/EmailCampaignForm.gql.js +7 -0
  112. package/lib/emailCampaigns/form/EmailCampaignForm.js +418 -0
  113. package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.d.ts +8 -0
  114. package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.d.ts.map +1 -0
  115. package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.js +35 -0
  116. package/lib/emailCampaigns/form/SendManagerFields.d.ts +10 -0
  117. package/lib/emailCampaigns/form/SendManagerFields.d.ts.map +1 -0
  118. package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts +3 -0
  119. package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts.map +1 -0
  120. package/lib/emailCampaigns/form/SendManagerFields.gql.generated.d.ts +39 -0
  121. package/lib/emailCampaigns/form/SendManagerFields.gql.generated.d.ts.map +1 -0
  122. package/lib/emailCampaigns/form/SendManagerFields.gql.generated.js +11 -0
  123. package/lib/emailCampaigns/form/SendManagerFields.gql.js +6 -0
  124. package/lib/emailCampaigns/form/SendManagerFields.js +171 -0
  125. package/lib/emailCampaigns/form/SendManagerWrapper.d.ts +8 -0
  126. package/lib/emailCampaigns/form/SendManagerWrapper.d.ts.map +1 -0
  127. package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts +2 -0
  128. package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts.map +1 -0
  129. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts +14 -0
  130. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts.map +1 -0
  131. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.js +5 -0
  132. package/lib/emailCampaigns/form/SendManagerWrapper.gql.js +4 -0
  133. package/lib/emailCampaigns/form/SendManagerWrapper.js +39 -0
  134. package/lib/emailCampaigns/form/TestEmailCampaignForm.d.ts +10 -0
  135. package/lib/emailCampaigns/form/TestEmailCampaignForm.d.ts.map +1 -0
  136. package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.d.ts +33 -0
  137. package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.d.ts.map +1 -0
  138. package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.js +8 -0
  139. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts +2 -0
  140. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts.map +1 -0
  141. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.d.ts +15 -0
  142. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.d.ts.map +1 -0
  143. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.js +5 -0
  144. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.js +4 -0
  145. package/lib/emailCampaigns/form/TestEmailCampaignForm.js +146 -0
  146. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.d.ts +7 -0
  147. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.d.ts.map +1 -0
  148. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts +2 -0
  149. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts.map +1 -0
  150. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.d.ts +23 -0
  151. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.d.ts.map +1 -0
  152. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.js +5 -0
  153. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.js +4 -0
  154. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.js +133 -0
  155. package/lib/emailCampaigns/statistics/PercentageCard.d.ts +10 -0
  156. package/lib/emailCampaigns/statistics/PercentageCard.d.ts.map +1 -0
  157. package/lib/emailCampaigns/statistics/PercentageCard.js +145 -0
  158. package/lib/emailCampaigns/view/EmailCampaignView.d.ts +8 -0
  159. package/lib/emailCampaigns/view/EmailCampaignView.d.ts.map +1 -0
  160. package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts +2 -0
  161. package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts.map +1 -0
  162. package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.d.ts +18 -0
  163. package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.d.ts.map +1 -0
  164. package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.js +5 -0
  165. package/lib/emailCampaigns/view/EmailCampaignView.gql.js +4 -0
  166. package/lib/emailCampaigns/view/EmailCampaignView.js +81 -0
  167. package/lib/graphql.generated.d.ts +596 -0
  168. package/lib/graphql.generated.d.ts.map +1 -0
  169. package/lib/graphql.generated.js +1 -0
  170. package/lib/index.d.ts +10 -0
  171. package/lib/index.d.ts.map +1 -0
  172. package/lib/index.js +7 -0
  173. package/lib/targetGroups/TargetGroupDialog.d.ts +8 -0
  174. package/lib/targetGroups/TargetGroupDialog.d.ts.map +1 -0
  175. package/lib/targetGroups/TargetGroupDialog.gql.d.ts +2 -0
  176. package/lib/targetGroups/TargetGroupDialog.gql.d.ts.map +1 -0
  177. package/lib/targetGroups/TargetGroupDialog.gql.generated.d.ts +18 -0
  178. package/lib/targetGroups/TargetGroupDialog.gql.generated.d.ts.map +1 -0
  179. package/lib/targetGroups/TargetGroupDialog.gql.generated.js +5 -0
  180. package/lib/targetGroups/TargetGroupDialog.gql.js +4 -0
  181. package/lib/targetGroups/TargetGroupDialog.js +72 -0
  182. package/lib/targetGroups/TargetGroupForm.d.ts +20 -0
  183. package/lib/targetGroups/TargetGroupForm.d.ts.map +1 -0
  184. package/lib/targetGroups/TargetGroupForm.gql.d.ts +4 -0
  185. package/lib/targetGroups/TargetGroupForm.gql.d.ts.map +1 -0
  186. package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts +37 -0
  187. package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts.map +1 -0
  188. package/lib/targetGroups/TargetGroupForm.gql.generated.js +8 -0
  189. package/lib/targetGroups/TargetGroupForm.gql.js +9 -0
  190. package/lib/targetGroups/TargetGroupForm.js +219 -0
  191. package/lib/targetGroups/TargetGroupsGrid.d.ts +18 -0
  192. package/lib/targetGroups/TargetGroupsGrid.d.ts.map +1 -0
  193. package/lib/targetGroups/TargetGroupsGrid.generated.d.ts +90 -0
  194. package/lib/targetGroups/TargetGroupsGrid.generated.d.ts.map +1 -0
  195. package/lib/targetGroups/TargetGroupsGrid.generated.js +14 -0
  196. package/lib/targetGroups/TargetGroupsGrid.js +280 -0
  197. package/lib/targetGroups/TargetGroupsPage.d.ts +26 -0
  198. package/lib/targetGroups/TargetGroupsPage.d.ts.map +1 -0
  199. package/lib/targetGroups/TargetGroupsPage.js +63 -0
  200. package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts +10 -0
  201. package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts.map +1 -0
  202. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts +5 -0
  203. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts.map +1 -0
  204. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts +84 -0
  205. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts.map +1 -0
  206. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.js +13 -0
  207. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.js +8 -0
  208. package/lib/targetGroups/addContacts/AddContactsGridSelect.js +346 -0
  209. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts +10 -0
  210. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts.map +1 -0
  211. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts +2 -0
  212. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts.map +1 -0
  213. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.d.ts +42 -0
  214. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.d.ts.map +1 -0
  215. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.js +8 -0
  216. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.js +5 -0
  217. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.js +112 -0
  218. package/package.json +109 -0
@@ -0,0 +1,346 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
3
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
4
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
5
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
6
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
16
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
17
+ import { useMutation, useQuery } from "@apollo/client";
18
+ import { Button, CancelButton, CrudMoreActionsMenu, DataGridToolbar, Dialog, Field, FinalForm, GridToolbarQuickFilter, ToolbarFillSpace, ToolbarItem, ToolbarTitleItem, useBufferedRowCount, useDataGridRemote, usePersistentColumnState } from "@dextinity/admin";
19
+ import { Add, Close, Remove, Save } from "@dextinity/admin-icons";
20
+ import { DialogActions, DialogTitle, IconButton, useTheme } from "@mui/material";
21
+ import { Box } from "@mui/system";
22
+ import { useState } from "react";
23
+ import { FormattedMessage, useIntl } from "react-intl";
24
+ import { MemoryRouter } from "react-router";
25
+ import { useContactImportFromCsv } from "../../common/contactImport/useContactImportFromCsv";
26
+ import { DataGrid } from "../../dataGrid/DataGrid";
27
+ import { targetGroupFormNamedOperations } from "../TargetGroupForm";
28
+ import { addBrevoContactsToTargetGroupMutation, brevoContactsQuery, manuallyAssignedBrevoContactsGridQuery, removeBrevoContactFromTargetGroupMutation } from "./AddContactsGridSelect.gql";
29
+ import { namedOperations } from "./AddContactsGridSelect.gql.generated";
30
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
31
+ var AssignedContactsGridToolbar = function AssignedContactsGridToolbar(_ref) {
32
+ var onOpenDialog = _ref.onOpenDialog,
33
+ scope = _ref.scope,
34
+ targetGroupId = _ref.targetGroupId,
35
+ sendDoubleOptIn = _ref.sendDoubleOptIn;
36
+ var intl = useIntl();
37
+ var _useContactImportFrom = useContactImportFromCsv({
38
+ scope: scope,
39
+ targetGroupId: targetGroupId,
40
+ sendDoubleOptIn: sendDoubleOptIn,
41
+ refetchQueries: [namedOperations.Query.ManuallyAssignedBrevoContactsGrid]
42
+ }),
43
+ _useContactImportFrom2 = _slicedToArray(_useContactImportFrom, 2),
44
+ moreActionsMenuItem = _useContactImportFrom2[0],
45
+ component = _useContactImportFrom2[1];
46
+ return /*#__PURE__*/_jsxs(_Fragment, {
47
+ children: [/*#__PURE__*/_jsxs(DataGridToolbar, {
48
+ children: [/*#__PURE__*/_jsx(ToolbarTitleItem, {
49
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
50
+ id: "cometBrevoModule.targetGroup.manuallyAssignedContacts.title",
51
+ defaultMessage: "Manually assigned contacts"
52
+ })
53
+ }), /*#__PURE__*/_jsx(GridToolbarQuickFilter, {
54
+ placeholder: intl.formatMessage({
55
+ id: "cometBrevoModule.targetGroup.assignedContacts.searchEmail",
56
+ defaultMessage: "Search email address"
57
+ })
58
+ }), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(CrudMoreActionsMenu, {
59
+ overallActions: [moreActionsMenuItem]
60
+ }), /*#__PURE__*/_jsx(Button, {
61
+ startIcon: /*#__PURE__*/_jsx(Add, {}),
62
+ variant: "primary",
63
+ onClick: onOpenDialog,
64
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
65
+ id: "cometBrevoModule.targetGroup.assignedContacts.addContact",
66
+ defaultMessage: "Add contacts"
67
+ })
68
+ })]
69
+ }), component]
70
+ });
71
+ };
72
+ var AssignableContactsGridToolbar = function AssignableContactsGridToolbar() {
73
+ var intl = useIntl();
74
+ return /*#__PURE__*/_jsxs(DataGridToolbar, {
75
+ children: [/*#__PURE__*/_jsx(ToolbarTitleItem, {
76
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
77
+ id: "cometBrevoModule.targetGroup.assignableContacts.title",
78
+ defaultMessage: "Assignable contacts"
79
+ })
80
+ }), /*#__PURE__*/_jsx(ToolbarItem, {
81
+ children: /*#__PURE__*/_jsx(GridToolbarQuickFilter, {
82
+ placeholder: intl.formatMessage({
83
+ id: "cometBrevoModule.targetGroup.assignableContacts.searchEmail",
84
+ defaultMessage: "Search email address"
85
+ })
86
+ })
87
+ })]
88
+ });
89
+ };
90
+ var useSubmitMutation = function useSubmitMutation(id) {
91
+ var _useMutation = useMutation(addBrevoContactsToTargetGroupMutation, {
92
+ refetchQueries: [namedOperations.Query.ManuallyAssignedBrevoContactsGrid, targetGroupFormNamedOperations.Query.TargetGroupForm]
93
+ }),
94
+ _useMutation2 = _slicedToArray(_useMutation, 1),
95
+ addContactsToTargetGroup = _useMutation2[0];
96
+ return function (_ref2) {
97
+ var brevoContactIds = _ref2.brevoContactIds;
98
+ return addContactsToTargetGroup({
99
+ variables: {
100
+ id: id,
101
+ input: {
102
+ brevoContactIds: brevoContactIds
103
+ }
104
+ }
105
+ });
106
+ };
107
+ };
108
+ export function AddContactsGridSelect(_ref3) {
109
+ var _dataGridAssignableCo, _dataGridAssignableCo2, _dataGridAssignedCont, _dataGridAssignedCont2, _assignedContactsData;
110
+ var id = _ref3.id,
111
+ scope = _ref3.scope,
112
+ assignedContactsTargetGroupBrevoId = _ref3.assignedContactsTargetGroupBrevoId;
113
+ var intl = useIntl();
114
+ var submit = useSubmitMutation(id);
115
+ var theme = useTheme();
116
+ var dataGridAssignedContactsProps = _objectSpread(_objectSpread({}, useDataGridRemote()), usePersistentColumnState("TargetGroupAssignedBrevoContactsGrid"));
117
+ var dataGridAssignableContactsProps = _objectSpread(_objectSpread({}, useDataGridRemote()), usePersistentColumnState("TargetGroupAssignableBrevoContactsGrid"));
118
+ var _useState = useState(false),
119
+ _useState2 = _slicedToArray(_useState, 2),
120
+ isDialogOpen = _useState2[0],
121
+ setIsDialogOpen = _useState2[1];
122
+ var _useMutation3 = useMutation(removeBrevoContactFromTargetGroupMutation, {
123
+ refetchQueries: [namedOperations.Query.ManuallyAssignedBrevoContactsGrid],
124
+ awaitRefetchQueries: true
125
+ }),
126
+ _useMutation4 = _slicedToArray(_useMutation3, 2),
127
+ removeContacts = _useMutation4[0],
128
+ removeLoading = _useMutation4[1].loading;
129
+ var onDeleteClick = function onDeleteClick(contactId) {
130
+ if (!id) {
131
+ return;
132
+ }
133
+ removeContacts({
134
+ variables: {
135
+ id: id,
136
+ input: {
137
+ brevoContactId: contactId
138
+ }
139
+ }
140
+ });
141
+ };
142
+ var _useQuery = useQuery(brevoContactsQuery, {
143
+ variables: {
144
+ offset: dataGridAssignableContactsProps.paginationModel.page * dataGridAssignableContactsProps.paginationModel.pageSize,
145
+ limit: dataGridAssignableContactsProps.paginationModel.pageSize,
146
+ email: (_dataGridAssignableCo = dataGridAssignableContactsProps.filterModel) !== null && _dataGridAssignableCo !== void 0 && _dataGridAssignableCo.quickFilterValues ? (_dataGridAssignableCo2 = dataGridAssignableContactsProps.filterModel) === null || _dataGridAssignableCo2 === void 0 ? void 0 : _dataGridAssignableCo2.quickFilterValues[0] : undefined,
147
+ scope: scope
148
+ }
149
+ }),
150
+ assignableContactsData = _useQuery.data,
151
+ assignableContactsLoading = _useQuery.loading,
152
+ assignableContactsError = _useQuery.error;
153
+ var _useQuery2 = useQuery(manuallyAssignedBrevoContactsGridQuery, {
154
+ variables: {
155
+ offset: dataGridAssignedContactsProps.paginationModel.page * dataGridAssignedContactsProps.paginationModel.pageSize,
156
+ limit: dataGridAssignedContactsProps.paginationModel.pageSize,
157
+ email: (_dataGridAssignedCont = dataGridAssignedContactsProps.filterModel) !== null && _dataGridAssignedCont !== void 0 && _dataGridAssignedCont.quickFilterValues ? (_dataGridAssignedCont2 = dataGridAssignedContactsProps.filterModel) === null || _dataGridAssignedCont2 === void 0 ? void 0 : _dataGridAssignedCont2.quickFilterValues[0] : undefined,
158
+ targetGroupId: id
159
+ },
160
+ skip: !assignedContactsTargetGroupBrevoId
161
+ }),
162
+ assignedContactsData = _useQuery2.data,
163
+ assignedContactsLoading = _useQuery2.loading,
164
+ assignedContactsError = _useQuery2.error;
165
+ var assignableContactsColumns = [{
166
+ field: "createdAt",
167
+ headerName: intl.formatMessage({
168
+ id: "cometBrevoModule.brevoContact.subscribedAt",
169
+ defaultMessage: "Subscribed At"
170
+ }),
171
+ filterable: false,
172
+ sortable: false,
173
+ width: 150,
174
+ renderCell: function renderCell(_ref4) {
175
+ var row = _ref4.row;
176
+ return intl.formatDate(new Date(row.createdAt));
177
+ }
178
+ }, {
179
+ field: "modifiedAt",
180
+ headerName: intl.formatMessage({
181
+ id: "cometBrevoModule.brevoContact.modifiedAt",
182
+ defaultMessage: "Modified At"
183
+ }),
184
+ filterable: false,
185
+ sortable: false,
186
+ width: 150,
187
+ renderCell: function renderCell(_ref5) {
188
+ var row = _ref5.row;
189
+ return intl.formatDate(new Date(row.modifiedAt));
190
+ }
191
+ }, {
192
+ field: "email",
193
+ headerName: intl.formatMessage({
194
+ id: "cometBrevoModule.brevoContact.email",
195
+ defaultMessage: "Email"
196
+ }),
197
+ filterable: false,
198
+ sortable: false,
199
+ width: 150,
200
+ flex: 1
201
+ }, {
202
+ field: "emailBlacklisted",
203
+ headerName: intl.formatMessage({
204
+ id: "cometBrevoModule.brevoContact.emailBlocked",
205
+ defaultMessage: "Email blocked"
206
+ }),
207
+ type: "boolean",
208
+ filterable: false,
209
+ sortable: false,
210
+ width: 150
211
+ }];
212
+ var assignedContactsColumns = assignableContactsColumns.concat([{
213
+ field: "actions",
214
+ width: 50,
215
+ disableColumnMenu: true,
216
+ resizable: false,
217
+ filterable: false,
218
+ sortable: false,
219
+ renderHeader: function renderHeader() {
220
+ return null;
221
+ },
222
+ renderCell: function renderCell(_ref6) {
223
+ var id = _ref6.id;
224
+ return /*#__PURE__*/_jsx(IconButton, {
225
+ onClick: function onClick() {
226
+ return onDeleteClick(Number(id));
227
+ },
228
+ disabled: removeLoading,
229
+ children: /*#__PURE__*/_jsx(Remove, {})
230
+ });
231
+ }
232
+ }]);
233
+ var assignedContactsRowCount = useBufferedRowCount(assignedContactsData === null || assignedContactsData === void 0 ? void 0 : assignedContactsData.manuallyAssignedBrevoContacts.totalCount);
234
+ var assignableContactsRowCount = useBufferedRowCount(assignableContactsData === null || assignableContactsData === void 0 ? void 0 : assignableContactsData.brevoContacts.totalCount);
235
+ if (assignedContactsError || assignableContactsError) {
236
+ throw assignedContactsError !== null && assignedContactsError !== void 0 ? assignedContactsError : assignableContactsError;
237
+ }
238
+ return /*#__PURE__*/_jsxs(_Fragment, {
239
+ children: [/*#__PURE__*/_jsx(DataGrid, _objectSpread(_objectSpread({}, dataGridAssignedContactsProps), {}, {
240
+ disableRowSelectionOnClick: true,
241
+ rows: (_assignedContactsData = assignedContactsData === null || assignedContactsData === void 0 ? void 0 : assignedContactsData.manuallyAssignedBrevoContacts.nodes) !== null && _assignedContactsData !== void 0 ? _assignedContactsData : [],
242
+ rowCount: assignedContactsRowCount,
243
+ columns: assignedContactsColumns,
244
+ autoHeight: true,
245
+ loading: assignedContactsLoading,
246
+ slots: {
247
+ toolbar: AssignedContactsGridToolbar
248
+ },
249
+ slotProps: {
250
+ toolbar: {
251
+ onOpenDialog: function onOpenDialog() {
252
+ return setIsDialogOpen(true);
253
+ },
254
+ scope: scope,
255
+ targetGroupId: id
256
+ }
257
+ },
258
+ showToolbar: true
259
+ })), /*#__PURE__*/_jsx(FinalForm, {
260
+ mode: "edit",
261
+ onSubmit: submit,
262
+ children: function children(_ref7) {
263
+ var handleSubmit = _ref7.handleSubmit,
264
+ submitting = _ref7.submitting;
265
+ return /*#__PURE__*/_jsx(MemoryRouter, {
266
+ children: /*#__PURE__*/_jsxs(Dialog, {
267
+ open: isDialogOpen,
268
+ maxWidth: "lg",
269
+ onClose: function onClose() {
270
+ return setIsDialogOpen(false);
271
+ },
272
+ children: [/*#__PURE__*/_jsxs(DialogTitle, {
273
+ display: "flex",
274
+ flexDirection: "row",
275
+ alignItems: "center",
276
+ justifyContent: "space-between",
277
+ children: [/*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(IconButton, {
278
+ onClick: function onClick() {
279
+ return setIsDialogOpen(false);
280
+ },
281
+ children: /*#__PURE__*/_jsx(Close, {
282
+ htmlColor: theme.palette.common.white
283
+ })
284
+ })]
285
+ }), /*#__PURE__*/_jsx(Box, {
286
+ children: /*#__PURE__*/_jsx(Field, {
287
+ name: "brevoContactIds",
288
+ fullWidth: true,
289
+ children: function children(props) {
290
+ var _assignableContactsDa;
291
+ return /*#__PURE__*/_jsx(DataGrid, _objectSpread(_objectSpread({}, dataGridAssignableContactsProps), {}, {
292
+ rows: (_assignableContactsDa = assignableContactsData === null || assignableContactsData === void 0 ? void 0 : assignableContactsData.brevoContacts.nodes) !== null && _assignableContactsDa !== void 0 ? _assignableContactsDa : [],
293
+ rowCount: assignableContactsRowCount,
294
+ columns: assignableContactsColumns,
295
+ autoHeight: true,
296
+ loading: assignableContactsLoading || submitting,
297
+ slots: {
298
+ toolbar: AssignableContactsGridToolbar
299
+ },
300
+ rowSelectionModel: {
301
+ type: "include",
302
+ ids: new Set(props.input.value)
303
+ },
304
+ onRowSelectionModelChange: function onRowSelectionModelChange(newSelectionModel) {
305
+ props.input.onChange(Array.from(newSelectionModel.ids));
306
+ },
307
+ disableRowSelectionExcludeModel: true,
308
+ checkboxSelection: true,
309
+ keepNonExistentRowsSelected: true,
310
+ showToolbar: true
311
+ }));
312
+ }
313
+ })
314
+ }), /*#__PURE__*/_jsxs(DialogActions, {
315
+ children: [/*#__PURE__*/_jsx(CancelButton, {
316
+ onClick: function onClick() {
317
+ return setIsDialogOpen(false);
318
+ }
319
+ }), /*#__PURE__*/_jsx(Button, {
320
+ startIcon: /*#__PURE__*/_jsx(Save, {}),
321
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
322
+ return _regenerator().w(function (_context) {
323
+ while (1) switch (_context.n) {
324
+ case 0:
325
+ _context.n = 1;
326
+ return handleSubmit();
327
+ case 1:
328
+ setIsDialogOpen(false);
329
+ case 2:
330
+ return _context.a(2);
331
+ }
332
+ }, _callee);
333
+ })),
334
+ variant: "primary",
335
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
336
+ id: "cometBrevoModule.targetGroup.addBrevoContacts.dialog.save",
337
+ defaultMessage: "Save"
338
+ })
339
+ })]
340
+ })]
341
+ })
342
+ });
343
+ }
344
+ })]
345
+ });
346
+ }
@@ -0,0 +1,10 @@
1
+ import type { ContentScope } from "@dextinity/cms-admin";
2
+ import type { ReactElement } from "react";
3
+ interface AllAssignedContactsGridProps {
4
+ scope: ContentScope;
5
+ id: string;
6
+ brevoId?: number;
7
+ }
8
+ export declare function AllAssignedContactsGrid({ id, scope, brevoId }: AllAssignedContactsGridProps): ReactElement;
9
+ export {};
10
+ //# sourceMappingURL=AllAssignedContactsGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllAssignedContactsGrid.d.ts","sourceRoot":"","sources":["../../../src/targetGroups/allAssignedContacts/AllAssignedContactsGrid.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AA6B1C,UAAU,4BAA4B;IAClC,KAAK,EAAE,YAAY,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,4BAA4B,GAAG,YAAY,CA6E1G"}
@@ -0,0 +1,2 @@
1
+ export declare const allAssignedBrevoContactsGridQuery: import("graphql").DocumentNode;
2
+ //# sourceMappingURL=AllAssignedContactsGrid.gql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllAssignedContactsGrid.gql.d.ts","sourceRoot":"","sources":["../../../src/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,iCAAiC,gCAU7C,CAAC"}
@@ -0,0 +1,42 @@
1
+ import * as Types from '../../graphql.generated';
2
+ export declare const namedOperations: {
3
+ Query: {
4
+ BrevoContacts: string;
5
+ };
6
+ Fragment: {
7
+ TargetGroupBrevoContactsList: string;
8
+ };
9
+ };
10
+ export type GQLTargetGroupBrevoContactsListFragment = {
11
+ __typename?: 'BrevoContact';
12
+ id: number;
13
+ createdAt: string;
14
+ modifiedAt: string;
15
+ email: string;
16
+ emailBlacklisted: boolean;
17
+ smsBlacklisted: boolean;
18
+ };
19
+ export type GQLBrevoContactsQueryVariables = Types.Exact<{
20
+ offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;
21
+ limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;
22
+ email?: Types.InputMaybe<Types.Scalars['String']['input']>;
23
+ targetGroupId: Types.Scalars['ID']['input'];
24
+ scope: Types.GQLEmailCampaignContentScopeInput;
25
+ }>;
26
+ export type GQLBrevoContactsQuery = {
27
+ __typename?: 'Query';
28
+ brevoContacts: {
29
+ __typename?: 'PaginatedBrevoContacts';
30
+ totalCount: number;
31
+ nodes: Array<{
32
+ __typename?: 'BrevoContact';
33
+ id: number;
34
+ createdAt: string;
35
+ modifiedAt: string;
36
+ email: string;
37
+ emailBlacklisted: boolean;
38
+ smsBlacklisted: boolean;
39
+ }>;
40
+ };
41
+ };
42
+ //# sourceMappingURL=AllAssignedContactsGrid.gql.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllAssignedContactsGrid.gql.generated.d.ts","sourceRoot":"","sources":["../../../src/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAC;AAEjD,eAAO,MAAM,eAAe;;;;;;;CAO3B,CAAA;AACD,MAAM,MAAM,uCAAuC,GAAG;IAAE,UAAU,CAAC,EAAE,cAAc,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5M,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAAC,KAAK,CAAC;IACvD,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IAC5C,KAAK,EAAE,KAAK,CAAC,iCAAiC,CAAC;CAChD,CAAC,CAAC;AAGH,MAAM,MAAM,qBAAqB,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE;QAAE,UAAU,CAAC,EAAE,wBAAwB,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;YAAE,UAAU,CAAC,EAAE,cAAc,CAAC;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,gBAAgB,EAAE,OAAO,CAAC;YAAC,cAAc,EAAE,OAAO,CAAA;SAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export var namedOperations = {
2
+ Query: {
3
+ BrevoContacts: 'BrevoContacts'
4
+ },
5
+ Fragment: {
6
+ TargetGroupBrevoContactsList: 'TargetGroupBrevoContactsList'
7
+ }
8
+ };
@@ -0,0 +1,5 @@
1
+ var _templateObject, _templateObject2;
2
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
3
+ import { gql } from "@apollo/client";
4
+ var targetGroupBrevoContactsFragment = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment TargetGroupBrevoContactsList on BrevoContact {\n id\n createdAt\n modifiedAt\n email\n emailBlacklisted\n smsBlacklisted\n }\n"])));
5
+ export var allAssignedBrevoContactsGridQuery = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query BrevoContacts($offset: Int, $limit: Int, $email: String, $targetGroupId: ID!, $scope: EmailCampaignContentScopeInput!) {\n brevoContacts(offset: $offset, limit: $limit, email: $email, targetGroupId: $targetGroupId, scope: $scope) {\n nodes {\n ...TargetGroupBrevoContactsList\n }\n totalCount\n }\n }\n ", "\n"])), targetGroupBrevoContactsFragment);
@@ -0,0 +1,112 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { useQuery } from "@apollo/client";
8
+ import { DataGridToolbar, GridToolbarQuickFilter, ToolbarTitleItem, useBufferedRowCount, useDataGridRemote, usePersistentColumnState } from "@dextinity/admin";
9
+ import { FormattedMessage, useIntl } from "react-intl";
10
+ import { DataGrid } from "../../dataGrid/DataGrid";
11
+ import { allAssignedBrevoContactsGridQuery } from "./AllAssignedContactsGrid.gql";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ var AssignedContactsGridToolbar = function AssignedContactsGridToolbar() {
14
+ var intl = useIntl();
15
+ return /*#__PURE__*/_jsxs(DataGridToolbar, {
16
+ children: [/*#__PURE__*/_jsx(ToolbarTitleItem, {
17
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
18
+ id: "cometBrevoModule.targetGroup.allAssignedContacts.title",
19
+ defaultMessage: "All assigned contacts"
20
+ })
21
+ }), /*#__PURE__*/_jsx(GridToolbarQuickFilter, {
22
+ placeholder: intl.formatMessage({
23
+ id: "cometBrevoModule.targetGroup.assignedContacts.searchEmail",
24
+ defaultMessage: "Search email address"
25
+ })
26
+ })]
27
+ });
28
+ };
29
+ export function AllAssignedContactsGrid(_ref) {
30
+ var _dataGridAllAssignedC, _dataGridAllAssignedC2, _allAssignedContactsD;
31
+ var id = _ref.id,
32
+ scope = _ref.scope,
33
+ brevoId = _ref.brevoId;
34
+ var intl = useIntl();
35
+ var dataGridAllAssignedContactsProps = _objectSpread(_objectSpread({}, useDataGridRemote()), usePersistentColumnState("TargetGroupAssignedBrevoContactsGrid"));
36
+ var _useQuery = useQuery(allAssignedBrevoContactsGridQuery, {
37
+ variables: {
38
+ offset: dataGridAllAssignedContactsProps.paginationModel.page * dataGridAllAssignedContactsProps.paginationModel.pageSize,
39
+ limit: dataGridAllAssignedContactsProps.paginationModel.pageSize,
40
+ email: (_dataGridAllAssignedC = dataGridAllAssignedContactsProps.filterModel) !== null && _dataGridAllAssignedC !== void 0 && _dataGridAllAssignedC.quickFilterValues ? (_dataGridAllAssignedC2 = dataGridAllAssignedContactsProps.filterModel) === null || _dataGridAllAssignedC2 === void 0 ? void 0 : _dataGridAllAssignedC2.quickFilterValues[0] : undefined,
41
+ targetGroupId: id,
42
+ scope: scope
43
+ },
44
+ skip: !brevoId
45
+ }),
46
+ allAssignedContactsData = _useQuery.data,
47
+ assignedContactsLoading = _useQuery.loading,
48
+ allAssignedContactsError = _useQuery.error;
49
+ var allAssignedContactsColumns = [{
50
+ field: "createdAt",
51
+ headerName: intl.formatMessage({
52
+ id: "cometBrevoModule.brevoContact.subscribedAt",
53
+ defaultMessage: "Subscribed At"
54
+ }),
55
+ filterable: false,
56
+ sortable: false,
57
+ width: 150,
58
+ renderCell: function renderCell(_ref2) {
59
+ var row = _ref2.row;
60
+ return intl.formatDate(new Date(row.createdAt));
61
+ }
62
+ }, {
63
+ field: "modifiedAt",
64
+ headerName: intl.formatMessage({
65
+ id: "cometBrevoModule.brevoContact.modifiedAt",
66
+ defaultMessage: "Modified At"
67
+ }),
68
+ filterable: false,
69
+ sortable: false,
70
+ width: 150,
71
+ renderCell: function renderCell(_ref3) {
72
+ var row = _ref3.row;
73
+ return intl.formatDate(new Date(row.modifiedAt));
74
+ }
75
+ }, {
76
+ field: "email",
77
+ headerName: intl.formatMessage({
78
+ id: "cometBrevoModule.brevoContact.email",
79
+ defaultMessage: "Email"
80
+ }),
81
+ filterable: false,
82
+ sortable: false,
83
+ width: 150,
84
+ flex: 1
85
+ }, {
86
+ field: "emailBlacklisted",
87
+ headerName: intl.formatMessage({
88
+ id: "cometBrevoModule.brevoContact.emailBlocked",
89
+ defaultMessage: "Email blocked"
90
+ }),
91
+ type: "boolean",
92
+ filterable: false,
93
+ sortable: false,
94
+ width: 150
95
+ }];
96
+ var allAssignedContactsRowCount = useBufferedRowCount(allAssignedContactsData === null || allAssignedContactsData === void 0 ? void 0 : allAssignedContactsData.brevoContacts.totalCount);
97
+ if (allAssignedContactsError) {
98
+ throw allAssignedContactsError;
99
+ }
100
+ return /*#__PURE__*/_jsx(DataGrid, _objectSpread(_objectSpread({}, dataGridAllAssignedContactsProps), {}, {
101
+ disableRowSelectionOnClick: true,
102
+ rows: (_allAssignedContactsD = allAssignedContactsData === null || allAssignedContactsData === void 0 ? void 0 : allAssignedContactsData.brevoContacts.nodes) !== null && _allAssignedContactsD !== void 0 ? _allAssignedContactsD : [],
103
+ rowCount: allAssignedContactsRowCount,
104
+ columns: allAssignedContactsColumns,
105
+ autoHeight: true,
106
+ loading: assignedContactsLoading,
107
+ slots: {
108
+ toolbar: AssignedContactsGridToolbar
109
+ },
110
+ showToolbar: true
111
+ }));
112
+ }