@useinsider/guido 1.0.0-beta.5f47ded → 1.0.0-beta.5f67111

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 (70) hide show
  1. package/dist/@types/generic.d.ts +4 -4
  2. package/dist/components/Guido.vue.d.ts +6 -3
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +54 -38
  5. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  6. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -17
  7. package/dist/components/organisms/header/RightSlot.vue.js +5 -5
  8. package/dist/components/organisms/header/RightSlot.vue2.js +19 -17
  9. package/dist/components/organisms/header/ViewOptions.vue.js +6 -6
  10. package/dist/components/organisms/{design-preview/AmpErrorModal.vue.d.ts → save-template/SaveTemplateModal.vue.d.ts} +1 -1
  11. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +20 -0
  12. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +78 -0
  13. package/dist/components/wrappers/ModalWrapper.vue.d.ts +72 -0
  14. package/dist/components/wrappers/ModalWrapper.vue.js +19 -0
  15. package/dist/components/wrappers/ModalWrapper.vue2.js +43 -0
  16. package/dist/composables/useActionsApi.d.ts +2 -3
  17. package/dist/composables/useActionsApi.js +43 -44
  18. package/dist/composables/useHttp.js +23 -21
  19. package/dist/composables/useSaveAsTemplate.d.ts +7 -0
  20. package/dist/composables/useSaveAsTemplate.js +51 -0
  21. package/dist/composables/useStripo.js +23 -17
  22. package/dist/composables/useTemplateNameValidation.d.ts +7 -0
  23. package/dist/composables/useTemplateNameValidation.js +33 -0
  24. package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
  25. package/dist/guido.css +1 -1
  26. package/dist/mock/api/template-library.d.ts +2 -0
  27. package/dist/stores/dynamic-content.d.ts +27 -0
  28. package/dist/stores/dynamic-content.js +23 -0
  29. package/dist/stores/editor.d.ts +1 -4
  30. package/dist/stores/editor.js +3 -6
  31. package/dist/stores/template-categories.d.ts +41 -0
  32. package/dist/stores/template-categories.js +91 -0
  33. package/dist/utils/arrayUtil.d.ts +1 -0
  34. package/dist/utils/arrayUtil.js +10 -0
  35. package/dist/utils/base64.d.ts +2 -0
  36. package/dist/utils/base64.js +14 -0
  37. package/dist/utils/generic.d.ts +1 -0
  38. package/dist/utils/generic.js +7 -0
  39. package/dist/utils/genericUtil.d.ts +2 -0
  40. package/dist/utils/genericUtil.js +7 -0
  41. package/dist/utils/textUtil.d.ts +2 -0
  42. package/package.json +1 -3
  43. package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +0 -21
  44. package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +0 -30
  45. package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +0 -16
  46. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +0 -22
  47. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +0 -42
  48. package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +0 -16
  49. package/dist/components/organisms/design-preview/EmailPreview.vue.js +0 -17
  50. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +0 -33
  51. package/dist/components/organisms/design-preview/EmailView.vue.d.ts +0 -18
  52. package/dist/components/organisms/design-preview/EmailView.vue.js +0 -19
  53. package/dist/components/organisms/design-preview/EmailView.vue2.js +0 -24
  54. package/dist/components/organisms/design-preview/InboxView.vue.d.ts +0 -17
  55. package/dist/components/organisms/design-preview/InboxView.vue.js +0 -19
  56. package/dist/components/organisms/design-preview/InboxView.vue2.js +0 -23
  57. package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +0 -17
  58. package/dist/components/organisms/design-preview/MobilePreview.vue.js +0 -17
  59. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +0 -24
  60. package/dist/components/organisms/header/AmpToggle.vue.d.ts +0 -2
  61. package/dist/components/organisms/header/AmpToggle.vue.js +0 -17
  62. package/dist/components/organisms/header/AmpToggle.vue2.js +0 -48
  63. package/dist/composables/useDebounce.d.ts +0 -4
  64. package/dist/composables/useDebounce.js +0 -12
  65. package/dist/composables/useMobileGmailFit.d.ts +0 -5
  66. package/dist/composables/useMobileGmailFit.js +0 -69
  67. package/dist/enums/gmailMobilePreview.d.ts +0 -7
  68. package/dist/enums/gmailMobilePreview.js +0 -17
  69. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  70. package/dist/static/assets/phone-mockup.svg.js +0 -4
@@ -9,7 +9,7 @@ export type DynamicContent = {
9
9
  text: string;
10
10
  fallback?: string;
11
11
  };
12
- export interface EmailData {
13
- senderName: string;
14
- subject: string;
15
- }
12
+ export type MergeTag = {
13
+ label: string;
14
+ value: string;
15
+ };
@@ -1,4 +1,4 @@
1
- import type { DynamicContent, GuidoConfig, EmailData } from '@@/Types/generic';
1
+ import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
2
2
  import type { Template } from '@@/Types/stripo';
3
3
  type __VLS_Props = {
4
4
  templateId: string;
@@ -8,8 +8,8 @@ type __VLS_Props = {
8
8
  username?: string;
9
9
  html?: string;
10
10
  css?: string;
11
+ preselectedDynamicContentList: DynamicContent[];
11
12
  guidoConfig: GuidoConfig;
12
- emailData?: EmailData;
13
13
  };
14
14
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
15
15
  dynamicContent: {
@@ -20,7 +20,10 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
20
20
  "dynamic-content:open": (detail: DynamicContent | null) => void;
21
21
  back: () => void;
22
22
  "save:start": () => void;
23
- "save:complete": (template: Omit<Template, "forceRecreate">) => void;
23
+ "save:complete": (data: {
24
+ template: Omit<Template, "forceRecreate">;
25
+ dynamicContentList: DynamicContent[];
26
+ }) => void;
24
27
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
25
28
  export default _default;
26
29
  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 t from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import a from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
- var i = this, r = i._self._c, e = i._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper" }, [r(e.HeaderWrapper), r(e.EmailPreview, { directives: [{ name: "show", rawName: "v-show", value: e.editorStore.isPreviewModeOpen, expression: "editorStore.isPreviewModeOpen" }], attrs: { "email-data": i.emailData, "is-visible": e.editorStore.isPreviewModeOpen } }), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.editorStore.isPreviewModeOpen, expression: "!editorStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
- }, a = [], d = /* @__PURE__ */ t(
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(
8
8
  o,
9
9
  s,
10
- a,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "7836f831"
13
+ "2d18ab9c"
14
14
  );
15
- const m = d.exports;
15
+ const c = d.exports;
16
16
  export {
17
- m as default
17
+ c as default
18
18
  };
@@ -1,13 +1,14 @@
1
1
  import { defineComponent as w, onMounted as E } from "vue";
2
- import { provideGuidoActions as S } from "../composables/useGuidoActions.js";
3
- import { usePartner as D } from "../composables/usePartner.js";
4
- import { useStripo as _ } from "../composables/useStripo.js";
5
- import { DefaultUsername as G, DefaultGuidoConfig as I } from "../enums/defaults.js";
6
- import P from "./organisms/design-preview/EmailPreview.vue.js";
7
- import k from "./organisms/header/HeaderWrapper.vue.js";
8
- import { useStripoApi as T } from "../services/stripoApi.js";
9
- import { useEditorStore as N } from "../stores/editor.js";
10
- const M = /* @__PURE__ */ w({
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({
11
12
  __name: "Guido",
12
13
  props: {
13
14
  templateId: null,
@@ -17,27 +18,34 @@ const M = /* @__PURE__ */ w({
17
18
  username: null,
18
19
  html: null,
19
20
  css: null,
20
- guidoConfig: null,
21
- emailData: null
21
+ preselectedDynamicContentList: null,
22
+ guidoConfig: null
22
23
  },
23
24
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
24
- setup(C, { expose: b, emit: t }) {
25
- const o = C, { getPartnerName: n, getProductType: a } = D(), {
26
- templateId: c,
25
+ setup(b, { expose: h, emit: t }) {
26
+ const o = b, n = A(), c = o.preselectedDynamicContentList || [], { getPartnerName: a, getProductType: i } = _(), {
27
+ templateId: s,
27
28
  userId: r,
28
- guidoConfig: i,
29
- html: s = "",
30
- css: l = "",
31
- partnerName: d = n(),
32
- productType: u = a(),
33
- username: m = G
29
+ guidoConfig: l,
30
+ html: d = "",
31
+ css: m = "",
32
+ partnerName: u = a(),
33
+ productType: p = i(),
34
+ username: y = I
34
35
  } = o;
35
36
  window.GuidoConfig = {
36
- ...I,
37
- ...i
37
+ ...k,
38
+ ...l
38
39
  };
39
- const { initPlugin: p } = _({ emailId: c, userId: r, username: m, partnerName: d, productType: u }), { getDefaultTemplate: f } = T(), h = N();
40
- S({
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({
41
49
  onBack: () => {
42
50
  console.debug("guido:back"), t("back");
43
51
  },
@@ -45,39 +53,47 @@ const M = /* @__PURE__ */ w({
45
53
  console.debug("guido:save:start"), t("save:start");
46
54
  },
47
55
  onSaveComplete: (e) => {
48
- console.debug("guido:save:complete", e), t("save:complete", 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
+ });
49
63
  }
50
64
  });
51
- const g = (e) => {
52
- console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
53
- }, y = () => {
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 = () => {
54
70
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
55
71
  };
56
72
  return E(async () => {
57
73
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
58
74
  try {
59
75
  let e = {
60
- html: s,
61
- css: l,
76
+ html: d,
77
+ css: m,
62
78
  forceRecreate: !0
63
79
  // TODO: It should be false for old templates. We will communicate with Stripo
64
80
  };
65
- e.html || (e = await f()), await p(e);
81
+ e.html || (e = await g()), await f(e), n.selectedDynamicContentList = c;
66
82
  } catch (e) {
67
83
  console.error("Failed to initialize Stripo editor:", e);
68
84
  }
69
85
  document.addEventListener("dynamic-content:open", (e) => {
70
- const v = e;
71
- console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.detail);
86
+ const D = e;
87
+ console.debug("dynamic-content:open", D.detail), t("dynamic-content:open", D.detail);
72
88
  });
73
- }), b({
89
+ }), h({
74
90
  dynamicContent: {
75
- insert: g,
76
- close: y
91
+ insert: v,
92
+ close: S
77
93
  }
78
- }), { __sfc: !0, props: o, getPartnerName: n, getProductType: a, templateId: c, userId: r, guidoConfig: i, html: s, css: l, partnerName: d, productType: u, username: m, emit: t, initPlugin: p, getDefaultTemplate: f, editorStore: h, insertDynamicContent: g, closeDynamicContent: y, EmailPreview: P, HeaderWrapper: k };
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 };
79
95
  }
80
96
  });
81
97
  export {
82
- M as default
98
+ q as default
83
99
  };
@@ -1,8 +1,8 @@
1
1
  import s from "./MiddleSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var o = this, e = o._self._c, t = o._self._setupProxy;
5
- return t.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(t.VersionHistory), e(t.VersionHistoryViewOptions)], 1) : e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "disabled-status": t.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), e(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.isPreviewModeOpen ? t.trans("newsletter.close-email-preview") : t.trans("newsletter.email-preview") }, on: { click: t.handlePreviewClick } }), e(t.ViewOptions, { staticClass: "ml-3" }), e(t.AmpToggle)], 1);
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
6
  }, l = [], r = /* @__PURE__ */ i(
7
7
  s,
8
8
  n,
@@ -11,7 +11,7 @@ var n = function() {
11
11
  null,
12
12
  null
13
13
  );
14
- const u = r.exports;
14
+ const p = r.exports;
15
15
  export {
16
- u as default
16
+ p as default
17
17
  };
@@ -1,25 +1,22 @@
1
- import { defineComponent as s, computed as n } from "vue";
2
- import { useTranslations as p } from "../../../composables/useTranslations.js";
3
- import { useEditorStore as m } from "../../../stores/editor.js";
4
- import { InButtonV2 as c } from "@useinsider/design-system-vue";
5
- import d from "./AmpToggle.vue.js";
6
- import f from "./version-history/VersionHistory.vue.js";
7
- import a from "./version-history/ViewOptions.vue.js";
8
- import l from "./ViewOptions.vue.js";
9
- const T = /* @__PURE__ */ s({
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({
10
9
  __name: "MiddleSlot",
11
- setup(u) {
12
- const o = m(), t = p(), e = () => {
13
- o.isPreviewModeOpen = !o.isPreviewModeOpen;
14
- }, i = n(() => o.isPreviewModeOpen);
15
- return { __sfc: !0, editorStore: o, trans: t, handlePreviewClick: e, isPreviewModeOpen: i, getTooltipOptions: (r) => ({
16
- id: `${r}-tooltip`,
10
+ setup(a) {
11
+ const o = n(), t = s();
12
+ return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
+ id: `${i}-tooltip`,
17
14
  dynamicPosition: !1,
18
15
  staticPosition: "bottom center",
19
16
  iconStatus: !1
20
- }), InButtonV2: c, AmpToggle: d, VersionHistory: f, VersionHistoryViewOptions: a, ViewOptions: l };
17
+ }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
21
18
  }
22
19
  });
23
20
  export {
24
- T as default
21
+ y as default
25
22
  };
@@ -2,16 +2,16 @@ import o from "./RightSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
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", "disabled-status": t.editorStore.isPreviewModeOpen, "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 } }), 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 || t.editorStore.isPreviewModeOpen }, on: { click: t.handleSave } })], 1);
6
- }, r = [], a = /* @__PURE__ */ i(
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
7
  o,
8
8
  n,
9
- r,
9
+ a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const c = a.exports;
14
+ const u = r.exports;
15
15
  export {
16
- c as default
16
+ u as default
17
17
  };
@@ -1,35 +1,37 @@
1
1
  import { defineComponent as m } from "vue";
2
2
  import { useActionsApi as p } from "../../../composables/useActionsApi.js";
3
- import { useExport as c } from "../../../composables/useExport.js";
4
- import { useSaveStart as l, useSaveComplete as f } from "../../../composables/useGuidoActions.js";
5
- import { useVersionHistoryApi as u } from "../../../composables/useVersionHistoryApi.js";
6
- import { useEditorStore as d } from "../../../stores/editor.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
7
  import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
- const E = /* @__PURE__ */ m({
8
+ const T = /* @__PURE__ */ m({
9
9
  __name: "RightSlot",
10
10
  setup(h) {
11
- const { exportHtml: a } = c(), { getCompiledEmail: t } = p(), e = l(), r = f(), { openVersionHistory: s, closeVersionHistory: n } = u(), i = d();
12
- return { __sfc: !0, exportHtml: a, getCompiledEmail: t, saveStart: e, saveComplete: r, openVersionHistory: s, closeVersionHistory: n, editorStore: i, handleVersionHistory: () => {
13
- if (i.isVersionHistoryOpen) {
14
- n();
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();
15
15
  return;
16
16
  }
17
- s();
17
+ n();
18
+ }, handleSaveAsTemplate: async () => {
19
+ e.isSaveTemplateModalOpen = !0;
18
20
  }, handleSave: async () => {
19
- e();
21
+ r();
20
22
  try {
21
- const { html: o } = await t();
22
- r({
23
- html: o || "",
23
+ const { html: t } = await o();
24
+ s({
25
+ html: t || "",
24
26
  css: ""
25
27
  // CSS is embedded in HTML from Stripo
26
28
  });
27
- } catch (o) {
28
- console.error("Failed to get template data for save:", o);
29
+ } catch (t) {
30
+ console.error("Failed to get template data for save:", t);
29
31
  }
30
32
  }, InButtonV2: S };
31
33
  }
32
34
  });
33
35
  export {
34
- E as default
36
+ T as default
35
37
  };
@@ -1,16 +1,16 @@
1
1
  import r from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var s = function() {
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
5
  var t = this, o = t._self._c, e = t._self._setupProxy;
6
- return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", disable: e.editorStore.isPreviewModeOpen, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
- }, n = [], _ = /* @__PURE__ */ i(
6
+ return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
+ }, i = [], _ = /* @__PURE__ */ s(
8
8
  r,
9
- s,
10
9
  n,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "f90d31ea"
13
+ "0fff376c"
14
14
  );
15
15
  const l = _.exports;
16
16
  export {
@@ -1,5 +1,5 @@
1
1
  interface Props {
2
- errors: string[];
2
+ isOpen: boolean;
3
3
  }
4
4
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
5
5
  close: () => void;
@@ -0,0 +1,20 @@
1
+ import s from "./SaveTemplateModal.vue2.js";
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var o = function() {
4
+ var a = this, t = a._self._c, e = a._self._setupProxy;
5
+ return t(e.ModalWrapper, { attrs: { "cancel-button-text": e.trans("products.cancel"), description: e.trans("newsletter.save-template-description"), "is-open": e.props.isOpen, "primary-button-loading": e.saveState.saving, "primary-button-text": e.trans(e.saveState.saving ? "newsletter.saving" : "products.save"), title: e.trans("products.save-template") }, on: { cancel: e.closeModal, close: e.closeModal, save: e.saveTemplate } }, [t(e.InBasicTextInput, { staticClass: "mb-5 w-1", attrs: { id: "template-name-input", name: "templateName", "character-counter-status": !1, "disabled-status": e.saveState.saving, "label-text": e.trans("products.template-name"), "placeholder-text": e.trans("newsletter.enter-template-name"), "state-message": e.getValidationMessage(), states: e.hasError() ? "error" : "", "tooltip-status": !1, value: e.templateName }, on: { input: e.templateNameInputHandler } }), t(e.InMultiSelect, { staticClass: "template-category-dropdown mb-5 w-1", attrs: { "create-option-status": "", "search-status": "", "button-status": !1, "character-limit-validation-text": e.trans("validation-v2.duration-value", {
6
+ min: 1,
7
+ max: e.templateCategorySearchInputLimit
8
+ }), "create-button-label": e.trans("products.create-new-category"), "disabled-status": e.saveState.saving, "label-text": e.trans("products.template-category"), "loading-state": e.categoriesStore.loading || e.categoriesStore.loadingCreate, "max-character-limit": e.templateCategorySearchInputLimit, options: e.categoriesStore.mappedCategories, "placeholder-text": e.trans("products.select-template-category"), value: e.categoriesStore.selectedCategories }, on: { addOption: e.addOption, change: e.categoriesStore.setSelectedCategories, resetAllOptions: e.categoriesStore.setSelectedCategories, selectAllOptions: e.categoriesStore.setSelectedCategories } })], 1);
9
+ }, n = [], l = /* @__PURE__ */ r(
10
+ s,
11
+ o,
12
+ n,
13
+ !1,
14
+ null,
15
+ null
16
+ );
17
+ const d = l.exports;
18
+ export {
19
+ d as default
20
+ };
@@ -0,0 +1,78 @@
1
+ import { defineComponent as b, ref as u, computed as A, watch as H } from "vue";
2
+ import L from "../../wrappers/ModalWrapper.vue.js";
3
+ import { useActionsApi as N } from "../../../composables/useActionsApi.js";
4
+ import { useToaster as V } from "../../../composables/useToaster.js";
5
+ import { useTranslations as j } from "../../../composables/useTranslations.js";
6
+ import { useTemplateCategoriesStore as x } from "../../../stores/template-categories.js";
7
+ import { InMultiSelect as B, InBasicTextInput as P } from "@useinsider/design-system-vue";
8
+ import { useSaveAsTemplate as E } from "../../../composables/useSaveAsTemplate.js";
9
+ import { useTemplateNameValidation as R } from "../../../composables/useTemplateNameValidation.js";
10
+ const U = /* @__PURE__ */ b({
11
+ __name: "SaveTemplateModal",
12
+ props: {
13
+ isOpen: { type: Boolean }
14
+ },
15
+ emits: ["close"],
16
+ setup(S, { emit: p }) {
17
+ const v = S, n = j(), { showToaster: c } = V(), { getRawTemplateData: f } = N(), a = x(), {
18
+ state: t,
19
+ saveTemplate: d
20
+ } = E(), {
21
+ templateName: s,
22
+ getValidationMessage: I,
23
+ hasError: w,
24
+ validateInputs: g,
25
+ resetValidation: i
26
+ } = R(), l = u(!1), o = u(""), r = u(""), C = 40, y = A(() => t.saving || l.value || a.loading || a.loadingCreate), m = () => {
27
+ s.value = "", o.value = "", r.value = "", a.resetSelection(), i();
28
+ }, M = (e) => {
29
+ s.value = e, i();
30
+ }, T = () => {
31
+ m(), p("close");
32
+ }, _ = async () => {
33
+ if (!y.value) {
34
+ if (t.saving = !0, !await g()) {
35
+ t.saving = !1;
36
+ return;
37
+ }
38
+ try {
39
+ await d({
40
+ name: s.value,
41
+ htmlContent: o.value,
42
+ categoryIds: a.getSelectedCategoryIds,
43
+ css: r.value
44
+ }) && (t.saving = !1, c({
45
+ message: n("journey-builder.template-saved-successfully", { name: s.value }),
46
+ type: "success"
47
+ }), T());
48
+ } catch {
49
+ t.saving = !1, c({
50
+ message: n("journey-builder.template-save-error", { name: s.value }),
51
+ type: "error"
52
+ });
53
+ }
54
+ }
55
+ }, h = async () => {
56
+ l.value = !0;
57
+ try {
58
+ const { html: e, css: O } = await f();
59
+ r.value = O || "", o.value = e || "";
60
+ } catch {
61
+ o.value = "", r.value = "";
62
+ } finally {
63
+ l.value = !1;
64
+ }
65
+ }, D = async (e) => {
66
+ await a.createCategory(e);
67
+ };
68
+ return H(() => v.isOpen, async (e) => {
69
+ e ? await Promise.all([
70
+ h(),
71
+ a.fetchCategories()
72
+ ]) : m();
73
+ }), { __sfc: !0, props: v, emit: p, trans: n, showToaster: c, getRawTemplateData: f, categoriesStore: a, saveState: t, saveTemplateToLibrary: d, templateName: s, getValidationMessage: I, hasError: w, validateInputs: g, resetValidation: i, isLoadingHtml: l, htmlData: o, cssData: r, templateCategorySearchInputLimit: C, isOperationInProgress: y, resetModalState: m, templateNameInputHandler: M, closeModal: T, saveTemplate: _, fetchHtmlData: h, addOption: D, ModalWrapper: L, InBasicTextInput: P, InMultiSelect: B };
74
+ }
75
+ });
76
+ export {
77
+ U as default
78
+ };
@@ -0,0 +1,72 @@
1
+ interface ModalWrapperProps {
2
+ isOpen: boolean;
3
+ title: string;
4
+ description?: string;
5
+ size?: 'small' | 'medium' | 'large';
6
+ primaryButtonText?: string;
7
+ primaryButtonDisabled?: boolean;
8
+ primaryButtonLoading?: boolean;
9
+ cancelButtonText?: string;
10
+ showCancelButton?: boolean;
11
+ className?: string;
12
+ }
13
+ declare var __VLS_12: {};
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_12) => any;
16
+ };
17
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ModalWrapperProps>, {
18
+ description: string;
19
+ size: string;
20
+ primaryButtonText: string;
21
+ primaryButtonDisabled: boolean;
22
+ primaryButtonLoading: boolean;
23
+ cancelButtonText: string;
24
+ showCancelButton: boolean;
25
+ className: string;
26
+ }>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
27
+ close: () => void;
28
+ save: () => void;
29
+ cancel: () => void;
30
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ModalWrapperProps>, {
31
+ description: string;
32
+ size: string;
33
+ primaryButtonText: string;
34
+ primaryButtonDisabled: boolean;
35
+ primaryButtonLoading: boolean;
36
+ cancelButtonText: string;
37
+ showCancelButton: boolean;
38
+ className: string;
39
+ }>>>, {
40
+ className: string;
41
+ size: "small" | "medium" | "large";
42
+ description: string;
43
+ primaryButtonText: string;
44
+ primaryButtonDisabled: boolean;
45
+ primaryButtonLoading: boolean;
46
+ cancelButtonText: string;
47
+ showCancelButton: boolean;
48
+ }>;
49
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
50
+ export default _default;
51
+ type __VLS_WithDefaults<P, D> = {
52
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
53
+ default: D[K];
54
+ }> : P[K];
55
+ };
56
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
57
+ type __VLS_TypePropsToOption<T> = {
58
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
59
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
60
+ } : {
61
+ type: import('vue').PropType<T[K]>;
62
+ required: true;
63
+ };
64
+ };
65
+ type __VLS_WithSlots<T, S> = T & {
66
+ new (): {
67
+ $scopedSlots: S;
68
+ };
69
+ };
70
+ type __VLS_PrettifyLocal<T> = {
71
+ [K in keyof T]: T[K];
72
+ } & {};
@@ -0,0 +1,19 @@
1
+ import r from "./ModalWrapper.vue2.js";
2
+ import o from "../../_virtual/_plugin-vue2_normalizer.js";
3
+ var s = function() {
4
+ var t = this, n = t._self._c, e = t._self._setupProxy;
5
+ return n(e.InDrawer, { attrs: { id: "modal-wrapper", "description-text": t.description, "footer-button-group-options": e.drawerFooterOptions, size: t.size, status: t.isOpen, "title-text": t.title }, on: { cancelOrBackButtonEvent: e.handleCancel, onCloseEvent: e.handleClose, primaryButtonEvent: e.handleSave }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
6
+ return [n("div", { staticClass: "modal-content-wrapper", class: t.className }, [t._t("default")], 2)];
7
+ }, proxy: !0 }], null, !0) });
8
+ }, a = [], l = /* @__PURE__ */ o(
9
+ r,
10
+ s,
11
+ a,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const u = l.exports;
17
+ export {
18
+ u as default
19
+ };
@@ -0,0 +1,43 @@
1
+ import { defineComponent as o, computed as l } from "vue";
2
+ import { InDrawer as s } from "@useinsider/design-system-vue";
3
+ const i = /* @__PURE__ */ o({
4
+ __name: "ModalWrapper",
5
+ props: {
6
+ isOpen: { type: Boolean },
7
+ title: null,
8
+ description: { default: "" },
9
+ size: { default: "small" },
10
+ primaryButtonText: { default: "" },
11
+ primaryButtonDisabled: { type: Boolean, default: !1 },
12
+ primaryButtonLoading: { type: Boolean, default: !1 },
13
+ cancelButtonText: { default: "" },
14
+ showCancelButton: { type: Boolean, default: !0 },
15
+ className: { default: "" }
16
+ },
17
+ emits: ["close", "save", "cancel"],
18
+ setup(a, { emit: t }) {
19
+ const e = a, n = l(() => ({
20
+ primaryButton: {
21
+ styling: "solid",
22
+ type: "primary",
23
+ labelText: e.primaryButtonText,
24
+ disabledStatus: e.primaryButtonDisabled || e.primaryButtonLoading
25
+ },
26
+ cancelOrBackButton: e.showCancelButton ? {
27
+ type: "secondary",
28
+ styling: "ghost",
29
+ labelText: e.cancelButtonText
30
+ } : void 0
31
+ }));
32
+ return { __sfc: !0, props: e, emit: t, drawerFooterOptions: n, handleClose: () => {
33
+ t("close");
34
+ }, handleSave: () => {
35
+ t("save");
36
+ }, handleCancel: () => {
37
+ t("cancel");
38
+ }, InDrawer: s };
39
+ }
40
+ });
41
+ export {
42
+ i as default
43
+ };
@@ -1,7 +1,6 @@
1
- import type { CompileEmailOptions } from '@@/Types/stripo';
2
- import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
1
+ import { GetCompiledEmailOptions, CompiledEmailResult, TemplateDataResult } from '@@/Types/actions-api';
3
2
  export declare const useActionsApi: () => {
4
3
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
4
+ getRawTemplateData: () => Promise<TemplateDataResult>;
5
5
  activateCustomViewStyles: (isActive?: boolean) => void;
6
- getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
7
6
  };