@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.
- package/LICENSE +24 -0
- package/lib/blocks/NewsletterImageBlock.d.ts +8 -0
- package/lib/blocks/NewsletterImageBlock.d.ts.map +1 -0
- package/lib/blocks/NewsletterImageBlock.js +20 -0
- package/lib/blocks.generated.d.ts +206 -0
- package/lib/blocks.generated.d.ts.map +1 -0
- package/lib/blocks.generated.js +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.d.ts +8 -0
- package/lib/brevoConfiguration/BrevoConfigForm.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts +12 -0
- package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.generated.js +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts +6 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts +102 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.js +14 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.js +9 -0
- package/lib/brevoConfiguration/BrevoConfigForm.js +351 -0
- package/lib/brevoConfiguration/BrevoConfigPage.d.ts +3 -0
- package/lib/brevoConfiguration/BrevoConfigPage.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigPage.js +17 -0
- package/lib/brevoContacts/BrevoContactsGrid.d.ts +13 -0
- package/lib/brevoContacts/BrevoContactsGrid.d.ts.map +1 -0
- package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts +65 -0
- package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts.map +1 -0
- package/lib/brevoContacts/BrevoContactsGrid.generated.js +12 -0
- package/lib/brevoContacts/BrevoContactsGrid.js +238 -0
- package/lib/brevoContacts/BrevoContactsPage.d.ts +16 -0
- package/lib/brevoContacts/BrevoContactsPage.d.ts.map +1 -0
- package/lib/brevoContacts/BrevoContactsPage.js +77 -0
- package/lib/brevoContacts/form/BrevoContactForm.d.ts +19 -0
- package/lib/brevoContacts/form/BrevoContactForm.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts +10 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.js +5 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.d.ts +6 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts +58 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.js +10 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.js +11 -0
- package/lib/brevoContacts/form/BrevoContactForm.js +346 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.d.ts +13 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.d.ts.map +1 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.d.ts +52 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.d.ts.map +1 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.js +11 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.js +205 -0
- package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts +18 -0
- package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts.map +1 -0
- package/lib/brevoTestContacts/BrevoTestContactsPage.js +78 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.d.ts +19 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.d.ts.map +1 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.d.ts +13 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.d.ts.map +1 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.js +5 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.d.ts +6 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.d.ts.map +1 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.d.ts +64 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.d.ts.map +1 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.js +10 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.js +11 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.js +266 -0
- package/lib/common/BrevoConfigProvider.d.ts +21 -0
- package/lib/common/BrevoConfigProvider.d.ts.map +1 -0
- package/lib/common/BrevoConfigProvider.js +33 -0
- package/lib/common/contactImport/useContactImportFromCsv.d.ts +18 -0
- package/lib/common/contactImport/useContactImportFromCsv.d.ts.map +1 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts +2 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts.map +1 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.generated.d.ts +26 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.generated.d.ts.map +1 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.generated.js +5 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.js +4 -0
- package/lib/common/contactImport/useContactImportFromCsv.js +462 -0
- package/lib/configVerification/ConfigVerification.d.ts +8 -0
- package/lib/configVerification/ConfigVerification.d.ts.map +1 -0
- package/lib/configVerification/ConfigVerification.gql.d.ts +2 -0
- package/lib/configVerification/ConfigVerification.gql.d.ts.map +1 -0
- package/lib/configVerification/ConfigVerification.gql.generated.d.ts +17 -0
- package/lib/configVerification/ConfigVerification.gql.generated.d.ts.map +1 -0
- package/lib/configVerification/ConfigVerification.gql.generated.js +5 -0
- package/lib/configVerification/ConfigVerification.gql.js +4 -0
- package/lib/configVerification/ConfigVerification.js +41 -0
- package/lib/dataGrid/DataGrid.d.ts +3 -0
- package/lib/dataGrid/DataGrid.d.ts.map +1 -0
- package/lib/dataGrid/DataGrid.js +19 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.d.ts +7 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.d.ts.map +1 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.generated.d.ts +81 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.generated.js +12 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.js +281 -0
- package/lib/emailCampaigns/EmailCampaignsPage.d.ts +8 -0
- package/lib/emailCampaigns/EmailCampaignsPage.d.ts.map +1 -0
- package/lib/emailCampaigns/EmailCampaignsPage.js +85 -0
- package/lib/emailCampaigns/SendingStateColumn.d.ts +7 -0
- package/lib/emailCampaigns/SendingStateColumn.d.ts.map +1 -0
- package/lib/emailCampaigns/SendingStateColumn.js +104 -0
- package/lib/emailCampaigns/form/ConfigFields.d.ts +2 -0
- package/lib/emailCampaigns/form/ConfigFields.d.ts.map +1 -0
- package/lib/emailCampaigns/form/ConfigFields.js +26 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.d.ts +9 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.d.ts.map +1 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts +4 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.d.ts +93 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.js +12 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.js +7 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.js +418 -0
- package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.d.ts +8 -0
- package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.js +35 -0
- package/lib/emailCampaigns/form/SendManagerFields.d.ts +10 -0
- package/lib/emailCampaigns/form/SendManagerFields.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts +3 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.generated.d.ts +39 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.generated.js +11 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.js +6 -0
- package/lib/emailCampaigns/form/SendManagerFields.js +171 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.d.ts +8 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts +2 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts +14 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.js +5 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.js +4 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.js +39 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.d.ts +10 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.d.ts.map +1 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.d.ts +33 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.js +8 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts +2 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.d.ts +15 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.js +5 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.js +4 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.js +146 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.d.ts +7 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.d.ts.map +1 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts +2 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.d.ts +23 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.js +5 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.js +4 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.js +133 -0
- package/lib/emailCampaigns/statistics/PercentageCard.d.ts +10 -0
- package/lib/emailCampaigns/statistics/PercentageCard.d.ts.map +1 -0
- package/lib/emailCampaigns/statistics/PercentageCard.js +145 -0
- package/lib/emailCampaigns/view/EmailCampaignView.d.ts +8 -0
- package/lib/emailCampaigns/view/EmailCampaignView.d.ts.map +1 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts +2 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.d.ts +18 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.js +5 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.js +4 -0
- package/lib/emailCampaigns/view/EmailCampaignView.js +81 -0
- package/lib/graphql.generated.d.ts +596 -0
- package/lib/graphql.generated.d.ts.map +1 -0
- package/lib/graphql.generated.js +1 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/targetGroups/TargetGroupDialog.d.ts +8 -0
- package/lib/targetGroups/TargetGroupDialog.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupDialog.gql.d.ts +2 -0
- package/lib/targetGroups/TargetGroupDialog.gql.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupDialog.gql.generated.d.ts +18 -0
- package/lib/targetGroups/TargetGroupDialog.gql.generated.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupDialog.gql.generated.js +5 -0
- package/lib/targetGroups/TargetGroupDialog.gql.js +4 -0
- package/lib/targetGroups/TargetGroupDialog.js +72 -0
- package/lib/targetGroups/TargetGroupForm.d.ts +20 -0
- package/lib/targetGroups/TargetGroupForm.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupForm.gql.d.ts +4 -0
- package/lib/targetGroups/TargetGroupForm.gql.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts +37 -0
- package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupForm.gql.generated.js +8 -0
- package/lib/targetGroups/TargetGroupForm.gql.js +9 -0
- package/lib/targetGroups/TargetGroupForm.js +219 -0
- package/lib/targetGroups/TargetGroupsGrid.d.ts +18 -0
- package/lib/targetGroups/TargetGroupsGrid.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupsGrid.generated.d.ts +90 -0
- package/lib/targetGroups/TargetGroupsGrid.generated.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupsGrid.generated.js +14 -0
- package/lib/targetGroups/TargetGroupsGrid.js +280 -0
- package/lib/targetGroups/TargetGroupsPage.d.ts +26 -0
- package/lib/targetGroups/TargetGroupsPage.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupsPage.js +63 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts +10 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts.map +1 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts +5 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts.map +1 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts +84 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts.map +1 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.js +13 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.js +8 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.js +346 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts +10 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts.map +1 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts +2 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts.map +1 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.d.ts +42 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.d.ts.map +1 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.js +8 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.js +5 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.js +112 -0
- package/package.json +109 -0
|
@@ -0,0 +1,418 @@
|
|
|
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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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; } }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
+
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 }; })(); }
|
|
9
|
+
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); }
|
|
10
|
+
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); }
|
|
11
|
+
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); }); }; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
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); }
|
|
17
|
+
import { useApolloClient, useQuery } from "@apollo/client";
|
|
18
|
+
import { Field, Loading, MainContent, Toolbar, ToolbarActions, ToolbarFillSpace, ToolbarItem, ToolbarTitleItem, useFormApiRef, useStackApi, useStackSwitchApi } from "@dextinity/admin";
|
|
19
|
+
import { ArrowLeft } from "@dextinity/admin-icons";
|
|
20
|
+
import { BlockAdminComponentRoot, BlockAdminTabLabel, BlockPreviewWithTabs, BlocksFinalForm, ContentScopeIndicator, createFinalFormBlock, parallelAsyncEvery, queryUpdatedAt, resolveHasSaveConflict, useBlockContext, useBlockPreview, useEditState, useFormSaveConflict, useSaveState } from "@dextinity/cms-admin";
|
|
21
|
+
import { IconButton } from "@mui/material";
|
|
22
|
+
import { isBefore } from "date-fns";
|
|
23
|
+
import { useMemo } from "react";
|
|
24
|
+
import { FormattedMessage } from "react-intl";
|
|
25
|
+
import { useRouteMatch } from "react-router";
|
|
26
|
+
import { useBrevoConfig } from "../../common/BrevoConfigProvider";
|
|
27
|
+
import { ConfigFields } from "./ConfigFields";
|
|
28
|
+
import { createEmailCampaignMutation, emailCampaignFormQuery, updateEmailCampaignMutation } from "./EmailCampaignForm.gql";
|
|
29
|
+
import { SendManagerFields } from "./SendManagerFields";
|
|
30
|
+
import { SendManagerWrapper } from "./SendManagerWrapper";
|
|
31
|
+
import { TestEmailCampaignForm } from "./TestEmailCampaignForm";
|
|
32
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
33
|
+
export function EmailCampaignForm(_ref) {
|
|
34
|
+
var id = _ref.id,
|
|
35
|
+
EmailCampaignContentBlock = _ref.EmailCampaignContentBlock,
|
|
36
|
+
scope = _ref.scope;
|
|
37
|
+
var rootBlocks = {
|
|
38
|
+
content: EmailCampaignContentBlock
|
|
39
|
+
};
|
|
40
|
+
var _useBrevoConfig = useBrevoConfig(),
|
|
41
|
+
previewUrl = _useBrevoConfig.previewUrl;
|
|
42
|
+
var stackApi = useStackApi();
|
|
43
|
+
var stackSwitchApi = useStackSwitchApi();
|
|
44
|
+
var client = useApolloClient();
|
|
45
|
+
var mode = id ? "edit" : "add";
|
|
46
|
+
var previewApi = useBlockPreview();
|
|
47
|
+
var formApiRef = useFormApiRef();
|
|
48
|
+
var blockContext = useBlockContext();
|
|
49
|
+
var match = useRouteMatch();
|
|
50
|
+
var FinalFormEmailCampaignContentBlock = useMemo(function () {
|
|
51
|
+
return createFinalFormBlock(EmailCampaignContentBlock);
|
|
52
|
+
}, [EmailCampaignContentBlock]);
|
|
53
|
+
var _useQuery = useQuery(emailCampaignFormQuery, id ? {
|
|
54
|
+
variables: {
|
|
55
|
+
id: id
|
|
56
|
+
}
|
|
57
|
+
} : {
|
|
58
|
+
skip: true
|
|
59
|
+
}),
|
|
60
|
+
data = _useQuery.data,
|
|
61
|
+
error = _useQuery.error,
|
|
62
|
+
loading = _useQuery.loading,
|
|
63
|
+
refetch = _useQuery.refetch;
|
|
64
|
+
var _useEditState = useEditState({
|
|
65
|
+
query: emailCampaignFormQuery,
|
|
66
|
+
variables: id ? {
|
|
67
|
+
id: id
|
|
68
|
+
} : undefined,
|
|
69
|
+
mode: mode,
|
|
70
|
+
input2State: function input2State(_ref2) {
|
|
71
|
+
var brevoEmailCampaign = _ref2.brevoEmailCampaign;
|
|
72
|
+
return {
|
|
73
|
+
title: brevoEmailCampaign === null || brevoEmailCampaign === void 0 ? void 0 : brevoEmailCampaign.title,
|
|
74
|
+
subject: brevoEmailCampaign === null || brevoEmailCampaign === void 0 ? void 0 : brevoEmailCampaign.subject,
|
|
75
|
+
content: EmailCampaignContentBlock.input2State(brevoEmailCampaign.content),
|
|
76
|
+
scheduledAt: brevoEmailCampaign !== null && brevoEmailCampaign !== void 0 && brevoEmailCampaign.scheduledAt ? new Date(brevoEmailCampaign.scheduledAt) : null,
|
|
77
|
+
sendingState: brevoEmailCampaign === null || brevoEmailCampaign === void 0 ? void 0 : brevoEmailCampaign.sendingState,
|
|
78
|
+
brevoTargetGroups: brevoEmailCampaign === null || brevoEmailCampaign === void 0 ? void 0 : brevoEmailCampaign.brevoTargetGroups
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
state2Output: function state2Output(state) {
|
|
82
|
+
var _state$scheduledAt;
|
|
83
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
84
|
+
content: EmailCampaignContentBlock.state2Output(state.content),
|
|
85
|
+
scheduledAt: state.brevoTargetGroups.length > 0 ? (_state$scheduledAt = state.scheduledAt) !== null && _state$scheduledAt !== void 0 ? _state$scheduledAt : null : null,
|
|
86
|
+
sendingState: undefined,
|
|
87
|
+
brevoTargetGroups: state.brevoTargetGroups.map(function (brevoTargetGroup) {
|
|
88
|
+
return brevoTargetGroup.id;
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
defaultState: {
|
|
93
|
+
title: "",
|
|
94
|
+
subject: "",
|
|
95
|
+
content: EmailCampaignContentBlock.defaultValues(),
|
|
96
|
+
sendingState: "DRAFT",
|
|
97
|
+
scheduledAt: undefined,
|
|
98
|
+
brevoTargetGroups: []
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
state = _useEditState.state,
|
|
102
|
+
setState = _useEditState.setState,
|
|
103
|
+
hasChanges = _useEditState.hasChanges,
|
|
104
|
+
output = _useEditState.output,
|
|
105
|
+
query = _useEditState.query,
|
|
106
|
+
updateReferenceContent = _useEditState.updateReferenceContent;
|
|
107
|
+
var saveConflict = useFormSaveConflict({
|
|
108
|
+
checkConflict: function () {
|
|
109
|
+
var _checkConflict = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
110
|
+
var updatedAt;
|
|
111
|
+
return _regenerator().w(function (_context) {
|
|
112
|
+
while (1) switch (_context.n) {
|
|
113
|
+
case 0:
|
|
114
|
+
_context.n = 1;
|
|
115
|
+
return queryUpdatedAt(client, "brevoEmailCampaign", id);
|
|
116
|
+
case 1:
|
|
117
|
+
updatedAt = _context.v;
|
|
118
|
+
return _context.a(2, resolveHasSaveConflict(data === null || data === void 0 ? void 0 : data.brevoEmailCampaign.updatedAt, updatedAt));
|
|
119
|
+
}
|
|
120
|
+
}, _callee);
|
|
121
|
+
}));
|
|
122
|
+
function checkConflict() {
|
|
123
|
+
return _checkConflict.apply(this, arguments);
|
|
124
|
+
}
|
|
125
|
+
return checkConflict;
|
|
126
|
+
}(),
|
|
127
|
+
formApiRef: formApiRef,
|
|
128
|
+
loadLatestVersion: function () {
|
|
129
|
+
var _loadLatestVersion = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
130
|
+
return _regenerator().w(function (_context2) {
|
|
131
|
+
while (1) switch (_context2.n) {
|
|
132
|
+
case 0:
|
|
133
|
+
_context2.n = 1;
|
|
134
|
+
return refetch();
|
|
135
|
+
case 1:
|
|
136
|
+
return _context2.a(2);
|
|
137
|
+
}
|
|
138
|
+
}, _callee2);
|
|
139
|
+
}));
|
|
140
|
+
function loadLatestVersion() {
|
|
141
|
+
return _loadLatestVersion.apply(this, arguments);
|
|
142
|
+
}
|
|
143
|
+
return loadLatestVersion;
|
|
144
|
+
}()
|
|
145
|
+
});
|
|
146
|
+
var _useSaveState = useSaveState({
|
|
147
|
+
hasChanges: hasChanges,
|
|
148
|
+
saveConflict: saveConflict,
|
|
149
|
+
mode: mode,
|
|
150
|
+
validate: function () {
|
|
151
|
+
var _validate = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
152
|
+
var validateBlocks;
|
|
153
|
+
return _regenerator().w(function (_context4) {
|
|
154
|
+
while (1) switch (_context4.n) {
|
|
155
|
+
case 0:
|
|
156
|
+
if (state) {
|
|
157
|
+
_context4.n = 1;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
return _context4.a(2, false);
|
|
161
|
+
case 1:
|
|
162
|
+
_context4.n = 2;
|
|
163
|
+
return parallelAsyncEvery(Object.entries(rootBlocks), /*#__PURE__*/function () {
|
|
164
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref3) {
|
|
165
|
+
var _ref5, key, block;
|
|
166
|
+
return _regenerator().w(function (_context3) {
|
|
167
|
+
while (1) switch (_context3.n) {
|
|
168
|
+
case 0:
|
|
169
|
+
_ref5 = _slicedToArray(_ref3, 2), key = _ref5[0], block = _ref5[1];
|
|
170
|
+
return _context3.a(2, block.isValid(state[key]));
|
|
171
|
+
}
|
|
172
|
+
}, _callee3);
|
|
173
|
+
}));
|
|
174
|
+
return function (_x) {
|
|
175
|
+
return _ref4.apply(this, arguments);
|
|
176
|
+
};
|
|
177
|
+
}());
|
|
178
|
+
case 2:
|
|
179
|
+
validateBlocks = _context4.v;
|
|
180
|
+
return _context4.a(2, validateBlocks);
|
|
181
|
+
}
|
|
182
|
+
}, _callee4);
|
|
183
|
+
}));
|
|
184
|
+
function validate() {
|
|
185
|
+
return _validate.apply(this, arguments);
|
|
186
|
+
}
|
|
187
|
+
return validate;
|
|
188
|
+
}(),
|
|
189
|
+
save: saveEmailCampaign,
|
|
190
|
+
navigateToEditPage: function () {
|
|
191
|
+
var _navigateToEditPage = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(data) {
|
|
192
|
+
return _regenerator().w(function (_context5) {
|
|
193
|
+
while (1) switch (_context5.n) {
|
|
194
|
+
case 0:
|
|
195
|
+
if (!id) {
|
|
196
|
+
stackSwitchApi.activatePage("edit", data.brevoEmailCampaign.id);
|
|
197
|
+
}
|
|
198
|
+
case 1:
|
|
199
|
+
return _context5.a(2);
|
|
200
|
+
}
|
|
201
|
+
}, _callee5);
|
|
202
|
+
}));
|
|
203
|
+
function navigateToEditPage(_x2) {
|
|
204
|
+
return _navigateToEditPage.apply(this, arguments);
|
|
205
|
+
}
|
|
206
|
+
return navigateToEditPage;
|
|
207
|
+
}(),
|
|
208
|
+
updateReferenceContent: updateReferenceContent
|
|
209
|
+
}),
|
|
210
|
+
saveButton = _useSaveState.saveButton;
|
|
211
|
+
function saveEmailCampaign() {
|
|
212
|
+
return _saveEmailCampaign.apply(this, arguments);
|
|
213
|
+
}
|
|
214
|
+
function _saveEmailCampaign() {
|
|
215
|
+
_saveEmailCampaign = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
216
|
+
var _query$data, _yield$client$mutate, mutationResponse, _yield$client$mutate2, _mutationResponse;
|
|
217
|
+
return _regenerator().w(function (_context6) {
|
|
218
|
+
while (1) switch (_context6.n) {
|
|
219
|
+
case 0:
|
|
220
|
+
_context6.n = 1;
|
|
221
|
+
return saveConflict.checkForConflicts();
|
|
222
|
+
case 1:
|
|
223
|
+
if (!_context6.v) {
|
|
224
|
+
_context6.n = 2;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
throw new Error("Conflicts detected");
|
|
228
|
+
case 2:
|
|
229
|
+
if (output) {
|
|
230
|
+
_context6.n = 3;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
throw new Error("Output is required");
|
|
234
|
+
case 3:
|
|
235
|
+
if (!(mode === "edit")) {
|
|
236
|
+
_context6.n = 7;
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
if (id) {
|
|
240
|
+
_context6.n = 4;
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
throw new Error("Missing id in edit mode");
|
|
244
|
+
case 4:
|
|
245
|
+
_context6.n = 5;
|
|
246
|
+
return client.mutate({
|
|
247
|
+
mutation: updateEmailCampaignMutation,
|
|
248
|
+
variables: {
|
|
249
|
+
id: id,
|
|
250
|
+
input: _objectSpread({}, output),
|
|
251
|
+
lastUpdatedAt: (_query$data = query.data) === null || _query$data === void 0 || (_query$data = _query$data.brevoEmailCampaign) === null || _query$data === void 0 ? void 0 : _query$data.updatedAt
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
case 5:
|
|
255
|
+
_yield$client$mutate = _context6.v;
|
|
256
|
+
mutationResponse = _yield$client$mutate.data;
|
|
257
|
+
if (mutationResponse) {
|
|
258
|
+
_context6.n = 6;
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
throw new Error("Failed to update");
|
|
262
|
+
case 6:
|
|
263
|
+
return _context6.a(2, mutationResponse);
|
|
264
|
+
case 7:
|
|
265
|
+
_context6.n = 8;
|
|
266
|
+
return client.mutate({
|
|
267
|
+
mutation: createEmailCampaignMutation,
|
|
268
|
+
variables: {
|
|
269
|
+
scope: scope,
|
|
270
|
+
input: _objectSpread(_objectSpread({}, output), {}, {
|
|
271
|
+
brevoTargetGroups: output.brevoTargetGroups
|
|
272
|
+
})
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
case 8:
|
|
276
|
+
_yield$client$mutate2 = _context6.v;
|
|
277
|
+
_mutationResponse = _yield$client$mutate2.data;
|
|
278
|
+
if (_mutationResponse) {
|
|
279
|
+
_context6.n = 9;
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
throw new Error("Failed to create");
|
|
283
|
+
case 9:
|
|
284
|
+
return _context6.a(2, _mutationResponse);
|
|
285
|
+
case 10:
|
|
286
|
+
return _context6.a(2);
|
|
287
|
+
}
|
|
288
|
+
}, _callee6);
|
|
289
|
+
}));
|
|
290
|
+
return _saveEmailCampaign.apply(this, arguments);
|
|
291
|
+
}
|
|
292
|
+
if (!state) {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
if (error) {
|
|
296
|
+
throw error;
|
|
297
|
+
}
|
|
298
|
+
if (loading) {
|
|
299
|
+
return /*#__PURE__*/_jsx(Loading, {
|
|
300
|
+
behavior: "fillPageHeight"
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
var previewContext = _objectSpread(_objectSpread({}, blockContext), {}, {
|
|
304
|
+
parentUrl: match.url,
|
|
305
|
+
showVisibleOnly: previewApi.showOnlyVisible
|
|
306
|
+
});
|
|
307
|
+
var previewState = {
|
|
308
|
+
emailCampaignId: id,
|
|
309
|
+
scope: scope,
|
|
310
|
+
content: EmailCampaignContentBlock.createPreviewState(state.content, previewContext)
|
|
311
|
+
};
|
|
312
|
+
var isScheduledDateInPast = state.scheduledAt != undefined && isBefore(new Date(state.scheduledAt), new Date());
|
|
313
|
+
var isCampaignCreated = state.sendingState === "SENT" || mode === "add" || state.brevoTargetGroups.length === 0 || isScheduledDateInPast;
|
|
314
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
315
|
+
children: [saveConflict.dialogs, /*#__PURE__*/_jsxs(Toolbar, {
|
|
316
|
+
scopeIndicator: /*#__PURE__*/_jsx(ContentScopeIndicator, {
|
|
317
|
+
scope: scope
|
|
318
|
+
}),
|
|
319
|
+
children: [/*#__PURE__*/_jsx(ToolbarItem, {
|
|
320
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
321
|
+
onClick: stackApi === null || stackApi === void 0 ? void 0 : stackApi.goBack,
|
|
322
|
+
children: /*#__PURE__*/_jsx(ArrowLeft, {})
|
|
323
|
+
})
|
|
324
|
+
}), /*#__PURE__*/_jsx(ToolbarTitleItem, {
|
|
325
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
326
|
+
id: "cometBrevoModule.emailCampaigns.EmailCampaign",
|
|
327
|
+
defaultMessage: "Email Campaign"
|
|
328
|
+
})
|
|
329
|
+
}), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(ToolbarActions, {
|
|
330
|
+
children: saveButton
|
|
331
|
+
})]
|
|
332
|
+
}), /*#__PURE__*/_jsx(MainContent, {
|
|
333
|
+
disablePaddingBottom: true,
|
|
334
|
+
children: /*#__PURE__*/_jsx(BlockPreviewWithTabs, {
|
|
335
|
+
previewUrl: previewUrl,
|
|
336
|
+
previewState: previewState,
|
|
337
|
+
previewApi: previewApi,
|
|
338
|
+
children: [{
|
|
339
|
+
key: "config",
|
|
340
|
+
label: /*#__PURE__*/_jsx(BlockAdminTabLabel, {
|
|
341
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
342
|
+
id: "cometBrevoModule.emailCampaigns.config",
|
|
343
|
+
defaultMessage: "Config"
|
|
344
|
+
})
|
|
345
|
+
}),
|
|
346
|
+
content: /*#__PURE__*/_jsx(BlocksFinalForm, {
|
|
347
|
+
onSubmit: function onSubmit(values) {
|
|
348
|
+
return setState(_objectSpread(_objectSpread({}, state), values));
|
|
349
|
+
},
|
|
350
|
+
initialValues: {
|
|
351
|
+
title: state.title,
|
|
352
|
+
subject: state.subject
|
|
353
|
+
},
|
|
354
|
+
children: /*#__PURE__*/_jsx(ConfigFields, {})
|
|
355
|
+
})
|
|
356
|
+
}, {
|
|
357
|
+
key: "blocks",
|
|
358
|
+
label: /*#__PURE__*/_jsx(BlockAdminTabLabel, {
|
|
359
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
360
|
+
id: "cometBrevoModule.emailCampaigns.blocks",
|
|
361
|
+
defaultMessage: "Blocks"
|
|
362
|
+
})
|
|
363
|
+
}),
|
|
364
|
+
content: /*#__PURE__*/_jsx(BlocksFinalForm, {
|
|
365
|
+
onSubmit: function onSubmit(values) {
|
|
366
|
+
return setState(_objectSpread(_objectSpread({}, state), values));
|
|
367
|
+
},
|
|
368
|
+
initialValues: {
|
|
369
|
+
content: state === null || state === void 0 ? void 0 : state.content
|
|
370
|
+
},
|
|
371
|
+
children: /*#__PURE__*/_jsx(BlockAdminComponentRoot, {
|
|
372
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
373
|
+
name: "content",
|
|
374
|
+
fullWidth: true,
|
|
375
|
+
required: true,
|
|
376
|
+
component: FinalFormEmailCampaignContentBlock
|
|
377
|
+
})
|
|
378
|
+
})
|
|
379
|
+
})
|
|
380
|
+
}, {
|
|
381
|
+
key: "send-manager",
|
|
382
|
+
label: /*#__PURE__*/_jsx(BlockAdminTabLabel, {
|
|
383
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
384
|
+
id: "cometBrevoModule.emailCampaigns.sendManager",
|
|
385
|
+
defaultMessage: "Send manager"
|
|
386
|
+
})
|
|
387
|
+
}),
|
|
388
|
+
content: /*#__PURE__*/_jsx(BlocksFinalForm, {
|
|
389
|
+
onSubmit: function onSubmit(values) {
|
|
390
|
+
return setState(_objectSpread(_objectSpread({}, state), {}, {
|
|
391
|
+
scheduledAt: values.scheduledAt,
|
|
392
|
+
brevoTargetGroups: values.targetGroups
|
|
393
|
+
}));
|
|
394
|
+
},
|
|
395
|
+
initialValues: {
|
|
396
|
+
targetGroups: state.brevoTargetGroups,
|
|
397
|
+
scheduledAt: state.scheduledAt
|
|
398
|
+
},
|
|
399
|
+
children: /*#__PURE__*/_jsxs(SendManagerWrapper, {
|
|
400
|
+
scope: scope,
|
|
401
|
+
children: [/*#__PURE__*/_jsx(SendManagerFields, {
|
|
402
|
+
scope: scope,
|
|
403
|
+
isCampaignCreated: isCampaignCreated,
|
|
404
|
+
isSendable: !hasChanges && state.brevoTargetGroups != undefined,
|
|
405
|
+
id: id
|
|
406
|
+
}), /*#__PURE__*/_jsx(TestEmailCampaignForm, {
|
|
407
|
+
id: id,
|
|
408
|
+
isSendable: !hasChanges && state.brevoTargetGroups != undefined,
|
|
409
|
+
scope: scope,
|
|
410
|
+
isCampaignCreated: isCampaignCreated
|
|
411
|
+
})]
|
|
412
|
+
})
|
|
413
|
+
})
|
|
414
|
+
}]
|
|
415
|
+
})
|
|
416
|
+
})]
|
|
417
|
+
});
|
|
418
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface SendEmailCampaignNowDialogProps {
|
|
2
|
+
dialogOpen: boolean;
|
|
3
|
+
handleNoClick: () => void;
|
|
4
|
+
handleYesClick: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const SendEmailCampaignNowDialog: ({ dialogOpen, handleNoClick, handleYesClick }: SendEmailCampaignNowDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { SendEmailCampaignNowDialog };
|
|
8
|
+
//# sourceMappingURL=SendEmailCampaignNowDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendEmailCampaignNowDialog.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/SendEmailCampaignNowDialog.tsx"],"names":[],"mappings":"AAIA,UAAU,+BAA+B;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,QAAA,MAAM,0BAA0B,GAAI,+CAA+C,+BAA+B,4CAoBjH,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CancelButton, Dialog, SaveButton } from "@dextinity/admin";
|
|
2
|
+
import { DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
var SendEmailCampaignNowDialog = function SendEmailCampaignNowDialog(_ref) {
|
|
6
|
+
var dialogOpen = _ref.dialogOpen,
|
|
7
|
+
handleNoClick = _ref.handleNoClick,
|
|
8
|
+
handleYesClick = _ref.handleYesClick;
|
|
9
|
+
return /*#__PURE__*/_jsxs(Dialog, {
|
|
10
|
+
open: dialogOpen,
|
|
11
|
+
onClose: handleNoClick,
|
|
12
|
+
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
|
13
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
14
|
+
id: "cometBrevoModule.emailCampaigns.sendNow.dialog.title",
|
|
15
|
+
defaultMessage: "Send email campaign now?"
|
|
16
|
+
})
|
|
17
|
+
}), /*#__PURE__*/_jsx(DialogContent, {
|
|
18
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
19
|
+
id: "cometBrevoModule.emailCampaigns.sendNow.dialog.contentText",
|
|
20
|
+
defaultMessage: "Are you sure you want to send the email campaign now?"
|
|
21
|
+
})
|
|
22
|
+
}), /*#__PURE__*/_jsxs(DialogActions, {
|
|
23
|
+
children: [/*#__PURE__*/_jsx(CancelButton, {
|
|
24
|
+
onClick: handleNoClick
|
|
25
|
+
}), /*#__PURE__*/_jsx(SaveButton, {
|
|
26
|
+
onClick: handleYesClick,
|
|
27
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
28
|
+
id: "cometBrevoModule.emailCampaigns.sendNow.dialog.sendText",
|
|
29
|
+
defaultMessage: "Send now"
|
|
30
|
+
})
|
|
31
|
+
})]
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export { SendEmailCampaignNowDialog };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ContentScope } from "@dextinity/cms-admin";
|
|
2
|
+
interface SendManagerFieldsProps {
|
|
3
|
+
scope: ContentScope;
|
|
4
|
+
id?: string;
|
|
5
|
+
isSendable: boolean;
|
|
6
|
+
isCampaignCreated?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const SendManagerFields: ({ isCampaignCreated, scope, id, isSendable }: SendManagerFieldsProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=SendManagerFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendManagerFields.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/SendManagerFields.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA6D,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAepH,UAAU,sBAAsB;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAiBD,eAAO,MAAM,iBAAiB,GAAI,8CAA8C,sBAAsB,4CAmGrG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendManagerFields.gql.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/SendManagerFields.gql.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,uBAAuB,gCAUnC,CAAC;AAEF,eAAO,MAAM,4BAA4B,gCAIxC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as Types from '../../graphql.generated';
|
|
2
|
+
export declare const namedOperations: {
|
|
3
|
+
Query: {
|
|
4
|
+
TargetGroupsSelect: string;
|
|
5
|
+
};
|
|
6
|
+
Mutation: {
|
|
7
|
+
SendEmailCampaignNow: string;
|
|
8
|
+
};
|
|
9
|
+
Fragment: {
|
|
10
|
+
TargetGroupSelect: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type GQLTargetGroupSelectFragment = {
|
|
14
|
+
__typename?: 'BrevoTargetGroup';
|
|
15
|
+
id: string;
|
|
16
|
+
title: string;
|
|
17
|
+
};
|
|
18
|
+
export type GQLTargetGroupsSelectQueryVariables = Types.Exact<{
|
|
19
|
+
scope: Types.GQLEmailCampaignContentScopeInput;
|
|
20
|
+
}>;
|
|
21
|
+
export type GQLTargetGroupsSelectQuery = {
|
|
22
|
+
__typename?: 'Query';
|
|
23
|
+
brevoTargetGroups: {
|
|
24
|
+
__typename?: 'PaginatedTargetGroups';
|
|
25
|
+
nodes: Array<{
|
|
26
|
+
__typename?: 'BrevoTargetGroup';
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type GQLSendEmailCampaignNowMutationVariables = Types.Exact<{
|
|
33
|
+
id: Types.Scalars['ID']['input'];
|
|
34
|
+
}>;
|
|
35
|
+
export type GQLSendEmailCampaignNowMutation = {
|
|
36
|
+
__typename?: 'Mutation';
|
|
37
|
+
sendBrevoEmailCampaignNow: boolean;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=SendManagerFields.gql.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendManagerFields.gql.generated.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/SendManagerFields.gql.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAC;AAEjD,eAAO,MAAM,eAAe;;;;;;;;;;CAU3B,CAAA;AACD,MAAM,MAAM,4BAA4B,GAAG;IAAE,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1G,MAAM,MAAM,mCAAmC,GAAG,KAAK,CAAC,KAAK,CAAC;IAC5D,KAAK,EAAE,KAAK,CAAC,iCAAiC,CAAC;CAChD,CAAC,CAAC;AAGH,MAAM,MAAM,0BAA0B,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,iBAAiB,EAAE;QAAE,UAAU,CAAC,EAAE,uBAAuB,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;YAAE,UAAU,CAAC,EAAE,kBAAkB,CAAC;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC;AAE7M,MAAM,MAAM,wCAAwC,GAAG,KAAK,CAAC,KAAK,CAAC;IACjE,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC,CAAC;AAGH,MAAM,MAAM,+BAA+B,GAAG;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,yBAAyB,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
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 targetGroupSelectFragment = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment TargetGroupSelect on BrevoTargetGroup {\n id\n title\n }\n"])));
|
|
5
|
+
export var targetGroupsSelectQuery = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query TargetGroupsSelect($scope: EmailCampaignContentScopeInput!) {\n brevoTargetGroups(scope: $scope, limit: 100) {\n nodes {\n ...TargetGroupSelect\n }\n }\n }\n\n ", "\n"])), targetGroupSelectFragment);
|
|
6
|
+
export var sendEmailCampaignNowMutation = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n mutation SendEmailCampaignNow($id: ID!) {\n sendBrevoEmailCampaignNow(id: $id)\n }\n"])));
|