@useinsider/guido 3.18.2-beta.3e1d9ab → 3.18.2-beta.6cafced

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 (46) hide show
  1. package/dist/components/Guido.vue.js +3 -3
  2. package/dist/components/Guido.vue2.js +30 -30
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +70 -51
  5. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +23 -37
  6. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
  7. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  8. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
  9. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
  10. package/dist/composables/useCustomInterfaceAppearance.js +56 -46
  11. package/dist/composables/useHtmlValidator.js +84 -79
  12. package/dist/composables/useHttp.js +22 -24
  13. package/dist/composables/useRecommendation.js +40 -35
  14. package/dist/composables/useStripo.js +30 -30
  15. package/dist/enums/extensions/recommendationBlock.js +38 -31
  16. package/dist/extensions/Blocks/Recommendation/block.js +43 -39
  17. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  18. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +40 -35
  19. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +84 -52
  20. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  21. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +189 -90
  22. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  23. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  24. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  25. package/dist/guido.css +1 -1
  26. package/dist/services/templateLibraryApi.js +14 -17
  27. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
  28. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  29. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  30. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  31. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  32. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +9 -0
  33. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
  34. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +75 -0
  35. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  36. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  37. package/dist/src/stores/onboarding.d.ts +377 -0
  38. package/dist/src/utils/genericUtil.d.ts +0 -6
  39. package/dist/static/styles/components/recommendation-strategy.css.js +34 -4
  40. package/dist/static/styles/components/skeleton.css.js +23 -0
  41. package/dist/stores/onboarding.js +41 -36
  42. package/dist/utils/genericUtil.js +54 -63
  43. package/dist/utils/templatePreparation.js +59 -60
  44. package/package.json +1 -1
  45. package/dist/src/utils/liquidDynamicContent.d.ts +0 -20
  46. package/dist/utils/liquidDynamicContent.js +0 -15
@@ -12,9 +12,9 @@ var t = function() {
12
12
  s,
13
13
  !1,
14
14
  null,
15
- "050dfa52"
15
+ "cc5ee925"
16
16
  );
17
- const f = n.exports;
17
+ const v = n.exports;
18
18
  export {
19
- f as default
19
+ v as default
20
20
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as ne, defineAsyncComponent as l, ref as O, computed as u, watch as P, onMounted as re, onUnmounted as se } from "vue";
1
+ import { defineComponent as ne, defineAsyncComponent as l, ref as O, computed as u, watch as x, onMounted as re, onUnmounted as se } from "vue";
2
2
  import { useCortexBlueprintBridge as ae } from "../composables/useCortexBlueprintBridge.js";
3
3
  import { useEditorLock as ie } from "../composables/useEditorLock.js";
4
4
  import { provideGuidoActions as ce } from "../composables/useGuidoActions.js";
@@ -6,10 +6,10 @@ import { useGuidoStateBridge as de } from "../composables/useGuidoStateBridge.js
6
6
  import { usePartner as me } from "../composables/usePartner.js";
7
7
  import { useStripo as le } from "../composables/useStripo.js";
8
8
  import { useTimerClone as ue } from "../composables/useTimerClone.js";
9
- import { migrate as x } from "../config/migrator/index.js";
10
- import { ModuleFolderDefaults as W } from "../enums/defaults.js";
9
+ import { migrate as W } from "../config/migrator/index.js";
10
+ import { ModuleFolderDefaults as G } from "../enums/defaults.js";
11
11
  import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
12
- import { useRecommendationExtensionStore as G } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
13
13
  import fe from "./organisms/AutoSaveController.vue.js";
14
14
  import ye from "./organisms/base/Toaster.vue.js";
15
15
  import ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
@@ -41,12 +41,12 @@ const et = /* @__PURE__ */ ne({
41
41
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
42
42
  ), J = l(
43
43
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
44
- ), h = O(), p = O(), f = Ce(), E = Te(), o = we();
44
+ ), E = O(), p = O(), f = Ce(), w = Te(), o = we();
45
45
  a.ready && o.init(a.config);
46
- const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), w = () => {
46
+ const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), C = () => {
47
47
  var t;
48
- return (t = h.value) == null ? void 0 : t.handleSave(!0);
49
- }, C = (t) => {
48
+ return (t = E.value) == null ? void 0 : t.handleSave(!0);
49
+ }, D = (t) => {
50
50
  c.loadingStatus = t;
51
51
  };
52
52
  ae(), de();
@@ -57,16 +57,16 @@ const et = /* @__PURE__ */ ne({
57
57
  userId: o.userId,
58
58
  username: o.username,
59
59
  partnerName: o.partnerName,
60
- savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
61
- defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
60
+ savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
61
+ defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
62
62
  };
63
- }, { initPlugin: D, preloadRuntime: k } = le(), { runExclusive: T, beginMount: F, isCurrentMount: I } = ie();
63
+ }, { initPlugin: k, preloadRuntime: T } = le(), { runExclusive: F, beginMount: R, isCurrentMount: I } = ie();
64
64
  let g = 0;
65
- const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: R, hasTimerBlocks: L } = ue(), Y = u(() => {
65
+ const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: L, hasTimerBlocks: B } = ue(), Y = u(() => {
66
66
  var t;
67
67
  return !((t = o.ui) != null && t.showHeader);
68
68
  }), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
69
- () => !!G().recommendationConfigs.strategyId
69
+ () => !!h().recommendationConfigs.strategyId
70
70
  );
71
71
  ce({
72
72
  onBack: () => {
@@ -83,12 +83,12 @@ const et = /* @__PURE__ */ ne({
83
83
  console.debug("guido:test-email:click"), r("test-email:click");
84
84
  }
85
85
  });
86
- const B = (t) => {
86
+ const A = (t) => {
87
87
  console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
88
- }, A = () => {
88
+ }, P = () => {
89
89
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
90
90
  };
91
- P(() => m.value, () => {
91
+ x(() => m.value, () => {
92
92
  r("on-change", m.value);
93
93
  });
94
94
  const v = (t) => {
@@ -105,40 +105,40 @@ const et = /* @__PURE__ */ ne({
105
105
  try {
106
106
  o.initialized || o.init(a.config), c.templateId = o.templateId;
107
107
  const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", U = (e == null ? void 0 : e.preselectedDynamicContent) || [];
108
- E.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
108
+ w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
109
109
  const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
110
110
  let n = {
111
- html: s && await x(s, _),
111
+ html: s && await W(s, _),
112
112
  css: d
113
113
  };
114
- n.html || (n = await M(), n.html = await x(n.html, _));
114
+ n.html || (n = await M(), n.html = await W(n.html, _));
115
115
  const te = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
116
- L(n.html) && (n.html = await R(n.html)), N && (c.trackIdSessionFloor = Math.max(te, $(n.html)));
116
+ B(n.html) && (n.html = await L(n.html)), N && (c.trackIdSessionFloor = Math.max(te, $(n.html)));
117
117
  const oe = {
118
118
  preselectedDynamicContentList: U,
119
119
  onReady: () => {
120
120
  console.debug("guido:ready"), r("ready");
121
121
  }
122
122
  };
123
- g = F(), await D(n, y(), oe), f.selectedDynamicContentList = U;
123
+ g = R(), await k(n, y(), oe), f.selectedDynamicContentList = U;
124
124
  } catch (e) {
125
125
  console.error("Failed to initialize Stripo editor:", e);
126
126
  }
127
127
  };
128
128
  return re(async () => {
129
129
  var e;
130
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(), ke().$reset(), S();
130
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(), ke().$reset(), S();
131
131
  const t = (e = p.value) == null ? void 0 : e.parentElement;
132
- if (t && (i = new ResizeObserver(S), i.observe(t)), k(), a.ready)
132
+ if (t && (i = new ResizeObserver(S), i.observe(t)), T(), a.ready)
133
133
  await b();
134
134
  else {
135
- const s = P(() => a.ready, (d) => {
135
+ const s = x(() => a.ready, (d) => {
136
136
  d && (s(), b());
137
137
  });
138
138
  }
139
139
  document.addEventListener("dynamic-content:open", v);
140
140
  }), se(() => {
141
- i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), T(async () => {
141
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), h().disposeStrategyPageReturn(), F(async () => {
142
142
  if (I(g))
143
143
  try {
144
144
  window.UIEditor.removeEditor();
@@ -148,13 +148,13 @@ const et = /* @__PURE__ */ ne({
148
148
  }), o.reset();
149
149
  }), q({
150
150
  dynamicContent: {
151
- insert: B,
152
- close: A
151
+ insert: A,
152
+ close: P
153
153
  },
154
154
  hasChanges: m,
155
- saveSilent: w,
156
- setLoading: C
157
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: E, props: a, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: w, setLoading: C, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: k, runExclusive: T, beginMount: F, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: M, cloneTimersOnSave: R, hasTimerBlocks: L, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: B, closeDynamicContent: A, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: be, UnsubscribeWrapper: he };
155
+ saveSilent: C,
156
+ setLoading: D
157
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: T, runExclusive: F, beginMount: R, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: M, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: A, closeDynamicContent: P, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: be, UnsubscribeWrapper: he };
158
158
  }
159
159
  });
160
160
  export {
@@ -1,19 +1,21 @@
1
- import r from "./AssignStrategyDrawer.vue2.js";
1
+ import s from "./AssignStrategyDrawer.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
- var o = function() {
6
- var e = this, s = e._self._c, t = e._self._setupProxy;
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();
10
- }, n = [], i = /* @__PURE__ */ a(
11
- r,
12
- o,
4
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
5
+ var a = function() {
6
+ var e = this, r = e._self._c, t = e._self._setupProxy;
7
+ return t.store.assignStrategyDrawerStatus ? r(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 [r("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [r(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "create-button-visible": "", "info-box-position": "bottom right", 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: { create: function(l) {
9
+ return t.store.openStrategyCreation();
10
+ }, infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
11
+ }, proxy: !0 }], null, !1, 1517791821) }) : e._e();
12
+ }, n = [], i = /* @__PURE__ */ o(
13
+ s,
14
+ a,
13
15
  n,
14
16
  !1,
15
17
  null,
16
- "2580a7d9"
18
+ "521cf6b3"
17
19
  );
18
20
  const y = i.exports;
19
21
  export {
@@ -1,48 +1,47 @@
1
- import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
1
+ import { defineComponent as A, defineAsyncComponent as S, ref as T, computed as g, watch as h } 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";
7
- import { ToasterTypeOptions as m } 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 I } from "../../../../utils/dateUtil.js";
11
- import { asText as f } from "../../../../utils/genericUtil.js";
12
- import { escapeHtml as N } from "../../../../utils/htmlEscape.js";
13
- import { InSkeleton as b } from "@useinsider/design-system-vue";
14
- const W = /* @__PURE__ */ v({
3
+ import { useToaster as C } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as b } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as B } from "../../../../enums/date.js";
6
+ import { URLS as k } from "../../../../enums/extensions/recommendationBlock.js";
7
+ import { ToasterTypeOptions as d } from "../../../../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as R } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { commitStrategyChange as _ } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
10
+ import N from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as P } from "../../../../utils/dateUtil.js";
12
+ import { asText as v } from "../../../../utils/genericUtil.js";
13
+ import { escapeHtml as U } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as L } from "@useinsider/design-system-vue";
15
+ const rt = /* @__PURE__ */ A({
15
16
  __name: "AssignStrategyDrawer",
16
- setup(k) {
17
- const c = () => import("@useinsider/design-system-organisms"), g = (t, r) => ({
18
- render: (a) => a(b, { props: { sizing: { width: t, height: r } } })
19
- }), S = y({
20
- loader: async () => (await c()).OrgStrategyDetailModal,
21
- loadingComponent: g(480, 240),
17
+ setup(M) {
18
+ const m = () => import("@useinsider/design-system-organisms"), u = (t, r) => ({
19
+ render: (a) => a(L, { props: { sizing: { width: t, height: r } } })
20
+ }), w = S({
21
+ loader: async () => (await m()).OrgStrategyDetailModal,
22
+ loadingComponent: u(480, 240),
22
23
  delay: 0
23
- }), T = y({
24
- loader: async () => (await c()).OrgStrategyDropdown,
25
- loadingComponent: g(240, 42),
26
- delay: 0
27
- }), o = A(), e = C(), { showToaster: s } = x(), n = u(null), i = u(!1), _ = l(() => e.assignStrategyDrawerStatus ? o("email-editor.assign-strategy-description", { url: h.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
28
- O(() => e.assignStrategyDrawerStatus, (t) => {
24
+ }), D = S({
25
+ loader: async () => (await m()).OrgStrategyDropdown
26
+ }), n = "guido-edit-strategy-", o = b(), e = R(), { showToaster: i } = C(), s = T(null), c = T(!1), I = g(() => e.assignStrategyDrawerStatus ? o("email-editor.assign-strategy-description", { url: k.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
+ h(() => e.assignStrategyDrawerStatus, (t) => {
29
28
  if (!t)
30
29
  return;
31
30
  const { strategyId: r } = e.recommendationConfigs;
32
- n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
33
- s({
34
- type: m.Error,
31
+ s.value = r || null, c.value = !1, e.fetchStrategies().catch(() => {
32
+ i({
33
+ type: d.Error,
35
34
  message: o("discovery-strategy.error-description")
36
35
  });
37
36
  });
38
37
  });
39
- const p = (t) => {
40
- const r = f(t.updated_at || t.created_at);
38
+ const y = (t) => {
39
+ const r = v(t.updated_at || t.created_at);
41
40
  if (!r)
42
41
  return "";
43
- const a = I(r, E);
42
+ const a = P(r, B);
44
43
  return o("recommendation-strategy.last-updated-on", { value: a });
45
- }, D = l(() => e.strategies.map((t) => ({
44
+ }, x = g(() => e.strategies.map((t) => ({
46
45
  text: t.name,
47
46
  value: t.strategy_id,
48
47
  infoBoxProps: {
@@ -50,16 +49,35 @@ const W = /* @__PURE__ */ v({
50
49
  theme: "light",
51
50
  variant: "information",
52
51
  className: "assign-strategy-info-box",
53
- titleText: N(f(t.name)),
52
+ titleText: U(v(t.name)),
54
53
  descriptionStatus: !0,
55
- descriptionText: p(t),
56
- slot: B,
57
- slotProps: { strategy: t }
54
+ descriptionText: y(t),
55
+ slot: N,
56
+ slotProps: { strategy: t },
57
+ // The info box drops the option's value/text, so the id is the only channel
58
+ // that can carry the strategy back to the click handler.
59
+ buttonOptions: [{
60
+ id: `${n}${t.strategy_id}`,
61
+ text: o("eureka.edit-strategy"),
62
+ type: "text",
63
+ // Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
64
+ // silently render blank space instead of failing.
65
+ icon: "line-open-website"
66
+ }]
58
67
  }
59
- }))), d = l(() => {
60
- const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
68
+ }))), E = (t) => {
69
+ var f;
70
+ const r = (f = t == null ? void 0 : t.id) != null && f.startsWith(n) ? t.id.slice(n.length) : "";
71
+ if (!r)
72
+ return;
73
+ const a = e.currentRecommendationId;
74
+ String(s.value ?? "") === r && (s.value = null);
75
+ const l = e.recommendationConfigs.strategyId === r;
76
+ l && e.removeStrategy(), e.openStrategyEdit(r), l && a !== null && _(a, "Removed recommendation strategy");
77
+ }, p = g(() => {
78
+ const t = e.strategies.find((r) => String(r.strategy_id) === String(s.value ?? ""));
61
79
  return t ? { ...t, fallback_config: null } : null;
62
- }), w = l(() => ({
80
+ }), O = g(() => ({
63
81
  primaryButton: {
64
82
  styling: "solid",
65
83
  type: "primary",
@@ -71,36 +89,37 @@ const W = /* @__PURE__ */ v({
71
89
  labelText: o("products.cancel")
72
90
  }
73
91
  }));
74
- return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: S, OrgStrategyDropdown: T, trans: o, store: e, showToaster: s, selectedStrategyId: n, showSelectionError: i, drawerDescription: _, lastUpdatedText: p, strategyOptions: D, selectedStrategy: d, footerButtonGroupOptions: w, closeDrawer: () => {
92
+ return { __sfc: !0, loadOrganisms: m, skeleton: u, OrgStrategyDetailModal: w, OrgStrategyDropdown: D, EDIT_BUTTON_ID_PREFIX: n, trans: o, store: e, showToaster: i, selectedStrategyId: s, showSelectionError: c, drawerDescription: I, lastUpdatedText: y, strategyOptions: x, onInfoBoxButtonClick: E, selectedStrategy: p, footerButtonGroupOptions: O, closeDrawer: () => {
75
93
  e.closeAssignStrategyDrawer();
76
94
  }, assignStrategy: async () => {
77
- const t = d.value;
95
+ const t = p.value;
78
96
  if (!t) {
79
- i.value = !0;
97
+ c.value = !0;
80
98
  return;
81
99
  }
82
100
  let r = "";
83
101
  try {
84
102
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
85
- } catch (a) {
86
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
103
+ } catch (l) {
104
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", l);
87
105
  }
88
106
  if (!r) {
89
- s({
90
- type: m.Error,
107
+ i({
108
+ type: d.Error,
91
109
  message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
92
110
  });
93
111
  return;
94
112
  }
95
- e.assignStrategy(t), s({
96
- type: m.Success,
113
+ const a = e.currentRecommendationId;
114
+ e.assignStrategy(t), i({
115
+ type: d.Success,
97
116
  message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
98
- }), e.closeAssignStrategyDrawer();
117
+ }), e.closeAssignStrategyDrawer(), a !== null && await _(a, "Assigned recommendation strategy");
99
118
  }, onSelect: (t) => {
100
- n.value = t.value, i.value = !1;
119
+ s.value = t.value, c.value = !1;
101
120
  } };
102
121
  }
103
122
  });
104
123
  export {
105
- W as default
124
+ rt as default
106
125
  };
@@ -1,15 +1,15 @@
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({
1
+ import { defineComponent as d, computed as a } from "vue";
2
+ import g from "../../../wrappers/WpModal.vue.js";
3
+ import { useToaster as l } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as y } from "../../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
6
+ import { useRecommendationExtensionStore as f } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { commitStrategyChange as _ } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
8
+ import { escapeHtml as T } from "../../../../utils/htmlEscape.js";
9
+ const B = /* @__PURE__ */ d({
10
10
  __name: "RemoveStrategyModal",
11
- setup(S) {
12
- const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
11
+ setup(v) {
12
+ const t = y(), e = f(), { showToaster: n } = l(), i = a(() => ({
13
13
  cancelOrBackButton: {
14
14
  type: "secondary",
15
15
  labelText: t("products.cancel"),
@@ -19,39 +19,25 @@ const P = /* @__PURE__ */ u({
19
19
  type: "danger",
20
20
  labelText: t("discovery-strategy.remove")
21
21
  }
22
- })), m = n(() => {
22
+ })), m = a(() => {
23
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 = () => {
24
+ const { strategyId: s } = e.recommendationConfigs;
25
+ return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${s}`;
26
+ }), r = "__STRATEGY_NAME__", p = a(() => t("email-editor.remove-strategy-confirm-message", { strategyName: r }).split(r)), c = () => {
27
27
  e.closeRemoveStrategyModal();
28
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,
29
+ return { __sfc: !0, trans: t, store: e, showToaster: n, footerButtonOptions: i, strategyName: m, NAME_TOKEN: r, messageParts: p, close: c, handleConfirm: async () => {
30
+ const s = m.value, o = e.currentRecommendationId;
31
+ e.removeStrategy(), c(), n({
32
+ type: u.Success,
35
33
  // The toast renders through a sanitizing v-html, so the name is escaped first.
36
34
  message: t("email-editor.strategy-removed-success", {
37
- strategyName: `<b>${R(r)}</b>`
35
+ strategyName: `<b>${T(s)}</b>`
38
36
  })
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 };
37
+ }), o !== null && await _(o, "Removed recommendation strategy");
38
+ }, WpModal: g };
53
39
  }
54
40
  });
55
41
  export {
56
- P as default
42
+ B as default
57
43
  };
@@ -1,26 +1,28 @@
1
1
  import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
2
2
  import u from "./AMPOnboarding.vue.js";
3
3
  import v from "./GenericOnboarding.vue.js";
4
- import l from "./ItemsOnboarding.vue.js";
5
- import y from "./NewVersionPopup.vue.js";
6
- import S from "./TextBlockOnboarding.vue.js";
7
- import h from "./VersionHistoryOnboarding.vue.js";
8
- import { usePartner as w } from "../../../composables/usePartner.js";
9
- import { useEditorStore as P } from "../../../stores/editor.js";
10
- import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
11
- import { usePreviewStore as A } from "../../../stores/preview.js";
12
- const G = /* @__PURE__ */ b({
4
+ import y from "./ItemsOnboarding.vue.js";
5
+ import l from "./NewVersionPopup.vue.js";
6
+ import S from "./RecommendationStrategyOnboarding.vue.js";
7
+ import h from "./TextBlockOnboarding.vue.js";
8
+ import w from "./VersionHistoryOnboarding.vue.js";
9
+ import { usePartner as P } from "../../../composables/usePartner.js";
10
+ import { useEditorStore as _ } from "../../../stores/editor.js";
11
+ import { useOnboardingStore as A } from "../../../stores/onboarding.js";
12
+ import { usePreviewStore as H } from "../../../stores/preview.js";
13
+ const N = /* @__PURE__ */ b({
13
14
  __name: "OnboardingWrapper",
14
15
  emits: ["onboarding-finished"],
15
- setup(H, { emit: f }) {
16
- const o = _(), r = P(), s = A(), { isTestPartner: a } = w(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
17
- { type: "newVersionPopup", component: y },
16
+ setup(M, { emit: g }) {
17
+ const o = A(), r = _(), s = H(), { isTestPartner: a } = P(), m = e(() => r.isStripoInitialized), p = e(() => a()), d = [
18
+ { type: "newVersionPopup", component: l },
18
19
  { type: "genericOnboarding", component: v },
19
- { type: "textBlockOnboarding", component: S },
20
- { type: "versionHistoryOnboarding", component: h },
20
+ { type: "textBlockOnboarding", component: h },
21
+ { type: "versionHistoryOnboarding", component: w },
21
22
  { type: "ampOnboarding", component: u },
22
- { type: "itemsOnboarding", component: l }
23
- ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), g = e(() => m.filter((n) => c(n.type)));
23
+ { type: "itemsOnboarding", component: y },
24
+ { type: "recommendationStrategyOnboarding", component: S }
25
+ ], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = e(() => d.filter((n) => c(n.type)));
24
26
  return O(async () => {
25
27
  await o.fetchUserModalState();
26
28
  }), t(
@@ -38,9 +40,9 @@ const G = /* @__PURE__ */ b({
38
40
  (n) => {
39
41
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
40
42
  }
41
- ), { __sfc: !0, emit: f, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: g };
43
+ ), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: f };
42
44
  }
43
45
  });
44
46
  export {
45
- G as default
47
+ N as default
46
48
  };
@@ -0,0 +1,21 @@
1
+ import d from "./RecommendationStrategyOnboarding.vue2.js";
2
+ /* empty css */
3
+ import g from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var m = function() {
5
+ var e, n, r, i, a;
6
+ var t = this, s = t._self._c, o = t._self._setupProxy;
7
+ return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.right, "top-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.top }, on: { close: function(p) {
8
+ return o.onboardingStore.close(o.ONBOARDING_TYPE);
9
+ }, nextButtonClick: o.handleNext } }) : t._e();
10
+ }, c = [], _ = /* @__PURE__ */ g(
11
+ d,
12
+ m,
13
+ c,
14
+ !1,
15
+ null,
16
+ "ec2027ff"
17
+ );
18
+ const S = _.exports;
19
+ export {
20
+ S as default
21
+ };
@@ -0,0 +1,47 @@
1
+ import { defineComponent as g, computed as p, watch as b } from "vue";
2
+ import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as l } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as f } from "../../../enums/academy.js";
5
+ import { useRecommendationExtensionStore as O } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
7
+ import { InOnboard as y } from "@useinsider/design-system-vue";
8
+ const h = /* @__PURE__ */ g({
9
+ __name: "RecommendationStrategyOnboarding",
10
+ setup(C) {
11
+ const n = "recommendationStrategyOnboarding", e = l(), t = _(), i = O(), { getTopPosition: r } = u(), a = `<a href="${f.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${e("action-builder.visit-academy")}</a>`, m = () => [
12
+ {
13
+ classes: "guido-recommendation-strategy-onboarding",
14
+ // Sits in the gap left of the settings panel and points at the strategy section, which
15
+ // starts 208px down: the panel header and its tab row are fixed chrome above it.
16
+ right: "426px",
17
+ top: r(208),
18
+ position: "Right Top",
19
+ title: e("email-editor.onboarding-recommendation-strategy-title"),
20
+ description: e("email-editor.onboarding-recommendation-strategy-description", {
21
+ academyLink: a
22
+ }),
23
+ imageSource: "",
24
+ backButtonClick: () => {
25
+ },
26
+ nextButtonType: "text",
27
+ nextButtonText: e("action-builder.ok"),
28
+ nextButtonClick: () => {
29
+ t.close(n);
30
+ }
31
+ }
32
+ ], c = p(() => i.strategyPanelOpen && t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
33
+ var o, s;
34
+ (s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
35
+ };
36
+ return b(
37
+ () => t.isActive(n),
38
+ (o) => {
39
+ o && t.setConfig(n, m());
40
+ },
41
+ { immediate: !0 }
42
+ ), { __sfc: !0, ONBOARDING_TYPE: n, trans: e, onboardingStore: t, recommendationStore: i, getTopPosition: r, academyLink: a, buildOnboardingCards: m, isVisible: c, handleNext: d, InOnboard: y };
43
+ }
44
+ });
45
+ export {
46
+ h as default
47
+ };