@useinsider/guido 3.8.0 → 3.8.1-beta.1a5be20
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/useHtmlValidator.js +180 -133
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +64 -69
- package/dist/config/compiler/utils/recommendationIgnoreUtils.js +15 -0
- package/dist/config/migrator/recommendation/extractors.js +44 -22
- package/dist/config/migrator/recommendation/htmlBuilder.js +175 -169
- package/dist/config/migrator/recommendationMigrator.js +30 -31
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +22 -15
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +55 -41
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +42 -43
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -45
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +3 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +64 -60
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +294 -335
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +7 -6
- package/dist/extensions/Blocks/Recommendation/extension.js +7 -5
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -2
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +142 -173
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +56 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +30 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +132 -105
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +44 -23
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +112 -64
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +219 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +30 -22
- package/dist/extensions/Blocks/Unsubscribe/block.js +1 -1
- package/dist/extensions/Blocks/controlFactories.js +159 -133
- package/dist/src/composables/useHtmlValidator.d.ts +27 -0
- package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +17 -0
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +23 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +29 -47
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +165 -11
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +78 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +29 -9
- package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
- package/package.json +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var a = (o, e, t) =>
|
|
4
|
-
import { UIElementType as c, UEAttr as
|
|
2
|
+
var p = (o, e, t) => e in o ? m(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var a = (o, e, t) => p(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { UIElementType as c, UEAttr as _ } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as d } from "../../common-control.js";
|
|
6
6
|
import { RecommendationControlId as C } from "../constants/controlIds.js";
|
|
7
|
+
import "../constants/selectors.js";
|
|
7
8
|
const S = C.SYNC_INFO_MESSAGE, r = "sync-info-message", u = "Note that changes will be applied to all product cards in your recommendation block.";
|
|
8
|
-
class
|
|
9
|
+
class O extends d {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
a(this, "_repositionedElement", null);
|
|
@@ -17,7 +18,7 @@ class h extends d {
|
|
|
17
18
|
return `
|
|
18
19
|
<div class="${r}">
|
|
19
20
|
<${c.ICON}
|
|
20
|
-
${
|
|
21
|
+
${_.ICON.src}="migration-info-icon"
|
|
21
22
|
class="${r}__icon">
|
|
22
23
|
</${c.ICON}>
|
|
23
24
|
<p class="${r}__text">
|
|
@@ -61,5 +62,5 @@ class h extends d {
|
|
|
61
62
|
}
|
|
62
63
|
export {
|
|
63
64
|
S as SYNC_INFO_MESSAGE_CONTROL_ID,
|
|
64
|
-
|
|
65
|
+
O as SyncInfoMessageControl
|
|
65
66
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ExtensionBuilder as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlock as m } from "./block.js";
|
|
3
3
|
import { RecommendationBlockControl as n } from "./controls/main/index.js";
|
|
4
|
+
import "./constants/selectors.js";
|
|
4
5
|
import "./store/recommendation.js";
|
|
6
|
+
import "./utils/captureStyleTemplates.js";
|
|
5
7
|
import { NameControls as i } from "./controls/name/index.js";
|
|
6
8
|
import { PriceControls as e } from "./controls/price/index.js";
|
|
7
9
|
import { OldPriceControls as s } from "./controls/oldPrice/index.js";
|
|
8
10
|
import { OmnibusPriceControls as l } from "./controls/omnibusPrice/index.js";
|
|
9
|
-
import { OmnibusDiscountControls as
|
|
10
|
-
import { ButtonControls as
|
|
11
|
+
import { OmnibusDiscountControls as p } from "./controls/omnibusDiscount/index.js";
|
|
12
|
+
import { ButtonControls as a } from "./controls/button/index.js";
|
|
11
13
|
import { ImageControls as c } from "./controls/image/index.js";
|
|
12
14
|
import { CustomAttributeControls as C } from "./controls/customAttribute/index.js";
|
|
13
15
|
import { SpacingControl as f } from "./controls/spacing/index.js";
|
|
@@ -22,8 +24,8 @@ const b = [
|
|
|
22
24
|
e,
|
|
23
25
|
s,
|
|
24
26
|
l,
|
|
25
|
-
a,
|
|
26
27
|
p,
|
|
28
|
+
a,
|
|
27
29
|
c,
|
|
28
30
|
C
|
|
29
31
|
], P = [
|
|
@@ -35,10 +37,10 @@ const b = [
|
|
|
35
37
|
], S = [
|
|
36
38
|
...P,
|
|
37
39
|
...b.flatMap((o) => Object.values(o))
|
|
38
|
-
],
|
|
40
|
+
], Q = S.reduce(
|
|
39
41
|
(o, t) => o.addControl(t),
|
|
40
42
|
new r().addBlock(m).withSettingsPanelRegistry(B)
|
|
41
43
|
).addStyles(y).withIconsRegistry(R).build();
|
|
42
44
|
export {
|
|
43
|
-
|
|
45
|
+
Q as default
|
|
44
46
|
};
|
|
@@ -2,8 +2,10 @@ import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as O, Co
|
|
|
2
2
|
import { BLOCK_ID as U } from "./block.js";
|
|
3
3
|
import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
|
+
import "./constants/selectors.js";
|
|
5
6
|
import { CONTROL_BLOCK_ID as A } from "./controls/main/index.js";
|
|
6
7
|
import "./store/recommendation.js";
|
|
8
|
+
import "./utils/captureStyleTemplates.js";
|
|
7
9
|
import "./controls/name/index.js";
|
|
8
10
|
import "./controls/price/index.js";
|
|
9
11
|
import "./controls/oldPrice/index.js";
|
|
@@ -15,7 +17,7 @@ import { SPACING_CONTROL_ID as L } from "./controls/spacing/index.js";
|
|
|
15
17
|
import { CARD_BACKGROUND_COLOR_CONTROL_ID as D } from "./controls/cardBackground/index.js";
|
|
16
18
|
import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
|
|
17
19
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
18
|
-
class
|
|
20
|
+
class d extends E {
|
|
19
21
|
registerBlockControls(I) {
|
|
20
22
|
I[U] = [
|
|
21
23
|
new _(
|
|
@@ -194,5 +196,5 @@ class Z extends E {
|
|
|
194
196
|
}
|
|
195
197
|
}
|
|
196
198
|
export {
|
|
197
|
-
|
|
199
|
+
d as SettingsPanel
|
|
198
200
|
};
|
|
@@ -2,6 +2,7 @@ import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAtt
|
|
|
2
2
|
import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
|
|
3
3
|
import { useConfigStore as G } from "../../../../stores/config.js";
|
|
4
4
|
import { defineStore as F } from "pinia";
|
|
5
|
+
import "../constants/selectors.js";
|
|
5
6
|
import { DEFAULT_MOBILE_CARDS_IN_ROW as P, DEFAULT_CARDS_IN_ROW as D } from "../constants/layout.js";
|
|
6
7
|
import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
|
|
7
8
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
@@ -60,7 +61,7 @@ const L = () => ({
|
|
|
60
61
|
blockStates: {},
|
|
61
62
|
currentRecommendationId: null,
|
|
62
63
|
configVersion: 0
|
|
63
|
-
}),
|
|
64
|
+
}), $ = F("guidoRecommendationExtension", {
|
|
64
65
|
state: () => L(),
|
|
65
66
|
getters: {
|
|
66
67
|
// ====================================================================
|
|
@@ -476,5 +477,5 @@ const L = () => ({
|
|
|
476
477
|
}
|
|
477
478
|
});
|
|
478
479
|
export {
|
|
479
|
-
|
|
480
|
+
$ as useRecommendationExtensionStore
|
|
480
481
|
};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { RecommendationBlockId as
|
|
2
|
-
import { ATTR_PRODUCT_ATTR as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { formatPrice as
|
|
5
|
-
import { CUSTOM_CELL_HTML as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
return `<td class="${
|
|
1
|
+
import { RecommendationBlockId as b } from "../../constants/blockIds.js";
|
|
2
|
+
import { ATTR_PRODUCT_ATTR as k, ATTR_PRODUCT_BUTTON as h, CSS_CLASS_RECO_BUTTON as f, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_OMNIBUS_PRICE as O, ATTR_PRODUCT_OLD_PRICE as U, ATTR_PRODUCT_PRICE as v, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_IMAGE as I } from "../../constants/selectors.js";
|
|
3
|
+
import { useRecommendationExtensionStore as L } from "../../store/recommendation.js";
|
|
4
|
+
import { formatPrice as D } from "../../utils/priceFormatter.js";
|
|
5
|
+
import { CUSTOM_CELL_HTML as N, renderStyledParagraph as T, cellBgStyleAttr as $, DEFAULT_BUTTON_BORDER_STYLE as M, DEFAULT_BUTTON_ANCHOR_STYLE as z, renderButtonLabel as F, resolveButtonBorderClass as G, resolvePStyle as P, resolveOmnibusText as x, DEFAULT_IMG_STYLE as j, sanitizeImageUrl as w, resolveSegmentBgStyle as Y } from "../utils.js";
|
|
6
|
+
const d = "0 5px", t = "attribute-cell";
|
|
7
|
+
function Q(r, e = d) {
|
|
8
|
+
return `<td class="${t}" style="padding: ${e};" width="${r}%"></td>`;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
10
|
+
function u(r, e = "") {
|
|
11
|
+
const l = Y(e, r);
|
|
12
|
+
return `<table class="product-card-segment" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"${l ? ` style="${l}"` : ""}>`;
|
|
13
|
+
}
|
|
14
|
+
function A() {
|
|
15
|
+
const r = L(), { currencySettings: e } = r.recommendationConfigs;
|
|
12
16
|
return {
|
|
13
17
|
code: e.value,
|
|
14
18
|
symbol: e.symbol,
|
|
@@ -18,34 +22,31 @@ function g() {
|
|
|
18
22
|
thousandSeparator: e.thousandSeparator
|
|
19
23
|
};
|
|
20
24
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
price:
|
|
25
|
-
currency:
|
|
25
|
+
function m(r, e = "price") {
|
|
26
|
+
const l = A(), a = r[e], c = (a == null ? void 0 : a[l.code]) ?? Object.values(a ?? {})[0] ?? 0;
|
|
27
|
+
return D({
|
|
28
|
+
price: c,
|
|
29
|
+
currency: l
|
|
26
30
|
});
|
|
27
31
|
}
|
|
28
|
-
const
|
|
29
|
-
[
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
cellpadding="0"
|
|
36
|
-
cellspacing="0"
|
|
37
|
-
border="0">
|
|
32
|
+
const W = {
|
|
33
|
+
[I]: (r, e) => {
|
|
34
|
+
var c;
|
|
35
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? d, a = ((c = e == null ? void 0 : e.styleTemplate) == null ? void 0 : c.imgStyle) ?? j;
|
|
36
|
+
return `
|
|
37
|
+
<td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
|
|
38
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
38
39
|
<tbody>
|
|
39
40
|
<tr valign="top">
|
|
40
41
|
<td
|
|
41
42
|
class="esd-block-image product-image"
|
|
42
43
|
align="center"
|
|
43
|
-
esd-extension-block-id="${
|
|
44
|
-
<a target="_blank" href="${
|
|
44
|
+
esd-extension-block-id="${b.IMAGE}">
|
|
45
|
+
<a target="_blank" href="${r.url}" class="${f}">
|
|
45
46
|
<img
|
|
46
|
-
src="${
|
|
47
|
-
alt="${
|
|
48
|
-
style="
|
|
47
|
+
src="${w(r.image_url)}"
|
|
48
|
+
alt="${r.name}"
|
|
49
|
+
style="${a}"
|
|
49
50
|
class="adapt-img">
|
|
50
51
|
</a>
|
|
51
52
|
</td>
|
|
@@ -53,134 +54,120 @@ const A = {
|
|
|
53
54
|
</tbody>
|
|
54
55
|
</table>
|
|
55
56
|
</td>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
`;
|
|
58
|
+
},
|
|
59
|
+
[E]: (r, e) => {
|
|
60
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? d, a = T(
|
|
61
|
+
r.name,
|
|
62
|
+
{ pStyle: "font-size: 16px; color: #333333;", openTags: "<strong>", closeTags: "</strong>" },
|
|
63
|
+
e == null ? void 0 : e.styleTemplate
|
|
64
|
+
);
|
|
65
|
+
return `
|
|
66
|
+
<td class="${t}" style="padding: ${l}; height: 100%;" valign="middle">
|
|
67
|
+
${u(e == null ? void 0 : e.cardBackgroundColor, "table-layout: fixed;")}
|
|
67
68
|
<tbody>
|
|
68
69
|
<tr valign="top">
|
|
69
70
|
<td
|
|
70
|
-
class="esd-block-text product-name es-p10t es-p10b es-p15l es-p15r"
|
|
71
|
-
align="center"
|
|
72
|
-
esd-extension-block-id="${
|
|
73
|
-
|
|
74
|
-
<strong>${t.name}</strong>
|
|
75
|
-
</p>
|
|
71
|
+
class="esd-block-text product-name ${(e == null ? void 0 : e.cellClasses) ?? "es-p10t es-p10b es-p15l es-p15r"}"
|
|
72
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
73
|
+
esd-extension-block-id="${b.NAME}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
74
|
+
${a}
|
|
76
75
|
</td>
|
|
77
76
|
</tr>
|
|
78
77
|
</tbody>
|
|
79
78
|
</table>
|
|
80
79
|
</td>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
`;
|
|
81
|
+
},
|
|
82
|
+
[v]: (r, e) => {
|
|
83
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? d, a = T(
|
|
84
|
+
m(r, "price"),
|
|
85
|
+
{ pStyle: "font-size: 16px; color: #333333;", openTags: "<strong>", closeTags: "</strong>" },
|
|
86
|
+
e == null ? void 0 : e.styleTemplate
|
|
87
|
+
);
|
|
88
|
+
return `
|
|
89
|
+
<td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
|
|
90
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
91
91
|
<tbody>
|
|
92
92
|
<tr valign="top">
|
|
93
93
|
<td
|
|
94
|
-
class="esd-block-text product-price es-p15l es-p15r"
|
|
95
|
-
align="center"
|
|
96
|
-
esd-extension-block-id="${
|
|
97
|
-
|
|
98
|
-
<strong>${i(t, "price")}</strong>
|
|
99
|
-
</p>
|
|
94
|
+
class="esd-block-text product-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
|
|
95
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
96
|
+
esd-extension-block-id="${b.PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
97
|
+
${a}
|
|
100
98
|
</td>
|
|
101
99
|
</tr>
|
|
102
100
|
</tbody>
|
|
103
101
|
</table>
|
|
104
102
|
</td>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
`;
|
|
104
|
+
},
|
|
105
|
+
[U]: (r, e) => {
|
|
106
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? d, a = T(
|
|
107
|
+
m(r, "original_price"),
|
|
108
|
+
{ pStyle: "font-size: 14px; color: #999999;", openTags: "<s><strong>", closeTags: "</strong></s>" },
|
|
109
|
+
e == null ? void 0 : e.styleTemplate
|
|
110
|
+
);
|
|
111
|
+
return `
|
|
112
|
+
<td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
|
|
113
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
115
114
|
<tbody>
|
|
116
115
|
<tr valign="top">
|
|
117
116
|
<td
|
|
118
|
-
class="esd-block-text product-old-price es-p15l es-p15r"
|
|
119
|
-
align="center"
|
|
120
|
-
esd-extension-block-id="${
|
|
121
|
-
|
|
122
|
-
contenteditable="false"
|
|
123
|
-
style="font-size: 14px; color: #999999;">
|
|
124
|
-
<s><strong>${i(t, "original_price")}</strong></s>
|
|
125
|
-
</p>
|
|
117
|
+
class="esd-block-text product-old-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
|
|
118
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
119
|
+
esd-extension-block-id="${b.OLD_PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
120
|
+
${a}
|
|
126
121
|
</td>
|
|
127
122
|
</tr>
|
|
128
123
|
</tbody>
|
|
129
124
|
</table>
|
|
130
125
|
</td>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
cellpadding="0"
|
|
139
|
-
cellspacing="0"
|
|
140
|
-
border="0">
|
|
126
|
+
`;
|
|
127
|
+
},
|
|
128
|
+
[O]: (r, e) => {
|
|
129
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? d, a = P("font-size: 12px; color: #666666;", e == null ? void 0 : e.styleTemplate), { before: c, after: g } = x(e == null ? void 0 : e.omnibusText, "Lowest 30-day price: ");
|
|
130
|
+
return `
|
|
131
|
+
<td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
|
|
132
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
141
133
|
<tbody>
|
|
142
134
|
<tr valign="top">
|
|
143
135
|
<td
|
|
144
|
-
class="esd-block-text product-omnibus-price es-p15l es-p15r"
|
|
145
|
-
align="center"
|
|
146
|
-
data-text-before="
|
|
147
|
-
data-text-after=""
|
|
148
|
-
esd-extension-block-id="${
|
|
149
|
-
<p contenteditable="false" style="
|
|
150
|
-
<span class="omnibus-text-before"
|
|
151
|
-
<span class="omnibus-price-value">${
|
|
152
|
-
<span class="omnibus-text-after"
|
|
136
|
+
class="esd-block-text product-omnibus-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
|
|
137
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
138
|
+
data-text-before="${c}"
|
|
139
|
+
data-text-after="${g}"
|
|
140
|
+
esd-extension-block-id="${b.OMNIBUS_PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
141
|
+
<p contenteditable="false" style="${a}">
|
|
142
|
+
<span class="omnibus-text-before">${c}</span>
|
|
143
|
+
<span class="omnibus-price-value">${m(r, "original_price")}</span>
|
|
144
|
+
<span class="omnibus-text-after">${g}</span>
|
|
153
145
|
</p>
|
|
154
146
|
</td>
|
|
155
147
|
</tr>
|
|
156
148
|
</tbody>
|
|
157
149
|
</table>
|
|
158
150
|
</td>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
151
|
+
`;
|
|
152
|
+
},
|
|
153
|
+
[R]: (r, e) => {
|
|
154
|
+
var s, S;
|
|
155
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? d, a = P("font-size: 12px; color: #666666;", e == null ? void 0 : e.styleTemplate), c = A(), g = ((s = r.original_price) == null ? void 0 : s[c.code]) ?? Object.values(r.original_price ?? {})[0] ?? 0, y = ((S = r.price) == null ? void 0 : S[c.code]) ?? Object.values(r.price ?? {})[0] ?? 0, C = g > 0 ? Math.round((g - y) / g * 100) : 0, B = C > 0 ? `-${C}%` : "0%", { before: _, after: n } = x(e == null ? void 0 : e.omnibusText);
|
|
163
156
|
return `
|
|
164
|
-
<td class="${
|
|
165
|
-
|
|
166
|
-
class="product-card-segment"
|
|
167
|
-
width="100%"
|
|
168
|
-
height="100%"
|
|
169
|
-
cellpadding="0"
|
|
170
|
-
cellspacing="0"
|
|
171
|
-
border="0">
|
|
157
|
+
<td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
|
|
158
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
172
159
|
<tbody>
|
|
173
160
|
<tr valign="top">
|
|
174
161
|
<td
|
|
175
|
-
class="esd-block-text product-omnibus-discount es-p15l es-p15r"
|
|
176
|
-
align="center"
|
|
177
|
-
data-text-before=""
|
|
178
|
-
data-text-after=""
|
|
179
|
-
esd-extension-block-id="${
|
|
180
|
-
<p contenteditable="false" style="
|
|
181
|
-
<span class="omnibus-text-before"
|
|
182
|
-
<span class="omnibus-discount-value">${
|
|
183
|
-
<span class="omnibus-text-after"
|
|
162
|
+
class="esd-block-text product-omnibus-discount ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
|
|
163
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
164
|
+
data-text-before="${_}"
|
|
165
|
+
data-text-after="${n}"
|
|
166
|
+
esd-extension-block-id="${b.OMNIBUS_DISCOUNT}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
167
|
+
<p contenteditable="false" style="${a}">
|
|
168
|
+
<span class="omnibus-text-before">${_}</span>
|
|
169
|
+
<span class="omnibus-discount-value">${B}</span>
|
|
170
|
+
<span class="omnibus-text-after">${n}</span>
|
|
184
171
|
</p>
|
|
185
172
|
</td>
|
|
186
173
|
</tr>
|
|
@@ -189,43 +176,24 @@ const A = {
|
|
|
189
176
|
</td>
|
|
190
177
|
`;
|
|
191
178
|
},
|
|
192
|
-
[
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
height="100%"
|
|
198
|
-
cellpadding="0"
|
|
199
|
-
cellspacing="0"
|
|
200
|
-
border="0">
|
|
179
|
+
[h]: (r, e) => {
|
|
180
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? d, a = e == null ? void 0 : e.styleTemplate, c = (a == null ? void 0 : a.buttonBorderStyle) ?? M, g = (a == null ? void 0 : a.buttonAnchorStyle) ?? z, y = F((a == null ? void 0 : a.buttonText) ?? "Buy", a);
|
|
181
|
+
return `
|
|
182
|
+
<td class="${t}" style="padding: ${l}; height: 100%;" valign="top">
|
|
183
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
201
184
|
<tbody>
|
|
202
185
|
<tr valign="top">
|
|
203
186
|
<td
|
|
204
|
-
class="esd-block-button product-button es-p10t es-p10b"
|
|
205
|
-
align="center"
|
|
206
|
-
esd-extension-block-id="${
|
|
207
|
-
<span
|
|
208
|
-
class="es-button-border"
|
|
209
|
-
style="
|
|
210
|
-
border-width: 1px;
|
|
211
|
-
background: rgb(217, 234, 211);
|
|
212
|
-
border-color: rgb(106, 168, 79);
|
|
213
|
-
">
|
|
187
|
+
class="esd-block-button product-button ${(e == null ? void 0 : e.cellClasses) ?? "es-p10t es-p10b"}"
|
|
188
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
189
|
+
esd-extension-block-id="${b.BUTTON}">
|
|
190
|
+
<span class="${G(a)}" style="${c}">
|
|
214
191
|
<a
|
|
215
192
|
href="#"
|
|
216
|
-
class="es-button ${
|
|
193
|
+
class="es-button ${f}"
|
|
217
194
|
target="_blank"
|
|
218
|
-
style="
|
|
219
|
-
|
|
220
|
-
background: rgb(217, 234, 211);
|
|
221
|
-
font-family: arial, 'helvetica neue', helvetica, sans-serif;
|
|
222
|
-
font-size: 16px;
|
|
223
|
-
font-weight: normal;
|
|
224
|
-
line-height: 120%;
|
|
225
|
-
mso-border-alt: 10px solid rgb(217, 234, 211);
|
|
226
|
-
mso-padding-alt: 0;
|
|
227
|
-
">
|
|
228
|
-
Buy
|
|
195
|
+
style="${g}">
|
|
196
|
+
${y}
|
|
229
197
|
</a>
|
|
230
198
|
</span>
|
|
231
199
|
</td>
|
|
@@ -233,7 +201,8 @@ const A = {
|
|
|
233
201
|
</tbody>
|
|
234
202
|
</table>
|
|
235
203
|
</td>
|
|
236
|
-
|
|
204
|
+
`;
|
|
205
|
+
},
|
|
237
206
|
/**
|
|
238
207
|
* Custom attribute cell template — same structure as built-in entries
|
|
239
208
|
* (outer td → inner product-card-segment table).
|
|
@@ -241,34 +210,34 @@ const A = {
|
|
|
241
210
|
* @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
|
|
242
211
|
* @param content - Display content for the cell
|
|
243
212
|
*/
|
|
244
|
-
[
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
style="table-layout: fixed;">
|
|
213
|
+
[N]: (r, e, l) => {
|
|
214
|
+
const a = (l == null ? void 0 : l.cellPadding) ?? d, c = T(
|
|
215
|
+
e,
|
|
216
|
+
{ pStyle: "font-size: 12px; color: #666666;", openTags: "", closeTags: "" },
|
|
217
|
+
l == null ? void 0 : l.styleTemplate
|
|
218
|
+
);
|
|
219
|
+
return `
|
|
220
|
+
<td class="${t}" style="padding: ${a}; height: 100%;" valign="middle">
|
|
221
|
+
${u(l == null ? void 0 : l.cardBackgroundColor, "table-layout: fixed;")}
|
|
254
222
|
<tbody>
|
|
255
223
|
<tr valign="top">
|
|
256
224
|
<td
|
|
257
|
-
${
|
|
258
|
-
class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
|
|
259
|
-
align="center"
|
|
260
|
-
esd-extension-block-id="${
|
|
261
|
-
|
|
225
|
+
${k}="${r}"
|
|
226
|
+
class="esd-block-text product-custom-attribute ${(l == null ? void 0 : l.cellClasses) ?? "es-p0t es-p0b es-p15l es-p15r"}"
|
|
227
|
+
align="${(l == null ? void 0 : l.cellAlignment) ?? "center"}"
|
|
228
|
+
esd-extension-block-id="${b.CUSTOM_ATTRIBUTE}"${$(l == null ? void 0 : l.cellBackgroundColor)}>
|
|
229
|
+
${c}
|
|
262
230
|
</td>
|
|
263
231
|
</tr>
|
|
264
232
|
</tbody>
|
|
265
233
|
</table>
|
|
266
234
|
</td>
|
|
267
|
-
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
268
237
|
};
|
|
269
238
|
export {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
239
|
+
t as ATTRIBUTE_CELL_CLASS,
|
|
240
|
+
d as DEFAULT_CELL_PADDING,
|
|
241
|
+
Q as buildFillerCell,
|
|
242
|
+
W as gridElementRenderer
|
|
274
243
|
};
|