@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,28 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (
|
|
4
|
-
import { UEAttr as
|
|
5
|
-
import { CommonControl as
|
|
6
|
-
import { ItemsBlockId as
|
|
7
|
-
import { productPairs as
|
|
8
|
-
import { ItemTypeOptions as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useItemsBlockStore as
|
|
12
|
-
import { getDefaultTemplate as
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var D = (h, p, e) => p in h ? M(h, p, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[p] = e;
|
|
3
|
+
var b = (h, p, e) => D(h, typeof p != "symbol" ? p + "" : p, e);
|
|
4
|
+
import { UEAttr as A, ModificationDescription as d } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as x } from "../../common-control.js";
|
|
6
|
+
import { ItemsBlockId as l } from "../enums/controlEnums.js";
|
|
7
|
+
import { productPairs as T, templateFirstLine as R } from "../enums/productEnums.js";
|
|
8
|
+
import { ItemTypeOptions as P, OrientationOptions as L, ItemInCartOptions as N, SETTINGS_ENUMS as S, DefaultConfigValues as H } from "../enums/settingsEnums.js";
|
|
9
|
+
import U from "../layouts/horizontal.html.js";
|
|
10
|
+
import F from "../layouts/vertical.html.js";
|
|
11
|
+
import { useItemsBlockStore as $ } from "../store/items-block.js";
|
|
12
|
+
import { getDefaultTemplate as q } from "../template.js";
|
|
13
|
+
import { syncCurrencySymbolFromAttributes as k, syncCurrencyLocationFromAttributes as w, syncFormattedPriceFromAttributes as B } from "../utils/syncAttributesFromConfigBlock.js";
|
|
13
14
|
import { updateConfigBlockAttributes as f } from "../utils/updateAttributes.js";
|
|
14
|
-
const
|
|
15
|
+
const G = "ui-elements-items-block", s = {
|
|
15
16
|
ITEMS_TYPE: "itemsType",
|
|
16
17
|
ORIENTATION: "orientation",
|
|
17
18
|
ITEM_IDS: "itemIds"
|
|
18
19
|
};
|
|
19
|
-
class
|
|
20
|
+
class te extends x {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
22
|
-
b(this, "store",
|
|
23
|
+
b(this, "store", $());
|
|
23
24
|
}
|
|
24
25
|
getId() {
|
|
25
|
-
return
|
|
26
|
+
return G;
|
|
26
27
|
}
|
|
27
28
|
getTemplate() {
|
|
28
29
|
return `
|
|
@@ -41,11 +42,18 @@ class W extends P {
|
|
|
41
42
|
}), this._listenToFormUpdates();
|
|
42
43
|
}
|
|
43
44
|
onTemplateNodeUpdated(e) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
|
|
46
|
+
() => {
|
|
47
|
+
k(this.currentNode), w(this.currentNode), B(this.currentNode);
|
|
48
|
+
},
|
|
49
|
+
() => {
|
|
50
|
+
this.api.updateValues({
|
|
51
|
+
[s.ORIENTATION]: this.store.orientation,
|
|
52
|
+
[s.ITEMS_TYPE]: this.store.itemsType,
|
|
53
|
+
[s.ITEM_IDS]: this.store.itemIds
|
|
54
|
+
}), this._initializeSelectItems();
|
|
55
|
+
}
|
|
56
|
+
);
|
|
49
57
|
}
|
|
50
58
|
onDestroy() {
|
|
51
59
|
const e = this._getTemplateData();
|
|
@@ -59,7 +67,7 @@ class W extends P {
|
|
|
59
67
|
name: s.ITEMS_TYPE,
|
|
60
68
|
className: "es-100",
|
|
61
69
|
placeholder: "Select Item Type",
|
|
62
|
-
options:
|
|
70
|
+
options: P
|
|
63
71
|
})
|
|
64
72
|
])}
|
|
65
73
|
`;
|
|
@@ -70,7 +78,7 @@ class W extends P {
|
|
|
70
78
|
this._GuLabel({ text: "Orientation" }),
|
|
71
79
|
this._GuRadioButton({
|
|
72
80
|
name: s.ORIENTATION,
|
|
73
|
-
buttons:
|
|
81
|
+
buttons: L
|
|
74
82
|
})
|
|
75
83
|
])}
|
|
76
84
|
`;
|
|
@@ -89,11 +97,13 @@ class W extends P {
|
|
|
89
97
|
`;
|
|
90
98
|
}
|
|
91
99
|
_onOrientationChange(e) {
|
|
92
|
-
console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [s.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(),
|
|
100
|
+
console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.store.setPriceOrientation("horizontal"), this.api.updateValues({ [s.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(), setTimeout(() => {
|
|
101
|
+
this._recalculateTrimming();
|
|
102
|
+
}, 50);
|
|
93
103
|
}
|
|
94
|
-
_onItemsTypeChange(e
|
|
95
|
-
const
|
|
96
|
-
r
|
|
104
|
+
_onItemsTypeChange(e) {
|
|
105
|
+
const i = S.ITEMS_TYPE[e], t = N[e], r = t == null ? void 0 : t[0];
|
|
106
|
+
!i || !r || (this.store.setItemsType(i), this.store.setItemIds(r.value), f(this.currentNode, this.api), this._updateDataTypeAttributes(i), this._initializeSelectItems(), this._reFillTemplate());
|
|
97
107
|
}
|
|
98
108
|
_onItemIdsChange(e) {
|
|
99
109
|
console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [s.ITEM_IDS]: e }), f(this.currentNode, this.api), this._updateDataNumberAttributes(e), this._reFillTemplate();
|
|
@@ -101,17 +111,17 @@ class W extends P {
|
|
|
101
111
|
_initializeSelectItems() {
|
|
102
112
|
this.api.setUIEAttribute(
|
|
103
113
|
s.ITEMS_TYPE,
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
A.SELECTPICKER.items,
|
|
115
|
+
P
|
|
106
116
|
);
|
|
107
117
|
const { itemsType: e, itemIds: i } = this.store;
|
|
108
118
|
this.api.updateValues({
|
|
109
119
|
[s.ITEMS_TYPE]: e
|
|
110
120
|
});
|
|
111
|
-
const t =
|
|
121
|
+
const t = N[e];
|
|
112
122
|
this.api.setUIEAttribute(
|
|
113
123
|
s.ITEM_IDS,
|
|
114
|
-
|
|
124
|
+
A.SELECTPICKER.items,
|
|
115
125
|
t
|
|
116
126
|
), this.api.updateValues({
|
|
117
127
|
[s.ITEM_IDS]: i
|
|
@@ -120,7 +130,7 @@ class W extends P {
|
|
|
120
130
|
_listenToFormUpdates() {
|
|
121
131
|
this.api.onValueChanged(
|
|
122
132
|
s.ITEMS_TYPE,
|
|
123
|
-
(e
|
|
133
|
+
(e) => this._onItemsTypeChange(e)
|
|
124
134
|
), this.api.onValueChanged(
|
|
125
135
|
s.ORIENTATION,
|
|
126
136
|
(e) => this._onOrientationChange(e)
|
|
@@ -138,7 +148,7 @@ class W extends P {
|
|
|
138
148
|
currencyLocation: n,
|
|
139
149
|
formattedPrice: o
|
|
140
150
|
} = this.store;
|
|
141
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(
|
|
151
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(q({
|
|
142
152
|
orientation: e,
|
|
143
153
|
itemsType: i,
|
|
144
154
|
itemId: t,
|
|
@@ -148,24 +158,24 @@ class W extends P {
|
|
|
148
158
|
})).apply(new d("Updated template"));
|
|
149
159
|
}
|
|
150
160
|
_getTemplateData() {
|
|
151
|
-
const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r =
|
|
161
|
+
const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = N[e].findIndex((o) => o.value === i), n = r > -1 ? r : 0;
|
|
152
162
|
return {
|
|
153
|
-
imageSrc:
|
|
154
|
-
name:
|
|
155
|
-
price: t ?
|
|
156
|
-
originalPrice: t ?
|
|
157
|
-
quantity:
|
|
158
|
-
button:
|
|
163
|
+
imageSrc: T.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
|
|
164
|
+
name: T.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
|
|
165
|
+
price: t ? T.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : T.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE,
|
|
166
|
+
originalPrice: t ? T.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : T.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE,
|
|
167
|
+
quantity: T.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT,
|
|
168
|
+
button: T.PAIRS_FOR_EXTENSION.button[e].DEFAULT_LABEL
|
|
159
169
|
};
|
|
160
170
|
}
|
|
161
171
|
_updateImageSrc(e) {
|
|
162
172
|
var t;
|
|
163
|
-
const i = (t = this.currentNode) == null ? void 0 : t.querySelector(`[esd-extension-block-id="${
|
|
173
|
+
const i = (t = this.currentNode) == null ? void 0 : t.querySelector(`[esd-extension-block-id="${l.IMAGE}"] img`);
|
|
164
174
|
i && this.api.getDocumentModifier().modifyHtml(i).setAttribute("src", e).apply(new d("Updated image src"));
|
|
165
175
|
}
|
|
166
176
|
_updateName(e) {
|
|
167
177
|
var n;
|
|
168
|
-
const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${
|
|
178
|
+
const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${l.NAME}"]`);
|
|
169
179
|
if (!i)
|
|
170
180
|
return;
|
|
171
181
|
const t = i.getInnerText().trim();
|
|
@@ -174,19 +184,19 @@ class W extends P {
|
|
|
174
184
|
}
|
|
175
185
|
_updatePrice(e) {
|
|
176
186
|
var g;
|
|
177
|
-
const i = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${
|
|
187
|
+
const i = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${l.PRICE}"]`);
|
|
178
188
|
if (!i)
|
|
179
189
|
return;
|
|
180
190
|
const t = this._getParagraphFromBlock(i);
|
|
181
191
|
if (!t)
|
|
182
192
|
return;
|
|
183
|
-
const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: o, currencyLocation: a } = this.store,
|
|
193
|
+
const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: o, currencyLocation: a } = this.store, c = (o == null ? void 0 : o.trim()) || "", m = this._removeCurrencySymbol(n, c), u = this._replacePriceNumber(m, e), I = this._buildPriceContent(u, c, a), _ = r.replace(n, I);
|
|
184
194
|
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(_).apply(new d("Updated price"));
|
|
185
195
|
}
|
|
186
196
|
_updateOriginalPrice(e) {
|
|
187
|
-
var
|
|
188
|
-
const i = (
|
|
189
|
-
`[esd-extension-block-id="${
|
|
197
|
+
var y;
|
|
198
|
+
const i = (y = this.currentNode) == null ? void 0 : y.querySelector(
|
|
199
|
+
`[esd-extension-block-id="${l.ORIGINAL_PRICE}"]`
|
|
190
200
|
);
|
|
191
201
|
if (!i)
|
|
192
202
|
return;
|
|
@@ -196,37 +206,34 @@ class W extends P {
|
|
|
196
206
|
const r = t.querySelector("s");
|
|
197
207
|
if (!r)
|
|
198
208
|
return;
|
|
199
|
-
const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: a, currencyLocation:
|
|
200
|
-
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(
|
|
209
|
+
const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: a, currencyLocation: c } = this.store, m = (a == null ? void 0 : a.trim()) || "", u = this._removeCurrencySymbol(o, m), I = this._replacePriceNumber(u, e), _ = this._buildPriceContent(I, m, c), E = `<s>${n.replace(o, _)}</s>`;
|
|
210
|
+
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(E).apply(new d("Updated original price"));
|
|
201
211
|
}
|
|
202
212
|
_updateQuantity(e) {
|
|
203
213
|
var a;
|
|
204
|
-
const i = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, t = (a = this.currentNode) == null ? void 0 : a.querySelector(`[esd-extension-block-id="${
|
|
214
|
+
const i = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, t = (a = this.currentNode) == null ? void 0 : a.querySelector(`[esd-extension-block-id="${l.QUANTITY}"]`);
|
|
205
215
|
if (!t)
|
|
206
216
|
return;
|
|
207
217
|
const r = t.getStyle("display") === "none", n = t.getInnerText().trim();
|
|
208
218
|
let o = t.getInnerHTML();
|
|
209
219
|
o = o.replace(n, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(o).setStyle("display", i && !r ? "table-cell" : "none").apply(new d("Updated quantity"));
|
|
210
220
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
return;
|
|
216
|
-
const t = i.getInnerText().trim();
|
|
217
|
-
let r = i.getInnerHTML();
|
|
218
|
-
r = r.replace(t, e), this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(r).apply(new d("Updated button"));
|
|
219
|
-
}
|
|
221
|
+
/**
|
|
222
|
+
* @todo Optimize template reordering for performance.
|
|
223
|
+
* @description Reorders the template structure based on current orientation and visibility settings.
|
|
224
|
+
*/
|
|
220
225
|
_reOrderTemplate() {
|
|
221
|
-
var I,
|
|
222
|
-
const e = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${
|
|
223
|
-
`[esd-extension-block-id="${
|
|
224
|
-
), n = (
|
|
226
|
+
var I, _, g, E, y, O, C;
|
|
227
|
+
const e = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${l.IMAGE}"]`), i = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${l.NAME}"]`), t = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${l.PRICE}"]`), r = (E = this.currentNode) == null ? void 0 : E.querySelector(
|
|
228
|
+
`[esd-extension-block-id="${l.ORIGINAL_PRICE}"]`
|
|
229
|
+
), n = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${l.QUANTITY}"]`), o = (O = this.currentNode) == null ? void 0 : O.querySelector(`[esd-extension-block-id="${l.BUTTON}"]`), a = (C = this.currentNode) == null ? void 0 : C.querySelector("esd-config-block");
|
|
225
230
|
if (!e || !i || !t || !r || !n || !o || !a)
|
|
226
231
|
return;
|
|
227
|
-
const { orientation:
|
|
228
|
-
let
|
|
229
|
-
|
|
232
|
+
const { orientation: c } = this.store, m = c === S.ORIENTATION.VERTICAL;
|
|
233
|
+
let u = m ? F : U;
|
|
234
|
+
this.api.getDocumentModifier().modifyHtml(e.querySelector("img")).setAttribute("width", H.productImageWidth).apply(new d("Updated image width")), setTimeout(() => {
|
|
235
|
+
u = u.replace("{-{-TEMPLATE_FIRST_LINE-}-}", m ? R : "").replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replaceAll("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replaceAll("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", o.getOuterHTML()).replace("{-{-CONFIG_BLOCK-}-}", a.getOuterHTML()), u = u.trim().replace(R, "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(u).apply(new d("Reordered template"));
|
|
236
|
+
}, 50);
|
|
230
237
|
}
|
|
231
238
|
_updateDataTypeAttributes(e) {
|
|
232
239
|
if (!this.currentNode)
|
|
@@ -240,39 +247,39 @@ class W extends P {
|
|
|
240
247
|
_updateDataNumberAttributes(e) {
|
|
241
248
|
if (!this.currentNode)
|
|
242
249
|
return;
|
|
243
|
-
const { itemsType: i } = this.store, t =
|
|
250
|
+
const { itemsType: i } = this.store, t = N[i].findIndex((c) => c.value === e);
|
|
244
251
|
let r = "1";
|
|
245
252
|
if (t >= 0)
|
|
246
253
|
r = String(t + 1);
|
|
247
254
|
else if (e) {
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
const [,
|
|
251
|
-
r =
|
|
255
|
+
const c = e.match(/\((\d+)\)/);
|
|
256
|
+
if (c) {
|
|
257
|
+
const [, m] = c;
|
|
258
|
+
r = m;
|
|
252
259
|
}
|
|
253
260
|
}
|
|
254
261
|
const n = this.currentNode.closest(".ins-product-td"), o = this.api.getDocumentModifier();
|
|
255
|
-
n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((
|
|
256
|
-
const
|
|
257
|
-
o.modifyHtml(
|
|
262
|
+
n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((c) => {
|
|
263
|
+
const m = c;
|
|
264
|
+
o.modifyHtml(m).setAttribute("data-number", r);
|
|
258
265
|
}), o.apply(new d("Updated data-number attribute"));
|
|
259
266
|
}
|
|
260
267
|
_reFillTemplate() {
|
|
261
268
|
const e = this._getTemplateData();
|
|
262
|
-
this._updateImageSrc(e.imageSrc), this._updateName(e.name), this._updatePrice(e.price), this._updateOriginalPrice(e.originalPrice), this._updateQuantity(e.quantity)
|
|
269
|
+
this._updateImageSrc(e.imageSrc), this._updateName(e.name), this._updatePrice(e.price), this._updateOriginalPrice(e.originalPrice), this._updateQuantity(e.quantity);
|
|
263
270
|
}
|
|
264
271
|
_recalculateTrimming() {
|
|
265
|
-
var
|
|
266
|
-
if (!this.
|
|
272
|
+
var n;
|
|
273
|
+
if (!this.currentNode)
|
|
267
274
|
return;
|
|
268
|
-
const e = (
|
|
275
|
+
const e = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${l.NAME}"]`);
|
|
269
276
|
if (!e)
|
|
270
277
|
return;
|
|
271
|
-
const i = e.querySelector("p");
|
|
278
|
+
const i = e.querySelector("p > a");
|
|
272
279
|
if (!i)
|
|
273
280
|
return;
|
|
274
|
-
const t = this.store.orientation === S.ORIENTATION.VERTICAL;
|
|
275
|
-
this.api.getDocumentModifier().modifyHtml(i).setStyle("
|
|
281
|
+
const t = this.store.orientation === S.ORIENTATION.VERTICAL, r = this.store.nameTrimming;
|
|
282
|
+
this.api.getDocumentModifier().modifyHtml(i).setStyle("overflow", "hidden").setStyle("white-space", r ? "nowrap" : "normal").setStyle("text-overflow", r ? "ellipsis" : "unset").setStyle("max-width", t ? "130px" : "520px").setStyle("width", t ? "130px" : "520px").apply(new d("Recalculated trimming after orientation change"));
|
|
276
283
|
}
|
|
277
284
|
_getParagraphFromBlock(e) {
|
|
278
285
|
return e.querySelector("p");
|
|
@@ -304,6 +311,6 @@ class W extends P {
|
|
|
304
311
|
}
|
|
305
312
|
}
|
|
306
313
|
export {
|
|
307
|
-
|
|
308
|
-
|
|
314
|
+
G as CONTROL_BLOCK_ID,
|
|
315
|
+
te as ItemsBlockControl
|
|
309
316
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var c = /* @__PURE__ */ ((i) => (i.BUTTON = "items-block-button", i.IMAGE = "items-block-image", i.ORIGINAL_PRICE = "items-block-original-price", i.PRICE = "items-block-price", i.QUANTITY = "items-block-quantity", i.NAME = "items-block-name", i))(c || {}),
|
|
1
|
+
var c = /* @__PURE__ */ ((i) => (i.BUTTON = "items-block-button", i.IMAGE = "items-block-image", i.ORIGINAL_PRICE = "items-block-original-price", i.PRICE = "items-block-price", i.QUANTITY = "items-block-quantity", i.NAME = "items-block-name", i))(c || {}), t = /* @__PURE__ */ ((i) => (i.BUTTON_ALIGN = "items-block-button-align-control", i.BUTTON_BORDER = "items-block-button-border-control", i.BUTTON_BORDER_RADIUS = "items-block-button-border-radius-control", i.BUTTON_COLOR = "items-block-button-color-control", i.BUTTON_FIT_TO_CONTENT = "items-block-button-fit-to-content-control", i.BUTTON_FONT_FAMILY = "items-block-button-font-family-control", i.BUTTON_MARGINS = "items-block-button-margins-control", i.BUTTON_PADDINGS = "items-block-button-paddings-control", i.BUTTON_TEXT = "items-block-button-text-control", i.BUTTON_TEXT_SIZE = "items-block-button-text-size-control", i.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "items-block-button-text-style-and-font-color-control", i.BUTTON_LINK = "items-block-button-link-control", i.IMAGE_SIZE = "items-block-image-size-control", i.IMAGE_MARGINS = "items-block-image-margins-control", i.IMAGE_LINK = "items-block-image-link-control", i.ORIGINAL_PRICE_ALIGN = "items-block-original-price-align-control", i.ORIGINAL_PRICE_COLOR = "items-block-original-price-color-control", i.ORIGINAL_PRICE_SIZE = "items-block-original-price-size-control", i.ORIGINAL_PRICE_STYLE = "items-block-original-price-style-control", i.ORIGINAL_PRICE_FONT_FAMILY = "items-block-original-price-font-family-control", i.ORIGINAL_PRICE_BACKGROUND = "items-block-original-price-background-control", i.ORIGINAL_PRICE_PADDINGS = "items-block-original-price-paddings-control", i.PRICE_ALIGN = "items-block-price-align-control", i.PRICE_COLOR = "items-block-price-color-control", i.PRICE_SIZE = "items-block-price-size-control", i.PRICE_STYLE = "items-block-price-style-control", i.PRICE_FONT_FAMILY = "items-block-price-font-family-control", i.PRICE_BACKGROUND = "items-block-price-background-control", i.PRICE_PADDINGS = "items-block-price-paddings-control", i.PRICE_HIDE_DISCOUNT = "items-block-price-hide-discount-control", i.PRICE_FORMATTED_PRICE = "items-block-price-formatted-price-control", i.PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control", i.PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control", i.PRICE_ORIENTATION = "items-block-price-orientation-control", i.NAME_ALIGN = "items-block-name-align-control", i.NAME_COLOR = "items-block-name-color-control", i.NAME_SIZE = "items-block-name-size-control", i.NAME_STYLE = "items-block-name-style-control", i.NAME_FONT_FAMILY = "items-block-name-font-family-control", i.NAME_BACKGROUND = "items-block-name-background-control", i.NAME_TRIMMING = "items-block-name-trimming-control", i.NAME_PADDINGS = "items-block-name-paddings-control", i.QUANTITY_ALIGN = "items-block-quantity-align-control", i.QUANTITY_COLOR = "items-block-quantity-color-control", i.QUANTITY_FONT_FAMILY = "items-block-quantity-font-family-control", i.QUANTITY_PADDINGS = "items-block-quantity-paddings-control", i.QUANTITY_SIZE = "items-block-quantity-size-control", i.QUANTITY_STYLE = "items-block-quantity-style-control", i))(t || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
t as ItemsBlockControlId,
|
|
4
4
|
c as ItemsBlockId
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from "../../../../node_modules/lodash-es/flatMap.js";
|
|
2
2
|
import i from "../../../../node_modules/lodash-es/range.js";
|
|
3
|
-
const R = {
|
|
3
|
+
const o = '<td align="center" class="ins-product-td items-block items-block-v2">', R = {
|
|
4
4
|
TYPE: "data-type",
|
|
5
5
|
ITEMS_INDEX_SELECT_CONTROL_VALUE: "data-cart_items_select_control_value",
|
|
6
6
|
ORIENTATION: "data-card_orientation_control_value",
|
|
@@ -9,6 +9,7 @@ const R = {
|
|
|
9
9
|
PRODUCT_PRICE_FORMATTED: "data-product_price_formatted",
|
|
10
10
|
PRODUCT_PRICE_CURRENCY_SYMBOL: "data-product_price_currency_symbol",
|
|
11
11
|
PRODUCT_PRICE_CURRENCY_LOCATION: "data-product_price_currency_location",
|
|
12
|
+
PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION: "data-product_original_price_control_orientation",
|
|
12
13
|
PRODUCT_BUTTON_LINK: "data-product_button_link",
|
|
13
14
|
PRODUCT_IMAGE_LINK: "data-product_image_link",
|
|
14
15
|
PRODUCT_NAME_CONTROL_VALUE: "data-product_name_control_value",
|
|
@@ -214,7 +215,7 @@ const R = {
|
|
|
214
215
|
function m(e, a = 8) {
|
|
215
216
|
return i(1, a + 1).map((s) => `${e}_${s}`);
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function r() {
|
|
218
219
|
const { PAIRS_FOR_EXTENSION: e } = t, a = [];
|
|
219
220
|
return a.push(
|
|
220
221
|
e.imageSrc.CART_ITEMS.ATTR,
|
|
@@ -261,12 +262,13 @@ function E() {
|
|
|
261
262
|
e.itemLink.PURCHASED_ITEMS.HREF
|
|
262
263
|
), a;
|
|
263
264
|
}
|
|
264
|
-
const
|
|
265
|
-
|
|
265
|
+
const p = _(
|
|
266
|
+
r(),
|
|
266
267
|
(e) => m(e)
|
|
267
268
|
);
|
|
268
269
|
export {
|
|
269
270
|
R as configAttributes,
|
|
270
|
-
|
|
271
|
-
t as productPairs
|
|
271
|
+
p as itemsBlockDynamicVariables,
|
|
272
|
+
t as productPairs,
|
|
273
|
+
o as templateFirstLine
|
|
272
274
|
};
|
|
@@ -19,7 +19,7 @@ const e = {
|
|
|
19
19
|
itemsType: e.ITEMS_TYPE.CART_ITEMS,
|
|
20
20
|
cartItemsSelectControlValue: "{{Abandoned Cart Item (1) Url}}",
|
|
21
21
|
cardOrientationControlValue: e.ORIENTATION.HORIZONTAL,
|
|
22
|
-
productNameTrimmingControlValue: "
|
|
22
|
+
productNameTrimmingControlValue: "1",
|
|
23
23
|
productPriceHideDiscountControlValue: "0",
|
|
24
24
|
productPriceFormattedControlValue: "1",
|
|
25
25
|
productPriceCurrencySymbolControlValue: "USD",
|
|
@@ -34,7 +34,8 @@ const e = {
|
|
|
34
34
|
productQuantityVisible: "1",
|
|
35
35
|
productPriceVisible: "1",
|
|
36
36
|
productOriginalPriceVisible: "1",
|
|
37
|
-
productButtonVisible: "1"
|
|
37
|
+
productButtonVisible: "1",
|
|
38
|
+
productImageWidth: "70"
|
|
38
39
|
}, o = {
|
|
39
40
|
[e.ITEMS_TYPE.CART_ITEMS]: [
|
|
40
41
|
{ text: "Abandoned Cart Item (1)", value: "{{Abandoned Cart Item (1) Url}}" },
|
|
@@ -3,17 +3,18 @@ import { ItemsBlock as i } from "./block.js";
|
|
|
3
3
|
import { ButtonLinkControl as C } from "./controls/button/link.js";
|
|
4
4
|
import { ItemsBlockCardCompositionControl as e } from "./controls/cardComposition.js";
|
|
5
5
|
import { ImageLinkControl as m } from "./controls/image/link.js";
|
|
6
|
-
import { NameControls as
|
|
6
|
+
import { NameControls as r, QuantityControls as n, OriginalPriceControls as t, PriceControls as d, ImageControls as l, ButtonControls as o } from "./controls/index.js";
|
|
7
7
|
import { NameTrimmingControl as s } from "./controls/name/trimming.js";
|
|
8
8
|
import { PriceCurrencyLocationControl as c } from "./controls/price/currencyLocation.js";
|
|
9
9
|
import { PriceCurrencySymbolControl as g } from "./controls/price/currencySymbol.js";
|
|
10
10
|
import { PriceFormattedPriceControl as f } from "./controls/price/formattedPrice.js";
|
|
11
11
|
import { PriceHideDiscountControl as p } from "./controls/price/hideDiscount.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { PriceOrientationControl as y } from "./controls/price/priceOrientation.js";
|
|
13
|
+
import { ItemsBlockControl as u } from "./controls/settingsControl.js";
|
|
14
|
+
import { ItemsIconsRegistry as P } from "./iconsRegistry.js";
|
|
14
15
|
import k from "./items.css.js";
|
|
15
|
-
import { SettingsPanel as
|
|
16
|
-
const
|
|
16
|
+
import { SettingsPanel as I } from "./settingsPanel.js";
|
|
17
|
+
const H = new a().addBlock(i).withSettingsPanelRegistry(I).addControl(u).addControl(e).addControl(r.align).addControl(r.color).addControl(r.size).addControl(r.style).addControl(r.fontFamily).addControl(r.background).addControl(r.paddings).addControl(s).addControl(n.align).addControl(n.color).addControl(n.fontFamily).addControl(n.paddings).addControl(n.size).addControl(n.style).addControl(t.align).addControl(t.color).addControl(t.size).addControl(t.style).addControl(t.fontFamily).addControl(t.background).addControl(t.paddings).addControl(d.align).addControl(d.color).addControl(d.size).addControl(d.style).addControl(d.fontFamily).addControl(d.background).addControl(d.paddings).addControl(p).addControl(f).addControl(g).addControl(c).addControl(y).addControl(m).addControl(l.size).addControl(l.margins).addControl(C).addControl(o.align).addControl(o.border).addControl(o.borderRadius).addControl(o.color).addControl(o.fontFamily).addControl(o.margins).addControl(o.paddings).addControl(o.text).addControl(o.textSize).addControl(o.textStyleAndFontColor).addControl(o.fitToContent).addStyles(k).withIconsRegistry(P).build();
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
H as default
|
|
19
20
|
};
|
|
@@ -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%" class="product-quantity-class" data-slot-3>
|
|
37
|
+
<table width="100%">
|
|
38
|
+
<tbody>
|
|
39
|
+
{-{-PRODUCT_QUANTITY-}-}
|
|
40
|
+
</tbody>
|
|
41
|
+
</table>
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td width="100%" class="product-button-class" data-slot-6>
|
|
46
|
+
<table width="100%">
|
|
47
|
+
<tbody>
|
|
48
|
+
{-{-PRODUCT_BUTTON-}-}
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</table>
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
</tbody>
|
|
57
|
+
</table>
|
|
58
58
|
</td>
|
|
59
59
|
`;
|
|
60
60
|
export {
|