@atlaskit/media-card 77.10.12 → 77.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardView.js +2 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/iconMessage/iconMessageWrapper.js +9 -10
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/cardViewV2.js +2 -1
- package/dist/cjs/card/v2/cardviews/loadingCardView.js +2 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/lightCards/cardLoading.js +3 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/utils/viewportDetector.js +16 -4
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardView.js +2 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/iconMessage/iconMessageWrapper.js +10 -11
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/cardViewV2.js +2 -1
- package/dist/es2019/card/v2/cardviews/loadingCardView.js +2 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/lightCards/cardLoading.js +3 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/utils/viewportDetector.js +13 -5
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/cardView.js +2 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/iconMessage/iconMessageWrapper.js +10 -11
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/cardViewV2.js +2 -1
- package/dist/esm/card/v2/cardviews/loadingCardView.js +2 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/lightCards/cardLoading.js +3 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/utils/viewportDetector.js +17 -5
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 77.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#90872](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90872) [`ac8e7b44549a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ac8e7b44549a) - The internal composition of this package has changed. There is no expected change in behavior.
|
|
8
|
+
|
|
9
|
+
## 77.11.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#88895](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88895) [`a48b908e2bf6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a48b908e2bf6) - Add integration of React UFO to not hold react-ufo measurement when media is not in viewport
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 77.10.12
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -50,7 +50,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
50
50
|
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); }; }
|
|
51
51
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
52
52
|
var packageName = "@atlaskit/media-card";
|
|
53
|
-
var packageVersion = "77.
|
|
53
|
+
var packageVersion = "77.11.1";
|
|
54
54
|
var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
55
55
|
(0, _inherits2.default)(CardBase, _Component);
|
|
56
56
|
var _super = _createSuper(CardBase);
|
|
@@ -251,7 +251,8 @@ var CardViewBase = exports.CardViewBase = /*#__PURE__*/function (_React$Componen
|
|
|
251
251
|
breakpoint: this.breakpoint,
|
|
252
252
|
hasTitleBox: hasTitleBox
|
|
253
253
|
}, (0, _react.jsx)(_spinner.default, {
|
|
254
|
-
testId: 'media-card-loading'
|
|
254
|
+
testId: 'media-card-loading',
|
|
255
|
+
interactionName: 'media-card-loading'
|
|
255
256
|
}));
|
|
256
257
|
}
|
|
257
258
|
}, {
|
|
@@ -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.
|
|
93
|
+
var packageVersion = "77.11.1";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.IconMessageWrapper = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _primitives = require("@atlaskit/primitives");
|
|
9
8
|
/**@jsx jsx */
|
|
10
9
|
|
|
11
10
|
var breatheAnimation = (0, _react.keyframes)({
|
|
@@ -19,32 +18,32 @@ var breatheAnimation = (0, _react.keyframes)({
|
|
|
19
18
|
opacity: 1
|
|
20
19
|
}
|
|
21
20
|
});
|
|
22
|
-
var animatedStyles = (0,
|
|
21
|
+
var animatedStyles = (0, _react.css)({
|
|
23
22
|
animationName: breatheAnimation,
|
|
24
23
|
animationDuration: '3.5s',
|
|
25
24
|
animationTimingFunction: 'ease-in-out',
|
|
26
25
|
animationIterationCount: 'infinite'
|
|
27
26
|
});
|
|
28
|
-
var reducedFontStyle = (0,
|
|
27
|
+
var reducedFontStyle = (0, _react.css)({
|
|
29
28
|
fontSize: '0.7em'
|
|
30
29
|
});
|
|
31
|
-
var baseStyles = (0,
|
|
30
|
+
var baseStyles = (0, _react.css)({
|
|
32
31
|
overflow: 'hidden',
|
|
33
32
|
opacity: 1,
|
|
34
33
|
fontWeight: 450,
|
|
35
|
-
color:
|
|
34
|
+
color: "var(--ds-text-subtlest, #7A869A)",
|
|
36
35
|
textAlign: 'center',
|
|
37
|
-
// eslint-disable-next-line @atlaskit/design-system/
|
|
36
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
38
37
|
marginBottom: '-1em',
|
|
39
38
|
// Needs pixel precision to align the icon at the center of the box
|
|
40
|
-
paddingBlock:
|
|
41
|
-
paddingInline:
|
|
39
|
+
paddingBlock: "var(--ds-space-050, 4px)",
|
|
40
|
+
paddingInline: "var(--ds-space-100, 8px)"
|
|
42
41
|
});
|
|
43
42
|
var IconMessageWrapper = exports.IconMessageWrapper = function IconMessageWrapper(props) {
|
|
44
43
|
var animated = props.animated,
|
|
45
44
|
reducedFont = props.reducedFont;
|
|
46
|
-
return (0, _react.jsx)(
|
|
45
|
+
return (0, _react.jsx)("div", {
|
|
47
46
|
id: "iconMessageWrapper",
|
|
48
|
-
|
|
47
|
+
css: [baseStyles, reducedFont && reducedFontStyle, animated && animatedStyles]
|
|
49
48
|
}, props.children);
|
|
50
49
|
};
|
|
@@ -16,7 +16,7 @@ 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.
|
|
19
|
+
var packageVersion = "77.11.1";
|
|
20
20
|
var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
|
|
21
21
|
var identifier = _ref.identifier,
|
|
22
22
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -230,7 +230,8 @@ var CardViewV2Base = exports.CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
230
230
|
breakpoint: breakpoint,
|
|
231
231
|
hasTitleBox: hasTitleBox
|
|
232
232
|
}, (0, _react.jsx)(_spinner.default, {
|
|
233
|
-
testId: "media-card-loading"
|
|
233
|
+
testId: "media-card-loading",
|
|
234
|
+
interactionName: "media-card-loading"
|
|
234
235
|
})), renderImageRenderer && !!cardPreview && (0, _react.jsx)(_imageRenderer.ImageRenderer, {
|
|
235
236
|
cardPreview: cardPreview,
|
|
236
237
|
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
@@ -37,7 +37,8 @@ var LoadingCardViewBase = function LoadingCardViewBase(props) {
|
|
|
37
37
|
breakpoint: breakpoint,
|
|
38
38
|
hasTitleBox: hasTitleBox
|
|
39
39
|
}, (0, _react.jsx)(_spinner.default, {
|
|
40
|
-
testId: "media-card-loading"
|
|
40
|
+
testId: "media-card-loading",
|
|
41
|
+
interactionName: "media-card-loading"
|
|
41
42
|
})));
|
|
42
43
|
};
|
|
43
44
|
|
|
@@ -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.
|
|
122
|
+
packageName: "77.11.1",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -37,7 +37,9 @@ var CardLoading = exports.CardLoading = /*#__PURE__*/function (_Component) {
|
|
|
37
37
|
"data-testid": testId || 'media-card-loading',
|
|
38
38
|
"data-test-loading": true,
|
|
39
39
|
dimensions: dimensions
|
|
40
|
-
}, /*#__PURE__*/_react.default.createElement(_spinner.default,
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
41
|
+
interactionName: "media-card-loading"
|
|
42
|
+
}));
|
|
41
43
|
}
|
|
42
44
|
}]);
|
|
43
45
|
return CardLoading;
|
|
@@ -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.
|
|
17
|
+
var packageVersion = "77.11.1";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.ViewportDetector = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _ufoInteractionIgnore = _interopRequireDefault(require("@atlaskit/ufo-interaction-ignore"));
|
|
10
12
|
var _document = _interopRequireDefault(require("./document"));
|
|
11
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -39,15 +41,23 @@ var ViewportObserver = function ViewportObserver(_ref) {
|
|
|
39
41
|
var onVisible = _ref.onVisible,
|
|
40
42
|
cardEl = _ref.cardEl,
|
|
41
43
|
children = _ref.children;
|
|
44
|
+
var _useState = (0, _react.useState)(false),
|
|
45
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
46
|
+
isVisible = _useState2[0],
|
|
47
|
+
setIsVisible = _useState2[1];
|
|
48
|
+
var onVisibleCallback = (0, _react.useCallback)(function () {
|
|
49
|
+
setIsVisible(true);
|
|
50
|
+
onVisible();
|
|
51
|
+
}, [onVisible]);
|
|
42
52
|
(0, _react.useEffect)(function () {
|
|
43
53
|
var intersectionObserver;
|
|
44
54
|
try {
|
|
45
|
-
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(
|
|
55
|
+
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisibleCallback), {
|
|
46
56
|
root: (0, _document.default)(),
|
|
47
57
|
rootMargin: "".concat(ABS_VIEWPORT_ANCHOR_OFFSET_TOP, "px")
|
|
48
58
|
});
|
|
49
59
|
} catch (error) {
|
|
50
|
-
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(
|
|
60
|
+
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisibleCallback), {
|
|
51
61
|
root: null,
|
|
52
62
|
rootMargin: "".concat(ABS_VIEWPORT_ANCHOR_OFFSET_TOP, "px")
|
|
53
63
|
});
|
|
@@ -56,8 +66,10 @@ var ViewportObserver = function ViewportObserver(_ref) {
|
|
|
56
66
|
return function () {
|
|
57
67
|
intersectionObserver.disconnect();
|
|
58
68
|
};
|
|
59
|
-
}, [cardEl,
|
|
60
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
69
|
+
}, [cardEl, onVisibleCallback]);
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_ufoInteractionIgnore.default, {
|
|
71
|
+
ignore: !isVisible
|
|
72
|
+
}, children);
|
|
61
73
|
};
|
|
62
74
|
var ViewportDetector = exports.ViewportDetector = function ViewportDetector(_ref2) {
|
|
63
75
|
var cardEl = _ref2.cardEl,
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -28,7 +28,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
30
30
|
const packageName = "@atlaskit/media-card";
|
|
31
|
-
const packageVersion = "77.
|
|
31
|
+
const packageVersion = "77.11.1";
|
|
32
32
|
export class CardBase extends Component {
|
|
33
33
|
constructor(props) {
|
|
34
34
|
super(props);
|
|
@@ -245,7 +245,8 @@ export class CardViewBase extends React.Component {
|
|
|
245
245
|
breakpoint: this.breakpoint,
|
|
246
246
|
hasTitleBox: hasTitleBox
|
|
247
247
|
}, jsx(SpinnerIcon, {
|
|
248
|
-
testId: 'media-card-loading'
|
|
248
|
+
testId: 'media-card-loading',
|
|
249
|
+
interactionName: 'media-card-loading'
|
|
249
250
|
}));
|
|
250
251
|
}
|
|
251
252
|
shouldRenderPlayButton() {
|
|
@@ -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.
|
|
69
|
+
const packageVersion = "77.11.1";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**@jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { keyframes } from '@emotion/react';
|
|
4
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
4
|
const breatheAnimation = keyframes({
|
|
6
5
|
'0%': {
|
|
7
6
|
opacity: 1
|
|
@@ -13,34 +12,34 @@ const breatheAnimation = keyframes({
|
|
|
13
12
|
opacity: 1
|
|
14
13
|
}
|
|
15
14
|
});
|
|
16
|
-
const animatedStyles =
|
|
15
|
+
const animatedStyles = css({
|
|
17
16
|
animationName: breatheAnimation,
|
|
18
17
|
animationDuration: '3.5s',
|
|
19
18
|
animationTimingFunction: 'ease-in-out',
|
|
20
19
|
animationIterationCount: 'infinite'
|
|
21
20
|
});
|
|
22
|
-
const reducedFontStyle =
|
|
21
|
+
const reducedFontStyle = css({
|
|
23
22
|
fontSize: '0.7em'
|
|
24
23
|
});
|
|
25
|
-
const baseStyles =
|
|
24
|
+
const baseStyles = css({
|
|
26
25
|
overflow: 'hidden',
|
|
27
26
|
opacity: 1,
|
|
28
27
|
fontWeight: 450,
|
|
29
|
-
color:
|
|
28
|
+
color: "var(--ds-text-subtlest, #7A869A)",
|
|
30
29
|
textAlign: 'center',
|
|
31
|
-
// eslint-disable-next-line @atlaskit/design-system/
|
|
30
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
32
31
|
marginBottom: '-1em',
|
|
33
32
|
// Needs pixel precision to align the icon at the center of the box
|
|
34
|
-
paddingBlock:
|
|
35
|
-
paddingInline:
|
|
33
|
+
paddingBlock: "var(--ds-space-050, 4px)",
|
|
34
|
+
paddingInline: "var(--ds-space-100, 8px)"
|
|
36
35
|
});
|
|
37
36
|
export const IconMessageWrapper = props => {
|
|
38
37
|
const {
|
|
39
38
|
animated,
|
|
40
39
|
reducedFont
|
|
41
40
|
} = props;
|
|
42
|
-
return jsx(
|
|
41
|
+
return jsx("div", {
|
|
43
42
|
id: "iconMessageWrapper",
|
|
44
|
-
|
|
43
|
+
css: [baseStyles, reducedFont && reducedFontStyle, animated && animatedStyles]
|
|
45
44
|
}, props.children);
|
|
46
45
|
};
|
|
@@ -7,7 +7,7 @@ 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.
|
|
10
|
+
const packageVersion = "77.11.1";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|
|
@@ -225,7 +225,8 @@ export const CardViewV2Base = ({
|
|
|
225
225
|
breakpoint: breakpoint,
|
|
226
226
|
hasTitleBox: hasTitleBox
|
|
227
227
|
}, jsx(SpinnerIcon, {
|
|
228
|
-
testId: "media-card-loading"
|
|
228
|
+
testId: "media-card-loading",
|
|
229
|
+
interactionName: "media-card-loading"
|
|
229
230
|
})), renderImageRenderer && !!cardPreview && jsx(ImageRenderer, {
|
|
230
231
|
cardPreview: cardPreview,
|
|
231
232
|
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
@@ -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.
|
|
40
|
+
packageName: "77.11.1",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -14,6 +14,8 @@ export class CardLoading extends Component {
|
|
|
14
14
|
"data-testid": testId || 'media-card-loading',
|
|
15
15
|
"data-test-loading": true,
|
|
16
16
|
dimensions: dimensions
|
|
17
|
-
}, /*#__PURE__*/React.createElement(SpinnerIcon,
|
|
17
|
+
}, /*#__PURE__*/React.createElement(SpinnerIcon, {
|
|
18
|
+
interactionName: "media-card-loading"
|
|
19
|
+
}));
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -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.
|
|
7
|
+
const packageVersion = "77.11.1";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
1
|
+
import React, { useEffect, useCallback, useState } from 'react';
|
|
2
|
+
import UFOInteractionIgnore from '@atlaskit/ufo-interaction-ignore';
|
|
2
3
|
import getDocument from './document';
|
|
3
4
|
const ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900; //px
|
|
4
5
|
|
|
@@ -16,15 +17,20 @@ const ViewportObserver = ({
|
|
|
16
17
|
cardEl,
|
|
17
18
|
children
|
|
18
19
|
}) => {
|
|
20
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
21
|
+
const onVisibleCallback = useCallback(() => {
|
|
22
|
+
setIsVisible(true);
|
|
23
|
+
onVisible();
|
|
24
|
+
}, [onVisible]);
|
|
19
25
|
useEffect(() => {
|
|
20
26
|
let intersectionObserver;
|
|
21
27
|
try {
|
|
22
|
-
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(
|
|
28
|
+
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisibleCallback), {
|
|
23
29
|
root: getDocument(),
|
|
24
30
|
rootMargin: `${ABS_VIEWPORT_ANCHOR_OFFSET_TOP}px`
|
|
25
31
|
});
|
|
26
32
|
} catch (error) {
|
|
27
|
-
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(
|
|
33
|
+
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisibleCallback), {
|
|
28
34
|
root: null,
|
|
29
35
|
rootMargin: `${ABS_VIEWPORT_ANCHOR_OFFSET_TOP}px`
|
|
30
36
|
});
|
|
@@ -33,8 +39,10 @@ const ViewportObserver = ({
|
|
|
33
39
|
return () => {
|
|
34
40
|
intersectionObserver.disconnect();
|
|
35
41
|
};
|
|
36
|
-
}, [cardEl,
|
|
37
|
-
return /*#__PURE__*/React.createElement(
|
|
42
|
+
}, [cardEl, onVisibleCallback]);
|
|
43
|
+
return /*#__PURE__*/React.createElement(UFOInteractionIgnore, {
|
|
44
|
+
ignore: !isVisible
|
|
45
|
+
}, children);
|
|
38
46
|
};
|
|
39
47
|
export const ViewportDetector = ({
|
|
40
48
|
cardEl,
|
package/dist/esm/card/card.js
CHANGED
|
@@ -41,7 +41,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
43
43
|
var packageName = "@atlaskit/media-card";
|
|
44
|
-
var packageVersion = "77.
|
|
44
|
+
var packageVersion = "77.11.1";
|
|
45
45
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
46
46
|
_inherits(CardBase, _Component);
|
|
47
47
|
var _super = _createSuper(CardBase);
|
|
@@ -245,7 +245,8 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
245
245
|
breakpoint: this.breakpoint,
|
|
246
246
|
hasTitleBox: hasTitleBox
|
|
247
247
|
}, jsx(SpinnerIcon, {
|
|
248
|
-
testId: 'media-card-loading'
|
|
248
|
+
testId: 'media-card-loading',
|
|
249
|
+
interactionName: 'media-card-loading'
|
|
249
250
|
}));
|
|
250
251
|
}
|
|
251
252
|
}, {
|
|
@@ -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.
|
|
86
|
+
var packageVersion = "77.11.1";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**@jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { keyframes } from '@emotion/react';
|
|
4
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
4
|
var breatheAnimation = keyframes({
|
|
6
5
|
'0%': {
|
|
7
6
|
opacity: 1
|
|
@@ -13,32 +12,32 @@ var breatheAnimation = keyframes({
|
|
|
13
12
|
opacity: 1
|
|
14
13
|
}
|
|
15
14
|
});
|
|
16
|
-
var animatedStyles =
|
|
15
|
+
var animatedStyles = css({
|
|
17
16
|
animationName: breatheAnimation,
|
|
18
17
|
animationDuration: '3.5s',
|
|
19
18
|
animationTimingFunction: 'ease-in-out',
|
|
20
19
|
animationIterationCount: 'infinite'
|
|
21
20
|
});
|
|
22
|
-
var reducedFontStyle =
|
|
21
|
+
var reducedFontStyle = css({
|
|
23
22
|
fontSize: '0.7em'
|
|
24
23
|
});
|
|
25
|
-
var baseStyles =
|
|
24
|
+
var baseStyles = css({
|
|
26
25
|
overflow: 'hidden',
|
|
27
26
|
opacity: 1,
|
|
28
27
|
fontWeight: 450,
|
|
29
|
-
color:
|
|
28
|
+
color: "var(--ds-text-subtlest, #7A869A)",
|
|
30
29
|
textAlign: 'center',
|
|
31
|
-
// eslint-disable-next-line @atlaskit/design-system/
|
|
30
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
32
31
|
marginBottom: '-1em',
|
|
33
32
|
// Needs pixel precision to align the icon at the center of the box
|
|
34
|
-
paddingBlock:
|
|
35
|
-
paddingInline:
|
|
33
|
+
paddingBlock: "var(--ds-space-050, 4px)",
|
|
34
|
+
paddingInline: "var(--ds-space-100, 8px)"
|
|
36
35
|
});
|
|
37
36
|
export var IconMessageWrapper = function IconMessageWrapper(props) {
|
|
38
37
|
var animated = props.animated,
|
|
39
38
|
reducedFont = props.reducedFont;
|
|
40
|
-
return jsx(
|
|
39
|
+
return jsx("div", {
|
|
41
40
|
id: "iconMessageWrapper",
|
|
42
|
-
|
|
41
|
+
css: [baseStyles, reducedFont && reducedFontStyle, animated && animatedStyles]
|
|
43
42
|
}, props.children);
|
|
44
43
|
};
|
|
@@ -9,7 +9,7 @@ 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.
|
|
12
|
+
var packageVersion = "77.11.1";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -221,7 +221,8 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
221
221
|
breakpoint: breakpoint,
|
|
222
222
|
hasTitleBox: hasTitleBox
|
|
223
223
|
}, jsx(SpinnerIcon, {
|
|
224
|
-
testId: "media-card-loading"
|
|
224
|
+
testId: "media-card-loading",
|
|
225
|
+
interactionName: "media-card-loading"
|
|
225
226
|
})), renderImageRenderer && !!cardPreview && jsx(ImageRenderer, {
|
|
226
227
|
cardPreview: cardPreview,
|
|
227
228
|
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
@@ -29,7 +29,8 @@ var LoadingCardViewBase = function LoadingCardViewBase(props) {
|
|
|
29
29
|
breakpoint: breakpoint,
|
|
30
30
|
hasTitleBox: hasTitleBox
|
|
31
31
|
}, jsx(SpinnerIcon, {
|
|
32
|
-
testId: "media-card-loading"
|
|
32
|
+
testId: "media-card-loading",
|
|
33
|
+
interactionName: "media-card-loading"
|
|
33
34
|
})));
|
|
34
35
|
};
|
|
35
36
|
|
|
@@ -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.
|
|
106
|
+
packageName: "77.11.1",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -28,7 +28,9 @@ export var CardLoading = /*#__PURE__*/function (_Component) {
|
|
|
28
28
|
"data-testid": testId || 'media-card-loading',
|
|
29
29
|
"data-test-loading": true,
|
|
30
30
|
dimensions: dimensions
|
|
31
|
-
}, /*#__PURE__*/React.createElement(SpinnerIcon,
|
|
31
|
+
}, /*#__PURE__*/React.createElement(SpinnerIcon, {
|
|
32
|
+
interactionName: "media-card-loading"
|
|
33
|
+
}));
|
|
32
34
|
}
|
|
33
35
|
}]);
|
|
34
36
|
return CardLoading;
|
|
@@ -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.
|
|
10
|
+
var packageVersion = "77.11.1";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
4
|
-
import React, { useEffect } from 'react';
|
|
5
|
+
import React, { useEffect, useCallback, useState } from 'react';
|
|
6
|
+
import UFOInteractionIgnore from '@atlaskit/ufo-interaction-ignore';
|
|
5
7
|
import getDocument from './document';
|
|
6
8
|
var ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900; //px
|
|
7
9
|
|
|
@@ -29,15 +31,23 @@ var ViewportObserver = function ViewportObserver(_ref) {
|
|
|
29
31
|
var onVisible = _ref.onVisible,
|
|
30
32
|
cardEl = _ref.cardEl,
|
|
31
33
|
children = _ref.children;
|
|
34
|
+
var _useState = useState(false),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
isVisible = _useState2[0],
|
|
37
|
+
setIsVisible = _useState2[1];
|
|
38
|
+
var onVisibleCallback = useCallback(function () {
|
|
39
|
+
setIsVisible(true);
|
|
40
|
+
onVisible();
|
|
41
|
+
}, [onVisible]);
|
|
32
42
|
useEffect(function () {
|
|
33
43
|
var intersectionObserver;
|
|
34
44
|
try {
|
|
35
|
-
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(
|
|
45
|
+
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisibleCallback), {
|
|
36
46
|
root: getDocument(),
|
|
37
47
|
rootMargin: "".concat(ABS_VIEWPORT_ANCHOR_OFFSET_TOP, "px")
|
|
38
48
|
});
|
|
39
49
|
} catch (error) {
|
|
40
|
-
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(
|
|
50
|
+
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisibleCallback), {
|
|
41
51
|
root: null,
|
|
42
52
|
rootMargin: "".concat(ABS_VIEWPORT_ANCHOR_OFFSET_TOP, "px")
|
|
43
53
|
});
|
|
@@ -46,8 +56,10 @@ var ViewportObserver = function ViewportObserver(_ref) {
|
|
|
46
56
|
return function () {
|
|
47
57
|
intersectionObserver.disconnect();
|
|
48
58
|
};
|
|
49
|
-
}, [cardEl,
|
|
50
|
-
return /*#__PURE__*/React.createElement(
|
|
59
|
+
}, [cardEl, onVisibleCallback]);
|
|
60
|
+
return /*#__PURE__*/React.createElement(UFOInteractionIgnore, {
|
|
61
|
+
ignore: !isVisible
|
|
62
|
+
}, children);
|
|
51
63
|
};
|
|
52
64
|
export var ViewportDetector = function ViewportDetector(_ref2) {
|
|
53
65
|
var cardEl = _ref2.cardEl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "77.
|
|
3
|
+
"version": "77.11.1",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
"@atlaskit/dropdown-menu": "^12.8.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
42
42
|
"@atlaskit/icon": "^22.1.0",
|
|
43
|
-
"@atlaskit/media-client": "^26.
|
|
43
|
+
"@atlaskit/media-client": "^26.3.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
45
45
|
"@atlaskit/media-common": "^11.1.0",
|
|
46
46
|
"@atlaskit/media-file-preview": "^0.5.0",
|
|
47
|
-
"@atlaskit/media-ui": "^25.
|
|
47
|
+
"@atlaskit/media-ui": "^25.7.0",
|
|
48
48
|
"@atlaskit/media-viewer": "^48.4.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
50
|
-
"@atlaskit/primitives": "^5.5.0",
|
|
51
50
|
"@atlaskit/spinner": "^16.0.0",
|
|
52
51
|
"@atlaskit/theme": "^12.7.0",
|
|
53
52
|
"@atlaskit/tokens": "^1.43.0",
|
|
54
|
-
"@atlaskit/tooltip": "^18.
|
|
53
|
+
"@atlaskit/tooltip": "^18.2.0",
|
|
55
54
|
"@atlaskit/ufo": "^0.2.0",
|
|
55
|
+
"@atlaskit/ufo-interaction-ignore": "^1.1.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|
|
57
57
|
"classnames": "^2.2.5",
|
|
58
58
|
"eventemitter2": "^4.1.0",
|
|
@@ -73,8 +73,9 @@
|
|
|
73
73
|
"@atlaskit/media-core": "^34.2.0",
|
|
74
74
|
"@atlaskit/media-picker": "^66.4.0",
|
|
75
75
|
"@atlaskit/media-state": "^1.0.0",
|
|
76
|
-
"@atlaskit/media-test-data": "^
|
|
76
|
+
"@atlaskit/media-test-data": "^2.0.0",
|
|
77
77
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
78
|
+
"@atlaskit/primitives": "^5.5.0",
|
|
78
79
|
"@atlaskit/ssr": "*",
|
|
79
80
|
"@atlaskit/visual-regression": "*",
|
|
80
81
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|