@atlaskit/media-card 78.0.8 → 78.0.9
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 +3 -4
- package/dist/cjs/card/externalImageCard.js +4 -2
- package/dist/cjs/card/fileCard.js +3 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/svgView/svgView.js +2 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +3 -4
- package/dist/es2019/card/externalImageCard.js +5 -2
- package/dist/es2019/card/fileCard.js +4 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/svgView/svgView.js +2 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +3 -4
- package/dist/esm/card/externalImageCard.js +4 -2
- package/dist/esm/card/fileCard.js +3 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/svgView/svgView.js +2 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/card.d.ts +1 -2
- package/dist/types/card/externalImageCard.d.ts +1 -3
- package/dist/types/card/fileCard.d.ts +1 -3
- package/dist/types-ts4.5/card/card.d.ts +1 -2
- package/dist/types-ts4.5/card/externalImageCard.d.ts +1 -3
- package/dist/types-ts4.5/card/fileCard.d.ts +1 -3
- package/example-helpers/index.tsx +4 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 78.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#121438](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121438)
|
|
8
|
+
[`6fc64e2707215`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6fc64e2707215) -
|
|
9
|
+
Added more accurate SVG status in DOM
|
|
10
|
+
- [#121438](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121438)
|
|
11
|
+
[`6fc64e2707215`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6fc64e2707215) -
|
|
12
|
+
Replaced Analytics event generator HOC by Analytics Hook event generator
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 78.0.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.CardBase = exports.Card = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
10
|
var _mediaClient = require("@atlaskit/media-client");
|
|
12
11
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
13
12
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -16,7 +15,7 @@ var _externalImageCard = require("./externalImageCard");
|
|
|
16
15
|
var _fileCard = require("./fileCard");
|
|
17
16
|
var _excluded = ["identifier"];
|
|
18
17
|
var packageName = "@atlaskit/media-card";
|
|
19
|
-
var packageVersion = "78.0.
|
|
18
|
+
var packageVersion = "78.0.9";
|
|
20
19
|
var CardBase = exports.CardBase = function CardBase(_ref) {
|
|
21
20
|
var identifier = _ref.identifier,
|
|
22
21
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -36,6 +35,6 @@ var Card = exports.Card = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
|
36
35
|
packageName: packageName,
|
|
37
36
|
componentName: 'mediaCard',
|
|
38
37
|
component: 'mediaCard'
|
|
39
|
-
})((0,
|
|
38
|
+
})((0, _reactIntlNext.injectIntl)(CardBase, {
|
|
40
39
|
enforceContext: false
|
|
41
|
-
}))
|
|
40
|
+
}));
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.ExternalImageCard = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
12
|
var _mediaClient = require("@atlaskit/media-client");
|
|
12
13
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
13
14
|
var _mediaViewer = require("@atlaskit/media-viewer");
|
|
@@ -52,8 +53,9 @@ var ExternalImageCard = exports.ExternalImageCard = function ExternalImageCard(_
|
|
|
52
53
|
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
53
54
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
54
55
|
_onClick = _ref.onClick,
|
|
55
|
-
_onMouseEnter = _ref.onMouseEnter
|
|
56
|
-
|
|
56
|
+
_onMouseEnter = _ref.onMouseEnter;
|
|
57
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
58
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
57
59
|
var cardDimensions = dimensions || (0, _cardDimensions.getDefaultCardDimensions)(appearance);
|
|
58
60
|
var internalOccurrenceKey = (0, _react.useMemo)(function () {
|
|
59
61
|
return (0, _generateUniqueId.generateUniqueId)();
|
|
@@ -9,6 +9,7 @@ exports.FileCard = void 0;
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _download = _interopRequireDefault(require("@atlaskit/icon/glyph/download"));
|
|
14
15
|
var _mediaClient = require("@atlaskit/media-client");
|
|
@@ -73,8 +74,9 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
73
74
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
74
75
|
onClick = _ref.onClick,
|
|
75
76
|
onMouseEnter = _ref.onMouseEnter,
|
|
76
|
-
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
77
77
|
videoControlsWrapperRef = _ref.videoControlsWrapperRef;
|
|
78
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
79
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
78
80
|
//----------------------------------------------------------------//
|
|
79
81
|
//------------ State, Refs & Initial Values ----------------------//
|
|
80
82
|
//----------------------------------------------------------------//
|
|
@@ -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 = "78.0.
|
|
93
|
+
var packageVersion = "78.0.9";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -61,6 +61,7 @@ var SvgViewBase = exports.SvgViewBase = function SvgViewBase(_ref) {
|
|
|
61
61
|
var imgRef = (0, _react2.useRef)(null);
|
|
62
62
|
var wrapperRef = (0, _react2.useRef)(null);
|
|
63
63
|
var breakpoint = (0, _useBreakpoint.useBreakpoint)(cardDimensions.width, wrapperRef);
|
|
64
|
+
var svgStatus = status === 'uploading' ? status : didSvgRender ? 'complete' : 'loading-svg';
|
|
64
65
|
var calculateDimensions = (0, _react2.useCallback)(function (targetImgElem) {
|
|
65
66
|
if (!wrapperRef.current || !targetImgElem) {
|
|
66
67
|
return;
|
|
@@ -106,7 +107,7 @@ var SvgViewBase = exports.SvgViewBase = function SvgViewBase(_ref) {
|
|
|
106
107
|
centerElements: true,
|
|
107
108
|
testId: _classnames.fileCardImageViewSelector,
|
|
108
109
|
mediaName: fileName,
|
|
109
|
-
status:
|
|
110
|
+
status: svgStatus,
|
|
110
111
|
progress: progress,
|
|
111
112
|
selected: selected,
|
|
112
113
|
source: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
@@ -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: "78.0.
|
|
122
|
+
packageName: "78.0.9",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -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 = "78.0.
|
|
18
|
+
var packageVersion = "78.0.9";
|
|
19
19
|
var concurrentExperience;
|
|
20
20
|
var getExperience = function getExperience(id) {
|
|
21
21
|
if (!concurrentExperience) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
2
|
import { isFileIdentifier } from '@atlaskit/media-client';
|
|
4
3
|
import { withMediaAnalyticsContext } from '@atlaskit/media-common';
|
|
5
4
|
import React from 'react';
|
|
@@ -7,7 +6,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
7
6
|
import { ExternalImageCard } from './externalImageCard';
|
|
8
7
|
import { FileCard } from './fileCard';
|
|
9
8
|
const packageName = "@atlaskit/media-card";
|
|
10
|
-
const packageVersion = "78.0.
|
|
9
|
+
const packageVersion = "78.0.9";
|
|
11
10
|
export const CardBase = ({
|
|
12
11
|
identifier,
|
|
13
12
|
...otherProps
|
|
@@ -28,6 +27,6 @@ export const Card = withMediaAnalyticsContext({
|
|
|
28
27
|
packageName,
|
|
29
28
|
componentName: 'mediaCard',
|
|
30
29
|
component: 'mediaCard'
|
|
31
|
-
})(
|
|
30
|
+
})(injectIntl(CardBase, {
|
|
32
31
|
enforceContext: false
|
|
33
|
-
}))
|
|
32
|
+
}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
1
2
|
import { globalMediaEventEmitter } from '@atlaskit/media-client';
|
|
2
3
|
import { getRandomHex } from '@atlaskit/media-common';
|
|
3
4
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
@@ -35,9 +36,11 @@ export const ExternalImageCard = ({
|
|
|
35
36
|
shouldHideTooltip,
|
|
36
37
|
mediaViewerItems,
|
|
37
38
|
onClick,
|
|
38
|
-
onMouseEnter
|
|
39
|
-
createAnalyticsEvent
|
|
39
|
+
onMouseEnter
|
|
40
40
|
}) => {
|
|
41
|
+
const {
|
|
42
|
+
createAnalyticsEvent
|
|
43
|
+
} = useAnalyticsEvents();
|
|
41
44
|
const cardDimensions = dimensions || getDefaultCardDimensions(appearance);
|
|
42
45
|
const internalOccurrenceKey = useMemo(() => generateUniqueId(), []);
|
|
43
46
|
const timeElapsedTillCommenced = useMemo(() => performanceNow(), []);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
1
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
3
4
|
import { globalMediaEventEmitter, RECENTS_COLLECTION, imageResizeModeToFileImageMode, isProcessedFileState } from '@atlaskit/media-client';
|
|
@@ -55,9 +56,11 @@ export const FileCard = ({
|
|
|
55
56
|
mediaViewerItems,
|
|
56
57
|
onClick,
|
|
57
58
|
onMouseEnter,
|
|
58
|
-
createAnalyticsEvent,
|
|
59
59
|
videoControlsWrapperRef
|
|
60
60
|
}) => {
|
|
61
|
+
const {
|
|
62
|
+
createAnalyticsEvent
|
|
63
|
+
} = useAnalyticsEvents();
|
|
61
64
|
//----------------------------------------------------------------//
|
|
62
65
|
//------------ State, Refs & Initial Values ----------------------//
|
|
63
66
|
//----------------------------------------------------------------//
|
|
@@ -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 = "78.0.
|
|
69
|
+
const packageVersion = "78.0.9";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -40,6 +40,7 @@ export const SvgViewBase = ({
|
|
|
40
40
|
const imgRef = useRef(null);
|
|
41
41
|
const wrapperRef = useRef(null);
|
|
42
42
|
const breakpoint = useBreakpoint(cardDimensions.width, wrapperRef);
|
|
43
|
+
const svgStatus = status === 'uploading' ? status : didSvgRender ? 'complete' : 'loading-svg';
|
|
43
44
|
const calculateDimensions = useCallback(targetImgElem => {
|
|
44
45
|
if (!wrapperRef.current || !targetImgElem) {
|
|
45
46
|
return;
|
|
@@ -85,7 +86,7 @@ export const SvgViewBase = ({
|
|
|
85
86
|
centerElements: true,
|
|
86
87
|
testId: fileCardImageViewSelector,
|
|
87
88
|
mediaName: fileName,
|
|
88
|
-
status:
|
|
89
|
+
status: svgStatus,
|
|
89
90
|
progress: progress,
|
|
90
91
|
selected: selected,
|
|
91
92
|
source: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
@@ -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: "78.0.
|
|
40
|
+
packageName: "78.0.9",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -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 = "78.0.
|
|
8
|
+
const packageVersion = "78.0.9";
|
|
9
9
|
let concurrentExperience;
|
|
10
10
|
const getExperience = id => {
|
|
11
11
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["identifier"];
|
|
4
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
4
|
import { isFileIdentifier } from '@atlaskit/media-client';
|
|
6
5
|
import { withMediaAnalyticsContext } from '@atlaskit/media-common';
|
|
7
6
|
import React from 'react';
|
|
@@ -9,7 +8,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
9
8
|
import { ExternalImageCard } from './externalImageCard';
|
|
10
9
|
import { FileCard } from './fileCard';
|
|
11
10
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "78.0.
|
|
11
|
+
var packageVersion = "78.0.9";
|
|
13
12
|
export var CardBase = function CardBase(_ref) {
|
|
14
13
|
var identifier = _ref.identifier,
|
|
15
14
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -29,6 +28,6 @@ export var Card = withMediaAnalyticsContext({
|
|
|
29
28
|
packageName: packageName,
|
|
30
29
|
componentName: 'mediaCard',
|
|
31
30
|
component: 'mediaCard'
|
|
32
|
-
})(
|
|
31
|
+
})(injectIntl(CardBase, {
|
|
33
32
|
enforceContext: false
|
|
34
|
-
}))
|
|
33
|
+
}));
|
|
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
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; }
|
|
4
4
|
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) { _defineProperty(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; }
|
|
5
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
6
|
import { globalMediaEventEmitter } from '@atlaskit/media-client';
|
|
6
7
|
import { getRandomHex } from '@atlaskit/media-common';
|
|
7
8
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
@@ -42,8 +43,9 @@ export var ExternalImageCard = function ExternalImageCard(_ref) {
|
|
|
42
43
|
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
43
44
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
44
45
|
_onClick = _ref.onClick,
|
|
45
|
-
_onMouseEnter = _ref.onMouseEnter
|
|
46
|
-
|
|
46
|
+
_onMouseEnter = _ref.onMouseEnter;
|
|
47
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
48
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
47
49
|
var cardDimensions = dimensions || getDefaultCardDimensions(appearance);
|
|
48
50
|
var internalOccurrenceKey = useMemo(function () {
|
|
49
51
|
return generateUniqueId();
|
|
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
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; }
|
|
5
5
|
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) { _defineProperty(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; }
|
|
6
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
8
9
|
import { globalMediaEventEmitter, RECENTS_COLLECTION, imageResizeModeToFileImageMode, isProcessedFileState } from '@atlaskit/media-client';
|
|
@@ -64,8 +65,9 @@ export var FileCard = function FileCard(_ref) {
|
|
|
64
65
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
65
66
|
onClick = _ref.onClick,
|
|
66
67
|
onMouseEnter = _ref.onMouseEnter,
|
|
67
|
-
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
68
68
|
videoControlsWrapperRef = _ref.videoControlsWrapperRef;
|
|
69
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
70
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
69
71
|
//----------------------------------------------------------------//
|
|
70
72
|
//------------ State, Refs & Initial Values ----------------------//
|
|
71
73
|
//----------------------------------------------------------------//
|
|
@@ -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 = "78.0.
|
|
86
|
+
var packageVersion = "78.0.9";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -53,6 +53,7 @@ export var SvgViewBase = function SvgViewBase(_ref) {
|
|
|
53
53
|
var imgRef = useRef(null);
|
|
54
54
|
var wrapperRef = useRef(null);
|
|
55
55
|
var breakpoint = useBreakpoint(cardDimensions.width, wrapperRef);
|
|
56
|
+
var svgStatus = status === 'uploading' ? status : didSvgRender ? 'complete' : 'loading-svg';
|
|
56
57
|
var calculateDimensions = useCallback(function (targetImgElem) {
|
|
57
58
|
if (!wrapperRef.current || !targetImgElem) {
|
|
58
59
|
return;
|
|
@@ -98,7 +99,7 @@ export var SvgViewBase = function SvgViewBase(_ref) {
|
|
|
98
99
|
centerElements: true,
|
|
99
100
|
testId: fileCardImageViewSelector,
|
|
100
101
|
mediaName: fileName,
|
|
101
|
-
status:
|
|
102
|
+
status: svgStatus,
|
|
102
103
|
progress: progress,
|
|
103
104
|
selected: selected,
|
|
104
105
|
source: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.source
|
|
@@ -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: "78.0.
|
|
106
|
+
packageName: "78.0.9",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -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 = "78.0.
|
|
11
|
+
var packageVersion = "78.0.9";
|
|
12
12
|
var concurrentExperience;
|
|
13
13
|
var getExperience = function getExperience(id) {
|
|
14
14
|
if (!concurrentExperience) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
3
|
import { type CardProps } from '../types';
|
|
5
|
-
export type CardBaseProps = CardProps &
|
|
4
|
+
export type CardBaseProps = CardProps & Partial<WrappedComponentProps>;
|
|
6
5
|
export declare const CardBase: ({ identifier, ...otherProps }: CardBaseProps & WrappedComponentProps) => JSX.Element;
|
|
7
6
|
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
2
|
import { type ExternalImageIdentifier, type Identifier, type MediaClient } from '@atlaskit/media-client';
|
|
4
3
|
import { type CardEventProps, type SharedCardProps } from '../types';
|
|
5
4
|
export interface ExternalImageCardProps extends SharedCardProps, CardEventProps {
|
|
@@ -10,5 +9,4 @@ export interface ExternalImageCardProps extends SharedCardProps, CardEventProps
|
|
|
10
9
|
readonly contextId?: string;
|
|
11
10
|
readonly shouldHideTooltip?: boolean;
|
|
12
11
|
}
|
|
13
|
-
export
|
|
14
|
-
export declare const ExternalImageCard: ({ mediaClient, appearance, resizeMode, disableOverlay, featureFlags, identifier, dimensions, contextId, alt, actions, shouldOpenMediaViewer, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, createAnalyticsEvent, }: ExternalImageCardBaseProps) => JSX.Element;
|
|
12
|
+
export declare const ExternalImageCard: ({ mediaClient, appearance, resizeMode, disableOverlay, featureFlags, identifier, dimensions, contextId, alt, actions, shouldOpenMediaViewer, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, }: ExternalImageCardProps) => JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
2
|
import { type FileIdentifier, type Identifier, type ImageResizeMode } from '@atlaskit/media-client';
|
|
4
3
|
import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
|
|
5
4
|
import { type CardAppearance, type CardDimensions, type CardEventProps, type TitleBoxIcon } from '../types';
|
|
@@ -49,5 +48,4 @@ export interface FileCardProps extends CardEventProps {
|
|
|
49
48
|
/** Disable tooltip for the card */
|
|
50
49
|
readonly shouldHideTooltip?: boolean;
|
|
51
50
|
}
|
|
52
|
-
export
|
|
53
|
-
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, createAnalyticsEvent, videoControlsWrapperRef, }: FileCardBaseProps) => JSX.Element;
|
|
51
|
+
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, }: FileCardProps) => JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
3
|
import { type CardProps } from '../types';
|
|
5
|
-
export type CardBaseProps = CardProps &
|
|
4
|
+
export type CardBaseProps = CardProps & Partial<WrappedComponentProps>;
|
|
6
5
|
export declare const CardBase: ({ identifier, ...otherProps }: CardBaseProps & WrappedComponentProps) => JSX.Element;
|
|
7
6
|
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
2
|
import { type ExternalImageIdentifier, type Identifier, type MediaClient } from '@atlaskit/media-client';
|
|
4
3
|
import { type CardEventProps, type SharedCardProps } from '../types';
|
|
5
4
|
export interface ExternalImageCardProps extends SharedCardProps, CardEventProps {
|
|
@@ -10,5 +9,4 @@ export interface ExternalImageCardProps extends SharedCardProps, CardEventProps
|
|
|
10
9
|
readonly contextId?: string;
|
|
11
10
|
readonly shouldHideTooltip?: boolean;
|
|
12
11
|
}
|
|
13
|
-
export
|
|
14
|
-
export declare const ExternalImageCard: ({ mediaClient, appearance, resizeMode, disableOverlay, featureFlags, identifier, dimensions, contextId, alt, actions, shouldOpenMediaViewer, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, createAnalyticsEvent, }: ExternalImageCardBaseProps) => JSX.Element;
|
|
12
|
+
export declare const ExternalImageCard: ({ mediaClient, appearance, resizeMode, disableOverlay, featureFlags, identifier, dimensions, contextId, alt, actions, shouldOpenMediaViewer, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, }: ExternalImageCardProps) => JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
2
|
import { type FileIdentifier, type Identifier, type ImageResizeMode } from '@atlaskit/media-client';
|
|
4
3
|
import { type MediaFeatureFlags, type NumericalCardDimensions, type SSR } from '@atlaskit/media-common';
|
|
5
4
|
import { type CardAppearance, type CardDimensions, type CardEventProps, type TitleBoxIcon } from '../types';
|
|
@@ -49,5 +48,4 @@ export interface FileCardProps extends CardEventProps {
|
|
|
49
48
|
/** Disable tooltip for the card */
|
|
50
49
|
readonly shouldHideTooltip?: boolean;
|
|
51
50
|
}
|
|
52
|
-
export
|
|
53
|
-
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, createAnalyticsEvent, videoControlsWrapperRef, }: FileCardBaseProps) => JSX.Element;
|
|
51
|
+
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, }: FileCardProps) => JSX.Element;
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
import React, { type PropsWithChildren } from 'react';
|
|
4
4
|
import { type FileItem, type Identifier } from '@atlaskit/media-client';
|
|
5
5
|
import {
|
|
6
|
-
createPollingMaxAttemptsError,
|
|
7
|
-
createRateLimitedError,
|
|
8
6
|
createStorybookMediaClientConfig,
|
|
9
7
|
enableMediaUfoLogger,
|
|
10
8
|
FeatureFlagsWrapper,
|
|
11
9
|
} from '@atlaskit/media-test-helpers';
|
|
10
|
+
import {
|
|
11
|
+
createPollingMaxAttemptsError,
|
|
12
|
+
createRateLimitedError,
|
|
13
|
+
} from '@atlaskit/media-client/test-helpers';
|
|
12
14
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
13
15
|
import FabricAnalyticsListeners, { type AnalyticsWebClient } from '@atlaskit/analytics-listeners';
|
|
14
16
|
import { payloadPublisher } from '@atlassian/ufo';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "78.0.
|
|
3
|
+
"version": "78.0.9",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/primitives": "^11.0.0",
|
|
52
52
|
"@atlaskit/spinner": "^16.2.0",
|
|
53
53
|
"@atlaskit/theme": "^12.11.0",
|
|
54
|
-
"@atlaskit/tokens": "^1.
|
|
54
|
+
"@atlaskit/tokens": "^1.56.0",
|
|
55
55
|
"@atlaskit/tooltip": "^18.5.0",
|
|
56
56
|
"@atlaskit/ufo": "^0.2.0",
|
|
57
57
|
"@atlaskit/ufo-interaction-ignore": "^1.1.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@atlaskit/media-picker": "^66.4.0",
|
|
80
80
|
"@atlaskit/media-state": "^1.1.0",
|
|
81
81
|
"@atlaskit/media-test-data": "^2.3.0",
|
|
82
|
-
"@atlaskit/media-test-helpers": "^
|
|
82
|
+
"@atlaskit/media-test-helpers": "^34.0.0",
|
|
83
83
|
"@atlaskit/radio": "^6.4.0",
|
|
84
84
|
"@atlaskit/range": "^7.3.0",
|
|
85
85
|
"@atlaskit/ssr": "*",
|