@useinsider/guido 3.19.0-beta.2854f4f → 3.19.0-beta.3906ea8

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 (40) hide show
  1. package/README.md +21 -3
  2. package/dist/@types/config/schemas.js +59 -51
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +57 -55
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +3 -3
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +56 -52
  7. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  8. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +18 -18
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -26
  11. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
  12. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
  13. package/dist/composables/useCustomInterfaceAppearance.js +54 -50
  14. package/dist/composables/useLegacyStrategyConversion.js +61 -0
  15. package/dist/enums/extensions/recommendationBlock.js +34 -25
  16. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +73 -72
  17. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +81 -38
  18. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +169 -108
  19. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
  20. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +10 -10
  21. package/dist/guido.css +1 -1
  22. package/dist/services/recommendationApi.js +46 -37
  23. package/dist/src/@types/config/schemas.d.ts +16 -0
  24. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  25. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
  26. package/dist/src/composables/useConfig.d.ts +4 -0
  27. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  28. package/dist/src/enums/extensions/recommendationBlock.d.ts +5 -1
  29. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +1 -0
  30. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +76 -1
  31. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
  32. package/dist/src/services/recommendationApi.d.ts +2 -1
  33. package/dist/src/stores/config.d.ts +322 -0
  34. package/dist/src/stores/onboarding.d.ts +421 -0
  35. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  36. package/dist/static/assets/icons/line-info.svg.js +5 -0
  37. package/dist/static/styles/components/recommendation-strategy.css.js +70 -5
  38. package/dist/stores/config.js +74 -60
  39. package/dist/stores/onboarding.js +6 -1
  40. package/package.json +2 -2
@@ -1,47 +1,51 @@
1
- import { defineComponent as A, defineAsyncComponent as S, ref as T, computed as l, watch as h } from "vue";
1
+ import { defineComponent as B, defineAsyncComponent as T, ref as w, computed as n, watch as k } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
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({
3
+ import { useToaster as b } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as L } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as N } from "../../../../enums/date.js";
6
+ import { URLS as R } from "../../../../enums/extensions/recommendationBlock.js";
7
+ import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as P } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { commitStrategyChange as D } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
10
+ import U from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as M } from "../../../../utils/dateUtil.js";
12
+ import { asText as O } from "../../../../utils/genericUtil.js";
13
+ import { escapeHtml as G } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as $ } from "@useinsider/design-system-vue";
15
+ const st = /* @__PURE__ */ B({
16
16
  __name: "AssignStrategyDrawer",
17
- setup(M) {
18
- const g = () => import("@useinsider/design-system-organisms"), u = (t, r) => ({
19
- render: (o) => o(L, { props: { sizing: { width: t, height: r } } })
20
- }), w = S({
17
+ setup(H) {
18
+ const g = () => import("@useinsider/design-system-organisms"), p = (t, r) => ({
19
+ render: (o) => o($, { props: { sizing: { width: t, height: r } } })
20
+ }), E = T({
21
21
  loader: async () => (await g()).OrgStrategyDetailModal,
22
- loadingComponent: u(480, 240),
22
+ loadingComponent: p(480, 240),
23
23
  delay: 0
24
- }), D = S({
24
+ }), I = T({
25
25
  loader: async () => (await g()).OrgStrategyDropdown
26
- }), n = "guido-edit-strategy-", a = b(), e = R(), { showToaster: i } = C(), s = T(null), c = T(!1), I = l(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: k.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
- h(() => e.assignStrategyDrawerStatus, (t) => {
26
+ }), i = "guido-edit-strategy-", a = L(), e = P(), { showToaster: c } = b(), s = w(null), m = "legacy", l = w(!1), x = n(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: R.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
+ k(() => e.assignStrategyDrawerStatus, (t) => {
28
28
  if (!t)
29
29
  return;
30
30
  const { strategyId: r } = e.recommendationConfigs;
31
- s.value = r || null, c.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
32
- i({
33
- type: d.Error,
31
+ s.value = r || (e.isLegacyStrategyBlock ? m : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
32
+ c({
33
+ type: u.Error,
34
34
  message: a("discovery-strategy.error-description")
35
35
  });
36
36
  });
37
37
  });
38
- const y = (t) => {
39
- const r = v(t.updated_at || t.created_at);
38
+ const f = (t) => {
39
+ const r = O(t.updated_at || t.created_at);
40
40
  if (!r)
41
41
  return "";
42
- const o = P(r, B);
42
+ const o = M(r, N);
43
43
  return a("recommendation-strategy.last-updated-on", { value: o });
44
- }, x = l(() => e.strategies.map((t) => ({
44
+ }, S = n(() => ({
45
+ text: a("ds-steps.legacy-strategy"),
46
+ value: m,
47
+ hidden: !0
48
+ })), d = n(() => e.strategies.map((t) => ({
45
49
  text: t.name,
46
50
  value: t.strategy_id,
47
51
  infoBoxProps: {
@@ -49,15 +53,15 @@ const rt = /* @__PURE__ */ A({
49
53
  theme: "light",
50
54
  variant: "information",
51
55
  className: "assign-strategy-info-box",
52
- titleText: U(v(t.name)),
56
+ titleText: G(O(t.name)),
53
57
  descriptionStatus: !0,
54
- descriptionText: y(t),
55
- slot: N,
58
+ descriptionText: f(t),
59
+ slot: U,
56
60
  slotProps: { strategy: t },
57
61
  // The info box drops the option's value/text, so the id is the only channel
58
62
  // that can carry the strategy back to the click handler.
59
63
  buttonOptions: [{
60
- id: `${n}${t.strategy_id}`,
64
+ id: `${i}${t.strategy_id}`,
61
65
  text: a("eureka.edit-strategy"),
62
66
  type: "text",
63
67
  // Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
@@ -65,17 +69,17 @@ const rt = /* @__PURE__ */ A({
65
69
  icon: "line-open-website"
66
70
  }]
67
71
  }
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) : "";
72
+ }))), A = n(() => e.isLegacyStrategyBlock ? [S.value, ...d.value] : d.value), h = (t) => {
73
+ var _;
74
+ const r = (_ = t == null ? void 0 : t.id) != null && _.startsWith(i) ? t.id.slice(i.length) : "";
71
75
  if (!r)
72
76
  return;
73
- const o = e.currentRecommendationId, m = e.recommendationConfigs.strategyId === r;
74
- e.openStrategyEdit(r) && (String(s.value ?? "") === r && (s.value = null), m && (e.removeStrategy(), o !== null && _(o, "Removed recommendation strategy")));
75
- }, p = l(() => {
77
+ const o = e.currentRecommendationId, y = e.recommendationConfigs.strategyId === r;
78
+ e.openStrategyEdit(r) && (String(s.value ?? "") === r && (s.value = null), y && (e.removeStrategy(), o !== null && D(o, "Removed recommendation strategy")));
79
+ }, v = n(() => {
76
80
  const t = e.strategies.find((r) => String(r.strategy_id) === String(s.value ?? ""));
77
81
  return t ? { ...t, fallback_config: null } : null;
78
- }), O = l(() => ({
82
+ }), C = n(() => ({
79
83
  primaryButton: {
80
84
  styling: "solid",
81
85
  type: "primary",
@@ -87,37 +91,37 @@ const rt = /* @__PURE__ */ A({
87
91
  labelText: a("products.cancel")
88
92
  }
89
93
  }));
90
- return { __sfc: !0, loadOrganisms: g, skeleton: u, OrgStrategyDetailModal: w, OrgStrategyDropdown: D, EDIT_BUTTON_ID_PREFIX: n, trans: a, store: e, showToaster: i, selectedStrategyId: s, showSelectionError: c, drawerDescription: I, lastUpdatedText: y, strategyOptions: x, onInfoBoxButtonClick: E, selectedStrategy: p, footerButtonGroupOptions: O, closeDrawer: () => {
94
+ return { __sfc: !0, loadOrganisms: g, skeleton: p, OrgStrategyDetailModal: E, OrgStrategyDropdown: I, EDIT_BUTTON_ID_PREFIX: i, trans: a, store: e, showToaster: c, selectedStrategyId: s, LEGACY_OPTION_VALUE: m, showSelectionError: l, drawerDescription: x, lastUpdatedText: f, legacyStrategyOption: S, remoteStrategyOptions: d, strategyOptions: A, onInfoBoxButtonClick: h, selectedStrategy: v, footerButtonGroupOptions: C, closeDrawer: () => {
91
95
  e.closeAssignStrategyDrawer();
92
96
  }, assignStrategy: async () => {
93
- const t = p.value;
97
+ const t = v.value;
94
98
  if (!t) {
95
- c.value = !0;
99
+ l.value = !0;
96
100
  return;
97
101
  }
98
102
  let r = "";
99
103
  try {
100
104
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
101
- } catch (m) {
102
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", m);
105
+ } catch (y) {
106
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", y);
103
107
  }
104
108
  if (!r) {
105
- i({
106
- type: d.Error,
109
+ c({
110
+ type: u.Error,
107
111
  message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
108
112
  });
109
113
  return;
110
114
  }
111
115
  const o = e.currentRecommendationId;
112
- e.assignStrategy(t), i({
113
- type: d.Success,
116
+ e.assignStrategy(t), c({
117
+ type: u.Success,
114
118
  message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
115
- }), e.closeAssignStrategyDrawer(), o !== null && await _(o, "Assigned recommendation strategy");
119
+ }), e.closeAssignStrategyDrawer(), o !== null && await D(o, "Assigned recommendation strategy");
116
120
  }, onSelect: (t) => {
117
- s.value = t.value, c.value = !1;
121
+ s.value = t.value, l.value = !1;
118
122
  } };
119
123
  }
120
124
  });
121
125
  export {
122
- rt as default
126
+ st as default
123
127
  };
@@ -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
+ };
@@ -1,41 +1,41 @@
1
- import { defineComponent as d, computed as a } from "vue";
2
- import g from "../../../wrappers/WpModal.vue.js";
1
+ import { defineComponent as p, computed as a } from "vue";
2
+ import d from "../../../wrappers/WpModal.vue.js";
3
3
  import { useToaster as l } from "../../../../composables/useToaster.js";
4
4
  import { useTranslations as y } from "../../../../composables/useTranslations.js";
5
5
  import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
6
6
  import { useRecommendationExtensionStore as f } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
7
7
  import { commitStrategyChange as _ } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
8
8
  import { escapeHtml as T } from "../../../../utils/htmlEscape.js";
9
- const B = /* @__PURE__ */ d({
9
+ const B = /* @__PURE__ */ p({
10
10
  __name: "RemoveStrategyModal",
11
11
  setup(v) {
12
- const t = y(), e = f(), { showToaster: n } = l(), i = a(() => ({
12
+ const e = y(), t = f(), { showToaster: n } = l(), i = a(() => ({
13
13
  cancelOrBackButton: {
14
14
  type: "secondary",
15
- labelText: t("products.cancel"),
15
+ labelText: e("products.cancel"),
16
16
  styling: "ghost"
17
17
  },
18
18
  primaryButton: {
19
19
  type: "danger",
20
- labelText: t("discovery-strategy.remove")
20
+ labelText: e("discovery-strategy.remove")
21
21
  }
22
22
  })), m = a(() => {
23
- var o;
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
- e.closeRemoveStrategyModal();
23
+ var s;
24
+ const { strategyId: o } = t.recommendationConfigs;
25
+ return o ? ((s = t.assignedStrategy) == null ? void 0 : s.name) || `#${o}` : e("ds-steps.legacy-strategy");
26
+ }), r = "__STRATEGY_NAME__", g = a(() => e("email-editor.remove-strategy-confirm-message", { strategyName: r }).split(r)), c = () => {
27
+ t.closeRemoveStrategyModal();
28
28
  };
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({
29
+ return { __sfc: !0, trans: e, store: t, showToaster: n, footerButtonOptions: i, strategyName: m, NAME_TOKEN: r, messageParts: g, close: c, handleConfirm: async () => {
30
+ const o = m.value, s = t.currentRecommendationId;
31
+ t.removeStrategy(), c(), n({
32
32
  type: u.Success,
33
33
  // The toast renders through a sanitizing v-html, so the name is escaped first.
34
- message: t("email-editor.strategy-removed-success", {
35
- strategyName: `<b>${T(s)}</b>`
34
+ message: e("email-editor.strategy-removed-success", {
35
+ strategyName: `<b>${T(o)}</b>`
36
36
  })
37
- }), o !== null && await _(o, "Removed recommendation strategy");
38
- }, WpModal: g };
37
+ }), s !== null && await _(s, "Removed recommendation strategy");
38
+ }, WpModal: d };
39
39
  }
40
40
  });
41
41
  export {
@@ -1,28 +1,30 @@
1
- import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
2
- import u from "./AMPOnboarding.vue.js";
3
- import v from "./GenericOnboarding.vue.js";
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({
1
+ import { defineComponent as f, computed as e, onMounted as O, watch as t } from "vue";
2
+ import y from "./AMPOnboarding.vue.js";
3
+ import u from "./GenericOnboarding.vue.js";
4
+ import v from "./ItemsOnboarding.vue.js";
5
+ import S from "./NewVersionPopup.vue.js";
6
+ import l from "./RecommendationLegacyStrategyOnboarding.vue.js";
7
+ import h from "./RecommendationStrategyOnboarding.vue.js";
8
+ import w from "./TextBlockOnboarding.vue.js";
9
+ import P from "./VersionHistoryOnboarding.vue.js";
10
+ import { usePartner as _ } from "../../../composables/usePartner.js";
11
+ import { useEditorStore as A } from "../../../stores/editor.js";
12
+ import { useOnboardingStore as H } from "../../../stores/onboarding.js";
13
+ import { usePreviewStore as M } from "../../../stores/preview.js";
14
+ const U = /* @__PURE__ */ f({
14
15
  __name: "OnboardingWrapper",
15
16
  emits: ["onboarding-finished"],
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 },
19
- { type: "genericOnboarding", component: v },
20
- { type: "textBlockOnboarding", component: h },
21
- { type: "versionHistoryOnboarding", component: w },
22
- { type: "ampOnboarding", component: u },
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)));
17
+ setup(x, { emit: g }) {
18
+ const o = H(), r = A(), a = M(), { isTestPartner: s } = _(), m = e(() => r.isStripoInitialized), p = e(() => s()), d = [
19
+ { type: "newVersionPopup", component: S },
20
+ { type: "genericOnboarding", component: u },
21
+ { type: "textBlockOnboarding", component: w },
22
+ { type: "versionHistoryOnboarding", component: P },
23
+ { type: "ampOnboarding", component: y },
24
+ { type: "itemsOnboarding", component: v },
25
+ { type: "recommendationStrategyOnboarding", component: h },
26
+ { type: "recommendationLegacyStrategyOnboarding", component: l }
27
+ ], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), b = e(() => d.filter((n) => c(n.type)));
26
28
  return O(async () => {
27
29
  await o.fetchUserModalState();
28
30
  }), t(
@@ -31,7 +33,7 @@ const N = /* @__PURE__ */ b({
31
33
  n && !i && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && i && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
32
34
  }
33
35
  ), t(
34
- () => s.emailFormat,
36
+ () => a.emailFormat,
35
37
  (n, i) => {
36
38
  i !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
37
39
  }
@@ -40,9 +42,9 @@ const N = /* @__PURE__ */ b({
40
42
  (n) => {
41
43
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
42
44
  }
43
- ), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: f };
45
+ ), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: a, isTestPartner: s, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: b };
44
46
  }
45
47
  });
46
48
  export {
47
- N as default
49
+ U as default
48
50
  };
@@ -0,0 +1,21 @@
1
+ import s from "./RecommendationLegacyStrategyOnboarding.vue2.js";
2
+ /* empty css */
3
+ import c from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var d = function() {
5
+ var t, n, r, a, i;
6
+ var o = this, g = o._self._c, e = o._self._setupProxy;
7
+ return e.isVisible ? g(e.InOnboard, { key: "guido__recommendation-legacy-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (t = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : t.classes, attrs: { id: "guido__recommendation-legacy-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": e.onboardingStore.onboardings.recommendationLegacyStrategyOnboarding.config, "pointer-position": (r = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (a = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : a.right, "top-position": (i = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : i.top }, on: { close: function(p) {
8
+ return e.onboardingStore.close(e.ONBOARDING_TYPE);
9
+ }, nextButtonClick: e.handleNext } }) : o._e();
10
+ }, m = [], l = /* @__PURE__ */ c(
11
+ s,
12
+ d,
13
+ m,
14
+ !1,
15
+ null,
16
+ "19d8cb42"
17
+ );
18
+ const f = l.exports;
19
+ export {
20
+ f as default
21
+ };
@@ -0,0 +1,46 @@
1
+ import { defineComponent as d, computed as g, watch as l } from "vue";
2
+ import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as p } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as u } from "../../../enums/academy.js";
5
+ import { useOnboardingStore as y } from "../../../stores/onboarding.js";
6
+ import { InOnboard as f } from "@useinsider/design-system-vue";
7
+ const A = /* @__PURE__ */ d({
8
+ __name: "RecommendationLegacyStrategyOnboarding",
9
+ setup(O) {
10
+ const n = "recommendationLegacyStrategyOnboarding", o = p(), t = y(), { getTopPosition: i } = b(), r = `<a href="${u.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${o("action-builder.visit-academy")}</a>`, a = () => [
11
+ {
12
+ classes: "guido-recommendation-legacy-strategy-onboarding",
13
+ right: "40px",
14
+ top: i(485),
15
+ position: "Top Right",
16
+ title: o("email-editor.onboarding-recommendation-strategy-legacy-title"),
17
+ description: o("email-editor.onboarding-recommendation-strategy-legacy-description", {
18
+ academyLink: r
19
+ }),
20
+ imageSource: "",
21
+ backButtonClick: () => {
22
+ },
23
+ nextButtonType: "text",
24
+ nextButtonText: o("action-builder.ok"),
25
+ nextButtonClick: () => {
26
+ t.close(n);
27
+ }
28
+ }
29
+ ], s = g(
30
+ () => t.onboardings.recommendationLegacyStrategyOnboarding.config.length > 0 && t.onboardings.recommendationLegacyStrategyOnboarding.isActive
31
+ ), m = () => {
32
+ var e, c;
33
+ (c = (e = t.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : e.nextButtonClick) == null || c.call(e);
34
+ };
35
+ return l(
36
+ () => t.isActive(n),
37
+ (e) => {
38
+ e && t.setConfig(n, a());
39
+ },
40
+ { immediate: !0 }
41
+ ), { __sfc: !0, ONBOARDING_TYPE: n, trans: o, onboardingStore: t, getTopPosition: i, academyLink: r, buildOnboardingCards: a, isVisible: s, handleNext: m, InOnboard: f };
42
+ }
43
+ });
44
+ export {
45
+ A as default
46
+ };
@@ -1,77 +1,81 @@
1
- import p from "../static/assets/icons/line-change.svg.js";
2
- import s from "../static/assets/icons/line-delete.svg.js";
3
- import a from "../static/assets/icons/line-plus.svg.js";
4
- import f from "../static/styles/base.css.js";
1
+ import p from "../static/assets/icons/filled-arrow-rising.svg.js";
2
+ import s from "../static/assets/icons/line-change.svg.js";
3
+ import a from "../static/assets/icons/line-delete.svg.js";
4
+ import f from "../static/assets/icons/line-info.svg.js";
5
+ import c from "../static/assets/icons/line-plus.svg.js";
6
+ import l from "../static/styles/base.css.js";
5
7
  import C from "../static/styles/components/alert-message.css.js";
6
- import c from "../static/styles/components/amp-block.css.js";
7
- import l from "../static/styles/components/base-input.css.js";
8
- import d from "../static/styles/components/button-group.css.js";
9
- import u from "../static/styles/components/button.css.js";
10
- import h from "../static/styles/components/combobox.css.js";
11
- import g from "../static/styles/components/counter.css.js";
12
- import w from "../static/styles/components/dropdown-menu.css.js";
13
- import y from "../static/styles/components/loader.css.js";
14
- import I from "../static/styles/components/narrow-panel.css.js";
15
- import A from "../static/styles/components/popup.css.js";
16
- import b from "../static/styles/components/recommendation-strategy.css.js";
17
- import B from "../static/styles/components/skeleton.css.js";
18
- import D from "../static/styles/components/switcher.css.js";
19
- import $ from "../static/styles/components/tabs.css.js";
20
- import P from "../static/styles/components/tools.css.js";
21
- import R from "../static/styles/components/version-history.css.js";
22
- import T from "../static/styles/components/wide-panel.css.js";
23
- import x from "../static/styles/variables.css.js";
24
- function r(S, o) {
25
- return `--guido-icon-${S}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
8
+ import d from "../static/styles/components/amp-block.css.js";
9
+ import u from "../static/styles/components/base-input.css.js";
10
+ import h from "../static/styles/components/button-group.css.js";
11
+ import I from "../static/styles/components/button.css.js";
12
+ import g from "../static/styles/components/combobox.css.js";
13
+ import w from "../static/styles/components/counter.css.js";
14
+ import y from "../static/styles/components/dropdown-menu.css.js";
15
+ import A from "../static/styles/components/loader.css.js";
16
+ import $ from "../static/styles/components/narrow-panel.css.js";
17
+ import b from "../static/styles/components/popup.css.js";
18
+ import B from "../static/styles/components/recommendation-strategy.css.js";
19
+ import D from "../static/styles/components/skeleton.css.js";
20
+ import R from "../static/styles/components/switcher.css.js";
21
+ import P from "../static/styles/components/tabs.css.js";
22
+ import T from "../static/styles/components/tools.css.js";
23
+ import x from "../static/styles/components/version-history.css.js";
24
+ import M from "../static/styles/components/wide-panel.css.js";
25
+ import O from "../static/styles/variables.css.js";
26
+ function o(i, r) {
27
+ return `--guido-icon-${i}: url("data:image/svg+xml,${encodeURIComponent(r.trim())}");`;
26
28
  }
27
- const M = `:host {
28
- ${r("line-change", p)}
29
- ${r("line-delete", s)}
30
- ${r("line-plus", a)}
31
- }`, O = [
32
- x,
29
+ const V = `:host {
30
+ ${o("line-change", s)}
31
+ ${o("line-delete", a)}
32
+ ${o("filled-arrow-rising", p)}
33
+ ${o("line-info", f)}
34
+ ${o("line-plus", c)}
35
+ }`, W = [
36
+ O,
33
37
  // Must be on top
34
- M,
35
- f,
38
+ V,
39
+ l,
36
40
  // Must be on top
37
41
  C,
38
- c,
39
- l,
40
42
  d,
41
43
  u,
42
44
  h,
45
+ I,
43
46
  g,
44
47
  w,
45
48
  y,
46
- I,
47
49
  A,
48
- B,
49
- D,
50
50
  $,
51
- P,
51
+ b,
52
+ D,
52
53
  R,
54
+ P,
53
55
  T,
54
- b
56
+ x,
57
+ M,
58
+ B
55
59
  // Last: overrides button.css / wide-panel.css defaults
56
60
  ].join(`
57
61
 
58
- `), V = 3e4;
62
+ `), _ = 3e4;
59
63
  let e = null;
60
- function W() {
61
- return e || (e = new CSSStyleSheet(), e.replaceSync(O)), e;
64
+ function k() {
65
+ return e || (e = new CSSStyleSheet(), e.replaceSync(W)), e;
62
66
  }
63
- const So = () => ({ importCss: () => {
64
- const o = W(), i = Date.now() + V, m = () => {
65
- var n;
66
- const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
67
+ const po = () => ({ importCss: () => {
68
+ const r = k(), S = Date.now() + _, n = () => {
69
+ var m;
70
+ const t = (m = document.querySelector("ui-editor")) == null ? void 0 : m.shadowRoot;
67
71
  if (t) {
68
- t.adoptedStyleSheets.includes(o) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, o]);
72
+ t.adoptedStyleSheets.includes(r) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, r]);
69
73
  return;
70
74
  }
71
- Date.now() < i && requestAnimationFrame(m);
75
+ Date.now() < S && requestAnimationFrame(n);
72
76
  };
73
- m();
77
+ n();
74
78
  } });
75
79
  export {
76
- So as useCustomInterfaceAppearance
80
+ po as useCustomInterfaceAppearance
77
81
  };
@@ -0,0 +1,61 @@
1
+ import { useRecommendation as I } from "./useRecommendation.js";
2
+ import { useToaster as C } from "./useToaster.js";
3
+ import { useTranslations as v } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as g } from "../enums/toaster.js";
5
+ import "../extensions/Blocks/Recommendation/constants/selectors.js";
6
+ import { CURRENT_CONFIG_VERSION as L } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
7
+ import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
+ import { resolveMigrationTarget as R, buildLegacyMigrationPayload as T } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
9
+ import { commitBlockChangeOutsidePanel as h } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
10
+ import { useConfigStore as k } from "../stores/config.js";
11
+ const F = () => {
12
+ const e = b(), r = k(), { buildCampaignUrl: m } = I(), { showToaster: i } = C(), c = v();
13
+ return { convertLegacyStrategy: async () => {
14
+ const t = e.currentRecommendationId;
15
+ if (t === null || !e.isLegacyStrategyBlock || e.legacyConversionLoading)
16
+ return "";
17
+ const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s = R({
18
+ campaignId: r.campaignId,
19
+ templateLibraryId: r.templateLibraryId
20
+ }), S = T({
21
+ blockId: t,
22
+ url: m(String(t)),
23
+ campaignId: r.campaignId,
24
+ variationId: r.variationId,
25
+ strategy: d,
26
+ productIds: y,
27
+ target: s
28
+ });
29
+ let o;
30
+ try {
31
+ o = await e.convertLegacyStrategy(S, s);
32
+ } catch (n) {
33
+ return console.error("[useLegacyStrategyConversion] migration failed", n), i({
34
+ type: g.Error,
35
+ message: c("email-editor.legacy-strategy-update-failed")
36
+ }), "";
37
+ }
38
+ try {
39
+ await e.fetchStrategyProductsForBlock(t);
40
+ } catch (n) {
41
+ console.error("[useLegacyStrategyConversion] product refetch failed", n);
42
+ }
43
+ const a = e.blockStates[t];
44
+ return a ? h(
45
+ t,
46
+ {
47
+ strategyId: o,
48
+ size: a.recommendationConfigs.size,
49
+ configVersion: L
50
+ },
51
+ a.recommendationProducts,
52
+ "Converted legacy recommendation strategy"
53
+ ) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), o) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f), i({
54
+ type: g.Error,
55
+ message: c("email-editor.legacy-strategy-update-failed")
56
+ }), "") : o;
57
+ } };
58
+ };
59
+ export {
60
+ F as useLegacyStrategyConversion
61
+ };