@atlaskit/media-card 77.12.4 → 78.0.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 +9 -0
- package/dist/cjs/card/card.js +20 -1039
- package/dist/cjs/card/cardLoader.js +2 -2
- package/dist/cjs/card/cardView.js +255 -417
- package/dist/cjs/card/cardWithMediaClient.js +5 -9
- package/dist/cjs/card/{v2/cardviews → cardviews}/cardViewWrapper.js +8 -8
- package/dist/cjs/card/{v2/cardviews → cardviews}/errorCardView.js +6 -6
- package/dist/cjs/card/{v2/cardviews → cardviews}/iconCardView.js +5 -5
- package/dist/cjs/card/{v2/cardviews → cardviews}/imageCardView.js +5 -5
- package/dist/cjs/card/{v2/cardviews → cardviews}/index.js +2 -2
- package/dist/cjs/card/{v2/cardviews → cardviews}/loadingCardView.js +3 -3
- package/dist/cjs/card/{v2/cardviews → cardviews}/processingCardView.js +4 -4
- package/dist/cjs/card/{v2/cardviews → cardviews}/videoCardView.js +7 -7
- package/dist/cjs/card/{v2/externalImageCard.js → externalImageCard.js} +11 -11
- package/dist/cjs/card/{v2/fileCard.js → fileCard.js} +18 -18
- package/dist/cjs/card/index.js +2 -2
- package/dist/cjs/card/inlinePlayer.js +184 -267
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/{v2/svgView → svgView}/svgView.js +9 -9
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +20 -1023
- package/dist/es2019/card/cardLoader.js +2 -2
- package/dist/es2019/card/cardView.js +252 -403
- package/dist/es2019/card/cardWithMediaClient.js +6 -10
- package/dist/es2019/card/{v2/cardviews → cardviews}/cardViewWrapper.js +8 -8
- package/dist/es2019/card/{v2/cardviews → cardviews}/errorCardView.js +6 -6
- package/dist/es2019/card/{v2/cardviews → cardviews}/iconCardView.js +5 -5
- package/dist/es2019/card/{v2/cardviews → cardviews}/imageCardView.js +5 -5
- package/dist/es2019/card/{v2/cardviews → cardviews}/index.js +2 -2
- package/dist/es2019/card/{v2/cardviews → cardviews}/loadingCardView.js +3 -3
- package/dist/es2019/card/{v2/cardviews → cardviews}/processingCardView.js +4 -4
- package/dist/es2019/card/{v2/cardviews → cardviews}/videoCardView.js +7 -7
- package/dist/es2019/card/{v2/externalImageCard.js → externalImageCard.js} +11 -11
- package/dist/es2019/card/{v2/fileCard.js → fileCard.js} +18 -18
- package/dist/es2019/card/index.js +1 -1
- package/dist/es2019/card/inlinePlayer.js +127 -208
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/{v2/svgView → svgView}/svgView.js +9 -9
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +21 -1040
- package/dist/esm/card/cardLoader.js +2 -2
- package/dist/esm/card/cardView.js +251 -416
- package/dist/esm/card/cardWithMediaClient.js +6 -10
- package/dist/esm/card/{v2/cardviews → cardviews}/cardViewWrapper.js +8 -8
- package/dist/esm/card/{v2/cardviews → cardviews}/errorCardView.js +6 -6
- package/dist/esm/card/{v2/cardviews → cardviews}/iconCardView.js +5 -5
- package/dist/esm/card/{v2/cardviews → cardviews}/imageCardView.js +5 -5
- package/dist/esm/card/{v2/cardviews → cardviews}/index.js +2 -2
- package/dist/esm/card/{v2/cardviews → cardviews}/loadingCardView.js +3 -3
- package/dist/esm/card/{v2/cardviews → cardviews}/processingCardView.js +4 -4
- package/dist/esm/card/{v2/cardviews → cardviews}/videoCardView.js +7 -7
- package/dist/esm/card/{v2/externalImageCard.js → externalImageCard.js} +11 -11
- package/dist/esm/card/{v2/fileCard.js → fileCard.js} +18 -18
- package/dist/esm/card/index.js +1 -1
- package/dist/esm/card/inlinePlayer.js +185 -269
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/{v2/svgView → svgView}/svgView.js +9 -9
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/card.d.ts +5 -66
- package/dist/types/card/cardLoader.d.ts +1 -1
- package/dist/types/card/cardView.d.ts +23 -45
- package/dist/types/card/cardWithMediaClient.d.ts +1 -1
- package/dist/types/card/{v2/cardviews → cardviews}/cardViewWrapper.d.ts +3 -3
- package/dist/types/card/{v2/cardviews → cardviews}/errorCardView.d.ts +1 -1
- package/dist/{types-ts4.5/card/v2 → types/card}/cardviews/iconCardView.d.ts +1 -1
- package/dist/{types-ts4.5/card/v2 → types/card}/cardviews/imageCardView.d.ts +1 -1
- package/dist/{types-ts4.5/card/v2 → types/card}/cardviews/index.d.ts +5 -5
- package/dist/types/card/{v2/cardviews → cardviews}/videoCardView.d.ts +1 -1
- package/dist/types/card/{v2/externalImageCard.d.ts → externalImageCard.d.ts} +1 -1
- package/dist/types/card/{v2/fileCard.d.ts → fileCard.d.ts} +2 -2
- package/dist/types/card/index.d.ts +1 -1
- package/dist/types/card/inlinePlayer.d.ts +2 -31
- package/dist/types/card/{v2/svgView → svgView}/errors.d.ts +1 -1
- package/dist/{types-ts4.5/card/v2 → types/card}/svgView/svgView.d.ts +2 -2
- package/dist/types-ts4.5/card/card.d.ts +5 -66
- package/dist/types-ts4.5/card/cardLoader.d.ts +1 -1
- package/dist/types-ts4.5/card/cardView.d.ts +23 -45
- package/dist/types-ts4.5/card/cardWithMediaClient.d.ts +1 -1
- package/dist/types-ts4.5/card/{v2/cardviews → cardviews}/cardViewWrapper.d.ts +3 -3
- package/dist/types-ts4.5/card/{v2/cardviews → cardviews}/errorCardView.d.ts +1 -1
- package/dist/{types/card/v2 → types-ts4.5/card}/cardviews/iconCardView.d.ts +1 -1
- package/dist/{types/card/v2 → types-ts4.5/card}/cardviews/imageCardView.d.ts +1 -1
- package/dist/{types/card/v2 → types-ts4.5/card}/cardviews/index.d.ts +5 -5
- package/dist/types-ts4.5/card/{v2/cardviews → cardviews}/videoCardView.d.ts +1 -1
- package/dist/types-ts4.5/card/{v2/externalImageCard.d.ts → externalImageCard.d.ts} +1 -1
- package/dist/types-ts4.5/card/{v2/fileCard.d.ts → fileCard.d.ts} +2 -2
- package/dist/types-ts4.5/card/index.d.ts +1 -1
- package/dist/types-ts4.5/card/inlinePlayer.d.ts +2 -31
- package/dist/types-ts4.5/card/{v2/svgView → svgView}/errors.d.ts +1 -1
- package/dist/{types/card/v2 → types-ts4.5/card}/svgView/svgView.d.ts +2 -2
- package/package.json +1 -4
- package/dist/cjs/card/cardSwitcher.js +0 -15
- package/dist/cjs/card/v2/cardV2.js +0 -41
- package/dist/cjs/card/v2/cardV2Loader.js +0 -36
- package/dist/cjs/card/v2/cardViewV2.js +0 -298
- package/dist/cjs/card/v2/cardWithMediaClientV2.js +0 -34
- package/dist/cjs/card/v2/inlinePlayerLazyV2.js +0 -35
- package/dist/cjs/card/v2/inlinePlayerV2.js +0 -224
- package/dist/es2019/card/cardSwitcher.js +0 -8
- package/dist/es2019/card/v2/cardV2.js +0 -33
- package/dist/es2019/card/v2/cardV2Loader.js +0 -18
- package/dist/es2019/card/v2/cardViewV2.js +0 -294
- package/dist/es2019/card/v2/cardWithMediaClientV2.js +0 -25
- package/dist/es2019/card/v2/inlinePlayerLazyV2.js +0 -10
- package/dist/es2019/card/v2/inlinePlayerV2.js +0 -166
- package/dist/esm/card/cardSwitcher.js +0 -8
- package/dist/esm/card/v2/cardV2.js +0 -34
- package/dist/esm/card/v2/cardV2Loader.js +0 -24
- package/dist/esm/card/v2/cardViewV2.js +0 -290
- package/dist/esm/card/v2/cardWithMediaClientV2.js +0 -27
- package/dist/esm/card/v2/inlinePlayerLazyV2.js +0 -23
- package/dist/esm/card/v2/inlinePlayerV2.js +0 -214
- package/dist/types/card/cardSwitcher.d.ts +0 -4
- package/dist/types/card/v2/cardV2.d.ts +0 -7
- package/dist/types/card/v2/cardV2Loader.d.ts +0 -4
- package/dist/types/card/v2/cardViewV2.d.ts +0 -59
- package/dist/types/card/v2/cardWithMediaClientV2.d.ts +0 -3
- package/dist/types/card/v2/inlinePlayerLazyV2.d.ts +0 -2
- package/dist/types/card/v2/inlinePlayerV2.d.ts +0 -24
- package/dist/types-ts4.5/card/cardSwitcher.d.ts +0 -4
- package/dist/types-ts4.5/card/v2/cardV2.d.ts +0 -7
- package/dist/types-ts4.5/card/v2/cardV2Loader.d.ts +0 -4
- package/dist/types-ts4.5/card/v2/cardViewV2.d.ts +0 -59
- package/dist/types-ts4.5/card/v2/cardWithMediaClientV2.d.ts +0 -3
- package/dist/types-ts4.5/card/v2/inlinePlayerLazyV2.d.ts +0 -2
- package/dist/types-ts4.5/card/v2/inlinePlayerV2.d.ts +0 -24
- /package/dist/cjs/card/{v2/performance.js → performance.js} +0 -0
- /package/dist/cjs/card/{v2/svgView → svgView}/errors.js +0 -0
- /package/dist/cjs/card/{v2/svgView → svgView}/helpers.js +0 -0
- /package/dist/cjs/card/{v2/svgView → svgView}/index.js +0 -0
- /package/dist/es2019/card/{v2/performance.js → performance.js} +0 -0
- /package/dist/es2019/card/{v2/svgView → svgView}/errors.js +0 -0
- /package/dist/es2019/card/{v2/svgView → svgView}/helpers.js +0 -0
- /package/dist/es2019/card/{v2/svgView → svgView}/index.js +0 -0
- /package/dist/esm/card/{v2/performance.js → performance.js} +0 -0
- /package/dist/esm/card/{v2/svgView → svgView}/errors.js +0 -0
- /package/dist/esm/card/{v2/svgView → svgView}/helpers.js +0 -0
- /package/dist/esm/card/{v2/svgView → svgView}/index.js +0 -0
- /package/dist/types/card/{v2/cardviews → cardviews}/loadingCardView.d.ts +0 -0
- /package/dist/types/card/{v2/cardviews → cardviews}/processingCardView.d.ts +0 -0
- /package/dist/types/card/{v2/performance.d.ts → performance.d.ts} +0 -0
- /package/dist/types/card/{v2/svgView → svgView}/helpers.d.ts +0 -0
- /package/dist/types/card/{v2/svgView → svgView}/index.d.ts +0 -0
- /package/dist/types-ts4.5/card/{v2/cardviews → cardviews}/loadingCardView.d.ts +0 -0
- /package/dist/types-ts4.5/card/{v2/cardviews → cardviews}/processingCardView.d.ts +0 -0
- /package/dist/types-ts4.5/card/{v2/performance.d.ts → performance.d.ts} +0 -0
- /package/dist/types-ts4.5/card/{v2/svgView → svgView}/helpers.d.ts +0 -0
- /package/dist/types-ts4.5/card/{v2/svgView → svgView}/index.d.ts +0 -0
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useRef, useState, useEffect } from 'react';
|
|
3
|
-
import { globalMediaEventEmitter } from '@atlaskit/media-client';
|
|
4
|
-
import { CustomMediaPlayer, InactivityDetector } from '@atlaskit/media-ui';
|
|
5
|
-
import { defaultImageCardDimensions } from '../../utils';
|
|
6
|
-
import { CardLoading } from '../../utils/lightCards/cardLoading';
|
|
7
|
-
import { ProgressBar } from '../ui/progressBar/progressBar';
|
|
8
|
-
import { InlinePlayerWrapper } from '../inlinePlayerWrapper';
|
|
9
|
-
import { useBreakpoint } from '../useBreakpoint';
|
|
10
|
-
import { useFileState, useMediaClient } from '@atlaskit/media-client-react';
|
|
11
|
-
export const getPreferredVideoArtifact = fileState => {
|
|
12
|
-
if (fileState.status === 'processed' || fileState.status === 'processing') {
|
|
13
|
-
const {
|
|
14
|
-
artifacts
|
|
15
|
-
} = fileState;
|
|
16
|
-
if (!artifacts) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
return artifacts['video_1280.mp4'] ? 'video_1280.mp4' : artifacts['video_640.mp4'] ? 'video_640.mp4' : undefined;
|
|
20
|
-
}
|
|
21
|
-
return undefined;
|
|
22
|
-
};
|
|
23
|
-
export const InlinePlayerBaseV2 = ({
|
|
24
|
-
identifier,
|
|
25
|
-
onError,
|
|
26
|
-
onClick,
|
|
27
|
-
dimensions = defaultImageCardDimensions,
|
|
28
|
-
originalDimensions,
|
|
29
|
-
selected,
|
|
30
|
-
testId,
|
|
31
|
-
forwardRef,
|
|
32
|
-
autoplay,
|
|
33
|
-
cardPreview,
|
|
34
|
-
onFullscreenChange,
|
|
35
|
-
videoControlsWrapperRef
|
|
36
|
-
}) => {
|
|
37
|
-
// === States ===
|
|
38
|
-
const [fileSrc, setFileSrc] = useState();
|
|
39
|
-
const [isUploading, setIsUploading] = useState();
|
|
40
|
-
const [progress, setProgress] = useState();
|
|
41
|
-
|
|
42
|
-
// === Refs and Local Variables ===
|
|
43
|
-
const divRef = useRef(null);
|
|
44
|
-
const onErrorRef = useRef(onError);
|
|
45
|
-
onErrorRef.current = onError;
|
|
46
|
-
const {
|
|
47
|
-
id,
|
|
48
|
-
collectionName,
|
|
49
|
-
occurrenceKey
|
|
50
|
-
} = identifier;
|
|
51
|
-
const breakpoint = useBreakpoint(dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, divRef);
|
|
52
|
-
const mediaClient = useMediaClient();
|
|
53
|
-
const {
|
|
54
|
-
fileState
|
|
55
|
-
} = useFileState(id, {
|
|
56
|
-
collectionName,
|
|
57
|
-
occurrenceKey
|
|
58
|
-
});
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
const subscribeFileState = async fileState => {
|
|
61
|
-
if (fileState.status === 'uploading') {
|
|
62
|
-
setIsUploading(true);
|
|
63
|
-
setProgress(fileState.progress);
|
|
64
|
-
} else {
|
|
65
|
-
setIsUploading(false);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// We reuse the existing fileSrc to prevent re renders, therefore we only perform fileSrc updates when there isn't any
|
|
69
|
-
if (fileSrc) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (fileState.status !== 'error' && fileState.preview) {
|
|
73
|
-
const {
|
|
74
|
-
value
|
|
75
|
-
} = await fileState.preview;
|
|
76
|
-
if (value instanceof Blob && value.type.indexOf('video/') === 0) {
|
|
77
|
-
const newFileSrc = URL.createObjectURL(value);
|
|
78
|
-
setFileSrc(newFileSrc);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (fileState.status === 'processed' || fileState.status === 'processing') {
|
|
83
|
-
const artifactName = getPreferredVideoArtifact(fileState);
|
|
84
|
-
const {
|
|
85
|
-
artifacts
|
|
86
|
-
} = fileState;
|
|
87
|
-
if (!artifactName || !artifacts) {
|
|
88
|
-
// Tries to use the binary artifact to provide something to play while the video is still processing
|
|
89
|
-
try {
|
|
90
|
-
const newFileSrc = await mediaClient.file.getFileBinaryURL(id, collectionName);
|
|
91
|
-
setFileSrc(newFileSrc);
|
|
92
|
-
} catch (error) {
|
|
93
|
-
if (onErrorRef.current && error instanceof Error) {
|
|
94
|
-
onErrorRef.current(error);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
const newFileSrc = await mediaClient.file.getArtifactURL(artifacts, artifactName, collectionName);
|
|
101
|
-
setFileSrc(newFileSrc);
|
|
102
|
-
} catch (error) {
|
|
103
|
-
if (onErrorRef.current && error instanceof Error) {
|
|
104
|
-
onErrorRef.current(error);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
if (fileState) {
|
|
110
|
-
subscribeFileState(fileState);
|
|
111
|
-
}
|
|
112
|
-
}, [fileState, collectionName, fileSrc, id, mediaClient]);
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
return () => {
|
|
115
|
-
fileSrc && URL.revokeObjectURL(fileSrc);
|
|
116
|
-
};
|
|
117
|
-
}, [fileSrc]);
|
|
118
|
-
|
|
119
|
-
// === Render ===
|
|
120
|
-
return fileSrc ? /*#__PURE__*/React.createElement(InlinePlayerWrapper, {
|
|
121
|
-
testId: testId || 'media-card-inline-player',
|
|
122
|
-
selected: {
|
|
123
|
-
selected
|
|
124
|
-
},
|
|
125
|
-
onClick: onClick,
|
|
126
|
-
innerRef: forwardRef || undefined,
|
|
127
|
-
dimensions: dimensions
|
|
128
|
-
}, /*#__PURE__*/React.createElement(InactivityDetector, null, checkMouseMovement => /*#__PURE__*/React.createElement(CustomMediaPlayer, {
|
|
129
|
-
type: "video",
|
|
130
|
-
src: fileSrc,
|
|
131
|
-
onFullscreenChange: onFullscreenChange,
|
|
132
|
-
fileId: id,
|
|
133
|
-
isAutoPlay: autoplay,
|
|
134
|
-
isHDAvailable: false,
|
|
135
|
-
onDownloadClick: () => {
|
|
136
|
-
mediaClient.file.downloadBinary(id, undefined, collectionName);
|
|
137
|
-
},
|
|
138
|
-
onFirstPlay: () => {
|
|
139
|
-
globalMediaEventEmitter.emit('media-viewed', {
|
|
140
|
-
fileId: id,
|
|
141
|
-
viewingLevel: 'full'
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
lastWatchTimeConfig: {
|
|
145
|
-
contentId: id
|
|
146
|
-
},
|
|
147
|
-
originalDimensions: originalDimensions,
|
|
148
|
-
showControls: checkMouseMovement,
|
|
149
|
-
poster: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI,
|
|
150
|
-
videoControlsWrapperRef: videoControlsWrapperRef
|
|
151
|
-
})), isUploading && /*#__PURE__*/React.createElement(ProgressBar, {
|
|
152
|
-
progress: progress,
|
|
153
|
-
breakpoint: breakpoint,
|
|
154
|
-
positionBottom: true,
|
|
155
|
-
showOnTop: true
|
|
156
|
-
})) : /*#__PURE__*/React.createElement(CardLoading, {
|
|
157
|
-
testId: testId,
|
|
158
|
-
dimensions: dimensions
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
const InlinePlayerForwardRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
162
|
-
return /*#__PURE__*/React.createElement(InlinePlayerBaseV2, _extends({}, props, {
|
|
163
|
-
forwardRef: ref
|
|
164
|
-
}));
|
|
165
|
-
});
|
|
166
|
-
export const InlinePlayerV2 = InlinePlayerForwardRef;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import CardLoader from './cardLoader';
|
|
4
|
-
import CardV2Loader from './v2/cardV2Loader';
|
|
5
|
-
function CardSwitcher(props) {
|
|
6
|
-
return getBooleanFF('platform.media-experience.cardv2_7zann') ? /*#__PURE__*/React.createElement(CardV2Loader, props) : /*#__PURE__*/React.createElement(CardLoader, props);
|
|
7
|
-
}
|
|
8
|
-
export default CardSwitcher;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["identifier"];
|
|
4
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
|
-
import { isFileIdentifier } from '@atlaskit/media-client';
|
|
6
|
-
import { withMediaAnalyticsContext } from '@atlaskit/media-common';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
9
|
-
import { ExternalImageCard } from './externalImageCard';
|
|
10
|
-
import { FileCard } from './fileCard';
|
|
11
|
-
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "77.12.4";
|
|
13
|
-
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
|
-
var identifier = _ref.identifier,
|
|
15
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
var innerContent = isFileIdentifier(identifier) ? /*#__PURE__*/React.createElement(FileCard, _extends({}, otherProps, {
|
|
17
|
-
identifier: identifier,
|
|
18
|
-
key: identifier.id
|
|
19
|
-
})) : /*#__PURE__*/React.createElement(ExternalImageCard, _extends({}, otherProps, {
|
|
20
|
-
identifier: identifier,
|
|
21
|
-
key: identifier.dataURI
|
|
22
|
-
}));
|
|
23
|
-
return otherProps.intl ? innerContent : /*#__PURE__*/React.createElement(IntlProvider, {
|
|
24
|
-
locale: "en"
|
|
25
|
-
}, innerContent);
|
|
26
|
-
};
|
|
27
|
-
export var CardV2 = withMediaAnalyticsContext({
|
|
28
|
-
packageVersion: packageVersion,
|
|
29
|
-
packageName: packageName,
|
|
30
|
-
componentName: 'mediaCard',
|
|
31
|
-
component: 'mediaCard'
|
|
32
|
-
})(withAnalyticsEvents()(injectIntl(CardV2Base, {
|
|
33
|
-
enforceContext: false
|
|
34
|
-
})));
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import Loadable from 'react-loadable';
|
|
3
|
-
import { CardLoading } from '../../utils/lightCards/cardLoading';
|
|
4
|
-
var MediaCardContext = /*#__PURE__*/React.createContext({});
|
|
5
|
-
var CardLoadingWithContext = function CardLoadingWithContext() {
|
|
6
|
-
var props = useContext(MediaCardContext);
|
|
7
|
-
return /*#__PURE__*/React.createElement(CardLoading, props);
|
|
8
|
-
};
|
|
9
|
-
var MediaCardWithMediaClientProvider = Loadable({
|
|
10
|
-
loader: function loader() {
|
|
11
|
-
return import( /* webpackChunkName: "@atlaskit-internal_media-card-with-media-client-v2" */'./cardWithMediaClientV2').then(function (mod) {
|
|
12
|
-
return mod.CardWithMediaClientV2;
|
|
13
|
-
});
|
|
14
|
-
},
|
|
15
|
-
loading: function loading() {
|
|
16
|
-
return /*#__PURE__*/React.createElement(CardLoadingWithContext, null);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
var CardLoader = function CardLoader(props) {
|
|
20
|
-
return /*#__PURE__*/React.createElement(MediaCardContext.Provider, {
|
|
21
|
-
value: props
|
|
22
|
-
}, /*#__PURE__*/React.createElement(MediaCardWithMediaClientProvider, props));
|
|
23
|
-
};
|
|
24
|
-
export default CardLoader;
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
/** @jsx jsx */
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { jsx } from '@emotion/react';
|
|
8
|
-
import React, { useEffect, useState, useRef } from 'react';
|
|
9
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
|
-
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
11
|
-
import SpinnerIcon from '@atlaskit/spinner';
|
|
12
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
13
|
-
import { messages } from '@atlaskit/media-ui';
|
|
14
|
-
import { createAndFireMediaCardEvent } from '../../utils/analytics';
|
|
15
|
-
import { attachDetailsToActions } from '../actions';
|
|
16
|
-
import { ImageRenderer } from '../ui/imageRenderer/imageRenderer';
|
|
17
|
-
import { TitleBox } from '../ui/titleBox/titleBox';
|
|
18
|
-
import { FailedTitleBox } from '../ui/titleBox/failedTitleBox';
|
|
19
|
-
import { ProgressBar } from '../ui/progressBar/progressBar';
|
|
20
|
-
import { PlayButton } from '../ui/playButton/playButton';
|
|
21
|
-
import { TickBox } from '../ui/tickBox/tickBox';
|
|
22
|
-
import { Blanket } from '../ui/blanket/blanket';
|
|
23
|
-
import { ActionsBar } from '../ui/actionsBar/actionsBar';
|
|
24
|
-
import { IconWrapper } from '../ui/iconWrapper/iconWrapper';
|
|
25
|
-
import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUnavailable, FailedToLoad } from '../ui/iconMessage';
|
|
26
|
-
import { isUploadError, isRateLimitedError, isPollingError } from '../../errors';
|
|
27
|
-
import { Wrapper, ImageContainer } from '../ui/wrapper';
|
|
28
|
-
import { fileCardImageViewSelector } from '../classnames';
|
|
29
|
-
import { useBreakpoint } from '../useBreakpoint';
|
|
30
|
-
import OpenMediaViewerButton from '../ui/openMediaViewerButton/openMediaViewerButton';
|
|
31
|
-
export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
32
|
-
var innerRef = _ref.innerRef,
|
|
33
|
-
onImageLoad = _ref.onImageLoad,
|
|
34
|
-
onImageError = _ref.onImageError,
|
|
35
|
-
dimensions = _ref.dimensions,
|
|
36
|
-
onClick = _ref.onClick,
|
|
37
|
-
onMouseEnter = _ref.onMouseEnter,
|
|
38
|
-
testId = _ref.testId,
|
|
39
|
-
metadata = _ref.metadata,
|
|
40
|
-
status = _ref.status,
|
|
41
|
-
selected = _ref.selected,
|
|
42
|
-
selectable = _ref.selectable,
|
|
43
|
-
cardPreview = _ref.cardPreview,
|
|
44
|
-
mediaCardCursor = _ref.mediaCardCursor,
|
|
45
|
-
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
46
|
-
progress = _ref.progress,
|
|
47
|
-
alt = _ref.alt,
|
|
48
|
-
resizeMode = _ref.resizeMode,
|
|
49
|
-
onDisplayImage = _ref.onDisplayImage,
|
|
50
|
-
nativeLazyLoad = _ref.nativeLazyLoad,
|
|
51
|
-
forceSyncDisplay = _ref.forceSyncDisplay,
|
|
52
|
-
actions = _ref.actions,
|
|
53
|
-
disableOverlay = _ref.disableOverlay,
|
|
54
|
-
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
55
|
-
titleBoxIcon = _ref.titleBoxIcon,
|
|
56
|
-
error = _ref.error,
|
|
57
|
-
disableAnimation = _ref.disableAnimation,
|
|
58
|
-
_ref$openMediaViewerB = _ref.openMediaViewerButtonRef,
|
|
59
|
-
openMediaViewerButtonRef = _ref$openMediaViewerB === void 0 ? null : _ref$openMediaViewerB,
|
|
60
|
-
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer,
|
|
61
|
-
overriddenCreationDate = _ref.overriddenCreationDate;
|
|
62
|
-
var _useState = useState(false),
|
|
63
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
-
didImageRender = _useState2[0],
|
|
65
|
-
setDidImageRender = _useState2[1];
|
|
66
|
-
var divRef = useRef(null);
|
|
67
|
-
var prevCardPreviewRef = useRef();
|
|
68
|
-
var breakpoint = useBreakpoint(dimensions === null || dimensions === void 0 ? void 0 : dimensions.width, divRef);
|
|
69
|
-
useEffect(function () {
|
|
70
|
-
innerRef && !!divRef.current && innerRef(divRef.current);
|
|
71
|
-
}, [innerRef]);
|
|
72
|
-
useEffect(function () {
|
|
73
|
-
// We should only switch didImageRender to false when cardPreview goes undefined, not when it is changed. as this method could be triggered after onImageLoad callback, falling on a race condition
|
|
74
|
-
if (prevCardPreviewRef.current && !cardPreview) {
|
|
75
|
-
setDidImageRender(false);
|
|
76
|
-
}
|
|
77
|
-
prevCardPreviewRef.current = cardPreview;
|
|
78
|
-
}, [cardPreview]);
|
|
79
|
-
var handleOnImageLoad = function handleOnImageLoad(prevCardPreview) {
|
|
80
|
-
if (prevCardPreview.dataURI !== (cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI)) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
/*
|
|
84
|
-
We render the icon & icon message always, even if there is cardPreview available.
|
|
85
|
-
If the image fails to load/render, the icon will remain, i.e. the user won't see a change until the root card decides to chage status to error.
|
|
86
|
-
If the image renders successfully, we switch this variable to hide the icon & icon message behind the thumbnail in case the image has transparency.
|
|
87
|
-
It is less likely that root component replaces a suceeded cardPreview for a failed one than the opposite case. Therefore we prefer to hide the icon instead show when the image fails, for a smoother transition
|
|
88
|
-
*/
|
|
89
|
-
setDidImageRender(true);
|
|
90
|
-
onImageLoad === null || onImageLoad === void 0 || onImageLoad(cardPreview);
|
|
91
|
-
};
|
|
92
|
-
var handleOnImageError = function handleOnImageError(prevCardPreview) {
|
|
93
|
-
if (prevCardPreview.dataURI !== (cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI)) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
setDidImageRender(false);
|
|
97
|
-
onImageError === null || onImageError === void 0 || onImageError(cardPreview);
|
|
98
|
-
};
|
|
99
|
-
var shouldRenderPlayButton = function shouldRenderPlayButton() {
|
|
100
|
-
var _ref2 = metadata || {},
|
|
101
|
-
mediaType = _ref2.mediaType;
|
|
102
|
-
if (mediaType !== 'video' || !cardPreview) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
return true;
|
|
106
|
-
};
|
|
107
|
-
var getRenderConfigByStatus = function getRenderConfigByStatus() {
|
|
108
|
-
var _ref3 = metadata || {},
|
|
109
|
-
name = _ref3.name,
|
|
110
|
-
mediaType = _ref3.mediaType;
|
|
111
|
-
var isZeroSize = metadata && metadata.size === 0;
|
|
112
|
-
var defaultConfig = {
|
|
113
|
-
renderTypeIcon: !didImageRender,
|
|
114
|
-
renderImageRenderer: !!cardPreview,
|
|
115
|
-
renderPlayButton: !!cardPreview && mediaType === 'video',
|
|
116
|
-
renderBlanket: !disableOverlay,
|
|
117
|
-
renderTitleBox: !disableOverlay && !!name,
|
|
118
|
-
renderTickBox: !disableOverlay && !!selectable
|
|
119
|
-
};
|
|
120
|
-
switch (status) {
|
|
121
|
-
case 'uploading':
|
|
122
|
-
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
123
|
-
renderBlanket: !disableOverlay || mediaType !== 'video',
|
|
124
|
-
isFixedBlanket: true,
|
|
125
|
-
renderProgressBar: true
|
|
126
|
-
});
|
|
127
|
-
case 'processing':
|
|
128
|
-
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
129
|
-
iconMessage: !didImageRender && !isZeroSize ? jsx(CreatingPreview, {
|
|
130
|
-
disableAnimation: disableAnimation
|
|
131
|
-
}) : undefined
|
|
132
|
-
});
|
|
133
|
-
case 'complete':
|
|
134
|
-
return defaultConfig;
|
|
135
|
-
case 'error':
|
|
136
|
-
case 'failed-processing':
|
|
137
|
-
var baseErrorConfig = _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
138
|
-
renderTypeIcon: true,
|
|
139
|
-
renderImageRenderer: false,
|
|
140
|
-
renderTitleBox: false,
|
|
141
|
-
renderPlayButton: false
|
|
142
|
-
});
|
|
143
|
-
var _iconMessage;
|
|
144
|
-
var _customTitleMessage;
|
|
145
|
-
var _ref4 = error || {},
|
|
146
|
-
secondaryError = _ref4.secondaryError;
|
|
147
|
-
if (isRateLimitedError(secondaryError) || isPollingError(secondaryError)) {
|
|
148
|
-
_iconMessage = jsx(PreviewCurrentlyUnavailable, null);
|
|
149
|
-
} else if (isUploadError(error)) {
|
|
150
|
-
_iconMessage = jsx(FailedToUpload, null);
|
|
151
|
-
_customTitleMessage = messages.failed_to_upload;
|
|
152
|
-
} else if (!metadata) {
|
|
153
|
-
_iconMessage = jsx(FailedToLoad, null);
|
|
154
|
-
} else {
|
|
155
|
-
_iconMessage = jsx(PreviewUnavailable, null);
|
|
156
|
-
}
|
|
157
|
-
if (!disableOverlay) {
|
|
158
|
-
var _renderFailedTitleBox = !name || !!_customTitleMessage;
|
|
159
|
-
return _objectSpread(_objectSpread({}, baseErrorConfig), {}, {
|
|
160
|
-
renderTitleBox: !!name && !_customTitleMessage,
|
|
161
|
-
renderFailedTitleBox: _renderFailedTitleBox,
|
|
162
|
-
iconMessage: !_renderFailedTitleBox ? _iconMessage : undefined,
|
|
163
|
-
customTitleMessage: _customTitleMessage
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
return _objectSpread(_objectSpread({}, baseErrorConfig), {}, {
|
|
167
|
-
iconMessage: _iconMessage
|
|
168
|
-
});
|
|
169
|
-
case 'loading-preview':
|
|
170
|
-
case 'loading':
|
|
171
|
-
default:
|
|
172
|
-
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
173
|
-
renderPlayButton: false,
|
|
174
|
-
renderTypeIcon: false,
|
|
175
|
-
renderSpinner: !didImageRender
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
var _getRenderConfigBySta = getRenderConfigByStatus(),
|
|
180
|
-
renderTypeIcon = _getRenderConfigBySta.renderTypeIcon,
|
|
181
|
-
iconMessage = _getRenderConfigBySta.iconMessage,
|
|
182
|
-
renderImageRenderer = _getRenderConfigBySta.renderImageRenderer,
|
|
183
|
-
renderSpinner = _getRenderConfigBySta.renderSpinner,
|
|
184
|
-
renderPlayButton = _getRenderConfigBySta.renderPlayButton,
|
|
185
|
-
renderBlanket = _getRenderConfigBySta.renderBlanket,
|
|
186
|
-
renderProgressBar = _getRenderConfigBySta.renderProgressBar,
|
|
187
|
-
renderTitleBox = _getRenderConfigBySta.renderTitleBox,
|
|
188
|
-
renderFailedTitleBox = _getRenderConfigBySta.renderFailedTitleBox,
|
|
189
|
-
renderTickBox = _getRenderConfigBySta.renderTickBox,
|
|
190
|
-
isFixedBlanket = _getRenderConfigBySta.isFixedBlanket,
|
|
191
|
-
customTitleMessage = _getRenderConfigBySta.customTitleMessage;
|
|
192
|
-
var shouldDisplayBackground = !cardPreview || !disableOverlay || status === 'error' || status === 'failed-processing';
|
|
193
|
-
var isPlayButtonClickable = shouldRenderPlayButton() && !!disableOverlay;
|
|
194
|
-
var isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
195
|
-
// Disable tooltip for Media Single
|
|
196
|
-
var shouldDisplayTooltip = !disableOverlay && !shouldHideTooltip;
|
|
197
|
-
var hasTitleBox = !!(renderTitleBox || renderFailedTitleBox);
|
|
198
|
-
var _ref5 = metadata || {},
|
|
199
|
-
mediaType = _ref5.mediaType,
|
|
200
|
-
mimeType = _ref5.mimeType,
|
|
201
|
-
name = _ref5.name,
|
|
202
|
-
createdAt = _ref5.createdAt;
|
|
203
|
-
var actionsWithDetails = metadata && actions ? attachDetailsToActions(actions, metadata) : [];
|
|
204
|
-
var contents = jsx(React.Fragment, null, jsx(ImageContainer, {
|
|
205
|
-
testId: fileCardImageViewSelector,
|
|
206
|
-
mediaName: name,
|
|
207
|
-
status: status,
|
|
208
|
-
progress: progress,
|
|
209
|
-
selected: selected,
|
|
210
|
-
source: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
211
|
-
}, renderTypeIcon && jsx(IconWrapper, {
|
|
212
|
-
breakpoint: breakpoint,
|
|
213
|
-
hasTitleBox: hasTitleBox
|
|
214
|
-
}, jsx(MimeTypeIcon, {
|
|
215
|
-
testId: "media-card-file-type-icon",
|
|
216
|
-
mediaType: mediaType,
|
|
217
|
-
mimeType: mimeType,
|
|
218
|
-
name: name
|
|
219
|
-
}), iconMessage), renderSpinner && jsx(IconWrapper, {
|
|
220
|
-
breakpoint: breakpoint,
|
|
221
|
-
hasTitleBox: hasTitleBox
|
|
222
|
-
}, jsx(SpinnerIcon, {
|
|
223
|
-
testId: "media-card-loading",
|
|
224
|
-
interactionName: "media-card-loading"
|
|
225
|
-
})), renderImageRenderer && !!cardPreview && jsx(ImageRenderer, {
|
|
226
|
-
cardPreview: cardPreview,
|
|
227
|
-
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
228
|
-
alt: alt || name,
|
|
229
|
-
resizeMode: resizeMode,
|
|
230
|
-
onDisplayImage: onDisplayImage,
|
|
231
|
-
onImageLoad: handleOnImageLoad,
|
|
232
|
-
onImageError: handleOnImageError,
|
|
233
|
-
nativeLazyLoad: nativeLazyLoad,
|
|
234
|
-
forceSyncDisplay: forceSyncDisplay
|
|
235
|
-
}), renderPlayButton && jsx(IconWrapper, {
|
|
236
|
-
breakpoint: breakpoint,
|
|
237
|
-
hasTitleBox: hasTitleBox
|
|
238
|
-
}, jsx(PlayButton, null)), renderBlanket && jsx(Blanket, {
|
|
239
|
-
isFixed: isFixedBlanket
|
|
240
|
-
}), renderTitleBox && name && jsx(TitleBox, {
|
|
241
|
-
name: name,
|
|
242
|
-
createdAt: overriddenCreationDate !== null && overriddenCreationDate !== void 0 ? overriddenCreationDate : createdAt,
|
|
243
|
-
breakpoint: breakpoint,
|
|
244
|
-
titleBoxIcon: titleBoxIcon,
|
|
245
|
-
titleBoxBgColor: titleBoxBgColor
|
|
246
|
-
}), renderFailedTitleBox && jsx(FailedTitleBox, {
|
|
247
|
-
breakpoint: breakpoint,
|
|
248
|
-
customMessage: customTitleMessage
|
|
249
|
-
}), renderProgressBar && jsx(ProgressBar, {
|
|
250
|
-
progress: progress,
|
|
251
|
-
breakpoint: breakpoint,
|
|
252
|
-
positionBottom: !hasTitleBox
|
|
253
|
-
}), renderTickBox && jsx(TickBox, {
|
|
254
|
-
selected: selected
|
|
255
|
-
})), disableOverlay || !actions || actions.length === 0 ? null : jsx(ActionsBar, {
|
|
256
|
-
filename: name,
|
|
257
|
-
actions: actionsWithDetails
|
|
258
|
-
}));
|
|
259
|
-
return jsx(React.Fragment, null, shouldOpenMediaViewer && jsx(OpenMediaViewerButton, {
|
|
260
|
-
fileName: name !== null && name !== void 0 ? name : '',
|
|
261
|
-
innerRef: openMediaViewerButtonRef,
|
|
262
|
-
onClick: onClick
|
|
263
|
-
}), jsx(Wrapper, {
|
|
264
|
-
testId: testId || 'media-card-view',
|
|
265
|
-
dimensions: dimensions,
|
|
266
|
-
onClick: onClick,
|
|
267
|
-
onMouseEnter: onMouseEnter,
|
|
268
|
-
innerRef: divRef,
|
|
269
|
-
breakpoint: breakpoint,
|
|
270
|
-
mediaCardCursor: mediaCardCursor,
|
|
271
|
-
disableOverlay: !!disableOverlay,
|
|
272
|
-
selected: !!selected,
|
|
273
|
-
displayBackground: shouldDisplayBackground,
|
|
274
|
-
isPlayButtonClickable: isPlayButtonClickable,
|
|
275
|
-
isTickBoxSelectable: isTickBoxSelectable,
|
|
276
|
-
shouldDisplayTooltip: shouldDisplayTooltip
|
|
277
|
-
}, shouldDisplayTooltip ? jsx(Tooltip, {
|
|
278
|
-
content: name,
|
|
279
|
-
position: "bottom",
|
|
280
|
-
tag: "div"
|
|
281
|
-
}, contents) : contents));
|
|
282
|
-
};
|
|
283
|
-
export var CardViewV2 = withAnalyticsEvents({
|
|
284
|
-
onClick: createAndFireMediaCardEvent({
|
|
285
|
-
eventType: 'ui',
|
|
286
|
-
action: 'clicked',
|
|
287
|
-
actionSubject: 'mediaCard',
|
|
288
|
-
attributes: {}
|
|
289
|
-
})
|
|
290
|
-
})(CardViewV2Base);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { withMediaClient } from '@atlaskit/media-client-react';
|
|
7
|
-
import MediaCardAnalyticsErrorBoundary from '../media-card-analytics-error-boundary';
|
|
8
|
-
import { CardV2 } from './cardV2';
|
|
9
|
-
export var CardWithMediaClientV2 = function CardWithMediaClientV2(props) {
|
|
10
|
-
var dimensions = props.dimensions,
|
|
11
|
-
onClick = props.onClick,
|
|
12
|
-
featureFlags = props.featureFlags;
|
|
13
|
-
var Card = React.useMemo(function () {
|
|
14
|
-
return withMediaClient(CardV2);
|
|
15
|
-
}, []);
|
|
16
|
-
var featureFlagsWithMediaCardV2 = React.useMemo(function () {
|
|
17
|
-
return _objectSpread(_objectSpread({}, featureFlags), {}, {
|
|
18
|
-
mediaCardV2: true //used for analytics - internal use only
|
|
19
|
-
});
|
|
20
|
-
}, [featureFlags]);
|
|
21
|
-
return /*#__PURE__*/React.createElement(MediaCardAnalyticsErrorBoundary, {
|
|
22
|
-
dimensions: dimensions,
|
|
23
|
-
onClick: onClick
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Card, _extends({}, props, {
|
|
25
|
-
featureFlags: featureFlagsWithMediaCardV2
|
|
26
|
-
})));
|
|
27
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import { lazy } from 'react';
|
|
4
|
-
export var InlinePlayerLazyV2 = /*#__PURE__*/lazy( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
5
|
-
var _yield$import, InlinePlayerV2;
|
|
6
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7
|
-
while (1) switch (_context.prev = _context.next) {
|
|
8
|
-
case 0:
|
|
9
|
-
_context.next = 2;
|
|
10
|
-
return import( /* webpackChunkName: "@atlaskit-internal_media-card-inlineplayer-v2" */
|
|
11
|
-
'./inlinePlayerV2');
|
|
12
|
-
case 2:
|
|
13
|
-
_yield$import = _context.sent;
|
|
14
|
-
InlinePlayerV2 = _yield$import.InlinePlayerV2;
|
|
15
|
-
return _context.abrupt("return", {
|
|
16
|
-
default: InlinePlayerV2
|
|
17
|
-
});
|
|
18
|
-
case 5:
|
|
19
|
-
case "end":
|
|
20
|
-
return _context.stop();
|
|
21
|
-
}
|
|
22
|
-
}, _callee);
|
|
23
|
-
})));
|