@useinsider/guido 1.0.3-beta.d1ff593 → 1.0.3-beta.d574817

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 (135) hide show
  1. package/README.md +144 -3
  2. package/dist/components/Guido.vue.js +11 -9
  3. package/dist/components/Guido.vue2.js +76 -70
  4. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -15
  6. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  7. package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
  8. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  9. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -17
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -10
  11. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +19 -18
  12. package/dist/composables/useBlocksConfig.js +49 -0
  13. package/dist/composables/useGuidoActions.js +19 -9
  14. package/dist/composables/useStripo.js +49 -58
  15. package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
  16. package/dist/config/migrator/recommendationMigrator.js +188 -98
  17. package/dist/enums/date.js +6 -0
  18. package/dist/enums/defaults.js +16 -8
  19. package/dist/enums/onboarding.js +2 -1
  20. package/dist/enums/unsubscribe.js +27 -25
  21. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  22. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  23. package/dist/extensions/Blocks/Recommendation/block.js +1 -1
  24. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +66 -298
  25. package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
  26. package/dist/extensions/Blocks/Recommendation/control.js +5 -4
  27. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +7 -6
  28. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +7 -6
  29. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +7 -6
  30. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +5 -4
  31. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +5 -4
  32. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +5 -4
  33. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +5 -4
  34. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +5 -4
  35. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +5 -4
  36. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +5 -4
  37. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +5 -4
  38. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
  39. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
  40. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +5 -4
  41. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +7 -6
  42. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +5 -4
  43. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +5 -4
  44. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +5 -4
  45. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +7 -6
  46. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +7 -6
  47. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
  48. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
  49. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
  51. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
  52. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
  53. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
  54. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
  55. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
  56. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
  57. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
  58. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
  59. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
  60. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
  61. package/dist/extensions/Blocks/Recommendation/extension.js +37 -21
  62. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +90 -45
  63. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  64. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +160 -0
  65. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +152 -0
  66. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +180 -0
  67. package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
  68. package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
  69. package/dist/guido.css +1 -1
  70. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +198 -176
  71. package/dist/package.json.js +1 -1
  72. package/dist/services/stripoApi.js +1 -1
  73. package/dist/src/@types/generic.d.ts +42 -6
  74. package/dist/src/components/Guido.vue.d.ts +4 -2
  75. package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +3 -1
  76. package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +3 -1
  77. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  78. package/dist/src/composables/useBlocksConfig.d.ts +11 -0
  79. package/dist/src/composables/useGuidoActions.d.ts +9 -0
  80. package/dist/src/enums/date.d.ts +4 -0
  81. package/dist/src/enums/onboarding.d.ts +1 -0
  82. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +5 -42
  83. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -0
  84. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
  85. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
  87. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
  88. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
  89. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
  90. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
  91. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
  92. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
  93. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
  94. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
  95. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
  96. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
  97. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
  98. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
  99. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
  100. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  101. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
  102. package/dist/src/extensions/Blocks/Recommendation/{template.d.ts → templates/migrationTemplate.d.ts} +7 -34
  103. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
  104. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
  105. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
  106. package/dist/src/stores/config.d.ts +10 -2
  107. package/dist/src/stores/dynamic-content.d.ts +3 -3
  108. package/dist/src/stores/editor.d.ts +1 -1
  109. package/dist/src/stores/onboarding.d.ts +1 -1
  110. package/dist/src/stores/preview.d.ts +1 -1
  111. package/dist/src/stores/recommendation.d.ts +1 -1
  112. package/dist/src/stores/save-as-template.d.ts +1 -1
  113. package/dist/src/stores/toaster.d.ts +1 -1
  114. package/dist/src/stores/unsubscribe.d.ts +1 -1
  115. package/dist/src/stores/version-history.d.ts +1 -1
  116. package/dist/src/utils/dateUtil.d.ts +21 -0
  117. package/dist/src/utils/environmentUtil.d.ts +5 -0
  118. package/dist/src/utils/genericUtil.d.ts +1 -0
  119. package/dist/static/styles/components/narrow-panel.css.js +10 -0
  120. package/dist/static/styles/customEditorStyle.css.js +5 -0
  121. package/dist/stores/config.js +5 -5
  122. package/dist/stores/dynamic-content.js +2 -2
  123. package/dist/stores/editor.js +1 -1
  124. package/dist/stores/onboarding.js +27 -27
  125. package/dist/stores/preview.js +1 -1
  126. package/dist/stores/recommendation.js +3 -3
  127. package/dist/stores/save-as-template.js +2 -2
  128. package/dist/stores/toaster.js +1 -1
  129. package/dist/stores/unsubscribe.js +1 -1
  130. package/dist/stores/version-history.js +4 -4
  131. package/dist/utils/dateUtil.js +24 -3
  132. package/dist/utils/environmentUtil.js +4 -0
  133. package/dist/utils/genericUtil.js +20 -9
  134. package/package.json +2 -2
  135. package/dist/extensions/Blocks/Recommendation/template.js +0 -314
@@ -1,23 +1,24 @@
1
- var b = Object.defineProperty;
2
- var y = (i, e, t) => e in i ? b(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var p = (i, e, t) => y(i, typeof e != "symbol" ? e + "" : e, t);
4
- import h, { getDefaultProducts as x, prepareProductRows as C } from "../../extensions/Blocks/Recommendation/template.js";
1
+ var h = Object.defineProperty;
2
+ var T = (A, e, t) => e in A ? h(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t;
3
+ var m = (A, e, t) => T(A, typeof e != "symbol" ? e + "" : e, t);
4
+ import P, { prepareProductRows as S } from "../../extensions/Blocks/Recommendation/templates/migrationTemplate.js";
5
+ import { getDefaultProducts as q } from "../../extensions/Blocks/Recommendation/templates/templateUtils.js";
5
6
  class w {
6
7
  constructor() {
7
- p(this, "parser");
8
+ m(this, "parser");
8
9
  this.parser = new DOMParser();
9
10
  }
10
11
  migrate(e) {
11
12
  try {
12
- const t = this.parser.parseFromString(e, "text/html"), r = t.querySelectorAll(
13
+ const t = this.parser.parseFromString(e, "text/html"), s = t.querySelectorAll(
13
14
  'td.ins-recommendation-v3-block-1, td.product-block[esd-handler-name*="EmailRecommendationV3"]'
14
15
  );
15
- return r.length === 0 ? e : (r.forEach((o) => {
16
- const n = o.getAttribute("id"), s = this.extractBgColor(o), c = this.extractTitle(o), a = this.extractProductRows(o), u = h.replace("{-{-TITLE-}-}", c).replace("{-{-PRODUCT_ROWS-}-}", a), l = this.parser.parseFromString(
17
- `<table id="tempDoc"><tbody><tr>${u}</tr></tbody></table>`,
16
+ return s.length === 0 ? e : (s.forEach((o) => {
17
+ const l = o.getAttribute("id"), r = this.extractBgColor(o), i = this.extractTitle(o), u = this.extractProductRows(o), c = P.replace("{-{-TITLE-}-}", i).replace("{-{-PRODUCT_ROWS-}-}", u), a = this.parser.parseFromString(
18
+ `<table id="tempDoc"><tbody><tr>${c}</tr></tbody></table>`,
18
19
  "text/html"
19
20
  ).querySelector(".ins-recommendation-v3-block-v2");
20
- l && o.parentNode && (n && l.setAttribute("id", n), console.debug("BG Color", s), s && l.setAttribute("bgcolor", s), o.parentNode.replaceChild(l, o));
21
+ a && o.parentNode && (l && a.setAttribute("id", l), r && a.setAttribute("bgcolor", r), o.parentNode.replaceChild(a, o));
21
22
  }), t.documentElement.outerHTML);
22
23
  } catch (t) {
23
24
  return console.error("RecommendationMigrator failed:", t), e;
@@ -25,53 +26,45 @@ class w {
25
26
  }
26
27
  /**
27
28
  * Extracts background color from old block
28
- *
29
- * Checks for background color in the following priority order:
30
- * 1. bgcolor attribute: `<td bgcolor="#f9f9f9">`
31
- * 2. style attribute: `<td style="background-color: #f9f9f9;">`
32
- * @example
33
- * // From bgcolor attribute
34
- * <td bgcolor="#ffffff"> → "#ffffff"
35
- *
36
- * // From style attribute
37
- * <td style="background-color: rgb(255, 255, 255);"> → "rgb(255, 255, 255)"
38
- *
39
- * // No background color
40
- * <td> → ""
41
29
  * @param block - The old recommendation block element
42
- * @returns The background color value (hex, rgb, rgba, named color) or empty string
30
+ * @returns The background color value or empty string
43
31
  */
44
32
  extractBgColor(e) {
45
33
  const t = e.getAttribute("bgcolor");
46
- if (console.debug("bg block", e), console.debug("bg attr", t), t)
34
+ if (t)
47
35
  return t.trim();
48
- const r = e.getAttribute("style");
49
- if (console.debug("bg style", r), r) {
50
- const o = r.match(/background-color\s*:\s*([^;]+)/i);
36
+ const s = e.getAttribute("style");
37
+ if (s) {
38
+ const o = s.match(/background-color\s*:\s*([^;]+)/i);
51
39
  if (o && o[1])
52
40
  return o[1].trim();
53
41
  }
54
42
  return "";
55
43
  }
56
44
  /**
57
- * Extracts title from old block
58
- *
59
- * Old structure:
60
- * <td class="ext-recommendation-title" align="right">
61
- * <p style="color: #93c47d; font-weight: bold; font-style: italic; font-size: 28px;">
62
- * This is amazing recommendation
63
- * </p>
64
- * </td>
65
- *
66
- * New structure (output):
67
- * <td class="esd-block-text es-p10t es-p10b es-p20l es-p20r" align="center">
68
- * <p path="1" style="font-size: 28px; color: #333333;">
69
- * <strong path="1,0">Title Text</strong>
70
- * </p>
71
- * </td>
45
+ * Extracts background color from product card wrapper element
46
+ * @param cardElement - The product card TD element
47
+ * @returns The background color value or empty string
48
+ */
49
+ extractCardBgColor(e) {
50
+ const t = e.getAttribute("bgcolor");
51
+ if (t)
52
+ return t.trim();
53
+ const s = e.getAttribute("style");
54
+ if (s) {
55
+ const o = s.match(/background-color\s*:\s*([^;]+)/i);
56
+ if (o && o[1])
57
+ return o[1].trim();
58
+ }
59
+ return "";
60
+ }
61
+ /**
62
+ * Extracts title from old block and converts to new structure
63
+ * @param block - The old recommendation block element
64
+ * @returns HTML string for the title block
72
65
  */
73
66
  extractTitle(e) {
74
- var l, d;
67
+ var a, g;
75
68
  const t = e.querySelector(".ext-recommendation-title");
76
69
  if (!t)
77
70
  return this.buildTitleBlock({
@@ -81,83 +74,182 @@ class w {
81
74
  align: "center",
82
75
  styles: "font-size: 28px; color: #333333;"
83
76
  });
84
- const r = t.querySelector("p");
85
- if (!r) {
86
- const m = ((l = t.textContent) == null ? void 0 : l.trim()) || "You May Also Like!", f = t.getAttribute("align") || "center";
77
+ const s = t.querySelector("p");
78
+ if (!s) {
79
+ const p = ((a = t.textContent) == null ? void 0 : a.trim()) || "You May Also Like!", b = t.getAttribute("align") || "center";
87
80
  return this.buildTitleBlock({
88
- text: m,
81
+ text: p,
89
82
  isBold: !0,
90
83
  isItalic: !1,
91
- align: f,
84
+ align: b,
92
85
  styles: "font-size: 28px; color: #333333;"
93
86
  });
94
87
  }
95
- const o = ((d = r.textContent) == null ? void 0 : d.trim()) || "You May Also Like!", n = t.getAttribute("align") || r.getAttribute("align") || "center", s = r.getAttribute("style") || "", c = /font-weight\s*:\s*bold/i.test(s) || !!r.querySelector("b, strong"), a = /font-style\s*:\s*italic/i.test(s) || !!r.querySelector("i, em"), u = this.removeStyleProperties(s, ["font-weight", "font-style"]), g = this.convertInlineToBlock(u);
88
+ const o = ((g = s.textContent) == null ? void 0 : g.trim()) || "You May Also Like!", l = t.getAttribute("align") || s.getAttribute("align") || "center", r = s.getAttribute("style") || "", i = /font-weight\s*:\s*bold/i.test(r) || !!s.querySelector("b, strong"), u = /font-style\s*:\s*italic/i.test(r) || !!s.querySelector("i, em"), c = this.removeStyleProperties(r, ["font-weight", "font-style"]), n = this.convertInlineToBlock(c);
96
89
  return this.buildTitleBlock({
97
90
  text: o,
98
- isBold: c,
99
- isItalic: a,
100
- align: n,
101
- styles: g
91
+ isBold: i,
92
+ isItalic: u,
93
+ align: l,
94
+ styles: n
102
95
  });
103
96
  }
104
97
  /**
105
98
  * Extracts product configuration from old block and generates new product rows
106
- *
107
- * Strategy:
108
- * 1. Extract product count and layout configuration from old block
109
- * 2. Use prepareProductRows() to generate new HTML structure with default product data
110
- *
111
- * The migrator uses default/placeholder product data from getDefaultProducts()
112
- * to populate the new block structure.
99
+ * @param block - The old recommendation block element
100
+ * @returns HTML string for product rows
113
101
  */
114
102
  extractProductRows(e) {
115
103
  const t = this.extractProductConfig(e);
116
104
  if (!t)
117
- return console.warn("[RecommendationMigrator] No product config found, using defaults"), this.generateProductRows(6, 3);
118
- const { totalCount: r, rowCount: o } = t;
119
- return this.generateProductRows(r, o);
105
+ return console.warn("[RecommendationMigrator] No product config found, using defaults"), this.generateProductRows(6, 3, {});
106
+ const { totalCount: s, productsPerRow: o } = t, l = this.extractProductStyles(e);
107
+ return this.generateProductRows(s, o, l);
108
+ }
109
+ /**
110
+ * Extracts Stripo padding/margin utility classes from a class string
111
+ * @param classString - Space-separated class string from element
112
+ * @returns Filtered Stripo utility classes as a space-separated string
113
+ */
114
+ extractStripoClasses(e) {
115
+ return e ? e.split(/\s+/).filter((o) => /^es-(p\d+|m[-\d])/.test(o)).join(" ") : "";
120
116
  }
121
117
  /**
122
118
  * Extracts product configuration from old block
123
- *
124
- * Parses esd-dev-product-config attribute:
125
- * {"rowCount":3,"totalCount":6,"orientation":"vertical",...}
119
+ * @param block - The old recommendation block element
120
+ * @returns Object with totalCount and productsPerRow, or null if parsing fails
126
121
  */
127
122
  extractProductConfig(e) {
128
123
  const t = e.getAttribute("esd-dev-product-config");
129
124
  if (!t)
130
125
  return null;
131
126
  try {
132
- const r = t.replace(/&quot;/g, '"').replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">"), o = JSON.parse(r);
127
+ const s = this.unescapeJsonString(t), o = JSON.parse(s);
133
128
  return {
134
129
  totalCount: o.totalCount ?? 6,
135
- rowCount: o.rowCount ?? 3
130
+ productsPerRow: o.rowCount ?? 3
136
131
  };
137
- } catch (r) {
138
- return console.error("[RecommendationMigrator] Failed to parse product config:", r), null;
132
+ } catch (s) {
133
+ return console.error("[RecommendationMigrator] Failed to parse product config:", s), console.error(
134
+ "[RecommendationMigrator] Error details:",
135
+ s instanceof Error ? s.message : String(s)
136
+ ), null;
139
137
  }
140
138
  }
139
+ /**
140
+ * Decodes HTML entities from JSON string
141
+ * @param text - The encoded string
142
+ * @returns Decoded string
143
+ */
144
+ unescapeJsonString(e) {
145
+ return e.replace(/&amp;/g, "&").replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&#x27;/g, "'").replace(/&quot;/g, '"').replace(/\\\\"/g, "'");
146
+ }
141
147
  /**
142
148
  * Generates product rows using prepareProductRows with default product data
143
- *
144
- * Process:
145
- * 1. Get default products from getDefaultProducts()
146
- * 2. Create array of products (repeat defaults if needed to reach totalCount)
147
- * 3. Call prepareProductRows() to generate HTML structure
148
- *
149
- * The generated HTML will contain placeholder/default product data
150
- * which can be replaced with real data at runtime.
151
- * @param totalCount - Total number of products (e.g., 6)
152
- * @param productsPerRow - Products per row (e.g., 3)
149
+ * @param totalCount - Total number of products to display
150
+ * @param productsPerRow - Number of products in each row
151
+ * @param extractedStyles - Styles extracted from old product elements
152
+ * @returns HTML string for product rows with applied styles
153
+ */
154
+ generateProductRows(e, t, s) {
155
+ const o = q(), l = [];
156
+ for (let i = 0; i < e; i++) {
157
+ const u = o[i % o.length];
158
+ l.push({ ...u });
159
+ }
160
+ let r = S(l, t);
161
+ return r = this.applyExtractedStyles(r, s), r;
162
+ }
163
+ /**
164
+ * Extracts styles from old product elements
165
+ * @param block - The old recommendation block element
166
+ * @returns Object with extracted styles for each element type
153
167
  */
154
- generateProductRows(e, t) {
155
- const r = x(), o = [];
156
- for (let n = 0; n < e; n++) {
157
- const s = r[n % r.length];
158
- o.push({ ...s });
168
+ extractProductStyles(e) {
169
+ const t = {}, s = e.querySelector(".product-card");
170
+ if (!s)
171
+ return console.warn("[RecommendationMigrator] No product card found, using default styles"), t;
172
+ const o = this.extractCardBgColor(s);
173
+ o && (t.cardBgColor = o);
174
+ const l = s.querySelector(".ext-product-image");
175
+ if (l) {
176
+ const n = l.querySelector("img"), a = n == null ? void 0 : n.getAttribute("width"), g = l.getAttribute("style") || "", p = l.getAttribute("align") || "center", b = l.getAttribute("class") || "", d = this.extractStripoClasses(b);
177
+ t.imageWidth = a || "120", t.imageAlign = p, t.imageTdStyle = g, t.imageClasses = d;
178
+ }
179
+ const r = s.querySelector(".ext-product-name");
180
+ if (r) {
181
+ const n = r.querySelector("p"), a = (n == null ? void 0 : n.getAttribute("style")) || "", g = r.getAttribute("align") || "center", p = r.getAttribute("style") || "", b = r.getAttribute("class") || "", d = this.extractStripoClasses(b);
182
+ t.nameStyle = a, t.nameAlign = g, t.nameTdStyle = p, t.nameClasses = d;
159
183
  }
160
- return C(o, t);
184
+ const i = s.querySelector(".ext-product-price");
185
+ if (i) {
186
+ const n = i.querySelector("p"), a = (n == null ? void 0 : n.getAttribute("style")) || "", g = i.getAttribute("align") || "center", p = i.getAttribute("style") || "", b = i.getAttribute("class") || "", d = this.extractStripoClasses(b);
187
+ t.priceStyle = a, t.priceAlign = g, t.priceTdStyle = p, t.priceClasses = d;
188
+ }
189
+ const u = s.querySelector(".ext-product-original-price");
190
+ if (u) {
191
+ const n = u.querySelector("p"), a = (n == null ? void 0 : n.getAttribute("style")) || "", g = u.getAttribute("align") || "center", p = u.getAttribute("style") || "", b = u.getAttribute("class") || "", d = this.extractStripoClasses(b);
192
+ t.oldPriceStyle = a, t.oldPriceAlign = g, t.oldPriceTdStyle = p, t.oldPriceClasses = d;
193
+ }
194
+ const c = s.querySelector(".ext-product-button");
195
+ if (c) {
196
+ const n = c.querySelector(".es-button-border"), a = c.querySelector("a.es-button"), g = (n == null ? void 0 : n.getAttribute("style")) || "", p = (a == null ? void 0 : a.getAttribute("style")) || "", b = c.getAttribute("align") || "center", d = c.getAttribute("style") || "", f = c.getAttribute("class") || "", C = this.extractStripoClasses(f), y = ((c == null ? void 0 : c.textContent) || "").trim();
197
+ t.buttonBorderStyle = g, t.buttonLinkStyle = p, t.buttonAlign = b, t.buttonTdStyle = d, t.buttonClasses = C, t.buttonText = y;
198
+ }
199
+ return t;
200
+ }
201
+ /**
202
+ * Applies extracted styles to the generated HTML
203
+ * @param html - The generated HTML from prepareProductRows
204
+ * @param extractedStyles - Styles extracted from old product elements
205
+ * @returns HTML with applied styles
206
+ */
207
+ applyExtractedStyles(e, t) {
208
+ if (!t || Object.keys(t).length === 0)
209
+ return e;
210
+ const s = this.parser.parseFromString(`<table>${e}</table>`, "text/html");
211
+ t.cardBgColor && s.querySelectorAll(".product-attribute-cell").forEach((r) => {
212
+ r.setAttribute("bgcolor", t.cardBgColor);
213
+ }), (t.imageWidth || t.imageAlign || t.imageTdStyle || t.imageClasses) && s.querySelectorAll(".product-image").forEach((r) => {
214
+ if (t.imageAlign && r.setAttribute("align", t.imageAlign), t.imageTdStyle && r.setAttribute("style", t.imageTdStyle), t.imageClasses) {
215
+ const c = `${r.getAttribute("class") || ""} ${t.imageClasses}`.trim();
216
+ r.setAttribute("class", c);
217
+ }
218
+ const i = r.querySelector("img");
219
+ i && t.imageWidth && i.setAttribute("width", t.imageWidth);
220
+ }), (t.nameStyle || t.nameAlign || t.nameTdStyle || t.nameClasses) && s.querySelectorAll(".product-name").forEach((r) => {
221
+ if (t.nameAlign && r.setAttribute("align", t.nameAlign), t.nameTdStyle && r.setAttribute("style", t.nameTdStyle), t.nameClasses) {
222
+ const c = `${r.getAttribute("class") || ""} ${t.nameClasses}`.trim();
223
+ r.setAttribute("class", c);
224
+ }
225
+ const i = r.querySelector("p");
226
+ i && t.nameStyle && i.setAttribute("style", t.nameStyle);
227
+ }), (t.priceStyle || t.priceAlign || t.priceTdStyle || t.priceClasses) && s.querySelectorAll(".product-price").forEach((r) => {
228
+ if (t.priceAlign && r.setAttribute("align", t.priceAlign), t.priceTdStyle && r.setAttribute("style", t.priceTdStyle), t.priceClasses) {
229
+ const c = `${r.getAttribute("class") || ""} ${t.priceClasses}`.trim();
230
+ r.setAttribute("class", c);
231
+ }
232
+ const i = r.querySelector("p");
233
+ i && t.priceStyle && i.setAttribute("style", t.priceStyle);
234
+ }), (t.oldPriceStyle || t.oldPriceAlign || t.oldPriceTdStyle || t.oldPriceClasses) && s.querySelectorAll(".product-old-price").forEach((r) => {
235
+ if (t.oldPriceAlign && r.setAttribute("align", t.oldPriceAlign), t.oldPriceTdStyle && r.setAttribute("style", t.oldPriceTdStyle), t.oldPriceClasses) {
236
+ const c = `${r.getAttribute("class") || ""} ${t.oldPriceClasses}`.trim();
237
+ r.setAttribute("class", c);
238
+ }
239
+ const i = r.querySelector("p");
240
+ i && t.oldPriceStyle && i.setAttribute("style", t.oldPriceStyle);
241
+ }), (t.buttonBorderStyle || t.buttonLinkStyle || t.buttonAlign || t.buttonTdStyle || t.buttonClasses) && s.querySelectorAll(".product-button").forEach((r) => {
242
+ if (t.buttonAlign && r.setAttribute("align", t.buttonAlign), t.buttonTdStyle && r.setAttribute("style", t.buttonTdStyle), t.buttonClasses) {
243
+ const n = `${r.getAttribute("class") || ""} ${t.buttonClasses}`.trim();
244
+ r.setAttribute("class", n);
245
+ }
246
+ const i = r.querySelector(".es-button-border");
247
+ i && t.buttonBorderStyle && i.setAttribute("style", t.buttonBorderStyle);
248
+ const u = r.querySelector("a.es-button");
249
+ u && (t.buttonLinkStyle && u.setAttribute("style", t.buttonLinkStyle), t.buttonText && (u.textContent = t.buttonText));
250
+ });
251
+ const o = s.querySelector("table");
252
+ return (o == null ? void 0 : o.innerHTML) || e;
161
253
  }
162
254
  /**
163
255
  * Builds title block with proper structure
@@ -165,9 +257,9 @@ class w {
165
257
  buildTitleBlock(e) {
166
258
  let t = e.text;
167
259
  e.isBold && e.isItalic ? t = `<strong path="1,0"><em path="1,0,0">${t}</em></strong>` : e.isBold ? t = `<strong path="1,0">${t}</strong>` : e.isItalic && (t = `<em path="1,0">${t}</em>`);
168
- const r = e.align ? ` align="${e.align}"` : "", o = e.styles ? ` style="${e.styles}"` : "";
260
+ const s = e.align ? ` align="${e.align}"` : "", o = e.styles ? ` style="${e.styles}"` : "";
169
261
  return `
170
- <td class="esd-block-text es-p10t es-p10b es-p20l es-p20r"${r}>
262
+ <td class="esd-block-text es-p10t es-p10b es-p20l es-p20r"${s}>
171
263
  <p path="1"${o}>
172
264
  ${t}
173
265
  </p>
@@ -176,28 +268,26 @@ class w {
176
268
  }
177
269
  /**
178
270
  * Removes specified style properties from a style string
179
- * Helper from CheckboxMigrator
180
271
  */
181
272
  removeStyleProperties(e, t) {
182
- return e ? t.reduce((o, n) => {
183
- const s = new RegExp(`${n}\\s*:\\s*[^;]*;?`, "gi");
184
- return o.replace(s, "");
273
+ return e ? t.reduce((o, l) => {
274
+ const r = new RegExp(`${l}\\s*:\\s*[^;]*;?`, "gi");
275
+ return o.replace(r, "");
185
276
  }, e).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
186
277
  }
187
278
  /**
188
279
  * Converts inline display to block display
189
- * Helper from CheckboxMigrator
190
280
  */
191
281
  convertInlineToBlock(e) {
192
282
  if (!e)
193
283
  return "";
194
284
  let t = e.replace(/display\s*:\s*inline/gi, "display: block");
195
- return /display\s*:/i.test(t) || (t = t ? `${t}; display: block` : "display: block"), t.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim();
285
+ return /display\s*:/i.test(t) || (t = t ? `${t}; display: block` : "display: block"), t.replace(/;\s*;/g, ";").replace(/^;|;$/g, "").replace(/"/g, "'").trim();
196
286
  }
197
287
  }
198
- function P(i) {
199
- return new w().migrate(i);
288
+ function k(A) {
289
+ return new w().migrate(A);
200
290
  }
201
291
  export {
202
- P as migrateRecommendation
292
+ k as migrateRecommendation
203
293
  };
@@ -0,0 +1,6 @@
1
+ const t = "tr-TR", T = "default", L = "UTC";
2
+ export {
3
+ T as DEFAULT,
4
+ t as DEFAULT_LOCALE,
5
+ L as DEFAULT_TZ
6
+ };
@@ -1,5 +1,6 @@
1
- const a = {
1
+ const e = {
2
2
  translationsPath: "window.trans.en",
3
+ migrationDate: 1759696858,
3
4
  emailHeader: {
4
5
  senderName: "",
5
6
  subject: ""
@@ -7,18 +8,25 @@ const a = {
7
8
  extensions: {
8
9
  unsubscribe: !0
9
10
  },
11
+ blocks: {
12
+ excludeDefaults: [],
13
+ includeCustoms: []
14
+ },
10
15
  features: {
11
16
  dynamicContent: !0,
12
17
  saveAsTemplate: !0,
13
- versionHistory: !0
18
+ versionHistory: !0,
19
+ testMessage: !0,
20
+ displayConditions: !0
14
21
  },
15
22
  useHeader: !0
16
23
  }, t = {
17
24
  promotional: 1,
18
25
  transactional: 2
19
- }, e = "email", o = "Guido User", n = t.promotional, s = 2, i = {
26
+ }, a = "email", o = "Guido User", s = t.promotional, n = 2, i = {
20
27
  email: 60,
21
- architect: 49
28
+ architect: 49,
29
+ unsubscribePages: 97
22
30
  }, u = [
23
31
  "alfredtesting",
24
32
  "electio",
@@ -52,11 +60,11 @@ const a = {
52
60
  "stripoeditorlivetest"
53
61
  ];
54
62
  export {
55
- a as DefaultGuidoConfig,
56
- n as DefaultMessageType,
57
- e as DefaultProductType,
63
+ e as DefaultGuidoConfig,
64
+ s as DefaultMessageType,
65
+ a as DefaultProductType,
58
66
  o as DefaultUsername,
59
- s as EditorType,
67
+ n as EditorType,
60
68
  i as ProductIds,
61
69
  u as TEST_PARTNER_LIST,
62
70
  t as TemplateTypes
@@ -2,7 +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
- ];
5
+ ], t = "https://academy.useinsider.com/docs/email-drag-drop-editor";
6
6
  export {
7
+ t as ACADEMY_LINK,
7
8
  e as SERVICE_HOVER_SELECTORS
8
9
  };
@@ -1,25 +1,26 @@
1
- import { useTranslations as e } from "../composables/useTranslations.js";
2
- const s = e(), R = {
1
+ import { useTranslations as n } from "../composables/useTranslations.js";
2
+ import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
+ const e = n(), I = {
3
4
  UNSUBSCRIBE_LINK_TYPE: 1,
4
5
  PREFERENCES_LINK_TYPE: 3
5
- }, S = {
6
+ }, r = {
6
7
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
7
8
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
8
9
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
9
10
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
10
- }, N = {
11
- UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
12
- PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
13
- }, _ = {
11
+ }, s = R(), _ = {
12
+ UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
13
+ PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
14
+ }, i = "iid", B = {
14
15
  name: "Global Unsubscribe",
15
16
  sendGridId: "G"
16
- }, I = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
17
+ }, C = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", c = "/email/unsubscribe-pages", E = {
17
18
  GLOBAL_UNSUBSCRIBE: 1,
18
19
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
19
20
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
20
21
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
21
22
  RESUBSCRIBE: 5
22
- }, i = {
23
+ }, t = {
23
24
  [E.GLOBAL_UNSUBSCRIBE]: [
24
25
  E.GLOBAL_UNSUBSCRIBE,
25
26
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -29,26 +30,27 @@ const s = e(), R = {
29
30
  E.SUBSCRIPTION_PREFERENCE_CENTER,
30
31
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
31
32
  ]
32
- }, B = {
33
- [E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
34
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
35
- [E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
36
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
37
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
38
- }, C = {
33
+ }, U = {
34
+ [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
35
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
36
+ [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
37
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
38
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
39
+ }, o = {
39
40
  default: "{{ins-unsubscribe-link}}",
40
41
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
41
42
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
42
43
  };
43
44
  export {
44
- I as ACADEMY_LINK,
45
- _ as DEFAULT_UNSUBSCRIBE_GROUP,
46
- S as LINK_REGEXES,
47
- R as LINK_TYPES,
48
- C as MERGE_TAGS,
45
+ C as ACADEMY_LINK,
46
+ B as DEFAULT_UNSUBSCRIBE_GROUP,
47
+ i as INSIDER_ID,
48
+ r as LINK_REGEXES,
49
+ I as LINK_TYPES,
50
+ o as MERGE_TAGS,
49
51
  E as PAGE_TYPES,
50
- i as TYPE_COLLECTIONS,
51
- B as TYPE_TRANSLATIONS,
52
- r as UNSUBSCRIBE_PAGES_LINK,
53
- N as URLS
52
+ t as TYPE_COLLECTIONS,
53
+ U as TYPE_TRANSLATIONS,
54
+ c as UNSUBSCRIBE_PAGES_LINK,
55
+ _ as URLS
54
56
  };
@@ -3,7 +3,7 @@ import { CheckboxBlock as t } from "./block.js";
3
3
  import { CheckboxControl as e } from "./control.js";
4
4
  import { CheckboxIconsRegistry as r } from "./iconsRegistry.js";
5
5
  import { CheckboxBlockSettings as i } from "./settingsPanel.js";
6
- const k = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
6
+ const d = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
7
7
  export {
8
- k as default
8
+ d as default
9
9
  };
@@ -2,7 +2,7 @@ import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-edito
2
2
  import { CouponBlock as t } from "./block.js";
3
3
  import { CouponIconsRegistry as i } from "./iconsRegistry.js";
4
4
  import { CouponBlockSettings as n } from "./settingsPanel.js";
5
- const m = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
5
+ const p = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
6
6
  export {
7
- m as default
7
+ p as default
8
8
  };
@@ -1,5 +1,5 @@
1
1
  import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { getDefaultTemplate as o } from "./template.js";
2
+ import { getDefaultTemplate as o } from "./templates/blockTemplate.js";
3
3
  const n = "recommendation-block";
4
4
  class m extends e {
5
5
  constructor() {