@useinsider/guido 3.8.1 → 3.8.2-beta.06011ff

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 (61) hide show
  1. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +8 -8
  2. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +15 -12
  3. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  4. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +16 -15
  5. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  6. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +42 -37
  7. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  8. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +40 -37
  9. package/dist/composables/useHtmlCompiler.js +13 -10
  10. package/dist/composables/useHtmlValidator.js +180 -133
  11. package/dist/composables/usePreviewInteractionGuard.js +17 -0
  12. package/dist/composables/useSave.js +14 -14
  13. package/dist/composables/validators/useUnsubscribeBlockValidator.js +26 -17
  14. package/dist/config/compiler/htmlCompilerRules.js +38 -10
  15. package/dist/config/compiler/recommendationCompilerRules.js +83 -108
  16. package/dist/config/compiler/utils/recommendationCompilerUtils.js +58 -57
  17. package/dist/config/compiler/utils/recommendationIgnoreUtils.js +15 -0
  18. package/dist/config/migrator/recommendation/extractors.js +44 -22
  19. package/dist/config/migrator/recommendation/htmlBuilder.js +175 -169
  20. package/dist/config/migrator/recommendationMigrator.js +30 -31
  21. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +26 -20
  22. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +55 -41
  23. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +22 -21
  24. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +58 -57
  25. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +43 -31
  26. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +3 -2
  27. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +55 -45
  28. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +60 -53
  29. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +7 -6
  30. package/dist/extensions/Blocks/Recommendation/extension.js +3 -2
  31. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +62 -4
  32. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
  33. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -2
  34. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +13 -12
  35. package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -6
  36. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  37. package/dist/extensions/Blocks/Unsubscribe/block.js +40 -37
  38. package/dist/extensions/Blocks/Unsubscribe/control.js +19 -16
  39. package/dist/extensions/Blocks/common-control.js +58 -45
  40. package/dist/guido.css +1 -1
  41. package/dist/src/composables/useHtmlValidator.d.ts +27 -0
  42. package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
  43. package/dist/src/composables/usePreviewInteractionGuard.d.ts +3 -0
  44. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +1 -0
  45. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +17 -0
  46. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
  47. package/dist/src/config/migrator/recommendation/extractors.d.ts +15 -0
  48. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +8 -0
  49. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  50. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +21 -0
  51. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +7 -0
  52. package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +1 -1
  53. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +5 -0
  54. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -0
  55. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -0
  56. package/dist/src/extensions/Blocks/common-control.d.ts +7 -0
  57. package/dist/src/stores/unsubscribe.d.ts +11 -1
  58. package/dist/src/utils/ampErrorFilter.d.ts +1 -0
  59. package/dist/stores/unsubscribe.js +8 -7
  60. package/dist/utils/ampErrorFilter.js +6 -5
  61. package/package.json +1 -1
@@ -1,19 +1,20 @@
1
1
  var S = Object.defineProperty;
2
- var L = (c, o, e) => o in c ? S(c, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[o] = e;
3
- var a = (c, o, e) => L(c, typeof o != "symbol" ? o + "" : o, e);
4
- import { useToaster as f } from "../../../composables/useToaster.js";
2
+ var f = (c, o, e) => o in c ? S(c, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[o] = e;
3
+ var a = (c, o, e) => f(c, typeof o != "symbol" ? o + "" : o, e);
4
+ import { useToaster as L } from "../../../composables/useToaster.js";
5
5
  import { ToasterTypeOptions as A } from "../../../enums/toaster.js";
6
6
  import { PAGE_TYPES as h } from "../../../enums/unsubscribe.js";
7
- import { useUnsubscribeStore as u } from "../../../stores/unsubscribe.js";
8
- import { Block as y, BlockCompositionType as T, ContextActionType as k, ModificationDescription as d, BlockType as I } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
9
- import { getDefaultTemplate as v } from "./template.js";
7
+ import { useEditorStore as y } from "../../../stores/editor.js";
8
+ import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
9
+ import { Block as T, BlockCompositionType as I, ContextActionType as B, ModificationDescription as d, BlockType as v } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
10
+ import { getDefaultTemplate as C } from "./template.js";
10
11
  import { UNSUBSCRIBE_BLOCK_SELECTOR as m, DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as b } from "./utils/constants.js";
11
- import { parsePageList as B } from "./utils/utils.js";
12
- const C = "unsubscribe-block", E = 'a[data-unsubscribe-link="true"]', N = "{{ins-unsubscribe-link}}", U = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", R = "Removing the unsubscribe text leaves an empty block, but an active unsubscribe link is required. Undo your last action to restore the text, or delete the unsubscribe block entirely.", D = {
12
+ import { parsePageList as _ } from "./utils/utils.js";
13
+ const N = "unsubscribe-block", E = 'a[data-unsubscribe-link="true"]', U = "{{ins-unsubscribe-link}}", R = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", D = "Removing the unsubscribe text leaves an empty block, but an active unsubscribe link is required. Undo your last action to restore the text, or delete the unsubscribe block entirely.", w = {
13
14
  [h.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
14
15
  [h.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
15
- }, w = 3;
16
- class H extends y {
16
+ }, P = 3;
17
+ class W extends T {
17
18
  constructor() {
18
19
  super();
19
20
  a(this, "selectEventListener", null);
@@ -29,13 +30,13 @@ class H extends y {
29
30
  a(this, "guardAttemptsByBlockId", /* @__PURE__ */ new Map());
30
31
  }
31
32
  getId() {
32
- return C;
33
+ return N;
33
34
  }
34
35
  getIcon() {
35
36
  return "unsubscribe-icon";
36
37
  }
37
38
  getBlockCompositionType() {
38
- return T.BLOCK;
39
+ return I.BLOCK;
39
40
  }
40
41
  getName() {
41
42
  return this.api.translate("Unsubscribe Block");
@@ -44,15 +45,16 @@ class H extends y {
44
45
  return this.api.translate("Unsubscribe Block Description");
45
46
  }
46
47
  getTemplate() {
47
- return v();
48
+ return C();
48
49
  }
49
50
  getContextActionsIds() {
50
- return [k.MOVE, k.REMOVE];
51
+ return [B.MOVE, B.REMOVE];
51
52
  }
52
53
  onSelect(e) {
53
- this.currentNode = e;
54
+ if (this.currentNode = e, y().isPreviewModeOpen)
55
+ return;
54
56
  const t = this._getOrAssignBlockId(e);
55
- t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), this._setupSelectEventListener(), this._setupCancelEventListener(), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), this._loadBlockState(e), this._checkExistingBlocks(), this._openDrawer());
57
+ t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), this._setupSelectEventListener(), this._setupCancelEventListener(t), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), t && (l().pendingBlockId = t), this._loadBlockState(e), this._checkExistingBlocks(), this._openDrawer());
56
58
  }
57
59
  onCreated(e) {
58
60
  this._ensureLeadingTextGuard(e);
@@ -107,9 +109,9 @@ class H extends y {
107
109
  const g = this._getOrAssignBlockId(e);
108
110
  if (!g)
109
111
  return;
110
- const _ = this.guardAttemptsByBlockId.get(g) ?? 0;
111
- if (!(_ >= w)) {
112
- this.guardAttemptsByBlockId.set(g, _ + 1);
112
+ const k = this.guardAttemptsByBlockId.get(g) ?? 0;
113
+ if (!(k >= P)) {
114
+ this.guardAttemptsByBlockId.set(g, k + 1);
113
115
  try {
114
116
  this.api.getDocumentModifier().modifyHtml(r).prepend(" ").apply(new d("Ensure unsubscribe link text guard"));
115
117
  } catch (p) {
@@ -154,8 +156,8 @@ class H extends y {
154
156
  const t = this.api.getDocumentRoot();
155
157
  t && "querySelectorAll" in t && t.querySelectorAll(m).forEach((r) => {
156
158
  if ("getAttribute" in r) {
157
- const i = r.getAttribute(n.BLOCK_ID), l = i ? parseInt(i) : 0;
158
- l > e && (e = l);
159
+ const i = r.getAttribute(n.BLOCK_ID), u = i ? parseInt(i) : 0;
160
+ u > e && (e = u);
159
161
  }
160
162
  });
161
163
  } catch {
@@ -164,14 +166,14 @@ class H extends y {
164
166
  }
165
167
  _warnLinkRemoved() {
166
168
  try {
167
- const { showToaster: e } = f();
169
+ const { showToaster: e } = L();
168
170
  e({
169
171
  type: A.Warning,
170
- message: this.api.translate(R),
172
+ message: this.api.translate(D),
171
173
  actionButton: {
172
174
  text: this.api.translate("Visit Academy"),
173
175
  onClick: () => {
174
- window.open(U, "_blank", "noopener,noreferrer");
176
+ window.open(R, "_blank", "noopener,noreferrer");
175
177
  }
176
178
  }
177
179
  });
@@ -188,9 +190,10 @@ class H extends y {
188
190
  _removeSelectEventListener() {
189
191
  this.selectEventListener && (document.removeEventListener(b.SELECT, this.selectEventListener), this.selectEventListener = null);
190
192
  }
191
- _setupCancelEventListener() {
192
- this._removeCancelEventListener(), this.cancelEventListener = () => {
193
- this._handleCancel();
193
+ _setupCancelEventListener(e) {
194
+ this._removeCancelEventListener(), this.cancelEventListener = (t) => {
195
+ const { detail: s } = t;
196
+ ((s == null ? void 0 : s.blockId) ?? null) === e && this._handleCancel();
194
197
  }, document.addEventListener(b.CANCEL, this.cancelEventListener);
195
198
  }
196
199
  _removeCancelEventListener() {
@@ -200,7 +203,7 @@ class H extends y {
200
203
  try {
201
204
  if (!this.currentNode)
202
205
  return;
203
- this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${I.EMPTY_CONTAINER}/>`).apply(new d("Removed unsubscribe block due to cancel"));
206
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${v.EMPTY_CONTAINER}/>`).apply(new d("Removed unsubscribe block due to cancel"));
204
207
  } catch (e) {
205
208
  console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
206
209
  }
@@ -218,19 +221,19 @@ class H extends y {
218
221
  this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", r).apply(new d(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(n.PAGE_TYPE, e.toString()).setAttribute(n.PAGE_LIST, t).apply(new d("Updated unsubscribe block metadata"));
219
222
  }
220
223
  _getMergeTag(e) {
221
- return D[e] ?? N;
224
+ return w[e] ?? U;
222
225
  }
223
226
  _openDrawer() {
224
227
  if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
225
228
  try {
226
- const e = u();
229
+ const e = l();
227
230
  e.typeSelectionDrawerStatus = !0;
228
231
  } catch (e) {
229
232
  console.error("[UnsubscribeBlock] Failed to open drawer:", e);
230
233
  }
231
234
  }
232
235
  _checkExistingBlocks() {
233
- const e = u();
236
+ const e = l();
234
237
  e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(m).forEach((s) => {
235
238
  if ("getAttribute" in s) {
236
239
  const r = s.getAttribute(n.PAGE_TYPE);
@@ -247,11 +250,11 @@ class H extends y {
247
250
  const t = e.getAttribute(n.PAGE_TYPE), s = e.getAttribute(n.PAGE_LIST);
248
251
  if (!t || !s)
249
252
  return;
250
- const r = u(), i = Number(t), l = B(s);
251
- await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(l);
253
+ const r = l(), i = Number(t), u = _(s);
254
+ await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(u);
252
255
  }
253
256
  _resetStoreState() {
254
- u().$reset();
257
+ l().$reset();
255
258
  }
256
259
  _removeBlockTemplatesFromStore(e) {
257
260
  if (!("getAttribute" in e))
@@ -259,11 +262,11 @@ class H extends y {
259
262
  const t = e.getAttribute(n.PAGE_LIST);
260
263
  if (!t)
261
264
  return;
262
- const s = u(), r = B(t);
265
+ const s = l(), r = _(t);
263
266
  s.removeUnsubscribePages(r);
264
267
  }
265
268
  }
266
269
  export {
267
- C as UNSUBSCRIBE_BLOCK_ID,
268
- H as UnsubscribeBlock
270
+ N as UNSUBSCRIBE_BLOCK_ID,
271
+ W as UnsubscribeBlock
269
272
  };
@@ -1,18 +1,19 @@
1
1
  var T = Object.defineProperty;
2
- var p = (o, s, e) => s in o ? T(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
3
- var c = (o, s, e) => p(o, typeof s != "symbol" ? s + "" : s, e);
2
+ var p = (a, s, e) => s in a ? T(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
3
+ var c = (a, s, e) => p(a, typeof s != "symbol" ? s + "" : s, e);
4
+ import { useEditorStore as _ } from "../../../stores/editor.js";
4
5
  import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
5
- import { Control as _, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
+ import { Control as g, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
7
  import { DATA_ATTRIBUTES as d } from "./utils/constants.js";
7
8
  import { parsePageList as h } from "./utils/utils.js";
8
- const g = "ui-elements-unsubscribe", r = {
9
+ const v = "ui-elements-unsubscribe", r = {
9
10
  SELECT_BUTTON: "selectTemplateButton",
10
11
  PREV_BUTTON: "prevButton",
11
12
  NEXT_BUTTON: "nextButton",
12
13
  COUNTER_TEXT: "counterText",
13
14
  PREVIEW_IMAGE: "previewImage"
14
15
  };
15
- class B extends _ {
16
+ class w extends g {
16
17
  constructor() {
17
18
  super(...arguments);
18
19
  c(this, "currentPreviewIndex", 0);
@@ -22,7 +23,7 @@ class B extends _ {
22
23
  c(this, "lastParsedAttribute");
23
24
  }
24
25
  getId() {
25
- return g;
26
+ return v;
26
27
  }
27
28
  getTemplate() {
28
29
  return `
@@ -59,10 +60,12 @@ class B extends _ {
59
60
  this.api.onValueChanged(r.NEXT_BUTTON, () => this._onNextClick())
60
61
  );
61
62
  }
62
- _onButtonClick() {
63
+ async _onButtonClick() {
63
64
  try {
65
+ if (_().isPreviewModeOpen)
66
+ return;
64
67
  const e = l();
65
- this._reseedSelectionFromBlock(), e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
68
+ await e.fetchTemplates(!0), this._reseedSelectionFromBlock(), e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
66
69
  } catch (e) {
67
70
  console.error("[UnsubscribeControl] Failed to open drawer:", e);
68
71
  }
@@ -71,8 +74,8 @@ class B extends _ {
71
74
  const e = l();
72
75
  if (e.$reset(), !this.currentNode || !("getAttribute" in this.currentNode))
73
76
  return;
74
- const t = this.currentNode.getAttribute(d.PAGE_TYPE), a = this.currentNode.getAttribute(d.PAGE_LIST);
75
- !t || !a || (e.setCollectionWithoutAutoSelection(Number(t)), e.loadSelectedTemplates(h(a)));
77
+ const t = this.currentNode.getAttribute(d.PAGE_TYPE), o = this.currentNode.getAttribute(d.PAGE_LIST);
78
+ !t || !o || (e.setCollectionWithoutAutoSelection(Number(t)), e.loadSelectedTemplates(h(o)));
76
79
  }
77
80
  _onPrevClick() {
78
81
  this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
@@ -100,8 +103,8 @@ class B extends _ {
100
103
  }
101
104
  }
102
105
  _updateCounter() {
103
- const e = this.currentPreviewIndex + 1, t = this.totalTemplates, a = this.currentPreviewIndex === 0, u = this.currentPreviewIndex >= t - 1;
104
- this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, a), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, u), this.api.setUIEAttribute(
106
+ const e = this.currentPreviewIndex + 1, t = this.totalTemplates, o = this.currentPreviewIndex === 0, u = this.currentPreviewIndex >= t - 1;
107
+ this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, u), this.api.setUIEAttribute(
105
108
  r.COUNTER_TEXT,
106
109
  i.LABEL.text,
107
110
  `${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
@@ -142,8 +145,8 @@ class B extends _ {
142
145
  </${n.LABEL}>
143
146
  `;
144
147
  }
145
- _getIconButton(e, t, a) {
146
- const u = a ? `${i.BUTTON.disabled}="true"` : "";
148
+ _getIconButton(e, t, o) {
149
+ const u = o ? `${i.BUTTON.disabled}="true"` : "";
147
150
  return `
148
151
  <${n.BUTTON}
149
152
  id="${e}"
@@ -172,6 +175,6 @@ class B extends _ {
172
175
  }
173
176
  }
174
177
  export {
175
- g as UNSUBSCRIBE_CONTROL_ID,
176
- B as UnsubscribeControl
178
+ v as UNSUBSCRIBE_CONTROL_ID,
179
+ w as UnsubscribeControl
177
180
  };
@@ -1,12 +1,12 @@
1
1
  var c = Object.defineProperty;
2
- var i = (s, r, e) => r in s ? c(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
- var u = (s, r, e) => i(s, typeof r != "symbol" ? r + "" : r, e);
2
+ var i = (s, a, e) => a in s ? c(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e;
3
+ var T = (s, a, e) => i(s, typeof a != "symbol" ? a + "" : a, e);
4
4
  import { Control as I, UIElementType as n, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- class d extends I {
5
+ class _ extends I {
6
6
  constructor() {
7
7
  super(...arguments);
8
- u(this, "currentNode");
9
- u(this, "lastBlockInstanceId", null);
8
+ T(this, "currentNode");
9
+ T(this, "lastBlockInstanceId", null);
10
10
  }
11
11
  getContainer() {
12
12
  var e;
@@ -47,15 +47,15 @@ class d extends I {
47
47
  const t = this.getBlockInstanceId();
48
48
  if (!t)
49
49
  return !1;
50
- const o = t !== this.lastBlockInstanceId;
51
- return e(), o && (this.lastBlockInstanceId = t), o;
50
+ const E = t !== this.lastBlockInstanceId;
51
+ return e(), E && (this.lastBlockInstanceId = t), E;
52
52
  }
53
- _GuLabel({ text: e, name: t = "", hint: o }) {
53
+ _GuLabel({ text: e, name: t = "", hint: E }) {
54
54
  return `
55
55
  <${n.LABEL}
56
56
  ${$.LABEL.text}="${e}"
57
57
  ${$.LABEL.name}="${t || `${e} Label`}"
58
- ${o ? `${$.LABEL.hint}="${o}"` : ""}>
58
+ ${E ? `${$.LABEL.hint}="${E}"` : ""}>
59
59
  </${n.LABEL}>
60
60
  `;
61
61
  }
@@ -73,7 +73,7 @@ class d extends I {
73
73
  * Use in getTemplate() — the icon is registered in a hidden store so Stripo initializes it.
74
74
  * Pair with _setInfoMessageValue() in onRender() to set the text content.
75
75
  */
76
- _GuOnPageMessage({ name: e, icon: t = "not-found", type: o = "info" }) {
76
+ _GuOnPageMessage({ name: e, icon: t = "not-found", type: E = "info" }) {
77
77
  return `
78
78
  <div data-info-message="${e}" style="display: none; padding: 16px 16px 0;">
79
79
  <div class="icon-store" style="display: none;">
@@ -81,7 +81,7 @@ class d extends I {
81
81
  ${this._GuIcon({ src: t, className: "icon" })}
82
82
  </div>
83
83
  </div>
84
- ${this._GuMessage({ name: e, type: o })}
84
+ ${this._GuMessage({ name: e, type: E })}
85
85
  </div>
86
86
  `;
87
87
  }
@@ -91,7 +91,7 @@ class d extends I {
91
91
  * and combines it with the text in Stripo's alert-message layout.
92
92
  */
93
93
  _setInfoMessageValue(e, t) {
94
- const o = this.getContainer(), E = o.querySelector(`[data-icon-key="${e}"]`), a = E == null ? void 0 : E.querySelector("ue-icon-component"), l = (a == null ? void 0 : a.outerHTML) ?? "";
94
+ const E = this.getContainer(), o = E.querySelector(`[data-icon-key="${e}"]`), r = o == null ? void 0 : o.querySelector("ue-icon-component"), l = (r == null ? void 0 : r.outerHTML) ?? "";
95
95
  this.api.setUIEAttribute(
96
96
  e,
97
97
  "value",
@@ -104,8 +104,8 @@ class d extends I {
104
104
  </div>
105
105
  `
106
106
  );
107
- const T = o.querySelector(`[data-info-message="${e}"]`);
108
- T && (T.style.display = "");
107
+ const u = E.querySelector(`[data-info-message="${e}"]`);
108
+ u && (u.style.display = "");
109
109
  }
110
110
  _GuToggle(e) {
111
111
  return `
@@ -121,59 +121,59 @@ class d extends I {
121
121
  ${$.SELECT_ITEM.value}="${t}">
122
122
  </${n.SELECT_ITEM}>`;
123
123
  }
124
- _GuSelect({ name: e, placeholder: t, options: o, className: E = "es-180w" }) {
124
+ _GuSelect({ name: e, placeholder: t, options: E, className: o = "es-180w" }) {
125
125
  return `
126
126
  <${n.SELECTPICKER}
127
- class="${E}"
127
+ class="${o}"
128
128
  ${$.SELECTPICKER.name}="${e}"
129
129
  ${$.SELECTPICKER.placeholder}="${t}">
130
- ${o.map((a) => this._GuSelectItem(a)).join("")}
130
+ ${E.map((r) => this._GuSelectItem(r)).join("")}
131
131
  </${n.SELECTPICKER}>
132
132
  `;
133
133
  }
134
- _GuTextInput({ name: e, placeholder: t, className: o = "", disabled: E = !1 }) {
134
+ _GuTextInput({ name: e, placeholder: t, className: E = "", disabled: o = !1 }) {
135
135
  return `
136
136
  <${n.TEXT}
137
- class=${o}
137
+ class=${E}
138
138
  ${$.TEXT.name}="${e}"
139
139
  placeholder="${t || e}"
140
- ${E ? `${$.TEXT.disabled}="true"` : ""}>
140
+ ${o ? `${$.TEXT.disabled}="true"` : ""}>
141
141
  </${n.TEXT}>
142
142
  `;
143
143
  }
144
- _GuCounter({ name: e, maxValue: t, minValue: o = 1, step: E = 1 }) {
144
+ _GuCounter({ name: e, maxValue: t, minValue: E = 1, step: o = 1 }) {
145
145
  return `
146
146
  <${n.COUNTER}
147
147
  ${$.COUNTER.name}="${e}"
148
- ${$.COUNTER.minValue}="${o}"
148
+ ${$.COUNTER.minValue}="${E}"
149
149
  ${$.COUNTER.maxValue}="${t}"
150
- ${$.COUNTER.step}="${E}">
150
+ ${$.COUNTER.step}="${o}">
151
151
  </${n.COUNTER}>
152
152
  `;
153
153
  }
154
- _GuRadioButtonItem({ text: e, value: t, icon: o }) {
154
+ _GuRadioButtonItem({ text: e, value: t, icon: E }) {
155
155
  return `
156
156
  <${n.RADIO_ITEM}
157
157
  ${$.RADIO_ITEM.value}="${t}"
158
158
  ${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
159
- ${o ? `${$.RADIO_ITEM.icon}="${o}"` : ""}>
159
+ ${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
160
160
  </${n.RADIO_ITEM}>
161
161
  `;
162
162
  }
163
- _GuRadioButton({ name: e, buttons: t, id: o = "" }) {
163
+ _GuRadioButton({ name: e, buttons: t, id: E = "" }) {
164
164
  return `
165
165
  <${n.RADIO_BUTTONS}
166
- ${o ? `id="${o}"` : ""}
166
+ ${E ? `id="${E}"` : ""}
167
167
  ${$.RADIO_BUTTONS.name}="${e}">
168
- ${t.map((E) => this._GuRadioButtonItem(E)).join("")}
168
+ ${t.map((o) => this._GuRadioButtonItem(o)).join("")}
169
169
  </${n.RADIO_BUTTONS}>
170
170
  `;
171
171
  }
172
- _GuButton({ name: e, label: t, id: o = "" }) {
172
+ _GuButton({ name: e, label: t, id: E = "" }) {
173
173
  return `
174
174
  <${n.BUTTON}
175
175
  ${$.BUTTON.name}="${e}"
176
- ${o ? `id="${o}"` : ""}
176
+ ${E ? `id="${E}"` : ""}
177
177
  ${$.BUTTON.caption}="${t}"}>
178
178
  </${n.BUTTON}>
179
179
  `;
@@ -191,10 +191,10 @@ class d extends I {
191
191
  * @param param0
192
192
  * @returns It returns a button with an icon.
193
193
  */
194
- _GuIconButton({ name: e, icon: t, className: o = "" }) {
194
+ _GuIconButton({ name: e, icon: t, className: E = "" }) {
195
195
  return `
196
196
  <${n.BUTTON}
197
- class="${o}"
197
+ class="${E}"
198
198
  ${$.BUTTON.name}="${e}"
199
199
  ${$.BUTTON.icon}="${t}">
200
200
  </${n.BUTTON}>
@@ -222,19 +222,19 @@ class d extends I {
222
222
  * @returns HTML string for the orderable control
223
223
  */
224
224
  _GuOrderable(e, t) {
225
- let o = "";
226
- t.forEach((a) => {
225
+ let E = "";
226
+ t.forEach((r) => {
227
227
  const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
228
- o += `
229
- <${n.ORDERABLE_ITEM} ${l}="${a.key}">
230
- ${a.content}
228
+ E += `
229
+ <${n.ORDERABLE_ITEM} ${l}="${r.key}">
230
+ ${r.content}
231
231
  </${n.ORDERABLE_ITEM}>
232
232
  `;
233
233
  });
234
- const E = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
234
+ const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
235
235
  return `
236
- <${n.ORDERABLE} ${E}="${e}">
237
- ${o}
236
+ <${n.ORDERABLE} ${o}="${e}">
237
+ ${E}
238
238
  </${n.ORDERABLE}>
239
239
  `;
240
240
  }
@@ -275,16 +275,16 @@ class d extends I {
275
275
  `;
276
276
  }
277
277
  _GuRadioButtons(e, t) {
278
- const o = t.map((E) => `
278
+ const E = t.map((o) => `
279
279
  <${n.RADIO_ITEM}
280
- ${$.RADIO_ITEM.text}="${E.text}"
281
- ${$.RADIO_ITEM.value}="${E.value}">
280
+ ${$.RADIO_ITEM.text}="${o.text}"
281
+ ${$.RADIO_ITEM.value}="${o.value}">
282
282
  </${n.RADIO_ITEM}>
283
283
  `).join("");
284
284
  return `
285
285
  <${n.RADIO_BUTTONS}
286
286
  ${$.RADIO_BUTTONS.name}="${e}">
287
- ${o}
287
+ ${E}
288
288
  </${n.RADIO_BUTTONS}>
289
289
  `;
290
290
  }
@@ -296,7 +296,20 @@ class d extends I {
296
296
  </${n.CHECKBOX}>
297
297
  `;
298
298
  }
299
+ // Tag/chips input (Stripo MULTIPLE_SELECT): add-by-Enter, remove-by-×.
300
+ // Value is read/written as a string[] via updateValues / onValueChanged.
301
+ _GuMultiSelect({ name: e, placeholder: t = "", className: E = "", disabled: o = !1 }) {
302
+ const r = [E, o ? "" : "click-enabled"].filter(Boolean).join(" ");
303
+ return `
304
+ <${n.MULTIPLE_SELECT}
305
+ class="${r}"
306
+ ${$.MULTIPLE_SELECT.name}="${e}"
307
+ ${$.MULTIPLE_SELECT.placeholder}="${t}"
308
+ ${o ? `${$.MULTIPLE_SELECT.disabled}="true"` : ""}>
309
+ </${n.MULTIPLE_SELECT}>
310
+ `;
311
+ }
299
312
  }
300
313
  export {
301
- d as CommonControl
314
+ _ as CommonControl
302
315
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__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-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-f6a8cb4c]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-f6a8cb4c]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-f6a8cb4c]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-f6a8cb4c]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-f6a8cb4c]{object-fit:cover;transform:scale(1)}[data-v-18e1220a] .guido__verion-history-view-option-selection-desktop svg,[data-v-18e1220a] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-18e1220a] .in-segments-wrapper__button_selected,[data-v-18e1220a] .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-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{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-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__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-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-669fe7cf]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-669fe7cf]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-669fe7cf]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-669fe7cf]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-669fe7cf]{object-fit:cover;transform:scale(1)}[data-v-7a305bb2] .guido__verion-history-view-option-selection-desktop svg,[data-v-7a305bb2] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-7a305bb2] .in-segments-wrapper__button_selected,[data-v-7a305bb2] .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-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{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-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
@@ -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,3 @@
1
+ export declare const usePreviewInteractionGuard: () => {
2
+ blockPreviewInteractions: (iframe: HTMLIFrameElement) => void;
3
+ };
@@ -1,3 +1,4 @@
1
1
  export declare const useUnsubscribeBlockValidator: () => {
2
2
  validateUnsubscribeBlockUniqueness: (html: string) => boolean;
3
+ validateUnsubscribeBlockHasTemplate: (html: string) => boolean;
3
4
  };
@@ -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;
@@ -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, 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_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';