@useinsider/guido 3.17.0-beta.77567eb → 3.17.0-beta.978ff7e

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 (36) hide show
  1. package/dist/composables/useStripo.js +14 -14
  2. package/dist/config/migrator/index.js +9 -8
  3. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  4. package/dist/config/migrator/recommendation/extractors.js +29 -24
  5. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  6. package/dist/config/migrator/recommendationMigrator.js +30 -25
  7. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  8. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  9. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  10. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +19 -17
  11. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +34 -28
  12. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +310 -238
  13. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +9 -8
  14. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  15. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  16. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  17. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  18. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  19. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  20. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  21. package/dist/package.json.js +1 -1
  22. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  23. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  24. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  25. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  26. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  27. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  28. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
  29. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  30. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  31. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  32. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  33. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  34. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  35. package/dist/static/styles/customEditorStyle.css.js +3 -1
  36. package/package.json +2 -2
@@ -11,9 +11,9 @@ import { CurrencyControl as R } from "./currency.js";
11
11
  import { CURRENCY_CONTROL_ID as ot } from "./currency.js";
12
12
  import { FiltersControl as I } from "./filters.js";
13
13
  import { FILTERS_CONTROL_ID as nt } from "./filters.js";
14
- import { LayoutOrientationControl as _ } from "./layoutOrientation.js";
14
+ import { LayoutOrientationControl as b } from "./layoutOrientation.js";
15
15
  import { LAYOUT_ORIENTATION_CONTROL_ID as st } from "./layoutOrientation.js";
16
- import { LocaleControl as b } from "./locale.js";
16
+ import { LocaleControl as _ } from "./locale.js";
17
17
  import { LOCALE_CONTROL_ID as lt } from "./locale.js";
18
18
  import { PricePlacementControl as T } from "./pricePlacement.js";
19
19
  import { PRICE_PLACEMENT_CONTROL_ID as ut } from "./pricePlacement.js";
@@ -24,7 +24,7 @@ import { PRODUCT_LAYOUT_CONTROL_ID as Ct } from "./productLayout.js";
24
24
  import { ShuffleControl as S } from "./shuffle.js";
25
25
  import { SHUFFLE_CONTROL_ID as pt } from "./shuffle.js";
26
26
  import { setCurrencyAttributes as L, getBlockElement as k, isPartnerManagedBlock as D, updateProductContentInPlace as E, regenerateProductRowsWithStyles as A } from "./utils.js";
27
- import { adjustProductsToSize as yt, formatProductPrice as Nt, getCardComposition as Rt, getCurrentLayout as It, regenerateMobileProductRows as _t, updatePricesInPlace as bt, updateSingleProductContent as Tt } from "./utils.js";
27
+ import { adjustProductsToSize as yt, formatProductPrice as Nt, getCardComposition as Rt, getCurrentLayout as It, getMainContainerTbody as bt, regenerateMobileProductRows as _t, updatePricesInPlace as Tt, updateSingleProductContent as Ot } from "./utils.js";
28
28
  import { useDebounceFn as m } from "../../../../../node_modules/@vueuse/shared/index.js";
29
29
  const v = "recommendation-id", w = "ui-elements-recommendation-block";
30
30
  class Q extends g {
@@ -81,7 +81,7 @@ class Q extends g {
81
81
  return w;
82
82
  }
83
83
  getTemplate() {
84
- return this.algorithmControl = new N(), this.localeControl = new b(), this.currencyControl = new R(), this.productCountControl = new O(), this.productLayoutControl = new P(), this.filtersControl = new I(), this.shuffleControl = new S(), this.pricePlacementControl = new T(), this.layoutOrientationControl = new _(), [
84
+ return this.algorithmControl = new N(), this.localeControl = new _(), this.currencyControl = new R(), this.productCountControl = new O(), this.productLayoutControl = new P(), this.filtersControl = new I(), this.shuffleControl = new S(), this.pricePlacementControl = new T(), this.layoutOrientationControl = new b(), [
85
85
  this.algorithmControl,
86
86
  this.localeControl,
87
87
  this.currencyControl,
@@ -365,8 +365,8 @@ export {
365
365
  I as FiltersControl,
366
366
  st as LAYOUT_ORIENTATION_CONTROL_ID,
367
367
  lt as LOCALE_CONTROL_ID,
368
- _ as LayoutOrientationControl,
369
- b as LocaleControl,
368
+ b as LayoutOrientationControl,
369
+ _ as LocaleControl,
370
370
  ut as PRICE_PLACEMENT_CONTROL_ID,
371
371
  ht as PRODUCT_COUNT_CONTROL_ID,
372
372
  Ct as PRODUCT_LAYOUT_CONTROL_ID,
@@ -381,11 +381,12 @@ export {
381
381
  k as getBlockElement,
382
382
  Rt as getCardComposition,
383
383
  It as getCurrentLayout,
384
+ bt as getMainContainerTbody,
384
385
  D as isPartnerManagedBlock,
385
386
  _t as regenerateMobileProductRows,
386
387
  A as regenerateProductRowsWithStyles,
387
388
  L as setCurrencyAttributes,
388
- bt as updatePricesInPlace,
389
+ Tt as updatePricesInPlace,
389
390
  E as updateProductContentInPlace,
390
- Tt as updateSingleProductContent
391
+ Ot as updateSingleProductContent
391
392
  };
@@ -438,6 +438,7 @@ export {
438
438
  C as getBlockElement,
439
439
  U as getCardComposition,
440
440
  P as getCurrentLayout,
441
+ oe as getMainContainerTbody,
441
442
  ee as isPartnerManagedBlock,
442
443
  Pe as regenerateMobileProductRows,
443
444
  Te as regenerateProductRowsWithStyles,
@@ -0,0 +1,44 @@
1
+ import { createPaddingsControl as r, createTextBackgroundColorControl as T, createTextFontFamilyControl as e, createTextStyleControl as l, createTextSizeControl as C, createTextColorControl as c, createTextAlignControl as I } from "../../../controlFactories.js";
2
+ import { RecommendationBlockId as o } from "../../constants/blockIds.js";
3
+ import { RecommendationControlId as t } from "../../constants/controlIds.js";
4
+ import { BLOCK_ROOT_SELECTOR as n } from "../../constants/selectors.js";
5
+ const L = I(
6
+ t.TITLE_ALIGN,
7
+ o.TITLE,
8
+ n
9
+ ), a = c(
10
+ t.TITLE_COLOR,
11
+ o.TITLE,
12
+ n
13
+ ), i = C(
14
+ t.TITLE_SIZE,
15
+ o.TITLE,
16
+ n
17
+ ), E = l(
18
+ t.TITLE_STYLE,
19
+ o.TITLE,
20
+ n
21
+ ), m = e(
22
+ t.TITLE_FONT_FAMILY,
23
+ o.TITLE,
24
+ n
25
+ ), s = T(
26
+ t.TITLE_BACKGROUND,
27
+ o.TITLE,
28
+ n
29
+ ), d = r(
30
+ t.TITLE_PADDINGS,
31
+ o.TITLE,
32
+ n
33
+ ), x = {
34
+ align: L,
35
+ color: a,
36
+ size: i,
37
+ style: E,
38
+ fontFamily: m,
39
+ background: s,
40
+ paddings: d
41
+ };
42
+ export {
43
+ x as TitleControls
44
+ };
@@ -5,23 +5,24 @@ import { RecommendationBlockControl as i } from "./controls/main/index.js";
5
5
  import "./constants/selectors.js";
6
6
  import "./store/recommendation.js";
7
7
  import "./utils/captureStyleTemplates.js";
8
- import { NameControls as e } from "./controls/name/index.js";
9
- import { PriceControls as l } from "./controls/price/index.js";
10
- import { OldPriceControls as s } from "./controls/oldPrice/index.js";
11
- import { OmnibusPriceControls as p } from "./controls/omnibusPrice/index.js";
12
- import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
13
- import { ButtonControls as c } from "./controls/button/index.js";
14
- import { ImageControls as C } from "./controls/image/index.js";
15
- import { CustomAttributeControls as f } from "./controls/customAttribute/index.js";
16
- import { SpacingControl as d } from "./controls/spacing/index.js";
17
- import { BlockBackgroundColorControl as u } from "./controls/blockBackground/index.js";
18
- import { CardBackgroundColorControl as g } from "./controls/cardBackground/index.js";
19
- import { RecommendationCardCompositionControl as y } from "./controls/cardComposition/index.js";
20
- import { SyncInfoMessageControl as B } from "./controls/syncInfoMessage.js";
21
- import { RecommendationIconsRegistry as P } from "./iconsRegistry.js";
22
- import R from "./recommendation.css.js";
23
- import { SettingsPanel as S } from "./settingsPanel.js";
24
- const k = [
8
+ import { TitleControls as e } from "./controls/title/index.js";
9
+ import { NameControls as l } from "./controls/name/index.js";
10
+ import { PriceControls as s } from "./controls/price/index.js";
11
+ import { OldPriceControls as p } from "./controls/oldPrice/index.js";
12
+ import { OmnibusPriceControls as a } from "./controls/omnibusPrice/index.js";
13
+ import { OmnibusDiscountControls as c } from "./controls/omnibusDiscount/index.js";
14
+ import { ButtonControls as C } from "./controls/button/index.js";
15
+ import { ImageControls as f } from "./controls/image/index.js";
16
+ import { CustomAttributeControls as d } from "./controls/customAttribute/index.js";
17
+ import { SpacingControl as u } from "./controls/spacing/index.js";
18
+ import { BlockBackgroundColorControl as g } from "./controls/blockBackground/index.js";
19
+ import { CardBackgroundColorControl as y } from "./controls/cardBackground/index.js";
20
+ import { RecommendationCardCompositionControl as B } from "./controls/cardComposition/index.js";
21
+ import { SyncInfoMessageControl as P } from "./controls/syncInfoMessage.js";
22
+ import { RecommendationIconsRegistry as R } from "./iconsRegistry.js";
23
+ import S from "./recommendation.css.js";
24
+ import { SettingsPanel as k } from "./settingsPanel.js";
25
+ const w = [
25
26
  e,
26
27
  l,
27
28
  s,
@@ -29,21 +30,22 @@ const k = [
29
30
  a,
30
31
  c,
31
32
  C,
32
- f
33
- ], w = [
33
+ f,
34
+ d
35
+ ], b = [
34
36
  i,
35
- u,
36
37
  g,
37
- d,
38
38
  y,
39
- B
40
- ], b = [
41
- ...w,
42
- ...k.flatMap((o) => Object.values(o))
43
- ], W = b.reduce(
39
+ u,
40
+ B,
41
+ P
42
+ ], v = [
43
+ ...b,
44
+ ...w.flatMap((o) => Object.values(o))
45
+ ], Y = v.reduce(
44
46
  (o, r) => o.addControl(r),
45
- new t().addBlock(m).withSettingsPanelRegistry(S)
46
- ).addStyles(R).withPreviewStyles(n).withIconsRegistry(P).build();
47
+ new t().addBlock(m).withSettingsPanelRegistry(k)
48
+ ).addStyles(S).withPreviewStyles(n).withIconsRegistry(R).build();
47
49
  export {
48
- W as default
50
+ Y as default
49
51
  };
@@ -3,9 +3,10 @@ import { BLOCK_ID as R } from "./block.js";
3
3
  import { RecommendationBlockId as S } from "./constants/blockIds.js";
4
4
  import { RecommendationControlId as T } from "./constants/controlIds.js";
5
5
  import "./constants/selectors.js";
6
- import { CONTROL_BLOCK_ID as U } from "./controls/main/index.js";
6
+ import { CONTROL_BLOCK_ID as L } from "./controls/main/index.js";
7
7
  import "./store/recommendation.js";
8
8
  import "./utils/captureStyleTemplates.js";
9
+ import "./controls/title/index.js";
9
10
  import "./controls/name/index.js";
10
11
  import "./controls/price/index.js";
11
12
  import "./controls/oldPrice/index.js";
@@ -15,7 +16,7 @@ import "./controls/button/index.js";
15
16
  import "./controls/image/index.js";
16
17
  import { SPACING_CONTROL_ID as A } from "./controls/spacing/index.js";
17
18
  import "./controls/blockBackground/index.js";
18
- import { CARD_BACKGROUND_COLOR_CONTROL_ID as L } from "./controls/cardBackground/index.js";
19
+ import { CARD_BACKGROUND_COLOR_CONTROL_ID as U } from "./controls/cardBackground/index.js";
19
20
  import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
20
21
  import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
21
22
  class s extends E {
@@ -24,7 +25,7 @@ class s extends E {
24
25
  new _(
25
26
  I.SETTINGS,
26
27
  [
27
- U,
28
+ L,
28
29
  C.EXTERNAL_INDENTS
29
30
  ]
30
31
  ),
@@ -32,7 +33,7 @@ class s extends E {
32
33
  I.STYLES,
33
34
  [
34
35
  T.BLOCK_BACKGROUND,
35
- L,
36
+ U,
36
37
  A
37
38
  ]
38
39
  ),
@@ -42,6 +43,24 @@ class s extends E {
42
43
  D
43
44
  ]
44
45
  ).withLabel(this.api.translate("Card Composition"))
46
+ ], O[S.TITLE] = [
47
+ new _(
48
+ I.SETTINGS,
49
+ [
50
+ T.TITLE_STYLE,
51
+ T.TITLE_ALIGN,
52
+ T.TITLE_PADDINGS
53
+ ]
54
+ ),
55
+ new _(
56
+ I.STYLES,
57
+ [
58
+ T.TITLE_BACKGROUND,
59
+ T.TITLE_FONT_FAMILY,
60
+ T.TITLE_SIZE,
61
+ T.TITLE_COLOR
62
+ ]
63
+ )
45
64
  ], O[S.NAME] = [
46
65
  new _(
47
66
  I.SETTINGS,
@@ -1,6 +1,6 @@
1
1
  import { ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_OLD_PRICE as O } from "../../constants/selectors.js";
2
2
  import { DEFAULT_PRODUCTS_PER_ROW as w } from "../../constants/layout.js";
3
- import { getDefaultProducts as A, DEFAULTS as g, createBlockTemplate as U, buildSpacer as h, DEFAULT_CARD_COMPOSITION as Y, buildElementRenderer as B, resolveInlinePriceOrder as F, buildCellOptions as I, DEFAULT_CARD_VISIBILITY as W } from "../utils.js";
3
+ import { createBlockTemplate as A, getDefaultProducts as g, DEFAULTS as U, buildSpacer as h, DEFAULT_CARD_COMPOSITION as Y, buildElementRenderer as B, resolveInlinePriceOrder as F, buildCellOptions as I, DEFAULT_CARD_VISIBILITY as W } from "../utils.js";
4
4
  import { DEFAULT_CELL_PADDING as k, renderInlineGridPriceCell as H, buildFillerCell as x, gridElementRenderer as y } from "./elementRenderer.js";
5
5
  const G = `
6
6
  <tr class="recommendation-product-row">
@@ -69,8 +69,8 @@ function M(t, r, o, e = {}, c = {}) {
69
69
  );
70
70
  }
71
71
  function Q(t) {
72
- const r = t ? `ins-recommendation-v3-block-${t}` : void 0, o = U("grid", r), e = A(), c = M(e, w);
73
- return o.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
72
+ const r = t ? `ins-recommendation-v3-block-${t}` : void 0, o = A("grid", r), e = g(), c = M(e, w);
73
+ return o.replace("{-{-TITLE-}-}", U.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
74
74
  }
75
75
  export {
76
76
  Q as getDefaultTemplate,
@@ -0,0 +1,33 @@
1
+ import { RecommendationBlockId as r } from "../constants/blockIds.js";
2
+ import { DEFAULT_ROW_SPACING as l } from "../constants/layout.js";
3
+ import { CSS_CLASS_ATTRIBUTE_ROW as d, ATTR_RECOMMENDATION_TITLE as n, ATTR_DATA_VISIBILITY as A, CSS_CLASS_TITLE_CELL as _, CSS_CLASS_SPACER as c } from "../constants/selectors.js";
4
+ const a = "You May Also Like!", i = '<p style="font-size: 28px; color: #333333;"><strong>{-{-TITLE-}-}</strong></p>';
5
+ function E(s = i, t = !0, T = l) {
6
+ const e = `class="${d}" data-attribute-type="${n}" ${A}="${t ? "1" : "0"}"`, o = t ? "" : ' style="display: none;"';
7
+ return `
8
+ <tr ${e}${o}>
9
+ <td>
10
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
11
+ <tbody>
12
+ <tr>
13
+ <td
14
+ class="esd-block-text ${_} es-p10t es-p10b es-p20l es-p20r"
15
+ align="center"
16
+ esd-extension-block-id="${r.TITLE}">
17
+ ${s}
18
+ </td>
19
+ </tr>
20
+ </tbody>
21
+ </table>
22
+ </td>
23
+ </tr>
24
+ <tr ${e}${o}>
25
+ <td class="${c}" style="height: ${T}px;"></td>
26
+ </tr>
27
+ `;
28
+ }
29
+ export {
30
+ i as DEFAULT_TITLE_PARAGRAPH,
31
+ a as DEFAULT_TITLE_TEXT,
32
+ E as buildTitleRows
33
+ };
@@ -1,8 +1,9 @@
1
- import { ATTR_PRODUCT_PRICE as l, ATTR_PRODUCT_OLD_PRICE as a, ATTR_CUSTOM_PREFIX as T, ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as C, ATTR_PRODUCT_OMNIBUS_PRICE as _, ATTR_PRODUCT_OMNIBUS_DISCOUNT as p, ATTR_PRODUCT_BUTTON as y, PRODUCT_ATTRIBUTE_PREFIX as I } from "../constants/selectors.js";
1
+ import { ATTR_PRODUCT_PRICE as l, ATTR_PRODUCT_OLD_PRICE as a, ATTR_CUSTOM_PREFIX as T, ATTR_PRODUCT_IMAGE as b, ATTR_PRODUCT_NAME as _, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_BUTTON as p, PRODUCT_ATTRIBUTE_PREFIX as I } from "../constants/selectors.js";
2
2
  import { useRecommendationExtensionStore as L } from "../store/recommendation.js";
3
- import { compositionKeyToProductAttr as A, isDefaultProductAttr as b, bareAttributeName as S, findFilterByBareName as $, productAttrToCompositionKey as h } from "../utils/compositionKeys.js";
3
+ import { compositionKeyToProductAttr as y, isDefaultProductAttr as f, bareAttributeName as S, findFilterByBareName as $, productAttrToCompositionKey as P } from "../utils/compositionKeys.js";
4
4
  import { formatPrice as B } from "../utils/priceFormatter.js";
5
- function k() {
5
+ import { buildTitleRows as k } from "./titleRows.js";
6
+ function x() {
6
7
  const t = L(), { currencySettings: e } = t.recommendationConfigs;
7
8
  return {
8
9
  code: e.value,
@@ -13,17 +14,17 @@ function k() {
13
14
  thousandSeparator: e.thousandSeparator
14
15
  };
15
16
  }
16
- function f(t, e = "price") {
17
- const o = k(), n = t[e], c = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
17
+ function m(t, e = "price") {
18
+ const o = x(), n = t[e], c = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
18
19
  return B({
19
20
  price: c,
20
21
  currency: o
21
22
  });
22
23
  }
23
24
  function q(t) {
24
- return f(t, "price") === f(t, "original_price");
25
+ return m(t, "price") === m(t, "original_price");
25
26
  }
26
- function x(t) {
27
+ function N(t) {
27
28
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
28
29
  }
29
30
  function J(t) {
@@ -34,115 +35,114 @@ function J(t) {
34
35
  skip: n ? l : a
35
36
  };
36
37
  }
37
- function N(t) {
38
+ function F(t) {
38
39
  const e = Array.isArray(t) ? t[t.length - 1] : t;
39
40
  if (typeof e == "string")
40
41
  return e;
41
42
  if (typeof e == "number")
42
43
  return String(e);
43
44
  }
44
- function w(t, e) {
45
+ function v(t, e) {
45
46
  var o;
46
47
  return ((o = $(t, e)) == null ? void 0 : o.type) === "defaultAttribute";
47
48
  }
48
- function F(t, e) {
49
- return w(t, e) ? t : `${I}${t}`;
49
+ function w(t, e) {
50
+ return v(t, e) ? t : `${I}${t}`;
50
51
  }
51
52
  function Q(t) {
52
- return h(t);
53
+ return P(t);
53
54
  }
54
- const v = Symbol("customCellHtml");
55
+ const M = Symbol("customCellHtml");
55
56
  function Z(t, e, o = {}) {
56
- const n = t[v];
57
+ const n = t[M];
57
58
  if (!n)
58
59
  return { ...t };
59
60
  const c = { ...t };
60
- return e.filter((s) => s.startsWith(T) && !c[s]).forEach((s) => {
61
- const i = A(s), r = b(i) ? F(i, o) : i, u = S(r), R = x(u), D = b(r);
62
- c[s] = (d, U) => {
61
+ return e.filter((i) => i.startsWith(T) && !c[i]).forEach((i) => {
62
+ const s = y(i), r = f(s) ? w(s, o) : s, u = S(r), h = N(u), D = f(r);
63
+ c[i] = (d, U) => {
63
64
  var g;
64
- const E = D ? d[u] : (g = d.product_attributes) == null ? void 0 : g[u], O = N(E) ?? R;
65
- return n(r, O, U);
65
+ const O = D ? d[u] : (g = d.product_attributes) == null ? void 0 : g[u], E = F(O) ?? h;
66
+ return n(r, E, U);
66
67
  };
67
68
  }), c;
68
69
  }
69
70
  function tt(t, e, o = []) {
70
- const n = t.startsWith(T) ? h(S(A(t))) : t, s = n !== t && !o.includes(n) ? n : t, i = (r) => (r == null ? void 0 : r[t]) ?? (r == null ? void 0 : r[s]);
71
+ const n = t.startsWith(T) ? P(S(y(t))) : t, i = n !== t && !o.includes(n) ? n : t, s = (r) => (r == null ? void 0 : r[t]) ?? (r == null ? void 0 : r[i]);
71
72
  return {
72
73
  cellPadding: e.cellPadding,
73
74
  cardBackgroundColor: e.cardBackgroundColor,
74
- cellBackgroundColor: i(e.cellBackgroundColors),
75
- cellAlignment: i(e.cellAlignments),
76
- cellClasses: i(e.cellClasses),
77
- omnibusText: i(e.omnibusTexts),
78
- styleTemplate: i(e.styleTemplates)
75
+ cellBackgroundColor: s(e.cellBackgroundColors),
76
+ cellAlignment: s(e.cellAlignments),
77
+ cellClasses: s(e.cellClasses),
78
+ omnibusText: s(e.omnibusTexts),
79
+ styleTemplate: s(e.styleTemplates)
79
80
  };
80
81
  }
81
82
  const et = {
82
83
  TITLE: "You May Also Like!"
83
84
  }, ot = [
84
- m,
85
- C,
85
+ b,
86
+ _,
86
87
  a,
87
88
  l,
88
- _,
89
- p,
90
- y
89
+ C,
90
+ A,
91
+ p
91
92
  ], nt = {
92
- [m]: !0,
93
- [C]: !0,
93
+ [b]: !0,
94
+ [_]: !0,
94
95
  [l]: !0,
95
96
  [a]: !0,
96
- [_]: !1,
97
- [p]: !1,
98
- [y]: !0
99
- }, M = 10;
100
- function W(t = M) {
97
+ [C]: !1,
98
+ [A]: !1,
99
+ [p]: !0
100
+ }, W = 10;
101
+ function rt(t = W) {
101
102
  return `
102
103
  <tr>
103
104
  <td class="spacer" style="height: ${t}px;"></td>
104
105
  </tr>
105
106
  `;
106
107
  }
107
- const H = W();
108
- function V(t, e) {
108
+ function H(t, e) {
109
109
  return e ? e.pStyle ?? "" : t;
110
110
  }
111
- function rt(t, e, o) {
112
- const n = V(e.pStyle, o), c = o ? o.openTags ?? "" : e.openTags, s = o ? o.closeTags ?? "" : e.closeTags;
113
- return `<p contenteditable="false" style="${n}">${c}${t}${s}</p>`;
111
+ function it(t, e, o) {
112
+ const n = H(e.pStyle, o), c = o ? o.openTags ?? "" : e.openTags, i = o ? o.closeTags ?? "" : e.closeTags;
113
+ return `<p contenteditable="false" style="${n}">${c}${t}${i}</p>`;
114
114
  }
115
115
  function st(t, e) {
116
116
  const o = [];
117
117
  return t && o.push(t), e && o.push(`background-color: ${e};`), o.join(" ");
118
118
  }
119
- function Y(t) {
119
+ function V(t) {
120
120
  return t ? ` background-color: ${t};` : "";
121
121
  }
122
- function it(t) {
123
- const e = Y(t);
122
+ function ct(t) {
123
+ const e = V(t);
124
124
  return e ? ` style="${e.trim()}"` : "";
125
125
  }
126
- function ct(t, e = "") {
126
+ function lt(t, e = "") {
127
127
  return {
128
128
  before: (t == null ? void 0 : t.before) ?? e,
129
129
  after: (t == null ? void 0 : t.after) ?? ""
130
130
  };
131
131
  }
132
- function lt(t, e) {
132
+ function at(t, e) {
133
133
  return `${(e == null ? void 0 : e.openTags) ?? ""}${t}${(e == null ? void 0 : e.closeTags) ?? ""}`;
134
134
  }
135
- function at(t) {
135
+ function ut(t) {
136
136
  return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
137
137
  }
138
- const ut = "display: block; max-width: 100%; height: auto;", dt = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", gt = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0;", P = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
139
- function bt(t) {
140
- return !t || typeof t != "string" || t.trim() === "" ? P : t.startsWith("http://") ? t.replace("http://", "https://") : t;
138
+ const dt = "display: block; max-width: 100%; height: auto;", gt = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", ft = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0;", R = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
139
+ function mt(t) {
140
+ return !t || typeof t != "string" || t.trim() === "" ? R : t.startsWith("http://") ? t.replace("http://", "https://") : t;
141
141
  }
142
- function G(t) {
142
+ function Y(t) {
143
143
  return {
144
144
  name: "Product Name",
145
- image_url: P,
145
+ image_url: R,
146
146
  price: { USD: 18 },
147
147
  original_price: { USD: 20 },
148
148
  discount: { USD: 2 },
@@ -154,19 +154,20 @@ function G(t) {
154
154
  category: []
155
155
  };
156
156
  }
157
- function ft(t = 6) {
157
+ function Tt(t = 6) {
158
158
  return Array.from(
159
159
  { length: t },
160
- (e, o) => G(String(o + 1))
160
+ (e, o) => Y(String(o + 1))
161
161
  );
162
162
  }
163
- function Tt(t = "grid", e) {
163
+ function bt(t = "grid", e) {
164
164
  const o = t === "list" ? `
165
- data-layout="list"` : "", n = e ? ` ${e}` : "";
165
+ data-layout="list"` : "", n = e ? ` ${e}` : "", i = `recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${n}`, s = t === "list" ? "" : `
166
+ {-{-MOBILE_PRODUCT_ROWS-}-}`, r = t === "list" ? ' style="display: none;"' : "";
166
167
  return `
167
168
  <td
168
169
  align="left"
169
- class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${n}`}"${o}>
170
+ class="${i}"${o}>
170
171
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
171
172
  <tr>
172
173
  <td align="center">
@@ -177,28 +178,7 @@ function Tt(t = "grid", e) {
177
178
  cellspacing="0"
178
179
  border="0">
179
180
  <tbody>
180
- <tr>
181
- <td>
182
- <table
183
- width="100%"
184
- cellpadding="0"
185
- cellspacing="0"
186
- border="0">
187
- <tbody>
188
- <tr>
189
- <td
190
- class="esd-block-text es-p10t es-p10b es-p20l es-p20r"
191
- align="center">
192
- <p style="font-size: 28px; color: #333333;">
193
- <strong>{-{-TITLE-}-}</strong>
194
- </p>
195
- </td>
196
- </tr>
197
- </tbody>
198
- </table>
199
- </td>
200
- </tr>
201
- ${H}
181
+ ${k()}
202
182
  <tr>
203
183
  <td>
204
184
  <table
@@ -213,7 +193,7 @@ function Tt(t = "grid", e) {
213
193
  </table>
214
194
  </td>
215
195
  </tr>
216
- <tr class="ins-recommendation-mobile-row"${t === "list" ? ' style="display: none;"' : ""}>
196
+ <tr class="ins-recommendation-mobile-row"${r}>
217
197
  <td>
218
198
  <table
219
199
  class="ins-recommendation-product-container
@@ -223,8 +203,7 @@ function Tt(t = "grid", e) {
223
203
  cellspacing="0"
224
204
  border="0"
225
205
  style="display: none;"
226
- >${t === "list" ? "" : `
227
- {-{-MOBILE_PRODUCT_ROWS-}-}`}
206
+ >${s}
228
207
  </table>
229
208
  </td>
230
209
  </tr>
@@ -237,37 +216,36 @@ function Tt(t = "grid", e) {
237
216
  `;
238
217
  }
239
218
  export {
240
- v as CUSTOM_CELL_HTML,
219
+ M as CUSTOM_CELL_HTML,
241
220
  et as DEFAULTS,
242
- gt as DEFAULT_BUTTON_ANCHOR_STYLE,
243
- dt as DEFAULT_BUTTON_BORDER_STYLE,
221
+ ft as DEFAULT_BUTTON_ANCHOR_STYLE,
222
+ gt as DEFAULT_BUTTON_BORDER_STYLE,
244
223
  ot as DEFAULT_CARD_COMPOSITION,
245
224
  nt as DEFAULT_CARD_VISIBILITY,
246
- ut as DEFAULT_IMG_STYLE,
247
- M as DEFAULT_ROW_SPACING_PX,
248
- P as PLACEHOLDER_IMAGE,
249
- Y as bgColorFragment,
225
+ dt as DEFAULT_IMG_STYLE,
226
+ W as DEFAULT_ROW_SPACING_PX,
227
+ R as PLACEHOLDER_IMAGE,
228
+ V as bgColorFragment,
250
229
  tt as buildCellOptions,
251
230
  Z as buildElementRenderer,
252
- W as buildSpacer,
253
- it as cellBgStyleAttr,
254
- Tt as createBlockTemplate,
255
- f as formatProductPrice,
256
- k as getCurrentCurrencyConfig,
257
- ft as getDefaultProducts,
258
- w as isDefaultAttribute,
231
+ rt as buildSpacer,
232
+ ct as cellBgStyleAttr,
233
+ bt as createBlockTemplate,
234
+ m as formatProductPrice,
235
+ x as getCurrentCurrencyConfig,
236
+ Tt as getDefaultProducts,
237
+ v as isDefaultAttribute,
259
238
  q as isSamePrice,
260
- lt as renderButtonLabel,
261
- rt as renderStyledParagraph,
262
- at as resolveButtonBorderClass,
239
+ at as renderButtonLabel,
240
+ it as renderStyledParagraph,
241
+ ut as resolveButtonBorderClass,
263
242
  J as resolveInlinePriceOrder,
264
- ct as resolveOmnibusText,
265
- V as resolvePStyle,
266
- F as resolveProductAttrValue,
243
+ lt as resolveOmnibusText,
244
+ H as resolvePStyle,
245
+ w as resolveProductAttrValue,
267
246
  st as resolveSegmentBgStyle,
268
- bt as sanitizeImageUrl,
269
- H as spacer,
247
+ mt as sanitizeImageUrl,
270
248
  Q as toCustomCompositionKey,
271
- x as toDisplayName,
272
- N as toDisplayableAttributeValue
249
+ N as toDisplayName,
250
+ F as toDisplayableAttributeValue
273
251
  };
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.73.0" } }, s = {
1
+ const o = { stripo: { version: "2.72.1" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -1,4 +1,12 @@
1
1
  export declare function extractTitleText(block: Element): string;
2
+ /**
3
+ * Fallback for legacy configs that carry no `p_recommendation_title` variable:
4
+ * the rendered HTML decides. A missing or `display: none` title container means
5
+ * the user never saw a title, so the migrated block keeps it toggled off.
6
+ * @param block - The legacy recommendation block element
7
+ * @returns True when the legacy block renders a visible title
8
+ */
9
+ export declare function hasVisibleTitle(block: Element): boolean;
2
10
  /**
3
11
  * Card background lives on either the block (`bgcolor`/`style`) or per-card
4
12
  * cells (`.product-card`). Returns empty string when no background is set —