@useinsider/guido 1.0.0-beta.cd820fb → 1.0.0-beta.d5d5bac

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 (60) hide show
  1. package/dist/@types/generic.d.ts +0 -5
  2. package/dist/components/Guido.vue.js +8 -8
  3. package/dist/components/Guido.vue2.js +25 -28
  4. package/dist/components/organisms/header/MiddleSlot.vue.js +9 -9
  5. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -17
  6. package/dist/components/organisms/header/RightSlot.vue.js +4 -4
  7. package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
  8. package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
  9. package/dist/components/organisms/header/ViewOptions.vue2.js +8 -10
  10. package/dist/composables/useActionsApi.d.ts +0 -2
  11. package/dist/composables/useActionsApi.js +36 -62
  12. package/dist/enums/defaults.js +5 -9
  13. package/dist/guido.css +1 -1
  14. package/package.json +1 -1
  15. package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +0 -2
  16. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +0 -19
  17. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +0 -19
  18. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -4
  19. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +0 -22
  20. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +0 -30
  21. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -2
  22. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +0 -19
  23. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +0 -29
  24. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -2
  25. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +0 -22
  26. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +0 -31
  27. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -2
  28. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  29. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  30. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -2
  31. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +0 -18
  32. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +0 -25
  33. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -4
  34. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +0 -19
  35. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +0 -23
  36. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -4
  37. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +0 -20
  38. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +0 -21
  39. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -2
  40. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +0 -17
  41. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +0 -22
  42. package/dist/components/wrappers/WpModal.vue.d.ts +0 -65
  43. package/dist/components/wrappers/WpModal.vue.js +0 -27
  44. package/dist/components/wrappers/WpModal.vue2.js +0 -22
  45. package/dist/composables/useCodeEditorApi.d.ts +0 -4
  46. package/dist/composables/useCodeEditorApi.js +0 -11
  47. package/dist/composables/useConfig.d.ts +0 -4
  48. package/dist/composables/useConfig.js +0 -7
  49. package/dist/composables/useDebounce.d.ts +0 -4
  50. package/dist/composables/useDebounce.js +0 -12
  51. package/dist/composables/usePreviewMode.d.ts +0 -5
  52. package/dist/composables/usePreviewMode.js +0 -31
  53. package/dist/composables/useResponsivePreview.d.ts +0 -5
  54. package/dist/composables/useResponsivePreview.js +0 -86
  55. package/dist/enums/preview.d.ts +0 -13
  56. package/dist/enums/preview.js +0 -23
  57. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  58. package/dist/static/assets/phone-mockup.svg.js +0 -4
  59. package/dist/stores/preview.d.ts +0 -64
  60. package/dist/stores/preview.js +0 -49
@@ -3,17 +3,12 @@ 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
- }
17
12
  export type MergeTag = {
18
13
  label: string;
19
14
  value: string;
@@ -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 i 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" } })], 1);
7
+ }, _ = [], a = /* @__PURE__ */ i(
8
8
  o,
9
9
  s,
10
- a,
10
+ _,
11
11
  !1,
12
12
  null,
13
- "4083db95"
13
+ "f9fbdc93"
14
14
  );
15
- const c = n.exports;
15
+ const f = a.exports;
16
16
  export {
17
- c as default
17
+ f as default
18
18
  };
@@ -1,13 +1,12 @@
1
- import { defineComponent as L, defineAsyncComponent as E, onMounted as P } 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 k, DefaultGuidoConfig as T } from "../enums/defaults.js";
6
- import A from "./organisms/header/HeaderWrapper.vue.js";
7
- import { useStripoApi as N } from "../services/stripoApi.js";
8
- import { useDynamicContentStore as x } from "../stores/dynamic-content.js";
9
- import { usePreviewStore as W } from "../stores/preview.js";
10
- const q = /* @__PURE__ */ L({
1
+ import { defineComponent as h, onMounted as L } from "vue";
2
+ import { provideGuidoActions as w } from "../composables/useGuidoActions.js";
3
+ import { usePartner as E } 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 k from "./organisms/header/HeaderWrapper.vue.js";
7
+ import { useStripoApi as P } from "../services/stripoApi.js";
8
+ import { useDynamicContentStore as T } from "../stores/dynamic-content.js";
9
+ const K = /* @__PURE__ */ h({
11
10
  __name: "Guido",
12
11
  props: {
13
12
  templateId: null,
@@ -21,32 +20,30 @@ const q = /* @__PURE__ */ L({
21
20
  guidoConfig: null
22
21
  },
23
22
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
24
- setup(S, { expose: b, emit: t }) {
25
- const o = S, w = E(
26
- () => import("./organisms/email-preview/PreviewContainer.vue.js")
27
- ), n = x(), c = o.preselectedDynamicContentList || [], { getPartnerName: i, getProductType: s } = G(), h = W(), {
23
+ setup(b, { expose: S, emit: t }) {
24
+ const o = b, n = T(), c = o.preselectedDynamicContentList || [], { getPartnerName: i, getProductType: s } = E(), {
28
25
  templateId: a,
29
26
  userId: r,
30
- guidoConfig: m,
27
+ guidoConfig: l,
31
28
  html: d = "",
32
- css: l = "",
29
+ css: m = "",
33
30
  partnerName: u = i(),
34
31
  productType: p = s(),
35
- username: y = k
32
+ username: y = G
36
33
  } = o;
37
34
  window.GuidoConfig = {
38
- ...T,
39
- ...m
35
+ ...I,
36
+ ...l
40
37
  };
41
- const { initPlugin: C } = I({
38
+ const { initPlugin: g } = _({
42
39
  emailId: a,
43
40
  userId: r,
44
41
  username: y,
45
42
  partnerName: u,
46
43
  productType: p,
47
44
  preselectedDynamicContentList: c
48
- }), { getDefaultTemplate: g } = N();
49
- _({
45
+ }), { getDefaultTemplate: C } = P();
46
+ w({
50
47
  onBack: () => {
51
48
  console.debug("guido:back"), t("back");
52
49
  },
@@ -68,16 +65,16 @@ const q = /* @__PURE__ */ L({
68
65
  }, v = () => {
69
66
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
70
67
  };
71
- return P(async () => {
68
+ return L(async () => {
72
69
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
73
70
  try {
74
71
  let e = {
75
72
  html: d,
76
- css: l,
73
+ css: m,
77
74
  forceRecreate: !0
78
75
  // TODO: It should be false for old templates. We will communicate with Stripo
79
76
  };
80
- e.html || (e = await g()), await C(e), n.selectedDynamicContentList = c;
77
+ e.html || (e = await C()), await g(e), n.selectedDynamicContentList = c;
81
78
  } catch (e) {
82
79
  console.error("Failed to initialize Stripo editor:", e);
83
80
  }
@@ -85,14 +82,14 @@ const q = /* @__PURE__ */ L({
85
82
  const D = e;
86
83
  console.debug("dynamic-content:open", D.detail), t("dynamic-content:open", D.detail);
87
84
  });
88
- }), b({
85
+ }), S({
89
86
  dynamicContent: {
90
87
  insert: f,
91
88
  close: v
92
89
  }
93
- }), { __sfc: !0, PreviewContainer: w, dynamicContentStore: n, props: o, preselectedDynamicContentList: c, getPartnerName: i, getProductType: s, previewStore: h, templateId: a, userId: r, guidoConfig: m, html: d, css: l, partnerName: u, productType: p, username: y, emit: t, initPlugin: C, getDefaultTemplate: g, insertDynamicContent: f, closeDynamicContent: v, HeaderWrapper: A };
90
+ }), { __sfc: !0, dynamicContentStore: n, props: o, preselectedDynamicContentList: c, getPartnerName: i, getProductType: s, templateId: a, userId: r, guidoConfig: l, html: d, css: m, partnerName: u, productType: p, username: y, emit: t, initPlugin: g, getDefaultTemplate: C, insertDynamicContent: f, closeDynamicContent: v, HeaderWrapper: k };
94
91
  }
95
92
  });
96
93
  export {
97
- q as default
94
+ K as default
98
95
  };
@@ -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,25 +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 a from "../email-preview/amp/AmpToggle.vue.js";
5
- import { useEditorStore as d } from "../../../stores/editor.js";
6
- import { usePreviewStore as f } 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 = d(), e = c(), o = f(), { openPreviewMode: t, closePreviewMode: i } = l(), s = m(() => o.isPreviewModeOpen ? e("newsletter.close-email-preview") : e("newsletter.email-preview"));
15
- return { __sfc: !0, editorStore: r, trans: e, previewStore: o, 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: () => o.isPreviewModeOpen ? i() : t(), AmpToggle: a, InButtonV2: w, VersionHistory: v, VersionHistoryViewOptions: u, ViewOptions: P };
17
+ }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
21
18
  }
22
19
  });
23
20
  export {
24
- B as default
21
+ y as default
25
22
  };
@@ -2,16 +2,16 @@ import o from "./RightSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
4
  var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.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 } }), 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 c = a.exports;
15
15
  export {
16
16
  c as default
17
17
  };
@@ -1,36 +1,35 @@
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 f } from "../../../composables/useGuidoActions.js";
5
+ import { useVersionHistoryApi as u } from "../../../composables/useVersionHistoryApi.js";
6
+ import { useEditorStore as d } from "../../../stores/editor.js";
7
+ import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
+ const E = /* @__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) {
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
14
  n();
15
15
  return;
16
16
  }
17
- i();
18
- }, c = async () => {
19
- r();
17
+ s();
18
+ }, handleSave: async () => {
19
+ e();
20
20
  try {
21
- const { html: t } = await e();
22
- s({
23
- html: t || "",
21
+ const { html: o } = await t();
22
+ r({
23
+ html: o || "",
24
24
  css: ""
25
25
  // CSS is embedded in HTML from Stripo
26
26
  });
27
- } catch (t) {
28
- console.error("Failed to get template data for save:", t);
27
+ } catch (o) {
28
+ console.error("Failed to get template data for save:", o);
29
29
  }
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 };
30
+ }, InButtonV2: S };
32
31
  }
33
32
  });
34
33
  export {
35
- b as default
34
+ E as default
36
35
  };
@@ -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
  };
@@ -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
  };
@@ -1,64 +1,38 @@
1
- import { useToaster as d } from "./useToaster.js";
2
- const E = () => {
3
- const { handleError: m } = d(), s = (t = {}) => new Promise((e, a) => {
4
- const i = { ...{
5
- minimize: !0,
6
- utmEntity: {
7
- utmSource: "",
8
- utmMedium: "",
9
- utmCampaign: "",
10
- utmContent: "",
11
- utmTerm: "",
12
- customUtms: [
13
- {
14
- name1: "val1",
15
- name2: "val2"
16
- }
17
- ]
18
- },
19
- mergeTags: ["Tag1", "Tag2"],
20
- forseAmp: !1,
21
- resetDataSavedFlag: !1,
22
- disableLineHeightsReplace: !0
23
- }, ...t }, n = {
24
- callback: (r, l, c, p, u) => {
25
- r ? a(r) : e({
26
- html: l,
27
- ampHtml: c,
28
- ampErrors: p,
29
- displayConditions: u
30
- });
31
- },
32
- ...i
33
- };
34
- window.StripoEditorApi.actionsApi.compileEmail(n);
35
- });
36
- return { getCompiledEmail: s, activateCustomViewStyles: (t = !0) => {
37
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
38
- }, getPreviewData: async (t) => {
39
- try {
40
- const {
41
- html: e,
42
- displayConditions: a,
43
- ampHtml: o = "",
44
- ampErrors: i = []
45
- } = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
46
- return {
47
- html: e,
48
- ampHtml: o,
49
- ampErrors: i,
50
- displayConditions: a
51
- };
52
- } catch (e) {
53
- return m(e, "Error loading preview"), {
54
- html: "",
55
- ampHtml: "",
56
- ampErrors: [],
57
- displayConditions: []
58
- };
59
- }
60
- } };
61
- };
1
+ const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
2
+ const s = { ...{
3
+ minimize: !0,
4
+ utmEntity: {
5
+ utmSource: "",
6
+ utmMedium: "",
7
+ utmCampaign: "",
8
+ utmContent: "",
9
+ utmTerm: "",
10
+ customUtms: [
11
+ {
12
+ name1: "val1",
13
+ name2: "val2"
14
+ }
15
+ ]
16
+ },
17
+ mergeTags: ["Tag1", "Tag2"],
18
+ forseAmp: !1,
19
+ resetDataSavedFlag: !1,
20
+ disableLineHeightsReplace: !0
21
+ }, ...t }, o = {
22
+ callback: (e, m, l, n, c) => {
23
+ e ? a(e) : i({
24
+ html: m,
25
+ ampHtml: l,
26
+ ampErrors: n,
27
+ displayConditions: c
28
+ });
29
+ },
30
+ ...s
31
+ };
32
+ window.StripoEditorApi.actionsApi.compileEmail(o);
33
+ }), activateCustomViewStyles: (t = !0) => {
34
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
35
+ } });
62
36
  export {
63
- E as useActionsApi
37
+ g as useActionsApi
64
38
  };
@@ -1,12 +1,8 @@
1
- const e = {
2
- translationsPath: "window.trans.en",
3
- emailHeader: {
4
- senderName: "",
5
- subject: ""
6
- }
7
- }, t = "newsletter", n = "Guido User";
1
+ const t = {
2
+ translationsPath: "window.trans.en"
3
+ }, e = "newsletter", n = "Guido User";
8
4
  export {
9
- e as DefaultGuidoConfig,
10
- t as DefaultProductType,
5
+ t as DefaultGuidoConfig,
6
+ e as DefaultProductType,
11
7
  n as DefaultUsername
12
8
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-c4fe2637] .guido__view-option-selection-desktop svg,[data-v-c4fe2637] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-c4fe2637] .in-segments-wrapper__button_selected,[data-v-c4fe2637] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-4083db95],.guido-editor__container[data-v-4083db95]{width:100%;height:calc(100vh - 75px)}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
1
+ .version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.guido-editor__wrapper[data-v-f9fbdc93],.guido-editor__container[data-v-f9fbdc93]{width:100%;height:calc(100vh - 75px)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.0-beta.cd820fb",
3
+ "version": "1.0.0-beta.d5d5bac",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,19 +0,0 @@
1
- import i from "./PreviewContainer.vue2.js";
2
- import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var t = function() {
4
- var s = this, e = s._self._c, r = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f f-d-c h-1 b-c-5 bor-r-2 pb-5" }, [e("div", { staticClass: "f-g-1 d-f p-5 o-a g-4 min-h-600" }, [r.previewStore.isLoading ? [e("div", { staticClass: "d-f a-i-c j-c-c w-1 h-1 f-g-1" }, [e(r.InLoading, { attrs: { "color-class": "i-c-1", size: "32" } })], 1)] : [e(r.DesktopPreview, { staticClass: "f-g-1 min-w-0" }), e(r.MobilePreview, { staticClass: "f-0 min-w-a" })]], 2), r.previewStore.isAMPErrorModalVisible ? e(r.AmpErrorModal, { on: { close: function(l) {
6
- return r.previewStore.closeErrorModal();
7
- } } }) : s._e()], 1);
8
- }, a = [], n = /* @__PURE__ */ o(
9
- i,
10
- t,
11
- a,
12
- !1,
13
- null,
14
- null
15
- );
16
- const d = n.exports;
17
- export {
18
- d as default
19
- };
@@ -1,19 +0,0 @@
1
- import { defineComponent as r, onMounted as t } from "vue";
2
- import { usePreviewMode as i } from "../../../composables/usePreviewMode.js";
3
- import { usePreviewStore as m } from "../../../stores/preview.js";
4
- import { InLoading as n } from "@useinsider/design-system-vue";
5
- import p from "./amp/AmpErrorModal.vue.js";
6
- import f from "./desktop-preview/DesktopPreview.vue.js";
7
- import s from "./mobile-preview/MobilePreview.vue.js";
8
- const l = /* @__PURE__ */ r({
9
- __name: "PreviewContainer",
10
- setup(a) {
11
- const { loadPreviewData: o } = i(), e = m();
12
- return t(() => {
13
- o();
14
- }), { __sfc: !0, loadPreviewData: o, previewStore: e, InLoading: n, AmpErrorModal: p, DesktopPreview: f, MobilePreview: s };
15
- }
16
- });
17
- export {
18
- l as default
19
- };
@@ -1,4 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
- close: () => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
- export default _default;
@@ -1,22 +0,0 @@
1
- import s from "./AmpErrorModal.vue2.js";
2
- /* empty css */
3
- import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var e = this, r = e._self._c, t = e._self._setupProxy;
6
- return r(t.WpModal, { attrs: { id: "amp-error-modal", size: "medium", description: t.trans("email-editor.amp-validation-description"), "footer-button-options": t.footerButtonOptions, title: t.trans("email-editor.amp-validation-title") }, on: { close: function(o) {
7
- return t.emit("close");
8
- }, "primary-action": t.handleFixInCodeEditor } }, [r("div", { staticClass: "d-f f-d-c" }, [r("div", { staticClass: "mb-3" }, [r("div", { staticClass: "l-s-5 f-s-1 f-w-600 t-c-55 t-t-u" }, [e._v(" " + e._s(t.errorCountText) + " ")])]), r("div", { staticClass: "d-f f-d-c g-13 max-h-21-s o-y-a error-list" }, e._l(t.previewStore.ampErrors, function(o, i) {
9
- return r(t.InOnPageMessage, { key: i, attrs: { icon: "filled-error-box", size: "medium", type: "alert", text: o } });
10
- }), 1)])]);
11
- }, l = [], d = /* @__PURE__ */ a(
12
- s,
13
- n,
14
- l,
15
- !1,
16
- null,
17
- "7a09985c"
18
- );
19
- const _ = d.exports;
20
- export {
21
- _ as default
22
- };
@@ -1,30 +0,0 @@
1
- import { defineComponent as p, ref as m, computed as c } from "vue";
2
- import d from "../../../wrappers/WpModal.vue.js";
3
- import { useCodeEditorApi as l } from "../../../../composables/useCodeEditorApi.js";
4
- import { usePreviewMode as u } from "../../../../composables/usePreviewMode.js";
5
- import { useTranslations as f } from "../../../../composables/useTranslations.js";
6
- import { usePreviewStore as _ } from "../../../../stores/preview.js";
7
- import { InOnPageMessage as g } from "@useinsider/design-system-vue";
8
- const P = /* @__PURE__ */ p({
9
- __name: "AmpErrorModal",
10
- emits: ["close"],
11
- setup(x, { emit: e }) {
12
- const o = f(), { closePreviewMode: r } = u(), { openCodeEditor: t } = l(), n = _(), s = m({
13
- cancelOrBackButton: {
14
- type: "secondary",
15
- labelText: o("campaign-builder.cancel"),
16
- styling: "ghost"
17
- },
18
- primaryButton: {
19
- type: "primary",
20
- labelText: o("email-editor.amp-validation-fix")
21
- }
22
- }), i = () => {
23
- e("close"), r(), t();
24
- }, a = c(() => `${o("products.errors")}(${n.ampErrors.length})`);
25
- return { __sfc: !0, emit: e, trans: o, closePreviewMode: r, openCodeEditor: t, previewStore: n, footerButtonOptions: s, handleFixInCodeEditor: i, errorCountText: a, WpModal: d, InOnPageMessage: g };
26
- }
27
- });
28
- export {
29
- P as default
30
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;