@useinsider/guido 3.7.0-beta.a6317a3 → 3.7.0-beta.bd7cb8f
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,172 +1,166 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
1
|
+
import { useConfig as _ } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as H } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
|
|
4
4
|
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
5
|
-
import { itemsBlockDynamicVariables as
|
|
6
|
-
import { useRecommendationExtensionStore as
|
|
7
|
-
import { RecommendationRequiredFieldsKey as
|
|
8
|
-
import { useRecommendationStore as
|
|
9
|
-
import { base64EncodeWithSpecialChars as
|
|
10
|
-
import { useHttp as
|
|
11
|
-
import { useToaster as
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
return [...
|
|
5
|
+
import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
6
|
+
import { useRecommendationExtensionStore as X } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
7
|
+
import { RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
|
|
8
|
+
import { useRecommendationStore as K } from "../stores/recommendation.js";
|
|
9
|
+
import { base64EncodeWithSpecialChars as z } from "../utils/base64.js";
|
|
10
|
+
import { useHttp as U } from "./useHttp.js";
|
|
11
|
+
import { useToaster as Y } from "./useToaster.js";
|
|
12
|
+
import { useTranslations as Z } from "./useTranslations.js";
|
|
13
|
+
const J = /recommendation-id="(\d+)"/g;
|
|
14
|
+
function Q(a) {
|
|
15
|
+
return [...a.matchAll(J)].map((u) => u[1]);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function ee(a, u) {
|
|
18
|
+
return u.some((d) => a.startsWith(`${d}_`));
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const ve = () => {
|
|
27
|
-
var h, v;
|
|
28
|
-
const { showToaster: o } = Q(), { post: d } = J(), { config: f } = V(), i = ee(), u = U(), g = j(), y = ((v = (h = f.value) == null ? void 0 : h.partner) == null ? void 0 : v.messageType) === M.transactional, A = async (e) => {
|
|
29
|
-
const t = await d(
|
|
20
|
+
const ge = () => {
|
|
21
|
+
var y, h;
|
|
22
|
+
const { showToaster: a } = Y(), { post: u } = U(), { config: d } = _(), r = Z(), g = K(), S = X(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, b = async (e) => {
|
|
23
|
+
const t = await u(
|
|
30
24
|
"/newsletter/template-library/check-template-html-body",
|
|
31
|
-
{ html:
|
|
25
|
+
{ html: z(e) }
|
|
32
26
|
), { status: n, message: l } = t.data;
|
|
33
|
-
return n ||
|
|
27
|
+
return n || a({
|
|
34
28
|
type: c.Alert,
|
|
35
|
-
message: n === void 0 ? l :
|
|
36
|
-
}),
|
|
29
|
+
message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
|
|
30
|
+
}), r(M), l === r($) && a({
|
|
37
31
|
type: c.Alert,
|
|
38
|
-
message:
|
|
32
|
+
message: r("newsletter.already-in-progress")
|
|
39
33
|
}), n;
|
|
40
|
-
},
|
|
34
|
+
}, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
|
|
41
35
|
const t = e.match(/({%(.*?)%})/g);
|
|
42
36
|
let n = !0;
|
|
43
|
-
return t !== null && !
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
const [
|
|
47
|
-
|
|
37
|
+
return t !== null && !p && t.forEach((l) => {
|
|
38
|
+
const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
39
|
+
if (o && o.length > 0) {
|
|
40
|
+
const [i] = o;
|
|
41
|
+
w(i) && !s.includes(i) && (a({
|
|
48
42
|
type: c.Warning,
|
|
49
|
-
message:
|
|
43
|
+
message: r("custom-fields.invalid-custom-fields")
|
|
50
44
|
}), n = !1);
|
|
51
45
|
}
|
|
52
46
|
}), n;
|
|
53
|
-
},
|
|
54
|
-
const n = t ? await
|
|
55
|
-
return
|
|
56
|
-
}, x = (e) => e.length > 0 ? !0 : (
|
|
47
|
+
}, k = async (e, s, t) => {
|
|
48
|
+
const n = t ? await b(e) : !0;
|
|
49
|
+
return A(e, s) && n;
|
|
50
|
+
}, x = (e) => e.length > 0 ? !0 : (a({
|
|
57
51
|
type: c.Warning,
|
|
58
|
-
message:
|
|
59
|
-
}), !1),
|
|
52
|
+
message: r("newsletter.html-content-is-empty")
|
|
53
|
+
}), !1), I = (e) => {
|
|
60
54
|
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
61
|
-
return s > t &&
|
|
55
|
+
return s > t && a({
|
|
62
56
|
type: c.Warning,
|
|
63
|
-
message:
|
|
64
|
-
}), s < t &&
|
|
57
|
+
message: r("custom-fields.missing-closing-braces")
|
|
58
|
+
}), s < t && a({
|
|
65
59
|
type: c.Warning,
|
|
66
|
-
message:
|
|
60
|
+
message: r("custom-fields.missing-opening-braces")
|
|
67
61
|
}), s === t;
|
|
68
|
-
},
|
|
69
|
-
const s =
|
|
70
|
-
return s ||
|
|
62
|
+
}, F = (e) => {
|
|
63
|
+
const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
64
|
+
return s || a({
|
|
71
65
|
type: c.Warning,
|
|
72
|
-
message:
|
|
66
|
+
message: r("custom-fields.invalid-custom-fields")
|
|
73
67
|
}), s;
|
|
74
|
-
},
|
|
68
|
+
}, T = (e, s) => {
|
|
75
69
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
76
|
-
if (t && !
|
|
77
|
-
const n = new Set(s.map((
|
|
78
|
-
if (t.forEach((
|
|
79
|
-
const m =
|
|
80
|
-
(!n.has(m) || m === "") && !
|
|
81
|
-
}),
|
|
82
|
-
const
|
|
70
|
+
if (t && !p) {
|
|
71
|
+
const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
|
|
72
|
+
if (t.forEach((i) => {
|
|
73
|
+
const m = i.slice(2, -2).trim().toLowerCase();
|
|
74
|
+
(!n.has(m) || m === "") && !ee(m, l) && o.push(m);
|
|
75
|
+
}), o.length > 0) {
|
|
76
|
+
const i = `
|
|
83
77
|
<ul>
|
|
84
|
-
${
|
|
78
|
+
${o.map((m) => `<li>${m}</li>`).join("")}
|
|
85
79
|
</ul>
|
|
86
80
|
`;
|
|
87
|
-
return
|
|
81
|
+
return a({
|
|
88
82
|
type: c.Alert,
|
|
89
|
-
message:
|
|
83
|
+
message: r("custom-fields.invalid-custom-fields") + i
|
|
90
84
|
}), !1;
|
|
91
85
|
}
|
|
92
86
|
}
|
|
93
87
|
return !0;
|
|
94
|
-
},
|
|
88
|
+
}, R = (e) => {
|
|
95
89
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
96
90
|
let n = !0;
|
|
97
91
|
if (s && s.forEach((l) => {
|
|
98
|
-
const
|
|
99
|
-
(!
|
|
92
|
+
const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
|
|
93
|
+
(!o || l !== m) && !i && (a({
|
|
100
94
|
type: c.Alert,
|
|
101
|
-
message:
|
|
102
|
-
}), n = !1),
|
|
103
|
-
|
|
95
|
+
message: r("newsletter.display-conditions-invalid-syntax")
|
|
96
|
+
}), n = !1), o && o.forEach((f) => {
|
|
97
|
+
f.trim() === "=" && (a({
|
|
104
98
|
type: c.Alert,
|
|
105
|
-
message:
|
|
99
|
+
message: r("custom-conditions.wrong-equality-operators")
|
|
106
100
|
}), n = !1);
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
const v = f.match(/^[a-zA-Z]*$/g);
|
|
102
|
+
v && v.forEach((C) => {
|
|
103
|
+
E(C) && t.push(C);
|
|
110
104
|
});
|
|
111
105
|
});
|
|
112
106
|
}), t.length) {
|
|
113
|
-
const l = t.filter((
|
|
114
|
-
l.length !==
|
|
107
|
+
const l = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
|
|
108
|
+
l.length !== o.length && (a({
|
|
115
109
|
type: c.Alert,
|
|
116
|
-
message:
|
|
110
|
+
message: r("custom-conditions.missing-if-endif-tag")
|
|
117
111
|
}), n = !1);
|
|
118
112
|
}
|
|
119
113
|
return n;
|
|
120
|
-
},
|
|
114
|
+
}, B = (e) => {
|
|
121
115
|
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
122
|
-
return n ||
|
|
116
|
+
return n || a({
|
|
123
117
|
type: c.Warning,
|
|
124
|
-
message:
|
|
118
|
+
message: r("custom-conditions.no-space-after-braces")
|
|
125
119
|
}), n;
|
|
126
|
-
},
|
|
120
|
+
}, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
|
|
127
121
|
type: c.Warning,
|
|
128
|
-
message:
|
|
129
|
-
}), !1) : !0,
|
|
122
|
+
message: r("custom-conditions.no-braces-inside-if-tag")
|
|
123
|
+
}), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
|
|
130
124
|
type: c.Alert,
|
|
131
|
-
message:
|
|
132
|
-
}), !1) : !0, O = () =>
|
|
125
|
+
message: r(j)
|
|
126
|
+
}), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
|
|
133
127
|
type: c.Alert,
|
|
134
|
-
message:
|
|
135
|
-
}), !1) : !0,
|
|
128
|
+
message: r("newsletter.fill-all-necessary-fields")
|
|
129
|
+
}), !1) : !0, D = (e) => {
|
|
136
130
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
137
|
-
return e.match(s) === null ? !0 : (
|
|
131
|
+
return e.match(s) === null ? !0 : (a({
|
|
138
132
|
type: c.Alert,
|
|
139
|
-
message:
|
|
133
|
+
message: r("newsletter.invalid-image-type")
|
|
140
134
|
}), !1);
|
|
141
135
|
}, L = (e) => {
|
|
142
136
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
143
|
-
return Array.from(n).find((
|
|
144
|
-
var
|
|
145
|
-
return !((
|
|
146
|
-
}) ? (
|
|
137
|
+
return Array.from(n).find((o) => {
|
|
138
|
+
var i;
|
|
139
|
+
return !((i = o.id) != null && i.trim());
|
|
140
|
+
}) ? (a({
|
|
147
141
|
type: c.Alert,
|
|
148
|
-
message:
|
|
142
|
+
message: r("unsubscribe-templates.select-checkbox-groups")
|
|
149
143
|
}), !1) : !0;
|
|
150
|
-
},
|
|
144
|
+
}, V = (e) => {
|
|
151
145
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
152
|
-
return Array.from(n).find((
|
|
153
|
-
var
|
|
154
|
-
return !((
|
|
155
|
-
}) ? (
|
|
146
|
+
return Array.from(n).find((o) => {
|
|
147
|
+
var i;
|
|
148
|
+
return !((i = o.id) != null && i.trim());
|
|
149
|
+
}) ? (a({
|
|
156
150
|
type: c.Alert,
|
|
157
|
-
message:
|
|
151
|
+
message: r("unsubscribe-templates.select-radio-button-groups")
|
|
158
152
|
}), !1) : !0;
|
|
159
153
|
};
|
|
160
154
|
return { validateHtml: async (e, s, t = !1) => {
|
|
161
|
-
var
|
|
155
|
+
var o, i;
|
|
162
156
|
const n = [
|
|
163
157
|
...s.map((m) => m.value),
|
|
164
|
-
...
|
|
165
|
-
...((
|
|
158
|
+
...q,
|
|
159
|
+
...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
|
|
166
160
|
];
|
|
167
|
-
return await
|
|
161
|
+
return await k(e, n, t) && x(e) && I(e) && F(e) && T(e, n) && R(e) && B(e) && W(e) && N() && O() && D(e) && L(e) && V(e);
|
|
168
162
|
} };
|
|
169
163
|
};
|
|
170
164
|
export {
|
|
171
|
-
|
|
165
|
+
ge as useHtmlValidator
|
|
172
166
|
};
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
1
|
+
import { useActionsApi as I } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as U } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as R } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as x } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as O } from "./useFullStoryBridge.js";
|
|
6
6
|
import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
|
|
7
|
-
import { useToaster as
|
|
8
|
-
import { localePatch as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import { useToaster as H } from "./useToaster.js";
|
|
8
|
+
import { localePatch as z } from "../config/i18n/index.js";
|
|
9
|
+
import { en as h } from "../config/i18n/en/index.js";
|
|
10
|
+
import { ToasterTypeOptions as L } from "../enums/toaster.js";
|
|
11
|
+
import { useStripoApi as $ } from "../services/stripoApi.js";
|
|
12
|
+
import G from "../static/styles/customEditorStyle.css.js";
|
|
13
|
+
import { useEditorStore as C } from "../stores/editor.js";
|
|
14
|
+
import { dynamicContentToMergeTags as J } from "../utils/genericUtil.js";
|
|
15
|
+
import N from "../package.json.js";
|
|
16
|
+
const ce = (E, l) => {
|
|
17
|
+
const { features: c, template: w, isFeatureEnabled: u } = R(), { handleError: m, showToaster: b } = H(), { getToken: T, getCustomFonts: k, getSyncModulesStatus: B } = $(), { handleEvent: F } = q(), { getStripoBlocksConfig: v } = U(), V = async (s, r = [], i = !1) => {
|
|
16
18
|
var g, S, y;
|
|
17
|
-
const e =
|
|
18
|
-
window.UIEditor.initEditor(
|
|
19
|
+
const e = C(), { html: p, css: a } = s, { baseBlocks: t, extensions: d } = await v(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, A = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, M = ((y = w.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
20
|
+
await window.UIEditor.initEditor(
|
|
19
21
|
document.querySelector("#guido-editor"),
|
|
20
22
|
{
|
|
21
|
-
metadata:
|
|
23
|
+
metadata: E,
|
|
22
24
|
html: p,
|
|
23
25
|
css: a,
|
|
24
|
-
forceRecreate:
|
|
26
|
+
forceRecreate: M,
|
|
25
27
|
locale: "en",
|
|
26
28
|
undoButtonSelector: "#guido__undo-button",
|
|
27
29
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -31,12 +33,12 @@ const se = (C, l) => {
|
|
|
31
33
|
customAppearanceMergetags: !u("liquidSyntax"),
|
|
32
34
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
35
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
|
-
customViewStyles:
|
|
36
|
+
customViewStyles: G,
|
|
35
37
|
conditionsEnabled: f,
|
|
36
38
|
customConditionsEnabled: f,
|
|
37
39
|
enableXSSSecurity: !0,
|
|
38
|
-
modulesDisabled:
|
|
39
|
-
syncModulesEnabled:
|
|
40
|
+
modulesDisabled: A,
|
|
41
|
+
syncModulesEnabled: i,
|
|
40
42
|
messageSettingsEnabled: !0,
|
|
41
43
|
displayGmailAnnotations: !0,
|
|
42
44
|
displayHiddenPreheader: !1,
|
|
@@ -45,7 +47,7 @@ const se = (C, l) => {
|
|
|
45
47
|
selectElementAfterDrop: !0,
|
|
46
48
|
sameFontSizeForOutlook: !0,
|
|
47
49
|
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
48
|
-
...
|
|
50
|
+
...t ? { baseBlocks: t } : {},
|
|
49
51
|
editorFonts: {
|
|
50
52
|
showDefaultStandardFonts: !0,
|
|
51
53
|
showDefaultNotStandardFonts: !0,
|
|
@@ -53,38 +55,38 @@ const se = (C, l) => {
|
|
|
53
55
|
},
|
|
54
56
|
mergeTags: [
|
|
55
57
|
{
|
|
56
|
-
entries:
|
|
58
|
+
entries: J(
|
|
57
59
|
l.preselectedDynamicContentList,
|
|
58
60
|
u("liquidSyntax")
|
|
59
61
|
)
|
|
60
62
|
}
|
|
61
63
|
],
|
|
62
|
-
async onTokenRefreshRequest(
|
|
64
|
+
async onTokenRefreshRequest(o) {
|
|
63
65
|
try {
|
|
64
|
-
const n = await
|
|
65
|
-
|
|
66
|
+
const n = await T();
|
|
67
|
+
o(n);
|
|
66
68
|
} catch (n) {
|
|
67
69
|
m(n, "Failed to refresh token");
|
|
68
70
|
}
|
|
69
71
|
},
|
|
70
72
|
onTemplateLoaded() {
|
|
71
73
|
try {
|
|
72
|
-
const { importCss:
|
|
73
|
-
|
|
74
|
+
const { importCss: o } = x(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: P } = I(), { injectFullStory: D } = O();
|
|
75
|
+
o(), n(), D(), P(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
74
76
|
e.hasChanges = !1;
|
|
75
77
|
}, 1e3);
|
|
76
|
-
} catch (
|
|
77
|
-
m(
|
|
78
|
+
} catch (o) {
|
|
79
|
+
m(o, "Failed to load custom interface appearance");
|
|
78
80
|
}
|
|
79
81
|
},
|
|
80
|
-
onCodeEditorVisibilityChanged(
|
|
81
|
-
e.isCodeEditorOpen =
|
|
82
|
+
onCodeEditorVisibilityChanged(o) {
|
|
83
|
+
e.isCodeEditorOpen = o;
|
|
82
84
|
},
|
|
83
|
-
onEditorVisualModeChanged(
|
|
84
|
-
e.editorVisualMode =
|
|
85
|
+
onEditorVisualModeChanged(o) {
|
|
86
|
+
e.editorVisualMode = o.toLowerCase();
|
|
85
87
|
},
|
|
86
|
-
onVersionHistoryVisibilityChanged(
|
|
87
|
-
e.isVersionHistoryOpen =
|
|
88
|
+
onVersionHistoryVisibilityChanged(o) {
|
|
89
|
+
e.isVersionHistoryOpen = o;
|
|
88
90
|
},
|
|
89
91
|
onDataChanged() {
|
|
90
92
|
e.hasChanges = !0;
|
|
@@ -96,32 +98,44 @@ const se = (C, l) => {
|
|
|
96
98
|
".in-drawer__container"
|
|
97
99
|
],
|
|
98
100
|
extensions: d,
|
|
99
|
-
localePatch:
|
|
101
|
+
localePatch: z
|
|
100
102
|
}
|
|
101
103
|
);
|
|
102
|
-
},
|
|
104
|
+
}, _ = (s) => new Promise((r, i) => {
|
|
103
105
|
var d;
|
|
104
106
|
if (document.getElementById("UiEditorScript")) {
|
|
105
|
-
|
|
107
|
+
Promise.resolve(s()).then(r, i);
|
|
106
108
|
return;
|
|
107
109
|
}
|
|
108
|
-
const e =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
}, document.body.appendChild(
|
|
110
|
+
const e = N.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
|
|
111
|
+
t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
|
|
112
|
+
Promise.resolve(s()).then(r, i);
|
|
113
|
+
}, t.onerror = () => {
|
|
114
|
+
i(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
115
|
+
}, document.body.appendChild(t);
|
|
114
116
|
});
|
|
115
|
-
return { initPlugin: async (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
return { initPlugin: async (s) => {
|
|
118
|
+
const r = C();
|
|
119
|
+
try {
|
|
120
|
+
await _(async () => {
|
|
121
|
+
const [i, e] = await Promise.all([
|
|
122
|
+
k(),
|
|
123
|
+
B()
|
|
124
|
+
]);
|
|
125
|
+
r.syncModulesEnabled = e, await V(s, i, e);
|
|
126
|
+
});
|
|
127
|
+
} catch {
|
|
128
|
+
r.loadingStatus = !1, b({
|
|
129
|
+
type: L.Alert,
|
|
130
|
+
message: h["An error has occurred. Please report the error code to support."],
|
|
131
|
+
actionButton: {
|
|
132
|
+
text: h["Reload page"],
|
|
133
|
+
onClick: () => window.location.reload()
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
123
137
|
} };
|
|
124
138
|
};
|
|
125
139
|
export {
|
|
126
|
-
|
|
140
|
+
ce as useStripo
|
|
127
141
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const e = "Your version has been restored successfully.", o = "Restore Image", t = "Cancel", a = {
|
|
2
|
+
"Reload page": "Reload page",
|
|
2
3
|
"The image has been deleted.": "The image has been deleted successfully.",
|
|
3
4
|
"Aim for the drop zone!": "Drag and drop your image inside the upload area to continue.",
|
|
4
5
|
"Image processing": "The image upload is in progress. This may take some time.",
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
"ins-unsubscribe-link",
|
|
3
|
-
"ins-global-unsubscribe-link",
|
|
4
|
-
"ins-preferences-unsubscribe-link",
|
|
5
|
-
"@COUPON_CODE"
|
|
6
|
-
];
|
|
1
|
+
const e = "newsletter.already-in-progress", n = "newsletter.campaign-could-not-be-saved", o = / (==|<=|>=|!=|>|<|in) | (if|elif|endif|else|and|or) |("[\S ]+")|('[\S ]+')|([^”\s\n]+)|(({%)|( %}))/gm, a = /{%( )*now( )(".*")( )*%}/gm;
|
|
7
2
|
export {
|
|
8
|
-
|
|
9
|
-
e as
|
|
10
|
-
|
|
11
|
-
o as
|
|
12
|
-
s as DISPLAY_CONDITIONS_REGEX,
|
|
13
|
-
i as DYNAMIC_CONTENT_TAG_REGEX,
|
|
14
|
-
E as VALID_DYNAMIC_VARIABLE_REGEX
|
|
3
|
+
n as CampaignCouldNotBeSavedKey,
|
|
4
|
+
e as CanNotMakeAnyChangesForRunningKey,
|
|
5
|
+
a as DISPLAY_CONDITIONS_EXCEPTIONS_REGEX,
|
|
6
|
+
o as DISPLAY_CONDITIONS_REGEX
|
|
15
7
|
};
|
|
@@ -4,6 +4,3 @@ export declare const CampaignCouldNotBeSavedKey = "newsletter.campaign-could-not
|
|
|
4
4
|
export declare const DISPLAY_CONDITIONS_REGEX: RegExp;
|
|
5
5
|
export declare const DISPLAY_CONDITIONS_EXCEPTIONS_REGEX: RegExp;
|
|
6
6
|
export declare const REMOVE_CONDITIONS_REGEX: RegExp;
|
|
7
|
-
export declare const DYNAMIC_CONTENT_TAG_REGEX: RegExp;
|
|
8
|
-
export declare const VALID_DYNAMIC_VARIABLE_REGEX: RegExp;
|
|
9
|
-
export declare const ALLOWED_DYNAMIC_SYSTEM_TOKENS: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.7.0-beta.
|
|
3
|
+
"version": "3.7.0-beta.bd7cb8f",
|
|
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",
|