@micromag/element-image 0.4.48 → 0.4.50
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/es/index.js +14 -12
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -3,9 +3,10 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import { getSizeWithinBounds } from '@folklore/size';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import
|
|
6
|
+
import { useState, useRef, useCallback } from 'react';
|
|
7
7
|
import { useSetting } from '@micromag/core/contexts';
|
|
8
8
|
import { getOptimalImageUrl } from '@micromag/core/utils';
|
|
9
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
11
|
var styles = {"container":"micromag-element-image-container","img":"micromag-element-image-img"};
|
|
11
12
|
|
|
@@ -169,23 +170,24 @@ function Image(_ref) {
|
|
|
169
170
|
resolution: imageResolution,
|
|
170
171
|
supportsWebp: supportsWebp
|
|
171
172
|
});
|
|
172
|
-
return /*#__PURE__*/
|
|
173
|
+
return /*#__PURE__*/jsx("div", {
|
|
173
174
|
className: classNames([styles.container, className]),
|
|
174
175
|
style: finalContainerStyle,
|
|
175
|
-
ref: containerRef
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
176
|
+
ref: containerRef,
|
|
177
|
+
children: finalUrl !== null && finalShouldLoad ? /*#__PURE__*/jsx("img", {
|
|
178
|
+
src: finalUrl,
|
|
179
|
+
alt: alt || description,
|
|
180
|
+
className: classNames([styles.img, imageClassName]),
|
|
181
|
+
style: finalImageStyle,
|
|
182
|
+
onLoad: onImageLoaded,
|
|
183
|
+
loading: loadingMode
|
|
184
|
+
}) : null
|
|
185
|
+
});
|
|
184
186
|
}
|
|
185
187
|
var Image_default = (function (_ref5) {
|
|
186
188
|
var ref = _ref5.ref,
|
|
187
189
|
props = _objectWithoutProperties(_ref5, _excluded);
|
|
188
|
-
return /*#__PURE__*/
|
|
190
|
+
return /*#__PURE__*/jsx(Image, _objectSpread({
|
|
189
191
|
containerRef: ref
|
|
190
192
|
}, props));
|
|
191
193
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-image",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.50",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@babel/runtime": "^7.28.6",
|
|
63
63
|
"@folklore/size": "^0.1.20",
|
|
64
|
-
"@micromag/core": "^0.4.
|
|
64
|
+
"@micromag/core": "^0.4.50",
|
|
65
65
|
"classnames": "^2.2.6",
|
|
66
66
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
67
67
|
"uuid": "^9.0.0"
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"access": "public",
|
|
71
71
|
"registry": "https://registry.npmjs.org/"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
|
|
74
74
|
"types": "es/index.d.ts"
|
|
75
75
|
}
|