@micromag/element-visual 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-visual-container{overflow:hidden;position:relative}.micromag-element-visual-container .micromag-element-visual-videoContainer{overflow:hidden;position:absolute}.micromag-element-visual-container .micromag-element-visual-videoTag{pointer-events:auto}.micromag-element-visual-container .micromag-element-visual-videoTouchOverlay{bottom:0;left:0;position:absolute;right:0;top:0}
1
+ .container{overflow:hidden;position:relative}.container .videoContainer{overflow:hidden;position:absolute}.container .videoTag{pointer-events:auto}.container .videoTouchOverlay{bottom:0;left:0;position:absolute;right:0;top:0}
package/es/index.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Media, ObjectFit } from '@micromag/core';
3
+
4
+ interface VisualProps {
5
+ media?: Media | null;
6
+ mediaRef?: ((...args: unknown[]) => void | {
7
+ current?: unknown;
8
+ }) | null;
9
+ width?: number | string | null;
10
+ height?: number | string | null;
11
+ ratio?: number | null;
12
+ resolution?: number;
13
+ objectFit?: ObjectFit | null;
14
+ playing?: boolean;
15
+ muted?: boolean;
16
+ shouldLoad?: boolean;
17
+ loadingMode?: string | null;
18
+ videoLoop?: boolean;
19
+ withoutVideo?: boolean;
20
+ videoInitialMuted?: boolean;
21
+ onLoaded?: ((...args: unknown[]) => void) | null;
22
+ className?: string | null;
23
+ imageClassName?: string | null;
24
+ videoClassName?: string | null;
25
+ qualityStartLevel?: number | null;
26
+ onQualityLevelChange?: ((...args: unknown[]) => void) | null;
27
+ }
28
+ declare function Visual({ media, mediaRef, width, height, ratio, resolution, objectFit, playing, muted, loadingMode, shouldLoad, videoLoop, videoInitialMuted, onLoaded: onParentLoaded, className, imageClassName, videoClassName, withoutVideo, qualityStartLevel, onQualityLevelChange, ...props }: VisualProps): react_jsx_runtime.JSX.Element;
29
+
30
+ export { Visual as default };
package/es/index.js CHANGED
@@ -3,84 +3,54 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
3
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
4
4
  import { getSizeWithinBounds } from '@folklore/size';
5
5
  import classNames from 'classnames';
6
- import PropTypes from 'prop-types';
7
6
  import React, { useMemo, useCallback } from 'react';
8
- import { PropTypes as PropTypes$1 } from '@micromag/core';
9
7
  import { useIsVisible } from '@micromag/core/hooks';
10
8
  import Image from '@micromag/element-image';
11
9
  import Video from '@micromag/element-video';
12
10
 
13
- var styles = {"container":"micromag-element-visual-container","videoContainer":"micromag-element-visual-videoContainer","videoTag":"micromag-element-visual-videoTag","videoTouchOverlay":"micromag-element-visual-videoTouchOverlay"};
11
+ var styles = {"container":"container","videoContainer":"videoContainer","videoTag":"videoTag","videoTouchOverlay":"videoTouchOverlay"};
14
12
 
15
13
  var _excluded = ["media", "mediaRef", "width", "height", "ratio", "resolution", "objectFit", "playing", "muted", "loadingMode", "shouldLoad", "videoLoop", "videoInitialMuted", "onLoaded", "className", "imageClassName", "videoClassName", "withoutVideo", "qualityStartLevel", "onQualityLevelChange"];
16
- var propTypes = {
17
- media: PropTypes$1.media,
18
- mediaRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
19
- // eslint-disable-next-line react/forbid-prop-types
20
- current: PropTypes.any
21
- })]),
22
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
23
- height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
24
- ratio: PropTypes.number,
25
- resolution: PropTypes.number,
26
- objectFit: PropTypes$1.objectFit,
27
- playing: PropTypes.bool,
28
- muted: PropTypes.bool,
29
- shouldLoad: PropTypes.bool,
30
- loadingMode: PropTypes.string,
31
- videoLoop: PropTypes.bool,
32
- withoutVideo: PropTypes.bool,
33
- videoInitialMuted: PropTypes.bool,
34
- onLoaded: PropTypes.func,
35
- className: PropTypes.string,
36
- imageClassName: PropTypes.string,
37
- videoClassName: PropTypes.string,
38
- qualityStartLevel: PropTypes.number,
39
- onQualityLevelChange: PropTypes.func
40
- };
41
- var defaultProps = {
42
- media: null,
43
- mediaRef: null,
44
- width: null,
45
- height: null,
46
- ratio: null,
47
- resolution: 1,
48
- objectFit: null,
49
- playing: true,
50
- muted: true,
51
- loadingMode: null,
52
- shouldLoad: true,
53
- videoLoop: true,
54
- withoutVideo: false,
55
- videoInitialMuted: true,
56
- onLoaded: null,
57
- className: null,
58
- imageClassName: null,
59
- videoClassName: null,
60
- qualityStartLevel: null,
61
- onQualityLevelChange: null
62
- };
63
- var Visual = function Visual(_ref) {
64
- var media = _ref.media,
65
- mediaRef = _ref.mediaRef,
66
- width = _ref.width,
67
- height = _ref.height,
68
- ratio = _ref.ratio,
69
- resolution = _ref.resolution,
70
- objectFit = _ref.objectFit,
71
- playing = _ref.playing,
72
- muted = _ref.muted,
73
- loadingMode = _ref.loadingMode,
74
- shouldLoad = _ref.shouldLoad,
75
- videoLoop = _ref.videoLoop;
14
+ function Visual(_ref) {
15
+ var _ref$media = _ref.media,
16
+ media = _ref$media === void 0 ? null : _ref$media,
17
+ _ref$mediaRef = _ref.mediaRef,
18
+ mediaRef = _ref$mediaRef === void 0 ? null : _ref$mediaRef,
19
+ _ref$width = _ref.width,
20
+ width = _ref$width === void 0 ? null : _ref$width,
21
+ _ref$height = _ref.height,
22
+ height = _ref$height === void 0 ? null : _ref$height,
23
+ _ref$ratio = _ref.ratio,
24
+ ratio = _ref$ratio === void 0 ? null : _ref$ratio,
25
+ _ref$resolution = _ref.resolution,
26
+ resolution = _ref$resolution === void 0 ? 1 : _ref$resolution,
27
+ _ref$objectFit = _ref.objectFit,
28
+ objectFit = _ref$objectFit === void 0 ? null : _ref$objectFit,
29
+ _ref$playing = _ref.playing,
30
+ playing = _ref$playing === void 0 ? true : _ref$playing,
31
+ _ref$muted = _ref.muted,
32
+ muted = _ref$muted === void 0 ? true : _ref$muted,
33
+ _ref$loadingMode = _ref.loadingMode,
34
+ loadingMode = _ref$loadingMode === void 0 ? null : _ref$loadingMode,
35
+ _ref$shouldLoad = _ref.shouldLoad,
36
+ shouldLoad = _ref$shouldLoad === void 0 ? true : _ref$shouldLoad,
37
+ _ref$videoLoop = _ref.videoLoop,
38
+ videoLoop = _ref$videoLoop === void 0 ? true : _ref$videoLoop;
76
39
  _ref.videoInitialMuted;
77
- var onParentLoaded = _ref.onLoaded,
78
- className = _ref.className,
79
- imageClassName = _ref.imageClassName,
80
- videoClassName = _ref.videoClassName,
81
- withoutVideo = _ref.withoutVideo,
82
- qualityStartLevel = _ref.qualityStartLevel,
83
- onQualityLevelChange = _ref.onQualityLevelChange,
40
+ var _ref$onLoaded = _ref.onLoaded,
41
+ onParentLoaded = _ref$onLoaded === void 0 ? null : _ref$onLoaded,
42
+ _ref$className = _ref.className,
43
+ className = _ref$className === void 0 ? null : _ref$className,
44
+ _ref$imageClassName = _ref.imageClassName,
45
+ imageClassName = _ref$imageClassName === void 0 ? null : _ref$imageClassName,
46
+ _ref$videoClassName = _ref.videoClassName,
47
+ videoClassName = _ref$videoClassName === void 0 ? null : _ref$videoClassName,
48
+ _ref$withoutVideo = _ref.withoutVideo,
49
+ withoutVideo = _ref$withoutVideo === void 0 ? false : _ref$withoutVideo,
50
+ _ref$qualityStartLeve = _ref.qualityStartLevel,
51
+ qualityStartLevel = _ref$qualityStartLeve === void 0 ? null : _ref$qualityStartLeve,
52
+ _ref$onQualityLevelCh = _ref.onQualityLevelChange,
53
+ onQualityLevelChange = _ref$onQualityLevelCh === void 0 ? null : _ref$onQualityLevelCh,
84
54
  props = _objectWithoutProperties(_ref, _excluded);
85
55
  var _ref2 = media || {},
86
56
  _ref2$type = _ref2.type,
@@ -186,8 +156,6 @@ var Visual = function Visual(_ref) {
186
156
  })), /*#__PURE__*/React.createElement("div", {
187
157
  className: styles.videoTouchOverlay
188
158
  }))) : null) : null;
189
- };
190
- Visual.propTypes = propTypes;
191
- Visual.defaultProps = defaultProps;
159
+ }
192
160
 
193
161
  export { Visual as default };
package/es/styles.css ADDED
@@ -0,0 +1 @@
1
+ .container{overflow:hidden;position:relative}.container .videoContainer{overflow:hidden;position:absolute}.container .videoTag{pointer-events:auto}.container .videoTouchOverlay{bottom:0;left:0;position:absolute;right:0;top:0}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-visual",
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,29 +48,29 @@
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/element-image": "^0.3.832",
65
- "@micromag/element-video": "^0.3.832",
64
+ "@micromag/core": "^0.4.4",
65
+ "@micromag/element-image": "^0.4.4",
66
+ "@micromag/element-video": "^0.4.4",
66
67
  "classnames": "^2.2.6",
67
- "prop-types": "^15.7.2",
68
68
  "uuid": "^9.0.0"
69
69
  },
70
70
  "publishConfig": {
71
71
  "access": "public",
72
72
  "registry": "https://registry.npmjs.org/"
73
73
  },
74
- "gitHead": "4969d64e304334cfd47321e624e5914e0694c55f"
74
+ "gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
75
+ "types": "es/index.d.ts"
75
76
  }