@vectoriox/iox-builder 1.4.7 → 1.4.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.
package/package.json
CHANGED
|
@@ -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
|
-
/**
|
|
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
|
|
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.
|
|
@@ -714,6 +726,8 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
|
|
|
714
726
|
get globalElementsAfter(): ComponentNode[];
|
|
715
727
|
/** Canvas width in CSS pixels (driven by ViewportService). */
|
|
716
728
|
get viewportWidth(): number;
|
|
729
|
+
/** Canvas viewport height in CSS pixels (driven by ViewportService). */
|
|
730
|
+
get viewportHeight(): number;
|
|
717
731
|
/** Visual (scaled) canvas width — used to size the scroll container so the
|
|
718
732
|
* scrollbar aligns with the right edge of the canvas, not the CMS shell. */
|
|
719
733
|
get viewportScaledWidth(): number;
|
|
@@ -727,10 +741,7 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
|
|
|
727
741
|
* not unscaled CSS px — correct at any zoom level.
|
|
728
742
|
*/
|
|
729
743
|
get scaledContentHeight(): number;
|
|
730
|
-
/**
|
|
731
|
-
* The canvas min-height simulates a real browser viewport.
|
|
732
|
-
* We subtract the builder header (~49px) and some padding from window.innerHeight.
|
|
733
|
-
*/
|
|
744
|
+
/** The canvas starts at the simulated viewport height, just like a real empty browser page. */
|
|
734
745
|
get canvasMinHeight(): number;
|
|
735
746
|
private sub?;
|
|
736
747
|
private registrySub?;
|
|
@@ -739,6 +750,13 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
|
|
|
739
750
|
ngOnChanges(changes: SimpleChanges): void;
|
|
740
751
|
ngAfterViewInit(): void;
|
|
741
752
|
ngOnDestroy(): void;
|
|
753
|
+
/**
|
|
754
|
+
* Set --preview-vh on .preview-scroll so that vh values rewritten by
|
|
755
|
+
* StyleRegistryService resolve to the SIMULATED viewport height, not the
|
|
756
|
+
* real browser viewport. e.g. desktop (900px): --preview-vh = 9px → 100vh = 900px.
|
|
757
|
+
* Falls back to 1vh in production where --preview-vh is never defined.
|
|
758
|
+
*/
|
|
759
|
+
private updatePreviewVh;
|
|
742
760
|
private initLenis;
|
|
743
761
|
private destroyLenis;
|
|
744
762
|
addComponent(name: string): void;
|
|
@@ -833,6 +851,13 @@ declare class StyleRegistryService {
|
|
|
833
851
|
remove(nodeId: string): void;
|
|
834
852
|
destroy(): void;
|
|
835
853
|
private compile;
|
|
854
|
+
/**
|
|
855
|
+
* Rewrite bare `vh` values to `calc(N * var(--preview-vh, 1vh))` so they
|
|
856
|
+
* resolve to the simulated viewport height in the builder canvas.
|
|
857
|
+
* In production (no --preview-vh defined) the fallback `1vh` preserves the
|
|
858
|
+
* original behaviour: `calc(50 * 1vh)` == `50vh`.
|
|
859
|
+
*/
|
|
860
|
+
private rewriteVh;
|
|
836
861
|
private toKebabCase;
|
|
837
862
|
private flush;
|
|
838
863
|
static ɵfac: i0.ɵɵFactoryDeclaration<StyleRegistryService, never>;
|