@atlaskit/media-card 77.1.1 → 77.1.2
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 +8 -0
- package/dist/cjs/card/card.js +17 -13
- package/dist/cjs/card/cardState.js +1 -1
- package/dist/cjs/card/getCardPreview/index.js +2 -5
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +20 -16
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +18 -14
- package/dist/es2019/card/card.js +18 -16
- package/dist/es2019/card/cardState.js +1 -1
- package/dist/es2019/card/getCardPreview/index.js +0 -5
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +21 -19
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +18 -9
- package/dist/esm/card/card.js +18 -14
- package/dist/esm/card/cardState.js +1 -1
- package/dist/esm/card/getCardPreview/index.js +2 -5
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/v2/cardV2.js +21 -17
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +17 -13
- package/dist/types/card/card.d.ts +1 -0
- package/dist/types/card/cardState.d.ts +1 -2
- package/dist/types/card/getCardPreview/index.d.ts +4 -10
- package/dist/types/card/v2/cardV2.d.ts +3 -2
- package/dist/types/utils/ufoExperiences.d.ts +7 -0
- package/package.json +2 -2
- package/dist/types-ts4.5/card/actions.d.ts +0 -9
- package/dist/types-ts4.5/card/card.d.ts +0 -63
- package/dist/types-ts4.5/card/cardAnalytics.d.ts +0 -10
- package/dist/types-ts4.5/card/cardConstants.d.ts +0 -1
- package/dist/types-ts4.5/card/cardLoader.d.ts +0 -6
- package/dist/types-ts4.5/card/cardState.d.ts +0 -10
- package/dist/types-ts4.5/card/cardSwitcher.d.ts +0 -4
- package/dist/types-ts4.5/card/cardView.d.ts +0 -78
- package/dist/types-ts4.5/card/classnames.d.ts +0 -2
- 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 -59
- package/dist/types-ts4.5/card/getCardStatus.d.ts +0 -4
- package/dist/types-ts4.5/card/index.d.ts +0 -1
- package/dist/types-ts4.5/card/inlinePlayer.d.ts +0 -52
- package/dist/types-ts4.5/card/inlinePlayerLazy.d.ts +0 -2
- package/dist/types-ts4.5/card/inlinePlayerWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/inlinePlayerWrapperStyles.d.ts +0 -6
- package/dist/types-ts4.5/card/media-card-analytics-error-boundary.d.ts +0 -14
- package/dist/types-ts4.5/card/types.d.ts +0 -13
- package/dist/types-ts4.5/card/ui/actionsBar/actionsBar.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/actionsBar/actionsBarWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionButton.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionIconButton.d.ts +0 -12
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.d.ts +0 -14
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsView.d.ts +0 -16
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/index.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/actionsBar/cardActions/styles.d.ts +0 -18
- package/dist/types-ts4.5/card/ui/actionsBar/styles.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/actionsBar/types.d.ts +0 -10
- package/dist/types-ts4.5/card/ui/blanket/blanket.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/blanket/styles.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/common.d.ts +0 -23
- package/dist/types-ts4.5/card/ui/iconMessage/iconMessageWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/iconMessage/index.d.ts +0 -8
- package/dist/types-ts4.5/card/ui/iconMessage/styles.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/iconMessage/types.d.ts +0 -19
- package/dist/types-ts4.5/card/ui/iconWrapper/iconWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/iconWrapper/styles.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/iconWrapper/types.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/imageRenderer/imageRenderer.d.ts +0 -15
- package/dist/types-ts4.5/card/ui/imageRenderer/resizeModeToMediaImageProps.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/playButton/playButton.d.ts +0 -2
- package/dist/types-ts4.5/card/ui/playButton/playButtonBackground.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/playButton/playButtonWrapper.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/playButton/styles.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/progressBar/progressBar.d.ts +0 -10
- package/dist/types-ts4.5/card/ui/progressBar/styledBar.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/progressBar/styles.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/progressBar/types.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/styles.d.ts +0 -13
- package/dist/types-ts4.5/card/ui/tickBox/styles.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/tickBox/tickBox.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/tickBox/tickBoxWrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/tickBox/types.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/titleBox/failedTitleBox.d.ts +0 -3
- package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +0 -15
- package/dist/types-ts4.5/card/ui/titleBox/titleBox.d.ts +0 -4
- package/dist/types-ts4.5/card/ui/titleBox/titleBoxComponents.d.ts +0 -8
- package/dist/types-ts4.5/card/ui/titleBox/types.d.ts +0 -34
- package/dist/types-ts4.5/card/ui/unhandledErrorCard/index.d.ts +0 -7
- package/dist/types-ts4.5/card/ui/unhandledErrorCard/types.d.ts +0 -6
- package/dist/types-ts4.5/card/ui/wrapper/index.d.ts +0 -1
- package/dist/types-ts4.5/card/ui/wrapper/styles.d.ts +0 -5
- package/dist/types-ts4.5/card/ui/wrapper/types.d.ts +0 -25
- package/dist/types-ts4.5/card/ui/wrapper/wrapper.d.ts +0 -4
- package/dist/types-ts4.5/card/v2/cardV2.d.ts +0 -62
- package/dist/types-ts4.5/card/v2/cardV2Loader.d.ts +0 -4
- package/dist/types-ts4.5/card/v2/cardViewV2.d.ts +0 -44
- package/dist/types-ts4.5/classnames.d.ts +0 -5
- package/dist/types-ts4.5/errors.d.ts +0 -53
- package/dist/types-ts4.5/index.d.ts +0 -15
- package/dist/types-ts4.5/inline/index.d.ts +0 -1
- package/dist/types-ts4.5/inline/loader.d.ts +0 -26
- package/dist/types-ts4.5/inline/mediaInlineAnalyticsErrorBoundary.d.ts +0 -12
- package/dist/types-ts4.5/inline/mediaInlineCard.d.ts +0 -15
- package/dist/types-ts4.5/inline/mediaInlineCardAnalytics.d.ts +0 -6
- package/dist/types-ts4.5/types.d.ts +0 -105
- package/dist/types-ts4.5/utils/analytics.d.ts +0 -101
- package/dist/types-ts4.5/utils/cardDimensions.d.ts +0 -14
- package/dist/types-ts4.5/utils/containsPixelUnit.d.ts +0 -1
- package/dist/types-ts4.5/utils/dimensionComparer.d.ts +0 -3
- package/dist/types-ts4.5/utils/document.d.ts +0 -2
- package/dist/types-ts4.5/utils/generateUniqueId.d.ts +0 -1
- package/dist/types-ts4.5/utils/getCSSUnitValue.d.ts +0 -1
- package/dist/types-ts4.5/utils/getDataURIDimension.d.ts +0 -9
- package/dist/types-ts4.5/utils/getElementDimension.d.ts +0 -2
- package/dist/types-ts4.5/utils/getMediaCardCursor.d.ts +0 -6
- package/dist/types-ts4.5/utils/globalScope/getSSRData.d.ts +0 -3
- package/dist/types-ts4.5/utils/globalScope/globalScope.d.ts +0 -21
- package/dist/types-ts4.5/utils/globalScope/index.d.ts +0 -4
- package/dist/types-ts4.5/utils/globalScope/types.d.ts +0 -8
- package/dist/types-ts4.5/utils/index.d.ts +0 -6
- package/dist/types-ts4.5/utils/isRetina.d.ts +0 -1
- package/dist/types-ts4.5/utils/isValidPercentageUnit.d.ts +0 -1
- package/dist/types-ts4.5/utils/lightCards/cardError.d.ts +0 -12
- package/dist/types-ts4.5/utils/lightCards/cardLoading.d.ts +0 -5
- package/dist/types-ts4.5/utils/lightCards/errorIcon/index.d.ts +0 -12
- package/dist/types-ts4.5/utils/lightCards/errorIcon/styles.d.ts +0 -1
- package/dist/types-ts4.5/utils/lightCards/getDimensionsWithDefault.d.ts +0 -2
- package/dist/types-ts4.5/utils/lightCards/lightCardWrappers.d.ts +0 -4
- package/dist/types-ts4.5/utils/lightCards/styles.d.ts +0 -2
- package/dist/types-ts4.5/utils/lightCards/types.d.ts +0 -15
- package/dist/types-ts4.5/utils/metadata.d.ts +0 -2
- package/dist/types-ts4.5/utils/mockIntersectionObserver.d.ts +0 -20
- package/dist/types-ts4.5/utils/objectURLCache.d.ts +0 -12
- package/dist/types-ts4.5/utils/preventClickThrough.d.ts +0 -8
- package/dist/types-ts4.5/utils/printScript.d.ts +0 -2
- package/dist/types-ts4.5/utils/ufoExperiences.d.ts +0 -7
- package/dist/types-ts4.5/utils/videoIsPlayable.d.ts +0 -2
- package/dist/types-ts4.5/utils/videoSnapshot.d.ts +0 -1
- package/dist/types-ts4.5/utils/viewportDetector.d.ts +0 -6
- package/tmp/api-report-tmp.d.ts +0 -345
|
@@ -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.1.
|
|
7
|
+
const packageVersion = "77.1.2";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
|
@@ -51,14 +51,17 @@ export const completeUfoExperience = (id, status, fileAttributes, fileStateFlags
|
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
+
const getBasePayloadAttributes = () => ({
|
|
55
|
+
packageName,
|
|
56
|
+
packageVersion,
|
|
57
|
+
mediaEnvironment: getMediaEnvironment(),
|
|
58
|
+
mediaRegion: getMediaRegion()
|
|
59
|
+
});
|
|
54
60
|
const succeedUfoExperience = (id, properties) => {
|
|
55
61
|
getExperience(id).success({
|
|
56
62
|
metadata: {
|
|
57
63
|
...properties,
|
|
58
|
-
|
|
59
|
-
packageVersion,
|
|
60
|
-
mediaEnvironment: getMediaEnvironment(),
|
|
61
|
-
mediaRegion: getMediaRegion()
|
|
64
|
+
...getBasePayloadAttributes()
|
|
62
65
|
}
|
|
63
66
|
});
|
|
64
67
|
};
|
|
@@ -66,10 +69,16 @@ const failUfoExperience = (id, properties) => {
|
|
|
66
69
|
getExperience(id).failure({
|
|
67
70
|
metadata: {
|
|
68
71
|
...properties,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
...getBasePayloadAttributes()
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
export const abortUfoExperience = (id, properties) => {
|
|
77
|
+
// UFO won't abort if it's already in a final state (succeeded, failed, aborted, etc)
|
|
78
|
+
getExperience(id).abort({
|
|
79
|
+
metadata: {
|
|
80
|
+
...properties,
|
|
81
|
+
...getBasePayloadAttributes()
|
|
73
82
|
}
|
|
74
83
|
});
|
|
75
84
|
};
|
package/dist/esm/card/card.js
CHANGED
|
@@ -37,10 +37,10 @@ import { StoreSSRDataScript, getSSRData } from '../utils/globalScope';
|
|
|
37
37
|
import { getCardStateFromFileState, createStateUpdater } from './cardState';
|
|
38
38
|
import { isBigger } from '../utils/dimensionComparer';
|
|
39
39
|
import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
40
|
-
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
40
|
+
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
var packageName = "@atlaskit/media-card";
|
|
43
|
-
var packageVersion = "77.1.
|
|
43
|
+
var packageVersion = "77.1.2";
|
|
44
44
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
45
45
|
_inherits(CardBase, _Component);
|
|
46
46
|
var _super = _createSuper(CardBase);
|
|
@@ -108,8 +108,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
108
108
|
var _this$props2 = _this.props,
|
|
109
109
|
_this$props2$dimensio = _this$props2.dimensions,
|
|
110
110
|
dimensions = _this$props2$dimensio === void 0 ? {} : _this$props2$dimensio,
|
|
111
|
-
mediaClient = _this$props2.mediaClient
|
|
112
|
-
createAnalyticsEvent = _this$props2.createAnalyticsEvent;
|
|
111
|
+
mediaClient = _this$props2.mediaClient;
|
|
113
112
|
return {
|
|
114
113
|
mediaClient: mediaClient,
|
|
115
114
|
id: id,
|
|
@@ -119,8 +118,6 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
119
118
|
isRemotePreviewReady: isImageRepresentationReady(fileState),
|
|
120
119
|
imageUrlParams: _this.getImageURLParams(identifier),
|
|
121
120
|
mediaBlobUrlAttrs: _this.getMediaBlobUrlAttrs(identifier, fileState),
|
|
122
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
123
|
-
featureFlags: _this.props.featureFlags,
|
|
124
121
|
traceContext: _this.traceContext
|
|
125
122
|
};
|
|
126
123
|
});
|
|
@@ -759,10 +756,8 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
759
756
|
mediaClient = _this$props12.mediaClient,
|
|
760
757
|
identifier = _this$props12.identifier,
|
|
761
758
|
dimensions = _this$props12.dimensions,
|
|
762
|
-
featureFlags = _this$props12.featureFlags,
|
|
763
759
|
useInlinePlayer = _this$props12.useInlinePlayer,
|
|
764
760
|
disableOverlay = _this$props12.disableOverlay,
|
|
765
|
-
resizeMode = _this$props12.resizeMode,
|
|
766
761
|
ssr = _this$props12.ssr;
|
|
767
762
|
var _this$state4 = this.state,
|
|
768
763
|
isCardVisible = _this$state4.isCardVisible,
|
|
@@ -789,7 +784,6 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
789
784
|
var turnedVisible = !prevIsCardVisible && isCardVisible;
|
|
790
785
|
var hadSSRCardPreview = !!prevCardPreview && isSSRClientPreview(prevCardPreview) && !cardPreview;
|
|
791
786
|
var isNewMediaClient = prevMediaClient !== mediaClient;
|
|
792
|
-
var fileImageMode = imageResizeModeToFileImageMode(resizeMode);
|
|
793
787
|
this.updateFileStateFlag(fileState);
|
|
794
788
|
if (isExternalImageIdentifier(identifier) && isDiffIdentifier) {
|
|
795
789
|
this.fireCommencedEvent();
|
|
@@ -828,9 +822,6 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
828
822
|
fileState: fileState,
|
|
829
823
|
prevDimensions: prevDimensions,
|
|
830
824
|
dimensions: dimensions,
|
|
831
|
-
identifier: identifier,
|
|
832
|
-
fileImageMode: fileImageMode,
|
|
833
|
-
featureFlags: featureFlags,
|
|
834
825
|
hasCardPreview: !!cardPreview,
|
|
835
826
|
isBannedLocalPreview: isBannedLocalPreview,
|
|
836
827
|
wasResolvedUpfrontPreview: wasResolvedUpfrontPreview
|
|
@@ -864,6 +855,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
864
855
|
key: "componentWillUnmount",
|
|
865
856
|
value: function componentWillUnmount() {
|
|
866
857
|
var _getDocument2;
|
|
858
|
+
this.fireAbortedEvent();
|
|
867
859
|
this.hasBeenMounted = false;
|
|
868
860
|
this.unsubscribe();
|
|
869
861
|
(_getDocument2 = getDocument()) === null || _getDocument2 === void 0 || _getDocument2.removeEventListener('copy', this.fireCopiedEvent);
|
|
@@ -902,8 +894,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
902
894
|
occurrenceKey: occurrenceKey
|
|
903
895
|
}).subscribe({
|
|
904
896
|
next: function next(fileState) {
|
|
905
|
-
var
|
|
906
|
-
var newState = getCardStateFromFileState(fileState, isBannedLocalPreview, featureFlags);
|
|
897
|
+
var newState = getCardStateFromFileState(fileState, isBannedLocalPreview);
|
|
907
898
|
_this2.safeSetState(newState);
|
|
908
899
|
},
|
|
909
900
|
error: function error(e) {
|
|
@@ -950,6 +941,19 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
950
941
|
createAnalyticsEvent && _fireOperationalEvent(createAnalyticsEvent, status, this.fileAttributes, this.getPerformanceAttributes(), this.ssrReliability, error, this.traceContext, fileState === null || fileState === void 0 ? void 0 : fileState.metadataTraceContext);
|
|
951
942
|
completeUfoExperience(this.internalOccurrenceKey, status, this.fileAttributes, this.fileStateFlags, this.ssrReliability, error);
|
|
952
943
|
}
|
|
944
|
+
}, {
|
|
945
|
+
key: "fireAbortedEvent",
|
|
946
|
+
value: function fireAbortedEvent() {
|
|
947
|
+
var fileAttributes = this.fileAttributes,
|
|
948
|
+
fileStateFlags = this.fileStateFlags,
|
|
949
|
+
ssrReliability = this.ssrReliability;
|
|
950
|
+
// UFO won't abort if it's already in a final state (succeeded, failed, aborted, etc)
|
|
951
|
+
abortUfoExperience(this.internalOccurrenceKey, {
|
|
952
|
+
fileAttributes: fileAttributes,
|
|
953
|
+
fileStateFlags: fileStateFlags,
|
|
954
|
+
ssrReliability: ssrReliability
|
|
955
|
+
});
|
|
956
|
+
}
|
|
953
957
|
}, {
|
|
954
958
|
key: "fireCommencedEvent",
|
|
955
959
|
value: function fireCommencedEvent() {
|
|
@@ -19,7 +19,7 @@ export var createStateUpdater = function createStateUpdater(newState, fireErrorE
|
|
|
19
19
|
return newState;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
export var getCardStateFromFileState = function getCardStateFromFileState(fileState, isBannedLocalPreview
|
|
22
|
+
export var getCardStateFromFileState = function getCardStateFromFileState(fileState, isBannedLocalPreview) {
|
|
23
23
|
var status = getCardStatus(fileState.status, extractFilePreviewStatus(fileState, isBannedLocalPreview));
|
|
24
24
|
var error = status === 'error' && isErrorFileState(fileState) ? new MediaCardError('error-file-state', new Error(fileState.message)) : undefined;
|
|
25
25
|
var progress = status === 'uploading' && fileState.status === 'uploading' ? fileState.progress : 1;
|
|
@@ -64,11 +64,11 @@ var extendAndCachePreview = function extendAndCachePreview(id, mode, preview, me
|
|
|
64
64
|
*/
|
|
65
65
|
export var getCardPreview = /*#__PURE__*/function () {
|
|
66
66
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
67
|
-
var mediaClient, id, _ref$dimensions, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs,
|
|
67
|
+
var mediaClient, id, _ref$dimensions, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, traceContext, mode, cachedPreview, dimensionsAreBigger, localPreview, remotePreview;
|
|
68
68
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
69
69
|
while (1) switch (_context.prev = _context.next) {
|
|
70
70
|
case 0:
|
|
71
|
-
mediaClient = _ref.mediaClient, id = _ref.id, _ref$dimensions = _ref.dimensions, dimensions = _ref$dimensions === void 0 ? {} : _ref$dimensions, filePreview = _ref.filePreview, onLocalPreviewError = _ref.onLocalPreviewError, isRemotePreviewReady = _ref.isRemotePreviewReady, imageUrlParams = _ref.imageUrlParams, mediaBlobUrlAttrs = _ref.mediaBlobUrlAttrs,
|
|
71
|
+
mediaClient = _ref.mediaClient, id = _ref.id, _ref$dimensions = _ref.dimensions, dimensions = _ref$dimensions === void 0 ? {} : _ref$dimensions, filePreview = _ref.filePreview, onLocalPreviewError = _ref.onLocalPreviewError, isRemotePreviewReady = _ref.isRemotePreviewReady, imageUrlParams = _ref.imageUrlParams, mediaBlobUrlAttrs = _ref.mediaBlobUrlAttrs, traceContext = _ref.traceContext;
|
|
72
72
|
mode = imageUrlParams.mode;
|
|
73
73
|
cachedPreview = cardPreviewCache.get(id, mode);
|
|
74
74
|
dimensionsAreBigger = isBigger(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions);
|
|
@@ -145,11 +145,8 @@ export var shouldResolvePreview = function shouldResolvePreview(_ref3) {
|
|
|
145
145
|
fileState = _ref3.fileState,
|
|
146
146
|
prevDimensions = _ref3.prevDimensions,
|
|
147
147
|
dimensions = _ref3.dimensions,
|
|
148
|
-
identifier = _ref3.identifier,
|
|
149
|
-
fileImageMode = _ref3.fileImageMode,
|
|
150
148
|
hasCardPreview = _ref3.hasCardPreview,
|
|
151
149
|
isBannedLocalPreview = _ref3.isBannedLocalPreview,
|
|
152
|
-
featureFlags = _ref3.featureFlags,
|
|
153
150
|
wasResolvedUpfrontPreview = _ref3.wasResolvedUpfrontPreview;
|
|
154
151
|
var statusIsPreviewable = isPreviewableStatus(status, extractFilePreviewStatus(fileState, isBannedLocalPreview));
|
|
155
152
|
var dimensionsAreBigger = isBigger(prevDimensions, dimensions);
|
|
@@ -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.1.
|
|
86
|
+
var packageVersion = "77.1.2";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -37,11 +37,11 @@ import { StoreSSRDataScript, getSSRData } from '../../utils/globalScope';
|
|
|
37
37
|
import { getCardStateFromFileState, createStateUpdater } from '../cardState';
|
|
38
38
|
import { isBigger } from '../../utils/dimensionComparer';
|
|
39
39
|
import { getMediaCardCursor } from '../../utils/getMediaCardCursor';
|
|
40
|
-
import { completeUfoExperience, startUfoExperience } from '../../utils/ufoExperiences';
|
|
40
|
+
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../../utils/ufoExperiences';
|
|
41
41
|
import { generateUniqueId } from '../../utils/generateUniqueId';
|
|
42
42
|
import { useFileState } from '@atlaskit/media-client-react';
|
|
43
43
|
var packageName = "@atlaskit/media-card";
|
|
44
|
-
var packageVersion = "77.1.
|
|
44
|
+
var packageVersion = "77.1.2";
|
|
45
45
|
export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
46
46
|
_inherits(CardV2Base, _Component);
|
|
47
47
|
var _super = _createSuper(CardV2Base);
|
|
@@ -109,8 +109,7 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
109
109
|
var _this$props2 = _this.props,
|
|
110
110
|
_this$props2$dimensio = _this$props2.dimensions,
|
|
111
111
|
dimensions = _this$props2$dimensio === void 0 ? {} : _this$props2$dimensio,
|
|
112
|
-
mediaClient = _this$props2.mediaClient
|
|
113
|
-
createAnalyticsEvent = _this$props2.createAnalyticsEvent;
|
|
112
|
+
mediaClient = _this$props2.mediaClient;
|
|
114
113
|
return {
|
|
115
114
|
mediaClient: mediaClient,
|
|
116
115
|
id: id,
|
|
@@ -120,8 +119,6 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
120
119
|
isRemotePreviewReady: isImageRepresentationReady(fileState),
|
|
121
120
|
imageUrlParams: _this.getImageURLParams(identifier),
|
|
122
121
|
mediaBlobUrlAttrs: _this.getMediaBlobUrlAttrs(identifier, fileState),
|
|
123
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
124
|
-
featureFlags: _this.props.featureFlags,
|
|
125
122
|
traceContext: _this.traceContext
|
|
126
123
|
};
|
|
127
124
|
});
|
|
@@ -264,8 +261,7 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
264
261
|
_defineProperty(_assertThisInitialized(_this), "subscribeFileState", function (fileState) {
|
|
265
262
|
var isBannedLocalPreview = _this.state.isBannedLocalPreview;
|
|
266
263
|
if (fileState.status !== 'error') {
|
|
267
|
-
var
|
|
268
|
-
var newState = getCardStateFromFileState(fileState, isBannedLocalPreview, featureFlags);
|
|
264
|
+
var newState = getCardStateFromFileState(fileState, isBannedLocalPreview);
|
|
269
265
|
_this.safeSetState(newState);
|
|
270
266
|
} else {
|
|
271
267
|
var e = new MediaFileStateError(fileState.id, fileState.reason, fileState.message, fileState.details);
|
|
@@ -727,7 +723,7 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
727
723
|
ssr = _this$props11.ssr,
|
|
728
724
|
dimensions = _this$props11.dimensions;
|
|
729
725
|
if (isCardVisible && isFileIdentifier(identifier)) {
|
|
730
|
-
this.updateStateForIdentifier(
|
|
726
|
+
this.updateStateForIdentifier();
|
|
731
727
|
if (!cardPreview) {
|
|
732
728
|
this.resolveUpfrontPreview(identifier);
|
|
733
729
|
}
|
|
@@ -764,10 +760,8 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
764
760
|
mediaClient = _this$props12.mediaClient,
|
|
765
761
|
identifier = _this$props12.identifier,
|
|
766
762
|
dimensions = _this$props12.dimensions,
|
|
767
|
-
featureFlags = _this$props12.featureFlags,
|
|
768
763
|
useInlinePlayer = _this$props12.useInlinePlayer,
|
|
769
764
|
disableOverlay = _this$props12.disableOverlay,
|
|
770
|
-
resizeMode = _this$props12.resizeMode,
|
|
771
765
|
ssr = _this$props12.ssr;
|
|
772
766
|
var _this$state4 = this.state,
|
|
773
767
|
isCardVisible = _this$state4.isCardVisible,
|
|
@@ -794,7 +788,6 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
794
788
|
var turnedVisible = !prevIsCardVisible && isCardVisible;
|
|
795
789
|
var hadSSRCardPreview = !!prevCardPreview && isSSRClientPreview(prevCardPreview) && !cardPreview;
|
|
796
790
|
var isNewMediaClient = prevMediaClient !== mediaClient;
|
|
797
|
-
var fileImageMode = imageResizeModeToFileImageMode(resizeMode);
|
|
798
791
|
this.updateFileStateFlag(fileState);
|
|
799
792
|
if (isExternalImageIdentifier(identifier) && isDiffIdentifier) {
|
|
800
793
|
this.fireCommencedEvent();
|
|
@@ -815,7 +808,7 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
815
808
|
this.refetchSSRPreview(identifier);
|
|
816
809
|
}
|
|
817
810
|
if (isFileIdentifier(identifier) && (turnedVisible || !!this.subscription && (isNewMediaClient || isDiffIdentifier))) {
|
|
818
|
-
this.updateStateForIdentifier(
|
|
811
|
+
this.updateStateForIdentifier();
|
|
819
812
|
}
|
|
820
813
|
if (this.state.status !== prevState.status) {
|
|
821
814
|
this.fireOperationalEvent();
|
|
@@ -833,9 +826,6 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
833
826
|
fileState: fileState,
|
|
834
827
|
prevDimensions: prevDimensions,
|
|
835
828
|
dimensions: dimensions,
|
|
836
|
-
identifier: identifier,
|
|
837
|
-
fileImageMode: fileImageMode,
|
|
838
|
-
featureFlags: featureFlags,
|
|
839
829
|
hasCardPreview: !!cardPreview,
|
|
840
830
|
isBannedLocalPreview: isBannedLocalPreview,
|
|
841
831
|
wasResolvedUpfrontPreview: wasResolvedUpfrontPreview
|
|
@@ -875,12 +865,13 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
875
865
|
key: "componentWillUnmount",
|
|
876
866
|
value: function componentWillUnmount() {
|
|
877
867
|
var _getDocument2;
|
|
868
|
+
this.fireAbortedEvent();
|
|
878
869
|
this.hasBeenMounted = false;
|
|
879
870
|
(_getDocument2 = getDocument()) === null || _getDocument2 === void 0 || _getDocument2.removeEventListener('copy', this.fireCopiedEvent);
|
|
880
871
|
}
|
|
881
872
|
}, {
|
|
882
873
|
key: "updateStateForIdentifier",
|
|
883
|
-
value: function updateStateForIdentifier(
|
|
874
|
+
value: function updateStateForIdentifier() {
|
|
884
875
|
this.fireCommencedEvent();
|
|
885
876
|
this.setState({
|
|
886
877
|
shouldUpdateStateForIdentifier: true
|
|
@@ -945,6 +936,19 @@ export var CardV2Base = /*#__PURE__*/function (_Component) {
|
|
|
945
936
|
}, this.traceContext);
|
|
946
937
|
startUfoExperience(this.internalOccurrenceKey);
|
|
947
938
|
}
|
|
939
|
+
}, {
|
|
940
|
+
key: "fireAbortedEvent",
|
|
941
|
+
value: function fireAbortedEvent() {
|
|
942
|
+
var fileAttributes = this.fileAttributes,
|
|
943
|
+
fileStateFlags = this.fileStateFlags,
|
|
944
|
+
ssrReliability = this.ssrReliability;
|
|
945
|
+
// UFO won't abort if it's already in a final state (succeeded, failed, aborted, etc)
|
|
946
|
+
abortUfoExperience(this.internalOccurrenceKey, {
|
|
947
|
+
fileAttributes: fileAttributes,
|
|
948
|
+
fileStateFlags: fileStateFlags,
|
|
949
|
+
ssrReliability: ssrReliability
|
|
950
|
+
});
|
|
951
|
+
}
|
|
948
952
|
}, {
|
|
949
953
|
key: "actions",
|
|
950
954
|
get: function get() {
|
|
@@ -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.1.
|
|
106
|
+
packageName: "77.1.2",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "77.1.
|
|
10
|
+
var packageVersion = "77.1.2";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -55,23 +55,27 @@ export var completeUfoExperience = function completeUfoExperience(id, status, fi
|
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
+
var getBasePayloadAttributes = function getBasePayloadAttributes() {
|
|
59
|
+
return {
|
|
60
|
+
packageName: packageName,
|
|
61
|
+
packageVersion: packageVersion,
|
|
62
|
+
mediaEnvironment: getMediaEnvironment(),
|
|
63
|
+
mediaRegion: getMediaRegion()
|
|
64
|
+
};
|
|
65
|
+
};
|
|
58
66
|
var succeedUfoExperience = function succeedUfoExperience(id, properties) {
|
|
59
67
|
getExperience(id).success({
|
|
60
|
-
metadata: _objectSpread(_objectSpread({}, properties),
|
|
61
|
-
packageName: packageName,
|
|
62
|
-
packageVersion: packageVersion,
|
|
63
|
-
mediaEnvironment: getMediaEnvironment(),
|
|
64
|
-
mediaRegion: getMediaRegion()
|
|
65
|
-
})
|
|
68
|
+
metadata: _objectSpread(_objectSpread({}, properties), getBasePayloadAttributes())
|
|
66
69
|
});
|
|
67
70
|
};
|
|
68
71
|
var failUfoExperience = function failUfoExperience(id, properties) {
|
|
69
72
|
getExperience(id).failure({
|
|
70
|
-
metadata: _objectSpread(_objectSpread({}, properties),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
metadata: _objectSpread(_objectSpread({}, properties), getBasePayloadAttributes())
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
export var abortUfoExperience = function abortUfoExperience(id, properties) {
|
|
77
|
+
// UFO won't abort if it's already in a final state (succeeded, failed, aborted, etc)
|
|
78
|
+
getExperience(id).abort({
|
|
79
|
+
metadata: _objectSpread(_objectSpread({}, properties), getBasePayloadAttributes())
|
|
76
80
|
});
|
|
77
81
|
};
|
|
@@ -39,6 +39,7 @@ export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
|
39
39
|
private onImageError;
|
|
40
40
|
private onImageLoad;
|
|
41
41
|
private fireOperationalEvent;
|
|
42
|
+
private fireAbortedEvent;
|
|
42
43
|
private fireCommencedEvent;
|
|
43
44
|
private fireCopiedEvent;
|
|
44
45
|
private fireScreenEvent;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FileState } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
2
|
import { CardState } from '../types';
|
|
4
3
|
import { MediaCardError } from '../errors';
|
|
5
4
|
/**
|
|
@@ -7,4 +6,4 @@ import { MediaCardError } from '../errors';
|
|
|
7
6
|
* The output of the updater is shallowly merged with state."
|
|
8
7
|
*/
|
|
9
8
|
export declare const createStateUpdater: (newState: Partial<CardState>, fireErrorEvent: (error: MediaCardError) => void) => (prevState: CardState) => Partial<CardState>;
|
|
10
|
-
export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean
|
|
9
|
+
export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean) => Partial<CardState>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { MediaClient, FilePreview, FileState, MediaStoreGetFileImageParams, MediaBlobUrlAttrs
|
|
2
|
-
import {
|
|
1
|
+
import { MediaClient, FilePreview, FileState, MediaStoreGetFileImageParams, MediaBlobUrlAttrs } from '@atlaskit/media-client';
|
|
2
|
+
import { SSR, MediaTraceContext } from '@atlaskit/media-common';
|
|
3
3
|
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
4
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
4
|
import { CardDimensions } from '../../types';
|
|
6
5
|
import { MediaCardError } from '../../errors';
|
|
7
6
|
import { CardStatus, CardPreview } from '../../types';
|
|
@@ -23,8 +22,6 @@ export type CardPreviewParams = {
|
|
|
23
22
|
isRemotePreviewReady: boolean;
|
|
24
23
|
imageUrlParams: MediaStoreGetFileImageParams;
|
|
25
24
|
mediaBlobUrlAttrs?: MediaBlobUrlAttrs;
|
|
26
|
-
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
27
|
-
featureFlags?: MediaFeatureFlags;
|
|
28
25
|
traceContext?: MediaTraceContext;
|
|
29
26
|
};
|
|
30
27
|
/**
|
|
@@ -37,17 +34,14 @@ export type CardPreviewParams = {
|
|
|
37
34
|
* In that case, we still want to report the local preview error to the caller, for feature realiability track.
|
|
38
35
|
* hence the use of the optional callback onLocalPreviewError
|
|
39
36
|
*/
|
|
40
|
-
export declare const getCardPreview: ({ mediaClient, id, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs,
|
|
41
|
-
export declare const shouldResolvePreview: ({ status, fileState, prevDimensions, dimensions,
|
|
37
|
+
export declare const getCardPreview: ({ mediaClient, id, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, traceContext, }: CardPreviewParams) => Promise<CardPreview>;
|
|
38
|
+
export declare const shouldResolvePreview: ({ status, fileState, prevDimensions, dimensions, hasCardPreview, isBannedLocalPreview, wasResolvedUpfrontPreview, }: {
|
|
42
39
|
status: CardStatus;
|
|
43
40
|
fileState: FileState;
|
|
44
41
|
prevDimensions?: CardDimensions | undefined;
|
|
45
42
|
dimensions?: CardDimensions | undefined;
|
|
46
|
-
identifier: FileIdentifier;
|
|
47
|
-
fileImageMode?: ImageResizeMode | undefined;
|
|
48
43
|
hasCardPreview: boolean;
|
|
49
44
|
isBannedLocalPreview: boolean;
|
|
50
|
-
featureFlags?: MediaFeatureFlags | undefined;
|
|
51
45
|
wasResolvedUpfrontPreview: boolean;
|
|
52
46
|
}) => boolean;
|
|
53
47
|
export declare const getSSRCardPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs) => CardPreview;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
-
import {
|
|
3
|
+
import { FileState, MediaSubscription } from '@atlaskit/media-client';
|
|
4
4
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
import { CardAction } from '../actions';
|
|
6
6
|
import { CardProps, CardState, CardStatus } from '../../types';
|
|
@@ -20,7 +20,7 @@ export declare class CardV2Base extends Component<CardV2BaseProps, CardState> {
|
|
|
20
20
|
componentDidMount(): void;
|
|
21
21
|
componentDidUpdate(prevProps: CardProps, prevState: CardState): void;
|
|
22
22
|
componentWillUnmount(): void;
|
|
23
|
-
updateStateForIdentifier(
|
|
23
|
+
updateStateForIdentifier(): void;
|
|
24
24
|
private getImageURLParams;
|
|
25
25
|
private getMediaBlobUrlAttrs;
|
|
26
26
|
private getCardPreviewParams;
|
|
@@ -40,6 +40,7 @@ export declare class CardV2Base extends Component<CardV2BaseProps, CardState> {
|
|
|
40
40
|
private onImageLoad;
|
|
41
41
|
private fireOperationalEvent;
|
|
42
42
|
private fireCommencedEvent;
|
|
43
|
+
private fireAbortedEvent;
|
|
43
44
|
private fireCopiedEvent;
|
|
44
45
|
private fireScreenEvent;
|
|
45
46
|
private fireNonCriticalErrorEvent;
|
|
@@ -3,5 +3,12 @@ import { FileAttributes } from '@atlaskit/media-common';
|
|
|
3
3
|
import { SSRStatus } from './analytics';
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { FileStateFlags } from '../types';
|
|
6
|
+
type SucceedUfoPayload = {
|
|
7
|
+
fileAttributes: FileAttributes;
|
|
8
|
+
ssrReliability: SSRStatus;
|
|
9
|
+
fileStateFlags: FileStateFlags;
|
|
10
|
+
};
|
|
6
11
|
export declare const startUfoExperience: (id: string) => void;
|
|
7
12
|
export declare const completeUfoExperience: (id: string, status: CardStatus, fileAttributes: FileAttributes, fileStateFlags: FileStateFlags, ssrReliability: SSRStatus, error?: MediaCardError) => void;
|
|
13
|
+
export declare const abortUfoExperience: (id: string, properties?: Partial<SucceedUfoPayload>) => void;
|
|
14
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "77.1.
|
|
3
|
+
"version": "77.1.2",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
40
|
-
"@atlaskit/dropdown-menu": "^
|
|
40
|
+
"@atlaskit/dropdown-menu": "^12.0.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^2.8.0",
|
|
42
42
|
"@atlaskit/icon": "^21.12.0",
|
|
43
43
|
"@atlaskit/media-client": "^24.0.0",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FileItem, FileDetails } from '@atlaskit/media-client';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
export interface CardAction {
|
|
4
|
-
label?: string;
|
|
5
|
-
handler: CardEventHandler;
|
|
6
|
-
icon?: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export type CardEventHandler = (item?: FileItem, event?: Event) => void;
|
|
9
|
-
export declare function attachDetailsToActions(actions: Array<CardAction>, details: FileDetails): Array<CardAction>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
-
import { FileIdentifier, FileState, MediaSubscription } from '@atlaskit/media-client';
|
|
4
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
5
|
-
import { CardAction } from './actions';
|
|
6
|
-
import { CardProps, CardState, CardStatus } from '../types';
|
|
7
|
-
export type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<WrappedComponentProps>;
|
|
8
|
-
export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
9
|
-
private internalOccurrenceKey;
|
|
10
|
-
private hasBeenMounted;
|
|
11
|
-
private fileStateFlags;
|
|
12
|
-
private ssrReliability;
|
|
13
|
-
private timeElapsedTillCommenced;
|
|
14
|
-
subscription?: MediaSubscription;
|
|
15
|
-
private ssrData?;
|
|
16
|
-
private traceContext;
|
|
17
|
-
static defaultProps: Partial<CardProps>;
|
|
18
|
-
constructor(props: CardBaseProps);
|
|
19
|
-
private getSSRPreview;
|
|
20
|
-
componentDidMount(): void;
|
|
21
|
-
componentDidUpdate(prevProps: CardProps, prevState: CardState): void;
|
|
22
|
-
componentWillUnmount(): void;
|
|
23
|
-
updateStateForIdentifier(identifier: FileIdentifier): void;
|
|
24
|
-
private getImageURLParams;
|
|
25
|
-
private getMediaBlobUrlAttrs;
|
|
26
|
-
private getCardPreviewParams;
|
|
27
|
-
private setCacheSSRPreview;
|
|
28
|
-
private refetchSSRPreview;
|
|
29
|
-
private resolveUpfrontPreview;
|
|
30
|
-
private fetchAndCacheRemotePreview;
|
|
31
|
-
private resolvePreview;
|
|
32
|
-
updateFileStateFlag(fileState?: FileState): void;
|
|
33
|
-
subscribeInternalFile(identifier: FileIdentifier): void;
|
|
34
|
-
private get requestedDimensions();
|
|
35
|
-
private get metadata();
|
|
36
|
-
private get fileAttributes();
|
|
37
|
-
private getPerformanceAttributes;
|
|
38
|
-
private logSSRImageError;
|
|
39
|
-
private onImageError;
|
|
40
|
-
private onImageLoad;
|
|
41
|
-
private fireOperationalEvent;
|
|
42
|
-
private fireCommencedEvent;
|
|
43
|
-
private fireCopiedEvent;
|
|
44
|
-
private fireScreenEvent;
|
|
45
|
-
private fireNonCriticalErrorEvent;
|
|
46
|
-
private safeSetState;
|
|
47
|
-
unsubscribe: () => void;
|
|
48
|
-
get actions(): CardAction[];
|
|
49
|
-
onCardViewClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
50
|
-
onInlinePlayerError: () => void;
|
|
51
|
-
setRef: (cardRef: HTMLDivElement | null) => void;
|
|
52
|
-
renderInlinePlayer: () => JSX.Element;
|
|
53
|
-
onMediaViewerClose: () => void;
|
|
54
|
-
private onDisplayImage;
|
|
55
|
-
renderMediaViewer: () => React.ReactPortal | undefined;
|
|
56
|
-
renderCard: (withCallbacks?: boolean, cardStatusOverride?: CardStatus, izLazyOverride?: boolean) => JSX.Element;
|
|
57
|
-
private storeSSRData;
|
|
58
|
-
render(): JSX.Element;
|
|
59
|
-
private onCardInViewport;
|
|
60
|
-
onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
61
|
-
onMouseEnter: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
62
|
-
}
|
|
63
|
-
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FileAttributes, MediaTraceContext, PerformanceAttributes } from '@atlaskit/media-common';
|
|
2
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import { SSRStatus } from '../utils/analytics';
|
|
4
|
-
import { CardStatus } from '../types';
|
|
5
|
-
import { MediaCardError } from '../errors';
|
|
6
|
-
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
7
|
-
export declare const fireCommencedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, traceContext: MediaTraceContext) => void;
|
|
8
|
-
export declare const fireCopiedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileId: string, cardRef: HTMLDivElement) => void;
|
|
9
|
-
export declare const fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes) => void;
|
|
10
|
-
export declare const fireNonCriticalErrorEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, cardStatus: CardStatus, fileAttributes: FileAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const newFileExperienceClassName = "new-file-experience-wrapper";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
|
-
import type { CardBaseProps } from './card';
|
|
4
|
-
export type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
|
|
5
|
-
declare const CardLoader: React.FC<CardWithMediaClientConfigProps>;
|
|
6
|
-
export default CardLoader;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FileState } from '@atlaskit/media-client';
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
-
import { CardState } from '../types';
|
|
4
|
-
import { MediaCardError } from '../errors';
|
|
5
|
-
/**
|
|
6
|
-
* From docs: "Both state and props received by the updater function are guaranteed to be up-to-date.
|
|
7
|
-
* The output of the updater is shallowly merged with state."
|
|
8
|
-
*/
|
|
9
|
-
export declare const createStateUpdater: (newState: Partial<CardState>, fireErrorEvent: (error: MediaCardError) => void) => (prevState: CardState) => Partial<CardState>;
|
|
10
|
-
export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags) => Partial<CardState>;
|