@useinsider/guido 3.16.0-beta.8933e24 → 3.16.0-beta.925fbc8

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 (39) hide show
  1. package/dist/composables/useRecommendation.js +20 -19
  2. package/dist/config/migrator/index.js +8 -9
  3. package/dist/config/migrator/itemsBlockMigrator.js +1 -1
  4. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  5. package/dist/config/migrator/recommendation/extractors.js +24 -29
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +130 -116
  7. package/dist/config/migrator/recommendationMigrator.js +15 -18
  8. package/dist/enums/recommendation.js +17 -17
  9. package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
  10. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  11. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  12. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +22 -23
  13. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +26 -29
  14. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +152 -203
  15. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
  16. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +21 -21
  17. package/dist/extensions/Blocks/Recommendation/extension.js +29 -31
  18. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -23
  19. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -12
  20. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  21. package/dist/extensions/Blocks/Recommendation/templates/utils.js +107 -85
  22. package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
  23. package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -8
  24. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +1 -2
  25. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +0 -7
  26. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
  27. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  28. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -4
  29. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -7
  30. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -1
  31. package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
  32. package/dist/static/styles/customEditorStyle.css.js +1 -3
  33. package/package.json +1 -1
  34. package/dist/config/migrator/recommendationTitleMigrator.js +0 -112
  35. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +0 -44
  36. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +0 -33
  37. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +0 -1
  38. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +0 -86
  39. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +0 -13
@@ -1,9 +1,8 @@
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_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";
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 A, isDefaultProductAttr as b, bareAttributeName as S, findFilterByBareName as $, productAttrToCompositionKey as h } from "../utils/compositionKeys.js";
4
4
  import { formatPrice as B } from "../utils/priceFormatter.js";
5
- import { buildTitleRows as k } from "./titleRows.js";
6
- function x() {
5
+ function k() {
7
6
  const t = L(), { currencySettings: e } = t.recommendationConfigs;
8
7
  return {
9
8
  code: e.value,
@@ -14,17 +13,17 @@ function x() {
14
13
  thousandSeparator: e.thousandSeparator
15
14
  };
16
15
  }
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;
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;
19
18
  return B({
20
19
  price: c,
21
20
  currency: o
22
21
  });
23
22
  }
24
23
  function q(t) {
25
- return m(t, "price") === m(t, "original_price");
24
+ return f(t, "price") === f(t, "original_price");
26
25
  }
27
- function N(t) {
26
+ function x(t) {
28
27
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
29
28
  }
30
29
  function J(t) {
@@ -35,114 +34,115 @@ function J(t) {
35
34
  skip: n ? l : a
36
35
  };
37
36
  }
38
- function F(t) {
37
+ function N(t) {
39
38
  const e = Array.isArray(t) ? t[t.length - 1] : t;
40
39
  if (typeof e == "string")
41
40
  return e;
42
41
  if (typeof e == "number")
43
42
  return String(e);
44
43
  }
45
- function v(t, e) {
44
+ function w(t, e) {
46
45
  var o;
47
46
  return ((o = $(t, e)) == null ? void 0 : o.type) === "defaultAttribute";
48
47
  }
49
- function w(t, e) {
50
- return v(t, e) ? t : `${I}${t}`;
48
+ function F(t, e) {
49
+ return w(t, e) ? t : `${I}${t}`;
51
50
  }
52
51
  function Q(t) {
53
- return P(t);
52
+ return h(t);
54
53
  }
55
- const M = Symbol("customCellHtml");
54
+ const v = Symbol("customCellHtml");
56
55
  function Z(t, e, o = {}) {
57
- const n = t[M];
56
+ const n = t[v];
58
57
  if (!n)
59
58
  return { ...t };
60
59
  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) => {
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) => {
64
63
  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);
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);
67
66
  };
68
67
  }), c;
69
68
  }
70
69
  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]);
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]);
72
71
  return {
73
72
  cellPadding: e.cellPadding,
74
73
  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)
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)
80
79
  };
81
80
  }
82
81
  const et = {
83
82
  TITLE: "You May Also Like!"
84
83
  }, ot = [
85
- b,
86
- _,
84
+ m,
85
+ C,
87
86
  a,
88
87
  l,
89
- C,
90
- A,
91
- p
88
+ _,
89
+ p,
90
+ y
92
91
  ], nt = {
93
- [b]: !0,
94
- [_]: !0,
92
+ [m]: !0,
93
+ [C]: !0,
95
94
  [l]: !0,
96
95
  [a]: !0,
97
- [C]: !1,
98
- [A]: !1,
99
- [p]: !0
100
- }, W = 10;
101
- function rt(t = W) {
96
+ [_]: !1,
97
+ [p]: !1,
98
+ [y]: !0
99
+ }, M = 10;
100
+ function W(t = M) {
102
101
  return `
103
102
  <tr>
104
103
  <td class="spacer" style="height: ${t}px;"></td>
105
104
  </tr>
106
105
  `;
107
106
  }
108
- function H(t, e) {
107
+ const H = W();
108
+ function V(t, e) {
109
109
  return e ? e.pStyle ?? "" : t;
110
110
  }
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>`;
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>`;
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 V(t) {
119
+ function Y(t) {
120
120
  return t ? ` background-color: ${t};` : "";
121
121
  }
122
- function ct(t) {
123
- const e = V(t);
122
+ function it(t) {
123
+ const e = Y(t);
124
124
  return e ? ` style="${e.trim()}"` : "";
125
125
  }
126
- function lt(t, e = "") {
126
+ function ct(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 at(t, e) {
132
+ function lt(t, e) {
133
133
  return `${(e == null ? void 0 : e.openTags) ?? ""}${t}${(e == null ? void 0 : e.closeTags) ?? ""}`;
134
134
  }
135
- function ut(t) {
135
+ function at(t) {
136
136
  return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
137
137
  }
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;
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;
141
141
  }
142
- function Y(t) {
142
+ function G(t) {
143
143
  return {
144
144
  name: "Product Name",
145
- image_url: R,
145
+ image_url: P,
146
146
  price: { USD: 18 },
147
147
  original_price: { USD: 20 },
148
148
  discount: { USD: 2 },
@@ -154,20 +154,19 @@ function Y(t) {
154
154
  category: []
155
155
  };
156
156
  }
157
- function Tt(t = 6) {
157
+ function ft(t = 6) {
158
158
  return Array.from(
159
159
  { length: t },
160
- (e, o) => Y(String(o + 1))
160
+ (e, o) => G(String(o + 1))
161
161
  );
162
162
  }
163
- function bt(t = "grid", e) {
163
+ function Tt(t = "grid", e) {
164
164
  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" ? "" : `
166
- {-{-MOBILE_PRODUCT_ROWS-}-}`, r = t === "list" ? ' style="display: none;"' : "";
165
+ data-layout="list"` : "", n = e ? ` ${e}` : "";
167
166
  return `
168
167
  <td
169
168
  align="left"
170
- class="${i}"${o}>
169
+ class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${n}`}"${o}>
171
170
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
172
171
  <tr>
173
172
  <td align="center">
@@ -178,7 +177,28 @@ function bt(t = "grid", e) {
178
177
  cellspacing="0"
179
178
  border="0">
180
179
  <tbody>
181
- ${k()}
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}
182
202
  <tr>
183
203
  <td>
184
204
  <table
@@ -193,7 +213,7 @@ function bt(t = "grid", e) {
193
213
  </table>
194
214
  </td>
195
215
  </tr>
196
- <tr class="ins-recommendation-mobile-row"${r}>
216
+ <tr class="ins-recommendation-mobile-row"${t === "list" ? ' style="display: none;"' : ""}>
197
217
  <td>
198
218
  <table
199
219
  class="ins-recommendation-product-container
@@ -203,7 +223,8 @@ function bt(t = "grid", e) {
203
223
  cellspacing="0"
204
224
  border="0"
205
225
  style="display: none;"
206
- >${s}
226
+ >${t === "list" ? "" : `
227
+ {-{-MOBILE_PRODUCT_ROWS-}-}`}
207
228
  </table>
208
229
  </td>
209
230
  </tr>
@@ -216,36 +237,37 @@ function bt(t = "grid", e) {
216
237
  `;
217
238
  }
218
239
  export {
219
- M as CUSTOM_CELL_HTML,
240
+ v as CUSTOM_CELL_HTML,
220
241
  et as DEFAULTS,
221
- ft as DEFAULT_BUTTON_ANCHOR_STYLE,
222
- gt as DEFAULT_BUTTON_BORDER_STYLE,
242
+ gt as DEFAULT_BUTTON_ANCHOR_STYLE,
243
+ dt as DEFAULT_BUTTON_BORDER_STYLE,
223
244
  ot as DEFAULT_CARD_COMPOSITION,
224
245
  nt as DEFAULT_CARD_VISIBILITY,
225
- dt as DEFAULT_IMG_STYLE,
226
- W as DEFAULT_ROW_SPACING_PX,
227
- R as PLACEHOLDER_IMAGE,
228
- V as bgColorFragment,
246
+ ut as DEFAULT_IMG_STYLE,
247
+ M as DEFAULT_ROW_SPACING_PX,
248
+ P as PLACEHOLDER_IMAGE,
249
+ Y as bgColorFragment,
229
250
  tt as buildCellOptions,
230
251
  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,
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,
238
259
  q as isSamePrice,
239
- at as renderButtonLabel,
240
- it as renderStyledParagraph,
241
- ut as resolveButtonBorderClass,
260
+ lt as renderButtonLabel,
261
+ rt as renderStyledParagraph,
262
+ at as resolveButtonBorderClass,
242
263
  J as resolveInlinePriceOrder,
243
- lt as resolveOmnibusText,
244
- H as resolvePStyle,
245
- w as resolveProductAttrValue,
264
+ ct as resolveOmnibusText,
265
+ V as resolvePStyle,
266
+ F as resolveProductAttrValue,
246
267
  st as resolveSegmentBgStyle,
247
- mt as sanitizeImageUrl,
268
+ bt as sanitizeImageUrl,
269
+ H as spacer,
248
270
  Q as toCustomCompositionKey,
249
- N as toDisplayName,
250
- F as toDisplayableAttributeValue
271
+ x as toDisplayName,
272
+ N as toDisplayableAttributeValue
251
273
  };
@@ -0,0 +1,6 @@
1
+ function n(t) {
2
+ return t.map((i) => String(i ?? "").trim()).filter(Boolean).join(",");
3
+ }
4
+ export {
5
+ n as sanitizeProductIds
6
+ };
@@ -1,12 +1,4 @@
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;
10
2
  /**
11
3
  * Card background lives on either the block (`bgcolor`/`style`) or per-card
12
4
  * cells (`.product-card`). Returns empty string when no background is set —
@@ -10,6 +10,5 @@ export declare enum RecommendationBlockId {
10
10
  OMNIBUS_PRICE = "recommendation-block-omnibus-price",
11
11
  OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount",
12
12
  IMAGE = "recommendation-block-image",
13
- CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute",
14
- TITLE = "recommendation-block-title"
13
+ CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute"
15
14
  }
@@ -65,12 +65,5 @@ export declare enum RecommendationControlId {
65
65
  CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control",
66
66
  CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control",
67
67
  CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control",
68
- TITLE_ALIGN = "recommendation-block-title-align-control",
69
- TITLE_BACKGROUND = "recommendation-block-title-background-control",
70
- TITLE_COLOR = "recommendation-block-title-color-control",
71
- TITLE_FONT_FAMILY = "recommendation-block-title-font-family-control",
72
- TITLE_PADDINGS = "recommendation-block-title-paddings-control",
73
- TITLE_SIZE = "recommendation-block-title-size-control",
74
- TITLE_STYLE = "recommendation-block-title-style-control",
75
68
  SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message"
76
69
  }
@@ -32,7 +32,6 @@ export declare const DEFAULT_COMPOSITION: string[];
32
32
  /**
33
33
  * Default visibility settings for card elements
34
34
  * Omnibus elements are hidden by default (not all regions require them)
35
- * The block-level title is visible on a fresh drop.
36
35
  */
37
36
  export declare const DEFAULT_VISIBILITY: Record<string, boolean>;
38
37
  /**
@@ -8,6 +8,6 @@
8
8
  */
9
9
  export { RecommendationBlockId } from './blockIds';
10
10
  export { RecommendationControlId } from './controlIds';
11
- export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_RECOMMENDATION_TITLE, SELECTOR_TITLE_CELL, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
11
+ export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CSS_CLASS_SKIP_COMPILE, RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CARD_COMPOSITION, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, SELECTOR_ATTRIBUTE_ROW, ATTR_DATA_ATTRIBUTE_TYPE, PRODUCT_ATTRIBUTE_PREFIX, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
12
12
  export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
13
13
  export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
@@ -58,10 +58,6 @@ export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
58
58
  export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
59
59
  export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
60
60
  export declare const ATTR_PRODUCT_BUTTON = "productButton";
61
- export declare const ATTR_RECOMMENDATION_TITLE = "recommendationTitle";
62
- export declare const CSS_CLASS_TITLE_CELL = "ins-recommendation-title";
63
- /** Title cell — the only `esd-block-text` living outside the product containers. */
64
- export declare const SELECTOR_TITLE_CELL = ".ins-recommendation-title";
65
61
  /**
66
62
  * Custom attribute constants
67
63
  * Used for dynamically added product attributes in Card Composition
@@ -33,8 +33,6 @@ export declare class RecommendationCardCompositionControl extends CommonControl
33
33
  private _normalizeComposition;
34
34
  private _readCustomAttributesFromNode;
35
35
  private _readVisibilityFromRows;
36
- private _withTitlePresence;
37
- private _hasTitle;
38
36
  private _getDefaultVisibilities;
39
37
  private _extractVisibilityFromRows;
40
38
  private _parseVisibilityValue;
@@ -189,11 +187,6 @@ export declare class RecommendationCardCompositionControl extends CommonControl
189
187
  */
190
188
  private _buildCompositionHtml;
191
189
  private _applyVisibilityToBlock;
192
- private _applyTitleVisibilityToBlock;
193
- private _findTitleRows;
194
- private _findTitleContainerBody;
195
- private _readInnerHtml;
196
- private _defaultTitleParagraph;
197
190
  /**
198
191
  * Finds the composition array index for the Nth custom attribute (0-based).
199
192
  * Scans left-to-right, counting only entries with the custom prefix.
@@ -11,7 +11,6 @@
11
11
  */
12
12
  export { RecommendationBlockControl, CONTROL_BLOCK_ID, AlgorithmControl, ALGORITHM_CONTROL_ID, LocaleControl, LOCALE_CONTROL_ID, CurrencyControl, CURRENCY_CONTROL_ID, ProductCountControl, PRODUCT_COUNT_CONTROL_ID, ProductLayoutControl, PRODUCT_LAYOUT_CONTROL_ID, FiltersControl, FILTERS_CONTROL_ID, ShuffleControl, SHUFFLE_CONTROL_ID, LayoutOrientationControl, LAYOUT_ORIENTATION_CONTROL_ID, PricePlacementControl, PRICE_PLACEMENT_CONTROL_ID, } from './main';
13
13
  export * from './main/utils';
14
- export { TitleControls } from './title';
15
14
  export { NameControls } from './name';
16
15
  export { PriceControls } from './price';
17
16
  export { OldPriceControls } from './oldPrice';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Builds the request/URL `productId` value from raw product ID segments.
3
+ * Trimming happens here — NOT on input change — so the user's in-progress
4
+ * text (trailing commas, spaces) is never rewritten under the caret (SD-147111).
5
+ */
6
+ export declare function sanitizeProductIds(ids: readonly (string | number | null | undefined)[]): string;
@@ -43,9 +43,7 @@ const n = `.esd-x,
43
43
  .recommendation-block-v2 .product-omnibus-discount ue-node-actions,
44
44
  .recommendation-block-v2 .product-omnibus-discount ue-node-panel,
45
45
  .recommendation-block-v2 .product-button ue-node-actions,
46
- .recommendation-block-v2 .product-button ue-node-panel,
47
- .recommendation-block-v2 .ins-recommendation-title ue-node-actions,
48
- .recommendation-block-v2 .ins-recommendation-title ue-node-panel {
46
+ .recommendation-block-v2 .product-button ue-node-panel {
49
47
  display: none !important;
50
48
  }
51
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.16.0-beta.8933e24",
3
+ "version": "3.16.0-beta.925fbc8",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -1,112 +0,0 @@
1
- var u = Object.defineProperty;
2
- var d = (r, t, e) => t in r ? u(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var c = (r, t, e) => d(r, typeof t != "symbol" ? t + "" : t, e);
4
- import { RecommendationBlockId as m } from "../../extensions/Blocks/Recommendation/constants/blockIds.js";
5
- import { BLOCK_ROOT_SELECTOR as _, CSS_CLASS_SKIP_COMPILE as f, ATTR_RECOMMENDATION_TITLE as a, CONTAINER_SELECTOR as T, CSS_CLASS_TITLE_CELL as R } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
6
- const S = _.slice(1), E = `${_}:not(.${f})`, p = `[data-attribute-type="${a}"]`, g = "td.esd-block-text", b = "table.container > tbody", l = "esd-ext-config";
7
- class y {
8
- constructor() {
9
- c(this, "parser");
10
- this.parser = new DOMParser();
11
- }
12
- migrate(t) {
13
- try {
14
- if (!t.includes(S))
15
- return t;
16
- const e = this.parser.parseFromString(t, "text/html");
17
- return Array.from(e.querySelectorAll(E)).reduce(
18
- (n, o) => this._migrateBlock(o) || n,
19
- !1
20
- ) ? e.documentElement.outerHTML : t;
21
- } catch (e) {
22
- return console.error("RecommendationTitleMigrator failed:", e), t;
23
- }
24
- }
25
- /** Migrates one block. Returns `true` when the block was changed. */
26
- _migrateBlock(t) {
27
- if (t.querySelector(p) || this._hasRecordedTitleState(t))
28
- return !1;
29
- const e = this._findTitleCell(t), i = e !== null && (e.textContent ?? "").trim().length > 0;
30
- return i ? this._tagExistingTitle(e) : this._removeTitleRemnants(t, e), this._writeVisibility(t, i), !0;
31
- }
32
- /** The only `esd-block-text` cell outside the product containers is the title. */
33
- _findTitleCell(t) {
34
- return Array.from(t.querySelectorAll(g)).find((e) => !e.closest(T)) ?? null;
35
- }
36
- /**
37
- * Stamps the attribute-row tagging onto the title's wrapper row and the spacer
38
- * below it, so one toggle governs the pair and the compiler drops both when off.
39
- */
40
- _tagExistingTitle(t) {
41
- t.classList.add(R), t.setAttribute("esd-extension-block-id", m.TITLE);
42
- const e = this._wrapperRowOf(t);
43
- if (!e)
44
- return;
45
- this._tagRow(e);
46
- const i = e.nextElementSibling;
47
- i && this._isSpacerRow(i) && this._tagRow(i);
48
- }
49
- /** The `<tr>` inside `table.container > tbody` that wraps the title's own table. */
50
- _wrapperRowOf(t) {
51
- var e, i;
52
- return ((i = (e = t == null ? void 0 : t.closest("table")) == null ? void 0 : e.parentElement) == null ? void 0 : i.closest("tr")) ?? null;
53
- }
54
- /**
55
- * Direct children only — a product-container row holds spacer cells further down,
56
- * and `querySelector` would happily reach them. (`:scope >` is unsupported in happy-dom.)
57
- */
58
- _isSpacerRow(t) {
59
- return Array.from(t.children).some((e) => e.classList.contains("spacer"));
60
- }
61
- _tagRow(t) {
62
- t.classList.add("recommendation-attribute-row"), t.setAttribute("data-attribute-type", a), t.setAttribute("data-visibility", "1");
63
- }
64
- /**
65
- * A deleted title leaves nothing to tag — the toggle re-injects the markup only
66
- * when the user switches it back on. Its leftovers (an emptied wrapper row, the
67
- * spacer that trailed it) would otherwise render as blank padding on top.
68
- */
69
- _removeTitleRemnants(t, e) {
70
- var o;
71
- const i = this._wrapperRowOf(e), s = i == null ? void 0 : i.nextElementSibling;
72
- if (s && this._isSpacerRow(s) && s.remove(), i) {
73
- i.remove();
74
- return;
75
- }
76
- const n = (o = t.querySelector(b)) == null ? void 0 : o.firstElementChild;
77
- n && this._isSpacerRow(n) && n.remove();
78
- }
79
- /**
80
- * Mirrors the resolved state into the persisted config blob, so a saved module
81
- * whose `data-*` attributes Stripo strips on re-drop still restores the toggle.
82
- */
83
- _writeVisibility(t, e) {
84
- const i = this._readConfig(t);
85
- if (!i)
86
- return;
87
- const s = typeof i.visibility == "object" && i.visibility !== null ? i.visibility : {};
88
- i.visibility = { ...s, [a]: e }, t.setAttribute(l, JSON.stringify(i));
89
- }
90
- _hasRecordedTitleState(t) {
91
- var i;
92
- const e = (i = this._readConfig(t)) == null ? void 0 : i.visibility;
93
- return typeof e == "object" && e !== null && a in e;
94
- }
95
- _readConfig(t) {
96
- const e = t.getAttribute(l);
97
- if (!e)
98
- return null;
99
- try {
100
- const i = JSON.parse(e);
101
- return typeof i == "object" && i !== null ? i : null;
102
- } catch {
103
- return null;
104
- }
105
- }
106
- }
107
- function h(r) {
108
- return new y().migrate(r);
109
- }
110
- export {
111
- h as migrateRecommendationTitle
112
- };
@@ -1,44 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
1
- import { RecommendationBlockId as i } from "../constants/blockIds.js";
2
- import { DEFAULT_ROW_SPACING as l } from "../constants/layout.js";
3
- import { ATTR_RECOMMENDATION_TITLE as n } from "../constants/selectors.js";
4
- const p = "You May Also Like!", d = '<p style="font-size: 28px; color: #333333;"><strong>{-{-TITLE-}-}</strong></p>';
5
- function m(r = d, t = !0, s = l) {
6
- const e = `class="recommendation-attribute-row" data-attribute-type="${n}" data-visibility="${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 ins-recommendation-title es-p10t es-p10b es-p20l es-p20r"
15
- align="center"
16
- esd-extension-block-id="${i.TITLE}">
17
- ${r}
18
- </td>
19
- </tr>
20
- </tbody>
21
- </table>
22
- </td>
23
- </tr>
24
- <tr ${e}${o}>
25
- <td class="spacer" style="height: ${s}px;"></td>
26
- </tr>
27
- `;
28
- }
29
- export {
30
- d as DEFAULT_TITLE_PARAGRAPH,
31
- p as DEFAULT_TITLE_TEXT,
32
- m as buildTitleRows
33
- };