@useinsider/guido 3.15.1-beta.6da4177 → 3.16.0-beta.0faee0c
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 +108 -92
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +78 -75
- package/dist/composables/useActionsApi.js +30 -22
- package/dist/composables/useEmailTemplateApplier.js +25 -23
- package/dist/composables/useHtmlValidator.js +85 -83
- package/dist/composables/useStripo.js +30 -29
- package/dist/composables/useTimerClone.js +21 -19
- package/dist/config/migrator/checkboxMigrator.js +20 -19
- package/dist/config/migrator/radioButtonMigrator.js +26 -25
- package/dist/extensions/Blocks/Checkbox/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Checkbox/constants/selectors.js +6 -0
- package/dist/extensions/Blocks/Checkbox/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +15 -14
- package/dist/extensions/Blocks/Checkbox/template.js +10 -9
- package/dist/extensions/Blocks/Items/block.js +44 -42
- package/dist/extensions/Blocks/Items/template.js +86 -86
- package/dist/extensions/Blocks/RadioButton/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/RadioButton/constants/selectors.js +6 -0
- package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +12 -11
- package/dist/extensions/Blocks/RadioButton/template.js +16 -9
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +5 -9
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +98 -113
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +21 -0
- package/dist/extensions/Blocks/controlFactories.js +117 -115
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -7
- package/dist/node_modules/valibot/dist/index.js +230 -216
- package/dist/public/trackingIds.js +8 -0
- package/dist/src/@types/config/schemas.d.ts +20 -0
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/trackingIds.d.ts +9 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/utils/linkTrackingIds.d.ts +30 -0
- package/dist/stores/editor.js +4 -1
- package/dist/stores/onboarding.js +11 -7
- package/dist/utils/linkTrackingIds.js +56 -0
- package/dist/utils/pairProductVariables.js +105 -99
- package/dist/utils/templatePreparation.js +72 -61
- package/package.json +5 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { escapeHtml as m } from "../../../utils/htmlEscape.js";
|
|
2
2
|
import { BlockType as R, BlockAttr as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
3
|
import { ItemsBlockId as O } from "./enums/controlEnums.js";
|
|
4
|
-
import { productPairs as h, templateFirstLine as
|
|
5
|
-
import { ItemInCartOptions as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { deriveItemNumber as
|
|
9
|
-
let [
|
|
10
|
-
const
|
|
11
|
-
const
|
|
4
|
+
import { productPairs as h, templateFirstLine as q } from "./enums/productEnums.js";
|
|
5
|
+
import { ItemInCartOptions as j, SETTINGS_ENUMS as N, DefaultConfigValues as M } from "./enums/settingsEnums.js";
|
|
6
|
+
import C from "./layouts/horizontal.html.js";
|
|
7
|
+
import J from "./layouts/vertical.html.js";
|
|
8
|
+
import { deriveItemNumber as Z, escapeReplacement as g } from "./utils/nodeConfigUtils.js";
|
|
9
|
+
let [v] = h.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [F] = h.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = h.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [L] = h.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [X] = h.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
10
|
+
const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), k = (s) => U(s, "text-align"), y = (s, e) => {
|
|
11
|
+
const r = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(r);
|
|
12
12
|
return a ? a[1].trim() : null;
|
|
13
|
-
}, w = (s) => `<tr>${s}</tr>`,
|
|
14
|
-
const i =
|
|
13
|
+
}, w = (s) => `<tr>${s}</tr>`, f = (s, e, r, a) => {
|
|
14
|
+
const i = r || M.productImageHeight, d = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
|
|
15
15
|
return w(`
|
|
16
16
|
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
17
17
|
align="center"
|
|
@@ -26,7 +26,7 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
26
26
|
href="#!">
|
|
27
27
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
28
28
|
style="object-fit: contain;"
|
|
29
|
-
src="${
|
|
29
|
+
src="${v}"
|
|
30
30
|
alt="${F}"
|
|
31
31
|
width="${i}"
|
|
32
32
|
height="${i}">
|
|
@@ -35,18 +35,18 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
35
35
|
`);
|
|
36
36
|
}, tt = (s, e) => `
|
|
37
37
|
<${R.BLOCK_IMAGE}
|
|
38
|
-
${S.BLOCK_IMAGE.src}="${
|
|
38
|
+
${S.BLOCK_IMAGE.src}="${v}"
|
|
39
39
|
${S.BLOCK_IMAGE.alt}="${F}"
|
|
40
40
|
${S.BLOCK_IMAGE.href}="#!"
|
|
41
|
-
${S.BLOCK_IMAGE.width}="${
|
|
42
|
-
${S.BLOCK_IMAGE.height}="${
|
|
41
|
+
${S.BLOCK_IMAGE.width}="${M.productImageWidth}"
|
|
42
|
+
${S.BLOCK_IMAGE.height}="${M.productImageWidth}"
|
|
43
43
|
esd-extension-block-id="${O.IMAGE}"
|
|
44
44
|
data-slot-1
|
|
45
45
|
product-attr="imageSrc"
|
|
46
46
|
data-type="${s}"
|
|
47
47
|
data-number="${e}"
|
|
48
48
|
/>
|
|
49
|
-
`, et = (s, e,
|
|
49
|
+
`, et = (s, e, r, a) => {
|
|
50
50
|
const i = `
|
|
51
51
|
word-wrap: break-word;
|
|
52
52
|
white-space: nowrap;
|
|
@@ -56,15 +56,15 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
56
56
|
max-width: 100%;
|
|
57
57
|
`;
|
|
58
58
|
if (e) {
|
|
59
|
-
const d = y(
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
const d = y(r || "", "text-align") || "center", n = k(r || i), c = y(n, "font-weight"), l = y(n, "font-style"), o = c === "bold" || c === "700", t = l === "italic", p = U(
|
|
60
|
+
U(
|
|
61
|
+
U(n, "font-weight"),
|
|
62
62
|
"font-style"
|
|
63
63
|
),
|
|
64
64
|
"text-decoration"
|
|
65
|
-
), T = (a == null ? void 0 : a.nameVisible) === !1 ? "display: none;" : "display: table-cell;", _ =
|
|
66
|
-
let
|
|
67
|
-
return
|
|
65
|
+
), T = (a == null ? void 0 : a.nameVisible) === !1 ? "display: none;" : "display: table-cell;", _ = p ? ` style="${m(p)}"` : "";
|
|
66
|
+
let E = F;
|
|
67
|
+
return o && (E = `<strong>${E}</strong>`), t && (E = `<em>${E}</em>`), w(`
|
|
68
68
|
<td class="esd-block-text es-p10"
|
|
69
69
|
align="${d}"
|
|
70
70
|
width="100%"
|
|
@@ -76,7 +76,7 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
76
76
|
path="1"
|
|
77
77
|
product-attr="name"
|
|
78
78
|
data-slot-2${_}>
|
|
79
|
-
${
|
|
79
|
+
${E}
|
|
80
80
|
</p>
|
|
81
81
|
</td>
|
|
82
82
|
`);
|
|
@@ -97,15 +97,15 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
97
97
|
</p>
|
|
98
98
|
</${R.BLOCK_TEXT}>
|
|
99
99
|
`;
|
|
100
|
-
}, at = (s, e,
|
|
100
|
+
}, at = (s, e, r, a, i, d, n, c, l, o) => {
|
|
101
101
|
let t = x;
|
|
102
102
|
if (a && a.trim()) {
|
|
103
|
-
const
|
|
104
|
-
t = (i || "0") === "1" ? `${x} ${
|
|
103
|
+
const $ = `${a.trim()}`;
|
|
104
|
+
t = (i || "0") === "1" ? `${x} ${$}` : `${$} ${x}`;
|
|
105
105
|
}
|
|
106
|
-
const
|
|
106
|
+
const p = i === "1" ? "after" : "before", T = `data-formated="${r ? "true" : "false"}"`, _ = `data-curency="${p}"`, E = a ? `data-currency_symbol="${a}"` : "", u = `data-single_price="${c ? "true" : "false"}"`, I = l === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
107
107
|
if (d) {
|
|
108
|
-
const b =
|
|
108
|
+
const b = k(n || "color: #060606; white-space: nowrap; font-size: 20px;"), A = o ? "" : ' style="display: none;"';
|
|
109
109
|
return w(`
|
|
110
110
|
<td class="esd-block-text items-block-price${I}"
|
|
111
111
|
align="center"
|
|
@@ -119,7 +119,7 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
119
119
|
data-number="${e}"
|
|
120
120
|
${T}
|
|
121
121
|
${_}
|
|
122
|
-
${
|
|
122
|
+
${E}
|
|
123
123
|
${u}
|
|
124
124
|
style="${m(b)}">
|
|
125
125
|
${t}
|
|
@@ -149,20 +149,20 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
149
149
|
</p>
|
|
150
150
|
</${R.BLOCK_TEXT}>
|
|
151
151
|
`;
|
|
152
|
-
}, st = (s, e,
|
|
152
|
+
}, st = (s, e, r, a, i, d, n = !0, c, l, o) => {
|
|
153
153
|
let t = L;
|
|
154
154
|
if (a && a.trim()) {
|
|
155
|
-
const
|
|
156
|
-
t = (i || "0") === "1" ? `${L} ${
|
|
155
|
+
const $ = `${a.trim()}`;
|
|
156
|
+
t = (i || "0") === "1" ? `${L} ${$}` : `${$} ${L}`;
|
|
157
157
|
}
|
|
158
|
-
const
|
|
158
|
+
const p = i === "1" ? "after" : "before", T = `data-formated="${r ? "true" : "false"}"`, _ = `data-curency="${p}"`, E = n ? "" : ' style="display: none;"', u = `data-single_price="${l ? "true" : "false"}"`, I = o === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
159
159
|
if (d) {
|
|
160
|
-
const b =
|
|
160
|
+
const b = k(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
161
161
|
return w(`
|
|
162
162
|
<td class="esd-block-text items-block-price${I}"
|
|
163
163
|
esd-extension-block-id="${O.ORIGINAL_PRICE}"
|
|
164
164
|
width="100%"
|
|
165
|
-
align="center"${
|
|
165
|
+
align="center"${E}>
|
|
166
166
|
<p
|
|
167
167
|
product-attr="originalPrice"
|
|
168
168
|
contenteditable="false"
|
|
@@ -203,10 +203,10 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
203
203
|
</p>
|
|
204
204
|
</${R.BLOCK_TEXT}>
|
|
205
205
|
`;
|
|
206
|
-
}, lt = (s = !0, e,
|
|
206
|
+
}, lt = (s = !0, e, r) => {
|
|
207
207
|
const a = s ? "" : 'style="display: none;"';
|
|
208
208
|
if (e) {
|
|
209
|
-
const i = "font-size: 14px;", d = y(
|
|
209
|
+
const i = "font-size: 14px;", d = y(r || "", "text-align") || "center", n = k(r || i);
|
|
210
210
|
return w(`
|
|
211
211
|
<td class="esd-block-text es-p10 document-node-component default-block-component selectable"
|
|
212
212
|
width="100%" align="${d}"
|
|
@@ -218,7 +218,7 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
218
218
|
width="100%"
|
|
219
219
|
path="1"
|
|
220
220
|
style="${m(n)}">
|
|
221
|
-
${
|
|
221
|
+
${X}
|
|
222
222
|
</p>
|
|
223
223
|
</td>
|
|
224
224
|
`);
|
|
@@ -236,26 +236,26 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
236
236
|
data-slot-3
|
|
237
237
|
contenteditable="false"
|
|
238
238
|
width="100%">
|
|
239
|
-
${
|
|
239
|
+
${X}
|
|
240
240
|
</p>
|
|
241
241
|
</${R.BLOCK_TEXT}>
|
|
242
242
|
`;
|
|
243
|
-
}, rt = (s, e,
|
|
243
|
+
}, rt = (s, e, r = "Buy", a, i, d = !0, n = !0) => {
|
|
244
244
|
if (a) {
|
|
245
|
-
const c = y(i || "", "background") || y(i || "", "background-color"),
|
|
245
|
+
const c = y(i || "", "background") || y(i || "", "background-color"), l = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", o = d ? "es-fw" : "es-il", t = (i || "").replace("border-width: 0;", "");
|
|
246
246
|
return w(`
|
|
247
247
|
<td class="esd-block-button ins-button default-block-component selectable"
|
|
248
|
-
align="center" width="100%" name="buy-button" caption="${
|
|
248
|
+
align="center" width="100%" name="buy-button" caption="${r}"
|
|
249
249
|
esd-extension-block-id="${O.BUTTON}"
|
|
250
250
|
product-attr="button" data-slot-6="" data-type="${s}" data-number="${e}"
|
|
251
251
|
${n ? "" : ' style="display: none;"'}>
|
|
252
|
-
<span class="es-button-border ${
|
|
252
|
+
<span class="es-button-border ${o}" style="${m(l)}">
|
|
253
253
|
<a
|
|
254
254
|
class="es-button"
|
|
255
255
|
href="#!"
|
|
256
256
|
target="_blank"
|
|
257
257
|
style="${m(t)} padding: 5px 12px;">
|
|
258
|
-
${
|
|
258
|
+
${r}
|
|
259
259
|
</a>
|
|
260
260
|
</span>
|
|
261
261
|
</td>
|
|
@@ -266,27 +266,27 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
266
266
|
width="100%"
|
|
267
267
|
class="ins-button"
|
|
268
268
|
name="buy-button"
|
|
269
|
-
caption="${
|
|
269
|
+
caption="${r}"
|
|
270
270
|
align="center"
|
|
271
271
|
esd-extension-block-id="${O.BUTTON}"
|
|
272
272
|
product-attr="button"
|
|
273
273
|
data-slot-6
|
|
274
274
|
data-type="${s}"
|
|
275
275
|
data-number="${e}"
|
|
276
|
-
>${
|
|
276
|
+
>${r}
|
|
277
277
|
</${R.BLOCK_BUTTON}>
|
|
278
278
|
`;
|
|
279
|
-
}, ct = (s, e,
|
|
280
|
-
const d = e === N.ORIENTATION.VERTICAL, n =
|
|
279
|
+
}, ct = (s, e, r, a = !0, i = !0) => {
|
|
280
|
+
const d = e === N.ORIENTATION.VERTICAL, n = r === "horizontal";
|
|
281
281
|
if (d) {
|
|
282
|
-
const c = !n,
|
|
282
|
+
const c = !n, l = c || !i ? "100%" : "50%", o = c || !a ? "100%" : "50%";
|
|
283
283
|
let t = s.replace(
|
|
284
284
|
/<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
|
|
285
|
-
(
|
|
285
|
+
(p) => p.replace(/width="[^"]*"/gi, `width="${l}"`).replace(/width:\s*[^;]+;/gi, `width: ${l};`)
|
|
286
286
|
);
|
|
287
287
|
return t = t.replace(
|
|
288
288
|
/<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
|
|
289
|
-
(
|
|
289
|
+
(p) => p.replace(/width="[^"]*"/gi, `width="${o}"`).replace(/width:\s*[^;]+;/gi, `width: ${o};`)
|
|
290
290
|
), t;
|
|
291
291
|
}
|
|
292
292
|
return n ? s : s.replace(
|
|
@@ -298,74 +298,74 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
298
298
|
);
|
|
299
299
|
}, it = (s) => s ? `<td align="center"
|
|
300
300
|
esd-extension-block-id="items-block"
|
|
301
|
-
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` :
|
|
302
|
-
const A = `${`data-type="${e}" data-number="${
|
|
301
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : q, B = (s, e, r, a, i, d, n, c, l, o, t, p, T, _ = "horizontal", E, u, P, I) => {
|
|
302
|
+
const $ = o !== void 0 ? ` data-nodup="${o}"` : "", A = `${`data-type="${e}" data-number="${r}"`} data-orientation="${a}"${$}`, D = l == null ? void 0 : l["data-product_image_control_image-height"], V = d ? f(e, r, D, t) : tt(e, r), W = (t == null ? void 0 : t.buttonLabel) || "Buy", z = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, H = e === N.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, Q = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (l == null ? void 0 : l["data-product_button_control_enabled"]) !== "false", G = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (l == null ? void 0 : l["data-product_price_control_enabled"]) !== "false", K = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (l == null ? void 0 : l["data-product_original_price_control_enabled"]) !== "false", Y = s.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(d)).replace("{-{-PRODUCT_IMAGE-}-}", V).replace("{-{-PRODUCT_NAME-}-}", et(e, d, p, t)).replaceAll(
|
|
303
303
|
"{-{-PRODUCT_PRICE-}-}",
|
|
304
|
-
|
|
304
|
+
g(at(
|
|
305
305
|
e,
|
|
306
|
-
|
|
306
|
+
r,
|
|
307
307
|
i,
|
|
308
308
|
n,
|
|
309
309
|
c,
|
|
310
310
|
d,
|
|
311
|
-
|
|
311
|
+
E,
|
|
312
312
|
I,
|
|
313
313
|
a,
|
|
314
|
-
|
|
314
|
+
G
|
|
315
315
|
))
|
|
316
316
|
).replaceAll(
|
|
317
317
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
318
|
-
|
|
318
|
+
g(st(
|
|
319
319
|
e,
|
|
320
|
-
|
|
320
|
+
r,
|
|
321
321
|
i,
|
|
322
322
|
n,
|
|
323
323
|
c,
|
|
324
324
|
d,
|
|
325
|
-
|
|
325
|
+
K,
|
|
326
326
|
u,
|
|
327
327
|
I,
|
|
328
328
|
a
|
|
329
329
|
))
|
|
330
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}", lt(
|
|
330
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", lt(H, d, P)).replace(
|
|
331
331
|
"{-{-PRODUCT_BUTTON-}-}",
|
|
332
|
-
rt(e,
|
|
332
|
+
rt(e, r, W, d, T, z, Q)
|
|
333
333
|
).replace(
|
|
334
334
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
335
335
|
`<td$1 ${A}>`
|
|
336
336
|
);
|
|
337
337
|
return ct(
|
|
338
|
-
|
|
338
|
+
Y,
|
|
339
339
|
a,
|
|
340
340
|
_,
|
|
341
|
-
|
|
342
|
-
|
|
341
|
+
G,
|
|
342
|
+
K
|
|
343
343
|
);
|
|
344
344
|
};
|
|
345
345
|
function It({
|
|
346
346
|
orientation: s,
|
|
347
347
|
itemsType: e = N.ITEMS_TYPE.CART_ITEMS,
|
|
348
|
-
itemId:
|
|
348
|
+
itemId: r,
|
|
349
349
|
currencySymbol: a,
|
|
350
350
|
currencyLocation: i,
|
|
351
351
|
migrate: d = !1,
|
|
352
352
|
formattedPrice: n = !0,
|
|
353
353
|
configBlockAttributes: c,
|
|
354
|
-
nodeConfig:
|
|
355
|
-
nameStyles:
|
|
354
|
+
nodeConfig: l,
|
|
355
|
+
nameStyles: o,
|
|
356
356
|
buttonStyles: t,
|
|
357
|
-
priceStyles:
|
|
357
|
+
priceStyles: p,
|
|
358
358
|
originalPriceStyles: T,
|
|
359
359
|
quantityStyles: _,
|
|
360
|
-
priceOrientation:
|
|
360
|
+
priceOrientation: E
|
|
361
361
|
}) {
|
|
362
|
-
const u =
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
I ? (x = n ?
|
|
366
|
-
const A =
|
|
367
|
-
return s === N.ORIENTATION.VERTICAL ?
|
|
368
|
-
|
|
362
|
+
const u = j[e].findIndex((V) => V.value === r), P = Z(r, e), I = (l == null ? void 0 : l.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
|
|
363
|
+
v = h.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[u >= 0 ? u : 0], F = h.PAIRS_FOR_EXTENSION.name[e].DEFAULT[u >= 0 ? u : 0];
|
|
364
|
+
const $ = h.PAIRS_FOR_EXTENSION.price[e], b = h.PAIRS_FOR_EXTENSION.originalPrice[e];
|
|
365
|
+
I ? (x = n ? $.DEFAULT_SINGLE_PRICE_FORMATTED : $.DEFAULT_SINGLE_PRICE, L = n ? b.DEFAULT_SINGLE_PRICE_FORMATTED : b.DEFAULT_SINGLE_PRICE) : (x = n ? $.DEFAULT_PRICE_FORMATTED : $.DEFAULT_PRICE, L = n ? b.DEFAULT_PRICE_FORMATTED : b.DEFAULT_PRICE), X = h.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
|
|
366
|
+
const A = E || (l == null ? void 0 : l.priceOrientation) || "horizontal", D = (l == null ? void 0 : l.priceHideDiscount) ?? M.productPriceHideDiscountControlValue === "1";
|
|
367
|
+
return s === N.ORIENTATION.VERTICAL ? B(
|
|
368
|
+
J,
|
|
369
369
|
e,
|
|
370
370
|
P,
|
|
371
371
|
s,
|
|
@@ -374,18 +374,18 @@ function It({
|
|
|
374
374
|
a,
|
|
375
375
|
i,
|
|
376
376
|
c,
|
|
377
|
-
|
|
377
|
+
String(D),
|
|
378
378
|
// nodup
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
l,
|
|
380
|
+
o,
|
|
381
381
|
t,
|
|
382
382
|
A,
|
|
383
|
-
|
|
383
|
+
p,
|
|
384
384
|
T,
|
|
385
385
|
_,
|
|
386
386
|
I
|
|
387
|
-
) :
|
|
388
|
-
|
|
387
|
+
) : B(
|
|
388
|
+
C,
|
|
389
389
|
e,
|
|
390
390
|
P,
|
|
391
391
|
s,
|
|
@@ -394,13 +394,13 @@ function It({
|
|
|
394
394
|
a,
|
|
395
395
|
i,
|
|
396
396
|
c,
|
|
397
|
-
|
|
397
|
+
String(D),
|
|
398
398
|
// nodup
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
l,
|
|
400
|
+
o,
|
|
401
401
|
t,
|
|
402
402
|
A,
|
|
403
|
-
|
|
403
|
+
p,
|
|
404
404
|
T,
|
|
405
405
|
_,
|
|
406
406
|
I
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createBlockBackgroundColorControl as o } from "../../../controlFactories.js";
|
|
2
|
+
import { RadioButtonControlId as r } from "../../constants/controlIds.js";
|
|
3
|
+
import { BLOCK_ROOT_SELECTOR as t } from "../../constants/selectors.js";
|
|
4
|
+
const c = o(
|
|
5
|
+
r.BLOCK_BACKGROUND,
|
|
6
|
+
t
|
|
7
|
+
);
|
|
8
|
+
export {
|
|
9
|
+
c as RadioButtonBlockBackgroundControl
|
|
10
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RadioButtonCustomBlock as t } from "./block.js";
|
|
3
3
|
import { RadioButtonControl as i } from "./control.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { RadioButtonBlockBackgroundControl as n } from "./controls/blockBackground/index.js";
|
|
5
|
+
import { RadioButtonIconsRegistry as r } from "./iconsRegistry.js";
|
|
6
|
+
import { RadioButtonBlockSettingsPanel as d } from "./settingsPanel.js";
|
|
7
|
+
const u = new o().addBlock(t).withSettingsPanelRegistry(d).addControl(i).addControl(n).withIconsRegistry(r).build();
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
u as default
|
|
9
10
|
};
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as r, SettingsPanelTab as t, SettingsTab as o, ContainerControls as
|
|
2
|
-
import { BLOCK_ID as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { SettingsPanelRegistry as r, SettingsPanelTab as t, SettingsTab as o, ContainerControls as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as i } from "./block.js";
|
|
3
|
+
import { RadioButtonControlId as s } from "./constants/controlIds.js";
|
|
4
|
+
import { CONTROL_BLOCK_ID as S } from "./control.js";
|
|
5
|
+
class B extends r {
|
|
6
|
+
registerBlockControls(e) {
|
|
7
|
+
e[i] = [
|
|
7
8
|
new t(
|
|
8
9
|
o.SETTINGS,
|
|
9
10
|
[
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
S,
|
|
12
|
+
n.EXTERNAL_INDENTS,
|
|
13
|
+
n.DISPLAY_CONDITIONS
|
|
13
14
|
]
|
|
14
15
|
),
|
|
15
16
|
new t(
|
|
16
17
|
o.STYLES,
|
|
17
18
|
[
|
|
18
|
-
s.
|
|
19
|
+
s.BLOCK_BACKGROUND
|
|
19
20
|
]
|
|
20
21
|
)
|
|
21
22
|
];
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
B as RadioButtonBlockSettingsPanel
|
|
26
27
|
};
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { BlockType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CSS_CLASS_RADIO_BUTTON_BLOCK as d, CSS_CLASS_RADIO_BUTTON_BLOCK_V2 as i } from "./constants/selectors.js";
|
|
2
3
|
const e = {
|
|
3
4
|
TITLE: "This is a title text",
|
|
4
5
|
DESCRIPTION: "This is a description text",
|
|
5
6
|
YES: "Yes",
|
|
6
7
|
NO: "No"
|
|
7
|
-
},
|
|
8
|
-
<td
|
|
8
|
+
}, l = `
|
|
9
|
+
<td
|
|
10
|
+
align="left"
|
|
11
|
+
class="
|
|
12
|
+
${d}
|
|
13
|
+
${i}
|
|
14
|
+
esd-block-radio es-p10t es-p10b es-p30r es-p30l"
|
|
15
|
+
>
|
|
9
16
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
10
17
|
<tbody>
|
|
11
18
|
<tr>
|
|
@@ -75,14 +82,14 @@ const e = {
|
|
|
75
82
|
</tbody>
|
|
76
83
|
</table>
|
|
77
84
|
</td>
|
|
78
|
-
`,
|
|
85
|
+
`, n = `
|
|
79
86
|
<td
|
|
80
87
|
align="left"
|
|
81
88
|
esd-extension-block-id="radio-button-block"
|
|
82
89
|
esd-handler-name="esd-extension-RadioButtonBlock"
|
|
83
90
|
class="
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
${d}
|
|
92
|
+
${i}
|
|
86
93
|
esd-block-ra
|
|
87
94
|
esd-radio-button-block
|
|
88
95
|
esd-extension-block
|
|
@@ -149,10 +156,10 @@ const e = {
|
|
|
149
156
|
</table>
|
|
150
157
|
</td>
|
|
151
158
|
`;
|
|
152
|
-
function
|
|
153
|
-
return
|
|
159
|
+
function p() {
|
|
160
|
+
return l.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`).replace("{-{-YES-}-}", `<p path="1">${e.YES}</p>`).replace("{-{-NO-}-}", `<p path="1">${e.NO}</p>`);
|
|
154
161
|
}
|
|
155
162
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
163
|
+
n as default,
|
|
164
|
+
p as getDefaultTemplate
|
|
158
165
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModificationDescription as d } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { CommonControl as s } from "../../../common-control.js";
|
|
3
3
|
import { getCurrentLayout as l } from "../main/utils.js";
|
|
4
|
-
const
|
|
4
|
+
const u = "recommendation-card-background-color-control", e = {
|
|
5
5
|
CARD_BACKGROUND_COLOR: "cardBackgroundColor"
|
|
6
6
|
}, a = {
|
|
7
7
|
GRID: ".product-card-segment",
|
|
@@ -9,17 +9,13 @@ const i = "recommendation-card-background-color-control", e = {
|
|
|
9
9
|
};
|
|
10
10
|
class _ extends s {
|
|
11
11
|
getId() {
|
|
12
|
-
return
|
|
12
|
+
return u;
|
|
13
13
|
}
|
|
14
14
|
getTemplate() {
|
|
15
|
-
return
|
|
16
|
-
<div class="card-bg-control-container">
|
|
17
|
-
${this._GuTwoColumns([
|
|
15
|
+
return this._GuTwoColumns([
|
|
18
16
|
this._GuLabel({ text: this.api.translate("Card Background Color") }),
|
|
19
17
|
this._GuColorPicker(e.CARD_BACKGROUND_COLOR)
|
|
20
|
-
])
|
|
21
|
-
</div>
|
|
22
|
-
`;
|
|
18
|
+
]);
|
|
23
19
|
}
|
|
24
20
|
onRender() {
|
|
25
21
|
this._setFormValues(), this._listenToFormUpdates();
|
|
@@ -75,6 +71,6 @@ class _ extends s {
|
|
|
75
71
|
}
|
|
76
72
|
}
|
|
77
73
|
export {
|
|
78
|
-
|
|
74
|
+
u as CARD_BACKGROUND_COLOR_CONTROL_ID,
|
|
79
75
|
_ as CardBackgroundColorControl
|
|
80
76
|
};
|