@useinsider/guido 3.21.2-beta.4b0fed7 → 3.21.2-beta.928b4a8

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 (27) hide show
  1. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  2. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
  3. package/dist/composables/useSave.js +75 -68
  4. package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
  5. package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
  6. package/dist/config/migrator/recommendation/compositionMapper.js +49 -56
  7. package/dist/config/migrator/recommendation/extractors.js +29 -68
  8. package/dist/config/migrator/recommendation/htmlBuilder.js +200 -283
  9. package/dist/config/migrator/recommendation/settingsMapper.js +32 -35
  10. package/dist/config/migrator/recommendationMigrator.js +29 -32
  11. package/dist/extensions/Blocks/Recommendation/block.js +24 -33
  12. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +162 -146
  13. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +2 -1
  14. package/dist/guido.css +1 -1
  15. package/dist/services/templateLibraryApi.js +36 -31
  16. package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
  17. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +1 -3
  18. package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -20
  19. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  20. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -2
  21. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -3
  22. package/dist/src/stores/unsubscribe.d.ts +10 -0
  23. package/dist/src/utils/templatePreparation.d.ts +2 -1
  24. package/dist/stores/unsubscribe.js +28 -24
  25. package/dist/utils/pairProductVariables.js +98 -90
  26. package/dist/utils/templatePreparation.js +30 -30
  27. package/package.json +1 -1
@@ -1,93 +1,54 @@
1
- import { CURRENCY_ATTR as c, CSS_CLASS_SKIP_COMPILE as a } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
2
- const m = "You May Also Like!";
3
- function S(t) {
4
- var o;
1
+ import { CURRENCY_ATTR as n, CSS_CLASS_SKIP_COMPILE as c } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
2
+ const a = "You May Also Like!";
3
+ function A(t) {
4
+ var i;
5
5
  const e = t.querySelector(".ext-recommendation-title");
6
6
  if (!e)
7
- return m;
8
- const r = (o = e.textContent) == null ? void 0 : o.trim();
9
- return r && r.length > 0 ? r : m;
7
+ return a;
8
+ const r = (i = e.textContent) == null ? void 0 : i.trim();
9
+ return r && r.length > 0 ? r : a;
10
10
  }
11
- function T(t) {
11
+ function m(t) {
12
12
  const e = t.querySelector(".ext-recommendation-title");
13
13
  return e ? !/display\s*:\s*none/i.test(e.getAttribute("style") ?? "") : !1;
14
14
  }
15
- function f(t) {
16
- var r;
17
- const e = t.querySelector(".ext-recommendation-title");
18
- return !!e && !((r = e == null ? void 0 : e.textContent) != null && r.trim());
19
- }
20
- function g(t) {
21
- const e = t.querySelector(".ext-product-price"), r = t.querySelector(".ext-product-original-price");
22
- return !e || !r ? !1 : e.compareDocumentPosition(r) === Node.DOCUMENT_POSITION_PRECEDING;
23
- }
24
- const d = /* @__PURE__ */ new Map([
25
- ["p_name", ".ext-product-name p"],
26
- ["p_price", ".ext-product-price p"],
27
- ["p_original_price", ".ext-product-original-price p"]
28
- ]);
29
- function p(t) {
30
- const e = ((t == null ? void 0 : t.getAttribute("style")) ?? "").match(/(?:^|;)\s*color\s*:\s*([^;]+)/i);
31
- return (e == null ? void 0 : e[1].trim()) || void 0;
32
- }
33
- const A = "ins-trim-text";
34
- function x(t, e) {
35
- return t == null ? void 0 : t.map((r) => {
36
- var s, l;
37
- const o = d.get(r.variable ?? "");
38
- if (!o)
39
- return r;
40
- const n = e.querySelector(o), u = (l = (s = r.theme) == null ? void 0 : s.textColor) != null && l.color ? void 0 : p(n), i = r.variable === "p_name" && (n == null ? void 0 : n.classList.contains(A));
41
- return !u && !i ? r : {
42
- ...r,
43
- theme: {
44
- ...r.theme,
45
- ...u ? { textColor: { color: u } } : {},
46
- ...i ? { textTrimming: !0 } : {}
47
- }
48
- };
49
- });
50
- }
51
- function E(t) {
15
+ function d(t) {
52
16
  const e = [
53
17
  t,
54
18
  ...Array.from(t.querySelectorAll(".product-card, .ext-recommendation-card"))
55
19
  ];
56
20
  let r = "";
57
- return e.some((o) => {
58
- const n = o.getAttribute("bgcolor");
59
- if (n && n.trim())
60
- return r = n.trim(), !0;
61
- const i = (o.getAttribute("style") ?? "").match(/background-color\s*:\s*([^;]+)/i);
62
- return i && i[1] ? (r = i[1].trim(), !0) : !1;
21
+ return e.some((i) => {
22
+ const o = i.getAttribute("bgcolor");
23
+ if (o && o.trim())
24
+ return r = o.trim(), !0;
25
+ const u = (i.getAttribute("style") ?? "").match(/background-color\s*:\s*([^;]+)/i);
26
+ return u && u[1] ? (r = u[1].trim(), !0) : !1;
63
27
  }), r;
64
28
  }
65
- function _(t) {
66
- const e = t.getAttribute(c.CURRENCY);
29
+ function C(t) {
30
+ const e = t.getAttribute(n.CURRENCY);
67
31
  if (!e)
68
32
  return;
69
- const r = t.getAttribute(c.SYMBOL);
33
+ const r = t.getAttribute(n.SYMBOL);
70
34
  return {
71
35
  value: e,
72
36
  // An empty `currency-symbol` is omitted so `mapCurrency` falls back to
73
37
  // the currency code as the symbol.
74
38
  ...r ? { symbol: r } : {},
75
- alignment: t.getAttribute(c.ALIGNMENT) ?? "",
76
- decimalCount: t.getAttribute(c.DECIMAL_COUNT) ?? "",
77
- decimalSeparator: t.getAttribute(c.DECIMAL_SEPARATOR) ?? "",
78
- thousandSeparator: t.getAttribute(c.THOUSAND_SEPARATOR) ?? ""
39
+ alignment: t.getAttribute(n.ALIGNMENT) ?? "",
40
+ decimalCount: t.getAttribute(n.DECIMAL_COUNT) ?? "",
41
+ decimalSeparator: t.getAttribute(n.DECIMAL_SEPARATOR) ?? "",
42
+ thousandSeparator: t.getAttribute(n.THOUSAND_SEPARATOR) ?? ""
79
43
  };
80
44
  }
81
- function y(t) {
82
- return t.classList.contains(a);
45
+ function g(t) {
46
+ return t.classList.contains(c);
83
47
  }
84
48
  export {
85
- E as extractCardBgColor,
86
- _ as extractCurrencyFromBlock,
87
- S as extractTitleText,
88
- f as hasEmptyTitle,
89
- T as hasVisibleTitle,
90
- g as isOldPriceFirst,
91
- y as isPartnerManagedBlock,
92
- x as withRenderedTextTheme
49
+ d as extractCardBgColor,
50
+ C as extractCurrencyFromBlock,
51
+ A as extractTitleText,
52
+ m as hasVisibleTitle,
53
+ g as isPartnerManagedBlock
93
54
  };