@plasmicapp/react-web 0.2.238 → 0.2.239

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.js CHANGED
@@ -1166,9 +1166,12 @@ var PlasmicImg = React.forwardRef(function PlasmicImg(props, outerRef) {
1166
1166
  }), sizes = _b.sizes, widthDescs = _b.widthDescs;
1167
1167
  var imageLoader = getImageLoader(loader);
1168
1168
  var spacerSvg = "<svg width=\"".concat(spacerWidth, "\" height=\"").concat(spacerHeight, "\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"/>");
1169
- var spacerSvgBase64 = typeof window === "undefined"
1170
- ? Buffer.from(spacerSvg).toString("base64")
1171
- : window.btoa(spacerSvg);
1169
+ var spacerSvgBase64 =
1170
+ // if btoa exists, use btoa, as it works in browser and in
1171
+ // cloudflare edge workers. For node, use Buffer.from().
1172
+ typeof globalThis.btoa === "function"
1173
+ ? globalThis.btoa(spacerSvg)
1174
+ : Buffer.from(spacerSvg).toString("base64");
1172
1175
  var wrapperStyle = __assign({}, (style || {}));
1173
1176
  var spacerStyle = __assign({}, pick(style || {}, "objectFit", "objectPosition"));
1174
1177
  if (displayWidth != null && displayWidth !== "auto") {