@vectoriox/iox-builder 1.4.6 → 1.4.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -332,6 +332,8 @@ interface DeviceOption {
332
332
  label: string;
333
333
  icon: string;
334
334
  width: number;
335
+ /** Simulated browser viewport height in CSS px. */
336
+ height: number;
335
337
  }
336
338
  declare const DEVICE_OPTIONS: DeviceOption[];
337
339
  interface ZoomOption {
@@ -608,7 +610,9 @@ interface ViewportState {
608
610
  device: DeviceMode;
609
611
  /** Real canvas width in CSS pixels (e.g., 1440 for desktop). */
610
612
  width: number;
611
- /** Visual scale factor (0–1+). Canvas is rendered at `width` then scaled. */
613
+ /** Real canvas height in CSS pixels (e.g., 900 for desktop). Simulates the browser viewport. */
614
+ height: number;
615
+ /** Visual scale factor (0–1+). Canvas is rendered at `width × height` then scaled. */
612
616
  scale: number;
613
617
  }
614
618
  declare class ViewportService {
@@ -623,9 +627,17 @@ declare class ViewportService {
623
627
  /**
624
628
  * Calculate the scale that makes the canvas fit inside the available editor width.
625
629
  * @param availableWidth The pixel width of the editor area that holds the canvas.
626
- * @param padding Optional horizontal padding to subtract (default 20px each side).
630
+ * @param padding Optional horizontal padding to subtract (default 40px total).
627
631
  */
628
632
  fitToWidth(availableWidth: number, padding?: number): void;
633
+ /**
634
+ * Calculate the scale that makes the canvas fit both the available width AND height.
635
+ * Uses the smaller of the two scale factors so the entire viewport frame is visible.
636
+ * @param containerWidth Available container width in screen pixels.
637
+ * @param containerHeight Available container height in screen pixels.
638
+ * @param padding Total padding to subtract from both dimensions (default 40px).
639
+ */
640
+ fitToSize(containerWidth: number, containerHeight: number, padding?: number): void;
629
641
  /**
630
642
  * Convert a screen-space coordinate to canvas-space (unscaled).
631
643
  * Call this when translating pointer events into canvas-relative positions.
@@ -833,6 +845,13 @@ declare class StyleRegistryService {
833
845
  remove(nodeId: string): void;
834
846
  destroy(): void;
835
847
  private compile;
848
+ /**
849
+ * Rewrite bare `vh` values to `calc(N * var(--preview-vh, 1vh))` so they
850
+ * resolve to the simulated viewport height in the builder canvas.
851
+ * In production (no --preview-vh defined) the fallback `1vh` preserves the
852
+ * original behaviour: `calc(50 * 1vh)` == `50vh`.
853
+ */
854
+ private rewriteVh;
836
855
  private toKebabCase;
837
856
  private flush;
838
857
  static ɵfac: i0.ɵɵFactoryDeclaration<StyleRegistryService, never>;