@useinsider/guido 1.0.0-beta.f3dd8d9 → 1.0.0-beta.f57520c

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 (61) hide show
  1. package/dist/@types/generic.d.ts +0 -4
  2. package/dist/@types/save-as-template.d.ts +11 -0
  3. package/dist/components/Guido.vue.d.ts +2 -2
  4. package/dist/components/Guido.vue.js +7 -7
  5. package/dist/components/Guido.vue2.js +39 -39
  6. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  7. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -18
  8. package/dist/components/organisms/header/RightSlot.vue.js +3 -3
  9. package/dist/components/organisms/header/RightSlot.vue2.js +18 -16
  10. package/dist/components/organisms/header/ViewOptions.vue.js +6 -6
  11. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +20 -0
  12. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +58 -0
  13. package/dist/components/wrappers/WpDrawer.vue.d.ts +63 -0
  14. package/dist/components/wrappers/WpDrawer.vue.js +25 -0
  15. package/dist/components/wrappers/WpDrawer.vue2.js +23 -0
  16. package/dist/composables/useStripo.js +13 -9
  17. package/dist/composables/useValidation.d.ts +30 -0
  18. package/dist/composables/useValidation.js +19 -0
  19. package/dist/composables/validators/saveAsTemplate.d.ts +26 -0
  20. package/dist/composables/validators/saveAsTemplate.js +21 -0
  21. package/dist/guido.css +1 -1
  22. package/dist/mock/api/template-library.d.ts +2 -0
  23. package/dist/node_modules/valibot/dist/index.js +157 -0
  24. package/dist/stores/editor.d.ts +2 -4
  25. package/dist/stores/editor.js +4 -6
  26. package/dist/stores/save-as-template.d.ts +25 -0
  27. package/dist/stores/save-as-template.js +44 -0
  28. package/package.json +2 -1
  29. package/dist/components/organisms/design-preview/AmpErrorModal.vue.d.ts +0 -16
  30. package/dist/components/organisms/design-preview/AmpErrorModal.vue.js +0 -21
  31. package/dist/components/organisms/design-preview/AmpErrorModal.vue2.js +0 -31
  32. package/dist/components/organisms/design-preview/DesktopPreview.vue.d.ts +0 -16
  33. package/dist/components/organisms/design-preview/DesktopPreview.vue.js +0 -22
  34. package/dist/components/organisms/design-preview/DesktopPreview.vue2.js +0 -29
  35. package/dist/components/organisms/design-preview/EmailPreview.vue.d.ts +0 -16
  36. package/dist/components/organisms/design-preview/EmailPreview.vue.js +0 -17
  37. package/dist/components/organisms/design-preview/EmailPreview.vue2.js +0 -33
  38. package/dist/components/organisms/design-preview/EmailView.vue.d.ts +0 -18
  39. package/dist/components/organisms/design-preview/EmailView.vue.js +0 -19
  40. package/dist/components/organisms/design-preview/EmailView.vue2.js +0 -24
  41. package/dist/components/organisms/design-preview/InboxView.vue.d.ts +0 -17
  42. package/dist/components/organisms/design-preview/InboxView.vue.js +0 -19
  43. package/dist/components/organisms/design-preview/InboxView.vue2.js +0 -23
  44. package/dist/components/organisms/design-preview/MobilePreview.vue.d.ts +0 -17
  45. package/dist/components/organisms/design-preview/MobilePreview.vue.js +0 -17
  46. package/dist/components/organisms/design-preview/MobilePreview.vue2.js +0 -23
  47. package/dist/components/organisms/header/AmpToggle.vue.js +0 -17
  48. package/dist/components/organisms/header/AmpToggle.vue2.js +0 -48
  49. package/dist/composables/useDebounce.d.ts +0 -4
  50. package/dist/composables/useDebounce.js +0 -12
  51. package/dist/composables/useMobileGmailFit.d.ts +0 -5
  52. package/dist/composables/useMobileGmailFit.js +0 -69
  53. package/dist/composables/usePreviewMode.d.ts +0 -6
  54. package/dist/composables/usePreviewMode.js +0 -19
  55. package/dist/enums/emailPreview.d.ts +0 -3
  56. package/dist/enums/emailPreview.js +0 -6
  57. package/dist/enums/gmailMobilePreview.d.ts +0 -7
  58. package/dist/enums/gmailMobilePreview.js +0 -17
  59. package/dist/inbox-mockup.svg +0 -39
  60. package/dist/phone-mockup.svg +0 -31
  61. /package/dist/components/organisms/{header/AmpToggle.vue.d.ts → save-as-template/SaveAsTemplateDrawer.vue.d.ts} +0 -0
@@ -9,7 +9,3 @@ export type DynamicContent = {
9
9
  text: string;
10
10
  fallback?: string;
11
11
  };
12
- export interface EmailData {
13
- senderName: string;
14
- subject: 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
+ }
@@ -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;
@@ -9,13 +9,13 @@ type __VLS_Props = {
9
9
  html?: string;
10
10
  css?: string;
11
11
  guidoConfig: GuidoConfig;
12
- emailData?: EmailData;
13
12
  };
14
13
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
15
14
  dynamicContent: {
16
15
  insert: (data: DynamicContent) => void;
17
16
  close: () => void;
18
17
  };
18
+ hasChanges: import("vue").ComputedRef<boolean>;
19
19
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
20
20
  "dynamic-content:open": (detail: DynamicContent | null) => void;
21
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, 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 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
- "7836f831"
13
+ "202b6818"
14
14
  );
15
- const m = d.exports;
15
+ const m = _.exports;
16
16
  export {
17
17
  m as default
18
18
  };
@@ -1,13 +1,13 @@
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({
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({
11
11
  __name: "Guido",
12
12
  props: {
13
13
  templateId: null,
@@ -17,27 +17,26 @@ const M = /* @__PURE__ */ w({
17
17
  username: null,
18
18
  html: null,
19
19
  css: null,
20
- guidoConfig: null,
21
- emailData: null
20
+ guidoConfig: null
22
21
  },
23
22
  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,
27
- userId: r,
28
- guidoConfig: i,
29
- html: s = "",
30
- css: l = "",
31
- partnerName: d = n(),
32
- productType: u = a(),
33
- username: m = G
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
34
33
  } = o;
35
34
  window.GuidoConfig = {
36
- ...I,
37
- ...i
35
+ ...k,
36
+ ...d
38
37
  };
39
- const { initPlugin: p } = _({ emailId: c, userId: r, username: m, partnerName: d, productType: u }), { getDefaultTemplate: f } = T(), h = N();
40
- S({
38
+ const { initPlugin: f } = I({ emailId: r, userId: i, username: g, partnerName: m, productType: p }), { getDefaultTemplate: y } = N();
39
+ _({
41
40
  onBack: () => {
42
41
  console.debug("guido:back"), t("back");
43
42
  },
@@ -48,36 +47,37 @@ const M = /* @__PURE__ */ w({
48
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
- }, y = () => {
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: l,
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 v = e;
71
- console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.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: y
77
- }
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 };
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,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,26 +1,22 @@
1
- import { defineComponent as p, computed as m } from "vue";
2
- import { usePreviewMode as d } from "../../../composables/usePreviewMode.js";
3
- import { useTranslations as f } from "../../../composables/useTranslations.js";
4
- import { useEditorStore as a } from "../../../stores/editor.js";
5
- import { InButtonV2 as c } from "@useinsider/design-system-vue";
6
- import l from "./AmpToggle.vue.js";
7
- import w from "./version-history/VersionHistory.vue.js";
8
- import P from "./version-history/ViewOptions.vue.js";
9
- import u from "./ViewOptions.vue.js";
10
- const C = /* @__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({
11
9
  __name: "MiddleSlot",
12
- setup(v) {
13
- const o = a(), t = f(), { enablePreviewUI: e, disablePreviewUI: i } = d(), r = () => {
14
- o.isPreviewModeOpen = !o.isPreviewModeOpen, o.isPreviewModeOpen ? e() : i();
15
- }, s = m(() => o.isPreviewModeOpen);
16
- return { __sfc: !0, editorStore: o, trans: t, enablePreviewUI: e, disablePreviewUI: i, handlePreviewClick: r, isPreviewModeOpen: s, getTooltipOptions: (n) => ({
17
- 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`,
18
14
  dynamicPosition: !1,
19
15
  staticPosition: "bottom center",
20
16
  iconStatus: !1
21
- }), InButtonV2: c, AmpToggle: l, VersionHistory: w, VersionHistoryViewOptions: P, ViewOptions: u };
17
+ }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
22
18
  }
23
19
  });
24
20
  export {
25
- C as default
21
+ y as default
26
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.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);
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,35 +1,37 @@
1
1
  import { defineComponent as m } from "vue";
2
2
  import { useActionsApi as p } from "../../../composables/useActionsApi.js";
3
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";
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
7
  import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
- const E = /* @__PURE__ */ m({
8
+ const w = /* @__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: 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
- s();
17
+ n();
18
+ }, handleSaveAs: () => {
19
+ e.isSaveAsTemplateDrawerOpen = !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
+ w 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 {
@@ -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
+ };
@@ -0,0 +1,63 @@
1
+ import type { FooterButtonGroupOptions } from '@@/Types/wrappers/wp-drawer';
2
+ interface Props {
3
+ id: string;
4
+ className?: string;
5
+ size?: string;
6
+ closeOnOutsideClick?: boolean;
7
+ descriptionStatus?: boolean;
8
+ descriptionText?: string;
9
+ footerButtonGroupOptions: FooterButtonGroupOptions;
10
+ status: boolean;
11
+ titleText: 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<Props>, {
18
+ className: string;
19
+ size: string;
20
+ closeOnOutsideClick: boolean;
21
+ descriptionStatus: boolean;
22
+ descriptionText: string;
23
+ }>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
24
+ cancelOrBackButtonEvent: () => void;
25
+ onCloseEvent: () => void;
26
+ primaryButtonEvent: () => void;
27
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
28
+ className: string;
29
+ size: string;
30
+ closeOnOutsideClick: boolean;
31
+ descriptionStatus: boolean;
32
+ descriptionText: string;
33
+ }>>>, {
34
+ className: string;
35
+ size: string;
36
+ closeOnOutsideClick: boolean;
37
+ descriptionStatus: boolean;
38
+ descriptionText: string;
39
+ }>;
40
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
41
+ export default _default;
42
+ type __VLS_WithDefaults<P, D> = {
43
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
44
+ default: D[K];
45
+ }> : P[K];
46
+ };
47
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
48
+ type __VLS_TypePropsToOption<T> = {
49
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
50
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
51
+ } : {
52
+ type: import('vue').PropType<T[K]>;
53
+ required: true;
54
+ };
55
+ };
56
+ type __VLS_WithSlots<T, S> = T & {
57
+ new (): {
58
+ $scopedSlots: S;
59
+ };
60
+ };
61
+ type __VLS_PrettifyLocal<T> = {
62
+ [K in keyof T]: T[K];
63
+ } & {};
@@ -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,13 +1,13 @@
1
1
  import { useActionsApi as g } from "./useActionsApi.js";
2
2
  import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
- import { useToaster as E } from "./useToaster.js";
4
- import { displayConditions as S } from "../enums/displayConditions.js";
5
- import y from "../extensions/DynamicContent/extension.js";
6
- import { useStripoApi as C } from "../services/stripoApi.js";
7
- import { useEditorStore as w } from "../stores/editor.js";
3
+ import { useToaster as S } from "./useToaster.js";
4
+ import { displayConditions as C } from "../enums/displayConditions.js";
5
+ import E from "../extensions/DynamicContent/extension.js";
6
+ import { useStripoApi as y } from "../services/stripoApi.js";
7
+ import { useEditorStore as h } from "../stores/editor.js";
8
8
  const A = (a) => {
9
- const { handleError: d } = E(), { getToken: c, getCustomFonts: u } = C(), l = (e, r = []) => {
10
- const i = w(), { html: t, css: s, forceRecreate: m } = e;
9
+ const { handleError: d } = S(), { getToken: c, getCustomFonts: u } = y(), l = (e, r = []) => {
10
+ const i = h(), { html: t, css: s, forceRecreate: m } = e;
11
11
  window.UIEditor.initEditor(
12
12
  document.querySelector("#guido-editor"),
13
13
  {
@@ -30,7 +30,8 @@ const A = (a) => {
30
30
  `,
31
31
  conditionsEnabled: !0,
32
32
  customConditionsEnabled: !0,
33
- conditionCategories: S,
33
+ conditionCategories: C,
34
+ enableXSSSecurity: !0,
34
35
  messageSettingsEnabled: !1,
35
36
  editorFonts: {
36
37
  showDefaultStandardFonts: !0,
@@ -62,8 +63,11 @@ const A = (a) => {
62
63
  onVersionHistoryVisibilityChanged(o) {
63
64
  i.isVersionHistoryOpen = o;
64
65
  },
66
+ onDataChanged() {
67
+ i.hasChanges = !0;
68
+ },
65
69
  ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
66
- extensions: [y]
70
+ extensions: [E]
67
71
  }
68
72
  );
69
73
  }, p = (e) => new Promise((r, i) => {
@@ -0,0 +1,30 @@
1
+ import { type BaseIssue, type BaseSchema } from 'valibot';
2
+ import { type Ref } from 'vue';
3
+ type Base = BaseSchema<unknown, unknown, BaseIssue<unknown>>;
4
+ type MaybeRefOrGetter<T> = T | Ref<T> | (() => T);
5
+ export declare function useValidation<const Schema extends Base = Base>(input: MaybeRefOrGetter<unknown>, schema: Schema): {
6
+ schema: Schema;
7
+ validate: () => {
8
+ error: import("valibot").InferIssue<Schema> | undefined;
9
+ errorMessage: string;
10
+ typed: true;
11
+ success: true;
12
+ output: import("valibot").InferOutput<Schema>;
13
+ issues: undefined;
14
+ } | {
15
+ error: import("valibot").InferIssue<Schema> | undefined;
16
+ errorMessage: string;
17
+ typed: true;
18
+ success: false;
19
+ output: import("valibot").InferOutput<Schema>;
20
+ issues: [import("valibot").InferIssue<Schema>, ...import("valibot").InferIssue<Schema>[]];
21
+ } | {
22
+ error: import("valibot").InferIssue<Schema> | undefined;
23
+ errorMessage: string;
24
+ typed: false;
25
+ success: false;
26
+ output: unknown;
27
+ issues: [import("valibot").InferIssue<Schema>, ...import("valibot").InferIssue<Schema>[]];
28
+ };
29
+ };
30
+ export {};