@vectoriox/iox-builder 1.6.8 → 1.6.9

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, IS_PREVIEW, IoxPageModule } from '@vectoriox/iox-ui';
20
+ import { ComponentInstanceRegistryService, 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';
@@ -2618,32 +2618,14 @@ class StyleRegistryService {
2618
2618
  }
2619
2619
  }
2620
2620
  compile(className, styles) {
2621
- const entries = Object.entries(styles)
2622
- .filter(([, v]) => v !== undefined && v !== null && v !== '')
2623
- .map(([k, v]) => {
2624
- const val = this.rewriteVh(String(v));
2625
- const bang = StyleRegistryService.IMPORTANT_PROPS.has(k) ? ' !important' : '';
2626
- return ` ${this.toKebabCase(k)}: ${val}${bang};`;
2627
- });
2628
- if (!entries.length)
2621
+ // Declaration compilation (kebab-case, viewport-unit rewrite, !important) lives in
2622
+ // the shared style-compiler so the SSR engine produces byte-identical output.
2623
+ // The inner/outer partition + selector emission stay here (builder-only concern).
2624
+ const decls = compileDeclarations(styles, StyleRegistryService.IMPORTANT_PROPS);
2625
+ if (!decls.length)
2629
2626
  return '';
2630
- return `.${className} {\n${entries.join('\n')}\n}`;
2631
- }
2632
- /**
2633
- * Rewrite viewport-relative units so they resolve to the simulated canvas
2634
- * dimensions rather than the real browser viewport.
2635
- *
2636
- * --preview-vh / --preview-vw are set by BuilderComponent via ResizeObserver
2637
- * and viewport-state subscription. In production (no variables defined) the
2638
- * fallbacks `1vh` / `1vw` restore the original browser behaviour.
2639
- */
2640
- rewriteVh(value) {
2641
- return value
2642
- .replace(/(-?\d*\.?\d+)vh/g, 'calc($1 * var(--preview-vh, 1vh))')
2643
- .replace(/(-?\d*\.?\d+)vw/g, 'calc($1 * var(--preview-vw, 1vw))');
2644
- }
2645
- toKebabCase(str) {
2646
- return str.replace(/[A-Z]/g, m => `-${m.toLowerCase()}`);
2627
+ const body = decls.map(d => ` ${d};`).join('\n');
2628
+ return `.${className} {\n${body}\n}`;
2647
2629
  }
2648
2630
  flush() {
2649
2631
  if (!this.styleEl || this._flushPending)