@useinsider/guido 1.4.4 → 2.0.0-beta.087a24f
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 +295 -664
- package/dist/@types/config/defaults.js +44 -0
- package/dist/@types/config/schemas.js +231 -0
- package/dist/@types/config/validator.js +56 -0
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +64 -86
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +18 -15
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +22 -19
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
- package/dist/composables/useActionsApi.js +42 -25
- package/dist/composables/useBlocksConfig.js +23 -20
- package/dist/composables/useConfig.js +51 -5
- package/dist/composables/useHtmlCompiler.js +20 -19
- package/dist/composables/useHtmlValidator.js +41 -41
- package/dist/composables/usePartner.js +19 -9
- package/dist/composables/useStripo.js +55 -56
- package/dist/composables/useTimerClone.js +53 -0
- package/dist/composables/useTranslations.js +3 -2
- package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/itemsBlockMigrator.js +283 -0
- package/dist/enums/defaults.js +4 -67
- package/dist/enums/unsubscribe.js +23 -20
- package/dist/extensions/Blocks/Items/block.js +39 -40
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -49
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +28 -26
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +132 -127
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -48
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -58
- package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
- package/dist/extensions/Blocks/Items/template.js +296 -123
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +172 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +11 -20
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +12 -11
- package/dist/extensions/Blocks/common-control.js +64 -53
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +366 -287
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
- package/dist/node_modules/valibot/dist/index.js +476 -103
- package/dist/services/stripoApi.js +13 -14
- package/dist/services/templateLibraryApi.js +18 -18
- package/dist/src/@types/config/defaults.d.ts +68 -0
- package/dist/src/@types/config/index.d.ts +14 -0
- package/dist/src/@types/config/schemas.d.ts +509 -0
- package/dist/src/@types/config/types.d.ts +142 -0
- package/dist/src/@types/config/validator.d.ts +119 -0
- package/dist/src/@types/generic.d.ts +4 -45
- package/dist/src/components/Guido.vue.d.ts +13 -12
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +186 -2
- package/dist/src/composables/usePartner.d.ts +8 -0
- package/dist/src/composables/useTimerClone.d.ts +6 -0
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
- package/dist/src/enums/defaults.d.ts +5 -6
- package/dist/src/enums/unsubscribe.d.ts +5 -1
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/template.d.ts +20 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +71 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +13 -8
- package/dist/src/library.d.ts +3 -1
- package/dist/src/stores/config.d.ts +1564 -102
- package/dist/static/styles/components/narrow-panel.css.js +0 -10
- package/dist/stores/config.js +141 -9
- package/package.json +3 -3
- package/dist/node_modules/lodash-es/_apply.js +0 -16
- package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
- package/dist/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
- package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
- package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
- package/dist/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/lodash-es/_copyArray.js +0 -9
- package/dist/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
- package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
- package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
- package/dist/node_modules/lodash-es/_overRest.js +0 -15
- package/dist/node_modules/lodash-es/_safeGet.js +0 -7
- package/dist/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/lodash-es/_shortOut.js +0 -16
- package/dist/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
- package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
- package/dist/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/lodash-es/merge.js +0 -8
- package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
- package/dist/package.json.js +0 -7
|
@@ -1,65 +1,55 @@
|
|
|
1
1
|
const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
2
|
-
<table class="es-left ins-product-wrapper
|
|
2
|
+
<table class="es-left ins-product-wrapper" cellspacing="0" cellpadding="0" align="left" width="100%">
|
|
3
3
|
{-{-CONFIG_BLOCK-}-}
|
|
4
4
|
<tbody>
|
|
5
5
|
<tr>
|
|
6
|
-
<td
|
|
7
|
-
<table class="
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</td>
|
|
54
|
-
<td class="product-button-class" data-slot-6>
|
|
55
|
-
<table width="100%">
|
|
56
|
-
<tbody>
|
|
57
|
-
{-{-PRODUCT_BUTTON-}-}
|
|
58
|
-
</tbody>
|
|
59
|
-
</table>
|
|
60
|
-
</td>
|
|
61
|
-
</tr>
|
|
62
|
-
</tbody>
|
|
6
|
+
<td class="es-p20b es-p10r es-p10l es-m-p20b es-p10t" width="100%" align="center">
|
|
7
|
+
<table class="ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
|
|
8
|
+
<tr style="vertical-align: top">
|
|
9
|
+
<td colspan="2" width="100%" align="center" data-slot-1>
|
|
10
|
+
<table width="100%">
|
|
11
|
+
<tbody>
|
|
12
|
+
{-{-PRODUCT_IMAGE-}-}
|
|
13
|
+
</tbody>
|
|
14
|
+
</table>
|
|
15
|
+
</td>
|
|
16
|
+
</tr>
|
|
17
|
+
{-{-PRODUCT_NAME-}-}
|
|
18
|
+
<tr>
|
|
19
|
+
<td width="50%" style=" width: 50%;display: block;float: left;" class="product-price-class">
|
|
20
|
+
<table width="100%">
|
|
21
|
+
<tbody>
|
|
22
|
+
{-{-PRODUCT_PRICE-}-}
|
|
23
|
+
</tbody>
|
|
24
|
+
</table>
|
|
25
|
+
</td>
|
|
26
|
+
<td width="50%" style=" width: 50%;display: block;float: left;"
|
|
27
|
+
class="product-original-price-class">
|
|
28
|
+
<table width="100%">
|
|
29
|
+
<tbody>
|
|
30
|
+
{-{-PRODUCT_ORIGINAL_PRICE-}-}
|
|
31
|
+
</tbody>
|
|
32
|
+
</table>
|
|
33
|
+
</td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td width="100%" class="product-quantity-class" data-slot-3>
|
|
37
|
+
<table width="100%">
|
|
38
|
+
<tbody>
|
|
39
|
+
{-{-PRODUCT_QUANTITY-}-}
|
|
40
|
+
</tbody>
|
|
41
|
+
</table>
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td width="100%" class="product-button-class" data-slot-6>
|
|
46
|
+
<table width="100%">
|
|
47
|
+
<tbody>
|
|
48
|
+
{-{-PRODUCT_BUTTON-}-}
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
63
53
|
</table>
|
|
64
54
|
</td>
|
|
65
55
|
</tr>
|
|
@@ -9,11 +9,11 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
|
|
|
9
9
|
buttonLink: o(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
|
-
priceOrientation: "
|
|
16
|
+
priceOrientation: "vertical",
|
|
17
17
|
templateData: {
|
|
18
18
|
imageSrc: "",
|
|
19
19
|
name: "",
|
|
@@ -1,29 +1,86 @@
|
|
|
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 $, BlockAttr as R } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { ItemsBlockId as b } from "./enums/controlEnums.js";
|
|
3
|
+
import { productPairs as c, templateFirstLine as v } from "./enums/productEnums.js";
|
|
4
|
+
import { ItemInCartOptions as X, SETTINGS_ENUMS as y, DefaultConfigValues as P } from "./enums/settingsEnums.js";
|
|
5
|
+
import K from "./layouts/horizontal.html.js";
|
|
6
|
+
import z from "./layouts/vertical.html.js";
|
|
7
|
+
let [N] = c.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = c.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [f] = c.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [k] = c.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [m] = c.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
8
|
+
const S = (e) => e.split(";").map((t) => t.trim()).filter((t) => !t.toLowerCase().startsWith("text-align")).join("; ").replace(/;\s*$/, ""), G = (e, t, n) => {
|
|
9
|
+
const a = n || P.productImageWidth;
|
|
10
|
+
return `
|
|
11
|
+
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
12
|
+
align="center"
|
|
13
|
+
esd-extension-block-id="items-block-image"
|
|
14
|
+
data-slot-1=""
|
|
15
|
+
product-attr="imageSrc"
|
|
16
|
+
data-type="${e}"
|
|
17
|
+
data-number="${t}"
|
|
18
|
+
style="font-size: 0px;">
|
|
19
|
+
<a class="document-node-component ng-star-inserted"
|
|
20
|
+
target="_blank"
|
|
21
|
+
href="#!">
|
|
22
|
+
<img class="adapt-img document-node-component ng-star-inserted"
|
|
23
|
+
src="${N}"
|
|
24
|
+
alt="${A}"
|
|
25
|
+
width="${a}">
|
|
26
|
+
</a>
|
|
27
|
+
</td>
|
|
28
|
+
`;
|
|
29
|
+
}, Q = (e, t) => `
|
|
30
|
+
<${$.BLOCK_IMAGE}
|
|
31
|
+
${R.BLOCK_IMAGE.src}="${N}"
|
|
32
|
+
${R.BLOCK_IMAGE.alt}="${A}"
|
|
33
|
+
${R.BLOCK_IMAGE.href}="#!"
|
|
34
|
+
${R.BLOCK_IMAGE.width}="${P.productImageWidth}"
|
|
35
|
+
${R.BLOCK_IMAGE.height}="${P.productImageWidth}"
|
|
36
|
+
esd-extension-block-id="${b.IMAGE}"
|
|
15
37
|
data-slot-1
|
|
16
38
|
product-attr="imageSrc"
|
|
17
|
-
data-type="${
|
|
39
|
+
data-type="${e}"
|
|
18
40
|
data-number="${t}"
|
|
19
41
|
/>
|
|
20
|
-
`,
|
|
21
|
-
|
|
42
|
+
`, W = (e, t, n, a) => {
|
|
43
|
+
const l = `
|
|
44
|
+
text-decoration:none;
|
|
45
|
+
font-size: inherit;
|
|
46
|
+
font-weight: inherit;
|
|
47
|
+
line-height: inherit;
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
color: inherit;
|
|
50
|
+
display: block;
|
|
51
|
+
word-wrap:break-word;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
width: ${n === y.ORIENTATION.HORIZONTAL ? "130px" : "520px"};
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
text-overflow: ellipsis;
|
|
56
|
+
`, o = a || l;
|
|
57
|
+
return t ? `
|
|
58
|
+
<td class="esd-block-text es-p10"
|
|
59
|
+
align="center"
|
|
60
|
+
width="100%"
|
|
61
|
+
data-type="${e}"
|
|
62
|
+
esd-extension-block-id="${b.NAME}"
|
|
63
|
+
style="display: table-cell;">
|
|
64
|
+
<div id="renderedContent" class="service-element text-block-input-area text-block-preview-area"
|
|
65
|
+
style="outline: none;" contenteditable="">
|
|
66
|
+
<p contenteditable="false" path="1">
|
|
67
|
+
<a
|
|
68
|
+
href="#!"
|
|
69
|
+
style="${o}"
|
|
70
|
+
product-attr="name"
|
|
71
|
+
data-slot-2
|
|
72
|
+
width="100%">
|
|
73
|
+
${A}
|
|
74
|
+
</a>
|
|
75
|
+
</p>
|
|
76
|
+
</div>
|
|
77
|
+
</td>
|
|
78
|
+
` : `<${$.BLOCK_TEXT}
|
|
22
79
|
width="100%"
|
|
23
80
|
align="center"
|
|
24
81
|
class="es-p10"
|
|
25
|
-
data-type="${
|
|
26
|
-
esd-extension-block-id="${
|
|
82
|
+
data-type="${e}"
|
|
83
|
+
esd-extension-block-id="${b.NAME}"
|
|
27
84
|
>
|
|
28
85
|
<p contenteditable="false">
|
|
29
86
|
<a
|
|
@@ -48,148 +105,264 @@ const h = (a, t) => `
|
|
|
48
105
|
${A}
|
|
49
106
|
</a>
|
|
50
107
|
</p>
|
|
51
|
-
</${
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
108
|
+
</${$.BLOCK_TEXT}>
|
|
109
|
+
`;
|
|
110
|
+
}, q = (e, t, n, a, r, l, o) => {
|
|
111
|
+
let d = f;
|
|
112
|
+
if (a && a.trim()) {
|
|
113
|
+
const u = ` ${a.trim()} `;
|
|
114
|
+
d = (r || "0") === "1" ? `${f}${u}` : `${u}${f}`;
|
|
115
|
+
}
|
|
116
|
+
const s = r === "1" ? "after" : "before", T = `data-formated="${n ? "true" : "false"}"`, i = `data-curency="${s}"`, E = a ? `data-currency_symbol="${a}"` : "";
|
|
117
|
+
if (l) {
|
|
118
|
+
const p = S(o || "color: #060606; white-space: nowrap; font-size: 20px;");
|
|
119
|
+
return `
|
|
120
|
+
<td class="esd-block-text items-block-price"
|
|
121
|
+
align="center"
|
|
122
|
+
esd-extension-block-id="items-block-price"
|
|
123
|
+
width="100%">
|
|
124
|
+
<p product-attr="price"
|
|
125
|
+
contenteditable="false"
|
|
126
|
+
data-slot-4
|
|
127
|
+
data-type="${e}"
|
|
128
|
+
data-number="${t}"
|
|
129
|
+
${T}
|
|
130
|
+
${i}
|
|
131
|
+
${E}
|
|
132
|
+
style="${p}">
|
|
133
|
+
${d}
|
|
134
|
+
</p>
|
|
135
|
+
</td>`;
|
|
57
136
|
}
|
|
58
|
-
const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
59
137
|
return `
|
|
60
|
-
<${
|
|
61
|
-
esd-extension-block-id="${
|
|
138
|
+
<${$.BLOCK_TEXT}
|
|
139
|
+
esd-extension-block-id="${b.PRICE}"
|
|
62
140
|
class="items-block-price"
|
|
63
|
-
width="100%"
|
|
64
|
-
align="center"
|
|
141
|
+
width="100%"
|
|
142
|
+
align="center"
|
|
65
143
|
>
|
|
66
|
-
<p
|
|
144
|
+
<p
|
|
67
145
|
product-attr="price"
|
|
68
146
|
contenteditable="false"
|
|
69
147
|
data-slot-4
|
|
70
|
-
data-type="${
|
|
148
|
+
data-type="${e}"
|
|
71
149
|
data-number="${t}"
|
|
72
|
-
${
|
|
73
|
-
${
|
|
74
|
-
${
|
|
150
|
+
${T}
|
|
151
|
+
${i}
|
|
152
|
+
${a ? `data-currency_symbol="${a}"` : ""}
|
|
75
153
|
>
|
|
76
|
-
${
|
|
154
|
+
${d}
|
|
77
155
|
</p>
|
|
78
|
-
</${
|
|
156
|
+
</${$.BLOCK_TEXT}>
|
|
79
157
|
`;
|
|
80
|
-
},
|
|
81
|
-
let
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
|
|
158
|
+
}, V = (e, t, n, a, r, l, o = !0, d) => {
|
|
159
|
+
let s = k;
|
|
160
|
+
if (a && a.trim()) {
|
|
161
|
+
const p = ` ${a.trim()} `;
|
|
162
|
+
s = (r || "0") === "1" ? `${k}${p}` : `${p}${k}`;
|
|
163
|
+
}
|
|
164
|
+
const T = r === "1" ? "after" : "before", i = `data-formated="${n ? "true" : "false"}"`, E = `data-curency="${T}"`, u = o ? "" : ' style="display: none;"';
|
|
165
|
+
if (l) {
|
|
166
|
+
const O = S(d || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
167
|
+
return `
|
|
168
|
+
<td class="esd-block-text items-block-price"
|
|
169
|
+
esd-extension-block-id="items-block-original-price"
|
|
170
|
+
width="100%"
|
|
171
|
+
align="center"${u}>
|
|
172
|
+
<p
|
|
173
|
+
product-attr="originalPrice"
|
|
174
|
+
contenteditable="false"
|
|
175
|
+
data-slot-5
|
|
176
|
+
data-type="${e}"
|
|
177
|
+
data-number="${t}"
|
|
178
|
+
${i}
|
|
179
|
+
${E}
|
|
180
|
+
${a ? `data-currency_symbol="${a}"` : ""}
|
|
181
|
+
style="${O}">
|
|
182
|
+
<s>${s}</s>
|
|
183
|
+
</p>
|
|
184
|
+
</td>`;
|
|
85
185
|
}
|
|
86
|
-
const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
87
186
|
return `
|
|
88
|
-
<${
|
|
187
|
+
<${$.BLOCK_TEXT}
|
|
89
188
|
class="items-block-price"
|
|
90
|
-
esd-extension-block-id="${
|
|
91
|
-
width="100%"
|
|
92
|
-
align="center"
|
|
189
|
+
esd-extension-block-id="${b.ORIGINAL_PRICE}"
|
|
190
|
+
width="100%"
|
|
191
|
+
align="center"
|
|
192
|
+
${o ? "" : 'style="display: none;"'}
|
|
93
193
|
>
|
|
94
194
|
<p
|
|
95
195
|
product-attr="originalPrice"
|
|
96
|
-
contenteditable="false"
|
|
196
|
+
contenteditable="false"
|
|
97
197
|
data-slot-5
|
|
98
198
|
style="color: #cc0000"
|
|
99
|
-
data-type="${
|
|
199
|
+
data-type="${e}"
|
|
100
200
|
data-number="${t}"
|
|
101
|
-
${
|
|
102
|
-
${
|
|
103
|
-
${
|
|
201
|
+
${i}
|
|
202
|
+
${E}
|
|
203
|
+
${a ? `data-currency_symbol="${a}"` : ""}
|
|
104
204
|
>
|
|
105
|
-
<s>${
|
|
205
|
+
<s>${s}</s>
|
|
106
206
|
</p>
|
|
107
|
-
</${
|
|
207
|
+
</${$.BLOCK_TEXT}>
|
|
108
208
|
`;
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
209
|
+
}, H = (e = !0, t, n) => {
|
|
210
|
+
const a = e ? "" : 'style="display: none;"';
|
|
211
|
+
return t ? `
|
|
212
|
+
<td class="esd-block-text es-p10 document-node-component default-block-component selectable"
|
|
213
|
+
width="100%" align="center" esd-extension-block-id="items-block-quantity" ${a}>
|
|
214
|
+
<div class="service-element text-block-input-area text-block-preview-area"
|
|
215
|
+
style="outline: none;" contenteditable="">
|
|
216
|
+
<p product-attr="quantity" data-slot-3="" contenteditable="false" width="100%" path="1"
|
|
217
|
+
style="${n || "text-align: center; font-size: 14px;"}">
|
|
218
|
+
${m}
|
|
219
|
+
</p>
|
|
220
|
+
</div>
|
|
221
|
+
</td>` : `
|
|
222
|
+
<${$.BLOCK_TEXT}
|
|
223
|
+
width="100%"
|
|
224
|
+
align="center"
|
|
225
|
+
class="es-p10"
|
|
226
|
+
esd-extension-block-id="${b.QUANTITY}"
|
|
227
|
+
${e ? "" : 'style="display: none;"'}
|
|
228
|
+
>
|
|
229
|
+
<p
|
|
230
|
+
product-attr="quantity"
|
|
231
|
+
data-slot-3
|
|
232
|
+
contenteditable="false"
|
|
233
|
+
width="100%">
|
|
234
|
+
${m}
|
|
235
|
+
</p>
|
|
236
|
+
</${$.BLOCK_TEXT}>
|
|
237
|
+
`;
|
|
238
|
+
}, j = (e, t, n = "Buy", a, r) => a ? `
|
|
239
|
+
<td class="esd-block-button ins-button default-block-component selectable"
|
|
240
|
+
align="center" width="100%" name="buy-button" caption="${n}"
|
|
241
|
+
esd-extension-block-id="items-block-button"
|
|
242
|
+
product-attr="button" data-slot-6="" data-type="${e}" data-number="${t}">
|
|
243
|
+
<span class="es-button-border" style="border-width: 0px;">
|
|
244
|
+
<a class="es-button" href="#!" target="_blank" style="${r || ""}">
|
|
245
|
+
${n}
|
|
246
|
+
</a>
|
|
247
|
+
</span>
|
|
248
|
+
</td>` : `
|
|
249
|
+
<${$.BLOCK_BUTTON}
|
|
250
|
+
width="100%"
|
|
251
|
+
class="ins-button"
|
|
252
|
+
name="buy-button"
|
|
253
|
+
caption="${n}"
|
|
254
|
+
align="center"
|
|
255
|
+
esd-extension-block-id="${b.BUTTON}"
|
|
256
|
+
product-attr="button"
|
|
257
|
+
data-slot-6
|
|
258
|
+
data-type="${e}"
|
|
259
|
+
data-number="${t}"
|
|
260
|
+
>${n}
|
|
261
|
+
</${$.BLOCK_BUTTON}>
|
|
262
|
+
`, Y = (e) => !e || Object.keys(e).length === 0 ? '<esd-config-block style="display: none;"></esd-config-block>' : `<esd-config-block style="display: none;" ${Object.entries(e).map(([n, a]) => `${n}="${a}"`).join(" ")}></esd-config-block>`, Z = (e, t, n) => {
|
|
263
|
+
const a = t === y.ORIENTATION.VERTICAL, r = n === "horizontal";
|
|
264
|
+
return a ? r ? e : e.replace(
|
|
265
|
+
/<td\s+[^>]*class="[^"]*product-(?:original-)?price-class[^"]*"[^>]*>/gi,
|
|
266
|
+
(l) => l.replace(/width="50%"/gi, 'width="100%"').replace(/width:\s*50%;/gi, "width: 100%;")
|
|
267
|
+
) : r ? e : e.replace(
|
|
268
|
+
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
269
|
+
(l) => /style\s*=\s*"/i.test(l) ? l.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : l.replace(/>$/, ' style="display: none;">')
|
|
270
|
+
).replace(
|
|
271
|
+
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
272
|
+
(l) => l.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
273
|
+
);
|
|
274
|
+
}, J = (e) => e ? `<td align="center"
|
|
275
|
+
esd-extension-block-id="items-block" width="560"
|
|
276
|
+
data-number="4"
|
|
277
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : v, g = (e, t, n, a, r, l, o, d, s, T, i, E, u, p = "horizontal", O, _, I) => {
|
|
278
|
+
const x = `${`data-type="${t}" data-number="${n}"`} data-orientation="${a}"`, L = e.replace(
|
|
143
279
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
144
|
-
`<td$1 ${
|
|
145
|
-
).replace("{-{-TEMPLATE_FIRST_LINE-}-}",
|
|
280
|
+
`<td$1 ${x}>`
|
|
281
|
+
), F = s == null ? void 0 : s["data-product_image_control_image-width"], C = l ? G(t, n, F) : Q(t, n), M = (i == null ? void 0 : i.buttonLabel) || "Buy", U = (i == null ? void 0 : i.quantityControlEnabled) !== void 0 ? i.quantityControlEnabled : !0, D = (i == null ? void 0 : i.originalPriceVisible) !== void 0 ? i.originalPriceVisible : (s == null ? void 0 : s["data-product_original_price_control_enabled"]) !== "false", B = L.replace("{-{-TEMPLATE_FIRST_LINE-}-}", J(l)).replace("{-{-PRODUCT_IMAGE-}-}", C).replace("{-{-PRODUCT_NAME-}-}", W(t, l, a, E)).replaceAll(
|
|
146
282
|
"{-{-PRODUCT_PRICE-}-}",
|
|
147
|
-
|
|
283
|
+
q(t, n, r, o, d, l, O)
|
|
148
284
|
).replaceAll(
|
|
149
285
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
150
|
-
|
|
286
|
+
V(
|
|
151
287
|
t,
|
|
152
|
-
o,
|
|
153
|
-
c,
|
|
154
288
|
n,
|
|
155
|
-
r
|
|
289
|
+
r,
|
|
290
|
+
o,
|
|
291
|
+
d,
|
|
292
|
+
l,
|
|
293
|
+
D,
|
|
294
|
+
_
|
|
156
295
|
)
|
|
157
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
296
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", H(U, l, I)).replace("{-{-PRODUCT_BUTTON-}-}", j(t, n, M, l, u)).replace("{-{-CONFIG_BLOCK-}-}", Y(s));
|
|
297
|
+
return Z(B, a, p);
|
|
158
298
|
};
|
|
159
|
-
function
|
|
160
|
-
orientation:
|
|
161
|
-
itemsType: t =
|
|
162
|
-
itemId:
|
|
163
|
-
currencySymbol:
|
|
164
|
-
currencyLocation:
|
|
165
|
-
|
|
299
|
+
function st({
|
|
300
|
+
orientation: e,
|
|
301
|
+
itemsType: t = y.ITEMS_TYPE.CART_ITEMS,
|
|
302
|
+
itemId: n,
|
|
303
|
+
currencySymbol: a,
|
|
304
|
+
currencyLocation: r,
|
|
305
|
+
migrate: l = !1,
|
|
306
|
+
formattedPrice: o = !0,
|
|
307
|
+
configBlockAttributes: d,
|
|
308
|
+
nodeConfig: s,
|
|
309
|
+
nameStyles: T,
|
|
310
|
+
buttonStyles: i,
|
|
311
|
+
priceStyles: E,
|
|
312
|
+
originalPriceStyles: u,
|
|
313
|
+
quantityStyles: p,
|
|
314
|
+
priceOrientation: O
|
|
166
315
|
}) {
|
|
167
|
-
const
|
|
168
|
-
let
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
else if (
|
|
172
|
-
const
|
|
173
|
-
|
|
316
|
+
const _ = X[t].findIndex((h) => h.value === n);
|
|
317
|
+
let I = "1";
|
|
318
|
+
if (_ >= 0)
|
|
319
|
+
I = String(_ + 1);
|
|
320
|
+
else if (n) {
|
|
321
|
+
const h = n.match(/\((\d+)\)/);
|
|
322
|
+
h && h[1] && ([, I] = h);
|
|
174
323
|
}
|
|
175
|
-
|
|
176
|
-
|
|
324
|
+
N = c.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[_ >= 0 ? _ : 0], A = c.PAIRS_FOR_EXTENSION.name[t].DEFAULT[_ >= 0 ? _ : 0], f = o ? c.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : c.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, k = o ? c.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : c.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, m = c.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT;
|
|
325
|
+
const w = O || (s == null ? void 0 : s.priceOrientation) || "horizontal";
|
|
326
|
+
return e === y.ORIENTATION.VERTICAL ? g(
|
|
327
|
+
z,
|
|
177
328
|
t,
|
|
178
|
-
|
|
179
|
-
a,
|
|
180
|
-
n,
|
|
329
|
+
I,
|
|
181
330
|
e,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
B,
|
|
185
|
-
t,
|
|
186
|
-
d,
|
|
331
|
+
o,
|
|
332
|
+
l,
|
|
187
333
|
a,
|
|
188
|
-
|
|
334
|
+
r,
|
|
335
|
+
d,
|
|
336
|
+
void 0,
|
|
337
|
+
// nodup
|
|
338
|
+
s,
|
|
339
|
+
T,
|
|
340
|
+
i,
|
|
341
|
+
w,
|
|
342
|
+
E,
|
|
343
|
+
u,
|
|
344
|
+
p
|
|
345
|
+
) : g(
|
|
346
|
+
K,
|
|
347
|
+
t,
|
|
348
|
+
I,
|
|
189
349
|
e,
|
|
190
|
-
|
|
350
|
+
o,
|
|
351
|
+
l,
|
|
352
|
+
a,
|
|
353
|
+
r,
|
|
354
|
+
d,
|
|
355
|
+
void 0,
|
|
356
|
+
// nodup
|
|
357
|
+
s,
|
|
358
|
+
T,
|
|
359
|
+
i,
|
|
360
|
+
w,
|
|
361
|
+
E,
|
|
362
|
+
u,
|
|
363
|
+
p
|
|
191
364
|
);
|
|
192
365
|
}
|
|
193
366
|
export {
|
|
194
|
-
|
|
367
|
+
st as getDefaultTemplate
|
|
195
368
|
};
|