@useinsider/guido 1.0.2-beta.c50c279 → 1.0.2-beta.c73fe31

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 (78) hide show
  1. package/README.md +1 -36
  2. package/dist/@types/events.d.ts +0 -6
  3. package/dist/@types/generic.d.ts +0 -1
  4. package/dist/components/Guido.vue.d.ts +0 -1
  5. package/dist/components/Guido.vue.js +10 -10
  6. package/dist/components/Guido.vue2.js +43 -50
  7. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  8. package/dist/components/organisms/header/RightSlot.vue2.js +25 -20
  9. package/dist/components/organisms/header/ViewOptions.vue.js +11 -11
  10. package/dist/components/organisms/header/ViewOptions.vue2.js +5 -5
  11. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
  12. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
  13. package/dist/composables/useHtmlCompiler.js +9 -17
  14. package/dist/composables/usePartner.d.ts +0 -1
  15. package/dist/composables/usePartner.js +9 -16
  16. package/dist/composables/useStripo.js +43 -44
  17. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -2
  18. package/dist/enums/defaults.d.ts +1 -6
  19. package/dist/enums/defaults.js +10 -47
  20. package/dist/guido.css +1 -1
  21. package/dist/static/styles/components/wide-panel.css.js +0 -9
  22. package/dist/stores/editor.d.ts +0 -21
  23. package/dist/stores/editor.js +1 -2
  24. package/dist/utils/templatePreparation.js +14 -21
  25. package/package.json +1 -1
  26. package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -2
  27. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +0 -20
  28. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +0 -37
  29. package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -2
  30. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +0 -21
  31. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +0 -83
  32. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -2
  33. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +0 -17
  34. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +0 -30
  35. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -2
  36. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +0 -19
  37. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +0 -43
  38. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -2
  39. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +0 -21
  40. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +0 -74
  41. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -2
  42. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +0 -20
  43. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +0 -37
  44. package/dist/composables/useHtmlValidator.d.ts +0 -3
  45. package/dist/composables/useHtmlValidator.js +0 -120
  46. package/dist/composables/useRecommendation.d.ts +0 -19
  47. package/dist/composables/useRecommendation.js +0 -27
  48. package/dist/composables/useSave.d.ts +0 -3
  49. package/dist/composables/useSave.js +0 -14
  50. package/dist/composables/useStripoEventHandler.d.ts +0 -3
  51. package/dist/composables/useStripoEventHandler.js +0 -20
  52. package/dist/config/compiler/outlookCompilerRules.js +0 -36
  53. package/dist/config/compiler/recommendationCompilerRules.d.ts +0 -2
  54. package/dist/config/compiler/recommendationCompilerRules.js +0 -83
  55. package/dist/config/compiler/socialCompilerRules.d.ts +0 -2
  56. package/dist/config/compiler/socialCompilerRules.js +0 -21
  57. package/dist/config/compiler/unsubscribeCompilerRules.d.ts +0 -2
  58. package/dist/config/compiler/unsubscribeCompilerRules.js +0 -64
  59. package/dist/enums/html-validator.d.ts +0 -6
  60. package/dist/enums/html-validator.js +0 -7
  61. package/dist/enums/onboarding.d.ts +0 -1
  62. package/dist/enums/onboarding.js +0 -8
  63. package/dist/enums/recommendation.d.ts +0 -54
  64. package/dist/enums/recommendation.js +0 -56
  65. package/dist/enums/unsubscribe.d.ts +0 -15
  66. package/dist/enums/unsubscribe.js +0 -17
  67. package/dist/mock/api/user-modal-state.d.ts +0 -2
  68. package/dist/mock/api/validator.d.ts +0 -2
  69. package/dist/services/onboardingApi.d.ts +0 -4
  70. package/dist/services/onboardingApi.js +0 -23
  71. package/dist/static/assets/onboarding-img.svg.js +0 -4
  72. package/dist/static/styles/customEditorStyle.css.js +0 -18
  73. package/dist/stores/onboarding.d.ts +0 -1068
  74. package/dist/stores/onboarding.js +0 -95
  75. package/dist/stores/recommendation.d.ts +0 -10
  76. package/dist/stores/recommendation.js +0 -9
  77. package/dist/stores/unsubscribe.d.ts +0 -8
  78. package/dist/stores/unsubscribe.js +0 -9
package/README.md CHANGED
@@ -16,30 +16,7 @@ npm install @useinsider/guido
16
16
  ```
17
17
  ### Prerequisites
18
18
  🍍 Your project should have `pinia`
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
- ```
19
+
43
20
  ---
44
21
  ## 🚀 Usage
45
22
 
@@ -154,7 +131,6 @@ export default {
154
131
  | `back` | - | Fired when user clicks the back button |
155
132
  | `save:start` | - | Fired when the save process begins |
156
133
  | `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
157
- | `on-change` | void | It Fires once for managing leave modal etc. |
158
134
 
159
135
  ### Guido Exposed Methods
160
136
  ```typescript
@@ -169,16 +145,6 @@ interface GuidoConfig {
169
145
  translationsPath: string;
170
146
  htmlCompilerRules?: CompilerRule[];
171
147
  ignoreDefaultHtmlCompilerRules?: boolean;
172
- useHeader: boolean
173
- emailHeader: {
174
- senderName: string;
175
- subject: string;
176
- };
177
- partner: {
178
- partnerName: string;
179
- productType: number;
180
- messageType: number;
181
- };
182
148
  features: {
183
149
  dynamicContent: boolean;
184
150
  saveAsTemplate: boolean;
@@ -192,7 +158,6 @@ interface GuidoConfig {
192
158
  | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
193
159
  | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
194
160
  | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
195
- | `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
196
161
  | `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
197
162
  | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
198
163
  | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
@@ -1,7 +1 @@
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,7 +13,6 @@ export type GuidoConfig = {
13
13
  translationsPath: string;
14
14
  htmlCompilerRules?: CompilerRule[];
15
15
  ignoreDefaultHtmlCompilerRules?: boolean;
16
- useHeader?: boolean;
17
16
  emailHeader: EmailHeader;
18
17
  partner?: Partner;
19
18
  features?: Features;
@@ -23,7 +23,6 @@ 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;
27
26
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
28
27
  export default _default;
29
28
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,18 +1,18 @@
1
- import a from "./Guido.vue2.js";
1
+ import i from "./Guido.vue2.js";
2
2
  /* empty css */
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), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper), r(e.LoadingWrapper)], 1);
7
- }, s = [], d = /* @__PURE__ */ i(
3
+ import t from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = 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.LoadingWrapper)], 1);
7
+ }, s = [], d = /* @__PURE__ */ t(
8
+ i,
8
9
  a,
9
- t,
10
10
  s,
11
11
  !1,
12
12
  null,
13
- "39783038"
13
+ "3c25e746"
14
14
  );
15
- const v = d.exports;
15
+ const c = d.exports;
16
16
  export {
17
- v as default
17
+ c as default
18
18
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as A, defineAsyncComponent as b, computed as T, watch as W, onMounted as H, onUnmounted as N } from "vue";
2
- import { provideGuidoActions as U } from "../composables/useGuidoActions.js";
3
- import { usePartner as x } from "../composables/usePartner.js";
4
- import { useStripo as M } from "../composables/useStripo.js";
5
- import { DefaultUsername as z, DefaultMessageType as B, DefaultGuidoConfig as F } from "../enums/defaults.js";
6
- import K from "./organisms/base/Toaster.vue.js";
7
- import O from "./organisms/header/HeaderWrapper.vue.js";
8
- import R from "./organisms/LoadingWrapper.vue.js";
9
- import j from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
10
- import { useStripoApi as q } from "../services/stripoApi.js";
11
- import { useDynamicContentStore as J } from "../stores/dynamic-content.js";
12
- import { useEditorStore as Q } from "../stores/editor.js";
13
- import { usePreviewStore as V } from "../stores/preview.js";
14
- import X from "../node_modules/lodash-es/merge.js";
15
- const le = /* @__PURE__ */ A({
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 N } from "../composables/usePartner.js";
4
+ import { useStripo as U } from "../composables/useStripo.js";
5
+ import { DefaultUsername as W, 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/save-as-template/SaveAsTemplateDrawer.vue.js";
10
+ import { useStripoApi as K } from "../services/stripoApi.js";
11
+ import { useDynamicContentStore as R } 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 J from "../node_modules/lodash-es/merge.js";
15
+ const ae = /* @__PURE__ */ I({
16
16
  __name: "Guido",
17
17
  props: {
18
18
  templateId: null,
@@ -26,40 +26,35 @@ const le = /* @__PURE__ */ A({
26
26
  preselectedDynamicContentList: null,
27
27
  guidoConfig: null
28
28
  },
29
- emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change"],
30
- setup(E, { expose: G, emit: t }) {
31
- const o = E, P = b(
29
+ emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
30
+ setup(b, { expose: E, emit: t }) {
31
+ const o = b, T = L(
32
32
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
33
- ), I = b(
34
- () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
35
- ), n = J(), c = Q(), L = V(), r = T(() => c.hasChanges), a = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d, isTestPartner: _ } = x(), {
33
+ ), n = R(), a = j(), G = q(), c = P(() => a.hasChanges), r = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = N(), {
36
34
  templateId: l,
37
35
  userId: p,
38
36
  guidoConfig: u,
39
- html: g = "",
40
- css: f = "",
37
+ html: f = "",
38
+ css: g = "",
41
39
  partnerName: i = m(),
42
40
  productType: s = d(),
43
- messageType: y = B,
44
- username: C = z
41
+ messageType: y = x,
42
+ username: C = W
45
43
  } = o;
46
- window.GuidoConfig = X(F, u), window.GuidoConfig.partner = {
44
+ window.GuidoConfig = J(M, u), window.GuidoConfig.partner = {
47
45
  partnerName: i,
48
46
  productType: s,
49
47
  messageType: y
50
48
  };
51
- const { initPlugin: v } = M({
49
+ const { initPlugin: v } = U({
52
50
  emailId: l,
53
51
  userId: p,
54
52
  username: C,
55
53
  partnerName: i,
56
54
  productType: s,
57
- preselectedDynamicContentList: a
58
- }), { getDefaultTemplate: w } = q(), k = T(() => {
59
- var e;
60
- return !((e = window.GuidoConfig) != null && e.useHeader);
61
- });
62
- U({
55
+ preselectedDynamicContentList: r
56
+ }), { getDefaultTemplate: w } = K();
57
+ A({
63
58
  onBack: () => {
64
59
  console.debug("guido:back"), t("back");
65
60
  },
@@ -70,41 +65,39 @@ const le = /* @__PURE__ */ A({
70
65
  console.debug("guido:save:complete", e), t("save:complete", e);
71
66
  }
72
67
  });
73
- const h = (e) => {
68
+ const D = (e) => {
74
69
  console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
75
- }, D = () => {
70
+ }, S = () => {
76
71
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
77
72
  };
78
- return W(() => r.value, () => {
79
- t("on-change");
80
- }), H(async () => {
73
+ return _(async () => {
81
74
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
82
75
  try {
83
76
  let e = {
84
- html: g,
85
- css: f,
77
+ html: f,
78
+ css: g,
86
79
  forceRecreate: !0
87
80
  // TODO: It should be false for old templates. We will communicate with Stripo
88
81
  };
89
- e.html || (e = await w()), await v(e), n.selectedDynamicContentList = a;
82
+ e.html || (e = await w()), await v(e), n.selectedDynamicContentList = r;
90
83
  } catch (e) {
91
84
  console.error("Failed to initialize Stripo editor:", e);
92
85
  }
93
86
  document.addEventListener("dynamic-content:open", (e) => {
94
- const S = e;
95
- console.debug("dynamic-content:open", S.detail), t("dynamic-content:open", S.detail);
87
+ const h = e;
88
+ console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
96
89
  });
97
- }), N(() => {
90
+ }), k(() => {
98
91
  window.UIEditor.removeEditor();
99
- }), G({
92
+ }), E({
100
93
  dynamicContent: {
101
- insert: h,
102
- close: D
94
+ insert: D,
95
+ close: S
103
96
  },
104
- hasChanges: r
105
- }), { __sfc: !0, PreviewContainer: P, OnboardingWrapper: I, dynamicContentStore: n, props: o, editorStore: c, previewStore: L, hasChanges: r, preselectedDynamicContentList: a, getPartnerName: m, getProductType: d, isTestPartner: _, templateId: l, userId: p, guidoConfig: u, html: g, css: f, partnerName: i, productType: s, messageType: y, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, noHeader: k, insertDynamicContent: h, closeDynamicContent: D, Toaster: K, HeaderWrapper: O, LoadingWrapper: R, SaveAsTemplateDrawer: j };
97
+ hasChanges: c
98
+ }), { __sfc: !0, PreviewContainer: T, dynamicContentStore: n, props: o, editorStore: a, previewStore: G, hasChanges: c, preselectedDynamicContentList: r, getPartnerName: m, getProductType: d, templateId: l, userId: p, 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, SaveAsTemplateDrawer: H };
106
99
  }
107
100
  });
108
101
  export {
109
- le as default
102
+ ae as default
110
103
  };
@@ -3,7 +3,7 @@ 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, "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: 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, "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
7
  }, r = [], d = /* @__PURE__ */ a(
8
8
  n,
9
9
  l,
@@ -1,31 +1,36 @@
1
- import { defineComponent as v, ref as p, computed as d } from "vue";
1
+ import { defineComponent as v, ref as S, computed as d } from "vue";
2
2
  import { useConfig as y } from "../../../composables/useConfig.js";
3
- import { useExport as S } from "../../../composables/useExport.js";
4
- import { useSave as g } from "../../../composables/useSave.js";
5
- import { useTranslations as h } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as H } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as _ } from "../../../stores/editor.js";
8
- import { getTooltipOptions as V } from "../../../utils/tooltipUtils.js";
9
- import { InButtonV2 as x } from "@useinsider/design-system-vue";
10
- const j = /* @__PURE__ */ v({
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
+ import { useVersionHistoryApi as T } from "../../../composables/useVersionHistoryApi.js";
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({
11
12
  __name: "RightSlot",
12
- setup(w) {
13
- const { config: l } = y(), { exportHtml: r } = S(), { save: n } = g(), { openVersionHistory: i, closeVersionHistory: a } = H(), o = _(), t = h(), e = p(!1), s = p(!1), m = () => {
14
- if (o.isVersionHistoryOpen) {
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) {
15
16
  a();
16
17
  return;
17
18
  }
18
19
  i();
19
- }, u = async () => {
20
- e.value = !0, await r(), e.value = !1;
21
20
  }, c = () => {
22
- o.isSaveAsTemplateDrawerOpen = !0;
23
- }, f = d(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history"));
24
- return { __sfc: !0, config: l, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: m, handleExport: u, handleSaveAs: c, versionHistoryTooltipText: f, handleSave: async () => {
25
- s.value = !0, o.loadingStatus = !0, await n(), s.value = !1, o.loadingStatus = !1;
26
- }, getTooltipOptions: V, InButtonV2: x };
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
+ try {
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
+ }
31
+ }, getTooltipOptions: x, InButtonV2: C };
27
32
  }
28
33
  });
29
34
  export {
30
- j as default
35
+ q as default
31
36
  };
@@ -1,18 +1,18 @@
1
- import i from "./ViewOptions.vue2.js";
1
+ import o from "./ViewOptions.vue2.js";
2
2
  /* empty css */
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,
9
- n,
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,
10
9
  r,
10
+ n,
11
11
  !1,
12
12
  null,
13
- "195ab6d4"
13
+ "ad3cf7cc"
14
14
  );
15
- const c = a.exports;
15
+ const m = _.exports;
16
16
  export {
17
- c as default
17
+ m as default
18
18
  };
@@ -2,10 +2,10 @@ import { defineComponent as n } from "vue";
2
2
  import { useTranslations as p } from "../../../composables/useTranslations.js";
3
3
  import { useEditorStore as s } from "../../../stores/editor.js";
4
4
  import { getTooltipOptions as o } from "../../../utils/tooltipUtils.js";
5
- import { InChips as r, InSegments as m } from "@useinsider/design-system-vue";
6
- const f = /* @__PURE__ */ n({
5
+ import { InSegments as r } from "@useinsider/design-system-vue";
6
+ const d = /* @__PURE__ */ n({
7
7
  __name: "ViewOptions",
8
- setup(l) {
8
+ setup(m) {
9
9
  const e = s(), t = p(), i = [
10
10
  {
11
11
  text: "",
@@ -26,9 +26,9 @@ const f = /* @__PURE__ */ n({
26
26
  tooltipOptions: o("guido__view-option-mobile")
27
27
  }
28
28
  ];
29
- return { __sfc: !0, editorStore: e, trans: t, segmentList: i, InSegments: m, InChips: r };
29
+ return { __sfc: !0, editorStore: e, trans: t, segmentList: i, InSegments: r };
30
30
  }
31
31
  });
32
32
  export {
33
- f as default
33
+ d as default
34
34
  };
@@ -1,18 +1,18 @@
1
- import i from "./ViewOptions.vue2.js";
1
+ import s from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var s = this, t = s._self._c, e = s._self._setupProxy;
6
- return t("div", { staticClass: "view-options-wrapper" }, [t(e.InSegments, { attrs: { id: "guido__verion-history-view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.versionHistoryStore.editorVisualMode }, on: { click: e.changeVisualMode } }), t(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,
9
- n,
3
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, o = t._self._c, e = t._self._setupProxy;
6
+ return o(e.InSegments, { attrs: { id: "guido__verion-history-view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.versionHistoryStore.editorVisualMode }, on: { click: e.changeVisualMode } });
7
+ }, n = [], _ = /* @__PURE__ */ i(
8
+ s,
10
9
  r,
10
+ n,
11
11
  !1,
12
12
  null,
13
- "d405ca59"
13
+ "421ffc13"
14
14
  );
15
- const d = a.exports;
15
+ const f = _.exports;
16
16
  export {
17
- d as default
17
+ f as default
18
18
  };
@@ -3,10 +3,10 @@ import { useTranslations as m } from "../../../../composables/useTranslations.js
3
3
  import { useVersionHistoryApi as l } from "../../../../composables/useVersionHistoryApi.js";
4
4
  import { useVersionHistoryStore as a } from "../../../../stores/version-history.js";
5
5
  import { getTooltipOptions as n } from "../../../../utils/tooltipUtils.js";
6
- import { InChips as c, InSegments as u } from "@useinsider/design-system-vue";
7
- const T = /* @__PURE__ */ p({
6
+ import { InSegments as c } from "@useinsider/design-system-vue";
7
+ const h = /* @__PURE__ */ p({
8
8
  __name: "ViewOptions",
9
- setup(_) {
9
+ setup(u) {
10
10
  const t = a(), { switchToDesktopPreview: e, switchToMobilePreview: i } = l(), o = m(), r = [
11
11
  {
12
12
  text: "",
@@ -33,9 +33,9 @@ const T = /* @__PURE__ */ p({
33
33
  return;
34
34
  }
35
35
  e();
36
- }, InSegments: u, InChips: c };
36
+ }, InSegments: c };
37
37
  }
38
38
  });
39
39
  export {
40
- T as default
40
+ h as default
41
41
  };
@@ -1,25 +1,17 @@
1
- import { defaultHtmlCompilerRules as t } from "../config/compiler/htmlCompilerRules.js";
2
- import { outlookCompilerRules as p } from "../config/compiler/outlookCompilerRules.js";
3
- import { recommendationCompilerRules as s } from "../config/compiler/recommendationCompilerRules.js";
4
- import { socialCompilerRules as u } from "../config/compiler/socialCompilerRules.js";
5
- import { unsubscribeCompilerRules as n } from "../config/compiler/unsubscribeCompilerRules.js";
6
- import { createHtmlCompiler as c } from "../utils/htmlCompiler.js";
7
- import { useConfig as f } from "./useConfig.js";
8
- const h = () => {
9
- const { config: e } = f(), l = e.htmlCompilerRules || [], m = [
10
- ...!!e.ignoreDefaultHtmlCompilerRules ? [] : t,
11
- ...s,
12
- ...n,
13
- ...p,
14
- ...u,
1
+ import { defaultHtmlCompilerRules as r } from "../config/compiler/htmlCompilerRules.js";
2
+ import { createHtmlCompiler as p } from "../utils/htmlCompiler.js";
3
+ import { useConfig as s } from "./useConfig.js";
4
+ const R = () => {
5
+ const { config: e } = s(), l = e.htmlCompilerRules || [], t = [
6
+ ...!!e.ignoreDefaultHtmlCompilerRules ? [] : r,
15
7
  ...l.map((o, i) => ({
16
8
  ...o,
17
9
  priority: o.priority + 1e3 + i
18
10
  // Ensure additional rules run after default rules
19
11
  }))
20
- ], r = c(m);
21
- return { compileHtml: (o) => r.compile(o) };
12
+ ], m = p(t);
13
+ return { compileHtml: (o) => m.compile(o) };
22
14
  };
23
15
  export {
24
- h as useHtmlCompiler
16
+ R as useHtmlCompiler
25
17
  };
@@ -1,5 +1,4 @@
1
1
  export declare const usePartner: () => {
2
2
  getPartnerName: () => string;
3
3
  getProductType: () => number;
4
- isTestPartner: () => boolean;
5
4
  };
@@ -1,18 +1,11 @@
1
- import { TEST_PARTNER_LIST as r, DefaultProductType as o, ProductIds as n } from "../enums/defaults.js";
2
- const i = () => {
3
- const e = () => window.location.hostname.split(".")[0] || "";
4
- return {
5
- getPartnerName: e,
6
- getProductType: () => {
7
- const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
8
- return n[t] || 0;
9
- },
10
- isTestPartner: () => {
11
- const t = e();
12
- return r.includes(t);
13
- }
14
- };
15
- };
1
+ import { DefaultProductType as e, ProductIds as o } from "../enums/defaults.js";
2
+ const c = () => ({
3
+ getPartnerName: () => window.location.hostname.split(".")[0] || "",
4
+ getProductType: () => {
5
+ const t = window.location.pathname.split("/").filter(Boolean)[0] || e;
6
+ return o[t] || 0;
7
+ }
8
+ });
16
9
  export {
17
- i as usePartner
10
+ c as usePartner
18
11
  };