@rebuy/rebuy 2.36.0 → 2.37.0-rc.1
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/index.js +27 -1
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +27 -1
- package/dist/index.mjs.map +2 -2
- package/dist/server/index.js +27 -1
- package/dist/server/index.js.map +2 -2
- package/dist/server/index.mjs +27 -1
- package/dist/server/index.mjs.map +2 -2
- package/dist/transforms/index.js +27 -1
- package/dist/transforms/index.js.map +2 -2
- package/dist/transforms/index.mjs +27 -1
- package/dist/transforms/index.mjs.map +2 -2
- package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4460,6 +4460,20 @@ var STYLE_TO_DIRECTION = {
|
|
|
4460
4460
|
};
|
|
4461
4461
|
var directionForStyle = (style) => style ? STYLE_TO_DIRECTION[style] : "rows";
|
|
4462
4462
|
var buildProductListLayout = (direction, columns) => direction === "grid" ? { direction, grid: { columns: Array.from({ length: Math.max(columns, 1) }, () => "fill"), rows: ["auto"] } } : { direction };
|
|
4463
|
+
var navButton = (action, glyph) => ({
|
|
4464
|
+
action,
|
|
4465
|
+
buttonStyle: "plain",
|
|
4466
|
+
sections: [{ buttonField: "buttonLabel", content: { en: glyph }, sectionType: "text" }],
|
|
4467
|
+
sectionType: "button"
|
|
4468
|
+
});
|
|
4469
|
+
var buildCarouselNav = () => ({
|
|
4470
|
+
alignment: { horizontal: "end", vertical: "middle" },
|
|
4471
|
+
direction: "columns",
|
|
4472
|
+
name: "pagination",
|
|
4473
|
+
padding: "none",
|
|
4474
|
+
sections: [navButton("goToPrevPage", "\u2039"), navButton("goToNextPage", "\u203A")],
|
|
4475
|
+
sectionType: "layout"
|
|
4476
|
+
});
|
|
4463
4477
|
var hasHeaderText = (language) => !!(language?.title || language?.superTitle || language?.description);
|
|
4464
4478
|
var DISCOUNTED_FROM = {
|
|
4465
4479
|
compare_at_price: "compare_at_price",
|
|
@@ -4551,6 +4565,16 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
4551
4565
|
...settings.treatAsGwp && { treatAsGwp: true }
|
|
4552
4566
|
};
|
|
4553
4567
|
const offers = {
|
|
4568
|
+
/**
|
|
4569
|
+
* The offers section's own layout config IS the per-product card template (the extension renders
|
|
4570
|
+
* each product through `asLayout` of this section) — so the legacy card chrome lives here: the
|
|
4571
|
+
* always-on rounded border, inner padding, and vertical centering of the info column against the
|
|
4572
|
+
* image. Values match the canonical seed template; omitting them renders borderless, top-crowded
|
|
4573
|
+
* cards (REB-23807).
|
|
4574
|
+
*/
|
|
4575
|
+
alignment: { horizontal: "start", vertical: "middle" },
|
|
4576
|
+
border: { radius: "base", style: "base", width: "base" },
|
|
4577
|
+
padding: "base",
|
|
4554
4578
|
sections: [
|
|
4555
4579
|
...buildOfferCard(settings, horizontalCard),
|
|
4556
4580
|
dataSource,
|
|
@@ -4565,7 +4589,9 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
4565
4589
|
// otherwise throw at parse, so floor it at 1 (the carousel still shows a product per page).
|
|
4566
4590
|
itemsAtOnce: Math.max(layout?.carousel ? columns : settings.limit ?? columns, 1),
|
|
4567
4591
|
...listLayout,
|
|
4568
|
-
|
|
4592
|
+
// Arrows only when the v1 widget actually paginates — a non-carousel widget shows everything
|
|
4593
|
+
// at once (`itemsAtOnce` = limit), so nav buttons would render permanently disabled.
|
|
4594
|
+
sections: layout?.carousel ? [buildCarouselNav(), offers] : [offers],
|
|
4569
4595
|
sectionType: "carousel"
|
|
4570
4596
|
};
|
|
4571
4597
|
return CABRootSection.parse({
|