@atlaskit/media-card 78.0.7 → 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 +20 -0
- package/dist/cjs/card/card.js +3 -4
- package/dist/cjs/card/externalImageCard.js +4 -2
- package/dist/cjs/card/fileCard.js +5 -3
- 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/types.js +16 -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 +5 -2
- 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/types.js +10 -0
- 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 +4 -2
- 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/types.js +14 -0
- 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/types.d.ts +4 -0
- 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/dist/types-ts4.5/types.d.ts +4 -0
- package/example-helpers/index.tsx +4 -2
- package/package.json +3 -3
- package/dist/cjs/card/cardState.js +0 -37
- package/dist/cjs/card/getCardPreview/cache.js +0 -39
- package/dist/cjs/card/getCardPreview/filePreviewStatus.js +0 -45
- package/dist/cjs/card/getCardPreview/helpers.js +0 -165
- package/dist/cjs/card/getCardPreview/index.js +0 -245
- package/dist/es2019/card/cardState.js +0 -30
- package/dist/es2019/card/getCardPreview/cache.js +0 -33
- package/dist/es2019/card/getCardPreview/filePreviewStatus.js +0 -43
- package/dist/es2019/card/getCardPreview/helpers.js +0 -74
- package/dist/es2019/card/getCardPreview/index.js +0 -170
- package/dist/esm/card/cardState.js +0 -32
- package/dist/esm/card/getCardPreview/cache.js +0 -35
- package/dist/esm/card/getCardPreview/filePreviewStatus.js +0 -40
- package/dist/esm/card/getCardPreview/helpers.js +0 -158
- package/dist/esm/card/getCardPreview/index.js +0 -213
- package/dist/types/card/cardState.d.ts +0 -9
- package/dist/types/card/getCardPreview/cache.d.ts +0 -21
- package/dist/types/card/getCardPreview/filePreviewStatus.d.ts +0 -4
- package/dist/types/card/getCardPreview/helpers.d.ts +0 -10
- package/dist/types/card/getCardPreview/index.d.ts +0 -53
- package/dist/types-ts4.5/card/cardState.d.ts +0 -9
- package/dist/types-ts4.5/card/getCardPreview/cache.d.ts +0 -21
- package/dist/types-ts4.5/card/getCardPreview/filePreviewStatus.d.ts +0 -4
- package/dist/types-ts4.5/card/getCardPreview/helpers.d.ts +0 -10
- package/dist/types-ts4.5/card/getCardPreview/index.d.ts +0 -53
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
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
|
+
|
|
15
|
+
## 78.0.8
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#120561](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120561)
|
|
20
|
+
[`5bcb6ac107e75`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5bcb6ac107e75) -
|
|
21
|
+
Removed unused code in Media Card
|
|
22
|
+
|
|
3
23
|
## 78.0.7
|
|
4
24
|
|
|
5
25
|
### 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");
|
|
@@ -18,6 +19,7 @@ var _mediaViewer = require("@atlaskit/media-viewer");
|
|
|
18
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
20
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
20
21
|
var _errors = require("../errors");
|
|
22
|
+
var _types = require("../types");
|
|
21
23
|
var _document = _interopRequireDefault(require("../utils/document"));
|
|
22
24
|
var _generateUniqueId = require("../utils/generateUniqueId");
|
|
23
25
|
var _getDataURIDimension = require("../utils/getDataURIDimension");
|
|
@@ -29,7 +31,6 @@ var _usePrevious = require("../utils/usePrevious");
|
|
|
29
31
|
var _viewportDetector = require("../utils/viewportDetector");
|
|
30
32
|
var _cardDimensions = require("../utils/cardDimensions");
|
|
31
33
|
var _cardAnalytics = require("./cardAnalytics");
|
|
32
|
-
var _getCardPreview = require("./getCardPreview");
|
|
33
34
|
var _cardView = require("./cardView");
|
|
34
35
|
var _cardviews = require("./cardviews");
|
|
35
36
|
var _inlinePlayerLazy = require("./inlinePlayerLazy");
|
|
@@ -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
|
//----------------------------------------------------------------//
|
|
@@ -571,7 +573,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
571
573
|
// Side note: We should not lazy load if the cardPreview is available from local cache,
|
|
572
574
|
// in order to avoid flickers during re-mount of the component
|
|
573
575
|
// CXP-2723 TODO: Create test cases for the above scenarios
|
|
574
|
-
var nativeLazyLoad = isLazyWithOverride && !isCardVisible && preview && (0,
|
|
576
|
+
var nativeLazyLoad = isLazyWithOverride && !isCardVisible && preview && (0, _types.isSSRPreview)(preview);
|
|
575
577
|
// Force Media Image to always display img for SSR
|
|
576
578
|
var forceSyncDisplay = !!ssr;
|
|
577
579
|
var card = /*#__PURE__*/_react.default.createElement(LoadedCardView, {
|
|
@@ -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
|
};
|
package/dist/cjs/types.js
CHANGED
|
@@ -3,11 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.MediaCardCursor = void 0;
|
|
6
|
+
exports.isSSRServerPreview = exports.isSSRPreview = exports.isSSRDataPreview = exports.isSSRClientPreview = exports.MediaCardCursor = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Entry Point: @atlaskit/media-card/types
|
|
9
9
|
* tsconfig.entry-points.json
|
|
10
10
|
*/
|
|
11
|
+
|
|
12
|
+
var isSSRPreview = exports.isSSRPreview = function isSSRPreview(preview) {
|
|
13
|
+
return isSSRClientPreview(preview) || isSSRServerPreview(preview) || isSSRDataPreview(preview);
|
|
14
|
+
};
|
|
15
|
+
var isSSRServerPreview = exports.isSSRServerPreview = function isSSRServerPreview(preview) {
|
|
16
|
+
var ssrClientSources = ['ssr-server', 'cache-ssr-server'];
|
|
17
|
+
return ssrClientSources.includes(preview.source);
|
|
18
|
+
};
|
|
19
|
+
var isSSRClientPreview = exports.isSSRClientPreview = function isSSRClientPreview(preview) {
|
|
20
|
+
var ssrClientSources = ['ssr-client', 'cache-ssr-client'];
|
|
21
|
+
return ssrClientSources.includes(preview.source);
|
|
22
|
+
};
|
|
23
|
+
var isSSRDataPreview = exports.isSSRDataPreview = function isSSRDataPreview(preview) {
|
|
24
|
+
return preview.source === 'ssr-data';
|
|
25
|
+
};
|
|
11
26
|
var MediaCardCursor = exports.MediaCardCursor = /*#__PURE__*/function (MediaCardCursor) {
|
|
12
27
|
MediaCardCursor["Action"] = "pointer";
|
|
13
28
|
MediaCardCursor["NotReady"] = "wait";
|
|
@@ -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';
|
|
@@ -7,6 +8,7 @@ import { MediaViewer } from '@atlaskit/media-viewer';
|
|
|
7
8
|
import React, { Suspense, useEffect, useMemo, useRef, useState } from 'react';
|
|
8
9
|
import ReactDOM from 'react-dom';
|
|
9
10
|
import { MediaCardError } from '../errors';
|
|
11
|
+
import { isSSRPreview } from '../types';
|
|
10
12
|
import getDocument from '../utils/document';
|
|
11
13
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
12
14
|
import { resolveCardPreviewDimensions } from '../utils/getDataURIDimension';
|
|
@@ -18,7 +20,6 @@ import { usePrevious } from '../utils/usePrevious';
|
|
|
18
20
|
import { ViewportDetector } from '../utils/viewportDetector';
|
|
19
21
|
import { getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
20
22
|
import { fireCommencedEvent, fireCopiedEvent, fireNonCriticalErrorEvent, fireOperationalEvent, fireScreenEvent } from './cardAnalytics';
|
|
21
|
-
import { isSSRPreview } from './getCardPreview';
|
|
22
23
|
import { CardView } from './cardView';
|
|
23
24
|
import { CardViews } from './cardviews';
|
|
24
25
|
import { InlinePlayerLazy } from './inlinePlayerLazy';
|
|
@@ -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
|
};
|
package/dist/es2019/types.js
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
* tsconfig.entry-points.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
export const isSSRPreview = preview => isSSRClientPreview(preview) || isSSRServerPreview(preview) || isSSRDataPreview(preview);
|
|
7
|
+
export const isSSRServerPreview = preview => {
|
|
8
|
+
const ssrClientSources = ['ssr-server', 'cache-ssr-server'];
|
|
9
|
+
return ssrClientSources.includes(preview.source);
|
|
10
|
+
};
|
|
11
|
+
export const isSSRClientPreview = preview => {
|
|
12
|
+
const ssrClientSources = ['ssr-client', 'cache-ssr-client'];
|
|
13
|
+
return ssrClientSources.includes(preview.source);
|
|
14
|
+
};
|
|
15
|
+
export const isSSRDataPreview = preview => preview.source === 'ssr-data';
|
|
6
16
|
export let MediaCardCursor = /*#__PURE__*/function (MediaCardCursor) {
|
|
7
17
|
MediaCardCursor["Action"] = "pointer";
|
|
8
18
|
MediaCardCursor["NotReady"] = "wait";
|
|
@@ -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';
|
|
@@ -12,6 +13,7 @@ import { MediaViewer } from '@atlaskit/media-viewer';
|
|
|
12
13
|
import React, { Suspense, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
14
|
import ReactDOM from 'react-dom';
|
|
14
15
|
import { MediaCardError } from '../errors';
|
|
16
|
+
import { isSSRPreview } from '../types';
|
|
15
17
|
import getDocument from '../utils/document';
|
|
16
18
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
17
19
|
import { resolveCardPreviewDimensions } from '../utils/getDataURIDimension';
|
|
@@ -23,7 +25,6 @@ import { usePrevious } from '../utils/usePrevious';
|
|
|
23
25
|
import { ViewportDetector } from '../utils/viewportDetector';
|
|
24
26
|
import { getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
25
27
|
import { fireCommencedEvent, fireCopiedEvent, fireNonCriticalErrorEvent, fireOperationalEvent, fireScreenEvent } from './cardAnalytics';
|
|
26
|
-
import { isSSRPreview } from './getCardPreview';
|
|
27
28
|
import { CardView } from './cardView';
|
|
28
29
|
import { CardViews } from './cardviews';
|
|
29
30
|
import { InlinePlayerLazy } from './inlinePlayerLazy';
|
|
@@ -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
|
};
|
package/dist/esm/types.js
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
* tsconfig.entry-points.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
export var isSSRPreview = function isSSRPreview(preview) {
|
|
7
|
+
return isSSRClientPreview(preview) || isSSRServerPreview(preview) || isSSRDataPreview(preview);
|
|
8
|
+
};
|
|
9
|
+
export var isSSRServerPreview = function isSSRServerPreview(preview) {
|
|
10
|
+
var ssrClientSources = ['ssr-server', 'cache-ssr-server'];
|
|
11
|
+
return ssrClientSources.includes(preview.source);
|
|
12
|
+
};
|
|
13
|
+
export var isSSRClientPreview = function isSSRClientPreview(preview) {
|
|
14
|
+
var ssrClientSources = ['ssr-client', 'cache-ssr-client'];
|
|
15
|
+
return ssrClientSources.includes(preview.source);
|
|
16
|
+
};
|
|
17
|
+
export var isSSRDataPreview = function isSSRDataPreview(preview) {
|
|
18
|
+
return preview.source === 'ssr-data';
|
|
19
|
+
};
|
|
6
20
|
export var MediaCardCursor = /*#__PURE__*/function (MediaCardCursor) {
|
|
7
21
|
MediaCardCursor["Action"] = "pointer";
|
|
8
22
|
MediaCardCursor["NotReady"] = "wait";
|
|
@@ -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;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export interface CardPreview {
|
|
|
28
28
|
dimensions?: CardDimensions;
|
|
29
29
|
source: CardPreviewSource;
|
|
30
30
|
}
|
|
31
|
+
export declare const isSSRPreview: (preview: CardPreview) => boolean;
|
|
32
|
+
export declare const isSSRServerPreview: (preview: CardPreview) => boolean;
|
|
33
|
+
export declare const isSSRClientPreview: (preview: CardPreview) => boolean;
|
|
34
|
+
export declare const isSSRDataPreview: (preview: CardPreview) => boolean;
|
|
31
35
|
export declare enum MediaCardCursor {
|
|
32
36
|
Action = "pointer",
|
|
33
37
|
NotReady = "wait"
|
|
@@ -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;
|
|
@@ -28,6 +28,10 @@ export interface CardPreview {
|
|
|
28
28
|
dimensions?: CardDimensions;
|
|
29
29
|
source: CardPreviewSource;
|
|
30
30
|
}
|
|
31
|
+
export declare const isSSRPreview: (preview: CardPreview) => boolean;
|
|
32
|
+
export declare const isSSRServerPreview: (preview: CardPreview) => boolean;
|
|
33
|
+
export declare const isSSRClientPreview: (preview: CardPreview) => boolean;
|
|
34
|
+
export declare const isSSRDataPreview: (preview: CardPreview) => boolean;
|
|
31
35
|
export declare enum MediaCardCursor {
|
|
32
36
|
Action = "pointer",
|
|
33
37
|
NotReady = "wait"
|
|
@@ -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';
|