@useinsider/guido 1.0.0-beta.c798ebe → 1.0.0-beta.c99b3ab

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 (77) hide show
  1. package/dist/@types/generic.d.ts +0 -5
  2. package/dist/@types/save-as-template.d.ts +11 -0
  3. package/dist/components/Guido.vue.d.ts +1 -0
  4. package/dist/components/Guido.vue.js +8 -8
  5. package/dist/components/Guido.vue2.js +41 -41
  6. package/dist/components/organisms/header/MiddleSlot.vue.js +9 -9
  7. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -19
  8. package/dist/components/organisms/header/RightSlot.vue.js +5 -5
  9. package/dist/components/organisms/header/RightSlot.vue2.js +20 -19
  10. package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
  11. package/dist/components/organisms/header/ViewOptions.vue2.js +8 -10
  12. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +20 -0
  13. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +58 -0
  14. package/dist/components/wrappers/{WpModal.vue.d.ts → WpDrawer.vue.d.ts} +27 -40
  15. package/dist/components/wrappers/WpDrawer.vue.js +25 -0
  16. package/dist/components/wrappers/WpDrawer.vue2.js +23 -0
  17. package/dist/composables/useActionsApi.d.ts +0 -2
  18. package/dist/composables/useActionsApi.js +36 -52
  19. package/dist/composables/useStripo.js +13 -9
  20. package/dist/composables/useValidation.d.ts +30 -0
  21. package/dist/composables/useValidation.js +19 -0
  22. package/dist/composables/validators/saveAsTemplate.d.ts +26 -0
  23. package/dist/composables/validators/saveAsTemplate.js +21 -0
  24. package/dist/enums/defaults.js +5 -9
  25. package/dist/guido.css +1 -1
  26. package/dist/mock/api/template-library.d.ts +2 -0
  27. package/dist/node_modules/valibot/dist/index.js +157 -0
  28. package/dist/stores/editor.d.ts +2 -0
  29. package/dist/stores/editor.js +5 -3
  30. package/dist/stores/save-as-template.d.ts +25 -0
  31. package/dist/stores/save-as-template.js +44 -0
  32. package/package.json +2 -1
  33. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +0 -19
  34. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +0 -19
  35. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -4
  36. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +0 -22
  37. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +0 -30
  38. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -2
  39. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +0 -19
  40. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +0 -29
  41. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -2
  42. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +0 -22
  43. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +0 -30
  44. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -2
  45. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  46. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  47. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -2
  48. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +0 -18
  49. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +0 -22
  50. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -4
  51. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +0 -19
  52. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +0 -23
  53. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -4
  54. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +0 -20
  55. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +0 -21
  56. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -2
  57. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +0 -17
  58. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +0 -22
  59. package/dist/components/wrappers/WpModal.vue.js +0 -27
  60. package/dist/components/wrappers/WpModal.vue2.js +0 -22
  61. package/dist/composables/useCodeEditorApi.d.ts +0 -4
  62. package/dist/composables/useCodeEditorApi.js +0 -11
  63. package/dist/composables/useConfig.d.ts +0 -5
  64. package/dist/composables/useConfig.js +0 -11
  65. package/dist/composables/useDebounce.d.ts +0 -4
  66. package/dist/composables/useDebounce.js +0 -12
  67. package/dist/composables/usePreviewMode.d.ts +0 -5
  68. package/dist/composables/usePreviewMode.js +0 -31
  69. package/dist/composables/useResponsivePreview.d.ts +0 -5
  70. package/dist/composables/useResponsivePreview.js +0 -86
  71. package/dist/enums/preview.d.ts +0 -13
  72. package/dist/enums/preview.js +0 -23
  73. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  74. package/dist/static/assets/phone-mockup.svg.js +0 -4
  75. package/dist/stores/preview.d.ts +0 -89
  76. package/dist/stores/preview.js +0 -63
  77. /package/dist/components/organisms/{email-preview/PreviewContainer.vue.d.ts → save-as-template/SaveAsTemplateDrawer.vue.d.ts} +0 -0
@@ -3,14 +3,9 @@ export type GuidoConfig = {
3
3
  translationsPath: string;
4
4
  htmlCompilerRules?: CompilerRule[];
5
5
  ignoreDefaultHtmlCompilerRules?: boolean;
6
- emailHeader: EmailHeader;
7
6
  };
8
7
  export type DynamicContent = {
9
8
  value: string;
10
9
  text: string;
11
10
  fallback?: string;
12
11
  };
13
- export interface EmailHeader {
14
- senderName: string;
15
- subject: string;
16
- }
@@ -0,0 +1,11 @@
1
+ export interface MappedCategory {
2
+ value: string;
3
+ text: string;
4
+ }
5
+ export interface Category {
6
+ id: number;
7
+ name: string;
8
+ partnerId: number;
9
+ isStripo: boolean;
10
+ templatesCount: number;
11
+ }
@@ -15,6 +15,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
15
15
  insert: (data: DynamicContent) => void;
16
16
  close: () => void;
17
17
  };
18
+ hasChanges: import("vue").ComputedRef<boolean>;
18
19
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
19
20
  "dynamic-content:open": (detail: DynamicContent | null) => void;
20
21
  back: () => void;
@@ -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, e = i._self._c, r = i._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
- }, a = [], n = /* @__PURE__ */ t(
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" } }), r(t.SaveAsTemplateDrawer)], 1);
7
+ }, i = [], _ = /* @__PURE__ */ a(
8
8
  o,
9
9
  s,
10
- a,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "5fe1cbdf"
13
+ "202b6818"
14
14
  );
15
- const c = n.exports;
15
+ const m = _.exports;
16
16
  export {
17
- c as default
17
+ m as default
18
18
  };
@@ -1,12 +1,13 @@
1
- import { defineComponent as S, defineAsyncComponent as D, onMounted as E } from "vue";
2
- import { provideGuidoActions as P } 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 T from "./organisms/header/HeaderWrapper.vue.js";
7
- import { useStripoApi as A } from "../services/stripoApi.js";
8
- import { usePreviewStore as N } from "../stores/preview.js";
9
- const M = /* @__PURE__ */ S({
1
+ import { defineComponent as w, computed as D, onMounted as E } from "vue";
2
+ import { provideGuidoActions as _ } from "../composables/useGuidoActions.js";
3
+ import { usePartner as G } from "../composables/usePartner.js";
4
+ import { useStripo as I } from "../composables/useStripo.js";
5
+ import { DefaultUsername as T, DefaultGuidoConfig as k } from "../enums/defaults.js";
6
+ import P from "./organisms/header/HeaderWrapper.vue.js";
7
+ import A from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
8
+ import { useStripoApi as N } from "../services/stripoApi.js";
9
+ import { useEditorStore as x } from "../stores/editor.js";
10
+ const U = /* @__PURE__ */ w({
10
11
  __name: "Guido",
11
12
  props: {
12
13
  templateId: null,
@@ -19,65 +20,64 @@ const M = /* @__PURE__ */ S({
19
20
  guidoConfig: null
20
21
  },
21
22
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
22
- setup(C, { expose: b, emit: o }) {
23
- const t = C, w = D(
24
- () => import("./organisms/email-preview/PreviewContainer.vue.js")
25
- ), { getPartnerName: n, getProductType: c } = _(), h = N(), {
26
- templateId: a,
27
- userId: r,
28
- guidoConfig: i,
29
- html: s = "",
30
- css: d = "",
31
- partnerName: l = n(),
32
- productType: u = c(),
33
- username: m = I
34
- } = t;
23
+ setup(b, { expose: S, emit: t }) {
24
+ const o = b, n = x(), a = D(() => n.hasChanges), { getPartnerName: c, getProductType: s } = G(), {
25
+ templateId: r,
26
+ userId: i,
27
+ guidoConfig: d,
28
+ html: l = "",
29
+ css: u = "",
30
+ partnerName: m = c(),
31
+ productType: p = s(),
32
+ username: g = T
33
+ } = o;
35
34
  window.GuidoConfig = {
36
35
  ...k,
37
- ...i
36
+ ...d
38
37
  };
39
- const { initPlugin: p } = G({ emailId: a, userId: r, username: m, partnerName: l, productType: u }), { getDefaultTemplate: f } = A();
40
- P({
38
+ const { initPlugin: f } = I({ emailId: r, userId: i, username: g, partnerName: m, productType: p }), { getDefaultTemplate: y } = N();
39
+ _({
41
40
  onBack: () => {
42
- console.debug("guido:back"), o("back");
41
+ console.debug("guido:back"), t("back");
43
42
  },
44
43
  onSaveStart: () => {
45
- console.debug("guido:save:start"), o("save:start");
44
+ console.debug("guido:save:start"), t("save:start");
46
45
  },
47
46
  onSaveComplete: (e) => {
48
- console.debug("guido:save:complete", e), o("save:complete", e);
47
+ console.debug("guido:save:complete", e), t("save:complete", e);
49
48
  }
50
49
  });
51
- const g = (e) => {
50
+ const v = (e) => {
52
51
  console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
53
- }, v = () => {
52
+ }, C = () => {
54
53
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
55
54
  };
56
55
  return E(async () => {
57
56
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
58
57
  try {
59
58
  let e = {
60
- html: s,
61
- css: d,
59
+ html: l,
60
+ css: u,
62
61
  forceRecreate: !0
63
62
  // TODO: It should be false for old templates. We will communicate with Stripo
64
63
  };
65
- e.html || (e = await f()), await p(e);
64
+ e.html || (e = await y()), await f(e);
66
65
  } catch (e) {
67
66
  console.error("Failed to initialize Stripo editor:", e);
68
67
  }
69
68
  document.addEventListener("dynamic-content:open", (e) => {
70
- const y = e;
71
- console.debug("dynamic-content:open", y.detail), o("dynamic-content:open", y.detail);
69
+ const h = e;
70
+ console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
72
71
  });
73
- }), b({
72
+ }), S({
74
73
  dynamicContent: {
75
- insert: g,
76
- close: v
77
- }
78
- }), { __sfc: !0, PreviewContainer: w, props: t, getPartnerName: n, getProductType: c, previewStore: h, templateId: a, userId: r, guidoConfig: i, html: s, css: d, partnerName: l, productType: u, username: m, emit: o, initPlugin: p, getDefaultTemplate: f, insertDynamicContent: g, closeDynamicContent: v, HeaderWrapper: T };
74
+ insert: v,
75
+ close: C
76
+ },
77
+ hasChanges: a
78
+ }), { __sfc: !0, props: o, editorStore: n, hasChanges: a, getPartnerName: c, getProductType: s, templateId: r, userId: i, guidoConfig: d, html: l, css: u, partnerName: m, productType: p, username: g, emit: t, initPlugin: f, getDefaultTemplate: y, insertDynamicContent: v, closeDynamicContent: C, HeaderWrapper: P, SaveAsTemplateDrawer: A };
79
79
  }
80
80
  });
81
81
  export {
82
- M as default
82
+ U as default
83
83
  };
@@ -1,17 +1,17 @@
1
- import i from "./MiddleSlot.vue2.js";
2
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import s from "./MiddleSlot.vue2.js";
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.previewStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1 } }), 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.previewStore.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, "selected-status": t.previewStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreviewToggle } }), e(t.ViewOptions, { staticClass: "ml-3" }), t.previewStore.isPreviewModeOpen ? e(t.AmpToggle) : o._e()], 1);
6
- }, r = [], d = /* @__PURE__ */ s(
7
- i,
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,
8
8
  n,
9
- r,
9
+ l,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const u = d.exports;
14
+ const p = r.exports;
15
15
  export {
16
- u as default
16
+ p as default
17
17
  };
@@ -1,27 +1,22 @@
1
- import { defineComponent as p, computed as m } from "vue";
2
- import { usePreviewMode as l } from "../../../composables/usePreviewMode.js";
3
- import { useTranslations as c } from "../../../composables/useTranslations.js";
4
- import f from "../email-preview/amp/AmpToggle.vue.js";
5
- import { useEditorStore as a } from "../../../stores/editor.js";
6
- import { usePreviewStore as d } from "../../../stores/preview.js";
7
- import { InButtonV2 as w } from "@useinsider/design-system-vue";
8
- import v from "./version-history/VersionHistory.vue.js";
9
- import u from "./version-history/ViewOptions.vue.js";
10
- import P from "./ViewOptions.vue.js";
11
- const B = /* @__PURE__ */ p({
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({
12
9
  __name: "MiddleSlot",
13
- setup(g) {
14
- const r = a(), o = c(), e = d(), { openPreviewMode: t, closePreviewMode: i } = l(), s = m(() => o(e.isPreviewModeOpen ? "newsletter.close-email-preview" : "newsletter.email-preview"));
15
- return { __sfc: !0, editorStore: r, trans: o, previewStore: e, openPreviewMode: t, closePreviewMode: i, previewTooltipText: s, getTooltipOptions: (n) => ({
16
- id: `${n}-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
- }), handlePreviewToggle: () => {
21
- e.isPreviewModeOpen ? i() : t();
22
- }, AmpToggle: f, InButtonV2: w, VersionHistory: v, VersionHistoryViewOptions: u, ViewOptions: P };
17
+ }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
23
18
  }
24
19
  });
25
20
  export {
26
- B as default
21
+ y as default
27
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.previewStore.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.isSaveButtonDisabled }, on: { click: t.handleSave } })], 1);
6
- }, a = [], r = /* @__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.handleSaveAs } }), 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
+ }, r = [], a = /* @__PURE__ */ i(
7
7
  o,
8
8
  n,
9
- a,
9
+ r,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const c = r.exports;
14
+ const u = a.exports;
15
15
  export {
16
- c as default
16
+ u as default
17
17
  };
@@ -1,24 +1,26 @@
1
- import { defineComponent as u, computed as f } from "vue";
2
- import { useActionsApi as d } from "../../../composables/useActionsApi.js";
3
- import { useExport as S } from "../../../composables/useExport.js";
4
- import { useSaveStart as v, useSaveComplete as y } from "../../../composables/useGuidoActions.js";
5
- import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
6
- import { useEditorStore as H } from "../../../stores/editor.js";
7
- import { usePreviewStore as V } from "../../../stores/preview.js";
8
- import { InButtonV2 as h } from "@useinsider/design-system-vue";
9
- const b = /* @__PURE__ */ u({
1
+ import { defineComponent as m } from "vue";
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 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 w = /* @__PURE__ */ m({
10
9
  __name: "RightSlot",
11
- setup(w) {
12
- const { exportHtml: p } = S(), { getCompiledEmail: e } = d(), r = v(), s = y(), { openVersionHistory: i, closeVersionHistory: n } = _(), o = H(), m = V(), a = () => {
13
- if (o.isVersionHistoryOpen) {
14
- n();
10
+ setup(h) {
11
+ const { exportHtml: a } = c(), { getCompiledEmail: o } = p(), r = l(), s = d(), { openVersionHistory: n, closeVersionHistory: i } = f(), e = u();
12
+ return { __sfc: !0, exportHtml: a, getCompiledEmail: o, saveStart: r, saveComplete: s, openVersionHistory: n, closeVersionHistory: i, editorStore: e, handleVersionHistory: () => {
13
+ if (e.isVersionHistoryOpen) {
14
+ i();
15
15
  return;
16
16
  }
17
- i();
18
- }, c = async () => {
17
+ n();
18
+ }, handleSaveAs: () => {
19
+ e.isSaveAsTemplateDrawerOpen = !0;
20
+ }, handleSave: async () => {
19
21
  r();
20
22
  try {
21
- const { html: t } = await e();
23
+ const { html: t } = await o();
22
24
  s({
23
25
  html: t || "",
24
26
  css: ""
@@ -27,10 +29,9 @@ const b = /* @__PURE__ */ u({
27
29
  } catch (t) {
28
30
  console.error("Failed to get template data for save:", t);
29
31
  }
30
- }, l = f(() => o.isVersionHistoryOpen || m.isPreviewModeOpen);
31
- return { __sfc: !0, exportHtml: p, getCompiledEmail: e, saveStart: r, saveComplete: s, openVersionHistory: i, closeVersionHistory: n, editorStore: o, previewStore: m, handleVersionHistory: a, handleSave: c, isSaveButtonDisabled: l, InButtonV2: h };
32
+ }, InButtonV2: S };
32
33
  }
33
34
  });
34
35
  export {
35
- b as default
36
+ w as default
36
37
  };
@@ -1,18 +1,18 @@
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.previewStore.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
- "c4fe2637"
13
+ "0fff376c"
14
14
  );
15
- const d = _.exports;
15
+ const l = _.exports;
16
16
  export {
17
- d as default
17
+ l as default
18
18
  };
@@ -1,17 +1,15 @@
1
- import { defineComponent as r } from "vue";
2
- import { useEditorStore as i } from "../../../stores/editor.js";
3
- import { usePreviewStore as n } from "../../../stores/preview.js";
4
- import { InSegments as s } from "@useinsider/design-system-vue";
5
- const _ = /* @__PURE__ */ r({
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({
6
5
  __name: "ViewOptions",
7
- setup(m) {
8
- const e = i(), t = [
6
+ setup(n) {
7
+ return { __sfc: !0, editorStore: t(), segmentList: [
9
8
  { text: "", icon: "line-desktop", value: "desktop" },
10
9
  { text: "", icon: "line-menu-mobileapp", value: "mobile" }
11
- ], o = n();
12
- return { __sfc: !0, editorStore: e, segmentList: t, previewStore: o, InSegments: s };
10
+ ], InSegments: o };
13
11
  }
14
12
  });
15
13
  export {
16
- _ as default
14
+ u as default
17
15
  };
@@ -0,0 +1,20 @@
1
+ import s from "./SaveAsTemplateDrawer.vue2.js";
2
+ import l from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var r = function() {
4
+ var a = this, e = a._self._c, t = a._self._setupProxy;
5
+ return e(t.WpDrawer, { attrs: { id: "save-as-template-modal", "description-status": "", "description-text": t.trans("newsletter.save-template-description"), "footer-button-group-options": t.footerButtonGroupOptions, status: t.editorStore.isSaveAsTemplateDrawerOpen, "title-text": t.trans("products.save-template") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.saveTemplate } }, [e(t.InBasicTextInput, { staticClass: "mb-5 w-1", attrs: { id: "template-name-input", name: "templateName", "character-counter-status": !1, "disabled-status": t.isSaving, "label-text": t.trans("products.template-name"), "placeholder-text": t.trans("newsletter.enter-template-name"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, "state-message": t.templateNameError, states: t.templateNameError ? "error" : "default", "tooltip-status": !1, value: t.saveAsTemplateStore.templateName }, on: { input: t.handleTemplateName } }), e(t.InMultiSelect, { staticClass: "template-category-dropdown mb-5 w-1", attrs: { "create-option-status": "", "search-status": "", "button-status": !1, "character-limit-validation-text": t.trans("validation-v2.duration-value", {
6
+ min: 1,
7
+ max: 25
8
+ }), "create-button-label": t.trans("products.create-new-category"), "disabled-status": t.isSaving, "label-text": t.trans("products.template-category"), "loading-state": t.isAddingOption, "max-character-limit": 25, options: t.saveAsTemplateStore.categories, "placeholder-text": t.trans("products.select-template-category"), "skeleton-sizing": { width: 495, height: 44 }, "skeleton-status": t.saveAsTemplateStore.skeletonStatus, value: t.saveAsTemplateStore.selectedCategories }, on: { addOption: t.handleAddOption, change: t.handleCategoryChange, resetAllOptions: t.handleResetAllOptions, selectAllOptions: t.handleSelectAllOptions } })], 1);
9
+ }, o = [], n = /* @__PURE__ */ l(
10
+ s,
11
+ r,
12
+ o,
13
+ !1,
14
+ null,
15
+ null
16
+ );
17
+ const c = n.exports;
18
+ export {
19
+ c as default
20
+ };
@@ -0,0 +1,58 @@
1
+ import { defineComponent as N, ref as i, computed as _, toRef as h } from "vue";
2
+ import A from "../../wrappers/WpDrawer.vue.js";
3
+ import { useTranslations as C } from "../../../composables/useTranslations.js";
4
+ import { useTemplateNameValidator as b } from "../../../composables/validators/saveAsTemplate.js";
5
+ import { useEditorStore as w } from "../../../stores/editor.js";
6
+ import { useSaveAsTemplateStore as O } from "../../../stores/save-as-template.js";
7
+ import { InMultiSelect as B, InBasicTextInput as x } from "@useinsider/design-system-vue";
8
+ const z = /* @__PURE__ */ N({
9
+ __name: "SaveAsTemplateDrawer",
10
+ setup(D) {
11
+ const s = C(), o = w(), t = O(), a = i(!1), l = i(!1), p = _(() => ({
12
+ primaryButton: {
13
+ styling: "solid",
14
+ type: "primary",
15
+ labelText: s(a.value ? "newsletter.saving" : "products.save"),
16
+ loadingStatus: a.value,
17
+ disabledStatus: t.skeletonStatus
18
+ },
19
+ cancelOrBackButton: {
20
+ styling: "ghost",
21
+ type: "secondary",
22
+ labelText: s("products.cancel"),
23
+ disabledStatus: a.value
24
+ }
25
+ })), r = i(""), c = b(h(t, "templateName")), n = () => {
26
+ const e = c.validate();
27
+ return r.value = e.errorMessage, e.success;
28
+ }, u = () => {
29
+ o.isSaveAsTemplateDrawerOpen = !1;
30
+ }, d = (e) => {
31
+ t.templateName = e, r.value && n();
32
+ }, f = async (e) => {
33
+ l.value = !0, await t.createCategory(e), l.value = !1;
34
+ }, v = (e) => {
35
+ t.selectedCategories = [...e];
36
+ }, g = (e) => {
37
+ e && (t.selectedCategories = [...e]);
38
+ }, S = () => {
39
+ t.selectedCategories = [];
40
+ }, T = () => {
41
+ if (a.value = !0, !n()) {
42
+ a.value = !1;
43
+ return;
44
+ }
45
+ setTimeout(() => {
46
+ console.debug("💾 Saved", t.getTemplateName), a.value = !1;
47
+ }, 3e3);
48
+ }, m = async () => {
49
+ t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1;
50
+ };
51
+ return o.$subscribe((e, { isSaveAsTemplateDrawerOpen: y }) => {
52
+ y && m();
53
+ }), { __sfc: !0, trans: s, editorStore: o, saveAsTemplateStore: t, isSaving: a, isAddingOption: l, footerButtonGroupOptions: p, templateNameError: r, nameValidator: c, validateTemplateName: n, closeModal: u, handleTemplateName: d, handleAddOption: f, handleCategoryChange: v, handleSelectAllOptions: g, handleResetAllOptions: S, saveTemplate: T, initializeDrawer: m, WpDrawer: A, InBasicTextInput: x, InMultiSelect: B };
54
+ }
55
+ });
56
+ export {
57
+ z as default
58
+ };
@@ -1,54 +1,41 @@
1
- interface FooterButtonGroup {
2
- primaryButton?: {
3
- type: string;
4
- labelText: string;
5
- disabledStatus?: boolean;
6
- };
7
- cancelOrBackButton?: {
8
- type: string;
9
- labelText: string;
10
- styling: string;
11
- };
12
- }
13
- type __VLS_Props = {
1
+ import type { FooterButtonGroupOptions } from '@@/Types/wrappers/wp-drawer';
2
+ interface Props {
14
3
  id: string;
15
- title: string;
16
- description?: string;
17
- size?: 'small' | 'medium' | 'large';
18
- footerButtonOptions?: FooterButtonGroup;
19
- closeButtonStatus?: boolean;
4
+ className?: string;
5
+ size?: string;
20
6
  closeOnOutsideClick?: boolean;
21
- footerStatus?: boolean;
22
- };
23
- declare var __VLS_13: {};
7
+ descriptionStatus?: boolean;
8
+ descriptionText?: string;
9
+ footerButtonGroupOptions: FooterButtonGroupOptions;
10
+ status: boolean;
11
+ titleText: string;
12
+ }
13
+ declare var __VLS_12: {};
24
14
  type __VLS_Slots = {} & {
25
- default?: (props: typeof __VLS_13) => any;
15
+ default?: (props: typeof __VLS_12) => any;
26
16
  };
27
- declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
28
- description: string;
17
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
18
+ className: string;
29
19
  size: string;
30
- footerButtonOptions: undefined;
31
- closeButtonStatus: boolean;
32
20
  closeOnOutsideClick: boolean;
33
- footerStatus: boolean;
21
+ descriptionStatus: boolean;
22
+ descriptionText: string;
34
23
  }>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
35
- close: () => void;
36
- "primary-action": () => void;
37
- "secondary-action": () => void;
38
- }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
39
- description: string;
24
+ cancelOrBackButtonEvent: () => void;
25
+ onCloseEvent: () => void;
26
+ primaryButtonEvent: () => void;
27
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
28
+ className: string;
40
29
  size: string;
41
- footerButtonOptions: undefined;
42
- closeButtonStatus: boolean;
43
30
  closeOnOutsideClick: boolean;
44
- footerStatus: boolean;
31
+ descriptionStatus: boolean;
32
+ descriptionText: string;
45
33
  }>>>, {
46
- size: "small" | "medium" | "large";
47
- description: string;
48
- footerButtonOptions: FooterButtonGroup;
49
- closeButtonStatus: boolean;
34
+ className: string;
35
+ size: string;
50
36
  closeOnOutsideClick: boolean;
51
- footerStatus: boolean;
37
+ descriptionStatus: boolean;
38
+ descriptionText: string;
52
39
  }>;
53
40
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
54
41
  export default _default;
@@ -0,0 +1,25 @@
1
+ import r from "./WpDrawer.vue2.js";
2
+ import s from "../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var t = this, n = t._self._c, e = t._self._setupProxy;
5
+ return n(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(o) {
6
+ return e.emit("cancelOrBackButtonEvent");
7
+ }, onCloseEvent: function(o) {
8
+ return e.emit("onCloseEvent");
9
+ }, primaryButtonEvent: function(o) {
10
+ return e.emit("primaryButtonEvent");
11
+ } }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
12
+ return [n("div", [t._t("default")], 2)];
13
+ }, proxy: !0 }], null, !0) });
14
+ }, u = [], c = /* @__PURE__ */ s(
15
+ r,
16
+ i,
17
+ u,
18
+ !1,
19
+ null,
20
+ null
21
+ );
22
+ const f = c.exports;
23
+ export {
24
+ f as default
25
+ };
@@ -0,0 +1,23 @@
1
+ import { defineComponent as e } from "vue";
2
+ import { InDrawer as o } from "@useinsider/design-system-vue";
3
+ const r = /* @__PURE__ */ e({
4
+ __name: "WpDrawer",
5
+ props: {
6
+ id: null,
7
+ className: { default: "" },
8
+ size: { default: "small" },
9
+ closeOnOutsideClick: { type: Boolean, default: !0 },
10
+ descriptionStatus: { type: Boolean, default: !1 },
11
+ descriptionText: { default: "" },
12
+ footerButtonGroupOptions: null,
13
+ status: { type: Boolean },
14
+ titleText: null
15
+ },
16
+ emits: ["cancelOrBackButtonEvent", "onCloseEvent", "primaryButtonEvent"],
17
+ setup(n, { emit: t }) {
18
+ return { __sfc: !0, emit: t, InDrawer: o };
19
+ }
20
+ });
21
+ export {
22
+ r as default
23
+ };
@@ -1,7 +1,5 @@
1
- import type { CompileEmailOptions } from '@@/Types/actions-api';
2
1
  import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
3
2
  export declare const useActionsApi: () => {
4
3
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
5
4
  activateCustomViewStyles: (isActive?: boolean) => void;
6
- getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
7
5
  };