@biela.dev/core 1.7.7 → 1.7.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/dist/lite.js CHANGED
@@ -724,6 +724,20 @@ function DeviceFrame({
724
724
  useEffect(() => {
725
725
  onScaleChangeRef.current?.(activeScale);
726
726
  }, [activeScale]);
727
+ useEffect(() => {
728
+ const el = frameOverlayRef.current;
729
+ if (!el) return;
730
+ const svgs = el.querySelectorAll("svg");
731
+ svgs.forEach((svg) => {
732
+ if (!svg.getAttribute("viewBox")) {
733
+ const w = svg.getAttribute("width");
734
+ const h = svg.getAttribute("height");
735
+ if (w && h) svg.setAttribute("viewBox", `0 0 ${w} ${h}`);
736
+ }
737
+ svg.setAttribute("width", "100%");
738
+ svg.setAttribute("height", "100%");
739
+ });
740
+ });
727
741
  const DeviceSVGComponent = svgEntry?.component;
728
742
  const hasMeasured = containerW > 0 && containerH > 0;
729
743
  return /* @__PURE__ */ jsx(
@@ -791,36 +805,22 @@ function DeviceFrame({
791
805
  children: /* @__PURE__ */ jsx(DeviceErrorBoundary, { children })
792
806
  }
793
807
  ),
794
- DeviceSVGComponent && /* @__PURE__ */ jsxs(
795
- "div",
808
+ DeviceSVGComponent && /* @__PURE__ */ jsx("div", { ref: frameOverlayRef, children: /* @__PURE__ */ jsx(
809
+ DeviceSVGComponent,
796
810
  {
797
- ref: frameOverlayRef,
798
- className: "bielaframe-svg-overlay",
811
+ colorScheme,
799
812
  style: {
800
813
  position: "absolute",
801
814
  top: 0,
802
815
  left: 0,
803
816
  width: frameTotalW,
804
817
  height: frameTotalH,
818
+ overflow: "hidden",
805
819
  pointerEvents: "none",
806
- zIndex: 10,
807
- overflow: "hidden"
808
- },
809
- children: [
810
- /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: `.bielaframe-svg-overlay svg { width: 100% !important; height: 100% !important; }` } }),
811
- /* @__PURE__ */ jsx(
812
- DeviceSVGComponent,
813
- {
814
- colorScheme,
815
- style: {
816
- width: "100%",
817
- height: "100%"
818
- }
819
- }
820
- )
821
- ]
820
+ zIndex: 10
821
+ }
822
822
  }
823
- ),
823
+ ) }),
824
824
  showSafeAreaOverlay && /* @__PURE__ */ jsx(
825
825
  "div",
826
826
  {