@useinsider/guido 2.0.0-beta.5b1fb5a → 2.0.0-beta.5c09f2c

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 (190) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +55 -39
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +15 -17
  5. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
  6. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +6 -6
  7. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
  8. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +6 -6
  9. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
  10. package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.js +18 -0
  11. package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue2.js +15 -0
  12. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
  13. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +14 -22
  14. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
  15. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -10
  16. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
  17. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
  18. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
  19. package/dist/components/organisms/header/EditorActions.vue.js +21 -0
  20. package/dist/components/organisms/header/EditorActions.vue2.js +41 -0
  21. package/dist/components/organisms/header/EditorToolbar.vue.js +18 -0
  22. package/dist/components/organisms/header/EditorToolbar.vue2.js +17 -0
  23. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -5
  24. package/dist/components/organisms/header/LeftSlot.vue.js +11 -11
  25. package/dist/components/organisms/header/LeftSlot.vue2.js +11 -12
  26. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  27. package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -15
  28. package/dist/components/organisms/header/RightSlot.vue.js +11 -14
  29. package/dist/components/organisms/header/RightSlot.vue2.js +13 -30
  30. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +5 -5
  31. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
  32. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
  33. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
  34. package/dist/composables/useActionsApi.js +33 -30
  35. package/dist/composables/useConfig.js +29 -27
  36. package/dist/composables/useSave.js +13 -11
  37. package/dist/composables/useStripo.js +40 -40
  38. package/dist/config/migrator/recommendationMigrator.js +2 -2
  39. package/dist/enums/academy.js +8 -0
  40. package/dist/enums/onboarding.js +1 -2
  41. package/dist/enums/unsubscribe.js +20 -21
  42. package/dist/extensions/Blocks/Recommendation/block.js +40 -6
  43. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
  44. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
  45. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +64 -0
  46. package/dist/extensions/Blocks/Recommendation/constants/layout.js +20 -0
  47. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +19 -0
  48. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
  49. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +80 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +232 -0
  51. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
  52. package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +96 -0
  53. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +110 -0
  54. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +204 -0
  55. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +54 -0
  56. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +201 -0
  57. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +74 -0
  58. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +118 -0
  59. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +71 -0
  60. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +286 -0
  61. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
  62. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +76 -0
  63. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
  64. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
  65. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +16 -14
  66. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +16 -14
  67. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
  68. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
  69. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
  70. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
  71. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +222 -0
  72. package/dist/extensions/Blocks/Recommendation/extension.js +40 -17
  73. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +19 -3
  74. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +13 -4
  75. package/dist/extensions/Blocks/Recommendation/services/configService.js +239 -0
  76. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -10
  77. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +41 -36
  78. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +233 -0
  79. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
  80. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +69 -0
  81. package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
  82. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +174 -0
  83. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +73 -0
  84. package/dist/extensions/Blocks/Recommendation/templates/utils.js +121 -0
  85. package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +6 -0
  86. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
  87. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +27 -16
  88. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +29 -0
  89. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +46 -0
  90. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  91. package/dist/extensions/Blocks/common-control.js +6 -7
  92. package/dist/extensions/Blocks/controlFactories.js +155 -121
  93. package/dist/guido.css +1 -1
  94. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +223 -169
  95. package/dist/services/recommendationApi.js +10 -9
  96. package/dist/services/stripoApi.js +6 -10
  97. package/dist/src/@types/config/index.d.ts +2 -2
  98. package/dist/src/@types/config/schemas.d.ts +30 -0
  99. package/dist/src/@types/config/types.d.ts +7 -1
  100. package/dist/src/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.d.ts +2 -0
  101. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +4 -0
  102. package/dist/src/components/organisms/header/EditorToolbar.vue.d.ts +2 -0
  103. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  104. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
  105. package/dist/src/composables/useActionsApi.d.ts +1 -0
  106. package/dist/src/composables/useConfig.d.ts +8 -0
  107. package/dist/src/enums/academy.d.ts +12 -0
  108. package/dist/src/enums/onboarding.d.ts +0 -1
  109. package/dist/src/enums/unsubscribe.d.ts +0 -1
  110. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +34 -0
  111. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
  112. package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +0 -24
  113. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +49 -0
  114. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +13 -0
  115. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +35 -0
  116. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +31 -0
  117. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
  118. package/dist/src/extensions/Blocks/Recommendation/controls/{cardBackgroundColorControl.d.ts → cardBackground/index.d.ts} +9 -3
  119. package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +23 -3
  120. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
  121. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +21 -589
  122. package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +37 -0
  123. package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +29 -0
  124. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +45 -0
  125. package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
  126. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +56 -0
  127. package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +24 -0
  128. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +42 -0
  129. package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +23 -0
  130. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +214 -0
  131. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
  132. package/dist/src/extensions/Blocks/Recommendation/controls/{nameTextTrimControl.d.ts → name/textTrim.d.ts} +1 -1
  133. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
  134. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
  135. package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.d.ts → omnibusDiscount/textAfter.d.ts} +1 -1
  136. package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.d.ts → omnibusDiscount/textBefore.d.ts} +1 -1
  137. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
  138. package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.d.ts → omnibusPrice/textAfter.d.ts} +1 -1
  139. package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.d.ts → omnibusPrice/textBefore.d.ts} +1 -1
  140. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
  141. package/dist/src/extensions/Blocks/Recommendation/controls/{spacingControl.d.ts → spacing/index.d.ts} +33 -10
  142. package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
  143. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +151 -0
  144. package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +6 -0
  145. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +17 -16
  146. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +20 -0
  147. package/dist/src/extensions/Blocks/Recommendation/templates/{migrationTemplate.d.ts → grid/migration.d.ts} +11 -4
  148. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +33 -0
  149. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +39 -0
  150. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +8 -0
  151. package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +25 -0
  152. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +18 -0
  153. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +54 -0
  154. package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +7 -0
  155. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +154 -0
  156. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +33 -0
  157. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
  158. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +77 -0
  159. package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
  160. package/dist/src/stores/config.d.ts +164 -1
  161. package/dist/src/stores/editor.d.ts +21 -0
  162. package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
  163. package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
  164. package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
  165. package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
  166. package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
  167. package/dist/static/styles/components/button.css.js +1 -1
  168. package/dist/static/styles/components/wide-panel.css.js +1 -1
  169. package/dist/static/styles/customEditorStyle.css.js +25 -2
  170. package/dist/stores/config.js +7 -0
  171. package/dist/stores/editor.js +1 -0
  172. package/dist/utils/templatePreparation.js +17 -17
  173. package/package.json +1 -1
  174. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  175. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  176. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -187
  177. package/dist/extensions/Blocks/Recommendation/constants.js +0 -13
  178. package/dist/extensions/Blocks/Recommendation/control.js +0 -336
  179. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
  180. package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
  181. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
  182. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
  183. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -181
  184. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
  185. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
  186. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -38
  187. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  188. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
  189. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  190. package/dist/static/assets/phone-mockup.svg.js +0 -4
@@ -1,18 +1,19 @@
1
- import { defineComponent as v, ref as b, computed as m, watch as _ } from "vue";
2
- import B from "../../wrappers/WpDrawer.vue.js";
1
+ import { defineComponent as h, ref as b, computed as g, watch as _ } from "vue";
2
+ import v from "../../wrappers/WpDrawer.vue.js";
3
3
  import { useToaster as U } from "../../../composables/useToaster.js";
4
- import { useTranslations as w } from "../../../composables/useTranslations.js";
5
- import { ToasterTypeOptions as N } from "../../../enums/toaster.js";
6
- import { PAGE_TYPES as l, ACADEMY_LINK as D, getTypeTranslations as P, UNSUBSCRIBE_PAGES_LINK as R } from "../../../enums/unsubscribe.js";
7
- import { useUnsubscribeStore as I } from "../../../stores/unsubscribe.js";
4
+ import { useTranslations as N } from "../../../composables/useTranslations.js";
5
+ import { ACADEMY_LINKS as w } from "../../../enums/academy.js";
6
+ import { ToasterTypeOptions as R } from "../../../enums/toaster.js";
7
+ import { PAGE_TYPES as l, getTypeTranslations as D, UNSUBSCRIBE_PAGES_LINK as I } from "../../../enums/unsubscribe.js";
8
+ import { useUnsubscribeStore as P } from "../../../stores/unsubscribe.js";
8
9
  import { InSegments as G } from "@useinsider/design-system-vue";
9
- const K = /* @__PURE__ */ v({
10
+ const V = /* @__PURE__ */ h({
10
11
  __name: "UnsubscribeTypeSelection",
11
- setup(x) {
12
- const e = w(), { showToaster: f } = U(), t = I(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
12
+ setup(L) {
13
+ const e = N(), { showToaster: f } = U(), t = P(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
13
14
  "unsubscription-preference.select-unsubscribe-page-description",
14
- { action: `<a href="${D}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
15
- ), T = m(() => [
15
+ { action: `<a href="${w.GLOBAL_UNSUBSCRIBE}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
16
+ ), T = g(() => [
16
17
  {
17
18
  description: e("unsubscription-preference.type-global-unsubscribe-description"),
18
19
  icon: "line-contact-global-unsub-page",
@@ -30,7 +31,7 @@ const K = /* @__PURE__ */ v({
30
31
  disable: t.isSubscriptionPreferencesCenterDisabled,
31
32
  tooltipText: t.isSubscriptionPreferencesCenterDisabled ? e("unsubscription-preference.pref-center-added") : ""
32
33
  }
33
- ]), y = m(() => ({
34
+ ]), y = g(() => ({
34
35
  primaryButton: {
35
36
  styling: "solid",
36
37
  type: "primary",
@@ -56,13 +57,13 @@ const K = /* @__PURE__ */ v({
56
57
  }, 500);
57
58
  }, E = (s) => {
58
59
  o.value = s;
59
- }, g = () => {
60
+ }, m = () => {
60
61
  const s = t.hasTemplatesByCollectionType, r = [];
61
62
  if (Object.entries(s).forEach(([c, p]) => {
62
63
  p || r.push(Number(c));
63
64
  }), r.length === 0)
64
65
  return !0;
65
- const h = P(), a = r.map((c) => h[c]);
66
+ const B = D(), a = r.map((c) => B[c]);
66
67
  let u = "";
67
68
  if (r.length === 1)
68
69
  u = e("unsubscription-preference.create-page-to-continue", {
@@ -81,17 +82,17 @@ const K = /* @__PURE__ */ v({
81
82
  });
82
83
  }
83
84
  return f({
84
- type: N.Warning,
85
+ type: R.Warning,
85
86
  message: u,
86
87
  actionButton: {
87
88
  text: "Go to Unsubscribe Pages",
88
89
  onClick: () => {
89
- window.location.href = R;
90
+ window.location.href = I;
90
91
  }
91
92
  }
92
93
  }), !1;
93
94
  }, C = async () => {
94
- if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !g()) {
95
+ if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !m()) {
95
96
  n.value = !1, d();
96
97
  return;
97
98
  }
@@ -99,9 +100,9 @@ const K = /* @__PURE__ */ v({
99
100
  };
100
101
  return _(() => t.typeSelectionDrawerStatus, (s) => {
101
102
  s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
102
- }), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer: B, InSegments: G };
103
+ }), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: m, selectCollection: C, WpDrawer: v, InSegments: G };
103
104
  }
104
105
  });
105
106
  export {
106
- K as default
107
+ V as default
107
108
  };
@@ -1,7 +1,7 @@
1
1
  import { useToaster as w } from "./useToaster.js";
2
- const S = () => {
3
- const { handleError: l } = w(), s = (t = {}) => new Promise((e, i) => {
4
- const n = { ...{
2
+ const v = () => {
3
+ const { handleError: l } = w(), r = (t = {}) => new Promise((e, a) => {
4
+ const o = { ...{
5
5
  minimize: !0,
6
6
  utmEntity: {
7
7
  utmSource: "",
@@ -20,29 +20,29 @@ const S = () => {
20
20
  forceAmp: !1,
21
21
  resetDataSavedFlag: !1,
22
22
  disableLineHeightsReplace: !0
23
- }, ...t }, m = {
24
- callback: (o, p, d, c, u) => {
25
- o ? i(o) : e({
23
+ }, ...t }, s = {
24
+ callback: (n, p, d, c, u) => {
25
+ n ? a(n) : e({
26
26
  html: p,
27
27
  ampHtml: d,
28
28
  ampErrors: c,
29
29
  displayConditions: u
30
30
  });
31
31
  },
32
- ...n
32
+ ...o
33
33
  };
34
- window.StripoEditorApi.actionsApi.compileEmail(m);
34
+ window.StripoEditorApi.actionsApi.compileEmail(s);
35
35
  });
36
36
  return {
37
- getCompiledEmail: s,
37
+ getCompiledEmail: r,
38
38
  getTemplateData: () => new Promise((t) => {
39
- const e = ({ html: i, css: a, width: n, height: r, utmParams: m, syncModulesIds: o }) => t({
40
- html: i,
41
- css: a,
42
- width: n,
43
- height: r,
44
- utmParams: m,
45
- syncModulesIds: o
39
+ const e = ({ html: a, css: i, width: o, height: m, utmParams: s, syncModulesIds: n }) => t({
40
+ html: a,
41
+ css: i,
42
+ width: o,
43
+ height: m,
44
+ utmParams: s,
45
+ syncModulesIds: n
46
46
  });
47
47
  window.StripoEditorApi.actionsApi.getTemplateData(e);
48
48
  }),
@@ -53,15 +53,15 @@ const S = () => {
53
53
  try {
54
54
  const {
55
55
  html: e,
56
- displayConditions: i,
57
- ampHtml: a = "",
58
- ampErrors: n = []
59
- } = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
56
+ displayConditions: a,
57
+ ampHtml: i = "",
58
+ ampErrors: o = []
59
+ } = await r({ minimize: !1, resetDataSavedFlag: !1, ...t });
60
60
  return {
61
61
  html: e,
62
- ampHtml: a,
63
- ampErrors: n,
64
- displayConditions: i
62
+ ampHtml: i,
63
+ ampErrors: o,
64
+ displayConditions: a
65
65
  };
66
66
  } catch (e) {
67
67
  return l(e, "Error loading preview"), {
@@ -73,24 +73,27 @@ const S = () => {
73
73
  }
74
74
  },
75
75
  updateTimerInClonedTemplate: () => new Promise((t) => {
76
- var e, i;
77
- if (typeof ((i = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : i.updateTimerInClonedTemplate) != "function") {
76
+ var e, a;
77
+ if (typeof ((a = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : a.updateTimerInClonedTemplate) != "function") {
78
78
  t(null);
79
79
  return;
80
80
  }
81
81
  try {
82
- window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, n) => {
83
- a ? (l(a, "Failed to update timer in cloned template"), t(null)) : t(n || null);
82
+ window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
83
+ i ? (l(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
84
84
  });
85
- } catch (a) {
86
- l(a, "Failed to call updateTimerInClonedTemplate"), t(null);
85
+ } catch (i) {
86
+ l(i, "Failed to call updateTimerInClonedTemplate"), t(null);
87
87
  }
88
88
  }),
89
89
  updateHtmlAndCss: (t, e) => {
90
90
  window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
91
+ },
92
+ editorSave: () => {
93
+ window.StripoEditorApi.actionsApi.save();
91
94
  }
92
95
  };
93
96
  };
94
97
  export {
95
- S as useActionsApi
98
+ v as useActionsApi
96
99
  };
@@ -1,26 +1,27 @@
1
- import { useConfigStore as F } from "../stores/config.js";
2
- import { storeToRefs as I } from "pinia";
3
- const k = () => {
4
- const e = F(), {
1
+ import { useConfigStore as I } from "../stores/config.js";
2
+ import { storeToRefs as T } from "pinia";
3
+ const w = () => {
4
+ const e = I(), {
5
5
  config: t,
6
6
  initialized: o,
7
7
  identity: r,
8
8
  partner: i,
9
- template: n,
10
- editor: a,
9
+ template: a,
10
+ editor: n,
11
11
  ui: s,
12
- features: u,
13
- blocks: d,
14
- compiler: p,
15
- templateId: c,
12
+ features: c,
13
+ blocks: u,
14
+ compiler: d,
15
+ callbacks: l,
16
+ templateId: p,
16
17
  userId: f,
17
18
  variationId: m,
18
19
  partnerName: g,
19
- productType: l,
20
- messageType: b,
21
- username: C,
22
- showHeader: y
23
- } = I(e);
20
+ productType: b,
21
+ messageType: C,
22
+ username: y,
23
+ showHeader: E
24
+ } = T(e);
24
25
  return {
25
26
  // State refs
26
27
  config: t,
@@ -28,26 +29,27 @@ const k = () => {
28
29
  // Section refs
29
30
  identity: r,
30
31
  partner: i,
31
- template: n,
32
- editor: a,
32
+ template: a,
33
+ editor: n,
33
34
  ui: s,
34
- features: u,
35
- blocks: d,
36
- compiler: p,
35
+ features: c,
36
+ blocks: u,
37
+ compiler: d,
38
+ callbacks: l,
37
39
  // Convenience refs
38
- templateId: c,
40
+ templateId: p,
39
41
  userId: f,
40
42
  variationId: m,
41
43
  partnerName: g,
42
- productType: l,
43
- messageType: b,
44
- username: C,
45
- showHeader: y,
44
+ productType: b,
45
+ messageType: C,
46
+ username: y,
47
+ showHeader: E,
46
48
  // Methods
47
49
  getConfig: () => t.value,
48
- isFeatureEnabled: (E) => e.isFeatureEnabled(E)
50
+ isFeatureEnabled: (F) => e.isFeatureEnabled(F)
49
51
  };
50
52
  };
51
53
  export {
52
- k as useConfig
54
+ w as useConfig
53
55
  };
@@ -1,15 +1,17 @@
1
- import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
2
- import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
3
- import { useHtmlValidator as l } from "./useHtmlValidator.js";
4
- const f = () => {
5
- const e = i(), a = m(), { validateHtml: s } = l();
6
- return { save: async (o = !1) => {
7
- e();
8
- const { prepareTemplateDetails: r } = n(), t = await r();
9
- if (await s(t.compiledHtml, t.dynamicContentList, !0))
10
- return o || a(t), t;
1
+ import { useConfig as l } from "./useConfig.js";
2
+ import { useSaveStart as m, useSaveComplete as c } from "./useGuidoActions.js";
3
+ import { useTemplatePreparation as d } from "../utils/templatePreparation.js";
4
+ import { useHtmlValidator as p } from "./useHtmlValidator.js";
5
+ const w = () => {
6
+ const i = m(), s = c(), { validateHtml: o } = p(), { callbacks: a } = l();
7
+ return { save: async (r = !1) => {
8
+ var e;
9
+ i();
10
+ const { prepareTemplateDetails: n } = d(), t = await n();
11
+ if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
12
+ return r || s(t), t;
11
13
  } };
12
14
  };
13
15
  export {
14
- f as useSave
16
+ w as useSave
15
17
  };
@@ -1,26 +1,26 @@
1
- import { useActionsApi as T } from "./useActionsApi.js";
2
- import { useBlocksConfig as V } from "./useBlocksConfig.js";
3
- import { useConfig as _ } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as B } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as v } from "./useStripoEventHandler.js";
6
- import { useToaster as A } from "./useToaster.js";
7
- import { displayConditions as F } from "../enums/displayConditions.js";
8
- import { useStripoApi as D } from "../services/stripoApi.js";
9
- import I from "../static/styles/customEditorStyle.css.js";
10
- import { useEditorStore as M } from "../stores/editor.js";
11
- import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
12
- import P from "../package.json.js";
13
- const K = (c) => {
14
- const { features: l } = _(), { handleError: u } = A(), { getToken: y, getCustomFonts: S } = D(), { handleEvent: C } = v(), { getStripoBlocksConfig: E } = V(), h = async (i, n = []) => {
15
- var g, f;
16
- const o = M(), { html: r, css: p, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await E(), m = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, b = ((f = l.value) == null ? void 0 : f.modulesDisabled) ?? !1;
1
+ import { useActionsApi as _ } from "./useActionsApi.js";
2
+ import { useBlocksConfig as B } from "./useBlocksConfig.js";
3
+ import { useConfig as v } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as A } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as F } from "./useStripoEventHandler.js";
6
+ import { useToaster as D } from "./useToaster.js";
7
+ import { displayConditions as I } from "../enums/displayConditions.js";
8
+ import { useStripoApi as M } from "../services/stripoApi.js";
9
+ import U from "../static/styles/customEditorStyle.css.js";
10
+ import { useEditorStore as P } from "../stores/editor.js";
11
+ import { dynamicContentToMergeTags as R } from "../utils/genericUtil.js";
12
+ import H from "../package.json.js";
13
+ const W = (c) => {
14
+ const { features: l, template: y } = v(), { handleError: u } = D(), { getToken: C, getCustomFonts: S } = M(), { handleEvent: E } = F(), { getStripoBlocksConfig: h } = B(), w = async (i, n = []) => {
15
+ var m, g, f;
16
+ const o = P(), { html: r, css: p } = i, { baseBlocks: s, extensions: t } = await h(), a = ((m = l.value) == null ? void 0 : m.displayConditions) ?? !0, k = ((g = l.value) == null ? void 0 : g.modulesDisabled) ?? !1, T = ((f = y.value) == null ? void 0 : f.forceRecreate) ?? !1;
17
17
  window.UIEditor.initEditor(
18
18
  document.querySelector("#guido-editor"),
19
19
  {
20
20
  metadata: c,
21
21
  html: r,
22
22
  css: p,
23
- forceRecreate: a,
23
+ forceRecreate: T,
24
24
  locale: "en",
25
25
  undoButtonSelector: "#guido__undo-button",
26
26
  redoButtonSelector: "#guido__redo-button",
@@ -30,19 +30,19 @@ const K = (c) => {
30
30
  customAppearanceMergetags: !0,
31
31
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
32
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
33
- customViewStyles: I,
34
- conditionsEnabled: m,
35
- customConditionsEnabled: m,
36
- conditionCategories: F,
33
+ customViewStyles: U,
34
+ conditionsEnabled: a,
35
+ customConditionsEnabled: a,
36
+ conditionCategories: I,
37
37
  enableXSSSecurity: !0,
38
- modulesDisabled: b,
38
+ modulesDisabled: k,
39
39
  messageSettingsEnabled: !0,
40
40
  displayGmailAnnotations: !0,
41
41
  displayHiddenPreheader: !1,
42
42
  displayTitle: !1,
43
43
  displayUTM: !1,
44
44
  selectElementAfterDrop: !0,
45
- ...t ? { baseBlocks: t } : {},
45
+ ...s ? { baseBlocks: s } : {},
46
46
  editorFonts: {
47
47
  showDefaultStandardFonts: !0,
48
48
  showDefaultNotStandardFonts: !0,
@@ -50,21 +50,21 @@ const K = (c) => {
50
50
  },
51
51
  mergeTags: [
52
52
  {
53
- entries: U(c.preselectedDynamicContentList)
53
+ entries: R(c.preselectedDynamicContentList)
54
54
  }
55
55
  ],
56
56
  async onTokenRefreshRequest(e) {
57
57
  try {
58
- const s = await y();
59
- e(s);
60
- } catch (s) {
61
- u(s, "Failed to refresh token");
58
+ const d = await C();
59
+ e(d);
60
+ } catch (d) {
61
+ u(d, "Failed to refresh token");
62
62
  }
63
63
  },
64
64
  onTemplateLoaded() {
65
65
  try {
66
- const { importCss: e } = B(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: k } = T();
67
- e(), s(), k(), c.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
66
+ const { importCss: e } = A(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: V } = _();
67
+ e(), d(), V(), c.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
68
68
  o.hasChanges = !1;
69
69
  }, 1e3);
70
70
  } catch (e) {
@@ -83,35 +83,35 @@ const K = (c) => {
83
83
  onDataChanged() {
84
84
  o.hasChanges = !0;
85
85
  },
86
- onEvent: C,
86
+ onEvent: E,
87
87
  ignoreClickOutsideSelectors: [
88
88
  "#guido-dynamic-content-modal",
89
89
  ".in-on-board-wrapper",
90
90
  ".in-drawer__container"
91
91
  ],
92
- extensions: d
92
+ extensions: t
93
93
  }
94
94
  );
95
- }, w = (i) => new Promise((n, o) => {
96
- var d;
95
+ }, b = (i) => new Promise((n, o) => {
96
+ var a;
97
97
  if (document.getElementById("UiEditorScript")) {
98
98
  i(), n();
99
99
  return;
100
100
  }
101
- const r = P.guido, a = `https://email-static.useinsider.com/guido/${(d = r == null ? void 0 : r.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
102
- t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
101
+ const r = H.guido, s = `https://email-static.useinsider.com/guido/${(a = r == null ? void 0 : r.stripo) == null ? void 0 : a.version}/UIEditor.js`, t = document.createElement("script");
102
+ t.id = "UiEditorScript", t.type = "module", t.src = s, t.onload = () => {
103
103
  i(), n();
104
104
  }, t.onerror = () => {
105
- o(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
105
+ o(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
106
106
  }, document.body.appendChild(t);
107
107
  });
108
108
  return { initPlugin: async (i) => {
109
- await w(async () => {
109
+ await b(async () => {
110
110
  const n = await S();
111
- await h(i, n);
111
+ await w(i, n);
112
112
  });
113
113
  } };
114
114
  };
115
115
  export {
116
- K as useStripo
116
+ W as useStripo
117
117
  };
@@ -1,8 +1,8 @@
1
1
  var h = Object.defineProperty;
2
2
  var T = (A, e, t) => e in A ? h(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t;
3
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";
4
+ import P, { prepareProductRows as S } from "../../extensions/Blocks/Recommendation/templates/grid/migration.js";
5
+ import { getDefaultProducts as q } from "../../extensions/Blocks/Recommendation/templates/utils.js";
6
6
  class w {
7
7
  constructor() {
8
8
  m(this, "parser");
@@ -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,7 +1,8 @@
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 "./templates/blockTemplate.js";
1
+ import { Block as o, BlockCompositionType as i } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { RecommendationConfigService as t } from "./services/configService.js";
3
+ import { getDefaultTemplate as r } from "./templates/grid/template.js";
3
4
  const n = "recommendation-block";
4
- class m extends e {
5
+ class g extends o {
5
6
  constructor() {
6
7
  super();
7
8
  }
@@ -12,7 +13,7 @@ class m extends e {
12
13
  return "recommendation-icon";
13
14
  }
14
15
  getBlockCompositionType() {
15
- return t.CONTAINER;
16
+ return i.CONTAINER;
16
17
  }
17
18
  getName() {
18
19
  return this.api.translate("Recommendation Block");
@@ -21,10 +22,43 @@ class m extends e {
21
22
  return this.api.translate("Recommendation Block Title Description");
22
23
  }
23
24
  getTemplate() {
24
- return o();
25
+ return r();
26
+ }
27
+ /**
28
+ * Called when a new block is dropped into the template
29
+ *
30
+ * Initializes the block with default configuration stored via node config.
31
+ * This ensures the configuration persists with the template.
32
+ * @param node - The newly created block node
33
+ */
34
+ onCreated(e) {
35
+ t.initializeConfig(this.api, e);
36
+ }
37
+ /**
38
+ * Called when the document changes or template is loaded
39
+ *
40
+ * Handles migration from legacy templates that don't have node config.
41
+ * Also handles config version upgrades for future migrations.
42
+ * @param node - The block node that may need migration
43
+ */
44
+ onDocumentChanged(e) {
45
+ !e || !("getNodeConfig" in e) || t.needsMigration(e) && this._migrateFromLegacy(e);
46
+ }
47
+ /**
48
+ * Migrate configuration from legacy format
49
+ *
50
+ * Legacy templates may store configuration in:
51
+ * - data-attributes (data-layout, data-card-composition, etc.)
52
+ * - Pinia store (lost on reload - this is what we're fixing)
53
+ *
54
+ * This method reads what we can from the DOM and initializes proper node config.
55
+ * @param node - The block node to migrate
56
+ */
57
+ _migrateFromLegacy(e) {
58
+ t.migrateFromDataAttributes(this.api, e);
25
59
  }
26
60
  }
27
61
  export {
28
62
  n as BLOCK_ID,
29
- m as RecommendationBlock
63
+ g as RecommendationBlock
30
64
  };
@@ -0,0 +1,4 @@
1
+ var b = /* @__PURE__ */ ((r) => (r.BUTTON = "recommendation-block-button", r.NAME = "recommendation-block-name", r.PRICE = "recommendation-block-price", r.OLD_PRICE = "recommendation-block-old-price", r.OMNIBUS_PRICE = "recommendation-block-omnibus-price", r.OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount", r.IMAGE = "recommendation-block-image", r))(b || {});
2
+ export {
3
+ b as RecommendationBlockId
4
+ };