@useinsider/guido 3.7.2-beta.1489585 → 3.7.2-beta.2220fb0

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 (62) hide show
  1. package/dist/@types/config/schemas.js +70 -66
  2. package/dist/composables/usePreviewMode.js +15 -14
  3. package/dist/composables/useRecommendationPreview.js +100 -0
  4. package/dist/config/compiler/recommendationCompilerRules.js +1 -1
  5. package/dist/config/compiler/utils/recommendationCompilerUtils.js +92 -78
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +59 -58
  7. package/dist/config/migrator/recommendation/settingsMapper.js +38 -33
  8. package/dist/extensions/Blocks/Recommendation/block.js +60 -41
  9. package/dist/extensions/Blocks/Recommendation/canvasPreview.css.js +16 -0
  10. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +41 -32
  11. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +10 -11
  12. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +369 -288
  13. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +96 -82
  14. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +39 -30
  15. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +133 -0
  16. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +34 -28
  17. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +338 -288
  18. package/dist/extensions/Blocks/Recommendation/extension.js +30 -30
  19. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +21 -7
  20. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +64 -4
  21. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +2 -3
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +7 -5
  23. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +217 -155
  24. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +31 -56
  25. package/dist/extensions/Blocks/Recommendation/templates/index.js +10 -29
  26. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +135 -145
  27. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +22 -43
  28. package/dist/extensions/Blocks/Recommendation/templates/utils.js +96 -109
  29. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +19 -24
  30. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +22 -30
  31. package/dist/extensions/Blocks/controlFactories.js +133 -159
  32. package/dist/src/@types/config/schemas.d.ts +16 -0
  33. package/dist/src/composables/useConfig.d.ts +4 -0
  34. package/dist/src/composables/useRecommendationPreview.d.ts +10 -0
  35. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
  36. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
  37. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  38. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  39. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -2
  40. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
  41. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +29 -3
  42. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
  43. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
  44. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +1 -2
  45. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +59 -0
  46. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +47 -20
  47. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
  48. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +16 -0
  49. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  50. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  51. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +13 -0
  52. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  53. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +47 -163
  54. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +15 -0
  55. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -15
  56. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
  57. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +9 -29
  58. package/dist/src/extensions/Blocks/controlFactories.d.ts +1 -11
  59. package/dist/src/stores/config.d.ts +36 -0
  60. package/package.json +1 -1
  61. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +0 -216
  62. package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +0 -78
@@ -1,70 +1,75 @@
1
1
  import { CURRENT_CONFIG_VERSION as s, DEFAULT_CURRENCY as i } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
- import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as f, DEFAULT_ROW_SPACING as S, DEFAULT_COLUMN_SPACING as d, DEFAULT_MOBILE_CARDS_IN_ROW as u } from "../../../extensions/Blocks/Recommendation/constants/layout.js";
3
- import { mapLegacyStrategy as c } from "../../../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
4
- function l(t) {
2
+ import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as f, DEFAULT_COLUMN_SPACING as S, DEFAULT_MOBILE_CARDS_IN_ROW as a } from "../../../extensions/Blocks/Recommendation/constants/layout.js";
3
+ import { mapLegacyStrategy as l } from "../../../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
4
+ function c(t) {
5
5
  return t === "0" || t === 0 ? "before" : "after";
6
6
  }
7
- function _(t) {
7
+ function I(t) {
8
8
  if (typeof t == "number" && Number.isFinite(t))
9
9
  return t;
10
10
  if (typeof t == "string") {
11
- const n = parseInt(t);
12
- if (!Number.isNaN(n))
13
- return n;
11
+ const o = parseInt(t);
12
+ if (!Number.isNaN(o))
13
+ return o;
14
14
  }
15
15
  return i.decimalCount;
16
16
  }
17
- function I(t) {
17
+ function _(t) {
18
18
  return t === "." || t === "," || t === " " || t === "" ? t : ",";
19
19
  }
20
- function A(t) {
20
+ function N(t) {
21
21
  return t === "." || t === "," || t === " " ? t : ".";
22
22
  }
23
- function N(t) {
23
+ function A(t) {
24
24
  if (!t || typeof t != "object")
25
25
  return { ...i };
26
- const n = t, o = n.value ?? n.name ?? i.code, r = n.symbol ?? o;
26
+ const o = t, n = o.value ?? o.name ?? i.code, r = o.symbol ?? n;
27
27
  return {
28
- code: o,
28
+ code: n,
29
29
  symbol: r,
30
- alignment: l(n.alignment),
31
- decimalCount: _(n.decimalCount),
32
- decimalSeparator: A(n.decimalSeparator),
33
- thousandSeparator: I(n.thousandSeparator)
30
+ alignment: c(o.alignment),
31
+ decimalCount: I(o.decimalCount),
32
+ decimalSeparator: N(o.decimalSeparator),
33
+ thousandSeparator: _(o.thousandSeparator)
34
34
  };
35
35
  }
36
- function R(t) {
36
+ function L(t) {
37
37
  return t === "horizontal" || t === "list" ? "list" : "grid";
38
38
  }
39
- function b(t) {
40
- return c(t) || "mostPopular";
39
+ function R(t) {
40
+ return l(t) || "mostPopular";
41
41
  }
42
- function D(t, n, o) {
43
- const r = n.rowCount ?? t.cardsInRow ?? m, a = n.totalCount ?? (typeof t.size == "string" ? parseInt(t.size) : t.size) ?? 6;
42
+ function U(t, o, n) {
43
+ const r = o.rowCount ?? t.cardsInRow ?? m, u = o.totalCount ?? (typeof t.size == "string" ? parseInt(t.size) : t.size) ?? 6;
44
44
  return {
45
- recommendationId: o,
46
- strategy: b(t.strategy),
45
+ recommendationId: n,
46
+ strategy: R(t.strategy),
47
47
  productIds: (t.productIds ?? []).map((e) => String(e)),
48
- size: String(a),
48
+ size: String(u),
49
49
  shuffleProducts: !!t.shuffleProducts,
50
50
  language: t.language ?? "en_US",
51
- currency: N(t.currencySettings),
51
+ currency: A(t.currencySettings),
52
52
  filters: (t.filters ?? []).map((e) => ({ ...e })),
53
- layout: R(t.orientation ?? n.orientation),
53
+ layout: L(t.orientation ?? o.orientation),
54
54
  cardsInRow: r,
55
- mobileCardsInRow: u,
55
+ mobileCardsInRow: a,
56
56
  mobileLayoutEnabled: !1,
57
- previousMobileCardsInRow: u,
58
- columnSpacing: d,
59
- rowSpacing: S,
60
- mobileColumnSpacing: f,
57
+ previousMobileCardsInRow: a,
58
+ columnSpacing: S,
59
+ rowSpacing: f,
60
+ mobileColumnSpacing: d,
61
61
  mobileRowSpacing: p,
62
62
  omnibusPrice: { textBefore: "", textAfter: "" },
63
63
  omnibusDiscount: { textBefore: "", textAfter: "" },
64
+ // Preserve the legacy price-placement toggles. Absent legacy keys map to
65
+ // `false`, matching the legacy default (prices inline, original price not
66
+ // gated). New Guido blocks default differently (see DEFAULT_NODE_CONFIG).
67
+ priceMovedToNextLine: !!t.isPriceMovedToNextLine,
68
+ priceHideIfSameAsDiscounted: !!t.isPriceDeletedForZeroSale,
64
69
  configVersion: s
65
70
  };
66
71
  }
67
72
  export {
68
- N as mapCurrency,
69
- D as mapSettings
73
+ A as mapCurrency,
74
+ U as mapSettings
70
75
  };
@@ -1,34 +1,34 @@
1
- var k = Object.defineProperty;
2
- var B = (a, r, t) => r in a ? k(a, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[r] = t;
3
- var d = (a, r, t) => B(a, typeof r != "symbol" ? r + "" : r, t);
1
+ var B = Object.defineProperty;
2
+ var D = (a, c, t) => c in a ? B(a, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[c] = t;
3
+ var h = (a, c, t) => D(a, typeof c != "symbol" ? c + "" : c, t);
4
4
  import { BlockId as R } from "../../../enums/block.js";
5
5
  import { getMigrationBannerHtml as y } from "../../../utils/migrationBannerHtml.js";
6
- import { Block as D, BlockCompositionType as C, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- import { regenerateMobileProductRows as b } from "./controls/main/utils.js";
8
- import { ensureMobileCssRulesExist as p, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as A } from "./controls/mobileLayout/cssRules.js";
9
- import { RecommendationConfigService as c } from "./services/configService.js";
10
- import { useRecommendationExtensionStore as g } from "./store/recommendation.js";
11
- import { getDefaultTemplate as E } from "./templates/grid/template.js";
6
+ import { Block as b, BlockCompositionType as A, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
+ import { regenerateMobileProductRows as C } from "./controls/main/utils.js";
8
+ import { ensureMobileCssRulesExist as p, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as E } from "./controls/mobileLayout/cssRules.js";
9
+ import { RecommendationConfigService as s } from "./services/configService.js";
10
+ import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
11
+ import { getDefaultTemplate as S } from "./templates/grid/template.js";
12
12
  import { useRecommendationBlockWarning as M } from "./useRecommendationBlockWarning.js";
13
- const I = R.Recommendation, m = "recommendation-block-v2", u = "recommendation-id";
14
- let _ = !1;
15
- class H extends D {
13
+ const _ = R.Recommendation, m = "recommendation-block-v2", u = "recommendation-id", I = "hide-price";
14
+ let k = !1;
15
+ class P extends b {
16
16
  constructor() {
17
17
  super();
18
18
  /**
19
19
  * Stores the ID generated in getTemplate() so onCreated() can reuse it.
20
20
  * This avoids generating a new (different) ID in onCreated().
21
21
  */
22
- d(this, "_pendingBlockId", null);
22
+ h(this, "_pendingBlockId", null);
23
23
  }
24
24
  getId() {
25
- return I;
25
+ return _;
26
26
  }
27
27
  getIcon() {
28
28
  return "recommendation-icon";
29
29
  }
30
30
  getBlockCompositionType() {
31
- return C.CONTAINER;
31
+ return A.CONTAINER;
32
32
  }
33
33
  getName() {
34
34
  return this.api.translate("Recommendation Block");
@@ -40,7 +40,7 @@ class H extends D {
40
40
  }
41
41
  getSettingsPanelTitleHtml() {
42
42
  return y(
43
- I,
43
+ _,
44
44
  this.api.translate("Recommendation Block"),
45
45
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
46
46
  );
@@ -60,7 +60,7 @@ class H extends D {
60
60
  */
61
61
  getTemplate() {
62
62
  const t = this._generateNextId();
63
- return this._pendingBlockId = t, E(t);
63
+ return this._pendingBlockId = t, S(t);
64
64
  }
65
65
  /**
66
66
  * Called when a new block is dropped into the template
@@ -83,20 +83,20 @@ class H extends D {
83
83
  }
84
84
  const i = this._pendingBlockId ?? this._generateNextId();
85
85
  this._pendingBlockId = null, this._assignRecommendationId(t, i);
86
- const { config: n, wasFreshDrop: o } = c.initializeConfig(
86
+ const { config: n, wasFreshDrop: o } = s.initializeConfig(
87
87
  this.api,
88
88
  t,
89
89
  { recommendationId: i }
90
- ), s = g();
91
- if (s.setCurrentBlock(i), o) {
90
+ ), r = d();
91
+ if (r.setCurrentBlock(i), this._stampHidePrice(t, n.priceHideIfSameAsDiscounted), o) {
92
92
  p(this.api);
93
93
  const l = this._getBlockElement(t);
94
- l && (f(this.api, l, !0), b({
94
+ l && (f(this.api, l, !0), C({
95
95
  currentNode: t,
96
96
  documentModifier: this.api.getDocumentModifier()
97
97
  }));
98
98
  }
99
- s.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 }), this._warnIfMultipleBlocks();
99
+ r.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 }), this._warnIfMultipleBlocks();
100
100
  }
101
101
  /**
102
102
  * Called when the document changes or template is loaded
@@ -109,20 +109,20 @@ class H extends D {
109
109
  if (!(!t || !("getNodeConfig" in t))) {
110
110
  if (!this._getRecommendationId(t)) {
111
111
  const e = this._generateNextId();
112
- this._assignRecommendationId(t, e), c.hasConfig(t) && c.updateConfig(
112
+ this._assignRecommendationId(t, e), s.hasConfig(t) && s.updateConfig(
113
113
  this.api,
114
114
  t,
115
115
  { recommendationId: e },
116
116
  "Assign recommendation ID to legacy block"
117
117
  );
118
118
  }
119
- this._healLingeringDuplicate(t), c.needsMigration(t) && this._migrateFromLegacy(t);
119
+ this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
120
120
  try {
121
- _ || (p(this.api), _ = !0);
122
- const e = c.getConfig(t), i = this._getBlockElement(t);
121
+ k || (p(this.api), k = !0);
122
+ const e = s.getConfig(t), i = this._getBlockElement(t);
123
123
  if (i) {
124
124
  const n = !e.mobileLayoutEnabled;
125
- A(i) !== n && f(this.api, i, n);
125
+ E(i) !== n && f(this.api, i, n);
126
126
  }
127
127
  } catch {
128
128
  }
@@ -136,7 +136,7 @@ class H extends D {
136
136
  */
137
137
  onDelete(t) {
138
138
  const e = this._getRecommendationId(t);
139
- e && g().removeBlockState(e);
139
+ e && d().removeBlockState(e);
140
140
  }
141
141
  /**
142
142
  * Warns (dark advisory toaster) when the design holds more than one live
@@ -166,8 +166,8 @@ class H extends D {
166
166
  const e = this.api.getDocumentRoot();
167
167
  e && "querySelectorAll" in e && e.querySelectorAll(`.${m}`).forEach((n) => {
168
168
  if ("getAttribute" in n) {
169
- const o = n.getAttribute(u), s = o ? parseInt(o) : 0;
170
- s > t && (t = s);
169
+ const o = n.getAttribute(u), r = o ? parseInt(o) : 0;
170
+ r > t && (t = r);
171
171
  }
172
172
  });
173
173
  } catch {
@@ -201,13 +201,13 @@ class H extends D {
201
201
  const o = this._getBlockElement(t);
202
202
  if (!o)
203
203
  return;
204
- let s = -1;
204
+ let r = -1;
205
205
  for (let l = 0; l < n.length; l++)
206
206
  if (n[l] === o) {
207
- s = l;
207
+ r = l;
208
208
  break;
209
209
  }
210
- if (s <= 0)
210
+ if (r <= 0)
211
211
  return;
212
212
  this._reassignDuplicateId(t, e);
213
213
  } catch {
@@ -227,7 +227,7 @@ class H extends D {
227
227
  }
228
228
  /** Assigns a fresh id to a duplicated block and syncs DOM, node config and store. */
229
229
  _handleDuplicate(t, e) {
230
- const i = this._reassignDuplicateId(t, e), n = g();
230
+ const i = this._reassignDuplicateId(t, e), n = d();
231
231
  n.cloneBlockState(e, i), n.setCurrentBlock(i), this._warnIfMultipleBlocks();
232
232
  }
233
233
  /**
@@ -243,7 +243,7 @@ class H extends D {
243
243
  */
244
244
  _reassignDuplicateId(t, e) {
245
245
  const i = this._generateNextId(), n = this._getBlockElement(t);
246
- return this._assignRecommendationId(t, i), n && this._reassignInstanceClass(n, e, i), c.hasConfig(t) && c.updateConfig(
246
+ return this._assignRecommendationId(t, i), n && this._reassignInstanceClass(n, e, i), s.hasConfig(t) && s.updateConfig(
247
247
  this.api,
248
248
  t,
249
249
  { recommendationId: i },
@@ -260,8 +260,8 @@ class H extends D {
260
260
  _reassignInstanceClass(t, e, i) {
261
261
  if (!("getAttribute" in t))
262
262
  return;
263
- const n = `ins-recommendation-v3-block-${e}`, o = `ins-recommendation-v3-block-${i}`, s = this.api.getDocumentModifier();
264
- s.modifyHtml(t).removeClass(n).setClass(o), s.apply(new h(
263
+ const n = `ins-recommendation-v3-block-${e}`, o = `ins-recommendation-v3-block-${i}`, r = this.api.getDocumentModifier();
264
+ r.modifyHtml(t).removeClass(n).setClass(o), r.apply(new g(
265
265
  `Reassign recommendation instance class ${n} -> ${o}`
266
266
  ));
267
267
  }
@@ -276,7 +276,26 @@ class H extends D {
276
276
  if (!i)
277
277
  return;
278
278
  const n = this.api.getDocumentModifier();
279
- n.modifyHtml(i).setAttribute(u, e.toString()), n.apply(new h(`Assign recommendation ID ${e}`));
279
+ n.modifyHtml(i).setAttribute(u, e.toString()), n.apply(new g(`Assign recommendation ID ${e}`));
280
+ }
281
+ /**
282
+ * Stamps the `hide-price` attribute (read by email-service at send time) on
283
+ * the block element from the config flag.
284
+ */
285
+ _stampHidePrice(t, e) {
286
+ const i = this._getBlockElement(t);
287
+ i && this.api.getDocumentModifier().modifyHtml(i).setAttribute(I, String(e)).apply(new g("Stamp hide-price"));
288
+ }
289
+ /**
290
+ * Stamps `hide-price` from config only when the block lacks the attribute —
291
+ * heals templates saved before this feature without dirtying current ones.
292
+ */
293
+ _healHidePriceAttr(t) {
294
+ const e = this._getBlockElement(t);
295
+ if (!e || !("getAttribute" in e) || e.getAttribute(I) !== null)
296
+ return;
297
+ const { priceHideIfSameAsDiscounted: i } = s.getConfig(t);
298
+ this._stampHidePrice(t, i);
280
299
  }
281
300
  /**
282
301
  * Gets the recommendation-id from a block node
@@ -306,10 +325,10 @@ class H extends D {
306
325
  * Migrate configuration from legacy format
307
326
  */
308
327
  _migrateFromLegacy(t) {
309
- c.migrateFromDataAttributes(this.api, t);
328
+ s.migrateFromDataAttributes(this.api, t);
310
329
  }
311
330
  }
312
331
  export {
313
- I as BLOCK_ID,
314
- H as RecommendationBlock
332
+ _ as BLOCK_ID,
333
+ P as RecommendationBlock
315
334
  };
@@ -0,0 +1,16 @@
1
+ const e = `/*
2
+ * Editor-canvas-only styles (ExtensionBuilder.withPreviewStyles).
3
+ * Never reaches the exported email HTML — send-time behavior stays in email-service.
4
+ */
5
+
6
+ /* Hide-if-same: mirror the email-service rule in the canvas. The block-level
7
+ \`hide-price\` attr is the toggle; \`data-same-price\` is stamped per old-price
8
+ cell by the renderers / in-place price updates. Hiding the <p> (not the td)
9
+ keeps inline price columns from collapsing, matching the preview look. */
10
+ .recommendation-block-v2[hide-price="true"] .product-old-price[data-same-price="true"] p {
11
+ display: none;
12
+ }
13
+ `;
14
+ export {
15
+ e as default
16
+ };
@@ -1,34 +1,34 @@
1
- import { DEFAULT_COLUMN_SPACING as R, DEFAULT_ROW_SPACING as U, DEFAULT_MOBILE_ROW_SPACING as i, DEFAULT_MOBILE_COLUMN_SPACING as s, DEFAULT_MOBILE_CARDS_IN_ROW as o, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
2
- import { ATTR_PRODUCT_IMAGE as _, ATTR_PRODUCT_NAME as e, ATTR_PRODUCT_OLD_PRICE as t, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as I, ATTR_PRODUCT_BUTTON as n } from "./selectors.js";
3
- const O = {
1
+ import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
2
+ import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as i, ATTR_PRODUCT_BUTTON as I } from "./selectors.js";
3
+ const D = {
4
4
  code: "USD",
5
5
  symbol: "USD",
6
6
  alignment: "after",
7
7
  decimalCount: 2,
8
8
  decimalSeparator: ".",
9
9
  thousandSeparator: ","
10
- }, D = {
10
+ }, O = {
11
11
  textBefore: "",
12
12
  textAfter: ""
13
- }, A = {
13
+ }, a = {
14
14
  textBefore: "",
15
15
  textAfter: ""
16
- }, a = [
17
- _,
18
- e,
16
+ }, A = [
17
+ o,
19
18
  t,
19
+ _,
20
20
  T,
21
21
  r,
22
- I,
23
- n
24
- ], E = {
25
- [_]: !0,
26
- [e]: !0,
27
- [T]: !0,
22
+ i,
23
+ I
24
+ ], c = {
25
+ [o]: !0,
28
26
  [t]: !0,
27
+ [T]: !0,
28
+ [_]: !0,
29
29
  [r]: !1,
30
- [I]: !1,
31
- [n]: !0
30
+ [i]: !1,
31
+ [I]: !0
32
32
  }, l = {
33
33
  // Settings
34
34
  strategy: "mostPopular",
@@ -36,36 +36,45 @@ const O = {
36
36
  size: "6",
37
37
  shuffleProducts: !1,
38
38
  language: "en_US",
39
- currency: O,
39
+ currency: D,
40
40
  filters: [],
41
41
  // Layout
42
42
  layout: "grid",
43
43
  cardsInRow: C,
44
- mobileCardsInRow: o,
44
+ mobileCardsInRow: e,
45
45
  mobileLayoutEnabled: !1,
46
- previousMobileCardsInRow: o,
47
- columnSpacing: R,
48
- rowSpacing: U,
49
- mobileColumnSpacing: s,
50
- mobileRowSpacing: i,
46
+ previousMobileCardsInRow: e,
47
+ columnSpacing: n,
48
+ rowSpacing: s,
49
+ mobileColumnSpacing: U,
50
+ mobileRowSpacing: R,
51
51
  // Composition
52
- composition: a,
53
- visibility: E,
52
+ composition: A,
53
+ visibility: c,
54
54
  // Element settings
55
- omnibusPrice: D,
56
- omnibusDiscount: A,
55
+ omnibusPrice: O,
56
+ omnibusDiscount: a,
57
57
  textTrimming: !1,
58
+ // Price placement (block-level, affects all cards)
59
+ // Default ON = current stacked look, so existing templates are unaffected.
60
+ priceMovedToNextLine: !0,
61
+ // Default OFF: the original price always shows; the user opts in to hide it
62
+ // when it equals the sale price. Mirrors email-service's `hide-price` default
63
+ // of "false" (the actual hiding happens server-side at send).
64
+ priceHideIfSameAsDiscounted: !1,
58
65
  // Meta
66
+ // Version NOT bumped: mergeWithDefaults() backfills the two new fields from
67
+ // defaults, so no data transform (and no needsMigration trigger) is required.
59
68
  configVersion: 1,
60
69
  recommendationId: 0
61
70
  }, N = [11, 12], m = 1;
62
71
  export {
63
72
  m as CURRENT_CONFIG_VERSION,
64
- a as DEFAULT_COMPOSITION,
65
- O as DEFAULT_CURRENCY,
73
+ A as DEFAULT_COMPOSITION,
74
+ D as DEFAULT_CURRENCY,
66
75
  l as DEFAULT_NODE_CONFIG,
67
- A as DEFAULT_OMNIBUS_DISCOUNT,
68
- D as DEFAULT_OMNIBUS_PRICE,
69
- E as DEFAULT_VISIBILITY,
76
+ a as DEFAULT_OMNIBUS_DISCOUNT,
77
+ O as DEFAULT_OMNIBUS_PRICE,
78
+ c as DEFAULT_VISIBILITY,
70
79
  N as EXCLUDED_ALGORITHM_IDS
71
80
  };
@@ -1,11 +1,11 @@
1
- const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", t = ".ins-recommendation-desktop-container", o = ".ins-recommendation-mobile-container", n = ".ins-recommendation-mobile-row", r = "reco-v3-button", _ = {
1
+ const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", n = ".ins-recommendation-mobile-container", t = ".ins-recommendation-mobile-row", r = "reco-v3-button", _ = {
2
2
  CURRENCY: "currency",
3
3
  SYMBOL: "currency-symbol",
4
4
  ALIGNMENT: "currency-alignment",
5
5
  THOUSAND_SEPARATOR: "currency-thousand-separator",
6
6
  DECIMAL_SEPARATOR: "currency-decimal-separator",
7
7
  DECIMAL_COUNT: "currency-decimal-count"
8
- }, R = "productImage", e = "productName", O = "productPrice", s = "productOldPrice", E = "productOmnibusPrice", i = "productOmnibusDiscount", C = "productButton", A = "customAttr:", u = "data-custom-attributes", a = "product-attr", m = "product_attribute.", U = /* @__PURE__ */ new Set([
8
+ }, R = "productImage", e = "productName", O = "productPrice", s = "productOldPrice", i = "productOmnibusPrice", C = "productOmnibusDiscount", E = "productButton", A = "customAttr:", u = "data-custom-attributes", m = "product-attr", a = /* @__PURE__ */ new Set([
9
9
  "name",
10
10
  // productName
11
11
  "price",
@@ -24,21 +24,20 @@ const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container
24
24
  export {
25
25
  A as ATTR_CUSTOM_PREFIX,
26
26
  u as ATTR_DATA_CUSTOM_ATTRIBUTES,
27
- a as ATTR_PRODUCT_ATTR,
28
- C as ATTR_PRODUCT_BUTTON,
27
+ m as ATTR_PRODUCT_ATTR,
28
+ E as ATTR_PRODUCT_BUTTON,
29
29
  R as ATTR_PRODUCT_IMAGE,
30
30
  e as ATTR_PRODUCT_NAME,
31
31
  s as ATTR_PRODUCT_OLD_PRICE,
32
- i as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
33
- E as ATTR_PRODUCT_OMNIBUS_PRICE,
32
+ C as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
33
+ i as ATTR_PRODUCT_OMNIBUS_PRICE,
34
34
  O as ATTR_PRODUCT_PRICE,
35
35
  T as BLOCK_ROOT_SELECTOR,
36
- U as BUILT_IN_DEFAULT_ATTRIBUTES,
36
+ a as BUILT_IN_DEFAULT_ATTRIBUTES,
37
37
  c as CONTAINER_SELECTOR,
38
38
  r as CSS_CLASS_RECO_BUTTON,
39
39
  _ as CURRENCY_ATTR,
40
- t as DESKTOP_CONTAINER_SELECTOR,
41
- o as MOBILE_CONTAINER_SELECTOR,
42
- n as MOBILE_ROW_SELECTOR,
43
- m as PRODUCT_ATTRIBUTE_PREFIX
40
+ o as DESKTOP_CONTAINER_SELECTOR,
41
+ n as MOBILE_CONTAINER_SELECTOR,
42
+ t as MOBILE_ROW_SELECTOR
44
43
  };