@useinsider/guido 3.8.1-beta.2ee94c2 → 3.8.1-beta.6c331cf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/composables/useHtmlValidator.js +180 -133
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +58 -57
- package/dist/config/compiler/utils/recommendationIgnoreUtils.js +15 -0
- package/dist/config/migrator/recommendation/extractors.js +44 -22
- package/dist/config/migrator/recommendation/htmlBuilder.js +175 -169
- package/dist/config/migrator/recommendationMigrator.js +30 -31
- package/dist/extensions/Blocks/Items/block.js +48 -29
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +62 -45
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +26 -20
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +55 -41
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +58 -57
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +43 -31
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +3 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +55 -45
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +63 -56
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +7 -6
- package/dist/extensions/Blocks/Recommendation/extension.js +3 -2
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +3 -2
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +13 -12
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -6
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
- package/dist/src/composables/useHtmlValidator.d.ts +27 -0
- package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +17 -0
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +21 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { BlockId as f } from "../../enums/block.js";
|
|
2
|
-
import { useTemplateStore as
|
|
3
|
-
import { mapComposition as
|
|
4
|
-
import { extractTitleText as
|
|
5
|
-
import { buildBlockHtml as
|
|
6
|
-
import { parseRecommendationId as
|
|
7
|
-
import { mapSettings as
|
|
2
|
+
import { useTemplateStore as b } from "../../stores/template.js";
|
|
3
|
+
import { mapComposition as y } from "./recommendation/compositionMapper.js";
|
|
4
|
+
import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
|
|
5
|
+
import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
|
|
6
|
+
import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
|
|
7
|
+
import { mapSettings as T } from "./recommendation/settingsMapper.js";
|
|
8
8
|
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)';
|
|
9
|
-
function
|
|
10
|
-
var
|
|
11
|
-
const o =
|
|
9
|
+
function B(i, t, a) {
|
|
10
|
+
var d;
|
|
11
|
+
const o = x(t);
|
|
12
12
|
if (o === null)
|
|
13
13
|
return console.warn(
|
|
14
14
|
"[RecommendationMigrator] Skipping block — missing/invalid `ins-recommendation-v3-campaign-id`"
|
|
@@ -18,30 +18,29 @@ function x(i, t, c) {
|
|
|
18
18
|
return console.warn(
|
|
19
19
|
`[RecommendationMigrator] Aborting block id=${o} — \`esd-dev-product-config\` missing or unable to be parsed`
|
|
20
20
|
), !1;
|
|
21
|
-
const n =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
), !1;
|
|
26
|
-
const a = S(n, r, o), e = b((s = r.composition) == null ? void 0 : s.variables), d = y(t), l = C(t), g = {
|
|
27
|
-
...a,
|
|
21
|
+
const n = a[String(o)] ?? {
|
|
22
|
+
currencySettings: v(t)
|
|
23
|
+
}, c = T(n, r, o), e = y((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
|
|
24
|
+
...c,
|
|
28
25
|
composition: e.composition,
|
|
29
26
|
visibility: e.visibility,
|
|
30
27
|
textTrimming: e.anyTextTrimming
|
|
31
|
-
},
|
|
28
|
+
}, m = S(t), u = `
|
|
32
29
|
<table>
|
|
33
30
|
<tbody>
|
|
34
31
|
<tr>
|
|
35
32
|
<td class="esd-structure" align="left">
|
|
36
33
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
37
34
|
<tbody>
|
|
38
|
-
<tr>${
|
|
39
|
-
nodeConfig:
|
|
35
|
+
<tr>${w({
|
|
36
|
+
nodeConfig: p,
|
|
40
37
|
composition: e,
|
|
41
|
-
cardBg:
|
|
42
|
-
titleText:
|
|
38
|
+
cardBg: g,
|
|
39
|
+
titleText: l,
|
|
43
40
|
legacyId: t.getAttribute("id") ?? void 0,
|
|
44
|
-
legacyBgColor: t.getAttribute("bgcolor") ?? void 0
|
|
41
|
+
legacyBgColor: t.getAttribute("bgcolor") ?? void 0,
|
|
42
|
+
preserveInnerHtml: m ? t.innerHTML : void 0,
|
|
43
|
+
skipCompile: m
|
|
45
44
|
})}</tr>
|
|
46
45
|
</tbody>
|
|
47
46
|
</table>
|
|
@@ -49,15 +48,15 @@ function x(i, t, c) {
|
|
|
49
48
|
</tr>
|
|
50
49
|
</tbody>
|
|
51
50
|
</table>
|
|
52
|
-
`,
|
|
53
|
-
return !
|
|
51
|
+
`, s = i.parseFromString(u, "text/html").querySelector("td.esd-structure");
|
|
52
|
+
return !s || !t.parentNode ? (console.warn(
|
|
54
53
|
`[RecommendationMigrator] Aborting block id=${o} — failed to construct new HTML element`
|
|
55
|
-
), !1) : (t.parentNode.replaceChild(
|
|
54
|
+
), !1) : (t.parentNode.replaceChild(s, t), !0);
|
|
56
55
|
}
|
|
57
|
-
function
|
|
58
|
-
const
|
|
56
|
+
function q(i, t = {}) {
|
|
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
|
|
@@ -68,14 +67,14 @@ function I(i, t = {}) {
|
|
|
68
67
|
if (r.length === 0)
|
|
69
68
|
return i;
|
|
70
69
|
let n = 0;
|
|
71
|
-
return r.forEach((
|
|
70
|
+
return r.forEach((c) => {
|
|
72
71
|
try {
|
|
73
|
-
|
|
72
|
+
B(a, c, t) && (n += 1);
|
|
74
73
|
} catch (e) {
|
|
75
74
|
console.error("[RecommendationMigrator] Unexpected error migrating block:", e);
|
|
76
75
|
}
|
|
77
76
|
}), n > 0 && console.info(`[RecommendationMigrator] Migrated ${n} legacy Recommendation block(s)`), o.documentElement.outerHTML;
|
|
78
77
|
}
|
|
79
78
|
export {
|
|
80
|
-
|
|
79
|
+
q as migrateRecommendation
|
|
81
80
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { BlockId as
|
|
1
|
+
import { BlockId as u } from "../../../enums/block.js";
|
|
2
2
|
import { useOnboardingStore as p } from "../../../stores/onboarding.js";
|
|
3
|
-
import { getMigrationBannerHtml as
|
|
4
|
-
import { Block as
|
|
5
|
-
import { SETTINGS_ENUMS as
|
|
6
|
-
import { getDefaultTemplate as
|
|
7
|
-
import { getItemsBlockContainer as
|
|
8
|
-
const
|
|
9
|
-
class E extends
|
|
3
|
+
import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
|
|
4
|
+
import { Block as I, BlockCompositionType as y, ModificationDescription as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { SETTINGS_ENUMS as c, DefaultConfigValues as a } from "./enums/settingsEnums.js";
|
|
6
|
+
import { getDefaultTemplate as h } from "./template.js";
|
|
7
|
+
import { getItemsBlockContainer as l, getItemsBlockConfig as m, getDefaultItemsBlockConfig as b } from "./utils/nodeConfigUtils.js";
|
|
8
|
+
const d = u.Items;
|
|
9
|
+
class E extends I {
|
|
10
10
|
getId() {
|
|
11
|
-
return
|
|
11
|
+
return d;
|
|
12
12
|
}
|
|
13
13
|
getIcon() {
|
|
14
14
|
return "items-icon";
|
|
15
15
|
}
|
|
16
16
|
getBlockCompositionType() {
|
|
17
|
-
return
|
|
17
|
+
return y.CONTAINER;
|
|
18
18
|
}
|
|
19
19
|
getName() {
|
|
20
20
|
return this.api.translate("Items");
|
|
@@ -23,41 +23,60 @@ class E extends u {
|
|
|
23
23
|
return this.api.translate("Items lets you display personalized products based on user behavior.");
|
|
24
24
|
}
|
|
25
25
|
getSettingsPanelTitleHtml() {
|
|
26
|
-
return
|
|
27
|
-
|
|
26
|
+
return C(
|
|
27
|
+
d,
|
|
28
28
|
this.api.translate("Items"),
|
|
29
29
|
this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.")
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
getTemplate() {
|
|
33
|
-
return
|
|
34
|
-
orientation:
|
|
35
|
-
itemsType:
|
|
33
|
+
return h({
|
|
34
|
+
orientation: c.ORIENTATION.VERTICAL,
|
|
35
|
+
itemsType: c.ITEMS_TYPE.CART_ITEMS,
|
|
36
36
|
itemId: "{{Abandoned Cart Item (1) Url}}",
|
|
37
|
-
currencySymbol:
|
|
38
|
-
currencyLocation:
|
|
39
|
-
formattedPrice:
|
|
37
|
+
currencySymbol: a.productPriceCurrencySymbolControlValue,
|
|
38
|
+
currencyLocation: a.productPriceCurrencyLocationControlValue,
|
|
39
|
+
formattedPrice: a.productPriceFormattedControlValue === "1"
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
allowInnerBlocksDND() {
|
|
43
43
|
return !1;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
canBeSavedAsModule() {
|
|
46
|
+
return !0;
|
|
47
|
+
}
|
|
48
|
+
onCreated(i) {
|
|
49
|
+
const n = this.api.getDocumentModifier(), r = this.api.getDocumentRootCssNode();
|
|
50
|
+
r.querySelector('[product-attr="imageSrc"] img') || n.modifyCss(r).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
|
|
51
|
+
const t = l(i);
|
|
52
|
+
if (!t)
|
|
50
53
|
return;
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
+
const e = t.getNodeConfig(), g = e && Object.keys(e).length > 0, o = m(i);
|
|
55
|
+
if (o != null && o.initialized)
|
|
56
|
+
g ? o.blockInstanceId || this.api.getDocumentModifier().modifyHtml(t).setNodeConfig({ ...o, blockInstanceId: String(Date.now()) }).apply(new s("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(t).setNodeConfig(o).apply(new s("Migrate legacy config to nodeConfig"));
|
|
54
57
|
else {
|
|
55
|
-
const
|
|
56
|
-
this.api.getDocumentModifier().modifyHtml(
|
|
58
|
+
const f = b();
|
|
59
|
+
this.api.getDocumentModifier().modifyHtml(t).setNodeConfig(f).apply(new s("Initialize Items block with default configuration")), p().startOnboarding("itemsOnboarding");
|
|
57
60
|
}
|
|
58
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
|
|
64
|
+
* surfaces via document load. Stripo strips esd-ext-config and never restores it
|
|
65
|
+
* into nodeConfig, so without this a reused module would reset to defaults.
|
|
66
|
+
* Guarded to the nodeConfig-empty case so it runs once and never loops.
|
|
67
|
+
*/
|
|
68
|
+
onDocumentChanged(i) {
|
|
69
|
+
const n = l(i);
|
|
70
|
+
if (!n)
|
|
71
|
+
return;
|
|
72
|
+
const r = n.getNodeConfig();
|
|
73
|
+
if (r && Object.keys(r).length > 0)
|
|
74
|
+
return;
|
|
75
|
+
const e = m(i);
|
|
76
|
+
e != null && e.initialized && this.api.getDocumentModifier().modifyHtml(n).setNodeConfig(e).apply(new s("Recover Items block config from saved module"));
|
|
77
|
+
}
|
|
59
78
|
}
|
|
60
79
|
export {
|
|
61
|
-
|
|
80
|
+
d as BLOCK_ID,
|
|
62
81
|
E as ItemsBlock
|
|
63
82
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { ModificationDescription as b } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { DefaultConfigValues as
|
|
2
|
+
import { DefaultConfigValues as i, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
|
|
3
3
|
function _() {
|
|
4
4
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
5
5
|
}
|
|
6
6
|
const E = (r) => r.replace(/\$/g, "$$$$");
|
|
7
|
-
function
|
|
7
|
+
function y() {
|
|
8
8
|
return {
|
|
9
9
|
initialized: !0,
|
|
10
10
|
blockInstanceId: _(),
|
|
11
11
|
source: n.ITEMS_TYPE.CART_ITEMS,
|
|
12
12
|
type: n.ITEMS_TYPE.CART_ITEMS,
|
|
13
|
-
itemsSelectValue:
|
|
13
|
+
itemsSelectValue: i.cartItemsSelectControlValue,
|
|
14
14
|
orientation: n.ORIENTATION.VERTICAL,
|
|
15
|
-
nameTrimming:
|
|
16
|
-
priceHideDiscount:
|
|
17
|
-
priceFormatted:
|
|
15
|
+
nameTrimming: i.productNameTrimmingControlValue === "1",
|
|
16
|
+
priceHideDiscount: i.productPriceHideDiscountControlValue === "1",
|
|
17
|
+
priceFormatted: i.productPriceFormattedControlValue === "1",
|
|
18
18
|
priceSinglePrice: !1,
|
|
19
|
-
priceCurrencySymbol:
|
|
20
|
-
priceCurrencyLocation:
|
|
19
|
+
priceCurrencySymbol: i.productPriceCurrencySymbolControlValue,
|
|
20
|
+
priceCurrencyLocation: i.productPriceCurrencyLocationControlValue,
|
|
21
21
|
priceOrientation: "horizontal",
|
|
22
|
-
quantityControlEnabled:
|
|
23
|
-
buttonLink:
|
|
24
|
-
imageLink:
|
|
22
|
+
quantityControlEnabled: i.productQuantityControlEnabled === "1",
|
|
23
|
+
buttonLink: i.productButtonLinkControlValue,
|
|
24
|
+
imageLink: i.productImageLinkControlValue,
|
|
25
25
|
buttonLabel: "Buy",
|
|
26
26
|
buttonFullWidth: !0,
|
|
27
27
|
// Default to full width (es-fw class)
|
|
28
|
-
imageVisible:
|
|
29
|
-
nameVisible:
|
|
30
|
-
quantityVisible:
|
|
31
|
-
priceVisible:
|
|
32
|
-
originalPriceVisible:
|
|
33
|
-
buttonVisible:
|
|
28
|
+
imageVisible: i.productImageVisible === "1",
|
|
29
|
+
nameVisible: i.productNameVisible === "1",
|
|
30
|
+
quantityVisible: i.productQuantityVisible === "1",
|
|
31
|
+
priceVisible: i.productPriceVisible === "1",
|
|
32
|
+
originalPriceVisible: i.productOriginalPriceVisible === "1",
|
|
33
|
+
buttonVisible: i.productButtonVisible === "1"
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
function p(r) {
|
|
@@ -50,26 +50,26 @@ function m(r) {
|
|
|
50
50
|
PURCHASED_ITEMS: n.ITEMS_TYPE.PURCHASED_ITEMS
|
|
51
51
|
}[r] || n.ITEMS_TYPE.CART_ITEMS : n.ITEMS_TYPE.CART_ITEMS;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function f(r, t) {
|
|
54
54
|
if (!r)
|
|
55
|
-
return
|
|
55
|
+
return i.cartItemsSelectControlValue;
|
|
56
56
|
if (r.includes("{{"))
|
|
57
57
|
return r;
|
|
58
58
|
if (/^\d+$/.test(r)) {
|
|
59
|
-
const e = parseInt(r) - 1,
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
59
|
+
const e = parseInt(r) - 1, o = g[t];
|
|
60
|
+
if (o && o[e])
|
|
61
|
+
return o[e].value;
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return i.cartItemsSelectControlValue;
|
|
64
64
|
}
|
|
65
65
|
function C(r) {
|
|
66
66
|
const t = r.querySelector("esd-config-block");
|
|
67
67
|
if (!t)
|
|
68
68
|
return null;
|
|
69
|
-
const e = (
|
|
69
|
+
const e = (u, s) => u == null ? s : u === "1" || u === "true", o = (u, s) => u || s, c = t.getAttribute("data-type"), a = m(c), d = t.getAttribute("data-cart_items_select_control_value"), l = f(d, a);
|
|
70
70
|
return {
|
|
71
71
|
initialized: e(t.getAttribute("data-initialized"), !1),
|
|
72
|
-
blockInstanceId:
|
|
72
|
+
blockInstanceId: o(
|
|
73
73
|
t.getAttribute("data-block-instance-id"),
|
|
74
74
|
_()
|
|
75
75
|
),
|
|
@@ -93,28 +93,28 @@ function C(r) {
|
|
|
93
93
|
t.getAttribute("data-product_price_control_single_price"),
|
|
94
94
|
!1
|
|
95
95
|
),
|
|
96
|
-
priceCurrencySymbol:
|
|
96
|
+
priceCurrencySymbol: o(
|
|
97
97
|
t.getAttribute("data-product_price_control_currency_symbol"),
|
|
98
|
-
|
|
98
|
+
i.productPriceCurrencySymbolControlValue
|
|
99
99
|
),
|
|
100
|
-
priceCurrencyLocation:
|
|
100
|
+
priceCurrencyLocation: o(
|
|
101
101
|
t.getAttribute("data-product_price_currency_location"),
|
|
102
|
-
|
|
102
|
+
i.productPriceCurrencyLocationControlValue
|
|
103
103
|
),
|
|
104
104
|
priceOrientation: t.getAttribute("data-product_original_price_control_orientation") || "horizontal",
|
|
105
105
|
quantityControlEnabled: e(
|
|
106
106
|
t.getAttribute("data-product_quantity_control_enabled"),
|
|
107
107
|
!0
|
|
108
108
|
),
|
|
109
|
-
buttonLink:
|
|
109
|
+
buttonLink: o(
|
|
110
110
|
t.getAttribute("data-product_button_link"),
|
|
111
|
-
|
|
111
|
+
i.productButtonLinkControlValue
|
|
112
112
|
),
|
|
113
|
-
imageLink:
|
|
113
|
+
imageLink: o(
|
|
114
114
|
t.getAttribute("data-product_image_link"),
|
|
115
|
-
|
|
115
|
+
i.productImageLinkControlValue
|
|
116
116
|
),
|
|
117
|
-
buttonLabel:
|
|
117
|
+
buttonLabel: o(
|
|
118
118
|
t.getAttribute("data-product_button_control_label"),
|
|
119
119
|
"Buy"
|
|
120
120
|
),
|
|
@@ -149,28 +149,45 @@ function C(r) {
|
|
|
149
149
|
)
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function I(r) {
|
|
153
|
+
if (typeof r.getAttribute != "function")
|
|
154
|
+
return null;
|
|
155
|
+
const t = r.getAttribute("esd-ext-config");
|
|
156
|
+
if (!t)
|
|
157
|
+
return null;
|
|
158
|
+
try {
|
|
159
|
+
const e = JSON.parse(t);
|
|
160
|
+
if (e && e.initialized)
|
|
161
|
+
return e;
|
|
162
|
+
} catch {
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
function A(r) {
|
|
153
167
|
const t = p(r);
|
|
154
168
|
if (!t)
|
|
155
169
|
return null;
|
|
156
170
|
const e = t.getNodeConfig();
|
|
157
171
|
if (e && e.initialized)
|
|
158
172
|
return e;
|
|
159
|
-
const
|
|
160
|
-
|
|
173
|
+
const o = I(t);
|
|
174
|
+
if (o)
|
|
175
|
+
return o;
|
|
176
|
+
const c = C(t);
|
|
177
|
+
return c || null;
|
|
161
178
|
}
|
|
162
|
-
function
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
179
|
+
function V(r, t, e, o) {
|
|
180
|
+
const c = p(r);
|
|
181
|
+
if (!c)
|
|
165
182
|
return;
|
|
166
|
-
const d = { ...
|
|
167
|
-
l.modifyHtml(
|
|
183
|
+
const d = { ...c.getNodeConfig() || {}, ...e }, l = o ?? t.getDocumentModifier();
|
|
184
|
+
l.modifyHtml(c).setNodeConfig(d), o || l.apply(new b("Update Items block configuration"));
|
|
168
185
|
}
|
|
169
186
|
export {
|
|
170
187
|
E as escapeReplacement,
|
|
171
188
|
_ as generateBlockInstanceId,
|
|
172
|
-
|
|
173
|
-
|
|
189
|
+
y as getDefaultItemsBlockConfig,
|
|
190
|
+
A as getItemsBlockConfig,
|
|
174
191
|
p as getItemsBlockContainer,
|
|
175
|
-
|
|
192
|
+
V as setItemsBlockConfig
|
|
176
193
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c = ".recommendation-block-v2", t = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", n = ".ins-recommendation-mobile-container", _ = ".ins-recommendation-mobile-row", r = "reco-v3-button", R = "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
|
+
}, O = "productImage", s = "productName", E = "productPrice", i = "productOldPrice", A = "productOmnibusPrice", C = "productOmnibusDiscount", u = "productButton", I = "customAttr:", S = "data-custom-attributes", m = "product-attr", U = "product_attribute.", T = /* @__PURE__ */ new Set([
|
|
9
9
|
"name",
|
|
10
10
|
// productName
|
|
11
11
|
"price",
|
|
@@ -20,25 +20,31 @@ const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container
|
|
|
20
20
|
// productOmnibusPrice
|
|
21
21
|
"omnibus_discount"
|
|
22
22
|
// productOmnibusDiscount
|
|
23
|
+
]), a = /* @__PURE__ */ new Set([
|
|
24
|
+
...T,
|
|
25
|
+
"currency",
|
|
26
|
+
"discount"
|
|
23
27
|
]);
|
|
24
28
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
I as ATTR_CUSTOM_PREFIX,
|
|
30
|
+
S as ATTR_DATA_CUSTOM_ATTRIBUTES,
|
|
31
|
+
m as ATTR_PRODUCT_ATTR,
|
|
32
|
+
u as ATTR_PRODUCT_BUTTON,
|
|
33
|
+
O as ATTR_PRODUCT_IMAGE,
|
|
34
|
+
s as ATTR_PRODUCT_NAME,
|
|
35
|
+
i as ATTR_PRODUCT_OLD_PRICE,
|
|
36
|
+
C as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
|
|
37
|
+
A as ATTR_PRODUCT_OMNIBUS_PRICE,
|
|
38
|
+
E as ATTR_PRODUCT_PRICE,
|
|
39
|
+
c as BLOCK_ROOT_SELECTOR,
|
|
40
|
+
T as BUILT_IN_DEFAULT_ATTRIBUTES,
|
|
41
|
+
t as CONTAINER_SELECTOR,
|
|
38
42
|
r as CSS_CLASS_RECO_BUTTON,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
o as
|
|
42
|
-
n as
|
|
43
|
-
|
|
43
|
+
R as CSS_CLASS_SKIP_COMPILE,
|
|
44
|
+
e as CURRENCY_ATTR,
|
|
45
|
+
o as DESKTOP_CONTAINER_SELECTOR,
|
|
46
|
+
n as MOBILE_CONTAINER_SELECTOR,
|
|
47
|
+
_ as MOBILE_ROW_SELECTOR,
|
|
48
|
+
U as PRODUCT_ATTRIBUTE_PREFIX,
|
|
49
|
+
a as RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES
|
|
44
50
|
};
|