@useinsider/guido 2.0.0-beta.c2c0829 → 2.0.0-beta.d170da6
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/extensions/Blocks/CouponBlock/constants.js +4 -0
- package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
- package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +153 -69
- package/dist/extensions/Blocks/Recommendation/constants.js +9 -1
- package/dist/extensions/Blocks/Recommendation/control.js +74 -59
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +68 -0
- package/dist/extensions/Blocks/Recommendation/controls/index.js +245 -0
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +74 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +71 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +71 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +71 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +71 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +188 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +16 -42
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +117 -72
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +85 -64
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +54 -17
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +74 -45
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +25 -0
- package/dist/extensions/Blocks/controlFactories.js +122 -111
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +14 -14
- package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +50 -3
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +32 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +5 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +25 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +592 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +60 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +15 -7
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +19 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/dist/static/styles/components/wide-panel.css.js +0 -4
- package/dist/static/styles/customEditorStyle.css.js +13 -0
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { currencyDecimalCounts as
|
|
5
|
-
import { UEAttr as
|
|
6
|
-
import { CommonControl as
|
|
7
|
-
import { useRecommendationExtensionStore as
|
|
8
|
-
import { prepareProductRows as
|
|
9
|
-
import { DEFAULT_CARD_COMPOSITION as
|
|
10
|
-
import { useDebounceFn as
|
|
11
|
-
const
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var S = (a, s, e) => s in a ? p(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
|
|
3
|
+
var u = (a, s, e) => S(a, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { currencyDecimalCounts as _, currencyOperators as C, currencyLocationMaps as R } from "../../../enums/extensions/recommendationBlock.js";
|
|
5
|
+
import { UEAttr as O, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { CommonControl as U } from "../common-control.js";
|
|
7
|
+
import { useRecommendationExtensionStore as N } from "./store/recommendation.js";
|
|
8
|
+
import { prepareProductRows as E } from "./templates/blockTemplate.js";
|
|
9
|
+
import { DEFAULT_CARD_COMPOSITION as d, getDefaultProducts as L } from "./templates/templateUtils.js";
|
|
10
|
+
import { useDebounceFn as T } from "../../../node_modules/@vueuse/shared/index.js";
|
|
11
|
+
const f = "ui-elements-recommendation-block", t = {
|
|
12
12
|
ALGORITHM: "strategy",
|
|
13
13
|
PRODUCT_IDS: "productIds",
|
|
14
14
|
LOCALE: "language",
|
|
@@ -21,24 +21,23 @@ const L = "ui-elements-recommendation-block", t = {
|
|
|
21
21
|
FILTERS: "filterStatus",
|
|
22
22
|
PRODUCT_COUNT: "size",
|
|
23
23
|
PRODUCT_IN_ROW: "cardsInRow",
|
|
24
|
-
SHUFFLE_PRODUCTS: "shuffleProducts"
|
|
25
|
-
RESPONSIVE: "unresponsive"
|
|
24
|
+
SHUFFLE_PRODUCTS: "shuffleProducts"
|
|
26
25
|
};
|
|
27
|
-
class
|
|
26
|
+
class Y extends U {
|
|
28
27
|
constructor() {
|
|
29
28
|
super(...arguments);
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
u(this, "store", N());
|
|
30
|
+
u(this, "storeUnsubscription", () => {
|
|
32
31
|
});
|
|
33
|
-
|
|
32
|
+
u(this, "addFilterListener", () => {
|
|
34
33
|
});
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
u(this, "addFilterButton", null);
|
|
35
|
+
u(this, "_debouncedRegenerateProductRows", T(() => {
|
|
37
36
|
this._regenerateProductRows();
|
|
38
37
|
}, 500));
|
|
39
38
|
}
|
|
40
39
|
getId() {
|
|
41
|
-
return
|
|
40
|
+
return f;
|
|
42
41
|
}
|
|
43
42
|
getTemplate() {
|
|
44
43
|
return `
|
|
@@ -49,7 +48,6 @@ class b extends g {
|
|
|
49
48
|
${this._getFilterStatus()}
|
|
50
49
|
${this._getProductLayout()}
|
|
51
50
|
${this._getShuffleProducts()}
|
|
52
|
-
${this._getResponsive()}
|
|
53
51
|
</div>
|
|
54
52
|
`;
|
|
55
53
|
}
|
|
@@ -79,27 +77,25 @@ class b extends g {
|
|
|
79
77
|
[t.CURRENCY_DECIMAL_COUNT]: e.currencySettings.decimalCount,
|
|
80
78
|
[t.PRODUCT_COUNT]: e.size,
|
|
81
79
|
[t.PRODUCT_IN_ROW]: e.cardsInRow,
|
|
82
|
-
[t.SHUFFLE_PRODUCTS]: e.shuffleProducts
|
|
83
|
-
[t.RESPONSIVE]: !e.unresponsive
|
|
80
|
+
[t.SHUFFLE_PRODUCTS]: e.shuffleProducts
|
|
84
81
|
});
|
|
85
82
|
}
|
|
86
83
|
_initializeSelectItems() {
|
|
87
|
-
const { store: e } = this, o = e.getActivePredictiveAlgorithms, i = e.getLanguages,
|
|
84
|
+
const { store: e } = this, o = e.getActivePredictiveAlgorithms, i = e.getLanguages, n = {
|
|
88
85
|
[t.ALGORITHM]: o,
|
|
89
86
|
[t.LOCALE]: i,
|
|
90
87
|
[t.CURRENCY]: e.currencyList,
|
|
91
|
-
[t.CURRENCY_LOCATION]:
|
|
88
|
+
[t.CURRENCY_LOCATION]: R,
|
|
92
89
|
[t.CURRENCY_SYMBOL]: e.getCurrencySymbolList,
|
|
93
|
-
[t.CURRENCY_THOUSAND_SEPARATOR]:
|
|
94
|
-
[t.CURRENCY_DECIMAL_SEPARATOR]:
|
|
95
|
-
[t.CURRENCY_DECIMAL_COUNT]:
|
|
90
|
+
[t.CURRENCY_THOUSAND_SEPARATOR]: C,
|
|
91
|
+
[t.CURRENCY_DECIMAL_SEPARATOR]: C,
|
|
92
|
+
[t.CURRENCY_DECIMAL_COUNT]: _,
|
|
96
93
|
[t.PRODUCT_COUNT]: Number(e.recommendationConfigs.size),
|
|
97
94
|
[t.PRODUCT_IN_ROW]: e.recommendationConfigs.cardsInRow,
|
|
98
|
-
[t.SHUFFLE_PRODUCTS]: e.recommendationConfigs.shuffleProducts
|
|
99
|
-
[t.RESPONSIVE]: !e.recommendationConfigs.unresponsive
|
|
95
|
+
[t.SHUFFLE_PRODUCTS]: e.recommendationConfigs.shuffleProducts
|
|
100
96
|
};
|
|
101
|
-
Object.entries(
|
|
102
|
-
this.api.setUIEAttribute(
|
|
97
|
+
Object.entries(n).forEach(([r, l]) => {
|
|
98
|
+
this.api.setUIEAttribute(r, O.SELECTPICKER.items, l);
|
|
103
99
|
});
|
|
104
100
|
}
|
|
105
101
|
_getAlgorithms() {
|
|
@@ -145,7 +141,7 @@ class b extends g {
|
|
|
145
141
|
this._GuSelect({
|
|
146
142
|
name: t.CURRENCY_LOCATION,
|
|
147
143
|
placeholder: "Select Currency Location",
|
|
148
|
-
options:
|
|
144
|
+
options: R
|
|
149
145
|
}),
|
|
150
146
|
this._GuLabel({ text: "Currency Symbol" }),
|
|
151
147
|
this._GuSelect({
|
|
@@ -157,19 +153,19 @@ class b extends g {
|
|
|
157
153
|
this._GuSelect({
|
|
158
154
|
name: t.CURRENCY_THOUSAND_SEPARATOR,
|
|
159
155
|
placeholder: "Select Thousand Separator",
|
|
160
|
-
options:
|
|
156
|
+
options: C
|
|
161
157
|
}),
|
|
162
158
|
this._GuLabel({ text: "Decimal Separator" }),
|
|
163
159
|
this._GuSelect({
|
|
164
160
|
name: t.CURRENCY_DECIMAL_SEPARATOR,
|
|
165
161
|
placeholder: "Select Decimal Separator",
|
|
166
|
-
options:
|
|
162
|
+
options: C
|
|
167
163
|
}),
|
|
168
164
|
this._GuLabel({ text: "Decimal Count" }),
|
|
169
165
|
this._GuSelect({
|
|
170
166
|
name: t.CURRENCY_DECIMAL_COUNT,
|
|
171
167
|
placeholder: "Select Decimal Count",
|
|
172
|
-
options:
|
|
168
|
+
options: _
|
|
173
169
|
})
|
|
174
170
|
])}
|
|
175
171
|
`;
|
|
@@ -204,20 +200,6 @@ class b extends g {
|
|
|
204
200
|
])}
|
|
205
201
|
`;
|
|
206
202
|
}
|
|
207
|
-
_getResponsive() {
|
|
208
|
-
return `
|
|
209
|
-
${this._GuTwoColumns([
|
|
210
|
-
this._GuLabel({ text: "Responsive Block" }),
|
|
211
|
-
this._GuToggle(t.RESPONSIVE)
|
|
212
|
-
])}
|
|
213
|
-
`;
|
|
214
|
-
}
|
|
215
|
-
_onFilterChange(e) {
|
|
216
|
-
this.currentNode && this.store.$patch({
|
|
217
|
-
filterStatus: e,
|
|
218
|
-
filterSelectionDrawerStatus: e
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
203
|
_onFilterSelectClick() {
|
|
222
204
|
this.store.$patch({
|
|
223
205
|
filterSelectionDrawerStatus: !0
|
|
@@ -235,12 +217,12 @@ class b extends g {
|
|
|
235
217
|
*/
|
|
236
218
|
_getCardComposition() {
|
|
237
219
|
if (!this.currentNode)
|
|
238
|
-
return
|
|
220
|
+
return d;
|
|
239
221
|
const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
240
222
|
if (!e || !("getAttribute" in e))
|
|
241
|
-
return
|
|
223
|
+
return d;
|
|
242
224
|
const o = e.getAttribute("data-card-composition");
|
|
243
|
-
return o ? o.split(",").filter(Boolean) :
|
|
225
|
+
return o ? o.split(",").filter(Boolean) : d;
|
|
244
226
|
}
|
|
245
227
|
_regenerateProductRows() {
|
|
246
228
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
@@ -250,8 +232,41 @@ class b extends g {
|
|
|
250
232
|
console.error("Could not find container table for product rows");
|
|
251
233
|
return;
|
|
252
234
|
}
|
|
253
|
-
const o = this.store.recommendationProducts.length > 0 ? this.store.recommendationProducts :
|
|
254
|
-
this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(
|
|
235
|
+
const o = this.store.recommendationProducts.length > 0 ? this.store.recommendationProducts : L(), { cardsInRow: i } = this.store.recommendationConfigs, n = this._getCardComposition(), r = E(o, i, n);
|
|
236
|
+
this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(r).apply(new g("Updated product")), this._reapplySpacing();
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Reapply spacing values after product regeneration
|
|
240
|
+
* This ensures spacing persists when products are regenerated
|
|
241
|
+
*/
|
|
242
|
+
_reapplySpacing() {
|
|
243
|
+
if (!this.currentNode)
|
|
244
|
+
return;
|
|
245
|
+
const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
246
|
+
if (!e || !("getAttribute" in e))
|
|
247
|
+
return;
|
|
248
|
+
const o = e.getAttribute("data-column-spacing"), i = e.getAttribute("data-row-spacing"), n = this.api.getDocumentModifier();
|
|
249
|
+
if (o) {
|
|
250
|
+
const r = parseInt(o);
|
|
251
|
+
if (!Number.isNaN(r)) {
|
|
252
|
+
const h = `0 ${Math.floor(r / 2)}px`;
|
|
253
|
+
Array.from(
|
|
254
|
+
this.currentNode.querySelectorAll(".product-card-wrapper")
|
|
255
|
+
).forEach((c) => {
|
|
256
|
+
"parentNode" in c && c.parentNode && typeof c.parentNode == "object" && "tagName" in c.parentNode && c.parentNode.tagName === "TD" && n.modifyHtml(c.parentNode).setStyle("padding", h);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (i) {
|
|
261
|
+
const r = parseInt(i);
|
|
262
|
+
if (!Number.isNaN(r)) {
|
|
263
|
+
const l = `${r}px`;
|
|
264
|
+
Array.from(this.currentNode.querySelectorAll(".spacer")).forEach((m) => {
|
|
265
|
+
n.modifyHtml(m).setStyle("height", l);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
(o || i) && n.apply(new g("Reapply spacing after regeneration"));
|
|
255
270
|
}
|
|
256
271
|
_onCurrencyConfigChange(e, o) {
|
|
257
272
|
this.currentNode && this.store.$patch({
|
|
@@ -288,8 +303,8 @@ class b extends g {
|
|
|
288
303
|
t.CURRENCY_DECIMAL_SEPARATOR,
|
|
289
304
|
t.CURRENCY_DECIMAL_COUNT
|
|
290
305
|
].forEach((i) => {
|
|
291
|
-
this.api.onValueChanged(i, (
|
|
292
|
-
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.
|
|
306
|
+
this.api.onValueChanged(i, (n) => this._onCurrencyConfigChange(i, n));
|
|
307
|
+
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (o = this.addFilterButton) == null || o.addEventListener("click", this.addFilterListener);
|
|
293
308
|
}
|
|
294
309
|
_listenStateUpdates() {
|
|
295
310
|
this.storeUnsubscription = this.store.$subscribe((e) => {
|
|
@@ -301,6 +316,6 @@ class b extends g {
|
|
|
301
316
|
}
|
|
302
317
|
}
|
|
303
318
|
export {
|
|
304
|
-
|
|
305
|
-
|
|
319
|
+
f as CONTROL_BLOCK_ID,
|
|
320
|
+
Y as RecommendationBlockControl
|
|
306
321
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ModificationDescription as a } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as d } from "../../common-control.js";
|
|
3
|
+
const c = "recommendation-card-background-color-control", o = {
|
|
4
|
+
CARD_BACKGROUND_COLOR: "cardBackgroundColor"
|
|
5
|
+
};
|
|
6
|
+
class u extends d {
|
|
7
|
+
getId() {
|
|
8
|
+
return c;
|
|
9
|
+
}
|
|
10
|
+
getTemplate() {
|
|
11
|
+
return `
|
|
12
|
+
<div class="card-bg-control-container">
|
|
13
|
+
${this._GuTwoColumns([
|
|
14
|
+
this._GuLabel({ text: "Card Background Color" }),
|
|
15
|
+
this._GuColorPicker(o.CARD_BACKGROUND_COLOR)
|
|
16
|
+
])}
|
|
17
|
+
</div>
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
onRender() {
|
|
21
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
22
|
+
}
|
|
23
|
+
onTemplateNodeUpdated(r) {
|
|
24
|
+
super.onTemplateNodeUpdated(r), this._setFormValues();
|
|
25
|
+
}
|
|
26
|
+
_setFormValues() {
|
|
27
|
+
const r = this._getCurrentCardBackgroundColor();
|
|
28
|
+
this.api.updateValues({
|
|
29
|
+
[o.CARD_BACKGROUND_COLOR]: r
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Reads the current background color from the first product card wrapper
|
|
34
|
+
* @returns The background color value or 'transparent' if not found
|
|
35
|
+
*/
|
|
36
|
+
_getCurrentCardBackgroundColor() {
|
|
37
|
+
if (!this.currentNode || !("querySelectorAll" in this.currentNode))
|
|
38
|
+
return "transparent";
|
|
39
|
+
const r = this.currentNode.querySelector(".product-card-wrapper");
|
|
40
|
+
return !r || !("getStyle" in r) ? "transparent" : r.getStyle("background-color") || "transparent";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Handles card background color changes
|
|
44
|
+
* Applies the color to all product card wrapper elements
|
|
45
|
+
*/
|
|
46
|
+
_onCardBackgroundColorChange(r) {
|
|
47
|
+
if (!this.currentNode || !("querySelectorAll" in this.currentNode))
|
|
48
|
+
return;
|
|
49
|
+
const e = Array.from(
|
|
50
|
+
this.currentNode.querySelectorAll(".product-card-wrapper")
|
|
51
|
+
);
|
|
52
|
+
if (e.length === 0)
|
|
53
|
+
return;
|
|
54
|
+
const t = this.api.getDocumentModifier();
|
|
55
|
+
e.forEach((n) => {
|
|
56
|
+
t.modifyHtml(n).setStyle("background-color", r);
|
|
57
|
+
}), t.apply(new a("Update card background color"));
|
|
58
|
+
}
|
|
59
|
+
_listenToFormUpdates() {
|
|
60
|
+
this.api.onValueChanged(o.CARD_BACKGROUND_COLOR, (r) => {
|
|
61
|
+
this._onCardBackgroundColorChange(r);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
c as CARD_BACKGROUND_COLOR_CONTROL_ID,
|
|
67
|
+
u as CardBackgroundColorControl
|
|
68
|
+
};
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { createButtonAlignControl as c, createButtonBorderControl as _, createButtonBorderRadiusControl as T, createButtonColorControl as i, createButtonFitToContainerControl as B, createButtonFontFamilyControl as s, createButtonMarginsControl as S, createButtonPaddingsControl as E, createButtonTextControl as P, createButtonTextSizeControl as U, createButtonTextStyleAndFontColorControl as R, createImageMarginsControl as a, createImageSizeControl as M, createTextAlignControl as C, createTextBackgroundColorControl as r, createTextColorControl as O, createTextFontFamilyControl as I, createPaddingsControl as e, createTextSizeControl as N, createTextStyleControl as l } from "../../controlFactories.js";
|
|
2
|
+
import { RecommendationBlockId as o, RecommendationControlId as t } from "../constants.js";
|
|
3
|
+
const n = ".ins-recommendation-product-container", u = C(
|
|
4
|
+
t.NAME_ALIGN,
|
|
5
|
+
o.NAME,
|
|
6
|
+
n
|
|
7
|
+
), d = O(
|
|
8
|
+
t.NAME_COLOR,
|
|
9
|
+
o.NAME,
|
|
10
|
+
n
|
|
11
|
+
), m = N(
|
|
12
|
+
t.NAME_SIZE,
|
|
13
|
+
o.NAME,
|
|
14
|
+
n
|
|
15
|
+
), L = l(
|
|
16
|
+
t.NAME_STYLE,
|
|
17
|
+
o.NAME,
|
|
18
|
+
n
|
|
19
|
+
), F = I(
|
|
20
|
+
t.NAME_FONT_FAMILY,
|
|
21
|
+
o.NAME,
|
|
22
|
+
n
|
|
23
|
+
), g = r(
|
|
24
|
+
t.NAME_BACKGROUND,
|
|
25
|
+
o.NAME,
|
|
26
|
+
n
|
|
27
|
+
), G = e(
|
|
28
|
+
t.NAME_PADDINGS,
|
|
29
|
+
o.NAME,
|
|
30
|
+
n
|
|
31
|
+
), y = C(
|
|
32
|
+
t.PRICE_ALIGN,
|
|
33
|
+
o.PRICE,
|
|
34
|
+
n
|
|
35
|
+
), b = O(
|
|
36
|
+
t.PRICE_COLOR,
|
|
37
|
+
o.PRICE,
|
|
38
|
+
n
|
|
39
|
+
), x = N(
|
|
40
|
+
t.PRICE_SIZE,
|
|
41
|
+
o.PRICE,
|
|
42
|
+
n
|
|
43
|
+
), Y = l(
|
|
44
|
+
t.PRICE_STYLE,
|
|
45
|
+
o.PRICE,
|
|
46
|
+
n
|
|
47
|
+
), z = I(
|
|
48
|
+
t.PRICE_FONT_FAMILY,
|
|
49
|
+
o.PRICE,
|
|
50
|
+
n
|
|
51
|
+
), k = r(
|
|
52
|
+
t.PRICE_BACKGROUND,
|
|
53
|
+
o.PRICE,
|
|
54
|
+
n
|
|
55
|
+
), Z = e(
|
|
56
|
+
t.PRICE_PADDINGS,
|
|
57
|
+
o.PRICE,
|
|
58
|
+
n
|
|
59
|
+
), K = C(
|
|
60
|
+
t.OLD_PRICE_ALIGN,
|
|
61
|
+
o.OLD_PRICE,
|
|
62
|
+
n
|
|
63
|
+
), p = O(
|
|
64
|
+
t.OLD_PRICE_COLOR,
|
|
65
|
+
o.OLD_PRICE,
|
|
66
|
+
n
|
|
67
|
+
), X = N(
|
|
68
|
+
t.OLD_PRICE_SIZE,
|
|
69
|
+
o.OLD_PRICE,
|
|
70
|
+
n
|
|
71
|
+
), f = l(
|
|
72
|
+
t.OLD_PRICE_STYLE,
|
|
73
|
+
o.OLD_PRICE,
|
|
74
|
+
n
|
|
75
|
+
), h = I(
|
|
76
|
+
t.OLD_PRICE_FONT_FAMILY,
|
|
77
|
+
o.OLD_PRICE,
|
|
78
|
+
n
|
|
79
|
+
), j = r(
|
|
80
|
+
t.OLD_PRICE_BACKGROUND,
|
|
81
|
+
o.OLD_PRICE,
|
|
82
|
+
n
|
|
83
|
+
), q = e(
|
|
84
|
+
t.OLD_PRICE_PADDINGS,
|
|
85
|
+
o.OLD_PRICE,
|
|
86
|
+
n
|
|
87
|
+
), v = C(
|
|
88
|
+
t.OMNIBUS_PRICE_ALIGN,
|
|
89
|
+
o.OMNIBUS_PRICE,
|
|
90
|
+
n
|
|
91
|
+
), w = O(
|
|
92
|
+
t.OMNIBUS_PRICE_COLOR,
|
|
93
|
+
o.OMNIBUS_PRICE,
|
|
94
|
+
n
|
|
95
|
+
), H = N(
|
|
96
|
+
t.OMNIBUS_PRICE_SIZE,
|
|
97
|
+
o.OMNIBUS_PRICE,
|
|
98
|
+
n
|
|
99
|
+
), J = l(
|
|
100
|
+
t.OMNIBUS_PRICE_STYLE,
|
|
101
|
+
o.OMNIBUS_PRICE,
|
|
102
|
+
n
|
|
103
|
+
), Q = I(
|
|
104
|
+
t.OMNIBUS_PRICE_FONT_FAMILY,
|
|
105
|
+
o.OMNIBUS_PRICE,
|
|
106
|
+
n
|
|
107
|
+
), V = r(
|
|
108
|
+
t.OMNIBUS_PRICE_BACKGROUND,
|
|
109
|
+
o.OMNIBUS_PRICE,
|
|
110
|
+
n
|
|
111
|
+
), W = e(
|
|
112
|
+
t.OMNIBUS_PRICE_PADDINGS,
|
|
113
|
+
o.OMNIBUS_PRICE,
|
|
114
|
+
n
|
|
115
|
+
), $ = C(
|
|
116
|
+
t.OMNIBUS_DISCOUNT_ALIGN,
|
|
117
|
+
o.OMNIBUS_DISCOUNT,
|
|
118
|
+
n
|
|
119
|
+
), oo = O(
|
|
120
|
+
t.OMNIBUS_DISCOUNT_COLOR,
|
|
121
|
+
o.OMNIBUS_DISCOUNT,
|
|
122
|
+
n
|
|
123
|
+
), to = N(
|
|
124
|
+
t.OMNIBUS_DISCOUNT_SIZE,
|
|
125
|
+
o.OMNIBUS_DISCOUNT,
|
|
126
|
+
n
|
|
127
|
+
), no = l(
|
|
128
|
+
t.OMNIBUS_DISCOUNT_STYLE,
|
|
129
|
+
o.OMNIBUS_DISCOUNT,
|
|
130
|
+
n
|
|
131
|
+
), Co = I(
|
|
132
|
+
t.OMNIBUS_DISCOUNT_FONT_FAMILY,
|
|
133
|
+
o.OMNIBUS_DISCOUNT,
|
|
134
|
+
n
|
|
135
|
+
), ro = r(
|
|
136
|
+
t.OMNIBUS_DISCOUNT_BACKGROUND,
|
|
137
|
+
o.OMNIBUS_DISCOUNT,
|
|
138
|
+
n
|
|
139
|
+
), Oo = e(
|
|
140
|
+
t.OMNIBUS_DISCOUNT_PADDINGS,
|
|
141
|
+
o.OMNIBUS_DISCOUNT,
|
|
142
|
+
n
|
|
143
|
+
), Io = c(
|
|
144
|
+
t.BUTTON_ALIGN,
|
|
145
|
+
o.BUTTON,
|
|
146
|
+
n
|
|
147
|
+
), eo = _(
|
|
148
|
+
t.BUTTON_BORDER,
|
|
149
|
+
o.BUTTON,
|
|
150
|
+
n
|
|
151
|
+
), No = T(
|
|
152
|
+
t.BUTTON_BORDER_RADIUS,
|
|
153
|
+
o.BUTTON,
|
|
154
|
+
n
|
|
155
|
+
), lo = i(
|
|
156
|
+
t.BUTTON_COLOR,
|
|
157
|
+
o.BUTTON,
|
|
158
|
+
n
|
|
159
|
+
), co = s(
|
|
160
|
+
t.BUTTON_FONT_FAMILY,
|
|
161
|
+
o.BUTTON,
|
|
162
|
+
n
|
|
163
|
+
), _o = S(
|
|
164
|
+
t.BUTTON_MARGINS,
|
|
165
|
+
o.BUTTON,
|
|
166
|
+
n
|
|
167
|
+
), To = E(
|
|
168
|
+
t.BUTTON_PADDINGS,
|
|
169
|
+
o.BUTTON,
|
|
170
|
+
n
|
|
171
|
+
), io = P(
|
|
172
|
+
t.BUTTON_TEXT,
|
|
173
|
+
o.BUTTON,
|
|
174
|
+
n
|
|
175
|
+
), Bo = U(
|
|
176
|
+
t.BUTTON_TEXT_SIZE,
|
|
177
|
+
o.BUTTON,
|
|
178
|
+
n
|
|
179
|
+
), so = R(
|
|
180
|
+
t.BUTTON_TEXT_STYLE_AND_FONT_COLOR,
|
|
181
|
+
o.BUTTON,
|
|
182
|
+
n
|
|
183
|
+
), So = B(
|
|
184
|
+
t.BUTTON_FIT_TO_CONTENT,
|
|
185
|
+
o.BUTTON,
|
|
186
|
+
n
|
|
187
|
+
), Eo = M(
|
|
188
|
+
t.IMAGE_SIZE,
|
|
189
|
+
o.IMAGE,
|
|
190
|
+
n
|
|
191
|
+
), Po = a(
|
|
192
|
+
t.IMAGE_MARGINS,
|
|
193
|
+
o.IMAGE,
|
|
194
|
+
n
|
|
195
|
+
);
|
|
196
|
+
export {
|
|
197
|
+
Io as ButtonAlignControl,
|
|
198
|
+
eo as ButtonBorderControl,
|
|
199
|
+
No as ButtonBorderRadiusControl,
|
|
200
|
+
lo as ButtonColorControl,
|
|
201
|
+
So as ButtonFitToContentControl,
|
|
202
|
+
co as ButtonFontFamilyControl,
|
|
203
|
+
_o as ButtonMarginsControl,
|
|
204
|
+
To as ButtonPaddingsControl,
|
|
205
|
+
io as ButtonTextControl,
|
|
206
|
+
Bo as ButtonTextSizeControl,
|
|
207
|
+
so as ButtonTextStyleAndFontColorControl,
|
|
208
|
+
Po as ImageMarginsControl,
|
|
209
|
+
Eo as ImageSizeControl,
|
|
210
|
+
u as NameAlignControl,
|
|
211
|
+
g as NameBackgroundControl,
|
|
212
|
+
d as NameColorControl,
|
|
213
|
+
F as NameFontFamilyControl,
|
|
214
|
+
G as NamePaddingsControl,
|
|
215
|
+
m as NameSizeControl,
|
|
216
|
+
L as NameStyleControl,
|
|
217
|
+
K as OldPriceAlignControl,
|
|
218
|
+
j as OldPriceBackgroundControl,
|
|
219
|
+
p as OldPriceColorControl,
|
|
220
|
+
h as OldPriceFontFamilyControl,
|
|
221
|
+
q as OldPricePaddingsControl,
|
|
222
|
+
X as OldPriceSizeControl,
|
|
223
|
+
f as OldPriceStyleControl,
|
|
224
|
+
$ as OmnibusDiscountAlignControl,
|
|
225
|
+
ro as OmnibusDiscountBackgroundControl,
|
|
226
|
+
oo as OmnibusDiscountColorControl,
|
|
227
|
+
Co as OmnibusDiscountFontFamilyControl,
|
|
228
|
+
Oo as OmnibusDiscountPaddingsControl,
|
|
229
|
+
to as OmnibusDiscountSizeControl,
|
|
230
|
+
no as OmnibusDiscountStyleControl,
|
|
231
|
+
v as OmnibusPriceAlignControl,
|
|
232
|
+
V as OmnibusPriceBackgroundControl,
|
|
233
|
+
w as OmnibusPriceColorControl,
|
|
234
|
+
Q as OmnibusPriceFontFamilyControl,
|
|
235
|
+
W as OmnibusPricePaddingsControl,
|
|
236
|
+
H as OmnibusPriceSizeControl,
|
|
237
|
+
J as OmnibusPriceStyleControl,
|
|
238
|
+
y as PriceAlignControl,
|
|
239
|
+
k as PriceBackgroundControl,
|
|
240
|
+
b as PriceColorControl,
|
|
241
|
+
z as PriceFontFamilyControl,
|
|
242
|
+
Z as PricePaddingsControl,
|
|
243
|
+
x as PriceSizeControl,
|
|
244
|
+
Y as PriceStyleControl
|
|
245
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ModificationDescription as m } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as c } from "../../common-control.js";
|
|
3
|
+
import { RecommendationControlId as d, RecommendationBlockId as a } from "../constants.js";
|
|
4
|
+
const n = {
|
|
5
|
+
TEXT_TRIM_ENABLED: "textTrimEnabled"
|
|
6
|
+
}, r = "text-trim-enabled", l = ".ins-recommendation-product-container";
|
|
7
|
+
class E extends c {
|
|
8
|
+
getId() {
|
|
9
|
+
return d.NAME_TEXT_TRIM;
|
|
10
|
+
}
|
|
11
|
+
getTemplate() {
|
|
12
|
+
return `
|
|
13
|
+
<div class="name-text-trim-control-container">
|
|
14
|
+
${this._GuTwoColumns([
|
|
15
|
+
this._GuLabel({ text: "Trim Long Text" }),
|
|
16
|
+
this._GuToggle(n.TEXT_TRIM_ENABLED)
|
|
17
|
+
])}
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
20
|
+
}
|
|
21
|
+
onRender() {
|
|
22
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
23
|
+
}
|
|
24
|
+
onTemplateNodeUpdated(e) {
|
|
25
|
+
super.onTemplateNodeUpdated(e), this._setFormValues();
|
|
26
|
+
}
|
|
27
|
+
_setFormValues() {
|
|
28
|
+
const e = this._getCurrentTrimState();
|
|
29
|
+
this.api.updateValues({
|
|
30
|
+
[n.TEXT_TRIM_ENABLED]: e
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
_getCurrentTrimState() {
|
|
34
|
+
if (!this.currentNode || !("hasClass" in this.currentNode))
|
|
35
|
+
return !1;
|
|
36
|
+
if (this.currentNode.hasClass(r))
|
|
37
|
+
return !0;
|
|
38
|
+
const e = this.currentNode.closest(l);
|
|
39
|
+
if (!e)
|
|
40
|
+
return !1;
|
|
41
|
+
const t = e.querySelector(
|
|
42
|
+
`[esd-extension-block-id="${a.NAME}"]`
|
|
43
|
+
);
|
|
44
|
+
return t && "hasClass" in t ? t.hasClass(r) : !1;
|
|
45
|
+
}
|
|
46
|
+
_onTextTrimChange(e) {
|
|
47
|
+
if (!this.currentNode || !("closest" in this.currentNode))
|
|
48
|
+
return;
|
|
49
|
+
const t = this.currentNode.closest(l);
|
|
50
|
+
if (!t || !("querySelectorAll" in t))
|
|
51
|
+
return;
|
|
52
|
+
const s = Array.from(
|
|
53
|
+
t.querySelectorAll(`[esd-extension-block-id="${a.NAME}"]`)
|
|
54
|
+
);
|
|
55
|
+
if (!s.length)
|
|
56
|
+
return;
|
|
57
|
+
const o = this.api.getDocumentModifier();
|
|
58
|
+
s.forEach((i) => {
|
|
59
|
+
e ? o.modifyHtml(i).setClass(r) : o.modifyHtml(i).removeClass(r);
|
|
60
|
+
}), o.apply(
|
|
61
|
+
new m(
|
|
62
|
+
e ? "Enable product name text trimming" : "Disable product name text trimming"
|
|
63
|
+
)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
_listenToFormUpdates() {
|
|
67
|
+
this.api.onValueChanged(n.TEXT_TRIM_ENABLED, (e) => {
|
|
68
|
+
this._onTextTrimChange(e);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
E as NameTextTrimControl
|
|
74
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ModificationDescription as a } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as m } from "../../common-control.js";
|
|
3
|
+
import { RecommendationControlId as l, RecommendationBlockId as d } from "../constants.js";
|
|
4
|
+
import { preserveTextStyles as T } from "../utils/preserveTextStyles.js";
|
|
5
|
+
const f = ".ins-recommendation-product-container", i = "data-text-after", u = "", p = ".omnibus-text-after";
|
|
6
|
+
class E extends m {
|
|
7
|
+
getId() {
|
|
8
|
+
return l.OMNIBUS_DISCOUNT_TEXT_AFTER;
|
|
9
|
+
}
|
|
10
|
+
getTemplate() {
|
|
11
|
+
return `
|
|
12
|
+
<div class="omnibus-discount-text-after-control-container">
|
|
13
|
+
${this._GuTwoColumns([
|
|
14
|
+
this._GuLabel({ text: "Text After" }),
|
|
15
|
+
this._GuTextInput({
|
|
16
|
+
name: "omnibusDiscountTextAfter",
|
|
17
|
+
placeholder: "e.g., off!",
|
|
18
|
+
className: "es-180w"
|
|
19
|
+
})
|
|
20
|
+
])}
|
|
21
|
+
</div>
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
onRender() {
|
|
25
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
26
|
+
}
|
|
27
|
+
onTemplateNodeUpdated(t) {
|
|
28
|
+
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
29
|
+
}
|
|
30
|
+
_setFormValues() {
|
|
31
|
+
const t = this._getCurrentText();
|
|
32
|
+
this.api.updateValues({
|
|
33
|
+
omnibusDiscountTextAfter: t
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
_getCurrentText() {
|
|
37
|
+
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
38
|
+
return u;
|
|
39
|
+
const t = this.currentNode.getAttribute(i);
|
|
40
|
+
return t === null ? u : t;
|
|
41
|
+
}
|
|
42
|
+
_onTextChange(t) {
|
|
43
|
+
if (!this.currentNode || !("closest" in this.currentNode))
|
|
44
|
+
return;
|
|
45
|
+
const e = this.currentNode.closest(f);
|
|
46
|
+
if (!e || !("querySelectorAll" in e))
|
|
47
|
+
return;
|
|
48
|
+
const n = Array.from(
|
|
49
|
+
e.querySelectorAll(`[esd-extension-block-id="${d.OMNIBUS_DISCOUNT}"]`)
|
|
50
|
+
);
|
|
51
|
+
if (!n.length)
|
|
52
|
+
return;
|
|
53
|
+
const o = this.api.getDocumentModifier();
|
|
54
|
+
n.forEach((s) => {
|
|
55
|
+
o.modifyHtml(s).setAttribute(i, t);
|
|
56
|
+
const r = s.querySelector(p);
|
|
57
|
+
if (r) {
|
|
58
|
+
const c = T(r, t);
|
|
59
|
+
o.modifyHtml(r).setInnerHtml(c);
|
|
60
|
+
}
|
|
61
|
+
}), o.apply(new a("Update omnibus discount text after"));
|
|
62
|
+
}
|
|
63
|
+
_listenToFormUpdates() {
|
|
64
|
+
this.api.onValueChanged("omnibusDiscountTextAfter", (t) => {
|
|
65
|
+
this._onTextChange(t);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
E as OmnibusDiscountTextAfterControl
|
|
71
|
+
};
|