@useinsider/guido 2.1.0-beta.9ba2e9d → 2.1.0-beta.a67f307
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/@types/config/schemas.js +70 -65
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +69 -58
- package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
- package/dist/composables/useBlocksConfig.js +26 -16
- package/dist/composables/useHtmlValidator.js +107 -119
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +70 -96
- package/dist/config/migrator/itemsBlockMigrator.js +101 -97
- package/dist/enums/defaults.js +8 -4
- package/dist/enums/extensions/recommendationBlock.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +26 -23
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +27 -26
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +6 -4
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +12 -10
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +103 -70
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +87 -37
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +138 -117
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +117 -107
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +43 -31
- package/dist/extensions/ModulesTabIcons/extension.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
- package/dist/services/recommendationApi.js +11 -9
- package/dist/src/@types/config/schemas.d.ts +8 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/defaults.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -3
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/static/styles/components/notification.css.js +1 -0
- package/dist/static/styles/components/version-history.css.js +10 -2
- package/dist/static/styles/components/wide-panel.css.js +18 -2
- package/dist/static/styles/customEditorStyle.css.js +10 -9
- package/package.json +2 -2
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { ModificationDescription as
|
|
2
|
-
import { RecommendationBlockId as
|
|
3
|
-
import { CURRENCY_ATTR as y, CONTAINER_SELECTOR as
|
|
4
|
-
import {
|
|
1
|
+
import { ModificationDescription as S } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RecommendationBlockId as m } from "../../constants/blockIds.js";
|
|
3
|
+
import { CURRENCY_ATTR as y, MOBILE_CONTAINER_SELECTOR as T, DESKTOP_CONTAINER_SELECTOR as w, CONTAINER_SELECTOR as _ } from "../../constants/selectors.js";
|
|
4
|
+
import { RecommendationConfigService as k } from "../../services/configService.js";
|
|
5
|
+
import { useRecommendationExtensionStore as b } from "../../store/recommendation.js";
|
|
5
6
|
import { prepareProductRows as R } from "../../templates/index.js";
|
|
6
|
-
import { formatPrice as
|
|
7
|
-
import { isTdNode as
|
|
8
|
-
import { sanitizeImageUrl as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
7
|
+
import { formatPrice as D } from "../../utils/priceFormatter.js";
|
|
8
|
+
import { isTdNode as L } from "../../utils/tagName.js";
|
|
9
|
+
import { sanitizeImageUrl as U, getDefaultProducts as H, DEFAULT_CARD_COMPOSITION as C } from "../../templates/utils.js";
|
|
10
|
+
const q = "ins-recommendation-v3-block-v2";
|
|
11
|
+
function E(o) {
|
|
11
12
|
if (!o)
|
|
12
13
|
return null;
|
|
13
14
|
if ("getAttribute" in o) {
|
|
14
15
|
const e = o.getAttribute("class");
|
|
15
|
-
if (e && e.includes(
|
|
16
|
+
if (e && e.includes(q))
|
|
16
17
|
return o;
|
|
17
18
|
}
|
|
18
|
-
return "querySelector" in o ? o.querySelector(`.${
|
|
19
|
+
return "querySelector" in o ? o.querySelector(`.${q}`) : null;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
const e =
|
|
21
|
+
function P(o) {
|
|
22
|
+
const e = E(o);
|
|
22
23
|
if (!e || !("getAttribute" in e))
|
|
23
24
|
return "grid";
|
|
24
25
|
const t = e.getAttribute("data-layout");
|
|
25
26
|
return t === "list" || t === "horizontal" ? "list" : "grid";
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
const e =
|
|
28
|
+
function N(o) {
|
|
29
|
+
const e = E(o);
|
|
29
30
|
if (!e || !("getAttribute" in e))
|
|
30
|
-
return
|
|
31
|
+
return C;
|
|
31
32
|
const t = e.getAttribute("data-card-composition");
|
|
32
|
-
return t ? t.split(",").filter(Boolean) :
|
|
33
|
+
return t ? t.split(",").filter(Boolean) : C;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function g(o, e, t) {
|
|
35
36
|
if (!e || !("childNodes" in e))
|
|
36
37
|
return !1;
|
|
37
38
|
const n = e.childNodes().find(
|
|
@@ -39,23 +40,42 @@ function S(o, e, t) {
|
|
|
39
40
|
);
|
|
40
41
|
return n ? (o.modifyHtml(n).setText(t), !0) : !1;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
return o && o.length > 0 ? o : e.length > 0 ? e :
|
|
43
|
+
function h(o, e) {
|
|
44
|
+
return o && o.length > 0 ? o : e.length > 0 ? e : H();
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
const { currentNode: e, documentModifier: t,
|
|
46
|
+
function $(o) {
|
|
47
|
+
const { currentNode: e, documentModifier: t, products: r, layout: n } = o;
|
|
48
|
+
if (!e || !("querySelector" in e))
|
|
49
|
+
return;
|
|
50
|
+
const i = e.querySelector(T);
|
|
51
|
+
if (!i)
|
|
52
|
+
return;
|
|
53
|
+
const c = b(), u = k.getConfig(e), l = h(r, c.recommendationProducts), s = N(e), d = n ?? P(e), a = R(l, d, {
|
|
54
|
+
productsPerRow: u.mobileCardsInRow,
|
|
55
|
+
composition: s
|
|
56
|
+
});
|
|
57
|
+
t.modifyHtml(i).setInnerHtml(a).apply(new S("Updated mobile product rows"));
|
|
58
|
+
}
|
|
59
|
+
function x(o) {
|
|
60
|
+
const {
|
|
61
|
+
currentNode: e,
|
|
62
|
+
documentModifier: t,
|
|
63
|
+
afterRegenerate: r,
|
|
64
|
+
products: n,
|
|
65
|
+
layout: i
|
|
66
|
+
} = o;
|
|
47
67
|
if (!e || !("querySelector" in e))
|
|
48
68
|
return;
|
|
49
|
-
const c = e.querySelector(
|
|
69
|
+
const c = e.querySelector(w) ?? e.querySelector(_);
|
|
50
70
|
if (!c)
|
|
51
71
|
return;
|
|
52
|
-
const
|
|
53
|
-
productsPerRow:
|
|
72
|
+
const u = b(), l = h(n, u.recommendationProducts), { cardsInRow: s } = u.recommendationConfigs, d = N(e), a = i ?? P(e), p = R(l, a, {
|
|
73
|
+
productsPerRow: s,
|
|
54
74
|
composition: d
|
|
55
75
|
});
|
|
56
|
-
t.modifyHtml(c).setInnerHtml(p).apply(new
|
|
76
|
+
t.modifyHtml(c).setInnerHtml(p).apply(new S("Updated product")), $(o), r == null || r();
|
|
57
77
|
}
|
|
58
|
-
function
|
|
78
|
+
function B(o, e, t, r) {
|
|
59
79
|
const i = `0 ${Math.floor(t / 2)}px`;
|
|
60
80
|
let c = !1;
|
|
61
81
|
return r === "grid" ? Array.from(
|
|
@@ -65,29 +85,29 @@ function $(o, e, t, r) {
|
|
|
65
85
|
}) : Array.from(
|
|
66
86
|
o.querySelectorAll(".product-card-wrapper")
|
|
67
87
|
).forEach((l) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
88
|
+
const s = "parentNode" in l ? l.parentNode : null;
|
|
89
|
+
s && L(s) && (e.modifyHtml(s).setStyle("padding", i), c = !0);
|
|
70
90
|
}), c;
|
|
71
91
|
}
|
|
72
|
-
function
|
|
92
|
+
function v(o, e, t) {
|
|
73
93
|
const r = `${t}px`, n = Array.from(o.querySelectorAll(".spacer"));
|
|
74
94
|
let i = !1;
|
|
75
95
|
return n.forEach((c) => {
|
|
76
96
|
e.modifyHtml(c).setStyle("height", r), i = !0;
|
|
77
97
|
}), i;
|
|
78
98
|
}
|
|
79
|
-
function
|
|
99
|
+
function V(o) {
|
|
80
100
|
const { currentNode: e, documentModifier: t } = o;
|
|
81
101
|
if (!e)
|
|
82
102
|
return;
|
|
83
|
-
const r =
|
|
103
|
+
const r = E(e);
|
|
84
104
|
if (!r || !("getAttribute" in r))
|
|
85
105
|
return;
|
|
86
|
-
const n = r.getAttribute("data-column-spacing"), i = r.getAttribute("data-row-spacing"), c =
|
|
87
|
-
let
|
|
106
|
+
const n = r.getAttribute("data-column-spacing"), i = r.getAttribute("data-row-spacing"), c = P(e);
|
|
107
|
+
let u = !1;
|
|
88
108
|
if (n) {
|
|
89
109
|
const l = parseInt(n);
|
|
90
|
-
Number.isNaN(l) || (
|
|
110
|
+
Number.isNaN(l) || (u = B(
|
|
91
111
|
e,
|
|
92
112
|
t,
|
|
93
113
|
l,
|
|
@@ -97,28 +117,28 @@ function H(o) {
|
|
|
97
117
|
if (i) {
|
|
98
118
|
const l = parseInt(i);
|
|
99
119
|
if (!Number.isNaN(l)) {
|
|
100
|
-
const
|
|
101
|
-
|
|
120
|
+
const s = v(e, t, l);
|
|
121
|
+
u = u || s;
|
|
102
122
|
}
|
|
103
123
|
}
|
|
104
|
-
|
|
124
|
+
u && t.apply(new S("Reapply spacing after regeneration"));
|
|
105
125
|
}
|
|
106
|
-
function
|
|
126
|
+
function ee(o) {
|
|
107
127
|
const { currentNode: e, documentModifier: t, afterRegenerate: r, products: n, layout: i } = o;
|
|
108
|
-
e &&
|
|
128
|
+
e && x({
|
|
109
129
|
currentNode: e,
|
|
110
130
|
documentModifier: t,
|
|
111
131
|
products: n,
|
|
112
132
|
layout: i,
|
|
113
133
|
afterRegenerate: () => {
|
|
114
134
|
setTimeout(() => {
|
|
115
|
-
|
|
135
|
+
V({ currentNode: e, documentModifier: t });
|
|
116
136
|
}, 0), r == null || r();
|
|
117
137
|
}
|
|
118
138
|
});
|
|
119
139
|
}
|
|
120
|
-
function
|
|
121
|
-
const o =
|
|
140
|
+
function M() {
|
|
141
|
+
const o = b(), { currencySettings: e } = o.recommendationConfigs;
|
|
122
142
|
return {
|
|
123
143
|
code: e.value,
|
|
124
144
|
symbol: e.symbol,
|
|
@@ -128,40 +148,40 @@ function h() {
|
|
|
128
148
|
thousandSeparator: e.thousandSeparator
|
|
129
149
|
};
|
|
130
150
|
}
|
|
131
|
-
function
|
|
132
|
-
const t =
|
|
133
|
-
return
|
|
151
|
+
function A(o, e = "price") {
|
|
152
|
+
const t = M(), r = o[e], n = (r == null ? void 0 : r[t.code]) ?? Object.values(r ?? {})[0] ?? 0;
|
|
153
|
+
return D({
|
|
134
154
|
price: n,
|
|
135
155
|
currency: t
|
|
136
156
|
});
|
|
137
157
|
}
|
|
138
|
-
function
|
|
158
|
+
function j(o) {
|
|
139
159
|
var i, c;
|
|
140
|
-
const e =
|
|
160
|
+
const e = M(), t = ((i = o.original_price) == null ? void 0 : i[e.code]) ?? Object.values(o.original_price ?? {})[0] ?? 0, r = ((c = o.price) == null ? void 0 : c[e.code]) ?? Object.values(o.price ?? {})[0] ?? 0, n = t > 0 ? Math.round((t - r) / t * 100) : 0;
|
|
141
161
|
return n > 0 ? `-${n}%` : "0%";
|
|
142
162
|
}
|
|
143
|
-
function
|
|
163
|
+
function I(o) {
|
|
144
164
|
const { documentModifier: e, product: t, priceEl: r, oldPriceEl: n, omnibusPriceEl: i, omnibusDiscountEl: c } = o;
|
|
145
|
-
let
|
|
165
|
+
let u = !1;
|
|
146
166
|
if (r && "querySelector" in r) {
|
|
147
|
-
const l = r.querySelector("strong"),
|
|
148
|
-
|
|
167
|
+
const l = r.querySelector("strong"), s = A(t, "price");
|
|
168
|
+
g(e, l, s) && (u = !0);
|
|
149
169
|
}
|
|
150
170
|
if (n && "querySelector" in n) {
|
|
151
|
-
const l = n.querySelector("strong"),
|
|
152
|
-
|
|
171
|
+
const l = n.querySelector("strong"), s = A(t, "original_price");
|
|
172
|
+
g(e, l, s) && (u = !0);
|
|
153
173
|
}
|
|
154
174
|
if (i && "querySelector" in i) {
|
|
155
|
-
const l = i.querySelector(".omnibus-price-value"),
|
|
156
|
-
|
|
175
|
+
const l = i.querySelector(".omnibus-price-value"), s = A(t, "original_price");
|
|
176
|
+
g(e, l, s) && (u = !0);
|
|
157
177
|
}
|
|
158
178
|
if (c && "querySelector" in c) {
|
|
159
|
-
const l = c.querySelector(".omnibus-discount-value"),
|
|
160
|
-
|
|
179
|
+
const l = c.querySelector(".omnibus-discount-value"), s = j(t);
|
|
180
|
+
g(e, l, s) && (u = !0);
|
|
161
181
|
}
|
|
162
|
-
return
|
|
182
|
+
return u;
|
|
163
183
|
}
|
|
164
|
-
function
|
|
184
|
+
function W(o) {
|
|
165
185
|
const {
|
|
166
186
|
documentModifier: e,
|
|
167
187
|
product: t,
|
|
@@ -169,118 +189,119 @@ function B(o) {
|
|
|
169
189
|
nameEl: n,
|
|
170
190
|
priceEl: i,
|
|
171
191
|
oldPriceEl: c,
|
|
172
|
-
omnibusPriceEl:
|
|
192
|
+
omnibusPriceEl: u,
|
|
173
193
|
omnibusDiscountEl: l,
|
|
174
|
-
buttonEl:
|
|
194
|
+
buttonEl: s
|
|
175
195
|
} = o;
|
|
176
196
|
let d = !1;
|
|
177
197
|
if (r && "querySelector" in r) {
|
|
178
198
|
const a = r.querySelector("img");
|
|
179
|
-
a && (e.modifyHtml(a).setAttribute("src",
|
|
199
|
+
a && (e.modifyHtml(a).setAttribute("src", U(t.image_url)).setAttribute("alt", t.name), d = !0);
|
|
180
200
|
const p = r.querySelector("a");
|
|
181
201
|
p && (e.modifyHtml(p).setAttribute("href", t.url), d = !0);
|
|
182
202
|
}
|
|
183
203
|
if (n && "querySelector" in n) {
|
|
184
204
|
const a = n.querySelector("strong");
|
|
185
|
-
|
|
205
|
+
g(e, a, t.name) && (d = !0);
|
|
186
206
|
}
|
|
187
|
-
if (
|
|
207
|
+
if (I({
|
|
188
208
|
documentModifier: e,
|
|
189
209
|
product: t,
|
|
190
210
|
priceEl: i,
|
|
191
211
|
oldPriceEl: c,
|
|
192
|
-
omnibusPriceEl:
|
|
212
|
+
omnibusPriceEl: u,
|
|
193
213
|
omnibusDiscountEl: l
|
|
194
|
-
}) && (d = !0),
|
|
195
|
-
const a =
|
|
214
|
+
}) && (d = !0), s && "querySelector" in s) {
|
|
215
|
+
const a = s.querySelector("a.es-button") || s.querySelector("a");
|
|
196
216
|
a && (e.modifyHtml(a).setAttribute("href", t.url), d = !0);
|
|
197
217
|
}
|
|
198
218
|
return d;
|
|
199
219
|
}
|
|
200
|
-
function
|
|
220
|
+
function te(o) {
|
|
201
221
|
const { currentNode: e, documentModifier: t, products: r } = o;
|
|
202
222
|
if (!e || !("querySelectorAll" in e))
|
|
203
223
|
return !1;
|
|
204
224
|
const n = e.querySelectorAll(
|
|
205
|
-
`[esd-extension-block-id="${
|
|
225
|
+
`[esd-extension-block-id="${m.IMAGE}"]`
|
|
206
226
|
), i = e.querySelectorAll(
|
|
207
|
-
`[esd-extension-block-id="${
|
|
227
|
+
`[esd-extension-block-id="${m.NAME}"]`
|
|
208
228
|
), c = e.querySelectorAll(
|
|
209
|
-
`[esd-extension-block-id="${
|
|
210
|
-
), s = e.querySelectorAll(
|
|
211
|
-
`[esd-extension-block-id="${f.OLD_PRICE}"]`
|
|
212
|
-
), l = e.querySelectorAll(
|
|
213
|
-
`[esd-extension-block-id="${f.OMNIBUS_PRICE}"]`
|
|
229
|
+
`[esd-extension-block-id="${m.PRICE}"]`
|
|
214
230
|
), u = e.querySelectorAll(
|
|
215
|
-
`[esd-extension-block-id="${
|
|
231
|
+
`[esd-extension-block-id="${m.OLD_PRICE}"]`
|
|
232
|
+
), l = e.querySelectorAll(
|
|
233
|
+
`[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
|
|
234
|
+
), s = e.querySelectorAll(
|
|
235
|
+
`[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
|
|
216
236
|
), d = e.querySelectorAll(
|
|
217
|
-
`[esd-extension-block-id="${
|
|
237
|
+
`[esd-extension-block-id="${m.BUTTON}"]`
|
|
218
238
|
);
|
|
219
239
|
if (n.length !== r.length)
|
|
220
240
|
return !1;
|
|
221
241
|
let a = !1;
|
|
222
|
-
return r.forEach((p,
|
|
223
|
-
const
|
|
242
|
+
return r.forEach((p, f) => {
|
|
243
|
+
const O = W({
|
|
224
244
|
documentModifier: t,
|
|
225
245
|
product: p,
|
|
226
|
-
imageEl: n[
|
|
227
|
-
nameEl: i[
|
|
228
|
-
priceEl: c[
|
|
229
|
-
oldPriceEl:
|
|
230
|
-
omnibusPriceEl: l[
|
|
231
|
-
omnibusDiscountEl:
|
|
232
|
-
buttonEl: d[
|
|
246
|
+
imageEl: n[f] ?? null,
|
|
247
|
+
nameEl: i[f] ?? null,
|
|
248
|
+
priceEl: c[f] ?? null,
|
|
249
|
+
oldPriceEl: u[f] ?? null,
|
|
250
|
+
omnibusPriceEl: l[f] ?? null,
|
|
251
|
+
omnibusDiscountEl: s[f] ?? null,
|
|
252
|
+
buttonEl: d[f] ?? null
|
|
233
253
|
});
|
|
234
|
-
a = a ||
|
|
235
|
-
}), a && t.apply(new
|
|
254
|
+
a = a || O;
|
|
255
|
+
}), a && t.apply(new S("Updated product content in-place")), !0;
|
|
236
256
|
}
|
|
237
|
-
function
|
|
257
|
+
function oe(o) {
|
|
238
258
|
const { currentNode: e, documentModifier: t } = o;
|
|
239
259
|
if (!e || !("querySelectorAll" in e))
|
|
240
260
|
return !1;
|
|
241
|
-
const n =
|
|
261
|
+
const n = b().recommendationProducts;
|
|
242
262
|
if (n.length === 0)
|
|
243
263
|
return !1;
|
|
244
264
|
const i = e.querySelectorAll(
|
|
245
|
-
`[esd-extension-block-id="${
|
|
265
|
+
`[esd-extension-block-id="${m.PRICE}"]`
|
|
246
266
|
), c = e.querySelectorAll(
|
|
247
|
-
`[esd-extension-block-id="${
|
|
248
|
-
),
|
|
249
|
-
`[esd-extension-block-id="${
|
|
267
|
+
`[esd-extension-block-id="${m.OLD_PRICE}"]`
|
|
268
|
+
), u = e.querySelectorAll(
|
|
269
|
+
`[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
|
|
250
270
|
), l = e.querySelectorAll(
|
|
251
|
-
`[esd-extension-block-id="${
|
|
271
|
+
`[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
|
|
252
272
|
);
|
|
253
|
-
let
|
|
273
|
+
let s = !1;
|
|
254
274
|
return n.forEach((d, a) => {
|
|
255
|
-
|
|
275
|
+
I({
|
|
256
276
|
documentModifier: t,
|
|
257
277
|
product: d,
|
|
258
278
|
priceEl: i[a] ?? null,
|
|
259
279
|
oldPriceEl: c[a] ?? null,
|
|
260
|
-
omnibusPriceEl:
|
|
280
|
+
omnibusPriceEl: u[a] ?? null,
|
|
261
281
|
omnibusDiscountEl: l[a] ?? null
|
|
262
|
-
}) && (
|
|
263
|
-
}),
|
|
282
|
+
}) && (s = !0);
|
|
283
|
+
}), s && t.apply(new S("Updated price formatting in-place")), s;
|
|
264
284
|
}
|
|
265
|
-
function
|
|
266
|
-
const { currentNode: e, documentModifier: t, currency: r } = o, n =
|
|
285
|
+
function re(o) {
|
|
286
|
+
const { currentNode: e, documentModifier: t, currency: r } = o, n = E(e);
|
|
267
287
|
if (!n)
|
|
268
288
|
return;
|
|
269
|
-
const i = r.alignment === "before" ? "0" : "1", c = (
|
|
270
|
-
t.modifyHtml(n).setAttribute(
|
|
289
|
+
const i = r.alignment === "before" ? "0" : "1", c = (u, l) => {
|
|
290
|
+
t.modifyHtml(n).setAttribute(u, l);
|
|
271
291
|
};
|
|
272
|
-
c(y.CURRENCY, r.code), c(y.SYMBOL, r.symbol), c(y.ALIGNMENT, i), c(y.THOUSAND_SEPARATOR, r.thousandSeparator), c(y.DECIMAL_SEPARATOR, r.decimalSeparator), c(y.DECIMAL_COUNT, r.decimalCount.toString()), t.apply(new
|
|
292
|
+
c(y.CURRENCY, r.code), c(y.SYMBOL, r.symbol), c(y.ALIGNMENT, i), c(y.THOUSAND_SEPARATOR, r.thousandSeparator), c(y.DECIMAL_SEPARATOR, r.decimalSeparator), c(y.DECIMAL_COUNT, r.decimalCount.toString()), t.apply(new S("Update currency attributes"));
|
|
273
293
|
}
|
|
274
294
|
export {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
295
|
+
A as formatProductPrice,
|
|
296
|
+
E as getBlockElement,
|
|
297
|
+
N as getCardComposition,
|
|
298
|
+
P as getCurrentLayout,
|
|
299
|
+
V as reapplySpacing,
|
|
300
|
+
$ as regenerateMobileProductRows,
|
|
301
|
+
x as regenerateProductRows,
|
|
302
|
+
ee as regenerateProductRowsWithStyles,
|
|
303
|
+
re as setCurrencyAttributes,
|
|
304
|
+
oe as updatePricesInPlace,
|
|
305
|
+
te as updateProductContentInPlace,
|
|
306
|
+
W as updateSingleProductContent
|
|
286
307
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ModificationDescription as r } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
const i = "ins-recommendation-desktop-container", s = "ins-recommendation-mobile-container", l = `.${s} { display: none; }`, u = `@media only screen and (max-width: 480px) { .${i} { display: none !important; } .${s} { display: table !important; } }`, c = `.${s}`;
|
|
3
|
+
function a(o, e) {
|
|
4
|
+
return !!o.querySelector(e);
|
|
5
|
+
}
|
|
6
|
+
function d(o) {
|
|
7
|
+
return o.querySelectorAll(`*${i}`).length > 0;
|
|
8
|
+
}
|
|
9
|
+
function p(o) {
|
|
10
|
+
const e = o.getDocumentRootCssNode();
|
|
11
|
+
if (!e)
|
|
12
|
+
return;
|
|
13
|
+
const n = o.getDocumentModifier();
|
|
14
|
+
let t = !1;
|
|
15
|
+
a(e, c) || (n.modifyCss(e).appendRule(l), t = !0), d(e) || (n.modifyCss(e).appendRule(u), t = !0), t && n.apply(new r("Add mobile layout CSS rules"));
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
i as CSS_CLASS_DESKTOP_CONTAINER,
|
|
19
|
+
s as CSS_CLASS_MOBILE_CONTAINER,
|
|
20
|
+
p as ensureMobileCssRulesExist
|
|
21
|
+
};
|