@useinsider/guido 3.6.0-beta.3555230 → 3.6.0-beta.3c5ea31
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/useHtmlCompiler.js +22 -40
- package/dist/composables/useRecommendation.js +34 -33
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +10 -12
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +24 -32
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +34 -40
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +286 -329
- package/dist/extensions/Blocks/Recommendation/extension.js +6 -5
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -9
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +139 -168
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +56 -30
- package/dist/extensions/Blocks/Recommendation/templates/index.js +29 -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 +98 -55
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +207 -0
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +20 -16
- package/dist/extensions/Blocks/controlFactories.js +159 -133
- package/dist/src/composables/useHtmlCompiler.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +20 -47
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.test.d.ts +1 -0
- 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/elementRenderer.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +158 -11
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +85 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +20 -9
- package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
- package/dist/utils/templatePreparation.js +53 -53
- package/package.json +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
|
@@ -2,12 +2,13 @@ import { ExtensionBuilder as r } from "../../../node_modules/@stripoinc/ui-edito
|
|
|
2
2
|
import { RecommendationBlock as m } from "./block.js";
|
|
3
3
|
import { RecommendationBlockControl as n } from "./controls/main/index.js";
|
|
4
4
|
import "./store/recommendation.js";
|
|
5
|
+
import "./utils/captureStyleTemplates.js";
|
|
5
6
|
import { NameControls as i } from "./controls/name/index.js";
|
|
6
7
|
import { PriceControls as e } from "./controls/price/index.js";
|
|
7
8
|
import { OldPriceControls as s } from "./controls/oldPrice/index.js";
|
|
8
9
|
import { OmnibusPriceControls as l } from "./controls/omnibusPrice/index.js";
|
|
9
|
-
import { OmnibusDiscountControls as
|
|
10
|
-
import { ButtonControls as
|
|
10
|
+
import { OmnibusDiscountControls as p } from "./controls/omnibusDiscount/index.js";
|
|
11
|
+
import { ButtonControls as a } from "./controls/button/index.js";
|
|
11
12
|
import { ImageControls as c } from "./controls/image/index.js";
|
|
12
13
|
import { CustomAttributeControls as C } from "./controls/customAttribute/index.js";
|
|
13
14
|
import { SpacingControl as f } from "./controls/spacing/index.js";
|
|
@@ -22,8 +23,8 @@ const b = [
|
|
|
22
23
|
e,
|
|
23
24
|
s,
|
|
24
25
|
l,
|
|
25
|
-
a,
|
|
26
26
|
p,
|
|
27
|
+
a,
|
|
27
28
|
c,
|
|
28
29
|
C
|
|
29
30
|
], P = [
|
|
@@ -35,10 +36,10 @@ const b = [
|
|
|
35
36
|
], S = [
|
|
36
37
|
...P,
|
|
37
38
|
...b.flatMap((o) => Object.values(o))
|
|
38
|
-
],
|
|
39
|
+
], L = S.reduce(
|
|
39
40
|
(o, t) => o.addControl(t),
|
|
40
41
|
new r().addBlock(m).withSettingsPanelRegistry(B)
|
|
41
42
|
).addStyles(y).withIconsRegistry(R).build();
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
L as default
|
|
44
45
|
};
|
|
@@ -4,6 +4,7 @@ import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
5
|
import { CONTROL_BLOCK_ID as A } from "./controls/main/index.js";
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
|
+
import "./utils/captureStyleTemplates.js";
|
|
7
8
|
import "./controls/name/index.js";
|
|
8
9
|
import "./controls/price/index.js";
|
|
9
10
|
import "./controls/oldPrice/index.js";
|
|
@@ -15,7 +16,7 @@ import { SPACING_CONTROL_ID as L } from "./controls/spacing/index.js";
|
|
|
15
16
|
import { CARD_BACKGROUND_COLOR_CONTROL_ID as D } from "./controls/cardBackground/index.js";
|
|
16
17
|
import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
|
|
17
18
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
18
|
-
class
|
|
19
|
+
class a extends E {
|
|
19
20
|
registerBlockControls(I) {
|
|
20
21
|
I[U] = [
|
|
21
22
|
new _(
|
|
@@ -194,5 +195,5 @@ class Z extends E {
|
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
export {
|
|
197
|
-
|
|
198
|
+
a as SettingsPanel
|
|
198
199
|
};
|
|
@@ -6,8 +6,9 @@ import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
|
6
6
|
import { EXCLUDED_ALGORITHM_IDS as D } from "../constants/defaultConfig.js";
|
|
7
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
8
8
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { getPartnerRecommendationParams as v } from "../utils/partnerCustomizations.js";
|
|
10
|
+
import { isFilterValid as w } from "../validation/filterSchema.js";
|
|
11
|
+
import { isConfigValid as N } from "../validation/requiredFields.js";
|
|
11
12
|
const h = y();
|
|
12
13
|
let m = null, u = null, d = null;
|
|
13
14
|
function I() {
|
|
@@ -49,7 +50,7 @@ function k() {
|
|
|
49
50
|
filterSnapshot: null
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
|
-
const
|
|
53
|
+
const x = () => ({
|
|
53
54
|
recommendationCampaignUrls: {},
|
|
54
55
|
activePredictiveAlgorithms: [],
|
|
55
56
|
languages: {},
|
|
@@ -58,8 +59,8 @@ const N = () => ({
|
|
|
58
59
|
blockStates: {},
|
|
59
60
|
currentRecommendationId: null,
|
|
60
61
|
configVersion: 0
|
|
61
|
-
}),
|
|
62
|
-
state: () =>
|
|
62
|
+
}), T = P("guidoRecommendationExtension", {
|
|
63
|
+
state: () => x(),
|
|
63
64
|
getters: {
|
|
64
65
|
// ====================================================================
|
|
65
66
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -378,7 +379,7 @@ const N = () => ({
|
|
|
378
379
|
const n = [...e.recommendationConfigs.filters];
|
|
379
380
|
n[r] = {
|
|
380
381
|
...t,
|
|
381
|
-
isValid:
|
|
382
|
+
isValid: w(t)
|
|
382
383
|
}, e.recommendationConfigs.filters = n;
|
|
383
384
|
}
|
|
384
385
|
},
|
|
@@ -424,7 +425,7 @@ const N = () => ({
|
|
|
424
425
|
* every block's recommendationConfigs across user edits.
|
|
425
426
|
*/
|
|
426
427
|
hasInvalidBlock() {
|
|
427
|
-
return Object.values(this.blockStates).some((t) => !
|
|
428
|
+
return Object.values(this.blockStates).some((t) => !N(t.recommendationConfigs, this));
|
|
428
429
|
},
|
|
429
430
|
// ====================================================================
|
|
430
431
|
// Per-Block Product Fetching
|
|
@@ -453,7 +454,10 @@ const N = () => ({
|
|
|
453
454
|
details: !0,
|
|
454
455
|
campaignId: o.variationId
|
|
455
456
|
};
|
|
456
|
-
r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0)
|
|
457
|
+
r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
|
|
458
|
+
a,
|
|
459
|
+
v(o.partnerName, r.strategy)
|
|
460
|
+
);
|
|
457
461
|
let f;
|
|
458
462
|
try {
|
|
459
463
|
f = await h.fetchRecommendationProducts(i, a);
|
|
@@ -471,5 +475,5 @@ const N = () => ({
|
|
|
471
475
|
}
|
|
472
476
|
});
|
|
473
477
|
export {
|
|
474
|
-
|
|
478
|
+
T as useRecommendationExtensionStore
|
|
475
479
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
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
|
-
const
|
|
1
|
+
import { RecommendationBlockId as t } from "../../constants/blockIds.js";
|
|
2
|
+
import { ATTR_PRODUCT_ATTR as k, ATTR_PRODUCT_BUTTON as R, CSS_CLASS_RECO_BUTTON as f, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, 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 s, resolveOmnibusText as x, DEFAULT_IMG_STYLE as j, sanitizeImageUrl as Y, resolveSegmentBgStyle as w } from "../utils.js";
|
|
6
|
+
const g = "0 5px", b = "attribute-cell";
|
|
7
|
+
function u(r, e = "") {
|
|
8
|
+
const l = w(e, r);
|
|
9
|
+
return `<table class="product-card-segment" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"${l ? ` style="${l}"` : ""}>`;
|
|
10
|
+
}
|
|
11
|
+
function A() {
|
|
12
|
+
const r = L(), { currencySettings: e } = r.recommendationConfigs;
|
|
9
13
|
return {
|
|
10
14
|
code: e.value,
|
|
11
15
|
symbol: e.symbol,
|
|
@@ -15,34 +19,31 @@ function g() {
|
|
|
15
19
|
thousandSeparator: e.thousandSeparator
|
|
16
20
|
};
|
|
17
21
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
price:
|
|
22
|
-
currency:
|
|
22
|
+
function m(r, e = "price") {
|
|
23
|
+
const l = A(), a = r[e], c = (a == null ? void 0 : a[l.code]) ?? Object.values(a ?? {})[0] ?? 0;
|
|
24
|
+
return D({
|
|
25
|
+
price: c,
|
|
26
|
+
currency: l
|
|
23
27
|
});
|
|
24
28
|
}
|
|
25
|
-
const
|
|
26
|
-
[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
cellpadding="0"
|
|
33
|
-
cellspacing="0"
|
|
34
|
-
border="0">
|
|
29
|
+
const Q = {
|
|
30
|
+
[I]: (r, e) => {
|
|
31
|
+
var c;
|
|
32
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? g, a = ((c = e == null ? void 0 : e.styleTemplate) == null ? void 0 : c.imgStyle) ?? j;
|
|
33
|
+
return `
|
|
34
|
+
<td class="${b}" style="padding: ${l}; height: 100%;" valign="top">
|
|
35
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
35
36
|
<tbody>
|
|
36
37
|
<tr valign="top">
|
|
37
38
|
<td
|
|
38
39
|
class="esd-block-image product-image"
|
|
39
40
|
align="center"
|
|
40
|
-
esd-extension-block-id="${
|
|
41
|
-
<a target="_blank" href="${
|
|
41
|
+
esd-extension-block-id="${t.IMAGE}">
|
|
42
|
+
<a target="_blank" href="${r.url}" class="${f}">
|
|
42
43
|
<img
|
|
43
|
-
src="${
|
|
44
|
-
alt="${
|
|
45
|
-
style="
|
|
44
|
+
src="${Y(r.image_url)}"
|
|
45
|
+
alt="${r.name}"
|
|
46
|
+
style="${a}"
|
|
46
47
|
class="adapt-img">
|
|
47
48
|
</a>
|
|
48
49
|
</td>
|
|
@@ -50,132 +51,120 @@ const S = {
|
|
|
50
51
|
</tbody>
|
|
51
52
|
</table>
|
|
52
53
|
</td>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
`;
|
|
55
|
+
},
|
|
56
|
+
[E]: (r, e) => {
|
|
57
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? g, a = T(
|
|
58
|
+
r.name,
|
|
59
|
+
{ pStyle: "font-size: 16px; color: #333333;", openTags: "<strong>", closeTags: "</strong>" },
|
|
60
|
+
e == null ? void 0 : e.styleTemplate
|
|
61
|
+
);
|
|
62
|
+
return `
|
|
63
|
+
<td class="${b}" style="padding: ${l}; height: 100%;" valign="middle">
|
|
64
|
+
${u(e == null ? void 0 : e.cardBackgroundColor, "table-layout: fixed;")}
|
|
64
65
|
<tbody>
|
|
65
66
|
<tr valign="top">
|
|
66
67
|
<td
|
|
67
|
-
class="esd-block-text product-name es-p10t es-p10b es-p15l es-p15r"
|
|
68
|
-
align="center"
|
|
69
|
-
esd-extension-block-id="${
|
|
70
|
-
|
|
71
|
-
<strong>${t.name}</strong>
|
|
72
|
-
</p>
|
|
68
|
+
class="esd-block-text product-name ${(e == null ? void 0 : e.cellClasses) ?? "es-p10t es-p10b es-p15l es-p15r"}"
|
|
69
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
70
|
+
esd-extension-block-id="${t.NAME}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
71
|
+
${a}
|
|
73
72
|
</td>
|
|
74
73
|
</tr>
|
|
75
74
|
</tbody>
|
|
76
75
|
</table>
|
|
77
76
|
</td>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
`;
|
|
78
|
+
},
|
|
79
|
+
[v]: (r, e) => {
|
|
80
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? g, a = T(
|
|
81
|
+
m(r, "price"),
|
|
82
|
+
{ pStyle: "font-size: 16px; color: #333333;", openTags: "<strong>", closeTags: "</strong>" },
|
|
83
|
+
e == null ? void 0 : e.styleTemplate
|
|
84
|
+
);
|
|
85
|
+
return `
|
|
86
|
+
<td class="${b}" style="padding: ${l}; height: 100%;" valign="top">
|
|
87
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
88
88
|
<tbody>
|
|
89
89
|
<tr valign="top">
|
|
90
90
|
<td
|
|
91
|
-
class="esd-block-text product-price es-p15l es-p15r"
|
|
92
|
-
align="center"
|
|
93
|
-
esd-extension-block-id="${
|
|
94
|
-
|
|
95
|
-
<strong>${i(t, "price")}</strong>
|
|
96
|
-
</p>
|
|
91
|
+
class="esd-block-text product-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
|
|
92
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
93
|
+
esd-extension-block-id="${t.PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
94
|
+
${a}
|
|
97
95
|
</td>
|
|
98
96
|
</tr>
|
|
99
97
|
</tbody>
|
|
100
98
|
</table>
|
|
101
99
|
</td>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
100
|
+
`;
|
|
101
|
+
},
|
|
102
|
+
[U]: (r, e) => {
|
|
103
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? g, a = T(
|
|
104
|
+
m(r, "original_price"),
|
|
105
|
+
{ pStyle: "font-size: 14px; color: #999999;", openTags: "<strong>", closeTags: "</strong>" },
|
|
106
|
+
e == null ? void 0 : e.styleTemplate
|
|
107
|
+
);
|
|
108
|
+
return `
|
|
109
|
+
<td class="${b}" style="padding: ${l}; height: 100%;" valign="top">
|
|
110
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
112
111
|
<tbody>
|
|
113
112
|
<tr valign="top">
|
|
114
113
|
<td
|
|
115
|
-
class="esd-block-text product-old-price es-p15l es-p15r"
|
|
116
|
-
align="center"
|
|
117
|
-
esd-extension-block-id="${
|
|
118
|
-
|
|
119
|
-
<strong>${i(t, "original_price")}</strong>
|
|
120
|
-
</p>
|
|
114
|
+
class="esd-block-text product-old-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
|
|
115
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
116
|
+
esd-extension-block-id="${t.OLD_PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
117
|
+
${a}
|
|
121
118
|
</td>
|
|
122
119
|
</tr>
|
|
123
120
|
</tbody>
|
|
124
121
|
</table>
|
|
125
122
|
</td>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
cellpadding="0"
|
|
134
|
-
cellspacing="0"
|
|
135
|
-
border="0">
|
|
123
|
+
`;
|
|
124
|
+
},
|
|
125
|
+
[O]: (r, e) => {
|
|
126
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? g, a = s("font-size: 12px; color: #666666;", e == null ? void 0 : e.styleTemplate), { before: c, after: d } = x(e == null ? void 0 : e.omnibusText, "Lowest 30-day price: ");
|
|
127
|
+
return `
|
|
128
|
+
<td class="${b}" style="padding: ${l}; height: 100%;" valign="top">
|
|
129
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
136
130
|
<tbody>
|
|
137
131
|
<tr valign="top">
|
|
138
132
|
<td
|
|
139
|
-
class="esd-block-text product-omnibus-price es-p15l es-p15r"
|
|
140
|
-
align="center"
|
|
141
|
-
data-text-before="
|
|
142
|
-
data-text-after=""
|
|
143
|
-
esd-extension-block-id="${
|
|
144
|
-
<p contenteditable="false" style="
|
|
145
|
-
<span class="omnibus-text-before"
|
|
146
|
-
<span class="omnibus-price-value">${
|
|
147
|
-
<span class="omnibus-text-after"
|
|
133
|
+
class="esd-block-text product-omnibus-price ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
|
|
134
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
135
|
+
data-text-before="${c}"
|
|
136
|
+
data-text-after="${d}"
|
|
137
|
+
esd-extension-block-id="${t.OMNIBUS_PRICE}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
138
|
+
<p contenteditable="false" style="${a}">
|
|
139
|
+
<span class="omnibus-text-before">${c}</span>
|
|
140
|
+
<span class="omnibus-price-value">${m(r, "original_price")}</span>
|
|
141
|
+
<span class="omnibus-text-after">${d}</span>
|
|
148
142
|
</p>
|
|
149
143
|
</td>
|
|
150
144
|
</tr>
|
|
151
145
|
</tbody>
|
|
152
146
|
</table>
|
|
153
147
|
</td>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
`;
|
|
149
|
+
},
|
|
150
|
+
[h]: (r, e) => {
|
|
151
|
+
var n, P;
|
|
152
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? g, a = s("font-size: 12px; color: #666666;", e == null ? void 0 : e.styleTemplate), c = A(), d = ((n = r.original_price) == null ? void 0 : n[c.code]) ?? Object.values(r.original_price ?? {})[0] ?? 0, y = ((P = r.price) == null ? void 0 : P[c.code]) ?? Object.values(r.price ?? {})[0] ?? 0, C = d > 0 ? Math.round((d - y) / d * 100) : 0, B = C > 0 ? `-${C}%` : "0%", { before: _, after: S } = x(e == null ? void 0 : e.omnibusText);
|
|
158
153
|
return `
|
|
159
|
-
<td class="${
|
|
160
|
-
|
|
161
|
-
class="product-card-segment"
|
|
162
|
-
width="100%"
|
|
163
|
-
height="100%"
|
|
164
|
-
cellpadding="0"
|
|
165
|
-
cellspacing="0"
|
|
166
|
-
border="0">
|
|
154
|
+
<td class="${b}" style="padding: ${l}; height: 100%;" valign="top">
|
|
155
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
167
156
|
<tbody>
|
|
168
157
|
<tr valign="top">
|
|
169
158
|
<td
|
|
170
|
-
class="esd-block-text product-omnibus-discount es-p15l es-p15r"
|
|
171
|
-
align="center"
|
|
172
|
-
data-text-before=""
|
|
173
|
-
data-text-after=""
|
|
174
|
-
esd-extension-block-id="${
|
|
175
|
-
<p contenteditable="false" style="
|
|
176
|
-
<span class="omnibus-text-before"
|
|
177
|
-
<span class="omnibus-discount-value">${
|
|
178
|
-
<span class="omnibus-text-after"
|
|
159
|
+
class="esd-block-text product-omnibus-discount ${(e == null ? void 0 : e.cellClasses) ?? "es-p15l es-p15r"}"
|
|
160
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
161
|
+
data-text-before="${_}"
|
|
162
|
+
data-text-after="${S}"
|
|
163
|
+
esd-extension-block-id="${t.OMNIBUS_DISCOUNT}"${$(e == null ? void 0 : e.cellBackgroundColor)}>
|
|
164
|
+
<p contenteditable="false" style="${a}">
|
|
165
|
+
<span class="omnibus-text-before">${_}</span>
|
|
166
|
+
<span class="omnibus-discount-value">${B}</span>
|
|
167
|
+
<span class="omnibus-text-after">${S}</span>
|
|
179
168
|
</p>
|
|
180
169
|
</td>
|
|
181
170
|
</tr>
|
|
@@ -184,43 +173,24 @@ const S = {
|
|
|
184
173
|
</td>
|
|
185
174
|
`;
|
|
186
175
|
},
|
|
187
|
-
[
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
height="100%"
|
|
193
|
-
cellpadding="0"
|
|
194
|
-
cellspacing="0"
|
|
195
|
-
border="0">
|
|
176
|
+
[R]: (r, e) => {
|
|
177
|
+
const l = (e == null ? void 0 : e.cellPadding) ?? g, a = e == null ? void 0 : e.styleTemplate, c = (a == null ? void 0 : a.buttonBorderStyle) ?? M, d = (a == null ? void 0 : a.buttonAnchorStyle) ?? z, y = F((a == null ? void 0 : a.buttonText) ?? "Buy", a);
|
|
178
|
+
return `
|
|
179
|
+
<td class="${b}" style="padding: ${l}; height: 100%;" valign="top">
|
|
180
|
+
${u(e == null ? void 0 : e.cardBackgroundColor)}
|
|
196
181
|
<tbody>
|
|
197
182
|
<tr valign="top">
|
|
198
183
|
<td
|
|
199
|
-
class="esd-block-button product-button es-p10t es-p10b"
|
|
200
|
-
align="center"
|
|
201
|
-
esd-extension-block-id="${
|
|
202
|
-
<span
|
|
203
|
-
class="es-button-border"
|
|
204
|
-
style="
|
|
205
|
-
border-width: 1px;
|
|
206
|
-
background: rgb(217, 234, 211);
|
|
207
|
-
border-color: rgb(106, 168, 79);
|
|
208
|
-
">
|
|
184
|
+
class="esd-block-button product-button ${(e == null ? void 0 : e.cellClasses) ?? "es-p10t es-p10b"}"
|
|
185
|
+
align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
|
|
186
|
+
esd-extension-block-id="${t.BUTTON}">
|
|
187
|
+
<span class="${G(a)}" style="${c}">
|
|
209
188
|
<a
|
|
210
189
|
href="#"
|
|
211
|
-
class="es-button ${
|
|
190
|
+
class="es-button ${f}"
|
|
212
191
|
target="_blank"
|
|
213
|
-
style="
|
|
214
|
-
|
|
215
|
-
background: rgb(217, 234, 211);
|
|
216
|
-
font-family: arial, 'helvetica neue', helvetica, sans-serif;
|
|
217
|
-
font-size: 16px;
|
|
218
|
-
font-weight: normal;
|
|
219
|
-
line-height: 120%;
|
|
220
|
-
mso-border-alt: 10px solid rgb(217, 234, 211);
|
|
221
|
-
mso-padding-alt: 0;
|
|
222
|
-
">
|
|
223
|
-
Buy
|
|
192
|
+
style="${d}">
|
|
193
|
+
${y}
|
|
224
194
|
</a>
|
|
225
195
|
</span>
|
|
226
196
|
</td>
|
|
@@ -228,7 +198,8 @@ const S = {
|
|
|
228
198
|
</tbody>
|
|
229
199
|
</table>
|
|
230
200
|
</td>
|
|
231
|
-
|
|
201
|
+
`;
|
|
202
|
+
},
|
|
232
203
|
/**
|
|
233
204
|
* Custom attribute cell template — same structure as built-in entries
|
|
234
205
|
* (outer td → inner product-card-segment table).
|
|
@@ -236,33 +207,33 @@ const S = {
|
|
|
236
207
|
* @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
|
|
237
208
|
* @param content - Display content for the cell
|
|
238
209
|
*/
|
|
239
|
-
[
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
style="table-layout: fixed;">
|
|
210
|
+
[N]: (r, e, l) => {
|
|
211
|
+
const a = (l == null ? void 0 : l.cellPadding) ?? g, c = T(
|
|
212
|
+
e,
|
|
213
|
+
{ pStyle: "font-size: 12px; color: #666666;", openTags: "", closeTags: "" },
|
|
214
|
+
l == null ? void 0 : l.styleTemplate
|
|
215
|
+
);
|
|
216
|
+
return `
|
|
217
|
+
<td class="${b}" style="padding: ${a}; height: 100%;" valign="middle">
|
|
218
|
+
${u(l == null ? void 0 : l.cardBackgroundColor, "table-layout: fixed;")}
|
|
249
219
|
<tbody>
|
|
250
220
|
<tr valign="top">
|
|
251
221
|
<td
|
|
252
|
-
${
|
|
253
|
-
class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
|
|
254
|
-
align="center"
|
|
255
|
-
esd-extension-block-id="${
|
|
256
|
-
|
|
222
|
+
${k}="${r}"
|
|
223
|
+
class="esd-block-text product-custom-attribute ${(l == null ? void 0 : l.cellClasses) ?? "es-p0t es-p0b es-p15l es-p15r"}"
|
|
224
|
+
align="${(l == null ? void 0 : l.cellAlignment) ?? "center"}"
|
|
225
|
+
esd-extension-block-id="${t.CUSTOM_ATTRIBUTE}"${$(l == null ? void 0 : l.cellBackgroundColor)}>
|
|
226
|
+
${c}
|
|
257
227
|
</td>
|
|
258
228
|
</tr>
|
|
259
229
|
</tbody>
|
|
260
230
|
</table>
|
|
261
231
|
</td>
|
|
262
|
-
|
|
232
|
+
`;
|
|
233
|
+
}
|
|
263
234
|
};
|
|
264
235
|
export {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
236
|
+
b as ATTRIBUTE_CELL_CLASS,
|
|
237
|
+
g as DEFAULT_CELL_PADDING,
|
|
238
|
+
Q as gridElementRenderer
|
|
268
239
|
};
|