@useinsider/guido 3.15.0-beta.f5247a0 → 3.15.0-beta.fcabbea
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/@types/config/schemas.js +108 -92
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +78 -75
- package/dist/composables/useActionsApi.js +30 -22
- package/dist/composables/useEmailTemplateApplier.js +25 -23
- package/dist/composables/useHtmlValidator.js +50 -50
- package/dist/composables/useRecommendation.js +20 -19
- package/dist/composables/useTimerClone.js +21 -19
- 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/Items/block.js +44 -42
- package/dist/extensions/Blocks/Items/template.js +86 -86
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +18 -15
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +9 -5
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +363 -322
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +21 -21
- 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/controls/spacing/index.js +113 -98
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -21
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -12
- 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/Recommendation/utils/productIds.js +6 -0
- package/dist/extensions/Blocks/common-control.js +42 -35
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -7
- package/dist/node_modules/valibot/dist/index.js +230 -216
- package/dist/public/trackingIds.js +8 -0
- package/dist/src/@types/config/schemas.d.ts +20 -0
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +4 -0
- 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/controls/spacing/index.d.ts +0 -5
- 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/Recommendation/utils/productIds.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +3 -1
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/trackingIds.d.ts +9 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/utils/linkTrackingIds.d.ts +30 -0
- package/dist/stores/editor.js +4 -1
- package/dist/utils/linkTrackingIds.js +56 -0
- package/dist/utils/pairProductVariables.js +105 -99
- package/dist/utils/templatePreparation.js +72 -61
- package/package.json +5 -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
|