@vectoriox/iox-builder 4.7.0 → 4.8.0
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.
|
@@ -218,7 +218,7 @@ class ComponentConfig {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
class TraitConfig {
|
|
221
|
-
constructor(name, label, type, options, defaultValue, inline, showWhen) {
|
|
221
|
+
constructor(name, label, type, options, defaultValue, inline, showWhen, responsive) {
|
|
222
222
|
this.name = name;
|
|
223
223
|
this.label = label;
|
|
224
224
|
this.type = type;
|
|
@@ -226,6 +226,7 @@ class TraitConfig {
|
|
|
226
226
|
this.default = defaultValue;
|
|
227
227
|
this.inline = inline;
|
|
228
228
|
this.showWhen = showWhen;
|
|
229
|
+
this.responsive = responsive;
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
232
|
class GroupStyleConfig {
|
|
@@ -4273,6 +4274,12 @@ class RenderDirective {
|
|
|
4273
4274
|
return;
|
|
4274
4275
|
safeSetInput(componentRef, trait.name, trait.default);
|
|
4275
4276
|
});
|
|
4277
|
+
// Per-breakpoint TRAIT overrides — the same hand-off the SSR engine makes. A component that
|
|
4278
|
+
// declares a `responsive` input (SliderContainer) converts it to its own width config, so the
|
|
4279
|
+
// canvas and the live site agree without the canvas needing a resize listener. Dropped by
|
|
4280
|
+
// safeSetInput for every component that does not declare it.
|
|
4281
|
+
if (node.responsive)
|
|
4282
|
+
safeSetInput(componentRef, 'responsive', node.responsive);
|
|
4276
4283
|
// Build initial style map from styleTraits defaults.
|
|
4277
4284
|
const initialStyle = {};
|
|
4278
4285
|
if (node.styleTraits?.length) {
|
|
@@ -9462,6 +9469,14 @@ class RepeaterComponentConfig extends ComponentConfig {
|
|
|
9462
9469
|
label: 'Limit',
|
|
9463
9470
|
type: TraitInputType.Number,
|
|
9464
9471
|
default: 10,
|
|
9472
|
+
// NOT marked `responsive` yet, deliberately. Row COUNT cannot be varied per width the
|
|
9473
|
+
// way the slider's can: Swiper reads its own breakpoints map at runtime, but a
|
|
9474
|
+
// repeater's count is decided when the markup is produced — and SSR has no viewport,
|
|
9475
|
+
// so rendering N on the server and M in the browser is a hydration mismatch. The fix
|
|
9476
|
+
// is to keep rendering every item and HIDE the surplus per width with a generated
|
|
9477
|
+
// `:nth-child(n+X) { display: none }` rule (CSS-expressible, hydration-safe), which is
|
|
9478
|
+
// a separate change. Marking it responsive now would ship a control that silently
|
|
9479
|
+
// does nothing on the live site — exactly the `slidesPerGroup` bug this pass fixed.
|
|
9465
9480
|
},
|
|
9466
9481
|
];
|
|
9467
9482
|
this.styleTraits = buildFullStyleTraits();
|
|
@@ -9562,15 +9577,15 @@ class SliderContainerConfig extends ComponentConfig {
|
|
|
9562
9577
|
{ label: '4', value: 4 },
|
|
9563
9578
|
{ label: '5', value: 5 },
|
|
9564
9579
|
{ label: '6', value: 6 },
|
|
9565
|
-
], 'auto'),
|
|
9566
|
-
new TraitConfig('slidesPerGroup', 'Slides per group', TraitInputType.Scrub, undefined, 1),
|
|
9580
|
+
], 'auto', undefined, undefined, /* responsive */ true),
|
|
9581
|
+
new TraitConfig('slidesPerGroup', 'Slides per group', TraitInputType.Scrub, undefined, 1, undefined, undefined, /* responsive */ true),
|
|
9567
9582
|
new TraitConfig('loop', 'Loop', TraitInputType.SelectButton, [
|
|
9568
9583
|
{ label: 'Off', value: 'off' },
|
|
9569
9584
|
{ label: 'Loop', value: 'loop' },
|
|
9570
9585
|
{ label: 'Rewind', value: 'rewind' },
|
|
9571
9586
|
], 'off'),
|
|
9572
9587
|
new TraitConfig('centeredSlides', 'Centered slides', TraitInputType.Checkbox, undefined, false),
|
|
9573
|
-
new TraitConfig('spaceBetween', 'Space between (px)', TraitInputType.Scrub, undefined, 0),
|
|
9588
|
+
new TraitConfig('spaceBetween', 'Space between (px)', TraitInputType.Scrub, undefined, 0, undefined, undefined, /* responsive */ true),
|
|
9574
9589
|
new TraitConfig('initialSlide', 'Initial slide', TraitInputType.Scrub, undefined, 0),
|
|
9575
9590
|
new TraitConfig('autoHeight', 'Auto height', TraitInputType.Checkbox, undefined, false),
|
|
9576
9591
|
new TraitConfig('grabCursor', 'Grab cursor', TraitInputType.Checkbox, undefined, true),
|