@atlaskit/media-card 74.7.2 → 74.7.4
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 +17 -0
- package/dist/cjs/card/card.js +92 -101
- package/dist/cjs/card/cardImageView/cardOverlay/index.js +1 -1
- package/dist/cjs/card/cardImageView/cardOverlay/styles.js +6 -0
- package/dist/cjs/card/cardImageView/fileCardImageView.js +1 -1
- package/dist/cjs/card/cardLoader.js +3 -3
- package/dist/cjs/card/cardView.js +7 -8
- package/dist/cjs/card/getCardPreview/cache.js +3 -0
- package/dist/cjs/card/getCardPreview/helpers.js +99 -107
- package/dist/cjs/card/getCardPreview/index.js +94 -98
- package/dist/cjs/card/inlinePlayer.js +87 -90
- package/dist/cjs/card/inlinePlayerLazy.js +16 -17
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/common.js +4 -4
- package/dist/cjs/card/ui/unhandledErrorCard/index.js +1 -0
- package/dist/cjs/inline/loader.js +45 -47
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +59 -9
- package/dist/cjs/types.js +4 -4
- package/dist/cjs/utils/cardActions/cardActionIconButton.js +2 -3
- package/dist/cjs/utils/cardActions/cardActionsView.js +1 -1
- package/dist/cjs/utils/cardActions/styles.js +4 -4
- package/dist/cjs/utils/errorIcon/index.js +1 -1
- package/dist/cjs/utils/fileIcon/index.js +1 -1
- package/dist/cjs/utils/progressBar/index.js +1 -1
- package/dist/cjs/utils/progressBar/styles.js +1 -0
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/utils/videoSnapshot.js +38 -40
- package/dist/cjs/utils/viewportDetector.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +6 -9
- package/dist/es2019/card/cardView.js +2 -4
- package/dist/es2019/card/getCardPreview/cache.js +3 -0
- package/dist/es2019/card/inlinePlayer.js +1 -0
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/common.js +3 -3
- package/dist/es2019/inline/loader.js +3 -1
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +60 -7
- package/dist/es2019/types.js +3 -3
- package/dist/es2019/utils/cardActions/cardActionIconButton.js +2 -3
- package/dist/es2019/utils/cardActions/styles.js +3 -3
- package/dist/es2019/utils/globalScope/globalScope.js +0 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +92 -101
- package/dist/esm/card/cardView.js +6 -7
- package/dist/esm/card/getCardPreview/cache.js +3 -0
- package/dist/esm/card/getCardPreview/helpers.js +99 -107
- package/dist/esm/card/getCardPreview/index.js +94 -98
- package/dist/esm/card/inlinePlayer.js +87 -90
- package/dist/esm/card/inlinePlayerLazy.js +14 -16
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/common.js +3 -3
- package/dist/esm/inline/loader.js +39 -41
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +59 -9
- package/dist/esm/types.js +3 -3
- package/dist/esm/utils/cardActions/cardActionIconButton.js +2 -3
- package/dist/esm/utils/cardActions/styles.js +3 -3
- package/dist/esm/utils/globalScope/globalScope.js +0 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/utils/videoSnapshot.js +38 -40
- package/dist/esm/utils/viewportDetector.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/inline/loader.d.ts +1 -0
- package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +1 -0
- package/package.json +6 -6
- package/report.api.md +1 -0
|
@@ -102,92 +102,90 @@ var getCardPreview = /*#__PURE__*/function () {
|
|
|
102
102
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
103
103
|
var mediaClient, id, _ref$dimensions, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, createAnalyticsEvent, featureFlags, traceContext, mode, cachedPreview, dimensionsAreBigger, localPreview, remotePreview;
|
|
104
104
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
105
|
-
while (1) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
105
|
+
while (1) switch (_context.prev = _context.next) {
|
|
106
|
+
case 0:
|
|
107
|
+
mediaClient = _ref.mediaClient, id = _ref.id, _ref$dimensions = _ref.dimensions, dimensions = _ref$dimensions === void 0 ? {} : _ref$dimensions, filePreview = _ref.filePreview, onLocalPreviewError = _ref.onLocalPreviewError, isRemotePreviewReady = _ref.isRemotePreviewReady, imageUrlParams = _ref.imageUrlParams, mediaBlobUrlAttrs = _ref.mediaBlobUrlAttrs, createAnalyticsEvent = _ref.createAnalyticsEvent, featureFlags = _ref.featureFlags, traceContext = _ref.traceContext;
|
|
108
|
+
mode = imageUrlParams.mode;
|
|
109
|
+
cachedPreview = _cache.default.get(id, mode);
|
|
110
|
+
dimensionsAreBigger = (0, _dimensionComparer.isBigger)(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions);
|
|
111
|
+
if (!(cachedPreview && !dimensionsAreBigger)) {
|
|
112
|
+
_context.next = 7;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
if ((0, _mediaCommon.getMediaFeatureFlag)('memoryCacheLogging', featureFlags)) {
|
|
116
|
+
createAnalyticsEvent && (0, _imageRefetchingAnalytics.fireImageFetchingOperationalEvent)(createAnalyticsEvent, 'cache-hit', {
|
|
117
|
+
fileId: id,
|
|
118
|
+
prevDimensions: cachedPreview.dimensions,
|
|
119
|
+
currentDimensions: dimensions,
|
|
120
|
+
source: cachedPreview.source
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return _context.abrupt("return", cachedPreview);
|
|
124
|
+
case 7:
|
|
125
|
+
_context.prev = 7;
|
|
126
|
+
if (!filePreview) {
|
|
127
|
+
_context.next = 13;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
_context.next = 11;
|
|
131
|
+
return (0, _helpers.getCardPreviewFromFilePreview)(filePreview);
|
|
132
|
+
case 11:
|
|
133
|
+
localPreview = _context.sent;
|
|
134
|
+
return _context.abrupt("return", extendAndCachePreview(id, mode, _objectSpread(_objectSpread({}, localPreview), {}, {
|
|
135
|
+
dimensions: dimensions
|
|
136
|
+
}), mediaBlobUrlAttrs));
|
|
137
|
+
case 13:
|
|
138
|
+
_context.next = 20;
|
|
139
|
+
break;
|
|
140
|
+
case 15:
|
|
141
|
+
_context.prev = 15;
|
|
142
|
+
_context.t0 = _context["catch"](7);
|
|
143
|
+
/**
|
|
144
|
+
* We report the error if:
|
|
145
|
+
* - local preview is supported and fails
|
|
146
|
+
* - local preview is unsupported and remote preview is NOT READY
|
|
147
|
+
* i.e. the function was called for "no reason".
|
|
148
|
+
* We DON'T report the error if:
|
|
149
|
+
* - local preview is unsupported and remote preview IS READY
|
|
150
|
+
* i.e. local preview is available and not supported,
|
|
151
|
+
* but we are after the remote preview instead.
|
|
152
|
+
*/
|
|
153
|
+
if (!(0, _errors.isUnsupportedLocalPreviewError)(_context.t0) || (0, _errors.isUnsupportedLocalPreviewError)(_context.t0) && !isRemotePreviewReady) {
|
|
154
|
+
onLocalPreviewError && onLocalPreviewError(_context.t0);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* No matter the reason why the local preview failed, we break the process
|
|
158
|
+
* if there is no remote preview available
|
|
159
|
+
*/
|
|
160
|
+
if (isRemotePreviewReady) {
|
|
139
161
|
_context.next = 20;
|
|
140
162
|
break;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (isRemotePreviewReady) {
|
|
168
|
-
_context.next = 22;
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
throw new _errors.MediaCardError('remote-preview-not-ready');
|
|
172
|
-
case 22:
|
|
173
|
-
_context.next = 24;
|
|
174
|
-
return fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs, traceContext);
|
|
175
|
-
case 24:
|
|
176
|
-
remotePreview = _context.sent;
|
|
177
|
-
if ((0, _mediaCommon.getMediaFeatureFlag)('memoryCacheLogging', featureFlags)) {
|
|
178
|
-
createAnalyticsEvent && (0, _imageRefetchingAnalytics.fireImageFetchingOperationalEvent)(createAnalyticsEvent, 'remote-success', {
|
|
179
|
-
fileId: id,
|
|
180
|
-
prevDimensions: cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions,
|
|
181
|
-
currentDimensions: dimensions,
|
|
182
|
-
dimensionsPercentageDiff: (0, _imageRefetchingAnalytics.calculatePercentageDifference)(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions),
|
|
183
|
-
source: remotePreview.source
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
return _context.abrupt("return", remotePreview);
|
|
187
|
-
case 27:
|
|
188
|
-
case "end":
|
|
189
|
-
return _context.stop();
|
|
190
|
-
}
|
|
163
|
+
}
|
|
164
|
+
throw _context.t0;
|
|
165
|
+
case 20:
|
|
166
|
+
if (isRemotePreviewReady) {
|
|
167
|
+
_context.next = 22;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
throw new _errors.MediaCardError('remote-preview-not-ready');
|
|
171
|
+
case 22:
|
|
172
|
+
_context.next = 24;
|
|
173
|
+
return fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs, traceContext);
|
|
174
|
+
case 24:
|
|
175
|
+
remotePreview = _context.sent;
|
|
176
|
+
if ((0, _mediaCommon.getMediaFeatureFlag)('memoryCacheLogging', featureFlags)) {
|
|
177
|
+
createAnalyticsEvent && (0, _imageRefetchingAnalytics.fireImageFetchingOperationalEvent)(createAnalyticsEvent, 'remote-success', {
|
|
178
|
+
fileId: id,
|
|
179
|
+
prevDimensions: cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions,
|
|
180
|
+
currentDimensions: dimensions,
|
|
181
|
+
dimensionsPercentageDiff: (0, _imageRefetchingAnalytics.calculatePercentageDifference)(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions),
|
|
182
|
+
source: remotePreview.source
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return _context.abrupt("return", remotePreview);
|
|
186
|
+
case 27:
|
|
187
|
+
case "end":
|
|
188
|
+
return _context.stop();
|
|
191
189
|
}
|
|
192
190
|
}, _callee, null, [[7, 15]]);
|
|
193
191
|
}));
|
|
@@ -258,20 +256,18 @@ var fetchAndCacheRemotePreview = /*#__PURE__*/function () {
|
|
|
258
256
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(mediaClient, id, dimensions, params, mediaBlobUrlAttrs, traceContext) {
|
|
259
257
|
var remotePreview;
|
|
260
258
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
261
|
-
while (1) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return _context2.stop();
|
|
274
|
-
}
|
|
259
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
260
|
+
case 0:
|
|
261
|
+
_context2.next = 2;
|
|
262
|
+
return (0, _helpers.getCardPreviewFromBackend)(mediaClient, id, params, traceContext);
|
|
263
|
+
case 2:
|
|
264
|
+
remotePreview = _context2.sent;
|
|
265
|
+
return _context2.abrupt("return", extendAndCachePreview(id, params.mode, _objectSpread(_objectSpread({}, remotePreview), {}, {
|
|
266
|
+
dimensions: dimensions
|
|
267
|
+
}), mediaBlobUrlAttrs));
|
|
268
|
+
case 4:
|
|
269
|
+
case "end":
|
|
270
|
+
return _context2.stop();
|
|
275
271
|
}
|
|
276
272
|
}, _callee2);
|
|
277
273
|
}));
|
|
@@ -58,32 +58,31 @@ var InlinePlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
58
58
|
fileSrc: fileSrc
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
|
+
// Tries to use the binary artifact to provide something to play while the video is still processing
|
|
61
62
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setBinaryURL", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
62
63
|
var _this$props, mediaClient, identifier, onError, id, collectionName, fileSrc;
|
|
63
64
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
64
|
-
while (1) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return _context.stop();
|
|
86
|
-
}
|
|
65
|
+
while (1) switch (_context.prev = _context.next) {
|
|
66
|
+
case 0:
|
|
67
|
+
_this$props = _this.props, mediaClient = _this$props.mediaClient, identifier = _this$props.identifier, onError = _this$props.onError;
|
|
68
|
+
id = identifier.id, collectionName = identifier.collectionName;
|
|
69
|
+
_context.prev = 2;
|
|
70
|
+
_context.next = 5;
|
|
71
|
+
return mediaClient.file.getFileBinaryURL(id, collectionName);
|
|
72
|
+
case 5:
|
|
73
|
+
fileSrc = _context.sent;
|
|
74
|
+
_this.setFileSrc(fileSrc);
|
|
75
|
+
_context.next = 12;
|
|
76
|
+
break;
|
|
77
|
+
case 9:
|
|
78
|
+
_context.prev = 9;
|
|
79
|
+
_context.t0 = _context["catch"](2);
|
|
80
|
+
if (onError && _context.t0 instanceof Error) {
|
|
81
|
+
onError(_context.t0);
|
|
82
|
+
}
|
|
83
|
+
case 12:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context.stop();
|
|
87
86
|
}
|
|
88
87
|
}, _callee, null, [[2, 9]]);
|
|
89
88
|
})));
|
|
@@ -147,75 +146,73 @@ var InlinePlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
147
146
|
var _next = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(fileState) {
|
|
148
147
|
var existingFileSrc, _yield$fileState$prev, value, fileSrc, artifactName, artifacts, _fileSrc, onError;
|
|
149
148
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
150
|
-
while (1) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if (!(fileState.status === 'processed' || fileState.status === 'processing')) {
|
|
188
|
-
_context2.next = 30;
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
artifactName = getPreferredVideoArtifact(fileState);
|
|
192
|
-
artifacts = fileState.artifacts;
|
|
193
|
-
if (!(!artifactName || !artifacts)) {
|
|
194
|
-
_context2.next = 19;
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
_this2.setBinaryURL();
|
|
198
|
-
return _context2.abrupt("return");
|
|
199
|
-
case 19:
|
|
200
|
-
_context2.prev = 19;
|
|
201
|
-
_context2.next = 22;
|
|
202
|
-
return mediaClient.file.getArtifactURL(artifacts, artifactName, collectionName);
|
|
203
|
-
case 22:
|
|
204
|
-
_fileSrc = _context2.sent;
|
|
205
|
-
_this2.setFileSrc(_fileSrc);
|
|
149
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
150
|
+
case 0:
|
|
151
|
+
if (fileState.status === 'uploading') {
|
|
152
|
+
_this2.setState({
|
|
153
|
+
isUploading: true,
|
|
154
|
+
progress: fileState.progress
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
_this2.setState({
|
|
158
|
+
isUploading: false
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
existingFileSrc = _this2.state.fileSrc; // we want to reuse the existing fileSrc to prevent re renders
|
|
162
|
+
if (!existingFileSrc) {
|
|
163
|
+
_context2.next = 4;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
return _context2.abrupt("return");
|
|
167
|
+
case 4:
|
|
168
|
+
if (!(fileState.status !== 'error' && fileState.preview)) {
|
|
169
|
+
_context2.next = 13;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
_context2.next = 7;
|
|
173
|
+
return fileState.preview;
|
|
174
|
+
case 7:
|
|
175
|
+
_yield$fileState$prev = _context2.sent;
|
|
176
|
+
value = _yield$fileState$prev.value;
|
|
177
|
+
if (!(value instanceof Blob && value.type.indexOf('video/') === 0)) {
|
|
178
|
+
_context2.next = 13;
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
fileSrc = URL.createObjectURL(value);
|
|
182
|
+
_this2.setFileSrc(fileSrc);
|
|
183
|
+
return _context2.abrupt("return");
|
|
184
|
+
case 13:
|
|
185
|
+
if (!(fileState.status === 'processed' || fileState.status === 'processing')) {
|
|
206
186
|
_context2.next = 30;
|
|
207
187
|
break;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
188
|
+
}
|
|
189
|
+
artifactName = getPreferredVideoArtifact(fileState);
|
|
190
|
+
artifacts = fileState.artifacts;
|
|
191
|
+
if (!(!artifactName || !artifacts)) {
|
|
192
|
+
_context2.next = 19;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
_this2.setBinaryURL();
|
|
196
|
+
return _context2.abrupt("return");
|
|
197
|
+
case 19:
|
|
198
|
+
_context2.prev = 19;
|
|
199
|
+
_context2.next = 22;
|
|
200
|
+
return mediaClient.file.getArtifactURL(artifacts, artifactName, collectionName);
|
|
201
|
+
case 22:
|
|
202
|
+
_fileSrc = _context2.sent;
|
|
203
|
+
_this2.setFileSrc(_fileSrc);
|
|
204
|
+
_context2.next = 30;
|
|
205
|
+
break;
|
|
206
|
+
case 26:
|
|
207
|
+
_context2.prev = 26;
|
|
208
|
+
_context2.t0 = _context2["catch"](19);
|
|
209
|
+
onError = _this2.props.onError;
|
|
210
|
+
if (onError && _context2.t0 instanceof Error) {
|
|
211
|
+
onError(_context2.t0);
|
|
212
|
+
}
|
|
213
|
+
case 30:
|
|
214
|
+
case "end":
|
|
215
|
+
return _context2.stop();
|
|
219
216
|
}
|
|
220
217
|
}, _callee2, null, [[19, 26]]);
|
|
221
218
|
}));
|
|
@@ -14,23 +14,22 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
14
14
|
var InlinePlayerLazy = /*#__PURE__*/(0, _react.lazy)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
15
15
|
var _yield$import, InlinePlayer;
|
|
16
16
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
17
|
-
while (1) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
17
|
+
while (1) switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
_context.next = 2;
|
|
20
|
+
return Promise.resolve().then(function () {
|
|
21
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_media-card-inlineplayer" */
|
|
22
|
+
'./inlinePlayer'));
|
|
23
|
+
});
|
|
24
|
+
case 2:
|
|
25
|
+
_yield$import = _context.sent;
|
|
26
|
+
InlinePlayer = _yield$import.InlinePlayer;
|
|
27
|
+
return _context.abrupt("return", {
|
|
28
|
+
default: InlinePlayer
|
|
29
|
+
});
|
|
30
|
+
case 5:
|
|
31
|
+
case "end":
|
|
32
|
+
return _context.stop();
|
|
34
33
|
}
|
|
35
34
|
}, _callee);
|
|
36
35
|
})));
|
|
@@ -90,7 +90,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
90
90
|
}(_react.default.Component);
|
|
91
91
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
92
92
|
var packageName = "@atlaskit/media-card";
|
|
93
|
-
var packageVersion = "74.7.
|
|
93
|
+
var packageVersion = "74.7.4";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.responsiveSettings = exports.getTitleBoxHeight = exports.Breakpoint = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _responsiveSettings;
|
|
10
|
-
var Breakpoint
|
|
11
|
-
exports.Breakpoint = Breakpoint;
|
|
12
|
-
(function (Breakpoint) {
|
|
10
|
+
var Breakpoint = /*#__PURE__*/function (Breakpoint) {
|
|
13
11
|
Breakpoint["SMALL"] = "small";
|
|
14
12
|
Breakpoint["LARGE"] = "large";
|
|
15
|
-
|
|
13
|
+
return Breakpoint;
|
|
14
|
+
}({});
|
|
15
|
+
exports.Breakpoint = Breakpoint;
|
|
16
16
|
var responsiveSettings = (_responsiveSettings = {}, (0, _defineProperty2.default)(_responsiveSettings, Breakpoint.SMALL, {
|
|
17
17
|
fontSize: 11,
|
|
18
18
|
lineHeight: 14,
|
|
@@ -19,6 +19,7 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
19
19
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
20
20
|
var _utils = require("../../../utils");
|
|
21
21
|
var _templateObject;
|
|
22
|
+
/** @jsx jsx */
|
|
22
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
24
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
25
|
var isPercentage = function isPercentage(value) {
|
|
@@ -45,46 +45,44 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
45
45
|
var _componentDidMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
46
46
|
var _yield$Promise$all, _yield$Promise$all2, mediaClient, cardModule, mediaInlineErrorBoundaryModule;
|
|
47
47
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
48
|
-
while (1) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (this.state.MediaInlineCard) {
|
|
53
|
-
_context.next = 17;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
_context.prev = 2;
|
|
57
|
-
_context.next = 5;
|
|
58
|
-
return Promise.all([Promise.resolve().then(function () {
|
|
59
|
-
return _interopRequireWildcard(require('@atlaskit/media-client'));
|
|
60
|
-
}), Promise.resolve().then(function () {
|
|
61
|
-
return _interopRequireWildcard(require('./mediaInlineCard'));
|
|
62
|
-
}), Promise.resolve().then(function () {
|
|
63
|
-
return _interopRequireWildcard(require('./mediaInlineAnalyticsErrorBoundary'));
|
|
64
|
-
})]);
|
|
65
|
-
case 5:
|
|
66
|
-
_yield$Promise$all = _context.sent;
|
|
67
|
-
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 3);
|
|
68
|
-
mediaClient = _yield$Promise$all2[0];
|
|
69
|
-
cardModule = _yield$Promise$all2[1];
|
|
70
|
-
mediaInlineErrorBoundaryModule = _yield$Promise$all2[2];
|
|
71
|
-
MediaInlineCardLoader.MediaInlineCard = mediaClient.withMediaClient(cardModule.MediaInlineCard);
|
|
72
|
-
MediaInlineCardLoader.ErrorBoundary = mediaInlineErrorBoundaryModule.default;
|
|
73
|
-
if (this.isMounted) {
|
|
74
|
-
this.setState({
|
|
75
|
-
MediaInlineCard: MediaInlineCardLoader.MediaInlineCard,
|
|
76
|
-
ErrorBoundary: MediaInlineCardLoader.ErrorBoundary
|
|
77
|
-
});
|
|
78
|
-
}
|
|
48
|
+
while (1) switch (_context.prev = _context.next) {
|
|
49
|
+
case 0:
|
|
50
|
+
this.isMounted = true;
|
|
51
|
+
if (this.state.MediaInlineCard) {
|
|
79
52
|
_context.next = 17;
|
|
80
53
|
break;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
54
|
+
}
|
|
55
|
+
_context.prev = 2;
|
|
56
|
+
_context.next = 5;
|
|
57
|
+
return Promise.all([Promise.resolve().then(function () {
|
|
58
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_media-client" */'@atlaskit/media-client'));
|
|
59
|
+
}), Promise.resolve().then(function () {
|
|
60
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_inline-media-card" */'./mediaInlineCard'));
|
|
61
|
+
}), Promise.resolve().then(function () {
|
|
62
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_media-inline-error-boundary" */'./mediaInlineAnalyticsErrorBoundary'));
|
|
63
|
+
})]);
|
|
64
|
+
case 5:
|
|
65
|
+
_yield$Promise$all = _context.sent;
|
|
66
|
+
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 3);
|
|
67
|
+
mediaClient = _yield$Promise$all2[0];
|
|
68
|
+
cardModule = _yield$Promise$all2[1];
|
|
69
|
+
mediaInlineErrorBoundaryModule = _yield$Promise$all2[2];
|
|
70
|
+
MediaInlineCardLoader.MediaInlineCard = mediaClient.withMediaClient(cardModule.MediaInlineCard);
|
|
71
|
+
MediaInlineCardLoader.ErrorBoundary = mediaInlineErrorBoundaryModule.default;
|
|
72
|
+
if (this.isMounted) {
|
|
73
|
+
this.setState({
|
|
74
|
+
MediaInlineCard: MediaInlineCardLoader.MediaInlineCard,
|
|
75
|
+
ErrorBoundary: MediaInlineCardLoader.ErrorBoundary
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
_context.next = 17;
|
|
79
|
+
break;
|
|
80
|
+
case 15:
|
|
81
|
+
_context.prev = 15;
|
|
82
|
+
_context.t0 = _context["catch"](2);
|
|
83
|
+
case 17:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context.stop();
|
|
88
86
|
}
|
|
89
87
|
}, _callee, this, [[2, 15]]);
|
|
90
88
|
}));
|
|
@@ -98,14 +96,12 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
98
96
|
value: function () {
|
|
99
97
|
var _componentWillUnmount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
100
98
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
101
|
-
while (1) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return _context2.stop();
|
|
108
|
-
}
|
|
99
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
100
|
+
case 0:
|
|
101
|
+
this.isMounted = false;
|
|
102
|
+
case 1:
|
|
103
|
+
case "end":
|
|
104
|
+
return _context2.stop();
|
|
109
105
|
}
|
|
110
106
|
}, _callee2, this);
|
|
111
107
|
}));
|
|
@@ -125,7 +121,9 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
125
121
|
message: ""
|
|
126
122
|
});
|
|
127
123
|
}
|
|
128
|
-
return /*#__PURE__*/_react.default.createElement(ErrorBoundary,
|
|
124
|
+
return /*#__PURE__*/_react.default.createElement(ErrorBoundary, {
|
|
125
|
+
isSelected: this.props.isSelected
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(MediaInlineCard, this.props));
|
|
129
127
|
}
|
|
130
128
|
}]);
|
|
131
129
|
return MediaInlineCardLoader;
|