@useinsider/guido 3.0.0-beta.a72fd61 → 3.0.0-beta.ae0075e

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.
Files changed (49) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/organisms/header/EditorActions.vue.js +1 -1
  3. package/dist/components/organisms/header/EditorActions.vue2.js +6 -6
  4. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  5. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +1 -1
  6. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +1 -1
  7. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +2 -2
  8. package/dist/config/compiler/unsubscribeCompilerRules.js +14 -14
  9. package/dist/config/compiler/utils/recommendationCompilerUtils.js +29 -18
  10. package/dist/extensions/Blocks/Recommendation/block.js +3 -0
  11. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  12. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  13. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -12
  14. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +693 -144
  15. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +78 -0
  16. package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +27 -24
  17. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +134 -126
  18. package/dist/extensions/Blocks/Recommendation/extension.js +18 -16
  19. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +126 -2
  20. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +124 -106
  21. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +8 -7
  22. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +63 -34
  23. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -33
  24. package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -8
  25. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +28 -13
  26. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +25 -44
  27. package/dist/extensions/Blocks/Recommendation/templates/utils.js +62 -38
  28. package/dist/guido.css +1 -1
  29. package/dist/src/components/Guido.vue.d.ts +1 -1
  30. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  31. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  32. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  33. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  35. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +8 -1
  36. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  37. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
  38. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +134 -44
  39. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +105 -0
  40. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  41. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -0
  42. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
  43. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -1
  44. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +1 -1
  45. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +10 -4
  46. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +37 -2
  47. package/dist/static/styles/base.css.js +7 -2
  48. package/dist/static/styles/variables.css.js +3 -0
  49. package/package.json +1 -1
@@ -1,36 +1,36 @@
1
1
  import { ModificationDescription as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { RecommendationBlockId as m } from "../../constants/blockIds.js";
3
- import { MOBILE_CONTAINER_SELECTOR as g, CURRENCY_ATTR as y, DESKTOP_CONTAINER_SELECTOR as q, CONTAINER_SELECTOR as $, MOBILE_ROW_SELECTOR as O } from "../../constants/selectors.js";
4
- import { RecommendationConfigService as N } from "../../services/configService.js";
3
+ import { MOBILE_CONTAINER_SELECTOR as g, CURRENCY_ATTR as y, DESKTOP_CONTAINER_SELECTOR as A, CONTAINER_SELECTOR as $, MOBILE_ROW_SELECTOR as N } from "../../constants/selectors.js";
4
+ import { RecommendationConfigService as k } from "../../services/configService.js";
5
5
  import { useRecommendationExtensionStore as E } from "../../store/recommendation.js";
6
- import { prepareProductRows as k } from "../../templates/index.js";
6
+ import { prepareProductRows as T } from "../../templates/index.js";
7
7
  import { formatPrice as B } from "../../utils/priceFormatter.js";
8
8
  import { isTdNode as v } from "../../utils/tagName.js";
9
- import { getDefaultProducts as T, DEFAULT_CARD_COMPOSITION as P, sanitizeImageUrl as j } from "../../templates/utils.js";
10
- const M = "recommendation-block-v2";
11
- function A(t) {
9
+ import { getDefaultProducts as _, DEFAULT_CARD_COMPOSITION as M, sanitizeImageUrl as j } from "../../templates/utils.js";
10
+ const h = "recommendation-block-v2";
11
+ function P(t) {
12
12
  if (!t)
13
13
  return null;
14
14
  if ("getAttribute" in t) {
15
15
  const e = t.getAttribute("class");
16
- if (e && e.includes(M))
16
+ if (e && e.includes(h))
17
17
  return t;
18
18
  }
19
- return "querySelector" in t ? t.querySelector(`.${M}`) : null;
19
+ return "querySelector" in t ? t.querySelector(`.${h}`) : null;
20
20
  }
21
21
  function b(t) {
22
- const e = A(t);
22
+ const e = P(t);
23
23
  if (!e || !("getAttribute" in e))
24
24
  return "grid";
25
25
  const o = e.getAttribute("data-layout");
26
26
  return o === "list" || o === "horizontal" ? "list" : "grid";
27
27
  }
28
- function _(t) {
29
- const e = A(t);
28
+ function x(t) {
29
+ const e = P(t);
30
30
  if (!e || !("getAttribute" in e))
31
- return P;
31
+ return M;
32
32
  const o = e.getAttribute("data-card-composition");
33
- return o ? o.split(",").filter(Boolean) : P;
33
+ return o ? o.split(",").filter(Boolean) : M;
34
34
  }
35
35
  function S(t, e, o) {
36
36
  if (!e || !("childNodes" in e))
@@ -40,41 +40,47 @@ function S(t, e, o) {
40
40
  );
41
41
  return r ? (t.modifyHtml(r).setText(o), !0) : !1;
42
42
  }
43
- function x(t, e) {
44
- return t && t.length > 0 ? t : e.length > 0 ? e : T();
43
+ function D(t, e) {
44
+ return t && t.length > 0 ? t : e.length > 0 ? e : _();
45
45
  }
46
46
  function V(t) {
47
47
  const { currentNode: e, documentModifier: o } = t;
48
48
  if (!e || !("querySelector" in e))
49
49
  return;
50
- const n = e.querySelector(O), r = e.querySelector(g);
50
+ const n = e.querySelector(N), r = e.querySelector(g);
51
51
  n && o.modifyHtml(n).setStyle("display", "none"), r && o.modifyHtml(r).setInnerHtml(""), (n || r) && o.apply(new p("Hide mobile row for list layout"));
52
52
  }
53
53
  function W(t) {
54
54
  const { currentNode: e, documentModifier: o } = t;
55
55
  if (!e || !("querySelector" in e))
56
56
  return;
57
- const n = e.querySelector(O);
57
+ const n = e.querySelector(N);
58
58
  n && o.modifyHtml(n).removeStyle("display").apply(new p("Show mobile row for grid layout"));
59
59
  }
60
60
  function G(t) {
61
- const { currentNode: e, documentModifier: o, products: n, layout: r } = t;
61
+ const {
62
+ currentNode: e,
63
+ documentModifier: o,
64
+ products: n,
65
+ layout: r,
66
+ composition: c
67
+ } = t;
62
68
  if (!e || !("querySelector" in e))
63
69
  return;
64
- const c = r ?? b(e);
65
- if (c === "list") {
70
+ const i = r ?? b(e);
71
+ if (i === "list") {
66
72
  V({ currentNode: e, documentModifier: o });
67
73
  return;
68
74
  }
69
75
  W({ currentNode: e, documentModifier: o });
70
- const i = e.querySelector(g);
71
- if (!i)
76
+ const u = e.querySelector(g);
77
+ if (!u)
72
78
  return;
73
- const s = E(), u = N.getConfig(e), l = x(n, s.recommendationProducts), f = _(e), a = k(l, c, {
74
- productsPerRow: u.mobileCardsInRow,
75
- composition: f
79
+ const s = E(), l = k.getConfig(e), f = D(n, s.recommendationProducts), d = c ?? x(e), a = T(f, i, {
80
+ productsPerRow: l.mobileCardsInRow,
81
+ composition: d
76
82
  });
77
- o.modifyHtml(i).setInnerHtml(a).apply(new p("Updated mobile product rows"));
83
+ o.modifyHtml(u).setInnerHtml(a).apply(new p("Updated mobile product rows"));
78
84
  }
79
85
  function Y(t) {
80
86
  const {
@@ -82,34 +88,35 @@ function Y(t) {
82
88
  documentModifier: o,
83
89
  afterRegenerate: n,
84
90
  products: r,
85
- layout: c
91
+ layout: c,
92
+ composition: i
86
93
  } = t;
87
94
  if (!e || !("querySelector" in e))
88
95
  return;
89
- const i = e.querySelector(q) ?? e.querySelector($);
90
- if (!i)
96
+ const u = e.querySelector(A) ?? e.querySelector($);
97
+ if (!u)
91
98
  return;
92
- const s = E(), u = x(r, s.recommendationProducts), { cardsInRow: l } = s.recommendationConfigs, f = _(e), a = c ?? b(e), d = k(u, a, {
93
- productsPerRow: l,
94
- composition: f
99
+ const s = E(), l = D(r, s.recommendationProducts), { cardsInRow: f } = s.recommendationConfigs, d = i ?? x(e), a = c ?? b(e), C = T(l, a, {
100
+ productsPerRow: f,
101
+ composition: d
95
102
  });
96
- o.modifyHtml(i).setInnerHtml(d).apply(new p("Updated product")), G(t), n == null || n();
103
+ o.modifyHtml(u).setInnerHtml(C).apply(new p("Updated product")), G(t), n == null || n();
97
104
  }
98
- function h(t, e, o, n) {
105
+ function R(t, e, o, n) {
99
106
  const c = `0 ${Math.floor(o / 2)}px`;
100
107
  let i = !1;
101
108
  return n === "grid" ? Array.from(
102
109
  t.querySelectorAll(".attribute-cell")
103
- ).forEach((u) => {
104
- e.modifyHtml(u).setStyle("padding", c), i = !0;
110
+ ).forEach((s) => {
111
+ e.modifyHtml(s).setStyle("padding", c), i = !0;
105
112
  }) : Array.from(
106
113
  t.querySelectorAll(".product-card-wrapper")
107
- ).forEach((u) => {
108
- const l = "parentNode" in u ? u.parentNode : null;
114
+ ).forEach((s) => {
115
+ const l = "parentNode" in s ? s.parentNode : null;
109
116
  l && v(l) && (e.modifyHtml(l).setStyle("padding", c), i = !0);
110
117
  }), i;
111
118
  }
112
- function R(t, e, o) {
119
+ function I(t, e, o) {
113
120
  const n = `${o}px`, r = Array.from(t.querySelectorAll(".spacer"));
114
121
  let c = !1;
115
122
  return r.forEach((i) => {
@@ -120,34 +127,34 @@ function F(t) {
120
127
  const { currentNode: e, documentModifier: o } = t;
121
128
  if (!e)
122
129
  return;
123
- const n = N.getConfig(e), r = b(e);
130
+ const n = k.getConfig(e), r = b(e);
124
131
  let c = !1;
125
- const i = e.querySelector(q);
132
+ const i = e.querySelector(A);
126
133
  if (i) {
127
- c = h(
134
+ c = R(
128
135
  i,
129
136
  o,
130
137
  n.columnSpacing,
131
138
  r
132
139
  );
133
- const l = R(
140
+ const l = I(
134
141
  i,
135
142
  o,
136
143
  n.rowSpacing
137
144
  );
138
145
  c = c || l;
139
146
  }
140
- const s = e.querySelector(g);
141
- if (s) {
142
- const u = h(
143
- s,
147
+ const u = e.querySelector(g);
148
+ if (u) {
149
+ const s = R(
150
+ u,
144
151
  o,
145
152
  n.mobileColumnSpacing,
146
153
  r
147
154
  );
148
- c = c || u;
149
- const l = R(
150
- s,
155
+ c = c || s;
156
+ const l = I(
157
+ u,
151
158
  o,
152
159
  n.mobileRowSpacing
153
160
  );
@@ -156,12 +163,13 @@ function F(t) {
156
163
  c && o.apply(new p("Reapply spacing after regeneration"));
157
164
  }
158
165
  function ie(t) {
159
- const { currentNode: e, documentModifier: o, afterRegenerate: n, products: r, layout: c } = t;
166
+ const { currentNode: e, documentModifier: o, afterRegenerate: n, products: r, layout: c, composition: i } = t;
160
167
  e && Y({
161
168
  currentNode: e,
162
169
  documentModifier: o,
163
170
  products: r,
164
171
  layout: c,
172
+ composition: i,
165
173
  afterRegenerate: () => {
166
174
  setTimeout(() => {
167
175
  F({ currentNode: e, documentModifier: o });
@@ -170,9 +178,9 @@ function ie(t) {
170
178
  });
171
179
  }
172
180
  function ce(t, e) {
173
- return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...T(e - t.length)];
181
+ return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ..._(e - t.length)];
174
182
  }
175
- function D() {
183
+ function H() {
176
184
  const t = E(), { currencySettings: e } = t.recommendationConfigs, o = parseInt(e.decimalCount);
177
185
  return {
178
186
  code: e.value,
@@ -183,8 +191,8 @@ function D() {
183
191
  thousandSeparator: e.thousandSeparator
184
192
  };
185
193
  }
186
- function C(t, e = "price") {
187
- const o = D(), n = t[e], r = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
194
+ function q(t, e = "price") {
195
+ const o = H(), n = t[e], r = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
188
196
  return B({
189
197
  price: r,
190
198
  currency: o
@@ -192,29 +200,29 @@ function C(t, e = "price") {
192
200
  }
193
201
  function K(t) {
194
202
  var c, i;
195
- const e = D(), o = ((c = t.original_price) == null ? void 0 : c[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((i = t.price) == null ? void 0 : i[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = o > 0 ? Math.round((o - n) / o * 100) : 0;
203
+ const e = H(), o = ((c = t.original_price) == null ? void 0 : c[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((i = t.price) == null ? void 0 : i[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = o > 0 ? Math.round((o - n) / o * 100) : 0;
196
204
  return r > 0 ? `-${r}%` : "0%";
197
205
  }
198
- function H(t) {
206
+ function L(t) {
199
207
  const { documentModifier: e, product: o, priceEl: n, oldPriceEl: r, omnibusPriceEl: c, omnibusDiscountEl: i } = t;
200
- let s = !1;
208
+ let u = !1;
201
209
  if (n && "querySelector" in n) {
202
- const u = n.querySelector("strong"), l = C(o, "price");
203
- S(e, u, l) && (s = !0);
210
+ const s = n.querySelector("strong"), l = q(o, "price");
211
+ S(e, s, l) && (u = !0);
204
212
  }
205
213
  if (r && "querySelector" in r) {
206
- const u = r.querySelector("strong"), l = C(o, "original_price");
207
- S(e, u, l) && (s = !0);
214
+ const s = r.querySelector("strong"), l = q(o, "original_price");
215
+ S(e, s, l) && (u = !0);
208
216
  }
209
217
  if (c && "querySelector" in c) {
210
- const u = c.querySelector(".omnibus-price-value"), l = C(o, "original_price");
211
- S(e, u, l) && (s = !0);
218
+ const s = c.querySelector(".omnibus-price-value"), l = q(o, "original_price");
219
+ S(e, s, l) && (u = !0);
212
220
  }
213
221
  if (i && "querySelector" in i) {
214
- const u = i.querySelector(".omnibus-discount-value"), l = K(o);
215
- S(e, u, l) && (s = !0);
222
+ const s = i.querySelector(".omnibus-discount-value"), l = K(o);
223
+ S(e, s, l) && (u = !0);
216
224
  }
217
- return s;
225
+ return u;
218
226
  }
219
227
  function z(t) {
220
228
  const {
@@ -224,38 +232,38 @@ function z(t) {
224
232
  nameEl: r,
225
233
  priceEl: c,
226
234
  oldPriceEl: i,
227
- omnibusPriceEl: s,
228
- omnibusDiscountEl: u,
235
+ omnibusPriceEl: u,
236
+ omnibusDiscountEl: s,
229
237
  buttonEl: l
230
238
  } = t;
231
239
  let f = !1;
232
240
  if (n && "querySelector" in n) {
233
- const a = n.querySelector("img");
234
- a && (e.modifyHtml(a).setAttribute("src", j(o.image_url)).setAttribute("alt", o.name), f = !0);
235
- const d = n.querySelector("a");
236
- d && (e.modifyHtml(d).setAttribute("href", o.url), f = !0);
241
+ const d = n.querySelector("img");
242
+ d && (e.modifyHtml(d).setAttribute("src", j(o.image_url)).setAttribute("alt", o.name), f = !0);
243
+ const a = n.querySelector("a");
244
+ a && (e.modifyHtml(a).setAttribute("href", o.url), f = !0);
237
245
  }
238
246
  if (r && "querySelector" in r) {
239
- const a = r.querySelector("strong");
240
- S(e, a, o.name) && (f = !0);
247
+ const d = r.querySelector("strong");
248
+ S(e, d, o.name) && (f = !0);
241
249
  }
242
- if (H({
250
+ if (L({
243
251
  documentModifier: e,
244
252
  product: o,
245
253
  priceEl: c,
246
254
  oldPriceEl: i,
247
- omnibusPriceEl: s,
248
- omnibusDiscountEl: u
255
+ omnibusPriceEl: u,
256
+ omnibusDiscountEl: s
249
257
  }) && (f = !0), l && "querySelector" in l) {
250
- const a = l.querySelector("a.es-button") || l.querySelector("a");
251
- a && (e.modifyHtml(a).setAttribute("href", o.url), f = !0);
258
+ const d = l.querySelector("a.es-button") || l.querySelector("a");
259
+ d && (e.modifyHtml(d).setAttribute("href", o.url), f = !0);
252
260
  }
253
261
  return f;
254
262
  }
255
- function L(t) {
256
- return "querySelector" in t ? t.querySelector(q) ?? t : t;
263
+ function U(t) {
264
+ return "querySelector" in t ? t.querySelector(A) ?? t : t;
257
265
  }
258
- function I(t, e, o) {
266
+ function w(t, e, o) {
259
267
  if (!("querySelectorAll" in t))
260
268
  return !1;
261
269
  const n = t.querySelectorAll(
@@ -266,45 +274,45 @@ function I(t, e, o) {
266
274
  `[esd-extension-block-id="${m.PRICE}"]`
267
275
  ), i = t.querySelectorAll(
268
276
  `[esd-extension-block-id="${m.OLD_PRICE}"]`
269
- ), s = t.querySelectorAll(
270
- `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
271
277
  ), u = t.querySelectorAll(
278
+ `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
279
+ ), s = t.querySelectorAll(
272
280
  `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
273
281
  ), l = t.querySelectorAll(
274
282
  `[esd-extension-block-id="${m.BUTTON}"]`
275
283
  ), f = Math.min(n.length, o.length);
276
- let a = !1;
277
- for (let d = 0; d < f; d++) {
278
- const U = z({
284
+ let d = !1;
285
+ for (let a = 0; a < f; a++) {
286
+ const C = z({
279
287
  documentModifier: e,
280
- product: o[d],
281
- imageEl: n[d] ?? null,
282
- nameEl: r[d] ?? null,
283
- priceEl: c[d] ?? null,
284
- oldPriceEl: i[d] ?? null,
285
- omnibusPriceEl: s[d] ?? null,
286
- omnibusDiscountEl: u[d] ?? null,
287
- buttonEl: l[d] ?? null
288
+ product: o[a],
289
+ imageEl: n[a] ?? null,
290
+ nameEl: r[a] ?? null,
291
+ priceEl: c[a] ?? null,
292
+ oldPriceEl: i[a] ?? null,
293
+ omnibusPriceEl: u[a] ?? null,
294
+ omnibusDiscountEl: s[a] ?? null,
295
+ buttonEl: l[a] ?? null
288
296
  });
289
- a = a || U;
297
+ d = d || C;
290
298
  }
291
- return a;
299
+ return d;
292
300
  }
293
301
  function le(t) {
294
302
  const { currentNode: e, documentModifier: o, products: n } = t;
295
303
  if (!e || !("querySelectorAll" in e))
296
304
  return !1;
297
- const r = L(e);
305
+ const r = U(e);
298
306
  if (!("querySelectorAll" in r) || r.querySelectorAll(
299
307
  `[esd-extension-block-id="${m.IMAGE}"]`
300
308
  ).length !== n.length)
301
309
  return !1;
302
- let i = I(r, o, n);
310
+ let i = w(r, o, n);
303
311
  if (b(e) !== "list" && "querySelector" in e) {
304
- const u = e.querySelector(g);
305
- if (u) {
306
- const l = I(
307
- u,
312
+ const s = e.querySelector(g);
313
+ if (s) {
314
+ const l = w(
315
+ s,
308
316
  o,
309
317
  n
310
318
  );
@@ -313,7 +321,7 @@ function le(t) {
313
321
  }
314
322
  return i && o.apply(new p("Updated product content in-place")), !0;
315
323
  }
316
- function w(t, e, o) {
324
+ function O(t, e, o) {
317
325
  if (!("querySelectorAll" in t))
318
326
  return !1;
319
327
  const n = t.querySelectorAll(
@@ -324,58 +332,58 @@ function w(t, e, o) {
324
332
  `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
325
333
  ), i = t.querySelectorAll(
326
334
  `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
327
- ), s = Math.min(n.length, o.length);
328
- let u = !1;
329
- for (let l = 0; l < s; l++)
330
- H({
335
+ ), u = Math.min(n.length, o.length);
336
+ let s = !1;
337
+ for (let l = 0; l < u; l++)
338
+ L({
331
339
  documentModifier: e,
332
340
  product: o[l],
333
341
  priceEl: n[l] ?? null,
334
342
  oldPriceEl: r[l] ?? null,
335
343
  omnibusPriceEl: c[l] ?? null,
336
344
  omnibusDiscountEl: i[l] ?? null
337
- }) && (u = !0);
338
- return u;
345
+ }) && (s = !0);
346
+ return s;
339
347
  }
340
- function ue(t) {
348
+ function se(t) {
341
349
  const { currentNode: e, documentModifier: o } = t;
342
350
  if (!e || !("querySelectorAll" in e))
343
351
  return !1;
344
352
  const r = E().recommendationProducts;
345
353
  if (r.length === 0)
346
354
  return !1;
347
- const c = L(e);
348
- let i = w(c, o, r);
355
+ const c = U(e);
356
+ let i = O(c, o, r);
349
357
  if (b(e) !== "list" && "querySelector" in e) {
350
- const u = e.querySelector(g);
351
- if (u) {
352
- const l = w(u, o, r);
358
+ const s = e.querySelector(g);
359
+ if (s) {
360
+ const l = O(s, o, r);
353
361
  i = i || l;
354
362
  }
355
363
  }
356
364
  return i && o.apply(new p("Updated price formatting in-place")), i;
357
365
  }
358
- function se(t) {
359
- const { currentNode: e, documentModifier: o, currency: n } = t, r = A(e);
366
+ function ue(t) {
367
+ const { currentNode: e, documentModifier: o, currency: n } = t, r = P(e);
360
368
  if (!r)
361
369
  return;
362
- const c = n.alignment === "before" ? "0" : "1", i = (s, u) => {
363
- o.modifyHtml(r).setAttribute(s, u);
370
+ const c = n.alignment === "before" ? "0" : "1", i = (u, s) => {
371
+ o.modifyHtml(r).setAttribute(u, s);
364
372
  };
365
373
  i(y.CURRENCY, n.code), i(y.SYMBOL, n.symbol), i(y.ALIGNMENT, c), i(y.THOUSAND_SEPARATOR, n.thousandSeparator), i(y.DECIMAL_SEPARATOR, n.decimalSeparator), i(y.DECIMAL_COUNT, n.decimalCount.toString()), o.apply(new p("Update currency attributes"));
366
374
  }
367
375
  export {
368
376
  ce as adjustProductsToSize,
369
- C as formatProductPrice,
370
- A as getBlockElement,
371
- _ as getCardComposition,
377
+ q as formatProductPrice,
378
+ P as getBlockElement,
379
+ x as getCardComposition,
372
380
  b as getCurrentLayout,
373
381
  F as reapplySpacing,
374
382
  G as regenerateMobileProductRows,
375
383
  Y as regenerateProductRows,
376
384
  ie as regenerateProductRowsWithStyles,
377
- se as setCurrencyAttributes,
378
- ue as updatePricesInPlace,
385
+ ue as setCurrencyAttributes,
386
+ se as updatePricesInPlace,
379
387
  le as updateProductContentInPlace,
380
388
  z as updateSingleProductContent
381
389
  };
@@ -8,35 +8,37 @@ import { OldPriceControls as l } from "./controls/oldPrice/index.js";
8
8
  import { OmnibusPriceControls as s } from "./controls/omnibusPrice/index.js";
9
9
  import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
10
10
  import { ButtonControls as p } from "./controls/button/index.js";
11
- import { ImageControls as c } from "./controls/image/index.js";
12
- import { SpacingControl as C } from "./controls/spacing/index.js";
11
+ import { ImageControls as C } from "./controls/image/index.js";
12
+ import { CustomAttributeControls as c } from "./controls/customAttribute/index.js";
13
+ import { SpacingControl as f } from "./controls/spacing/index.js";
13
14
  import { CardBackgroundColorControl as d } from "./controls/cardBackground/index.js";
14
- import { LayoutControl as f } from "./controls/layout/index.js";
15
- import { RecommendationCardCompositionControl as u } from "./controls/cardComposition/index.js";
16
- import { RecommendationIconsRegistry as g } from "./iconsRegistry.js";
17
- import R from "./recommendation.css.js";
18
- import { SettingsPanel as y } from "./settingsPanel.js";
19
- const B = [
15
+ import { LayoutControl as u } from "./controls/layout/index.js";
16
+ import { RecommendationCardCompositionControl as g } from "./controls/cardComposition/index.js";
17
+ import { RecommendationIconsRegistry as R } from "./iconsRegistry.js";
18
+ import y from "./recommendation.css.js";
19
+ import { SettingsPanel as B } from "./settingsPanel.js";
20
+ const b = [
20
21
  i,
21
22
  e,
22
23
  l,
23
24
  s,
24
25
  a,
25
26
  p,
27
+ C,
26
28
  c
27
29
  ], P = [
28
30
  n,
29
31
  d,
32
+ u,
30
33
  f,
31
- C,
32
- u
33
- ], b = [
34
+ g
35
+ ], k = [
34
36
  ...P,
35
- ...B.flatMap((o) => Object.values(o))
36
- ], F = b.reduce(
37
+ ...b.flatMap((o) => Object.values(o))
38
+ ], J = k.reduce(
37
39
  (o, t) => o.addControl(t),
38
- new r().addBlock(m).withSettingsPanelRegistry(y)
39
- ).addStyles(R).withIconsRegistry(g).build();
40
+ new r().addBlock(m).withSettingsPanelRegistry(B)
41
+ ).addStyles(y).withIconsRegistry(R).build();
40
42
  export {
41
- F as default
43
+ J as default
42
44
  };