@useinsider/guido 3.2.0-beta.a14c305 → 3.2.0-beta.a49c53c
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/useFullStoryBridge.js +14 -0
- package/dist/composables/useRecommendation.js +2 -2
- package/dist/composables/useStripo.js +54 -54
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +33 -30
- package/dist/config/migrator/recommendationMigrator.js +1 -1
- package/dist/enums/displayConditions.js +78 -82
- package/dist/enums/extensions/recommendationBlock.js +41 -95
- package/dist/enums/unsubscribe.js +16 -17
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- 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 +31 -27
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/enums/displayConditions.d.ts +1 -5
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -5
- package/dist/src/enums/unsubscribe.d.ts +3 -8
- 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/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/static/templates/empty/style.css.js +0 -1
- package/package.json +3 -3
- package/dist/package.json.js +0 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const c = "https://email-static.useinsider.com/guido/guido-fs.js", u = () => ({ injectFullStory: () => {
|
|
2
|
+
var n;
|
|
3
|
+
const s = window;
|
|
4
|
+
if (typeof s._fs_org != "string" || !s._fs_org)
|
|
5
|
+
return;
|
|
6
|
+
const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
|
|
7
|
+
if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
|
|
8
|
+
return;
|
|
9
|
+
const t = e.createElement("script");
|
|
10
|
+
t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
|
|
11
|
+
} });
|
|
12
|
+
export {
|
|
13
|
+
u as useFullStoryBridge
|
|
14
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RecommendationFeedSourceMaps 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
|
|
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,79 +1,80 @@
|
|
|
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
|
|
14
|
-
const
|
|
15
|
-
const { features:
|
|
16
|
-
var
|
|
17
|
-
const e =
|
|
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 S } from "../stores/editor.js";
|
|
13
|
+
import { dynamicContentToMergeTags as z } from "../utils/genericUtil.js";
|
|
14
|
+
const ne = (y, a) => {
|
|
15
|
+
const { features: d, template: C, isFeatureEnabled: l } = P(), { handleError: c } = x(), { getToken: E, getCustomFonts: h, getSyncModulesStatus: w } = j(), { handleEvent: b } = q(), { getStripoBlocksConfig: B } = I(), T = async (i, r = [], n = !1) => {
|
|
16
|
+
var p, f, g;
|
|
17
|
+
const e = S(), { html: o, css: k } = i, { baseBlocks: u, extensions: F } = await B(), m = ((p = d.value) == null ? void 0 : p.displayConditions) ?? !0, M = ((f = d.value) == null ? void 0 : f.modulesDisabled) ?? !1, V = ((g = C.value) == null ? void 0 : g.forceRecreate) ?? !1;
|
|
18
18
|
window.UIEditor.initEditor(
|
|
19
19
|
document.querySelector("#guido-editor"),
|
|
20
20
|
{
|
|
21
|
-
metadata:
|
|
22
|
-
html:
|
|
23
|
-
css:
|
|
24
|
-
forceRecreate:
|
|
21
|
+
metadata: y,
|
|
22
|
+
html: o,
|
|
23
|
+
css: k,
|
|
24
|
+
forceRecreate: V,
|
|
25
25
|
locale: "en",
|
|
26
26
|
undoButtonSelector: "#guido__undo-button",
|
|
27
27
|
redoButtonSelector: "#guido__redo-button",
|
|
28
28
|
mobileViewButtonSelector: ".guido__view-option-selection-mobile",
|
|
29
29
|
desktopViewButtonSelector: ".guido__view-option-selection-desktop",
|
|
30
30
|
codeEditorButtonSelector: "#guido__code-button",
|
|
31
|
-
customAppearanceMergetags: !
|
|
31
|
+
customAppearanceMergetags: !l("liquidSyntax"),
|
|
32
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
|
-
customViewStyles:
|
|
35
|
-
conditionsEnabled:
|
|
36
|
-
customConditionsEnabled:
|
|
37
|
-
conditionCategories:
|
|
34
|
+
customViewStyles: L,
|
|
35
|
+
conditionsEnabled: m,
|
|
36
|
+
customConditionsEnabled: m,
|
|
37
|
+
conditionCategories: O,
|
|
38
38
|
enableXSSSecurity: !0,
|
|
39
|
-
modulesDisabled:
|
|
40
|
-
syncModulesEnabled:
|
|
39
|
+
modulesDisabled: M,
|
|
40
|
+
syncModulesEnabled: n,
|
|
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
|
-
|
|
47
|
+
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
48
|
+
...u ? { baseBlocks: u } : {},
|
|
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
|
-
|
|
57
|
-
|
|
56
|
+
entries: z(
|
|
57
|
+
a.preselectedDynamicContentList,
|
|
58
|
+
l("liquidSyntax")
|
|
58
59
|
)
|
|
59
60
|
}
|
|
60
61
|
],
|
|
61
62
|
async onTokenRefreshRequest(t) {
|
|
62
63
|
try {
|
|
63
|
-
const s = await
|
|
64
|
+
const s = await E();
|
|
64
65
|
t(s);
|
|
65
66
|
} catch (s) {
|
|
66
|
-
|
|
67
|
+
c(s, "Failed to refresh token");
|
|
67
68
|
}
|
|
68
69
|
},
|
|
69
70
|
onTemplateLoaded() {
|
|
70
71
|
try {
|
|
71
|
-
const { importCss: t } =
|
|
72
|
-
t(), s(), A(),
|
|
72
|
+
const { importCss: t } = U(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: v } = D(), { injectFullStory: A } = R();
|
|
73
|
+
t(), s(), A(), v(), a.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
73
74
|
e.hasChanges = !1;
|
|
74
75
|
}, 1e3);
|
|
75
76
|
} catch (t) {
|
|
76
|
-
|
|
77
|
+
c(t, "Failed to load custom interface appearance");
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
onCodeEditorVisibilityChanged(t) {
|
|
@@ -88,39 +89,38 @@ const ie = (E, c) => {
|
|
|
88
89
|
onDataChanged() {
|
|
89
90
|
e.hasChanges = !0;
|
|
90
91
|
},
|
|
91
|
-
onEvent:
|
|
92
|
+
onEvent: b,
|
|
92
93
|
ignoreClickOutsideSelectors: [
|
|
93
94
|
"#guido-dynamic-content-modal",
|
|
94
95
|
".in-on-board-wrapper",
|
|
95
96
|
".in-drawer__container"
|
|
96
97
|
],
|
|
97
|
-
extensions:
|
|
98
|
-
localePatch:
|
|
98
|
+
extensions: F,
|
|
99
|
+
localePatch: H
|
|
99
100
|
}
|
|
100
101
|
);
|
|
101
|
-
},
|
|
102
|
-
var d;
|
|
102
|
+
}, _ = (i) => new Promise((r, n) => {
|
|
103
103
|
if (document.getElementById("UiEditorScript")) {
|
|
104
|
-
i(),
|
|
104
|
+
i(), r();
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
const e =
|
|
108
|
-
o.id = "UiEditorScript", o.type = "module", o.src =
|
|
109
|
-
i(),
|
|
107
|
+
const e = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o = document.createElement("script");
|
|
108
|
+
o.id = "UiEditorScript", o.type = "module", o.src = e, o.onload = () => {
|
|
109
|
+
i(), r();
|
|
110
110
|
}, o.onerror = () => {
|
|
111
|
-
|
|
111
|
+
n(new Error(`Failed to load Stripo UIEditor script from S3: ${e}`));
|
|
112
112
|
}, document.body.appendChild(o);
|
|
113
113
|
});
|
|
114
114
|
return { initPlugin: async (i) => {
|
|
115
|
-
await
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
await _(async () => {
|
|
116
|
+
const r = S(), [n, e] = await Promise.all([
|
|
117
|
+
h(),
|
|
118
|
+
w()
|
|
119
119
|
]);
|
|
120
|
-
|
|
120
|
+
r.syncModulesEnabled = e, await T(i, n, e);
|
|
121
121
|
});
|
|
122
122
|
} };
|
|
123
123
|
};
|
|
124
124
|
export {
|
|
125
|
-
|
|
125
|
+
ne as useStripo
|
|
126
126
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useConfig as S } from "../../../composables/useConfig.js";
|
|
2
2
|
import { useRecommendation as _ } from "../../../composables/useRecommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as d } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
3
4
|
function y(e, u, r, o, s = "") {
|
|
4
5
|
const n = `{{${s}${e}_${u}_${r}}}`, t = `{{${s}${e}_${u}_currency}}`;
|
|
5
6
|
return o === "before" ? `${t} ${n}` : `${n} ${t}`;
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
+
function m(e, u, r, o, s, n) {
|
|
8
9
|
switch (u) {
|
|
9
10
|
case "productImage": {
|
|
10
11
|
const t = e.querySelector("img");
|
|
@@ -69,67 +70,69 @@ function p(e, u, r, o, s, n) {
|
|
|
69
70
|
default: {
|
|
70
71
|
const t = e.getAttribute("product-attr") ? e : e.querySelector("[product-attr]");
|
|
71
72
|
if (t) {
|
|
72
|
-
const c = t.getAttribute("product-attr"),
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
|
|
73
|
+
const c = t.getAttribute("product-attr"), a = t.querySelector("p");
|
|
74
|
+
if (a) {
|
|
75
|
+
const i = a.querySelector("strong") || a;
|
|
76
|
+
i.textContent = `{{${n}${r}_${o}_${c}}}`;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
break;
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function q(e, u, r, o) {
|
|
83
84
|
e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
|
|
84
|
-
n.querySelectorAll("[data-attribute-type]").forEach((
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
p
|
|
88
|
-
}) :
|
|
85
|
+
n.querySelectorAll("[data-attribute-type]").forEach((a) => {
|
|
86
|
+
const i = a.getAttribute("data-attribute-type") || "", l = a.querySelectorAll(".attribute-cell");
|
|
87
|
+
l.length > 0 ? l.forEach((p) => {
|
|
88
|
+
m(p, i, u, t, r, o);
|
|
89
|
+
}) : m(a, i, u, t, r, o);
|
|
89
90
|
});
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
+
function g(e, u, r, o) {
|
|
93
94
|
const s = e.querySelectorAll(".recommendation-product-row");
|
|
94
95
|
if (!s.length)
|
|
95
96
|
return;
|
|
96
97
|
const [n] = s, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
|
|
97
|
-
s.forEach((
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const A =
|
|
102
|
-
|
|
98
|
+
s.forEach((a, i) => {
|
|
99
|
+
a.querySelectorAll("[data-attribute-type]").forEach((p) => {
|
|
100
|
+
const b = p.getAttribute("data-attribute-type") || "";
|
|
101
|
+
p.querySelectorAll(".attribute-cell").forEach((f, $) => {
|
|
102
|
+
const A = i * c + $;
|
|
103
|
+
m(f, b, u, A, r, o);
|
|
103
104
|
});
|
|
104
105
|
});
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function h(e, u, r, o) {
|
|
108
109
|
e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
|
|
109
|
-
|
|
110
|
+
g(n, u, r, o);
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
+
function C(e, u, r) {
|
|
113
114
|
const o = e.getAttribute("data-layout") || "grid", s = e.getAttribute("currency-alignment") || "after";
|
|
114
|
-
o === "list" ?
|
|
115
|
+
o === "list" ? q(e, u, s, r) : h(e, u, s, r);
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
+
function E(e, u) {
|
|
117
118
|
const r = e.match(/<!DOCTYPE[^>]*>/i);
|
|
118
119
|
return (r ? `${r[0]}
|
|
119
120
|
` : "") + u.documentElement.outerHTML;
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function T(e) {
|
|
122
123
|
const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".recommendation-block-v2");
|
|
123
124
|
if (!o.length)
|
|
124
125
|
return e;
|
|
125
|
-
const { buildCampaignUrl: s } = _(),
|
|
126
|
+
const { buildCampaignUrl: s } = _(), n = d();
|
|
127
|
+
n.recommendationCampaignUrls = {};
|
|
128
|
+
const { isFeatureEnabled: t } = S(), c = t("liquidSyntax") ? "reco_" : "";
|
|
126
129
|
return o.forEach((i) => {
|
|
127
|
-
var
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
}),
|
|
130
|
+
var p, b;
|
|
131
|
+
const l = i.getAttribute("recommendation-id");
|
|
132
|
+
l && ((p = i.parentNode) == null || p.insertBefore(r.createComment("REC_START"), i), (b = i.parentNode) == null || b.insertBefore(r.createComment("REC_END"), i.nextSibling), s(l), C(i, l, c));
|
|
133
|
+
}), E(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
131
134
|
}
|
|
132
135
|
export {
|
|
133
136
|
y as formatPriceVariable,
|
|
134
|
-
|
|
137
|
+
T as prepareRecommendationBlocks
|
|
135
138
|
};
|
|
@@ -13,7 +13,7 @@ class B {
|
|
|
13
13
|
migrate(e) {
|
|
14
14
|
try {
|
|
15
15
|
const t = this.parser.parseFromString(e, "text/html"), s = t.querySelectorAll(
|
|
16
|
-
'td.ins-recommendation-v3-block-1, td.product-block[esd-handler-name*="EmailRecommendationV3"]'
|
|
16
|
+
'td.ins-recommendation-v3-block-1:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"]:not(.recommendation-block-v2)'
|
|
17
17
|
);
|
|
18
18
|
return w().$patch((i) => {
|
|
19
19
|
i.migrations = { ...i.migrations, [S]: s.length };
|
|
@@ -1,84 +1,80 @@
|
|
|
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
|
-
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
];
|
|
81
|
-
};
|
|
1
|
+
const e = [
|
|
2
|
+
{
|
|
3
|
+
category: "Demographics",
|
|
4
|
+
conditions: [
|
|
5
|
+
{
|
|
6
|
+
id: 1,
|
|
7
|
+
name: "Language",
|
|
8
|
+
description: "Users who are in the English will see the banner",
|
|
9
|
+
beforeScript: '{% if language == "en_US" %}',
|
|
10
|
+
afterScript: "{% endif %}"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 2,
|
|
14
|
+
name: "Country",
|
|
15
|
+
description: "Only people who live in Australia will see the banner",
|
|
16
|
+
beforeScript: '{% if country == "Australia" %}',
|
|
17
|
+
afterScript: "{% endif %}"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 3,
|
|
21
|
+
name: "Country & City",
|
|
22
|
+
description: "Only people who are located in that country and city",
|
|
23
|
+
beforeScript: '{% if country == "United Kingdom" and city == "London" %}',
|
|
24
|
+
afterScript: "{% endif %}"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 4,
|
|
28
|
+
name: "Age (Less than operator)",
|
|
29
|
+
description: "Users whose age is less than 18",
|
|
30
|
+
beforeScript: "{% if age < 18 %}",
|
|
31
|
+
afterScript: "{% endif %}"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 5,
|
|
35
|
+
name: "Age (Equal and greater than operator)",
|
|
36
|
+
description: "Users whose age is equal or greater than 25",
|
|
37
|
+
beforeScript: "{% if age >= 25 %}",
|
|
38
|
+
afterScript: "{% endif %}"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 6,
|
|
42
|
+
name: "Age (Greater than & less than operators)",
|
|
43
|
+
description: "Users whose age is between 18 and 25",
|
|
44
|
+
beforeScript: "{% if age > 18 and age < 25 %}",
|
|
45
|
+
afterScript: "{% endif %}"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 7,
|
|
49
|
+
name: "Gender",
|
|
50
|
+
description: "Users whose gender is Female",
|
|
51
|
+
beforeScript: '{% if gender == "Female" %}',
|
|
52
|
+
afterScript: "{% endif %}"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 8,
|
|
56
|
+
name: "State",
|
|
57
|
+
description: "Users whose state is one of the followings. c_state is a custom attribute. Use this condition if you have the attribute with the same naming. ",
|
|
58
|
+
beforeScript: '{% if c_state == "VIC" or c_state == "NSW" or c_state == "QLD" %}',
|
|
59
|
+
afterScript: "{% endif %}"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 9,
|
|
63
|
+
name: "VIP User",
|
|
64
|
+
description: "Users who are VIP users for that brand. c_is_vip_user = true. c_is_vip_user is a custom attribute. Use this condition if you have the attribute with the same naming.",
|
|
65
|
+
beforeScript: "{% if c_is_vip_user %}",
|
|
66
|
+
afterScript: "{% endif %}"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 10,
|
|
70
|
+
name: "Membership Type",
|
|
71
|
+
description: "Users who belong to gold or silver membership type. c_is_gold_member = true, c_is_silver_member = true. These are custom attributes. Use this condition if you have the attribute with the same naming.",
|
|
72
|
+
beforeScript: "{% if c_is_gold_member or c_is_silver_member %}",
|
|
73
|
+
afterScript: "{% endif %}"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
];
|
|
82
78
|
export {
|
|
83
|
-
|
|
79
|
+
e as displayConditions
|
|
84
80
|
};
|