@useinsider/guido 1.0.0-beta.637a8ae → 1.0.0-beta.63d99fe

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 (82) hide show
  1. package/dist/@types/generic.d.ts +4 -5
  2. package/dist/@types/save-as-template.d.ts +11 -0
  3. package/dist/components/Guido.vue.d.ts +6 -1
  4. package/dist/components/Guido.vue.js +11 -11
  5. package/dist/components/Guido.vue2.js +58 -41
  6. package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
  7. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -16
  8. package/dist/components/organisms/header/RightSlot.vue.js +3 -3
  9. package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
  10. package/dist/components/organisms/header/ViewOptions.vue.js +7 -7
  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/{BaseModal.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 -47
  19. package/dist/composables/useStripo.js +25 -15
  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 +6 -10
  25. package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
  26. package/dist/guido.css +1 -1
  27. package/dist/mock/api/template-library.d.ts +2 -0
  28. package/dist/node_modules/valibot/dist/index.js +157 -0
  29. package/dist/stores/dynamic-content.d.ts +27 -0
  30. package/dist/stores/dynamic-content.js +23 -0
  31. package/dist/stores/editor.d.ts +2 -1
  32. package/dist/stores/editor.js +5 -4
  33. package/dist/stores/save-as-template.d.ts +25 -0
  34. package/dist/stores/save-as-template.js +44 -0
  35. package/dist/utils/arrayUtil.d.ts +1 -0
  36. package/dist/utils/arrayUtil.js +10 -0
  37. package/dist/utils/genericUtil.d.ts +2 -0
  38. package/dist/utils/genericUtil.js +7 -0
  39. package/package.json +2 -1
  40. package/dist/components/organisms/email-preview/EmailPreviewContainer.vue.d.ts +0 -15
  41. package/dist/components/organisms/email-preview/EmailPreviewContainer.vue.js +0 -17
  42. package/dist/components/organisms/email-preview/EmailPreviewContainer.vue2.js +0 -32
  43. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -16
  44. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +0 -19
  45. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +0 -37
  46. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +0 -17
  47. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +0 -57
  48. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -16
  49. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +0 -22
  50. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +0 -39
  51. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -15
  52. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  53. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -15
  54. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -19
  55. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +0 -17
  56. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +0 -17
  57. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -17
  58. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +0 -19
  59. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +0 -23
  60. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -17
  61. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +0 -17
  62. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +0 -27
  63. package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue.d.ts +0 -17
  64. package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue.js +0 -19
  65. package/dist/components/organisms/email-preview/mobile-preview/OpenedEmailView.vue2.js +0 -26
  66. package/dist/components/wrappers/BaseModal.vue.js +0 -19
  67. package/dist/components/wrappers/BaseModal.vue2.js +0 -22
  68. package/dist/composables/useCodeEditorApi.d.ts +0 -5
  69. package/dist/composables/useCodeEditorApi.js +0 -17
  70. package/dist/composables/useDebounce.d.ts +0 -4
  71. package/dist/composables/useDebounce.js +0 -12
  72. package/dist/composables/useEmailResponsiveFit.d.ts +0 -5
  73. package/dist/composables/useEmailResponsiveFit.js +0 -72
  74. package/dist/composables/usePreviewMode.d.ts +0 -6
  75. package/dist/composables/usePreviewMode.js +0 -21
  76. package/dist/enums/gmailMobilePreview.d.ts +0 -7
  77. package/dist/enums/gmailMobilePreview.js +0 -17
  78. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  79. package/dist/static/assets/phone-mockup.svg.js +0 -4
  80. package/dist/stores/preview.d.ts +0 -56
  81. package/dist/stores/preview.js +0 -23
  82. /package/dist/components/organisms/{email-preview/amp/AmpToggle.vue.d.ts → save-as-template/SaveAsTemplateDrawer.vue.d.ts} +0 -0
@@ -3,14 +3,13 @@ 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
- }
12
+ export type MergeTag = {
13
+ label: string;
14
+ value: string;
15
+ };
@@ -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
+ }
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  username?: string;
9
9
  html?: string;
10
10
  css?: string;
11
+ preselectedDynamicContentList: DynamicContent[];
11
12
  guidoConfig: GuidoConfig;
12
13
  };
13
14
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
@@ -15,11 +16,15 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
15
16
  insert: (data: DynamicContent) => void;
16
17
  close: () => void;
17
18
  };
19
+ hasChanges: import("vue").ComputedRef<boolean>;
18
20
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
19
21
  "dynamic-content:open": (detail: DynamicContent | null) => void;
20
22
  back: () => void;
21
23
  "save:start": () => void;
22
- "save:complete": (template: Omit<Template, "forceRecreate">) => void;
24
+ "save:complete": (data: {
25
+ template: Omit<Template, "forceRecreate">;
26
+ dynamicContentList: DynamicContent[];
27
+ }) => void;
23
28
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
24
29
  export default _default;
25
30
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,18 +1,18 @@
1
- import o from "./Guido.vue2.js";
1
+ import a from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import s from "../_virtual/_plugin-vue2_normalizer.js";
4
- var a = function() {
5
- var i = this, r = i._self._c, e = i._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper" }, [r(e.HeaderWrapper), e.isPreviewModeOpen ? r(e.EmailPreview, { attrs: { "email-header": e.guidoConfig.emailHeader } }) : i._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.isPreviewModeOpen, expression: "!isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
- }, t = [], d = /* @__PURE__ */ s(
8
- o,
3
+ import o from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
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__ */ o(
9
8
  a,
10
- t,
9
+ s,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "988dfdfd"
13
+ "ac2711fd"
14
14
  );
15
- const v = d.exports;
15
+ const f = _.exports;
16
16
  export {
17
- v as default
17
+ f as default
18
18
  };
@@ -1,12 +1,14 @@
1
- import { defineComponent as E, defineAsyncComponent as P, onMounted as D } from "vue";
2
- import { provideGuidoActions as S } from "../composables/useGuidoActions.js";
3
- import { usePartner as _ } from "../composables/usePartner.js";
4
- import { usePreviewMode as G } from "../composables/usePreviewMode.js";
5
- import { useStripo as I } from "../composables/useStripo.js";
6
- import { DefaultUsername as k, DefaultGuidoConfig as T } from "../enums/defaults.js";
1
+ import { defineComponent as w, computed as E, onMounted as _ } from "vue";
2
+ import { provideGuidoActions as G } from "../composables/useGuidoActions.js";
3
+ import { usePartner as I } from "../composables/usePartner.js";
4
+ import { useStripo as T } from "../composables/useStripo.js";
5
+ import { DefaultUsername as k, DefaultGuidoConfig as P } from "../enums/defaults.js";
7
6
  import A from "./organisms/header/HeaderWrapper.vue.js";
8
- import { useStripoApi as M } from "../services/stripoApi.js";
9
- const L = /* @__PURE__ */ E({
7
+ import N from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
8
+ import { useStripoApi as x } from "../services/stripoApi.js";
9
+ import { useDynamicContentStore as W } from "../stores/dynamic-content.js";
10
+ import { useEditorStore as z } from "../stores/editor.js";
11
+ const O = /* @__PURE__ */ w({
10
12
  __name: "Guido",
11
13
  props: {
12
14
  templateId: null,
@@ -16,66 +18,81 @@ const L = /* @__PURE__ */ E({
16
18
  username: null,
17
19
  html: null,
18
20
  css: null,
21
+ preselectedDynamicContentList: null,
19
22
  guidoConfig: null
20
23
  },
21
24
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
22
- setup(C, { expose: b, emit: o }) {
23
- const t = C, w = P(() => import("./organisms/email-preview/EmailPreviewContainer.vue.js")), { getPartnerName: n, getProductType: c } = _(), { isPreviewModeOpen: h } = G(), {
24
- templateId: a,
25
- userId: i,
26
- guidoConfig: s,
27
- html: r = "",
28
- css: d = "",
29
- partnerName: l = n(),
30
- productType: u = c(),
31
- username: m = k
32
- } = t;
25
+ setup(b, { expose: L, emit: t }) {
26
+ const o = b, n = W(), s = z(), a = E(() => s.hasChanges), c = o.preselectedDynamicContentList || [], { getPartnerName: i, getProductType: r } = I(), {
27
+ templateId: m,
28
+ userId: d,
29
+ guidoConfig: l,
30
+ html: u = "",
31
+ css: p = "",
32
+ partnerName: y = i(),
33
+ productType: g = r(),
34
+ username: C = k
35
+ } = o;
33
36
  window.GuidoConfig = {
34
- ...T,
35
- ...s
37
+ ...P,
38
+ ...l
36
39
  };
37
- const { initPlugin: p } = I({ emailId: a, userId: i, username: m, partnerName: l, productType: u }), { getDefaultTemplate: f } = M();
38
- S({
40
+ const { initPlugin: f } = T({
41
+ emailId: m,
42
+ userId: d,
43
+ username: C,
44
+ partnerName: y,
45
+ productType: g,
46
+ preselectedDynamicContentList: c
47
+ }), { getDefaultTemplate: v } = x();
48
+ G({
39
49
  onBack: () => {
40
- console.debug("guido:back"), o("back");
50
+ console.debug("guido:back"), t("back");
41
51
  },
42
52
  onSaveStart: () => {
43
- console.debug("guido:save:start"), o("save:start");
53
+ console.debug("guido:save:start"), t("save:start");
44
54
  },
45
55
  onSaveComplete: (e) => {
46
- console.debug("guido:save:complete", e), o("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
+ });
47
63
  }
48
64
  });
49
- const g = (e) => {
50
- console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
51
- }, v = () => {
65
+ const D = (e) => {
66
+ console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
67
+ }, S = () => {
52
68
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
53
69
  };
54
- return D(async () => {
70
+ return _(async () => {
55
71
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
56
72
  try {
57
73
  let e = {
58
- html: r,
59
- css: d,
74
+ html: u,
75
+ css: p,
60
76
  forceRecreate: !0
61
77
  // TODO: It should be false for old templates. We will communicate with Stripo
62
78
  };
63
- e.html || (e = await f()), await p(e);
79
+ e.html || (e = await v()), await f(e), n.selectedDynamicContentList = c;
64
80
  } catch (e) {
65
81
  console.error("Failed to initialize Stripo editor:", e);
66
82
  }
67
83
  document.addEventListener("dynamic-content:open", (e) => {
68
- const y = e;
69
- console.debug("dynamic-content:open", y.detail), o("dynamic-content:open", y.detail);
84
+ const h = e;
85
+ console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
70
86
  });
71
- }), b({
87
+ }), L({
72
88
  dynamicContent: {
73
- insert: g,
74
- close: v
75
- }
76
- }), { __sfc: !0, EmailPreview: w, props: t, getPartnerName: n, getProductType: c, isPreviewModeOpen: h, templateId: a, userId: i, guidoConfig: s, html: r, css: d, partnerName: l, productType: u, username: m, emit: o, initPlugin: p, getDefaultTemplate: f, insertDynamicContent: g, closeDynamicContent: v, HeaderWrapper: A };
89
+ insert: D,
90
+ close: S
91
+ },
92
+ hasChanges: a
93
+ }), { __sfc: !0, dynamicContentStore: n, props: o, editorStore: s, hasChanges: a, preselectedDynamicContentList: c, getPartnerName: i, getProductType: r, templateId: m, userId: d, guidoConfig: l, html: u, css: p, partnerName: y, productType: g, username: C, emit: t, initPlugin: f, getDefaultTemplate: v, insertDynamicContent: D, closeDynamicContent: S, HeaderWrapper: A, SaveAsTemplateDrawer: N };
77
94
  }
78
95
  });
79
96
  export {
80
- L as default
97
+ O as default
81
98
  };
@@ -1,17 +1,17 @@
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, "selected-status": t.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.togglePreviewMode } }), e(t.ViewOptions, { staticClass: "ml-3" }), t.isPreviewModeOpen ? e(t.AmpToggle) : o._e()], 1);
6
- }, d = [], l = /* @__PURE__ */ 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
7
  s,
8
8
  n,
9
- d,
9
+ l,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const u = l.exports;
14
+ const p = r.exports;
15
15
  export {
16
- u as default
16
+ p as default
17
17
  };
@@ -1,24 +1,22 @@
1
- import { defineComponent as n, computed as p } from "vue";
2
- import { usePreviewMode as m } from "../../../composables/usePreviewMode.js";
3
- import { useTranslations as l } from "../../../composables/useTranslations.js";
4
- import a from "../email-preview/amp/AmpToggle.vue.js";
5
- import { useEditorStore as f } from "../../../stores/editor.js";
6
- import { InButtonV2 as c } from "@useinsider/design-system-vue";
7
- import d from "./version-history/VersionHistory.vue.js";
8
- import u from "./version-history/ViewOptions.vue.js";
9
- import w from "./ViewOptions.vue.js";
10
- const H = /* @__PURE__ */ n({
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({
11
9
  __name: "MiddleSlot",
12
- setup(_) {
13
- const e = f(), o = l(), { isPreviewModeOpen: t, togglePreviewMode: i } = m(), r = p(() => o(t.value ? "newsletter.close-email-preview" : "newsletter.email-preview"));
14
- return { __sfc: !0, editorStore: e, trans: o, isPreviewModeOpen: t, togglePreviewMode: i, previewTooltipText: r, getTooltipOptions: (s) => ({
15
- id: `${s}-tooltip`,
10
+ setup(a) {
11
+ const o = n(), t = s();
12
+ return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
+ id: `${i}-tooltip`,
16
14
  dynamicPosition: !1,
17
15
  staticPosition: "bottom center",
18
16
  iconStatus: !1
19
- }), AmpToggle: a, InButtonV2: c, VersionHistory: d, VersionHistoryViewOptions: u, ViewOptions: w };
17
+ }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
20
18
  }
21
19
  });
22
20
  export {
23
- H as default
21
+ y as default
24
22
  };
@@ -2,7 +2,7 @@ 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.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.isPreviewModeOpen }, on: { click: t.handleSave } })], 1);
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
6
  }, r = [], a = /* @__PURE__ */ i(
7
7
  o,
8
8
  n,
@@ -11,7 +11,7 @@ var n = function() {
11
11
  null,
12
12
  null
13
13
  );
14
- const c = a.exports;
14
+ const u = a.exports;
15
15
  export {
16
- c as default
16
+ u as default
17
17
  };
@@ -1,36 +1,37 @@
1
- import { defineComponent as p } from "vue";
2
- import { useActionsApi as c } from "../../../composables/useActionsApi.js";
3
- import { useExport as l } from "../../../composables/useExport.js";
4
- import { useSaveStart as f, useSaveComplete as d } from "../../../composables/useGuidoActions.js";
5
- import { usePreviewMode as u } from "../../../composables/usePreviewMode.js";
6
- import { useVersionHistoryApi as v } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as S } from "../../../stores/editor.js";
8
- import { InButtonV2 as h } from "@useinsider/design-system-vue";
9
- const O = /* @__PURE__ */ p({
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(y) {
12
- const { exportHtml: m } = l(), { getCompiledEmail: e } = c(), t = f(), r = d(), { openVersionHistory: s, closeVersionHistory: i } = v(), n = S(), { isPreviewModeOpen: a } = u();
13
- return { __sfc: !0, exportHtml: m, getCompiledEmail: e, saveStart: t, saveComplete: r, openVersionHistory: s, closeVersionHistory: i, editorStore: n, isPreviewModeOpen: a, handleVersionHistory: () => {
14
- if (n.isVersionHistoryOpen) {
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) {
15
14
  i();
16
15
  return;
17
16
  }
18
- s();
17
+ n();
18
+ }, handleSaveAs: () => {
19
+ e.isSaveAsTemplateDrawerOpen = !0;
19
20
  }, handleSave: async () => {
20
- t();
21
+ r();
21
22
  try {
22
- const { html: o } = await e();
23
- r({
24
- html: o || "",
23
+ const { html: t } = await o();
24
+ s({
25
+ html: t || "",
25
26
  css: ""
26
27
  // CSS is embedded in HTML from Stripo
27
28
  });
28
- } catch (o) {
29
- console.error("Failed to get template data for save:", o);
29
+ } catch (t) {
30
+ console.error("Failed to get template data for save:", t);
30
31
  }
31
- }, InButtonV2: h };
32
+ }, InButtonV2: S };
32
33
  }
33
34
  });
34
35
  export {
35
- O as default
36
+ w as default
36
37
  };
@@ -1,16 +1,16 @@
1
- import s from "./ViewOptions.vue2.js";
1
+ import r from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var r = 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.isPreviewModeOpen, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
- }, n = [], _ = /* @__PURE__ */ i(
8
- s,
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(
9
8
  r,
10
9
  n,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "b81a01c5"
13
+ "0fff376c"
14
14
  );
15
15
  const l = _.exports;
16
16
  export {
@@ -1,17 +1,15 @@
1
- import { defineComponent as i } from "vue";
2
- import { usePreviewMode as n } from "../../../composables/usePreviewMode.js";
3
- import { useEditorStore as r } from "../../../stores/editor.js";
4
- import { InSegments as s } from "@useinsider/design-system-vue";
5
- const f = /* @__PURE__ */ i({
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 = r(), o = [
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
- ], { isPreviewModeOpen: t } = n();
12
- return { __sfc: !0, editorStore: e, segmentList: o, isPreviewModeOpen: t, InSegments: s };
10
+ ], InSegments: o };
13
11
  }
14
12
  });
15
13
  export {
16
- f 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), u = _(() => ({
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
+ }, m = () => {
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, m();
47
+ }, 3e3);
48
+ }, p = async () => {
49
+ t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1;
50
+ };
51
+ return o.$subscribe((e, { isSaveAsTemplateDrawerOpen: y }) => {
52
+ y && p();
53
+ }), { __sfc: !0, trans: s, editorStore: o, saveAsTemplateStore: t, isSaving: a, isAddingOption: l, footerButtonGroupOptions: u, templateNameError: r, nameValidator: c, validateTemplateName: n, closeModal: m, handleTemplateName: d, handleAddOption: f, handleCategoryChange: v, handleSelectAllOptions: g, handleResetAllOptions: S, saveTemplate: T, initializeDrawer: p, 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: 'primary';
4
- labelText: string;
5
- disabledStatus?: boolean;
6
- };
7
- cancelOrBackButton?: {
8
- type: 'secondary';
9
- labelText: string;
10
- styling: 'ghost';
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
+ };