@useinsider/guido 3.8.0 → 3.8.1-beta.0fbf78a

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 (54) hide show
  1. package/dist/composables/useHtmlValidator.js +180 -133
  2. package/dist/config/compiler/utils/recommendationCompilerUtils.js +64 -69
  3. package/dist/config/compiler/utils/recommendationIgnoreUtils.js +15 -0
  4. package/dist/config/migrator/itemsBlockMigrator.js +154 -115
  5. package/dist/config/migrator/recommendation/extractors.js +44 -22
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +175 -169
  7. package/dist/config/migrator/recommendationMigrator.js +30 -31
  8. package/dist/extensions/Blocks/Items/template.js +26 -27
  9. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +22 -15
  10. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +55 -41
  11. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +42 -43
  12. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -45
  13. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +3 -2
  14. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +64 -60
  15. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +294 -335
  16. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +7 -6
  17. package/dist/extensions/Blocks/Recommendation/extension.js +7 -5
  18. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -2
  19. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -2
  20. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +142 -173
  21. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +56 -29
  22. package/dist/extensions/Blocks/Recommendation/templates/index.js +30 -8
  23. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +132 -105
  24. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +44 -23
  25. package/dist/extensions/Blocks/Recommendation/templates/utils.js +112 -64
  26. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +219 -0
  27. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
  28. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +30 -22
  29. package/dist/extensions/Blocks/Unsubscribe/block.js +1 -1
  30. package/dist/extensions/Blocks/controlFactories.js +159 -133
  31. package/dist/src/composables/useHtmlValidator.d.ts +27 -0
  32. package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
  33. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +17 -0
  34. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
  35. package/dist/src/config/migrator/recommendation/extractors.d.ts +15 -0
  36. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +8 -0
  37. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
  38. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  39. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +23 -0
  40. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
  41. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +7 -0
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +7 -1
  43. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -0
  44. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +29 -47
  45. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  46. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  47. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
  48. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +165 -11
  49. package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +78 -0
  50. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
  51. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +29 -9
  52. package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
  53. package/package.json +1 -1
  54. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
@@ -1,250 +1,276 @@
1
- import { TextAlignBuiltInControl as s, TextColorBuiltInControl as l, TextSizeBuiltInControl as u, TextStyleBuiltInControl as i, TextFontFamilyBuiltInControl as c, ButtonBackgroundColorBuiltInControl as d, TextPaddingsBuiltInControl as a, ImageSizeBuiltInControl as g, ImageMarginsBuiltInControl as x, ButtonAlignBuiltInControl as C, ButtonBorderBuiltInControl as f, ButtonBorderRadiusBuiltInControl as B, ButtonColorBuiltInControl as T, ButtonFontFamilyBuiltInControl as I, ButtonMarginsBuiltInControl as y, ButtonPaddingsBuiltInControl as m, ButtonTextBuiltInControl as A, ButtonTextSizeBuiltInControl as S, ButtonTextStyleAndFontColorBuiltInControl as N, ButtonFitToContainerBuiltInControl as b, TextLineSpacingBuiltInControl as q } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- function k(o, n, r) {
3
- return class extends s {
1
+ import { TextAlignBuiltInControl as a, TextColorBuiltInControl as g, TextSizeBuiltInControl as x, TextStyleBuiltInControl as f, TextFontFamilyBuiltInControl as C, ButtonBackgroundColorBuiltInControl as T, TextPaddingsBuiltInControl as B, ImageSizeBuiltInControl as I, ImageMarginsBuiltInControl as y, ButtonAlignBuiltInControl as m, ButtonBorderBuiltInControl as S, ButtonBorderRadiusBuiltInControl as A, ButtonColorBuiltInControl as b, ButtonFontFamilyBuiltInControl as N, ButtonMarginsBuiltInControl as q, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as k, ButtonTextSizeBuiltInControl as p, ButtonTextStyleAndFontColorBuiltInControl as F, ButtonFitToContainerBuiltInControl as h, TextLineSpacingBuiltInControl as M } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ const z = "buttonTextStyleForm";
3
+ function P(o, n, r) {
4
+ return class extends a {
4
5
  getId() {
5
6
  return o;
6
7
  }
7
- getTargetNodes(t) {
8
+ getTargetNodes(e) {
8
9
  if (!n || !r)
9
- return [t];
10
- const e = t.closest(r);
11
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
10
+ return [e];
11
+ const t = e.closest(r);
12
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
12
13
  }
13
14
  };
14
15
  }
15
- function p(o, n, r) {
16
- return class extends l {
16
+ function _(o, n, r) {
17
+ return class extends g {
17
18
  getId() {
18
19
  return o;
19
20
  }
20
- getTargetNodes(t) {
21
+ getTargetNodes(e) {
21
22
  if (!n || !r)
22
- return [t];
23
- const e = t.closest(r);
24
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
23
+ return [e];
24
+ const t = e.closest(r);
25
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
25
26
  }
26
27
  };
27
28
  }
28
- function F(o, n, r) {
29
- return class extends u {
29
+ function v(o, n, r) {
30
+ return class extends x {
30
31
  getId() {
31
32
  return o;
32
33
  }
33
- getTargetNodes(t) {
34
+ getTargetNodes(e) {
34
35
  if (!n || !r)
35
- return [t];
36
- const e = t.closest(r);
37
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
36
+ return [e];
37
+ const t = e.closest(r);
38
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
38
39
  }
39
40
  };
40
41
  }
41
- function z(o, n, r) {
42
- return class extends i {
42
+ function L(o, n, r) {
43
+ return class extends f {
43
44
  getId() {
44
45
  return o;
45
46
  }
46
- getTargetNodes(t) {
47
+ getTargetNodes(e) {
47
48
  if (!n || !r)
48
- return [t];
49
- const e = t.closest(r);
50
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
49
+ return [e];
50
+ const t = e.closest(r);
51
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
51
52
  }
52
53
  };
53
54
  }
54
- function M(o, n, r) {
55
- return class extends c {
55
+ function R(o, n, r) {
56
+ return class extends C {
56
57
  getId() {
57
58
  return o;
58
59
  }
59
- getTargetNodes(t) {
60
+ getTargetNodes(e) {
60
61
  if (!n || !r)
61
- return [t];
62
- const e = t.closest(r);
63
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
62
+ return [e];
63
+ const t = e.closest(r);
64
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
64
65
  }
65
66
  };
66
67
  }
67
- function P(o, n, r) {
68
- return class extends d {
68
+ function O(o, n, r) {
69
+ return class extends T {
69
70
  getId() {
70
71
  return o;
71
72
  }
72
- getTargetNodes(t) {
73
+ getTargetNodes(e) {
73
74
  if (!n || !r)
74
- return [t];
75
- const e = t.closest(r);
76
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
75
+ return [e];
76
+ const t = e.closest(r);
77
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
77
78
  }
78
79
  };
79
80
  }
80
- function h(o, n, r) {
81
- return class extends a {
81
+ function Y(o, n, r) {
82
+ return class extends B {
82
83
  getId() {
83
84
  return o;
84
85
  }
85
- getTargetNodes(t) {
86
+ getTargetNodes(e) {
86
87
  if (!n || !r)
87
- return [t];
88
- const e = t.closest(r);
89
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
88
+ return [e];
89
+ const t = e.closest(r);
90
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
90
91
  }
91
92
  };
92
93
  }
93
- function L(o, n, r) {
94
- return class extends q {
94
+ function w(o, n, r) {
95
+ return class extends M {
95
96
  getId() {
96
97
  return o;
97
98
  }
98
- getTargetNodes(t) {
99
- return [t];
99
+ getTargetNodes(e) {
100
+ return [e];
100
101
  }
101
102
  };
102
103
  }
103
- function R(o, n, r = ".ins-recommendation-product-container") {
104
- return class extends C {
104
+ function D(o, n, r = ".ins-recommendation-product-container") {
105
+ return class extends m {
105
106
  getId() {
106
107
  return o;
107
108
  }
108
- getTargetNodes(t) {
109
- const e = t.closest(r);
110
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
109
+ getTargetNodes(e) {
110
+ const t = e.closest(r);
111
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
111
112
  }
112
113
  };
113
114
  }
114
- function j(o, n, r = ".ins-recommendation-product-container") {
115
- return class extends T {
115
+ function H(o, n, r = ".ins-recommendation-product-container") {
116
+ return class extends b {
116
117
  getId() {
117
118
  return o;
118
119
  }
119
- getTargetNodes(t) {
120
- const e = t.closest(r);
121
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
120
+ getTargetNodes(e) {
121
+ const t = e.closest(r);
122
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
122
123
  }
123
124
  };
124
125
  }
125
- function v(o, n, r = ".ins-recommendation-product-container") {
126
- return class extends f {
126
+ function K(o, n, r = ".ins-recommendation-product-container") {
127
+ return class extends S {
127
128
  getId() {
128
129
  return o;
129
130
  }
130
- getTargetNodes(t) {
131
- const e = t.closest(r);
132
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
131
+ getTargetNodes(e) {
132
+ const t = e.closest(r);
133
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
133
134
  }
134
135
  };
135
136
  }
136
- function w(o, n, r = ".ins-recommendation-product-container") {
137
- return class extends B {
137
+ function U(o, n, r = ".ins-recommendation-product-container") {
138
+ return class extends A {
138
139
  getId() {
139
140
  return o;
140
141
  }
141
- getTargetNodes(t) {
142
- const e = t.closest(r);
143
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
142
+ getTargetNodes(e) {
143
+ const t = e.closest(r);
144
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
144
145
  }
145
146
  };
146
147
  }
147
- function D(o, n, r = ".ins-recommendation-product-container") {
148
- return class extends I {
148
+ function V(o, n, r = ".ins-recommendation-product-container") {
149
+ return class extends N {
149
150
  getId() {
150
151
  return o;
151
152
  }
152
- getTargetNodes(t) {
153
- const e = t.closest(r);
154
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
153
+ getTargetNodes(e) {
154
+ const t = e.closest(r);
155
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
155
156
  }
156
157
  };
157
158
  }
158
- function E(o, n, r = ".ins-recommendation-product-container") {
159
- return class extends y {
159
+ function W(o, n, r = ".ins-recommendation-product-container") {
160
+ return class extends q {
160
161
  getId() {
161
162
  return o;
162
163
  }
163
- getTargetNodes(t) {
164
- const e = t.closest(r);
165
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
164
+ getTargetNodes(e) {
165
+ const t = e.closest(r);
166
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
166
167
  }
167
168
  };
168
169
  }
169
- function G(o, n, r = ".ins-recommendation-product-container") {
170
- return class extends m {
170
+ function X(o, n, r = ".ins-recommendation-product-container") {
171
+ return class extends $ {
171
172
  getId() {
172
173
  return o;
173
174
  }
174
- getTargetNodes(t) {
175
- const e = t.closest(r);
176
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
175
+ getTargetNodes(e) {
176
+ const t = e.closest(r);
177
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
177
178
  }
178
179
  };
179
180
  }
180
- function H(o, n, r = ".ins-recommendation-product-container") {
181
- return class extends A {
181
+ function j(o, n, r = ".ins-recommendation-product-container") {
182
+ return class extends k {
182
183
  getId() {
183
184
  return o;
184
185
  }
185
- getTargetNodes(t) {
186
- const e = t.closest(r);
187
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
186
+ getTargetNodes(e) {
187
+ const t = e.closest(r);
188
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
188
189
  }
189
190
  };
190
191
  }
191
- function J(o, n, r = ".ins-recommendation-product-container") {
192
- return class extends S {
192
+ function G(o, n, r = ".ins-recommendation-product-container") {
193
+ return class extends p {
193
194
  getId() {
194
195
  return o;
195
196
  }
196
- getTargetNodes(t) {
197
- const e = t.closest(r);
198
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
197
+ getTargetNodes(e) {
198
+ const t = e.closest(r);
199
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
199
200
  }
200
201
  };
201
202
  }
202
- function K(o, n, r) {
203
- return class extends N {
203
+ function J(o, n, r) {
204
+ return class extends F {
204
205
  getId() {
205
206
  return o;
206
207
  }
207
- getTargetNodes(t) {
208
- const e = t.closest(r);
209
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
208
+ getTargetNodes(e) {
209
+ const t = e.closest(r);
210
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
211
+ }
212
+ /**
213
+ * Propagates Bold/Italic to ALL product buttons, not just the focused one.
214
+ *
215
+ * Stripo's built-in applies font-color/size to every target node but writes
216
+ * the text-style (font-weight/font-style) only to the selected button. Bold/italic
217
+ * are plain inline CSS on the `<a class="es-button">` (no tags), so we mirror them
218
+ * onto every button's anchor. The toggle state comes from the control's form
219
+ * (`buttonTextStyleForm.{bold,italic}`) because the patched node isn't updated yet
220
+ * when this runs. Returned modifications are merged into the parent control's patch.
221
+ */
222
+ getAdditionalModifications(e) {
223
+ const t = e.closest(r);
224
+ if (!t)
225
+ return;
226
+ const i = t.querySelectorAll(`[esd-extension-block-id="${n}"] a.es-button`);
227
+ if (!i.length)
228
+ return;
229
+ const s = this.api.getValues()[z];
230
+ if (!s)
231
+ return;
232
+ const u = s.bold ? "bold" : "normal", c = s.italic ? "italic" : "normal", l = this.api.getDocumentModifier();
233
+ return i.forEach((d) => {
234
+ l.modifyHtml(d).setStyle("font-weight", u).setStyle("font-style", c);
235
+ }), l;
210
236
  }
211
237
  };
212
238
  }
213
- function O(o, n, r) {
214
- return class extends b {
239
+ function Q(o, n, r) {
240
+ return class extends h {
215
241
  getId() {
216
242
  return o;
217
243
  }
218
- getTargetNodes(t) {
219
- const e = t.closest(r);
220
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
244
+ getTargetNodes(e) {
245
+ const t = e.closest(r);
246
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
221
247
  }
222
248
  };
223
249
  }
224
- function Q(o, n, r) {
225
- return class extends g {
250
+ function Z(o, n, r) {
251
+ return class extends I {
226
252
  getId() {
227
253
  return o;
228
254
  }
229
- getTargetNodes(t) {
255
+ getTargetNodes(e) {
230
256
  try {
231
- const e = t.closest(r);
232
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
257
+ const t = e.closest(r);
258
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
233
259
  } catch {
234
260
  return [];
235
261
  }
236
262
  }
237
263
  };
238
264
  }
239
- function U(o, n, r) {
240
- return class extends x {
265
+ function tt(o, n, r) {
266
+ return class extends y {
241
267
  getId() {
242
268
  return o;
243
269
  }
244
- getTargetNodes(t) {
270
+ getTargetNodes(e) {
245
271
  try {
246
- const e = t.closest(r);
247
- return e ? e.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
272
+ const t = e.closest(r);
273
+ return t ? t.querySelectorAll(`[esd-extension-block-id="${n}"]`) : [];
248
274
  } catch {
249
275
  return [];
250
276
  }
@@ -252,25 +278,25 @@ function U(o, n, r) {
252
278
  };
253
279
  }
254
280
  export {
255
- R as createButtonAlignControl,
256
- v as createButtonBorderControl,
257
- w as createButtonBorderRadiusControl,
258
- j as createButtonColorControl,
259
- O as createButtonFitToContainerControl,
260
- D as createButtonFontFamilyControl,
261
- E as createButtonMarginsControl,
262
- G as createButtonPaddingsControl,
263
- H as createButtonTextControl,
264
- J as createButtonTextSizeControl,
265
- K as createButtonTextStyleAndFontColorControl,
266
- U as createImageMarginsControl,
267
- Q as createImageSizeControl,
268
- h as createPaddingsControl,
269
- k as createTextAlignControl,
270
- P as createTextBackgroundColorControl,
271
- p as createTextColorControl,
272
- M as createTextFontFamilyControl,
273
- L as createTextLineSpacingControl,
274
- F as createTextSizeControl,
275
- z as createTextStyleControl
281
+ D as createButtonAlignControl,
282
+ K as createButtonBorderControl,
283
+ U as createButtonBorderRadiusControl,
284
+ H as createButtonColorControl,
285
+ Q as createButtonFitToContainerControl,
286
+ V as createButtonFontFamilyControl,
287
+ W as createButtonMarginsControl,
288
+ X as createButtonPaddingsControl,
289
+ j as createButtonTextControl,
290
+ G as createButtonTextSizeControl,
291
+ J as createButtonTextStyleAndFontColorControl,
292
+ tt as createImageMarginsControl,
293
+ Z as createImageSizeControl,
294
+ Y as createPaddingsControl,
295
+ P as createTextAlignControl,
296
+ O as createTextBackgroundColorControl,
297
+ _ as createTextColorControl,
298
+ R as createTextFontFamilyControl,
299
+ w as createTextLineSpacingControl,
300
+ v as createTextSizeControl,
301
+ L as createTextStyleControl
276
302
  };
@@ -1,4 +1,31 @@
1
1
  import type { DynamicContent } from '@@/Types/generic';
2
+ import type { FiltersResponse } from '@@/Types/recommendation';
3
+ /**
4
+ * Parses a `{{recoId_index_attributeName}}` variable (already stripped of the
5
+ * braces/whitespace) into its recommendation id and attribute name. Returns
6
+ * null for anything that isn't a well-formed recommendation variable.
7
+ */
8
+ export declare function parseRecommendationVariable(field: string): {
9
+ recoId: string;
10
+ attribute: string;
11
+ } | null;
12
+ /**
13
+ * Builds the set of attribute forms valid inside partner-authored
14
+ * `{{recoId_index_attribute}}` variables: the built-in compiler attributes plus
15
+ * each account attribute in its canonical token form — bare for
16
+ * `defaultAttribute`, `product_attribute.<name>` for `productAttribute`. Using
17
+ * `resolveProductAttrValue` (the same producer the block builder uses) keeps the
18
+ * validator's notion of "valid form" identical to what is actually emitted.
19
+ */
20
+ export declare function buildPartnerAttributeNameSet(filterList: FiltersResponse): Set<string>;
21
+ /**
22
+ * Returns the `{{...}}` custom fields in the HTML that are invalid. Partner
23
+ * attributes in `ins-skip-compile` blocks (recoId ∈ ignoredIds) are checked
24
+ * against `ignoredAttributeNames`; Guido-generated reco variables and known merge
25
+ * tags pass. An unrecognized dotted token is ignored: it was never captured
26
+ * before, so flagging it would false-positive on merge tags like `{{user.name}}`.
27
+ */
28
+ export declare function findInvalidCustomFields(html: string, validCustomFields: string[], recommendationBlockIds: string[], ignoredIds: Set<string>, ignoredAttributeNames: Set<string> | null): string[];
2
29
  export declare const useHtmlValidator: () => {
3
30
  validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
4
31
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Returns true when a recommendation block has opted out of Guido's
3
+ * product-data → template-variable substitution. Partners signal opt-out by
4
+ * adding the `ins-skip-compile` class on the `.recommendation-block-v2`
5
+ * element. Only the variable substitution is skipped — campaign URL building,
6
+ * hidden-row removal, Outlook image widths, discount conditions, text-trim CSS
7
+ * and general HTML optimizations still apply. See `CSS_CLASS_SKIP_COMPILE` for
8
+ * the full scope.
9
+ */
10
+ export declare function isIgnoredRecommendationBlock(block: Element): boolean;
11
+ /**
12
+ * DOM-parses the HTML once and returns the set of `recommendation-id`
13
+ * values that belong to ignored blocks. Use this in regex/string-based
14
+ * compiler rules where the rule processes flat matches and only has the
15
+ * extracted block ID rather than a DOM Element reference.
16
+ */
17
+ export declare function getIgnoredRecommendationBlockIds(html: string): Set<string>;
@@ -5,3 +5,18 @@ export declare function extractTitleText(block: Element): string;
5
5
  * the caller treats that as "no segment background".
6
6
  */
7
7
  export declare function extractCardBgColor(block: Element): string;
8
+ /**
9
+ * Reads the legacy block's own `currency-*` attributes into a
10
+ * `currencySettings`-shaped object that `mapCurrency` understands. Used as a
11
+ * fallback when the external recommendationConfigs map has no entry for this
12
+ * block, so the migrated block keeps its real currency instead of defaulting.
13
+ * Returns undefined when the block carries no `currency` attribute.
14
+ */
15
+ export declare function extractCurrencyFromBlock(block: Element): Record<string, string> | undefined;
16
+ /**
17
+ * True when a PM has manually opted the legacy block out of content
18
+ * regeneration by adding the `ins-skip-compile` class. Detected before rebuild
19
+ * so the migrator preserves the partner's markup verbatim (keeping their
20
+ * hand-authored variables) instead of regenerating the block.
21
+ */
22
+ export declare function isPartnerManagedBlock(block: Element): boolean;
@@ -8,4 +8,12 @@ export declare function buildBlockHtml(params: {
8
8
  extraClasses?: string;
9
9
  legacyId?: string;
10
10
  legacyBgColor?: string;
11
+ /**
12
+ * When set, the block's existing inner HTML is preserved verbatim instead
13
+ * of regenerating product rows — used for partner-customized blocks so
14
+ * their hand-authored `{{...}}` variables survive migration.
15
+ */
16
+ preserveInnerHtml?: string;
17
+ /** Adds the `ins-skip-compile` opt-out class to the migrated block. */
18
+ skipCompile?: boolean;
11
19
  }): string;
@@ -120,11 +120,11 @@ export declare const ButtonControls: {
120
120
  new (): {
121
121
  getId(): string;
122
122
  getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
123
+ getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
123
124
  getParentControlId(): string;
124
125
  getLabels(): import("@stripoinc/ui-editor-extensions").ButtonTextStyleAndFontColorControlLabels | undefined;
125
126
  api: import("@stripoinc/ui-editor-extensions").ControlApi;
126
127
  getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
127
- getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
128
128
  isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
129
129
  };
130
130
  };
@@ -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, 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_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, 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_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, 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';
@@ -23,6 +23,18 @@ export declare const MOBILE_ROW_SELECTOR = ".ins-recommendation-mobile-row";
23
23
  * `{{cId_pIdx_url}}` template variable.
24
24
  */
25
25
  export declare const CSS_CLASS_RECO_BUTTON = "reco-v3-button";
26
+ /**
27
+ * Opt-out class for partners who want to inject their own template variables
28
+ * into a recommendation block. When present on `.recommendation-block-v2`,
29
+ * Guido skips ONLY its product-data → template-variable substitution
30
+ * (`replaceProductAttributes`) for that block — partners author their own
31
+ * `{{recoId_index_attribute}}` variables. Everything else (campaign URL
32
+ * building, hidden-row removal, Outlook image widths, text-trim CSS, discount
33
+ * conditions, store hydration, store-level config validation, and general HTML
34
+ * optimizations) still applies. The class is preserved in the final compiled
35
+ * output so partners may use it for their own styling.
36
+ */
37
+ export declare const CSS_CLASS_SKIP_COMPILE = "ins-skip-compile";
26
38
  /**
27
39
  * Currency HTML attributes set on the block element
28
40
  * These are read by the HTML compiler at runtime to format prices
@@ -56,8 +68,19 @@ export declare const ATTR_CUSTOM_PREFIX = "customAttr:";
56
68
  export declare const ATTR_DATA_CUSTOM_ATTRIBUTES = "data-custom-attributes";
57
69
  /** HTML attribute on <td> elements identifying the product attribute for compiler template variable generation */
58
70
  export declare const ATTR_PRODUCT_ATTR = "product-attr";
71
+ /** Prefix `resolveProductAttrValue` puts on custom (non-default) product attributes in `product-attr` values */
72
+ export declare const PRODUCT_ATTRIBUTE_PREFIX = "product_attribute.";
59
73
  /**
60
74
  * Default attribute names that are already represented by built-in composition toggle items.
61
75
  * Used to exclude these from the custom attribute dropdown to prevent duplication with toggles.
62
76
  */
63
77
  export declare const BUILT_IN_DEFAULT_ATTRIBUTES: Set<string>;
78
+ /**
79
+ * Attribute names valid inside a `{{recoId_index_attributeName}}` template
80
+ * variable regardless of the account's custom attribute list. Every built-in
81
+ * composition attribute is valid, plus `currency` and `discount` which the
82
+ * compiler emits but are not composition toggles. Custom attributes are
83
+ * validated separately against the account's fetched attribute list
84
+ * (`stripo/email-recommendation-attributes`).
85
+ */
86
+ export declare const RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES: Set<string>;
@@ -120,11 +120,11 @@ export declare const ButtonControls: {
120
120
  new (): {
121
121
  getId(): string;
122
122
  getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
123
+ getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
123
124
  getParentControlId(): string;
124
125
  getLabels(): import("@stripoinc/ui-editor-extensions").ButtonTextStyleAndFontColorControlLabels | undefined;
125
126
  api: import("@stripoinc/ui-editor-extensions").ControlApi;
126
127
  getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
127
- getAdditionalModifications(_root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
128
128
  isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
129
129
  };
130
130
  };
@@ -17,6 +17,13 @@ export declare class RecommendationCardCompositionControl extends CommonControl
17
17
  getId(): string;
18
18
  getTemplate(): string;
19
19
  onRender(): void;
20
+ /**
21
+ * Card composition restructures the block (toggles/reorders/adds attribute
22
+ * cells), which would corrupt a partner-managed (`ins-skip-compile`) block's
23
+ * preserved markup. There is no native tab-disable API, so the whole control
24
+ * container is rendered inert (greyed + non-interactive) instead.
25
+ */
26
+ _syncDisabledState(): void;
20
27
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
21
28
  onDestroy(): void;
22
29
  private _initializeComposition;
@@ -21,6 +21,11 @@ export declare class LayoutOrientationControl extends CommonControl {
21
21
  getTemplate(): string;
22
22
  onRender(): void;
23
23
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
24
+ /**
25
+ * Layout orientation restructures the whole block, which is meaningless for
26
+ * partner-managed (`ins-skip-compile`) blocks — disable the control there.
27
+ */
28
+ _syncDisabledState(): void;
24
29
  _setFormValues(): void;
25
30
  /**
26
31
  * Handles layout change
@@ -31,7 +36,8 @@ export declare class LayoutOrientationControl extends CommonControl {
31
36
  * Regenerates product rows based on the selected layout
32
37
  * Uses unified style-preserving regeneration to maintain user customizations
33
38
  * @param layout - The layout to use for regeneration (passed explicitly to avoid stale DOM reads)
39
+ * @param composition - The preserved card composition, incl. customAttr:* entries
34
40
  */
35
- _regenerateProductRows(layout: Orientation): void;
41
+ _regenerateProductRows(layout: Orientation, composition: string[]): void;
36
42
  _listenToFormUpdates(): void;
37
43
  }