@useinsider/guido 3.17.0-beta.e23d5cd → 3.17.0-beta.e324492

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 (50) hide show
  1. package/dist/components/Guido.vue.js +7 -7
  2. package/dist/components/Guido.vue2.js +59 -57
  3. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  4. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  5. package/dist/composables/useStripo.js +14 -14
  6. package/dist/config/i18n/en/labels.json.js +1 -1
  7. package/dist/config/migrator/index.js +9 -8
  8. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  9. package/dist/config/migrator/recommendation/extractors.js +29 -24
  10. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  11. package/dist/config/migrator/recommendationMigrator.js +30 -25
  12. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  13. package/dist/extensions/Blocks/Recommendation/block.js +12 -11
  14. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  15. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  16. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +24 -22
  17. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  18. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +329 -257
  19. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +127 -113
  20. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +1 -1
  21. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  22. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  23. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  24. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  25. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +37 -26
  26. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  27. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  28. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  29. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  30. package/dist/guido.css +1 -1
  31. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  32. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  33. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  34. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  35. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  36. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  37. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  38. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  39. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  40. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  41. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +8 -4
  42. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  43. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  44. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +38 -0
  45. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  46. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  47. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  48. package/dist/static/styles/customEditorStyle.css.js +3 -1
  49. package/dist/utils/templatePreparation.js +37 -36
  50. package/package.json +1 -1
@@ -1,20 +1,20 @@
1
- import a from "./Guido.vue2.js";
1
+ import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
- var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : o._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
5
+ var a = this, r = a._self._c, e = a._self._setupProxy;
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
9
  }, s = [], n = /* @__PURE__ */ i(
10
- a,
10
+ o,
11
11
  t,
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "e6f99d29"
15
+ "5c588dc5"
16
16
  );
17
- const l = n.exports;
17
+ const v = n.exports;
18
18
  export {
19
- l as default
19
+ v as default
20
20
  };
@@ -1,30 +1,30 @@
1
- import { defineComponent as Y, defineAsyncComponent as S, ref as A, computed as l, watch as U, onMounted as Z, onUnmounted as ee } from "vue";
2
- import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as re } from "../composables/usePartner.js";
6
- import { useStripo as se } from "../composables/useStripo.js";
7
- import { useTimerClone as ae } from "../composables/useTimerClone.js";
1
+ import { defineComponent as Z, defineAsyncComponent as l, ref as A, computed as u, watch as U, onMounted as ee, onUnmounted as te } from "vue";
2
+ import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as se } from "../composables/usePartner.js";
6
+ import { useStripo as ae } from "../composables/useStripo.js";
7
+ import { useTimerClone as ie } from "../composables/useTimerClone.js";
8
8
  import { migrate as _ } from "../config/migrator/index.js";
9
9
  import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ie } from "../enums/onboarding.js";
10
+ import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
11
11
  import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import ce from "./organisms/AutoSaveController.vue.js";
13
- import de from "./organisms/base/Toaster.vue.js";
14
- import me from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import le from "./organisms/header/HeaderWrapper.vue.js";
16
- import ue from "./organisms/LoadingWrapper.vue.js";
17
- import pe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import fe from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as ye } from "../services/stripoApi.js";
20
- import { useConfigStore as ge } from "../stores/config.js";
21
- import { useDynamicContentStore as ve } from "../stores/dynamic-content.js";
12
+ import de from "./organisms/AutoSaveController.vue.js";
13
+ import me from "./organisms/base/Toaster.vue.js";
14
+ import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import ue from "./organisms/header/HeaderWrapper.vue.js";
16
+ import pe from "./organisms/LoadingWrapper.vue.js";
17
+ import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as ge } from "../services/stripoApi.js";
20
+ import { useConfigStore as ve } from "../stores/config.js";
21
+ import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
22
22
  import { useEditorStore as P } from "../stores/editor.js";
23
- import { usePreviewStore as Se } from "../stores/preview.js";
24
- import { useTemplateStore as he } from "../stores/template.js";
25
- import { useUnsubscribeStore as be } from "../stores/unsubscribe.js";
23
+ import { usePreviewStore as he } from "../stores/preview.js";
24
+ import { useTemplateStore as be } from "../stores/template.js";
25
+ import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
26
26
  import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
27
- const Ve = /* @__PURE__ */ Y({
27
+ const je = /* @__PURE__ */ Z({
28
28
  __name: "Guido",
29
29
  props: {
30
30
  config: null,
@@ -32,22 +32,24 @@ const Ve = /* @__PURE__ */ Y({
32
32
  },
33
33
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
34
34
  setup(x, { expose: G, emit: r }) {
35
- const a = x, H = S(
35
+ const a = x, H = l(
36
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
37
- ), $ = S(
37
+ ), $ = l(
38
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
39
- ), z = S(
39
+ ), z = l(
40
40
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
41
- ), h = A(), u = A(), p = ve(), b = be(), o = ge();
41
+ ), q = l(
42
+ () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
43
+ ), h = A(), p = A(), f = Se(), b = Ee(), o = ve();
42
44
  a.ready && o.init(a.config);
43
- const c = P(), q = Se(), m = l(() => c.hasChanges), { isTestPartner: K } = re(), E = () => {
45
+ const c = P(), K = he(), m = u(() => c.hasChanges), { isTestPartner: V } = se(), E = () => {
44
46
  var t;
45
47
  return (t = h.value) == null ? void 0 : t.handleSave(!0);
46
48
  }, w = (t) => {
47
49
  c.loadingStatus = t;
48
50
  };
49
- te(), ne();
50
- const f = () => {
51
+ oe(), re();
52
+ const y = () => {
51
53
  var t, e;
52
54
  return {
53
55
  emailId: o.templateId,
@@ -57,13 +59,13 @@ const Ve = /* @__PURE__ */ Y({
57
59
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
58
60
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
59
61
  };
60
- }, { initPlugin: C, preloadRuntime: D } = se(), { getDefaultTemplate: k } = ye(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ae(), V = l(() => {
62
+ }, { initPlugin: C, preloadRuntime: D } = ae(), { getDefaultTemplate: k } = ge(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ie(), j = u(() => {
61
63
  var t;
62
64
  return !((t = o.ui) != null && t.showHeader);
63
- }), j = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), J = l(
65
+ }), J = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Q = u(
64
66
  () => !!O().recommendationConfigs.strategyId
65
67
  );
66
- oe({
68
+ ne({
67
69
  onBack: () => {
68
70
  console.debug("guido:back"), r("back");
69
71
  },
@@ -71,7 +73,7 @@ const Ve = /* @__PURE__ */ Y({
71
73
  console.debug("guido:save:start"), r("save:start");
72
74
  },
73
75
  onSaveComplete: (t) => {
74
- const e = { ...t, metadata: f() };
76
+ const e = { ...t, metadata: y() };
75
77
  console.debug("guido:save:complete", e), r("save:complete", e);
76
78
  },
77
79
  onTestEmailClick: () => {
@@ -79,61 +81,61 @@ const Ve = /* @__PURE__ */ Y({
79
81
  }
80
82
  });
81
83
  const I = (t) => {
82
- console.debug("dynamic-content:close", t), p.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
84
+ console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
83
85
  }, R = () => {
84
86
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
85
87
  };
86
88
  U(() => m.value, () => {
87
89
  r("on-change", m.value);
88
90
  });
89
- const y = (t) => {
91
+ const g = (t) => {
90
92
  const e = t, { attribute: s, position: d } = e.detail;
91
93
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
92
94
  };
93
95
  let i = null;
94
- const g = () => {
96
+ const v = () => {
95
97
  var e;
96
- const t = document.querySelector(ie);
97
- (e = u.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
98
- }, v = async () => {
98
+ const t = document.querySelector(ce);
99
+ (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
100
+ }, S = async () => {
99
101
  var t;
100
102
  try {
101
103
  o.initialized || o.init(a.config), c.templateId = o.templateId;
102
104
  const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
103
105
  b.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
104
- const B = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, M = o.isFeatureEnabled("linkTrackingIds");
106
+ const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
105
107
  let n = {
106
- html: s && await _(s, B),
108
+ html: s && await _(s, M),
107
109
  css: d
108
110
  };
109
- n.html || (n = await k(), n.html = await _(n.html, B));
110
- const Q = M ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
111
- F(n.html) && (n.html = await T(n.html)), M && (c.trackIdSessionFloor = Math.max(Q, W(n.html)));
112
- const X = {
111
+ n.html || (n = await k(), n.html = await _(n.html, M));
112
+ const X = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
113
+ F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(X, W(n.html)));
114
+ const Y = {
113
115
  preselectedDynamicContentList: L,
114
116
  onReady: () => {
115
117
  console.debug("guido:ready"), r("ready");
116
118
  }
117
119
  };
118
- await C(n, f(), X), p.selectedDynamicContentList = L;
120
+ await C(n, y(), Y), f.selectedDynamicContentList = L;
119
121
  } catch (e) {
120
122
  console.error("Failed to initialize Stripo editor:", e);
121
123
  }
122
124
  };
123
- return Z(async () => {
125
+ return ee(async () => {
124
126
  var e;
125
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), he().$reset(), g();
126
- const t = (e = u.value) == null ? void 0 : e.parentElement;
127
- if (t && (i = new ResizeObserver(g), i.observe(t)), D(), a.ready)
128
- await v();
127
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), be().$reset(), v();
128
+ const t = (e = p.value) == null ? void 0 : e.parentElement;
129
+ if (t && (i = new ResizeObserver(v), i.observe(t)), D(), a.ready)
130
+ await S();
129
131
  else {
130
132
  const s = U(() => a.ready, (d) => {
131
- d && (s(), v());
133
+ d && (s(), S());
132
134
  });
133
135
  }
134
- document.addEventListener("dynamic-content:open", y);
135
- }), ee(() => {
136
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", y);
136
+ document.addEventListener("dynamic-content:open", g);
137
+ }), te(() => {
138
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g);
137
139
  try {
138
140
  window.UIEditor.removeEditor();
139
141
  } catch {
@@ -148,9 +150,9 @@ const Ve = /* @__PURE__ */ Y({
148
150
  hasChanges: m,
149
151
  saveSilent: E,
150
152
  setLoading: w
151
- }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, headerWrapperRef: h, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: q, hasChanges: m, isTestPartner: K, saveSilent: E, setLoading: w, emit: r, buildMetadata: f, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: V, isRrsEnabled: j, hasAssignedStrategy: J, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: y, ribbonObserver: i, updateRibbonOffset: g, startEditor: v, AutoSaveController: ce, Toaster: de, FilterSelectionDrawer: me, HeaderWrapper: le, LoadingWrapper: ue, SaveAsTemplateDrawer: pe, UnsubscribeWrapper: fe };
153
+ }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, RemoveStrategyModal: q, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: K, hasChanges: m, isTestPartner: V, saveSilent: E, setLoading: w, emit: r, buildMetadata: y, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: j, isRrsEnabled: J, hasAssignedStrategy: Q, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: de, Toaster: me, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ye };
152
154
  }
153
155
  });
154
156
  export {
155
- Ve as default
157
+ je as default
156
158
  };
@@ -0,0 +1,17 @@
1
+ import s from "./RemoveStrategyModal.vue2.js";
2
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var t = this, o = t._self._c, e = t._self._setupProxy;
5
+ return e.store.removeStrategyModalStatus ? o(e.WpModal, { attrs: { id: "guido__remove-strategy-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.remove-strategy-confirm-title") }, on: { close: e.close, "primary-action": e.handleConfirm, "secondary-action": e.close } }, [o("p", [t._v(t._s(e.messageParts[0])), o("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])]) : t._e();
6
+ }, n = [], _ = /* @__PURE__ */ r(
7
+ s,
8
+ a,
9
+ n,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = _.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,57 @@
1
+ import { defineComponent as u, computed as n } from "vue";
2
+ import y from "../../../wrappers/WpModal.vue.js";
3
+ import { useToaster as f } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as v } from "../../../../enums/toaster.js";
6
+ import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { commitBlockChangeOutsidePanel as h } from "../../../../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
8
+ import { escapeHtml as R } from "../../../../utils/htmlEscape.js";
9
+ const P = /* @__PURE__ */ u({
10
+ __name: "RemoveStrategyModal",
11
+ setup(S) {
12
+ const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
13
+ cancelOrBackButton: {
14
+ type: "secondary",
15
+ labelText: t("products.cancel"),
16
+ styling: "ghost"
17
+ },
18
+ primaryButton: {
19
+ type: "danger",
20
+ labelText: t("discovery-strategy.remove")
21
+ }
22
+ })), m = n(() => {
23
+ var o;
24
+ const { strategyId: r } = e.recommendationConfigs;
25
+ return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
26
+ }), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
27
+ e.closeRemoveStrategyModal();
28
+ };
29
+ return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
30
+ const r = m.value, o = e.currentRecommendationId;
31
+ e.removeStrategy(), c();
32
+ const { strategyId: l, size: g } = e.recommendationConfigs;
33
+ if (a({
34
+ type: v.Success,
35
+ // The toast renders through a sanitizing v-html, so the name is escaped first.
36
+ message: t("email-editor.strategy-removed-success", {
37
+ strategyName: `<b>${R(r)}</b>`
38
+ })
39
+ }), o !== null) {
40
+ try {
41
+ await e.fetchRecommendationProducts();
42
+ } catch (p) {
43
+ console.error("[RemoveStrategyModal] product refetch failed", p);
44
+ }
45
+ h(
46
+ o,
47
+ { strategyId: l, size: g },
48
+ e.recommendationProducts,
49
+ "Removed recommendation strategy"
50
+ );
51
+ }
52
+ }, WpModal: y };
53
+ }
54
+ });
55
+ export {
56
+ P as default
57
+ };
@@ -17,13 +17,13 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
17
17
  import Z from "../package.json.js";
18
18
  let n = null;
19
19
  const Ce = () => {
20
- const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: M, getCustomFonts: T, getSyncModulesStatus: v } = K(), { handleEvent: B } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
21
- var l;
20
+ const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: v } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
21
+ var d;
22
22
  if (document.getElementById("UiEditorScript")) {
23
23
  i();
24
24
  return;
25
25
  }
26
- const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`, e = document.createElement("script");
26
+ const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
27
27
  e.id = "UiEditorScript", e.type = "module", e.src = r, e.onload = () => i(), e.onerror = () => {
28
28
  e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
29
29
  }, document.body.appendChild(e);
@@ -31,12 +31,12 @@ const Ce = () => {
31
31
  n = null;
32
32
  }), n), _ = async (i, s, o, a = [], r = !1) => {
33
33
  var y, E, h, C;
34
- const e = b(), { html: l, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
34
+ const e = b(), { html: d, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1);
35
35
  await window.UIEditor.initEditor(
36
36
  document.querySelector("#guido-editor"),
37
37
  {
38
38
  metadata: s,
39
- html: l,
39
+ html: d,
40
40
  css: D,
41
41
  forceRecreate: U,
42
42
  locale: "en",
@@ -80,16 +80,16 @@ const Ce = () => {
80
80
  ],
81
81
  async onTokenRefreshRequest(t) {
82
82
  try {
83
- const d = await M();
84
- t(d);
85
- } catch (d) {
86
- p(d, "Failed to refresh token");
83
+ const l = await B();
84
+ t(l);
85
+ } catch (l) {
86
+ p(l, "Failed to refresh token");
87
87
  }
88
88
  },
89
89
  onTemplateLoaded() {
90
90
  try {
91
- const { importCss: t } = H(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
92
- t(), d(), x(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
91
+ const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
92
+ t(), l(), x(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
93
93
  e.hasChanges = !1;
94
94
  }, 1e3);
95
95
  } catch (t) {
@@ -108,7 +108,7 @@ const Ce = () => {
108
108
  onDataChanged() {
109
109
  e.hasChanges = !0;
110
110
  },
111
- onEvent: B,
111
+ onEvent: v,
112
112
  onModuleAdd: F,
113
113
  notifications: V(),
114
114
  ignoreClickOutsideSelectors: [
@@ -126,8 +126,8 @@ const Ce = () => {
126
126
  try {
127
127
  await f();
128
128
  const [r, e] = await Promise.all([
129
- T(),
130
- v()
129
+ M(),
130
+ T()
131
131
  ]);
132
132
  a.syncModulesEnabled = e, await _(i, s, o, r, e);
133
133
  } catch {
@@ -1,7 +1,7 @@
1
1
  const e = "Items", o = "Default", t = "Custom", s = {
2
2
  "Global Styles & Layout": "Global Styles and Layout",
3
3
  "Structures & Modules": "Structures and Modules",
4
- "Recommendation Block": "Recommendation",
4
+ "Recommendation Block": "Recommendation Block",
5
5
  Items: e,
6
6
  "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.",
7
7
  "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.",
@@ -2,14 +2,15 @@ import { migrateCheckbox as t } from "./checkboxMigrator.js";
2
2
  import { migrateCouponBlock as i } from "./couponBlockMigrator.js";
3
3
  import { migrateItemsBlock as e } from "./itemsBlockMigrator.js";
4
4
  import { migrateProductNameLink as a } from "./productNameLinkMigrator.js";
5
- import { migrateRadioButton as c } from "./radioButtonMigrator.js";
6
- import { migrateRecommendation as g } from "./recommendationMigrator.js";
7
- import { migrateSocialIcons as n } from "./socialIconMigrator.js";
8
- import { migrateUnsubscribe as p } from "./unsubscribeMigrator.js";
9
- const x = async (r, o = {}) => {
10
- let m = r;
11
- return m = t(m), m = c(m), m = await p(m), m = i(m), m = g(m, o), m = e(m), m = a(m), m = n(m), m;
5
+ import { migrateRadioButton as n } from "./radioButtonMigrator.js";
6
+ import { migrateRecommendation as c } from "./recommendationMigrator.js";
7
+ import { migrateRecommendationTitle as g } from "./recommendationTitleMigrator.js";
8
+ import { migrateSocialIcons as p } from "./socialIconMigrator.js";
9
+ import { migrateUnsubscribe as f } from "./unsubscribeMigrator.js";
10
+ const C = async (o, r = {}) => {
11
+ let m = o;
12
+ return m = t(m), m = n(m), m = await f(m), m = i(m), m = c(m, r), m = g(m), m = e(m), m = a(m), m = p(m), m;
12
13
  };
13
14
  export {
14
- x as migrate
15
+ C as migrate
15
16
  };
@@ -1,34 +1,34 @@
1
1
  import { DEFAULT_COMPOSITION as p, DEFAULT_VISIBILITY as I } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
2
- import { ATTR_CUSTOM_PREFIX as l, ATTR_PRODUCT_BUTTON as k, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_OMNIBUS_PRICE as x, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as R, ATTR_PRODUCT_NAME as h, ATTR_PRODUCT_IMAGE as y } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
- import { mapTextTheme as E, mapButtonTheme as O, mapImageTheme as b } from "./themeMapper.js";
4
- const C = "__title__", a = "product_attribute.";
5
- function N(r) {
2
+ import { ATTR_RECOMMENDATION_TITLE as l, ATTR_CUSTOM_PREFIX as k, ATTR_PRODUCT_BUTTON as A, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_OMNIBUS_PRICE as x, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as h, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_IMAGE as O } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
+ import { mapTextTheme as b, mapButtonTheme as y, mapImageTheme as N } from "./themeMapper.js";
4
+ const C = "__title__", T = "product_attribute.";
5
+ function P(r) {
6
6
  const t = r.variable ?? "";
7
7
  switch (t) {
8
8
  case "p_recommendation_title":
9
9
  return { key: C, kind: "title" };
10
10
  case "p_image":
11
- return { key: y, kind: "image" };
11
+ return { key: O, kind: "image" };
12
12
  case "p_name":
13
- return { key: h, kind: "text" };
13
+ return { key: E, kind: "text" };
14
14
  case "p_price":
15
- return { key: R, kind: "text" };
15
+ return { key: h, kind: "text" };
16
16
  case "p_original_price":
17
17
  return { key: f, kind: "text" };
18
18
  case "p_omnibus_price":
19
19
  return { key: x, kind: "text" };
20
20
  case "p_omnibus_discount":
21
- return { key: A, kind: "text" };
21
+ return { key: R, kind: "text" };
22
22
  case "p_button":
23
- return { key: k, kind: "button" };
23
+ return { key: A, kind: "button" };
24
24
  default:
25
25
  if (r.variableType === "p_attribute" || t.startsWith("p_attribute_")) {
26
- const o = r.value ?? "", s = o.startsWith(a) ? o.slice(a.length) : o;
26
+ const o = r.value ?? "", s = o.startsWith(T) ? o.slice(T.length) : o;
27
27
  if (!s)
28
28
  return null;
29
- const e = o || `${a}${s}`;
29
+ const e = o || `${T}${s}`;
30
30
  return {
31
- key: `${l}${e}`,
31
+ key: `${k}${e}`,
32
32
  kind: "custom",
33
33
  customAttrName: s,
34
34
  customAttrValue: e
@@ -41,7 +41,7 @@ function _(r) {
41
41
  const t = p.indexOf(r);
42
42
  return t === -1 ? Number.POSITIVE_INFINITY : t;
43
43
  }
44
- function S(r) {
44
+ function V(r) {
45
45
  const t = {
46
46
  composition: [],
47
47
  visibility: { ...I },
@@ -54,10 +54,10 @@ function S(r) {
54
54
  return t.composition = [...p], t;
55
55
  const o = [];
56
56
  r.forEach((e, i) => {
57
- const n = N(e);
57
+ const n = P(e);
58
58
  if (n) {
59
59
  if (n.kind === "title") {
60
- t.titleVariable = e;
60
+ t.titleVariable = e, t.visibility[l] = e.hidden !== !0;
61
61
  return;
62
62
  }
63
63
  o.push({
@@ -82,20 +82,20 @@ function S(r) {
82
82
  const { key: i, kind: n, hidden: u, legacy: c, customAttrName: d, customAttrValue: m } = e;
83
83
  switch (t.composition.push(i), t.visibility[i] = !u, n === "custom" && d && m && (t.customAttributes.includes(m) || t.customAttributes.push(m), t.customAttrValues[i] = m), n) {
84
84
  case "image":
85
- s[i] = b(c.theme);
85
+ s[i] = N(c.theme);
86
86
  break;
87
87
  case "button":
88
- s[i] = O(c.theme);
88
+ s[i] = y(c.theme);
89
89
  break;
90
90
  case "text":
91
91
  case "custom": {
92
- const T = E(c.theme);
93
- s[i] = T, T.textTrimming && (t.anyTextTrimming = !0);
92
+ const a = b(c.theme);
93
+ s[i] = a, a.textTrimming && (t.anyTextTrimming = !0);
94
94
  break;
95
95
  }
96
96
  }
97
97
  }), t.perElementStyles = s, t;
98
98
  }
99
99
  export {
100
- S as mapComposition
100
+ V as mapComposition
101
101
  };
@@ -1,49 +1,54 @@
1
1
  import { CURRENCY_ATTR as n, CSS_CLASS_SKIP_COMPILE as c } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
2
2
  const a = "You May Also Like!";
3
- function l(t) {
4
- var o;
5
- const r = t.querySelector(".ext-recommendation-title");
6
- if (!r)
3
+ function A(t) {
4
+ var i;
5
+ const e = t.querySelector(".ext-recommendation-title");
6
+ if (!e)
7
7
  return a;
8
- const e = (o = r.textContent) == null ? void 0 : o.trim();
9
- return e && e.length > 0 ? e : a;
8
+ const r = (i = e.textContent) == null ? void 0 : i.trim();
9
+ return r && r.length > 0 ? r : a;
10
10
  }
11
11
  function m(t) {
12
- const r = [
12
+ const e = t.querySelector(".ext-recommendation-title");
13
+ return e ? !/display\s*:\s*none/i.test(e.getAttribute("style") ?? "") : !1;
14
+ }
15
+ function d(t) {
16
+ const e = [
13
17
  t,
14
18
  ...Array.from(t.querySelectorAll(".product-card, .ext-recommendation-card"))
15
19
  ];
16
- let e = "";
17
- return r.some((o) => {
18
- const i = o.getAttribute("bgcolor");
19
- if (i && i.trim())
20
- return e = i.trim(), !0;
21
- const u = (o.getAttribute("style") ?? "").match(/background-color\s*:\s*([^;]+)/i);
22
- return u && u[1] ? (e = u[1].trim(), !0) : !1;
23
- }), e;
20
+ let r = "";
21
+ return e.some((i) => {
22
+ const o = i.getAttribute("bgcolor");
23
+ if (o && o.trim())
24
+ return r = o.trim(), !0;
25
+ const u = (i.getAttribute("style") ?? "").match(/background-color\s*:\s*([^;]+)/i);
26
+ return u && u[1] ? (r = u[1].trim(), !0) : !1;
27
+ }), r;
24
28
  }
25
29
  function C(t) {
26
- const r = t.getAttribute(n.CURRENCY);
27
- if (!r)
30
+ const e = t.getAttribute(n.CURRENCY);
31
+ if (!e)
28
32
  return;
29
- const e = t.getAttribute(n.SYMBOL);
33
+ const r = t.getAttribute(n.SYMBOL);
30
34
  return {
31
- value: r,
35
+ value: e,
32
36
  // An empty `currency-symbol` is omitted so `mapCurrency` falls back to
33
37
  // the currency code as the symbol.
34
- ...e ? { symbol: e } : {},
38
+ ...r ? { symbol: r } : {},
35
39
  alignment: t.getAttribute(n.ALIGNMENT) ?? "",
36
40
  decimalCount: t.getAttribute(n.DECIMAL_COUNT) ?? "",
37
41
  decimalSeparator: t.getAttribute(n.DECIMAL_SEPARATOR) ?? "",
38
42
  thousandSeparator: t.getAttribute(n.THOUSAND_SEPARATOR) ?? ""
39
43
  };
40
44
  }
41
- function d(t) {
45
+ function g(t) {
42
46
  return t.classList.contains(c);
43
47
  }
44
48
  export {
45
- m as extractCardBgColor,
49
+ d as extractCardBgColor,
46
50
  C as extractCurrencyFromBlock,
47
- l as extractTitleText,
48
- d as isPartnerManagedBlock
51
+ A as extractTitleText,
52
+ m as hasVisibleTitle,
53
+ g as isPartnerManagedBlock
49
54
  };