@useinsider/guido 3.17.0-beta.dc7f4d2 → 3.17.0-beta.e6704da
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/README.md +1 -0
- package/dist/@types/config/schemas.js +12 -6
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +77 -77
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +70 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +55 -0
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +23 -46
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useCustomInterfaceAppearance.js +19 -16
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useSave.js +41 -84
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/config/migrator/recommendationMigrator.js +6 -4
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/recommendationBlock.js +25 -23
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +13 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +156 -154
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +141 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +223 -82
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +78 -29
- package/dist/src/@types/config/schemas.d.ts +12 -0
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/{validation/ValidationErrorDrawer.vue.d.ts → extensions/recommendation/AssignStrategyDrawer.vue.d.ts} +1 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +24 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +14 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +214 -15
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +43 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -5
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/static/styles/components/recommendation-strategy.css.js +171 -0
- package/dist/stores/config.js +6 -13
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/templatePreparation.js +50 -50
- package/package.json +2 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
- package/dist/composables/useSaveValidation.js +0 -279
- package/dist/composables/useSaveValidationRollout.js +0 -9
- package/dist/enums/save-validation.js +0 -4
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/stores/save-validation.js +0 -30
|
@@ -1,94 +1,51 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useSaveStart as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useSyncModuleExtractor as O } from "./useSyncModuleExtractor.js";
|
|
7
|
-
import { ToasterTypeOptions as W } from "../enums/toaster.js";
|
|
1
|
+
import { useActionsApi as T } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as k } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as B, useSaveComplete as E } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { ToasterTypeOptions as C } from "../enums/toaster.js";
|
|
8
6
|
import { useStripoApi as D } from "../services/stripoApi.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const n = A(), d = q(), { validateHtml: u } = K(), { validateLiquidSyntax: f } = X(), { validateCouponBlockTags: p } = Q(), { validateUnsubscribeBlockUniqueness: v, validateUnsubscribeBlockHasTemplate: y } = Y(), { callbacks: a, isFeatureEnabled: c } = L(), { extractSyncModuleData: S } = O(), { setSyncModuleUnsubscriptionPages: b } = D(), { editorSave: g, getTemplateData: w } = h(), { showToaster: H } = N(), { getBlockedDomains: V, resolveToast: C } = J(), { prepareTemplateDetails: m } = G(), { collectSaveValidationErrors: E } = M(), { isEnabled: x } = R(), k = z(), T = j(), B = F(), r = async (t, e, o) => {
|
|
21
|
-
if (!c("allowlistEnabled"))
|
|
22
|
-
return !1;
|
|
23
|
-
const i = await V(t, e);
|
|
24
|
-
if (!i.length)
|
|
25
|
-
return !1;
|
|
26
|
-
if (!o) {
|
|
27
|
-
const s = await C(i);
|
|
28
|
-
s != null && s.message && H({
|
|
29
|
-
type: W.Warning,
|
|
30
|
-
message: s.message,
|
|
31
|
-
actionButton: s.actionButton
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return !0;
|
|
35
|
-
}, P = async (t) => !p(t.compiledHtml) || !v(t.compiledHtml) || !y(t.compiledHtml) ? !1 : c("liquidSyntax") ? f(t.compiledHtml) : u(t.compiledHtml, t.dynamicContentList, !0), l = async (t, e) => {
|
|
36
|
-
if (!await g())
|
|
37
|
-
return;
|
|
38
|
-
const { unsubscribePayload: i, stripoModules: s } = S(t.rawHtml);
|
|
39
|
-
if (await b(i), t.modules = s, !e.suppress) {
|
|
40
|
-
const U = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
|
|
41
|
-
d({ ...t, ...U, silent: e.silent });
|
|
42
|
-
}
|
|
43
|
-
return t;
|
|
44
|
-
};
|
|
45
|
-
return { save: async (t = !1, e = !1) => {
|
|
46
|
-
var i;
|
|
7
|
+
import { useTemplatePreparation as L } from "../utils/templatePreparation.js";
|
|
8
|
+
import { useAllowlist as P } from "./useAllowlist.js";
|
|
9
|
+
import { useHtmlValidator as U } from "./useHtmlValidator.js";
|
|
10
|
+
import { useToaster as A } from "./useToaster.js";
|
|
11
|
+
import { useCouponBlockValidator as M } from "./validators/useCouponBlockValidator.js";
|
|
12
|
+
import { useLiquidValidator as h } from "./validators/useLiquidValidator.js";
|
|
13
|
+
import { useUnsubscribeBlockValidator as F } from "./validators/useUnsubscribeBlockValidator.js";
|
|
14
|
+
const $ = () => {
|
|
15
|
+
const n = B(), l = E(), { validateHtml: c } = U(), { validateLiquidSyntax: d } = h(), { validateCouponBlockTags: m } = M(), { validateUnsubscribeBlockUniqueness: u, validateUnsubscribeBlockHasTemplate: p } = F(), { callbacks: e, isFeatureEnabled: a } = k(), { extractSyncModuleData: f } = q(), { setSyncModuleUnsubscriptionPages: v } = D(), { editorSave: S } = T(), { showToaster: b } = A(), { getBlockedDomains: w, resolveToast: V } = P();
|
|
16
|
+
return { save: async (y = !1, s = !1) => {
|
|
17
|
+
var r;
|
|
47
18
|
n();
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
54
|
-
if (s.length) {
|
|
55
|
-
k.open(s, "save");
|
|
19
|
+
const { prepareTemplateDetails: H } = L(), t = await H();
|
|
20
|
+
if (!m(t.compiledHtml) || !u(t.compiledHtml) || !p(t.compiledHtml))
|
|
21
|
+
return;
|
|
22
|
+
if (a("liquidSyntax")) {
|
|
23
|
+
if (!await d(t.compiledHtml))
|
|
56
24
|
return;
|
|
57
|
-
|
|
58
|
-
} else if (!await P(o))
|
|
25
|
+
} else if (!await c(t.compiledHtml, t.dynamicContentList, !0))
|
|
59
26
|
return;
|
|
60
|
-
if (
|
|
61
|
-
return l(o, { silent: e, suppress: t });
|
|
62
|
-
}, saveWithErrors: async () => {
|
|
63
|
-
var e;
|
|
64
|
-
if (B.isTransactional)
|
|
27
|
+
if ((r = e.value) != null && r.externalValidation && !await e.value.externalValidation(t))
|
|
65
28
|
return;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
rawHtml: t,
|
|
79
|
-
css: e,
|
|
80
|
-
ampHtml: "",
|
|
81
|
-
ampErrors: [],
|
|
82
|
-
modules: [],
|
|
83
|
-
recommendation: { campaignUrls: {}, configs: {} },
|
|
84
|
-
unsubscribe: {
|
|
85
|
-
status: o.length > 0,
|
|
86
|
-
config: o
|
|
29
|
+
if (a("allowlistEnabled")) {
|
|
30
|
+
const i = await w(t.compiledHtml, t.css);
|
|
31
|
+
if (i.length) {
|
|
32
|
+
if (!s) {
|
|
33
|
+
const o = await V(i);
|
|
34
|
+
o != null && o.message && b({
|
|
35
|
+
type: C.Warning,
|
|
36
|
+
message: o.message,
|
|
37
|
+
actionButton: o.actionButton
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
87
41
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
42
|
+
}
|
|
43
|
+
if (!await S())
|
|
44
|
+
return;
|
|
45
|
+
const { unsubscribePayload: g, stripoModules: x } = f(t.rawHtml);
|
|
46
|
+
return await v(g), t.modules = x, y || l({ ...t, silent: s }), t;
|
|
90
47
|
} };
|
|
91
48
|
};
|
|
92
49
|
export {
|
|
93
|
-
|
|
50
|
+
$ as useSave
|
|
94
51
|
};
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
2
|
-
import { COUPON_PLACEHOLDER_DEFAULT as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
]),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}), !1) : !0 };
|
|
1
|
+
import { ToasterTypeOptions as c } from "../../enums/toaster.js";
|
|
2
|
+
import { COUPON_PLACEHOLDER_DEFAULT as i, COUPON_PLACEHOLDER_LIQUID as l } from "../../extensions/Blocks/CouponBlock/template.js";
|
|
3
|
+
import { useToaster as m } from "../useToaster.js";
|
|
4
|
+
import { useTranslations as p } from "../useTranslations.js";
|
|
5
|
+
const u = /* @__PURE__ */ new Set([
|
|
6
|
+
i,
|
|
7
|
+
l
|
|
8
|
+
]), A = () => {
|
|
9
|
+
const { showToaster: t } = m(), r = p();
|
|
10
|
+
return { validateCouponBlockTags: (e) => {
|
|
11
|
+
const n = new DOMParser().parseFromString(e, "text/html");
|
|
12
|
+
return Array.from(n.querySelectorAll(".coupon-block")).find((s) => {
|
|
13
|
+
var o;
|
|
14
|
+
const a = ((o = s.textContent) == null ? void 0 : o.trim()) ?? "";
|
|
15
|
+
return !u.has(a);
|
|
16
|
+
}) ? (t({
|
|
17
|
+
type: c.Warning,
|
|
18
|
+
message: r("newsletter.coupon-tag-modified")
|
|
19
|
+
}), !1) : !0;
|
|
20
|
+
} };
|
|
22
21
|
};
|
|
23
22
|
export {
|
|
24
|
-
|
|
25
|
-
u as findInvalidCouponBlocks,
|
|
26
|
-
T as useCouponBlockValidator
|
|
23
|
+
A as useCouponBlockValidator
|
|
27
24
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
1
|
+
import { ToasterTypeOptions as i } from "../../enums/toaster.js";
|
|
2
2
|
import { PAGE_TYPES as u } from "../../enums/unsubscribe.js";
|
|
3
|
-
import { UNSUBSCRIBE_BLOCK_SELECTOR as
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { useTranslations as
|
|
3
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as l, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
4
|
+
import { useToaster as E } from "../useToaster.js";
|
|
5
|
+
import { useTranslations as m } from "../useTranslations.js";
|
|
6
6
|
const T = [
|
|
7
7
|
{
|
|
8
8
|
pageType: u.GLOBAL_UNSUBSCRIBE,
|
|
@@ -12,37 +12,30 @@ const T = [
|
|
|
12
12
|
pageType: u.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
13
13
|
messageKey: "unsubscription-preference.duplicate-pref-center"
|
|
14
14
|
}
|
|
15
|
-
], g = "unsubscription-preference.duplicate-both",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return !n || !e;
|
|
28
|
-
}).length;
|
|
29
|
-
}
|
|
30
|
-
const y = () => {
|
|
31
|
-
const { showToaster: r } = p(), s = l();
|
|
32
|
-
return { validateUnsubscribeBlockUniqueness: (e) => {
|
|
33
|
-
const o = m(e);
|
|
34
|
-
return o.length ? (r({
|
|
35
|
-
type: c.Error,
|
|
36
|
-
message: s(o.length > 1 ? g : o[0].messageKey)
|
|
15
|
+
], g = "unsubscription-preference.duplicate-both", b = "unsubscription-preference.select-page-to-continue", P = () => {
|
|
16
|
+
const { showToaster: c } = E(), p = m();
|
|
17
|
+
return { validateUnsubscribeBlockUniqueness: (n) => {
|
|
18
|
+
const o = new DOMParser().parseFromString(n, "text/html"), r = /* @__PURE__ */ new Map();
|
|
19
|
+
o.querySelectorAll(l).forEach((e) => {
|
|
20
|
+
const s = Number(e.getAttribute(a.PAGE_TYPE));
|
|
21
|
+
r.set(s, (r.get(s) ?? 0) + 1);
|
|
22
|
+
});
|
|
23
|
+
const t = T.filter((e) => (r.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
|
|
24
|
+
return t.length ? (c({
|
|
25
|
+
type: i.Error,
|
|
26
|
+
message: p(t.length > 1 ? g : t[0])
|
|
37
27
|
}), !1) : !0;
|
|
38
|
-
}, validateUnsubscribeBlockHasTemplate: (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
}, validateUnsubscribeBlockHasTemplate: (n) => {
|
|
29
|
+
const o = new DOMParser().parseFromString(n, "text/html");
|
|
30
|
+
return Array.from(o.querySelectorAll(l)).some((t) => {
|
|
31
|
+
const e = t.getAttribute(a.PAGE_TYPE), s = t.getAttribute(a.PAGE_LIST);
|
|
32
|
+
return !e || !s;
|
|
33
|
+
}) ? (c({
|
|
34
|
+
type: i.Warning,
|
|
35
|
+
message: p(b)
|
|
36
|
+
}), !1) : !0;
|
|
37
|
+
} };
|
|
42
38
|
};
|
|
43
39
|
export {
|
|
44
|
-
|
|
45
|
-
b as countUnsubBlocksWithoutPage,
|
|
46
|
-
m as findDuplicateUnsubPageTypes,
|
|
47
|
-
y as useUnsubscribeBlockValidator
|
|
40
|
+
P as useUnsubscribeBlockValidator
|
|
48
41
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockId as f } from "../../enums/block.js";
|
|
2
|
-
import { useTemplateStore as
|
|
3
|
-
import { mapComposition as
|
|
2
|
+
import { useTemplateStore as y } from "../../stores/template.js";
|
|
3
|
+
import { mapComposition as b } from "./recommendation/compositionMapper.js";
|
|
4
4
|
import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
|
|
5
5
|
import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
|
|
6
6
|
import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
|
|
@@ -20,8 +20,10 @@ function B(i, t, a) {
|
|
|
20
20
|
), !1;
|
|
21
21
|
const n = a[String(o)] ?? {
|
|
22
22
|
currencySettings: v(t)
|
|
23
|
-
}, c = T(n, r, o), e =
|
|
23
|
+
}, c = T(n, r, o), e = b((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
|
|
24
24
|
...c,
|
|
25
|
+
// Legacy blocks predate RRS — never strategy-backed.
|
|
26
|
+
strategyId: "",
|
|
25
27
|
composition: e.composition,
|
|
26
28
|
visibility: e.visibility,
|
|
27
29
|
textTrimming: e.anyTextTrimming
|
|
@@ -56,7 +58,7 @@ function B(i, t, a) {
|
|
|
56
58
|
function q(i, t = {}) {
|
|
57
59
|
const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
|
|
58
60
|
try {
|
|
59
|
-
|
|
61
|
+
y().$patch((e) => {
|
|
60
62
|
e.migrations = {
|
|
61
63
|
...e.migrations,
|
|
62
64
|
[f.Recommendation]: r.length
|
package/dist/enums/academy.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const e = "https://academy.insiderone.com", o = {
|
|
2
2
|
EMAIL_EDITOR: `${e}/docs/email-drag-and-drop-editor`,
|
|
3
3
|
GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
|
|
4
|
-
AMP_FOR_EMAILS: `${e}/docs/amp-for-emails
|
|
4
|
+
AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`,
|
|
5
|
+
EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`
|
|
5
6
|
};
|
|
6
7
|
export {
|
|
7
8
|
o as ACADEMY_LINKS
|
package/dist/enums/date.js
CHANGED
|
@@ -2,10 +2,11 @@ import { useTranslations as r } from "../../composables/useTranslations.js";
|
|
|
2
2
|
const l = {
|
|
3
3
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
|
|
4
4
|
// Relative path → same-origin as the embedding inone dashboard.
|
|
5
|
-
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
|
|
6
|
-
|
|
5
|
+
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
|
|
6
|
+
RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies"
|
|
7
|
+
}, c = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", d = {
|
|
7
8
|
CLIENT_ID: "clientId"
|
|
8
|
-
},
|
|
9
|
+
}, m = () => {
|
|
9
10
|
const e = r();
|
|
10
11
|
return [
|
|
11
12
|
{
|
|
@@ -69,14 +70,14 @@ const l = {
|
|
|
69
70
|
path: "top-sellers"
|
|
70
71
|
}
|
|
71
72
|
];
|
|
72
|
-
},
|
|
73
|
+
}, p = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], v = [
|
|
73
74
|
{ text: "before the amount", value: "0" },
|
|
74
75
|
{ text: "after the amount", value: "1" }
|
|
75
|
-
],
|
|
76
|
+
], h = [
|
|
76
77
|
{ text: "dot(.)", value: "." },
|
|
77
78
|
{ text: "comma(,)", value: "," },
|
|
78
79
|
{ text: "space( )", value: " " }
|
|
79
|
-
],
|
|
80
|
+
], x = [
|
|
80
81
|
{ text: "0", value: "0" },
|
|
81
82
|
{ text: "1", value: "1" },
|
|
82
83
|
{ text: "2", value: "2" },
|
|
@@ -88,54 +89,55 @@ const l = {
|
|
|
88
89
|
{ text: "contains", value: "~" },
|
|
89
90
|
{ text: "does not contain", value: "!~" },
|
|
90
91
|
{ text: "any of", value: a }
|
|
91
|
-
],
|
|
92
|
+
], s = [
|
|
92
93
|
{ text: "is exactly", value: "=" },
|
|
93
94
|
{ text: "is not exactly", value: "!==" },
|
|
94
95
|
{ text: "contains", value: "~" },
|
|
95
96
|
{ text: "does not contain", value: "!~" },
|
|
96
97
|
{ text: "any of", value: a }
|
|
97
|
-
],
|
|
98
|
+
], n = [
|
|
98
99
|
{ text: "is equal to", value: "=" },
|
|
99
100
|
{ text: "is greater than", value: ">" },
|
|
100
101
|
{ text: "is less than", value: "<" }
|
|
101
|
-
],
|
|
102
|
+
], o = [
|
|
102
103
|
{ text: "is equal to", value: "=" },
|
|
103
104
|
{ text: "after", value: ">" },
|
|
104
105
|
{ text: "before", value: "<" }
|
|
105
106
|
], i = [
|
|
106
107
|
{ text: "true", value: "==" },
|
|
107
108
|
{ text: "false", value: "!=" }
|
|
108
|
-
],
|
|
109
|
+
], b = (e) => {
|
|
109
110
|
if (!e)
|
|
110
111
|
return t;
|
|
111
112
|
switch (e) {
|
|
112
113
|
case "Boolean":
|
|
113
114
|
return i;
|
|
114
115
|
case "Date":
|
|
115
|
-
return s;
|
|
116
|
-
case "Number":
|
|
117
116
|
return o;
|
|
117
|
+
case "Number":
|
|
118
|
+
return n;
|
|
118
119
|
case "String":
|
|
119
120
|
return t;
|
|
120
121
|
case "Strings":
|
|
121
|
-
return
|
|
122
|
+
return s;
|
|
122
123
|
default:
|
|
123
124
|
return t;
|
|
124
125
|
}
|
|
125
126
|
};
|
|
126
127
|
export {
|
|
127
128
|
a as OP_ANY_OF,
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
p as PriceAttributes,
|
|
130
|
+
d as QUERY_PARAMS,
|
|
131
|
+
c as RRS_ACTIVE_EMAIL_FILTER,
|
|
130
132
|
l as URLS,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
x as currencyDecimalCounts,
|
|
134
|
+
v as currencyLocationMaps,
|
|
135
|
+
h as currencyOperators,
|
|
136
|
+
b as getOperatorOptions,
|
|
137
|
+
m as getRecommendationFeedSourceMaps,
|
|
138
|
+
s as operatorOptionsForArrayOfStrings,
|
|
137
139
|
i as operatorOptionsForBooleans,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
o as operatorOptionsForDates,
|
|
141
|
+
n as operatorOptionsForNumbers,
|
|
140
142
|
t as operatorOptionsForStrings
|
|
141
143
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as
|
|
1
|
+
import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as a } from "./layout.js";
|
|
2
2
|
import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as i, ATTR_PRODUCT_BUTTON as I } from "./selectors.js";
|
|
3
|
-
const
|
|
3
|
+
const C = {
|
|
4
4
|
code: "USD",
|
|
5
5
|
symbol: "USD",
|
|
6
6
|
alignment: "after",
|
|
7
7
|
decimalCount: 2,
|
|
8
8
|
decimalSeparator: ".",
|
|
9
9
|
thousandSeparator: ","
|
|
10
|
-
},
|
|
10
|
+
}, D = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
|
-
},
|
|
13
|
+
}, O = {
|
|
14
14
|
textBefore: "",
|
|
15
15
|
textAfter: ""
|
|
16
16
|
}, A = [
|
|
@@ -36,11 +36,13 @@ const D = {
|
|
|
36
36
|
size: "6",
|
|
37
37
|
shuffleProducts: !1,
|
|
38
38
|
language: "en_US",
|
|
39
|
-
currency:
|
|
39
|
+
currency: C,
|
|
40
40
|
filters: [],
|
|
41
|
+
// Version NOT bumped: mergeWithDefaults() backfills '' for older configs.
|
|
42
|
+
strategyId: "",
|
|
41
43
|
// Layout
|
|
42
44
|
layout: "grid",
|
|
43
|
-
cardsInRow:
|
|
45
|
+
cardsInRow: a,
|
|
44
46
|
mobileCardsInRow: e,
|
|
45
47
|
mobileLayoutEnabled: !1,
|
|
46
48
|
previousMobileCardsInRow: e,
|
|
@@ -52,8 +54,8 @@ const D = {
|
|
|
52
54
|
composition: A,
|
|
53
55
|
visibility: c,
|
|
54
56
|
// Element settings
|
|
55
|
-
omnibusPrice:
|
|
56
|
-
omnibusDiscount:
|
|
57
|
+
omnibusPrice: D,
|
|
58
|
+
omnibusDiscount: O,
|
|
57
59
|
textTrimming: !1,
|
|
58
60
|
// Price placement (block-level, affects all cards)
|
|
59
61
|
// Default ON = current stacked look, so existing templates are unaffected.
|
|
@@ -71,10 +73,10 @@ const D = {
|
|
|
71
73
|
export {
|
|
72
74
|
m as CURRENT_CONFIG_VERSION,
|
|
73
75
|
A as DEFAULT_COMPOSITION,
|
|
74
|
-
|
|
76
|
+
C as DEFAULT_CURRENCY,
|
|
75
77
|
l as DEFAULT_NODE_CONFIG,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
O as DEFAULT_OMNIBUS_DISCOUNT,
|
|
79
|
+
D as DEFAULT_OMNIBUS_PRICE,
|
|
78
80
|
c as DEFAULT_VISIBILITY,
|
|
79
81
|
N as EXCLUDED_ALGORITHM_IDS
|
|
80
82
|
};
|