@atlaskit/media-ui 23.1.0 → 23.2.0

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 (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/customMediaPlayer/index.js +77 -62
  3. package/dist/cjs/customMediaPlayer/styled.js +9 -9
  4. package/dist/cjs/i18n/en.js +1 -0
  5. package/dist/cjs/i18n/en_GB.js +1 -0
  6. package/dist/cjs/i18n/en_ZZ.js +1 -0
  7. package/dist/cjs/mediaImage/index.js +10 -0
  8. package/dist/cjs/version.json +1 -1
  9. package/dist/es2019/customMediaPlayer/index.js +26 -9
  10. package/dist/es2019/customMediaPlayer/styled.js +9 -9
  11. package/dist/es2019/i18n/en.js +1 -0
  12. package/dist/es2019/i18n/en_GB.js +1 -0
  13. package/dist/es2019/i18n/en_ZZ.js +1 -0
  14. package/dist/es2019/mediaImage/index.js +10 -0
  15. package/dist/es2019/version.json +1 -1
  16. package/dist/esm/customMediaPlayer/index.js +77 -62
  17. package/dist/esm/customMediaPlayer/styled.js +9 -9
  18. package/dist/esm/i18n/en.js +1 -0
  19. package/dist/esm/i18n/en_GB.js +1 -0
  20. package/dist/esm/i18n/en_ZZ.js +1 -0
  21. package/dist/esm/mediaImage/index.js +10 -0
  22. package/dist/esm/version.json +1 -1
  23. package/dist/types/customMediaPlayer/index.d.ts +1 -0
  24. package/dist/types/i18n/en.d.ts +1 -0
  25. package/dist/types/i18n/en_GB.d.ts +1 -0
  26. package/dist/types/i18n/en_ZZ.d.ts +1 -0
  27. package/dist/types/mediaImage/index.d.ts +1 -0
  28. package/dist/types-ts4.5/customMediaPlayer/index.d.ts +1 -0
  29. package/dist/types-ts4.5/i18n/en.d.ts +1 -0
  30. package/dist/types-ts4.5/i18n/en_GB.d.ts +1 -0
  31. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
  32. package/dist/types-ts4.5/mediaImage/index.d.ts +1 -0
  33. package/example-helpers/styled.ts +4 -4
  34. package/package.json +28 -30
  35. package/report.api.md +2 -0
  36. package/tmp/api-report-tmp.d.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/media-ui
2
2
 
3
+ ## 23.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`f486dbd535c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f486dbd535c) - MEX-2481 Fix minor gap between image and border
8
+
9
+ ## 23.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`183fdc63b26`](https://bitbucket.org/atlassian/atlassian-frontend/commits/183fdc63b26) - MEX-2467 Fix firstPlayed track event firing when autoPlay is false
14
+
3
15
  ## 23.1.0
4
16
 
5
17
  ### Minor Changes
@@ -51,7 +51,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
51
51
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // Keep media player components used in media-viewer to use static colors from the new color palette to
52
52
  // support the hybrid theming in media viewer https://product-fabric.atlassian.net/browse/DSP-6067
53
53
  var packageName = "@atlaskit/media-ui";
54
- var packageVersion = "23.1.0";
54
+ var packageVersion = "23.2.0";
55
55
  var MEDIUM_VIDEO_MAX_WIDTH = 400;
56
56
  var SMALL_VIDEO_MAX_WIDTH = 160;
57
57
  var MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -84,6 +84,27 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
84
84
  playerSize: 'large',
85
85
  playbackSpeed: 1
86
86
  });
87
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "fireFirstPlayedTrackEvent", function () {
88
+ var _this$props = _this.props,
89
+ type = _this$props.type,
90
+ fileId = _this$props.fileId,
91
+ isHDActive = _this$props.isHDActive,
92
+ isHDAvailable = _this$props.isHDAvailable,
93
+ isAutoPlay = _this$props.isAutoPlay,
94
+ createAnalyticsEvent = _this$props.createAnalyticsEvent;
95
+ var _this$state = _this.state,
96
+ isFullScreenEnabled = _this$state.isFullScreenEnabled,
97
+ playerSize = _this$state.playerSize,
98
+ playbackSpeed = _this$state.playbackSpeed;
99
+ (0, _analytics.fireAnalyticsEvent)((0, _analytics.createFirstPlayedTrackEvent)(type, {
100
+ isAutoPlay: isAutoPlay,
101
+ isHDAvailable: isHDAvailable,
102
+ isHDActive: isHDActive,
103
+ isFullScreenEnabled: isFullScreenEnabled,
104
+ playerSize: playerSize,
105
+ playbackSpeed: playbackSpeed
106
+ }, fileId), createAnalyticsEvent);
107
+ });
87
108
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFullScreenChange", function (e) {
88
109
  if (e.target !== _this.videoWrapperRef.current) {
89
110
  return;
@@ -91,8 +112,8 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
91
112
  var currentFullScreenMode = _this.state.isFullScreenEnabled;
92
113
  var isFullScreenEnabled = !!(0, _fullscreen.getFullscreenElement)();
93
114
  if (currentFullScreenMode !== isFullScreenEnabled) {
94
- var _this$props$onFullscr, _this$props;
95
- (_this$props$onFullscr = (_this$props = _this.props).onFullscreenChange) === null || _this$props$onFullscr === void 0 ? void 0 : _this$props$onFullscr.call(_this$props, isFullScreenEnabled);
115
+ var _this$props$onFullscr, _this$props2;
116
+ (_this$props$onFullscr = (_this$props2 = _this.props).onFullscreenChange) === null || _this$props$onFullscr === void 0 ? void 0 : _this$props$onFullscr.call(_this$props2, isFullScreenEnabled);
96
117
  _this.setState({
97
118
  isFullScreenEnabled: isFullScreenEnabled
98
119
  });
@@ -119,11 +140,11 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
119
140
  }, (0, _formatDuration.formatDuration)(currentTime), " / ", (0, _formatDuration.formatDuration)(duration));
120
141
  });
121
142
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderHDButton", function () {
122
- var _this$props2 = _this.props,
123
- type = _this$props2.type,
124
- isHDAvailable = _this$props2.isHDAvailable,
125
- isHDActive = _this$props2.isHDActive,
126
- onHDToggleClick = _this$props2.onHDToggleClick;
143
+ var _this$props3 = _this.props,
144
+ type = _this$props3.type,
145
+ isHDAvailable = _this$props3.isHDAvailable,
146
+ isHDActive = _this$props3.isHDActive,
147
+ onHDToggleClick = _this$props3.onHDToggleClick;
127
148
  if (type === 'audio' || !isHDAvailable) {
128
149
  return;
129
150
  }
@@ -207,9 +228,9 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
207
228
  }
208
229
  });
209
230
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderFullScreenButton", function () {
210
- var _this$props3 = _this.props,
211
- formatMessage = _this$props3.intl.formatMessage,
212
- type = _this$props3.type;
231
+ var _this$props4 = _this.props,
232
+ formatMessage = _this$props4.intl.formatMessage,
233
+ type = _this$props4.type;
213
234
  if (type === 'audio') {
214
235
  return;
215
236
  }
@@ -330,6 +351,7 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
330
351
  }
331
352
  _simultaneousPlayManager.default.pauseOthers((0, _assertThisInitialized2.default)(_this));
332
353
  if (!_this.wasPlayedOnce && onFirstPlay) {
354
+ _this.fireFirstPlayedTrackEvent();
333
355
  _this.wasPlayedOnce = true;
334
356
  onFirstPlay();
335
357
  }
@@ -351,17 +373,17 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
351
373
  };
352
374
  });
353
375
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onViewed", function (videoState) {
354
- var _this$props4 = _this.props,
355
- createAnalyticsEvent = _this$props4.createAnalyticsEvent,
356
- fileId = _this$props4.fileId,
357
- isAutoPlay = _this$props4.isAutoPlay,
358
- isHDAvailable = _this$props4.isHDAvailable,
359
- isHDActive = _this$props4.isHDActive,
360
- type = _this$props4.type;
361
- var _this$state = _this.state,
362
- isFullScreenEnabled = _this$state.isFullScreenEnabled,
363
- playerSize = _this$state.playerSize,
364
- playbackSpeed = _this$state.playbackSpeed;
376
+ var _this$props5 = _this.props,
377
+ createAnalyticsEvent = _this$props5.createAnalyticsEvent,
378
+ fileId = _this$props5.fileId,
379
+ isAutoPlay = _this$props5.isAutoPlay,
380
+ isHDAvailable = _this$props5.isHDAvailable,
381
+ isHDActive = _this$props5.isHDActive,
382
+ type = _this$props5.type;
383
+ var _this$state2 = _this.state,
384
+ isFullScreenEnabled = _this$state2.isFullScreenEnabled,
385
+ playerSize = _this$state2.playerSize,
386
+ playbackSpeed = _this$state2.playbackSpeed;
365
387
  var status = videoState.status,
366
388
  currentTime = videoState.currentTime;
367
389
  if (status === 'playing' && (currentTime < _this.lastCurrentTime || currentTime >= _this.lastCurrentTime + VIEWED_TRACKING_SECS)) {
@@ -406,18 +428,18 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
406
428
  (0, _createClass2.default)(CustomMediaPlayerBase, [{
407
429
  key: "componentDidMount",
408
430
  value: function componentDidMount() {
409
- var _this$props5 = this.props,
410
- type = _this$props5.type,
411
- fileId = _this$props5.fileId,
412
- isAutoPlay = _this$props5.isAutoPlay,
413
- isHDAvailable = _this$props5.isHDAvailable,
414
- isHDActive = _this$props5.isHDActive,
415
- onFirstPlay = _this$props5.onFirstPlay,
416
- createAnalyticsEvent = _this$props5.createAnalyticsEvent;
417
- var _this$state2 = this.state,
418
- isFullScreenEnabled = _this$state2.isFullScreenEnabled,
419
- playerSize = _this$state2.playerSize,
420
- playbackSpeed = _this$state2.playbackSpeed;
431
+ var _this$props6 = this.props,
432
+ type = _this$props6.type,
433
+ fileId = _this$props6.fileId,
434
+ isAutoPlay = _this$props6.isAutoPlay,
435
+ isHDAvailable = _this$props6.isHDAvailable,
436
+ isHDActive = _this$props6.isHDActive,
437
+ onFirstPlay = _this$props6.onFirstPlay,
438
+ createAnalyticsEvent = _this$props6.createAnalyticsEvent;
439
+ var _this$state3 = this.state,
440
+ isFullScreenEnabled = _this$state3.isFullScreenEnabled,
441
+ playerSize = _this$state3.playerSize,
442
+ playbackSpeed = _this$state3.playbackSpeed;
421
443
  (0, _analytics.fireAnalyticsEvent)((0, _analytics.createCustomMediaPlayerScreenEvent)(type, {
422
444
  isAutoPlay: isAutoPlay,
423
445
  isHDAvailable: isHDAvailable,
@@ -433,14 +455,7 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
433
455
  if (isAutoPlay) {
434
456
  _simultaneousPlayManager.default.pauseOthers(this);
435
457
  if (onFirstPlay) {
436
- (0, _analytics.fireAnalyticsEvent)((0, _analytics.createFirstPlayedTrackEvent)(type, {
437
- isAutoPlay: isAutoPlay,
438
- isHDAvailable: isHDAvailable,
439
- isHDActive: isHDActive,
440
- isFullScreenEnabled: isFullScreenEnabled,
441
- playerSize: playerSize,
442
- playbackSpeed: playbackSpeed
443
- }, fileId), createAnalyticsEvent);
458
+ this.fireFirstPlayedTrackEvent();
444
459
  this.wasPlayedOnce = true;
445
460
  onFirstPlay();
446
461
  }
@@ -453,8 +468,8 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
453
468
  this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
454
469
  }
455
470
  if (this.state.isFullScreenEnabled) {
456
- var _this$props$onFullscr2, _this$props6;
457
- (_this$props$onFullscr2 = (_this$props6 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 ? void 0 : _this$props$onFullscr2.call(_this$props6, false);
471
+ var _this$props$onFullscr2, _this$props7;
472
+ (_this$props$onFullscr2 = (_this$props7 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 ? void 0 : _this$props$onFullscr2.call(_this$props7, false);
458
473
  }
459
474
  _simultaneousPlayManager.default.unsubscribe(this);
460
475
  }
@@ -470,17 +485,17 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
470
485
  }, {
471
486
  key: "createAndFireUIEvent",
472
487
  value: function createAndFireUIEvent(eventType, actionSubjectId) {
473
- var _this$props7 = this.props,
474
- type = _this$props7.type,
475
- fileId = _this$props7.fileId,
476
- isHDActive = _this$props7.isHDActive,
477
- isHDAvailable = _this$props7.isHDAvailable,
478
- isAutoPlay = _this$props7.isAutoPlay,
479
- createAnalyticsEvent = _this$props7.createAnalyticsEvent;
480
- var _this$state3 = this.state,
481
- isFullScreenEnabled = _this$state3.isFullScreenEnabled,
482
- playerSize = _this$state3.playerSize,
483
- playbackSpeed = _this$state3.playbackSpeed;
488
+ var _this$props8 = this.props,
489
+ type = _this$props8.type,
490
+ fileId = _this$props8.fileId,
491
+ isHDActive = _this$props8.isHDActive,
492
+ isHDAvailable = _this$props8.isHDAvailable,
493
+ isAutoPlay = _this$props8.isAutoPlay,
494
+ createAnalyticsEvent = _this$props8.createAnalyticsEvent;
495
+ var _this$state4 = this.state,
496
+ isFullScreenEnabled = _this$state4.isFullScreenEnabled,
497
+ playerSize = _this$state4.playerSize,
498
+ playbackSpeed = _this$state4.playbackSpeed;
484
499
  var playbackState = _objectSpread(_objectSpread({}, this.videoState), {}, {
485
500
  isAutoPlay: isAutoPlay,
486
501
  isHDAvailable: isHDAvailable,
@@ -523,13 +538,13 @@ var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
523
538
  key: "render",
524
539
  value: function render() {
525
540
  var _this2 = this;
526
- var _this$props8 = this.props,
527
- type = _this$props8.type,
528
- src = _this$props8.src,
529
- isAutoPlay = _this$props8.isAutoPlay,
530
- onCanPlay = _this$props8.onCanPlay,
531
- onError = _this$props8.onError,
532
- poster = _this$props8.poster;
541
+ var _this$props9 = this.props,
542
+ type = _this$props9.type,
543
+ src = _this$props9.src,
544
+ isAutoPlay = _this$props9.isAutoPlay,
545
+ onCanPlay = _this$props9.onCanPlay,
546
+ onError = _this$props9.onError,
547
+ poster = _this$props9.poster;
533
548
  return /*#__PURE__*/_react.default.createElement(_styled.CustomVideoWrapper, {
534
549
  ref: this.videoWrapperRef,
535
550
  "data-testid": "custom-media-player"
@@ -14,20 +14,20 @@ var CustomVideoWrapper = _styled.default.div(_templateObject || (_templateObject
14
14
  exports.CustomVideoWrapper = CustomVideoWrapper;
15
15
  var VideoWrapper = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n"])));
16
16
 
17
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
17
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
18
18
  exports.VideoWrapper = VideoWrapper;
19
19
  var TimebarWrapper = _styled.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: white;\n position: absolute;\n width: 100%;\n bottom: 10px;\n"])));
20
20
  exports.TimebarWrapper = TimebarWrapper;
21
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
21
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
22
22
  var VolumeWrapper = _styled.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 35px;\n overflow: hidden;\n transition: width 0.3s;\n align-items: center;\n bottom: 0px;\n left: 43px;\n\n ", "\n"])), function (props) {
23
23
  return props.showSlider ? "\n &:hover,\n &:active {\n width: 150px;\n transition: width 0.3s ease-out;\n }\n " : '';
24
24
  });
25
25
 
26
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
26
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
27
27
  exports.VolumeWrapper = VolumeWrapper;
28
28
  var TimeWrapper = _styled.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 ", " 10px ", ";\n margin-bottom: 44px;\n"])), "var(--ds-space-250, 20px)", "var(--ds-space-250, 20px)");
29
29
 
30
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
30
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
31
31
  exports.TimeWrapper = TimeWrapper;
32
32
  var CurrentTime = _styled.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n color: #c7d1db;\n user-select: none;\n margin-right: 10px;\n white-space: nowrap;\n"])));
33
33
  exports.CurrentTime = CurrentTime;
@@ -39,17 +39,17 @@ var Thumb = _styled.default.div(_templateObject9 || (_templateObject9 = (0, _tag
39
39
  exports.Thumb = Thumb;
40
40
  var BufferedTime = _styled.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n background-color: #8696a7;\n height: inherit;\n border-radius: inherit;\n width: 0;\n"])));
41
41
 
42
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
42
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
43
43
  exports.BufferedTime = BufferedTime;
44
44
  var LeftControls = _styled.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: 10px;\n"])));
45
45
 
46
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
46
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
47
47
  exports.LeftControls = LeftControls;
48
48
  var RightControls = _styled.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n margin-right: 10px;\n color: '#c7d1db';\n"])));
49
49
  exports.RightControls = RightControls;
50
50
  var ControlsWrapper = _styled.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n bottom: 0;\n left: 0;\n width: 100%;\n height: auto;\n background: linear-gradient(to top, #101214, rgba(14, 22, 36, 0));\n position: absolute;\n"])));
51
51
 
52
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
52
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
53
53
  exports.ControlsWrapper = ControlsWrapper;
54
54
  var VolumeToggleWrapper = _styled.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n margin-right: 13px;\n\n button {\n width: 36px !important;\n color: ", ";\n }\n"])), function (_ref) {
55
55
  var isMuted = _ref.isMuted;
@@ -58,13 +58,13 @@ var VolumeToggleWrapper = _styled.default.div(_templateObject14 || (_templateObj
58
58
  exports.VolumeToggleWrapper = VolumeToggleWrapper;
59
59
  var VolumeTimeRangeWrapper = _styled.default.div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n margin-right: ", ";\n"])), "var(--ds-space-250, 20px)");
60
60
 
61
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
61
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
62
62
  exports.VolumeTimeRangeWrapper = VolumeTimeRangeWrapper;
63
63
  var MutedIndicator = _styled.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n width: 29px;\n height: 2px;\n position: absolute;\n top: 10px;\n left: 9px;\n z-index: 2;\n background: ", ";\n transform: rotate(32deg) translateY(10px);\n opacity: 0;\n pointer-events: none;\n\n ", ";\n"])), _colors.R300, function (props) {
64
64
  return props.isMuted ? "\n opacity: 1;\n " : '';
65
65
  });
66
66
  exports.MutedIndicator = MutedIndicator;
67
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
67
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
68
68
  var CurrentTimeTooltip = _styled.default.div(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n user-select: none;\n top: -28px;\n background-color: #182c4c;\n color: #eff1f3;\n font-size: 12px;\n padding: 3px 7px;\n border-radius: 3px;\n left: 50%;\n transform: translateX(-50%);\n opacity: ", ";\n transition: opacity 0.3s;\n word-break: keep-all;\n"])), function (props) {
69
69
  return props.isDragging ? '1' : '0';
70
70
  });
@@ -29,6 +29,7 @@ var _default = {
29
29
  'fabric.media.annotate.tool.text': 'Text',
30
30
  'fabric.media.archive': 'archive',
31
31
  'fabric.media.audio': 'audio',
32
+ 'fabric.media.avatar_picker_back_btn_label': 'Go Back',
32
33
  'fabric.media.cancel': 'Cancel',
33
34
  'fabric.media.cant_preview_file_type': "We can't preview this file type.",
34
35
  'fabric.media.cant_retrieve_files': 'Ouch! We could not retrieve any files',
@@ -29,6 +29,7 @@ var _default = {
29
29
  'fabric.media.annotate.tool.text': 'Text',
30
30
  'fabric.media.archive': 'archive',
31
31
  'fabric.media.audio': 'audio',
32
+ 'fabric.media.avatar_picker_back_btn_label': 'Go Back',
32
33
  'fabric.media.cancel': 'Cancel',
33
34
  'fabric.media.cant_preview_file_type': "We can't preview this file type.",
34
35
  'fabric.media.cant_retrieve_files': 'Ouch! We could not retrieve any files',
@@ -29,6 +29,7 @@ var _default = {
29
29
  'fabric.media.annotate.tool.text': '⁣⁢Text⁡⁡⁠⁠⁡؜‌‌‍⁡⁠‌‍⁣⁤',
30
30
  'fabric.media.archive': '⁣⁢archive‌⁡‌‍‍‌؜⁡⁠⁣⁤',
31
31
  'fabric.media.audio': '⁣⁢audio‍⁡⁡؜⁡⁣⁤',
32
+ 'fabric.media.avatar_picker_back_btn_label': '⁣⁢Go Back؜⁡‌‌⁡⁡⁠‌‌⁣⁤',
32
33
  'fabric.media.cancel': '⁣⁢Cancel‌‍؜⁠‍؜‌‌⁠⁡⁣⁤',
33
34
  'fabric.media.cant_preview_file_type': "⁣⁢We can't preview this file type.⁠‍‌⁡⁡‍؜‍⁠؜⁣⁤",
34
35
  'fabric.media.cant_retrieve_files': '⁣⁢Ouch! We could not retrieve any files⁠‍؜؜‌؜⁡‌⁡؜⁠⁣⁤',
@@ -270,6 +270,16 @@ var MediaImage = /*#__PURE__*/function (_Component) {
270
270
  }
271
271
  }
272
272
 
273
+ /*
274
+ For images with borders, there may be an intermittent gap between the image and the border due to weird browser behaviour.
275
+ Part of the solution is to expand the image equally in all directions (width & height) by 1px, and the below calculation is to ensure just that.
276
+ Read more: https://product-fabric.atlassian.net/browse/MEX-2481
277
+ */
278
+
279
+ if (this.props.expandByPixel !== undefined) {
280
+ percentSize = "calc(".concat(percentSize, " + ").concat(this.props.expandByPixel, "px)");
281
+ }
282
+
273
283
  /*
274
284
  When isStretchingAllowed is false image is as big as it is, but as small as container
275
285
  (according to strategy - cover or fit).
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-ui",
3
- "version": "23.1.0",
3
+ "version": "23.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -34,7 +34,7 @@ import Tooltip from '@atlaskit/tooltip';
34
34
  import { SkipTenBackwardIcon, SkipTenForwardIcon } from './icons';
35
35
  import { getControlsWrapperClassName } from './getControlsWrapperClassName';
36
36
  const packageName = "@atlaskit/media-ui";
37
- const packageVersion = "23.1.0";
37
+ const packageVersion = "23.2.0";
38
38
  const MEDIUM_VIDEO_MAX_WIDTH = 400;
39
39
  const SMALL_VIDEO_MAX_WIDTH = 160;
40
40
  const MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -60,6 +60,29 @@ export class CustomMediaPlayerBase extends Component {
60
60
  playerSize: 'large',
61
61
  playbackSpeed: 1
62
62
  });
63
+ _defineProperty(this, "fireFirstPlayedTrackEvent", () => {
64
+ const {
65
+ type,
66
+ fileId,
67
+ isHDActive,
68
+ isHDAvailable,
69
+ isAutoPlay,
70
+ createAnalyticsEvent
71
+ } = this.props;
72
+ const {
73
+ isFullScreenEnabled,
74
+ playerSize,
75
+ playbackSpeed
76
+ } = this.state;
77
+ fireAnalyticsEvent(createFirstPlayedTrackEvent(type, {
78
+ isAutoPlay,
79
+ isHDAvailable,
80
+ isHDActive,
81
+ isFullScreenEnabled,
82
+ playerSize,
83
+ playbackSpeed
84
+ }, fileId), createAnalyticsEvent);
85
+ });
63
86
  _defineProperty(this, "onFullScreenChange", e => {
64
87
  if (e.target !== this.videoWrapperRef.current) {
65
88
  return;
@@ -332,6 +355,7 @@ export class CustomMediaPlayerBase extends Component {
332
355
  }
333
356
  simultaneousPlayManager.pauseOthers(this);
334
357
  if (!this.wasPlayedOnce && onFirstPlay) {
358
+ this.fireFirstPlayedTrackEvent();
335
359
  this.wasPlayedOnce = true;
336
360
  onFirstPlay();
337
361
  }
@@ -437,14 +461,7 @@ export class CustomMediaPlayerBase extends Component {
437
461
  if (isAutoPlay) {
438
462
  simultaneousPlayManager.pauseOthers(this);
439
463
  if (onFirstPlay) {
440
- fireAnalyticsEvent(createFirstPlayedTrackEvent(type, {
441
- isAutoPlay,
442
- isHDAvailable,
443
- isHDActive,
444
- isFullScreenEnabled,
445
- playerSize,
446
- playbackSpeed
447
- }, fileId), createAnalyticsEvent);
464
+ this.fireFirstPlayedTrackEvent();
448
465
  this.wasPlayedOnce = true;
449
466
  onFirstPlay();
450
467
  }
@@ -13,7 +13,7 @@ export const VideoWrapper = styled.div`
13
13
  flex-direction: column;
14
14
  `;
15
15
 
16
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
16
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
17
17
  export const TimebarWrapper = styled.div`
18
18
  display: flex;
19
19
  align-items: center;
@@ -23,7 +23,7 @@ export const TimebarWrapper = styled.div`
23
23
  width: 100%;
24
24
  bottom: 10px;
25
25
  `;
26
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
26
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
27
27
  export const VolumeWrapper = styled.div`
28
28
  display: flex;
29
29
  width: 35px;
@@ -42,13 +42,13 @@ export const VolumeWrapper = styled.div`
42
42
  ` : ''}
43
43
  `;
44
44
 
45
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
45
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
46
46
  export const TimeWrapper = styled.div`
47
47
  margin: 0 ${"var(--ds-space-250, 20px)"} 10px ${"var(--ds-space-250, 20px)"};
48
48
  margin-bottom: 44px;
49
49
  `;
50
50
 
51
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
51
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
52
52
  export const CurrentTime = styled.div`
53
53
  color: #c7d1db;
54
54
  user-select: none;
@@ -98,13 +98,13 @@ export const BufferedTime = styled.div`
98
98
  width: 0;
99
99
  `;
100
100
 
101
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
101
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
102
102
  export const LeftControls = styled.div`
103
103
  display: flex;
104
104
  margin-left: 10px;
105
105
  `;
106
106
 
107
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
107
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
108
108
  export const RightControls = styled.div`
109
109
  display: flex;
110
110
  align-items: center;
@@ -120,7 +120,7 @@ export const ControlsWrapper = styled.div`
120
120
  position: absolute;
121
121
  `;
122
122
 
123
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
123
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
124
124
  export const VolumeToggleWrapper = styled.div`
125
125
  position: relative;
126
126
  margin-right: 13px;
@@ -137,7 +137,7 @@ export const VolumeTimeRangeWrapper = styled.div`
137
137
  margin-right: ${"var(--ds-space-250, 20px)"};
138
138
  `;
139
139
 
140
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
140
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
141
141
  export const MutedIndicator = styled.div`
142
142
  width: 29px;
143
143
  height: 2px;
@@ -154,7 +154,7 @@ export const MutedIndicator = styled.div`
154
154
  opacity: 1;
155
155
  ` : ''};
156
156
  `;
157
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
157
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
158
158
  export const CurrentTimeTooltip = styled.div`
159
159
  position: absolute;
160
160
  user-select: none;
@@ -23,6 +23,7 @@ export default {
23
23
  'fabric.media.annotate.tool.text': 'Text',
24
24
  'fabric.media.archive': 'archive',
25
25
  'fabric.media.audio': 'audio',
26
+ 'fabric.media.avatar_picker_back_btn_label': 'Go Back',
26
27
  'fabric.media.cancel': 'Cancel',
27
28
  'fabric.media.cant_preview_file_type': "We can't preview this file type.",
28
29
  'fabric.media.cant_retrieve_files': 'Ouch! We could not retrieve any files',
@@ -23,6 +23,7 @@ export default {
23
23
  'fabric.media.annotate.tool.text': 'Text',
24
24
  'fabric.media.archive': 'archive',
25
25
  'fabric.media.audio': 'audio',
26
+ 'fabric.media.avatar_picker_back_btn_label': 'Go Back',
26
27
  'fabric.media.cancel': 'Cancel',
27
28
  'fabric.media.cant_preview_file_type': "We can't preview this file type.",
28
29
  'fabric.media.cant_retrieve_files': 'Ouch! We could not retrieve any files',
@@ -23,6 +23,7 @@ export default {
23
23
  'fabric.media.annotate.tool.text': '⁣⁢Text⁡⁡⁠⁠⁡؜‌‌‍⁡⁠‌‍⁣⁤',
24
24
  'fabric.media.archive': '⁣⁢archive‌⁡‌‍‍‌؜⁡⁠⁣⁤',
25
25
  'fabric.media.audio': '⁣⁢audio‍⁡⁡؜⁡⁣⁤',
26
+ 'fabric.media.avatar_picker_back_btn_label': '⁣⁢Go Back؜⁡‌‌⁡⁡⁠‌‌⁣⁤',
26
27
  'fabric.media.cancel': '⁣⁢Cancel‌‍؜⁠‍؜‌‌⁠⁡⁣⁤',
27
28
  'fabric.media.cant_preview_file_type': "⁣⁢We can't preview this file type.⁠‍‌⁡⁡‍؜‍⁠؜⁣⁤",
28
29
  'fabric.media.cant_retrieve_files': '⁣⁢Ouch! We could not retrieve any files⁠‍؜؜‌؜⁡‌⁡؜⁠⁣⁤',
@@ -248,6 +248,16 @@ export class MediaImage extends Component {
248
248
  }
249
249
  }
250
250
 
251
+ /*
252
+ For images with borders, there may be an intermittent gap between the image and the border due to weird browser behaviour.
253
+ Part of the solution is to expand the image equally in all directions (width & height) by 1px, and the below calculation is to ensure just that.
254
+ Read more: https://product-fabric.atlassian.net/browse/MEX-2481
255
+ */
256
+
257
+ if (this.props.expandByPixel !== undefined) {
258
+ percentSize = `calc(${percentSize} + ${this.props.expandByPixel}px)`;
259
+ }
260
+
251
261
  /*
252
262
  When isStretchingAllowed is false image is as big as it is, but as small as container
253
263
  (according to strategy - cover or fit).
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-ui",
3
- "version": "23.1.0",
3
+ "version": "23.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -44,7 +44,7 @@ import Tooltip from '@atlaskit/tooltip';
44
44
  import { SkipTenBackwardIcon, SkipTenForwardIcon } from './icons';
45
45
  import { getControlsWrapperClassName } from './getControlsWrapperClassName';
46
46
  var packageName = "@atlaskit/media-ui";
47
- var packageVersion = "23.1.0";
47
+ var packageVersion = "23.2.0";
48
48
  var MEDIUM_VIDEO_MAX_WIDTH = 400;
49
49
  var SMALL_VIDEO_MAX_WIDTH = 160;
50
50
  var MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -77,6 +77,27 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
77
77
  playerSize: 'large',
78
78
  playbackSpeed: 1
79
79
  });
80
+ _defineProperty(_assertThisInitialized(_this), "fireFirstPlayedTrackEvent", function () {
81
+ var _this$props = _this.props,
82
+ type = _this$props.type,
83
+ fileId = _this$props.fileId,
84
+ isHDActive = _this$props.isHDActive,
85
+ isHDAvailable = _this$props.isHDAvailable,
86
+ isAutoPlay = _this$props.isAutoPlay,
87
+ createAnalyticsEvent = _this$props.createAnalyticsEvent;
88
+ var _this$state = _this.state,
89
+ isFullScreenEnabled = _this$state.isFullScreenEnabled,
90
+ playerSize = _this$state.playerSize,
91
+ playbackSpeed = _this$state.playbackSpeed;
92
+ fireAnalyticsEvent(createFirstPlayedTrackEvent(type, {
93
+ isAutoPlay: isAutoPlay,
94
+ isHDAvailable: isHDAvailable,
95
+ isHDActive: isHDActive,
96
+ isFullScreenEnabled: isFullScreenEnabled,
97
+ playerSize: playerSize,
98
+ playbackSpeed: playbackSpeed
99
+ }, fileId), createAnalyticsEvent);
100
+ });
80
101
  _defineProperty(_assertThisInitialized(_this), "onFullScreenChange", function (e) {
81
102
  if (e.target !== _this.videoWrapperRef.current) {
82
103
  return;
@@ -84,8 +105,8 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
84
105
  var currentFullScreenMode = _this.state.isFullScreenEnabled;
85
106
  var isFullScreenEnabled = !!getFullscreenElement();
86
107
  if (currentFullScreenMode !== isFullScreenEnabled) {
87
- var _this$props$onFullscr, _this$props;
88
- (_this$props$onFullscr = (_this$props = _this.props).onFullscreenChange) === null || _this$props$onFullscr === void 0 ? void 0 : _this$props$onFullscr.call(_this$props, isFullScreenEnabled);
108
+ var _this$props$onFullscr, _this$props2;
109
+ (_this$props$onFullscr = (_this$props2 = _this.props).onFullscreenChange) === null || _this$props$onFullscr === void 0 ? void 0 : _this$props$onFullscr.call(_this$props2, isFullScreenEnabled);
89
110
  _this.setState({
90
111
  isFullScreenEnabled: isFullScreenEnabled
91
112
  });
@@ -112,11 +133,11 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
112
133
  }, formatDuration(currentTime), " / ", formatDuration(duration));
113
134
  });
114
135
  _defineProperty(_assertThisInitialized(_this), "renderHDButton", function () {
115
- var _this$props2 = _this.props,
116
- type = _this$props2.type,
117
- isHDAvailable = _this$props2.isHDAvailable,
118
- isHDActive = _this$props2.isHDActive,
119
- onHDToggleClick = _this$props2.onHDToggleClick;
136
+ var _this$props3 = _this.props,
137
+ type = _this$props3.type,
138
+ isHDAvailable = _this$props3.isHDAvailable,
139
+ isHDActive = _this$props3.isHDActive,
140
+ onHDToggleClick = _this$props3.onHDToggleClick;
120
141
  if (type === 'audio' || !isHDAvailable) {
121
142
  return;
122
143
  }
@@ -200,9 +221,9 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
200
221
  }
201
222
  });
202
223
  _defineProperty(_assertThisInitialized(_this), "renderFullScreenButton", function () {
203
- var _this$props3 = _this.props,
204
- formatMessage = _this$props3.intl.formatMessage,
205
- type = _this$props3.type;
224
+ var _this$props4 = _this.props,
225
+ formatMessage = _this$props4.intl.formatMessage,
226
+ type = _this$props4.type;
206
227
  if (type === 'audio') {
207
228
  return;
208
229
  }
@@ -323,6 +344,7 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
323
344
  }
324
345
  simultaneousPlayManager.pauseOthers(_assertThisInitialized(_this));
325
346
  if (!_this.wasPlayedOnce && onFirstPlay) {
347
+ _this.fireFirstPlayedTrackEvent();
326
348
  _this.wasPlayedOnce = true;
327
349
  onFirstPlay();
328
350
  }
@@ -344,17 +366,17 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
344
366
  };
345
367
  });
346
368
  _defineProperty(_assertThisInitialized(_this), "onViewed", function (videoState) {
347
- var _this$props4 = _this.props,
348
- createAnalyticsEvent = _this$props4.createAnalyticsEvent,
349
- fileId = _this$props4.fileId,
350
- isAutoPlay = _this$props4.isAutoPlay,
351
- isHDAvailable = _this$props4.isHDAvailable,
352
- isHDActive = _this$props4.isHDActive,
353
- type = _this$props4.type;
354
- var _this$state = _this.state,
355
- isFullScreenEnabled = _this$state.isFullScreenEnabled,
356
- playerSize = _this$state.playerSize,
357
- playbackSpeed = _this$state.playbackSpeed;
369
+ var _this$props5 = _this.props,
370
+ createAnalyticsEvent = _this$props5.createAnalyticsEvent,
371
+ fileId = _this$props5.fileId,
372
+ isAutoPlay = _this$props5.isAutoPlay,
373
+ isHDAvailable = _this$props5.isHDAvailable,
374
+ isHDActive = _this$props5.isHDActive,
375
+ type = _this$props5.type;
376
+ var _this$state2 = _this.state,
377
+ isFullScreenEnabled = _this$state2.isFullScreenEnabled,
378
+ playerSize = _this$state2.playerSize,
379
+ playbackSpeed = _this$state2.playbackSpeed;
358
380
  var status = videoState.status,
359
381
  currentTime = videoState.currentTime;
360
382
  if (status === 'playing' && (currentTime < _this.lastCurrentTime || currentTime >= _this.lastCurrentTime + VIEWED_TRACKING_SECS)) {
@@ -399,18 +421,18 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
399
421
  _createClass(CustomMediaPlayerBase, [{
400
422
  key: "componentDidMount",
401
423
  value: function componentDidMount() {
402
- var _this$props5 = this.props,
403
- type = _this$props5.type,
404
- fileId = _this$props5.fileId,
405
- isAutoPlay = _this$props5.isAutoPlay,
406
- isHDAvailable = _this$props5.isHDAvailable,
407
- isHDActive = _this$props5.isHDActive,
408
- onFirstPlay = _this$props5.onFirstPlay,
409
- createAnalyticsEvent = _this$props5.createAnalyticsEvent;
410
- var _this$state2 = this.state,
411
- isFullScreenEnabled = _this$state2.isFullScreenEnabled,
412
- playerSize = _this$state2.playerSize,
413
- playbackSpeed = _this$state2.playbackSpeed;
424
+ var _this$props6 = this.props,
425
+ type = _this$props6.type,
426
+ fileId = _this$props6.fileId,
427
+ isAutoPlay = _this$props6.isAutoPlay,
428
+ isHDAvailable = _this$props6.isHDAvailable,
429
+ isHDActive = _this$props6.isHDActive,
430
+ onFirstPlay = _this$props6.onFirstPlay,
431
+ createAnalyticsEvent = _this$props6.createAnalyticsEvent;
432
+ var _this$state3 = this.state,
433
+ isFullScreenEnabled = _this$state3.isFullScreenEnabled,
434
+ playerSize = _this$state3.playerSize,
435
+ playbackSpeed = _this$state3.playbackSpeed;
414
436
  fireAnalyticsEvent(createCustomMediaPlayerScreenEvent(type, {
415
437
  isAutoPlay: isAutoPlay,
416
438
  isHDAvailable: isHDAvailable,
@@ -426,14 +448,7 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
426
448
  if (isAutoPlay) {
427
449
  simultaneousPlayManager.pauseOthers(this);
428
450
  if (onFirstPlay) {
429
- fireAnalyticsEvent(createFirstPlayedTrackEvent(type, {
430
- isAutoPlay: isAutoPlay,
431
- isHDAvailable: isHDAvailable,
432
- isHDActive: isHDActive,
433
- isFullScreenEnabled: isFullScreenEnabled,
434
- playerSize: playerSize,
435
- playbackSpeed: playbackSpeed
436
- }, fileId), createAnalyticsEvent);
451
+ this.fireFirstPlayedTrackEvent();
437
452
  this.wasPlayedOnce = true;
438
453
  onFirstPlay();
439
454
  }
@@ -446,8 +461,8 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
446
461
  this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
447
462
  }
448
463
  if (this.state.isFullScreenEnabled) {
449
- var _this$props$onFullscr2, _this$props6;
450
- (_this$props$onFullscr2 = (_this$props6 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 ? void 0 : _this$props$onFullscr2.call(_this$props6, false);
464
+ var _this$props$onFullscr2, _this$props7;
465
+ (_this$props$onFullscr2 = (_this$props7 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 ? void 0 : _this$props$onFullscr2.call(_this$props7, false);
451
466
  }
452
467
  simultaneousPlayManager.unsubscribe(this);
453
468
  }
@@ -463,17 +478,17 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
463
478
  }, {
464
479
  key: "createAndFireUIEvent",
465
480
  value: function createAndFireUIEvent(eventType, actionSubjectId) {
466
- var _this$props7 = this.props,
467
- type = _this$props7.type,
468
- fileId = _this$props7.fileId,
469
- isHDActive = _this$props7.isHDActive,
470
- isHDAvailable = _this$props7.isHDAvailable,
471
- isAutoPlay = _this$props7.isAutoPlay,
472
- createAnalyticsEvent = _this$props7.createAnalyticsEvent;
473
- var _this$state3 = this.state,
474
- isFullScreenEnabled = _this$state3.isFullScreenEnabled,
475
- playerSize = _this$state3.playerSize,
476
- playbackSpeed = _this$state3.playbackSpeed;
481
+ var _this$props8 = this.props,
482
+ type = _this$props8.type,
483
+ fileId = _this$props8.fileId,
484
+ isHDActive = _this$props8.isHDActive,
485
+ isHDAvailable = _this$props8.isHDAvailable,
486
+ isAutoPlay = _this$props8.isAutoPlay,
487
+ createAnalyticsEvent = _this$props8.createAnalyticsEvent;
488
+ var _this$state4 = this.state,
489
+ isFullScreenEnabled = _this$state4.isFullScreenEnabled,
490
+ playerSize = _this$state4.playerSize,
491
+ playbackSpeed = _this$state4.playbackSpeed;
477
492
  var playbackState = _objectSpread(_objectSpread({}, this.videoState), {}, {
478
493
  isAutoPlay: isAutoPlay,
479
494
  isHDAvailable: isHDAvailable,
@@ -516,13 +531,13 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
516
531
  key: "render",
517
532
  value: function render() {
518
533
  var _this2 = this;
519
- var _this$props8 = this.props,
520
- type = _this$props8.type,
521
- src = _this$props8.src,
522
- isAutoPlay = _this$props8.isAutoPlay,
523
- onCanPlay = _this$props8.onCanPlay,
524
- onError = _this$props8.onError,
525
- poster = _this$props8.poster;
534
+ var _this$props9 = this.props,
535
+ type = _this$props9.type,
536
+ src = _this$props9.src,
537
+ isAutoPlay = _this$props9.isAutoPlay,
538
+ onCanPlay = _this$props9.onCanPlay,
539
+ onError = _this$props9.onError,
540
+ poster = _this$props9.poster;
526
541
  return /*#__PURE__*/React.createElement(CustomVideoWrapper, {
527
542
  ref: this.videoWrapperRef,
528
543
  "data-testid": "custom-media-player"
@@ -6,42 +6,42 @@ import { R300 } from '@atlaskit/theme/colors';
6
6
  export var CustomVideoWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n user-select: none;\n"])));
7
7
  export var VideoWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n"])));
8
8
 
9
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
9
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
10
10
  export var TimebarWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: white;\n position: absolute;\n width: 100%;\n bottom: 10px;\n"])));
11
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
11
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
12
12
  export var VolumeWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n width: 35px;\n overflow: hidden;\n transition: width 0.3s;\n align-items: center;\n bottom: 0px;\n left: 43px;\n\n ", "\n"])), function (props) {
13
13
  return props.showSlider ? "\n &:hover,\n &:active {\n width: 150px;\n transition: width 0.3s ease-out;\n }\n " : '';
14
14
  });
15
15
 
16
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
16
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
17
17
  export var TimeWrapper = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 0 ", " 10px ", ";\n margin-bottom: 44px;\n"])), "var(--ds-space-250, 20px)", "var(--ds-space-250, 20px)");
18
18
 
19
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
19
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
20
20
  export var CurrentTime = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: #c7d1db;\n user-select: none;\n margin-right: 10px;\n white-space: nowrap;\n"])));
21
21
  export var TimeLine = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: 100%;\n height: 2px;\n transition-delay: 1s;\n transition: all 0.1s;\n background-color: #596773;\n border-radius: 5px;\n position: relative;\n"])));
22
22
  export var CurrentTimeLine = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: #05c;\n border-radius: inherit;\n height: inherit;\n position: absolute;\n top: 0;\n max-width: 100%;\n"])));
23
23
  export var Thumb = styled.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n pointer-events: none;\n width: 14px;\n height: 14px;\n border-radius: 100%;\n background-color: white;\n border: 1px solid #666;\n position: absolute;\n right: 0;\n top: 50%;\n\n transform: translate(7px, -50%) scale(0);\n transition: all 0.1s;\n transition-delay: 1s;\n\n &:hover .current-time-tooltip {\n opacity: 1;\n }\n"])));
24
24
  export var BufferedTime = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-color: #8696a7;\n height: inherit;\n border-radius: inherit;\n width: 0;\n"])));
25
25
 
26
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
26
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
27
27
  export var LeftControls = styled.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n margin-left: 10px;\n"])));
28
28
 
29
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
29
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
30
30
  export var RightControls = styled.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-right: 10px;\n color: '#c7d1db';\n"])));
31
31
  export var ControlsWrapper = styled.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n bottom: 0;\n left: 0;\n width: 100%;\n height: auto;\n background: linear-gradient(to top, #101214, rgba(14, 22, 36, 0));\n position: absolute;\n"])));
32
32
 
33
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
33
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
34
34
  export var VolumeToggleWrapper = styled.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: relative;\n margin-right: 13px;\n\n button {\n width: 36px !important;\n color: ", ";\n }\n"])), function (_ref) {
35
35
  var isMuted = _ref.isMuted;
36
36
  return isMuted ? "#EF5C48 !important;" : '';
37
37
  });
38
38
  export var VolumeTimeRangeWrapper = styled.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n width: 100%;\n margin-right: ", ";\n"])), "var(--ds-space-250, 20px)");
39
39
 
40
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
40
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
41
41
  export var MutedIndicator = styled.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n width: 29px;\n height: 2px;\n position: absolute;\n top: 10px;\n left: 9px;\n z-index: 2;\n background: ", ";\n transform: rotate(32deg) translateY(10px);\n opacity: 0;\n pointer-events: none;\n\n ", ";\n"])), R300, function (props) {
42
42
  return props.isMuted ? "\n opacity: 1;\n " : '';
43
43
  });
44
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
44
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
45
45
  export var CurrentTimeTooltip = styled.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n position: absolute;\n user-select: none;\n top: -28px;\n background-color: #182c4c;\n color: #eff1f3;\n font-size: 12px;\n padding: 3px 7px;\n border-radius: 3px;\n left: 50%;\n transform: translateX(-50%);\n opacity: ", ";\n transition: opacity 0.3s;\n word-break: keep-all;\n"])), function (props) {
46
46
  return props.isDragging ? '1' : '0';
47
47
  });
@@ -23,6 +23,7 @@ export default {
23
23
  'fabric.media.annotate.tool.text': 'Text',
24
24
  'fabric.media.archive': 'archive',
25
25
  'fabric.media.audio': 'audio',
26
+ 'fabric.media.avatar_picker_back_btn_label': 'Go Back',
26
27
  'fabric.media.cancel': 'Cancel',
27
28
  'fabric.media.cant_preview_file_type': "We can't preview this file type.",
28
29
  'fabric.media.cant_retrieve_files': 'Ouch! We could not retrieve any files',
@@ -23,6 +23,7 @@ export default {
23
23
  'fabric.media.annotate.tool.text': 'Text',
24
24
  'fabric.media.archive': 'archive',
25
25
  'fabric.media.audio': 'audio',
26
+ 'fabric.media.avatar_picker_back_btn_label': 'Go Back',
26
27
  'fabric.media.cancel': 'Cancel',
27
28
  'fabric.media.cant_preview_file_type': "We can't preview this file type.",
28
29
  'fabric.media.cant_retrieve_files': 'Ouch! We could not retrieve any files',
@@ -23,6 +23,7 @@ export default {
23
23
  'fabric.media.annotate.tool.text': '⁣⁢Text⁡⁡⁠⁠⁡؜‌‌‍⁡⁠‌‍⁣⁤',
24
24
  'fabric.media.archive': '⁣⁢archive‌⁡‌‍‍‌؜⁡⁠⁣⁤',
25
25
  'fabric.media.audio': '⁣⁢audio‍⁡⁡؜⁡⁣⁤',
26
+ 'fabric.media.avatar_picker_back_btn_label': '⁣⁢Go Back؜⁡‌‌⁡⁡⁠‌‌⁣⁤',
26
27
  'fabric.media.cancel': '⁣⁢Cancel‌‍؜⁠‍؜‌‌⁠⁡⁣⁤',
27
28
  'fabric.media.cant_preview_file_type': "⁣⁢We can't preview this file type.⁠‍‌⁡⁡‍؜‍⁠؜⁣⁤",
28
29
  'fabric.media.cant_retrieve_files': '⁣⁢Ouch! We could not retrieve any files⁠‍؜؜‌؜⁡‌⁡؜⁠⁣⁤',
@@ -261,6 +261,16 @@ export var MediaImage = /*#__PURE__*/function (_Component) {
261
261
  }
262
262
  }
263
263
 
264
+ /*
265
+ For images with borders, there may be an intermittent gap between the image and the border due to weird browser behaviour.
266
+ Part of the solution is to expand the image equally in all directions (width & height) by 1px, and the below calculation is to ensure just that.
267
+ Read more: https://product-fabric.atlassian.net/browse/MEX-2481
268
+ */
269
+
270
+ if (this.props.expandByPixel !== undefined) {
271
+ percentSize = "calc(".concat(percentSize, " + ").concat(this.props.expandByPixel, "px)");
272
+ }
273
+
264
274
  /*
265
275
  When isStretchingAllowed is false image is as big as it is, but as small as container
266
276
  (according to strategy - cover or fit).
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-ui",
3
- "version": "23.1.0",
3
+ "version": "23.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -37,6 +37,7 @@ export declare class CustomMediaPlayerBase extends Component<CustomMediaPlayerPr
37
37
  private clickToTogglePlayTimoutId;
38
38
  state: CustomMediaPlayerState;
39
39
  componentDidMount(): void;
40
+ private fireFirstPlayedTrackEvent;
40
41
  componentWillUnmount(): void;
41
42
  private onFullScreenChange;
42
43
  private onTimeChanged;
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  'fabric.media.annotate.tool.text': string;
22
22
  'fabric.media.archive': string;
23
23
  'fabric.media.audio': string;
24
+ 'fabric.media.avatar_picker_back_btn_label': string;
24
25
  'fabric.media.cancel': string;
25
26
  'fabric.media.cant_preview_file_type': string;
26
27
  'fabric.media.cant_retrieve_files': string;
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  'fabric.media.annotate.tool.text': string;
22
22
  'fabric.media.archive': string;
23
23
  'fabric.media.audio': string;
24
+ 'fabric.media.avatar_picker_back_btn_label': string;
24
25
  'fabric.media.cancel': string;
25
26
  'fabric.media.cant_preview_file_type': string;
26
27
  'fabric.media.cant_retrieve_files': string;
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  'fabric.media.annotate.tool.text': string;
22
22
  'fabric.media.archive': string;
23
23
  'fabric.media.audio': string;
24
+ 'fabric.media.avatar_picker_back_btn_label': string;
24
25
  'fabric.media.cancel': string;
25
26
  'fabric.media.cant_preview_file_type': string;
26
27
  'fabric.media.cant_retrieve_files': string;
@@ -11,6 +11,7 @@ export interface MediaImageProps {
11
11
  onImageError?: () => void;
12
12
  loading?: 'auto' | 'lazy' | 'eager';
13
13
  forceSyncDisplay?: boolean;
14
+ expandByPixel?: number;
14
15
  }
15
16
  export interface MediaImageState {
16
17
  isImageLoaded: boolean;
@@ -37,6 +37,7 @@ export declare class CustomMediaPlayerBase extends Component<CustomMediaPlayerPr
37
37
  private clickToTogglePlayTimoutId;
38
38
  state: CustomMediaPlayerState;
39
39
  componentDidMount(): void;
40
+ private fireFirstPlayedTrackEvent;
40
41
  componentWillUnmount(): void;
41
42
  private onFullScreenChange;
42
43
  private onTimeChanged;
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  'fabric.media.annotate.tool.text': string;
22
22
  'fabric.media.archive': string;
23
23
  'fabric.media.audio': string;
24
+ 'fabric.media.avatar_picker_back_btn_label': string;
24
25
  'fabric.media.cancel': string;
25
26
  'fabric.media.cant_preview_file_type': string;
26
27
  'fabric.media.cant_retrieve_files': string;
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  'fabric.media.annotate.tool.text': string;
22
22
  'fabric.media.archive': string;
23
23
  'fabric.media.audio': string;
24
+ 'fabric.media.avatar_picker_back_btn_label': string;
24
25
  'fabric.media.cancel': string;
25
26
  'fabric.media.cant_preview_file_type': string;
26
27
  'fabric.media.cant_retrieve_files': string;
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  'fabric.media.annotate.tool.text': string;
22
22
  'fabric.media.archive': string;
23
23
  'fabric.media.audio': string;
24
+ 'fabric.media.avatar_picker_back_btn_label': string;
24
25
  'fabric.media.cancel': string;
25
26
  'fabric.media.cant_preview_file_type': string;
26
27
  'fabric.media.cant_retrieve_files': string;
@@ -11,6 +11,7 @@ export interface MediaImageProps {
11
11
  onImageError?: () => void;
12
12
  loading?: 'auto' | 'lazy' | 'eager';
13
13
  forceSyncDisplay?: boolean;
14
+ expandByPixel?: number;
14
15
  }
15
16
  export interface MediaImageState {
16
17
  isImageLoaded: boolean;
@@ -16,7 +16,7 @@ export const PreviewInfo = styled.pre`
16
16
  font-size: 80%;
17
17
  `;
18
18
 
19
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
19
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
20
20
  export const PreviewItem = styled.li`
21
21
  border-radius: 10px;
22
22
  border: 1px solid ${token('color.border', '#ccc')};
@@ -27,7 +27,7 @@ export const PreviewItem = styled.li`
27
27
  margin-bottom: 10px;
28
28
  `;
29
29
 
30
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
30
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
31
31
  export const Code = styled.code`
32
32
  padding: 5px;
33
33
  border-radius: 5px;
@@ -36,7 +36,7 @@ export const Code = styled.code`
36
36
  font-size: 80%;
37
37
  `;
38
38
 
39
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
39
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
40
40
  export const CloseButton = styled.button`
41
41
  position: absolute;
42
42
  top: 5px;
@@ -44,7 +44,7 @@ export const CloseButton = styled.button`
44
44
  cursor: pointer;
45
45
  `;
46
46
 
47
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
47
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
48
48
  export const PreviewImageContainer = styled.div`
49
49
  margin-top: 10px;
50
50
  margin-bottom: 10px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-ui",
3
- "version": "23.1.0",
3
+ "version": "23.2.0",
4
4
  "description": "Includes common components and utilities used by other media packages",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,32 +12,8 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.5 <4.9": {
17
- "*": [
18
- "dist/types-ts4.5/*",
19
- "dist/types-ts4.5/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": false,
24
16
  "atlaskit:src": "src/index.ts",
25
- "af:exports": {
26
- "./classNames": "./src/classNames.ts",
27
- "./media-type-icon": "./src/media-type-icon.tsx",
28
- "./mime-type-icon": "./src/mime-type-icon.tsx",
29
- "./truncateText": "./src/truncateText.tsx",
30
- "./messages": "./src/messages.ts",
31
- "./modalSpinner": "./src/modalSpinner.tsx",
32
- "./browser": "./src/browser.tsx",
33
- "./codeViewer": "./src/codeViewer.ts",
34
- "./util": "./src/util.ts",
35
- "./errorIcon": "./src/errorIcon.tsx",
36
- "./types": "./src/types.ts",
37
- "./formatDate": "./src/formatDate.ts",
38
- "./locales": "./src/locales.ts",
39
- ".": "./src/index.ts"
40
- },
41
17
  "atlassian": {
42
18
  "team": "Media Experience",
43
19
  "inPublicMirror": true,
@@ -53,11 +29,11 @@
53
29
  "@atlaskit/icon": "^21.12.0",
54
30
  "@atlaskit/icon-file-type": "^6.4.0",
55
31
  "@atlaskit/locale": "^2.5.0",
56
- "@atlaskit/media-common": "^7.0.0",
32
+ "@atlaskit/media-common": "^7.1.0",
57
33
  "@atlaskit/select": "^16.5.0",
58
34
  "@atlaskit/spinner": "^15.5.0",
59
35
  "@atlaskit/theme": "^12.5.0",
60
- "@atlaskit/tokens": "^1.9.0",
36
+ "@atlaskit/tokens": "^1.11.0",
61
37
  "@atlaskit/tooltip": "^17.8.0",
62
38
  "@atlaskit/width-detector": "^4.1.0",
63
39
  "@babel/runtime": "^7.0.0",
@@ -75,12 +51,10 @@
75
51
  "react-intl-next": "npm:react-intl@^5.18.1"
76
52
  },
77
53
  "devDependencies": {
54
+ "@af/visual-regression": "*",
78
55
  "@atlaskit/analytics-listeners": "^8.7.0",
79
56
  "@atlaskit/button": "^16.8.0",
80
- "@atlaskit/docs": "*",
81
- "@atlaskit/lozenge": "^11.4.0",
82
57
  "@atlaskit/media-test-helpers": "^33.0.0",
83
- "@atlaskit/page": "^12.3.0",
84
58
  "@atlaskit/ssr": "*",
85
59
  "@atlaskit/visual-regression": "*",
86
60
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -111,5 +85,29 @@
111
85
  ]
112
86
  }
113
87
  },
88
+ "typesVersions": {
89
+ ">=4.5 <4.9": {
90
+ "*": [
91
+ "dist/types-ts4.5/*",
92
+ "dist/types-ts4.5/index.d.ts"
93
+ ]
94
+ }
95
+ },
96
+ "af:exports": {
97
+ "./classNames": "./src/classNames.ts",
98
+ "./media-type-icon": "./src/media-type-icon.tsx",
99
+ "./mime-type-icon": "./src/mime-type-icon.tsx",
100
+ "./truncateText": "./src/truncateText.tsx",
101
+ "./messages": "./src/messages.ts",
102
+ "./modalSpinner": "./src/modalSpinner.tsx",
103
+ "./browser": "./src/browser.tsx",
104
+ "./codeViewer": "./src/codeViewer.ts",
105
+ "./util": "./src/util.ts",
106
+ "./errorIcon": "./src/errorIcon.tsx",
107
+ "./types": "./src/types.ts",
108
+ "./formatDate": "./src/formatDate.ts",
109
+ "./locales": "./src/locales.ts",
110
+ ".": "./src/index.ts"
111
+ },
114
112
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
115
113
  }
package/report.api.md CHANGED
@@ -439,6 +439,8 @@ export interface MediaImageProps {
439
439
  // (undocumented)
440
440
  dataURI: string;
441
441
  // (undocumented)
442
+ expandByPixel?: number;
443
+ // (undocumented)
442
444
  forceSyncDisplay?: boolean;
443
445
  // (undocumented)
444
446
  loading?: 'auto' | 'eager' | 'lazy';
@@ -377,6 +377,8 @@ export interface MediaImageProps {
377
377
  // (undocumented)
378
378
  dataURI: string;
379
379
  // (undocumented)
380
+ expandByPixel?: number;
381
+ // (undocumented)
380
382
  forceSyncDisplay?: boolean;
381
383
  // (undocumented)
382
384
  loading?: 'auto' | 'eager' | 'lazy';