@useinsider/guido 3.12.0-beta.1b68f97 → 3.12.0-beta.29b526b

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 (32) hide show
  1. package/README.md +0 -4
  2. package/dist/@types/config/schemas.js +50 -63
  3. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
  4. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
  5. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  6. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
  7. package/dist/composables/useEmailTemplateApplier.js +49 -30
  8. package/dist/composables/usePreviewInteractionGuard.js +11 -36
  9. package/dist/composables/useRecommendationPreview.js +60 -61
  10. package/dist/composables/useSave.js +24 -43
  11. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  12. package/dist/extensions/Blocks/Recommendation/extension.js +21 -23
  13. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +40 -41
  14. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +2 -3
  15. package/dist/extensions/Blocks/controlFactories.js +75 -125
  16. package/dist/guido.css +1 -1
  17. package/dist/src/@types/config/schemas.d.ts +0 -29
  18. package/dist/src/composables/useConfig.d.ts +0 -4
  19. package/dist/src/composables/useEmailTemplateApplier.d.ts +5 -0
  20. package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
  21. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +0 -1
  22. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -1
  23. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -1
  24. package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -36
  25. package/dist/src/stores/config.d.ts +0 -36
  26. package/package.json +1 -1
  27. package/dist/composables/validators/useAllowlistValidator.js +0 -31
  28. package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +0 -10
  29. package/dist/src/composables/validators/useAllowlistValidator.d.ts +0 -9
  30. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +0 -14
  31. package/dist/src/utils/urlSchemes.d.ts +0 -6
  32. package/dist/utils/urlSchemes.js +0 -4
@@ -1,112 +1,111 @@
1
- import { BLOCK_ROOT_SELECTOR as f, CURRENCY_ATTR as A, CONTAINER_SELECTOR as O } from "../extensions/Blocks/Recommendation/constants/selectors.js";
2
- import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
3
- import { formatPrice as _ } from "../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
- import { BASE_SAFE_URL_SCHEMES as R } from "../utils/urlSchemes.js";
5
- const S = `${f}[recommendation-id]`, h = ".product-old-price", T = /\{\{(?:reco_)?(\d+_\d+_[a-zA-Z0-9_.]+)\}\}/g, b = new RegExp(
1
+ import { BLOCK_ROOT_SELECTOR as S, CURRENCY_ATTR as p, CONTAINER_SELECTOR as O } from "../extensions/Blocks/Recommendation/constants/selectors.js";
2
+ import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
3
+ import { formatPrice as E } from "../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
+ const f = `${S}[recommendation-id]`, C = ".product-old-price", R = /\{\{(?:reco_)?(\d+_\d+_[a-zA-Z0-9_.]+)\}\}/g, T = new RegExp(
6
5
  "\\{%\\s*if\\s+([\\s\\S]+?)\\s*%\\}([\\s\\S]*?)(?:\\{%\\s*else\\s*%\\}([\\s\\S]*?))?\\{%\\s*endif\\s*%\\}",
7
6
  "g"
8
7
  );
9
- function L(e) {
8
+ function b(e) {
10
9
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
11
10
  }
12
- function g(e) {
13
- var c;
14
- const i = (c = e.replace(/[\u0000-\u0020]+/g, "").toLowerCase().match(/^([a-z][a-z0-9+.-]*):/)) == null ? void 0 : c[1];
15
- return i && !R.includes(`${i}:`) ? "" : e;
11
+ function _(e) {
12
+ var s;
13
+ const n = (s = e.replace(/[\u0000-\u0020]+/g, "").toLowerCase().match(/^([a-z][a-z0-9+.-]*):/)) == null ? void 0 : s[1];
14
+ return n && n !== "http" && n !== "https" && n !== "mailto" ? "" : e;
16
15
  }
17
16
  function N(e) {
18
- const t = e.getAttribute(A.CURRENCY) || "USD", i = e.getAttribute(A.DECIMAL_SEPARATOR) || ".", c = e.getAttribute(A.THOUSAND_SEPARATOR) || ",";
17
+ const t = e.getAttribute(p.CURRENCY) || "USD", n = e.getAttribute(p.DECIMAL_SEPARATOR) || ".", s = e.getAttribute(p.THOUSAND_SEPARATOR) || ",";
19
18
  return {
20
19
  code: t,
21
- symbol: e.getAttribute(A.SYMBOL) || t,
22
- alignment: e.getAttribute(A.ALIGNMENT) === "0" ? "before" : "after",
23
- decimalCount: parseInt(e.getAttribute(A.DECIMAL_COUNT) || "2") || 2,
24
- decimalSeparator: i,
25
- thousandSeparator: c
20
+ symbol: e.getAttribute(p.SYMBOL) || t,
21
+ alignment: e.getAttribute(p.ALIGNMENT) === "0" ? "before" : "after",
22
+ decimalCount: parseInt(e.getAttribute(p.DECIMAL_COUNT) || "2") || 2,
23
+ decimalSeparator: n,
24
+ thousandSeparator: s
26
25
  };
27
26
  }
28
- function E(e, t) {
27
+ function g(e, t) {
29
28
  return (e == null ? void 0 : e[t]) ?? Object.values(e ?? {})[0] ?? 0;
30
29
  }
31
- function $(e, t) {
32
- const i = E(e.original_price, t), c = E(e.price, t), n = i > 0 ? Math.round((i - c) / i * 100) : 0;
33
- return n > 0 ? `${n}%` : "0%";
30
+ function L(e, t) {
31
+ const n = g(e.original_price, t), s = g(e.price, t), o = n > 0 ? Math.round((n - s) / n * 100) : 0;
32
+ return o > 0 ? `${o}%` : "0%";
34
33
  }
35
- function P(e, t, i, c, n, a) {
36
- c.forEach((o, s) => {
37
- const r = (m) => `${i}_${s}_${m}`, u = _({ price: E(o.price, n.code), currency: n }), l = _({ price: E(o.original_price, n.code), currency: n }), d = $(o, n.code);
38
- e.set(r("name"), o.name ?? ""), e.set(r("image_url"), g(o.image_url ?? "")), e.set(r("url"), g(o.url ?? "")), e.set(r("item_id"), o.item_id ?? ""), e.set(r("currency"), ""), e.set(r("price"), u), e.set(r("original_price"), l), e.set(r("discount"), d), e.set(r("omnibus_price"), l), e.set(r("omnibus_discount"), d), a && u === l && t.add(`${i}_${s}`), Object.entries(o.product_attributes ?? {}).forEach(([m, p]) => {
39
- e.set(r(`product_attribute.${m}`), String(p)), e.set(r(m), String(p));
34
+ function P(e, t, n, s, o, a) {
35
+ s.forEach((i, c) => {
36
+ const r = (m) => `${n}_${c}_${m}`, u = E({ price: g(i.price, o.code), currency: o }), l = E({ price: g(i.original_price, o.code), currency: o }), d = L(i, o.code);
37
+ e.set(r("name"), i.name ?? ""), e.set(r("image_url"), _(i.image_url ?? "")), e.set(r("url"), _(i.url ?? "")), e.set(r("item_id"), i.item_id ?? ""), e.set(r("currency"), ""), e.set(r("price"), u), e.set(r("original_price"), l), e.set(r("discount"), d), e.set(r("omnibus_price"), l), e.set(r("omnibus_discount"), d), a && u === l && t.add(`${n}_${c}`), Object.entries(i.product_attributes ?? {}).forEach(([m, A]) => {
38
+ e.set(r(`product_attribute.${m}`), String(A)), e.set(r(m), String(A));
40
39
  });
41
40
  });
42
41
  }
43
- function z(e, t) {
44
- const i = e.match(/^(.+?)\s*(!=|==)\s*"([^"]*)"$/);
45
- if (!i)
42
+ function $(e, t) {
43
+ const n = e.match(/^(.+?)\s*(!=|==)\s*"([^"]*)"$/);
44
+ if (!n)
46
45
  return !0;
47
- const [, c, n, a] = i, o = t.get(c.trim()) ?? "";
48
- return n === "!=" ? o !== a : o === a;
46
+ const [, s, o, a] = n, i = t.get(s.trim()) ?? "";
47
+ return o === "!=" ? i !== a : i === a;
49
48
  }
50
- function w(e, t) {
49
+ function z(e, t) {
51
50
  return e.replace(
52
- b,
53
- (i, c, n, a) => c.split(/\s+and\s+/).every((s) => z(s.trim(), t)) ? n : a ?? ""
51
+ T,
52
+ (n, s, o, a) => s.split(/\s+and\s+/).every((c) => $(c.trim(), t)) ? o : a ?? ""
54
53
  );
55
54
  }
56
- function D(e) {
55
+ function w(e) {
57
56
  let t = e;
58
57
  for (; t.children.length === 1; )
59
58
  [t] = t.children;
60
59
  return t;
61
60
  }
62
- function I(e, t) {
63
- var o;
61
+ function D(e, t) {
62
+ var i;
64
63
  if (!t.size)
65
64
  return e;
66
- const i = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), c = new DOMParser().parseFromString(i, "text/html");
67
- c.querySelectorAll(S).forEach((s) => {
68
- const r = Number(s.getAttribute("recommendation-id"));
65
+ const n = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), s = new DOMParser().parseFromString(n, "text/html");
66
+ s.querySelectorAll(f).forEach((c) => {
67
+ const r = Number(c.getAttribute("recommendation-id"));
69
68
  if (!Number.isFinite(r))
70
69
  return;
71
- const u = s.querySelectorAll(O);
72
- (u.length ? Array.from(u) : [s]).forEach((d) => {
73
- d.querySelectorAll(h).forEach((m, p) => {
74
- t.has(`${r}_${p}`) && (D(m).textContent = "");
70
+ const u = c.querySelectorAll(O);
71
+ (u.length ? Array.from(u) : [c]).forEach((d) => {
72
+ d.querySelectorAll(C).forEach((m, A) => {
73
+ t.has(`${r}_${A}`) && (w(m).textContent = "");
75
74
  });
76
75
  });
77
76
  });
78
- const n = (o = e.match(/<!DOCTYPE[^>]*>/i)) == null ? void 0 : o[0];
79
- return ((n ? `${n}
80
- ` : "") + c.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
77
+ const o = (i = e.match(/<!DOCTYPE[^>]*>/i)) == null ? void 0 : i[0];
78
+ return ((o ? `${o}
79
+ ` : "") + s.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
81
80
  }
82
- function y(e) {
81
+ function I(e) {
83
82
  if (!e || !e.includes("recommendation-block-v2"))
84
83
  return e;
85
- const t = C(), i = new DOMParser().parseFromString(e, "text/html"), c = Array.from(i.querySelectorAll(S)), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
86
- if (c.forEach((s) => {
84
+ const t = h(), n = new DOMParser().parseFromString(e, "text/html"), s = Array.from(n.querySelectorAll(f)), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
85
+ if (s.forEach((c) => {
87
86
  var l;
88
- const r = Number(s.getAttribute("recommendation-id"));
87
+ const r = Number(c.getAttribute("recommendation-id"));
89
88
  if (!Number.isFinite(r))
90
89
  return;
91
90
  const u = ((l = t.blockStates[r]) == null ? void 0 : l.recommendationProducts) ?? [];
92
91
  u.length && P(
93
- n,
92
+ o,
94
93
  a,
95
94
  r,
96
95
  u,
97
- N(s),
98
- s.getAttribute("hide-price") === "true"
96
+ N(c),
97
+ c.getAttribute("hide-price") === "true"
99
98
  );
100
- }), !n.size)
99
+ }), !o.size)
101
100
  return e;
102
- let o = I(e, a);
103
- return o = o.replace(
104
- T,
105
- (s, r) => n.has(r) ? L(n.get(r)) : s
106
- ), o = w(o, n), o;
101
+ let i = D(e, a);
102
+ return i = i.replace(
103
+ R,
104
+ (c, r) => o.has(r) ? b(o.get(r)) : c
105
+ ), i = z(i, o), i;
107
106
  }
108
- const q = () => ({ substituteRecommendationPreview: y });
107
+ const q = () => ({ substituteRecommendationPreview: I });
109
108
  export {
110
- y as substituteRecommendationPreview,
109
+ I as substituteRecommendationPreview,
111
110
  q as useRecommendationPreview
112
111
  };
@@ -1,51 +1,32 @@
1
- import { useActionsApi as k } from "./useActionsApi.js";
2
- import { useConfig as B } from "./useConfig.js";
3
- import { useSaveStart as E, useSaveComplete as q } from "./useGuidoActions.js";
4
- import { useSyncModuleExtractor as C } from "./useSyncModuleExtractor.js";
5
- import { ToasterTypeOptions as A } from "../enums/toaster.js";
6
- import { useStripoApi as D } from "../services/stripoApi.js";
7
- import { useTemplatePreparation as L } from "../utils/templatePreparation.js";
8
- import { useHtmlValidator as P } from "./useHtmlValidator.js";
9
- import { useToaster as U } from "./useToaster.js";
10
- import { useAllowlistValidator as M } from "./validators/useAllowlistValidator.js";
11
- import { useCouponBlockValidator as h } from "./validators/useCouponBlockValidator.js";
12
- import { useLiquidValidator as F } from "./validators/useLiquidValidator.js";
13
- import { useUnsubscribeBlockValidator as O } from "./validators/useUnsubscribeBlockValidator.js";
14
- const tt = () => {
15
- const d = E(), c = q(), { validateHtml: m } = P(), { validateLiquidSyntax: u } = F(), { validateCouponBlockTags: p } = h(), { validateUnsubscribeBlockUniqueness: f, validateUnsubscribeBlockHasTemplate: v } = O(), { callbacks: a, isFeatureEnabled: s } = B(), { extractSyncModuleData: S } = C(), { setSyncModuleUnsubscriptionPages: b } = D(), { editorSave: V } = k(), { showToaster: w } = U(), { getBlockedDomains: y } = M();
16
- return { save: async (H = !1, r = !1) => {
17
- var l, e, n;
18
- d();
19
- const { prepareTemplateDetails: g } = L(), t = await g();
20
- if (!p(t.compiledHtml) || !f(t.compiledHtml) || !v(t.compiledHtml))
1
+ import { useActionsApi as H } from "./useActionsApi.js";
2
+ import { useConfig as y } from "./useConfig.js";
3
+ import { useSaveStart as w, useSaveComplete as k } from "./useGuidoActions.js";
4
+ import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
5
+ import { useStripoApi as C } from "../services/stripoApi.js";
6
+ import { useTemplatePreparation as E } from "../utils/templatePreparation.js";
7
+ import { useHtmlValidator as B } from "./useHtmlValidator.js";
8
+ import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
9
+ import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
10
+ import { useUnsubscribeBlockValidator as U } from "./validators/useUnsubscribeBlockValidator.js";
11
+ const K = () => {
12
+ const o = w(), s = k(), { validateHtml: r } = B(), { validateLiquidSyntax: l } = P(), { validateCouponBlockTags: n } = L(), { validateUnsubscribeBlockUniqueness: d, validateUnsubscribeBlockHasTemplate: c } = U(), { callbacks: i, isFeatureEnabled: u } = y(), { extractSyncModuleData: m } = q(), { setSyncModuleUnsubscriptionPages: p } = C(), { editorSave: v } = H();
13
+ return { save: async (f = !1, S = !1) => {
14
+ var a;
15
+ o();
16
+ const { prepareTemplateDetails: V } = E(), t = await V();
17
+ if (!n(t.compiledHtml) || !d(t.compiledHtml) || !c(t.compiledHtml))
21
18
  return;
22
- if (s("liquidSyntax")) {
23
- if (!await u(t.compiledHtml))
19
+ if (u("liquidSyntax")) {
20
+ if (!await l(t.compiledHtml))
24
21
  return;
25
- } else if (!await m(t.compiledHtml, t.dynamicContentList, !0))
22
+ } else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
26
23
  return;
27
- if ((l = a.value) != null && l.externalValidation && !await a.value.externalValidation(t))
24
+ if ((a = i.value) != null && a.externalValidation && !await i.value.externalValidation(t) || !await v())
28
25
  return;
29
- if (s("allowlistEnabled")) {
30
- const o = await y(t.compiledHtml, t.css);
31
- if (o.length) {
32
- if (!r) {
33
- const i = (n = (e = a.value) == null ? void 0 : e.resolveAllowlistToast) == null ? void 0 : n.call(e, o);
34
- i != null && i.message && w({
35
- type: A.Warning,
36
- message: i.message,
37
- actionButton: i.actionButton
38
- });
39
- }
40
- return;
41
- }
42
- }
43
- if (!await V())
44
- return;
45
- const { unsubscribePayload: x, stripoModules: T } = S(t.rawHtml);
46
- return await b(x), t.modules = T, H || c({ ...t, silent: r }), t;
26
+ const { unsubscribePayload: b, stripoModules: x } = m(t.rawHtml);
27
+ return await p(b), t.modules = x, f || s({ ...t, silent: S }), t;
47
28
  } };
48
29
  };
49
30
  export {
50
- tt as useSave
31
+ K as useSave
51
32
  };
@@ -1,4 +1,4 @@
1
- var o = /* @__PURE__ */ ((c) => (c.BLOCK_BACKGROUND = "recommendation-block-background-color-control", c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
1
+ var o = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
2
2
  export {
3
3
  o as RecommendationControlId
4
4
  };
@@ -1,4 +1,4 @@
1
- import { ExtensionBuilder as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { ExtensionBuilder as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { RecommendationBlock as m } from "./block.js";
3
3
  import n from "./canvasPreview.css.js";
4
4
  import { RecommendationBlockControl as i } from "./controls/main/index.js";
@@ -6,44 +6,42 @@ import "./constants/selectors.js";
6
6
  import "./store/recommendation.js";
7
7
  import "./utils/captureStyleTemplates.js";
8
8
  import { NameControls as e } from "./controls/name/index.js";
9
- import { PriceControls as l } from "./controls/price/index.js";
10
- import { OldPriceControls as s } from "./controls/oldPrice/index.js";
9
+ import { PriceControls as s } from "./controls/price/index.js";
10
+ import { OldPriceControls as l } from "./controls/oldPrice/index.js";
11
11
  import { OmnibusPriceControls as p } from "./controls/omnibusPrice/index.js";
12
12
  import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
13
13
  import { ButtonControls as c } from "./controls/button/index.js";
14
- import { ImageControls as C } from "./controls/image/index.js";
15
- import { CustomAttributeControls as f } from "./controls/customAttribute/index.js";
14
+ import { ImageControls as f } from "./controls/image/index.js";
15
+ import { CustomAttributeControls as C } from "./controls/customAttribute/index.js";
16
16
  import { SpacingControl as d } from "./controls/spacing/index.js";
17
- import { BlockBackgroundColorControl as u } from "./controls/blockBackground/index.js";
18
- import { CardBackgroundColorControl as g } from "./controls/cardBackground/index.js";
19
- import { RecommendationCardCompositionControl as y } from "./controls/cardComposition/index.js";
20
- import { SyncInfoMessageControl as B } from "./controls/syncInfoMessage.js";
17
+ import { CardBackgroundColorControl as u } from "./controls/cardBackground/index.js";
18
+ import { RecommendationCardCompositionControl as g } from "./controls/cardComposition/index.js";
19
+ import { SyncInfoMessageControl as y } from "./controls/syncInfoMessage.js";
21
20
  import { RecommendationIconsRegistry as P } from "./iconsRegistry.js";
22
21
  import R from "./recommendation.css.js";
23
22
  import { SettingsPanel as S } from "./settingsPanel.js";
24
- const k = [
23
+ const w = [
25
24
  e,
26
- l,
27
25
  s,
26
+ l,
28
27
  p,
29
28
  a,
30
29
  c,
31
- C,
32
- f
33
- ], w = [
30
+ f,
31
+ C
32
+ ], B = [
34
33
  i,
35
34
  u,
36
- g,
37
35
  d,
38
- y,
39
- B
36
+ g,
37
+ y
40
38
  ], b = [
41
- ...w,
42
- ...k.flatMap((o) => Object.values(o))
43
- ], W = b.reduce(
44
- (o, r) => o.addControl(r),
45
- new t().addBlock(m).withSettingsPanelRegistry(S)
39
+ ...B,
40
+ ...w.flatMap((o) => Object.values(o))
41
+ ], U = b.reduce(
42
+ (o, t) => o.addControl(t),
43
+ new r().addBlock(m).withSettingsPanelRegistry(S)
46
44
  ).addStyles(R).withPreviewStyles(n).withIconsRegistry(P).build();
47
45
  export {
48
- W as default
46
+ U as default
49
47
  };
@@ -1,9 +1,9 @@
1
- import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as I, ContainerControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { BLOCK_ID as R } from "./block.js";
1
+ import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as O, ContainerControls as C, TextControls as R } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { BLOCK_ID as U } from "./block.js";
3
3
  import { RecommendationBlockId as S } from "./constants/blockIds.js";
4
4
  import { RecommendationControlId as T } from "./constants/controlIds.js";
5
5
  import "./constants/selectors.js";
6
- import { CONTROL_BLOCK_ID as U } from "./controls/main/index.js";
6
+ import { CONTROL_BLOCK_ID as A } from "./controls/main/index.js";
7
7
  import "./store/recommendation.js";
8
8
  import "./utils/captureStyleTemplates.js";
9
9
  import "./controls/name/index.js";
@@ -13,38 +13,37 @@ import "./controls/omnibusPrice/index.js";
13
13
  import "./controls/omnibusDiscount/index.js";
14
14
  import "./controls/button/index.js";
15
15
  import "./controls/image/index.js";
16
- import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
17
- import "./controls/blockBackground/index.js";
18
- import { CARD_BACKGROUND_COLOR_CONTROL_ID as L } from "./controls/cardBackground/index.js";
19
- import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
16
+ import { SPACING_CONTROL_ID as L } from "./controls/spacing/index.js";
17
+ import { CARD_BACKGROUND_COLOR_CONTROL_ID as D } from "./controls/cardBackground/index.js";
18
+ import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
20
19
  import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
21
- class s extends E {
22
- registerBlockControls(O) {
23
- O[R] = [
20
+ class d extends E {
21
+ registerBlockControls(I) {
22
+ I[U] = [
24
23
  new _(
25
- I.SETTINGS,
24
+ O.SETTINGS,
26
25
  [
27
- U,
26
+ A,
28
27
  C.EXTERNAL_INDENTS
29
28
  ]
30
29
  ),
31
30
  new _(
32
- I.STYLES,
31
+ O.STYLES,
33
32
  [
34
- T.BLOCK_BACKGROUND,
35
- L,
36
- A
33
+ R.TEXT_BLOCK_BACKGROUND_COLOR,
34
+ D,
35
+ L
37
36
  ]
38
37
  ),
39
38
  new _(
40
39
  "Card Composition",
41
40
  [
42
- D
41
+ B
43
42
  ]
44
43
  ).withLabel(this.api.translate("Card Composition"))
45
- ], O[S.NAME] = [
44
+ ], I[S.NAME] = [
46
45
  new _(
47
- I.SETTINGS,
46
+ O.SETTINGS,
48
47
  [
49
48
  N,
50
49
  T.NAME_STYLE,
@@ -54,7 +53,7 @@ class s extends E {
54
53
  ]
55
54
  ),
56
55
  new _(
57
- I.STYLES,
56
+ O.STYLES,
58
57
  [
59
58
  T.NAME_BACKGROUND,
60
59
  T.NAME_FONT_FAMILY,
@@ -62,9 +61,9 @@ class s extends E {
62
61
  T.NAME_COLOR
63
62
  ]
64
63
  )
65
- ], O[S.PRICE] = [
64
+ ], I[S.PRICE] = [
66
65
  new _(
67
- I.SETTINGS,
66
+ O.SETTINGS,
68
67
  [
69
68
  N,
70
69
  T.PRICE_STYLE,
@@ -73,7 +72,7 @@ class s extends E {
73
72
  ]
74
73
  ),
75
74
  new _(
76
- I.STYLES,
75
+ O.STYLES,
77
76
  [
78
77
  T.PRICE_BACKGROUND,
79
78
  T.PRICE_FONT_FAMILY,
@@ -81,9 +80,9 @@ class s extends E {
81
80
  T.PRICE_COLOR
82
81
  ]
83
82
  )
84
- ], O[S.OLD_PRICE] = [
83
+ ], I[S.OLD_PRICE] = [
85
84
  new _(
86
- I.SETTINGS,
85
+ O.SETTINGS,
87
86
  [
88
87
  N,
89
88
  T.OLD_PRICE_STYLE,
@@ -92,7 +91,7 @@ class s extends E {
92
91
  ]
93
92
  ),
94
93
  new _(
95
- I.STYLES,
94
+ O.STYLES,
96
95
  [
97
96
  T.OLD_PRICE_BACKGROUND,
98
97
  T.OLD_PRICE_FONT_FAMILY,
@@ -100,9 +99,9 @@ class s extends E {
100
99
  T.OLD_PRICE_COLOR
101
100
  ]
102
101
  )
103
- ], O[S.OMNIBUS_PRICE] = [
102
+ ], I[S.OMNIBUS_PRICE] = [
104
103
  new _(
105
- I.SETTINGS,
104
+ O.SETTINGS,
106
105
  [
107
106
  N,
108
107
  T.OMNIBUS_PRICE_TEXT_BEFORE,
@@ -113,7 +112,7 @@ class s extends E {
113
112
  ]
114
113
  ),
115
114
  new _(
116
- I.STYLES,
115
+ O.STYLES,
117
116
  [
118
117
  T.OMNIBUS_PRICE_BACKGROUND,
119
118
  T.OMNIBUS_PRICE_FONT_FAMILY,
@@ -121,9 +120,9 @@ class s extends E {
121
120
  T.OMNIBUS_PRICE_COLOR
122
121
  ]
123
122
  )
124
- ], O[S.OMNIBUS_DISCOUNT] = [
123
+ ], I[S.OMNIBUS_DISCOUNT] = [
125
124
  new _(
126
- I.SETTINGS,
125
+ O.SETTINGS,
127
126
  [
128
127
  N,
129
128
  T.OMNIBUS_DISCOUNT_TEXT_BEFORE,
@@ -134,7 +133,7 @@ class s extends E {
134
133
  ]
135
134
  ),
136
135
  new _(
137
- I.STYLES,
136
+ O.STYLES,
138
137
  [
139
138
  T.OMNIBUS_DISCOUNT_BACKGROUND,
140
139
  T.OMNIBUS_DISCOUNT_FONT_FAMILY,
@@ -142,9 +141,9 @@ class s extends E {
142
141
  T.OMNIBUS_DISCOUNT_COLOR
143
142
  ]
144
143
  )
145
- ], O[S.BUTTON] = [
144
+ ], I[S.BUTTON] = [
146
145
  new _(
147
- I.SETTINGS,
146
+ O.SETTINGS,
148
147
  [
149
148
  N,
150
149
  T.BUTTON_TEXT,
@@ -154,7 +153,7 @@ class s extends E {
154
153
  ]
155
154
  ),
156
155
  new _(
157
- I.STYLES,
156
+ O.STYLES,
158
157
  [
159
158
  T.BUTTON_COLOR,
160
159
  T.BUTTON_FONT_FAMILY,
@@ -165,9 +164,9 @@ class s extends E {
165
164
  T.BUTTON_BORDER
166
165
  ]
167
166
  )
168
- ], O[S.CUSTOM_ATTRIBUTE] = [
167
+ ], I[S.CUSTOM_ATTRIBUTE] = [
169
168
  new _(
170
- I.SETTINGS,
169
+ O.SETTINGS,
171
170
  [
172
171
  T.CUSTOM_ATTR_STYLE,
173
172
  T.CUSTOM_ATTR_ALIGN,
@@ -176,7 +175,7 @@ class s extends E {
176
175
  ]
177
176
  ),
178
177
  new _(
179
- I.STYLES,
178
+ O.STYLES,
180
179
  [
181
180
  T.CUSTOM_ATTR_BACKGROUND,
182
181
  T.CUSTOM_ATTR_FONT_FAMILY,
@@ -184,9 +183,9 @@ class s extends E {
184
183
  T.CUSTOM_ATTR_COLOR
185
184
  ]
186
185
  )
187
- ], O[S.IMAGE] = [
186
+ ], I[S.IMAGE] = [
188
187
  new _(
189
- I.SETTINGS,
188
+ O.SETTINGS,
190
189
  [
191
190
  N,
192
191
  T.IMAGE_SIZE,
@@ -197,5 +196,5 @@ class s extends E {
197
196
  }
198
197
  }
199
198
  export {
200
- s as SettingsPanel
199
+ d as SettingsPanel
201
200
  };
@@ -5,10 +5,9 @@ const s = {
5
5
  PAGE_TYPE: "data-unsubscribe-page-type",
6
6
  PAGE_LIST: "data-unsubscribe-page-list",
7
7
  BLOCK_ID: "data-unsubscribe-block-id"
8
- }, c = ".unsubscribe-block-v2", u = 'a[data-unsubscribe-link="true"], a.unsubscribe-link';
8
+ }, c = ".unsubscribe-block-v2";
9
9
  export {
10
10
  b as DATA_ATTRIBUTES,
11
11
  c as UNSUBSCRIBE_BLOCK_SELECTOR,
12
- s as UNSUBSCRIBE_EVENTS,
13
- u as UNSUBSCRIBE_LINK_SELECTOR
12
+ s as UNSUBSCRIBE_EVENTS
14
13
  };