@useinsider/guido 3.17.0-beta.668ca65 → 3.17.0-beta.a18fbda
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 +5 -6
- package/dist/@types/config/schemas.js +6 -7
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +83 -83
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +54 -41
- package/dist/composables/useActionsApi.js +82 -67
- package/dist/composables/useAutoSave.js +31 -26
- package/dist/composables/useCustomInterfaceAppearance.js +38 -52
- package/dist/composables/useEditorLock.js +20 -0
- package/dist/composables/useGuidoStateBridge.js +37 -31
- package/dist/composables/useRecommendation.js +34 -41
- package/dist/composables/useSave.js +39 -36
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +4 -5
- package/dist/enums/academy.js +1 -2
- package/dist/enums/date.js +3 -5
- package/dist/enums/extensions/recommendationBlock.js +1 -3
- package/dist/extensions/Blocks/Recommendation/block.js +21 -26
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +166 -162
- package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +79 -165
- package/dist/extensions/Blocks/common-control.js +19 -22
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +30 -69
- package/dist/src/@types/config/schemas.d.ts +0 -2
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useEditorLock.d.ts +10 -0
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/enums/date.d.ts +0 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +4 -10
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -150
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/stores/save-as-template.d.ts +3 -4
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/templatePreparation.js +34 -35
- package/package.json +2 -3
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -21
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -105
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +0 -19
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +0 -62
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -124
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -16
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -2
- package/dist/static/assets/icons/line-change.svg.js +0 -5
- package/dist/static/assets/icons/line-delete.svg.js +0 -5
- package/dist/static/assets/icons/line-plus.svg.js +0 -5
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -155
|
@@ -1,51 +1,54 @@
|
|
|
1
1
|
import { useActionsApi as T } from "./useActionsApi.js";
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
const { prepareTemplateDetails: H } =
|
|
20
|
-
if (!
|
|
2
|
+
import { useConfig as B } from "./useConfig.js";
|
|
3
|
+
import { useEditorLock as q } from "./useEditorLock.js";
|
|
4
|
+
import { useSaveStart as C, useSaveComplete as L } from "./useGuidoActions.js";
|
|
5
|
+
import { useSyncModuleExtractor as D } from "./useSyncModuleExtractor.js";
|
|
6
|
+
import { ToasterTypeOptions as P } from "../enums/toaster.js";
|
|
7
|
+
import { useStripoApi as U } from "../services/stripoApi.js";
|
|
8
|
+
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
9
|
+
import { useAllowlist as M } from "./useAllowlist.js";
|
|
10
|
+
import { useHtmlValidator as h } from "./useHtmlValidator.js";
|
|
11
|
+
import { useToaster as F } from "./useToaster.js";
|
|
12
|
+
import { useCouponBlockValidator as O } from "./validators/useCouponBlockValidator.js";
|
|
13
|
+
import { useLiquidValidator as W } from "./validators/useLiquidValidator.js";
|
|
14
|
+
import { useUnsubscribeBlockValidator as j } from "./validators/useUnsubscribeBlockValidator.js";
|
|
15
|
+
const et = () => {
|
|
16
|
+
const l = C(), c = L(), { validateHtml: m } = h(), { validateLiquidSyntax: d } = W(), { validateCouponBlockTags: u } = O(), { validateUnsubscribeBlockUniqueness: p, validateUnsubscribeBlockHasTemplate: f } = j(), { callbacks: s, isFeatureEnabled: r } = B(), { extractSyncModuleData: v } = D(), { setSyncModuleUnsubscriptionPages: S } = U(), { editorSave: b } = T(), { showToaster: w } = F(), { getBlockedDomains: V, resolveToast: x } = M(), { runExclusive: y } = q(), E = async (a, e) => {
|
|
17
|
+
var n;
|
|
18
|
+
l();
|
|
19
|
+
const { prepareTemplateDetails: H } = A(), t = await H();
|
|
20
|
+
if (!u(t.compiledHtml) || !p(t.compiledHtml) || !f(t.compiledHtml))
|
|
21
21
|
return;
|
|
22
|
-
if (
|
|
22
|
+
if (r("liquidSyntax")) {
|
|
23
23
|
if (!await d(t.compiledHtml))
|
|
24
24
|
return;
|
|
25
|
-
} else if (!await
|
|
25
|
+
} else if (!await m(t.compiledHtml, t.dynamicContentList, !0))
|
|
26
26
|
return;
|
|
27
|
-
if ((
|
|
27
|
+
if ((n = s.value) != null && n.externalValidation && !await s.value.externalValidation(t))
|
|
28
28
|
return;
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
type:
|
|
36
|
-
message:
|
|
37
|
-
actionButton:
|
|
29
|
+
if (r("allowlistEnabled")) {
|
|
30
|
+
const o = await V(t.compiledHtml, t.css);
|
|
31
|
+
if (o.length) {
|
|
32
|
+
if (!e) {
|
|
33
|
+
const i = await x(o);
|
|
34
|
+
i != null && i.message && w({
|
|
35
|
+
type: P.Warning,
|
|
36
|
+
message: i.message,
|
|
37
|
+
actionButton: i.actionButton
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
if (!await
|
|
43
|
+
if (!await b())
|
|
44
44
|
return;
|
|
45
|
-
const { unsubscribePayload: g, stripoModules:
|
|
46
|
-
return await
|
|
47
|
-
}
|
|
45
|
+
const { unsubscribePayload: g, stripoModules: k } = v(t.rawHtml);
|
|
46
|
+
return await S(g), t.modules = k, a || c({ ...t, silent: e }), t;
|
|
47
|
+
};
|
|
48
|
+
return { save: (a = !1, e = !1) => y(
|
|
49
|
+
() => E(a, e)
|
|
50
|
+
) };
|
|
48
51
|
};
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
et as useSave
|
|
51
54
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as
|
|
1
|
+
import { CURRENT_CONFIG_VERSION as s, DEFAULT_CURRENCY as i } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
2
|
+
import { DEFAULT_CARDS_IN_ROW as m, DEFAULT_MOBILE_ROW_SPACING as p, DEFAULT_MOBILE_COLUMN_SPACING as d, DEFAULT_ROW_SPACING as f, DEFAULT_COLUMN_SPACING as S, DEFAULT_MOBILE_CARDS_IN_ROW as a } from "../../../extensions/Blocks/Recommendation/constants/layout.js";
|
|
3
3
|
import { mapLegacyStrategy as l } from "../../../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
4
4
|
function c(t) {
|
|
5
5
|
return t === "0" || t === 0 ? "before" : "after";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function I(t) {
|
|
8
8
|
if (typeof t == "number" && Number.isFinite(t))
|
|
9
9
|
return t;
|
|
10
10
|
if (typeof t == "string") {
|
|
@@ -14,13 +14,13 @@ function _(t) {
|
|
|
14
14
|
}
|
|
15
15
|
return i.decimalCount;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function _(t) {
|
|
18
18
|
return t === "." || t === "," || t === " " || t === "" ? t : ",";
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function N(t) {
|
|
21
21
|
return t === "." || t === "," || t === " " ? t : ".";
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function A(t) {
|
|
24
24
|
if (!t || typeof t != "object")
|
|
25
25
|
return { ...i };
|
|
26
26
|
const o = t, n = o.value ?? o.name ?? i.code, r = o.symbol ?? n;
|
|
@@ -28,18 +28,18 @@ function L(t) {
|
|
|
28
28
|
code: n,
|
|
29
29
|
symbol: r,
|
|
30
30
|
alignment: c(o.alignment),
|
|
31
|
-
decimalCount:
|
|
32
|
-
decimalSeparator:
|
|
33
|
-
thousandSeparator:
|
|
31
|
+
decimalCount: I(o.decimalCount),
|
|
32
|
+
decimalSeparator: N(o.decimalSeparator),
|
|
33
|
+
thousandSeparator: _(o.thousandSeparator)
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function L(t) {
|
|
37
37
|
return t === "horizontal" || t === "list" ? "list" : "grid";
|
|
38
38
|
}
|
|
39
39
|
function R(t) {
|
|
40
40
|
return l(t) || "mostPopular";
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function U(t, o, n) {
|
|
43
43
|
const r = o.rowCount ?? t.cardsInRow ?? m, u = o.totalCount ?? (typeof t.size == "string" ? parseInt(t.size) : t.size) ?? 6;
|
|
44
44
|
return {
|
|
45
45
|
recommendationId: n,
|
|
@@ -48,15 +48,15 @@ function O(t, o, n) {
|
|
|
48
48
|
size: String(u),
|
|
49
49
|
shuffleProducts: !!t.shuffleProducts,
|
|
50
50
|
language: t.language ?? "en_US",
|
|
51
|
-
currency:
|
|
51
|
+
currency: A(t.currencySettings),
|
|
52
52
|
filters: (t.filters ?? []).map((e) => ({ ...e })),
|
|
53
|
-
layout:
|
|
53
|
+
layout: L(t.orientation ?? o.orientation),
|
|
54
54
|
cardsInRow: r,
|
|
55
55
|
mobileCardsInRow: a,
|
|
56
56
|
mobileLayoutEnabled: !1,
|
|
57
57
|
previousMobileCardsInRow: a,
|
|
58
|
-
columnSpacing:
|
|
59
|
-
rowSpacing:
|
|
58
|
+
columnSpacing: S,
|
|
59
|
+
rowSpacing: f,
|
|
60
60
|
mobileColumnSpacing: d,
|
|
61
61
|
mobileRowSpacing: p,
|
|
62
62
|
omnibusPrice: { textBefore: "", textAfter: "" },
|
|
@@ -70,6 +70,6 @@ function O(t, o, n) {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
A as mapCurrency,
|
|
74
|
+
U as mapSettings
|
|
75
75
|
};
|
|
@@ -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 b } from "../../stores/template.js";
|
|
3
|
+
import { mapComposition as y } 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,9 +20,8 @@ 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 = y((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
|
|
24
24
|
...c,
|
|
25
|
-
strategyId: "",
|
|
26
25
|
composition: e.composition,
|
|
27
26
|
visibility: e.visibility,
|
|
28
27
|
textTrimming: e.anyTextTrimming
|
|
@@ -57,7 +56,7 @@ function B(i, t, a) {
|
|
|
57
56
|
function q(i, t = {}) {
|
|
58
57
|
const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
|
|
59
58
|
try {
|
|
60
|
-
|
|
59
|
+
b().$patch((e) => {
|
|
61
60
|
e.migrations = {
|
|
62
61
|
...e.migrations,
|
|
63
62
|
[f.Recommendation]: r.length
|
package/dist/enums/academy.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
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
|
|
5
|
-
EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`
|
|
4
|
+
AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`
|
|
6
5
|
};
|
|
7
6
|
export {
|
|
8
7
|
o as ACADEMY_LINKS
|
package/dist/enums/date.js
CHANGED
|
@@ -2,9 +2,7 @@ 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
|
-
RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
|
|
7
|
-
RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies"
|
|
5
|
+
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
|
|
8
6
|
}, c = {
|
|
9
7
|
CLIENT_ID: "clientId"
|
|
10
8
|
}, d = () => {
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
|
|
1
|
+
var B = Object.defineProperty;
|
|
2
|
+
var D = (a, c, t) => c in a ? B(a, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[c] = t;
|
|
3
|
+
var h = (a, c, t) => D(a, typeof c != "symbol" ? c + "" : c, t);
|
|
4
|
+
import { BlockId as R } from "../../../enums/block.js";
|
|
5
|
+
import { getMigrationBannerHtml as y } from "../../../utils/migrationBannerHtml.js";
|
|
7
6
|
import { Block as b, BlockCompositionType as A, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { ensureMobileCssRulesExist as h, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
|
|
7
|
+
import { regenerateMobileProductRows as C } from "./controls/main/utils.js";
|
|
8
|
+
import { ensureMobileCssRulesExist as p, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as E } from "./controls/mobileLayout/cssRules.js";
|
|
11
9
|
import { RecommendationConfigService as s } from "./services/configService.js";
|
|
12
10
|
import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
|
|
13
|
-
import { getDefaultTemplate as
|
|
14
|
-
import { useRecommendationBlockWarning as
|
|
15
|
-
const _ =
|
|
11
|
+
import { getDefaultTemplate as S } from "./templates/grid/template.js";
|
|
12
|
+
import { useRecommendationBlockWarning as M } from "./useRecommendationBlockWarning.js";
|
|
13
|
+
const _ = R.Recommendation, m = "recommendation-block-v2", u = "recommendation-id", I = "hide-price";
|
|
16
14
|
let k = !1;
|
|
17
|
-
class
|
|
15
|
+
class P extends b {
|
|
18
16
|
constructor() {
|
|
19
17
|
super();
|
|
20
18
|
/**
|
|
21
19
|
* Stores the ID generated in getTemplate() so onCreated() can reuse it.
|
|
22
20
|
* This avoids generating a new (different) ID in onCreated().
|
|
23
21
|
*/
|
|
24
|
-
|
|
22
|
+
h(this, "_pendingBlockId", null);
|
|
25
23
|
}
|
|
26
24
|
getId() {
|
|
27
25
|
return _;
|
|
@@ -41,7 +39,7 @@ class K extends b {
|
|
|
41
39
|
);
|
|
42
40
|
}
|
|
43
41
|
getSettingsPanelTitleHtml() {
|
|
44
|
-
return
|
|
42
|
+
return y(
|
|
45
43
|
_,
|
|
46
44
|
this.api.translate("Recommendation Block"),
|
|
47
45
|
this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
|
|
@@ -65,7 +63,7 @@ class K extends b {
|
|
|
65
63
|
*/
|
|
66
64
|
getTemplate() {
|
|
67
65
|
const t = this._generateNextId();
|
|
68
|
-
return this._pendingBlockId = t,
|
|
66
|
+
return this._pendingBlockId = t, S(t);
|
|
69
67
|
}
|
|
70
68
|
/**
|
|
71
69
|
* Called when a new block is dropped into the template
|
|
@@ -91,15 +89,12 @@ class K extends b {
|
|
|
91
89
|
const { config: n, wasFreshDrop: o } = s.initializeConfig(
|
|
92
90
|
this.api,
|
|
93
91
|
t,
|
|
94
|
-
{
|
|
95
|
-
recommendationId: i,
|
|
96
|
-
configVersion: D().isFeatureEnabled("reusableRecommendationStrategy") ? E : S
|
|
97
|
-
}
|
|
92
|
+
{ recommendationId: i }
|
|
98
93
|
), r = d();
|
|
99
94
|
if (r.setCurrentBlock(i), this._stampHidePrice(t, n.priceHideIfSameAsDiscounted), o) {
|
|
100
|
-
|
|
95
|
+
p(this.api);
|
|
101
96
|
const l = this._getBlockElement(t);
|
|
102
|
-
l && (f(this.api, l, !0),
|
|
97
|
+
l && (f(this.api, l, !0), C({
|
|
103
98
|
currentNode: t,
|
|
104
99
|
documentModifier: this.api.getDocumentModifier()
|
|
105
100
|
}));
|
|
@@ -126,11 +121,11 @@ class K extends b {
|
|
|
126
121
|
}
|
|
127
122
|
this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
|
|
128
123
|
try {
|
|
129
|
-
k || (
|
|
124
|
+
k || (p(this.api), k = !0);
|
|
130
125
|
const e = s.getConfig(t), i = this._getBlockElement(t);
|
|
131
126
|
if (i) {
|
|
132
127
|
const n = !e.mobileLayoutEnabled;
|
|
133
|
-
|
|
128
|
+
E(i) !== n && f(this.api, i, n);
|
|
134
129
|
}
|
|
135
130
|
} catch {
|
|
136
131
|
}
|
|
@@ -160,7 +155,7 @@ class K extends b {
|
|
|
160
155
|
*/
|
|
161
156
|
_warnIfMultipleBlocks() {
|
|
162
157
|
try {
|
|
163
|
-
|
|
158
|
+
M().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
|
|
164
159
|
} catch {
|
|
165
160
|
}
|
|
166
161
|
}
|
|
@@ -338,5 +333,5 @@ class K extends b {
|
|
|
338
333
|
}
|
|
339
334
|
export {
|
|
340
335
|
_ as BLOCK_ID,
|
|
341
|
-
|
|
336
|
+
P as RecommendationBlock
|
|
342
337
|
};
|
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import { DEFAULT_COLUMN_SPACING as
|
|
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
|
|
3
|
-
const
|
|
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 C } from "./layout.js";
|
|
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 D = {
|
|
4
4
|
code: "USD",
|
|
5
5
|
symbol: "USD",
|
|
6
6
|
alignment: "after",
|
|
7
7
|
decimalCount: 2,
|
|
8
8
|
decimalSeparator: ".",
|
|
9
9
|
thousandSeparator: ","
|
|
10
|
-
},
|
|
10
|
+
}, O = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
|
-
},
|
|
13
|
+
}, a = {
|
|
14
14
|
textBefore: "",
|
|
15
15
|
textAfter: ""
|
|
16
|
-
},
|
|
16
|
+
}, A = [
|
|
17
17
|
o,
|
|
18
18
|
t,
|
|
19
19
|
_,
|
|
20
20
|
T,
|
|
21
21
|
r,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
],
|
|
22
|
+
i,
|
|
23
|
+
I
|
|
24
|
+
], c = {
|
|
25
25
|
[o]: !0,
|
|
26
26
|
[t]: !0,
|
|
27
27
|
[T]: !0,
|
|
28
28
|
[_]: !0,
|
|
29
29
|
[r]: !1,
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
},
|
|
30
|
+
[i]: !1,
|
|
31
|
+
[I]: !0
|
|
32
|
+
}, l = {
|
|
33
33
|
// Settings
|
|
34
34
|
strategy: "mostPopular",
|
|
35
35
|
productIds: [],
|
|
36
36
|
size: "6",
|
|
37
37
|
shuffleProducts: !1,
|
|
38
38
|
language: "en_US",
|
|
39
|
-
currency:
|
|
39
|
+
currency: D,
|
|
40
40
|
filters: [],
|
|
41
|
-
strategyId: "",
|
|
42
41
|
// Layout
|
|
43
42
|
layout: "grid",
|
|
44
|
-
cardsInRow:
|
|
43
|
+
cardsInRow: C,
|
|
45
44
|
mobileCardsInRow: e,
|
|
46
45
|
mobileLayoutEnabled: !1,
|
|
47
46
|
previousMobileCardsInRow: e,
|
|
48
|
-
columnSpacing:
|
|
49
|
-
rowSpacing:
|
|
50
|
-
mobileColumnSpacing:
|
|
51
|
-
mobileRowSpacing:
|
|
47
|
+
columnSpacing: n,
|
|
48
|
+
rowSpacing: s,
|
|
49
|
+
mobileColumnSpacing: U,
|
|
50
|
+
mobileRowSpacing: R,
|
|
52
51
|
// Composition
|
|
53
|
-
composition:
|
|
54
|
-
visibility:
|
|
52
|
+
composition: A,
|
|
53
|
+
visibility: c,
|
|
55
54
|
// Element settings
|
|
56
|
-
omnibusPrice:
|
|
57
|
-
omnibusDiscount:
|
|
55
|
+
omnibusPrice: O,
|
|
56
|
+
omnibusDiscount: a,
|
|
58
57
|
textTrimming: !1,
|
|
59
58
|
// Price placement (block-level, affects all cards)
|
|
60
59
|
// Default ON = current stacked look, so existing templates are unaffected.
|
|
@@ -64,17 +63,18 @@ const C = 1, l = 2, a = {
|
|
|
64
63
|
// of "false" (the actual hiding happens server-side at send).
|
|
65
64
|
priceHideIfSameAsDiscounted: !1,
|
|
66
65
|
// Meta
|
|
67
|
-
|
|
66
|
+
// Version NOT bumped: mergeWithDefaults() backfills the two new fields from
|
|
67
|
+
// defaults, so no data transform (and no needsMigration trigger) is required.
|
|
68
|
+
configVersion: 1,
|
|
68
69
|
recommendationId: 0
|
|
69
|
-
},
|
|
70
|
+
}, N = [11, 12], m = 1;
|
|
70
71
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
C as PRE_RRS_CONFIG_VERSION
|
|
72
|
+
m as CURRENT_CONFIG_VERSION,
|
|
73
|
+
A as DEFAULT_COMPOSITION,
|
|
74
|
+
D as DEFAULT_CURRENCY,
|
|
75
|
+
l as DEFAULT_NODE_CONFIG,
|
|
76
|
+
a as DEFAULT_OMNIBUS_DISCOUNT,
|
|
77
|
+
O as DEFAULT_OMNIBUS_PRICE,
|
|
78
|
+
c as DEFAULT_VISIBILITY,
|
|
79
|
+
N as EXCLUDED_ALGORITHM_IDS
|
|
80
80
|
};
|