@raketa-builder/support 0.13.0 → 0.15.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @raketa-builder/support@0.13.0 build
2
+ > @raketa-builder/support@0.15.0 build
3
3
  > tsup src/index.js --format cjs --loader ".js=jsx"
4
4
 
5
5
  CLI Building entry: src/index.js
@@ -7,5 +7,5 @@ CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v6.5.0
8
8
  CLI Target: es6
9
9
  CJS Build start
10
- CJS dist/index.js 21.44 KB
11
- CJS ⚡️ Build success in 48ms
10
+ CJS dist/index.js 21.22 KB
11
+ CJS ⚡️ Build success in 140ms
package/dist/index.js CHANGED
@@ -75,15 +75,15 @@ var getWebp = (url) => {
75
75
  return segments.join(".");
76
76
  };
77
77
  var getDimensions = (src, variant) => {
78
- var _a, _b, _c, _d, _e;
78
+ var _a, _b, _c;
79
79
  if (typeof src === "object" && ((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg"))) {
80
- const width = ((_b = src.sizes[variant]) == null ? void 0 : _b.width) || src.width || null;
81
- const height = ((_c = src.sizes[variant]) == null ? void 0 : _c.height) || src.height || null;
80
+ const width = src.width || null;
81
+ const height = src.height || null;
82
82
  return [width, height];
83
83
  }
84
84
  if (typeof src === "object") {
85
- const width = ((_d = src.sizes[variant]) == null ? void 0 : _d.width) || null;
86
- const height = ((_e = src.sizes[variant]) == null ? void 0 : _e.height) || null;
85
+ const width = ((_b = src.sizes[variant]) == null ? void 0 : _b.width) || null;
86
+ const height = ((_c = src.sizes[variant]) == null ? void 0 : _c.height) || null;
87
87
  return [width, height];
88
88
  }
89
89
  return [null, null];
@@ -124,7 +124,7 @@ var getImageObjOrSrc = (value) => {
124
124
  return value;
125
125
  };
126
126
  var Image = (_a) => {
127
- var _b = _a, { variant, src, alt, loading } = _b, props = __objRest(_b, ["variant", "src", "alt", "loading"]);
127
+ var _b = _a, { variant, src, alt, loading = "lazy" } = _b, props = __objRest(_b, ["variant", "src", "alt", "loading"]);
128
128
  if (!variant) {
129
129
  console.error("Image with no variant", { variant, src, alt, props });
130
130
  return null;
@@ -156,9 +156,6 @@ var Image = (_a) => {
156
156
  )
157
157
  ] });
158
158
  };
159
- Image.defaultProps = {
160
- loading: "lazy"
161
- };
162
159
  var Image_default = Image;
163
160
 
164
161
  // src/imageSrc.js
@@ -472,9 +469,6 @@ var AdminWidgetMinimal = ({
472
469
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Container_default, { settings: containerSettings, children: import_react5.default.createElement(currentWidget, widget.settings) })
473
470
  ] });
474
471
  };
475
- AdminWidgetMinimal.defaultProps = {
476
- containerSettings: {}
477
- };
478
472
  var AdminWidgetMinimal_default = AdminWidgetMinimal;
479
473
 
480
474
  // src/lib/SelectedWidgetsToolbar.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/support",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
@@ -91,8 +91,4 @@ const AdminWidgetMinimal = ({
91
91
  );
92
92
  };
93
93
 
94
- AdminWidgetMinimal.defaultProps = {
95
- containerSettings: {},
96
- };
97
-
98
94
  export default AdminWidgetMinimal;
package/src/Image.js CHANGED
@@ -11,8 +11,8 @@ const getWebp = (url) => {
11
11
 
12
12
  const getDimensions = (src, variant) => {
13
13
  if (typeof src === "object" && src?.name?.includes(".svg")) {
14
- const width = src.sizes[variant]?.width || src.width || null;
15
- const height = src.sizes[variant]?.height || src.height || null;
14
+ const width = src.width || null;
15
+ const height = src.height || null;
16
16
 
17
17
  return [width, height];
18
18
  }
@@ -74,7 +74,7 @@ const getImageObjOrSrc = (value) => {
74
74
  return value;
75
75
  };
76
76
 
77
- const Image = ({ variant, src, alt, loading, ...props }) => {
77
+ const Image = ({ variant, src, alt, loading = "lazy", ...props }) => {
78
78
  if (!variant) {
79
79
  console.error("Image with no variant", { variant, src, alt, props });
80
80
  return null;
@@ -116,8 +116,4 @@ const Image = ({ variant, src, alt, loading, ...props }) => {
116
116
  );
117
117
  };
118
118
 
119
- Image.defaultProps = {
120
- loading: "lazy",
121
- };
122
-
123
119
  export default Image;