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