@useinsider/guido 1.0.2-beta.efaabbe → 1.0.2-beta.efc8835

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.
package/README.md CHANGED
@@ -102,11 +102,6 @@ export default {
102
102
  // ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
103
103
  handleDynamicContentClose() {
104
104
  this.$refs.guidoEditor?.dynamicContent.close();
105
- },
106
-
107
- // If you need to trigger save manually like leave modal cases, you can use this method.
108
- save () {
109
- this.$refs.guidoEditor?.saveSilent();
110
105
  }
111
106
  }
112
107
  };
@@ -143,7 +138,6 @@ export default {
143
138
  ```typescript
144
139
  dynamicContent.insert(DynamicContent);
145
140
  dynamicContent.close();
146
- saveSilent();
147
141
  ```
148
142
 
149
143
  ### Guido Interfaces
@@ -18,13 +18,12 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
18
18
  close: () => void;
19
19
  };
20
20
  hasChanges: import("vue").ComputedRef<boolean>;
21
- saveSilent: () => Promise<SavedTemplateDetails | undefined> | undefined;
22
21
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
23
22
  "dynamic-content:open": (detail: DynamicContent | null) => void;
24
23
  back: () => void;
25
24
  "save:start": () => void;
26
25
  "save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
27
- "on-change": (hasChanges: boolean) => void;
26
+ "on-change": () => void;
28
27
  ready: () => void;
29
28
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
30
29
  export default _default;
@@ -3,14 +3,14 @@ import a from "./Guido.vue2.js";
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.SaveAsTemplateDrawer), r(e.LoadingWrapper)], 1);
6
+ return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.SaveAsTemplateDrawer), r(e.LoadingWrapper)], 1);
7
7
  }, s = [], d = /* @__PURE__ */ i(
8
8
  a,
9
9
  t,
10
10
  s,
11
11
  !1,
12
12
  null,
13
- "0defec6a"
13
+ "e45e9eab"
14
14
  );
15
15
  const v = d.exports;
16
16
  export {
@@ -1,18 +1,18 @@
1
- import { defineComponent as k, defineAsyncComponent as A, ref as N, computed as T, watch as W, onMounted as H, onUnmounted as R } from "vue";
2
- import { provideGuidoActions as U } from "../composables/useGuidoActions.js";
3
- import { usePartner as x } from "../composables/usePartner.js";
4
- import { useStripo as F } from "../composables/useStripo.js";
5
- import { DefaultUsername as M, DefaultMessageType as z, DefaultGuidoConfig as B } from "../enums/defaults.js";
6
- import K from "./organisms/base/Toaster.vue.js";
7
- import j from "./organisms/header/HeaderWrapper.vue.js";
8
- import q from "./organisms/LoadingWrapper.vue.js";
9
- import J from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
10
- import { useStripoApi as O } from "../services/stripoApi.js";
11
- import { useDynamicContentStore as Q } from "../stores/dynamic-content.js";
12
- import { useEditorStore as V } from "../stores/editor.js";
13
- import { usePreviewStore as X } from "../stores/preview.js";
14
- import Y from "../node_modules/lodash-es/merge.js";
15
- const ue = /* @__PURE__ */ k({
1
+ import { defineComponent as P, defineAsyncComponent as _, computed as b, watch as k, onMounted as A, onUnmounted as N } from "vue";
2
+ import { provideGuidoActions as H } from "../composables/useGuidoActions.js";
3
+ import { usePartner as U } from "../composables/usePartner.js";
4
+ import { useStripo as W } from "../composables/useStripo.js";
5
+ import { DefaultUsername as x, DefaultMessageType as F, DefaultGuidoConfig as M } from "../enums/defaults.js";
6
+ import R from "./organisms/base/Toaster.vue.js";
7
+ import z from "./organisms/header/HeaderWrapper.vue.js";
8
+ import B from "./organisms/LoadingWrapper.vue.js";
9
+ import K from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
10
+ import { useStripoApi as j } from "../services/stripoApi.js";
11
+ import { useDynamicContentStore as q } from "../stores/dynamic-content.js";
12
+ import { useEditorStore as J } from "../stores/editor.js";
13
+ import { usePreviewStore as O } from "../stores/preview.js";
14
+ import Q from "../node_modules/lodash-es/merge.js";
15
+ const de = /* @__PURE__ */ P({
16
16
  __name: "Guido",
17
17
  props: {
18
18
  templateId: null,
@@ -27,43 +27,40 @@ const ue = /* @__PURE__ */ k({
27
27
  guidoConfig: null
28
28
  },
29
29
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready"],
30
- setup(G, { expose: I, emit: o }) {
31
- const n = G, L = A(
30
+ setup(E, { expose: T, emit: o }) {
31
+ const t = E, G = _(
32
32
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
33
- ), c = N(), r = Q(), d = V(), P = X(), t = T(() => d.hasChanges), a = n.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: l } = x(), u = () => {
34
- var e;
35
- return (e = c.value) == null ? void 0 : e.handleSave(!0);
36
- }, {
37
- templateId: p,
38
- userId: g,
39
- guidoConfig: f,
40
- html: y = "",
41
- css: v = "",
42
- partnerName: i = m(),
43
- productType: s = l(),
44
- messageType: C = z,
45
- username: h = M
46
- } = n;
47
- window.GuidoConfig = Y(B, f), window.GuidoConfig.partner = {
33
+ ), n = q(), c = J(), I = O(), r = b(() => c.hasChanges), a = t.preselectedDynamicContentList || [], { getPartnerName: d, getProductType: m } = U(), {
34
+ templateId: l,
35
+ userId: u,
36
+ guidoConfig: p,
37
+ html: g = "",
38
+ css: y = "",
39
+ partnerName: i = d(),
40
+ productType: s = m(),
41
+ messageType: f = F,
42
+ username: C = x
43
+ } = t;
44
+ window.GuidoConfig = Q(M, p), window.GuidoConfig.partner = {
48
45
  partnerName: i,
49
46
  productType: s,
50
- messageType: C
47
+ messageType: f
51
48
  };
52
- const { initPlugin: w } = F({
53
- emailId: p,
54
- userId: g,
55
- username: h,
49
+ const { initPlugin: v } = W({
50
+ emailId: l,
51
+ userId: u,
52
+ username: C,
56
53
  partnerName: i,
57
54
  productType: s,
58
55
  preselectedDynamicContentList: a,
59
56
  onReady: () => {
60
57
  console.debug("guido:ready"), o("ready");
61
58
  }
62
- }), { getDefaultTemplate: S } = O(), _ = T(() => {
59
+ }), { getDefaultTemplate: w } = j(), L = b(() => {
63
60
  var e;
64
61
  return !((e = window.GuidoConfig) != null && e.useHeader);
65
62
  });
66
- U({
63
+ H({
67
64
  onBack: () => {
68
65
  console.debug("guido:back"), o("back");
69
66
  },
@@ -74,46 +71,45 @@ const ue = /* @__PURE__ */ k({
74
71
  console.debug("guido:save:complete", e), o("save:complete", e);
75
72
  }
76
73
  });
77
- const D = (e) => {
78
- console.debug("dynamic-content:close", e), r.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
79
- }, b = () => {
74
+ const h = (e) => {
75
+ console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
76
+ }, S = () => {
80
77
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
81
78
  };
82
- return W(() => t.value, () => {
83
- o("on-change", t.value);
84
- }), H(async () => {
79
+ return k(() => r.value, () => {
80
+ o("on-change");
81
+ }), A(async () => {
85
82
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
86
83
  try {
87
84
  let e = {
88
- html: y,
89
- css: v,
85
+ html: g,
86
+ css: y,
90
87
  forceRecreate: !0
91
88
  // TODO: It should be false for old templates. We will communicate with Stripo
92
89
  };
93
- e.html || (e = await S()), await w(e), r.selectedDynamicContentList = a;
90
+ e.html || (e = await w()), await v(e), n.selectedDynamicContentList = a;
94
91
  } catch (e) {
95
92
  console.error("Failed to initialize Stripo editor:", e);
96
93
  }
97
94
  document.addEventListener("dynamic-content:open", (e) => {
98
- const E = e;
99
- console.debug("dynamic-content:open", E.detail), o("dynamic-content:open", E.detail);
95
+ const D = e;
96
+ console.debug("dynamic-content:open", D.detail), o("dynamic-content:open", D.detail);
100
97
  });
101
- }), R(() => {
98
+ }), N(() => {
102
99
  try {
103
100
  window.UIEditor.removeEditor();
104
101
  } catch {
105
102
  console.debug("Failed to remove Stripo editor: No editor found");
106
103
  }
107
- }), I({
104
+ }), T({
108
105
  dynamicContent: {
109
- insert: D,
110
- close: b
106
+ insert: h,
107
+ close: S
111
108
  },
112
- hasChanges: t,
113
- saveSilent: u
114
- }), { __sfc: !0, PreviewContainer: L, headerWrapperRef: c, dynamicContentStore: r, props: n, editorStore: d, previewStore: P, hasChanges: t, preselectedDynamicContentList: a, getPartnerName: m, getProductType: l, saveSilent: u, templateId: p, userId: g, guidoConfig: f, html: y, css: v, partnerName: i, productType: s, messageType: C, username: h, emit: o, initPlugin: w, getDefaultTemplate: S, noHeader: _, insertDynamicContent: D, closeDynamicContent: b, Toaster: K, HeaderWrapper: j, LoadingWrapper: q, SaveAsTemplateDrawer: J };
109
+ hasChanges: r
110
+ }), { __sfc: !0, PreviewContainer: G, dynamicContentStore: n, props: t, editorStore: c, previewStore: I, hasChanges: r, preselectedDynamicContentList: a, getPartnerName: d, getProductType: m, templateId: l, userId: u, guidoConfig: p, html: g, css: y, partnerName: i, productType: s, messageType: f, username: C, emit: o, initPlugin: v, getDefaultTemplate: w, noHeader: L, insertDynamicContent: h, closeDynamicContent: S, Toaster: R, HeaderWrapper: z, LoadingWrapper: B, SaveAsTemplateDrawer: K };
115
111
  }
116
112
  });
117
113
  export {
118
- ue as default
114
+ de as default
119
115
  };
@@ -10,7 +10,7 @@ var s = function() {
10
10
  n,
11
11
  !1,
12
12
  null,
13
- "dced5582"
13
+ "2d4cd446"
14
14
  );
15
15
  const l = _.exports;
16
16
  export {
@@ -1,4 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
2
- handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo.js").SavedTemplateDetails | undefined> | undefined;
3
- }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
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<{}>>, {}>;
4
2
  export default _default;
@@ -1,17 +1,17 @@
1
- import o from "./HeaderWrapper.vue2.js";
1
+ import t from "./HeaderWrapper.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var t = this, r = t._self._c, e = t._self._setupProxy;
5
- return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot, { ref: "rightSlotRef" })], 1)]);
4
+ var o = this, r = o._self._c, e = o._self._setupProxy;
5
+ return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot)], 1)]);
6
6
  }, a = [], _ = /* @__PURE__ */ s(
7
- o,
7
+ t,
8
8
  n,
9
9
  a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const c = _.exports;
14
+ const d = _.exports;
15
15
  export {
16
- c as default
16
+ d as default
17
17
  };
@@ -1,20 +1,14 @@
1
- import { defineComponent as n, ref as m } from "vue";
2
- import { InContainer as a } from "@useinsider/design-system-vue";
3
- import f from "./LeftSlot.vue.js";
4
- import p from "./MiddleSlot.vue.js";
5
- import i from "./RightSlot.vue.js";
6
- const c = /* @__PURE__ */ n({
1
+ import { defineComponent as o } from "vue";
2
+ import { InContainer as r } from "@useinsider/design-system-vue";
3
+ import t from "./LeftSlot.vue.js";
4
+ import e from "./MiddleSlot.vue.js";
5
+ import m from "./RightSlot.vue.js";
6
+ const s = /* @__PURE__ */ o({
7
7
  __name: "HeaderWrapper",
8
- setup(l, { expose: r }) {
9
- const e = m(null);
10
- return r({
11
- handleSave: (t) => {
12
- var o;
13
- return (o = e.value) == null ? void 0 : o.handleSave(t);
14
- }
15
- }), { __sfc: !0, rightSlotRef: e, InContainer: a, LeftSlot: f, MiddleSlot: p, RightSlot: i };
8
+ setup(p) {
9
+ return { __sfc: !0, InContainer: r, LeftSlot: t, MiddleSlot: e, RightSlot: m };
16
10
  }
17
11
  });
18
12
  export {
19
- c as default
13
+ s as default
20
14
  };
@@ -1,4 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
2
- handleSave: (isSilent: boolean) => Promise<import("../../../@types/stripo").SavedTemplateDetails | undefined>;
3
- }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
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<{}>>, {}>;
4
2
  export default _default;
@@ -3,9 +3,7 @@ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var l = function() {
4
4
  var s, i;
5
5
  var o = this, e = o._self._c, t = o._self._setupProxy;
6
- return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(p) {
7
- return t.handleSave(!1);
8
- } } })], 1);
6
+ return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: t.handleSave } })], 1);
9
7
  }, r = [], d = /* @__PURE__ */ a(
10
8
  n,
11
9
  l,
@@ -14,7 +12,7 @@ var l = function() {
14
12
  null,
15
13
  null
16
14
  );
17
- const g = d.exports;
15
+ const c = d.exports;
18
16
  export {
19
- g as default
17
+ c as default
20
18
  };
@@ -1,35 +1,31 @@
1
- import { defineComponent as g, ref as l, computed as H } from "vue";
2
- import { useConfig as _ } from "../../../composables/useConfig.js";
3
- import { useExport as h } from "../../../composables/useExport.js";
4
- import { useSave as V } from "../../../composables/useSave.js";
5
- import { useTranslations as x } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as T } from "../../../stores/editor.js";
8
- import { getTooltipOptions as E } from "../../../utils/tooltipUtils.js";
9
- import { InButtonV2 as O } from "@useinsider/design-system-vue";
10
- const z = /* @__PURE__ */ g({
1
+ import { defineComponent as v, ref as p, computed as d } from "vue";
2
+ import { useConfig as y } from "../../../composables/useConfig.js";
3
+ import { useExport as S } from "../../../composables/useExport.js";
4
+ import { useSave as g } from "../../../composables/useSave.js";
5
+ import { useTranslations as h } from "../../../composables/useTranslations.js";
6
+ import { useVersionHistoryApi as H } from "../../../composables/useVersionHistoryApi.js";
7
+ import { useEditorStore as _ } from "../../../stores/editor.js";
8
+ import { getTooltipOptions as V } from "../../../utils/tooltipUtils.js";
9
+ import { InButtonV2 as x } from "@useinsider/design-system-vue";
10
+ const j = /* @__PURE__ */ v({
11
11
  __name: "RightSlot",
12
- setup(A, { expose: m }) {
13
- const { config: u } = _(), { exportHtml: r } = h(), { save: n } = V(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = T(), t = x(), e = l(!1), s = l(!1), c = () => {
12
+ setup(w) {
13
+ const { config: l } = y(), { exportHtml: r } = S(), { save: n } = g(), { openVersionHistory: i, closeVersionHistory: a } = H(), o = _(), t = h(), e = p(!1), s = p(!1), m = () => {
14
14
  if (o.isVersionHistoryOpen) {
15
15
  a();
16
16
  return;
17
17
  }
18
18
  i();
19
- }, f = async () => {
19
+ }, u = async () => {
20
20
  e.value = !0, await r(), e.value = !1;
21
- }, v = () => {
21
+ }, c = () => {
22
22
  o.isSaveAsTemplateDrawerOpen = !0;
23
- }, d = H(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), p = async (y) => {
24
- s.value = !0, o.loadingStatus = !0;
25
- const S = await n(y);
26
- return s.value = !1, o.loadingStatus = !1, S;
27
- };
28
- return m({
29
- handleSave: p
30
- }), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: c, handleExport: f, handleSaveAs: v, versionHistoryTooltipText: d, handleSave: p, getTooltipOptions: E, InButtonV2: O };
23
+ }, f = d(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history"));
24
+ return { __sfc: !0, config: l, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, handleVersionHistory: m, handleExport: u, handleSaveAs: c, versionHistoryTooltipText: f, handleSave: async () => {
25
+ s.value = !0, o.loadingStatus = !0, await n(), s.value = !1, o.loadingStatus = !1;
26
+ }, getTooltipOptions: V, InButtonV2: x };
31
27
  }
32
28
  });
33
29
  export {
34
- z as default
30
+ j as default
35
31
  };
@@ -1,4 +1,3 @@
1
- import { SavedTemplateDetails } from '@@/Types/stripo';
2
1
  export declare const useSave: () => {
3
- save: (isSilent?: boolean) => Promise<SavedTemplateDetails | undefined>;
2
+ save: () => Promise<void>;
4
3
  };
@@ -1,15 +1,14 @@
1
- import { useSaveStart as i, useSaveComplete as l } from "./useGuidoActions.js";
1
+ import { useSaveStart as r, useSaveComplete as i } from "./useGuidoActions.js";
2
2
  import { useTemplatePreparation as m } from "../utils/templatePreparation.js";
3
- import { useHtmlValidator as n } from "./useHtmlValidator.js";
4
- const f = () => {
5
- const e = i(), a = l(), { validateHtml: s } = n();
6
- return { save: async (o = !1) => {
3
+ import { useHtmlValidator as l } from "./useHtmlValidator.js";
4
+ const d = () => {
5
+ const e = r(), a = i(), { validateHtml: s } = l();
6
+ return { save: async () => {
7
7
  e();
8
- const { prepareTemplateDetails: r } = m(), t = await r();
9
- if (await s(t.compiledHtml, [], !0))
10
- return o || a(t), t;
8
+ const { prepareTemplateDetails: o } = m(), t = await o();
9
+ await s(t.compiledHtml, [], !0) && a(t);
11
10
  } };
12
11
  };
13
12
  export {
14
- f as useSave
13
+ d as useSave
15
14
  };
@@ -1,21 +1,21 @@
1
1
  import { useActionsApi as g } from "./useActionsApi.js";
2
2
  import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
3
3
  import { useToaster as S } from "./useToaster.js";
4
- import { displayConditions as C } from "../enums/displayConditions.js";
5
- import y from "../extensions/DynamicContent/extension.js";
4
+ import { displayConditions as y } from "../enums/displayConditions.js";
5
+ import C from "../extensions/DynamicContent/extension.js";
6
6
  import { useStripoApi as E } from "../services/stripoApi.js";
7
7
  import h from "../static/styles/customEditorStyle.css.js";
8
8
  import { useEditorStore as w } from "../stores/editor.js";
9
9
  import { dynamicContentToMergeTags as b } from "../utils/genericUtil.js";
10
10
  const P = (s) => {
11
- const { handleError: d } = S(), { getToken: c, getCustomFonts: u } = E(), l = (r, i = []) => {
12
- const e = w(), { html: o, css: a, forceRecreate: p } = r;
11
+ const { handleError: c } = S(), { getToken: a, getCustomFonts: u } = E(), l = (r, i = []) => {
12
+ const e = w(), { html: o, css: d, forceRecreate: p } = r;
13
13
  window.UIEditor.initEditor(
14
14
  document.querySelector("#guido-editor"),
15
15
  {
16
16
  metadata: s,
17
17
  html: o,
18
- css: a,
18
+ css: d,
19
19
  forceRecreate: p,
20
20
  locale: "en",
21
21
  undoButtonSelector: "#guido__undo-button",
@@ -29,7 +29,7 @@ const P = (s) => {
29
29
  customViewStyles: h,
30
30
  conditionsEnabled: !0,
31
31
  customConditionsEnabled: !0,
32
- conditionCategories: C,
32
+ conditionCategories: y,
33
33
  enableXSSSecurity: !0,
34
34
  messageSettingsEnabled: !1,
35
35
  selectBlockAfterDropFromSettingsPanel: !0,
@@ -45,20 +45,18 @@ const P = (s) => {
45
45
  ],
46
46
  async onTokenRefreshRequest(t) {
47
47
  try {
48
- const n = await c();
48
+ const n = await a();
49
49
  t(n);
50
50
  } catch (n) {
51
- d(n, "Failed to refresh token");
51
+ c(n, "Failed to refresh token");
52
52
  }
53
53
  },
54
54
  onTemplateLoaded() {
55
55
  try {
56
56
  const { importCss: t } = f(), { activateCustomViewStyles: n } = g();
57
- t(), n(), s.onReady(), e.loadingStatus = !1, setTimeout(() => {
58
- e.hasChanges = !1;
59
- }, 1e3);
57
+ t(), n(), s.onReady(), e.loadingStatus = !1;
60
58
  } catch (t) {
61
- d(t, "Failed to load custom interface appearance");
59
+ c(t, "Failed to load custom interface appearance");
62
60
  }
63
61
  },
64
62
  onCodeEditorVisibilityChanged(t) {
@@ -74,7 +72,7 @@ const P = (s) => {
74
72
  e.hasChanges = !0;
75
73
  },
76
74
  ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
77
- extensions: [y]
75
+ extensions: [C]
78
76
  }
79
77
  );
80
78
  }, m = (r) => new Promise((i, e) => {
@@ -86,8 +84,8 @@ const P = (s) => {
86
84
  o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
87
85
  r(), i();
88
86
  }, o.onerror = () => {
89
- const a = new Error("Failed to load Stripo UIEditor script");
90
- e(a);
87
+ const d = new Error("Failed to load Stripo UIEditor script");
88
+ e(d);
91
89
  }, document.body.appendChild(o);
92
90
  });
93
91
  return { initPlugin: async (r) => {
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- [data-v-a18ac2d3] .in-button-v2__wrapper{line-height:0}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-421ffc13] .guido__verion-history-view-option-selection-desktop svg,[data-v-421ffc13] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-421ffc13] .in-segments-wrapper__button_selected,[data-v-421ffc13] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-421ffc13] .in-tooltip-wrapper__icon{cursor:pointer}[data-v-ad3cf7cc] .guido__view-option-selection-desktop svg,[data-v-ad3cf7cc] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-ad3cf7cc] .in-segments-wrapper__button_selected,[data-v-ad3cf7cc] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-ad3cf7cc] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-0defec6a],.guido-editor__container[data-v-0defec6a]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-0defec6a]{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
+ [data-v-a18ac2d3] .in-button-v2__wrapper{line-height:0}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-421ffc13] .guido__verion-history-view-option-selection-desktop svg,[data-v-421ffc13] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-421ffc13] .in-segments-wrapper__button_selected,[data-v-421ffc13] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-421ffc13] .in-tooltip-wrapper__icon{cursor:pointer}[data-v-ad3cf7cc] .guido__view-option-selection-desktop svg,[data-v-ad3cf7cc] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-ad3cf7cc] .in-segments-wrapper__button_selected,[data-v-ad3cf7cc] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-ad3cf7cc] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-2d4cd446]{height:calc(100% - 75px);top:75px}.guido-editor__wrapper[data-v-e45e9eab],.guido-editor__container[data-v-e45e9eab]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-e45e9eab]{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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.2-beta.efaabbe",
3
+ "version": "1.0.2-beta.efc8835",
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",