@useinsider/guido 3.2.0-beta.c3bc14c → 3.2.0-beta.caa22bf

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 (91) hide show
  1. package/README.md +92 -0
  2. package/dist/@types/config/schemas.js +150 -94
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +88 -87
  5. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  6. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  7. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  8. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  9. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  10. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  11. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  12. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  13. package/dist/composables/useRecommendation.js +46 -26
  14. package/dist/composables/useRibbonOffset.js +21 -0
  15. package/dist/composables/useStripo.js +14 -16
  16. package/dist/composables/validators/useCouponBlockValidator.js +6 -6
  17. package/dist/config/compiler/recommendationCompilerRules.js +27 -27
  18. package/dist/config/migrator/index.js +9 -9
  19. package/dist/config/migrator/radioButtonMigrator.js +64 -44
  20. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  21. package/dist/config/migrator/recommendation/extractors.js +27 -0
  22. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  23. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  24. package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
  25. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  26. package/dist/config/migrator/recommendationMigrator.js +74 -290
  27. package/dist/enums/extensions/recommendationBlock.js +2 -1
  28. package/dist/enums/onboarding.js +7 -2
  29. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  30. package/dist/extensions/Blocks/Recommendation/block.js +35 -32
  31. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  32. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +25 -24
  33. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
  34. package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
  35. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +130 -90
  36. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  37. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  38. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
  39. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  40. package/dist/guido.css +1 -1
  41. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
  42. package/dist/node_modules/valibot/dist/index.js +450 -235
  43. package/dist/package.json.js +1 -1
  44. package/dist/services/templateLibraryApi.js +5 -4
  45. package/dist/src/@types/config/defaults.d.ts +5 -1
  46. package/dist/src/@types/config/index.d.ts +3 -3
  47. package/dist/src/@types/config/schemas.d.ts +213 -0
  48. package/dist/src/@types/config/types.d.ts +9 -1
  49. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  50. package/dist/src/composables/useConfig.d.ts +56 -0
  51. package/dist/src/composables/useRecommendation.d.ts +10 -1
  52. package/dist/src/composables/useRecommendation.test.d.ts +1 -0
  53. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  54. package/dist/src/config/migrator/index.d.ts +2 -1
  55. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  56. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  57. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  58. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  59. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  60. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  61. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  62. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  63. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  64. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  65. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  66. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  67. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  68. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  69. package/dist/src/enums/onboarding.d.ts +6 -0
  70. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  71. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  72. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
  73. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  74. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
  75. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  76. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
  77. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
  78. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  79. package/dist/src/library.d.ts +1 -1
  80. package/dist/src/stores/config.d.ts +504 -0
  81. package/dist/src/stores/onboarding.d.ts +4 -0
  82. package/dist/src/utils/htmlEscape.d.ts +5 -0
  83. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  84. package/dist/stores/onboarding.js +4 -0
  85. package/dist/utils/htmlEscape.js +13 -0
  86. package/dist/utils/pairProductVariables.js +89 -88
  87. package/dist/utils/templatePreparation.js +72 -32
  88. package/package.json +7 -3
  89. package/dist/enums/displayConditions.js +0 -80
  90. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
  91. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -1,131 +1,132 @@
1
- import { defineComponent as j, defineAsyncComponent as R, ref as A, computed as I, watch as J, onMounted as Q, onUnmounted as X } from "vue";
2
- import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
3
- import { usePartner as Z } from "../composables/usePartner.js";
4
- import { useStripo as ee } from "../composables/useStripo.js";
1
+ import { defineComponent as J, defineAsyncComponent as I, ref as W, computed as B, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
2
+ import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
3
+ import { usePartner as ee } from "../composables/usePartner.js";
4
+ import { useStripo as oe } from "../composables/useStripo.js";
5
5
  import { useTimerClone as te } from "../composables/useTimerClone.js";
6
- import { migrate as W } from "../config/migrator/index.js";
7
- import { ModuleFolderDefaults as B } from "../enums/defaults.js";
8
- import { RIBBON_SELECTOR as oe } from "../enums/onboarding.js";
9
- import ne from "./organisms/base/Toaster.vue.js";
10
- import se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
11
- import re from "./organisms/header/HeaderWrapper.vue.js";
12
- import ce from "./organisms/LoadingWrapper.vue.js";
13
- import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
14
- import ie from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
15
- import { useStripoApi as me } from "../services/stripoApi.js";
16
- import { useConfigStore as de } from "../stores/config.js";
17
- import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
18
- import { useEditorStore as ue } from "../stores/editor.js";
19
- import { usePreviewStore as pe } from "../stores/preview.js";
20
- import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
21
- const Re = /* @__PURE__ */ j({
6
+ import { migrate as H } from "../config/migrator/index.js";
7
+ import { ModuleFolderDefaults as x } from "../enums/defaults.js";
8
+ import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
9
+ import se from "./organisms/base/Toaster.vue.js";
10
+ import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
11
+ import ce from "./organisms/header/HeaderWrapper.vue.js";
12
+ import ae from "./organisms/LoadingWrapper.vue.js";
13
+ import ie from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
14
+ import me from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
15
+ import { useStripoApi as de } from "../services/stripoApi.js";
16
+ import { useConfigStore as le } from "../stores/config.js";
17
+ import { useDynamicContentStore as ue } from "../stores/dynamic-content.js";
18
+ import { useEditorStore as pe } from "../stores/editor.js";
19
+ import { usePreviewStore as fe } from "../stores/preview.js";
20
+ import { useUnsubscribeStore as ve } from "../stores/unsubscribe.js";
21
+ const Ae = /* @__PURE__ */ J({
22
22
  __name: "Guido",
23
23
  props: {
24
24
  config: null
25
25
  },
26
26
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
27
- setup(H, { expose: x, emit: s }) {
28
- const b = H, G = R(
27
+ setup(G, { expose: z, emit: n }) {
28
+ const g = G, q = I(
29
29
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
30
- ), z = R(
30
+ ), K = I(
31
31
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
32
- ), S = A(), d = A(), l = le(), g = fe(), a = de();
33
- a.init(b.config);
34
- const u = ue(), q = pe(), i = I(() => u.hasChanges), { isTestPartner: K } = Z(), w = () => {
32
+ ), w = W(), u = W(), p = ue(), E = ve(), i = le();
33
+ i.init(g.config);
34
+ const f = pe(), V = fe(), m = B(() => f.hasChanges), { isTestPartner: $ } = ee(), D = () => {
35
35
  var e;
36
- return (e = S.value) == null ? void 0 : e.handleSave(!0);
36
+ return (e = w.value) == null ? void 0 : e.handleSave(!0);
37
37
  }, {
38
- templateId: p,
39
- userId: E,
40
- partnerName: D,
41
- username: C,
42
- template: t,
38
+ templateId: v,
39
+ userId: C,
40
+ partnerName: T,
41
+ username: k,
42
+ template: o,
43
43
  editor: r
44
- } = a, m = (t == null ? void 0 : t.html) || "", T = (t == null ? void 0 : t.css) || "", f = (t == null ? void 0 : t.preselectedDynamicContent) || [], k = (r == null ? void 0 : r.savedModulesFolderName) || B.SAVED_MODULES, F = (r == null ? void 0 : r.defaultModulesFolderName) || B.DEFAULT_MODULES;
45
- u.templateId = p;
46
- const v = {
47
- emailId: p,
48
- userId: E,
49
- username: C,
50
- partnerName: D,
51
- savedModulesFolderName: k,
52
- defaultModulesFolderName: F
53
- }, L = {
54
- preselectedDynamicContentList: f,
44
+ } = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (r == null ? void 0 : r.savedModulesFolderName) || x.SAVED_MODULES, U = (r == null ? void 0 : r.defaultModulesFolderName) || x.DEFAULT_MODULES;
45
+ f.templateId = v;
46
+ const h = {
47
+ emailId: v,
48
+ userId: C,
49
+ username: k,
50
+ partnerName: T,
51
+ savedModulesFolderName: L,
52
+ defaultModulesFolderName: U
53
+ }, _ = {
54
+ preselectedDynamicContentList: y,
55
55
  onReady: () => {
56
- console.debug("guido:ready"), s("ready");
56
+ console.debug("guido:ready"), n("ready");
57
57
  }
58
- }, { initPlugin: U } = ee(v, L), { getDefaultTemplate: _ } = me(), { cloneTimersOnSave: M, hasTimerBlocks: O } = te(), V = I(() => {
58
+ }, { initPlugin: M } = oe(h, _), { getDefaultTemplate: O } = de(), { cloneTimersOnSave: P, hasTimerBlocks: N } = te(), j = B(() => {
59
59
  var e;
60
- return !((e = a.ui) != null && e.showHeader);
60
+ return !((e = i.ui) != null && e.showHeader);
61
61
  });
62
- Y({
62
+ Z({
63
63
  onBack: () => {
64
- console.debug("guido:back"), s("back");
64
+ console.debug("guido:back"), n("back");
65
65
  },
66
66
  onSaveStart: () => {
67
- console.debug("guido:save:start"), s("save:start");
67
+ console.debug("guido:save:start"), n("save:start");
68
68
  },
69
69
  onSaveComplete: (e) => {
70
- const n = { ...e, metadata: v };
71
- console.debug("guido:save:complete", n), s("save:complete", n);
70
+ const t = { ...e, metadata: h };
71
+ console.debug("guido:save:complete", t), n("save:complete", t);
72
72
  },
73
73
  onTestEmailClick: () => {
74
- console.debug("guido:test-email:click"), s("test-email:click");
74
+ console.debug("guido:test-email:click"), n("test-email:click");
75
75
  }
76
76
  });
77
- const P = (e) => {
78
- console.debug("dynamic-content:close", e), l.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
79
- }, N = () => {
77
+ const R = (e) => {
78
+ console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
79
+ }, A = () => {
80
80
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
81
81
  };
82
- J(() => i.value, () => {
83
- s("on-change", i.value);
82
+ Q(() => m.value, () => {
83
+ n("on-change", m.value);
84
84
  });
85
- const y = (e) => {
86
- const n = e, { attribute: o, position: $ } = n.detail;
87
- console.debug("dynamic-content:open", n.detail), s("dynamic-content:open", o, $);
85
+ const b = (e) => {
86
+ const t = e, { attribute: l, position: a } = t.detail;
87
+ console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
88
88
  };
89
89
  let c = null;
90
- const h = () => {
91
- var n;
92
- const e = document.querySelector(oe);
93
- (n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
90
+ const S = () => {
91
+ var t;
92
+ const e = document.querySelector(ne);
93
+ (t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
94
94
  };
95
- return Q(async () => {
96
- var n;
97
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
98
- const e = (n = d.value) == null ? void 0 : n.parentElement;
99
- e && (c = new ResizeObserver(h), c.observe(e));
95
+ return X(async () => {
96
+ var t, l;
97
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), S();
98
+ const e = (t = u.value) == null ? void 0 : t.parentElement;
99
+ e && (c = new ResizeObserver(S), c.observe(e));
100
100
  try {
101
- g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
102
- let o = {
103
- html: m && await W(m),
104
- css: T
101
+ E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
102
+ const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
103
+ let s = {
104
+ html: d && await H(d, a),
105
+ css: F
105
106
  };
106
- o.html || (o = await _(), o.html = await W(o.html)), O(o.html) && (o.html = await M(o.html)), await U(o), l.selectedDynamicContentList = f;
107
- } catch (o) {
108
- console.error("Failed to initialize Stripo editor:", o);
107
+ s.html || (s = await O(), s.html = await H(s.html, a)), N(s.html) && (s.html = await P(s.html)), await M(s), p.selectedDynamicContentList = y;
108
+ } catch (a) {
109
+ console.error("Failed to initialize Stripo editor:", a);
109
110
  }
110
- document.addEventListener("dynamic-content:open", y);
111
- }), X(() => {
112
- c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", y);
111
+ document.addEventListener("dynamic-content:open", b);
112
+ }), Y(() => {
113
+ c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", b);
113
114
  try {
114
115
  window.UIEditor.removeEditor();
115
116
  } catch {
116
117
  console.debug("Failed to remove Stripo editor: No editor found");
117
118
  }
118
- a.reset();
119
- }), x({
119
+ i.reset();
120
+ }), z({
120
121
  dynamicContent: {
121
- insert: P,
122
- close: N
122
+ insert: R,
123
+ close: A
123
124
  },
124
- hasChanges: i,
125
- saveSilent: w
126
- }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: z, headerWrapperRef: S, wrapperRef: d, dynamicContentStore: l, unsubscribeStore: g, props: b, configStore: a, editorStore: u, previewStore: q, hasChanges: i, isTestPartner: K, saveSilent: w, templateId: p, userId: E, partnerName: D, username: C, templateConfig: t, editorConfig: r, html: m, css: T, preselectedDynamicContentList: f, savedModulesFolderName: k, defaultModulesFolderName: F, emit: s, metadata: v, options: L, initPlugin: U, getDefaultTemplate: _, cloneTimersOnSave: M, hasTimerBlocks: O, noHeader: V, insertDynamicContent: P, closeDynamicContent: N, handleDynamicContentOpen: y, ribbonObserver: c, updateRibbonOffset: h, Toaster: ne, FilterSelectionDrawer: se, HeaderWrapper: re, LoadingWrapper: ce, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ie };
125
+ hasChanges: m,
126
+ saveSilent: D
127
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: r, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: N, noHeader: j, insertDynamicContent: R, closeDynamicContent: A, handleDynamicContentOpen: b, ribbonObserver: c, updateRibbonOffset: S, Toaster: se, FilterSelectionDrawer: re, HeaderWrapper: ce, LoadingWrapper: ae, SaveAsTemplateDrawer: ie, UnsubscribeWrapper: me };
127
128
  }
128
129
  });
129
130
  export {
130
- Re as default
131
+ Ae as default
131
132
  };
@@ -1,37 +1,57 @@
1
- import { defineComponent as p, computed as e, watch as m } from "vue";
2
- import { useTranslations as g } from "../../../composables/useTranslations.js";
3
- import { useOnboardingStore as u } from "../../../stores/onboarding.js";
4
- import { InOnboard as b } from "@useinsider/design-system-vue";
5
- const O = /* @__PURE__ */ p({
1
+ import { defineComponent as u, computed as d, watch as b, nextTick as f } from "vue";
2
+ import { useTranslations as C } from "../../../composables/useTranslations.js";
3
+ import { HEADER_SELECTOR as O, AMP_TOGGLE_BUTTON_SELECTOR as _, AMP_TOGGLE_WRAPPER_SELECTOR as T, POPOVER_LEFT_OFFSET as g, POPOVER_TOP_GAP as E } from "../../../enums/onboarding.js";
4
+ import { useOnboardingStore as x } from "../../../stores/onboarding.js";
5
+ import { InOnboard as P } from "@useinsider/design-system-vue";
6
+ const G = /* @__PURE__ */ u({
6
7
  __name: "AMPOnboarding",
7
- setup(l) {
8
- const i = g(), o = u(), r = e(() => `${window.innerWidth / 2 - 110}px`), a = e(() => [
9
- {
10
- classes: "guido-amp-onboarding",
11
- left: r.value,
12
- top: "70px",
13
- position: "Top Center",
14
- title: i("email-editor.onboarding-amp-title"),
15
- description: i("email-editor.onboarding-amp-description"),
16
- imageSource: "",
17
- backButtonClick: () => {
18
- },
19
- nextButtonType: "text",
20
- nextButtonText: i("action-builder.ok"),
21
- nextButtonClick: () => void o.close("ampOnboarding")
22
- }
23
- ]), d = e(() => o.onboardings.ampOnboarding.config.length > 0 && o.onboardings.ampOnboarding.isActive), s = () => {
24
- var n, t;
25
- (t = (n = o.getAmpCurrentCard) == null ? void 0 : n.nextButtonClick) == null || t.call(n);
26
- }, c = () => {
27
- var n, t;
28
- (t = (n = o.getAmpCurrentCard) == null ? void 0 : n.backButtonClick) == null || t.call(n);
8
+ setup(R) {
9
+ const e = C(), o = x(), r = () => {
10
+ const t = document.querySelector(O), n = document.querySelector(_), c = n == null ? void 0 : n.closest(T);
11
+ if (!c || !t)
12
+ return {
13
+ left: `${((t == null ? void 0 : t.offsetWidth) ?? window.innerWidth) / 2 - g}px`,
14
+ top: "68px"
15
+ };
16
+ const s = t.getBoundingClientRect(), i = c.getBoundingClientRect();
17
+ return {
18
+ left: `${i.left - s.left + i.width / 2 - g}px`,
19
+ top: `${i.bottom - s.top + E}px`
20
+ };
21
+ }, a = d(() => {
22
+ const { left: t, top: n } = r();
23
+ return [
24
+ {
25
+ classes: "guido-amp-onboarding",
26
+ left: t,
27
+ top: n,
28
+ position: "Top Center",
29
+ title: e("email-editor.onboarding-amp-title"),
30
+ description: e("email-editor.onboarding-amp-description"),
31
+ imageSource: "",
32
+ backButtonClick: () => {
33
+ },
34
+ nextButtonType: "text",
35
+ nextButtonText: e("action-builder.ok"),
36
+ nextButtonClick: () => void o.close("ampOnboarding")
37
+ }
38
+ ];
39
+ }), l = d(() => o.onboardings.ampOnboarding.config.length > 0 && o.onboardings.ampOnboarding.isActive), p = () => {
40
+ var t, n;
41
+ (n = (t = o.getAmpCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
42
+ }, m = () => {
43
+ var t, n;
44
+ (n = (t = o.getAmpCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
29
45
  };
30
- return m(() => o.onboardings.ampOnboarding.isActive, (n) => {
31
- n && o.setConfig("ampOnboarding", a.value);
32
- }, { immediate: !0 }), { __sfc: !0, trans: i, onboardingStore: o, centerLeft: r, onboardingCardsConfig: a, isVisible: d, handleNext: s, handleBack: c, InOnboard: b };
46
+ return b(
47
+ () => o.onboardings.ampOnboarding.isActive,
48
+ async (t) => {
49
+ t && (await f(), o.setConfig("ampOnboarding", a.value));
50
+ },
51
+ { immediate: !0 }
52
+ ), { __sfc: !0, trans: e, onboardingStore: o, getTogglePosition: r, onboardingCardsConfig: a, isVisible: l, handleNext: p, handleBack: m, InOnboard: P };
33
53
  }
34
54
  });
35
55
  export {
36
- O as default
56
+ G as default
37
57
  };
@@ -13,7 +13,7 @@ var l = function() {
13
13
  p,
14
14
  !1,
15
15
  null,
16
- "29b9af29"
16
+ "7419ae06"
17
17
  );
18
18
  const S = _.exports;
19
19
  export {
@@ -1,23 +1,24 @@
1
- import { defineComponent as l, computed as i, watch as b } from "vue";
2
- import { useTranslations as x } from "../../../composables/useTranslations.js";
3
- import { SERVICE_HOVER_SELECTORS as m } from "../../../enums/onboarding.js";
4
- import { useOnboardingStore as k } from "../../../stores/onboarding.js";
5
- import { InOnboard as f } from "@useinsider/design-system-vue";
6
- const S = /* @__PURE__ */ l({
1
+ import { defineComponent as l, computed as r, watch as m } from "vue";
2
+ import { useRibbonOffset as x } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as f } from "../../../composables/useTranslations.js";
4
+ import { SERVICE_HOVER_SELECTORS as k } from "../../../enums/onboarding.js";
5
+ import { useOnboardingStore as B } from "../../../stores/onboarding.js";
6
+ import { InOnboard as C } from "@useinsider/design-system-vue";
7
+ const y = /* @__PURE__ */ l({
7
8
  __name: "GenericOnboarding",
8
- setup(B) {
9
- const e = x(), o = k(), r = i(() => `${window.innerWidth / 2 - 160}px`), c = () => {
9
+ setup(T) {
10
+ const e = f(), o = B(), { getTopPosition: i } = x(), s = r(() => `${window.innerWidth / 2 - 146}px`), c = () => {
10
11
  const t = document.querySelector("ui-editor");
11
- t != null && t.shadowRoot && m.forEach((n) => {
12
- var d;
13
- const a = (d = t.shadowRoot) == null ? void 0 : d.querySelector(n);
14
- a && a.classList.add("hover");
12
+ t != null && t.shadowRoot && k.forEach((n) => {
13
+ var g;
14
+ const d = (g = t.shadowRoot) == null ? void 0 : g.querySelector(n);
15
+ d && d.classList.add("hover");
15
16
  });
16
- }, s = i(() => [
17
+ }, a = r(() => [
17
18
  {
18
19
  classes: "guido-onboarding-blocks",
19
20
  left: "90px",
20
- top: "90px",
21
+ top: i(90),
21
22
  position: "Left Top",
22
23
  title: e("email-editor.onboarding-blocks-title"),
23
24
  description: e("email-editor.onboarding-blocks-description"),
@@ -51,8 +52,8 @@ const S = /* @__PURE__ */ l({
51
52
  },
52
53
  {
53
54
  classes: "guido-onboarding-preview",
54
- left: r.value,
55
- top: "90px",
55
+ left: s.value,
56
+ top: i(68),
56
57
  position: "Top Center",
57
58
  title: e("email-editor.onboarding-preview-title"),
58
59
  description: e("email-editor.onboarding-preview-description"),
@@ -66,18 +67,18 @@ const S = /* @__PURE__ */ l({
66
67
  o.close("genericOnboarding");
67
68
  }
68
69
  }
69
- ]), g = i(() => o.onboardings.genericOnboarding.config.length > 0 && o.onboardings.genericOnboarding.isActive), p = () => {
70
+ ]), p = r(() => o.onboardings.genericOnboarding.config.length > 0 && o.onboardings.genericOnboarding.isActive), u = () => {
70
71
  var t, n;
71
72
  (n = (t = o.getGenericCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
72
- }, u = () => {
73
+ }, b = () => {
73
74
  var t, n;
74
75
  (n = (t = o.getGenericCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
75
76
  };
76
- return b(() => o.onboardings.genericOnboarding.isActive, (t) => {
77
- t && o.setConfig("genericOnboarding", s.value);
78
- }, { immediate: !0 }), { __sfc: !0, trans: e, onboardingStore: o, centerLeft: r, addHoverToServiceElements: c, onboardingCardsConfig: s, isVisible: g, handleNext: p, handleBack: u, InOnboard: f };
77
+ return m(() => o.onboardings.genericOnboarding.isActive, (t) => {
78
+ t && o.setConfig("genericOnboarding", a.value);
79
+ }, { immediate: !0 }), { __sfc: !0, trans: e, onboardingStore: o, getTopPosition: i, centerLeft: s, addHoverToServiceElements: c, onboardingCardsConfig: a, isVisible: p, handleNext: u, handleBack: b, InOnboard: C };
79
80
  }
80
81
  });
81
82
  export {
82
- S as default
83
+ y as default
83
84
  };
@@ -13,7 +13,7 @@ var l = function() {
13
13
  c,
14
14
  !1,
15
15
  null,
16
- "dd1a237a"
16
+ "796d193b"
17
17
  );
18
18
  const I = p.exports;
19
19
  export {
@@ -1,33 +1,31 @@
1
- import { defineComponent as l, computed as a, watch as u } from "vue";
1
+ import { defineComponent as b, computed as d, watch as m } from "vue";
2
+ import { useRibbonOffset as l } from "../../../composables/useRibbonOffset.js";
2
3
  import { useTranslations as x } from "../../../composables/useTranslations.js";
3
- import { RIBBON_SELECTOR as T, UI_EDITOR_SELECTOR as O, CARD_COMPOSITION_TAB_SELECTOR as B, SETTINGS_TAB_SELECTOR as f } from "../../../enums/onboarding.js";
4
- import { useOnboardingStore as C } from "../../../stores/onboarding.js";
5
- import { InOnboard as k } from "@useinsider/design-system-vue";
6
- const E = /* @__PURE__ */ l({
4
+ import { UI_EDITOR_SELECTOR as T, CARD_COMPOSITION_TAB_SELECTOR as O, SETTINGS_TAB_SELECTOR as f } from "../../../enums/onboarding.js";
5
+ import { useOnboardingStore as k } from "../../../stores/onboarding.js";
6
+ import { InOnboard as B } from "@useinsider/design-system-vue";
7
+ const E = /* @__PURE__ */ b({
7
8
  __name: "ItemsOnboarding",
8
- setup(_) {
9
- const e = x(), o = C(), c = a(() => {
10
- const t = document.querySelector(T);
11
- return (t == null ? void 0 : t.offsetHeight) ?? 0;
12
- }), n = (t) => `${t + c.value}px`, r = (t) => {
13
- const i = document.querySelector(O);
14
- if (!(i != null && i.shadowRoot))
9
+ setup(C) {
10
+ const i = x(), o = k(), { getTopPosition: n } = l(), r = (t) => {
11
+ const e = document.querySelector(T);
12
+ if (!(e != null && e.shadowRoot))
15
13
  return;
16
- const { shadowRoot: s } = i, m = s.querySelector(t);
17
- m && m.click();
18
- }, d = a(() => [
14
+ const { shadowRoot: s } = e, c = s.querySelector(t);
15
+ c && c.click();
16
+ }, a = d(() => [
19
17
  {
20
18
  classes: "guido-items-onboarding-card-1",
21
19
  right: "426px",
22
20
  top: n(90),
23
21
  position: "Right Top",
24
- title: e("email-editor.onboarding-items-title"),
25
- description: e("email-editor.onboarding-items-description"),
22
+ title: i("email-editor.onboarding-items-title"),
23
+ description: i("email-editor.onboarding-items-description"),
26
24
  imageSource: "",
27
25
  backButtonClick: () => {
28
26
  },
29
27
  nextButtonType: "text",
30
- nextButtonText: e("products.next"),
28
+ nextButtonText: i("products.next"),
31
29
  nextButtonClick: () => {
32
30
  o.next("itemsOnboarding");
33
31
  }
@@ -37,16 +35,16 @@ const E = /* @__PURE__ */ l({
37
35
  right: "426px",
38
36
  top: n(218),
39
37
  position: "Right Top",
40
- title: e("email-editor.onboarding-items-item-type-title"),
41
- description: e("email-editor.onboarding-items-item-type-description"),
38
+ title: i("email-editor.onboarding-items-item-type-title"),
39
+ description: i("email-editor.onboarding-items-item-type-description"),
42
40
  imageSource: "",
43
41
  backButtonType: "text",
44
- backButtonText: e("ds-steps.back"),
42
+ backButtonText: i("ds-steps.back"),
45
43
  backButtonClick: () => {
46
44
  o.previous("itemsOnboarding");
47
45
  },
48
46
  nextButtonType: "text",
49
- nextButtonText: e("products.next"),
47
+ nextButtonText: i("products.next"),
50
48
  nextButtonClick: () => {
51
49
  o.next("itemsOnboarding");
52
50
  }
@@ -56,42 +54,42 @@ const E = /* @__PURE__ */ l({
56
54
  right: "426px",
57
55
  top: n(140),
58
56
  position: "Right Top",
59
- title: e("email-editor.onboarding-items-composition-title"),
60
- description: e("email-editor.onboarding-items-composition-description"),
57
+ title: i("email-editor.onboarding-items-composition-title"),
58
+ description: i("email-editor.onboarding-items-composition-description"),
61
59
  imageSource: "",
62
60
  backButtonType: "text",
63
- backButtonText: e("ds-steps.back"),
61
+ backButtonText: i("ds-steps.back"),
64
62
  backButtonClick: () => {
65
63
  o.previous("itemsOnboarding");
66
64
  },
67
65
  nextButtonType: "text",
68
- nextButtonText: e("action-builder.ok"),
66
+ nextButtonText: i("action-builder.ok"),
69
67
  nextButtonClick: () => {
70
68
  o.close("itemsOnboarding");
71
69
  }
72
70
  }
73
- ]), g = a(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
74
- var t, i;
75
- (i = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || i.call(t);
76
- }, b = () => {
77
- var t, i;
78
- (i = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || i.call(t);
71
+ ]), g = d(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
72
+ var t, e;
73
+ (e = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
74
+ }, u = () => {
75
+ var t, e;
76
+ (e = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
79
77
  };
80
- return u(
78
+ return m(
81
79
  () => o.isActive("itemsOnboarding"),
82
80
  (t) => {
83
- t && o.setConfig("itemsOnboarding", d.value);
81
+ t && o.setConfig("itemsOnboarding", a.value);
84
82
  },
85
83
  { immediate: !0 }
86
- ), u(
84
+ ), m(
87
85
  () => o.onboardings.itemsOnboarding.cardIndex,
88
- (t, i) => {
86
+ (t, e) => {
89
87
  if (!o.isActive("itemsOnboarding"))
90
88
  return;
91
- const s = `${i}-${t}`;
92
- s === "1-2" && r(B), s === "2-1" && r(f);
89
+ const s = `${e}-${t}`;
90
+ s === "1-2" && r(O), s === "2-1" && r(f);
93
91
  }
94
- ), { __sfc: !0, trans: e, onboardingStore: o, ribbonOffset: c, getTopPosition: n, switchTab: r, onboardingCardsConfig: d, isVisible: g, handleNext: p, handleBack: b, InOnboard: k };
92
+ ), { __sfc: !0, trans: i, onboardingStore: o, getTopPosition: n, switchTab: r, onboardingCardsConfig: a, isVisible: g, handleNext: p, handleBack: u, InOnboard: B };
95
93
  }
96
94
  });
97
95
  export {
@@ -13,9 +13,9 @@ var g = function() {
13
13
  b,
14
14
  !1,
15
15
  null,
16
- "d073b1dc"
16
+ "cadfc82d"
17
17
  );
18
- const f = p.exports;
18
+ const C = p.exports;
19
19
  export {
20
- f as default
20
+ C as default
21
21
  };