@useinsider/guido 3.2.0-beta.f2e037f → 3.2.0-beta.f679fe4
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/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
- package/dist/composables/useFullStoryBridge.js +14 -0
- package/dist/composables/useHtmlValidator.js +83 -118
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useStripo.js +47 -46
- package/dist/config/compiler/recommendationCompilerRules.js +72 -67
- package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +33 -30
- package/dist/config/migrator/recommendationMigrator.js +1 -1
- package/dist/enums/html-validator.js +2 -4
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
- package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +6 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +29 -25
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
- package/dist/package.json.js +1 -1
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/enums/html-validator.d.ts +0 -2
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/static/styles/components/button.css.js +16 -9
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/dist/stores/onboarding.js +4 -0
- package/package.json +3 -3
|
@@ -1,161 +1,126 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import {
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import { itemsBlockDynamicVariables as
|
|
6
|
-
import { useRecommendationStore as
|
|
7
|
-
import { base64EncodeWithSpecialChars as
|
|
8
|
-
import { useHttp as
|
|
9
|
-
import { useToaster as
|
|
10
|
-
import { useTranslations as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
return [...
|
|
1
|
+
import { useConfig as I } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as B } from "../enums/defaults.js";
|
|
3
|
+
import { CampaignCouldNotBeSavedKey as R, CanNotMakeAnyChangesForRunningKey as V } from "../enums/html-validator.js";
|
|
4
|
+
import { ToasterTypeOptions as l } from "../enums/toaster.js";
|
|
5
|
+
import { itemsBlockDynamicVariables as H } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
6
|
+
import { useRecommendationStore as W } from "../stores/recommendation.js";
|
|
7
|
+
import { base64EncodeWithSpecialChars as L } from "../utils/base64.js";
|
|
8
|
+
import { useHttp as N } from "./useHttp.js";
|
|
9
|
+
import { useToaster as O } from "./useToaster.js";
|
|
10
|
+
import { useTranslations as D } from "./useTranslations.js";
|
|
11
|
+
const M = /recommendation-id="(\d+)"/g;
|
|
12
|
+
function _(o) {
|
|
13
|
+
return [...o.matchAll(M)].map((u) => u[1]);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return u.some((d) =>
|
|
15
|
+
function $(o, u) {
|
|
16
|
+
return u.some((d) => o.startsWith(`${d}_`));
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
var
|
|
20
|
-
const { showToaster:
|
|
21
|
-
const
|
|
18
|
+
const ee = () => {
|
|
19
|
+
var g, v;
|
|
20
|
+
const { showToaster: o } = O(), { post: u } = N(), { config: d } = I(), r = D(), f = W(), p = ((v = (g = d.value) == null ? void 0 : g.partner) == null ? void 0 : v.messageType) === B.transactional, y = async (e) => {
|
|
21
|
+
const s = await u(
|
|
22
22
|
"/newsletter/template-library/check-template-html-body",
|
|
23
|
-
{ html:
|
|
24
|
-
), { status: n, message:
|
|
25
|
-
return n ||
|
|
26
|
-
type:
|
|
27
|
-
message: n === void 0 ?
|
|
28
|
-
}), r(
|
|
29
|
-
type:
|
|
23
|
+
{ html: L(e) }
|
|
24
|
+
), { status: n, message: c } = s.data;
|
|
25
|
+
return n || o({
|
|
26
|
+
type: l.Alert,
|
|
27
|
+
message: n === void 0 ? c : r("newsletter.invalid-url-link-for-toaster")
|
|
28
|
+
}), r(R), c === r(V) && o({
|
|
29
|
+
type: l.Alert,
|
|
30
30
|
message: r("newsletter.already-in-progress")
|
|
31
31
|
}), n;
|
|
32
|
-
},
|
|
33
|
-
const
|
|
32
|
+
}, b = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), h = (e, t) => {
|
|
33
|
+
const s = e.match(/({%(.*?)%})/g);
|
|
34
34
|
let n = !0;
|
|
35
|
-
return
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
const [i] =
|
|
39
|
-
|
|
40
|
-
type:
|
|
35
|
+
return s !== null && !p && s.forEach((c) => {
|
|
36
|
+
const a = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
37
|
+
if (a && a.length > 0) {
|
|
38
|
+
const [i] = a;
|
|
39
|
+
b(i) && !t.includes(i) && (o({
|
|
40
|
+
type: l.Warning,
|
|
41
41
|
message: r("custom-fields.invalid-custom-fields")
|
|
42
42
|
}), n = !1);
|
|
43
43
|
}
|
|
44
44
|
}), n;
|
|
45
|
-
},
|
|
46
|
-
const n =
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
-
type:
|
|
45
|
+
}, C = async (e, t, s) => {
|
|
46
|
+
const n = s ? await y(e) : !0;
|
|
47
|
+
return h(e, t) && n;
|
|
48
|
+
}, w = (e) => e.length > 0 ? !0 : (o({
|
|
49
|
+
type: l.Warning,
|
|
50
50
|
message: r("newsletter.html-content-is-empty")
|
|
51
51
|
}), !1), k = (e) => {
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
type:
|
|
52
|
+
const t = (e.match(/{/gm) || []).length, s = (e.match(/}/gm) || []).length;
|
|
53
|
+
return t > s && o({
|
|
54
|
+
type: l.Warning,
|
|
55
55
|
message: r("custom-fields.missing-closing-braces")
|
|
56
|
-
}),
|
|
57
|
-
type:
|
|
56
|
+
}), t < s && o({
|
|
57
|
+
type: l.Warning,
|
|
58
58
|
message: r("custom-fields.missing-opening-braces")
|
|
59
|
-
}),
|
|
60
|
-
},
|
|
61
|
-
const
|
|
62
|
-
return
|
|
63
|
-
type:
|
|
59
|
+
}), t === s;
|
|
60
|
+
}, A = (e) => {
|
|
61
|
+
const t = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
62
|
+
return t || o({
|
|
63
|
+
type: l.Warning,
|
|
64
64
|
message: r("custom-fields.invalid-custom-fields")
|
|
65
|
-
}),
|
|
66
|
-
},
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const n = new Set(
|
|
70
|
-
if (
|
|
65
|
+
}), t;
|
|
66
|
+
}, E = (e, t) => {
|
|
67
|
+
const s = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
68
|
+
if (s && !p) {
|
|
69
|
+
const n = new Set(t.map((i) => i.toLowerCase())), c = _(e), a = [];
|
|
70
|
+
if (s.forEach((i) => {
|
|
71
71
|
const m = i.slice(2, -2).trim().toLowerCase();
|
|
72
|
-
(!n.has(m) || m === "") &&
|
|
73
|
-
}),
|
|
72
|
+
(!n.has(m) || m === "") && !$(m, c) && a.push(m);
|
|
73
|
+
}), a.length > 0) {
|
|
74
74
|
const i = `
|
|
75
75
|
<ul>
|
|
76
|
-
${
|
|
76
|
+
${a.map((m) => `<li>${m}</li>`).join("")}
|
|
77
77
|
</ul>
|
|
78
78
|
`;
|
|
79
|
-
return
|
|
80
|
-
type:
|
|
79
|
+
return o({
|
|
80
|
+
type: l.Alert,
|
|
81
81
|
message: r("custom-fields.invalid-custom-fields") + i
|
|
82
82
|
}), !1;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
return !0;
|
|
86
|
-
}, F = (
|
|
87
|
-
|
|
88
|
-
let n = !0;
|
|
89
|
-
if (s && s.forEach((l) => {
|
|
90
|
-
const o = l.match(_), i = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
|
|
91
|
-
(!o || l !== m) && !i && (a({
|
|
92
|
-
type: c.Alert,
|
|
93
|
-
message: r("newsletter.display-conditions-invalid-syntax")
|
|
94
|
-
}), n = !1), o && o.forEach((f) => {
|
|
95
|
-
f.trim() === "=" && (a({
|
|
96
|
-
type: c.Alert,
|
|
97
|
-
message: r("custom-conditions.wrong-equality-operators")
|
|
98
|
-
}), n = !1);
|
|
99
|
-
const v = f.match(/^[a-zA-Z]*$/g);
|
|
100
|
-
v && v.forEach((C) => {
|
|
101
|
-
S(C) && t.push(C);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
}), t.length) {
|
|
105
|
-
const l = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
|
|
106
|
-
l.length !== o.length && (a({
|
|
107
|
-
type: c.Alert,
|
|
108
|
-
message: r("custom-conditions.missing-if-endif-tag")
|
|
109
|
-
}), n = !1);
|
|
110
|
-
}
|
|
111
|
-
return n;
|
|
112
|
-
}, W = (e) => {
|
|
113
|
-
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
114
|
-
return n || a({
|
|
115
|
-
type: c.Warning,
|
|
116
|
-
message: r("custom-conditions.no-space-after-braces")
|
|
117
|
-
}), n;
|
|
118
|
-
}, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
|
|
119
|
-
type: c.Warning,
|
|
120
|
-
message: r("custom-conditions.no-braces-inside-if-tag")
|
|
121
|
-
}), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
|
|
122
|
-
type: c.Alert,
|
|
86
|
+
}, F = () => f.recommendationConfigs && Object.values(f.recommendationConfigs).find((t) => t.filters.find((s) => s.value === "")) !== void 0 ? (o({
|
|
87
|
+
type: l.Alert,
|
|
123
88
|
message: r("newsletter.fill-all-necessary-fields")
|
|
124
|
-
}), !1) : !0,
|
|
125
|
-
const
|
|
126
|
-
return e.match(
|
|
127
|
-
type:
|
|
89
|
+
}), !1) : !0, x = (e) => {
|
|
90
|
+
const t = /src="[^"]*\.(svg|pst)"/gm;
|
|
91
|
+
return e.match(t) === null ? !0 : (o({
|
|
92
|
+
type: l.Alert,
|
|
128
93
|
message: r("newsletter.invalid-image-type")
|
|
129
94
|
}), !1);
|
|
130
|
-
},
|
|
95
|
+
}, T = (e) => {
|
|
131
96
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
132
|
-
return Array.from(n).find((
|
|
97
|
+
return Array.from(n).find((a) => {
|
|
133
98
|
var i;
|
|
134
|
-
return !((i =
|
|
135
|
-
}) ? (
|
|
136
|
-
type:
|
|
99
|
+
return !((i = a.id) != null && i.trim());
|
|
100
|
+
}) ? (o({
|
|
101
|
+
type: l.Alert,
|
|
137
102
|
message: r("unsubscribe-templates.select-checkbox-groups")
|
|
138
103
|
}), !1) : !0;
|
|
139
|
-
},
|
|
104
|
+
}, S = (e) => {
|
|
140
105
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
141
|
-
return Array.from(n).find((
|
|
106
|
+
return Array.from(n).find((a) => {
|
|
142
107
|
var i;
|
|
143
|
-
return !((i =
|
|
144
|
-
}) ? (
|
|
145
|
-
type:
|
|
108
|
+
return !((i = a.id) != null && i.trim());
|
|
109
|
+
}) ? (o({
|
|
110
|
+
type: l.Alert,
|
|
146
111
|
message: r("unsubscribe-templates.select-radio-button-groups")
|
|
147
112
|
}), !1) : !0;
|
|
148
113
|
};
|
|
149
|
-
return { validateHtml: async (e,
|
|
150
|
-
var
|
|
114
|
+
return { validateHtml: async (e, t, s = !1) => {
|
|
115
|
+
var a, i;
|
|
151
116
|
const n = [
|
|
152
|
-
...
|
|
153
|
-
...
|
|
154
|
-
...((i = (
|
|
117
|
+
...t.map((m) => m.value),
|
|
118
|
+
...H,
|
|
119
|
+
...((i = (a = d.value) == null ? void 0 : a.template) == null ? void 0 : i.customFieldAttributes) ?? []
|
|
155
120
|
];
|
|
156
|
-
return await
|
|
121
|
+
return await C(e, n, s) && w(e) && k(e) && A(e) && E(e, n) && F() && x(e) && T(e) && S(e);
|
|
157
122
|
} };
|
|
158
123
|
};
|
|
159
124
|
export {
|
|
160
|
-
|
|
125
|
+
ee as useHtmlValidator
|
|
161
126
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RIBBON_SELECTOR as r } from "../enums/onboarding.js";
|
|
2
|
+
import { ref as f, onMounted as c, onBeforeUnmount as i } from "vue";
|
|
3
|
+
const m = () => {
|
|
4
|
+
const o = f(0);
|
|
5
|
+
let e = null;
|
|
6
|
+
const n = () => {
|
|
7
|
+
const t = document.querySelector(r), s = (t == null ? void 0 : t.offsetHeight) ?? 0;
|
|
8
|
+
o.value !== s && (o.value = s);
|
|
9
|
+
}, u = (t) => `${t + o.value}px`;
|
|
10
|
+
return c(() => {
|
|
11
|
+
n(), e = new MutationObserver(n), e.observe(document.body, {
|
|
12
|
+
childList: !0,
|
|
13
|
+
subtree: !0
|
|
14
|
+
});
|
|
15
|
+
}), i(() => {
|
|
16
|
+
e == null || e.disconnect();
|
|
17
|
+
}), { ribbonOffset: o, getTopPosition: u };
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
m as useRibbonOffset
|
|
21
|
+
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import $ from "../
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { useActionsApi as D } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as I } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as P } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
|
|
7
|
+
import { useToaster as x } from "./useToaster.js";
|
|
8
|
+
import { localePatch as H } from "../config/i18n/index.js";
|
|
9
|
+
import { displayConditions as O } from "../enums/displayConditions.js";
|
|
10
|
+
import { useStripoApi as j } from "../services/stripoApi.js";
|
|
11
|
+
import L from "../static/styles/customEditorStyle.css.js";
|
|
12
|
+
import { useEditorStore as y } from "../stores/editor.js";
|
|
13
|
+
import { dynamicContentToMergeTags as $ } from "../utils/genericUtil.js";
|
|
14
|
+
import z from "../package.json.js";
|
|
15
|
+
const ae = (C, l) => {
|
|
16
|
+
const { features: c, template: E, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: h, getCustomFonts: w, getSyncModulesStatus: b } = j(), { handleEvent: k } = q(), { getStripoBlocksConfig: B } = I(), T = async (i, r = [], s = !1) => {
|
|
17
|
+
var f, g, S;
|
|
18
|
+
const e = y(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await B(), _ = ((f = c.value) == null ? void 0 : f.displayConditions) ?? !0, F = ((g = c.value) == null ? void 0 : g.modulesDisabled) ?? !1, v = ((S = E.value) == null ? void 0 : S.forceRecreate) ?? !1;
|
|
18
19
|
window.UIEditor.initEditor(
|
|
19
20
|
document.querySelector("#guido-editor"),
|
|
20
21
|
{
|
|
21
|
-
metadata:
|
|
22
|
+
metadata: C,
|
|
22
23
|
html: p,
|
|
23
24
|
css: a,
|
|
24
|
-
forceRecreate:
|
|
25
|
+
forceRecreate: v,
|
|
25
26
|
locale: "en",
|
|
26
27
|
undoButtonSelector: "#guido__undo-button",
|
|
27
28
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -31,45 +32,45 @@ const ie = (E, c) => {
|
|
|
31
32
|
customAppearanceMergetags: !u("liquidSyntax"),
|
|
32
33
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
34
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
|
-
customViewStyles:
|
|
35
|
-
conditionsEnabled:
|
|
36
|
-
|
|
37
|
-
conditionCategories: x,
|
|
35
|
+
customViewStyles: L,
|
|
36
|
+
conditionsEnabled: _,
|
|
37
|
+
conditionCategories: O,
|
|
38
38
|
enableXSSSecurity: !0,
|
|
39
|
-
modulesDisabled:
|
|
40
|
-
syncModulesEnabled:
|
|
39
|
+
modulesDisabled: F,
|
|
40
|
+
syncModulesEnabled: s,
|
|
41
41
|
messageSettingsEnabled: !0,
|
|
42
42
|
displayGmailAnnotations: !0,
|
|
43
43
|
displayHiddenPreheader: !1,
|
|
44
44
|
displayTitle: !1,
|
|
45
45
|
displayUTM: !1,
|
|
46
46
|
selectElementAfterDrop: !0,
|
|
47
|
+
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
47
48
|
...o ? { baseBlocks: o } : {},
|
|
48
49
|
editorFonts: {
|
|
49
50
|
showDefaultStandardFonts: !0,
|
|
50
51
|
showDefaultNotStandardFonts: !0,
|
|
51
|
-
customFonts:
|
|
52
|
+
customFonts: r
|
|
52
53
|
},
|
|
53
54
|
mergeTags: [
|
|
54
55
|
{
|
|
55
|
-
entries:
|
|
56
|
-
|
|
56
|
+
entries: $(
|
|
57
|
+
l.preselectedDynamicContentList,
|
|
57
58
|
u("liquidSyntax")
|
|
58
59
|
)
|
|
59
60
|
}
|
|
60
61
|
],
|
|
61
62
|
async onTokenRefreshRequest(t) {
|
|
62
63
|
try {
|
|
63
|
-
const
|
|
64
|
-
t(
|
|
65
|
-
} catch (
|
|
66
|
-
m(
|
|
64
|
+
const n = await h();
|
|
65
|
+
t(n);
|
|
66
|
+
} catch (n) {
|
|
67
|
+
m(n, "Failed to refresh token");
|
|
67
68
|
}
|
|
68
69
|
},
|
|
69
70
|
onTemplateLoaded() {
|
|
70
71
|
try {
|
|
71
|
-
const { importCss: t } =
|
|
72
|
-
t(),
|
|
72
|
+
const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
|
|
73
|
+
t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
73
74
|
e.hasChanges = !1;
|
|
74
75
|
}, 1e3);
|
|
75
76
|
} catch (t) {
|
|
@@ -88,39 +89,39 @@ const ie = (E, c) => {
|
|
|
88
89
|
onDataChanged() {
|
|
89
90
|
e.hasChanges = !0;
|
|
90
91
|
},
|
|
91
|
-
onEvent:
|
|
92
|
+
onEvent: k,
|
|
92
93
|
ignoreClickOutsideSelectors: [
|
|
93
94
|
"#guido-dynamic-content-modal",
|
|
94
95
|
".in-on-board-wrapper",
|
|
95
96
|
".in-drawer__container"
|
|
96
97
|
],
|
|
97
98
|
extensions: d,
|
|
98
|
-
localePatch:
|
|
99
|
+
localePatch: H
|
|
99
100
|
}
|
|
100
101
|
);
|
|
101
|
-
},
|
|
102
|
+
}, V = (i) => new Promise((r, s) => {
|
|
102
103
|
var d;
|
|
103
104
|
if (document.getElementById("UiEditorScript")) {
|
|
104
|
-
i(),
|
|
105
|
+
i(), r();
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
|
-
const e =
|
|
108
|
+
const e = z.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
|
|
108
109
|
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
109
|
-
i(),
|
|
110
|
+
i(), r();
|
|
110
111
|
}, o.onerror = () => {
|
|
111
|
-
|
|
112
|
+
s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
112
113
|
}, document.body.appendChild(o);
|
|
113
114
|
});
|
|
114
115
|
return { initPlugin: async (i) => {
|
|
115
|
-
await
|
|
116
|
-
const
|
|
116
|
+
await V(async () => {
|
|
117
|
+
const r = y(), [s, e] = await Promise.all([
|
|
117
118
|
w(),
|
|
118
|
-
|
|
119
|
+
b()
|
|
119
120
|
]);
|
|
120
|
-
|
|
121
|
+
r.syncModulesEnabled = e, await T(i, s, e);
|
|
121
122
|
});
|
|
122
123
|
} };
|
|
123
124
|
};
|
|
124
125
|
export {
|
|
125
|
-
|
|
126
|
+
ae as useStripo
|
|
126
127
|
};
|