@atlaskit/media-card 76.0.3 → 76.0.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 +12 -0
- package/dist/cjs/card/card.js +14 -6
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/actionsBar/styles.js +1 -1
- package/dist/cjs/card/ui/tickBox/styles.js +2 -0
- package/dist/cjs/card/ui/titleBox/styles.js +2 -2
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +17 -5
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/actionsBar/styles.js +2 -2
- package/dist/es2019/card/ui/tickBox/styles.js +2 -0
- package/dist/es2019/card/ui/titleBox/styles.js +3 -3
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +15 -5
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/actionsBar/styles.js +1 -1
- package/dist/esm/card/ui/tickBox/styles.js +2 -0
- package/dist/esm/card/ui/titleBox/styles.js +2 -2
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/version.json +1 -1
- package/example-helpers/cardViewWrapper.tsx +9 -6
- package/example-helpers/styles.ts +16 -7
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 76.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`48e4a655534`](https://bitbucket.org/atlassian/atlassian-frontend/commits/48e4a655534) - Internal change to enforce token usage for spacing properties. There is no expected visual or behaviour change.
|
|
8
|
+
|
|
9
|
+
## 76.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`8b83c75ef6d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8b83c75ef6d) - MEX-2382 Fixed a bug in media card so that the card preview updates when the provided file identifier is different
|
|
14
|
+
|
|
3
15
|
## 76.0.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.CardBase = exports.Card = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -48,7 +49,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
48
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); }; }
|
|
49
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; } }
|
|
50
51
|
var packageName = "@atlaskit/media-card";
|
|
51
|
-
var packageVersion = "76.0.
|
|
52
|
+
var packageVersion = "76.0.5";
|
|
52
53
|
var CardBase = /*#__PURE__*/function (_Component) {
|
|
53
54
|
(0, _inherits2.default)(CardBase, _Component);
|
|
54
55
|
var _super = _createSuper(CardBase);
|
|
@@ -776,7 +777,7 @@ var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
776
777
|
previewDidRender = _this$state4.previewDidRender,
|
|
777
778
|
isPlayingFile = _this$state4.isPlayingFile,
|
|
778
779
|
wasResolvedUpfrontPreview = _this$state4.wasResolvedUpfrontPreview;
|
|
779
|
-
var
|
|
780
|
+
var isDiffIdentifier = (0, _mediaClient2.isDifferentIdentifier)(prevIdentifier, identifier);
|
|
780
781
|
/**
|
|
781
782
|
* Variable turnedVisible should only be true when media card
|
|
782
783
|
* was invisible in the previous state and is visible in the current one
|
|
@@ -794,7 +795,7 @@ var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
794
795
|
var isNewMediaClient = prevMediaClient !== mediaClient;
|
|
795
796
|
var fileImageMode = (0, _mediaClient2.imageResizeModeToFileImageMode)(resizeMode);
|
|
796
797
|
this.updateFileStateFlag(fileState);
|
|
797
|
-
if ((0, _mediaClient2.isExternalImageIdentifier)(identifier) &&
|
|
798
|
+
if ((0, _mediaClient2.isExternalImageIdentifier)(identifier) && isDiffIdentifier) {
|
|
798
799
|
this.fireCommencedEvent();
|
|
799
800
|
var dataURI = identifier.dataURI;
|
|
800
801
|
this.setState({
|
|
@@ -807,7 +808,7 @@ var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
807
808
|
isCardVisible: true
|
|
808
809
|
});
|
|
809
810
|
}
|
|
810
|
-
if ((0, _mediaClient2.isFileIdentifier)(identifier) && (turnedVisible || !!this.subscription && (isNewMediaClient ||
|
|
811
|
+
if ((0, _mediaClient2.isFileIdentifier)(identifier) && (turnedVisible || !!this.subscription && (isNewMediaClient || isDiffIdentifier))) {
|
|
811
812
|
this.updateStateForIdentifier(identifier);
|
|
812
813
|
}
|
|
813
814
|
if (this.state.status !== prevState.status) {
|
|
@@ -999,7 +1000,7 @@ var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
999
1000
|
}
|
|
1000
1001
|
}]);
|
|
1001
1002
|
return CardBase;
|
|
1002
|
-
}(_react.Component);
|
|
1003
|
+
}(_react.Component); // We require this wrapper in order to refresh media card state when the identifier is updated
|
|
1003
1004
|
exports.CardBase = CardBase;
|
|
1004
1005
|
(0, _defineProperty2.default)(CardBase, "defaultProps", {
|
|
1005
1006
|
appearance: 'auto',
|
|
@@ -1009,12 +1010,19 @@ exports.CardBase = CardBase;
|
|
|
1009
1010
|
// Media Feature Flag defaults are defined in @atlaskit/media-common
|
|
1010
1011
|
featureFlags: {}
|
|
1011
1012
|
});
|
|
1013
|
+
var CardWithKey = function CardWithKey(props) {
|
|
1014
|
+
var identifier = props.identifier;
|
|
1015
|
+
var key = (0, _mediaClient2.isFileIdentifier)(identifier) ? identifier.id : identifier.dataURI;
|
|
1016
|
+
return /*#__PURE__*/_react.default.createElement(CardBase, (0, _extends2.default)({}, props, {
|
|
1017
|
+
key: key
|
|
1018
|
+
}));
|
|
1019
|
+
};
|
|
1012
1020
|
var Card = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
1013
1021
|
packageVersion: packageVersion,
|
|
1014
1022
|
packageName: packageName,
|
|
1015
1023
|
componentName: 'mediaCard',
|
|
1016
1024
|
component: 'mediaCard'
|
|
1017
|
-
})((0, _analyticsNext.withAnalyticsEvents)()((0, _reactIntlNext.injectIntl)(
|
|
1025
|
+
})((0, _analyticsNext.withAnalyticsEvents)()((0, _reactIntlNext.injectIntl)(CardWithKey, {
|
|
1018
1026
|
enforceContext: false
|
|
1019
1027
|
})));
|
|
1020
1028
|
exports.Card = Card;
|
|
@@ -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 = "76.0.
|
|
93
|
+
var packageVersion = "76.0.5";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -14,7 +14,7 @@ exports.actionsBarClassName = actionsBarClassName;
|
|
|
14
14
|
var fixedActionBarStyles = "opacity: 1;";
|
|
15
15
|
exports.fixedActionBarStyles = fixedActionBarStyles;
|
|
16
16
|
var wrapperStyles = function wrapperStyles(isFixed) {
|
|
17
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n position: absolute;\n top:
|
|
17
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n position: absolute;\n top: ", ";\n right: ", ";\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n"])), isFixed ? fixedActionBarStyles : 'opacity: 0;', (0, _styles.transition)(), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
|
|
18
18
|
};
|
|
19
19
|
exports.wrapperStyles = wrapperStyles;
|
|
20
20
|
wrapperStyles.displayName = 'ActionsBarWrapper';
|
|
@@ -17,6 +17,8 @@ exports.tickboxFixedStyles = tickboxFixedStyles;
|
|
|
17
17
|
var getSelectedStyles = function getSelectedStyles(selected) {
|
|
18
18
|
return selected ? "background-color: ".concat("var(--ds-icon-information, ".concat(_colors.B200, ")"), ";\n color: ", "var(--ds-icon-inverse, white)", ";") : "";
|
|
19
19
|
};
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
20
22
|
exports.getSelectedStyles = getSelectedStyles;
|
|
21
23
|
var wrapperStyles = function wrapperStyles(selected) {
|
|
22
24
|
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n font-size: 14px;\n width: 14px;\n height: 14px;\n position: absolute;\n top: 7px;\n left: 7px;\n border-radius: 20px;\n color: transparent;\n /* Enforce dimensions and position of \"tick\" icon */\n span {\n display: block;\n svg {\n height: 14px;\n }\n }\n ", "\n"])), (0, _styles.transition)(), getSelectedStyles(selected));
|
|
@@ -57,7 +57,7 @@ var titleBoxFooterStyles = function titleBoxFooterStyles(_ref3) {
|
|
|
57
57
|
};
|
|
58
58
|
exports.titleBoxFooterStyles = titleBoxFooterStyles;
|
|
59
59
|
titleBoxFooterStyles.displayName = 'TitleBoxFooter';
|
|
60
|
-
var titleBoxIconStyles = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n right:
|
|
60
|
+
var titleBoxIconStyles = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n right: ", ";\n bottom: 0px;\n"])), "var(--ds-space-050, 4px)");
|
|
61
61
|
exports.titleBoxIconStyles = titleBoxIconStyles;
|
|
62
|
-
var errorMessageWrapperStyles = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n span {\n vertical-align: middle;\n :nth-child(2) {\n margin-left:
|
|
62
|
+
var errorMessageWrapperStyles = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n span {\n vertical-align: middle;\n :nth-child(2) {\n margin-left: ", ";\n margin-right: ", ";\n }\n }\n"])), "var(--ds-space-050, 4px)", "var(--ds-space-050, 4px)");
|
|
63
63
|
exports.errorMessageWrapperStyles = errorMessageWrapperStyles;
|
|
@@ -119,7 +119,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
119
119
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
120
120
|
var analyticsContext = {
|
|
121
121
|
packageVersion: "@atlaskit/media-card",
|
|
122
|
-
packageName: "76.0.
|
|
122
|
+
packageName: "76.0.5",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
14
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
16
|
var packageName = "@atlaskit/media-card";
|
|
17
|
-
var packageVersion = "76.0.
|
|
17
|
+
var packageVersion = "76.0.5";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/card/card.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import React, { Component, Suspense } from 'react';
|
|
3
4
|
import ReactDOM from 'react-dom';
|
|
@@ -27,7 +28,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
27
28
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
28
29
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
30
|
const packageName = "@atlaskit/media-card";
|
|
30
|
-
const packageVersion = "76.0.
|
|
31
|
+
const packageVersion = "76.0.5";
|
|
31
32
|
export class CardBase extends Component {
|
|
32
33
|
constructor(props) {
|
|
33
34
|
super(props);
|
|
@@ -754,7 +755,7 @@ export class CardBase extends Component {
|
|
|
754
755
|
isPlayingFile,
|
|
755
756
|
wasResolvedUpfrontPreview
|
|
756
757
|
} = this.state;
|
|
757
|
-
const
|
|
758
|
+
const isDiffIdentifier = isDifferentIdentifier(prevIdentifier, identifier);
|
|
758
759
|
/**
|
|
759
760
|
* Variable turnedVisible should only be true when media card
|
|
760
761
|
* was invisible in the previous state and is visible in the current one
|
|
@@ -772,7 +773,7 @@ export class CardBase extends Component {
|
|
|
772
773
|
const isNewMediaClient = prevMediaClient !== mediaClient;
|
|
773
774
|
const fileImageMode = imageResizeModeToFileImageMode(resizeMode);
|
|
774
775
|
this.updateFileStateFlag(fileState);
|
|
775
|
-
if (isExternalImageIdentifier(identifier) &&
|
|
776
|
+
if (isExternalImageIdentifier(identifier) && isDiffIdentifier) {
|
|
776
777
|
this.fireCommencedEvent();
|
|
777
778
|
const {
|
|
778
779
|
dataURI
|
|
@@ -787,7 +788,7 @@ export class CardBase extends Component {
|
|
|
787
788
|
isCardVisible: true
|
|
788
789
|
});
|
|
789
790
|
}
|
|
790
|
-
if (isFileIdentifier(identifier) && (turnedVisible || !!this.subscription && (isNewMediaClient ||
|
|
791
|
+
if (isFileIdentifier(identifier) && (turnedVisible || !!this.subscription && (isNewMediaClient || isDiffIdentifier))) {
|
|
791
792
|
this.updateStateForIdentifier(identifier);
|
|
792
793
|
}
|
|
793
794
|
if (this.state.status !== prevState.status) {
|
|
@@ -976,6 +977,8 @@ export class CardBase extends Component {
|
|
|
976
977
|
}, innerContent);
|
|
977
978
|
}
|
|
978
979
|
}
|
|
980
|
+
|
|
981
|
+
// We require this wrapper in order to refresh media card state when the identifier is updated
|
|
979
982
|
_defineProperty(CardBase, "defaultProps", {
|
|
980
983
|
appearance: 'auto',
|
|
981
984
|
resizeMode: 'crop',
|
|
@@ -984,11 +987,20 @@ _defineProperty(CardBase, "defaultProps", {
|
|
|
984
987
|
// Media Feature Flag defaults are defined in @atlaskit/media-common
|
|
985
988
|
featureFlags: {}
|
|
986
989
|
});
|
|
990
|
+
const CardWithKey = props => {
|
|
991
|
+
const {
|
|
992
|
+
identifier
|
|
993
|
+
} = props;
|
|
994
|
+
const key = isFileIdentifier(identifier) ? identifier.id : identifier.dataURI;
|
|
995
|
+
return /*#__PURE__*/React.createElement(CardBase, _extends({}, props, {
|
|
996
|
+
key: key
|
|
997
|
+
}));
|
|
998
|
+
};
|
|
987
999
|
export const Card = withMediaAnalyticsContext({
|
|
988
1000
|
packageVersion,
|
|
989
1001
|
packageName,
|
|
990
1002
|
componentName: 'mediaCard',
|
|
991
1003
|
component: 'mediaCard'
|
|
992
|
-
})(withAnalyticsEvents()(injectIntl(
|
|
1004
|
+
})(withAnalyticsEvents()(injectIntl(CardWithKey, {
|
|
993
1005
|
enforceContext: false
|
|
994
1006
|
})));
|
|
@@ -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 = "76.0.
|
|
69
|
+
const packageVersion = "76.0.5";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -6,8 +6,8 @@ export const wrapperStyles = isFixed => css`
|
|
|
6
6
|
${isFixed ? fixedActionBarStyles : 'opacity: 0;'}
|
|
7
7
|
${transition()}
|
|
8
8
|
position: absolute;
|
|
9
|
-
top: 8px;
|
|
10
|
-
right: 8px;
|
|
9
|
+
top: ${"var(--ds-space-100, 8px)"};
|
|
10
|
+
right: ${"var(--ds-space-100, 8px)"};
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-flow: row nowrap;
|
|
13
13
|
align-items: center;
|
|
@@ -8,6 +8,8 @@ export const tickboxFixedStyles = `
|
|
|
8
8
|
`;
|
|
9
9
|
export const getSelectedStyles = selected => selected ? `background-color: ${`var(--ds-icon-information, ${B200})`};
|
|
10
10
|
color: ${"var(--ds-icon-inverse, white)"};` : ``;
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
11
13
|
export const wrapperStyles = selected => css`
|
|
12
14
|
${transition()}
|
|
13
15
|
font-size: 14px;
|
|
@@ -64,7 +64,7 @@ export const titleBoxFooterStyles = ({
|
|
|
64
64
|
titleBoxFooterStyles.displayName = 'TitleBoxFooter';
|
|
65
65
|
export const titleBoxIconStyles = css`
|
|
66
66
|
position: absolute;
|
|
67
|
-
right: 4px;
|
|
67
|
+
right: ${"var(--ds-space-050, 4px)"};
|
|
68
68
|
bottom: 0px;
|
|
69
69
|
`;
|
|
70
70
|
export const errorMessageWrapperStyles = css`
|
|
@@ -74,8 +74,8 @@ export const errorMessageWrapperStyles = css`
|
|
|
74
74
|
span {
|
|
75
75
|
vertical-align: middle;
|
|
76
76
|
:nth-child(2) {
|
|
77
|
-
margin-left: 4px;
|
|
78
|
-
margin-right: 4px;
|
|
77
|
+
margin-left: ${"var(--ds-space-050, 4px)"};
|
|
78
|
+
margin-right: ${"var(--ds-space-050, 4px)"};
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
`;
|
|
@@ -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: "76.0.
|
|
40
|
+
packageName: "76.0.5",
|
|
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 = "76.0.
|
|
7
|
+
const packageVersion = "76.0.5";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/card/card.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -40,7 +41,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
40
41
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
41
42
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
43
|
var packageName = "@atlaskit/media-card";
|
|
43
|
-
var packageVersion = "76.0.
|
|
44
|
+
var packageVersion = "76.0.5";
|
|
44
45
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
45
46
|
_inherits(CardBase, _Component);
|
|
46
47
|
var _super = _createSuper(CardBase);
|
|
@@ -768,7 +769,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
768
769
|
previewDidRender = _this$state4.previewDidRender,
|
|
769
770
|
isPlayingFile = _this$state4.isPlayingFile,
|
|
770
771
|
wasResolvedUpfrontPreview = _this$state4.wasResolvedUpfrontPreview;
|
|
771
|
-
var
|
|
772
|
+
var isDiffIdentifier = isDifferentIdentifier(prevIdentifier, identifier);
|
|
772
773
|
/**
|
|
773
774
|
* Variable turnedVisible should only be true when media card
|
|
774
775
|
* was invisible in the previous state and is visible in the current one
|
|
@@ -786,7 +787,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
786
787
|
var isNewMediaClient = prevMediaClient !== mediaClient;
|
|
787
788
|
var fileImageMode = imageResizeModeToFileImageMode(resizeMode);
|
|
788
789
|
this.updateFileStateFlag(fileState);
|
|
789
|
-
if (isExternalImageIdentifier(identifier) &&
|
|
790
|
+
if (isExternalImageIdentifier(identifier) && isDiffIdentifier) {
|
|
790
791
|
this.fireCommencedEvent();
|
|
791
792
|
var dataURI = identifier.dataURI;
|
|
792
793
|
this.setState({
|
|
@@ -799,7 +800,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
799
800
|
isCardVisible: true
|
|
800
801
|
});
|
|
801
802
|
}
|
|
802
|
-
if (isFileIdentifier(identifier) && (turnedVisible || !!this.subscription && (isNewMediaClient ||
|
|
803
|
+
if (isFileIdentifier(identifier) && (turnedVisible || !!this.subscription && (isNewMediaClient || isDiffIdentifier))) {
|
|
803
804
|
this.updateStateForIdentifier(identifier);
|
|
804
805
|
}
|
|
805
806
|
if (this.state.status !== prevState.status) {
|
|
@@ -992,6 +993,8 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
992
993
|
}]);
|
|
993
994
|
return CardBase;
|
|
994
995
|
}(Component);
|
|
996
|
+
|
|
997
|
+
// We require this wrapper in order to refresh media card state when the identifier is updated
|
|
995
998
|
_defineProperty(CardBase, "defaultProps", {
|
|
996
999
|
appearance: 'auto',
|
|
997
1000
|
resizeMode: 'crop',
|
|
@@ -1000,11 +1003,18 @@ _defineProperty(CardBase, "defaultProps", {
|
|
|
1000
1003
|
// Media Feature Flag defaults are defined in @atlaskit/media-common
|
|
1001
1004
|
featureFlags: {}
|
|
1002
1005
|
});
|
|
1006
|
+
var CardWithKey = function CardWithKey(props) {
|
|
1007
|
+
var identifier = props.identifier;
|
|
1008
|
+
var key = isFileIdentifier(identifier) ? identifier.id : identifier.dataURI;
|
|
1009
|
+
return /*#__PURE__*/React.createElement(CardBase, _extends({}, props, {
|
|
1010
|
+
key: key
|
|
1011
|
+
}));
|
|
1012
|
+
};
|
|
1003
1013
|
export var Card = withMediaAnalyticsContext({
|
|
1004
1014
|
packageVersion: packageVersion,
|
|
1005
1015
|
packageName: packageName,
|
|
1006
1016
|
componentName: 'mediaCard',
|
|
1007
1017
|
component: 'mediaCard'
|
|
1008
|
-
})(withAnalyticsEvents()(injectIntl(
|
|
1018
|
+
})(withAnalyticsEvents()(injectIntl(CardWithKey, {
|
|
1009
1019
|
enforceContext: false
|
|
1010
1020
|
})));
|
|
@@ -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 = "76.0.
|
|
86
|
+
var packageVersion = "76.0.5";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -5,6 +5,6 @@ import { transition } from '../styles';
|
|
|
5
5
|
export var actionsBarClassName = 'media-card-actions-bar';
|
|
6
6
|
export var fixedActionBarStyles = "opacity: 1;";
|
|
7
7
|
export var wrapperStyles = function wrapperStyles(isFixed) {
|
|
8
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n position: absolute;\n top:
|
|
8
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n position: absolute;\n top: ", ";\n right: ", ";\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n"])), isFixed ? fixedActionBarStyles : 'opacity: 0;', transition(), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
|
|
9
9
|
};
|
|
10
10
|
wrapperStyles.displayName = 'ActionsBarWrapper';
|
|
@@ -8,6 +8,8 @@ export var tickboxFixedStyles = "\n background-color: ".concat("var(--ds-backgr
|
|
|
8
8
|
export var getSelectedStyles = function getSelectedStyles(selected) {
|
|
9
9
|
return selected ? "background-color: ".concat("var(--ds-icon-information, ".concat(B200, ")"), ";\n color: ", "var(--ds-icon-inverse, white)", ";") : "";
|
|
10
10
|
};
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
11
13
|
export var wrapperStyles = function wrapperStyles(selected) {
|
|
12
14
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n font-size: 14px;\n width: 14px;\n height: 14px;\n position: absolute;\n top: 7px;\n left: 7px;\n border-radius: 20px;\n color: transparent;\n /* Enforce dimensions and position of \"tick\" icon */\n span {\n display: block;\n svg {\n height: 14px;\n }\n }\n ", "\n"])), transition(), getSelectedStyles(selected));
|
|
13
15
|
};
|
|
@@ -47,5 +47,5 @@ export var titleBoxFooterStyles = function titleBoxFooterStyles(_ref3) {
|
|
|
47
47
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n text-overflow: ellipsis;\n ", "\n ", "\n"])), infoStyles, hasIconOverlap && iconOverlapStyles);
|
|
48
48
|
};
|
|
49
49
|
titleBoxFooterStyles.displayName = 'TitleBoxFooter';
|
|
50
|
-
export var titleBoxIconStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n right:
|
|
51
|
-
export var errorMessageWrapperStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n span {\n vertical-align: middle;\n :nth-child(2) {\n margin-left:
|
|
50
|
+
export var titleBoxIconStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0px;\n"])), "var(--ds-space-050, 4px)");
|
|
51
|
+
export var errorMessageWrapperStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n span {\n vertical-align: middle;\n :nth-child(2) {\n margin-left: ", ";\n margin-right: ", ";\n }\n }\n"])), "var(--ds-space-050, 4px)", "var(--ds-space-050, 4px)");
|
|
@@ -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: "76.0.
|
|
106
|
+
packageName: "76.0.5",
|
|
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 = "76.0.
|
|
10
|
+
var packageVersion = "76.0.5";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**@jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
|
|
4
5
|
type CardViewWrapperProps = {
|
|
5
6
|
wrapperDimensions: { width: string; height: string };
|
|
@@ -14,12 +15,14 @@ const displayInlineStyles = (displayInline?: boolean) => {
|
|
|
14
15
|
const cardWrapperStyles = ({
|
|
15
16
|
wrapperDimensions,
|
|
16
17
|
displayInline,
|
|
17
|
-
}: CardViewWrapperProps) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
}: CardViewWrapperProps) =>
|
|
19
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
20
|
+
css`
|
|
21
|
+
${displayInlineStyles(displayInline)}
|
|
22
|
+
width: ${wrapperDimensions.width};
|
|
23
|
+
height: ${wrapperDimensions.height};
|
|
24
|
+
margin: 15px ${token('space.250', '20px')};
|
|
25
|
+
`;
|
|
23
26
|
|
|
24
27
|
export const CardViewWrapper = (props: CardViewWrapperProps) => {
|
|
25
28
|
return <div css={cardWrapperStyles(props)}>{props.children}</div>;
|
|
@@ -2,11 +2,12 @@ import { token } from '@atlaskit/tokens';
|
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
|
|
4
4
|
export const editableCardOptionsStyles = css`
|
|
5
|
-
padding: 20px;
|
|
5
|
+
padding: ${token('space.250', '20px')};
|
|
6
6
|
border-bottom: 1px solid ${token('color.border', '#ccc')};
|
|
7
7
|
max-width: 700px;
|
|
8
8
|
`;
|
|
9
9
|
|
|
10
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
10
11
|
export const sliderWrapperStyles = css`
|
|
11
12
|
display: flex;
|
|
12
13
|
width: 50%;
|
|
@@ -17,9 +18,10 @@ export const sliderWrapperStyles = css`
|
|
|
17
18
|
}
|
|
18
19
|
`;
|
|
19
20
|
|
|
21
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
20
22
|
export const editableCardContentStyles = css`
|
|
21
23
|
/* Not making the wrapper fancier or center elements in order to have a more realistic scenario */
|
|
22
|
-
padding: 20px;
|
|
24
|
+
padding: ${token('space.250', '20px')};
|
|
23
25
|
border: 2px dashed;
|
|
24
26
|
margin: 0 10px 50px 10px;
|
|
25
27
|
overflow: hidden;
|
|
@@ -30,6 +32,7 @@ export const editableCardContentStyles = css`
|
|
|
30
32
|
box-sizing: border-box;
|
|
31
33
|
`;
|
|
32
34
|
|
|
35
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
33
36
|
export const optionsWrapperStyles = css`
|
|
34
37
|
display: flex;
|
|
35
38
|
|
|
@@ -39,8 +42,9 @@ export const optionsWrapperStyles = css`
|
|
|
39
42
|
}
|
|
40
43
|
`;
|
|
41
44
|
|
|
45
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
42
46
|
export const cardDimensionsWrapperStyles = css`
|
|
43
|
-
margin: 10px 10px 20px 10px;
|
|
47
|
+
margin: 10px 10px ${token('space.250', '20px')} 10px;
|
|
44
48
|
display: flex;
|
|
45
49
|
|
|
46
50
|
> div {
|
|
@@ -58,6 +62,7 @@ export const cardPreviewWrapperStyles = css`
|
|
|
58
62
|
flex: 1;
|
|
59
63
|
`;
|
|
60
64
|
|
|
65
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
61
66
|
export const cardWrapperStyles = css`
|
|
62
67
|
border: 1px solid ${token('color.border.bold', 'black')};
|
|
63
68
|
padding: 10px;
|
|
@@ -69,11 +74,13 @@ export const cardWrapperStyles = css`
|
|
|
69
74
|
display: inline-block;
|
|
70
75
|
`;
|
|
71
76
|
|
|
77
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
72
78
|
export const cardFlowHeaderStyles = css`
|
|
73
|
-
margin: 20px auto;
|
|
79
|
+
margin: ${token('space.250', '20px')} auto;
|
|
74
80
|
padding: 10px 0;
|
|
75
81
|
`;
|
|
76
82
|
|
|
83
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
77
84
|
export const externalIdentifierWrapperStyles = css`
|
|
78
85
|
display: flex;
|
|
79
86
|
justify-content: space-around;
|
|
@@ -85,18 +92,19 @@ export const externalIdentifierWrapperStyles = css`
|
|
|
85
92
|
`;
|
|
86
93
|
|
|
87
94
|
export const unhandledErrorCardWrapperStyles = css`
|
|
88
|
-
padding: 20px;
|
|
95
|
+
padding: ${token('space.250', '20px')};
|
|
89
96
|
|
|
90
97
|
> div:first-child {
|
|
91
98
|
display: flex;
|
|
92
|
-
margin-bottom: 20px;
|
|
99
|
+
margin-bottom: ${token('space.250', '20px')};
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
label {
|
|
96
|
-
margin-right: 20px;
|
|
103
|
+
margin-right: ${token('space.250', '20px')};
|
|
97
104
|
}
|
|
98
105
|
`;
|
|
99
106
|
|
|
107
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
100
108
|
export const inlineCardVideoWrapperItemStyles = css`
|
|
101
109
|
padding: 10px;
|
|
102
110
|
border: 1px solid ${token('color.border.bold', 'black')};
|
|
@@ -116,6 +124,7 @@ export const mediaViewerExampleWrapperStyles = css`
|
|
|
116
124
|
display: flex;
|
|
117
125
|
`;
|
|
118
126
|
|
|
127
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
119
128
|
export const mediaInlineWrapperStyles = css`
|
|
120
129
|
display: flex;
|
|
121
130
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "76.0.
|
|
3
|
+
"version": "76.0.5",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -98,7 +98,8 @@
|
|
|
98
98
|
"techstack": {
|
|
99
99
|
"@repo/internal": {
|
|
100
100
|
"design-tokens": [
|
|
101
|
-
"color"
|
|
101
|
+
"color",
|
|
102
|
+
"spacing"
|
|
102
103
|
]
|
|
103
104
|
}
|
|
104
105
|
},
|