@useinsider/guido 3.0.0-beta.7a5aecd → 3.0.0-beta.7d3a300
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/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +1 -1
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +2 -2
- package/dist/config/compiler/unsubscribeCompilerRules.js +14 -14
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +29 -18
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/extensions/Blocks/Recommendation/block.js +4 -1
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -12
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +693 -144
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +78 -0
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +27 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +96 -88
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +83 -81
- package/dist/extensions/Blocks/Recommendation/extension.js +18 -16
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +126 -2
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +124 -106
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +8 -7
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +63 -34
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -33
- package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +28 -13
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +25 -44
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +62 -38
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +324 -218
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +8 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +134 -44
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +105 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +37 -2
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/static/styles/components/button.css.js +13 -7
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/dist/static/styles/variables.css.js +3 -0
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as S, SettingsPanelTab as
|
|
1
|
+
import { SettingsPanelRegistry as S, SettingsPanelTab as _, SettingsTab as O, ContainerControls as E, TextControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { BLOCK_ID as R } from "./block.js";
|
|
3
3
|
import { RecommendationBlockId as N } from "./constants/blockIds.js";
|
|
4
|
-
import { RecommendationControlId as
|
|
5
|
-
import { CONTROL_BLOCK_ID as
|
|
4
|
+
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
|
+
import { CONTROL_BLOCK_ID as U } from "./controls/main/index.js";
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
7
|
import "./controls/name/index.js";
|
|
8
8
|
import "./controls/price/index.js";
|
|
@@ -11,163 +11,181 @@ import "./controls/omnibusPrice/index.js";
|
|
|
11
11
|
import "./controls/omnibusDiscount/index.js";
|
|
12
12
|
import "./controls/button/index.js";
|
|
13
13
|
import "./controls/image/index.js";
|
|
14
|
-
import { SPACING_CONTROL_ID as
|
|
15
|
-
import { CARD_BACKGROUND_COLOR_CONTROL_ID as
|
|
14
|
+
import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
|
|
15
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as L } from "./controls/cardBackground/index.js";
|
|
16
16
|
import { LAYOUT_CONTROL_ID as D } from "./controls/layout/index.js";
|
|
17
|
-
import { COMPOSITION_CONTROL_BLOCK_ID as
|
|
18
|
-
class
|
|
19
|
-
registerBlockControls(
|
|
20
|
-
|
|
21
|
-
new
|
|
22
|
-
|
|
23
|
-
[
|
|
24
|
-
|
|
17
|
+
import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
|
|
18
|
+
class d extends S {
|
|
19
|
+
registerBlockControls(I) {
|
|
20
|
+
I[R] = [
|
|
21
|
+
new _(
|
|
22
|
+
O.SETTINGS,
|
|
23
|
+
[
|
|
24
|
+
U,
|
|
25
25
|
E.EXTERNAL_INDENTS
|
|
26
26
|
]
|
|
27
27
|
),
|
|
28
|
-
new
|
|
29
|
-
|
|
28
|
+
new _(
|
|
29
|
+
O.STYLES,
|
|
30
30
|
[
|
|
31
31
|
C.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
32
|
-
|
|
32
|
+
L,
|
|
33
33
|
D,
|
|
34
|
-
|
|
34
|
+
A
|
|
35
35
|
]
|
|
36
36
|
),
|
|
37
|
-
new
|
|
37
|
+
new _(
|
|
38
38
|
"Card Composition",
|
|
39
39
|
[
|
|
40
|
-
|
|
40
|
+
B
|
|
41
41
|
]
|
|
42
42
|
).withLabel("Card Composition")
|
|
43
|
-
],
|
|
44
|
-
new
|
|
45
|
-
|
|
43
|
+
], I[N.NAME] = [
|
|
44
|
+
new _(
|
|
45
|
+
O.SETTINGS,
|
|
46
|
+
[
|
|
47
|
+
T.NAME_STYLE,
|
|
48
|
+
T.NAME_ALIGN,
|
|
49
|
+
T.NAME_TEXT_TRIM,
|
|
50
|
+
T.NAME_PADDINGS
|
|
51
|
+
]
|
|
52
|
+
),
|
|
53
|
+
new _(
|
|
54
|
+
O.STYLES,
|
|
55
|
+
[
|
|
56
|
+
T.NAME_BACKGROUND,
|
|
57
|
+
T.NAME_FONT_FAMILY,
|
|
58
|
+
T.NAME_SIZE,
|
|
59
|
+
T.NAME_COLOR
|
|
60
|
+
]
|
|
61
|
+
)
|
|
62
|
+
], I[N.PRICE] = [
|
|
63
|
+
new _(
|
|
64
|
+
O.SETTINGS,
|
|
46
65
|
[
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_.NAME_PADDINGS
|
|
66
|
+
T.PRICE_STYLE,
|
|
67
|
+
T.PRICE_ALIGN,
|
|
68
|
+
T.PRICE_PADDINGS
|
|
51
69
|
]
|
|
52
70
|
),
|
|
53
|
-
new
|
|
54
|
-
|
|
71
|
+
new _(
|
|
72
|
+
O.STYLES,
|
|
55
73
|
[
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
T.PRICE_BACKGROUND,
|
|
75
|
+
T.PRICE_FONT_FAMILY,
|
|
76
|
+
T.PRICE_SIZE,
|
|
77
|
+
T.PRICE_COLOR
|
|
60
78
|
]
|
|
61
79
|
)
|
|
62
|
-
],
|
|
63
|
-
new
|
|
64
|
-
|
|
80
|
+
], I[N.OLD_PRICE] = [
|
|
81
|
+
new _(
|
|
82
|
+
O.SETTINGS,
|
|
65
83
|
[
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
T.OLD_PRICE_STYLE,
|
|
85
|
+
T.OLD_PRICE_ALIGN,
|
|
86
|
+
T.OLD_PRICE_PADDINGS
|
|
69
87
|
]
|
|
70
88
|
),
|
|
71
|
-
new
|
|
72
|
-
|
|
89
|
+
new _(
|
|
90
|
+
O.STYLES,
|
|
73
91
|
[
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
92
|
+
T.OLD_PRICE_BACKGROUND,
|
|
93
|
+
T.OLD_PRICE_FONT_FAMILY,
|
|
94
|
+
T.OLD_PRICE_SIZE,
|
|
95
|
+
T.OLD_PRICE_COLOR
|
|
78
96
|
]
|
|
79
97
|
)
|
|
80
|
-
],
|
|
81
|
-
new
|
|
82
|
-
|
|
98
|
+
], I[N.OMNIBUS_PRICE] = [
|
|
99
|
+
new _(
|
|
100
|
+
O.SETTINGS,
|
|
83
101
|
[
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
102
|
+
T.OMNIBUS_PRICE_TEXT_BEFORE,
|
|
103
|
+
T.OMNIBUS_PRICE_TEXT_AFTER,
|
|
104
|
+
T.OMNIBUS_PRICE_STYLE,
|
|
105
|
+
T.OMNIBUS_PRICE_ALIGN,
|
|
106
|
+
T.OMNIBUS_PRICE_PADDINGS
|
|
87
107
|
]
|
|
88
108
|
),
|
|
89
|
-
new
|
|
90
|
-
|
|
109
|
+
new _(
|
|
110
|
+
O.STYLES,
|
|
91
111
|
[
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
112
|
+
T.OMNIBUS_PRICE_BACKGROUND,
|
|
113
|
+
T.OMNIBUS_PRICE_FONT_FAMILY,
|
|
114
|
+
T.OMNIBUS_PRICE_SIZE,
|
|
115
|
+
T.OMNIBUS_PRICE_COLOR
|
|
96
116
|
]
|
|
97
117
|
)
|
|
98
|
-
],
|
|
99
|
-
new
|
|
100
|
-
|
|
118
|
+
], I[N.OMNIBUS_DISCOUNT] = [
|
|
119
|
+
new _(
|
|
120
|
+
O.SETTINGS,
|
|
101
121
|
[
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
T.OMNIBUS_DISCOUNT_TEXT_BEFORE,
|
|
123
|
+
T.OMNIBUS_DISCOUNT_TEXT_AFTER,
|
|
124
|
+
T.OMNIBUS_DISCOUNT_STYLE,
|
|
125
|
+
T.OMNIBUS_DISCOUNT_ALIGN,
|
|
126
|
+
T.OMNIBUS_DISCOUNT_PADDINGS
|
|
107
127
|
]
|
|
108
128
|
),
|
|
109
|
-
new
|
|
110
|
-
|
|
129
|
+
new _(
|
|
130
|
+
O.STYLES,
|
|
111
131
|
[
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
132
|
+
T.OMNIBUS_DISCOUNT_BACKGROUND,
|
|
133
|
+
T.OMNIBUS_DISCOUNT_FONT_FAMILY,
|
|
134
|
+
T.OMNIBUS_DISCOUNT_SIZE,
|
|
135
|
+
T.OMNIBUS_DISCOUNT_COLOR
|
|
116
136
|
]
|
|
117
137
|
)
|
|
118
|
-
],
|
|
119
|
-
new
|
|
120
|
-
|
|
138
|
+
], I[N.BUTTON] = [
|
|
139
|
+
new _(
|
|
140
|
+
O.SETTINGS,
|
|
121
141
|
[
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
_.OMNIBUS_DISCOUNT_PADDINGS
|
|
142
|
+
T.BUTTON_TEXT,
|
|
143
|
+
T.BUTTON_ALIGN,
|
|
144
|
+
T.BUTTON_PADDINGS,
|
|
145
|
+
T.BUTTON_MARGINS
|
|
127
146
|
]
|
|
128
147
|
),
|
|
129
|
-
new
|
|
130
|
-
|
|
148
|
+
new _(
|
|
149
|
+
O.STYLES,
|
|
131
150
|
[
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
T.BUTTON_COLOR,
|
|
152
|
+
T.BUTTON_FONT_FAMILY,
|
|
153
|
+
T.BUTTON_TEXT_SIZE,
|
|
154
|
+
T.BUTTON_TEXT_STYLE_AND_FONT_COLOR,
|
|
155
|
+
T.BUTTON_FIT_TO_CONTENT,
|
|
156
|
+
T.BUTTON_BORDER_RADIUS,
|
|
157
|
+
T.BUTTON_BORDER
|
|
136
158
|
]
|
|
137
159
|
)
|
|
138
|
-
],
|
|
139
|
-
new
|
|
140
|
-
|
|
160
|
+
], I[N.CUSTOM_ATTRIBUTE] = [
|
|
161
|
+
new _(
|
|
162
|
+
O.SETTINGS,
|
|
141
163
|
[
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
_.BUTTON_MARGINS
|
|
164
|
+
T.CUSTOM_ATTR_STYLE,
|
|
165
|
+
T.CUSTOM_ATTR_ALIGN,
|
|
166
|
+
T.CUSTOM_ATTR_PADDINGS
|
|
146
167
|
]
|
|
147
168
|
),
|
|
148
|
-
new
|
|
149
|
-
|
|
169
|
+
new _(
|
|
170
|
+
O.STYLES,
|
|
150
171
|
[
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
_.BUTTON_FIT_TO_CONTENT,
|
|
156
|
-
_.BUTTON_BORDER_RADIUS,
|
|
157
|
-
_.BUTTON_BORDER
|
|
172
|
+
T.CUSTOM_ATTR_BACKGROUND,
|
|
173
|
+
T.CUSTOM_ATTR_FONT_FAMILY,
|
|
174
|
+
T.CUSTOM_ATTR_SIZE,
|
|
175
|
+
T.CUSTOM_ATTR_COLOR
|
|
158
176
|
]
|
|
159
177
|
)
|
|
160
|
-
],
|
|
161
|
-
new
|
|
162
|
-
|
|
178
|
+
], I[N.IMAGE] = [
|
|
179
|
+
new _(
|
|
180
|
+
O.SETTINGS,
|
|
163
181
|
[
|
|
164
|
-
|
|
165
|
-
|
|
182
|
+
T.IMAGE_SIZE,
|
|
183
|
+
T.IMAGE_MARGINS
|
|
166
184
|
]
|
|
167
185
|
)
|
|
168
186
|
];
|
|
169
187
|
}
|
|
170
188
|
}
|
|
171
189
|
export {
|
|
172
|
-
|
|
190
|
+
d as SettingsPanel
|
|
173
191
|
};
|
|
@@ -5,11 +5,11 @@ import { defineStore as G } from "pinia";
|
|
|
5
5
|
import { DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
6
6
|
import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
|
|
7
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
8
|
-
import { generateCompleteFilterQuery as
|
|
8
|
+
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
9
9
|
import { isFilterValid as D } from "../validation/filterSchema.js";
|
|
10
10
|
const h = y();
|
|
11
11
|
let u = null, m = null, d = null;
|
|
12
|
-
function
|
|
12
|
+
function I() {
|
|
13
13
|
return {
|
|
14
14
|
cardsInRow: F,
|
|
15
15
|
currencySettings: {
|
|
@@ -32,12 +32,13 @@ function b() {
|
|
|
32
32
|
strategy: "mostPopular",
|
|
33
33
|
textTrimming: !0,
|
|
34
34
|
unresponsive: !1,
|
|
35
|
-
size: "6"
|
|
35
|
+
size: "6",
|
|
36
|
+
customAttributes: []
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
39
|
function P() {
|
|
39
40
|
return {
|
|
40
|
-
recommendationConfigs:
|
|
41
|
+
recommendationConfigs: I(),
|
|
41
42
|
recommendationProducts: [],
|
|
42
43
|
filterStatus: !1,
|
|
43
44
|
filterSelectionDrawerStatus: !1,
|
|
@@ -66,7 +67,7 @@ const v = () => ({
|
|
|
66
67
|
* This allows all existing code that reads `store.recommendationConfigs` to work unchanged.
|
|
67
68
|
*/
|
|
68
69
|
recommendationConfigs(t) {
|
|
69
|
-
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs :
|
|
70
|
+
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].recommendationConfigs : I();
|
|
70
71
|
},
|
|
71
72
|
/**
|
|
72
73
|
* Proxy getter: delegates to blockStates[currentRecommendationId].recommendationProducts
|
|
@@ -352,7 +353,7 @@ const v = () => ({
|
|
|
352
353
|
}), r.recommendationConfigs.filters = e;
|
|
353
354
|
},
|
|
354
355
|
generateFilterQuery() {
|
|
355
|
-
return
|
|
356
|
+
return b(this.recommendationConfigs.filters);
|
|
356
357
|
},
|
|
357
358
|
// ====================================================================
|
|
358
359
|
// Per-Block Product Fetching
|
|
@@ -373,7 +374,7 @@ const v = () => ({
|
|
|
373
374
|
},
|
|
374
375
|
async _doFetchProducts() {
|
|
375
376
|
var p;
|
|
376
|
-
const t = this.currentRecommendationId, r = this.blockStates[t], { recommendationConfigs: e } = r, n = e.filters.filter((a) => a.isValid), c =
|
|
377
|
+
const t = this.currentRecommendationId, r = this.blockStates[t], { recommendationConfigs: e } = r, n = e.filters.filter((a) => a.isValid), c = b(n), i = ((p = g.find((a) => a.key === e.strategy)) == null ? void 0 : p.path) || "", o = C(), s = {
|
|
377
378
|
locale: e.language,
|
|
378
379
|
currency: e.currencySettings.value,
|
|
379
380
|
partnerName: o.partnerName,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RecommendationBlockId as s } from "../../constants/blockIds.js";
|
|
2
|
-
import { ATTR_PRODUCT_BUTTON as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { formatPrice as
|
|
5
|
-
import { sanitizeImageUrl as
|
|
6
|
-
const a = "0 5px",
|
|
2
|
+
import { ATTR_PRODUCT_ATTR as g, ATTR_PRODUCT_BUTTON as u, ATTR_PRODUCT_OMNIBUS_DISCOUNT as m, ATTR_PRODUCT_OMNIBUS_PRICE as h, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as f, ATTR_PRODUCT_IMAGE as _ } from "../../constants/selectors.js";
|
|
3
|
+
import { useRecommendationExtensionStore as x } from "../../store/recommendation.js";
|
|
4
|
+
import { formatPrice as $ } from "../../utils/priceFormatter.js";
|
|
5
|
+
import { sanitizeImageUrl as C, CUSTOM_CELL_HTML as R } from "../utils.js";
|
|
6
|
+
const a = "0 5px", l = "attribute-cell";
|
|
7
7
|
function p() {
|
|
8
|
-
const t =
|
|
8
|
+
const t = x(), { currencySettings: e } = t.recommendationConfigs;
|
|
9
9
|
return {
|
|
10
10
|
code: e.value,
|
|
11
11
|
symbol: e.symbol,
|
|
@@ -15,16 +15,16 @@ function p() {
|
|
|
15
15
|
thousandSeparator: e.thousandSeparator
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
price:
|
|
22
|
-
currency:
|
|
18
|
+
function r(t, e = "price") {
|
|
19
|
+
const o = p(), n = t[e], d = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
|
|
20
|
+
return $({
|
|
21
|
+
price: d,
|
|
22
|
+
currency: o
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
[
|
|
27
|
-
<td class="${
|
|
25
|
+
const I = {
|
|
26
|
+
[_]: (t) => `
|
|
27
|
+
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
28
28
|
<table
|
|
29
29
|
class="product-card-segment"
|
|
30
30
|
width="100%"
|
|
@@ -40,7 +40,7 @@ const P = {
|
|
|
40
40
|
esd-extension-block-id="${s.IMAGE}">
|
|
41
41
|
<a target="_blank" href="${t.url}">
|
|
42
42
|
<img
|
|
43
|
-
src="${
|
|
43
|
+
src="${C(t.image_url)}"
|
|
44
44
|
alt="${t.name}"
|
|
45
45
|
style="display: block; max-width: 100%; height: auto;"
|
|
46
46
|
class="adapt-img">
|
|
@@ -52,7 +52,7 @@ const P = {
|
|
|
52
52
|
</td>
|
|
53
53
|
`,
|
|
54
54
|
[f]: (t) => `
|
|
55
|
-
<td class="${
|
|
55
|
+
<td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
|
|
56
56
|
<table
|
|
57
57
|
class="product-card-segment"
|
|
58
58
|
width="100%"
|
|
@@ -76,8 +76,8 @@ const P = {
|
|
|
76
76
|
</table>
|
|
77
77
|
</td>
|
|
78
78
|
`,
|
|
79
|
-
[
|
|
80
|
-
<td class="${
|
|
79
|
+
[T]: (t) => `
|
|
80
|
+
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
81
81
|
<table
|
|
82
82
|
class="product-card-segment"
|
|
83
83
|
width="100%"
|
|
@@ -92,7 +92,7 @@ const P = {
|
|
|
92
92
|
align="center"
|
|
93
93
|
esd-extension-block-id="${s.PRICE}">
|
|
94
94
|
<p contenteditable="false" style="font-size: 16px; color: #333333;">
|
|
95
|
-
<strong>${
|
|
95
|
+
<strong>${r(t, "price")}</strong>
|
|
96
96
|
</p>
|
|
97
97
|
</td>
|
|
98
98
|
</tr>
|
|
@@ -100,8 +100,8 @@ const P = {
|
|
|
100
100
|
</table>
|
|
101
101
|
</td>
|
|
102
102
|
`,
|
|
103
|
-
[
|
|
104
|
-
<td class="${
|
|
103
|
+
[y]: (t) => `
|
|
104
|
+
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
105
105
|
<table
|
|
106
106
|
class="product-card-segment"
|
|
107
107
|
width="100%"
|
|
@@ -116,7 +116,7 @@ const P = {
|
|
|
116
116
|
align="center"
|
|
117
117
|
esd-extension-block-id="${s.OLD_PRICE}">
|
|
118
118
|
<p contenteditable="false" style="font-size: 14px; color: #999999;">
|
|
119
|
-
<strong>${
|
|
119
|
+
<strong>${r(t, "original_price")}</strong>
|
|
120
120
|
</p>
|
|
121
121
|
</td>
|
|
122
122
|
</tr>
|
|
@@ -124,8 +124,8 @@ const P = {
|
|
|
124
124
|
</table>
|
|
125
125
|
</td>
|
|
126
126
|
`,
|
|
127
|
-
[
|
|
128
|
-
<td class="${
|
|
127
|
+
[h]: (t) => `
|
|
128
|
+
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
129
129
|
<table
|
|
130
130
|
class="product-card-segment"
|
|
131
131
|
width="100%"
|
|
@@ -143,7 +143,7 @@ const P = {
|
|
|
143
143
|
esd-extension-block-id="${s.OMNIBUS_PRICE}">
|
|
144
144
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">
|
|
145
145
|
<span class="omnibus-text-before">Lowest 30-day price: </span>
|
|
146
|
-
<span class="omnibus-price-value">${
|
|
146
|
+
<span class="omnibus-price-value">${r(t, "original_price")}</span>
|
|
147
147
|
<span class="omnibus-text-after"></span>
|
|
148
148
|
</p>
|
|
149
149
|
</td>
|
|
@@ -152,11 +152,11 @@ const P = {
|
|
|
152
152
|
</table>
|
|
153
153
|
</td>
|
|
154
154
|
`,
|
|
155
|
-
[
|
|
156
|
-
var
|
|
157
|
-
const e = p(),
|
|
155
|
+
[m]: (t) => {
|
|
156
|
+
var c, i;
|
|
157
|
+
const e = p(), o = ((c = t.original_price) == null ? void 0 : c[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((i = t.price) == null ? void 0 : i[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, d = o > 0 ? Math.round((o - n) / o * 100) : 0, b = d > 0 ? `-${d}%` : "0%";
|
|
158
158
|
return `
|
|
159
|
-
<td class="${
|
|
159
|
+
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
160
160
|
<table
|
|
161
161
|
class="product-card-segment"
|
|
162
162
|
width="100%"
|
|
@@ -174,7 +174,7 @@ const P = {
|
|
|
174
174
|
esd-extension-block-id="${s.OMNIBUS_DISCOUNT}">
|
|
175
175
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">
|
|
176
176
|
<span class="omnibus-text-before"></span>
|
|
177
|
-
<span class="omnibus-discount-value">${
|
|
177
|
+
<span class="omnibus-discount-value">${b}</span>
|
|
178
178
|
<span class="omnibus-text-after"></span>
|
|
179
179
|
</p>
|
|
180
180
|
</td>
|
|
@@ -184,8 +184,8 @@ const P = {
|
|
|
184
184
|
</td>
|
|
185
185
|
`;
|
|
186
186
|
},
|
|
187
|
-
[
|
|
188
|
-
<td class="${
|
|
187
|
+
[u]: () => `
|
|
188
|
+
<td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
|
|
189
189
|
<table
|
|
190
190
|
class="product-card-segment"
|
|
191
191
|
width="100%"
|
|
@@ -219,10 +219,39 @@ const P = {
|
|
|
219
219
|
</tbody>
|
|
220
220
|
</table>
|
|
221
221
|
</td>
|
|
222
|
+
`,
|
|
223
|
+
/**
|
|
224
|
+
* Custom attribute cell template — same structure as built-in entries
|
|
225
|
+
* (outer td → inner product-card-segment table).
|
|
226
|
+
* Used by `buildElementRenderer` for `customAttr:*` composition entries.
|
|
227
|
+
*/
|
|
228
|
+
[R]: (t, e) => `
|
|
229
|
+
<td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
|
|
230
|
+
<table
|
|
231
|
+
class="product-card-segment"
|
|
232
|
+
width="100%"
|
|
233
|
+
height="100%"
|
|
234
|
+
cellpadding="0"
|
|
235
|
+
cellspacing="0"
|
|
236
|
+
border="0"
|
|
237
|
+
style="table-layout: fixed;">
|
|
238
|
+
<tbody>
|
|
239
|
+
<tr valign="top">
|
|
240
|
+
<td
|
|
241
|
+
${g}="product_attribute.${t}"
|
|
242
|
+
class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
|
|
243
|
+
align="center"
|
|
244
|
+
esd-extension-block-id="${s.CUSTOM_ATTRIBUTE}">
|
|
245
|
+
<p contenteditable="false" style="font-size: 12px; color: #666666;">${e}</p>
|
|
246
|
+
</td>
|
|
247
|
+
</tr>
|
|
248
|
+
</tbody>
|
|
249
|
+
</table>
|
|
250
|
+
</td>
|
|
222
251
|
`
|
|
223
252
|
};
|
|
224
253
|
export {
|
|
225
|
-
|
|
254
|
+
l as ATTRIBUTE_CELL_CLASS,
|
|
226
255
|
a as DEFAULT_CELL_PADDING,
|
|
227
|
-
|
|
256
|
+
I as gridElementRenderer
|
|
228
257
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_PRODUCTS_PER_ROW as m, DEFAULT_MOBILE_CARDS_IN_ROW as
|
|
2
|
-
import { DEFAULT_CARD_COMPOSITION as
|
|
3
|
-
import { gridElementRenderer as
|
|
4
|
-
const
|
|
1
|
+
import { DEFAULT_PRODUCTS_PER_ROW as m, DEFAULT_MOBILE_CARDS_IN_ROW as E } from "../../constants/layout.js";
|
|
2
|
+
import { DEFAULT_CARD_COMPOSITION as I, spacer as _, getDefaultProducts as S, createBlockTemplate as b, DEFAULTS as A, buildElementRenderer as D, DEFAULT_CARD_VISIBILITY as w } from "../utils.js";
|
|
3
|
+
import { gridElementRenderer as f, ATTRIBUTE_CELL_CLASS as C, DEFAULT_CELL_PADDING as O } from "./elementRenderer.js";
|
|
4
|
+
const U = `
|
|
5
5
|
<tr class="recommendation-product-row">
|
|
6
6
|
<td>
|
|
7
7
|
<table
|
|
@@ -18,7 +18,7 @@ const O = `
|
|
|
18
18
|
</table>
|
|
19
19
|
</td>
|
|
20
20
|
</tr>
|
|
21
|
-
`,
|
|
21
|
+
`, g = `
|
|
22
22
|
<tr
|
|
23
23
|
class="recommendation-attribute-row"
|
|
24
24
|
data-attribute-type="{-{-ATTR_TYPE-}-}"
|
|
@@ -27,40 +27,37 @@ const O = `
|
|
|
27
27
|
{-{-CELLS-}-}
|
|
28
28
|
</tr>
|
|
29
29
|
`;
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
const p =
|
|
34
|
-
|
|
35
|
-
return L(R).replace("<td", `<td width="${c}%"`);
|
|
36
|
-
}).join("");
|
|
37
|
-
return U.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", T).replace("{-{-CELLS-}-}", u + i);
|
|
30
|
+
function P(t, e, l, o = I) {
|
|
31
|
+
const n = (100 / e).toFixed(2), c = e - t.length, r = `<td class="${C}" style="padding: ${O};" width="${n}%"></td>`, i = c > 0 ? r.repeat(c) : "", a = D(l, o);
|
|
32
|
+
return o.filter((s) => a[s]).map((s) => {
|
|
33
|
+
const p = w[s] ?? !0, u = p ? "" : 'style="display: none;"', R = t.map((L) => a[s](L).replace("<td", `<td width="${n}%"`)).join("");
|
|
34
|
+
return g.replace("{-{-ATTR_TYPE-}-}", s).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", R + i);
|
|
38
35
|
}).join("");
|
|
39
36
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
for (let
|
|
43
|
-
|
|
44
|
-
return
|
|
45
|
-
const a =
|
|
46
|
-
o,
|
|
47
|
-
e,
|
|
37
|
+
function h(t, e, l, o) {
|
|
38
|
+
const n = [];
|
|
39
|
+
for (let r = 0; r < t.length; r += e)
|
|
40
|
+
n.push(t.slice(r, r + e));
|
|
41
|
+
return n.map((r, i) => {
|
|
42
|
+
const a = P(
|
|
48
43
|
r,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
e,
|
|
45
|
+
l,
|
|
46
|
+
o
|
|
47
|
+
), d = U.replace("{-{-ATTRIBUTE_ROWS-}-}", a);
|
|
48
|
+
return i > 0 ? _ + d : d;
|
|
52
49
|
}).join("");
|
|
53
50
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
51
|
+
function T(t, e, l) {
|
|
52
|
+
return h(t, e, f, l);
|
|
56
53
|
}
|
|
57
|
-
function
|
|
58
|
-
const e = t ? `ins-recommendation-v3-block-${t}` : void 0,
|
|
59
|
-
return
|
|
54
|
+
function F(t) {
|
|
55
|
+
const e = t ? `ins-recommendation-v3-block-${t}` : void 0, l = b("grid", e), o = S(), n = T(o, m), c = T(o, E);
|
|
56
|
+
return l.replace("{-{-TITLE-}-}", A.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", c);
|
|
60
57
|
}
|
|
61
58
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
F as getDefaultTemplate,
|
|
60
|
+
P as prepareGridAttributeRows,
|
|
61
|
+
h as prepareGridProductRows,
|
|
62
|
+
T as prepareProductRows
|
|
66
63
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
|
|
2
|
-
import { prepareProductRows as
|
|
3
|
-
import { prepareProductRows as
|
|
4
|
-
function
|
|
5
|
-
if (
|
|
6
|
-
return
|
|
7
|
-
const { productsPerRow: t = s, composition: e } =
|
|
8
|
-
return
|
|
2
|
+
import { prepareProductRows as c } from "./grid/template.js";
|
|
3
|
+
import { prepareProductRows as i } from "./list/template.js";
|
|
4
|
+
function P(r, p, o = {}) {
|
|
5
|
+
if (p === "list")
|
|
6
|
+
return i(r, o.composition);
|
|
7
|
+
const { productsPerRow: t = s, composition: e } = o;
|
|
8
|
+
return c(r, t, e);
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
P as prepareProductRows
|
|
12
12
|
};
|