@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.
- package/README.md +35 -4
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +118 -108
- package/dist/composables/useEditorOpenMetrics.js +167 -0
- package/dist/composables/useStripo.js +93 -82
- 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 +40 -100
- package/dist/config/migrator/recommendation/htmlBuilder.js +207 -285
- package/dist/config/migrator/recommendation/settingsMapper.js +36 -37
- package/dist/config/migrator/recommendation/themeMapper.js +41 -53
- package/dist/config/migrator/recommendationMigrator.js +61 -68
- package/dist/config/migrator/unsubscribeMigrator.js +60 -87
- package/dist/extensions/Blocks/Recommendation/block.js +24 -33
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +19 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +163 -148
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +22 -23
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +18 -19
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +91 -82
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +2 -3
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -10
- package/dist/package.json.js +6 -4
- package/dist/public/prefetchRuntime.js +4 -0
- package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
- package/dist/src/composables/useStripo.d.ts +2 -1
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +1 -3
- package/dist/src/config/migrator/recommendation/extractors.d.ts +6 -35
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +1 -3
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +1 -3
- package/dist/src/config/migrator/recommendation/types.d.ts +1 -11
- 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/templates/utils.d.ts +13 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +19 -2
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/prefetchRuntime.d.ts +1 -0
- package/dist/src/utils/runtimePrefetch.d.ts +4 -0
- package/dist/src/utils/stripoRuntime.d.ts +3 -0
- package/dist/static/stripo-runtime-manifest.json.js +9 -0
- package/dist/utils/runtimePrefetch.js +26 -0
- package/dist/utils/stripoRuntime.js +13 -0
- package/package.json +6 -1
- package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +0 -12
- package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +0 -9
|
@@ -1,114 +1,54 @@
|
|
|
1
|
-
import { CURRENCY_ATTR as
|
|
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
|
|
4
|
-
var
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
3
|
+
function A(t) {
|
|
4
|
+
var i;
|
|
5
|
+
const e = t.querySelector(".ext-recommendation-title");
|
|
6
|
+
if (!e)
|
|
7
7
|
return a;
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const r = (i = e.textContent) == null ? void 0 : i.trim();
|
|
9
|
+
return r && r.length > 0 ? r : a;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
return
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
65
|
-
return
|
|
66
|
-
const o =
|
|
20
|
+
let r = "";
|
|
21
|
+
return e.some((i) => {
|
|
22
|
+
const o = i.getAttribute("bgcolor");
|
|
67
23
|
if (o && o.trim())
|
|
68
|
-
return
|
|
69
|
-
const
|
|
70
|
-
return
|
|
71
|
-
}),
|
|
72
|
-
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
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
|
-
|
|
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
|
-
...
|
|
80
|
-
alignment:
|
|
81
|
-
decimalCount: "
|
|
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
|
-
|
|
87
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
};
|