@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.
- package/dist/components/organisms/header/LeftSlot.vue.js +10 -10
- package/dist/components/organisms/header/LeftSlot.vue2.js +23 -10
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +2 -2
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +5 -5
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +40 -28
- package/dist/composables/useHtmlValidator.d.ts +2 -1
- package/dist/composables/useHtmlValidator.js +85 -75
- package/dist/composables/useSave.js +6 -6
- package/dist/composables/useVersionHistoryApi.js +10 -9
- package/dist/guido.css +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s from "./LeftSlot.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
5
|
-
var e = this,
|
|
6
|
-
return
|
|
7
|
-
},
|
|
8
|
-
|
|
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
|
-
"
|
|
13
|
+
"2c168944"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const p = i.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
p as default
|
|
18
18
|
};
|
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBack as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
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(
|
|
9
|
-
const o = m(), t = e();
|
|
10
|
-
return { __sfc: !0, editorStore: o, handleBack: t,
|
|
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
|
-
|
|
27
|
+
O as default
|
|
15
28
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
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,
|
|
7
|
-
return e.isVisible ?
|
|
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
|
-
|
|
11
|
+
c,
|
|
12
12
|
l,
|
|
13
13
|
p,
|
|
14
14
|
!1,
|
|
15
15
|
null,
|
|
16
|
-
"
|
|
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: "
|
|
37
|
-
position: "Right
|
|
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
|
|
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,
|
|
7
|
-
return o.isVisible ?
|
|
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
|
-
|
|
11
|
+
l,
|
|
12
12
|
g,
|
|
13
13
|
b,
|
|
14
14
|
!1,
|
|
15
15
|
null,
|
|
16
|
-
"
|
|
16
|
+
"a408dcea"
|
|
17
17
|
);
|
|
18
18
|
const f = p.exports;
|
|
19
19
|
export {
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { useOnboardingStore as
|
|
4
|
-
import { InOnboard as
|
|
5
|
-
const
|
|
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(
|
|
8
|
-
const
|
|
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:
|
|
13
|
-
position:
|
|
14
|
-
title:
|
|
15
|
-
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:
|
|
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:
|
|
29
|
-
position:
|
|
30
|
-
title:
|
|
31
|
-
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:
|
|
46
|
+
backButtonText: i("ds-steps.back"),
|
|
35
47
|
backButtonClick: () => {
|
|
36
48
|
o.previous("textBlockOnboarding");
|
|
37
49
|
},
|
|
38
50
|
nextButtonType: "text",
|
|
39
|
-
nextButtonText:
|
|
51
|
+
nextButtonText: i("action-builder.ok"),
|
|
40
52
|
nextButtonClick: () => {
|
|
41
53
|
o.close("textBlockOnboarding");
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
|
-
]),
|
|
45
|
-
var t,
|
|
46
|
-
(
|
|
47
|
-
},
|
|
48
|
-
var t,
|
|
49
|
-
(
|
|
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
|
|
63
|
+
return b(
|
|
52
64
|
() => o.isActive("textBlockOnboarding"),
|
|
53
65
|
(t) => {
|
|
54
|
-
t && o.setConfig("textBlockOnboarding",
|
|
66
|
+
t && o.setConfig("textBlockOnboarding", c.value);
|
|
55
67
|
},
|
|
56
68
|
{ immediate: !0 }
|
|
57
|
-
), { __sfc: !0, trans:
|
|
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
|
-
|
|
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:
|
|
3
|
+
validateHtml: (html: string, customFields: DynamicContent[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
3
4
|
};
|
|
@@ -1,119 +1,129 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
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
|
|
7
|
+
import { useHttp as $ } from "./useHttp.js";
|
|
8
8
|
import { useToaster as j } from "./useToaster.js";
|
|
9
|
-
import { useTranslations as
|
|
9
|
+
import { useTranslations as X } from "./useTranslations.js";
|
|
10
10
|
const tt = () => {
|
|
11
11
|
var d;
|
|
12
|
-
const { showToaster:
|
|
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:
|
|
17
|
-
return n ||
|
|
18
|
-
type:
|
|
19
|
-
message: n === void 0 ?
|
|
20
|
-
}),
|
|
21
|
-
type:
|
|
22
|
-
message:
|
|
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 && !
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const [l] =
|
|
31
|
-
v(l) && !s.includes(l) && (
|
|
32
|
-
type:
|
|
33
|
-
message:
|
|
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
|
|
38
|
+
const n = e ? await C(t) : !0;
|
|
39
39
|
return S(t, s) && n;
|
|
40
|
-
}, T = (t) => t.length > 0 ? !0 : (
|
|
41
|
-
type:
|
|
42
|
-
message:
|
|
43
|
-
}), !1),
|
|
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 &&
|
|
46
|
-
type:
|
|
47
|
-
message:
|
|
48
|
-
}), s < e &&
|
|
49
|
-
type:
|
|
50
|
-
message:
|
|
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
|
-
},
|
|
52
|
+
}, I = (t) => {
|
|
53
53
|
const s = t.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
54
|
-
return s ||
|
|
55
|
-
type:
|
|
56
|
-
message:
|
|
54
|
+
return s || r({
|
|
55
|
+
type: c.Warning,
|
|
56
|
+
message: o("custom-fields.invalid-custom-fields")
|
|
57
57
|
}), s;
|
|
58
|
-
},
|
|
58
|
+
}, F = (t, s) => {
|
|
59
59
|
const e = t.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
60
|
-
if (e && !
|
|
61
|
-
const n = s.map((
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
},
|
|
78
|
+
}, W = (t) => {
|
|
72
79
|
const s = t.match(/{%(.*?)%}/g), e = [];
|
|
73
80
|
let n = !0;
|
|
74
|
-
if (s && s.forEach((
|
|
75
|
-
const
|
|
76
|
-
(!
|
|
77
|
-
type:
|
|
78
|
-
message:
|
|
79
|
-
}), n = !1),
|
|
80
|
-
|
|
81
|
-
type:
|
|
82
|
-
message:
|
|
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 =
|
|
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
|
|
91
|
-
|
|
92
|
-
type:
|
|
93
|
-
message:
|
|
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 ||
|
|
100
|
-
type:
|
|
101
|
-
message:
|
|
106
|
+
return n || r({
|
|
107
|
+
type: c.Warning,
|
|
108
|
+
message: o("custom-conditions.no-space-after-braces")
|
|
102
109
|
}), n;
|
|
103
|
-
},
|
|
104
|
-
type:
|
|
105
|
-
message:
|
|
106
|
-
}), !1) : !0,
|
|
107
|
-
type:
|
|
108
|
-
message:
|
|
109
|
-
}), !1) : !0,
|
|
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 : (
|
|
112
|
-
type:
|
|
113
|
-
message:
|
|
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) =>
|
|
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
|
|
2
|
-
import { useTemplatePreparation as
|
|
3
|
-
import { useHtmlValidator as
|
|
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 =
|
|
5
|
+
const e = i(), a = m(), { validateHtml: s } = l();
|
|
6
6
|
return { save: async (o = !1) => {
|
|
7
7
|
e();
|
|
8
|
-
const { prepareTemplateDetails: r } =
|
|
9
|
-
if (await s(t.compiledHtml,
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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(
|
|
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
|
-
|
|
54
|
+
u as useVersionHistoryApi
|
|
54
55
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-
|
|
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.
|
|
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",
|