@useinsider/guido 3.2.0-beta.565bfaf → 3.2.0-beta.8b4780a
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/useActionsApi.js +4 -4
- package/dist/composables/useRecommendation.js +2 -2
- package/dist/composables/useSave.js +1 -1
- package/dist/composables/useStripo.js +6 -6
- package/dist/config/compiler/recommendationCompilerRules.js +72 -67
- 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/Items/controls/price/singlePrice.js +38 -38
- package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -3
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +324 -218
- package/dist/package.json.js +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- 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/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/package.json +3 -3
|
@@ -89,11 +89,11 @@ const v = () => {
|
|
|
89
89
|
updateHtmlAndCss: (t, e) => {
|
|
90
90
|
window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
|
|
91
91
|
},
|
|
92
|
-
editorSave: () => {
|
|
93
|
-
window.StripoEditorApi.actionsApi.save((
|
|
94
|
-
|
|
92
|
+
editorSave: () => new Promise((t) => {
|
|
93
|
+
window.StripoEditorApi.actionsApi.save((e) => {
|
|
94
|
+
e && n(e, "Failed to save template"), t();
|
|
95
95
|
});
|
|
96
|
-
}
|
|
96
|
+
})
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
export {
|
|
@@ -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");
|
|
@@ -19,7 +19,7 @@ const F = () => {
|
|
|
19
19
|
return;
|
|
20
20
|
if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t))
|
|
21
21
|
return;
|
|
22
|
-
c();
|
|
22
|
+
await c();
|
|
23
23
|
const { unsubscribePayload: f, stripoModules: v } = d(t.rawHtml);
|
|
24
24
|
return await u(f), t.modules = v, m || s(t), t;
|
|
25
25
|
} };
|
|
@@ -5,7 +5,7 @@ import { useCustomInterfaceAppearance as P } from "./useCustomInterfaceAppearanc
|
|
|
5
5
|
import { useStripoEventHandler as U } from "./useStripoEventHandler.js";
|
|
6
6
|
import { useToaster as R } from "./useToaster.js";
|
|
7
7
|
import { localePatch as q } from "../config/i18n/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { displayConditions as x } from "../enums/displayConditions.js";
|
|
9
9
|
import { useStripoApi as H } from "../services/stripoApi.js";
|
|
10
10
|
import O from "../static/styles/customEditorStyle.css.js";
|
|
11
11
|
import { useEditorStore as C } from "../stores/editor.js";
|
|
@@ -13,8 +13,8 @@ import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
|
|
|
13
13
|
import $ from "../package.json.js";
|
|
14
14
|
const ie = (E, c) => {
|
|
15
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
|
|
17
|
-
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(),
|
|
16
|
+
var g, y, S;
|
|
17
|
+
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await V(), f = ((g = l.value) == null ? void 0 : g.displayConditions) ?? !0, v = ((y = l.value) == null ? void 0 : y.modulesDisabled) ?? !1, M = ((S = h.value) == null ? void 0 : S.forceRecreate) ?? !1;
|
|
18
18
|
window.UIEditor.initEditor(
|
|
19
19
|
document.querySelector("#guido-editor"),
|
|
20
20
|
{
|
|
@@ -32,9 +32,9 @@ const ie = (E, c) => {
|
|
|
32
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
34
|
customViewStyles: O,
|
|
35
|
-
conditionsEnabled:
|
|
36
|
-
customConditionsEnabled:
|
|
37
|
-
conditionCategories: x
|
|
35
|
+
conditionsEnabled: f,
|
|
36
|
+
customConditionsEnabled: f,
|
|
37
|
+
conditionCategories: x,
|
|
38
38
|
enableXSSSecurity: !0,
|
|
39
39
|
modulesDisabled: v,
|
|
40
40
|
syncModulesEnabled: r,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useRecommendation as
|
|
2
|
-
import { DUMMY_IMAGE_MAPPINGS as
|
|
1
|
+
import { useRecommendation as C } from "../../composables/useRecommendation.js";
|
|
2
|
+
import { DUMMY_IMAGE_MAPPINGS as h, REGEX as T, VerticalOrientation as M, CSS as E, ATTRIBUTES as A, CONDITIONS as g, HTML as N } from "../../enums/recommendation.js";
|
|
3
3
|
import { prepareRecommendationBlocks as x } from "./utils/recommendationCompilerUtils.js";
|
|
4
4
|
const w = [
|
|
5
5
|
{
|
|
6
6
|
id: "replace-images-with-variable-names",
|
|
7
7
|
description: "Replacing dummy images with variable names in recommendation module",
|
|
8
8
|
type: "custom",
|
|
9
|
-
processor: (
|
|
10
|
-
let e =
|
|
11
|
-
return Object.entries(
|
|
12
|
-
Object.entries(
|
|
13
|
-
e = e.replaceAll(
|
|
9
|
+
processor: (c) => {
|
|
10
|
+
let e = c;
|
|
11
|
+
return Object.entries(h).forEach(([, l]) => {
|
|
12
|
+
Object.entries(l).forEach(([n, s]) => {
|
|
13
|
+
e = e.replaceAll(s, `{{${n}}}`);
|
|
14
14
|
});
|
|
15
15
|
}), e;
|
|
16
16
|
},
|
|
@@ -29,21 +29,21 @@ const w = [
|
|
|
29
29
|
id: "add-recommendation-unresponsive-css",
|
|
30
30
|
description: "Adding recommendation unresponsive css",
|
|
31
31
|
type: "custom",
|
|
32
|
-
processor: (
|
|
33
|
-
const { calculateCardWidth: e, getRecommendationCampaignData:
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
32
|
+
processor: (c) => {
|
|
33
|
+
const { calculateCardWidth: e, getRecommendationCampaignData: l } = C();
|
|
34
|
+
let n = c;
|
|
35
|
+
const s = n.match(T.ID);
|
|
36
|
+
if (s) {
|
|
37
37
|
const a = [];
|
|
38
|
-
if (
|
|
39
|
-
const d = /recommendation-id="(.*?)"/i.exec(
|
|
40
|
-
|
|
38
|
+
if (s.forEach((i) => {
|
|
39
|
+
const d = /recommendation-id="(.*?)"/i.exec(i), _ = d ? d[1].trim() : "", R = l(_);
|
|
40
|
+
R.textTrimming && R.orientation === M && a.push(e(R));
|
|
41
41
|
}), a.length) {
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const i = `width:${Math.min(...a)}px!important;`;
|
|
43
|
+
n = n.replace(E.REGULAR_NAME_HEIGHT, `${E.TRIMMED_NAME_HEIGHT} ${i} ${E.ELLIPSIS}`).replace(E.REGULAR_NAME_CONTAINER_HEIGHT, E.TRIMMED_NAME_CONTAINER_CSS).replace(E.RESPONSIVE_NAME_SIZE, `${E.RESPONSIVE_NAME_HEIGHT} ${i} ${E.ELLIPSIS}`).replace(E.RESPONSIVE_NAME_CONTAINER_HEIGHT, E.TRIMMED_RESPONSIVE_NAME_CONTAINER_CSS);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
return
|
|
46
|
+
return n;
|
|
47
47
|
},
|
|
48
48
|
priority: 52
|
|
49
49
|
},
|
|
@@ -51,34 +51,34 @@ const w = [
|
|
|
51
51
|
id: "prepare-recommendations",
|
|
52
52
|
description: "Replacing product data with template variables in recommendation blocks",
|
|
53
53
|
type: "custom",
|
|
54
|
-
processor: (
|
|
54
|
+
processor: (c) => x(c),
|
|
55
55
|
priority: 48
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
id: "add-discount-conditions",
|
|
59
59
|
description: "Adding discount conditions to the recommendation block",
|
|
60
60
|
type: "custom",
|
|
61
|
-
processor: (
|
|
62
|
-
let e =
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
const a =
|
|
61
|
+
processor: (c) => {
|
|
62
|
+
let e = c;
|
|
63
|
+
const l = e.match(T.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: n } = C();
|
|
64
|
+
return l !== null && l.forEach((s) => {
|
|
65
|
+
const a = s.match(T.CUSTOM_FIELD);
|
|
66
66
|
if (!a)
|
|
67
67
|
return;
|
|
68
|
-
const [
|
|
69
|
-
if (!d || !_ || !
|
|
68
|
+
const [i] = a, d = i.match(T.CUSTOM_FIELD_INDEXES_PART), _ = i.match(T.CUSTOM_FIELD_NAME_PART), R = s.match(T.ATTRIBUTE_PARAGRAPH_START_TAG);
|
|
69
|
+
if (!d || !_ || !R)
|
|
70
70
|
return;
|
|
71
|
-
const [
|
|
72
|
-
let t =
|
|
71
|
+
const [S] = d, [b] = _, [m] = R, o = b.substring(1, b.length - 2), r = m.match(T.COMPOSITION) !== null;
|
|
72
|
+
let t = i;
|
|
73
73
|
if (r) {
|
|
74
|
-
const
|
|
75
|
-
o ===
|
|
74
|
+
const I = S.substring(2, S.length - 3), p = n(I);
|
|
75
|
+
o === A.OMNIBUS_PRICE && (p.priceBeforeTextValue && (t = `${p.priceBeforeTextValue}${t}`), p.priceAfterTextValue && (t = `${t}${p.priceAfterTextValue}`)), o === A.OMNIBUS_DISCOUNT && (p.discountBeforeTextValue && (t = `${p.discountBeforeTextValue}${t}`), p.discountAfterTextValue && (t = `${t}${p.discountAfterTextValue}`));
|
|
76
76
|
}
|
|
77
|
-
const u =
|
|
77
|
+
const u = S.substring(2);
|
|
78
78
|
let f = "";
|
|
79
|
-
o in
|
|
80
|
-
const
|
|
81
|
-
e = e.replace(
|
|
79
|
+
o in g.IF && (f = g.IF[o].replaceAll(`{${A.DISCOUNT}}`, `${u}${A.DISCOUNT}`).replaceAll(`{${A.OMNIBUS_DISCOUNT}}`, `${u}${A.OMNIBUS_DISCOUNT}`).replaceAll(`{${A.OMNIBUS_PRICE}}`, `${u}${A.OMNIBUS_PRICE}`));
|
|
80
|
+
const $ = `${m}${t}${N.PARAGRAPH_END_TAG}`, y = `${f}${r ? $ : s}${g.ELSE}${m}${N.PARAGRAPH_END_TAG}${g.END_IF}`;
|
|
81
|
+
e = e.replace(s, y);
|
|
82
82
|
}), e;
|
|
83
83
|
},
|
|
84
84
|
priority: 53
|
|
@@ -95,19 +95,24 @@ const w = [
|
|
|
95
95
|
{
|
|
96
96
|
id: "strip-recommendation-editor-attributes",
|
|
97
97
|
description: "Strip editor-only attributes from compiled recommendation output",
|
|
98
|
-
type: "
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
type: "custom",
|
|
99
|
+
// Scoped to REC_START/REC_END markers so it cannot strip `product-attr`
|
|
100
|
+
// from Items block elements, which the items compiler rule depends on.
|
|
101
|
+
processor: (c) => {
|
|
102
|
+
const e = /\s+(?:esd-extension-block-id|data-attribute-type|data-visibility|data-text-before|data-text-after|product-attr|composition)="[^"]*"/g;
|
|
103
|
+
return c.replace(
|
|
104
|
+
/<!--REC_START-->([\s\S]*?)<!--REC_END-->/g,
|
|
105
|
+
(l, n) => `<!--REC_START-->${n.replace(e, "")}<!--REC_END-->`
|
|
106
|
+
);
|
|
107
|
+
},
|
|
103
108
|
priority: 55
|
|
104
109
|
},
|
|
105
110
|
{
|
|
106
111
|
id: "strip-unused-recommendation-classes",
|
|
107
112
|
description: "Remove CSS classes not referenced by any style rule from recommendation elements",
|
|
108
113
|
type: "custom",
|
|
109
|
-
processor: (
|
|
110
|
-
let e =
|
|
114
|
+
processor: (c) => {
|
|
115
|
+
let e = c.replace(
|
|
111
116
|
/ class="(?:product-card-segment|attribute-cell|recommendation-attribute-row|product-image|product-name|product-price|product-old-price|product-omnibus-price|product-omnibus-discount|product-button|recommendation-product-row|product-card-wrapper)"/g,
|
|
112
117
|
""
|
|
113
118
|
);
|
|
@@ -119,8 +124,8 @@ const w = [
|
|
|
119
124
|
id: "remove-empty-mobile-layout-artifacts",
|
|
120
125
|
description: "Remove empty mobile container rows and unused mobile layout CSS",
|
|
121
126
|
type: "custom",
|
|
122
|
-
processor: (
|
|
123
|
-
let e =
|
|
127
|
+
processor: (c) => {
|
|
128
|
+
let e = c;
|
|
124
129
|
return e = e.replace(
|
|
125
130
|
/<tr[^>]*class="ins-recommendation-mobile-row"[^>]*><\/tr>/g,
|
|
126
131
|
""
|
|
@@ -129,9 +134,9 @@ const w = [
|
|
|
129
134
|
""
|
|
130
135
|
), e = e.replace(
|
|
131
136
|
/@media[^{]*max-width\s*:\s*480px[^{]*\{((?:[^{}]*\{[^{}]*\})*[^{}]*)\}/g,
|
|
132
|
-
(
|
|
133
|
-
const
|
|
134
|
-
return
|
|
137
|
+
(l, n) => {
|
|
138
|
+
const s = n.match(/[^{}]+\{[^{}]*\}/g) || [], a = /ins-recommendation|product-image-cell|button-cell|product-info-cell/;
|
|
139
|
+
return s.every((d) => a.test(d)) ? "" : l;
|
|
135
140
|
}
|
|
136
141
|
)), e;
|
|
137
142
|
},
|
|
@@ -141,38 +146,38 @@ const w = [
|
|
|
141
146
|
id: "deduplicate-inline-styles",
|
|
142
147
|
description: "Replace repeated inline styles with CSS class references within recommendation blocks",
|
|
143
148
|
type: "custom",
|
|
144
|
-
processor: (
|
|
145
|
-
const e =
|
|
149
|
+
processor: (c) => {
|
|
150
|
+
const e = c.replace(
|
|
146
151
|
/<a\b[^>]*\bes-button\b[^>]*>/g,
|
|
147
152
|
(o) => o.replace(
|
|
148
153
|
/([;"]color:)([^;"]+)/g,
|
|
149
154
|
(r, t, u) => u.includes("!important") ? r : `${t}${u} !important`
|
|
150
155
|
)
|
|
151
|
-
),
|
|
152
|
-
let a =
|
|
156
|
+
), l = /<!--REC_START-->([\s\S]*?)<!--REC_END-->/g, n = / style="([^"]*)"/g, s = /* @__PURE__ */ new Map();
|
|
157
|
+
let a = l.exec(e);
|
|
153
158
|
for (; a !== null; ) {
|
|
154
|
-
let o =
|
|
159
|
+
let o = n.exec(a[1]);
|
|
155
160
|
for (; o !== null; ) {
|
|
156
161
|
const [, r] = o;
|
|
157
|
-
|
|
162
|
+
s.set(r, (s.get(r) || 0) + 1), o = n.exec(a[1]);
|
|
158
163
|
}
|
|
159
|
-
|
|
164
|
+
n.lastIndex = 0, a = l.exec(e);
|
|
160
165
|
}
|
|
161
|
-
const
|
|
166
|
+
const i = /* @__PURE__ */ new Map(), d = [];
|
|
162
167
|
let _ = 0;
|
|
163
|
-
if (
|
|
168
|
+
if (s.forEach((o, r) => {
|
|
164
169
|
if (o >= 6) {
|
|
165
170
|
const t = `rc${_++}`;
|
|
166
|
-
|
|
171
|
+
i.set(r, t), d.push(`.${t}{${r}}`);
|
|
167
172
|
}
|
|
168
|
-
}),
|
|
173
|
+
}), i.size === 0) {
|
|
169
174
|
let o = e;
|
|
170
175
|
return o = o.replaceAll("<!--REC_START-->", ""), o = o.replaceAll("<!--REC_END-->", ""), o;
|
|
171
176
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
const t =
|
|
175
|
-
|
|
177
|
+
const R = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), S = (o, r) => `${o.slice(0, -1)} ${r}"`, b = /* @__PURE__ */ new Map();
|
|
178
|
+
i.forEach((o, r) => {
|
|
179
|
+
const t = R(r);
|
|
180
|
+
b.set(r, {
|
|
176
181
|
caseA: new RegExp(`(class="[^"]*")((?:[^>]*?)) style="${t}"`, "g"),
|
|
177
182
|
caseB: new RegExp(` style="${t}"((?:[^>]*?))(class="[^"]*")`, "g")
|
|
178
183
|
});
|
|
@@ -182,14 +187,14 @@ const w = [
|
|
|
182
187
|
/<!--REC_START-->([\s\S]*?)<!--REC_END-->/g,
|
|
183
188
|
(o, r) => {
|
|
184
189
|
let t = r;
|
|
185
|
-
return
|
|
186
|
-
const
|
|
190
|
+
return i.forEach((u, f) => {
|
|
191
|
+
const $ = b.get(f);
|
|
187
192
|
t = t.replace(
|
|
188
|
-
|
|
189
|
-
(y,
|
|
193
|
+
$.caseA,
|
|
194
|
+
(y, I, p) => S(I, u) + p
|
|
190
195
|
), t = t.replace(
|
|
191
|
-
|
|
192
|
-
(y,
|
|
196
|
+
$.caseB,
|
|
197
|
+
(y, I, p) => I + S(p, u)
|
|
193
198
|
), t = t.replaceAll(` style="${f}"`, ` class="${u}"`);
|
|
194
199
|
}), t;
|
|
195
200
|
}
|
|
@@ -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
|
};
|