@useinsider/guido 3.10.0-beta.9a07917 → 3.10.0-beta.cbd47be
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/composables/useCortexBlueprintBridge.js +7 -7
- package/dist/composables/useCustomInterfaceAppearance.js +18 -16
- package/dist/composables/useEmailTemplateApplier.js +9 -9
- package/dist/composables/useExport.js +18 -18
- package/dist/composables/useHtmlValidator.js +90 -90
- package/dist/composables/useStripo.js +51 -53
- package/dist/composables/useToaster.js +11 -11
- package/dist/composables/useVersionHistoryApi.js +2 -2
- package/dist/composables/validators/useLiquidValidator.js +1 -1
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +10 -10
- package/dist/enums/toaster.js +2 -2
- package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +7 -7
- package/dist/package.json.js +1 -1
- package/dist/services/blankTemplate.js +1 -1
- package/dist/services/templateLibraryApi.js +7 -8
- package/dist/src/enums/toaster.d.ts +2 -2
- package/dist/src/stores/toaster.d.ts +3 -2
- package/dist/static/styles/components/notification.css.js +74 -0
- package/dist/stores/toaster.js +10 -10
- package/package.json +3 -3
- package/dist/composables/useStripoNotifications.js +0 -26
- package/dist/src/composables/useStripoNotifications.d.ts +0 -10
|
@@ -19,10 +19,10 @@ const x = "email_template", L = "chat", M = "guido:debug:ai", R = () => {
|
|
|
19
19
|
const l = c._s, p = l == null ? void 0 : l.get(L);
|
|
20
20
|
if (!p)
|
|
21
21
|
return;
|
|
22
|
-
const { markPending: d, applyTemplate: f, applyTemplateDebounced: T } = w(), { showToaster:
|
|
23
|
-
const e =
|
|
22
|
+
const { markPending: d, applyTemplate: f, applyTemplateDebounced: T } = w(), { showToaster: h } = I(), y = P(), A = (r, t) => {
|
|
23
|
+
const e = y(r);
|
|
24
24
|
return e === r ? t : e;
|
|
25
|
-
}, i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), u = R(),
|
|
25
|
+
}, i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), u = R(), E = (r, t) => {
|
|
26
26
|
u && console.debug(`[guido:cortex] msg=${r ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
|
|
27
27
|
}, b = (r) => {
|
|
28
28
|
if (r.blueprintType !== x)
|
|
@@ -36,9 +36,9 @@ const x = "email_template", L = "chat", M = "guido:debug:ai", R = () => {
|
|
|
36
36
|
}
|
|
37
37
|
const o = i.get(t);
|
|
38
38
|
o === void 0 ? (i.set(t, e.html), f(t, e)) : o !== e.html && (i.set(t, e.html), T(t, e));
|
|
39
|
-
}, s = (r) => r === void 0 || a.has(r) ? !1 : (a.add(r),
|
|
40
|
-
type: S.
|
|
41
|
-
message:
|
|
39
|
+
}, s = (r) => r === void 0 || a.has(r) ? !1 : (a.add(r), h({
|
|
40
|
+
type: S.Alert,
|
|
41
|
+
message: A("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
|
|
42
42
|
}), !0), m = B(
|
|
43
43
|
() => p.messages,
|
|
44
44
|
(r) => {
|
|
@@ -48,7 +48,7 @@ const x = "email_template", L = "chat", M = "guido:debug:ai", R = () => {
|
|
|
48
48
|
const o = t == null ? void 0 : t.segments;
|
|
49
49
|
Array.isArray(o) && o.forEach((n) => {
|
|
50
50
|
if (n)
|
|
51
|
-
switch (
|
|
51
|
+
switch (E(e, n), n.type) {
|
|
52
52
|
case "blueprint":
|
|
53
53
|
b(n);
|
|
54
54
|
break;
|
|
@@ -4,20 +4,21 @@ import e 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 C from "../static/styles/components/combobox.css.js";
|
|
8
|
+
import s 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/components/
|
|
18
|
-
import B from "../static/styles/
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
import c from "../static/styles/components/notification.css.js";
|
|
13
|
+
import d from "../static/styles/components/popup.css.js";
|
|
14
|
+
import l from "../static/styles/components/switcher.css.js";
|
|
15
|
+
import h from "../static/styles/components/tabs.css.js";
|
|
16
|
+
import w from "../static/styles/components/tools.css.js";
|
|
17
|
+
import y from "../static/styles/components/version-history.css.js";
|
|
18
|
+
import B from "../static/styles/components/wide-panel.css.js";
|
|
19
|
+
import b from "../static/styles/variables.css.js";
|
|
20
|
+
const A = [
|
|
21
|
+
b,
|
|
21
22
|
// Must be on top
|
|
22
23
|
S,
|
|
23
24
|
// Must be on top
|
|
@@ -26,8 +27,8 @@ const b = [
|
|
|
26
27
|
i,
|
|
27
28
|
p,
|
|
28
29
|
n,
|
|
29
|
-
s,
|
|
30
30
|
C,
|
|
31
|
+
s,
|
|
31
32
|
f,
|
|
32
33
|
a,
|
|
33
34
|
u,
|
|
@@ -36,12 +37,13 @@ const b = [
|
|
|
36
37
|
l,
|
|
37
38
|
h,
|
|
38
39
|
w,
|
|
39
|
-
y
|
|
40
|
+
y,
|
|
41
|
+
B
|
|
40
42
|
].join(`
|
|
41
43
|
|
|
42
|
-
`),
|
|
44
|
+
`), F = () => ({ importCss: () => {
|
|
43
45
|
const o = new CSSStyleSheet();
|
|
44
|
-
o.replaceSync(
|
|
46
|
+
o.replaceSync(A);
|
|
45
47
|
const r = document.querySelector("ui-editor");
|
|
46
48
|
if (!r)
|
|
47
49
|
return;
|
|
@@ -49,5 +51,5 @@ const b = [
|
|
|
49
51
|
t && (t.adoptedStyleSheets = [o]);
|
|
50
52
|
} });
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
F as useCustomInterfaceAppearance
|
|
53
55
|
};
|
|
@@ -3,19 +3,19 @@ import { useToaster as f } from "./useToaster.js";
|
|
|
3
3
|
import { useTranslations as y } from "./useTranslations.js";
|
|
4
4
|
import { ToasterTypeOptions as n } from "../enums/toaster.js";
|
|
5
5
|
import { ref as v } from "vue";
|
|
6
|
-
const
|
|
7
|
-
const { updateHtmlAndCss: l } = T(), { showToaster:
|
|
6
|
+
const h = 250, s = v({}), o = {}, j = () => {
|
|
7
|
+
const { updateHtmlAndCss: l } = T(), { showToaster: r } = f(), i = y(), u = (e) => {
|
|
8
8
|
s.value[e] === void 0 && (s.value = { ...s.value, [e]: "pending" });
|
|
9
|
-
}, c = (e, t,
|
|
9
|
+
}, c = (e, t, p) => {
|
|
10
10
|
s.value = { ...s.value, [e]: "applying" };
|
|
11
11
|
try {
|
|
12
|
-
l(t,
|
|
12
|
+
l(t, p), s.value = { ...s.value, [e]: "applied" }, r({
|
|
13
13
|
type: n.Success,
|
|
14
14
|
message: i("newsletter.ai-template-applied")
|
|
15
15
|
});
|
|
16
16
|
} catch (a) {
|
|
17
|
-
s.value = { ...s.value, [e]: "failed" },
|
|
18
|
-
type: n.
|
|
17
|
+
s.value = { ...s.value, [e]: "failed" }, r({
|
|
18
|
+
type: n.Alert,
|
|
19
19
|
message: a instanceof Error ? a.message : "Failed to apply template"
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -29,10 +29,10 @@ const E = 250, s = v({}), o = {}, j = () => {
|
|
|
29
29
|
if (!t.html)
|
|
30
30
|
return;
|
|
31
31
|
m(e);
|
|
32
|
-
const { html:
|
|
32
|
+
const { html: p } = t, a = t.css ?? "";
|
|
33
33
|
o[e] = setTimeout(() => {
|
|
34
|
-
delete o[e], c(e,
|
|
35
|
-
},
|
|
34
|
+
delete o[e], c(e, p, a);
|
|
35
|
+
}, h);
|
|
36
36
|
} };
|
|
37
37
|
}, k = () => {
|
|
38
38
|
Object.values(o).forEach(clearTimeout), Object.keys(o).forEach((l) => delete o[l]), s.value = {};
|
|
@@ -3,39 +3,39 @@ import { useActionsApi as m } from "./useActionsApi.js";
|
|
|
3
3
|
import { useHtmlCompiler as p } from "./useHtmlCompiler.js";
|
|
4
4
|
import { useToaster as d } from "./useToaster.js";
|
|
5
5
|
const H = () => {
|
|
6
|
-
const
|
|
7
|
-
const i = new Blob([s], { type:
|
|
6
|
+
const l = (s, o, r) => {
|
|
7
|
+
const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
|
|
8
8
|
e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
|
|
9
|
-
},
|
|
10
|
-
const o = /* @__PURE__ */ new Date(),
|
|
11
|
-
return `${s}_${
|
|
9
|
+
}, c = (s) => {
|
|
10
|
+
const o = /* @__PURE__ */ new Date(), r = String(o.getDate()).padStart(2, "0"), i = String(o.getMonth() + 1).padStart(2, "0"), t = o.getFullYear(), e = String(o.getHours()).padStart(2, "0"), n = String(o.getMinutes()).padStart(2, "0");
|
|
11
|
+
return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
|
|
12
12
|
};
|
|
13
13
|
return { exportHtml: async (s = !0) => {
|
|
14
|
-
const { getCompiledEmail: o } = m(), { showToaster:
|
|
14
|
+
const { getCompiledEmail: o } = m(), { showToaster: r } = d(), { compileHtml: i } = p();
|
|
15
15
|
try {
|
|
16
16
|
const { html: t } = await o();
|
|
17
17
|
if (t) {
|
|
18
18
|
let e = t;
|
|
19
19
|
if (s) {
|
|
20
|
-
const
|
|
21
|
-
e =
|
|
22
|
-
originalSize:
|
|
23
|
-
compiledSize:
|
|
24
|
-
reduction: `${
|
|
25
|
-
appliedRules:
|
|
26
|
-
executionTime: `${
|
|
20
|
+
const n = i(t);
|
|
21
|
+
e = n.compiledHtml, console.debug("HTML Compilation Stats:", {
|
|
22
|
+
originalSize: n.stats.originalSize,
|
|
23
|
+
compiledSize: n.stats.compiledSize,
|
|
24
|
+
reduction: `${n.stats.reductionPercentage.toFixed(2)}%`,
|
|
25
|
+
appliedRules: n.appliedRules,
|
|
26
|
+
executionTime: `${n.stats.executionTime.toFixed(2)}ms`
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
l(e, c("HTML"), "text/html");
|
|
30
30
|
} else
|
|
31
|
-
|
|
32
|
-
type: a.
|
|
31
|
+
r({
|
|
32
|
+
type: a.Alert,
|
|
33
33
|
message: "No HTML content to download"
|
|
34
34
|
});
|
|
35
35
|
} catch (t) {
|
|
36
36
|
const e = t instanceof Error ? t.message : String(t);
|
|
37
|
-
|
|
38
|
-
type: a.
|
|
37
|
+
r({
|
|
38
|
+
type: a.Alert,
|
|
39
39
|
message: `Error compiling email: ${e}`
|
|
40
40
|
});
|
|
41
41
|
}
|
|
@@ -11,11 +11,11 @@ import { RecommendationRequiredFieldsKey as ee } from "../extensions/Blocks/Reco
|
|
|
11
11
|
import { useRecommendationStore as te } from "../stores/recommendation.js";
|
|
12
12
|
import { base64EncodeWithSpecialChars as ne } from "../utils/base64.js";
|
|
13
13
|
import { useHttp as se } from "./useHttp.js";
|
|
14
|
-
import { useToaster as
|
|
15
|
-
import { useTranslations as
|
|
16
|
-
const
|
|
14
|
+
import { useToaster as oe } from "./useToaster.js";
|
|
15
|
+
import { useTranslations as ie } from "./useTranslations.js";
|
|
16
|
+
const re = /recommendation-id="(\d+)"/g;
|
|
17
17
|
function ae(t) {
|
|
18
|
-
return [...t.matchAll(
|
|
18
|
+
return [...t.matchAll(re)].map((m) => m[1]);
|
|
19
19
|
}
|
|
20
20
|
function ce(t, m) {
|
|
21
21
|
return m.some((f) => t.startsWith(`${f}_`));
|
|
@@ -31,34 +31,34 @@ function ue(t) {
|
|
|
31
31
|
m.add(Q(f.attributeName, t).toLowerCase());
|
|
32
32
|
}), m;
|
|
33
33
|
}
|
|
34
|
-
function de(t, m, f,
|
|
34
|
+
function de(t, m, f, i, d) {
|
|
35
35
|
const u = t.match(/{{([a-zA-Z0-9_.\s]*)}}/gm);
|
|
36
36
|
if (!u)
|
|
37
37
|
return [];
|
|
38
|
-
const p = new Set(m.map((
|
|
39
|
-
return u.forEach((
|
|
40
|
-
const g =
|
|
38
|
+
const p = new Set(m.map((y) => y.toLowerCase())), h = [];
|
|
39
|
+
return u.forEach((y) => {
|
|
40
|
+
const g = y.slice(2, -2).trim().toLowerCase();
|
|
41
41
|
if (g !== "" && p.has(g))
|
|
42
42
|
return;
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
if (!d || d.has(
|
|
43
|
+
const E = me(g);
|
|
44
|
+
if (E && i.has(E.recoId)) {
|
|
45
|
+
if (!d || d.has(E.attribute))
|
|
46
46
|
return;
|
|
47
|
-
|
|
47
|
+
h.push(g);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
ce(g, f) || g.includes(".") ||
|
|
51
|
-
}),
|
|
50
|
+
ce(g, f) || g.includes(".") || h.push(g);
|
|
51
|
+
}), h;
|
|
52
52
|
}
|
|
53
53
|
function fe(t) {
|
|
54
|
-
return (t.replace(U, "$1").match(j) ?? []).filter((
|
|
55
|
-
const d =
|
|
54
|
+
return (t.replace(U, "$1").match(j) ?? []).filter((i) => {
|
|
55
|
+
const d = i.slice(2, -2), u = d.indexOf("|"), p = (u === -1 ? d : d.slice(0, u)).trim();
|
|
56
56
|
return q.includes(p) ? !1 : K.test(p) ? u !== -1 && d.slice(u + 1).trim() === "" : !0;
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
const xe = () => {
|
|
60
|
-
var
|
|
61
|
-
const { showToaster: t } =
|
|
60
|
+
var I, b;
|
|
61
|
+
const { showToaster: t } = oe(), { post: m } = se(), { config: f } = W(), i = ie(), d = te(), u = J(), p = ((b = (I = f.value) == null ? void 0 : I.partner) == null ? void 0 : b.messageType) === H.transactional, h = async (e) => {
|
|
62
62
|
if (e.size === 0)
|
|
63
63
|
return /* @__PURE__ */ new Set();
|
|
64
64
|
try {
|
|
@@ -67,53 +67,53 @@ const xe = () => {
|
|
|
67
67
|
return null;
|
|
68
68
|
}
|
|
69
69
|
return ue(u.filterList);
|
|
70
|
-
},
|
|
70
|
+
}, y = async (e) => {
|
|
71
71
|
const n = await m(
|
|
72
72
|
"/newsletter/template-library/check-template-html-body",
|
|
73
73
|
{ html: ne(e) }
|
|
74
|
-
), { status:
|
|
75
|
-
return
|
|
76
|
-
type: c.
|
|
77
|
-
message:
|
|
78
|
-
}),
|
|
79
|
-
type: c.
|
|
80
|
-
message:
|
|
81
|
-
}),
|
|
82
|
-
}, g = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()),
|
|
74
|
+
), { status: o, message: a } = n.data;
|
|
75
|
+
return o || t({
|
|
76
|
+
type: c.Alert,
|
|
77
|
+
message: o === void 0 ? a : i("newsletter.invalid-url-link-for-toaster")
|
|
78
|
+
}), i($), a === i(Y) && t({
|
|
79
|
+
type: c.Alert,
|
|
80
|
+
message: i("newsletter.already-in-progress")
|
|
81
|
+
}), o;
|
|
82
|
+
}, g = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), T = (e, s) => {
|
|
83
83
|
const n = e.match(/({%(.*?)%})/g);
|
|
84
|
-
let
|
|
84
|
+
let o = !0;
|
|
85
85
|
return n !== null && !p && n.forEach((a) => {
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
const [l] =
|
|
86
|
+
const r = a.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
87
|
+
if (r && r.length > 0) {
|
|
88
|
+
const [l] = r;
|
|
89
89
|
g(l) && !s.includes(l) && (t({
|
|
90
90
|
type: c.Warning,
|
|
91
|
-
message:
|
|
92
|
-
}),
|
|
91
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
92
|
+
}), o = !1);
|
|
93
93
|
}
|
|
94
|
-
}),
|
|
94
|
+
}), o;
|
|
95
95
|
}, w = async (e, s, n) => {
|
|
96
|
-
const
|
|
97
|
-
return T(e, s) &&
|
|
96
|
+
const o = n ? await y(e) : !0;
|
|
97
|
+
return T(e, s) && o;
|
|
98
98
|
}, R = (e) => e.length > 0 ? !0 : (t({
|
|
99
99
|
type: c.Warning,
|
|
100
|
-
message:
|
|
100
|
+
message: i("newsletter.html-content-is-empty")
|
|
101
101
|
}), !1), _ = (e) => {
|
|
102
102
|
const s = (e.match(/{/gm) || []).length, n = (e.match(/}/gm) || []).length;
|
|
103
103
|
return s > n && t({
|
|
104
104
|
type: c.Warning,
|
|
105
|
-
message:
|
|
105
|
+
message: i("custom-fields.missing-closing-braces")
|
|
106
106
|
}), s < n && t({
|
|
107
107
|
type: c.Warning,
|
|
108
|
-
message:
|
|
108
|
+
message: i("custom-fields.missing-opening-braces")
|
|
109
109
|
}), s === n;
|
|
110
110
|
}, N = (e) => {
|
|
111
111
|
const s = fe(e).length === 0;
|
|
112
112
|
return s || t({
|
|
113
113
|
type: c.Warning,
|
|
114
|
-
message:
|
|
114
|
+
message: i("custom-fields.invalid-custom-fields")
|
|
115
115
|
}), s;
|
|
116
|
-
}, x = (e, s, n,
|
|
116
|
+
}, x = (e, s, n, o) => {
|
|
117
117
|
if (p)
|
|
118
118
|
return !0;
|
|
119
119
|
const a = de(
|
|
@@ -121,94 +121,94 @@ const xe = () => {
|
|
|
121
121
|
s,
|
|
122
122
|
ae(e),
|
|
123
123
|
n,
|
|
124
|
-
|
|
124
|
+
o
|
|
125
125
|
);
|
|
126
126
|
if (a.length > 0) {
|
|
127
|
-
const
|
|
127
|
+
const r = `
|
|
128
128
|
<ul>
|
|
129
129
|
${a.map((l) => `<li>${l}</li>`).join("")}
|
|
130
130
|
</ul>
|
|
131
131
|
`;
|
|
132
132
|
return t({
|
|
133
|
-
type: c.
|
|
134
|
-
message:
|
|
133
|
+
type: c.Alert,
|
|
134
|
+
message: i("custom-fields.invalid-custom-fields") + r
|
|
135
135
|
}), !1;
|
|
136
136
|
}
|
|
137
137
|
return !0;
|
|
138
138
|
}, O = (e) => {
|
|
139
139
|
const s = e.match(/{%(.*?)%}/g), n = [];
|
|
140
|
-
let
|
|
140
|
+
let o = !0;
|
|
141
141
|
if (s && s.forEach((a) => {
|
|
142
|
-
const
|
|
143
|
-
(!
|
|
144
|
-
type: c.
|
|
145
|
-
message:
|
|
146
|
-
}),
|
|
142
|
+
const r = a.match(P), l = a.match(X), v = (r == null ? void 0 : r.join("")) || "";
|
|
143
|
+
(!r || a !== v) && !l && (t({
|
|
144
|
+
type: c.Alert,
|
|
145
|
+
message: i("newsletter.display-conditions-invalid-syntax")
|
|
146
|
+
}), o = !1), r && r.forEach((C) => {
|
|
147
147
|
C.trim() === "=" && (t({
|
|
148
|
-
type: c.
|
|
149
|
-
message:
|
|
150
|
-
}),
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
type: c.Alert,
|
|
149
|
+
message: i("custom-conditions.wrong-equality-operators")
|
|
150
|
+
}), o = !1);
|
|
151
|
+
const A = C.match(/^[a-zA-Z]*$/g);
|
|
152
|
+
A && A.forEach((S) => {
|
|
153
|
+
E(S) && n.push(S);
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
156
|
}), n.length) {
|
|
157
|
-
const a = n.filter((l) => l === "if"),
|
|
158
|
-
a.length !==
|
|
159
|
-
type: c.
|
|
160
|
-
message:
|
|
161
|
-
}),
|
|
157
|
+
const a = n.filter((l) => l === "if"), r = n.filter((l) => l === "endif");
|
|
158
|
+
a.length !== r.length && (t({
|
|
159
|
+
type: c.Alert,
|
|
160
|
+
message: i("custom-conditions.missing-if-endif-tag")
|
|
161
|
+
}), o = !1);
|
|
162
162
|
}
|
|
163
|
-
return
|
|
163
|
+
return o;
|
|
164
164
|
}, k = (e) => {
|
|
165
|
-
const s = (e.match(/{% /gm) || []).length, n = (e.match(/ %}/gm) || []).length,
|
|
166
|
-
return
|
|
165
|
+
const s = (e.match(/{% /gm) || []).length, n = (e.match(/ %}/gm) || []).length, o = s === n;
|
|
166
|
+
return o || t({
|
|
167
167
|
type: c.Warning,
|
|
168
|
-
message:
|
|
169
|
-
}),
|
|
170
|
-
}, B = (e) => (e.match(/({%(.*?)%})/g) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n,
|
|
168
|
+
message: i("custom-conditions.no-space-after-braces")
|
|
169
|
+
}), o;
|
|
170
|
+
}, B = (e) => (e.match(/({%(.*?)%})/g) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, o) => n + o, 0) > 0 ? (t({
|
|
171
171
|
type: c.Warning,
|
|
172
|
-
message:
|
|
172
|
+
message: i("custom-conditions.no-braces-inside-if-tag")
|
|
173
173
|
}), !1) : !0, D = () => u.hasInvalidBlock() ? (t({
|
|
174
|
-
type: c.
|
|
175
|
-
message:
|
|
174
|
+
type: c.Alert,
|
|
175
|
+
message: i(ee)
|
|
176
176
|
}), !1) : !0, F = () => d.recommendationConfigs && Object.values(d.recommendationConfigs).find((s) => s.filters.find((n) => n.value === "")) !== void 0 ? (t({
|
|
177
|
-
type: c.
|
|
178
|
-
message:
|
|
177
|
+
type: c.Alert,
|
|
178
|
+
message: i("newsletter.fill-all-necessary-fields")
|
|
179
179
|
}), !1) : !0, L = (e) => {
|
|
180
180
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
181
181
|
return e.match(s) === null ? !0 : (t({
|
|
182
|
-
type: c.
|
|
183
|
-
message:
|
|
182
|
+
type: c.Alert,
|
|
183
|
+
message: i("newsletter.invalid-image-type")
|
|
184
184
|
}), !1);
|
|
185
185
|
}, V = (e) => {
|
|
186
|
-
const
|
|
187
|
-
return Array.from(
|
|
186
|
+
const o = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
187
|
+
return Array.from(o).find((r) => {
|
|
188
188
|
var l;
|
|
189
|
-
return !((l =
|
|
189
|
+
return !((l = r.id) != null && l.trim());
|
|
190
190
|
}) ? (t({
|
|
191
|
-
type: c.
|
|
192
|
-
message:
|
|
191
|
+
type: c.Alert,
|
|
192
|
+
message: i("unsubscribe-templates.select-checkbox-groups")
|
|
193
193
|
}), !1) : !0;
|
|
194
194
|
}, M = (e) => {
|
|
195
|
-
const
|
|
196
|
-
return Array.from(
|
|
195
|
+
const o = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
196
|
+
return Array.from(o).find((r) => {
|
|
197
197
|
var l;
|
|
198
|
-
return !((l =
|
|
198
|
+
return !((l = r.id) != null && l.trim());
|
|
199
199
|
}) ? (t({
|
|
200
|
-
type: c.
|
|
201
|
-
message:
|
|
200
|
+
type: c.Alert,
|
|
201
|
+
message: i("unsubscribe-templates.select-radio-button-groups")
|
|
202
202
|
}), !1) : !0;
|
|
203
203
|
};
|
|
204
204
|
return { validateHtml: async (e, s, n = !1) => {
|
|
205
205
|
var v, C;
|
|
206
|
-
const
|
|
207
|
-
...s.map((
|
|
206
|
+
const o = [
|
|
207
|
+
...s.map((A) => A.value),
|
|
208
208
|
...z,
|
|
209
209
|
...((C = (v = f.value) == null ? void 0 : v.template) == null ? void 0 : C.customFieldAttributes) ?? []
|
|
210
|
-
], a = G(e),
|
|
211
|
-
return await w(e,
|
|
210
|
+
], a = G(e), r = await h(a);
|
|
211
|
+
return await w(e, o, n) && R(e) && _(e) && N(e) && x(e, o, a, r) && O(e) && k(e) && B(e) && D() && F() && L(e) && V(e) && M(e);
|
|
212
212
|
} };
|
|
213
213
|
};
|
|
214
214
|
export {
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useStripoEventHandler as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { localePatch as L } from "../config/i18n/index.js";
|
|
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
|
+
import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
|
|
7
|
+
import { useToaster as H } from "./useToaster.js";
|
|
8
|
+
import { localePatch as z } from "../config/i18n/index.js";
|
|
10
9
|
import { en as h } from "../config/i18n/en/index.js";
|
|
11
|
-
import { ToasterTypeOptions as
|
|
12
|
-
import { useStripoApi as
|
|
13
|
-
import
|
|
14
|
-
import { useEditorStore as
|
|
15
|
-
import { dynamicContentToMergeTags as
|
|
16
|
-
import
|
|
17
|
-
const
|
|
18
|
-
const { features: c, template: w, isFeatureEnabled: u } =
|
|
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) => {
|
|
19
18
|
var g, S, y;
|
|
20
|
-
const
|
|
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;
|
|
21
20
|
await window.UIEditor.initEditor(
|
|
22
21
|
document.querySelector("#guido-editor"),
|
|
23
22
|
{
|
|
24
|
-
metadata:
|
|
23
|
+
metadata: E,
|
|
25
24
|
html: p,
|
|
26
25
|
css: a,
|
|
27
|
-
forceRecreate:
|
|
26
|
+
forceRecreate: M,
|
|
28
27
|
locale: "en",
|
|
29
28
|
undoButtonSelector: "#guido__undo-button",
|
|
30
29
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -34,12 +33,12 @@ const fo = (C, l) => {
|
|
|
34
33
|
customAppearanceMergetags: !u("liquidSyntax"),
|
|
35
34
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
36
35
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
37
|
-
customViewStyles:
|
|
36
|
+
customViewStyles: G,
|
|
38
37
|
conditionsEnabled: f,
|
|
39
38
|
customConditionsEnabled: f,
|
|
40
39
|
enableXSSSecurity: !0,
|
|
41
|
-
modulesDisabled:
|
|
42
|
-
syncModulesEnabled:
|
|
40
|
+
modulesDisabled: A,
|
|
41
|
+
syncModulesEnabled: i,
|
|
43
42
|
messageSettingsEnabled: !0,
|
|
44
43
|
displayGmailAnnotations: !0,
|
|
45
44
|
displayHiddenPreheader: !1,
|
|
@@ -52,83 +51,82 @@ const fo = (C, l) => {
|
|
|
52
51
|
editorFonts: {
|
|
53
52
|
showDefaultStandardFonts: !0,
|
|
54
53
|
showDefaultNotStandardFonts: !0,
|
|
55
|
-
customFonts:
|
|
54
|
+
customFonts: r
|
|
56
55
|
},
|
|
57
56
|
mergeTags: [
|
|
58
57
|
{
|
|
59
|
-
entries:
|
|
58
|
+
entries: J(
|
|
60
59
|
l.preselectedDynamicContentList,
|
|
61
60
|
u("liquidSyntax")
|
|
62
61
|
)
|
|
63
62
|
}
|
|
64
63
|
],
|
|
65
|
-
async onTokenRefreshRequest(
|
|
64
|
+
async onTokenRefreshRequest(o) {
|
|
66
65
|
try {
|
|
67
66
|
const n = await T();
|
|
68
|
-
|
|
67
|
+
o(n);
|
|
69
68
|
} catch (n) {
|
|
70
69
|
m(n, "Failed to refresh token");
|
|
71
70
|
}
|
|
72
71
|
},
|
|
73
72
|
onTemplateLoaded() {
|
|
74
73
|
try {
|
|
75
|
-
const { importCss:
|
|
76
|
-
|
|
77
|
-
|
|
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(() => {
|
|
76
|
+
e.hasChanges = !1;
|
|
78
77
|
}, 1e3);
|
|
79
|
-
} catch (
|
|
80
|
-
m(
|
|
78
|
+
} catch (o) {
|
|
79
|
+
m(o, "Failed to load custom interface appearance");
|
|
81
80
|
}
|
|
82
81
|
},
|
|
83
|
-
onCodeEditorVisibilityChanged(
|
|
84
|
-
|
|
82
|
+
onCodeEditorVisibilityChanged(o) {
|
|
83
|
+
e.isCodeEditorOpen = o;
|
|
85
84
|
},
|
|
86
|
-
onEditorVisualModeChanged(
|
|
87
|
-
|
|
85
|
+
onEditorVisualModeChanged(o) {
|
|
86
|
+
e.editorVisualMode = o.toLowerCase();
|
|
88
87
|
},
|
|
89
|
-
onVersionHistoryVisibilityChanged(
|
|
90
|
-
|
|
88
|
+
onVersionHistoryVisibilityChanged(o) {
|
|
89
|
+
e.isVersionHistoryOpen = o;
|
|
91
90
|
},
|
|
92
91
|
onDataChanged() {
|
|
93
|
-
|
|
92
|
+
e.hasChanges = !0;
|
|
94
93
|
},
|
|
95
94
|
onEvent: F,
|
|
96
|
-
notifications: V(),
|
|
97
95
|
ignoreClickOutsideSelectors: [
|
|
98
96
|
"#guido-dynamic-content-modal",
|
|
99
97
|
".in-on-board-wrapper",
|
|
100
98
|
".in-drawer__container"
|
|
101
99
|
],
|
|
102
100
|
extensions: d,
|
|
103
|
-
localePatch:
|
|
101
|
+
localePatch: z
|
|
104
102
|
}
|
|
105
103
|
);
|
|
106
|
-
},
|
|
104
|
+
}, _ = (s) => new Promise((r, i) => {
|
|
107
105
|
var d;
|
|
108
106
|
if (document.getElementById("UiEditorScript")) {
|
|
109
|
-
Promise.resolve(s()).then(
|
|
107
|
+
Promise.resolve(s()).then(r, i);
|
|
110
108
|
return;
|
|
111
109
|
}
|
|
112
|
-
const
|
|
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");
|
|
113
111
|
t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
|
|
114
|
-
Promise.resolve(s()).then(
|
|
112
|
+
Promise.resolve(s()).then(r, i);
|
|
115
113
|
}, t.onerror = () => {
|
|
116
|
-
|
|
114
|
+
i(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
117
115
|
}, document.body.appendChild(t);
|
|
118
116
|
});
|
|
119
117
|
return { initPlugin: async (s) => {
|
|
120
|
-
const
|
|
118
|
+
const r = C();
|
|
121
119
|
try {
|
|
122
|
-
await
|
|
123
|
-
const [
|
|
120
|
+
await _(async () => {
|
|
121
|
+
const [i, e] = await Promise.all([
|
|
124
122
|
k(),
|
|
125
123
|
B()
|
|
126
124
|
]);
|
|
127
|
-
|
|
125
|
+
r.syncModulesEnabled = e, await V(s, i, e);
|
|
128
126
|
});
|
|
129
127
|
} catch {
|
|
130
|
-
|
|
131
|
-
type:
|
|
128
|
+
r.loadingStatus = !1, b({
|
|
129
|
+
type: L.Alert,
|
|
132
130
|
message: h["An error has occurred. Please report the error code to support."],
|
|
133
131
|
actionButton: {
|
|
134
132
|
text: h["Reload page"],
|
|
@@ -139,5 +137,5 @@ const fo = (C, l) => {
|
|
|
139
137
|
} };
|
|
140
138
|
};
|
|
141
139
|
export {
|
|
142
|
-
|
|
140
|
+
ce as useStripo
|
|
143
141
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { ToasterTypeOptions as T } from "../enums/toaster.js";
|
|
2
2
|
import { useToasterStore as c } from "../stores/toaster.js";
|
|
3
|
-
import { watch as u, nextTick as
|
|
3
|
+
import { watch as u, nextTick as l } from "vue";
|
|
4
4
|
const p = () => {
|
|
5
|
-
const
|
|
6
|
-
let
|
|
5
|
+
const t = c();
|
|
6
|
+
let o = null;
|
|
7
7
|
const s = () => {
|
|
8
|
-
|
|
8
|
+
o && (clearTimeout(o), o = null);
|
|
9
9
|
};
|
|
10
10
|
function r(e = { message: "" }) {
|
|
11
|
-
s(),
|
|
12
|
-
|
|
11
|
+
s(), t.hideToaster(), l(() => {
|
|
12
|
+
t.showToaster(e);
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
function i() {
|
|
16
|
-
s(),
|
|
16
|
+
s(), t.hideToaster();
|
|
17
17
|
}
|
|
18
18
|
function n(e, a) {
|
|
19
19
|
const m = e instanceof Error ? e.message : String(e);
|
|
20
|
-
r({ type: T.
|
|
20
|
+
r({ type: T.Alert, message: `${a}: ${m}` });
|
|
21
21
|
}
|
|
22
22
|
return u(
|
|
23
|
-
() =>
|
|
23
|
+
() => t.shouldAutoHide,
|
|
24
24
|
(e) => {
|
|
25
|
-
s(), e && (
|
|
26
|
-
|
|
25
|
+
s(), e && (o = setTimeout(() => {
|
|
26
|
+
t.hideToaster(), s();
|
|
27
27
|
}, 6e3));
|
|
28
28
|
}
|
|
29
29
|
), { showToaster: r, hideToaster: i, handleError: n };
|
|
@@ -24,7 +24,7 @@ const S = () => {
|
|
|
24
24
|
window.StripoEditorApi.versionHistoryApi.previewVersion(e, (o) => {
|
|
25
25
|
const r = o instanceof Error ? o.message : String(o);
|
|
26
26
|
s({
|
|
27
|
-
type: t.
|
|
27
|
+
type: t.Alert,
|
|
28
28
|
message: `Error compiling email: ${r}`
|
|
29
29
|
});
|
|
30
30
|
});
|
|
@@ -41,7 +41,7 @@ const S = () => {
|
|
|
41
41
|
(o) => {
|
|
42
42
|
const r = o instanceof Error ? o.message : String(o);
|
|
43
43
|
s({
|
|
44
|
-
type: t.
|
|
44
|
+
type: t.Alert,
|
|
45
45
|
message: `Error compiling email: ${r}`
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ToasterTypeOptions as i } from "../../enums/toaster.js";
|
|
2
2
|
import { PAGE_TYPES as u } from "../../enums/unsubscribe.js";
|
|
3
3
|
import { UNSUBSCRIBE_BLOCK_SELECTOR as l, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { useTranslations as
|
|
4
|
+
import { useToaster as m } from "../useToaster.js";
|
|
5
|
+
import { useTranslations as E } from "../useTranslations.js";
|
|
6
6
|
const T = [
|
|
7
7
|
{
|
|
8
8
|
pageType: u.GLOBAL_UNSUBSCRIBE,
|
|
@@ -13,23 +13,23 @@ const T = [
|
|
|
13
13
|
messageKey: "unsubscription-preference.duplicate-pref-center"
|
|
14
14
|
}
|
|
15
15
|
], g = "unsubscription-preference.duplicate-both", b = "unsubscription-preference.select-page-to-continue", P = () => {
|
|
16
|
-
const { showToaster: c } =
|
|
16
|
+
const { showToaster: c } = m(), p = E();
|
|
17
17
|
return { validateUnsubscribeBlockUniqueness: (n) => {
|
|
18
|
-
const o = new DOMParser().parseFromString(n, "text/html"),
|
|
18
|
+
const o = new DOMParser().parseFromString(n, "text/html"), s = /* @__PURE__ */ new Map();
|
|
19
19
|
o.querySelectorAll(l).forEach((e) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
const r = Number(e.getAttribute(a.PAGE_TYPE));
|
|
21
|
+
s.set(r, (s.get(r) ?? 0) + 1);
|
|
22
22
|
});
|
|
23
|
-
const t = T.filter((e) => (
|
|
23
|
+
const t = T.filter((e) => (s.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
|
|
24
24
|
return t.length ? (c({
|
|
25
|
-
type: i.
|
|
25
|
+
type: i.Alert,
|
|
26
26
|
message: p(t.length > 1 ? g : t[0])
|
|
27
27
|
}), !1) : !0;
|
|
28
28
|
}, validateUnsubscribeBlockHasTemplate: (n) => {
|
|
29
29
|
const o = new DOMParser().parseFromString(n, "text/html");
|
|
30
30
|
return Array.from(o.querySelectorAll(l)).some((t) => {
|
|
31
|
-
const e = t.getAttribute(a.PAGE_TYPE),
|
|
32
|
-
return !e || !
|
|
31
|
+
const e = t.getAttribute(a.PAGE_TYPE), r = t.getAttribute(a.PAGE_LIST);
|
|
32
|
+
return !e || !r;
|
|
33
33
|
}) ? (c({
|
|
34
34
|
type: i.Warning,
|
|
35
35
|
message: p(b)
|
package/dist/enums/toaster.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r.Dark = "dark", r))(c || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
c as ToasterTypeOptions
|
|
4
4
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useToaster as
|
|
1
|
+
import { useToaster as r } from "../../../composables/useToaster.js";
|
|
2
2
|
import { useTranslations as s } from "../../../composables/useTranslations.js";
|
|
3
|
-
import { ToasterTypeOptions as
|
|
3
|
+
import { ToasterTypeOptions as n } from "../../../enums/toaster.js";
|
|
4
4
|
import { countLiveRecommendationBlocks as i } from "./utils/recommendationBlockCount.js";
|
|
5
|
-
const
|
|
6
|
-
const { showToaster: o } =
|
|
5
|
+
const a = "newsletter.multiple-reco-blocks-warning", f = () => {
|
|
6
|
+
const { showToaster: o } = r(), t = s();
|
|
7
7
|
return { warnIfMultipleBlocks: (e) => {
|
|
8
8
|
i(e) > 1 && o({
|
|
9
|
-
type:
|
|
10
|
-
message: t(
|
|
9
|
+
type: n.Dark,
|
|
10
|
+
message: t(a)
|
|
11
11
|
});
|
|
12
12
|
} };
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
f as useRecommendationBlockWarning
|
|
16
16
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -26,7 +26,7 @@ const u = (e) => new Promise((t) => {
|
|
|
26
26
|
} catch (o) {
|
|
27
27
|
console.error(`Failed to fetch blank template (attempt ${r}/${a}):`, o), r < a && await u(r * f);
|
|
28
28
|
}
|
|
29
|
-
return e({ type: p.
|
|
29
|
+
return e({ type: p.Alert, message: t("errors-pages.undefined-response") }), { html: "", css: "" };
|
|
30
30
|
} };
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
@@ -4,12 +4,11 @@ import { useToaster as C } from "../composables/useToaster.js";
|
|
|
4
4
|
import { useTranslations as h } from "../composables/useTranslations.js";
|
|
5
5
|
import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
|
|
6
6
|
import { EditorType as v } from "../enums/defaults.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useSaveAsTemplateStore as E } from "../stores/save-as-template.js";
|
|
7
|
+
import { useRecommendationExtensionStore as N } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
+
import { useSaveAsTemplateStore as x } from "../stores/save-as-template.js";
|
|
10
9
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
11
10
|
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
12
|
-
const
|
|
11
|
+
const $ = () => {
|
|
13
12
|
const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
|
|
14
13
|
return {
|
|
15
14
|
getCategories: async () => {
|
|
@@ -40,7 +39,7 @@ const j = () => {
|
|
|
40
39
|
createTemplate: async () => {
|
|
41
40
|
var e, t, d, y;
|
|
42
41
|
try {
|
|
43
|
-
const { prepareTemplateDetails: i } = A(), s =
|
|
42
|
+
const { prepareTemplateDetails: i } = A(), s = x(), a = await i();
|
|
44
43
|
if (p("liquidSyntax") && !await g(a.compiledHtml))
|
|
45
44
|
return !1;
|
|
46
45
|
const f = {
|
|
@@ -54,7 +53,7 @@ const j = () => {
|
|
|
54
53
|
unsubscriptionPreferencePageStatus: !1,
|
|
55
54
|
unsubscriptionPreferencePages: [],
|
|
56
55
|
recommendationCampaignUrls: r(
|
|
57
|
-
|
|
56
|
+
N().recommendationCampaignUrls
|
|
58
57
|
),
|
|
59
58
|
recommendationConfigs: r({}),
|
|
60
59
|
isGuido: !0,
|
|
@@ -75,7 +74,7 @@ const j = () => {
|
|
|
75
74
|
"newsletter.template-library-save-alert",
|
|
76
75
|
{ templateName: s.getTemplateName }
|
|
77
76
|
),
|
|
78
|
-
type:
|
|
77
|
+
type: "alert"
|
|
79
78
|
}), !1) : (l({
|
|
80
79
|
message: u(
|
|
81
80
|
"newsletter.template-library-save-success",
|
|
@@ -90,5 +89,5 @@ const j = () => {
|
|
|
90
89
|
};
|
|
91
90
|
};
|
|
92
91
|
export {
|
|
93
|
-
|
|
92
|
+
$ as useTemplateLibraryApi
|
|
94
93
|
};
|
|
@@ -4,14 +4,15 @@ export declare const useToasterStore: import("pinia").StoreDefinition<"guidoToas
|
|
|
4
4
|
status: boolean;
|
|
5
5
|
type: import("@@/Types/toaster").ToasterType;
|
|
6
6
|
text: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
withIcon: boolean;
|
|
7
9
|
withoutLeftMargin: boolean;
|
|
8
|
-
autoHide: boolean;
|
|
9
10
|
actionButton?: {
|
|
10
11
|
text: string;
|
|
11
12
|
onClick: () => void;
|
|
12
13
|
} | undefined;
|
|
13
14
|
} & import("pinia").PiniaCustomStateProperties<ToasterState>) => boolean;
|
|
14
15
|
}, {
|
|
15
|
-
showToaster(this: ToasterState, { type, message, actionButton
|
|
16
|
+
showToaster(this: ToasterState, { type, message, actionButton }: ToasterOptions): void;
|
|
16
17
|
hideToaster(this: ToasterState): void;
|
|
17
18
|
}>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const n = `ue-notifications-container {
|
|
2
|
+
left: 96px;
|
|
3
|
+
margin: 0;
|
|
4
|
+
bottom: 32px;
|
|
5
|
+
top: unset;
|
|
6
|
+
width: unset;
|
|
7
|
+
position: fixed;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
ue-notifications-container ue-message + ue-message {
|
|
11
|
+
margin-bottom: 24px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
ue-notifications-container .alert-message-wrapper {
|
|
15
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07);
|
|
16
|
+
border: none;
|
|
17
|
+
padding: 16px 24px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
ue-notifications-container .alert-message-wrapper.info,
|
|
21
|
+
ue-notifications-container .alert-message-wrapper.loader {
|
|
22
|
+
background-color: var(--guido-color-background-toaster-info) !important;
|
|
23
|
+
color: inherit;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.alert-message-wrapper .alert-message-main {
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ue-notifications-container ue-caption .caption {
|
|
31
|
+
color: var(--guido-color-white) !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ue-block-thumb-hint {
|
|
35
|
+
text-align: left;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-content {
|
|
39
|
+
width: calc(100% - 64px);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-text {
|
|
43
|
+
font-size: 15px;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
ue-notifications-container .alert-message-text,
|
|
48
|
+
ue-notifications-container .alert-message-wrapper ue-icon-component.icon,
|
|
49
|
+
ue-notifications-container .alert-message-wrapper ue-icon-component.icon-button {
|
|
50
|
+
color: var(--guido-color-white);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
ue-notifications-container ue-message ue-button.close {
|
|
54
|
+
margin: 0 0 0 16px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ue-notifications-container .alert-message-wrapper.success {
|
|
58
|
+
background: var(--guido-color-background-toaster-success);
|
|
59
|
+
color: inherit;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ue-notifications-container .alert-message-wrapper.error {
|
|
63
|
+
background: var(--guido-color-background-toaster-error);
|
|
64
|
+
color: inherit;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
ue-notifications-container .alert-message-wrapper.warn {
|
|
68
|
+
background: var(--guido-color-background-toaster-warn);
|
|
69
|
+
color: inherit;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
export {
|
|
73
|
+
n as default
|
|
74
|
+
};
|
package/dist/stores/toaster.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ToasterTypeOptions as e } from "../enums/toaster.js";
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
2
|
+
import { defineStore as i } from "pinia";
|
|
3
|
+
const a = () => ({
|
|
4
4
|
status: !1,
|
|
5
5
|
type: e.Success,
|
|
6
6
|
text: "",
|
|
7
|
+
icon: "",
|
|
8
|
+
withIcon: !0,
|
|
7
9
|
withoutLeftMargin: !1,
|
|
8
|
-
autoHide: !0,
|
|
9
10
|
actionButton: void 0
|
|
10
|
-
}),
|
|
11
|
-
state: () =>
|
|
11
|
+
}), n = i("guidoToaster", {
|
|
12
|
+
state: () => a(),
|
|
12
13
|
getters: {
|
|
13
|
-
|
|
14
|
-
shouldAutoHide: (t) => t.status && !!t.text && t.autoHide
|
|
14
|
+
shouldAutoHide: (t) => t.status && !!t.text
|
|
15
15
|
},
|
|
16
16
|
actions: {
|
|
17
|
-
showToaster({ type: t = e.Success, message: s, actionButton: o
|
|
18
|
-
this.status = !0, this.text = s, this.type = t, this.actionButton = o
|
|
17
|
+
showToaster({ type: t = e.Success, message: s, actionButton: o }) {
|
|
18
|
+
this.status = !0, this.text = s, this.type = t, this.actionButton = o;
|
|
19
19
|
},
|
|
20
20
|
hideToaster() {
|
|
21
21
|
this.status = !1;
|
|
@@ -23,5 +23,5 @@ const u = () => ({
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
n as useToasterStore
|
|
27
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.10.0-beta.
|
|
3
|
+
"version": "3.10.0-beta.cbd47be",
|
|
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",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@stripoinc/ui-editor-extensions": "3.8.0",
|
|
40
|
-
"@useinsider/design-system-vue": "1.
|
|
40
|
+
"@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
|
|
41
41
|
"@vueuse/core": "11.3.0",
|
|
42
42
|
"lodash-es": "4.17.21",
|
|
43
43
|
"pinia": "2.3.1",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
},
|
|
105
105
|
"guido": {
|
|
106
106
|
"stripo": {
|
|
107
|
-
"version": "2.
|
|
107
|
+
"version": "2.69.1"
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useToaster as d } from "./useToaster.js";
|
|
2
|
-
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
3
|
-
const g = () => {
|
|
4
|
-
const { showToaster: s, hideToaster: u } = d();
|
|
5
|
-
let r = null;
|
|
6
|
-
const n = (o, t, i, e, f = !0) => {
|
|
7
|
-
r = i;
|
|
8
|
-
const l = e != null && e.action ? { text: e.action.label, onClick: e.action.func } : void 0;
|
|
9
|
-
s({ type: o, message: t, actionButton: l, autoHide: (e == null ? void 0 : e.autoClose) ?? f });
|
|
10
|
-
};
|
|
11
|
-
return { getStripoNotifications: () => ({
|
|
12
|
-
info: (o, t, i) => n(c.Info, o, t, i),
|
|
13
|
-
success: (o, t, i) => n(c.Success, o, t, i),
|
|
14
|
-
warn: (o, t, i) => n(c.Warning, o, t, i),
|
|
15
|
-
error: (o, t, i) => n(c.Error, o, t, i),
|
|
16
|
-
// A loader marks an in-progress operation; Stripo dismisses it via hide(id)
|
|
17
|
-
// when finished, so it must not auto-hide.
|
|
18
|
-
loader: (o, t, i) => n(c.Info, o, t, i, !1),
|
|
19
|
-
hide: (o) => {
|
|
20
|
-
r === o && (u(), r = null);
|
|
21
|
-
}
|
|
22
|
-
}) };
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
g as useStripoNotifications
|
|
26
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StripoNotifications } from '@@/Types/stripo';
|
|
2
|
-
/**
|
|
3
|
-
* Adapter that routes Stripo's in-editor notifications through Guido's own
|
|
4
|
-
* InToasts-based toaster, so the editor only ever shows one toaster style.
|
|
5
|
-
* Passed to `initEditor` as the `notifications` config (Stripo then delegates
|
|
6
|
-
* rendering to us instead of drawing its native <ue-notifications-container>).
|
|
7
|
-
*/
|
|
8
|
-
export declare const useStripoNotifications: () => {
|
|
9
|
-
getStripoNotifications: () => StripoNotifications;
|
|
10
|
-
};
|