@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.
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
- package/dist/composables/useSave.js +75 -68
- package/dist/composables/validators/useHtmlDocumentCountValidator.js +22 -0
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
- package/dist/config/migrator/recommendation/compositionMapper.js +49 -56
- package/dist/config/migrator/recommendation/extractors.js +29 -68
- package/dist/config/migrator/recommendation/htmlBuilder.js +200 -283
- package/dist/config/migrator/recommendation/settingsMapper.js +32 -35
- package/dist/config/migrator/recommendationMigrator.js +29 -32
- package/dist/extensions/Blocks/Recommendation/block.js +24 -33
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +162 -146
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +2 -1
- package/dist/guido.css +1 -1
- package/dist/services/templateLibraryApi.js +36 -31
- package/dist/src/composables/validators/useHtmlDocumentCountValidator.d.ts +3 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +1 -3
- package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -20
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -3
- package/dist/src/stores/unsubscribe.d.ts +10 -0
- package/dist/src/utils/templatePreparation.d.ts +2 -1
- package/dist/stores/unsubscribe.js +28 -24
- package/dist/utils/pairProductVariables.js +98 -90
- package/dist/utils/templatePreparation.js +30 -30
- package/package.json +1 -1
|
@@ -1,93 +1,54 @@
|
|
|
1
|
-
import { CURRENCY_ATTR as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
var
|
|
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
|
|
8
|
-
const r = (
|
|
9
|
-
return r && r.length > 0 ? r :
|
|
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
|
|
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
|
|
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((
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
return r =
|
|
61
|
-
const
|
|
62
|
-
return
|
|
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
|
|
66
|
-
const e = t.getAttribute(
|
|
29
|
+
function C(t) {
|
|
30
|
+
const e = t.getAttribute(n.CURRENCY);
|
|
67
31
|
if (!e)
|
|
68
32
|
return;
|
|
69
|
-
const r = t.getAttribute(
|
|
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(
|
|
76
|
-
decimalCount: t.getAttribute(
|
|
77
|
-
decimalSeparator: t.getAttribute(
|
|
78
|
-
thousandSeparator: t.getAttribute(
|
|
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
|
|
82
|
-
return t.classList.contains(
|
|
45
|
+
function g(t) {
|
|
46
|
+
return t.classList.contains(c);
|
|
83
47
|
}
|
|
84
48
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
};
|