@useinsider/guido 1.0.0-beta.9980c81 → 1.0.0-beta.9e097de

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 (45) hide show
  1. package/dist/@types/generic.d.ts +11 -4
  2. package/dist/components/Guido.vue.d.ts +1 -5
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +37 -56
  5. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  6. package/dist/components/organisms/header/MiddleSlot.vue2.js +15 -17
  7. package/dist/components/organisms/header/RightSlot.vue.js +7 -7
  8. package/dist/components/organisms/header/RightSlot.vue2.js +24 -24
  9. package/dist/components/organisms/header/ViewOptions.vue.js +3 -3
  10. package/dist/components/organisms/header/ViewOptions.vue2.js +25 -10
  11. package/dist/composables/useActionsApi.d.ts +1 -2
  12. package/dist/composables/useActionsApi.js +35 -45
  13. package/dist/composables/useHttp.js +21 -23
  14. package/dist/composables/useStripo.js +17 -23
  15. package/dist/extensions/DynamicContent/dynamic-content.js +15 -13
  16. package/dist/guido.css +1 -1
  17. package/dist/stores/editor.d.ts +1 -1
  18. package/dist/stores/editor.js +4 -4
  19. package/dist/utils/tooltipUtils.d.ts +2 -0
  20. package/dist/utils/tooltipUtils.js +11 -0
  21. package/package.json +3 -1
  22. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -16
  23. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -20
  24. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -78
  25. package/dist/components/wrappers/ModalWrapper.vue.d.ts +0 -72
  26. package/dist/components/wrappers/ModalWrapper.vue.js +0 -19
  27. package/dist/components/wrappers/ModalWrapper.vue2.js +0 -43
  28. package/dist/composables/useSaveAsTemplate.d.ts +0 -7
  29. package/dist/composables/useSaveAsTemplate.js +0 -52
  30. package/dist/composables/useTemplateNameValidation.d.ts +0 -7
  31. package/dist/composables/useTemplateNameValidation.js +0 -33
  32. package/dist/mock/api/template-library.d.ts +0 -2
  33. package/dist/stores/dynamic-content.d.ts +0 -27
  34. package/dist/stores/dynamic-content.js +0 -23
  35. package/dist/stores/template-categories.d.ts +0 -41
  36. package/dist/stores/template-categories.js +0 -91
  37. package/dist/utils/arrayUtil.d.ts +0 -1
  38. package/dist/utils/arrayUtil.js +0 -10
  39. package/dist/utils/base64.d.ts +0 -2
  40. package/dist/utils/base64.js +0 -14
  41. package/dist/utils/generic.d.ts +0 -1
  42. package/dist/utils/generic.js +0 -7
  43. package/dist/utils/genericUtil.d.ts +0 -2
  44. package/dist/utils/genericUtil.js +0 -7
  45. package/dist/utils/textUtil.d.ts +0 -2
@@ -9,7 +9,14 @@ export type DynamicContent = {
9
9
  text: string;
10
10
  fallback?: string;
11
11
  };
12
- export type MergeTag = {
13
- label: string;
14
- value: string;
15
- };
12
+ export interface TooltipOptions {
13
+ id: string;
14
+ dynamicPosition: boolean;
15
+ staticPosition: 'top center' | 'top left' | 'top right' | 'bottom center' | 'bottom left' | 'bottom right' | 'right center' | 'right top' | 'right bottom' | 'left center' | 'left top' | 'left bottom';
16
+ iconStatus: boolean;
17
+ offset?: {
18
+ x: number;
19
+ y: number;
20
+ };
21
+ preventXss?: boolean;
22
+ }
@@ -8,7 +8,6 @@ type __VLS_Props = {
8
8
  username?: string;
9
9
  html?: string;
10
10
  css?: string;
11
- preselectedDynamicContentList: DynamicContent[];
12
11
  guidoConfig: GuidoConfig;
13
12
  };
14
13
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
@@ -20,10 +19,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
20
19
  "dynamic-content:open": (detail: DynamicContent | null) => void;
21
20
  back: () => void;
22
21
  "save:start": () => void;
23
- "save:complete": (data: {
24
- template: Omit<Template, "forceRecreate">;
25
- dynamicContentList: DynamicContent[];
26
- }) => void;
22
+ "save:complete": (template: Omit<Template, "forceRecreate">) => void;
27
23
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
28
24
  export default _default;
29
25
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,18 +1,18 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
- var t = this, e = t._self._c, r = t._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), e("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.SaveTemplateModal, { attrs: { "is-open": r.editorStore.isSaveTemplateModalOpen }, on: { close: r.handleCloseSaveTemplateModal } })], 1);
7
- }, i = [], d = /* @__PURE__ */ a(
5
+ var e = this, r = e._self._c, t = e._self._setupProxy;
6
+ return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.HeaderWrapper), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
+ }, _ = [], a = /* @__PURE__ */ i(
8
8
  o,
9
9
  s,
10
- i,
10
+ _,
11
11
  !1,
12
12
  null,
13
- "2d18ab9c"
13
+ "89bedf08"
14
14
  );
15
- const c = d.exports;
15
+ const f = a.exports;
16
16
  export {
17
- c as default
17
+ f as default
18
18
  };
@@ -1,14 +1,11 @@
1
- import { defineComponent as w, onMounted as E } from "vue";
2
- import { provideGuidoActions as T } from "../composables/useGuidoActions.js";
3
- import { usePartner as _ } from "../composables/usePartner.js";
4
- import { useStripo as G } from "../composables/useStripo.js";
5
- import { DefaultUsername as I, DefaultGuidoConfig as k } from "../enums/defaults.js";
6
- import M from "./organisms/header/HeaderWrapper.vue.js";
7
- import P from "./organisms/save-template/SaveTemplateModal.vue.js";
8
- import { useStripoApi as N } from "../services/stripoApi.js";
9
- import { useEditorStore as x } from "../stores/editor.js";
10
- import { useDynamicContentStore as A } from "../stores/dynamic-content.js";
11
- const q = /* @__PURE__ */ w({
1
+ import { defineComponent as h, onMounted as w } from "vue";
2
+ import { provideGuidoActions as D } from "../composables/useGuidoActions.js";
3
+ import { usePartner as E } from "../composables/usePartner.js";
4
+ import { useStripo as S } from "../composables/useStripo.js";
5
+ import { DefaultUsername as _, DefaultGuidoConfig as G } from "../enums/defaults.js";
6
+ import I from "./organisms/header/HeaderWrapper.vue.js";
7
+ import { useStripoApi as k } from "../services/stripoApi.js";
8
+ const B = /* @__PURE__ */ h({
12
9
  __name: "Guido",
13
10
  props: {
14
11
  templateId: null,
@@ -18,34 +15,26 @@ const q = /* @__PURE__ */ w({
18
15
  username: null,
19
16
  html: null,
20
17
  css: null,
21
- preselectedDynamicContentList: null,
22
18
  guidoConfig: null
23
19
  },
24
20
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
25
- setup(b, { expose: h, emit: t }) {
26
- const o = b, n = A(), c = o.preselectedDynamicContentList || [], { getPartnerName: a, getProductType: i } = _(), {
27
- templateId: s,
28
- userId: r,
29
- guidoConfig: l,
30
- html: d = "",
31
- css: m = "",
32
- partnerName: u = a(),
33
- productType: p = i(),
34
- username: y = I
21
+ setup(C, { expose: b, emit: t }) {
22
+ const o = C, { getPartnerName: n, getProductType: a } = E(), {
23
+ templateId: c,
24
+ userId: s,
25
+ guidoConfig: i,
26
+ html: r = "",
27
+ css: l = "",
28
+ partnerName: d = n(),
29
+ productType: u = a(),
30
+ username: m = _
35
31
  } = o;
36
32
  window.GuidoConfig = {
37
- ...k,
38
- ...l
33
+ ...G,
34
+ ...i
39
35
  };
40
- const { initPlugin: f } = G({
41
- emailId: s,
42
- userId: r,
43
- username: y,
44
- partnerName: u,
45
- productType: p,
46
- preselectedDynamicContentList: c
47
- }), { getDefaultTemplate: g } = N();
48
- T({
36
+ const { initPlugin: p } = S({ emailId: c, userId: s, username: m, partnerName: d, productType: u }), { getDefaultTemplate: g } = k();
37
+ D({
49
38
  onBack: () => {
50
39
  console.debug("guido:back"), t("back");
51
40
  },
@@ -53,47 +42,39 @@ const q = /* @__PURE__ */ w({
53
42
  console.debug("guido:save:start"), t("save:start");
54
43
  },
55
44
  onSaveComplete: (e) => {
56
- console.debug("guido:save:complete", {
57
- template: e,
58
- dynamicContentList: n.getSelectedDynamicContentList
59
- }), t("save:complete", {
60
- template: e,
61
- dynamicContentList: n.getSelectedDynamicContentList
62
- });
45
+ console.debug("guido:save:complete", e), t("save:complete", e);
63
46
  }
64
47
  });
65
- const C = x(), L = () => {
66
- C.isSaveTemplateModalOpen = !1;
67
- }, v = (e) => {
68
- console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
69
- }, S = () => {
48
+ const f = (e) => {
49
+ console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
50
+ }, y = () => {
70
51
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
71
52
  };
72
- return E(async () => {
53
+ return w(async () => {
73
54
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
74
55
  try {
75
56
  let e = {
76
- html: d,
77
- css: m,
57
+ html: r,
58
+ css: l,
78
59
  forceRecreate: !0
79
60
  // TODO: It should be false for old templates. We will communicate with Stripo
80
61
  };
81
- e.html || (e = await g()), await f(e), n.selectedDynamicContentList = c;
62
+ e.html || (e = await g()), await p(e);
82
63
  } catch (e) {
83
64
  console.error("Failed to initialize Stripo editor:", e);
84
65
  }
85
66
  document.addEventListener("dynamic-content:open", (e) => {
86
- const D = e;
87
- console.debug("dynamic-content:open", D.detail), t("dynamic-content:open", D.detail);
67
+ const v = e;
68
+ console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.detail);
88
69
  });
89
- }), h({
70
+ }), b({
90
71
  dynamicContent: {
91
- insert: v,
92
- close: S
72
+ insert: f,
73
+ close: y
93
74
  }
94
- }), { __sfc: !0, dynamicContentStore: n, props: o, preselectedDynamicContentList: c, getPartnerName: a, getProductType: i, templateId: s, userId: r, guidoConfig: l, html: d, css: m, partnerName: u, productType: p, username: y, emit: t, initPlugin: f, getDefaultTemplate: g, editorStore: C, handleCloseSaveTemplateModal: L, insertDynamicContent: v, closeDynamicContent: S, HeaderWrapper: M, SaveTemplateModal: P };
75
+ }), { __sfc: !0, props: o, getPartnerName: n, getProductType: a, templateId: c, userId: s, guidoConfig: i, html: r, css: l, partnerName: d, productType: u, username: m, emit: t, initPlugin: p, getDefaultTemplate: g, insertDynamicContent: f, closeDynamicContent: y, HeaderWrapper: I };
95
76
  }
96
77
  });
97
78
  export {
98
- q as default
79
+ B as default
99
80
  };
@@ -1,17 +1,17 @@
1
- import s from "./MiddleSlot.vue2.js";
2
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import i from "./MiddleSlot.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
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", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
6
- }, l = [], r = /* @__PURE__ */ i(
7
- s,
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", "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", "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", "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", "label-text-status": !1, "selected-status": t.editorStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreview } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
6
+ }, l = [], r = /* @__PURE__ */ s(
7
+ i,
8
8
  n,
9
9
  l,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const p = r.exports;
14
+ const u = r.exports;
15
15
  export {
16
- p as default
16
+ u as default
17
17
  };
@@ -1,22 +1,20 @@
1
- import { defineComponent as r } from "vue";
2
- import { useTranslations as s } from "../../../composables/useTranslations.js";
3
- import { useEditorStore as n } from "../../../stores/editor.js";
4
- import { InButtonV2 as e } from "@useinsider/design-system-vue";
5
- import m from "./version-history/VersionHistory.vue.js";
6
- import p from "./version-history/ViewOptions.vue.js";
7
- import f from "./ViewOptions.vue.js";
8
- const y = /* @__PURE__ */ r({
1
+ import { defineComponent as s, computed as t } from "vue";
2
+ import { useTranslations as n } from "../../../composables/useTranslations.js";
3
+ import { useEditorStore as p } from "../../../stores/editor.js";
4
+ import { getTooltipOptions as m } from "../../../utils/tooltipUtils.js";
5
+ import { InButtonV2 as l } from "@useinsider/design-system-vue";
6
+ import d from "./version-history/VersionHistory.vue.js";
7
+ import w from "./version-history/ViewOptions.vue.js";
8
+ import c from "./ViewOptions.vue.js";
9
+ const M = /* @__PURE__ */ s({
9
10
  __name: "MiddleSlot",
10
- setup(a) {
11
- const o = n(), t = s();
12
- return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
- id: `${i}-tooltip`,
14
- dynamicPosition: !1,
15
- staticPosition: "bottom center",
16
- iconStatus: !1
17
- }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
11
+ setup(f) {
12
+ const e = p(), o = n(), r = t(() => e.isCodeEditorOpen ? o("newsletter.close-html-editor") : o("newsletter.html-editor")), i = t(() => e.isPreviewModeOpen ? o("newsletter.close-email-preview") : o("newsletter.email-preview"));
13
+ return { __sfc: !0, editorStore: e, trans: o, codeEditorTooltipText: r, previewTooltipText: i, handlePreview: () => {
14
+ e.isPreviewModeOpen = !e.isPreviewModeOpen;
15
+ }, getTooltipOptions: m, InButtonV2: l, VersionHistory: d, VersionHistoryViewOptions: w, ViewOptions: c };
18
16
  }
19
17
  });
20
18
  export {
21
- y as default
19
+ M as default
22
20
  };
@@ -1,17 +1,17 @@
1
- import o from "./RightSlot.vue2.js";
1
+ import s from "./RightSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), 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 }, on: { click: t.exportHtml } }), 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 }, on: { click: t.handleSaveAsTemplate } }), 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 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleSave } })], 1);
6
- }, a = [], r = /* @__PURE__ */ i(
7
- o,
4
+ var o = this, e = o._self._c, t = o._self._setupProxy;
5
+ return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }), 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 } }), 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") } }), 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.editorStore.isVersionHistoryOpen }, on: { click: t.handleSave } })], 1);
6
+ }, r = [], l = /* @__PURE__ */ i(
7
+ s,
8
8
  n,
9
- a,
9
+ r,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const u = r.exports;
14
+ const u = l.exports;
15
15
  export {
16
16
  u as default
17
17
  };
@@ -1,37 +1,37 @@
1
- import { defineComponent as m } from "vue";
2
- import { useActionsApi as p } from "../../../composables/useActionsApi.js";
3
- import { useExport as l } from "../../../composables/useExport.js";
4
- import { useSaveStart as c, useSaveComplete as d } from "../../../composables/useGuidoActions.js";
5
- import { useVersionHistoryApi as f } from "../../../composables/useVersionHistoryApi.js";
6
- import { useEditorStore as u } from "../../../stores/editor.js";
7
- import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
- const T = /* @__PURE__ */ m({
1
+ import { defineComponent as l, computed as f } from "vue";
2
+ import { useActionsApi as u } from "../../../composables/useActionsApi.js";
3
+ import { useExport as d } from "../../../composables/useExport.js";
4
+ import { useSaveStart as y, useSaveComplete as v } from "../../../composables/useGuidoActions.js";
5
+ import { useTranslations as h } from "../../../composables/useTranslations.js";
6
+ import { useVersionHistoryApi as S } from "../../../composables/useVersionHistoryApi.js";
7
+ import { useEditorStore as H } from "../../../stores/editor.js";
8
+ import { getTooltipOptions as _ } from "../../../utils/tooltipUtils.js";
9
+ import { InButtonV2 as V } from "@useinsider/design-system-vue";
10
+ const R = /* @__PURE__ */ l({
9
11
  __name: "RightSlot",
10
- setup(h) {
11
- const { exportHtml: i } = l(), { getCompiledEmail: o } = p(), r = c(), s = d(), { openVersionHistory: n, closeVersionHistory: a } = f(), e = u();
12
- return { __sfc: !0, exportHtml: i, getCompiledEmail: o, saveStart: r, saveComplete: s, openVersionHistory: n, closeVersionHistory: a, editorStore: e, handleVersionHistory: () => {
13
- if (e.isVersionHistoryOpen) {
14
- a();
12
+ setup(g) {
13
+ const { exportHtml: p } = d(), { getCompiledEmail: r } = u(), s = y(), i = v(), { openVersionHistory: n, closeVersionHistory: m } = S(), o = H(), t = h(), a = () => {
14
+ if (o.isVersionHistoryOpen) {
15
+ m();
15
16
  return;
16
17
  }
17
18
  n();
18
- }, handleSaveAsTemplate: async () => {
19
- e.isSaveTemplateModalOpen = !0;
20
- }, handleSave: async () => {
21
- r();
19
+ }, c = f(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history"));
20
+ return { __sfc: !0, exportHtml: p, getCompiledEmail: r, saveStart: s, saveComplete: i, openVersionHistory: n, closeVersionHistory: m, editorStore: o, trans: t, handleVersionHistory: a, versionHistoryTooltipText: c, handleSave: async () => {
21
+ s();
22
22
  try {
23
- const { html: t } = await o();
24
- s({
25
- html: t || "",
23
+ const { html: e } = await r();
24
+ i({
25
+ html: e || "",
26
26
  css: ""
27
27
  // CSS is embedded in HTML from Stripo
28
28
  });
29
- } catch (t) {
30
- console.error("Failed to get template data for save:", t);
29
+ } catch (e) {
30
+ console.error("Failed to get template data for save:", e);
31
31
  }
32
- }, InButtonV2: S };
32
+ }, getTooltipOptions: _, InButtonV2: V };
33
33
  }
34
34
  });
35
35
  export {
36
- T as default
36
+ R as default
37
37
  };
@@ -10,9 +10,9 @@ var n = function() {
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "0fff376c"
13
+ "d82f51a1"
14
14
  );
15
- const l = _.exports;
15
+ const f = _.exports;
16
16
  export {
17
- l as default
17
+ f as default
18
18
  };
@@ -1,15 +1,30 @@
1
- import { defineComponent as e } from "vue";
2
- import { useEditorStore as t } from "../../../stores/editor.js";
3
- import { InSegments as o } from "@useinsider/design-system-vue";
4
- const u = /* @__PURE__ */ e({
1
+ import { defineComponent as n } from "vue";
2
+ import { useTranslations as p } from "../../../composables/useTranslations.js";
3
+ import { useEditorStore as s } from "../../../stores/editor.js";
4
+ import { getTooltipOptions as o } from "../../../utils/tooltipUtils.js";
5
+ import { InSegments as r } from "@useinsider/design-system-vue";
6
+ const f = /* @__PURE__ */ n({
5
7
  __name: "ViewOptions",
6
- setup(n) {
7
- return { __sfc: !0, editorStore: t(), segmentList: [
8
- { text: "", icon: "line-desktop", value: "desktop" },
9
- { text: "", icon: "line-menu-mobileapp", value: "mobile" }
10
- ], InSegments: o };
8
+ setup(m) {
9
+ const e = s(), t = p(), i = [
10
+ {
11
+ text: "",
12
+ icon: "line-desktop",
13
+ value: "desktop",
14
+ tooltipText: t("newsletter.desktop"),
15
+ tooltipOptions: o("guido__view-option-desktop")
16
+ },
17
+ {
18
+ text: "",
19
+ icon: "line-menu-mobileapp",
20
+ value: "mobile",
21
+ tooltipText: t("newsletter.mobile"),
22
+ tooltipOptions: o("guido__view-option-mobile")
23
+ }
24
+ ];
25
+ return { __sfc: !0, editorStore: e, trans: t, segmentList: i, InSegments: r };
11
26
  }
12
27
  });
13
28
  export {
14
- u as default
29
+ f as default
15
30
  };
@@ -1,6 +1,5 @@
1
- import { GetCompiledEmailOptions, CompiledEmailResult, TemplateDataResult } from '@@/Types/actions-api';
1
+ import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
2
2
  export declare const useActionsApi: () => {
3
3
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
4
- getRawTemplateData: () => Promise<TemplateDataResult>;
5
4
  activateCustomViewStyles: (isActive?: boolean) => void;
6
5
  };
@@ -1,48 +1,38 @@
1
- const g = () => ({
2
- getCompiledEmail: (t = {}) => new Promise((e, a) => {
3
- const o = {
4
- ...{ ...{
5
- minimize: !0,
6
- utmEntity: {
7
- utmSource: "",
8
- utmMedium: "",
9
- utmCampaign: "",
10
- utmContent: "",
11
- utmTerm: "",
12
- customUtms: [
13
- {
14
- name1: "val1",
15
- name2: "val2"
16
- }
17
- ]
18
- },
19
- mergeTags: ["Tag1", "Tag2"],
20
- forseAmp: !1,
21
- resetDataSavedFlag: !1,
22
- disableLineHeightsReplace: !0
23
- }, ...t },
24
- callback: (i, s, m, n, l) => {
25
- i ? a(i) : e({
26
- html: s,
27
- ampHtml: m,
28
- ampErrors: n,
29
- displayConditions: l
30
- });
31
- }
32
- };
33
- window.StripoEditorApi.actionsApi.compileEmail(o);
34
- }),
35
- getRawTemplateData: () => new Promise((t) => {
36
- window.StripoEditorApi.actionsApi.getTemplateData(
37
- (e) => {
38
- t(e);
39
- }
40
- );
41
- }),
42
- activateCustomViewStyles: (t = !0) => {
43
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
44
- }
45
- });
1
+ const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
2
+ const s = { ...{
3
+ minimize: !0,
4
+ utmEntity: {
5
+ utmSource: "",
6
+ utmMedium: "",
7
+ utmCampaign: "",
8
+ utmContent: "",
9
+ utmTerm: "",
10
+ customUtms: [
11
+ {
12
+ name1: "val1",
13
+ name2: "val2"
14
+ }
15
+ ]
16
+ },
17
+ mergeTags: ["Tag1", "Tag2"],
18
+ forseAmp: !1,
19
+ resetDataSavedFlag: !1,
20
+ disableLineHeightsReplace: !0
21
+ }, ...t }, o = {
22
+ callback: (e, m, l, n, c) => {
23
+ e ? a(e) : i({
24
+ html: m,
25
+ ampHtml: l,
26
+ ampErrors: n,
27
+ displayConditions: c
28
+ });
29
+ },
30
+ ...s
31
+ };
32
+ window.StripoEditorApi.actionsApi.compileEmail(o);
33
+ }), activateCustomViewStyles: (t = !0) => {
34
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
35
+ } });
46
36
  export {
47
37
  g as useActionsApi
48
38
  };
@@ -1,20 +1,18 @@
1
- import { ref as p, computed as T } from "vue";
2
- import { getCsrfToken as H } from "../utils/generic.js";
3
- const k = (b = {}) => {
4
- const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
1
+ import { ref as p, computed as v } from "vue";
2
+ const j = (y = {}) => {
3
+ const h = p(!1), a = p(null), u = p(null), E = v(() => h.value), g = v(() => a.value !== null), T = {
5
4
  baseURL: "",
6
5
  timeout: 1e4,
7
6
  retry: 0,
8
7
  retryDelay: 1e3,
9
8
  headers: {
10
- "Content-Type": "application/json",
11
- "X-CSRF-TOKEN": H()
9
+ "Content-Type": "application/json"
12
10
  },
13
- ...b
11
+ ...y
14
12
  }, w = (e, s) => {
15
13
  if (e.startsWith("http://") || e.startsWith("https://"))
16
14
  return e;
17
- const t = s || v.baseURL || "";
15
+ const t = s || T.baseURL || "";
18
16
  return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
19
17
  }, P = (e) => new Promise((s, t) => {
20
18
  setTimeout(() => {
@@ -24,20 +22,20 @@ const k = (b = {}) => {
24
22
  setTimeout(s, e);
25
23
  }), i = async (e, s, t, D = {}) => {
26
24
  a.value = null, h.value = !0, u.value = new AbortController();
27
- const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
25
+ const n = { ...T, ...D }, L = w(s, n.baseURL), c = {
28
26
  method: e,
29
27
  headers: { ...n.headers },
30
28
  signal: u.value.signal,
31
29
  ...n
32
30
  };
33
31
  t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
34
- const E = async (m = 0) => {
32
+ const b = async (m = 0) => {
35
33
  try {
36
34
  const o = [fetch(L, c)];
37
35
  n.timeout && o.push(P(n.timeout));
38
36
  const r = await Promise.race(o);
39
37
  if (!r.ok) {
40
- const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
38
+ const H = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(H);
41
39
  throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
42
40
  }
43
41
  let f;
@@ -51,36 +49,36 @@ const k = (b = {}) => {
51
49
  } catch (o) {
52
50
  const r = o instanceof Error && o.name === "AbortError";
53
51
  if (m < (n.retry || 0) && !r)
54
- return await x(n.retryDelay || 1e3), E(m + 1);
52
+ return await x(n.retryDelay || 1e3), b(m + 1);
55
53
  throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
56
54
  }
57
55
  };
58
56
  try {
59
- return await E();
57
+ return await b();
60
58
  } finally {
61
59
  h.value = !1, u.value = null;
62
60
  }
63
- }, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
61
+ }, $ = (e, s) => i("GET", e, void 0, s), C = (e, s, t) => i("POST", e, s, t), U = (e, s, t) => i("PUT", e, s, t), A = (e, s, t) => i("PATCH", e, s, t), R = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
64
62
  u.value && u.value.abort(e);
65
63
  }, q = () => {
66
64
  a.value = null;
67
65
  };
68
66
  return {
69
67
  // State
70
- loading: g,
71
- error: T(() => a.value),
72
- hasError: y,
68
+ loading: E,
69
+ error: v(() => a.value),
70
+ hasError: g,
73
71
  // Methods
74
72
  request: i,
75
- get: C,
76
- post: $,
77
- put: R,
78
- patch: U,
79
- delete: A,
73
+ get: $,
74
+ post: C,
75
+ put: U,
76
+ patch: A,
77
+ delete: R,
80
78
  cancel: W,
81
79
  clearError: q
82
80
  };
83
81
  };
84
82
  export {
85
- k as useHttp
83
+ j as useHttp
86
84
  };