@useinsider/guido 2.0.0-beta.eee5ecc → 2.0.0-beta.f66b754

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 (64) hide show
  1. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
  2. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +6 -6
  3. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
  4. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +6 -6
  5. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
  6. package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.js +18 -0
  7. package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue2.js +15 -0
  8. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +16 -15
  9. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +14 -22
  10. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
  11. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -10
  12. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
  13. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
  14. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
  15. package/dist/components/organisms/header/EditorActions.vue.js +21 -0
  16. package/dist/components/organisms/header/EditorActions.vue2.js +41 -0
  17. package/dist/components/organisms/header/EditorToolbar.vue.js +18 -0
  18. package/dist/components/organisms/header/EditorToolbar.vue2.js +17 -0
  19. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -5
  20. package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
  21. package/dist/components/organisms/header/LeftSlot.vue2.js +13 -14
  22. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  23. package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -15
  24. package/dist/components/organisms/header/RightSlot.vue.js +11 -14
  25. package/dist/components/organisms/header/RightSlot.vue2.js +13 -30
  26. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +5 -5
  27. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
  28. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
  29. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
  30. package/dist/config/migrator/itemsBlockMigrator.js +72 -64
  31. package/dist/enums/academy.js +8 -0
  32. package/dist/enums/onboarding.js +1 -2
  33. package/dist/enums/unsubscribe.js +20 -21
  34. package/dist/extensions/Blocks/Items/block.js +23 -20
  35. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -32
  36. package/dist/extensions/Blocks/Items/controls/settingsControl.js +69 -75
  37. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -0
  38. package/dist/extensions/Blocks/Items/extension.js +8 -9
  39. package/dist/extensions/Blocks/Items/template.js +210 -221
  40. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +61 -53
  41. package/dist/guido.css +1 -1
  42. package/dist/src/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.d.ts +2 -0
  43. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +4 -0
  44. package/dist/src/components/organisms/header/EditorToolbar.vue.d.ts +2 -0
  45. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  46. package/dist/src/enums/academy.d.ts +12 -0
  47. package/dist/src/enums/onboarding.d.ts +0 -1
  48. package/dist/src/enums/unsubscribe.d.ts +0 -1
  49. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +2 -0
  50. package/dist/src/extensions/Blocks/Items/template.d.ts +1 -1
  51. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -5
  52. package/dist/src/stores/editor.d.ts +21 -0
  53. package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
  54. package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
  55. package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
  56. package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
  57. package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
  58. package/dist/static/styles/components/wide-panel.css.js +1 -1
  59. package/dist/stores/editor.js +1 -0
  60. package/package.json +1 -1
  61. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  62. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  63. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  64. package/dist/static/assets/phone-mockup.svg.js +0 -4
@@ -1,10 +1,10 @@
1
1
  var L = Object.defineProperty;
2
- var K = (o, t, r) => t in o ? L(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r;
3
- var R = (o, t, r) => K(o, typeof t != "symbol" ? t + "" : t, r);
2
+ var K = (r, t, o) => t in r ? L(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o;
3
+ var v = (r, t, o) => K(r, typeof t != "symbol" ? t + "" : t, o);
4
4
  import { productPairs as B } from "../../extensions/Blocks/Items/enums/productEnums.js";
5
5
  import { ItemInCartOptions as E, DefaultConfigValues as g, SETTINGS_ENUMS as _ } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
6
6
  import { getDefaultTemplate as U } from "../../extensions/Blocks/Items/template.js";
7
- const w = {
7
+ const q = {
8
8
  img: {
9
9
  pairsKey: "imageSrc",
10
10
  defaultKey: "DEFAULT",
@@ -71,57 +71,59 @@ const w = {
71
71
  isArray: !1
72
72
  }
73
73
  };
74
- function F() {
74
+ function w() {
75
75
  return String(Date.now() + Math.floor(Math.random() * 1e3));
76
76
  }
77
- function q(o) {
78
- return o ? {
77
+ function F(r) {
78
+ return r ? {
79
79
  CartItems: _.ITEMS_TYPE.CART_ITEMS,
80
80
  BrowsedItems: _.ITEMS_TYPE.BROWSED_ITEMS,
81
81
  PurchasedItems: _.ITEMS_TYPE.PURCHASED_ITEMS,
82
82
  CART_ITEMS: _.ITEMS_TYPE.CART_ITEMS,
83
83
  BROWSED_ITEMS: _.ITEMS_TYPE.BROWSED_ITEMS,
84
84
  PURCHASED_ITEMS: _.ITEMS_TYPE.PURCHASED_ITEMS
85
- }[o] || _.ITEMS_TYPE.CART_ITEMS : _.ITEMS_TYPE.CART_ITEMS;
85
+ }[r] || _.ITEMS_TYPE.CART_ITEMS : _.ITEMS_TYPE.CART_ITEMS;
86
86
  }
87
- function M(o) {
88
- const t = (e, a) => e == null ? a : e === "1" || e === "true", r = (e, a) => e || a, c = o["data-type"] || o["data-source"], n = q(c);
89
- let i = o["data-cart_items_select_control_value"] || g.cartItemsSelectControlValue;
87
+ function R(r) {
88
+ const t = (e, a) => e == null ? a : e === "1" || e === "true", o = (e, a) => e || a, c = r["data-type"] || r["data-source"], n = F(c);
89
+ let i = r["data-cart_items_select_control_value"] || g.cartItemsSelectControlValue;
90
90
  if (i && !i.includes("{{") && /^\d+$/.test(i)) {
91
91
  const e = parseInt(i) - 1, a = E[n];
92
92
  a && a[e] && (i = a[e].value);
93
93
  }
94
94
  return {
95
95
  initialized: !0,
96
- blockInstanceId: r(o["data-block-instance-id"], F()),
96
+ blockInstanceId: o(r["data-block-instance-id"], w()),
97
97
  source: n,
98
98
  type: n,
99
99
  itemsSelectValue: i,
100
- orientation: o["data-card_orientation_control_value"] || _.ORIENTATION.VERTICAL,
101
- nameTrimming: t(o["data-product_name_control_trim"], !0),
102
- priceHideDiscount: t(o["data-product_price_control_nodup"], !0),
103
- priceFormatted: t(o["data-product_price_control_formated"], !0),
104
- priceSinglePrice: t(o["data-product_price_control_single_price"], !1),
105
- priceCurrencySymbol: r(
106
- o["data-product_price_currency_symbol"],
100
+ orientation: r["data-card_orientation_control_value"] || _.ORIENTATION.VERTICAL,
101
+ nameTrimming: t(r["data-product_name_control_trim"], !0),
102
+ nameControlEnabled: t(r["data-product_name_control_enabled"], !0),
103
+ priceHideDiscount: t(r["data-product_price_control_nodup"], !0),
104
+ priceFormatted: t(r["data-product_price_control_formated"], !0),
105
+ priceSinglePrice: t(r["data-product_price_control_single_price"], !1),
106
+ priceCurrencySymbol: o(
107
+ r["data-product_price_currency_symbol"],
107
108
  g.productPriceCurrencySymbolControlValue
108
109
  ),
109
- priceCurrencyLocation: r(
110
- o["data-product_price_currency_location"],
110
+ priceCurrencyLocation: o(
111
+ r["data-product_price_currency_location"],
111
112
  g.productPriceCurrencyLocationControlValue
112
113
  ),
113
- priceOrientation: o["data-product_original_price_control_orientation"] || "horizontal",
114
- quantityControlEnabled: t(o["data-product_quantity_control_enabled"], !0),
115
- buttonLink: r(o["data-product_button_link"], g.productButtonLinkControlValue),
116
- imageLink: r(o["data-product_image_link"], g.productImageLinkControlValue),
117
- buttonLabel: r(o["data-product_button_control_label"], "Buy"),
118
- buttonFullWidth: t(o["data-product_button_control_atw"], !0),
119
- imageVisible: t(o["data-product_image_control_enabled"], !0),
120
- nameVisible: t(o["data-product_name_control_enabled"], !0),
121
- quantityVisible: t(o["data-product_quantity_control_enabled"], !0),
122
- priceVisible: t(o["data-product_price_control_enabled"], !0),
123
- originalPriceVisible: t(o["data-product_original_price_control_enabled"], !0),
124
- buttonVisible: t(o["data-product_button_control_enabled"], !0)
114
+ priceControlOpened: t(r["data-product_price_control_opened"], !0),
115
+ priceOrientation: r["data-product_original_price_control_orientation"] || "horizontal",
116
+ quantityControlEnabled: t(r["data-product_quantity_control_enabled"], !0),
117
+ buttonLink: o(r["data-product_button_link"], g.productButtonLinkControlValue),
118
+ imageLink: o(r["data-product_image_link"], g.productImageLinkControlValue),
119
+ buttonLabel: o(r["data-product_button_control_label"], "Buy"),
120
+ buttonFullWidth: t(r["data-product_button_control_atw"], !0),
121
+ imageVisible: t(r["data-product_image_control_enabled"], !0),
122
+ nameVisible: t(r["data-product_name_control_enabled"], !0),
123
+ quantityVisible: t(r["data-product_quantity_visible"], !0),
124
+ priceVisible: t(r["data-product_price_visible"], !0),
125
+ originalPriceVisible: t(r["data-product_original_price_control_enabled"], !0),
126
+ buttonVisible: t(r["data-product_button_visible"], !0)
125
127
  };
126
128
  }
127
129
  const x = {
@@ -131,17 +133,17 @@ const x = {
131
133
  };
132
134
  class N {
133
135
  constructor() {
134
- R(this, "parser");
136
+ v(this, "parser");
135
137
  this.parser = new DOMParser();
136
138
  }
137
139
  migrate(t) {
138
140
  try {
139
- let r = this.removeJinjaConditionals(t);
140
- r = this.replaceTemplateVariables(r);
141
- const c = this.parser.parseFromString(r, "text/html"), n = c.querySelectorAll(
141
+ let o = this.removeJinjaConditionals(t);
142
+ o = this.replaceTemplateVariables(o);
143
+ const c = this.parser.parseFromString(o, "text/html"), n = c.querySelectorAll(
142
144
  "td.esd-cart-items-block, td.esd-browsed-items-block, td.esd-purchased-items-block"
143
145
  );
144
- return n.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), r) : (n.forEach((i) => {
146
+ return n.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), o) : (n.forEach((i) => {
145
147
  const e = this.extractConfiguration(i), a = U({
146
148
  orientation: e.orientation,
147
149
  itemsType: e.itemsType,
@@ -156,20 +158,20 @@ class N {
156
158
  priceStyles: e.priceStyles,
157
159
  originalPriceStyles: e.originalPriceStyles,
158
160
  quantityStyles: e.quantityStyles,
159
- nodeConfig: M(e.configBlockAttributes)
161
+ nodeConfig: R(e.configBlockAttributes)
160
162
  }), l = this.parser.parseFromString(
161
163
  `<table><tbody><tr>${a}</tr></tbody></table>`,
162
164
  "text/html"
163
165
  ).querySelector("td");
164
166
  if (l && i.parentNode) {
165
- const f = M(e.configBlockAttributes);
167
+ const f = R(e.configBlockAttributes);
166
168
  l.setAttribute("esd-ext-config", JSON.stringify(f));
167
169
  const u = l.querySelector("esd-config-block");
168
170
  u && u.remove(), i.parentNode.replaceChild(l, i);
169
171
  }
170
172
  }), c.documentElement.outerHTML);
171
- } catch (r) {
172
- return console.error("ItemsBlockMigrator failed:", r), t;
173
+ } catch (o) {
174
+ return console.error("ItemsBlockMigrator failed:", o), t;
173
175
  }
174
176
  }
175
177
  /**
@@ -180,13 +182,13 @@ class N {
180
182
  */
181
183
  extractConfiguration(t) {
182
184
  var C, D, P;
183
- const r = ((C = t.querySelector("[data-type]")) == null ? void 0 : C.getAttribute("data-type")) || "CART_ITEMS", c = ((D = t.querySelector("[data-number]")) == null ? void 0 : D.getAttribute("data-number")) || "1", n = parseInt(c) - 1, i = E[r], e = ((P = i == null ? void 0 : i[n]) == null ? void 0 : P.value) || i[0].value, a = t.querySelector('[product-attr="price"]'), d = (a == null ? void 0 : a.getAttribute("data-currency_symbol")) || "USD", f = ((a == null ? void 0 : a.getAttribute("data-curency")) || "before") === "after" ? "1" : "0", u = (a == null ? void 0 : a.getAttribute("data-formated")) !== "false", s = this.extractConfigBlockAttributes(t, r), b = s["data-card_orientation_control_value"];
185
+ const o = ((C = t.querySelector("[data-type]")) == null ? void 0 : C.getAttribute("data-type")) || "CART_ITEMS", c = ((D = t.querySelector("[data-number]")) == null ? void 0 : D.getAttribute("data-number")) || "1", n = parseInt(c) - 1, i = E[o], e = ((P = i == null ? void 0 : i[n]) == null ? void 0 : P.value) || i[0].value, a = t.querySelector('[product-attr="price"]'), d = (a == null ? void 0 : a.getAttribute("data-currency_symbol")) || "USD", f = ((a == null ? void 0 : a.getAttribute("data-curency")) || "before") === "after" ? "1" : "0", u = (a == null ? void 0 : a.getAttribute("data-formated")) !== "false", s = this.extractConfigBlockAttributes(t, o), b = s["data-card_orientation_control_value"];
184
186
  let S;
185
187
  b ? S = b === "horizontal" ? "horizontal" : "vertical" : S = t.querySelector('[colspan="2"]') !== null ? "vertical" : "horizontal";
186
- const p = t.querySelector('a[product-attr="name"]'), T = (p == null ? void 0 : p.getAttribute("style")) || void 0, y = t.querySelector('a[product-attr="button"]'), m = (y == null ? void 0 : y.getAttribute("style")) || void 0, h = (a == null ? void 0 : a.getAttribute("style")) || void 0, A = t.querySelector("p.original-price"), k = (A == null ? void 0 : A.getAttribute("style")) || void 0, I = t.querySelector('[product-attr="quantity"]'), v = (I == null ? void 0 : I.getAttribute("style")) || void 0;
188
+ const p = t.querySelector('a[product-attr="name"]'), T = (p == null ? void 0 : p.getAttribute("style")) || void 0, y = t.querySelector('a[product-attr="button"]'), m = (y == null ? void 0 : y.getAttribute("style")) || void 0, M = (a == null ? void 0 : a.getAttribute("style")) || void 0, A = t.querySelector("p.original-price"), h = (A == null ? void 0 : A.getAttribute("style")) || void 0, I = t.querySelector('[product-attr="quantity"]'), k = (I == null ? void 0 : I.getAttribute("style")) || void 0;
187
189
  return {
188
190
  orientation: S,
189
- itemsType: r,
191
+ itemsType: o,
190
192
  itemId: e,
191
193
  currencySymbol: d,
192
194
  currencyLocation: f,
@@ -194,9 +196,9 @@ class N {
194
196
  configBlockAttributes: s,
195
197
  nameStyles: T,
196
198
  buttonStyles: m,
197
- priceStyles: h,
198
- originalPriceStyles: k,
199
- quantityStyles: v
199
+ priceStyles: M,
200
+ originalPriceStyles: h,
201
+ quantityStyles: k
200
202
  };
201
203
  }
202
204
  /**
@@ -205,7 +207,7 @@ class N {
205
207
  * @param block - The block element containing the esd-config-block
206
208
  * @param itemsType - The type of items (CART_ITEMS, BROWSED_ITEMS, PURCHASED_ITEMS)
207
209
  */
208
- extractConfigBlockAttributes(t, r) {
210
+ extractConfigBlockAttributes(t, o) {
209
211
  const c = t.querySelector("esd-config-block"), n = {};
210
212
  if (!c)
211
213
  return this.getDefaultConfigBlockAttributes();
@@ -214,7 +216,7 @@ class N {
214
216
  }), n["data-cart_items_select_control_value"]) {
215
217
  const e = n["data-cart_items_select_control_value"];
216
218
  if (/^\d+$/.test(e)) {
217
- const a = parseInt(e) - 1, d = E[r];
219
+ const a = parseInt(e) - 1, d = E[o];
218
220
  d && d[a] && (n["data-cart_items_select_control_value"] = d[a].value);
219
221
  }
220
222
  }
@@ -225,7 +227,7 @@ class N {
225
227
  }
226
228
  (!n["data-product_price_currency_symbol"] || n["data-product_price_currency_symbol"].trim() === "") && (n["data-product_price_currency_symbol"] = "USD");
227
229
  const i = { ...this.getDefaultConfigBlockAttributes(), ...n };
228
- return i["data-type"] = r, i["data-source"] = r, i;
230
+ return i["data-type"] = o, i["data-source"] = o, i;
229
231
  }
230
232
  /**
231
233
  * Returns default esd-config-block attributes based on the old template structure
@@ -237,19 +239,24 @@ class N {
237
239
  "data-type": "CART_ITEMS",
238
240
  "data-card_orientation_control_value": "vertical",
239
241
  // Image settings
242
+ "data-product_image_control_opened": "false",
240
243
  "data-product_image_control_image-width": "70",
241
244
  "data-product_image_control_image-height": "70",
242
245
  "data-product_image_control_align_button": "true",
243
246
  "data-product_image_control_padding_mobile": "true",
244
247
  "data-product_image_link": "{{Abandoned Cart Item (1) Image}}",
245
- "data-product_image_control_enabled": "true",
248
+ "data-product_image_control_enabled": "1",
246
249
  // Name settings
247
- "data-product_name_control_enabled": "true",
250
+ "data-product_name_control_opened": "false",
251
+ "data-product_name_control_enabled": "1",
248
252
  "data-product_name_control_font_font_size": "20",
249
253
  "data-product_name_control_trim": "1",
250
254
  // Quantity settings
255
+ "data-product_quantity_control_opened": "true",
251
256
  "data-product_quantity_control_enabled": "true",
257
+ "data-product_quantity_visible": "1",
252
258
  // Price settings
259
+ "data-product_price_control_opened": "false",
253
260
  "data-product_price_control_font_font_size": "20",
254
261
  "data-product_price_control_color": "#060606",
255
262
  "data-product_price_control_curency": "0",
@@ -258,20 +265,21 @@ class N {
258
265
  "data-product_price_control_formated": "1",
259
266
  "data-product_price_control_nodup": "1",
260
267
  "data-product_price_control_single_price": "false",
261
- "data-product_price_control_enabled": "true",
268
+ "data-product_price_visible": "1",
262
269
  // Original price settings
263
270
  "data-product_original_price_control_font_font_size": "19",
264
271
  "data-product_original_price_control_align_align_desktop": "center",
265
272
  "data-product_original_price_control_orientation": "horizontal",
266
273
  "data-product_original_price_control_enabled": "true",
267
274
  // Button settings
268
- "data-product_button_control_enabled": "true",
275
+ "data-product_button_control_opened": "true",
269
276
  "data-product_button_control_label": "Buy",
270
277
  "data-product_button_control_font_font_size": "17",
271
278
  "data-product_button_control_color": "#ffffff",
272
279
  "data-product_button_control_background": "#010101",
273
280
  "data-product_button_control_atw": "true",
274
- "data-product_button_link": "{{Abandoned Cart Item (1) Url}}"
281
+ "data-product_button_link": "{{Abandoned Cart Item (1) Url}}",
282
+ "data-product_button_visible": "1"
275
283
  };
276
284
  }
277
285
  /**
@@ -282,16 +290,16 @@ class N {
282
290
  * - Purchased Items: purchased_item_total_product_kind, purchased_item_price_N, purchased_item_originalprice_N
283
291
  */
284
292
  removeJinjaConditionals(t) {
285
- let r = t.replace(
293
+ let o = t.replace(
286
294
  /\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_total_product_kind\s*(&gt;|>)\s*\d+\s*%\}/g,
287
295
  ""
288
296
  );
289
- return r = r.replace(
297
+ return o = o.replace(
290
298
  /\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_price_\d+\s*(!&#61;|!=)\s*\1_originalprice_\d+\s*%\}/g,
291
299
  ""
292
- ), r = r.replace(/\{%\s*endif\s*%\}/g, ""), r = r.replace(/\n\s*\n\s*\n/g, `
300
+ ), o = o.replace(/\{%\s*endif\s*%\}/g, ""), o = o.replace(/\n\s*\n\s*\n/g, `
293
301
 
294
- `), r;
302
+ `), o;
295
303
  }
296
304
  /**
297
305
  * Replaces template variables with default values from productPairs
@@ -303,7 +311,7 @@ class N {
303
311
  * - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
304
312
  */
305
313
  replaceTemplateVariables(t) {
306
- const { PAIRS_FOR_EXTENSION: r } = B;
314
+ const { PAIRS_FOR_EXTENSION: o } = B;
307
315
  return t.replace(/{{([^}]+)}}/g, (c, n) => {
308
316
  const i = n.match(/^(ins_apr|browsed_item|purchased_item)_([a-z_]+)_(\d+)$/);
309
317
  if (!i)
@@ -311,10 +319,10 @@ class N {
311
319
  const [, e, a, d] = i, l = x[e];
312
320
  if (!l)
313
321
  return console.warn(`Unknown variable prefix: ${e}`), c;
314
- const f = w[a];
322
+ const f = q[a];
315
323
  if (!f)
316
324
  return console.warn(`Unknown variable suffix mapping for: ${a}`), c;
317
- const { pairsKey: u, defaultKey: s, isArray: b } = f, p = r[u][l];
325
+ const { pairsKey: u, defaultKey: s, isArray: b } = f, p = o[u][l];
318
326
  if (!p)
319
327
  return console.warn(`No data found for: ${u}.${l}`), c;
320
328
  if (b) {
@@ -326,8 +334,8 @@ class N {
326
334
  });
327
335
  }
328
336
  }
329
- function Y(o) {
330
- return new N().migrate(o);
337
+ function Y(r) {
338
+ return new N().migrate(r);
331
339
  }
332
340
  export {
333
341
  Y as migrateItemsBlock
@@ -0,0 +1,8 @@
1
+ const e = "https://academy.insiderone.com/", o = {
2
+ EMAIL_EDITOR: `${e}/docs/email-drag-and-drop-editor`,
3
+ GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
4
+ AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`
5
+ };
6
+ export {
7
+ o as ACADEMY_LINKS
8
+ };
@@ -2,9 +2,8 @@ const e = [
2
2
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
3
3
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
4
4
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
5
- ], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper", a = "https://academy.useinsider.com/docs/email-drag-drop-editor";
5
+ ], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper";
6
6
  export {
7
- a as ACADEMY_LINK,
8
7
  n as CARD_COMPOSITION_TAB_SELECTOR,
9
8
  o as RIBBON_SELECTOR,
10
9
  e as SERVICE_HOVER_SELECTORS,
@@ -1,26 +1,26 @@
1
- import { useTranslations as n } from "../composables/useTranslations.js";
1
+ import { useTranslations as e } from "../composables/useTranslations.js";
2
2
  import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
- const N = {
3
+ const I = {
4
4
  UNSUBSCRIBE_LINK_TYPE: 1,
5
5
  PREFERENCES_LINK_TYPE: 3
6
- }, I = {
6
+ }, r = {
7
7
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
8
8
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
9
9
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
10
10
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
11
- }, s = R(), i = {
11
+ }, s = R(), _ = {
12
12
  UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
13
13
  PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
14
- }, _ = "iid", B = {
14
+ }, i = "iid", B = {
15
15
  name: "Global Unsubscribe",
16
16
  sendGridId: "G"
17
- }, t = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", C = "/email/unsubscribe-pages", E = {
17
+ }, C = "/email/unsubscribe-pages", E = {
18
18
  GLOBAL_UNSUBSCRIBE: 1,
19
19
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
20
20
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
21
21
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
22
22
  RESUBSCRIBE: 5
23
- }, c = {
23
+ }, t = {
24
24
  [E.GLOBAL_UNSUBSCRIBE]: [
25
25
  E.GLOBAL_UNSUBSCRIBE,
26
26
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -31,29 +31,28 @@ const N = {
31
31
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
32
32
  ]
33
33
  }, U = () => {
34
- const e = n();
34
+ const n = e();
35
35
  return {
36
- [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
37
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
38
- [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
39
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
40
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
36
+ [E.GLOBAL_UNSUBSCRIBE]: n("unsubscription-preference.type-global-unsubscribe"),
37
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: n("unsubscription-preference.type-global-unsubscription-confirmation"),
38
+ [E.RESUBSCRIBE]: n("unsubscription-preference.type-resubscribe"),
39
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: n("unsubscription-preference.type-subscription-preferences-center"),
40
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: n("unsubscription-preference.type-subscription-preferences-confirmation")
41
41
  };
42
- }, o = {
42
+ }, c = {
43
43
  default: "{{ins-unsubscribe-link}}",
44
44
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
45
45
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
46
46
  };
47
47
  export {
48
- t as ACADEMY_LINK,
49
48
  B as DEFAULT_UNSUBSCRIBE_GROUP,
50
- _ as INSIDER_ID,
51
- I as LINK_REGEXES,
52
- N as LINK_TYPES,
53
- o as MERGE_TAGS,
49
+ i as INSIDER_ID,
50
+ r as LINK_REGEXES,
51
+ I as LINK_TYPES,
52
+ c as MERGE_TAGS,
54
53
  E as PAGE_TYPES,
55
- c as TYPE_COLLECTIONS,
54
+ t as TYPE_COLLECTIONS,
56
55
  C as UNSUBSCRIBE_PAGES_LINK,
57
- i as URLS,
56
+ _ as URLS,
58
57
  U as getTypeTranslations
59
58
  };
@@ -1,19 +1,20 @@
1
- import { useOnboardingStore as m } from "../../../stores/onboarding.js";
2
- import { Block as u, BlockCompositionType as d, ModificationDescription as i } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { useOnboardingStore as d } from "../../../stores/onboarding.js";
2
+ import { Block as u, BlockCompositionType as p, ModificationDescription as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ import { ItemsBlockId as f } from "./enums/controlEnums.js";
3
4
  import { SETTINGS_ENUMS as c, DefaultConfigValues as o } from "./enums/settingsEnums.js";
4
- import { useItemsBlockStore as p } from "./store/items-block.js";
5
- import { getDefaultTemplate as f } from "./template.js";
6
- import { getItemsBlockContainer as g, getItemsBlockConfig as a, getDefaultItemsBlockConfig as C } from "./utils/nodeConfigUtils.js";
7
- const y = "items-block";
8
- class B extends u {
5
+ import { useItemsBlockStore as g } from "./store/items-block.js";
6
+ import { getDefaultTemplate as y } from "./template.js";
7
+ import { getItemsBlockContainer as C, getItemsBlockConfig as a, getDefaultItemsBlockConfig as I } from "./utils/nodeConfigUtils.js";
8
+ const b = "items-block";
9
+ class O extends u {
9
10
  getId() {
10
- return y;
11
+ return b;
11
12
  }
12
13
  getIcon() {
13
14
  return "items-icon";
14
15
  }
15
16
  getBlockCompositionType() {
16
- return d.CONTAINER;
17
+ return p.CONTAINER;
17
18
  }
18
19
  getName() {
19
20
  return this.api.translate("Items");
@@ -22,7 +23,7 @@ class B extends u {
22
23
  return this.api.translate("Items lets you display personalized products based on user behavior.");
23
24
  }
24
25
  getTemplate() {
25
- return f({
26
+ return y({
26
27
  orientation: c.ORIENTATION.VERTICAL,
27
28
  itemsType: c.ITEMS_TYPE.CART_ITEMS,
28
29
  itemId: "{{Abandoned Cart Item (1) Url}}",
@@ -34,20 +35,22 @@ class B extends u {
34
35
  allowInnerBlocksDND() {
35
36
  return !1;
36
37
  }
37
- onCreated(n) {
38
- const e = g(n);
38
+ onCreated(i) {
39
+ const e = C(i);
39
40
  if (!e)
40
41
  return;
41
- const t = e.getNodeConfig(), l = t && Object.keys(t).length > 0, r = a(n);
42
+ const t = e.getNodeConfig(), l = t && Object.keys(t).length > 0, r = a(i);
42
43
  if (r != null && r.initialized)
43
- l ? r.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...r, blockInstanceId: String(Date.now()) }).apply(new i("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(r).apply(new i("Migrate legacy config to nodeConfig"));
44
+ l ? r.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...r, blockInstanceId: String(Date.now()) }).apply(new n("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(r).apply(new n("Migrate legacy config to nodeConfig"));
44
45
  else {
45
- const s = C();
46
- this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(s).apply(new i("Initialize Items block with default configuration")), m().startOnboarding("itemsOnboarding");
46
+ const m = I();
47
+ this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(m).apply(new n("Initialize Items block with default configuration")), d().startOnboarding("itemsOnboarding");
47
48
  }
49
+ const s = `[esd-extension-block-id="${f.IMAGE}"] img`;
50
+ this.api.getDocumentModifier().modifyHtml(i.querySelector(s)).setStyle("object-fit", "contain").apply(new n("Updated image object-fit"));
48
51
  }
49
- onSelect(n) {
50
- const e = p(), t = a(n);
52
+ onSelect(i) {
53
+ const e = g(), t = a(i);
51
54
  t && (e.setItemsType(t.type || o.itemsType), e.setItemIds(t.itemsSelectValue || o.cartItemsSelectControlValue), e.setOrientation(t.orientation || o.cardOrientationControlValue), e.setCurrencySymbol(
52
55
  t.priceCurrencySymbol || o.productPriceCurrencySymbolControlValue
53
56
  ), e.setCurrencyLocation(
@@ -58,6 +61,6 @@ class B extends u {
58
61
  }
59
62
  }
60
63
  export {
61
- y as BLOCK_ID,
62
- B as ItemsBlock
64
+ b as BLOCK_ID,
65
+ O as ItemsBlock
63
66
  };
@@ -1,76 +1,82 @@
1
- var R = Object.defineProperty;
2
- var _ = (i, t, e) => t in i ? R(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var m = (i, t, e) => _(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { ModificationDescription as F, UIElementType as P, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ var C = Object.defineProperty;
2
+ var A = (n, r, e) => r in n ? C(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
3
+ var _ = (n, r, e) => A(n, typeof r != "symbol" ? r + "" : r, e);
4
+ import { ModificationDescription as L, UIElementType as m, UEAttr as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as h } from "../../../common-control.js";
6
- import { ItemsBlockControlId as p, ItemsBlockId as g } from "../../enums/controlEnums.js";
7
- import { productPairs as T } from "../../enums/productEnums.js";
8
- import { useItemsBlockStore as A } from "../../store/items-block.js";
9
- import { getItemsBlockConfig as f, setItemsBlockConfig as u } from "../../utils/nodeConfigUtils.js";
10
- const D = p.PRICE_FORMATTED_PRICE, n = {
6
+ import { ItemsBlockControlId as l, ItemsBlockId as D } from "../../enums/controlEnums.js";
7
+ import { productPairs as I } from "../../enums/productEnums.js";
8
+ import { useItemsBlockStore as O } from "../../store/items-block.js";
9
+ import { getItemsBlockConfig as u, setItemsBlockConfig as f } from "../../utils/nodeConfigUtils.js";
10
+ const N = l.PRICE_FORMATTED_PRICE, c = {
11
11
  FORMATTED_PRICE: "formattedPrice"
12
12
  };
13
- class k extends h {
13
+ class y extends h {
14
14
  constructor() {
15
15
  super(...arguments);
16
- m(this, "store", A());
16
+ _(this, "store", O());
17
17
  }
18
18
  getId() {
19
- return D;
19
+ return N;
20
20
  }
21
21
  getTemplate() {
22
22
  return `
23
- <div class="container ${p.PRICE_FORMATTED_PRICE}">
23
+ <div class="container ${l.PRICE_FORMATTED_PRICE}">
24
24
  ${this._getFormattedPrice()}
25
25
  </div>
26
26
  `;
27
27
  }
28
28
  onRender() {
29
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (e) => {
29
+ this.api.updateValues({ [c.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(c.FORMATTED_PRICE, (e) => {
30
30
  this._onFormattedPriceChange(e);
31
31
  });
32
32
  }
33
33
  onTemplateNodeUpdated(e) {
34
34
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
35
35
  () => {
36
- const r = f(this.currentNode);
37
- r && this.store.setFormattedPrice(r.priceFormatted ?? !0);
36
+ const o = u(this.currentNode);
37
+ o && this.store.setFormattedPrice(o.priceFormatted ?? !0);
38
38
  },
39
39
  () => {
40
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice });
40
+ this.api.updateValues({ [c.FORMATTED_PRICE]: this.store.formattedPrice });
41
41
  }
42
42
  );
43
43
  }
44
44
  _onFormattedPriceChange(e) {
45
- if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e), u(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
45
+ if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e), f(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
46
46
  return;
47
- const { itemsType: r } = this.store, o = T.PAIRS_FOR_EXTENSION.price[r], s = T.PAIRS_FOR_EXTENSION.originalPrice[r], [c, a] = e ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE], [l, I] = e ? [s.DEFAULT_PRICE, s.DEFAULT_PRICE_FORMATTED] : [s.DEFAULT_PRICE_FORMATTED, s.DEFAULT_PRICE];
47
+ const { itemsType: o, singlePrice: i } = this.store, t = I.PAIRS_FOR_EXTENSION.price[o], s = I.PAIRS_FOR_EXTENSION.originalPrice[o], [E, R] = e ? [
48
+ i ? t.DEFAULT_SINGLE_PRICE : t.DEFAULT_PRICE,
49
+ i ? t.DEFAULT_SINGLE_PRICE_FORMATTED : t.DEFAULT_PRICE_FORMATTED
50
+ ] : [
51
+ i ? t.DEFAULT_SINGLE_PRICE_FORMATTED : t.DEFAULT_PRICE_FORMATTED,
52
+ i ? t.DEFAULT_SINGLE_PRICE : t.DEFAULT_PRICE
53
+ ], d = i ? s.DEFAULT_SINGLE_PRICE : s.DEFAULT_PRICE, P = i ? s.DEFAULT_SINGLE_PRICE_FORMATTED : s.DEFAULT_PRICE_FORMATTED, [p, F] = e ? [d, P] : [P, d];
48
54
  this._updatePriceBlock(
49
55
  this.currentNode,
50
- c,
51
- a,
56
+ E,
57
+ R,
52
58
  "price"
53
59
  );
54
- const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${g.ORIGINAL_PRICE}"]`);
55
- E && this._updatePriceBlock(E, l, I, "original price");
60
+ const a = this.currentNode.closest(".items-block"), T = a == null ? void 0 : a.querySelector(`[esd-extension-block-id="${D.ORIGINAL_PRICE}"]`);
61
+ T && this._updatePriceBlock(T, p, F, "original price");
56
62
  }
57
- _updatePriceBlock(e, r, o, s) {
58
- const c = e.getInnerHTML().replace(r, o), a = `Updated ${s} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
59
- this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(c).apply(new F(a));
63
+ _updatePriceBlock(e, o, i, t) {
64
+ const s = e.getInnerHTML().replace(o, i), E = `Updated ${t} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
65
+ this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(s).apply(new L(E));
60
66
  }
61
67
  _getFormattedPrice() {
62
68
  return `
63
69
  <div class="display-flex align-items-center justify-content-between">
64
- <${P.LABEL}
65
- ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
70
+ <${m.LABEL}
71
+ ${g.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
66
72
  >
67
- </${P.LABEL}>
68
- ${this._GuToggle(n.FORMATTED_PRICE)}
73
+ </${m.LABEL}>
74
+ ${this._GuToggle(c.FORMATTED_PRICE)}
69
75
  </div>
70
76
  `;
71
77
  }
72
78
  }
73
79
  export {
74
- D as CONTROL_BLOCK_ID,
75
- k as PriceFormattedPriceControl
80
+ N as CONTROL_BLOCK_ID,
81
+ y as PriceFormattedPriceControl
76
82
  };