@useinsider/guido 3.14.1-beta.9ad6513 → 3.15.0-beta.0b5dc39
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/composables/useEmailTemplateApplier.js +46 -32
- package/dist/composables/useHtmlValidator.js +105 -100
- package/dist/composables/useStripo.js +30 -29
- package/dist/config/i18n/en/labels.json.js +7 -3
- package/dist/config/migrator/recommendation/compositionMapper.js +26 -23
- package/dist/config/migrator/recommendation/htmlBuilder.js +156 -155
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +18 -15
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +363 -322
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +271 -231
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +16 -16
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +16 -16
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +120 -120
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +55 -54
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +89 -0
- package/dist/extensions/Blocks/common-control.js +42 -35
- package/dist/src/composables/useHtmlValidator.d.ts +3 -2
- package/dist/src/config/migrator/recommendation/types.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +27 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -11
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +47 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +3 -1
- package/dist/src/stores/dynamic-content.d.ts +8 -0
- package/dist/src/utils/registerUsedDynamicContent.d.ts +8 -0
- package/dist/stores/dynamic-content.js +12 -2
- package/dist/utils/registerUsedDynamicContent.js +23 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_COMPOSITION as
|
|
1
|
+
import { DEFAULT_COMPOSITION as p, DEFAULT_VISIBILITY as I } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
2
2
|
import { ATTR_CUSTOM_PREFIX as l, ATTR_PRODUCT_BUTTON as k, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_OMNIBUS_PRICE as x, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as R, ATTR_PRODUCT_NAME as h, ATTR_PRODUCT_IMAGE as y } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
3
3
|
import { mapTextTheme as E, mapButtonTheme as O, mapImageTheme as b } from "./themeMapper.js";
|
|
4
4
|
const C = "__title__", a = "product_attribute.";
|
|
@@ -23,19 +23,22 @@ function N(r) {
|
|
|
23
23
|
return { key: k, kind: "button" };
|
|
24
24
|
default:
|
|
25
25
|
if (r.variableType === "p_attribute" || t.startsWith("p_attribute_")) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const o = r.value ?? "", s = o.startsWith(a) ? o.slice(a.length) : o;
|
|
27
|
+
if (!s)
|
|
28
|
+
return null;
|
|
29
|
+
const e = o || `${a}${s}`;
|
|
30
|
+
return {
|
|
31
|
+
key: `${l}${e}`,
|
|
29
32
|
kind: "custom",
|
|
30
|
-
customAttrName:
|
|
31
|
-
customAttrValue:
|
|
32
|
-
}
|
|
33
|
+
customAttrName: s,
|
|
34
|
+
customAttrValue: e
|
|
35
|
+
};
|
|
33
36
|
}
|
|
34
37
|
return null;
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
function
|
|
38
|
-
const t =
|
|
40
|
+
function _(r) {
|
|
41
|
+
const t = p.indexOf(r);
|
|
39
42
|
return t === -1 ? Number.POSITIVE_INFINITY : t;
|
|
40
43
|
}
|
|
41
44
|
function S(r) {
|
|
@@ -48,8 +51,8 @@ function S(r) {
|
|
|
48
51
|
anyTextTrimming: !1
|
|
49
52
|
};
|
|
50
53
|
if (!r || r.length === 0)
|
|
51
|
-
return t.composition = [...
|
|
52
|
-
const
|
|
54
|
+
return t.composition = [...p], t;
|
|
55
|
+
const o = [];
|
|
53
56
|
r.forEach((e, i) => {
|
|
54
57
|
const n = N(e);
|
|
55
58
|
if (n) {
|
|
@@ -57,7 +60,7 @@ function S(r) {
|
|
|
57
60
|
t.titleVariable = e;
|
|
58
61
|
return;
|
|
59
62
|
}
|
|
60
|
-
|
|
63
|
+
o.push({
|
|
61
64
|
key: n.key,
|
|
62
65
|
kind: n.kind,
|
|
63
66
|
hidden: e.hidden === !0,
|
|
@@ -68,30 +71,30 @@ function S(r) {
|
|
|
68
71
|
originalIndex: i
|
|
69
72
|
});
|
|
70
73
|
}
|
|
71
|
-
}),
|
|
74
|
+
}), o.sort((e, i) => {
|
|
72
75
|
if (e.positionIdx !== i.positionIdx)
|
|
73
76
|
return e.positionIdx - i.positionIdx;
|
|
74
|
-
const n =
|
|
77
|
+
const n = _(e.key), u = _(i.key);
|
|
75
78
|
return n !== u ? n - u : e.originalIndex - i.originalIndex;
|
|
76
79
|
});
|
|
77
|
-
const
|
|
78
|
-
return
|
|
79
|
-
const { key: i, kind: n, hidden: u, legacy:
|
|
80
|
-
switch (t.composition.push(i), t.visibility[i] = !u, n === "custom" &&
|
|
80
|
+
const s = {};
|
|
81
|
+
return o.forEach((e) => {
|
|
82
|
+
const { key: i, kind: n, hidden: u, legacy: c, customAttrName: d, customAttrValue: m } = e;
|
|
83
|
+
switch (t.composition.push(i), t.visibility[i] = !u, n === "custom" && d && m && (t.customAttributes.includes(m) || t.customAttributes.push(m), t.customAttrValues[i] = m), n) {
|
|
81
84
|
case "image":
|
|
82
|
-
|
|
85
|
+
s[i] = b(c.theme);
|
|
83
86
|
break;
|
|
84
87
|
case "button":
|
|
85
|
-
|
|
88
|
+
s[i] = O(c.theme);
|
|
86
89
|
break;
|
|
87
90
|
case "text":
|
|
88
91
|
case "custom": {
|
|
89
|
-
const
|
|
90
|
-
|
|
92
|
+
const T = E(c.theme);
|
|
93
|
+
s[i] = T, T.textTrimming && (t.anyTextTrimming = !0);
|
|
91
94
|
break;
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
|
-
}), t.perElementStyles =
|
|
97
|
+
}), t.perElementStyles = s, t;
|
|
95
98
|
}
|
|
96
99
|
export {
|
|
97
100
|
S as mapComposition
|