@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.
Files changed (2) hide show
  1. package/es/index.js +83 -83
  2. 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 React, { useState, useEffect, useCallback, useMemo } from 'react';
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__*/React.createElement("div", {
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
- }, /*#__PURE__*/React.createElement(Container, {
201
- width: width,
202
- height: height,
203
- className: styles.content
204
- }, /*#__PURE__*/React.createElement(Layout, {
205
- fullscreen: true,
206
- style: !isPlaceholder ? {
207
- padding: spacing,
208
- paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing)
209
- } : null
210
- }, hasHeader ? /*#__PURE__*/React.createElement(Header, header) : /*#__PURE__*/React.createElement(Spacer, {
211
- key: "spacer-top"
212
- }), /*#__PURE__*/React.createElement(ScreenElement, {
213
- key: "audio",
214
- placeholder: "audio",
215
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
216
- id: "MYZwSA",
217
- defaultMessage: [{
218
- "type": 0,
219
- "value": "Audio"
220
- }]
221
- }),
222
- emptyClassName: styles.empty,
223
- isEmpty: !hasAudioUrl
224
- }, /*#__PURE__*/React.createElement(Audio, Object.assign({}, finalAudio, {
225
- mediaRef: mediaRef,
226
- waveFake: isIOS || isPreview,
227
- waveProps: isPreview ? {
228
- sampleWidth: 10,
229
- sampleMargin: 5,
230
- minSampleHeight: 5,
231
- backgroundColor: color,
232
- progressColor: progressColor
233
- } : {
234
- backgroundColor: color,
235
- progressColor: progressColor
236
- },
237
- paused: paused,
238
- muted: muted,
239
- className: styles.audio,
240
- onReady: onAudioReady,
241
- onPlay: onPlay,
242
- onPause: onPause,
243
- onTimeUpdate: onTimeUpdate,
244
- onProgressStep: onProgressStep,
245
- onDurationChange: onDurationChange,
246
- onSeeked: onSeeked,
247
- onEnded: onEnded,
248
- onPlayError: onPlayError,
249
- withWave: showWave && withWave
250
- }))), /*#__PURE__*/React.createElement(Spacer, {
251
- key: "spacer-middle"
252
- }), !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
253
- key: "bottom",
254
- className: styles.bottom,
255
- style: {
256
- transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
257
- paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
258
- paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
259
- paddingBottom: spacing / 2,
260
- paddingTop: 0
261
- }
262
- }, hasClosedCaptions && !isPreview && !isCapture && !isStatic ? /*#__PURE__*/React.createElement(ClosedCaptions, Object.assign({
263
- className: styles.closedCaptions,
264
- media: closedCaptions
265
- }, captions, {
266
- currentTime: currentTime
267
- })) : null, hasFooter ? /*#__PURE__*/React.createElement(Footer, Object.assign({}, footerProps, {
268
- className: styles.callToAction
269
- })) : null) : null)), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
270
- background: background,
271
- width: width,
272
- height: height,
273
- resolution: resolution,
274
- playing: backgroundPlaying,
275
- muted: muted,
276
- shouldLoad: mediaShouldLoad,
277
- withoutVideo: isPreview,
278
- className: styles.background
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.49",
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.49",
65
- "@micromag/element-audio": "^0.4.49",
66
- "@micromag/element-background": "^0.4.49",
67
- "@micromag/element-closed-captions": "^0.4.49",
68
- "@micromag/element-container": "^0.4.49",
69
- "@micromag/element-footer": "^0.4.49",
70
- "@micromag/element-header": "^0.4.49",
71
- "@micromag/element-layout": "^0.4.49",
72
- "@micromag/transforms": "^0.4.49",
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": "0a225ff29387217cccb0fcc5a731e23c74bd202e",
82
+ "gitHead": "985a2370829c9ac8901ea97bf20bfc98ab158439",
83
83
  "types": "es/index.d.ts"
84
84
  }