@atlaskit/media-card 70.11.0 → 73.0.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 +104 -0
- package/dist/cjs/errors.js +78 -5
- package/dist/cjs/files/cardImageView/cardOverlay/styled.js +1 -1
- package/dist/cjs/files/cardImageView/index.js +53 -104
- package/dist/cjs/files/cardImageView/styled.js +1 -1
- package/dist/cjs/files/index.js +0 -6
- package/dist/cjs/index.js +12 -6
- package/dist/cjs/root/card/cardAnalytics.js +11 -17
- package/dist/cjs/root/card/cardLoader.js +66 -124
- package/dist/cjs/root/card/cardState.js +50 -0
- package/dist/cjs/root/card/getCardPreview/cache.js +6 -1
- package/dist/cjs/root/card/getCardPreview/filePreviewStatus.js +53 -0
- package/dist/cjs/root/card/getCardPreview/helpers.js +14 -22
- package/dist/cjs/root/card/getCardPreview/index.js +176 -102
- package/dist/cjs/root/card/getCardStatus.js +7 -1
- package/dist/cjs/root/card/index.js +361 -281
- package/dist/cjs/root/cardView.js +109 -86
- package/dist/cjs/root/index.js +9 -1
- package/dist/cjs/root/inline/loader.js +22 -21
- package/dist/cjs/root/inline/{inlineMediaCard.js → mediaInlineCard.js} +84 -26
- package/dist/cjs/root/inlinePlayer.js +4 -3
- package/dist/cjs/root/styled.js +7 -3
- package/dist/cjs/root/ui/actionsBar/styled.js +1 -1
- package/dist/cjs/root/ui/blanket/styled.js +1 -1
- package/dist/cjs/root/ui/common.js +11 -5
- package/dist/cjs/root/ui/iconMessage/index.js +16 -7
- package/dist/cjs/root/ui/iconWrapper/styled.js +1 -1
- package/dist/cjs/root/ui/imageRenderer/imageRenderer.js +34 -124
- package/dist/cjs/root/ui/loadingRateLimited/loadingRateLimited.js +6 -4
- package/dist/cjs/root/ui/loadingRateLimited/styled.js +1 -1
- package/dist/cjs/root/ui/playButton/styled.js +1 -1
- package/dist/cjs/root/ui/progressBar/progressBar.js +2 -2
- package/dist/cjs/root/ui/progressBar/styled.js +2 -4
- package/dist/cjs/root/ui/styled.js +80 -17
- package/dist/cjs/root/ui/tickBox/styled.js +1 -1
- package/dist/cjs/root/ui/titleBox/failedTitleBox.js +9 -3
- package/dist/cjs/root/ui/titleBox/styled.js +2 -4
- package/dist/cjs/root/ui/titleBox/titleBox.js +2 -2
- package/dist/cjs/styles/index.js +25 -23
- package/dist/cjs/styles/mixins.js +1 -1
- package/dist/cjs/utils/analytics.js +21 -43
- package/dist/cjs/utils/breakpoint.js +1 -1
- package/dist/cjs/utils/cardActions/cardActionsDropdownMenu.js +16 -9
- package/dist/cjs/utils/cardActions/index.js +10 -10
- package/dist/cjs/utils/cardActions/styled.js +1 -1
- package/dist/cjs/utils/cardDimensions.js +1 -1
- package/dist/cjs/utils/dimensionComparer.js +1 -1
- package/dist/cjs/utils/getErrorMessage.js +2 -2
- package/dist/cjs/utils/index.js +46 -46
- package/dist/cjs/utils/lightCards/styled.js +1 -1
- package/dist/cjs/utils/metadata.js +11 -3
- package/dist/cjs/utils/objectURLCache.js +7 -1
- package/dist/cjs/utils/shouldDisplayImageThumbnail.js +1 -1
- package/dist/cjs/utils/viewportDetector.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/errors.js +42 -2
- package/dist/es2019/files/cardImageView/index.js +8 -61
- package/dist/es2019/files/index.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/root/card/cardAnalytics.js +7 -15
- package/dist/es2019/root/card/cardLoader.js +47 -53
- package/dist/es2019/root/card/cardState.js +26 -0
- package/dist/es2019/root/card/getCardPreview/cache.js +5 -0
- package/dist/es2019/root/card/getCardPreview/filePreviewStatus.js +38 -0
- package/dist/es2019/root/card/getCardPreview/helpers.js +2 -12
- package/dist/es2019/root/card/getCardPreview/index.js +112 -79
- package/dist/es2019/root/card/getCardStatus.js +1 -0
- package/dist/es2019/root/card/index.js +285 -190
- package/dist/es2019/root/cardView.js +93 -68
- package/dist/es2019/root/index.js +2 -1
- package/dist/es2019/root/inline/loader.js +16 -15
- package/dist/es2019/root/inline/mediaInlineCard.js +143 -0
- package/dist/es2019/root/inlinePlayer.js +3 -2
- package/dist/es2019/root/styled.js +2 -1
- package/dist/es2019/root/ui/common.js +7 -1
- package/dist/es2019/root/ui/iconMessage/index.js +8 -5
- package/dist/es2019/root/ui/imageRenderer/imageRenderer.js +25 -88
- package/dist/es2019/root/ui/loadingRateLimited/loadingRateLimited.js +4 -3
- package/dist/es2019/root/ui/progressBar/progressBar.js +1 -1
- package/dist/es2019/root/ui/progressBar/styled.js +1 -2
- package/dist/es2019/root/ui/styled.js +64 -3
- package/dist/es2019/root/ui/titleBox/failedTitleBox.js +6 -3
- package/dist/es2019/root/ui/titleBox/styled.js +1 -2
- package/dist/es2019/root/ui/titleBox/titleBox.js +1 -1
- package/dist/es2019/utils/analytics.js +15 -34
- package/dist/es2019/utils/cardActions/cardActionsDropdownMenu.js +8 -4
- package/dist/es2019/utils/dimensionComparer.js +1 -1
- package/dist/es2019/utils/getErrorMessage.js +1 -1
- package/dist/es2019/utils/metadata.js +12 -4
- package/dist/es2019/utils/objectURLCache.js +5 -0
- package/dist/es2019/utils/shouldDisplayImageThumbnail.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/errors.js +60 -1
- package/dist/esm/files/cardImageView/index.js +51 -102
- package/dist/esm/files/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/root/card/cardAnalytics.js +7 -16
- package/dist/esm/root/card/cardLoader.js +66 -126
- package/dist/esm/root/card/cardState.js +32 -0
- package/dist/esm/root/card/getCardPreview/cache.js +6 -0
- package/dist/esm/root/card/getCardPreview/filePreviewStatus.js +38 -0
- package/dist/esm/root/card/getCardPreview/helpers.js +13 -21
- package/dist/esm/root/card/getCardPreview/index.js +142 -95
- package/dist/esm/root/card/getCardStatus.js +3 -0
- package/dist/esm/root/card/index.js +370 -284
- package/dist/esm/root/cardView.js +109 -84
- package/dist/esm/root/index.js +2 -1
- package/dist/esm/root/inline/loader.js +23 -22
- package/dist/esm/root/inline/mediaInlineCard.js +156 -0
- package/dist/esm/root/inlinePlayer.js +3 -2
- package/dist/esm/root/styled.js +3 -2
- package/dist/esm/root/ui/common.js +7 -1
- package/dist/esm/root/ui/iconMessage/index.js +10 -5
- package/dist/esm/root/ui/imageRenderer/imageRenderer.js +27 -118
- package/dist/esm/root/ui/loadingRateLimited/loadingRateLimited.js +4 -3
- package/dist/esm/root/ui/progressBar/progressBar.js +1 -1
- package/dist/esm/root/ui/progressBar/styled.js +1 -2
- package/dist/esm/root/ui/styled.js +61 -13
- package/dist/esm/root/ui/titleBox/failedTitleBox.js +7 -3
- package/dist/esm/root/ui/titleBox/styled.js +1 -2
- package/dist/esm/root/ui/titleBox/titleBox.js +1 -1
- package/dist/esm/utils/analytics.js +16 -35
- package/dist/esm/utils/cardActions/cardActionsDropdownMenu.js +16 -9
- package/dist/esm/utils/dimensionComparer.js +1 -1
- package/dist/esm/utils/getErrorMessage.js +1 -1
- package/dist/esm/utils/metadata.js +12 -4
- package/dist/esm/utils/objectURLCache.js +6 -0
- package/dist/esm/utils/shouldDisplayImageThumbnail.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/errors.d.ts +15 -1
- package/dist/types/files/cardImageView/index.d.ts +4 -13
- package/dist/types/files/cardImageView/styled.d.ts +1 -1
- package/dist/types/files/index.d.ts +1 -1
- package/dist/types/index.d.ts +7 -5
- package/dist/types/root/card/cardAnalytics.d.ts +2 -6
- package/dist/types/root/card/cardLoader.d.ts +5 -19
- package/dist/types/root/card/cardState.d.ts +5 -0
- package/dist/types/root/card/getCardPreview/cache.d.ts +3 -1
- package/dist/types/root/card/getCardPreview/filePreviewStatus.d.ts +5 -0
- package/dist/types/root/card/getCardPreview/helpers.d.ts +3 -4
- package/dist/types/root/card/getCardPreview/index.d.ts +24 -14
- package/dist/types/root/card/getCardStatus.d.ts +1 -0
- package/dist/types/root/card/index.d.ts +19 -18
- package/dist/types/root/cardView.d.ts +13 -8
- package/dist/types/root/index.d.ts +1 -0
- package/dist/types/root/inline/loader.d.ts +8 -8
- package/dist/types/root/inline/{inlineMediaCard.d.ts → mediaInlineCard.d.ts} +4 -6
- package/dist/types/root/inlinePlayer.d.ts +1 -1
- package/dist/types/root/styled.d.ts +1 -0
- package/dist/types/root/ui/common.d.ts +4 -1
- package/dist/types/root/ui/iconMessage/index.d.ts +4 -3
- package/dist/types/root/ui/iconWrapper/styled.d.ts +1 -1
- package/dist/types/root/ui/imageRenderer/imageRenderer.d.ts +5 -15
- package/dist/types/root/ui/loadingRateLimited/loadingRateLimited.d.ts +2 -1
- package/dist/types/root/ui/loadingRateLimited/styled.d.ts +1 -1
- package/dist/types/root/ui/playButton/playButton.d.ts +1 -0
- package/dist/types/root/ui/progressBar/progressBar.d.ts +2 -1
- package/dist/types/root/ui/progressBar/styled.d.ts +1 -1
- package/dist/types/root/ui/styled.d.ts +10 -3
- package/dist/types/root/ui/tickBox/tickBox.d.ts +1 -0
- package/dist/types/root/ui/titleBox/failedTitleBox.d.ts +3 -1
- package/dist/types/root/ui/titleBox/styled.d.ts +1 -1
- package/dist/types/root/ui/titleBox/titleBox.d.ts +2 -10
- package/dist/types/styles/mixins.d.ts +1 -1
- package/dist/types/types.d.ts +7 -1
- package/dist/types/utils/analytics.d.ts +14 -15
- package/dist/types/utils/cardDimensions.d.ts +4 -4
- package/dist/types/utils/dimensionComparer.d.ts +1 -1
- package/dist/types/utils/getErrorMessage.d.ts +1 -0
- package/dist/types/utils/metadata.d.ts +2 -2
- package/dist/types/utils/objectURLCache.d.ts +2 -1
- package/example-helpers/developmentUseMessage.tsx +14 -0
- package/example-helpers/index.tsx +55 -4
- package/example-helpers/selectableCard.tsx +2 -1
- package/package.json +20 -16
- package/dist/cjs/root/card/cardSSRView.js +0 -99
- package/dist/cjs/root/card/getCardPreview/types.js +0 -5
- package/dist/cjs/root/ui/Breakpoint.js +0 -13
- package/dist/cjs/root/ui/styledSSR.js +0 -108
- package/dist/cjs/utils/fileAttributesContext.js +0 -40
- package/dist/es2019/root/card/cardSSRView.js +0 -79
- package/dist/es2019/root/card/getCardPreview/types.js +0 -1
- package/dist/es2019/root/inline/inlineMediaCard.js +0 -92
- package/dist/es2019/root/ui/Breakpoint.js +0 -6
- package/dist/es2019/root/ui/styledSSR.js +0 -93
- package/dist/es2019/utils/fileAttributesContext.js +0 -19
- package/dist/esm/root/card/cardSSRView.js +0 -78
- package/dist/esm/root/card/getCardPreview/types.js +0 -1
- package/dist/esm/root/inline/inlineMediaCard.js +0 -100
- package/dist/esm/root/ui/Breakpoint.js +0 -6
- package/dist/esm/root/ui/styledSSR.js +0 -76
- package/dist/esm/utils/fileAttributesContext.js +0 -18
- package/dist/types/root/card/cardSSRView.d.ts +0 -12
- package/dist/types/root/card/getCardPreview/types.d.ts +0 -5
- package/dist/types/root/ui/Breakpoint.d.ts +0 -4
- package/dist/types/root/ui/styledSSR.d.ts +0 -16
- package/dist/types/utils/fileAttributesContext.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,109 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 73.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`47f58da5946`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47f58da5946) - ED-13322, ED-13324, ED-13326, ED-13323, ED-13204: Upgrade and support react-intl@^5.18.1 including breaking API changes, types and tests in atlassian-frontend packages
|
|
8
|
+
|
|
9
|
+
What changed: Upgraded our react-intl support from ^2.6.0 to ^5.18.1. This means editor packages now rely on consumers installing ^5.18.1, otherwise editor usage of react-intl will mismatch with actual installed react-intl APIs.
|
|
10
|
+
Why change was made: As part of a coordinated upgrade effort across AF packages, as react-intl v2 is quite dated.
|
|
11
|
+
How consumer should update their code: Ensure react-intl ^5.18.1 is installed in consuming applications.
|
|
12
|
+
|
|
13
|
+
Upgrade guide: To consume atlassian-frontend packages that use react-intl5 setup a second provider for the new version, using an npm alias
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
"react-intl": "^2.6.0",
|
|
17
|
+
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { IntlProvider } from 'react-intl';
|
|
22
|
+
import { IntlProvider as IntlNextProvider } from 'react-intl-next';
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<IntlProvider
|
|
26
|
+
key={locale}
|
|
27
|
+
data-test-language={locale}
|
|
28
|
+
locale={locale}
|
|
29
|
+
defaultLocale={DEFAULT_LOCALE}
|
|
30
|
+
messages={messages}
|
|
31
|
+
>
|
|
32
|
+
<IntlNextProvider
|
|
33
|
+
key={locale}
|
|
34
|
+
data-test-language={locale}
|
|
35
|
+
locale={locale}
|
|
36
|
+
defaultLocale={DEFAULT_LOCALE}
|
|
37
|
+
messages={messages}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</IntlNextProvider>
|
|
41
|
+
</IntlProvider>
|
|
42
|
+
);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
|
|
49
|
+
## 72.1.0
|
|
50
|
+
|
|
51
|
+
### Minor Changes
|
|
52
|
+
|
|
53
|
+
- [`1724e1b8277`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1724e1b8277) - Added SSR capabilities to Media Card
|
|
54
|
+
- [`ca519a86b1d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ca519a86b1d) - Add new prop forceSyncDisplay in MediaImage to provide an option of always showing images.
|
|
55
|
+
Enable MediaCard to turn on forceSyncDisplay when server side rendering is enabled.
|
|
56
|
+
- [`ac4846d0f3f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ac4846d0f3f) - Added native lazy load support
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- [`fc70978492a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc70978492a) - Using type for SSR prop to reduce dependency on media-common
|
|
61
|
+
- [`dc1f9d42903`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc1f9d42903) - Fixed error message logic
|
|
62
|
+
- [`27c61b8cdd8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/27c61b8cdd8) - revert CardSSRView component
|
|
63
|
+
- [`12bfc09a21e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12bfc09a21e) - Fixing internal prop calls for testId and removing references to the old DropdownMenuStateless export when using the new default export.
|
|
64
|
+
- [`2b24fcc59f2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2b24fcc59f2) - Removed Code Viewer and Zip Previews Feature Flags
|
|
65
|
+
- [`bccde8a4127`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bccde8a4127) - Update dependency of dropdown menu to the lite mode version. Update all usages to cater to the new API. The padding within dropdown menu items is 8px more, which makes the menu look bigger.
|
|
66
|
+
- [`3a56ce8792b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3a56ce8792b) - [ux] Show selected for mediaInline in other states
|
|
67
|
+
- [`f461edcfd05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f461edcfd05) - Update CardLoader to use react-loadable
|
|
68
|
+
Add SSR feature prop to be passed in renderer and media card
|
|
69
|
+
- Updated dependencies
|
|
70
|
+
|
|
71
|
+
## 72.0.0
|
|
72
|
+
|
|
73
|
+
### Major Changes
|
|
74
|
+
|
|
75
|
+
- [`b3606652fa1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b3606652fa1) - [ux] Editor integration for Media Inline component
|
|
76
|
+
|
|
77
|
+
### Minor Changes
|
|
78
|
+
|
|
79
|
+
- [`269ee940b87`](https://bitbucket.org/atlassian/atlassian-frontend/commits/269ee940b87) - redesign error UI on new media card experience
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- [`a81fdad4b7b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a81fdad4b7b) - Refactored the internal status logic based on file processing status and preview render outcome
|
|
84
|
+
- [`b51fc0a9062`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b51fc0a9062) - Refactored internal helpers to match common type definitions from Media Client
|
|
85
|
+
- [`ebad8bc86e5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ebad8bc86e5) - Moved analytics from image renderer to root component
|
|
86
|
+
- [`fe9ced0cd70`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fe9ced0cd70) - Removed feature flags for polling settings
|
|
87
|
+
- Updated dependencies
|
|
88
|
+
|
|
89
|
+
## 71.0.0
|
|
90
|
+
|
|
91
|
+
### Major Changes
|
|
92
|
+
|
|
93
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - [ux] Updated and refreshed media inline component
|
|
94
|
+
|
|
95
|
+
### Minor Changes
|
|
96
|
+
|
|
97
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - [ux] Skip forward and backward buttons are added to inline media player
|
|
98
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Added analytics event to track total impressions of successfully rendered mediacards
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Adding lazy loading as the default for the SSR media card
|
|
103
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - fix modification for media card flow example
|
|
104
|
+
- [`f3547c79d81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f3547c79d81) - Updated in-code comment
|
|
105
|
+
- Updated dependencies
|
|
106
|
+
|
|
3
107
|
## 70.11.0
|
|
4
108
|
|
|
5
109
|
### Minor Changes
|
package/dist/cjs/errors.js
CHANGED
|
@@ -5,8 +5,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.getImageLoadPrimaryReason = exports.ensureMediaCardError = exports.SsrPreviewError = exports.RemotePreviewError = exports.MediaCardError = exports.LocalPreviewError = exports.ImageLoadError = void 0;
|
|
9
|
+
exports.isImageLoadError = isImageLoadError;
|
|
10
|
+
exports.isLocalPreviewError = void 0;
|
|
8
11
|
exports.isMediaCardError = isMediaCardError;
|
|
9
|
-
exports.
|
|
12
|
+
exports.isUploadError = exports.isUnsupportedLocalPreviewError = exports.isRemotePreviewError = void 0;
|
|
10
13
|
|
|
11
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
15
|
|
|
@@ -91,6 +94,66 @@ var RemotePreviewError = /*#__PURE__*/function (_MediaCardError2) {
|
|
|
91
94
|
|
|
92
95
|
exports.RemotePreviewError = RemotePreviewError;
|
|
93
96
|
|
|
97
|
+
var SsrPreviewError = /*#__PURE__*/function (_MediaCardError3) {
|
|
98
|
+
(0, _inherits2.default)(SsrPreviewError, _MediaCardError3);
|
|
99
|
+
|
|
100
|
+
var _super4 = _createSuper(SsrPreviewError);
|
|
101
|
+
|
|
102
|
+
function SsrPreviewError(primaryReason, secondaryError) {
|
|
103
|
+
var _this4;
|
|
104
|
+
|
|
105
|
+
(0, _classCallCheck2.default)(this, SsrPreviewError);
|
|
106
|
+
_this4 = _super4.call(this, primaryReason, secondaryError);
|
|
107
|
+
_this4.primaryReason = primaryReason;
|
|
108
|
+
_this4.secondaryError = secondaryError;
|
|
109
|
+
return _this4;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return SsrPreviewError;
|
|
113
|
+
}(MediaCardError);
|
|
114
|
+
|
|
115
|
+
exports.SsrPreviewError = SsrPreviewError;
|
|
116
|
+
|
|
117
|
+
var getImageLoadPrimaryReason = function getImageLoadPrimaryReason(source) {
|
|
118
|
+
switch (source) {
|
|
119
|
+
case 'cache-remote':
|
|
120
|
+
return 'cache-remote-uri';
|
|
121
|
+
|
|
122
|
+
case 'cache-local':
|
|
123
|
+
return 'cache-local-uri';
|
|
124
|
+
|
|
125
|
+
case 'external':
|
|
126
|
+
return 'external-uri';
|
|
127
|
+
|
|
128
|
+
case 'local':
|
|
129
|
+
return 'local-uri';
|
|
130
|
+
|
|
131
|
+
case 'remote':
|
|
132
|
+
return 'remote-uri';
|
|
133
|
+
// This fail reason will come from a bug, most likely.
|
|
134
|
+
|
|
135
|
+
default:
|
|
136
|
+
return "unknown-uri";
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
exports.getImageLoadPrimaryReason = getImageLoadPrimaryReason;
|
|
141
|
+
|
|
142
|
+
var ImageLoadError = /*#__PURE__*/function (_MediaCardError4) {
|
|
143
|
+
(0, _inherits2.default)(ImageLoadError, _MediaCardError4);
|
|
144
|
+
|
|
145
|
+
var _super5 = _createSuper(ImageLoadError);
|
|
146
|
+
|
|
147
|
+
function ImageLoadError(source) {
|
|
148
|
+
(0, _classCallCheck2.default)(this, ImageLoadError);
|
|
149
|
+
return _super5.call(this, getImageLoadPrimaryReason(source));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return ImageLoadError;
|
|
153
|
+
}(MediaCardError);
|
|
154
|
+
|
|
155
|
+
exports.ImageLoadError = ImageLoadError;
|
|
156
|
+
|
|
94
157
|
function isMediaCardError(err) {
|
|
95
158
|
return err instanceof MediaCardError;
|
|
96
159
|
}
|
|
@@ -109,14 +172,24 @@ exports.isRemotePreviewError = isRemotePreviewError;
|
|
|
109
172
|
|
|
110
173
|
var isUnsupportedLocalPreviewError = function isUnsupportedLocalPreviewError(err) {
|
|
111
174
|
return isMediaCardError(err) && err.primaryReason === 'local-preview-unsupported';
|
|
112
|
-
};
|
|
113
|
-
// We can use this helper to ensure that the error handled is the type of MediaCardError if unsure
|
|
114
|
-
|
|
175
|
+
};
|
|
115
176
|
|
|
116
177
|
exports.isUnsupportedLocalPreviewError = isUnsupportedLocalPreviewError;
|
|
117
178
|
|
|
179
|
+
function isImageLoadError(err) {
|
|
180
|
+
return err instanceof ImageLoadError;
|
|
181
|
+
} // In a try/catch statement, the error caught is the type of any.
|
|
182
|
+
// We can use this helper to ensure that the error handled is the type of MediaCardError if unsure
|
|
183
|
+
|
|
184
|
+
|
|
118
185
|
var ensureMediaCardError = function ensureMediaCardError(primaryReason, error) {
|
|
119
186
|
return isMediaCardError(error) ? error : new MediaCardError(primaryReason, error);
|
|
120
187
|
};
|
|
121
188
|
|
|
122
|
-
exports.ensureMediaCardError = ensureMediaCardError;
|
|
189
|
+
exports.ensureMediaCardError = ensureMediaCardError;
|
|
190
|
+
|
|
191
|
+
var isUploadError = function isUploadError(error) {
|
|
192
|
+
return error && error.primaryReason === 'upload';
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
exports.isUploadError = isUploadError;
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.TopRow = exports.TitleWrapper = exports.TickBox = exports.Subtitle = exports.RightColumn = exports.Overlay = exports.Metadata = exports.LeftColumn = exports.ErrorMessage = exports.ErrorLine = exports.BottomRow = exports.AltWrapper = void 0;
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.fileCardImageViewSelector = exports.fileCardImageViewSelectedSelector = exports.FileCardImageView = void 0;
|
|
11
11
|
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
|
|
@@ -41,12 +41,6 @@ var _progressBar = require("../../utils/progressBar");
|
|
|
41
41
|
|
|
42
42
|
var _cardActions = _interopRequireDefault(require("../../utils/cardActions"));
|
|
43
43
|
|
|
44
|
-
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
45
|
-
|
|
46
|
-
var _analytics = require("../../utils/analytics");
|
|
47
|
-
|
|
48
|
-
var _fileAttributesContext = require("../../utils/fileAttributesContext");
|
|
49
|
-
|
|
50
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
45
|
|
|
52
46
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -60,15 +54,15 @@ exports.fileCardImageViewSelector = fileCardImageViewSelector;
|
|
|
60
54
|
var fileCardImageViewSelectedSelector = 'media-file-card-view-selected';
|
|
61
55
|
exports.fileCardImageViewSelectedSelector = fileCardImageViewSelectedSelector;
|
|
62
56
|
|
|
63
|
-
var
|
|
64
|
-
(0, _inherits2.default)(
|
|
57
|
+
var FileCardImageView = /*#__PURE__*/function (_Component) {
|
|
58
|
+
(0, _inherits2.default)(FileCardImageView, _Component);
|
|
65
59
|
|
|
66
|
-
var _super = _createSuper(
|
|
60
|
+
var _super = _createSuper(FileCardImageView);
|
|
67
61
|
|
|
68
|
-
function
|
|
62
|
+
function FileCardImageView() {
|
|
69
63
|
var _this;
|
|
70
64
|
|
|
71
|
-
(0, _classCallCheck2.default)(this,
|
|
65
|
+
(0, _classCallCheck2.default)(this, FileCardImageView);
|
|
72
66
|
|
|
73
67
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
74
68
|
args[_key] = arguments[_key];
|
|
@@ -186,58 +180,18 @@ var FileCardImageViewBase = /*#__PURE__*/function (_Component) {
|
|
|
186
180
|
size: "large"
|
|
187
181
|
})));
|
|
188
182
|
});
|
|
189
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onImageLoad", function () {
|
|
190
|
-
var _this$props6 = _this.props,
|
|
191
|
-
createAnalyticsEvent = _this$props6.createAnalyticsEvent,
|
|
192
|
-
fileAttributes = _this$props6.fileAttributes,
|
|
193
|
-
timeElapsedTillCommenced = _this$props6.timeElapsedTillCommenced;
|
|
194
|
-
|
|
195
|
-
if (fileAttributes && _this.shouldFireEvent(_analytics.RenderEventAction.SUCCEEDED)) {
|
|
196
|
-
var timeElapsedTillSucceeded = performance.now();
|
|
197
|
-
var durationSinceCommenced = timeElapsedTillCommenced && timeElapsedTillSucceeded - timeElapsedTillCommenced;
|
|
198
|
-
var performanceAttributes = {
|
|
199
|
-
overall: {
|
|
200
|
-
durationSincePageStart: timeElapsedTillSucceeded,
|
|
201
|
-
durationSinceCommenced: durationSinceCommenced
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
(0, _analytics.fireMediaCardEvent)((0, _analytics.getRenderSucceededEventPayload)(fileAttributes, performanceAttributes), createAnalyticsEvent);
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onImageError", function () {
|
|
208
|
-
var fileAttributes = _this.props.fileAttributes;
|
|
209
|
-
|
|
210
|
-
if (fileAttributes && _this.shouldFireEvent(_analytics.RenderEventAction.FAILED)) {
|
|
211
|
-
var _this$props7 = _this.props,
|
|
212
|
-
createAnalyticsEvent = _this$props7.createAnalyticsEvent,
|
|
213
|
-
mediaItemType = _this$props7.mediaItemType,
|
|
214
|
-
timeElapsedTillCommenced = _this$props7.timeElapsedTillCommenced;
|
|
215
|
-
var timeElapsedTillFailed = performance.now();
|
|
216
|
-
var durationSinceCommenced = timeElapsedTillCommenced && timeElapsedTillFailed - timeElapsedTillCommenced;
|
|
217
|
-
var performanceAttributes = {
|
|
218
|
-
overall: {
|
|
219
|
-
durationSincePageStart: timeElapsedTillFailed,
|
|
220
|
-
durationSinceCommenced: durationSinceCommenced
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
if (mediaItemType === 'file') {
|
|
225
|
-
(0, _analytics.fireMediaCardEvent)((0, _analytics.getRenderFailedFileUriPayload)(fileAttributes, performanceAttributes), createAnalyticsEvent);
|
|
226
|
-
} else if (mediaItemType === 'external-image') {
|
|
227
|
-
(0, _analytics.fireMediaCardEvent)((0, _analytics.getRenderFailedExternalUriPayload)(fileAttributes, performanceAttributes), createAnalyticsEvent);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
183
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderMediaImage", function () {
|
|
232
|
-
var _this$
|
|
233
|
-
status = _this$
|
|
234
|
-
mediaItemType = _this$
|
|
235
|
-
dataURI = _this$
|
|
236
|
-
mediaType = _this$
|
|
237
|
-
mimeType = _this$
|
|
238
|
-
previewOrientation = _this$
|
|
239
|
-
onDisplayImage = _this$
|
|
240
|
-
alt = _this$
|
|
184
|
+
var _this$props6 = _this.props,
|
|
185
|
+
status = _this$props6.status,
|
|
186
|
+
mediaItemType = _this$props6.mediaItemType,
|
|
187
|
+
dataURI = _this$props6.dataURI,
|
|
188
|
+
mediaType = _this$props6.mediaType,
|
|
189
|
+
mimeType = _this$props6.mimeType,
|
|
190
|
+
previewOrientation = _this$props6.previewOrientation,
|
|
191
|
+
onDisplayImage = _this$props6.onDisplayImage,
|
|
192
|
+
alt = _this$props6.alt,
|
|
193
|
+
onImageLoad = _this$props6.onImageLoad,
|
|
194
|
+
onImageError = _this$props6.onImageError;
|
|
241
195
|
|
|
242
196
|
if (!(0, _shouldDisplayImageThumbnail.shouldDisplayImageThumbnail)(status, mediaItemType, dataURI, mediaType, mimeType)) {
|
|
243
197
|
return null;
|
|
@@ -254,19 +208,16 @@ var FileCardImageViewBase = /*#__PURE__*/function (_Component) {
|
|
|
254
208
|
crop: _this.isCropped,
|
|
255
209
|
stretch: _this.isStretched,
|
|
256
210
|
previewOrientation: previewOrientation,
|
|
257
|
-
onImageLoad:
|
|
258
|
-
onImageError:
|
|
211
|
+
onImageLoad: onImageLoad,
|
|
212
|
+
onImageError: onImageError
|
|
259
213
|
});
|
|
260
214
|
});
|
|
261
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "shouldFireEvent", function (action) {
|
|
262
|
-
return !_this.lastAnalyticsAction || _this.lastAnalyticsAction !== action;
|
|
263
|
-
});
|
|
264
215
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderProgressBar", function () {
|
|
265
|
-
var _this$
|
|
266
|
-
mediaName = _this$
|
|
267
|
-
progress = _this$
|
|
268
|
-
actions = _this$
|
|
269
|
-
status = _this$
|
|
216
|
+
var _this$props7 = _this.props,
|
|
217
|
+
mediaName = _this$props7.mediaName,
|
|
218
|
+
progress = _this$props7.progress,
|
|
219
|
+
actions = _this$props7.actions,
|
|
220
|
+
status = _this$props7.status;
|
|
270
221
|
|
|
271
222
|
if (status !== 'uploading') {
|
|
272
223
|
return null;
|
|
@@ -284,10 +235,10 @@ var FileCardImageViewBase = /*#__PURE__*/function (_Component) {
|
|
|
284
235
|
}) : null))));
|
|
285
236
|
});
|
|
286
237
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSuccessCardContents", function () {
|
|
287
|
-
var _this$
|
|
288
|
-
disableOverlay = _this$
|
|
289
|
-
selectable = _this$
|
|
290
|
-
status = _this$
|
|
238
|
+
var _this$props8 = _this.props,
|
|
239
|
+
disableOverlay = _this$props8.disableOverlay,
|
|
240
|
+
selectable = _this$props8.selectable,
|
|
241
|
+
status = _this$props8.status;
|
|
291
242
|
var overlay = null;
|
|
292
243
|
|
|
293
244
|
if (!disableOverlay) {
|
|
@@ -307,15 +258,15 @@ var FileCardImageViewBase = /*#__PURE__*/function (_Component) {
|
|
|
307
258
|
}, _this.renderMediaImage(), _this.renderProgressBar(), _this.renderPlayButton()), overlay);
|
|
308
259
|
});
|
|
309
260
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSuccessCardOverlay", function () {
|
|
310
|
-
var _this$
|
|
311
|
-
status = _this$
|
|
312
|
-
mediaName = _this$
|
|
313
|
-
mediaType = _this$
|
|
314
|
-
fileSize = _this$
|
|
315
|
-
dataURI = _this$
|
|
316
|
-
selectable = _this$
|
|
317
|
-
selected = _this$
|
|
318
|
-
actions = _this$
|
|
261
|
+
var _this$props9 = _this.props,
|
|
262
|
+
status = _this$props9.status,
|
|
263
|
+
mediaName = _this$props9.mediaName,
|
|
264
|
+
mediaType = _this$props9.mediaType,
|
|
265
|
+
fileSize = _this$props9.fileSize,
|
|
266
|
+
dataURI = _this$props9.dataURI,
|
|
267
|
+
selectable = _this$props9.selectable,
|
|
268
|
+
selected = _this$props9.selected,
|
|
269
|
+
actions = _this$props9.actions;
|
|
319
270
|
var isPersistent = mediaType === 'doc' || !dataURI;
|
|
320
271
|
return /*#__PURE__*/_react.default.createElement(_cardOverlay.CardOverlay, {
|
|
321
272
|
cardStatus: status,
|
|
@@ -331,17 +282,17 @@ var FileCardImageViewBase = /*#__PURE__*/function (_Component) {
|
|
|
331
282
|
return _this;
|
|
332
283
|
}
|
|
333
284
|
|
|
334
|
-
(0, _createClass2.default)(
|
|
285
|
+
(0, _createClass2.default)(FileCardImageView, [{
|
|
335
286
|
key: "render",
|
|
336
287
|
value: function render() {
|
|
337
|
-
var _this$
|
|
338
|
-
disableOverlay = _this$
|
|
339
|
-
selectable = _this$
|
|
340
|
-
selected = _this$
|
|
341
|
-
mediaType = _this$
|
|
342
|
-
progress = _this$
|
|
343
|
-
status = _this$
|
|
344
|
-
mediaName = _this$
|
|
288
|
+
var _this$props10 = this.props,
|
|
289
|
+
disableOverlay = _this$props10.disableOverlay,
|
|
290
|
+
selectable = _this$props10.selectable,
|
|
291
|
+
selected = _this$props10.selected,
|
|
292
|
+
mediaType = _this$props10.mediaType,
|
|
293
|
+
progress = _this$props10.progress,
|
|
294
|
+
status = _this$props10.status,
|
|
295
|
+
mediaName = _this$props10.mediaName;
|
|
345
296
|
return /*#__PURE__*/_react.default.createElement(_styled.Wrapper, {
|
|
346
297
|
"data-testid": "media-file-card-view",
|
|
347
298
|
"data-test-media-name": mediaName,
|
|
@@ -358,9 +309,9 @@ var FileCardImageViewBase = /*#__PURE__*/function (_Component) {
|
|
|
358
309
|
}, {
|
|
359
310
|
key: "isFileCardImageReadyForDisplay",
|
|
360
311
|
get: function get() {
|
|
361
|
-
var _this$
|
|
362
|
-
dataURI = _this$
|
|
363
|
-
status = _this$
|
|
312
|
+
var _this$props11 = this.props,
|
|
313
|
+
dataURI = _this$props11.dataURI,
|
|
314
|
+
status = _this$props11.status;
|
|
364
315
|
return !!dataURI || !['loading', 'processing', 'loading-preview'].includes(status);
|
|
365
316
|
}
|
|
366
317
|
}, {
|
|
@@ -376,13 +327,11 @@ var FileCardImageViewBase = /*#__PURE__*/function (_Component) {
|
|
|
376
327
|
return resizeMode === 'stretchy-fit';
|
|
377
328
|
}
|
|
378
329
|
}]);
|
|
379
|
-
return
|
|
330
|
+
return FileCardImageView;
|
|
380
331
|
}(_react.Component);
|
|
381
332
|
|
|
382
|
-
exports.
|
|
383
|
-
(0, _defineProperty2.default)(
|
|
333
|
+
exports.FileCardImageView = FileCardImageView;
|
|
334
|
+
(0, _defineProperty2.default)(FileCardImageView, "defaultProps", {
|
|
384
335
|
resizeMode: 'crop',
|
|
385
336
|
disableOverlay: false
|
|
386
|
-
});
|
|
387
|
-
var FileCardImageView = (0, _analyticsNext.withAnalyticsEvents)()((0, _fileAttributesContext.withFileAttributes)(FileCardImageViewBase));
|
|
388
|
-
exports.FileCardImageView = FileCardImageView;
|
|
337
|
+
});
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.Wrapper = exports.Title = exports.ProgressWrapper = exports.ProgressBarWrapper = exports.PlayIconWrapper = exports.PlayIconBackground = exports.Overlay = exports.CardActionsWrapper = exports.Body = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
package/dist/cjs/files/index.js
CHANGED
|
@@ -9,11 +9,5 @@ Object.defineProperty(exports, "FileCardImageView", {
|
|
|
9
9
|
return _cardImageView.FileCardImageView;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "FileCardImageViewBase", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _cardImageView.FileCardImageViewBase;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
|
|
19
13
|
var _cardImageView = require("./cardImageView");
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,16 +9,22 @@ Object.defineProperty(exports, "Card", {
|
|
|
9
9
|
return _root.Card;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "CardError", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _cardError.CardError;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "CardLoading", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function get() {
|
|
15
21
|
return _cardLoading.CardLoading;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "MediaInlineCard", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
21
|
-
return
|
|
27
|
+
return _root.MediaInlineCard;
|
|
22
28
|
}
|
|
23
29
|
});
|
|
24
30
|
Object.defineProperty(exports, "defaultImageCardDimensions", {
|
|
@@ -27,16 +33,16 @@ Object.defineProperty(exports, "defaultImageCardDimensions", {
|
|
|
27
33
|
return _cardDimensions.defaultImageCardDimensions;
|
|
28
34
|
}
|
|
29
35
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "fileCardImageViewSelectedSelector", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function get() {
|
|
33
|
-
return _cardImageView.
|
|
39
|
+
return _cardImageView.fileCardImageViewSelectedSelector;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "fileCardImageViewSelector", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function get() {
|
|
39
|
-
return _cardImageView.
|
|
45
|
+
return _cardImageView.fileCardImageViewSelector;
|
|
40
46
|
}
|
|
41
47
|
});
|
|
42
48
|
Object.defineProperty(exports, "inlinePlayerClassName", {
|
|
@@ -3,33 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.relevantFeatureFlagNames = exports.fireScreenEvent = exports.fireOperationalEvent = exports.fireCopiedEvent = exports.fireCommencedEvent = void 0;
|
|
7
7
|
|
|
8
8
|
var _analytics = require("../../utils/analytics");
|
|
9
9
|
|
|
10
|
-
var relevantFeatureFlagNames = ['newCardExperience', '
|
|
10
|
+
var relevantFeatureFlagNames = ['newCardExperience', 'captions'];
|
|
11
11
|
exports.relevantFeatureFlagNames = relevantFeatureFlagNames;
|
|
12
12
|
|
|
13
|
-
var fireOperationalEvent = function fireOperationalEvent(createAnalyticsEvent, status, fileAttributes, performanceAttributes) {
|
|
14
|
-
var _ref = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {},
|
|
15
|
-
cardPreview = _ref.cardPreview,
|
|
16
|
-
error = _ref.error;
|
|
17
|
-
|
|
13
|
+
var fireOperationalEvent = function fireOperationalEvent(createAnalyticsEvent, status, fileAttributes, performanceAttributes, error) {
|
|
18
14
|
var fireEvent = function fireEvent(payload) {
|
|
19
15
|
return (0, _analytics.fireMediaCardEvent)(payload, createAnalyticsEvent);
|
|
20
16
|
};
|
|
21
17
|
|
|
22
18
|
switch (status) {
|
|
23
19
|
case 'complete':
|
|
24
|
-
|
|
25
|
-
* A Card that is considered Complete and has no preview,
|
|
26
|
-
* reflects an expected behaviour, and thus a legitimate
|
|
27
|
-
* success case to be logged.
|
|
28
|
-
*/
|
|
29
|
-
if (!(cardPreview !== null && cardPreview !== void 0 && cardPreview.dataURI)) {
|
|
30
|
-
fireEvent((0, _analytics.getRenderSucceededEventPayload)(fileAttributes, performanceAttributes));
|
|
31
|
-
}
|
|
32
|
-
|
|
20
|
+
fireEvent((0, _analytics.getRenderSucceededEventPayload)(fileAttributes, performanceAttributes));
|
|
33
21
|
break;
|
|
34
22
|
|
|
35
23
|
case 'failed-processing':
|
|
@@ -62,4 +50,10 @@ var fireCopiedEvent = function fireCopiedEvent(createAnalyticsEvent, fileId, car
|
|
|
62
50
|
}
|
|
63
51
|
};
|
|
64
52
|
|
|
65
|
-
exports.fireCopiedEvent = fireCopiedEvent;
|
|
53
|
+
exports.fireCopiedEvent = fireCopiedEvent;
|
|
54
|
+
|
|
55
|
+
var fireScreenEvent = function fireScreenEvent(createAnalyticsEvent, fileAttributes) {
|
|
56
|
+
(0, _analytics.fireMediaCardEvent)((0, _analytics.getRenderPreviewableCardPayload)(fileAttributes), createAnalyticsEvent);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exports.fireScreenEvent = fireScreenEvent;
|