@useinsider/guido 3.17.0-beta.e23d5cd → 3.17.0-beta.e324492
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/components/Guido.vue.js +7 -7
- package/dist/components/Guido.vue2.js +59 -57
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
- 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/recommendationMigrator.js +30 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/extensions/Blocks/Recommendation/block.js +12 -11
- 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 +24 -22
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +329 -257
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +127 -113
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +1 -1
- 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/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +37 -26
- 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/guido.css +1 -1
- package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -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/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 +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- 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 +8 -4
- 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/store/recommendation.d.ts +38 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/utils/templatePreparation.js +37 -36
- package/package.json +1 -1
|
@@ -1,32 +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,
|
|
25
29
|
strategyId: "",
|
|
26
30
|
composition: e.composition,
|
|
27
31
|
visibility: e.visibility,
|
|
32
|
+
previousTitleHtml: b.previousTitleHtml,
|
|
28
33
|
textTrimming: e.anyTextTrimming
|
|
29
|
-
}, m =
|
|
34
|
+
}, m = h(t), u = `
|
|
30
35
|
<table>
|
|
31
36
|
<tbody>
|
|
32
37
|
<tr>
|
|
@@ -34,10 +39,10 @@ function B(i, t, a) {
|
|
|
34
39
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
35
40
|
<tbody>
|
|
36
41
|
<tr>${w({
|
|
37
|
-
nodeConfig:
|
|
42
|
+
nodeConfig: g,
|
|
38
43
|
composition: e,
|
|
39
|
-
cardBg:
|
|
40
|
-
titleText:
|
|
44
|
+
cardBg: p,
|
|
45
|
+
titleText: d,
|
|
41
46
|
legacyId: t.getAttribute("id") ?? void 0,
|
|
42
47
|
legacyBgColor: t.getAttribute("bgcolor") ?? void 0,
|
|
43
48
|
preserveInnerHtml: m ? t.innerHTML : void 0,
|
|
@@ -49,15 +54,15 @@ function B(i, t, a) {
|
|
|
49
54
|
</tr>
|
|
50
55
|
</tbody>
|
|
51
56
|
</table>
|
|
52
|
-
`, s =
|
|
57
|
+
`, s = n.parseFromString(u, "text/html").querySelector("td.esd-structure");
|
|
53
58
|
return !s || !t.parentNode ? (console.warn(
|
|
54
59
|
`[RecommendationMigrator] Aborting block id=${o} — failed to construct new HTML element`
|
|
55
60
|
), !1) : (t.parentNode.replaceChild(s, t), !0);
|
|
56
61
|
}
|
|
57
|
-
function
|
|
58
|
-
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));
|
|
59
64
|
try {
|
|
60
|
-
|
|
65
|
+
T().$patch((e) => {
|
|
61
66
|
e.migrations = {
|
|
62
67
|
...e.migrations,
|
|
63
68
|
[f.Recommendation]: r.length
|
|
@@ -66,16 +71,16 @@ function q(i, t = {}) {
|
|
|
66
71
|
} catch {
|
|
67
72
|
}
|
|
68
73
|
if (r.length === 0)
|
|
69
|
-
return
|
|
70
|
-
let
|
|
74
|
+
return n;
|
|
75
|
+
let i = 0;
|
|
71
76
|
return r.forEach((c) => {
|
|
72
77
|
try {
|
|
73
|
-
B(a, c, t) && (
|
|
78
|
+
B(a, c, t) && (i += 1);
|
|
74
79
|
} catch (e) {
|
|
75
80
|
console.error("[RecommendationMigrator] Unexpected error migrating block:", e);
|
|
76
81
|
}
|
|
77
|
-
}),
|
|
82
|
+
}), i > 0 && console.info(`[RecommendationMigrator] Migrated ${i} legacy Recommendation block(s)`), o.documentElement.outerHTML;
|
|
78
83
|
}
|
|
79
84
|
export {
|
|
80
|
-
|
|
85
|
+
G as migrateRecommendation
|
|
81
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
|
+
};
|
|
@@ -6,15 +6,16 @@ import { BlockId as y } from "../../../enums/block.js";
|
|
|
6
6
|
import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
|
|
7
7
|
import { Block as b, BlockCompositionType as A, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
8
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";
|
|
9
10
|
import { regenerateMobileProductRows as N } from "./controls/main/utils.js";
|
|
10
11
|
import { ensureMobileCssRulesExist as h, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
|
|
11
12
|
import { RecommendationConfigService as s } from "./services/configService.js";
|
|
12
13
|
import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
|
|
13
14
|
import { getDefaultTemplate as M } from "./templates/grid/template.js";
|
|
14
15
|
import { useRecommendationBlockWarning as w } from "./useRecommendationBlockWarning.js";
|
|
15
|
-
const _ = y.Recommendation,
|
|
16
|
+
const _ = y.Recommendation, u = "recommendation-block-v2", I = "hide-price";
|
|
16
17
|
let k = !1;
|
|
17
|
-
class
|
|
18
|
+
class W extends b {
|
|
18
19
|
constructor() {
|
|
19
20
|
super();
|
|
20
21
|
/**
|
|
@@ -172,9 +173,9 @@ class K extends b {
|
|
|
172
173
|
let t = 0;
|
|
173
174
|
try {
|
|
174
175
|
const e = this.api.getDocumentRoot();
|
|
175
|
-
e && "querySelectorAll" in e && e.querySelectorAll(`.${
|
|
176
|
+
e && "querySelectorAll" in e && e.querySelectorAll(`.${u}`).forEach((n) => {
|
|
176
177
|
if ("getAttribute" in n) {
|
|
177
|
-
const o = n.getAttribute(
|
|
178
|
+
const o = n.getAttribute(m), r = o ? parseInt(o) : 0;
|
|
178
179
|
r > t && (t = r);
|
|
179
180
|
}
|
|
180
181
|
});
|
|
@@ -202,7 +203,7 @@ class K extends b {
|
|
|
202
203
|
if (!i || !("querySelectorAll" in i))
|
|
203
204
|
return;
|
|
204
205
|
const n = i.querySelectorAll(
|
|
205
|
-
`.${
|
|
206
|
+
`.${u}[${m}="${e}"]`
|
|
206
207
|
);
|
|
207
208
|
if (n.length <= 1)
|
|
208
209
|
return;
|
|
@@ -227,7 +228,7 @@ class K extends b {
|
|
|
227
228
|
const e = this.api.getDocumentRoot();
|
|
228
229
|
if (e && "querySelectorAll" in e)
|
|
229
230
|
return e.querySelectorAll(
|
|
230
|
-
`.${
|
|
231
|
+
`.${u}[${m}="${t}"]`
|
|
231
232
|
).length > 1;
|
|
232
233
|
} catch {
|
|
233
234
|
}
|
|
@@ -284,7 +285,7 @@ class K extends b {
|
|
|
284
285
|
if (!i)
|
|
285
286
|
return;
|
|
286
287
|
const n = this.api.getDocumentModifier();
|
|
287
|
-
n.modifyHtml(i).setAttribute(
|
|
288
|
+
n.modifyHtml(i).setAttribute(m, e.toString()), n.apply(new g(`Assign recommendation ID ${e}`));
|
|
288
289
|
}
|
|
289
290
|
/**
|
|
290
291
|
* Stamps the `hide-price` attribute (read by email-service at send time) on
|
|
@@ -312,7 +313,7 @@ class K extends b {
|
|
|
312
313
|
const e = this._getBlockElement(t);
|
|
313
314
|
if (!e || !("getAttribute" in e))
|
|
314
315
|
return null;
|
|
315
|
-
const i = e.getAttribute(
|
|
316
|
+
const i = e.getAttribute(m);
|
|
316
317
|
if (!i)
|
|
317
318
|
return null;
|
|
318
319
|
const n = parseInt(i);
|
|
@@ -324,10 +325,10 @@ class K extends b {
|
|
|
324
325
|
_getBlockElement(t) {
|
|
325
326
|
if ("getAttribute" in t) {
|
|
326
327
|
const e = t.getAttribute("class");
|
|
327
|
-
if (e && e.includes(
|
|
328
|
+
if (e && e.includes(u))
|
|
328
329
|
return t;
|
|
329
330
|
}
|
|
330
|
-
return "querySelector" in t ? t.querySelector(`.${
|
|
331
|
+
return "querySelector" in t ? t.querySelector(`.${u}`) ?? null : null;
|
|
331
332
|
}
|
|
332
333
|
/**
|
|
333
334
|
* Migrate configuration from legacy format
|
|
@@ -338,5 +339,5 @@ class K extends b {
|
|
|
338
339
|
}
|
|
339
340
|
export {
|
|
340
341
|
_ as BLOCK_ID,
|
|
341
|
-
|
|
342
|
+
W as RecommendationBlock
|
|
342
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,16 +1,16 @@
|
|
|
1
|
-
import { DEFAULT_COLUMN_SPACING as R, DEFAULT_ROW_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 I, ATTR_PRODUCT_BUTTON as i } from "./selectors.js";
|
|
3
|
-
const
|
|
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 = [
|
|
@@ -21,7 +21,8 @@ const C = 1, l = 2, a = {
|
|
|
21
21
|
r,
|
|
22
22
|
I,
|
|
23
23
|
i
|
|
24
|
-
],
|
|
24
|
+
], N = {
|
|
25
|
+
[U]: !0,
|
|
25
26
|
[o]: !0,
|
|
26
27
|
[t]: !0,
|
|
27
28
|
[T]: !0,
|
|
@@ -36,25 +37,26 @@ const C = 1, l = 2, a = {
|
|
|
36
37
|
size: "6",
|
|
37
38
|
shuffleProducts: !1,
|
|
38
39
|
language: "en_US",
|
|
39
|
-
currency:
|
|
40
|
+
currency: D,
|
|
40
41
|
filters: [],
|
|
41
42
|
strategyId: "",
|
|
42
43
|
// Layout
|
|
43
44
|
layout: "grid",
|
|
44
|
-
cardsInRow:
|
|
45
|
+
cardsInRow: C,
|
|
45
46
|
mobileCardsInRow: e,
|
|
46
47
|
mobileLayoutEnabled: !1,
|
|
47
48
|
previousMobileCardsInRow: e,
|
|
48
49
|
columnSpacing: R,
|
|
49
|
-
rowSpacing:
|
|
50
|
+
rowSpacing: s,
|
|
50
51
|
mobileColumnSpacing: O,
|
|
51
|
-
mobileRowSpacing:
|
|
52
|
+
mobileRowSpacing: n,
|
|
52
53
|
// Composition
|
|
53
54
|
composition: c,
|
|
54
|
-
visibility:
|
|
55
|
+
visibility: N,
|
|
56
|
+
previousTitleHtml: "",
|
|
55
57
|
// Element settings
|
|
56
|
-
omnibusPrice:
|
|
57
|
-
omnibusDiscount:
|
|
58
|
+
omnibusPrice: E,
|
|
59
|
+
omnibusDiscount: a,
|
|
58
60
|
textTrimming: !1,
|
|
59
61
|
// Price placement (block-level, affects all cards)
|
|
60
62
|
// Default ON = current stacked look, so existing templates are unaffected.
|
|
@@ -64,17 +66,17 @@ const C = 1, l = 2, a = {
|
|
|
64
66
|
// of "false" (the actual hiding happens server-side at send).
|
|
65
67
|
priceHideIfSameAsDiscounted: !1,
|
|
66
68
|
// Meta
|
|
67
|
-
configVersion:
|
|
69
|
+
configVersion: A,
|
|
68
70
|
recommendationId: 0
|
|
69
|
-
},
|
|
71
|
+
}, L = [11, 12];
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
u as CURRENT_CONFIG_VERSION,
|
|
72
74
|
c as DEFAULT_COMPOSITION,
|
|
73
|
-
|
|
75
|
+
D as DEFAULT_CURRENCY,
|
|
74
76
|
m as DEFAULT_NODE_CONFIG,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
a as DEFAULT_OMNIBUS_DISCOUNT,
|
|
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
|
};
|