@useinsider/guido 3.18.1-beta.dea994d → 3.18.1-beta.e489d08
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 +3 -3
- package/dist/components/Guido.vue2.js +30 -30
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +65 -53
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
- package/dist/composables/useCustomInterfaceAppearance.js +46 -41
- package/dist/composables/useHtmlValidator.js +84 -79
- package/dist/composables/usePreviewMode.js +11 -12
- package/dist/composables/useRecommendation.js +21 -18
- package/dist/composables/useStripo.js +7 -7
- package/dist/config/compiler/htmlCompilerRules.js +6 -14
- package/dist/enums/extensions/recommendationBlock.js +38 -31
- package/dist/extensions/Blocks/Recommendation/block.js +43 -39
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +62 -57
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +80 -52
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +150 -73
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +61 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +51 -4
- package/dist/static/styles/customEditorStyle.css.js +0 -14
- package/dist/stores/onboarding.js +41 -36
- package/dist/utils/templatePreparation.js +50 -50
- package/package.json +1 -1
- package/dist/src/utils/appendMobileHiddenColumnCss.d.ts +0 -2
- package/dist/utils/appendMobileHiddenColumnCss.js +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useConfig as V } from "./useConfig.js";
|
|
2
2
|
import { getIgnoredRecommendationBlockIds as M } from "../config/compiler/utils/recommendationIgnoreUtils.js";
|
|
3
3
|
import { TemplateTypes as W } from "../enums/defaults.js";
|
|
4
|
-
import { DISPLAY_CONDITIONS_REGEX as G, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as
|
|
4
|
+
import { DISPLAY_CONDITIONS_REGEX as G, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as K, CanNotMakeAnyChangesForRunningKey as P, DATA_ATTRIBUTE_REGEX as X, DYNAMIC_CONTENT_TAG_REGEX as Y, ALLOWED_DYNAMIC_SYSTEM_TOKENS as $, VALID_DYNAMIC_VARIABLE_REGEX as U } from "../enums/html-validator.js";
|
|
5
5
|
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
6
6
|
import { BLOCK_ROOT_SELECTOR as j } from "../extensions/Blocks/Checkbox/constants/selectors.js";
|
|
7
7
|
import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
@@ -9,58 +9,58 @@ import { BLOCK_ROOT_SELECTOR as z } from "../extensions/Blocks/RadioButton/const
|
|
|
9
9
|
import { RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES as Z } from "../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
10
10
|
import { useRecommendationExtensionStore as J } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
11
11
|
import { filterToProductAttrValue as Q } from "../extensions/Blocks/Recommendation/utils/compositionKeys.js";
|
|
12
|
-
import {
|
|
13
|
-
import { useRecommendationStore as
|
|
14
|
-
import { base64EncodeWithSpecialChars as
|
|
15
|
-
import { computed as
|
|
16
|
-
import { useHttp as
|
|
17
|
-
import { useToaster as
|
|
18
|
-
import { useTranslations as
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
return [...s.matchAll(
|
|
12
|
+
import { STRATEGY_FIELD_KEY as ee, RecommendationAssignStrategyKey as te, RecommendationRequiredFieldsKey as ne } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
|
|
13
|
+
import { useRecommendationStore as se } from "../stores/recommendation.js";
|
|
14
|
+
import { base64EncodeWithSpecialChars as re } from "../utils/base64.js";
|
|
15
|
+
import { computed as oe } from "vue";
|
|
16
|
+
import { useHttp as ie } from "./useHttp.js";
|
|
17
|
+
import { useToaster as ae } from "./useToaster.js";
|
|
18
|
+
import { useTranslations as ce } from "./useTranslations.js";
|
|
19
|
+
const le = /recommendation-id="(\d+)"/g;
|
|
20
|
+
function me(s) {
|
|
21
|
+
return [...s.matchAll(le)].map((m) => m[1]);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
23
|
+
function ue(s, m) {
|
|
24
|
+
return m.some((f) => s.startsWith(`${f}_`));
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return
|
|
26
|
+
const de = /^(\d+)_\d+_(.+)$/;
|
|
27
|
+
function fe(s) {
|
|
28
|
+
const m = s.match(de);
|
|
29
|
+
return m ? { recoId: m[1], attribute: m[2] } : null;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
31
|
+
function ge(s) {
|
|
32
|
+
const m = new Set(Z);
|
|
33
33
|
return Object.values(s).forEach((f) => {
|
|
34
|
-
|
|
35
|
-
}),
|
|
34
|
+
m.add(Q(f).toLowerCase());
|
|
35
|
+
}), m;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function pe(s, m, f, o, d) {
|
|
38
38
|
const u = s.match(/{{([a-zA-Z0-9_.\s]*)}}/gm);
|
|
39
39
|
if (!u)
|
|
40
40
|
return [];
|
|
41
|
-
const
|
|
41
|
+
const p = new Set(m.map((C) => C.toLowerCase())), E = [];
|
|
42
42
|
return u.forEach((C) => {
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
43
|
+
const g = C.slice(2, -2).trim().toLowerCase();
|
|
44
|
+
if (g !== "" && p.has(g))
|
|
45
45
|
return;
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
if (!d || d.has(
|
|
46
|
+
const y = fe(g);
|
|
47
|
+
if (y && o.has(y.recoId)) {
|
|
48
|
+
if (!d || d.has(y.attribute))
|
|
49
49
|
return;
|
|
50
|
-
E.push(
|
|
50
|
+
E.push(g);
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
ue(g, f) || g.includes(".") || E.push(g);
|
|
54
54
|
}), E;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
return (s.replace(
|
|
58
|
-
const d = o.slice(2, -2), u = d.indexOf("|"),
|
|
59
|
-
return
|
|
56
|
+
function Ee(s) {
|
|
57
|
+
return (s.replace(X, "$1").match(Y) ?? []).filter((o) => {
|
|
58
|
+
const d = o.slice(2, -2), u = d.indexOf("|"), p = (u === -1 ? d : d.slice(0, u)).trim();
|
|
59
|
+
return $.includes(p) ? !1 : U.test(p) ? u !== -1 && d.slice(u + 1).trim() === "" : !0;
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
const { showToaster: s } =
|
|
62
|
+
const ke = () => {
|
|
63
|
+
const { showToaster: s } = ae(), { post: m } = ie(), { config: f } = V(), o = ce(), d = se(), u = J(), p = oe(
|
|
64
64
|
() => {
|
|
65
65
|
var e, t;
|
|
66
66
|
return ((t = (e = f.value) == null ? void 0 : e.partner) == null ? void 0 : t.messageType) === W.transactional;
|
|
@@ -73,27 +73,27 @@ const De = () => {
|
|
|
73
73
|
} catch {
|
|
74
74
|
return null;
|
|
75
75
|
}
|
|
76
|
-
return
|
|
76
|
+
return ge(u.filterList);
|
|
77
77
|
}, C = async (e) => {
|
|
78
|
-
const n = await
|
|
78
|
+
const n = await m(
|
|
79
79
|
"/newsletter/template-library/check-template-html-body",
|
|
80
|
-
{ html:
|
|
80
|
+
{ html: re(e) }
|
|
81
81
|
), { status: r, message: a } = n.data;
|
|
82
82
|
return r || s({
|
|
83
83
|
type: c.Error,
|
|
84
84
|
message: r === void 0 ? a : o("newsletter.invalid-url-link-for-toaster")
|
|
85
|
-
}), o(
|
|
85
|
+
}), o(K), a === o(P) && s({
|
|
86
86
|
type: c.Error,
|
|
87
87
|
message: o("newsletter.already-in-progress")
|
|
88
88
|
}), r;
|
|
89
|
-
},
|
|
89
|
+
}, g = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), y = (e) => ["if", "endif"].includes(e.toLowerCase()), I = (e, t) => {
|
|
90
90
|
const n = e.match(/({%(.*?)%})/g);
|
|
91
91
|
let r = !0;
|
|
92
|
-
return n !== null && !
|
|
92
|
+
return n !== null && !p.value && n.forEach((a) => {
|
|
93
93
|
const i = a.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
94
94
|
if (i && i.length > 0) {
|
|
95
|
-
const [
|
|
96
|
-
|
|
95
|
+
const [l] = i;
|
|
96
|
+
g(l) && !t.includes(l) && (s({
|
|
97
97
|
type: c.Warning,
|
|
98
98
|
message: o("custom-fields.invalid-custom-fields")
|
|
99
99
|
}), r = !1);
|
|
@@ -101,11 +101,11 @@ const De = () => {
|
|
|
101
101
|
}), r;
|
|
102
102
|
}, R = async (e, t, n) => {
|
|
103
103
|
const r = n ? await C(e) : !0;
|
|
104
|
-
return
|
|
105
|
-
},
|
|
104
|
+
return I(e, t) && r;
|
|
105
|
+
}, A = (e) => e.length > 0 ? !0 : (s({
|
|
106
106
|
type: c.Warning,
|
|
107
107
|
message: o("newsletter.html-content-is-empty")
|
|
108
|
-
}), !1),
|
|
108
|
+
}), !1), _ = (e) => {
|
|
109
109
|
const t = (e.match(/{/gm) || []).length, n = (e.match(/}/gm) || []).length;
|
|
110
110
|
return t > n && s({
|
|
111
111
|
type: c.Warning,
|
|
@@ -114,26 +114,26 @@ const De = () => {
|
|
|
114
114
|
type: c.Warning,
|
|
115
115
|
message: o("custom-fields.missing-opening-braces")
|
|
116
116
|
}), t === n;
|
|
117
|
-
},
|
|
118
|
-
const t =
|
|
117
|
+
}, b = (e) => {
|
|
118
|
+
const t = Ee(e).length === 0;
|
|
119
119
|
return t || s({
|
|
120
120
|
type: c.Warning,
|
|
121
121
|
message: o("custom-fields.invalid-custom-fields")
|
|
122
122
|
}), t;
|
|
123
123
|
}, O = (e, t, n, r) => {
|
|
124
|
-
if (
|
|
124
|
+
if (p.value)
|
|
125
125
|
return !0;
|
|
126
|
-
const a =
|
|
126
|
+
const a = pe(
|
|
127
127
|
e,
|
|
128
128
|
t,
|
|
129
|
-
|
|
129
|
+
me(e),
|
|
130
130
|
n,
|
|
131
131
|
r
|
|
132
132
|
);
|
|
133
133
|
if (a.length > 0) {
|
|
134
134
|
const i = `
|
|
135
135
|
<ul>
|
|
136
|
-
${a.map((
|
|
136
|
+
${a.map((l) => `<li>${l}</li>`).join("")}
|
|
137
137
|
</ul>
|
|
138
138
|
`;
|
|
139
139
|
return s({
|
|
@@ -146,22 +146,22 @@ const De = () => {
|
|
|
146
146
|
const t = e.match(/{%(.*?)%}/g), n = [];
|
|
147
147
|
let r = !0;
|
|
148
148
|
if (t && t.forEach((a) => {
|
|
149
|
-
const i = a.match(G),
|
|
150
|
-
(!i || a !== v) && !
|
|
149
|
+
const i = a.match(G), l = a.match(H), v = (i == null ? void 0 : i.join("")) || "";
|
|
150
|
+
(!i || a !== v) && !l && (s({
|
|
151
151
|
type: c.Error,
|
|
152
152
|
message: o("newsletter.display-conditions-invalid-syntax")
|
|
153
|
-
}), r = !1), i && i.forEach((
|
|
154
|
-
|
|
153
|
+
}), r = !1), i && i.forEach((h) => {
|
|
154
|
+
h.trim() === "=" && (s({
|
|
155
155
|
type: c.Error,
|
|
156
156
|
message: o("custom-conditions.wrong-equality-operators")
|
|
157
157
|
}), r = !1);
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
const S = h.match(/^[a-zA-Z]*$/g);
|
|
159
|
+
S && S.forEach((T) => {
|
|
160
|
+
y(T) && n.push(T);
|
|
161
161
|
});
|
|
162
162
|
});
|
|
163
163
|
}), n.length) {
|
|
164
|
-
const a = n.filter((
|
|
164
|
+
const a = n.filter((l) => l === "if"), i = n.filter((l) => l === "endif");
|
|
165
165
|
a.length !== i.length && (s({
|
|
166
166
|
type: c.Error,
|
|
167
167
|
message: o("custom-conditions.missing-if-endif-tag")
|
|
@@ -177,23 +177,28 @@ const De = () => {
|
|
|
177
177
|
}, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, r) => n + r, 0) > 0 ? (s({
|
|
178
178
|
type: c.Warning,
|
|
179
179
|
message: o("custom-conditions.no-braces-inside-if-tag")
|
|
180
|
-
}), !1) : !0, B = () =>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
180
|
+
}), !1) : !0, B = () => {
|
|
181
|
+
if (!u.hasInvalidBlock())
|
|
182
|
+
return !0;
|
|
183
|
+
const e = u.invalidBlockFields().includes(ee);
|
|
184
|
+
return s({
|
|
185
|
+
type: e ? c.Warning : c.Error,
|
|
186
|
+
message: o(e ? te : ne)
|
|
187
|
+
}), !1;
|
|
188
|
+
}, x = () => d.recommendationConfigs && Object.values(d.recommendationConfigs).find((t) => t.filters.find((n) => n.value === "")) !== void 0 ? (s({
|
|
184
189
|
type: c.Error,
|
|
185
190
|
message: o("newsletter.fill-all-necessary-fields")
|
|
186
|
-
}), !1) : !0,
|
|
191
|
+
}), !1) : !0, F = (e) => {
|
|
187
192
|
const t = /src="[^"]*\.(svg|pst)"/gm;
|
|
188
193
|
return e.match(t) === null ? !0 : (s({
|
|
189
194
|
type: c.Error,
|
|
190
195
|
message: o("newsletter.invalid-image-type")
|
|
191
196
|
}), !1);
|
|
192
|
-
},
|
|
197
|
+
}, D = (e) => {
|
|
193
198
|
const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(j);
|
|
194
199
|
return Array.from(r).find((i) => {
|
|
195
|
-
var
|
|
196
|
-
return !((
|
|
200
|
+
var l;
|
|
201
|
+
return !((l = i.id) != null && l.trim());
|
|
197
202
|
}) ? (s({
|
|
198
203
|
type: c.Error,
|
|
199
204
|
message: o("unsubscribe-templates.select-checkbox-groups")
|
|
@@ -201,26 +206,26 @@ const De = () => {
|
|
|
201
206
|
}, k = (e) => {
|
|
202
207
|
const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(z);
|
|
203
208
|
return Array.from(r).find((i) => {
|
|
204
|
-
var
|
|
205
|
-
return !((
|
|
209
|
+
var l;
|
|
210
|
+
return !((l = i.id) != null && l.trim());
|
|
206
211
|
}) ? (s({
|
|
207
212
|
type: c.Error,
|
|
208
213
|
message: o("unsubscribe-templates.select-radio-button-groups")
|
|
209
214
|
}), !1) : !0;
|
|
210
215
|
};
|
|
211
216
|
return { validateHtml: async (e, t, n = !1) => {
|
|
212
|
-
var v,
|
|
217
|
+
var v, h;
|
|
213
218
|
const r = [
|
|
214
|
-
...t.map((
|
|
219
|
+
...t.map((S) => S.value),
|
|
215
220
|
...q,
|
|
216
|
-
...((
|
|
221
|
+
...((h = (v = f.value) == null ? void 0 : v.template) == null ? void 0 : h.customFieldAttributes) ?? []
|
|
217
222
|
], a = M(e), i = await E(a);
|
|
218
|
-
return await R(e, r, n) &&
|
|
223
|
+
return await R(e, r, n) && A(e) && _(e) && b(e) && O(e, r, a, i) && w(e) && L(e) && N(e) && B() && x() && F(e) && D(e) && k(e);
|
|
219
224
|
} };
|
|
220
225
|
};
|
|
221
226
|
export {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
227
|
+
ge as buildPartnerAttributeNameSet,
|
|
228
|
+
pe as findInvalidCustomFields,
|
|
229
|
+
fe as parseRecommendationVariable,
|
|
230
|
+
ke as useHtmlValidator
|
|
226
231
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { useEditorStore as
|
|
2
|
-
import { usePreviewStore as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const t = p(), e = c(), { closeCodeEditor: a } = w(), { getPreviewData: m, getCompiledEmail: s } = v(), { compileHtml: l } = P(), { substituteRecommendationPreview: r } = f(), i = () => {
|
|
1
|
+
import { useEditorStore as n } from "../stores/editor.js";
|
|
2
|
+
import { usePreviewStore as p } from "../stores/preview.js";
|
|
3
|
+
import { useActionsApi as c } from "./useActionsApi.js";
|
|
4
|
+
import { useCodeEditorApi as u } from "./useCodeEditorApi.js";
|
|
5
|
+
import { useHtmlCompiler as v } from "./useHtmlCompiler.js";
|
|
6
|
+
import { useRecommendationPreview as w } from "./useRecommendationPreview.js";
|
|
7
|
+
const C = () => {
|
|
8
|
+
const t = n(), e = p(), { closeCodeEditor: a } = u(), { getPreviewData: m, getCompiledEmail: s } = c(), { compileHtml: l } = v(), { substituteRecommendationPreview: r } = w(), i = () => {
|
|
10
9
|
t.isPreviewModeOpen = !1, e.$reset();
|
|
11
10
|
};
|
|
12
11
|
return {
|
|
@@ -21,8 +20,8 @@ const A = () => {
|
|
|
21
20
|
const [o, d] = await Promise.all([
|
|
22
21
|
m(),
|
|
23
22
|
s({ minimize: !0, resetDataSavedFlag: !1 })
|
|
24
|
-
])
|
|
25
|
-
e.templateHtml =
|
|
23
|
+
]);
|
|
24
|
+
e.templateHtml = r(o.html || ""), e.ampHtml = r(o.ampHtml || ""), e.ampErrors = o.ampErrors || [], e.setEmailFormat(o.ampHtml ? "AMP" : "html"), e.emailSizeKB = l(d.html).estimatedSizeKB, e.isLoaded = !0;
|
|
26
25
|
} catch (o) {
|
|
27
26
|
console.error("Failed to load preview data:", o), i();
|
|
28
27
|
} finally {
|
|
@@ -33,5 +32,5 @@ const A = () => {
|
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
34
|
export {
|
|
36
|
-
|
|
35
|
+
C as usePreviewMode
|
|
37
36
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { getRecommendationFeedSourceMaps as y, URLS as I } from "../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { MinDeviceViewport as C, DefaultPadding as R } from "../enums/recommendation.js";
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
3
|
+
import { useRecommendationExtensionStore as f } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
5
|
import { getPartnerRecommendationParams as h } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
6
6
|
import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
|
|
7
7
|
import { useConfigStore as P } from "../stores/config.js";
|
|
8
8
|
const B = () => ({
|
|
9
9
|
calculateCardWidth: ({
|
|
10
|
-
mobileLeftPadding:
|
|
10
|
+
mobileLeftPadding: a,
|
|
11
11
|
mobileRightPadding: c,
|
|
12
|
-
cardsInRow:
|
|
12
|
+
cardsInRow: i,
|
|
13
13
|
unresponsive: n
|
|
14
14
|
}) => {
|
|
15
|
-
const o = n ?
|
|
15
|
+
const o = n ? i : 1, e = a + c + (o - 1) * R;
|
|
16
16
|
return (C - e) / o;
|
|
17
17
|
},
|
|
18
|
-
getRecommendationCampaignData: (
|
|
19
|
-
const c =
|
|
18
|
+
getRecommendationCampaignData: (a) => {
|
|
19
|
+
const c = f(), i = Number(a), n = c.blockStates[i];
|
|
20
20
|
if (!n)
|
|
21
21
|
return {
|
|
22
22
|
textTrimming: !1,
|
|
@@ -44,17 +44,17 @@ const B = () => ({
|
|
|
44
44
|
discountAfterTextValue: ""
|
|
45
45
|
};
|
|
46
46
|
},
|
|
47
|
-
buildCampaignUrl: (
|
|
48
|
-
var
|
|
49
|
-
const
|
|
47
|
+
buildCampaignUrl: (a, c) => {
|
|
48
|
+
var l;
|
|
49
|
+
const i = f(), n = P(), o = Number(a);
|
|
50
50
|
let e;
|
|
51
51
|
if (c)
|
|
52
52
|
e = c;
|
|
53
53
|
else {
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
54
|
+
const s = i.blockStates[o];
|
|
55
|
+
if (!s)
|
|
56
56
|
return "";
|
|
57
|
-
const { recommendationConfigs: r } =
|
|
57
|
+
const { recommendationConfigs: r } = s;
|
|
58
58
|
e = {
|
|
59
59
|
strategy: r.strategy,
|
|
60
60
|
strategyId: r.strategyId,
|
|
@@ -67,17 +67,20 @@ const B = () => ({
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
if (e.strategyId && n.isFeatureEnabled("reusableRecommendationStrategy"))
|
|
70
|
-
return
|
|
70
|
+
return i.recommendationCampaignUrls[a] = {
|
|
71
71
|
strategyId: e.strategyId,
|
|
72
72
|
locale: e.language,
|
|
73
73
|
currency: e.currencyCode
|
|
74
74
|
}, "";
|
|
75
|
-
const
|
|
75
|
+
const d = ((l = y().find((s) => s.key === e.strategy)) == null ? void 0 : l.path) || "";
|
|
76
|
+
if (!d)
|
|
77
|
+
return delete i.recommendationCampaignUrls[a], "";
|
|
78
|
+
const t = new URLSearchParams();
|
|
76
79
|
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" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const p = decodeURIComponent(t.toString()),
|
|
80
|
-
return
|
|
80
|
+
const g = e.filters.filter((s) => s.isValid), u = b(g);
|
|
81
|
+
u && t.set("filter", u), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(n.partnerName, e.strategy)).forEach(([s, r]) => t.set(s, r));
|
|
82
|
+
const p = decodeURIComponent(t.toString()), m = `${I.RECOMMENDATION_API_URL}/v2/${d}?${p}`;
|
|
83
|
+
return i.recommendationCampaignUrls[a] = m, m;
|
|
81
84
|
}
|
|
82
85
|
});
|
|
83
86
|
export {
|
|
@@ -16,7 +16,7 @@ import { useEditorStore as b } from "../stores/editor.js";
|
|
|
16
16
|
import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
|
|
17
17
|
import Z from "../package.json.js";
|
|
18
18
|
let n = null;
|
|
19
|
-
const
|
|
19
|
+
const he = () => {
|
|
20
20
|
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: v } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
21
|
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
@@ -31,8 +31,8 @@ const Ce = () => {
|
|
|
31
31
|
n = null;
|
|
32
32
|
}), n), _ = async (i, s, o, a = [], r = !1) => {
|
|
33
33
|
var y, E, h, C;
|
|
34
|
-
const e = b(), { html: d, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1);
|
|
35
|
-
await window.UIEditor.initEditor(
|
|
34
|
+
const e = b(), { html: d, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), I = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
35
|
+
H().importCss(), await window.UIEditor.initEditor(
|
|
36
36
|
document.querySelector("#guido-editor"),
|
|
37
37
|
{
|
|
38
38
|
metadata: s,
|
|
@@ -62,7 +62,7 @@ const Ce = () => {
|
|
|
62
62
|
displayUTM: !1,
|
|
63
63
|
selectElementAfterDrop: !0,
|
|
64
64
|
sameFontSizeForOutlook: !0,
|
|
65
|
-
allowedScriptSourceDomains:
|
|
65
|
+
allowedScriptSourceDomains: I,
|
|
66
66
|
...g ? { baseBlocks: g } : {},
|
|
67
67
|
editorFonts: {
|
|
68
68
|
showDefaultStandardFonts: !0,
|
|
@@ -88,8 +88,8 @@ const Ce = () => {
|
|
|
88
88
|
},
|
|
89
89
|
onTemplateLoaded() {
|
|
90
90
|
try {
|
|
91
|
-
const {
|
|
92
|
-
t(),
|
|
91
|
+
const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
|
|
92
|
+
t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
93
93
|
e.hasChanges = !1;
|
|
94
94
|
}, 1e3);
|
|
95
95
|
} catch (t) {
|
|
@@ -146,5 +146,5 @@ const Ce = () => {
|
|
|
146
146
|
} };
|
|
147
147
|
};
|
|
148
148
|
export {
|
|
149
|
-
|
|
149
|
+
he as useStripo
|
|
150
150
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const g = [
|
|
1
|
+
import { stripFontTags as p } from "../../utils/stripFontTags.js";
|
|
2
|
+
const d = [
|
|
4
3
|
{
|
|
5
4
|
id: "fix-url-encoding-start",
|
|
6
5
|
description: "Replace {%22 with %7B%22 to fix URL encoding",
|
|
@@ -59,7 +58,7 @@ const g = [
|
|
|
59
58
|
id: "strip-font-tags",
|
|
60
59
|
description: 'Unwrap browser-translate-injected <font dir="auto"> tags, keeping inner content; other <font> elements are left intact.',
|
|
61
60
|
type: "custom",
|
|
62
|
-
processor: (e) =>
|
|
61
|
+
processor: (e) => p(e),
|
|
63
62
|
priority: 15
|
|
64
63
|
},
|
|
65
64
|
{
|
|
@@ -130,13 +129,6 @@ const g = [
|
|
|
130
129
|
},
|
|
131
130
|
priority: 30
|
|
132
131
|
},
|
|
133
|
-
{
|
|
134
|
-
id: "append-mobile-hidden-column-css",
|
|
135
|
-
description: "Inject media-query CSS that hides mobile-hidden columns and their gap cells",
|
|
136
|
-
type: "custom",
|
|
137
|
-
processor: (e) => c(e),
|
|
138
|
-
priority: 31
|
|
139
|
-
},
|
|
140
132
|
{
|
|
141
133
|
id: "replace-old-image-domain",
|
|
142
134
|
description: "Replacing old image domains",
|
|
@@ -165,8 +157,8 @@ const g = [
|
|
|
165
157
|
processor: (e) => {
|
|
166
158
|
const t = (i) => i.toString(16).padStart(2, "0");
|
|
167
159
|
return e.replace(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi, (i, o, n, r) => {
|
|
168
|
-
const [s, a,
|
|
169
|
-
return s > 255 || a > 255 ||
|
|
160
|
+
const [s, a, c] = [Number(o), Number(n), Number(r)];
|
|
161
|
+
return s > 255 || a > 255 || c > 255 ? i : `#${t(s)}${t(a)}${t(c)}`;
|
|
170
162
|
}).replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3\b/gi, "#$1$2$3");
|
|
171
163
|
},
|
|
172
164
|
priority: 44
|
|
@@ -208,5 +200,5 @@ const g = [
|
|
|
208
200
|
}
|
|
209
201
|
];
|
|
210
202
|
export {
|
|
211
|
-
|
|
203
|
+
d as defaultHtmlCompilerRules
|
|
212
204
|
};
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { useTranslations as
|
|
2
|
-
const
|
|
1
|
+
import { useTranslations as n } from "../../composables/useTranslations.js";
|
|
2
|
+
const o = {
|
|
3
3
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
|
|
4
4
|
// Relative path → same-origin as the embedding inone dashboard.
|
|
5
5
|
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
|
|
6
6
|
RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
|
|
7
|
-
RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies"
|
|
8
|
-
|
|
7
|
+
RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies",
|
|
8
|
+
// Smart Recommender hides the Email channel unless the URL asks for it, so a strategy created
|
|
9
|
+
// without this flag can never be Email-suitable and would never reach the editor's list.
|
|
10
|
+
RECOMMENDATION_STRATEGY_CREATE_PATH: "/discovery/recommendation-strategies/create?isEmail=true"
|
|
11
|
+
}, d = (e) => {
|
|
12
|
+
const { RECOMMENDATION_STRATEGIES_PANEL_PATH: r } = o;
|
|
13
|
+
return `${r}/${e}/edit`;
|
|
14
|
+
}, m = {
|
|
9
15
|
CLIENT_ID: "clientId"
|
|
10
|
-
},
|
|
11
|
-
const e =
|
|
16
|
+
}, p = () => {
|
|
17
|
+
const e = n();
|
|
12
18
|
return [
|
|
13
19
|
{
|
|
14
20
|
id: 11,
|
|
@@ -71,14 +77,14 @@ const l = {
|
|
|
71
77
|
path: "top-sellers"
|
|
72
78
|
}
|
|
73
79
|
];
|
|
74
|
-
},
|
|
80
|
+
}, v = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], h = [
|
|
75
81
|
{ text: "before the amount", value: "0" },
|
|
76
82
|
{ text: "after the amount", value: "1" }
|
|
77
|
-
],
|
|
83
|
+
], x = [
|
|
78
84
|
{ text: "dot(.)", value: "." },
|
|
79
85
|
{ text: "comma(,)", value: "," },
|
|
80
86
|
{ text: "space( )", value: " " }
|
|
81
|
-
],
|
|
87
|
+
], b = [
|
|
82
88
|
{ text: "0", value: "0" },
|
|
83
89
|
{ text: "1", value: "1" },
|
|
84
90
|
{ text: "2", value: "2" },
|
|
@@ -90,54 +96,55 @@ const l = {
|
|
|
90
96
|
{ text: "contains", value: "~" },
|
|
91
97
|
{ text: "does not contain", value: "!~" },
|
|
92
98
|
{ text: "any of", value: a }
|
|
93
|
-
],
|
|
99
|
+
], s = [
|
|
94
100
|
{ text: "is exactly", value: "=" },
|
|
95
101
|
{ text: "is not exactly", value: "!==" },
|
|
96
102
|
{ text: "contains", value: "~" },
|
|
97
103
|
{ text: "does not contain", value: "!~" },
|
|
98
104
|
{ text: "any of", value: a }
|
|
99
|
-
],
|
|
105
|
+
], i = [
|
|
100
106
|
{ text: "is equal to", value: "=" },
|
|
101
107
|
{ text: "is greater than", value: ">" },
|
|
102
108
|
{ text: "is less than", value: "<" }
|
|
103
|
-
],
|
|
109
|
+
], u = [
|
|
104
110
|
{ text: "is equal to", value: "=" },
|
|
105
111
|
{ text: "after", value: ">" },
|
|
106
112
|
{ text: "before", value: "<" }
|
|
107
|
-
],
|
|
113
|
+
], c = [
|
|
108
114
|
{ text: "true", value: "==" },
|
|
109
115
|
{ text: "false", value: "!=" }
|
|
110
|
-
],
|
|
116
|
+
], g = (e) => {
|
|
111
117
|
if (!e)
|
|
112
118
|
return t;
|
|
113
119
|
switch (e) {
|
|
114
120
|
case "Boolean":
|
|
115
|
-
return
|
|
121
|
+
return c;
|
|
116
122
|
case "Date":
|
|
117
|
-
return
|
|
123
|
+
return u;
|
|
118
124
|
case "Number":
|
|
119
|
-
return
|
|
125
|
+
return i;
|
|
120
126
|
case "String":
|
|
121
127
|
return t;
|
|
122
128
|
case "Strings":
|
|
123
|
-
return
|
|
129
|
+
return s;
|
|
124
130
|
default:
|
|
125
131
|
return t;
|
|
126
132
|
}
|
|
127
133
|
};
|
|
128
134
|
export {
|
|
129
135
|
a as OP_ANY_OF,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
t as operatorOptionsForStrings
|
|
136
|
+
v as PriceAttributes,
|
|
137
|
+
m as QUERY_PARAMS,
|
|
138
|
+
o as URLS,
|
|
139
|
+
b as currencyDecimalCounts,
|
|
140
|
+
h as currencyLocationMaps,
|
|
141
|
+
x as currencyOperators,
|
|
142
|
+
g as getOperatorOptions,
|
|
143
|
+
p as getRecommendationFeedSourceMaps,
|
|
144
|
+
s as operatorOptionsForArrayOfStrings,
|
|
145
|
+
c as operatorOptionsForBooleans,
|
|
146
|
+
u as operatorOptionsForDates,
|
|
147
|
+
i as operatorOptionsForNumbers,
|
|
148
|
+
t as operatorOptionsForStrings,
|
|
149
|
+
d as strategyEditPath
|
|
143
150
|
};
|