@useinsider/guido 1.0.2-beta.4d8bf90 → 1.0.2-beta.4e8474b

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 (86) hide show
  1. package/README.md +43 -1
  2. package/dist/@types/events.d.ts +6 -0
  3. package/dist/@types/generic.d.ts +5 -0
  4. package/dist/components/Guido.vue.d.ts +3 -0
  5. package/dist/components/Guido.vue.js +10 -10
  6. package/dist/components/Guido.vue2.js +80 -63
  7. package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
  8. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +3 -2
  9. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -15
  10. package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +3 -1
  11. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  12. package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -9
  13. package/dist/components/organisms/header/RightSlot.vue.d.ts +3 -1
  14. package/dist/components/organisms/header/RightSlot.vue.js +5 -3
  15. package/dist/components/organisms/header/RightSlot.vue2.js +25 -27
  16. package/dist/components/organisms/header/ViewOptions.vue.js +11 -11
  17. package/dist/components/organisms/header/ViewOptions.vue2.js +5 -5
  18. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
  19. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
  20. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +13 -13
  21. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +21 -23
  22. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +14 -14
  23. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +26 -28
  24. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +1 -1
  25. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +38 -21
  26. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +13 -13
  27. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +38 -28
  28. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +14 -14
  29. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +21 -23
  30. package/dist/components/wrappers/WpDrawer.vue.d.ts +1 -1
  31. package/dist/components/wrappers/WpModal.vue.d.ts +1 -1
  32. package/dist/composables/useCustomInterfaceAppearance.js +22 -18
  33. package/dist/composables/useHtmlCompiler.js +17 -9
  34. package/dist/composables/useHtmlValidator.d.ts +3 -0
  35. package/dist/composables/useHtmlValidator.js +120 -0
  36. package/dist/composables/usePartner.d.ts +1 -0
  37. package/dist/composables/usePartner.js +16 -9
  38. package/dist/composables/usePreviewMode.js +14 -15
  39. package/dist/composables/useRecommendation.d.ts +19 -0
  40. package/dist/composables/useRecommendation.js +27 -0
  41. package/dist/composables/useSave.d.ts +4 -0
  42. package/dist/composables/useSave.js +15 -0
  43. package/dist/composables/useStripo.js +32 -31
  44. package/dist/composables/useStripoEventHandler.js +8 -8
  45. package/dist/composables/useToaster.js +17 -17
  46. package/dist/config/compiler/outlookCompilerRules.d.ts +2 -0
  47. package/dist/config/compiler/outlookCompilerRules.js +36 -0
  48. package/dist/config/compiler/recommendationCompilerRules.d.ts +2 -0
  49. package/dist/config/compiler/recommendationCompilerRules.js +83 -0
  50. package/dist/config/compiler/socialCompilerRules.d.ts +2 -0
  51. package/dist/config/compiler/socialCompilerRules.js +21 -0
  52. package/dist/config/compiler/unsubscribeCompilerRules.d.ts +2 -0
  53. package/dist/config/compiler/unsubscribeCompilerRules.js +64 -0
  54. package/dist/enums/defaults.d.ts +6 -1
  55. package/dist/enums/defaults.js +47 -10
  56. package/dist/enums/html-validator.d.ts +6 -0
  57. package/dist/enums/html-validator.js +7 -0
  58. package/dist/enums/recommendation.d.ts +54 -0
  59. package/dist/enums/recommendation.js +56 -0
  60. package/dist/enums/unsubscribe.d.ts +15 -0
  61. package/dist/enums/unsubscribe.js +17 -0
  62. package/dist/guido.css +1 -1
  63. package/dist/mock/api/validator.d.ts +2 -0
  64. package/dist/services/onboardingApi.d.ts +4 -0
  65. package/dist/services/onboardingApi.js +23 -0
  66. package/dist/static/styles/components/alert-message.css.js +32 -2
  67. package/dist/static/styles/components/button.css.js +32 -2
  68. package/dist/static/styles/components/notification.css.js +55 -0
  69. package/dist/static/styles/components/popup.css.js +68 -0
  70. package/dist/static/styles/components/wide-panel.css.js +13 -0
  71. package/dist/static/styles/customEditorStyle.css.js +24 -0
  72. package/dist/static/styles/variables.css.js +10 -0
  73. package/dist/stores/dynamic-content.d.ts +12 -0
  74. package/dist/stores/dynamic-content.js +7 -6
  75. package/dist/stores/onboarding.d.ts +133 -592
  76. package/dist/stores/onboarding.js +38 -55
  77. package/dist/stores/preview.js +6 -14
  78. package/dist/stores/recommendation.d.ts +10 -0
  79. package/dist/stores/recommendation.js +9 -0
  80. package/dist/stores/unsubscribe.d.ts +8 -0
  81. package/dist/stores/unsubscribe.js +9 -0
  82. package/dist/utils/genericUtil.js +9 -6
  83. package/dist/utils/templatePreparation.js +21 -14
  84. package/package.json +4 -2
  85. package/dist/composables/useOnboardingApi.d.ts +0 -4
  86. package/dist/composables/useOnboardingApi.js +0 -23
package/README.md CHANGED
@@ -16,7 +16,30 @@ npm install @useinsider/guido
16
16
  ```
17
17
  ### Prerequisites
18
18
  🍍 Your project should have `pinia`
19
-
19
+ You need to be sure those lines added in your config file:
20
+
21
+ ℹ️ It helps to optimize your dependencies and sharing by Guido. This is why Guido pretty fast and tiny.
22
+
23
+ #### For Webpack
24
+ `/webpack.config.js` or `/vue.config.js`
25
+ ```js
26
+ // ... Previous Configs
27
+ shared: {
28
+ vue: { singleton: true },
29
+ pinia: { singleton: true },
30
+ },
31
+ // ... Upcoming Configs
32
+ ```
33
+
34
+ ##### For Vite:
35
+ `/vite.config.js`
36
+ ```js
37
+ // ... Previous Configs
38
+ resolve: {
39
+ dedupe: ['vue', 'pinia'],
40
+ },
41
+ // ... Upcoming Configs
42
+ ```
20
43
  ---
21
44
  ## 🚀 Usage
22
45
 
@@ -102,6 +125,11 @@ export default {
102
125
  // ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
103
126
  handleDynamicContentClose() {
104
127
  this.$refs.guidoEditor?.dynamicContent.close();
128
+ },
129
+
130
+ // If you need to trigger save manually like leave modal cases, you can use this method.
131
+ save () {
132
+ this.$refs.guidoEditor?.saveSilent();
105
133
  }
106
134
  }
107
135
  };
@@ -131,11 +159,14 @@ export default {
131
159
  | `back` | - | Fired when user clicks the back button |
132
160
  | `save:start` | - | Fired when the save process begins |
133
161
  | `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
162
+ | `on-change` | void | It Fires once for managing leave modal etc. |
163
+ | `ready` | void | Fired when the editor is ready and template is loaded |
134
164
 
135
165
  ### Guido Exposed Methods
136
166
  ```typescript
137
167
  dynamicContent.insert(DynamicContent);
138
168
  dynamicContent.close();
169
+ saveSilent();
139
170
  ```
140
171
 
141
172
  ### Guido Interfaces
@@ -145,6 +176,16 @@ interface GuidoConfig {
145
176
  translationsPath: string;
146
177
  htmlCompilerRules?: CompilerRule[];
147
178
  ignoreDefaultHtmlCompilerRules?: boolean;
179
+ useHeader: boolean
180
+ emailHeader: {
181
+ senderName: string;
182
+ subject: string;
183
+ };
184
+ partner: {
185
+ partnerName: string;
186
+ productType: number;
187
+ messageType: number;
188
+ };
148
189
  features: {
149
190
  dynamicContent: boolean;
150
191
  saveAsTemplate: boolean;
@@ -158,6 +199,7 @@ interface GuidoConfig {
158
199
  | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
159
200
  | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
160
201
  | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
202
+ | `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
161
203
  | `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
162
204
  | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
163
205
  | `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;
@@ -21,6 +22,10 @@ export type DynamicContent = {
21
22
  value: string;
22
23
  text: string;
23
24
  fallback?: string;
25
+ format?: {
26
+ key: string;
27
+ value: string;
28
+ };
24
29
  };
25
30
  export interface EmailHeader {
26
31
  senderName: string;
@@ -18,11 +18,14 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
18
18
  close: () => void;
19
19
  };
20
20
  hasChanges: import("vue").ComputedRef<boolean>;
21
+ saveSilent: () => Promise<SavedTemplateDetails | undefined> | undefined;
21
22
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
22
23
  "dynamic-content:open": (detail: DynamicContent | null) => void;
23
24
  back: () => void;
24
25
  "save:start": () => void;
25
26
  "save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
27
+ "on-change": (hasChanges: boolean) => void;
28
+ ready: () => void;
26
29
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
27
30
  export default _default;
28
31
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,18 +1,18 @@
1
- import i from "./Guido.vue2.js";
1
+ import a from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
4
- var t = function() {
5
- var o = this, e = o._self._c, r = o._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.editorStore.isPreviewModeOpen ? e(r.PreviewContainer) : o._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.Toaster), e(r.SaveAsTemplateDrawer), e(r.OnboardingWrapper), e(r.LoadingWrapper)], 1);
7
- }, s = [], n = /* @__PURE__ */ a(
8
- i,
9
- t,
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = 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, { ref: "headerWrapperRef" }), 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), !e.isTestPartner() && !e.isDevMode ? r(e.OnboardingWrapper) : o._e(), r(e.LoadingWrapper)], 1);
7
+ }, t = [], d = /* @__PURE__ */ i(
8
+ a,
10
9
  s,
10
+ t,
11
11
  !1,
12
12
  null,
13
- "649c8c66"
13
+ "cebb8ab0"
14
14
  );
15
- const v = n.exports;
15
+ const v = d.exports;
16
16
  export {
17
17
  v as default
18
18
  };
@@ -1,19 +1,18 @@
1
- import { defineComponent as I, defineAsyncComponent as L, computed as P, onMounted as _, onUnmounted as k } from "vue";
2
- import { provideGuidoActions as A } from "../composables/useGuidoActions.js";
3
- import { usePartner as W } from "../composables/usePartner.js";
4
- import { useStripo as N } from "../composables/useStripo.js";
5
- import { DefaultUsername as U, DefaultMessageType as x, DefaultGuidoConfig as M } 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/LoadingWrapper.vue.js";
9
- import H from "./organisms/onboarding/OnboardingWrapper.vue.js";
10
- import K from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
11
- import { useStripoApi as O } from "../services/stripoApi.js";
12
- import { useDynamicContentStore as R } from "../stores/dynamic-content.js";
13
- import { useEditorStore as j } from "../stores/editor.js";
14
- import { usePreviewStore as q } from "../stores/preview.js";
15
- import J from "../node_modules/lodash-es/merge.js";
16
- const me = /* @__PURE__ */ I({
1
+ import { defineComponent as H, defineAsyncComponent as G, ref as M, computed as c, watch as R, onMounted as U, onUnmounted as x } from "vue";
2
+ import { provideGuidoActions as F } from "../composables/useGuidoActions.js";
3
+ import { usePartner as z } from "../composables/usePartner.js";
4
+ import { useStripo as B } from "../composables/useStripo.js";
5
+ import { DefaultUsername as K, DefaultMessageType as O, DefaultGuidoConfig as j } from "../enums/defaults.js";
6
+ import q from "./organisms/base/Toaster.vue.js";
7
+ import J from "./organisms/header/HeaderWrapper.vue.js";
8
+ import Q from "./organisms/LoadingWrapper.vue.js";
9
+ import V from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
10
+ import { useStripoApi as X } from "../services/stripoApi.js";
11
+ import { useDynamicContentStore as Y } from "../stores/dynamic-content.js";
12
+ import { useEditorStore as Z } from "../stores/editor.js";
13
+ import { usePreviewStore as $ } from "../stores/preview.js";
14
+ import ee from "../node_modules/lodash-es/merge.js";
15
+ const fe = /* @__PURE__ */ H({
17
16
  __name: "Guido",
18
17
  props: {
19
18
  templateId: null,
@@ -27,78 +26,96 @@ const me = /* @__PURE__ */ I({
27
26
  preselectedDynamicContentList: null,
28
27
  guidoConfig: null
29
28
  },
30
- emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
31
- setup(b, { expose: E, emit: t }) {
32
- const o = b, T = L(
29
+ emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready"],
30
+ setup(P, { expose: I, emit: o }) {
31
+ const n = P, L = G(
33
32
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
34
- ), n = R(), a = j(), G = q(), c = P(() => a.hasChanges), r = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = W(), {
35
- templateId: p,
36
- userId: l,
37
- guidoConfig: u,
38
- html: f = "",
39
- css: g = "",
40
- partnerName: i = m(),
41
- productType: s = d(),
42
- messageType: y = x,
43
- username: C = U
44
- } = o;
45
- window.GuidoConfig = J(M, u), window.GuidoConfig.partner = {
46
- partnerName: i,
47
- productType: s,
48
- messageType: y
33
+ ), _ = G(
34
+ () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
35
+ ), d = M(), r = Y(), m = Z(), W = $(), t = c(() => m.hasChanges), a = n.preselectedDynamicContentList || [], { getPartnerName: l, getProductType: u, isTestPartner: k } = z(), A = c(() => !1), p = () => {
36
+ var e;
37
+ return (e = d.value) == null ? void 0 : e.handleSave(!0);
38
+ }, {
39
+ templateId: g,
40
+ userId: f,
41
+ guidoConfig: y,
42
+ html: v = "",
43
+ css: C = "",
44
+ partnerName: s = l(),
45
+ productType: i = u(),
46
+ messageType: h = O,
47
+ username: w = K
48
+ } = n;
49
+ window.GuidoConfig = ee(j, y), window.GuidoConfig.partner = {
50
+ partnerName: s,
51
+ productType: i,
52
+ messageType: h
49
53
  };
50
- const { initPlugin: v } = N({
51
- emailId: p,
52
- userId: l,
53
- username: C,
54
- partnerName: i,
55
- productType: s,
56
- preselectedDynamicContentList: r
57
- }), { getDefaultTemplate: w } = O();
58
- A({
54
+ const { initPlugin: S } = B({
55
+ emailId: g,
56
+ userId: f,
57
+ username: w,
58
+ partnerName: s,
59
+ productType: i,
60
+ preselectedDynamicContentList: a,
61
+ onReady: () => {
62
+ console.debug("guido:ready"), o("ready");
63
+ }
64
+ }), { getDefaultTemplate: D } = X(), N = c(() => {
65
+ var e;
66
+ return !((e = window.GuidoConfig) != null && e.useHeader);
67
+ });
68
+ F({
59
69
  onBack: () => {
60
- console.debug("guido:back"), t("back");
70
+ console.debug("guido:back"), o("back");
61
71
  },
62
72
  onSaveStart: () => {
63
- console.debug("guido:save:start"), t("save:start");
73
+ console.debug("guido:save:start"), o("save:start");
64
74
  },
65
75
  onSaveComplete: (e) => {
66
- console.debug("guido:save:complete", e), t("save:complete", e);
76
+ console.debug("guido:save:complete", e), o("save:complete", e);
67
77
  }
68
78
  });
69
- const D = (e) => {
70
- console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
71
- }, S = () => {
79
+ const b = (e) => {
80
+ console.debug("dynamic-content:close", e), r.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
81
+ }, T = () => {
72
82
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
73
83
  };
74
- return _(async () => {
84
+ return R(() => t.value, () => {
85
+ o("on-change", t.value);
86
+ }), U(async () => {
75
87
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
76
88
  try {
77
89
  let e = {
78
- html: f,
79
- css: g,
90
+ html: v,
91
+ css: C,
80
92
  forceRecreate: !0
81
93
  // TODO: It should be false for old templates. We will communicate with Stripo
82
94
  };
83
- e.html || (e = await w()), await v(e), n.selectedDynamicContentList = r;
95
+ e.html || (e = await D()), await S(e), r.selectedDynamicContentList = a;
84
96
  } catch (e) {
85
97
  console.error("Failed to initialize Stripo editor:", e);
86
98
  }
87
99
  document.addEventListener("dynamic-content:open", (e) => {
88
- const h = e;
89
- console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
100
+ const E = e;
101
+ console.debug("dynamic-content:open", E.detail), o("dynamic-content:open", E.detail);
90
102
  });
91
- }), k(() => {
92
- window.UIEditor.removeEditor();
93
- }), E({
103
+ }), x(() => {
104
+ try {
105
+ window.UIEditor.removeEditor();
106
+ } catch {
107
+ console.debug("Failed to remove Stripo editor: No editor found");
108
+ }
109
+ }), I({
94
110
  dynamicContent: {
95
- insert: D,
96
- close: S
111
+ insert: b,
112
+ close: T
97
113
  },
98
- hasChanges: c
99
- }), { __sfc: !0, PreviewContainer: T, dynamicContentStore: n, props: o, editorStore: a, previewStore: G, hasChanges: c, preselectedDynamicContentList: r, getPartnerName: m, getProductType: d, templateId: p, userId: l, guidoConfig: u, html: f, css: g, partnerName: i, productType: s, messageType: y, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, insertDynamicContent: D, closeDynamicContent: S, Toaster: z, HeaderWrapper: B, LoadingWrapper: F, OnboardingWrapper: H, SaveAsTemplateDrawer: K };
114
+ hasChanges: t,
115
+ saveSilent: p
116
+ }), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: _, headerWrapperRef: d, dynamicContentStore: r, props: n, editorStore: m, previewStore: W, hasChanges: t, preselectedDynamicContentList: a, getPartnerName: l, getProductType: u, isTestPartner: k, isDevMode: A, saveSilent: p, templateId: g, userId: f, guidoConfig: y, html: v, css: C, partnerName: s, productType: i, messageType: h, username: w, emit: o, initPlugin: S, getDefaultTemplate: D, noHeader: N, insertDynamicContent: b, closeDynamicContent: T, Toaster: q, HeaderWrapper: J, LoadingWrapper: Q, SaveAsTemplateDrawer: V };
100
117
  }
101
118
  });
102
119
  export {
103
- me as default
120
+ fe as default
104
121
  };
@@ -10,7 +10,7 @@ var s = function() {
10
10
  n,
11
11
  !1,
12
12
  null,
13
- "2d4cd446"
13
+ "dced5582"
14
14
  );
15
15
  const l = _.exports;
16
16
  export {
@@ -1,8 +1,9 @@
1
1
  import o from "./AmpToggle.vue2.js";
2
+ /* empty css */
2
3
  import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
4
  var s = function() {
4
5
  var r = this, t = r._self._c, e = r._self._setupProxy;
5
- return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-2 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(c) {
6
+ return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-2 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(l) {
6
7
  return e.previewStore.openErrorModal();
7
8
  } } }) : r._e()], 1)]);
8
9
  }, a = [], i = /* @__PURE__ */ n(
@@ -11,7 +12,7 @@ var s = function() {
11
12
  a,
12
13
  !1,
13
14
  null,
14
- null
15
+ "b5997368"
15
16
  );
16
17
  const d = i.exports;
17
18
  export {
@@ -1,30 +1,29 @@
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({
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({
7
6
  __name: "AmpToggle",
8
- setup(u) {
9
- const t = p(), e = s(), o = m(), a = i(() => [
7
+ setup(p) {
8
+ const t = i(), e = r(), o = n(() => [
10
9
  {
11
- text: o("dynamic-creatives.html"),
10
+ text: e("dynamic-creatives.html"),
12
11
  value: "html"
13
12
  },
14
13
  {
15
- text: o("email-editor.amp-html"),
14
+ text: e("email-editor.amp-html"),
16
15
  value: "AMP",
17
- tooltipText: t.hasAMP ? "" : o("email-editor.preview-amp-unavailable-tooltip"),
16
+ tooltipText: t.hasAMP ? "" : e("email-editor.preview-amp-unavailable-tooltip"),
18
17
  position: "bottom",
19
18
  align: "center",
20
19
  disable: !t.hasAMP
21
20
  }
22
21
  ]);
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 };
22
+ return { __sfc: !0, previewStore: t, trans: e, segmentList: o, handleFormatChange: (a) => {
23
+ t.setEmailFormat(a);
24
+ }, InSegments: l, InButtonV2: s };
26
25
  }
27
26
  });
28
27
  export {
29
- v as default
28
+ _ as default
30
29
  };
@@ -1,2 +1,4 @@
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<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo.js").SavedTemplateDetails | undefined> | undefined;
3
+ }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
4
  export default _default;
@@ -1,17 +1,17 @@
1
- import t from "./HeaderWrapper.vue2.js";
1
+ import o from "./HeaderWrapper.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var o = this, r = o._self._c, e = o._self._setupProxy;
5
- return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot)], 1)]);
4
+ var t = this, r = t._self._c, e = t._self._setupProxy;
5
+ return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot, { ref: "rightSlotRef" })], 1)]);
6
6
  }, a = [], _ = /* @__PURE__ */ s(
7
- t,
7
+ o,
8
8
  n,
9
9
  a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const d = _.exports;
14
+ const c = _.exports;
15
15
  export {
16
- d as default
16
+ c as default
17
17
  };
@@ -1,14 +1,20 @@
1
- import { defineComponent as o } from "vue";
2
- import { InContainer as r } from "@useinsider/design-system-vue";
3
- import t from "./LeftSlot.vue.js";
4
- import e from "./MiddleSlot.vue.js";
5
- import m from "./RightSlot.vue.js";
6
- const s = /* @__PURE__ */ o({
1
+ import { defineComponent as n, ref as m } from "vue";
2
+ import { InContainer as a } from "@useinsider/design-system-vue";
3
+ import f from "./LeftSlot.vue.js";
4
+ import p from "./MiddleSlot.vue.js";
5
+ import i from "./RightSlot.vue.js";
6
+ const c = /* @__PURE__ */ n({
7
7
  __name: "HeaderWrapper",
8
- setup(p) {
9
- return { __sfc: !0, InContainer: r, LeftSlot: t, MiddleSlot: e, RightSlot: m };
8
+ setup(l, { expose: r }) {
9
+ const e = m(null);
10
+ return r({
11
+ handleSave: (t) => {
12
+ var o;
13
+ return (o = e.value) == null ? void 0 : o.handleSave(t);
14
+ }
15
+ }), { __sfc: !0, rightSlotRef: e, InContainer: a, LeftSlot: f, MiddleSlot: p, RightSlot: i };
10
16
  }
11
17
  });
12
18
  export {
13
- s as default
19
+ c as default
14
20
  };
@@ -1,2 +1,4 @@
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<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo").SavedTemplateDetails | undefined>;
3
+ }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
4
  export default _default;
@@ -3,7 +3,9 @@ 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.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);
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, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (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: function(p) {
7
+ return t.handleSave(!1);
8
+ } } })], 1);
7
9
  }, r = [], d = /* @__PURE__ */ a(
8
10
  n,
9
11
  l,
@@ -12,7 +14,7 @@ var l = function() {
12
14
  null,
13
15
  null
14
16
  );
15
- const c = d.exports;
17
+ const g = d.exports;
16
18
  export {
17
- c as default
19
+ g as default
18
20
  };
@@ -1,37 +1,35 @@
1
- import { defineComponent as v, ref as S, computed as g } from "vue";
2
- import { useConfig as y } from "../../../composables/useConfig.js";
3
- import { useExport as H } from "../../../composables/useExport.js";
4
- import { useSaveStart as h, useSaveComplete as O } from "../../../composables/useGuidoActions.js";
5
- import { useTranslations as _ } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as b } from "../../../composables/useVersionHistoryApi.js";
1
+ import { defineComponent as g, ref as l, computed as H } from "vue";
2
+ import { useConfig as _ } from "../../../composables/useConfig.js";
3
+ import { useExport as h } from "../../../composables/useExport.js";
4
+ import { useSave as V } from "../../../composables/useSave.js";
5
+ import { useTranslations as x } from "../../../composables/useTranslations.js";
6
+ import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
7
7
  import { useEditorStore as T } from "../../../stores/editor.js";
8
- import { useOnboardingStore as V } from "../../../stores/onboarding.js";
9
- import { useTemplatePreparation as w } from "../../../utils/templatePreparation.js";
10
- import { getTooltipOptions as x } from "../../../utils/tooltipUtils.js";
11
- import { InButtonV2 as A } from "@useinsider/design-system-vue";
12
- const J = /* @__PURE__ */ v({
8
+ import { getTooltipOptions as E } from "../../../utils/tooltipUtils.js";
9
+ import { InButtonV2 as O } from "@useinsider/design-system-vue";
10
+ const z = /* @__PURE__ */ g({
13
11
  __name: "RightSlot",
14
- setup(C) {
15
- const { config: m } = y(), { exportHtml: l } = H(), n = h(), i = O(), { openVersionHistory: a, closeVersionHistory: p } = b(), o = T(), t = V(), e = _(), r = S(!1), c = () => {
12
+ setup(A, { expose: m }) {
13
+ const { config: u } = _(), { exportHtml: r } = h(), { save: n } = V(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = T(), t = x(), e = l(!1), s = l(!1), c = () => {
16
14
  if (o.isVersionHistoryOpen) {
17
- p(), t.isActive("versionHistoryOnboarding") && t.close("versionHistoryOnboarding");
15
+ a();
18
16
  return;
19
17
  }
20
- a(), t.shouldShowOnboarding("versionHistoryOnboarding") && t.start("versionHistoryOnboarding");
21
- }, f = () => {
18
+ i();
19
+ }, f = async () => {
20
+ e.value = !0, await r(), e.value = !1;
21
+ }, v = () => {
22
22
  o.isSaveAsTemplateDrawerOpen = !0;
23
- }, u = g(() => o.isVersionHistoryOpen ? e("newsletter.close-version-history") : e("newsletter.version-history"));
24
- return { __sfc: !0, config: m, exportHtml: l, saveStart: n, saveComplete: i, openVersionHistory: a, closeVersionHistory: p, editorStore: o, onboardingStore: t, trans: e, isSaving: r, handleVersionHistory: c, handleSaveAs: f, versionHistoryTooltipText: u, handleSave: async () => {
25
- r.value = !0, o.loadingStatus = !0, n();
26
- try {
27
- const { prepareTemplateDetails: s } = w(), d = await s();
28
- i(d), r.value = !1, o.loadingStatus = !1;
29
- } catch (s) {
30
- console.error("Failed to get template data for save:", s);
31
- }
32
- }, getTooltipOptions: x, InButtonV2: A };
23
+ }, d = H(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), p = async (y) => {
24
+ s.value = !0, o.loadingStatus = !0;
25
+ const S = await n(y);
26
+ return s.value = !1, o.loadingStatus = !1, S;
27
+ };
28
+ return m({
29
+ handleSave: p
30
+ }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: c, handleExport: f, handleSaveAs: v, versionHistoryTooltipText: d, handleSave: p, getTooltipOptions: E, InButtonV2: O };
33
31
  }
34
32
  });
35
33
  export {
36
- J as default
34
+ z as default
37
35
  };
@@ -1,18 +1,18 @@
1
- import o from "./ViewOptions.vue2.js";
1
+ import i from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var r = function() {
5
- var t = this, i = t._self._c, e = t._self._setupProxy;
6
- return i(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", disable: e.editorStore.isViewOptionsDisabled, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
- }, n = [], _ = /* @__PURE__ */ s(
8
- o,
9
- r,
3
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var t = this, s = t._self._c, e = t._self._setupProxy;
6
+ return s("div", { staticClass: "view-options-wrapper" }, [s(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", disable: e.editorStore.isViewOptionsDisabled, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } }), e.editorStore.isViewOptionsDisabled ? t._e() : s(e.InChips, { staticClass: "new-tag", attrs: { id: "guido__view-options-new-tag", styles: "stroke", value: "chips", "close-button": !1, interactive: !1, text: e.trans("settings.new") } })], 1);
7
+ }, r = [], a = /* @__PURE__ */ o(
8
+ i,
10
9
  n,
10
+ r,
11
11
  !1,
12
12
  null,
13
- "ad3cf7cc"
13
+ "195ab6d4"
14
14
  );
15
- const m = _.exports;
15
+ const c = a.exports;
16
16
  export {
17
- m as default
17
+ c as default
18
18
  };