@vectoriox/iox-builder 1.6.9 → 1.6.11

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.
@@ -17,7 +17,7 @@ import { SelectModule } from 'primeng/select';
17
17
  import { TooltipModule } from 'primeng/tooltip';
18
18
  import { DialogModule } from 'primeng/dialog';
19
19
  import * as i14 from '@vectoriox/iox-ui';
20
- import { ComponentInstanceRegistryService, compileDeclarations, IS_PREVIEW, IoxPageModule } from '@vectoriox/iox-ui';
20
+ import { ComponentInstanceRegistryService, DEFAULT_WIDTH_BY_TYPE, compileDeclarations, IS_PREVIEW, IoxPageModule } from '@vectoriox/iox-ui';
21
21
  export { ComponentInstanceRegistryService } from '@vectoriox/iox-ui';
22
22
  import Lenis from 'lenis';
23
23
  import { Subject, BehaviorSubject } from 'rxjs';
@@ -2086,6 +2086,12 @@ class ComponentConfig {
2086
2086
  /** Override specific trait defaults after styleTraits are set.
2087
2087
  * Call this at the end of each subclass constructor. */
2088
2088
  applyStyleDefaults(defaults) {
2089
+ // Single source of truth for container-type width defaults: when a subclass does
2090
+ // not set width explicitly, fill it from the shared DEFAULT_WIDTH_BY_TYPE map — the
2091
+ // same map the SSR engine resolves from. See render-parity.md.
2092
+ if (defaults['width'] === undefined && DEFAULT_WIDTH_BY_TYPE[this.type] !== undefined) {
2093
+ defaults = { ...defaults, width: DEFAULT_WIDTH_BY_TYPE[this.type] };
2094
+ }
2089
2095
  for (const group of this.styleTraits) {
2090
2096
  for (const trait of group.traits) {
2091
2097
  if (defaults[trait.name] !== undefined) {
@@ -2243,7 +2249,11 @@ class SizeGroupStyleConfig extends GroupStyleConfig {
2243
2249
  new TraitConfig('minHeight', 'Min H', TraitInputType.Scrub, { min: 0, max: 9999, step: 1, units: UNITS_ALL, allowAuto: true }, 'auto', true),
2244
2250
  new TraitConfig('maxWidth', 'Max W', TraitInputType.Scrub, { min: 0, max: 9999, step: 1, units: UNITS_ALL, allowAuto: true }, 'auto', true),
2245
2251
  new TraitConfig('maxHeight', 'Max H', TraitInputType.Scrub, { min: 0, max: 9999, step: 1, units: UNITS_ALL, allowAuto: true }, 'auto', true),
2246
- new TraitConfig('aspectRatio', 'Aspect Ratio', TraitInputType.Text, undefined, 'auto'),
2252
+ // aspect-ratio is a unitless ratio (or 'auto') — scrub with no unit.
2253
+ new TraitConfig('aspectRatio', 'Aspect Ratio', TraitInputType.Scrub, { min: 0, max: 10, step: 0.1, units: [''], allowAuto: true }, 'auto', true),
2254
+ // object-fit is a style trait (applies to replaced elements, e.g. images). Lives here so
2255
+ // it flows through the CSS engine (styleProps) instead of a per-component inline binding.
2256
+ new TraitConfig('objectFit', 'Object Fit', TraitInputType.Select, ['cover', 'contain', 'fill', 'none', 'scale-down'], 'cover'),
2247
2257
  ]);
2248
2258
  }
2249
2259
  }
@@ -7093,7 +7103,6 @@ class BuilderContainerComponentConfig extends ComponentConfig {
7093
7103
  ];
7094
7104
  this.styleTraits = buildFullStyleTraits();
7095
7105
  this.applyStyleDefaults({
7096
- width: '100%',
7097
7106
  height: 'auto',
7098
7107
  minHeight: '200px',
7099
7108
  display: 'block',
@@ -7108,7 +7117,6 @@ class BuilderDividerComponentConfig extends ComponentConfig {
7108
7117
  this.traits = [];
7109
7118
  this.styleTraits = buildFullStyleTraits();
7110
7119
  this.applyStyleDefaults({
7111
- width: '100%',
7112
7120
  height: '1px',
7113
7121
  backgroundColor: '#cccccc',
7114
7122
  margin: '8px 0px 8px 0px',
@@ -7152,12 +7160,11 @@ class BuilderImageComponentConfig extends ComponentConfig {
7152
7160
  this.inputs = {
7153
7161
  src: 'text',
7154
7162
  alt: 'text',
7155
- objectFit: 'select'
7156
7163
  };
7157
7164
  this.traits = [
7158
7165
  new TraitConfig('src', 'Image URL', TraitInputType.Media, { mode: 'compact' }, 'https://placehold.co/600x400?text=Image'),
7159
7166
  new TraitConfig('alt', 'Alt Text', TraitInputType.Text, undefined, 'Image'),
7160
- new TraitConfig('objectFit', 'Object Fit', TraitInputType.Select, ['cover', 'contain', 'fill', 'none'], 'cover'),
7167
+ // objectFit moved to the Size style group (flows through the CSS engine as a style trait).
7161
7168
  ];
7162
7169
  this.styleTraits = buildFullStyleTraits();
7163
7170
  this.applyStyleDefaults({
@@ -7233,7 +7240,6 @@ class BuilderListItemComponentConfig extends ComponentConfig {
7233
7240
  this.styleTraits = buildFullStyleTraits();
7234
7241
  this.children = [];
7235
7242
  this.applyStyleDefaults({
7236
- width: '100%',
7237
7243
  display: 'block',
7238
7244
  backgroundColor: 'transparent',
7239
7245
  });
@@ -7254,7 +7260,6 @@ class TextBlockComponentConfig extends ComponentConfig {
7254
7260
  this.styleTraits = buildFullStyleTraits();
7255
7261
  this.applyStyleDefaults({
7256
7262
  display: 'block',
7257
- width: '100%',
7258
7263
  height: 'auto',
7259
7264
  minHeight: '20px',
7260
7265
  padding: '10px',
@@ -7287,7 +7292,6 @@ class BuilderListComponentConfig extends ComponentConfig {
7287
7292
  this.makeListItem(),
7288
7293
  ];
7289
7294
  this.applyStyleDefaults({
7290
- width: '100%',
7291
7295
  display: 'block',
7292
7296
  backgroundColor: 'transparent',
7293
7297
  padding: '0px 0px 0px 24px',
@@ -7325,7 +7329,6 @@ class RepeaterComponentConfig extends ComponentConfig {
7325
7329
  ];
7326
7330
  this.styleTraits = buildFullStyleTraits();
7327
7331
  this.applyStyleDefaults({
7328
- width: '100%',
7329
7332
  height: 'auto',
7330
7333
  });
7331
7334
  }
@@ -7494,9 +7497,7 @@ class SliderContainerConfig extends ComponentConfig {
7494
7497
  new BackgroundGroupStyleConfig(),
7495
7498
  new EffectsGroupStyleConfig(),
7496
7499
  ];
7497
- this.applyStyleDefaults({
7498
- width: '100%',
7499
- });
7500
+ this.applyStyleDefaults({});
7500
7501
  }
7501
7502
  }
7502
7503
 
@@ -7506,7 +7507,6 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
7506
7507
  this.traits = [];
7507
7508
  this.styleTraits = buildFullStyleTraits();
7508
7509
  this.applyStyleDefaults({
7509
- width: '100%',
7510
7510
  height: '40px',
7511
7511
  });
7512
7512
  }