@useinsider/guido 3.21.2-beta.4c14c74 → 3.21.2-beta.5a809f7
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/config/compiler/utils/recommendationCompilerUtils.js +22 -22
- package/dist/config/migrator/recommendation/compositionMapper.js +56 -49
- package/dist/config/migrator/recommendation/extractors.js +74 -26
- package/dist/config/migrator/recommendation/htmlBuilder.js +279 -202
- package/dist/config/migrator/recommendation/settingsMapper.js +37 -36
- package/dist/config/migrator/recommendationMigrator.js +65 -59
- package/dist/extensions/Blocks/Items/controls/button/link.js +17 -14
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +17 -14
- package/dist/extensions/Blocks/Items/controls/image/link.js +17 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +10 -9
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +13 -12
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +30 -29
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +16 -15
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +26 -25
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +28 -27
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +80 -75
- package/dist/extensions/Blocks/Recommendation/block.js +33 -24
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +27 -26
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +216 -236
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +15 -15
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +23 -22
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +19 -18
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +82 -91
- package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +12 -0
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +3 -2
- package/dist/extensions/Blocks/common-control.js +55 -62
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/extractors.d.ts +26 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +4 -11
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -13
- package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -19
- package/dist/src/extensions/Blocks/common-control.d.ts +0 -2
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ModificationDescription as l } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CommonControl as
|
|
2
|
+
import { CommonControl as u } from "../../../common-control.js";
|
|
3
3
|
import { RecommendationBlockId as a } from "../../constants/blockIds.js";
|
|
4
|
-
import { RecommendationControlId as
|
|
4
|
+
import { RecommendationControlId as d } from "../../constants/controlIds.js";
|
|
5
5
|
import { BLOCK_ROOT_SELECTOR as m } from "../../constants/selectors.js";
|
|
6
6
|
import { CSS_CLASS_TEXT_TRIM as r, ensureTextTrimCssRulesExist as T } from "../shared/textTrimCssRules.js";
|
|
7
7
|
const s = {
|
|
8
8
|
TEXT_TRIM_ENABLED: "textTrimEnabled"
|
|
9
9
|
};
|
|
10
|
-
class N extends
|
|
10
|
+
class N extends u {
|
|
11
11
|
getId() {
|
|
12
|
-
return
|
|
12
|
+
return d.NAME_TEXT_TRIM;
|
|
13
13
|
}
|
|
14
14
|
getTemplate() {
|
|
15
15
|
return `
|
|
@@ -23,7 +23,7 @@ class N extends d {
|
|
|
23
23
|
`;
|
|
24
24
|
}
|
|
25
25
|
onRender() {
|
|
26
|
-
this.
|
|
26
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
27
27
|
}
|
|
28
28
|
onTemplateNodeUpdated(e) {
|
|
29
29
|
super.onTemplateNodeUpdated(e), this._setFormValues();
|
|
@@ -4,8 +4,8 @@ import { CommonControl as l } from "../../../common-control.js";
|
|
|
4
4
|
import { RecommendationBlockId as d } from "../../constants/blockIds.js";
|
|
5
5
|
import { RecommendationControlId as T } from "../../constants/controlIds.js";
|
|
6
6
|
import { BLOCK_ROOT_SELECTOR as f } from "../../constants/selectors.js";
|
|
7
|
-
const
|
|
8
|
-
class
|
|
7
|
+
const i = "data-text-after", u = "", p = ".omnibus-text-after";
|
|
8
|
+
class g extends l {
|
|
9
9
|
getId() {
|
|
10
10
|
return T.OMNIBUS_DISCOUNT_TEXT_AFTER;
|
|
11
11
|
}
|
|
@@ -24,7 +24,7 @@ class N extends l {
|
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
26
26
|
onRender() {
|
|
27
|
-
this.
|
|
27
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
28
28
|
}
|
|
29
29
|
onTemplateNodeUpdated(t) {
|
|
30
30
|
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
@@ -38,7 +38,7 @@ class N extends l {
|
|
|
38
38
|
_getCurrentText() {
|
|
39
39
|
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
40
40
|
return u;
|
|
41
|
-
const t = this.currentNode.getAttribute(
|
|
41
|
+
const t = this.currentNode.getAttribute(i);
|
|
42
42
|
return t === null ? u : t;
|
|
43
43
|
}
|
|
44
44
|
_onTextChange(t) {
|
|
@@ -53,9 +53,9 @@ class N extends l {
|
|
|
53
53
|
if (!n.length)
|
|
54
54
|
return;
|
|
55
55
|
const o = this.api.getDocumentModifier();
|
|
56
|
-
n.forEach((
|
|
57
|
-
o.modifyHtml(
|
|
58
|
-
const r =
|
|
56
|
+
n.forEach((s) => {
|
|
57
|
+
o.modifyHtml(s).setAttribute(i, t);
|
|
58
|
+
const r = s.querySelector(p);
|
|
59
59
|
if (r) {
|
|
60
60
|
const a = m(r, t);
|
|
61
61
|
o.modifyHtml(r).setInnerHtml(a);
|
|
@@ -69,5 +69,5 @@ class N extends l {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
g as OmnibusDiscountTextAfterControl
|
|
73
73
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { preserveTextStyles as
|
|
1
|
+
import { preserveTextStyles as a } from "../../../../../utils/preserveTextStyles.js";
|
|
2
2
|
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
3
|
import { CommonControl as l } from "../../../common-control.js";
|
|
4
4
|
import { RecommendationBlockId as d } from "../../constants/blockIds.js";
|
|
5
|
-
import { RecommendationControlId as
|
|
6
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
5
|
+
import { RecommendationControlId as T } from "../../constants/controlIds.js";
|
|
6
|
+
import { BLOCK_ROOT_SELECTOR as f } from "../../constants/selectors.js";
|
|
7
|
+
const i = "data-text-before", u = "", p = ".omnibus-text-before";
|
|
8
|
+
class g extends l {
|
|
9
9
|
getId() {
|
|
10
|
-
return
|
|
10
|
+
return T.OMNIBUS_DISCOUNT_TEXT_BEFORE;
|
|
11
11
|
}
|
|
12
12
|
getTemplate() {
|
|
13
13
|
return `
|
|
@@ -24,7 +24,7 @@ class B extends l {
|
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
26
26
|
onRender() {
|
|
27
|
-
this.
|
|
27
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
28
28
|
}
|
|
29
29
|
onTemplateNodeUpdated(t) {
|
|
30
30
|
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
@@ -38,13 +38,13 @@ class B extends l {
|
|
|
38
38
|
_getCurrentText() {
|
|
39
39
|
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
40
40
|
return u;
|
|
41
|
-
const t = this.currentNode.getAttribute(
|
|
41
|
+
const t = this.currentNode.getAttribute(i);
|
|
42
42
|
return t === null ? u : t;
|
|
43
43
|
}
|
|
44
44
|
_onTextChange(t) {
|
|
45
45
|
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
46
|
return;
|
|
47
|
-
const e = this.currentNode.closest(
|
|
47
|
+
const e = this.currentNode.closest(f);
|
|
48
48
|
if (!e || !("querySelectorAll" in e))
|
|
49
49
|
return;
|
|
50
50
|
const n = Array.from(
|
|
@@ -53,12 +53,12 @@ class B extends l {
|
|
|
53
53
|
if (!n.length)
|
|
54
54
|
return;
|
|
55
55
|
const o = this.api.getDocumentModifier();
|
|
56
|
-
n.forEach((
|
|
57
|
-
o.modifyHtml(
|
|
58
|
-
const r =
|
|
56
|
+
n.forEach((s) => {
|
|
57
|
+
o.modifyHtml(s).setAttribute(i, t);
|
|
58
|
+
const r = s.querySelector(p);
|
|
59
59
|
if (r) {
|
|
60
|
-
const
|
|
61
|
-
o.modifyHtml(r).setInnerHtml(
|
|
60
|
+
const m = a(r, t);
|
|
61
|
+
o.modifyHtml(r).setInnerHtml(m);
|
|
62
62
|
}
|
|
63
63
|
}), o.apply(new c("Update omnibus discount text before"));
|
|
64
64
|
}
|
|
@@ -69,5 +69,5 @@ class B extends l {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
g as OmnibusDiscountTextBeforeControl
|
|
73
73
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { preserveTextStyles as
|
|
2
|
-
import { ModificationDescription as
|
|
3
|
-
import { CommonControl as
|
|
1
|
+
import { preserveTextStyles as u } from "../../../../../utils/preserveTextStyles.js";
|
|
2
|
+
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { CommonControl as l } from "../../../common-control.js";
|
|
4
4
|
import { RecommendationBlockId as d } from "../../constants/blockIds.js";
|
|
5
5
|
import { RecommendationControlId as T } from "../../constants/controlIds.js";
|
|
6
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
7
|
-
const s = "data-text-after", a = "",
|
|
8
|
-
class g extends
|
|
6
|
+
import { BLOCK_ROOT_SELECTOR as p } from "../../constants/selectors.js";
|
|
7
|
+
const s = "data-text-after", a = "", f = ".omnibus-text-after";
|
|
8
|
+
class g extends l {
|
|
9
9
|
getId() {
|
|
10
10
|
return T.OMNIBUS_PRICE_TEXT_AFTER;
|
|
11
11
|
}
|
|
@@ -24,7 +24,7 @@ class g extends u {
|
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
26
26
|
onRender() {
|
|
27
|
-
this.
|
|
27
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
28
28
|
}
|
|
29
29
|
onTemplateNodeUpdated(t) {
|
|
30
30
|
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
@@ -44,7 +44,7 @@ class g extends u {
|
|
|
44
44
|
_onTextChange(t) {
|
|
45
45
|
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
46
|
return;
|
|
47
|
-
const e = this.currentNode.closest(
|
|
47
|
+
const e = this.currentNode.closest(p);
|
|
48
48
|
if (!e || !("querySelectorAll" in e))
|
|
49
49
|
return;
|
|
50
50
|
const n = Array.from(
|
|
@@ -55,12 +55,12 @@ class g extends u {
|
|
|
55
55
|
const r = this.api.getDocumentModifier();
|
|
56
56
|
n.forEach((i) => {
|
|
57
57
|
r.modifyHtml(i).setAttribute(s, t);
|
|
58
|
-
const o = i.querySelector(
|
|
58
|
+
const o = i.querySelector(f);
|
|
59
59
|
if (o) {
|
|
60
|
-
const
|
|
61
|
-
r.modifyHtml(o).setInnerHtml(
|
|
60
|
+
const m = u(o, t);
|
|
61
|
+
r.modifyHtml(o).setInnerHtml(m);
|
|
62
62
|
}
|
|
63
|
-
}), r.apply(new
|
|
63
|
+
}), r.apply(new c("Update omnibus price text after"));
|
|
64
64
|
}
|
|
65
65
|
_listenToFormUpdates() {
|
|
66
66
|
this.api.onValueChanged("omnibusPriceTextAfter", (t) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { preserveTextStyles as
|
|
2
|
-
import { ModificationDescription as
|
|
1
|
+
import { preserveTextStyles as u } from "../../../../../utils/preserveTextStyles.js";
|
|
2
|
+
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
3
|
import { CommonControl as l } from "../../../common-control.js";
|
|
4
4
|
import { RecommendationBlockId as d } from "../../constants/blockIds.js";
|
|
5
5
|
import { RecommendationControlId as p } from "../../constants/controlIds.js";
|
|
6
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
7
|
-
const s = "data-text-before", a = "",
|
|
6
|
+
import { BLOCK_ROOT_SELECTOR as T } from "../../constants/selectors.js";
|
|
7
|
+
const s = "data-text-before", a = "", f = ".omnibus-text-before";
|
|
8
8
|
class g extends l {
|
|
9
9
|
getId() {
|
|
10
10
|
return p.OMNIBUS_PRICE_TEXT_BEFORE;
|
|
@@ -24,7 +24,7 @@ class g extends l {
|
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
26
26
|
onRender() {
|
|
27
|
-
this.
|
|
27
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
28
28
|
}
|
|
29
29
|
onTemplateNodeUpdated(e) {
|
|
30
30
|
super.onTemplateNodeUpdated(e), this._setFormValues();
|
|
@@ -44,7 +44,7 @@ class g extends l {
|
|
|
44
44
|
_onTextChange(e) {
|
|
45
45
|
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
46
|
return;
|
|
47
|
-
const t = this.currentNode.closest(
|
|
47
|
+
const t = this.currentNode.closest(T);
|
|
48
48
|
if (!t || !("querySelectorAll" in t))
|
|
49
49
|
return;
|
|
50
50
|
const n = Array.from(
|
|
@@ -55,12 +55,12 @@ class g extends l {
|
|
|
55
55
|
const o = this.api.getDocumentModifier();
|
|
56
56
|
n.forEach((i) => {
|
|
57
57
|
o.modifyHtml(i).setAttribute(s, e);
|
|
58
|
-
const r = i.querySelector(
|
|
58
|
+
const r = i.querySelector(f);
|
|
59
59
|
if (r) {
|
|
60
|
-
const
|
|
61
|
-
o.modifyHtml(r).setInnerHtml(
|
|
60
|
+
const m = u(r, e);
|
|
61
|
+
o.modifyHtml(r).setInnerHtml(m);
|
|
62
62
|
}
|
|
63
|
-
}), o.apply(new
|
|
63
|
+
}), o.apply(new c("Update omnibus price text before"));
|
|
64
64
|
}
|
|
65
65
|
_listenToFormUpdates() {
|
|
66
66
|
this.api.onValueChanged("omnibusPriceTextBefore", (e) => {
|
|
@@ -84,7 +84,7 @@ class j extends E {
|
|
|
84
84
|
`;
|
|
85
85
|
}
|
|
86
86
|
onRender() {
|
|
87
|
-
this.
|
|
87
|
+
this._setFormValues(), this._updateSpacingVisibility(), this._listenToFormUpdates(), this._subscribeToOrientationChanges();
|
|
88
88
|
}
|
|
89
89
|
onTemplateNodeUpdated(t) {
|
|
90
90
|
super.onTemplateNodeUpdated(t), this._setFormValues(), this._updateSpacingVisibility();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_PRICE as
|
|
1
|
+
import { ATTR_PRODUCT_PRICE as D, ATTR_PRODUCT_OLD_PRICE as O } from "../../constants/selectors.js";
|
|
2
2
|
import { DEFAULT_PRODUCTS_PER_ROW as w } from "../../constants/layout.js";
|
|
3
|
-
import { createBlockTemplate as A, getDefaultProducts as g, DEFAULTS as U, buildSpacer as h, DEFAULT_CARD_COMPOSITION as Y, buildElementRenderer as B,
|
|
4
|
-
import { DEFAULT_CELL_PADDING as
|
|
3
|
+
import { createBlockTemplate as A, getDefaultProducts as g, DEFAULTS as U, buildSpacer as h, DEFAULT_CARD_COMPOSITION as Y, buildElementRenderer as B, buildCellOptions as m, DEFAULT_CARD_VISIBILITY as F } from "../utils.js";
|
|
4
|
+
import { DEFAULT_CELL_PADDING as W, renderInlineGridPriceCell as k, buildFillerCell as H, gridElementRenderer as x } from "./elementRenderer.js";
|
|
5
|
+
import { resolveInlinePriceOrder as y } from "../../utils/inlinePriceOrder.js";
|
|
5
6
|
const G = `
|
|
6
7
|
<tr class="recommendation-product-row">
|
|
7
8
|
<td>
|
|
@@ -28,29 +29,29 @@ const G = `
|
|
|
28
29
|
{-{-CELLS-}-}
|
|
29
30
|
</tr>
|
|
30
31
|
`;
|
|
31
|
-
function j(t, r,
|
|
32
|
-
const { cellPadding: s =
|
|
33
|
-
return L.filter((l) =>
|
|
34
|
-
const _ = (a == null ? void 0 : a[l]) ??
|
|
32
|
+
function j(t, r, n, e = Y, c = {}, i = {}) {
|
|
33
|
+
const { cellPadding: s = W, cardBackgroundColor: u, visibility: a, priceInline: o = !1 } = i, d = (100 / r).toFixed(2), p = r - t.length, T = p > 0 ? H(d, s).repeat(p) : "", I = B(n, e, c), R = y(e), L = o ? e.filter((l) => l !== R.skip) : e, C = m(D, i), P = m(O, i);
|
|
34
|
+
return L.filter((l) => I[l]).map((l) => {
|
|
35
|
+
const _ = (a == null ? void 0 : a[l]) ?? F[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = m(l, i, e), f = t.map((E) => (o && l === R.anchor ? k(
|
|
35
36
|
E,
|
|
36
37
|
R.originalFirst,
|
|
37
38
|
C,
|
|
38
39
|
P,
|
|
39
40
|
u
|
|
40
|
-
) :
|
|
41
|
-
return V.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", _ ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", b).replace("{-{-CELLS-}-}",
|
|
41
|
+
) : I[l](E, S)).replace("<td", `<td width="${d}%"`)).join("");
|
|
42
|
+
return V.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", _ ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", b).replace("{-{-CELLS-}-}", f + T);
|
|
42
43
|
}).join("");
|
|
43
44
|
}
|
|
44
|
-
function v(t, r,
|
|
45
|
+
function v(t, r, n, e, c = {}, i = {}) {
|
|
45
46
|
const s = [];
|
|
46
|
-
for (let
|
|
47
|
-
s.push(t.slice(
|
|
47
|
+
for (let o = 0; o < t.length; o += r)
|
|
48
|
+
s.push(t.slice(o, o + r));
|
|
48
49
|
const u = h(i.rowSpacingPx);
|
|
49
|
-
return s.map((
|
|
50
|
+
return s.map((o, d) => {
|
|
50
51
|
const p = j(
|
|
51
|
-
n,
|
|
52
|
-
r,
|
|
53
52
|
o,
|
|
53
|
+
r,
|
|
54
|
+
n,
|
|
54
55
|
e,
|
|
55
56
|
c,
|
|
56
57
|
i
|
|
@@ -58,22 +59,22 @@ function v(t, r, o, e, c = {}, i = {}) {
|
|
|
58
59
|
return d > 0 ? u + T : T;
|
|
59
60
|
}).join("");
|
|
60
61
|
}
|
|
61
|
-
function M(t, r,
|
|
62
|
+
function M(t, r, n, e = {}, c = {}) {
|
|
62
63
|
return v(
|
|
63
64
|
t,
|
|
64
65
|
r,
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
x,
|
|
67
|
+
n,
|
|
67
68
|
e,
|
|
68
69
|
c
|
|
69
70
|
);
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
const r = t ? `ins-recommendation-v3-block-${t}` : void 0,
|
|
73
|
-
return
|
|
72
|
+
function X(t) {
|
|
73
|
+
const r = t ? `ins-recommendation-v3-block-${t}` : void 0, n = A("grid", r), e = g(), c = M(e, w);
|
|
74
|
+
return n.replace("{-{-TITLE-}-}", U.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
74
75
|
}
|
|
75
76
|
export {
|
|
76
|
-
|
|
77
|
+
X as getDefaultTemplate,
|
|
77
78
|
j as prepareGridAttributeRows,
|
|
78
79
|
v as prepareGridProductRows,
|
|
79
80
|
M as prepareProductRows
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as
|
|
2
|
-
import { buildSpacer as
|
|
3
|
-
import { listElementRenderer as
|
|
1
|
+
import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as m } from "../../constants/selectors.js";
|
|
2
|
+
import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, DEFAULT_CARD_VISIBILITY as w } from "../utils.js";
|
|
3
|
+
import { listElementRenderer as y, renderInlineListPriceRow as L } from "./elementRenderer.js";
|
|
4
|
+
import { resolveInlinePriceOrder as O } from "../../utils/inlinePriceOrder.js";
|
|
4
5
|
const S = "0 5px";
|
|
5
6
|
function U(l, r, n) {
|
|
6
|
-
const
|
|
7
|
+
const e = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
|
|
7
8
|
return `<tr
|
|
8
9
|
class="recommendation-attribute-row"
|
|
9
10
|
data-attribute-type="${r}"
|
|
10
|
-
data-visibility="${n ? "1" : "0"}"${
|
|
11
|
+
data-visibility="${n ? "1" : "0"}"${e}>${o}</tr>`;
|
|
11
12
|
}
|
|
12
13
|
const N = `
|
|
13
14
|
<tr class="recommendation-product-row">
|
|
@@ -27,40 +28,40 @@ const N = `
|
|
|
27
28
|
</td>
|
|
28
29
|
</tr>
|
|
29
30
|
`;
|
|
30
|
-
function x(l, r = g, n = {},
|
|
31
|
+
function x(l, r = g, n = {}, e = {}) {
|
|
31
32
|
const {
|
|
32
33
|
cellPadding: o = S,
|
|
33
34
|
cardBackgroundColor: d,
|
|
34
35
|
visibility: c,
|
|
35
36
|
priceInline: a = !1
|
|
36
|
-
} =
|
|
37
|
+
} = e, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(y, r, n), P = s[p](l, i(p, e)), R = O(r), T = `
|
|
37
38
|
<td class="product-info-cell" valign="middle" style="padding: 15px;">
|
|
38
39
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
|
|
39
40
|
<tbody>
|
|
40
|
-
${r.filter((
|
|
41
|
-
const b = (c == null ? void 0 : c[
|
|
41
|
+
${r.filter((t) => t !== p && t !== C).filter((t) => !(a && t === R.skip)).filter((t) => s[t]).map((t) => {
|
|
42
|
+
const b = (c == null ? void 0 : c[t]) ?? w[t] ?? !0, f = a && t === R.anchor ? L(
|
|
42
43
|
l,
|
|
43
44
|
R.originalFirst,
|
|
44
|
-
i(
|
|
45
|
-
i(A,
|
|
46
|
-
) : s[
|
|
47
|
-
return U(f,
|
|
45
|
+
i(m, e),
|
|
46
|
+
i(A, e)
|
|
47
|
+
) : s[t](l, i(t, e, r));
|
|
48
|
+
return U(f, t, b);
|
|
48
49
|
}).join(`
|
|
49
50
|
`)}
|
|
50
51
|
</tbody>
|
|
51
52
|
</table>
|
|
52
53
|
</td>
|
|
53
|
-
`, _ = s[C](l, i(C,
|
|
54
|
+
`, _ = s[C](l, i(C, e)), D = P + T + _;
|
|
54
55
|
return N.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
const o =
|
|
57
|
+
function k(l, r, n = {}, e = {}) {
|
|
58
|
+
const o = I(e.rowSpacingPx);
|
|
58
59
|
return l.map((d, c) => {
|
|
59
|
-
const a = x(d, r, n,
|
|
60
|
+
const a = x(d, r, n, e);
|
|
60
61
|
return c > 0 ? o + a : a;
|
|
61
62
|
}).join("");
|
|
62
63
|
}
|
|
63
64
|
export {
|
|
64
65
|
x as getListProductCard,
|
|
65
|
-
|
|
66
|
+
k as prepareProductRows
|
|
66
67
|
};
|