@micromag/screen-audio 0.3.310 → 0.3.318

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-screen-audio-container .micromag-screen-audio-background{position:absolute;top:0;left:0;width:100%;height:100%}.micromag-screen-audio-container{position:relative;width:100%;height:100%;overflow:hidden}.micromag-screen-audio-disabled.micromag-screen-audio-container{overflow:hidden;pointer-events:none}.micromag-screen-audio-hidden.micromag-screen-audio-container{display:none;visibility:hidden}.micromag-screen-audio-placeholder.micromag-screen-audio-container .micromag-screen-audio-content{position:relative;padding:6px}.micromag-screen-audio-container .micromag-screen-audio-empty{margin:5px auto;border:2px dashed #343434;color:#343434}.micromag-screen-audio-container .micromag-screen-audio-background{z-index:0}.micromag-screen-audio-container .micromag-screen-audio-content{z-index:1}.micromag-screen-audio-container .micromag-screen-audio-audio{position:absolute;bottom:50%;left:0;width:100%;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%)}.micromag-screen-audio-container .micromag-screen-audio-bottom{position:absolute;bottom:0;left:0;width:100%;-webkit-transition:padding .2s ease-out,-webkit-transform .2s ease-out;transition:padding .2s ease-out,-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out,padding .2s ease-out;transition:transform .2s ease-out,padding .2s ease-out;transition:transform .2s ease-out,padding .2s ease-out,-webkit-transform .2s ease-out}.micromag-screen-audio-container .micromag-screen-audio-bottom>*{margin-bottom:10px}.micromag-screen-audio-container .micromag-screen-audio-bottom>:last-child{margin-bottom:0}.micromag-screen-audio-container .micromag-screen-audio-empty{width:100%;height:100px;margin:0 auto}.micromag-screen-audio-container.micromag-screen-audio-isPreview{pointer-events:none}
1
+ .micromag-screen-audio-container .micromag-screen-audio-background{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-screen-audio-container{height:100%;overflow:hidden;position:relative;width:100%}.micromag-screen-audio-disabled.micromag-screen-audio-container{overflow:hidden;pointer-events:none}.micromag-screen-audio-hidden.micromag-screen-audio-container{display:none;visibility:hidden}.micromag-screen-audio-placeholder.micromag-screen-audio-container .micromag-screen-audio-content{padding:6px;position:relative}.micromag-screen-audio-container .micromag-screen-audio-empty{border:2px dashed #343434;color:#343434;margin:5px auto}.micromag-screen-audio-container .micromag-screen-audio-background{z-index:0}.micromag-screen-audio-container .micromag-screen-audio-content{z-index:1}.micromag-screen-audio-container .micromag-screen-audio-audio{bottom:50%;left:0;position:absolute;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);width:100%}.micromag-screen-audio-container .micromag-screen-audio-bottom{bottom:0;left:0;position:absolute;-webkit-transition:padding .2s ease-out,-webkit-transform .2s ease-out;transition:padding .2s ease-out,-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out,padding .2s ease-out;transition:transform .2s ease-out,padding .2s ease-out;transition:transform .2s ease-out,padding .2s ease-out,-webkit-transform .2s ease-out;width:100%}.micromag-screen-audio-container .micromag-screen-audio-bottom>*{margin-bottom:10px}.micromag-screen-audio-container .micromag-screen-audio-bottom>:last-child{margin-bottom:0}.micromag-screen-audio-container .micromag-screen-audio-empty{height:100px;margin:0 auto;width:100%}.micromag-screen-audio-container.micromag-screen-audio-isPreview{pointer-events:none}
package/es/index.js CHANGED
@@ -47,103 +47,86 @@ var defaultProps = {
47
47
  showWave: true,
48
48
  className: null
49
49
  };
50
-
51
50
  var AudioScreen = function AudioScreen(_ref) {
52
51
  var _ref8;
53
-
54
52
  _ref.layout;
55
- var audio = _ref.audio,
56
- spacing = _ref.spacing,
57
- background = _ref.background,
58
- callToAction = _ref.callToAction,
59
- current = _ref.current,
60
- active = _ref.active,
61
- transitions = _ref.transitions,
62
- customMediaRef = _ref.mediaRef,
63
- showWave = _ref.showWave,
64
- className = _ref.className;
65
-
53
+ var audio = _ref.audio,
54
+ spacing = _ref.spacing,
55
+ background = _ref.background,
56
+ callToAction = _ref.callToAction,
57
+ current = _ref.current,
58
+ active = _ref.active,
59
+ transitions = _ref.transitions,
60
+ customMediaRef = _ref.mediaRef,
61
+ showWave = _ref.showWave,
62
+ className = _ref.className;
66
63
  var _useScreenSize = useScreenSize(),
67
- width = _useScreenSize.width,
68
- height = _useScreenSize.height,
69
- resolution = _useScreenSize.resolution;
70
-
64
+ width = _useScreenSize.width,
65
+ height = _useScreenSize.height,
66
+ resolution = _useScreenSize.resolution;
71
67
  var _useScreenRenderConte = useScreenRenderContext(),
72
- isPlaceholder = _useScreenRenderConte.isPlaceholder,
73
- isPreview = _useScreenRenderConte.isPreview,
74
- isView = _useScreenRenderConte.isView,
75
- isEdit = _useScreenRenderConte.isEdit,
76
- isStatic = _useScreenRenderConte.isStatic,
77
- isCapture = _useScreenRenderConte.isCapture;
78
-
68
+ isPlaceholder = _useScreenRenderConte.isPlaceholder,
69
+ isPreview = _useScreenRenderConte.isPreview,
70
+ isView = _useScreenRenderConte.isView,
71
+ isEdit = _useScreenRenderConte.isEdit,
72
+ isStatic = _useScreenRenderConte.isStatic,
73
+ isCapture = _useScreenRenderConte.isCapture;
79
74
  var _useViewerContext = useViewerContext(),
80
- viewerTopHeight = _useViewerContext.topHeight,
81
- viewerBottomHeight = _useViewerContext.bottomHeight,
82
- viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
83
-
75
+ viewerTopHeight = _useViewerContext.topHeight,
76
+ viewerBottomHeight = _useViewerContext.bottomHeight,
77
+ viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
84
78
  var _useViewerWebView = useViewerWebView(),
85
- openWebView = _useViewerWebView.open;
86
-
79
+ openWebView = _useViewerWebView.open;
87
80
  var trackScreenMedia = useTrackScreenMedia('audio');
88
-
89
81
  var _useState = useState(isStatic || isPlaceholder),
90
- _useState2 = _slicedToArray(_useState, 2),
91
- ready = _useState2[0],
92
- setReady = _useState2[1];
93
-
82
+ _useState2 = _slicedToArray(_useState, 2),
83
+ ready = _useState2[0],
84
+ setReady = _useState2[1];
94
85
  var backgroundPlaying = current && (isView || isEdit);
95
86
  var mediaShouldLoad = current || active;
96
87
  var transitionPlaying = current && ready;
97
88
  var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
98
-
99
89
  var _ref2 = callToAction || {},
100
- _ref2$active = _ref2.active,
101
- hasCallToAction = _ref2$active === void 0 ? false : _ref2$active;
102
-
90
+ _ref2$active = _ref2.active,
91
+ hasCallToAction = _ref2$active === void 0 ? false : _ref2$active;
103
92
  var hasAudio = audio !== null;
104
-
105
93
  var _ref3 = audio || {},
106
- _ref3$media = _ref3.media,
107
- audioMedia = _ref3$media === void 0 ? null : _ref3$media,
108
- _ref3$autoPlay = _ref3.autoPlay,
109
- autoPlay = _ref3$autoPlay === void 0 ? true : _ref3$autoPlay,
110
- _ref3$closedCaptions = _ref3.closedCaptions,
111
- closedCaptions = _ref3$closedCaptions === void 0 ? null : _ref3$closedCaptions,
112
- _ref3$withWave = _ref3.withWave,
113
- withWave = _ref3$withWave === void 0 ? false : _ref3$withWave,
114
- _ref3$withControls = _ref3.withControls,
115
- withControls = _ref3$withControls === void 0 ? false : _ref3$withControls,
116
- _ref3$withSeekBar = _ref3.withSeekBar,
117
- withSeekBar = _ref3$withSeekBar === void 0 ? false : _ref3$withSeekBar,
118
- _ref3$color = _ref3.color,
119
- color = _ref3$color === void 0 ? null : _ref3$color,
120
- _ref3$progressColor = _ref3.progressColor,
121
- progressColor = _ref3$progressColor === void 0 ? null : _ref3$progressColor;
122
-
94
+ _ref3$media = _ref3.media,
95
+ audioMedia = _ref3$media === void 0 ? null : _ref3$media,
96
+ _ref3$autoPlay = _ref3.autoPlay,
97
+ autoPlay = _ref3$autoPlay === void 0 ? true : _ref3$autoPlay,
98
+ _ref3$closedCaptions = _ref3.closedCaptions,
99
+ closedCaptions = _ref3$closedCaptions === void 0 ? null : _ref3$closedCaptions,
100
+ _ref3$withWave = _ref3.withWave,
101
+ withWave = _ref3$withWave === void 0 ? false : _ref3$withWave,
102
+ _ref3$withControls = _ref3.withControls,
103
+ withControls = _ref3$withControls === void 0 ? false : _ref3$withControls,
104
+ _ref3$withSeekBar = _ref3.withSeekBar,
105
+ withSeekBar = _ref3$withSeekBar === void 0 ? false : _ref3$withSeekBar,
106
+ _ref3$color = _ref3.color,
107
+ color = _ref3$color === void 0 ? null : _ref3$color,
108
+ _ref3$progressColor = _ref3.progressColor,
109
+ progressColor = _ref3$progressColor === void 0 ? null : _ref3$progressColor;
123
110
  var _ref4 = audioMedia || {},
124
- _ref4$url = _ref4.url,
125
- audioUrl = _ref4$url === void 0 ? null : _ref4$url;
126
-
111
+ _ref4$url = _ref4.url,
112
+ audioUrl = _ref4$url === void 0 ? null : _ref4$url;
127
113
  var hasAudioUrl = audioUrl !== null;
128
114
  var finalAudio = hasAudio ? _objectSpread(_objectSpread({}, audio), {}, {
129
115
  autoPlay: !isPreview && !isStatic && !isCapture && autoPlay && current
130
116
  }) : null;
131
117
  var hasClosedCaptions = closedCaptions !== null;
132
-
133
118
  var _usePlaybackContext = usePlaybackContext(),
134
- playing = _usePlaybackContext.playing,
135
- muted = _usePlaybackContext.muted,
136
- setControls = _usePlaybackContext.setControls,
137
- setControlsTheme = _usePlaybackContext.setControlsTheme;
138
- _usePlaybackContext.setMedia;
139
- var setPlaying = _usePlaybackContext.setPlaying;
140
-
119
+ playing = _usePlaybackContext.playing,
120
+ muted = _usePlaybackContext.muted,
121
+ setControls = _usePlaybackContext.setControls,
122
+ setControlsTheme = _usePlaybackContext.setControlsTheme;
123
+ _usePlaybackContext.setMedia;
124
+ var setPlaying = _usePlaybackContext.setPlaying;
141
125
  var mediaRef = usePlaybackMediaRef(current);
142
126
  useEffect(function () {
143
127
  if (!current) {
144
128
  return function () {};
145
129
  }
146
-
147
130
  if (withControls || withSeekBar) {
148
131
  setControls(true);
149
132
  setControlsTheme({
@@ -154,7 +137,6 @@ var AudioScreen = function AudioScreen(_ref) {
154
137
  } else {
155
138
  setControls(false);
156
139
  }
157
-
158
140
  return function () {
159
141
  if (withControls || withSeekBar) {
160
142
  setControls(false);
@@ -169,17 +151,14 @@ var AudioScreen = function AudioScreen(_ref) {
169
151
  var onAudioReady = useCallback(function () {
170
152
  setReady(true);
171
153
  }, [setReady]);
172
-
173
154
  var _useState3 = useState(null),
174
- _useState4 = _slicedToArray(_useState3, 2),
175
- currentTime = _useState4[0],
176
- setCurrentTime = _useState4[1];
177
-
155
+ _useState4 = _slicedToArray(_useState3, 2),
156
+ currentTime = _useState4[0],
157
+ setCurrentTime = _useState4[1];
178
158
  var _useState5 = useState(null),
179
- _useState6 = _slicedToArray(_useState5, 2),
180
- duration = _useState6[0],
181
- setDuration = _useState6[1];
182
-
159
+ _useState6 = _slicedToArray(_useState5, 2),
160
+ duration = _useState6[0],
161
+ setDuration = _useState6[1];
183
162
  var isIOS = useMemo(function () {
184
163
  return isIos();
185
164
  }, [isIos]);
@@ -190,7 +169,7 @@ var AudioScreen = function AudioScreen(_ref) {
190
169
  }, [current, autoPlay]);
191
170
  var onTimeUpdate = useCallback(function (_ref5) {
192
171
  var _ref5$timeStamp = _ref5.timeStamp,
193
- timeStamp = _ref5$timeStamp === void 0 ? 0 : _ref5$timeStamp;
172
+ timeStamp = _ref5$timeStamp === void 0 ? 0 : _ref5$timeStamp;
194
173
  setCurrentTime(timeStamp);
195
174
  }, [setCurrentTime, setDuration, duration]);
196
175
  var onProgressStep = useCallback(function (step) {
@@ -283,7 +262,9 @@ var AudioScreen = function AudioScreen(_ref) {
283
262
  openWebView: openWebView
284
263
  })) : null) : null].filter(function (el) {
285
264
  return el !== null;
286
- }); // console.log('finalAudio', finalAudio);
265
+ });
266
+
267
+ // console.log('finalAudio', finalAudio);
287
268
 
288
269
  return /*#__PURE__*/React.createElement("div", {
289
270
  className: classNames([styles.container, (_ref8 = {}, _defineProperty(_ref8, className, className !== null), _defineProperty(_ref8, styles.placeholder, isPlaceholder), _defineProperty(_ref8, styles.isPreview, isPreview), _ref8)]),
@@ -309,27 +290,22 @@ var AudioScreen = function AudioScreen(_ref) {
309
290
  className: styles.background
310
291
  }) : null);
311
292
  };
312
-
313
293
  AudioScreen.propTypes = propTypes;
314
294
  AudioScreen.defaultProps = defaultProps;
315
295
  var AudioScreen$1 = /*#__PURE__*/React.memo(AudioScreen);
316
296
 
317
297
  var transform = function transform(newStory, _ref) {
318
298
  var audio = _ref.audio;
319
-
320
299
  var _ref2 = audio || {},
321
- _ref2$media = _ref2.media,
322
- media = _ref2$media === void 0 ? null : _ref2$media;
323
-
300
+ _ref2$media = _ref2.media,
301
+ media = _ref2$media === void 0 ? null : _ref2$media;
324
302
  var _Audio = Audio$1(newStory, media),
325
- titleStory = _Audio.story,
326
- titleComponent = _Audio.component; // console.log(media);
327
-
328
-
303
+ titleStory = _Audio.story,
304
+ titleComponent = _Audio.component;
305
+ // console.log(media);
329
306
  var _Container = Container$1(titleStory, _toConsumableArray(titleComponent ? [titleComponent] : [])),
330
- containerStory = _Container.story,
331
- containerComponent = _Container.component;
332
-
307
+ containerStory = _Container.story,
308
+ containerComponent = _Container.component;
333
309
  return _objectSpread(_objectSpread({}, containerStory), {}, {
334
310
  components: [].concat(_toConsumableArray(newStory.components || []), _toConsumableArray(containerComponent ? [containerComponent] : []))
335
311
  });
package/lib/index.js CHANGED
@@ -67,103 +67,86 @@ var defaultProps = {
67
67
  showWave: true,
68
68
  className: null
69
69
  };
70
-
71
70
  var AudioScreen = function AudioScreen(_ref) {
72
71
  var _ref8;
73
-
74
72
  _ref.layout;
75
- var audio = _ref.audio,
76
- spacing = _ref.spacing,
77
- background = _ref.background,
78
- callToAction = _ref.callToAction,
79
- current = _ref.current,
80
- active = _ref.active,
81
- transitions = _ref.transitions,
82
- customMediaRef = _ref.mediaRef,
83
- showWave = _ref.showWave,
84
- className = _ref.className;
85
-
73
+ var audio = _ref.audio,
74
+ spacing = _ref.spacing,
75
+ background = _ref.background,
76
+ callToAction = _ref.callToAction,
77
+ current = _ref.current,
78
+ active = _ref.active,
79
+ transitions = _ref.transitions,
80
+ customMediaRef = _ref.mediaRef,
81
+ showWave = _ref.showWave,
82
+ className = _ref.className;
86
83
  var _useScreenSize = contexts.useScreenSize(),
87
- width = _useScreenSize.width,
88
- height = _useScreenSize.height,
89
- resolution = _useScreenSize.resolution;
90
-
84
+ width = _useScreenSize.width,
85
+ height = _useScreenSize.height,
86
+ resolution = _useScreenSize.resolution;
91
87
  var _useScreenRenderConte = contexts.useScreenRenderContext(),
92
- isPlaceholder = _useScreenRenderConte.isPlaceholder,
93
- isPreview = _useScreenRenderConte.isPreview,
94
- isView = _useScreenRenderConte.isView,
95
- isEdit = _useScreenRenderConte.isEdit,
96
- isStatic = _useScreenRenderConte.isStatic,
97
- isCapture = _useScreenRenderConte.isCapture;
98
-
88
+ isPlaceholder = _useScreenRenderConte.isPlaceholder,
89
+ isPreview = _useScreenRenderConte.isPreview,
90
+ isView = _useScreenRenderConte.isView,
91
+ isEdit = _useScreenRenderConte.isEdit,
92
+ isStatic = _useScreenRenderConte.isStatic,
93
+ isCapture = _useScreenRenderConte.isCapture;
99
94
  var _useViewerContext = contexts.useViewerContext(),
100
- viewerTopHeight = _useViewerContext.topHeight,
101
- viewerBottomHeight = _useViewerContext.bottomHeight,
102
- viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
103
-
95
+ viewerTopHeight = _useViewerContext.topHeight,
96
+ viewerBottomHeight = _useViewerContext.bottomHeight,
97
+ viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
104
98
  var _useViewerWebView = contexts.useViewerWebView(),
105
- openWebView = _useViewerWebView.open;
106
-
99
+ openWebView = _useViewerWebView.open;
107
100
  var trackScreenMedia = hooks.useTrackScreenMedia('audio');
108
-
109
101
  var _useState = React.useState(isStatic || isPlaceholder),
110
- _useState2 = _slicedToArray__default["default"](_useState, 2),
111
- ready = _useState2[0],
112
- setReady = _useState2[1];
113
-
102
+ _useState2 = _slicedToArray__default["default"](_useState, 2),
103
+ ready = _useState2[0],
104
+ setReady = _useState2[1];
114
105
  var backgroundPlaying = current && (isView || isEdit);
115
106
  var mediaShouldLoad = current || active;
116
107
  var transitionPlaying = current && ready;
117
108
  var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
118
-
119
109
  var _ref2 = callToAction || {},
120
- _ref2$active = _ref2.active,
121
- hasCallToAction = _ref2$active === void 0 ? false : _ref2$active;
122
-
110
+ _ref2$active = _ref2.active,
111
+ hasCallToAction = _ref2$active === void 0 ? false : _ref2$active;
123
112
  var hasAudio = audio !== null;
124
-
125
113
  var _ref3 = audio || {},
126
- _ref3$media = _ref3.media,
127
- audioMedia = _ref3$media === void 0 ? null : _ref3$media,
128
- _ref3$autoPlay = _ref3.autoPlay,
129
- autoPlay = _ref3$autoPlay === void 0 ? true : _ref3$autoPlay,
130
- _ref3$closedCaptions = _ref3.closedCaptions,
131
- closedCaptions = _ref3$closedCaptions === void 0 ? null : _ref3$closedCaptions,
132
- _ref3$withWave = _ref3.withWave,
133
- withWave = _ref3$withWave === void 0 ? false : _ref3$withWave,
134
- _ref3$withControls = _ref3.withControls,
135
- withControls = _ref3$withControls === void 0 ? false : _ref3$withControls,
136
- _ref3$withSeekBar = _ref3.withSeekBar,
137
- withSeekBar = _ref3$withSeekBar === void 0 ? false : _ref3$withSeekBar,
138
- _ref3$color = _ref3.color,
139
- color = _ref3$color === void 0 ? null : _ref3$color,
140
- _ref3$progressColor = _ref3.progressColor,
141
- progressColor = _ref3$progressColor === void 0 ? null : _ref3$progressColor;
142
-
114
+ _ref3$media = _ref3.media,
115
+ audioMedia = _ref3$media === void 0 ? null : _ref3$media,
116
+ _ref3$autoPlay = _ref3.autoPlay,
117
+ autoPlay = _ref3$autoPlay === void 0 ? true : _ref3$autoPlay,
118
+ _ref3$closedCaptions = _ref3.closedCaptions,
119
+ closedCaptions = _ref3$closedCaptions === void 0 ? null : _ref3$closedCaptions,
120
+ _ref3$withWave = _ref3.withWave,
121
+ withWave = _ref3$withWave === void 0 ? false : _ref3$withWave,
122
+ _ref3$withControls = _ref3.withControls,
123
+ withControls = _ref3$withControls === void 0 ? false : _ref3$withControls,
124
+ _ref3$withSeekBar = _ref3.withSeekBar,
125
+ withSeekBar = _ref3$withSeekBar === void 0 ? false : _ref3$withSeekBar,
126
+ _ref3$color = _ref3.color,
127
+ color = _ref3$color === void 0 ? null : _ref3$color,
128
+ _ref3$progressColor = _ref3.progressColor,
129
+ progressColor = _ref3$progressColor === void 0 ? null : _ref3$progressColor;
143
130
  var _ref4 = audioMedia || {},
144
- _ref4$url = _ref4.url,
145
- audioUrl = _ref4$url === void 0 ? null : _ref4$url;
146
-
131
+ _ref4$url = _ref4.url,
132
+ audioUrl = _ref4$url === void 0 ? null : _ref4$url;
147
133
  var hasAudioUrl = audioUrl !== null;
148
134
  var finalAudio = hasAudio ? _objectSpread__default["default"](_objectSpread__default["default"]({}, audio), {}, {
149
135
  autoPlay: !isPreview && !isStatic && !isCapture && autoPlay && current
150
136
  }) : null;
151
137
  var hasClosedCaptions = closedCaptions !== null;
152
-
153
138
  var _usePlaybackContext = contexts.usePlaybackContext(),
154
- playing = _usePlaybackContext.playing,
155
- muted = _usePlaybackContext.muted,
156
- setControls = _usePlaybackContext.setControls,
157
- setControlsTheme = _usePlaybackContext.setControlsTheme;
158
- _usePlaybackContext.setMedia;
159
- var setPlaying = _usePlaybackContext.setPlaying;
160
-
139
+ playing = _usePlaybackContext.playing,
140
+ muted = _usePlaybackContext.muted,
141
+ setControls = _usePlaybackContext.setControls,
142
+ setControlsTheme = _usePlaybackContext.setControlsTheme;
143
+ _usePlaybackContext.setMedia;
144
+ var setPlaying = _usePlaybackContext.setPlaying;
161
145
  var mediaRef = contexts.usePlaybackMediaRef(current);
162
146
  React.useEffect(function () {
163
147
  if (!current) {
164
148
  return function () {};
165
149
  }
166
-
167
150
  if (withControls || withSeekBar) {
168
151
  setControls(true);
169
152
  setControlsTheme({
@@ -174,7 +157,6 @@ var AudioScreen = function AudioScreen(_ref) {
174
157
  } else {
175
158
  setControls(false);
176
159
  }
177
-
178
160
  return function () {
179
161
  if (withControls || withSeekBar) {
180
162
  setControls(false);
@@ -189,17 +171,14 @@ var AudioScreen = function AudioScreen(_ref) {
189
171
  var onAudioReady = React.useCallback(function () {
190
172
  setReady(true);
191
173
  }, [setReady]);
192
-
193
174
  var _useState3 = React.useState(null),
194
- _useState4 = _slicedToArray__default["default"](_useState3, 2),
195
- currentTime = _useState4[0],
196
- setCurrentTime = _useState4[1];
197
-
175
+ _useState4 = _slicedToArray__default["default"](_useState3, 2),
176
+ currentTime = _useState4[0],
177
+ setCurrentTime = _useState4[1];
198
178
  var _useState5 = React.useState(null),
199
- _useState6 = _slicedToArray__default["default"](_useState5, 2),
200
- duration = _useState6[0],
201
- setDuration = _useState6[1];
202
-
179
+ _useState6 = _slicedToArray__default["default"](_useState5, 2),
180
+ duration = _useState6[0],
181
+ setDuration = _useState6[1];
203
182
  var isIOS = React.useMemo(function () {
204
183
  return utils.isIos();
205
184
  }, [utils.isIos]);
@@ -210,7 +189,7 @@ var AudioScreen = function AudioScreen(_ref) {
210
189
  }, [current, autoPlay]);
211
190
  var onTimeUpdate = React.useCallback(function (_ref5) {
212
191
  var _ref5$timeStamp = _ref5.timeStamp,
213
- timeStamp = _ref5$timeStamp === void 0 ? 0 : _ref5$timeStamp;
192
+ timeStamp = _ref5$timeStamp === void 0 ? 0 : _ref5$timeStamp;
214
193
  setCurrentTime(timeStamp);
215
194
  }, [setCurrentTime, setDuration, duration]);
216
195
  var onProgressStep = React.useCallback(function (step) {
@@ -303,7 +282,9 @@ var AudioScreen = function AudioScreen(_ref) {
303
282
  openWebView: openWebView
304
283
  })) : null) : null].filter(function (el) {
305
284
  return el !== null;
306
- }); // console.log('finalAudio', finalAudio);
285
+ });
286
+
287
+ // console.log('finalAudio', finalAudio);
307
288
 
308
289
  return /*#__PURE__*/React__default["default"].createElement("div", {
309
290
  className: classNames__default["default"]([styles.container, (_ref8 = {}, _defineProperty__default["default"](_ref8, className, className !== null), _defineProperty__default["default"](_ref8, styles.placeholder, isPlaceholder), _defineProperty__default["default"](_ref8, styles.isPreview, isPreview), _ref8)]),
@@ -329,27 +310,22 @@ var AudioScreen = function AudioScreen(_ref) {
329
310
  className: styles.background
330
311
  }) : null);
331
312
  };
332
-
333
313
  AudioScreen.propTypes = propTypes;
334
314
  AudioScreen.defaultProps = defaultProps;
335
315
  var AudioScreen$1 = /*#__PURE__*/React__default["default"].memo(AudioScreen);
336
316
 
337
317
  var transform = function transform(newStory, _ref) {
338
318
  var audio = _ref.audio;
339
-
340
319
  var _ref2 = audio || {},
341
- _ref2$media = _ref2.media,
342
- media = _ref2$media === void 0 ? null : _ref2$media;
343
-
320
+ _ref2$media = _ref2.media,
321
+ media = _ref2$media === void 0 ? null : _ref2$media;
344
322
  var _Audio = appleNews.Audio(newStory, media),
345
- titleStory = _Audio.story,
346
- titleComponent = _Audio.component; // console.log(media);
347
-
348
-
323
+ titleStory = _Audio.story,
324
+ titleComponent = _Audio.component;
325
+ // console.log(media);
349
326
  var _Container = appleNews.Container(titleStory, _toConsumableArray__default["default"](titleComponent ? [titleComponent] : [])),
350
- containerStory = _Container.story,
351
- containerComponent = _Container.component;
352
-
327
+ containerStory = _Container.story,
328
+ containerComponent = _Container.component;
353
329
  return _objectSpread__default["default"](_objectSpread__default["default"]({}, containerStory), {}, {
354
330
  components: [].concat(_toConsumableArray__default["default"](newStory.components || []), _toConsumableArray__default["default"](containerComponent ? [containerComponent] : []))
355
331
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-audio",
3
- "version": "0.3.310",
3
+ "version": "0.3.318",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -49,23 +49,23 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
- "@micromag/core": "^0.3.307",
53
- "@micromag/element-audio": "^0.3.310",
54
- "@micromag/element-background": "^0.3.307",
55
- "@micromag/element-call-to-action": "^0.3.310",
56
- "@micromag/element-closed-captions": "^0.3.307",
57
- "@micromag/element-container": "^0.3.307",
58
- "@micromag/element-layout": "^0.3.307",
59
- "@micromag/element-media-controls": "^0.3.307",
60
- "@micromag/transforms": "^0.3.307",
52
+ "@micromag/core": "^0.3.318",
53
+ "@micromag/element-audio": "^0.3.318",
54
+ "@micromag/element-background": "^0.3.318",
55
+ "@micromag/element-call-to-action": "^0.3.318",
56
+ "@micromag/element-closed-captions": "^0.3.318",
57
+ "@micromag/element-container": "^0.3.318",
58
+ "@micromag/element-layout": "^0.3.318",
59
+ "@micromag/element-media-controls": "^0.3.318",
60
+ "@micromag/transforms": "^0.3.318",
61
61
  "classnames": "^2.2.6",
62
62
  "lodash": "^4.17.21",
63
63
  "prop-types": "^15.7.2",
64
64
  "react-intl": "^5.12.1",
65
- "uuid": "^8.3.2"
65
+ "uuid": "^9.0.0"
66
66
  },
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "c2f4fbfcf0f643737a77f99dccf4d353f7856c2c"
70
+ "gitHead": "7d1a296e0c0d410e1225279e1f19e3a7715bfa96"
71
71
  }