@useinsider/guido 1.0.3-beta.f2389d0 → 1.0.3-beta.f263f71
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/desktop-preview/EmailSizeIndicator.vue.js +8 -8
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +90 -94
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +2 -3
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -3
- package/dist/extensions/Blocks/Items/extension.js +6 -7
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +2 -2
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +5 -17
- package/dist/extensions/Blocks/Items/settingsPanel.js +24 -25
- package/dist/extensions/Blocks/Items/store/items-block.js +4 -8
- package/dist/extensions/Blocks/Items/template.js +59 -65
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +26 -35
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +27 -29
- package/dist/extensions/Blocks/Unsubscribe/block.js +30 -34
- package/dist/guido.css +1 -1
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -6
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +4 -3
- package/package.json +1 -3
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +0 -92
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -15
|
@@ -33,7 +33,7 @@ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
|
33
33
|
</td>
|
|
34
34
|
</tr>
|
|
35
35
|
<tr>
|
|
36
|
-
<td width="100%"
|
|
36
|
+
<td width="100%">
|
|
37
37
|
<table width="100%">
|
|
38
38
|
<tbody>
|
|
39
39
|
{-{-PRODUCT_QUANTITY-}-}
|
|
@@ -42,7 +42,7 @@ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
|
42
42
|
</td>
|
|
43
43
|
</tr>
|
|
44
44
|
<tr>
|
|
45
|
-
<td width="100%"
|
|
45
|
+
<td width="100%">
|
|
46
46
|
<table width="100%">
|
|
47
47
|
<tbody>
|
|
48
48
|
{-{-PRODUCT_BUTTON-}-}
|
|
@@ -10,8 +10,8 @@ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
|
10
10
|
<td class="product-image-class" data-slot-1>
|
|
11
11
|
{-{-PRODUCT_IMAGE-}-}
|
|
12
12
|
</td>
|
|
13
|
-
<td class="product-name-class" data-slot-2>
|
|
14
|
-
<table>
|
|
13
|
+
<td class="product-name-class" data-slot-2 width="130px">
|
|
14
|
+
<table width="130">
|
|
15
15
|
<tbody>
|
|
16
16
|
{-{-PRODUCT_NAME-}-}
|
|
17
17
|
</tbody>
|
|
@@ -24,33 +24,21 @@ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
|
24
24
|
</tbody>
|
|
25
25
|
</table>
|
|
26
26
|
</td>
|
|
27
|
-
<td class="product-price-class
|
|
27
|
+
<td class="product-price-class" data-slot-4>
|
|
28
|
+
|
|
28
29
|
<table width="100%">
|
|
29
30
|
<tbody>
|
|
30
31
|
{-{-PRODUCT_PRICE-}-}
|
|
31
32
|
</tbody>
|
|
32
33
|
</table>
|
|
33
34
|
</td>
|
|
34
|
-
<td class="product-original-price-class
|
|
35
|
+
<td class="product-original-price-class" data-slot-5>
|
|
35
36
|
<table width="100%">
|
|
36
37
|
<tbody>
|
|
37
38
|
{-{-PRODUCT_ORIGINAL_PRICE-}-}
|
|
38
39
|
</tbody>
|
|
39
40
|
</table>
|
|
40
41
|
</td>
|
|
41
|
-
<td class="product-price-container vertical-price" data-slot-4 style="display: none;">
|
|
42
|
-
<table class="product-price-class" width="100%" data-slot-4>
|
|
43
|
-
<tbody>
|
|
44
|
-
{-{-PRODUCT_PRICE-}-}
|
|
45
|
-
</tbody>
|
|
46
|
-
</table>
|
|
47
|
-
<table class="product-original-price-class product-original-price-container"
|
|
48
|
-
width="100%" data-slot-5>
|
|
49
|
-
<tbody>
|
|
50
|
-
{-{-PRODUCT_ORIGINAL_PRICE-}-}
|
|
51
|
-
</tbody>
|
|
52
|
-
</table>
|
|
53
|
-
</td>
|
|
54
42
|
<td class="product-button-class" data-slot-6>
|
|
55
43
|
<table width="100%">
|
|
56
44
|
<tbody>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as
|
|
2
|
-
import { BLOCK_ID as
|
|
3
|
-
import { COMPOSITION_CONTROL_BLOCK_ID as
|
|
1
|
+
import { SettingsPanelRegistry as O, SettingsPanelTab as T, SettingsTab as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as S } from "./block.js";
|
|
3
|
+
import { COMPOSITION_CONTROL_BLOCK_ID as R } from "./controls/cardComposition.js";
|
|
4
4
|
import { CONTROL_BLOCK_ID as A } from "./controls/settingsControl.js";
|
|
5
5
|
import { ItemsBlockId as E, ItemsBlockControlId as I } from "./enums/controlEnums.js";
|
|
6
6
|
class U extends O {
|
|
7
|
-
registerBlockControls(
|
|
8
|
-
|
|
7
|
+
registerBlockControls(N) {
|
|
8
|
+
N[S] = [
|
|
9
9
|
new T(
|
|
10
|
-
|
|
10
|
+
_.SETTINGS,
|
|
11
11
|
[
|
|
12
12
|
A
|
|
13
13
|
]
|
|
@@ -15,12 +15,12 @@ class U extends O {
|
|
|
15
15
|
new T(
|
|
16
16
|
"Card Composition",
|
|
17
17
|
[
|
|
18
|
-
|
|
18
|
+
R
|
|
19
19
|
]
|
|
20
20
|
).withLabel("Card Composition")
|
|
21
|
-
],
|
|
21
|
+
], N[E.ORIGINAL_PRICE] = [
|
|
22
22
|
new T(
|
|
23
|
-
|
|
23
|
+
_.SETTINGS,
|
|
24
24
|
[
|
|
25
25
|
I.ORIGINAL_PRICE_STYLE,
|
|
26
26
|
I.ORIGINAL_PRICE_ALIGN,
|
|
@@ -28,16 +28,16 @@ class U extends O {
|
|
|
28
28
|
]
|
|
29
29
|
),
|
|
30
30
|
new T(
|
|
31
|
-
|
|
31
|
+
_.STYLES,
|
|
32
32
|
[
|
|
33
33
|
I.ORIGINAL_PRICE_COLOR,
|
|
34
34
|
I.ORIGINAL_PRICE_FONT_FAMILY,
|
|
35
35
|
I.ORIGINAL_PRICE_SIZE
|
|
36
36
|
]
|
|
37
37
|
)
|
|
38
|
-
],
|
|
38
|
+
], N[E.PRICE] = [
|
|
39
39
|
new T(
|
|
40
|
-
|
|
40
|
+
_.SETTINGS,
|
|
41
41
|
[
|
|
42
42
|
I.PRICE_STYLE,
|
|
43
43
|
I.PRICE_ALIGN,
|
|
@@ -45,21 +45,20 @@ class U extends O {
|
|
|
45
45
|
I.PRICE_FORMATTED_PRICE,
|
|
46
46
|
I.PRICE_CURRENCY_SYMBOL,
|
|
47
47
|
I.PRICE_CURRENCY_LOCATION,
|
|
48
|
-
I.PRICE_ORIENTATION,
|
|
49
48
|
I.PRICE_PADDINGS
|
|
50
49
|
]
|
|
51
50
|
),
|
|
52
51
|
new T(
|
|
53
|
-
|
|
52
|
+
_.STYLES,
|
|
54
53
|
[
|
|
55
54
|
I.PRICE_COLOR,
|
|
56
55
|
I.PRICE_FONT_FAMILY,
|
|
57
56
|
I.PRICE_SIZE
|
|
58
57
|
]
|
|
59
58
|
)
|
|
60
|
-
],
|
|
59
|
+
], N[E.NAME] = [
|
|
61
60
|
new T(
|
|
62
|
-
|
|
61
|
+
_.SETTINGS,
|
|
63
62
|
[
|
|
64
63
|
I.NAME_STYLE,
|
|
65
64
|
I.NAME_ALIGN,
|
|
@@ -68,23 +67,23 @@ class U extends O {
|
|
|
68
67
|
]
|
|
69
68
|
),
|
|
70
69
|
new T(
|
|
71
|
-
|
|
70
|
+
_.STYLES,
|
|
72
71
|
[
|
|
73
72
|
I.NAME_FONT_FAMILY,
|
|
74
73
|
I.NAME_SIZE,
|
|
75
74
|
I.NAME_COLOR
|
|
76
75
|
]
|
|
77
76
|
)
|
|
78
|
-
],
|
|
77
|
+
], N[E.QUANTITY] = [
|
|
79
78
|
new T(
|
|
80
|
-
|
|
79
|
+
_.SETTINGS,
|
|
81
80
|
[
|
|
82
81
|
I.QUANTITY_FONT_FAMILY,
|
|
83
82
|
I.QUANTITY_STYLE
|
|
84
83
|
]
|
|
85
84
|
),
|
|
86
85
|
new T(
|
|
87
|
-
|
|
86
|
+
_.STYLES,
|
|
88
87
|
[
|
|
89
88
|
I.QUANTITY_ALIGN,
|
|
90
89
|
I.QUANTITY_SIZE,
|
|
@@ -92,18 +91,18 @@ class U extends O {
|
|
|
92
91
|
I.QUANTITY_PADDINGS
|
|
93
92
|
]
|
|
94
93
|
)
|
|
95
|
-
],
|
|
94
|
+
], N[E.IMAGE] = [
|
|
96
95
|
new T(
|
|
97
|
-
|
|
96
|
+
_.SETTINGS,
|
|
98
97
|
[
|
|
99
98
|
I.IMAGE_LINK,
|
|
100
99
|
I.IMAGE_SIZE,
|
|
101
100
|
I.IMAGE_MARGINS
|
|
102
101
|
]
|
|
103
102
|
)
|
|
104
|
-
],
|
|
103
|
+
], N[E.BUTTON] = [
|
|
105
104
|
new T(
|
|
106
|
-
|
|
105
|
+
_.SETTINGS,
|
|
107
106
|
[
|
|
108
107
|
I.BUTTON_LINK,
|
|
109
108
|
I.BUTTON_TEXT,
|
|
@@ -113,7 +112,7 @@ class U extends O {
|
|
|
113
112
|
]
|
|
114
113
|
),
|
|
115
114
|
new T(
|
|
116
|
-
|
|
115
|
+
_.STYLES,
|
|
117
116
|
[
|
|
118
117
|
I.BUTTON_COLOR,
|
|
119
118
|
I.BUTTON_FONT_FAMILY,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineStore as
|
|
1
|
+
import { defineStore as s } from "pinia";
|
|
2
2
|
import { DefaultConfigValues as e } from "../enums/settingsEnums.js";
|
|
3
3
|
const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "Url}"), i = () => {
|
|
4
4
|
const t = e.cartItemsSelectControlValue;
|
|
@@ -8,12 +8,11 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
|
|
|
8
8
|
imageLink: n(t),
|
|
9
9
|
buttonLink: o(t),
|
|
10
10
|
orientation: e.cardOrientationControlValue,
|
|
11
|
-
nameTrimming: !
|
|
11
|
+
nameTrimming: !1,
|
|
12
12
|
hideDiscount: !1,
|
|
13
13
|
currencySymbol: "USD",
|
|
14
14
|
currencyLocation: "0",
|
|
15
15
|
formattedPrice: !0,
|
|
16
|
-
priceOrientation: "horizontal",
|
|
17
16
|
templateData: {
|
|
18
17
|
imageSrc: "",
|
|
19
18
|
name: "",
|
|
@@ -23,7 +22,7 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
|
|
|
23
22
|
button: ""
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
|
-
},
|
|
25
|
+
}, a = s("guidoItemsBlock", {
|
|
27
26
|
state: () => i(),
|
|
28
27
|
actions: {
|
|
29
28
|
setItemsType(t) {
|
|
@@ -56,9 +55,6 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
|
|
|
56
55
|
setFormattedPrice(t) {
|
|
57
56
|
this.formattedPrice = t;
|
|
58
57
|
},
|
|
59
|
-
setPriceOrientation(t) {
|
|
60
|
-
this.priceOrientation = t;
|
|
61
|
-
},
|
|
62
58
|
setTemplateData(t) {
|
|
63
59
|
this.templateData = t;
|
|
64
60
|
},
|
|
@@ -71,5 +67,5 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
|
|
|
71
67
|
}
|
|
72
68
|
});
|
|
73
69
|
export {
|
|
74
|
-
|
|
70
|
+
a as useItemsBlockStore
|
|
75
71
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { ItemsBlockId as
|
|
2
|
+
import { ItemsBlockId as d } from "./enums/controlEnums.js";
|
|
3
3
|
import { productPairs as i, templateFirstLine as N } from "./enums/productEnums.js";
|
|
4
|
-
import { ItemInCartOptions as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
let [
|
|
8
|
-
const
|
|
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) => `
|
|
9
9
|
<${l.BLOCK_IMAGE}
|
|
10
|
-
${_.BLOCK_IMAGE.src}="${
|
|
11
|
-
${_.BLOCK_IMAGE.alt}="
|
|
10
|
+
${_.BLOCK_IMAGE.src}="${R}"
|
|
11
|
+
${_.BLOCK_IMAGE.alt}="Product Image"
|
|
12
12
|
${_.BLOCK_IMAGE.href}="#!"
|
|
13
|
-
${_.BLOCK_IMAGE.width}
|
|
14
|
-
esd-extension-block-id="${
|
|
13
|
+
${_.BLOCK_IMAGE.width}="70"
|
|
14
|
+
esd-extension-block-id="${d.IMAGE}"
|
|
15
15
|
data-slot-1
|
|
16
16
|
product-attr="imageSrc"
|
|
17
17
|
data-type="${a}"
|
|
@@ -23,7 +23,7 @@ const h = (a, t) => `
|
|
|
23
23
|
align="center"
|
|
24
24
|
class="es-p10"
|
|
25
25
|
data-type="${a}"
|
|
26
|
-
esd-extension-block-id="${
|
|
26
|
+
esd-extension-block-id="${d.NAME}"
|
|
27
27
|
>
|
|
28
28
|
<p contenteditable="false">
|
|
29
29
|
<a
|
|
@@ -35,30 +35,24 @@ const h = (a, t) => `
|
|
|
35
35
|
line-height: inherit;
|
|
36
36
|
font-family: inherit;
|
|
37
37
|
color: inherit;
|
|
38
|
-
display: block;
|
|
39
|
-
word-wrap:break-word;
|
|
40
|
-
white-space: nowrap;
|
|
41
|
-
width: 520px;
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
text-overflow: ellipsis;
|
|
44
38
|
"
|
|
45
39
|
product-attr="name"
|
|
46
40
|
data-slot-2
|
|
47
41
|
width="100%">
|
|
48
|
-
${
|
|
42
|
+
${C}
|
|
49
43
|
</a>
|
|
50
44
|
</p>
|
|
51
45
|
</${l.BLOCK_TEXT}>
|
|
52
|
-
`, S = (a, t,
|
|
53
|
-
let
|
|
46
|
+
`, S = (a, t, n, e, c) => {
|
|
47
|
+
let o = I;
|
|
54
48
|
if (e && e.trim()) {
|
|
55
|
-
const
|
|
56
|
-
|
|
49
|
+
const T = ` ${e.trim()} `;
|
|
50
|
+
o = (c || "0") === "1" ? `${I}${T}` : `${T}${I}`;
|
|
57
51
|
}
|
|
58
|
-
const r = c === "1" ? "after" : "before",
|
|
52
|
+
const r = c === "1" ? "after" : "before", E = `data-formated="${n ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
59
53
|
return `
|
|
60
54
|
<${l.BLOCK_TEXT}
|
|
61
|
-
esd-extension-block-id="${
|
|
55
|
+
esd-extension-block-id="${d.PRICE}"
|
|
62
56
|
class="items-block-price"
|
|
63
57
|
width="100%"
|
|
64
58
|
align="center"
|
|
@@ -69,25 +63,25 @@ const h = (a, t) => `
|
|
|
69
63
|
data-slot-4
|
|
70
64
|
data-type="${a}"
|
|
71
65
|
data-number="${t}"
|
|
72
|
-
${
|
|
66
|
+
${E}
|
|
73
67
|
${s}
|
|
74
68
|
${e ? `data-currency_symbol="${e}"` : ""}
|
|
75
69
|
>
|
|
76
|
-
${
|
|
70
|
+
${o}
|
|
77
71
|
</p>
|
|
78
72
|
</${l.BLOCK_TEXT}>
|
|
79
73
|
`;
|
|
80
|
-
}, L = (a, t,
|
|
81
|
-
let
|
|
74
|
+
}, L = (a, t, n, e, c) => {
|
|
75
|
+
let o = $;
|
|
82
76
|
if (e && e.trim()) {
|
|
83
|
-
const
|
|
84
|
-
|
|
77
|
+
const T = ` ${e.trim()} `;
|
|
78
|
+
o = (c || "0") === "1" ? `${$}${T}` : `${T}${$}`;
|
|
85
79
|
}
|
|
86
|
-
const r = c === "1" ? "after" : "before",
|
|
80
|
+
const r = c === "1" ? "after" : "before", E = `data-formated="${n ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
87
81
|
return `
|
|
88
82
|
<${l.BLOCK_TEXT}
|
|
89
83
|
class="items-block-price"
|
|
90
|
-
esd-extension-block-id="${
|
|
84
|
+
esd-extension-block-id="${d.ORIGINAL_PRICE}"
|
|
91
85
|
width="100%"
|
|
92
86
|
align="center"
|
|
93
87
|
>
|
|
@@ -98,11 +92,11 @@ const h = (a, t) => `
|
|
|
98
92
|
style="color: #cc0000"
|
|
99
93
|
data-type="${a}"
|
|
100
94
|
data-number="${t}"
|
|
101
|
-
${
|
|
95
|
+
${E}
|
|
102
96
|
${s}
|
|
103
97
|
${e ? `data-currency_symbol="${e}"` : ""}
|
|
104
98
|
>
|
|
105
|
-
<s>${
|
|
99
|
+
<s>${o}</s>
|
|
106
100
|
</p>
|
|
107
101
|
</${l.BLOCK_TEXT}>
|
|
108
102
|
`;
|
|
@@ -111,7 +105,7 @@ const h = (a, t) => `
|
|
|
111
105
|
width="100%"
|
|
112
106
|
align="center"
|
|
113
107
|
class="es-p10"
|
|
114
|
-
esd-extension-block-id="${
|
|
108
|
+
esd-extension-block-id="${d.QUANTITY}"
|
|
115
109
|
>
|
|
116
110
|
<p
|
|
117
111
|
product-attr="quantity"
|
|
@@ -121,75 +115,75 @@ const h = (a, t) => `
|
|
|
121
115
|
${u}
|
|
122
116
|
</p>
|
|
123
117
|
</${l.BLOCK_TEXT}>
|
|
124
|
-
`,
|
|
118
|
+
`, h = (a, t) => `
|
|
125
119
|
<${l.BLOCK_BUTTON}
|
|
126
120
|
width="100%"
|
|
127
121
|
class="ins-button"
|
|
128
122
|
name="buy-button"
|
|
129
123
|
caption="Buy"
|
|
130
124
|
align="center"
|
|
131
|
-
esd-extension-block-id="${
|
|
125
|
+
esd-extension-block-id="${d.BUTTON}"
|
|
132
126
|
product-attr="button"
|
|
133
127
|
data-slot-6
|
|
134
128
|
data-type="${a}"
|
|
135
129
|
data-number="${t}"
|
|
136
130
|
>Buy
|
|
137
131
|
</${l.BLOCK_BUTTON}>
|
|
138
|
-
`,
|
|
132
|
+
`, U = () => `
|
|
139
133
|
<esd-config-block style="display: none;"></esd-config-block>
|
|
140
|
-
`,
|
|
141
|
-
const
|
|
134
|
+
`, p = (a, t, n, e, c, o, r, E) => {
|
|
135
|
+
const A = `${`data-type="${t}" data-number="${n}"`} data-orientation="${e}"`;
|
|
142
136
|
return a.replace(
|
|
143
137
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
144
|
-
`<td$1 ${
|
|
145
|
-
).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}",
|
|
138
|
+
`<td$1 ${A}>`
|
|
139
|
+
).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", g(t, n)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replace(
|
|
146
140
|
"{-{-PRODUCT_PRICE-}-}",
|
|
147
|
-
S(t,
|
|
148
|
-
).
|
|
141
|
+
S(t, n, c, o, r)
|
|
142
|
+
).replace(
|
|
149
143
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
150
144
|
L(
|
|
151
145
|
t,
|
|
152
|
-
o,
|
|
153
|
-
c,
|
|
154
146
|
n,
|
|
147
|
+
c,
|
|
148
|
+
o,
|
|
155
149
|
r
|
|
156
150
|
)
|
|
157
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}",
|
|
151
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", h(t, n)).replace("{-{-CONFIG_BLOCK-}-}", U());
|
|
158
152
|
};
|
|
159
|
-
function
|
|
153
|
+
function x({
|
|
160
154
|
orientation: a,
|
|
161
155
|
itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
|
|
162
|
-
itemId:
|
|
156
|
+
itemId: n,
|
|
163
157
|
currencySymbol: e,
|
|
164
158
|
currencyLocation: c,
|
|
165
|
-
formattedPrice:
|
|
159
|
+
formattedPrice: o = !0
|
|
166
160
|
}) {
|
|
167
|
-
const r =
|
|
168
|
-
let
|
|
161
|
+
const r = P[t].findIndex((s) => s.value === n);
|
|
162
|
+
let E = "1";
|
|
169
163
|
if (r >= 0)
|
|
170
|
-
|
|
171
|
-
else if (
|
|
172
|
-
const s =
|
|
173
|
-
s && s[1] && ([,
|
|
164
|
+
E = String(r + 1);
|
|
165
|
+
else if (n) {
|
|
166
|
+
const s = n.match(/\((\d+)\)/);
|
|
167
|
+
s && s[1] && ([, E] = s);
|
|
174
168
|
}
|
|
175
|
-
return
|
|
176
|
-
|
|
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,
|
|
177
171
|
t,
|
|
178
|
-
|
|
172
|
+
E,
|
|
179
173
|
a,
|
|
180
|
-
|
|
174
|
+
o,
|
|
181
175
|
e,
|
|
182
176
|
c
|
|
183
|
-
) :
|
|
184
|
-
|
|
177
|
+
) : p(
|
|
178
|
+
f,
|
|
185
179
|
t,
|
|
186
|
-
|
|
180
|
+
E,
|
|
187
181
|
a,
|
|
188
|
-
|
|
182
|
+
o,
|
|
189
183
|
e,
|
|
190
184
|
c
|
|
191
185
|
);
|
|
192
186
|
}
|
|
193
187
|
export {
|
|
194
|
-
|
|
188
|
+
x as getDefaultTemplate
|
|
195
189
|
};
|
|
@@ -1,76 +1,67 @@
|
|
|
1
|
-
import { useItemsBlockStore as
|
|
2
|
-
import { syncAttributeFromConfigBlock as
|
|
3
|
-
function
|
|
4
|
-
const o =
|
|
1
|
+
import { useItemsBlockStore as s } from "../store/items-block.js";
|
|
2
|
+
import { syncAttributeFromConfigBlock as e, createBooleanSyncConfig as i, createStringSyncConfig as r } from "./syncAttributeFromConfigBlock.js";
|
|
3
|
+
function C(t) {
|
|
4
|
+
const o = s(), n = i(
|
|
5
5
|
"PRODUCT_NAME_TRIMMING",
|
|
6
6
|
(c) => o.setNameTrimming(c),
|
|
7
7
|
!1
|
|
8
8
|
);
|
|
9
|
-
|
|
9
|
+
e(t, n);
|
|
10
10
|
}
|
|
11
11
|
function f(t) {
|
|
12
|
-
const o =
|
|
12
|
+
const o = s(), n = i(
|
|
13
13
|
"PRODUCT_PRICE_HIDE_DISCOUNT",
|
|
14
14
|
(c) => o.setHideDiscount(c),
|
|
15
15
|
!1
|
|
16
16
|
);
|
|
17
|
-
|
|
17
|
+
e(t, n);
|
|
18
18
|
}
|
|
19
19
|
function R(t) {
|
|
20
|
-
const o =
|
|
20
|
+
const o = s(), n = i(
|
|
21
21
|
"PRODUCT_PRICE_FORMATTED",
|
|
22
22
|
(c) => o.setFormattedPrice(c),
|
|
23
23
|
!0
|
|
24
24
|
);
|
|
25
|
-
|
|
25
|
+
e(t, n);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const o =
|
|
27
|
+
function _(t) {
|
|
28
|
+
const o = s(), n = r(
|
|
29
29
|
"PRODUCT_PRICE_CURRENCY_SYMBOL",
|
|
30
30
|
(c) => o.setCurrencySymbol(c),
|
|
31
31
|
""
|
|
32
32
|
);
|
|
33
|
-
|
|
33
|
+
e(t, n);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const o =
|
|
35
|
+
function y(t) {
|
|
36
|
+
const o = s(), n = r(
|
|
37
37
|
"PRODUCT_PRICE_CURRENCY_LOCATION",
|
|
38
38
|
(c) => o.setCurrencyLocation(c),
|
|
39
39
|
"0"
|
|
40
40
|
);
|
|
41
|
-
|
|
41
|
+
e(t, n);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const o =
|
|
43
|
+
function T(t) {
|
|
44
|
+
const o = s(), n = r(
|
|
45
45
|
"PRODUCT_BUTTON_LINK",
|
|
46
46
|
(c) => o.setButtonLink(c),
|
|
47
47
|
""
|
|
48
48
|
);
|
|
49
|
-
|
|
49
|
+
e(t, n);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const o =
|
|
51
|
+
function g(t) {
|
|
52
|
+
const o = s(), n = r(
|
|
53
53
|
"PRODUCT_IMAGE_LINK",
|
|
54
54
|
(c) => o.setImageLink(c),
|
|
55
55
|
""
|
|
56
56
|
);
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
function y(t) {
|
|
60
|
-
const o = e(), n = s(
|
|
61
|
-
"PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION",
|
|
62
|
-
(c) => o.setPriceOrientation(c),
|
|
63
|
-
"horizontal"
|
|
64
|
-
);
|
|
65
|
-
r(t, n);
|
|
57
|
+
e(t, n);
|
|
66
58
|
}
|
|
67
59
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
T as syncButtonLinkFromAttributes,
|
|
61
|
+
y as syncCurrencyLocationFromAttributes,
|
|
62
|
+
_ as syncCurrencySymbolFromAttributes,
|
|
71
63
|
R as syncFormattedPriceFromAttributes,
|
|
72
64
|
f as syncHideDiscountFromAttributes,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
y as syncPriceOrientationFromAttributes
|
|
65
|
+
g as syncImageLinkFromAttributes,
|
|
66
|
+
C as syncNameTrimmingFromAttributes
|
|
76
67
|
};
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
import { ModificationDescription as
|
|
1
|
+
import { ModificationDescription as D } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { configAttributes as t } from "../enums/productEnums.js";
|
|
3
|
-
import { DefaultConfigValues as
|
|
4
|
-
import { useItemsBlockStore as
|
|
5
|
-
import { getConfigBlock as
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
3
|
+
import { DefaultConfigValues as e } from "../enums/settingsEnums.js";
|
|
4
|
+
import { useItemsBlockStore as l } from "../store/items-block.js";
|
|
5
|
+
import { getConfigBlock as p } from "./configBlockUtils.js";
|
|
6
|
+
function b(n, c) {
|
|
7
|
+
const i = p(n);
|
|
8
|
+
if (!i)
|
|
9
9
|
return;
|
|
10
|
-
const
|
|
10
|
+
const C = l(), {
|
|
11
11
|
itemsType: r,
|
|
12
|
-
itemIds:
|
|
12
|
+
itemIds: E,
|
|
13
13
|
orientation: T,
|
|
14
14
|
nameTrimming: _,
|
|
15
|
-
hideDiscount:
|
|
16
|
-
formattedPrice:
|
|
17
|
-
currencySymbol:
|
|
18
|
-
currencyLocation:
|
|
19
|
-
priceOrientation: I,
|
|
15
|
+
hideDiscount: O,
|
|
16
|
+
formattedPrice: m,
|
|
17
|
+
currencySymbol: R,
|
|
18
|
+
currencyLocation: N,
|
|
20
19
|
buttonLink: a,
|
|
21
20
|
imageLink: f
|
|
22
|
-
} =
|
|
21
|
+
} = C, u = {
|
|
23
22
|
"data-source": r,
|
|
24
23
|
[t.TYPE]: r,
|
|
25
|
-
[t.ITEMS_INDEX_SELECT_CONTROL_VALUE]:
|
|
24
|
+
[t.ITEMS_INDEX_SELECT_CONTROL_VALUE]: E,
|
|
26
25
|
[t.ORIENTATION]: T,
|
|
27
26
|
[t.PRODUCT_NAME_TRIMMING]: _ ? "1" : "0",
|
|
28
|
-
[t.PRODUCT_PRICE_HIDE_DISCOUNT]:
|
|
29
|
-
[t.PRODUCT_PRICE_FORMATTED]:
|
|
30
|
-
[t.PRODUCT_PRICE_CURRENCY_SYMBOL]:
|
|
31
|
-
[t.PRODUCT_PRICE_CURRENCY_LOCATION]:
|
|
32
|
-
[t.PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION]: I || "horizontal",
|
|
27
|
+
[t.PRODUCT_PRICE_HIDE_DISCOUNT]: O ? "1" : "0",
|
|
28
|
+
[t.PRODUCT_PRICE_FORMATTED]: m ? "1" : "0",
|
|
29
|
+
[t.PRODUCT_PRICE_CURRENCY_SYMBOL]: R || "",
|
|
30
|
+
[t.PRODUCT_PRICE_CURRENCY_LOCATION]: N || "0",
|
|
33
31
|
[t.PRODUCT_BUTTON_LINK]: a || "",
|
|
34
32
|
[t.PRODUCT_IMAGE_LINK]: f || "",
|
|
35
|
-
[t.NAME_CONTROL_ENABLED]:
|
|
36
|
-
[t.QUANTITY_CONTROL_ENABLED]:
|
|
37
|
-
[t.PRICE_CONTROL_OPENED]:
|
|
33
|
+
[t.NAME_CONTROL_ENABLED]: e.productNameControlEnabled,
|
|
34
|
+
[t.QUANTITY_CONTROL_ENABLED]: e.productQuantityControlEnabled,
|
|
35
|
+
[t.PRICE_CONTROL_OPENED]: e.productPriceControlOpened
|
|
38
36
|
};
|
|
39
|
-
let o =
|
|
40
|
-
Object.entries(u).forEach(([
|
|
41
|
-
o = o.setAttribute(
|
|
42
|
-
}), o.apply(new
|
|
37
|
+
let o = c.getDocumentModifier().modifyHtml(i);
|
|
38
|
+
Object.entries(u).forEach(([I, s]) => {
|
|
39
|
+
o = o.setAttribute(I, s);
|
|
40
|
+
}), o.apply(new D("Update config block attributes from control"));
|
|
43
41
|
}
|
|
44
42
|
export {
|
|
45
|
-
|
|
43
|
+
b as updateConfigBlockAttributes
|
|
46
44
|
};
|