@useinsider/guido 2.0.0-beta.eee5ecc → 2.0.0-beta.f66b754
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/email-preview/PreviewContainer.vue.js +3 -3
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +6 -6
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +6 -6
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
- package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue2.js +15 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +16 -15
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +14 -22
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
- package/dist/components/organisms/header/EditorActions.vue.js +21 -0
- package/dist/components/organisms/header/EditorActions.vue2.js +41 -0
- package/dist/components/organisms/header/EditorToolbar.vue.js +18 -0
- package/dist/components/organisms/header/EditorToolbar.vue2.js +17 -0
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -5
- package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
- package/dist/components/organisms/header/LeftSlot.vue2.js +13 -14
- package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
- package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -14
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -30
- package/dist/components/organisms/header/version-history/VersionHistory.vue.js +5 -5
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
- package/dist/config/migrator/itemsBlockMigrator.js +72 -64
- package/dist/enums/academy.js +8 -0
- package/dist/enums/onboarding.js +1 -2
- package/dist/enums/unsubscribe.js +20 -21
- package/dist/extensions/Blocks/Items/block.js +23 -20
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -32
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +69 -75
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -0
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/template.js +210 -221
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +61 -53
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +4 -0
- package/dist/src/components/organisms/header/EditorToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/enums/academy.d.ts +12 -0
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/enums/unsubscribe.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -5
- package/dist/src/stores/editor.d.ts +21 -0
- package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
- package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
- package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
- package/dist/static/styles/components/wide-panel.css.js +1 -1
- package/dist/stores/editor.js +1 -0
- package/package.json +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
|
@@ -1,54 +1,52 @@
|
|
|
1
|
-
import { BlockType as
|
|
2
|
-
import { ItemsBlockId as
|
|
3
|
-
import { productPairs as
|
|
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
4
|
import { ItemInCartOptions as C, SETTINGS_ENUMS as w, DefaultConfigValues as F } from "./enums/settingsEnums.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi"),
|
|
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"),
|
|
14
13
|
`$1${l}`
|
|
15
|
-
) :
|
|
16
|
-
const c = l || F.productImageHeight, n = (
|
|
14
|
+
) : a, Y = (a, t, l, e) => {
|
|
15
|
+
const c = l || F.productImageHeight, n = (e == null ? void 0 : e.imageVisible) === !1 ? "display: none; " : "";
|
|
17
16
|
return `
|
|
18
17
|
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
19
18
|
align="center"
|
|
20
|
-
esd-extension-block-id="
|
|
19
|
+
esd-extension-block-id="items-block-image"
|
|
21
20
|
data-slot-1=""
|
|
22
21
|
product-attr="imageSrc"
|
|
23
|
-
data-type="${
|
|
24
|
-
data-number="${
|
|
22
|
+
data-type="${a}"
|
|
23
|
+
data-number="${t}"
|
|
25
24
|
style="${n}font-size: 0px;">
|
|
26
25
|
<a class="document-node-component ng-star-inserted"
|
|
27
26
|
target="_blank"
|
|
28
27
|
href="#!">
|
|
29
28
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
30
|
-
src="${
|
|
31
|
-
alt="${
|
|
32
|
-
width="${c}"
|
|
29
|
+
src="${g}"
|
|
30
|
+
alt="${N}"
|
|
33
31
|
height="${c}">
|
|
34
32
|
</a>
|
|
35
33
|
</td>
|
|
36
34
|
`;
|
|
37
|
-
},
|
|
38
|
-
<${
|
|
39
|
-
${
|
|
40
|
-
${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
esd-extension-block-id="${
|
|
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}"
|
|
45
43
|
data-slot-1
|
|
46
44
|
product-attr="imageSrc"
|
|
47
|
-
data-type="${
|
|
48
|
-
data-number="${
|
|
45
|
+
data-type="${a}"
|
|
46
|
+
data-number="${t}"
|
|
49
47
|
/>
|
|
50
|
-
`,
|
|
51
|
-
const
|
|
48
|
+
`, Z = (a, t, l, e, c) => {
|
|
49
|
+
const o = `
|
|
52
50
|
text-decoration:none;
|
|
53
51
|
font-size: inherit;
|
|
54
52
|
font-weight: inherit;
|
|
@@ -62,41 +60,41 @@ const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
62
60
|
overflow: hidden;
|
|
63
61
|
text-overflow: ellipsis;
|
|
64
62
|
`;
|
|
65
|
-
if (
|
|
66
|
-
const i = m(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
].filter(Boolean).join("; "),
|
|
70
|
-
|
|
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"),
|
|
71
69
|
"font-size",
|
|
72
70
|
"inherit"
|
|
73
|
-
),
|
|
71
|
+
), _ = (c == null ? void 0 : c.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
|
|
74
72
|
return `
|
|
75
73
|
<td class="esd-block-text es-p10"
|
|
76
74
|
align="${i}"
|
|
77
75
|
width="100%"
|
|
78
|
-
data-type="${
|
|
79
|
-
esd-extension-block-id="${
|
|
80
|
-
style="${
|
|
76
|
+
data-type="${a}"
|
|
77
|
+
esd-extension-block-id="${P.NAME}"
|
|
78
|
+
style="${_}">
|
|
81
79
|
<p contenteditable="false" path="1"${p ? ` style="${p}"` : ""}>
|
|
82
80
|
<a
|
|
83
81
|
href="#!"
|
|
84
|
-
style="${
|
|
82
|
+
style="${E}"
|
|
85
83
|
product-attr="name"
|
|
86
84
|
data-slot-2
|
|
87
85
|
width="100%">
|
|
88
|
-
${
|
|
86
|
+
${N}
|
|
89
87
|
</a>
|
|
90
88
|
</p>
|
|
91
89
|
</td>
|
|
92
90
|
`;
|
|
93
91
|
}
|
|
94
|
-
return `<${
|
|
92
|
+
return `<${h.BLOCK_TEXT}
|
|
95
93
|
width="100%"
|
|
96
94
|
align="center"
|
|
97
95
|
class="es-p10"
|
|
98
|
-
data-type="${
|
|
99
|
-
esd-extension-block-id="${
|
|
96
|
+
data-type="${a}"
|
|
97
|
+
esd-extension-block-id="${P.NAME}"
|
|
100
98
|
>
|
|
101
99
|
<p contenteditable="false">
|
|
102
100
|
<a
|
|
@@ -118,44 +116,43 @@ const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
118
116
|
product-attr="name"
|
|
119
117
|
data-slot-2
|
|
120
118
|
width="100%">
|
|
121
|
-
${
|
|
119
|
+
${N}
|
|
122
120
|
</a>
|
|
123
121
|
</p>
|
|
124
|
-
</${
|
|
122
|
+
</${h.BLOCK_TEXT}>
|
|
125
123
|
`;
|
|
126
|
-
},
|
|
127
|
-
let
|
|
128
|
-
if (
|
|
129
|
-
const
|
|
130
|
-
|
|
124
|
+
}, J = (a, t, l, e, c, n, o, i, r) => {
|
|
125
|
+
let d = x;
|
|
126
|
+
if (e && e.trim()) {
|
|
127
|
+
const $ = ` ${e.trim()} `;
|
|
128
|
+
d = (c || "0") === "1" ? `${x}${$}` : `${$}${x}`;
|
|
131
129
|
}
|
|
132
|
-
const
|
|
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" : "";
|
|
133
131
|
if (n) {
|
|
134
|
-
const
|
|
132
|
+
const T = D(o || "color: #060606; white-space: nowrap; font-size: 20px;");
|
|
135
133
|
return `
|
|
136
|
-
<td class="esd-block-text items-block-price${
|
|
134
|
+
<td class="esd-block-text items-block-price${I}"
|
|
137
135
|
align="center"
|
|
138
|
-
esd-extension-block-id="
|
|
139
|
-
width="100%"
|
|
140
|
-
${y}>
|
|
136
|
+
esd-extension-block-id="items-block-price"
|
|
137
|
+
width="100%">
|
|
141
138
|
<p product-attr="price"
|
|
142
139
|
contenteditable="false"
|
|
143
140
|
data-slot-4
|
|
144
|
-
data-type="${
|
|
145
|
-
data-number="${
|
|
146
|
-
${
|
|
147
|
-
${
|
|
148
|
-
${
|
|
149
|
-
${
|
|
150
|
-
style="${
|
|
151
|
-
${
|
|
141
|
+
data-type="${a}"
|
|
142
|
+
data-number="${t}"
|
|
143
|
+
${p}
|
|
144
|
+
${E}
|
|
145
|
+
${_}
|
|
146
|
+
${b}
|
|
147
|
+
style="${T}">
|
|
148
|
+
${d}
|
|
152
149
|
</p>
|
|
153
150
|
</td>`;
|
|
154
151
|
}
|
|
155
152
|
return `
|
|
156
|
-
<${
|
|
157
|
-
esd-extension-block-id="${
|
|
158
|
-
class="items-block-price ${
|
|
153
|
+
<${h.BLOCK_TEXT}
|
|
154
|
+
esd-extension-block-id="${P.PRICE}"
|
|
155
|
+
class="items-block-price ${I}"
|
|
159
156
|
width="100%"
|
|
160
157
|
align="center"
|
|
161
158
|
>
|
|
@@ -163,281 +160,273 @@ const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
163
160
|
product-attr="price"
|
|
164
161
|
contenteditable="false"
|
|
165
162
|
data-slot-4
|
|
166
|
-
data-type="${
|
|
167
|
-
data-number="${
|
|
168
|
-
${
|
|
169
|
-
${
|
|
170
|
-
${
|
|
171
|
-
${
|
|
163
|
+
data-type="${a}"
|
|
164
|
+
data-number="${t}"
|
|
165
|
+
${p}
|
|
166
|
+
${E}
|
|
167
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
168
|
+
${b}
|
|
172
169
|
>
|
|
173
|
-
${
|
|
170
|
+
${d}
|
|
174
171
|
</p>
|
|
175
|
-
</${
|
|
172
|
+
</${h.BLOCK_TEXT}>
|
|
176
173
|
`;
|
|
177
|
-
},
|
|
178
|
-
let
|
|
179
|
-
if (
|
|
180
|
-
const
|
|
181
|
-
|
|
174
|
+
}, tt = (a, t, l, e, c, n, o = !0, i, r, d) => {
|
|
175
|
+
let s = S;
|
|
176
|
+
if (e && e.trim()) {
|
|
177
|
+
const T = ` ${e.trim()} `;
|
|
178
|
+
s = (c || "0") === "1" ? `${S}${T}` : `${T}${S}`;
|
|
182
179
|
}
|
|
183
|
-
const p = c === "1" ? "after" : "before",
|
|
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" : "";
|
|
184
181
|
if (n) {
|
|
185
|
-
const
|
|
182
|
+
const R = D(i || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
186
183
|
return `
|
|
187
|
-
<td class="esd-block-text items-block-price${
|
|
188
|
-
esd-extension-block-id="
|
|
184
|
+
<td class="esd-block-text items-block-price${$}"
|
|
185
|
+
esd-extension-block-id="items-block-original-price"
|
|
189
186
|
width="100%"
|
|
190
|
-
align="center"${
|
|
187
|
+
align="center"${b}>
|
|
191
188
|
<p
|
|
192
189
|
product-attr="originalPrice"
|
|
193
190
|
contenteditable="false"
|
|
194
191
|
data-slot-5
|
|
195
|
-
data-type="${
|
|
196
|
-
data-number="${
|
|
197
|
-
${
|
|
192
|
+
data-type="${a}"
|
|
193
|
+
data-number="${t}"
|
|
194
|
+
${E}
|
|
195
|
+
${_}
|
|
196
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
198
197
|
${u}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
style="${h}">
|
|
202
|
-
<s>${t}</s>
|
|
198
|
+
style="${R}">
|
|
199
|
+
<s>${s}</s>
|
|
203
200
|
</p>
|
|
204
201
|
</td>
|
|
205
202
|
`;
|
|
206
203
|
}
|
|
207
204
|
return `
|
|
208
|
-
<${
|
|
209
|
-
class="items-block-price ${
|
|
210
|
-
esd-extension-block-id="${
|
|
205
|
+
<${h.BLOCK_TEXT}
|
|
206
|
+
class="items-block-price ${$}"
|
|
207
|
+
esd-extension-block-id="${P.ORIGINAL_PRICE}"
|
|
211
208
|
width="100%"
|
|
212
209
|
align="center"
|
|
213
|
-
${
|
|
210
|
+
${o ? "" : 'style="display: none;"'}
|
|
214
211
|
>
|
|
215
212
|
<p
|
|
216
213
|
product-attr="originalPrice"
|
|
217
214
|
contenteditable="false"
|
|
218
215
|
data-slot-5
|
|
219
216
|
style="color: #cc0000"
|
|
220
|
-
data-type="${
|
|
221
|
-
data-number="${
|
|
222
|
-
${
|
|
217
|
+
data-type="${a}"
|
|
218
|
+
data-number="${t}"
|
|
219
|
+
${E}
|
|
220
|
+
${_}
|
|
221
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
223
222
|
${u}
|
|
224
|
-
${a ? `data-currency_symbol="${a}"` : ""}
|
|
225
|
-
${$}
|
|
226
223
|
>
|
|
227
|
-
<s>${
|
|
224
|
+
<s>${s}</s>
|
|
228
225
|
</p>
|
|
229
|
-
</${
|
|
226
|
+
</${h.BLOCK_TEXT}>
|
|
230
227
|
`;
|
|
231
|
-
},
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
const n = l || "text-align: center; font-size: 14px;";
|
|
235
|
-
return `
|
|
228
|
+
}, et = (a = !0, t, l) => {
|
|
229
|
+
const e = a ? "" : 'style="display: none;"';
|
|
230
|
+
return t ? `
|
|
236
231
|
<td class="esd-block-text es-p10 document-node-component default-block-component selectable"
|
|
237
|
-
width="100%" align="center"
|
|
238
|
-
esd-extension-block-id="${I.QUANTITY}"
|
|
239
|
-
${a}>
|
|
232
|
+
width="100%" align="center" esd-extension-block-id="items-block-quantity" ${e}>
|
|
240
233
|
<p product-attr="quantity"
|
|
241
234
|
data-slot-3=""
|
|
242
235
|
contenteditable="false"
|
|
243
236
|
width="100%"
|
|
244
237
|
path="1"
|
|
245
|
-
style="${
|
|
246
|
-
${
|
|
238
|
+
style="${l || "text-align: center; font-size: 14px;"}">
|
|
239
|
+
${k}
|
|
247
240
|
</p>
|
|
248
|
-
</td
|
|
249
|
-
|
|
250
|
-
return `
|
|
251
|
-
<${O.BLOCK_TEXT}
|
|
241
|
+
</td>` : `
|
|
242
|
+
<${h.BLOCK_TEXT}
|
|
252
243
|
width="100%"
|
|
253
244
|
align="center"
|
|
254
245
|
class="es-p10"
|
|
255
|
-
esd-extension-block-id="${
|
|
256
|
-
${
|
|
246
|
+
esd-extension-block-id="${P.QUANTITY}"
|
|
247
|
+
${a ? "" : 'style="display: none;"'}
|
|
257
248
|
>
|
|
258
249
|
<p
|
|
259
250
|
product-attr="quantity"
|
|
260
251
|
data-slot-3
|
|
261
252
|
contenteditable="false"
|
|
262
253
|
width="100%">
|
|
263
|
-
${
|
|
254
|
+
${k}
|
|
264
255
|
</p>
|
|
265
|
-
</${
|
|
256
|
+
</${h.BLOCK_TEXT}>
|
|
266
257
|
`;
|
|
267
|
-
},
|
|
268
|
-
if (
|
|
269
|
-
const
|
|
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;", "");
|
|
270
261
|
return `
|
|
271
262
|
<td class="esd-block-button ins-button default-block-component selectable"
|
|
272
263
|
align="center" width="100%" name="buy-button" caption="${l}"
|
|
273
|
-
esd-extension-block-id="
|
|
274
|
-
product-attr="button" data-slot-6="" data-type="${
|
|
275
|
-
${
|
|
276
|
-
<span class="es-button-border ${o}" style="${r}">
|
|
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}">
|
|
277
267
|
<a
|
|
278
268
|
class="es-button"
|
|
279
269
|
href="#!"
|
|
280
270
|
target="_blank"
|
|
281
|
-
style="${
|
|
271
|
+
style="${d} padding: 5px 12px;">
|
|
282
272
|
${l}
|
|
283
273
|
</a>
|
|
284
274
|
</span>
|
|
285
275
|
</td>`;
|
|
286
276
|
}
|
|
287
277
|
return `
|
|
288
|
-
<${
|
|
278
|
+
<${h.BLOCK_BUTTON}
|
|
289
279
|
width="100%"
|
|
290
280
|
class="ins-button"
|
|
291
281
|
name="buy-button"
|
|
292
282
|
caption="${l}"
|
|
293
283
|
align="center"
|
|
294
|
-
esd-extension-block-id="${
|
|
284
|
+
esd-extension-block-id="${P.BUTTON}"
|
|
295
285
|
product-attr="button"
|
|
296
286
|
data-slot-6
|
|
297
|
-
data-type="${
|
|
298
|
-
data-number="${
|
|
287
|
+
data-type="${a}"
|
|
288
|
+
data-number="${t}"
|
|
299
289
|
>${l}
|
|
300
|
-
</${
|
|
290
|
+
</${h.BLOCK_BUTTON}>
|
|
301
291
|
`;
|
|
302
|
-
},
|
|
303
|
-
const n =
|
|
292
|
+
}, st = (a, t, l, e = !0, c = !0) => {
|
|
293
|
+
const n = t === w.ORIENTATION.VERTICAL, o = l === "horizontal";
|
|
304
294
|
if (n) {
|
|
305
|
-
const i = !
|
|
306
|
-
let
|
|
295
|
+
const i = !o, r = i || !c ? "100%" : "50%", d = i || !e ? "100%" : "50%";
|
|
296
|
+
let s = a.replace(
|
|
307
297
|
/<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
|
|
308
298
|
(p) => p.replace(/width="[^"]*"/gi, `width="${r}"`).replace(/width:\s*[^;]+;/gi, `width: ${r};`)
|
|
309
299
|
);
|
|
310
|
-
return
|
|
300
|
+
return s = s.replace(
|
|
311
301
|
/<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
|
|
312
|
-
(p) => p.replace(/width="[^"]*"/gi, `width="${
|
|
313
|
-
),
|
|
302
|
+
(p) => p.replace(/width="[^"]*"/gi, `width="${d}"`).replace(/width:\s*[^;]+;/gi, `width: ${d};`)
|
|
303
|
+
), s;
|
|
314
304
|
}
|
|
315
|
-
return
|
|
305
|
+
return o ? a : a.replace(
|
|
316
306
|
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
317
307
|
(i) => /style\s*=\s*"/i.test(i) ? i.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : i.replace(/>$/, ' style="display: none;">')
|
|
318
308
|
).replace(
|
|
319
309
|
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
320
310
|
(i) => i.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
321
311
|
);
|
|
322
|
-
},
|
|
312
|
+
}, lt = (a) => a ? `<td align="center"
|
|
323
313
|
esd-extension-block-id="items-block" width="560"
|
|
324
314
|
data-number="4"
|
|
325
|
-
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` :
|
|
326
|
-
const
|
|
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(
|
|
327
317
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
328
|
-
`<td$1 ${
|
|
329
|
-
),
|
|
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(
|
|
330
320
|
"{-{-PRODUCT_PRICE-}-}",
|
|
331
|
-
|
|
332
|
-
|
|
321
|
+
J(
|
|
322
|
+
t,
|
|
333
323
|
l,
|
|
334
324
|
c,
|
|
335
|
-
|
|
325
|
+
o,
|
|
336
326
|
i,
|
|
337
327
|
n,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
))
|
|
328
|
+
b,
|
|
329
|
+
$,
|
|
330
|
+
e
|
|
331
|
+
)
|
|
343
332
|
).replaceAll(
|
|
344
333
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
345
|
-
|
|
346
|
-
|
|
334
|
+
tt(
|
|
335
|
+
t,
|
|
347
336
|
l,
|
|
348
337
|
c,
|
|
349
|
-
|
|
338
|
+
o,
|
|
350
339
|
i,
|
|
351
340
|
n,
|
|
352
|
-
|
|
341
|
+
M,
|
|
342
|
+
u,
|
|
353
343
|
$,
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}", st(B, n, b)).replace(
|
|
344
|
+
e
|
|
345
|
+
)
|
|
346
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", et(B, n, I)).replace(
|
|
358
347
|
"{-{-PRODUCT_BUTTON-}-}",
|
|
359
|
-
|
|
348
|
+
at(t, l, z, n, E, X)
|
|
360
349
|
);
|
|
361
|
-
return
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
350
|
+
return st(
|
|
351
|
+
G,
|
|
352
|
+
e,
|
|
353
|
+
_,
|
|
354
|
+
K,
|
|
355
|
+
M
|
|
367
356
|
);
|
|
368
357
|
};
|
|
369
|
-
function
|
|
370
|
-
orientation:
|
|
371
|
-
itemsType:
|
|
358
|
+
function pt({
|
|
359
|
+
orientation: a,
|
|
360
|
+
itemsType: t = w.ITEMS_TYPE.CART_ITEMS,
|
|
372
361
|
itemId: l,
|
|
373
|
-
currencySymbol:
|
|
362
|
+
currencySymbol: e,
|
|
374
363
|
currencyLocation: c,
|
|
375
364
|
migrate: n = !1,
|
|
376
|
-
formattedPrice:
|
|
365
|
+
formattedPrice: o = !0,
|
|
377
366
|
configBlockAttributes: i,
|
|
378
367
|
nodeConfig: r,
|
|
379
|
-
nameStyles:
|
|
380
|
-
buttonStyles:
|
|
368
|
+
nameStyles: d,
|
|
369
|
+
buttonStyles: s,
|
|
381
370
|
priceStyles: p,
|
|
382
|
-
originalPriceStyles:
|
|
383
|
-
quantityStyles:
|
|
384
|
-
priceOrientation:
|
|
371
|
+
originalPriceStyles: E,
|
|
372
|
+
quantityStyles: _,
|
|
373
|
+
priceOrientation: b
|
|
385
374
|
}) {
|
|
386
|
-
const
|
|
387
|
-
let
|
|
388
|
-
if (
|
|
389
|
-
|
|
375
|
+
const u = C[t].findIndex((A) => A.value === l);
|
|
376
|
+
let I = "1";
|
|
377
|
+
if (u >= 0)
|
|
378
|
+
I = String(u + 1);
|
|
390
379
|
else if (l) {
|
|
391
380
|
const A = l.match(/\((\d+)\)/);
|
|
392
|
-
A && A[1] && ([,
|
|
381
|
+
A && A[1] && ([, I] = A);
|
|
393
382
|
}
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
const
|
|
399
|
-
return
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
s,
|
|
404
|
-
d,
|
|
405
|
-
n,
|
|
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,
|
|
390
|
+
t,
|
|
391
|
+
I,
|
|
406
392
|
a,
|
|
393
|
+
o,
|
|
394
|
+
n,
|
|
395
|
+
e,
|
|
407
396
|
c,
|
|
408
397
|
i,
|
|
409
398
|
void 0,
|
|
410
399
|
// nodup
|
|
411
400
|
r,
|
|
412
|
-
o,
|
|
413
|
-
t,
|
|
414
|
-
y,
|
|
415
|
-
p,
|
|
416
|
-
T,
|
|
417
|
-
u,
|
|
418
|
-
_
|
|
419
|
-
) : z(
|
|
420
|
-
Y,
|
|
421
|
-
e,
|
|
422
|
-
b,
|
|
423
|
-
s,
|
|
424
401
|
d,
|
|
425
|
-
|
|
402
|
+
s,
|
|
403
|
+
L,
|
|
404
|
+
p,
|
|
405
|
+
E,
|
|
406
|
+
_,
|
|
407
|
+
$
|
|
408
|
+
) : f(
|
|
409
|
+
Q,
|
|
410
|
+
t,
|
|
411
|
+
I,
|
|
426
412
|
a,
|
|
413
|
+
o,
|
|
414
|
+
n,
|
|
415
|
+
e,
|
|
427
416
|
c,
|
|
428
417
|
i,
|
|
429
418
|
void 0,
|
|
430
419
|
// nodup
|
|
431
420
|
r,
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
421
|
+
d,
|
|
422
|
+
s,
|
|
423
|
+
L,
|
|
435
424
|
p,
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
425
|
+
E,
|
|
426
|
+
_,
|
|
427
|
+
$
|
|
439
428
|
);
|
|
440
429
|
}
|
|
441
430
|
export {
|
|
442
|
-
|
|
431
|
+
pt as getDefaultTemplate
|
|
443
432
|
};
|