@micromag/element-image 0.3.832 → 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.
@@ -1 +1 @@
1
- .micromag-element-image-container .micromag-element-image-showEmpty{margin:5px auto}.micromag-element-image-container{overflow:hidden;position:relative}.micromag-element-image-container .micromag-element-image-img{display:block;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.micromag-element-image-container .micromag-element-image-showEmpty{border:2px dashed #343434;color:#343434;height:200px;width:300px}
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
@@ -0,0 +1,5 @@
1
+ import * as react from 'react';
2
+
3
+ declare const _default: react.ForwardRefExoticComponent<react.RefAttributes<unknown>>;
4
+
5
+ export { _default as default };
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":"micromag-element-image-container","img":"micromag-element-image-img"};
10
+ var styles = {"container":"container","img":"img"};
13
11
 
14
- var propTypes = {
15
- media: PropTypes$1.imageMedia,
16
- alt: PropTypes.string,
17
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
18
- height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
19
- resolution: PropTypes.number,
20
- objectFit: PropTypes$1.objectFit,
21
- containerStyle: PropTypes$1.containerStyle,
22
- imageStyle: PropTypes$1.containerStyle,
23
- className: PropTypes.string,
24
- imageClassName: PropTypes.string,
25
- onLoaded: PropTypes.func,
26
- loadingMode: PropTypes.string,
27
- shouldLoad: PropTypes.bool,
28
- containerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
29
- current: PropTypes.any
30
- })])
31
- };
32
- var defaultProps = {
33
- media: null,
34
- alt: null,
35
- width: null,
36
- height: null,
37
- resolution: 1,
38
- objectFit: null,
39
- containerStyle: {},
40
- //
41
- imageStyle: {},
42
- className: null,
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.832",
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": "^16.8.0 || ^17.0.0 || ^18.0.0",
54
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
54
+ "react": "^19.2.0",
55
+ "react-dom": "^18.3.0 || ^19.0.0"
55
56
  },
56
57
  "peerDependencies": {
57
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
58
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
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.3.832",
64
+ "@micromag/core": "^0.4.4",
64
65
  "classnames": "^2.2.6",
65
- "prop-types": "^15.7.2",
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": "4969d64e304334cfd47321e624e5914e0694c55f"
73
+ "gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
74
+ "types": "es/index.d.ts"
74
75
  }