@useinsider/guido 3.15.1-beta.6da4177 → 3.16.0-beta.20cd2fe

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 (93) hide show
  1. package/dist/@types/config/schemas.js +118 -100
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +78 -75
  4. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  5. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
  6. package/dist/components/organisms/header/EditorActions.vue.js +11 -11
  7. package/dist/components/organisms/header/EditorActions.vue2.js +34 -50
  8. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  9. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
  10. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  12. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  13. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  14. package/dist/components/organisms/header/RightSlot.vue.js +6 -6
  15. package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
  16. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  17. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  18. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
  19. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  20. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +18 -0
  21. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +74 -0
  22. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -34
  23. package/dist/composables/useAccessibilityApi.js +31 -0
  24. package/dist/composables/useActionsApi.js +30 -22
  25. package/dist/composables/useEmailTemplateApplier.js +25 -23
  26. package/dist/composables/useHtmlValidator.js +85 -83
  27. package/dist/composables/useTimerClone.js +21 -19
  28. package/dist/config/i18n/en/labels.json.js +28 -4
  29. package/dist/config/migrator/checkboxMigrator.js +20 -19
  30. package/dist/config/migrator/radioButtonMigrator.js +26 -25
  31. package/dist/extensions/Blocks/Checkbox/constants/controlIds.js +4 -0
  32. package/dist/extensions/Blocks/Checkbox/constants/selectors.js +6 -0
  33. package/dist/extensions/Blocks/Checkbox/controls/blockBackground/index.js +10 -0
  34. package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
  35. package/dist/extensions/Blocks/Checkbox/settingsPanel.js +15 -14
  36. package/dist/extensions/Blocks/Checkbox/template.js +10 -9
  37. package/dist/extensions/Blocks/Items/block.js +44 -42
  38. package/dist/extensions/Blocks/Items/template.js +86 -86
  39. package/dist/extensions/Blocks/RadioButton/constants/controlIds.js +4 -0
  40. package/dist/extensions/Blocks/RadioButton/constants/selectors.js +6 -0
  41. package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +10 -0
  42. package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
  43. package/dist/extensions/Blocks/RadioButton/settingsPanel.js +12 -11
  44. package/dist/extensions/Blocks/RadioButton/template.js +16 -9
  45. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +5 -9
  46. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +98 -113
  47. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +21 -0
  48. package/dist/extensions/Blocks/controlFactories.js +117 -115
  49. package/dist/guido.css +1 -1
  50. package/dist/library.js +11 -7
  51. package/dist/node_modules/@vueuse/core/index.js +102 -0
  52. package/dist/node_modules/@vueuse/shared/index.js +40 -28
  53. package/dist/node_modules/valibot/dist/index.js +230 -216
  54. package/dist/public/trackingIds.js +8 -0
  55. package/dist/src/@types/config/schemas.d.ts +24 -0
  56. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  57. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  58. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  59. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  60. package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
  61. package/dist/src/composables/useActionsApi.d.ts +3 -3
  62. package/dist/src/composables/useConfig.d.ts +6 -0
  63. package/dist/src/extensions/Blocks/Checkbox/constants/controlIds.d.ts +7 -0
  64. package/dist/src/extensions/Blocks/Checkbox/constants/index.d.ts +10 -0
  65. package/dist/src/extensions/Blocks/Checkbox/constants/selectors.d.ts +16 -0
  66. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +14 -0
  67. package/dist/src/extensions/Blocks/RadioButton/constants/controlIds.d.ts +7 -0
  68. package/dist/src/extensions/Blocks/RadioButton/constants/index.d.ts +10 -0
  69. package/dist/src/extensions/Blocks/RadioButton/constants/selectors.d.ts +16 -0
  70. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +14 -0
  71. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -0
  72. package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
  73. package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
  74. package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
  75. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +14 -0
  76. package/dist/src/library.d.ts +1 -0
  77. package/dist/src/public/trackingIds.d.ts +9 -0
  78. package/dist/src/stores/config.d.ts +54 -0
  79. package/dist/src/stores/editor.d.ts +132 -0
  80. package/dist/src/stores/onboarding.d.ts +377 -0
  81. package/dist/src/stores/version-history.d.ts +1 -1
  82. package/dist/src/utils/linkTrackingIds.d.ts +30 -0
  83. package/dist/src/utils/timeUtil.d.ts +10 -0
  84. package/dist/stores/editor.js +9 -2
  85. package/dist/stores/onboarding.js +23 -14
  86. package/dist/utils/linkTrackingIds.js +56 -0
  87. package/dist/utils/pairProductVariables.js +105 -99
  88. package/dist/utils/templatePreparation.js +72 -61
  89. package/dist/utils/timeUtil.js +6 -17
  90. package/package.json +5 -1
  91. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  92. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  93. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
@@ -1,64 +1,66 @@
1
1
  import { useConfig as V } from "./useConfig.js";
2
2
  import { getIgnoredRecommendationBlockIds as M } from "../config/compiler/utils/recommendationIgnoreUtils.js";
3
3
  import { TemplateTypes as W } from "../enums/defaults.js";
4
- import { DISPLAY_CONDITIONS_REGEX as G, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as X, DATA_ATTRIBUTE_REGEX as $, DYNAMIC_CONTENT_TAG_REGEX as Y, ALLOWED_DYNAMIC_SYSTEM_TOKENS as U, VALID_DYNAMIC_VARIABLE_REGEX as j } from "../enums/html-validator.js";
4
+ import { DISPLAY_CONDITIONS_REGEX as G, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as X, DATA_ATTRIBUTE_REGEX as $, DYNAMIC_CONTENT_TAG_REGEX as K, ALLOWED_DYNAMIC_SYSTEM_TOKENS as Y, VALID_DYNAMIC_VARIABLE_REGEX as U } from "../enums/html-validator.js";
5
5
  import { ToasterTypeOptions as c } from "../enums/toaster.js";
6
+ import { BLOCK_ROOT_SELECTOR as j } from "../extensions/Blocks/Checkbox/constants/selectors.js";
6
7
  import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
7
- import { RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES as K } from "../extensions/Blocks/Recommendation/constants/selectors.js";
8
- import { useRecommendationExtensionStore as z } from "../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import { filterToProductAttrValue as Z } from "../extensions/Blocks/Recommendation/utils/compositionKeys.js";
10
- import { RecommendationRequiredFieldsKey as J } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
11
- import { useRecommendationStore as Q } from "../stores/recommendation.js";
12
- import { base64EncodeWithSpecialChars as ee } from "../utils/base64.js";
13
- import { computed as te } from "vue";
14
- import { useHttp as ne } from "./useHttp.js";
15
- import { useToaster as se } from "./useToaster.js";
16
- import { useTranslations as re } from "./useTranslations.js";
17
- const oe = /recommendation-id="(\d+)"/g;
18
- function ie(s) {
19
- return [...s.matchAll(oe)].map((m) => m[1]);
8
+ import { BLOCK_ROOT_SELECTOR as z } from "../extensions/Blocks/RadioButton/constants/selectors.js";
9
+ import { RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES as Z } from "../extensions/Blocks/Recommendation/constants/selectors.js";
10
+ import { useRecommendationExtensionStore as J } from "../extensions/Blocks/Recommendation/store/recommendation.js";
11
+ import { filterToProductAttrValue as Q } from "../extensions/Blocks/Recommendation/utils/compositionKeys.js";
12
+ import { RecommendationRequiredFieldsKey as ee } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
13
+ import { useRecommendationStore as te } from "../stores/recommendation.js";
14
+ import { base64EncodeWithSpecialChars as ne } from "../utils/base64.js";
15
+ import { computed as se } from "vue";
16
+ import { useHttp as re } from "./useHttp.js";
17
+ import { useToaster as oe } from "./useToaster.js";
18
+ import { useTranslations as ie } from "./useTranslations.js";
19
+ const ae = /recommendation-id="(\d+)"/g;
20
+ function ce(s) {
21
+ return [...s.matchAll(ae)].map((l) => l[1]);
20
22
  }
21
- function ae(s, m) {
22
- return m.some((f) => s.startsWith(`${f}_`));
23
+ function me(s, l) {
24
+ return l.some((f) => s.startsWith(`${f}_`));
23
25
  }
24
- const ce = /^(\d+)_\d+_(.+)$/;
25
- function le(s) {
26
- const m = s.match(ce);
27
- return m ? { recoId: m[1], attribute: m[2] } : null;
26
+ const le = /^(\d+)_\d+_(.+)$/;
27
+ function ue(s) {
28
+ const l = s.match(le);
29
+ return l ? { recoId: l[1], attribute: l[2] } : null;
28
30
  }
29
- function me(s) {
30
- const m = new Set(K);
31
+ function de(s) {
32
+ const l = new Set(Z);
31
33
  return Object.values(s).forEach((f) => {
32
- m.add(Z(f).toLowerCase());
33
- }), m;
34
+ l.add(Q(f).toLowerCase());
35
+ }), l;
34
36
  }
35
- function ue(s, m, f, o, d) {
37
+ function fe(s, l, f, o, d) {
36
38
  const u = s.match(/{{([a-zA-Z0-9_.\s]*)}}/gm);
37
39
  if (!u)
38
40
  return [];
39
- const g = new Set(m.map((h) => h.toLowerCase())), E = [];
40
- return u.forEach((h) => {
41
- const p = h.slice(2, -2).trim().toLowerCase();
41
+ const g = new Set(l.map((C) => C.toLowerCase())), E = [];
42
+ return u.forEach((C) => {
43
+ const p = C.slice(2, -2).trim().toLowerCase();
42
44
  if (p !== "" && g.has(p))
43
45
  return;
44
- const y = le(p);
45
- if (y && o.has(y.recoId)) {
46
- if (!d || d.has(y.attribute))
46
+ const h = ue(p);
47
+ if (h && o.has(h.recoId)) {
48
+ if (!d || d.has(h.attribute))
47
49
  return;
48
50
  E.push(p);
49
51
  return;
50
52
  }
51
- ae(p, f) || p.includes(".") || E.push(p);
53
+ me(p, f) || p.includes(".") || E.push(p);
52
54
  }), E;
53
55
  }
54
- function de(s) {
55
- return (s.replace($, "$1").match(Y) ?? []).filter((o) => {
56
+ function pe(s) {
57
+ return (s.replace($, "$1").match(K) ?? []).filter((o) => {
56
58
  const d = o.slice(2, -2), u = d.indexOf("|"), g = (u === -1 ? d : d.slice(0, u)).trim();
57
- return U.includes(g) ? !1 : j.test(g) ? u !== -1 && d.slice(u + 1).trim() === "" : !0;
59
+ return Y.includes(g) ? !1 : U.test(g) ? u !== -1 && d.slice(u + 1).trim() === "" : !0;
58
60
  });
59
61
  }
60
- const xe = () => {
61
- const { showToaster: s } = se(), { post: m } = ne(), { config: f } = V(), o = re(), d = Q(), u = z(), g = te(
62
+ const De = () => {
63
+ const { showToaster: s } = oe(), { post: l } = re(), { config: f } = V(), o = ie(), d = te(), u = J(), g = se(
62
64
  () => {
63
65
  var e, t;
64
66
  return ((t = (e = f.value) == null ? void 0 : e.partner) == null ? void 0 : t.messageType) === W.transactional;
@@ -71,11 +73,11 @@ const xe = () => {
71
73
  } catch {
72
74
  return null;
73
75
  }
74
- return me(u.filterList);
75
- }, h = async (e) => {
76
- const n = await m(
76
+ return de(u.filterList);
77
+ }, C = async (e) => {
78
+ const n = await l(
77
79
  "/newsletter/template-library/check-template-html-body",
78
- { html: ee(e) }
80
+ { html: ne(e) }
79
81
  ), { status: r, message: a } = n.data;
80
82
  return r || s({
81
83
  type: c.Error,
@@ -84,26 +86,26 @@ const xe = () => {
84
86
  type: c.Error,
85
87
  message: o("newsletter.already-in-progress")
86
88
  }), r;
87
- }, p = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), y = (e) => ["if", "endif"].includes(e.toLowerCase()), S = (e, t) => {
89
+ }, p = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), h = (e) => ["if", "endif"].includes(e.toLowerCase()), T = (e, t) => {
88
90
  const n = e.match(/({%(.*?)%})/g);
89
91
  let r = !0;
90
92
  return n !== null && !g.value && n.forEach((a) => {
91
93
  const i = a.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
92
94
  if (i && i.length > 0) {
93
- const [l] = i;
94
- p(l) && !t.includes(l) && (s({
95
+ const [m] = i;
96
+ p(m) && !t.includes(m) && (s({
95
97
  type: c.Warning,
96
98
  message: o("custom-fields.invalid-custom-fields")
97
99
  }), r = !1);
98
100
  }
99
101
  }), r;
100
- }, A = async (e, t, n) => {
101
- const r = n ? await h(e) : !0;
102
- return S(e, t) && r;
103
- }, T = (e) => e.length > 0 ? !0 : (s({
102
+ }, R = async (e, t, n) => {
103
+ const r = n ? await C(e) : !0;
104
+ return T(e, t) && r;
105
+ }, b = (e) => e.length > 0 ? !0 : (s({
104
106
  type: c.Warning,
105
107
  message: o("newsletter.html-content-is-empty")
106
- }), !1), w = (e) => {
108
+ }), !1), A = (e) => {
107
109
  const t = (e.match(/{/gm) || []).length, n = (e.match(/}/gm) || []).length;
108
110
  return t > n && s({
109
111
  type: c.Warning,
@@ -112,26 +114,26 @@ const xe = () => {
112
114
  type: c.Warning,
113
115
  message: o("custom-fields.missing-opening-braces")
114
116
  }), t === n;
115
- }, R = (e) => {
116
- const t = de(e).length === 0;
117
+ }, _ = (e) => {
118
+ const t = pe(e).length === 0;
117
119
  return t || s({
118
120
  type: c.Warning,
119
121
  message: o("custom-fields.invalid-custom-fields")
120
122
  }), t;
121
- }, _ = (e, t, n, r) => {
123
+ }, O = (e, t, n, r) => {
122
124
  if (g.value)
123
125
  return !0;
124
- const a = ue(
126
+ const a = fe(
125
127
  e,
126
128
  t,
127
- ie(e),
129
+ ce(e),
128
130
  n,
129
131
  r
130
132
  );
131
133
  if (a.length > 0) {
132
134
  const i = `
133
135
  <ul>
134
- ${a.map((l) => `<li>${l}</li>`).join("")}
136
+ ${a.map((m) => `<li>${m}</li>`).join("")}
135
137
  </ul>
136
138
  `;
137
139
  return s({
@@ -140,45 +142,45 @@ const xe = () => {
140
142
  }), !1;
141
143
  }
142
144
  return !0;
143
- }, N = (e) => {
145
+ }, w = (e) => {
144
146
  const t = e.match(/{%(.*?)%}/g), n = [];
145
147
  let r = !0;
146
148
  if (t && t.forEach((a) => {
147
- const i = a.match(G), l = a.match(H), C = (i == null ? void 0 : i.join("")) || "";
148
- (!i || a !== C) && !l && (s({
149
+ const i = a.match(G), m = a.match(H), v = (i == null ? void 0 : i.join("")) || "";
150
+ (!i || a !== v) && !m && (s({
149
151
  type: c.Error,
150
152
  message: o("newsletter.display-conditions-invalid-syntax")
151
- }), r = !1), i && i.forEach((v) => {
152
- v.trim() === "=" && (s({
153
+ }), r = !1), i && i.forEach((y) => {
154
+ y.trim() === "=" && (s({
153
155
  type: c.Error,
154
156
  message: o("custom-conditions.wrong-equality-operators")
155
157
  }), r = !1);
156
- const I = v.match(/^[a-zA-Z]*$/g);
157
- I && I.forEach((b) => {
158
- y(b) && n.push(b);
158
+ const I = y.match(/^[a-zA-Z]*$/g);
159
+ I && I.forEach((S) => {
160
+ h(S) && n.push(S);
159
161
  });
160
162
  });
161
163
  }), n.length) {
162
- const a = n.filter((l) => l === "if"), i = n.filter((l) => l === "endif");
164
+ const a = n.filter((m) => m === "if"), i = n.filter((m) => m === "endif");
163
165
  a.length !== i.length && (s({
164
166
  type: c.Error,
165
167
  message: o("custom-conditions.missing-if-endif-tag")
166
168
  }), r = !1);
167
169
  }
168
170
  return r;
169
- }, x = (e) => {
171
+ }, L = (e) => {
170
172
  const t = (e.match(/{% /gm) || []).length, n = (e.match(/ %}/gm) || []).length, r = t === n;
171
173
  return r || s({
172
174
  type: c.Warning,
173
175
  message: o("custom-conditions.no-space-after-braces")
174
176
  }), r;
175
- }, O = (e) => (e.match(/({%(.*?)%})/g) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, r) => n + r, 0) > 0 ? (s({
177
+ }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, r) => n + r, 0) > 0 ? (s({
176
178
  type: c.Warning,
177
179
  message: o("custom-conditions.no-braces-inside-if-tag")
178
- }), !1) : !0, k = () => u.hasInvalidBlock() ? (s({
180
+ }), !1) : !0, B = () => u.hasInvalidBlock() ? (s({
179
181
  type: c.Error,
180
- message: o(J)
181
- }), !1) : !0, B = () => d.recommendationConfigs && Object.values(d.recommendationConfigs).find((t) => t.filters.find((n) => n.value === "")) !== void 0 ? (s({
182
+ message: o(ee)
183
+ }), !1) : !0, x = () => d.recommendationConfigs && Object.values(d.recommendationConfigs).find((t) => t.filters.find((n) => n.value === "")) !== void 0 ? (s({
182
184
  type: c.Error,
183
185
  message: o("newsletter.fill-all-necessary-fields")
184
186
  }), !1) : !0, D = (e) => {
@@ -188,37 +190,37 @@ const xe = () => {
188
190
  message: o("newsletter.invalid-image-type")
189
191
  }), !1);
190
192
  }, F = (e) => {
191
- const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
193
+ const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(j);
192
194
  return Array.from(r).find((i) => {
193
- var l;
194
- return !((l = i.id) != null && l.trim());
195
+ var m;
196
+ return !((m = i.id) != null && m.trim());
195
197
  }) ? (s({
196
198
  type: c.Error,
197
199
  message: o("unsubscribe-templates.select-checkbox-groups")
198
200
  }), !1) : !0;
199
- }, L = (e) => {
200
- const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
201
+ }, k = (e) => {
202
+ const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(z);
201
203
  return Array.from(r).find((i) => {
202
- var l;
203
- return !((l = i.id) != null && l.trim());
204
+ var m;
205
+ return !((m = i.id) != null && m.trim());
204
206
  }) ? (s({
205
207
  type: c.Error,
206
208
  message: o("unsubscribe-templates.select-radio-button-groups")
207
209
  }), !1) : !0;
208
210
  };
209
211
  return { validateHtml: async (e, t, n = !1) => {
210
- var C, v;
212
+ var v, y;
211
213
  const r = [
212
214
  ...t.map((I) => I.value),
213
215
  ...q,
214
- ...((v = (C = f.value) == null ? void 0 : C.template) == null ? void 0 : v.customFieldAttributes) ?? []
216
+ ...((y = (v = f.value) == null ? void 0 : v.template) == null ? void 0 : y.customFieldAttributes) ?? []
215
217
  ], a = M(e), i = await E(a);
216
- return await A(e, r, n) && T(e) && w(e) && R(e) && _(e, r, a, i) && N(e) && x(e) && O(e) && k() && B() && D(e) && F(e) && L(e);
218
+ return await R(e, r, n) && b(e) && A(e) && _(e) && O(e, r, a, i) && w(e) && L(e) && N(e) && B() && x() && D(e) && F(e) && k(e);
217
219
  } };
218
220
  };
219
221
  export {
220
- me as buildPartnerAttributeNameSet,
221
- ue as findInvalidCustomFields,
222
- le as parseRecommendationVariable,
223
- xe as useHtmlValidator
222
+ de as buildPartnerAttributeNameSet,
223
+ fe as findInvalidCustomFields,
224
+ ue as parseRecommendationVariable,
225
+ De as useHtmlValidator
224
226
  };
@@ -1,11 +1,11 @@
1
1
  import { useActionsApi as f } from "./useActionsApi.js";
2
- import { useHttp as w } from "./useHttp.js";
3
- import { useToaster as H } from "./useToaster.js";
4
- import { useStripoApi as y } from "../services/stripoApi.js";
5
- const O = () => {
6
- const { handleError: c } = H(), { getToken: u } = y(), { post: d } = w(), { updateHtmlAndCss: l } = f(), s = (t) => /esd-timer-id="(\d+)"/.test(t), i = async (t, e) => {
2
+ import { useHttp as H } from "./useHttp.js";
3
+ import { useToaster as h } from "./useToaster.js";
4
+ import { useStripoApi as k } from "../services/stripoApi.js";
5
+ const S = () => {
6
+ const { handleError: c } = h(), { getToken: l } = k(), { post: p } = H(), { updateHtmlAndCss: u } = f(), s = (t) => /esd-timer-id="(\d+)"/.test(t), i = async (t, e) => {
7
7
  try {
8
- return (await d(
8
+ return (await p(
9
9
  "https://plugins.stripo.email/api/v1/timers/clone",
10
10
  { html: t },
11
11
  {
@@ -25,29 +25,31 @@ const O = () => {
25
25
  cloneTimersOnSave: async (t) => {
26
26
  if (!s(t))
27
27
  return t;
28
- const e = await u();
28
+ const e = await l();
29
29
  return e && await i(t, e) || t;
30
30
  },
31
31
  updateTimersOnLoad: async (t) => {
32
- var e, r, o, m;
32
+ var e, r, n, d;
33
33
  try {
34
- const n = (r = (e = window.UIEditor) == null ? void 0 : e.getHtml) == null ? void 0 : r.call(e);
35
- if (!n || !s(n))
34
+ const o = (r = (e = window.UIEditor) == null ? void 0 : e.getHtml) == null ? void 0 : r.call(e);
35
+ if (!o || !s(o))
36
36
  return;
37
- const p = await t();
38
- if (!p)
37
+ const m = await t();
38
+ if (!m)
39
39
  return;
40
- const a = await i(n, p);
41
- if (!a || a === n)
40
+ const a = await i(o, m);
41
+ if (!a || a === o)
42
42
  return;
43
- const T = ((m = (o = window.UIEditor) == null ? void 0 : o.getCss) == null ? void 0 : m.call(o)) || "";
44
- l(a, T);
45
- } catch (n) {
46
- c(n, "Failed to update timer blocks");
43
+ const T = ((d = (n = window.UIEditor) == null ? void 0 : n.getCss) == null ? void 0 : d.call(n)) || "";
44
+ u(a, T).catch((w) => {
45
+ console.warn("Editor did not acknowledge the timer-block update.", w);
46
+ });
47
+ } catch (o) {
48
+ c(o, "Failed to update timer blocks");
47
49
  }
48
50
  }
49
51
  };
50
52
  };
51
53
  export {
52
- O as useTimerClone
54
+ S as useTimerClone
53
55
  };
@@ -1,19 +1,43 @@
1
- const e = "Items", o = "Default", t = "Custom", s = {
1
+ const e = "Items", o = "Default", i = "Custom", t = {
2
2
  "Global Styles & Layout": "Global Styles and Layout",
3
3
  "Structures & Modules": "Structures and Modules",
4
4
  "Recommendation Block": "Recommendation",
5
5
  Items: e,
6
6
  "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.",
7
7
  "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.",
8
+ "email-editor.a11y-hide-images": "Hide images",
9
+ "email-editor.a11y-show-images": "Show images",
10
+ "email-editor.cvd-none": "No Color Deficiency",
11
+ "email-editor.cvd-protanopia": "Protanopia",
12
+ "email-editor.cvd-protanopia-description": "Causes red-green confusion and makes reds appear darker.",
13
+ "email-editor.cvd-deuteranopia": "Deuteranopia",
14
+ "email-editor.cvd-deuteranopia-description": "Causes red-green confusion.",
15
+ "email-editor.cvd-tritanopia": "Tritanopia",
16
+ "email-editor.cvd-tritanopia-description": "Causes blue-yellow confusion.",
17
+ "email-editor.cvd-achromatopsia": "Achromatopsia",
18
+ "email-editor.cvd-achromatopsia-description": "Causes complete color blindness.",
19
+ "email-editor.more-actions": "More actions",
20
+ "email-editor.preferences": "Preferences",
21
+ "email-editor.actions": "Actions",
22
+ "email-editor.accessibility-test": "Accessibility Test",
23
+ "email-editor.autosaved-at-today": "Autosaved at {time}, Today",
24
+ "email-editor.autosaved-at-date": "Autosaved at {date}",
25
+ "email-editor.export-html": "Export HTML",
26
+ "email-editor.onboarding-kebab-title": "Discover Preferences and Actions",
27
+ "email-editor.onboarding-kebab-description": "You can now access your Preferences and Actions easily such as Autosave, Export HTML, Version History, Accessibility Test and Save As Template.",
28
+ "email-editor.onboarding-autosave-title": "Autosave Your Design",
29
+ "email-editor.onboarding-autosave-description": "You can save your design automatically by enabling Autosave without losing your work.",
30
+ "email-editor.onboarding-accessibility-title": "Test Accessibility of Your Design",
31
+ "email-editor.onboarding-accessibility-description": "You can test the accessibility of your design to see the Failed, Passed items and update the Failed ones accordingly.",
8
32
  "Pixel Tracking Opt-in": "Pixel Tracking Opt-in",
9
33
  "OPT-IN SELECTION": "OPT-IN SELECTION",
10
34
  "UNSUBSCRIBE GROUPS": "UNSUBSCRIBE GROUPS",
11
35
  Default: o,
12
- Custom: t
36
+ Custom: i
13
37
  };
14
38
  export {
15
- t as Custom,
39
+ i as Custom,
16
40
  o as Default,
17
41
  e as Items,
18
- s as default
42
+ t as default
19
43
  };
@@ -1,36 +1,37 @@
1
- var h = Object.defineProperty;
2
- var g = (r, t, e) => t in r ? h(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var l = (r, t, e) => g(r, typeof t != "symbol" ? t + "" : t, e);
4
- import f from "../../extensions/Blocks/Checkbox/template.js";
5
- import { extractTextFromElement as m, buildTextBlock as p } from "./textBlockMigration.js";
6
- class C {
1
+ var g = Object.defineProperty;
2
+ var x = (r, t, e) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var m = (r, t, e) => x(r, typeof t != "symbol" ? t + "" : t, e);
4
+ import { CSS_CLASS_CHECKBOX_BLOCK as b, CSS_CLASS_CHECKBOX_BLOCK_V2 as T, BLOCK_ROOT_SELECTOR as f } from "../../extensions/Blocks/Checkbox/constants/selectors.js";
5
+ import h from "../../extensions/Blocks/Checkbox/template.js";
6
+ import { extractTextFromElement as p, buildTextBlock as C } from "./textBlockMigration.js";
7
+ class O {
7
8
  constructor() {
8
- l(this, "parser");
9
+ m(this, "parser");
9
10
  this.parser = new DOMParser();
10
11
  }
11
12
  migrate(t) {
12
13
  try {
13
- const e = this.parser.parseFromString(t, "text/html"), n = e.querySelectorAll("td.checkbox-block");
14
- if (n.length === 0)
14
+ const e = this.parser.parseFromString(t, "text/html"), i = e.querySelectorAll(`td.${b}`);
15
+ if (i.length === 0)
15
16
  return t;
16
- let i = !1;
17
- return n.forEach((o) => {
18
- if (o.classList.contains("checkbox-block-v2"))
17
+ let s = !1;
18
+ return i.forEach((o) => {
19
+ if (o.classList.contains(T))
19
20
  return;
20
- const b = o.getAttribute("id"), s = m(o, "ins-title"), a = m(o, "ins-description"), u = p(s, s.containerClass), x = p(a, a.containerClass), d = f.replace("{-{-TITLE-}-}", u).replace("{-{-DESCRIPTION-}-}", x), c = this.parser.parseFromString(
21
+ const l = o.getAttribute("id"), c = p(o, "ins-title"), a = p(o, "ins-description"), u = C(c, c.containerClass), S = C(a, a.containerClass), d = h.replace("{-{-TITLE-}-}", u).replace("{-{-DESCRIPTION-}-}", S), n = this.parser.parseFromString(
21
22
  `<table id="tempDoc"><tbody><tr>${d}</tr></tbody></table>`,
22
23
  "text/html"
23
- ).querySelector(".checkbox-block-v2");
24
- c && o.parentNode && (c.setAttribute("id", b || ""), o.parentNode.replaceChild(c, o), i = !0);
25
- }), i ? e.documentElement.outerHTML : t;
24
+ ).querySelector(f);
25
+ n && o.parentNode && (n.setAttribute("id", l || ""), o.parentNode.replaceChild(n, o), s = !0);
26
+ }), s ? e.documentElement.outerHTML : t;
26
27
  } catch (e) {
27
28
  return console.error("CheckboxMigrator failed:", e), t;
28
29
  }
29
30
  }
30
31
  }
31
- function E(r) {
32
- return new C().migrate(r);
32
+ function D(r) {
33
+ return new O().migrate(r);
33
34
  }
34
35
  export {
35
- E as migrateCheckbox
36
+ D as migrateCheckbox
36
37
  };
@@ -1,53 +1,54 @@
1
- var q = Object.defineProperty;
2
- var C = (o, t, e) => t in o ? q(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var g = (o, t, e) => C(o, typeof t != "symbol" ? t + "" : t, e);
1
+ var R = Object.defineProperty;
2
+ var b = (n, t, e) => t in n ? R(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var g = (n, t, e) => b(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import { CSS_CLASS_RADIO_BUTTON_BLOCK as C, CSS_CLASS_RADIO_BUTTON_BLOCK_V2 as T, BLOCK_ROOT_SELECTOR as A } from "../../extensions/Blocks/RadioButton/constants/selectors.js";
4
5
  import N from "../../extensions/Blocks/RadioButton/template.js";
5
- import { extractTextFromElement as b, buildTextBlock as f } from "./textBlockMigration.js";
6
- class R {
6
+ import { extractTextFromElement as S, buildTextBlock as f } from "./textBlockMigration.js";
7
+ class _ {
7
8
  constructor() {
8
9
  g(this, "parser");
9
10
  this.parser = new DOMParser();
10
11
  }
11
12
  migrate(t) {
12
13
  try {
13
- const e = this.parser.parseFromString(t, "text/html"), n = e.querySelectorAll("td.radio-button-block"), a = e.querySelectorAll("td.radio-button-v2");
14
- if (n.length === 0 && a.length === 0)
14
+ const e = this.parser.parseFromString(t, "text/html"), o = e.querySelectorAll(`td.${C}`), a = e.querySelectorAll(`td.${T}`);
15
+ if (o.length === 0 && a.length === 0)
15
16
  return t;
16
- let i = !1;
17
- return n.forEach((r) => {
18
- if (r.classList.contains("radio-button-v2"))
17
+ let s = !1;
18
+ return o.forEach((r) => {
19
+ if (r.classList.contains(T))
19
20
  return;
20
- const s = r.getAttribute("id"), c = b(r, "ins-title"), d = b(r, "ins-description"), u = b(r, "ins-subscribe"), l = b(r, "ins-unsubscribe"), p = f(c, c.containerClass), m = f(d, d.containerClass), h = f(u), S = f(l), T = N.replace("{-{-TITLE-}-}", p).replace("{-{-DESCRIPTION-}-}", m).replace("{-{-YES-}-}", h).replace("{-{-NO-}-}", S), y = this.parser.parseFromString(
21
- `<table id="tempDoc"><tbody><tr>${T}</tr></tbody></table>`,
21
+ const i = r.getAttribute("id"), c = S(r, "ins-title"), p = S(r, "ins-description"), l = S(r, "ins-subscribe"), u = S(r, "ins-unsubscribe"), d = f(c, c.containerClass), m = f(p, p.containerClass), h = f(l), L = f(u), O = N.replace("{-{-TITLE-}-}", d).replace("{-{-DESCRIPTION-}-}", m).replace("{-{-YES-}-}", h).replace("{-{-NO-}-}", L), y = this.parser.parseFromString(
22
+ `<table id="tempDoc"><tbody><tr>${O}</tr></tbody></table>`,
22
23
  "text/html"
23
- ).querySelector(".radio-button-v2");
24
- y && r.parentNode && (y.setAttribute("id", s || ""), r.parentNode.replaceChild(y, r), i = !0);
25
- }), i = this.healRadioButtonV2(e) || i, i ? e.documentElement.outerHTML : t;
24
+ ).querySelector(A);
25
+ y && r.parentNode && (y.setAttribute("id", i || ""), r.parentNode.replaceChild(y, r), s = !0);
26
+ }), s = this.healRadioButtonV2(e) || s, s ? e.documentElement.outerHTML : t;
26
27
  } catch (e) {
27
28
  return console.error("RadioButtonMigrator failed:", e), t;
28
29
  }
29
30
  }
30
31
  healRadioButtonV2(t) {
31
32
  let e = !1;
32
- return t.querySelectorAll("td.radio-button-v2").forEach((n) => {
33
+ return t.querySelectorAll(`td.${T}`).forEach((o) => {
33
34
  var m;
34
- n.classList.contains("radio-button-block") || (n.classList.add("radio-button-block"), e = !0);
35
- const a = n.querySelector("input#radioYes"), i = n.querySelector("input#radioNo");
36
- if (!a || !i)
35
+ o.classList.contains(C) || (o.classList.add(C), e = !0);
36
+ const a = o.querySelector("input#radioYes"), s = o.querySelector("input#radioNo");
37
+ if (!a || !s)
37
38
  return;
38
39
  const r = ((m = a.parentElement) == null ? void 0 : m.querySelector(":scope > p")) || null;
39
40
  if (!r && !a.hasAttribute("align"))
40
41
  return;
41
- const s = a.closest("tr"), c = i.closest("tr");
42
- if (!s || !c || s === c || !s.parentNode)
42
+ const i = a.closest("tr"), c = s.closest("tr");
43
+ if (!i || !c || i === c || !i.parentNode)
43
44
  return;
44
- const d = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", u = c.cloneNode(!0), l = u.querySelector("input#radioNo"), p = u.querySelector("p");
45
- l && (l.setAttribute("id", "radioYes"), l.removeAttribute("align")), p && (p.innerHTML = d), s.parentNode.replaceChild(u, s), e = !0;
45
+ const p = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", l = c.cloneNode(!0), u = l.querySelector("input#radioNo"), d = l.querySelector("p");
46
+ u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")), d && (d.innerHTML = p), i.parentNode.replaceChild(l, i), e = !0;
46
47
  }), e;
47
48
  }
48
49
  }
49
- function w(o) {
50
- return new R().migrate(o);
50
+ function w(n) {
51
+ return new _().migrate(n);
51
52
  }
52
53
  export {
53
54
  w as migrateRadioButton
@@ -0,0 +1,4 @@
1
+ var r = /* @__PURE__ */ ((o) => (o.BLOCK_BACKGROUND = "checkbox-block-background-color-control", o))(r || {});
2
+ export {
3
+ r as CheckboxControlId
4
+ };
@@ -0,0 +1,6 @@
1
+ const c = "checkbox-block", C = "checkbox-block-v2", S = `.${C}`;
2
+ export {
3
+ S as BLOCK_ROOT_SELECTOR,
4
+ c as CSS_CLASS_CHECKBOX_BLOCK,
5
+ C as CSS_CLASS_CHECKBOX_BLOCK_V2
6
+ };
@@ -0,0 +1,10 @@
1
+ import { createBlockBackgroundColorControl as o } from "../../../controlFactories.js";
2
+ import { CheckboxControlId as r } from "../../constants/controlIds.js";
3
+ import { BLOCK_ROOT_SELECTOR as C } from "../../constants/selectors.js";
4
+ const k = o(
5
+ r.BLOCK_BACKGROUND,
6
+ C
7
+ );
8
+ export {
9
+ k as CheckboxBlockBackgroundControl
10
+ };
@@ -1,9 +1,10 @@
1
1
  import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { CheckboxBlock as t } from "./block.js";
3
- import { CheckboxControl as e } from "./control.js";
4
- import { CheckboxIconsRegistry as r } from "./iconsRegistry.js";
5
- import { CheckboxBlockSettings as i } from "./settingsPanel.js";
6
- const d = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
3
+ import { CheckboxControl as r } from "./control.js";
4
+ import { CheckboxBlockBackgroundControl as e } from "./controls/blockBackground/index.js";
5
+ import { CheckboxIconsRegistry as i } from "./iconsRegistry.js";
6
+ import { CheckboxBlockSettings as n } from "./settingsPanel.js";
7
+ const C = new o().addBlock(t).withSettingsPanelRegistry(n).addControl(r).addControl(e).withIconsRegistry(i).build();
7
8
  export {
8
- d as default
9
+ C as default
9
10
  };