@atlaskit/media-card 77.4.5 → 77.4.7
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 +13 -0
- package/dist/cjs/card/card.js +4 -7
- package/dist/cjs/card/getCardPreview/filePreviewStatus.js +2 -0
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/fileCard.js +117 -520
- package/dist/cjs/card/v2/useFilePreview.js +585 -0
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/globalScope/globalScope.js +4 -10
- package/dist/cjs/utils/globalScope/index.js +2 -2
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +5 -8
- package/dist/es2019/card/getCardPreview/filePreviewStatus.js +2 -0
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/fileCard.js +102 -435
- package/dist/es2019/card/v2/useFilePreview.js +493 -0
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/globalScope/globalScope.js +1 -7
- package/dist/es2019/utils/globalScope/index.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +5 -8
- package/dist/esm/card/getCardPreview/filePreviewStatus.js +2 -0
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/fileCard.js +122 -525
- package/dist/esm/card/v2/useFilePreview.js +578 -0
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/globalScope/globalScope.js +3 -8
- package/dist/esm/utils/globalScope/index.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/v2/useFilePreview.d.ts +37 -0
- package/dist/types/utils/globalScope/globalScope.d.ts +1 -7
- package/dist/types/utils/globalScope/index.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/useFilePreview.d.ts +37 -0
- package/dist/types-ts4.5/utils/globalScope/globalScope.d.ts +1 -7
- package/dist/types-ts4.5/utils/globalScope/index.d.ts +1 -1
- package/package.json +5 -4
- package/tmp/api-report-tmp.d.ts +0 -345
package/dist/es2019/card/card.js
CHANGED
|
@@ -20,14 +20,14 @@ import { getFileAttributes, extractErrorInfo } from '../utils/analytics';
|
|
|
20
20
|
import { isLocalPreviewError, MediaCardError, ensureMediaCardError, ImageLoadError } from '../errors';
|
|
21
21
|
import { fireOperationalEvent, fireCommencedEvent, fireCopiedEvent, fireScreenEvent, fireNonCriticalErrorEvent } from './cardAnalytics';
|
|
22
22
|
import getDocument from '../utils/document';
|
|
23
|
-
import {
|
|
23
|
+
import { generateScriptProps, getSSRData } from '../utils/globalScope';
|
|
24
24
|
import { getCardStateFromFileState, createStateUpdater } from './cardState';
|
|
25
25
|
import { isBigger } from '../utils/dimensionComparer';
|
|
26
26
|
import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
27
27
|
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
const packageName = "@atlaskit/media-card";
|
|
30
|
-
const packageVersion = "77.4.
|
|
30
|
+
const packageVersion = "77.4.7";
|
|
31
31
|
export class CardBase extends Component {
|
|
32
32
|
constructor(props) {
|
|
33
33
|
super(props);
|
|
@@ -573,12 +573,9 @@ export class CardBase extends Component {
|
|
|
573
573
|
dataURI
|
|
574
574
|
} = {}
|
|
575
575
|
} = this.state;
|
|
576
|
-
return isFileIdentifier(identifier) &&
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
dimensions: this.requestedDimensions,
|
|
580
|
-
error: ((_this$ssrReliability$ = this.ssrReliability.server) === null || _this$ssrReliability$ === void 0 ? void 0 : _this$ssrReliability$.status) === 'fail' ? this.ssrReliability.server : undefined
|
|
581
|
-
});
|
|
576
|
+
return isFileIdentifier(identifier) &&
|
|
577
|
+
// Print the SSR result to be used during hydration
|
|
578
|
+
ssr === 'server' && /*#__PURE__*/React.createElement("script", generateScriptProps(identifier, dataURI, this.requestedDimensions, ((_this$ssrReliability$ = this.ssrReliability.server) === null || _this$ssrReliability$ === void 0 ? void 0 : _this$ssrReliability$.status) === 'fail' ? this.ssrReliability.server : undefined));
|
|
582
579
|
});
|
|
583
580
|
_defineProperty(this, "onCardInViewport", () => {
|
|
584
581
|
this.setState({
|
|
@@ -28,6 +28,8 @@ export const extractFilePreviewStatus = (fileState, isBannedLocalPreview) => {
|
|
|
28
28
|
isSupportedByBrowser
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
// CXP-2723 TODO: Review this in relation to removing status from the hook
|
|
31
33
|
export const isPreviewableStatus = (cardStatus, {
|
|
32
34
|
isPreviewable,
|
|
33
35
|
hasPreview,
|
|
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
|
|
|
66
66
|
}
|
|
67
67
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
68
68
|
const packageName = "@atlaskit/media-card";
|
|
69
|
-
const packageVersion = "77.4.
|
|
69
|
+
const packageVersion = "77.4.7";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -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.4.
|
|
10
|
+
const packageVersion = "77.4.7";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|