@useinsider/guido 1.0.2-beta.dacd24a → 1.0.2-beta.e5fcba7

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.
@@ -1,18 +1,18 @@
1
- import o from "./LeftSlot.vue2.js";
1
+ import s from "./LeftSlot.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var a = function() {
5
- var e = this, s = e._self._c, t = e._self._setupProxy;
6
- return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" }, on: { click: t.handleBack } }), t.editorStore.isVersionHistoryOpen ? s(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
7
- }, n = [], i = /* @__PURE__ */ r(
8
- o,
9
- a,
4
+ var n = function() {
5
+ var e = this, o = e._self._c, t = e._self._setupProxy;
6
+ return o("div", { staticClass: "d-f a-i-c" }, [o(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "left-icon": "line-arrow-left", styling: "text", type: "secondary", "label-text": t.backButtonLabel }, on: { click: t.handleBackClick } }), t.editorStore.isVersionHistoryOpen ? o(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
7
+ }, a = [], i = /* @__PURE__ */ r(
8
+ s,
10
9
  n,
10
+ a,
11
11
  !1,
12
12
  null,
13
- "a18ac2d3"
13
+ "2c168944"
14
14
  );
15
- const d = i.exports;
15
+ const p = i.exports;
16
16
  export {
17
- d as default
17
+ p as default
18
18
  };
@@ -1,15 +1,28 @@
1
- import { defineComponent as r } from "vue";
2
- import { useBack as e } from "../../../composables/useGuidoActions.js";
3
- import { useEditorStore as m } from "../../../stores/editor.js";
4
- import { InButtonV2 as n } from "@useinsider/design-system-vue";
5
- import s from "./version-history/RestoreButton.vue.js";
6
- const c = /* @__PURE__ */ r({
1
+ import { defineComponent as s, computed as c } from "vue";
2
+ import { useBack as m } from "../../../composables/useGuidoActions.js";
3
+ import { usePreviewMode as a } from "../../../composables/usePreviewMode.js";
4
+ import { useTranslations as p } from "../../../composables/useTranslations.js";
5
+ import { useVersionHistoryApi as u } from "../../../composables/useVersionHistoryApi.js";
6
+ import { useEditorStore as d } from "../../../stores/editor.js";
7
+ import { InButtonV2 as f } from "@useinsider/design-system-vue";
8
+ import l from "./version-history/RestoreButton.vue.js";
9
+ const O = /* @__PURE__ */ s({
7
10
  __name: "LeftSlot",
8
- setup(f) {
9
- const o = m(), t = e();
10
- return { __sfc: !0, editorStore: o, handleBack: t, InButtonV2: n, RestoreButton: s };
11
+ setup(k) {
12
+ const o = d(), r = m(), { closeVersionHistory: t } = u(), { closePreviewMode: i } = a(), e = p(), n = c(() => o.isVersionHistoryOpen || o.isPreviewModeOpen ? e("email-editor.back-to-editor") : e("email-editor.back-to-design"));
13
+ return { __sfc: !0, editorStore: o, handleBack: r, closeVersionHistory: t, closePreviewMode: i, trans: e, backButtonLabel: n, handleBackClick: () => {
14
+ if (o.isVersionHistoryOpen) {
15
+ t();
16
+ return;
17
+ }
18
+ if (o.isPreviewModeOpen) {
19
+ i();
20
+ return;
21
+ }
22
+ r();
23
+ }, InButtonV2: f, RestoreButton: l };
11
24
  }
12
25
  });
13
26
  export {
14
- c as default
27
+ O as default
15
28
  };
@@ -1,19 +1,19 @@
1
- import d from "./GenericOnboarding.vue2.js";
1
+ import c from "./GenericOnboarding.vue2.js";
2
2
  /* empty css */
3
3
  import g from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var l = function() {
5
5
  var r, n, t, i, a, s;
6
- var o = this, c = o._self._c, e = o._self._setupProxy;
7
- return e.isVisible ? c(e.InOnboard, { key: "guido__editor-onboard", staticClass: "w-21-s p-a z-11", class: (r = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : r.classes, attrs: { id: "guido__editor-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : n.bottom, "left-position": (t = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : t.left, "pages-config": e.onboardingStore.onboardings.genericOnboarding.config, "pointer-position": (i = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : i.position, "right-position": (a = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : a.right, "top-position": (s = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: e.handleBack, close: function(u) {
6
+ var o = this, d = o._self._c, e = o._self._setupProxy;
7
+ return e.isVisible ? d(e.InOnboard, { key: "guido__editor-onboard", staticClass: "w-21-s p-a z-11", class: (r = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : r.classes, attrs: { id: "guido__editor-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : n.bottom, "left-position": (t = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : t.left, "pages-config": e.onboardingStore.onboardings.genericOnboarding.config, "pointer-position": (i = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : i.position, "right-position": (a = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : a.right, "top-position": (s = e.onboardingStore.getGenericCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: e.handleBack, close: function(u) {
8
8
  return e.onboardingStore.close("genericOnboarding");
9
9
  }, nextButtonClick: e.handleNext } }) : o._e();
10
10
  }, p = [], _ = /* @__PURE__ */ g(
11
- d,
11
+ c,
12
12
  l,
13
13
  p,
14
14
  !1,
15
15
  null,
16
- "2473c29f"
16
+ "d3c52b44"
17
17
  );
18
18
  const S = _.exports;
19
19
  export {
@@ -33,8 +33,8 @@ const S = /* @__PURE__ */ l({
33
33
  {
34
34
  classes: "guido-onboarding-stripes",
35
35
  right: "450px",
36
- bottom: "-38px",
37
- position: "Right Top",
36
+ bottom: "38px",
37
+ position: "Right Bottom",
38
38
  title: e("email-editor.onboarding-stripes-title"),
39
39
  description: e("email-editor.onboarding-stripes-description"),
40
40
  imageSource: "",
@@ -1,19 +1,19 @@
1
- import c from "./TextBlockOnboarding.vue2.js";
1
+ import l from "./TextBlockOnboarding.vue2.js";
2
2
  /* empty css */
3
3
  import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var g = function() {
5
5
  var e, n, r, i, a, s;
6
- var t = this, l = t._self._c, o = t._self._setupProxy;
7
- return o.isVisible ? l(o.InOnboard, { key: "guido__text-block-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__text-block-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : n.bottom, "left-position": (r = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : r.left, "pages-config": o.onboardingStore.onboardings.textBlockOnboarding.config, "pointer-position": (i = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : i.position, "right-position": (a = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : a.right, "top-position": (s = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: o.handleBack, close: function(u) {
6
+ var t = this, c = t._self._c, o = t._self._setupProxy;
7
+ return o.isVisible ? c(o.InOnboard, { key: "guido__text-block-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__text-block-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : n.bottom, "left-position": (r = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : r.left, "pages-config": o.onboardingStore.onboardings.textBlockOnboarding.config, "pointer-position": (i = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : i.position, "right-position": (a = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : a.right, "top-position": (s = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: o.handleBack, close: function(u) {
8
8
  return o.onboardingStore.close("textBlockOnboarding");
9
9
  }, nextButtonClick: o.handleNext } }) : t._e();
10
10
  }, b = [], p = /* @__PURE__ */ d(
11
- c,
11
+ l,
12
12
  g,
13
13
  b,
14
14
  !1,
15
15
  null,
16
- "a77a2dd4"
16
+ "a408dcea"
17
17
  );
18
18
  const f = p.exports;
19
19
  export {
@@ -1,23 +1,35 @@
1
- import { defineComponent as s, computed as r, watch as l } from "vue";
2
- import { useTranslations as x } from "../../../composables/useTranslations.js";
3
- import { useOnboardingStore as g } from "../../../stores/onboarding.js";
4
- import { InOnboard as b } from "@useinsider/design-system-vue";
5
- const C = /* @__PURE__ */ s({
1
+ import { defineComponent as u, computed as a, watch as b } from "vue";
2
+ import { useTranslations as m } from "../../../composables/useTranslations.js";
3
+ import { useOnboardingStore as k } from "../../../stores/onboarding.js";
4
+ import { InOnboard as B } from "@useinsider/design-system-vue";
5
+ const y = /* @__PURE__ */ u({
6
6
  __name: "TextBlockOnboarding",
7
- setup(p) {
8
- const n = x(), o = g(), i = r(() => [
7
+ setup(h) {
8
+ const i = m(), o = k(), e = a(() => {
9
+ const n = window.innerHeight - 128, r = Math.max(90, n * 0.15), s = Math.max(490, n * 0.71), d = 200, g = 40;
10
+ return {
11
+ settings: {
12
+ top: `${r}px`,
13
+ position: r + d + g > n ? "Right Bottom" : "Right Top"
14
+ },
15
+ dynamic: {
16
+ top: `${s}px`,
17
+ position: s + d + g > n ? "Right Bottom" : "Right Top"
18
+ }
19
+ };
20
+ }), c = a(() => [
9
21
  {
10
22
  classes: "guido-text-block-onboarding-settings",
11
23
  right: "450px",
12
- top: "90px",
13
- position: "Right Top",
14
- title: n("email-editor.onboarding-text-block-title"),
15
- description: n("email-editor.onboarding-text-block-description"),
24
+ top: e.value.settings.top,
25
+ position: e.value.settings.position,
26
+ title: i("email-editor.onboarding-text-block-title"),
27
+ description: i("email-editor.onboarding-text-block-description"),
16
28
  imageSource: "",
17
29
  backButtonClick: () => {
18
30
  },
19
31
  nextButtonType: "text",
20
- nextButtonText: n("products.next"),
32
+ nextButtonText: i("products.next"),
21
33
  nextButtonClick: () => {
22
34
  o.next("textBlockOnboarding");
23
35
  }
@@ -25,38 +37,38 @@ const C = /* @__PURE__ */ s({
25
37
  {
26
38
  classes: "guido-text-block-onboarding-dynamic",
27
39
  right: "450px",
28
- top: "594px",
29
- position: "Right Top",
30
- title: n("email-editor.onboarding-dynamic-content-title"),
31
- description: n("email-editor.onboarding-dynamic-content-description"),
40
+ top: e.value.dynamic.top,
41
+ position: e.value.dynamic.position,
42
+ title: i("email-editor.onboarding-dynamic-content-title"),
43
+ description: i("email-editor.onboarding-dynamic-content-description"),
32
44
  imageSource: "",
33
45
  backButtonType: "text",
34
- backButtonText: n("ds-steps.back"),
46
+ backButtonText: i("ds-steps.back"),
35
47
  backButtonClick: () => {
36
48
  o.previous("textBlockOnboarding");
37
49
  },
38
50
  nextButtonType: "text",
39
- nextButtonText: n("action-builder.ok"),
51
+ nextButtonText: i("action-builder.ok"),
40
52
  nextButtonClick: () => {
41
53
  o.close("textBlockOnboarding");
42
54
  }
43
55
  }
44
- ]), c = r(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), a = () => {
45
- var t, e;
46
- (e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
47
- }, d = () => {
48
- var t, e;
49
- (e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
56
+ ]), l = a(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), p = () => {
57
+ var t, n;
58
+ (n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
59
+ }, x = () => {
60
+ var t, n;
61
+ (n = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
50
62
  };
51
- return l(
63
+ return b(
52
64
  () => o.isActive("textBlockOnboarding"),
53
65
  (t) => {
54
- t && o.setConfig("textBlockOnboarding", i.value);
66
+ t && o.setConfig("textBlockOnboarding", c.value);
55
67
  },
56
68
  { immediate: !0 }
57
- ), { __sfc: !0, trans: n, onboardingStore: o, onboardingCardsConfig: i, isVisible: c, handleNext: a, handleBack: d, InOnboard: b };
69
+ ), { __sfc: !0, trans: i, onboardingStore: o, dynamicPosition: e, onboardingCardsConfig: c, isVisible: l, handleNext: p, handleBack: x, InOnboard: B };
58
70
  }
59
71
  });
60
72
  export {
61
- C as default
73
+ y as default
62
74
  };
@@ -1,3 +1,4 @@
1
+ import type { DynamicContent } from '@@/Types/generic';
1
2
  export declare const useHtmlValidator: () => {
2
- validateHtml: (html: string, customFields: string[], isOnSaveValidation?: boolean) => Promise<boolean>;
3
+ validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
3
4
  };
@@ -1,119 +1,129 @@
1
- import { useConfig as V } from "./useConfig.js";
2
- import { TemplateTypes as H } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as O, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as B, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as R } from "../enums/html-validator.js";
4
- import { ToasterTypeOptions as r } from "../enums/toaster.js";
1
+ import { useConfig as H } from "./useConfig.js";
2
+ import { TemplateTypes as O } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as V, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as B, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as R } from "../enums/html-validator.js";
4
+ import { ToasterTypeOptions as c } from "../enums/toaster.js";
5
5
  import { useRecommendationStore as D } from "../stores/recommendation.js";
6
6
  import { base64EncodeWithSpecialChars as P } from "../utils/base64.js";
7
- import { useHttp as X } from "./useHttp.js";
7
+ import { useHttp as $ } from "./useHttp.js";
8
8
  import { useToaster as j } from "./useToaster.js";
9
- import { useTranslations as z } from "./useTranslations.js";
9
+ import { useTranslations as X } from "./useTranslations.js";
10
10
  const tt = () => {
11
11
  var d;
12
- const { showToaster: a } = j(), { post: y } = X(), { config: C } = V(), i = z(), m = D(), f = ((d = C.partner) == null ? void 0 : d.messageType) === H.transactional, h = async (t) => {
12
+ const { showToaster: r } = j(), { post: y } = $(), { config: h } = H(), o = X(), m = D(), u = ((d = h.partner) == null ? void 0 : d.messageType) === O.transactional, C = async (t) => {
13
13
  const e = await y(
14
14
  "/newsletter/template-library/check-template-html-body",
15
15
  { html: P(t) }
16
- ), { status: n, message: c } = e.data;
17
- return n || a({
18
- type: r.Alert,
19
- message: n === void 0 ? c : i("newsletter.invalid-url-link-for-toaster")
20
- }), i(_), c === i(R) && a({
21
- type: r.Alert,
22
- message: i("newsletter.already-in-progress")
16
+ ), { status: n, message: a } = e.data;
17
+ return n || r({
18
+ type: c.Alert,
19
+ message: n === void 0 ? a : o("newsletter.invalid-url-link-for-toaster")
20
+ }), o(_), a === o(R) && r({
21
+ type: c.Alert,
22
+ message: o("newsletter.already-in-progress")
23
23
  }), n;
24
24
  }, v = (t) => !["if", "endif", "else", "elif", "now"].includes(t.toLowerCase()), w = (t) => ["if", "endif"].includes(t.toLowerCase()), S = (t, s) => {
25
25
  const e = t.match(/({%(.*?)%})/g);
26
26
  let n = !0;
27
- return e !== null && !f && e.forEach((c) => {
28
- const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
29
- if (o && o.length > 0) {
30
- const [l] = o;
31
- v(l) && !s.includes(l) && (a({
32
- type: r.Warning,
33
- message: i("custom-fields.invalid-custom-fields")
27
+ return e !== null && !u && e.forEach((a) => {
28
+ const i = a.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
29
+ if (i && i.length > 0) {
30
+ const [l] = i;
31
+ v(l) && !s.includes(l) && (r({
32
+ type: c.Warning,
33
+ message: o("custom-fields.invalid-custom-fields")
34
34
  }), n = !1);
35
35
  }
36
36
  }), n;
37
37
  }, E = async (t, s, e) => {
38
- const n = e ? await h(t) : !0;
38
+ const n = e ? await C(t) : !0;
39
39
  return S(t, s) && n;
40
- }, T = (t) => t.length > 0 ? !0 : (a({
41
- type: r.Warning,
42
- message: i("newsletter.html-content-is-empty")
43
- }), !1), I = (t) => {
40
+ }, T = (t) => t.length > 0 ? !0 : (r({
41
+ type: c.Warning,
42
+ message: o("newsletter.html-content-is-empty")
43
+ }), !1), A = (t) => {
44
44
  const s = (t.match(/{/gm) || []).length, e = (t.match(/}/gm) || []).length;
45
- return s > e && a({
46
- type: r.Warning,
47
- message: i("custom-fields.missing-closing-braces")
48
- }), s < e && a({
49
- type: r.Warning,
50
- message: i("custom-fields.missing-opening-braces")
45
+ return s > e && r({
46
+ type: c.Warning,
47
+ message: o("custom-fields.missing-closing-braces")
48
+ }), s < e && r({
49
+ type: c.Warning,
50
+ message: o("custom-fields.missing-opening-braces")
51
51
  }), s === e;
52
- }, A = (t) => {
52
+ }, I = (t) => {
53
53
  const s = t.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
54
- return s || a({
55
- type: r.Warning,
56
- message: i("custom-fields.invalid-custom-fields")
54
+ return s || r({
55
+ type: c.Warning,
56
+ message: o("custom-fields.invalid-custom-fields")
57
57
  }), s;
58
- }, W = (t, s) => {
58
+ }, F = (t, s) => {
59
59
  const e = t.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
60
- if (e && !f) {
61
- const n = s.map((o) => o.toLowerCase()), c = e.some((o) => {
62
- const l = o.replace("{{", "").replace("}}", "").trim().toLowerCase();
63
- return !n.includes(l) || l === "";
64
- });
65
- return c && a({
66
- type: r.Warning,
67
- message: i("custom-fields.invalid-custom-fields")
68
- }), !c;
60
+ if (e && !u) {
61
+ const n = new Set(s.map((i) => i.toLowerCase())), a = [];
62
+ if (e.forEach((i) => {
63
+ const l = i.slice(2, -2).trim().toLowerCase();
64
+ (!n.has(l) || l === "") && a.push(l);
65
+ }), a.length > 0) {
66
+ const i = `
67
+ <ul>
68
+ ${a.map((l) => `<li>${l}</li>`).join("")}
69
+ </ul>
70
+ `;
71
+ return r({
72
+ type: c.Alert,
73
+ message: o("custom-fields.invalid-custom-fields") + i
74
+ }), !1;
75
+ }
69
76
  }
70
77
  return !0;
71
- }, x = (t) => {
78
+ }, W = (t) => {
72
79
  const s = t.match(/{%(.*?)%}/g), e = [];
73
80
  let n = !0;
74
- if (s && s.forEach((c) => {
75
- const o = c.match(O), l = c.match(B), L = (o == null ? void 0 : o.join("")) || "";
76
- (!o || c !== L) && !l && (a({
77
- type: r.Alert,
78
- message: i("newsletter.display-conditions-invalid-syntax")
79
- }), n = !1), o && o.forEach((u) => {
80
- u.trim() === "=" && (a({
81
- type: r.Alert,
82
- message: i("custom-conditions.wrong-equality-operators")
81
+ if (s && s.forEach((a) => {
82
+ const i = a.match(V), l = a.match(B), k = (i == null ? void 0 : i.join("")) || "";
83
+ (!i || a !== k) && !l && (r({
84
+ type: c.Alert,
85
+ message: o("newsletter.display-conditions-invalid-syntax")
86
+ }), n = !1), i && i.forEach((f) => {
87
+ f.trim() === "=" && (r({
88
+ type: c.Alert,
89
+ message: o("custom-conditions.wrong-equality-operators")
83
90
  }), n = !1);
84
- const g = u.match(/^[a-zA-Z]*$/g);
91
+ const g = f.match(/^[a-zA-Z]*$/g);
85
92
  g && g.forEach((p) => {
86
93
  w(p) && e.push(p);
87
94
  });
88
95
  });
89
96
  }), e.length) {
90
- const c = e.filter((l) => l === "if"), o = e.filter((l) => l === "endif");
91
- c.length !== o.length && (a({
92
- type: r.Alert,
93
- message: i("custom-conditions.missing-if-endif-tag")
97
+ const a = e.filter((l) => l === "if"), i = e.filter((l) => l === "endif");
98
+ a.length !== i.length && (r({
99
+ type: c.Alert,
100
+ message: o("custom-conditions.missing-if-endif-tag")
94
101
  }), n = !1);
95
102
  }
96
103
  return n;
97
104
  }, b = (t) => {
98
105
  const s = (t.match(/{% /gm) || []).length, e = (t.match(/ %}/gm) || []).length, n = s === e;
99
- return n || a({
100
- type: r.Warning,
101
- message: i("custom-conditions.no-space-after-braces")
106
+ return n || r({
107
+ type: c.Warning,
108
+ message: o("custom-conditions.no-space-after-braces")
102
109
  }), n;
103
- }, N = (t) => (t.match(/({%(.*?)%})/g) || []).filter((e) => e.includes("if")).map((e) => (e.match(/{{.*}}/gm) || []).length).reduce((e, n) => e + n, 0) > 0 ? (a({
104
- type: r.Warning,
105
- message: i("custom-conditions.no-braces-inside-if-tag")
106
- }), !1) : !0, k = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((e) => e.value === "")) !== void 0 ? (a({
107
- type: r.Alert,
108
- message: i("newsletter.fill-all-necessary-fields")
109
- }), !1) : !0, F = (t) => {
110
+ }, x = (t) => (t.match(/({%(.*?)%})/g) || []).filter((e) => e.includes("if")).map((e) => (e.match(/{{.*}}/gm) || []).length).reduce((e, n) => e + n, 0) > 0 ? (r({
111
+ type: c.Warning,
112
+ message: o("custom-conditions.no-braces-inside-if-tag")
113
+ }), !1) : !0, L = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((e) => e.value === "")) !== void 0 ? (r({
114
+ type: c.Alert,
115
+ message: o("newsletter.fill-all-necessary-fields")
116
+ }), !1) : !0, N = (t) => {
110
117
  const s = /src="[^"]*\.(svg|pst)"/gm;
111
- return t.match(s) === null ? !0 : (a({
112
- type: r.Alert,
113
- message: i("newsletter.invalid-image-type")
118
+ return t.match(s) === null ? !0 : (r({
119
+ type: c.Alert,
120
+ message: o("newsletter.invalid-image-type")
114
121
  }), !1);
115
122
  };
116
- return { validateHtml: async (t, s, e = !1) => await E(t, s, e) && T(t) && I(t) && A(t) && W(t, s) && x(t) && b(t) && N(t) && k() && F(t) };
123
+ return { validateHtml: async (t, s, e = !1) => {
124
+ const n = s.map((i) => i.value);
125
+ return await E(t, n, e) && T(t) && A(t) && I(t) && F(t, n) && W(t) && b(t) && x(t) && L() && N(t);
126
+ } };
117
127
  };
118
128
  export {
119
129
  tt as useHtmlValidator
@@ -1,12 +1,12 @@
1
- import { useSaveStart as i, useSaveComplete as l } from "./useGuidoActions.js";
2
- import { useTemplatePreparation as m } from "../utils/templatePreparation.js";
3
- import { useHtmlValidator as n } from "./useHtmlValidator.js";
1
+ import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
2
+ import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
3
+ import { useHtmlValidator as l } from "./useHtmlValidator.js";
4
4
  const f = () => {
5
- const e = i(), a = l(), { validateHtml: s } = n();
5
+ const e = i(), a = m(), { validateHtml: s } = l();
6
6
  return { save: async (o = !1) => {
7
7
  e();
8
- const { prepareTemplateDetails: r } = m(), t = await r();
9
- if (await s(t.compiledHtml, [], !0))
8
+ const { prepareTemplateDetails: r } = n(), t = await r();
9
+ if (await s(t.compiledHtml, t.dynamicContentList, !0))
10
10
  return o || a(t), t;
11
11
  } };
12
12
  };
@@ -1,15 +1,16 @@
1
1
  import { ToasterTypeOptions as t } from "../enums/toaster.js";
2
- import { useVersionHistoryStore as c } from "../stores/version-history.js";
3
- import { useToaster as w } from "./useToaster.js";
4
- const S = () => {
5
- const i = c(), { showToaster: s } = w(), n = (e) => {
6
- i.$reset(), i.updateState(e);
7
- }, p = () => {
8
- i.$reset();
2
+ import { useEditorStore as w } from "../stores/editor.js";
3
+ import { useVersionHistoryStore as y } from "../stores/version-history.js";
4
+ import { useToaster as a } from "./useToaster.js";
5
+ const u = () => {
6
+ const i = y(), n = w(), { showToaster: s } = a(), p = (e) => {
7
+ i.$reset(), i.updateState(e), n.isVersionHistoryOpen = !0;
8
+ }, c = () => {
9
+ i.$reset(), n.isVersionHistoryOpen = !1;
9
10
  };
10
11
  return {
11
12
  openVersionHistory: () => {
12
- window.StripoEditorApi.versionHistoryApi.openVersionHistory(n, p);
13
+ window.StripoEditorApi.versionHistoryApi.openVersionHistory(p, c);
13
14
  },
14
15
  closeVersionHistory: () => {
15
16
  window.StripoEditorApi.versionHistoryApi.closeVersionHistory();
@@ -50,5 +51,5 @@ const S = () => {
50
51
  };
51
52
  };
52
53
  export {
53
- S as useVersionHistoryApi
54
+ u as useVersionHistoryApi
54
55
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- [data-v-a18ac2d3] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-cc1f9260],.guido-editor__container[data-v-cc1f9260]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-cc1f9260]{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}[data-v-2473c29f] .vueperslides__bullets,[data-v-a77a2dd4] .vueperslides__bullets{pointer-events:none!important}
1
+ [data-v-2c168944] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-cc1f9260],.guido-editor__container[data-v-cc1f9260]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-cc1f9260]{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}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.2-beta.dacd24a",
3
+ "version": "1.0.2-beta.e5fcba7",
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",