@useinsider/guido 3.7.2-beta.13c9a35 → 3.7.2-beta.6f556cb

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 (42) hide show
  1. package/dist/@types/config/schemas.js +66 -70
  2. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  3. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +47 -45
  4. package/dist/composables/usePreviewMode.js +14 -15
  5. package/dist/config/compiler/utils/recommendationCompilerUtils.js +82 -90
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +58 -59
  7. package/dist/config/migrator/recommendation/settingsMapper.js +33 -38
  8. package/dist/extensions/Blocks/Recommendation/block.js +41 -60
  9. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +32 -41
  10. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +288 -369
  11. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +84 -96
  12. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +80 -82
  13. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +7 -21
  14. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -64
  15. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +5 -7
  16. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +72 -101
  17. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -31
  18. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -9
  19. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +59 -74
  20. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
  21. package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -88
  22. package/dist/guido.css +1 -1
  23. package/dist/src/@types/config/schemas.d.ts +0 -16
  24. package/dist/src/composables/useConfig.d.ts +0 -4
  25. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
  26. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -10
  27. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -29
  28. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
  29. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -3
  30. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -2
  31. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +0 -16
  32. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  33. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +0 -13
  34. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +2 -3
  35. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -33
  36. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -15
  37. package/dist/src/stores/config.d.ts +0 -36
  38. package/package.json +1 -1
  39. package/dist/composables/useRecommendationPreview.js +0 -100
  40. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +0 -133
  41. package/dist/src/composables/useRecommendationPreview.d.ts +0 -10
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +0 -59
@@ -1,33 +1,31 @@
1
- var f = Object.defineProperty;
2
- var p = (d, l, t) => l in d ? f(d, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[l] = t;
3
- var s = (d, l, t) => p(d, typeof l != "symbol" ? l + "" : l, t);
1
+ var C = Object.defineProperty;
2
+ var p = (d, c, t) => c in d ? C(d, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[c] = t;
3
+ var s = (d, c, t) => p(d, typeof c != "symbol" ? c + "" : c, t);
4
4
  import { CommonControl as g } from "../../../common-control.js";
5
- import { DEFAULT_NODE_CONFIG as c } from "../../constants/defaultConfig.js";
6
- import { RecommendationConfigService as m } from "../../services/configService.js";
5
+ import { DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
6
+ import { RecommendationConfigService as h } from "../../services/configService.js";
7
7
  import { useRecommendationExtensionStore as y } from "../../store/recommendation.js";
8
8
  import { AlgorithmControl as R } from "./algorithm.js";
9
- import { ALGORITHM_CONTROL_ID as Z } from "./algorithm.js";
10
- import { CurrencyControl as N } from "./currency.js";
11
- import { CURRENCY_CONTROL_ID as et } from "./currency.js";
12
- import { FiltersControl as I } from "./filters.js";
13
- import { FILTERS_CONTROL_ID as rt } from "./filters.js";
14
- import { LayoutOrientationControl as _ } from "./layoutOrientation.js";
15
- import { LAYOUT_ORIENTATION_CONTROL_ID as it } from "./layoutOrientation.js";
16
- import { LocaleControl as b } from "./locale.js";
17
- import { LOCALE_CONTROL_ID as ct } from "./locale.js";
18
- import { PricePlacementControl as T } from "./pricePlacement.js";
19
- import { PRICE_PLACEMENT_CONTROL_ID as at } from "./pricePlacement.js";
20
- import { ProductCountControl as P } from "./productCount.js";
21
- import { PRODUCT_COUNT_CONTROL_ID as dt } from "./productCount.js";
22
- import { ProductLayoutControl as O } from "./productLayout.js";
23
- import { PRODUCT_LAYOUT_CONTROL_ID as ht } from "./productLayout.js";
24
- import { ShuffleControl as L } from "./shuffle.js";
25
- import { SHUFFLE_CONTROL_ID as ft } from "./shuffle.js";
26
- import { setCurrencyAttributes as S, getBlockElement as k, updateProductContentInPlace as D, regenerateProductRowsWithStyles as E } from "./utils.js";
27
- import { adjustProductsToSize as gt, formatProductPrice as yt, getCardComposition as Rt, getCurrentLayout as Nt, reapplySpacing as It, regenerateMobileProductRows as _t, regenerateProductRows as bt, updatePricesInPlace as Tt, updateSingleProductContent as Pt } from "./utils.js";
28
- import { useDebounceFn as h } from "../../../../../node_modules/@vueuse/shared/index.js";
29
- const w = "recommendation-id", A = "ui-elements-recommendation-block";
30
- class J extends g {
9
+ import { ALGORITHM_CONTROL_ID as Q } from "./algorithm.js";
10
+ import { CurrencyControl as b } from "./currency.js";
11
+ import { CURRENCY_CONTROL_ID as Z } from "./currency.js";
12
+ import { FiltersControl as N } from "./filters.js";
13
+ import { FILTERS_CONTROL_ID as et } from "./filters.js";
14
+ import { LayoutOrientationControl as I } from "./layoutOrientation.js";
15
+ import { LAYOUT_ORIENTATION_CONTROL_ID as rt } from "./layoutOrientation.js";
16
+ import { LocaleControl as _ } from "./locale.js";
17
+ import { LOCALE_CONTROL_ID as it } from "./locale.js";
18
+ import { ProductCountControl as O } from "./productCount.js";
19
+ import { PRODUCT_COUNT_CONTROL_ID as at } from "./productCount.js";
20
+ import { ProductLayoutControl as T } from "./productLayout.js";
21
+ import { PRODUCT_LAYOUT_CONTROL_ID as lt } from "./productLayout.js";
22
+ import { ShuffleControl as S } from "./shuffle.js";
23
+ import { SHUFFLE_CONTROL_ID as dt } from "./shuffle.js";
24
+ import { setCurrencyAttributes as L, getBlockElement as P, updateProductContentInPlace as k, regenerateProductRowsWithStyles as D } from "./utils.js";
25
+ import { adjustProductsToSize as mt, formatProductPrice as ft, getCardComposition as Ct, getCurrentLayout as pt, reapplySpacing as gt, regenerateMobileProductRows as yt, regenerateProductRows as Rt, updatePricesInPlace as bt, updateSingleProductContent as Nt } from "./utils.js";
26
+ import { useDebounceFn as m } from "../../../../../node_modules/@vueuse/shared/index.js";
27
+ const E = "recommendation-id", w = "ui-elements-recommendation-block";
28
+ class K extends g {
31
29
  constructor() {
32
30
  super(...arguments);
33
31
  s(this, "store", y());
@@ -42,12 +40,11 @@ class J extends g {
42
40
  s(this, "productLayoutControl", null);
43
41
  s(this, "filtersControl", null);
44
42
  s(this, "shuffleControl", null);
45
- s(this, "pricePlacementControl", null);
46
43
  s(this, "layoutOrientationControl", null);
47
44
  /**
48
45
  * Debounced product fetch to prevent rapid API calls during config changes
49
46
  */
50
- s(this, "_debouncedFetchProducts", h(() => {
47
+ s(this, "_debouncedFetchProducts", m(() => {
51
48
  this.store.fetchRecommendationProducts();
52
49
  }, 500));
53
50
  /**
@@ -61,16 +58,16 @@ class J extends g {
61
58
  * count. The store pads products to the configured size, so in-place only
62
59
  * fails when the size actually changed.
63
60
  */
64
- s(this, "_debouncedRegenerateWithProducts", h(() => {
61
+ s(this, "_debouncedRegenerateWithProducts", m(() => {
65
62
  const t = this.store.recommendationProducts;
66
63
  if (!this.currentNode || !this.api)
67
64
  return;
68
65
  const e = this.api.getDocumentModifier();
69
- D({
66
+ k({
70
67
  currentNode: this.currentNode,
71
68
  documentModifier: e,
72
69
  products: t
73
- }) || E({
70
+ }) || D({
74
71
  currentNode: this.currentNode,
75
72
  documentModifier: e,
76
73
  products: t
@@ -78,10 +75,10 @@ class J extends g {
78
75
  }, 100));
79
76
  }
80
77
  getId() {
81
- return A;
78
+ return w;
82
79
  }
83
80
  getTemplate() {
84
- return this.algorithmControl = new R(), this.localeControl = new b(), this.currencyControl = new N(), this.productCountControl = new P(), this.productLayoutControl = new O(), this.filtersControl = new I(), this.shuffleControl = new L(), this.pricePlacementControl = new T(), this.layoutOrientationControl = new _(), [
81
+ return this.algorithmControl = new R(), this.localeControl = new _(), this.currencyControl = new b(), this.productCountControl = new O(), this.productLayoutControl = new T(), this.filtersControl = new N(), this.shuffleControl = new S(), this.layoutOrientationControl = new I(), [
85
82
  this.algorithmControl,
86
83
  this.localeControl,
87
84
  this.currencyControl,
@@ -89,7 +86,6 @@ class J extends g {
89
86
  this.productLayoutControl,
90
87
  this.filtersControl,
91
88
  this.shuffleControl,
92
- this.pricePlacementControl,
93
89
  this.layoutOrientationControl
94
90
  ].forEach((e) => {
95
91
  e.api = this.api;
@@ -100,7 +96,6 @@ class J extends g {
100
96
  ${this.productLayoutControl.getTemplate()}
101
97
  ${this.algorithmControl.getTemplate()}
102
98
  ${this.localeControl.getTemplate()}
103
- ${this.pricePlacementControl.getTemplate()}
104
99
  ${this.currencyControl.getTemplate()}
105
100
  ${this.filtersControl.getTemplate()}
106
101
  ${this.shuffleControl.getTemplate()}
@@ -130,8 +125,7 @@ class J extends g {
130
125
  this.currencyControl,
131
126
  this.productLayoutControl,
132
127
  this.filtersControl,
133
- this.shuffleControl,
134
- this.pricePlacementControl
128
+ this.shuffleControl
135
129
  ].forEach((n) => {
136
130
  var i;
137
131
  n != null && n.api && (n.currentNode = t, (i = n.onTemplateNodeUpdated) == null || i.call(n, t));
@@ -146,8 +140,7 @@ class J extends g {
146
140
  this.currencyControl,
147
141
  this.productLayoutControl,
148
142
  this.filtersControl,
149
- this.shuffleControl,
150
- this.pricePlacementControl
143
+ this.shuffleControl
151
144
  ].forEach((e) => {
152
145
  var o;
153
146
  return (o = e == null ? void 0 : e.onDestroy) == null ? void 0 : o.call(e);
@@ -166,8 +159,7 @@ class J extends g {
166
159
  this.currencyControl,
167
160
  this.productLayoutControl,
168
161
  this.filtersControl,
169
- this.shuffleControl,
170
- this.pricePlacementControl
162
+ this.shuffleControl
171
163
  ].forEach((e) => {
172
164
  var o;
173
165
  e && (e.api = this.api, e.currentNode = this.currentNode, (o = e.onRender) == null || o.call(e));
@@ -186,7 +178,7 @@ class J extends g {
186
178
  */
187
179
  _syncNodeConfigToStore() {
188
180
  var r;
189
- const t = m.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((r = this.store.blockStates[e]) == null ? void 0 : r.isInitialized);
181
+ const t = h.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((r = this.store.blockStates[e]) == null ? void 0 : r.isInitialized);
190
182
  this.store.patchCurrentBlockConfig({
191
183
  strategy: t.strategy,
192
184
  language: t.language,
@@ -201,8 +193,6 @@ class J extends g {
201
193
  // for filters (edited via the filter drawer).
202
194
  ...o ? {} : { filters: t.filters },
203
195
  shuffleProducts: t.shuffleProducts,
204
- priceMovedToNextLine: t.priceMovedToNextLine,
205
- priceHideIfSameAsDiscounted: t.priceHideIfSameAsDiscounted,
206
196
  currencySettings: {
207
197
  name: t.currency.code,
208
198
  value: t.currency.code,
@@ -249,36 +239,36 @@ class J extends g {
249
239
  _applySmartDefaults() {
250
240
  if (!this.currentNode || !this.api)
251
241
  return;
252
- const t = m.getConfig(this.currentNode), e = {};
242
+ const t = h.getConfig(this.currentNode), e = {};
253
243
  let o = null, r = null, n = null;
254
- if (t.currency.code === c.currency.code) {
244
+ if (t.currency.code === a.currency.code) {
255
245
  const { currencyList: i } = this.store;
256
246
  i.length > 0 && (i.some(
257
- (u) => u.value === `price.${c.currency.code}`
247
+ (u) => u.value === `price.${a.currency.code}`
258
248
  ) || (o = i[0].value.replace("price.", ""), e.currency = {
259
- ...c.currency,
249
+ ...a.currency,
260
250
  code: o,
261
251
  symbol: o
262
252
  }));
263
253
  }
264
- if (t.strategy === c.strategy) {
254
+ if (t.strategy === a.strategy) {
265
255
  const i = this.store.getActivePredictiveAlgorithms;
266
256
  i.length > 0 && (i.some(
267
- (u) => u.value === c.strategy
257
+ (u) => u.value === a.strategy
268
258
  ) || (r = i[0].value, e.strategy = r));
269
259
  }
270
- if (t.language === c.language) {
260
+ if (t.language === a.language) {
271
261
  const i = this.store.getLanguages;
272
262
  i.length > 0 && (i.some(
273
- (u) => u.value === c.language
263
+ (u) => u.value === a.language
274
264
  ) || (n = i[0].value, e.language = n));
275
265
  }
276
- !o && !r && !n || (m.updateConfig(
266
+ !o && !r && !n || (h.updateConfig(
277
267
  this.api,
278
268
  this.currentNode,
279
269
  e,
280
270
  "Applied smart defaults"
281
- ), o && e.currency && S({
271
+ ), o && e.currency && L({
282
272
  currentNode: this.currentNode,
283
273
  documentModifier: this.api.getDocumentModifier(),
284
274
  currency: e.currency
@@ -288,10 +278,10 @@ class J extends g {
288
278
  name: o,
289
279
  value: o,
290
280
  symbol: o,
291
- alignment: c.currency.alignment === "before" ? "0" : "1",
292
- decimalCount: c.currency.decimalCount.toString(),
293
- decimalSeparator: c.currency.decimalSeparator,
294
- thousandSeparator: c.currency.thousandSeparator
281
+ alignment: a.currency.alignment === "before" ? "0" : "1",
282
+ decimalCount: a.currency.decimalCount.toString(),
283
+ decimalSeparator: a.currency.decimalSeparator,
284
+ thousandSeparator: a.currency.thousandSeparator
295
285
  }
296
286
  } : {},
297
287
  ...r ? { strategy: r } : {},
@@ -302,10 +292,10 @@ class J extends g {
302
292
  * Reads the recommendation-id attribute from the block element within the node
303
293
  */
304
294
  _getRecommendationIdFromNode(t) {
305
- const e = k(t);
295
+ const e = P(t);
306
296
  if (!e || !("getAttribute" in e))
307
297
  return null;
308
- const o = e.getAttribute(w);
298
+ const o = e.getAttribute(E);
309
299
  if (!o)
310
300
  return null;
311
301
  const r = parseInt(o);
@@ -335,8 +325,8 @@ class J extends g {
335
325
  }
336
326
  const i = t.$state.configVersion;
337
327
  i !== o && (o = i, this._persistFiltersToNodeConfig(), this._debouncedFetchProducts());
338
- const a = t.recommendationProducts, u = a !== e, C = Array.isArray(a) && a.length > 0;
339
- u && C && (e = a, this._debouncedRegenerateWithProducts());
328
+ const l = t.recommendationProducts, u = l !== e, f = Array.isArray(l) && l.length > 0;
329
+ u && f && (e = l, this._debouncedRegenerateWithProducts());
340
330
  });
341
331
  }
342
332
  /**
@@ -347,7 +337,7 @@ class J extends g {
347
337
  if (!this.currentNode || !this.api)
348
338
  return;
349
339
  const { filters: t } = this.store.recommendationConfigs;
350
- m.updateConfig(
340
+ h.updateConfig(
351
341
  this.api,
352
342
  this.currentNode,
353
343
  { filters: t },
@@ -356,37 +346,35 @@ class J extends g {
356
346
  }
357
347
  }
358
348
  export {
359
- Z as ALGORITHM_CONTROL_ID,
349
+ Q as ALGORITHM_CONTROL_ID,
360
350
  R as AlgorithmControl,
361
- A as CONTROL_BLOCK_ID,
362
- et as CURRENCY_CONTROL_ID,
363
- N as CurrencyControl,
364
- rt as FILTERS_CONTROL_ID,
365
- I as FiltersControl,
366
- it as LAYOUT_ORIENTATION_CONTROL_ID,
367
- ct as LOCALE_CONTROL_ID,
368
- _ as LayoutOrientationControl,
369
- b as LocaleControl,
370
- at as PRICE_PLACEMENT_CONTROL_ID,
371
- dt as PRODUCT_COUNT_CONTROL_ID,
372
- ht as PRODUCT_LAYOUT_CONTROL_ID,
373
- T as PricePlacementControl,
374
- P as ProductCountControl,
375
- O as ProductLayoutControl,
376
- J as RecommendationBlockControl,
377
- ft as SHUFFLE_CONTROL_ID,
378
- L as ShuffleControl,
379
- gt as adjustProductsToSize,
380
- yt as formatProductPrice,
381
- k as getBlockElement,
382
- Rt as getCardComposition,
383
- Nt as getCurrentLayout,
384
- It as reapplySpacing,
385
- _t as regenerateMobileProductRows,
386
- bt as regenerateProductRows,
387
- E as regenerateProductRowsWithStyles,
388
- S as setCurrencyAttributes,
389
- Tt as updatePricesInPlace,
390
- D as updateProductContentInPlace,
391
- Pt as updateSingleProductContent
351
+ w as CONTROL_BLOCK_ID,
352
+ Z as CURRENCY_CONTROL_ID,
353
+ b as CurrencyControl,
354
+ et as FILTERS_CONTROL_ID,
355
+ N as FiltersControl,
356
+ rt as LAYOUT_ORIENTATION_CONTROL_ID,
357
+ it as LOCALE_CONTROL_ID,
358
+ I as LayoutOrientationControl,
359
+ _ as LocaleControl,
360
+ at as PRODUCT_COUNT_CONTROL_ID,
361
+ lt as PRODUCT_LAYOUT_CONTROL_ID,
362
+ O as ProductCountControl,
363
+ T as ProductLayoutControl,
364
+ K as RecommendationBlockControl,
365
+ dt as SHUFFLE_CONTROL_ID,
366
+ S as ShuffleControl,
367
+ mt as adjustProductsToSize,
368
+ ft as formatProductPrice,
369
+ P as getBlockElement,
370
+ Ct as getCardComposition,
371
+ pt as getCurrentLayout,
372
+ gt as reapplySpacing,
373
+ yt as regenerateMobileProductRows,
374
+ Rt as regenerateProductRows,
375
+ D as regenerateProductRowsWithStyles,
376
+ L as setCurrencyAttributes,
377
+ bt as updatePricesInPlace,
378
+ k as updateProductContentInPlace,
379
+ Nt as updateSingleProductContent
392
380
  };