@useinsider/guido 2.0.0-beta.dd0d492 → 2.0.0-beta.faa7c5d
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/README.md +2 -0
- package/dist/@types/config/schemas.js +55 -39
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +15 -17
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue.js +12 -12
- package/dist/components/organisms/header/LeftSlot.vue2.js +6 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/composables/useStripo.js +40 -40
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/itemsBlockMigrator.js +342 -0
- package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
- package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
- package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
- package/dist/extensions/Blocks/Items/block.js +39 -40
- package/dist/extensions/Blocks/Items/controls/button/link.js +22 -29
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +66 -46
- package/dist/extensions/Blocks/Items/controls/image/link.js +23 -30
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +19 -17
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +31 -29
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +36 -36
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +21 -19
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +29 -27
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +93 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +152 -143
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +43 -45
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +4 -3
- package/dist/extensions/Blocks/Items/extension.js +7 -6
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -49
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -59
- package/dist/extensions/Blocks/Items/settingsPanel.js +27 -26
- package/dist/extensions/Blocks/Items/store/items-block.js +11 -7
- package/dist/extensions/Blocks/Items/template.js +366 -129
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +184 -0
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +29 -30
- package/dist/extensions/Blocks/controlFactories.js +139 -118
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +370 -286
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +6 -10
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +30 -0
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/composables/useConfig.d.ts +8 -0
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
- package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +9 -0
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +18 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +24 -26
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +22 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +73 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +9 -10
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/dist/src/stores/config.d.ts +164 -1
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/stores/config.js +7 -0
- package/dist/utils/pairProductVariables.js +61 -58
- package/package.json +3 -3
- package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
- package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -76
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -46
- package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
- package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -50
- package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineStore as
|
|
1
|
+
import { defineStore as s } from "pinia";
|
|
2
2
|
import { DefaultConfigValues as e } from "../enums/settingsEnums.js";
|
|
3
|
-
const n = (t) => t.replace(/Url\}/, "Image}"),
|
|
3
|
+
const n = (t) => t.replace(/Url\}/, "Image}"), r = (t) => t.replace(/Image\}/, "Url}"), i = () => {
|
|
4
4
|
const t = e.cartItemsSelectControlValue;
|
|
5
5
|
return {
|
|
6
6
|
itemsType: e.itemsType,
|
|
7
7
|
itemIds: t,
|
|
8
8
|
imageLink: n(t),
|
|
9
|
-
buttonLink:
|
|
9
|
+
buttonLink: r(t),
|
|
10
10
|
orientation: e.cardOrientationControlValue,
|
|
11
11
|
nameTrimming: !0,
|
|
12
|
-
hideDiscount: !
|
|
12
|
+
hideDiscount: !0,
|
|
13
13
|
currencySymbol: "USD",
|
|
14
14
|
currencyLocation: "0",
|
|
15
15
|
formattedPrice: !0,
|
|
16
|
-
|
|
16
|
+
singlePrice: !1,
|
|
17
|
+
priceOrientation: "vertical",
|
|
17
18
|
templateData: {
|
|
18
19
|
imageSrc: "",
|
|
19
20
|
name: "",
|
|
@@ -23,14 +24,14 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
|
|
|
23
24
|
button: ""
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
|
-
}, m =
|
|
27
|
+
}, m = s("guidoItemsBlock", {
|
|
27
28
|
state: () => i(),
|
|
28
29
|
actions: {
|
|
29
30
|
setItemsType(t) {
|
|
30
31
|
this.itemsType = t;
|
|
31
32
|
},
|
|
32
33
|
setItemIds(t) {
|
|
33
|
-
this.itemIds = t, this.imageLink = n(t), this.buttonLink =
|
|
34
|
+
this.itemIds = t, this.imageLink = n(t), this.buttonLink = r(t);
|
|
34
35
|
},
|
|
35
36
|
setImageLink(t) {
|
|
36
37
|
this.imageLink = t;
|
|
@@ -56,6 +57,9 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
|
|
|
56
57
|
setFormattedPrice(t) {
|
|
57
58
|
this.formattedPrice = t;
|
|
58
59
|
},
|
|
60
|
+
setSinglePrice(t) {
|
|
61
|
+
this.singlePrice = t;
|
|
62
|
+
},
|
|
59
63
|
setPriceOrientation(t) {
|
|
60
64
|
this.priceOrientation = t;
|
|
61
65
|
},
|
|
@@ -1,29 +1,100 @@
|
|
|
1
|
-
import { BlockType as
|
|
2
|
-
import { ItemsBlockId as
|
|
3
|
-
import { productPairs as
|
|
4
|
-
import { ItemInCartOptions as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
let [
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { BlockType as h, BlockAttr as y } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { ItemsBlockId as P } from "./enums/controlEnums.js";
|
|
3
|
+
import { productPairs as O, templateFirstLine as W } from "./enums/productEnums.js";
|
|
4
|
+
import { ItemInCartOptions as C, SETTINGS_ENUMS as w, DefaultConfigValues as F } from "./enums/settingsEnums.js";
|
|
5
|
+
import Q from "./layouts/horizontal.html.js";
|
|
6
|
+
import H from "./layouts/vertical.html.js";
|
|
7
|
+
let [g] = O.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [N] = O.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = O.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [S] = O.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [k] = O.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
8
|
+
const q = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(t.toLowerCase())).join("; ").replace(/;\s*$/, ""), D = (a) => q(a, "text-align"), m = (a, t) => {
|
|
9
|
+
const l = new RegExp(`${t}\\s*:\\s*([^;]+)`, "i"), e = a.match(l);
|
|
10
|
+
return e ? e[1].trim() : null;
|
|
11
|
+
}, U = (a, t, l) => new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi").test(a) ? a.replace(
|
|
12
|
+
new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi"),
|
|
13
|
+
`$1${l}`
|
|
14
|
+
) : a, Y = (a, t, l, e) => {
|
|
15
|
+
const c = l || F.productImageHeight, n = (e == null ? void 0 : e.imageVisible) === !1 ? "display: none; " : "";
|
|
16
|
+
return `
|
|
17
|
+
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
18
|
+
align="center"
|
|
19
|
+
esd-extension-block-id="items-block-image"
|
|
20
|
+
data-slot-1=""
|
|
21
|
+
product-attr="imageSrc"
|
|
22
|
+
data-type="${a}"
|
|
23
|
+
data-number="${t}"
|
|
24
|
+
style="${n}font-size: 0px;">
|
|
25
|
+
<a class="document-node-component ng-star-inserted"
|
|
26
|
+
target="_blank"
|
|
27
|
+
href="#!">
|
|
28
|
+
<img class="adapt-img document-node-component ng-star-inserted"
|
|
29
|
+
src="${g}"
|
|
30
|
+
alt="${N}"
|
|
31
|
+
height="${c}">
|
|
32
|
+
</a>
|
|
33
|
+
</td>
|
|
34
|
+
`;
|
|
35
|
+
}, j = (a, t) => `
|
|
36
|
+
<${h.BLOCK_IMAGE}
|
|
37
|
+
${y.BLOCK_IMAGE.src}="${g}"
|
|
38
|
+
${y.BLOCK_IMAGE.alt}="${N}"
|
|
39
|
+
${y.BLOCK_IMAGE.href}="#!"
|
|
40
|
+
${y.BLOCK_IMAGE.width}="${F.productImageWidth}"
|
|
41
|
+
${y.BLOCK_IMAGE.height}="${F.productImageWidth}"
|
|
42
|
+
esd-extension-block-id="${P.IMAGE}"
|
|
15
43
|
data-slot-1
|
|
16
44
|
product-attr="imageSrc"
|
|
17
|
-
data-type="${a}"
|
|
45
|
+
data-type="${a}"
|
|
18
46
|
data-number="${t}"
|
|
19
47
|
/>
|
|
20
|
-
`,
|
|
21
|
-
|
|
48
|
+
`, Z = (a, t, l, e, c) => {
|
|
49
|
+
const o = `
|
|
50
|
+
text-decoration:none;
|
|
51
|
+
font-size: inherit;
|
|
52
|
+
font-weight: inherit;
|
|
53
|
+
line-height: inherit;
|
|
54
|
+
font-family: inherit;
|
|
55
|
+
color: inherit;
|
|
56
|
+
display: block;
|
|
57
|
+
word-wrap:break-word;
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
width: ${l === w.ORIENTATION.HORIZONTAL ? "130px" : "520px"};
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
text-overflow: ellipsis;
|
|
62
|
+
`;
|
|
63
|
+
if (t) {
|
|
64
|
+
const i = m(e || "", "text-align") || "center", r = D(e || o), d = m(r, "color"), s = m(r, "font-size"), p = [
|
|
65
|
+
d ? `color: ${d}` : "",
|
|
66
|
+
s ? `font-size: ${s}` : ""
|
|
67
|
+
].filter(Boolean).join("; "), E = U(
|
|
68
|
+
U(r, "color", "inherit"),
|
|
69
|
+
"font-size",
|
|
70
|
+
"inherit"
|
|
71
|
+
), _ = (c == null ? void 0 : c.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
|
|
72
|
+
return `
|
|
73
|
+
<td class="esd-block-text es-p10"
|
|
74
|
+
align="${i}"
|
|
75
|
+
width="100%"
|
|
76
|
+
data-type="${a}"
|
|
77
|
+
esd-extension-block-id="${P.NAME}"
|
|
78
|
+
style="${_}">
|
|
79
|
+
<p contenteditable="false" path="1"${p ? ` style="${p}"` : ""}>
|
|
80
|
+
<a
|
|
81
|
+
href="#!"
|
|
82
|
+
style="${E}"
|
|
83
|
+
product-attr="name"
|
|
84
|
+
data-slot-2
|
|
85
|
+
width="100%">
|
|
86
|
+
${N}
|
|
87
|
+
</a>
|
|
88
|
+
</p>
|
|
89
|
+
</td>
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
return `<${h.BLOCK_TEXT}
|
|
22
93
|
width="100%"
|
|
23
94
|
align="center"
|
|
24
95
|
class="es-p10"
|
|
25
96
|
data-type="${a}"
|
|
26
|
-
esd-extension-block-id="${
|
|
97
|
+
esd-extension-block-id="${P.NAME}"
|
|
27
98
|
>
|
|
28
99
|
<p contenteditable="false">
|
|
29
100
|
<a
|
|
@@ -45,151 +116,317 @@ const h = (a, t) => `
|
|
|
45
116
|
product-attr="name"
|
|
46
117
|
data-slot-2
|
|
47
118
|
width="100%">
|
|
48
|
-
${
|
|
119
|
+
${N}
|
|
49
120
|
</a>
|
|
50
121
|
</p>
|
|
51
|
-
</${
|
|
52
|
-
|
|
53
|
-
|
|
122
|
+
</${h.BLOCK_TEXT}>
|
|
123
|
+
`;
|
|
124
|
+
}, J = (a, t, l, e, c, n, o, i, r) => {
|
|
125
|
+
let d = x;
|
|
54
126
|
if (e && e.trim()) {
|
|
55
|
-
const
|
|
56
|
-
|
|
127
|
+
const $ = ` ${e.trim()} `;
|
|
128
|
+
d = (c || "0") === "1" ? `${x}${$}` : `${$}${x}`;
|
|
129
|
+
}
|
|
130
|
+
const s = c === "1" ? "after" : "before", p = `data-formated="${l ? "true" : "false"}"`, E = `data-curency="${s}"`, _ = e ? `data-currency_symbol="${e}"` : "", b = `data-single_price="${i ? "true" : "false"}"`, I = r === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
131
|
+
if (n) {
|
|
132
|
+
const T = D(o || "color: #060606; white-space: nowrap; font-size: 20px;");
|
|
133
|
+
return `
|
|
134
|
+
<td class="esd-block-text items-block-price${I}"
|
|
135
|
+
align="center"
|
|
136
|
+
esd-extension-block-id="items-block-price"
|
|
137
|
+
width="100%">
|
|
138
|
+
<p product-attr="price"
|
|
139
|
+
contenteditable="false"
|
|
140
|
+
data-slot-4
|
|
141
|
+
data-type="${a}"
|
|
142
|
+
data-number="${t}"
|
|
143
|
+
${p}
|
|
144
|
+
${E}
|
|
145
|
+
${_}
|
|
146
|
+
${b}
|
|
147
|
+
style="${T}">
|
|
148
|
+
${d}
|
|
149
|
+
</p>
|
|
150
|
+
</td>`;
|
|
57
151
|
}
|
|
58
|
-
const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
59
152
|
return `
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
>
|
|
66
|
-
<p
|
|
67
|
-
product-attr="price"
|
|
68
|
-
contenteditable="false"
|
|
69
|
-
data-slot-4
|
|
70
|
-
data-type="${a}"
|
|
71
|
-
data-number="${t}"
|
|
72
|
-
${d}
|
|
73
|
-
${s}
|
|
74
|
-
${e ? `data-currency_symbol="${e}"` : ""}
|
|
153
|
+
<${h.BLOCK_TEXT}
|
|
154
|
+
esd-extension-block-id="${P.PRICE}"
|
|
155
|
+
class="items-block-price ${I}"
|
|
156
|
+
width="100%"
|
|
157
|
+
align="center"
|
|
75
158
|
>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
159
|
+
<p
|
|
160
|
+
product-attr="price"
|
|
161
|
+
contenteditable="false"
|
|
162
|
+
data-slot-4
|
|
163
|
+
data-type="${a}"
|
|
164
|
+
data-number="${t}"
|
|
165
|
+
${p}
|
|
166
|
+
${E}
|
|
167
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
168
|
+
${b}
|
|
169
|
+
>
|
|
170
|
+
${d}
|
|
171
|
+
</p>
|
|
172
|
+
</${h.BLOCK_TEXT}>
|
|
173
|
+
`;
|
|
174
|
+
}, tt = (a, t, l, e, c, n, o = !0, i, r, d) => {
|
|
175
|
+
let s = S;
|
|
82
176
|
if (e && e.trim()) {
|
|
83
|
-
const
|
|
84
|
-
|
|
177
|
+
const T = ` ${e.trim()} `;
|
|
178
|
+
s = (c || "0") === "1" ? `${S}${T}` : `${T}${S}`;
|
|
179
|
+
}
|
|
180
|
+
const p = c === "1" ? "after" : "before", E = `data-formated="${l ? "true" : "false"}"`, _ = `data-curency="${p}"`, b = o ? "" : ' style="display: none;"', u = `data-single_price="${r ? "true" : "false"}"`, $ = d === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
181
|
+
if (n) {
|
|
182
|
+
const R = D(i || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
183
|
+
return `
|
|
184
|
+
<td class="esd-block-text items-block-price${$}"
|
|
185
|
+
esd-extension-block-id="items-block-original-price"
|
|
186
|
+
width="100%"
|
|
187
|
+
align="center"${b}>
|
|
188
|
+
<p
|
|
189
|
+
product-attr="originalPrice"
|
|
190
|
+
contenteditable="false"
|
|
191
|
+
data-slot-5
|
|
192
|
+
data-type="${a}"
|
|
193
|
+
data-number="${t}"
|
|
194
|
+
${E}
|
|
195
|
+
${_}
|
|
196
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
197
|
+
${u}
|
|
198
|
+
style="${R}">
|
|
199
|
+
<s>${s}</s>
|
|
200
|
+
</p>
|
|
201
|
+
</td>
|
|
202
|
+
`;
|
|
85
203
|
}
|
|
86
|
-
const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
87
204
|
return `
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
205
|
+
<${h.BLOCK_TEXT}
|
|
206
|
+
class="items-block-price ${$}"
|
|
207
|
+
esd-extension-block-id="${P.ORIGINAL_PRICE}"
|
|
208
|
+
width="100%"
|
|
209
|
+
align="center"
|
|
210
|
+
${o ? "" : 'style="display: none;"'}
|
|
211
|
+
>
|
|
212
|
+
<p
|
|
213
|
+
product-attr="originalPrice"
|
|
214
|
+
contenteditable="false"
|
|
215
|
+
data-slot-5
|
|
216
|
+
style="color: #cc0000"
|
|
217
|
+
data-type="${a}"
|
|
218
|
+
data-number="${t}"
|
|
219
|
+
${E}
|
|
220
|
+
${_}
|
|
221
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
222
|
+
${u}
|
|
223
|
+
>
|
|
224
|
+
<s>${s}</s>
|
|
225
|
+
</p>
|
|
226
|
+
</${h.BLOCK_TEXT}>
|
|
227
|
+
`;
|
|
228
|
+
}, et = (a = !0, t, l) => {
|
|
229
|
+
const e = a ? "" : 'style="display: none;"';
|
|
230
|
+
return t ? `
|
|
231
|
+
<td class="esd-block-text es-p10 document-node-component default-block-component selectable"
|
|
232
|
+
width="100%" align="center" esd-extension-block-id="items-block-quantity" ${e}>
|
|
233
|
+
<p product-attr="quantity"
|
|
234
|
+
data-slot-3=""
|
|
235
|
+
contenteditable="false"
|
|
236
|
+
width="100%"
|
|
237
|
+
path="1"
|
|
238
|
+
style="${l || "text-align: center; font-size: 14px;"}">
|
|
239
|
+
${k}
|
|
240
|
+
</p>
|
|
241
|
+
</td>` : `
|
|
242
|
+
<${h.BLOCK_TEXT}
|
|
243
|
+
width="100%"
|
|
244
|
+
align="center"
|
|
245
|
+
class="es-p10"
|
|
246
|
+
esd-extension-block-id="${P.QUANTITY}"
|
|
247
|
+
${a ? "" : 'style="display: none;"'}
|
|
248
|
+
>
|
|
249
|
+
<p
|
|
250
|
+
product-attr="quantity"
|
|
251
|
+
data-slot-3
|
|
252
|
+
contenteditable="false"
|
|
253
|
+
width="100%">
|
|
254
|
+
${k}
|
|
255
|
+
</p>
|
|
256
|
+
</${h.BLOCK_TEXT}>
|
|
257
|
+
`;
|
|
258
|
+
}, at = (a, t, l = "Buy", e, c, n = !0) => {
|
|
259
|
+
if (e) {
|
|
260
|
+
const o = m(c || "", "background") || m(c || "", "background-color"), i = o ? `border-width: 0px; background: ${o};` : "border-width: 0px;", r = n ? "es-fw" : "es-il", d = (c || "").replace("border-width: 0;", "");
|
|
261
|
+
return `
|
|
262
|
+
<td class="esd-block-button ins-button default-block-component selectable"
|
|
263
|
+
align="center" width="100%" name="buy-button" caption="${l}"
|
|
264
|
+
esd-extension-block-id="items-block-button"
|
|
265
|
+
product-attr="button" data-slot-6="" data-type="${a}" data-number="${t}">
|
|
266
|
+
<span class="es-button-border ${r}" style="${i}">
|
|
267
|
+
<a
|
|
268
|
+
class="es-button"
|
|
269
|
+
href="#!"
|
|
270
|
+
target="_blank"
|
|
271
|
+
style="${d} padding: 5px 12px;">
|
|
272
|
+
${l}
|
|
273
|
+
</a>
|
|
274
|
+
</span>
|
|
275
|
+
</td>`;
|
|
276
|
+
}
|
|
277
|
+
return `
|
|
278
|
+
<${h.BLOCK_BUTTON}
|
|
279
|
+
width="100%"
|
|
280
|
+
class="ins-button"
|
|
281
|
+
name="buy-button"
|
|
282
|
+
caption="${l}"
|
|
283
|
+
align="center"
|
|
284
|
+
esd-extension-block-id="${P.BUTTON}"
|
|
285
|
+
product-attr="button"
|
|
286
|
+
data-slot-6
|
|
99
287
|
data-type="${a}"
|
|
100
288
|
data-number="${t}"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
caption="Buy"
|
|
130
|
-
align="center"
|
|
131
|
-
esd-extension-block-id="${T.BUTTON}"
|
|
132
|
-
product-attr="button"
|
|
133
|
-
data-slot-6
|
|
134
|
-
data-type="${a}"
|
|
135
|
-
data-number="${t}"
|
|
136
|
-
>Buy
|
|
137
|
-
</${l.BLOCK_BUTTON}>
|
|
138
|
-
`, D = () => `
|
|
139
|
-
<esd-config-block style="display: none;"></esd-config-block>
|
|
140
|
-
`, R = (a, t, o, e, c, n, r, d) => {
|
|
141
|
-
const $ = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
|
|
142
|
-
return a.replace(
|
|
289
|
+
>${l}
|
|
290
|
+
</${h.BLOCK_BUTTON}>
|
|
291
|
+
`;
|
|
292
|
+
}, st = (a, t, l, e = !0, c = !0) => {
|
|
293
|
+
const n = t === w.ORIENTATION.VERTICAL, o = l === "horizontal";
|
|
294
|
+
if (n) {
|
|
295
|
+
const i = !o, r = i || !c ? "100%" : "50%", d = i || !e ? "100%" : "50%";
|
|
296
|
+
let s = a.replace(
|
|
297
|
+
/<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
|
|
298
|
+
(p) => p.replace(/width="[^"]*"/gi, `width="${r}"`).replace(/width:\s*[^;]+;/gi, `width: ${r};`)
|
|
299
|
+
);
|
|
300
|
+
return s = s.replace(
|
|
301
|
+
/<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
|
|
302
|
+
(p) => p.replace(/width="[^"]*"/gi, `width="${d}"`).replace(/width:\s*[^;]+;/gi, `width: ${d};`)
|
|
303
|
+
), s;
|
|
304
|
+
}
|
|
305
|
+
return o ? a : a.replace(
|
|
306
|
+
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
307
|
+
(i) => /style\s*=\s*"/i.test(i) ? i.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : i.replace(/>$/, ' style="display: none;">')
|
|
308
|
+
).replace(
|
|
309
|
+
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
310
|
+
(i) => i.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
311
|
+
);
|
|
312
|
+
}, lt = (a) => a ? `<td align="center"
|
|
313
|
+
esd-extension-block-id="items-block" width="560"
|
|
314
|
+
data-number="4"
|
|
315
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : W, f = (a, t, l, e, c, n, o, i, r, d, s, p, E, _ = "horizontal", b, u, I, $) => {
|
|
316
|
+
const L = `${`data-type="${t}" data-number="${l}"`} data-orientation="${e}"`, A = a.replace(
|
|
143
317
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
144
|
-
`<td$1 ${
|
|
145
|
-
).replace("{-{-TEMPLATE_FIRST_LINE-}-}",
|
|
318
|
+
`<td$1 ${L}>`
|
|
319
|
+
), V = r == null ? void 0 : r["data-product_image_control_image-height"], v = n ? Y(t, l, V, s) : j(t, l), z = (s == null ? void 0 : s.buttonLabel) || "Buy", X = (s == null ? void 0 : s.buttonFullWidth) !== void 0 ? s.buttonFullWidth : !0, B = t === w.ITEMS_TYPE.BROWSED_ITEMS ? !1 : s == null ? void 0 : s.quantityControlEnabled, K = (s == null ? void 0 : s.priceVisible) !== void 0 ? s.priceVisible : (r == null ? void 0 : r["data-product_price_visible"]) !== "false", M = (s == null ? void 0 : s.originalPriceVisible) !== void 0 ? s.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", G = A.replace("{-{-TEMPLATE_FIRST_LINE-}-}", lt(n)).replace("{-{-PRODUCT_IMAGE-}-}", v).replace("{-{-PRODUCT_NAME-}-}", Z(t, n, e, p, s)).replaceAll(
|
|
146
320
|
"{-{-PRODUCT_PRICE-}-}",
|
|
147
|
-
|
|
321
|
+
J(
|
|
322
|
+
t,
|
|
323
|
+
l,
|
|
324
|
+
c,
|
|
325
|
+
o,
|
|
326
|
+
i,
|
|
327
|
+
n,
|
|
328
|
+
b,
|
|
329
|
+
$,
|
|
330
|
+
e
|
|
331
|
+
)
|
|
148
332
|
).replaceAll(
|
|
149
333
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
150
|
-
|
|
334
|
+
tt(
|
|
151
335
|
t,
|
|
152
|
-
|
|
336
|
+
l,
|
|
153
337
|
c,
|
|
338
|
+
o,
|
|
339
|
+
i,
|
|
154
340
|
n,
|
|
155
|
-
|
|
341
|
+
M,
|
|
342
|
+
u,
|
|
343
|
+
$,
|
|
344
|
+
e
|
|
156
345
|
)
|
|
157
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
346
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", et(B, n, I)).replace(
|
|
347
|
+
"{-{-PRODUCT_BUTTON-}-}",
|
|
348
|
+
at(t, l, z, n, E, X)
|
|
349
|
+
);
|
|
350
|
+
return st(
|
|
351
|
+
G,
|
|
352
|
+
e,
|
|
353
|
+
_,
|
|
354
|
+
K,
|
|
355
|
+
M
|
|
356
|
+
);
|
|
158
357
|
};
|
|
159
|
-
function
|
|
358
|
+
function pt({
|
|
160
359
|
orientation: a,
|
|
161
|
-
itemsType: t =
|
|
162
|
-
itemId:
|
|
360
|
+
itemsType: t = w.ITEMS_TYPE.CART_ITEMS,
|
|
361
|
+
itemId: l,
|
|
163
362
|
currencySymbol: e,
|
|
164
363
|
currencyLocation: c,
|
|
165
|
-
|
|
364
|
+
migrate: n = !1,
|
|
365
|
+
formattedPrice: o = !0,
|
|
366
|
+
configBlockAttributes: i,
|
|
367
|
+
nodeConfig: r,
|
|
368
|
+
nameStyles: d,
|
|
369
|
+
buttonStyles: s,
|
|
370
|
+
priceStyles: p,
|
|
371
|
+
originalPriceStyles: E,
|
|
372
|
+
quantityStyles: _,
|
|
373
|
+
priceOrientation: b
|
|
166
374
|
}) {
|
|
167
|
-
const
|
|
168
|
-
let
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
else if (
|
|
172
|
-
const
|
|
173
|
-
|
|
375
|
+
const u = C[t].findIndex((A) => A.value === l);
|
|
376
|
+
let I = "1";
|
|
377
|
+
if (u >= 0)
|
|
378
|
+
I = String(u + 1);
|
|
379
|
+
else if (l) {
|
|
380
|
+
const A = l.match(/\((\d+)\)/);
|
|
381
|
+
A && A[1] && ([, I] = A);
|
|
174
382
|
}
|
|
175
|
-
|
|
176
|
-
|
|
383
|
+
const $ = (r == null ? void 0 : r.priceSinglePrice) ?? (i == null ? void 0 : i["data-product_price_control_single_price"]) === "1" ?? !1;
|
|
384
|
+
g = O.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[u >= 0 ? u : 0], N = O.PAIRS_FOR_EXTENSION.name[t].DEFAULT[u >= 0 ? u : 0];
|
|
385
|
+
const T = O.PAIRS_FOR_EXTENSION.price[t], R = O.PAIRS_FOR_EXTENSION.originalPrice[t];
|
|
386
|
+
$ ? (x = o ? T.DEFAULT_SINGLE_PRICE_FORMATTED : T.DEFAULT_SINGLE_PRICE, S = o ? R.DEFAULT_SINGLE_PRICE_FORMATTED : R.DEFAULT_SINGLE_PRICE) : (x = o ? T.DEFAULT_PRICE_FORMATTED : T.DEFAULT_PRICE, S = o ? R.DEFAULT_PRICE_FORMATTED : R.DEFAULT_PRICE), k = O.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT;
|
|
387
|
+
const L = b || (r == null ? void 0 : r.priceOrientation) || "horizontal";
|
|
388
|
+
return a === w.ORIENTATION.VERTICAL ? f(
|
|
389
|
+
H,
|
|
177
390
|
t,
|
|
178
|
-
|
|
391
|
+
I,
|
|
179
392
|
a,
|
|
393
|
+
o,
|
|
180
394
|
n,
|
|
181
395
|
e,
|
|
182
|
-
c
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
396
|
+
c,
|
|
397
|
+
i,
|
|
398
|
+
void 0,
|
|
399
|
+
// nodup
|
|
400
|
+
r,
|
|
186
401
|
d,
|
|
402
|
+
s,
|
|
403
|
+
L,
|
|
404
|
+
p,
|
|
405
|
+
E,
|
|
406
|
+
_,
|
|
407
|
+
$
|
|
408
|
+
) : f(
|
|
409
|
+
Q,
|
|
410
|
+
t,
|
|
411
|
+
I,
|
|
187
412
|
a,
|
|
413
|
+
o,
|
|
188
414
|
n,
|
|
189
415
|
e,
|
|
190
|
-
c
|
|
416
|
+
c,
|
|
417
|
+
i,
|
|
418
|
+
void 0,
|
|
419
|
+
// nodup
|
|
420
|
+
r,
|
|
421
|
+
d,
|
|
422
|
+
s,
|
|
423
|
+
L,
|
|
424
|
+
p,
|
|
425
|
+
E,
|
|
426
|
+
_,
|
|
427
|
+
$
|
|
191
428
|
);
|
|
192
429
|
}
|
|
193
430
|
export {
|
|
194
|
-
|
|
431
|
+
pt as getDefaultTemplate
|
|
195
432
|
};
|