@micromag/element-image 0.3.824 → 0.4.4
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +5 -0
- package/es/index.js +31 -56
- package/es/styles.css +1 -0
- package/package.json +11 -10
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container{overflow:hidden;position:relative}.container .img{display:block;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container .showEmpty{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);height:200px;margin:5px auto;width:300px}
|
package/es/index.d.ts
ADDED
package/es/index.js
CHANGED
|
@@ -3,64 +3,41 @@ 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 PropTypes from 'prop-types';
|
|
7
6
|
import React, { forwardRef, useState, useRef, useCallback } from 'react';
|
|
8
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
9
7
|
import { useSetting } from '@micromag/core/contexts';
|
|
10
8
|
import { getOptimalImageUrl } from '@micromag/core/utils';
|
|
11
9
|
|
|
12
|
-
var styles = {"container":"
|
|
10
|
+
var styles = {"container":"container","img":"img"};
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
media
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
imageClassName: null,
|
|
44
|
-
onLoaded: null,
|
|
45
|
-
loadingMode: 'lazy',
|
|
46
|
-
shouldLoad: true,
|
|
47
|
-
containerRef: null
|
|
48
|
-
};
|
|
49
|
-
var Image = function Image(_ref) {
|
|
50
|
-
var media = _ref.media,
|
|
51
|
-
alt = _ref.alt,
|
|
52
|
-
width = _ref.width,
|
|
53
|
-
height = _ref.height,
|
|
54
|
-
resolution = _ref.resolution,
|
|
55
|
-
objectFit = _ref.objectFit,
|
|
56
|
-
containerStyle = _ref.containerStyle,
|
|
57
|
-
imageStyle = _ref.imageStyle,
|
|
58
|
-
className = _ref.className,
|
|
59
|
-
imageClassName = _ref.imageClassName,
|
|
60
|
-
onLoaded = _ref.onLoaded,
|
|
61
|
-
loadingMode = _ref.loadingMode,
|
|
62
|
-
shouldLoad = _ref.shouldLoad,
|
|
63
|
-
containerRef = _ref.containerRef;
|
|
12
|
+
function Image(_ref) {
|
|
13
|
+
var _ref$media = _ref.media,
|
|
14
|
+
media = _ref$media === void 0 ? null : _ref$media,
|
|
15
|
+
_ref$alt = _ref.alt,
|
|
16
|
+
alt = _ref$alt === void 0 ? null : _ref$alt,
|
|
17
|
+
_ref$width = _ref.width,
|
|
18
|
+
width = _ref$width === void 0 ? null : _ref$width,
|
|
19
|
+
_ref$height = _ref.height,
|
|
20
|
+
height = _ref$height === void 0 ? null : _ref$height,
|
|
21
|
+
_ref$resolution = _ref.resolution,
|
|
22
|
+
resolution = _ref$resolution === void 0 ? 1 : _ref$resolution,
|
|
23
|
+
_ref$objectFit = _ref.objectFit,
|
|
24
|
+
objectFit = _ref$objectFit === void 0 ? null : _ref$objectFit,
|
|
25
|
+
_ref$containerStyle = _ref.containerStyle,
|
|
26
|
+
containerStyle = _ref$containerStyle === void 0 ? {} : _ref$containerStyle,
|
|
27
|
+
_ref$imageStyle = _ref.imageStyle,
|
|
28
|
+
imageStyle = _ref$imageStyle === void 0 ? {} : _ref$imageStyle,
|
|
29
|
+
_ref$className = _ref.className,
|
|
30
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
31
|
+
_ref$imageClassName = _ref.imageClassName,
|
|
32
|
+
imageClassName = _ref$imageClassName === void 0 ? null : _ref$imageClassName,
|
|
33
|
+
_ref$onLoaded = _ref.onLoaded,
|
|
34
|
+
onLoaded = _ref$onLoaded === void 0 ? null : _ref$onLoaded,
|
|
35
|
+
_ref$loadingMode = _ref.loadingMode,
|
|
36
|
+
loadingMode = _ref$loadingMode === void 0 ? 'lazy' : _ref$loadingMode,
|
|
37
|
+
_ref$shouldLoad = _ref.shouldLoad,
|
|
38
|
+
shouldLoad = _ref$shouldLoad === void 0 ? true : _ref$shouldLoad,
|
|
39
|
+
_ref$containerRef = _ref.containerRef,
|
|
40
|
+
containerRef = _ref$containerRef === void 0 ? null : _ref$containerRef;
|
|
64
41
|
var _ref2 = media || {},
|
|
65
42
|
_ref2$metadata = _ref2.metadata,
|
|
66
43
|
metadata = _ref2$metadata === void 0 ? null : _ref2$metadata;
|
|
@@ -202,9 +179,7 @@ var Image = function Image(_ref) {
|
|
|
202
179
|
onLoad: onImageLoaded,
|
|
203
180
|
loading: loadingMode
|
|
204
181
|
}) : null);
|
|
205
|
-
}
|
|
206
|
-
Image.propTypes = propTypes;
|
|
207
|
-
Image.defaultProps = defaultProps;
|
|
182
|
+
}
|
|
208
183
|
var Image_default = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
209
184
|
return /*#__PURE__*/React.createElement(Image, Object.assign({
|
|
210
185
|
containerRef: ref
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container{overflow:hidden;position:relative}.container .img{display:block;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container .showEmpty{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);height:200px;margin:5px auto;width:300px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
+
"types": "./es/index.d.ts",
|
|
37
38
|
"import": "./es/index.js"
|
|
38
39
|
},
|
|
39
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -47,28 +48,28 @@
|
|
|
47
48
|
"scripts": {
|
|
48
49
|
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
49
50
|
"prepublishOnly": "npm run build",
|
|
50
|
-
"build": "../../scripts/prepare-package.sh"
|
|
51
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"react": "^
|
|
54
|
-
"react-dom": "^
|
|
54
|
+
"react": "^19.2.0",
|
|
55
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
|
-
"react": "^
|
|
58
|
-
"react-dom": "^
|
|
58
|
+
"react": "^19.2.0",
|
|
59
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
62
|
"@babel/runtime": "^7.13.10",
|
|
62
63
|
"@folklore/size": "^0.1.20",
|
|
63
|
-
"@micromag/core": "^0.
|
|
64
|
+
"@micromag/core": "^0.4.4",
|
|
64
65
|
"classnames": "^2.2.6",
|
|
65
|
-
"
|
|
66
|
-
"react-intl": "^6.6.4",
|
|
66
|
+
"react-intl": "^8.1.3",
|
|
67
67
|
"uuid": "^9.0.0"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public",
|
|
71
71
|
"registry": "https://registry.npmjs.org/"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
|
|
74
|
+
"types": "es/index.d.ts"
|
|
74
75
|
}
|