fix: manifest-aware layout picker, real carousel items-per-page, hero arrows/swipe/2-panel
Some checks failed
Architecture Governance / architecture (push) Has been cancelled

Sprint E: homepage section editor now filters the layout-strategy picker
to each widget's widget-manifest.json supportedLayouts instead of always
showing all 5 strategies. columns field gated to widgets that read it
(hero, product-collection carousel).

Sprint F: closes client bug report (no items-per-page control, hero
carousel not manually/automatically scrollable, no 1-2 slide big-carousel
option). Product carousel item width now driven by layout.columns
(reused, was already editable but dead). Hero widget gains prev/next
arrows, touch swipe, and 1-2 panel mode via the same field.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
sdarbinyan
2026-08-05 19:25:34 +04:00
parent 3e3185cb6e
commit 55b379bd6d
9 changed files with 217 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ import { TranslatePipe } from '../../i18n/translate.pipe';
standalone: true,
imports: [CommonModule, CatalogProductGridComponent, TranslatePipe],
template: `
<section class="product-carousel-widget">
<section class="product-carousel-widget" [style.--items-per-page]="itemsPerPage()">
@if (data?.title) {
<h2 class="product-carousel-widget__title">{{ data?.title }}</h2>
}
@@ -83,7 +83,8 @@ import { TranslatePipe } from '../../i18n/translate.pipe';
::ng-deep .catalog-product-shell {
flex: 0 0 auto;
width: 220px;
width: calc((100% - (var(--items-per-page, 4) - 1) * var(--space-md, 16px)) / var(--items-per-page, 4));
min-width: 160px;
}
}
@@ -121,6 +122,12 @@ export class ProductCarouselWidgetComponent {
return this.section?.layout?.strategy === 'carousel';
}
/** Items visible per page - reuses `layout.columns` (default 4, min 1) rather than a dedicated field. */
itemsPerPage(): number {
const columns = this.section?.layout?.columns;
return columns && columns >= 1 ? Math.floor(columns) : 4;
}
scrollBy(direction: -1 | 1): void {
const el = this.scroller?.nativeElement;
if (!el) {