@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/index.cjs CHANGED
@@ -636,6 +636,20 @@ function DeviceFrame({
636
636
  react.useEffect(() => {
637
637
  onScaleChangeRef.current?.(activeScale);
638
638
  }, [activeScale]);
639
+ react.useEffect(() => {
640
+ const el = frameOverlayRef.current;
641
+ if (!el) return;
642
+ const svgs = el.querySelectorAll("svg");
643
+ svgs.forEach((svg) => {
644
+ if (!svg.getAttribute("viewBox")) {
645
+ const w = svg.getAttribute("width");
646
+ const h = svg.getAttribute("height");
647
+ if (w && h) svg.setAttribute("viewBox", `0 0 ${w} ${h}`);
648
+ }
649
+ svg.setAttribute("width", "100%");
650
+ svg.setAttribute("height", "100%");
651
+ });
652
+ });
639
653
  const DeviceSVGComponent = svgEntry?.component;
640
654
  const hasMeasured = containerW > 0 && containerH > 0;
641
655
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -703,36 +717,22 @@ function DeviceFrame({
703
717
  children: /* @__PURE__ */ jsxRuntime.jsx(DeviceErrorBoundary, { children })
704
718
  }
705
719
  ),
706
- DeviceSVGComponent && /* @__PURE__ */ jsxRuntime.jsxs(
707
- "div",
720
+ DeviceSVGComponent && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: frameOverlayRef, children: /* @__PURE__ */ jsxRuntime.jsx(
721
+ DeviceSVGComponent,
708
722
  {
709
- ref: frameOverlayRef,
710
- className: "bielaframe-svg-overlay",
723
+ colorScheme,
711
724
  style: {
712
725
  position: "absolute",
713
726
  top: 0,
714
727
  left: 0,
715
728
  width: frameTotalW,
716
729
  height: frameTotalH,
730
+ overflow: "hidden",
717
731
  pointerEvents: "none",
718
- zIndex: 10,
719
- overflow: "hidden"
720
- },
721
- children: [
722
- /* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: `.bielaframe-svg-overlay svg { width: 100% !important; height: 100% !important; }` } }),
723
- /* @__PURE__ */ jsxRuntime.jsx(
724
- DeviceSVGComponent,
725
- {
726
- colorScheme,
727
- style: {
728
- width: "100%",
729
- height: "100%"
730
- }
731
- }
732
- )
733
- ]
732
+ zIndex: 10
733
+ }
734
734
  }
735
- ),
735
+ ) }),
736
736
  showSafeAreaOverlay && /* @__PURE__ */ jsxRuntime.jsx(
737
737
  "div",
738
738
  {