@useinsider/guido 3.20.0 → 3.20.1-beta.10fbbe9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +25 -24
  3. package/dist/config/compiler/itemsCompilerRules.js +21 -5
  4. package/dist/config/compiler/utils/itemsCompilerUtils.js +64 -17
  5. package/dist/config/migrator/itemsBlockMigrator.js +112 -108
  6. package/dist/extensions/Blocks/Items/block.js +78 -67
  7. package/dist/extensions/Blocks/Items/constants/cardWidth.js +20 -0
  8. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +1 -1
  9. package/dist/extensions/Blocks/Recommendation/block.js +51 -44
  10. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +103 -91
  11. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -73
  12. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +209 -203
  13. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +122 -90
  14. package/dist/extensions/Blocks/Recommendation/utils/blockUrlConfig.js +25 -0
  15. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +72 -70
  16. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +69 -60
  17. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +46 -25
  18. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +40 -17
  19. package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
  20. package/dist/guido.css +1 -1
  21. package/dist/src/config/compiler/utils/itemsCompilerUtils.d.ts +10 -0
  22. package/dist/src/extensions/Blocks/Items/block.d.ts +5 -0
  23. package/dist/src/extensions/Blocks/Items/constants/cardWidth.d.ts +12 -0
  24. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +2 -0
  25. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -0
  26. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  27. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +18 -5
  28. package/dist/src/extensions/Blocks/Recommendation/utils/blockUrlConfig.d.ts +4 -0
  29. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +4 -0
  30. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +3 -1
  31. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +7 -0
  32. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
  33. package/dist/src/utils/liquidProtection.d.ts +3 -0
  34. package/dist/utils/liquidProtection.js +5 -0
  35. package/dist/utils/templatePreparation.js +61 -85
  36. package/package.json +1 -1
@@ -1,42 +1,48 @@
1
- var S = Object.defineProperty;
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);
1
+ var y = Object.defineProperty;
2
+ var I = (c, o, e) => o in c ? y(c, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[o] = e;
3
+ var g = (c, o, e) => I(c, typeof o != "symbol" ? o + "" : o, e);
4
4
  import { useToaster as L } from "../../../composables/useToaster.js";
5
- import { ToasterTypeOptions as A } from "../../../enums/toaster.js";
6
- import { PAGE_TYPES as h } from "../../../enums/unsubscribe.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";
11
- import { UNSUBSCRIBE_BLOCK_SELECTOR as m, DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as b } from "./utils/constants.js";
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 = {
14
- [h.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
15
- [h.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
16
- }, P = 3;
17
- class W extends T {
5
+ import { ToasterTypeOptions as C } from "../../../enums/toaster.js";
6
+ import { PAGE_TYPES as m } from "../../../enums/unsubscribe.js";
7
+ import { useEditorStore as N } from "../../../stores/editor.js";
8
+ import { useUnsubscribeStore as a } from "../../../stores/unsubscribe.js";
9
+ import { Block as U, BlockCompositionType as R, ContextActionType as f, ModificationDescription as u, BlockType as v } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
10
+ import { getDefaultTemplate as D } from "./template.js";
11
+ import { UNSUBSCRIBE_BLOCK_SELECTOR as B, DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as h } from "./utils/constants.js";
12
+ import { parsePageList as S } from "./utils/utils.js";
13
+ const w = "unsubscribe-block", E = 'a[data-unsubscribe-link="true"]', P = "{{ins-unsubscribe-link}}", x = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", G = "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.", M = {
14
+ [m.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
15
+ [m.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
16
+ }, O = 3;
17
+ let d = null, p = null;
18
+ const A = () => {
19
+ d && (document.removeEventListener(h.SELECT, d), d = null);
20
+ }, T = () => {
21
+ p && (document.removeEventListener(h.CANCEL, p), p = null);
22
+ }, q = () => {
23
+ A(), T();
24
+ };
25
+ class J extends U {
18
26
  constructor() {
19
27
  super();
20
- a(this, "selectEventListener", null);
21
- a(this, "cancelEventListener", null);
22
- a(this, "currentNode");
28
+ g(this, "currentNode");
23
29
  // Per-block "did this instance have a link last time we saw it?" tracking.
24
30
  // Keyed by the stable `data-unsubscribe-block-id` we assign, because
25
31
  // ImmutableHtmlNode instances are recreated on every document mutation and
26
32
  // can't be used as Map keys directly. A singleton boolean here would be
27
33
  // polluted across blocks since Stripo fires onDocumentChanged per-instance.
28
- a(this, "linkStateByBlockId", /* @__PURE__ */ new Map());
34
+ g(this, "linkStateByBlockId", /* @__PURE__ */ new Map());
29
35
  // Per-block prepend retry counter for the leading text guard (SD-143097).
30
- a(this, "guardAttemptsByBlockId", /* @__PURE__ */ new Map());
36
+ g(this, "guardAttemptsByBlockId", /* @__PURE__ */ new Map());
31
37
  }
32
38
  getId() {
33
- return N;
39
+ return w;
34
40
  }
35
41
  getIcon() {
36
42
  return "unsubscribe-icon";
37
43
  }
38
44
  getBlockCompositionType() {
39
- return I.BLOCK;
45
+ return R.BLOCK;
40
46
  }
41
47
  getName() {
42
48
  return this.api.translate("Unsubscribe Block");
@@ -45,16 +51,16 @@ class W extends T {
45
51
  return this.api.translate("Unsubscribe Block Description");
46
52
  }
47
53
  getTemplate() {
48
- return C();
54
+ return D();
49
55
  }
50
56
  getContextActionsIds() {
51
- return [B.MOVE, B.REMOVE];
57
+ return [f.MOVE, f.REMOVE];
52
58
  }
53
59
  onSelect(e) {
54
- if (this.currentNode = e, y().isPreviewModeOpen)
60
+ if (this.currentNode = e, N().isPreviewModeOpen)
55
61
  return;
56
62
  const t = this._getOrAssignBlockId(e);
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());
63
+ t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), this._setupSelectEventListener(), this._setupCancelEventListener(t), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), t && (a().pendingBlockId = t), this._loadBlockState(e), this._checkExistingBlocks(), this._openDrawer());
58
64
  }
59
65
  onCreated(e) {
60
66
  this._ensureLeadingTextGuard(e);
@@ -62,7 +68,7 @@ class W extends T {
62
68
  onDocumentInit() {
63
69
  try {
64
70
  const e = this.api.getDocumentRoot();
65
- e && "querySelectorAll" in e && e.querySelectorAll(m).forEach((t) => {
71
+ e && "querySelectorAll" in e && e.querySelectorAll(B).forEach((t) => {
66
72
  this._ensureLeadingTextGuard(t);
67
73
  });
68
74
  } catch {
@@ -77,13 +83,10 @@ class W extends T {
77
83
  this.linkStateByBlockId.get(t) === !0 && !s && this._warnLinkRemoved(), this.linkStateByBlockId.set(t, s);
78
84
  }
79
85
  onDelete(e) {
80
- this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
86
+ q(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
81
87
  const t = this._readBlockId(e);
82
88
  t && (this.linkStateByBlockId.delete(t), this.guardAttemptsByBlockId.delete(t));
83
89
  }
84
- onDestroy() {
85
- this._removeEventListeners(), this.currentNode = void 0, this.linkStateByBlockId.clear(), this.guardAttemptsByBlockId.clear();
86
- }
87
90
  /**
88
91
  * Guarantees a plain-text node before the link's wrapper inside the <p>.
89
92
  * Without it the only caret position left of the link is inside the anchor,
@@ -102,20 +105,20 @@ class W extends T {
102
105
  return;
103
106
  const i = s.previousSibling();
104
107
  if (!!(i && i.getType() === "text" && i.getTextContent())) {
105
- const p = this._readBlockId(e);
106
- p && this.guardAttemptsByBlockId.delete(p);
108
+ const b = this._readBlockId(e);
109
+ b && this.guardAttemptsByBlockId.delete(b);
107
110
  return;
108
111
  }
109
- const g = this._getOrAssignBlockId(e);
110
- if (!g)
112
+ const k = this._getOrAssignBlockId(e);
113
+ if (!k)
111
114
  return;
112
- const k = this.guardAttemptsByBlockId.get(g) ?? 0;
113
- if (!(k >= P)) {
114
- this.guardAttemptsByBlockId.set(g, k + 1);
115
+ const _ = this.guardAttemptsByBlockId.get(k) ?? 0;
116
+ if (!(_ >= O)) {
117
+ this.guardAttemptsByBlockId.set(k, _ + 1);
115
118
  try {
116
- this.api.getDocumentModifier().modifyHtml(r).prepend("&nbsp;").apply(new d("Ensure unsubscribe link text guard"));
117
- } catch (p) {
118
- console.warn("[UnsubscribeBlock] Failed to ensure link text guard:", p);
119
+ this.api.getDocumentModifier().modifyHtml(r).prepend("&nbsp;").apply(new u("Ensure unsubscribe link text guard"));
120
+ } catch (b) {
121
+ console.warn("[UnsubscribeBlock] Failed to ensure link text guard:", b);
119
122
  }
120
123
  }
121
124
  }
@@ -139,7 +142,7 @@ class W extends T {
139
142
  return null;
140
143
  const s = this._generateNextBlockId();
141
144
  try {
142
- this.api.getDocumentModifier().modifyHtml(e).setAttribute(n.BLOCK_ID, s).apply(new d(`Assign unsubscribe block id ${s}`));
145
+ this.api.getDocumentModifier().modifyHtml(e).setAttribute(n.BLOCK_ID, s).apply(new u(`Assign unsubscribe block id ${s}`));
143
146
  } catch (r) {
144
147
  return console.warn("[UnsubscribeBlock] Failed to assign block id:", r), null;
145
148
  }
@@ -154,10 +157,10 @@ class W extends T {
154
157
  let e = 0;
155
158
  try {
156
159
  const t = this.api.getDocumentRoot();
157
- t && "querySelectorAll" in t && t.querySelectorAll(m).forEach((r) => {
160
+ t && "querySelectorAll" in t && t.querySelectorAll(B).forEach((r) => {
158
161
  if ("getAttribute" in r) {
159
- const i = r.getAttribute(n.BLOCK_ID), u = i ? parseInt(i) : 0;
160
- u > e && (e = u);
162
+ const i = r.getAttribute(n.BLOCK_ID), l = i ? parseInt(i) : 0;
163
+ l > e && (e = l);
161
164
  }
162
165
  });
163
166
  } catch {
@@ -168,12 +171,12 @@ class W extends T {
168
171
  try {
169
172
  const { showToaster: e } = L();
170
173
  e({
171
- type: A.Warning,
172
- message: this.api.translate(D),
174
+ type: C.Warning,
175
+ message: this.api.translate(G),
173
176
  actionButton: {
174
177
  text: this.api.translate("Visit Academy"),
175
178
  onClick: () => {
176
- window.open(R, "_blank", "noopener,noreferrer");
179
+ window.open(x, "_blank", "noopener,noreferrer");
177
180
  }
178
181
  }
179
182
  });
@@ -182,35 +185,26 @@ class W extends T {
182
185
  }
183
186
  }
184
187
  _setupSelectEventListener() {
185
- this._removeSelectEventListener(), this.selectEventListener = (e) => {
188
+ A(), d = (e) => {
186
189
  const t = e, { collectionType: s, selectedPages: r } = t.detail;
187
190
  this._updateBlock(s, r.join(","));
188
- }, document.addEventListener(b.SELECT, this.selectEventListener);
189
- }
190
- _removeSelectEventListener() {
191
- this.selectEventListener && (document.removeEventListener(b.SELECT, this.selectEventListener), this.selectEventListener = null);
191
+ }, document.addEventListener(h.SELECT, d);
192
192
  }
193
193
  _setupCancelEventListener(e) {
194
- this._removeCancelEventListener(), this.cancelEventListener = (t) => {
194
+ T(), p = (t) => {
195
195
  const { detail: s } = t;
196
196
  ((s == null ? void 0 : s.blockId) ?? null) === e && this._handleCancel();
197
- }, document.addEventListener(b.CANCEL, this.cancelEventListener);
198
- }
199
- _removeCancelEventListener() {
200
- this.cancelEventListener && (document.removeEventListener(b.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
197
+ }, document.addEventListener(h.CANCEL, p);
201
198
  }
202
199
  _handleCancel() {
203
200
  try {
204
201
  if (!this.currentNode)
205
202
  return;
206
- this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${v.EMPTY_CONTAINER}/>`).apply(new d("Removed unsubscribe block due to cancel"));
203
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${v.EMPTY_CONTAINER}/>`).apply(new u("Removed unsubscribe block due to cancel"));
207
204
  } catch (e) {
208
205
  console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
209
206
  }
210
207
  }
211
- _removeEventListeners() {
212
- this._removeSelectEventListener(), this._removeCancelEventListener();
213
- }
214
208
  _updateBlock(e, t) {
215
209
  if (!this.currentNode || !("querySelector" in this.currentNode))
216
210
  return;
@@ -218,28 +212,28 @@ class W extends T {
218
212
  if (!s)
219
213
  return;
220
214
  const r = this._getMergeTag(e);
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"));
215
+ this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", r).apply(new u(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(n.PAGE_TYPE, e.toString()).setAttribute(n.PAGE_LIST, t).apply(new u("Updated unsubscribe block metadata"));
222
216
  }
223
217
  _getMergeTag(e) {
224
- return w[e] ?? U;
218
+ return M[e] ?? P;
225
219
  }
226
220
  _openDrawer() {
227
221
  if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
228
222
  try {
229
- const e = l();
223
+ const e = a();
230
224
  e.typeSelectionDrawerStatus = !0;
231
225
  } catch (e) {
232
226
  console.error("[UnsubscribeBlock] Failed to open drawer:", e);
233
227
  }
234
228
  }
235
229
  _checkExistingBlocks() {
236
- const e = l();
237
- e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(m).forEach((s) => {
230
+ const e = a();
231
+ e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((s) => {
238
232
  if ("getAttribute" in s) {
239
233
  const r = s.getAttribute(n.PAGE_TYPE);
240
234
  if (r) {
241
235
  const i = Number(r);
242
- i === h.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : i === h.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
236
+ i === m.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : i === m.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
243
237
  }
244
238
  }
245
239
  });
@@ -250,11 +244,11 @@ class W extends T {
250
244
  const t = e.getAttribute(n.PAGE_TYPE), s = e.getAttribute(n.PAGE_LIST);
251
245
  if (!t || !s)
252
246
  return;
253
- const r = l(), i = Number(t), u = _(s);
254
- await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(u);
247
+ const r = a(), i = Number(t), l = S(s);
248
+ await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(l);
255
249
  }
256
250
  _resetStoreState() {
257
- l().$reset();
251
+ a().$reset();
258
252
  }
259
253
  _removeBlockTemplatesFromStore(e) {
260
254
  if (!("getAttribute" in e))
@@ -262,11 +256,12 @@ class W extends T {
262
256
  const t = e.getAttribute(n.PAGE_LIST);
263
257
  if (!t)
264
258
  return;
265
- const s = l(), r = _(t);
259
+ const s = a(), r = S(t);
266
260
  s.removeUnsubscribePages(r);
267
261
  }
268
262
  }
269
263
  export {
270
- N as UNSUBSCRIBE_BLOCK_ID,
271
- W as UnsubscribeBlock
264
+ w as UNSUBSCRIBE_BLOCK_ID,
265
+ J as UnsubscribeBlock,
266
+ q as disposeUnsubscribeListeners
272
267
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-2cccbd44]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-c5ff3804]{gap:16px}.validation-error-row[data-v-c5ff3804]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-c5ff3804]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-c5ff3804]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-1b5c844a]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-1b5c844a]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-1b5c844a]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
1
+ @charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-2cccbd44]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-c5ff3804]{gap:16px}.validation-error-row[data-v-c5ff3804]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-c5ff3804]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-c5ff3804]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-44a22ef1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-44a22ef1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-44a22ef1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
@@ -10,3 +10,13 @@ export declare const MSO_ITEMS_HIDE_END = "MSO_ITEMS_HIDE_END";
10
10
  * and collapse them inline for web-engine Outlook.
11
11
  */
12
12
  export declare function wrapHiddenPriceTdsForOutlook(html: string): string;
13
+ /**
14
+ * Export safety net for a zero Items width: the wrapper gets the 100% pin, the cell's zero is
15
+ * dropped so it keeps its column width (a pin there overflows 33%/50% columns).
16
+ */
17
+ export declare function normalizeItemsBlockWidths(html: string): string;
18
+ /**
19
+ * The mobile `.adapt-img { width: 100% }` rule sizes the horizontal thumbnail by its auto-width column,
20
+ * so it grows in a roomy row and collapses to nothing in a crowded one — bound it to [default, width].
21
+ */
22
+ export declare function lockHorizontalItemImageWidths(html: string): string;
@@ -46,6 +46,11 @@ export declare class ItemsBlock extends Block {
46
46
  * relies on this td-level fallback in pairProductVariables.
47
47
  */
48
48
  private _stampProductTdDomAttributes;
49
+ /**
50
+ * Repairs a saved module's collapsed card into the state the load migrator produces. Acts only
51
+ * on a zero width, so Stripo's non-zero drop-time width never triggers it and a healed block no-ops.
52
+ */
53
+ private _healCollapsedWidths;
49
54
  /**
50
55
  * Whether a currency self-heal pass should run for this block (SD-147588). The only gate here is
51
56
  * once-per-session: heal each instance at most once, so the auto-fix can't fight undo (undo
@@ -0,0 +1,12 @@
1
+ export declare const PRODUCT_TD_SELECTOR = ".ins-product-td";
2
+ export declare const PRODUCT_WRAPPER_SELECTOR = ".ins-product-wrapper";
3
+ /** The declaration `layouts/vertical.html` and `layouts/horizontal.html` ship inline. */
4
+ export declare const WIDTH_PIN_DECLARATION = "width: 100%";
5
+ /** True for a `width` attribute value that renders the card zero-wide (`0`, `0px`, `0%`). */
6
+ export declare const isZeroWidthValue: (value?: string | null) => boolean;
7
+ /** True when an inline style declares a zero `width` (ignores `max-width` / `min-width`). */
8
+ export declare const hasZeroWidthDeclaration: (style: string) => boolean;
9
+ /** Rewrites a zero width to the pin or appends it; a non-zero width is kept. Idempotent. */
10
+ export declare const withWidthPin: (style: string) => string;
11
+ /** Drops a zero `width` declaration; the product cell must inherit its column width, not be pinned. */
12
+ export declare const withoutZeroWidth: (style: string) => string;
@@ -17,6 +17,8 @@ export declare class RecommendationBlock extends Block {
17
17
  private _pendingBlockId;
18
18
  /** Ids already reset under their new name, so the deferred pass skips their stale snapshot. */
19
19
  private _resetSourceIds;
20
+ /** Ids handed to duplicates the document root does not show yet: a copied module renames all its blocks at once. */
21
+ private _unsettledDuplicateIds;
20
22
  constructor();
21
23
  getId(): string;
22
24
  getIcon(): string;
@@ -189,6 +189,9 @@ export declare class RecommendationCardCompositionControl extends CommonControl
189
189
  */
190
190
  private _buildCompositionHtml;
191
191
  private _applyVisibilityToBlock;
192
+ /** Inline "Product Prices" group row is tagged with whichever price comes first, so it drives both keys. */
193
+ private _resolveVisibilityKeys;
194
+ private _isInlinePrices;
192
195
  private _applyTitleVisibilityToBlock;
193
196
  private _resolveTitleInjection;
194
197
  private _readTitleHtml;
@@ -139,6 +139,8 @@ export declare class RecommendationBlockControl extends CommonControl {
139
139
  * fails when the size actually changed.
140
140
  */
141
141
  private _debouncedRegenerateWithProducts;
142
+ /** Draws the current block's products into this panel's node. */
143
+ private _regenerateWithProducts;
142
144
  /**
143
145
  * Listen to store changes that require product refresh or regeneration.
144
146
  *
@@ -620,12 +620,25 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
620
620
  fetchRecommendationProducts(): Promise<void>;
621
621
  _doFetchProducts(): Promise<void>;
622
622
  /**
623
- * Block-scoped counterpart of `fetchRecommendationProducts`, which only ever serves the
624
- * selected block. The legacy conversion must refresh the products of the block that
625
- * started it even after the user selected another one.
623
+ * Block-scoped counterpart of `fetchRecommendationProducts`, which only serves the selected block:
624
+ * the legacy conversion and the duplicate refresh must reach a block that may no longer be selected.
625
+ * @returns whether real products arrived
626
626
  */
627
- fetchStrategyProductsForBlock(blockId: number): Promise<void>;
628
- _doFetchStrategyProducts(blockId: number): Promise<void>;
627
+ fetchStrategyProductsForBlock(blockId: number, options?: {
628
+ keepOnFailure?: boolean;
629
+ }): Promise<boolean>;
630
+ /**
631
+ * Reloads a block's products and adopts its strategy's current size, which may have
632
+ * moved since the block was assigned.
633
+ * @returns whether a fresh listing holds the strategy and its products arrived
634
+ */
635
+ refreshStrategyBlock(blockId: number): Promise<boolean>;
636
+ _doFetchStrategyProducts(blockId: number, options?: {
637
+ keepOnFailure?: boolean;
638
+ }): Promise<boolean>;
639
+ _loadStrategyProducts(blockId: number, token: number, { keepOnFailure }: {
640
+ keepOnFailure?: boolean;
641
+ }): Promise<boolean>;
629
642
  _setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
630
643
  }>;
631
644
  export {};
@@ -0,0 +1,4 @@
1
+ import type { PerBlockUrlConfig } from '../store/recommendation';
2
+ import type { RecommendationNodeConfig } from '../types/nodeConfig';
3
+ /** Maps a persisted node config onto the store's per-block seed, defaulting what an older config lacks. */
4
+ export declare function toBlockUrlConfig(config: Partial<RecommendationNodeConfig>): PerBlockUrlConfig;
@@ -33,6 +33,10 @@ export declare function normalizeCustomAttrValues(values: string[], blockNode?:
33
33
  * value, which stays correct on rows still tagged with a legacy bare name.
34
34
  */
35
35
  export declare function resolveRowCompositionKey(row: ImmutableHtmlNode): string | null;
36
+ /** Inline price mode renders sale + original price in ONE row, tagged with whichever comes first. */
37
+ export declare function isMergedInlinePriceRow(row: ImmutableHtmlNode | null | undefined): boolean;
38
+ /** Keys whose visibility a row carries: the merged inline price row stands for both prices. */
39
+ export declare function resolveRowVisibilityKeys(row: ImmutableHtmlNode): string[];
36
40
  /**
37
41
  * Finds an attribute row by composition key, tolerating rows still tagged with the
38
42
  * legacy bare-name key. Custom candidates are validated against their `product-attr`,
@@ -1,5 +1,5 @@
1
1
  import type { DocumentModifier } from '../services/configService';
2
- import type { PartialNodeConfig } from '../types/nodeConfig';
2
+ import type { PartialNodeConfig, RecommendationNodeConfig } from '../types/nodeConfig';
3
3
  import type { RecommendationProduct } from '@@/Types/recommendation';
4
4
  import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
5
5
  interface ConfigWriterApi {
@@ -13,6 +13,8 @@ interface ConfigWriterApi {
13
13
  * itself is torn down.
14
14
  */
15
15
  export declare function registerNodeConfigWriter(api: ConfigWriterApi): void;
16
+ /** Reads the persisted config of every node carrying a block id (two while a duplicate still shares it). */
17
+ export declare function readBlockNodeConfigs(blockId: number): RecommendationNodeConfig[];
16
18
  /**
17
19
  * Commits a config change and its product re-render straight to the document,
18
20
  * bypassing the settings panel.
@@ -1,3 +1,10 @@
1
+ import type { RecommendationNodeConfig } from '../types/nodeConfig';
2
+ /**
3
+ * Re-reads the strategy of a duplicated block and its source and redraws both: the clone copies the
4
+ * cards the source last drew, so a strategy edited since then only reached a block once selected (SD-153266).
5
+ * @param config - the arriving block's persisted config; seeds either block its store entry does not match
6
+ */
7
+ export declare function refreshDuplicatedStrategyBlocks(sourceId: number, duplicateId: number, config: RecommendationNodeConfig): Promise<void>;
1
8
  /**
2
9
  * Writes a strategy change and its products straight to the document, without the settings panel.
3
10
  *
@@ -1,9 +1,8 @@
1
1
  import type { ImmutableHtmlElementNode, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
2
  import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
3
3
  export declare const UNSUBSCRIBE_BLOCK_ID = "unsubscribe-block";
4
+ export declare const disposeUnsubscribeListeners: () => void;
4
5
  export declare class UnsubscribeBlock extends Block {
5
- private selectEventListener;
6
- private cancelEventListener;
7
6
  private currentNode?;
8
7
  private linkStateByBlockId;
9
8
  private guardAttemptsByBlockId;
@@ -20,7 +19,6 @@ export declare class UnsubscribeBlock extends Block {
20
19
  onDocumentInit(): void;
21
20
  onDocumentChanged(node: ImmutableHtmlNode): void;
22
21
  onDelete(node: ImmutableHtmlElementNode): void;
23
- onDestroy(): void;
24
22
  /**
25
23
  * Guarantees a plain-text node before the link's wrapper inside the <p>.
26
24
  * Without it the only caret position left of the link is inside the anchor,
@@ -44,11 +42,8 @@ export declare class UnsubscribeBlock extends Block {
44
42
  private _generateNextBlockId;
45
43
  private _warnLinkRemoved;
46
44
  private _setupSelectEventListener;
47
- private _removeSelectEventListener;
48
45
  private _setupCancelEventListener;
49
- private _removeCancelEventListener;
50
46
  private _handleCancel;
51
- private _removeEventListeners;
52
47
  private _updateBlock;
53
48
  private _getMergeTag;
54
49
  private _openDrawer;
@@ -0,0 +1,3 @@
1
+ export declare const protectLiquid: (html: string) => string;
2
+ /** Reverses `protectLiquid`, including markers the serializer escaped inside attribute values. */
3
+ export declare const restoreLiquid: (html: string) => string;
@@ -0,0 +1,5 @@
1
+ const p = (l) => l.split(/(<!--[\s\S]*?-->)/).map((e, c) => c % 2 ? e : e.replaceAll("{%", "<!--lq{%").replaceAll("%}", "%}lq-->")).join(""), r = (l) => l.replaceAll("<!--lq{%", "{%").replaceAll("%}lq-->", "%}").replaceAll("&lt;!--lq{%", "{%").replaceAll("%}lq--&gt;", "%}");
2
+ export {
3
+ p as protectLiquid,
4
+ r as restoreLiquid
5
+ };