@atlaskit/media-card 74.5.0 → 74.5.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 +12 -0
- package/dist/cjs/card/actions.js +0 -5
- package/dist/cjs/card/card.js +126 -260
- package/dist/cjs/card/cardAnalytics.js +0 -18
- package/dist/cjs/card/cardImageView/cardImageViewWrapper.js +7 -16
- package/dist/cjs/card/cardImageView/cardOverlay/cardOverlayComponents.js +3 -15
- package/dist/cjs/card/cardImageView/cardOverlay/index.js +20 -52
- package/dist/cjs/card/cardImageView/cardOverlay/styles.js +1 -19
- package/dist/cjs/card/cardImageView/cardViewWrapper.js +7 -10
- package/dist/cjs/card/cardImageView/fileCardImageView.js +66 -111
- package/dist/cjs/card/cardImageView/index.js +0 -1
- package/dist/cjs/card/cardImageView/styles.js +0 -14
- package/dist/cjs/card/cardLoader.js +3 -20
- package/dist/cjs/card/cardState.js +0 -9
- package/dist/cjs/card/cardView.js +105 -198
- package/dist/cjs/card/getCardPreview/cache.js +0 -12
- package/dist/cjs/card/getCardPreview/filePreviewStatus.js +8 -16
- package/dist/cjs/card/getCardPreview/helpers.js +0 -39
- package/dist/cjs/card/getCardPreview/imageRefetchingAnalytics.js +0 -8
- package/dist/cjs/card/getCardPreview/index.js +16 -85
- package/dist/cjs/card/getCardStatus.js +5 -24
- package/dist/cjs/card/index.js +0 -2
- package/dist/cjs/card/inlinePlayer.js +19 -102
- package/dist/cjs/card/inlinePlayerLazy.js +0 -11
- package/dist/cjs/card/inlinePlayerWrapper.js +5 -8
- package/dist/cjs/card/media-card-analytics-error-boundary.js +6 -34
- package/dist/cjs/card/styles/animations.js +0 -5
- package/dist/cjs/card/styles/getSelectedBorderStyle.js +0 -4
- package/dist/cjs/card/styles/index.js +0 -14
- package/dist/cjs/card/styles/mixins.js +0 -11
- package/dist/cjs/card/styles/styles.js +4 -20
- package/dist/cjs/card/ui/actionsBar/actionsBar.js +2 -20
- package/dist/cjs/card/ui/actionsBar/actionsBarWrapper.js +1 -4
- package/dist/cjs/card/ui/actionsBar/styles.js +0 -8
- package/dist/cjs/card/ui/blanket/blanket.js +1 -4
- package/dist/cjs/card/ui/blanket/styles.js +0 -9
- package/dist/cjs/card/ui/common.js +0 -8
- package/dist/cjs/card/ui/iconMessage/iconMessageWrapper.js +2 -5
- package/dist/cjs/card/ui/iconMessage/index.js +4 -22
- package/dist/cjs/card/ui/iconMessage/styles.js +1 -10
- package/dist/cjs/card/ui/iconWrapper/iconWrapper.js +2 -5
- package/dist/cjs/card/ui/iconWrapper/styles.js +3 -11
- package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +8 -21
- package/dist/cjs/card/ui/loadingRateLimited/styles.js +1 -10
- package/dist/cjs/card/ui/newFileExperience/newFileExperienceWrapper.js +14 -19
- package/dist/cjs/card/ui/newFileExperience/styles.js +10 -26
- package/dist/cjs/card/ui/playButton/playButton.js +0 -7
- package/dist/cjs/card/ui/playButton/playButtonBackground.js +1 -4
- package/dist/cjs/card/ui/playButton/playButtonWrapper.js +1 -4
- package/dist/cjs/card/ui/playButton/styles.js +0 -6
- package/dist/cjs/card/ui/progressBar/progressBar.js +6 -14
- package/dist/cjs/card/ui/progressBar/styledBar.js +4 -7
- package/dist/cjs/card/ui/progressBar/styles.js +4 -18
- package/dist/cjs/card/ui/styles.js +12 -46
- package/dist/cjs/card/ui/tickBox/styles.js +0 -11
- package/dist/cjs/card/ui/tickBox/tickBox.js +0 -6
- package/dist/cjs/card/ui/tickBox/tickBoxWrapper.js +1 -4
- package/dist/cjs/card/ui/titleBox/failedTitleBox.js +2 -11
- package/dist/cjs/card/ui/titleBox/styles.js +4 -19
- package/dist/cjs/card/ui/titleBox/titleBox.js +9 -21
- package/dist/cjs/card/ui/titleBox/titleBoxComponents.js +2 -14
- package/dist/cjs/card/ui/unhandledErrorCard/index.js +6 -36
- package/dist/cjs/classnames.js +0 -1
- package/dist/cjs/errors.js +7 -66
- package/dist/cjs/index.js +0 -8
- package/dist/cjs/inline/index.js +0 -2
- package/dist/cjs/inline/loader.js +2 -43
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +4 -29
- package/dist/cjs/inline/mediaInlineCard.js +21 -57
- package/dist/cjs/types.js +0 -2
- package/dist/cjs/utils/analytics.js +0 -49
- package/dist/cjs/utils/breakpoint.js +0 -10
- package/dist/cjs/utils/cardActions/cardActionButton.js +1 -4
- package/dist/cjs/utils/cardActions/cardActionIconButton.js +7 -29
- package/dist/cjs/utils/cardActions/cardActionsDropdownMenu.js +6 -35
- package/dist/cjs/utils/cardActions/cardActionsView.js +7 -34
- package/dist/cjs/utils/cardActions/index.js +0 -4
- package/dist/cjs/utils/cardActions/styles.js +0 -13
- package/dist/cjs/utils/cardDimensions.js +5 -22
- package/dist/cjs/utils/containsPixelUnit.js +0 -2
- package/dist/cjs/utils/dimensionComparer.js +0 -8
- package/dist/cjs/utils/document.js +0 -4
- package/dist/cjs/utils/errorIcon/index.js +0 -18
- package/dist/cjs/utils/errorIcon/styles.js +0 -5
- package/dist/cjs/utils/fileIcon/index.js +3 -21
- package/dist/cjs/utils/fileIcon/styles.js +0 -6
- package/dist/cjs/utils/generateUniqueId.js +0 -2
- package/dist/cjs/utils/getCSSUnitValue.js +0 -1
- package/dist/cjs/utils/getDataURIDimension.js +0 -13
- package/dist/cjs/utils/getElementDimension.js +0 -2
- package/dist/cjs/utils/getErrorMessage.js +0 -6
- package/dist/cjs/utils/getMediaCardCursor.js +1 -6
- package/dist/cjs/utils/globalScope/getSSRData.js +0 -5
- package/dist/cjs/utils/globalScope/globalScope.js +8 -25
- package/dist/cjs/utils/globalScope/index.js +0 -2
- package/dist/cjs/utils/index.js +0 -12
- package/dist/cjs/utils/isRetina.js +0 -1
- package/dist/cjs/utils/isValidPercentageUnit.js +0 -2
- package/dist/cjs/utils/lightCards/cardError.js +0 -21
- package/dist/cjs/utils/lightCards/cardLoading.js +3 -27
- package/dist/cjs/utils/lightCards/getDimensionsWithDefault.js +0 -2
- package/dist/cjs/utils/lightCards/lightCardWrappers.js +1 -9
- package/dist/cjs/utils/lightCards/styles.js +1 -13
- package/dist/cjs/utils/metadata.js +0 -7
- package/dist/cjs/utils/objectURLCache.js +0 -22
- package/dist/cjs/utils/preventClickThrough.js +0 -5
- package/dist/cjs/utils/printScript.js +0 -10
- package/dist/cjs/utils/progressBar/index.js +0 -17
- package/dist/cjs/utils/progressBar/styles.js +0 -6
- package/dist/cjs/utils/resizeModeToMediaImageProps.js +0 -1
- package/dist/cjs/utils/shouldDisplayImageThumbnail.js +0 -5
- package/dist/cjs/utils/ufoExperiences.js +1 -21
- package/dist/cjs/utils/videoSnapshot.js +2 -11
- package/dist/cjs/utils/viewportDetector.js +5 -24
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/actions.js +2 -1
- package/dist/es2019/card/card.js +26 -121
- package/dist/es2019/card/cardAnalytics.js +0 -5
- package/dist/es2019/card/cardImageView/cardOverlay/index.js +2 -16
- package/dist/es2019/card/cardImageView/cardOverlay/styles.js +1 -2
- package/dist/es2019/card/cardImageView/fileCardImageView.js +3 -36
- package/dist/es2019/card/cardImageView/styles.js +0 -3
- package/dist/es2019/card/cardLoader.js +3 -14
- package/dist/es2019/card/cardState.js +1 -2
- package/dist/es2019/card/cardView.js +24 -68
- package/dist/es2019/card/getCardPreview/cache.js +0 -4
- package/dist/es2019/card/getCardPreview/filePreviewStatus.js +8 -5
- package/dist/es2019/card/getCardPreview/helpers.js +0 -9
- package/dist/es2019/card/getCardPreview/imageRefetchingAnalytics.js +0 -3
- package/dist/es2019/card/getCardPreview/index.js +16 -30
- package/dist/es2019/card/getCardStatus.js +2 -15
- package/dist/es2019/card/inlinePlayer.js +2 -35
- package/dist/es2019/card/inlinePlayerLazy.js +1 -2
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -15
- package/dist/es2019/card/styles/getSelectedBorderStyle.js +1 -1
- package/dist/es2019/card/styles/styles.js +0 -3
- package/dist/es2019/card/ui/actionsBar/actionsBar.js +0 -3
- package/dist/es2019/card/ui/common.js +0 -2
- package/dist/es2019/card/ui/iconMessage/styles.js +0 -2
- package/dist/es2019/card/ui/iconWrapper/styles.js +2 -2
- package/dist/es2019/card/ui/imageRenderer/imageRenderer.js +0 -3
- package/dist/es2019/card/ui/progressBar/styles.js +1 -3
- package/dist/es2019/card/ui/styles.js +3 -4
- package/dist/es2019/card/ui/titleBox/styles.js +2 -3
- package/dist/es2019/card/ui/unhandledErrorCard/index.js +0 -8
- package/dist/es2019/errors.js +8 -17
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/inline/loader.js +1 -18
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +1 -12
- package/dist/es2019/inline/mediaInlineCard.js +0 -15
- package/dist/es2019/types.js +1 -1
- package/dist/es2019/utils/analytics.js +0 -3
- package/dist/es2019/utils/breakpoint.js +0 -4
- package/dist/es2019/utils/cardActions/cardActionIconButton.js +3 -5
- package/dist/es2019/utils/cardActions/cardActionsDropdownMenu.js +0 -5
- package/dist/es2019/utils/cardActions/cardActionsView.js +0 -10
- package/dist/es2019/utils/cardActions/styles.js +0 -3
- package/dist/es2019/utils/cardDimensions.js +7 -14
- package/dist/es2019/utils/dimensionComparer.js +0 -3
- package/dist/es2019/utils/document.js +0 -2
- package/dist/es2019/utils/errorIcon/index.js +0 -3
- package/dist/es2019/utils/fileIcon/index.js +0 -1
- package/dist/es2019/utils/getDataURIDimension.js +0 -4
- package/dist/es2019/utils/getMediaCardCursor.js +1 -4
- package/dist/es2019/utils/globalScope/getSSRData.js +0 -2
- package/dist/es2019/utils/globalScope/globalScope.js +3 -10
- package/dist/es2019/utils/lightCards/cardError.js +0 -3
- package/dist/es2019/utils/lightCards/cardLoading.js +0 -3
- package/dist/es2019/utils/lightCards/lightCardWrappers.js +0 -1
- package/dist/es2019/utils/metadata.js +0 -5
- package/dist/es2019/utils/objectURLCache.js +0 -10
- package/dist/es2019/utils/printScript.js +0 -3
- package/dist/es2019/utils/progressBar/index.js +0 -2
- package/dist/es2019/utils/shouldDisplayImageThumbnail.js +0 -2
- package/dist/es2019/utils/ufoExperiences.js +5 -10
- package/dist/es2019/utils/videoSnapshot.js +2 -4
- package/dist/es2019/utils/viewportDetector.js +0 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/actions.js +0 -3
- package/dist/esm/card/card.js +126 -254
- package/dist/esm/card/cardAnalytics.js +0 -6
- package/dist/esm/card/cardImageView/cardImageViewWrapper.js +6 -6
- package/dist/esm/card/cardImageView/cardOverlay/cardOverlayComponents.js +2 -2
- package/dist/esm/card/cardImageView/cardOverlay/index.js +22 -37
- package/dist/esm/card/cardImageView/cardOverlay/styles.js +2 -6
- package/dist/esm/card/cardImageView/cardViewWrapper.js +6 -6
- package/dist/esm/card/cardImageView/fileCardImageView.js +66 -104
- package/dist/esm/card/cardImageView/styles.js +0 -5
- package/dist/esm/card/cardLoader.js +6 -17
- package/dist/esm/card/cardState.js +1 -2
- package/dist/esm/card/cardView.js +105 -171
- package/dist/esm/card/getCardPreview/cache.js +0 -7
- package/dist/esm/card/getCardPreview/filePreviewStatus.js +11 -11
- package/dist/esm/card/getCardPreview/helpers.js +0 -28
- package/dist/esm/card/getCardPreview/imageRefetchingAnalytics.js +0 -3
- package/dist/esm/card/getCardPreview/index.js +16 -53
- package/dist/esm/card/getCardStatus.js +5 -20
- package/dist/esm/card/inlinePlayer.js +19 -85
- package/dist/esm/card/inlinePlayerLazy.js +1 -5
- package/dist/esm/card/inlinePlayerWrapper.js +4 -4
- package/dist/esm/card/media-card-analytics-error-boundary.js +6 -28
- package/dist/esm/card/styles/animations.js +0 -2
- package/dist/esm/card/styles/getSelectedBorderStyle.js +1 -1
- package/dist/esm/card/styles/index.js +0 -2
- package/dist/esm/card/styles/styles.js +4 -9
- package/dist/esm/card/ui/actionsBar/actionsBar.js +2 -12
- package/dist/esm/card/ui/actionsBar/styles.js +0 -2
- package/dist/esm/card/ui/blanket/styles.js +0 -2
- package/dist/esm/card/ui/common.js +0 -4
- package/dist/esm/card/ui/iconMessage/iconMessageWrapper.js +1 -1
- package/dist/esm/card/ui/iconMessage/index.js +4 -4
- package/dist/esm/card/ui/iconMessage/styles.js +1 -5
- package/dist/esm/card/ui/iconWrapper/iconWrapper.js +1 -1
- package/dist/esm/card/ui/iconWrapper/styles.js +3 -5
- package/dist/esm/card/ui/imageRenderer/imageRenderer.js +8 -11
- package/dist/esm/card/ui/loadingRateLimited/styles.js +1 -3
- package/dist/esm/card/ui/newFileExperience/newFileExperienceWrapper.js +13 -13
- package/dist/esm/card/ui/newFileExperience/styles.js +10 -12
- package/dist/esm/card/ui/playButton/styles.js +0 -2
- package/dist/esm/card/ui/progressBar/progressBar.js +6 -6
- package/dist/esm/card/ui/progressBar/styledBar.js +3 -3
- package/dist/esm/card/ui/progressBar/styles.js +4 -8
- package/dist/esm/card/ui/styles.js +12 -20
- package/dist/esm/card/ui/tickBox/styles.js +0 -2
- package/dist/esm/card/ui/titleBox/failedTitleBox.js +2 -2
- package/dist/esm/card/ui/titleBox/styles.js +4 -7
- package/dist/esm/card/ui/titleBox/titleBox.js +9 -11
- package/dist/esm/card/ui/titleBox/titleBoxComponents.js +1 -1
- package/dist/esm/card/ui/unhandledErrorCard/index.js +6 -24
- package/dist/esm/errors.js +8 -40
- package/dist/esm/index.js +1 -0
- package/dist/esm/inline/loader.js +3 -40
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +4 -23
- package/dist/esm/inline/mediaInlineCard.js +21 -40
- package/dist/esm/types.js +1 -1
- package/dist/esm/utils/analytics.js +0 -6
- package/dist/esm/utils/breakpoint.js +0 -5
- package/dist/esm/utils/cardActions/cardActionIconButton.js +7 -18
- package/dist/esm/utils/cardActions/cardActionsDropdownMenu.js +6 -19
- package/dist/esm/utils/cardActions/cardActionsView.js +7 -22
- package/dist/esm/utils/cardActions/styles.js +0 -5
- package/dist/esm/utils/cardDimensions.js +7 -14
- package/dist/esm/utils/dimensionComparer.js +0 -3
- package/dist/esm/utils/document.js +0 -2
- package/dist/esm/utils/errorIcon/index.js +0 -9
- package/dist/esm/utils/errorIcon/styles.js +0 -2
- package/dist/esm/utils/fileIcon/index.js +3 -11
- package/dist/esm/utils/fileIcon/styles.js +0 -2
- package/dist/esm/utils/getDataURIDimension.js +0 -4
- package/dist/esm/utils/getMediaCardCursor.js +1 -4
- package/dist/esm/utils/globalScope/getSSRData.js +0 -2
- package/dist/esm/utils/globalScope/globalScope.js +8 -15
- package/dist/esm/utils/lightCards/cardError.js +0 -9
- package/dist/esm/utils/lightCards/cardLoading.js +3 -13
- package/dist/esm/utils/lightCards/lightCardWrappers.js +0 -1
- package/dist/esm/utils/lightCards/styles.js +1 -3
- package/dist/esm/utils/metadata.js +0 -5
- package/dist/esm/utils/objectURLCache.js +0 -15
- package/dist/esm/utils/printScript.js +0 -5
- package/dist/esm/utils/progressBar/index.js +0 -9
- package/dist/esm/utils/progressBar/styles.js +0 -2
- package/dist/esm/utils/shouldDisplayImageThumbnail.js +0 -2
- package/dist/esm/utils/ufoExperiences.js +1 -12
- package/dist/esm/utils/videoSnapshot.js +2 -6
- package/dist/esm/utils/viewportDetector.js +5 -16
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { isErrorFileState, isFileIdentifier } from '@atlaskit/media-client';
|
|
2
|
-
|
|
3
2
|
var getProcessingStatusFromFileState = function getProcessingStatusFromFileState(status) {
|
|
4
3
|
switch (status) {
|
|
5
4
|
case 'processed':
|
|
6
5
|
return 'succeeded';
|
|
7
|
-
|
|
8
6
|
case 'processing':
|
|
9
7
|
return 'running';
|
|
10
|
-
|
|
11
8
|
case 'failed-processing':
|
|
12
9
|
return 'failed';
|
|
13
10
|
}
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
var getFileDetailsFromFileState = function getFileDetailsFromFileState(state) {
|
|
17
13
|
return {
|
|
18
14
|
id: state.id,
|
|
@@ -24,7 +20,6 @@ var getFileDetailsFromFileState = function getFileDetailsFromFileState(state) {
|
|
|
24
20
|
processingStatus: getProcessingStatusFromFileState(state.status)
|
|
25
21
|
};
|
|
26
22
|
};
|
|
27
|
-
|
|
28
23
|
export var getFileDetails = function getFileDetails(identifier, fileState) {
|
|
29
24
|
return isFileIdentifier(identifier) ? fileState && !isErrorFileState(fileState) ? getFileDetailsFromFileState(fileState) : {
|
|
30
25
|
id: identifier.id
|
|
@@ -4,35 +4,25 @@ import _get from "@babel/runtime/helpers/get";
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
|
|
8
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
|
|
10
8
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
|
|
12
9
|
import { LRUMap } from 'lru_map';
|
|
13
10
|
import { EventEmitter2 } from 'eventemitter2';
|
|
14
11
|
export var PREVIEW_CACHE_LRU_SIZE = 50;
|
|
15
|
-
|
|
16
12
|
var ExtendedLRUCache = /*#__PURE__*/function (_LRUMap) {
|
|
17
13
|
_inherits(ExtendedLRUCache, _LRUMap);
|
|
18
|
-
|
|
19
14
|
var _super = _createSuper(ExtendedLRUCache);
|
|
20
|
-
|
|
21
15
|
function ExtendedLRUCache(limit) {
|
|
22
16
|
var _this;
|
|
23
|
-
|
|
24
17
|
_classCallCheck(this, ExtendedLRUCache);
|
|
25
|
-
|
|
26
18
|
_this = _super.call(this, limit);
|
|
27
19
|
_this.eventEmitter = new EventEmitter2();
|
|
28
20
|
return _this;
|
|
29
21
|
}
|
|
30
|
-
|
|
31
22
|
_createClass(ExtendedLRUCache, [{
|
|
32
23
|
key: "shift",
|
|
33
24
|
value: function shift() {
|
|
34
25
|
var entry = _get(_getPrototypeOf(ExtendedLRUCache.prototype), "shift", this).call(this);
|
|
35
|
-
|
|
36
26
|
this.eventEmitter.emit('shift', entry);
|
|
37
27
|
return entry;
|
|
38
28
|
}
|
|
@@ -42,14 +32,11 @@ var ExtendedLRUCache = /*#__PURE__*/function (_LRUMap) {
|
|
|
42
32
|
this.eventEmitter.on(event, callback);
|
|
43
33
|
}
|
|
44
34
|
}]);
|
|
45
|
-
|
|
46
35
|
return ExtendedLRUCache;
|
|
47
36
|
}(LRUMap);
|
|
48
|
-
|
|
49
37
|
export var ObjectURLCache = /*#__PURE__*/function () {
|
|
50
38
|
function ObjectURLCache(size) {
|
|
51
39
|
_classCallCheck(this, ObjectURLCache);
|
|
52
|
-
|
|
53
40
|
this.cache = new ExtendedLRUCache(size);
|
|
54
41
|
this.cache.on('shift', function (entry) {
|
|
55
42
|
if (entry && entry[1].dataURI) {
|
|
@@ -57,7 +44,6 @@ export var ObjectURLCache = /*#__PURE__*/function () {
|
|
|
57
44
|
}
|
|
58
45
|
});
|
|
59
46
|
}
|
|
60
|
-
|
|
61
47
|
_createClass(ObjectURLCache, [{
|
|
62
48
|
key: "has",
|
|
63
49
|
value: function has(key) {
|
|
@@ -80,7 +66,6 @@ export var ObjectURLCache = /*#__PURE__*/function () {
|
|
|
80
66
|
removed && URL.revokeObjectURL(removed.dataURI);
|
|
81
67
|
}
|
|
82
68
|
}]);
|
|
83
|
-
|
|
84
69
|
return ObjectURLCache;
|
|
85
70
|
}();
|
|
86
71
|
export var createObjectURLCache = function createObjectURLCache() {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
-
|
|
3
2
|
var printParam = function printParam(param) {
|
|
4
3
|
if (typeof param === 'string') {
|
|
5
4
|
return "'".concat(param, "'");
|
|
@@ -8,21 +7,17 @@ var printParam = function printParam(param) {
|
|
|
8
7
|
} else if (param === undefined) {
|
|
9
8
|
return 'undefined';
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
return param;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
var printParams = function printParams(args) {
|
|
16
13
|
return args.map(function (arg) {
|
|
17
14
|
return printParam(arg);
|
|
18
15
|
}).join(',');
|
|
19
16
|
};
|
|
20
|
-
|
|
21
17
|
export var printFunctionCall = function printFunctionCall(fn) {
|
|
22
18
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
23
19
|
args[_key - 1] = arguments[_key];
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
return "(".concat(fn.toString(), ")(").concat(printParams(args), ");");
|
|
27
22
|
};
|
|
28
23
|
export var printScript = function printScript(statements) {
|
|
@@ -3,33 +3,25 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
7
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
|
|
9
7
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
|
|
11
8
|
/**@jsx jsx */
|
|
12
9
|
import { jsx } from '@emotion/react';
|
|
13
10
|
import { Component } from 'react';
|
|
14
11
|
import { progressWrapperStyles } from './styles';
|
|
15
12
|
export var ProgressBar = /*#__PURE__*/function (_Component) {
|
|
16
13
|
_inherits(ProgressBar, _Component);
|
|
17
|
-
|
|
18
14
|
var _super = _createSuper(ProgressBar);
|
|
19
|
-
|
|
20
15
|
function ProgressBar() {
|
|
21
16
|
_classCallCheck(this, ProgressBar);
|
|
22
|
-
|
|
23
17
|
return _super.apply(this, arguments);
|
|
24
18
|
}
|
|
25
|
-
|
|
26
19
|
_createClass(ProgressBar, [{
|
|
27
20
|
key: "render",
|
|
28
21
|
value: function render() {
|
|
29
22
|
if (typeof this.props.progress !== 'number') {
|
|
30
23
|
return null;
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
var progress = Math.min(1, Math.max(0, this.props.progress));
|
|
34
26
|
var progressBarStyle = {
|
|
35
27
|
width: "".concat(progress * 100, "%")
|
|
@@ -42,6 +34,5 @@ export var ProgressBar = /*#__PURE__*/function (_Component) {
|
|
|
42
34
|
}));
|
|
43
35
|
}
|
|
44
36
|
}]);
|
|
45
|
-
|
|
46
37
|
return ProgressBar;
|
|
47
38
|
}(Component);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
6
4
|
import { css } from '@emotion/react';
|
|
7
5
|
import { borderRadius } from '@atlaskit/media-ui';
|
|
@@ -3,10 +3,8 @@ export var shouldDisplayImageThumbnail = function shouldDisplayImageThumbnail(ca
|
|
|
3
3
|
if (mediaType === 'doc' || !mimeType && mediaItemType === 'file') {
|
|
4
4
|
return false;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
6
|
if (dataURI) {
|
|
8
7
|
return mediaItemType === 'external-image' || mimeType && isMimeTypeSupportedByBrowser(mimeType) || cardStatus === 'complete' || cardStatus === 'loading-preview';
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return false;
|
|
12
10
|
};
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
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
|
-
|
|
7
4
|
import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo';
|
|
8
5
|
import { extractErrorInfo, getRenderErrorRequestMetadata, LOGGED_FEATURE_FLAG_KEYS } from './analytics';
|
|
9
6
|
import { MediaCardError } from '../errors';
|
|
10
7
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
11
8
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "74.5.
|
|
9
|
+
var packageVersion = "74.5.2";
|
|
13
10
|
var concurrentExperience;
|
|
14
|
-
|
|
15
11
|
var getExperience = function getExperience(id) {
|
|
16
12
|
if (!concurrentExperience) {
|
|
17
13
|
var inlineExperience = {
|
|
@@ -24,16 +20,13 @@ var getExperience = function getExperience(id) {
|
|
|
24
20
|
};
|
|
25
21
|
concurrentExperience = new ConcurrentExperience('media-card-render', inlineExperience);
|
|
26
22
|
}
|
|
27
|
-
|
|
28
23
|
return concurrentExperience.getInstance(id);
|
|
29
24
|
};
|
|
30
|
-
|
|
31
25
|
export var startUfoExperience = function startUfoExperience(id) {
|
|
32
26
|
getExperience(id).start();
|
|
33
27
|
};
|
|
34
28
|
export var completeUfoExperience = function completeUfoExperience(id, status, fileAttributes, fileStateFlags, ssrReliability) {
|
|
35
29
|
var error = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : new MediaCardError('missing-error-data');
|
|
36
|
-
|
|
37
30
|
switch (status) {
|
|
38
31
|
case 'complete':
|
|
39
32
|
succeedUfoExperience(id, {
|
|
@@ -42,7 +35,6 @@ export var completeUfoExperience = function completeUfoExperience(id, status, fi
|
|
|
42
35
|
fileStateFlags: fileStateFlags
|
|
43
36
|
});
|
|
44
37
|
break;
|
|
45
|
-
|
|
46
38
|
case 'failed-processing':
|
|
47
39
|
failUfoExperience(id, {
|
|
48
40
|
fileAttributes: fileAttributes,
|
|
@@ -51,7 +43,6 @@ export var completeUfoExperience = function completeUfoExperience(id, status, fi
|
|
|
51
43
|
fileStateFlags: fileStateFlags
|
|
52
44
|
});
|
|
53
45
|
break;
|
|
54
|
-
|
|
55
46
|
case 'error':
|
|
56
47
|
failUfoExperience(id, _objectSpread(_objectSpread({
|
|
57
48
|
fileAttributes: fileAttributes
|
|
@@ -63,7 +54,6 @@ export var completeUfoExperience = function completeUfoExperience(id, status, fi
|
|
|
63
54
|
break;
|
|
64
55
|
}
|
|
65
56
|
};
|
|
66
|
-
|
|
67
57
|
var succeedUfoExperience = function succeedUfoExperience(id, properties) {
|
|
68
58
|
getExperience(id).success({
|
|
69
59
|
metadata: _objectSpread(_objectSpread({}, properties), {}, {
|
|
@@ -74,7 +64,6 @@ var succeedUfoExperience = function succeedUfoExperience(id, properties) {
|
|
|
74
64
|
})
|
|
75
65
|
});
|
|
76
66
|
};
|
|
77
|
-
|
|
78
67
|
var failUfoExperience = function failUfoExperience(id, properties) {
|
|
79
68
|
getExperience(id).failure({
|
|
80
69
|
metadata: _objectSpread(_objectSpread({}, properties), {}, {
|
|
@@ -18,21 +18,19 @@ export var takeSnapshot = /*#__PURE__*/function () {
|
|
|
18
18
|
video.addEventListener('timeupdate', function timeUpdateHandler() {
|
|
19
19
|
video.removeEventListener('timeupdate', timeUpdateHandler);
|
|
20
20
|
video.pause();
|
|
21
|
-
URL.revokeObjectURL(url);
|
|
21
|
+
URL.revokeObjectURL(url);
|
|
22
|
+
//create canvas to draw our first frame on.
|
|
22
23
|
|
|
23
24
|
if (!video.videoWidth && !video.videoHeight) {
|
|
24
25
|
return reject(new Error('error retrieving video dimensions'));
|
|
25
26
|
}
|
|
26
|
-
|
|
27
27
|
var canvas = document.createElement('canvas');
|
|
28
28
|
canvas.width = video.videoWidth;
|
|
29
29
|
canvas.height = video.videoHeight;
|
|
30
30
|
var context = canvas.getContext('2d');
|
|
31
|
-
|
|
32
31
|
if (!context) {
|
|
33
32
|
return reject(new Error('error creating canvas context'));
|
|
34
33
|
}
|
|
35
|
-
|
|
36
34
|
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
37
35
|
var dataURL = canvas.toDataURL('image/jpeg', 0.85);
|
|
38
36
|
resolve(dataURL);
|
|
@@ -42,7 +40,6 @@ export var takeSnapshot = /*#__PURE__*/function () {
|
|
|
42
40
|
URL.revokeObjectURL(url);
|
|
43
41
|
});
|
|
44
42
|
}));
|
|
45
|
-
|
|
46
43
|
case 1:
|
|
47
44
|
case "end":
|
|
48
45
|
return _context.stop();
|
|
@@ -50,7 +47,6 @@ export var takeSnapshot = /*#__PURE__*/function () {
|
|
|
50
47
|
}
|
|
51
48
|
}, _callee);
|
|
52
49
|
}));
|
|
53
|
-
|
|
54
50
|
return function takeSnapshot(_x) {
|
|
55
51
|
return _ref.apply(this, arguments);
|
|
56
52
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
|
-
|
|
3
2
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
|
|
5
3
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
6
|
-
|
|
7
4
|
import React, { useEffect } from 'react';
|
|
8
5
|
import getDocument from './document';
|
|
9
6
|
var ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900; //px
|
|
@@ -11,12 +8,10 @@ var ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900; //px
|
|
|
11
8
|
var createIntersectionObserverCallback = function createIntersectionObserverCallback(onVisible) {
|
|
12
9
|
return function (entries, observer) {
|
|
13
10
|
var _iterator = _createForOfIteratorHelper(entries),
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
_step;
|
|
16
12
|
try {
|
|
17
13
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
18
14
|
var entry = _step.value;
|
|
19
|
-
|
|
20
15
|
if (entry.isIntersecting) {
|
|
21
16
|
onVisible();
|
|
22
17
|
observer.disconnect();
|
|
@@ -30,14 +25,12 @@ var createIntersectionObserverCallback = function createIntersectionObserverCall
|
|
|
30
25
|
}
|
|
31
26
|
};
|
|
32
27
|
};
|
|
33
|
-
|
|
34
28
|
var ViewportObserver = function ViewportObserver(_ref) {
|
|
35
29
|
var onVisible = _ref.onVisible,
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
cardEl = _ref.cardEl,
|
|
31
|
+
children = _ref.children;
|
|
38
32
|
useEffect(function () {
|
|
39
33
|
var intersectionObserver;
|
|
40
|
-
|
|
41
34
|
try {
|
|
42
35
|
intersectionObserver = new IntersectionObserver(createIntersectionObserverCallback(onVisible), {
|
|
43
36
|
root: getDocument(),
|
|
@@ -49,7 +42,6 @@ var ViewportObserver = function ViewportObserver(_ref) {
|
|
|
49
42
|
rootMargin: "".concat(ABS_VIEWPORT_ANCHOR_OFFSET_TOP, "px")
|
|
50
43
|
});
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
cardEl && intersectionObserver.observe(cardEl);
|
|
54
46
|
return function () {
|
|
55
47
|
intersectionObserver.disconnect();
|
|
@@ -57,16 +49,13 @@ var ViewportObserver = function ViewportObserver(_ref) {
|
|
|
57
49
|
}, [cardEl, onVisible]);
|
|
58
50
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
59
51
|
};
|
|
60
|
-
|
|
61
52
|
export var ViewportDetector = function ViewportDetector(_ref2) {
|
|
62
53
|
var cardEl = _ref2.cardEl,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
onVisible = _ref2.onVisible,
|
|
55
|
+
children = _ref2.children;
|
|
66
56
|
if (typeof IntersectionObserver === 'undefined') {
|
|
67
57
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
68
58
|
}
|
|
69
|
-
|
|
70
59
|
return /*#__PURE__*/React.createElement(ViewportObserver, {
|
|
71
60
|
cardEl: cardEl,
|
|
72
61
|
onVisible: onVisible
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "74.5.
|
|
3
|
+
"version": "74.5.2",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/media-viewer": "^47.4.0",
|
|
39
39
|
"@atlaskit/spinner": "^15.3.0",
|
|
40
40
|
"@atlaskit/theme": "^12.2.0",
|
|
41
|
-
"@atlaskit/tokens": "^0.
|
|
41
|
+
"@atlaskit/tokens": "^1.0.0",
|
|
42
42
|
"@atlaskit/tooltip": "^17.6.0",
|
|
43
43
|
"@atlaskit/ufo": "^0.1.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|