@useinsider/guido 3.17.0-beta.77567eb → 3.17.0-beta.7cd51e2
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 +7 -6
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +82 -76
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
- package/dist/composables/useCustomInterfaceAppearance.js +52 -38
- package/dist/composables/useHttp.js +47 -41
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useStripo.js +14 -14
- package/dist/config/i18n/en/labels.json.js +1 -1
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +31 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +5 -3
- package/dist/enums/extensions/recommendationBlock.js +3 -1
- package/dist/extensions/Blocks/Recommendation/block.js +35 -29
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +241 -180
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +175 -79
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +69 -30
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +176 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +28 -27
- package/dist/utils/templatePreparation.js +35 -34
- package/package.json +3 -2
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import { BlockId as f } from "../../enums/block.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DEFAULT_NODE_CONFIG as b } from "../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
3
|
+
import { ATTR_RECOMMENDATION_TITLE as y } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
4
|
+
import { useTemplateStore as T } from "../../stores/template.js";
|
|
5
|
+
import { mapComposition as v } from "./recommendation/compositionMapper.js";
|
|
6
|
+
import { extractCurrencyFromBlock as C, extractTitleText as M, hasVisibleTitle as R, extractCardBgColor as S, isPartnerManagedBlock as h } from "./recommendation/extractors.js";
|
|
5
7
|
import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
|
|
6
|
-
import { parseRecommendationId as x, parseLegacyConfig as
|
|
7
|
-
import { mapSettings as
|
|
8
|
-
const
|
|
9
|
-
function B(
|
|
10
|
-
var
|
|
8
|
+
import { parseRecommendationId as x, parseLegacyConfig as E } from "./recommendation/parseLegacyConfig.js";
|
|
9
|
+
import { mapSettings as A } from "./recommendation/settingsMapper.js";
|
|
10
|
+
const H = 'td[esd-dev-product-config][class*="ins-recommendation-v3-block-"]:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"][esd-dev-product-config]:not(.recommendation-block-v2)';
|
|
11
|
+
function B(n, t, a) {
|
|
12
|
+
var l;
|
|
11
13
|
const o = x(t);
|
|
12
14
|
if (o === null)
|
|
13
15
|
return console.warn(
|
|
14
16
|
"[RecommendationMigrator] Skipping block — missing/invalid `ins-recommendation-v3-campaign-id`"
|
|
15
17
|
), !1;
|
|
16
|
-
const r =
|
|
18
|
+
const r = E(t);
|
|
17
19
|
if (!r)
|
|
18
20
|
return console.warn(
|
|
19
21
|
`[RecommendationMigrator] Aborting block id=${o} — \`esd-dev-product-config\` missing or unable to be parsed`
|
|
20
22
|
), !1;
|
|
21
|
-
const
|
|
22
|
-
currencySettings:
|
|
23
|
-
}, c =
|
|
23
|
+
const i = a[String(o)] ?? {
|
|
24
|
+
currencySettings: C(t)
|
|
25
|
+
}, c = A(i, r, o), e = v((l = r.composition) == null ? void 0 : l.variables), d = M(t);
|
|
26
|
+
e.titleVariable || (e.visibility[y] = R(t));
|
|
27
|
+
const p = S(t), g = {
|
|
24
28
|
...c,
|
|
29
|
+
strategyId: "",
|
|
25
30
|
composition: e.composition,
|
|
26
31
|
visibility: e.visibility,
|
|
32
|
+
previousTitleHtml: b.previousTitleHtml,
|
|
27
33
|
textTrimming: e.anyTextTrimming
|
|
28
|
-
}, m =
|
|
34
|
+
}, m = h(t), u = `
|
|
29
35
|
<table>
|
|
30
36
|
<tbody>
|
|
31
37
|
<tr>
|
|
@@ -33,10 +39,10 @@ function B(i, t, a) {
|
|
|
33
39
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
34
40
|
<tbody>
|
|
35
41
|
<tr>${w({
|
|
36
|
-
nodeConfig:
|
|
42
|
+
nodeConfig: g,
|
|
37
43
|
composition: e,
|
|
38
|
-
cardBg:
|
|
39
|
-
titleText:
|
|
44
|
+
cardBg: p,
|
|
45
|
+
titleText: d,
|
|
40
46
|
legacyId: t.getAttribute("id") ?? void 0,
|
|
41
47
|
legacyBgColor: t.getAttribute("bgcolor") ?? void 0,
|
|
42
48
|
preserveInnerHtml: m ? t.innerHTML : void 0,
|
|
@@ -48,15 +54,15 @@ function B(i, t, a) {
|
|
|
48
54
|
</tr>
|
|
49
55
|
</tbody>
|
|
50
56
|
</table>
|
|
51
|
-
`, s =
|
|
57
|
+
`, s = n.parseFromString(u, "text/html").querySelector("td.esd-structure");
|
|
52
58
|
return !s || !t.parentNode ? (console.warn(
|
|
53
59
|
`[RecommendationMigrator] Aborting block id=${o} — failed to construct new HTML element`
|
|
54
60
|
), !1) : (t.parentNode.replaceChild(s, t), !0);
|
|
55
61
|
}
|
|
56
|
-
function
|
|
57
|
-
const a = new DOMParser(), o = a.parseFromString(
|
|
62
|
+
function G(n, t = {}) {
|
|
63
|
+
const a = new DOMParser(), o = a.parseFromString(n, "text/html"), r = Array.from(o.querySelectorAll(H));
|
|
58
64
|
try {
|
|
59
|
-
|
|
65
|
+
T().$patch((e) => {
|
|
60
66
|
e.migrations = {
|
|
61
67
|
...e.migrations,
|
|
62
68
|
[f.Recommendation]: r.length
|
|
@@ -65,16 +71,16 @@ function q(i, t = {}) {
|
|
|
65
71
|
} catch {
|
|
66
72
|
}
|
|
67
73
|
if (r.length === 0)
|
|
68
|
-
return
|
|
69
|
-
let
|
|
74
|
+
return n;
|
|
75
|
+
let i = 0;
|
|
70
76
|
return r.forEach((c) => {
|
|
71
77
|
try {
|
|
72
|
-
B(a, c, t) && (
|
|
78
|
+
B(a, c, t) && (i += 1);
|
|
73
79
|
} catch (e) {
|
|
74
80
|
console.error("[RecommendationMigrator] Unexpected error migrating block:", e);
|
|
75
81
|
}
|
|
76
|
-
}),
|
|
82
|
+
}), i > 0 && console.info(`[RecommendationMigrator] Migrated ${i} legacy Recommendation block(s)`), o.documentElement.outerHTML;
|
|
77
83
|
}
|
|
78
84
|
export {
|
|
79
|
-
|
|
85
|
+
G as migrateRecommendation
|
|
80
86
|
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var f = (s, t, e) => t in s ? R(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var a = (s, t, e) => f(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { RecommendationBlockId as d } from "../../extensions/Blocks/Recommendation/constants/blockIds.js";
|
|
5
|
+
import { BLOCK_ROOT_SELECTOR as u, CSS_CLASS_SKIP_COMPILE as m, ATTR_DATA_ATTRIBUTE_TYPE as S, ATTR_RECOMMENDATION_TITLE as l, CONTAINER_SELECTOR as E, CSS_CLASS_TITLE_CELL as c, CSS_CLASS_SPACER as C, CSS_CLASS_ATTRIBUTE_ROW as A, ATTR_DATA_VISIBILITY as L } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
6
|
+
const p = u.slice(1), g = `${u}:not(.${m})`, O = `[${S}="${l}"]`, h = "td.esd-block-text", _ = "table.container > tbody", T = "esd-ext-config";
|
|
7
|
+
class y {
|
|
8
|
+
constructor() {
|
|
9
|
+
a(this, "parser");
|
|
10
|
+
this.parser = new DOMParser();
|
|
11
|
+
}
|
|
12
|
+
migrate(t) {
|
|
13
|
+
try {
|
|
14
|
+
if (!t.includes(p))
|
|
15
|
+
return t;
|
|
16
|
+
const e = this.parser.parseFromString(t, "text/html");
|
|
17
|
+
return Array.from(e.querySelectorAll(g)).reduce(
|
|
18
|
+
(n, o) => this._migrateBlock(o) || n,
|
|
19
|
+
!1
|
|
20
|
+
) ? e.documentElement.outerHTML : t;
|
|
21
|
+
} catch (e) {
|
|
22
|
+
return console.error("RecommendationTitleMigrator failed:", e), t;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Migrates one block. Returns `true` when the block was changed. */
|
|
26
|
+
_migrateBlock(t) {
|
|
27
|
+
if (t.querySelector(O) || this._hasRecordedTitleState(t))
|
|
28
|
+
return !1;
|
|
29
|
+
const e = this._findTitleCell(t), i = e !== null && (e.textContent ?? "").trim().length > 0;
|
|
30
|
+
return i ? this._tagExistingTitle(t, e) : this._removeTitleRemnants(t, e), this._writeVisibility(t, i), !0;
|
|
31
|
+
}
|
|
32
|
+
/** The only `esd-block-text` cell outside the product containers is the title. */
|
|
33
|
+
_findTitleCell(t) {
|
|
34
|
+
return Array.from(t.querySelectorAll(h)).find((e) => !e.closest(E) && this._isTitlePosition(t, e)) ?? null;
|
|
35
|
+
}
|
|
36
|
+
_isTitlePosition(t, e) {
|
|
37
|
+
var r;
|
|
38
|
+
const i = this._wrapperRowOf(t, e);
|
|
39
|
+
return e.classList.contains(c) || i !== null && i === ((r = i.parentElement) == null ? void 0 : r.firstElementChild);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Stamps the attribute-row tagging onto the title's wrapper row and the spacer
|
|
43
|
+
* below it, so one toggle governs the pair and the compiler drops both when off.
|
|
44
|
+
*/
|
|
45
|
+
_tagExistingTitle(t, e) {
|
|
46
|
+
e.classList.add(c), e.setAttribute("esd-extension-block-id", d.TITLE);
|
|
47
|
+
const i = this._wrapperRowOf(t, e);
|
|
48
|
+
if (!i)
|
|
49
|
+
return;
|
|
50
|
+
this._tagRow(i);
|
|
51
|
+
const r = i.nextElementSibling;
|
|
52
|
+
r && this._isSpacerRow(r) && this._tagRow(r);
|
|
53
|
+
}
|
|
54
|
+
/** The `<tr>` inside `table.container > tbody` that wraps the title's own table. */
|
|
55
|
+
_wrapperRowOf(t, e) {
|
|
56
|
+
if (!e)
|
|
57
|
+
return null;
|
|
58
|
+
const i = t.querySelector(_);
|
|
59
|
+
return Array.from((i == null ? void 0 : i.children) ?? []).find((r) => r.contains(e)) ?? null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Direct children only — a product-container row holds spacer cells further down,
|
|
63
|
+
* and `querySelector` would happily reach them. (`:scope >` is unsupported in happy-dom.)
|
|
64
|
+
*/
|
|
65
|
+
_isSpacerRow(t) {
|
|
66
|
+
return Array.from(t.children).some((e) => e.classList.contains(C));
|
|
67
|
+
}
|
|
68
|
+
_tagRow(t) {
|
|
69
|
+
t.classList.add(A), t.setAttribute(S, l), t.setAttribute(L, "1");
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A deleted title leaves nothing to tag — the toggle re-injects the markup only
|
|
73
|
+
* when the user switches it back on. Its leftovers (an emptied wrapper row, the
|
|
74
|
+
* spacer that trailed it) would otherwise render as blank padding on top.
|
|
75
|
+
*/
|
|
76
|
+
_removeTitleRemnants(t, e) {
|
|
77
|
+
var o;
|
|
78
|
+
const i = this._wrapperRowOf(t, e), r = i == null ? void 0 : i.nextElementSibling;
|
|
79
|
+
if (r && this._isSpacerRow(r) && r.remove(), i) {
|
|
80
|
+
i.remove();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const n = (o = t.querySelector(_)) == null ? void 0 : o.firstElementChild;
|
|
84
|
+
n && this._isSpacerRow(n) && n.remove();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Mirrors the resolved state into the persisted config blob, so a saved module
|
|
88
|
+
* whose `data-*` attributes Stripo strips on re-drop still restores the toggle.
|
|
89
|
+
*/
|
|
90
|
+
_writeVisibility(t, e) {
|
|
91
|
+
const i = this._readConfig(t);
|
|
92
|
+
if (!i)
|
|
93
|
+
return;
|
|
94
|
+
const r = typeof i.visibility == "object" && i.visibility !== null ? i.visibility : {};
|
|
95
|
+
i.visibility = { ...r, [l]: e }, t.setAttribute(T, JSON.stringify(i));
|
|
96
|
+
}
|
|
97
|
+
_hasRecordedTitleState(t) {
|
|
98
|
+
var i;
|
|
99
|
+
const e = (i = this._readConfig(t)) == null ? void 0 : i.visibility;
|
|
100
|
+
return typeof e == "object" && e !== null && l in e;
|
|
101
|
+
}
|
|
102
|
+
_readConfig(t) {
|
|
103
|
+
const e = t.getAttribute(T);
|
|
104
|
+
if (!e)
|
|
105
|
+
return null;
|
|
106
|
+
try {
|
|
107
|
+
const i = JSON.parse(e);
|
|
108
|
+
return typeof i == "object" && i !== null ? i : null;
|
|
109
|
+
} catch {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function v(s) {
|
|
115
|
+
return new y().migrate(s);
|
|
116
|
+
}
|
|
117
|
+
export {
|
|
118
|
+
v as migrateRecommendationTitle
|
|
119
|
+
};
|
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,7 +2,9 @@ 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"
|
|
5
|
+
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
|
|
6
|
+
RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
|
|
7
|
+
RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies"
|
|
6
8
|
}, c = {
|
|
7
9
|
CLIENT_ID: "clientId"
|
|
8
10
|
}, d = () => {
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var B = (a, c, t) => c in a ? R(a, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[c] = t;
|
|
3
|
+
var p = (a, c, t) => B(a, typeof c != "symbol" ? c + "" : c, t);
|
|
4
|
+
import { useConfig as D } from "../../../composables/useConfig.js";
|
|
5
|
+
import { BlockId as y } from "../../../enums/block.js";
|
|
6
|
+
import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
|
|
6
7
|
import { Block as b, BlockCompositionType as A, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { CURRENT_CONFIG_VERSION as E, PRE_RRS_CONFIG_VERSION as S } from "./constants/defaultConfig.js";
|
|
9
|
+
import { RECOMMENDATION_ID_ATTR as m } from "./constants/selectors.js";
|
|
10
|
+
import { regenerateMobileProductRows as N } from "./controls/main/utils.js";
|
|
11
|
+
import { ensureMobileCssRulesExist as h, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
|
|
9
12
|
import { RecommendationConfigService as s } from "./services/configService.js";
|
|
10
13
|
import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
|
|
11
|
-
import { getDefaultTemplate as
|
|
12
|
-
import { useRecommendationBlockWarning as
|
|
13
|
-
const _ =
|
|
14
|
+
import { getDefaultTemplate as M } from "./templates/grid/template.js";
|
|
15
|
+
import { useRecommendationBlockWarning as w } from "./useRecommendationBlockWarning.js";
|
|
16
|
+
const _ = y.Recommendation, u = "recommendation-block-v2", I = "hide-price";
|
|
14
17
|
let k = !1;
|
|
15
|
-
class
|
|
18
|
+
class W extends b {
|
|
16
19
|
constructor() {
|
|
17
20
|
super();
|
|
18
21
|
/**
|
|
19
22
|
* Stores the ID generated in getTemplate() so onCreated() can reuse it.
|
|
20
23
|
* This avoids generating a new (different) ID in onCreated().
|
|
21
24
|
*/
|
|
22
|
-
|
|
25
|
+
p(this, "_pendingBlockId", null);
|
|
23
26
|
}
|
|
24
27
|
getId() {
|
|
25
28
|
return _;
|
|
@@ -39,7 +42,7 @@ class P extends b {
|
|
|
39
42
|
);
|
|
40
43
|
}
|
|
41
44
|
getSettingsPanelTitleHtml() {
|
|
42
|
-
return
|
|
45
|
+
return C(
|
|
43
46
|
_,
|
|
44
47
|
this.api.translate("Recommendation Block"),
|
|
45
48
|
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.")
|
|
@@ -63,7 +66,7 @@ class P extends b {
|
|
|
63
66
|
*/
|
|
64
67
|
getTemplate() {
|
|
65
68
|
const t = this._generateNextId();
|
|
66
|
-
return this._pendingBlockId = t,
|
|
69
|
+
return this._pendingBlockId = t, M(t);
|
|
67
70
|
}
|
|
68
71
|
/**
|
|
69
72
|
* Called when a new block is dropped into the template
|
|
@@ -89,12 +92,15 @@ class P extends b {
|
|
|
89
92
|
const { config: n, wasFreshDrop: o } = s.initializeConfig(
|
|
90
93
|
this.api,
|
|
91
94
|
t,
|
|
92
|
-
{
|
|
95
|
+
{
|
|
96
|
+
recommendationId: i,
|
|
97
|
+
configVersion: D().isFeatureEnabled("reusableRecommendationStrategy") ? E : S
|
|
98
|
+
}
|
|
93
99
|
), r = d();
|
|
94
100
|
if (r.setCurrentBlock(i), this._stampHidePrice(t, n.priceHideIfSameAsDiscounted), o) {
|
|
95
|
-
|
|
101
|
+
h(this.api);
|
|
96
102
|
const l = this._getBlockElement(t);
|
|
97
|
-
l && (f(this.api, l, !0),
|
|
103
|
+
l && (f(this.api, l, !0), N({
|
|
98
104
|
currentNode: t,
|
|
99
105
|
documentModifier: this.api.getDocumentModifier()
|
|
100
106
|
}));
|
|
@@ -121,11 +127,11 @@ class P extends b {
|
|
|
121
127
|
}
|
|
122
128
|
this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
|
|
123
129
|
try {
|
|
124
|
-
k || (
|
|
130
|
+
k || (h(this.api), k = !0);
|
|
125
131
|
const e = s.getConfig(t), i = this._getBlockElement(t);
|
|
126
132
|
if (i) {
|
|
127
133
|
const n = !e.mobileLayoutEnabled;
|
|
128
|
-
|
|
134
|
+
O(i) !== n && f(this.api, i, n);
|
|
129
135
|
}
|
|
130
136
|
} catch {
|
|
131
137
|
}
|
|
@@ -155,7 +161,7 @@ class P extends b {
|
|
|
155
161
|
*/
|
|
156
162
|
_warnIfMultipleBlocks() {
|
|
157
163
|
try {
|
|
158
|
-
|
|
164
|
+
w().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
|
|
159
165
|
} catch {
|
|
160
166
|
}
|
|
161
167
|
}
|
|
@@ -167,9 +173,9 @@ class P extends b {
|
|
|
167
173
|
let t = 0;
|
|
168
174
|
try {
|
|
169
175
|
const e = this.api.getDocumentRoot();
|
|
170
|
-
e && "querySelectorAll" in e && e.querySelectorAll(`.${
|
|
176
|
+
e && "querySelectorAll" in e && e.querySelectorAll(`.${u}`).forEach((n) => {
|
|
171
177
|
if ("getAttribute" in n) {
|
|
172
|
-
const o = n.getAttribute(
|
|
178
|
+
const o = n.getAttribute(m), r = o ? parseInt(o) : 0;
|
|
173
179
|
r > t && (t = r);
|
|
174
180
|
}
|
|
175
181
|
});
|
|
@@ -197,7 +203,7 @@ class P extends b {
|
|
|
197
203
|
if (!i || !("querySelectorAll" in i))
|
|
198
204
|
return;
|
|
199
205
|
const n = i.querySelectorAll(
|
|
200
|
-
`.${
|
|
206
|
+
`.${u}[${m}="${e}"]`
|
|
201
207
|
);
|
|
202
208
|
if (n.length <= 1)
|
|
203
209
|
return;
|
|
@@ -222,7 +228,7 @@ class P extends b {
|
|
|
222
228
|
const e = this.api.getDocumentRoot();
|
|
223
229
|
if (e && "querySelectorAll" in e)
|
|
224
230
|
return e.querySelectorAll(
|
|
225
|
-
`.${
|
|
231
|
+
`.${u}[${m}="${t}"]`
|
|
226
232
|
).length > 1;
|
|
227
233
|
} catch {
|
|
228
234
|
}
|
|
@@ -279,7 +285,7 @@ class P extends b {
|
|
|
279
285
|
if (!i)
|
|
280
286
|
return;
|
|
281
287
|
const n = this.api.getDocumentModifier();
|
|
282
|
-
n.modifyHtml(i).setAttribute(
|
|
288
|
+
n.modifyHtml(i).setAttribute(m, e.toString()), n.apply(new g(`Assign recommendation ID ${e}`));
|
|
283
289
|
}
|
|
284
290
|
/**
|
|
285
291
|
* Stamps the `hide-price` attribute (read by email-service at send time) on
|
|
@@ -307,7 +313,7 @@ class P extends b {
|
|
|
307
313
|
const e = this._getBlockElement(t);
|
|
308
314
|
if (!e || !("getAttribute" in e))
|
|
309
315
|
return null;
|
|
310
|
-
const i = e.getAttribute(
|
|
316
|
+
const i = e.getAttribute(m);
|
|
311
317
|
if (!i)
|
|
312
318
|
return null;
|
|
313
319
|
const n = parseInt(i);
|
|
@@ -319,10 +325,10 @@ class P extends b {
|
|
|
319
325
|
_getBlockElement(t) {
|
|
320
326
|
if ("getAttribute" in t) {
|
|
321
327
|
const e = t.getAttribute("class");
|
|
322
|
-
if (e && e.includes(
|
|
328
|
+
if (e && e.includes(u))
|
|
323
329
|
return t;
|
|
324
330
|
}
|
|
325
|
-
return "querySelector" in t ? t.querySelector(`.${
|
|
331
|
+
return "querySelector" in t ? t.querySelector(`.${u}`) ?? null : null;
|
|
326
332
|
}
|
|
327
333
|
/**
|
|
328
334
|
* Migrate configuration from legacy format
|
|
@@ -333,5 +339,5 @@ class P extends b {
|
|
|
333
339
|
}
|
|
334
340
|
export {
|
|
335
341
|
_ as BLOCK_ID,
|
|
336
|
-
|
|
342
|
+
W as RecommendationBlock
|
|
337
343
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var b = /* @__PURE__ */ ((r) => (r.BUTTON = "recommendation-block-button", r.NAME = "recommendation-block-name", r.PRICE = "recommendation-block-price", r.OLD_PRICE = "recommendation-block-old-price", r.OMNIBUS_PRICE = "recommendation-block-omnibus-price", r.OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount", r.IMAGE = "recommendation-block-image", r.CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute", r))(b || {});
|
|
1
|
+
var b = /* @__PURE__ */ ((r) => (r.BUTTON = "recommendation-block-button", r.NAME = "recommendation-block-name", r.PRICE = "recommendation-block-price", r.OLD_PRICE = "recommendation-block-old-price", r.OMNIBUS_PRICE = "recommendation-block-omnibus-price", r.OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount", r.IMAGE = "recommendation-block-image", r.CUSTOM_ATTRIBUTE = "recommendation-block-custom-attribute", r.TITLE = "recommendation-block-title", r))(b || {});
|
|
2
2
|
export {
|
|
3
3
|
b as RecommendationBlockId
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (c.BLOCK_BACKGROUND = "recommendation-block-background-color-control", c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
1
|
+
var o = /* @__PURE__ */ ((c) => (c.BLOCK_BACKGROUND = "recommendation-block-background-color-control", c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.TITLE_ALIGN = "recommendation-block-title-align-control", c.TITLE_BACKGROUND = "recommendation-block-title-background-control", c.TITLE_COLOR = "recommendation-block-title-color-control", c.TITLE_FONT_FAMILY = "recommendation-block-title-font-family-control", c.TITLE_PADDINGS = "recommendation-block-title-paddings-control", c.TITLE_SIZE = "recommendation-block-title-size-control", c.TITLE_STYLE = "recommendation-block-title-style-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
2
2
|
export {
|
|
3
3
|
o as RecommendationControlId
|
|
4
4
|
};
|
|
@@ -1,35 +1,36 @@
|
|
|
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 D = {
|
|
1
|
+
import { DEFAULT_COLUMN_SPACING as R, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as n, DEFAULT_MOBILE_COLUMN_SPACING as O, 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, ATTR_RECOMMENDATION_TITLE as U } from "./selectors.js";
|
|
3
|
+
const A = 1, u = 2, 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
|
+
}, E = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
13
|
}, a = {
|
|
14
14
|
textBefore: "",
|
|
15
15
|
textAfter: ""
|
|
16
|
-
},
|
|
16
|
+
}, c = [
|
|
17
17
|
o,
|
|
18
18
|
t,
|
|
19
19
|
_,
|
|
20
20
|
T,
|
|
21
21
|
r,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
],
|
|
22
|
+
I,
|
|
23
|
+
i
|
|
24
|
+
], N = {
|
|
25
|
+
[U]: !0,
|
|
25
26
|
[o]: !0,
|
|
26
27
|
[t]: !0,
|
|
27
28
|
[T]: !0,
|
|
28
29
|
[_]: !0,
|
|
29
30
|
[r]: !1,
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
},
|
|
31
|
+
[I]: !1,
|
|
32
|
+
[i]: !0
|
|
33
|
+
}, m = {
|
|
33
34
|
// Settings
|
|
34
35
|
strategy: "mostPopular",
|
|
35
36
|
productIds: [],
|
|
@@ -38,21 +39,23 @@ const D = {
|
|
|
38
39
|
language: "en_US",
|
|
39
40
|
currency: D,
|
|
40
41
|
filters: [],
|
|
42
|
+
strategyId: "",
|
|
41
43
|
// Layout
|
|
42
44
|
layout: "grid",
|
|
43
45
|
cardsInRow: C,
|
|
44
46
|
mobileCardsInRow: e,
|
|
45
47
|
mobileLayoutEnabled: !1,
|
|
46
48
|
previousMobileCardsInRow: e,
|
|
47
|
-
columnSpacing:
|
|
49
|
+
columnSpacing: R,
|
|
48
50
|
rowSpacing: s,
|
|
49
|
-
mobileColumnSpacing:
|
|
50
|
-
mobileRowSpacing:
|
|
51
|
+
mobileColumnSpacing: O,
|
|
52
|
+
mobileRowSpacing: n,
|
|
51
53
|
// Composition
|
|
52
|
-
composition:
|
|
53
|
-
visibility:
|
|
54
|
+
composition: c,
|
|
55
|
+
visibility: N,
|
|
56
|
+
previousTitleHtml: "",
|
|
54
57
|
// Element settings
|
|
55
|
-
omnibusPrice:
|
|
58
|
+
omnibusPrice: E,
|
|
56
59
|
omnibusDiscount: a,
|
|
57
60
|
textTrimming: !1,
|
|
58
61
|
// Price placement (block-level, affects all cards)
|
|
@@ -63,18 +66,17 @@ const D = {
|
|
|
63
66
|
// of "false" (the actual hiding happens server-side at send).
|
|
64
67
|
priceHideIfSameAsDiscounted: !1,
|
|
65
68
|
// Meta
|
|
66
|
-
|
|
67
|
-
// defaults, so no data transform (and no needsMigration trigger) is required.
|
|
68
|
-
configVersion: 1,
|
|
69
|
+
configVersion: A,
|
|
69
70
|
recommendationId: 0
|
|
70
|
-
},
|
|
71
|
+
}, L = [11, 12];
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
u as CURRENT_CONFIG_VERSION,
|
|
74
|
+
c as DEFAULT_COMPOSITION,
|
|
74
75
|
D as DEFAULT_CURRENCY,
|
|
75
|
-
|
|
76
|
+
m as DEFAULT_NODE_CONFIG,
|
|
76
77
|
a as DEFAULT_OMNIBUS_DISCOUNT,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
E as DEFAULT_OMNIBUS_PRICE,
|
|
79
|
+
N as DEFAULT_VISIBILITY,
|
|
80
|
+
L as EXCLUDED_ALGORITHM_IDS,
|
|
81
|
+
A as PRE_RRS_CONFIG_VERSION
|
|
80
82
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c = ".recommendation-block-v2", n = ".ins-recommendation-product-container", _ = ".ins-recommendation-desktop-container", R = ".ins-recommendation-mobile-container", e = ".ins-recommendation-mobile-row", r = "reco-v3-button", A = "ins-skip-compile", E = {
|
|
2
2
|
CURRENCY: "currency",
|
|
3
3
|
SYMBOL: "currency-symbol",
|
|
4
4
|
ALIGNMENT: "currency-alignment",
|
|
5
5
|
THOUSAND_SEPARATOR: "currency-thousand-separator",
|
|
6
6
|
DECIMAL_SEPARATOR: "currency-decimal-separator",
|
|
7
7
|
DECIMAL_COUNT: "currency-decimal-count"
|
|
8
|
-
},
|
|
8
|
+
}, s = "productImage", O = "productName", i = "productPrice", C = "productOldPrice", S = "productOmnibusPrice", I = "productOmnibusDiscount", a = "productButton", m = "recommendationTitle", T = "ins-recommendation-title", u = `.${T}`, L = "customAttr:", d = "data-custom-attributes", U = "data-card-composition", N = "recommendation-id", D = "product-attr", t = "recommendation-attribute-row", P = `.${t}`, p = "data-attribute-type", B = "data-visibility", M = "spacer", l = "product_attribute.", o = /* @__PURE__ */ new Set([
|
|
9
9
|
"name",
|
|
10
10
|
// productName
|
|
11
11
|
"price",
|
|
@@ -20,34 +20,41 @@ const t = ".recommendation-block-v2", c = ".ins-recommendation-product-container
|
|
|
20
20
|
// productOmnibusPrice
|
|
21
21
|
"omnibus_discount"
|
|
22
22
|
// productOmnibusDiscount
|
|
23
|
-
]),
|
|
24
|
-
...
|
|
23
|
+
]), b = /* @__PURE__ */ new Set([
|
|
24
|
+
...o,
|
|
25
25
|
"currency",
|
|
26
26
|
"discount"
|
|
27
27
|
]);
|
|
28
28
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
C as
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
c as
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
29
|
+
L as ATTR_CUSTOM_PREFIX,
|
|
30
|
+
p as ATTR_DATA_ATTRIBUTE_TYPE,
|
|
31
|
+
U as ATTR_DATA_CARD_COMPOSITION,
|
|
32
|
+
d as ATTR_DATA_CUSTOM_ATTRIBUTES,
|
|
33
|
+
B as ATTR_DATA_VISIBILITY,
|
|
34
|
+
D as ATTR_PRODUCT_ATTR,
|
|
35
|
+
a as ATTR_PRODUCT_BUTTON,
|
|
36
|
+
s as ATTR_PRODUCT_IMAGE,
|
|
37
|
+
O as ATTR_PRODUCT_NAME,
|
|
38
|
+
C as ATTR_PRODUCT_OLD_PRICE,
|
|
39
|
+
I as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
|
|
40
|
+
S as ATTR_PRODUCT_OMNIBUS_PRICE,
|
|
41
|
+
i as ATTR_PRODUCT_PRICE,
|
|
42
|
+
m as ATTR_RECOMMENDATION_TITLE,
|
|
43
|
+
c as BLOCK_ROOT_SELECTOR,
|
|
44
|
+
o as BUILT_IN_DEFAULT_ATTRIBUTES,
|
|
45
|
+
n as CONTAINER_SELECTOR,
|
|
46
|
+
t as CSS_CLASS_ATTRIBUTE_ROW,
|
|
47
|
+
r as CSS_CLASS_RECO_BUTTON,
|
|
48
|
+
A as CSS_CLASS_SKIP_COMPILE,
|
|
49
|
+
M as CSS_CLASS_SPACER,
|
|
50
|
+
T as CSS_CLASS_TITLE_CELL,
|
|
51
|
+
E as CURRENCY_ATTR,
|
|
52
|
+
_ as DESKTOP_CONTAINER_SELECTOR,
|
|
53
|
+
R as MOBILE_CONTAINER_SELECTOR,
|
|
54
|
+
e as MOBILE_ROW_SELECTOR,
|
|
55
|
+
l as PRODUCT_ATTRIBUTE_PREFIX,
|
|
56
|
+
N as RECOMMENDATION_ID_ATTR,
|
|
57
|
+
b as RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES,
|
|
58
|
+
P as SELECTOR_ATTRIBUTE_ROW,
|
|
59
|
+
u as SELECTOR_TITLE_CELL
|
|
53
60
|
};
|