@useinsider/guido 1.0.2-beta.e5fcba7 → 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 +1 -30
- package/dist/@types/events.d.ts +0 -6
- package/dist/@types/generic.d.ts +0 -4
- package/dist/components/Guido.vue.d.ts +1 -2
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +54 -60
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -3
- package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -15
- package/dist/components/organisms/header/LeftSlot.vue.js +10 -10
- package/dist/components/organisms/header/LeftSlot.vue2.js +10 -23
- package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -3
- package/dist/components/organisms/header/RightSlot.vue.js +3 -5
- package/dist/components/organisms/header/RightSlot.vue2.js +19 -23
- 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/composables/useCustomInterfaceAppearance.js +18 -22
- package/dist/composables/useHtmlValidator.d.ts +1 -2
- package/dist/composables/useHtmlValidator.js +75 -85
- package/dist/composables/usePartner.d.ts +0 -1
- package/dist/composables/usePartner.js +9 -16
- package/dist/composables/useSave.d.ts +1 -2
- package/dist/composables/useSave.js +8 -9
- package/dist/composables/useStripo.js +26 -30
- package/dist/composables/useVersionHistoryApi.js +9 -10
- package/dist/enums/defaults.d.ts +0 -1
- package/dist/enums/defaults.js +10 -42
- package/dist/guido.css +1 -1
- package/dist/static/styles/components/alert-message.css.js +2 -32
- package/dist/static/styles/components/button.css.js +2 -32
- package/dist/static/styles/components/wide-panel.css.js +1 -5
- package/dist/static/styles/customEditorStyle.css.js +0 -6
- package/dist/static/styles/variables.css.js +0 -10
- package/dist/stores/dynamic-content.d.ts +0 -12
- package/dist/stores/dynamic-content.js +6 -7
- package/dist/stores/editor.d.ts +0 -21
- package/dist/stores/editor.js +1 -2
- package/dist/utils/genericUtil.js +6 -9
- package/package.json +1 -1
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +0 -20
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +0 -37
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +0 -83
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +0 -17
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +0 -30
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +0 -19
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +0 -43
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +0 -74
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -2
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +0 -20
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +0 -37
- package/dist/composables/useStripoEventHandler.d.ts +0 -3
- package/dist/composables/useStripoEventHandler.js +0 -20
- package/dist/enums/onboarding.d.ts +0 -1
- package/dist/enums/onboarding.js +0 -8
- package/dist/mock/api/user-modal-state.d.ts +0 -2
- package/dist/services/onboardingApi.d.ts +0 -4
- package/dist/services/onboardingApi.js +0 -23
- package/dist/static/assets/onboarding-img.svg.js +0 -4
- package/dist/static/styles/components/notification.css.js +0 -55
- package/dist/static/styles/components/popup.css.js +0 -68
- package/dist/stores/onboarding.d.ts +0 -1068
- package/dist/stores/onboarding.js +0 -95
|
@@ -3,10 +3,10 @@ import { useTranslations as m } from "../../../../composables/useTranslations.js
|
|
|
3
3
|
import { useVersionHistoryApi as l } from "../../../../composables/useVersionHistoryApi.js";
|
|
4
4
|
import { useVersionHistoryStore as a } from "../../../../stores/version-history.js";
|
|
5
5
|
import { getTooltipOptions as n } from "../../../../utils/tooltipUtils.js";
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
6
|
+
import { InSegments as c } from "@useinsider/design-system-vue";
|
|
7
|
+
const h = /* @__PURE__ */ p({
|
|
8
8
|
__name: "ViewOptions",
|
|
9
|
-
setup(
|
|
9
|
+
setup(u) {
|
|
10
10
|
const t = a(), { switchToDesktopPreview: e, switchToMobilePreview: i } = l(), o = m(), r = [
|
|
11
11
|
{
|
|
12
12
|
text: "",
|
|
@@ -33,9 +33,9 @@ const T = /* @__PURE__ */ p({
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
e();
|
|
36
|
-
}, InSegments:
|
|
36
|
+
}, InSegments: c };
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
h as default
|
|
41
41
|
};
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
import S from "../static/styles/base.css.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import e from "../static/styles/components/alert-message.css.js";
|
|
3
|
+
import m from "../static/styles/components/amp-block.css.js";
|
|
4
4
|
import i from "../static/styles/components/base-input.css.js";
|
|
5
5
|
import p from "../static/styles/components/button-group.css.js";
|
|
6
6
|
import n from "../static/styles/components/button.css.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import s from "../static/styles/components/combobox.css.js";
|
|
8
|
+
import C from "../static/styles/components/counter.css.js";
|
|
9
9
|
import f from "../static/styles/components/dropdown-menu.css.js";
|
|
10
10
|
import a from "../static/styles/components/loader.css.js";
|
|
11
11
|
import u from "../static/styles/components/narrow-panel.css.js";
|
|
12
|
-
import c from "../static/styles/components/
|
|
13
|
-
import d from "../static/styles/components/
|
|
14
|
-
import l from "../static/styles/components/
|
|
15
|
-
import h from "../static/styles/components/
|
|
16
|
-
import w from "../static/styles/components/
|
|
17
|
-
import y from "../static/styles/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const A = [
|
|
21
|
-
b,
|
|
12
|
+
import c from "../static/styles/components/switcher.css.js";
|
|
13
|
+
import d from "../static/styles/components/tabs.css.js";
|
|
14
|
+
import l from "../static/styles/components/tools.css.js";
|
|
15
|
+
import h from "../static/styles/components/version-history.css.js";
|
|
16
|
+
import w from "../static/styles/components/wide-panel.css.js";
|
|
17
|
+
import y from "../static/styles/variables.css.js";
|
|
18
|
+
const B = [
|
|
19
|
+
y,
|
|
22
20
|
// Must be on top
|
|
23
21
|
S,
|
|
24
22
|
// Must be on top
|
|
25
|
-
m,
|
|
26
23
|
e,
|
|
24
|
+
m,
|
|
27
25
|
i,
|
|
28
26
|
p,
|
|
29
27
|
n,
|
|
30
|
-
C,
|
|
31
28
|
s,
|
|
29
|
+
C,
|
|
32
30
|
f,
|
|
33
31
|
a,
|
|
34
32
|
u,
|
|
@@ -36,14 +34,12 @@ const A = [
|
|
|
36
34
|
d,
|
|
37
35
|
l,
|
|
38
36
|
h,
|
|
39
|
-
w
|
|
40
|
-
y,
|
|
41
|
-
B
|
|
37
|
+
w
|
|
42
38
|
].join(`
|
|
43
39
|
|
|
44
|
-
`),
|
|
40
|
+
`), R = () => ({ importCss: () => {
|
|
45
41
|
const o = new CSSStyleSheet();
|
|
46
|
-
o.replaceSync(
|
|
42
|
+
o.replaceSync(B);
|
|
47
43
|
const r = document.querySelector("ui-editor");
|
|
48
44
|
if (!r)
|
|
49
45
|
return;
|
|
@@ -51,5 +47,5 @@ const A = [
|
|
|
51
47
|
t && (t.adoptedStyleSheets = [o]);
|
|
52
48
|
} });
|
|
53
49
|
export {
|
|
54
|
-
|
|
50
|
+
R as useCustomInterfaceAppearance
|
|
55
51
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DynamicContent } from '@@/Types/generic';
|
|
2
1
|
export declare const useHtmlValidator: () => {
|
|
3
|
-
validateHtml: (html: string, customFields:
|
|
2
|
+
validateHtml: (html: string, customFields: string[], isOnSaveValidation?: boolean) => Promise<boolean>;
|
|
4
3
|
};
|
|
@@ -1,129 +1,119 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
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";
|
|
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 X } from "./useHttp.js";
|
|
8
8
|
import { useToaster as j } from "./useToaster.js";
|
|
9
|
-
import { useTranslations as
|
|
9
|
+
import { useTranslations as z } from "./useTranslations.js";
|
|
10
10
|
const tt = () => {
|
|
11
11
|
var d;
|
|
12
|
-
const { showToaster:
|
|
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
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: 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")
|
|
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 && !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")
|
|
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 h(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 : (a({
|
|
41
|
+
type: r.Warning,
|
|
42
|
+
message: i("newsletter.html-content-is-empty")
|
|
43
|
+
}), !1), I = (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 && 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")
|
|
51
51
|
}), s === e;
|
|
52
|
-
},
|
|
52
|
+
}, A = (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 || a({
|
|
55
|
+
type: r.Warning,
|
|
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 n =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</ul>
|
|
70
|
-
`;
|
|
71
|
-
return r({
|
|
72
|
-
type: c.Alert,
|
|
73
|
-
message: o("custom-fields.invalid-custom-fields") + i
|
|
74
|
-
}), !1;
|
|
75
|
-
}
|
|
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;
|
|
76
69
|
}
|
|
77
70
|
return !0;
|
|
78
|
-
},
|
|
71
|
+
}, x = (t) => {
|
|
79
72
|
const s = t.match(/{%(.*?)%}/g), e = [];
|
|
80
73
|
let n = !0;
|
|
81
|
-
if (s && s.forEach((
|
|
82
|
-
const
|
|
83
|
-
(!
|
|
84
|
-
type:
|
|
85
|
-
message:
|
|
86
|
-
}), n = !1),
|
|
87
|
-
|
|
88
|
-
type:
|
|
89
|
-
message:
|
|
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")
|
|
90
83
|
}), n = !1);
|
|
91
|
-
const g =
|
|
84
|
+
const g = u.match(/^[a-zA-Z]*$/g);
|
|
92
85
|
g && g.forEach((p) => {
|
|
93
86
|
w(p) && e.push(p);
|
|
94
87
|
});
|
|
95
88
|
});
|
|
96
89
|
}), e.length) {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
type:
|
|
100
|
-
message:
|
|
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")
|
|
101
94
|
}), n = !1);
|
|
102
95
|
}
|
|
103
96
|
return n;
|
|
104
97
|
}, b = (t) => {
|
|
105
98
|
const s = (t.match(/{% /gm) || []).length, e = (t.match(/ %}/gm) || []).length, n = s === e;
|
|
106
|
-
return n ||
|
|
107
|
-
type:
|
|
108
|
-
message:
|
|
99
|
+
return n || a({
|
|
100
|
+
type: r.Warning,
|
|
101
|
+
message: i("custom-conditions.no-space-after-braces")
|
|
109
102
|
}), n;
|
|
110
|
-
},
|
|
111
|
-
type:
|
|
112
|
-
message:
|
|
113
|
-
}), !1) : !0,
|
|
114
|
-
type:
|
|
115
|
-
message:
|
|
116
|
-
}), !1) : !0,
|
|
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) => {
|
|
117
110
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
118
|
-
return t.match(s) === null ? !0 : (
|
|
119
|
-
type:
|
|
120
|
-
message:
|
|
111
|
+
return t.match(s) === null ? !0 : (a({
|
|
112
|
+
type: r.Alert,
|
|
113
|
+
message: i("newsletter.invalid-image-type")
|
|
121
114
|
}), !1);
|
|
122
115
|
};
|
|
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
|
-
} };
|
|
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) };
|
|
127
117
|
};
|
|
128
118
|
export {
|
|
129
119
|
tt as useHtmlValidator
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
isTestPartner: () => {
|
|
11
|
-
const t = e();
|
|
12
|
-
return r.includes(t);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
};
|
|
1
|
+
import { DefaultProductType as e, ProductIds as o } from "../enums/defaults.js";
|
|
2
|
+
const c = () => ({
|
|
3
|
+
getPartnerName: () => window.location.hostname.split(".")[0] || "",
|
|
4
|
+
getProductType: () => {
|
|
5
|
+
const t = window.location.pathname.split("/").filter(Boolean)[0] || e;
|
|
6
|
+
return o[t] || 0;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
16
9
|
export {
|
|
17
|
-
|
|
10
|
+
c as usePartner
|
|
18
11
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { useSaveStart as
|
|
2
|
-
import { useTemplatePreparation as
|
|
1
|
+
import { useSaveStart as r, useSaveComplete as i } from "./useGuidoActions.js";
|
|
2
|
+
import { useTemplatePreparation as m } from "../utils/templatePreparation.js";
|
|
3
3
|
import { useHtmlValidator as l } from "./useHtmlValidator.js";
|
|
4
|
-
const
|
|
5
|
-
const e =
|
|
6
|
-
return { save: async (
|
|
4
|
+
const d = () => {
|
|
5
|
+
const e = r(), a = i(), { validateHtml: s } = l();
|
|
6
|
+
return { save: async () => {
|
|
7
7
|
e();
|
|
8
|
-
const { prepareTemplateDetails:
|
|
9
|
-
|
|
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
|
-
|
|
13
|
+
d as useSave
|
|
15
14
|
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useCustomInterfaceAppearance as
|
|
3
|
-
import {
|
|
4
|
-
import { useToaster as E } from "./useToaster.js";
|
|
1
|
+
import { useActionsApi as g } from "./useActionsApi.js";
|
|
2
|
+
import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
|
|
3
|
+
import { useToaster as S } from "./useToaster.js";
|
|
5
4
|
import { displayConditions as y } from "../enums/displayConditions.js";
|
|
6
|
-
import
|
|
7
|
-
import { useStripoApi as
|
|
8
|
-
import
|
|
9
|
-
import { useEditorStore as
|
|
10
|
-
import { dynamicContentToMergeTags as
|
|
11
|
-
const
|
|
12
|
-
const { handleError:
|
|
13
|
-
const e =
|
|
5
|
+
import C from "../extensions/DynamicContent/extension.js";
|
|
6
|
+
import { useStripoApi as E } from "../services/stripoApi.js";
|
|
7
|
+
import h from "../static/styles/customEditorStyle.css.js";
|
|
8
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
9
|
+
import { dynamicContentToMergeTags as b } from "../utils/genericUtil.js";
|
|
10
|
+
const P = (s) => {
|
|
11
|
+
const { handleError: c } = S(), { getToken: a, getCustomFonts: u } = E(), l = (r, i = []) => {
|
|
12
|
+
const e = w(), { html: o, css: d, forceRecreate: p } = r;
|
|
14
13
|
window.UIEditor.initEditor(
|
|
15
14
|
document.querySelector("#guido-editor"),
|
|
16
15
|
{
|
|
17
16
|
metadata: s,
|
|
18
17
|
html: o,
|
|
19
|
-
css:
|
|
20
|
-
forceRecreate:
|
|
18
|
+
css: d,
|
|
19
|
+
forceRecreate: p,
|
|
21
20
|
locale: "en",
|
|
22
21
|
undoButtonSelector: "#guido__undo-button",
|
|
23
22
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -27,7 +26,7 @@ const R = (s) => {
|
|
|
27
26
|
customAppearanceMergetags: !0,
|
|
28
27
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
29
28
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
30
|
-
customViewStyles:
|
|
29
|
+
customViewStyles: h,
|
|
31
30
|
conditionsEnabled: !0,
|
|
32
31
|
customConditionsEnabled: !0,
|
|
33
32
|
conditionCategories: y,
|
|
@@ -41,25 +40,23 @@ const R = (s) => {
|
|
|
41
40
|
},
|
|
42
41
|
mergeTags: [
|
|
43
42
|
{
|
|
44
|
-
entries:
|
|
43
|
+
entries: b(s.preselectedDynamicContentList)
|
|
45
44
|
}
|
|
46
45
|
],
|
|
47
46
|
async onTokenRefreshRequest(t) {
|
|
48
47
|
try {
|
|
49
|
-
const n = await
|
|
48
|
+
const n = await a();
|
|
50
49
|
t(n);
|
|
51
50
|
} catch (n) {
|
|
52
|
-
|
|
51
|
+
c(n, "Failed to refresh token");
|
|
53
52
|
}
|
|
54
53
|
},
|
|
55
54
|
onTemplateLoaded() {
|
|
56
55
|
try {
|
|
57
|
-
const { importCss: t } =
|
|
58
|
-
t(), n(), s.onReady(), e.
|
|
59
|
-
e.hasChanges = !1;
|
|
60
|
-
}, 1e3);
|
|
56
|
+
const { importCss: t } = f(), { activateCustomViewStyles: n } = g();
|
|
57
|
+
t(), n(), s.onReady(), e.loadingStatus = !1;
|
|
61
58
|
} catch (t) {
|
|
62
|
-
|
|
59
|
+
c(t, "Failed to load custom interface appearance");
|
|
63
60
|
}
|
|
64
61
|
},
|
|
65
62
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -74,9 +71,8 @@ const R = (s) => {
|
|
|
74
71
|
onDataChanged() {
|
|
75
72
|
e.hasChanges = !0;
|
|
76
73
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
extensions: [h]
|
|
74
|
+
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
75
|
+
extensions: [C]
|
|
80
76
|
}
|
|
81
77
|
);
|
|
82
78
|
}, m = (r) => new Promise((i, e) => {
|
|
@@ -88,17 +84,17 @@ const R = (s) => {
|
|
|
88
84
|
o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
|
|
89
85
|
r(), i();
|
|
90
86
|
}, o.onerror = () => {
|
|
91
|
-
const
|
|
92
|
-
e(
|
|
87
|
+
const d = new Error("Failed to load Stripo UIEditor script");
|
|
88
|
+
e(d);
|
|
93
89
|
}, document.body.appendChild(o);
|
|
94
90
|
});
|
|
95
91
|
return { initPlugin: async (r) => {
|
|
96
92
|
await m(async () => {
|
|
97
93
|
const i = await u();
|
|
98
|
-
|
|
94
|
+
l(r, i);
|
|
99
95
|
});
|
|
100
96
|
} };
|
|
101
97
|
};
|
|
102
98
|
export {
|
|
103
|
-
|
|
99
|
+
P as useStripo
|
|
104
100
|
};
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { ToasterTypeOptions as t } from "../enums/toaster.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
i.$reset(), n.isVersionHistoryOpen = !1;
|
|
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();
|
|
10
9
|
};
|
|
11
10
|
return {
|
|
12
11
|
openVersionHistory: () => {
|
|
13
|
-
window.StripoEditorApi.versionHistoryApi.openVersionHistory(
|
|
12
|
+
window.StripoEditorApi.versionHistoryApi.openVersionHistory(n, p);
|
|
14
13
|
},
|
|
15
14
|
closeVersionHistory: () => {
|
|
16
15
|
window.StripoEditorApi.versionHistoryApi.closeVersionHistory();
|
|
@@ -51,5 +50,5 @@ const u = () => {
|
|
|
51
50
|
};
|
|
52
51
|
};
|
|
53
52
|
export {
|
|
54
|
-
|
|
53
|
+
S as useVersionHistoryApi
|
|
55
54
|
};
|
package/dist/enums/defaults.d.ts
CHANGED
package/dist/enums/defaults.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = {
|
|
2
2
|
translationsPath: "window.trans.en",
|
|
3
3
|
emailHeader: {
|
|
4
4
|
senderName: "",
|
|
@@ -10,51 +10,19 @@ const a = {
|
|
|
10
10
|
versionHistory: !0
|
|
11
11
|
},
|
|
12
12
|
useHeader: !0
|
|
13
|
-
},
|
|
13
|
+
}, e = {
|
|
14
14
|
promotional: 1,
|
|
15
15
|
transactional: 2
|
|
16
|
-
},
|
|
16
|
+
}, a = "email", o = "Guido User", s = e.promotional, n = 2, r = {
|
|
17
17
|
email: 60,
|
|
18
18
|
architect: 49
|
|
19
|
-
}
|
|
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
|
-
];
|
|
19
|
+
};
|
|
51
20
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
21
|
+
t as DefaultGuidoConfig,
|
|
22
|
+
s as DefaultMessageType,
|
|
23
|
+
a as DefaultProductType,
|
|
55
24
|
o as DefaultUsername,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
t as TemplateTypes
|
|
25
|
+
n as EditorType,
|
|
26
|
+
r as ProductIds,
|
|
27
|
+
e as TemplateTypes
|
|
60
28
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[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}[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}
|