@micromag/screen-audio 0.4.49 → 0.4.51
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.
- package/es/index.js +83 -83
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
3
3
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import
|
|
6
|
+
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
7
7
|
import { ScreenElement } from '@micromag/core/components';
|
|
8
8
|
import { useScreenSize, useScreenRenderContext, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
|
|
9
9
|
import { useTrackScreenMedia } from '@micromag/core/hooks';
|
|
@@ -15,6 +15,7 @@ import Container from '@micromag/element-container';
|
|
|
15
15
|
import Footer from '@micromag/element-footer';
|
|
16
16
|
import Header from '@micromag/element-header';
|
|
17
17
|
import Layout, { Spacer } from '@micromag/element-layout';
|
|
18
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
18
19
|
|
|
19
20
|
var styles = {"container":"micromag-screen-audio-container","background":"micromag-screen-audio-background","content":"micromag-screen-audio-content","audio":"micromag-screen-audio-audio","bottom":"micromag-screen-audio-bottom","empty":"micromag-screen-audio-empty","isPreview":"micromag-screen-audio-isPreview"};
|
|
20
21
|
|
|
@@ -194,89 +195,88 @@ function AudioScreen(_ref) {
|
|
|
194
195
|
setControlsSuggestPlay(true);
|
|
195
196
|
}
|
|
196
197
|
}, [isView, current, playing, hasAudio, autoPlay, setPlaying, setControlsSuggestPlay]);
|
|
197
|
-
return /*#__PURE__*/
|
|
198
|
+
return /*#__PURE__*/jsxs("div", {
|
|
198
199
|
className: classNames([styles.container, className, _defineProperty(_defineProperty({}, styles.placeholder, isPlaceholder), styles.isPreview, isPreview)]),
|
|
199
|
-
"data-screen-ready": ready
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}) : null);
|
|
200
|
+
"data-screen-ready": ready,
|
|
201
|
+
children: [/*#__PURE__*/jsx(Container, {
|
|
202
|
+
width: width,
|
|
203
|
+
height: height,
|
|
204
|
+
className: styles.content,
|
|
205
|
+
children: /*#__PURE__*/jsxs(Layout, {
|
|
206
|
+
fullscreen: true,
|
|
207
|
+
style: !isPlaceholder ? {
|
|
208
|
+
padding: spacing,
|
|
209
|
+
paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing)
|
|
210
|
+
} : null,
|
|
211
|
+
children: [hasHeader ? /*#__PURE__*/jsx(Header, _objectSpread({}, header)) : /*#__PURE__*/jsx(Spacer, {}, "spacer-top"), /*#__PURE__*/jsx(ScreenElement, {
|
|
212
|
+
placeholder: "audio",
|
|
213
|
+
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
214
|
+
id: "MYZwSA",
|
|
215
|
+
defaultMessage: [{
|
|
216
|
+
"type": 0,
|
|
217
|
+
"value": "Audio"
|
|
218
|
+
}]
|
|
219
|
+
}),
|
|
220
|
+
emptyClassName: styles.empty,
|
|
221
|
+
isEmpty: !hasAudioUrl,
|
|
222
|
+
children: /*#__PURE__*/jsx(Audio, _objectSpread(_objectSpread({}, finalAudio), {}, {
|
|
223
|
+
mediaRef: mediaRef,
|
|
224
|
+
waveFake: isIOS || isPreview,
|
|
225
|
+
waveProps: isPreview ? {
|
|
226
|
+
sampleWidth: 10,
|
|
227
|
+
sampleMargin: 5,
|
|
228
|
+
minSampleHeight: 5,
|
|
229
|
+
backgroundColor: color,
|
|
230
|
+
progressColor: progressColor
|
|
231
|
+
} : {
|
|
232
|
+
backgroundColor: color,
|
|
233
|
+
progressColor: progressColor
|
|
234
|
+
},
|
|
235
|
+
paused: paused,
|
|
236
|
+
muted: muted,
|
|
237
|
+
className: styles.audio,
|
|
238
|
+
onReady: onAudioReady,
|
|
239
|
+
onPlay: onPlay,
|
|
240
|
+
onPause: onPause,
|
|
241
|
+
onTimeUpdate: onTimeUpdate,
|
|
242
|
+
onProgressStep: onProgressStep,
|
|
243
|
+
onDurationChange: onDurationChange,
|
|
244
|
+
onSeeked: onSeeked,
|
|
245
|
+
onEnded: onEnded,
|
|
246
|
+
onPlayError: onPlayError,
|
|
247
|
+
withWave: showWave && withWave
|
|
248
|
+
}))
|
|
249
|
+
}, "audio"), /*#__PURE__*/jsx(Spacer, {}, "spacer-middle"), !isPlaceholder ? /*#__PURE__*/jsxs("div", {
|
|
250
|
+
className: styles.bottom,
|
|
251
|
+
style: {
|
|
252
|
+
transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
|
|
253
|
+
paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
254
|
+
paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
255
|
+
paddingBottom: spacing / 2,
|
|
256
|
+
paddingTop: 0
|
|
257
|
+
},
|
|
258
|
+
children: [hasClosedCaptions && !isPreview && !isCapture && !isStatic ? /*#__PURE__*/jsx(ClosedCaptions, _objectSpread(_objectSpread({
|
|
259
|
+
className: styles.closedCaptions,
|
|
260
|
+
media: closedCaptions
|
|
261
|
+
}, captions), {}, {
|
|
262
|
+
currentTime: currentTime
|
|
263
|
+
})) : null, hasFooter ? /*#__PURE__*/jsx(Footer, _objectSpread(_objectSpread({}, footerProps), {}, {
|
|
264
|
+
className: styles.callToAction
|
|
265
|
+
})) : null]
|
|
266
|
+
}, "bottom") : null]
|
|
267
|
+
})
|
|
268
|
+
}), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
|
|
269
|
+
background: background,
|
|
270
|
+
width: width,
|
|
271
|
+
height: height,
|
|
272
|
+
resolution: resolution,
|
|
273
|
+
playing: backgroundPlaying,
|
|
274
|
+
muted: muted,
|
|
275
|
+
shouldLoad: mediaShouldLoad,
|
|
276
|
+
withoutVideo: isPreview,
|
|
277
|
+
className: styles.background
|
|
278
|
+
}) : null]
|
|
279
|
+
});
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
// import * as transforms from './transforms/index';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-audio",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@babel/runtime": "^7.28.6",
|
|
64
|
-
"@micromag/core": "^0.4.
|
|
65
|
-
"@micromag/element-audio": "^0.4.
|
|
66
|
-
"@micromag/element-background": "^0.4.
|
|
67
|
-
"@micromag/element-closed-captions": "^0.4.
|
|
68
|
-
"@micromag/element-container": "^0.4.
|
|
69
|
-
"@micromag/element-footer": "^0.4.
|
|
70
|
-
"@micromag/element-header": "^0.4.
|
|
71
|
-
"@micromag/element-layout": "^0.4.
|
|
72
|
-
"@micromag/transforms": "^0.4.
|
|
64
|
+
"@micromag/core": "^0.4.51",
|
|
65
|
+
"@micromag/element-audio": "^0.4.51",
|
|
66
|
+
"@micromag/element-background": "^0.4.51",
|
|
67
|
+
"@micromag/element-closed-captions": "^0.4.51",
|
|
68
|
+
"@micromag/element-container": "^0.4.51",
|
|
69
|
+
"@micromag/element-footer": "^0.4.51",
|
|
70
|
+
"@micromag/element-header": "^0.4.51",
|
|
71
|
+
"@micromag/element-layout": "^0.4.51",
|
|
72
|
+
"@micromag/transforms": "^0.4.51",
|
|
73
73
|
"classnames": "^2.2.6",
|
|
74
74
|
"lodash": "^4.17.23",
|
|
75
75
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -79,6 +79,6 @@
|
|
|
79
79
|
"access": "public",
|
|
80
80
|
"registry": "https://registry.npmjs.org/"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "985a2370829c9ac8901ea97bf20bfc98ab158439",
|
|
83
83
|
"types": "es/index.d.ts"
|
|
84
84
|
}
|