@webstudio-is/image 0.49.0 → 0.50.0

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.
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -66,6 +66,7 @@ const generateImgAttrs = ({
66
66
  srcSet: widths.map(
67
67
  (w, i) => `${loader({ src, quality, width: w })} ${kind === "w" ? w : i + 1}${kind}`
68
68
  ).join(", "),
69
+ // Must be last, to prevent Safari to load images twice
69
70
  src: loader({
70
71
  src,
71
72
  quality,
package/lib/cjs/image.cjs CHANGED
@@ -43,13 +43,16 @@ const Image = (0, import_react.forwardRef)(
43
43
  loader,
44
44
  optimize
45
45
  }) ?? { src: imagePlaceholderSvg };
46
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
47
- ...imageProps,
48
- ...imageAttributes,
49
- decoding,
50
- loading,
51
- ref
52
- });
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ "img",
48
+ {
49
+ ...imageProps,
50
+ ...imageAttributes,
51
+ decoding,
52
+ loading,
53
+ ref
54
+ }
55
+ );
53
56
  }
54
57
  );
55
58
  Image.defaultProps = {
package/lib/cjs/index.cjs CHANGED
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -42,6 +42,7 @@ const generateImgAttrs = ({
42
42
  srcSet: widths.map(
43
43
  (w, i) => `${loader({ src, quality, width: w })} ${kind === "w" ? w : i + 1}${kind}`
44
44
  ).join(", "),
45
+ // Must be last, to prevent Safari to load images twice
45
46
  src: loader({
46
47
  src,
47
48
  quality,
package/lib/image.js CHANGED
@@ -20,13 +20,16 @@ const Image = forwardRef(
20
20
  loader,
21
21
  optimize
22
22
  }) ?? { src: imagePlaceholderSvg };
23
- return /* @__PURE__ */ jsx("img", {
24
- ...imageProps,
25
- ...imageAttributes,
26
- decoding,
27
- loading,
28
- ref
29
- });
23
+ return /* @__PURE__ */ jsx(
24
+ "img",
25
+ {
26
+ ...imageProps,
27
+ ...imageAttributes,
28
+ decoding,
29
+ loading,
30
+ ref
31
+ }
32
+ );
30
33
  }
31
34
  );
32
35
  Image.defaultProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/image",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "Image optimization",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "react": "^17.0.2",
10
10
  "warn-once": "^0.1.1",
11
- "@webstudio-is/generate-arg-types": "^0.49.0"
11
+ "@webstudio-is/generate-arg-types": "^0.50.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@jest/globals": "^29.3.1",