@atlaskit/media-viewer 54.12.15 → 54.12.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +6 -4
- package/CHANGELOG.md +24 -0
- package/dist/cjs/DownloadItem.js +3 -2
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/insetViewerContext.js +34 -6
- package/dist/cjs/styleWrappers.compiled.css +6 -0
- package/dist/cjs/styleWrappers.js +82 -37
- package/dist/cjs/viewers/archiveSidebar/archive-download-button-wrapper.compiled.css +7 -1
- package/dist/cjs/viewers/archiveSidebar/archive-download-button-wrapper.js +6 -1
- package/dist/cjs/viewers/archiveSidebar/archive-layout.js +18 -2
- package/dist/cjs/viewers/archiveSidebar/archive-sidebar-file-entry-wrapper.compiled.css +13 -2
- package/dist/cjs/viewers/archiveSidebar/archive-sidebar-file-entry-wrapper.js +10 -2
- package/dist/cjs/viewers/archiveSidebar/archive-sidebar-folder-entry.js +15 -25
- package/dist/cjs/viewers/archiveSidebar/archive-sidebar.compiled.css +3 -0
- package/dist/cjs/viewers/archiveSidebar/archive-sidebar.js +54 -24
- package/dist/cjs/viewers/archiveSidebar/archive-viewer-base.js +135 -39
- package/dist/cjs/viewers/archiveSidebar/archive-viewer-wrapper.compiled.css +5 -0
- package/dist/cjs/viewers/archiveSidebar/archive-viewer-wrapper.js +6 -1
- package/dist/cjs/viewers/archiveSidebar/archive.js +2 -1
- package/dist/cjs/viewers/archiveSidebar/archiveViewerLoader.js +8 -1
- package/dist/cjs/viewers/archiveSidebar/custom-button-item.compiled.css +10 -2
- package/dist/cjs/viewers/archiveSidebar/custom-button-item.js +15 -2
- package/dist/cjs/viewers/archiveSidebar/download-archive-entry.js +47 -0
- package/dist/cjs/viewers/archiveSidebar/nativePdfViewer.js +18 -4
- package/dist/cjs/viewers/archiveSidebar/sidebar-item-wrapper.compiled.css +6 -1
- package/dist/cjs/viewers/archiveSidebar/sidebar-item-wrapper.js +4 -1
- package/dist/cjs/viewers/archiveSidebar/styleWrappers.compiled.css +9 -0
- package/dist/cjs/viewers/archiveSidebar/styleWrappers.js +30 -2
- package/dist/cjs/viewers/audio.js +41 -53
- package/dist/cjs/viewers/inset-audio-frame.js +42 -0
- package/dist/cjs/viewers/inset-video-frame.js +88 -0
- package/dist/cjs/viewers/video.js +77 -136
- package/dist/es2019/DownloadItem.js +3 -2
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/insetViewerContext.js +25 -6
- package/dist/es2019/styleWrappers.compiled.css +6 -0
- package/dist/es2019/styleWrappers.js +44 -8
- package/dist/es2019/viewers/archiveSidebar/archive-download-button-wrapper.compiled.css +7 -1
- package/dist/es2019/viewers/archiveSidebar/archive-download-button-wrapper.js +6 -1
- package/dist/es2019/viewers/archiveSidebar/archive-layout.js +16 -1
- package/dist/es2019/viewers/archiveSidebar/archive-sidebar-file-entry-wrapper.compiled.css +13 -2
- package/dist/es2019/viewers/archiveSidebar/archive-sidebar-file-entry-wrapper.js +10 -2
- package/dist/es2019/viewers/archiveSidebar/archive-sidebar-folder-entry.js +14 -23
- package/dist/es2019/viewers/archiveSidebar/archive-sidebar.compiled.css +3 -0
- package/dist/es2019/viewers/archiveSidebar/archive-sidebar.js +37 -7
- package/dist/es2019/viewers/archiveSidebar/archive-viewer-base.js +98 -29
- package/dist/es2019/viewers/archiveSidebar/archive-viewer-wrapper.compiled.css +5 -0
- package/dist/es2019/viewers/archiveSidebar/archive-viewer-wrapper.js +6 -1
- package/dist/es2019/viewers/archiveSidebar/archive.js +2 -1
- package/dist/es2019/viewers/archiveSidebar/archiveViewerLoader.js +6 -1
- package/dist/es2019/viewers/archiveSidebar/custom-button-item.compiled.css +10 -2
- package/dist/es2019/viewers/archiveSidebar/custom-button-item.js +14 -1
- package/dist/es2019/viewers/archiveSidebar/download-archive-entry.js +21 -0
- package/dist/es2019/viewers/archiveSidebar/nativePdfViewer.js +15 -3
- package/dist/es2019/viewers/archiveSidebar/sidebar-item-wrapper.compiled.css +6 -1
- package/dist/es2019/viewers/archiveSidebar/sidebar-item-wrapper.js +4 -1
- package/dist/es2019/viewers/archiveSidebar/styleWrappers.compiled.css +9 -0
- package/dist/es2019/viewers/archiveSidebar/styleWrappers.js +27 -1
- package/dist/es2019/viewers/audio.js +33 -40
- package/dist/es2019/viewers/inset-audio-frame.js +35 -0
- package/dist/es2019/viewers/inset-video-frame.js +80 -0
- package/dist/es2019/viewers/video.js +71 -126
- package/dist/esm/DownloadItem.js +3 -2
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/insetViewerContext.js +34 -6
- package/dist/esm/styleWrappers.compiled.css +6 -0
- package/dist/esm/styleWrappers.js +82 -37
- package/dist/esm/viewers/archiveSidebar/archive-download-button-wrapper.compiled.css +7 -1
- package/dist/esm/viewers/archiveSidebar/archive-download-button-wrapper.js +6 -1
- package/dist/esm/viewers/archiveSidebar/archive-layout.js +18 -1
- package/dist/esm/viewers/archiveSidebar/archive-sidebar-file-entry-wrapper.compiled.css +13 -2
- package/dist/esm/viewers/archiveSidebar/archive-sidebar-file-entry-wrapper.js +10 -2
- package/dist/esm/viewers/archiveSidebar/archive-sidebar-folder-entry.js +15 -25
- package/dist/esm/viewers/archiveSidebar/archive-sidebar.compiled.css +3 -0
- package/dist/esm/viewers/archiveSidebar/archive-sidebar.js +54 -24
- package/dist/esm/viewers/archiveSidebar/archive-viewer-base.js +138 -41
- package/dist/esm/viewers/archiveSidebar/archive-viewer-wrapper.compiled.css +5 -0
- package/dist/esm/viewers/archiveSidebar/archive-viewer-wrapper.js +6 -1
- package/dist/esm/viewers/archiveSidebar/archive.js +2 -1
- package/dist/esm/viewers/archiveSidebar/archiveViewerLoader.js +8 -1
- package/dist/esm/viewers/archiveSidebar/custom-button-item.compiled.css +10 -2
- package/dist/esm/viewers/archiveSidebar/custom-button-item.js +15 -2
- package/dist/esm/viewers/archiveSidebar/download-archive-entry.js +41 -0
- package/dist/esm/viewers/archiveSidebar/nativePdfViewer.js +17 -3
- package/dist/esm/viewers/archiveSidebar/sidebar-item-wrapper.compiled.css +6 -1
- package/dist/esm/viewers/archiveSidebar/sidebar-item-wrapper.js +4 -1
- package/dist/esm/viewers/archiveSidebar/styleWrappers.compiled.css +9 -0
- package/dist/esm/viewers/archiveSidebar/styleWrappers.js +29 -1
- package/dist/esm/viewers/audio.js +42 -54
- package/dist/esm/viewers/inset-audio-frame.js +36 -0
- package/dist/esm/viewers/inset-video-frame.js +81 -0
- package/dist/esm/viewers/video.js +78 -137
- package/dist/types/DownloadItem.d.ts +1 -1
- package/dist/types/DownloadItemProps.d.ts +1 -0
- package/dist/types/insetViewerContext.d.ts +3 -2
- package/dist/types/styleWrappers.d.ts +4 -0
- package/dist/types/viewers/archiveSidebar/archive-sidebar-file-entry-wrapper.d.ts +2 -1
- package/dist/types/viewers/archiveSidebar/archive-sidebar-folder-entry.d.ts +2 -4
- package/dist/types/viewers/archiveSidebar/archive-sidebar.d.ts +2 -8
- package/dist/types/viewers/archiveSidebar/archive-viewer-base.d.ts +4 -1
- package/dist/types/viewers/archiveSidebar/custom-button-item.d.ts +1 -1
- package/dist/types/viewers/archiveSidebar/download-archive-entry.d.ts +2 -0
- package/dist/types/viewers/archiveSidebar/nativePdfViewer.d.ts +1 -0
- package/dist/types/viewers/archiveSidebar/styleWrappers.d.ts +1 -0
- package/dist/types/viewers/inset-audio-frame.d.ts +11 -0
- package/dist/types/viewers/inset-video-frame.d.ts +11 -0
- package/package.json +6 -6
|
@@ -11,31 +11,27 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
15
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
16
|
var _react = _interopRequireDefault(require("react"));
|
|
18
17
|
var _mediaClient = require("@atlaskit/media-client");
|
|
19
18
|
var _artifacts = require("@atlaskit/media-client/artifacts");
|
|
20
19
|
var _globalMediaEventEmitter = require("@atlaskit/media-client/global-media-event-emitter");
|
|
21
|
-
var _camera = require("@atlaskit/media-ui/camera/camera");
|
|
22
20
|
var _customMediaPlayer = require("@atlaskit/media-ui/customMediaPlayer");
|
|
23
21
|
var _insetViewerProvider = require("@atlaskit/media-ui/insetViewerProvider");
|
|
24
22
|
var _mediaPlayer = require("@atlaskit/media-ui/mediaPlayer");
|
|
25
|
-
var _rectangle = require("@atlaskit/media-ui/rectangle");
|
|
26
23
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
27
24
|
var _buildVideoErrorDiagnostics = require("../buildVideoErrorDiagnostics");
|
|
28
25
|
var _outcome = require("../domain/outcome");
|
|
29
26
|
var _insetViewerContext = require("../insetViewerContext");
|
|
30
27
|
var _MediaViewerError = require("../MediaViewerError");
|
|
31
28
|
var _styleWrappers = require("../styleWrappers");
|
|
32
|
-
var _fitViewport = require("../utils/fit-viewport");
|
|
33
29
|
var _getObjectUrlFromFileState = require("../utils/getObjectUrlFromFileState");
|
|
34
30
|
var _isIE = require("../utils/isIE");
|
|
35
31
|
var _baseViewer = require("./base-viewer");
|
|
32
|
+
var _insetVideoFrame = require("./inset-video-frame");
|
|
36
33
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
37
34
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
38
|
-
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
39
35
|
var hdArtifact = 'video_1280.mp4';
|
|
40
36
|
var sdArtifact = 'video_640.mp4';
|
|
41
37
|
var _VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
@@ -46,9 +42,6 @@ var _VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
46
42
|
args[_key] = arguments[_key];
|
|
47
43
|
}
|
|
48
44
|
_this = _callSuper(this, _VideoViewer, [].concat(args));
|
|
49
|
-
(0, _defineProperty2.default)(_this, "insetVideoFrame", null);
|
|
50
|
-
(0, _defineProperty2.default)(_this, "insetVideo", null);
|
|
51
|
-
(0, _defineProperty2.default)(_this, "insetVideoResizeObserver", null);
|
|
52
45
|
(0, _defineProperty2.default)(_this, "onFirstPlay", function () {
|
|
53
46
|
var _this$props = _this.props,
|
|
54
47
|
item = _this$props.item,
|
|
@@ -82,111 +75,15 @@ var _VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
82
75
|
}
|
|
83
76
|
onError && onError(new _MediaViewerError.MediaViewerError('videoviewer-playback', secondaryError));
|
|
84
77
|
});
|
|
85
|
-
(0, _defineProperty2.default)(_this, "
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
var viewport = (0, _fitViewport.insetFittedViewport)(wrapper);
|
|
93
|
-
if (viewport.width <= 0 || viewport.height <= 0) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
var camera = new _camera.Camera(viewport, new _rectangle.Rectangle(video.videoWidth, video.videoHeight));
|
|
97
|
-
var nextSize = camera.scaledImg(camera.scaleToFit);
|
|
98
|
-
frame.style.width = "".concat(nextSize.width, "px");
|
|
99
|
-
frame.style.height = "".concat(nextSize.height, "px");
|
|
100
|
-
});
|
|
101
|
-
(0, _defineProperty2.default)(_this, "unbindInsetVideoSize", function () {
|
|
102
|
-
var _this$insetVideo, _this$insetVideoResiz;
|
|
103
|
-
(_this$insetVideo = _this.insetVideo) === null || _this$insetVideo === void 0 || _this$insetVideo.removeEventListener('loadedmetadata', _this.updateInsetVideoSize);
|
|
104
|
-
(_this$insetVideoResiz = _this.insetVideoResizeObserver) === null || _this$insetVideoResiz === void 0 || _this$insetVideoResiz.disconnect();
|
|
105
|
-
_this.insetVideoResizeObserver = null;
|
|
106
|
-
});
|
|
107
|
-
(0, _defineProperty2.default)(_this, "bindInsetVideoSize", function () {
|
|
108
|
-
var frame = _this.insetVideoFrame;
|
|
109
|
-
var wrapper = frame === null || frame === void 0 ? void 0 : frame.parentElement;
|
|
110
|
-
var video = _this.insetVideo;
|
|
111
|
-
if (!wrapper || !frame || !video) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
video.addEventListener('loadedmetadata', _this.updateInsetVideoSize);
|
|
115
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
116
|
-
_this.insetVideoResizeObserver = new ResizeObserver(_this.updateInsetVideoSize);
|
|
117
|
-
_this.insetVideoResizeObserver.observe(wrapper);
|
|
118
|
-
}
|
|
119
|
-
_this.updateInsetVideoSize();
|
|
120
|
-
});
|
|
121
|
-
(0, _defineProperty2.default)(_this, "setInsetVideo", function (video) {
|
|
122
|
-
_this.unbindInsetVideoSize();
|
|
123
|
-
_this.insetVideo = video;
|
|
124
|
-
_this.bindInsetVideoSize();
|
|
125
|
-
});
|
|
126
|
-
(0, _defineProperty2.default)(_this, "setInsetVideoFrame", function (frame) {
|
|
127
|
-
_this.unbindInsetVideoSize();
|
|
128
|
-
_this.insetVideoFrame = frame;
|
|
129
|
-
_this.bindInsetVideoSize();
|
|
130
|
-
});
|
|
131
|
-
return _this;
|
|
132
|
-
}
|
|
133
|
-
(0, _inherits2.default)(_VideoViewer, _BaseViewer);
|
|
134
|
-
return (0, _createClass2.default)(_VideoViewer, [{
|
|
135
|
-
key: "componentDidMount",
|
|
136
|
-
value: function componentDidMount() {
|
|
137
|
-
_superPropGet(_VideoViewer, "componentDidMount", this, 3)([]);
|
|
138
|
-
if (this.props.isInsetViewer) {
|
|
139
|
-
var _this$props$setHasPla, _this$props3;
|
|
140
|
-
(_this$props$setHasPla = (_this$props3 = this.props).setHasPlayerControls) === null || _this$props$setHasPla === void 0 || _this$props$setHasPla.call(_this$props3, true);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}, {
|
|
144
|
-
key: "componentWillUnmount",
|
|
145
|
-
value: function componentWillUnmount() {
|
|
146
|
-
if (this.props.isInsetViewer) {
|
|
147
|
-
var _this$props$setHasPla2, _this$props4;
|
|
148
|
-
(_this$props$setHasPla2 = (_this$props4 = this.props).setHasPlayerControls) === null || _this$props$setHasPla2 === void 0 || _this$props$setHasPla2.call(_this$props4, false);
|
|
149
|
-
}
|
|
150
|
-
_superPropGet(_VideoViewer, "componentWillUnmount", this, 3)([]);
|
|
151
|
-
}
|
|
152
|
-
}, {
|
|
153
|
-
key: "initialState",
|
|
154
|
-
get: function get() {
|
|
155
|
-
return {
|
|
156
|
-
content: _outcome.Outcome.pending()
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
}, {
|
|
160
|
-
key: "renderSuccessful",
|
|
161
|
-
value: function renderSuccessful(content) {
|
|
162
|
-
var _this$props5 = this.props,
|
|
163
|
-
item = _this$props5.item,
|
|
164
|
-
showControls = _this$props5.showControls,
|
|
165
|
-
previewCount = _this$props5.previewCount,
|
|
166
|
-
identifier = _this$props5.identifier,
|
|
167
|
-
isInsetViewer = _this$props5.isInsetViewer,
|
|
168
|
-
mediaFooterControls = _this$props5.mediaFooterControls;
|
|
169
|
-
var useCustomVideoPlayer = !(0, _isIE.isIE)();
|
|
78
|
+
(0, _defineProperty2.default)(_this, "renderPlayer", function (content, controlsPortalElement, onVideoElementChange) {
|
|
79
|
+
var _this$props3 = _this.props,
|
|
80
|
+
item = _this$props3.item,
|
|
81
|
+
showControls = _this$props3.showControls,
|
|
82
|
+
previewCount = _this$props3.previewCount,
|
|
83
|
+
identifier = _this$props3.identifier;
|
|
170
84
|
var isAutoPlay = previewCount === 0;
|
|
171
85
|
var hdAvailable = isHDAvailable(item);
|
|
172
|
-
|
|
173
|
-
if (!isInsetViewer) {
|
|
174
|
-
return /*#__PURE__*/_react.default.createElement(_styleWrappers.Video, {
|
|
175
|
-
autoPlay: isAutoPlay,
|
|
176
|
-
controls: true,
|
|
177
|
-
src: content
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
return /*#__PURE__*/_react.default.createElement(_styleWrappers.CustomMediaPlayerWrapper, null, /*#__PURE__*/_react.default.createElement(_styleWrappers.FittedVideoFrame, {
|
|
181
|
-
ref: this.setInsetVideoFrame
|
|
182
|
-
}, /*#__PURE__*/_react.default.createElement(_styleWrappers.Video, {
|
|
183
|
-
autoPlay: isAutoPlay,
|
|
184
|
-
controls: true,
|
|
185
|
-
src: content,
|
|
186
|
-
onVideoElementChange: this.setInsetVideo
|
|
187
|
-
})));
|
|
188
|
-
}
|
|
189
|
-
var playerElement = (0, _mediaClient.isFileIdentifier)(identifier) && (0, _fg.fg)('platform_media_video_captions') ? /*#__PURE__*/_react.default.createElement(_mediaPlayer.MediaPlayer, {
|
|
86
|
+
return (0, _mediaClient.isFileIdentifier)(identifier) && (0, _fg.fg)('platform_media_video_captions') ? /*#__PURE__*/_react.default.createElement(_mediaPlayer.MediaPlayer, {
|
|
190
87
|
identifier: identifier,
|
|
191
88
|
type: "video",
|
|
192
89
|
isAutoPlay: isAutoPlay,
|
|
@@ -195,12 +92,12 @@ var _VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
195
92
|
isHDActive: hdAvailable,
|
|
196
93
|
isHDAvailable: hdAvailable,
|
|
197
94
|
isShortcutEnabled: true,
|
|
198
|
-
onFirstPlay:
|
|
199
|
-
onError:
|
|
200
|
-
onPlay:
|
|
201
|
-
onTimeChanged:
|
|
202
|
-
controlsPortalElement:
|
|
203
|
-
onVideoElementChange:
|
|
95
|
+
onFirstPlay: _this.onFirstPlay,
|
|
96
|
+
onError: _this.onError,
|
|
97
|
+
onPlay: _this.onPlay,
|
|
98
|
+
onTimeChanged: _this.onTimeChanged,
|
|
99
|
+
controlsPortalElement: controlsPortalElement,
|
|
100
|
+
onVideoElementChange: onVideoElementChange,
|
|
204
101
|
lastWatchTimeConfig: {
|
|
205
102
|
contentId: item.id
|
|
206
103
|
}
|
|
@@ -213,34 +110,82 @@ var _VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
213
110
|
isHDActive: hdAvailable,
|
|
214
111
|
isHDAvailable: hdAvailable,
|
|
215
112
|
isShortcutEnabled: true,
|
|
216
|
-
onFirstPlay:
|
|
217
|
-
onError:
|
|
218
|
-
onPlay:
|
|
219
|
-
onTimeChanged:
|
|
220
|
-
controlsPortalElement:
|
|
221
|
-
onVideoElementChange:
|
|
113
|
+
onFirstPlay: _this.onFirstPlay,
|
|
114
|
+
onError: _this.onError,
|
|
115
|
+
onPlay: _this.onPlay,
|
|
116
|
+
onTimeChanged: _this.onTimeChanged,
|
|
117
|
+
controlsPortalElement: controlsPortalElement,
|
|
118
|
+
onVideoElementChange: onVideoElementChange,
|
|
222
119
|
lastWatchTimeConfig: {
|
|
223
120
|
contentId: item.id
|
|
224
121
|
}
|
|
225
122
|
});
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
123
|
+
});
|
|
124
|
+
return _this;
|
|
125
|
+
}
|
|
126
|
+
(0, _inherits2.default)(_VideoViewer, _BaseViewer);
|
|
127
|
+
return (0, _createClass2.default)(_VideoViewer, [{
|
|
128
|
+
key: "initialState",
|
|
129
|
+
get: function get() {
|
|
130
|
+
return {
|
|
131
|
+
content: _outcome.Outcome.pending()
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "renderSuccessful",
|
|
136
|
+
value: function renderSuccessful(content) {
|
|
137
|
+
var _this2 = this;
|
|
138
|
+
var _this$props4 = this.props,
|
|
139
|
+
previewCount = _this$props4.previewCount,
|
|
140
|
+
isInsetViewer = _this$props4.isInsetViewer,
|
|
141
|
+
mediaFooterControls = _this$props4.mediaFooterControls;
|
|
142
|
+
var useCustomVideoPlayer = !(0, _isIE.isIE)();
|
|
143
|
+
var isAutoPlay = previewCount === 0;
|
|
144
|
+
if (!useCustomVideoPlayer) {
|
|
145
|
+
if (!isInsetViewer) {
|
|
146
|
+
return /*#__PURE__*/_react.default.createElement(_styleWrappers.Video, {
|
|
147
|
+
autoPlay: isAutoPlay,
|
|
148
|
+
controls: true,
|
|
149
|
+
src: content
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement(_insetVideoFrame.InsetVideoFrame, {
|
|
153
|
+
renderPlayer: function renderPlayer(_ref) {
|
|
154
|
+
var onVideoElementChange = _ref.onVideoElementChange;
|
|
155
|
+
return /*#__PURE__*/_react.default.createElement(_styleWrappers.Video, {
|
|
156
|
+
autoPlay: isAutoPlay,
|
|
157
|
+
controls: true,
|
|
158
|
+
src: content,
|
|
159
|
+
onVideoElementChange: onVideoElementChange
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (isInsetViewer) {
|
|
165
|
+
return /*#__PURE__*/_react.default.createElement(_insetVideoFrame.InsetVideoFrame, {
|
|
166
|
+
"data-testid": "media-viewer-video-content",
|
|
167
|
+
renderPlayer: function renderPlayer(_ref2) {
|
|
168
|
+
var controlsPortalElement = _ref2.controlsPortalElement,
|
|
169
|
+
onVideoElementChange = _ref2.onVideoElementChange;
|
|
170
|
+
return _this2.renderPlayer(content, controlsPortalElement, onVideoElementChange);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
229
174
|
return /*#__PURE__*/_react.default.createElement(_styleWrappers.CustomMediaPlayerWrapper, {
|
|
230
175
|
"data-testid": "media-viewer-video-content"
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
},
|
|
176
|
+
}, /*#__PURE__*/_react.default.createElement(_insetViewerProvider.InsetViewerProvider, {
|
|
177
|
+
isInsetViewer: isInsetViewer
|
|
178
|
+
}, this.renderPlayer(content, mediaFooterControls, undefined)));
|
|
234
179
|
}
|
|
235
180
|
}, {
|
|
236
181
|
key: "init",
|
|
237
182
|
value: function () {
|
|
238
183
|
var _init = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
239
|
-
var _this$
|
|
184
|
+
var _this$props5, mediaClient, item, collectionName, contentUrl, preferredArtifact, _t;
|
|
240
185
|
return _regenerator.default.wrap(function (_context) {
|
|
241
186
|
while (1) switch (_context.prev = _context.next) {
|
|
242
187
|
case 0:
|
|
243
|
-
_this$
|
|
188
|
+
_this$props5 = this.props, mediaClient = _this$props5.mediaClient, item = _this$props5.item, collectionName = _this$props5.collectionName;
|
|
244
189
|
_context.prev = 1;
|
|
245
190
|
if (!(item.status === 'processed')) {
|
|
246
191
|
_context.next = 7;
|
|
@@ -315,11 +260,7 @@ var _VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
315
260
|
}()
|
|
316
261
|
}, {
|
|
317
262
|
key: "release",
|
|
318
|
-
value: function release() {
|
|
319
|
-
this.unbindInsetVideoSize();
|
|
320
|
-
this.insetVideo = null;
|
|
321
|
-
this.insetVideoFrame = null;
|
|
322
|
-
}
|
|
263
|
+
value: function release() {}
|
|
323
264
|
}]);
|
|
324
265
|
}(_baseViewer.BaseViewer);
|
|
325
266
|
function isHDAvailable(file) {
|
|
@@ -16,7 +16,8 @@ export const DownloadItem = ({
|
|
|
16
16
|
iconBefore,
|
|
17
17
|
variant,
|
|
18
18
|
children,
|
|
19
|
-
fallbackMediaName
|
|
19
|
+
fallbackMediaName,
|
|
20
|
+
onDownload
|
|
20
21
|
}) => {
|
|
21
22
|
const [isAbuseModalOpen, setIsAbuseModalOpen] = useState(false);
|
|
22
23
|
const {
|
|
@@ -27,7 +28,7 @@ export const DownloadItem = ({
|
|
|
27
28
|
tooltip
|
|
28
29
|
} = useDownloadButtonDisabledProps(mediaClient);
|
|
29
30
|
const shouldRenderAbuseModal = !isErrorFileState(fileState) && !!fileState.abuseClassification;
|
|
30
|
-
const itemDownloader = createItemDownloader(fileState, mediaClient, {
|
|
31
|
+
const itemDownloader = onDownload !== null && onDownload !== void 0 ? onDownload : createItemDownloader(fileState, mediaClient, {
|
|
31
32
|
collectionName: collectionName,
|
|
32
33
|
createAnalyticsEvent,
|
|
33
34
|
traceContext,
|
|
@@ -4,7 +4,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
|
4
4
|
import { UFOExperience } from '@atlaskit/ufo/experience';
|
|
5
5
|
import { ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo/experience-types';
|
|
6
6
|
const packageName = "@atlaskit/media-viewer";
|
|
7
|
-
const packageVersion = "54.12.
|
|
7
|
+
const packageVersion = "54.12.16";
|
|
8
8
|
let ufoExperience;
|
|
9
9
|
const getExperience = () => {
|
|
10
10
|
if (!ufoExperience) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { createContext, useContext, useState } from 'react';
|
|
2
|
+
import React, { createContext, useContext, useLayoutEffect, useState } from 'react';
|
|
3
3
|
const InsetViewerContext = /*#__PURE__*/createContext(false);
|
|
4
4
|
|
|
5
5
|
// The inset media footer element, once mounted, so controls can portal into it.
|
|
@@ -9,12 +9,17 @@ const SetMediaFooterControlsContext = /*#__PURE__*/createContext(() => {});
|
|
|
9
9
|
// Whether a viewer has registered video controls in the footer, which gives the footer extra room.
|
|
10
10
|
const HasMediaFooterPlayerControlsContext = /*#__PURE__*/createContext(false);
|
|
11
11
|
const SetHasMediaFooterPlayerControlsContext = /*#__PURE__*/createContext(() => {});
|
|
12
|
+
|
|
13
|
+
// Whether a zip file's list is showing, so the header and footer can continue its column.
|
|
14
|
+
const HasArchiveColumnContext = /*#__PURE__*/createContext(false);
|
|
15
|
+
const SetHasArchiveColumnContext = /*#__PURE__*/createContext(() => {});
|
|
12
16
|
export const InsetViewerProvider = ({
|
|
13
17
|
isInsetViewer = false,
|
|
14
18
|
children
|
|
15
19
|
}) => {
|
|
16
20
|
const [mediaFooterControls, setMediaFooterControls] = useState(null);
|
|
17
21
|
const [hasPlayerControls, setHasPlayerControls] = useState(false);
|
|
22
|
+
const [hasArchiveColumn, setHasArchiveColumn] = useState(false);
|
|
18
23
|
return /*#__PURE__*/React.createElement(InsetViewerContext.Provider, {
|
|
19
24
|
value: isInsetViewer
|
|
20
25
|
}, /*#__PURE__*/React.createElement(SetMediaFooterControlsContext.Provider, {
|
|
@@ -25,13 +30,29 @@ export const InsetViewerProvider = ({
|
|
|
25
30
|
value: setHasPlayerControls
|
|
26
31
|
}, /*#__PURE__*/React.createElement(HasMediaFooterPlayerControlsContext.Provider, {
|
|
27
32
|
value: hasPlayerControls
|
|
28
|
-
},
|
|
33
|
+
}, /*#__PURE__*/React.createElement(SetHasArchiveColumnContext.Provider, {
|
|
34
|
+
value: setHasArchiveColumn
|
|
35
|
+
}, /*#__PURE__*/React.createElement(HasArchiveColumnContext.Provider, {
|
|
36
|
+
value: hasArchiveColumn
|
|
37
|
+
}, children)))))));
|
|
29
38
|
};
|
|
30
39
|
export const useIsInsetViewer = () => useContext(InsetViewerContext);
|
|
31
40
|
export const useMediaFooterControls = () => useContext(MediaFooterControlsContext);
|
|
32
41
|
export const useSetMediaFooterControls = () => useContext(SetMediaFooterControlsContext);
|
|
33
42
|
export const useHasMediaFooterPlayerControls = () => useContext(HasMediaFooterPlayerControlsContext);
|
|
34
|
-
|
|
43
|
+
const useSetHasMediaFooterPlayerControls = () => useContext(SetHasMediaFooterPlayerControlsContext);
|
|
44
|
+
|
|
45
|
+
// Gives the footer room for player controls while the calling player is mounted. A layout effect, so
|
|
46
|
+
// one player's cleanup always runs before the next one registers.
|
|
47
|
+
export const useRegisterMediaFooterPlayerControls = () => {
|
|
48
|
+
const setHasPlayerControls = useSetHasMediaFooterPlayerControls();
|
|
49
|
+
useLayoutEffect(() => {
|
|
50
|
+
setHasPlayerControls(true);
|
|
51
|
+
return () => setHasPlayerControls(false);
|
|
52
|
+
}, [setHasPlayerControls]);
|
|
53
|
+
};
|
|
54
|
+
export const useHasArchiveColumn = () => useContext(HasArchiveColumnContext);
|
|
55
|
+
export const useSetHasArchiveColumn = () => useContext(SetHasArchiveColumnContext);
|
|
35
56
|
export const withInsetViewer = WrappedComponent => {
|
|
36
57
|
const WithInsetViewer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
37
58
|
const isInsetViewer = useIsInsetViewer();
|
|
@@ -47,12 +68,10 @@ export const withInsetViewerFooter = WrappedComponent => {
|
|
|
47
68
|
const WithInsetViewerFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
48
69
|
const isInsetViewer = useIsInsetViewer();
|
|
49
70
|
const mediaFooterControls = useMediaFooterControls();
|
|
50
|
-
const setHasPlayerControls = useSetHasMediaFooterPlayerControls();
|
|
51
71
|
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
|
|
52
72
|
ref: ref,
|
|
53
73
|
isInsetViewer: isInsetViewer,
|
|
54
|
-
mediaFooterControls: mediaFooterControls
|
|
55
|
-
setHasPlayerControls: setHasPlayerControls
|
|
74
|
+
mediaFooterControls: mediaFooterControls
|
|
56
75
|
}));
|
|
57
76
|
});
|
|
58
77
|
WithInsetViewerFooter.displayName = `WithInsetViewerFooter(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
._1bsb1osq{width:100%}
|
|
43
43
|
._1bsb1tcg{width:24px}
|
|
44
44
|
._1bsbauwl{width:100vw}
|
|
45
|
+
._1bsbe4h9{width:var(--ds-border-width,1px)}
|
|
45
46
|
._1bsbt4lq{width:calc(100% - 3pc)}
|
|
46
47
|
._1bsbyazj{width:calc(100% - 26pc)}
|
|
47
48
|
._1bsbze3t{width:var(--ds-space-0,0)}
|
|
@@ -85,13 +86,16 @@
|
|
|
85
86
|
._1ul9uuw1{min-width:200px}
|
|
86
87
|
._1vgl1rj4 >*{pointer-events:all}
|
|
87
88
|
._1vnlkb7n video{flex-shrink:1}
|
|
89
|
+
._1xi21dup{right:424px}
|
|
88
90
|
._1xi21ejb{right:var(--ds-space-300,24px)}
|
|
89
91
|
._1xi21wug{right:auto}
|
|
90
92
|
._1xi2idpf{right:0}
|
|
91
93
|
._1xi2v47k{right:var(--ds-space-250,20px)}
|
|
94
|
+
._1xi2z2kd{right:calc(25pc - var(--ds-border-width, 1px))}
|
|
92
95
|
._1y2kauwl video{width:100vw}
|
|
93
96
|
._20ka1poe._20ka1poe button:active svg{color:#c7d1db}
|
|
94
97
|
._2hwx1jfw{margin-right:var(--ds-space-500,40px)}
|
|
98
|
+
._2hwx1wug{margin-right:auto}
|
|
95
99
|
._2hwxidpf{margin-right:0}
|
|
96
100
|
._2lx21bp4{flex-direction:column}
|
|
97
101
|
._2z05i47z{grid-template-rows:minmax(0,1fr)}
|
|
@@ -119,6 +123,7 @@
|
|
|
119
123
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
120
124
|
._bfhk1i5c{background-color:var(--ds-blanket,#050c1f75)}
|
|
121
125
|
._bfhk1j28{background-color:transparent}
|
|
126
|
+
._bfhk1l7x{background-color:var(--ds-border,#0b120e24)}
|
|
122
127
|
._bfhk1tzm{background-color:#22272b}
|
|
123
128
|
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
124
129
|
._bfhkr3uz{background-color:#000}
|
|
@@ -161,6 +166,7 @@
|
|
|
161
166
|
._t6vde4h9{border-left-width:var(--ds-border-width,1px)}
|
|
162
167
|
._t9ec1i34{transform:translateY(-50%)}
|
|
163
168
|
._tzy41w01{opacity:.85}
|
|
169
|
+
._u5f31dup{padding-right:424px}
|
|
164
170
|
._u5f31ejb{padding-right:var(--ds-space-300,24px)}
|
|
165
171
|
._u5f31tcg{padding-right:24px}
|
|
166
172
|
._u5f3idpf{padding-right:0}
|
|
@@ -16,7 +16,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
|
16
16
|
import { Box } from '@atlaskit/primitives/box';
|
|
17
17
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
18
18
|
import { xcss } from '@atlaskit/primitives/xcss/xcss';
|
|
19
|
-
import { useHasMediaFooterPlayerControls, useIsInsetViewer, useSetMediaFooterControls } from './insetViewerContext';
|
|
19
|
+
import { useHasMediaFooterPlayerControls, useHasArchiveColumn, useIsInsetViewer, useSetMediaFooterControls } from './insetViewerContext';
|
|
20
20
|
const INSET_HEADER_HEIGHT = "var(--ds-space-800, 64px)";
|
|
21
21
|
// The horizontal gutter of the inset header, footer and fitted media, shared so they can't drift.
|
|
22
22
|
// It is `space.300` at the default root font size, hard-coded because the fit maths needs a number
|
|
@@ -25,6 +25,8 @@ export const INSET_VIEWER_GUTTER_PX = 24;
|
|
|
25
25
|
const INSET_SIDEBAR_WIDTH = '400px';
|
|
26
26
|
// The media footer is the header's height, and taller when it holds player controls.
|
|
27
27
|
const INSET_PLAYER_FOOTER_HEIGHT = `calc(${INSET_HEADER_HEIGHT} + ${"var(--ds-space-050, 4px)"})`;
|
|
28
|
+
// The gap the footer and the next arrow keep from a zip file's list, as they would from the edge.
|
|
29
|
+
const INSET_ARCHIVE_COLUMN_OFFSET = `calc(${INSET_SIDEBAR_WIDTH} + ${INSET_VIEWER_GUTTER_PX}px)`;
|
|
28
30
|
const insetSidebarWidthTransitionStyles = null;
|
|
29
31
|
const insetSidebarSlotStyles = null;
|
|
30
32
|
const insetSidebarSlotOpenStyles = null;
|
|
@@ -47,6 +49,12 @@ const insetViewerSidebarHeaderContentStyles = null;
|
|
|
47
49
|
const insetViewerSidebarHeaderTitleStyles = null;
|
|
48
50
|
const insetViewerMediaStageStyles = null;
|
|
49
51
|
const insetViewerMediaFooterBarStyles = null;
|
|
52
|
+
|
|
53
|
+
// Continues the zip file list's left border through the header and footer rows.
|
|
54
|
+
const insetViewerArchiveColumnLineStyles = null;
|
|
55
|
+
|
|
56
|
+
// Centers the footer controls under the preview, not under the preview and the zip file list.
|
|
57
|
+
const insetViewerArchiveColumnFooterStyles = null;
|
|
50
58
|
const insetViewerPlayerMediaFooterBarStyles = null;
|
|
51
59
|
const listWrapperStyles = null;
|
|
52
60
|
const insetViewerListWrapperStyles = null;
|
|
@@ -79,6 +87,9 @@ const insetViewerArrowWrapperStyles = null;
|
|
|
79
87
|
const insetViewerPlayerArrowWrapperStyles = null;
|
|
80
88
|
const insetViewerLeftWrapperStyles = null;
|
|
81
89
|
const insetViewerRightWrapperStyles = null;
|
|
90
|
+
|
|
91
|
+
// Keeps the next arrow in the preview area, left of a zip file's list.
|
|
92
|
+
const insetViewerArchiveColumnRightWrapperStyles = null;
|
|
82
93
|
const arrowsWrapperStyles = null;
|
|
83
94
|
const leftWrapperStyles = null;
|
|
84
95
|
const leftWrapperStylesWithSideBar = null;
|
|
@@ -114,7 +125,14 @@ const customAudioPlayerWrapperStyles = null;
|
|
|
114
125
|
// The controls are in the footer, so the player's play/pause blanket covers the whole stage.
|
|
115
126
|
const insetViewerCustomAudioPlayerWrapperStyles = null;
|
|
116
127
|
const audioPlayerStyles = null;
|
|
128
|
+
|
|
129
|
+
// Fills the inset media frame, which owns the gutter, corners and surface.
|
|
117
130
|
const insetViewerAudioPlayerStyles = null;
|
|
131
|
+
|
|
132
|
+
// The inset viewer's frame for media in the stage: the same side gutter the video is fitted to, and
|
|
133
|
+
// the same corners.
|
|
134
|
+
const insetMediaFrameStyles = null;
|
|
135
|
+
const insetMediaFrameNeutralStyles = null;
|
|
118
136
|
const insetViewerAudioCoverStyles = null;
|
|
119
137
|
const audioStyles = null;
|
|
120
138
|
const audioCoverStyles = null;
|
|
@@ -204,10 +222,14 @@ export const HeaderWrapper = ({
|
|
|
204
222
|
isArchiveSideBarVisible
|
|
205
223
|
}) => {
|
|
206
224
|
const isInsetViewer = useIsInsetViewer();
|
|
225
|
+
const hasArchiveColumn = useHasArchiveColumn();
|
|
207
226
|
return /*#__PURE__*/React.createElement("div", {
|
|
208
227
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
209
228
|
className: ax([!isInsetViewer && "_11q75a80 _kqswstnw _154iidpf _1ltvidpf _1bsb1osq _4t3i1uc6 _tzy41w01 _ouxlidpf _syaz1poe _k48p1wq8 _ca0q1ejb _n3td1ejb _19bv1ejb _u5f31ejb _vchhusvi _lcxvglyw _1pby3tda", !isInsetViewer && isArchiveSideBarVisible && "_ouxl1klg", isInsetViewer && "_kqswh2mm _1bsb1osq _4t3ixncg _1o9zidpf _syazi7uo _lcxvglyw _1pbykb7n _1e0c1txw _4cvr1h6o _ca0qpxbi _u5f31tcg _n3tdpxbi _19bv1tcg _vchhusvi", className])
|
|
210
|
-
}, children
|
|
229
|
+
}, children, isInsetViewer && hasArchiveColumn ? /*#__PURE__*/React.createElement("div", {
|
|
230
|
+
"data-testid": "media-viewer-header-archive-column-line",
|
|
231
|
+
className: ax(["_kqswstnw _154iidpf _94n5idpf _1xi2z2kd _1bsbe4h9 _bfhk1l7x"])
|
|
232
|
+
}) : null);
|
|
211
233
|
};
|
|
212
234
|
HeaderWrapper.displayName = 'HeaderWrapper';
|
|
213
235
|
export const MediaColumn = ({
|
|
@@ -223,11 +245,16 @@ export const MediaStage = ({
|
|
|
223
245
|
export const MediaFooterBar = () => {
|
|
224
246
|
const setMediaFooterControls = useSetMediaFooterControls();
|
|
225
247
|
const hasPlayerControls = useHasMediaFooterPlayerControls();
|
|
248
|
+
const isInsetViewer = useIsInsetViewer();
|
|
249
|
+
const hasArchiveColumn = useHasArchiveColumn();
|
|
226
250
|
return /*#__PURE__*/React.createElement("div", {
|
|
227
251
|
ref: setMediaFooterControls,
|
|
228
252
|
"data-testid": "media-viewer-media-footer",
|
|
229
|
-
className: ax(["_1reoewfl _18m9ewfl _1o9zidpf _4t3ixncg _vchhusvi _1bsb1osq _1e0c1txw _4cvr1h6o _1bah1h6o _ca0qpxbi _u5f31tcg _n3tdpxbi _19bv1tcg _kqswh2mm _lcxv1rj4", hasPlayerControls && "_4t3iz5ib _ca0qv47k"])
|
|
230
|
-
}
|
|
253
|
+
className: ax(["_1reoewfl _18m9ewfl _1o9zidpf _4t3ixncg _vchhusvi _1bsb1osq _1e0c1txw _4cvr1h6o _1bah1h6o _ca0qpxbi _u5f31tcg _n3tdpxbi _19bv1tcg _kqswh2mm _lcxv1rj4", hasPlayerControls && "_4t3iz5ib _ca0qv47k", isInsetViewer && hasArchiveColumn && "_u5f31dup"])
|
|
254
|
+
}, isInsetViewer && hasArchiveColumn ? /*#__PURE__*/React.createElement("div", {
|
|
255
|
+
"data-testid": "media-viewer-footer-archive-column-line",
|
|
256
|
+
className: ax(["_kqswstnw _154iidpf _94n5idpf _1xi2z2kd _1bsbe4h9 _bfhk1l7x"])
|
|
257
|
+
}) : null);
|
|
231
258
|
};
|
|
232
259
|
export const ListWrapper = ({
|
|
233
260
|
children
|
|
@@ -366,16 +393,17 @@ export const LeftWrapper = ({
|
|
|
366
393
|
const isInsetViewer = useIsInsetViewer();
|
|
367
394
|
const hasPlayerControls = useHasMediaFooterPlayerControls();
|
|
368
395
|
return /*#__PURE__*/React.createElement("div", {
|
|
369
|
-
className: ax(["_kqswstnw _154i1ssb _t9ec1i34 _ca0qv47k _n3tdv47k _19bvv47k _u5f3v47k", "_y3gn1e5h _1ltvidpf", isArchiveSideBarVisible && "_1ltv1mjv", isInsetViewer && "_154inuvu _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t", isInsetViewer && hasPlayerControls && "_154i69le", isInsetViewer && "_1ltv1ejb"])
|
|
396
|
+
className: ax(["_kqswstnw _154i1ssb _t9ec1i34 _ca0qv47k _n3tdv47k _19bvv47k _u5f3v47k", "_y3gn1e5h _1ltvidpf", !isInsetViewer && isArchiveSideBarVisible && "_1ltv1mjv", isInsetViewer && "_154inuvu _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t", isInsetViewer && hasPlayerControls && "_154i69le", isInsetViewer && "_1ltv1ejb"])
|
|
370
397
|
}, children);
|
|
371
398
|
};
|
|
372
399
|
export const RightWrapper = ({
|
|
373
400
|
children
|
|
374
401
|
}) => {
|
|
375
402
|
const isInsetViewer = useIsInsetViewer();
|
|
403
|
+
const hasArchiveColumn = useHasArchiveColumn();
|
|
376
404
|
const hasPlayerControls = useHasMediaFooterPlayerControls();
|
|
377
405
|
return /*#__PURE__*/React.createElement("div", {
|
|
378
|
-
className: ax(["_kqswstnw _154i1ssb _t9ec1i34 _ca0qv47k _n3tdv47k _19bvv47k _u5f3v47k", "_y3gnusic _1xi2idpf", isInsetViewer && "_154inuvu _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t", isInsetViewer && hasPlayerControls && "_154i69le", isInsetViewer && "_1xi21ejb"])
|
|
406
|
+
className: ax(["_kqswstnw _154i1ssb _t9ec1i34 _ca0qv47k _n3tdv47k _19bvv47k _u5f3v47k", "_y3gnusic _1xi2idpf", isInsetViewer && "_154inuvu _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t", isInsetViewer && hasPlayerControls && "_154i69le", isInsetViewer && "_1xi21ejb", isInsetViewer && hasArchiveColumn && "_1xi21dup"])
|
|
379
407
|
}, children);
|
|
380
408
|
};
|
|
381
409
|
|
|
@@ -389,7 +417,7 @@ export const Header = ({
|
|
|
389
417
|
const isInsetViewer = useIsInsetViewer();
|
|
390
418
|
return /*#__PURE__*/React.createElement("div", {
|
|
391
419
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
392
|
-
className: ax(["_1e0c1txw _19bvidpf", isArchiveSideBarVisible && "_19bv1mjv", isInsetViewer && "_zulpu2gc _1bsb1osq _4cvr1h6o _1bah1yb4 _1tkexy5q _4t3ixy5q", className])
|
|
420
|
+
className: ax(["_1e0c1txw _19bvidpf", !isInsetViewer && isArchiveSideBarVisible && "_19bv1mjv", isInsetViewer && "_zulpu2gc _1bsb1osq _4cvr1h6o _1bah1yb4 _1tkexy5q _4t3ixy5q", className])
|
|
393
421
|
}, children);
|
|
394
422
|
};
|
|
395
423
|
export const LeftHeader = ({
|
|
@@ -514,6 +542,14 @@ export const CustomAudioPlayerWrapper = ({
|
|
|
514
542
|
className: ax(["_kqswstnw _94n5idpf _1ltvidpf _1bsb1osq", isInsetViewer && "_154iidpf _4t3i1osq"])
|
|
515
543
|
}, children);
|
|
516
544
|
};
|
|
545
|
+
export const InsetMediaFrame = ({
|
|
546
|
+
'data-testid': datatestId,
|
|
547
|
+
children,
|
|
548
|
+
isNeutral
|
|
549
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
550
|
+
"data-testid": datatestId,
|
|
551
|
+
className: ax(["_2rko1mok _1reo15vq _18m915vq _1e0c1txw _4cvr1h6o _1bah1h6o _1bsbt4lq _4t3i1osq _18u01wug _2hwx1wug _vchhusvi", isNeutral && "_bfhki8nm"])
|
|
552
|
+
}, children);
|
|
517
553
|
export const AudioPlayer = ({
|
|
518
554
|
'data-testid': datatestId,
|
|
519
555
|
children
|
|
@@ -521,7 +557,7 @@ export const AudioPlayer = ({
|
|
|
521
557
|
const isInsetViewer = useIsInsetViewer();
|
|
522
558
|
return /*#__PURE__*/React.createElement("div", {
|
|
523
559
|
"data-testid": datatestId,
|
|
524
|
-
className: ax(["_2rkofajl _1reo15vq _18m915vq _bfhk1tzm _4cvr1h6o _1bah1h6o _1bsb1kdj _4t3i1kdj _1e0c1txw _2lx21bp4 _kqswh2mm", isInsetViewer && "
|
|
560
|
+
className: ax(["_2rkofajl _1reo15vq _18m915vq _bfhk1tzm _4cvr1h6o _1bah1h6o _1bsb1kdj _4t3i1kdj _1e0c1txw _2lx21bp4 _kqswh2mm", isInsetViewer && "_bfhk1j28 _1bsb1osq _4t3i1osq"])
|
|
525
561
|
}, children);
|
|
526
562
|
};
|
|
527
563
|
AudioPlayer.displayName = 'AudioPlayer';
|
|
@@ -3,17 +3,23 @@
|
|
|
3
3
|
._2rkofajl{border-radius:var(--ds-radius-small,3px)}
|
|
4
4
|
._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
|
|
5
5
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
6
|
+
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
6
7
|
._1e0c1ule{display:block}
|
|
7
8
|
._bfhk1j28{background-color:transparent}
|
|
8
9
|
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
10
|
+
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
9
11
|
._n3td14y2{padding-bottom:5px}
|
|
12
|
+
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
10
13
|
._syaz1q3r{color:var(--ds-icon,#292a2e)}
|
|
11
|
-
._u5f31v6z{padding-right:7px}
|
|
14
|
+
._u5f31v6z{padding-right:7px}
|
|
15
|
+
._u5f3ze3t{padding-right:var(--ds-space-0,0)}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
12
16
|
._1ah3v77o:focus-visible{outline-offset:var(--ds-space-025,2px)}
|
|
13
17
|
._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
|
|
14
18
|
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
15
19
|
._d0altlke:hover{cursor:pointer}
|
|
16
20
|
._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
21
|
+
._irr31j28:hover{background-color:transparent}
|
|
17
22
|
._1ggl5xtf:active{transition:var(--ds-button-pressed,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
|
|
23
|
+
._1di61j28:active{background-color:transparent}
|
|
18
24
|
._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
|
|
19
25
|
._1qamtlke:active{cursor:pointer}
|
|
@@ -5,18 +5,23 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
8
|
+
import { useIsInsetViewer } from '../../insetViewerContext';
|
|
8
9
|
const archiveDownloadButtonWrapperStyles = null;
|
|
9
10
|
const archiveDownloadButtonMotionStyles = null;
|
|
10
11
|
const archiveDownloadButtonWrapperStyleFix = null;
|
|
12
|
+
|
|
13
|
+
// The row around the button owns the padding and the hover in the inset viewer.
|
|
14
|
+
const insetViewerArchiveDownloadButtonWrapperStyles = null;
|
|
11
15
|
export const ArchiveDownloadButtonWrapper = ({
|
|
12
16
|
children,
|
|
13
17
|
onClick
|
|
14
18
|
}) => {
|
|
15
19
|
const intl = useIntl();
|
|
20
|
+
const isInsetViewer = useIsInsetViewer();
|
|
16
21
|
return /*#__PURE__*/React.createElement("button", {
|
|
17
22
|
"aria-label": intl.formatMessage(messages.archive_download_label_assistive_text),
|
|
18
23
|
onClick: event => onClick && onClick(event),
|
|
19
24
|
"data-testid": "media-archiveDownloadButton",
|
|
20
|
-
className: ax(["_kkk2n7od _1e0c1ule _1ah3v77o _128mdkaa _mizu1v1w _ra3xnqa1", "_19itglyw _2rkofajl _v564k6bl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1ggl5xtf _1qamtlke _1di6fcek", "_v564k6bl _1ggl5xtf"])
|
|
25
|
+
className: ax(["_kkk2n7od _1e0c1ule _1ah3v77o _128mdkaa _mizu1v1w _ra3xnqa1", "_19itglyw _2rkofajl _v564k6bl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1ggl5xtf _1qamtlke _1di6fcek", "_v564k6bl _1ggl5xtf", isInsetViewer && "_ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _irr31j28 _1di61j28"])
|
|
21
26
|
}, children);
|
|
22
27
|
};
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
/* archive-layout.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
-
// eslint-disable-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
2
|
import "./archive-layout.compiled.css";
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useLayoutEffect } from 'react';
|
|
6
|
+
// eslint-disable-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
+
|
|
8
|
+
import { useIsInsetViewer, useSetHasArchiveColumn } from '../../insetViewerContext';
|
|
6
9
|
const archiveLayoutStyles = null;
|
|
7
10
|
export const ArchiveLayout = ({
|
|
8
11
|
children
|
|
9
12
|
}) => {
|
|
13
|
+
const isInsetViewer = useIsInsetViewer();
|
|
14
|
+
const setHasArchiveColumn = useSetHasArchiveColumn();
|
|
15
|
+
|
|
16
|
+
// The file list shows whenever this layout does, so the header and footer continue its column.
|
|
17
|
+
// A layout effect, so the header, footer and arrows update in the same frame the list appears.
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
if (!isInsetViewer) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
setHasArchiveColumn(true);
|
|
23
|
+
return () => setHasArchiveColumn(false);
|
|
24
|
+
}, [isInsetViewer, setHasArchiveColumn]);
|
|
10
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
11
26
|
"data-testid": "archive-layout",
|
|
12
27
|
className: ax(["_1e0c1txw _1bsb1osq _4t3i1osq"])
|