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