@micromag/element-video 0.3.832 → 0.4.6

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-video-container .micromag-element-video-spinner,.micromag-element-video-container.micromag-element-video-withSize .micromag-element-video-media{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-element-video-container{position:relative}.micromag-element-video-container .micromag-element-video-media{display:block;width:100%}.micromag-element-video-container .micromag-element-video-spinner{height:32px;left:50%;margin-left:-16px;margin-top:-16px;top:50%;width:32px}
1
+ .micromag-element-video-container{position:relative}.micromag-element-video-container .micromag-element-video-media{display:block;width:100%}.micromag-element-video-container .micromag-element-video-spinner{height:100%;height:32px;left:0;left:50%;margin-left:-16px;margin-top:-16px;position:absolute;top:0;top:50%;width:100%;width:32px}.micromag-element-video-container.micromag-element-video-withSize .micromag-element-video-media{height:100%;left:0;position:absolute;top:0;width:100%}
package/es/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+
3
+ export { _default as default };
package/es/index.js CHANGED
@@ -2,9 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
3
  import classNames from 'classnames';
4
4
  import isFunction from 'lodash/isFunction';
5
- import PropTypes from 'prop-types';
6
5
  import React, { useMemo, useState, useEffect, useRef, useCallback } from 'react';
7
- import { PropTypes as PropTypes$1 } from '@micromag/core';
8
6
  import { Spinner } from '@micromag/core/components';
9
7
  import { useMediaThumbnail, useMediaCurrentTime, useMediaDuration, useMediaReady, useProgressSteps } from '@micromag/core/hooks';
10
8
  import { useSetting } from '@micromag/core/contexts';
@@ -84,108 +82,71 @@ function useSources(media) {
84
82
  };
85
83
  }
86
84
 
87
- var styles = {"container":"micromag-element-video-container","withSize":"micromag-element-video-withSize","media":"micromag-element-video-media","spinner":"micromag-element-video-spinner"};
85
+ var styles = {"container":"micromag-element-video-container","media":"micromag-element-video-media","spinner":"micromag-element-video-spinner","withSize":"micromag-element-video-withSize"};
88
86
 
89
- var propTypes = {
90
- media: PropTypes$1.videoMedia,
91
- thumbnail: PropTypes.oneOf([PropTypes.string, PropTypes$1.imageMedia]),
92
- width: PropTypes.number,
93
- height: PropTypes.number,
94
- mediaRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
95
- current: PropTypes.any
96
- })]),
97
- muted: PropTypes.bool,
98
- autoPlay: PropTypes.bool,
99
- paused: PropTypes.bool,
100
- loop: PropTypes.bool,
101
- playsInline: PropTypes.bool,
102
- preload: PropTypes.oneOf(['auto', 'metadata', 'none', null]),
103
- disablePictureInPicture: PropTypes.bool,
104
- shouldLoad: PropTypes.bool,
105
- withoutCors: PropTypes.bool,
106
- className: PropTypes.string,
107
- innerClassName: PropTypes.string,
108
- onReady: PropTypes.func,
109
- onPlay: PropTypes.func,
110
- onPause: PropTypes.func,
111
- onEnded: PropTypes.func,
112
- onSeeked: PropTypes.func,
113
- onTimeUpdate: PropTypes.func,
114
- onProgressStep: PropTypes.func,
115
- onDurationChange: PropTypes.func,
116
- onVolumeChange: PropTypes.func,
117
- onSuspend: PropTypes.func,
118
- onSuspended: PropTypes.func,
119
- onPlayError: PropTypes.func,
120
- focusable: PropTypes.bool,
121
- withPoster: PropTypes.bool,
122
- withLoading: PropTypes.bool
123
- };
124
- var defaultProps = {
125
- media: null,
126
- thumbnail: null,
127
- width: null,
128
- height: null,
129
- mediaRef: null,
130
- muted: false,
131
- autoPlay: false,
132
- paused: false,
133
- loop: false,
134
- playsInline: true,
135
- preload: 'auto',
136
- disablePictureInPicture: true,
137
- shouldLoad: true,
138
- withoutCors: false,
139
- className: null,
140
- innerClassName: null,
141
- onReady: null,
142
- onPlay: null,
143
- onPause: null,
144
- onEnded: null,
145
- onSeeked: null,
146
- onTimeUpdate: null,
147
- onProgressStep: null,
148
- onDurationChange: null,
149
- onVolumeChange: null,
150
- onSuspend: null,
151
- onSuspended: null,
152
- onPlayError: null,
153
- focusable: true,
154
- withPoster: false,
155
- withLoading: false
156
- };
157
- var Video = function Video(_ref) {
158
- var media = _ref.media,
159
- thumbnail = _ref.thumbnail,
160
- width = _ref.width,
161
- height = _ref.height,
162
- mediaRef = _ref.mediaRef,
163
- muted = _ref.muted,
164
- autoPlay = _ref.autoPlay,
165
- paused = _ref.paused,
166
- loop = _ref.loop,
167
- playsInline = _ref.playsInline,
168
- preload = _ref.preload,
169
- shouldLoad = _ref.shouldLoad,
170
- withoutCors = _ref.withoutCors,
171
- className = _ref.className,
172
- innerClassName = _ref.innerClassName,
173
- onReady = _ref.onReady,
174
- customOnPlay = _ref.onPlay,
175
- onPause = _ref.onPause,
176
- onEnded = _ref.onEnded,
177
- onSeeked = _ref.onSeeked,
178
- onTimeUpdate = _ref.onTimeUpdate,
179
- onProgressStep = _ref.onProgressStep,
180
- customOnDurationChange = _ref.onDurationChange,
181
- customOnVolumeChange = _ref.onVolumeChange,
182
- customOnSuspend = _ref.onSuspend,
183
- onSuspended = _ref.onSuspended,
184
- onPlayError = _ref.onPlayError,
185
- focusable = _ref.focusable,
186
- withPoster = _ref.withPoster,
187
- withLoading = _ref.withLoading,
188
- disablePictureInPicture = _ref.disablePictureInPicture;
87
+ function Video(_ref) {
88
+ var _ref$media = _ref.media,
89
+ media = _ref$media === void 0 ? null : _ref$media,
90
+ _ref$thumbnail = _ref.thumbnail,
91
+ thumbnail = _ref$thumbnail === void 0 ? null : _ref$thumbnail,
92
+ _ref$width = _ref.width,
93
+ width = _ref$width === void 0 ? null : _ref$width,
94
+ _ref$height = _ref.height,
95
+ height = _ref$height === void 0 ? null : _ref$height,
96
+ _ref$mediaRef = _ref.mediaRef,
97
+ mediaRef = _ref$mediaRef === void 0 ? null : _ref$mediaRef,
98
+ _ref$muted = _ref.muted,
99
+ muted = _ref$muted === void 0 ? false : _ref$muted,
100
+ _ref$autoPlay = _ref.autoPlay,
101
+ autoPlay = _ref$autoPlay === void 0 ? false : _ref$autoPlay,
102
+ _ref$paused = _ref.paused,
103
+ paused = _ref$paused === void 0 ? false : _ref$paused,
104
+ _ref$loop = _ref.loop,
105
+ loop = _ref$loop === void 0 ? false : _ref$loop,
106
+ _ref$playsInline = _ref.playsInline,
107
+ playsInline = _ref$playsInline === void 0 ? true : _ref$playsInline,
108
+ _ref$preload = _ref.preload,
109
+ preload = _ref$preload === void 0 ? 'auto' : _ref$preload,
110
+ _ref$shouldLoad = _ref.shouldLoad,
111
+ shouldLoad = _ref$shouldLoad === void 0 ? true : _ref$shouldLoad,
112
+ _ref$withoutCors = _ref.withoutCors,
113
+ withoutCors = _ref$withoutCors === void 0 ? false : _ref$withoutCors,
114
+ _ref$className = _ref.className,
115
+ className = _ref$className === void 0 ? null : _ref$className,
116
+ _ref$innerClassName = _ref.innerClassName,
117
+ innerClassName = _ref$innerClassName === void 0 ? null : _ref$innerClassName,
118
+ _ref$onReady = _ref.onReady,
119
+ onReady = _ref$onReady === void 0 ? null : _ref$onReady,
120
+ _ref$onPlay = _ref.onPlay,
121
+ customOnPlay = _ref$onPlay === void 0 ? null : _ref$onPlay,
122
+ _ref$onPause = _ref.onPause,
123
+ onPause = _ref$onPause === void 0 ? null : _ref$onPause,
124
+ _ref$onEnded = _ref.onEnded,
125
+ onEnded = _ref$onEnded === void 0 ? null : _ref$onEnded,
126
+ _ref$onSeeked = _ref.onSeeked,
127
+ onSeeked = _ref$onSeeked === void 0 ? null : _ref$onSeeked,
128
+ _ref$onTimeUpdate = _ref.onTimeUpdate,
129
+ onTimeUpdate = _ref$onTimeUpdate === void 0 ? null : _ref$onTimeUpdate,
130
+ _ref$onProgressStep = _ref.onProgressStep,
131
+ onProgressStep = _ref$onProgressStep === void 0 ? null : _ref$onProgressStep,
132
+ _ref$onDurationChange = _ref.onDurationChange,
133
+ customOnDurationChange = _ref$onDurationChange === void 0 ? null : _ref$onDurationChange,
134
+ _ref$onVolumeChange = _ref.onVolumeChange,
135
+ customOnVolumeChange = _ref$onVolumeChange === void 0 ? null : _ref$onVolumeChange,
136
+ _ref$onSuspend = _ref.onSuspend,
137
+ customOnSuspend = _ref$onSuspend === void 0 ? null : _ref$onSuspend,
138
+ _ref$onSuspended = _ref.onSuspended,
139
+ onSuspended = _ref$onSuspended === void 0 ? null : _ref$onSuspended,
140
+ _ref$onPlayError = _ref.onPlayError,
141
+ onPlayError = _ref$onPlayError === void 0 ? null : _ref$onPlayError,
142
+ _ref$focusable = _ref.focusable,
143
+ focusable = _ref$focusable === void 0 ? true : _ref$focusable,
144
+ _ref$withPoster = _ref.withPoster,
145
+ withPoster = _ref$withPoster === void 0 ? false : _ref$withPoster,
146
+ _ref$withLoading = _ref.withLoading,
147
+ withLoading = _ref$withLoading === void 0 ? false : _ref$withLoading,
148
+ _ref$disablePictureIn = _ref.disablePictureInPicture,
149
+ disablePictureInPicture = _ref$disablePictureIn === void 0 ? true : _ref$disablePictureIn;
189
150
  var _ref2 = media || {},
190
151
  _ref2$url = _ref2.url,
191
152
  mediaUrl = _ref2$url === void 0 ? null : _ref2$url,
@@ -357,9 +318,7 @@ var Video = function Video(_ref) {
357
318
  })) : null, !isImageWithoutSourceFile && !ready && showLoading ? /*#__PURE__*/React.createElement(Spinner, {
358
319
  className: styles.spinner
359
320
  }) : null);
360
- };
361
- Video.propTypes = propTypes;
362
- Video.defaultProps = defaultProps;
321
+ }
363
322
  var Video_default = /*#__PURE__*/React.forwardRef(function (props, ref) {
364
323
  return /*#__PURE__*/React.createElement(Video, Object.assign({
365
324
  mediaRef: ref
package/es/styles.css ADDED
@@ -0,0 +1 @@
1
+ .micromag-element-video-container{position:relative}.micromag-element-video-container .micromag-element-video-media{display:block;width:100%}.micromag-element-video-container .micromag-element-video-spinner{height:100%;height:32px;left:0;left:50%;margin-left:-16px;margin-top:-16px;position:absolute;top:0;top:50%;width:100%;width:32px}.micromag-element-video-container.micromag-element-video-withSize .micromag-element-video-media{height:100%;left:0;position:absolute;top:0;width:100%}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-video",
3
- "version": "0.3.832",
3
+ "version": "0.4.6",
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,30 +48,30 @@
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
- "@babel/runtime": "^7.13.10",
62
- "@micromag/core": "^0.3.832",
63
- "@micromag/element-closed-captions": "^0.3.832",
62
+ "@babel/runtime": "^7.28.6",
63
+ "@micromag/core": "^0.4.6",
64
+ "@micromag/element-closed-captions": "^0.4.6",
64
65
  "classnames": "^2.2.6",
65
66
  "hls.js": "^1.5.15",
66
- "lodash": "^4.17.21",
67
- "prop-types": "^15.7.2",
68
- "react-intl": "^6.6.4",
67
+ "lodash": "^4.17.23",
68
+ "react-intl": "^8.1.3",
69
69
  "uuid": "^9.0.0"
70
70
  },
71
71
  "publishConfig": {
72
72
  "access": "public",
73
73
  "registry": "https://registry.npmjs.org/"
74
74
  },
75
- "gitHead": "4969d64e304334cfd47321e624e5914e0694c55f"
75
+ "gitHead": "cf8440c2851b864167a1f545aa56551d55473263",
76
+ "types": "es/index.d.ts"
76
77
  }