@useinsider/guido 3.22.0-beta.e1b5da2 → 3.22.0-beta.e9b6f94

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 (45) hide show
  1. package/README.md +35 -4
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +118 -108
  4. package/dist/composables/useEditorOpenMetrics.js +167 -0
  5. package/dist/composables/useStripo.js +93 -82
  6. package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
  7. package/dist/config/migrator/recommendation/compositionMapper.js +49 -56
  8. package/dist/config/migrator/recommendation/extractors.js +40 -100
  9. package/dist/config/migrator/recommendation/htmlBuilder.js +207 -285
  10. package/dist/config/migrator/recommendation/settingsMapper.js +36 -37
  11. package/dist/config/migrator/recommendation/themeMapper.js +41 -53
  12. package/dist/config/migrator/recommendationMigrator.js +61 -68
  13. package/dist/config/migrator/unsubscribeMigrator.js +60 -87
  14. package/dist/extensions/Blocks/Recommendation/block.js +24 -33
  15. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +19 -20
  16. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +163 -148
  17. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +22 -23
  18. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +18 -19
  19. package/dist/extensions/Blocks/Recommendation/templates/utils.js +91 -82
  20. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +2 -3
  21. package/dist/guido.css +1 -1
  22. package/dist/library.js +12 -10
  23. package/dist/package.json.js +6 -4
  24. package/dist/public/prefetchRuntime.js +4 -0
  25. package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
  26. package/dist/src/composables/useStripo.d.ts +2 -1
  27. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +1 -3
  28. package/dist/src/config/migrator/recommendation/extractors.d.ts +6 -35
  29. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +1 -3
  30. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +1 -3
  31. package/dist/src/config/migrator/recommendation/types.d.ts +1 -11
  32. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  33. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -2
  34. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +13 -1
  35. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +19 -2
  36. package/dist/src/library.d.ts +1 -0
  37. package/dist/src/public/prefetchRuntime.d.ts +1 -0
  38. package/dist/src/utils/runtimePrefetch.d.ts +4 -0
  39. package/dist/src/utils/stripoRuntime.d.ts +3 -0
  40. package/dist/static/stripo-runtime-manifest.json.js +9 -0
  41. package/dist/utils/runtimePrefetch.js +26 -0
  42. package/dist/utils/stripoRuntime.js +13 -0
  43. package/package.json +6 -1
  44. package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +0 -12
  45. package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +0 -9
@@ -1,114 +1,54 @@
1
- import { CURRENCY_ATTR as l, CSS_CLASS_SKIP_COMPILE as m } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
1
+ import { CURRENCY_ATTR as n, CSS_CLASS_SKIP_COMPILE as c } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
2
2
  const a = "You May Also Like!";
3
- function C(e) {
4
- var n;
5
- const r = e.querySelector(".ext-recommendation-title");
6
- if (!r)
3
+ function A(t) {
4
+ var i;
5
+ const e = t.querySelector(".ext-recommendation-title");
6
+ if (!e)
7
7
  return a;
8
- const t = (n = r.textContent) == null ? void 0 : n.trim();
9
- return t && t.length > 0 ? t : a;
8
+ const r = (i = e.textContent) == null ? void 0 : i.trim();
9
+ return r && r.length > 0 ? r : a;
10
10
  }
11
- function A(e) {
12
- const r = e.querySelector(".ext-recommendation-title");
13
- return r ? !/display\s*:\s*none/i.test(r.getAttribute("style") ?? "") : !1;
11
+ function m(t) {
12
+ const e = t.querySelector(".ext-recommendation-title");
13
+ return e ? !/display\s*:\s*none/i.test(e.getAttribute("style") ?? "") : !1;
14
14
  }
15
- function _(e) {
16
- var t;
17
- const r = e.querySelector(".ext-recommendation-title");
18
- return !!r && !((t = r == null ? void 0 : r.textContent) != null && t.trim());
19
- }
20
- function E(e) {
21
- const r = e.querySelector(".ext-product-price"), t = e.querySelector(".ext-product-original-price");
22
- return !r || !t ? !1 : r.compareDocumentPosition(t) === Node.DOCUMENT_POSITION_PRECEDING;
23
- }
24
- function d(e) {
25
- return /(?:^|;)\s*display\s*:\s*table-cell/i.test(e.getAttribute("style") ?? "");
26
- }
27
- function T(e) {
28
- var n, o;
29
- const r = (n = e.querySelector(".ext-product-price")) == null ? void 0 : n.closest("tr"), t = (o = e.querySelector(".ext-product-original-price")) == null ? void 0 : o.closest("tr");
30
- return !r || !t || r === t ? !1 : !d(r) && !d(t);
31
- }
32
- const p = /* @__PURE__ */ new Map([
33
- ["p_name", ".ext-product-name p"],
34
- ["p_price", ".ext-product-price p"],
35
- ["p_original_price", ".ext-product-original-price p"]
36
- ]);
37
- function f(e) {
38
- const r = ((e == null ? void 0 : e.getAttribute("style")) ?? "").match(/(?:^|;)\s*color\s*:\s*([^;]+)/i);
39
- return (r == null ? void 0 : r[1].trim()) || void 0;
40
- }
41
- const x = "ins-trim-text";
42
- function h(e, r) {
43
- return e == null ? void 0 : e.map((t) => {
44
- var s, u;
45
- const n = p.get(t.variable ?? "");
46
- if (!n)
47
- return t;
48
- const o = r.querySelector(n), c = (u = (s = t.theme) == null ? void 0 : s.textColor) != null && u.color ? void 0 : f(o), i = t.variable === "p_name" && (o == null ? void 0 : o.classList.contains(x));
49
- return !c && !i ? t : {
50
- ...t,
51
- theme: {
52
- ...t.theme,
53
- ...c ? { textColor: { color: c } } : {},
54
- ...i ? { textTrimming: !0 } : {}
55
- }
56
- };
57
- });
58
- }
59
- function R(e) {
60
- const r = [
61
- e,
62
- ...Array.from(e.querySelectorAll(".product-card, .ext-recommendation-card"))
15
+ function d(t) {
16
+ const e = [
17
+ t,
18
+ ...Array.from(t.querySelectorAll(".product-card, .ext-recommendation-card"))
63
19
  ];
64
- let t = "";
65
- return r.some((n) => {
66
- const o = n.getAttribute("bgcolor");
20
+ let r = "";
21
+ return e.some((i) => {
22
+ const o = i.getAttribute("bgcolor");
67
23
  if (o && o.trim())
68
- return t = o.trim(), !0;
69
- const i = (n.getAttribute("style") ?? "").match(/background-color\s*:\s*([^;]+)/i);
70
- return i && i[1] ? (t = i[1].trim(), !0) : !1;
71
- }), t;
72
- }
73
- function L(e) {
74
- const r = e.getAttribute(l.CURRENCY), t = e.getAttribute(l.SYMBOL);
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;
27
+ }), r;
28
+ }
29
+ function C(t) {
30
+ const e = t.getAttribute(n.CURRENCY);
31
+ if (!e)
32
+ return;
33
+ const r = t.getAttribute(n.SYMBOL);
75
34
  return {
76
- ...r ? { value: r } : {},
35
+ value: e,
77
36
  // An empty `currency-symbol` is omitted so `mapCurrency` falls back to
78
37
  // the currency code as the symbol.
79
- ...t ? { symbol: t } : {},
80
- alignment: 1,
81
- decimalCount: "2",
82
- decimalSeparator: ",",
83
- thousandSeparator: "."
38
+ ...r ? { symbol: r } : {},
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) ?? ""
84
43
  };
85
44
  }
86
- const S = /^es-p(\d+)([trbl]?)$/, g = { t: "top", r: "right", b: "bottom", l: "left" };
87
- function P(e) {
88
- const r = e.querySelector("td.esd-structure.esd-extension-internal-block");
89
- if (!r)
90
- return;
91
- const t = { top: 0, right: 0, bottom: 0, left: 0 };
92
- return r.classList.forEach((n) => {
93
- const o = n.match(S);
94
- if (!o)
95
- return;
96
- const c = Number(o[1]), i = o[2];
97
- i ? t[g[i]] = c : Object.assign(t, { top: c, right: c, bottom: c, left: c });
98
- }), t;
99
- }
100
- function I(e) {
101
- return e.classList.contains(m);
45
+ function g(t) {
46
+ return t.classList.contains(c);
102
47
  }
103
48
  export {
104
- R as extractCardBgColor,
105
- L as extractCurrencyFromBlock,
106
- P as extractRenderedBlockPadding,
107
- C as extractTitleText,
108
- _ as hasEmptyTitle,
109
- A as hasVisibleTitle,
110
- E as isOldPriceFirst,
111
- I as isPartnerManagedBlock,
112
- T as isPriceOnNextLine,
113
- h as withRenderedTextTheme
49
+ d as extractCardBgColor,
50
+ C as extractCurrencyFromBlock,
51
+ A as extractTitleText,
52
+ m as hasVisibleTitle,
53
+ g as isPartnerManagedBlock
114
54
  };