@useinsider/guido 1.0.2-beta.8424df0 → 1.0.2-beta.85ea6e2

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 (64) hide show
  1. package/README.md +12 -0
  2. package/dist/@types/events.d.ts +6 -0
  3. package/dist/@types/generic.d.ts +1 -0
  4. package/dist/components/Guido.vue.d.ts +1 -0
  5. package/dist/components/Guido.vue.js +11 -11
  6. package/dist/components/Guido.vue2.js +63 -55
  7. package/dist/components/organisms/LoadingWrapper.vue.d.ts +2 -0
  8. package/dist/components/organisms/LoadingWrapper.vue.js +18 -0
  9. package/dist/components/organisms/LoadingWrapper.vue2.js +12 -0
  10. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +12 -12
  11. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +7 -8
  12. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +15 -14
  13. package/dist/components/organisms/header/LeftSlot.vue.js +10 -9
  14. package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
  15. package/dist/components/organisms/header/MiddleSlot.vue2.js +15 -16
  16. package/dist/components/organisms/header/RightSlot.vue.js +3 -3
  17. package/dist/components/organisms/header/RightSlot.vue2.js +25 -26
  18. package/dist/components/organisms/header/ViewOptions.vue.js +10 -10
  19. package/dist/components/organisms/header/ViewOptions.vue2.js +14 -15
  20. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
  21. package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +2 -0
  22. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +20 -0
  23. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +37 -0
  24. package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +2 -0
  25. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +21 -0
  26. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +83 -0
  27. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +2 -0
  28. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +17 -0
  29. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -0
  30. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +2 -0
  31. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +19 -0
  32. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +38 -0
  33. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +2 -0
  34. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +21 -0
  35. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +62 -0
  36. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +2 -0
  37. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +20 -0
  38. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +37 -0
  39. package/dist/composables/useCustomInterfaceAppearance.js +15 -13
  40. package/dist/composables/usePartner.d.ts +1 -0
  41. package/dist/composables/usePartner.js +16 -9
  42. package/dist/composables/usePreviewMode.js +16 -15
  43. package/dist/composables/useStripo.js +49 -48
  44. package/dist/composables/useStripoEventHandler.d.ts +3 -0
  45. package/dist/composables/useStripoEventHandler.js +20 -0
  46. package/dist/enums/defaults.d.ts +1 -0
  47. package/dist/enums/defaults.js +42 -9
  48. package/dist/enums/onboarding.d.ts +1 -0
  49. package/dist/enums/onboarding.js +8 -0
  50. package/dist/guido.css +1 -1
  51. package/dist/mock/api/user-modal-state.d.ts +2 -0
  52. package/dist/services/onboardingApi.d.ts +4 -0
  53. package/dist/services/onboardingApi.js +23 -0
  54. package/dist/static/assets/onboarding-img.svg.js +4 -0
  55. package/dist/static/styles/components/loader.css.js +10 -0
  56. package/dist/static/styles/components/wide-panel.css.js +11 -2
  57. package/dist/static/styles/customEditorStyle.css.js +18 -0
  58. package/dist/stores/editor.d.ts +194 -1
  59. package/dist/stores/editor.js +18 -2
  60. package/dist/stores/onboarding.d.ts +1004 -0
  61. package/dist/stores/onboarding.js +95 -0
  62. package/dist/stores/preview.d.ts +0 -8
  63. package/dist/stores/preview.js +14 -20
  64. package/package.json +1 -1
package/README.md CHANGED
@@ -131,6 +131,7 @@ export default {
131
131
  | `back` | - | Fired when user clicks the back button |
132
132
  | `save:start` | - | Fired when the save process begins |
133
133
  | `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
134
+ | `on-change` | void | It Fires once for managing leave modal etc. |
134
135
 
135
136
  ### Guido Exposed Methods
136
137
  ```typescript
@@ -145,6 +146,16 @@ interface GuidoConfig {
145
146
  translationsPath: string;
146
147
  htmlCompilerRules?: CompilerRule[];
147
148
  ignoreDefaultHtmlCompilerRules?: boolean;
149
+ useHeader: boolean
150
+ emailHeader: {
151
+ senderName: string;
152
+ subject: string;
153
+ };
154
+ partner: {
155
+ partnerName: string;
156
+ productType: number;
157
+ messageType: number;
158
+ };
148
159
  features: {
149
160
  dynamicContent: boolean;
150
161
  saveAsTemplate: boolean;
@@ -158,6 +169,7 @@ interface GuidoConfig {
158
169
  | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
159
170
  | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
160
171
  | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
172
+ | `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
161
173
  | `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
162
174
  | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
163
175
  | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
@@ -1 +1,7 @@
1
1
  export type StripoEventType = 'save' | 'export' | 'close' | 'autosave' | 'publish' | 'export:requested' | 'export:ready';
2
+ export interface EventHandler {
3
+ (params: Record<string, string>): void | Promise<void>;
4
+ }
5
+ export interface EventHandlers {
6
+ [eventType: string]: EventHandler;
7
+ }
@@ -13,6 +13,7 @@ export type GuidoConfig = {
13
13
  translationsPath: string;
14
14
  htmlCompilerRules?: CompilerRule[];
15
15
  ignoreDefaultHtmlCompilerRules?: boolean;
16
+ useHeader?: boolean;
16
17
  emailHeader: EmailHeader;
17
18
  partner?: Partner;
18
19
  features?: Features;
@@ -23,6 +23,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
23
23
  back: () => void;
24
24
  "save:start": () => void;
25
25
  "save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
26
+ "on-change": () => void;
26
27
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
27
28
  export default _default;
28
29
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,18 +1,18 @@
1
- import o from "./Guido.vue2.js";
1
+ import a from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import t from "../_virtual/_plugin-vue2_normalizer.js";
4
- var s = function() {
5
- var i = this, e = i._self._c, r = i._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.Toaster), e(r.SaveAsTemplateDrawer)], 1);
7
- }, a = [], n = /* @__PURE__ */ t(
8
- o,
9
- s,
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var t = function() {
5
+ var o = this, r = o._self._c, e = o._self._setupProxy;
6
+ return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.SaveAsTemplateDrawer), r(e.OnboardingWrapper), r(e.LoadingWrapper)], 1);
7
+ }, s = [], d = /* @__PURE__ */ i(
10
8
  a,
9
+ t,
10
+ s,
11
11
  !1,
12
12
  null,
13
- "84c43576"
13
+ "b74952a6"
14
14
  );
15
- const c = n.exports;
15
+ const v = d.exports;
16
16
  export {
17
- c as default
17
+ v as default
18
18
  };
@@ -1,17 +1,18 @@
1
- import { defineComponent as I, defineAsyncComponent as P, computed as _, onMounted as L, onUnmounted as k } from "vue";
2
- import { provideGuidoActions as A } from "../composables/useGuidoActions.js";
3
- import { usePartner as N } from "../composables/usePartner.js";
4
- import { useStripo as U } from "../composables/useStripo.js";
5
- import { DefaultUsername as x, DefaultMessageType as M, DefaultGuidoConfig as W } from "../enums/defaults.js";
6
- import z from "./organisms/base/Toaster.vue.js";
7
- import B from "./organisms/header/HeaderWrapper.vue.js";
8
- import F from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
9
- import { useStripoApi as H } from "../services/stripoApi.js";
10
- import { useDynamicContentStore as K } from "../stores/dynamic-content.js";
11
- import { useEditorStore as R } from "../stores/editor.js";
12
- import { usePreviewStore as j } from "../stores/preview.js";
13
- import q from "../node_modules/lodash-es/merge.js";
14
- const se = /* @__PURE__ */ I({
1
+ import { defineComponent as k, defineAsyncComponent as b, computed as E, watch as A, onMounted as W, onUnmounted as H } from "vue";
2
+ import { provideGuidoActions as N } from "../composables/useGuidoActions.js";
3
+ import { usePartner as U } from "../composables/usePartner.js";
4
+ import { useStripo as x } from "../composables/useStripo.js";
5
+ import { DefaultUsername as M, DefaultMessageType as z, DefaultGuidoConfig as B } from "../enums/defaults.js";
6
+ import F from "./organisms/base/Toaster.vue.js";
7
+ import K from "./organisms/header/HeaderWrapper.vue.js";
8
+ import O from "./organisms/LoadingWrapper.vue.js";
9
+ import R from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
10
+ import { useStripoApi as j } from "../services/stripoApi.js";
11
+ import { useDynamicContentStore as q } from "../stores/dynamic-content.js";
12
+ import { useEditorStore as J } from "../stores/editor.js";
13
+ import { usePreviewStore as Q } from "../stores/preview.js";
14
+ import V from "../node_modules/lodash-es/merge.js";
15
+ const de = /* @__PURE__ */ k({
15
16
  __name: "Guido",
16
17
  props: {
17
18
  templateId: null,
@@ -25,78 +26,85 @@ const se = /* @__PURE__ */ I({
25
26
  preselectedDynamicContentList: null,
26
27
  guidoConfig: null
27
28
  },
28
- emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
29
- setup(b, { expose: E, emit: t }) {
30
- const o = b, T = P(
29
+ emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change"],
30
+ setup(T, { expose: G, emit: o }) {
31
+ const t = T, I = b(
31
32
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
32
- ), n = K(), c = R(), a = _(() => c.hasChanges), r = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = N(), G = j(), {
33
+ ), L = b(
34
+ () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
35
+ ), n = q(), c = J(), P = Q(), r = E(() => c.hasChanges), a = t.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = U(), {
33
36
  templateId: l,
34
- userId: u,
35
- guidoConfig: p,
36
- html: f = "",
37
- css: g = "",
38
- partnerName: s = m(),
39
- productType: i = d(),
40
- messageType: y = M,
41
- username: C = x
42
- } = o;
43
- window.GuidoConfig = q(W, p), window.GuidoConfig.partner = {
44
- partnerName: s,
45
- productType: i,
37
+ userId: p,
38
+ guidoConfig: u,
39
+ html: g = "",
40
+ css: f = "",
41
+ partnerName: i = m(),
42
+ productType: s = d(),
43
+ messageType: y = z,
44
+ username: C = M
45
+ } = t;
46
+ window.GuidoConfig = V(B, u), window.GuidoConfig.partner = {
47
+ partnerName: i,
48
+ productType: s,
46
49
  messageType: y
47
50
  };
48
- const { initPlugin: v } = U({
51
+ const { initPlugin: v } = x({
49
52
  emailId: l,
50
- userId: u,
53
+ userId: p,
51
54
  username: C,
52
- partnerName: s,
53
- productType: i,
54
- preselectedDynamicContentList: r
55
- }), { getDefaultTemplate: w } = H();
56
- A({
55
+ partnerName: i,
56
+ productType: s,
57
+ preselectedDynamicContentList: a
58
+ }), { getDefaultTemplate: w } = j(), _ = E(() => {
59
+ var e;
60
+ return !((e = window.GuidoConfig) != null && e.useHeader);
61
+ });
62
+ N({
57
63
  onBack: () => {
58
- console.debug("guido:back"), t("back");
64
+ console.debug("guido:back"), o("back");
59
65
  },
60
66
  onSaveStart: () => {
61
- console.debug("guido:save:start"), t("save:start");
67
+ console.debug("guido:save:start"), o("save:start");
62
68
  },
63
69
  onSaveComplete: (e) => {
64
- console.debug("guido:save:complete", e), t("save:complete", e);
70
+ console.debug("guido:save:complete", e), o("save:complete", e);
65
71
  }
66
72
  });
67
- const D = (e) => {
73
+ const h = (e) => {
68
74
  console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
69
- }, S = () => {
75
+ }, D = () => {
70
76
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
71
77
  };
72
- return L(async () => {
78
+ return A(() => r.value, () => {
79
+ o("on-change");
80
+ }), W(async () => {
73
81
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
74
82
  try {
75
83
  let e = {
76
- html: f,
77
- css: g,
84
+ html: g,
85
+ css: f,
78
86
  forceRecreate: !0
79
87
  // TODO: It should be false for old templates. We will communicate with Stripo
80
88
  };
81
- e.html || (e = await w()), await v(e), n.selectedDynamicContentList = r;
89
+ e.html || (e = await w()), await v(e), n.selectedDynamicContentList = a;
82
90
  } catch (e) {
83
91
  console.error("Failed to initialize Stripo editor:", e);
84
92
  }
85
93
  document.addEventListener("dynamic-content:open", (e) => {
86
- const h = e;
87
- console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
94
+ const S = e;
95
+ console.debug("dynamic-content:open", S.detail), o("dynamic-content:open", S.detail);
88
96
  });
89
- }), k(() => {
97
+ }), H(() => {
90
98
  window.UIEditor.removeEditor();
91
- }), E({
99
+ }), G({
92
100
  dynamicContent: {
93
- insert: D,
94
- close: S
101
+ insert: h,
102
+ close: D
95
103
  },
96
- hasChanges: a
97
- }), { __sfc: !0, PreviewContainer: T, dynamicContentStore: n, props: o, editorStore: c, hasChanges: a, preselectedDynamicContentList: r, getPartnerName: m, getProductType: d, previewStore: G, templateId: l, userId: u, guidoConfig: p, html: f, css: g, partnerName: s, productType: i, messageType: y, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, insertDynamicContent: D, closeDynamicContent: S, Toaster: z, HeaderWrapper: B, SaveAsTemplateDrawer: F };
104
+ hasChanges: r
105
+ }), { __sfc: !0, PreviewContainer: I, OnboardingWrapper: L, dynamicContentStore: n, props: t, editorStore: c, previewStore: P, hasChanges: r, preselectedDynamicContentList: a, getPartnerName: m, getProductType: d, templateId: l, userId: p, guidoConfig: u, html: g, css: f, partnerName: i, productType: s, messageType: y, username: C, emit: o, initPlugin: v, getDefaultTemplate: w, noHeader: _, insertDynamicContent: h, closeDynamicContent: D, Toaster: F, HeaderWrapper: K, LoadingWrapper: O, SaveAsTemplateDrawer: R };
98
106
  }
99
107
  });
100
108
  export {
101
- se as default
109
+ de as default
102
110
  };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import t from "./LoadingWrapper.vue2.js";
2
+ /* empty css */
3
+ import a from "../../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
5
+ var r = this, e = r._self._c, o = r._self._setupProxy;
6
+ return o.editorStore.loadingStatus ? e("div", { staticClass: "guido-loading__wrapper p-a l-0 z-4 d-f a-i-c j-c-c w-1 f-g-1 b-c-36" }, [e(o.InLoading, { attrs: { "color-class": "i-c-7", size: "32" } })], 1) : r._e();
7
+ }, n = [], _ = /* @__PURE__ */ a(
8
+ t,
9
+ s,
10
+ n,
11
+ !1,
12
+ null,
13
+ "2d4cd446"
14
+ );
15
+ const l = _.exports;
16
+ export {
17
+ l as default
18
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent as o } from "vue";
2
+ import { useEditorStore as r } from "../../stores/editor.js";
3
+ import { InLoading as t } from "@useinsider/design-system-vue";
4
+ const s = /* @__PURE__ */ o({
5
+ __name: "LoadingWrapper",
6
+ setup(e) {
7
+ return { __sfc: !0, editorStore: r(), InLoading: t };
8
+ }
9
+ });
10
+ export {
11
+ s as default
12
+ };
@@ -1,19 +1,19 @@
1
- import i from "./PreviewContainer.vue2.js";
2
- import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var t = function() {
4
- var s = this, e = s._self._c, r = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f f-d-c h-1 b-c-5 bor-r-2 pb-5" }, [e("div", { staticClass: "f-g-1 d-f p-5 o-a g-4 min-h-600" }, [r.previewStore.isLoading ? [e("div", { staticClass: "d-f a-i-c j-c-c w-1 h-1 f-g-1" }, [e(r.InLoading, { attrs: { "color-class": "i-c-1", size: "32" } })], 1)] : [e(r.DesktopPreview, { staticClass: "f-g-1 min-w-0" }), e(r.MobilePreview, { staticClass: "f-0 min-w-a" })]], 2), r.previewStore.isAMPErrorModalVisible ? e(r.AmpErrorModal, { on: { close: function(l) {
6
- return r.previewStore.closeErrorModal();
7
- } } }) : s._e()], 1);
8
- }, a = [], n = /* @__PURE__ */ o(
1
+ import s from "./PreviewContainer.vue2.js";
2
+ import t from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var o = this, r = o._self._c, e = o._self._setupProxy;
5
+ return e.previewStore.isLoaded ? r("div", { staticClass: "d-f f-d-c h-1 b-c-5 bor-r-2 pb-5" }, [r("div", { staticClass: "f-g-1 d-f p-5 o-a g-4 min-h-600" }, [r(e.DesktopPreview, { staticClass: "f-g-1 min-w-0" }), r(e.MobilePreview, { staticClass: "f-0 min-w-a" })], 1), e.previewStore.isAMPErrorModalVisible ? r(e.AmpErrorModal, { on: { close: function(_) {
6
+ return e.previewStore.closeErrorModal();
7
+ } } }) : o._e()], 1) : o._e();
8
+ }, n = [], a = /* @__PURE__ */ t(
9
+ s,
9
10
  i,
10
- t,
11
- a,
11
+ n,
12
12
  !1,
13
13
  null,
14
14
  null
15
15
  );
16
- const d = n.exports;
16
+ const p = a.exports;
17
17
  export {
18
- d as default
18
+ p as default
19
19
  };
@@ -1,19 +1,18 @@
1
1
  import { defineComponent as r, onMounted as t } from "vue";
2
2
  import { usePreviewMode as i } from "../../../composables/usePreviewMode.js";
3
3
  import { usePreviewStore as m } from "../../../stores/preview.js";
4
- import { InLoading as n } from "@useinsider/design-system-vue";
5
4
  import p from "./amp/AmpErrorModal.vue.js";
6
- import f from "./desktop-preview/DesktopPreview.vue.js";
5
+ import n from "./desktop-preview/DesktopPreview.vue.js";
7
6
  import s from "./mobile-preview/MobilePreview.vue.js";
8
- const l = /* @__PURE__ */ r({
7
+ const P = /* @__PURE__ */ r({
9
8
  __name: "PreviewContainer",
10
- setup(a) {
11
- const { loadPreviewData: o } = i(), e = m();
9
+ setup(f) {
10
+ const { loadPreviewData: e } = i(), o = m();
12
11
  return t(() => {
13
- o();
14
- }), { __sfc: !0, loadPreviewData: o, previewStore: e, InLoading: n, AmpErrorModal: p, DesktopPreview: f, MobilePreview: s };
12
+ e();
13
+ }), { __sfc: !0, loadPreviewData: e, previewStore: o, AmpErrorModal: p, DesktopPreview: n, MobilePreview: s };
15
14
  }
16
15
  });
17
16
  export {
18
- l as default
17
+ P as default
19
18
  };
@@ -1,29 +1,30 @@
1
- import { defineComponent as m, computed as n } from "vue";
2
- import { useTranslations as r } from "../../../../composables/useTranslations.js";
3
- import { usePreviewStore as i } from "../../../../stores/preview.js";
4
- import { InButtonV2 as s, InSegments as l } from "@useinsider/design-system-vue";
5
- const _ = /* @__PURE__ */ m({
1
+ import { defineComponent as r, computed as i } from "vue";
2
+ import { useTranslations as m } from "../../../../composables/useTranslations.js";
3
+ import { useOnboardingStore as s } from "../../../../stores/onboarding.js";
4
+ import { usePreviewStore as p } from "../../../../stores/preview.js";
5
+ import { InButtonV2 as l, InSegments as d } from "@useinsider/design-system-vue";
6
+ const v = /* @__PURE__ */ r({
6
7
  __name: "AmpToggle",
7
- setup(p) {
8
- const t = i(), e = r(), o = n(() => [
8
+ setup(u) {
9
+ const t = p(), e = s(), o = m(), a = i(() => [
9
10
  {
10
- text: e("dynamic-creatives.html"),
11
+ text: o("dynamic-creatives.html"),
11
12
  value: "html"
12
13
  },
13
14
  {
14
- text: e("email-editor.amp-html"),
15
+ text: o("email-editor.amp-html"),
15
16
  value: "AMP",
16
- tooltipText: t.hasAMP ? "" : e("email-editor.preview-amp-unavailable-tooltip"),
17
+ tooltipText: t.hasAMP ? "" : o("email-editor.preview-amp-unavailable-tooltip"),
17
18
  position: "bottom",
18
19
  align: "center",
19
20
  disable: !t.hasAMP
20
21
  }
21
22
  ]);
22
- return { __sfc: !0, previewStore: t, trans: e, segmentList: o, handleFormatChange: (a) => {
23
- t.setEmailFormat(a);
24
- }, InSegments: l, InButtonV2: s };
23
+ return { __sfc: !0, previewStore: t, onboardingStore: e, trans: o, segmentList: a, handleFormatChange: (n) => {
24
+ t.setEmailFormat(n), n === "AMP" && e.shouldShowOnboarding("ampOnboarding") && e.start("ampOnboarding");
25
+ }, InSegments: d, InButtonV2: l };
25
26
  }
26
27
  });
27
28
  export {
28
- _ as default
29
+ v as default
29
30
  };
@@ -1,17 +1,18 @@
1
- import n from "./LeftSlot.vue2.js";
2
- import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var r = function() {
1
+ import o from "./LeftSlot.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
4
5
  var e = this, s = e._self._c, t = e._self._setupProxy;
5
6
  return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" }, on: { click: t.handleBack } }), t.editorStore.isVersionHistoryOpen ? s(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
6
- }, a = [], i = /* @__PURE__ */ o(
7
- n,
8
- r,
7
+ }, n = [], i = /* @__PURE__ */ r(
8
+ o,
9
9
  a,
10
+ n,
10
11
  !1,
11
12
  null,
12
- null
13
+ "a18ac2d3"
13
14
  );
14
- const f = i.exports;
15
+ const d = i.exports;
15
16
  export {
16
- f as default
17
+ d as default
17
18
  };
@@ -1,17 +1,17 @@
1
1
  import i from "./MiddleSlot.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var o = this, e = o._self._c, t = o._self._setupProxy;
5
- return t.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(t.VersionHistory), e(t.VersionHistoryViewOptions)], 1) : e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__undo-button"), "tooltip-text": t.trans("action-builder.undo") } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__redo-button"), "tooltip-text": t.trans("action-builder.redo") } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button"), "tooltip-text": t.codeEditorTooltipText } }), e(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.previewStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreviewToggle } }), e(t.ViewOptions, { staticClass: "ml-3" }), t.previewStore.isPreviewModeOpen ? e(t.AmpToggle) : o._e()], 1);
6
- }, r = [], l = /* @__PURE__ */ s(
4
+ var e = this, o = e._self._c, t = e._self._setupProxy;
5
+ return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isUndoButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__undo-button"), "tooltip-text": t.trans("action-builder.undo") } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isRedoButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__redo-button"), "tooltip-text": t.trans("action-builder.redo") } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isCodeEditorButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button"), "tooltip-text": t.codeEditorTooltipText } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreviewToggle } }), o(t.ViewOptions, { staticClass: "ml-3" }), t.editorStore.isPreviewModeOpen ? o(t.AmpToggle) : e._e()], 1);
6
+ }, d = [], l = /* @__PURE__ */ s(
7
7
  i,
8
8
  n,
9
- r,
9
+ d,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const u = l.exports;
14
+ const p = l.exports;
15
15
  export {
16
- u as default
16
+ p as default
17
17
  };
@@ -1,21 +1,20 @@
1
- import { defineComponent as m, computed as s } from "vue";
2
- import { usePreviewMode as l } from "../../../composables/usePreviewMode.js";
3
- import { useTranslations as d } from "../../../composables/useTranslations.js";
4
- import w from "../email-preview/amp/AmpToggle.vue.js";
5
- import { useEditorStore as c } from "../../../stores/editor.js";
6
- import { usePreviewStore as f } from "../../../stores/preview.js";
7
- import { getTooltipOptions as v } from "../../../utils/tooltipUtils.js";
8
- import { InButtonV2 as a } from "@useinsider/design-system-vue";
9
- import u from "./version-history/VersionHistory.vue.js";
10
- import T from "./version-history/ViewOptions.vue.js";
11
- import P from "./ViewOptions.vue.js";
12
- const B = /* @__PURE__ */ m({
1
+ import { defineComponent as p, computed as i } from "vue";
2
+ import { usePreviewMode as m } from "../../../composables/usePreviewMode.js";
3
+ import { useTranslations as l } from "../../../composables/useTranslations.js";
4
+ import d from "../email-preview/amp/AmpToggle.vue.js";
5
+ import { useEditorStore as w } from "../../../stores/editor.js";
6
+ import { getTooltipOptions as c } from "../../../utils/tooltipUtils.js";
7
+ import { InButtonV2 as f } from "@useinsider/design-system-vue";
8
+ import a from "./version-history/VersionHistory.vue.js";
9
+ import v from "./version-history/ViewOptions.vue.js";
10
+ import u from "./ViewOptions.vue.js";
11
+ const C = /* @__PURE__ */ p({
13
12
  __name: "MiddleSlot",
14
- setup(_) {
15
- const t = c(), e = d(), o = f(), { openPreviewMode: r, closePreviewMode: i } = l(), n = s(() => o.isPreviewModeOpen ? e("newsletter.close-email-preview") : e("newsletter.email-preview")), p = s(() => t.isCodeEditorOpen ? e("newsletter.close-html-editor") : e("newsletter.html-editor"));
16
- return { __sfc: !0, editorStore: t, trans: e, previewStore: o, openPreviewMode: r, closePreviewMode: i, previewTooltipText: n, codeEditorTooltipText: p, handlePreviewToggle: () => o.isPreviewModeOpen ? i() : r(), AmpToggle: w, getTooltipOptions: v, InButtonV2: a, VersionHistory: u, VersionHistoryViewOptions: T, ViewOptions: P };
13
+ setup(T) {
14
+ const o = w(), e = l(), { openPreviewMode: t, closePreviewMode: r } = m(), s = i(() => o.isPreviewModeOpen ? e("newsletter.close-email-preview") : e("newsletter.email-preview")), n = i(() => o.isCodeEditorOpen ? e("newsletter.close-html-editor") : e("newsletter.html-editor"));
15
+ return { __sfc: !0, editorStore: o, trans: e, openPreviewMode: t, closePreviewMode: r, previewTooltipText: s, codeEditorTooltipText: n, handlePreviewToggle: () => o.isPreviewModeOpen ? r() : t(), AmpToggle: d, getTooltipOptions: c, InButtonV2: f, VersionHistory: a, VersionHistoryViewOptions: v, ViewOptions: u };
17
16
  }
18
17
  });
19
18
  export {
20
- B as default
19
+ C as default
21
20
  };
@@ -3,8 +3,8 @@ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var l = function() {
4
4
  var s, i;
5
5
  var o = this, e = o._self._c, t = o._self._setupProxy;
6
- return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.isSaveButtonDisabled }, on: { click: t.handleSave } })], 1);
7
- }, r = [], p = /* @__PURE__ */ a(
6
+ return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: t.handleSave } })], 1);
7
+ }, r = [], d = /* @__PURE__ */ a(
8
8
  n,
9
9
  l,
10
10
  r,
@@ -12,7 +12,7 @@ var l = function() {
12
12
  null,
13
13
  null
14
14
  );
15
- const c = p.exports;
15
+ const c = d.exports;
16
16
  export {
17
17
  c as default
18
18
  };
@@ -1,37 +1,36 @@
1
- import { defineComponent as y, computed as p } from "vue";
2
- import { useConfig as H } from "../../../composables/useConfig.js";
3
- import { useExport as V } from "../../../composables/useExport.js";
4
- import { useSaveStart as _, useSaveComplete as h } from "../../../composables/useGuidoActions.js";
5
- import { useTranslations as w } from "../../../composables/useTranslations.js";
1
+ import { defineComponent as v, ref as S, computed as d } from "vue";
2
+ import { useConfig as y } from "../../../composables/useConfig.js";
3
+ import { useExport as g } from "../../../composables/useExport.js";
4
+ import { useSaveStart as h, useSaveComplete as H } from "../../../composables/useGuidoActions.js";
5
+ import { useTranslations as _ } from "../../../composables/useTranslations.js";
6
6
  import { useVersionHistoryApi as T } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as O } from "../../../stores/editor.js";
8
- import { usePreviewStore as g } from "../../../stores/preview.js";
9
- import { useTemplatePreparation as x } from "../../../utils/templatePreparation.js";
10
- import { getTooltipOptions as C } from "../../../utils/tooltipUtils.js";
11
- import { InButtonV2 as D } from "@useinsider/design-system-vue";
12
- const z = /* @__PURE__ */ y({
7
+ import { useEditorStore as V } from "../../../stores/editor.js";
8
+ import { useTemplatePreparation as w } from "../../../utils/templatePreparation.js";
9
+ import { getTooltipOptions as x } from "../../../utils/tooltipUtils.js";
10
+ import { InButtonV2 as C } from "@useinsider/design-system-vue";
11
+ const q = /* @__PURE__ */ v({
13
12
  __name: "RightSlot",
14
- setup(A) {
15
- const { config: m } = H(), { exportHtml: c } = V(), r = _(), s = h(), { openVersionHistory: i, closeVersionHistory: n } = T(), e = O(), o = w(), a = g(), l = () => {
16
- if (e.isVersionHistoryOpen) {
17
- n();
13
+ setup(O) {
14
+ const { config: p } = y(), { exportHtml: m } = g(), s = h(), n = H(), { openVersionHistory: i, closeVersionHistory: a } = T(), t = V(), e = _(), o = S(!1), l = () => {
15
+ if (t.isVersionHistoryOpen) {
16
+ a();
18
17
  return;
19
18
  }
20
19
  i();
21
- }, f = () => {
22
- e.isSaveAsTemplateDrawerOpen = !0;
23
- }, u = p(() => e.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), v = async () => {
24
- r();
20
+ }, c = () => {
21
+ t.isSaveAsTemplateDrawerOpen = !0;
22
+ }, f = d(() => t.isVersionHistoryOpen ? e("newsletter.close-version-history") : e("newsletter.version-history"));
23
+ return { __sfc: !0, config: p, exportHtml: m, saveStart: s, saveComplete: n, openVersionHistory: i, closeVersionHistory: a, editorStore: t, trans: e, isSaving: o, handleVersionHistory: l, handleSaveAs: c, versionHistoryTooltipText: f, handleSave: async () => {
24
+ o.value = !0, t.loadingStatus = !0, s();
25
25
  try {
26
- const { prepareTemplateDetails: t } = x(), d = await t();
27
- s(d);
28
- } catch (t) {
29
- console.error("Failed to get template data for save:", t);
26
+ const { prepareTemplateDetails: r } = w(), u = await r();
27
+ n(u), o.value = !1, t.loadingStatus = !1;
28
+ } catch (r) {
29
+ console.error("Failed to get template data for save:", r);
30
30
  }
31
- }, S = p(() => e.isVersionHistoryOpen || a.isPreviewModeOpen);
32
- return { __sfc: !0, config: m, exportHtml: c, saveStart: r, saveComplete: s, openVersionHistory: i, closeVersionHistory: n, editorStore: e, trans: o, previewStore: a, handleVersionHistory: l, handleSaveAs: f, versionHistoryTooltipText: u, handleSave: v, isSaveButtonDisabled: S, getTooltipOptions: C, InButtonV2: D };
31
+ }, getTooltipOptions: x, InButtonV2: C };
33
32
  }
34
33
  });
35
34
  export {
36
- z as default
35
+ q as default
37
36
  };