@useinsider/guido 3.2.0-beta.6d12eec → 3.2.0-beta.97c35ff
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 +2 -2
- package/dist/composables/useStripo.js +32 -33
- package/dist/enums/displayConditions.js +82 -78
- package/dist/enums/extensions/recommendationBlock.js +95 -41
- package/dist/enums/unsubscribe.js +17 -16
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -3
- package/dist/src/enums/displayConditions.d.ts +5 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +5 -1
- package/dist/src/enums/unsubscribe.d.ts +8 -3
- package/package.json +1 -1
- package/dist/composables/useFullStoryBridge.js +0 -34
- package/dist/src/composables/useFullStoryBridge.d.ts +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getRecommendationFeedSourceMaps as g, URLS as p } from "../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
3
|
import { useRecommendationExtensionStore as u } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as x } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
@@ -47,7 +47,7 @@ const N = () => ({
|
|
|
47
47
|
const n = u(), o = I(), a = Number(i), r = n.blockStates[a];
|
|
48
48
|
if (!r)
|
|
49
49
|
return "";
|
|
50
|
-
const { recommendationConfigs: e } = r, l = ((m = g.find((s) => s.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
50
|
+
const { recommendationConfigs: e } = r, l = ((m = g().find((s) => s.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
51
51
|
t.set("locale", e.language), t.set("currency", e.currencySettings.value), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.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}");
|
|
52
52
|
const f = e.filters.filter((s) => s.isValid), c = x(f);
|
|
53
53
|
c && t.set("filter", c), e.shuffleProducts && t.set("shuffle", "true");
|
|
@@ -1,28 +1,27 @@
|
|
|
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 L from "../static/styles/customEditorStyle.css.js";
|
|
1
|
+
import { useActionsApi as F } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as D } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as I } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as P } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useStripoEventHandler as U } from "./useStripoEventHandler.js";
|
|
6
|
+
import { useToaster as R } from "./useToaster.js";
|
|
7
|
+
import { localePatch as q } from "../config/i18n/index.js";
|
|
8
|
+
import { getDisplayConditions as x } from "../enums/displayConditions.js";
|
|
9
|
+
import { useStripoApi as H } from "../services/stripoApi.js";
|
|
10
|
+
import O from "../static/styles/customEditorStyle.css.js";
|
|
12
11
|
import { useEditorStore as C } from "../stores/editor.js";
|
|
13
|
-
import { dynamicContentToMergeTags as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
const { features:
|
|
17
|
-
var
|
|
18
|
-
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await
|
|
12
|
+
import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
|
|
13
|
+
import $ from "../package.json.js";
|
|
14
|
+
const ie = (E, c) => {
|
|
15
|
+
const { features: l, template: h, isFeatureEnabled: u } = I(), { handleError: m } = R(), { getToken: b, getCustomFonts: w, getSyncModulesStatus: k } = H(), { handleEvent: T } = U(), { getStripoBlocksConfig: V } = D(), _ = async (i, n = [], r = !1) => {
|
|
16
|
+
var f, y, S;
|
|
17
|
+
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(), g = ((f = l.value) == null ? void 0 : f.displayConditions) ?? !0, v = ((y = l.value) == null ? void 0 : y.modulesDisabled) ?? !1, M = ((S = h.value) == null ? void 0 : S.forceRecreate) ?? !1;
|
|
19
18
|
window.UIEditor.initEditor(
|
|
20
19
|
document.querySelector("#guido-editor"),
|
|
21
20
|
{
|
|
22
21
|
metadata: E,
|
|
23
22
|
html: p,
|
|
24
23
|
css: a,
|
|
25
|
-
forceRecreate:
|
|
24
|
+
forceRecreate: M,
|
|
26
25
|
locale: "en",
|
|
27
26
|
undoButtonSelector: "#guido__undo-button",
|
|
28
27
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -32,10 +31,10 @@ const se = (E, l) => {
|
|
|
32
31
|
customAppearanceMergetags: !u("liquidSyntax"),
|
|
33
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
34
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
35
|
-
customViewStyles:
|
|
36
|
-
conditionsEnabled:
|
|
37
|
-
customConditionsEnabled:
|
|
38
|
-
conditionCategories:
|
|
34
|
+
customViewStyles: O,
|
|
35
|
+
conditionsEnabled: g,
|
|
36
|
+
customConditionsEnabled: g,
|
|
37
|
+
conditionCategories: x(),
|
|
39
38
|
enableXSSSecurity: !0,
|
|
40
39
|
modulesDisabled: v,
|
|
41
40
|
syncModulesEnabled: r,
|
|
@@ -53,8 +52,8 @@ const se = (E, l) => {
|
|
|
53
52
|
},
|
|
54
53
|
mergeTags: [
|
|
55
54
|
{
|
|
56
|
-
entries:
|
|
57
|
-
|
|
55
|
+
entries: L(
|
|
56
|
+
c.preselectedDynamicContentList,
|
|
58
57
|
u("liquidSyntax")
|
|
59
58
|
)
|
|
60
59
|
}
|
|
@@ -69,8 +68,8 @@ const se = (E, l) => {
|
|
|
69
68
|
},
|
|
70
69
|
onTemplateLoaded() {
|
|
71
70
|
try {
|
|
72
|
-
const { importCss: t } =
|
|
73
|
-
t(), s(), A(),
|
|
71
|
+
const { importCss: t } = P(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: A } = F();
|
|
72
|
+
t(), s(), A(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
74
73
|
e.hasChanges = !1;
|
|
75
74
|
}, 1e3);
|
|
76
75
|
} catch (t) {
|
|
@@ -89,23 +88,23 @@ const se = (E, l) => {
|
|
|
89
88
|
onDataChanged() {
|
|
90
89
|
e.hasChanges = !0;
|
|
91
90
|
},
|
|
92
|
-
onEvent:
|
|
91
|
+
onEvent: T,
|
|
93
92
|
ignoreClickOutsideSelectors: [
|
|
94
93
|
"#guido-dynamic-content-modal",
|
|
95
94
|
".in-on-board-wrapper",
|
|
96
95
|
".in-drawer__container"
|
|
97
96
|
],
|
|
98
97
|
extensions: d,
|
|
99
|
-
localePatch:
|
|
98
|
+
localePatch: q
|
|
100
99
|
}
|
|
101
100
|
);
|
|
102
|
-
},
|
|
101
|
+
}, B = (i) => new Promise((n, r) => {
|
|
103
102
|
var d;
|
|
104
103
|
if (document.getElementById("UiEditorScript")) {
|
|
105
104
|
i(), n();
|
|
106
105
|
return;
|
|
107
106
|
}
|
|
108
|
-
const e =
|
|
107
|
+
const e = $.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");
|
|
109
108
|
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
110
109
|
i(), n();
|
|
111
110
|
}, o.onerror = () => {
|
|
@@ -113,15 +112,15 @@ const se = (E, l) => {
|
|
|
113
112
|
}, document.body.appendChild(o);
|
|
114
113
|
});
|
|
115
114
|
return { initPlugin: async (i) => {
|
|
116
|
-
await
|
|
115
|
+
await B(async () => {
|
|
117
116
|
const n = C(), [r, e] = await Promise.all([
|
|
118
117
|
w(),
|
|
119
118
|
k()
|
|
120
119
|
]);
|
|
121
|
-
n.syncModulesEnabled = e, await
|
|
120
|
+
n.syncModulesEnabled = e, await _(i, r, e);
|
|
122
121
|
});
|
|
123
122
|
} };
|
|
124
123
|
};
|
|
125
124
|
export {
|
|
126
|
-
|
|
125
|
+
ie as useStripo
|
|
127
126
|
};
|
|
@@ -1,80 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
import { useTranslations as i } from "../composables/useTranslations.js";
|
|
2
|
+
const t = () => {
|
|
3
|
+
const e = i();
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
category: e("journey-builder.demographics"),
|
|
7
|
+
conditions: [
|
|
8
|
+
{
|
|
9
|
+
id: 1,
|
|
10
|
+
name: e("condition.language"),
|
|
11
|
+
description: e("journey-builder.display-condition-language-description"),
|
|
12
|
+
beforeScript: '{% if language == "en_US" %}',
|
|
13
|
+
afterScript: "{% endif %}"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 2,
|
|
17
|
+
name: e("condition.country"),
|
|
18
|
+
description: e("journey-builder.display-condition-country-description"),
|
|
19
|
+
beforeScript: '{% if country == "Australia" %}',
|
|
20
|
+
afterScript: "{% endif %}"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 3,
|
|
24
|
+
name: e("stripo-editor.country-and-city"),
|
|
25
|
+
description: e("journey-builder.display-condition-country-city-description"),
|
|
26
|
+
beforeScript: '{% if country == "United Kingdom" and city == "London" %}',
|
|
27
|
+
afterScript: "{% endif %}"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 4,
|
|
31
|
+
name: e("stripo-editor.age-less-than-operator"),
|
|
32
|
+
description: e("journey-builder.display-condition-age-less-than"),
|
|
33
|
+
beforeScript: "{% if age < 18 %}",
|
|
34
|
+
afterScript: "{% endif %}"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 5,
|
|
38
|
+
name: e("stripo-editor.age-equal-greater-operator"),
|
|
39
|
+
description: e("journey-builder.display-condition-age-equal-greater"),
|
|
40
|
+
beforeScript: "{% if age >= 25 %}",
|
|
41
|
+
afterScript: "{% endif %}"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 6,
|
|
45
|
+
name: e("stripo-editor.age-greater-less-operators"),
|
|
46
|
+
description: e("journey-builder.display-condition-age-between"),
|
|
47
|
+
beforeScript: "{% if age > 18 and age < 25 %}",
|
|
48
|
+
afterScript: "{% endif %}"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 7,
|
|
52
|
+
name: e("condition.gender"),
|
|
53
|
+
description: e("journey-builder.display-condition-gender-female"),
|
|
54
|
+
beforeScript: '{% if gender == "Female" %}',
|
|
55
|
+
afterScript: "{% endif %}"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 8,
|
|
59
|
+
name: e("journey-builder.state"),
|
|
60
|
+
description: e("stripo-editor.state-description"),
|
|
61
|
+
beforeScript: '{% if c_state == "VIC" or c_state == "NSW" or c_state == "QLD" %}',
|
|
62
|
+
afterScript: "{% endif %}"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 9,
|
|
66
|
+
name: e("journey-builder.vip-user"),
|
|
67
|
+
description: e("stripo-editor.vip-user-description"),
|
|
68
|
+
beforeScript: "{% if c_is_vip_user %}",
|
|
69
|
+
afterScript: "{% endif %}"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 10,
|
|
73
|
+
name: e("journey-builder.membership-type"),
|
|
74
|
+
description: e("stripo-editor.membership-type-description"),
|
|
75
|
+
beforeScript: "{% if c_is_gold_member or c_is_silver_member %}",
|
|
76
|
+
afterScript: "{% endif %}"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
};
|
|
78
82
|
export {
|
|
79
|
-
|
|
83
|
+
t as getDisplayConditions
|
|
80
84
|
};
|
|
@@ -1,43 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
import { useTranslations as a } from "../../composables/useTranslations.js";
|
|
2
|
+
const u = {
|
|
2
3
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
|
|
3
|
-
},
|
|
4
|
+
}, l = {
|
|
4
5
|
CLIENT_ID: "clientId"
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
}, c = () => {
|
|
7
|
+
const e = a();
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
id: 11,
|
|
11
|
+
key: "similarViewed",
|
|
12
|
+
name: e("action-builder.similar-viewed"),
|
|
13
|
+
path: "viewed-together"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 12,
|
|
17
|
+
key: "similarBought",
|
|
18
|
+
name: e("action-builder.similar-bought"),
|
|
19
|
+
path: "purchased-together"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 13,
|
|
23
|
+
key: "userBased",
|
|
24
|
+
name: e("action-builder.user-based"),
|
|
25
|
+
path: "user-based"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 36,
|
|
29
|
+
key: "highestDiscounted",
|
|
30
|
+
name: e("journey-builder.highest-discounted-items"),
|
|
31
|
+
path: "highest-discounted"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 38,
|
|
35
|
+
key: "manualMerchandising",
|
|
36
|
+
name: e("action-builder.manual-merchandising"),
|
|
37
|
+
path: "manual-merchandising"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 39,
|
|
41
|
+
key: "newArrivals",
|
|
42
|
+
name: e("action-builder.new-arrivals"),
|
|
43
|
+
path: "new-arrivals"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 40,
|
|
47
|
+
key: "trendingProducts",
|
|
48
|
+
name: e("journey-builder.trending-products"),
|
|
49
|
+
path: "trending"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 46,
|
|
53
|
+
key: "mostValuableOfPartner",
|
|
54
|
+
name: e("journey-builder.most-valuable-products"),
|
|
55
|
+
path: "most-valuable"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 61,
|
|
59
|
+
key: "mostPopular",
|
|
60
|
+
name: e("journey-builder.most-popular-items"),
|
|
61
|
+
path: "most-popular"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 62,
|
|
65
|
+
key: "mostPurchased",
|
|
66
|
+
name: e("action-builder.most-purchased"),
|
|
67
|
+
path: "top-sellers"
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
}, d = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], m = [
|
|
17
71
|
{ text: "before the amount", value: "0" },
|
|
18
72
|
{ text: "after the amount", value: "1" }
|
|
19
|
-
],
|
|
73
|
+
], p = [
|
|
20
74
|
{ text: "dot(.)", value: "." },
|
|
21
75
|
{ text: "comma(,)", value: "," }
|
|
22
|
-
],
|
|
76
|
+
], v = [
|
|
23
77
|
{ text: "0", value: "0" },
|
|
24
78
|
{ text: "1", value: "1" },
|
|
25
79
|
{ text: "2", value: "2" },
|
|
26
80
|
{ text: "3", value: "3" },
|
|
27
81
|
{ text: "4", value: "4" },
|
|
28
82
|
{ text: "5", value: "5" }
|
|
29
|
-
],
|
|
83
|
+
], t = [
|
|
30
84
|
{ text: "is exactly", value: "=" },
|
|
31
85
|
{ text: "contains", value: "~" },
|
|
32
86
|
{ text: "does not contain", value: "!~" },
|
|
33
87
|
{ text: "any of", value: "||" }
|
|
34
|
-
],
|
|
88
|
+
], r = [
|
|
35
89
|
{ text: "is exactly", value: "=" },
|
|
36
90
|
{ text: "is not exactly", value: "!==" },
|
|
37
91
|
{ text: "contains", value: "~" },
|
|
38
92
|
{ text: "does not contain", value: "!~" },
|
|
39
93
|
{ text: "any of", value: "||" }
|
|
40
|
-
],
|
|
94
|
+
], n = [
|
|
41
95
|
{ text: "is equal to", value: "=" },
|
|
42
96
|
{ text: "is greater than", value: ">" },
|
|
43
97
|
{ text: "is less than", value: "<" }
|
|
@@ -45,39 +99,39 @@ const s = {
|
|
|
45
99
|
{ text: "is equal to", value: "=" },
|
|
46
100
|
{ text: "after", value: ">" },
|
|
47
101
|
{ text: "before", value: "<" }
|
|
48
|
-
],
|
|
102
|
+
], s = [
|
|
49
103
|
{ text: "true", value: "==" },
|
|
50
104
|
{ text: "false", value: "!=" }
|
|
51
|
-
],
|
|
52
|
-
if (!
|
|
53
|
-
return
|
|
54
|
-
switch (
|
|
105
|
+
], h = (e) => {
|
|
106
|
+
if (!e)
|
|
107
|
+
return t;
|
|
108
|
+
switch (e) {
|
|
55
109
|
case "Boolean":
|
|
56
|
-
return
|
|
110
|
+
return s;
|
|
57
111
|
case "Date":
|
|
58
112
|
return o;
|
|
59
113
|
case "Number":
|
|
60
|
-
return
|
|
114
|
+
return n;
|
|
61
115
|
case "String":
|
|
62
|
-
return
|
|
116
|
+
return t;
|
|
63
117
|
case "Strings":
|
|
64
|
-
return
|
|
118
|
+
return r;
|
|
65
119
|
default:
|
|
66
|
-
return
|
|
120
|
+
return t;
|
|
67
121
|
}
|
|
68
122
|
};
|
|
69
123
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
u as
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
124
|
+
d as PriceAttributes,
|
|
125
|
+
l as QUERY_PARAMS,
|
|
126
|
+
u as URLS,
|
|
127
|
+
v as currencyDecimalCounts,
|
|
128
|
+
m as currencyLocationMaps,
|
|
129
|
+
p as currencyOperators,
|
|
130
|
+
h as getOperatorOptions,
|
|
131
|
+
c as getRecommendationFeedSourceMaps,
|
|
132
|
+
r as operatorOptionsForArrayOfStrings,
|
|
133
|
+
s as operatorOptionsForBooleans,
|
|
80
134
|
o as operatorOptionsForDates,
|
|
81
|
-
|
|
82
|
-
|
|
135
|
+
n as operatorOptionsForNumbers,
|
|
136
|
+
t as operatorOptionsForStrings
|
|
83
137
|
};
|
|
@@ -8,22 +8,22 @@ const _ = {
|
|
|
8
8
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
9
9
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
10
10
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
11
|
-
}, n = R(),
|
|
11
|
+
}, n = R(), t = {
|
|
12
12
|
UNSUBSCRIBE_URL: `https://mail.${n}.com/user/v1/unsub`,
|
|
13
13
|
PREFERENCES_URL: `https://mail.${n}.com/user/v1/prefs`
|
|
14
|
-
},
|
|
15
|
-
name: "
|
|
16
|
-
sendGridId:
|
|
17
|
-
}, C = "/email/unsubscribe-pages", E = {
|
|
14
|
+
}, i = "iid", S = "G", B = () => ({
|
|
15
|
+
name: e()("onboarding-center.email-subscribers-global-unsub-card-title"),
|
|
16
|
+
sendGridId: S
|
|
17
|
+
}), C = "/email/unsubscribe-pages", E = {
|
|
18
18
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
19
19
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
20
20
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
21
21
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
22
22
|
RESUBSCRIBE: 5
|
|
23
|
-
},
|
|
23
|
+
}, c = {
|
|
24
24
|
[E.GLOBAL_UNSUBSCRIBE]: "custom-unsubscribe",
|
|
25
25
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "custom-preferences"
|
|
26
|
-
},
|
|
26
|
+
}, U = {
|
|
27
27
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
28
28
|
E.GLOBAL_UNSUBSCRIBE,
|
|
29
29
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -33,7 +33,7 @@ const _ = {
|
|
|
33
33
|
E.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
34
34
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
35
35
|
]
|
|
36
|
-
},
|
|
36
|
+
}, o = () => {
|
|
37
37
|
const s = e();
|
|
38
38
|
return {
|
|
39
39
|
[E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
|
|
@@ -42,21 +42,22 @@ const _ = {
|
|
|
42
42
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
|
|
43
43
|
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
44
44
|
};
|
|
45
|
-
},
|
|
45
|
+
}, u = {
|
|
46
46
|
default: "{{ins-unsubscribe-link}}",
|
|
47
47
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
48
48
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
49
49
|
};
|
|
50
50
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
S as DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID,
|
|
52
|
+
i as INSIDER_ID,
|
|
53
53
|
I as LINK_REGEXES,
|
|
54
54
|
_ as LINK_TYPES,
|
|
55
|
-
|
|
55
|
+
u as MERGE_TAGS,
|
|
56
56
|
E as PAGE_TYPES,
|
|
57
|
-
|
|
57
|
+
U as TYPE_COLLECTIONS,
|
|
58
58
|
C as UNSUBSCRIBE_PAGES_LINK,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
c as UNSUBSCRIBE_SYNC_MODULE_TYPES,
|
|
60
|
+
t as URLS,
|
|
61
|
+
B as getDefaultUnsubscribeGroup,
|
|
62
|
+
o as getTypeTranslations
|
|
62
63
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import {
|
|
6
|
-
import { Control as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var d = (i, n, e) => n in i ? E(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var o = (i, n, e) => d(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as l } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as L, DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID as h } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as p, UIElementType as r, UEAttr as t, ModificationDescription as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-checkbox", u = "select", { get: C } = l();
|
|
8
|
+
class I extends p {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
11
|
o(this, "currentNode");
|
|
@@ -13,13 +13,13 @@ class S extends h {
|
|
|
13
13
|
o(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
|
-
return
|
|
16
|
+
return b;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const e = this.currentNode.getAttribute("id");
|
|
21
21
|
if (e) {
|
|
22
|
-
const s = e ===
|
|
22
|
+
const s = e === h ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -29,18 +29,18 @@ class S extends h {
|
|
|
29
29
|
}
|
|
30
30
|
_getLabel(e, s = `${Math.random()}`) {
|
|
31
31
|
return `
|
|
32
|
-
<${
|
|
32
|
+
<${r.LABEL}
|
|
33
33
|
${t.LABEL.text}="${e}"
|
|
34
34
|
${t.LABEL.name}="${s}">
|
|
35
|
-
</${
|
|
35
|
+
</${r.LABEL}>
|
|
36
36
|
`;
|
|
37
37
|
}
|
|
38
38
|
_getSelectItem(e, s) {
|
|
39
39
|
return `
|
|
40
|
-
<${
|
|
40
|
+
<${r.SELECT_ITEM}
|
|
41
41
|
${t.SELECT_ITEM.text}="${e}"
|
|
42
42
|
${t.SELECT_ITEM.value}="${s}">
|
|
43
|
-
</${
|
|
43
|
+
</${r.SELECT_ITEM}>`;
|
|
44
44
|
}
|
|
45
45
|
_getSelect() {
|
|
46
46
|
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
@@ -49,22 +49,22 @@ class S extends h {
|
|
|
49
49
|
return `
|
|
50
50
|
<div class="checkbox-controls-container">
|
|
51
51
|
<div class="checkbox-select-container container two-columns stretch">
|
|
52
|
-
<${
|
|
52
|
+
<${r.LABEL}
|
|
53
53
|
${t.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
|
|
54
54
|
${t.LABEL.name}="${Math.random()}">
|
|
55
|
-
</${
|
|
55
|
+
</${r.LABEL}>
|
|
56
56
|
|
|
57
|
-
<${
|
|
57
|
+
<${r.SELECTPICKER}
|
|
58
58
|
${t.SELECTPICKER.name}="${u}"
|
|
59
59
|
${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
60
60
|
${this._getSelect()}
|
|
61
|
-
</${
|
|
61
|
+
</${r.SELECTPICKER}>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
64
|
`;
|
|
65
65
|
}
|
|
66
66
|
_onSelectChange(e) {
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new
|
|
67
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new m(`Updated text to ${e}`));
|
|
68
68
|
}
|
|
69
69
|
_listenToFormUpdates() {
|
|
70
70
|
this.api.onValueChanged(u, (e) => this._onSelectChange(e));
|
|
@@ -76,18 +76,18 @@ class S extends h {
|
|
|
76
76
|
async onRender() {
|
|
77
77
|
const e = await C(
|
|
78
78
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s = [
|
|
79
|
+
), s = [L(), ...e.data], c = s.map((a) => ({
|
|
80
80
|
[t.SELECT_ITEM.text]: a.name,
|
|
81
81
|
[t.SELECT_ITEM.value]: a.sendGridId
|
|
82
82
|
}));
|
|
83
83
|
this.unsubList = s, this.api.setUIEAttribute(
|
|
84
84
|
u,
|
|
85
85
|
t.SELECTPICKER.items,
|
|
86
|
-
|
|
86
|
+
c
|
|
87
87
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
b as CHECKBOX_CONTROL_BLOCK_ID,
|
|
92
|
+
I as CheckboxControl
|
|
93
93
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (r, n, t) =>
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import {
|
|
6
|
-
import { Control as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var d = (r, n, t) => n in r ? E(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
|
+
var o = (r, n, t) => d(r, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { useHttp as l } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as L, DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID as p } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as h, UIElementType as i, UEAttr as e, ModificationDescription as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-radio-button", u = "select", { get: $ } = l();
|
|
8
|
+
class I extends h {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
11
|
o(this, "currentNode");
|
|
@@ -13,13 +13,13 @@ class S extends p {
|
|
|
13
13
|
o(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
|
-
return
|
|
16
|
+
return b;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const t = this.currentNode.getAttribute("id");
|
|
21
21
|
if (t) {
|
|
22
|
-
const s = t ===
|
|
22
|
+
const s = t === p ? t : Number(t);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -64,7 +64,7 @@ class S extends p {
|
|
|
64
64
|
`;
|
|
65
65
|
}
|
|
66
66
|
_onSelectChange(t) {
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new
|
|
67
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new m(`Updated text to ${t}`));
|
|
68
68
|
}
|
|
69
69
|
_listenToFormUpdates() {
|
|
70
70
|
this.api.onValueChanged(u, (t) => this._onSelectChange(t));
|
|
@@ -76,18 +76,18 @@ class S extends p {
|
|
|
76
76
|
async onRender() {
|
|
77
77
|
const t = await $(
|
|
78
78
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s = [
|
|
79
|
+
), s = [L(), ...t.data], c = s.map((a) => ({
|
|
80
80
|
[e.SELECT_ITEM.text]: a.name,
|
|
81
81
|
[e.SELECT_ITEM.value]: a.sendGridId
|
|
82
82
|
}));
|
|
83
83
|
this.unsubList = s, this.api.setUIEAttribute(
|
|
84
84
|
u,
|
|
85
85
|
e.SELECTPICKER.items,
|
|
86
|
-
|
|
86
|
+
c
|
|
87
87
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
b as CONTROL_BLOCK_ID,
|
|
92
|
+
I as RadioButtonControl
|
|
93
93
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAttributes as k } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
|
|
3
3
|
import { useConfigStore as C } from "../../../../stores/config.js";
|
|
4
4
|
import { defineStore as G } from "pinia";
|
|
@@ -115,7 +115,7 @@ const v = () => ({
|
|
|
115
115
|
getActivePredictiveAlgorithms: (t) => {
|
|
116
116
|
const r = [];
|
|
117
117
|
return t.activePredictiveAlgorithms.filter((e) => !w.includes(e)).forEach((e) => {
|
|
118
|
-
r.push(...g.filter((n) => n.id === e));
|
|
118
|
+
r.push(...g().filter((n) => n.id === e));
|
|
119
119
|
}), r.map((e) => ({
|
|
120
120
|
text: e.name,
|
|
121
121
|
value: e.key
|
|
@@ -375,7 +375,7 @@ const v = () => ({
|
|
|
375
375
|
},
|
|
376
376
|
async _doFetchProducts() {
|
|
377
377
|
var p;
|
|
378
|
-
const t = this.currentRecommendationId, r = this.blockStates[t], { recommendationConfigs: e } = r, n = e.filters.filter((a) => a.isValid), c = b(n), i = ((p = g.find((a) => a.key === e.strategy)) == null ? void 0 : p.path) || "", o = C(), s = {
|
|
378
|
+
const t = this.currentRecommendationId, r = this.blockStates[t], { recommendationConfigs: e } = r, n = e.filters.filter((a) => a.isValid), c = b(n), i = ((p = g().find((a) => a.key === e.strategy)) == null ? void 0 : p.path) || "", o = C(), s = {
|
|
379
379
|
locale: e.language,
|
|
380
380
|
currency: e.currencySettings.value,
|
|
381
381
|
partnerName: o.partnerName,
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { ConditionCategories } from '@@/Types/condition-categories';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Get display conditions lazily so translations resolve at access time.
|
|
4
|
+
* Must be called within a Vue component context or after Pinia is initialized.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getDisplayConditions: () => ConditionCategories;
|
|
@@ -6,7 +6,11 @@ export declare const URLS: {
|
|
|
6
6
|
export declare const QUERY_PARAMS: {
|
|
7
7
|
CLIENT_ID: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Get recommendation feed source maps lazily so translated names resolve at access time.
|
|
11
|
+
* Must be called within a Vue component context or after Pinia is initialized.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getRecommendationFeedSourceMaps: () => RecommendationFeedItem[];
|
|
10
14
|
export declare const PriceAttributes: string[];
|
|
11
15
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
12
16
|
export declare const currencyOperators: TextValueObject[];
|
|
@@ -13,9 +13,14 @@ export declare const URLS: {
|
|
|
13
13
|
PREFERENCES_URL: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const INSIDER_ID = "iid";
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export declare const DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID = "G";
|
|
17
|
+
/**
|
|
18
|
+
* Get the default unsubscribe group lazily so the translated name resolves at access time.
|
|
19
|
+
* Must be called within a Vue component context or after Pinia is initialized.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getDefaultUnsubscribeGroup: () => {
|
|
22
|
+
name: string;
|
|
23
|
+
sendGridId: string;
|
|
19
24
|
};
|
|
20
25
|
export declare const UNSUBSCRIBE_PAGES_LINK = "/email/unsubscribe-pages";
|
|
21
26
|
export declare const PAGE_TYPES: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
3
|
+
"version": "3.2.0-beta.97c35ff",
|
|
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",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const f = (r, t) => {
|
|
2
|
-
const e = window[r];
|
|
3
|
-
return typeof e == "string" ? e : t;
|
|
4
|
-
}, m = (r) => {
|
|
5
|
-
const t = ((e, s, n) => {
|
|
6
|
-
if (t.q) {
|
|
7
|
-
t.q.push([e, s, n]);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
t._api(e, s, n);
|
|
11
|
-
});
|
|
12
|
-
return t.q = [], t.identify = (e, s, n) => {
|
|
13
|
-
t("user", { uid: e }, n), s && t("user", s, n);
|
|
14
|
-
}, t.setUserVars = (e, s) => t("user", e, s), t.event = (e, s, n) => t("event", { n: e, p: s }, n), t.anonymize = () => t.identify(!1), t.shutdown = () => t("rec", !1), t.restart = () => t("rec", !0), t.log = (e, s) => t("log", [e, s]), t.consent = (e) => t("consent", e ?? !0), t.identifyAccount = (e, s) => t("account", { ...s ?? {}, acctId: e }), t.clearUserCookie = () => {
|
|
15
|
-
}, t.setVars = (e, s) => t("setVars", [e, s]), t._w = { XMLHttpRequest: r.XMLHttpRequest, fetch: r.fetch }, t._v = "1.3.0", t;
|
|
16
|
-
}, F = () => ({ injectFullStory: async () => {
|
|
17
|
-
var d;
|
|
18
|
-
const t = f("_fs_org", "");
|
|
19
|
-
if (!t)
|
|
20
|
-
return;
|
|
21
|
-
const e = document.querySelector("ui-editor"), s = (d = e == null ? void 0 : e.shadowRoot) == null ? void 0 : d.querySelector("iframe"), n = s == null ? void 0 : s.contentWindow, i = s == null ? void 0 : s.contentDocument;
|
|
22
|
-
if (!n || !i)
|
|
23
|
-
return;
|
|
24
|
-
const h = f("_fs_host", "fullstory.com"), l = f("_fs_script", "edge.fullstory.com/s/fs.js"), u = f("_fs_namespace", "FS");
|
|
25
|
-
if (n[u])
|
|
26
|
-
return;
|
|
27
|
-
const a = window.fetch.bind(window), y = typeof n.fetch == "function" ? n.fetch.bind(n) : a, w = (o, p) => (typeof o == "string" || o instanceof URL ? String(o) : o.url).includes("fullstory.com") ? a(o, p) : y(o, p);
|
|
28
|
-
n.fetch = w, n._fs_run_in_iframe = !0, n._fs_host = h, n._fs_script = l, n._fs_org = t, n._fs_namespace = u, n[u] = m(n);
|
|
29
|
-
const g = await (await a(`https://${l}`)).text(), _ = URL.createObjectURL(new Blob([g], { type: "text/javascript" })), c = i.createElement("script");
|
|
30
|
-
c.src = _, c.crossOrigin = "anonymous", c.onload = () => URL.revokeObjectURL(_), i.head.appendChild(c);
|
|
31
|
-
} });
|
|
32
|
-
export {
|
|
33
|
-
F as useFullStoryBridge
|
|
34
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bridges FullStory from the parent window into the Stripo editor iframe.
|
|
3
|
-
*
|
|
4
|
-
* Stripo's iframe CSP allowlists neither inline FS snippets nor the
|
|
5
|
-
* edge.fullstory.com origin, so we: fetch fs.js in the parent context,
|
|
6
|
-
* hand the iframe a blob: URL (blob: is in script-src), and proxy the
|
|
7
|
-
* iframe's fetch through the parent so beacons bypass connect-src.
|
|
8
|
-
*/
|
|
9
|
-
export declare const useFullStoryBridge: () => {
|
|
10
|
-
injectFullStory: () => Promise<void>;
|
|
11
|
-
};
|