@atlaskit/media-ui 28.2.2 → 28.2.3

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 (57) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/MediaInlineCard/Frame/styled-compiled.js +1 -2
  3. package/dist/cjs/MediaInlineCard/Icon-compiled.js +1 -2
  4. package/dist/cjs/MediaInlineCard/IconAndTitleLayout/styled-compiled.js +1 -2
  5. package/dist/cjs/MediaInlineCard/LoadingView/styled-compiled.js +1 -2
  6. package/dist/cjs/MediaInlineCard/styled-compiled.js +1 -2
  7. package/dist/cjs/abuseModal/abuseModal.js +1 -2
  8. package/dist/cjs/customMediaPlayer/index-compiled.js +27 -23
  9. package/dist/cjs/customMediaPlayer/index-emotion.js +28 -24
  10. package/dist/cjs/customMediaPlayer/index.js +1 -1
  11. package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/uploadForm.js +1 -2
  12. package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/captionsUploaderBrowser.js +1 -2
  13. package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/filePickers/browser.js +1 -2
  14. package/dist/cjs/customMediaPlayer/mediaPlayer/captionsAdminControls.js +1 -2
  15. package/dist/cjs/customMediaPlayer/mediaPlayer/captionsSelectControls.js +1 -2
  16. package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
  17. package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +27 -28
  18. package/dist/cjs/customMediaPlayer/playbackSpeedControls.js +1 -2
  19. package/dist/cjs/customMediaPlayer/react-video-renderer/track.js +1 -2
  20. package/dist/cjs/customMediaPlayer/react-video-renderer/video.js +1 -2
  21. package/dist/cjs/customMediaPlayer/styled-compiled.js +30 -31
  22. package/dist/cjs/customMediaPlayer/styled.js +1 -2
  23. package/dist/cjs/customMediaPlayer/timeRange.js +1 -2
  24. package/dist/cjs/customMediaPlayer/volumeRange.js +5 -4
  25. package/dist/cjs/ellipsify-compiled.js +1 -2
  26. package/dist/cjs/ellipsify-emotion.js +1 -2
  27. package/dist/cjs/humanReadableSize.js +1 -2
  28. package/dist/cjs/imageMetaData/parseJPEG.js +1 -2
  29. package/dist/cjs/imageMetaData/parsePNG.js +1 -2
  30. package/dist/cjs/inactivityDetector/inactivityDetector.js +1 -2
  31. package/dist/cjs/inactivityDetector/styled-compiled.js +1 -2
  32. package/dist/cjs/inactivityDetector/styled.js +1 -2
  33. package/dist/cjs/index.js +1 -2
  34. package/dist/cjs/locales.js +1 -2
  35. package/dist/cjs/media-type-icon-compiled.js +16 -16
  36. package/dist/cjs/media-type-icon-emotion.js +6 -6
  37. package/dist/cjs/mediaImage/index.js +8 -4
  38. package/dist/cjs/mime-type-icon.js +1 -2
  39. package/dist/cjs/modalSpinner-compiled.js +1 -2
  40. package/dist/cjs/modalSpinner.js +1 -2
  41. package/dist/cjs/truncateText-compiled.js +1 -2
  42. package/dist/cjs/util.js +12 -12
  43. package/dist/es2019/customMediaPlayer/index-compiled.js +7 -2
  44. package/dist/es2019/customMediaPlayer/index-emotion.js +8 -3
  45. package/dist/es2019/customMediaPlayer/index.js +1 -1
  46. package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
  47. package/dist/es2019/customMediaPlayer/volumeRange.js +4 -2
  48. package/dist/es2019/mediaImage/index.js +7 -2
  49. package/dist/esm/customMediaPlayer/index-compiled.js +26 -21
  50. package/dist/esm/customMediaPlayer/index-emotion.js +27 -22
  51. package/dist/esm/customMediaPlayer/index.js +1 -1
  52. package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
  53. package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +26 -26
  54. package/dist/esm/customMediaPlayer/styled-compiled.js +29 -29
  55. package/dist/esm/customMediaPlayer/volumeRange.js +4 -2
  56. package/dist/esm/mediaImage/index.js +7 -2
  57. package/package.json +4 -1
@@ -157,7 +157,8 @@ export class CustomMediaPlayerBase extends Component {
157
157
  currentTime,
158
158
  duration
159
159
  }) => /*#__PURE__*/React.createElement(CurrentTime, {
160
- draggable: false
160
+ draggable: false,
161
+ "data-testid": "current-time"
161
162
  }, formatDuration(currentTime), " / ", formatDuration(duration)));
162
163
  _defineProperty(this, "renderHDButton", () => {
163
164
  const {
@@ -217,7 +218,9 @@ export class CustomMediaPlayerBase extends Component {
217
218
  label: this.props.intl.formatMessage(messages.volumeMuteButtonAria)
218
219
  }),
219
220
  "aria-pressed": videoState.isMuted
220
- })), showSlider && /*#__PURE__*/React.createElement(VolumeTimeRangeWrapper, null, /*#__PURE__*/React.createElement(VolumeRange, {
221
+ })), showSlider && /*#__PURE__*/React.createElement(VolumeTimeRangeWrapper, {
222
+ "data-testid": "volume-time-range-wrapper"
223
+ }, /*#__PURE__*/React.createElement(VolumeRange, {
221
224
  onChange: actions.setVolume,
222
225
  currentVolume: videoState.volume,
223
226
  isAlwaysActive: true,
@@ -386,6 +389,7 @@ export class CustomMediaPlayerBase extends Component {
386
389
  }));
387
390
  });
388
391
  _defineProperty(this, "renderSpinner", () => /*#__PURE__*/React.createElement(Flex, {
392
+ testId: "spinner",
389
393
  direction: "column",
390
394
  alignItems: "center",
391
395
  justifyContent: "center",
@@ -618,7 +622,8 @@ export class CustomMediaPlayerBase extends Component {
618
622
  defaultTime: this.getDefaultTime,
619
623
  onTimeChange: this.onCurrentTimeChange,
620
624
  onError: onError,
621
- poster: poster
625
+ poster: poster,
626
+ "data-testid": "media-player"
622
627
  }, (video, videoState, actions) => {
623
628
  this.onViewed(videoState);
624
629
  this.setActions(actions);
@@ -7,7 +7,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import { withMediaAnalyticsContext } from '@atlaskit/media-common';
8
8
  export const CustomMediaPlayerBase = props => fg('platform_media_compiled') ? /*#__PURE__*/React.createElement(CompiledCustomMediaPlayerBase, props) : /*#__PURE__*/React.createElement(EmotionCustomMediaPlayerBase, props);
9
9
  const packageName = "@atlaskit/media-ui";
10
- const packageVersion = "28.2.2";
10
+ const packageVersion = "28.2.3";
11
11
 
12
12
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
13
13
  export const CustomMediaPlayer = withMediaAnalyticsContext({
@@ -5,7 +5,7 @@ import { useFileState, useMediaClient, useMediaSettings } from '@atlaskit/media-
5
5
  import { MediaPlayerBase } from './mediaPlayerBase';
6
6
  import { useTextTracks } from './useTextTracks';
7
7
  const packageName = "@atlaskit/media-ui";
8
- const packageVersion = "28.2.2";
8
+ const packageVersion = "28.2.3";
9
9
  const MediaPlayerBaseWithContext = withMediaAnalyticsContext({
10
10
  packageVersion,
11
11
  packageName,
@@ -129,7 +129,8 @@ const VolumeRange = props => {
129
129
  return fg('platform_media_compiled') ? /*#__PURE__*/React.createElement(CompiledTimeRangeWrapper, {
130
130
  onMouseDown: onThumbMouseDown,
131
131
  onKeyDown: onThumbKeyDown,
132
- ref: wrapperElement
132
+ ref: wrapperElement,
133
+ "data-testid": "volume-range"
133
134
  }, /*#__PURE__*/React.createElement(Range, {
134
135
  tabIndex: 0,
135
136
  step: 1,
@@ -149,7 +150,8 @@ const VolumeRange = props => {
149
150
  showAsActive: isAlwaysActive,
150
151
  onMouseDown: onThumbMouseDown,
151
152
  onKeyDown: onThumbKeyDown,
152
- ref: wrapperElement
153
+ ref: wrapperElement,
154
+ "data-testid": "volume-range"
153
155
  }, /*#__PURE__*/React.createElement(Range, {
154
156
  tabIndex: 0,
155
157
  step: 1,
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef, useCallback, useRef, useState } from 'react';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
4
  import { VcMediaWrapperProps } from '@atlaskit/react-ufo/vc-media';
5
+ import UFOCustomData from '@atlaskit/react-ufo/custom-data';
5
6
  import { ImageComponent } from './styled';
6
7
  import { getCssFromImageOrientation, isRotated } from '../imageMetaData';
7
8
  import { useMergeRefs } from 'use-callback-ref';
@@ -344,7 +345,11 @@ export const MediaImage = /*#__PURE__*/forwardRef(({
344
345
  const transform = getCssFromImageOrientation(previewOrientation);
345
346
  style.transform += ` ${transform}`;
346
347
  }
347
- return /*#__PURE__*/React.createElement(ImageComponent, _extends({
348
+ return /*#__PURE__*/React.createElement(React.Fragment, null, fg('platform_media_add_ufo_custom_data') ? /*#__PURE__*/React.createElement(UFOCustomData, {
349
+ data: {
350
+ hasMediaComponent: true
351
+ }
352
+ }) : null, /*#__PURE__*/React.createElement(ImageComponent, _extends({
348
353
  loading: loading,
349
354
  "data-testid": "media-image",
350
355
  "data-vc": "media-image",
@@ -358,5 +363,5 @@ export const MediaImage = /*#__PURE__*/forwardRef(({
358
363
  imageRef: mergedRef,
359
364
  src: dataURI,
360
365
  crossOrigin: crossOrigin
361
- }, fg('platform_exclude_media_offender_from_vc') && VcMediaWrapperProps));
366
+ }, fg('platform_exclude_media_offender_from_vc') && VcMediaWrapperProps)));
362
367
  });
@@ -156,7 +156,8 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
156
156
  var currentTime = _ref.currentTime,
157
157
  duration = _ref.duration;
158
158
  return /*#__PURE__*/React.createElement(CurrentTime, {
159
- draggable: false
159
+ draggable: false,
160
+ "data-testid": "current-time"
160
161
  }, formatDuration(currentTime), " / ", formatDuration(duration));
161
162
  });
162
163
  _defineProperty(_this, "renderHDButton", function () {
@@ -215,7 +216,9 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
215
216
  label: _this.props.intl.formatMessage(messages.volumeMuteButtonAria)
216
217
  }),
217
218
  "aria-pressed": videoState.isMuted
218
- })), showSlider && /*#__PURE__*/React.createElement(VolumeTimeRangeWrapper, null, /*#__PURE__*/React.createElement(VolumeRange, {
219
+ })), showSlider && /*#__PURE__*/React.createElement(VolumeTimeRangeWrapper, {
220
+ "data-testid": "volume-time-range-wrapper"
221
+ }, /*#__PURE__*/React.createElement(VolumeRange, {
219
222
  onChange: actions.setVolume,
220
223
  currentVolume: videoState.volume,
221
224
  isAlwaysActive: true,
@@ -364,6 +367,7 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
364
367
  });
365
368
  _defineProperty(_this, "renderSpinner", function () {
366
369
  return /*#__PURE__*/React.createElement(Flex, {
370
+ testId: "spinner",
367
371
  direction: "column",
368
372
  alignItems: "center",
369
373
  justifyContent: "center",
@@ -493,14 +497,14 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
493
497
  }
494
498
  simultaneousPlayManager.subscribe(this);
495
499
  if (isAutoPlay) {
496
- var _this$props10, _this$props10$onPlay;
500
+ var _this$props0, _this$props0$onPlay;
497
501
  simultaneousPlayManager.pauseOthers(this);
498
502
  if (onFirstPlay) {
499
503
  this.fireFirstPlayedTrackEvent();
500
504
  this.wasPlayedOnce = true;
501
505
  onFirstPlay();
502
506
  }
503
- (_this$props10 = this.props) === null || _this$props10 === void 0 || (_this$props10$onPlay = _this$props10.onPlay) === null || _this$props10$onPlay === void 0 || _this$props10$onPlay.call(_this$props10);
507
+ (_this$props0 = this.props) === null || _this$props0 === void 0 || (_this$props0$onPlay = _this$props0.onPlay) === null || _this$props0$onPlay === void 0 || _this$props0$onPlay.call(_this$props0);
504
508
  }
505
509
  }
506
510
  }, {
@@ -510,8 +514,8 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
510
514
  this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
511
515
  }
512
516
  if (this.state.isFullScreenEnabled) {
513
- var _this$props$onFullscr2, _this$props11;
514
- (_this$props$onFullscr2 = (_this$props11 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props11, false);
517
+ var _this$props$onFullscr2, _this$props1;
518
+ (_this$props$onFullscr2 = (_this$props1 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props1, false);
515
519
  }
516
520
  simultaneousPlayManager.unsubscribe(this);
517
521
  }
@@ -527,13 +531,13 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
527
531
  }, {
528
532
  key: "createAndFireUIEvent",
529
533
  value: function createAndFireUIEvent(eventType, actionSubjectId) {
530
- var _this$props12 = this.props,
531
- type = _this$props12.type,
532
- fileId = _this$props12.fileId,
533
- isHDActive = _this$props12.isHDActive,
534
- isHDAvailable = _this$props12.isHDAvailable,
535
- isAutoPlay = _this$props12.isAutoPlay,
536
- createAnalyticsEvent = _this$props12.createAnalyticsEvent;
534
+ var _this$props10 = this.props,
535
+ type = _this$props10.type,
536
+ fileId = _this$props10.fileId,
537
+ isHDActive = _this$props10.isHDActive,
538
+ isHDAvailable = _this$props10.isHDAvailable,
539
+ isAutoPlay = _this$props10.isAutoPlay,
540
+ createAnalyticsEvent = _this$props10.createAnalyticsEvent;
537
541
  var _this$state4 = this.state,
538
542
  isFullScreenEnabled = _this$state4.isFullScreenEnabled,
539
543
  playerSize = _this$state4.playerSize,
@@ -580,19 +584,20 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
580
584
  key: "render",
581
585
  value: function render() {
582
586
  var _this2 = this;
583
- var _this$props13 = this.props,
584
- type = _this$props13.type,
585
- src = _this$props13.src,
586
- isAutoPlay = _this$props13.isAutoPlay,
587
- onCanPlay = _this$props13.onCanPlay,
588
- onError = _this$props13.onError,
589
- poster = _this$props13.poster,
590
- videoControlsWrapperRef = _this$props13.videoControlsWrapperRef;
587
+ var _this$props11 = this.props,
588
+ type = _this$props11.type,
589
+ src = _this$props11.src,
590
+ isAutoPlay = _this$props11.isAutoPlay,
591
+ onCanPlay = _this$props11.onCanPlay,
592
+ onError = _this$props11.onError,
593
+ poster = _this$props11.poster,
594
+ videoControlsWrapperRef = _this$props11.videoControlsWrapperRef;
591
595
  return /*#__PURE__*/React.createElement(Box, {
592
596
  xcss: customVideoWrapperStyles.root,
593
597
  ref: this.videoWrapperRef,
594
598
  testId: "custom-media-player"
595
599
  }, /*#__PURE__*/React.createElement(MediaPlayer, {
600
+ "data-testid": "media-player",
596
601
  sourceType: type,
597
602
  src: src,
598
603
  autoPlay: isAutoPlay,
@@ -167,7 +167,8 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
167
167
  var currentTime = _ref.currentTime,
168
168
  duration = _ref.duration;
169
169
  return /*#__PURE__*/React.createElement(CurrentTime, {
170
- draggable: false
170
+ draggable: false,
171
+ "data-testid": "current-time"
171
172
  }, formatDuration(currentTime), " / ", formatDuration(duration));
172
173
  });
173
174
  _defineProperty(_this, "renderHDButton", function () {
@@ -226,7 +227,9 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
226
227
  label: _this.props.intl.formatMessage(messages.volumeMuteButtonAria)
227
228
  }),
228
229
  "aria-pressed": videoState.isMuted
229
- })), showSlider && /*#__PURE__*/React.createElement(VolumeTimeRangeWrapper, null, /*#__PURE__*/React.createElement(VolumeRange, {
230
+ })), showSlider && /*#__PURE__*/React.createElement(VolumeTimeRangeWrapper, {
231
+ "data-testid": "volume-time-range-wrapper"
232
+ }, /*#__PURE__*/React.createElement(VolumeRange, {
230
233
  onChange: actions.setVolume,
231
234
  currentVolume: videoState.volume,
232
235
  isAlwaysActive: true,
@@ -375,6 +378,7 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
375
378
  });
376
379
  _defineProperty(_this, "renderSpinner", function () {
377
380
  return /*#__PURE__*/React.createElement(Flex, {
381
+ testId: "spinner",
378
382
  direction: "column",
379
383
  alignItems: "center",
380
384
  justifyContent: "center",
@@ -504,14 +508,14 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
504
508
  }
505
509
  simultaneousPlayManager.subscribe(this);
506
510
  if (isAutoPlay) {
507
- var _this$props10, _this$props10$onPlay;
511
+ var _this$props0, _this$props0$onPlay;
508
512
  simultaneousPlayManager.pauseOthers(this);
509
513
  if (onFirstPlay) {
510
514
  this.fireFirstPlayedTrackEvent();
511
515
  this.wasPlayedOnce = true;
512
516
  onFirstPlay();
513
517
  }
514
- (_this$props10 = this.props) === null || _this$props10 === void 0 || (_this$props10$onPlay = _this$props10.onPlay) === null || _this$props10$onPlay === void 0 || _this$props10$onPlay.call(_this$props10);
518
+ (_this$props0 = this.props) === null || _this$props0 === void 0 || (_this$props0$onPlay = _this$props0.onPlay) === null || _this$props0$onPlay === void 0 || _this$props0$onPlay.call(_this$props0);
515
519
  }
516
520
  }
517
521
  }, {
@@ -521,8 +525,8 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
521
525
  this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
522
526
  }
523
527
  if (this.state.isFullScreenEnabled) {
524
- var _this$props$onFullscr2, _this$props11;
525
- (_this$props$onFullscr2 = (_this$props11 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props11, false);
528
+ var _this$props$onFullscr2, _this$props1;
529
+ (_this$props$onFullscr2 = (_this$props1 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props1, false);
526
530
  }
527
531
  simultaneousPlayManager.unsubscribe(this);
528
532
  }
@@ -538,13 +542,13 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
538
542
  }, {
539
543
  key: "createAndFireUIEvent",
540
544
  value: function createAndFireUIEvent(eventType, actionSubjectId) {
541
- var _this$props12 = this.props,
542
- type = _this$props12.type,
543
- fileId = _this$props12.fileId,
544
- isHDActive = _this$props12.isHDActive,
545
- isHDAvailable = _this$props12.isHDAvailable,
546
- isAutoPlay = _this$props12.isAutoPlay,
547
- createAnalyticsEvent = _this$props12.createAnalyticsEvent;
545
+ var _this$props10 = this.props,
546
+ type = _this$props10.type,
547
+ fileId = _this$props10.fileId,
548
+ isHDActive = _this$props10.isHDActive,
549
+ isHDAvailable = _this$props10.isHDAvailable,
550
+ isAutoPlay = _this$props10.isAutoPlay,
551
+ createAnalyticsEvent = _this$props10.createAnalyticsEvent;
548
552
  var _this$state4 = this.state,
549
553
  isFullScreenEnabled = _this$state4.isFullScreenEnabled,
550
554
  playerSize = _this$state4.playerSize,
@@ -591,14 +595,14 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
591
595
  key: "render",
592
596
  value: function render() {
593
597
  var _this2 = this;
594
- var _this$props13 = this.props,
595
- type = _this$props13.type,
596
- src = _this$props13.src,
597
- isAutoPlay = _this$props13.isAutoPlay,
598
- onCanPlay = _this$props13.onCanPlay,
599
- onError = _this$props13.onError,
600
- poster = _this$props13.poster,
601
- videoControlsWrapperRef = _this$props13.videoControlsWrapperRef;
598
+ var _this$props11 = this.props,
599
+ type = _this$props11.type,
600
+ src = _this$props11.src,
601
+ isAutoPlay = _this$props11.isAutoPlay,
602
+ onCanPlay = _this$props11.onCanPlay,
603
+ onError = _this$props11.onError,
604
+ poster = _this$props11.poster,
605
+ videoControlsWrapperRef = _this$props11.videoControlsWrapperRef;
602
606
  return /*#__PURE__*/React.createElement(Box, {
603
607
  xcss: customVideoWrapperStyles,
604
608
  ref: this.videoWrapperRef,
@@ -611,7 +615,8 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
611
615
  defaultTime: this.getDefaultTime,
612
616
  onTimeChange: this.onCurrentTimeChange,
613
617
  onError: onError,
614
- poster: poster
618
+ poster: poster,
619
+ "data-testid": "media-player"
615
620
  }, function (video, videoState, actions) {
616
621
  _this2.onViewed(videoState);
617
622
  _this2.setActions(actions);
@@ -9,7 +9,7 @@ export var CustomMediaPlayerBase = function CustomMediaPlayerBase(props) {
9
9
  return fg('platform_media_compiled') ? /*#__PURE__*/React.createElement(CompiledCustomMediaPlayerBase, props) : /*#__PURE__*/React.createElement(EmotionCustomMediaPlayerBase, props);
10
10
  };
11
11
  var packageName = "@atlaskit/media-ui";
12
- var packageVersion = "28.2.2";
12
+ var packageVersion = "28.2.3";
13
13
 
14
14
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
15
15
  export var CustomMediaPlayer = withMediaAnalyticsContext({
@@ -5,7 +5,7 @@ import { useFileState, useMediaClient, useMediaSettings } from '@atlaskit/media-
5
5
  import { MediaPlayerBase } from './mediaPlayerBase';
6
6
  import { useTextTracks } from './useTextTracks';
7
7
  var packageName = "@atlaskit/media-ui";
8
- var packageVersion = "28.2.2";
8
+ var packageVersion = "28.2.3";
9
9
  var MediaPlayerBaseWithContext = withMediaAnalyticsContext({
10
10
  packageVersion: packageVersion,
11
11
  packageName: packageName,
@@ -580,14 +580,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
580
580
  }
581
581
  simultaneousPlayManager.subscribe(this);
582
582
  if (isAutoPlay) {
583
- var _this$props$onPlay, _this$props10;
583
+ var _this$props$onPlay, _this$props0;
584
584
  simultaneousPlayManager.pauseOthers(this);
585
585
  if (onFirstPlay) {
586
586
  this.fireFirstPlayedTrackEvent();
587
587
  this.wasPlayedOnce = true;
588
588
  onFirstPlay();
589
589
  }
590
- (_this$props$onPlay = (_this$props10 = this.props).onPlay) === null || _this$props$onPlay === void 0 || _this$props$onPlay.call(_this$props10);
590
+ (_this$props$onPlay = (_this$props0 = this.props).onPlay) === null || _this$props$onPlay === void 0 || _this$props$onPlay.call(_this$props0);
591
591
  }
592
592
  }
593
593
  }, {
@@ -597,8 +597,8 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
597
597
  this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
598
598
  }
599
599
  if (this.state.isFullScreenEnabled) {
600
- var _this$props$onFullscr2, _this$props11;
601
- (_this$props$onFullscr2 = (_this$props11 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props11, false);
600
+ var _this$props$onFullscr2, _this$props1;
601
+ (_this$props$onFullscr2 = (_this$props1 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props1, false);
602
602
  }
603
603
  simultaneousPlayManager.unsubscribe(this);
604
604
  }
@@ -614,13 +614,13 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
614
614
  }, {
615
615
  key: "createAndFireUIEvent",
616
616
  value: function createAndFireUIEvent(eventType, actionSubjectId) {
617
- var _this$props12 = this.props,
618
- type = _this$props12.type,
619
- identifier = _this$props12.identifier,
620
- isHDActive = _this$props12.isHDActive,
621
- isHDAvailable = _this$props12.isHDAvailable,
622
- isAutoPlay = _this$props12.isAutoPlay,
623
- createAnalyticsEvent = _this$props12.createAnalyticsEvent;
617
+ var _this$props10 = this.props,
618
+ type = _this$props10.type,
619
+ identifier = _this$props10.identifier,
620
+ isHDActive = _this$props10.isHDActive,
621
+ isHDAvailable = _this$props10.isHDAvailable,
622
+ isAutoPlay = _this$props10.isAutoPlay,
623
+ createAnalyticsEvent = _this$props10.createAnalyticsEvent;
624
624
  var _this$state5 = this.state,
625
625
  isFullScreenEnabled = _this$state5.isFullScreenEnabled,
626
626
  playerSize = _this$state5.playerSize,
@@ -667,21 +667,21 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
667
667
  key: "render",
668
668
  value: function render() {
669
669
  var _this2 = this;
670
- var _this$props13 = this.props,
671
- type = _this$props13.type,
672
- src = _this$props13.src,
673
- isAutoPlay = _this$props13.isAutoPlay,
674
- onCanPlay = _this$props13.onCanPlay,
675
- onError = _this$props13.onError,
676
- poster = _this$props13.poster,
677
- videoControlsWrapperRef = _this$props13.videoControlsWrapperRef,
678
- textTracks = _this$props13.textTracks,
679
- areControlsVisible = _this$props13.areControlsVisible,
680
- identifier = _this$props13.identifier,
681
- _this$props13$mediaSe = _this$props13.mediaSettings,
682
- _this$props13$mediaSe2 = _this$props13$mediaSe === void 0 ? {} : _this$props13$mediaSe,
683
- _this$props13$mediaSe3 = _this$props13$mediaSe2.canUpdateVideoCaptions,
684
- canUpdateVideoCaptions = _this$props13$mediaSe3 === void 0 ? false : _this$props13$mediaSe3;
670
+ var _this$props11 = this.props,
671
+ type = _this$props11.type,
672
+ src = _this$props11.src,
673
+ isAutoPlay = _this$props11.isAutoPlay,
674
+ onCanPlay = _this$props11.onCanPlay,
675
+ onError = _this$props11.onError,
676
+ poster = _this$props11.poster,
677
+ videoControlsWrapperRef = _this$props11.videoControlsWrapperRef,
678
+ textTracks = _this$props11.textTracks,
679
+ areControlsVisible = _this$props11.areControlsVisible,
680
+ identifier = _this$props11.identifier,
681
+ _this$props11$mediaSe = _this$props11.mediaSettings,
682
+ _this$props11$mediaSe2 = _this$props11$mediaSe === void 0 ? {} : _this$props11$mediaSe,
683
+ _this$props11$mediaSe3 = _this$props11$mediaSe2.canUpdateVideoCaptions,
684
+ canUpdateVideoCaptions = _this$props11$mediaSe3 === void 0 ? false : _this$props11$mediaSe3;
685
685
  var _this$state6 = this.state,
686
686
  areCaptionsEnabled = _this$state6.areCaptionsEnabled,
687
687
  isArtifactUploaderOpen = _this$state6.isArtifactUploaderOpen;
@@ -10,12 +10,12 @@ var _excluded = ["showSlider", "children"],
10
10
  _excluded7 = ["children"],
11
11
  _excluded8 = ["children"],
12
12
  _excluded9 = ["children"],
13
- _excluded10 = ["children", "controlsHidden"],
13
+ _excluded0 = ["children", "controlsHidden"],
14
+ _excluded1 = ["isMuted", "children"],
15
+ _excluded10 = ["children"],
14
16
  _excluded11 = ["isMuted", "children"],
15
- _excluded12 = ["children"],
16
- _excluded13 = ["isMuted", "children"],
17
- _excluded14 = ["isDragging", "timeLineThumbIsHover", "timeLineThumbIsFocus", "children"],
18
- _excluded15 = ["children"];
17
+ _excluded12 = ["isDragging", "timeLineThumbIsHover", "timeLineThumbIsFocus", "children"],
18
+ _excluded13 = ["children"];
19
19
  import "./styled-compiled.compiled.css";
20
20
  import { ax, ix } from "@compiled/react/runtime";
21
21
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
@@ -106,10 +106,10 @@ export var RightControls = function RightControls(_ref9) {
106
106
  };
107
107
  var controlsWrapperStyles = null;
108
108
  var hiddenControlsWrapperStyles = null;
109
- export var ControlsWrapper = /*#__PURE__*/forwardRef(function (_ref10, ref) {
110
- var children = _ref10.children,
111
- controlsHidden = _ref10.controlsHidden,
112
- props = _objectWithoutProperties(_ref10, _excluded10);
109
+ export var ControlsWrapper = /*#__PURE__*/forwardRef(function (_ref0, ref) {
110
+ var children = _ref0.children,
111
+ controlsHidden = _ref0.controlsHidden,
112
+ props = _objectWithoutProperties(_ref0, _excluded0);
113
113
  return /*#__PURE__*/React.createElement("div", _extends({
114
114
  ref: ref
115
115
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -119,28 +119,28 @@ export var ControlsWrapper = /*#__PURE__*/forwardRef(function (_ref10, ref) {
119
119
  });
120
120
  var volumeToggleWrapperStyles = null;
121
121
  var mutedVolumeToggleWrapperStyles = null;
122
- export var VolumeToggleWrapper = function VolumeToggleWrapper(_ref11) {
123
- var isMuted = _ref11.isMuted,
124
- children = _ref11.children,
125
- props = _objectWithoutProperties(_ref11, _excluded11);
122
+ export var VolumeToggleWrapper = function VolumeToggleWrapper(_ref1) {
123
+ var isMuted = _ref1.isMuted,
124
+ children = _ref1.children,
125
+ props = _objectWithoutProperties(_ref1, _excluded1);
126
126
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
127
127
  className: ax(["_kqswh2mm _2hwxw1gv _14hp1j2z", isMuted && "_d32vqb75"])
128
128
  }), children);
129
129
  };
130
130
  var volumeTimeRangeWrapperStyles = null;
131
- export var VolumeTimeRangeWrapper = function VolumeTimeRangeWrapper(_ref12) {
132
- var children = _ref12.children,
133
- props = _objectWithoutProperties(_ref12, _excluded12);
131
+ export var VolumeTimeRangeWrapper = function VolumeTimeRangeWrapper(_ref10) {
132
+ var children = _ref10.children,
133
+ props = _objectWithoutProperties(_ref10, _excluded10);
134
134
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
135
135
  className: ax(["_1bsb1osq _2hwxv47k"])
136
136
  }), children);
137
137
  };
138
138
  var mutedIndicatorStyles = null;
139
139
  var isMutedStyles = null;
140
- export var MutedIndicator = function MutedIndicator(_ref13) {
141
- var isMuted = _ref13.isMuted,
142
- children = _ref13.children,
143
- props = _objectWithoutProperties(_ref13, _excluded13);
140
+ export var MutedIndicator = function MutedIndicator(_ref11) {
141
+ var isMuted = _ref11.isMuted,
142
+ children = _ref11.children,
143
+ props = _objectWithoutProperties(_ref11, _excluded11);
144
144
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
145
145
  className: ax(["_bfhk18rw _1bsb1pa9 _4t3iyh40 _kqswstnw _154iu2gc _1ltvu2gc _1pbycs5v _t9ec17wz _tzy4idpf _lcxvglyw", isMuted && "_tzy4kb7n"])
146
146
  }), children);
@@ -150,21 +150,21 @@ var currentTimeToolTipDraggingStyles = null;
150
150
  var currentTimeToolTipNotDraggingStyles = null;
151
151
  var currentTimeTooltipThumbHoveredStyles = null;
152
152
  var currentTimeTooltipThumbFocusedStyles = null;
153
- export var CurrentTimeTooltip = function CurrentTimeTooltip(_ref14) {
154
- var isDragging = _ref14.isDragging,
155
- timeLineThumbIsHover = _ref14.timeLineThumbIsHover,
156
- timeLineThumbIsFocus = _ref14.timeLineThumbIsFocus,
157
- children = _ref14.children,
158
- props = _objectWithoutProperties(_ref14, _excluded14);
153
+ export var CurrentTimeTooltip = function CurrentTimeTooltip(_ref12) {
154
+ var isDragging = _ref12.isDragging,
155
+ timeLineThumbIsHover = _ref12.timeLineThumbIsHover,
156
+ timeLineThumbIsFocus = _ref12.timeLineThumbIsFocus,
157
+ children = _ref12.children,
158
+ props = _objectWithoutProperties(_ref12, _excluded12);
159
159
  return /*#__PURE__*/React.createElement("div", _extends({
160
160
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
161
161
  className: ax(["_11c8dcr7 _2rko1b66 _v564g17y _kqswstnw _uiztglyw _154iukr8 _bfhk39qu _syaz1pcz _ca0q1b66 _u5f3u2gc _n3td1b66 _19bvu2gc _1ltv1ssb _t9eczr6s _1nmz16rz", isDragging && "_tzy4kb7n", !isDragging && "_tzy4idpf", timeLineThumbIsHover && "_tzy4kb7n", timeLineThumbIsFocus && "_tzy4kb7n", "current-time-tooltip"])
162
162
  }, props), children);
163
163
  };
164
164
  var timeRangeWrapperStyles = null;
165
- export var TimeRangeWrapper = /*#__PURE__*/forwardRef(function (_ref15, ref) {
166
- var children = _ref15.children,
167
- props = _objectWithoutProperties(_ref15, _excluded15);
165
+ export var TimeRangeWrapper = /*#__PURE__*/forwardRef(function (_ref13, ref) {
166
+ var children = _ref13.children,
167
+ props = _objectWithoutProperties(_ref13, _excluded13);
168
168
  return /*#__PURE__*/React.createElement("div", _extends({
169
169
  ref: ref
170
170
  }, props, {
@@ -128,7 +128,8 @@ var VolumeRange = function VolumeRange(props) {
128
128
  return fg('platform_media_compiled') ? /*#__PURE__*/React.createElement(CompiledTimeRangeWrapper, {
129
129
  onMouseDown: onThumbMouseDown,
130
130
  onKeyDown: onThumbKeyDown,
131
- ref: wrapperElement
131
+ ref: wrapperElement,
132
+ "data-testid": "volume-range"
132
133
  }, /*#__PURE__*/React.createElement(Range, {
133
134
  tabIndex: 0,
134
135
  step: 1,
@@ -148,7 +149,8 @@ var VolumeRange = function VolumeRange(props) {
148
149
  showAsActive: isAlwaysActive,
149
150
  onMouseDown: onThumbMouseDown,
150
151
  onKeyDown: onThumbKeyDown,
151
- ref: wrapperElement
152
+ ref: wrapperElement,
153
+ "data-testid": "volume-range"
152
154
  }, /*#__PURE__*/React.createElement(Range, {
153
155
  tabIndex: 0,
154
156
  step: 1,
@@ -3,6 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import React, { forwardRef, useCallback, useRef, useState } from 'react';
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
5
  import { VcMediaWrapperProps } from '@atlaskit/react-ufo/vc-media';
6
+ import UFOCustomData from '@atlaskit/react-ufo/custom-data';
6
7
  import { ImageComponent } from './styled';
7
8
  import { getCssFromImageOrientation, isRotated } from '../imageMetaData';
8
9
  import { useMergeRefs } from 'use-callback-ref';
@@ -355,7 +356,11 @@ export var MediaImage = /*#__PURE__*/forwardRef(function (_ref, ref) {
355
356
  var transform = getCssFromImageOrientation(previewOrientation);
356
357
  style.transform += " ".concat(transform);
357
358
  }
358
- return /*#__PURE__*/React.createElement(ImageComponent, _extends({
359
+ return /*#__PURE__*/React.createElement(React.Fragment, null, fg('platform_media_add_ufo_custom_data') ? /*#__PURE__*/React.createElement(UFOCustomData, {
360
+ data: {
361
+ hasMediaComponent: true
362
+ }
363
+ }) : null, /*#__PURE__*/React.createElement(ImageComponent, _extends({
359
364
  loading: loading,
360
365
  "data-testid": "media-image",
361
366
  "data-vc": "media-image",
@@ -369,5 +374,5 @@ export var MediaImage = /*#__PURE__*/forwardRef(function (_ref, ref) {
369
374
  imageRef: mergedRef,
370
375
  src: dataURI,
371
376
  crossOrigin: crossOrigin
372
- }, fg('platform_exclude_media_offender_from_vc') && VcMediaWrapperProps));
377
+ }, fg('platform_exclude_media_offender_from_vc') && VcMediaWrapperProps)));
373
378
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-ui",
3
- "version": "28.2.2",
3
+ "version": "28.2.3",
4
4
  "description": "Includes common components and utilities used by other media packages",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -95,6 +95,9 @@
95
95
  "platform_media_compiled": {
96
96
  "type": "boolean"
97
97
  },
98
+ "platform_media_add_ufo_custom_data": {
99
+ "type": "boolean"
100
+ },
98
101
  "platform_exclude_media_offender_from_vc": {
99
102
  "type": "boolean"
100
103
  },