@shotstack/shotstack-studio 2.24.1 → 2.24.2

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.
@@ -38590,12 +38590,21 @@ ${e.stack}` : e), this.createFallbackGraphic();
38590
38590
  }
38591
38591
  captureIframeAsForeignObjectSvg(e, r) {
38592
38592
  if (!this.iframe?.contentDocument) throw new Error("iframe not ready");
38593
- const n = this.iframe.contentDocument, i = new XMLSerializer(), a = Array.from(n.querySelectorAll("style")).map((c) => i.serializeToString(c)).join(""), s = "<style>*,*::before,*::after{animation:none!important;transition:none!important}</style>", o = n.body.cloneNode(!0);
38594
- o.querySelectorAll("script").forEach((c) => c.remove());
38595
- const u = o.getAttribute("style") ?? "";
38596
- o.setAttribute("style", `width:${e}px;height:${r}px;margin:0;overflow:hidden;${u}`);
38597
- const l = i.serializeToString(o);
38598
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${r}"><foreignObject width="${e}" height="${r}">${a}${s}${l}</foreignObject></svg>`;
38593
+ const n = this.iframe.contentDocument, i = new XMLSerializer(), a = Array.from(n.querySelectorAll("style")).map((d) => i.serializeToString(d)).join(""), s = "<style>*,*::before,*::after{animation:none!important;transition:none!important}</style>", o = n.body.cloneNode(!0);
38594
+ o.querySelectorAll("script").forEach((d) => d.remove());
38595
+ const u = n.body.querySelectorAll("canvas"), l = o.querySelectorAll("canvas");
38596
+ for (let d = 0; d < l.length; d += 1) {
38597
+ const { style: m } = l[d], y = n.defaultView?.getComputedStyle(u[d]);
38598
+ y && (m.display = y.display === "inline" ? "inline-block" : y.display, m.width = y.width, m.height = y.height);
38599
+ try {
38600
+ m.backgroundImage = `url("${u[d].toDataURL()}")`, m.backgroundSize = "100% 100%", m.backgroundOrigin = "content-box", m.backgroundRepeat = "no-repeat";
38601
+ } catch {
38602
+ }
38603
+ }
38604
+ const c = o.getAttribute("style") ?? "";
38605
+ o.setAttribute("style", `width:${e}px;height:${r}px;margin:0;overflow:hidden;${c}`);
38606
+ const h = i.serializeToString(o);
38607
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${r}"><foreignObject width="${e}" height="${r}">${a}${s}${h}</foreignObject></svg>`;
38599
38608
  }
38600
38609
  async getDecodedFrame(e) {
38601
38610
  if (!this.capturedFrames) return null;