@atlaskit/media-card 77.4.2 → 77.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +5 -3
- package/dist/cjs/card/v2/externalImageCard.js +3 -4
- package/dist/cjs/card/v2/fileCard.js +0 -3
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +5 -3
- package/dist/es2019/card/v2/externalImageCard.js +3 -4
- package/dist/es2019/card/v2/fileCard.js +0 -3
- 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/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/v2/cardV2.js +5 -3
- package/dist/esm/card/v2/externalImageCard.js +3 -4
- package/dist/esm/card/v2/fileCard.js +0 -3
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 77.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 77.4.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#43248](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43248) [`38b1f08a5da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/38b1f08a5da) - [ux] CXP-2748 Bug fix in CardV2 so that the card correctly updates the file preview when a new identifier is passed to the component
|
|
14
|
+
|
|
3
15
|
## 77.4.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -49,7 +49,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
49
49
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
50
50
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
51
51
|
var packageName = "@atlaskit/media-card";
|
|
52
|
-
var packageVersion = "77.4.
|
|
52
|
+
var packageVersion = "77.4.4";
|
|
53
53
|
var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
54
54
|
(0, _inherits2.default)(CardBase, _Component);
|
|
55
55
|
var _super = _createSuper(CardBase);
|
|
@@ -90,7 +90,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
90
90
|
}(_react.default.Component);
|
|
91
91
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
92
92
|
var packageName = "@atlaskit/media-card";
|
|
93
|
-
var packageVersion = "77.4.
|
|
93
|
+
var packageVersion = "77.4.4";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -16,14 +16,16 @@ var _externalImageCard = require("./externalImageCard");
|
|
|
16
16
|
var _fileCard = require("./fileCard");
|
|
17
17
|
var _excluded = ["identifier"];
|
|
18
18
|
var packageName = "@atlaskit/media-card";
|
|
19
|
-
var packageVersion = "77.4.
|
|
19
|
+
var packageVersion = "77.4.4";
|
|
20
20
|
var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
|
|
21
21
|
var identifier = _ref.identifier,
|
|
22
22
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
23
23
|
var innerContent = (0, _mediaClient.isFileIdentifier)(identifier) ? /*#__PURE__*/_react.default.createElement(_fileCard.FileCard, (0, _extends2.default)({}, otherProps, {
|
|
24
|
-
identifier: identifier
|
|
24
|
+
identifier: identifier,
|
|
25
|
+
key: identifier.id
|
|
25
26
|
})) : /*#__PURE__*/_react.default.createElement(_externalImageCard.ExternalImageCard, (0, _extends2.default)({}, otherProps, {
|
|
26
|
-
identifier: identifier
|
|
27
|
+
identifier: identifier,
|
|
28
|
+
key: identifier.dataURI
|
|
27
29
|
}));
|
|
28
30
|
return otherProps.intl ? innerContent : /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
|
|
29
31
|
locale: "en"
|
|
@@ -85,10 +85,6 @@ var ExternalImageCard = exports.ExternalImageCard = function ExternalImageCard(_
|
|
|
85
85
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
86
86
|
status = _useState4[0],
|
|
87
87
|
setStatus = _useState4[1];
|
|
88
|
-
(0, _react.useEffect)(function () {
|
|
89
|
-
fireCommencedEventRef.current();
|
|
90
|
-
setStatus('loading-preview');
|
|
91
|
-
}, [fireCommencedEventRef, identifier]);
|
|
92
88
|
var cardPreview = (0, _react.useMemo)(function () {
|
|
93
89
|
return {
|
|
94
90
|
dataURI: identifier.dataURI,
|
|
@@ -160,6 +156,9 @@ var ExternalImageCard = exports.ExternalImageCard = function ExternalImageCard(_
|
|
|
160
156
|
//------------------------ useEffects ----------------------------//
|
|
161
157
|
//----------------------------------------------------------------//
|
|
162
158
|
|
|
159
|
+
(0, _react.useEffect)(function () {
|
|
160
|
+
fireCommencedEventRef.current();
|
|
161
|
+
}, [fireCommencedEventRef]);
|
|
163
162
|
(0, _react.useEffect)(function () {
|
|
164
163
|
var _getDocument;
|
|
165
164
|
var fireCopiedCardEvent = function fireCopiedCardEvent() {
|
|
@@ -214,9 +214,6 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
214
214
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
215
215
|
status = _useState8[0],
|
|
216
216
|
setStatus = _useState8[1];
|
|
217
|
-
(0, _react.useEffect)(function () {
|
|
218
|
-
setStatus('loading');
|
|
219
|
-
}, [identifier]);
|
|
220
217
|
var _useState9 = (0, _react.useState)(false),
|
|
221
218
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
222
219
|
isPlayingFile = _useState10[0],
|
|
@@ -119,7 +119,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
119
119
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
120
120
|
var analyticsContext = {
|
|
121
121
|
packageVersion: "@atlaskit/media-card",
|
|
122
|
-
packageName: "77.4.
|
|
122
|
+
packageName: "77.4.4",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
16
16
|
var packageName = "@atlaskit/media-card";
|
|
17
|
-
var packageVersion = "77.4.
|
|
17
|
+
var packageVersion = "77.4.4";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -27,7 +27,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
27
27
|
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
const packageName = "@atlaskit/media-card";
|
|
30
|
-
const packageVersion = "77.4.
|
|
30
|
+
const packageVersion = "77.4.4";
|
|
31
31
|
export class CardBase extends Component {
|
|
32
32
|
constructor(props) {
|
|
33
33
|
super(props);
|
|
@@ -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 = "77.4.
|
|
69
|
+
const packageVersion = "77.4.4";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -7,15 +7,17 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
7
7
|
import { ExternalImageCard } from './externalImageCard';
|
|
8
8
|
import { FileCard } from './fileCard';
|
|
9
9
|
const packageName = "@atlaskit/media-card";
|
|
10
|
-
const packageVersion = "77.4.
|
|
10
|
+
const packageVersion = "77.4.4";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|
|
14
14
|
}) => {
|
|
15
15
|
const innerContent = isFileIdentifier(identifier) ? /*#__PURE__*/React.createElement(FileCard, _extends({}, otherProps, {
|
|
16
|
-
identifier: identifier
|
|
16
|
+
identifier: identifier,
|
|
17
|
+
key: identifier.id
|
|
17
18
|
})) : /*#__PURE__*/React.createElement(ExternalImageCard, _extends({}, otherProps, {
|
|
18
|
-
identifier: identifier
|
|
19
|
+
identifier: identifier,
|
|
20
|
+
key: identifier.dataURI
|
|
19
21
|
}));
|
|
20
22
|
return otherProps.intl ? innerContent : /*#__PURE__*/React.createElement(IntlProvider, {
|
|
21
23
|
locale: "en"
|
|
@@ -57,10 +57,6 @@ export const ExternalImageCard = ({
|
|
|
57
57
|
startUfoExperience(internalOccurrenceKey);
|
|
58
58
|
});
|
|
59
59
|
const [status, setStatus] = useState('loading-preview');
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
fireCommencedEventRef.current();
|
|
62
|
-
setStatus('loading-preview');
|
|
63
|
-
}, [fireCommencedEventRef, identifier]);
|
|
64
60
|
const cardPreview = useMemo(() => ({
|
|
65
61
|
dataURI: identifier.dataURI,
|
|
66
62
|
orientation: 1,
|
|
@@ -121,6 +117,9 @@ export const ExternalImageCard = ({
|
|
|
121
117
|
//------------------------ useEffects ----------------------------//
|
|
122
118
|
//----------------------------------------------------------------//
|
|
123
119
|
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
fireCommencedEventRef.current();
|
|
122
|
+
}, [fireCommencedEventRef]);
|
|
124
123
|
useEffect(() => {
|
|
125
124
|
var _getDocument;
|
|
126
125
|
const fireCopiedCardEvent = () => {
|
|
@@ -180,9 +180,6 @@ export const FileCard = ({
|
|
|
180
180
|
traceId: getRandomHex(8)
|
|
181
181
|
}), []);
|
|
182
182
|
const [status, setStatus] = useState('loading');
|
|
183
|
-
useEffect(() => {
|
|
184
|
-
setStatus('loading');
|
|
185
|
-
}, [identifier]);
|
|
186
183
|
const [isPlayingFile, setIsPlayingFile] = useState(false);
|
|
187
184
|
const [shouldAutoplay, setShouldAutoplay] = useState(false);
|
|
188
185
|
const [isBannedLocalPreview, setIsBannedLocalPreview] = useState(false);
|
|
@@ -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: "77.4.
|
|
40
|
+
packageName: "77.4.4",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
const packageName = "@atlaskit/media-card";
|
|
7
|
-
const packageVersion = "77.4.
|
|
7
|
+
const packageVersion = "77.4.4";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -40,7 +40,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
40
40
|
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
var packageName = "@atlaskit/media-card";
|
|
43
|
-
var packageVersion = "77.4.
|
|
43
|
+
var packageVersion = "77.4.4";
|
|
44
44
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
45
45
|
_inherits(CardBase, _Component);
|
|
46
46
|
var _super = _createSuper(CardBase);
|
|
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
83
83
|
}(React.Component);
|
|
84
84
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
85
85
|
var packageName = "@atlaskit/media-card";
|
|
86
|
-
var packageVersion = "77.4.
|
|
86
|
+
var packageVersion = "77.4.4";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -9,14 +9,16 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
9
9
|
import { ExternalImageCard } from './externalImageCard';
|
|
10
10
|
import { FileCard } from './fileCard';
|
|
11
11
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "77.4.
|
|
12
|
+
var packageVersion = "77.4.4";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
16
16
|
var innerContent = isFileIdentifier(identifier) ? /*#__PURE__*/React.createElement(FileCard, _extends({}, otherProps, {
|
|
17
|
-
identifier: identifier
|
|
17
|
+
identifier: identifier,
|
|
18
|
+
key: identifier.id
|
|
18
19
|
})) : /*#__PURE__*/React.createElement(ExternalImageCard, _extends({}, otherProps, {
|
|
19
|
-
identifier: identifier
|
|
20
|
+
identifier: identifier,
|
|
21
|
+
key: identifier.dataURI
|
|
20
22
|
}));
|
|
21
23
|
return otherProps.intl ? innerContent : /*#__PURE__*/React.createElement(IntlProvider, {
|
|
22
24
|
locale: "en"
|
|
@@ -75,10 +75,6 @@ export var ExternalImageCard = function ExternalImageCard(_ref) {
|
|
|
75
75
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
76
|
status = _useState4[0],
|
|
77
77
|
setStatus = _useState4[1];
|
|
78
|
-
useEffect(function () {
|
|
79
|
-
fireCommencedEventRef.current();
|
|
80
|
-
setStatus('loading-preview');
|
|
81
|
-
}, [fireCommencedEventRef, identifier]);
|
|
82
78
|
var cardPreview = useMemo(function () {
|
|
83
79
|
return {
|
|
84
80
|
dataURI: identifier.dataURI,
|
|
@@ -150,6 +146,9 @@ export var ExternalImageCard = function ExternalImageCard(_ref) {
|
|
|
150
146
|
//------------------------ useEffects ----------------------------//
|
|
151
147
|
//----------------------------------------------------------------//
|
|
152
148
|
|
|
149
|
+
useEffect(function () {
|
|
150
|
+
fireCommencedEventRef.current();
|
|
151
|
+
}, [fireCommencedEventRef]);
|
|
153
152
|
useEffect(function () {
|
|
154
153
|
var _getDocument;
|
|
155
154
|
var fireCopiedCardEvent = function fireCopiedCardEvent() {
|
|
@@ -204,9 +204,6 @@ export var FileCard = function FileCard(_ref) {
|
|
|
204
204
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
205
205
|
status = _useState8[0],
|
|
206
206
|
setStatus = _useState8[1];
|
|
207
|
-
useEffect(function () {
|
|
208
|
-
setStatus('loading');
|
|
209
|
-
}, [identifier]);
|
|
210
207
|
var _useState9 = useState(false),
|
|
211
208
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
212
209
|
isPlayingFile = _useState10[0],
|
|
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
103
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
104
104
|
var analyticsContext = {
|
|
105
105
|
packageVersion: "@atlaskit/media-card",
|
|
106
|
-
packageName: "77.4.
|
|
106
|
+
packageName: "77.4.4",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "77.4.
|
|
10
|
+
var packageVersion = "77.4.4";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "77.4.
|
|
3
|
+
"version": "77.4.4",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/media-ui": "^25.0.0",
|
|
47
47
|
"@atlaskit/media-viewer": "^48.2.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
49
|
-
"@atlaskit/spinner": "^
|
|
49
|
+
"@atlaskit/spinner": "^16.0.0",
|
|
50
50
|
"@atlaskit/theme": "^12.6.0",
|
|
51
51
|
"@atlaskit/tokens": "^1.28.0",
|
|
52
52
|
"@atlaskit/tooltip": "^18.0.0",
|