@useinsider/guido 3.18.1 → 3.18.2-beta.32d291d

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 (56) 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 +55 -53
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -7
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +82 -57
  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 +24 -22
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -24
  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/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  14. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +46 -0
  15. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
  16. package/dist/composables/useCustomInterfaceAppearance.js +46 -42
  17. package/dist/composables/useHttp.js +24 -22
  18. package/dist/composables/useLegacyStrategyConversion.js +61 -0
  19. package/dist/enums/extensions/recommendationBlock.js +40 -31
  20. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +91 -84
  21. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -28
  22. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +45 -44
  23. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +123 -58
  24. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
  25. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
  26. package/dist/guido.css +1 -1
  27. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +29 -28
  28. package/dist/package.json.js +1 -1
  29. package/dist/services/recommendationApi.js +46 -37
  30. package/dist/services/templateLibraryApi.js +17 -14
  31. package/dist/src/@types/config/schemas.d.ts +16 -0
  32. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  33. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
  34. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
  35. package/dist/src/composables/useConfig.d.ts +4 -0
  36. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  37. package/dist/src/enums/extensions/recommendationBlock.d.ts +5 -1
  38. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -1
  39. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +2 -0
  40. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -0
  41. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +82 -1
  42. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
  43. package/dist/src/services/recommendationApi.d.ts +2 -1
  44. package/dist/src/stores/config.d.ts +322 -0
  45. package/dist/src/stores/onboarding.d.ts +808 -10
  46. package/dist/src/utils/genericUtil.d.ts +6 -0
  47. package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
  48. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  49. package/dist/static/assets/icons/line-info.svg.js +5 -0
  50. package/dist/static/styles/components/recommendation-strategy.css.js +70 -5
  51. package/dist/stores/config.js +74 -60
  52. package/dist/stores/onboarding.js +46 -36
  53. package/dist/utils/genericUtil.js +63 -54
  54. package/dist/utils/liquidDynamicContent.js +15 -0
  55. package/dist/utils/templatePreparation.js +54 -52
  56. package/package.json +3 -3
@@ -1,48 +1,73 @@
1
- import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
1
+ import { defineComponent as h, defineAsyncComponent as T, ref as _, computed as s, watch as B } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as x } from "../../../../composables/useToaster.js";
4
- import { useTranslations as A } from "../../../../composables/useTranslations.js";
5
- import { DOTTED_DATE_LOCALE as E } from "../../../../enums/date.js";
6
- import { URLS as h } from "../../../../enums/extensions/recommendationBlock.js";
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 { useLegacyStrategyConversion as I } from "../../../../composables/useLegacyStrategyConversion.js";
4
+ import { useToaster as N } from "../../../../composables/useToaster.js";
5
+ import { useTranslations as k } from "../../../../composables/useTranslations.js";
6
+ import { DOTTED_DATE_LOCALE as P } from "../../../../enums/date.js";
7
+ import { URLS as U } from "../../../../enums/extensions/recommendationBlock.js";
8
+ import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
9
+ import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
10
+ import G from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as M } from "../../../../utils/dateUtil.js";
12
+ import { asText as D } from "../../../../utils/genericUtil.js";
13
+ import { escapeHtml as x } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as R } from "@useinsider/design-system-vue";
15
+ const st = /* @__PURE__ */ h({
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,
17
+ setup(H) {
18
+ const l = () => import("@useinsider/design-system-organisms"), g = (t, a) => ({
19
+ render: (n) => n(R, { props: { sizing: { width: t, height: a } } })
20
+ }), O = T({
21
+ loader: async () => (await l()).OrgStrategyDetailModal,
21
22
  loadingComponent: g(480, 240),
22
23
  delay: 0
23
- }), T = y({
24
- loader: async () => (await c()).OrgStrategyDropdown,
24
+ }), w = T({
25
+ loader: async () => (await l()).OrgStrategyDropdown,
25
26
  loadingComponent: g(240, 42),
26
27
  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) => {
28
+ }), r = k(), e = b(), { showToaster: i } = N(), { convertLegacyStrategy: u } = I(), o = _(null), y = "legacy", d = "guido__btn-update-legacy-strategy", c = _(!1), A = s(() => e.assignStrategyDrawerStatus ? r("email-editor.assign-strategy-description", { url: U.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
29
+ B(() => e.assignStrategyDrawerStatus, (t) => {
29
30
  if (!t)
30
31
  return;
31
- 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")
32
+ const { strategyId: a } = e.recommendationConfigs;
33
+ o.value = a || (e.isLegacyStrategyBlock ? y : null), c.value = !1, e.fetchStrategies().catch(() => {
34
+ i({
35
+ type: p.Error,
36
+ message: r("discovery-strategy.error-description")
36
37
  });
37
38
  });
38
39
  });
39
- const p = (t) => {
40
- const r = f(t.updated_at || t.created_at);
41
- if (!r)
40
+ const f = (t) => {
41
+ const a = D(t.updated_at || t.created_at);
42
+ if (!a)
42
43
  return "";
43
- const a = I(r, E);
44
- return o("recommendation-strategy.last-updated-on", { value: a });
45
- }, D = l(() => e.strategies.map((t) => ({
44
+ const n = M(a, P);
45
+ return r("recommendation-strategy.last-updated-on", { value: n });
46
+ }, S = s(() => ({
47
+ text: r("ds-steps.legacy-strategy"),
48
+ value: y,
49
+ infoBoxProps: {
50
+ id: "strategy-info-legacy",
51
+ theme: "light",
52
+ variant: "information",
53
+ className: "assign-strategy-info-box",
54
+ titleText: x(r("ds-steps.legacy-strategy")),
55
+ descriptionStatus: !0,
56
+ descriptionText: r("statistics.legacy-strategy-description"),
57
+ buttonOptions: [{
58
+ id: d,
59
+ type: "primary",
60
+ text: r("ds-steps.update"),
61
+ loadingStatus: e.legacyConversionLoading,
62
+ disabledStatus: e.legacyConversionLoading
63
+ }]
64
+ }
65
+ })), E = async (t) => {
66
+ if ((t == null ? void 0 : t.id) !== d)
67
+ return;
68
+ const a = await u();
69
+ a && (o.value = a);
70
+ }, m = s(() => e.strategies.map((t) => ({
46
71
  text: t.name,
47
72
  value: t.strategy_id,
48
73
  infoBoxProps: {
@@ -50,57 +75,57 @@ const W = /* @__PURE__ */ v({
50
75
  theme: "light",
51
76
  variant: "information",
52
77
  className: "assign-strategy-info-box",
53
- titleText: N(f(t.name)),
78
+ titleText: x(D(t.name)),
54
79
  descriptionStatus: !0,
55
- descriptionText: p(t),
56
- slot: B,
80
+ descriptionText: f(t),
81
+ slot: G,
57
82
  slotProps: { strategy: t }
58
83
  }
59
- }))), d = l(() => {
60
- const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
84
+ }))), C = s(() => e.isLegacyStrategyBlock ? [S.value, ...m.value] : m.value), v = s(() => {
85
+ const t = e.strategies.find((a) => String(a.strategy_id) === String(o.value ?? ""));
61
86
  return t ? { ...t, fallback_config: null } : null;
62
- }), w = l(() => ({
87
+ }), L = s(() => ({
63
88
  primaryButton: {
64
89
  styling: "solid",
65
90
  type: "primary",
66
- labelText: o("products.assign-btn")
91
+ labelText: r("products.assign-btn")
67
92
  },
68
93
  cancelOrBackButton: {
69
94
  styling: "ghost",
70
95
  type: "secondary",
71
- labelText: o("products.cancel")
96
+ labelText: r("products.cancel")
72
97
  }
73
98
  }));
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: () => {
99
+ return { __sfc: !0, loadOrganisms: l, skeleton: g, OrgStrategyDetailModal: O, OrgStrategyDropdown: w, trans: r, store: e, showToaster: i, convertLegacyStrategy: u, selectedStrategyId: o, LEGACY_OPTION_VALUE: y, LEGACY_UPDATE_BUTTON_ID: d, showSelectionError: c, drawerDescription: A, lastUpdatedText: f, legacyStrategyOption: S, onInfoBoxButtonClick: E, remoteStrategyOptions: m, strategyOptions: C, selectedStrategy: v, footerButtonGroupOptions: L, closeDrawer: () => {
75
100
  e.closeAssignStrategyDrawer();
76
101
  }, assignStrategy: async () => {
77
- const t = d.value;
102
+ const t = v.value;
78
103
  if (!t) {
79
- i.value = !0;
104
+ c.value = !0;
80
105
  return;
81
106
  }
82
- let r = "";
107
+ let a = "";
83
108
  try {
84
- r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
85
- } catch (a) {
86
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
109
+ a = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
110
+ } catch (n) {
111
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", n);
87
112
  }
88
- if (!r) {
89
- s({
90
- type: m.Error,
91
- message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
113
+ if (!a) {
114
+ i({
115
+ type: p.Error,
116
+ message: r("email-editor.strategy-assign-failed", { strategyName: t.name })
92
117
  });
93
118
  return;
94
119
  }
95
- e.assignStrategy(t), s({
96
- type: m.Success,
97
- message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
120
+ e.assignStrategy(t), i({
121
+ type: p.Success,
122
+ message: r("email-editor.strategy-assigned-success", { strategyName: t.name })
98
123
  }), e.closeAssignStrategyDrawer();
99
124
  }, onSelect: (t) => {
100
- n.value = t.value, i.value = !1;
125
+ o.value = t.value, c.value = !1;
101
126
  } };
102
127
  }
103
128
  });
104
129
  export {
105
- W as default
130
+ st as default
106
131
  };
@@ -0,0 +1,18 @@
1
+ import s from "./LegacyStrategyUpdatedModal.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, a = t._self._c, e = t._self._setupProxy;
6
+ return e.store.legacyStrategyUpdatedModalStatus ? a("div", { staticClass: "legacy-strategy-updated-modal" }, [a(e.WpModal, { attrs: { id: "guido__legacy-strategy-updated-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("ds-steps.recommendation-strategy-migration-modal-title") }, on: { close: e.close, "primary-action": e.close } }, [a("p", [t._v(t._s(e.messageParts[0])), a("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])])], 1) : t._e();
7
+ }, l = [], n = /* @__PURE__ */ o(
8
+ s,
9
+ r,
10
+ l,
11
+ !1,
12
+ null,
13
+ "da2225a1"
14
+ );
15
+ const m = n.exports;
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as i, computed as s } from "vue";
2
+ import p from "../../../wrappers/WpModal.vue.js";
3
+ import { useTranslations as d } from "../../../../composables/useTranslations.js";
4
+ import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ const M = /* @__PURE__ */ i({
6
+ __name: "LegacyStrategyUpdatedModal",
7
+ setup(l) {
8
+ const e = d(), t = g(), n = s(() => ({
9
+ primaryButton: {
10
+ type: "primary",
11
+ labelText: e("action-builder.ok")
12
+ }
13
+ })), m = s(() => {
14
+ var r;
15
+ const { strategyId: a } = t.recommendationConfigs;
16
+ return ((r = t.assignedStrategy) == null ? void 0 : r.name) || `#${a}`;
17
+ }), o = "__STRATEGY_NAME__", c = s(() => e("email-editor.legacy-strategy-updated-message", { strategyName: o }).split(o));
18
+ return { __sfc: !0, trans: e, store: t, footerButtonOptions: n, strategyName: m, NAME_TOKEN: o, messageParts: c, close: () => {
19
+ t.closeLegacyStrategyUpdatedModal();
20
+ }, WpModal: p };
21
+ }
22
+ });
23
+ export {
24
+ M as default
25
+ };
@@ -1,15 +1,17 @@
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";
1
+ import { defineComponent as y, computed as n } from "vue";
2
+ import f from "../../../wrappers/WpModal.vue.js";
3
+ import { useToaster as u } from "../../../../composables/useToaster.js";
4
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({
5
+ import { ToasterTypeOptions as R } from "../../../../enums/toaster.js";
6
+ import "../../../../extensions/Blocks/Recommendation/constants/selectors.js";
7
+ import { CURRENT_CONFIG_VERSION as T } from "../../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
8
+ import { useRecommendationExtensionStore as v } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { commitBlockChangeOutsidePanel as N } from "../../../../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
10
+ import { escapeHtml as S } from "../../../../utils/htmlEscape.js";
11
+ const w = /* @__PURE__ */ y({
10
12
  __name: "RemoveStrategyModal",
11
- setup(S) {
12
- const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
13
+ setup(h) {
14
+ const t = _(), e = v(), { showToaster: a } = u(), i = n(() => ({
13
15
  cancelOrBackButton: {
14
16
  type: "secondary",
15
17
  labelText: t("products.cancel"),
@@ -20,38 +22,38 @@ const P = /* @__PURE__ */ u({
20
22
  labelText: t("discovery-strategy.remove")
21
23
  }
22
24
  })), m = n(() => {
23
- var o;
24
- const { strategyId: r } = e.recommendationConfigs;
25
- return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
25
+ var r;
26
+ const { strategyId: o } = e.recommendationConfigs;
27
+ return o ? ((r = e.assignedStrategy) == null ? void 0 : r.name) || `#${o}` : t("ds-steps.legacy-strategy");
26
28
  }), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
27
29
  e.closeRemoveStrategyModal();
28
30
  };
29
31
  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;
32
+ const o = m.value, r = e.currentRecommendationId;
31
33
  e.removeStrategy(), c();
32
34
  const { strategyId: l, size: g } = e.recommendationConfigs;
33
35
  if (a({
34
- type: v.Success,
36
+ type: R.Success,
35
37
  // The toast renders through a sanitizing v-html, so the name is escaped first.
36
38
  message: t("email-editor.strategy-removed-success", {
37
- strategyName: `<b>${R(r)}</b>`
39
+ strategyName: `<b>${S(o)}</b>`
38
40
  })
39
- }), o !== null) {
41
+ }), r !== null) {
40
42
  try {
41
43
  await e.fetchRecommendationProducts();
42
44
  } catch (p) {
43
45
  console.error("[RemoveStrategyModal] product refetch failed", p);
44
46
  }
45
- h(
46
- o,
47
- { strategyId: l, size: g },
47
+ N(
48
+ r,
49
+ { strategyId: l, size: g, configVersion: T },
48
50
  e.recommendationProducts,
49
51
  "Removed recommendation strategy"
50
52
  );
51
53
  }
52
- }, WpModal: y };
54
+ }, WpModal: f };
53
55
  }
54
56
  });
55
57
  export {
56
- P as default
58
+ w as default
57
59
  };
@@ -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, a, i;
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": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.right, "top-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.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
+ "1f4a4044"
17
+ );
18
+ const S = _.exports;
19
+ export {
20
+ S as default
21
+ };
@@ -0,0 +1,46 @@
1
+ import { defineComponent as c, computed as g, watch as b } from "vue";
2
+ import { useRibbonOffset as p } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as u } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as l } from "../../../enums/academy.js";
5
+ import { useOnboardingStore as f } from "../../../stores/onboarding.js";
6
+ import { InOnboard as O } from "@useinsider/design-system-vue";
7
+ const B = /* @__PURE__ */ c({
8
+ __name: "RecommendationStrategyOnboarding",
9
+ setup(_) {
10
+ const e = "recommendationStrategyOnboarding", n = u(), t = f(), { getTopPosition: i } = p(), r = `<a href="${l.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${n("action-builder.visit-academy")}</a>`, a = () => [
11
+ {
12
+ classes: "guido-recommendation-strategy-onboarding",
13
+ // Sits in the gap left of the settings panel and points at the strategy section, which
14
+ // starts 208px down: the panel header and its tab row are fixed chrome above it.
15
+ right: "426px",
16
+ top: i(208),
17
+ position: "Right Top",
18
+ title: n("email-editor.onboarding-recommendation-strategy-title"),
19
+ description: n("email-editor.onboarding-recommendation-strategy-description", {
20
+ academyLink: r
21
+ }),
22
+ imageSource: "",
23
+ backButtonClick: () => {
24
+ },
25
+ nextButtonType: "text",
26
+ nextButtonText: n("action-builder.ok"),
27
+ nextButtonClick: () => {
28
+ t.close(e);
29
+ }
30
+ }
31
+ ], m = g(() => t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
32
+ var o, s;
33
+ (s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
34
+ };
35
+ return b(
36
+ () => t.isActive(e),
37
+ (o) => {
38
+ o && t.setConfig(e, a());
39
+ },
40
+ { immediate: !0 }
41
+ ), { __sfc: !0, ONBOARDING_TYPE: e, trans: n, onboardingStore: t, getTopPosition: i, academyLink: r, buildOnboardingCards: a, isVisible: m, handleNext: d, InOnboard: O };
42
+ }
43
+ });
44
+ export {
45
+ B as default
46
+ };
@@ -1,64 +1,64 @@
1
- import { defineComponent as A, ref as c, computed as b, toRef as h, nextTick as C } from "vue";
2
- import N from "../../wrappers/WpDrawer.vue.js";
3
- import { useTranslations as O } from "../../../composables/useTranslations.js";
1
+ import { defineComponent as _, ref as c, computed as h, watch as C, toRef as N, nextTick as O } from "vue";
2
+ import b from "../../wrappers/WpDrawer.vue.js";
3
+ import { useTranslations as D } from "../../../composables/useTranslations.js";
4
4
  import { useTemplateNameValidator as x } from "../../../composables/validators/saveAsTemplate.js";
5
5
  import { useTemplateLibraryApi as B } from "../../../services/templateLibraryApi.js";
6
- import { useEditorStore as D } from "../../../stores/editor.js";
7
- import { useSaveAsTemplateStore as k } from "../../../stores/save-as-template.js";
8
- import { InMultiSelect as I, InBasicTextInput as M } from "@useinsider/design-system-vue";
9
- import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.js";
10
- const H = /* @__PURE__ */ A({
6
+ import { useEditorStore as k } from "../../../stores/editor.js";
7
+ import { useSaveAsTemplateStore as I } from "../../../stores/save-as-template.js";
8
+ import { InMultiSelect as M, InBasicTextInput as V } from "@useinsider/design-system-vue";
9
+ import { useDebounceFn as E } from "../../../node_modules/@vueuse/shared/index.js";
10
+ const J = /* @__PURE__ */ _({
11
11
  __name: "SaveAsTemplateDrawer",
12
- setup(E) {
13
- const o = O(), n = D(), t = k(), { createTemplate: m } = B(), a = c(!1), r = c(!1), l = c(""), f = b(() => ({
12
+ setup(R) {
13
+ const s = D(), o = k(), t = I(), { createTemplate: m } = B(), a = c(!1), n = c(!1), r = c(""), f = h(() => ({
14
14
  primaryButton: {
15
15
  styling: "solid",
16
16
  type: "primary",
17
- labelText: o(a.value ? "newsletter.saving" : "products.save"),
17
+ labelText: s(a.value ? "newsletter.saving" : "products.save"),
18
18
  loadingStatus: a.value,
19
19
  disabledStatus: t.skeletonStatus
20
20
  },
21
21
  cancelOrBackButton: {
22
22
  styling: "ghost",
23
23
  type: "secondary",
24
- labelText: o("products.cancel"),
24
+ labelText: s("products.cancel"),
25
25
  disabledStatus: a.value
26
26
  }
27
- })), u = () => {
28
- l.value = "", n.isSaveAsTemplateDrawerOpen = !1;
29
- }, i = async () => {
30
- const e = h(t, "templateName"), { success: s, errorMessage: _ } = await x(e).validate();
31
- return l.value = _, s;
32
- }, v = V(async (e) => {
33
- t.templateName = e, await i();
34
- }, 500), g = async (e) => {
35
- r.value = !0, await t.addCategory(e), r.value = !1;
36
- }, y = (e) => {
27
+ })), p = () => {
28
+ r.value = "", o.isSaveAsTemplateDrawerOpen = !1;
29
+ }, l = async () => {
30
+ const e = N(t, "templateName"), { success: i, errorMessage: A } = await x(e).validate();
31
+ return r.value = A, i;
32
+ }, v = E(async (e) => {
33
+ t.templateName = e, await l();
34
+ }, 500), S = async (e) => {
35
+ n.value = !0, await t.addCategory(e), n.value = !1;
36
+ }, T = (e) => {
37
37
  t.selectedCategories = e;
38
- }, S = (e) => {
38
+ }, g = (e) => {
39
39
  e && (t.selectedCategories = e);
40
- }, T = () => {
40
+ }, y = () => {
41
41
  t.selectedCategories = [];
42
42
  }, w = async () => {
43
- if (a.value = !0, !await i()) {
43
+ if (a.value = !0, !await l()) {
44
44
  a.value = !1;
45
45
  return;
46
46
  }
47
- const s = await m();
48
- a.value = !1, s && u();
49
- }, p = () => {
50
- C(() => {
47
+ const i = await m();
48
+ a.value = !1, i && p();
49
+ }, u = () => {
50
+ O(() => {
51
51
  const e = document.querySelector("input#guido__template-name-input");
52
52
  e == null || e.focus();
53
53
  });
54
54
  }, d = async () => {
55
- t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, p();
55
+ t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, u();
56
56
  };
57
- return n.$subscribe((e, { isSaveAsTemplateDrawerOpen: s }) => {
58
- s && d();
59
- }), { __sfc: !0, trans: o, editorStore: n, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: r, templateNameError: l, footerButtonGroupOptions: f, closeModal: u, validateTemplateName: i, handleTemplateName: v, handleAddOption: g, handleCategoryChange: y, handleSelectAllOptions: S, handleResetAllOptions: T, saveTemplate: w, focusToInput: p, initializeDrawer: d, WpDrawer: N, InBasicTextInput: M, InMultiSelect: I };
57
+ return C(() => o.isSaveAsTemplateDrawerOpen, (e) => {
58
+ e && d();
59
+ }), { __sfc: !0, trans: s, editorStore: o, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: n, templateNameError: r, footerButtonGroupOptions: f, closeModal: p, validateTemplateName: l, handleTemplateName: v, handleAddOption: S, handleCategoryChange: T, handleSelectAllOptions: g, handleResetAllOptions: y, saveTemplate: w, focusToInput: u, initializeDrawer: d, WpDrawer: b, InBasicTextInput: V, InMultiSelect: M };
60
60
  }
61
61
  });
62
62
  export {
63
- H as default
63
+ J as default
64
64
  };