@atlaskit/media-card 80.5.9 → 80.6.1
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 +19 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/fileCard.js +21 -18
- package/dist/cjs/card/inlinePlayer.js +37 -37
- package/dist/cjs/card/inlinePlayerLazy.js +4 -4
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/inline/loader.js +15 -15
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/utils/videoSnapshot.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/fileCard.js +3 -0
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/fileCard.js +20 -17
- package/dist/esm/card/inlinePlayer.js +36 -36
- package/dist/esm/card/inlinePlayerLazy.js +4 -4
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/inline/loader.js +14 -14
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/utils/videoSnapshot.js +1 -1
- package/dist/types/card/fileCard.d.ts +3 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts4.5/card/fileCard.d.ts +3 -1
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 80.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 80.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`330e005b44aa7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/330e005b44aa7) -
|
|
14
|
+
[ux] Adding support for loading state on media nodes during CWR with image gen. We reuse the
|
|
15
|
+
ai-generating-decoration and make gated changes to rebuild logic for this use case. We add
|
|
16
|
+
onPreviewRender callback to media-card to signal when the image has rendered.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 80.5.9
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -20,7 +20,7 @@ var _label = _interopRequireDefault(require("@atlaskit/react-ufo/label"));
|
|
|
20
20
|
var _excluded = ["identifier"];
|
|
21
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
22
|
var packageName = "@atlaskit/media-card";
|
|
23
|
-
var packageVersion = "80.
|
|
23
|
+
var packageVersion = "80.6.0";
|
|
24
24
|
var CardBase = exports.CardBase = function CardBase(_ref) {
|
|
25
25
|
var identifier = _ref.identifier,
|
|
26
26
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -42,7 +42,7 @@ var _abuseModal = require("@atlaskit/media-ui/abuseModal");
|
|
|
42
42
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
43
43
|
var _experienceTraceIdContext = require("@atlaskit/react-ufo/experience-trace-id-context");
|
|
44
44
|
var _usePressTracing = _interopRequireDefault(require("@atlaskit/react-ufo/use-press-tracing"));
|
|
45
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
45
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
46
46
|
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; }
|
|
47
47
|
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) { (0, _defineProperty2.default)(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; }
|
|
48
48
|
var traceContextRetriever = function traceContextRetriever() {
|
|
@@ -86,6 +86,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
86
86
|
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
87
87
|
titleBoxIcon = _ref.titleBoxIcon,
|
|
88
88
|
isAIGenerating = _ref.isAIGenerating,
|
|
89
|
+
onPreviewRender = _ref.onPreviewRender,
|
|
89
90
|
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
90
91
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
91
92
|
onClick = _ref.onClick,
|
|
@@ -309,46 +310,46 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
309
310
|
};
|
|
310
311
|
}, [fileStateValue === null || fileStateValue === void 0 ? void 0 : fileStateValue.status, metadata.id, metadata.mediaType, metadata.mimeType, metadata.size]);
|
|
311
312
|
var downloadFn = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
312
|
-
var _error;
|
|
313
|
-
return _regenerator.default.wrap(function
|
|
313
|
+
var _error, _t;
|
|
314
|
+
return _regenerator.default.wrap(function (_context) {
|
|
314
315
|
while (1) switch (_context.prev = _context.next) {
|
|
315
316
|
case 0:
|
|
316
317
|
_context.prev = 0;
|
|
317
|
-
_context.next =
|
|
318
|
+
_context.next = 1;
|
|
318
319
|
return mediaClient.file.downloadBinary(identifier.id, metadata.name, identifier.collectionName, traceContext);
|
|
319
|
-
case
|
|
320
|
+
case 1:
|
|
320
321
|
(0, _cardAnalytics.fireDownloadSucceededEvent)(createAnalyticsEvent, fileAttributes, traceContext, fileStateValue === null || fileStateValue === void 0 ? void 0 : fileStateValue.metadataTraceContext);
|
|
321
|
-
_context.next =
|
|
322
|
+
_context.next = 3;
|
|
322
323
|
break;
|
|
323
|
-
case
|
|
324
|
-
_context.prev =
|
|
325
|
-
|
|
326
|
-
_error = new _errors.MediaCardError('download',
|
|
324
|
+
case 2:
|
|
325
|
+
_context.prev = 2;
|
|
326
|
+
_t = _context["catch"](0);
|
|
327
|
+
_error = new _errors.MediaCardError('download', _t);
|
|
327
328
|
(0, _cardAnalytics.fireDownloadFailedEvent)(createAnalyticsEvent, fileAttributes, _error, traceContext, fileStateValue === null || fileStateValue === void 0 ? void 0 : fileStateValue.metadataTraceContext);
|
|
328
|
-
case
|
|
329
|
+
case 3:
|
|
329
330
|
case "end":
|
|
330
331
|
return _context.stop();
|
|
331
332
|
}
|
|
332
|
-
}, _callee, null, [[0,
|
|
333
|
+
}, _callee, null, [[0, 2]]);
|
|
333
334
|
})), [createAnalyticsEvent, fileAttributes, fileStateValue === null || fileStateValue === void 0 ? void 0 : fileStateValue.metadataTraceContext, identifier.collectionName, identifier.id, mediaClient.file, metadata.name, traceContext]);
|
|
334
335
|
var computedActions = (0, _react.useMemo)(function () {
|
|
335
336
|
if (finalStatus === 'failed-processing' || shouldEnableDownloadButton) {
|
|
336
337
|
var handler = /*#__PURE__*/function () {
|
|
337
338
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
338
|
-
return _regenerator.default.wrap(function
|
|
339
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
339
340
|
while (1) switch (_context2.prev = _context2.next) {
|
|
340
341
|
case 0:
|
|
341
342
|
if (!(fileStateValue !== null && fileStateValue !== void 0 && fileStateValue.abuseClassification)) {
|
|
342
|
-
_context2.next =
|
|
343
|
+
_context2.next = 1;
|
|
343
344
|
break;
|
|
344
345
|
}
|
|
345
346
|
setIsAbuseModalOpen(true);
|
|
346
|
-
_context2.next =
|
|
347
|
+
_context2.next = 2;
|
|
347
348
|
break;
|
|
348
|
-
case
|
|
349
|
-
_context2.next =
|
|
349
|
+
case 1:
|
|
350
|
+
_context2.next = 2;
|
|
350
351
|
return downloadFn();
|
|
351
|
-
case
|
|
352
|
+
case 2:
|
|
352
353
|
case "end":
|
|
353
354
|
return _context2.stop();
|
|
354
355
|
}
|
|
@@ -509,6 +510,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
509
510
|
};
|
|
510
511
|
var onSvgLoad = function onSvgLoad() {
|
|
511
512
|
setPreviewDidRender(true);
|
|
513
|
+
onPreviewRender === null || onPreviewRender === void 0 || onPreviewRender(identifier.id);
|
|
512
514
|
};
|
|
513
515
|
var onImageLoad = function onImageLoad(newCardPreview) {
|
|
514
516
|
if (metadata.mimeType === 'image/svg+xml') {
|
|
@@ -516,6 +518,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
516
518
|
}
|
|
517
519
|
onImageLoadBase(newCardPreview);
|
|
518
520
|
setPreviewDidRender(true);
|
|
521
|
+
onPreviewRender === null || onPreviewRender === void 0 || onPreviewRender(identifier.id);
|
|
519
522
|
};
|
|
520
523
|
var onCardClick = function onCardClick(event, analyticsEvent) {
|
|
521
524
|
if (onClick) {
|
|
@@ -20,7 +20,7 @@ var _inlinePlayerWrapper = require("./inlinePlayerWrapper");
|
|
|
20
20
|
var _useBreakpoint = require("./useBreakpoint");
|
|
21
21
|
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
22
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
23
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
24
24
|
var getPreferredVideoArtifact = exports.getPreferredVideoArtifact = function getPreferredVideoArtifact(fileState) {
|
|
25
25
|
if (fileState.status === 'processed' || fileState.status === 'processing') {
|
|
26
26
|
var artifacts = fileState.artifacts;
|
|
@@ -75,58 +75,58 @@ var InlinePlayerBase = exports.InlinePlayerBase = function InlinePlayerBase(_ref
|
|
|
75
75
|
fileState = _useFileState.fileState;
|
|
76
76
|
var init = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
77
77
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fileState) {
|
|
78
|
-
var artifactName, artifacts, newFileSrc, _newFileSrc;
|
|
79
|
-
return _regenerator.default.wrap(function
|
|
78
|
+
var artifactName, artifacts, newFileSrc, _newFileSrc, _t, _t2;
|
|
79
|
+
return _regenerator.default.wrap(function (_context) {
|
|
80
80
|
while (1) switch (_context.prev = _context.next) {
|
|
81
81
|
case 0:
|
|
82
82
|
if (fileState.status === 'processed' || fileState.status === 'processing') {
|
|
83
|
-
_context.next =
|
|
83
|
+
_context.next = 1;
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
return _context.abrupt("return");
|
|
87
|
-
case
|
|
87
|
+
case 1:
|
|
88
88
|
artifactName = getPreferredVideoArtifact(fileState);
|
|
89
89
|
artifacts = fileState.artifacts;
|
|
90
90
|
if (!(!artifactName || !artifacts)) {
|
|
91
|
-
_context.next =
|
|
91
|
+
_context.next = 6;
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
_context.prev =
|
|
95
|
-
_context.next =
|
|
94
|
+
_context.prev = 2;
|
|
95
|
+
_context.next = 3;
|
|
96
96
|
return mediaClient.file.getFileBinaryURL(id, collectionName);
|
|
97
|
-
case
|
|
97
|
+
case 3:
|
|
98
98
|
newFileSrc = _context.sent;
|
|
99
99
|
setFileSrc(newFileSrc);
|
|
100
|
-
_context.next =
|
|
100
|
+
_context.next = 5;
|
|
101
101
|
break;
|
|
102
|
-
case
|
|
103
|
-
_context.prev =
|
|
104
|
-
|
|
105
|
-
if (onErrorRef.current &&
|
|
106
|
-
onErrorRef.current(
|
|
102
|
+
case 4:
|
|
103
|
+
_context.prev = 4;
|
|
104
|
+
_t = _context["catch"](2);
|
|
105
|
+
if (onErrorRef.current && _t instanceof Error) {
|
|
106
|
+
onErrorRef.current(_t);
|
|
107
107
|
}
|
|
108
|
-
case
|
|
108
|
+
case 5:
|
|
109
109
|
return _context.abrupt("return");
|
|
110
|
-
case
|
|
111
|
-
_context.prev =
|
|
112
|
-
_context.next =
|
|
110
|
+
case 6:
|
|
111
|
+
_context.prev = 6;
|
|
112
|
+
_context.next = 7;
|
|
113
113
|
return mediaClient.file.getArtifactURL(artifacts, artifactName, collectionName);
|
|
114
|
-
case
|
|
114
|
+
case 7:
|
|
115
115
|
_newFileSrc = _context.sent;
|
|
116
116
|
setFileSrc(_newFileSrc);
|
|
117
|
-
_context.next =
|
|
117
|
+
_context.next = 9;
|
|
118
118
|
break;
|
|
119
|
-
case
|
|
120
|
-
_context.prev =
|
|
121
|
-
|
|
122
|
-
if (onErrorRef.current &&
|
|
123
|
-
onErrorRef.current(
|
|
119
|
+
case 8:
|
|
120
|
+
_context.prev = 8;
|
|
121
|
+
_t2 = _context["catch"](6);
|
|
122
|
+
if (onErrorRef.current && _t2 instanceof Error) {
|
|
123
|
+
onErrorRef.current(_t2);
|
|
124
124
|
}
|
|
125
|
-
case
|
|
125
|
+
case 9:
|
|
126
126
|
case "end":
|
|
127
127
|
return _context.stop();
|
|
128
128
|
}
|
|
129
|
-
}, _callee, null, [[
|
|
129
|
+
}, _callee, null, [[2, 4], [6, 8]]);
|
|
130
130
|
}));
|
|
131
131
|
return function (_x) {
|
|
132
132
|
return _ref2.apply(this, arguments);
|
|
@@ -142,7 +142,7 @@ var InlinePlayerBase = exports.InlinePlayerBase = function InlinePlayerBase(_ref
|
|
|
142
142
|
var subscribeFileState = /*#__PURE__*/function () {
|
|
143
143
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(fileState) {
|
|
144
144
|
var _yield$fileState$prev, value, newFileSrc;
|
|
145
|
-
return _regenerator.default.wrap(function
|
|
145
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
146
146
|
while (1) switch (_context2.prev = _context2.next) {
|
|
147
147
|
case 0:
|
|
148
148
|
if (fileState.status === 'uploading') {
|
|
@@ -154,32 +154,32 @@ var InlinePlayerBase = exports.InlinePlayerBase = function InlinePlayerBase(_ref
|
|
|
154
154
|
|
|
155
155
|
// We reuse the existing fileSrc to prevent re renders, therefore we only perform fileSrc updates when there isn't any
|
|
156
156
|
if (!fileSrc) {
|
|
157
|
-
_context2.next =
|
|
157
|
+
_context2.next = 1;
|
|
158
158
|
break;
|
|
159
159
|
}
|
|
160
160
|
return _context2.abrupt("return");
|
|
161
|
-
case
|
|
161
|
+
case 1:
|
|
162
162
|
if (!(fileState.status !== 'error' && fileState.preview)) {
|
|
163
|
-
_context2.next =
|
|
163
|
+
_context2.next = 3;
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
|
-
_context2.next =
|
|
166
|
+
_context2.next = 2;
|
|
167
167
|
return fileState.preview;
|
|
168
|
-
case
|
|
168
|
+
case 2:
|
|
169
169
|
_yield$fileState$prev = _context2.sent;
|
|
170
170
|
value = _yield$fileState$prev.value;
|
|
171
171
|
if (!(value instanceof Blob && value.type.indexOf('video/') === 0)) {
|
|
172
|
-
_context2.next =
|
|
172
|
+
_context2.next = 3;
|
|
173
173
|
break;
|
|
174
174
|
}
|
|
175
175
|
newFileSrc = URL.createObjectURL(value);
|
|
176
176
|
setFileSrc(newFileSrc);
|
|
177
177
|
return _context2.abrupt("return");
|
|
178
|
-
case
|
|
178
|
+
case 3:
|
|
179
179
|
if (fileState.status === 'processed' || fileState.status === 'processing') {
|
|
180
180
|
init(fileState);
|
|
181
181
|
}
|
|
182
|
-
case
|
|
182
|
+
case 4:
|
|
183
183
|
case "end":
|
|
184
184
|
return _context2.stop();
|
|
185
185
|
}
|
|
@@ -12,21 +12,21 @@ var _react = require("react");
|
|
|
12
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
13
|
var InlinePlayerLazy = exports.InlinePlayerLazy = /*#__PURE__*/(0, _react.lazy)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
14
14
|
var _yield$import, InlinePlayer;
|
|
15
|
-
return _regenerator.default.wrap(function
|
|
15
|
+
return _regenerator.default.wrap(function (_context) {
|
|
16
16
|
while (1) switch (_context.prev = _context.next) {
|
|
17
17
|
case 0:
|
|
18
|
-
_context.next =
|
|
18
|
+
_context.next = 1;
|
|
19
19
|
return Promise.resolve().then(function () {
|
|
20
20
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_media-card-inlineplayer" */
|
|
21
21
|
'./inlinePlayer'));
|
|
22
22
|
});
|
|
23
|
-
case
|
|
23
|
+
case 1:
|
|
24
24
|
_yield$import = _context.sent;
|
|
25
25
|
InlinePlayer = _yield$import.InlinePlayer;
|
|
26
26
|
return _context.abrupt("return", {
|
|
27
27
|
default: InlinePlayer
|
|
28
28
|
});
|
|
29
|
-
case
|
|
29
|
+
case 2:
|
|
30
30
|
case "end":
|
|
31
31
|
return _context.stop();
|
|
32
32
|
}
|
|
@@ -87,7 +87,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
87
87
|
}(_react.default.Component);
|
|
88
88
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
89
89
|
var packageName = "@atlaskit/media-card";
|
|
90
|
-
var packageVersion = "80.
|
|
90
|
+
var packageVersion = "80.6.0";
|
|
91
91
|
|
|
92
92
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
93
93
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
@@ -18,7 +18,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
19
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
20
20
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
21
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
21
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
22
22
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
23
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
24
|
var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -41,17 +41,17 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
41
41
|
key: "componentDidMount",
|
|
42
42
|
value: function () {
|
|
43
43
|
var _componentDidMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
44
|
-
var _yield$Promise$all, _yield$Promise$all2, mediaClient, cardModule, mediaInlineErrorBoundaryModule;
|
|
45
|
-
return _regenerator.default.wrap(function
|
|
44
|
+
var _yield$Promise$all, _yield$Promise$all2, mediaClient, cardModule, mediaInlineErrorBoundaryModule, _t;
|
|
45
|
+
return _regenerator.default.wrap(function (_context) {
|
|
46
46
|
while (1) switch (_context.prev = _context.next) {
|
|
47
47
|
case 0:
|
|
48
48
|
this.mounted = true;
|
|
49
49
|
if (this.state.MediaInlineCard) {
|
|
50
|
-
_context.next =
|
|
50
|
+
_context.next = 4;
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
|
-
_context.prev =
|
|
54
|
-
_context.next =
|
|
53
|
+
_context.prev = 1;
|
|
54
|
+
_context.next = 2;
|
|
55
55
|
return Promise.all([Promise.resolve().then(function () {
|
|
56
56
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_media-client-react" */'@atlaskit/media-client-react'));
|
|
57
57
|
}), Promise.resolve().then(function () {
|
|
@@ -59,7 +59,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
59
59
|
}), Promise.resolve().then(function () {
|
|
60
60
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_media-inline-error-boundary" */'./mediaInlineAnalyticsErrorBoundary'));
|
|
61
61
|
})]);
|
|
62
|
-
case
|
|
62
|
+
case 2:
|
|
63
63
|
_yield$Promise$all = _context.sent;
|
|
64
64
|
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 3);
|
|
65
65
|
mediaClient = _yield$Promise$all2[0];
|
|
@@ -73,16 +73,16 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
73
73
|
ErrorBoundary: MediaInlineCardLoader.ErrorBoundary
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
_context.next =
|
|
76
|
+
_context.next = 4;
|
|
77
77
|
break;
|
|
78
|
-
case
|
|
79
|
-
_context.prev =
|
|
80
|
-
|
|
81
|
-
case
|
|
78
|
+
case 3:
|
|
79
|
+
_context.prev = 3;
|
|
80
|
+
_t = _context["catch"](1);
|
|
81
|
+
case 4:
|
|
82
82
|
case "end":
|
|
83
83
|
return _context.stop();
|
|
84
84
|
}
|
|
85
|
-
}, _callee, this, [[
|
|
85
|
+
}, _callee, this, [[1, 3]]);
|
|
86
86
|
}));
|
|
87
87
|
function componentDidMount() {
|
|
88
88
|
return _componentDidMount.apply(this, arguments);
|
|
@@ -93,7 +93,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
93
93
|
key: "componentWillUnmount",
|
|
94
94
|
value: function () {
|
|
95
95
|
var _componentWillUnmount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
96
|
-
return _regenerator.default.wrap(function
|
|
96
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
97
97
|
while (1) switch (_context2.prev = _context2.next) {
|
|
98
98
|
case 0:
|
|
99
99
|
this.mounted = false;
|
|
@@ -116,7 +116,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
116
116
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
117
117
|
var analyticsContext = {
|
|
118
118
|
packageVersion: "@atlaskit/media-card",
|
|
119
|
-
packageName: "80.
|
|
119
|
+
packageName: "80.6.0",
|
|
120
120
|
componentName: 'mediaInlineCard',
|
|
121
121
|
component: 'mediaInlineCard'
|
|
122
122
|
};
|
|
@@ -19,7 +19,7 @@ var _globalScope = require("./globalScope/globalScope");
|
|
|
19
19
|
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; }
|
|
20
20
|
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) { (0, _defineProperty2.default)(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; }
|
|
21
21
|
var packageName = "@atlaskit/media-card";
|
|
22
|
-
var packageVersion = "80.
|
|
22
|
+
var packageVersion = "80.6.0";
|
|
23
23
|
var SAMPLE_RATE = 0.05;
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -9,7 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var takeSnapshot = exports.takeSnapshot = /*#__PURE__*/function () {
|
|
11
11
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(blob) {
|
|
12
|
-
return _regenerator.default.wrap(function
|
|
12
|
+
return _regenerator.default.wrap(function (_context) {
|
|
13
13
|
while (1) switch (_context.prev = _context.next) {
|
|
14
14
|
case 0:
|
|
15
15
|
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -9,7 +9,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
|
|
|
9
9
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
import UFOLabel from '@atlaskit/react-ufo/label';
|
|
11
11
|
const packageName = "@atlaskit/media-card";
|
|
12
|
-
const packageVersion = "80.
|
|
12
|
+
const packageVersion = "80.6.0";
|
|
13
13
|
export const CardBase = ({
|
|
14
14
|
identifier,
|
|
15
15
|
...otherProps
|
|
@@ -67,6 +67,7 @@ export const FileCard = ({
|
|
|
67
67
|
titleBoxBgColor,
|
|
68
68
|
titleBoxIcon,
|
|
69
69
|
isAIGenerating,
|
|
70
|
+
onPreviewRender,
|
|
70
71
|
shouldHideTooltip,
|
|
71
72
|
mediaViewerItems,
|
|
72
73
|
onClick,
|
|
@@ -428,6 +429,7 @@ export const FileCard = ({
|
|
|
428
429
|
};
|
|
429
430
|
const onSvgLoad = () => {
|
|
430
431
|
setPreviewDidRender(true);
|
|
432
|
+
onPreviewRender === null || onPreviewRender === void 0 ? void 0 : onPreviewRender(identifier.id);
|
|
431
433
|
};
|
|
432
434
|
const onImageLoad = newCardPreview => {
|
|
433
435
|
if (metadata.mimeType === 'image/svg+xml') {
|
|
@@ -435,6 +437,7 @@ export const FileCard = ({
|
|
|
435
437
|
}
|
|
436
438
|
onImageLoadBase(newCardPreview);
|
|
437
439
|
setPreviewDidRender(true);
|
|
440
|
+
onPreviewRender === null || onPreviewRender === void 0 ? void 0 : onPreviewRender(identifier.id);
|
|
438
441
|
};
|
|
439
442
|
const onCardClick = (event, analyticsEvent) => {
|
|
440
443
|
if (onClick) {
|
|
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
|
|
|
66
66
|
}
|
|
67
67
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
68
68
|
const packageName = "@atlaskit/media-card";
|
|
69
|
-
const packageVersion = "80.
|
|
69
|
+
const packageVersion = "80.6.0";
|
|
70
70
|
|
|
71
71
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
72
72
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
|
|
|
37
37
|
} = this.state;
|
|
38
38
|
const analyticsContext = {
|
|
39
39
|
packageVersion: "@atlaskit/media-card",
|
|
40
|
-
packageName: "80.
|
|
40
|
+
packageName: "80.6.0",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -9,7 +9,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
9
9
|
import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
10
10
|
import { getMediaGlobalScope } from './globalScope/globalScope';
|
|
11
11
|
const packageName = "@atlaskit/media-card";
|
|
12
|
-
const packageVersion = "80.
|
|
12
|
+
const packageVersion = "80.6.0";
|
|
13
13
|
const SAMPLE_RATE = 0.05;
|
|
14
14
|
|
|
15
15
|
/**
|
package/dist/esm/card/card.js
CHANGED
|
@@ -11,7 +11,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
|
|
|
11
11
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
12
|
import UFOLabel from '@atlaskit/react-ufo/label';
|
|
13
13
|
var packageName = "@atlaskit/media-card";
|
|
14
|
-
var packageVersion = "80.
|
|
14
|
+
var packageVersion = "80.6.0";
|
|
15
15
|
export var CardBase = function CardBase(_ref) {
|
|
16
16
|
var identifier = _ref.identifier,
|
|
17
17
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -78,6 +78,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
78
78
|
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
79
79
|
titleBoxIcon = _ref.titleBoxIcon,
|
|
80
80
|
isAIGenerating = _ref.isAIGenerating,
|
|
81
|
+
onPreviewRender = _ref.onPreviewRender,
|
|
81
82
|
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
82
83
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
83
84
|
onClick = _ref.onClick,
|
|
@@ -301,46 +302,46 @@ export var FileCard = function FileCard(_ref) {
|
|
|
301
302
|
};
|
|
302
303
|
}, [fileStateValue === null || fileStateValue === void 0 ? void 0 : fileStateValue.status, metadata.id, metadata.mediaType, metadata.mimeType, metadata.size]);
|
|
303
304
|
var downloadFn = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
304
|
-
var _error;
|
|
305
|
-
return _regeneratorRuntime.wrap(function
|
|
305
|
+
var _error, _t;
|
|
306
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
306
307
|
while (1) switch (_context.prev = _context.next) {
|
|
307
308
|
case 0:
|
|
308
309
|
_context.prev = 0;
|
|
309
|
-
_context.next =
|
|
310
|
+
_context.next = 1;
|
|
310
311
|
return mediaClient.file.downloadBinary(identifier.id, metadata.name, identifier.collectionName, traceContext);
|
|
311
|
-
case
|
|
312
|
+
case 1:
|
|
312
313
|
fireDownloadSucceededEvent(createAnalyticsEvent, fileAttributes, traceContext, fileStateValue === null || fileStateValue === void 0 ? void 0 : fileStateValue.metadataTraceContext);
|
|
313
|
-
_context.next =
|
|
314
|
+
_context.next = 3;
|
|
314
315
|
break;
|
|
315
|
-
case
|
|
316
|
-
_context.prev =
|
|
317
|
-
|
|
318
|
-
_error = new MediaCardError('download',
|
|
316
|
+
case 2:
|
|
317
|
+
_context.prev = 2;
|
|
318
|
+
_t = _context["catch"](0);
|
|
319
|
+
_error = new MediaCardError('download', _t);
|
|
319
320
|
fireDownloadFailedEvent(createAnalyticsEvent, fileAttributes, _error, traceContext, fileStateValue === null || fileStateValue === void 0 ? void 0 : fileStateValue.metadataTraceContext);
|
|
320
|
-
case
|
|
321
|
+
case 3:
|
|
321
322
|
case "end":
|
|
322
323
|
return _context.stop();
|
|
323
324
|
}
|
|
324
|
-
}, _callee, null, [[0,
|
|
325
|
+
}, _callee, null, [[0, 2]]);
|
|
325
326
|
})), [createAnalyticsEvent, fileAttributes, fileStateValue === null || fileStateValue === void 0 ? void 0 : fileStateValue.metadataTraceContext, identifier.collectionName, identifier.id, mediaClient.file, metadata.name, traceContext]);
|
|
326
327
|
var computedActions = useMemo(function () {
|
|
327
328
|
if (finalStatus === 'failed-processing' || shouldEnableDownloadButton) {
|
|
328
329
|
var handler = /*#__PURE__*/function () {
|
|
329
330
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
330
|
-
return _regeneratorRuntime.wrap(function
|
|
331
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
331
332
|
while (1) switch (_context2.prev = _context2.next) {
|
|
332
333
|
case 0:
|
|
333
334
|
if (!(fileStateValue !== null && fileStateValue !== void 0 && fileStateValue.abuseClassification)) {
|
|
334
|
-
_context2.next =
|
|
335
|
+
_context2.next = 1;
|
|
335
336
|
break;
|
|
336
337
|
}
|
|
337
338
|
setIsAbuseModalOpen(true);
|
|
338
|
-
_context2.next =
|
|
339
|
+
_context2.next = 2;
|
|
339
340
|
break;
|
|
340
|
-
case
|
|
341
|
-
_context2.next =
|
|
341
|
+
case 1:
|
|
342
|
+
_context2.next = 2;
|
|
342
343
|
return downloadFn();
|
|
343
|
-
case
|
|
344
|
+
case 2:
|
|
344
345
|
case "end":
|
|
345
346
|
return _context2.stop();
|
|
346
347
|
}
|
|
@@ -501,6 +502,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
501
502
|
};
|
|
502
503
|
var onSvgLoad = function onSvgLoad() {
|
|
503
504
|
setPreviewDidRender(true);
|
|
505
|
+
onPreviewRender === null || onPreviewRender === void 0 || onPreviewRender(identifier.id);
|
|
504
506
|
};
|
|
505
507
|
var onImageLoad = function onImageLoad(newCardPreview) {
|
|
506
508
|
if (metadata.mimeType === 'image/svg+xml') {
|
|
@@ -508,6 +510,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
508
510
|
}
|
|
509
511
|
onImageLoadBase(newCardPreview);
|
|
510
512
|
setPreviewDidRender(true);
|
|
513
|
+
onPreviewRender === null || onPreviewRender === void 0 || onPreviewRender(identifier.id);
|
|
511
514
|
};
|
|
512
515
|
var onCardClick = function onCardClick(event, analyticsEvent) {
|
|
513
516
|
if (onClick) {
|
|
@@ -66,58 +66,58 @@ export var InlinePlayerBase = function InlinePlayerBase(_ref) {
|
|
|
66
66
|
fileState = _useFileState.fileState;
|
|
67
67
|
var init = useCallback( /*#__PURE__*/function () {
|
|
68
68
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileState) {
|
|
69
|
-
var artifactName, artifacts, newFileSrc, _newFileSrc;
|
|
70
|
-
return _regeneratorRuntime.wrap(function
|
|
69
|
+
var artifactName, artifacts, newFileSrc, _newFileSrc, _t, _t2;
|
|
70
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
71
71
|
while (1) switch (_context.prev = _context.next) {
|
|
72
72
|
case 0:
|
|
73
73
|
if (fileState.status === 'processed' || fileState.status === 'processing') {
|
|
74
|
-
_context.next =
|
|
74
|
+
_context.next = 1;
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
return _context.abrupt("return");
|
|
78
|
-
case
|
|
78
|
+
case 1:
|
|
79
79
|
artifactName = getPreferredVideoArtifact(fileState);
|
|
80
80
|
artifacts = fileState.artifacts;
|
|
81
81
|
if (!(!artifactName || !artifacts)) {
|
|
82
|
-
_context.next =
|
|
82
|
+
_context.next = 6;
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
|
-
_context.prev =
|
|
86
|
-
_context.next =
|
|
85
|
+
_context.prev = 2;
|
|
86
|
+
_context.next = 3;
|
|
87
87
|
return mediaClient.file.getFileBinaryURL(id, collectionName);
|
|
88
|
-
case
|
|
88
|
+
case 3:
|
|
89
89
|
newFileSrc = _context.sent;
|
|
90
90
|
setFileSrc(newFileSrc);
|
|
91
|
-
_context.next =
|
|
91
|
+
_context.next = 5;
|
|
92
92
|
break;
|
|
93
|
-
case
|
|
94
|
-
_context.prev =
|
|
95
|
-
|
|
96
|
-
if (onErrorRef.current &&
|
|
97
|
-
onErrorRef.current(
|
|
93
|
+
case 4:
|
|
94
|
+
_context.prev = 4;
|
|
95
|
+
_t = _context["catch"](2);
|
|
96
|
+
if (onErrorRef.current && _t instanceof Error) {
|
|
97
|
+
onErrorRef.current(_t);
|
|
98
98
|
}
|
|
99
|
-
case
|
|
99
|
+
case 5:
|
|
100
100
|
return _context.abrupt("return");
|
|
101
|
-
case
|
|
102
|
-
_context.prev =
|
|
103
|
-
_context.next =
|
|
101
|
+
case 6:
|
|
102
|
+
_context.prev = 6;
|
|
103
|
+
_context.next = 7;
|
|
104
104
|
return mediaClient.file.getArtifactURL(artifacts, artifactName, collectionName);
|
|
105
|
-
case
|
|
105
|
+
case 7:
|
|
106
106
|
_newFileSrc = _context.sent;
|
|
107
107
|
setFileSrc(_newFileSrc);
|
|
108
|
-
_context.next =
|
|
108
|
+
_context.next = 9;
|
|
109
109
|
break;
|
|
110
|
-
case
|
|
111
|
-
_context.prev =
|
|
112
|
-
|
|
113
|
-
if (onErrorRef.current &&
|
|
114
|
-
onErrorRef.current(
|
|
110
|
+
case 8:
|
|
111
|
+
_context.prev = 8;
|
|
112
|
+
_t2 = _context["catch"](6);
|
|
113
|
+
if (onErrorRef.current && _t2 instanceof Error) {
|
|
114
|
+
onErrorRef.current(_t2);
|
|
115
115
|
}
|
|
116
|
-
case
|
|
116
|
+
case 9:
|
|
117
117
|
case "end":
|
|
118
118
|
return _context.stop();
|
|
119
119
|
}
|
|
120
|
-
}, _callee, null, [[
|
|
120
|
+
}, _callee, null, [[2, 4], [6, 8]]);
|
|
121
121
|
}));
|
|
122
122
|
return function (_x) {
|
|
123
123
|
return _ref2.apply(this, arguments);
|
|
@@ -133,7 +133,7 @@ export var InlinePlayerBase = function InlinePlayerBase(_ref) {
|
|
|
133
133
|
var subscribeFileState = /*#__PURE__*/function () {
|
|
134
134
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fileState) {
|
|
135
135
|
var _yield$fileState$prev, value, newFileSrc;
|
|
136
|
-
return _regeneratorRuntime.wrap(function
|
|
136
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
137
137
|
while (1) switch (_context2.prev = _context2.next) {
|
|
138
138
|
case 0:
|
|
139
139
|
if (fileState.status === 'uploading') {
|
|
@@ -145,32 +145,32 @@ export var InlinePlayerBase = function InlinePlayerBase(_ref) {
|
|
|
145
145
|
|
|
146
146
|
// We reuse the existing fileSrc to prevent re renders, therefore we only perform fileSrc updates when there isn't any
|
|
147
147
|
if (!fileSrc) {
|
|
148
|
-
_context2.next =
|
|
148
|
+
_context2.next = 1;
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
151
151
|
return _context2.abrupt("return");
|
|
152
|
-
case
|
|
152
|
+
case 1:
|
|
153
153
|
if (!(fileState.status !== 'error' && fileState.preview)) {
|
|
154
|
-
_context2.next =
|
|
154
|
+
_context2.next = 3;
|
|
155
155
|
break;
|
|
156
156
|
}
|
|
157
|
-
_context2.next =
|
|
157
|
+
_context2.next = 2;
|
|
158
158
|
return fileState.preview;
|
|
159
|
-
case
|
|
159
|
+
case 2:
|
|
160
160
|
_yield$fileState$prev = _context2.sent;
|
|
161
161
|
value = _yield$fileState$prev.value;
|
|
162
162
|
if (!(value instanceof Blob && value.type.indexOf('video/') === 0)) {
|
|
163
|
-
_context2.next =
|
|
163
|
+
_context2.next = 3;
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
166
|
newFileSrc = URL.createObjectURL(value);
|
|
167
167
|
setFileSrc(newFileSrc);
|
|
168
168
|
return _context2.abrupt("return");
|
|
169
|
-
case
|
|
169
|
+
case 3:
|
|
170
170
|
if (fileState.status === 'processed' || fileState.status === 'processing') {
|
|
171
171
|
init(fileState);
|
|
172
172
|
}
|
|
173
|
-
case
|
|
173
|
+
case 4:
|
|
174
174
|
case "end":
|
|
175
175
|
return _context2.stop();
|
|
176
176
|
}
|
|
@@ -3,19 +3,19 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
import { lazy } from 'react';
|
|
4
4
|
export var InlinePlayerLazy = /*#__PURE__*/lazy( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
5
5
|
var _yield$import, InlinePlayer;
|
|
6
|
-
return _regeneratorRuntime.wrap(function
|
|
6
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
7
7
|
while (1) switch (_context.prev = _context.next) {
|
|
8
8
|
case 0:
|
|
9
|
-
_context.next =
|
|
9
|
+
_context.next = 1;
|
|
10
10
|
return import( /* webpackChunkName: "@atlaskit-internal_media-card-inlineplayer" */
|
|
11
11
|
'./inlinePlayer');
|
|
12
|
-
case
|
|
12
|
+
case 1:
|
|
13
13
|
_yield$import = _context.sent;
|
|
14
14
|
InlinePlayer = _yield$import.InlinePlayer;
|
|
15
15
|
return _context.abrupt("return", {
|
|
16
16
|
default: InlinePlayer
|
|
17
17
|
});
|
|
18
|
-
case
|
|
18
|
+
case 2:
|
|
19
19
|
case "end":
|
|
20
20
|
return _context.stop();
|
|
21
21
|
}
|
|
@@ -80,7 +80,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
80
80
|
}(React.Component);
|
|
81
81
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
82
82
|
var packageName = "@atlaskit/media-card";
|
|
83
|
-
var packageVersion = "80.
|
|
83
|
+
var packageVersion = "80.6.0";
|
|
84
84
|
|
|
85
85
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
86
86
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -32,19 +32,19 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
32
32
|
key: "componentDidMount",
|
|
33
33
|
value: function () {
|
|
34
34
|
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
35
|
-
var _yield$Promise$all, _yield$Promise$all2, mediaClient, cardModule, mediaInlineErrorBoundaryModule;
|
|
36
|
-
return _regeneratorRuntime.wrap(function
|
|
35
|
+
var _yield$Promise$all, _yield$Promise$all2, mediaClient, cardModule, mediaInlineErrorBoundaryModule, _t;
|
|
36
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
37
37
|
while (1) switch (_context.prev = _context.next) {
|
|
38
38
|
case 0:
|
|
39
39
|
this.mounted = true;
|
|
40
40
|
if (this.state.MediaInlineCard) {
|
|
41
|
-
_context.next =
|
|
41
|
+
_context.next = 4;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
|
-
_context.prev =
|
|
45
|
-
_context.next =
|
|
44
|
+
_context.prev = 1;
|
|
45
|
+
_context.next = 2;
|
|
46
46
|
return Promise.all([import( /* webpackChunkName: "@atlaskit-internal_media-client-react" */'@atlaskit/media-client-react'), import( /* webpackChunkName: "@atlaskit-internal_inline-media-card" */'./mediaInlineCard'), import( /* webpackChunkName: "@atlaskit-internal_media-inline-error-boundary" */'./mediaInlineAnalyticsErrorBoundary')]);
|
|
47
|
-
case
|
|
47
|
+
case 2:
|
|
48
48
|
_yield$Promise$all = _context.sent;
|
|
49
49
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
|
|
50
50
|
mediaClient = _yield$Promise$all2[0];
|
|
@@ -58,16 +58,16 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
58
58
|
ErrorBoundary: MediaInlineCardLoader.ErrorBoundary
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
_context.next =
|
|
61
|
+
_context.next = 4;
|
|
62
62
|
break;
|
|
63
|
-
case
|
|
64
|
-
_context.prev =
|
|
65
|
-
|
|
66
|
-
case
|
|
63
|
+
case 3:
|
|
64
|
+
_context.prev = 3;
|
|
65
|
+
_t = _context["catch"](1);
|
|
66
|
+
case 4:
|
|
67
67
|
case "end":
|
|
68
68
|
return _context.stop();
|
|
69
69
|
}
|
|
70
|
-
}, _callee, this, [[
|
|
70
|
+
}, _callee, this, [[1, 3]]);
|
|
71
71
|
}));
|
|
72
72
|
function componentDidMount() {
|
|
73
73
|
return _componentDidMount.apply(this, arguments);
|
|
@@ -78,7 +78,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
78
78
|
key: "componentWillUnmount",
|
|
79
79
|
value: function () {
|
|
80
80
|
var _componentWillUnmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
81
|
-
return _regeneratorRuntime.wrap(function
|
|
81
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
82
82
|
while (1) switch (_context2.prev = _context2.next) {
|
|
83
83
|
case 0:
|
|
84
84
|
this.mounted = false;
|
|
@@ -101,7 +101,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
101
101
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
102
102
|
var analyticsContext = {
|
|
103
103
|
packageVersion: "@atlaskit/media-card",
|
|
104
|
-
packageName: "80.
|
|
104
|
+
packageName: "80.6.0",
|
|
105
105
|
componentName: 'mediaInlineCard',
|
|
106
106
|
component: 'mediaInlineCard'
|
|
107
107
|
};
|
|
@@ -13,7 +13,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
13
13
|
import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
14
14
|
import { getMediaGlobalScope } from './globalScope/globalScope';
|
|
15
15
|
var packageName = "@atlaskit/media-card";
|
|
16
|
-
var packageVersion = "80.
|
|
16
|
+
var packageVersion = "80.6.0";
|
|
17
17
|
var SAMPLE_RATE = 0.05;
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
export var takeSnapshot = /*#__PURE__*/function () {
|
|
4
4
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(blob) {
|
|
5
|
-
return _regeneratorRuntime.wrap(function
|
|
5
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
6
6
|
while (1) switch (_context.prev = _context.next) {
|
|
7
7
|
case 0:
|
|
8
8
|
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
@@ -35,6 +35,8 @@ export interface FileCardProps extends CardEventProps {
|
|
|
35
35
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
36
36
|
/** Indicates the media card is being generated by AI (e.g. Rovo image-create). */
|
|
37
37
|
readonly isAIGenerating?: boolean;
|
|
38
|
+
/** Callback fired when the media card's image preview has rendered. */
|
|
39
|
+
readonly onPreviewRender?: (fileId: string) => void;
|
|
38
40
|
/** Instance of file identifier. */
|
|
39
41
|
readonly identifier: FileIdentifier;
|
|
40
42
|
/** Lazy loads the media file. */
|
|
@@ -64,4 +66,4 @@ export interface FileCardProps extends CardEventProps {
|
|
|
64
66
|
/** Extensions for the media viewer (e.g. comment button in header). */
|
|
65
67
|
readonly mediaViewerExtensions?: MediaViewerExtensions;
|
|
66
68
|
}
|
|
67
|
-
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, isAIGenerating, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
|
69
|
+
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, isAIGenerating, onPreviewRender, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export interface SharedCardProps {
|
|
|
67
67
|
readonly titleBoxBgColor?: string;
|
|
68
68
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
69
69
|
readonly isAIGenerating?: boolean;
|
|
70
|
+
readonly onPreviewRender?: (fileId: string) => void;
|
|
70
71
|
readonly viewerOptions?: ViewerOptionsProps;
|
|
71
72
|
/** Sets options for viewer **/
|
|
72
73
|
readonly includeHashForDuplicateFiles?: boolean;
|
|
@@ -35,6 +35,8 @@ export interface FileCardProps extends CardEventProps {
|
|
|
35
35
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
36
36
|
/** Indicates the media card is being generated by AI (e.g. Rovo image-create). */
|
|
37
37
|
readonly isAIGenerating?: boolean;
|
|
38
|
+
/** Callback fired when the media card's image preview has rendered. */
|
|
39
|
+
readonly onPreviewRender?: (fileId: string) => void;
|
|
38
40
|
/** Instance of file identifier. */
|
|
39
41
|
readonly identifier: FileIdentifier;
|
|
40
42
|
/** Lazy loads the media file. */
|
|
@@ -64,4 +66,4 @@ export interface FileCardProps extends CardEventProps {
|
|
|
64
66
|
/** Extensions for the media viewer (e.g. comment button in header). */
|
|
65
67
|
readonly mediaViewerExtensions?: MediaViewerExtensions;
|
|
66
68
|
}
|
|
67
|
-
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, isAIGenerating, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
|
69
|
+
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, isAIGenerating, onPreviewRender, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
|
@@ -67,6 +67,7 @@ export interface SharedCardProps {
|
|
|
67
67
|
readonly titleBoxBgColor?: string;
|
|
68
68
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
69
69
|
readonly isAIGenerating?: boolean;
|
|
70
|
+
readonly onPreviewRender?: (fileId: string) => void;
|
|
70
71
|
readonly viewerOptions?: ViewerOptionsProps;
|
|
71
72
|
/** Sets options for viewer **/
|
|
72
73
|
readonly includeHashForDuplicateFiles?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "80.
|
|
3
|
+
"version": "80.6.1",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
55
55
|
"@atlaskit/primitives": "^19.0.0",
|
|
56
56
|
"@atlaskit/progress-bar": "^4.2.0",
|
|
57
|
-
"@atlaskit/react-ufo": "^6.
|
|
57
|
+
"@atlaskit/react-ufo": "^6.2.0",
|
|
58
58
|
"@atlaskit/spinner": "^19.1.0",
|
|
59
59
|
"@atlaskit/theme": "^25.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
61
|
-
"@atlaskit/tokens": "^13.
|
|
62
|
-
"@atlaskit/tooltip": "^22.
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^85.0.0",
|
|
61
|
+
"@atlaskit/tokens": "^13.1.0",
|
|
62
|
+
"@atlaskit/tooltip": "^22.5.0",
|
|
63
63
|
"@atlaskit/ufo": "^0.5.0",
|
|
64
64
|
"@atlaskit/visually-hidden": "^3.1.0",
|
|
65
65
|
"@babel/runtime": "^7.0.0",
|