@useinsider/guido 3.7.1-beta.4622f87 → 3.7.1-beta.748af43

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 (34) hide show
  1. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +2 -2
  2. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +24 -22
  3. package/dist/composables/useHtmlValidator.js +79 -73
  4. package/dist/enums/html-validator.js +13 -5
  5. package/dist/enums/toaster.js +1 -1
  6. package/dist/extensions/Blocks/Items/block.js +48 -29
  7. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +62 -45
  8. package/dist/extensions/Blocks/Recommendation/block.js +35 -16
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +35 -30
  10. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +62 -50
  11. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +208 -193
  12. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +18 -17
  13. package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +16 -0
  14. package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +9 -0
  15. package/dist/extensions/Blocks/Unsubscribe/block.js +122 -72
  16. package/dist/extensions/Blocks/Unsubscribe/control.js +33 -26
  17. package/dist/extensions/Blocks/Unsubscribe/template.js +4 -4
  18. package/dist/guido.css +1 -1
  19. package/dist/src/enums/html-validator.d.ts +4 -0
  20. package/dist/src/enums/toaster.d.ts +2 -1
  21. package/dist/src/extensions/Blocks/Items/block.d.ts +8 -0
  22. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
  23. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +13 -0
  24. package/dist/src/extensions/Blocks/Recommendation/block.test.d.ts +1 -0
  25. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -0
  26. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
  27. package/dist/src/extensions/Blocks/Recommendation/useRecommendationBlockWarning.d.ts +12 -0
  28. package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +28 -0
  29. package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.test.d.ts +1 -0
  30. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +9 -0
  31. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  32. package/dist/static/styles/components/base-input.css.js +5 -0
  33. package/dist/stores/autosave.js +6 -6
  34. package/package.json +1 -1
@@ -3,7 +3,7 @@ import a from "./UnsubscribePageSelection.vue2.js";
3
3
  import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var o = function() {
5
5
  var r = this, e = r._self._c, t = r._self._setupProxy;
6
- return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.closeModal, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
6
+ return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
7
7
  return [e(t.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
8
8
  }, proxy: !0 }]) }, [e("div", { staticClass: "d-g templates-wrapper" }, r._l(t.unsubscribeStore.getTemplatesByActiveType, function(s) {
9
9
  return e("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
@@ -16,7 +16,7 @@ var o = function() {
16
16
  i,
17
17
  !1,
18
18
  null,
19
- "df672485"
19
+ "f6a8cb4c"
20
20
  );
21
21
  const _ = c.exports;
22
22
  export {
@@ -1,15 +1,15 @@
1
- import { defineComponent as g, ref as y, computed as n, watch as S } from "vue";
2
- import T from "../../wrappers/WpDrawer.vue.js";
3
- import { useToaster as v } from "../../../composables/useToaster.js";
1
+ import { defineComponent as y, ref as S, computed as a, watch as T } from "vue";
2
+ import v from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as C } from "../../../composables/useToaster.js";
4
4
  import { useTranslations as B } from "../../../composables/useTranslations.js";
5
- import { ToasterTypeOptions as C } from "../../../enums/toaster.js";
6
- import { useUnsubscribeStore as w } from "../../../stores/unsubscribe.js";
7
- import { InContainer as h } from "@useinsider/design-system-vue";
8
- import U from "./UnsubscribeBreadcrumb.vue.js";
9
- const F = /* @__PURE__ */ g({
5
+ import { ToasterTypeOptions as w } from "../../../enums/toaster.js";
6
+ import { useUnsubscribeStore as h } from "../../../stores/unsubscribe.js";
7
+ import { InContainer as U } from "@useinsider/design-system-vue";
8
+ import P from "./UnsubscribeBreadcrumb.vue.js";
9
+ const L = /* @__PURE__ */ y({
10
10
  __name: "UnsubscribePageSelection",
11
- setup(P) {
12
- const s = B(), e = w(), { showToaster: a } = v(), o = y(!1), c = n(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = n(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), u = n(() => ({
11
+ setup(_) {
12
+ const s = B(), e = h(), { showToaster: r } = C(), o = S(!1), c = a(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = a(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), u = a(() => ({
13
13
  primaryButton: {
14
14
  styling: "solid",
15
15
  type: "primary",
@@ -23,42 +23,44 @@ const F = /* @__PURE__ */ g({
23
23
  labelText: i.value,
24
24
  disabledStatus: o.value
25
25
  }
26
- })), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", r = (t) => {
26
+ })), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", n = (t) => {
27
27
  e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
28
28
  t();
29
29
  }, 500);
30
30
  }, d = () => {
31
+ n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel"));
32
+ }, m = () => {
31
33
  if (e.isActiveTypeFirstInCollection) {
32
- r(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
34
+ n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
33
35
  return;
34
36
  }
35
37
  e.setPreviousType();
36
- }, m = () => {
38
+ }, b = () => {
37
39
  if (e.isActiveTypeLastInCollection) {
38
40
  o.value = !0;
39
- const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), f = e.getSelectedUnsubscribePagesByCollection(t);
40
- e.removeUnsubscribePages(f), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
41
+ const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), g = e.getSelectedUnsubscribePagesByCollection(t);
42
+ e.removeUnsubscribePages(g), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
41
43
  detail: {
42
44
  collectionType: t,
43
45
  selectedPages: l
44
46
  }
45
- })), r(() => {
46
- o.value = !1, a({
47
- type: C.Success,
47
+ })), n(() => {
48
+ o.value = !1, r({
49
+ type: w.Success,
48
50
  message: s("global-unsubscribe.pages-were-attached")
49
51
  });
50
52
  });
51
53
  return;
52
54
  }
53
55
  e.setNextType();
54
- }, b = (t) => {
56
+ }, f = (t) => {
55
57
  e.setSelectedTemplate(t);
56
58
  };
57
- return S(() => e.pageSelectionDrawerStatus, (t) => {
59
+ return T(() => e.pageSelectionDrawerStatus, (t) => {
58
60
  t && e.pageSelectionUpdateStatus && e.fetchTemplates();
59
- }), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: a, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: r, handleBack: d, handleSave: m, selectTemplate: b, WpDrawer: T, InContainer: h, UnsubscribeBreadcrumb: U };
61
+ }), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: r, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: n, handleClose: d, handleBack: m, handleSave: b, selectTemplate: f, WpDrawer: v, InContainer: U, UnsubscribeBreadcrumb: P };
60
62
  }
61
63
  });
62
64
  export {
63
- F as default
65
+ L as default
64
66
  };
@@ -1,86 +1,92 @@
1
- import { useConfig as _ } from "./useConfig.js";
2
- import { TemplateTypes as H } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
1
+ import { useConfig as V } from "./useConfig.js";
2
+ import { TemplateTypes as G } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as H, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as M, CampaignCouldNotBeSavedKey as X, CanNotMakeAnyChangesForRunningKey as P, DATA_ATTRIBUTE_REGEX as Y, DYNAMIC_CONTENT_TAG_REGEX as $, ALLOWED_DYNAMIC_SYSTEM_TOKENS as q, VALID_DYNAMIC_VARIABLE_REGEX as K } from "../enums/html-validator.js";
4
4
  import { ToasterTypeOptions as c } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationExtensionStore as X } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
- import { RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
8
- import { useRecommendationStore as K } from "../stores/recommendation.js";
9
- import { base64EncodeWithSpecialChars as z } from "../utils/base64.js";
10
- import { useHttp as U } from "./useHttp.js";
11
- import { useToaster as Y } from "./useToaster.js";
12
- import { useTranslations as Z } from "./useTranslations.js";
13
- const J = /recommendation-id="(\d+)"/g;
14
- function Q(a) {
15
- return [...a.matchAll(J)].map((u) => u[1]);
5
+ import { itemsBlockDynamicVariables as j } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationExtensionStore as U } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { RecommendationRequiredFieldsKey as z } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
8
+ import { useRecommendationStore as Z } from "../stores/recommendation.js";
9
+ import { base64EncodeWithSpecialChars as J } from "../utils/base64.js";
10
+ import { useHttp as Q } from "./useHttp.js";
11
+ import { useToaster as ee } from "./useToaster.js";
12
+ import { useTranslations as te } from "./useTranslations.js";
13
+ const se = /recommendation-id="(\d+)"/g;
14
+ function ne(i) {
15
+ return [...i.matchAll(se)].map((d) => d[1]);
16
16
  }
17
- function ee(a, u) {
18
- return u.some((d) => a.startsWith(`${d}_`));
17
+ function ie(i, d) {
18
+ return d.some((g) => i.startsWith(`${g}_`));
19
19
  }
20
- const ge = () => {
21
- var y, h;
22
- const { showToaster: a } = Y(), { post: u } = U(), { config: d } = _(), r = Z(), g = K(), S = X(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, b = async (e) => {
23
- const t = await u(
20
+ function oe(i) {
21
+ return (i.replace(Y, "$1").match($) ?? []).filter((r) => {
22
+ const u = r.slice(2, -2), f = u.indexOf("|"), p = (f === -1 ? u : u.slice(0, f)).trim();
23
+ return q.includes(p) ? !1 : K.test(p) ? f !== -1 && u.slice(f + 1).trim() === "" : !0;
24
+ });
25
+ }
26
+ const Ce = () => {
27
+ var h, v;
28
+ const { showToaster: i } = ee(), { post: d } = Q(), { config: g } = V(), r = te(), u = Z(), f = U(), p = ((v = (h = g.value) == null ? void 0 : h.partner) == null ? void 0 : v.messageType) === G.transactional, A = async (e) => {
29
+ const t = await d(
24
30
  "/newsletter/template-library/check-template-html-body",
25
- { html: z(e) }
31
+ { html: J(e) }
26
32
  ), { status: n, message: l } = t.data;
27
- return n || a({
33
+ return n || i({
28
34
  type: c.Alert,
29
35
  message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
30
- }), r(M), l === r($) && a({
36
+ }), r(X), l === r(P) && i({
31
37
  type: c.Alert,
32
38
  message: r("newsletter.already-in-progress")
33
39
  }), n;
34
- }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
40
+ }, S = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), b = (e) => ["if", "endif"].includes(e.toLowerCase()), I = (e, s) => {
35
41
  const t = e.match(/({%(.*?)%})/g);
36
42
  let n = !0;
37
43
  return t !== null && !p && t.forEach((l) => {
38
44
  const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
39
45
  if (o && o.length > 0) {
40
- const [i] = o;
41
- w(i) && !s.includes(i) && (a({
46
+ const [a] = o;
47
+ S(a) && !s.includes(a) && (i({
42
48
  type: c.Warning,
43
49
  message: r("custom-fields.invalid-custom-fields")
44
50
  }), n = !1);
45
51
  }
46
52
  }), n;
47
- }, k = async (e, s, t) => {
48
- const n = t ? await b(e) : !0;
49
- return A(e, s) && n;
50
- }, x = (e) => e.length > 0 ? !0 : (a({
53
+ }, T = async (e, s, t) => {
54
+ const n = t ? await A(e) : !0;
55
+ return I(e, s) && n;
56
+ }, w = (e) => e.length > 0 ? !0 : (i({
51
57
  type: c.Warning,
52
58
  message: r("newsletter.html-content-is-empty")
53
- }), !1), I = (e) => {
59
+ }), !1), x = (e) => {
54
60
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
55
- return s > t && a({
61
+ return s > t && i({
56
62
  type: c.Warning,
57
63
  message: r("custom-fields.missing-closing-braces")
58
- }), s < t && a({
64
+ }), s < t && i({
59
65
  type: c.Warning,
60
66
  message: r("custom-fields.missing-opening-braces")
61
67
  }), s === t;
62
- }, F = (e) => {
63
- const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
64
- return s || a({
68
+ }, _ = (e) => {
69
+ const s = oe(e).length === 0;
70
+ return s || i({
65
71
  type: c.Warning,
66
72
  message: r("custom-fields.invalid-custom-fields")
67
73
  }), s;
68
- }, T = (e, s) => {
74
+ }, k = (e, s) => {
69
75
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
70
76
  if (t && !p) {
71
- const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
72
- if (t.forEach((i) => {
73
- const m = i.slice(2, -2).trim().toLowerCase();
74
- (!n.has(m) || m === "") && !ee(m, l) && o.push(m);
77
+ const n = new Set(s.map((a) => a.toLowerCase())), l = ne(e), o = [];
78
+ if (t.forEach((a) => {
79
+ const m = a.slice(2, -2).trim().toLowerCase();
80
+ (!n.has(m) || m === "") && !ie(m, l) && o.push(m);
75
81
  }), o.length > 0) {
76
- const i = `
82
+ const a = `
77
83
  <ul>
78
84
  ${o.map((m) => `<li>${m}</li>`).join("")}
79
85
  </ul>
80
86
  `;
81
- return a({
87
+ return i({
82
88
  type: c.Alert,
83
- message: r("custom-fields.invalid-custom-fields") + i
89
+ message: r("custom-fields.invalid-custom-fields") + a
84
90
  }), !1;
85
91
  }
86
92
  }
@@ -89,78 +95,78 @@ const ge = () => {
89
95
  const s = e.match(/{%(.*?)%}/g), t = [];
90
96
  let n = !0;
91
97
  if (s && s.forEach((l) => {
92
- const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
93
- (!o || l !== m) && !i && (a({
98
+ const o = l.match(H), a = l.match(M), m = (o == null ? void 0 : o.join("")) || "";
99
+ (!o || l !== m) && !a && (i({
94
100
  type: c.Alert,
95
101
  message: r("newsletter.display-conditions-invalid-syntax")
96
- }), n = !1), o && o.forEach((f) => {
97
- f.trim() === "=" && (a({
102
+ }), n = !1), o && o.forEach((y) => {
103
+ y.trim() === "=" && (i({
98
104
  type: c.Alert,
99
105
  message: r("custom-conditions.wrong-equality-operators")
100
106
  }), n = !1);
101
- const v = f.match(/^[a-zA-Z]*$/g);
102
- v && v.forEach((C) => {
103
- E(C) && t.push(C);
107
+ const C = y.match(/^[a-zA-Z]*$/g);
108
+ C && C.forEach((E) => {
109
+ b(E) && t.push(E);
104
110
  });
105
111
  });
106
112
  }), t.length) {
107
- const l = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
108
- l.length !== o.length && (a({
113
+ const l = t.filter((a) => a === "if"), o = t.filter((a) => a === "endif");
114
+ l.length !== o.length && (i({
109
115
  type: c.Alert,
110
116
  message: r("custom-conditions.missing-if-endif-tag")
111
117
  }), n = !1);
112
118
  }
113
119
  return n;
114
- }, B = (e) => {
120
+ }, N = (e) => {
115
121
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
116
- return n || a({
122
+ return n || i({
117
123
  type: c.Warning,
118
124
  message: r("custom-conditions.no-space-after-braces")
119
125
  }), n;
120
- }, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
126
+ }, D = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
121
127
  type: c.Warning,
122
128
  message: r("custom-conditions.no-braces-inside-if-tag")
123
- }), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
129
+ }), !1) : !0, F = () => f.hasInvalidBlock() ? (i({
124
130
  type: c.Alert,
125
- message: r(j)
126
- }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
131
+ message: r(z)
132
+ }), !1) : !0, O = () => u.recommendationConfigs && Object.values(u.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
127
133
  type: c.Alert,
128
134
  message: r("newsletter.fill-all-necessary-fields")
129
- }), !1) : !0, D = (e) => {
135
+ }), !1) : !0, B = (e) => {
130
136
  const s = /src="[^"]*\.(svg|pst)"/gm;
131
- return e.match(s) === null ? !0 : (a({
137
+ return e.match(s) === null ? !0 : (i({
132
138
  type: c.Alert,
133
139
  message: r("newsletter.invalid-image-type")
134
140
  }), !1);
135
141
  }, L = (e) => {
136
142
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
137
143
  return Array.from(n).find((o) => {
138
- var i;
139
- return !((i = o.id) != null && i.trim());
140
- }) ? (a({
144
+ var a;
145
+ return !((a = o.id) != null && a.trim());
146
+ }) ? (i({
141
147
  type: c.Alert,
142
148
  message: r("unsubscribe-templates.select-checkbox-groups")
143
149
  }), !1) : !0;
144
- }, V = (e) => {
150
+ }, W = (e) => {
145
151
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
146
152
  return Array.from(n).find((o) => {
147
- var i;
148
- return !((i = o.id) != null && i.trim());
149
- }) ? (a({
153
+ var a;
154
+ return !((a = o.id) != null && a.trim());
155
+ }) ? (i({
150
156
  type: c.Alert,
151
157
  message: r("unsubscribe-templates.select-radio-button-groups")
152
158
  }), !1) : !0;
153
159
  };
154
160
  return { validateHtml: async (e, s, t = !1) => {
155
- var o, i;
161
+ var o, a;
156
162
  const n = [
157
163
  ...s.map((m) => m.value),
158
- ...q,
159
- ...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
164
+ ...j,
165
+ ...((a = (o = g.value) == null ? void 0 : o.template) == null ? void 0 : a.customFieldAttributes) ?? []
160
166
  ];
161
- return await k(e, n, t) && x(e) && I(e) && F(e) && T(e, n) && R(e) && B(e) && W(e) && N() && O() && D(e) && L(e) && V(e);
167
+ return await T(e, n, t) && w(e) && x(e) && _(e) && k(e, n) && R(e) && N(e) && D(e) && F() && O() && B(e) && L(e) && W(e);
162
168
  } };
163
169
  };
164
170
  export {
165
- ge as useHtmlValidator
171
+ Ce as useHtmlValidator
166
172
  };
@@ -1,7 +1,15 @@
1
- const e = "newsletter.already-in-progress", n = "newsletter.campaign-could-not-be-saved", o = / (==|<=|>=|!=|>|<|in) | (if|elif|endif|else|and|or) |("[\S ]+")|('[\S ]+')|([^”\s\n]+)|(({%)|( %}))/gm, a = /{%( )*now( )(".*")( )*%}/gm;
1
+ const n = "newsletter.already-in-progress", e = "newsletter.campaign-could-not-be-saved", s = / (==|<=|>=|!=|>|<|in) | (if|elif|endif|else|and|or) |("[\S ]+")|('[\S ]+')|([^”\s\n]+)|(({%)|( %}))/gm, o = /{%( )*now( )(".*")( )*%}/gm, E = /\{\{[^{}]+\}\}/g, i = /(\s)data-[\w-]+=(?:"[^"]*"|'[^']*')/g, t = /^[A-Za-z0-9_.]+$/, _ = [
2
+ "ins-unsubscribe-link",
3
+ "ins-global-unsubscribe-link",
4
+ "ins-preferences-unsubscribe-link"
5
+ ];
2
6
  export {
3
- n as CampaignCouldNotBeSavedKey,
4
- e as CanNotMakeAnyChangesForRunningKey,
5
- a as DISPLAY_CONDITIONS_EXCEPTIONS_REGEX,
6
- o as DISPLAY_CONDITIONS_REGEX
7
+ _ as ALLOWED_DYNAMIC_SYSTEM_TOKENS,
8
+ e as CampaignCouldNotBeSavedKey,
9
+ n as CanNotMakeAnyChangesForRunningKey,
10
+ i as DATA_ATTRIBUTE_REGEX,
11
+ o as DISPLAY_CONDITIONS_EXCEPTIONS_REGEX,
12
+ s as DISPLAY_CONDITIONS_REGEX,
13
+ E as DYNAMIC_CONTENT_TAG_REGEX,
14
+ t as VALID_DYNAMIC_VARIABLE_REGEX
7
15
  };
@@ -1,4 +1,4 @@
1
- var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r))(c || {});
1
+ var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r.Dark = "dark", r))(c || {});
2
2
  export {
3
3
  c as ToasterTypeOptions
4
4
  };
@@ -1,20 +1,20 @@
1
- import { BlockId as g } from "../../../enums/block.js";
1
+ import { BlockId as u } from "../../../enums/block.js";
2
2
  import { useOnboardingStore as p } from "../../../stores/onboarding.js";
3
- import { getMigrationBannerHtml as f } from "../../../utils/migrationBannerHtml.js";
4
- import { Block as u, BlockCompositionType as I, ModificationDescription as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { SETTINGS_ENUMS as a, DefaultConfigValues as i } from "./enums/settingsEnums.js";
6
- import { getDefaultTemplate as C } from "./template.js";
7
- import { getItemsBlockContainer as y, getItemsBlockConfig as b, getDefaultItemsBlockConfig as h } from "./utils/nodeConfigUtils.js";
8
- const c = g.Items;
9
- class E extends u {
3
+ import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
4
+ import { Block as I, BlockCompositionType as y, ModificationDescription as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { SETTINGS_ENUMS as c, DefaultConfigValues as a } from "./enums/settingsEnums.js";
6
+ import { getDefaultTemplate as h } from "./template.js";
7
+ import { getItemsBlockContainer as l, getItemsBlockConfig as m, getDefaultItemsBlockConfig as b } from "./utils/nodeConfigUtils.js";
8
+ const d = u.Items;
9
+ class E extends I {
10
10
  getId() {
11
- return c;
11
+ return d;
12
12
  }
13
13
  getIcon() {
14
14
  return "items-icon";
15
15
  }
16
16
  getBlockCompositionType() {
17
- return I.CONTAINER;
17
+ return y.CONTAINER;
18
18
  }
19
19
  getName() {
20
20
  return this.api.translate("Items");
@@ -23,41 +23,60 @@ class E extends u {
23
23
  return this.api.translate("Items lets you display personalized products based on user behavior.");
24
24
  }
25
25
  getSettingsPanelTitleHtml() {
26
- return f(
27
- c,
26
+ return C(
27
+ d,
28
28
  this.api.translate("Items"),
29
29
  this.api.translate("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.")
30
30
  );
31
31
  }
32
32
  getTemplate() {
33
- return C({
34
- orientation: a.ORIENTATION.VERTICAL,
35
- itemsType: a.ITEMS_TYPE.CART_ITEMS,
33
+ return h({
34
+ orientation: c.ORIENTATION.VERTICAL,
35
+ itemsType: c.ITEMS_TYPE.CART_ITEMS,
36
36
  itemId: "{{Abandoned Cart Item (1) Url}}",
37
- currencySymbol: i.productPriceCurrencySymbolControlValue,
38
- currencyLocation: i.productPriceCurrencyLocationControlValue,
39
- formattedPrice: i.productPriceFormattedControlValue === "1"
37
+ currencySymbol: a.productPriceCurrencySymbolControlValue,
38
+ currencyLocation: a.productPriceCurrencyLocationControlValue,
39
+ formattedPrice: a.productPriceFormattedControlValue === "1"
40
40
  });
41
41
  }
42
42
  allowInnerBlocksDND() {
43
43
  return !1;
44
44
  }
45
- onCreated(n) {
46
- const l = this.api.getDocumentModifier(), r = this.api.getDocumentRootCssNode();
47
- r.querySelector('[product-attr="imageSrc"] img') || l.modifyCss(r).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
48
- const e = y(n);
49
- if (!e)
45
+ canBeSavedAsModule() {
46
+ return !0;
47
+ }
48
+ onCreated(i) {
49
+ const n = this.api.getDocumentModifier(), r = this.api.getDocumentRootCssNode();
50
+ r.querySelector('[product-attr="imageSrc"] img') || n.modifyCss(r).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
51
+ const t = l(i);
52
+ if (!t)
50
53
  return;
51
- const s = e.getNodeConfig(), m = s && Object.keys(s).length > 0, t = b(n);
52
- if (t != null && t.initialized)
53
- m ? t.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...t, blockInstanceId: String(Date.now()) }).apply(new o("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(t).apply(new o("Migrate legacy config to nodeConfig"));
54
+ const e = t.getNodeConfig(), g = e && Object.keys(e).length > 0, o = m(i);
55
+ if (o != null && o.initialized)
56
+ g ? o.blockInstanceId || this.api.getDocumentModifier().modifyHtml(t).setNodeConfig({ ...o, blockInstanceId: String(Date.now()) }).apply(new s("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(t).setNodeConfig(o).apply(new s("Migrate legacy config to nodeConfig"));
54
57
  else {
55
- const d = h();
56
- this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(d).apply(new o("Initialize Items block with default configuration")), p().startOnboarding("itemsOnboarding");
58
+ const f = b();
59
+ this.api.getDocumentModifier().modifyHtml(t).setNodeConfig(f).apply(new s("Initialize Items block with default configuration")), p().startOnboarding("itemsOnboarding");
57
60
  }
58
61
  }
62
+ /**
63
+ * Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
64
+ * surfaces via document load. Stripo strips esd-ext-config and never restores it
65
+ * into nodeConfig, so without this a reused module would reset to defaults.
66
+ * Guarded to the nodeConfig-empty case so it runs once and never loops.
67
+ */
68
+ onDocumentChanged(i) {
69
+ const n = l(i);
70
+ if (!n)
71
+ return;
72
+ const r = n.getNodeConfig();
73
+ if (r && Object.keys(r).length > 0)
74
+ return;
75
+ const e = m(i);
76
+ e != null && e.initialized && this.api.getDocumentModifier().modifyHtml(n).setNodeConfig(e).apply(new s("Recover Items block config from saved module"));
77
+ }
59
78
  }
60
79
  export {
61
- c as BLOCK_ID,
80
+ d as BLOCK_ID,
62
81
  E as ItemsBlock
63
82
  };