@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.
@@ -1148,9 +1148,12 @@ var PlasmicImg = React__default.forwardRef(function PlasmicImg(props, outerRef)
1148
1148
  }), sizes = _b.sizes, widthDescs = _b.widthDescs;
1149
1149
  var imageLoader = getImageLoader(loader);
1150
1150
  var spacerSvg = "<svg width=\"".concat(spacerWidth, "\" height=\"").concat(spacerHeight, "\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"/>");
1151
- var spacerSvgBase64 = typeof window === "undefined"
1152
- ? Buffer.from(spacerSvg).toString("base64")
1153
- : window.btoa(spacerSvg);
1151
+ var spacerSvgBase64 =
1152
+ // if btoa exists, use btoa, as it works in browser and in
1153
+ // cloudflare edge workers. For node, use Buffer.from().
1154
+ typeof globalThis.btoa === "function"
1155
+ ? globalThis.btoa(spacerSvg)
1156
+ : Buffer.from(spacerSvg).toString("base64");
1154
1157
  var wrapperStyle = __assign({}, (style || {}));
1155
1158
  var spacerStyle = __assign({}, pick(style || {}, "objectFit", "objectPosition"));
1156
1159
  if (displayWidth != null && displayWidth !== "auto") {