@useinsider/guido 1.0.3-beta.5361682 → 1.0.3-beta.538b804
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 +0 -32
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/composables/useHtmlValidator.js +36 -35
- package/dist/enums/unsubscribe.js +27 -26
- package/dist/extensions/Blocks/Items/block.js +26 -26
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +1 -1
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +48 -36
- package/dist/extensions/Blocks/Items/enums/productEnums.js +62 -4
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +57 -57
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +54 -55
- package/dist/extensions/Blocks/Items/template.js +79 -82
- package/dist/extensions/Blocks/Unsubscribe/block.js +27 -27
- package/dist/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/lodash-es/_SetCache.js +13 -0
- package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +13 -12
- package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
- package/dist/node_modules/lodash-es/_arraySome.js +9 -0
- package/dist/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
- package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
- package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
- package/dist/node_modules/lodash-es/_baseMap.js +11 -0
- package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/lodash-es/_baseRange.js +9 -0
- package/dist/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
- package/dist/node_modules/lodash-es/_createRange.js +11 -0
- package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
- package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
- package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
- package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
- package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/lodash-es/_getTag.js +28 -0
- package/dist/node_modules/lodash-es/_hasPath.js +19 -0
- package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/dist/node_modules/lodash-es/flatMap.js +8 -0
- package/dist/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/node_modules/lodash-es/map.js +11 -0
- package/dist/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/lodash-es/range.js +5 -0
- package/dist/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/lodash-es/toFinite.js +14 -0
- package/dist/node_modules/lodash-es/toNumber.js +22 -0
- package/dist/node_modules/lodash-es/toString.js +7 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +14 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +9 -1
- package/dist/src/utils/environmentUtil.d.ts +5 -0
- package/dist/utils/environmentUtil.js +4 -0
- package/package.json +2 -9
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
const t =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
2
|
+
<table class="es-left ins-product-wrapper" cellspacing="0" cellpadding="0" align="left" width="100%">
|
|
3
|
+
{-{-CONFIG_BLOCK-}-}
|
|
4
|
+
<tbody>
|
|
5
|
+
<tr>
|
|
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%">
|
|
37
|
+
<table width="100%">
|
|
38
|
+
<tbody>
|
|
39
|
+
{-{-PRODUCT_QUANTITY-}-}
|
|
40
|
+
</tbody>
|
|
41
|
+
</table>
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td width="100%">
|
|
46
|
+
<table width="100%">
|
|
47
|
+
<tbody>
|
|
48
|
+
{-{-PRODUCT_BUTTON-}-}
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</table>
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
</tbody>
|
|
57
|
+
</table>
|
|
58
58
|
</td>
|
|
59
59
|
`;
|
|
60
60
|
export {
|
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
const t =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<td class="product-price-class" data-slot-4>
|
|
1
|
+
const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
2
|
+
<table class="es-left ins-product-wrapper ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
|
|
3
|
+
{-{-CONFIG_BLOCK-}-}
|
|
4
|
+
<tbody>
|
|
5
|
+
<tr>
|
|
6
|
+
<td style="padding: 16px 9px;">
|
|
7
|
+
<table class="es-left esdev-disable-select" cellspacing="0" cellpadding="0" align="left" width="100%">
|
|
8
|
+
<tbody>
|
|
9
|
+
<tr>
|
|
10
|
+
<td class="product-image-class" data-slot-1>
|
|
11
|
+
{-{-PRODUCT_IMAGE-}-}
|
|
12
|
+
</td>
|
|
13
|
+
<td class="product-name-class" data-slot-2 width="130px">
|
|
14
|
+
<table width="130">
|
|
15
|
+
<tbody>
|
|
16
|
+
{-{-PRODUCT_NAME-}-}
|
|
17
|
+
</tbody>
|
|
18
|
+
</table>
|
|
19
|
+
</td>
|
|
20
|
+
<td class="product-quantity-class" data-slot-3>
|
|
21
|
+
<table width="100%">
|
|
22
|
+
<tbody>
|
|
23
|
+
{-{-PRODUCT_QUANTITY-}-}
|
|
24
|
+
</tbody>
|
|
25
|
+
</table>
|
|
26
|
+
</td>
|
|
27
|
+
<td class="product-price-class" data-slot-4>
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
29
|
+
<table width="100%">
|
|
30
|
+
<tbody>
|
|
31
|
+
{-{-PRODUCT_PRICE-}-}
|
|
32
|
+
</tbody>
|
|
33
|
+
</table>
|
|
34
|
+
</td>
|
|
35
|
+
<td class="product-original-price-class" data-slot-5>
|
|
36
|
+
<table width="100%">
|
|
37
|
+
<tbody>
|
|
38
|
+
{-{-PRODUCT_ORIGINAL_PRICE-}-}
|
|
39
|
+
</tbody>
|
|
40
|
+
</table>
|
|
41
|
+
</td>
|
|
42
|
+
<td class="product-button-class" data-slot-6>
|
|
43
|
+
<table width="100%">
|
|
44
|
+
<tbody>
|
|
45
|
+
{-{-PRODUCT_BUTTON-}-}
|
|
46
|
+
</tbody>
|
|
47
|
+
</table>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
</tbody>
|
|
51
|
+
</table>
|
|
52
|
+
</td>
|
|
53
|
+
</tr>
|
|
54
|
+
</tbody>
|
|
55
|
+
</table>
|
|
57
56
|
</td>
|
|
58
57
|
`;
|
|
59
58
|
export {
|
|
@@ -1,61 +1,58 @@
|
|
|
1
|
-
import { BlockType as l, BlockAttr as
|
|
2
|
-
import { ItemsBlockId as
|
|
3
|
-
import { productPairs as
|
|
4
|
-
import { ItemInCartOptions as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
BlinkMacSystemFont,
|
|
10
|
-
'Segoe UI',
|
|
11
|
-
Roboto,
|
|
12
|
-
Helvetica,
|
|
13
|
-
Arial,
|
|
14
|
-
sans-serif,
|
|
15
|
-
'Apple Color Emoji',
|
|
16
|
-
'Segoe UI Emoji',
|
|
17
|
-
'Segoe UI Symbol'
|
|
18
|
-
`;
|
|
19
|
-
let [R] = c.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [C] = c.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [_] = c.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [$] = c.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = c.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
20
|
-
const f = (a, t) => `
|
|
1
|
+
import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { ItemsBlockId as d } from "./enums/controlEnums.js";
|
|
3
|
+
import { productPairs as i, templateFirstLine as N } from "./enums/productEnums.js";
|
|
4
|
+
import { ItemInCartOptions as P, SETTINGS_ENUMS as O } from "./enums/settingsEnums.js";
|
|
5
|
+
import f from "./layouts/horizontal.html.js";
|
|
6
|
+
import B from "./layouts/vertical.html.js";
|
|
7
|
+
let [R] = i.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [C] = i.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [I] = i.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [$] = i.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = i.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
8
|
+
const g = (a, t) => `
|
|
21
9
|
<${l.BLOCK_IMAGE}
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
esd-extension-block-id="${
|
|
10
|
+
${_.BLOCK_IMAGE.src}="${R}"
|
|
11
|
+
${_.BLOCK_IMAGE.alt}="Product Image"
|
|
12
|
+
${_.BLOCK_IMAGE.href}="#!"
|
|
13
|
+
${_.BLOCK_IMAGE.width}="70"
|
|
14
|
+
esd-extension-block-id="${d.IMAGE}"
|
|
27
15
|
data-slot-1
|
|
28
16
|
product-attr="imageSrc"
|
|
29
17
|
data-type="${a}"
|
|
30
18
|
data-number="${t}"
|
|
31
19
|
/>
|
|
32
|
-
`,
|
|
20
|
+
`, F = (a) => `
|
|
33
21
|
<${l.BLOCK_TEXT}
|
|
34
22
|
width="100%"
|
|
35
23
|
align="center"
|
|
36
24
|
class="es-p10"
|
|
37
25
|
data-type="${a}"
|
|
38
|
-
esd-extension-block-id="${
|
|
26
|
+
esd-extension-block-id="${d.NAME}"
|
|
39
27
|
>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
<p contenteditable="false">
|
|
29
|
+
<a
|
|
30
|
+
href="#!"
|
|
31
|
+
style="
|
|
32
|
+
text-decoration:none;
|
|
33
|
+
font-size: inherit;
|
|
34
|
+
font-weight: inherit;
|
|
35
|
+
line-height: inherit;
|
|
36
|
+
font-family: inherit;
|
|
37
|
+
color: inherit;
|
|
38
|
+
"
|
|
39
|
+
product-attr="name"
|
|
40
|
+
data-slot-2
|
|
41
|
+
width="100%">
|
|
42
|
+
${C}
|
|
43
|
+
</a>
|
|
44
|
+
</p>
|
|
48
45
|
</${l.BLOCK_TEXT}>
|
|
49
|
-
`,
|
|
50
|
-
let
|
|
46
|
+
`, S = (a, t, n, e, c) => {
|
|
47
|
+
let o = I;
|
|
51
48
|
if (e && e.trim()) {
|
|
52
|
-
const
|
|
53
|
-
|
|
49
|
+
const T = ` ${e.trim()} `;
|
|
50
|
+
o = (c || "0") === "1" ? `${I}${T}` : `${T}${I}`;
|
|
54
51
|
}
|
|
55
|
-
const r =
|
|
52
|
+
const r = c === "1" ? "after" : "before", E = `data-formated="${n ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
56
53
|
return `
|
|
57
54
|
<${l.BLOCK_TEXT}
|
|
58
|
-
esd-extension-block-id="${
|
|
55
|
+
esd-extension-block-id="${d.PRICE}"
|
|
59
56
|
class="items-block-price"
|
|
60
57
|
width="100%"
|
|
61
58
|
align="center"
|
|
@@ -66,25 +63,25 @@ const f = (a, t) => `
|
|
|
66
63
|
data-slot-4
|
|
67
64
|
data-type="${a}"
|
|
68
65
|
data-number="${t}"
|
|
69
|
-
${s}
|
|
70
66
|
${E}
|
|
67
|
+
${s}
|
|
71
68
|
${e ? `data-currency_symbol="${e}"` : ""}
|
|
72
69
|
>
|
|
73
|
-
${
|
|
70
|
+
${o}
|
|
74
71
|
</p>
|
|
75
72
|
</${l.BLOCK_TEXT}>
|
|
76
73
|
`;
|
|
77
|
-
},
|
|
78
|
-
let
|
|
74
|
+
}, L = (a, t, n, e, c) => {
|
|
75
|
+
let o = $;
|
|
79
76
|
if (e && e.trim()) {
|
|
80
|
-
const
|
|
81
|
-
|
|
77
|
+
const T = ` ${e.trim()} `;
|
|
78
|
+
o = (c || "0") === "1" ? `${$}${T}` : `${T}${$}`;
|
|
82
79
|
}
|
|
83
|
-
const r =
|
|
80
|
+
const r = c === "1" ? "after" : "before", E = `data-formated="${n ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
84
81
|
return `
|
|
85
82
|
<${l.BLOCK_TEXT}
|
|
86
83
|
class="items-block-price"
|
|
87
|
-
esd-extension-block-id="${
|
|
84
|
+
esd-extension-block-id="${d.ORIGINAL_PRICE}"
|
|
88
85
|
width="100%"
|
|
89
86
|
align="center"
|
|
90
87
|
>
|
|
@@ -95,20 +92,20 @@ const f = (a, t) => `
|
|
|
95
92
|
style="color: #cc0000"
|
|
96
93
|
data-type="${a}"
|
|
97
94
|
data-number="${t}"
|
|
98
|
-
${s}
|
|
99
95
|
${E}
|
|
96
|
+
${s}
|
|
100
97
|
${e ? `data-currency_symbol="${e}"` : ""}
|
|
101
98
|
>
|
|
102
|
-
<s>${
|
|
99
|
+
<s>${o}</s>
|
|
103
100
|
</p>
|
|
104
101
|
</${l.BLOCK_TEXT}>
|
|
105
102
|
`;
|
|
106
|
-
},
|
|
103
|
+
}, b = () => `
|
|
107
104
|
<${l.BLOCK_TEXT}
|
|
108
105
|
width="100%"
|
|
109
106
|
align="center"
|
|
110
107
|
class="es-p10"
|
|
111
|
-
esd-extension-block-id="${
|
|
108
|
+
esd-extension-block-id="${d.QUANTITY}"
|
|
112
109
|
>
|
|
113
110
|
<p
|
|
114
111
|
product-attr="quantity"
|
|
@@ -118,73 +115,73 @@ const f = (a, t) => `
|
|
|
118
115
|
${u}
|
|
119
116
|
</p>
|
|
120
117
|
</${l.BLOCK_TEXT}>
|
|
121
|
-
`,
|
|
118
|
+
`, h = (a, t) => `
|
|
122
119
|
<${l.BLOCK_BUTTON}
|
|
123
120
|
width="100%"
|
|
124
121
|
class="ins-button"
|
|
125
122
|
name="buy-button"
|
|
126
123
|
caption="Buy"
|
|
127
124
|
align="center"
|
|
128
|
-
esd-extension-block-id="${
|
|
125
|
+
esd-extension-block-id="${d.BUTTON}"
|
|
129
126
|
product-attr="button"
|
|
130
127
|
data-slot-6
|
|
131
128
|
data-type="${a}"
|
|
132
129
|
data-number="${t}"
|
|
133
130
|
>Buy
|
|
134
131
|
</${l.BLOCK_BUTTON}>
|
|
135
|
-
`,
|
|
132
|
+
`, U = () => `
|
|
136
133
|
<esd-config-block style="display: none;"></esd-config-block>
|
|
137
|
-
`, p = (a, t,
|
|
138
|
-
const A = `${`data-type="${t}" data-number="${
|
|
134
|
+
`, p = (a, t, n, e, c, o, r, E) => {
|
|
135
|
+
const A = `${`data-type="${t}" data-number="${n}"`} data-orientation="${e}"`;
|
|
139
136
|
return a.replace(
|
|
140
137
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
141
138
|
`<td$1 ${A}>`
|
|
142
|
-
).replace("{-{-PRODUCT_IMAGE-}-}",
|
|
139
|
+
).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", g(t, n)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replace(
|
|
143
140
|
"{-{-PRODUCT_PRICE-}-}",
|
|
144
|
-
|
|
141
|
+
S(t, n, c, o, r)
|
|
145
142
|
).replace(
|
|
146
143
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
147
|
-
|
|
144
|
+
L(
|
|
148
145
|
t,
|
|
149
|
-
o,
|
|
150
|
-
i,
|
|
151
146
|
n,
|
|
147
|
+
c,
|
|
148
|
+
o,
|
|
152
149
|
r
|
|
153
150
|
)
|
|
154
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
151
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", h(t, n)).replace("{-{-CONFIG_BLOCK-}-}", U());
|
|
155
152
|
};
|
|
156
153
|
function x({
|
|
157
154
|
orientation: a,
|
|
158
155
|
itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
|
|
159
|
-
itemId:
|
|
156
|
+
itemId: n,
|
|
160
157
|
currencySymbol: e,
|
|
161
|
-
currencyLocation:
|
|
162
|
-
formattedPrice:
|
|
158
|
+
currencyLocation: c,
|
|
159
|
+
formattedPrice: o = !0
|
|
163
160
|
}) {
|
|
164
|
-
const r =
|
|
165
|
-
let
|
|
161
|
+
const r = P[t].findIndex((s) => s.value === n);
|
|
162
|
+
let E = "1";
|
|
166
163
|
if (r >= 0)
|
|
167
|
-
|
|
168
|
-
else if (
|
|
169
|
-
const
|
|
170
|
-
|
|
164
|
+
E = String(r + 1);
|
|
165
|
+
else if (n) {
|
|
166
|
+
const s = n.match(/\((\d+)\)/);
|
|
167
|
+
s && s[1] && ([, E] = s);
|
|
171
168
|
}
|
|
172
|
-
return R =
|
|
173
|
-
|
|
169
|
+
return R = i.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[r >= 0 ? r : 0], C = i.PAIRS_FOR_EXTENSION.name[t].DEFAULT[r >= 0 ? r : 0], I = o ? i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, $ = o ? i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = i.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === O.ORIENTATION.VERTICAL ? p(
|
|
170
|
+
B,
|
|
174
171
|
t,
|
|
175
|
-
|
|
172
|
+
E,
|
|
176
173
|
a,
|
|
177
|
-
|
|
174
|
+
o,
|
|
178
175
|
e,
|
|
179
|
-
|
|
176
|
+
c
|
|
180
177
|
) : p(
|
|
181
|
-
|
|
178
|
+
f,
|
|
182
179
|
t,
|
|
183
|
-
|
|
180
|
+
E,
|
|
184
181
|
a,
|
|
185
|
-
|
|
182
|
+
o,
|
|
186
183
|
e,
|
|
187
|
-
|
|
184
|
+
c
|
|
188
185
|
);
|
|
189
186
|
}
|
|
190
187
|
export {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var u = (n, i, e) =>
|
|
2
|
+
var S = (n, i, e) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
|
|
3
|
+
var u = (n, i, e) => S(n, typeof i != "symbol" ? i + "" : i, e);
|
|
4
4
|
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
5
5
|
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
6
|
-
import { Block as
|
|
7
|
-
import { getDefaultTemplate as
|
|
6
|
+
import { Block as d, BlockCompositionType as L, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { getDefaultTemplate as h } from "./template.js";
|
|
8
8
|
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
9
9
|
import { parsePageList as m } from "./utils/utils.js";
|
|
10
|
-
const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]',
|
|
10
|
+
const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', T = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", B = {
|
|
11
11
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
12
12
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
13
13
|
};
|
|
14
|
-
class D extends
|
|
14
|
+
class D extends d {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
u(this, "selectEventListener", null);
|
|
@@ -25,7 +25,7 @@ class D extends S {
|
|
|
25
25
|
return "unsubscribe-icon";
|
|
26
26
|
}
|
|
27
27
|
getBlockCompositionType() {
|
|
28
|
-
return
|
|
28
|
+
return L.BLOCK;
|
|
29
29
|
}
|
|
30
30
|
getName() {
|
|
31
31
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -34,10 +34,10 @@ class D extends S {
|
|
|
34
34
|
return this.api.translate("Unsubscribe Block Description");
|
|
35
35
|
}
|
|
36
36
|
getTemplate() {
|
|
37
|
-
return
|
|
37
|
+
return h();
|
|
38
38
|
}
|
|
39
39
|
onCreated(e) {
|
|
40
|
-
"getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
40
|
+
"getOuterHTML" in e && !e.getOuterHTML() || "getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
41
41
|
}
|
|
42
42
|
onSelect(e) {
|
|
43
43
|
this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
|
|
@@ -50,8 +50,8 @@ class D extends S {
|
|
|
50
50
|
}
|
|
51
51
|
_setupSelectEventListener() {
|
|
52
52
|
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
53
|
-
const
|
|
54
|
-
this._updateBlock(t,
|
|
53
|
+
const s = e, { collectionType: t, selectedPages: r } = s.detail;
|
|
54
|
+
this._updateBlock(t, r.join(","));
|
|
55
55
|
}, document.addEventListener(a.SELECT, this.selectEventListener);
|
|
56
56
|
}
|
|
57
57
|
_removeSelectEventListener() {
|
|
@@ -71,17 +71,17 @@ class D extends S {
|
|
|
71
71
|
_removeEventListeners() {
|
|
72
72
|
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
73
73
|
}
|
|
74
|
-
_updateBlock(e,
|
|
74
|
+
_updateBlock(e, s) {
|
|
75
75
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
76
76
|
return;
|
|
77
77
|
const t = this.currentNode.querySelector(g);
|
|
78
78
|
if (!t)
|
|
79
79
|
return;
|
|
80
|
-
const
|
|
81
|
-
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href",
|
|
80
|
+
const r = this._getMergeTag(e);
|
|
81
|
+
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", r).apply(new b(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, s).apply(new b("Updated unsubscribe block metadata"));
|
|
82
82
|
}
|
|
83
83
|
_getMergeTag(e) {
|
|
84
|
-
return
|
|
84
|
+
return B[e] ?? f;
|
|
85
85
|
}
|
|
86
86
|
_openDrawer() {
|
|
87
87
|
try {
|
|
@@ -93,11 +93,11 @@ class D extends S {
|
|
|
93
93
|
}
|
|
94
94
|
_checkExistingBlocks() {
|
|
95
95
|
const e = c();
|
|
96
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(
|
|
96
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(T).forEach((t) => {
|
|
97
97
|
if ("getAttribute" in t) {
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
const l = Number(
|
|
98
|
+
const r = t.getAttribute(o.PAGE_TYPE);
|
|
99
|
+
if (r) {
|
|
100
|
+
const l = Number(r);
|
|
101
101
|
l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -106,11 +106,11 @@ class D extends S {
|
|
|
106
106
|
_loadBlockState(e) {
|
|
107
107
|
if (!("getAttribute" in e))
|
|
108
108
|
return;
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
109
|
+
const s = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
|
|
110
|
+
if (!s || !t)
|
|
111
111
|
return;
|
|
112
|
-
const
|
|
113
|
-
|
|
112
|
+
const r = c(), l = Number(s), p = m(t);
|
|
113
|
+
r.setCollectionWithoutAutoSelection(l), r.loadSelectedTemplates(p);
|
|
114
114
|
}
|
|
115
115
|
_resetStoreState() {
|
|
116
116
|
c().$reset();
|
|
@@ -118,11 +118,11 @@ class D extends S {
|
|
|
118
118
|
_removeBlockTemplatesFromStore(e) {
|
|
119
119
|
if (!("getAttribute" in e))
|
|
120
120
|
return;
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
121
|
+
const s = e.getAttribute(o.PAGE_LIST);
|
|
122
|
+
if (!s)
|
|
123
123
|
return;
|
|
124
|
-
const t = c(),
|
|
125
|
-
t.removeUnsubscribePages(
|
|
124
|
+
const t = c(), r = m(s);
|
|
125
|
+
t.removeUnsubscribePages(r);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
export {
|