@useinsider/guido 3.5.2-beta.c2f8a2e → 3.6.0
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/useRecommendation.js +24 -28
- package/dist/composables/useStripo.js +12 -11
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.test.d.ts +1 -0
- package/package.json +2 -2
|
@@ -5,16 +5,16 @@ import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommend
|
|
|
5
5
|
import { useConfigStore as x } from "../stores/config.js";
|
|
6
6
|
const w = () => ({
|
|
7
7
|
calculateCardWidth: ({
|
|
8
|
-
mobileLeftPadding:
|
|
9
|
-
mobileRightPadding:
|
|
10
|
-
cardsInRow:
|
|
8
|
+
mobileLeftPadding: o,
|
|
9
|
+
mobileRightPadding: s,
|
|
10
|
+
cardsInRow: a,
|
|
11
11
|
unresponsive: n
|
|
12
12
|
}) => {
|
|
13
|
-
const r = n ?
|
|
13
|
+
const r = n ? a : 1, e = o + s + (r - 1) * b;
|
|
14
14
|
return (R - e) / r;
|
|
15
15
|
},
|
|
16
|
-
getRecommendationCampaignData: (
|
|
17
|
-
const
|
|
16
|
+
getRecommendationCampaignData: (o) => {
|
|
17
|
+
const s = m(), a = Number(o), n = s.blockStates[a];
|
|
18
18
|
if (!n)
|
|
19
19
|
return {
|
|
20
20
|
textTrimming: !1,
|
|
@@ -42,37 +42,33 @@ const w = () => ({
|
|
|
42
42
|
discountAfterTextValue: ""
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
|
-
buildCampaignUrl: (
|
|
45
|
+
buildCampaignUrl: (o, s) => {
|
|
46
46
|
var l;
|
|
47
|
-
const
|
|
47
|
+
const a = m(), n = x(), r = Number(o);
|
|
48
48
|
let e;
|
|
49
|
-
if (
|
|
50
|
-
e =
|
|
49
|
+
if (s)
|
|
50
|
+
e = s;
|
|
51
51
|
else {
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
52
|
+
const c = a.blockStates[r];
|
|
53
|
+
if (!c)
|
|
54
54
|
return "";
|
|
55
|
-
const { recommendationConfigs:
|
|
55
|
+
const { recommendationConfigs: i } = c;
|
|
56
56
|
e = {
|
|
57
|
-
strategy:
|
|
58
|
-
language:
|
|
59
|
-
currencyCode:
|
|
60
|
-
size:
|
|
61
|
-
productIds:
|
|
62
|
-
filters:
|
|
63
|
-
shuffleProducts:
|
|
57
|
+
strategy: i.strategy,
|
|
58
|
+
language: i.language,
|
|
59
|
+
currencyCode: i.currencySettings.value,
|
|
60
|
+
size: i.size,
|
|
61
|
+
productIds: i.productIds,
|
|
62
|
+
filters: i.filters,
|
|
63
|
+
shuffleProducts: i.shuffleProducts
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
const f = ((l = I().find((
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
t.set("productId", e.productIds.slice(0, i).join(","));
|
|
70
|
-
} else e.strategy === "similarViewed" && t.set("productId", "{itemId}");
|
|
71
|
-
e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
72
|
-
const g = e.filters.filter((i) => i.isValid), d = h(g);
|
|
66
|
+
const f = ((l = I().find((c) => c.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
|
|
67
|
+
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", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
68
|
+
const g = e.filters.filter((c) => c.isValid), d = h(g);
|
|
73
69
|
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true");
|
|
74
70
|
const p = decodeURIComponent(t.toString()), u = `${C.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
75
|
-
return
|
|
71
|
+
return a.recommendationCampaignUrls[o] = u, u;
|
|
76
72
|
}
|
|
77
73
|
});
|
|
78
74
|
export {
|
|
@@ -9,12 +9,12 @@ import { localePatch as H } from "../config/i18n/index.js";
|
|
|
9
9
|
import { useStripoApi as O } from "../services/stripoApi.js";
|
|
10
10
|
import j from "../static/styles/customEditorStyle.css.js";
|
|
11
11
|
import { useEditorStore as E } from "../stores/editor.js";
|
|
12
|
-
import { dynamicContentToMergeTags as
|
|
13
|
-
import
|
|
12
|
+
import { dynamicContentToMergeTags as z } from "../utils/genericUtil.js";
|
|
13
|
+
import L from "../package.json.js";
|
|
14
14
|
const se = (C, l) => {
|
|
15
|
-
const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent:
|
|
15
|
+
const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent: F } = q(), { getStripoBlocksConfig: B } = I(), T = async (i, r = [], s = !1) => {
|
|
16
16
|
var g, S, y;
|
|
17
|
-
const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await
|
|
17
|
+
const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await B(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, _ = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
18
18
|
window.UIEditor.initEditor(
|
|
19
19
|
document.querySelector("#guido-editor"),
|
|
20
20
|
{
|
|
@@ -35,7 +35,7 @@ const se = (C, l) => {
|
|
|
35
35
|
conditionsEnabled: f,
|
|
36
36
|
customConditionsEnabled: f,
|
|
37
37
|
enableXSSSecurity: !0,
|
|
38
|
-
modulesDisabled:
|
|
38
|
+
modulesDisabled: _,
|
|
39
39
|
syncModulesEnabled: s,
|
|
40
40
|
messageSettingsEnabled: !0,
|
|
41
41
|
displayGmailAnnotations: !0,
|
|
@@ -43,6 +43,7 @@ const se = (C, l) => {
|
|
|
43
43
|
displayTitle: !1,
|
|
44
44
|
displayUTM: !1,
|
|
45
45
|
selectElementAfterDrop: !0,
|
|
46
|
+
sameFontSizeForOutlook: !0,
|
|
46
47
|
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
47
48
|
...o ? { baseBlocks: o } : {},
|
|
48
49
|
editorFonts: {
|
|
@@ -52,7 +53,7 @@ const se = (C, l) => {
|
|
|
52
53
|
},
|
|
53
54
|
mergeTags: [
|
|
54
55
|
{
|
|
55
|
-
entries:
|
|
56
|
+
entries: z(
|
|
56
57
|
l.preselectedDynamicContentList,
|
|
57
58
|
u("liquidSyntax")
|
|
58
59
|
)
|
|
@@ -88,7 +89,7 @@ const se = (C, l) => {
|
|
|
88
89
|
onDataChanged() {
|
|
89
90
|
e.hasChanges = !0;
|
|
90
91
|
},
|
|
91
|
-
onEvent:
|
|
92
|
+
onEvent: F,
|
|
92
93
|
ignoreClickOutsideSelectors: [
|
|
93
94
|
"#guido-dynamic-content-modal",
|
|
94
95
|
".in-on-board-wrapper",
|
|
@@ -98,13 +99,13 @@ const se = (C, l) => {
|
|
|
98
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
105
|
i(), r();
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
|
-
const e =
|
|
108
|
+
const e = L.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
110
|
i(), r();
|
|
110
111
|
}, o.onerror = () => {
|
|
@@ -112,12 +113,12 @@ const se = (C, l) => {
|
|
|
112
113
|
}, document.body.appendChild(o);
|
|
113
114
|
});
|
|
114
115
|
return { initPlugin: async (i) => {
|
|
115
|
-
await
|
|
116
|
+
await V(async () => {
|
|
116
117
|
const r = E(), [s, e] = await Promise.all([
|
|
117
118
|
b(),
|
|
118
119
|
k()
|
|
119
120
|
]);
|
|
120
|
-
r.syncModulesEnabled = e, await
|
|
121
|
+
r.syncModulesEnabled = e, await T(i, s, e);
|
|
121
122
|
});
|
|
122
123
|
} };
|
|
123
124
|
};
|
|
@@ -453,7 +453,7 @@ const N = () => ({
|
|
|
453
453
|
details: !0,
|
|
454
454
|
campaignId: o.variationId
|
|
455
455
|
};
|
|
456
|
-
r.strategy === "manualMerchandising" ? a.productId = r.productIds.
|
|
456
|
+
r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0);
|
|
457
457
|
let f;
|
|
458
458
|
try {
|
|
459
459
|
f = await h.fetchRecommendationProducts(i, a);
|
package/dist/package.json.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
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",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"guido": {
|
|
94
94
|
"stripo": {
|
|
95
|
-
"version": "2.
|
|
95
|
+
"version": "2.65.0"
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|