@useinsider/guido 3.0.0-beta.8709edc → 3.0.0-beta.952fc1f
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/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +6 -6
- package/dist/config/compiler/unsubscribeCompilerRules.js +14 -14
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +29 -18
- package/dist/config/i18n/en/tooltips.json.js +1 -2
- package/dist/extensions/Blocks/Recommendation/block.js +59 -38
- 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 +36 -34
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -12
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +693 -144
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +78 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +15 -15
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +107 -78
- package/dist/extensions/Blocks/Recommendation/controls/{layout/index.js → main/layoutOrientation.js} +34 -23
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +58 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +150 -64
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +2 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +202 -200
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +25 -8
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +6 -5
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +21 -21
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +17 -17
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +135 -143
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +65 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +20 -18
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +161 -2
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +135 -111
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +9 -7
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +63 -34
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +25 -28
- package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +28 -13
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +25 -44
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +62 -38
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +17 -16
- package/dist/extensions/Blocks/common-control.js +90 -41
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +218 -324
- package/dist/package.json.js +1 -1
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +9 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +134 -44
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +105 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/{layout/index.d.ts → main/layoutOrientation.d.ts} +3 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productCount.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +38 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +6 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +23 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +8 -18
- package/dist/src/extensions/Blocks/Recommendation/controls/syncInfoMessage.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +37 -2
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/src/extensions/Blocks/common-control.d.ts +24 -2
- package/dist/static/styles/components/wide-panel.css.js +1 -0
- package/dist/static/styles/customEditorStyle.css.js +9 -0
- package/dist/static/styles/variables.css.js +3 -0
- package/package.json +3 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
|
@@ -14,17 +14,17 @@ import P from "./MigrationConfirmModal.vue.js";
|
|
|
14
14
|
const Z = /* @__PURE__ */ E({
|
|
15
15
|
__name: "EditorActions",
|
|
16
16
|
setup(j, { expose: H }) {
|
|
17
|
-
const { config: a } = w(), { exportHtml: m } = C(), { save: p } = O(), { openVersionHistory: l, closeVersionHistory:
|
|
17
|
+
const { config: a } = w(), { exportHtml: m } = C(), { save: p } = O(), { openVersionHistory: l, closeVersionHistory: u } = k(), e = B(), c = R(), { hasMigrations: f } = I(c), r = A(), s = n(!1), i = n(!1), v = n(), S = M(), V = () => {
|
|
18
18
|
if (e.isVersionHistoryOpen) {
|
|
19
|
-
|
|
19
|
+
u();
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
l();
|
|
23
23
|
}, T = async () => {
|
|
24
|
-
|
|
24
|
+
s.value = !0, await m(), s.value = !1;
|
|
25
25
|
}, _ = () => {
|
|
26
26
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
27
|
-
}, h = g(() => e.isVersionHistoryOpen ?
|
|
27
|
+
}, h = g(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), x = g(
|
|
28
28
|
() => {
|
|
29
29
|
var o, t;
|
|
30
30
|
return ((t = (o = a.value) == null ? void 0 : o.features) == null ? void 0 : t.versionHistory) && !e.isPreviewModeOpen;
|
|
@@ -39,11 +39,11 @@ const Z = /* @__PURE__ */ E({
|
|
|
39
39
|
(t = v.value) == null || t.open();
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
d(o);
|
|
42
|
+
return d(o);
|
|
43
43
|
};
|
|
44
44
|
return H({
|
|
45
45
|
handleSave: y
|
|
46
|
-
}), { __sfc: !0, config: a, exportHtml: m, save: p, openVersionHistory: l, closeVersionHistory:
|
|
46
|
+
}), { __sfc: !0, config: a, exportHtml: m, save: p, openVersionHistory: l, closeVersionHistory: u, editorStore: e, templateStore: c, hasMigrations: f, trans: r, isExporting: s, isSaving: i, migrationModalRef: v, testEmailClick: S, handleVersionHistory: V, handleExport: T, handleSaveAs: _, versionHistoryTooltipText: h, isVersionHistoryButtonVisible: x, executeSave: d, handleSave: y, getTooltipOptions: b, InButtonV2: D, MigrationConfirmModal: P };
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usePartner as N } from "../../composables/usePartner.js";
|
|
2
|
-
import { LINK_REGEXES as l, LINK_TYPES as
|
|
2
|
+
import { LINK_REGEXES as l, LINK_TYPES as S, INSIDER_ID as R, URLS as _ } from "../../enums/unsubscribe.js";
|
|
3
3
|
import { parsePageList as U } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
4
|
import { useConfigStore as B } from "../../stores/config.js";
|
|
5
5
|
import { useDynamicContentStore as y } from "../../stores/dynamic-content.js";
|
|
@@ -16,25 +16,25 @@ const D = [
|
|
|
16
16
|
let e = t;
|
|
17
17
|
const r = `/${i()}/email/${a}?user={{iid}}`;
|
|
18
18
|
return new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
|
|
19
|
-
var
|
|
19
|
+
var g;
|
|
20
20
|
const m = p.getAttribute("data-unsubscribe-page-list");
|
|
21
21
|
if (!m)
|
|
22
22
|
return;
|
|
23
|
-
const
|
|
24
|
-
(o) =>
|
|
25
|
-
)) ?? [],
|
|
26
|
-
let s =
|
|
27
|
-
|
|
28
|
-
text:
|
|
29
|
-
value:
|
|
23
|
+
const I = U(m), d = ((g = u.templates) == null ? void 0 : g.filter(
|
|
24
|
+
(o) => I.includes(o.id)
|
|
25
|
+
)) ?? [], E = d.some((o) => o.type === S.UNSUBSCRIBE_LINK_TYPE), b = d.some((o) => o.type === S.PREFERENCES_LINK_TYPE), f = p.outerHTML;
|
|
26
|
+
let s = f;
|
|
27
|
+
(E || b) && n.selectedDynamicContentList.push({
|
|
28
|
+
text: R,
|
|
29
|
+
value: R,
|
|
30
30
|
fallback: ""
|
|
31
|
-
}), s = s.replace(
|
|
31
|
+
}), E && (s = s.replace(
|
|
32
32
|
l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
33
|
-
|
|
34
|
-
)),
|
|
33
|
+
_.UNSUBSCRIBE_URL + r
|
|
34
|
+
)), b && (s = s.replace(
|
|
35
35
|
l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
36
|
-
|
|
37
|
-
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(
|
|
36
|
+
_.PREFERENCES_URL + r
|
|
37
|
+
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(f, s);
|
|
38
38
|
}), e;
|
|
39
39
|
},
|
|
40
40
|
priority: 60
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRecommendation as
|
|
1
|
+
import { useRecommendation as $ } from "../../../composables/useRecommendation.js";
|
|
2
2
|
function b(e, u, r, o) {
|
|
3
3
|
const n = `{{${e}_${u}_${r}}}`, t = `{{${e}_${u}_currency}}`;
|
|
4
4
|
return o === "before" ? `${t} ${n}` : `${n} ${t}`;
|
|
@@ -64,58 +64,69 @@ function p(e, u, r, o, n) {
|
|
|
64
64
|
}
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
|
+
default: {
|
|
68
|
+
const t = e.getAttribute("product-attr") ? e : e.querySelector("[product-attr]");
|
|
69
|
+
if (t) {
|
|
70
|
+
const c = t.getAttribute("product-attr"), s = t.querySelector("p");
|
|
71
|
+
if (s) {
|
|
72
|
+
const i = s.querySelector("strong") || s;
|
|
73
|
+
i.textContent = `{{${r}_${o}_${c}}}`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
|
-
function
|
|
80
|
+
function S(e, u, r) {
|
|
70
81
|
e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
|
|
71
82
|
n.querySelectorAll("[data-attribute-type]").forEach((s) => {
|
|
72
|
-
const i = s.getAttribute("data-attribute-type") || "",
|
|
73
|
-
|
|
74
|
-
p(
|
|
83
|
+
const i = s.getAttribute("data-attribute-type") || "", l = s.querySelectorAll(".attribute-cell");
|
|
84
|
+
l.length > 0 ? l.forEach((a) => {
|
|
85
|
+
p(a, i, u, t, r);
|
|
75
86
|
}) : p(s, i, u, t, r);
|
|
76
87
|
});
|
|
77
88
|
});
|
|
78
89
|
}
|
|
79
|
-
function
|
|
90
|
+
function _(e, u, r) {
|
|
80
91
|
const o = e.querySelectorAll(".recommendation-product-row");
|
|
81
92
|
if (!o.length)
|
|
82
93
|
return;
|
|
83
94
|
const [n] = o, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
|
|
84
95
|
o.forEach((s, i) => {
|
|
85
|
-
s.querySelectorAll("[data-attribute-type]").forEach((
|
|
86
|
-
const f =
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
p(y, f, u,
|
|
96
|
+
s.querySelectorAll("[data-attribute-type]").forEach((a) => {
|
|
97
|
+
const f = a.getAttribute("data-attribute-type") || "";
|
|
98
|
+
a.querySelectorAll(".attribute-cell").forEach((y, A) => {
|
|
99
|
+
const m = i * c + A;
|
|
100
|
+
p(y, f, u, m, r);
|
|
90
101
|
});
|
|
91
102
|
});
|
|
92
103
|
});
|
|
93
104
|
}
|
|
94
105
|
function q(e, u, r) {
|
|
95
106
|
e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
|
|
96
|
-
|
|
107
|
+
_(n, u, r);
|
|
97
108
|
});
|
|
98
109
|
}
|
|
99
110
|
function d(e, u) {
|
|
100
111
|
const r = e.getAttribute("data-layout") || "grid", o = e.getAttribute("currency-alignment") || "after";
|
|
101
|
-
r === "list" ?
|
|
112
|
+
r === "list" ? S(e, u, o) : q(e, u, o);
|
|
102
113
|
}
|
|
103
|
-
function
|
|
114
|
+
function g(e, u) {
|
|
104
115
|
const r = e.match(/<!DOCTYPE[^>]*>/i);
|
|
105
116
|
return (r ? `${r[0]}
|
|
106
117
|
` : "") + u.documentElement.outerHTML;
|
|
107
118
|
}
|
|
108
|
-
function
|
|
119
|
+
function E(e) {
|
|
109
120
|
const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".recommendation-block-v2");
|
|
110
121
|
if (!o.length)
|
|
111
122
|
return e;
|
|
112
|
-
const { buildCampaignUrl: n } =
|
|
123
|
+
const { buildCampaignUrl: n } = $();
|
|
113
124
|
return o.forEach((c) => {
|
|
114
125
|
const s = c.getAttribute("recommendation-id");
|
|
115
126
|
s && (n(s), d(c, s));
|
|
116
|
-
}),
|
|
127
|
+
}), g(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
117
128
|
}
|
|
118
129
|
export {
|
|
119
130
|
b as formatPriceVariable,
|
|
120
|
-
|
|
131
|
+
E as prepareRecommendationBlocks
|
|
121
132
|
};
|
|
@@ -75,8 +75,7 @@ const e = {
|
|
|
75
75
|
"The image with the invalid link cannot be saved to the image gallery": "Enter a valid image link to continue.",
|
|
76
76
|
"The data source link is unavailable. Please, make sure there is an access to the data source.": "Enter an accessible Data Source Link to contiue.",
|
|
77
77
|
"The file should not exceed the maximum resolution of {maxImageResolution}px.": "Upload files up to 1024x512 pixels to continue.",
|
|
78
|
-
"The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor."
|
|
79
|
-
"Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit."
|
|
78
|
+
"The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor."
|
|
80
79
|
};
|
|
81
80
|
export {
|
|
82
81
|
e as default
|
|
@@ -1,45 +1,52 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { BlockId as
|
|
5
|
-
import { getMigrationBannerHtml as
|
|
6
|
-
import { Block as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var I = (r, n, t) => n in r ? k(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
|
+
var u = (r, n, t) => I(r, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { BlockId as B } from "../../../enums/block.js";
|
|
5
|
+
import { getMigrationBannerHtml as _ } from "../../../utils/migrationBannerHtml.js";
|
|
6
|
+
import { Block as b, BlockCompositionType as R, ModificationDescription as y } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { regenerateMobileProductRows as C } from "./controls/main/utils.js";
|
|
8
|
+
import { ensureMobileCssRulesExist as g, setMobileLayoutOptOut as d, hasMobileLayoutOptOut as A } from "./controls/mobileLayout/cssRules.js";
|
|
9
|
+
import { RecommendationConfigService as c } from "./services/configService.js";
|
|
10
|
+
import { useRecommendationExtensionStore as p } from "./store/recommendation.js";
|
|
11
|
+
import { getDefaultTemplate as E } from "./templates/grid/template.js";
|
|
12
|
+
const f = B.Recommendation, a = "recommendation-block-v2", l = "recommendation-id";
|
|
13
|
+
let h = !1;
|
|
14
|
+
class q extends b {
|
|
13
15
|
constructor() {
|
|
14
16
|
super();
|
|
15
17
|
/**
|
|
16
18
|
* Stores the ID generated in getTemplate() so onCreated() can reuse it.
|
|
17
19
|
* This avoids generating a new (different) ID in onCreated().
|
|
18
20
|
*/
|
|
19
|
-
|
|
21
|
+
u(this, "_pendingBlockId", null);
|
|
20
22
|
}
|
|
21
23
|
getId() {
|
|
22
|
-
return
|
|
24
|
+
return f;
|
|
23
25
|
}
|
|
24
26
|
getIcon() {
|
|
25
27
|
return "recommendation-icon";
|
|
26
28
|
}
|
|
27
29
|
getBlockCompositionType() {
|
|
28
|
-
return
|
|
30
|
+
return R.CONTAINER;
|
|
29
31
|
}
|
|
30
32
|
getName() {
|
|
31
33
|
return this.api.translate("Recommendation Block");
|
|
32
34
|
}
|
|
33
35
|
getDescription() {
|
|
34
|
-
return this.api.translate(
|
|
36
|
+
return this.api.translate(
|
|
37
|
+
"Recommendation lets you display personalized product recommendations to users based on their algorithm."
|
|
38
|
+
);
|
|
35
39
|
}
|
|
36
40
|
getSettingsPanelTitleHtml() {
|
|
37
|
-
return
|
|
38
|
-
|
|
41
|
+
return _(
|
|
42
|
+
f,
|
|
39
43
|
this.api.translate("Recommendation Block"),
|
|
40
44
|
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.")
|
|
41
45
|
);
|
|
42
46
|
}
|
|
47
|
+
allowInnerBlocksDND() {
|
|
48
|
+
return !1;
|
|
49
|
+
}
|
|
43
50
|
/**
|
|
44
51
|
* Returns the template HTML for a new recommendation block.
|
|
45
52
|
* Generates a unique recommendation ID and embeds the instance class
|
|
@@ -49,7 +56,7 @@ class T extends B {
|
|
|
49
56
|
*/
|
|
50
57
|
getTemplate() {
|
|
51
58
|
const t = this._generateNextId();
|
|
52
|
-
return this._pendingBlockId = t,
|
|
59
|
+
return this._pendingBlockId = t, E(t);
|
|
53
60
|
}
|
|
54
61
|
/**
|
|
55
62
|
* Called when a new block is dropped into the template
|
|
@@ -61,8 +68,13 @@ class T extends B {
|
|
|
61
68
|
onCreated(t) {
|
|
62
69
|
const e = this._pendingBlockId ?? this._generateNextId();
|
|
63
70
|
this._pendingBlockId = null, this._assignRecommendationId(t, e);
|
|
64
|
-
const
|
|
65
|
-
i.setCurrentBlock(e),
|
|
71
|
+
const o = c.initializeConfig(this.api, t, { recommendationId: e }), i = p();
|
|
72
|
+
i.setCurrentBlock(e), g(this.api);
|
|
73
|
+
const s = this._getBlockElement(t);
|
|
74
|
+
s && (d(this.api, s, !0), C({
|
|
75
|
+
currentNode: t,
|
|
76
|
+
documentModifier: this.api.getDocumentModifier()
|
|
77
|
+
})), i.patchCurrentBlockConfig({ language: o.language }, { triggerRefetch: !1 });
|
|
66
78
|
}
|
|
67
79
|
/**
|
|
68
80
|
* Called when the document changes or template is loaded
|
|
@@ -75,14 +87,23 @@ class T extends B {
|
|
|
75
87
|
if (!(!t || !("getNodeConfig" in t))) {
|
|
76
88
|
if (!this._getRecommendationId(t)) {
|
|
77
89
|
const e = this._generateNextId();
|
|
78
|
-
this._assignRecommendationId(t, e),
|
|
90
|
+
this._assignRecommendationId(t, e), c.hasConfig(t) && c.updateConfig(
|
|
79
91
|
this.api,
|
|
80
92
|
t,
|
|
81
93
|
{ recommendationId: e },
|
|
82
94
|
"Assign recommendation ID to legacy block"
|
|
83
95
|
);
|
|
84
96
|
}
|
|
85
|
-
|
|
97
|
+
c.needsMigration(t) && this._migrateFromLegacy(t);
|
|
98
|
+
try {
|
|
99
|
+
h || (g(this.api), h = !0);
|
|
100
|
+
const e = c.getConfig(t), o = this._getBlockElement(t);
|
|
101
|
+
if (o) {
|
|
102
|
+
const i = !e.mobileLayoutEnabled;
|
|
103
|
+
A(o) !== i && d(this.api, o, i);
|
|
104
|
+
}
|
|
105
|
+
} catch {
|
|
106
|
+
}
|
|
86
107
|
}
|
|
87
108
|
}
|
|
88
109
|
/**
|
|
@@ -93,7 +114,7 @@ class T extends B {
|
|
|
93
114
|
*/
|
|
94
115
|
onDelete(t) {
|
|
95
116
|
const e = this._getRecommendationId(t);
|
|
96
|
-
e &&
|
|
117
|
+
e && p().removeBlockState(e);
|
|
97
118
|
}
|
|
98
119
|
/**
|
|
99
120
|
* Generates the next unique recommendation ID by scanning all existing blocks
|
|
@@ -103,10 +124,10 @@ class T extends B {
|
|
|
103
124
|
let t = 0;
|
|
104
125
|
try {
|
|
105
126
|
const e = this.api.getDocumentRoot();
|
|
106
|
-
e && "querySelectorAll" in e && e.querySelectorAll(`.${
|
|
127
|
+
e && "querySelectorAll" in e && e.querySelectorAll(`.${a}`).forEach((i) => {
|
|
107
128
|
if ("getAttribute" in i) {
|
|
108
|
-
const
|
|
109
|
-
|
|
129
|
+
const s = i.getAttribute(l), m = s ? parseInt(s) : 0;
|
|
130
|
+
m > t && (t = m);
|
|
110
131
|
}
|
|
111
132
|
});
|
|
112
133
|
} catch {
|
|
@@ -120,11 +141,11 @@ class T extends B {
|
|
|
120
141
|
* added classes via setAttribute.
|
|
121
142
|
*/
|
|
122
143
|
_assignRecommendationId(t, e) {
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
144
|
+
const o = this._getBlockElement(t);
|
|
145
|
+
if (!o)
|
|
125
146
|
return;
|
|
126
147
|
const i = this.api.getDocumentModifier();
|
|
127
|
-
i.modifyHtml(
|
|
148
|
+
i.modifyHtml(o).setAttribute(l, e.toString()), i.apply(new y(`Assign recommendation ID ${e}`));
|
|
128
149
|
}
|
|
129
150
|
/**
|
|
130
151
|
* Gets the recommendation-id from a block node
|
|
@@ -133,10 +154,10 @@ class T extends B {
|
|
|
133
154
|
const e = this._getBlockElement(t);
|
|
134
155
|
if (!e || !("getAttribute" in e))
|
|
135
156
|
return null;
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
157
|
+
const o = e.getAttribute(l);
|
|
158
|
+
if (!o)
|
|
138
159
|
return null;
|
|
139
|
-
const i = parseInt(
|
|
160
|
+
const i = parseInt(o);
|
|
140
161
|
return Number.isNaN(i) ? null : i;
|
|
141
162
|
}
|
|
142
163
|
/**
|
|
@@ -145,19 +166,19 @@ class T extends B {
|
|
|
145
166
|
_getBlockElement(t) {
|
|
146
167
|
if ("getAttribute" in t) {
|
|
147
168
|
const e = t.getAttribute("class");
|
|
148
|
-
if (e && e.includes(
|
|
169
|
+
if (e && e.includes(a))
|
|
149
170
|
return t;
|
|
150
171
|
}
|
|
151
|
-
return "querySelector" in t ? t.querySelector(`.${
|
|
172
|
+
return "querySelector" in t ? t.querySelector(`.${a}`) : null;
|
|
152
173
|
}
|
|
153
174
|
/**
|
|
154
175
|
* Migrate configuration from legacy format
|
|
155
176
|
*/
|
|
156
177
|
_migrateFromLegacy(t) {
|
|
157
|
-
|
|
178
|
+
c.migrateFromDataAttributes(this.api, t);
|
|
158
179
|
}
|
|
159
180
|
}
|
|
160
181
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
182
|
+
f as BLOCK_ID,
|
|
183
|
+
q as RecommendationBlock
|
|
163
184
|
};
|
|
@@ -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))(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))(b || {});
|
|
2
2
|
export {
|
|
3
3
|
b as RecommendationBlockId
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (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))(o || {});
|
|
1
|
+
var o = /* @__PURE__ */ ((c) => (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.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
2
2
|
export {
|
|
3
3
|
o as RecommendationControlId
|
|
4
4
|
};
|
|
@@ -1,69 +1,71 @@
|
|
|
1
|
-
import { DEFAULT_MOBILE_ROW_SPACING as
|
|
2
|
-
import { ATTR_PRODUCT_IMAGE as _, ATTR_PRODUCT_NAME as
|
|
3
|
-
const
|
|
1
|
+
import { DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_ROW_SPACING as i, DEFAULT_COLUMN_SPACING as s, DEFAULT_MOBILE_CARDS_IN_ROW as o, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
|
|
2
|
+
import { ATTR_PRODUCT_IMAGE as _, ATTR_PRODUCT_NAME as e, ATTR_PRODUCT_OLD_PRICE as t, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as I, ATTR_PRODUCT_BUTTON as n } from "./selectors.js";
|
|
3
|
+
const O = {
|
|
4
4
|
code: "USD",
|
|
5
5
|
symbol: "USD",
|
|
6
6
|
alignment: "after",
|
|
7
7
|
decimalCount: 2,
|
|
8
8
|
decimalSeparator: ".",
|
|
9
9
|
thousandSeparator: ","
|
|
10
|
-
},
|
|
10
|
+
}, D = {
|
|
11
11
|
textBefore: "",
|
|
12
12
|
textAfter: ""
|
|
13
|
-
},
|
|
13
|
+
}, A = {
|
|
14
14
|
textBefore: "",
|
|
15
15
|
textAfter: ""
|
|
16
|
-
},
|
|
16
|
+
}, a = [
|
|
17
17
|
_,
|
|
18
|
-
o,
|
|
19
|
-
t,
|
|
20
18
|
e,
|
|
19
|
+
t,
|
|
21
20
|
T,
|
|
21
|
+
r,
|
|
22
22
|
I,
|
|
23
|
-
|
|
24
|
-
],
|
|
23
|
+
n
|
|
24
|
+
], E = {
|
|
25
25
|
[_]: !0,
|
|
26
|
-
[o]: !0,
|
|
27
26
|
[e]: !0,
|
|
27
|
+
[T]: !0,
|
|
28
28
|
[t]: !0,
|
|
29
|
-
[
|
|
29
|
+
[r]: !1,
|
|
30
30
|
[I]: !1,
|
|
31
|
-
[
|
|
32
|
-
},
|
|
31
|
+
[n]: !0
|
|
32
|
+
}, l = {
|
|
33
33
|
// Settings
|
|
34
34
|
strategy: "mostPopular",
|
|
35
35
|
productIds: [],
|
|
36
36
|
size: "6",
|
|
37
37
|
shuffleProducts: !1,
|
|
38
38
|
language: "en_US",
|
|
39
|
-
currency:
|
|
39
|
+
currency: O,
|
|
40
40
|
filters: [],
|
|
41
41
|
// Layout
|
|
42
42
|
layout: "grid",
|
|
43
|
-
cardsInRow:
|
|
44
|
-
mobileCardsInRow:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
cardsInRow: C,
|
|
44
|
+
mobileCardsInRow: o,
|
|
45
|
+
mobileLayoutEnabled: !1,
|
|
46
|
+
previousMobileCardsInRow: o,
|
|
47
|
+
columnSpacing: s,
|
|
48
|
+
rowSpacing: i,
|
|
49
|
+
mobileColumnSpacing: U,
|
|
50
|
+
mobileRowSpacing: R,
|
|
49
51
|
// Composition
|
|
50
|
-
composition:
|
|
51
|
-
visibility:
|
|
52
|
+
composition: a,
|
|
53
|
+
visibility: E,
|
|
52
54
|
// Element settings
|
|
53
|
-
omnibusPrice:
|
|
54
|
-
omnibusDiscount:
|
|
55
|
+
omnibusPrice: D,
|
|
56
|
+
omnibusDiscount: A,
|
|
55
57
|
textTrimming: !1,
|
|
56
58
|
// Meta
|
|
57
59
|
configVersion: 1,
|
|
58
60
|
recommendationId: 0
|
|
59
|
-
},
|
|
61
|
+
}, N = [11, 12], m = 1;
|
|
60
62
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
m as CURRENT_CONFIG_VERSION,
|
|
64
|
+
a as DEFAULT_COMPOSITION,
|
|
65
|
+
O as DEFAULT_CURRENCY,
|
|
66
|
+
l as DEFAULT_NODE_CONFIG,
|
|
67
|
+
A as DEFAULT_OMNIBUS_DISCOUNT,
|
|
68
|
+
D as DEFAULT_OMNIBUS_PRICE,
|
|
69
|
+
E as DEFAULT_VISIBILITY,
|
|
70
|
+
N as EXCLUDED_ALGORITHM_IDS
|
|
69
71
|
};
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
const
|
|
1
|
+
const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", t = ".ins-recommendation-mobile-container", n = ".ins-recommendation-mobile-row", R = {
|
|
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
|
+
}, r = "productImage", O = "productName", _ = "productPrice", e = "productOldPrice", s = "productOmnibusPrice", C = "productOmnibusDiscount", E = "productButton", A = "customAttr:", i = "data-custom-attributes", u = "product-attr";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
A as ATTR_CUSTOM_PREFIX,
|
|
11
|
+
i as ATTR_DATA_CUSTOM_ATTRIBUTES,
|
|
12
|
+
u as ATTR_PRODUCT_ATTR,
|
|
13
|
+
E as ATTR_PRODUCT_BUTTON,
|
|
14
|
+
r as ATTR_PRODUCT_IMAGE,
|
|
12
15
|
O as ATTR_PRODUCT_NAME,
|
|
13
|
-
|
|
16
|
+
e as ATTR_PRODUCT_OLD_PRICE,
|
|
14
17
|
C as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
s as ATTR_PRODUCT_OMNIBUS_PRICE,
|
|
19
|
+
_ as ATTR_PRODUCT_PRICE,
|
|
20
|
+
T as BLOCK_ROOT_SELECTOR,
|
|
21
|
+
c as CONTAINER_SELECTOR,
|
|
22
|
+
R as CURRENCY_ATTR,
|
|
20
23
|
o as DESKTOP_CONTAINER_SELECTOR,
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
t as MOBILE_CONTAINER_SELECTOR,
|
|
25
|
+
n as MOBILE_ROW_SELECTOR
|
|
23
26
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModificationDescription as d } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { CommonControl as s } from "../../../common-control.js";
|
|
3
3
|
import { getCurrentLayout as l } from "../main/utils.js";
|
|
4
|
-
const
|
|
4
|
+
const i = "recommendation-card-background-color-control", e = {
|
|
5
5
|
CARD_BACKGROUND_COLOR: "cardBackgroundColor"
|
|
6
6
|
}, a = {
|
|
7
7
|
GRID: ".product-card-segment",
|
|
@@ -9,13 +9,13 @@ const u = "recommendation-card-background-color-control", e = {
|
|
|
9
9
|
};
|
|
10
10
|
class _ extends s {
|
|
11
11
|
getId() {
|
|
12
|
-
return
|
|
12
|
+
return i;
|
|
13
13
|
}
|
|
14
14
|
getTemplate() {
|
|
15
15
|
return `
|
|
16
16
|
<div class="card-bg-control-container">
|
|
17
17
|
${this._GuTwoColumns([
|
|
18
|
-
this._GuLabel({ text: "Card Background Color" }),
|
|
18
|
+
this._GuLabel({ text: this.api.translate("Card Background Color") }),
|
|
19
19
|
this._GuColorPicker(e.CARD_BACKGROUND_COLOR)
|
|
20
20
|
])}
|
|
21
21
|
</div>
|
|
@@ -75,6 +75,6 @@ class _ extends s {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
i as CARD_BACKGROUND_COLOR_CONTROL_ID,
|
|
79
79
|
_ as CardBackgroundColorControl
|
|
80
80
|
};
|