@useinsider/guido 3.7.0-beta.24a845f → 3.7.0-beta.24bdfa3
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/@types/config/schemas.js +70 -66
- package/dist/composables/usePreviewMode.js +15 -14
- package/dist/composables/useRecommendationPreview.js +100 -0
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +90 -82
- package/dist/config/migrator/recommendation/htmlBuilder.js +59 -58
- package/dist/config/migrator/recommendation/settingsMapper.js +38 -33
- package/dist/extensions/Blocks/Items/block.js +11 -16
- package/dist/extensions/Blocks/Recommendation/block.js +59 -43
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +41 -32
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +369 -288
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +84 -72
- package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +133 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +68 -66
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +21 -7
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +64 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +101 -72
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +31 -30
- package/dist/extensions/Blocks/Recommendation/templates/index.js +9 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +74 -59
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +88 -57
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useRecommendationPreview.d.ts +10 -0
- package/dist/src/composables/useRecommendationPreview.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +29 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +59 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +33 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +15 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/package.json +1 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { ModificationDescription as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlockId as m } from "../../constants/blockIds.js";
|
|
3
|
-
import { CURRENCY_ATTR as y, MOBILE_CONTAINER_SELECTOR as q, MOBILE_ROW_SELECTOR as k, DESKTOP_CONTAINER_SELECTOR as P, CONTAINER_SELECTOR as
|
|
4
|
-
import { RecommendationConfigService as
|
|
3
|
+
import { CURRENCY_ATTR as y, MOBILE_CONTAINER_SELECTOR as q, MOBILE_ROW_SELECTOR as k, DESKTOP_CONTAINER_SELECTOR as P, CONTAINER_SELECTOR as V, ATTR_PRODUCT_ATTR as W } from "../../constants/selectors.js";
|
|
4
|
+
import { RecommendationConfigService as b } from "../../services/configService.js";
|
|
5
5
|
import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
|
|
6
6
|
import { prepareProductRows as _ } from "../../templates/index.js";
|
|
7
|
-
import { formatPrice as
|
|
8
|
-
import { isTdNode as
|
|
9
|
-
import { getDefaultProducts as L, DEFAULT_CARD_COMPOSITION as
|
|
10
|
-
const
|
|
11
|
-
function
|
|
7
|
+
import { formatPrice as j } from "../../utils/priceFormatter.js";
|
|
8
|
+
import { isTdNode as F } from "../../utils/tagName.js";
|
|
9
|
+
import { getDefaultProducts as L, DEFAULT_CARD_COMPOSITION as R, sanitizeImageUrl as G, toDisplayableAttributeValue as Y } from "../../templates/utils.js";
|
|
10
|
+
const h = "recommendation-block-v2";
|
|
11
|
+
function M(t) {
|
|
12
12
|
if (!t)
|
|
13
13
|
return null;
|
|
14
14
|
if ("getAttribute" in t) {
|
|
15
15
|
const e = t.getAttribute("class");
|
|
16
|
-
if (e && e.includes(
|
|
16
|
+
if (e && e.includes(h))
|
|
17
17
|
return t;
|
|
18
18
|
}
|
|
19
|
-
return "querySelector" in t ? t.querySelector(`.${
|
|
19
|
+
return "querySelector" in t ? t.querySelector(`.${h}`) ?? null : null;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const e =
|
|
21
|
+
function E(t) {
|
|
22
|
+
const e = M(t);
|
|
23
23
|
if (!e || !("getAttribute" in e))
|
|
24
24
|
return "grid";
|
|
25
25
|
const o = e.getAttribute("data-layout");
|
|
26
26
|
return o === "list" || o === "horizontal" ? "list" : "grid";
|
|
27
27
|
}
|
|
28
28
|
function x(t) {
|
|
29
|
-
const e =
|
|
29
|
+
const e = M(t);
|
|
30
30
|
if (!e || !("getAttribute" in e))
|
|
31
|
-
return
|
|
31
|
+
return R;
|
|
32
32
|
const o = e.getAttribute("data-card-composition");
|
|
33
|
-
return o ? o.split(",").filter(Boolean) :
|
|
33
|
+
return o ? o.split(",").filter(Boolean) : R;
|
|
34
34
|
}
|
|
35
35
|
function D(t) {
|
|
36
36
|
if (!t || !("childNodes" in t))
|
|
@@ -47,14 +47,14 @@ function S(t, e, o) {
|
|
|
47
47
|
function U(t, e) {
|
|
48
48
|
return t && t.length > 0 ? t : e.length > 0 ? e : L();
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function K(t) {
|
|
51
51
|
const { currentNode: e, documentModifier: o } = t;
|
|
52
52
|
if (!e || !("querySelector" in e))
|
|
53
53
|
return;
|
|
54
54
|
const n = e.querySelector(k);
|
|
55
55
|
n && (o.modifyHtml(n).setInnerHtml(""), o.apply(new p("Cleared mobile row content")));
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function X(t) {
|
|
58
58
|
const {
|
|
59
59
|
currentNode: e,
|
|
60
60
|
documentModifier: o,
|
|
@@ -64,9 +64,9 @@ function K(t) {
|
|
|
64
64
|
} = t;
|
|
65
65
|
if (!e || !("querySelector" in e))
|
|
66
66
|
return;
|
|
67
|
-
const r = i ??
|
|
67
|
+
const r = i ?? E(e), s = b.getConfig(e);
|
|
68
68
|
if (r === "list" || !s.mobileLayoutEnabled) {
|
|
69
|
-
|
|
69
|
+
K({ currentNode: e, documentModifier: o });
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
const u = e.querySelector(k);
|
|
@@ -75,11 +75,12 @@ function K(t) {
|
|
|
75
75
|
const l = C(), d = U(n, l.recommendationProducts), a = c ?? x(e), g = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${_(d, r, {
|
|
76
76
|
productsPerRow: s.mobileCardsInRow,
|
|
77
77
|
composition: a,
|
|
78
|
-
filterList: l.filterList
|
|
78
|
+
filterList: l.filterList,
|
|
79
|
+
priceInline: !s.priceMovedToNextLine
|
|
79
80
|
})}</table></td>`;
|
|
80
81
|
o.modifyHtml(u).setInnerHtml(g), o.apply(new p("Updated mobile product rows"));
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function z(t) {
|
|
83
84
|
const {
|
|
84
85
|
currentNode: e,
|
|
85
86
|
documentModifier: o,
|
|
@@ -90,15 +91,16 @@ function X(t) {
|
|
|
90
91
|
} = t;
|
|
91
92
|
if (!e || !("querySelector" in e))
|
|
92
93
|
return;
|
|
93
|
-
const s = e.querySelector(P) ?? e.querySelector(
|
|
94
|
+
const s = e.querySelector(P) ?? e.querySelector(V);
|
|
94
95
|
if (!s)
|
|
95
96
|
return;
|
|
96
|
-
const u = C(), l = U(i, u.recommendationProducts), { cardsInRow: d } = u.recommendationConfigs, a = r ?? x(e), f = c ??
|
|
97
|
+
const u = C(), l = U(i, u.recommendationProducts), { cardsInRow: d } = u.recommendationConfigs, a = r ?? x(e), f = c ?? E(e), { priceMovedToNextLine: g } = b.getConfig(e), v = _(l, f, {
|
|
97
98
|
productsPerRow: d,
|
|
98
99
|
composition: a,
|
|
99
|
-
filterList: u.filterList
|
|
100
|
+
filterList: u.filterList,
|
|
101
|
+
priceInline: !g
|
|
100
102
|
});
|
|
101
|
-
o.modifyHtml(s).setInnerHtml(
|
|
103
|
+
o.modifyHtml(s).setInnerHtml(v).apply(new p("Updated product")), X(t), n == null || n();
|
|
102
104
|
}
|
|
103
105
|
function T(t, e, o, n) {
|
|
104
106
|
const c = `0 ${Math.floor(o / 2)}px`;
|
|
@@ -111,7 +113,7 @@ function T(t, e, o, n) {
|
|
|
111
113
|
t.querySelectorAll(".product-card-wrapper")
|
|
112
114
|
).forEach((u) => {
|
|
113
115
|
const l = "parentNode" in u ? u.parentNode : null;
|
|
114
|
-
l &&
|
|
116
|
+
l && F(l) && (e.modifyHtml(l).setStyle("padding", c), r = !0);
|
|
115
117
|
}), r;
|
|
116
118
|
}
|
|
117
119
|
function I(t, e, o) {
|
|
@@ -121,11 +123,11 @@ function I(t, e, o) {
|
|
|
121
123
|
e.modifyHtml(r).setStyle("height", n), c = !0;
|
|
122
124
|
}), c;
|
|
123
125
|
}
|
|
124
|
-
function
|
|
126
|
+
function J(t) {
|
|
125
127
|
const { currentNode: e, documentModifier: o } = t;
|
|
126
128
|
if (!e)
|
|
127
129
|
return;
|
|
128
|
-
const n =
|
|
130
|
+
const n = b.getConfig(e), i = E(e);
|
|
129
131
|
let c = !1;
|
|
130
132
|
const r = e.querySelector(P);
|
|
131
133
|
if (r) {
|
|
@@ -160,9 +162,9 @@ function z(t) {
|
|
|
160
162
|
}
|
|
161
163
|
c && o.apply(new p("Reapply spacing after regeneration"));
|
|
162
164
|
}
|
|
163
|
-
function
|
|
165
|
+
function de(t) {
|
|
164
166
|
const { currentNode: e, documentModifier: o, afterRegenerate: n, products: i, layout: c, composition: r } = t;
|
|
165
|
-
e &&
|
|
167
|
+
e && z({
|
|
166
168
|
currentNode: e,
|
|
167
169
|
documentModifier: o,
|
|
168
170
|
products: i,
|
|
@@ -170,12 +172,12 @@ function ae(t) {
|
|
|
170
172
|
composition: r,
|
|
171
173
|
afterRegenerate: () => {
|
|
172
174
|
setTimeout(() => {
|
|
173
|
-
|
|
175
|
+
J({ currentNode: e, documentModifier: o });
|
|
174
176
|
}, 0), n == null || n();
|
|
175
177
|
}
|
|
176
178
|
});
|
|
177
179
|
}
|
|
178
|
-
function
|
|
180
|
+
function fe(t, e) {
|
|
179
181
|
return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...L(e - t.length)];
|
|
180
182
|
}
|
|
181
183
|
function H() {
|
|
@@ -191,12 +193,12 @@ function H() {
|
|
|
191
193
|
}
|
|
192
194
|
function A(t, e = "price") {
|
|
193
195
|
const o = H(), n = t[e], i = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
|
|
194
|
-
return
|
|
196
|
+
return j({
|
|
195
197
|
price: i,
|
|
196
198
|
currency: o
|
|
197
199
|
});
|
|
198
200
|
}
|
|
199
|
-
function
|
|
201
|
+
function Q(t) {
|
|
200
202
|
var c, r;
|
|
201
203
|
const e = H(), o = ((c = t.original_price) == null ? void 0 : c[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((r = t.price) == null ? void 0 : r[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, i = o > 0 ? Math.round((o - n) / o * 100) : 0;
|
|
202
204
|
return i > 0 ? `-${i}%` : "0%";
|
|
@@ -217,12 +219,12 @@ function $(t) {
|
|
|
217
219
|
S(e, u, l) && (s = !0);
|
|
218
220
|
}
|
|
219
221
|
if (r && "querySelector" in r) {
|
|
220
|
-
const u = r.querySelector(".omnibus-discount-value") ?? null, l =
|
|
222
|
+
const u = r.querySelector(".omnibus-discount-value") ?? null, l = Q(o);
|
|
221
223
|
S(e, u, l) && (s = !0);
|
|
222
224
|
}
|
|
223
225
|
return s;
|
|
224
226
|
}
|
|
225
|
-
function
|
|
227
|
+
function Z(t) {
|
|
226
228
|
const {
|
|
227
229
|
documentModifier: e,
|
|
228
230
|
product: o,
|
|
@@ -237,7 +239,7 @@ function Q(t) {
|
|
|
237
239
|
let d = !1;
|
|
238
240
|
if (n && "querySelector" in n) {
|
|
239
241
|
const a = n.querySelector("img");
|
|
240
|
-
a && (e.modifyHtml(a).setAttribute("src",
|
|
242
|
+
a && (e.modifyHtml(a).setAttribute("src", G(o.image_url)).setAttribute("alt", o.name), d = !0);
|
|
241
243
|
const f = n.querySelector("a");
|
|
242
244
|
f && (e.modifyHtml(f).setAttribute("href", o.url), d = !0);
|
|
243
245
|
}
|
|
@@ -262,7 +264,7 @@ function B(t) {
|
|
|
262
264
|
return "querySelector" in t ? t.querySelector(P) ?? t : t;
|
|
263
265
|
}
|
|
264
266
|
const O = "product_attribute.";
|
|
265
|
-
function
|
|
267
|
+
function ee(t, e) {
|
|
266
268
|
var n;
|
|
267
269
|
let o;
|
|
268
270
|
if (t.startsWith(O)) {
|
|
@@ -270,9 +272,9 @@ function Z(t, e) {
|
|
|
270
272
|
o = (n = e.product_attributes) == null ? void 0 : n[i];
|
|
271
273
|
} else
|
|
272
274
|
o = e[t];
|
|
273
|
-
return
|
|
275
|
+
return Y(o) || null;
|
|
274
276
|
}
|
|
275
|
-
function
|
|
277
|
+
function te(t, e, o) {
|
|
276
278
|
if (!("querySelectorAll" in t))
|
|
277
279
|
return !1;
|
|
278
280
|
const n = t.querySelectorAll(
|
|
@@ -284,7 +286,7 @@ function ee(t, e, o) {
|
|
|
284
286
|
n.forEach((r) => {
|
|
285
287
|
if (!("getAttribute" in r))
|
|
286
288
|
return;
|
|
287
|
-
const s = r.getAttribute(
|
|
289
|
+
const s = r.getAttribute(W);
|
|
288
290
|
if (!s)
|
|
289
291
|
return;
|
|
290
292
|
const u = i.get(s) ?? [];
|
|
@@ -296,7 +298,7 @@ function ee(t, e, o) {
|
|
|
296
298
|
r.slice(0, u).forEach((l, d) => {
|
|
297
299
|
if (!("querySelector" in l))
|
|
298
300
|
return;
|
|
299
|
-
const a =
|
|
301
|
+
const a = ee(s, o[d]);
|
|
300
302
|
if (a === null)
|
|
301
303
|
return;
|
|
302
304
|
const f = l.querySelector("p") ?? null;
|
|
@@ -304,7 +306,7 @@ function ee(t, e, o) {
|
|
|
304
306
|
});
|
|
305
307
|
}), c;
|
|
306
308
|
}
|
|
307
|
-
function
|
|
309
|
+
function N(t, e, o) {
|
|
308
310
|
if (!("querySelectorAll" in t))
|
|
309
311
|
return !1;
|
|
310
312
|
const n = t.querySelectorAll(
|
|
@@ -324,7 +326,7 @@ function w(t, e, o) {
|
|
|
324
326
|
), d = Math.min(n.length, o.length);
|
|
325
327
|
let a = !1;
|
|
326
328
|
for (let f = 0; f < d; f++) {
|
|
327
|
-
const g =
|
|
329
|
+
const g = Z({
|
|
328
330
|
documentModifier: e,
|
|
329
331
|
product: o[f],
|
|
330
332
|
imageEl: n[f] ?? null,
|
|
@@ -337,9 +339,9 @@ function w(t, e, o) {
|
|
|
337
339
|
});
|
|
338
340
|
a = a || g;
|
|
339
341
|
}
|
|
340
|
-
return
|
|
342
|
+
return te(t, e, o) && (a = !0), a;
|
|
341
343
|
}
|
|
342
|
-
function
|
|
344
|
+
function me(t) {
|
|
343
345
|
const { currentNode: e, documentModifier: o, products: n } = t;
|
|
344
346
|
if (!e || !("querySelectorAll" in e))
|
|
345
347
|
return !1;
|
|
@@ -348,12 +350,12 @@ function fe(t) {
|
|
|
348
350
|
`[esd-extension-block-id="${m.IMAGE}"]`
|
|
349
351
|
).length !== n.length)
|
|
350
352
|
return !1;
|
|
351
|
-
let r =
|
|
352
|
-
const s =
|
|
353
|
+
let r = N(i, o, n);
|
|
354
|
+
const s = E(e), u = b.getConfig(e);
|
|
353
355
|
if (s !== "list" && u.mobileLayoutEnabled && "querySelector" in e) {
|
|
354
356
|
const l = e.querySelector(q);
|
|
355
357
|
if (l) {
|
|
356
|
-
const d =
|
|
358
|
+
const d = N(
|
|
357
359
|
l,
|
|
358
360
|
o,
|
|
359
361
|
n
|
|
@@ -363,7 +365,7 @@ function fe(t) {
|
|
|
363
365
|
}
|
|
364
366
|
return r && o.apply(new p("Updated product content in-place")), !0;
|
|
365
367
|
}
|
|
366
|
-
function
|
|
368
|
+
function w(t, e, o) {
|
|
367
369
|
if (!("querySelectorAll" in t))
|
|
368
370
|
return !1;
|
|
369
371
|
const n = t.querySelectorAll(
|
|
@@ -387,7 +389,7 @@ function N(t, e, o) {
|
|
|
387
389
|
}) && (u = !0);
|
|
388
390
|
return u;
|
|
389
391
|
}
|
|
390
|
-
function
|
|
392
|
+
function pe(t) {
|
|
391
393
|
const { currentNode: e, documentModifier: o } = t;
|
|
392
394
|
if (!e || !("querySelectorAll" in e))
|
|
393
395
|
return !1;
|
|
@@ -395,19 +397,19 @@ function me(t) {
|
|
|
395
397
|
if (i.length === 0)
|
|
396
398
|
return !1;
|
|
397
399
|
const c = B(e);
|
|
398
|
-
let r =
|
|
399
|
-
const s =
|
|
400
|
+
let r = w(c, o, i);
|
|
401
|
+
const s = E(e), u = b.getConfig(e);
|
|
400
402
|
if (s !== "list" && u.mobileLayoutEnabled && "querySelector" in e) {
|
|
401
403
|
const l = e.querySelector(q);
|
|
402
404
|
if (l) {
|
|
403
|
-
const d =
|
|
405
|
+
const d = w(l, o, i);
|
|
404
406
|
r = r || d;
|
|
405
407
|
}
|
|
406
408
|
}
|
|
407
409
|
return r && o.apply(new p("Updated price formatting in-place")), r;
|
|
408
410
|
}
|
|
409
|
-
function
|
|
410
|
-
const { currentNode: e, documentModifier: o, currency: n } = t, i =
|
|
411
|
+
function ye(t) {
|
|
412
|
+
const { currentNode: e, documentModifier: o, currency: n } = t, i = M(e);
|
|
411
413
|
if (!i)
|
|
412
414
|
return;
|
|
413
415
|
const c = n.alignment === "before" ? "0" : "1", r = (s, u) => {
|
|
@@ -416,17 +418,17 @@ function pe(t) {
|
|
|
416
418
|
r(y.CURRENCY, n.code), r(y.SYMBOL, n.symbol), r(y.ALIGNMENT, c), r(y.THOUSAND_SEPARATOR, n.thousandSeparator), r(y.DECIMAL_SEPARATOR, n.decimalSeparator), r(y.DECIMAL_COUNT, n.decimalCount.toString()), o.apply(new p("Update currency attributes"));
|
|
417
419
|
}
|
|
418
420
|
export {
|
|
419
|
-
|
|
421
|
+
fe as adjustProductsToSize,
|
|
420
422
|
A as formatProductPrice,
|
|
421
|
-
|
|
423
|
+
M as getBlockElement,
|
|
422
424
|
x as getCardComposition,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
425
|
+
E as getCurrentLayout,
|
|
426
|
+
J as reapplySpacing,
|
|
427
|
+
X as regenerateMobileProductRows,
|
|
428
|
+
z as regenerateProductRows,
|
|
429
|
+
de as regenerateProductRowsWithStyles,
|
|
430
|
+
ye as setCurrencyAttributes,
|
|
431
|
+
pe as updatePricesInPlace,
|
|
432
|
+
me as updateProductContentInPlace,
|
|
433
|
+
Z as updateSingleProductContent
|
|
432
434
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import r from "../../../static/assets/info.svg.js";
|
|
2
|
-
import { IconsRegistry as
|
|
3
|
-
class h extends
|
|
4
|
-
registerIconsSvg(
|
|
5
|
-
|
|
2
|
+
import { IconsRegistry as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
class h extends C {
|
|
4
|
+
registerIconsSvg(t) {
|
|
5
|
+
t["recommendation-icon"] = `
|
|
6
6
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
7
7
|
<path d="M10 4.4C10 4.73137 9.73012 4.99622 9.40108 5.0355C6.92202 5.33143 5 7.44126 5 10C5 12.5587
|
|
8
8
|
6.92202 14.6686 9.40108 14.9645C9.73012 15.0038 10 15.2686 10 15.6V18.4C10 18.7314 9.73137 19 9.4
|
|
@@ -44,14 +44,14 @@ class h extends t {
|
|
|
44
44
|
3.40029 12.0082 3.25285 11.7656 3.15234C11.365 2.98638 11.0001 2.64849 11 2.21484V2Z"
|
|
45
45
|
fill="currentColor"/>
|
|
46
46
|
</svg>
|
|
47
|
-
`,
|
|
47
|
+
`, t["grid-orientation"] = `
|
|
48
48
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
49
49
|
<rect x="1" y="1" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
50
50
|
<rect x="12" y="1" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
51
51
|
<rect x="1" y="12" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
52
52
|
<rect x="12" y="12" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
53
53
|
</svg>
|
|
54
|
-
`,
|
|
54
|
+
`, t["list-orientation"] = `
|
|
55
55
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
56
56
|
<circle cx="3" cy="4" r="1" stroke="currentColor" stroke-width="1"/>
|
|
57
57
|
<rect x="7" y="3" width="11" height="2" rx="1"/>
|
|
@@ -60,7 +60,21 @@ class h extends t {
|
|
|
60
60
|
<circle cx="3" cy="16" r="1" stroke="currentColor" stroke-width="1"/>
|
|
61
61
|
<rect x="7" y="15" width="11" height="2" rx="1"/>
|
|
62
62
|
</svg>
|
|
63
|
-
`,
|
|
63
|
+
`, t["vertical-orientation"] = `
|
|
64
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
65
|
+
<path d="M19 10V16C19 16.5523 18.5523 17 18 17H2C1.44772 17 1 16.5523 1 16V10H19Z"
|
|
66
|
+
stroke="currentColor" stroke-width="2" fill="none"/>
|
|
67
|
+
<path d="M2 3H18C18.5523 3 19 3.44772 19 4V10H1V4C1 3.44772 1.44772 3 2 3Z" stroke="currentColor"
|
|
68
|
+
stroke-width="2" fill="none"/>
|
|
69
|
+
</svg>
|
|
70
|
+
`, t["horizontal-orientation"] = `
|
|
71
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
|
72
|
+
<path d="M10 19H4C3.44772 19 3 18.5523 3 18V2C3 1.44772 3.44772 1 4 1H10V19Z" stroke="currentColor"
|
|
73
|
+
stroke-width="2" fill="none"/>
|
|
74
|
+
<path d="M17 2V18C17 18.5523 16.5523 19 16 19H10V1H16C16.5523 1 17 1.44772 17 2Z" stroke="currentColor"
|
|
75
|
+
stroke-width="2" fill="none"/>
|
|
76
|
+
</svg>
|
|
77
|
+
`, t["migration-info-icon"] = r;
|
|
64
78
|
}
|
|
65
79
|
}
|
|
66
80
|
export {
|
|
@@ -18,6 +18,13 @@ const n = `/* Utils */
|
|
|
18
18
|
padding: 0
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/* Group the two price-placement rows (orientation + hide-if-same) into one
|
|
22
|
+
container — drop the divider the editor adds between stacked setting rows.
|
|
23
|
+
Ancestor added so this out-specifies the editor's \`.two-columns:not(:first-child)\`. */
|
|
24
|
+
.recommendation-controls-container .price-placement-control-container .container.two-columns {
|
|
25
|
+
border-top: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
21
28
|
/* Right-align the mobile layout toggle within the two-column grid */
|
|
22
29
|
.product-layout-control-container ue-switcher {
|
|
23
30
|
justify-self: end;
|
|
@@ -143,15 +150,68 @@ ue-orderable.orderable-disabled .droppable-icon {
|
|
|
143
150
|
color: var(--guido-color-danger-500);
|
|
144
151
|
}
|
|
145
152
|
|
|
146
|
-
/*
|
|
147
|
-
.orderable-
|
|
148
|
-
|
|
153
|
+
/* ─── Inline "Product Prices" group: nested 2-item sub-drag ───────────── */
|
|
154
|
+
.orderable-item.price-group-item {
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
align-items: stretch;
|
|
157
|
+
gap: 8px;
|
|
149
158
|
}
|
|
150
159
|
|
|
151
|
-
.
|
|
160
|
+
.price-group-header {
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
gap: 4px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.price-suborderable-list {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-direction: column;
|
|
169
|
+
margin-left: 4px;
|
|
170
|
+
padding-left: 8px;
|
|
171
|
+
border-left: 2px solid #eee;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.price-suborderable-item {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
gap: 4px;
|
|
178
|
+
padding: 8px 0;
|
|
179
|
+
background: var(--guido-color-white);
|
|
152
180
|
cursor: default;
|
|
181
|
+
transition: background 0.15s;
|
|
182
|
+
box-sizing: border-box;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.price-suborderable-item:hover {
|
|
186
|
+
background: #fafafa;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.price-suborderable-item.dragging {
|
|
190
|
+
opacity: 0.5;
|
|
191
|
+
background: var(--guido-color-gray-1);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.price-suborderable-item.drag-over {
|
|
195
|
+
border-top: 2px solid var(--guido-color-primary-500, #0A2ECC);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.price-suborderable-item .item-label {
|
|
199
|
+
font-size: 13px;
|
|
153
200
|
}
|
|
154
201
|
|
|
202
|
+
.sub-drag-handle {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: center;
|
|
206
|
+
flex-shrink: 0;
|
|
207
|
+
width: 24px;
|
|
208
|
+
height: 24px;
|
|
209
|
+
cursor: move;
|
|
210
|
+
user-select: none;
|
|
211
|
+
color: var(--guido-color-gray-600);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
155
215
|
/* ─── Migration Info Box ─────────────────────────────────────────────── */
|
|
156
216
|
/* Shown in the settings panel title when a block was migrated from legacy */
|
|
157
217
|
|
|
@@ -2,8 +2,8 @@ import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAtt
|
|
|
2
2
|
import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
|
|
3
3
|
import { useConfigStore as G } from "../../../../stores/config.js";
|
|
4
4
|
import { defineStore as P } from "pinia";
|
|
5
|
-
import { DEFAULT_CARDS_IN_ROW as
|
|
6
|
-
import { EXCLUDED_ALGORITHM_IDS as
|
|
5
|
+
import { DEFAULT_CARDS_IN_ROW as D } from "../constants/layout.js";
|
|
6
|
+
import { EXCLUDED_ALGORITHM_IDS as F } from "../constants/defaultConfig.js";
|
|
7
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
8
8
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
9
9
|
import { getPartnerRecommendationParams as v } from "../utils/partnerCustomizations.js";
|
|
@@ -13,7 +13,7 @@ const h = y();
|
|
|
13
13
|
let m = null, u = null, d = null;
|
|
14
14
|
function I() {
|
|
15
15
|
return {
|
|
16
|
-
cardsInRow:
|
|
16
|
+
cardsInRow: D,
|
|
17
17
|
currencySettings: {
|
|
18
18
|
name: "USD",
|
|
19
19
|
value: "USD",
|
|
@@ -36,7 +36,9 @@ function I() {
|
|
|
36
36
|
textTrimming: !0,
|
|
37
37
|
unresponsive: !1,
|
|
38
38
|
size: "6",
|
|
39
|
-
customAttributes: []
|
|
39
|
+
customAttributes: [],
|
|
40
|
+
priceMovedToNextLine: !0,
|
|
41
|
+
priceHideIfSameAsDiscounted: !1
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
function k() {
|
|
@@ -116,7 +118,7 @@ const x = () => ({
|
|
|
116
118
|
},
|
|
117
119
|
getActivePredictiveAlgorithms: (t) => {
|
|
118
120
|
const e = g(), r = [];
|
|
119
|
-
return t.activePredictiveAlgorithms.filter((n) => !
|
|
121
|
+
return t.activePredictiveAlgorithms.filter((n) => !F.includes(n)).forEach((n) => {
|
|
120
122
|
r.push(...e.filter((c) => c.id === n));
|
|
121
123
|
}), r.map((n) => ({
|
|
122
124
|
text: n.name,
|