@useinsider/guido 3.17.0-beta.668ca65 → 3.17.0-beta.6b602e7

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 (73) hide show
  1. package/README.md +5 -5
  2. package/dist/components/Guido.vue.js +7 -7
  3. package/dist/components/Guido.vue2.js +65 -61
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +3 -3
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -52
  6. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  7. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +36 -35
  11. package/dist/composables/useCustomInterfaceAppearance.js +46 -42
  12. package/dist/composables/useLegacyStrategyConversion.js +52 -0
  13. package/dist/composables/useStripo.js +14 -14
  14. package/dist/config/i18n/en/labels.json.js +1 -1
  15. package/dist/config/migrator/index.js +9 -8
  16. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  17. package/dist/config/migrator/recommendation/extractors.js +29 -24
  18. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  19. package/dist/config/migrator/recommendationMigrator.js +30 -25
  20. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  21. package/dist/enums/extensions/recommendationBlock.js +2 -1
  22. package/dist/extensions/Blocks/Recommendation/block.js +12 -11
  23. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  24. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  25. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +24 -22
  26. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  27. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +329 -257
  28. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +211 -145
  29. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +66 -31
  30. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  31. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  32. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  33. package/dist/extensions/Blocks/Recommendation/services/configService.js +34 -16
  34. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  35. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +93 -42
  36. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  37. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  38. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  39. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +58 -0
  40. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  41. package/dist/guido.css +1 -1
  42. package/dist/services/recommendationApi.js +61 -52
  43. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  44. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  45. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  46. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  47. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  48. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -0
  49. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  50. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  51. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  52. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  53. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  54. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  55. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  56. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +38 -8
  57. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +1 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  59. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  60. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  61. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +80 -1
  62. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  63. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  64. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +39 -0
  65. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  66. package/dist/src/services/recommendationApi.d.ts +2 -1
  67. package/dist/src/utils/genericUtil.d.ts +5 -0
  68. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  69. package/dist/static/assets/icons/line-info.svg.js +5 -0
  70. package/dist/static/styles/components/recommendation-strategy.css.js +70 -5
  71. package/dist/static/styles/customEditorStyle.css.js +3 -1
  72. package/dist/utils/genericUtil.js +28 -27
  73. package/package.json +2 -2
package/README.md CHANGED
@@ -634,16 +634,16 @@ toaster fires (useful before the host has wired the catalog).
634
634
 
635
635
  ```bash
636
636
  # Install
637
- bun install
637
+ npm install
638
638
 
639
639
  # Start dev server
640
- bun start
640
+ npm start
641
641
 
642
642
  # Build
643
- bun run build
643
+ npm run build
644
644
 
645
645
  # Lint & type-check
646
- bun run lint
646
+ npm run lint
647
647
  ```
648
648
 
649
649
  ### Environment Variables
@@ -661,7 +661,7 @@ VITE_STRIPO_USER=your_user
661
661
 
662
662
  ```bash
663
663
  # Build the package
664
- bun run build
664
+ npm run build
665
665
 
666
666
  # Create tarball
667
667
  npm pack
@@ -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(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : 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
+ "d1f80922"
16
16
  );
17
- const l = n.exports;
17
+ const f = n.exports;
18
18
  export {
19
- l as default
19
+ f 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 ee, defineAsyncComponent as m, ref as U, computed as u, watch as A, onMounted as te, onUnmounted as oe } from "vue";
2
+ import { useCortexBlueprintBridge as ne } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as re } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as se } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as ae } from "../composables/usePartner.js";
6
+ import { useStripo as ie } from "../composables/useStripo.js";
7
+ import { useTimerClone as ce } 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 de } 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 me from "./organisms/AutoSaveController.vue.js";
13
+ import le from "./organisms/base/Toaster.vue.js";
14
+ import ue from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import pe from "./organisms/header/HeaderWrapper.vue.js";
16
+ import fe from "./organisms/LoadingWrapper.vue.js";
17
+ import ye from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import ge from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as ve } from "../services/stripoApi.js";
20
+ import { useConfigStore as Se } from "../stores/config.js";
21
+ import { useDynamicContentStore as he } 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 be } from "../stores/preview.js";
24
+ import { useTemplateStore as Ee } from "../stores/template.js";
25
+ import { useUnsubscribeStore as we } from "../stores/unsubscribe.js";
26
26
  import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
27
- const Ve = /* @__PURE__ */ Y({
27
+ const Je = /* @__PURE__ */ ee({
28
28
  __name: "Guido",
29
29
  props: {
30
30
  config: null,
@@ -32,22 +32,26 @@ 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 = m(
36
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
37
- ), $ = S(
37
+ ), $ = m(
38
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
39
- ), z = S(
39
+ ), z = m(
40
40
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
41
- ), h = A(), u = A(), p = ve(), b = be(), o = ge();
41
+ ), q = m(
42
+ () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
43
+ ), K = m(
44
+ () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
45
+ ), h = U(), p = U(), f = he(), b = we(), o = Se();
42
46
  a.ready && o.init(a.config);
43
- const c = P(), q = Se(), m = l(() => c.hasChanges), { isTestPartner: K } = re(), E = () => {
47
+ const c = P(), V = be(), l = u(() => c.hasChanges), { isTestPartner: j } = ae(), E = () => {
44
48
  var t;
45
49
  return (t = h.value) == null ? void 0 : t.handleSave(!0);
46
50
  }, w = (t) => {
47
51
  c.loadingStatus = t;
48
52
  };
49
- te(), ne();
50
- const f = () => {
53
+ ne(), se();
54
+ const y = () => {
51
55
  var t, e;
52
56
  return {
53
57
  emailId: o.templateId,
@@ -57,13 +61,13 @@ const Ve = /* @__PURE__ */ Y({
57
61
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
58
62
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
59
63
  };
60
- }, { initPlugin: C, preloadRuntime: D } = se(), { getDefaultTemplate: k } = ye(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ae(), V = l(() => {
64
+ }, { initPlugin: C, preloadRuntime: D } = ie(), { getDefaultTemplate: k } = ve(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ce(), J = u(() => {
61
65
  var t;
62
66
  return !((t = o.ui) != null && t.showHeader);
63
- }), j = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), J = l(
67
+ }), Q = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), X = u(
64
68
  () => !!O().recommendationConfigs.strategyId
65
69
  );
66
- oe({
70
+ re({
67
71
  onBack: () => {
68
72
  console.debug("guido:back"), r("back");
69
73
  },
@@ -71,7 +75,7 @@ const Ve = /* @__PURE__ */ Y({
71
75
  console.debug("guido:save:start"), r("save:start");
72
76
  },
73
77
  onSaveComplete: (t) => {
74
- const e = { ...t, metadata: f() };
78
+ const e = { ...t, metadata: y() };
75
79
  console.debug("guido:save:complete", e), r("save:complete", e);
76
80
  },
77
81
  onTestEmailClick: () => {
@@ -79,61 +83,61 @@ const Ve = /* @__PURE__ */ Y({
79
83
  }
80
84
  });
81
85
  const I = (t) => {
82
- console.debug("dynamic-content:close", t), p.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
86
+ console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
83
87
  }, R = () => {
84
88
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
85
89
  };
86
- U(() => m.value, () => {
87
- r("on-change", m.value);
90
+ A(() => l.value, () => {
91
+ r("on-change", l.value);
88
92
  });
89
- const y = (t) => {
93
+ const g = (t) => {
90
94
  const e = t, { attribute: s, position: d } = e.detail;
91
95
  console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
92
96
  };
93
97
  let i = null;
94
- const g = () => {
98
+ const v = () => {
95
99
  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 () => {
100
+ const t = document.querySelector(de);
101
+ (e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
102
+ }, S = async () => {
99
103
  var t;
100
104
  try {
101
105
  o.initialized || o.init(a.config), c.templateId = o.templateId;
102
106
  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
107
  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");
108
+ const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
105
109
  let n = {
106
- html: s && await _(s, B),
110
+ html: s && await _(s, M),
107
111
  css: d
108
112
  };
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 = {
113
+ n.html || (n = await k(), n.html = await _(n.html, M));
114
+ const Y = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
115
+ F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(Y, W(n.html)));
116
+ const Z = {
113
117
  preselectedDynamicContentList: L,
114
118
  onReady: () => {
115
119
  console.debug("guido:ready"), r("ready");
116
120
  }
117
121
  };
118
- await C(n, f(), X), p.selectedDynamicContentList = L;
122
+ await C(n, y(), Z), f.selectedDynamicContentList = L;
119
123
  } catch (e) {
120
124
  console.error("Failed to initialize Stripo editor:", e);
121
125
  }
122
126
  };
123
- return Z(async () => {
127
+ return te(async () => {
124
128
  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();
129
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), Ee().$reset(), v();
130
+ const t = (e = p.value) == null ? void 0 : e.parentElement;
131
+ if (t && (i = new ResizeObserver(v), i.observe(t)), D(), a.ready)
132
+ await S();
129
133
  else {
130
- const s = U(() => a.ready, (d) => {
131
- d && (s(), v());
134
+ const s = A(() => a.ready, (d) => {
135
+ d && (s(), S());
132
136
  });
133
137
  }
134
- document.addEventListener("dynamic-content:open", y);
135
- }), ee(() => {
136
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", y);
138
+ document.addEventListener("dynamic-content:open", g);
139
+ }), oe(() => {
140
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g);
137
141
  try {
138
142
  window.UIEditor.removeEditor();
139
143
  } catch {
@@ -145,12 +149,12 @@ const Ve = /* @__PURE__ */ Y({
145
149
  insert: I,
146
150
  close: R
147
151
  },
148
- hasChanges: m,
152
+ hasChanges: l,
149
153
  saveSilent: E,
150
154
  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 };
155
+ }), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, RemoveStrategyModal: q, LegacyStrategyUpdatedModal: K, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: V, hasChanges: l, isTestPartner: j, saveSilent: E, setLoading: w, emit: r, buildMetadata: y, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: J, isRrsEnabled: Q, hasAssignedStrategy: X, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: me, Toaster: le, FilterSelectionDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ye, UnsubscribeWrapper: ge };
152
156
  }
153
157
  });
154
158
  export {
155
- Ve as default
159
+ Je as default
156
160
  };
@@ -5,15 +5,15 @@ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
5
  var a = function() {
6
6
  var e = this, s = e._self._c, t = e._self._setupProxy;
7
7
  return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
8
- return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { select: t.onSelect } })], 1)];
9
- }, proxy: !0 }], null, !1, 2542767044) }) : e._e();
8
+ return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading || t.store.legacyConversionLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
9
+ }, proxy: !0 }], null, !1, 239334473) }) : e._e();
10
10
  }, n = [], i = /* @__PURE__ */ o(
11
11
  r,
12
12
  a,
13
13
  n,
14
14
  !1,
15
15
  null,
16
- "d3080c55"
16
+ "4019dc4d"
17
17
  );
18
18
  const y = i.exports;
19
19
  export {
@@ -1,47 +1,73 @@
1
- import { defineComponent as v, defineAsyncComponent as u, ref as f, computed as l, watch as O } from "vue";
1
+ import { defineComponent as h, defineAsyncComponent as T, ref as _, computed as s, watch as B } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as x } from "../../../../composables/useToaster.js";
4
- import { useTranslations as A } from "../../../../composables/useTranslations.js";
5
- import { DOTTED_DATE_LOCALE as E } from "../../../../enums/date.js";
6
- import { URLS as h } from "../../../../enums/extensions/recommendationBlock.js";
3
+ import { useLegacyStrategyConversion as I } from "../../../../composables/useLegacyStrategyConversion.js";
4
+ import { useToaster as N } from "../../../../composables/useToaster.js";
5
+ import { useTranslations as k } from "../../../../composables/useTranslations.js";
6
+ import { DOTTED_DATE_LOCALE as P } from "../../../../enums/date.js";
7
+ import { URLS as U } from "../../../../enums/extensions/recommendationBlock.js";
7
8
  import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
8
- import { useRecommendationExtensionStore as C } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import b from "./StrategyInfoBoxContent.vue.js";
10
- import { formatShortDate as B } from "../../../../utils/dateUtil.js";
11
- import { escapeHtml as I } from "../../../../utils/htmlEscape.js";
12
- import { InSkeleton as N } from "@useinsider/design-system-vue";
13
- const V = /* @__PURE__ */ v({
9
+ import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
10
+ import G from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as M } from "../../../../utils/dateUtil.js";
12
+ import { asText as D } from "../../../../utils/genericUtil.js";
13
+ import { escapeHtml as x } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as R } from "@useinsider/design-system-vue";
15
+ const st = /* @__PURE__ */ h({
14
16
  __name: "AssignStrategyDrawer",
15
- setup(k) {
16
- const c = () => import("@useinsider/design-system-organisms"), g = (t, r) => ({
17
- render: (s) => s(N, { props: { sizing: { width: t, height: r } } })
18
- }), S = u({
19
- loader: async () => (await c()).OrgStrategyDetailModal,
17
+ setup(H) {
18
+ const l = () => import("@useinsider/design-system-organisms"), g = (t, a) => ({
19
+ render: (n) => n(R, { props: { sizing: { width: t, height: a } } })
20
+ }), O = T({
21
+ loader: async () => (await l()).OrgStrategyDetailModal,
20
22
  loadingComponent: g(480, 240),
21
23
  delay: 0
22
- }), T = u({
23
- loader: async () => (await c()).OrgStrategyDropdown,
24
+ }), w = T({
25
+ loader: async () => (await l()).OrgStrategyDropdown,
24
26
  loadingComponent: g(240, 42),
25
27
  delay: 0
26
- }), o = A(), e = C(), { showToaster: a } = x(), n = f(null), i = f(!1), m = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", _ = l(() => e.assignStrategyDrawerStatus ? o("email-editor.assign-strategy-description", { url: h.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
- O(() => e.assignStrategyDrawerStatus, (t) => {
28
+ }), r = k(), e = b(), { showToaster: i } = N(), { convertLegacyStrategy: u } = I(), o = _(null), y = "legacy", d = "guido__btn-update-legacy-strategy", c = _(!1), A = s(() => e.assignStrategyDrawerStatus ? r("email-editor.assign-strategy-description", { url: U.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
29
+ B(() => e.assignStrategyDrawerStatus, (t) => {
28
30
  if (!t)
29
31
  return;
30
- const { strategyId: r } = e.recommendationConfigs;
31
- n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
32
- a({
32
+ const { strategyId: a } = e.recommendationConfigs;
33
+ o.value = a || (e.isLegacyStrategyBlock ? y : null), c.value = !1, e.fetchStrategies().catch(() => {
34
+ i({
33
35
  type: p.Error,
34
- message: o("discovery-strategy.error-description")
36
+ message: r("discovery-strategy.error-description")
35
37
  });
36
38
  });
37
39
  });
38
- const d = (t) => {
39
- const r = m(t.updated_at || t.created_at);
40
- if (!r)
40
+ const f = (t) => {
41
+ const a = D(t.updated_at || t.created_at);
42
+ if (!a)
41
43
  return "";
42
- const s = B(r, E);
43
- return o("recommendation-strategy.last-updated-on", { value: s });
44
- }, D = l(() => e.strategies.map((t) => ({
44
+ const n = M(a, P);
45
+ return r("recommendation-strategy.last-updated-on", { value: n });
46
+ }, S = s(() => ({
47
+ text: r("ds-steps.legacy-strategy"),
48
+ value: y,
49
+ infoBoxProps: {
50
+ id: "strategy-info-legacy",
51
+ theme: "light",
52
+ variant: "information",
53
+ className: "assign-strategy-info-box",
54
+ titleText: x(r("ds-steps.legacy-strategy")),
55
+ descriptionStatus: !0,
56
+ descriptionText: r("statistics.legacy-strategy-description"),
57
+ buttonOptions: [{
58
+ id: d,
59
+ type: "primary",
60
+ text: r("ds-steps.update"),
61
+ loadingStatus: e.legacyConversionLoading,
62
+ disabledStatus: e.legacyConversionLoading
63
+ }]
64
+ }
65
+ })), E = async (t) => {
66
+ if ((t == null ? void 0 : t.id) !== d)
67
+ return;
68
+ const a = await u();
69
+ a && (o.value = a);
70
+ }, m = s(() => e.strategies.map((t) => ({
45
71
  text: t.name,
46
72
  value: t.strategy_id,
47
73
  infoBoxProps: {
@@ -49,57 +75,57 @@ const V = /* @__PURE__ */ v({
49
75
  theme: "light",
50
76
  variant: "information",
51
77
  className: "assign-strategy-info-box",
52
- titleText: I(m(t.name)),
78
+ titleText: x(D(t.name)),
53
79
  descriptionStatus: !0,
54
- descriptionText: d(t),
55
- slot: b,
80
+ descriptionText: f(t),
81
+ slot: G,
56
82
  slotProps: { strategy: t }
57
83
  }
58
- }))), y = l(() => {
59
- const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
84
+ }))), C = s(() => e.isLegacyStrategyBlock ? [S.value, ...m.value] : m.value), v = s(() => {
85
+ const t = e.strategies.find((a) => String(a.strategy_id) === String(o.value ?? ""));
60
86
  return t ? { ...t, fallback_config: null } : null;
61
- }), w = l(() => ({
87
+ }), L = s(() => ({
62
88
  primaryButton: {
63
89
  styling: "solid",
64
90
  type: "primary",
65
- labelText: o("products.assign-btn")
91
+ labelText: r("products.assign-btn")
66
92
  },
67
93
  cancelOrBackButton: {
68
94
  styling: "ghost",
69
95
  type: "secondary",
70
- labelText: o("products.cancel")
96
+ labelText: r("products.cancel")
71
97
  }
72
98
  }));
73
- return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: S, OrgStrategyDropdown: T, trans: o, store: e, showToaster: a, selectedStrategyId: n, showSelectionError: i, asText: m, drawerDescription: _, lastUpdatedText: d, strategyOptions: D, selectedStrategy: y, footerButtonGroupOptions: w, closeDrawer: () => {
99
+ return { __sfc: !0, loadOrganisms: l, skeleton: g, OrgStrategyDetailModal: O, OrgStrategyDropdown: w, trans: r, store: e, showToaster: i, convertLegacyStrategy: u, selectedStrategyId: o, LEGACY_OPTION_VALUE: y, LEGACY_UPDATE_BUTTON_ID: d, showSelectionError: c, drawerDescription: A, lastUpdatedText: f, legacyStrategyOption: S, onInfoBoxButtonClick: E, remoteStrategyOptions: m, strategyOptions: C, selectedStrategy: v, footerButtonGroupOptions: L, closeDrawer: () => {
74
100
  e.closeAssignStrategyDrawer();
75
101
  }, assignStrategy: async () => {
76
- const t = y.value;
102
+ const t = v.value;
77
103
  if (!t) {
78
- i.value = !0;
104
+ c.value = !0;
79
105
  return;
80
106
  }
81
- let r = "";
107
+ let a = "";
82
108
  try {
83
- r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
84
- } catch (s) {
85
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", s);
109
+ a = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
110
+ } catch (n) {
111
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", n);
86
112
  }
87
- if (!r) {
88
- a({
113
+ if (!a) {
114
+ i({
89
115
  type: p.Error,
90
- message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
116
+ message: r("email-editor.strategy-assign-failed", { strategyName: t.name })
91
117
  });
92
118
  return;
93
119
  }
94
- e.assignStrategy(t), a({
120
+ e.assignStrategy(t), i({
95
121
  type: p.Success,
96
- message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
122
+ message: r("email-editor.strategy-assigned-success", { strategyName: t.name })
97
123
  }), e.closeAssignStrategyDrawer();
98
124
  }, onSelect: (t) => {
99
- n.value = t.value, i.value = !1;
125
+ o.value = t.value, c.value = !1;
100
126
  } };
101
127
  }
102
128
  });
103
129
  export {
104
- V as default
130
+ st as default
105
131
  };
@@ -0,0 +1,18 @@
1
+ import s from "./LegacyStrategyUpdatedModal.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, a = t._self._c, e = t._self._setupProxy;
6
+ return e.store.legacyStrategyUpdatedModalStatus ? a("div", { staticClass: "legacy-strategy-updated-modal" }, [a(e.WpModal, { attrs: { id: "guido__legacy-strategy-updated-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("ds-steps.recommendation-strategy-migration-modal-title") }, on: { close: e.close, "primary-action": e.close } }, [a("p", [t._v(t._s(e.messageParts[0])), a("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])])], 1) : t._e();
7
+ }, l = [], n = /* @__PURE__ */ o(
8
+ s,
9
+ r,
10
+ l,
11
+ !1,
12
+ null,
13
+ "da2225a1"
14
+ );
15
+ const m = n.exports;
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as i, computed as s } from "vue";
2
+ import p from "../../../wrappers/WpModal.vue.js";
3
+ import { useTranslations as d } from "../../../../composables/useTranslations.js";
4
+ import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ const M = /* @__PURE__ */ i({
6
+ __name: "LegacyStrategyUpdatedModal",
7
+ setup(l) {
8
+ const e = d(), t = g(), n = s(() => ({
9
+ primaryButton: {
10
+ type: "primary",
11
+ labelText: e("action-builder.ok")
12
+ }
13
+ })), m = s(() => {
14
+ var r;
15
+ const { strategyId: a } = t.recommendationConfigs;
16
+ return ((r = t.assignedStrategy) == null ? void 0 : r.name) || `#${a}`;
17
+ }), o = "__STRATEGY_NAME__", c = s(() => e("email-editor.legacy-strategy-updated-message", { strategyName: o }).split(o));
18
+ return { __sfc: !0, trans: e, store: t, footerButtonOptions: n, strategyName: m, NAME_TOKEN: o, messageParts: c, close: () => {
19
+ t.closeLegacyStrategyUpdatedModal();
20
+ }, WpModal: p };
21
+ }
22
+ });
23
+ export {
24
+ M as default
25
+ };
@@ -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
+ };