@useinsider/guido 3.22.0-beta.d4e1d48 → 3.22.0-beta.e1b5da2

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 (31) hide show
  1. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +11 -11
  2. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
  3. package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
  4. package/dist/config/migrator/recommendation/compositionMapper.js +56 -49
  5. package/dist/config/migrator/recommendation/extractors.js +100 -40
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +285 -207
  7. package/dist/config/migrator/recommendation/settingsMapper.js +37 -36
  8. package/dist/config/migrator/recommendation/themeMapper.js +53 -41
  9. package/dist/config/migrator/recommendationMigrator.js +68 -61
  10. package/dist/extensions/Blocks/Recommendation/block.js +33 -24
  11. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +20 -19
  12. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +148 -163
  13. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +23 -22
  14. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +19 -18
  15. package/dist/extensions/Blocks/Recommendation/templates/utils.js +82 -91
  16. package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +12 -0
  17. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +3 -2
  18. package/dist/guido.css +1 -1
  19. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +3 -1
  20. package/dist/src/config/migrator/recommendation/extractors.d.ts +35 -6
  21. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +3 -1
  22. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +3 -1
  23. package/dist/src/config/migrator/recommendation/types.d.ts +11 -1
  24. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  25. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -8
  26. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -13
  27. package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +9 -0
  28. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -19
  29. package/dist/src/stores/unsubscribe.d.ts +0 -10
  30. package/dist/stores/unsubscribe.js +29 -33
  31. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
- import { ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_OLD_PRICE as O } from "../../constants/selectors.js";
1
+ import { ATTR_PRODUCT_PRICE as D, 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 { 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
- import { DEFAULT_CELL_PADDING as k, renderInlineGridPriceCell as H, buildFillerCell as x, gridElementRenderer as y } from "./elementRenderer.js";
3
+ import { createBlockTemplate as A, getDefaultProducts as g, DEFAULTS as U, buildSpacer as h, DEFAULT_CARD_COMPOSITION as Y, buildElementRenderer as B, buildCellOptions as m, DEFAULT_CARD_VISIBILITY as F } from "../utils.js";
4
+ import { DEFAULT_CELL_PADDING as W, renderInlineGridPriceCell as k, buildFillerCell as H, gridElementRenderer as x } from "./elementRenderer.js";
5
+ import { resolveInlinePriceOrder as y } from "../../utils/inlinePriceOrder.js";
5
6
  const G = `
6
7
  <tr class="recommendation-product-row">
7
8
  <td>
@@ -28,29 +29,29 @@ const G = `
28
29
  {-{-CELLS-}-}
29
30
  </tr>
30
31
  `;
31
- function j(t, r, o, e = Y, c = {}, i = {}) {
32
- const { cellPadding: s = k, cardBackgroundColor: u, visibility: a, priceInline: n = !1 } = i, d = (100 / r).toFixed(2), p = r - t.length, T = p > 0 ? x(d, s).repeat(p) : "", m = B(o, e, c), R = F(e), L = n ? e.filter((l) => l !== R.skip) : e, C = I(f, i), P = I(O, i);
33
- return L.filter((l) => m[l]).map((l) => {
34
- const _ = (a == null ? void 0 : a[l]) ?? W[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = I(l, i, e), D = t.map((E) => (n && l === R.anchor ? H(
32
+ function j(t, r, n, e = Y, c = {}, i = {}) {
33
+ const { cellPadding: s = W, cardBackgroundColor: u, visibility: a, priceInline: o = !1 } = i, d = (100 / r).toFixed(2), p = r - t.length, T = p > 0 ? H(d, s).repeat(p) : "", I = B(n, e, c), R = y(e), L = o ? e.filter((l) => l !== R.skip) : e, C = m(D, i), P = m(O, i);
34
+ return L.filter((l) => I[l]).map((l) => {
35
+ const _ = (a == null ? void 0 : a[l]) ?? F[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = m(l, i, e), f = t.map((E) => (o && l === R.anchor ? k(
35
36
  E,
36
37
  R.originalFirst,
37
38
  C,
38
39
  P,
39
40
  u
40
- ) : m[l](E, S)).replace("<td", `<td width="${d}%"`)).join("");
41
- return V.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", _ ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", b).replace("{-{-CELLS-}-}", D + T);
41
+ ) : I[l](E, S)).replace("<td", `<td width="${d}%"`)).join("");
42
+ return V.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", _ ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", b).replace("{-{-CELLS-}-}", f + T);
42
43
  }).join("");
43
44
  }
44
- function v(t, r, o, e, c = {}, i = {}) {
45
+ function v(t, r, n, e, c = {}, i = {}) {
45
46
  const s = [];
46
- for (let n = 0; n < t.length; n += r)
47
- s.push(t.slice(n, n + r));
47
+ for (let o = 0; o < t.length; o += r)
48
+ s.push(t.slice(o, o + r));
48
49
  const u = h(i.rowSpacingPx);
49
- return s.map((n, d) => {
50
+ return s.map((o, d) => {
50
51
  const p = j(
51
- n,
52
- r,
53
52
  o,
53
+ r,
54
+ n,
54
55
  e,
55
56
  c,
56
57
  i
@@ -58,22 +59,22 @@ function v(t, r, o, e, c = {}, i = {}) {
58
59
  return d > 0 ? u + T : T;
59
60
  }).join("");
60
61
  }
61
- function M(t, r, o, e = {}, c = {}) {
62
+ function M(t, r, n, e = {}, c = {}) {
62
63
  return v(
63
64
  t,
64
65
  r,
65
- y,
66
- o,
66
+ x,
67
+ n,
67
68
  e,
68
69
  c
69
70
  );
70
71
  }
71
- function Q(t) {
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-}-}", "");
72
+ function X(t) {
73
+ const r = t ? `ins-recommendation-v3-block-${t}` : void 0, n = A("grid", r), e = g(), c = M(e, w);
74
+ return n.replace("{-{-TITLE-}-}", U.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
74
75
  }
75
76
  export {
76
- Q as getDefaultTemplate,
77
+ X as getDefaultTemplate,
77
78
  j as prepareGridAttributeRows,
78
79
  v as prepareGridProductRows,
79
80
  M as prepareProductRows
@@ -1,13 +1,14 @@
1
- import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as I } from "../../constants/selectors.js";
2
- import { buildSpacer as m, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, resolveInlinePriceOrder as w, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
3
- import { listElementRenderer as L, renderInlineListPriceRow as O } from "./elementRenderer.js";
1
+ import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as m } from "../../constants/selectors.js";
2
+ import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, DEFAULT_CARD_VISIBILITY as w } from "../utils.js";
3
+ import { listElementRenderer as y, renderInlineListPriceRow as L } from "./elementRenderer.js";
4
+ import { resolveInlinePriceOrder as O } from "../../utils/inlinePriceOrder.js";
4
5
  const S = "0 5px";
5
6
  function U(l, r, n) {
6
- const t = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
7
+ const e = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
7
8
  return `<tr
8
9
  class="recommendation-attribute-row"
9
10
  data-attribute-type="${r}"
10
- data-visibility="${n ? "1" : "0"}"${t}>${o}</tr>`;
11
+ data-visibility="${n ? "1" : "0"}"${e}>${o}</tr>`;
11
12
  }
12
13
  const N = `
13
14
  <tr class="recommendation-product-row">
@@ -27,40 +28,40 @@ const N = `
27
28
  </td>
28
29
  </tr>
29
30
  `;
30
- function x(l, r = g, n = {}, t = {}) {
31
+ function x(l, r = g, n = {}, e = {}) {
31
32
  const {
32
33
  cellPadding: o = S,
33
34
  cardBackgroundColor: d,
34
35
  visibility: c,
35
36
  priceInline: a = !1
36
- } = t, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(L, r, n), P = s[p](l, i(p, t)), R = w(r), T = `
37
+ } = e, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(y, r, n), P = s[p](l, i(p, e)), R = O(r), T = `
37
38
  <td class="product-info-cell" valign="middle" style="padding: 15px;">
38
39
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
39
40
  <tbody>
40
- ${r.filter((e) => e !== p && e !== C).filter((e) => !(a && e === R.skip)).filter((e) => s[e]).map((e) => {
41
- const b = (c == null ? void 0 : c[e]) ?? y[e] ?? !0, f = a && e === R.anchor ? O(
41
+ ${r.filter((t) => t !== p && t !== C).filter((t) => !(a && t === R.skip)).filter((t) => s[t]).map((t) => {
42
+ const b = (c == null ? void 0 : c[t]) ?? w[t] ?? !0, f = a && t === R.anchor ? L(
42
43
  l,
43
44
  R.originalFirst,
44
- i(I, t),
45
- i(A, t)
46
- ) : s[e](l, i(e, t, r));
47
- return U(f, e, b);
45
+ i(m, e),
46
+ i(A, e)
47
+ ) : s[t](l, i(t, e, r));
48
+ return U(f, t, b);
48
49
  }).join(`
49
50
  `)}
50
51
  </tbody>
51
52
  </table>
52
53
  </td>
53
- `, _ = s[C](l, i(C, t)), D = P + T + _;
54
+ `, _ = s[C](l, i(C, e)), D = P + T + _;
54
55
  return N.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
55
56
  }
56
- function W(l, r, n = {}, t = {}) {
57
- const o = m(t.rowSpacingPx);
57
+ function k(l, r, n = {}, e = {}) {
58
+ const o = I(e.rowSpacingPx);
58
59
  return l.map((d, c) => {
59
- const a = x(d, r, n, t);
60
+ const a = x(d, r, n, e);
60
61
  return c > 0 ? o + a : a;
61
62
  }).join("");
62
63
  }
63
64
  export {
64
65
  x as getListProductCard,
65
- W as prepareProductRows
66
+ k as prepareProductRows
66
67
  };
@@ -1,9 +1,9 @@
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";
1
+ import { ATTR_CUSTOM_PREFIX as f, ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_OLD_PRICE as b, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_BUTTON as y, PRODUCT_ATTRIBUTE_PREFIX as I } from "../constants/selectors.js";
2
2
  import { useRecommendationExtensionStore as L } from "../store/recommendation.js";
3
- import { compositionKeyToProductAttr as y, isDefaultProductAttr as f, bareAttributeName as S, findFilterByBareName as $, productAttrToCompositionKey as P } from "../utils/compositionKeys.js";
3
+ import { compositionKeyToProductAttr as p, isDefaultProductAttr as d, bareAttributeName as S, findFilterByBareName as $, productAttrToCompositionKey as R } from "../utils/compositionKeys.js";
4
4
  import { formatPrice as B } from "../utils/priceFormatter.js";
5
5
  import { buildTitleRows as k } from "./titleRows.js";
6
- function x() {
6
+ function N() {
7
7
  const t = L(), { currencySettings: e } = t.recommendationConfigs;
8
8
  return {
9
9
  code: e.value,
@@ -14,91 +14,83 @@ function x() {
14
14
  thousandSeparator: e.thousandSeparator
15
15
  };
16
16
  }
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;
17
+ function g(t, e = "price") {
18
+ const o = N(), n = t[e], c = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
19
19
  return B({
20
20
  price: c,
21
21
  currency: o
22
22
  });
23
23
  }
24
24
  function q(t) {
25
- return m(t, "price") === m(t, "original_price");
25
+ return g(t, "price") === g(t, "original_price");
26
26
  }
27
- function N(t) {
27
+ function w(t) {
28
28
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
29
29
  }
30
- function J(t) {
31
- const e = t.indexOf(l), o = t.indexOf(a), n = o !== -1 && (e === -1 || o < e);
32
- return {
33
- originalFirst: n,
34
- anchor: n ? a : l,
35
- skip: n ? l : a
36
- };
37
- }
38
- function F(t) {
30
+ function x(t) {
39
31
  const e = Array.isArray(t) ? t[t.length - 1] : t;
40
32
  if (typeof e == "string")
41
33
  return e;
42
34
  if (typeof e == "number")
43
35
  return String(e);
44
36
  }
45
- function v(t, e) {
37
+ function F(t, e) {
46
38
  var o;
47
39
  return ((o = $(t, e)) == null ? void 0 : o.type) === "defaultAttribute";
48
40
  }
49
- function w(t, e) {
50
- return v(t, e) ? t : `${I}${t}`;
41
+ function M(t, e) {
42
+ return F(t, e) ? t : `${I}${t}`;
51
43
  }
52
- function Q(t) {
53
- return P(t);
44
+ function J(t) {
45
+ return R(t);
54
46
  }
55
- const M = Symbol("customCellHtml");
56
- function Z(t, e, o = {}) {
57
- const n = t[M];
47
+ const v = Symbol("customCellHtml");
48
+ function Q(t, e, o = {}) {
49
+ const n = t[v];
58
50
  if (!n)
59
51
  return { ...t };
60
52
  const c = { ...t };
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) => {
64
- var g;
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);
53
+ return e.filter((s) => s.startsWith(f) && !c[s]).forEach((s) => {
54
+ const i = p(s), r = d(i) ? M(i, o) : i, l = S(r), h = w(l), D = d(r);
55
+ c[s] = (a, U) => {
56
+ var u;
57
+ const E = D ? a[l] : (u = a.product_attributes) == null ? void 0 : u[l], O = x(E) ?? h;
58
+ return n(r, O, U);
67
59
  };
68
60
  }), c;
69
61
  }
70
- function tt(t, e, o = []) {
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]);
62
+ function Z(t, e, o = []) {
63
+ const n = t.startsWith(f) ? R(S(p(t))) : t, s = n !== t && !o.includes(n) ? n : t, i = (r) => (r == null ? void 0 : r[t]) ?? (r == null ? void 0 : r[s]);
72
64
  return {
73
65
  cellPadding: e.cellPadding,
74
66
  cardBackgroundColor: e.cardBackgroundColor,
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)
67
+ cellBackgroundColor: i(e.cellBackgroundColors),
68
+ cellAlignment: i(e.cellAlignments),
69
+ cellClasses: i(e.cellClasses),
70
+ omnibusText: i(e.omnibusTexts),
71
+ styleTemplate: i(e.styleTemplates)
80
72
  };
81
73
  }
82
- const et = {
74
+ const tt = {
83
75
  TITLE: "You May Also Like!"
84
- }, ot = [
76
+ }, et = [
77
+ m,
78
+ T,
85
79
  b,
86
80
  _,
87
- a,
88
- l,
89
81
  C,
90
82
  A,
91
- p
92
- ], nt = {
93
- [b]: !0,
83
+ y
84
+ ], ot = {
85
+ [m]: !0,
86
+ [T]: !0,
94
87
  [_]: !0,
95
- [l]: !0,
96
- [a]: !0,
88
+ [b]: !0,
97
89
  [C]: !1,
98
90
  [A]: !1,
99
- [p]: !0
91
+ [y]: !0
100
92
  }, W = 10;
101
- function rt(t = W) {
93
+ function nt(t = W) {
102
94
  return `
103
95
  <tr>
104
96
  <td class="spacer" style="height: ${t}px;"></td>
@@ -108,9 +100,9 @@ function rt(t = W) {
108
100
  function H(t, e) {
109
101
  return e ? e.pStyle ?? "" : t;
110
102
  }
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>`;
103
+ function rt(t, e, o) {
104
+ const n = H(e.pStyle, o), c = o ? o.openTags ?? "" : e.openTags, s = o ? o.closeTags ?? "" : e.closeTags;
105
+ return `<p contenteditable="false" style="${n}">${c}${t}${s}</p>`;
114
106
  }
115
107
  function st(t, e) {
116
108
  const o = [];
@@ -119,30 +111,30 @@ function st(t, e) {
119
111
  function V(t) {
120
112
  return t ? ` background-color: ${t};` : "";
121
113
  }
122
- function ct(t) {
114
+ function it(t) {
123
115
  const e = V(t);
124
116
  return e ? ` style="${e.trim()}"` : "";
125
117
  }
126
- function lt(t, e = "") {
118
+ function ct(t, e = "") {
127
119
  return {
128
120
  before: (t == null ? void 0 : t.before) ?? e,
129
121
  after: (t == null ? void 0 : t.after) ?? ""
130
122
  };
131
123
  }
132
- function at(t, e) {
124
+ function lt(t, e) {
133
125
  return `${(e == null ? void 0 : e.openTags) ?? ""}${t}${(e == null ? void 0 : e.closeTags) ?? ""}`;
134
126
  }
135
- function ut(t) {
127
+ function at(t) {
136
128
  return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
137
129
  }
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;
130
+ 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";
131
+ function ft(t) {
132
+ return !t || typeof t != "string" || t.trim() === "" ? P : t.startsWith("http://") ? t.replace("http://", "https://") : t;
141
133
  }
142
134
  function Y(t) {
143
135
  return {
144
136
  name: "Product Name",
145
- image_url: R,
137
+ image_url: P,
146
138
  price: { USD: 18 },
147
139
  original_price: { USD: 20 },
148
140
  discount: { USD: 2 },
@@ -154,20 +146,20 @@ function Y(t) {
154
146
  category: []
155
147
  };
156
148
  }
157
- function Tt(t = 6) {
149
+ function mt(t = 6) {
158
150
  return Array.from(
159
151
  { length: t },
160
152
  (e, o) => Y(String(o + 1))
161
153
  );
162
154
  }
163
- function bt(t = "grid", e) {
155
+ function Tt(t = "grid", e) {
164
156
  const o = t === "list" ? `
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" ? "" : `
157
+ data-layout="list"` : "", n = e ? ` ${e}` : "", s = `recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${n}`, i = t === "list" ? "" : `
166
158
  {-{-MOBILE_PRODUCT_ROWS-}-}`, r = t === "list" ? ' style="display: none;"' : "";
167
159
  return `
168
160
  <td
169
161
  align="left"
170
- class="${i}"${o}>
162
+ class="${s}"${o}>
171
163
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
172
164
  <tr>
173
165
  <td align="center">
@@ -203,7 +195,7 @@ function bt(t = "grid", e) {
203
195
  cellspacing="0"
204
196
  border="0"
205
197
  style="display: none;"
206
- >${s}
198
+ >${i}
207
199
  </table>
208
200
  </td>
209
201
  </tr>
@@ -216,36 +208,35 @@ function bt(t = "grid", e) {
216
208
  `;
217
209
  }
218
210
  export {
219
- M as CUSTOM_CELL_HTML,
220
- et as DEFAULTS,
221
- ft as DEFAULT_BUTTON_ANCHOR_STYLE,
222
- gt as DEFAULT_BUTTON_BORDER_STYLE,
223
- ot as DEFAULT_CARD_COMPOSITION,
224
- nt as DEFAULT_CARD_VISIBILITY,
225
- dt as DEFAULT_IMG_STYLE,
211
+ v as CUSTOM_CELL_HTML,
212
+ tt as DEFAULTS,
213
+ gt as DEFAULT_BUTTON_ANCHOR_STYLE,
214
+ dt as DEFAULT_BUTTON_BORDER_STYLE,
215
+ et as DEFAULT_CARD_COMPOSITION,
216
+ ot as DEFAULT_CARD_VISIBILITY,
217
+ ut as DEFAULT_IMG_STYLE,
226
218
  W as DEFAULT_ROW_SPACING_PX,
227
- R as PLACEHOLDER_IMAGE,
219
+ P as PLACEHOLDER_IMAGE,
228
220
  V as bgColorFragment,
229
- tt as buildCellOptions,
230
- Z as buildElementRenderer,
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,
221
+ Z as buildCellOptions,
222
+ Q as buildElementRenderer,
223
+ nt as buildSpacer,
224
+ it as cellBgStyleAttr,
225
+ Tt as createBlockTemplate,
226
+ g as formatProductPrice,
227
+ N as getCurrentCurrencyConfig,
228
+ mt as getDefaultProducts,
229
+ F as isDefaultAttribute,
238
230
  q as isSamePrice,
239
- at as renderButtonLabel,
240
- it as renderStyledParagraph,
241
- ut as resolveButtonBorderClass,
242
- J as resolveInlinePriceOrder,
243
- lt as resolveOmnibusText,
231
+ lt as renderButtonLabel,
232
+ rt as renderStyledParagraph,
233
+ at as resolveButtonBorderClass,
234
+ ct as resolveOmnibusText,
244
235
  H as resolvePStyle,
245
- w as resolveProductAttrValue,
236
+ M as resolveProductAttrValue,
246
237
  st as resolveSegmentBgStyle,
247
- mt as sanitizeImageUrl,
248
- Q as toCustomCompositionKey,
249
- N as toDisplayName,
250
- F as toDisplayableAttributeValue
238
+ ft as sanitizeImageUrl,
239
+ J as toCustomCompositionKey,
240
+ w as toDisplayName,
241
+ x as toDisplayableAttributeValue
251
242
  };
@@ -0,0 +1,12 @@
1
+ import { ATTR_PRODUCT_PRICE as n, ATTR_PRODUCT_OLD_PRICE as e } from "../constants/selectors.js";
2
+ function d(i) {
3
+ const o = i.indexOf(n), t = i.indexOf(e), r = t !== -1 && (o === -1 || t < o);
4
+ return {
5
+ originalFirst: r,
6
+ anchor: r ? e : n,
7
+ skip: r ? n : e
8
+ };
9
+ }
10
+ export {
11
+ d as resolveInlinePriceOrder
12
+ };
@@ -3,9 +3,10 @@ function r(e) {
3
3
  return e;
4
4
  switch (e) {
5
5
  case "viewedTogether":
6
- return "similarViewed";
7
6
  case "purchasedTogether":
8
- return "similarBought";
7
+ case "similarViewed":
8
+ case "similarBought":
9
+ return "mostPopular";
9
10
  case "trending":
10
11
  return "trendingProducts";
11
12
  case "mostValuable":
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
@@ -1,2 +1,4 @@
1
1
  import { type LegacyVariable, type MappedComposition } from './types';
2
- export declare function mapComposition(variables: LegacyVariable[] | undefined): MappedComposition;
2
+ export declare function mapComposition(variables: LegacyVariable[] | undefined, { oldPriceFirst }?: {
3
+ oldPriceFirst?: boolean;
4
+ }): MappedComposition;
@@ -1,3 +1,4 @@
1
+ import type { LegacyPaddingViewport, LegacyVariable } from './types';
1
2
  export declare function extractTitleText(block: Element): string;
2
3
  /**
3
4
  * Fallback for legacy configs that carry no `p_recommendation_title` variable:
@@ -7,6 +8,31 @@ export declare function extractTitleText(block: Element): string;
7
8
  * @returns True when the legacy block renders a visible title
8
9
  */
9
10
  export declare function hasVisibleTitle(block: Element): boolean;
11
+ /**
12
+ * A rendered title container with no text showed the user no title, whatever the config's `hidden` flag says.
13
+ * @param block - The legacy recommendation block element
14
+ * @returns True when the legacy block renders an empty title container
15
+ */
16
+ export declare function hasEmptyTitle(block: Element): boolean;
17
+ /**
18
+ * Reads which price the legacy card renders first. Prices sharing a `positionIdx` are ordered by this.
19
+ * @param block - The legacy recommendation block element
20
+ * @returns True only when both prices render and the original price comes first
21
+ */
22
+ export declare function isOldPriceFirst(block: Element): boolean;
23
+ /**
24
+ * Reads the legacy "Move to next line" state from the rendered card, for blocks whose config does not carry it.
25
+ * @param block - The legacy recommendation block element
26
+ * @returns True only when both prices render in separate rows and neither row is laid out inline (`table-cell`)
27
+ */
28
+ export declare function isPriceOnNextLine(block: Element): boolean;
29
+ /**
30
+ * Legacy keeps the text color and the name's trim toggle in the rendered `<p>`, not in the config theme.
31
+ * @param variables - The legacy composition variables
32
+ * @param block - The legacy recommendation block element
33
+ * @returns The variables, with `textColor` / `textTrimming` filled from the rendered HTML where the theme lacks them
34
+ */
35
+ export declare function withRenderedTextTheme(variables: LegacyVariable[] | undefined, block: Element): LegacyVariable[] | undefined;
10
36
  /**
11
37
  * Card background lives on either the block (`bgcolor`/`style`) or per-card
12
38
  * cells (`.product-card`). Returns empty string when no background is set —
@@ -14,13 +40,16 @@ export declare function hasVisibleTitle(block: Element): boolean;
14
40
  */
15
41
  export declare function extractCardBgColor(block: Element): string;
16
42
  /**
17
- * Reads the legacy block's own `currency-*` attributes into a
18
- * `currencySettings`-shaped object that `mapCurrency` understands. Used as a
19
- * fallback when the external recommendationConfigs map has no entry for this
20
- * block, so the migrated block keeps its real currency instead of defaulting.
21
- * Returns undefined when the block carries no `currency` attribute.
43
+ * `currencySettings` for a block whose legacy config has none: the code and symbol come from the block,
44
+ * the formatting from the legacy editor's defaults, which it rendered without reading the block's attributes.
45
+ */
46
+ export declare function extractCurrencyFromBlock(block: Element): Record<string, string | number>;
47
+ /**
48
+ * Block padding as the legacy product row renders it, for configs whose theme has no `blockPadding`.
49
+ * @param block - The legacy recommendation block element
50
+ * @returns The row's `es-p{n}{side}` padding, or undefined when the block has no product row
22
51
  */
23
- export declare function extractCurrencyFromBlock(block: Element): Record<string, string> | undefined;
52
+ export declare function extractRenderedBlockPadding(block: Element): LegacyPaddingViewport | undefined;
24
53
  /**
25
54
  * True when a PM has manually opted the legacy block out of content
26
55
  * regeneration by adding the `ins-skip-compile` class. Detected before rebuild
@@ -1,4 +1,4 @@
1
- import type { MappedComposition } from './types';
1
+ import type { MappedBlockPadding, MappedComposition } from './types';
2
2
  import type { RecommendationNodeConfig } from '@@/Extensions/Blocks/Recommendation/types/nodeConfig';
3
3
  export declare function buildBlockHtml(params: {
4
4
  nodeConfig: RecommendationNodeConfig;
@@ -16,4 +16,6 @@ export declare function buildBlockHtml(params: {
16
16
  preserveInnerHtml?: string;
17
17
  /** Adds the `ins-skip-compile` opt-out class to the migrated block. */
18
18
  skipCompile?: boolean;
19
+ /** Legacy desktop block padding; without it the block keeps the default `es-p20`. */
20
+ blockPadding?: MappedBlockPadding;
19
21
  }): string;
@@ -1,5 +1,7 @@
1
- import type { LegacyButtonTheme, LegacyImageTheme, LegacyTextTheme, MappedButtonStyle, MappedImageStyle, MappedTextStyle } from './types';
1
+ import type { LegacyButtonTheme, LegacyImageTheme, LegacyPaddingViewport, LegacyTextTheme, MappedBlockPadding, MappedButtonStyle, MappedImageStyle, MappedTextStyle } from './types';
2
2
  export declare function mapTextTheme(theme: LegacyTextTheme | undefined): MappedTextStyle;
3
3
  export declare function mapButtonTheme(theme: LegacyButtonTheme | undefined): MappedButtonStyle;
4
4
  export declare function mapImageTheme(theme: LegacyImageTheme | undefined): MappedImageStyle;
5
+ /** Stripo `es-p{n}{side}` classes where a step class exists, inline `padding-{side}` otherwise; 0 needs neither. */
6
+ export declare function mapBlockPadding(padding: LegacyPaddingViewport | undefined): MappedBlockPadding | undefined;
5
7
  export declare function appendStyle(existing: string | undefined, addition: string | undefined): string;
@@ -30,7 +30,9 @@ export interface LegacyPadding {
30
30
  /** Border-radius shape — observed in two flavours: shorthand or per-corner. */
31
31
  export interface LegacyBorderRadius {
32
32
  /** Single shorthand value (e.g. `radius: 4`). */
33
- radius?: number;
33
+ radius?: number | string;
34
+ /** Shorthand the legacy button theme stores under `theme.borderRadius` (e.g. `borderRadius: "4"`). */
35
+ borderRadius?: number | string;
34
36
  /** Per-corner: top-left / top-right / bottom-right / bottom-left (in px). */
35
37
  lt?: number;
36
38
  rt?: number;
@@ -96,6 +98,7 @@ export interface LegacyButtonTheme {
96
98
  color?: LegacySides<string>;
97
99
  };
98
100
  buttonBorderRadius?: LegacyBorderRadius;
101
+ borderRadius?: LegacyBorderRadius;
99
102
  buttonAlign?: {
100
103
  align?: string;
101
104
  };
@@ -167,6 +170,13 @@ export interface MappedTextStyle {
167
170
  /** True if `textTrimming: true` in theme. */
168
171
  textTrimming: boolean;
169
172
  }
173
+ /** Resolved block wrapper padding. */
174
+ export interface MappedBlockPadding {
175
+ /** Space-separated `es-p{n}{side}` classes. */
176
+ classes: string;
177
+ /** Inline `padding-{side}` declarations for values without a step class. */
178
+ style: string;
179
+ }
170
180
  /** Resolved button styles. */
171
181
  export interface MappedButtonStyle {
172
182
  /** Inline CSS for outer `<td>` (external padding). */
@@ -65,6 +65,7 @@ export declare class RecommendationBlock extends Block {
65
65
  */
66
66
  onDelete(node: ImmutableHtmlNode): void;
67
67
  private _ensureMobileFitRule;
68
+ private _ensureTextTrimCss;
68
69
  private _syncHeightBound;
69
70
  /**
70
71
  * Warns (dark advisory toaster) when the design holds more than one live