@micromag/element-audio 0.3.396 → 0.3.403

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,3 +1,3 @@
1
1
  .micromag-element-audio-audio-bars-container .micromag-element-audio-audio-bars-seekButton{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;cursor:pointer;display:inline-block;font-family:inherit;height:100%;left:0;padding:0;position:relative;top:0;width:100%}.micromag-element-audio-audio-bars-container{height:100%;position:relative;width:100%}.micromag-element-audio-audio-bars-container .micromag-element-audio-audio-bars-seekButton{position:absolute;-ms-touch-action:none;touch-action:none}
2
- .micromag-element-audio-container .micromag-element-audio-wave{height:150px}
2
+ .micromag-element-audio-container .micromag-element-audio-wave{height:150px}.micromag-element-audio-container .micromag-element-audio-wave.micromag-element-audio-withAutoHeight{height:100%}
3
3
  .micromag-element-audio-audio-wave-container .micromag-element-audio-audio-wave-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;cursor:pointer;display:inline-block;font-family:inherit;padding:0;position:relative}.micromag-element-audio-audio-wave-container .micromag-element-audio-audio-wave-button,.micromag-element-audio-audio-wave-container .micromag-element-audio-audio-wave-canvasBackground,.micromag-element-audio-audio-wave-container .micromag-element-audio-audio-wave-canvasProgress{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-element-audio-audio-wave-container{height:100px;position:relative;-ms-touch-action:pan-y;touch-action:pan-y}
package/es/index.js CHANGED
@@ -176,7 +176,7 @@ function AudioBars(_ref) {
176
176
  AudioBars.propTypes = propTypes$2;
177
177
  AudioBars.defaultProps = defaultProps$2;
178
178
 
179
- var styles$1 = {"container":"micromag-element-audio-container","wave":"micromag-element-audio-wave"};
179
+ var styles$1 = {"container":"micromag-element-audio-container","wave":"micromag-element-audio-wave","withAutoHeight":"micromag-element-audio-withAutoHeight"};
180
180
 
181
181
  var propTypes$1 = {
182
182
  media: PropTypes$1.audioMedia,
@@ -196,7 +196,9 @@ var propTypes$1 = {
196
196
  // minSampleHeight: PropTypes.number,
197
197
  // }),
198
198
  withWave: PropTypes.bool,
199
+ autoWaveHeight: PropTypes.bool,
199
200
  // reduceBufferFactor: PropTypes.number,
201
+ updateInterval: PropTypes.number,
200
202
  className: PropTypes.string,
201
203
  onReady: PropTypes.func,
202
204
  onPlay: PropTypes.func,
@@ -220,7 +222,9 @@ var defaultProps$1 = {
220
222
  waveFake: false,
221
223
  // waveProps: null,
222
224
  withWave: false,
225
+ autoWaveHeight: false,
223
226
  // reduceBufferFactor: 100,
227
+ updateInterval: 1000,
224
228
  className: null,
225
229
  onReady: null,
226
230
  onPlay: null,
@@ -243,6 +247,8 @@ var Audio = function Audio(_ref) {
243
247
  shouldLoad = _ref.shouldLoad,
244
248
  waveFake = _ref.waveFake,
245
249
  withWave = _ref.withWave,
250
+ autoWaveHeight = _ref.autoWaveHeight,
251
+ updateInterval = _ref.updateInterval,
246
252
  className = _ref.className,
247
253
  onReady = _ref.onReady,
248
254
  onPlay = _ref.onPlay,
@@ -259,7 +265,8 @@ var Audio = function Audio(_ref) {
259
265
  var _ref4 = useRef(null);
260
266
  var currentTime = useMediaCurrentTime(_ref4.current, {
261
267
  id: url,
262
- disabled: paused || !withWave && onProgressStep === null
268
+ disabled: paused || !withWave && onProgressStep === null,
269
+ updateInterval: updateInterval
263
270
  });
264
271
  var ready = useMediaReady(_ref4.current, {
265
272
  id: url
@@ -361,7 +368,7 @@ var Audio = function Audio(_ref) {
361
368
  onTimeUpdate: onTimeUpdate,
362
369
  onVolumeChange: onVolumeChange
363
370
  }), withWave ? /*#__PURE__*/React.createElement(AudioBars, {
364
- className: styles$1.wave,
371
+ className: classNames([styles$1.wave, _defineProperty({}, styles$1.withAutoHeight, autoWaveHeight)]),
365
372
  progress: progress
366
373
  // {...waveProps}
367
374
  ,
package/lib/index.js CHANGED
@@ -191,7 +191,7 @@ function AudioBars(_ref) {
191
191
  AudioBars.propTypes = propTypes$2;
192
192
  AudioBars.defaultProps = defaultProps$2;
193
193
 
194
- var styles$1 = {"container":"micromag-element-audio-container","wave":"micromag-element-audio-wave"};
194
+ var styles$1 = {"container":"micromag-element-audio-container","wave":"micromag-element-audio-wave","withAutoHeight":"micromag-element-audio-withAutoHeight"};
195
195
 
196
196
  var propTypes$1 = {
197
197
  media: core.PropTypes.audioMedia,
@@ -211,7 +211,9 @@ var propTypes$1 = {
211
211
  // minSampleHeight: PropTypes.number,
212
212
  // }),
213
213
  withWave: PropTypes__default["default"].bool,
214
+ autoWaveHeight: PropTypes__default["default"].bool,
214
215
  // reduceBufferFactor: PropTypes.number,
216
+ updateInterval: PropTypes__default["default"].number,
215
217
  className: PropTypes__default["default"].string,
216
218
  onReady: PropTypes__default["default"].func,
217
219
  onPlay: PropTypes__default["default"].func,
@@ -235,7 +237,9 @@ var defaultProps$1 = {
235
237
  waveFake: false,
236
238
  // waveProps: null,
237
239
  withWave: false,
240
+ autoWaveHeight: false,
238
241
  // reduceBufferFactor: 100,
242
+ updateInterval: 1000,
239
243
  className: null,
240
244
  onReady: null,
241
245
  onPlay: null,
@@ -258,6 +262,8 @@ var Audio = function Audio(_ref) {
258
262
  shouldLoad = _ref.shouldLoad,
259
263
  waveFake = _ref.waveFake,
260
264
  withWave = _ref.withWave,
265
+ autoWaveHeight = _ref.autoWaveHeight,
266
+ updateInterval = _ref.updateInterval,
261
267
  className = _ref.className,
262
268
  onReady = _ref.onReady,
263
269
  onPlay = _ref.onPlay,
@@ -274,7 +280,8 @@ var Audio = function Audio(_ref) {
274
280
  var _ref4 = React.useRef(null);
275
281
  var currentTime = hooks.useMediaCurrentTime(_ref4.current, {
276
282
  id: url,
277
- disabled: paused || !withWave && onProgressStep === null
283
+ disabled: paused || !withWave && onProgressStep === null,
284
+ updateInterval: updateInterval
278
285
  });
279
286
  var ready = hooks.useMediaReady(_ref4.current, {
280
287
  id: url
@@ -376,7 +383,7 @@ var Audio = function Audio(_ref) {
376
383
  onTimeUpdate: onTimeUpdate,
377
384
  onVolumeChange: onVolumeChange
378
385
  }), withWave ? /*#__PURE__*/React__default["default"].createElement(AudioBars, {
379
- className: styles$1.wave,
386
+ className: classNames__default["default"]([styles$1.wave, _defineProperty__default["default"]({}, styles$1.withAutoHeight, autoWaveHeight)]),
380
387
  progress: progress
381
388
  // {...waveProps}
382
389
  ,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-audio",
3
- "version": "0.3.396",
3
+ "version": "0.3.403",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -53,8 +53,8 @@
53
53
  "@fortawesome/fontawesome-svg-core": "^1.2.32",
54
54
  "@fortawesome/free-solid-svg-icons": "^5.15.1",
55
55
  "@fortawesome/react-fontawesome": "^0.1.13",
56
- "@micromag/core": "^0.3.396",
57
- "@micromag/element-closed-captions": "^0.3.396",
56
+ "@micromag/core": "^0.3.403",
57
+ "@micromag/element-closed-captions": "^0.3.403",
58
58
  "@react-spring/core": "^9.6.1",
59
59
  "@react-spring/web": "^9.6.1",
60
60
  "@use-gesture/react": "^10.2.4",
@@ -69,5 +69,5 @@
69
69
  "access": "public",
70
70
  "registry": "https://registry.npmjs.org/"
71
71
  },
72
- "gitHead": "6f09831a86f03a570096ccc769aa2ecb3bcba693"
72
+ "gitHead": "3179202a6bd721978ed10d9282b904045770189b"
73
73
  }