@useinsider/guido 3.19.0 → 3.20.0-beta.7b31fec

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 (62) 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 +70 -68
  5. package/dist/components/organisms/base/Toaster.vue2.js +13 -12
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -57
  8. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  9. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  10. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -42
  11. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -24
  12. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
  13. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
  14. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  15. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
  16. package/dist/composables/useCustomInterfaceAppearance.js +65 -51
  17. package/dist/composables/useHtmlValidator.js +87 -82
  18. package/dist/composables/useLegacyStrategyConversion.js +61 -0
  19. package/dist/composables/useRecommendation.js +40 -35
  20. package/dist/composables/useStripo.js +30 -30
  21. package/dist/composables/useToaster.js +14 -20
  22. package/dist/enums/extensions/recommendationBlock.js +49 -33
  23. package/dist/extensions/Blocks/Recommendation/block.js +61 -42
  24. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  25. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +100 -94
  26. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +130 -55
  27. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  28. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +273 -92
  29. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
  30. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  31. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  32. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  33. package/dist/guido.css +1 -1
  34. package/dist/services/recommendationApi.js +46 -37
  35. package/dist/src/@types/config/schemas.d.ts +16 -0
  36. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  37. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
  38. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
  39. package/dist/src/composables/useConfig.d.ts +4 -0
  40. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  41. package/dist/src/enums/extensions/recommendationBlock.d.ts +7 -1
  42. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  43. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  44. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  45. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  46. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +10 -0
  47. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
  48. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +162 -1
  49. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
  50. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  51. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  52. package/dist/src/services/recommendationApi.d.ts +2 -1
  53. package/dist/src/stores/config.d.ts +322 -0
  54. package/dist/src/stores/onboarding.d.ts +808 -10
  55. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  56. package/dist/static/assets/icons/line-info.svg.js +5 -0
  57. package/dist/static/styles/components/recommendation-strategy.css.js +104 -9
  58. package/dist/static/styles/components/skeleton.css.js +23 -0
  59. package/dist/stores/config.js +74 -60
  60. package/dist/stores/onboarding.js +46 -36
  61. package/dist/utils/templatePreparation.js +55 -55
  62. package/package.json +1 -1
@@ -1,48 +1,51 @@
1
- import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } 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 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 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({
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(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
+ loader: async () => (await g()).OrgStrategyDetailModal,
22
+ loadingComponent: p(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
+ }), I = T({
25
+ loader: async () => (await g()).OrgStrategyDropdown
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) => {
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,
35
- message: o("discovery-strategy.error-description")
31
+ s.value = r || (e.isLegacyStrategyBlock ? m : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
32
+ c({
33
+ type: u.Error,
34
+ message: a("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 f = (t) => {
39
+ const r = O(t.updated_at || t.created_at);
41
40
  if (!r)
42
41
  return "";
43
- const a = I(r, E);
44
- return o("recommendation-strategy.last-updated-on", { value: a });
45
- }, D = l(() => e.strategies.map((t) => ({
42
+ const o = M(r, N);
43
+ return a("recommendation-strategy.last-updated-on", { value: o });
44
+ }, S = n(() => ({
45
+ text: a("ds-steps.legacy-strategy"),
46
+ value: m,
47
+ hidden: !0
48
+ })), d = n(() => e.strategies.map((t) => ({
46
49
  text: t.name,
47
50
  value: t.strategy_id,
48
51
  infoBoxProps: {
@@ -50,57 +53,75 @@ const W = /* @__PURE__ */ v({
50
53
  theme: "light",
51
54
  variant: "information",
52
55
  className: "assign-strategy-info-box",
53
- titleText: N(f(t.name)),
56
+ titleText: G(O(t.name)),
54
57
  descriptionStatus: !0,
55
- descriptionText: p(t),
56
- slot: B,
57
- slotProps: { strategy: t }
58
+ descriptionText: f(t),
59
+ slot: U,
60
+ slotProps: { strategy: t },
61
+ // The info box drops the option's value/text, so the id is the only channel
62
+ // that can carry the strategy back to the click handler.
63
+ buttonOptions: [{
64
+ id: `${i}${t.strategy_id}`,
65
+ text: a("eureka.edit-strategy"),
66
+ type: "text",
67
+ // Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
68
+ // silently render blank space instead of failing.
69
+ icon: "line-open-website"
70
+ }]
58
71
  }
59
- }))), d = l(() => {
60
- const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
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) : "";
75
+ if (!r)
76
+ return;
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(() => {
80
+ const t = e.strategies.find((r) => String(r.strategy_id) === String(s.value ?? ""));
61
81
  return t ? { ...t, fallback_config: null } : null;
62
- }), w = l(() => ({
82
+ }), C = n(() => ({
63
83
  primaryButton: {
64
84
  styling: "solid",
65
85
  type: "primary",
66
- labelText: o("products.assign-btn")
86
+ labelText: a("products.assign-btn")
67
87
  },
68
88
  cancelOrBackButton: {
69
89
  styling: "ghost",
70
90
  type: "secondary",
71
- labelText: o("products.cancel")
91
+ labelText: a("products.cancel")
72
92
  }
73
93
  }));
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: () => {
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: () => {
75
95
  e.closeAssignStrategyDrawer();
76
96
  }, assignStrategy: async () => {
77
- const t = d.value;
97
+ const t = v.value;
78
98
  if (!t) {
79
- i.value = !0;
99
+ l.value = !0;
80
100
  return;
81
101
  }
82
102
  let r = "";
83
103
  try {
84
104
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
85
- } catch (a) {
86
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
105
+ } catch (y) {
106
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", y);
87
107
  }
88
108
  if (!r) {
89
- s({
90
- type: m.Error,
91
- message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
109
+ c({
110
+ type: u.Error,
111
+ message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
92
112
  });
93
113
  return;
94
114
  }
95
- e.assignStrategy(t), s({
96
- type: m.Success,
97
- message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
98
- }), e.closeAssignStrategyDrawer();
115
+ const o = e.currentRecommendationId;
116
+ e.assignStrategy(t), c({
117
+ type: u.Success,
118
+ message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
119
+ }), e.closeAssignStrategyDrawer(), o !== null && await D(o, "Assigned recommendation strategy");
99
120
  }, onSelect: (t) => {
100
- n.value = t.value, i.value = !1;
121
+ s.value = t.value, l.value = !1;
101
122
  } };
102
123
  }
103
124
  });
104
125
  export {
105
- W as default
126
+ st as default
106
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,57 +1,43 @@
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 p, computed as a } from "vue";
2
+ import d 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__ */ p({
10
10
  __name: "RemoveStrategyModal",
11
- setup(S) {
12
- const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
11
+ setup(v) {
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
- })), 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();
22
+ })), m = a(() => {
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: 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: 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
+ type: u.Success,
35
33
  // 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>`
34
+ message: e("email-editor.strategy-removed-success", {
35
+ strategyName: `<b>${T(o)}</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
+ }), s !== null && await _(s, "Removed recommendation strategy");
38
+ }, WpModal: d };
53
39
  }
54
40
  });
55
41
  export {
56
- P as default
42
+ B as default
57
43
  };
@@ -1,26 +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 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({
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({
13
15
  __name: "OnboardingWrapper",
14
16
  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 },
18
- { type: "genericOnboarding", component: v },
19
- { type: "textBlockOnboarding", component: S },
20
- { type: "versionHistoryOnboarding", component: h },
21
- { 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)));
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)));
24
28
  return O(async () => {
25
29
  await o.fetchUserModalState();
26
30
  }), t(
@@ -29,7 +33,7 @@ const G = /* @__PURE__ */ b({
29
33
  n && !i && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && i && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
30
34
  }
31
35
  ), t(
32
- () => s.emailFormat,
36
+ () => a.emailFormat,
33
37
  (n, i) => {
34
38
  i !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
35
39
  }
@@ -38,9 +42,9 @@ const G = /* @__PURE__ */ b({
38
42
  (n) => {
39
43
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
40
44
  }
41
- ), { __sfc: !0, emit: f, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: g };
45
+ ), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: a, isTestPartner: s, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: b };
42
46
  }
43
47
  });
44
48
  export {
45
- G as default
49
+ U as default
46
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
+ };
@@ -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
+ };