@atlaskit/media-viewer 49.2.7 → 49.4.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.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/analytics/events/operational/download.js +59 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/components/media-viewer.js +4 -2
- package/dist/cjs/download.js +60 -27
- package/dist/cjs/header.js +4 -2
- package/dist/cjs/item-viewer.js +32 -17
- package/dist/cjs/list.js +11 -3
- package/dist/cjs/media-viewer.js +4 -2
- package/dist/cjs/viewerOptions.js +5 -0
- package/dist/cjs/viewers/archiveSidebar/archive.js +52 -8
- package/dist/cjs/viewers/base-viewer.js +4 -2
- package/dist/cjs/viewers/customViewer/customViewer.js +55 -0
- package/dist/es2019/analytics/events/operational/download.js +55 -0
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/components/media-viewer.js +4 -2
- package/dist/es2019/download.js +53 -24
- package/dist/es2019/header.js +4 -2
- package/dist/es2019/item-viewer.js +30 -17
- package/dist/es2019/list.js +12 -4
- package/dist/es2019/media-viewer.js +4 -2
- package/dist/es2019/viewerOptions.js +1 -0
- package/dist/es2019/viewers/archiveSidebar/archive.js +27 -5
- package/dist/es2019/viewers/base-viewer.js +4 -2
- package/dist/es2019/viewers/customViewer/customViewer.js +37 -0
- package/dist/esm/analytics/events/operational/download.js +53 -0
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/components/media-viewer.js +4 -2
- package/dist/esm/download.js +60 -25
- package/dist/esm/header.js +4 -2
- package/dist/esm/item-viewer.js +32 -17
- package/dist/esm/list.js +12 -4
- package/dist/esm/media-viewer.js +4 -2
- package/dist/esm/viewerOptions.js +1 -0
- package/dist/esm/viewers/archiveSidebar/archive.js +52 -8
- package/dist/esm/viewers/base-viewer.js +4 -2
- package/dist/esm/viewers/customViewer/customViewer.js +46 -0
- package/dist/types/analytics/events/index.d.ts +2 -1
- package/dist/types/analytics/events/operational/_mediaFile.d.ts +1 -1
- package/dist/types/analytics/events/operational/download.d.ts +9 -0
- package/dist/types/components/media-viewer.d.ts +1 -1
- package/dist/types/components/types.d.ts +2 -0
- package/dist/types/download.d.ts +7 -11
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/header.d.ts +3 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/item-viewer.d.ts +7 -2
- package/dist/types/list.d.ts +3 -1
- package/dist/types/media-viewer.d.ts +2 -0
- package/dist/types/viewerOptions.d.ts +21 -0
- package/dist/types/viewers/archiveSidebar/types.d.ts +4 -0
- package/dist/types/viewers/audio.d.ts +2 -0
- package/dist/types/viewers/base-viewer.d.ts +2 -0
- package/dist/types/viewers/codeViewer/index.d.ts +2 -0
- package/dist/types/viewers/customViewer/customViewer.d.ts +12 -0
- package/dist/types/viewers/doc/index.d.ts +2 -0
- package/dist/types/viewers/image/index.d.ts +1 -1
- package/dist/types/viewers/video.d.ts +2 -0
- package/dist/types-ts4.5/analytics/events/index.d.ts +2 -1
- package/dist/types-ts4.5/analytics/events/operational/_mediaFile.d.ts +1 -1
- package/dist/types-ts4.5/analytics/events/operational/download.d.ts +9 -0
- package/dist/types-ts4.5/components/media-viewer.d.ts +1 -1
- package/dist/types-ts4.5/components/types.d.ts +2 -0
- package/dist/types-ts4.5/download.d.ts +7 -11
- package/dist/types-ts4.5/errors.d.ts +2 -2
- package/dist/types-ts4.5/header.d.ts +3 -2
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/item-viewer.d.ts +7 -2
- package/dist/types-ts4.5/list.d.ts +3 -1
- package/dist/types-ts4.5/media-viewer.d.ts +2 -0
- package/dist/types-ts4.5/viewerOptions.d.ts +21 -0
- package/dist/types-ts4.5/viewers/archiveSidebar/types.d.ts +4 -0
- package/dist/types-ts4.5/viewers/audio.d.ts +2 -0
- package/dist/types-ts4.5/viewers/base-viewer.d.ts +2 -0
- package/dist/types-ts4.5/viewers/codeViewer/index.d.ts +2 -0
- package/dist/types-ts4.5/viewers/customViewer/customViewer.d.ts +12 -0
- package/dist/types-ts4.5/viewers/doc/index.d.ts +2 -0
- package/dist/types-ts4.5/viewers/image/index.d.ts +1 -1
- package/dist/types-ts4.5/viewers/video.d.ts +2 -0
- package/package.json +6 -6
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getFileAttributes } from '../..';
|
|
2
|
+
import { getPrimaryErrorReason, getSecondaryErrorReason, getErrorDetail, getRequestMetadata } from '../../../errors';
|
|
3
|
+
export var createDownloadSucceededEventPayload = function createDownloadSucceededEventPayload(fileState, traceContext) {
|
|
4
|
+
var _getFileAttributes = getFileAttributes(fileState),
|
|
5
|
+
fileId = _getFileAttributes.fileId,
|
|
6
|
+
fileMediatype = _getFileAttributes.fileMediatype,
|
|
7
|
+
fileMimetype = _getFileAttributes.fileMimetype,
|
|
8
|
+
fileSize = _getFileAttributes.fileSize;
|
|
9
|
+
return {
|
|
10
|
+
eventType: 'operational',
|
|
11
|
+
actionSubject: 'mediaFile',
|
|
12
|
+
action: 'downloadSucceeded',
|
|
13
|
+
attributes: {
|
|
14
|
+
status: 'success',
|
|
15
|
+
fileMediatype: fileMediatype,
|
|
16
|
+
fileMimetype: fileMimetype,
|
|
17
|
+
fileAttributes: {
|
|
18
|
+
fileId: fileId,
|
|
19
|
+
fileMediatype: fileMediatype,
|
|
20
|
+
fileMimetype: fileMimetype,
|
|
21
|
+
fileSize: fileSize
|
|
22
|
+
},
|
|
23
|
+
traceContext: traceContext
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export var createDownloadFailedEventPayload = function createDownloadFailedEventPayload(fileId, error, fileState, traceContext) {
|
|
28
|
+
var _getFileAttributes2 = getFileAttributes(fileState),
|
|
29
|
+
fileMediatype = _getFileAttributes2.fileMediatype,
|
|
30
|
+
fileMimetype = _getFileAttributes2.fileMimetype,
|
|
31
|
+
fileSize = _getFileAttributes2.fileSize;
|
|
32
|
+
return {
|
|
33
|
+
eventType: 'operational',
|
|
34
|
+
actionSubject: 'mediaFile',
|
|
35
|
+
action: 'downloadFailed',
|
|
36
|
+
attributes: {
|
|
37
|
+
status: 'fail',
|
|
38
|
+
failReason: getPrimaryErrorReason(error),
|
|
39
|
+
error: getSecondaryErrorReason(error),
|
|
40
|
+
errorDetail: getErrorDetail(error),
|
|
41
|
+
request: getRequestMetadata(error),
|
|
42
|
+
fileMimetype: fileMimetype,
|
|
43
|
+
fileMediatype: fileMediatype,
|
|
44
|
+
fileAttributes: {
|
|
45
|
+
fileId: fileId,
|
|
46
|
+
fileMediatype: fileMediatype,
|
|
47
|
+
fileMimetype: fileMimetype,
|
|
48
|
+
fileSize: fileSize
|
|
49
|
+
},
|
|
50
|
+
traceContext: traceContext
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
|
|
2
2
|
var componentName = 'mediaViewer';
|
|
3
3
|
var packageName = "@atlaskit/media-viewer";
|
|
4
|
-
var packageVersion = "49.
|
|
4
|
+
var packageVersion = "49.4.0";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -5,7 +5,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
|
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
7
7
|
var packageName = "@atlaskit/media-viewer";
|
|
8
|
-
var packageVersion = "49.
|
|
8
|
+
var packageVersion = "49.4.0";
|
|
9
9
|
var ufoExperience;
|
|
10
10
|
var getExperience = function getExperience() {
|
|
11
11
|
if (!ufoExperience) {
|
|
@@ -37,7 +37,8 @@ export var MediaViewerBase = function MediaViewerBase(_ref) {
|
|
|
37
37
|
collectionName = _ref.collectionName,
|
|
38
38
|
items = _ref.items,
|
|
39
39
|
extensions = _ref.extensions,
|
|
40
|
-
contextId = _ref.contextId
|
|
40
|
+
contextId = _ref.contextId,
|
|
41
|
+
viewerOptions = _ref.viewerOptions;
|
|
41
42
|
var _useMemo = useMemo(function () {
|
|
42
43
|
return normaliseItems(items, selectedItem, collectionName);
|
|
43
44
|
}, [items, selectedItem, collectionName]),
|
|
@@ -70,7 +71,8 @@ export var MediaViewerBase = function MediaViewerBase(_ref) {
|
|
|
70
71
|
items: normalisedItems,
|
|
71
72
|
featureFlags: featureFlags,
|
|
72
73
|
extensions: extensions,
|
|
73
|
-
contextId: contextId
|
|
74
|
+
contextId: contextId,
|
|
75
|
+
viewerOptions: viewerOptions
|
|
74
76
|
});
|
|
75
77
|
};
|
|
76
78
|
|
package/dist/esm/download.js
CHANGED
|
@@ -1,60 +1,91 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
var _excluded = ["analyticspayload", "onClick"];
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
7
|
import DownloadIcon from '@atlaskit/icon/core/migration/download';
|
|
5
8
|
import { isErrorFileState, isExternalImageIdentifier } from '@atlaskit/media-client';
|
|
6
9
|
import { MediaButton, messages } from '@atlaskit/media-ui';
|
|
7
10
|
import React, { useCallback } from 'react';
|
|
8
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
|
-
import { ANALYTICS_MEDIA_CHANNEL } from '@atlaskit/media-common';
|
|
10
12
|
import { createDownloadButtonClickedEvent } from './analytics/events/ui/downloadButtonClicked';
|
|
13
|
+
import { createDownloadFailedEventPayload, createDownloadSucceededEventPayload } from './analytics/events/operational/download';
|
|
14
|
+
import { fireAnalytics } from './analytics';
|
|
11
15
|
import { createFailedPreviewDownloadButtonClickedEvent } from './analytics/events/ui/failedPreviewDownloadButtonClicked';
|
|
12
16
|
import { DownloadButtonWrapper } from './styleWrappers';
|
|
17
|
+
import { MediaViewerError } from './errors';
|
|
13
18
|
var downloadIcon = /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
14
19
|
color: "currentColor",
|
|
15
20
|
spacing: "spacious",
|
|
16
21
|
label: "Download"
|
|
17
22
|
});
|
|
18
23
|
function noop() {}
|
|
19
|
-
|
|
24
|
+
function DownloadButton(_ref) {
|
|
20
25
|
var analyticspayload = _ref.analyticspayload,
|
|
21
26
|
_ref$onClick = _ref.onClick,
|
|
22
27
|
providedOnClick = _ref$onClick === void 0 ? noop : _ref$onClick,
|
|
23
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
30
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
24
31
|
var onClick = useCallback(function (event, analyticsEvent) {
|
|
25
|
-
|
|
26
|
-
if (clone) {
|
|
27
|
-
clone.update(analyticspayload);
|
|
28
|
-
clone.fire(ANALYTICS_MEDIA_CHANNEL);
|
|
29
|
-
}
|
|
32
|
+
fireAnalytics(analyticspayload, createAnalyticsEvent);
|
|
30
33
|
providedOnClick(event, analyticsEvent);
|
|
31
|
-
}, [analyticspayload, providedOnClick]);
|
|
34
|
+
}, [analyticspayload, providedOnClick, createAnalyticsEvent]);
|
|
32
35
|
return /*#__PURE__*/React.createElement(MediaButton, _extends({}, rest, {
|
|
33
36
|
onClick: onClick
|
|
34
37
|
}));
|
|
35
38
|
}
|
|
36
|
-
|
|
37
|
-
return function () {
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
var createItemDownloader = function createItemDownloader(file, mediaClient, options) {
|
|
40
|
+
return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
41
|
+
var collectionName, traceContext, createAnalyticsEvent, id, name;
|
|
42
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
collectionName = options.collectionName, traceContext = options.traceContext, createAnalyticsEvent = options.createAnalyticsEvent;
|
|
46
|
+
id = file.id;
|
|
47
|
+
name = !isErrorFileState(file) ? file.name : undefined;
|
|
48
|
+
mediaClient.file.downloadBinary(id, name, collectionName, traceContext).then(function () {
|
|
49
|
+
fireAnalytics(createDownloadSucceededEventPayload(file, traceContext), createAnalyticsEvent);
|
|
50
|
+
}).catch(function (e) {
|
|
51
|
+
fireAnalytics(createDownloadFailedEventPayload(file.id, new MediaViewerError('download', e), file, traceContext), createAnalyticsEvent);
|
|
52
|
+
});
|
|
53
|
+
case 4:
|
|
54
|
+
case "end":
|
|
55
|
+
return _context.stop();
|
|
56
|
+
}
|
|
57
|
+
}, _callee);
|
|
58
|
+
}));
|
|
42
59
|
};
|
|
43
|
-
export var ErrorViewDownloadButton = function ErrorViewDownloadButton(
|
|
44
|
-
var fileState =
|
|
45
|
-
|
|
60
|
+
export var ErrorViewDownloadButton = function ErrorViewDownloadButton(_ref3) {
|
|
61
|
+
var fileState = _ref3.fileState,
|
|
62
|
+
mediaClient = _ref3.mediaClient,
|
|
63
|
+
error = _ref3.error,
|
|
64
|
+
traceContext = _ref3.traceContext,
|
|
65
|
+
collectionName = _ref3.collectionName;
|
|
46
66
|
var downloadEvent = createFailedPreviewDownloadButtonClickedEvent(fileState, error);
|
|
47
|
-
|
|
48
|
-
|
|
67
|
+
var _useAnalyticsEvents2 = useAnalyticsEvents(),
|
|
68
|
+
createAnalyticsEvent = _useAnalyticsEvents2.createAnalyticsEvent;
|
|
69
|
+
return /*#__PURE__*/React.createElement(DownloadButtonWrapper, null, /*#__PURE__*/React.createElement(DownloadButton
|
|
70
|
+
// testId="media-viewer-failed-preview-download-button"
|
|
71
|
+
, {
|
|
72
|
+
testId: "media-viewer-error-download-button",
|
|
49
73
|
analyticspayload: downloadEvent,
|
|
50
74
|
appearance: "primary",
|
|
51
|
-
onClick: createItemDownloader(
|
|
75
|
+
onClick: createItemDownloader(fileState, mediaClient, {
|
|
76
|
+
collectionName: collectionName,
|
|
77
|
+
traceContext: traceContext,
|
|
78
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
79
|
+
})
|
|
52
80
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.download)));
|
|
53
81
|
};
|
|
54
|
-
export var ToolbarDownloadButton = function ToolbarDownloadButton(
|
|
55
|
-
var state =
|
|
56
|
-
mediaClient =
|
|
57
|
-
identifier =
|
|
82
|
+
export var ToolbarDownloadButton = function ToolbarDownloadButton(_ref4) {
|
|
83
|
+
var state = _ref4.state,
|
|
84
|
+
mediaClient = _ref4.mediaClient,
|
|
85
|
+
identifier = _ref4.identifier,
|
|
86
|
+
traceContext = _ref4.traceContext;
|
|
87
|
+
var _useAnalyticsEvents3 = useAnalyticsEvents(),
|
|
88
|
+
createAnalyticsEvent = _useAnalyticsEvents3.createAnalyticsEvent;
|
|
58
89
|
var downloadEvent = createDownloadButtonClickedEvent(state);
|
|
59
90
|
|
|
60
91
|
// TODO [MS-1731]: make it work for external files as well
|
|
@@ -64,7 +95,11 @@ export var ToolbarDownloadButton = function ToolbarDownloadButton(props) {
|
|
|
64
95
|
return /*#__PURE__*/React.createElement(DownloadButton, {
|
|
65
96
|
testId: "media-viewer-download-button",
|
|
66
97
|
analyticspayload: downloadEvent,
|
|
67
|
-
onClick: createItemDownloader(state, mediaClient,
|
|
98
|
+
onClick: createItemDownloader(state, mediaClient, {
|
|
99
|
+
collectionName: identifier.collectionName,
|
|
100
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
101
|
+
traceContext: traceContext
|
|
102
|
+
}),
|
|
68
103
|
iconBefore: downloadIcon
|
|
69
104
|
});
|
|
70
105
|
};
|
package/dist/esm/header.js
CHANGED
|
@@ -18,7 +18,8 @@ export var Header = function Header(_ref) {
|
|
|
18
18
|
isSidebarVisible = _ref.isSidebarVisible,
|
|
19
19
|
onSidebarButtonClick = _ref.onSidebarButtonClick,
|
|
20
20
|
identifier = _ref.identifier,
|
|
21
|
-
onSetArchiveSideBarVisible = _ref.onSetArchiveSideBarVisible
|
|
21
|
+
onSetArchiveSideBarVisible = _ref.onSetArchiveSideBarVisible,
|
|
22
|
+
traceContext = _ref.traceContext;
|
|
22
23
|
// States
|
|
23
24
|
var _useState = useState(Outcome.pending()),
|
|
24
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -143,7 +144,8 @@ export var Header = function Header(_ref) {
|
|
|
143
144
|
return /*#__PURE__*/React.createElement(ToolbarDownloadButton, {
|
|
144
145
|
state: item,
|
|
145
146
|
identifier: identifier,
|
|
146
|
-
mediaClient: mediaClient
|
|
147
|
+
mediaClient: mediaClient,
|
|
148
|
+
traceContext: traceContext
|
|
147
149
|
});
|
|
148
150
|
}
|
|
149
151
|
})));
|
package/dist/esm/item-viewer.js
CHANGED
|
@@ -3,6 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import React, { useCallback, useEffect, useState, useRef } from 'react';
|
|
4
4
|
import Loadable from 'react-loadable';
|
|
5
5
|
import { isExternalImageIdentifier, isFileIdentifier } from '@atlaskit/media-client';
|
|
6
|
+
import { Text } from '@atlaskit/primitives';
|
|
6
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
8
|
import { messages } from '@atlaskit/media-ui';
|
|
8
9
|
import { isCodeViewerItem } from '@atlaskit/media-ui/codeViewer';
|
|
@@ -18,8 +19,8 @@ import { createLoadSucceededEvent } from './analytics/events/operational/loadSuc
|
|
|
18
19
|
import { fireAnalytics, getFileAttributes } from './analytics';
|
|
19
20
|
import { InteractiveImg } from './viewers/image/interactive-img';
|
|
20
21
|
import ArchiveViewerLoader from './viewers/archiveSidebar/archiveViewerLoader';
|
|
21
|
-
import { getRandomHex } from '@atlaskit/media-common';
|
|
22
22
|
import { startMediaFileUfoExperience, succeedMediaFileUfoExperience } from './analytics/ufoExperiences';
|
|
23
|
+
import { CustomViewer } from './viewers/customViewer/customViewer';
|
|
23
24
|
var ImageViewer = Loadable({
|
|
24
25
|
loader: function loader() {
|
|
25
26
|
return import( /* webpackChunkName: "@atlaskit-internal_imageViewer" */'./viewers/image').then(function (mod) {
|
|
@@ -97,15 +98,14 @@ export var ItemViewerBase = function ItemViewerBase(_ref) {
|
|
|
97
98
|
onClose = _ref.onClose,
|
|
98
99
|
previewCount = _ref.previewCount,
|
|
99
100
|
contextId = _ref.contextId,
|
|
100
|
-
createAnalyticsEvent = _ref.createAnalyticsEvent
|
|
101
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
102
|
+
viewerOptions = _ref.viewerOptions,
|
|
103
|
+
traceContext = _ref.traceContext;
|
|
101
104
|
// States and Refs
|
|
102
105
|
var _useState = useState(Outcome.pending()),
|
|
103
106
|
_useState2 = _slicedToArray(_useState, 2),
|
|
104
107
|
item = _useState2[0],
|
|
105
108
|
setItem = _useState2[1];
|
|
106
|
-
var traceContext = useRef({
|
|
107
|
-
traceId: getRandomHex(8)
|
|
108
|
-
});
|
|
109
109
|
var fileStateFlagsRef = useRef({
|
|
110
110
|
wasStatusUploading: false,
|
|
111
111
|
wasStatusProcessing: false
|
|
@@ -126,9 +126,10 @@ export var ItemViewerBase = function ItemViewerBase(_ref) {
|
|
|
126
126
|
fileState: fileState,
|
|
127
127
|
mediaClient: mediaClient,
|
|
128
128
|
error: error,
|
|
129
|
-
collectionName: collectionName
|
|
129
|
+
collectionName: collectionName,
|
|
130
|
+
traceContext: traceContext
|
|
130
131
|
});
|
|
131
|
-
}, [mediaClient, identifier]);
|
|
132
|
+
}, [mediaClient, identifier, traceContext]);
|
|
132
133
|
|
|
133
134
|
// Did mount
|
|
134
135
|
|
|
@@ -136,9 +137,9 @@ export var ItemViewerBase = function ItemViewerBase(_ref) {
|
|
|
136
137
|
if (isExternalImageIdentifier(identifier)) {
|
|
137
138
|
return;
|
|
138
139
|
}
|
|
139
|
-
fireAnalytics(createCommencedEvent(identifier === null || identifier === void 0 ? void 0 : identifier.id, traceContext
|
|
140
|
+
fireAnalytics(createCommencedEvent(identifier === null || identifier === void 0 ? void 0 : identifier.id, traceContext), createAnalyticsEventRef.current);
|
|
140
141
|
startMediaFileUfoExperience();
|
|
141
|
-
}, [identifier]);
|
|
142
|
+
}, [identifier, traceContext]);
|
|
142
143
|
useEffect(function () {
|
|
143
144
|
if (isExternalImageIdentifier(identifier)) {
|
|
144
145
|
// external images do not need to talk to our backend,
|
|
@@ -170,26 +171,41 @@ export var ItemViewerBase = function ItemViewerBase(_ref) {
|
|
|
170
171
|
item.whenSuccessful(function (fileItem) {
|
|
171
172
|
if (isFileStateItem(fileItem)) {
|
|
172
173
|
var fileAttributes = getFileAttributes(fileItem);
|
|
173
|
-
fireAnalytics(createLoadSucceededEvent(fileAttributes, traceContext
|
|
174
|
+
fireAnalytics(createLoadSucceededEvent(fileAttributes, traceContext), createAnalyticsEventRef.current);
|
|
174
175
|
succeedMediaFileUfoExperience({
|
|
175
176
|
fileAttributes: fileAttributes,
|
|
176
177
|
fileStateFlags: fileStateFlagsRef.current
|
|
177
178
|
});
|
|
178
179
|
}
|
|
179
180
|
});
|
|
180
|
-
}, [item]);
|
|
181
|
+
}, [item, traceContext]);
|
|
181
182
|
var onLoadFail = useCallback(function (mediaViewerError) {
|
|
182
183
|
setItem(Outcome.failed(mediaViewerError, fileState));
|
|
183
184
|
}, [fileState]);
|
|
184
185
|
var renderItem = function renderItem(fileItem) {
|
|
186
|
+
var _viewerOptions$custom;
|
|
185
187
|
var collectionName = isFileIdentifier(identifier) ? identifier.collectionName : undefined;
|
|
186
188
|
var viewerProps = {
|
|
187
189
|
mediaClient: mediaClient,
|
|
188
190
|
item: fileItem,
|
|
189
191
|
collectionName: collectionName,
|
|
190
192
|
onClose: onClose,
|
|
191
|
-
previewCount: previewCount
|
|
193
|
+
previewCount: previewCount,
|
|
194
|
+
viewerOptions: viewerOptions,
|
|
195
|
+
traceContext: traceContext
|
|
192
196
|
};
|
|
197
|
+
var customRenderer = viewerOptions === null || viewerOptions === void 0 || (_viewerOptions$custom = viewerOptions.customRenderers) === null || _viewerOptions$custom === void 0 ? void 0 : _viewerOptions$custom.find(function (renderer) {
|
|
198
|
+
return renderer.shouldUseCustomRenderer({
|
|
199
|
+
fileItem: fileItem
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
if (customRenderer) {
|
|
203
|
+
return /*#__PURE__*/React.createElement(CustomViewer, _extends({
|
|
204
|
+
customRendererConfig: customRenderer,
|
|
205
|
+
onError: onLoadFail,
|
|
206
|
+
onSuccess: onSuccess
|
|
207
|
+
}, viewerProps));
|
|
208
|
+
}
|
|
193
209
|
|
|
194
210
|
// TODO: fix all of the item errors
|
|
195
211
|
|
|
@@ -210,7 +226,7 @@ export var ItemViewerBase = function ItemViewerBase(_ref) {
|
|
|
210
226
|
onLoad: onSuccess,
|
|
211
227
|
onError: onLoadFail,
|
|
212
228
|
onClose: onClose,
|
|
213
|
-
traceContext: traceContext
|
|
229
|
+
traceContext: traceContext
|
|
214
230
|
});
|
|
215
231
|
}
|
|
216
232
|
var mediaType = fileItem.mediaType;
|
|
@@ -219,8 +235,7 @@ export var ItemViewerBase = function ItemViewerBase(_ref) {
|
|
|
219
235
|
return /*#__PURE__*/React.createElement(ImageViewer, _extends({
|
|
220
236
|
onLoad: onSuccess,
|
|
221
237
|
onError: onLoadFail,
|
|
222
|
-
contextId: contextId
|
|
223
|
-
traceContext: traceContext.current
|
|
238
|
+
contextId: contextId
|
|
224
239
|
}, viewerProps));
|
|
225
240
|
case 'audio':
|
|
226
241
|
return /*#__PURE__*/React.createElement(AudioViewer, _extends({
|
|
@@ -265,8 +280,8 @@ export var ItemViewerBase = function ItemViewerBase(_ref) {
|
|
|
265
280
|
error: error,
|
|
266
281
|
fileState: _fileState,
|
|
267
282
|
fileStateFlags: fileStateFlagsRef.current,
|
|
268
|
-
traceContext: traceContext
|
|
269
|
-
}, /*#__PURE__*/React.createElement(
|
|
283
|
+
traceContext: traceContext
|
|
284
|
+
}, /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.try_downloading_file)), renderDownloadButton(_fileState, error));
|
|
270
285
|
} else {
|
|
271
286
|
return /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
272
287
|
fileId: isFileIdentifier(identifier) ? identifier.id : 'undefined',
|
package/dist/esm/list.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useState, useRef } from 'react';
|
|
3
3
|
import { hideControlsClassName } from '@atlaskit/media-ui';
|
|
4
4
|
import { ItemViewer } from './item-viewer';
|
|
5
5
|
import { HeaderWrapper, ListWrapper } from './styleWrappers';
|
|
6
6
|
import { Navigation } from './navigation';
|
|
7
|
+
import { getRandomHex } from '@atlaskit/media-common';
|
|
7
8
|
import Header from './header';
|
|
8
9
|
export var List = function List(_ref) {
|
|
9
10
|
var defaultSelectedItem = _ref.defaultSelectedItem,
|
|
@@ -15,7 +16,8 @@ export var List = function List(_ref) {
|
|
|
15
16
|
featureFlags = _ref.featureFlags,
|
|
16
17
|
isSidebarVisible = _ref.isSidebarVisible,
|
|
17
18
|
onNavigationChange = _ref.onNavigationChange,
|
|
18
|
-
items = _ref.items
|
|
19
|
+
items = _ref.items,
|
|
20
|
+
viewerOptions = _ref.viewerOptions;
|
|
19
21
|
var _useState = useState(defaultSelectedItem),
|
|
20
22
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
23
|
selectedItem = _useState2[0],
|
|
@@ -28,6 +30,9 @@ export var List = function List(_ref) {
|
|
|
28
30
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
29
31
|
isArchiveSideBarVisible = _useState6[0],
|
|
30
32
|
setIsArchiveSideBarVisible = _useState6[1];
|
|
33
|
+
var traceContext = useRef({
|
|
34
|
+
traceId: getRandomHex(8)
|
|
35
|
+
});
|
|
31
36
|
return /*#__PURE__*/React.createElement(ListWrapper, null, /*#__PURE__*/React.createElement(HeaderWrapper
|
|
32
37
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
33
38
|
, {
|
|
@@ -41,14 +46,17 @@ export var List = function List(_ref) {
|
|
|
41
46
|
isSidebarVisible: isSidebarVisible,
|
|
42
47
|
isArchiveSideBarVisible: isArchiveSideBarVisible,
|
|
43
48
|
featureFlags: featureFlags,
|
|
44
|
-
onSetArchiveSideBarVisible: setIsArchiveSideBarVisible
|
|
49
|
+
onSetArchiveSideBarVisible: setIsArchiveSideBarVisible,
|
|
50
|
+
traceContext: traceContext.current
|
|
45
51
|
})), /*#__PURE__*/React.createElement(ItemViewer, {
|
|
46
52
|
identifier: selectedItem,
|
|
47
53
|
showControls: showControls,
|
|
48
54
|
onClose: onClose,
|
|
49
55
|
previewCount: previewCount,
|
|
50
56
|
contextId: contextId,
|
|
51
|
-
featureFlags: featureFlags
|
|
57
|
+
featureFlags: featureFlags,
|
|
58
|
+
viewerOptions: viewerOptions,
|
|
59
|
+
traceContext: traceContext.current
|
|
52
60
|
}), /*#__PURE__*/React.createElement(Navigation, {
|
|
53
61
|
items: items,
|
|
54
62
|
selectedItem: selectedItem,
|
package/dist/esm/media-viewer.js
CHANGED
|
@@ -22,7 +22,8 @@ var MediaViewerComponent = function MediaViewerComponent(_ref) {
|
|
|
22
22
|
innerRef = _ref.innerRef,
|
|
23
23
|
_onClose = _ref.onClose,
|
|
24
24
|
selectedItem = _ref.selectedItem,
|
|
25
|
-
intl = _ref.intl
|
|
25
|
+
intl = _ref.intl,
|
|
26
|
+
viewerOptions = _ref.viewerOptions;
|
|
26
27
|
var _useState = useState(false),
|
|
27
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
29
|
isSidebarVisible = _useState2[0],
|
|
@@ -85,7 +86,8 @@ var MediaViewerComponent = function MediaViewerComponent(_ref) {
|
|
|
85
86
|
},
|
|
86
87
|
isSidebarVisible: isSidebarVisible,
|
|
87
88
|
contextId: contextId,
|
|
88
|
-
featureFlags: featureFlags
|
|
89
|
+
featureFlags: featureFlags,
|
|
90
|
+
viewerOptions: viewerOptions
|
|
89
91
|
})), renderSidebar()));
|
|
90
92
|
return intl ? content : /*#__PURE__*/React.createElement(IntlProvider, {
|
|
91
93
|
locale: "en"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,6 +17,7 @@ import { unzip, HTTPRangeReader } from 'unzipit';
|
|
|
17
17
|
import { FormattedMessage } from 'react-intl-next';
|
|
18
18
|
import { CustomMediaPlayer, messages } from '@atlaskit/media-ui';
|
|
19
19
|
import { getLanguageType, isCodeViewerItem } from '@atlaskit/media-ui/codeViewer';
|
|
20
|
+
import { Text } from '@atlaskit/primitives';
|
|
20
21
|
import { Outcome } from '../../domain';
|
|
21
22
|
import { CustomVideoPlayerWrapper, AudioPlayer, CustomAudioPlayerWrapper, DefaultCoverWrapper, ListWrapper } from '../../styleWrappers';
|
|
22
23
|
import AudioIcon from '@atlaskit/icon/core/migration/audio--media-services-audio';
|
|
@@ -92,7 +93,8 @@ export var ArchiveViewerBase = /*#__PURE__*/function (_BaseViewer) {
|
|
|
92
93
|
case 0:
|
|
93
94
|
_this.setState({
|
|
94
95
|
content: Outcome.successful(_objectSpread(_objectSpread({}, _this.state.content.data), {}, {
|
|
95
|
-
selectedArchiveEntry: undefined
|
|
96
|
+
selectedArchiveEntry: undefined,
|
|
97
|
+
hasLoadedEntries: false // displays a nice loading spinner for the content viewer
|
|
96
98
|
}))
|
|
97
99
|
});
|
|
98
100
|
src = '';
|
|
@@ -106,7 +108,7 @@ export var ArchiveViewerBase = /*#__PURE__*/function (_BaseViewer) {
|
|
|
106
108
|
_context2.next = 8;
|
|
107
109
|
return rejectAfter(function () {
|
|
108
110
|
return selectedArchiveEntry.blob();
|
|
109
|
-
});
|
|
111
|
+
}, 10000);
|
|
110
112
|
case 8:
|
|
111
113
|
blob = _context2.sent;
|
|
112
114
|
src = URL.createObjectURL(blob);
|
|
@@ -136,7 +138,8 @@ export var ArchiveViewerBase = /*#__PURE__*/function (_BaseViewer) {
|
|
|
136
138
|
isDirectory: selectedArchiveEntry.isDirectory,
|
|
137
139
|
error: undefined,
|
|
138
140
|
codeViewerSrc: codeViewerSrc,
|
|
139
|
-
isCodeMimeType: isCodeMimeType
|
|
141
|
+
isCodeMimeType: isCodeMimeType,
|
|
142
|
+
hasLoadedEntries: true
|
|
140
143
|
}))
|
|
141
144
|
});
|
|
142
145
|
case 20:
|
|
@@ -238,7 +241,9 @@ export var ArchiveViewerBase = /*#__PURE__*/function (_BaseViewer) {
|
|
|
238
241
|
}, {
|
|
239
242
|
key: "renderArchiveItemViewer",
|
|
240
243
|
value: function renderArchiveItemViewer(content) {
|
|
241
|
-
var
|
|
244
|
+
var _this$props2 = this.props,
|
|
245
|
+
item = _this$props2.item,
|
|
246
|
+
viewerOptions = _this$props2.viewerOptions;
|
|
242
247
|
var src = content.src,
|
|
243
248
|
name = content.name,
|
|
244
249
|
isDirectory = content.isDirectory,
|
|
@@ -250,9 +255,48 @@ export var ArchiveViewerBase = /*#__PURE__*/function (_BaseViewer) {
|
|
|
250
255
|
return this.renderPreviewError(error, selectedArchiveEntry);
|
|
251
256
|
}
|
|
252
257
|
if (!isDirectory && selectedArchiveEntry) {
|
|
258
|
+
var _viewerOptions$custom;
|
|
253
259
|
if (!name || !src) {
|
|
254
260
|
return this.renderPreviewError(new ArchiveViewerError('archiveviewer-missing-name-src'), selectedArchiveEntry);
|
|
255
261
|
}
|
|
262
|
+
var customRenderer = viewerOptions === null || viewerOptions === void 0 || (_viewerOptions$custom = viewerOptions.customRenderers) === null || _viewerOptions$custom === void 0 ? void 0 : _viewerOptions$custom.find(function (renderer) {
|
|
263
|
+
return renderer.shouldUseCustomRenderer({
|
|
264
|
+
fileItem: item,
|
|
265
|
+
archiveFileItem: {
|
|
266
|
+
name: name
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
if (customRenderer) {
|
|
271
|
+
return /*#__PURE__*/React.createElement(ArchiveItemViewerWrapper, null, customRenderer.renderContent({
|
|
272
|
+
fileItem: item,
|
|
273
|
+
archiveFileItem: {
|
|
274
|
+
name: name
|
|
275
|
+
},
|
|
276
|
+
getBinaryContent: function () {
|
|
277
|
+
var _getBinaryContent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
278
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
279
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
280
|
+
case 0:
|
|
281
|
+
_context4.next = 2;
|
|
282
|
+
return fetch(src);
|
|
283
|
+
case 2:
|
|
284
|
+
return _context4.abrupt("return", _context4.sent.blob());
|
|
285
|
+
case 3:
|
|
286
|
+
case "end":
|
|
287
|
+
return _context4.stop();
|
|
288
|
+
}
|
|
289
|
+
}, _callee4);
|
|
290
|
+
}));
|
|
291
|
+
function getBinaryContent() {
|
|
292
|
+
return _getBinaryContent.apply(this, arguments);
|
|
293
|
+
}
|
|
294
|
+
return getBinaryContent;
|
|
295
|
+
}(),
|
|
296
|
+
onLoad: this.onViewerLoad(selectedArchiveEntry),
|
|
297
|
+
onError: this.onViewerError('archiveviewer-customrenderer-onerror', selectedArchiveEntry)
|
|
298
|
+
}));
|
|
299
|
+
}
|
|
256
300
|
var mediaType = getMediaTypeFromFilename(name);
|
|
257
301
|
if (isCodeMimeType) {
|
|
258
302
|
// Same code viewer logic as in Item-Viewer.tsx
|
|
@@ -324,16 +368,16 @@ export var ArchiveViewerBase = /*#__PURE__*/function (_BaseViewer) {
|
|
|
324
368
|
}, {
|
|
325
369
|
key: "renderPreviewError",
|
|
326
370
|
value: function renderPreviewError(error, entry) {
|
|
327
|
-
var _this$
|
|
328
|
-
item = _this$
|
|
329
|
-
createAnalyticsEvent = _this$
|
|
371
|
+
var _this$props3 = this.props,
|
|
372
|
+
item = _this$props3.item,
|
|
373
|
+
createAnalyticsEvent = _this$props3.createAnalyticsEvent;
|
|
330
374
|
fireAnalytics(createZipEntryLoadFailedEvent(item, error, entry), createAnalyticsEvent);
|
|
331
375
|
return /*#__PURE__*/React.createElement(ListWrapper, null, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
332
376
|
fileId: item.id,
|
|
333
377
|
fileState: item,
|
|
334
378
|
error: error,
|
|
335
379
|
supressAnalytics: true
|
|
336
|
-
}, /*#__PURE__*/React.createElement(
|
|
380
|
+
}, /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.try_downloading_file))));
|
|
337
381
|
}
|
|
338
382
|
}]);
|
|
339
383
|
return ArchiveViewerBase;
|
|
@@ -113,12 +113,14 @@ export var BaseViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
113
113
|
var _this$props = this.props,
|
|
114
114
|
item = _this$props.item,
|
|
115
115
|
mediaClient = _this$props.mediaClient,
|
|
116
|
-
collectionName = _this$props.collectionName
|
|
116
|
+
collectionName = _this$props.collectionName,
|
|
117
|
+
traceContext = _this$props.traceContext;
|
|
117
118
|
return /*#__PURE__*/React.createElement(ErrorViewDownloadButton, {
|
|
118
119
|
fileState: item,
|
|
119
120
|
mediaClient: mediaClient,
|
|
120
121
|
error: error,
|
|
121
|
-
collectionName: collectionName
|
|
122
|
+
collectionName: collectionName,
|
|
123
|
+
traceContext: traceContext
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
126
|
}, {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { MediaViewerError } from '../../errors';
|
|
3
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Spinner } from '../../loading';
|
|
6
|
+
export var CustomViewer = function CustomViewer(_ref) {
|
|
7
|
+
var mediaClient = _ref.mediaClient,
|
|
8
|
+
item = _ref.item,
|
|
9
|
+
customRendererConfig = _ref.customRendererConfig,
|
|
10
|
+
onSuccess = _ref.onSuccess,
|
|
11
|
+
onError = _ref.onError;
|
|
12
|
+
var _useState = useState(),
|
|
13
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14
|
+
getBinaryContent = _useState2[0],
|
|
15
|
+
setGetBinaryContent = _useState2[1];
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
setGetBinaryContent(undefined);
|
|
18
|
+
var abortController = new AbortController();
|
|
19
|
+
// This sets the 'getBinaryContent' to an async function that fetches the binary content of the file
|
|
20
|
+
// The 'getBinaryContent' function has to be updated when the item changes
|
|
21
|
+
// This approach handles aborting in-progress request outside of the custom-renderer concern
|
|
22
|
+
if (item.status === 'processed' || item.status === 'failed-processing') {
|
|
23
|
+
setGetBinaryContent(function () {
|
|
24
|
+
return function () {
|
|
25
|
+
return mediaClient.mediaStore.getFileBinary(item.id, undefined, abortController);
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return function () {
|
|
30
|
+
return abortController.abort();
|
|
31
|
+
};
|
|
32
|
+
}, [item, mediaClient]);
|
|
33
|
+
var onLoadFailed = useCallback(function (error) {
|
|
34
|
+
var mediaError = new MediaViewerError('custom-viewer-error', error);
|
|
35
|
+
onError(mediaError, item);
|
|
36
|
+
}, [item, onError]);
|
|
37
|
+
if (!getBinaryContent) {
|
|
38
|
+
return /*#__PURE__*/React.createElement(Spinner, null);
|
|
39
|
+
}
|
|
40
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, customRendererConfig.renderContent({
|
|
41
|
+
fileItem: item,
|
|
42
|
+
getBinaryContent: getBinaryContent,
|
|
43
|
+
onLoad: onSuccess,
|
|
44
|
+
onError: onLoadFailed
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CommencedEventPayload } from './operational/commenced';
|
|
2
2
|
import { type LoadFailedEventPayload } from './operational/loadFailed';
|
|
3
|
+
import { type DownloadFailedEventPayload, type DownloadSucceededEventPayload } from './operational/download';
|
|
3
4
|
import { type LoadSucceededEventPayload } from './operational/loadSucceeded';
|
|
4
5
|
import { type PreviewUnsupportedEventPayload } from './operational/previewUnsupported';
|
|
5
6
|
import { type ZipEntryLoadFailedEventPayload } from './operational/zipEntryLoadFailed';
|
|
@@ -13,4 +14,4 @@ import { type FailedPreviewDownloadButtonClickedEventPayload } from './ui/failed
|
|
|
13
14
|
import { type NavigatedEventPayload } from './ui/navigated';
|
|
14
15
|
import { type ZoomInButtonClickEventPayload } from './ui/zoomInButtonClicked';
|
|
15
16
|
import { type ZoomOutButtonClickEventPayload } from './ui/zoomOutButtonClicked';
|
|
16
|
-
export type MediaViewerEventPayload = CommencedEventPayload | LoadFailedEventPayload | LoadSucceededEventPayload | PreviewUnsupportedEventPayload | ZipEntryLoadFailedEventPayload | ZipEntryLoadSucceededEventPayload | ModalEventPayload | PdfPasswordInputScreenEventPayload | PasswordPdfScreenEventPayload | ClosedEventPayload | DownloadButtonClickedEventPayload | FailedPreviewDownloadButtonClickedEventPayload | NavigatedEventPayload | ZoomInButtonClickEventPayload | ZoomOutButtonClickEventPayload;
|
|
17
|
+
export type MediaViewerEventPayload = CommencedEventPayload | LoadFailedEventPayload | LoadSucceededEventPayload | PreviewUnsupportedEventPayload | ZipEntryLoadFailedEventPayload | ZipEntryLoadSucceededEventPayload | ModalEventPayload | PdfPasswordInputScreenEventPayload | PasswordPdfScreenEventPayload | ClosedEventPayload | DownloadButtonClickedEventPayload | FailedPreviewDownloadButtonClickedEventPayload | NavigatedEventPayload | ZoomInButtonClickEventPayload | ZoomOutButtonClickEventPayload | DownloadFailedEventPayload | DownloadSucceededEventPayload;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type OperationalEventPayload, type OperationalAttributes } from '@atlaskit/media-common';
|
|
2
2
|
/** common definition used by other mediaFile events */
|
|
3
|
-
export type MediaFileEventPayload<Attributes extends OperationalAttributes, Action extends 'commenced' | 'loadSucceeded' | 'loadFailed' | 'previewUnsupported' | 'zipEntryLoadSucceeded' | 'zipEntryLoadFailed'> = OperationalEventPayload<Attributes, Action, 'mediaFile'>;
|
|
3
|
+
export type MediaFileEventPayload<Attributes extends OperationalAttributes, Action extends 'commenced' | 'loadSucceeded' | 'loadFailed' | 'previewUnsupported' | 'zipEntryLoadSucceeded' | 'zipEntryLoadFailed' | 'downloadSucceeded' | 'downloadFailed'> = OperationalEventPayload<Attributes, Action, 'mediaFile'>;
|