@useinsider/guido 1.0.3-beta.2cf8046 → 1.0.3-beta.2df2106
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/useActionsApi.js +1 -1
- package/dist/composables/useHtmlCompiler.js +15 -13
- package/dist/composables/useHtmlValidator.js +36 -35
- package/dist/composables/useStripo.js +29 -25
- package/dist/config/compiler/itemsCompilerRules.js +14 -0
- package/dist/enums/unsubscribe.js +27 -26
- 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 +26 -26
- 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 +150 -114
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +77 -4
- 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 -56
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +67 -56
- package/dist/extensions/Blocks/Items/settingsPanel.js +69 -43
- package/dist/extensions/Blocks/Items/store/items-block.js +8 -4
- package/dist/extensions/Blocks/Items/template.js +147 -62
- 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/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/config/compiler/itemsCompilerRules.d.ts +2 -0
- 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 +8 -2
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -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/dist/src/utils/environmentUtil.d.ts +5 -0
- package/dist/src/utils/pairProductVariables.d.ts +7 -0
- package/dist/utils/environmentUtil.js +4 -0
- package/dist/utils/pairProductVariables.js +136 -0
- package/package.json +5 -10
|
@@ -1,110 +1,195 @@
|
|
|
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
|
-
esd-extension-block-id="${
|
|
15
|
-
data-
|
|
16
|
-
|
|
1
|
+
import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { ItemsBlockId as T } from "./enums/controlEnums.js";
|
|
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) => `
|
|
9
|
+
<${l.BLOCK_IMAGE}
|
|
10
|
+
${_.BLOCK_IMAGE.src}="${C}"
|
|
11
|
+
${_.BLOCK_IMAGE.alt}="${A}"
|
|
12
|
+
${_.BLOCK_IMAGE.href}="#!"
|
|
13
|
+
${_.BLOCK_IMAGE.width}=${P.productImageWidth}
|
|
14
|
+
esd-extension-block-id="${T.IMAGE}"
|
|
15
|
+
data-slot-1
|
|
16
|
+
product-attr="imageSrc"
|
|
17
|
+
data-type="${a}"
|
|
18
|
+
data-number="${t}"
|
|
17
19
|
/>
|
|
18
|
-
`,
|
|
19
|
-
<${
|
|
20
|
+
`, F = (a) => `
|
|
21
|
+
<${l.BLOCK_TEXT}
|
|
20
22
|
width="100%"
|
|
21
23
|
align="center"
|
|
22
24
|
class="es-p10"
|
|
23
|
-
|
|
25
|
+
data-type="${a}"
|
|
26
|
+
esd-extension-block-id="${T.NAME}"
|
|
24
27
|
>
|
|
25
|
-
<p
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
+
display: block;
|
|
39
|
+
word-wrap:break-word;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
width: 520px;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
"
|
|
45
|
+
product-attr="name"
|
|
46
|
+
data-slot-2
|
|
47
|
+
width="100%">
|
|
48
|
+
${A}
|
|
49
|
+
</a>
|
|
29
50
|
</p>
|
|
30
|
-
</${
|
|
31
|
-
`, S = (
|
|
32
|
-
let
|
|
33
|
-
if (
|
|
34
|
-
const E = ` ${
|
|
35
|
-
|
|
51
|
+
</${l.BLOCK_TEXT}>
|
|
52
|
+
`, S = (a, t, o, e, c) => {
|
|
53
|
+
let n = p;
|
|
54
|
+
if (e && e.trim()) {
|
|
55
|
+
const E = ` ${e.trim()} `;
|
|
56
|
+
n = (c || "0") === "1" ? `${p}${E}` : `${E}${p}`;
|
|
36
57
|
}
|
|
58
|
+
const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
37
59
|
return `
|
|
38
|
-
<${
|
|
39
|
-
esd-extension-block-id="${
|
|
60
|
+
<${l.BLOCK_TEXT}
|
|
61
|
+
esd-extension-block-id="${T.PRICE}"
|
|
40
62
|
class="items-block-price"
|
|
41
63
|
width="100%"
|
|
42
64
|
align="center"
|
|
43
65
|
>
|
|
44
|
-
<p
|
|
45
|
-
|
|
66
|
+
<p
|
|
67
|
+
product-attr="price"
|
|
68
|
+
contenteditable="false"
|
|
69
|
+
data-slot-4
|
|
70
|
+
data-type="${a}"
|
|
71
|
+
data-number="${t}"
|
|
72
|
+
${d}
|
|
73
|
+
${s}
|
|
74
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
75
|
+
>
|
|
76
|
+
${n}
|
|
46
77
|
</p>
|
|
47
|
-
</${
|
|
78
|
+
</${l.BLOCK_TEXT}>
|
|
48
79
|
`;
|
|
49
|
-
},
|
|
50
|
-
let
|
|
51
|
-
if (
|
|
52
|
-
const E = ` ${
|
|
53
|
-
|
|
80
|
+
}, L = (a, t, o, e, c) => {
|
|
81
|
+
let n = I;
|
|
82
|
+
if (e && e.trim()) {
|
|
83
|
+
const E = ` ${e.trim()} `;
|
|
84
|
+
n = (c || "0") === "1" ? `${I}${E}` : `${E}${I}`;
|
|
54
85
|
}
|
|
86
|
+
const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
|
|
55
87
|
return `
|
|
56
|
-
<${
|
|
88
|
+
<${l.BLOCK_TEXT}
|
|
57
89
|
class="items-block-price"
|
|
58
|
-
esd-extension-block-id="${
|
|
90
|
+
esd-extension-block-id="${T.ORIGINAL_PRICE}"
|
|
59
91
|
width="100%"
|
|
60
92
|
align="center"
|
|
61
93
|
>
|
|
62
94
|
<p
|
|
95
|
+
product-attr="originalPrice"
|
|
63
96
|
contenteditable="false"
|
|
97
|
+
data-slot-5
|
|
64
98
|
style="color: #cc0000"
|
|
99
|
+
data-type="${a}"
|
|
100
|
+
data-number="${t}"
|
|
101
|
+
${d}
|
|
102
|
+
${s}
|
|
103
|
+
${e ? `data-currency_symbol="${e}"` : ""}
|
|
65
104
|
>
|
|
66
|
-
<s>${
|
|
105
|
+
<s>${n}</s>
|
|
67
106
|
</p>
|
|
68
|
-
</${
|
|
107
|
+
</${l.BLOCK_TEXT}>
|
|
69
108
|
`;
|
|
70
|
-
},
|
|
71
|
-
<${
|
|
109
|
+
}, b = () => `
|
|
110
|
+
<${l.BLOCK_TEXT}
|
|
72
111
|
width="100%"
|
|
73
112
|
align="center"
|
|
74
113
|
class="es-p10"
|
|
75
|
-
esd-extension-block-id="${
|
|
114
|
+
esd-extension-block-id="${T.QUANTITY}"
|
|
76
115
|
>
|
|
77
116
|
<p
|
|
117
|
+
product-attr="quantity"
|
|
78
118
|
data-slot-3
|
|
79
119
|
contenteditable="false"
|
|
80
120
|
width="100%">
|
|
81
|
-
${
|
|
121
|
+
${u}
|
|
82
122
|
</p>
|
|
83
|
-
</${
|
|
84
|
-
`,
|
|
85
|
-
<${
|
|
123
|
+
</${l.BLOCK_TEXT}>
|
|
124
|
+
`, U = (a, t) => `
|
|
125
|
+
<${l.BLOCK_BUTTON}
|
|
86
126
|
width="100%"
|
|
87
127
|
class="ins-button"
|
|
88
128
|
name="buy-button"
|
|
89
129
|
caption="Buy"
|
|
90
130
|
align="center"
|
|
91
|
-
esd-extension-block-id="${
|
|
131
|
+
esd-extension-block-id="${T.BUTTON}"
|
|
132
|
+
product-attr="button"
|
|
133
|
+
data-slot-6
|
|
134
|
+
data-type="${a}"
|
|
135
|
+
data-number="${t}"
|
|
92
136
|
>Buy
|
|
93
|
-
</${
|
|
94
|
-
`,
|
|
137
|
+
</${l.BLOCK_BUTTON}>
|
|
138
|
+
`, D = () => `
|
|
95
139
|
<esd-config-block style="display: none;"></esd-config-block>
|
|
96
|
-
`,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
140
|
+
`, R = (a, t, o, e, c, n, r, d) => {
|
|
141
|
+
const $ = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
|
|
142
|
+
return a.replace(
|
|
143
|
+
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
144
|
+
`<td$1 ${$}>`
|
|
145
|
+
).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", h(t, o)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replaceAll(
|
|
146
|
+
"{-{-PRODUCT_PRICE-}-}",
|
|
147
|
+
S(t, o, c, n, r)
|
|
148
|
+
).replaceAll(
|
|
149
|
+
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
150
|
+
L(
|
|
151
|
+
t,
|
|
152
|
+
o,
|
|
153
|
+
c,
|
|
154
|
+
n,
|
|
155
|
+
r
|
|
156
|
+
)
|
|
157
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", U(t, o)).replace("{-{-CONFIG_BLOCK-}-}", D());
|
|
158
|
+
};
|
|
159
|
+
function G({
|
|
160
|
+
orientation: a,
|
|
161
|
+
itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
|
|
100
162
|
itemId: o,
|
|
101
|
-
currencySymbol:
|
|
163
|
+
currencySymbol: e,
|
|
102
164
|
currencyLocation: c,
|
|
103
|
-
formattedPrice:
|
|
165
|
+
formattedPrice: n = !0
|
|
104
166
|
}) {
|
|
105
|
-
const
|
|
106
|
-
|
|
167
|
+
const r = f[t].findIndex((s) => s.value === o);
|
|
168
|
+
let d = "1";
|
|
169
|
+
if (r >= 0)
|
|
170
|
+
d = String(r + 1);
|
|
171
|
+
else if (o) {
|
|
172
|
+
const s = o.match(/\((\d+)\)/);
|
|
173
|
+
s && s[1] && ([, d] = s);
|
|
174
|
+
}
|
|
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,
|
|
177
|
+
t,
|
|
178
|
+
d,
|
|
179
|
+
a,
|
|
180
|
+
n,
|
|
181
|
+
e,
|
|
182
|
+
c
|
|
183
|
+
) : R(
|
|
184
|
+
B,
|
|
185
|
+
t,
|
|
186
|
+
d,
|
|
187
|
+
a,
|
|
188
|
+
n,
|
|
189
|
+
e,
|
|
190
|
+
c
|
|
191
|
+
);
|
|
107
192
|
}
|
|
108
193
|
export {
|
|
109
|
-
|
|
194
|
+
G as getDefaultTemplate
|
|
110
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
|
};
|
|
@@ -2,10 +2,10 @@ var d = Object.defineProperty;
|
|
|
2
2
|
var l = (r, n, t) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
3
|
var o = (r, n, t) => l(r, typeof n != "symbol" ? n + "" : n, t);
|
|
4
4
|
import { useHttp as L } from "../../../composables/useHttp.js";
|
|
5
|
-
import { DEFAULT_UNSUBSCRIBE_GROUP as
|
|
5
|
+
import { DEFAULT_UNSUBSCRIBE_GROUP as c } from "../../../enums/unsubscribe.js";
|
|
6
6
|
import { Control as p, UIElementType as i, UEAttr as e, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
-
const m = "ui-elements-radio-button",
|
|
8
|
-
class
|
|
7
|
+
const m = "ui-elements-radio-button", u = "select", { get: $ } = L();
|
|
8
|
+
class S extends p {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
11
|
o(this, "currentNode");
|
|
@@ -16,15 +16,16 @@ class _ extends p {
|
|
|
16
16
|
return m;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
|
-
if (this.currentNode && "getAttribute" in this.currentNode) {
|
|
19
|
+
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const t = this.currentNode.getAttribute("id");
|
|
21
21
|
if (t) {
|
|
22
|
-
const s = t ===
|
|
23
|
-
s && (this.selectedUnsubGroup = s
|
|
24
|
-
[a]: this.selectedUnsubGroup
|
|
25
|
-
}));
|
|
22
|
+
const s = t === c.sendGridId ? t : Number(t);
|
|
23
|
+
s && (this.selectedUnsubGroup = s);
|
|
26
24
|
}
|
|
27
25
|
}
|
|
26
|
+
this.api.updateValues({
|
|
27
|
+
[u]: this.selectedUnsubGroup
|
|
28
|
+
});
|
|
28
29
|
}
|
|
29
30
|
_getLabel(t, s = `${Math.random()}`) {
|
|
30
31
|
return `
|
|
@@ -54,7 +55,7 @@ class _ extends p {
|
|
|
54
55
|
</${i.LABEL}>
|
|
55
56
|
|
|
56
57
|
<${i.SELECTPICKER}
|
|
57
|
-
${e.SELECTPICKER.name}="${
|
|
58
|
+
${e.SELECTPICKER.name}="${u}"
|
|
58
59
|
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
59
60
|
${this._getSelect()}
|
|
60
61
|
</${i.SELECTPICKER}>
|
|
@@ -66,27 +67,27 @@ class _ extends p {
|
|
|
66
67
|
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
|
|
67
68
|
}
|
|
68
69
|
_listenToFormUpdates() {
|
|
69
|
-
this.api.onValueChanged(
|
|
70
|
+
this.api.onValueChanged(u, (t) => this._onSelectChange(t));
|
|
70
71
|
}
|
|
71
72
|
onTemplateNodeUpdated(t) {
|
|
72
|
-
this.currentNode = t;
|
|
73
|
+
this.currentNode = t, this._setFormValues();
|
|
73
74
|
}
|
|
74
75
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
75
76
|
async onRender() {
|
|
76
77
|
const t = await $(
|
|
77
78
|
"/unsubscribe-groups/unsubscribe-list"
|
|
78
|
-
), s = [
|
|
79
|
-
[e.SELECT_ITEM.text]:
|
|
80
|
-
[e.SELECT_ITEM.value]:
|
|
79
|
+
), s = [c, ...t.data], E = s.map((a) => ({
|
|
80
|
+
[e.SELECT_ITEM.text]: a.name,
|
|
81
|
+
[e.SELECT_ITEM.value]: a.sendGridId
|
|
81
82
|
}));
|
|
82
83
|
this.unsubList = s, this.api.setUIEAttribute(
|
|
83
|
-
|
|
84
|
+
u,
|
|
84
85
|
e.SELECTPICKER.items,
|
|
85
|
-
|
|
86
|
+
E
|
|
86
87
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
export {
|
|
90
91
|
m as CONTROL_BLOCK_ID,
|
|
91
|
-
|
|
92
|
+
S as RadioButtonControl
|
|
92
93
|
};
|
|
@@ -5,7 +5,7 @@ const e = {
|
|
|
5
5
|
YES: "Yes",
|
|
6
6
|
NO: "No"
|
|
7
7
|
}, d = `
|
|
8
|
-
<td align="left" class="radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
|
|
8
|
+
<td align="left" class="radio-button radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
|
|
9
9
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
10
10
|
<tbody>
|
|
11
11
|
<tr>
|
|
@@ -75,12 +75,21 @@ const e = {
|
|
|
75
75
|
</tbody>
|
|
76
76
|
</table>
|
|
77
77
|
</td>
|
|
78
|
-
`,
|
|
79
|
-
<td
|
|
80
|
-
align="left"
|
|
81
|
-
esd-extension-block-id="radio-button-block"
|
|
78
|
+
`, a = `
|
|
79
|
+
<td
|
|
80
|
+
align="left"
|
|
81
|
+
esd-extension-block-id="radio-button-block"
|
|
82
82
|
esd-handler-name="esd-extension-RadioButtonBlock"
|
|
83
|
-
class="
|
|
83
|
+
class="
|
|
84
|
+
radio-button
|
|
85
|
+
radio-button-v2
|
|
86
|
+
esd-block-ra
|
|
87
|
+
esd-radio-button-block
|
|
88
|
+
esd-extension-block
|
|
89
|
+
es-p10t
|
|
90
|
+
es-p10b
|
|
91
|
+
es-p30r
|
|
92
|
+
es-p30l"
|
|
84
93
|
>
|
|
85
94
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
86
95
|
<tbody>
|
|
@@ -140,10 +149,10 @@ const e = {
|
|
|
140
149
|
</table>
|
|
141
150
|
</td>
|
|
142
151
|
`;
|
|
143
|
-
function
|
|
152
|
+
function l() {
|
|
144
153
|
return d.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`).replace("{-{-YES-}-}", `<p path="1">${e.YES}</p>`).replace("{-{-NO-}-}", `<p path="1">${e.NO}</p>`);
|
|
145
154
|
}
|
|
146
155
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
156
|
+
a as default,
|
|
157
|
+
l as getDefaultTemplate
|
|
149
158
|
};
|