@useinsider/guido 3.3.0-beta.c1e1d7e → 3.3.0-beta.ddabd14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +103 -89
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
- package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
- package/dist/composables/useCortexBlueprintBridge.js +66 -0
- package/dist/composables/useCustomInterfaceAppearance.js +18 -16
- package/dist/composables/useEmailTemplateApplier.js +41 -0
- package/dist/composables/useGuidoStateBridge.js +48 -0
- package/dist/composables/useHtmlValidator.js +41 -36
- package/dist/composables/useRecommendation.js +2 -2
- package/dist/composables/useStripo.js +56 -54
- package/dist/config/migrator/index.js +21 -10
- package/dist/config/migrator/radioButtonMigrator.js +73 -48
- package/dist/enums/extensions/recommendationBlock.js +101 -46
- package/dist/enums/unsubscribe.js +25 -24
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/RadioButton/template.js +6 -6
- package/dist/extensions/Blocks/Recommendation/block.js +43 -36
- package/dist/extensions/Blocks/Recommendation/services/configService.js +33 -26
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +35 -26
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +25 -12
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
- package/dist/guido.css +1 -1
- package/dist/services/unsubscribeApi.js +6 -6
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +25 -0
- package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
- package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
- package/dist/src/enums/unsubscribe.d.ts +8 -3
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +11 -3
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
- package/dist/src/stores/guido-email-editor.d.ts +41 -0
- package/dist/static/styles/components/notification.css.js +74 -0
- package/dist/stores/guido-email-editor.js +20 -0
- package/dist/utils/templatePreparation.js +57 -50
- package/package.json +1 -1
- package/dist/composables/useStripoNotifications.js +0 -30
- package/dist/src/composables/useStripoNotifications.d.ts +0 -4
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useActionsApi as u } from "./useActionsApi.js";
|
|
2
|
+
import { useToaster as T } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as f } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as n } from "../enums/toaster.js";
|
|
5
|
+
import { ref as y } from "vue";
|
|
6
|
+
const h = 250, s = y({}), o = {}, j = () => {
|
|
7
|
+
const { updateHtmlAndCss: l } = u(), { showToaster: r } = T(), i = f(), c = (e, t, p) => {
|
|
8
|
+
s.value = { ...s.value, [e]: "applying" };
|
|
9
|
+
try {
|
|
10
|
+
l(t, p), s.value = { ...s.value, [e]: "applied" }, r({
|
|
11
|
+
type: n.Success,
|
|
12
|
+
message: i("newsletter.ai-template-applied")
|
|
13
|
+
});
|
|
14
|
+
} catch (a) {
|
|
15
|
+
s.value = { ...s.value, [e]: "failed" }, r({
|
|
16
|
+
type: n.Alert,
|
|
17
|
+
message: a instanceof Error ? a.message : "Failed to apply template"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}, m = (e) => {
|
|
21
|
+
const t = o[e];
|
|
22
|
+
t && (clearTimeout(t), delete o[e]);
|
|
23
|
+
};
|
|
24
|
+
return { applyStatus: s, applyTemplate: (e, t) => {
|
|
25
|
+
t.html && (m(e), c(e, t.html, t.css ?? ""));
|
|
26
|
+
}, applyTemplateDebounced: (e, t) => {
|
|
27
|
+
if (!t.html)
|
|
28
|
+
return;
|
|
29
|
+
m(e);
|
|
30
|
+
const { html: p } = t, a = t.css ?? "";
|
|
31
|
+
o[e] = setTimeout(() => {
|
|
32
|
+
delete o[e], c(e, p, a);
|
|
33
|
+
}, h);
|
|
34
|
+
} };
|
|
35
|
+
}, w = () => {
|
|
36
|
+
Object.values(o).forEach(clearTimeout), Object.keys(o).forEach((l) => delete o[l]), s.value = {};
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
w as resetEmailTemplateApplier,
|
|
40
|
+
j as useEmailTemplateApplier
|
|
41
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useActionsApi as g } from "./useActionsApi.js";
|
|
2
|
+
import { useConfigStore as I } from "../stores/config.js";
|
|
3
|
+
import { useEditorStore as b } from "../stores/editor.js";
|
|
4
|
+
import { useGuidoEmailEditorStore as E } from "../stores/guido-email-editor.js";
|
|
5
|
+
import { watch as c, onUnmounted as T } from "vue";
|
|
6
|
+
const w = 500, z = () => {
|
|
7
|
+
const i = b(), a = E(), l = I(), { getTemplateData: m } = g();
|
|
8
|
+
let e = null, n = !1;
|
|
9
|
+
const r = () => {
|
|
10
|
+
e && (clearTimeout(e), e = null);
|
|
11
|
+
}, s = async () => {
|
|
12
|
+
var t, o;
|
|
13
|
+
if (!(n || !i.isStripoInitialized))
|
|
14
|
+
try {
|
|
15
|
+
const { html: f, css: h } = await m(), S = ((o = (t = l.config) == null ? void 0 : t.identity) == null ? void 0 : o.templateId) ?? "";
|
|
16
|
+
if (n)
|
|
17
|
+
return;
|
|
18
|
+
a.$patch({
|
|
19
|
+
html: f ?? "",
|
|
20
|
+
css: h ?? "",
|
|
21
|
+
templateId: S,
|
|
22
|
+
lastUpdatedAt: Date.now()
|
|
23
|
+
});
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}, u = () => {
|
|
27
|
+
r(), e = setTimeout(() => {
|
|
28
|
+
e = null, s();
|
|
29
|
+
}, w);
|
|
30
|
+
}, d = c(
|
|
31
|
+
() => i.isStripoInitialized,
|
|
32
|
+
(t) => {
|
|
33
|
+
t && s();
|
|
34
|
+
},
|
|
35
|
+
{ immediate: !0 }
|
|
36
|
+
), p = c(
|
|
37
|
+
() => i.hasChanges,
|
|
38
|
+
(t, o) => {
|
|
39
|
+
i.isStripoInitialized && (t ? u() : o && (r(), s()));
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
T(() => {
|
|
43
|
+
n = !0, r(), d(), p();
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
z as useGuidoStateBridge
|
|
48
|
+
};
|
|
@@ -1,35 +1,37 @@
|
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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]);
|
|
14
16
|
}
|
|
15
|
-
function
|
|
17
|
+
function ee(a, u) {
|
|
16
18
|
return u.some((d) => a.startsWith(`${d}_`));
|
|
17
19
|
}
|
|
18
|
-
const
|
|
20
|
+
const ge = () => {
|
|
19
21
|
var y, h;
|
|
20
|
-
const { showToaster: a } =
|
|
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) => {
|
|
21
23
|
const t = await u(
|
|
22
24
|
"/newsletter/template-library/check-template-html-body",
|
|
23
|
-
{ html:
|
|
25
|
+
{ html: z(e) }
|
|
24
26
|
), { status: n, message: l } = t.data;
|
|
25
27
|
return n || a({
|
|
26
28
|
type: c.Alert,
|
|
27
29
|
message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
|
|
28
|
-
}), r(
|
|
30
|
+
}), r(M), l === r($) && a({
|
|
29
31
|
type: c.Alert,
|
|
30
32
|
message: r("newsletter.already-in-progress")
|
|
31
33
|
}), n;
|
|
32
|
-
}, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()),
|
|
34
|
+
}, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
|
|
33
35
|
const t = e.match(/({%(.*?)%})/g);
|
|
34
36
|
let n = !0;
|
|
35
37
|
return t !== null && !p && t.forEach((l) => {
|
|
@@ -42,13 +44,13 @@ const ce = () => {
|
|
|
42
44
|
}), n = !1);
|
|
43
45
|
}
|
|
44
46
|
}), n;
|
|
45
|
-
},
|
|
47
|
+
}, k = async (e, s, t) => {
|
|
46
48
|
const n = t ? await b(e) : !0;
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
+
return A(e, s) && n;
|
|
50
|
+
}, x = (e) => e.length > 0 ? !0 : (a({
|
|
49
51
|
type: c.Warning,
|
|
50
52
|
message: r("newsletter.html-content-is-empty")
|
|
51
|
-
}), !1),
|
|
53
|
+
}), !1), I = (e) => {
|
|
52
54
|
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
53
55
|
return s > t && a({
|
|
54
56
|
type: c.Warning,
|
|
@@ -57,7 +59,7 @@ const ce = () => {
|
|
|
57
59
|
type: c.Warning,
|
|
58
60
|
message: r("custom-fields.missing-opening-braces")
|
|
59
61
|
}), s === t;
|
|
60
|
-
},
|
|
62
|
+
}, F = (e) => {
|
|
61
63
|
const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
62
64
|
return s || a({
|
|
63
65
|
type: c.Warning,
|
|
@@ -66,10 +68,10 @@ const ce = () => {
|
|
|
66
68
|
}, T = (e, s) => {
|
|
67
69
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
68
70
|
if (t && !p) {
|
|
69
|
-
const n = new Set(s.map((i) => i.toLowerCase())), l =
|
|
71
|
+
const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
|
|
70
72
|
if (t.forEach((i) => {
|
|
71
73
|
const m = i.slice(2, -2).trim().toLowerCase();
|
|
72
|
-
(!n.has(m) || m === "") && !
|
|
74
|
+
(!n.has(m) || m === "") && !ee(m, l) && o.push(m);
|
|
73
75
|
}), o.length > 0) {
|
|
74
76
|
const i = `
|
|
75
77
|
<ul>
|
|
@@ -83,11 +85,11 @@ const ce = () => {
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
return !0;
|
|
86
|
-
},
|
|
88
|
+
}, R = (e) => {
|
|
87
89
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
88
90
|
let n = !0;
|
|
89
91
|
if (s && s.forEach((l) => {
|
|
90
|
-
const o = l.match(
|
|
92
|
+
const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
|
|
91
93
|
(!o || l !== m) && !i && (a({
|
|
92
94
|
type: c.Alert,
|
|
93
95
|
message: r("newsletter.display-conditions-invalid-syntax")
|
|
@@ -98,7 +100,7 @@ const ce = () => {
|
|
|
98
100
|
}), n = !1);
|
|
99
101
|
const v = f.match(/^[a-zA-Z]*$/g);
|
|
100
102
|
v && v.forEach((C) => {
|
|
101
|
-
|
|
103
|
+
E(C) && t.push(C);
|
|
102
104
|
});
|
|
103
105
|
});
|
|
104
106
|
}), t.length) {
|
|
@@ -109,25 +111,28 @@ const ce = () => {
|
|
|
109
111
|
}), n = !1);
|
|
110
112
|
}
|
|
111
113
|
return n;
|
|
112
|
-
},
|
|
114
|
+
}, B = (e) => {
|
|
113
115
|
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
114
116
|
return n || a({
|
|
115
117
|
type: c.Warning,
|
|
116
118
|
message: r("custom-conditions.no-space-after-braces")
|
|
117
119
|
}), n;
|
|
118
|
-
},
|
|
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({
|
|
119
121
|
type: c.Warning,
|
|
120
122
|
message: r("custom-conditions.no-braces-inside-if-tag")
|
|
123
|
+
}), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
|
|
124
|
+
type: c.Alert,
|
|
125
|
+
message: r(j)
|
|
121
126
|
}), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
|
|
122
127
|
type: c.Alert,
|
|
123
128
|
message: r("newsletter.fill-all-necessary-fields")
|
|
124
|
-
}), !1) : !0,
|
|
129
|
+
}), !1) : !0, D = (e) => {
|
|
125
130
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
126
131
|
return e.match(s) === null ? !0 : (a({
|
|
127
132
|
type: c.Alert,
|
|
128
133
|
message: r("newsletter.invalid-image-type")
|
|
129
134
|
}), !1);
|
|
130
|
-
},
|
|
135
|
+
}, L = (e) => {
|
|
131
136
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
132
137
|
return Array.from(n).find((o) => {
|
|
133
138
|
var i;
|
|
@@ -136,7 +141,7 @@ const ce = () => {
|
|
|
136
141
|
type: c.Alert,
|
|
137
142
|
message: r("unsubscribe-templates.select-checkbox-groups")
|
|
138
143
|
}), !1) : !0;
|
|
139
|
-
},
|
|
144
|
+
}, V = (e) => {
|
|
140
145
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
141
146
|
return Array.from(n).find((o) => {
|
|
142
147
|
var i;
|
|
@@ -150,12 +155,12 @@ const ce = () => {
|
|
|
150
155
|
var o, i;
|
|
151
156
|
const n = [
|
|
152
157
|
...s.map((m) => m.value),
|
|
153
|
-
...
|
|
158
|
+
...q,
|
|
154
159
|
...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
|
|
155
160
|
];
|
|
156
|
-
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);
|
|
157
162
|
} };
|
|
158
163
|
};
|
|
159
164
|
export {
|
|
160
|
-
|
|
165
|
+
ge as useHtmlValidator
|
|
161
166
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getRecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
3
|
import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
@@ -63,7 +63,7 @@ const w = () => ({
|
|
|
63
63
|
shuffleProducts: o.shuffleProducts
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
const f = ((l = I.find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
|
|
66
|
+
const f = ((l = I().find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
|
|
67
67
|
if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising") {
|
|
68
68
|
const i = parseInt(e.size) || 6;
|
|
69
69
|
t.set("productId", e.productIds.slice(0, i).join(","));
|
|
@@ -1,80 +1,83 @@
|
|
|
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 {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { useActionsApi as P } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as U } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as R } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as q } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as x } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useStripoEventHandler as H } from "./useStripoEventHandler.js";
|
|
7
|
+
import { useToaster as O } from "./useToaster.js";
|
|
8
|
+
import { localePatch as j } from "../config/i18n/index.js";
|
|
9
|
+
import { useStripoApi as L } from "../services/stripoApi.js";
|
|
10
|
+
import $ from "../static/styles/customEditorStyle.css.js";
|
|
11
|
+
import { useEditorStore as b } from "../stores/editor.js";
|
|
12
|
+
import { dynamicContentToMergeTags as z } from "../utils/genericUtil.js";
|
|
13
|
+
import G from "../package.json.js";
|
|
14
|
+
const nt = (w, m) => {
|
|
15
|
+
const { features: p, template: k, isFeatureEnabled: g } = R(), { handleError: f } = O(), { getToken: B, getCustomFonts: T, getSyncModulesStatus: V } = L(), { handleEvent: _ } = H(), { getStripoBlocksConfig: v } = U(), F = async (i, s = [], n = !1) => {
|
|
16
|
+
var E, h, C;
|
|
17
|
+
const t = b(), { html: u, css: a } = i, { baseBlocks: o, extensions: d } = await v(), S = ((E = p.value) == null ? void 0 : E.displayConditions) ?? !0, A = ((h = p.value) == null ? void 0 : h.modulesDisabled) ?? !1, y = ((C = k.value) == null ? void 0 : C.forceRecreate) ?? !1, D = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com", I = (u.match(/<td[^>]*radio-button-v2[^>]*>/gi) ?? []).map((e) => {
|
|
18
|
+
var l;
|
|
19
|
+
const c = (((l = e.match(/class="([^"]*)"/)) == null ? void 0 : l[1]) ?? "").split(/\s+/).filter(Boolean);
|
|
20
|
+
return { hasBlock: c.includes("radio-button-block"), classes: c };
|
|
21
|
+
});
|
|
22
|
+
console.debug("[guido:radio-migrator] stripo:before-init", { forceRecreate: y, radioTds: I }), window.UIEditor.initEditor(
|
|
20
23
|
document.querySelector("#guido-editor"),
|
|
21
24
|
{
|
|
22
|
-
metadata:
|
|
23
|
-
html:
|
|
25
|
+
metadata: w,
|
|
26
|
+
html: u,
|
|
24
27
|
css: a,
|
|
25
|
-
forceRecreate:
|
|
28
|
+
forceRecreate: y,
|
|
26
29
|
locale: "en",
|
|
27
30
|
undoButtonSelector: "#guido__undo-button",
|
|
28
31
|
redoButtonSelector: "#guido__redo-button",
|
|
29
32
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
30
33
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
31
34
|
codeEditorButtonSelector: "#guido__code-button",
|
|
32
|
-
customAppearanceMergetags: !
|
|
35
|
+
customAppearanceMergetags: !g("liquidSyntax"),
|
|
33
36
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
34
37
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
35
|
-
customViewStyles:
|
|
36
|
-
conditionsEnabled:
|
|
37
|
-
customConditionsEnabled:
|
|
38
|
+
customViewStyles: $,
|
|
39
|
+
conditionsEnabled: S,
|
|
40
|
+
customConditionsEnabled: S,
|
|
38
41
|
enableXSSSecurity: !0,
|
|
39
|
-
modulesDisabled:
|
|
40
|
-
syncModulesEnabled:
|
|
42
|
+
modulesDisabled: A,
|
|
43
|
+
syncModulesEnabled: n,
|
|
41
44
|
messageSettingsEnabled: !0,
|
|
42
45
|
displayGmailAnnotations: !0,
|
|
43
46
|
displayHiddenPreheader: !1,
|
|
44
47
|
displayTitle: !1,
|
|
45
48
|
displayUTM: !1,
|
|
46
49
|
selectElementAfterDrop: !0,
|
|
47
|
-
allowedScriptSourceDomains:
|
|
50
|
+
allowedScriptSourceDomains: D,
|
|
48
51
|
...o ? { baseBlocks: o } : {},
|
|
49
52
|
editorFonts: {
|
|
50
53
|
showDefaultStandardFonts: !0,
|
|
51
54
|
showDefaultNotStandardFonts: !0,
|
|
52
|
-
customFonts:
|
|
55
|
+
customFonts: s
|
|
53
56
|
},
|
|
54
57
|
mergeTags: [
|
|
55
58
|
{
|
|
56
|
-
entries:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
entries: z(
|
|
60
|
+
m.preselectedDynamicContentList,
|
|
61
|
+
g("liquidSyntax")
|
|
59
62
|
)
|
|
60
63
|
}
|
|
61
64
|
],
|
|
62
65
|
async onTokenRefreshRequest(e) {
|
|
63
66
|
try {
|
|
64
|
-
const
|
|
65
|
-
e(
|
|
66
|
-
} catch (
|
|
67
|
-
|
|
67
|
+
const r = await B();
|
|
68
|
+
e(r);
|
|
69
|
+
} catch (r) {
|
|
70
|
+
f(r, "Failed to refresh token");
|
|
68
71
|
}
|
|
69
72
|
},
|
|
70
73
|
onTemplateLoaded() {
|
|
71
74
|
try {
|
|
72
|
-
const { importCss: e } =
|
|
73
|
-
e(),
|
|
75
|
+
const { importCss: e } = q(), { activateCustomViewStyles: r, updateTimerInClonedTemplate: c } = P(), { injectFullStory: l } = x();
|
|
76
|
+
e(), r(), l(), c(), m.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
74
77
|
t.hasChanges = !1;
|
|
75
78
|
}, 1e3);
|
|
76
79
|
} catch (e) {
|
|
77
|
-
|
|
80
|
+
f(e, "Failed to load custom interface appearance");
|
|
78
81
|
}
|
|
79
82
|
},
|
|
80
83
|
onCodeEditorVisibilityChanged(e) {
|
|
@@ -89,40 +92,39 @@ const dt = (C, c) => {
|
|
|
89
92
|
onDataChanged() {
|
|
90
93
|
t.hasChanges = !0;
|
|
91
94
|
},
|
|
92
|
-
onEvent:
|
|
93
|
-
notifications: T(),
|
|
95
|
+
onEvent: _,
|
|
94
96
|
ignoreClickOutsideSelectors: [
|
|
95
97
|
"#guido-dynamic-content-modal",
|
|
96
98
|
".in-on-board-wrapper",
|
|
97
99
|
".in-drawer__container"
|
|
98
100
|
],
|
|
99
101
|
extensions: d,
|
|
100
|
-
localePatch:
|
|
102
|
+
localePatch: j
|
|
101
103
|
}
|
|
102
104
|
);
|
|
103
|
-
},
|
|
105
|
+
}, M = (i) => new Promise((s, n) => {
|
|
104
106
|
var d;
|
|
105
107
|
if (document.getElementById("UiEditorScript")) {
|
|
106
|
-
i(),
|
|
108
|
+
i(), s();
|
|
107
109
|
return;
|
|
108
110
|
}
|
|
109
|
-
const t =
|
|
111
|
+
const t = G.guido, a = `https://email-static.useinsider.com/guido/${(d = t == null ? void 0 : t.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
|
|
110
112
|
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
111
|
-
i(),
|
|
113
|
+
i(), s();
|
|
112
114
|
}, o.onerror = () => {
|
|
113
|
-
|
|
115
|
+
n(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
114
116
|
}, document.body.appendChild(o);
|
|
115
117
|
});
|
|
116
118
|
return { initPlugin: async (i) => {
|
|
117
|
-
await
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
await M(async () => {
|
|
120
|
+
const s = b(), [n, t] = await Promise.all([
|
|
121
|
+
T(),
|
|
122
|
+
V()
|
|
121
123
|
]);
|
|
122
|
-
|
|
124
|
+
s.syncModulesEnabled = t, await F(i, n, t);
|
|
123
125
|
});
|
|
124
126
|
} };
|
|
125
127
|
};
|
|
126
128
|
export {
|
|
127
|
-
|
|
129
|
+
nt as useStripo
|
|
128
130
|
};
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
2
|
-
import { migrateCouponBlock as
|
|
3
|
-
import { migrateItemsBlock as
|
|
4
|
-
import { migrateRadioButton as
|
|
5
|
-
import { migrateRecommendation as
|
|
6
|
-
import { migrateUnsubscribe as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { migrateCheckbox as m } from "./checkboxMigrator.js";
|
|
2
|
+
import { migrateCouponBlock as n } from "./couponBlockMigrator.js";
|
|
3
|
+
import { migrateItemsBlock as s } from "./itemsBlockMigrator.js";
|
|
4
|
+
import { migrateRadioButton as c } from "./radioButtonMigrator.js";
|
|
5
|
+
import { migrateRecommendation as d } from "./recommendationMigrator.js";
|
|
6
|
+
import { migrateUnsubscribe as g } from "./unsubscribeMigrator.js";
|
|
7
|
+
const a = (t) => (t.match(/<td[^>]*radio-button-v2[^>]*>/gi) ?? []).map((i) => {
|
|
8
|
+
var e;
|
|
9
|
+
const r = (((e = i.match(/class="([^"]*)"/)) == null ? void 0 : e[1]) ?? "").split(/\s+/).filter(Boolean);
|
|
10
|
+
return { hasBlock: r.includes("radio-button-block"), classes: r };
|
|
11
|
+
}), k = async (t, i = {}) => {
|
|
12
|
+
console.debug("[guido:radio-migrator] pipeline:start", {
|
|
13
|
+
inputLength: t.length,
|
|
14
|
+
radioTds: a(t)
|
|
15
|
+
});
|
|
16
|
+
let o = t;
|
|
17
|
+
return o = m(o), o = c(o), o = await g(o), o = n(o), o = d(o, i), o = s(o), console.debug("[guido:radio-migrator] pipeline:end", {
|
|
18
|
+
outputLength: o.length,
|
|
19
|
+
radioTds: a(o)
|
|
20
|
+
}), o;
|
|
10
21
|
};
|
|
11
22
|
export {
|
|
12
|
-
|
|
23
|
+
k as migrate
|
|
13
24
|
};
|