@atlaskit/media-card 79.4.3 → 79.4.5
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 +15 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/fileCard.js +1 -3
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/titleBox/failedTitleBox.js +2 -2
- package/dist/cjs/card/ui/unhandledErrorCard/unhandledErrorCard-compiled.js +2 -2
- package/dist/cjs/card/ui/unhandledErrorCard/unhandledErrorCard-emotion.js +2 -2
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +2 -2
- package/dist/cjs/inline/mediaInlineCard.js +22 -20
- package/dist/cjs/utils/lightCards/errorIcon/index.js +2 -2
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/fileCard.js +1 -3
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/titleBox/failedTitleBox.js +1 -1
- package/dist/es2019/card/ui/unhandledErrorCard/unhandledErrorCard-compiled.js +1 -1
- package/dist/es2019/card/ui/unhandledErrorCard/unhandledErrorCard-emotion.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/es2019/inline/mediaInlineCard.js +22 -20
- package/dist/es2019/utils/lightCards/errorIcon/index.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 +1 -3
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/titleBox/failedTitleBox.js +1 -1
- package/dist/esm/card/ui/unhandledErrorCard/unhandledErrorCard-compiled.js +1 -1
- package/dist/esm/card/ui/unhandledErrorCard/unhandledErrorCard-emotion.js +1 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +1 -1
- package/dist/esm/inline/mediaInlineCard.js +22 -20
- package/dist/esm/utils/lightCards/errorIcon/index.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/example-helpers/cardViewWrapper.tsx +1 -0
- package/example-helpers/index.tsx +1 -1
- package/example-helpers/svg-helpers/controls.tsx +1 -0
- package/example-helpers/svg-helpers/dimensionPicker.tsx +1 -0
- package/example-helpers/svg-helpers/svgContainer.tsx +1 -0
- package/package.json +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 79.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 79.4.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#188952](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/188952)
|
|
14
|
+
[`1a88e6e2601ae`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a88e6e2601ae) -
|
|
15
|
+
Migrated usage of renamed/deprecated icons
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 79.4.3
|
|
4
19
|
|
|
5
20
|
### 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 = "79.4.
|
|
23
|
+
var packageVersion = "79.4.4";
|
|
24
24
|
var CardBase = exports.CardBase = function CardBase(_ref) {
|
|
25
25
|
var identifier = _ref.identifier,
|
|
26
26
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -433,9 +433,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
// Abort VC when click file card
|
|
436
|
-
|
|
437
|
-
pressTracing();
|
|
438
|
-
}
|
|
436
|
+
pressTracing();
|
|
439
437
|
};
|
|
440
438
|
|
|
441
439
|
//----------------------------------------------------------------//
|
|
@@ -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 = "79.4.
|
|
90
|
+
var packageVersion = "79.4.4";
|
|
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)({
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.FailedTitleBox = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
|
-
var
|
|
10
|
+
var _statusWarningEditorWarning = _interopRequireDefault(require("@atlaskit/icon/core/migration/status-warning--editor-warning"));
|
|
11
11
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
12
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
13
|
var _titleBoxComponents = require("./titleBoxComponents");
|
|
@@ -17,7 +17,7 @@ var FailedTitleBox = exports.FailedTitleBox = function FailedTitleBox(_ref) {
|
|
|
17
17
|
customMessage = _ref$customMessage === void 0 ? _mediaUi.messages.failed_to_load : _ref$customMessage;
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement(_titleBoxComponents.TitleBoxWrapper, {
|
|
19
19
|
breakpoint: breakpoint
|
|
20
|
-
}, /*#__PURE__*/_react.default.createElement(_titleBoxComponents.ErrorMessageWrapper, null, /*#__PURE__*/_react.default.createElement(
|
|
20
|
+
}, /*#__PURE__*/_react.default.createElement(_titleBoxComponents.ErrorMessageWrapper, null, /*#__PURE__*/_react.default.createElement(_statusWarningEditorWarning.default, {
|
|
21
21
|
label: 'Warning',
|
|
22
22
|
LEGACY_size: 'small',
|
|
23
23
|
LEGACY_margin: "0 ".concat("var(--ds-space-negative-025, -2px)"),
|
|
@@ -17,7 +17,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
17
17
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
18
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
19
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
20
|
-
var
|
|
20
|
+
var _statusWarningEditorWarning = _interopRequireDefault(require("@atlaskit/icon/core/migration/status-warning--editor-warning"));
|
|
21
21
|
var _colors = require("@atlaskit/theme/colors");
|
|
22
22
|
var _utils = require("../../../utils");
|
|
23
23
|
var _contentLoadingErrorMessage = require("./contentLoadingErrorMessage");
|
|
@@ -74,7 +74,7 @@ var UnhandledErrorCard = exports.UnhandledErrorCard = /*#__PURE__*/function (_Co
|
|
|
74
74
|
"--_1jkcdu5": (0, _runtime.ix)("var(--ds-background-neutral, ".concat(_colors.N20, ")")),
|
|
75
75
|
"--_i2cu7k": (0, _runtime.ix)("var(--ds-text-subtle, ".concat(_colors.N800, ")"))
|
|
76
76
|
})
|
|
77
|
-
}, /*#__PURE__*/React.createElement(
|
|
77
|
+
}, /*#__PURE__*/React.createElement(_statusWarningEditorWarning.default, {
|
|
78
78
|
label: "Error",
|
|
79
79
|
color: "var(--ds-icon-warning, ".concat(_colors.Y500, ")"),
|
|
80
80
|
LEGACY_size: "medium",
|
|
@@ -12,7 +12,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _react = require("react");
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
|
-
var
|
|
15
|
+
var _statusWarningEditorWarning = _interopRequireDefault(require("@atlaskit/icon/core/migration/status-warning--editor-warning"));
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
17
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
18
18
|
var _utils = require("../../../utils");
|
|
@@ -92,7 +92,7 @@ var UnhandledErrorCard = exports.UnhandledErrorCard = /*#__PURE__*/function (_Co
|
|
|
92
92
|
(0, _react2.jsx)("div", {
|
|
93
93
|
css: wrapperStyles(dimensions),
|
|
94
94
|
onClick: onClick
|
|
95
|
-
}, (0, _react2.jsx)(
|
|
95
|
+
}, (0, _react2.jsx)(_statusWarningEditorWarning.default, {
|
|
96
96
|
label: "Error",
|
|
97
97
|
color: "var(--ds-icon-warning, ".concat(_colors.Y500, ")"),
|
|
98
98
|
LEGACY_size: "medium",
|
|
@@ -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: "79.4.
|
|
119
|
+
packageName: "79.4.4",
|
|
120
120
|
componentName: 'mediaInlineCard',
|
|
121
121
|
component: 'mediaInlineCard'
|
|
122
122
|
};
|
|
@@ -14,7 +14,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
|
-
var
|
|
17
|
+
var _statusWarningWarning = _interopRequireDefault(require("@atlaskit/icon/core/migration/status-warning--warning"));
|
|
18
18
|
var _analytics = require("../utils/analytics");
|
|
19
19
|
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)); }
|
|
20
20
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -67,7 +67,7 @@ var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
|
|
|
67
67
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
68
68
|
_react.default.createElement("span", {
|
|
69
69
|
style: style
|
|
70
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement(_statusWarningWarning.default, {
|
|
71
71
|
LEGACY_margin: "0 ".concat("var(--ds-space-negative-050, -4px)", " 0 0"),
|
|
72
72
|
label: "error",
|
|
73
73
|
LEGACY_size: "small",
|
|
@@ -21,7 +21,6 @@ var _errors = require("../errors");
|
|
|
21
21
|
var _analytics = require("../utils/analytics");
|
|
22
22
|
var _mediaInlineCardAnalytics = require("./mediaInlineCardAnalytics");
|
|
23
23
|
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
24
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
25
24
|
var _usePressTracing = _interopRequireDefault(require("@atlaskit/react-ufo/use-press-tracing"));
|
|
26
25
|
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); }
|
|
27
26
|
// UI component which renders an inline link in the appropiate state based on a media file
|
|
@@ -61,6 +60,9 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
|
|
|
61
60
|
var fireFailedOperationalEvent = function fireFailedOperationalEvent() {
|
|
62
61
|
var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _errors.MediaCardError('missing-error-data');
|
|
63
62
|
var failReason = arguments.length > 1 ? arguments[1] : undefined;
|
|
63
|
+
if (isFailedEventSent) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
64
66
|
var payload = failReason ? (0, _mediaInlineCardAnalytics.getFailedProcessingStatusPayload)(identifier.id, fileState) : (0, _mediaInlineCardAnalytics.getErrorStatusPayload)(identifier.id, error, fileState);
|
|
65
67
|
setIsFailedEventSent(true);
|
|
66
68
|
(0, _analytics.fireMediaCardEvent)(payload, createAnalyticsEvent);
|
|
@@ -87,9 +89,7 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
|
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
// Abort VC when click media inline card
|
|
90
|
-
|
|
91
|
-
pressTracing();
|
|
92
|
-
}
|
|
92
|
+
pressTracing();
|
|
93
93
|
};
|
|
94
94
|
var onMediaViewerClose = function onMediaViewerClose() {
|
|
95
95
|
return setMediaViewerVisible(false);
|
|
@@ -134,21 +134,23 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
|
|
|
134
134
|
if (subscribeError) {
|
|
135
135
|
var errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? _mediaUi.messages.failed_to_upload : _mediaUi.messages.couldnt_load_file;
|
|
136
136
|
var errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
|
|
137
|
-
|
|
138
|
-
return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
|
|
137
|
+
fireFailedOperationalEvent(new _errors.MediaCardError(errorReason, subscribeError));
|
|
138
|
+
return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
|
|
139
139
|
innerRef: copyNodeRef,
|
|
140
140
|
message: (intl || defaultIntl).formatMessage(errorMessage),
|
|
141
|
-
isSelected: isSelected
|
|
142
|
-
|
|
141
|
+
isSelected: isSelected,
|
|
142
|
+
onClick: onMediaInlineCardClick
|
|
143
|
+
}), renderMediaViewer()));
|
|
143
144
|
}
|
|
144
145
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
|
|
145
146
|
var error = new _errors.MediaCardError('error-file-state', (0, _mediaClient.toCommonMediaClientError)(fileState));
|
|
146
|
-
|
|
147
|
-
return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
|
|
147
|
+
fireFailedOperationalEvent(error);
|
|
148
|
+
return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
|
|
148
149
|
innerRef: copyNodeRef,
|
|
149
150
|
message: (intl || defaultIntl).formatMessage(_mediaUi.messages.couldnt_load_file),
|
|
150
|
-
isSelected: isSelected
|
|
151
|
-
|
|
151
|
+
isSelected: isSelected,
|
|
152
|
+
onClick: onMediaInlineCardClick
|
|
153
|
+
}), renderMediaViewer()));
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
// Empty file handling
|
|
@@ -156,12 +158,13 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
|
|
|
156
158
|
var _error = new _errors.MediaCardError('metadata-fetch', new _mediaClient.FileFetcherError('emptyFileName', {
|
|
157
159
|
id: fileState.id
|
|
158
160
|
}));
|
|
159
|
-
|
|
160
|
-
return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
|
|
161
|
+
fireFailedOperationalEvent(_error);
|
|
162
|
+
return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardErroredView, {
|
|
161
163
|
innerRef: copyNodeRef,
|
|
162
164
|
message: (intl || defaultIntl).formatMessage(_mediaUi.messages.couldnt_load_file),
|
|
163
|
-
isSelected: isSelected
|
|
164
|
-
|
|
165
|
+
isSelected: isSelected,
|
|
166
|
+
onClick: onMediaInlineCardClick
|
|
167
|
+
}), renderMediaViewer()));
|
|
165
168
|
}
|
|
166
169
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
|
|
167
170
|
return /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardLoadingView, {
|
|
@@ -180,7 +183,7 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
|
|
|
180
183
|
|
|
181
184
|
// Failed to process should still display the loaded view and enable Media Client to download
|
|
182
185
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
|
|
183
|
-
|
|
186
|
+
fireFailedOperationalEvent(undefined, 'failed-processing');
|
|
184
187
|
}
|
|
185
188
|
var mediaType = fileState.mediaType,
|
|
186
189
|
name = fileState.name,
|
|
@@ -192,7 +195,6 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
|
|
|
192
195
|
mimeType: mimeType,
|
|
193
196
|
name: name
|
|
194
197
|
});
|
|
195
|
-
var mediaViewer = renderMediaViewer();
|
|
196
198
|
var formattedDate;
|
|
197
199
|
if (fileState.createdAt) {
|
|
198
200
|
var _ref2 = intl || {
|
|
@@ -216,7 +218,7 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
|
|
|
216
218
|
title: name,
|
|
217
219
|
onClick: onMediaInlineCardClick,
|
|
218
220
|
isSelected: isSelected
|
|
219
|
-
})),
|
|
221
|
+
})), renderMediaViewer()));
|
|
220
222
|
} else {
|
|
221
223
|
return renderContent( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_mediaUi.MediaInlineCardLoadedView, {
|
|
222
224
|
innerRef: copyNodeRef,
|
|
@@ -224,7 +226,7 @@ var MediaInlineCardInternal = exports.MediaInlineCardInternal = function MediaIn
|
|
|
224
226
|
title: name,
|
|
225
227
|
onClick: onMediaInlineCardClick,
|
|
226
228
|
isSelected: isSelected
|
|
227
|
-
}),
|
|
229
|
+
}), renderMediaViewer()));
|
|
228
230
|
}
|
|
229
231
|
};
|
|
230
232
|
var MediaInlineCard = exports.MediaInlineCard = (0, _reactIntlNext.injectIntl)(MediaInlineCardInternal, {
|
|
@@ -13,7 +13,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = require("@emotion/react");
|
|
15
15
|
var _react2 = require("react");
|
|
16
|
-
var
|
|
16
|
+
var _statusWarningEditorWarning = _interopRequireDefault(require("@atlaskit/icon/core/migration/status-warning--editor-warning"));
|
|
17
17
|
var _styles = require("./styles");
|
|
18
18
|
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)); }
|
|
19
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
@@ -34,7 +34,7 @@ var ErrorIcon = exports.ErrorIcon = /*#__PURE__*/function (_Component) {
|
|
|
34
34
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
35
35
|
(0, _react.jsx)("div", {
|
|
36
36
|
css: _styles.errorIconWrapperStyles
|
|
37
|
-
}, (0, _react.jsx)(
|
|
37
|
+
}, (0, _react.jsx)(_statusWarningEditorWarning.default, {
|
|
38
38
|
color: "currentColor",
|
|
39
39
|
label: "Error",
|
|
40
40
|
LEGACY_size: size
|
|
@@ -15,7 +15,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
17
|
var packageName = "@atlaskit/media-card";
|
|
18
|
-
var packageVersion = "79.4.
|
|
18
|
+
var packageVersion = "79.4.4";
|
|
19
19
|
var SAMPLE_RATE = 0.05;
|
|
20
20
|
var concurrentExperience;
|
|
21
21
|
var getExperience = function getExperience(id) {
|
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 = "79.4.
|
|
12
|
+
const packageVersion = "79.4.4";
|
|
13
13
|
export const CardBase = ({
|
|
14
14
|
identifier,
|
|
15
15
|
...otherProps
|
|
@@ -356,9 +356,7 @@ export const FileCard = ({
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
// Abort VC when click file card
|
|
359
|
-
|
|
360
|
-
pressTracing();
|
|
361
|
-
}
|
|
359
|
+
pressTracing();
|
|
362
360
|
};
|
|
363
361
|
|
|
364
362
|
//----------------------------------------------------------------//
|
|
@@ -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 = "79.4.
|
|
69
|
+
const packageVersion = "79.4.4";
|
|
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({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import EditorWarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
3
|
+
import EditorWarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
|
|
4
4
|
import { messages } from '@atlaskit/media-ui';
|
|
5
5
|
import { R300 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { ErrorMessageWrapper, TitleBoxWrapper } from './titleBoxComponents';
|
|
@@ -3,7 +3,7 @@ import "./unhandledErrorCard-compiled.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { Component } from 'react';
|
|
6
|
-
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
6
|
+
import WarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
|
|
7
7
|
import { N20, N800, Y500 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { defaultImageCardDimensions } from '../../../utils';
|
|
9
9
|
import { ContentLoadingErrorMessage } from './contentLoadingErrorMessage';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Component } from 'react';
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
8
|
+
import WarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
|
|
9
9
|
import { N20, N800, Y500 } from '@atlaskit/theme/colors';
|
|
10
10
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
11
11
|
import { defaultImageCardDimensions } from '../../../utils';
|
|
@@ -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: "79.4.
|
|
40
|
+
packageName: "79.4.4",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import { B300, R300, N30A, N900 } from '@atlaskit/theme/colors';
|
|
5
|
-
import WarningIcon from '@atlaskit/icon/core/migration/warning';
|
|
5
|
+
import WarningIcon from '@atlaskit/icon/core/migration/status-warning--warning';
|
|
6
6
|
import { fireMediaCardEvent } from '../utils/analytics';
|
|
7
7
|
const ErrorBoundaryComponent = ({
|
|
8
8
|
message,
|
|
@@ -12,7 +12,6 @@ import { MediaCardError } from '../errors';
|
|
|
12
12
|
import { fireMediaCardEvent } from '../utils/analytics';
|
|
13
13
|
import { getErrorStatusPayload, getFailedProcessingStatusPayload, getSucceededStatusPayload } from './mediaInlineCardAnalytics';
|
|
14
14
|
import { useCopyIntent } from '@atlaskit/media-client-react';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
15
|
import usePressTracing from '@atlaskit/react-ufo/use-press-tracing';
|
|
17
16
|
// UI component which renders an inline link in the appropiate state based on a media file
|
|
18
17
|
export const MediaInlineCardInternal = ({
|
|
@@ -36,6 +35,9 @@ export const MediaInlineCardInternal = ({
|
|
|
36
35
|
} = useAnalyticsEvents();
|
|
37
36
|
const pressTracing = usePressTracing('click-media-inline-card');
|
|
38
37
|
const fireFailedOperationalEvent = (error = new MediaCardError('missing-error-data'), failReason) => {
|
|
38
|
+
if (isFailedEventSent) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
39
41
|
const payload = failReason ? getFailedProcessingStatusPayload(identifier.id, fileState) : getErrorStatusPayload(identifier.id, error, fileState);
|
|
40
42
|
setIsFailedEventSent(true);
|
|
41
43
|
fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
@@ -63,9 +65,7 @@ export const MediaInlineCardInternal = ({
|
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
// Abort VC when click media inline card
|
|
66
|
-
|
|
67
|
-
pressTracing();
|
|
68
|
-
}
|
|
68
|
+
pressTracing();
|
|
69
69
|
};
|
|
70
70
|
const onMediaViewerClose = () => setMediaViewerVisible(false);
|
|
71
71
|
const renderMediaViewer = () => {
|
|
@@ -108,21 +108,23 @@ export const MediaInlineCardInternal = ({
|
|
|
108
108
|
if (subscribeError) {
|
|
109
109
|
const errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? messages.failed_to_upload : messages.couldnt_load_file;
|
|
110
110
|
const errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
|
|
111
|
-
|
|
112
|
-
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
111
|
+
fireFailedOperationalEvent(new MediaCardError(errorReason, subscribeError));
|
|
112
|
+
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
113
113
|
innerRef: copyNodeRef,
|
|
114
114
|
message: (intl || defaultIntl).formatMessage(errorMessage),
|
|
115
|
-
isSelected: isSelected
|
|
116
|
-
|
|
115
|
+
isSelected: isSelected,
|
|
116
|
+
onClick: onMediaInlineCardClick
|
|
117
|
+
}), renderMediaViewer()));
|
|
117
118
|
}
|
|
118
119
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
|
|
119
120
|
const error = new MediaCardError('error-file-state', toCommonMediaClientError(fileState));
|
|
120
|
-
|
|
121
|
-
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
121
|
+
fireFailedOperationalEvent(error);
|
|
122
|
+
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
122
123
|
innerRef: copyNodeRef,
|
|
123
124
|
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
|
|
124
|
-
isSelected: isSelected
|
|
125
|
-
|
|
125
|
+
isSelected: isSelected,
|
|
126
|
+
onClick: onMediaInlineCardClick
|
|
127
|
+
}), renderMediaViewer()));
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
// Empty file handling
|
|
@@ -130,12 +132,13 @@ export const MediaInlineCardInternal = ({
|
|
|
130
132
|
const error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', {
|
|
131
133
|
id: fileState.id
|
|
132
134
|
}));
|
|
133
|
-
|
|
134
|
-
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
135
|
+
fireFailedOperationalEvent(error);
|
|
136
|
+
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
135
137
|
innerRef: copyNodeRef,
|
|
136
138
|
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
|
|
137
|
-
isSelected: isSelected
|
|
138
|
-
|
|
139
|
+
isSelected: isSelected,
|
|
140
|
+
onClick: onMediaInlineCardClick
|
|
141
|
+
}), renderMediaViewer()));
|
|
139
142
|
}
|
|
140
143
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
|
|
141
144
|
return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
|
|
@@ -154,7 +157,7 @@ export const MediaInlineCardInternal = ({
|
|
|
154
157
|
|
|
155
158
|
// Failed to process should still display the loaded view and enable Media Client to download
|
|
156
159
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
|
|
157
|
-
|
|
160
|
+
fireFailedOperationalEvent(undefined, 'failed-processing');
|
|
158
161
|
}
|
|
159
162
|
const {
|
|
160
163
|
mediaType,
|
|
@@ -168,7 +171,6 @@ export const MediaInlineCardInternal = ({
|
|
|
168
171
|
mimeType: mimeType,
|
|
169
172
|
name: name
|
|
170
173
|
});
|
|
171
|
-
const mediaViewer = renderMediaViewer();
|
|
172
174
|
let formattedDate;
|
|
173
175
|
if (fileState.createdAt) {
|
|
174
176
|
const {
|
|
@@ -192,7 +194,7 @@ export const MediaInlineCardInternal = ({
|
|
|
192
194
|
title: name,
|
|
193
195
|
onClick: onMediaInlineCardClick,
|
|
194
196
|
isSelected: isSelected
|
|
195
|
-
})),
|
|
197
|
+
})), renderMediaViewer()));
|
|
196
198
|
} else {
|
|
197
199
|
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardLoadedView, {
|
|
198
200
|
innerRef: copyNodeRef,
|
|
@@ -200,7 +202,7 @@ export const MediaInlineCardInternal = ({
|
|
|
200
202
|
title: name,
|
|
201
203
|
onClick: onMediaInlineCardClick,
|
|
202
204
|
isSelected: isSelected
|
|
203
|
-
}),
|
|
205
|
+
}), renderMediaViewer()));
|
|
204
206
|
}
|
|
205
207
|
};
|
|
206
208
|
export const MediaInlineCard = injectIntl(MediaInlineCardInternal, {
|
|
@@ -6,7 +6,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { Component } from 'react';
|
|
9
|
-
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
9
|
+
import WarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
|
|
10
10
|
import { errorIconWrapperStyles } from './styles';
|
|
11
11
|
export class ErrorIcon extends Component {
|
|
12
12
|
render() {
|
|
@@ -5,7 +5,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
5
5
|
import { MediaCardError } from '../errors';
|
|
6
6
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
7
7
|
const packageName = "@atlaskit/media-card";
|
|
8
|
-
const packageVersion = "79.4.
|
|
8
|
+
const packageVersion = "79.4.4";
|
|
9
9
|
const SAMPLE_RATE = 0.05;
|
|
10
10
|
let concurrentExperience;
|
|
11
11
|
const getExperience = id => {
|
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 = "79.4.
|
|
14
|
+
var packageVersion = "79.4.4";
|
|
15
15
|
export var CardBase = function CardBase(_ref) {
|
|
16
16
|
var identifier = _ref.identifier,
|
|
17
17
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -425,9 +425,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
// Abort VC when click file card
|
|
428
|
-
|
|
429
|
-
pressTracing();
|
|
430
|
-
}
|
|
428
|
+
pressTracing();
|
|
431
429
|
};
|
|
432
430
|
|
|
433
431
|
//----------------------------------------------------------------//
|
|
@@ -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 = "79.4.
|
|
83
|
+
var packageVersion = "79.4.4";
|
|
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({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import EditorWarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
3
|
+
import EditorWarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
|
|
4
4
|
import { messages } from '@atlaskit/media-ui';
|
|
5
5
|
import { R300 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { ErrorMessageWrapper, TitleBoxWrapper } from './titleBoxComponents';
|
|
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
14
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
15
|
import { Component } from 'react';
|
|
16
|
-
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
16
|
+
import WarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
|
|
17
17
|
import { N20, N800, Y500 } from '@atlaskit/theme/colors';
|
|
18
18
|
import { defaultImageCardDimensions } from '../../../utils';
|
|
19
19
|
import { ContentLoadingErrorMessage } from './contentLoadingErrorMessage';
|
|
@@ -12,7 +12,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
12
12
|
import { Component } from 'react';
|
|
13
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
14
|
import { css, jsx } from '@emotion/react';
|
|
15
|
-
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
15
|
+
import WarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
|
|
16
16
|
import { N20, N800, Y500 } from '@atlaskit/theme/colors';
|
|
17
17
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
18
18
|
import { defaultImageCardDimensions } from '../../../utils';
|
|
@@ -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: "79.4.
|
|
104
|
+
packageName: "79.4.4",
|
|
105
105
|
componentName: 'mediaInlineCard',
|
|
106
106
|
component: 'mediaInlineCard'
|
|
107
107
|
};
|
|
@@ -11,7 +11,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
13
|
import { B300, R300, N30A, N900 } from '@atlaskit/theme/colors';
|
|
14
|
-
import WarningIcon from '@atlaskit/icon/core/migration/warning';
|
|
14
|
+
import WarningIcon from '@atlaskit/icon/core/migration/status-warning--warning';
|
|
15
15
|
import { fireMediaCardEvent } from '../utils/analytics';
|
|
16
16
|
var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
|
|
17
17
|
var message = _ref.message,
|
|
@@ -13,7 +13,6 @@ import { MediaCardError } from '../errors';
|
|
|
13
13
|
import { fireMediaCardEvent } from '../utils/analytics';
|
|
14
14
|
import { getErrorStatusPayload, getFailedProcessingStatusPayload, getSucceededStatusPayload } from './mediaInlineCardAnalytics';
|
|
15
15
|
import { useCopyIntent } from '@atlaskit/media-client-react';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import usePressTracing from '@atlaskit/react-ufo/use-press-tracing';
|
|
18
17
|
// UI component which renders an inline link in the appropiate state based on a media file
|
|
19
18
|
export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
@@ -52,6 +51,9 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
52
51
|
var fireFailedOperationalEvent = function fireFailedOperationalEvent() {
|
|
53
52
|
var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new MediaCardError('missing-error-data');
|
|
54
53
|
var failReason = arguments.length > 1 ? arguments[1] : undefined;
|
|
54
|
+
if (isFailedEventSent) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
55
57
|
var payload = failReason ? getFailedProcessingStatusPayload(identifier.id, fileState) : getErrorStatusPayload(identifier.id, error, fileState);
|
|
56
58
|
setIsFailedEventSent(true);
|
|
57
59
|
fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
@@ -78,9 +80,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
// Abort VC when click media inline card
|
|
81
|
-
|
|
82
|
-
pressTracing();
|
|
83
|
-
}
|
|
83
|
+
pressTracing();
|
|
84
84
|
};
|
|
85
85
|
var onMediaViewerClose = function onMediaViewerClose() {
|
|
86
86
|
return setMediaViewerVisible(false);
|
|
@@ -125,21 +125,23 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
125
125
|
if (subscribeError) {
|
|
126
126
|
var errorMessage = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? messages.failed_to_upload : messages.couldnt_load_file;
|
|
127
127
|
var errorReason = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading' ? 'upload' : 'metadata-fetch';
|
|
128
|
-
|
|
129
|
-
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
128
|
+
fireFailedOperationalEvent(new MediaCardError(errorReason, subscribeError));
|
|
129
|
+
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
130
130
|
innerRef: copyNodeRef,
|
|
131
131
|
message: (intl || defaultIntl).formatMessage(errorMessage),
|
|
132
|
-
isSelected: isSelected
|
|
133
|
-
|
|
132
|
+
isSelected: isSelected,
|
|
133
|
+
onClick: onMediaInlineCardClick
|
|
134
|
+
}), renderMediaViewer()));
|
|
134
135
|
}
|
|
135
136
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'error') {
|
|
136
137
|
var error = new MediaCardError('error-file-state', toCommonMediaClientError(fileState));
|
|
137
|
-
|
|
138
|
-
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
138
|
+
fireFailedOperationalEvent(error);
|
|
139
|
+
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
139
140
|
innerRef: copyNodeRef,
|
|
140
141
|
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
|
|
141
|
-
isSelected: isSelected
|
|
142
|
-
|
|
142
|
+
isSelected: isSelected,
|
|
143
|
+
onClick: onMediaInlineCardClick
|
|
144
|
+
}), renderMediaViewer()));
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
// Empty file handling
|
|
@@ -147,12 +149,13 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
147
149
|
var _error = new MediaCardError('metadata-fetch', new FileFetcherError('emptyFileName', {
|
|
148
150
|
id: fileState.id
|
|
149
151
|
}));
|
|
150
|
-
|
|
151
|
-
return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
152
|
+
fireFailedOperationalEvent(_error);
|
|
153
|
+
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
152
154
|
innerRef: copyNodeRef,
|
|
153
155
|
message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file),
|
|
154
|
-
isSelected: isSelected
|
|
155
|
-
|
|
156
|
+
isSelected: isSelected,
|
|
157
|
+
onClick: onMediaInlineCardClick
|
|
158
|
+
}), renderMediaViewer()));
|
|
156
159
|
}
|
|
157
160
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading') {
|
|
158
161
|
return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
|
|
@@ -171,7 +174,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
171
174
|
|
|
172
175
|
// Failed to process should still display the loaded view and enable Media Client to download
|
|
173
176
|
if ((fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'failed-processing') {
|
|
174
|
-
|
|
177
|
+
fireFailedOperationalEvent(undefined, 'failed-processing');
|
|
175
178
|
}
|
|
176
179
|
var mediaType = fileState.mediaType,
|
|
177
180
|
name = fileState.name,
|
|
@@ -183,7 +186,6 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
183
186
|
mimeType: mimeType,
|
|
184
187
|
name: name
|
|
185
188
|
});
|
|
186
|
-
var mediaViewer = renderMediaViewer();
|
|
187
189
|
var formattedDate;
|
|
188
190
|
if (fileState.createdAt) {
|
|
189
191
|
var _ref2 = intl || {
|
|
@@ -207,7 +209,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
207
209
|
title: name,
|
|
208
210
|
onClick: onMediaInlineCardClick,
|
|
209
211
|
isSelected: isSelected
|
|
210
|
-
})),
|
|
212
|
+
})), renderMediaViewer()));
|
|
211
213
|
} else {
|
|
212
214
|
return renderContent( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaInlineCardLoadedView, {
|
|
213
215
|
innerRef: copyNodeRef,
|
|
@@ -215,7 +217,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
215
217
|
title: name,
|
|
216
218
|
onClick: onMediaInlineCardClick,
|
|
217
219
|
isSelected: isSelected
|
|
218
|
-
}),
|
|
220
|
+
}), renderMediaViewer()));
|
|
219
221
|
}
|
|
220
222
|
};
|
|
221
223
|
export var MediaInlineCard = injectIntl(MediaInlineCardInternal, {
|
|
@@ -13,7 +13,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
14
|
import { jsx } from '@emotion/react';
|
|
15
15
|
import { Component } from 'react';
|
|
16
|
-
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
16
|
+
import WarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
|
|
17
17
|
import { errorIconWrapperStyles } from './styles';
|
|
18
18
|
export var ErrorIcon = /*#__PURE__*/function (_Component) {
|
|
19
19
|
function ErrorIcon() {
|
|
@@ -8,7 +8,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
8
8
|
import { MediaCardError } from '../errors';
|
|
9
9
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
10
10
|
var packageName = "@atlaskit/media-card";
|
|
11
|
-
var packageVersion = "79.4.
|
|
11
|
+
var packageVersion = "79.4.4";
|
|
12
12
|
var SAMPLE_RATE = 0.05;
|
|
13
13
|
var concurrentExperience;
|
|
14
14
|
var getExperience = function getExperience(id) {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
7
8
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
9
|
|
|
9
10
|
type CardViewWrapperProps = {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
createPollingMaxAttemptsError,
|
|
12
12
|
createRateLimitedError,
|
|
13
13
|
} from '@atlaskit/media-client/test-helpers';
|
|
14
|
-
import CrossIcon from '@atlaskit/icon/core/migration/
|
|
14
|
+
import CrossIcon from '@atlaskit/icon/core/migration/cross';
|
|
15
15
|
import FabricAnalyticsListeners, { type AnalyticsWebClient } from '@atlaskit/analytics-listeners';
|
|
16
16
|
import { payloadPublisher } from '@atlassian/ufo';
|
|
17
17
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
3
4
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
4
5
|
import { media } from '@atlaskit/primitives/responsive';
|
|
5
6
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { Label } from '@atlaskit/form';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
4
5
|
import { Box, Flex, xcss } from '@atlaskit/primitives';
|
|
5
6
|
import Range from '@atlaskit/range';
|
|
6
7
|
|
|
@@ -7,6 +7,7 @@ import React from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
|
|
10
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
10
11
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
11
12
|
|
|
12
13
|
const containerStyles = xcss({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "79.4.
|
|
3
|
+
"version": "79.4.5",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
40
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
41
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
42
|
-
"@atlaskit/icon": "^27.
|
|
40
|
+
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
41
|
+
"@atlaskit/editor-shared-styles": "^3.5.0",
|
|
42
|
+
"@atlaskit/icon": "^27.7.0",
|
|
43
43
|
"@atlaskit/link": "^3.2.0",
|
|
44
|
-
"@atlaskit/media-client": "^35.
|
|
44
|
+
"@atlaskit/media-client": "^35.2.0",
|
|
45
45
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
46
46
|
"@atlaskit/media-common": "^12.3.0",
|
|
47
47
|
"@atlaskit/media-file-preview": "^0.11.0",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"@atlaskit/media-viewer": "^52.4.0",
|
|
51
51
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
52
52
|
"@atlaskit/primitives": "^14.10.0",
|
|
53
|
-
"@atlaskit/react-ufo": "^4.
|
|
54
|
-
"@atlaskit/spinner": "^
|
|
53
|
+
"@atlaskit/react-ufo": "^4.1.0",
|
|
54
|
+
"@atlaskit/spinner": "^19.0.0",
|
|
55
55
|
"@atlaskit/theme": "^19.0.0",
|
|
56
|
-
"@atlaskit/tokens": "^5.
|
|
57
|
-
"@atlaskit/tooltip": "^20.
|
|
56
|
+
"@atlaskit/tokens": "^5.6.0",
|
|
57
|
+
"@atlaskit/tooltip": "^20.4.0",
|
|
58
58
|
"@atlaskit/ufo": "^0.4.0",
|
|
59
59
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
60
60
|
"@babel/runtime": "^7.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@atlaskit/radio": "^8.1.0",
|
|
87
87
|
"@atlaskit/range": "^9.1.0",
|
|
88
88
|
"@atlaskit/ssr": "workspace:^",
|
|
89
|
-
"@atlaskit/toggle": "^15.
|
|
89
|
+
"@atlaskit/toggle": "^15.1.0",
|
|
90
90
|
"@atlaskit/visual-regression": "workspace:^",
|
|
91
91
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
92
92
|
"@atlassian/ufo": "^0.7.0",
|
|
@@ -142,9 +142,6 @@
|
|
|
142
142
|
"platform_media_resume_video_on_token_expiry": {
|
|
143
143
|
"type": "boolean"
|
|
144
144
|
},
|
|
145
|
-
"platform_abort_vc_click_file_card": {
|
|
146
|
-
"type": "boolean"
|
|
147
|
-
},
|
|
148
145
|
"platfrom_close_blindspot_for_img": {
|
|
149
146
|
"type": "boolean"
|
|
150
147
|
}
|