@useinsider/guido 3.8.2 → 3.9.0-beta.1549171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/config/schemas.js +70 -66
- package/dist/composables/usePreviewMode.js +15 -14
- package/dist/composables/useRecommendationPreview.js +111 -0
- package/dist/config/compiler/recommendationCompilerRules.js +1 -1
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +88 -80
- package/dist/config/migrator/itemsBlockMigrator.js +168 -122
- package/dist/config/migrator/recommendation/htmlBuilder.js +53 -52
- package/dist/config/migrator/recommendation/settingsMapper.js +38 -33
- package/dist/enums/html-validator.js +6 -5
- package/dist/extensions/Blocks/Items/block.js +48 -29
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +17 -18
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +47 -47
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +13 -9
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +26 -14
- package/dist/extensions/Blocks/Items/template.js +229 -223
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +62 -45
- package/dist/extensions/Blocks/Recommendation/block.js +64 -42
- package/dist/extensions/Blocks/Recommendation/canvasPreview.css.js +16 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +41 -32
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +461 -363
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +99 -87
- package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +133 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +162 -160
- package/dist/extensions/Blocks/Recommendation/extension.js +30 -29
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +21 -7
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +64 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +130 -96
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +43 -54
- package/dist/extensions/Blocks/Recommendation/templates/index.js +17 -14
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +86 -80
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +31 -40
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +155 -102
- package/dist/extensions/Blocks/controlFactories.js +76 -57
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useRecommendationPreview.d.ts +10 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +3 -3
- package/dist/src/extensions/Blocks/Items/template.d.ts +7 -0
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +29 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +59 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +13 -1
- 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.d.ts +10 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +51 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +15 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +10 -1
- package/dist/src/stores/config.d.ts +36 -0
- package/package.json +1 -1
|
@@ -1,101 +1,148 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { ATTR_PRODUCT_PRICE as c, ATTR_PRODUCT_OLD_PRICE as l, ATTR_CUSTOM_PREFIX as a, PRODUCT_ATTRIBUTE_PREFIX as u, ATTR_PRODUCT_IMAGE as f, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as p, ATTR_PRODUCT_BUTTON as _ } from "../constants/selectors.js";
|
|
2
|
+
import { useRecommendationExtensionStore as D } from "../store/recommendation.js";
|
|
3
|
+
import { formatPrice as O } from "../utils/priceFormatter.js";
|
|
4
|
+
function E() {
|
|
5
|
+
const t = D(), { currencySettings: e } = t.recommendationConfigs;
|
|
6
|
+
return {
|
|
7
|
+
code: e.value,
|
|
8
|
+
symbol: e.symbol,
|
|
9
|
+
alignment: e.alignment === "0" ? "before" : "after",
|
|
10
|
+
decimalCount: parseInt(e.decimalCount) || 2,
|
|
11
|
+
decimalSeparator: e.decimalSeparator,
|
|
12
|
+
thousandSeparator: e.thousandSeparator
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function m(t, e = "price") {
|
|
16
|
+
const n = E(), o = t[e], r = (o == null ? void 0 : o[n.code]) ?? Object.values(o ?? {})[0] ?? 0;
|
|
17
|
+
return O({
|
|
18
|
+
price: r,
|
|
19
|
+
currency: n
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function Y(t) {
|
|
23
|
+
return m(t, "price") === m(t, "original_price");
|
|
24
|
+
}
|
|
25
|
+
function I(t) {
|
|
26
|
+
return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
27
|
+
}
|
|
28
|
+
function G(t) {
|
|
29
|
+
const e = t.indexOf(c), n = t.indexOf(l), o = n !== -1 && (e === -1 || n < e);
|
|
30
|
+
return {
|
|
31
|
+
originalFirst: o,
|
|
32
|
+
anchor: o ? l : c,
|
|
33
|
+
skip: o ? c : l
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function $(t) {
|
|
37
|
+
const e = Array.isArray(t) ? t[t.length - 1] : t;
|
|
38
|
+
if (typeof e == "string")
|
|
39
|
+
return e;
|
|
40
|
+
if (typeof e == "number")
|
|
41
|
+
return String(e);
|
|
42
|
+
}
|
|
43
|
+
function h(t, e) {
|
|
44
|
+
const n = Object.values(e).find((o) => o.attributeName === t);
|
|
45
|
+
return (n == null ? void 0 : n.type) === "defaultAttribute";
|
|
46
|
+
}
|
|
47
|
+
function L(t, e) {
|
|
48
|
+
return h(t, e) ? t : `${u}${t}`;
|
|
49
|
+
}
|
|
50
|
+
function j(t) {
|
|
51
|
+
const e = t.startsWith(u) ? t.substring(u.length) : t;
|
|
52
|
+
return `${a}${e}`;
|
|
53
|
+
}
|
|
54
|
+
const x = Symbol("customCellHtml");
|
|
55
|
+
function z(t, e, n = {}) {
|
|
56
|
+
const o = t[x];
|
|
26
57
|
if (!o)
|
|
27
58
|
return { ...t };
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
const i =
|
|
31
|
-
s
|
|
32
|
-
var
|
|
33
|
-
const
|
|
34
|
-
return o(
|
|
59
|
+
const r = { ...t };
|
|
60
|
+
return e.filter((s) => s.startsWith(a) && !r[s]).forEach((s) => {
|
|
61
|
+
const i = s.substring(a.length), d = I(i), S = L(i, n), A = h(i, n);
|
|
62
|
+
r[s] = (g, R) => {
|
|
63
|
+
var b;
|
|
64
|
+
const P = A ? g[i] : (b = g.product_attributes) == null ? void 0 : b[i], U = $(P) ?? d;
|
|
65
|
+
return o(S, U, R);
|
|
35
66
|
};
|
|
36
|
-
}),
|
|
67
|
+
}), r;
|
|
68
|
+
}
|
|
69
|
+
function V(t, e) {
|
|
70
|
+
var n, o, r, s, i;
|
|
71
|
+
return {
|
|
72
|
+
cellPadding: e.cellPadding,
|
|
73
|
+
cardBackgroundColor: e.cardBackgroundColor,
|
|
74
|
+
cellBackgroundColor: (n = e.cellBackgroundColors) == null ? void 0 : n[t],
|
|
75
|
+
cellAlignment: (o = e.cellAlignments) == null ? void 0 : o[t],
|
|
76
|
+
cellClasses: (r = e.cellClasses) == null ? void 0 : r[t],
|
|
77
|
+
omnibusText: (s = e.omnibusTexts) == null ? void 0 : s[t],
|
|
78
|
+
styleTemplate: (i = e.styleTemplates) == null ? void 0 : i[t]
|
|
79
|
+
};
|
|
37
80
|
}
|
|
38
|
-
const
|
|
81
|
+
const X = {
|
|
39
82
|
TITLE: "You May Also Like!"
|
|
40
|
-
},
|
|
41
|
-
b,
|
|
42
|
-
T,
|
|
43
|
-
g,
|
|
44
|
-
_,
|
|
83
|
+
}, K = [
|
|
45
84
|
f,
|
|
85
|
+
T,
|
|
86
|
+
l,
|
|
87
|
+
c,
|
|
88
|
+
C,
|
|
46
89
|
p,
|
|
47
|
-
|
|
48
|
-
],
|
|
49
|
-
[
|
|
90
|
+
_
|
|
91
|
+
], q = {
|
|
92
|
+
[f]: !0,
|
|
50
93
|
[T]: !0,
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
94
|
+
[c]: !0,
|
|
95
|
+
[l]: !0,
|
|
96
|
+
[C]: !1,
|
|
54
97
|
[p]: !1,
|
|
55
|
-
[
|
|
56
|
-
},
|
|
57
|
-
function
|
|
98
|
+
[_]: !0
|
|
99
|
+
}, B = 10;
|
|
100
|
+
function k(t = B) {
|
|
58
101
|
return `
|
|
59
102
|
<tr>
|
|
60
103
|
<td class="spacer" style="height: ${t}px;"></td>
|
|
61
104
|
</tr>
|
|
62
105
|
`;
|
|
63
106
|
}
|
|
64
|
-
const
|
|
65
|
-
function w(t,
|
|
66
|
-
return
|
|
107
|
+
const v = k();
|
|
108
|
+
function w(t, e) {
|
|
109
|
+
return e ? e.pStyle ?? "" : t;
|
|
67
110
|
}
|
|
68
|
-
function
|
|
69
|
-
const o = w(
|
|
70
|
-
return `<p contenteditable="false" style="${o}">${
|
|
111
|
+
function J(t, e, n) {
|
|
112
|
+
const o = w(e.pStyle, n), r = n ? n.openTags ?? "" : e.openTags, s = n ? n.closeTags ?? "" : e.closeTags;
|
|
113
|
+
return `<p contenteditable="false" style="${o}">${r}${t}${s}</p>`;
|
|
71
114
|
}
|
|
72
|
-
function
|
|
73
|
-
const
|
|
74
|
-
return t &&
|
|
115
|
+
function Q(t, e) {
|
|
116
|
+
const n = [];
|
|
117
|
+
return t && n.push(t), e && n.push(`background-color: ${e};`), n.join(" ");
|
|
75
118
|
}
|
|
76
|
-
function
|
|
77
|
-
return t ? `
|
|
119
|
+
function N(t) {
|
|
120
|
+
return t ? ` background-color: ${t};` : "";
|
|
121
|
+
}
|
|
122
|
+
function Z(t) {
|
|
123
|
+
const e = N(t);
|
|
124
|
+
return e ? ` style="${e.trim()}"` : "";
|
|
78
125
|
}
|
|
79
|
-
function
|
|
126
|
+
function tt(t, e = "") {
|
|
80
127
|
return {
|
|
81
|
-
before: (t == null ? void 0 : t.before) ??
|
|
128
|
+
before: (t == null ? void 0 : t.before) ?? e,
|
|
82
129
|
after: (t == null ? void 0 : t.after) ?? ""
|
|
83
130
|
};
|
|
84
131
|
}
|
|
85
|
-
function
|
|
86
|
-
return `${(
|
|
132
|
+
function et(t, e) {
|
|
133
|
+
return `${(e == null ? void 0 : e.openTags) ?? ""}${t}${(e == null ? void 0 : e.closeTags) ?? ""}`;
|
|
87
134
|
}
|
|
88
|
-
function
|
|
135
|
+
function nt(t) {
|
|
89
136
|
return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
|
|
90
137
|
}
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
return !t || typeof t != "string" || t.trim() === "" ?
|
|
138
|
+
const ot = "display: block; max-width: 100%; height: auto;", rt = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", st = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0;", y = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
|
|
139
|
+
function it(t) {
|
|
140
|
+
return !t || typeof t != "string" || t.trim() === "" ? y : t.startsWith("http://") ? t.replace("http://", "https://") : t;
|
|
94
141
|
}
|
|
95
|
-
function
|
|
142
|
+
function F(t) {
|
|
96
143
|
return {
|
|
97
144
|
name: "Product Name",
|
|
98
|
-
image_url:
|
|
145
|
+
image_url: y,
|
|
99
146
|
price: { USD: 18 },
|
|
100
147
|
original_price: { USD: 20 },
|
|
101
148
|
discount: { USD: 2 },
|
|
@@ -107,19 +154,19 @@ function B(t) {
|
|
|
107
154
|
category: []
|
|
108
155
|
};
|
|
109
156
|
}
|
|
110
|
-
function
|
|
157
|
+
function ct(t = 6) {
|
|
111
158
|
return Array.from(
|
|
112
159
|
{ length: t },
|
|
113
|
-
(
|
|
160
|
+
(e, n) => F(String(n + 1))
|
|
114
161
|
);
|
|
115
162
|
}
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
data-layout="list"` : "", o =
|
|
163
|
+
function lt(t = "grid", e) {
|
|
164
|
+
const n = t === "list" ? `
|
|
165
|
+
data-layout="list"` : "", o = e ? ` ${e}` : "";
|
|
119
166
|
return `
|
|
120
167
|
<td
|
|
121
168
|
align="left"
|
|
122
|
-
class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${o}`}"${
|
|
169
|
+
class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${o}`}"${n}>
|
|
123
170
|
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
124
171
|
<tr>
|
|
125
172
|
<td align="center">
|
|
@@ -151,7 +198,7 @@ function Q(t = "grid", n) {
|
|
|
151
198
|
</table>
|
|
152
199
|
</td>
|
|
153
200
|
</tr>
|
|
154
|
-
${
|
|
201
|
+
${v}
|
|
155
202
|
<tr>
|
|
156
203
|
<td>
|
|
157
204
|
<table
|
|
@@ -190,31 +237,37 @@ function Q(t = "grid", n) {
|
|
|
190
237
|
`;
|
|
191
238
|
}
|
|
192
239
|
export {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
240
|
+
x as CUSTOM_CELL_HTML,
|
|
241
|
+
X as DEFAULTS,
|
|
242
|
+
st as DEFAULT_BUTTON_ANCHOR_STYLE,
|
|
243
|
+
rt as DEFAULT_BUTTON_BORDER_STYLE,
|
|
244
|
+
K as DEFAULT_CARD_COMPOSITION,
|
|
245
|
+
q as DEFAULT_CARD_VISIBILITY,
|
|
246
|
+
ot as DEFAULT_IMG_STYLE,
|
|
247
|
+
B as DEFAULT_ROW_SPACING_PX,
|
|
248
|
+
y as PLACEHOLDER_IMAGE,
|
|
249
|
+
N as bgColorFragment,
|
|
250
|
+
V as buildCellOptions,
|
|
251
|
+
z as buildElementRenderer,
|
|
252
|
+
k as buildSpacer,
|
|
253
|
+
Z as cellBgStyleAttr,
|
|
254
|
+
lt as createBlockTemplate,
|
|
255
|
+
m as formatProductPrice,
|
|
256
|
+
E as getCurrentCurrencyConfig,
|
|
257
|
+
ct as getDefaultProducts,
|
|
258
|
+
h as isDefaultAttribute,
|
|
259
|
+
Y as isSamePrice,
|
|
260
|
+
et as renderButtonLabel,
|
|
261
|
+
J as renderStyledParagraph,
|
|
262
|
+
nt as resolveButtonBorderClass,
|
|
263
|
+
G as resolveInlinePriceOrder,
|
|
264
|
+
tt as resolveOmnibusText,
|
|
212
265
|
w as resolvePStyle,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
266
|
+
L as resolveProductAttrValue,
|
|
267
|
+
Q as resolveSegmentBgStyle,
|
|
268
|
+
it as sanitizeImageUrl,
|
|
269
|
+
v as spacer,
|
|
270
|
+
j as toCustomCompositionKey,
|
|
271
|
+
I as toDisplayName,
|
|
272
|
+
$ as toDisplayableAttributeValue
|
|
220
273
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TextAlignBuiltInControl as a, TextColorBuiltInControl as g, TextSizeBuiltInControl as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { TextAlignBuiltInControl as a, TextColorBuiltInControl as g, TextSizeBuiltInControl as f, TextStyleBuiltInControl as x, TextFontFamilyBuiltInControl as C, ButtonBackgroundColorBuiltInControl as T, TextPaddingsBuiltInControl as B, ImageSizeBuiltInControl as m, ImageMarginsBuiltInControl as y, ButtonAlignBuiltInControl as I, ButtonBorderBuiltInControl as S, ButtonBorderRadiusBuiltInControl as A, ButtonColorBuiltInControl as b, ButtonFontFamilyBuiltInControl as N, ButtonMarginsBuiltInControl as q, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as k, ButtonTextSizeBuiltInControl as p, ButtonTextStyleAndFontColorBuiltInControl as h, ButtonFitToContainerBuiltInControl as F, TextLineSpacingBuiltInControl as M } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
const R = "buttonTextStyleForm", _ = "backgroundColor", E = /* @__PURE__ */ new Set(["", "transparent", "rgba(0, 0, 0, 0)"]);
|
|
3
|
+
function z(o, n, r) {
|
|
4
4
|
return class extends a {
|
|
5
5
|
getId() {
|
|
6
6
|
return o;
|
|
@@ -13,7 +13,7 @@ function P(o, n, r) {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function v(o, n, r) {
|
|
17
17
|
return class extends g {
|
|
18
18
|
getId() {
|
|
19
19
|
return o;
|
|
@@ -26,8 +26,8 @@ function _(o, n, r) {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return class extends
|
|
29
|
+
function P(o, n, r) {
|
|
30
|
+
return class extends f {
|
|
31
31
|
getId() {
|
|
32
32
|
return o;
|
|
33
33
|
}
|
|
@@ -39,8 +39,8 @@ function v(o, n, r) {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return class extends
|
|
42
|
+
function D(o, n, r) {
|
|
43
|
+
return class extends x {
|
|
44
44
|
getId() {
|
|
45
45
|
return o;
|
|
46
46
|
}
|
|
@@ -52,7 +52,7 @@ function L(o, n, r) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function K(o, n, r) {
|
|
56
56
|
return class extends C {
|
|
57
57
|
getId() {
|
|
58
58
|
return o;
|
|
@@ -65,7 +65,7 @@ function R(o, n, r) {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function L(o, n, r) {
|
|
69
69
|
return class extends T {
|
|
70
70
|
getId() {
|
|
71
71
|
return o;
|
|
@@ -76,9 +76,28 @@ function O(o, n, r) {
|
|
|
76
76
|
const t = e.closest(r);
|
|
77
77
|
return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Mirrors the picked background onto each target cell as an INLINE style.
|
|
81
|
+
*
|
|
82
|
+
* Stripo's built-in applies the background as a stylesheet rule, not inline. On
|
|
83
|
+
* regeneration we re-bake the captured color inline (cellBgStyleAttr); inline then
|
|
84
|
+
* outranks Stripo's rule in the cascade, so a later re-edit silently has no effect
|
|
85
|
+
* (SD-143023). Writing the inline here keeps it the single source of truth and in
|
|
86
|
+
* sync on every edit. Merged into the parent control's single patch (no extra apply).
|
|
87
|
+
*/
|
|
88
|
+
getAdditionalModifications(e) {
|
|
89
|
+
const t = this.getTargetNodes(e);
|
|
90
|
+
if (!t.length)
|
|
91
|
+
return;
|
|
92
|
+
const s = this.api.getValues()[_], i = !s || E.has(s), c = this.api.getDocumentModifier();
|
|
93
|
+
return t.forEach((u) => {
|
|
94
|
+
const l = c.modifyHtml(u);
|
|
95
|
+
i ? l.removeStyle("background-color") : l.setStyle("background-color", s);
|
|
96
|
+
}), c;
|
|
97
|
+
}
|
|
79
98
|
};
|
|
80
99
|
}
|
|
81
|
-
function
|
|
100
|
+
function U(o, n, r) {
|
|
82
101
|
return class extends B {
|
|
83
102
|
getId() {
|
|
84
103
|
return o;
|
|
@@ -91,7 +110,7 @@ function Y(o, n, r) {
|
|
|
91
110
|
}
|
|
92
111
|
};
|
|
93
112
|
}
|
|
94
|
-
function
|
|
113
|
+
function Y(o, n, r) {
|
|
95
114
|
return class extends M {
|
|
96
115
|
getId() {
|
|
97
116
|
return o;
|
|
@@ -101,8 +120,8 @@ function w(o, n, r) {
|
|
|
101
120
|
}
|
|
102
121
|
};
|
|
103
122
|
}
|
|
104
|
-
function
|
|
105
|
-
return class extends
|
|
123
|
+
function w(o, n, r = ".ins-recommendation-product-container") {
|
|
124
|
+
return class extends I {
|
|
106
125
|
getId() {
|
|
107
126
|
return o;
|
|
108
127
|
}
|
|
@@ -112,7 +131,7 @@ function D(o, n, r = ".ins-recommendation-product-container") {
|
|
|
112
131
|
}
|
|
113
132
|
};
|
|
114
133
|
}
|
|
115
|
-
function
|
|
134
|
+
function G(o, n, r = ".ins-recommendation-product-container") {
|
|
116
135
|
return class extends b {
|
|
117
136
|
getId() {
|
|
118
137
|
return o;
|
|
@@ -123,7 +142,7 @@ function H(o, n, r = ".ins-recommendation-product-container") {
|
|
|
123
142
|
}
|
|
124
143
|
};
|
|
125
144
|
}
|
|
126
|
-
function
|
|
145
|
+
function H(o, n, r = ".ins-recommendation-product-container") {
|
|
127
146
|
return class extends S {
|
|
128
147
|
getId() {
|
|
129
148
|
return o;
|
|
@@ -134,7 +153,7 @@ function K(o, n, r = ".ins-recommendation-product-container") {
|
|
|
134
153
|
}
|
|
135
154
|
};
|
|
136
155
|
}
|
|
137
|
-
function
|
|
156
|
+
function V(o, n, r = ".ins-recommendation-product-container") {
|
|
138
157
|
return class extends A {
|
|
139
158
|
getId() {
|
|
140
159
|
return o;
|
|
@@ -145,7 +164,7 @@ function U(o, n, r = ".ins-recommendation-product-container") {
|
|
|
145
164
|
}
|
|
146
165
|
};
|
|
147
166
|
}
|
|
148
|
-
function
|
|
167
|
+
function W(o, n, r = ".ins-recommendation-product-container") {
|
|
149
168
|
return class extends N {
|
|
150
169
|
getId() {
|
|
151
170
|
return o;
|
|
@@ -156,7 +175,7 @@ function V(o, n, r = ".ins-recommendation-product-container") {
|
|
|
156
175
|
}
|
|
157
176
|
};
|
|
158
177
|
}
|
|
159
|
-
function
|
|
178
|
+
function X(o, n, r = ".ins-recommendation-product-container") {
|
|
160
179
|
return class extends q {
|
|
161
180
|
getId() {
|
|
162
181
|
return o;
|
|
@@ -167,7 +186,7 @@ function W(o, n, r = ".ins-recommendation-product-container") {
|
|
|
167
186
|
}
|
|
168
187
|
};
|
|
169
188
|
}
|
|
170
|
-
function
|
|
189
|
+
function j(o, n, r = ".ins-recommendation-product-container") {
|
|
171
190
|
return class extends $ {
|
|
172
191
|
getId() {
|
|
173
192
|
return o;
|
|
@@ -178,7 +197,7 @@ function X(o, n, r = ".ins-recommendation-product-container") {
|
|
|
178
197
|
}
|
|
179
198
|
};
|
|
180
199
|
}
|
|
181
|
-
function
|
|
200
|
+
function J(o, n, r = ".ins-recommendation-product-container") {
|
|
182
201
|
return class extends k {
|
|
183
202
|
getId() {
|
|
184
203
|
return o;
|
|
@@ -189,7 +208,7 @@ function j(o, n, r = ".ins-recommendation-product-container") {
|
|
|
189
208
|
}
|
|
190
209
|
};
|
|
191
210
|
}
|
|
192
|
-
function
|
|
211
|
+
function Q(o, n, r = ".ins-recommendation-product-container") {
|
|
193
212
|
return class extends p {
|
|
194
213
|
getId() {
|
|
195
214
|
return o;
|
|
@@ -200,8 +219,8 @@ function G(o, n, r = ".ins-recommendation-product-container") {
|
|
|
200
219
|
}
|
|
201
220
|
};
|
|
202
221
|
}
|
|
203
|
-
function
|
|
204
|
-
return class extends
|
|
222
|
+
function Z(o, n, r) {
|
|
223
|
+
return class extends h {
|
|
205
224
|
getId() {
|
|
206
225
|
return o;
|
|
207
226
|
}
|
|
@@ -223,21 +242,21 @@ function J(o, n, r) {
|
|
|
223
242
|
const t = e.closest(r);
|
|
224
243
|
if (!t)
|
|
225
244
|
return;
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
245
|
+
const s = t.querySelectorAll(`[esd-extension-block-id="${n}"] a.es-button`);
|
|
246
|
+
if (!s.length)
|
|
228
247
|
return;
|
|
229
|
-
const
|
|
230
|
-
if (!
|
|
248
|
+
const i = this.api.getValues()[R];
|
|
249
|
+
if (!i)
|
|
231
250
|
return;
|
|
232
|
-
const
|
|
233
|
-
return
|
|
234
|
-
l.modifyHtml(d).setStyle("font-weight",
|
|
251
|
+
const c = i.bold ? "bold" : "normal", u = i.italic ? "italic" : "normal", l = this.api.getDocumentModifier();
|
|
252
|
+
return s.forEach((d) => {
|
|
253
|
+
l.modifyHtml(d).setStyle("font-weight", c).setStyle("font-style", u);
|
|
235
254
|
}), l;
|
|
236
255
|
}
|
|
237
256
|
};
|
|
238
257
|
}
|
|
239
|
-
function
|
|
240
|
-
return class extends
|
|
258
|
+
function tt(o, n, r) {
|
|
259
|
+
return class extends F {
|
|
241
260
|
getId() {
|
|
242
261
|
return o;
|
|
243
262
|
}
|
|
@@ -247,8 +266,8 @@ function Q(o, n, r) {
|
|
|
247
266
|
}
|
|
248
267
|
};
|
|
249
268
|
}
|
|
250
|
-
function
|
|
251
|
-
return class extends
|
|
269
|
+
function et(o, n, r) {
|
|
270
|
+
return class extends m {
|
|
252
271
|
getId() {
|
|
253
272
|
return o;
|
|
254
273
|
}
|
|
@@ -262,7 +281,7 @@ function Z(o, n, r) {
|
|
|
262
281
|
}
|
|
263
282
|
};
|
|
264
283
|
}
|
|
265
|
-
function
|
|
284
|
+
function nt(o, n, r) {
|
|
266
285
|
return class extends y {
|
|
267
286
|
getId() {
|
|
268
287
|
return o;
|
|
@@ -278,25 +297,25 @@ function tt(o, n, r) {
|
|
|
278
297
|
};
|
|
279
298
|
}
|
|
280
299
|
export {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
w as createButtonAlignControl,
|
|
301
|
+
H as createButtonBorderControl,
|
|
302
|
+
V as createButtonBorderRadiusControl,
|
|
303
|
+
G as createButtonColorControl,
|
|
304
|
+
tt as createButtonFitToContainerControl,
|
|
305
|
+
W as createButtonFontFamilyControl,
|
|
306
|
+
X as createButtonMarginsControl,
|
|
307
|
+
j as createButtonPaddingsControl,
|
|
308
|
+
J as createButtonTextControl,
|
|
309
|
+
Q as createButtonTextSizeControl,
|
|
310
|
+
Z as createButtonTextStyleAndFontColorControl,
|
|
311
|
+
nt as createImageMarginsControl,
|
|
312
|
+
et as createImageSizeControl,
|
|
313
|
+
U as createPaddingsControl,
|
|
314
|
+
z as createTextAlignControl,
|
|
315
|
+
L as createTextBackgroundColorControl,
|
|
316
|
+
v as createTextColorControl,
|
|
317
|
+
K as createTextFontFamilyControl,
|
|
318
|
+
Y as createTextLineSpacingControl,
|
|
319
|
+
P as createTextSizeControl,
|
|
320
|
+
D as createTextStyleControl
|
|
302
321
|
};
|
|
@@ -139,6 +139,10 @@ export declare const LegacyRecommendationConfigSchema: v.LooseObjectSchema<{
|
|
|
139
139
|
readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
140
140
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
141
141
|
readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
142
|
+
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
143
|
+
readonly isPriceMovedToNextLine: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
144
|
+
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
145
|
+
readonly isPriceDeletedForZeroSale: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
142
146
|
}, undefined>;
|
|
143
147
|
/**
|
|
144
148
|
* Migration-only inputs scoped to this template.
|
|
@@ -195,6 +199,10 @@ export declare const TemplateMigrationSchema: v.ObjectSchema<{
|
|
|
195
199
|
readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
196
200
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
197
201
|
readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
202
|
+
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
203
|
+
readonly isPriceMovedToNextLine: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
204
|
+
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
205
|
+
readonly isPriceDeletedForZeroSale: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
198
206
|
}, undefined>, undefined>, {}>;
|
|
199
207
|
}, undefined>;
|
|
200
208
|
/**
|
|
@@ -274,6 +282,10 @@ export declare const TemplateSchema: v.ObjectSchema<{
|
|
|
274
282
|
readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
275
283
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
276
284
|
readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
285
|
+
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
286
|
+
readonly isPriceMovedToNextLine: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
287
|
+
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
288
|
+
readonly isPriceDeletedForZeroSale: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
277
289
|
}, undefined>, undefined>, {}>;
|
|
278
290
|
}, undefined>, {}>;
|
|
279
291
|
}, undefined>;
|
|
@@ -665,6 +677,10 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
665
677
|
readonly size: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
666
678
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
667
679
|
readonly verticalResponsiveness: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
680
|
+
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
681
|
+
readonly isPriceMovedToNextLine: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
682
|
+
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
683
|
+
readonly isPriceDeletedForZeroSale: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
668
684
|
}, undefined>, undefined>, {}>;
|
|
669
685
|
}, undefined>, {}>;
|
|
670
686
|
}, undefined>, {}>;
|
|
@@ -60,6 +60,8 @@ export declare const useConfig: () => {
|
|
|
60
60
|
blockType?: string | undefined;
|
|
61
61
|
size?: string | number | undefined;
|
|
62
62
|
verticalResponsiveness?: boolean | undefined;
|
|
63
|
+
isPriceMovedToNextLine?: boolean | undefined;
|
|
64
|
+
isPriceDeletedForZeroSale?: boolean | undefined;
|
|
63
65
|
} & {
|
|
64
66
|
[key: string]: unknown;
|
|
65
67
|
};
|
|
@@ -186,6 +188,8 @@ export declare const useConfig: () => {
|
|
|
186
188
|
blockType?: string | undefined;
|
|
187
189
|
size?: string | number | undefined;
|
|
188
190
|
verticalResponsiveness?: boolean | undefined;
|
|
191
|
+
isPriceMovedToNextLine?: boolean | undefined;
|
|
192
|
+
isPriceDeletedForZeroSale?: boolean | undefined;
|
|
189
193
|
} & {
|
|
190
194
|
[key: string]: unknown;
|
|
191
195
|
};
|