@useinsider/guido 1.0.2-beta.c122fb4 → 1.0.2-beta.c50c279
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 +24 -1
- package/dist/@types/events.d.ts +6 -0
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +41 -39
- package/dist/components/organisms/header/ViewOptions.vue.js +11 -11
- package/dist/components/organisms/header/ViewOptions.vue2.js +5 -5
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +20 -0
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +37 -0
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +83 -0
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +17 -0
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +19 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -0
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +74 -0
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +20 -0
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +37 -0
- package/dist/composables/useHtmlValidator.js +51 -51
- package/dist/composables/usePartner.d.ts +1 -0
- package/dist/composables/usePartner.js +16 -9
- package/dist/composables/useStripo.js +37 -35
- package/dist/composables/useStripoEventHandler.d.ts +3 -0
- package/dist/composables/useStripoEventHandler.js +20 -0
- package/dist/enums/defaults.d.ts +1 -0
- package/dist/enums/defaults.js +42 -10
- package/dist/enums/onboarding.d.ts +1 -0
- package/dist/enums/onboarding.js +8 -0
- package/dist/guido.css +1 -1
- package/dist/mock/api/user-modal-state.d.ts +2 -0
- package/dist/services/onboardingApi.d.ts +4 -0
- package/dist/services/onboardingApi.js +23 -0
- package/dist/static/assets/onboarding-img.svg.js +4 -0
- package/dist/stores/editor.d.ts +21 -0
- package/dist/stores/editor.js +2 -1
- package/dist/stores/onboarding.d.ts +1068 -0
- package/dist/stores/onboarding.js +95 -0
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
__name: "TextBlockOnboarding",
|
|
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(() => [
|
|
21
|
+
{
|
|
22
|
+
classes: "guido-text-block-onboarding-settings",
|
|
23
|
+
right: "450px",
|
|
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"),
|
|
28
|
+
imageSource: "",
|
|
29
|
+
backButtonClick: () => {
|
|
30
|
+
},
|
|
31
|
+
nextButtonType: "text",
|
|
32
|
+
nextButtonText: i("products.next"),
|
|
33
|
+
nextButtonClick: () => {
|
|
34
|
+
o.next("textBlockOnboarding");
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
classes: "guido-text-block-onboarding-dynamic",
|
|
39
|
+
right: "450px",
|
|
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"),
|
|
44
|
+
imageSource: "",
|
|
45
|
+
backButtonType: "text",
|
|
46
|
+
backButtonText: i("ds-steps.back"),
|
|
47
|
+
backButtonClick: () => {
|
|
48
|
+
o.previous("textBlockOnboarding");
|
|
49
|
+
},
|
|
50
|
+
nextButtonType: "text",
|
|
51
|
+
nextButtonText: i("action-builder.ok"),
|
|
52
|
+
nextButtonClick: () => {
|
|
53
|
+
o.close("textBlockOnboarding");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
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);
|
|
62
|
+
};
|
|
63
|
+
return b(
|
|
64
|
+
() => o.isActive("textBlockOnboarding"),
|
|
65
|
+
(t) => {
|
|
66
|
+
t && o.setConfig("textBlockOnboarding", c.value);
|
|
67
|
+
},
|
|
68
|
+
{ immediate: !0 }
|
|
69
|
+
), { __sfc: !0, trans: i, onboardingStore: o, dynamicPosition: e, onboardingCardsConfig: c, isVisible: l, handleNext: p, handleBack: x, InOnboard: B };
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
y as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
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;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import g from "./VersionHistoryOnboarding.vue2.js";
|
|
2
|
+
import l from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var c = function() {
|
|
4
|
+
var n, t, i, e, s, a;
|
|
5
|
+
var r = this, d = r._self._c, o = r._self._setupProxy;
|
|
6
|
+
return o.isVisible ? d(o.InOnboard, { key: "guido__version-history-onboard", staticClass: "w-21-s p-a z-11", class: (n = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : n.classes, attrs: { id: "guido__version-history-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (t = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : t.bottom, "left-position": (i = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : i.left, "pages-config": o.onboardingStore.onboardings.versionHistoryOnboarding.config, "pointer-position": (e = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : e.position, "right-position": (s = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : s.right, "top-position": (a = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : a.top }, on: { backButtonClick: o.handleBack, close: function(b) {
|
|
7
|
+
return o.onboardingStore.close("versionHistoryOnboarding");
|
|
8
|
+
}, nextButtonClick: o.handleNext } }) : r._e();
|
|
9
|
+
}, _ = [], p = /* @__PURE__ */ l(
|
|
10
|
+
g,
|
|
11
|
+
c,
|
|
12
|
+
_,
|
|
13
|
+
!1,
|
|
14
|
+
null,
|
|
15
|
+
null
|
|
16
|
+
);
|
|
17
|
+
const m = p.exports;
|
|
18
|
+
export {
|
|
19
|
+
m as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as c, computed as e, watch as g } from "vue";
|
|
2
|
+
import { useTranslations as b } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { useOnboardingStore as u } from "../../../stores/onboarding.js";
|
|
4
|
+
import { InOnboard as l } from "@useinsider/design-system-vue";
|
|
5
|
+
const C = /* @__PURE__ */ c({
|
|
6
|
+
__name: "VersionHistoryOnboarding",
|
|
7
|
+
setup(p) {
|
|
8
|
+
const t = b(), n = u(), r = e(() => [
|
|
9
|
+
{
|
|
10
|
+
classes: "guido-version-history-onboarding",
|
|
11
|
+
left: "409px",
|
|
12
|
+
top: "192px",
|
|
13
|
+
position: "Left Top",
|
|
14
|
+
title: t("email-editor.onboarding-version-history-title"),
|
|
15
|
+
description: t("email-editor.onboarding-version-history-description"),
|
|
16
|
+
imageSource: "",
|
|
17
|
+
backButtonClick: () => {
|
|
18
|
+
},
|
|
19
|
+
nextButtonType: "text",
|
|
20
|
+
nextButtonText: t("action-builder.ok"),
|
|
21
|
+
nextButtonClick: () => void n.close("versionHistoryOnboarding")
|
|
22
|
+
}
|
|
23
|
+
]), s = e(() => n.onboardings.versionHistoryOnboarding.config.length > 0 && n.onboardings.versionHistoryOnboarding.isActive), a = () => {
|
|
24
|
+
var o, i;
|
|
25
|
+
(i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.nextButtonClick) == null || i.call(o);
|
|
26
|
+
}, d = () => {
|
|
27
|
+
var o, i;
|
|
28
|
+
(i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.backButtonClick) == null || i.call(o);
|
|
29
|
+
};
|
|
30
|
+
return g(() => n.onboardings.versionHistoryOnboarding.isActive, (o) => {
|
|
31
|
+
o && n.setConfig("versionHistoryOnboarding", r.value);
|
|
32
|
+
}, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n, onboardingCardsConfig: r, isVisible: s, handleNext: a, handleBack: d, InOnboard: l };
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
C as default
|
|
37
|
+
};
|
|
@@ -5,112 +5,112 @@ import { ToasterTypeOptions as r } 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
7
|
import { useHttp as X } from "./useHttp.js";
|
|
8
|
-
import { useToaster as
|
|
9
|
-
import { useTranslations as
|
|
8
|
+
import { useToaster as j } from "./useToaster.js";
|
|
9
|
+
import { useTranslations as z } from "./useTranslations.js";
|
|
10
10
|
const tt = () => {
|
|
11
|
-
var
|
|
12
|
-
const { showToaster: a } =
|
|
13
|
-
const
|
|
14
|
-
"/newsletter/
|
|
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) => {
|
|
13
|
+
const e = await y(
|
|
14
|
+
"/newsletter/template-library/check-template-html-body",
|
|
15
15
|
{ html: P(t) }
|
|
16
|
-
), { status:
|
|
17
|
-
return
|
|
16
|
+
), { status: n, message: c } = e.data;
|
|
17
|
+
return n || a({
|
|
18
18
|
type: r.Alert,
|
|
19
|
-
message:
|
|
20
|
-
}),
|
|
19
|
+
message: n === void 0 ? c : i("newsletter.invalid-url-link-for-toaster")
|
|
20
|
+
}), i(_), c === i(R) && a({
|
|
21
21
|
type: r.Alert,
|
|
22
|
-
message:
|
|
23
|
-
}),
|
|
22
|
+
message: i("newsletter.already-in-progress")
|
|
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
|
-
let
|
|
27
|
-
return e !== null && !
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const [l] =
|
|
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
31
|
v(l) && !s.includes(l) && (a({
|
|
32
32
|
type: r.Warning,
|
|
33
|
-
message:
|
|
34
|
-
}),
|
|
33
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
34
|
+
}), n = !1);
|
|
35
35
|
}
|
|
36
|
-
}),
|
|
36
|
+
}), n;
|
|
37
37
|
}, E = async (t, s, e) => {
|
|
38
|
-
const
|
|
39
|
-
return S(t, s) &&
|
|
38
|
+
const n = e ? await h(t) : !0;
|
|
39
|
+
return S(t, s) && n;
|
|
40
40
|
}, T = (t) => t.length > 0 ? !0 : (a({
|
|
41
41
|
type: r.Warning,
|
|
42
|
-
message:
|
|
42
|
+
message: i("newsletter.html-content-is-empty")
|
|
43
43
|
}), !1), I = (t) => {
|
|
44
44
|
const s = (t.match(/{/gm) || []).length, e = (t.match(/}/gm) || []).length;
|
|
45
45
|
return s > e && a({
|
|
46
46
|
type: r.Warning,
|
|
47
|
-
message:
|
|
47
|
+
message: i("custom-fields.missing-closing-braces")
|
|
48
48
|
}), s < e && a({
|
|
49
49
|
type: r.Warning,
|
|
50
|
-
message:
|
|
50
|
+
message: i("custom-fields.missing-opening-braces")
|
|
51
51
|
}), s === e;
|
|
52
52
|
}, A = (t) => {
|
|
53
53
|
const s = t.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
54
54
|
return s || a({
|
|
55
55
|
type: r.Warning,
|
|
56
|
-
message:
|
|
56
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
57
57
|
}), s;
|
|
58
58
|
}, W = (t, s) => {
|
|
59
59
|
const e = t.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
60
|
-
if (e && !
|
|
61
|
-
const
|
|
62
|
-
const l =
|
|
63
|
-
return !
|
|
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
64
|
});
|
|
65
65
|
return c && a({
|
|
66
66
|
type: r.Warning,
|
|
67
|
-
message:
|
|
67
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
68
68
|
}), !c;
|
|
69
69
|
}
|
|
70
70
|
return !0;
|
|
71
71
|
}, x = (t) => {
|
|
72
72
|
const s = t.match(/{%(.*?)%}/g), e = [];
|
|
73
|
-
let
|
|
73
|
+
let n = !0;
|
|
74
74
|
if (s && s.forEach((c) => {
|
|
75
|
-
const
|
|
76
|
-
(!
|
|
75
|
+
const o = c.match(O), l = c.match(B), L = (o == null ? void 0 : o.join("")) || "";
|
|
76
|
+
(!o || c !== L) && !l && (a({
|
|
77
77
|
type: r.Alert,
|
|
78
|
-
message:
|
|
79
|
-
}),
|
|
78
|
+
message: i("newsletter.display-conditions-invalid-syntax")
|
|
79
|
+
}), n = !1), o && o.forEach((u) => {
|
|
80
80
|
u.trim() === "=" && (a({
|
|
81
81
|
type: r.Alert,
|
|
82
|
-
message:
|
|
83
|
-
}),
|
|
82
|
+
message: i("custom-conditions.wrong-equality-operators")
|
|
83
|
+
}), n = !1);
|
|
84
84
|
const g = u.match(/^[a-zA-Z]*$/g);
|
|
85
85
|
g && g.forEach((p) => {
|
|
86
86
|
w(p) && e.push(p);
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
}), e.length) {
|
|
90
|
-
const c = e.filter((l) => l === "if"),
|
|
91
|
-
c.length !==
|
|
90
|
+
const c = e.filter((l) => l === "if"), o = e.filter((l) => l === "endif");
|
|
91
|
+
c.length !== o.length && (a({
|
|
92
92
|
type: r.Alert,
|
|
93
|
-
message:
|
|
94
|
-
}),
|
|
93
|
+
message: i("custom-conditions.missing-if-endif-tag")
|
|
94
|
+
}), n = !1);
|
|
95
95
|
}
|
|
96
|
-
return
|
|
96
|
+
return n;
|
|
97
97
|
}, b = (t) => {
|
|
98
|
-
const s = (t.match(/{% /gm) || []).length, e = (t.match(/ %}/gm) || []).length,
|
|
99
|
-
return
|
|
98
|
+
const s = (t.match(/{% /gm) || []).length, e = (t.match(/ %}/gm) || []).length, n = s === e;
|
|
99
|
+
return n || a({
|
|
100
100
|
type: r.Warning,
|
|
101
|
-
message:
|
|
102
|
-
}),
|
|
103
|
-
}, N = (t) => (t.match(/({%(.*?)%})/g) || []).filter((e) => e.includes("if")).map((e) => (e.match(/{{.*}}/gm) || []).length).reduce((e,
|
|
101
|
+
message: i("custom-conditions.no-space-after-braces")
|
|
102
|
+
}), 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
104
|
type: r.Warning,
|
|
105
|
-
message:
|
|
105
|
+
message: i("custom-conditions.no-braces-inside-if-tag")
|
|
106
106
|
}), !1) : !0, k = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((e) => e.value === "")) !== void 0 ? (a({
|
|
107
107
|
type: r.Alert,
|
|
108
|
-
message:
|
|
108
|
+
message: i("newsletter.fill-all-necessary-fields")
|
|
109
109
|
}), !1) : !0, F = (t) => {
|
|
110
110
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
111
111
|
return t.match(s) === null ? !0 : (a({
|
|
112
112
|
type: r.Alert,
|
|
113
|
-
message:
|
|
113
|
+
message: i("newsletter.invalid-image-type")
|
|
114
114
|
}), !1);
|
|
115
115
|
};
|
|
116
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) };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { DefaultProductType as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { TEST_PARTNER_LIST as r, DefaultProductType as o, ProductIds as n } from "../enums/defaults.js";
|
|
2
|
+
const i = () => {
|
|
3
|
+
const e = () => window.location.hostname.split(".")[0] || "";
|
|
4
|
+
return {
|
|
5
|
+
getPartnerName: e,
|
|
6
|
+
getProductType: () => {
|
|
7
|
+
const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
|
|
8
|
+
return n[t] || 0;
|
|
9
|
+
},
|
|
10
|
+
isTestPartner: () => {
|
|
11
|
+
const t = e();
|
|
12
|
+
return r.includes(t);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
9
16
|
export {
|
|
10
|
-
|
|
17
|
+
i as usePartner
|
|
11
18
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as S } from "./useActionsApi.js";
|
|
2
2
|
import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import y from "../
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import { useStripoEventHandler as E } from "./useStripoEventHandler.js";
|
|
4
|
+
import { useToaster as C } from "./useToaster.js";
|
|
5
|
+
import { displayConditions as y } from "../enums/displayConditions.js";
|
|
6
|
+
import h from "../extensions/DynamicContent/extension.js";
|
|
7
|
+
import { useStripoApi as w } from "../services/stripoApi.js";
|
|
8
|
+
import b from "../static/styles/customEditorStyle.css.js";
|
|
9
|
+
import { useEditorStore as V } from "../stores/editor.js";
|
|
10
|
+
import { dynamicContentToMergeTags as _ } from "../utils/genericUtil.js";
|
|
11
|
+
const x = (a) => {
|
|
12
|
+
const { handleError: d } = C(), { getToken: c, getCustomFonts: u } = w(), { handleEvent: l } = E(), p = (r, i = []) => {
|
|
13
|
+
const o = V(), { html: e, css: s, forceRecreate: g } = r;
|
|
13
14
|
window.UIEditor.initEditor(
|
|
14
15
|
document.querySelector("#guido-editor"),
|
|
15
16
|
{
|
|
16
|
-
metadata:
|
|
17
|
-
html:
|
|
17
|
+
metadata: a,
|
|
18
|
+
html: e,
|
|
18
19
|
css: s,
|
|
19
|
-
forceRecreate:
|
|
20
|
+
forceRecreate: g,
|
|
20
21
|
locale: "en",
|
|
21
22
|
undoButtonSelector: "#guido__undo-button",
|
|
22
23
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -26,10 +27,10 @@ const P = (d) => {
|
|
|
26
27
|
customAppearanceMergetags: !0,
|
|
27
28
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
28
29
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
29
|
-
customViewStyles:
|
|
30
|
+
customViewStyles: b,
|
|
30
31
|
conditionsEnabled: !0,
|
|
31
32
|
customConditionsEnabled: !0,
|
|
32
|
-
conditionCategories:
|
|
33
|
+
conditionCategories: y,
|
|
33
34
|
enableXSSSecurity: !0,
|
|
34
35
|
messageSettingsEnabled: !1,
|
|
35
36
|
selectBlockAfterDropFromSettingsPanel: !0,
|
|
@@ -40,7 +41,7 @@ const P = (d) => {
|
|
|
40
41
|
},
|
|
41
42
|
mergeTags: [
|
|
42
43
|
{
|
|
43
|
-
entries:
|
|
44
|
+
entries: _(a.preselectedDynamicContentList)
|
|
44
45
|
}
|
|
45
46
|
],
|
|
46
47
|
async onTokenRefreshRequest(t) {
|
|
@@ -48,53 +49,54 @@ const P = (d) => {
|
|
|
48
49
|
const n = await c();
|
|
49
50
|
t(n);
|
|
50
51
|
} catch (n) {
|
|
51
|
-
|
|
52
|
+
d(n, "Failed to refresh token");
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
55
|
onTemplateLoaded() {
|
|
55
56
|
try {
|
|
56
|
-
const { importCss: t } = f(), { activateCustomViewStyles: n } =
|
|
57
|
-
t(), n(),
|
|
57
|
+
const { importCss: t } = f(), { activateCustomViewStyles: n } = S();
|
|
58
|
+
t(), n(), o.isStripoInitialized = !0, o.loadingStatus = !1;
|
|
58
59
|
} catch (t) {
|
|
59
|
-
|
|
60
|
+
d(t, "Failed to load custom interface appearance");
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
onCodeEditorVisibilityChanged(t) {
|
|
63
|
-
|
|
64
|
+
o.isCodeEditorOpen = t;
|
|
64
65
|
},
|
|
65
66
|
onEditorVisualModeChanged(t) {
|
|
66
|
-
|
|
67
|
+
o.editorVisualMode = t.toLowerCase();
|
|
67
68
|
},
|
|
68
69
|
onVersionHistoryVisibilityChanged(t) {
|
|
69
|
-
|
|
70
|
+
o.isVersionHistoryOpen = t;
|
|
70
71
|
},
|
|
71
72
|
onDataChanged() {
|
|
72
|
-
|
|
73
|
+
o.hasChanges = !0;
|
|
73
74
|
},
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
onEvent: l,
|
|
76
|
+
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal", ".in-on-board-wrapper"],
|
|
77
|
+
extensions: [h]
|
|
76
78
|
}
|
|
77
79
|
);
|
|
78
|
-
}, m = (r) => new Promise((i,
|
|
80
|
+
}, m = (r) => new Promise((i, o) => {
|
|
79
81
|
if (document.getElementById("UiEditorScript")) {
|
|
80
82
|
r(), i();
|
|
81
83
|
return;
|
|
82
84
|
}
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
+
const e = document.createElement("script");
|
|
86
|
+
e.id = "UiEditorScript", e.type = "module", e.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", e.onload = () => {
|
|
85
87
|
r(), i();
|
|
86
|
-
},
|
|
88
|
+
}, e.onerror = () => {
|
|
87
89
|
const s = new Error("Failed to load Stripo UIEditor script");
|
|
88
|
-
|
|
89
|
-
}, document.body.appendChild(
|
|
90
|
+
o(s);
|
|
91
|
+
}, document.body.appendChild(e);
|
|
90
92
|
});
|
|
91
93
|
return { initPlugin: async (r) => {
|
|
92
94
|
await m(async () => {
|
|
93
95
|
const i = await u();
|
|
94
|
-
|
|
96
|
+
p(r, i);
|
|
95
97
|
});
|
|
96
98
|
} };
|
|
97
99
|
};
|
|
98
100
|
export {
|
|
99
|
-
|
|
101
|
+
x as useStripo
|
|
100
102
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useOnboardingStore as i } from "../stores/onboarding.js";
|
|
2
|
+
const c = () => {
|
|
3
|
+
const e = {
|
|
4
|
+
block_dropped: ({ blockName: t }) => {
|
|
5
|
+
if (t === "BLOCK_TEXT") {
|
|
6
|
+
const n = i(), o = !n.shouldShowOnboarding("textBlockOnboarding"), r = n.isActive("textBlockOnboarding");
|
|
7
|
+
if (o || r)
|
|
8
|
+
return;
|
|
9
|
+
n.start("textBlockOnboarding");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return { handleEvent: async (t, n) => {
|
|
14
|
+
const o = e[t];
|
|
15
|
+
o && await o(n);
|
|
16
|
+
} };
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
c as useStripoEventHandler
|
|
20
|
+
};
|
package/dist/enums/defaults.d.ts
CHANGED
package/dist/enums/defaults.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = {
|
|
2
2
|
translationsPath: "window.trans.en",
|
|
3
3
|
emailHeader: {
|
|
4
4
|
senderName: "",
|
|
@@ -10,19 +10,51 @@ const t = {
|
|
|
10
10
|
versionHistory: !0
|
|
11
11
|
},
|
|
12
12
|
useHeader: !0
|
|
13
|
-
},
|
|
13
|
+
}, t = {
|
|
14
14
|
promotional: 1,
|
|
15
15
|
transactional: 2
|
|
16
|
-
},
|
|
16
|
+
}, e = "email", o = "Guido User", n = t.promotional, i = 2, s = {
|
|
17
17
|
email: 60,
|
|
18
18
|
architect: 49
|
|
19
|
-
}
|
|
19
|
+
}, u = [
|
|
20
|
+
"alfredtesting",
|
|
21
|
+
"electio",
|
|
22
|
+
"eurekatest",
|
|
23
|
+
"gachapontestpart",
|
|
24
|
+
"gluautomation1",
|
|
25
|
+
"gluautomation2",
|
|
26
|
+
"gluautomation3",
|
|
27
|
+
"gluautomation4",
|
|
28
|
+
"inone",
|
|
29
|
+
"inshoppingcart",
|
|
30
|
+
"krakentest",
|
|
31
|
+
"leeroy",
|
|
32
|
+
"newsletteruat",
|
|
33
|
+
"ozaspava",
|
|
34
|
+
"piratesquad",
|
|
35
|
+
"qaautomation1",
|
|
36
|
+
"qaautomation2",
|
|
37
|
+
"qaautomation3",
|
|
38
|
+
"qaautomation4",
|
|
39
|
+
"roiautomation",
|
|
40
|
+
"seleniumautomation",
|
|
41
|
+
"seleniumautomation1",
|
|
42
|
+
"seleniumautomation2",
|
|
43
|
+
"seleniumautomation3",
|
|
44
|
+
"shopbagg",
|
|
45
|
+
"shopifytest",
|
|
46
|
+
"singlepageqa",
|
|
47
|
+
"testqa",
|
|
48
|
+
"vikingsankara",
|
|
49
|
+
"stripoeditorlivetest"
|
|
50
|
+
];
|
|
20
51
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
52
|
+
a as DefaultGuidoConfig,
|
|
53
|
+
n as DefaultMessageType,
|
|
54
|
+
e as DefaultProductType,
|
|
24
55
|
o as DefaultUsername,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
56
|
+
i as EditorType,
|
|
57
|
+
s as ProductIds,
|
|
58
|
+
u as TEST_PARTNER_LIST,
|
|
59
|
+
t as TemplateTypes
|
|
28
60
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SERVICE_HOVER_SELECTORS: string[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const e = [
|
|
2
|
+
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
|
|
3
|
+
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
|
|
4
|
+
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
|
|
5
|
+
];
|
|
6
|
+
export {
|
|
7
|
+
e as SERVICE_HOVER_SELECTORS
|
|
8
|
+
};
|
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-
|
|
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}.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-2d4cd446]{height:calc(100% - 75px);top:75px}.guido-editor__wrapper[data-v-39783038],.guido-editor__container[data-v-39783038]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-39783038]{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}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useHttp as a } from "../composables/useHttp.js";
|
|
2
|
+
const l = () => {
|
|
3
|
+
const { get: r } = a();
|
|
4
|
+
return {
|
|
5
|
+
fetchUserModalState: async () => {
|
|
6
|
+
try {
|
|
7
|
+
return (await r("/user-modal-state/get")).data;
|
|
8
|
+
} catch (t) {
|
|
9
|
+
throw console.error("fetchUserModalState error:", t), t;
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setUserModalState: async (t, o, s) => {
|
|
13
|
+
try {
|
|
14
|
+
return (await r(`/user-modal-state/set?modal=${t}&state=${o}&page=${s}`)).data;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
throw console.error("setUserModalState error:", e), e;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
l as useOnboardingApi
|
|
23
|
+
};
|