@atlaskit/media-card 73.5.0 → 73.7.0
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 +38 -0
- package/classnames/package.json +1 -0
- package/dist/cjs/root/card/cardAnalytics.js +1 -16
- package/dist/cjs/root/card/index.js +25 -3
- package/dist/cjs/root/cardView.js +2 -5
- package/dist/cjs/root/inlinePlayer.js +3 -1
- package/dist/cjs/root/ui/styled.js +1 -1
- package/dist/cjs/root/ui/titleBox/styled.js +1 -1
- package/dist/cjs/types.js +0 -1
- package/dist/cjs/utils/analytics.js +15 -1
- package/dist/cjs/utils/getMediaCardCursor.js +5 -2
- package/dist/cjs/utils/ufoExperiences.js +17 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/root/card/cardAnalytics.js +0 -9
- package/dist/es2019/root/card/index.js +29 -5
- package/dist/es2019/root/cardView.js +2 -4
- package/dist/es2019/root/inlinePlayer.js +3 -1
- package/dist/es2019/root/ui/styled.js +1 -1
- package/dist/es2019/root/ui/titleBox/styled.js +2 -0
- package/dist/es2019/types.js +0 -1
- package/dist/es2019/utils/analytics.js +12 -1
- package/dist/es2019/utils/getMediaCardCursor.js +6 -2
- package/dist/es2019/utils/ufoExperiences.js +17 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/root/card/cardAnalytics.js +0 -11
- package/dist/esm/root/card/index.js +28 -5
- package/dist/esm/root/cardView.js +2 -4
- package/dist/esm/root/inlinePlayer.js +3 -1
- package/dist/esm/root/ui/styled.js +1 -1
- package/dist/esm/root/ui/titleBox/styled.js +1 -1
- package/dist/esm/types.js +0 -1
- package/dist/esm/utils/analytics.js +12 -1
- package/dist/esm/utils/getMediaCardCursor.js +6 -2
- package/dist/esm/utils/ufoExperiences.js +17 -8
- package/dist/esm/version.json +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/files/cardImageView/cardOverlay/styled.d.ts +10 -10
- package/dist/types/files/cardImageView/styled.d.ts +266 -9
- package/dist/types/index.d.ts +5 -0
- package/dist/types/root/card/cardAnalytics.d.ts +0 -1
- package/dist/types/root/card/getCardPreview/helpers.d.ts +2 -2
- package/dist/types/root/card/index.d.ts +3 -1
- package/dist/types/root/cardView.d.ts +2 -2
- package/dist/types/root/inlinePlayer.d.ts +2 -1
- package/dist/types/root/styled.d.ts +1 -1
- package/dist/types/root/ui/loadingRateLimited/styled.d.ts +3 -3
- package/dist/types/root/ui/playButton/styled.d.ts +2 -2
- package/dist/types/root/ui/styled.d.ts +2 -2
- package/dist/types/root/ui/titleBox/styled.d.ts +2 -2
- package/dist/types/styles/mixins.d.ts +1 -1
- package/dist/types/types.d.ts +4 -1
- package/dist/types/utils/analytics.d.ts +3 -1
- package/dist/types/utils/cardDimensions.d.ts +5 -5
- package/dist/types/utils/dimensionComparer.d.ts +2 -2
- package/dist/types/utils/getMediaCardCursor.d.ts +5 -1
- package/dist/types/utils/metadata.d.ts +2 -2
- package/dist/types/utils/shouldDisplayImageThumbnail.d.ts +2 -2
- package/dist/types/utils/ufoExperiences.d.ts +2 -1
- package/example-helpers/index.tsx +20 -9
- package/in-product/package.json +1 -0
- package/package.json +13 -12
- package/types/package.json +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo';
|
|
2
2
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
3
|
-
import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
3
|
+
import { extractErrorInfo, getRenderErrorRequestMetadata, LOGGED_FEATURE_FLAG_KEYS } from './analytics';
|
|
4
|
+
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
4
5
|
let concurrentExperience;
|
|
5
6
|
|
|
6
7
|
const getExperience = id => {
|
|
@@ -10,7 +11,8 @@ const getExperience = id => {
|
|
|
10
11
|
component: 'media-card'
|
|
11
12
|
},
|
|
12
13
|
type: ExperienceTypes.Experience,
|
|
13
|
-
performanceType: ExperiencePerformanceTypes.InlineResult
|
|
14
|
+
performanceType: ExperiencePerformanceTypes.InlineResult,
|
|
15
|
+
featureFlags: LOGGED_FEATURE_FLAG_KEYS
|
|
14
16
|
};
|
|
15
17
|
concurrentExperience = new ConcurrentExperience('media-card-render', inlineExperience);
|
|
16
18
|
}
|
|
@@ -21,12 +23,13 @@ const getExperience = id => {
|
|
|
21
23
|
export const startUfoExperience = id => {
|
|
22
24
|
getExperience(id).start();
|
|
23
25
|
};
|
|
24
|
-
export const completeUfoExperience = (id, status, fileAttributes, ssrReliability, error) => {
|
|
26
|
+
export const completeUfoExperience = (id, status, fileAttributes, fileStateFlags, ssrReliability, error) => {
|
|
25
27
|
switch (status) {
|
|
26
28
|
case 'complete':
|
|
27
29
|
succeedUfoExperience(id, {
|
|
28
30
|
fileAttributes,
|
|
29
|
-
ssrReliability
|
|
31
|
+
ssrReliability,
|
|
32
|
+
fileStateFlags
|
|
30
33
|
});
|
|
31
34
|
break;
|
|
32
35
|
|
|
@@ -34,7 +37,8 @@ export const completeUfoExperience = (id, status, fileAttributes, ssrReliability
|
|
|
34
37
|
failUfoExperience(id, {
|
|
35
38
|
fileAttributes,
|
|
36
39
|
failReason: 'failed-processing',
|
|
37
|
-
ssrReliability
|
|
40
|
+
ssrReliability,
|
|
41
|
+
fileStateFlags
|
|
38
42
|
});
|
|
39
43
|
break;
|
|
40
44
|
|
|
@@ -43,7 +47,8 @@ export const completeUfoExperience = (id, status, fileAttributes, ssrReliability
|
|
|
43
47
|
fileAttributes,
|
|
44
48
|
...extractErrorInfo(error),
|
|
45
49
|
request: getRenderErrorRequestMetadata(error),
|
|
46
|
-
ssrReliability
|
|
50
|
+
ssrReliability,
|
|
51
|
+
fileStateFlags
|
|
47
52
|
});
|
|
48
53
|
break;
|
|
49
54
|
}
|
|
@@ -53,7 +58,9 @@ const succeedUfoExperience = (id, properties) => {
|
|
|
53
58
|
getExperience(id).success({
|
|
54
59
|
metadata: { ...properties,
|
|
55
60
|
packageName,
|
|
56
|
-
packageVersion
|
|
61
|
+
packageVersion,
|
|
62
|
+
mediaEnvironment: getMediaEnvironment(),
|
|
63
|
+
mediaRegion: getMediaRegion()
|
|
57
64
|
}
|
|
58
65
|
});
|
|
59
66
|
};
|
|
@@ -62,7 +69,9 @@ const failUfoExperience = (id, properties) => {
|
|
|
62
69
|
getExperience(id).failure({
|
|
63
70
|
metadata: { ...properties,
|
|
64
71
|
packageName,
|
|
65
|
-
packageVersion
|
|
72
|
+
packageVersion,
|
|
73
|
+
mediaEnvironment: getMediaEnvironment(),
|
|
74
|
+
mediaRegion: getMediaRegion()
|
|
66
75
|
}
|
|
67
76
|
});
|
|
68
77
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import { filterFeatureFlagNames } from '@atlaskit/media-common';
|
|
2
1
|
import { fireMediaCardEvent, getRenderSucceededEventPayload, getRenderErrorEventPayload, getRenderFailedFileStatusPayload, getCopiedFilePayload, getRenderCommencedEventPayload, getRenderPreviewableCardPayload } from '../../utils/analytics';
|
|
3
|
-
export var getRelevantFeatureFlagNames = function getRelevantFeatureFlagNames() {
|
|
4
|
-
return filterFeatureFlagNames({
|
|
5
|
-
newCardExperience: true,
|
|
6
|
-
captions: true,
|
|
7
|
-
timestampOnVideo: true,
|
|
8
|
-
observedWidth: true,
|
|
9
|
-
mediaInline: false,
|
|
10
|
-
folderUploads: false
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
2
|
export var fireOperationalEvent = function fireOperationalEvent(createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error) {
|
|
14
3
|
var fireEvent = function fireEvent(payload) {
|
|
15
4
|
return fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
@@ -32,9 +32,9 @@ import { getRequestedDimensions } from '../../utils/getDataURIDimension';
|
|
|
32
32
|
import { getCardPreview, getCardPreviewFromCache, removeCardPreviewFromCache, getFilePreviewFromFileState, shouldResolvePreview, getSSRCardPreview, isLocalPreview, isSSRPreview, isSSRClientPreview, isSSRDataPreview, fetchAndCacheRemotePreview } from './getCardPreview';
|
|
33
33
|
import { getFileDetails } from '../../utils/metadata';
|
|
34
34
|
import { InlinePlayer } from '../inlinePlayer';
|
|
35
|
-
import { getFileAttributes, extractErrorInfo } from '../../utils/analytics';
|
|
35
|
+
import { getFileAttributes, extractErrorInfo, LOGGED_FEATURE_FLAGS } from '../../utils/analytics';
|
|
36
36
|
import { isLocalPreviewError, MediaCardError, ensureMediaCardError, ImageLoadError } from '../../errors';
|
|
37
|
-
import { fireOperationalEvent as _fireOperationalEvent, fireCommencedEvent as _fireCommencedEvent,
|
|
37
|
+
import { fireOperationalEvent as _fireOperationalEvent, fireCommencedEvent as _fireCommencedEvent, fireCopiedEvent, fireScreenEvent } from './cardAnalytics';
|
|
38
38
|
import getDocument from '../../utils/document';
|
|
39
39
|
import { StoreSSRDataScript, getSSRData } from '../../utils/globalScope';
|
|
40
40
|
import { getCardStateFromFileState, createStateUpdater } from './cardState';
|
|
@@ -63,6 +63,11 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
63
63
|
|
|
64
64
|
_defineProperty(_assertThisInitialized(_this), "hasBeenMounted", false);
|
|
65
65
|
|
|
66
|
+
_defineProperty(_assertThisInitialized(_this), "fileStateFlags", {
|
|
67
|
+
wasStatusUploading: false,
|
|
68
|
+
wasStatusProcessing: false
|
|
69
|
+
});
|
|
70
|
+
|
|
66
71
|
_defineProperty(_assertThisInitialized(_this), "viewportPreAnchorRef", /*#__PURE__*/createRef());
|
|
67
72
|
|
|
68
73
|
_defineProperty(_assertThisInitialized(_this), "viewportPostAnchorRef", /*#__PURE__*/createRef());
|
|
@@ -450,7 +455,8 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
450
455
|
dimensions = _this$props7.dimensions,
|
|
451
456
|
selected = _this$props7.selected,
|
|
452
457
|
testId = _this$props7.testId,
|
|
453
|
-
originalDimensions = _this$props7.originalDimensions
|
|
458
|
+
originalDimensions = _this$props7.originalDimensions,
|
|
459
|
+
onFullscreenChange = _this$props7.onFullscreenChange;
|
|
454
460
|
var _this$state = _this.state,
|
|
455
461
|
shouldAutoplay = _this$state.shouldAutoplay,
|
|
456
462
|
cardPreview = _this$state.cardPreview;
|
|
@@ -460,6 +466,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
460
466
|
originalDimensions: originalDimensions,
|
|
461
467
|
identifier: identifier,
|
|
462
468
|
autoplay: !!shouldAutoplay,
|
|
469
|
+
onFullscreenChange: onFullscreenChange,
|
|
463
470
|
onError: _this.onInlinePlayerError,
|
|
464
471
|
onClick: _this.onClick,
|
|
465
472
|
selected: selected,
|
|
@@ -800,6 +807,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
800
807
|
var isDifferent = isDifferentIdentifier(prevIdentifier, identifier);
|
|
801
808
|
var turnedVisible = !prevIsCardVisible && isCardVisible;
|
|
802
809
|
var isNewMediaClient = prevMediaClient !== mediaClient;
|
|
810
|
+
this.updateFileStateFlag(fileState);
|
|
803
811
|
|
|
804
812
|
if (isExternalImageIdentifier(identifier) && isDifferent) {
|
|
805
813
|
this.fireCommencedEvent();
|
|
@@ -875,6 +883,21 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
875
883
|
this.fireCommencedEvent();
|
|
876
884
|
this.subscribeInternalFile(identifier);
|
|
877
885
|
}
|
|
886
|
+
}, {
|
|
887
|
+
key: "updateFileStateFlag",
|
|
888
|
+
value: function updateFileStateFlag(fileState) {
|
|
889
|
+
if (!fileState) {
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
var status = fileState.status;
|
|
894
|
+
|
|
895
|
+
if (status === 'processing') {
|
|
896
|
+
this.fileStateFlags.wasStatusProcessing = true;
|
|
897
|
+
} else if (status === 'uploading') {
|
|
898
|
+
this.fileStateFlags.wasStatusUploading = true;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
878
901
|
}, {
|
|
879
902
|
key: "subscribeInternalFile",
|
|
880
903
|
value: function subscribeInternalFile(identifier) {
|
|
@@ -942,7 +965,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
942
965
|
error = _this$state7.error;
|
|
943
966
|
var createAnalyticsEvent = this.props.createAnalyticsEvent;
|
|
944
967
|
createAnalyticsEvent && _fireOperationalEvent(createAnalyticsEvent, status, this.fileAttributes, this.getPerformanceAttributes(), this.ssrReliability, error);
|
|
945
|
-
completeUfoExperience(this.internalOccurrenceKey, status, this.fileAttributes, this.ssrReliability, error);
|
|
968
|
+
completeUfoExperience(this.internalOccurrenceKey, status, this.fileAttributes, this.fileStateFlags, this.ssrReliability, error);
|
|
946
969
|
}
|
|
947
970
|
}, {
|
|
948
971
|
key: "fireCommencedEvent",
|
|
@@ -1015,7 +1038,7 @@ export var Card = withMediaAnalyticsContext({
|
|
|
1015
1038
|
componentName: 'mediaCard',
|
|
1016
1039
|
component: 'mediaCard'
|
|
1017
1040
|
}, {
|
|
1018
|
-
filterFeatureFlags:
|
|
1041
|
+
filterFeatureFlags: LOGGED_FEATURE_FLAGS
|
|
1019
1042
|
})(withAnalyticsEvents()(injectIntl(CardBase, {
|
|
1020
1043
|
enforceContext: false
|
|
1021
1044
|
})));
|
|
@@ -45,7 +45,6 @@ import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUn
|
|
|
45
45
|
import { isRateLimitedError, isPollingError } from '@atlaskit/media-client';
|
|
46
46
|
import { newFileExperienceClassName } from './card/cardConstants';
|
|
47
47
|
import { isUploadError } from '../errors';
|
|
48
|
-
import { MediaCardCursor } from '../types';
|
|
49
48
|
|
|
50
49
|
/**
|
|
51
50
|
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
@@ -259,7 +258,6 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
259
258
|
});
|
|
260
259
|
|
|
261
260
|
case 'processing':
|
|
262
|
-
case 'loading-preview':
|
|
263
261
|
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
264
262
|
iconMessage: !didImageRender && !isZeroSize ? /*#__PURE__*/React.createElement(CreatingPreview, {
|
|
265
263
|
disableAnimation: disableAnimation
|
|
@@ -309,6 +307,7 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
309
307
|
iconMessage: iconMessage
|
|
310
308
|
});
|
|
311
309
|
|
|
310
|
+
case 'loading-preview':
|
|
312
311
|
case 'loading':
|
|
313
312
|
default:
|
|
314
313
|
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
@@ -589,8 +588,7 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
589
588
|
}(React.Component);
|
|
590
589
|
|
|
591
590
|
_defineProperty(CardViewBase, "defaultProps", {
|
|
592
|
-
appearance: 'auto'
|
|
593
|
-
mediaCardCursor: MediaCardCursor.NoAction
|
|
591
|
+
appearance: 'auto'
|
|
594
592
|
});
|
|
595
593
|
|
|
596
594
|
export var CardView = withAnalyticsEvents({
|
|
@@ -303,7 +303,8 @@ export var InlinePlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
303
303
|
identifier = _this$props4.identifier,
|
|
304
304
|
forwardRef = _this$props4.forwardRef,
|
|
305
305
|
autoplay = _this$props4.autoplay,
|
|
306
|
-
cardPreview = _this$props4.cardPreview
|
|
306
|
+
cardPreview = _this$props4.cardPreview,
|
|
307
|
+
onFullscreenChange = _this$props4.onFullscreenChange;
|
|
307
308
|
var _this$state = this.state,
|
|
308
309
|
fileSrc = _this$state.fileSrc,
|
|
309
310
|
isUploading = _this$state.isUploading,
|
|
@@ -327,6 +328,7 @@ export var InlinePlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
327
328
|
return /*#__PURE__*/React.createElement(CustomMediaPlayer, {
|
|
328
329
|
type: "video",
|
|
329
330
|
src: fileSrc,
|
|
331
|
+
onFullscreenChange: onFullscreenChange,
|
|
330
332
|
fileId: identifier.id,
|
|
331
333
|
isAutoPlay: autoplay,
|
|
332
334
|
isHDAvailable: false,
|
|
@@ -62,7 +62,7 @@ var getWrapperShadow = function getWrapperShadow(disableOverlay, selected) {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
var getCursorStyle = function getCursorStyle(cursor) {
|
|
65
|
-
return "cursor: ".concat(cursor, ";");
|
|
65
|
+
return !!cursor ? "cursor: ".concat(cursor, ";") : '';
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
var getClickablePlayButtonStyles = function getClickablePlayButtonStyles(isPlayButtonClickable) {
|
|
@@ -20,7 +20,7 @@ var HEX_REGEX = /^#[0-9A-F]{6}$/i;
|
|
|
20
20
|
export var TitleBoxWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref) {
|
|
21
21
|
var breakpoint = _ref.breakpoint,
|
|
22
22
|
titleBoxBgColor = _ref.titleBoxBgColor;
|
|
23
|
-
return "\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ".concat(rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 0.8), ";\n color: inherit;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ").concat(generateResponsiveStyles(breakpoint), "\n ");
|
|
23
|
+
return "\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ".concat(rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 0.8), ";\n color: inherit;\n cursor: inherit;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ").concat(generateResponsiveStyles(breakpoint), "\n ");
|
|
24
24
|
});
|
|
25
25
|
TitleBoxWrapper.displayName = 'TitleBoxWrapper';
|
|
26
26
|
var infoStyles = "\n white-space: nowrap;\n overflow: hidden;\n";
|
package/dist/esm/types.js
CHANGED
|
@@ -5,9 +5,20 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { getMediaClientErrorReason, isRequestError } from '@atlaskit/media-client';
|
|
8
|
-
import { ANALYTICS_MEDIA_CHANNEL } from '@atlaskit/media-common';
|
|
8
|
+
import { ANALYTICS_MEDIA_CHANNEL, filterFeatureFlagNames, filterFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
9
9
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
10
10
|
import { isMediaCardError } from '../errors';
|
|
11
|
+
var relevantFlags = {
|
|
12
|
+
newCardExperience: true,
|
|
13
|
+
captions: true,
|
|
14
|
+
timestampOnVideo: true,
|
|
15
|
+
observedWidth: true,
|
|
16
|
+
mediaInline: false,
|
|
17
|
+
folderUploads: false,
|
|
18
|
+
mediaUploadApiV2: false
|
|
19
|
+
};
|
|
20
|
+
export var LOGGED_FEATURE_FLAGS = filterFeatureFlagNames(relevantFlags);
|
|
21
|
+
export var LOGGED_FEATURE_FLAG_KEYS = filterFeatureFlagKeysAllProducts(relevantFlags);
|
|
11
22
|
export var getFileAttributes = function getFileAttributes(metadata, fileStatus) {
|
|
12
23
|
return {
|
|
13
24
|
fileMediatype: metadata.mediaType,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { MediaCardCursor } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* When the returned value is undefined, we'd expect the media card to take the parent's cursor style.
|
|
5
|
+
*/
|
|
2
6
|
export var getMediaCardCursor = function getMediaCardCursor(useInlinePlayer, useMediaViewer, isErrorStatus, hasCardPreview, mediaType) {
|
|
3
7
|
// If error status or no action is requested = NoAction
|
|
4
8
|
if (isErrorStatus || !useInlinePlayer && !useMediaViewer) {
|
|
5
|
-
return
|
|
9
|
+
return;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
12
|
if (!mediaType && (useInlinePlayer || useInlinePlayer && useMediaViewer)) {
|
|
@@ -15,5 +19,5 @@ export var getMediaCardCursor = function getMediaCardCursor(useInlinePlayer, use
|
|
|
15
19
|
return MediaCardCursor.Action;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
return
|
|
22
|
+
return;
|
|
19
23
|
};
|
|
@@ -6,7 +6,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo';
|
|
8
8
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
9
|
-
import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
9
|
+
import { extractErrorInfo, getRenderErrorRequestMetadata, LOGGED_FEATURE_FLAG_KEYS } from './analytics';
|
|
10
|
+
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
10
11
|
var concurrentExperience;
|
|
11
12
|
|
|
12
13
|
var getExperience = function getExperience(id) {
|
|
@@ -16,7 +17,8 @@ var getExperience = function getExperience(id) {
|
|
|
16
17
|
component: 'media-card'
|
|
17
18
|
},
|
|
18
19
|
type: ExperienceTypes.Experience,
|
|
19
|
-
performanceType: ExperiencePerformanceTypes.InlineResult
|
|
20
|
+
performanceType: ExperiencePerformanceTypes.InlineResult,
|
|
21
|
+
featureFlags: LOGGED_FEATURE_FLAG_KEYS
|
|
20
22
|
};
|
|
21
23
|
concurrentExperience = new ConcurrentExperience('media-card-render', inlineExperience);
|
|
22
24
|
}
|
|
@@ -27,12 +29,13 @@ var getExperience = function getExperience(id) {
|
|
|
27
29
|
export var startUfoExperience = function startUfoExperience(id) {
|
|
28
30
|
getExperience(id).start();
|
|
29
31
|
};
|
|
30
|
-
export var completeUfoExperience = function completeUfoExperience(id, status, fileAttributes, ssrReliability, error) {
|
|
32
|
+
export var completeUfoExperience = function completeUfoExperience(id, status, fileAttributes, fileStateFlags, ssrReliability, error) {
|
|
31
33
|
switch (status) {
|
|
32
34
|
case 'complete':
|
|
33
35
|
succeedUfoExperience(id, {
|
|
34
36
|
fileAttributes: fileAttributes,
|
|
35
|
-
ssrReliability: ssrReliability
|
|
37
|
+
ssrReliability: ssrReliability,
|
|
38
|
+
fileStateFlags: fileStateFlags
|
|
36
39
|
});
|
|
37
40
|
break;
|
|
38
41
|
|
|
@@ -40,7 +43,8 @@ export var completeUfoExperience = function completeUfoExperience(id, status, fi
|
|
|
40
43
|
failUfoExperience(id, {
|
|
41
44
|
fileAttributes: fileAttributes,
|
|
42
45
|
failReason: 'failed-processing',
|
|
43
|
-
ssrReliability: ssrReliability
|
|
46
|
+
ssrReliability: ssrReliability,
|
|
47
|
+
fileStateFlags: fileStateFlags
|
|
44
48
|
});
|
|
45
49
|
break;
|
|
46
50
|
|
|
@@ -49,7 +53,8 @@ export var completeUfoExperience = function completeUfoExperience(id, status, fi
|
|
|
49
53
|
fileAttributes: fileAttributes
|
|
50
54
|
}, extractErrorInfo(error)), {}, {
|
|
51
55
|
request: getRenderErrorRequestMetadata(error),
|
|
52
|
-
ssrReliability: ssrReliability
|
|
56
|
+
ssrReliability: ssrReliability,
|
|
57
|
+
fileStateFlags: fileStateFlags
|
|
53
58
|
}));
|
|
54
59
|
break;
|
|
55
60
|
}
|
|
@@ -59,7 +64,9 @@ var succeedUfoExperience = function succeedUfoExperience(id, properties) {
|
|
|
59
64
|
getExperience(id).success({
|
|
60
65
|
metadata: _objectSpread(_objectSpread({}, properties), {}, {
|
|
61
66
|
packageName: packageName,
|
|
62
|
-
packageVersion: packageVersion
|
|
67
|
+
packageVersion: packageVersion,
|
|
68
|
+
mediaEnvironment: getMediaEnvironment(),
|
|
69
|
+
mediaRegion: getMediaRegion()
|
|
63
70
|
})
|
|
64
71
|
});
|
|
65
72
|
};
|
|
@@ -68,7 +75,9 @@ var failUfoExperience = function failUfoExperience(id, properties) {
|
|
|
68
75
|
getExperience(id).failure({
|
|
69
76
|
metadata: _objectSpread(_objectSpread({}, properties), {}, {
|
|
70
77
|
packageName: packageName,
|
|
71
|
-
packageVersion: packageVersion
|
|
78
|
+
packageVersion: packageVersion,
|
|
79
|
+
mediaEnvironment: getMediaEnvironment(),
|
|
80
|
+
mediaRegion: getMediaRegion()
|
|
72
81
|
})
|
|
73
82
|
});
|
|
74
83
|
};
|
package/dist/esm/version.json
CHANGED
package/dist/types/errors.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare class SsrPreviewError extends MediaCardError {
|
|
|
24
24
|
readonly secondaryError?: Error | undefined;
|
|
25
25
|
constructor(primaryReason: SsrPreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
26
26
|
}
|
|
27
|
-
export declare const getImageLoadPrimaryReason: (source?: "
|
|
27
|
+
export declare const getImageLoadPrimaryReason: (source?: import("./types").CardPreviewSource | undefined) => ImageLoadPrimaryReason;
|
|
28
28
|
export declare class ImageLoadError extends MediaCardError {
|
|
29
29
|
constructor(source?: CardPreview['source']);
|
|
30
30
|
}
|
|
@@ -11,13 +11,13 @@ export interface OverlayProps {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const TickBox: ComponentClass<HTMLAttributes<{}> & OverlayProps>;
|
|
13
13
|
export declare const Overlay: ComponentClass<HTMLAttributes<{}> & OverlayProps>;
|
|
14
|
-
export declare const ErrorLine: import("styled-components").StyledComponentClass<import("react").
|
|
15
|
-
export declare const LeftColumn: import("styled-components").StyledComponentClass<import("react").
|
|
16
|
-
export declare const TopRow: import("styled-components").StyledComponentClass<import("react").
|
|
17
|
-
export declare const BottomRow: import("styled-components").StyledComponentClass<import("react").
|
|
18
|
-
export declare const RightColumn: import("styled-components").StyledComponentClass<import("react").
|
|
19
|
-
export declare const ErrorMessage: import("styled-components").StyledComponentClass<import("react").
|
|
20
|
-
export declare const AltWrapper: import("styled-components").StyledComponentClass<import("react").
|
|
21
|
-
export declare const TitleWrapper: import("styled-components").StyledComponentClass<
|
|
22
|
-
export declare const Subtitle: import("styled-components").StyledComponentClass<import("react").
|
|
23
|
-
export declare const Metadata: import("styled-components").StyledComponentClass<import("react").
|
|
14
|
+
export declare const ErrorLine: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const LeftColumn: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const TopRow: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const BottomRow: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const RightColumn: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|
|
19
|
+
export declare const ErrorMessage: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|
|
20
|
+
export declare const AltWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|
|
21
|
+
export declare const TitleWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & (import("@atlaskit/theme").ThemeProps | undefined), any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & (import("@atlaskit/theme").ThemeProps | undefined)>;
|
|
22
|
+
export declare const Subtitle: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|
|
23
|
+
export declare const Metadata: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>;
|